Commit Graph

60 Commits

Author SHA1 Message Date
Levi Neely 4dbfccf189 mail archive search 2026-03-19 08:45:27 +01:00
Levi Neely 6791d42a3e archive: re-read date from window name on Get 2026-03-18 17:27:57 +01:00
Levi Neely a5bf4a8397 Assist: archive window reads from mail history
- Archive tag accepts YYYYMMdd date (defaults to today)
- Loads messages from ~/.local/share/anvillm/mail/{date}-*.jsonl
- Shows both sent and received with From/To columns
- Inbox '- <id>' now deletes instead of archiving
2026-03-18 17:18:15 +01:00
Levi Neely b03324baaf beads: add deferred filter endpoint
Add /beads/deferred aggregate endpoint and per-mount /beads/<mount>/deferred
endpoint to list beads with status=deferred.

- internal/p9/beads.go: add readDeferredFromStore and readDeferredAggregate
- internal/p9/server.go: wire up deferred in walk, directory listings
- cmd/Assist: update listBeadsWithFilter to use deferred endpoint
2026-03-18 17:02:32 +01:00
Levi Neely aab91394a2 Assist: add Deferred/Ready/All filter buttons to Tasks window
- Deferred: shows only deferred status tickets
- Ready: shows open and in_progress tickets
- All: shows everything (default)
2026-03-18 15:03:50 +01:00
Levi Neely 2f55509e2c Assist: refresh Tasks window after Put edits 2026-03-16 11:24:23 +01:00
Levi Neely 2d908c6dcd Assist: add Comment tag to leave comments on beads
- Add Comment tag to bead view window tagline
- New /AnviLLM/Tasks/{bead-id}/comment window with Put handler
- Fix comments display: JSON field is 'text' not 'body'
2026-03-16 11:23:46 +01:00
Levi Neely 6ea87e1810 Assist: remap bead prefixes, add open/defer; orphan: skip user-claimed
Tasks window Put handler prefix changes:
  ~ → c  (claim)
  ^ → u  (unclaim)
  o      (open/promote deferred)
  d      (defer)
  x, f, -, + unchanged

Orphan check now skips beads claimed by "user" — human-held beads
are not orphans.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 21:21:25 +01:00
Levi Neely d76ccf4979 mcptools: convert all positional args to named flags
Every argument in every mcptools script is now a named flag (--mount,
--id, --agent-id, --session-id, --cwd, --child, --repo, --ticket, etc.).
No positional arguments remain. SKILL.md files updated to match.

Also updates cmd/Assist/main.go to pass --cwd flag to mount_beads.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:41:25 +01:00
Levi Neely 021b1b8221 mount_beads: drop friendly name, UUID is the mount name
Simplify: the optional friendly name parameter is removed. UUID first
segment is always the mount name; mtab provides the path mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:24:20 +01:00
Levi Neely 6cd4c450b1 Assist: read mount_beads.sh via 9p client instead of shelling out
Use readFile() to fetch the script over the existing 9p connection,
then pipe it to bash -s. Removes dependency on the 9p CLI binary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:09:16 +01:00
Levi Neely bede87b619 Assist: delegate mountProject to mount_beads.sh mcptool
Replace direct beads/ctl write with mount_beads.sh subprocess call.
UUID-based mount names are now generated by the script; the returned
name is captured and used as windowMount. Optional friendly name is
passed through for display only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:07:15 +01:00
Levi Neely 2a1d620a31 rename 9P endpoint from 'agent' to 'anvillm'
- Update socket path, MountService calls, path prefixes
- Update mcptools, scripts, docs, diagrams, services
- Fix idleSince initialization at session creation
2026-03-12 12:13:40 +01:00
Levi Neely 46da046fb3 tmux: remove FIFO plumbing, fix per-window metadata
- Remove dead streaming code: reader(), waitForReady(), StartupHandler, pipe-pane
- Switch recovery metadata from session-scoped set-environment to window-scoped set-option -w @key
- Sessions now start in idle state immediately (no startup wait)
2026-03-12 11:47:37 +01:00
Levi Neely 39b49e83ce beads: reduce context overflow, simplify filters, atomic blockers
- list_beads.sh/list_ready_beads.sh: filter to id,priority,title,status
- Add read_bead_comments.sh tool and Comments view in Assist
- Simplify Assist filters to All/Ready (was 6 status filters)
- Server-side filtering: list excludes closed at DB, ready uses GetReadyWork
- Default limit 100, DB-level filtering
- Atomic blockers= support in new command
2026-03-11 09:45:20 +01:00
Levi Neely 3896b3db43 Assist: add Comments view for beads; add read_bead_comments.sh tool 2026-03-11 09:07:05 +01:00
Levi Neely 919335a271 conductor: adaptive delegation based on available staff
- roles/conductor.md: discover roster before planning; adapt workflow
  to available roles (dev-only, dev+review, dev+review+test, etc.);
  drive iterative cycles; parallelize across multiple same-role bots;
  report skipped phases instead of blocking on missing roles

