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.
fullis every route and is bound on loopback only.lanis whatbackend::lan::listenersbinds on LAN interfaces when LAN discovery is on: the routes a LAN peer calls (all behindlan_or_full_auth_middleware), plus health and the WhatsApp webhook, which authenticate themselves. Nothing that requires the fullauth_keyis 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/cronis 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, orNone).- 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, andfindandconversationsalready 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 ofreactive_routes/authed_routesdeliberately β merged at the top level with their ownlan_or_full_auth_middlewareinstead, so a LAN peerβs scopedlan_key(seeConfig::lan_key) is accepted here without also being accepted byauthed_routesβs much broader surface (the generalauth_middlewarethere requires the fullauth_keyonly). Seelan_or_full_auth_middlewareβs doc comment for why this canβt just be nested insideauthed_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/injectand reconfigure the cloud muxbus poller. These routes are now merged intoauthed_routesbelow and gated byauth_middleware. (/injectand/agentare NOT here β seelan_forward_routesabove.) - 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_middlewarerequires, so it is merged outsideauthed_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
dirfor 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 getindex.html. Full router only; the LAN router never serves it.