/** * Event transport — batches the local funnel event queue and posts it to the * Cognitum analytics Cloud Function (ADR-308 endpoint contract). * * Design discipline (ADR-308 client failure policy — all normative): * 1. Telemetry never blocks the CLI. Every network call is best-effort, * capped by a short timeout, and swallows every error path. * 2. Events are LOCAL FIRST. The queue in `events.ts` accumulates * regardless of API reachability. This transport is the flush layer. * 3. Idempotency: every batch carries a UUIDv4 idempotency key so a retry * never double-counts (ADR-308 idempotent-batches invariant). * 4. Exponential backoff on transient failures. Successful flushes stamp * a "last flush" timestamp so we don't hammer the API each render. * 5. Consent-gated. Zero network activity when telemetry consent is off. * 6. Bounded. Never send more than MAX_BATCH events at once, so a large * backlog doesn't blow the endpoint request-size limit. * 7. Credit-exhaustion detection. If the endpoint replies 402 (Payment * Required) or the body carries the ADR-303 * `COGNITUM_CREDIT_EXHAUSTED` code, we surface via `credit-notifier.ts` * — the same recovery UX ADR-303 already ships. */ /** * Default endpoint — the ruflo-funnel-analytics endpoint on the ruv.io * domain, mapped via Cloud Run domain mapping to the cognitum-analytics * Cloud Function on cognitum-20260110. Overridable by env for staging or * self-hosted deploys. The domain choice is deliberate: an rUv-authored * OSS project's telemetry endpoint belongs on rUv's own domain, not on * cognitum.one — that keeps the CLI attribution honest. */ export declare const DEFAULT_ENDPOINT: string; /** Cap per POST — server enforces its own limits too; this is a safety net. */ export declare const MAX_BATCH = 100; /** Min interval between flushes (ms). Rate limits the client from within. */ export declare const MIN_FLUSH_INTERVAL_MS = 60000; /** POST timeout — telemetry must not stall the CLI. */ export declare const FLUSH_TIMEOUT_MS = 4000; /** * Best-effort flush of the local event queue to the endpoint. Returns a * summary the CLI can log at --verbose; the caller should never fail on it. */ export declare function flushEvents(opts?: { endpoint?: string; release?: string; force?: boolean; now?: Date; }): Promise<{ flushed: number; skipped: string | null; status?: number; }>; //# sourceMappingURL=event-transport.d.ts.map