Commit Graph

24 Commits

Author SHA1 Message Date
Levi Neely 8fe92c1182 Fix uneven columns in Assist main window
Change ID column width from 5 to 8 chars to match session ID length.
2026-02-16 14:46:48 +01:00
Levi Neely 37f38aa6d6 anvilweb: sortable data columns 2026-02-16 09:36:51 +01:00
Levi Neely 851ac311b0 remove acme log window in favor of external script 2026-02-15 13:22:12 +01:00
Levi Neely b47f6ba97d Add Log command to Acme interface
Opens streaming log window that displays session chat history.
Window is named /AnviLLM/Log.{session-id-or-alias} and streams
log data continuously, marking window as clean after each write.
2026-02-15 12:09:14 +01:00
Levi Neely ab5f9705cd Remove redundant Refresh command from Acme interface
Get command now simply reads from agent/list since anvilsrv
handles session state management. Removed client-side PID
checking and refresh logic.
2026-02-15 11:47:11 +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 7588fce349 Add log viewer to TUI with manual refresh
- Press 'l' to view session log in scrollable pane
- Press 'r' within log viewer to refresh
- Press 'q' or ESC to close
- Log window scales to 80% of terminal width
- Automatically scrolls to bottom on open
- Non-blocking read prevents hang on streaming log file
2026-02-15 11:10:32 +01:00
Levi Neely bef457a3aa Qualify tmux sessions per-namespace
- Extract namespace suffix (e.g., '0' from '/tmp/ns.user.:0/')
- Append suffix to tmux session names (e.g., 'anvillm-kiro-cli-0')
- Allows multiple namespace instances to coexist without conflicts
- Updated backend constructors to accept namespace suffix parameter
2026-02-14 18:35:35 +01:00
Levi Neely 452fc41ea5 basic self-healing 2026-02-14 17:51:28 +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
Levi Neely c367b05a2e remove autostart notification daemon; rely on prompting for this 2026-02-14 14:35:57 +01:00
Levi Neely a7076b5cce feat: improve TUI with unified backend menu, vim/emacs nav, and better styling
Enhancements to anvillm TUI:
- Unified backend selection: 's' key shows menu (claude/kiro-cli)
- Changed stop from 's' to 't' to avoid conflict
- Added vim navigation (j/k) and emacs navigation (C-n/C-p)
- Responsive table layout with proper column expansion
- Blue header with white bold text and column spacing
- Improved dialog styling with blue borders
- Black text on white background for input fields
- Updated help text and status bar with new keybindings

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 12:10:56 +01:00
Levi Neely 14e3c8d9a4 feat: add curses-based TUI (anvillm)
Add terminal UI as an alternative to the Acme interface. Both UIs
interact with anvilsrv via the same 9P filesystem interface.

Implementation:
- cmd/anvillm/main.go: Full-featured TUI using tview/tcell
- Session list with color-coded states
- Keyboard-driven interface (no mouse required)
- Auto-refresh every 2 seconds
- Modal dialogs for creating sessions, sending prompts, setting aliases

Features:
- Create Kiro/Claude sessions (k/c keys)
- Send prompts to selected session (p key)
- Stop/Restart/Kill sessions (s/R/K keys)
- Set session aliases (a key)
- Refresh session list (r key)
- Help dialog (? key)
- Quit (q key)

UI Components:
- Session table with columns: ID, Alias, Backend, State, PID, Cwd
- Status bar showing keyboard shortcuts
- Modal forms for user input
- Color-coded session states (green=running, aqua=idle, etc.)

Dependencies:
- github.com/rivo/tview: TUI framework
- github.com/gdamore/tcell/v2: Terminal cell library

Build:
- Updated mkfile to build anvillm binary
- Fixed .gitignore to allow cmd/anvillm/ directory

Documentation:
- Added Terminal UI section to README
- Lists all keyboard shortcuts
- Notes that TUI uses same 9P interface as Assist

This provides a lightweight alternative for users without Acme.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 12:01:02 +01:00
Levi Neely 55ebd64677 feat: add Daemon management UI and graceful degradation
Assist now continues working even if anvilsrv fails to start, and
provides a Daemon management window for server control.

Changes:
- Assist no longer fails fatally if anvilsrv won't start
- Logs ERROR and continues with disconnected state
- Add Daemon command to open /AnviLLM/Daemon window
- Daemon window shows server status with Start/Stop/Restart buttons
- Add isConnected() checks to all 9P operations
- Display friendly "not connected" message in main window
- Auto-reconnect when starting daemon from Daemon window

Daemon Window Features:
- Shows current daemon status (RUNNING/NOT RUNNING)
- Displays 9P socket path and existence
- Shows connection state
- Start button: runs `anvilsrv start` and reconnects
- Stop button: runs `anvilsrv stop` and disconnects
- Restart button: stops then starts
- Get button: refreshes status display

User Experience:
- Can still use Assist UI features (Sandbox, etc.) without daemon
- Session-related features show "not connected" errors
- Daemon command provides easy server management
- No more hard failures on startup

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:40:27 +01:00
Levi Neely 825d527b46 feat: restore Sandbox command to Assist UI
The Sandbox command was accidentally omitted during the architectural
split. This restores the UI convenience feature for managing sandbox
configuration.

Changes:
- Add Sandbox to main window tag and command handlers
- Port sandbox UI functions from old internal/ui/sandbox.go
- Open /AnviLLM/Sandbox window with Get/Edit/Reload/Status commands
- Edit opens config in Acme or $EDITOR
- Status shows landrun availability and version

README:
- Update Architecture section explaining daemon/client split
- Add Service Integration section (systemd/runit)
- Add anvilsrv commands (start/fgstart/stop/status)
- Update Commands table with Stop/Restart/Refresh/Sandbox
- Add path validation and security notes
- Expand troubleshooting section

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:36:50 +01:00
Levi Neely b7a823f120 feat: split monolith into anvilsrv daemon and Assist client
Major architectural refactoring to separate server and UI concerns:

Architecture Changes:
- Split into anvilsrv (server daemon) and Assist (Acme client)
- Removed UI coupling from server (OnAliasChange, WinID tracking)
- Server runs as background daemon, client reconnects as needed
- Client auto-starts server if not running

Server (anvilsrv):
- Add daemon management: start/stop/status commands
- Daemonize by default (fgstart for foreground/debug mode)
- Proper PID file handling in $NAMESPACE (not /tmp)
- Graceful shutdown with SIGTERM handling
- Duplicate start prevention with stale PID detection

Client (Assist):
- Auto-start anvilsrv if not running
- Fixed plan9 package imports (OWRITE/OREAD constants)
- Removed unused context import

Security Fixes:
- Move PID file from /tmp to $NAMESPACE (prevent symlink attacks)
- Add path validation in session creation:
  - Clean path traversal (/../../../etc → /etc)
  - Verify directory exists before creating session
  - Ensure absolute paths
  - Reject non-directory paths
- Add SECURITY.md documenting 9P socket risks

Service Integration:
- Add systemd service files (system, user, template)
- Add runit service files (run, finish)
- Add service documentation and installation instructions

Build & Testing:
- Both binaries build successfully
- All daemon operations verified (start/stop/status/daemonize)
- Path validation tested and working
- Auto-start functionality verified
- Add DevReviewQA workflow script

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:30:57 +01:00
Levi Neely e67e0d95a0 remove dead code 2026-02-09 21:27:28 +01:00
Levi Neely d8dccd94b3 initial commit 2026-02-09 17:57:42 +01:00