import type { Agent, AgentOutputType } from '../agent'; import type { RunState } from '../runState'; import type { RunConfig, Runner, ToolErrorFormatter } from '../run'; import type { SingleStepResult } from './steps'; import type { ResumedSessionWritePreparation } from './sessionPersistence'; export declare function isAcceptedResponseCheckpoint(state: RunState): boolean; export declare function assertAcceptedResponseContinuationAuthority(state: RunState, requestedConversationId?: string, requestedPreviousResponseId?: string): void; export declare function markAcceptedResponseProcessingStarted(state: RunState): void; export declare function markAcceptedResponseFinalizationStarted(state: RunState): void; /** * Continues local processing for a response that was already accepted by the model provider. */ export declare function resumeAcceptedModelResponse>(options: { state: RunState; runner: Runner; toolErrorFormatter?: ToolErrorFormatter; agentToolParentRunConfig?: Partial; signal?: AbortSignal; onStepItems?: (turnResult: SingleStepResult) => void; validateHandoffAgent?: (agent: Agent) => void; }): Promise; export type InterruptedTurnOutcome = { nextStep: SingleStepResult['nextStep']; action: 'return_interruption' | 'rerun_turn' | 'advance_step'; resumedSideEffects: boolean; }; export type InterruptedTurnControl = { shouldReturn: boolean; shouldContinue: boolean; }; type ApplyTurnResultOptions> = { state: RunState; turnResult: SingleStepResult; agent: Agent; toolsUsed: string[]; resetTurnPersistence: boolean; onStepItems?: (turnResult: SingleStepResult) => void; }; export declare function applyTurnResult>(options: ApplyTurnResultOptions): void; export declare function resumeInterruptedTurn>(options: { state: RunState; runner: Runner; toolErrorFormatter?: ToolErrorFormatter; agentToolParentRunConfig?: Partial; signal?: AbortSignal; onStepItems?: (turnResult: SingleStepResult) => void; validateHandoffAgent?: (agent: Agent) => void; beforeResumedSideEffects?: () => Promise; onHandoff?: (agent: TAgent) => void; }): Promise; export declare function handleInterruptedOutcome>(options: { state: RunState; outcome: InterruptedTurnOutcome; setContinuingInterruptedTurn: (value: boolean) => void; }): InterruptedTurnControl; export {};