/** The SDK's own usage/error stream: core's closed `VendoUsageEvent` catalog, * batched to the console on the SAME terms the capability-miss stream uploads. * * Consent is that contract, not a second one: a Cloud key fills the slot at the * composition seam (never read from the environment here), and `envOptOut` — * `VENDO_TELEMETRY_DISABLED`, `DO_NOT_TRACK`, `CI` — is the kill switch. It runs * in production; NODE_ENV gates nothing. No key or an opt-out means * `createSdkEvents` hands back `undefined`, no sink is installed, and * `emitUsage` stays the no-op it is by default. * * WHO this deployment is never rides the body. The identity headers * (`deployment-identity.ts`) already travel on every keyed call and the console * resolves org/project/deployment from them server-side — naming any of the * three here would let a deployment claim to be another one. * * Keep this module free of node builtins; the portability gate bundles it. */ import { type VendoLogger, type VendoUsageEvent } from "./core/index.js"; export interface SdkEventsPipeline { record(event: VendoUsageEvent): void; /** Drain hook for tests and orderly host shutdown; a turn never awaits it. */ flush(): Promise; } export interface SdkEventsOptions { /** ADAPTER RULE, events slot: filled by the composition seam * (`cloudKeyOptions()`), never from the environment here. */ cloud?: { apiKey: string; baseUrl?: string; }; /** Opt-out inputs only (`envOptOut`); never a key or a base URL. */ env?: Record; /** Which JS runtime this deployment boots on — see {@link sdkRuntime}. */ runtime: string; fetchImpl?: typeof fetch; } /** The runtime's own NAME, from the globals each one advertises. Reported so a * crash on the edge is not read as a crash on Node; never a version, a path or * a machine. */ export declare function sdkRuntime(): string; /** * The events pipeline for this deployment, or `undefined` when it has no * business existing — no Cloud slot, or an environment opt-out. */ export declare function createSdkEvents(options: SdkEventsOptions): SdkEventsPipeline | undefined; /** * Wrap a logger so what Vendo warns or fails about ALSO becomes an `sdk_error`. * * The console line is untouched — the wrapped logger calls the one it wraps * first and adds nothing to it, so a host's output stays byte-identical whether * or not the events stream exists. `debug` and `info` are the machine narrating * itself and never report. */ export declare function withSdkErrorReporting(logger: VendoLogger): VendoLogger; /** * The `@vendoai` frames of a stack, each trimmed to start at the package name. * * A host application's own frames are the host's business and never travel, and * the trim drops the absolute prefix every frame carries — which is a machine's * home directory. A source-tree frame (`packages/vendo/src/…`, a monorepo * checkout) names no package and is dropped with the rest. */ export declare function vendoFrames(stack: string | undefined): string[];