Commit Graph

221 Commits

Author SHA1 Message Date
Levi Neely d8907e1029 Fix KIRO_API_KEY documentation
Optional if using 'kiro-cli login' (OAuth flow)
Same pattern as ANTHROPIC_API_KEY
2026-02-20 00:28:05 +01:00
Levi Neely 1c883b6a18 Fix ANTHROPIC_API_KEY documentation
Not required if using 'claude /login' (OAuth flow)
Only needed for non-interactive API key authentication
2026-02-20 00:27:41 +01:00
Levi Neely ebeac0da6a Add 'Why 9P?' section
Explains design rationale: orchestration as file manipulation
Benefits: simplicity, universal access, composability
Placement: after Architecture, before Requirements

Addresses the 'why this obscure protocol' question upfront
2026-02-20 00:25:27 +01:00
Levi Neely 536b358006 Sort session list by creation time (newest first)
Backend changes:
- Add CreatedAt() to Session interface
- Implement CreatedAt() in tmux.Session (field already existed)
- Sort Manager.List() by creation time descending

Benefits:
- Deterministic ordering (no more random map iteration)
- Newest sessions appear first (most useful)
- All clients benefit immediately
- head -1 now reliably gets most recent session

README:
- Update example to use head -1 for newest session
- Document that list is sorted newest first
2026-02-19 23:51:10 +01:00
Levi Neely 17ad0fcafd Fix example: list order is non-deterministic
- Remove tail -1 hack (doesn't work - map iteration is random)
- Show listing sessions first with output format
- Document that order is non-deterministic
- Use manual ID selection (realistic workflow)

The session list iterates over a Go map, which has non-deterministic
order. Cannot rely on tail/head to get 'last created' session.
2026-02-19 23:48:16 +01:00
Levi Neely 4a9179f6e2 Fix filesystem tree and example: use mailbox system
Filesystem tree fixes:
- Remove non-existent 'in' and 'out' files
- Add missing 'role', 'tasks', 'tmux' files

Example fixes:
- Use mailbox system for prompts (user/mail with JSON message)
- Show reading response from user/inbox
- Correct workflow: prompts are messages, not direct writes

The old 'in/out' interface no longer exists - all communication
is via the mailbox system
2026-02-19 23:46:08 +01:00
Levi Neely 79bc7bf724 Fix 9P filesystem example
- Rename 'Example' to 'Basic Session Example' (more descriptive)
- Fix workflow: get actual session ID from list (not hardcoded)
- Add comments explaining each step
- Show both 'running' and 'idle' as possible states

Previous example used hardcoded ID that wouldn't exist
2026-02-19 23:44:44 +01:00
Levi Neely d07315a772 Reorganize README for logical flow
New section order:
1. Architecture/Requirements/Installation/Usage (getting started)
2. Configuration (env vars, templates) - before backends
3. Backends & Sandboxing (references Configuration templates)
4. 9P Filesystem (understand backend first, then filesystem)
5. Workflows (uses 9P concepts)
6. MCP Integration (alternative integration method)
7. Troubleshooting (end)

Improves flow: config before use, concepts before advanced features
2026-02-19 23:42:04 +01:00
Levi Neely 9fbcf8de51 Document all configurable options
Add Configuration section with:
- Environment variables table (NAMESPACE, ANVILLM_*, API keys)
- Sandbox config templates table (CWD, HOME, TMPDIR, XDG_*)
- Reference from Backends section
- Remove redundant debug/terminal note from Troubleshooting

All behavior-changing environment variables now documented
2026-02-19 23:39:57 +01:00
Levi Neely 6a5c326a93 Tech editing pass on beads README
Logical flow improvements:
- Condense overview and merge storage backend inline
- Move commands table before examples (reference before use)
- Remove duplicate commands table
- Consolidate examples into single code block
- Merge initialization and integration sections
- Condense MCP section
- Merge benefits and implementation sections
- Consistent formatting (em dashes, bullets)

Result: Clearer flow, no redundancy, 40 lines removed
2026-02-19 23:38:06 +01:00
Levi Neely 6966c1b9ef Remove IDEAS.md link from beads README
IDEAS.md is ephemeral and changes frequently
2026-02-19 23:35:43 +01:00
Levi Neely 24e30baa28 Fix content contradictions
- Fix mailbox filesystem: add outbox, completed, mail (was missing)
- Clarify 'Archive' command maps to 'completed' directory
- Fix mailbox example: use 'completed' not 'archive'
- Remove non-existent 'Log' command from Acme tag and table
- Add missing 'Get' command to Acme table
- Fix backends description: sandboxed with network (not 'full permissions')
- Reorder Acme commands table for clarity
2026-02-19 23:34:13 +01:00
Levi Neely ff4dcf4692 Internal consistency pass
- Remove duplicate Namespaces line
- Standardize separator style: em dash (—) throughout
- Remove trailing periods from standalone statements
- Merge Acme tag and interaction notes inline
- Reorder Emacs keys to match TUI order (help before quit)
- 5 lines removed (consolidation)
2026-02-19 23:30:59 +01:00
Levi Neely 45155650ce Add MCP integration section
- Document anvilmcp MCP server
- Installation command
- List available tools
- Explain use case (Claude Desktop, Cline integration)
2026-02-19 23:27:21 +01:00
Levi Neely d05ebac197 Final editing pass: maximum condensation
- Ultra-condense architecture to 3 lines
- Merge requirements into single line
- Flatten service integration commands
- Condense all clients into single-line descriptions
- Compress Acme commands table
- Remove obvious statements (path validation)
- Merge events & mailbox into single code block
- Ultra-condense backends/sandboxing/config/kernel/self-healing
- Compress workflows to essentials
- 118 lines removed (50% reduction from previous)
- Total: 322 lines removed from original (63% reduction overall)
2026-02-19 23:25:26 +01:00
Levi Neely 8ea62fd0fc Update README: document layered sandbox configuration
- Replace single sandbox.yaml with layered system
- Document: global.yaml → backends/ → roles/ → tasks/
- Note default role (roles/default.yaml) when none specified
- Add tip: make default.yaml permissive for quick starts
- Update troubleshooting reference
2026-02-19 23:23:03 +01:00
Levi Neely 751bac6543 Second editing pass: aggressive condensation
- Flatten service integration into single block
- Consolidate all client sections (TUI/Emacs/web/Acme) into compact format
- Merge beads commands into single code block
- Combine events & mailbox into one section
- Merge backends, self-healing, sandboxing into unified section
- Condense workflows: merge skills, examples, patterns
- Tighten troubleshooting table
- 126 lines removed (38% reduction from previous)
2026-02-19 23:20:34 +01:00
Levi Neely 2b101355e9 Edit README for clarity and concision
- Tighten architecture, requirements, and usage sections
- Condense UI sections (TUI, Emacs, web, Acme) - compact key lists
- Streamline 9P filesystem, beads, events, mailbox sections
- Condense workflow examples and self-healing explanation
- Remove redundant statements and obvious details
- 78 lines removed (35% reduction)
2026-02-19 23:17:52 +01:00
Levi Neely 8e421ead7d Fix outdated README: remove Sandbox command, add Inbox/Archive, update config instructions 2026-02-19 23:12:21 +01:00
Levi Neely 1d0aa9d091 Update README: add beads, events, mailbox, skills, and anvilmcp 2026-02-19 23:10:36 +01:00
Levi Neely 9ebd239a95 Add beads task tracking integration via 9P filesystem
- Add beads dependency (steveyegge/beads)
- Create internal/beads/beads.go: Storage wrapper for beads operations
- Create internal/p9/beads.go: 9P filesystem handlers for beads
- Integrate beads into 9P server (shared across all namespaces)
- Add beads directory to 9P filesystem: /agent/beads/
- Support commands: init, new, claim, complete, fail, dep
- Add ANVILLM_BEADS_PATH env var for custom beads location
- Update IDEAS.md with multi-tracker import design (Jira, GitHub, GitLab, Linear)
- Beads provides persistent, crash-resilient task tracking for multi-agent workflows
2026-02-19 23:08:50 +01:00
Levi Neely e1fc56f213 Improve event system: add initial state event and rename exited to killed
- Emit initial state change event (stopped -> starting) when session is created
- Rename 'exited' state to 'killed' for clarity
- Remove duplicate killed event emission (Close() already emits via transitionToLocked)
- Set OnStateChange callback in NewManager to emit state change events
- All state changes now properly emit events via callbacks
2026-02-19 20:29:43 +01:00
Levi Neely 65be761262 Fix event system: wire state changes to OnStateChange and fix /events 9p read
- 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
2026-02-19 20:18:55 +01:00
Levi Neely 4c79fc796c Add 9P event queue infrastructure
- internal/events: new package with Queue supporting Push/Read/Ack and 2-min TTL
- internal/p9: expose /events file (read returns JSON lines, write accepts ack)
- internal/backend/tmux: add OnStateChange callback to Session
- internal/session: add OnStateChange callback to Manager

No events are emitted yet - infrastructure only.
2026-02-19 18:56:24 +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 97a0a66722 Reload sandbox config on Restart for hot-reload of YAML changes 2026-02-19 16:24:57 +01:00
Levi Neely 977745d133 Make skills command conditional: use agent-prompt/agent-skills if available 2026-02-19 15:30:56 +01:00
Levi Neely 44934e685a Make agent-hook support direct invocation
- Added dual-mode support: JSON stdin or event name as argument
- Updated agent config to use agent-hook with event names
- Centralizes all hook logic in one script
- Works with both wrapper scripts and direct Kiro hooks
2026-02-18 22:35:27 +01:00
Levi Neely 5fdcc039d1 Add agent-hook script and SKILLS_PROMPT.md
- Added agent-hook for future use with wrapper script
- Created SKILLS_PROMPT.md for automatic skill loading
- Updated mkfile to install both
- Kept explicit commands in agent config (agent-hook needs wrapper)
2026-02-18 22:33:09 +01:00
Levi Neely 01efe06831 Revert "Remove 9p-read-inbox script"
This reverts commit 748c32aa05.
2026-02-18 22:18:29 +01:00
Levi Neely e5b77b0d27 Revert "Remove 9p-read-inbox from mkfile"
This reverts commit c7c02c9502.
2026-02-18 22:18:29 +01:00
Levi Neely c7c02c9502 Remove 9p-read-inbox from mkfile 2026-02-18 22:17:48 +01:00
Levi Neely 748c32aa05 Remove 9p-read-inbox script
- Replaced by read_inbox MCP tool
- MCP tool provides same functionality with better integration
2026-02-18 22:17:26 +01:00
Levi Neely 840453f2cc Format read_inbox output like 9p-read-inbox
- 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
2026-02-18 22:14:01 +01:00
Levi Neely 7089aa96fb Make inbox notification more action-oriented
- Change from 'check inbox' to 'You have a new message'
- Add 'respond appropriately' to emphasize action needed
2026-02-18 22:10:43 +01:00
Levi Neely 812d057d39 Add explicit guidance on responding to messages
- Tell agents to take action and respond, not just read
- Show request/response type pairing
- Include example response flow
2026-02-18 22:08:38 +01:00
Levi Neely 1139172a7e Return actual error messages from 9p commands
- Capture stderr/stdout from 9p write failures
- Return helpful error messages (e.g., list of valid message types)
- Allows agents to retry with correct values
2026-02-18 22:03:50 +01:00
Levi Neely 3f5c4da1e7 Make read_inbox auto-complete messages like 9p-read-inbox
- Read only first message (not all messages)
- Automatically mark message as complete after reading
- Matches behavior of original 9p-read-inbox script
2026-02-18 21:56:08 +01:00
Levi Neely d0ea1b30e0 Condense communication skill by 66%
- Reduced from 304 to 102 lines
- Removed redundancy and verbose explanations
- Kept all essential information and examples
- More scannable and focused
2026-02-18 21:50:51 +01:00
Levi Neely 3515f51151 Replace all 9p command references with MCP tools
- Updated anvillm-communication skill to use MCP tools
- Changed session.go to instruct agents to use send_message
- Updated manager.go to tell agents to use read_inbox
- Updated Claude hook to mention read_inbox tool
- Cleaner, more consistent interface across all documentation
2026-02-18 21:49:35 +01:00
Levi Neely 3ca6c8ae1d Update Claude agent instructions to use MCP tools
- Replace 9p-read-inbox script with read_inbox tool
- Replace manual 9p write with send_message tool
- Cleaner interface for agent communication
2026-02-18 21:46:48 +01:00
Levi Neely 191d00099f update mkfile 2026-02-18 21:45:40 +01:00
Levi Neely f3cad9a96f Add env field to MCP config for consistency 2026-02-18 21:44:42 +01:00
Levi Neely 199595416f Handle notifications/initialized properly
- Don't return error for notification methods
- Notifications don't expect responses per JSON-RPC spec
2026-02-18 21:43:30 +01:00
Levi Neely 19fb829d4e Add stdout flush for MCP protocol reliability
- Flush stdout after each JSON-RPC response
- Ensures responses are immediately available to MCP clients
2026-02-18 21:42:32 +01:00
Levi Neely fd9860c70e Use includeMcpJson to load global MCP config
- Remove mcpServers from agent config
- Add includeMcpJson: true to use ~/.kiro/settings/cli.json
- Allows agent to access MCP servers from global config
2026-02-18 21:38:28 +01:00
Levi Neely 8118f0c7b6 Add kiro-cli MCP installation to mkfile
- Run install-mcp.sh during build to configure MCP server
2026-02-18 20:21:54 +01:00
Levi Neely 75bfd529ca fix build errors 2026-02-18 20:20:58 +01:00
Levi Neely 5399d709c4 Replace PID-based temp files with AGENT_ID env var
- Simplified Claude hooks to use AGENT_ID instead of PID lookup
- Updated 9p-read-inbox to use AGENT_ID env var
- Removed temporary file creation in tmux.go
- Much cleaner and more reliable approach
2026-02-18 20:09:12 +01:00