import type { SessionStatusState } from '../read-model/index.js'; import { type SessionLog } from '../store/session-log/index.js'; import type { Message } from '../types/message/index.js'; import type { SessionRecord, TurnStatus } from '../types/session/index.js'; /** * Asking a session what happened, from its log. * * The log is the one source: `records()` is every record, the fold is the * conversation that survived compaction, and `compaction_shed` carries * exactly the messages each pass removed, in their original order — so * "everything that was ever in this conversation" has one answer. */ export interface SessionQueryOptions { /** The session log to ask. */ readonly log: SessionLog; /** Injectable for the same reason the read model injects it. */ readonly now?: () => number; } export type SessionTranscriptUnavailableReason = /** A record of the log does not chain to the one before it. */ 'log-integrity' /** A message body was spilled and the spill cannot be read or verified. */ | 'spill-unavailable'; /** * Refusal to call a partial or unverifiable reconstruction "complete". */ export declare class SessionTranscriptUnavailableError extends Error { readonly reason: SessionTranscriptUnavailableReason; /** The last record the log could vouch for. */ readonly throughSeq: number | undefined; constructor(input: { reason: SessionTranscriptUnavailableReason; throughSeq?: number; cause?: unknown; }); } /** What one compaction pass removed. */ export interface ShedPass { readonly iteration: number; readonly reason: Extract['reason']; readonly messages: readonly Message[]; /** Where in the log the pass sits. */ readonly seq: number; } export declare class SessionQuery { private readonly options; constructor(options: SessionQueryOptions); /** The session's records, oldest first. Refused when the log does not chain. */ records(): Promise; /** Every message compaction removed, one entry per pass, oldest first. */ shedHistory(): Promise; /** * Everything that was ever in this conversation: shed passes oldest * first, then the conversation that survived (the fold of the log, or * `messages` when given). Complete, not interleaved: the log records what * each pass removed, not where its summary sits relative to what came * after. */ fullTranscript(messages?: readonly Message[]): Promise; /** The session's status, folded from its own log through the read model. */ status(): Promise; /** The whole projected state, for a caller that wants the park too. */ statusState(): Promise; } //# sourceMappingURL=index.d.ts.map