/** * Prose compression by deterministic importance scoring. * * NO MODEL, ON PURPOSE. Their equivalent engine, Kompress-base, is a * ModernBERT classifier -- and it is simultaneously their weakest engine by * their own figures (30-50%, against 70-92% for the structural ones) and the * source of a stated limitation: "Kompress-base adds RAM overhead on * memory-constrained machines". Their whole product also "requires local Python * runtime -- incompatible with restricted sandboxes". * * Buying their least effective engine at the price of their worst deployment * constraint is a bad trade. The one structural advantage we hold is that we * are Node, already present wherever all sixteen supported clients run, and a * transformer dependency would spend exactly that. * * So: score sentences on features that are cheap and legible. A deterministic * scorer is also TESTABLE in a way a learned one is not -- every decision here * can be pinned by a fixture, which matters for a component whose failure mode * is quietly discarding the sentence that mattered. * * IF IT UNDERPERFORMS THEIR BAND, IT REPORTS THAT. The benchmark prints the * real number for this engine; it does not get to claim theirs. */ import type { CompressionResult, EngineContext } from './types.js'; /** * Importance of one sentence, higher is more worth keeping. * * Every term is a claim about what a coding agent needs, and every one is * checkable against a fixture. */ export declare function score(sentence: string, index: number, total: number, subject: number): number; /** * Recognises prose rather than structured content. * * DECLINES LINE-ORIENTED CONTENT, which by word count reads exactly like prose * and is the one shape this engine must not touch (#469). A comment block, a * numbered listing and a bulleted list all clear the wordiness bar -- a dense * block of `//` lines is wordier than most paragraphs -- while their lines are * the unit of meaning rather than their sentences. * * WHY THIS IS A CORRECTNESS FIX AND NOT A TUNING CHOICE. The reported session * read source through this path, got comment lines elided out of the middle of * a region, and built exact-text edits from what came back; every anchor * missed, because the lines it was anchored to had been removed from the view * and not from the file. A `12 lower-signal sentences removed` marker is an * honest report for a passage of prose and a corrupted one for a listing whose * reader is about to match it against the file it came from. The same goes for * a numbered listing, where dropping line 7 leaves 6 and 8 adjacent and every * line number after it meaningless. * * The cost is real and accepted: comment-dense and bulleted content stops being * elided, so some reduction is given up. A compression that makes an edit fail * is not a saving. */ export declare function looksLikeProse(text: string): boolean; /** * Keeps the highest-scoring half, in original order. * * LOSSY, and it says so. The marker names how many sentences went and, when a * spill is available, where the original is. A model reading "12 lower-signal * sentences" knows the shape of what it is missing, which is the difference * between compression and quiet damage. */ export declare function compressProse(text: string, ctx?: EngineContext): CompressionResult; //# sourceMappingURL=prose.d.ts.map