import { SharedSessionBroker } from '../control-plane/index.js'; import type { SharedSessionRecord, SharedSessionSubmission } from '../control-plane/index.js'; import type { RouteBindingManager } from '../channels/index.js'; import type { AutomationJob } from './jobs.js'; import type { AutomationRouteBinding } from './routes.js'; import type { AutomationRun, AutomationRunContinuationMode } from './runs.js'; import type { AutomationSessionTarget } from './session-targets.js'; import type { AutomationRunTrigger } from './types.js'; import type { ConfigManager } from '../config/manager.js'; import { type AutomationCheckinEvaluator } from './checkin-execution.js'; export interface AutomationManagerExecutionContext { readonly configManager: ConfigManager; readonly routeBindings: RouteBindingManager; readonly sessionBroker: SharedSessionBroker; readonly defaultSurfaceKind?: AutomationSessionTarget['surfaceKind'] | undefined; readonly defaultSurfaceId?: string | undefined; readonly spawnTask: (input: { readonly prompt: string; readonly modelId?: string | undefined; readonly modelProvider?: string | undefined; readonly fallbackModels?: readonly string[] | undefined; readonly routing?: AutomationRun['execution']['routing'] | undefined; readonly executionIntent?: AutomationRun['execution']['executionIntent'] | undefined; readonly template?: string | undefined; readonly reasoningEffort?: AutomationRun['execution']['reasoningEffort'] | undefined; readonly toolAllowlist?: readonly string[] | undefined; readonly context?: string | undefined; }) => string; readonly saveJobs: () => Promise; readonly saveRuns: () => Promise; readonly pruneRunHistory: (jobId?: string) => void; readonly activeRunCount: () => number; readonly maxConcurrentRuns: () => number; readonly syncExecutionRoute: (job: AutomationJob, run: AutomationRun) => Promise; readonly syncRunToRuntime: (run: AutomationRun, source: string) => void; readonly syncJobToRuntime: (job: AutomationJob, source: string) => void; readonly emitRunQueued: (job: AutomationJob, run: AutomationRun) => void; readonly emitRunStarted: (job: AutomationJob, run: AutomationRun) => void; readonly emitRunCompleted: (job: AutomationJob, run: AutomationRun, outcome: 'success' | 'partial' | 'failed' | 'cancelled') => void; readonly emitRunFailed: (job: AutomationJob, run: AutomationRun, error: string, retryable: boolean) => void; readonly maybeDeliverRun: (job: AutomationJob, run: AutomationRun) => void; readonly scheduleFailureFollowUp: (job: AutomationJob, run: AutomationRun) => void; readonly applyFailureToJob: (job: AutomationJob, timestamp: number, countRun?: boolean) => AutomationJob; readonly jobs: Map; readonly runs: Map; /** * Optional check-in evaluator. When a `kind: 'checkin'` job fires and this is * attached, executeAutomationJob delegates to it (see checkin-execution.ts) * instead of the generic agent-spawn path. Absent → a checkin job degrades to * an ordinary job (nothing to evaluate), never an error. */ readonly checkinEvaluator?: AutomationCheckinEvaluator | undefined; } interface ResolvedAutomationExecution { readonly task: string; readonly continuationMode: AutomationRunContinuationMode; readonly session?: SharedSessionRecord | undefined; readonly route?: AutomationRouteBinding | undefined; readonly agentId?: string | undefined; readonly target: AutomationSessionTarget; readonly executionIntent: AutomationRun['executionIntent']; readonly updatedJob?: AutomationJob | undefined; } export declare function executeAutomationJob(context: AutomationManagerExecutionContext, job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt?: number): Promise; export declare function resolveAutomationExecution(context: AutomationManagerExecutionContext, job: AutomationJob, prompt: string, trigger: AutomationRunTrigger): Promise; export declare function resolveSharedSessionExecution(context: AutomationManagerExecutionContext, job: AutomationJob, prompt: string, trigger: AutomationRunTrigger, input: { readonly sessionId?: string | undefined; readonly routeId?: string | undefined; readonly target: AutomationSessionTarget; readonly updatedJob?: AutomationJob | undefined; }): Promise; export declare function toResolvedExecution(job: AutomationJob, target: AutomationSessionTarget, submission: SharedSessionSubmission, updatedJob?: AutomationJob): ResolvedAutomationExecution; export declare function resolveRouteForTarget(context: AutomationManagerExecutionContext, target: AutomationSessionTarget, job: AutomationJob): AutomationRouteBinding | undefined; export declare function syncExecutionRoute(context: AutomationManagerExecutionContext, job: AutomationJob, run: AutomationRun): Promise; export declare function applyFailureToJob(job: AutomationJob, timestamp: number, countRun?: boolean): AutomationJob; export {}; //# sourceMappingURL=manager-runtime-execution.d.ts.map