import type { IncomingMessage, ServerResponse } from 'node:http'; import type { PipelineHandlers } from './handlers.js'; /** * A tiny Node `http` request handler wiring the pipeline routes. Drop it into * `http.createServer(...)`. For real apps, prefer mounting `PipelineHandlers` * into your framework (Express/Fastify/Hono) — this adapter exists so the package * runs out of the box. * * Routes (all under `basePath`, default `/pipeline`): * POST /pipeline -> save { ...PipelineDraft } => { pipelineId } * GET /pipeline/:id -> load. 404 (`{ error }`) if the pipeline * does not exist (`PipelineNotFoundError`); * any other failure (e.g. a DB outage) still * 500s, unclassified — never conflated with * "not found". * GET /pipeline/:id/runs -> list runs * POST /pipeline/run -> run (non-streaming) { pipelineId }. 400 for * a missing/non-string `pipelineId`, validated * before the engine is touched; 404 for * a nonexistent pipeline (`PipelineNotFoundError`, * thrown by `store.load` before the run row is * created — see runtime's `run()`); any other * failure still 500s. * POST /pipeline/run/stream -> start a run and stream its live events * (SSE) { pipelineId, context? } — this is * the route that actually starts a run; * the GET stream route below no longer does. * 404 (headers unsent) for a nonexistent * pipeline (`PipelineNotFoundError`); 400 * (headers unsent) for a missing/non-string * `pipelineId` or any other startRun failure — * both validated/started BEFORE * `res.writeHead` (#8). * GET /pipeline/runs/:runId/stream -> attach to an already IN-FLIGHT run's SSE * stream. 404 (headers unsent) if the run is * unknown or has already finished — never * starts a run and never replays one (#S11a/#E1). * POST /pipeline/run/:runId/abort -> abort. 404 if the run is unknown or has * already finished (#S11d). */ export declare function createNodeHttpHandler(handlers: PipelineHandlers, opts?: { basePath?: string; }): (req: IncomingMessage, res: ServerResponse) => void; //# sourceMappingURL=node-http.d.ts.map