feat(service): reach a Manager's followers' Macs
PR 2 of the Manager settings plan (STAG-4014, STAG-4025). PR 1 (#10769) added agent_follower. This PR makes the Mac tools read it, adds the procedures and a live read over it, and makes messaging a Manager follow it.
What changes
-
Routing
findMacOwnernow answersmanagerId, the agent itself, where the agent stands on no task. It reads through a worker's conversation to its Manager, as it already did for tasks.peopleOfreads the Manager's followers (listAgentFollowers) in place of a task's.routeOf,defaultMachinesOf(the composer's machine list) andlist_machinesthen reach a follower's Mac while their switch is on. They needed no changes of their own.- Refusals now say "this task's or Manager's agents", in the service's words and on the panel's refusal card.
list_machines's description names a Manager's followers.
-
Hosted procedures (
agentFollowers), additive only:list:GET /api/agents/{id}/followersfollow/unfollow:PUT/DELETE ā¦/followingsetMachines:PUT ā¦/following/machinesadd:POST ā¦/followersremove:DELETE ā¦/followers/{userId}
Each answers
{ agentId, followers: [{ userId, owner, machines }], txid? }. An agent the caller doesn't reach, or one on a task, answersnot-found. Unfollowing or removing the owner, or switching the owner's machines, answersnot-permitted. No floor or version change. In the member MCP coverage,listisSCREEN_ONLYand the writes areMEMBER_ONLY, as the task follower procedures are. -
Live read
agentFollowers(/api/live/agent-followers?id=) has two parts:owner: one row while the owner is a member of the workspace;followers: the other followers who are still members, with their switch.
It is gated like the store (
agentReachableBy, agent on no task, the reader's membership joined) and woken on the agent's topic.agent_followeris now synced (migrationsync_agent_follower, rendered bysync:render). -
Follow on message:
followAsMessagednow takes the agent. On no task, it follows the Manager with machines on (followAgentAsMessaged), and an existing follower keeps their switch. Both the typed and the queued paths go through it.
"Who asked" routing (sending a call to the Mac of the member whose line opened the turn) is not here. That is PR 3, STAG-4028.
Tests
machine-routing.test.ts, new case: a Manager's pick of a teammate's Mac is refused before they follow, refused as not-let while their switch is off, and taken once it's on. A follower row naming someone outside the workspace never reaches their Mac. The composer's list offers only the follower's machine. I saw it fail with the Manager branch ofpeopleOfturned off.agents-app-messages.test.ts, new case: a teammate who messages a Manager follows it with their machines on. I saw it fail without the change.live-procedures.test.ts, new case: a member reads the owner and a follower. A member of another workspace, and a read of an agent on a task, answernot-found.- I ran these three files whole, plus
agent-queue-app.test.ts,sync/live-query.test.ts,database/sync/__tests__/capture.test.ts,orpc/handler.test.ts,orpc/base.test.ts,apps/web/tests/orpc-route.test.tsandstorage-schema.test.ts. All pass. tsc -bfor the service,repository-checks.sh, oxlint, biome and the style guard pass. Knip reports nothing for these files. CI runs the rest.
š¤ Generated with Claude Code