Skip to main content

Module routes

Module routes 

Source
Expand description

The HTTP route table and frontend fallback. Split out of server/mod.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.1).

StructsΒ§

SrvRouters
The two routers srv serves. full is every route and is bound on loopback only. lan is what backend::lan::listeners binds on LAN interfaces when LAN discovery is on: the routes a LAN peer calls (all behind lan_or_full_auth_middleware), plus health and the WhatsApp webhook, which authenticate themselves. Nothing that requires the full auth_key is served off-host, so a LAN listener has no full-key surface.

ConstantsΒ§

AGENT_API_ROUTES πŸ”’
The routes of the function above, as declared.
AGENT_DEFINITION_ROUTES πŸ”’
The routes of the function above, as declared.
AGENT_ROUTES πŸ”’
The routes of the function above, as declared.
AGENT_SELF_AND_FLEET_ROUTES πŸ”’
The routes of the function above, as declared.
BROWSER_CONTROL_ROUTES πŸ”’
The routes of the function above, as declared.
BUS_ROUTES πŸ”’
The routes of the function above, as declared.
EXTERNAL_HOST_ROUTES πŸ”’
The routes of the function above, as declared.
FORWARDABLE_MUXSPECT_ROUTES πŸ”’
The routes of the function above, as declared.
FORWARD_MESSAGING_AND_WORK_ROUTES πŸ”’
The routes of the function above, as declared.
GOOGLE_AGENT_ROUTES πŸ”’
The routes of the function above, as declared.
HEALTH_ROUTE πŸ”’
The routes of the function above, as declared.
LAN_FORWARD_ROUTES πŸ”’
The routes of the function above, as declared.
LOCAL_HOOK_ROUTE πŸ”’
The routes of the function above, as declared.
MEMORY_AND_IDENTITY_ROUTES πŸ”’
The routes of the function above, as declared.
MODEL_GATEWAY_ROUTE πŸ”’
The routes of the function above, as declared.
MUXSPECT_ROUTES πŸ”’
The routes of the function above, as declared.
OS_LINK_ROUTES πŸ”’
The routes of the function above, as declared.
REACTIVE_ROUTES πŸ”’
The routes of the function above, as declared.
ROOT_HEALTH_ROUTE πŸ”’
The routes of the function above, as declared.
SERVICE_SHELL_AND_VAULT_ROUTES πŸ”’
The routes of the function above, as declared.
STREAMED_BROWSER_ROUTES πŸ”’
The routes of the function above, as declared.
UI_AND_HOST_ROUTES πŸ”’
The routes of the function above, as declared.
WHATSAPP_WEBHOOKS πŸ”’
The routes of the function above, as declared.
WIDGET_FILES_ROUTES πŸ”’
The routes of the function above, as declared.

FunctionsΒ§

