import type { ActiveRun, KdActionCommit, KdContextEntry, KdFact, KdHarnessMode, KdPhase, KdQuestion, KdRisk, KdRiskSource, KdSourceAnchorSnapshot, KdToolResultContract, KdWriteTransaction } from "./types.ts"; import { type ToolResultContractInput } from "./tool-result-contract.ts"; import { type SourceAnchorSnapshotInput } from "./source-anchors.ts"; export declare function readActiveRun(cwd: string): ActiveRun | undefined; export declare function writeActiveRun(cwd: string, run: ActiveRun): void; export declare function readRun(cwd: string, id: string): ActiveRun | undefined; export declare function listRuns(cwd: string): ActiveRun[]; export declare function switchActiveRun(cwd: string, id: string): ActiveRun | undefined; export declare function finishActiveRun(cwd: string, run: ActiveRun): ActiveRun; export declare function createActiveRun(cwd: string, goal: string, productInput?: string, version?: string, modeInput?: KdHarnessMode): ActiveRun; export declare function recordRunContext(cwd: string, run: ActiveRun, input: { text: string; kind?: KdContextEntry["kind"]; sourceRefs?: string[]; }): KdContextEntry | undefined; export declare function recordToolResultContract(cwd: string, run: ActiveRun, input: ToolResultContractInput): KdToolResultContract; export declare function recordActionCommit(cwd: string, run: ActiveRun, input: Omit & { phase?: KdPhase; }): KdActionCommit; export declare function recordWriteTransaction(cwd: string, run: ActiveRun, transaction: KdWriteTransaction): KdWriteTransaction; export declare function recordSourceAnchorSnapshot(cwd: string, run: ActiveRun, input: SourceAnchorSnapshotInput): KdSourceAnchorSnapshot; export declare function addQuestion(cwd: string, run: ActiveRun, input: { question: string; reason?: string; contextSummary?: string; sourceRefs?: string[]; factLabel?: string; proposedFactValue?: string; options?: Array<{ label: string; description?: string; }>; choices?: string[]; multiple?: boolean; customAnswer?: boolean; blocking?: boolean; }): KdQuestion; export declare function answerQuestion(cwd: string, run: ActiveRun, id: string, answer: string): KdQuestion | undefined; export declare function reviseFact(cwd: string, run: ActiveRun, input: { factLabel: string; value: string; reason?: string; }): KdFact | undefined; export declare function openBlockingQuestions(run: ActiveRun): KdQuestion[]; export declare function updateProductProfile(cwd: string, run: ActiveRun, productInput: string, version?: string): ActiveRun; export declare function updateRisk(cwd: string, run: ActiveRun, risk: KdRisk, reason: string, source?: KdRiskSource): ActiveRun; export declare function updateHarnessMode(cwd: string, run: ActiveRun, mode: KdHarnessMode): { run: ActiveRun; changed: boolean; message: string; }; export declare function ensurePhaseArtifact(cwd: string, run: ActiveRun, phase: KdPhase): string; export declare function updatePhaseArtifact(cwd: string, run: ActiveRun, phase: KdPhase, content: string): string; export declare function advanceRun(cwd: string, run: ActiveRun, requestedPhase?: KdPhase): { run: ActiveRun; message: string; }; export declare function advanceRunIfReady(cwd: string, run: ActiveRun): { run: ActiveRun; advanced: boolean; message: string; }; export declare function refreshGate(cwd: string, run: ActiveRun): ActiveRun;