import { ConfigManager } from '../config/manager.js';
import type { AgentRecord } from '../tools/agent/index.js';
import type { ExecutionIntent } from '@pellux/goodvibes-sdk/platform/runtime/execution-intents';
import type { AutomationDeliveryPolicy } from '@pellux/goodvibes-sdk/platform/automation/delivery';
import type { AutomationFailurePolicy } from '@pellux/goodvibes-sdk/platform/automation/failures';
import type { AutomationJob } from '@pellux/goodvibes-sdk/platform/automation/jobs';
import type { AutomationRun, AutomationRunTelemetry } from '@pellux/goodvibes-sdk/platform/automation/runs';
import type { AutomationExecutionPolicy, AutomationExternalContentSource, AutomationSessionTarget, AutomationWakeMode } from '@pellux/goodvibes-sdk/platform/automation/session-targets';
import type { AutomationSourceRecord } from '@pellux/goodvibes-sdk/platform/automation/sources';
import type { AutomationExecutionIntent, AutomationExecutionMode, AutomationExecutionTargetKind, ProviderModelRoutingPolicy } from '@pellux/goodvibes-sdk/platform/automation/types';
export interface CreateAutomationJobInput {
    readonly name: string;
    readonly prompt: string;
    readonly schedule: import('@pellux/goodvibes-sdk/platform/automation/schedules').AutomationScheduleDefinition;
    readonly description?: string;
    readonly model?: string;
    readonly provider?: string;
    readonly fallbackModels?: readonly string[];
    readonly fallbacks?: readonly string[];
    readonly routing?: ProviderModelRoutingPolicy;
    readonly executionIntent?: ExecutionIntent;
    readonly template?: string;
    readonly target?: AutomationSessionTarget;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'];
    readonly thinking?: string;
    readonly wakeMode?: AutomationWakeMode;
    readonly timeoutMs?: number;
    readonly toolAllowlist?: readonly string[];
    readonly autoApprove?: boolean;
    readonly allowUnsafeExternalContent?: boolean;
    readonly externalContentSource?: AutomationExternalContentSource;
    readonly lightContext?: boolean;
    readonly delivery?: Partial<AutomationDeliveryPolicy>;
    readonly failure?: Partial<AutomationFailurePolicy>;
    readonly enabled?: boolean;
    readonly deleteAfterRun?: boolean;
}
export interface UpdateAutomationJobInput {
    readonly name?: string;
    readonly prompt?: string;
    readonly schedule?: import('@pellux/goodvibes-sdk/platform/automation/schedules').AutomationScheduleDefinition;
    readonly description?: string;
    readonly model?: string;
    readonly provider?: string;
    readonly fallbackModels?: readonly string[];
    readonly fallbacks?: readonly string[];
    readonly routing?: ProviderModelRoutingPolicy;
    readonly executionIntent?: ExecutionIntent;
    readonly template?: string;
    readonly target?: AutomationSessionTarget;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'];
    readonly thinking?: string;
    readonly wakeMode?: AutomationWakeMode;
    readonly timeoutMs?: number;
    readonly toolAllowlist?: readonly string[];
    readonly autoApprove?: boolean;
    readonly allowUnsafeExternalContent?: boolean;
    readonly externalContentSource?: AutomationExternalContentSource;
    readonly lightContext?: boolean;
    readonly delivery?: Partial<AutomationDeliveryPolicy>;
    readonly failure?: Partial<AutomationFailurePolicy>;
    readonly enabled?: boolean;
    readonly deleteAfterRun?: boolean;
}
export interface SpawnAutomationTaskInput {
    readonly prompt: string;
    readonly modelId?: string;
    readonly modelProvider?: string;
    readonly fallbackModels?: readonly string[];
    readonly routing?: ProviderModelRoutingPolicy;
    readonly executionIntent?: ExecutionIntent;
    readonly template?: string;
    readonly reasoningEffort?: AutomationExecutionPolicy['reasoningEffort'];
    readonly toolAllowlist?: readonly string[];
    readonly context?: string;
}
export declare function sortJobs(jobs: Iterable<AutomationJob>): AutomationJob[];
export declare function sortRuns(runs: Iterable<AutomationRun>): AutomationRun[];
export declare function computeNextRun(schedule: import('@pellux/goodvibes-sdk/platform/automation/schedules').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 normalizeOptionalString(value: string | undefined): string | undefined;
export declare function normalizeProviderRoutingPolicy(input: {
    readonly provider?: string;
    readonly modelProvider?: string;
    readonly fallbackModels?: readonly string[];
    readonly fallbacks?: readonly string[];
    readonly routing?: ProviderModelRoutingPolicy;
}): 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