* 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>
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>
* 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>
Initialize sessions slice as empty array instead of nil to ensure
JSON encoding returns [] instead of null when no sessions exist.
This prevents JavaScript iteration errors in the web frontend.
Replaces the TTL-based event queue (internal/events) with a proper
in-memory pub-sub bus (internal/eventbus) backed by simonfxr/pubsub.
The agent/events 9P endpoint is now a streaming subscriber: clients
block on reads and receive one JSON-encoded event per read until they
disconnect. Each open(2) creates a per-connection subscription; clunk
and connection teardown cancel it automatically.
- internal/eventbus/bus.go: new package wrapping simonfxr/pubsub;
provides Publish(agent, type, data) and Subscribe() -> (chan, cancel)
- internal/events/events.go: deleted
- internal/session/manager.go: SetEventQueue -> SetEventBus; all
publish sites updated to use eventbus constants
- internal/p9/server.go: fid gains eventCh/eventUnsub fields; Topen
subscribes, Tread blocks on channel, Tclunk/serve-defer cancel
- cmd/anvilsrv/main.go: wired to SetEventBus
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New cmd/anvilwebgw: standalone HTTP gateway daemon with start/stop/fgstart/status
subcommands, exposing all 9P-connected API endpoints on :8081
- cmd/anvilweb simplified to a plain static file server that reverse-proxies
/api/* to anvilwebgw; removes all 9P connectivity
- Frontend error handling overhauled: replace alert() with styled dismissible
error banner and inline container errors showing actual server response detail
- Fix CSS specificity bug that kept error banner always visible
- Fix nil slice JSON encoding (null vs []) for empty inbox/archive responses
- mkfile: add anvilwebgw build and clean targets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Filter out closed tasks by default
- Add [Open] [InProgress] [Closed] filter buttons
- Maintain filter state during window session
- Position window at top after refresh
- 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
- Wire all state changes in tmux session to use transitionToLocked (triggers OnStateChange)
- Close() exited state
- Refresh() stopped states (intentional stop, restart spam prevention, auto-restart failure, PID=0)
- Add event callbacks to mailbox manager for send/receive events
- Callbacks fire when message removed from outbox (send) and delivered to inbox (receive)
- Consistent with state change callback pattern
- Fix /events 9p read handler to respect offset/count
- Prevents infinite read loop by properly signaling EOF
- Uses readFile() pattern like /list for consistency
- Parse JSON and format as: [Message from X] / Type / Subject / Body
- Makes it clear who the sender is for replying
- Matches original 9p-read-inbox behavior
- Read only first message (not all messages)
- Automatically mark message as complete after reading
- Matches behavior of original 9p-read-inbox script
- Allows setting agent state via MCP (idle, running, stopped, etc.)
- Validates state values via enum in schema
- Enables agent hooks to update their own state
- Implements MCP protocol server that translates to 9p operations
- Three tools: read_inbox, send_message, list_sessions
- Uses plan9port 9p client for filesystem operations
- Debug logging to stderr, JSON-RPC on stdout
- Enables MCP clients to interact with anvilsrv daemon
- 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
- 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
- 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
- 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).
- Created internal/audit package for centralized logging
- Replaced per-session log files with single agent/audit file
- Updated all UIs (TUI, web, Emacs) to use centralized audit log
- Modified mailbox manager to log all message deliveries with aliases
- Updated Alog script to stream centralized audit log
- Removed session-specific log streaming in favor of global audit log
- 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
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>
- cmd/anvillm: Added sendPrompt() using user/outbox
- cmd/anvilweb: Updated sendPrompt() to write to user/outbox
- elisp/anvillm.el: Changed to write JSON messages to user/outbox
- All UIs now queue prompts non-blocking via mailbox system
- Resolves blocking issue across all interfaces
- Changed sendPrompt() to write JSON messages to user/outbox
- Messages now queue and deliver when session is idle (non-blocking)
- Fixed prompt window to stay open on send error
- Resolves blocking issue when bot is busy
- Fix Attach button to launch foot terminal with tmux attach
- Add tmux file to 9P server to expose session:window target
- Replace action buttons with cleaner layout: main actions visible,
secondary actions in dropdown menu
- Add browser notifications for session state changes
- Preserve open dropdown menu across table refresh
- Remove disabled state from Prompt button (mailbox queues prompts)