Watch
0
0
Fork
You've already forked hyperhive
0

docs: move the agent tool docs to 4-implementation/agent-tools

This commit is contained in:
atlas 2026-11-06 23:50:28 +01:00 • committed by mara
commit aa227a95c1
25 changed files with 94 additions and 83 deletions

View file

@ -6,9 +6,9 @@
# what made swarmctl's fail.
docs/2-handbook/tools/hivectl-cli.md
docs/2-handbook/tools/swarmctl-cli.md
docs/2-handbook/tools/forge-cli.md
docs/2-handbook/tools/swarm-logs-cli.md
docs/2-handbook/tools/swarm-metrics-cli.md
docs/4-implementation/agent-tools/forge-cli.md
docs/4-implementation/agent-tools/swarm-logs-cli.md
docs/4-implementation/agent-tools/swarm-metrics-cli.md
# Files with multi-line list-item continuations that prettier strips to col 0.
# prettier's `proseWrap: "preserve"` prevents prose reflow but not list-item
@ -21,8 +21,8 @@ docs/4-implementation/networking/gateway.md
docs/2-handbook/integrations/matrix.md
docs/2-handbook/agent-lifecycle/persistence.md
docs/4-implementation/web-ui/terminal-rendering.md
docs/2-handbook/tools/forge.md
docs/2-handbook/tools/matrix.md
docs/4-implementation/agent-tools/forge.md
docs/4-implementation/agent-tools/matrix.md
docs/4-implementation/turn-loop/README.md
docs/2-handbook/web-ui/agent.md
docs/2-handbook/web-ui/dashboard.md

View file

@ -84,10 +84,10 @@ box it gets:
producers feed. → [schedules](docs/2-handbook/swarm/schedules.md)
- **background bash** — long-running commands as tracked tasks
(`run` / `status` / `kill`), so a build doesn't block the turn. →
[bash](docs/2-handbook/tools/bash.md)
[bash](docs/4-implementation/agent-tools/bash.md)
- **subagents** — nested sessions on the agent's own runtime, optionally
re-prompted toward a goal over several turns. →
[subagent](docs/2-handbook/tools/subagent.md)
[subagent](docs/4-implementation/agent-tools/subagent.md)
- **forge** — its own Forgejo account, the `hive-forge` CLI, git
credentials, and notifications turned into todos. Optional linked
accounts on other forges, GitLab (`glab` + push), and GitHub (`gh` + push) via
@ -95,7 +95,7 @@ box it gets:
[forge](docs/2-handbook/integrations/forge.md) · [gitlab](docs/2-handbook/integrations/gitlab.md) ·
[github](docs/2-handbook/integrations/github.md)
- **matrix** — its own account(s) on the swarm homeserver, as MCP tools. →
[matrix](docs/2-handbook/tools/matrix.md)
[matrix](docs/4-implementation/agent-tools/matrix.md)
- **knowledge** — the swarm's shared `internal/knowledge` repo, read-only
at `/knowledge`, plus hyperhive's own docs in the container. →
[knowledge](docs/2-handbook/integrations/knowledge.md)

View file

