/** * Shared instrumentation for billable inference responses. * * Every resource method that produces a `Completion` routes through * `instrumentResponse(...)` to extract the settlement receipt and the live * session-budget snapshot from response headers, emit them on the SDK event * bus, and build the public return shape. */ import type { EventBus } from "../events.js"; import type { NetworkId } from "../chains/index.js"; import type { Receipt, SessionBudgetSnapshot, SessionInvalidReason, X402PaymentSigner } from "../types/index.js"; export interface InstrumentedResult { data: T; response: Response; receipt: Receipt | null; requestId: string | null; budget: SessionBudgetSnapshot | null; sessionInvalidReason: SessionInvalidReason | null; } export interface InferenceContext { getWalletMaybe(): { address: string | null; network: NetworkId | null; }; getTokenMaybe(): string | null; getX402SignerMaybe?(): X402PaymentSigner | null; events: EventBus; } export declare function instrumentBillableResponse(ctx: InferenceContext, response: Response, data: T): InstrumentedResult; //# sourceMappingURL=instrumentation.d.ts.map