Skip to main content

Module api_types

Module api_types 

Source
Expand description

Canonical HTTP request/response DTOs shared between agentmux-srv, agentmux-mcp, and agentmux-bashwrap. Every struct here is the single source of truth for the corresponding wire shape; the three crates all import rather than redeclare these types.

Re-exports§

pub use crate::file_rename_types::FileRenameRequest;
pub use crate::ui_record_types::UiRecordRequest;
pub use crate::ui_record_types::UiRecordResponse;
pub use crate::ui_screenshot_types::ScreenshotRegion;
pub use crate::ui_screenshot_types::UiScreenshotRequest;
pub use crate::ui_screenshot_types::UiScreenshotResponse;
pub use crate::agent_create_types::ContainerAsk;
pub use crate::agent_create_types::CreateAgentRequest;
pub use crate::agent_create_types::ImportAgentRequest;
pub use crate::agent_create_types::RouteAsk;
pub use crate::agent_create_types::SpawnAgentRequest;
pub use crate::agent_create_types::SpawnManyRequest;
pub use crate::agent_create_types::SpawnWorkerSpec;
pub use crate::browser_control_types::UiBrowserHandoffStatusRequest;
pub use crate::browser_control_types::UiBrowserReleaseRequest;
pub use crate::browser_control_types::UiBrowserRequestRequest;
pub use crate::browser_control_types::UiBrowserRetakeRequest;
pub use crate::browser_control_types::UiBrowserTakeControlRequest;
pub use crate::browser_control_types::UiBrowserZoomRequest;
pub use crate::browser_control_types::UiBrowserLocateRequest;
pub use crate::place_args::PanePlaceRequest;
pub use crate::place_args::PlaceArgs;

Structs§

