wontopos 2.2.10 → 2.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,6 +123,14 @@ export interface StatsResult {
123
123
  short_term_turns?: number;
124
124
  [key: string]: unknown;
125
125
  }
126
+ /** `listMemories` → one page of a store's raw memories (original text + metadata, no vector). */
127
+ export interface MemoryPage {
128
+ memories: Memory[];
129
+ count: number;
130
+ /** Pass back as `cursor` for the next page; `null` on the last page. */
131
+ next_cursor: string | null;
132
+ [key: string]: unknown;
133
+ }
126
134
  export interface ModelInfo {
127
135
  id: string;
128
136
  name: string;
@@ -235,6 +243,22 @@ export declare class Client {
235
243
  history(userId?: string): Promise<HistoryTurn[]>;
236
244
  /** Memory counts for a store: { total_memories, short_term_turns }. */
237
245
  stats(userId?: string): Promise<StatsResult>;
246
+ /** List a store's stored memories — the original text plus metadata, never the
247
+ * vector. Paginated: pass the returned `next_cursor` back as `cursor` for the next
248
+ * page; a `null` cursor means the last page. Use it to browse or export a store.
249
+ *
250
+ * let cursor: string | null = null;
251
+ * const all: Memory[] = [];
252
+ * do {
253
+ * const page = await mem.listMemories(undefined, { cursor: cursor ?? undefined });
254
+ * all.push(...page.memories);
255
+ * cursor = page.next_cursor;
256
+ * } while (cursor);
257
+ */
258
+ listMemories(userId?: string, opts?: {
259
+ limit?: number;
260
+ cursor?: string;
261
+ }): Promise<MemoryPage>;
238
262
  /** Available models: `[{ id, name, available, memory }, ...]`. Needs no API key. */
239
263
  listModels(): Promise<ModelInfo[]>;
240
264
  /** Create a store — the `userId` you read and write under. Stores are explicit:
package/dist/wontopos.js CHANGED
@@ -32,7 +32,7 @@
32
32
  * runtime's (never disabled by this SDK; Node 18+ floors TLS at 1.2). Prefer
33
33
  * `Client.fromEnv()` over keys in source code.
34
34
  */
35
- const VERSION = "2.2.10";
35
+ const VERSION = "2.2.11";
36
36
  const USER_AGENT = `wontopos-node/${VERSION}`;
37
37
  const DEFAULT_BASE_URL = "https://api.wontopos.com";
38
38
  const DEFAULT_MODEL = "tablet-1";
@@ -197,6 +197,24 @@ export class Client {
197
197
  stats(userId) {
198
198
  return this.post("/api/v1/memory/stats", { user_id: this.uid(userId) });
199
199
  }
200
+ /** List a store's stored memories — the original text plus metadata, never the
201
+ * vector. Paginated: pass the returned `next_cursor` back as `cursor` for the next
202
+ * page; a `null` cursor means the last page. Use it to browse or export a store.
203
+ *
204
+ * let cursor: string | null = null;
205
+ * const all: Memory[] = [];
206
+ * do {
207
+ * const page = await mem.listMemories(undefined, { cursor: cursor ?? undefined });
208
+ * all.push(...page.memories);
209
+ * cursor = page.next_cursor;
210
+ * } while (cursor);
211
+ */
212
+ listMemories(userId, opts = {}) {
213
+ const body = { user_id: this.uid(userId), limit: opts.limit ?? 100 };
214
+ if (opts.cursor)
215
+ body.cursor = opts.cursor;
216
+ return this.post("/api/v1/memory/list", body);
217
+ }
200
218
  // ----- models -----
201
219
  /** Available models: `[{ id, name, available, memory }, ...]`. Needs no API key. */
202
220
  async listModels() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wontopos",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "Wontopos — long-term memory for AI agents. Pure semantic retrieval, identical recall in every language, ~100× lower LLM bill.",
5
5
  "keywords": [
6
6
  "memory",