import type { HarnessName } from "../../knowledge/descriptor.js"; import type { SessionMode } from "../../knowledge/transcript/listing.js"; /** One walked path a harness recognizes as a saved session. */ export interface ListingCandidate { /** The native ID, as `transcript read --id` accepts it; "" until the * session's own header supplies one. */ readonly id: string; /** The native transcript source, relative to the listing root. */ readonly file: string; /** Whether `transcript read` has a verified method for this source shape. */ readonly readable: boolean; /** The bytes this candidate's markers need, or null when it needs none. */ readonly read: { readonly path: string; readonly bytes: number; } | null; } /** One session, before the harness name and the method-level readability of * `SessionRow` are stamped on it. */ export interface ListedSession { readonly id: string; readonly file: string; readonly cwd: string | null; readonly lastWriteAt: string; /** When the native header says the session began, or null where the store * records no start time. A filesystem observation is never substituted. */ readonly startedAt: string | null; readonly mode: SessionMode; readonly readable: boolean; } export interface ListingMarkers { /** The candidate's bytes; empty when it declared no read. */ readonly bytes: Uint8Array; /** Whether this is the last prefix the caller will read: the whole file, or * the listing's read cap. */ readonly final: boolean; /** The listing's index bytes, or null when it declares no index. */ readonly index: Uint8Array | null; readonly lastWriteAt: string; } export type ListedResult = { readonly kind: "session"; readonly session: ListedSession; } /** No session of this harness, or a child conversation. */ | { readonly kind: "skip"; } /** The markers lie beyond the prefix; read more and ask again. */ | { readonly kind: "truncated"; }; export interface TranscriptListing { /** Directories under the listing root to walk; "" is the root itself. */ readonly directories: readonly string[]; /** Directory names that hold no session of this harness. */ prune(name: string): boolean; /** One store-wide file every row reads, relative to the listing root. */ readonly index: { readonly path: string; /** A passive filesystem clone is required to read it consistently. */ readonly snapshot: boolean; /** Sibling suffixes that must be absent or empty around the capture. */ readonly quiescentSiblings: readonly string[]; } | null; /** The candidate a walked path names, or null when it names no session. */ candidate(path: string): ListingCandidate | null; session(candidate: ListingCandidate, markers: ListingMarkers): ListedResult; } /** A first prefix that holds the identity records of every observed store. */ export declare const LISTING_PREFIX_BYTES = 65536; /** The listing one harness contributes, or null where it has none. */ export declare function listingForHarness(harness: HarnessName): TranscriptListing | null; //# sourceMappingURL=listings.d.ts.map