/** * HTTP client wrapper for `hippo serve`. * * Mirrors the function signatures in src/api.ts so the CLI can route through * either path uniformly. Each function takes (serverUrl, apiKey?, ...) and * returns the same shape that api.ts would. * * Errors from the server (4xx/5xx) are mapped back into thrown Errors with * the server's `error` message preserved verbatim so existing CLI handlers * that match on substrings (e.g. "not found", "already superseded") still * work unchanged. * * Network errors (ECONNREFUSED on a stale pidfile, etc.) propagate as the * native fetch failure so the caller can detect them and self-heal. */ import type { AuditEvent } from './audit.js'; import type { ApiKeyListItem } from './auth.js'; import type { RememberOpts, RememberResult, RecallOpts, RecallResult, AuthCreateOpts, AuthCreateResult, AuditListOpts } from './api.js'; /** An error the server answered with, not one the transport raised. The * refused-connection classifier sniffs message text, and a server message * quotes the caller's own id or content back verbatim. */ export declare class HttpResponseError extends Error { readonly status: number; constructor(message: string, status: number); } export declare function remember(serverUrl: string, apiKey: string | undefined, opts: RememberOpts): Promise; export declare function recall(serverUrl: string, apiKey: string | undefined, opts: RecallOpts): Promise; export declare function forget(serverUrl: string, apiKey: string | undefined, id: string): Promise<{ ok: true; id: string; }>; export declare function promote(serverUrl: string, apiKey: string | undefined, id: string): Promise<{ ok: true; sourceId: string; globalId: string; }>; export declare function supersede(serverUrl: string, apiKey: string | undefined, oldId: string, newContent: string): Promise<{ ok: true; oldId: string; newId: string; }>; export declare function archiveRaw(serverUrl: string, apiKey: string | undefined, id: string, reason: string): Promise<{ ok: true; archivedAt: string; }>; export declare function authCreate(serverUrl: string, apiKey: string | undefined, opts: AuthCreateOpts): Promise; export declare function authList(serverUrl: string, apiKey: string | undefined, opts: { active: boolean; }): Promise; export declare function authRevoke(serverUrl: string, apiKey: string | undefined, keyId: string): Promise<{ ok: true; revokedAt: string; }>; export declare function auditList(serverUrl: string, apiKey: string | undefined, opts: AuditListOpts): Promise; /** * How far a request got before the transport failed. * * 'never-sent' means the connection never opened, so the caller may safely * replay the call locally. 'delivery-unknown' means the socket broke with the * request already on the wire: the server may have committed it, so replaying a * write would store it twice. 'none' means this was not a transport failure. */ export type TransportFailure = 'none' | 'never-sent' | 'delivery-unknown'; export declare function classifyTransportFailure(err: unknown): TransportFailure; //# sourceMappingURL=client.d.ts.map