Expand description
HTTP /agentmux/service dispatcher, split into concern-based submodules.
object/client/window/workspace/misc— the per-service RPC handlersdispatch_serviceroutes to.introspect— agent-facing read-only tree snapshots +AgentContextresolution (backs/api/v1/self,/layout, naming verbs).object_helpers— wave-object read/update/meta primitives.reducer_helpers— reducer dispatch / event publish / compensation.layout_helpers— layout-tree + pending-action writers used by the drag-and-drop / tear-off / redock handlers.
pub use re-exports keep every external call site
(crate::server::service::…, super::service::…) unchanged.
Modules§
- client 🔒
clientservice handler.- credential 🔒
credentialservice — the paired CEF host’s browser-pane Basic-Auth credential broker calls this, host→srv, to resolve an identity for a pane and to look up / save / delete / fill a stored site credential.- host_
ipc 🔒 host_ipcservice — the paired CEF host pushes its own CDP-automation credentials (ipc_port+ipc_token, gating/agentmux/browser/*on the host’s own IPC server) here once, at the host’s own startup, right after it learns this srv instance’s address. srv has no other way to learn these values — the host generatesipc_tokenfor itself and is the sole source of truth.- introspect 🔒
- Agent-facing introspection:
AgentContextresolution plus the read-only window → workspace → tab → pane snapshots that back/api/v1/self,/api/v1/layout, and the naming verbs. Pure mstore reads — no reducer. - layout_
helpers 🔒 - Layout-tree + pending-action writers used by the tear-off / promote /
redock handlers. SPEC_864 Phase 3/4 — all of them route through the
reducer (
seed_layout_via_reducer/queue_layout_actions_via_reducer); nothing here writes mstore directly anymore.setup_torn_off_block_layoutis re-exported crate-wide (the pane app-API uses it). - layout_
intents 🔒 - Apply a layout intent and store its result: the write path of every layout
edit a window makes (
layout.applyIntent), and of srv’s own placements (place_block). SPEC_STRONG_REDUCER_AUTHORITY_LAYOUT_2026_06_30.md §4. - misc 🔒
- Catch-all service handler for the smaller service namespaces (userinput / block / subagent / history / agent).
- object 🔒
objectservice handler (GetObject, CreateBlock, UpdateObject, …).- object_
helpers 🔒 - AgentMux-object read/update/meta primitives used by the
objectservice handler, plus the per-agent zoom mirror.update_object_metaandschedule_agent_zoom_mirrorare re-exported crate-wide. - pane_
share 🔒 - What fraction of its tab’s area each docked pane has, from the layout tree srv holds
(docs/specs/SPEC_AGENT_PANE_PLACEMENT_FLOATING_2026_11_22.md §2.3):
Pane layout’sshare. - pin 🔒
workspaceservice handlers for pinning a pane to its window:PinBlockToWindowandUnpinBlockFromWindow(docs/specs/SPEC_PIN_TRANSFORM_FACILITY_2026_12_02.md§9). A pin is a flag: the pane stays in its tab and in that tab’s layout, and the page draws it over the other tabs at the place it has in its own. So a pin, and an unpin in the pane’s own tab, are one reducer command and change no layout. Unpinned in another tab, the pane moves into that tab: onto the edge it was on, at its own thickness.- redock_
origin 🔒 - Where a torn-off pane came from, and where a redock puts it back (SPEC_FLOATING_PANE_REDOCK_TO_ORIGIN_2026_11_03.md).
- reducer_
helpers 🔒 - Phase E.2c.2 reducer-dispatch helpers shared by the service handlers and
(via
crate::server::service::…) the sagas. - session_
closed 🔒 - Closed windows: closing a window keeps it in the open workspace
(
docs/specs/SPEC_WORKSPACES_2026_10_23.md§2, §5; closing is not deleting,SPEC_OFFLINE_RESILIENCE_2026_10_20.mdG8). - session_
other_ 🔒builds - Restore a layout another build saved.
- session_
restore 🔒 - Restore-on-relaunch (Feature 1 of
docs/specs/SPEC_SESSION_RESTORE_AND_SAVED_LAYOUTS_2026_08_13.md). - session_
slots 🔒 - The window slots of the open workspace: the order its windows are listed in, open and closed alike, in the version pill’s instance panel. Every window has a slot for good: closing one keeps it, reopening it returns to it, and a window that is opened for the first time takes the next one at the end. Only a window that is deleted (an open one removed from the workspace, a closed one removed from the list) gives its slot up, and the ones after it move up.
- session_
windows 🔒 - Every window comes back after a quit, an upgrade’s included
(
docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md§6.1). - stop_
requests 🔒 - What the service route’s
QuitAgentandShutdownAgentmay ask of the person: the same who-may-stop-whom asStop agents(asked by an agent the token names, of an agent’s pane that is not the caller’s own), one countdown per agent, and a limit on the countdowns one caller opens. - tab_
lifecycle 🔒 workspaceservice handlers — tab CRUD (CreateTab,SetActiveTab,CloseTab,UpdateTabIds,ReorderTab). Split out ofworkspace.rs; see that file’s dispatcher for the full method list.- tab_
move 🔒 workspaceservice handlers — drag-and-drop block/tab moves (MoveBlockToTab,PromoteBlockToTab,MoveTabToWorkspace,RestoreTornOffTab). Split out ofworkspace.rs; see that file’s dispatcher for the full method list.- tear_
off 🔒 workspaceservice handlers — floating-pane / torn-off tab flows (TearOffBlock,RedockFloatingPane,TearOffTab). Split out ofworkspace.rs; see that file’s dispatcher for the full method list.- user_
workspace 🔒 - The open workspace: a named set of windows, saved as it changes
(docs/specs/SPEC_WORKSPACES_2026_10_23.md §2, §4, §8). Not the srv
Workspaceobject, which is one window’s contents. - user_
workspace_ 🔒files - A workspace as a file (docs/specs/SPEC_WORKSPACES_2026_10_23.md §3.2, §4.2): ☰ → Workspaces → Export… and Import….
- user_
workspace_ 🔒switch - Several workspaces, one open at a time (docs/specs/SPEC_WORKSPACES_2026_10_23.md
§3.2, §6): list them, make a new one, switch, delete one. Not the srv
Workspaceobject, which is one window’s contents. - window 🔒
windowservice handler (GetWindow, CreateWindow, CloseWindow, …).- window_
close 🔒 windowservice handler —CloseWindow. Split out ofwindow.rs; see that file’s dispatcher for the full method list.- window_
create 🔒 windowservice handler —CreateWindow. Split out ofwindow.rs; see that file’s dispatcher for the full method list.- window_
inherit 🔒 windowservice handlers —MarkWindowOpenandInheritWindowAppearance: a new window opens with the theme and opacity of the window that created it (docs/specs/SPEC_PER_WINDOW_THEME_AND_OPACITY_2026_10_12.md §6).- window_
mutate 🔒 windowservice handlers — window mutation RPCs (SwitchWorkspace,SetWindowPosAndSize,SetWindowOpacity,SetWindowTopology). Split out ofwindow.rs; see that file’s dispatcher for the full method list.- window_
query 🔒 windowservice handlers — read-only lookups (GetWindow,FindWindowByLabel). Split out ofwindow.rs; see that file’s dispatcher for the full method list.- workspace 🔒
workspaceservice handler (workspace + tab lifecycle, drag-and-drop moves).- workspace_
lifecycle 🔒 workspaceservice handlers — workspace CRUD (CreateWorkspace,GetWorkspace,DeleteWorkspace,UpdateWorkspace). Split out ofworkspace.rs; see that file’s dispatcher for the full method list.
Functions§
- dispatch_
service 🔒 - handle_
service 🔒 - run_
service_ 🔒call - Dispatch a service call and broadcast any resulting
MuxObjUpdates to the event bus — the shared core ofhandle_service. Factored out so the typed first-class agent-API verbs (e.g./api/v1/window/name) get byte-identical persistence + broadcast to a raw/agentmux/servicecall without re-implementing it. See SPEC_AGENT_API_FIRST_CLASS_SURFACE_2026_06_17.md. - run_
service_ 🔒call_ as run_service_callfor a request whose agent token namescaller_uid(None: no agent credential).- update_
object_ 🔒meta - Update object meta by oref string. Merges meta into existing object.