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'; import { type ModelIdCandidate } from '../providers/model-id-resolution.js'; export interface CreateAutomationJobInput { readonly name: string; readonly kind?: import('./jobs.js').AutomationJobKind | undefined; 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 | undefined; readonly failure?: Partial | undefined; readonly enabled?: boolean | undefined; readonly deleteAfterRun?: boolean | undefined; } export interface UpdateAutomationJobInput { readonly name?: string | undefined; readonly kind?: import('./jobs.js').AutomationJobKind | 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 | undefined; readonly failure?: Partial | 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[]; export declare function sortRuns(runs: Iterable): 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; /** * Normalizes a user-supplied automation model reference. When `models` (the * live registry's candidate list) is supplied, a bare id resolves via the * shared resolver (unique -> auto-qualify; ambiguous/unknown -> a rich error * naming real candidates) and the RESOLVED, provider-qualified key is * returned, automation storage stays provider-qualified either way. When * `models` is omitted (a caller that hasn't threaded the registry through * yet), falls back to format-only validation so existing behavior is * unaffected until that caller is updated. */ export declare function normalizeProviderQualifiedModel(value: string | undefined, label: string, models?: readonly ModelIdCandidate[], contextProviderId?: string | undefined): 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, models?: readonly ModelIdCandidate[]): 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; }, models?: readonly ModelIdCandidate[]): ProviderModelRoutingPolicy; export declare function buildAutomationExecutionIntent(targetKind: AutomationExecutionTargetKind, mode: AutomationExecutionMode | undefined): AutomationExecutionIntent | undefined; export declare function buildDefaultExecution(input: CreateAutomationJobInput, configManager: ConfigManager, models?: readonly ModelIdCandidate[]): AutomationExecutionPolicy; export declare function buildDefaultDelivery(overrides?: Partial): AutomationDeliveryPolicy; export declare function buildDefaultFailurePolicy(configManager: ConfigManager, overrides?: Partial): AutomationFailurePolicy; export declare function getTerminalAgentState(agent: AgentRecord): Extract | 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['telemetry']; export declare function buildRunTelemetryFromAgent(agent: AgentRecord, run: AutomationRun): AutomationRunTelemetry | undefined; export declare function normalizeExternalTelemetry(telemetry: AutomationRunTelemetry | undefined, run: AutomationRun, metadata?: Record): 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