/** * Source-code compression: keep the shape, drop the bodies. * * Their CodeCompressor reports the largest single number they publish -- 92% on * code search, 17,765 tokens to 1,408 -- and the mechanism is sound: for a * context query, what a model needs from a file it is not editing is the list * of what is in it, not the implementation of each part. * * WHY A BODY MAY BE DROPPED AT ALL, given the lossless-first rule everywhere * else here: a body has a home. `src/x.ts:14-37` is a complete instruction for * getting it back, using a tool the agent already has, against a file that * exists whether or not any cache of ours survives. That is a materially * different bargain from an opaque hash into a TTL cache -- their marker stops * meaning anything when the entry expires, and prints `[unresolved: entry not * found]` into the model's context. * * NEVER APPLIED TO A DIFF. A diff is already the compressed form of a change, * and its hunks are the entire content; eliding those bodies would delete the * information. `looksLikeDiff` guards that, and the router honours it. */ import type { CompressionResult, EngineContext } from './types.js'; /** A unified diff. Its hunks ARE the content; never elide them. */ export declare function looksLikeDiff(text: string): boolean; /** Cheap structural check for source code. */ export declare function looksLikeCode(text: string, ctx?: EngineContext): boolean; /** * Replaces function bodies with a marker naming where they live. * * Signatures, imports, class and type declarations and decorators all survive, * which is what makes the output still answer "what is in this file". */ export declare function compressCode(text: string, ctx?: EngineContext): CompressionResult; //# sourceMappingURL=code.d.ts.map