/** * Session — verbatim readout of a single session by id (or id prefix). * * Scans all known session files (Claude Code CLI, ACP, Codex, opencode) and * resolves `` against `sessionId`, accepting any unique prefix. Renders * the matched session verbatim in the same header format as `snap`, with * optional tail/since slicing. No cwd filter, no live-session skipping — * if you named the id, you want it. */ import { type Conversation, type SessionFile } from './session-parser.js'; export interface SessionOptions { /** Last N messages of the session (default: all). */ turns?: number; /** Only include messages at or after this timestamp. */ since?: Date; /** * Per-message byte cap. 0 (default) disables truncation — when you ask for * one specific session, you almost always want the full text. */ maxMessageBytes?: number; /** * Include `entrypoint: 'sdk-cli'` Claude Code sessions in the candidate * pool. Default true here (unlike snap/whisper): the user named an id * explicitly, so we shouldn't silently refuse to find it. */ includeSdkCli?: boolean; } export interface SessionMatch { sessionId: string; sourceType: NonNullable; path: string; modifiedTime: string; cwd?: string; } export interface SessionResult { sessionId: string; sourceType: NonNullable; path: string; cwd?: string; startTime: string; endTime: string; modifiedTime: string; ageMs: number; messageCount: number; /** How many messages were rendered after `turns`/`since` filters. */ messagesIncluded: number; bytes: number; text: string; } export declare class SessionNotFoundError extends Error { readonly id: string; constructor(id: string); } export declare class SessionAmbiguousError extends Error { readonly id: string; readonly matches: SessionMatch[]; constructor(id: string, matches: SessionMatch[]); } export declare function collectAllSessionFiles(): SessionFile[]; export declare function parseByType(f: SessionFile): Conversation; /** * Resolve a session id prefix to its matching files. Exposed for callers that * want to handle the 0/many cases themselves (e.g. shell completion). */ export declare function resolveSessionId(idPrefix: string): SessionFile[]; export declare function session(idPrefix: string, opts?: SessionOptions): SessionResult; //# sourceMappingURL=session.d.ts.map