AgentWorkersRequest
POST /api/v1/agent/spawn — backs the Agents tool’s spawn (docs/specs/SPEC_AGENT_WORKERS_2026_10_15.md §3.1): the calling agent, the leader, opens a worker: a new agent built from its own definition (not a fork: no history), in its team tab. POST /api/v1/agent/workers — backs the Agents tool’s workers (docs/specs/SPEC_AGENT_WORKERS_2026_10_15.md §3.4): the calling agent’s own workers, by its signed identity.
CaptureInto
A new entry (kind and label), or an existing one by id, whose value is then replaced and the old one kept 7 days. part defaults to the kind’s main value.
CaptureRule
One value Terminal run takes out of a command’s output into the Vault (SPEC_VAULT_GENERATE_CAPTURE_AND_BROWSER_SIGNINS_2026_10_28.md §4.2).
ClosePaneRequest
DesktopAuthorizeRequest
POST /api/v1/agent/desktop/authorize — asked before every Desktop action but apps (§5.4); waits while the user is asked.
DesktopPolicyRequest
POST /api/v1/agent/desktop/policy — backs Desktop’s apps (docs/specs/SPEC_DESKTOP_DRIVING_2026_10_20.md §5.1): whether the tool is on, and for each window whether it is blocked or already granted.
DesktopRecordRequest
POST /api/v1/agent/desktop/record — what an authorized action did (§5.10). Typed text is never sent, only its length in details.
DesktopReleaseRequest
POST /api/v1/agent/desktop/release — the agent gives its grant back.
DesktopWindowRef
A window as Desktop names it to srv: the id apps gave, the app’s executable (name or path), and the window’s title.
InjectRequest
POST /agentmux/reactive/inject — deliver a message to an agent.
PaneOpenRequest
POST /api/v1/pane/open — open a new pane.
PaneOpenResponse
Response from POST /api/v1/pane/open
PaneTitleRequest
POST /api/v1/pane/title — set a pane’s display title.
PtyShellCreateRequest
POST /api/v1/ptyshell/create
PtyShellCreateResponse
Response from POST /api/v1/ptyshell/create. shell_id is the new sub-block’s id — the same value every other PtyShell* call takes.
PtyShellInputRequest
POST /api/v1/ptyshell/input — write raw text to the PTY, as if typed.
PtyShellInputResponse
Response from POST /api/v1/ptyshell/input
PtyShellReadRequest
POST /api/v1/ptyshell/read — read back the shell’s raw output tail.
PtyShellReadResponse
Response from POST /api/v1/ptyshell/read
PtyShellResizeRequest
POST /api/v1/ptyshell/resize — resize the PTY. Some TUIs render differently or wrap badly at the fallback geometry (25x200).
PtyShellResizeResponse
Response from POST /api/v1/ptyshell/resize
PtyShellStatusRequest
POST /api/v1/ptyshell/status — query whether the shell is still running.
PtyShellStatusResponse
Response from POST /api/v1/ptyshell/status
PtyShellStopRequest
POST /api/v1/ptyshell/stop — release the agent’s lock on the shell now, without waiting for AGENT_LOCK_WINDOW_MS to lapse.
PtyShellStopResponse
Response from POST /api/v1/ptyshell/stop
QuitSelfRequest
POST /api/v1/agent/pane/close — backs the ClosePane MCP tool. See docs/specs/SPEC_AGENT_PANE_LIFECYCLE_CONTROL_2026_09_10.md.
RegisterDevServerRequest
POST /api/v1/agent/dev_server/register — backs the RegisterDevServer MCP tool. See docs/specs/SPEC_NATIVE_CONTAINER_DEV_PROXY_2026_09_19.md.
RegisterDevServerResponse
Response for POST /api/v1/agent/dev_server/register.
RequestUpgradeRequest
POST /api/v1/agent/self/upgrade — backs the App tool’s upgrade (docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md §5.1).
ShellCreateRequest
POST /api/v1/shell/create
ShellCreateResponse
Response from POST /api/v1/shell/create
ShellInputRequest
POST /api/v1/shell/input — write text to a running shell’s stdin.
ShellInputResponse
Response from POST /api/v1/shell/input
ShellOutputRequest
POST /api/v1/shell/output - the cleaned output of a job that was given Vault secrets (ShellCreateRequest.secrets). Only such a job keeps its output, and only the agent whose pane started it may read it: the request carries the agent’s signed identity, and srv derives the pane from that, never from a field the caller fills in (every agent holds the instance auth key).
ShellOutputResponse
Response from POST /api/v1/shell/output
ShellStatusRequest
POST /api/v1/shell/status — query whether a shell is still running.
ShellStatusResponse
Response from POST /api/v1/shell/status
ShellStopRequest
POST /api/v1/shell/stop
ShellStopResponse
Response from POST /api/v1/shell/stop
TabActivateRequest
POST /api/v1/tab/activate — switch the active tab.
TabNameRequest
POST /api/v1/tab/name — rename a tab.
TabNewRequest
POST /api/v1/tab/new — create a new tab in a workspace.
UiAutomationAuth
Identity proof shared by every /api/v1/ui/* request. sig is jekt_sign::sign_jekt(key, "ui-automation-identity", agent_id, "__srv__", ts_secs, "") — the fixed msgid/target_agent/message values exist purely for domain separation from real jekt message signatures (no genuine jekt uses this literal msgid, and “srv” is not a spawnable agent name), not because those fields carry meaning here.
UiBrowserActRequest
POST /api/v1/ui/browser/act — backs BrowserClick, BrowserFill, BrowserSelect and BrowserCheck (spec §4.2).
UiBrowserActionsRequest
POST /api/v1/ui/browser/actions — backs Browser’s log: what the agent did in a browser pane it drives, as the pane’s action log records it (PLAN_BROWSER_DRIVER_FIXES_2026_10_17.md §5). Read-only, own panes only.
UiBrowserCloseRequest
POST /api/v1/ui/browser/close — backs Browser’s close: the agent closes a browser pane it drives. pane is required: with none, the request would name the caller’s own pane.
UiBrowserDialogsRequest
POST /api/v1/ui/browser/dialogs — the page dialogs the caller’s browser panes showed since it last asked (SPEC_BROWSER_PANE_NATIVE_DIALOGS_2026_10_17.md §6.1).
UiBrowserDispatchKeyRequest
POST /api/v1/ui/browser/dispatch_key
UiBrowserElementMatch
Elements by role and accessible name: find’s query, and a scope given by name. role is the role a snapshot line shows, in any case; name a part of the accessible name in any case, or with exact the whole name as written.
UiBrowserEndBypassRequest
POST /api/v1/ui/browser/end_bypass — backs Browser’s end_bypass: the agent ends its own bypass when the job is done.
UiBrowserEvalRequest
POST /api/v1/ui/browser/eval
UiBrowserFindRequest
POST /api/v1/ui/browser/find — backs Browser’s find: only the lines of the elements matching, each with a reference click and the rest take.
UiBrowserFocusElementRequest
POST /api/v1/ui/browser/focus_element
UiBrowserFocusInfoRequest
POST /api/v1/ui/browser/focus_info
UiBrowserHandoffRequest
POST /api/v1/ui/browser/handoff — backs BrowserHandoff (SPEC_AGENT_DRIVEN_BROWSER_PANES_2026_10_07.md §5.2): show the user a banner in the pane and wait for Done or Cancel.
UiBrowserHistoryRequest
POST /api/v1/ui/browser/back, /forward, /reload — all three only need the target block id; ignore_cache is meaningful for /reload only (ignored by back/forward, mirrors browser_api::types::HistoryReq).
UiBrowserNavigateRequest
POST /api/v1/ui/browser/navigate
UiBrowserOpenRequest
POST /api/v1/ui/browser/open — backs OpenBrowser. Opens a browser pane below the caller’s own pane and records the caller as its owner (SPEC_AGENT_DRIVEN_BROWSER_PANES_2026_10_07.md §3).
UiBrowserOpenResponse
Response for POST /api/v1/ui/browser/open: the new pane’s block id, which the Browser* and UI* tools take as pane.
UiBrowserRequestBypassRequest
POST /api/v1/ui/browser/request_bypass — backs Browser’s request_bypass (SPEC_BROWSER_PANE_BYPASS_2026_10_16.md §6): ask the user, in the pane, to let the agent act without asking first, and wait for their answer.
UiBrowserSetFilesRequest
POST /api/v1/ui/browser/set_files — backs BrowserSetFiles (SPEC_AGENT_DRIVEN_BROWSER_PANES_2026_10_07.md §5.3). srv allows only files inside the calling agent’s own workspace.
UiBrowserSnapshotRequest
POST /api/v1/ui/browser/snapshot — backs BrowserSnapshot (SPEC_AGENT_DRIVEN_BROWSER_PANES_2026_10_07.md §4.1).
UiBrowserTerminalRequest
POST /api/v1/ui/browser/terminal — backs Browser’s terminal action (SPEC_BROWSER_WEB_TERMINAL_TYPING_2026_10_23.md §4.2): type and run commands in a web terminal on a site the person granted.
UiBrowserWaitForRequest
POST /api/v1/ui/browser/wait_for — backs BrowserWaitFor. At most one of text, url_contains, gone, state.
UiClickRequest
POST /api/v1/ui/click
UiPressKeysRequest
POST /api/v1/ui/shortcuts/press
UiQueryRequest
POST /api/v1/ui/query
UiResetShortcutsRequest
POST /api/v1/ui/shortcuts/reset — puts one command, or every command, back on its defaults.
UiRunCommandRequest
POST /api/v1/ui/shortcuts/run
UiSetShortcutRequest
POST /api/v1/ui/shortcuts/set — gives one command exactly these keys (docs/specs/SPEC_KEYBOARD_SHORTCUTS_SETTINGS_2026_11_06.md §10).
UiShortcutsListRequest
POST /api/v1/ui/shortcuts/list
WindowFocusRequest
POST /api/v1/window/focus — bring a window to the foreground.
WindowNameRequest
POST /api/v1/window/name — set a window’s display name.
WorkspaceNameRequest
POST /api/v1/workspace/name — rename a workspace.
WpsPublishRequest
POST /agentmux/wps/publish — shared client/server envelope.

Enums§

CaptureFrom
Where a captured value is in the command’s standard output.
ShellInputFailure
Reason a ShellInput write did not happen.