import type { Session } from '../types/session.js'; import type { SessionStore } from '../session/SessionStore.js'; import type { Hooks } from '../types/hooks.js'; import type { RunContext } from '../types/run-context.js'; import { type RunState } from './durable/types.js'; import type { RunStore } from './durable/RunStore.js'; import type { ConversationOutcome } from '../outcomes/types.js'; import type { FlowGateVerdict } from '../flows/definition/types.js'; import type { ExtractionConfig } from '../types/grounding.js'; export interface CloseRunExtractionOptions { config: ExtractionConfig; turnMessageBaseline: number; run: () => Promise; trackBackground: (promise: Promise) => void; } export interface CloseRunOptions { session: Session; /** Number of inline audit entries present when this turn opened. */ auditBaseline?: number; runState: RunState; runStore: RunStore; sessionStore: SessionStore; hooks?: Hooks; ctx: RunContext; terminalOutcome?: ConversationOutcome; outcomeReason?: string; outcomeGates?: FlowGateVerdict[]; extraction?: CloseRunExtractionOptions; } export declare function closeRun(options: CloseRunOptions): Promise;