/** * Telemetry streaming — batch and send events to Optimus backend. */ import { TelemetryEvent } from "./telemetry.js"; /** Thrown by sendBatch when the server rejects the request with a 4xx status. Not retryable. */ export declare class ClientError extends Error { readonly httpStatus: number; constructor(status: number, message: string); } /** * Route a send failure to the right local buffer. * 4xx → client_errors.jsonl (logged, never retried) * anything else → pending_events.jsonl (retried on next hook invocation) * Exported for unit testing without needing to mock the HTTP stack. */ export declare function routeFailure(events: TelemetryEvent[], err: unknown): void; /** * Resolved batch size from OPTIMUS_BATCH_SIZE (read at call time so tests can set env after import). * Invalid or non-positive values fall back to 1 so `length >= batchSize` stays meaningful. */ export declare function getBatchSize(): number; /** * Add an event to the queue and flush if needed. */ export declare function queueEvent(event: TelemetryEvent): Promise; /** * Flush all queued events to backend. */ export declare function flushEvents(): Promise; /** * Ensure all events are flushed on process exit. * Uses beforeExit to allow async flush before process terminates. */ export declare function ensureShutdown(): void; //# sourceMappingURL=streaming.d.ts.map