Commit Graph

413 Commits

Author SHA1 Message Date
Levi Neely bda779380e anvilmcp: use single quotes for bash arg escaping
Prevents shell variable expansion in tool args. $VAR now stays
literal instead of expanding to empty string.
2026-03-06 15:03:26 +01:00
Levi Neely fc6cca01a8 Remove Go language support from execute_code (go run lacks stdin)
Keep code extensible for future language support.
2026-03-06 14:15:51 +01:00
Levi Neely b3bb801b23 execute_code: add tool/args params, read from 9P, trust tools
- Add 'tool' param to read tool code from 9P namespace
- Add 'args' as array (passed as positional params via set --)
- Tools from 9P skip dangerous pattern validation (trusted)
- Add Go language support
- Update all skills to use tool/args syntax
2026-03-06 14:07:16 +01:00
Levi Neely 9643a9a034 Flatten tools 9P, restore SKILLS_PROMPT, remove role/tool discovery
- Flatten agent/tools/ to serve tools directly (no capability subdirs)
- Restore SKILLS_PROMPT.md with proactive skill discovery
- Remove discover_role.sh and discover_tool.sh
- Remove help endpoint from roles and tools
- Update all SKILL.md files to use flat tool paths
- Clear agent prompt in anvillm-agent.json
2026-03-06 13:43:57 +01:00
Levi Neely 57cd96fc6c supervisor: require claimable label for bead assignment 2026-03-06 10:21:24 +01:00
Levi Neely b21c56b960 anvilmcp: use layered sandbox config from sandbox package
Reuse the same layered config approach as anvilsrv:
- global.yaml provides base permissions (including /usr, /lib, /bin)
- sandbox/<name>.yaml adds sandbox-specific permissions
- Merge uses most-permissive-wins strategy

This fixes the fallback to default sandbox, which now has proper
system paths from global.yaml.
2026-03-06 10:18:31 +01:00
Levi Neely 2046bc2513 anvilmcp: fallback to default sandbox on permission errors
When sandbox is not explicitly specified, retry with 'default' sandbox
if the initial execution fails with permission denied or missing file errors.
This allows third-party skills designed for execute_bash to work without
modification while preserving isolation when sandbox is explicitly set.
2026-03-06 10:03:01 +01:00
Levi Neely 0d847f96f3 execute_code: configurable sandbox, fix dangerous patterns
- Add sandbox parameter to execute_code (default: anvilmcp)
- Load sandbox config from ~/.config/anvillm/sandbox/<name>.yaml
- Fallback to ./cfg/sandbox/<name>.yaml for development
- Add cwd config option: 'temp' for isolated workspace, '{CWD}' for caller's dir
- Create cfg/sandbox/anvilmcp.yaml with restricted defaults
- Update cfg/sandbox/default.yaml with cwd: '{CWD}'

Dangerous pattern fixes (bash, not JS/Python):
- Remove curl/wget block (network controlled by landrun)
- Remove chmod 777, eval(), exec() (wrong syntax)
- Allow /etc/passwd (world-readable, needed for user lookups)
- Fix /dev/ write check to only block /dev/sd* (not /dev/null)
- Fix eval pattern for actual bash usage

