/** How to start the server again for a replay. */ export type SessionTarget = { kind: 'http'; url: string; } | { kind: 'stdio'; command: string; args: string[]; cwd: string; }; export interface SessionMeta { name: string; subdomain: string; target: SessionTarget; startedAt: string; } export interface RecordedCall { id: number; ts: string; tool: string; args: unknown; client: string; ms: number; /** False when the tool reported an error or the call itself failed. */ ok: boolean; /** The tool's result as the client received it; absent when too large. */ result?: unknown; /** Set when the call threw (timeout, server gone) instead of returning. */ error?: string; /** Size of a result that was too large to store. */ resultBytes?: number; } export declare function readCalls(subdomain: string): RecordedCall[]; export declare function readMeta(subdomain: string): SessionMeta | null; /** The session that recorded a call most recently, for commands run without a name. */ export declare function latestSession(): string | null; /** Appends calls for one publish session. Created once the subdomain is known. */ export declare class CallRecorder { private nextId; private readonly path; constructor(meta: SessionMeta); record(entry: Omit): void; } /** A tool result as text a person can read: text blocks as they are, the rest as JSON. */ export declare function resultText(result: unknown): string; /** * Line diff by longest common subsequence. Tool results are small; anything * past a few hundred lines is shown as two blocks instead. */ export declare function lineDiff(before: string, after: string): string[] | null; export declare function callsCmd(subdomain: string | undefined, options: { show?: string; tool?: string; last?: string; json?: boolean; }): void; export declare function replayCmd(parts: string[], options: { args?: string; url?: string; json?: boolean; }): Promise;