import { d as MemoryAdapterFactory } from '../../../types-B_kkAV7t.mjs'; /** * Hosted memory adapter — a thin HTTP client over @mordn/chat-api's * `/v1/memory/*` endpoints. Same `MemoryAdapter` interface as the Drizzle/mem0 * adapters, so switching is a one-line change: * * memory: { adapter: createHostedMemory({ apiKey: process.env.MORDN_CHAT_KEY, agentId }) } * * Identity: the `apiKey` authenticates the TENANT; the per-request `userId` the * handler binds is sent as `X-Chat-User` (the end user, from the consumer's * verified session — same trust model as getUserId). The hosted service enforces * tenant + agent + user scoping; this client only carries identity. * * Endpoints (per the build contract): * retrieve → POST /v1/memory/query { agentId, query, limit } * record → POST /v1/memory/record { agentId, conversationId, messages } * list → GET /v1/memory?agentId= * forget → DELETE /v1/memory/:id * forgetAll→ DELETE /v1/memory?agentId= */ interface HostedMemoryOptions { /** Tenant API key (mck_live_… / mck_test_…). Required. Never sent to the client. */ apiKey: string; /** * Optional agent assertion for advanced multi-agent control planes. The * standard hosted path omits it because the API key already selects the agent. */ agentId?: 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 `MemoryAdapterFactory` backed by the hosted @mordn/chat-api service. * Pass to `createChatHandler({ memory: { adapter: createHostedMemory({ apiKey, agentId }) } })`. */ declare function createHostedMemory(options: HostedMemoryOptions): MemoryAdapterFactory; export { type HostedMemoryOptions, createHostedMemory };