@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 +154 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +265 -9
- package/dist/index.d.ts +265 -9
- package/dist/index.js +152 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2314,6 +2314,110 @@ var MemoriesService = class extends BaseService {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
return this.client.call(request);
|
|
2316
2316
|
}
|
|
2317
|
+
/**
|
|
2318
|
+
* Get version history for a named memory
|
|
2319
|
+
* Returns the full version chain for a named memory, ordered newest-first.
|
|
2320
|
+
Walks the SUPERSEDES chain from HEAD backwards.
|
|
2321
|
+
|
|
2322
|
+
* @param name - Memory name (kebab-case, 2-64 chars)
|
|
2323
|
+
*/
|
|
2324
|
+
async getNamedMemoryHistory(name) {
|
|
2325
|
+
const request = new Request({
|
|
2326
|
+
baseUrl: this.config.baseUrl || "http://localhost:3000",
|
|
2327
|
+
method: "GET",
|
|
2328
|
+
path: "/api/memories/named/{name}/history",
|
|
2329
|
+
config: this.config,
|
|
2330
|
+
retry: {
|
|
2331
|
+
attempts: 3,
|
|
2332
|
+
delayMs: 150,
|
|
2333
|
+
maxDelayMs: 5e3,
|
|
2334
|
+
jitterMs: 50,
|
|
2335
|
+
backoffFactor: 2
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
request.addPathParam("name", {
|
|
2339
|
+
key: "name",
|
|
2340
|
+
value: name,
|
|
2341
|
+
explode: false,
|
|
2342
|
+
encode: true,
|
|
2343
|
+
style: "simple",
|
|
2344
|
+
isLimit: false,
|
|
2345
|
+
isOffset: false,
|
|
2346
|
+
isCursor: false
|
|
2347
|
+
});
|
|
2348
|
+
return this.client.call(request);
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Get a memory by name
|
|
2352
|
+
* Retrieve the current HEAD version of a named memory by its user-assigned name.
|
|
2353
|
+
Returns the memory with topic breakdown and entities, same as GET /api/memories/{id}.
|
|
2354
|
+
|
|
2355
|
+
* @param name - Memory name (kebab-case, 2-64 chars)
|
|
2356
|
+
*/
|
|
2357
|
+
async getMemoryByName(name) {
|
|
2358
|
+
const request = new Request({
|
|
2359
|
+
baseUrl: this.config.baseUrl || "http://localhost:3000",
|
|
2360
|
+
method: "GET",
|
|
2361
|
+
path: "/api/memories/named/{name}",
|
|
2362
|
+
config: this.config,
|
|
2363
|
+
retry: {
|
|
2364
|
+
attempts: 3,
|
|
2365
|
+
delayMs: 150,
|
|
2366
|
+
maxDelayMs: 5e3,
|
|
2367
|
+
jitterMs: 50,
|
|
2368
|
+
backoffFactor: 2
|
|
2369
|
+
}
|
|
2370
|
+
});
|
|
2371
|
+
request.addPathParam("name", {
|
|
2372
|
+
key: "name",
|
|
2373
|
+
value: name,
|
|
2374
|
+
explode: false,
|
|
2375
|
+
encode: true,
|
|
2376
|
+
style: "simple",
|
|
2377
|
+
isLimit: false,
|
|
2378
|
+
isOffset: false,
|
|
2379
|
+
isCursor: false
|
|
2380
|
+
});
|
|
2381
|
+
return this.client.call(request);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Update a named memory (create new version)
|
|
2385
|
+
* Creates a new version of a named memory. The name pointer moves to the new version,
|
|
2386
|
+
and a SUPERSEDES relationship links the new version to the old one.
|
|
2387
|
+
The old version's effectiveState becomes 'superseded'.
|
|
2388
|
+
|
|
2389
|
+
* @param name - Memory name (kebab-case, 2-64 chars)
|
|
2390
|
+
* @param body - Request body
|
|
2391
|
+
*/
|
|
2392
|
+
async updateNamedMemory(name, body) {
|
|
2393
|
+
const request = new Request({
|
|
2394
|
+
baseUrl: this.config.baseUrl || "http://localhost:3000",
|
|
2395
|
+
method: "PUT",
|
|
2396
|
+
path: "/api/memories/named/{name}",
|
|
2397
|
+
config: this.config,
|
|
2398
|
+
retry: {
|
|
2399
|
+
attempts: 3,
|
|
2400
|
+
delayMs: 150,
|
|
2401
|
+
maxDelayMs: 5e3,
|
|
2402
|
+
jitterMs: 50,
|
|
2403
|
+
backoffFactor: 2
|
|
2404
|
+
}
|
|
2405
|
+
});
|
|
2406
|
+
request.addPathParam("name", {
|
|
2407
|
+
key: "name",
|
|
2408
|
+
value: name,
|
|
2409
|
+
explode: false,
|
|
2410
|
+
encode: true,
|
|
2411
|
+
style: "simple",
|
|
2412
|
+
isLimit: false,
|
|
2413
|
+
isOffset: false,
|
|
2414
|
+
isCursor: false
|
|
2415
|
+
});
|
|
2416
|
+
if (body !== void 0) {
|
|
2417
|
+
request.addBody(body);
|
|
2418
|
+
}
|
|
2419
|
+
return this.client.call(request);
|
|
2420
|
+
}
|
|
2317
2421
|
/**
|
|
2318
2422
|
* Find similar memories
|
|
2319
2423
|
* Find memories that are semantically similar to the given memory.
|
|
@@ -4023,6 +4127,10 @@ var pagination = z.object({
|
|
|
4023
4127
|
var memory = z.object({
|
|
4024
4128
|
/** Unique memory identifier */
|
|
4025
4129
|
id: z.string(),
|
|
4130
|
+
/** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
|
|
4131
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
|
|
4132
|
+
/** Version number for named memories (1 for first version, increments on update) */
|
|
4133
|
+
version: z.number().min(1).optional(),
|
|
4026
4134
|
/** Memory content */
|
|
4027
4135
|
content: z.string(),
|
|
4028
4136
|
/** Type of memory */
|
|
@@ -4076,6 +4184,8 @@ var memory = z.object({
|
|
|
4076
4184
|
var createMemoryRequest = z.object({
|
|
4077
4185
|
/** Conversation ID - use "NEW" to create a new conversation or provide existing conversation ID */
|
|
4078
4186
|
conversationId: z.string().min(1),
|
|
4187
|
+
/** Optional human-readable name for deterministic retrieval. Must be unique per user. */
|
|
4188
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
|
|
4079
4189
|
/** Memory content */
|
|
4080
4190
|
content: z.string().min(1),
|
|
4081
4191
|
/** Type of memory */
|
|
@@ -4096,6 +4206,8 @@ var createMemoryRequest = z.object({
|
|
|
4096
4206
|
var updateMemoryRequest = z.object({
|
|
4097
4207
|
/** Updated memory content */
|
|
4098
4208
|
content: z.string().min(1).optional(),
|
|
4209
|
+
/** Assign or remove a name. Set to a valid name to assign, empty string to remove. */
|
|
4210
|
+
name: z.union([z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/), z.enum([""])]).optional(),
|
|
4099
4211
|
/** Updated memory type */
|
|
4100
4212
|
memoryType: z.enum(["episodic", "semantic", "procedural"]).optional(),
|
|
4101
4213
|
/** Updated context or domain */
|
|
@@ -4121,6 +4233,10 @@ var relatedMemoryResult = z.object({
|
|
|
4121
4233
|
memory: z.object({
|
|
4122
4234
|
/** Unique memory identifier */
|
|
4123
4235
|
id: z.string(),
|
|
4236
|
+
/** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
|
|
4237
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
|
|
4238
|
+
/** Version number for named memories (1 for first version, increments on update) */
|
|
4239
|
+
version: z.number().min(1).optional(),
|
|
4124
4240
|
/** Memory content */
|
|
4125
4241
|
content: z.string(),
|
|
4126
4242
|
/** Type of memory */
|
|
@@ -4181,6 +4297,32 @@ var relatedMemoryResult = z.object({
|
|
|
4181
4297
|
var getMemoryResponse = z.lazy(() => z.object({
|
|
4182
4298
|
data: memory
|
|
4183
4299
|
}));
|
|
4300
|
+
var updateNamedMemoryRequest = z.object({
|
|
4301
|
+
/** New content for the named memory version */
|
|
4302
|
+
content: z.string().min(1),
|
|
4303
|
+
/** Type of memory (defaults to previous version's type) */
|
|
4304
|
+
memoryType: z.enum(["episodic", "semantic", "procedural"]).optional(),
|
|
4305
|
+
/** Context or domain */
|
|
4306
|
+
context: z.string().optional(),
|
|
4307
|
+
/** Associated topics */
|
|
4308
|
+
topics: z.array(z.string()).optional()
|
|
4309
|
+
});
|
|
4310
|
+
var namedMemoryHistoryResponse = z.object({
|
|
4311
|
+
/** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
|
|
4312
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/),
|
|
4313
|
+
versions: z.array(z.object({
|
|
4314
|
+
/** Version number */
|
|
4315
|
+
version: z.number().min(1),
|
|
4316
|
+
/** Memory ID for this version */
|
|
4317
|
+
id: z.string(),
|
|
4318
|
+
/** Memory content at this version */
|
|
4319
|
+
content: z.string(),
|
|
4320
|
+
/** Effective state — HEAD version is 'current', older versions are 'superseded' */
|
|
4321
|
+
effectiveState: z.enum(["current", "superseded", "contradicted"]).optional(),
|
|
4322
|
+
/** When this version was created */
|
|
4323
|
+
createdAt: z.string().datetime()
|
|
4324
|
+
}))
|
|
4325
|
+
});
|
|
4184
4326
|
var batchGetMemoriesRequest = z.object({
|
|
4185
4327
|
/** Array of memory IDs to retrieve */
|
|
4186
4328
|
ids: z.array(z.string().uuid()).min(1).max(100)
|
|
@@ -4370,6 +4512,10 @@ var searchResult = z.lazy(() => z.object({
|
|
|
4370
4512
|
memory: z.object({
|
|
4371
4513
|
/** Unique memory identifier */
|
|
4372
4514
|
id: z.string(),
|
|
4515
|
+
/** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
|
|
4516
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
|
|
4517
|
+
/** Version number for named memories (1 for first version, increments on update) */
|
|
4518
|
+
version: z.number().min(1).optional(),
|
|
4373
4519
|
/** Memory content */
|
|
4374
4520
|
content: z.string(),
|
|
4375
4521
|
/** Type of memory */
|
|
@@ -4736,6 +4882,10 @@ var narrativeMemory = z.object({
|
|
|
4736
4882
|
memory: z.object({
|
|
4737
4883
|
/** Unique memory identifier */
|
|
4738
4884
|
id: z.string(),
|
|
4885
|
+
/** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
|
|
4886
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
|
|
4887
|
+
/** Version number for named memories (1 for first version, increments on update) */
|
|
4888
|
+
version: z.number().min(1).optional(),
|
|
4739
4889
|
/** Memory content */
|
|
4740
4890
|
content: z.string(),
|
|
4741
4891
|
/** Type of memory */
|
|
@@ -5169,6 +5319,7 @@ export {
|
|
|
5169
5319
|
memoryRelationship,
|
|
5170
5320
|
memoryRelationshipsResponse,
|
|
5171
5321
|
mergeCommunitiesRequest,
|
|
5322
|
+
namedMemoryHistoryResponse,
|
|
5172
5323
|
narrativeMemory,
|
|
5173
5324
|
narrativeThread,
|
|
5174
5325
|
narrativeTimelineResponse,
|
|
@@ -5188,6 +5339,7 @@ export {
|
|
|
5188
5339
|
updateArtifactRequest,
|
|
5189
5340
|
updateFactRequest,
|
|
5190
5341
|
updateMemoryRequest,
|
|
5342
|
+
updateNamedMemoryRequest,
|
|
5191
5343
|
updateNarrativeRequest,
|
|
5192
5344
|
user,
|
|
5193
5345
|
userUsage
|