export interface HarnessSessionRecord { agentId: string; taskId: string; mode: string; harness: string; /** Harness-native session id (or name for goose). */ id: string; /** True when the id was pre-assigned on the first run (deterministic). */ preassigned?: boolean; model?: string | null; /** Working directory the session was created in (resume requires it). */ cwd: string; createdAt: string; lastUsedAt: string; attempts: number; lastError?: string; } /** * Load a record when valid for this harness + cwd; otherwise null (fresh). * * Each mode resolves ONLY its own record. The old build→plan fallback was * removed (2026-09): resuming a plan session in build mode replays a * conversation that opens with "PLAN MODE … must NOT execute", causing the * model to report plan/read-only mode even though the task is workMode=build. * Build tasks that genuinely want planning context already have their own * `.build.json` record after the first build run. */ export declare function loadHarnessSession(agentId: string, taskId: string, mode: string, harness: string, cwd: string): HarnessSessionRecord | null; /** Persist a record (best-effort). */ export declare function saveHarnessSession(rec: HarnessSessionRecord): void; /** Drop a single record (e.g. after a resume failure). */ export declare function clearHarnessSession(agentId: string, taskId: string, mode: string): void; /** Drop every mode's record for a task (terminal status / --fresh). */ export declare function clearHarnessSessionsForTask(agentId: string, taskId: string, modes?: string[]): void; /** True when a record exists (used to decide whether resume is even possible). */ export declare function hasHarnessSession(agentId: string, taskId: string, mode: string): boolean;