Expand description
HTTP adapters over app_api: memory, global memory, fleet stop and stop forwarding. Split out of server/mod.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md ยง4.1).
Structsยง
- Agent
Broadcast ๐Confirm Request - A forwarded broadcast as a confirmation names it: the body by its SHA-256, never the words.
- Agent
Broadcast ๐Forward Request - Agent
Global ๐Memory Diff Query - Agent
Global ๐Memory History Query - Agent
Global ๐Memory Reach Request - Agent
Global ๐Memory Read Query - Agent
Global ๐Memory Remove Request - Agent
Global ๐Memory Revert Request - Agent
Global ๐Memory Write Provenance Req - Agent
Global ๐Memory Write Request - Agent
Memory ๐Diff Query - Agent
Memory ๐History Query - Agent
Memory ๐List Query - Agent
Memory ๐Read Query - Agent
Memory ๐Revert Request - Agent
Memory ๐Write Request - Agent
Stop ๐Forward Request - Agent
Stop ๐Pending Forward Request
Functionsยง
- app_
api_ ๐response - A MuxAPI result as its HTTP answer: the value, or the error under the status of its kind
(
api_error::ApiError). An error that is still a plainStringgets its kind from its text. - default_
agent_ ๐globalmemory_ write_ detail - default_
agent_ ๐globalmemory_ write_ source - forwarded_
asker ๐ - Who a request from another instance says is asking: the tokenโs agent when it carries one, else the name the forwarding instance sent, shown as a claim.
- handle_
agent_ ๐broadcast_ confirm POST /agentmux/agent/broadcast/confirm: another instance on this machine asks whether this one sent that forward from the operatorโs window. Answers yes once, and only for a forward this instance sent; a request that carries an agentโs token is refused.- handle_
agent_ ๐broadcast_ forward POST /agentmux/agent/broadcast: another channel on this machine asks this one to deliver a Swarm broadcast to one of its agent panes (same trust model as the stop forward above: loopback, this instanceโs own auth key). The header is built here; the caller supplies only the body.- handle_
agent_ ๐globalmemory_ diff GET /api/v1/agent/globalmemory/diff?id=<id>&from_version_id=&to_version_id=โ a line-based diff between two recorded versions, both of which must belong toid(same ownership check as/api/v1/agent/memory/diffโsagent_idscoping โ seeglobal_memory_diff_implโs own doc comment for why). Backs theGlobalMemoryDiffMCP tool.- handle_
agent_ ๐globalmemory_ history GET /api/v1/agent/globalmemory/history?id=<id>โ list every recorded version of one Global Memory entry, newest first. Refuses a system-tier, blank, or non-global id the same wayread/removealready do โ seeglobal_memory_history_implโs own doc comment. Backs theGlobalMemoryHistoryMCP tool.- handle_
agent_ ๐globalmemory_ list GET /api/v1/agent/globalmemory/listโ every Global Memory entry, system rows first and flaggedsystem, summary only (id/name/updated_at/system, no content). Read, write and remove still refuse a system id. Backs theGlobalMemoryListMCP tool. Seedocs/specs/SPEC_GLOBAL_MEMORY_LIST_SYSTEM_ROWS_2026_10_02.md.- handle_
agent_ ๐globalmemory_ reach POST /api/v1/agent/globalmemory/reachโ set where an existing Global Memory entry goes:fleet(every proven machine) ormachine(this one only). Backs thereachaction of the Memory tool.- handle_
agent_ ๐globalmemory_ read GET /api/v1/agent/globalmemory/read?id=<id>โ full content of one ordinary Global Memory entry. Backs theGlobalMemoryReadMCP tool.- handle_
agent_ ๐globalmemory_ remove POST /api/v1/agent/globalmemory/removeโ demote a Global Memory entry (clearsis_global; the bundle row itself survives, same as Memory โ Globalโs own โRemoveโ button), recorded as aremoveversion under the agent the requestโs token names so the removal can be seen and undone. A request without that token is refused. Backs theGlobalMemoryRemoveMCP tool.- handle_
agent_ ๐globalmemory_ revert POST /api/v1/agent/globalmemory/revertโ restore a Global Memory entryโs live content to a prior recorded version, recorded as a NEW version (source: "revert") โ never rewrites or deletes history, same as/api/v1/agent/memory/revert. Never reaches a system-tier row โ seeglobal_memory_revert_implโs own doc comment. Backs theGlobalMemoryRevertMCP tool.- handle_
agent_ ๐globalmemory_ write POST /api/v1/agent/globalmemory/writeโ create a new ordinary Global Memory entry, or update an existing one byid. Never reaches a system-tier row either way โ seeglobal_memory_write_implโs own doc comment for the full invariant. Backs theGlobalMemoryWriteMCP tool.- handle_
agent_ ๐memory_ diff GET /api/v1/agent/memory/diff?agent_id=<slug>&from_version_id=&to_version_id=โ a line-based diff between two recorded versions, both of which must belong toagent_id(reagent P1 โ seememory_diff_implโs own doc for why). Backs theMemoryDiffMCP tool.- handle_
agent_ ๐memory_ history GET /api/v1/agent/memory/history?agent_id=<slug>&filename=<f>โ list every recorded version of one memory file, newest first. Backs theMemoryHistoryMCP tool.- handle_
agent_ ๐memory_ list GET /api/v1/agent/memory/list?agent_id=<slug>โ list the agentโs own native-memory markdown files. Backs theMemoryListMCP tool.- handle_
agent_ ๐memory_ read GET /api/v1/agent/memory/read?agent_id=<slug>&filename=<f>โ read one of the agentโs own memory files. Backs theMemoryReadMCP tool.- handle_
agent_ ๐memory_ revert POST /api/v1/agent/memory/revertโ restore a memory fileโs live content to a prior version, recorded as a NEW version (source: "revert") โ never rewrites or deletes history. Backs theMemoryRevertMCP tool.- handle_
agent_ ๐memory_ write POST /api/v1/agent/memory/writeโ create/overwrite one of the agentโs own memory files (atomic tmpโrename). Backs theMemoryWriteMCP tool โ the primary write path an agent actually uses, soprovenance(optional, see docs/specs/SPEC_MEMORY_VERSION_CONTROL_AND_ARMORY_AUDIT_2026_08_19.md ยง4.1) threads through to the version history here, not just on the WebSocket RPCโsagent:memory:write_file.- handle_
agent_ ๐stop_ forward POST /agentmux/agent/stopโ the cross-channel bulk-stop forward target. Seefleet_bulk_stop_implโs doc comment for the caller side. The request names its asker itself and cannot be checked, so it goes through this instanceโs own override window (banner, chime, Keep running) like/agentmux/agent/stop-pending: the stop happens after 30 s unless the user keeps the agent running.- handle_
agent_ ๐stop_ pending_ forward POST /agentmux/agent/stop-pendingโ another instance on this machine forwards an agentโsFleetBulkStopfor a block running HERE: open this instanceโs own override window (banner, chime, Keep running) rather than stopping at once. The caller polls/api/v1/agent/shutdown/{request_id}here. Same trust model and gate as/agentmux/agent/stop.- handle_
fleet_ ๐bulk_ stop POST /api/v1/fleet/bulk-stopโStop agents: close each named agentโs tab (docs/specs/SPEC_STOP_AN_AGENT_ONE_WAY_AND_SHUTDOWN_TOAST_2026_10_23.md). Backs theStoptoolโsagentsaction. Infallible per target (never a single bool):{ succeeded, failed }.- open_
forwarded_ ๐window - Opens this instanceโs own override window for a stop or close another instance asked for, and answers with it.