Update skills with explicit sandbox specifications:
- anvilmcp sandbox for normal operations
- default sandbox for spawn_agent.sh (needs full permissions)
2026-03-06 09:53:41 +01:00
Levi Neely b51bbf7e72 working on a different approach for roles 2026-03-06 08:54:44 +01:00
Levi Neely 391f773b2a remove discover_tool.sh, one capability per tool, aggressive agent prompts
This allows me to assign a role via `context` to an agent, it discovers what that role means, then it can run the tools and load the skills required to do its work. In theory...
2026-03-05 23:35:15 +01:00
Levi Neely ec880544df fix skill prompt commands 2026-03-05 22:31:21 +01:00
Levi Neely 2ebacf2b2e refining role/skill/tool discovery 2026-03-05 21:38:26 +01:00
Levi Neely b246e4df5b Update anvillm-agent.md with SKILLS_PROMPT.md changes 2026-03-05 18:47:45 +01:00
Levi Neely 81c1b8747f sandbox perms 2026-03-05 18:43:42 +01:00
Levi Neely 0b5d120378 Add agent roles: github-bot, researcher, developer, tester 2026-03-05 18:25:41 +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 6475b9f216 Add maildir messaging support for agent communication 2026-03-05 14:33:47 +01:00
Levi Neely 8cf325873b mcp: broaden discover_tool and discover_skill search
Search path, description, and content (matching discover_role behavior).
Tools search script content; skills search SKILL.md content.
2026-03-05 11:19:39 +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 948e23156a refine skills prompt 2026-03-04 22:07:24 +01:00
Levi Neely 485016127d Add roles 9P endpoint to server and support multiple tool directories
- Wire up roles filesystem in server.go
- Add /agent/roles directory with focus areas and help
- Support ANVILLM_TOOLS_DIR env var for multiple tool directories
- Update pcloudcc-testing skill documentation
2026-03-04 21:15:23 +01:00
Levi Neely 65e5081134 Use physical filenames in roles 9P endpoint
- Add DisplayName field to RoleMeta for frontmatter name
- Name field now always contains physical filename (never overwritten)
- Use physical filename for 9P paths and deduplication
- Use DisplayName in help output for discovery
- Add unique filtering (sort -u) to discover_role/skill/tool scripts
2026-03-04 21:14:42 +01:00
Levi Neely d0e3ff2cd8 Rename role to sandbox in layered sandbox config
- cfg/roles/ → cfg/sandbox/
- DefaultRole → DefaultSandbox, LoadRole → LoadSandbox
- SessionOptions.Role → Sandbox, Session.Role() → Sandbox()
- p9 file: role → sandbox
- Remove tasks from layered sandbox config
- Update create_session.sh and SKILL.md docs
2026-03-04 13:10:10 +01:00
Levi Neely c93bd19487 perms, prompts 2026-03-04 08:05:22 +01:00
Levi Neely 12d446d748 Add comment_count field to bead list and json outputs
- Add CommentCount field to BeadWithBlockers struct in readListFromStore and readBeadPropertyFromStore
- Call GetIssueComments to populate comment count when > 0
- Update beads skill documentation to guide checking comment_count and reading comments for additional context
2026-03-03 11:05:08 +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 090b92bb0a fixes for mkfile and anvillm-notify 2026-03-02 17:10:47 +01:00
Levi Neely 1774640f95 Update default role perms: move .npm/.yarn to read-write, add .mcp-auth 2026-03-02 10:53:16 +01:00
Levi Neely 7b90d4aad2 Add proactive skill discovery to agent prompts 2026-03-01 21:57:23 +01:00
Levi Neely 8852541423 Update changes 2026-03-01 17:23:25 +01:00
Levi Neely 8ac4a6f401 update claude agent-anvillm 2026-03-01 16:52:10 +01:00
Levi Neely bde53a7389 perf: reduce mail idle guard from 15s to 5s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:51:34 +01:00
Levi Neely 2c32295094 fix: inject session context into first prompt only
Context was prepended to every Send() call. Now it is consumed
on the first Send() and cleared, acting as a one-shot spawn
initialization rather than a per-prompt overhead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:49:22 +01:00
Levi Neely 75940dd963 feat: Conductor orchestration with intelligent time estimation
- Rewrote Conductor context prompt: cycle detection, single-domain
  validation, topological worker scheduling, deadline monitoring,
  completion logging, and replacement spawning on failure/timeout
- Add estimate_time.sh: computes LLM task deadline from bead signals
  (domain, child count, description length) using fitted model or
  cold-start defaults per domain
- Add calibrate_time_estimate.sh: updates model.json from completion
  data; auto-promotes 'other' labels to taxonomy when threshold met
