/** * What reading it yourself would have cost, measured here rather than reported. * * EVERY TOOL THAT STATED ITS OWN SAVING STATED A NUMBER THAT WAS NOT WHAT IT * SENT. Measured across the fourteen benched tools: smart_dependencies declared * a baseline of 0 and a saving of -11 on a call that really avoided 63% of a * 211-token file; smart_tsconfig claimed +8.21% where the wire said -2.9%; * smart_package_json printed -92% in its own footer where the wire said -20.9%; * smart_security printed a flat 85% for three fixtures of three different * sizes. None of them was lying on purpose -- each counted a payload it then * wrapped in more metadata, or counted a compact form it did not send. * * A number a tool reports about itself can never be better than the tool's own * bookkeeping. So this module does not ask: it takes the arguments the caller * actually passed, reads the files they name, and counts them. The other half * of the ratio -- what went back -- is counted off the wire text. Both sides * are then measured by the same party with the same counter, which is the only * arrangement under which the difference between them means anything. */ /** What the recorder measured for itself, with no tool's arithmetic in it. */ export interface DisplacedInput { /** Tokens the caller would have spent reading the files it named. */ readonly tokens: number; /** Those files' bytes. */ readonly bytes: number; /** A digest of the text that was counted, so a row can be re-derived. */ readonly sha256: string; /** How many files were read. Never a path: a path is the caller's business. */ readonly files: number; /** * Whether the tool's resolved paths are part of this figure. * * False when a tool declared none, and also when it declared a set too large * to fit the cap -- which is measured as the named files alone. The recorder * labels a row with the tool's baseline source only when this is true, so * the label can never name a resolution the figure does not include. */ readonly widened: boolean; } /** * Measure what the caller's own read would have cost, or null if it cannot be * measured exactly. * * NULL IS THE IMPORTANT RETURN. A tool given content inline, pointed at a * directory, or pointed at something that is not there displaced an amount * this module cannot establish, and a missing baseline must read as missing * rather than as a measured zero -- a zero baseline is what produced * `tokensSaved: -11` for a tool that saves 63%. * * @param resolvedPaths files the arguments do not name but the tool resolved * for itself and reported: a `package.json` found under a directory, every * file in an `extends` chain. They are measured here exactly like the named * ones -- read with the same reader, counted with the same counter -- so a * tool's private resolution rule can widen the baseline without a tool's * arithmetic entering it. A path named twice across the two lists is still * counted once. */ export declare function measureDisplacedInput(args: unknown, resolvedPaths?: readonly string[]): Promise; //# sourceMappingURL=displaced-input.d.ts.map