diff --git a/.claude/skills/graft/SKILL.md b/.claude/skills/graft/SKILL.md index d4cbc72d..2dde4502 100644 --- a/.claude/skills/graft/SKILL.md +++ b/.claude/skills/graft/SKILL.md @@ -154,3 +154,14 @@ When the graft MCP server is connected, these are exposed as tools too: `graft_find_code`, `graft_find_all`, `graft_file_api`, `graft_trace_calls` (with `direction` / `depth`), `graft_repo_map`, `graft_check_freshness`. Use whichever surface is available; the guidance is identical. + + +## Project rule: agent tools + +A module is not done until the Ranch agent has tools for what the console +can do. Before adding or changing an admin-console capability, read +`docs/agent-tools.md`: tools live in the slice as `.tool.ts` with +`topic` / `title` / `template`, audience gating, `confirm` on anything +destructive, no secrets in results, and a spec. The API refuses to boot a +tool without that metadata. + diff --git a/.specify/feature.json b/.specify/feature.json index 1ce695e1..97590af0 100644 --- a/.specify/feature.json +++ b/.specify/feature.json @@ -1,3 +1,3 @@ { - "feature_directory": "specs/015-chat-message-reliability" + "feature_directory": "specs/016-agent-tool-parity" } diff --git a/CLAUDE.md b/CLAUDE.md index 6a638a71..9546ef3e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,4 +43,12 @@ problem a day apart without meeting. A fix that lands in one console and leaves the other behind is half a fix, and the missing half is the one the user clicks. +**Agent tools (`api`):** read `docs/agent-tools.md` before adding or changing +any admin-console capability. The console is a window, the chat is the hands: +a module is not done until the Ranch agent has a tool for what the console +can do — in the slice, with `topic`/`title`/`template`, gated to the right +audience, `confirm` on anything destructive, no secrets in results, and a spec. +The API refuses to boot a tool without that metadata; the reviewer checks the +rest against the checklist at the end of that doc. + Project overview: `README.md`. diff --git a/Makefile b/Makefile index 44a1c152..b83cd0bd 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,10 @@ help: ## Show this help init: ## Interactive setup wizard (local + optional Hetzner deploy) @bash scripts/init.sh + @node scripts/ensure-agent-tools-rule.mjs + +agent-tools-rule: ## Re-insert the agent-tools rule pointer into graft-owned guidance files + @node scripts/ensure-agent-tools-rule.mjs setup: install db db-wait migrate k3d ## Full local setup (non-interactive) @echo "" diff --git a/README.md b/README.md index 0f8e6e15..e89ad6ed 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,18 @@ Set `PUBLIC_API_URL` to the origin other agents reach this API on — every card URL is built from it. See `specs/013-a2a-agent-peers/` and `specs/014-a2a-protocol-upgrade/` for the full specifications. +## Agent tools and the Tools panel + +The console is a window; the chat is the hands. Everything the admin console +can do, the Ranch admin agent can do through a tool served by this API's own +MCP server — agents, templates, skills, LLM credentials, MCP servers, +knowledge bases and sources, settings, peers, paddock, users and API keys, +chats and usage, browser sessions, upgrades. Press the wrench beside the chat +composer to see the agent's tools grouped by topic; a click drops a starter +prompt into the composer. Tools added after a pod started show "after restart" +until it restarts. Adding a console capability means adding its tool in the +same PR — see `docs/agent-tools.md` and `specs/016-agent-tool-parity/`. + ## Project Structure ``` diff --git a/admin/slices/agent/agent/components/agent/chat/Tab.vue b/admin/slices/agent/agent/components/agent/chat/Tab.vue index ba6dc70e..ad100150 100644 --- a/admin/slices/agent/agent/components/agent/chat/Tab.vue +++ b/admin/slices/agent/agent/components/agent/chat/Tab.vue @@ -144,6 +144,7 @@ watch( :agent-id="agent.id" :title="`Chat with ${agent.name}`" :restart-prompt="false" + :tools-button="false" :agent-state="bridleAgentState" :offline-hint="offlineHint" :initial-debug-enabled="agent.debugEnabled" diff --git a/admin/slices/agent/agent/components/agent/workspace/Main.vue b/admin/slices/agent/agent/components/agent/workspace/Main.vue index ab3db986..464cf82c 100644 --- a/admin/slices/agent/agent/components/agent/workspace/Main.vue +++ b/admin/slices/agent/agent/components/agent/workspace/Main.vue @@ -258,6 +258,7 @@ async function onRemove() { {{ isRestarting ? 'Restarting…' : 'Restart' }} +