/** * Shared source-file loader used by tools that accept `source_paths[]`. * * The point of a path-based tool input is context preservation — Claude does * not pre-read the file, the server does. Keep this module fast and boring. */ export interface LoadedSource { path: string; body: string; } /** * Hard cap on a single source file's byte size — mirrors the indexer's * MAX_FILE_BYTES. loadSources only ever uses the first `perFileMax` CHARS, but * it read the WHOLE file into a JS string first: a multi-hundred-MB log (the * advertised incident_pack workload) OOM'd, and a file over V8's ~512MB string * limit threw ERR_STRING_TOO_LONG surfaced as a misleading SOURCE_PATH_NOT_FOUND. * We now reject over-cap files via the already-open handle's stat BEFORE any * read (never buffering the whole file), with a distinct SOURCE_FILE_TOO_LARGE * so callers can tell "too big" apart from "missing". (M7, 2026-07 health pass.) */ export declare const MAX_SOURCE_BYTES: number; /** * Read each path, slice to `perFileMax` chars per file, return in input order. * Throws SOURCE_PATH_NOT_FOUND on the first missing/unreadable path, and * SOURCE_FILE_TOO_LARGE on the first file whose byte size exceeds `maxBytes` * (default MAX_SOURCE_BYTES) — either way failing loud instead of a partial * answer or an OOM. `maxBytes` is an override seam (tests / future per-caller * caps); production callers pass two args and get the default. */ export declare function loadSources(paths: string[], perFileMax: number, maxBytes?: number): Promise; /** Format loaded sources as a single prompt block with begin/end markers per file. */ export declare function formatSourcesBlock(sources: LoadedSource[]): string; //# sourceMappingURL=sources.d.ts.map