import type { SnapshotRequest, SnapshotResponse, TelemetryRequest } from "./types.js"; export declare const DEFAULT_CLOUD_URL = "https://api.jdcodec.com"; export declare const SNAPSHOT_PATH = "/v1/snapshot"; export declare const TELEMETRY_PATH = "/v1/telemetry"; export declare const DEFAULT_TIMEOUT_MS = 15000; export declare const DEFAULT_TELEMETRY_TIMEOUT_MS = 5000; export declare const DEFAULT_RETRIES = 1; export interface CloudClientOptions { baseUrl?: string; apiKey: string; timeoutMs?: number; retries?: number; region?: string; /** Override for tests. */ fetchImpl?: typeof fetch; /** Override for tests. */ now?: () => number; /** Override for tests. */ sleep?: (ms: number) => Promise; /** Override for tests — used for X-Request-Id. */ generateRequestId?: () => string; } export interface CloudPostResult { response: SnapshotResponse; requestId: string; httpStatus: number; elapsedMs: number; } export declare class CloudClient { private readonly baseUrl; private readonly apiKey; private readonly timeoutMs; private readonly retries; private readonly region; private readonly fetchImpl; private readonly now; private readonly sleep; private readonly generateRequestId; constructor(opts: CloudClientOptions); postSnapshot(body: SnapshotRequest): Promise; /** * POST /v1/telemetry. Single-shot — telemetry is fire-and-forget at the * caller; we do not retry inside the client. The server uses * INSERT ON CONFLICT DO NOTHING semantics so a caller that wraps this in * its own retry stays idempotent on (session_id, step). Throws on * network or non-2xx response so callers can log; a caller that truly * wants fire-and-forget catches the error and moves on. * * Returns the echoed X-Request-Id and HTTP status — useful for logs. * Body parsing is best-effort: a 204 response has no body, and any * 4xx/5xx error body is returned via the error. */ postTelemetry(body: TelemetryRequest): Promise<{ requestId: string; httpStatus: number; }>; private postOnce; }