- team-templates/debug: new workflow with conductor+developer+tester;
  blocks until all roles are idle before returning

- list format: replace model field with role (field 5) in agent/list;
  update Assist, anvillm, anvilwebgw, list_sessions.sh accordingly

- Assist /AnviLLM/: replace Model column with Role in session list
2026-03-07 17:24:40 +01:00
Levi Neely d0c596dcaa Add mail_history.sh script for parsing agent message history 2026-03-05 17:08:55 +01:00
Levi Neely c0d09125ca Add backend-specific handlers for clear, compact, resume commands
- Add ClearHandler, CompactHandler, ResumeHandler callbacks to tmux.Config
- kiro-cli: clear/resume need 250ms delay + confirmation key
- claude: clear/compact are simple /command[ENTER], resume not implemented
- Add Resume tag and handler to Assist prompt window
- Update server.go to use new Session methods
2026-03-05 09:41:05 +01:00
Levi Neely e3a63dedd8 tmux backend and p9 server improvements 2026-03-05 09:32:07 +01:00
Levi Neely 33026360b3 Assist: reset view to top after refreshing window content
Add w.Addr("0")/dot=addr/show after content writes in refreshList,
refreshMailboxWindow, refreshDaemonWindow, and refreshViewBeadWindow
so windows no longer scroll to the bottom on open or refresh.

Closes anv-hww

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 18:42:07 +01:00
Levi Neely 95efd907fb Add frontend support for mountable beads and remove global mount state
- Add mount management UI to all frontends (anvillm TUI, Assist, anvilwebgw, anvillm.el)
- Mount commands default to directory basename if name not specified
- Server validates directory exists before mounting
- Umount accepts either mount name or cwd path
- Fix server bug: all beads operations now use mount-specific store
- Remove currentMount global - all operations require explicit mount parameter
- Each Tasks window tracks its own windowMount independently
- Bead detail windows receive mount from parent window
- When no mounts exist, show instructions to mount a project
- When unmounting current mount, switch to first available or show empty state
- Mount validation: Select command checks mount exists before switching
- Database path: ~/.beads/<cwd-hyphenated> to prevent cross-contamination
2026-02-28 13:35:46 +01:00
Levi Neely cbace3407c Update changes 2026-02-27 12:12:08 +01:00
Levi Neely 0b612aa0cc Add logging.Init() to all cmd programs
- anvilwebgw: init logging in startCmd
- anvilweb: init logging in main
- anvillm: init logging in main
- Assist: init logging in main

Each program now creates its own timestamped log file
2026-02-27 11:51:50 +01:00
Levi Neely 2418f12012 Fix review findings from code review
- Include model in session list output (eliminates N+1 reads)
- Add jq error handling in Supervisor dispatch_ready_beads
- Use process substitution in Supervisor to avoid subshell variable scope
- Fix claude backend Execute to return error (commands go through PTY)
- Make createSubtask return childID (eliminates duplicate O(n) scan)

