Skip to main content

Module gateway

Module gateway 

Modules§

a2a
A2A discovery surface: the well-known catalog card and per-alias agent cards.
acp
ACP-over-WebSocket gateway endpoint.
agent_owned_state
Agent-deletion owned-state cascade— the non-config half of deleting an agent.
api
REST API handlers for the web dashboard. All /api/* routes require bearer token authentication (PairingGuard).
api_browse
HTTP adapter over zeroclaw_runtime::browse::list_directory.
api_config
Per-property CRUD endpoints for /api/config/*.
api_logs
GET /api/logs — paginated query over the persisted JSONL log.
api_pairing
Device management and pairing API handlers.
api_personality
Read/write endpoints for per-agent personality markdown files (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md, MEMORY.md).
api_quickstart
HTTP routes for the Quickstart flow.
api_sections
Curated config-section endpoints. Used by the /config page in the web dashboard to navigate the schema by curated section rather than raw prop paths. OpenAPI is authoritative for the exact route set.
api_skills
HTTP adapter over zeroclaw_runtime::skills::SkillsService.
api_sop
Out-of-band SOP approval surface (EPIC C, C6; EPIC G broker).
api_sop_author
SOP authoring surface for the web node editor.
auth_rate_limit
Sliding-window rate limiter for authentication attempts.
canvas
Live Canvas gateway routes — REST + WebSocket for real-time canvas updates.
hardware_context
Hardware context management endpoints.
node_tool
Wraps a node capability as a zeroclaw Tool so it can be dispatched through the existing tool registry and agent loop. Tool names are prefixed with the node ID: node:<node_id>:<capability_name>.
nodes
WebSocket endpoint for dynamic node discovery and capability advertisement.
openapi
Runtime-generated OpenAPI 3.1 document for the new /api/config/* surface.
security_headers
session_queue
Re-export from zeroclaw-infra so existing gateway imports keep working.
sse
Server-Sent Events (SSE) stream for real-time event delivery. Wraps the broadcast channel in AppState to deliver events to web dashboard clients.
static_files
Static file serving for the web dashboard. Serves the compiled web/dist/ directory from the filesystem at runtime. The directory path is configured via gateway.web_dist_dir.
tls
TLS and mutual TLS (mTLS) support for the gateway server.
version
Version-check and restart-classification helpers for the dashboard’s upgrade affordance (RFC: In-app upgrade with optional supervised restart).
ws
WebSocket agent chat handler.
ws_approval
WebSocket-backed Channel implementation that surfaces tool approval prompts to the gateway client and waits for the operator’s decision.
ws_sop_runs
Live SOP-runs WebSocket: pushes run summaries as the engine transitions.

Structs§

AdminPaircodeQuery
AppState
Shared state for all axum handlers
GatewayRateLimiter
IdempotencyStore
WatiVerifyQuery
WebhookBody
Webhook request body
WebhookQuery
Webhook query parameters
WhatsAppVerifyQuery
WhatsApp verification query params

Constants§

IDEMPOTENCY_MAX_KEYS_DEFAULT
Fallback max distinct idempotency keys retained in gateway memory.
LONG_RUNNING_REQUEST_TIMEOUT_SECS
MAX_BODY_SIZE
Maximum request body size (64KB) — prevents memory exhaustion
RATE_LIMIT_MAX_KEYS_DEFAULT
Fallback max distinct client keys tracked in gateway rate limiter.
RATE_LIMIT_WINDOW_SECS
Sliding window used by gateway rate limiting.
REQUEST_TIMEOUT_SECS
Default request timeout (30s) — prevents slow-loris attacks.

Functions§

gateway_long_running_request_timeout_secs
Manual cron-trigger request timeout (seconds), exempt from the gateway-wide gateway_request_timeout_secs limit so synchronous agent jobs can run to completion. Reads from typed config.
gateway_request_timeout_secs
Gateway request timeout (seconds) for routes other than the long-running cron-trigger endpoint. Reads from typed config.
run_gateway
Run the HTTP gateway using axum with proper HTTP/1.1 compliance.
verify_whatsapp_signature
Verify WhatsApp webhook signature (X-Hub-Signature-256). Returns true if the signature is valid, false otherwise. See: https://developers.facebook.com/docs/graph-api/webhooks/getting-started#verification-requests