import type { HttpClient, RequestOptions } from "../http.js"; import { Paginated } from "../pagination.js"; import type { ListMemoriesParams, Memory, RememberParams, RememberResult } from "../types.js"; /** * Memories: browsing them, reading one, and handing over new material. * * Browsing is not searching. `list` is chronological and takes filters, * `search` ranks by relevance and takes a query - they are separate endpoints * because serving both from one would mean a caller who adds a filter silently * gets a differently ordered list. */ export declare class Memories { #private; constructor(http: HttpClient); /** * One page, plus the cursor loop. * * Returns a `Paginated`, so `await memories.list().first()` gets a page and * `for await (const memory of memories.list())` walks the lot. The filters * are carried into every page automatically - a caller re-passing them per * page is a caller who will eventually forget one, and the pages after that * come from a differently filtered list. */ list(params?: ListMemoriesParams, options?: RequestOptions): Paginated; get(id: string, options?: RequestOptions): Promise; /** * Hands material to the ingestion pipeline. Needs a key with `write` scope. * * This does NOT create a memory, and the return type says so: it answers 202 * with a job id. Extraction, entity resolution, deduplication and conflict * detection all run afterwards and may produce one memory, several, or none. * Poll `client.jobs.get(result.jobId)` to find out which. * * Pass an `idempotencyKey` if this can be retried by anything - a queue, a * user pressing a button twice, or this client's own retry loop, which * refuses to repeat a POST without one. `remember:note-42`, not a fresh * random value per call. */ remember(params: RememberParams, options?: RequestOptions): Promise; /** Upload document bytes for extraction. No automatic retry without an idempotency key. */ uploadFile(params: { bytes: Uint8Array; filename: string; contentType: string; spaceId: string; }, options?: RequestOptions): Promise<{ jobId: string; documentId: string; status: string; }>; }