agent_api_routes πŸ”’
Open, spawn, start, stop and name agents; windows, tabs and layout.
agent_definition_routes πŸ”’
What an agent changes about the agents themselves: their seats and names. Each acts as the agent its token names and is recorded under it.
agent_routes πŸ”’
Routes that act for an agent: each needs the agent’s token (agent_only). Jobs (SPEC_JOBS_AND_TEMPLATES_2026_10_24.md Β§5.1) and the cron scheduler under them (/agentmux/cron is kept as an alias for one release), and Muxqueue, the universal agent work queue (docs/reports/REPORT_UNIVERSAL_AGENT_WORK_QUEUE_2026_09_01.md), with the Kanban’s holder routes (SPEC_WARDEN_KANBAN_2026_10_20.md) and an agent’s hold and unhold (SPEC_KANBAN_AGENTS_HOLD_AND_UNHOLD_2026_10_22.md).
agent_routes_declared πŸ”’
The routes of agent_routes, each with what is decided about it.
agent_self_and_fleet_routes πŸ”’
An agent acting on itself, and fleet control.
agent_self_and_fleet_routes_declared πŸ”’
The routes of agent_self_and_fleet_routes, each with what is decided about it.
authed_routes πŸ”’
Everything behind the full key: the groups below, then the layers that attribute and authenticate.
browser_control_routes πŸ”’
Who drives a browser pane: the hand-off to the person, what became of it, and taking back a pane the person took over.
build_routers
Build both routers with all routes, auth middleware, and CORS.
build_routers_with πŸ”’
build_routers, with the frontend directory passed in (headless --frontend-dir, or None).
bus_routes πŸ”’
MessageBus routes (authed, localhost-only).
cors_layer πŸ”’
CORS for both routers: loopback origins only (plus any headless --allowed-origin).
external_host_routes πŸ”’
A headless server’s registered external host: it vouches for a connection, and asks what the workspace is doing, for a graceful shutdown and for a stop notice. Every one answers 404 unless a host is registered.
forward_messaging_and_work_routes πŸ”’
The forwards other instances call, messaging, job reads and the Kanban.
forwardable_muxspect_routes πŸ”’
The muxspect reads that can be asked of another instance on this machine with ?channel=<name> (Phase 2a of SPEC_MUXSPECT_CROSS_TIER_INSTANCE_INSPECTION_2026_09_02.md Β§2.4). Every route here is a read; dock/clear, the one write, is deliberately not, and find and conversations already look across channels themselves.
forwardable_muxspect_routes_declared πŸ”’
The routes of forwardable_muxspect_routes, each with what is decided about it.
google_agent_routes πŸ”’
Google connectors for agents: srv makes the call with the account’s token, for an agent with a grant (Calendar, Drive and Gmail), and agents turn services on and off themselves.
health_route πŸ”’
The health check (no auth), on both routers.
lan_forward_routes πŸ”’
The routes an LAN peer actually calls when forwarding a jekt or looking up which agents this instance hosts (LanDiscoveryController::find_agent, server/reactive.rs’s Tier-3 forward). Kept OUT of reactive_routes/authed_routes deliberately β€” merged at the top level with their own lan_or_full_auth_middleware instead, so a LAN peer’s scoped lan_key (see Config::lan_key) is accepted here without also being accepted by authed_routes’s much broader surface (the general auth_middleware there requires the full auth_key only). See lan_or_full_auth_middleware’s doc comment for why this can’t just be nested inside authed_routes.
lan_forward_routes_declared πŸ”’
The routes of lan_forward_routes, each with what is decided about it.
local_hook_route πŸ”’
A job’s local hook, with the body limit of a hook call.
memory_and_identity_routes πŸ”’
MuxAPI memory, Global Memory, presets, identity and skills.
model_gateway_route πŸ”’
The model gateway: every method goes on to the provider, and the handler checks the caller’s gateway token.
muxspect_routes πŸ”’
muxspect, work facts and the coordination channel.
muxspect_routes_declared πŸ”’
The routes of muxspect_routes, each with what is decided about it.
os_link_routes πŸ”’
A deep link another program handed to AgentMux, sent by the host and proven by its token: the operating system’s rules (G4e).
reactive_routes πŸ”’
Reactive routes. Previously registered without auth on the assumption that localhost is a trust boundary; the 2026-05-11 security audit (C1 + C2) showed that any local process β€” or a web page driving 127.0.0.1 via the permissive CORS layer β€” could drive /agentmux/reactive/inject and reconfigure the cloud muxbus poller. These routes are now merged into authed_routes below and gated by auth_middleware. (/inject and /agent are NOT here β€” see lan_forward_routes above.)
root_health_route πŸ”’
The health check at /, where no frontend is served there.
service_shell_and_vault_routes πŸ”’
The websocket and service calls, files, shells, widgets, the Vault and Google.
service_shell_and_vault_routes_declared πŸ”’
The routes of service_shell_and_vault_routes, each with what is decided about it.
streamed_browser_routes πŸ”’
The streamed Browser pane of a headless server’s web UI; 404 unless switched on.
ui_and_host_routes πŸ”’
UI automation, the browser pane and the host relays.
ui_and_host_routes_declared πŸ”’
The routes of ui_and_host_routes, each with what is decided about it.
whatsapp_webhooks πŸ”’
WhatsApp Cloud API webhook receiver (no auth). Meta’s servers call it directly and cannot supply the X-AuthKey header auth_middleware requires, so it is merged outside authed_routes.
widget_files_routes πŸ”’
An approved widget’s files and the SDK. Full router only, never the LAN.
with_frontend πŸ”’
Serve the built frontend in dir for every path no route claims, / included. Unauthenticated, like the CEF host’s static server: the bundle holds no secrets, and srv’s key still guards every API route. Unknown paths get index.html. Full router only; the LAN router never serves it.