@memnexus-ai/typescript-sdk 1.26.2 → 1.28.0

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.
package/dist/index.cjs CHANGED
@@ -80,6 +80,7 @@ __export(index_exports, {
80
80
  memoryRelationship: () => memoryRelationship,
81
81
  memoryRelationshipsResponse: () => memoryRelationshipsResponse,
82
82
  mergeCommunitiesRequest: () => mergeCommunitiesRequest,
83
+ namedMemoryHistoryResponse: () => namedMemoryHistoryResponse,
83
84
  narrativeMemory: () => narrativeMemory,
84
85
  narrativeThread: () => narrativeThread,
85
86
  narrativeTimelineResponse: () => narrativeTimelineResponse,
@@ -99,6 +100,7 @@ __export(index_exports, {
99
100
  updateArtifactRequest: () => updateArtifactRequest,
100
101
  updateFactRequest: () => updateFactRequest,
101
102
  updateMemoryRequest: () => updateMemoryRequest,
103
+ updateNamedMemoryRequest: () => updateNamedMemoryRequest,
102
104
  updateNarrativeRequest: () => updateNarrativeRequest,
103
105
  user: () => user,
104
106
  userUsage: () => userUsage
@@ -2421,6 +2423,110 @@ var MemoriesService = class extends BaseService {
2421
2423
  }
2422
2424
  return this.client.call(request);
2423
2425
  }
2426
+ /**
2427
+ * Get version history for a named memory
2428
+ * Returns the full version chain for a named memory, ordered newest-first.
2429
+ Walks the SUPERSEDES chain from HEAD backwards.
2430
+
2431
+ * @param name - Memory name (kebab-case, 2-64 chars)
2432
+ */
2433
+ async getNamedMemoryHistory(name) {
2434
+ const request = new Request({
2435
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
2436
+ method: "GET",
2437
+ path: "/api/memories/named/{name}/history",
2438
+ config: this.config,
2439
+ retry: {
2440
+ attempts: 3,
2441
+ delayMs: 150,
2442
+ maxDelayMs: 5e3,
2443
+ jitterMs: 50,
2444
+ backoffFactor: 2
2445
+ }
2446
+ });
2447
+ request.addPathParam("name", {
2448
+ key: "name",
2449
+ value: name,
2450
+ explode: false,
2451
+ encode: true,
2452
+ style: "simple",
2453
+ isLimit: false,
2454
+ isOffset: false,
2455
+ isCursor: false
2456
+ });
2457
+ return this.client.call(request);
2458
+ }
2459
+ /**
2460
+ * Get a memory by name
2461
+ * Retrieve the current HEAD version of a named memory by its user-assigned name.
2462
+ Returns the memory with topic breakdown and entities, same as GET /api/memories/{id}.
2463
+
2464
+ * @param name - Memory name (kebab-case, 2-64 chars)
2465
+ */
2466
+ async getMemoryByName(name) {
2467
+ const request = new Request({
2468
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
2469
+ method: "GET",
2470
+ path: "/api/memories/named/{name}",
2471
+ config: this.config,
2472
+ retry: {
2473
+ attempts: 3,
2474
+ delayMs: 150,
2475
+ maxDelayMs: 5e3,
2476
+ jitterMs: 50,
2477
+ backoffFactor: 2
2478
+ }
2479
+ });
2480
+ request.addPathParam("name", {
2481
+ key: "name",
2482
+ value: name,
2483
+ explode: false,
2484
+ encode: true,
2485
+ style: "simple",
2486
+ isLimit: false,
2487
+ isOffset: false,
2488
+ isCursor: false
2489
+ });
2490
+ return this.client.call(request);
2491
+ }
2492
+ /**
2493
+ * Update a named memory (create new version)
2494
+ * Creates a new version of a named memory. The name pointer moves to the new version,
2495
+ and a SUPERSEDES relationship links the new version to the old one.
2496
+ The old version's effectiveState becomes 'superseded'.
2497
+
2498
+ * @param name - Memory name (kebab-case, 2-64 chars)
2499
+ * @param body - Request body
2500
+ */
2501
+ async updateNamedMemory(name, body) {
2502
+ const request = new Request({
2503
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
2504
+ method: "PUT",
2505
+ path: "/api/memories/named/{name}",
2506
+ config: this.config,
2507
+ retry: {
2508
+ attempts: 3,
2509
+ delayMs: 150,
2510
+ maxDelayMs: 5e3,
2511
+ jitterMs: 50,
2512
+ backoffFactor: 2
2513
+ }
2514
+ });
2515
+ request.addPathParam("name", {
2516
+ key: "name",
2517
+ value: name,
2518
+ explode: false,
2519
+ encode: true,
2520
+ style: "simple",
2521
+ isLimit: false,
2522
+ isOffset: false,
2523
+ isCursor: false
2524
+ });
2525
+ if (body !== void 0) {
2526
+ request.addBody(body);
2527
+ }
2528
+ return this.client.call(request);
2529
+ }
2424
2530
  /**
2425
2531
  * Find similar memories
2426
2532
  * Find memories that are semantically similar to the given memory.
@@ -4130,6 +4236,10 @@ var pagination = import_zod.z.object({
4130
4236
  var memory = import_zod.z.object({
4131
4237
  /** Unique memory identifier */
4132
4238
  id: import_zod.z.string(),
4239
+ /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
4240
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
4241
+ /** Version number for named memories (1 for first version, increments on update) */
4242
+ version: import_zod.z.number().min(1).optional(),
4133
4243
  /** Memory content */
4134
4244
  content: import_zod.z.string(),
4135
4245
  /** Type of memory */
@@ -4183,6 +4293,8 @@ var memory = import_zod.z.object({
4183
4293
  var createMemoryRequest = import_zod.z.object({
4184
4294
  /** Conversation ID - use "NEW" to create a new conversation or provide existing conversation ID */
4185
4295
  conversationId: import_zod.z.string().min(1),
4296
+ /** Optional human-readable name for deterministic retrieval. Must be unique per user. */
4297
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
4186
4298
  /** Memory content */
4187
4299
  content: import_zod.z.string().min(1),
4188
4300
  /** Type of memory */
@@ -4203,6 +4315,8 @@ var createMemoryRequest = import_zod.z.object({
4203
4315
  var updateMemoryRequest = import_zod.z.object({
4204
4316
  /** Updated memory content */
4205
4317
  content: import_zod.z.string().min(1).optional(),
4318
+ /** Assign or remove a name. Set to a valid name to assign, empty string to remove. */
4319
+ name: import_zod.z.union([import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/), import_zod.z.enum([""])]).optional(),
4206
4320
  /** Updated memory type */
4207
4321
  memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]).optional(),
4208
4322
  /** Updated context or domain */
@@ -4228,6 +4342,10 @@ var relatedMemoryResult = import_zod.z.object({
4228
4342
  memory: import_zod.z.object({
4229
4343
  /** Unique memory identifier */
4230
4344
  id: import_zod.z.string(),
4345
+ /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
4346
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
4347
+ /** Version number for named memories (1 for first version, increments on update) */
4348
+ version: import_zod.z.number().min(1).optional(),
4231
4349
  /** Memory content */
4232
4350
  content: import_zod.z.string(),
4233
4351
  /** Type of memory */
@@ -4288,6 +4406,32 @@ var relatedMemoryResult = import_zod.z.object({
4288
4406
  var getMemoryResponse = import_zod.z.lazy(() => import_zod.z.object({
4289
4407
  data: memory
4290
4408
  }));
4409
+ var updateNamedMemoryRequest = import_zod.z.object({
4410
+ /** New content for the named memory version */
4411
+ content: import_zod.z.string().min(1),
4412
+ /** Type of memory (defaults to previous version's type) */
4413
+ memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]).optional(),
4414
+ /** Context or domain */
4415
+ context: import_zod.z.string().optional(),
4416
+ /** Associated topics */
4417
+ topics: import_zod.z.array(import_zod.z.string()).optional()
4418
+ });
4419
+ var namedMemoryHistoryResponse = import_zod.z.object({
4420
+ /** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
4421
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/),
4422
+ versions: import_zod.z.array(import_zod.z.object({
4423
+ /** Version number */
4424
+ version: import_zod.z.number().min(1),
4425
+ /** Memory ID for this version */
4426
+ id: import_zod.z.string(),
4427
+ /** Memory content at this version */
4428
+ content: import_zod.z.string(),
4429
+ /** Effective state — HEAD version is 'current', older versions are 'superseded' */
4430
+ effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
4431
+ /** When this version was created */
4432
+ createdAt: import_zod.z.string().datetime()
4433
+ }))
4434
+ });
4291
4435
  var batchGetMemoriesRequest = import_zod.z.object({
4292
4436
  /** Array of memory IDs to retrieve */
4293
4437
  ids: import_zod.z.array(import_zod.z.string().uuid()).min(1).max(100)
@@ -4477,6 +4621,10 @@ var searchResult = import_zod.z.lazy(() => import_zod.z.object({
4477
4621
  memory: import_zod.z.object({
4478
4622
  /** Unique memory identifier */
4479
4623
  id: import_zod.z.string(),
4624
+ /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
4625
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
4626
+ /** Version number for named memories (1 for first version, increments on update) */
4627
+ version: import_zod.z.number().min(1).optional(),
4480
4628
  /** Memory content */
4481
4629
  content: import_zod.z.string(),
4482
4630
  /** Type of memory */
@@ -4843,6 +4991,10 @@ var narrativeMemory = import_zod.z.object({
4843
4991
  memory: import_zod.z.object({
4844
4992
  /** Unique memory identifier */
4845
4993
  id: import_zod.z.string(),
4994
+ /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
4995
+ name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
4996
+ /** Version number for named memories (1 for first version, increments on update) */
4997
+ version: import_zod.z.number().min(1).optional(),
4846
4998
  /** Memory content */
4847
4999
  content: import_zod.z.string(),
4848
5000
  /** Type of memory */
@@ -5276,6 +5428,7 @@ var index_default = Memnexus;
5276
5428
  memoryRelationship,
5277
5429
  memoryRelationshipsResponse,
5278
5430
  mergeCommunitiesRequest,
5431
+ namedMemoryHistoryResponse,
5279
5432
  narrativeMemory,
5280
5433
  narrativeThread,
5281
5434
  narrativeTimelineResponse,
@@ -5295,6 +5448,7 @@ var index_default = Memnexus;
5295
5448
  updateArtifactRequest,
5296
5449
  updateFactRequest,
5297
5450
  updateMemoryRequest,
5451
+ updateNamedMemoryRequest,
5298
5452
  updateNarrativeRequest,
5299
5453
  user,
5300
5454
  userUsage