import type { DiagnosticHandler, InsforgeHttpResult, PostJsonOptions } from "./types.js"; export interface InsforgeHttpClientOptions { endpoint: string; apiKey?: string; anonKey?: string; apiKeyHeader?: string; extraHeaders?: Record; allowSelfSigned?: boolean; timeoutMs?: number; /** Used as diagnostic source + fingerprint scope. e.g. "sal.eval", "ext.telemetry". */ source: string; onDiagnostic?: DiagnosticHandler; } /** * Thin PostgREST HTTP client. Strictly transport: no routing, no batching, no * upsert semantics — those belong to the consumer (e.g. SAL's InsForgeEvalSink). * * Sinks construct one of these per options.endpoint, then call postJson / * patchJson with the full record URL. Diagnostics emit through * options.onDiagnostic with `source:category:fingerprint` keying so multiple * sinks can share an emit channel without collisions. */ export declare class InsforgeHttpClient { readonly base: string; private headers; private allowSelfSigned; private timeoutMs; private source; private onDiagnostic?; constructor(options: InsforgeHttpClientOptions); postJson(url: string, body: unknown, extra?: PostJsonOptions): Promise; patchJson(url: string, body: unknown): Promise; private httpJson; private reportDiagnostic; } export declare function parsePostgrestErrorCode(rawBody: string): string | undefined; export declare function safeHost(value: string): string | undefined;