Documentation Index
Fetch the complete documentation index at: https://smithers.sh/llms.txt
Use this file to discover all available pages before exploring further.
startServer boots a multi-workflow HTTP server with REST endpoints for run lifecycle, SSE event streams, and human-in-the-loop approvals. For a single-workflow variant alongside smithers up, see Serve Mode.
Quick start
ServerOptions
startServer returns a listening http.Server. headersTimeout and requestTimeout are applied to that server to bound slow header/body uploads.
API Routes (TOON)
Content-Type: application/json, Cache-Control: no-store, and X-Content-Type-Options: nosniff. SSE events are named smithers and carry SmithersEvent JSON; the stream sends a keep-alive comment every 10 s and closes on terminal state.
Errors use the envelope { "error": { "code", "message", "details" } }. Common codes: INVALID_REQUEST, RUN_NOT_FOUND, RUN_IN_PROGRESS, RUN_ALREADY_EXISTS, WORKFLOW_PATH_OUTSIDE_ROOT, DB_NOT_CONFIGURED, RUN_NOT_ACTIVE, SERVER_ERROR.
Tool surface
Tools resolve relative torootDir. The example below exposes a workflow that uses the built-in bash tool through the server; clients call it via POST /v1/runs.
allowNetwork: false (the default) keeps bash offline. Set rootDir to constrain the filesystem the workflow can touch.
Authentication
WhenauthToken is configured (directly or via SMITHERS_API_KEY), every request except GET /health must include either:
Authorization: Bearer <token>, orx-smithers-key: <token>.
401. No scopes — for finer access control use the Gateway.
Notes
- Each
POST /v1/runsand/resumereloads the workflow source via a content-addressed shadow file (.${name}.smithers-${sha1}.tsx), so edits take effect on the next call without a restart. - Active runs heartbeat to
_smithers_runs.heartbeat_at_msevery 5 s; stale rows are treated as crashed and may be resumed. - When a server-level
dbdiffers from a workflow’s database, runs and events are mirrored asynchronously to the server db so they show up inGET /v1/runs. - Metrics are exported via
/metrics; setSMITHERS_OTEL_ENABLED=1plusOTEL_EXPORTER_OTLP_ENDPOINTfor OTLP. See Observability.