#!/usr/bin/env node import type { EvalReport, PruneReport } from '@trazum/core'; /** * The part of an optional counter package this CLI actually uses. * * Declared here rather than imported as `typeof import('@trazum/tokenizer-openai')`, * and the reason is a build that failed in CI and was right to. * * A static type reference to an optional package is a **compile-time** * dependency on it: `tsc` resolves the module while type-checking, so the CLI * could not be built at all unless the optional package had been built first. * That is the opposite of optional, and it made a package somebody chooses to * install into one this repository could not compile without. * * So the contract is written out. It costs a few lines and it is the honest * shape: this is what the CLI relies on, and `optional-counter-contract.test.js` * asserts the real package still provides it, so the two cannot drift apart * without a red test rather than a wrong number. */ export interface OptionalCounterModule { openaiCounter(model: string): Promise<{ ok: true; count: (text: string) => number; encoding: string; model: string; } | { ok: false; refusal: { reason: string; model: string; known: readonly string[]; }; }>; } /** * `trazum route --prompt-file

--cases ` — the loop the levers could * only point at. * * `profile` prices a route exactly and can say nothing whatever about whether the * cheaper model still does the job. So it printed a figure and a homework * assignment, and homework does not get done — the report said "$16.80 available, * go and test it" and the reader closed the terminal. * * This runs the test. Same prompt, two models, judged against **the expensive * model's own run-to-run variance** measured on the same cases in the same run. No * threshold anybody picked: the question is whether the cheaper model agrees with * the original more closely than the original agrees with itself. * * It costs three provider calls per case and says so before spending one of them, * exactly as `prune` does. A command that can spend somebody's money without * telling them first is a command they stop trusting. */ /** * The routing measurement, without the text that produced it. * * `route --json` printed `{ slice, evaluation }` — the whole `EvalReport`, * whose `cases[]` carries `input` (the caller's own case text), `baseline[0]`, * `baseline[1]` and `optimized` (three model answers). It carried no * `schemaVersion` either. * * `docs/json-output.md` opens by promising that **nothing here carries a * session key or prompt text**, and this is the document most likely to be * piped into a dashboard, pasted into a ticket or dropped into a browser. A * tool whose headline is that prompts never leave the machine cannot have its * most portable artefact be the one that carries them. * * The per-case *shape* survives: the two similarity scores are the evidence * behind the verdict, and a reader checking a borderline call needs them. Only * the strings go. Anyone who wants the answers has the human-readable output, * which never left the terminal. * * A named function rather than an inline object so the stripping is a thing a * test can call without spending a provider call to reach it. */ export declare function routeDocument(slice: unknown, result: EvalReport): unknown; /** * The example-pruning measurement, likewise. * * `ExampleContribution.text` is *"the example itself, so a report can quote its * first line"* — true of the terminal rendering and wrong of a document that * promises to carry no prompt text. A few-shot example **is** prompt text, and * this was the second command emitting it. * * `index` and `tokens` say which example without quoting it, which is what a * machine reading this needs: it already has the prompt. */ export declare function pruneDocument(report: PruneReport): unknown; //# sourceMappingURL=index.d.ts.map