import { type SessionEntry, type SessionHeader } from "./session-entries.js"; /** Persisted child transcript (subagent or opted-in advisor), keyed by slash-joined path. */ export interface SubSession { /** Transcript stem, e.g. "ToolAsk" or "__advisor.reviewer". */ agentId: string; /** Key of the parent sub-session, or null when spawned by the main session. */ parent: string | null; header: SessionHeader | null; entries: SessionEntry[]; leafId: string | null; /** The subagent was explicitly killed (a tombstone sidecar sits next to its transcript). */ aborted: boolean; /** JSONL records skipped as malformed while loading this transcript. */ malformedRecords: number; } /** Receives the key of a subagent transcript that exists but has no readable session header. */ export type UnreadableSubSessionHandler = (key: string) => void; /** Read-only discovery scope and malformed-transcript reporting for child collectors. */ export interface CollectSubSessionsOptions { onUnreadable?: UnreadableSubSessionHandler; /** Include advisor transcripts for read-only exports, never task restoration. */ includeAdvisors?: boolean; /** Include gc-compressed transcripts for read-only exports. */ includeCompressed?: boolean; } /** * Collect subagent session transcripts stored next to a session file. * * Keys in the returned record are slash-joined ids relative to the main session * ("ToolAsk", "ToolAsk/Helper"). Empty files are skipped silently; corrupt ones * are skipped and reported to `onUnreadable`. Advisors and compressed transcripts * are opt-in, so task restoration and text dumps retain their subagent-only scope. */ export declare function collectSubSessions(sessionFile: string, options?: CollectSubSessionsOptions): Promise>;