import type { PricingCatalogue } from './pricing.js'; import { join, segment } from './segment.js'; import type { AsyncTokenCounter } from './tokenizer.js'; import type { OptimizationResult, OptimizeOptions, Segment, TokenProvenance, UsageProfile } from './types.js'; export declare const DEFAULT_USAGE: UsageProfile; interface Masked { text: string; /** Original text of each protected segment, indexed by its mask. */ vault: string[]; } /** * Replaces every protected segment with a 3-character marker from the Unicode * private use area. The rules work on the masked text, so none of them can * touch code, URLs or template placeholders. */ declare function mask(segments: Segment[]): Masked; /** Puts the protected content back. */ declare function unmask(text: string, vault: string[]): string; /** * Optimises a prompt by applying deterministic rules. * * The result is reproducible: the same input always yields the same output and * running it costs nothing. The optional LLM pass lives separately, in * `refineWithLlm`. */ export declare function optimize(prompt: string, options?: OptimizeOptions): OptimizationResult; /** * Recomputes the report with an exact token counter (e.g. the official * token-counting endpoint). * * Only the headline numbers and the saving are recomputed. Per-rule token * attribution stays on the heuristic estimate: asking a remote counter once * per rule would multiply the calls without changing any decision. */ export declare function withExactTokenCounts(result: OptimizationResult, counter: AsyncTokenCounter, pricing?: PricingCatalogue, countedBy?: TokenProvenance | null): Promise; /** Re-exports of internals useful to anyone extending the library. */ export { join, mask as maskProtected, segment, unmask as unmaskProtected }; //# sourceMappingURL=optimize.d.ts.map