import type { Message } from '../../types/message/index.js'; import type { FileReadTracker } from '../../types/tool/index.js'; import { type LedgerReplayReport } from './file-evidence-replay.js'; /** * Distinct paths one seeding will canonicalize before it replays anything. * * A ceiling rather than a budget because the work is uniform: each path is a * handful of `realpath` calls, once per conversation. Counted on distinct * SPELLINGS, the ones only `read` names included — a read has to be keyed too * or it cannot contradict a claim — so two spellings of one file count twice. * A history naming more paths than this is not a conversation whose ledger is * worth guessing at, and it seeds nothing rather than resolving a prefix and * abandoning the rest — a partially keyed walk is a walk that cannot say what * a mutation replaced. That is a total loss for the conversation, not a partial * one: it starts from the empty ledger a resume has always started from, and * its first mutation of each path re-establishes it. */ export declare const MAX_RESOLVED_PATHS = 1024; /** What a caller needs to key a path the way its tools will. */ export interface ObservationSeedContext { readonly workingDirectory: string; /** See `ToolContext.additionalDirectories`; part of the tools' resolution. */ readonly additionalDirectories?: readonly string[]; /** True when this turn's tools address a sandbox, whose keys are paths as written. */ readonly sandboxed?: boolean; } /** * Rebuild `tracker` from a conversation's own `messages`. * * For a host that keeps one tracker per conversation and has just restored one: * the ledger is process memory, so a resumed conversation starts with nothing * in it and re-reads files whose whole body is already in the transcript. Call * it once, before the conversation's first request. Reading files is confined * to canonicalizing the paths in the history; no file's CONTENT is read, and * every body restored is one the visible calls reconstruct exactly. * * Content-backed observations, and only those. A path the walk cannot rebuild * is left out of the ledger rather than entered without a fingerprint, so * `write`'s read-before-overwrite refusal stands over it exactly as it does * against the empty ledger a resume gets today. Three things seed nothing at * all, and the report says so: a history naming more than * {@link MAX_RESOLVED_PATHS} distinct path spellings, one whose ids are * ambiguous, and one holding a mutation no path can be recovered from — * whatever the transcript says came back to that mutation, since a key is what * withdrawing one path rather than the whole pass takes. A call whose arguments * are too long to read as JSON at all is one of that last kind; the replay * states the ceiling. */ export declare function seedObservationLedger(messages: readonly Message[], tracker: FileReadTracker, context: ObservationSeedContext): Promise; //# sourceMappingURL=file-evidence-seed.d.ts.map