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 '@pellux/goodvibes-sdk/platform/automation/jobs';
import type { AutomationRouteBinding } from '@pellux/goodvibes-sdk/platform/automation/routes';
import type { AutomationRun, AutomationRunContinuationMode } from '@pellux/goodvibes-sdk/platform/automation/runs';
import type { AutomationSessionTarget } from '@pellux/goodvibes-sdk/platform/automation/session-targets';
import type { AutomationRunTrigger } from '@pellux/goodvibes-sdk/platform/automation/types';
import type { ConfigManager } from '../config/manager.js';
export interface AutomationManagerExecutionContext {
    readonly configManager: ConfigManager;
    readonly routeBindings: RouteBindingManager;
    readonly sessionBroker: SharedSessionBroker;
    readonly spawnTask: (input: {
        readonly prompt: string;
        readonly modelId?: string;
        readonly modelProvider?: string;
        readonly fallbackModels?: readonly string[];
        readonly routing?: AutomationRun['execution']['routing'];
        readonly executionIntent?: AutomationRun['execution']['executionIntent'];
        readonly template?: string;
        readonly reasoningEffort?: AutomationRun['execution']['reasoningEffort'];
        readonly toolAllowlist?: readonly string[];
        readonly context?: string;
    }) => string;
    readonly saveJobs: () => Promise<void>;
    readonly saveRuns: () => Promise<void>;
    readonly pruneRunHistory: (jobId?: string) => void;
    readonly activeRunCount: () => number;
    readonly maxConcurrentRuns: () => number;
    readonly syncExecutionRoute: (job: AutomationJob, run: AutomationRun) => Promise<void>;
    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<string, AutomationJob>;
    readonly runs: Map<string, AutomationRun>;
}
interface ResolvedAutomationExecution {
    readonly task: string;
    readonly continuationMode: AutomationRunContinuationMode;
    readonly session?: SharedSessionRecord;
    readonly route?: AutomationRouteBinding;
    readonly agentId?: string;
    readonly target: AutomationSessionTarget;
    readonly executionIntent: AutomationRun['executionIntent'];
    readonly updatedJob?: AutomationJob;
}
export declare function executeAutomationJob(context: AutomationManagerExecutionContext, job: AutomationJob, trigger: AutomationRunTrigger, dueRun: boolean, attempt?: number): Promise<AutomationRun>;
export declare function resolveAutomationExecution(context: AutomationManagerExecutionContext, job: AutomationJob, prompt: string, trigger: AutomationRunTrigger): Promise<ResolvedAutomationExecution>;
export declare function resolveSharedSessionExecution(context: AutomationManagerExecutionContext, job: AutomationJob, prompt: string, trigger: AutomationRunTrigger, input: {
    readonly sessionId?: string;
    readonly routeId?: string;
    readonly target: AutomationSessionTarget;
    readonly updatedJob?: AutomationJob;
}): Promise<ResolvedAutomationExecution>;
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<void>;
export declare function applyFailureToJob(job: AutomationJob, timestamp: number, countRun?: boolean): AutomationJob;
export {};
//# sourceMappingURL=manager-runtime-execution.d.ts.map