/** * Log and build-output compression. * * Build logs, test runs and stack traces are the content a debugging loop reads * most and the content that repeats hardest. This is also the engine with the * best lossless story: a run of identical lines collapses to one line and a * count, and that is FULLY reconstructible from the output -- the reader knows * exactly what was there and exactly how many times. * * WHAT IS NEVER COLLAPSED. Lines carrying an error, a failure, an exception or * a non-zero exit survive individually even when they repeat. Two identical * `AssertionError` lines are two failures, and telling a debugging agent it saw * "2x AssertionError" when it needed to see both stack frames is exactly the * "inappropriate compression strategy [where] the model may not be able to * obtain key details" their own documentation warns about. The tokens saved by * folding an error are the tokens that mattered. */ import type { CompressionResult, EngineContext } from './types.js'; /** Detects content worth treating as a log rather than prose. */ export declare function looksLikeLog(text: string): boolean; /** * Whether the text is made of repeated records, whatever they are records OF. * * `looksLikeLog` recognises a log by its timestamps and its severity words, * which is one way for a block to be a pile of repeated records and not the * only one. A browser accessibility tree is the same thing without either -- * * node 0: role=listitem name="collect digest" focusable=false bounds=(597,141) * * -- and 701 such lines were reaching the router as `unknown`, compressing by * 0.0%, while the console log printed beside them in the same conversation was * claimed and folded by 41.4%. The engine could already do the work; nothing * asked it to. * * So the question is asked structurally: strip each line to its shape and see * whether a real share of the block collapses into a handful of them. That is * the same test `foldTemplates` applies to decide it has something to fold, so * a claim made here is one the compressor can honour. */ export declare function looksTemplated(text: string): boolean; /** * Folds runs of identical lines into one line and a count. * * LOSSLESS BY CONSTRUCTION, which is the point. "the same line, 37 more times" * is not an approximation of the removed content -- it is a complete * description of it, and the model can reconstruct the original exactly without * asking anyone for anything. No spill, no path, no lookup. */ export declare function compressLog(text: string, ctx?: EngineContext): CompressionResult; //# sourceMappingURL=log.d.ts.map