@memnexus-ai/typescript-sdk 1.31.0 → 1.31.2
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 +105 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +273 -4
- package/dist/index.d.ts +273 -4
- package/dist/index.js +100 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2315,6 +2315,46 @@ var MemoriesService = class extends BaseService {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
return this.client.call(request);
|
|
2317
2317
|
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Generate memory digest
|
|
2320
|
+
* Synthesizes a comprehensive, structured briefing from all relevant memories
|
|
2321
|
+
on a topic. Instead of multiple search rounds, one call returns a complete digest.
|
|
2322
|
+
|
|
2323
|
+
**Formats:**
|
|
2324
|
+
- `structured` (default): Sections with headers, bullet points, key decisions
|
|
2325
|
+
- `narrative`: Chronological prose narrative
|
|
2326
|
+
- `timeline`: Dated event list
|
|
2327
|
+
- `status-report`: Done/In Progress/Blocked grouping
|
|
2328
|
+
|
|
2329
|
+
**Pipeline:**
|
|
2330
|
+
1. Gather: High-limit search + conversation expansion
|
|
2331
|
+
2. Organize: Group by conversation, status, timeline
|
|
2332
|
+
3. Synthesize: LLM generates formatted digest
|
|
2333
|
+
|
|
2334
|
+
Requires an LLM provider to be configured (EXTRACTION_ENABLED=true).
|
|
2335
|
+
Returns 503 if the LLM provider is unavailable and 3+ memories are found.
|
|
2336
|
+
|
|
2337
|
+
* @param body - Request body
|
|
2338
|
+
*/
|
|
2339
|
+
async generateMemoryDigest(body) {
|
|
2340
|
+
const request = new Request({
|
|
2341
|
+
baseUrl: this.config.baseUrl || "http://localhost:3000",
|
|
2342
|
+
method: "POST",
|
|
2343
|
+
path: "/api/memories/digest",
|
|
2344
|
+
config: this.config,
|
|
2345
|
+
retry: {
|
|
2346
|
+
attempts: 3,
|
|
2347
|
+
delayMs: 150,
|
|
2348
|
+
maxDelayMs: 5e3,
|
|
2349
|
+
jitterMs: 50,
|
|
2350
|
+
backoffFactor: 2
|
|
2351
|
+
}
|
|
2352
|
+
});
|
|
2353
|
+
if (body !== void 0) {
|
|
2354
|
+
request.addBody(body);
|
|
2355
|
+
}
|
|
2356
|
+
return this.client.call(request);
|
|
2357
|
+
}
|
|
2318
2358
|
/**
|
|
2319
2359
|
* Get version history for a named memory
|
|
2320
2360
|
* Returns the full version chain for a named memory, ordered newest-first.
|
|
@@ -5045,7 +5085,7 @@ var user = z.object({
|
|
|
5045
5085
|
plan: z.enum(["free", "pro", "enterprise"]),
|
|
5046
5086
|
memoryLimit: z.number(),
|
|
5047
5087
|
retentionDays: z.number().nullable(),
|
|
5048
|
-
deletionStatus: z.enum(["none", "pending_deletion", "deleted"]),
|
|
5088
|
+
deletionStatus: z.enum(["none", "pending_deletion", "deleting", "deleted"]),
|
|
5049
5089
|
deletionScheduledFor: z.string().datetime().nullable(),
|
|
5050
5090
|
createdAt: z.string().datetime(),
|
|
5051
5091
|
updatedAt: z.string().datetime()
|
|
@@ -5196,6 +5236,60 @@ var listPaymentMethodsResponse = z.lazy(() => z.object({
|
|
|
5196
5236
|
/** List of payment methods */
|
|
5197
5237
|
data: z.array(paymentMethod)
|
|
5198
5238
|
}));
|
|
5239
|
+
var digestRequest = z.object({
|
|
5240
|
+
/** The topic or subject to generate a digest for */
|
|
5241
|
+
query: z.string().min(1),
|
|
5242
|
+
/** Time window filter (e.g., "7d", "24h", "2w", "30m"). Only considers memories within this window. */
|
|
5243
|
+
recent: z.string().optional(),
|
|
5244
|
+
/** Filter to memories with these topics */
|
|
5245
|
+
topics: z.array(z.string()).optional(),
|
|
5246
|
+
/** Limit to specific conversation IDs */
|
|
5247
|
+
conversationIds: z.array(z.string()).optional(),
|
|
5248
|
+
/** Output format: "structured" (sections with headers), "narrative" (chronological prose), "timeline" (dated event list), "status-report" (done/in-progress/blocked) */
|
|
5249
|
+
format: z.enum(["structured", "narrative", "timeline", "status-report"]).optional(),
|
|
5250
|
+
/** Maximum number of memories to consider (1-500, default 100) */
|
|
5251
|
+
maxSources: z.number().min(1).max(500).optional(),
|
|
5252
|
+
/** Whether to include source memory IDs in the response */
|
|
5253
|
+
includeMemoryIds: z.boolean().optional()
|
|
5254
|
+
});
|
|
5255
|
+
var digestTimeRange = z.object({
|
|
5256
|
+
/** Earliest memory timestamp in the digest sources */
|
|
5257
|
+
earliest: z.string().datetime(),
|
|
5258
|
+
/** Latest memory timestamp in the digest sources */
|
|
5259
|
+
latest: z.string().datetime()
|
|
5260
|
+
}).nullable();
|
|
5261
|
+
var digestMetadata = z.lazy(() => z.object({
|
|
5262
|
+
/** The query used to generate the digest */
|
|
5263
|
+
query: z.string(),
|
|
5264
|
+
/** Total number of memories gathered (search + expansion) before synthesis */
|
|
5265
|
+
sourcesConsidered: z.number().min(0),
|
|
5266
|
+
/** Number of memories fed into the synthesis step */
|
|
5267
|
+
sourcesUsed: z.number().min(0),
|
|
5268
|
+
/** Number of distinct conversations the sources come from */
|
|
5269
|
+
conversationsSpanned: z.number().min(0),
|
|
5270
|
+
/** Time range of the source memories (null if no sources found) */
|
|
5271
|
+
timeRange: digestTimeRange,
|
|
5272
|
+
/** Output format used for this digest */
|
|
5273
|
+
format: z.enum(["structured", "narrative", "timeline", "status-report"]),
|
|
5274
|
+
/** ISO 8601 timestamp when the digest was generated */
|
|
5275
|
+
generatedAt: z.string().datetime()
|
|
5276
|
+
}));
|
|
5277
|
+
var digestSource = z.object({
|
|
5278
|
+
/** Source memory ID */
|
|
5279
|
+
memoryId: z.string(),
|
|
5280
|
+
/** Relevance score (0-1) for this source memory */
|
|
5281
|
+
relevance: z.number().min(0).max(1),
|
|
5282
|
+
/** Conversation ID this memory belongs to */
|
|
5283
|
+
conversation: z.string().optional()
|
|
5284
|
+
});
|
|
5285
|
+
var digestResponse = z.lazy(() => z.object({
|
|
5286
|
+
/** The generated digest content (markdown formatted) */
|
|
5287
|
+
digest: z.string(),
|
|
5288
|
+
/** Generation metadata including source statistics */
|
|
5289
|
+
metadata: digestMetadata,
|
|
5290
|
+
/** Source memories used to generate the digest, for traceability */
|
|
5291
|
+
sources: z.array(digestSource)
|
|
5292
|
+
}));
|
|
5199
5293
|
|
|
5200
5294
|
// src/index.ts
|
|
5201
5295
|
var Memnexus = class {
|
|
@@ -5378,6 +5472,11 @@ export {
|
|
|
5378
5472
|
createNarrativeRequest,
|
|
5379
5473
|
createPortalSessionRequest,
|
|
5380
5474
|
index_default as default,
|
|
5475
|
+
digestMetadata,
|
|
5476
|
+
digestRequest,
|
|
5477
|
+
digestResponse,
|
|
5478
|
+
digestSource,
|
|
5479
|
+
digestTimeRange,
|
|
5381
5480
|
entity,
|
|
5382
5481
|
entityNode,
|
|
5383
5482
|
error,
|