UNPKG

histoire

Version:

A fast story book powered by Vite

28 lines • 1.54 kB
import type { ExecutionHandle, ExecutionTask } from './execution-types.js'; /** Injectable bounds without importing MCP, Vite or project modules into the lane. */ export interface ExecutionServiceOptions { /** Maximum waiting jobs across UI and MCP callers. */ queuedTotal?: number; /** Maximum waiting MCP jobs for one principal. */ queuedPerPrincipal?: number; /** Deadline for confirming owned cleanup and shutdown. */ cleanupTimeoutMs?: number; } /** One FIFO server lane; cancellation cannot overlap an unconfirmed runner. */ export declare function createExecutionService(options?: ExecutionServiceOptions): { /** False after shutdown or any unconfirmed teardown. Metadata stays readable. */ readonly available: boolean; /** Current active job and total pending count, without disclosing job data. */ readonly pendingCount: number; /** Atomic synchronous admission shared by UI and MCP. */ enqueue<T>(task: ExecutionTask<T>): ExecutionHandle<T>; /** Invalidate queued/active work before project generation teardown. */ cancelAll: () => Promise<void>; /** Blocks lane reuse after any owner's unconfirmed teardown, observing active work. */ quarantine(): void; /** Mark closed immediately, then wait for owned runner teardown. */ close(): Promise<void>; }; /** Controller-owned shared lane type for UI integration and operation adapters. */ export type ExecutionService = ReturnType<typeof createExecutionService>; //# sourceMappingURL=execution-service.d.ts.map