import type { HorizonCore } from './core.js'; import { type HaltConfig, type HaltReason } from './halt.js'; import { type CommandPolicy, type Classification } from './guard.js'; import { type CompactionSeams, type CompactionConfig } from './compaction.js'; import { type ToolExecutionResult, type ToolExecutor } from './executor.js'; import { type CompletionCertificate, type CompletionConfig, type CompletionReplay, type CompletionVerification } from './completion.js'; import { type HorizonCheckpoint, type HorizonContinuity } from './checkpoint.js'; export interface HorizonEvent { /** Stable identity for evidence references. Tool events use `tool:`. */ id?: string; role: 'model' | 'tool' | 'summary'; text: string; receipt?: ToolExecutionResult; } /** What one model step decides to do. */ export type StepResult = { kind: 'final'; output: string; certificate?: CompletionCertificate; } | { kind: 'tool'; /** A shell command to run; it is classified by the guard first. */ command: string; /** Signature of forward progress (drives no-progress detection). */ progress?: string; /** Error signature if this step failed (drives repeated-failure). */ failure?: string | null; /** Human-readable note recorded in the transcript. */ note?: string; }; export interface DriverSeams { /** The model: given the running transcript, decide the next step. */ step(ctx: { events: HorizonEvent[]; iteration: number; }): Promise; /** Approve a GATE-classified command. Default: deny (safe). */ approve?(command: string, c: Classification): Promise; /** Real execution seam. Absence is an observed exit-127 failure, never assumed success. */ executor?: ToolExecutor; /** Deterministically reconstruct a completion claim from referenced evidence. */ replayCompletion?: CompletionReplay; /** Context compaction seams (token estimate, flush, summarize). */ compaction: CompactionSeams; } export interface DriverConfig { halt: HaltConfig; policy: CommandPolicy; compaction: CompactionConfig; /** Optional evidence gate for final completion. Absent preserves legacy behavior. */ completion?: CompletionConfig; } export type TurnOutcome = { kind: 'final'; output: string; iterations: number; events: HorizonEvent[]; completion?: CompletionVerification; } | { kind: 'halted'; reason: HaltReason; iterations: number; events: HorizonEvent[]; }; export declare class LongHorizonDriver { private readonly core; private readonly seams; private readonly halt; private readonly guard; private readonly compaction; private readonly executor; private readonly completion?; private events; private actionCount; private continuity; constructor(core: HorizonCore, seams: DriverSeams, config: DriverConfig, checkpoint?: HorizonCheckpoint); /** Run one user turn to a final answer or a halt. */ runTurn(input: string): Promise; /** Continue an interrupted turn from a verified full-state checkpoint. */ resumeTurn(): Promise; private runLoop; /** Persist the halt state to resume this driver's turn later. */ snapshotHalt(): import("./halt.js").HaltState; updateContinuity(patch: Partial): void; /** Persist transcript + receipts + semantic continuity, not only halt counters. */ snapshot(): HorizonCheckpoint; } //# sourceMappingURL=driver.d.ts.map