@memnexus-ai/typescript-sdk 1.53.29 → 1.55.0-next.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
@@ -20,7 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AdminAlertsService: () => AdminAlertsService,
24
+ AdminPipelineService: () => AdminPipelineService,
23
25
  AdminService: () => AdminService,
26
+ AlertsService: () => AlertsService,
24
27
  ApiKeysService: () => ApiKeysService,
25
28
  ArtifactsService: () => ArtifactsService,
26
29
  BehaviorService: () => BehaviorService,
@@ -38,6 +41,7 @@ __export(index_exports, {
38
41
  MonitoringService: () => MonitoringService,
39
42
  NarrativesService: () => NarrativesService,
40
43
  PatternsService: () => PatternsService,
44
+ RecommendationsService: () => RecommendationsService,
41
45
  SdkError: () => SdkError,
42
46
  SerializationStyle: () => SerializationStyle,
43
47
  SystemService: () => SystemService,
@@ -58,8 +62,20 @@ __export(index_exports, {
58
62
  buildContextPattern: () => buildContextPattern,
59
63
  buildContextRequest: () => buildContextRequest,
60
64
  buildContextResponse: () => buildContextResponse,
65
+ bulkDeleteRequest: () => bulkDeleteRequest,
66
+ bulkDeleteResponse: () => bulkDeleteResponse,
67
+ bulkTagRequest: () => bulkTagRequest,
68
+ bulkTagResponse: () => bulkTagResponse,
69
+ bulkUpdateRequest: () => bulkUpdateRequest,
70
+ bulkUpdateResponse: () => bulkUpdateResponse,
61
71
  checkoutSessionResponse: () => checkoutSessionResponse,
72
+ claimGroup: () => claimGroup,
73
+ claimGroupClaim: () => claimGroupClaim,
74
+ claimGroupSignals: () => claimGroupSignals,
75
+ codeContext: () => codeContext,
62
76
  community: () => community,
77
+ compileInstructionsRequest: () => compileInstructionsRequest,
78
+ compileInstructionsResponse: () => compileInstructionsResponse,
63
79
  conversation: () => conversation,
64
80
  createArtifactRequest: () => createArtifactRequest,
65
81
  createCheckoutSessionRequest: () => createCheckoutSessionRequest,
@@ -71,6 +87,8 @@ __export(index_exports, {
71
87
  createMemoryResponseMeta: () => createMemoryResponseMeta,
72
88
  createNarrativeRequest: () => createNarrativeRequest,
73
89
  createPortalSessionRequest: () => createPortalSessionRequest,
90
+ createRecommendationRequest: () => createRecommendationRequest,
91
+ createSystemAlertRequest: () => createSystemAlertRequest,
74
92
  default: () => index_default,
75
93
  digestEntity: () => digestEntity,
76
94
  digestKeyFact: () => digestKeyFact,
@@ -83,6 +101,9 @@ __export(index_exports, {
83
101
  entity: () => entity,
84
102
  entityNode: () => entityNode,
85
103
  error: () => error,
104
+ exportRequest: () => exportRequest,
105
+ facetEntry: () => facetEntry,
106
+ facets: () => facets,
86
107
  fact: () => fact,
87
108
  factSearchRequest: () => factSearchRequest,
88
109
  getMemoryResponse: () => getMemoryResponse,
@@ -94,6 +115,7 @@ __export(index_exports, {
94
115
  listInvoicesResponse: () => listInvoicesResponse,
95
116
  listNarrativesResponse: () => listNarrativesResponse,
96
117
  listPaymentMethodsResponse: () => listPaymentMethodsResponse,
118
+ matchRecommendationsRequest: () => matchRecommendationsRequest,
97
119
  memory: () => memory,
98
120
  memoryRelationship: () => memoryRelationship,
99
121
  memoryRelationshipsResponse: () => memoryRelationshipsResponse,
@@ -105,20 +127,24 @@ __export(index_exports, {
105
127
  pattern: () => pattern,
106
128
  paymentMethod: () => paymentMethod,
107
129
  portalSessionResponse: () => portalSessionResponse,
130
+ precomputedMemoryFields: () => precomputedMemoryFields,
131
+ recommendation: () => recommendation,
108
132
  relatedMemoryResult: () => relatedMemoryResult,
133
+ searchMeta: () => searchMeta,
109
134
  searchRequest: () => searchRequest,
110
135
  searchResponse: () => searchResponse,
111
136
  searchResult: () => searchResult,
112
137
  serviceCheck: () => serviceCheck,
113
138
  subscription: () => subscription,
139
+ systemAlert: () => systemAlert,
114
140
  temporalMetadata: () => temporalMetadata,
115
141
  topic: () => topic,
116
- topicReference: () => topicReference,
117
142
  updateArtifactRequest: () => updateArtifactRequest,
118
143
  updateFactRequest: () => updateFactRequest,
119
144
  updateMemoryRequest: () => updateMemoryRequest,
120
145
  updateNamedMemoryRequest: () => updateNamedMemoryRequest,
121
146
  updateNarrativeRequest: () => updateNarrativeRequest,
147
+ updateSystemAlertRequest: () => updateSystemAlertRequest,
122
148
  user: () => user,
123
149
  userUsage: () => userUsage
124
150
  });
@@ -163,6 +189,9 @@ var SdkError = class _SdkError extends Error {
163
189
  this.name = "SdkError";
164
190
  Object.setPrototypeOf(this, _SdkError.prototype);
165
191
  }
192
+ status;
193
+ statusText;
194
+ data;
166
195
  };
167
196
 
168
197
  // src/http/handlers.ts
@@ -1444,6 +1473,31 @@ var PatternsService = class extends BaseService {
1444
1473
  }
1445
1474
  return this.client.call(request);
1446
1475
  }
1476
+ /**
1477
+ * Compile behavioral instructions from stored patterns
1478
+ * Converts stored behavioral patterns into actionable instructions suitable for injection into AI agent context at conversation start. Uses template-based (non-LLM) generation for deterministic output within the P95 <100ms budget.
1479
+
1480
+ * @param body - Request body
1481
+ */
1482
+ async compileInstructions(options) {
1483
+ const request = new Request({
1484
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1485
+ method: "POST",
1486
+ path: "/api/patterns/compile-instructions",
1487
+ config: this.config,
1488
+ retry: {
1489
+ attempts: 3,
1490
+ delayMs: 150,
1491
+ maxDelayMs: 5e3,
1492
+ jitterMs: 50,
1493
+ backoffFactor: 2
1494
+ }
1495
+ });
1496
+ if (options?.body !== void 0) {
1497
+ request.addBody(options?.body);
1498
+ }
1499
+ return this.client.call(request);
1500
+ }
1447
1501
  };
1448
1502
 
1449
1503
  // src/services/behavior-service.ts
@@ -1494,6 +1548,262 @@ var BehaviorService = class extends BaseService {
1494
1548
  }
1495
1549
  };
1496
1550
 
1551
+ // src/services/recommendations-service.ts
1552
+ var RecommendationsService = class extends BaseService {
1553
+ /**
1554
+ * Create an explicit recommendation
1555
+ * Create a new explicit recommendation (triggerContext + practice pair). Source is set to 'explicit'; triggerEmbedding is generated synchronously before return. SEC-BL-v2-002: practice content is validated against a prompt-injection deny-list. SEC-BL-v2-003: evidenceMemoryIds ownership is verified against the authenticated user.
1556
+
1557
+ * @param body - Request body
1558
+ */
1559
+ async createRecommendation(body) {
1560
+ const request = new Request({
1561
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1562
+ method: "POST",
1563
+ path: "/api/patterns/recommendations",
1564
+ config: this.config,
1565
+ retry: {
1566
+ attempts: 3,
1567
+ delayMs: 150,
1568
+ maxDelayMs: 5e3,
1569
+ jitterMs: 50,
1570
+ backoffFactor: 2
1571
+ }
1572
+ });
1573
+ if (body !== void 0) {
1574
+ request.addBody(body);
1575
+ }
1576
+ return this.client.call(request);
1577
+ }
1578
+ /**
1579
+ * List pending recommendations
1580
+ * Returns recommendations with status='pending_review' for the authenticated user, ordered by confidence DESC, createdAt ASC.
1581
+
1582
+ * @param limit - Maximum number of results
1583
+ * @param offset - Number of results to skip
1584
+ */
1585
+ async listPendingRecommendations(options) {
1586
+ const request = new Request({
1587
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1588
+ method: "GET",
1589
+ path: "/api/patterns/recommendations/pending",
1590
+ config: this.config,
1591
+ retry: {
1592
+ attempts: 3,
1593
+ delayMs: 150,
1594
+ maxDelayMs: 5e3,
1595
+ jitterMs: 50,
1596
+ backoffFactor: 2
1597
+ }
1598
+ });
1599
+ if (options?.limit !== void 0) {
1600
+ request.addQueryParam("limit", {
1601
+ key: "limit",
1602
+ value: options.limit,
1603
+ explode: false,
1604
+ encode: true,
1605
+ style: "form",
1606
+ isLimit: true,
1607
+ isOffset: false,
1608
+ isCursor: false
1609
+ });
1610
+ }
1611
+ if (options?.offset !== void 0) {
1612
+ request.addQueryParam("offset", {
1613
+ key: "offset",
1614
+ value: options.offset,
1615
+ explode: false,
1616
+ encode: true,
1617
+ style: "form",
1618
+ isLimit: false,
1619
+ isOffset: true,
1620
+ isCursor: false
1621
+ });
1622
+ }
1623
+ return this.client.call(request);
1624
+ }
1625
+ /**
1626
+ * Approve a pending recommendation
1627
+ * Transitions a recommendation from status='pending_review' to status='active'. Returns 404 if the recommendation is not found, not owned by the authenticated user, or is not in pending_review status.
1628
+
1629
+ * @param id - Recommendation ID
1630
+ * @param body - Request body
1631
+ */
1632
+ async approveRecommendation(id, options) {
1633
+ const request = new Request({
1634
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1635
+ method: "PATCH",
1636
+ path: "/api/patterns/recommendations/{id}/approve",
1637
+ config: this.config,
1638
+ retry: {
1639
+ attempts: 3,
1640
+ delayMs: 150,
1641
+ maxDelayMs: 5e3,
1642
+ jitterMs: 50,
1643
+ backoffFactor: 2
1644
+ }
1645
+ });
1646
+ request.addPathParam("id", {
1647
+ key: "id",
1648
+ value: id,
1649
+ explode: false,
1650
+ encode: true,
1651
+ style: "simple",
1652
+ isLimit: false,
1653
+ isOffset: false,
1654
+ isCursor: false
1655
+ });
1656
+ if (options?.body !== void 0) {
1657
+ request.addBody(options?.body);
1658
+ }
1659
+ return this.client.call(request);
1660
+ }
1661
+ /**
1662
+ * Dismiss a recommendation
1663
+ * Permanently dismisses a recommendation (any non-dismissed status → dismissed). This transition is terminal — dismissed recommendations cannot be reactivated. Returns 404 if not found, not owned by the authenticated user, or already dismissed.
1664
+
1665
+ * @param id - Recommendation ID
1666
+ * @param body - Request body
1667
+ */
1668
+ async dismissRecommendation(id, options) {
1669
+ const request = new Request({
1670
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1671
+ method: "PATCH",
1672
+ path: "/api/patterns/recommendations/{id}/dismiss",
1673
+ config: this.config,
1674
+ retry: {
1675
+ attempts: 3,
1676
+ delayMs: 150,
1677
+ maxDelayMs: 5e3,
1678
+ jitterMs: 50,
1679
+ backoffFactor: 2
1680
+ }
1681
+ });
1682
+ request.addPathParam("id", {
1683
+ key: "id",
1684
+ value: id,
1685
+ explode: false,
1686
+ encode: true,
1687
+ style: "simple",
1688
+ isLimit: false,
1689
+ isOffset: false,
1690
+ isCursor: false
1691
+ });
1692
+ if (options?.body !== void 0) {
1693
+ request.addBody(options?.body);
1694
+ }
1695
+ return this.client.call(request);
1696
+ }
1697
+ /**
1698
+ * List active recommendations
1699
+ * Returns recommendations with status='active' for the authenticated user, ordered by confidence DESC. These are the behavioral preferences currently surfacing in Claude via compile-instructions and build_context. SEC-BL-v2-003: results are scoped to the authenticated user — no cross-user data.
1700
+
1701
+ * @param limit - Maximum number of results
1702
+ * @param offset - Number of results to skip
1703
+ */
1704
+ async listActiveRecommendations(options) {
1705
+ const request = new Request({
1706
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1707
+ method: "GET",
1708
+ path: "/api/patterns/recommendations/active",
1709
+ config: this.config,
1710
+ retry: {
1711
+ attempts: 3,
1712
+ delayMs: 150,
1713
+ maxDelayMs: 5e3,
1714
+ jitterMs: 50,
1715
+ backoffFactor: 2
1716
+ }
1717
+ });
1718
+ if (options?.limit !== void 0) {
1719
+ request.addQueryParam("limit", {
1720
+ key: "limit",
1721
+ value: options.limit,
1722
+ explode: false,
1723
+ encode: true,
1724
+ style: "form",
1725
+ isLimit: true,
1726
+ isOffset: false,
1727
+ isCursor: false
1728
+ });
1729
+ }
1730
+ if (options?.offset !== void 0) {
1731
+ request.addQueryParam("offset", {
1732
+ key: "offset",
1733
+ value: options.offset,
1734
+ explode: false,
1735
+ encode: true,
1736
+ style: "form",
1737
+ isLimit: false,
1738
+ isOffset: true,
1739
+ isCursor: false
1740
+ });
1741
+ }
1742
+ return this.client.call(request);
1743
+ }
1744
+ /**
1745
+ * Match active recommendations to content
1746
+ * Embeds the supplied content and returns active Recommendations whose triggerContext is semantically similar. Used by the MCP server for just-in-time behavioral nudges on memory save. Results are scoped to the authenticated user — no cross-user data is returned.
1747
+
1748
+ * @param body - Request body
1749
+ */
1750
+ async matchRecommendations(body) {
1751
+ const request = new Request({
1752
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1753
+ method: "POST",
1754
+ path: "/api/patterns/recommendations/match",
1755
+ config: this.config,
1756
+ retry: {
1757
+ attempts: 3,
1758
+ delayMs: 150,
1759
+ maxDelayMs: 5e3,
1760
+ jitterMs: 50,
1761
+ backoffFactor: 2
1762
+ }
1763
+ });
1764
+ if (body !== void 0) {
1765
+ request.addBody(body);
1766
+ }
1767
+ return this.client.call(request);
1768
+ }
1769
+ /**
1770
+ * Pause an active recommendation
1771
+ * Transitions a recommendation from status='active' to status='paused'. Paused recommendations are excluded from compile-instructions and build_context surfacing. Returns 404 if the recommendation is not found, not owned by the authenticated user, or is not in active status. SEC-BL-v2-003: MATCH includes userId — no IDOR.
1772
+
1773
+ * @param id - Recommendation ID
1774
+ * @param body - Request body
1775
+ */
1776
+ async pauseRecommendation(id, options) {
1777
+ const request = new Request({
1778
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
1779
+ method: "PATCH",
1780
+ path: "/api/patterns/recommendations/{id}/pause",
1781
+ config: this.config,
1782
+ retry: {
1783
+ attempts: 3,
1784
+ delayMs: 150,
1785
+ maxDelayMs: 5e3,
1786
+ jitterMs: 50,
1787
+ backoffFactor: 2
1788
+ }
1789
+ });
1790
+ request.addPathParam("id", {
1791
+ key: "id",
1792
+ value: id,
1793
+ explode: false,
1794
+ encode: true,
1795
+ style: "simple",
1796
+ isLimit: false,
1797
+ isOffset: false,
1798
+ isCursor: false
1799
+ });
1800
+ if (options?.body !== void 0) {
1801
+ request.addBody(options?.body);
1802
+ }
1803
+ return this.client.call(request);
1804
+ }
1805
+ };
1806
+
1497
1807
  // src/services/narratives-service.ts
1498
1808
  var NarrativesService = class extends BaseService {
1499
1809
  /**
@@ -1984,6 +2294,106 @@ var MemoriesService = class extends BaseService {
1984
2294
  });
1985
2295
  return this.client.call(request);
1986
2296
  }
2297
+ /**
2298
+ * Aggregated memory analytics
2299
+ * Return aggregated memory counts grouped by a time dimension (day, week, month)
2300
+ or by topic. Useful for activity dashboards and trend analysis.
2301
+
2302
+ * @param groupBy - Dimension to group counts by: day (YYYY-MM-DD), week (YYYY-Www), month (YYYY-MM), or topic
2303
+ * @param after - Filter memories on or after this ISO 8601 timestamp
2304
+ * @param before - Filter memories on or before this ISO 8601 timestamp
2305
+ * @param recent - Shorthand time window relative to now (e.g. 7d, 2w, 1mo). Sets the lower bound. Takes precedence over `after`.
2306
+ * @param topic - Pre-filter to memories that contain this topic before grouping
2307
+ * @param limit - Maximum number of buckets to return
2308
+ */
2309
+ async getMemoriesStats(options) {
2310
+ const request = new Request({
2311
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
2312
+ method: "GET",
2313
+ path: "/api/memories/stats",
2314
+ config: this.config,
2315
+ retry: {
2316
+ attempts: 3,
2317
+ delayMs: 150,
2318
+ maxDelayMs: 5e3,
2319
+ jitterMs: 50,
2320
+ backoffFactor: 2
2321
+ }
2322
+ });
2323
+ if (options?.groupBy !== void 0) {
2324
+ request.addQueryParam("groupBy", {
2325
+ key: "groupBy",
2326
+ value: options.groupBy,
2327
+ explode: false,
2328
+ encode: true,
2329
+ style: "form",
2330
+ isLimit: false,
2331
+ isOffset: false,
2332
+ isCursor: false
2333
+ });
2334
+ }
2335
+ if (options?.after !== void 0) {
2336
+ request.addQueryParam("after", {
2337
+ key: "after",
2338
+ value: options.after,
2339
+ explode: false,
2340
+ encode: true,
2341
+ style: "form",
2342
+ isLimit: false,
2343
+ isOffset: false,
2344
+ isCursor: false
2345
+ });
2346
+ }
2347
+ if (options?.before !== void 0) {
2348
+ request.addQueryParam("before", {
2349
+ key: "before",
2350
+ value: options.before,
2351
+ explode: false,
2352
+ encode: true,
2353
+ style: "form",
2354
+ isLimit: false,
2355
+ isOffset: false,
2356
+ isCursor: false
2357
+ });
2358
+ }
2359
+ if (options?.recent !== void 0) {
2360
+ request.addQueryParam("recent", {
2361
+ key: "recent",
2362
+ value: options.recent,
2363
+ explode: false,
2364
+ encode: true,
2365
+ style: "form",
2366
+ isLimit: false,
2367
+ isOffset: false,
2368
+ isCursor: false
2369
+ });
2370
+ }
2371
+ if (options?.topic !== void 0) {
2372
+ request.addQueryParam("topic", {
2373
+ key: "topic",
2374
+ value: options.topic,
2375
+ explode: false,
2376
+ encode: true,
2377
+ style: "form",
2378
+ isLimit: false,
2379
+ isOffset: false,
2380
+ isCursor: false
2381
+ });
2382
+ }
2383
+ if (options?.limit !== void 0) {
2384
+ request.addQueryParam("limit", {
2385
+ key: "limit",
2386
+ value: options.limit,
2387
+ explode: false,
2388
+ encode: true,
2389
+ style: "form",
2390
+ isLimit: true,
2391
+ isOffset: false,
2392
+ isCursor: false
2393
+ });
2394
+ }
2395
+ return this.client.call(request);
2396
+ }
1987
2397
  /**
1988
2398
  * List memories
1989
2399
  * List all memories for the authenticated user with pagination.
@@ -2001,6 +2411,13 @@ var MemoriesService = class extends BaseService {
2001
2411
  * @param page - Page number (alternative to offset)
2002
2412
  * @param sortBy - Field to sort results by
2003
2413
  * @param order - Sort order
2414
+ * @param from - Filter memories created on or after this ISO 8601 timestamp (ingestion time lower bound)
2415
+ * @param to - Filter memories created on or before this ISO 8601 timestamp (ingestion time upper bound)
2416
+ * @param recent - Shorthand time filter relative to now (e.g. "24h", "7d", "2w"). Sets the lower bound for ingestion time. Takes precedence over `from` when both are provided.
2417
+ * @param topics - Comma-separated topic names. Memories must have at least one matching topic.
2418
+ * @param excludeTopics - Comma-separated topic names. Memories with any matching topic are excluded.
2419
+ * @param conversationId - Filter to memories belonging to the given conversation.
2420
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
2004
2421
  */
2005
2422
  async listMemories(options) {
2006
2423
  const request = new Request({
@@ -2048,14 +2465,98 @@ var MemoriesService = class extends BaseService {
2048
2465
  encode: true,
2049
2466
  style: "form",
2050
2467
  isLimit: false,
2051
- isOffset: true,
2468
+ isOffset: true,
2469
+ isCursor: false
2470
+ });
2471
+ }
2472
+ if (options?.page !== void 0) {
2473
+ request.addQueryParam("page", {
2474
+ key: "page",
2475
+ value: options.page,
2476
+ explode: false,
2477
+ encode: true,
2478
+ style: "form",
2479
+ isLimit: false,
2480
+ isOffset: false,
2481
+ isCursor: false
2482
+ });
2483
+ }
2484
+ if (options?.sortBy !== void 0) {
2485
+ request.addQueryParam("sortBy", {
2486
+ key: "sortBy",
2487
+ value: options.sortBy,
2488
+ explode: false,
2489
+ encode: true,
2490
+ style: "form",
2491
+ isLimit: false,
2492
+ isOffset: false,
2493
+ isCursor: false
2494
+ });
2495
+ }
2496
+ if (options?.order !== void 0) {
2497
+ request.addQueryParam("order", {
2498
+ key: "order",
2499
+ value: options.order,
2500
+ explode: false,
2501
+ encode: true,
2502
+ style: "form",
2503
+ isLimit: false,
2504
+ isOffset: false,
2505
+ isCursor: false
2506
+ });
2507
+ }
2508
+ if (options?.from !== void 0) {
2509
+ request.addQueryParam("from", {
2510
+ key: "from",
2511
+ value: options.from,
2512
+ explode: false,
2513
+ encode: true,
2514
+ style: "form",
2515
+ isLimit: false,
2516
+ isOffset: false,
2517
+ isCursor: false
2518
+ });
2519
+ }
2520
+ if (options?.to !== void 0) {
2521
+ request.addQueryParam("to", {
2522
+ key: "to",
2523
+ value: options.to,
2524
+ explode: false,
2525
+ encode: true,
2526
+ style: "form",
2527
+ isLimit: false,
2528
+ isOffset: false,
2529
+ isCursor: false
2530
+ });
2531
+ }
2532
+ if (options?.recent !== void 0) {
2533
+ request.addQueryParam("recent", {
2534
+ key: "recent",
2535
+ value: options.recent,
2536
+ explode: false,
2537
+ encode: true,
2538
+ style: "form",
2539
+ isLimit: false,
2540
+ isOffset: false,
2541
+ isCursor: false
2542
+ });
2543
+ }
2544
+ if (options?.topics !== void 0) {
2545
+ request.addQueryParam("topics", {
2546
+ key: "topics",
2547
+ value: options.topics,
2548
+ explode: false,
2549
+ encode: true,
2550
+ style: "form",
2551
+ isLimit: false,
2552
+ isOffset: false,
2052
2553
  isCursor: false
2053
2554
  });
2054
2555
  }
2055
- if (options?.page !== void 0) {
2056
- request.addQueryParam("page", {
2057
- key: "page",
2058
- value: options.page,
2556
+ if (options?.excludeTopics !== void 0) {
2557
+ request.addQueryParam("excludeTopics", {
2558
+ key: "excludeTopics",
2559
+ value: options.excludeTopics,
2059
2560
  explode: false,
2060
2561
  encode: true,
2061
2562
  style: "form",
@@ -2064,10 +2565,10 @@ var MemoriesService = class extends BaseService {
2064
2565
  isCursor: false
2065
2566
  });
2066
2567
  }
2067
- if (options?.sortBy !== void 0) {
2068
- request.addQueryParam("sortBy", {
2069
- key: "sortBy",
2070
- value: options.sortBy,
2568
+ if (options?.conversationId !== void 0) {
2569
+ request.addQueryParam("conversationId", {
2570
+ key: "conversationId",
2571
+ value: options.conversationId,
2071
2572
  explode: false,
2072
2573
  encode: true,
2073
2574
  style: "form",
@@ -2076,10 +2577,10 @@ var MemoriesService = class extends BaseService {
2076
2577
  isCursor: false
2077
2578
  });
2078
2579
  }
2079
- if (options?.order !== void 0) {
2080
- request.addQueryParam("order", {
2081
- key: "order",
2082
- value: options.order,
2580
+ if (options?.scope !== void 0) {
2581
+ request.addQueryParam("scope", {
2582
+ key: "scope",
2583
+ value: options.scope,
2083
2584
  explode: false,
2084
2585
  encode: true,
2085
2586
  style: "form",
@@ -2146,7 +2647,7 @@ var MemoriesService = class extends BaseService {
2146
2647
  **Array Parameters:**
2147
2648
  - `topics`: Provide as comma-separated values (e.g., `topics=typescript,api-design`)
2148
2649
 
2149
- * @param q - Search query string
2650
+ * @param q - Search query string. Optional — omit for topic/date-only browsing.
2150
2651
  * @param searchMethod - Search algorithm to use
2151
2652
  * @param limit - Maximum number of results to return
2152
2653
  * @param offset - Number of results to skip for pagination
@@ -2162,6 +2663,7 @@ var MemoriesService = class extends BaseService {
2162
2663
  * @param includeTopics - Include associated topics in results
2163
2664
  * @param includeEntities - Include mentioned entities in results
2164
2665
  * @param includeFacts - Include extracted facts in results
2666
+ * @param includeClaims - Include claims associated with results (defaults to true)
2165
2667
  * @param asOfTime - Point-in-time query (ISO 8601 datetime)
2166
2668
  * @param validAtTime - Filter by validity time (ISO 8601 datetime)
2167
2669
  * @param eventTimeFrom - Event time range start (ISO 8601 datetime)
@@ -2179,6 +2681,13 @@ var MemoriesService = class extends BaseService {
2179
2681
  * @param entityWeight - Weight for entity graph branch in hybrid search
2180
2682
  * @param topicWeight - Weight for topic graph branch in hybrid search
2181
2683
  * @param factWeight - Weight for fact graph branch in hybrid search
2684
+ * @param questionWeight - Weight for question graph branch in hybrid search
2685
+ * @param claimsWeight - Weight for claims vector branch in hybrid search
2686
+ * @param includeFacets - Include facet aggregation (topics, memoryType, effectiveState) in response
2687
+ * @param embeddingProvider - Which embedding provider to use for query-time embedding generation and vector index lookup. `voyage` is the canonical name for the secondary provider (Voyage voyage-3.5, 1024d); `openai` is accepted as a legacy alias and now also resolves to Voyage after v1.66 P0-EMBED-SWAP. Falls back to ollama when the secondary provider is unavailable.
2688
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
2689
+ * @param taskId - Task-scoped retrieval: returns own-history first, fills remainder with cross-task results.
2690
+ * @param outcomeFilter - Filter by task outcome. Use 'resolved' to find successful approaches from past tasks.
2182
2691
  */
2183
2692
  async searchMemoriesGet(options) {
2184
2693
  const request = new Request({
@@ -2386,6 +2895,18 @@ var MemoriesService = class extends BaseService {
2386
2895
  isCursor: false
2387
2896
  });
2388
2897
  }
2898
+ if (options?.includeClaims !== void 0) {
2899
+ request.addQueryParam("includeClaims", {
2900
+ key: "includeClaims",
2901
+ value: options.includeClaims,
2902
+ explode: false,
2903
+ encode: true,
2904
+ style: "form",
2905
+ isLimit: false,
2906
+ isOffset: false,
2907
+ isCursor: false
2908
+ });
2909
+ }
2389
2910
  if (options?.asOfTime !== void 0) {
2390
2911
  request.addQueryParam("asOfTime", {
2391
2912
  key: "asOfTime",
@@ -2590,6 +3111,90 @@ var MemoriesService = class extends BaseService {
2590
3111
  isCursor: false
2591
3112
  });
2592
3113
  }
3114
+ if (options?.questionWeight !== void 0) {
3115
+ request.addQueryParam("questionWeight", {
3116
+ key: "questionWeight",
3117
+ value: options.questionWeight,
3118
+ explode: false,
3119
+ encode: true,
3120
+ style: "form",
3121
+ isLimit: false,
3122
+ isOffset: false,
3123
+ isCursor: false
3124
+ });
3125
+ }
3126
+ if (options?.claimsWeight !== void 0) {
3127
+ request.addQueryParam("claimsWeight", {
3128
+ key: "claimsWeight",
3129
+ value: options.claimsWeight,
3130
+ explode: false,
3131
+ encode: true,
3132
+ style: "form",
3133
+ isLimit: false,
3134
+ isOffset: false,
3135
+ isCursor: false
3136
+ });
3137
+ }
3138
+ if (options?.includeFacets !== void 0) {
3139
+ request.addQueryParam("includeFacets", {
3140
+ key: "includeFacets",
3141
+ value: options.includeFacets,
3142
+ explode: false,
3143
+ encode: true,
3144
+ style: "form",
3145
+ isLimit: false,
3146
+ isOffset: false,
3147
+ isCursor: false
3148
+ });
3149
+ }
3150
+ if (options?.embeddingProvider !== void 0) {
3151
+ request.addQueryParam("embeddingProvider", {
3152
+ key: "embeddingProvider",
3153
+ value: options.embeddingProvider,
3154
+ explode: false,
3155
+ encode: true,
3156
+ style: "form",
3157
+ isLimit: false,
3158
+ isOffset: false,
3159
+ isCursor: false
3160
+ });
3161
+ }
3162
+ if (options?.scope !== void 0) {
3163
+ request.addQueryParam("scope", {
3164
+ key: "scope",
3165
+ value: options.scope,
3166
+ explode: false,
3167
+ encode: true,
3168
+ style: "form",
3169
+ isLimit: false,
3170
+ isOffset: false,
3171
+ isCursor: false
3172
+ });
3173
+ }
3174
+ if (options?.taskId !== void 0) {
3175
+ request.addQueryParam("taskId", {
3176
+ key: "taskId",
3177
+ value: options.taskId,
3178
+ explode: false,
3179
+ encode: true,
3180
+ style: "form",
3181
+ isLimit: false,
3182
+ isOffset: false,
3183
+ isCursor: false
3184
+ });
3185
+ }
3186
+ if (options?.outcomeFilter !== void 0) {
3187
+ request.addQueryParam("outcomeFilter", {
3188
+ key: "outcomeFilter",
3189
+ value: options.outcomeFilter,
3190
+ explode: false,
3191
+ encode: true,
3192
+ style: "form",
3193
+ isLimit: false,
3194
+ isOffset: false,
3195
+ isCursor: false
3196
+ });
3197
+ }
2593
3198
  return this.client.call(request);
2594
3199
  }
2595
3200
  /**
@@ -2692,6 +3297,41 @@ var MemoriesService = class extends BaseService {
2692
3297
  }
2693
3298
  return this.client.call(request);
2694
3299
  }
3300
+ /**
3301
+ * Generate memory digest (SSE streaming)
3302
+ * Same as POST /api/memories/digest but uses Server-Sent Events (SSE) to stream
3303
+ the response. Sends `: heartbeat` comments every 10 seconds during processing
3304
+ to prevent gateway read-timeout (default 60s) from killing long-running digests.
3305
+
3306
+ **Event sequence:**
3307
+ - `: heartbeat` — keep-alive comment, sent every 10s during processing
3308
+ - `event: result` / `data: <DigestResponse JSON>` — digest completed successfully
3309
+ - `event: error` / `data: {"error":"...","statusCode":N}` — digest failed
3310
+ - `event: done` / `data: {}` — stream complete (sent after result)
3311
+
3312
+ **Formats and pipeline:** identical to POST /api/memories/digest.
3313
+
3314
+ * @param body - Request body
3315
+ */
3316
+ async streamMemoryDigest(body) {
3317
+ const request = new Request({
3318
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
3319
+ method: "POST",
3320
+ path: "/api/memories/digest/stream",
3321
+ config: this.config,
3322
+ retry: {
3323
+ attempts: 3,
3324
+ delayMs: 150,
3325
+ maxDelayMs: 5e3,
3326
+ jitterMs: 50,
3327
+ backoffFactor: 2
3328
+ }
3329
+ });
3330
+ if (body !== void 0) {
3331
+ request.addBody(body);
3332
+ }
3333
+ return this.client.call(request);
3334
+ }
2695
3335
  /**
2696
3336
  * Build a context briefing
2697
3337
  * Answers "What should I know before working on X?" by combining active work
@@ -2726,8 +3366,11 @@ var MemoriesService = class extends BaseService {
2726
3366
  Walks the SUPERSEDES chain from HEAD backwards.
2727
3367
 
2728
3368
  * @param name - Memory name (kebab-case, 2-64 chars)
3369
+ * @param limit - Optional cap on the number of most-recent versions to return.
3370
+ When omitted, the full version chain is returned.
3371
+
2729
3372
  */
2730
- async getNamedMemoryHistory(name) {
3373
+ async getNamedMemoryHistory(name, options) {
2731
3374
  const request = new Request({
2732
3375
  baseUrl: this.config.baseUrl || "http://localhost:3000",
2733
3376
  method: "GET",
@@ -2751,6 +3394,18 @@ var MemoriesService = class extends BaseService {
2751
3394
  isOffset: false,
2752
3395
  isCursor: false
2753
3396
  });
3397
+ if (options?.limit !== void 0) {
3398
+ request.addQueryParam("limit", {
3399
+ key: "limit",
3400
+ value: options.limit,
3401
+ explode: false,
3402
+ encode: true,
3403
+ style: "form",
3404
+ isLimit: true,
3405
+ isOffset: false,
3406
+ isCursor: false
3407
+ });
3408
+ }
2754
3409
  return this.client.call(request);
2755
3410
  }
2756
3411
  /**
@@ -2837,6 +3492,56 @@ var MemoriesService = class extends BaseService {
2837
3492
  }
2838
3493
  return this.client.call(request);
2839
3494
  }
3495
+ /**
3496
+ * Bulk delete multiple memories
3497
+ * Soft-delete multiple memories at once. Requires confirmDeletion=true.
3498
+ Each memory is verified to belong to the authenticated user.
3499
+ Maximum 100 IDs per request.
3500
+
3501
+ * @param body - Request body
3502
+ */
3503
+ async bulkDeleteMemories(body) {
3504
+ const request = new Request({
3505
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
3506
+ method: "DELETE",
3507
+ path: "/api/memories/bulk",
3508
+ config: this.config,
3509
+ retry: {
3510
+ attempts: 3,
3511
+ delayMs: 150,
3512
+ maxDelayMs: 5e3,
3513
+ jitterMs: 50,
3514
+ backoffFactor: 2
3515
+ }
3516
+ });
3517
+ if (body !== void 0) {
3518
+ request.addBody(body);
3519
+ }
3520
+ return this.client.call(request);
3521
+ }
3522
+ /**
3523
+ * Repair orphaned effectiveState values
3524
+ * Finds memories with effectiveState='superseded' or 'contradicted' but no
3525
+ corresponding incoming SUPERSEDES/CONTRADICTS edges, and resets them to 'current'.
3526
+ This handles cases where edges were deleted but effectiveState wasn't recalculated.
3527
+
3528
+ */
3529
+ async repairEffectiveState() {
3530
+ const request = new Request({
3531
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
3532
+ method: "POST",
3533
+ path: "/api/memories/repair-effective-state",
3534
+ config: this.config,
3535
+ retry: {
3536
+ attempts: 3,
3537
+ delayMs: 150,
3538
+ maxDelayMs: 5e3,
3539
+ jitterMs: 50,
3540
+ backoffFactor: 2
3541
+ }
3542
+ });
3543
+ return this.client.call(request);
3544
+ }
2840
3545
  /**
2841
3546
  * Record behavioral feedback on a search result
2842
3547
  * Record whether a search result was selected or ignored by the user.
@@ -3245,8 +3950,128 @@ var MemoriesService = class extends BaseService {
3245
3950
  isOffset: false,
3246
3951
  isCursor: false
3247
3952
  });
3248
- if (options?.body !== void 0) {
3249
- request.addBody(options?.body);
3953
+ if (options?.body !== void 0) {
3954
+ request.addBody(options?.body);
3955
+ }
3956
+ return this.client.call(request);
3957
+ }
3958
+ /**
3959
+ * Generate LLM explanation for a memory relationship
3960
+ * Uses an LLM to explain why two memories have been flagged with a
3961
+ particular relationship (e.g. contradiction). Returns a short
3962
+ plain-text explanation highlighting the specific differences.
3963
+
3964
+ * @param id - The ID of the source memory
3965
+ * @param body - Request body
3966
+ */
3967
+ async explainMemoryRelationship(id, body) {
3968
+ const request = new Request({
3969
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
3970
+ method: "POST",
3971
+ path: "/api/memories/{id}/explain-relationship",
3972
+ config: this.config,
3973
+ retry: {
3974
+ attempts: 3,
3975
+ delayMs: 150,
3976
+ maxDelayMs: 5e3,
3977
+ jitterMs: 50,
3978
+ backoffFactor: 2
3979
+ }
3980
+ });
3981
+ request.addPathParam("id", {
3982
+ key: "id",
3983
+ value: id,
3984
+ explode: false,
3985
+ encode: true,
3986
+ style: "simple",
3987
+ isLimit: false,
3988
+ isOffset: false,
3989
+ isCursor: false
3990
+ });
3991
+ if (body !== void 0) {
3992
+ request.addBody(body);
3993
+ }
3994
+ return this.client.call(request);
3995
+ }
3996
+ /**
3997
+ * Export memories matching filters
3998
+ * Export memories matching an optional search query and filters to JSON or CSV format.
3999
+ When a query is provided, uses hybrid search. When no query is provided, lists memories
4000
+ with optional topic and memoryType filters. Maximum 1000 results per export.
4001
+
4002
+ * @param body - Request body
4003
+ */
4004
+ async exportMemories(body) {
4005
+ const request = new Request({
4006
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
4007
+ method: "POST",
4008
+ path: "/api/memories/export",
4009
+ config: this.config,
4010
+ retry: {
4011
+ attempts: 3,
4012
+ delayMs: 150,
4013
+ maxDelayMs: 5e3,
4014
+ jitterMs: 50,
4015
+ backoffFactor: 2
4016
+ }
4017
+ });
4018
+ if (body !== void 0) {
4019
+ request.addBody(body);
4020
+ }
4021
+ return this.client.call(request);
4022
+ }
4023
+ /**
4024
+ * Bulk update multiple memories
4025
+ * Update multiple memories at once. Supports updating topics and memoryType.
4026
+ Each memory is verified to belong to the authenticated user.
4027
+ Maximum 100 IDs per request.
4028
+
4029
+ * @param body - Request body
4030
+ */
4031
+ async bulkUpdateMemories(body) {
4032
+ const request = new Request({
4033
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
4034
+ method: "POST",
4035
+ path: "/api/memories/bulk-update",
4036
+ config: this.config,
4037
+ retry: {
4038
+ attempts: 3,
4039
+ delayMs: 150,
4040
+ maxDelayMs: 5e3,
4041
+ jitterMs: 50,
4042
+ backoffFactor: 2
4043
+ }
4044
+ });
4045
+ if (body !== void 0) {
4046
+ request.addBody(body);
4047
+ }
4048
+ return this.client.call(request);
4049
+ }
4050
+ /**
4051
+ * Bulk add or remove topics from memories
4052
+ * Add and/or remove topics from multiple memories at once.
4053
+ At least one of addTopics or removeTopics must be provided.
4054
+ Each memory is verified to belong to the authenticated user.
4055
+ Maximum 100 IDs per request.
4056
+
4057
+ * @param body - Request body
4058
+ */
4059
+ async bulkTagMemories(body) {
4060
+ const request = new Request({
4061
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
4062
+ method: "POST",
4063
+ path: "/api/memories/bulk-tag",
4064
+ config: this.config,
4065
+ retry: {
4066
+ attempts: 3,
4067
+ delayMs: 150,
4068
+ maxDelayMs: 5e3,
4069
+ jitterMs: 50,
4070
+ backoffFactor: 2
4071
+ }
4072
+ });
4073
+ if (body !== void 0) {
4074
+ request.addBody(body);
3250
4075
  }
3251
4076
  return this.client.call(request);
3252
4077
  }
@@ -3308,6 +4133,30 @@ var InvitesService = class extends BaseService {
3308
4133
 
3309
4134
  // src/services/health-service.ts
3310
4135
  var HealthService = class extends BaseService {
4136
+ /**
4137
+ * Liveness probe endpoint
4138
+ * Returns 200 if the process is alive. Does not check external dependencies.
4139
+ Used by Kubernetes liveness probes to determine if the container should be restarted.
4140
+ Unlike /health, this endpoint does not query the database — a database outage
4141
+ should not cause the API process to be killed and restarted.
4142
+
4143
+ */
4144
+ async livenessCheck() {
4145
+ const request = new Request({
4146
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
4147
+ method: "GET",
4148
+ path: "/livez",
4149
+ config: this.config,
4150
+ retry: {
4151
+ attempts: 3,
4152
+ delayMs: 150,
4153
+ maxDelayMs: 5e3,
4154
+ jitterMs: 50,
4155
+ backoffFactor: 2
4156
+ }
4157
+ });
4158
+ return this.client.call(request);
4159
+ }
3311
4160
  /**
3312
4161
  * API health check endpoint
3313
4162
  * Returns the health status and uptime of the API service.
@@ -3426,6 +4275,7 @@ var FactsService = class extends BaseService {
3426
4275
  * List all facts for the authenticated user
3427
4276
  * @param limit - Maximum number of facts to return
3428
4277
  * @param offset - Number of facts to skip
4278
+ * @param memoryId - Filter facts to a specific memory
3429
4279
  * @param sortBy - Field to sort facts by
3430
4280
  * @param order - Sort order
3431
4281
  */
@@ -3467,6 +4317,18 @@ var FactsService = class extends BaseService {
3467
4317
  isCursor: false
3468
4318
  });
3469
4319
  }
4320
+ if (options?.memoryId !== void 0) {
4321
+ request.addQueryParam("memoryId", {
4322
+ key: "memoryId",
4323
+ value: options.memoryId,
4324
+ explode: false,
4325
+ encode: true,
4326
+ style: "form",
4327
+ isLimit: false,
4328
+ isOffset: false,
4329
+ isCursor: false
4330
+ });
4331
+ }
3470
4332
  if (options?.sortBy !== void 0) {
3471
4333
  request.addQueryParam("sortBy", {
3472
4334
  key: "sortBy",
@@ -3645,6 +4507,7 @@ var EntitiesService = class extends BaseService {
3645
4507
  /**
3646
4508
  * List entities
3647
4509
  * List all entities for the authenticated user, optionally filtered by type
4510
+ * @param query - Search entities by name (case-insensitive substring match)
3648
4511
  * @param type - Filter by entity type (e.g., PERSON, TECHNOLOGY)
3649
4512
  * @param limit - Maximum number of entities to return
3650
4513
  * @param offset - Number of entities to skip
@@ -3663,6 +4526,18 @@ var EntitiesService = class extends BaseService {
3663
4526
  backoffFactor: 2
3664
4527
  }
3665
4528
  });
4529
+ if (options?.query !== void 0) {
4530
+ request.addQueryParam("query", {
4531
+ key: "query",
4532
+ value: options.query,
4533
+ explode: false,
4534
+ encode: true,
4535
+ style: "form",
4536
+ isLimit: false,
4537
+ isOffset: false,
4538
+ isCursor: false
4539
+ });
4540
+ }
3666
4541
  if (options?.type !== void 0) {
3667
4542
  request.addQueryParam("type", {
3668
4543
  key: "type",
@@ -3821,7 +4696,7 @@ var ConversationsService = class extends BaseService {
3821
4696
  * @param since - Return only conversations created after this timestamp (ISO 8601 format)
3822
4697
  * @param sortBy - Field to sort conversations by
3823
4698
  * @param order - Sort order
3824
- * @param hasMemories - When true, return only conversations that contain at least one memory
4699
+ * @param minMemories - Return only conversations with at least this many memories (filters out empty init conversations)
3825
4700
  */
3826
4701
  async listConversations(options) {
3827
4702
  const request = new Request({
@@ -3897,10 +4772,10 @@ var ConversationsService = class extends BaseService {
3897
4772
  isCursor: false
3898
4773
  });
3899
4774
  }
3900
- if (options?.hasMemories !== void 0) {
3901
- request.addQueryParam("hasMemories", {
3902
- key: "hasMemories",
3903
- value: options.hasMemories,
4775
+ if (options?.minMemories !== void 0) {
4776
+ request.addQueryParam("minMemories", {
4777
+ key: "minMemories",
4778
+ value: options.minMemories,
3904
4779
  explode: false,
3905
4780
  encode: true,
3906
4781
  style: "form",
@@ -4670,6 +5545,33 @@ var ApiKeysService = class extends BaseService {
4670
5545
  }
4671
5546
  };
4672
5547
 
5548
+ // src/services/alerts-service.ts
5549
+ var AlertsService = class extends BaseService {
5550
+ /**
5551
+ * List active system alerts for the current user
5552
+ * Returns all active, non-expired system alerts that target either
5553
+ all users or the authenticated user specifically. Used by the
5554
+ customer portal to render the system alerts banner.
5555
+
5556
+ */
5557
+ async getActiveSystemAlerts() {
5558
+ const request = new Request({
5559
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5560
+ method: "GET",
5561
+ path: "/api/alerts/active",
5562
+ config: this.config,
5563
+ retry: {
5564
+ attempts: 3,
5565
+ delayMs: 150,
5566
+ maxDelayMs: 5e3,
5567
+ jitterMs: 50,
5568
+ backoffFactor: 2
5569
+ }
5570
+ });
5571
+ return this.client.call(request);
5572
+ }
5573
+ };
5574
+
4673
5575
  // src/services/admin-service.ts
4674
5576
  var AdminService = class extends BaseService {
4675
5577
  /**
@@ -4725,22 +5627,232 @@ var AdminService = class extends BaseService {
4725
5627
  encode: true,
4726
5628
  style: "form",
4727
5629
  isLimit: false,
4728
- isOffset: true,
5630
+ isOffset: true,
5631
+ isCursor: false
5632
+ });
5633
+ }
5634
+ return this.client.call(request);
5635
+ }
5636
+ /**
5637
+ * Create invite code
5638
+ * Create a new invite code for the gated preview
5639
+ * @param body - Request body
5640
+ */
5641
+ async adminCreateInviteCode(body) {
5642
+ const request = new Request({
5643
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5644
+ method: "POST",
5645
+ path: "/api/admin/invites",
5646
+ config: this.config,
5647
+ retry: {
5648
+ attempts: 3,
5649
+ delayMs: 150,
5650
+ maxDelayMs: 5e3,
5651
+ jitterMs: 50,
5652
+ backoffFactor: 2
5653
+ }
5654
+ });
5655
+ if (body !== void 0) {
5656
+ request.addBody(body);
5657
+ }
5658
+ return this.client.call(request);
5659
+ }
5660
+ /**
5661
+ * Get invite system statistics
5662
+ * Aggregate statistics for the invite system
5663
+ */
5664
+ async adminGetInviteStats() {
5665
+ const request = new Request({
5666
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5667
+ method: "GET",
5668
+ path: "/api/admin/invites/stats",
5669
+ config: this.config,
5670
+ retry: {
5671
+ attempts: 3,
5672
+ delayMs: 150,
5673
+ maxDelayMs: 5e3,
5674
+ jitterMs: 50,
5675
+ backoffFactor: 2
5676
+ }
5677
+ });
5678
+ return this.client.call(request);
5679
+ }
5680
+ /**
5681
+ * Get invite code details
5682
+ * Get details for a single invite code including redemptions
5683
+ * @param code - The invite code
5684
+ */
5685
+ async adminGetInviteCode(code) {
5686
+ const request = new Request({
5687
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5688
+ method: "GET",
5689
+ path: "/api/admin/invites/{code}",
5690
+ config: this.config,
5691
+ retry: {
5692
+ attempts: 3,
5693
+ delayMs: 150,
5694
+ maxDelayMs: 5e3,
5695
+ jitterMs: 50,
5696
+ backoffFactor: 2
5697
+ }
5698
+ });
5699
+ request.addPathParam("code", {
5700
+ key: "code",
5701
+ value: code,
5702
+ explode: false,
5703
+ encode: true,
5704
+ style: "simple",
5705
+ isLimit: false,
5706
+ isOffset: false,
5707
+ isCursor: false
5708
+ });
5709
+ return this.client.call(request);
5710
+ }
5711
+ /**
5712
+ * Revoke an invite code
5713
+ * Revoke an invite code. Existing accounts created with this code are unaffected.
5714
+ * @param code -
5715
+ */
5716
+ async adminRevokeInviteCode(code) {
5717
+ const request = new Request({
5718
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5719
+ method: "DELETE",
5720
+ path: "/api/admin/invites/{code}",
5721
+ config: this.config,
5722
+ retry: {
5723
+ attempts: 3,
5724
+ delayMs: 150,
5725
+ maxDelayMs: 5e3,
5726
+ jitterMs: 50,
5727
+ backoffFactor: 2
5728
+ }
5729
+ });
5730
+ request.addPathParam("code", {
5731
+ key: "code",
5732
+ value: code,
5733
+ explode: false,
5734
+ encode: true,
5735
+ style: "simple",
5736
+ isLimit: false,
5737
+ isOffset: false,
5738
+ isCursor: false
5739
+ });
5740
+ return this.client.call(request);
5741
+ }
5742
+ /**
5743
+ * Get gate status with audit info
5744
+ * Get current invite gate state with audit information
5745
+ */
5746
+ async adminGetGateStatus() {
5747
+ const request = new Request({
5748
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5749
+ method: "GET",
5750
+ path: "/api/admin/gate",
5751
+ config: this.config,
5752
+ retry: {
5753
+ attempts: 3,
5754
+ delayMs: 150,
5755
+ maxDelayMs: 5e3,
5756
+ jitterMs: 50,
5757
+ backoffFactor: 2
5758
+ }
5759
+ });
5760
+ return this.client.call(request);
5761
+ }
5762
+ /**
5763
+ * Toggle invite gate
5764
+ * Toggle the invite gate. When enabled (true), new signups require a valid invite code.
5765
+ When disabled (false), registration is open. Takes effect immediately.
5766
+
5767
+ * @param body - Request body
5768
+ */
5769
+ async adminSetGateStatus(body) {
5770
+ const request = new Request({
5771
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5772
+ method: "POST",
5773
+ path: "/api/admin/gate",
5774
+ config: this.config,
5775
+ retry: {
5776
+ attempts: 3,
5777
+ delayMs: 150,
5778
+ maxDelayMs: 5e3,
5779
+ jitterMs: 50,
5780
+ backoffFactor: 2
5781
+ }
5782
+ });
5783
+ if (body !== void 0) {
5784
+ request.addBody(body);
5785
+ }
5786
+ return this.client.call(request);
5787
+ }
5788
+ /**
5789
+ * Backfill per-stage memory pipeline status fields by inspecting actual graph state
5790
+ * @param body - Request body
5791
+ */
5792
+ async adminMigratePerStageStatus(options) {
5793
+ const request = new Request({
5794
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5795
+ method: "POST",
5796
+ path: "/api/admin/migrate/per-stage-status",
5797
+ config: this.config,
5798
+ retry: {
5799
+ attempts: 3,
5800
+ delayMs: 150,
5801
+ maxDelayMs: 5e3,
5802
+ jitterMs: 50,
5803
+ backoffFactor: 2
5804
+ }
5805
+ });
5806
+ if (options?.body !== void 0) {
5807
+ request.addBody(options?.body);
5808
+ }
5809
+ return this.client.call(request);
5810
+ }
5811
+ };
5812
+
5813
+ // src/services/admin-alerts-service.ts
5814
+ var AdminAlertsService = class extends BaseService {
5815
+ /**
5816
+ * List system alerts
5817
+ * @param activeOnly - If true, return only active, non-expired alerts.
5818
+ */
5819
+ async adminListSystemAlerts(options) {
5820
+ const request = new Request({
5821
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
5822
+ method: "GET",
5823
+ path: "/api/admin/alerts",
5824
+ config: this.config,
5825
+ retry: {
5826
+ attempts: 3,
5827
+ delayMs: 150,
5828
+ maxDelayMs: 5e3,
5829
+ jitterMs: 50,
5830
+ backoffFactor: 2
5831
+ }
5832
+ });
5833
+ if (options?.activeOnly !== void 0) {
5834
+ request.addQueryParam("activeOnly", {
5835
+ key: "activeOnly",
5836
+ value: options.activeOnly,
5837
+ explode: false,
5838
+ encode: true,
5839
+ style: "form",
5840
+ isLimit: false,
5841
+ isOffset: false,
4729
5842
  isCursor: false
4730
5843
  });
4731
5844
  }
4732
5845
  return this.client.call(request);
4733
5846
  }
4734
5847
  /**
4735
- * Create invite code
4736
- * Create a new invite code for the gated preview
5848
+ * Create a system alert
4737
5849
  * @param body - Request body
4738
5850
  */
4739
- async adminCreateInviteCode(body) {
5851
+ async adminCreateSystemAlert(body) {
4740
5852
  const request = new Request({
4741
5853
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4742
5854
  method: "POST",
4743
- path: "/api/admin/invites",
5855
+ path: "/api/admin/alerts",
4744
5856
  config: this.config,
4745
5857
  retry: {
4746
5858
  attempts: 3,
@@ -4756,14 +5868,14 @@ var AdminService = class extends BaseService {
4756
5868
  return this.client.call(request);
4757
5869
  }
4758
5870
  /**
4759
- * Get invite system statistics
4760
- * Aggregate statistics for the invite system
5871
+ * Get a system alert by id
5872
+ * @param id - System alert id
4761
5873
  */
4762
- async adminGetInviteStats() {
5874
+ async adminGetSystemAlert(id) {
4763
5875
  const request = new Request({
4764
5876
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4765
5877
  method: "GET",
4766
- path: "/api/admin/invites/stats",
5878
+ path: "/api/admin/alerts/{id}",
4767
5879
  config: this.config,
4768
5880
  retry: {
4769
5881
  attempts: 3,
@@ -4773,18 +5885,27 @@ var AdminService = class extends BaseService {
4773
5885
  backoffFactor: 2
4774
5886
  }
4775
5887
  });
5888
+ request.addPathParam("id", {
5889
+ key: "id",
5890
+ value: id,
5891
+ explode: false,
5892
+ encode: true,
5893
+ style: "simple",
5894
+ isLimit: false,
5895
+ isOffset: false,
5896
+ isCursor: false
5897
+ });
4776
5898
  return this.client.call(request);
4777
5899
  }
4778
5900
  /**
4779
- * Get invite code details
4780
- * Get details for a single invite code including redemptions
4781
- * @param code - The invite code
5901
+ * Delete a system alert
5902
+ * @param id - System alert id
4782
5903
  */
4783
- async adminGetInviteCode(code) {
5904
+ async adminDeleteSystemAlert(id) {
4784
5905
  const request = new Request({
4785
5906
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4786
- method: "GET",
4787
- path: "/api/admin/invites/{code}",
5907
+ method: "DELETE",
5908
+ path: "/api/admin/alerts/{id}",
4788
5909
  config: this.config,
4789
5910
  retry: {
4790
5911
  attempts: 3,
@@ -4794,9 +5915,9 @@ var AdminService = class extends BaseService {
4794
5915
  backoffFactor: 2
4795
5916
  }
4796
5917
  });
4797
- request.addPathParam("code", {
4798
- key: "code",
4799
- value: code,
5918
+ request.addPathParam("id", {
5919
+ key: "id",
5920
+ value: id,
4800
5921
  explode: false,
4801
5922
  encode: true,
4802
5923
  style: "simple",
@@ -4807,15 +5928,15 @@ var AdminService = class extends BaseService {
4807
5928
  return this.client.call(request);
4808
5929
  }
4809
5930
  /**
4810
- * Revoke an invite code
4811
- * Revoke an invite code. Existing accounts created with this code are unaffected.
4812
- * @param code -
5931
+ * Update a system alert
5932
+ * @param id -
5933
+ * @param body - Request body
4813
5934
  */
4814
- async adminRevokeInviteCode(code) {
5935
+ async adminUpdateSystemAlert(id, body) {
4815
5936
  const request = new Request({
4816
5937
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4817
- method: "DELETE",
4818
- path: "/api/admin/invites/{code}",
5938
+ method: "PATCH",
5939
+ path: "/api/admin/alerts/{id}",
4819
5940
  config: this.config,
4820
5941
  retry: {
4821
5942
  attempts: 3,
@@ -4825,9 +5946,9 @@ var AdminService = class extends BaseService {
4825
5946
  backoffFactor: 2
4826
5947
  }
4827
5948
  });
4828
- request.addPathParam("code", {
4829
- key: "code",
4830
- value: code,
5949
+ request.addPathParam("id", {
5950
+ key: "id",
5951
+ value: id,
4831
5952
  explode: false,
4832
5953
  encode: true,
4833
5954
  style: "simple",
@@ -4835,17 +5956,30 @@ var AdminService = class extends BaseService {
4835
5956
  isOffset: false,
4836
5957
  isCursor: false
4837
5958
  });
5959
+ if (body !== void 0) {
5960
+ request.addBody(body);
5961
+ }
4838
5962
  return this.client.call(request);
4839
5963
  }
4840
- /**
4841
- * Get gate status with audit info
4842
- * Get current invite gate state with audit information
4843
- */
4844
- async adminGetGateStatus() {
5964
+ };
5965
+
5966
+ // src/services/admin-pipeline-service.ts
5967
+ var AdminPipelineService = class extends BaseService {
5968
+ /**
5969
+ * Re-enqueue a single memory through one pipeline
5970
+ * Admin-only. Re-publishes the requested pipeline job for the given
5971
+ memory and resets the corresponding per-stage status field(s) to
5972
+ `queued`. Used to recover individual memories from transient
5973
+ worker failures or to replay a stage after a code change.
5974
+
5975
+ * @param id - Memory id (admin can target any tenant).
5976
+ * @param body - Request body
5977
+ */
5978
+ async adminRerunMemoryPipeline(id, body) {
4845
5979
  const request = new Request({
4846
5980
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4847
- method: "GET",
4848
- path: "/api/admin/gate",
5981
+ method: "POST",
5982
+ path: "/api/admin/memories/{id}/rerun",
4849
5983
  config: this.config,
4850
5984
  retry: {
4851
5985
  attempts: 3,
@@ -4855,20 +5989,34 @@ var AdminService = class extends BaseService {
4855
5989
  backoffFactor: 2
4856
5990
  }
4857
5991
  });
5992
+ request.addPathParam("id", {
5993
+ key: "id",
5994
+ value: id,
5995
+ explode: false,
5996
+ encode: true,
5997
+ style: "simple",
5998
+ isLimit: false,
5999
+ isOffset: false,
6000
+ isCursor: false
6001
+ });
6002
+ if (body !== void 0) {
6003
+ request.addBody(body);
6004
+ }
4858
6005
  return this.client.call(request);
4859
6006
  }
4860
6007
  /**
4861
- * Toggle invite gate
4862
- * Toggle the invite gate. When enabled (true), new signups require a valid invite code.
4863
- When disabled (false), registration is open. Takes effect immediately.
6008
+ * Per-queue depth + failure counts for the memory-creation pipelines
6009
+ * Returns BullMQ `getJobCounts()` for each known pipeline queue. Queues
6010
+ that have not yet been provisioned (e.g. `summary-qna` while task 2.3
6011
+ is in flight) are reported with `{ status: "not_configured" }` rather
6012
+ than throwing.
4864
6013
 
4865
- * @param body - Request body
4866
6014
  */
4867
- async adminSetGateStatus(body) {
6015
+ async adminGetPipelineHealth() {
4868
6016
  const request = new Request({
4869
6017
  baseUrl: this.config.baseUrl || "http://localhost:3000",
4870
- method: "POST",
4871
- path: "/api/admin/gate",
6018
+ method: "GET",
6019
+ path: "/api/admin/pipeline/health",
4872
6020
  config: this.config,
4873
6021
  retry: {
4874
6022
  attempts: 3,
@@ -4878,9 +6026,37 @@ var AdminService = class extends BaseService {
4878
6026
  backoffFactor: 2
4879
6027
  }
4880
6028
  });
4881
- if (body !== void 0) {
4882
- request.addBody(body);
4883
- }
6029
+ return this.client.call(request);
6030
+ }
6031
+ /**
6032
+ * Inspect per-stage pipeline status for a single memory
6033
+ * Debugging affordance — returns the six per-stage status fields and graphSkipReason.
6034
+ * @param id -
6035
+ */
6036
+ async adminGetMemoryPipelineStatus(id) {
6037
+ const request = new Request({
6038
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
6039
+ method: "GET",
6040
+ path: "/api/admin/memories/{id}/pipeline-status",
6041
+ config: this.config,
6042
+ retry: {
6043
+ attempts: 3,
6044
+ delayMs: 150,
6045
+ maxDelayMs: 5e3,
6046
+ jitterMs: 50,
6047
+ backoffFactor: 2
6048
+ }
6049
+ });
6050
+ request.addPathParam("id", {
6051
+ key: "id",
6052
+ value: id,
6053
+ explode: false,
6054
+ encode: true,
6055
+ style: "simple",
6056
+ isLimit: false,
6057
+ isOffset: false,
6058
+ isCursor: false
6059
+ });
4884
6060
  return this.client.call(request);
4885
6061
  }
4886
6062
  };
@@ -4889,7 +6065,9 @@ var AdminService = class extends BaseService {
4889
6065
  var import_zod = require("zod");
4890
6066
  var error = import_zod.z.object({
4891
6067
  /** Error message */
4892
- error: import_zod.z.string()
6068
+ error: import_zod.z.string(),
6069
+ /** Optional constructor name of the underlying error. Present on selected 500 responses for client diagnostics; absent on most error responses. */
6070
+ errorClass: import_zod.z.string().optional()
4893
6071
  });
4894
6072
  var pagination = import_zod.z.object({
4895
6073
  /** Maximum number of items per page */
@@ -4899,7 +6077,23 @@ var pagination = import_zod.z.object({
4899
6077
  /** Total number of items */
4900
6078
  count: import_zod.z.number().min(0)
4901
6079
  });
4902
- var memory = import_zod.z.object({
6080
+ var codeContext = import_zod.z.object({
6081
+ /** Product name (e.g. 'memnexus', 'spearmint') */
6082
+ product: import_zod.z.string().max(200).optional(),
6083
+ /** Repository name, if different from product */
6084
+ repo: import_zod.z.string().max(200).optional(),
6085
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
6086
+ service: import_zod.z.string().max(200).optional(),
6087
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
6088
+ component: import_zod.z.string().max(200).optional(),
6089
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
6090
+ team: import_zod.z.string().max(200).optional(),
6091
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
6092
+ role: import_zod.z.string().max(200).optional(),
6093
+ /** Additional project-specific scope tags */
6094
+ extra: import_zod.z.object({}).catchall(import_zod.z.string().max(500)).optional()
6095
+ }).nullable();
6096
+ var memory = import_zod.z.lazy(() => import_zod.z.object({
4903
6097
  /** Unique memory identifier */
4904
6098
  id: import_zod.z.string(),
4905
6099
  /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
@@ -4922,6 +6116,8 @@ var memory = import_zod.z.object({
4922
6116
  validFrom: import_zod.z.string().datetime().optional(),
4923
6117
  /** Validity end time (when this fact expires, null means never expires) */
4924
6118
  validTo: import_zod.z.string().datetime().nullable().optional(),
6119
+ /** Environment context for memory scoping — product, service, team, component, role. */
6120
+ codeContext: codeContext.optional(),
4925
6121
  /** Creation timestamp */
4926
6122
  createdAt: import_zod.z.string().datetime(),
4927
6123
  /** Last update timestamp */
@@ -4931,23 +6127,57 @@ var memory = import_zod.z.object({
4931
6127
  /** Basis for the confidence score */
4932
6128
  confidenceBasis: import_zod.z.enum(["direct-statement", "repeated-mention", "single-mention", "hedged", "inference", "external-source", "contradicted"]).optional(),
4933
6129
  /** Effective state of the memory in the narrative */
4934
- effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
4935
- /** Status of automatic content extraction */
4936
- extractionStatus: import_zod.z.enum(["pending", "completed", "failed", "skipped"]).optional(),
6130
+ effectiveState: import_zod.z.enum(["current", "superseded", "contradicted", "duplicate"]).optional(),
6131
+ /** Authority level: directive (mandates) > decision (choices with reasoning) > observation (learned during work) > auto-captured (generated content) */
6132
+ authority: import_zod.z.enum(["directive", "decision", "observation", "auto-captured"]).optional(),
6133
+ /** Legacy aggregate extraction status. DERIVED on read from the six per-stage statuses (contentEmbeddingStatus, summaryStatus, questionsStatus, summaryEmbeddingStatus, questionsEmbeddingStatus, graphStatus). Preserved for SDK compatibility per PRD memory-creation-pipeline-v2 §5 Q7. */
6134
+ extractionStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
4937
6135
  /** When extraction was completed */
4938
6136
  extractionCompletedAt: import_zod.z.string().datetime().optional(),
6137
+ /** Pipeline 2 content-embedding stage status. Tracks the queue lifecycle for writing m.embedding (primary content embedding). */
6138
+ contentEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6139
+ /** AI-generated summary of the memory content */
6140
+ summary: import_zod.z.string().optional(),
6141
+ /** Pipeline 1 summary stage status. Tracks generation of m.summary by the summary-qna LLM call. */
6142
+ summaryStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6143
+ /** Pipeline 1 questions stage status. Tracks generation of anticipated Question nodes by the summary-qna LLM call. */
6144
+ questionsStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6145
+ /** Pipeline 2 summary-embedding stage status. Tracks the queue lifecycle for writing m.summaryEmbedding (depends on summaryStatus=completed). */
6146
+ summaryEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6147
+ /** Pipeline 2 question-embedding stage status. Tracks the queue lifecycle for writing Question.embedding for each anticipated question (depends on questionsStatus=completed). */
6148
+ questionsEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6149
+ /** Pipeline 3 graph-extraction stage status. Tracks generation of entities, facts, topics, authority, and memory-type. Replaces the role formerly played by the monolithic extractionStatus writer. */
6150
+ graphStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6151
+ /** When graphStatus=skipped, records why graph extraction was skipped. Mirrors the legacy extractionSkipReason field but scoped to the graph pipeline. */
6152
+ graphSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
6153
+ /** When extractionStatus=skipped, records why extraction was skipped. global_disabled = GRAPH_EXTRACTION_ENABLED=false kill switch. */
6154
+ extractionSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy"]).optional(),
6155
+ /** Status of primary (Ollama) embedding generation via durable queue */
6156
+ embeddingStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
6157
+ /** Status of secondary (OpenAI) dual-write embedding generation via durable queue */
6158
+ embeddingOpenaiStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
6159
+ /** True if the primary content embedding used a head-truncated input (model context exceeded). */
6160
+ embeddingTruncated: import_zod.z.boolean().optional(),
6161
+ /** Token count of the original content (pre-truncation, cl100k proxy). Useful for identifying under-indexed memories. */
6162
+ embeddingOriginalTokens: import_zod.z.number().min(0).optional(),
6163
+ /** Smart-field strategy used to produce the primary content embedding. */
6164
+ embeddingStrategy: import_zod.z.enum(["full", "head-truncated", "summary-selected", "question-selected"]).optional(),
4939
6165
  /** Number of topics extracted from content */
4940
6166
  extractedTopicCount: import_zod.z.number().min(0).optional(),
4941
6167
  /** Number of facts extracted from content */
4942
6168
  extractedFactCount: import_zod.z.number().min(0).optional(),
4943
6169
  /** Number of entities extracted from content */
4944
6170
  extractedEntityCount: import_zod.z.number().min(0).optional(),
6171
+ /** Number of memories this memory contradicts via outgoing CONTRADICTS relationships */
6172
+ conflictCount: import_zod.z.number().min(0).optional(),
6173
+ /** Memory visibility level. Null/undefined treated as 'private' for backward compatibility. 'admin_visible' is computed at retrieval time when an org owner/admin queries another member's post-join memory and is never accepted on writes. */
6174
+ visibility: import_zod.z.enum(["private", "shared_with_users", "shared_with_org", "admin_visible"]).optional(),
6175
+ /** User IDs this memory is shared with (only populated when visibility = 'shared_with_users') */
6176
+ sharedWith: import_zod.z.array(import_zod.z.string()).optional(),
4945
6177
  /** Topics explicitly provided by the user */
4946
6178
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
4947
6179
  /** Topics automatically extracted from content */
4948
6180
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
4949
- /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
4950
- agentSessionId: import_zod.z.string().nullable().optional(),
4951
6181
  /** Entities extracted from memory content */
4952
6182
  entities: import_zod.z.array(import_zod.z.object({
4953
6183
  /** Entity name */
@@ -4956,13 +6186,41 @@ var memory = import_zod.z.object({
4956
6186
  type: import_zod.z.string(),
4957
6187
  /** Extraction confidence */
4958
6188
  confidence: import_zod.z.number().min(0).max(1).optional()
4959
- })).optional()
6189
+ })).optional(),
6190
+ /** Task identifier for agentic loop memories */
6191
+ taskId: import_zod.z.string().nullable().optional(),
6192
+ /** Task outcome status */
6193
+ outcome: import_zod.z.enum(["resolved", "unresolved"]).nullable().optional(),
6194
+ /** Attempt number within the task */
6195
+ attemptNumber: import_zod.z.number().nullable().optional(),
6196
+ /** Distillation pipeline stage status */
6197
+ distillStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).nullable().optional(),
6198
+ /** Reason distillation was skipped */
6199
+ distillSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
6200
+ /** Error message if distillation failed */
6201
+ distillError: import_zod.z.string().nullable().optional(),
6202
+ /** ISO 8601 timestamp when distillation completed */
6203
+ distillCompletedAt: import_zod.z.string().nullable().optional()
6204
+ }));
6205
+ var precomputedMemoryFields = import_zod.z.object({
6206
+ /** Pre-computed memory summary. When supplied, summary-qna LLM call is skipped and m.summary is set inline. */
6207
+ summary: import_zod.z.string().max(2e3).optional(),
6208
+ /** Pre-computed anticipated questions. When supplied, the questions stage of the summary-qna LLM call is skipped and Question nodes are created inline. Hard-capped at 20. */
6209
+ questions: import_zod.z.array(import_zod.z.string().max(500)).max(20).optional(),
6210
+ /** Pre-computed embeddings keyed by Pipeline 2 job kind (content / summary / question). */
6211
+ embeddings: import_zod.z.object({
6212
+ /** Pre-computed content embedding (m.embedding). Bypasses the content-embedding queue. */
6213
+ content: import_zod.z.array(import_zod.z.number()).optional(),
6214
+ /** Pre-computed summary embedding (m.summaryEmbedding). Bypasses the summary-embedding queue. */
6215
+ summary: import_zod.z.array(import_zod.z.number()).optional(),
6216
+ /** Pre-computed per-question embeddings — must have the same length as `questions` when both are supplied. */
6217
+ questions: import_zod.z.array(import_zod.z.array(import_zod.z.number())).optional()
6218
+ }).optional()
4960
6219
  });
4961
- var createMemoryRequest = import_zod.z.object({
4962
- /** Conversation ID - use "NEW" to create a new conversation or provide existing conversation ID */
4963
- conversationId: import_zod.z.string().min(1),
4964
- /** Agent session ID (e.g. MCP session ID, Claude Code session UUID). When provided with conversationId "NEW", reuses the existing conversation for this session instead of creating a new one. Works with any MCP client (Claude, Copilot, Cursor, etc.). */
4965
- agentSessionId: import_zod.z.string().max(200).optional(),
6220
+ var createMemoryRequest = import_zod.z.lazy(() => import_zod.z.object({
6221
+ /** Conversation ID - use "NEW" to always create a new conversation, provide an existing ID to append to it, or omit to auto-assign via claudeSessionId session grouping. */
6222
+ conversationId: import_zod.z.string().min(1).optional(),
6223
+ /** Agent session ID (e.g. MCP session ID, Claude Code session UUID). When conversationId is omitted, reuses or creates a conversation for this session (automatic grouping). Ignored when conversationId is explicitly provided. Works with any MCP client (Claude, Copilot, Cursor, etc.). */
4966
6224
  claudeSessionId: import_zod.z.string().max(200).optional(),
4967
6225
  /** Optional human-readable name for deterministic retrieval. Must be unique per user. */
4968
6226
  name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
@@ -4981,8 +6239,32 @@ var createMemoryRequest = import_zod.z.object({
4981
6239
  /** Validity start time (when this fact becomes valid, ISO 8601 format) */
4982
6240
  validFrom: import_zod.z.string().datetime().optional(),
4983
6241
  /** Validity end time (when this fact expires, ISO 8601 format, omit for never expires) */
4984
- validTo: import_zod.z.string().datetime().optional()
4985
- });
6242
+ validTo: import_zod.z.string().datetime().optional(),
6243
+ codeContext: import_zod.z.object({
6244
+ /** Product name (e.g. 'memnexus', 'spearmint') */
6245
+ product: import_zod.z.string().max(200).optional(),
6246
+ /** Repository name, if different from product */
6247
+ repo: import_zod.z.string().max(200).optional(),
6248
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
6249
+ service: import_zod.z.string().max(200).optional(),
6250
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
6251
+ component: import_zod.z.string().max(200).optional(),
6252
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
6253
+ team: import_zod.z.string().max(200).optional(),
6254
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
6255
+ role: import_zod.z.string().max(200).optional(),
6256
+ /** Additional project-specific scope tags */
6257
+ extra: import_zod.z.object({}).catchall(import_zod.z.string().max(500)).optional()
6258
+ }).optional(),
6259
+ /** Privileged-only short-circuit for Pipeline 1/2 — admin/internal/test callers may pre-supply summary, questions, and/or embeddings to bypass LLM and embedding work at create time. Silently ignored for non-privileged callers. */
6260
+ precomputed: precomputedMemoryFields.optional(),
6261
+ /** Task identifier for grouping memories across agentic loop attempts */
6262
+ taskId: import_zod.z.string().max(200).optional(),
6263
+ /** Task outcome status for this memory */
6264
+ outcome: import_zod.z.enum(["resolved", "unresolved"]).optional(),
6265
+ /** Request distillation of this memory (Pro/Enterprise only) */
6266
+ distill: import_zod.z.boolean().optional()
6267
+ }));
4986
6268
  var updateMemoryRequest = import_zod.z.object({
4987
6269
  /** Updated memory content */
4988
6270
  content: import_zod.z.string().min(1).max(5e4).optional(),
@@ -4993,7 +6275,9 @@ var updateMemoryRequest = import_zod.z.object({
4993
6275
  /** Updated context or domain */
4994
6276
  context: import_zod.z.string().max(200).optional(),
4995
6277
  /** Updated topics */
4996
- topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional()
6278
+ topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional(),
6279
+ /** Task outcome status. Set to null to clear. */
6280
+ outcome: import_zod.z.enum(["resolved", "unresolved"]).nullable().optional()
4997
6281
  });
4998
6282
  var createMemoryResponseMeta = import_zod.z.object({
4999
6283
  /** Conversation ID (actual ID if "NEW" was provided) */
@@ -5009,7 +6293,7 @@ var createMemoryResponse = import_zod.z.lazy(() => import_zod.z.object({
5009
6293
  data: memory,
5010
6294
  meta: createMemoryResponseMeta
5011
6295
  }));
5012
- var relatedMemoryResult = import_zod.z.object({
6296
+ var relatedMemoryResult = import_zod.z.lazy(() => import_zod.z.object({
5013
6297
  memory: import_zod.z.object({
5014
6298
  /** Unique memory identifier */
5015
6299
  id: import_zod.z.string(),
@@ -5033,6 +6317,8 @@ var relatedMemoryResult = import_zod.z.object({
5033
6317
  validFrom: import_zod.z.string().datetime().optional(),
5034
6318
  /** Validity end time (when this fact expires, null means never expires) */
5035
6319
  validTo: import_zod.z.string().datetime().nullable().optional(),
6320
+ /** Environment context for memory scoping — product, service, team, component, role. */
6321
+ codeContext: codeContext.optional(),
5036
6322
  /** Creation timestamp */
5037
6323
  createdAt: import_zod.z.string().datetime(),
5038
6324
  /** Last update timestamp */
@@ -5042,23 +6328,57 @@ var relatedMemoryResult = import_zod.z.object({
5042
6328
  /** Basis for the confidence score */
5043
6329
  confidenceBasis: import_zod.z.enum(["direct-statement", "repeated-mention", "single-mention", "hedged", "inference", "external-source", "contradicted"]).optional(),
5044
6330
  /** Effective state of the memory in the narrative */
5045
- effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
5046
- /** Status of automatic content extraction */
5047
- extractionStatus: import_zod.z.enum(["pending", "completed", "failed", "skipped"]).optional(),
6331
+ effectiveState: import_zod.z.enum(["current", "superseded", "contradicted", "duplicate"]).optional(),
6332
+ /** Authority level: directive (mandates) > decision (choices with reasoning) > observation (learned during work) > auto-captured (generated content) */
6333
+ authority: import_zod.z.enum(["directive", "decision", "observation", "auto-captured"]).optional(),
6334
+ /** Legacy aggregate extraction status. DERIVED on read from the six per-stage statuses (contentEmbeddingStatus, summaryStatus, questionsStatus, summaryEmbeddingStatus, questionsEmbeddingStatus, graphStatus). Preserved for SDK compatibility per PRD memory-creation-pipeline-v2 §5 Q7. */
6335
+ extractionStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
5048
6336
  /** When extraction was completed */
5049
6337
  extractionCompletedAt: import_zod.z.string().datetime().optional(),
6338
+ /** Pipeline 2 content-embedding stage status. Tracks the queue lifecycle for writing m.embedding (primary content embedding). */
6339
+ contentEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6340
+ /** AI-generated summary of the memory content */
6341
+ summary: import_zod.z.string().optional(),
6342
+ /** Pipeline 1 summary stage status. Tracks generation of m.summary by the summary-qna LLM call. */
6343
+ summaryStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6344
+ /** Pipeline 1 questions stage status. Tracks generation of anticipated Question nodes by the summary-qna LLM call. */
6345
+ questionsStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6346
+ /** Pipeline 2 summary-embedding stage status. Tracks the queue lifecycle for writing m.summaryEmbedding (depends on summaryStatus=completed). */
6347
+ summaryEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6348
+ /** Pipeline 2 question-embedding stage status. Tracks the queue lifecycle for writing Question.embedding for each anticipated question (depends on questionsStatus=completed). */
6349
+ questionsEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6350
+ /** Pipeline 3 graph-extraction stage status. Tracks generation of entities, facts, topics, authority, and memory-type. Replaces the role formerly played by the monolithic extractionStatus writer. */
6351
+ graphStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
6352
+ /** When graphStatus=skipped, records why graph extraction was skipped. Mirrors the legacy extractionSkipReason field but scoped to the graph pipeline. */
6353
+ graphSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
6354
+ /** When extractionStatus=skipped, records why extraction was skipped. global_disabled = GRAPH_EXTRACTION_ENABLED=false kill switch. */
6355
+ extractionSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy"]).optional(),
6356
+ /** Status of primary (Ollama) embedding generation via durable queue */
6357
+ embeddingStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
6358
+ /** Status of secondary (OpenAI) dual-write embedding generation via durable queue */
6359
+ embeddingOpenaiStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
6360
+ /** True if the primary content embedding used a head-truncated input (model context exceeded). */
6361
+ embeddingTruncated: import_zod.z.boolean().optional(),
6362
+ /** Token count of the original content (pre-truncation, cl100k proxy). Useful for identifying under-indexed memories. */
6363
+ embeddingOriginalTokens: import_zod.z.number().min(0).optional(),
6364
+ /** Smart-field strategy used to produce the primary content embedding. */
6365
+ embeddingStrategy: import_zod.z.enum(["full", "head-truncated", "summary-selected", "question-selected"]).optional(),
5050
6366
  /** Number of topics extracted from content */
5051
6367
  extractedTopicCount: import_zod.z.number().min(0).optional(),
5052
6368
  /** Number of facts extracted from content */
5053
6369
  extractedFactCount: import_zod.z.number().min(0).optional(),
5054
6370
  /** Number of entities extracted from content */
5055
6371
  extractedEntityCount: import_zod.z.number().min(0).optional(),
6372
+ /** Number of memories this memory contradicts via outgoing CONTRADICTS relationships */
6373
+ conflictCount: import_zod.z.number().min(0).optional(),
6374
+ /** Memory visibility level. Null/undefined treated as 'private' for backward compatibility. 'admin_visible' is computed at retrieval time when an org owner/admin queries another member's post-join memory and is never accepted on writes. */
6375
+ visibility: import_zod.z.enum(["private", "shared_with_users", "shared_with_org", "admin_visible"]).optional(),
6376
+ /** User IDs this memory is shared with (only populated when visibility = 'shared_with_users') */
6377
+ sharedWith: import_zod.z.array(import_zod.z.string()).optional(),
5056
6378
  /** Topics explicitly provided by the user */
5057
6379
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5058
6380
  /** Topics automatically extracted from content */
5059
6381
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5060
- /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5061
- agentSessionId: import_zod.z.string().nullable().optional(),
5062
6382
  /** Entities extracted from memory content */
5063
6383
  entities: import_zod.z.array(import_zod.z.object({
5064
6384
  /** Entity name */
@@ -5067,7 +6387,21 @@ var relatedMemoryResult = import_zod.z.object({
5067
6387
  type: import_zod.z.string(),
5068
6388
  /** Extraction confidence */
5069
6389
  confidence: import_zod.z.number().min(0).max(1).optional()
5070
- })).optional()
6390
+ })).optional(),
6391
+ /** Task identifier for agentic loop memories */
6392
+ taskId: import_zod.z.string().nullable().optional(),
6393
+ /** Task outcome status */
6394
+ outcome: import_zod.z.enum(["resolved", "unresolved"]).nullable().optional(),
6395
+ /** Attempt number within the task */
6396
+ attemptNumber: import_zod.z.number().nullable().optional(),
6397
+ /** Distillation pipeline stage status */
6398
+ distillStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).nullable().optional(),
6399
+ /** Reason distillation was skipped */
6400
+ distillSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
6401
+ /** Error message if distillation failed */
6402
+ distillError: import_zod.z.string().nullable().optional(),
6403
+ /** ISO 8601 timestamp when distillation completed */
6404
+ distillCompletedAt: import_zod.z.string().nullable().optional()
5071
6405
  }),
5072
6406
  /** Relevance score (0-1). For similar: semantic similarity. For related: topic overlap ratio. For conversation: position score. */
5073
6407
  score: import_zod.z.number().min(0).max(1),
@@ -5075,7 +6409,7 @@ var relatedMemoryResult = import_zod.z.object({
5075
6409
  relationship: import_zod.z.string(),
5076
6410
  /** Topics shared with the source memory (only for topic relationship) */
5077
6411
  sharedTopics: import_zod.z.array(import_zod.z.string()).optional()
5078
- });
6412
+ }));
5079
6413
  var getMemoryResponse = import_zod.z.lazy(() => import_zod.z.object({
5080
6414
  data: memory
5081
6415
  }));
@@ -5087,7 +6421,27 @@ var updateNamedMemoryRequest = import_zod.z.object({
5087
6421
  /** Context or domain */
5088
6422
  context: import_zod.z.string().max(200).optional(),
5089
6423
  /** Associated topics */
5090
- topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional()
6424
+ topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional(),
6425
+ /** Conversation to group this version with (overrides previous version's conversation) */
6426
+ conversationId: import_zod.z.string().max(200).optional(),
6427
+ codeContext: import_zod.z.object({
6428
+ /** Product name (e.g. 'memnexus', 'spearmint') */
6429
+ product: import_zod.z.string().max(200).optional(),
6430
+ /** Repository name, if different from product */
6431
+ repo: import_zod.z.string().max(200).optional(),
6432
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
6433
+ service: import_zod.z.string().max(200).optional(),
6434
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
6435
+ component: import_zod.z.string().max(200).optional(),
6436
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
6437
+ team: import_zod.z.string().max(200).optional(),
6438
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
6439
+ role: import_zod.z.string().max(200).optional(),
6440
+ /** Additional project-specific scope tags */
6441
+ extra: import_zod.z.object({}).catchall(import_zod.z.string().max(500)).optional()
6442
+ }).optional(),
6443
+ /** Additional memory ID that this version supersedes (beyond the implicit version chain) */
6444
+ supersedes: import_zod.z.string().uuid().optional()
5091
6445
  });
5092
6446
  var namedMemoryHistoryResponse = import_zod.z.object({
5093
6447
  /** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
@@ -5100,16 +6454,16 @@ var namedMemoryHistoryResponse = import_zod.z.object({
5100
6454
  /** Memory content at this version */
5101
6455
  content: import_zod.z.string(),
5102
6456
  /** Effective state — HEAD version is 'current', older versions are 'superseded' */
5103
- effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
6457
+ effectiveState: import_zod.z.enum(["current", "superseded", "contradicted", "duplicate"]).optional(),
5104
6458
  /** When this version was created */
5105
6459
  createdAt: import_zod.z.string().datetime()
5106
6460
  }))
5107
6461
  });
5108
6462
  var batchGetMemoriesRequest = import_zod.z.object({
5109
- /** Array of memory IDs to retrieve */
5110
- ids: import_zod.z.array(import_zod.z.string().uuid()).min(1).max(100),
5111
- /** Detail level for each memory. 'minimal' returns raw memory only (default, backward compatible). 'standard' adds topics, entities, facts, and relationships. */
5112
- detail: import_zod.z.enum(["minimal", "standard"]).optional()
6463
+ /** Array of memory IDs to retrieve. Non-existent or malformed IDs are returned in the 'missing' array rather than failing the request. */
6464
+ ids: import_zod.z.array(import_zod.z.string().min(1).max(200)).min(1).max(100),
6465
+ /** Detail level for each memory. 'minimal' returns raw memory only (default, backward compatible). 'standard' adds topics, entities, facts, and relationships. 'full' additionally adds conversation context and relationship target previews. */
6466
+ detail: import_zod.z.enum(["minimal", "standard", "full"]).optional()
5113
6467
  });
5114
6468
  var batchGetMemoriesMeta = import_zod.z.object({
5115
6469
  /** Number of IDs requested */
@@ -5210,6 +6564,73 @@ var pattern = import_zod.z.object({
5210
6564
  /** Confidence score (0-1) */
5211
6565
  confidence: import_zod.z.number().min(0).max(1)
5212
6566
  });
6567
+ var compileInstructionsRequest = import_zod.z.object({
6568
+ conversationContext: import_zod.z.array(import_zod.z.string().max(100)).max(20).optional(),
6569
+ currentQuery: import_zod.z.string().max(2e3).optional(),
6570
+ tokenBudget: import_zod.z.number().min(50).max(2e3).optional(),
6571
+ minConfidence: import_zod.z.number().min(0).max(1).optional(),
6572
+ maxInstructions: import_zod.z.number().min(1).max(10).optional()
6573
+ });
6574
+ var compileInstructionsResponse = import_zod.z.object({
6575
+ instructions: import_zod.z.array(import_zod.z.object({
6576
+ patternId: import_zod.z.string(),
6577
+ instruction: import_zod.z.string().max(500),
6578
+ confidence: import_zod.z.number(),
6579
+ priority: import_zod.z.number(),
6580
+ source: import_zod.z.enum(["learned", "explicit", "manual"]),
6581
+ patternType: import_zod.z.string(),
6582
+ activatedBy: import_zod.z.array(import_zod.z.string()),
6583
+ recommendationId: import_zod.z.string().optional(),
6584
+ triggerContext: import_zod.z.string().optional(),
6585
+ evidenceSummary: import_zod.z.string().optional(),
6586
+ firstSurfacing: import_zod.z.boolean().optional()
6587
+ })),
6588
+ summary: import_zod.z.string().max(1e3),
6589
+ tokenCount: import_zod.z.number(),
6590
+ patternsEvaluated: import_zod.z.number(),
6591
+ patternsActivated: import_zod.z.number(),
6592
+ conflictsResolved: import_zod.z.array(import_zod.z.object({
6593
+ winnerId: import_zod.z.string(),
6594
+ loserId: import_zod.z.string(),
6595
+ strategy: import_zod.z.enum(["priority_override"])
6596
+ })),
6597
+ systemState: import_zod.z.enum(["ok", "cold_start", "pending_only", "no_match"]).optional(),
6598
+ pendingCount: import_zod.z.number().min(0).optional(),
6599
+ patternsExcluded: import_zod.z.number().min(0).optional()
6600
+ });
6601
+ var recommendation = import_zod.z.object({
6602
+ id: import_zod.z.string().uuid(),
6603
+ userId: import_zod.z.string(),
6604
+ triggerContext: import_zod.z.string().max(500),
6605
+ practice: import_zod.z.string().max(1e3),
6606
+ evidenceSummary: import_zod.z.string().max(2e3).optional(),
6607
+ source: import_zod.z.enum(["explicit", "learned", "manual"]),
6608
+ outcomeSignal: import_zod.z.enum(["positive", "neutral", "unknown"]),
6609
+ confidence: import_zod.z.number().min(0).max(1),
6610
+ evidenceMemoryIds: import_zod.z.array(import_zod.z.string().uuid()).max(50).optional(),
6611
+ triggerEmbeddingStatus: import_zod.z.enum(["pending", "complete", "failed"]),
6612
+ applicationCount: import_zod.z.number().min(0),
6613
+ provisional: import_zod.z.boolean(),
6614
+ status: import_zod.z.enum(["pending_review", "active", "paused", "dismissed", "superseded"]),
6615
+ validFrom: import_zod.z.string().datetime().optional(),
6616
+ validUntil: import_zod.z.string().datetime().nullable().optional(),
6617
+ supersededBy: import_zod.z.string().uuid().nullable().optional(),
6618
+ createdAt: import_zod.z.string().datetime(),
6619
+ updatedAt: import_zod.z.string().datetime()
6620
+ });
6621
+ var createRecommendationRequest = import_zod.z.object({
6622
+ triggerContext: import_zod.z.string().max(500),
6623
+ practice: import_zod.z.string().max(1e3),
6624
+ evidenceSummary: import_zod.z.string().max(2e3).optional(),
6625
+ outcomeSignal: import_zod.z.enum(["positive", "neutral", "unknown"]).optional(),
6626
+ evidenceMemoryIds: import_zod.z.array(import_zod.z.string().uuid()).max(50).optional(),
6627
+ activateImmediately: import_zod.z.boolean().optional()
6628
+ });
6629
+ var matchRecommendationsRequest = import_zod.z.object({
6630
+ content: import_zod.z.string().max(1e4),
6631
+ limit: import_zod.z.number().min(1).max(5).optional(),
6632
+ similarityThreshold: import_zod.z.number().min(0.1).max(0.99).optional()
6633
+ });
5213
6634
  var serviceCheck = import_zod.z.object({
5214
6635
  /** Service status */
5215
6636
  status: import_zod.z.enum(["up", "down"]),
@@ -5269,32 +6690,44 @@ var searchRequest = import_zod.z.object({
5269
6690
  memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]).optional(),
5270
6691
  /** Filter by conversation ID */
5271
6692
  conversationId: import_zod.z.string().optional(),
6693
+ /** Task-scoped retrieval: returns own-history first, fills remainder with cross-task results. */
6694
+ taskId: import_zod.z.string().max(200).optional(),
6695
+ /** Filter by task outcome. Use 'resolved' to find successful approaches from past tasks. */
6696
+ outcomeFilter: import_zod.z.enum(["resolved", "unresolved", "any"]).optional(),
5272
6697
  /** Include topics associated with matched memories (defaults to false for performance) */
5273
6698
  includeTopics: import_zod.z.boolean().optional(),
5274
6699
  /** Include entities mentioned in matched memories (defaults to false for performance) */
5275
6700
  includeEntities: import_zod.z.boolean().optional(),
5276
6701
  /** Include facts extracted from matched memories (defaults to false for performance) */
5277
6702
  includeFacts: import_zod.z.boolean().optional(),
6703
+ /** Include claims associated with matched memories (defaults to true) */
6704
+ includeClaims: import_zod.z.boolean().optional(),
5278
6705
  /** Filter entities by type (e.g., PERSON, TECHNOLOGY, PROJECT) */
5279
6706
  entityTypes: import_zod.z.array(import_zod.z.string().max(50)).max(20).optional(),
5280
6707
  /** Enable entity graph traversal branch in hybrid search (default false) */
5281
6708
  expandEntities: import_zod.z.boolean().optional(),
5282
- /** Enable topic graph traversal branch in hybrid search (default false) */
6709
+ /** Enable topic graph traversal branch in hybrid search (default true) */
5283
6710
  expandTopics: import_zod.z.boolean().optional(),
5284
- /** Enable fact graph traversal branch in hybrid search (default false) */
6711
+ /** Enable fact graph traversal branch in hybrid search (default true) */
5285
6712
  expandFacts: import_zod.z.boolean().optional(),
5286
6713
  /** Include superseded and contradicted memories in results (default false) */
5287
6714
  includeSuperseded: import_zod.z.boolean().optional(),
5288
- /** Weight for entity graph branch in hybrid search (0-1, default 0.7) */
6715
+ /** Weight for entity graph branch in hybrid search (0-1, default 0.1) */
5289
6716
  entityWeight: import_zod.z.number().min(0).max(1).optional(),
5290
6717
  /** Weight for topic graph branch in hybrid search (0-1, default 0.5) */
5291
6718
  topicWeight: import_zod.z.number().min(0).max(1).optional(),
5292
6719
  /** Weight for fact graph branch in hybrid search (0-1, default 0.6) */
5293
6720
  factWeight: import_zod.z.number().min(0).max(1).optional(),
6721
+ /** Weight for question graph branch in hybrid search (0-1) */
6722
+ questionWeight: import_zod.z.number().min(0).max(1).optional(),
6723
+ /** Weight for claims vector branch in hybrid search (0-1, default 0.5) */
6724
+ claimsWeight: import_zod.z.number().min(0).max(1).optional(),
5294
6725
  /** Field to sort results by (defaults to 'relevance' for search, 'createdAt' for list) */
5295
6726
  sortBy: import_zod.z.enum(["relevance", "createdAt", "updatedAt", "eventTime"]).optional(),
5296
6727
  /** Sort order: 'asc' or 'desc' (defaults to 'desc' for timestamps, 'desc' for relevance) */
5297
- order: import_zod.z.enum(["asc", "desc"]).optional()
6728
+ order: import_zod.z.enum(["asc", "desc"]).optional(),
6729
+ /** Include facet aggregation (topics, memoryType, effectiveState) in response (defaults to false) */
6730
+ includeFacets: import_zod.z.boolean().optional()
5298
6731
  });
5299
6732
  var entity = import_zod.z.object({
5300
6733
  /** Entity name */
@@ -5302,80 +6735,39 @@ var entity = import_zod.z.object({
5302
6735
  /** Entity type */
5303
6736
  type: import_zod.z.string().optional()
5304
6737
  });
5305
- var topicReference = import_zod.z.object({
5306
- /** Topic unique identifier */
5307
- id: import_zod.z.string().uuid(),
5308
- /** Topic name */
5309
- name: import_zod.z.string(),
5310
- /** When the topic was created */
5311
- createdAt: import_zod.z.string().datetime().optional()
5312
- });
5313
6738
  var searchResult = import_zod.z.lazy(() => import_zod.z.object({
5314
- memory: import_zod.z.object({
5315
- /** Unique memory identifier */
5316
- id: import_zod.z.string(),
5317
- /** Optional human-readable name for deterministic retrieval. Only the HEAD version carries the name. */
5318
- name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
5319
- /** Version number for named memories (1 for first version, increments on update) */
5320
- version: import_zod.z.number().min(1).optional(),
5321
- /** Memory content */
5322
- content: import_zod.z.string(),
5323
- /** Type of memory */
5324
- memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]),
5325
- /** Context or domain of the memory */
5326
- context: import_zod.z.string().optional(),
5327
- /** Associated topics */
5328
- topics: import_zod.z.array(import_zod.z.string()).optional(),
5329
- /** System ingestion timestamp (when the system learned about this) */
5330
- timestamp: import_zod.z.string().datetime().optional(),
5331
- /** Event time (when the event actually occurred in reality) */
5332
- eventTime: import_zod.z.string().datetime().optional(),
5333
- /** Validity start time (when this fact becomes valid) */
5334
- validFrom: import_zod.z.string().datetime().optional(),
5335
- /** Validity end time (when this fact expires, null means never expires) */
5336
- validTo: import_zod.z.string().datetime().nullable().optional(),
5337
- /** Creation timestamp */
5338
- createdAt: import_zod.z.string().datetime(),
5339
- /** Last update timestamp */
5340
- updatedAt: import_zod.z.string().datetime(),
5341
- /** Confidence score (0-1) for this memory's accuracy */
5342
- confidenceScore: import_zod.z.number().min(0).max(1).optional(),
5343
- /** Basis for the confidence score */
5344
- confidenceBasis: import_zod.z.enum(["direct-statement", "repeated-mention", "single-mention", "hedged", "inference", "external-source", "contradicted"]).optional(),
5345
- /** Effective state of the memory in the narrative */
5346
- effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
5347
- /** Status of automatic content extraction */
5348
- extractionStatus: import_zod.z.enum(["pending", "completed", "failed", "skipped"]).optional(),
5349
- /** When extraction was completed */
5350
- extractionCompletedAt: import_zod.z.string().datetime().optional(),
5351
- /** Number of topics extracted from content */
5352
- extractedTopicCount: import_zod.z.number().min(0).optional(),
5353
- /** Number of facts extracted from content */
5354
- extractedFactCount: import_zod.z.number().min(0).optional(),
5355
- /** Number of entities extracted from content */
5356
- extractedEntityCount: import_zod.z.number().min(0).optional(),
5357
- /** Topics explicitly provided by the user */
5358
- userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5359
- /** Topics automatically extracted from content */
5360
- extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5361
- /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5362
- agentSessionId: import_zod.z.string().nullable().optional(),
5363
- /** Entities extracted from memory content */
5364
- entities: import_zod.z.array(import_zod.z.object({
5365
- /** Entity name */
5366
- name: import_zod.z.string(),
5367
- /** Entity type */
5368
- type: import_zod.z.string(),
5369
- /** Extraction confidence */
5370
- confidence: import_zod.z.number().min(0).max(1).optional()
5371
- })).optional()
5372
- }),
5373
- /** Relevance score for this result */
5374
- score: import_zod.z.number(),
6739
+ /** Unique memory identifier */
6740
+ id: import_zod.z.string(),
6741
+ /** Full memory content */
6742
+ content: import_zod.z.string(),
6743
+ /** Truncated content preview (max 200 chars) */
6744
+ preview: import_zod.z.string(),
6745
+ /** Optional human-readable name for deterministic retrieval */
6746
+ name: import_zod.z.string().nullable().optional(),
6747
+ /** Type of memory */
6748
+ memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]),
6749
+ /** Associated topics */
6750
+ topics: import_zod.z.array(import_zod.z.string()).optional(),
6751
+ /** Conversation this memory belongs to */
6752
+ conversationId: import_zod.z.string().nullable().optional(),
6753
+ /** System ingestion timestamp */
6754
+ timestamp: import_zod.z.string().datetime().optional(),
6755
+ /** Event time (when the event actually occurred) */
6756
+ eventTime: import_zod.z.string().datetime().optional(),
6757
+ /** Validity start time */
6758
+ validFrom: import_zod.z.string().datetime().optional(),
6759
+ /** Creation timestamp */
6760
+ createdAt: import_zod.z.string().datetime().optional(),
6761
+ /** Last update timestamp */
6762
+ updatedAt: import_zod.z.string().datetime().optional(),
6763
+ /** Effective state of the memory */
6764
+ effectiveState: import_zod.z.string().optional(),
6765
+ /** Confidence score (0-1) */
6766
+ confidenceScore: import_zod.z.number().min(0).max(1).optional(),
6767
+ /** Overall relevance score for this result */
6768
+ score: import_zod.z.number().nullable().optional(),
5375
6769
  /** Entities mentioned in this memory */
5376
6770
  entities: import_zod.z.array(entity).optional(),
5377
- /** Topics associated with this memory */
5378
- topics: import_zod.z.array(topicReference).optional(),
5379
6771
  /** Facts extracted from this memory */
5380
6772
  facts: import_zod.z.array(import_zod.z.object({
5381
6773
  /** Fact subject */
@@ -5387,10 +6779,8 @@ var searchResult = import_zod.z.lazy(() => import_zod.z.object({
5387
6779
  /** Confidence */
5388
6780
  confidence: import_zod.z.number().min(0).max(1).optional()
5389
6781
  })).optional(),
5390
- /** Search method used to find this result */
5391
- searchMethod: import_zod.z.string().optional(),
5392
6782
  /** Combined RRF score for hybrid search */
5393
- hybridScore: import_zod.z.number().optional(),
6783
+ hybridScore: import_zod.z.number().nullable().optional(),
5394
6784
  /** Vector similarity score (0-1) */
5395
6785
  vectorScore: import_zod.z.number().optional(),
5396
6786
  /** Rank in vector search results */
@@ -5436,22 +6826,80 @@ var temporalMetadata = import_zod.z.object({
5436
6826
  includeExpired: import_zod.z.boolean(),
5437
6827
  /** Whether temporal fields are included in results */
5438
6828
  temporalFieldsIncluded: import_zod.z.boolean()
5439
- }).nullable();
6829
+ });
6830
+ var searchMeta = import_zod.z.lazy(() => import_zod.z.object({
6831
+ /** Total number of results matching the query */
6832
+ total: import_zod.z.number(),
6833
+ /** Current page number (1-based) */
6834
+ page: import_zod.z.number(),
6835
+ /** Number of results per page */
6836
+ pageSize: import_zod.z.number(),
6837
+ /** Search duration in milliseconds */
6838
+ searchTime: import_zod.z.number(),
6839
+ /** Search method used for this query */
6840
+ searchMethod: import_zod.z.string(),
6841
+ /** Temporal query metadata (present when temporal filters are used) */
6842
+ temporalMetadata: temporalMetadata.optional()
6843
+ }));
6844
+ var facetEntry = import_zod.z.object({
6845
+ /** Facet value */
6846
+ value: import_zod.z.string(),
6847
+ /** Number of results with this value */
6848
+ count: import_zod.z.number()
6849
+ });
6850
+ var facets = import_zod.z.lazy(() => import_zod.z.object({
6851
+ /** Topic facet counts (top 20 by frequency) */
6852
+ topics: import_zod.z.array(facetEntry),
6853
+ /** Memory type facet counts */
6854
+ memoryType: import_zod.z.array(facetEntry),
6855
+ /** Effective state facet counts */
6856
+ effectiveState: import_zod.z.array(facetEntry)
6857
+ }));
6858
+ var claimGroupClaim = import_zod.z.object({
6859
+ /** Claim ID */
6860
+ id: import_zod.z.string(),
6861
+ /** Claim content text */
6862
+ content: import_zod.z.string(),
6863
+ /** Memory this claim was extracted from */
6864
+ memoryId: import_zod.z.string(),
6865
+ /** Claim creation timestamp */
6866
+ createdAt: import_zod.z.string(),
6867
+ /** When the claimed event occurred */
6868
+ occurredStart: import_zod.z.string().optional()
6869
+ });
6870
+ var claimGroupSignals = import_zod.z.object({
6871
+ /** Number of claims in this group */
6872
+ n_claims: import_zod.z.number(),
6873
+ /** Minimum LLM-judged alignment score among all pairs in the group (0=conflict, 1=corroborate) */
6874
+ alignment_min: import_zod.z.number(),
6875
+ /** Days between earliest and latest claim in the group */
6876
+ temporal_spread_days: import_zod.z.number(),
6877
+ /** True if alignment_min < 0.85, indicating potential conflict */
6878
+ has_low_alignment_pair: import_zod.z.boolean(),
6879
+ /** True if alignment_min < 0.4 — claims directly conflict or one supersedes the other */
6880
+ has_conflict: import_zod.z.boolean(),
6881
+ /** True if temporal_spread_days > 30 */
6882
+ has_temporal_spread: import_zod.z.boolean()
6883
+ });
6884
+ var claimGroup = import_zod.z.lazy(() => import_zod.z.object({
6885
+ /** Deterministic group ID */
6886
+ id: import_zod.z.string(),
6887
+ /** Claims in this group, sorted by createdAt descending (newest first) */
6888
+ claims: import_zod.z.array(claimGroupClaim),
6889
+ /** Computed signals about the claim cluster */
6890
+ signals: claimGroupSignals
6891
+ }));
5440
6892
  var searchResponse = import_zod.z.lazy(() => import_zod.z.object({
5441
- /** Search results with metadata */
6893
+ /** Flattened search results with memory fields and search metadata */
5442
6894
  data: import_zod.z.array(searchResult),
5443
- /** Search method used for this query */
5444
- searchMethod: import_zod.z.string().optional(),
5445
- pagination: import_zod.z.object({
5446
- /** Maximum number of items per page */
5447
- limit: import_zod.z.number().min(1),
5448
- /** Number of items to skip */
5449
- offset: import_zod.z.number().min(0),
5450
- /** Total number of items */
5451
- count: import_zod.z.number().min(0)
5452
- }),
5453
- /** Temporal query metadata (null for semantic/hybrid search) */
5454
- temporalMetadata
6895
+ /** Search metadata including pagination, timing, and method */
6896
+ meta: searchMeta,
6897
+ /** Facet aggregations (only present when includeFacets=true) */
6898
+ facets: facets.optional(),
6899
+ /** Reader instructions for interpreting claims and resolving conflicts */
6900
+ instructions: import_zod.z.string().optional(),
6901
+ /** Clusters of related claims that may conflict. Only present when relevant groups exist. Claims within each group are sorted newest-first. */
6902
+ claim_groups: import_zod.z.array(claimGroup).optional()
5455
6903
  }));
5456
6904
  var fact = import_zod.z.object({
5457
6905
  /** Unique identifier for the fact */
@@ -5528,8 +6976,8 @@ var entityNode = import_zod.z.object({
5528
6976
  name: import_zod.z.string(),
5529
6977
  /** Normalized (lowercase) name for deduplication */
5530
6978
  normalizedName: import_zod.z.string(),
5531
- /** Entity type classification */
5532
- type: import_zod.z.enum(["PERSON", "PROJECT", "TECHNOLOGY", "COMPONENT", "API_ENDPOINT", "FILE", "CONCEPT", "ORGANIZATION", "LOCATION"]),
6979
+ /** Entity type classification (v2: PERSON, ORGANIZATION, CONCEPT; legacy types accepted) */
6980
+ type: import_zod.z.enum(["PERSON", "ORGANIZATION", "CONCEPT", "PROJECT", "TECHNOLOGY", "COMPONENT", "API_ENDPOINT", "FILE", "LOCATION"]),
5533
6981
  /** Alternative names for this entity */
5534
6982
  aliases: import_zod.z.array(import_zod.z.string()).optional(),
5535
6983
  /** Extraction confidence score (0-1) */
@@ -5605,11 +7053,11 @@ var memoryRelationship = import_zod.z.object({
5605
7053
  /** ID of the target memory (the memory being related to) */
5606
7054
  targetMemoryId: import_zod.z.string(),
5607
7055
  /** Type of relationship between memories */
5608
- type: import_zod.z.enum(["SUPERSEDES", "FOLLOWS", "RESOLVES", "CONTRADICTS", "REFERENCES"]),
7056
+ type: import_zod.z.enum(["SUPERSEDES", "FOLLOWS", "RESOLVES", "CONTRADICTS", "REFERENCES", "DUPLICATES"]),
5609
7057
  /** Confidence score for the relationship (0-1) */
5610
7058
  confidence: import_zod.z.number().min(0).max(1),
5611
7059
  /** How the relationship was created */
5612
- creationMethod: import_zod.z.enum(["manual", "auto-semantic", "auto-temporal"]),
7060
+ creationMethod: import_zod.z.enum(["manual", "auto-semantic", "auto-temporal", "auto-llm"]),
5613
7061
  /** Human-readable explanation for why this relationship exists */
5614
7062
  reason: import_zod.z.string().optional(),
5615
7063
  /** When the relationship was created */
@@ -5619,7 +7067,7 @@ var createMemoryRelationshipRequest = import_zod.z.object({
5619
7067
  /** ID of the target memory to create a relationship with */
5620
7068
  targetMemoryId: import_zod.z.string().min(1),
5621
7069
  /** Type of relationship between memories */
5622
- type: import_zod.z.enum(["SUPERSEDES", "FOLLOWS", "RESOLVES", "CONTRADICTS", "REFERENCES"]),
7070
+ type: import_zod.z.enum(["SUPERSEDES", "FOLLOWS", "RESOLVES", "CONTRADICTS", "REFERENCES", "DUPLICATES"]),
5623
7071
  /** Confidence score for the relationship (0-1, defaults to 1.0 for manual) */
5624
7072
  confidence: import_zod.z.number().min(0).max(1).optional(),
5625
7073
  /** Optional explanation for the relationship */
@@ -5680,7 +7128,7 @@ var addMemoryToNarrativeRequest = import_zod.z.object({
5680
7128
  /** Position in the narrative (0-indexed, omit for append) */
5681
7129
  position: import_zod.z.number().min(0).optional()
5682
7130
  });
5683
- var narrativeMemory = import_zod.z.object({
7131
+ var narrativeMemory = import_zod.z.lazy(() => import_zod.z.object({
5684
7132
  memory: import_zod.z.object({
5685
7133
  /** Unique memory identifier */
5686
7134
  id: import_zod.z.string(),
@@ -5704,6 +7152,8 @@ var narrativeMemory = import_zod.z.object({
5704
7152
  validFrom: import_zod.z.string().datetime().optional(),
5705
7153
  /** Validity end time (when this fact expires, null means never expires) */
5706
7154
  validTo: import_zod.z.string().datetime().nullable().optional(),
7155
+ /** Environment context for memory scoping — product, service, team, component, role. */
7156
+ codeContext: codeContext.optional(),
5707
7157
  /** Creation timestamp */
5708
7158
  createdAt: import_zod.z.string().datetime(),
5709
7159
  /** Last update timestamp */
@@ -5713,23 +7163,57 @@ var narrativeMemory = import_zod.z.object({
5713
7163
  /** Basis for the confidence score */
5714
7164
  confidenceBasis: import_zod.z.enum(["direct-statement", "repeated-mention", "single-mention", "hedged", "inference", "external-source", "contradicted"]).optional(),
5715
7165
  /** Effective state of the memory in the narrative */
5716
- effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional(),
5717
- /** Status of automatic content extraction */
5718
- extractionStatus: import_zod.z.enum(["pending", "completed", "failed", "skipped"]).optional(),
7166
+ effectiveState: import_zod.z.enum(["current", "superseded", "contradicted", "duplicate"]).optional(),
7167
+ /** Authority level: directive (mandates) > decision (choices with reasoning) > observation (learned during work) > auto-captured (generated content) */
7168
+ authority: import_zod.z.enum(["directive", "decision", "observation", "auto-captured"]).optional(),
7169
+ /** Legacy aggregate extraction status. DERIVED on read from the six per-stage statuses (contentEmbeddingStatus, summaryStatus, questionsStatus, summaryEmbeddingStatus, questionsEmbeddingStatus, graphStatus). Preserved for SDK compatibility per PRD memory-creation-pipeline-v2 §5 Q7. */
7170
+ extractionStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
5719
7171
  /** When extraction was completed */
5720
7172
  extractionCompletedAt: import_zod.z.string().datetime().optional(),
7173
+ /** Pipeline 2 content-embedding stage status. Tracks the queue lifecycle for writing m.embedding (primary content embedding). */
7174
+ contentEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7175
+ /** AI-generated summary of the memory content */
7176
+ summary: import_zod.z.string().optional(),
7177
+ /** Pipeline 1 summary stage status. Tracks generation of m.summary by the summary-qna LLM call. */
7178
+ summaryStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7179
+ /** Pipeline 1 questions stage status. Tracks generation of anticipated Question nodes by the summary-qna LLM call. */
7180
+ questionsStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7181
+ /** Pipeline 2 summary-embedding stage status. Tracks the queue lifecycle for writing m.summaryEmbedding (depends on summaryStatus=completed). */
7182
+ summaryEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7183
+ /** Pipeline 2 question-embedding stage status. Tracks the queue lifecycle for writing Question.embedding for each anticipated question (depends on questionsStatus=completed). */
7184
+ questionsEmbeddingStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7185
+ /** Pipeline 3 graph-extraction stage status. Tracks generation of entities, facts, topics, authority, and memory-type. Replaces the role formerly played by the monolithic extractionStatus writer. */
7186
+ graphStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).optional(),
7187
+ /** When graphStatus=skipped, records why graph extraction was skipped. Mirrors the legacy extractionSkipReason field but scoped to the graph pipeline. */
7188
+ graphSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
7189
+ /** When extractionStatus=skipped, records why extraction was skipped. global_disabled = GRAPH_EXTRACTION_ENABLED=false kill switch. */
7190
+ extractionSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy"]).optional(),
7191
+ /** Status of primary (Ollama) embedding generation via durable queue */
7192
+ embeddingStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
7193
+ /** Status of secondary (OpenAI) dual-write embedding generation via durable queue */
7194
+ embeddingOpenaiStatus: import_zod.z.enum(["queued", "running", "completed", "failed", "skipped"]).optional(),
7195
+ /** True if the primary content embedding used a head-truncated input (model context exceeded). */
7196
+ embeddingTruncated: import_zod.z.boolean().optional(),
7197
+ /** Token count of the original content (pre-truncation, cl100k proxy). Useful for identifying under-indexed memories. */
7198
+ embeddingOriginalTokens: import_zod.z.number().min(0).optional(),
7199
+ /** Smart-field strategy used to produce the primary content embedding. */
7200
+ embeddingStrategy: import_zod.z.enum(["full", "head-truncated", "summary-selected", "question-selected"]).optional(),
5721
7201
  /** Number of topics extracted from content */
5722
7202
  extractedTopicCount: import_zod.z.number().min(0).optional(),
5723
7203
  /** Number of facts extracted from content */
5724
7204
  extractedFactCount: import_zod.z.number().min(0).optional(),
5725
7205
  /** Number of entities extracted from content */
5726
7206
  extractedEntityCount: import_zod.z.number().min(0).optional(),
7207
+ /** Number of memories this memory contradicts via outgoing CONTRADICTS relationships */
7208
+ conflictCount: import_zod.z.number().min(0).optional(),
7209
+ /** Memory visibility level. Null/undefined treated as 'private' for backward compatibility. 'admin_visible' is computed at retrieval time when an org owner/admin queries another member's post-join memory and is never accepted on writes. */
7210
+ visibility: import_zod.z.enum(["private", "shared_with_users", "shared_with_org", "admin_visible"]).optional(),
7211
+ /** User IDs this memory is shared with (only populated when visibility = 'shared_with_users') */
7212
+ sharedWith: import_zod.z.array(import_zod.z.string()).optional(),
5727
7213
  /** Topics explicitly provided by the user */
5728
7214
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5729
7215
  /** Topics automatically extracted from content */
5730
7216
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5731
- /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5732
- agentSessionId: import_zod.z.string().nullable().optional(),
5733
7217
  /** Entities extracted from memory content */
5734
7218
  entities: import_zod.z.array(import_zod.z.object({
5735
7219
  /** Entity name */
@@ -5738,13 +7222,27 @@ var narrativeMemory = import_zod.z.object({
5738
7222
  type: import_zod.z.string(),
5739
7223
  /** Extraction confidence */
5740
7224
  confidence: import_zod.z.number().min(0).max(1).optional()
5741
- })).optional()
7225
+ })).optional(),
7226
+ /** Task identifier for agentic loop memories */
7227
+ taskId: import_zod.z.string().nullable().optional(),
7228
+ /** Task outcome status */
7229
+ outcome: import_zod.z.enum(["resolved", "unresolved"]).nullable().optional(),
7230
+ /** Attempt number within the task */
7231
+ attemptNumber: import_zod.z.number().nullable().optional(),
7232
+ /** Distillation pipeline stage status */
7233
+ distillStatus: import_zod.z.enum(["pending", "queued", "running", "completed", "failed", "skipped"]).nullable().optional(),
7234
+ /** Reason distillation was skipped */
7235
+ distillSkipReason: import_zod.z.enum(["global_disabled", "plan_excluded", "user_opt_out", "content_too_short", "legacy", "budget_exhausted"]).nullable().optional(),
7236
+ /** Error message if distillation failed */
7237
+ distillError: import_zod.z.string().nullable().optional(),
7238
+ /** ISO 8601 timestamp when distillation completed */
7239
+ distillCompletedAt: import_zod.z.string().nullable().optional()
5742
7240
  }),
5743
7241
  /** Position of this memory in the narrative (0-indexed) */
5744
7242
  position: import_zod.z.number().min(0),
5745
7243
  /** Effective state of this memory in the narrative context */
5746
7244
  effectiveState: import_zod.z.enum(["current", "superseded", "contradicted"]).optional()
5747
- });
7245
+ }));
5748
7246
  var narrativeTimelineResponse = import_zod.z.lazy(() => import_zod.z.object({
5749
7247
  data: import_zod.z.array(narrativeMemory),
5750
7248
  narrative: narrativeThread,
@@ -5931,7 +7429,7 @@ var listPaymentMethodsResponse = import_zod.z.lazy(() => import_zod.z.object({
5931
7429
  }));
5932
7430
  var digestRequest = import_zod.z.object({
5933
7431
  /** The topic or subject to generate a digest for */
5934
- query: import_zod.z.string().min(1),
7432
+ query: import_zod.z.string().min(1).max(2e3),
5935
7433
  /** Time window filter (e.g., "7d", "24h", "2w", "30m"). Only considers memories within this window. */
5936
7434
  recent: import_zod.z.string().optional(),
5937
7435
  /** Filter to memories with these topics */
@@ -5943,7 +7441,9 @@ var digestRequest = import_zod.z.object({
5943
7441
  /** Maximum number of memories to consider (1-500, default 100) */
5944
7442
  maxSources: import_zod.z.number().min(1).max(500).optional(),
5945
7443
  /** Whether to include source memory IDs in the response */
5946
- includeMemoryIds: import_zod.z.boolean().optional()
7444
+ includeMemoryIds: import_zod.z.boolean().optional(),
7445
+ /** Number of most-recent matching memories to return VERBATIM (full stored content, untouched) in `recentMemories`, instead of synthesizing them into `digest`. The remaining (older) memories are still synthesized into `digest` as usual. Recency is determined by event time when present, else system timestamp, else creation time. Default 0 = current behavior (synthesize all memories, `recentMemories` empty). When the total matched count is <= verbatimRecent, all matches are returned in `recentMemories` and `digest` is an empty string (no older memories to synthesize). Range 0-50. */
7446
+ verbatimRecent: import_zod.z.number().min(0).max(50).optional()
5947
7447
  });
5948
7448
  var digestTimeRange = import_zod.z.object({
5949
7449
  /** Earliest memory timestamp in the digest sources */
@@ -5964,6 +7464,12 @@ var digestMetadata = import_zod.z.lazy(() => import_zod.z.object({
5964
7464
  timeRange: digestTimeRange,
5965
7465
  /** Output format used for this digest */
5966
7466
  format: import_zod.z.enum(["structured", "narrative", "timeline", "status-report"]),
7467
+ /** Average relevance score (0-1) of the source memories used in synthesis. Low values (<0.02) indicate the query may not have strong matches. */
7468
+ averageRelevance: import_zod.z.number().min(0).max(1).optional(),
7469
+ /** True when averageRelevance falls in the narrow-window band (>= DIGEST_RELEVANCE_THRESHOLD but < NARROW_WINDOW_FALLBACK_CEILING) — the digest synthesised from weak matches that may not represent strong context. Consumers should surface a warning to the calling agent. */
7470
+ narrowWindowFallback: import_zod.z.boolean().optional(),
7471
+ /** True when the digest is in the narrow-window band AND the source memories span 2+ distinct codeContext.product values (or none share a product). Indicates the synthesis is drawn from heterogeneous, possibly cross-project sources — likely the wrong project for the calling agent. See support#183. */
7472
+ crossProjectFallback: import_zod.z.boolean().optional(),
5967
7473
  /** ISO 8601 timestamp when the digest was generated */
5968
7474
  generatedAt: import_zod.z.string().datetime(),
5969
7475
  /** Recursion stats (only present when recursive synthesis is used) */
@@ -6017,6 +7523,8 @@ var digestResponse = import_zod.z.lazy(() => import_zod.z.object({
6017
7523
  metadata: digestMetadata,
6018
7524
  /** Source memories used to generate the digest, for traceability */
6019
7525
  sources: import_zod.z.array(digestSource),
7526
+ /** The N most-recent matching memories returned VERBATIM (full stored content, untouched), where N = the request's verbatimRecent. Ordered newest-first. Empty/omitted when verbatimRecent is 0 (the default). These memories are NOT synthesized into `digest` — the synthesis covers only the older remainder. Lets callers preserve the exact structure of recent items (per-item status, identifiers, next-step) while still condensing the older tail. */
7527
+ recentMemories: import_zod.z.array(memory).optional(),
6020
7528
  /** Top extracted facts relevant to the digest, deduplicated and ranked by frequency */
6021
7529
  keyFacts: import_zod.z.array(digestKeyFact).optional(),
6022
7530
  /** Key entities mentioned across source memories */
@@ -6024,6 +7532,84 @@ var digestResponse = import_zod.z.lazy(() => import_zod.z.object({
6024
7532
  /** Breakdown of source memories by effective state (current/superseded/contradicted) */
6025
7533
  effectiveStateBreakdown: effectiveStateBreakdown.optional()
6026
7534
  }));
7535
+ var exportRequest = import_zod.z.object({
7536
+ /** Optional search query to filter memories for export */
7537
+ query: import_zod.z.string().max(2e3).optional(),
7538
+ /** Filter by topics */
7539
+ topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional(),
7540
+ /** Filter by memory type */
7541
+ memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]).optional(),
7542
+ /** Export format: json or csv (default: json) */
7543
+ format: import_zod.z.enum(["json", "csv"]).optional(),
7544
+ /** Optional field selection. If omitted, all standard fields are included. */
7545
+ fields: import_zod.z.array(import_zod.z.string().max(50)).max(20).optional(),
7546
+ /** Maximum results to export (default 100, max 1000) */
7547
+ limit: import_zod.z.number().min(1).max(1e3).optional()
7548
+ });
7549
+ var bulkUpdateRequest = import_zod.z.object({
7550
+ /** Memory IDs to update (max 100) */
7551
+ ids: import_zod.z.array(import_zod.z.string().min(1)).min(1).max(100),
7552
+ /** Fields to update on all specified memories */
7553
+ updates: import_zod.z.object({
7554
+ /** Replace topics on all specified memories */
7555
+ topics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional(),
7556
+ /** Set memory type on all specified memories */
7557
+ memoryType: import_zod.z.enum(["episodic", "semantic", "procedural"]).optional()
7558
+ })
7559
+ });
7560
+ var bulkUpdateResponse = import_zod.z.object({
7561
+ /** Number of memories successfully updated */
7562
+ updated: import_zod.z.number(),
7563
+ /** Number of memories that failed to update */
7564
+ failed: import_zod.z.number(),
7565
+ /** Per-item error details */
7566
+ errors: import_zod.z.array(import_zod.z.object({
7567
+ /** Memory ID that failed */
7568
+ id: import_zod.z.string(),
7569
+ /** Error message */
7570
+ error: import_zod.z.string()
7571
+ }))
7572
+ });
7573
+ var bulkDeleteRequest = import_zod.z.object({
7574
+ /** Memory IDs to delete (max 100) */
7575
+ ids: import_zod.z.array(import_zod.z.string().min(1)).min(1).max(100),
7576
+ /** Must be true to confirm bulk deletion */
7577
+ confirmDeletion: import_zod.z.literal(true)
7578
+ });
7579
+ var bulkDeleteResponse = import_zod.z.object({
7580
+ /** Number of memories successfully deleted */
7581
+ deleted: import_zod.z.number(),
7582
+ /** Number of memories that failed to delete */
7583
+ failed: import_zod.z.number(),
7584
+ /** Per-item error details */
7585
+ errors: import_zod.z.array(import_zod.z.object({
7586
+ /** Memory ID that failed */
7587
+ id: import_zod.z.string(),
7588
+ /** Error message */
7589
+ error: import_zod.z.string()
7590
+ }))
7591
+ });
7592
+ var bulkTagRequest = import_zod.z.object({
7593
+ /** Memory IDs to modify tags on (max 100) */
7594
+ ids: import_zod.z.array(import_zod.z.string().min(1)).min(1).max(100),
7595
+ /** Topics to add to all specified memories */
7596
+ addTopics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional(),
7597
+ /** Topics to remove from all specified memories */
7598
+ removeTopics: import_zod.z.array(import_zod.z.string().max(100)).max(50).optional()
7599
+ });
7600
+ var bulkTagResponse = import_zod.z.object({
7601
+ /** Number of memories successfully modified */
7602
+ modified: import_zod.z.number(),
7603
+ /** Number of memories that failed to modify */
7604
+ failed: import_zod.z.number(),
7605
+ /** Per-item error details */
7606
+ errors: import_zod.z.array(import_zod.z.object({
7607
+ /** Memory ID that failed */
7608
+ id: import_zod.z.string(),
7609
+ /** Error message */
7610
+ error: import_zod.z.string()
7611
+ }))
7612
+ });
6027
7613
  var buildContextRequest = import_zod.z.object({
6028
7614
  /** What you are about to work on */
6029
7615
  context: import_zod.z.string().min(1).max(2e3),
@@ -6089,7 +7675,9 @@ var buildContextMeta = import_zod.z.object({
6089
7675
  /** Search terms extracted from the context and files */
6090
7676
  contextTerms: import_zod.z.array(import_zod.z.string()),
6091
7677
  /** Hours window used for recent activity */
6092
- recentHours: import_zod.z.number()
7678
+ recentHours: import_zod.z.number(),
7679
+ /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
7680
+ timedOutSections: import_zod.z.array(import_zod.z.string()).optional()
6093
7681
  });
6094
7682
  var buildContextResponse = import_zod.z.lazy(() => import_zod.z.object({
6095
7683
  /** Most relevant active conversation, or null if none found */
@@ -6105,6 +7693,39 @@ var buildContextResponse = import_zod.z.lazy(() => import_zod.z.object({
6105
7693
  /** Request metadata for transparency */
6106
7694
  meta: buildContextMeta
6107
7695
  }));
7696
+ var systemAlert = import_zod.z.object({
7697
+ id: import_zod.z.string().uuid(),
7698
+ title: import_zod.z.string().min(1).max(120),
7699
+ body: import_zod.z.string().min(1).max(2e3),
7700
+ severity: import_zod.z.enum(["info", "warning", "critical"]),
7701
+ active: import_zod.z.boolean().optional(),
7702
+ dismissible: import_zod.z.boolean().optional(),
7703
+ targetAllUsers: import_zod.z.boolean().optional(),
7704
+ targetUserIds: import_zod.z.array(import_zod.z.string()).optional(),
7705
+ createdAt: import_zod.z.string().datetime(),
7706
+ expiresAt: import_zod.z.string().datetime().nullable(),
7707
+ createdBy: import_zod.z.string()
7708
+ });
7709
+ var createSystemAlertRequest = import_zod.z.object({
7710
+ title: import_zod.z.string().min(1).max(120),
7711
+ body: import_zod.z.string().min(1).max(2e3),
7712
+ severity: import_zod.z.enum(["info", "warning", "critical"]).optional(),
7713
+ active: import_zod.z.boolean().optional(),
7714
+ dismissible: import_zod.z.boolean().optional(),
7715
+ targetAllUsers: import_zod.z.boolean().optional(),
7716
+ targetUserIds: import_zod.z.array(import_zod.z.string().uuid()).max(1e3).optional(),
7717
+ expiresAt: import_zod.z.string().datetime().nullable().optional()
7718
+ });
7719
+ var updateSystemAlertRequest = import_zod.z.object({
7720
+ title: import_zod.z.string().min(1).max(120).optional(),
7721
+ body: import_zod.z.string().min(1).max(2e3).optional(),
7722
+ severity: import_zod.z.enum(["info", "warning", "critical"]).optional(),
7723
+ active: import_zod.z.boolean().optional(),
7724
+ dismissible: import_zod.z.boolean().optional(),
7725
+ targetAllUsers: import_zod.z.boolean().optional(),
7726
+ targetUserIds: import_zod.z.array(import_zod.z.string().uuid()).max(1e3).optional(),
7727
+ expiresAt: import_zod.z.string().datetime().nullable().optional()
7728
+ });
6108
7729
 
6109
7730
  // src/index.ts
6110
7731
  var Memnexus = class {
@@ -6119,6 +7740,8 @@ var Memnexus = class {
6119
7740
  patterns;
6120
7741
  /** Behavioral pattern tracking and state management endpoints operations */
6121
7742
  behavior;
7743
+ /** Behavioral recommendation management endpoints (v2) operations */
7744
+ recommendations;
6122
7745
  /** Narrative thread management endpoints operations */
6123
7746
  narratives;
6124
7747
  /** Observability and metrics endpoints for production monitoring operations */
@@ -6143,8 +7766,14 @@ var Memnexus = class {
6143
7766
  artifacts;
6144
7767
  /** API key management endpoints operations */
6145
7768
  apiKeys;
7769
+ /** System alerts banner endpoints (customer portal) operations */
7770
+ alerts;
6146
7771
  /** Admin management endpoints for invite codes and platform configuration operations */
6147
7772
  admin;
7773
+ /** Admin endpoints for managing system alerts operations */
7774
+ adminAlerts;
7775
+ /** Admin Pipeline operations */
7776
+ adminPipeline;
6148
7777
  /**
6149
7778
  * Create a new SDK client.
6150
7779
  * @param config - SDK configuration
@@ -6159,6 +7788,7 @@ var Memnexus = class {
6159
7788
  this.system = new SystemService(this.config);
6160
7789
  this.patterns = new PatternsService(this.config);
6161
7790
  this.behavior = new BehaviorService(this.config);
7791
+ this.recommendations = new RecommendationsService(this.config);
6162
7792
  this.narratives = new NarrativesService(this.config);
6163
7793
  this.monitoring = new MonitoringService(this.config);
6164
7794
  this.memories = new MemoriesService(this.config);
@@ -6171,7 +7801,10 @@ var Memnexus = class {
6171
7801
  this.billing = new BillingService(this.config);
6172
7802
  this.artifacts = new ArtifactsService(this.config);
6173
7803
  this.apiKeys = new ApiKeysService(this.config);
7804
+ this.alerts = new AlertsService(this.config);
6174
7805
  this.admin = new AdminService(this.config);
7806
+ this.adminAlerts = new AdminAlertsService(this.config);
7807
+ this.adminPipeline = new AdminPipelineService(this.config);
6175
7808
  }
6176
7809
  /**
6177
7810
  * Set the API token for authentication.
@@ -6184,6 +7817,7 @@ var Memnexus = class {
6184
7817
  this.system.token = token;
6185
7818
  this.patterns.token = token;
6186
7819
  this.behavior.token = token;
7820
+ this.recommendations.token = token;
6187
7821
  this.narratives.token = token;
6188
7822
  this.monitoring.token = token;
6189
7823
  this.memories.token = token;
@@ -6196,7 +7830,10 @@ var Memnexus = class {
6196
7830
  this.billing.token = token;
6197
7831
  this.artifacts.token = token;
6198
7832
  this.apiKeys.token = token;
7833
+ this.alerts.token = token;
6199
7834
  this.admin.token = token;
7835
+ this.adminAlerts.token = token;
7836
+ this.adminPipeline.token = token;
6200
7837
  }
6201
7838
  /**
6202
7839
  * Set the base URL for API requests.
@@ -6209,6 +7846,7 @@ var Memnexus = class {
6209
7846
  this.system.baseUrl = baseUrl;
6210
7847
  this.patterns.baseUrl = baseUrl;
6211
7848
  this.behavior.baseUrl = baseUrl;
7849
+ this.recommendations.baseUrl = baseUrl;
6212
7850
  this.narratives.baseUrl = baseUrl;
6213
7851
  this.monitoring.baseUrl = baseUrl;
6214
7852
  this.memories.baseUrl = baseUrl;
@@ -6221,7 +7859,10 @@ var Memnexus = class {
6221
7859
  this.billing.baseUrl = baseUrl;
6222
7860
  this.artifacts.baseUrl = baseUrl;
6223
7861
  this.apiKeys.baseUrl = baseUrl;
7862
+ this.alerts.baseUrl = baseUrl;
6224
7863
  this.admin.baseUrl = baseUrl;
7864
+ this.adminAlerts.baseUrl = baseUrl;
7865
+ this.adminPipeline.baseUrl = baseUrl;
6225
7866
  }
6226
7867
  /**
6227
7868
  * Set the environment.
@@ -6234,6 +7875,7 @@ var Memnexus = class {
6234
7875
  this.system.environment = environment;
6235
7876
  this.patterns.environment = environment;
6236
7877
  this.behavior.environment = environment;
7878
+ this.recommendations.environment = environment;
6237
7879
  this.narratives.environment = environment;
6238
7880
  this.monitoring.environment = environment;
6239
7881
  this.memories.environment = environment;
@@ -6246,13 +7888,19 @@ var Memnexus = class {
6246
7888
  this.billing.environment = environment;
6247
7889
  this.artifacts.environment = environment;
6248
7890
  this.apiKeys.environment = environment;
7891
+ this.alerts.environment = environment;
6249
7892
  this.admin.environment = environment;
7893
+ this.adminAlerts.environment = environment;
7894
+ this.adminPipeline.environment = environment;
6250
7895
  }
6251
7896
  };
6252
7897
  var index_default = Memnexus;
6253
7898
  // Annotate the CommonJS export names for ESM import in node:
6254
7899
  0 && (module.exports = {
7900
+ AdminAlertsService,
7901
+ AdminPipelineService,
6255
7902
  AdminService,
7903
+ AlertsService,
6256
7904
  ApiKeysService,
6257
7905
  ArtifactsService,
6258
7906
  BehaviorService,
@@ -6270,6 +7918,7 @@ var index_default = Memnexus;
6270
7918
  MonitoringService,
6271
7919
  NarrativesService,
6272
7920
  PatternsService,
7921
+ RecommendationsService,
6273
7922
  SdkError,
6274
7923
  SerializationStyle,
6275
7924
  SystemService,
@@ -6290,8 +7939,20 @@ var index_default = Memnexus;
6290
7939
  buildContextPattern,
6291
7940
  buildContextRequest,
6292
7941
  buildContextResponse,
7942
+ bulkDeleteRequest,
7943
+ bulkDeleteResponse,
7944
+ bulkTagRequest,
7945
+ bulkTagResponse,
7946
+ bulkUpdateRequest,
7947
+ bulkUpdateResponse,
6293
7948
  checkoutSessionResponse,
7949
+ claimGroup,
7950
+ claimGroupClaim,
7951
+ claimGroupSignals,
7952
+ codeContext,
6294
7953
  community,
7954
+ compileInstructionsRequest,
7955
+ compileInstructionsResponse,
6295
7956
  conversation,
6296
7957
  createArtifactRequest,
6297
7958
  createCheckoutSessionRequest,
@@ -6303,6 +7964,8 @@ var index_default = Memnexus;
6303
7964
  createMemoryResponseMeta,
6304
7965
  createNarrativeRequest,
6305
7966
  createPortalSessionRequest,
7967
+ createRecommendationRequest,
7968
+ createSystemAlertRequest,
6306
7969
  digestEntity,
6307
7970
  digestKeyFact,
6308
7971
  digestMetadata,
@@ -6314,6 +7977,9 @@ var index_default = Memnexus;
6314
7977
  entity,
6315
7978
  entityNode,
6316
7979
  error,
7980
+ exportRequest,
7981
+ facetEntry,
7982
+ facets,
6317
7983
  fact,
6318
7984
  factSearchRequest,
6319
7985
  getMemoryResponse,
@@ -6325,6 +7991,7 @@ var index_default = Memnexus;
6325
7991
  listInvoicesResponse,
6326
7992
  listNarrativesResponse,
6327
7993
  listPaymentMethodsResponse,
7994
+ matchRecommendationsRequest,
6328
7995
  memory,
6329
7996
  memoryRelationship,
6330
7997
  memoryRelationshipsResponse,
@@ -6336,20 +8003,24 @@ var index_default = Memnexus;
6336
8003
  pattern,
6337
8004
  paymentMethod,
6338
8005
  portalSessionResponse,
8006
+ precomputedMemoryFields,
8007
+ recommendation,
6339
8008
  relatedMemoryResult,
8009
+ searchMeta,
6340
8010
  searchRequest,
6341
8011
  searchResponse,
6342
8012
  searchResult,
6343
8013
  serviceCheck,
6344
8014
  subscription,
8015
+ systemAlert,
6345
8016
  temporalMetadata,
6346
8017
  topic,
6347
- topicReference,
6348
8018
  updateArtifactRequest,
6349
8019
  updateFactRequest,
6350
8020
  updateMemoryRequest,
6351
8021
  updateNamedMemoryRequest,
6352
8022
  updateNarrativeRequest,
8023
+ updateSystemAlertRequest,
6353
8024
  user,
6354
8025
  userUsage
6355
8026
  });