Fixes: bd-1z2, bd-73r, bd-cid, bd-viu, bd-vdi
2026-02-26 12:05:28 +01:00
Levi Neely 5bcaa38ad7 cost / usage optimization, phase 1 2026-02-25 19:17:50 +01:00
Levi Neely 065e4a3295
Add bulk-archive via inline Put notation to inbox and archive windows (#12)
* Add inline Put actions for sessions and tasks windows

Introduce a Put command to both the sessions list and tasks windows,
allowing inline edits via prefixed annotations in the body:

Sessions (cmd/Assist/main.go):
  - `- <id>`              Kill session
  - `~ <id>`              Stop session (graceful)
  - `@ <id> <alias>`      Set alias on session
  - `+ <backend> <path> [alias]`  Start new session

Tasks (cmd/Assist/main.go + internal/p9/beads.go):
  - `- [idx]`   Delete bead
  - `~ [idx]`   Claim bead as user
  - `^ [idx]`   Unclaim bead (clear assignee, reset to open)
  - `x [idx]`   Complete bead
  - `f [idx]`   Fail bead
  - `+ <title>` Create new bead with title pre-filled

Also adds `unclaim` ctl command to BeadsFS and helper functions:
claimBeadAsUser, unclaimBead, completeBead, failBead,
openNewBeadWindowWithTitle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add [Failed] [PendingReview] [PendingApproval] filters to tasks window

Extends the tasks window filter bar with three new status filters:

- [Failed]          closed beads whose close_reason != "completed"
- [PendingReview]   beads with status "pending_review"
- [PendingApproval] beads with status "pending_approval"

Implementation details:
- Add CloseReason field (json:"close_reason") to Bead struct so
  fail-vs-complete distinction is available after JSON decode.
- listBeadsWithFilter: add "failed" special case (closed beads with
  non-"completed" close_reason); "pending_review" and
  "pending_approval" fall through the existing status equality path.
- handleTasksWindow: wire Failed/PendingReview/PendingApproval cases
  to set statusFilter and refresh the list.
- refreshTasksWindowWithBeads: update filter bar header line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add bulk-archive via inline Put notation to inbox and archive windows

In the inbox window, lines prefixed with "- <shortID>" are parsed on Put
and each matching message is archived (moved to completed). In the archive
window the same notation permanently deletes the message from the archive.

Adds: parseMailEdits, mailEdit type, deleteArchivedMessage in Assist;
DeleteFromCompleted in mailbox.Manager; "delete <msg-id>" command on
user/ctl in the p9 server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 19:58:37 +01:00
Levi Neely 45e495a975
Add requires_approval and requires_review flags to bead UI across all frontends (#10)
Implements bd-258: display and toggle of requires_approval / requires_review
boolean flags in all four AnviLLM frontends. Flags are backed by labels
(requires_approval, requires_review) on each bead, read from the labels
array in bead JSON and toggled via label/unlabel ctl commands.

- Acme: adds Labels/HasLabel to Bead struct; shows flags in frontmatter;
  updateBead parses and applies label/unlabel on Put
- TUI: showBead displays flags (green when set); edit dialog adds two
  checkboxes that toggle labels on save
- Web: detail view shows flag status with Set/Unset buttons; new
  toggleBeadFlag() function calls beads ctl API and refreshes
- Emacs: detail buffer shows flag lines; A/R keybindings invoke new
  anvillm-bead-toggle-approval and anvillm-bead-toggle-review commands

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 18:13:12 +01:00
Levi Neely db501cca26
Add approval/rejection flags and actions to tasks UI (#9)
* Add approval/rejection flags and actions to tasks UI

Adds visual flags for APPROVAL_REQUEST and REVIEW_REQUEST messages across
all UI frontends (Acme, TUI, web, Emacs), with one-click approve/reject
actions and inferred reply type mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Auto-archive messages on approve or reject across all UIs

After an approval or rejection response is sent, the original inbox
message is now automatically completed/archived in all four frontends:

- Acme: handleReplyWindow gains an originalMsgID param; approve/reject
  windows pass the message ID so the original is archived on Send
- TUI: already archived via completeInboxMessage in approveMessage /
  rejectMessage — no change needed
- Web: approveCurrentMessage archives after reply succeeds; rejectCurrent-
  Message sets pendingArchiveId so the reply-form submit handler archives
  on send
- Emacs: anvillm-inbox-approve and anvillm-inbox-reject write "complete
  <id>" to user/ctl and refresh the inbox after sending the response

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:38:23 +01:00
Levi Neely 9d0e9b7e42 Add ollama backend support
- Add ollama backend implementation using mcphost and ollie
- Add ollama.yaml sandbox configuration
- Update README with ollama installation and usage instructions
- Add ollama command to Assist, anvilmcp, and anvilsrv
- Add ANVILLM_OLLAMA_MODEL environment variable
- Hardcode ollama-mcp.json config path to ~/.config/anvillm/ollama-mcp.json
2026-02-21 21:03:55 +01:00
Levi Neely dd6528bfee fix 2026-02-21 10:35:45 +01:00
Levi Neely 4257e6595d fix 2026-02-21 10:33:06 +01:00
Levi Neely 1aa3010200 Add status filter buttons to Tasks window
- Filter out closed tasks by default
- Add [Open] [InProgress] [Closed] filter buttons
- Maintain filter state during window session
- Position window at top after refresh
2026-02-21 10:31:20 +01:00
Levi Neely bf8c0d7cdb improve bead id special case "fire-forget" prompt 2026-02-20 19:05:06 +01:00
Levi Neely 5854f95f9b Assist: Add Tasks window for beads task management
- Tasks window with sorted list, blocker count column, index for navigation
- View window with frontmatter (title, status, blockers), Put saves changes
- New window with blockers field for setting deps on create
- Hierarchical subtask IDs (bd-s2r.1) via parent-id parameter
- Blocks tag for quick dependency add via selection
- Remove tag for deleting beads via chord
- beads/ctl commands: new, update, delete, dep, undep
- beads/{id}/json includes blockers array
- Fixed parseQuotedArgs to preserve empty quoted strings
- Fixed escape sequence handling in descriptions
2026-02-20 10:13:53 +01:00
Levi Neely b2502b3f5a Inbox/Archive: session ID arg, short UUID display, timestamp column, sort by date 2026-02-19 16:54:18 +01:00
Levi Neely d3f1d67547 Add Archive window, UUID-based message lookup, fix backend column in list 2026-02-19 16:39:43 +01:00
Levi Neely 4b87a7795f Assist: reuse existing terminal for tmux attach
- Check for existing tmux clients before launching new terminal
- Use 'tmux switch-client' to reuse existing terminal window
- Fall back to new terminal only when no client is attached
2026-02-18 16:31:21 +01:00
Levi Neely b8013b1b87 Assist: middle-click session ID attaches to tmux
- Middle-click on session ID without selection now attaches to tmux session
- Preserves existing fire-and-forget prompt behavior when text is selected
- Same functionality as 'Attach {session-id}' command
2026-02-18 16:26:21 +01:00
Levi Neely 937ad83e97 Remove deprecated endpoints and fix mailbox auto-completion
- Fix PROMPT_RESPONSE messages not auto-completing
- Remove deprecated message types (LogInfo, LogError, StatusUpdate)
- Remove entire chat log system (replaced by audit log)
- Migrate user prompts to mailbox system in main.go
- Remove {id}/in and {id}/out 9P endpoints
- Only mail processor uses sess.Send() directly
- Fix file index constants after removing in/out files
- Remove unused SendCtl function
2026-02-17 23:06:07 +01:00
Levi Neely b199fb23dc Remove Sandbox configuration window from Assist
- Remove Sandbox button from main window tag
- Remove Sandbox case handler and related functions
- Remove sandbox package import
- Delete internal/ui/sandbox.go

The Sandbox window is no longer needed as sandbox configuration
has been split into layered configuration (global, backends, roles, tools).
2026-02-17 22:18:02 +01:00
Levi Neely ff2bd372c1 improve send message api 2026-02-17 18:20:01 +01:00
Levi Neely a069a98ccc Add Archive button to Acme inbox message windows
- Added Archive to message window tag line
- Archive writes 'complete <msg-id>' to user/ctl
- Window closes after successful archive
- Added ID field to Message struct
- Added error handling for archive failures
2026-02-17 17:28:52 +01:00
Levi Neely d35e884a54 Add Reply functionality to inbox message windows 2026-02-17 16:37:04 +01:00
Levi Neely 45356673ec Update mailbox message types and validation 2026-02-17 16:32:20 +01:00
Levi Neely b66e9822a2 Fix attach for new tmux session naming and clean up emacs prompts
Front-ends were constructing anvillm-{backend} but backend now uses
anvillm-{namespace}. Updated Assist and emacs to read tmux target from
the tmux file instead of constructing it from backend name.

Also removed broken direct prompt functionality from emacs (P and M-P
keybindings that used /in file directly).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 15:32:48 +01:00
Levi Neely a856da7a34 Remove Prompt command, use only Send via outbox 2026-02-17 14:52:08 +01:00
Levi Neely 27f6a48411 Reapply "Fix Assist to use mailbox system instead of direct 'in' file writes"
This reverts commit 8a9ce2c9e1.
2026-02-17 14:50:10 +01:00
Levi Neely 8a9ce2c9e1 Revert "Fix Assist to use mailbox system instead of direct 'in' file writes"
This reverts commit bdd0039eba.
2026-02-17 14:49:12 +01:00
Levi Neely 35b3ff338e Fix 9p-read-inbox to strip .json extension when marking messages complete 2026-02-17 14:37:46 +01:00