/** * NOTHING THE CALLER ALREADY HAS IS WORTH SENDING BACK. * * Measured at the wire across all 37 cases in bench/tools/reduction.mjs, three * kinds of field cost 347 of 21,140 tokens and answer nothing: * * `success: true` on a reply that is not an error. MCP marks failure with * `isError`, so a true here is a second copy of the fact * that nothing went wrong. * cache bookkeeping `cacheHit`, `cached`, `fromCache`, `fileHash`, `hash`, * `cacheKey` -- facts about this process, not about the * input the caller asked about. * an echoed path the file the caller named, handed back to the caller * who named it. * * 1.64% in aggregate, but the aggregate is the wrong way to read it: these are * fixed costs, so they fall entirely on the small replies. They are 25% of * smart_env's answer about an 8-variable file and 17% of smart_tsconfig's about * a 76-token config, and removing them turns smart_env/example.env from -14.4% * into +14.4% -- a tool that cost more than reading the file into one that * does not. * * WHY HERE AND NOT IN THE TOOLS. `success: true` is written at 371 places in 82 * files and the cache fields at 557 more. Editing them individually would be a * thousand chances to miss one and a thousand diffs to review, and a tool added * next week would arrive with the fields back. This is the one place every * reply passes, so one rule covers every tool including the ones not written * yet. * * WHAT IT DELIBERATELY CANNOT REACH. A reply may carry the caller's own parsed * file -- smart_tsconfig returns the resolved config, and a config is arbitrary * JSON that may legitimately contain a key called `cached` or `success`. * Removing one would corrupt the answer. So this walks the ENVELOPE only: the * reply object itself, and a `metadata` or `summary` object directly beneath * it. Those two names are a tool's own bookkeeping container in every reply * measured, and nothing nested deeper is touched at any depth. The cost of * that boundary is one duplicate flag at `data.format.metadata.cacheHit`, six * tokens, whose copy at `metadata.cacheHit` is removed; the benefit is that no * amount of caller content can be mistaken for an envelope. A test pins both * halves. */ /** * Remove, from one reply, what the caller already holds. * * `declaredDefaults` holds, for this tool's own published inputSchema, every * property that prints a `default` and what that default is. It is how the * seam tells an echoed option from a finding while knowing nothing else * about the tool, and it defaults to empty so a caller that cannot supply it * still gets the other rules. */ export declare function withoutRestated(reply: unknown, args: unknown, declaredDefaults?: ReadonlyMap): unknown; //# sourceMappingURL=restated.d.ts.map