declare const API = "https://api.proagentstore.online"; export declare function getToken(): string | null; /** * True when an error message is transient CONNECTIVITY (offline / flaky wifi / aborted * navigation / CORS preflight), not a platform bug. Safari says "Load failed", Chrome * "Failed to fetch", Firefox "NetworkError". These fire once per in-flight request on * every network blip, so reporting them floods the durable log and buries real errors. * * A WORD filter, and so too broad for a reporting boundary (#1088): it also matches real errors that * merely mention "timed out" or "cancelled". `api()` and the global handlers now use * {@link classifyClientFailure}; this stays for the voice paths, which classify error STRINGS. */ export declare function isConnectivityError(message: string): boolean; export declare function setToken(t: string | null): void; /** Declare the build this bundle was made from. Call it once, at the app entry, before render. */ export declare function setClientBuild(id: string | null | undefined): void; /** The build id this bundle reports — see {@link setClientBuild}. */ export declare function clientBuild(): string; export declare function reportClientError(source: string, message: string, context?: Record, status?: number): void; /** * What a failure IS (#1088) — precise, not a guess from words in the message. * * - `abort` the caller cancelled it (`AbortError`): expected, never reported. * - `offline` a fetch that failed at the transport while the browser says it is offline: expected, * COUNTED, and the count is reported once it is back online — one row, not one per request. * - `network` a fetch that failed at the transport while online — the exact `TypeError` each browser * throws for it. Reported under `network`, which the server files as a warning. * - `error` everything else: a real failure. * * It replaces a word filter (`timed out|cancelled|aborted|…`) that also hid real errors whose message * merely contained one of those words. */ export type ClientFailureClass = "abort" | "offline" | "network" | "error"; export declare function classifyClientFailure(err: unknown, online?: boolean): ClientFailureClass; /** True for an error `api()` already reported (or classified as expected) — so a global handler skips it. */ export declare function wasReported(err: unknown): boolean; export declare function api>(path: string, opts?: RequestInit, noAuth?: boolean): Promise; /** * A refused request, with the WHOLE answer (#931). * * `api()` used to throw `new Error(body.error)`, so every structured field a refusal carried was * gone before any page could read it: the run holding a busy repo (`activeRun`, #886), a start * still provisioning, `needsReauth`, `duplicate_of`. The message is unchanged, so every existing * `catch (e) { … e.message … }` reads exactly as before; `status` and `body` are what is new. */ export declare class ApiError extends Error { readonly status: number; readonly body: unknown; constructor(message: string, status: number, body: unknown); } export { API }; //# sourceMappingURL=client.d.ts.map