/** * reportSavings — Fire-and-forget helper to report token savings to the proxy's SavingsLedger. * * Used by processes that run separately from the proxy (e.g., MCP server, CLI tools). * The proxy accumulates all savings in its in-memory SavingsLedger and serves them to the dashboard. */ type SavingsSource = 'clipboard' | 'contextSqueeze' | 'historyPrune' | 'complexityRouting' | 'cache'; interface ReportByChars { source: SavingsSource; charsBefore: number; charsAfter: number; toolName?: string; query?: string; filePath?: string; } interface ReportByTokens { source: SavingsSource; tokens: number; toolName?: string; query?: string; filePath?: string; } type ReportPayload = ReportByChars | ReportByTokens; /** * Report savings to the proxy's SavingsLedger via HTTP POST. * Fire-and-forget — never throws, never blocks. */ export declare function reportSavings(payload: ReportPayload): void; type CostSource = 'mcpInstructions' | 'toolResult' | 'cacheMiss'; interface CostPayload { source: CostSource; /** Tokens spent. Use this or `chars`, not both. */ tokens?: number; /** Chars spent — converted with the same chars/4 heuristic as savings. */ chars?: number; toolName?: string; /** Connected host name ("claude-code", "cursor", ...). The proxy defaults to "unknown". */ host?: string; /** Cost origin — in-process Lemma tool results report "lemma". */ origin?: string; } /** * Report tokens Lemma *spent* to the proxy's ledger. Same fire-and-forget contract * as reportSavings — the cost side must never be able to break a tool call, but it * also must not be silently skipped, or the ledger goes back to only counting wins. */ export declare function reportCost(payload: CostPayload): void; export {}; //# sourceMappingURL=reportSavings.d.ts.map