Expand description
MuxAPI — high-level commands for programmatic control of AgentMux.
These commands orchestrate multiple low-level operations (CreateBlock, SetMeta, ControllerResync) behind stable, intent-based interfaces. Callers express what they want (“open an agent pane with AgentX”), not how to do it.
Re-exports§
pub use pane::open_pane;pub use agent_define::allocate_agent_workdir;
Modules§
- agent_
define 🔒 - agent_
io 🔒 - agent_
open 🔒 - attachments 🔒
attachments.ingest/attachments.cancel/attachments.info— image attachments in the agent composer (docs/specs/SPEC_AGENT_PANE_IMAGE_ATTACHMENTS_2026_09_26.md §6). The work itself lives inbackend::attachments; these only adapt it to the RPC engine. Typed registration, sofrontend/types/rpc/gets the bindings.- blockfile 🔒
- blockstats 🔒
blockstats.detail: a terminal’s stats badge and its tooltip (backend::blockstats_detail). The window’s, not an agent API: a connection registered as an agent is refused.- bookmarks 🔒
bookmarks.list/bookmarks.set— the browser pane’s saved-URL list. Deliberately a thin wrapper overbackend::bookmarks_store: noStore/ sqlite involvement, no per-agent scoping — seedocs/specs/SPEC_BROWSER_PANE_BOOKMARKS_AND_GO_ICON_2026_08_22.mdfor why this is a dedicatedshared_dirfile instead of the ABF/db_bundlespattern the rest of this directory mostly follows.- browser_
profiles 🔒 browser_profiles.list/.create/.update/.delete: the named browser profiles (docs/specs/SPEC_BROWSER_PANE_PROFILES_MENU_2026_10_09.md §3, §6), ashared_dirfile like the bookmarks. Deleting a profile closes its open tabs first, then the host drops its jar and its folder on the next owned-pane push. Only the window changes profiles: a connection registered as an agent may list them, never create, change or delete one.- browser_
start_ 🔒page browser_start_page.set— the browser pane’s configured start page. Write-only: the read side isGetFullConfig’sbrowserstartpagefield (crates/srv/src/backend/wconfig/types.rs), not a matching.gethere — seedocs/specs/SPEC_BROWSER_PANE_START_PAGE_2026_09_16.md§3.1 for why. Deliberately its own file rather than folded intobookmarks.rs: unlike bookmarks, this handler needsAppState’sconfig_watcher/event_busto update the live config and broadcast immediately, the same shapeCOMMAND_SET_CONFIGalready has (server/websocket.rs).- bundle 🔒
bundle.*MuxAPI handlers — the Armory Bundle Format (ABF) surface.- connections 🔒
- The connection RPCs the frontend’s connection UI already calls
(
conntypeahead.tsx,blockframe.tsx’sConnStatusOverlay), which had no handler until now (P0 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md). - dev_
server 🔒 POST /api/v1/agent/dev_server/register— backs theRegisterDevServerMCP tool. See docs/specs/SPEC_NATIVE_CONTAINER_DEV_PROXY_2026_09_19.md.- fleet 🔒
- Fleet control — select, broadcast, and bulk-act on many agents at once. See docs/specs/SPEC_MULTI_AGENT_FLEET_CONTROL_2026_08_20.md.
- global_
memory 🔒 - Global Memory MuxAPI bodies, moved out of app_api/mod.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md item 9).
- identity 🔒
- layout 🔒
layout.save— write one window as anagentmux.layoutfile (docs/specs/SPEC_LAYOUT_FILES_2026_09_25.md §6.1). The walk and the per-view allowlist live inbackend::layout_file; this is the RPC shell.- mcp 🔒
- MuxAPI handlers for the v1 standalone MCP Server primitive. mcp.list / mcp.get / mcp.upsert / mcp.delete / mcp.bind / mcp.unbind
- mcp_
health 🔒 agentmux-mcp doctor’s two calls (docs/specs/SPEC_AGENT_MCP_SELF_HEAL_2026_10_10.md §7): what srv knows about the caller’s ownagentmuxMCP server, and “repair it now”.- memory 🔒
- pane 🔒
- presence 🔒
- The cloud presence publisher’s status and “Publish now”
(
muxbus::wan_presence), for Settings’ “Cloud presence” line. - session 🔒
- shells 🔒
shell.list: the shells installed here, and which one a new local terminal starts with, for Settings’ default-shell picker (backend::shells).- skill 🔒
- MuxAPI handlers for the v1 standalone Skill primitive. skill.list / skill.get / skill.upsert / skill.delete / skill.bind / skill.unbind
- tower_
pane 🔒 - Tower, the read-only task manager pane (
backend::tower_sampler; SPEC_TOWER_TASK_MANAGER_PANE_2026_10_08.md):tower.sample. - viewer 🔒
- The desktop’s side of pairing a device with the viewer listener
(
backend::viewer, agentmux-mobile’s SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §13.2): the QR, the paired-devices list with Revoke, and an agent’s “hide from paired devices” flag. Reached over the full-key WebSocket only, like every RPC. - voice 🔒
voice.checkPath— live existence check for the local whisper.cpp CLI binary or GGML model file paths configured in Settings -> Recording.
Functions§
- check_
s1 🔒 - S1: the caller may only act on itself.
- check_
s1_ 🔒resolved check_s1’s decision over plain strings, so it can be tested without constructing anRpcContext.- find_
agent_ 🔒block - Find an existing agent block in a tab by agent ID.
- find_
editor_ 🔒block - Find an Editor-view block the tab shows (
shown_block_ids: in front of its stack, not minimized, not hidden behind a magnified pane) onconnection(its metaconnection; absent andlocalare this computer), if any. Direct sibling offind_agent_blockabove, checkingmeta.view == "editor"instead ofmeta.agentId. An editor on another connection is never it: its reads and saves go there (remote terminals spec §6.3). - global_
output_ 🔒source - If the agent’s GLOBAL transcript zone (
agent:<defId>:current) hasoutput, return(global_store, agent_zone)— preferred even when this channel’s localoutputis non-empty. ReturnsNonewhen the block isn’t agent-anchored or is archived, there’s no global store, or the global zone is empty — callers then read the per-channel store keyed byblock_id. - global_
zone_ 🔒line_ count - Exact non-blank line count of the
outputfile inzone, computed via the same streaming index builderread_rangeuses (so the two endpoints always agree). ReturnsSome(0)for an empty file,Noneon read failure. - now_ms 🔒
- Milliseconds since the Unix epoch, as
i64. - parse_
seed_ 🔒zoom - Parse + validate a saved per-agent
ui:zoomcontent blob for seeding a new agent block’sterm:zoom. ReturnsSome(z)only for a parseable, non-default (≠ 1.0), in-[0.5, 2.0] zoom (the range the frontend enforces in term.tsx); anything else (default, out of range, garbage) returnsNoneso the new block opens at the default 1.0. See SPEC_AGENT_ZOOM_PERSISTENCE §4.2. - register_
app_ api_ handlers - Register all MuxAPI handlers on the RPC engine.
- resolve_
agent_ 🔒definition_ id - Resolve an S1-authenticated agent id (the slug — AGENTMUX_AGENT_ID /
bus:register id, e.g. “Agent3”) to the agent’s DEFINITION id, which is
what
db_agent_identity_links.agent_idstores (==AgentDefinition.id; see m0013 andidentity/resolver/inject.rs::resolve_bindings_for_instance). - resolve_
tab_ 🔒id - Resolve a tab ID: use the provided one, or fall back to the first workspace’s active tab.
- resolve_
tab_ 🔒id_ for_ block - Find which tab a given block currently belongs to, by scanning every
tab’s
blockids. Needed becauseresolve_tab_idonly resolves an explicit tab_id or “the active tab” — neither answers “which tab is MY OWN block in,” which a caller passing its own block id (e.g. an MCP tool’ssplit_reference_block_id) actually needs. - same_
pane_ 🔒connection - Whether two panes’ connections are one: absent and
localare this computer; otherwise the same host however it is spelled. - shown_
block_ 🔒ids - The blocks a tab’s layout shows: each pane’s active member (the tab in front of its stack), leaving out minimized panes, and every pane but the magnified one while one is magnified. A file pushed into an editor the user can’t see would look like nothing happened (SPEC_AGENT_PANE_TOOL_PEEK_ON_LINE_AND_MD_OPEN_IN_EDITOR_2026_10_11.md §2.2).