/** * Bounded in-process Scheduler -> Worker application driver. * * The driver supplies the optional application seam between a parent * orchestration execution and the existing control-plane services. It starts * one WorkerControlService, serially runs scheduler ticks followed by worker * passes, and stops the worker when the parent operation completes. It never * writes mission state or launches children itself; Scheduler, Assignment, * Worker, and the parent DurableMissionCoordinator retain their authorities. */ import type { AssignmentControlService } from "../assignment/assignment-control-service.js"; import type { DurableMissionStore } from "../mission-domain/durable-store.js"; import type { SchedulerControlService } from "../scheduler/scheduler-control-service.js"; import type { WorkerControlService } from "../worker-daemon/worker-control-service.js"; export interface SchedulerWorkerTerminalCleanupOptions { missions: DurableMissionStore; scheduler: SchedulerControlService; assignments: AssignmentControlService; } export interface SchedulerWorkerTerminalCleanupReport { children: string[]; releasedAssignments: string[]; cancelledIntents: string[]; completedExecutingAssignments: string[]; residuals: string[]; } /** * Bounded parent-terminal cleanup over the existing control-plane authorities. * It never writes mission state: active execution is stopped by Worker, pending * intent is cancelled by Scheduler, and assignment ownership is released or * completed by Assignment using the terminal mission result as evidence. */ export declare class SchedulerWorkerTerminalCleanup { private readonly _missions; private readonly _scheduler; private readonly _assignments; constructor(options: SchedulerWorkerTerminalCleanupOptions); cleanup(parentMissionId: string): Promise; } export interface SchedulerWorkerDriverOptions { scheduler: SchedulerControlService; worker: WorkerControlService; /** Mandatory parent-terminal cleanup over the existing Scheduler/Assignment authorities. */ terminalCleanup: SchedulerWorkerTerminalCleanup; /** Maximum number of scheduler/worker passes for one parent operation. */ maxTicks?: number; /** Delay between passes. Defaults to 0 for application/test composition. */ tickIntervalMs?: number; } export interface SchedulerWorkerDriverRunOptions { signal?: AbortSignal; parentMissionId?: string; } /** Structured scheduler/worker driver failure, distinct from caller cancellation. */ export declare class SchedulerWorkerDriverFailure extends Error { readonly cause: unknown; constructor(message: string, cause?: unknown); } /** * Drives a parent operation while an optional local worker consumes its child * assignments. One driver instance owns one serialized worker run at a time. */ export declare class SchedulerWorkerDriver { private readonly _scheduler; private readonly _worker; private readonly _terminalCleanup; private readonly _maxTicks; private readonly _tickIntervalMs; private _active; constructor(options: SchedulerWorkerDriverOptions); /** Execute an operation with the bounded Scheduler -> Worker pump active. */ execute(operation: (signal: AbortSignal) => Promise, options?: SchedulerWorkerDriverRunOptions): Promise; private _pump; } export declare function createSchedulerWorkerDriver(options: SchedulerWorkerDriverOptions): SchedulerWorkerDriver; //# sourceMappingURL=scheduler-worker-driver.d.ts.map