/** * Runs router — backs GET /api/runs/:executionId/state. * * Returns a {@link RunView} (live status) for a running or finished prod agents * execution, so the web canvas can poll live status. The Sapiom API key is held * server-side and never forwarded to the browser — the router fetches on behalf * of the canvas via {@link createRunStateFetcher}. */ import { Router } from "express"; import { type ApiKeyProvider } from "../core/api-key-provider.js"; export interface RunsRouterOpts { /** * Sapiom credential Studio actions authenticate with. Accepts either a plain * `string | null` (the boot-time key) or an {@link ApiKeyProvider}; pass a * provider so a rejected key can refresh + retry (the live-status path) and so * the fetcher reads the current key rather than a boot-time snapshot. This is * the API key (`sk_…`), NOT the local boot token. */ apiKey: string | null | ApiKeyProvider; /** Override the agents base URL (resolved from env by default). Test seam. */ baseUrl?: string; /** * Injectable fetch implementation forwarded to the fetcher. Undocumented for * prod — exists as a test seam only, mirroring the pattern used elsewhere in * the harness resolver suite. */ fetchImpl?: typeof fetch; } /** * Create the runs router. Mounts `GET /api/runs/:executionId/state`, delegating * to the run-state fetcher for the upstream call. */ export declare function createRunsRouter(opts: RunsRouterOpts): Router; //# sourceMappingURL=runs.d.ts.map