@ -398,4 +398,4 @@ delivers every unread notification it's handed. A hive-forge CLI
subscription verb bounds the firehose explicitly (dropping broad repo
watches an agent doesn't need) — the poller never guesses which
watches to drop. See the `subscription` verb in
[`docs/2-handbook/tools/forge.md`](../tools/forge.md).
[`docs/4-implementation/agent-tools/forge.md`](../../4-implementation/agent-tools/forge.md).

View file

@ -1,11 +1,8 @@
# Tools
`hivectl` is _your_ tool — the operator's own host CLI. Everything
else here documents the tool surface your **agents** get inside their
containers (the MCP tools an agent's own claude session can call).
You never call these directly, but they're the reference for what an
agent can actually do — useful when you're trying to understand or
debug agent behavior.
`hivectl` and `swarmctl` are _your_ tools — the operator's own CLIs. The
tool surface your agents get inside their containers lives in
[`4-implementation/agent-tools/`](../../4-implementation/agent-tools/README.md).
## For the operator
@ -25,27 +22,3 @@ debug agent behavior.
(authelia's subject store, edited in place) and `agent create`
(queues the swarm-controller's creation job graph). No curated guide
yet; add one here if/when that grows.
- **[swarm-logs-cli](swarm-logs-cli.md)** — the exhaustive, autogenerated
flag-by-flag reference for `swarm-logs`, kept in lockstep with the
binary by CI. No curated guide.
- **[swarm-metrics-cli](swarm-metrics-cli.md)** — the exhaustive,
autogenerated flag-by-flag reference for `swarm-metrics`, kept in
lockstep with the binary by CI. No curated guide.
## What your agents can do
- **[bash](bash.md)** — background shell execution (`mcp__bash__*`),
available on every agent unconditionally.
- **[subagent](subagent.md)** — spawn nested headless claude sessions
(`mcp__subagent__{start,continue,status,interrupt}`), shipped
default-on for every agent today alongside `bash` (expected to become a
real opt-in capability later).
- **[forge](forge.md)** — the `hive-forge` Forgejo CLI every agent has
for issues, PRs, and comments. Not an MCP tool — a binary agents
shell out to instead of ad-hoc curl.
- **[forge-cli](forge-cli.md)** — the exhaustive, autogenerated
flag-by-flag reference for `hive-forge`, kept in lockstep with the
binary by CI the same way `hivectl-cli.md` is.
- **[matrix](matrix.md)** — the matrix MCP tool surface
(`mcp__matrix__*`) for agents with a matrix account, multiple
accounts per agent, and declaring extra MCP servers generally.

View file

@ -0,0 +1,32 @@
# Agent tools
The tool surface your **agents** get inside their containers (the MCP tools
an agent's own claude session can call, plus the CLIs it shells out to).
You never call these directly, but they're the reference for what an agent
can actually do — useful when you're trying to understand or debug agent
behavior. The operator's own tools are in
[`2-handbook/tools/`](../../2-handbook/tools/README.md).
## What your agents can do
- **[bash](bash.md)** — background shell execution (`mcp__bash__*`),
available on every agent unconditionally.
- **[subagent](subagent.md)** — spawn nested headless claude sessions
(`mcp__subagent__{start,continue,status,interrupt}`), shipped
default-on for every agent today alongside `bash` (expected to become a
real opt-in capability later).
- **[forge](forge.md)** — the `hive-forge` Forgejo CLI every agent has
for issues, PRs, and comments. Not an MCP tool — a binary agents
shell out to instead of ad-hoc curl.
- **[forge-cli](forge-cli.md)** — the exhaustive, autogenerated
flag-by-flag reference for `hive-forge`, kept in lockstep with the
binary by CI the same way `hivectl-cli.md` is.
- **[swarm-logs-cli](swarm-logs-cli.md)** — the exhaustive, autogenerated
flag-by-flag reference for `swarm-logs`, kept in lockstep with the
binary by CI. No curated guide.
- **[swarm-metrics-cli](swarm-metrics-cli.md)** — the exhaustive,
autogenerated flag-by-flag reference for `swarm-metrics`, kept in
lockstep with the binary by CI. No curated guide.
- **[matrix](matrix.md)** — the matrix MCP tool surface
(`mcp__matrix__*`) for agents with a matrix account, multiple
accounts per agent, and declaring extra MCP servers generally.

View file

@ -10,7 +10,7 @@ autogenerated from the binary's own command tree, see
markdown-docs` subcommand and kept in lockstep with the code by the
`hive-forge-docs` flake check (CI fails if the committed copy drifts).
Regenerate with `nix build .#hive-forge && ./result/bin/hive-forge
markdown-docs > docs/2-handbook/tools/forge-cli.md`.
markdown-docs > docs/4-implementation/agent-tools/forge-cli.md`.
## Credentials and repo defaults

View file

@ -149,7 +149,7 @@ pending invites, resolve_invite to accept or reject`. The daemon clears
the keyed todo when a `resolve_invite` (or `join_room`) call resolves
the invite.
See [`docs/2-handbook/integrations/matrix.md`](../integrations/matrix.md) for the homeserver setup,
See [`docs/2-handbook/integrations/matrix.md`](../../2-handbook/integrations/matrix.md) for the homeserver setup,
provisioning flow, and federation config.
## Extra MCP servers (per-agent)

View file

@ -325,7 +325,7 @@ it came from. One without a `model` runs on claude's own default, which the
daemon doesn't check. The list is:
- the swarm's `subagent_models` for this agent, when it sets one
([`inference.md`](../../4-implementation/swarm/inference.md)). It replaces the agent's own
([`inference.md`](../swarm/inference.md)). It replaces the agent's own
list, so it can name models that list leaves out.
- otherwise `services.hyperhive.agent.availableModels`, which reaches the
daemon as `HIVE_AVAILABLE_MODELS`. An empty list restricts nothing.
@ -340,7 +340,7 @@ as `<provider>/<model>` on `opencode`.
## How many subagents may run at once
When the swarm sets `max_subagents` for the agent
([`inference.md`](../../4-implementation/swarm/inference.md)), the daemon refuses a `start`, or a
([`inference.md`](../swarm/inference.md)), the daemon refuses a `start`, or a
`continue` of a session that isn't running, once that many subagents are
running, before anything spawns:
@ -405,7 +405,7 @@ daemon reads from the swarm on each `start`/`continue`:
`Edit`, `Glob`, `Grep`, `Read`, `Skill`, `Write`, plus `WebFetch`/
`WebSearch` for an agent granted `web_tools` and not otherwise. A running
subagent keeps the tools it started with. See
[the harness's own allowlist](../../4-implementation/turn-loop/mcp.md#tool-allowlist-hive_sh4repermissionsallowed_builtin_tools)
[the harness's own allowlist](../turn-loop/mcp.md#tool-allowlist-hive_sh4repermissionsallowed_builtin_tools)
for what that list contains and why.
The exception: **a subagent gets Claude's built-in `Bash` iff its parent

View file

@ -20,11 +20,11 @@ swarmctl agent inference clear iris
- `--subagent-models` takes a comma-separated list. It replaces the
agent's `availableModels` as the models its subagent `start` and
`continue` calls may name, read on each call
([`subagent.md`](../../2-handbook/tools/subagent.md#which-models-a-subagent-may-run-on)).
([`subagent.md`](../agent-tools/subagent.md#which-models-a-subagent-may-run-on)).
- You set the subagent cap, `max_subagents`, in the swarm UI's inference
dialog; `set` has no flag for it and keeps the stored one. It's a whole
number from 0 to 32, where 0 allows no subagents; unset means no cap
([`subagent.md`](../../2-handbook/tools/subagent.md#how-many-subagents-may-run-at-once)).
([`subagent.md`](../agent-tools/subagent.md#how-many-subagents-may-run-at-once)).
- `get` shows each field, naming the unset ones (or says the swarm sets
nothing for the agent), and then the model and effort the agent reports
running on, each with where it comes from.

View file

@ -20,7 +20,7 @@ entry on the schema's stdio default — it spawns
the tools land in claude as
`mcp__hyperhive__<tool>`. Each entry also has an `availableToSubagents`
toggle (default `false`) — see
[`docs/2-handbook/tools/subagent.md`](../../2-handbook/tools/subagent.md#mcp-servers-available-to-a-subagent)
[`docs/4-implementation/agent-tools/subagent.md`](../agent-tools/subagent.md#mcp-servers-available-to-a-subagent)
for what reaches a subagent's own `--mcp-config` and what doesn't.
An `"http"` entry that needs request headers (a bearer-authenticated remote
server) sets `headersFile` to an absolute path: a file holding a JSON object
@ -48,7 +48,7 @@ runs on the change.
(default: empty = unrestricted) limits which names `send` accepts —
useful for sandboxing. The broker refuses `to: "operator"`. The error
points an agent that has the matrix MCP tools at matrix
([matrix](../../2-handbook/tools/matrix.md)), and tells one without them that the
([matrix](../agent-tools/matrix.md)), and tells one without them that the
operator reads its `set_status` line, its turn output on the dashboard,
and its logs.
- `recv` — drain inbox. Always an immediate peek, never blocks. `max`
@ -139,11 +139,11 @@ hive_name?, swarm_name?, matrix_accounts? }`. `matrix_accounts` is a
## Privileged tools (by permission)
- **Bash execution** (`execution`) — background shell tasks. See
[`docs/2-handbook/tools/bash.md`](../../2-handbook/tools/bash.md).
[`docs/4-implementation/agent-tools/bash.md`](../agent-tools/bash.md).
- **Subagent spawning** — nested sessions on the agent's own runtime
(claude or ACP, via `hive-runtime`) as background tasks, shipped
default-on like bash execution; no permission gates it. See
[`docs/2-handbook/tools/subagent.md`](../../2-handbook/tools/subagent.md).
[`docs/4-implementation/agent-tools/subagent.md`](../agent-tools/subagent.md).
- **Config changes** — no permission: they go through a forge PR on
`agent-configs/<name>` — see
[`docs/2-handbook/agent-lifecycle/config-changes.md`](../../2-handbook/agent-lifecycle/config-changes.md).
@ -155,14 +155,14 @@ hive_name?, swarm_name?, matrix_accounts? }`. `matrix_accounts` is a
[`docs/5-project/process/conventions.md#permissions`](../../5-project/process/conventions.md).
- **Matrix MCP + extra servers** — `mcp__matrix__*` tools and
per-agent extra MCP config. See
[`docs/2-handbook/tools/matrix.md`](../../2-handbook/tools/matrix.md).
[`docs/4-implementation/agent-tools/matrix.md`](../agent-tools/matrix.md).
## Waking the agent from inside the container
The built-in producers (matrix, bash, forge) upsert a todo on the
harness's in-agent socket (`HIVE_AGENT_SOCKET`, `UpsertTodo` — see
[`docs/2-handbook/tools/bash.md` § Completion as a todo
(loose-ends v2)](../../2-handbook/tools/bash.md#completion-as-a-todo-loose-ends-v2)
[`docs/4-implementation/agent-tools/bash.md` § Completion as a todo
(loose-ends v2)](../agent-tools/bash.md#completion-as-a-todo-loose-ends-v2)
for the full upsert/signal/clear mechanism): a new or changed summary
makes the harness signal its own turn loop, with no hive-c0re
round-trip. An external MCP server (or any other in-container process)
@ -205,7 +205,7 @@ The built-in list and the `--tools` value it resolves to live in
`hive-sh4re` (the `Permission` enum itself is in `hive-types`), not in the
harness, because the
subagent daemon spawns its own `claude` and must resolve the same set —
see [`docs/2-handbook/tools/subagent.md`](../../2-handbook/tools/subagent.md).
see [`docs/4-implementation/agent-tools/subagent.md`](../agent-tools/subagent.md).
- Allowed built-ins: `Edit`, `Glob`, `Grep`, `Read`, `Skill`, `Write`.
`Skill` is what makes an installed plugin's `SKILL.md` invokable —

View file

@ -286,7 +286,7 @@ host access it has.
| `messaging` | `send`, `recv`, `ack_until` |
| `meta` | `get_agent_meta` (`set_status` is always-on, see below) |
| `inbox` | `get_loose_ends`, `cancel_loose_end`, `remind` |
| `execution` | the `bash` MCP server (`mcp__bash__run`/`status`/`kill`), rendered into the agent's MCP config only with it; a subagent gets Claude's own `Bash` instead. See `docs/2-handbook/tools/bash.md`. |
| `execution` | the `bash` MCP server (`mcp__bash__run`/`status`/`kill`), rendered into the agent's MCP config only with it; a subagent gets Claude's own `Bash` instead. See `docs/4-implementation/agent-tools/bash.md`. |
| `web_tools` | the Claude built-ins `WebFetch`/`WebSearch` |
| `manage_root_agent` | every agent's state (rw) bind-mounted into the holder's container, plus `/meta` (ro) |
| `logs` | the log store: `swarm-logs` queries. Checked by `swarm-logs-auth` at the gateway, not by a tool list. Off by default. |

View file

@ -392,7 +392,7 @@ own self-consistent object store and is immune to the issue.
### `hive-forge`: prefer over raw curl pipelines
Full CLI reference: [`docs/2-handbook/tools/forge.md`](../../2-handbook/tools/forge.md).
Full CLI reference: [`docs/4-implementation/agent-tools/forge.md`](../../4-implementation/agent-tools/forge.md).
Never use raw `curl` for forge access.
## GUI (weston/VNC)

View file

@ -29,13 +29,13 @@ later work.
- **What does the dashboard look like, and how to use it?** →
[`2-handbook/web-ui/`](2-handbook/web-ui/README.md) — the operator-facing starting point,
with [`dashboard`](2-handbook/web-ui/dashboard.md) and [`agent`](2-handbook/web-ui/agent.md).
- **What tools does an agent (or the operator) have available?** →
[`2-handbook/tools/`](2-handbook/tools/README.md) — `hivectl` (yours) plus every agent's MCP
tool surface (bash, forge, lifecycle, matrix).
- **What tools does the operator have?** →
[`2-handbook/tools/`](2-handbook/tools/README.md) — `hivectl` and `swarmctl`. The agents' own tool
surface is in [`4-implementation/agent-tools/`](4-implementation/agent-tools/README.md).
- **What does `hivectl` do? Provisioning, gateway users, container
shells?** → [`2-handbook/tools/hivectl.md`](2-handbook/tools/hivectl.md) (the curated guide);
[`2-handbook/tools/hivectl-cli.md`](2-handbook/tools/hivectl-cli.md) for the exhaustive,
autogenerated flag reference. The other command-line references sit beside it in
autogenerated flag reference. The `swarmctl` reference sits beside it in
[`2-handbook/tools/`](2-handbook/tools/README.md).
### Agent lifecycle
@ -59,11 +59,11 @@ later work.
- **How do per-agent forge accounts work? What does `forge_notify` poll,
and how does it format wake messages?** → [`2-handbook/integrations/forge.md`](2-handbook/integrations/forge.md)
(the swarm's Forgejo); [`2-handbook/tools/forge.md`](2-handbook/tools/forge.md) for the
(the swarm's Forgejo); [`4-implementation/agent-tools/forge.md`](4-implementation/agent-tools/forge.md) for the
`hive-forge` CLI verbs agents actually call.
- **How does the matrix-tuwunel container work? Multiple accounts per
agent?** → [`2-handbook/integrations/matrix.md`](2-handbook/integrations/matrix.md) (the homeserver);
[`2-handbook/tools/matrix.md`](2-handbook/tools/matrix.md) for the MCP tool surface and
[`4-implementation/agent-tools/matrix.md`](4-implementation/agent-tools/matrix.md) for the MCP tool surface and
`services.hyperhive.agent.matrixAccounts`.
- **How to give an agent a GitHub account (`gh` + `git push`)? how's
the PAT injected?** → [`2-handbook/integrations/github.md`](2-handbook/integrations/github.md)
@ -101,6 +101,12 @@ Nothing of it sits in this tree.
## 4. Implementation
### Agent tools
- **What can an agent do inside its container? bash, subagent, forge, matrix, and the
`hive-forge`, `swarm-logs` and `swarm-metrics` CLI references?** →
[`4-implementation/agent-tools/`](4-implementation/agent-tools/README.md).
### Turn loop, scheduler, CI, observability
- **How does claude get its prompt, and what tools does it have?** →

View file

@ -32,4 +32,4 @@ here.
own notification read-state (no local mirror to drift).
- **`body.rs`** — shared `--body`/`--body-file`/stdin resolution.
Full verb reference: `docs/2-handbook/tools/forge.md`.
Full verb reference: `docs/4-implementation/agent-tools/forge.md`.

View file

@ -229,7 +229,7 @@ fn run() -> Result<()> {
}
// Same reasoning as `credential-helper` above: no repo, no forge
// credentials — just a pure render of the clap tree the docs build
// pipes into `docs/2-handbook/tools/forge-cli.md`.
// pipes into `docs/4-implementation/agent-tools/forge-cli.md`.
if let Verb::MarkdownDocs = verb {
// `show_footer(false)`: the default footer's wording ("This
// document was generated automatically by...") is clap-markdown's

View file

@ -73,7 +73,7 @@ pub fn builtin_tools_for(perms: &[Permission]) -> Vec<&'static str> {
/// `Execution` already grants shell execution to the parent agent, via the
/// out-of-process `bash` MCP server (`mcp__bash__run`/`status`/`kill` —
/// see the variant's own doc comment). A subagent has no MCP server at all
/// by default (`docs/2-handbook/tools/subagent.md`), so there is no `mcp__bash__*` for
/// by default (`docs/4-implementation/agent-tools/subagent.md`), so there is no `mcp__bash__*` for
/// it to inherit that permission through; it gets Claude's own `Bash`
/// instead.
///

Some files were not shown because too many files have changed in this diff Show more