import type { JobRow } from "./protocol.js"; export type TranscriptItem = { kind: "user"; text: string; } | { kind: "assistant"; text: string; } | { kind: "tool"; name: string; args: string; result?: string; error?: boolean; } | { kind: "note"; text: string; }; /** The tail of a session file read at most (a long session shows its latest part). */ export declare const READ_MAX: number; export declare function clean(s: string): string; type Entry = { type?: string; id?: string; parentId?: string | null; message?: Record; content?: unknown; customType?: string; display?: boolean; summary?: string; }; /** The current branch of a session file's entries (the last entry and its parents). */ export declare function branchOf(text: string): Entry[]; /** What a transcript shows, oldest first: prompts, replies, tool calls with their results, notes. */ export declare function transcriptItems(text: string, truncated?: boolean): TranscriptItem[]; /** A session file's last `max` bytes (READ_MAX unless said); truncated when the file is longer. */ export declare function readTail(file: string, max?: number): { text: string; truncated: boolean; size: number; mtimeMs: number; }; /** Ancestors of a subagent up to (not including) the main session, nearest last. */ export declare function pathOf(row: JobRow, rows: Iterable, main: string): JobRow[]; /** A subagent's siblings (itself among them) and direct children, oldest first. */ export declare function neighboursOf(row: JobRow, rows: Iterable): { siblings: JobRow[]; children: JobRow[]; }; export {};