/** Shared HTTP client for the knowledge endpoints: per-call Bearer auth, JSON/SSE POST, and error translation. */ /** One knowledge API failure: HTTP status plus a bounded server-body summary. */ export declare class KbApiError extends Error { readonly status?: number | undefined; constructor(message: string, status?: number | undefined); } export interface KbClientOptions { /** Resolves the current workspace id per call (patch config or credential); throws with guidance when unconfigured. */ resolveWorkspaceId: () => Promise; endpointHost: string; /** Service version forwarded on search/chat when set (deployment debug choice). */ agentVersion?: string; /** Resolves the current BAILIAN_KB_API_KEY per call; throws with guidance when unconfigured. */ resolveApiKey: () => Promise; /** Test seam; defaults to global fetch. */ fetchImpl?: typeof fetch; } export declare class KbClient { private readonly opts; constructor(opts: KbClientOptions); /** The deployment's configured service version, exposed for request builders. */ get agentVersion(): string | undefined; private post; /** * POST one JSON request and parse the JSON response. * @param path - one KB_PATHS value. * @param body - JSON-serializable request body. * @param signal - optional abort/timeout signal. * @returns the parsed response. */ postJson(path: string, body: unknown, signal?: AbortSignal): Promise; /** * POST one JSON request expecting an SSE response stream. * @param path - one KB_PATHS value. * @param body - JSON-serializable request body. * @param signal - abort/timeout signal (kb_chat passes its configured timeout). * @returns the raw Response whose body is the SSE stream. */ postSse(path: string, body: unknown, signal?: AbortSignal): Promise; }