Commit Graph

21 Commits

Author SHA1 Message Date
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 a28cf13cae Add anvilwebgw HTTP gateway service, simplify anvilweb
- 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>
2026-02-22 09:01:23 +01:00
Levi Neely 5a212793c3 ui parity 2026-02-21 13:57:05 +01:00
Levi Neely c6987a7962 Remove deprecated audit endpoint
- Remove audit endpoint routes from 9P filesystem
- Delete audit handler functions (readAuditLog, GetAuditLog)
- Remove audit package and all audit logging code
- Remove audit log viewer from TUI (anvillm)
- Remove audit log streaming from web UI (anvilweb)
- Update documentation to reference events system instead
- All audit functionality replaced by events system
2026-02-20 22:18:53 +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 314d347e76 Add centralized audit log system
- 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
2026-02-17 22:07:39 +01:00
Levi Neely ff2bd372c1 improve send message api 2026-02-17 18:20:01 +01:00
Levi Neely 53bf135d01 Add dynamic inbox refresh to anvilweb
- Inbox badge updates every 5 seconds automatically
- Messages view auto-refreshes every 5 seconds when inbox tab is visible
- Archive buttons trigger immediate inbox refresh
- Fixed backend to return empty array instead of null for empty inbox
- Added user/ctl endpoint for completing messages
2026-02-17 17:19:53 +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
Levi Neely 241e4b9818 Fix all UIs to use mailbox system for prompt sending
- 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
2026-02-17 11:10:14 +01:00
Levi Neely c1b3f525da anvilweb: fix attach button, improve UI
- 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)
2026-02-16 16:41:58 +01:00
Levi Neely 37f38aa6d6 anvilweb: sortable data columns 2026-02-16 09:36:51 +01:00
Levi Neely e88d91c78d Fix: Enable Restart button for all session states in web interface
The Restart button was incorrectly disabled for non-stopped sessions.
Since restart performs both stop and start actions, it should work
for any session state, similar to the Kill button.

Removed the conditional disabled state from the Restart button.
2026-02-15 11:39:08 +01:00
Levi Neely f278b55276 Add streaming log viewer to web interface
- Added /api/log/{sessionId} endpoint for SSE streaming
- Backend streams log file via 9P with proper SSE formatting
- Each log line sent as separate SSE message for protocol compliance
- Frontend displays log in terminal-like pane (black bg, white text)
- Log button added to each session in the table
- Auto-scrolls to bottom as new data arrives
- Stream automatically closes when log pane is closed
- Context cancellation properly closes 9P file handle

All three interfaces (Acme, Emacs, TUI, Web) now support log viewing
with appropriate streaming/refresh strategies for their execution models.
2026-02-15 11:35:09 +01:00
Levi Neely c073c3681a Improve anvilweb UI spacing and header styling
- Add vertical space above search box
- Style header as colored bar with white text
- Reduce header size and spacing for cleaner look
- Remove redundant subtitle text
2026-02-14 17:35:42 +01:00
Levi Neely 93f41389ca Add search box to anvilweb sessions list
- Filters sessions in real-time across all fields (alias, ID, state, backend, cwd, PID)
- Case-insensitive substring matching
- Uses event delegation for consistency with existing code
- Search persists during auto-refresh
2026-02-14 17:32:07 +01:00
Levi Neely ad7ae77820 anvilweb: improve UI with session IDs, state colors, and modal dialog
- Add session ID column (2nd position) with monospace styling
- Add color-coded state badges for all states (idle=green, running=blue, starting=orange, stopped=gray, error=red, exited=light gray)
- Convert New Session form to compact modal dialog
- Fix XSS vulnerability by replacing inline onclick handlers with data attributes and event delegation
2026-02-14 17:26:56 +01:00
Levi Neely bbd612680e Improve web UI usability
- Sort sessions alphabetically by alias/name (case-insensitive)
- Move New Session form below sessions table (view then act)
- Fix dialog buttons: right-aligned, [Send/Save] [Cancel] order (desktop convention)
- All changes client-side only, no API modifications
2026-02-14 17:16:18 +01:00
Levi Neely 9b4ac416d9 Convert session list to table layout
- Replace card-based layout with HTML table (Nomad-style)
- Columns: Alias, State, Backend, Working Directory, PID, Actions
- Inline action buttons for compact display
- Better scalability for many sessions
- All functionality preserved, XSS protections maintained
2026-02-14 17:09:32 +01:00
Levi Neely 38f3a8e765 Add web interface (anvilweb)
- Minimal Go web server with REST API for session management
- Single-page UI using Pico CSS (12KB, classless framework)
- Features: create sessions, send prompts, edit context/alias, control sessions
- Security: input validation, XSS prevention, path validation
- Auto-refresh every 5 seconds
- Documented security model (no authentication, localhost/SSH tunneling recommended)
2026-02-14 17:02:43 +01:00