Skip to main content

Module service

Module service 

Source
Expand description

HTTP /agentmux/service dispatcher, split into concern-based submodules.

  • object / client / window / workspace / misc — the per-service RPC handlers dispatch_service routes to.
  • introspect — agent-facing read-only tree snapshots + AgentContext resolution (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 🔒
client service handler.
credential 🔒
credential service — 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_ipc service — 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 generates ipc_token for itself and is the sole source of truth.
introspect 🔒
Agent-facing introspection: AgentContext resolution 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_layout is 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 🔒
object service handler (GetObject, CreateBlock, UpdateObject, …).
object_helpers 🔒
AgentMux-object read/update/meta primitives used by the object service handler, plus the per-agent zoom mirror. update_object_meta and schedule_agent_zoom_mirror are 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’s share.
pin 🔒
workspace service handlers for pinning a pane to its window: PinBlockToWindow and UnpinBlockFromWindow (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.md G8).
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 QuitAgent and ShutdownAgent may ask of the person: the same who-may-stop-whom as Stop 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 🔒
workspace service handlers — tab CRUD (CreateTab, SetActiveTab, CloseTab, UpdateTabIds, ReorderTab). Split out of workspace.rs; see that file’s dispatcher for the full method list.
tab_move 🔒
workspace service handlers — drag-and-drop block/tab moves (MoveBlockToTab, PromoteBlockToTab, MoveTabToWorkspace, RestoreTornOffTab). Split out of workspace.rs; see that file’s dispatcher for the full method list.
tear_off 🔒
workspace service handlers — floating-pane / torn-off tab flows (TearOffBlock, RedockFloatingPane, TearOffTab). Split out of workspace.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 Workspace object, 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 Workspace object, which is one window’s contents.
window 🔒
window service handler (GetWindow, CreateWindow, CloseWindow, …).
window_close 🔒
window service handler — CloseWindow. Split out of window.rs; see that file’s dispatcher for the full method list.
window_create 🔒
window service handler — CreateWindow. Split out of window.rs; see that file’s dispatcher for the full method list.
window_inherit 🔒
window service handlers — MarkWindowOpen and InheritWindowAppearance: 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 🔒
window service handlers — window mutation RPCs (SwitchWorkspace, SetWindowPosAndSize, SetWindowOpacity, SetWindowTopology). Split out of window.rs; see that file’s dispatcher for the full method list.
window_query 🔒
window service handlers — read-only lookups (GetWindow, FindWindowByLabel). Split out of window.rs; see that file’s dispatcher for the full method list.
workspace 🔒
workspace service handler (workspace + tab lifecycle, drag-and-drop moves).
workspace_lifecycle 🔒
workspace service handlers — workspace CRUD (CreateWorkspace, GetWorkspace, DeleteWorkspace, UpdateWorkspace). Split out of workspace.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 of handle_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/service call without re-implementing it. See SPEC_AGENT_API_FIRST_CLASS_SURFACE_2026_06_17.md.
run_service_call_as 🔒
run_service_call for a request whose agent token names caller_uid (None: no agent credential).
update_object_meta 🔒
Update object meta by oref string. Merges meta into existing object.