/** * resumeLast corroboration (the codex --last race): given the candidate * sessions a store scan produced, rank them by evidence and choose only * when the evidence actually distinguishes them. Two candidates the * ranking cannot tell apart is a refusal the caller must surface - "most * recent" over a race window is a guess, and a guess resumes a stranger. * * cwd corroboration compares path STRINGS (trailing slashes normalized); * canonicalization (symlinks, /tmp vs /private/tmp) is the caller's job at * the impure boundary - harnesses record resolved paths, so pass resolved * paths in. */ export interface ResumeCandidate { readonly id: string; readonly mtimeMs: number; readonly cwd: string; } export type ResumeLastVerdict = { readonly kind: "chosen"; readonly id: string; readonly ranked: readonly string[]; } | { readonly kind: "ambiguous"; readonly candidates: readonly string[]; readonly reason: string; } | { readonly kind: "none"; }; export declare const rankResumeLast: (candidates: readonly ResumeCandidate[], context: { readonly cwd: string; }) => ResumeLastVerdict; /** * Resume-last warning text (RFC-06 Safety item 4): rendered purely from * the descriptor's `resumeLast.warning` template, with the realpath scope * substituted for `{cwd}`. No harness-name branch - the per-harness * wording lives in the knowledge layer as data, and the CLI layer calls * this before spawn and hands the rendered line to the runner as data. */ import type { HarnessDescriptor } from "../knowledge/descriptor.js"; /** One fixed pre-spawn text carrying no id (the resumed id is known only * at the first stream announce). Verbatim per the RFC; pinned in tests. */ export declare const resumeLastWarning: (h: HarnessDescriptor, cwd: string) => string; //# sourceMappingURL=resume-last.d.ts.map