import { ConfigManager } from '../config/manager.js';
import type { AgentRecord } from '../tools/agent/index.js';
import type { ExecutionIntent } from '../runtime/execution-intents.js';
import type { AutomationDeliveryPolicy } from './delivery.js';
import type { AutomationFailurePolicy } from './failures.js';
import type { AutomationJob } from './jobs.js';
import type { AutomationRun, AutomationRunTelemetry } from './runs.js';
import type { AutomationExecutionPolicy, AutomationExternalContentSource, AutomationSessionTarget, AutomationWakeMode } from './session-targets.js';
import type { AutomationSourceRecord } from './sources.js';
import type { AutomationExecutionIntent, AutomationExecutionMode, AutomationExecutionTargetKind, ProviderModelRoutingPolicy } from './types.js';
export interface CreateAutomationJobInput {
    readonly name: string;
    readonly prompt: string;
    readonly schedule: import('./schedules.js').AutomationScheduleDefinition;
    readonly description?: string | undefined;
    readonly model?: string | undefined;
    readonly provider?: string | undefined;
    readonly fallbackModels?: readonly string[] | undefined;
    readonly routing?: ProviderModelRoutingPolicy | undefined;
    readonly executionIntent?: ExecutionIntent | undefined;
    readonly template?: string | undefined;
    readonly target?: AutomationSessionTarget | undefined;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'] | undefined;
    readonly thinking?: string | undefined;
    readonly wakeMode?: AutomationWakeMode | undefined;
    readonly timeoutMs?: number | undefined;
    readonly toolAllowlist?: readonly string[] | undefined;
    readonly autoApprove?: boolean | undefined;
    readonly allowUnsafeExternalContent?: boolean | undefined;
    readonly externalContentSource?: AutomationExternalContentSource | undefined;
    readonly lightContext?: boolean | undefined;
    readonly delivery?: Partial<AutomationDeliveryPolicy> | undefined;
    readonly failure?: Partial<AutomationFailurePolicy> | undefined;
    readonly enabled?: boolean | undefined;
    readonly deleteAfterRun?: boolean | undefined;
}
export interface UpdateAutomationJobInput {
    readonly name?: string | undefined;
    readonly prompt?: string | undefined;
    readonly schedule?: import('./schedules.js').AutomationScheduleDefinition | undefined;
    readonly description?: string | undefined;
    readonly model?: string | undefined;
    readonly provider?: string | undefined;
    readonly fallbackModels?: readonly string[] | undefined;
    readonly routing?: ProviderModelRoutingPolicy | undefined;
    readonly executionIntent?: ExecutionIntent | undefined;
    readonly template?: string | undefined;
    readonly target?: AutomationSessionTarget | undefined;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'] | undefined;
    readonly thinking?: string | undefined;
    readonly wakeMode?: AutomationWakeMode | undefined;
    readonly timeoutMs?: number | undefined;
    readonly toolAllowlist?: readonly string[] | undefined;
    readonly autoApprove?: boolean | undefined;
    readonly allowUnsafeExternalContent?: boolean | undefined;
    readonly externalContentSource?: AutomationExternalContentSource | undefined;
    readonly lightContext?: boolean | undefined;
    readonly delivery?: Partial<AutomationDeliveryPolicy> | undefined;
    readonly failure?: Partial<AutomationFailurePolicy> | undefined;
    readonly enabled?: boolean | undefined;
    readonly deleteAfterRun?: boolean | undefined;
}
export interface SpawnAutomationTaskInput {
    readonly prompt: string;
    readonly modelId?: string | undefined;
    readonly modelProvider?: string | undefined;
    readonly fallbackModels?: readonly string[] | undefined;
    readonly routing?: ProviderModelRoutingPolicy | undefined;
    readonly executionIntent?: ExecutionIntent | undefined;
    readonly template?: string | undefined;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'] | undefined;
    readonly toolAllowlist?: readonly string[] | undefined;
    readonly context?: string | undefined;
}
export declare function sortJobs(jobs: Iterable<AutomationJob>): AutomationJob[];
export declare function sortRuns(runs: Iterable<AutomationRun>): AutomationRun[];
export declare function computeNextRun(schedule: import('./schedules.js').AutomationScheduleDefinition, from?: number, stableId?: string): number | undefined;
export declare function buildDefaultSource(enabled: boolean, timestamp: number): AutomationSourceRecord;
export declare function normalizeSourceRecord(source: AutomationSourceRecord | undefined, enabled: boolean, timestamp: number): AutomationSourceRecord;
export declare function normalizeStringList(value: readonly string[] | undefined): readonly string[] | undefined;
export declare function normalizeProviderQualifiedModel(value: string | undefined, label: string): string | undefined;
export declare function assertProviderMatchesModel(modelId: string | undefined, providerId: string | undefined, label: string): void;
export declare function assertProviderHasModel(modelId: string | undefined, providerId: string | undefined, label: string): void;
export declare function normalizeProviderQualifiedModelList(value: readonly string[] | undefined, label: string): readonly string[] | undefined;
export declare function normalizeOptionalString(value: string | undefined): string | undefined;
export declare function normalizeProviderRoutingPolicy(input: {
    readonly provider?: string | undefined;
    readonly modelProvider?: string | undefined;
    readonly fallbackModels?: readonly string[] | undefined;
    readonly routing?: ProviderModelRoutingPolicy | undefined;
}): ProviderModelRoutingPolicy;
export declare function buildAutomationExecutionIntent(targetKind: AutomationExecutionTargetKind, mode: AutomationExecutionMode | undefined): AutomationExecutionIntent | undefined;
export declare function buildDefaultExecution(input: CreateAutomationJobInput, configManager: ConfigManager): AutomationExecutionPolicy;
export declare function buildDefaultDelivery(overrides?: Partial<AutomationDeliveryPolicy>): AutomationDeliveryPolicy;
export declare function buildDefaultFailurePolicy(configManager: ConfigManager, overrides?: Partial<AutomationFailurePolicy>): AutomationFailurePolicy;
export declare function getTerminalAgentState(agent: AgentRecord): Extract<AutomationRun['status'], 'completed' | 'failed' | 'cancelled'> | null;
export declare function normalizeJobRecord(job: AutomationJob, configManager: ConfigManager): AutomationJob;
export declare function normalizeRunRecord(run: AutomationRun, job?: AutomationJob): AutomationRun;
export declare function normalizeRunTelemetry(telemetry: AutomationRun['telemetry'], run: Pick<AutomationRun, 'modelId' | 'providerId' | 'continuationMode'>): AutomationRun['telemetry'];
export declare function buildRunTelemetryFromAgent(agent: AgentRecord, run: AutomationRun): AutomationRunTelemetry | undefined;
export declare function normalizeExternalTelemetry(telemetry: AutomationRunTelemetry | undefined, run: AutomationRun, metadata?: Record<string, unknown>): AutomationRunTelemetry | undefined;
export declare function formatExternalContentSource(source: AutomationExternalContentSource): string;
export declare function buildAutomationExecutionContext(execution: AutomationExecutionPolicy, sessionId?: string): string | undefined;
//# sourceMappingURL=manager-runtime-helpers.d.ts.map