import type { ExecutionContext } from '../../core/ExecutionContext.ts'; import type { EpisodeLearner } from '../../evals/EpisodeLearner.ts'; import type { ResidualMemory } from '../../memory/ResidualMemory.ts'; import type { ReActLoop } from '../../reasoning/ReActLoop.ts'; /** * Execution and persistence halves of the agent lifecycle: loop execution with * timing and soft-failure handling, tracing, residual memory, episode * learning, Sentry reporting, and decision/provenance recording. Kept out of * BaseAgent so the execution orchestration stays readable. `getRole` is a * closure because subclass role fields are only set after the base * constructor runs. */ export declare class RunLifecycle { private readonly getRole; private readonly reasoningLoop; private readonly residualMemory?; private readonly episodeLearner?; constructor(getRole: () => string, reasoningLoop: ReActLoop, residualMemory?: ResidualMemory | undefined, episodeLearner?: EpisodeLearner | undefined); private get report(); /** * Runs the agent's executor with timing and soft-failure handling. A hard * failure is returned (never thrown) so the caller records it and decides * whether to rethrow; MaxStepsExceededError carries a partial result that * must still reach the caller. */ runStage(execute: (systemPrompt: string, input: string) => Promise<{ output: string; model?: string; }>, systemPrompt: string, input: string): Promise<{ output: string; error: unknown; durationMs: number; }>; recordTrace(args: { input: string; output: string; durationMs: number; error: unknown; context: ExecutionContext; }): void; recordResidual(input: string, context: ExecutionContext): void; learnFromRun(context: ExecutionContext): void; reportFailure(error: unknown, durationMs: number, context: ExecutionContext): Promise; recordRun(input: string, output: string, error: unknown, context: ExecutionContext): Promise; private recordDecision; private trackRunProvenance; } //# sourceMappingURL=runLifecycle.d.ts.map