import { type KnowledgeAdapter, type KnowledgePosture } from "@vendoai/core"; /** One request the fake saw — tests assert auth rode as a Bearer token and that NO tenant selector of any kind crossed the wire. */ export interface RecordedKnowledgeRequest { /** Wire path suffix (`/search`); the mount prefix is stripped. */ path: string; method: string; authorization: string | null; body?: unknown; } export interface FakeKnowledgeServerOptions { /** The engine behind the wire (default: a fresh memoryKnowledgeAdapter). */ adapter?: KnowledgeAdapter; /** The posture the server declares AND enforces: routes outside it answer the `not-implemented` envelope, 501 (never a bare 404). */ posture?: KnowledgePosture; /** When set, requests not carrying `Bearer ` get the console-style 401 (an envelope that is deliberately NOT wire-legal — auth belongs to the mounting surface, so clients must fold 401 themselves). */ bearer?: string; } export interface FakeKnowledgeServer { /** Drop-in `fetch` for cloudKnowledge/httpKnowledge's injectable transport. */ fetch: typeof fetch; requests: RecordedKnowledgeRequest[]; adapter: KnowledgeAdapter; posture: KnowledgePosture; } /** * In-process fake of a `vendo/knowledge-wire@1` server — the test double for * the cloud client and the REFERENCE implementation the BYO docs * point at: everything a conformant wire server must do fits in this one * handler. Speaks core's wire schemas verbatim over any KnowledgeAdapter: * * 1. bodies are validated with the wire request schemas → `validation`, 400; * 2. routes the declared posture does not cover → `not-implemented`, 501; * 3. adapter `VendoError`s → `knowledgeWireErrorBody` envelopes; * 4. a missing/invisible /fetch ref → the enveloped `not-found`, 404 * (clients translate ONLY the envelope back to null); * 5. GET /status is the discovery handshake: format + posture + counts. * * The principal never crosses the wire — the server mints a local one and * `includeInternal` is the only context-derived behavior that rides in. */ export declare function fakeKnowledgeServer(options?: FakeKnowledgeServerOptions): FakeKnowledgeServer; //# sourceMappingURL=cloud.test-util.d.ts.map