import { R as RetrieverFactory } from '../../../types-B0JV4XZ0.mjs'; /** * Hosted Knowledge retriever — a thin HTTP client over @mordn/chat-api's * `POST /v1/knowledge/query`. Same `Retriever` interface as the pgvector * default, so switching a consumer from BYO to hosted is a one-line change: * * retrieval: { * store: createHostedKnowledgeRetriever({ apiKey: process.env.MORDN_CHAT_KEY }), * resolveNamespaces: () => [], * } * * Identity: the `apiKey` is an agent key (mck_live_… / mck_test_…), issued * per-agent from the dashboard. The server resolves both the tenant AND the * agent from this single credential — there is no separate agentId to * provide. Every query is automatically scoped to this agent's knowledge base. */ interface HostedKnowledgeOptions { /** Agent API key (mck_live_… / mck_test_…), issued per-agent from the * dashboard. Required. The server resolves the tenant and agent from this * key — no agentId is needed or accepted. Never sent to the client. */ apiKey: string; /** API base URL. Defaults to the hosted service; override for self-host/local. */ baseUrl?: string; /** Optional fetch override (testing). */ fetch?: typeof fetch; /** Per-request timeout (ms) for the hosted API. Defaults to 30s; `0` disables. */ timeoutMs?: number; } /** * Create a `RetrieverFactory` backed by the hosted @mordn/chat-api service. * * createChatHandler({ * retrieval: { * store: createHostedKnowledgeRetriever({ apiKey: process.env.MORDN_CHAT_KEY }), * resolveNamespaces: () => [], * }, * }) * * The API key is an agent key — the server resolves the tenant and agent from * it and scopes every query to that agent's knowledge base automatically. */ declare function createHostedKnowledgeRetriever(options: HostedKnowledgeOptions): RetrieverFactory; export { type HostedKnowledgeOptions, createHostedKnowledgeRetriever };