Watch
0
0
Fork
You've already forked hyperhive
0

swarm: the commands and skills an agent's message box offers

GET /api/agents/{name}/commands answers with the swarm's own commands, a table
in the controller, then the skills the agent's harness published to its key of
the agent-commands bucket. The published part is untrusted and cut down: plain
names only, no repeats, never a command's name, a capped list and one short line
per description. The agent credential may publish its own key. Nothing publishes
yet; the harness half and the swarm UI menu follow.
This commit is contained in:
iris 2026-11-15 19:42:17 +01:00
commit 8f11a38d17

View file

@ -278,6 +278,14 @@ the stored bytes, and 404 means the agent has no icon. swarm-ui's agent cards
load it as an `<img>` and show the dimmed default agent icon (a robot head in a
round frame, `branding/agent-default.svg`) for an agent without one.
The skills the agent has go to its key of the `agent-commands` bucket, for the swarm UI's command menu.
The agent's credential may publish `$KV.agent-commands.<agent>` and nothing else of the bucket. The value is a
list of `{name, description}`. `GET /api/agents/<name>/commands` answers with the swarm's own commands first (a
table in `agent_commands.rs`, today `compact`), then the agent's skills sorted by name. The skills come from the
agent, so the controller drops a name that isn't one plain word, a repeat, and any that takes a command's name,
keeps at most 200, and cuts each description to one line of 200 characters. An agent that published nothing gets
just the swarm's commands.
The fourth is its **`AGENTS.md`**, which goes into the `agents-md` bucket under
the key `<agent>`, writable by the agent's own credential alone
(`$KV.agents-md.<agent>`). The swarm reads that copy and edits the file through