import type { DeviceIdentity } from "./device.js"; export interface RegisterResult { sessionCode: string; agentToken: string; } /** Machine-readable `code` the relay sends for a stale/unknown device identity * 403 — the ONLY 403 that should trigger identity regeneration. */ export declare const DEVICE_SECRET_MISMATCH = "device_secret_mismatch"; /** * Thrown when the relay rejects a registration with a non-2xx status. Carries * the HTTP `status` plus the relay's machine-readable `code` (parsed from the * JSON body, when present) so callers can distinguish a fatal client error * (e.g. a `device_secret_mismatch` 403 — retrying the same identity will fail * forever, so the agent must regenerate) from a transient/server error or some * OTHER 403 that must NOT discard the device identity. */ export declare class RegistrationError extends Error { readonly status: number; readonly body: string; /** Relay-supplied machine-readable error code, or null if the body had none. */ readonly code: string | null; constructor(status: number, body: string); } export interface RegisterOptions { /** The stored session code, so the server can restore it if its KV record * was evicted. Ignored when `forceNew` is set. */ currentCode?: string; /** Force a brand-new code (change-code path). */ forceNew?: boolean; } export declare function register(serverUrl: string, device?: DeviceIdentity, options?: RegisterOptions): Promise;