@baselineos/api
v1.6.3
Published
BaselineOS REST + WebSocket API server — programmatic access to the 7-layer runtime
Downloads
207
Readme
@baselineos/api
REST + WebSocket API server for BaselineOS. Exposes the 7-layer runtime to external clients with RBAC auth, rate limiting, telemetry, and a Zod-typed schema surface (re-exported as OpenAPI).
Extracted from baselineos/src/api/ in Sprint 4.1. The baselineos
package re-exports APIServer for backward compatibility.
Usage
import { APIServer } from '@baselineos/api';
import { Baseline } from 'baselineos';
const baseline = new Baseline();
await baseline.init();
const api = new APIServer(baseline, { port: 3141 });
await api.start();Or use the bundled CLI: baseline serve --api --port 3141.
Surface
APIServer— Express + ws server with RBAC, rate limiting, OPA-mode reporting./schemas— Zod request/response schemas./openapi-gen— OpenAPI spec generator (reads the same schemas)
Control Plane
POST /api/haltactivates an external halt state even when no pipeline is armed.GET /api/halt/statusreports combined API and pipeline halt state.POST /api/resumeclears the halt state and resumes the armed pipeline if present.
While halted, new task, workflow, direct produce, streaming produce, and offline
queue drain requests return 423.
License
Apache-2.0
