feat(relaycast): visibility-only agent directory grant (r on relaycast:agent/<name>)
What
A visibility-only grant for the agent directory. GET /v1/agents and GET /v1/agents/:name now also show an agent when the caller may read its directory entry relaycast:agent/<name>. Before, an agent was visible only if the caller could write or read its inbox, so a group could not see an agent without also being able to (or claiming to be able to) message it, and agents whose names match no inbox prefix (e.g. editor or desktop agents named after their person) were invisible to everyone outside their group.
- Only
ris ever checked onrelaycast:agent/<name>. It shows name, status, persona and card; DMs still needwonrelaycast:inbox/<name>. - Entries are operator policy only:
PUT /v1/streams/{id}refuses everyrelaycast:agent/id (agent_directory_operator_only), so an agent can't show itself, or anyone else, to another group. - No policy change means no behaviour change.
Example: the pit (22) sees every agent, other groups unchanged:
"streamDefaults": [{"prefix": "relaycast:agent/", "gid": 22, "mode": "040"}, ...]
Why
Slack thread agents (pit) need to see every agent on the relay, including local editor/desktop agents, while messaging outside the pit stays denied. Paired with an infra PR in AgentWorkforce/infra (slack-relay relay_agents tools).
Tests
test/relaycast.test.ts: without the grant an uncovered agent is invisible to the pit; with it the pit lists and fetches every agent, DMs to local/editor agents still 403, local and guest views are unchanged, and registering a relaycast:agent/ stream is refused. Full suite 152/152, typecheck clean.
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds a visibility-only agent directory grant so GET /v1/agents and GET /v1/agents/:name show an agent when the caller may read its directory entry relaycast:agent/<name>. Previously an agent was visible only if the caller could write or read its inbox, which meant a group couldn't see an agent without also being able to message it, and agents whose names match no inbox prefix (e.g. editor or desktop agents named after their person) were invisible outside their group.
- Only
ris ever checked onrelaycast:agent/<name>; it shows the agent's name, status, persona and card, and grants nothing else — DMs still needwonrelaycast:inbox/<name>. - Entries are operator policy only:
PUT /v1/streams/{id}refuses everyrelaycast:agent/id, so an agent can't show itself, or anyone else, to another group. Visibility widens only through an exact override or a prefix default underrelaycast:agent/; registered stream rows and broader defaults likerelaycast:never count. - No policy change means no behavior change; docs and tests updated.