/** * Bhived REST Client * * Thin fetch-based client for the Bhived FastAPI core. * Uses native fetch (Node 18+) with AbortController timeouts * and single-retry for transient failures. */ import type { QueryParams, ReadResultV2, WriteParams, WriteResult, MemoryDetail, HealthStatus, SubscriptionStatus, MemoryListParams, MemoryListResult, ActivationResponse, CapabilityReportParams, AdminCapabilityReadResponse } from "./types.js"; export declare class BhivedRestClient { private readonly baseUrl; private readonly timeout; private readonly apiKey; constructor(baseUrl?: string, timeout?: number, apiKey?: string); /** * POST /v2/query — the only query path this client uses. Returns team-hive * and public-hive results in SEPARATE sections and honors the * `503 models_warming` retry-with-backoff. */ queryV2(params: QueryParams): Promise; writeMemory(params: WriteParams): Promise; getMemory(memoryId: string): Promise; getHealth(): Promise; /** * GET /v1/subscription — the caller's live plan, derived server-side from * the X-API-Key header. The authoritative signal for team vs personal * scope; callers must validate `plan` before trusting it. */ getSubscription(): Promise; listMemories(params?: MemoryListParams): Promise; activateCapability(memoryId: string): Promise; reportCapability(memoryId: string, params: CapabilityReportParams): Promise<{ ok: boolean; }>; getSkill(memoryId: string): Promise; getMcp(memoryId: string): Promise; private encodePathSegments; private buildHeaders; private post; private get; private assertAuthenticated; private handleResponse; private requestWithRetry; private isRetryableError; /** * Detect the `503 {"error":"models_warming"}` signal the backend returns on * /v1/query and /v2/query while embedding/reranker models warm up. This is * transient, not fatal — callers should retry with backoff rather than surface * it as an error. */ private isModelsWarming; private normalizeError; } /** Singleton REST client instance */ export declare const restClient: BhivedRestClient; //# sourceMappingURL=restClient.d.ts.map