import type { ToolResult } from "../core/host.js"; import { type Limits } from "../core/limits.js"; /** One sentinel found in what the package returned: which, in what form, in which source and where in it. */ export type LeakFinding = { readonly sentinel: string; readonly form: string; readonly source: string; readonly where: string; }; /** Every form a value takes when it leaks: as it is, URL-encoded, JSON-escaped, hex, base64 and base64url at each of the * three byte alignments (the characters a neighbour's bytes change are cut off), and its head and tail. */ export declare function leakNeedles(value: string): { readonly form: string; readonly needle: string; }[]; /** Scans results, details, receipts, derived names and memos for the sentinels, in every form a value takes when it leaks. */ export declare class LeakScan { #private; readonly findings: LeakFinding[]; constructor(sentinels?: Readonly>); /** Any value a run produces: a result, its details, a receipt record, a memo's key and value, an error with every own * property it has, hidden ones too. Keys and strings are searched; a string that is JSON is searched decoded too; an * image block's base64 is searched decoded, since metadata inside the picture is as much a leak as text. */ value(source: string, value: unknown, where?: string): void; /** File and directory names, as a derivation wrote them. */ names(source: string, names: Iterable): void; /** A directory tree: every name in it, and every file's bytes. A directory that is not there is covered as nothing. */ dir(source: string, root: string): void; /** What was searched under the sources that start with `prefix`. */ covered(prefix: string): { bytes: number; records: number; }; clean(): boolean; report(): string; } /** What a result's media breaks of `limits`, as the guard holds a result to them; an empty list is a result within its * route's limits. Per still: a route that takes images, its edges and its base64 characters, the size read from its * header as the guard reads it (`imageHeader`, so a format it cannot read counts as over, since it cannot be shown to be * under). Per result: the media blocks, videos included, at most `imagesPerCall`; the stills' base64 characters in all, at * most the result's share of the request body. A video block is for a route that takes video, within its inline bytes. */ export declare function limitViolations(result: Pick, limits: Limits): string[];