import type { TokenUsage } from './index.js'; /** One model call's usage, tagged with the chat entry that made it. The sink * maps this to its own span/audit format. Extends the standard `TokenUsage` * (provider, model, direction/tier, token counts) with the emitting `scope`. */ export interface ModelSpan extends TokenUsage { /** Which chat entry emitted it, e.g. `anthropic.chatWithTools`. */ scope: string; } export type ModelSpanSink = (span: ModelSpan) => void; /** Register (or clear, with `null`) the process-wide model-span sink. The most * recent registration wins; pass `null` to detach. One process = one sink, * matching the single-writer model of the MCP audit log. */ export declare function setModelSpanSink(sink: ModelSpanSink | null): void; /** Fire the registered sink for one model call. No-op when none is registered. * Never throws — a sink that throws is caught and warned, so audit / * observability can never break a model call (mirrors the `onUsage` contract). */ export declare function emitModelSpan(span: ModelSpan): void; /** Fire the model-span sink and the caller's `onUsage` hook for one model * call. Shared by every adapter so span emission stays at parity across * providers. The span goes first, independent of the caller's onUsage: the * audit sink must see EVERY model call, including inline coordinator turns * whose caller passes no onUsage. A throwing hook is caught and warned, so * accounting can never break a model call. */ export declare function fireUsageHook(hook: ((usage: TokenUsage) => Promise) | undefined, usage: TokenUsage, scope: string): Promise; //# sourceMappingURL=audit-hook.d.ts.map