/** * Connection-error classification + the two typed failures createRetryingClient's callOnce() * surfaces for a mutating operation. Split out of daemon-client.ts's own bundled concerns -- * still zero runtime imports of its own (see daemon-client.ts's own module doc comment for why * that invariant matters for Pi's jiti-based extension loader). */ export type StaleConnectionPredicate = (error: unknown) => boolean; /** Opaque identity for one daemon process instance. Never use a bearer token as this value. */ export type DaemonInstanceIdentity = string & { readonly __daemonInstanceIdentity: unique symbol; }; export declare function daemonInstanceIdentity(value: string): DaemonInstanceIdentity; export interface DaemonIdentityChange { previous: DaemonInstanceIdentity; current: DaemonInstanceIdentity; } export interface CallOnceOptions { /** Stable request/tool-call identifier carried into typed transport-ambiguity failures. */ operationId?: string; } export declare class PreDispatchConnectionError extends Error { readonly operationId: string | undefined; readonly code = "vehicle-pre-dispatch-connection-failed"; constructor(operationId: string | undefined, cause: unknown); } export declare class MutationOutcomeUnknownError extends Error { readonly operationId: string | undefined; readonly code = "vehicle-mutation-outcome-unknown"; constructor(operationId: string | undefined, cause: unknown); } /** * Conservative classifier for failures proving no request reached the daemon. A bare * `fetch failed`, timeout, reset, or abort is deliberately excluded: those can happen * after the server applied a mutation but before the response reached the caller. */ export declare function isDefinitelyPreDispatchConnectionError(error: unknown): boolean; /** * True when `error` means the connection itself is bad (worth dropping the * cached client and retrying once against a fresh one) -- a dead port after * a daemon restart, a refused/reset socket, a DNS failure, a timed-out * request. False for a genuine domain-level rejection (e.g. a validation * error the daemon itself returned), which a retry cannot fix and would * only mask. Matches the heuristic already proven identical across every * consumer this module replaces. */ export declare function isLikelyStaleConnectionError(error: unknown): boolean;