/** * Engine-generated receipt for a helper agent's report. * * The parent only ever saw a child's prose, and prose can cite files the child * never opened. The receipt is built from the child's real tool-call events, so * the model cannot write or forge it. It gives the parent checkable handles: * which files the child read or changed, which commands it ran and how they * exited, and which paths its report names that it never touched. */ /** Hard cap on the "Receipt (…)" line. */ export declare const RECEIPT_MAX_CHARS = 600; /** Unbacked paths listed before "+N more". */ export declare const UNBACKED_MAX_PATHS = 5; export interface ReceiptCall { name: string; /** Raw key target (path / command / pattern / URL / agent), unshortened. */ target: string; /** Search root for grep/find/ls/code_search, unresolved. */ root?: string; outcome: "ok" | "error" | "pending"; /** Parsed from bash's `Exit code: N` result prefix. */ exitCode?: string; } /** The one argument that identifies what a tool call acted on. */ export declare function keyTarget(name: string, args?: Record): string; /** Pairs tool_call_start/tool_call_end events by toolCallId. */ export declare class ReceiptRecorder { private calls; private readonly byId; start(toolCallId: unknown, name: unknown, args: unknown): void; end(toolCallId: unknown, result: unknown, isError: unknown): void; reset(): void; snapshot(): ReceiptCall[]; /** Receipt + unbacked-path block for a finished report. */ render(reportText: string, cwd: string): string; } /** * `Receipt (N calls): read a.ts, b.ts · bash \`npm test\` → exit 0 · edit b.ts ✓` * Groups by tool, collapses identical items as ×N, sorts tools and items * alphabetically, and caps the line at RECEIPT_MAX_CHARS with "+N more". */ export declare function formatReceipt(calls: readonly ReceiptCall[], cwd: string): string; /** Paths a report mentions, de-duplicated, without :line suffixes. */ export declare function extractReportPaths(reportText: string): string[]; /** * Paths the report names that the helper never read, wrote, edited, listed or * searched. Conservative by design — anything plausibly touched is covered: * exact resolved match, inside a grep/find/ls/code_search root, or (for a * relative mention) the trailing segments of a touched file. */ export declare function findUnbackedPaths(reportText: string, calls: readonly ReceiptCall[], cwd: string): string[]; export declare function formatUnbacked(paths: readonly string[]): string | undefined; /** Full receipt block appended to a helper's result. */ export declare function buildHelperReceipt(calls: readonly ReceiptCall[], reportText: string, cwd: string): string;