- Add cfg/estimation/taxonomy.json: default 10-category domain taxonomy
- mkfile: create ~/.config/anvillm/estimation and ~/.local/share/anvillm/estimation at install time

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:43:01 +01:00
Levi Neely ba5fd04025 fix: make beads mount work with lazy initialization
- Changed NewServer to accept *BeadsFS instead of bd.Storage
- BeadsFS is always created but with no initial mounts
- Each mount opens its own store on-demand
- Added nil check in supervisor to handle missing beads gracefully
2026-03-01 00:47:13 +01:00
Levi Neely 33dbc312b0 fix: remove eager beads store initialization at startup
The beads store was being opened unconditionally at startup, causing
crashes when the database was corrupted or incompatible. Now it's only
opened on-demand when actually needed.
2026-03-01 00:41:39 +01:00
Levi Neely 788d97307f Remove cfg/tasks and all roles except default 2026-03-01 00:17:13 +01:00
Levi Neely cb77f3d3f2 Fix supervisor task assignment: only assign when session CWD is exactly or under task mountpoint 2026-03-01 00:15:18 +01:00
Levi Neely 04d3616819 fix: require mount parameter for all bead tools
- Add mount param to github_to_beads.sh, jira_to_beads.sh, batch_create_beads.sh, sync_beads.sh
- Update all 9p paths to use mount-specific paths (agent/beads/<mount>/...)
- Fix SKILLS_PROMPT.md to correctly document mount requirements
- Only exceptions: mount_beads.sh, umount_beads.sh, list_mounts.sh
2026-02-28 23:40:24 +01:00
Levi Neely 7a40244663 Fix create_bead.sh to handle multi-line descriptions properly
- Use proper shift-based parameter handling instead of positional
- Build command string that preserves newlines in description
- Fixes issue where multi-line descriptions were incorrectly parsed as parent-id
2026-02-28 23:10:57 +01:00
Levi Neely 27188f1f55 Fix MCP bead tools: add mount parameter and handle multi-line inputs
- All bead tools now require explicit mount parameter as first arg
- Multi-line values (descriptions, comments, reasons) properly quoted with printf
- Fixes issue where tools wrote to read-only agent/beads/list instead of mount-specific ctl
2026-02-28 23:07:21 +01:00
Levi Neely 495136c70c Remove BeadsFS.store field, fix subtask creation to use mounted project stores 2026-02-28 22:52:14 +01:00
Levi Neely 7db743483b Fix recursive bead directory structure in 9P filesystem
- Distinguish control files from bead IDs in mount walk logic
- Add bead directories to mount listings via Read(mountName/list)
- Verify mount exists before allowing walk into it
- Add encoding/json import to server.go
2026-02-28 22:15:55 +01:00
Levi Neely 5e36e672a9 fix: remove broken check blocking beads/ctl writes when mounts exist 2026-02-28 21:55:25 +01:00
Levi Neely 4d51216fa6 Move SKILLS_PROMPT to root and refactor agent protocol
- Move SKILLS_PROMPT.md from kiro-cli/ to repo root (shared across backends)
- Replace verbose agent instructions with concise discovery protocol
- Enforce execute_code for all AnviLLM tool usage; forbid raw 9p commands
- Add agentspawn hook for claude backend
- Clean up install-mcp.sh tool list (now auto-discovered)
- Clarify SKILL.md wording for beads and anvillm-communication

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 21:50:48 +01:00
Levi Neely afe13afba2 Fix 9p tool access in execute_code sandbox
- Add DISPLAY, WAYLAND_DISPLAY, USER to landrun env passthrough
- Mount /etc/passwd read-only for getuser() to work
- Update mcptools scripts to check /etc/shadow instead of /etc/passwd for sandbox detection
2026-02-28 20:49:42 +01:00
Levi Neely a30ef745b0 Fix beads skill command format 2026-02-28 19:01:15 +01:00
Levi Neely ff907518e2 Clarify list_sessions as agent discovery 2026-02-28 19:00:37 +01:00
Levi Neely 729ec54d2d Fix command format: action: command 2026-02-28 18:59:45 +01:00