import type { AgentResponse, WorkflowResumePointEntry, WorkflowStep } from '../../models/types.js'; import type { PhasePromptParts, StepProviderInfo } from '../types.js'; export declare const PHASE1_EMPTY_OUTPUT_ERROR = "Phase 1 returned empty output"; export declare const PHASE1_EMPTY_CONTINUATION_INSTRUCTION: string; export type Phase1AttemptReason = 'initial' | 'provider_error_fresh' | 'empty_continuation' | 'empty_fresh' | 'publication_retry_fresh' | 'companion_fix' | 'live_intervention'; export interface Phase1Attempt { readonly sequence: number; readonly reason: Phase1AttemptReason; readonly instruction: string; readonly sessionId: string | undefined; } interface Phase1EmptyRecoveryOptions { readonly instruction: string; readonly initialSessionId: string | undefined; readonly execute: (attempt: Phase1Attempt) => Promise; readonly discardSession: (sessionId: string | undefined) => void; readonly recordSupersededAttempt?: (response: AgentResponse, attempt: Phase1Attempt) => void; } export interface Phase1EmptyRecoveryResult { readonly response: AgentResponse; readonly finalAttempt: Phase1Attempt; } interface SingleFreshPhase1RetryOptions { readonly stepName: string; readonly sequence: number; readonly instruction: string; readonly discardSession: () => void; readonly execute: (attempt: Phase1Attempt) => Promise<{ response: AgentResponse; promptResolved: boolean; }>; readonly complete: (response: AgentResponse, attempt: Phase1Attempt) => void; } interface ObservedPhase1AttemptOptions { readonly enabled: boolean; readonly runId: string | undefined; readonly workflowName: string; readonly eventStep: WorkflowStep; readonly spanStep: WorkflowStep; readonly iteration: number; readonly attempt: Phase1Attempt; readonly workflowStack: WorkflowResumePointEntry[] | undefined; readonly sanitizeText: ((text: string) => string) | undefined; readonly providerInfo: StepProviderInfo; readonly execute: (instruction: string, sessionId: string | undefined, onPromptResolved: (promptParts: PhasePromptParts) => void) => Promise; readonly onPhaseStart: ((step: WorkflowStep, phase: 1, phaseName: 'execute', instruction: string, promptParts: PhasePromptParts, phaseExecutionId: string, iteration: number) => void) | undefined; readonly onPhaseComplete?: CompleteObservedPhase1AttemptOptions['onPhaseComplete']; readonly failurePersona?: string; readonly recordFailure?: () => void; } interface CompleteObservedPhase1AttemptOptions { readonly eventStep: WorkflowStep; readonly iteration: number; readonly attempt: Phase1Attempt; readonly response: AgentResponse; readonly onPhaseComplete: ((step: WorkflowStep, phase: 1, phaseName: 'execute', content: string, status: string, error: string | undefined, phaseExecutionId: string, iteration: number) => void) | undefined; } export declare function executeObservedPhase1Attempt(options: ObservedPhase1AttemptOptions): Promise<{ response: AgentResponse; promptResolved: boolean; }>; export declare function completeObservedPhase1Attempt(options: CompleteObservedPhase1AttemptOptions): void; export declare function runSingleFreshPhase1Retry(options: SingleFreshPhase1RetryOptions): Promise; export declare function runPhase1WithEmptyRecovery(options: Phase1EmptyRecoveryOptions): Promise; export {}; //# sourceMappingURL=phase1-empty-recovery.d.ts.map