import type { ApiPrincipal, SkillsProductStore } from "./types.js"; import { ArtifactStorage } from "./artifact-storage.js"; import { RuntimeExecutionStore } from "./runtime-store.js"; import { EcsDispatcher, type EcsRunTaskClient } from "../sdk/execution/dispatchers/ecs.js"; import { type RuntimeConfig } from "./runtime-policy.js"; export interface RuntimeService { config: RuntimeConfig; signingKey: string; store: RuntimeExecutionStore; productStore: SkillsProductStore; artifacts: ArtifactStorage; dispatcher: EcsDispatcher; close?: () => Promise; } export declare function createRuntimeService(options: { databaseUrl?: string; productStore: SkillsProductStore; artifacts?: ArtifactStorage; env?: Record; executionStore?: RuntimeExecutionStore; ecsClient?: EcsRunTaskClient; }): Promise; /** Called after normal bearer authentication. Dedicated paths avoid changing /runs. */ export declare function handleRuntimeApiRequest(request: Request, principal: ApiPrincipal, service: RuntimeService | null): Promise; /** Worker-only route, before ordinary API-key auth. The token is bound to one * run, attempt, generation and deadline; it cannot read the registry or another run. */ export declare function handleRuntimeWorkerRequest(request: Request, service: RuntimeService | null): Promise; /** Replays persisted launch intents after an API restart and settles tasks that * stop before they can send a completion. Lost launch observations remain * unresolved: an empty eventual ECS listing must never cause a second launch. */ export declare function reconcileRuntimeJobs(service: RuntimeService): Promise;