Skip to main content

Module work_facts_handlers

Module work_facts_handlers 

Source
Expand description

HTTP side of agents’ work facts (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.1, §3.2):

  • GET /api/v1/work-facts: this srv’s own agents’ facts. Other channels on this computer call it; it never fans out itself.
  • GET /api/v1/work-facts/who: the WhoIsWorkingOn MCP tool. This srv’s agents plus every other channel’s (through the host-global registry, the same reach ListConversations has), matched against the question. LAN and WAN agents are listed by name only: their facts stay on their own computer.

Both answers include live work claims (ClaimWork, §3.4, work_claims_handlers). Also adds the facts to ListConversations entries (annotate_conversations).

Structs§

WhoParams
WhoIsWorkingOn’s arguments, plus who is asking (agent, block: the MCP’s own AGENTMUX_AGENT_ID and block id; the request’s agent token wins over both).

Constants§

NOTE 🔒
Shown with every answer, so an agent reads it as information.

Functions§

annotate_conversations 🔒
Add a work field (see work_facts::conversation_summary) to every host and cross-channel ListConversations entry that names its block, from the facts start_conversation_facts gathered. If gathering failed the entries are left as they were.
caller_block 🔒
The caller’s own block: by its token’s UID, else the block id it sent, else its name when exactly one registered agent has it. Only used to leave the caller out and to read its own repository, so a name is enough.
cross_channel_facts 🔒
Every other channel’s agents’ facts, plus the channels that didn’t answer.
handle_who_is_working_on 🔒
GET /api/v1/work-facts/who: WhoIsWorkingOn.
handle_work_facts
GET /api/v1/work-facts: this srv’s own agents’ work facts.
local_facts 🔒
This srv’s own agents’ facts. Store reads, so off the async workers.
remote_agents 🔒
LAN and WAN agents: name and liveness only.
split_caller 🔒
Take the caller’s own facts out of facts.
start_conversation_facts 🔒
Start gathering every agent’s facts for ListConversations, this srv’s and the other channels’ at once, so the handler can run its own preview fan-out meanwhile rather than paying a second round after it.