hephaestus/heph.nvim/lua/heph/config.lua
Erich Blume b97c387252
Some checks failed
Build / validate (pull_request) Failing after 3s
heph.nvim: context-item promotion + Dagger headless-nvim CI (slice 11c)
Backend (TDD):
- task.promote {container_id, item_ref, attention?, project?}: mint a committed
  task from the item_ref-th `- [ ]` context item (1-based, document order via a
  new extract::context_item_lines) and rewrite that source line into a [[link]]
  to it. Unit + rpc_socket tests.
- resolve_id now excludes canonical-context docs, so [[Task Title]] resolves to
  the task, not its identically-titled context doc (deterministic; a general fix
  surfaced by promotion's ULID-tiebreak ambiguity).

Plugin: :Heph promote / promote_under_cursor (save-if-dirty → compute item index
with a code-fence-aware scanner mirroring extract.rs → task.promote → reload the
rewritten buffer). e2e spec (f): promote a context line, assert the new task in
next, the source line became a link, and the container backlinks the task.

CI via Dagger: a test_nvim function bakes a pinned, arch-detected Neovim
(v0.11.2 — Debian's is too old for vim.uv) onto rust:1-bookworm, builds hephd,
and runs the self-contained shim suite (cargo + target cache volumes);
build.yaml calls `dagger call test-nvim`. run.lua now fails on zero specs (no
false-green). Validated end-to-end: passing suite → exit 0, failing spec →
Dagger exit 1.

117 Rust tests + 7 nvim e2e specs green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 06:08:41 -07:00

50 lines
1.6 KiB
Lua

--- Configuration defaults, socket resolution, and default keymaps.
local M = {}
M.defaults = {
--- Path to hephd's unix socket. `nil` → resolved to the daemon default.
socket = nil,
--- Spawn a local hephd if the socket is not ready (off by default in v1).
autostart = false,
--- hephd binary for autostart.
bin = "hephd",
--- Set the default `<leader>h*` keymaps. `false` to opt out.
keymaps = true,
}
--- Resolve the socket path, mirroring hephd's `default_socket_path`:
--- `$XDG_RUNTIME_DIR/heph/hephd.sock`, falling back to the temp dir.
function M.resolve_socket(opt)
if opt and #opt > 0 then
return opt
end
local xdg = vim.env.XDG_RUNTIME_DIR
local base = (xdg and #xdg > 0) and xdg or (vim.env.TMPDIR or "/tmp")
return (base:gsub("/+$", "")) .. "/heph/hephd.sock"
end
--- Apply the default keymaps (no-op when `opts.keymaps` is false).
function M.apply_keymaps(opts)
if not opts.keymaps then
return
end
local map = vim.keymap.set
map("n", "<leader>hj", function()
require("heph.journal").open()
end, { desc = "heph: today's journal" })
map("n", "<leader>hn", function()
require("heph.view").next()
end, { desc = "heph: what is next (Tactical)" })
map("n", "<leader>hl", function()
require("heph.view").list()
end, { desc = "heph: task list (Organizational)" })
map("n", "<leader>hd", function()
require("heph.task").set_state_current("done")
end, { desc = "heph: mark current task done" })
map("n", "<leader>hp", function()
require("heph.task").promote_under_cursor()
end, { desc = "heph: promote context item to a task" })
end
return M