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 πForward Request - Agent
Global πMemory Diff Query - Agent
Global πMemory History Query - 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_ πerror_ status - Classify an app-API or naming error string into an HTTP status. The
service layer returns plain
Stringerrors, so this matches on text. FORBIDDEN is a 403. βnot foundβ is a 404: a caller holding a stale or unknown id names a missing resource, not a malformed request (SPEC_WINDOW_NAME_API_HARDENING_2026_08_08.md Β§3.2). Argument errors are a 400. Everything unrecognized is a 500 (genuine service faults, e.g. SQLite write failures). The one classifier for MuxAPI routes here and the naming routes inhttp_naming.rs. - app_
api_ πresponse - default_
agent_ πglobalmemory_ write_ detail - 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_ 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). 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; this is juststop_one_agent_blockrun against THIS instanceβs own (in-process) controller registry, for a target the CALLING channel couldnβt find in its own β same one-hop-forward shape as/agentmux/reactive/injectβs cross-channel tier, no further forwarding.- 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 many agent panes (block ids) at once. Backs theFleetBulkStopMCP tool. Infallible per-target (never a single bool) β seeFleetActionResultβs doc comment.