You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a mention-driven agent to document-swarm, reply only #233
A person mentions an agent in a heading's chat room. The agent reads that section and replies in the same thread. Nothing does this today.
An earlier audit ranked this first, because it needed no identity work. That justification is gone: chat now has its own MCP tools, so it needs no separate identity work. So this is now an internal demonstration, not the path to a product.
What to do
Add an agent subcommand to packages/document-swarm. Three files: one new src/agent.ts, one case 'agent': in the CLI switch, and one Readme paragraph.
The loop: mint or adopt one account, refuse any non-allowlisted host, poll public.messages from a seq cursor, match its own username, read the mentioned heading's section, call a model once, insert one reply.
Reply only. No document writes.
Acceptance
bun document-swarm agent --url <doc-url> answers a mention in the same heading room.
Every polled row is checked, in TypeScript, against the document that preflightSwarmTarget already returned. A row for another document is refused.
The reply strips @ before insert, so it cannot fire the notification fan-out.
client_id is set from the mention id, so a retried reply cannot double-post.
The host allowlist refuses production, unchanged.
Notes
packages/document-swarm is "private": true and never published. classifySwarmHost refuses every host but localhost, *.local and stage.docs.plus, so this cannot reach production by design. That is why it does not touch the open ruling in #165.
The first two acceptance items are security conditions, not polish. Without the first, one bot token reads chat across the instance.
Ordered last in the connector work. Nothing depends on it.
Activity