/** * CostTelemetryBridge — forwards local token/cost accounting events to the * HQ publisher as `session.usage` envelopes, giving the command center the * granular per-call cost signal it needs to render live cost trends and * roll-ups across every connected machine. * * Source: the `token.accounted` EventBus event, emitted by the TokenCounter * (`infrastructure/token-counter.ts`) after every provider call. The payload * is plain serializable data (usage counts + a cost breakdown, plus the * provider/model that priced it and cache token counts) — no closures. * * This is the high-frequency cost feed; HQ's persistence layer time-buckets * these into trend series (per-bucket totals + per-model/per-provider * breakdowns). * * @module hq/cost-bridge */ import type { EventBus } from '../kernel/events.js'; import type { HqEventEnvelope } from './protocol.js'; import { type BridgeContextOptions } from './bridge-context.js'; export interface CostTelemetryBridgeOptions extends BridgeContextOptions { /** Local EventBus emitting `token.accounted`. */ events: EventBus; } /** * Start forwarding token/cost events to HQ. Returns a disposer that * unsubscribes the listener — call on shutdown. */ export declare function startCostTelemetryBridge(opts: CostTelemetryBridgeOptions): () => void; /** Re-export for type-only consumers. */ export type { HqEventEnvelope }; //# sourceMappingURL=cost-bridge.d.ts.map