@remnic/core 9.69.77 → 9.69.79

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.
Files changed (211) hide show
  1. package/dist/access-admin-ops-surface.js +12 -12
  2. package/dist/access-authorization-probe.js +13 -13
  3. package/dist/access-boundary.js +12 -12
  4. package/dist/access-cli.js +53 -53
  5. package/dist/access-extraction-force-flush.js +12 -12
  6. package/dist/access-http-briefing.js +13 -13
  7. package/dist/access-http-lcm-compaction.d.ts +2 -1
  8. package/dist/access-http-lcm-compaction.d.ts.map +1 -1
  9. package/dist/access-http-lcm-compaction.js +1 -1
  10. package/dist/access-http-lifecycle-flush.d.ts.map +1 -1
  11. package/dist/access-http-lifecycle-flush.js +2 -2
  12. package/dist/access-http-query.js +14 -14
  13. package/dist/access-http.js +30 -30
  14. package/dist/access-identity-continuity-surface.js +12 -12
  15. package/dist/access-lcm-surface.js +12 -12
  16. package/dist/access-mcp.js +21 -21
  17. package/dist/access-namespace-preflight.js +12 -12
  18. package/dist/access-observe-write-surface.js +12 -12
  19. package/dist/access-operations-batch.js +13 -13
  20. package/dist/access-operations.js +20 -20
  21. package/dist/access-recall-concurrency.js +12 -12
  22. package/dist/access-recall-response.js +12 -12
  23. package/dist/access-recall-surface.js +12 -12
  24. package/dist/access-service-helpers.d.ts +1 -0
  25. package/dist/access-service-helpers.d.ts.map +1 -1
  26. package/dist/access-service-helpers.js +1 -1
  27. package/dist/access-service.js +12 -12
  28. package/dist/access-surface-catalog.js +14 -14
  29. package/dist/active-recall.js +2 -2
  30. package/dist/briefing.js +2 -2
  31. package/dist/causal-consolidation.js +3 -3
  32. package/dist/{chunk-TIDEL77O.js → chunk-2BPPGNAQ.js} +4 -3
  33. package/dist/chunk-2BPPGNAQ.js.map +1 -0
  34. package/dist/{chunk-3AGCSD42.js → chunk-3GN2PEOT.js} +2 -2
  35. package/dist/{chunk-RGX4DGOG.js → chunk-3XQYM4RE.js} +2 -2
  36. package/dist/{chunk-GATQP7CE.js → chunk-4V44AA7O.js} +2 -2
  37. package/dist/{chunk-RRMIACBG.js → chunk-55FCXCXJ.js} +7 -3
  38. package/dist/{chunk-RRMIACBG.js.map → chunk-55FCXCXJ.js.map} +1 -1
  39. package/dist/{chunk-2L5FSNPC.js → chunk-5FNZ3G6X.js} +40 -11
  40. package/dist/chunk-5FNZ3G6X.js.map +1 -0
  41. package/dist/{chunk-7QXTCONH.js → chunk-7QK5TUTW.js} +2 -2
  42. package/dist/{chunk-OJ3TV57W.js → chunk-7UUKRS3J.js} +2 -2
  43. package/dist/{chunk-DCPAAAIC.js → chunk-AXDOF4VI.js} +2 -2
  44. package/dist/{chunk-RKTT72XV.js → chunk-B47OHVFT.js} +4 -4
  45. package/dist/chunk-B47OHVFT.js.map +1 -0
  46. package/dist/{chunk-NYZRJW5X.js → chunk-BJX3VQWZ.js} +2 -2
  47. package/dist/{chunk-3QL24R5Y.js → chunk-C2WWQ4OR.js} +1 -1
  48. package/dist/chunk-C2WWQ4OR.js.map +1 -0
  49. package/dist/{chunk-CDEI5S5W.js → chunk-C7JAUNFC.js} +2 -2
  50. package/dist/{chunk-MQQPONTM.js → chunk-CK5U7JGH.js} +2 -2
  51. package/dist/{chunk-RDUM6BKQ.js → chunk-CRKWSSS4.js} +2 -2
  52. package/dist/{chunk-XNYTMLPS.js → chunk-DGAWEJVI.js} +2 -2
  53. package/dist/{chunk-GZ3R6XOE.js → chunk-DJSJ4ULL.js} +22 -12
  54. package/dist/chunk-DJSJ4ULL.js.map +1 -0
  55. package/dist/{chunk-SUSMEKBE.js → chunk-EU3N5MK3.js} +3 -3
  56. package/dist/{chunk-QJAGDPY7.js → chunk-FYAU4S6E.js} +3 -3
  57. package/dist/{chunk-LEP46X5Y.js → chunk-GEX5NI36.js} +2 -2
  58. package/dist/{chunk-X3NZ2HAO.js → chunk-GZAGLCQH.js} +2 -2
  59. package/dist/{chunk-AVO2CBIL.js → chunk-HKFJ3PF3.js} +2 -2
  60. package/dist/{chunk-K2SXIWEV.js → chunk-IA3X2Y4K.js} +2 -2
  61. package/dist/{chunk-QIDMGBUY.js → chunk-IMAP236M.js} +2 -2
  62. package/dist/{chunk-OHRIBMSS.js → chunk-JS3S2HVG.js} +2 -2
  63. package/dist/{chunk-FVK5NQ3V.js → chunk-JVY556FW.js} +2 -2
  64. package/dist/{chunk-3K3PITOE.js → chunk-JXMECXMF.js} +2 -2
  65. package/dist/{chunk-NGFRFDSK.js → chunk-KERNN6BC.js} +2 -2
  66. package/dist/{chunk-LZLJK2IA.js → chunk-L2LBMKSI.js} +5 -5
  67. package/dist/{chunk-NHV6WCM5.js → chunk-ML2MVAEZ.js} +1 -1
  68. package/dist/{chunk-TPDBFYEG.js → chunk-MMCO4SRG.js} +17 -6
  69. package/dist/chunk-MMCO4SRG.js.map +1 -0
  70. package/dist/{chunk-GXQ5GDUH.js → chunk-N3MNDVJO.js} +2 -2
  71. package/dist/{chunk-WGXWZE3K.js → chunk-NAYBHNGN.js} +2 -2
  72. package/dist/{chunk-X33QB7LW.js → chunk-NKFLHW7J.js} +2 -2
  73. package/dist/{chunk-GARVFCV6.js → chunk-NMBX4D7P.js} +2 -2
  74. package/dist/{chunk-A2XDQ3JW.js → chunk-OM5BIPBR.js} +2 -2
  75. package/dist/{chunk-ALOMLIRC.js → chunk-Q5TRJ4BX.js} +26 -21
  76. package/dist/chunk-Q5TRJ4BX.js.map +1 -0
  77. package/dist/{chunk-ZYBLNHUB.js → chunk-QB75LKQQ.js} +3 -3
  78. package/dist/{chunk-2CH6MMO2.js → chunk-RDEUG2M2.js} +5 -5
  79. package/dist/{chunk-5X7ZTLFS.js → chunk-RIEX7NOZ.js} +2 -2
  80. package/dist/{chunk-ZWWF7PI5.js → chunk-S42HZILI.js} +2 -2
  81. package/dist/{chunk-YUAOU2B2.js → chunk-S55WTPFJ.js} +3 -5
  82. package/dist/chunk-S55WTPFJ.js.map +1 -0
  83. package/dist/{chunk-RMG22TH2.js → chunk-SQDKX4RW.js} +2 -2
  84. package/dist/{chunk-2GKLHU2D.js → chunk-SV72F4DS.js} +2 -2
  85. package/dist/{chunk-FMT52ROU.js → chunk-SVZWVZ7E.js} +11 -11
  86. package/dist/chunk-SVZWVZ7E.js.map +1 -0
  87. package/dist/{chunk-6MJGDUC7.js → chunk-T4BE5KJM.js} +3 -3
  88. package/dist/{chunk-7DZHRPCO.js → chunk-T4QGUXCV.js} +2 -2
  89. package/dist/{chunk-IILMR37Z.js → chunk-TEV2JGU5.js} +12 -12
  90. package/dist/{chunk-UKB7ZDKK.js → chunk-TIQZNDZ5.js} +2 -2
  91. package/dist/{chunk-7WO66MKJ.js → chunk-UNJOB4DY.js} +2 -2
  92. package/dist/{chunk-DSQWTXHP.js → chunk-W75BBBSY.js} +8 -8
  93. package/dist/{chunk-YL273SOF.js → chunk-WB2I2EQK.js} +2 -2
  94. package/dist/{chunk-CYCE3L2I.js → chunk-X22B4KTI.js} +18 -18
  95. package/dist/cli.js +42 -42
  96. package/dist/coding/export-okf-codegraph.js +1 -1
  97. package/dist/compounding/engine.js +2 -2
  98. package/dist/config.js +2 -2
  99. package/dist/connectors/codex-materialize-runner.js +2 -2
  100. package/dist/connectors/index.js +2 -2
  101. package/dist/convergence-refresh.js +4 -4
  102. package/dist/corpus-watermark.js +4 -4
  103. package/dist/entity-retrieval.js +2 -2
  104. package/dist/external-wiki-access.js +13 -13
  105. package/dist/extraction.js +2 -2
  106. package/dist/harmonic-retrieval.js +1 -1
  107. package/dist/index.js +53 -53
  108. package/dist/lcm/engine.d.ts +2 -2
  109. package/dist/lcm/engine.d.ts.map +1 -1
  110. package/dist/lcm/engine.js +2 -2
  111. package/dist/lcm/index.js +2 -2
  112. package/dist/lcm/queue.d.ts +1 -1
  113. package/dist/lcm/queue.d.ts.map +1 -1
  114. package/dist/lcm/queue.js +1 -1
  115. package/dist/lifecycle/seed-graduation.d.ts.map +1 -1
  116. package/dist/location/index.js +4 -4
  117. package/dist/maintenance/memory-governance.js +2 -2
  118. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +2 -2
  119. package/dist/maintenance/rebuild-memory-projection.js +3 -3
  120. package/dist/memory-browse-operations.js +13 -13
  121. package/dist/namespaces/migrate.js +3 -3
  122. package/dist/namespaces/storage.js +2 -2
  123. package/dist/operator-doctor-corpus.js +5 -5
  124. package/dist/operator-toolkit.js +11 -11
  125. package/dist/orchestration/lifecycle-policy-coordinator.d.ts.map +1 -1
  126. package/dist/orchestration/maintenance.js +10 -10
  127. package/dist/orchestrator.js +53 -53
  128. package/dist/recall-navigation-operations.js +13 -13
  129. package/dist/recall-navigation.js +12 -12
  130. package/dist/resume-bundles.js +3 -3
  131. package/dist/semantic-consolidation.js +3 -3
  132. package/dist/semantic-rule-promotion.js +2 -2
  133. package/dist/semantic-rule-verifier.js +2 -2
  134. package/dist/source-agent-qualifier.js +2 -2
  135. package/dist/standup/build.js +2 -2
  136. package/dist/storage.d.ts.map +1 -1
  137. package/dist/storage.js +1 -1
  138. package/dist/support-passport/index.js +15 -15
  139. package/dist/transfer/export-okf.js +2 -2
  140. package/dist/verified-recall.js +2 -2
  141. package/dist/who-knows-cli.js +3 -3
  142. package/dist/who-knows.js +2 -2
  143. package/package.json +2 -2
  144. package/src/access-http-extraction-force-flush.test.ts +6 -2
  145. package/src/access-http-lcm-compaction.abort.test.ts +60 -0
  146. package/src/access-http-lcm-compaction.ts +20 -9
  147. package/src/access-http-lifecycle-flush.ts +1 -0
  148. package/src/access-http.test.ts +4 -2
  149. package/src/access-operations-batch.ts +1 -1
  150. package/src/access-service-helpers.ts +1 -0
  151. package/src/access-service.ts +2 -2
  152. package/src/lcm/engine.ts +39 -9
  153. package/src/lcm/queue.test.ts +19 -0
  154. package/src/lcm/queue.ts +16 -5
  155. package/src/lcm-engine.test.ts +72 -0
  156. package/src/lifecycle/seed-graduation.test.ts +124 -0
  157. package/src/lifecycle/seed-graduation.ts +7 -2
  158. package/src/orchestration/lifecycle-policy-coordinator.ts +6 -1
  159. package/src/storage.ts +2 -4
  160. package/dist/chunk-2L5FSNPC.js.map +0 -1
  161. package/dist/chunk-3QL24R5Y.js.map +0 -1
  162. package/dist/chunk-ALOMLIRC.js.map +0 -1
  163. package/dist/chunk-FMT52ROU.js.map +0 -1
  164. package/dist/chunk-GZ3R6XOE.js.map +0 -1
  165. package/dist/chunk-RKTT72XV.js.map +0 -1
  166. package/dist/chunk-TIDEL77O.js.map +0 -1
  167. package/dist/chunk-TPDBFYEG.js.map +0 -1
  168. package/dist/chunk-YUAOU2B2.js.map +0 -1
  169. /package/dist/{chunk-3AGCSD42.js.map → chunk-3GN2PEOT.js.map} +0 -0
  170. /package/dist/{chunk-RGX4DGOG.js.map → chunk-3XQYM4RE.js.map} +0 -0
  171. /package/dist/{chunk-GATQP7CE.js.map → chunk-4V44AA7O.js.map} +0 -0
  172. /package/dist/{chunk-7QXTCONH.js.map → chunk-7QK5TUTW.js.map} +0 -0
  173. /package/dist/{chunk-OJ3TV57W.js.map → chunk-7UUKRS3J.js.map} +0 -0
  174. /package/dist/{chunk-DCPAAAIC.js.map → chunk-AXDOF4VI.js.map} +0 -0
  175. /package/dist/{chunk-NYZRJW5X.js.map → chunk-BJX3VQWZ.js.map} +0 -0
  176. /package/dist/{chunk-CDEI5S5W.js.map → chunk-C7JAUNFC.js.map} +0 -0
  177. /package/dist/{chunk-MQQPONTM.js.map → chunk-CK5U7JGH.js.map} +0 -0
  178. /package/dist/{chunk-RDUM6BKQ.js.map → chunk-CRKWSSS4.js.map} +0 -0
  179. /package/dist/{chunk-XNYTMLPS.js.map → chunk-DGAWEJVI.js.map} +0 -0
  180. /package/dist/{chunk-SUSMEKBE.js.map → chunk-EU3N5MK3.js.map} +0 -0
  181. /package/dist/{chunk-QJAGDPY7.js.map → chunk-FYAU4S6E.js.map} +0 -0
  182. /package/dist/{chunk-LEP46X5Y.js.map → chunk-GEX5NI36.js.map} +0 -0
  183. /package/dist/{chunk-X3NZ2HAO.js.map → chunk-GZAGLCQH.js.map} +0 -0
  184. /package/dist/{chunk-AVO2CBIL.js.map → chunk-HKFJ3PF3.js.map} +0 -0
  185. /package/dist/{chunk-K2SXIWEV.js.map → chunk-IA3X2Y4K.js.map} +0 -0
  186. /package/dist/{chunk-QIDMGBUY.js.map → chunk-IMAP236M.js.map} +0 -0
  187. /package/dist/{chunk-OHRIBMSS.js.map → chunk-JS3S2HVG.js.map} +0 -0
  188. /package/dist/{chunk-FVK5NQ3V.js.map → chunk-JVY556FW.js.map} +0 -0
  189. /package/dist/{chunk-3K3PITOE.js.map → chunk-JXMECXMF.js.map} +0 -0
  190. /package/dist/{chunk-NGFRFDSK.js.map → chunk-KERNN6BC.js.map} +0 -0
  191. /package/dist/{chunk-LZLJK2IA.js.map → chunk-L2LBMKSI.js.map} +0 -0
  192. /package/dist/{chunk-NHV6WCM5.js.map → chunk-ML2MVAEZ.js.map} +0 -0
  193. /package/dist/{chunk-GXQ5GDUH.js.map → chunk-N3MNDVJO.js.map} +0 -0
  194. /package/dist/{chunk-WGXWZE3K.js.map → chunk-NAYBHNGN.js.map} +0 -0
  195. /package/dist/{chunk-X33QB7LW.js.map → chunk-NKFLHW7J.js.map} +0 -0
  196. /package/dist/{chunk-GARVFCV6.js.map → chunk-NMBX4D7P.js.map} +0 -0
  197. /package/dist/{chunk-A2XDQ3JW.js.map → chunk-OM5BIPBR.js.map} +0 -0
  198. /package/dist/{chunk-ZYBLNHUB.js.map → chunk-QB75LKQQ.js.map} +0 -0
  199. /package/dist/{chunk-2CH6MMO2.js.map → chunk-RDEUG2M2.js.map} +0 -0
  200. /package/dist/{chunk-5X7ZTLFS.js.map → chunk-RIEX7NOZ.js.map} +0 -0
  201. /package/dist/{chunk-ZWWF7PI5.js.map → chunk-S42HZILI.js.map} +0 -0
  202. /package/dist/{chunk-RMG22TH2.js.map → chunk-SQDKX4RW.js.map} +0 -0
  203. /package/dist/{chunk-2GKLHU2D.js.map → chunk-SV72F4DS.js.map} +0 -0
  204. /package/dist/{chunk-6MJGDUC7.js.map → chunk-T4BE5KJM.js.map} +0 -0
  205. /package/dist/{chunk-7DZHRPCO.js.map → chunk-T4QGUXCV.js.map} +0 -0
  206. /package/dist/{chunk-IILMR37Z.js.map → chunk-TEV2JGU5.js.map} +0 -0
  207. /package/dist/{chunk-UKB7ZDKK.js.map → chunk-TIQZNDZ5.js.map} +0 -0
  208. /package/dist/{chunk-7WO66MKJ.js.map → chunk-UNJOB4DY.js.map} +0 -0
  209. /package/dist/{chunk-DSQWTXHP.js.map → chunk-W75BBBSY.js.map} +0 -0
  210. /package/dist/{chunk-YL273SOF.js.map → chunk-WB2I2EQK.js.map} +0 -0
  211. /package/dist/{chunk-CYCE3L2I.js.map → chunk-X22B4KTI.js.map} +0 -0
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-7N4KAIGN.js";
14
14
  import {
15
15
  LcmWorkQueue
16
- } from "./chunk-TPDBFYEG.js";
16
+ } from "./chunk-MMCO4SRG.js";
17
17
  import {
18
18
  assembleCompressedHistoryWithTrace
19
19
  } from "./chunk-UXPUUL3G.js";
@@ -32,6 +32,17 @@ function positiveInteger(value, fallback, min = 1) {
32
32
  if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
33
33
  return Math.max(min, Math.floor(value));
34
34
  }
35
+ function abortOnSignal(abortSignal, work) {
36
+ if (abortSignal === void 0) return work;
37
+ abortSignal.throwIfAborted();
38
+ return new Promise((resolve, reject) => {
39
+ const onAbort = () => {
40
+ reject(abortSignal.reason instanceof Error ? abortSignal.reason : new DOMException("Aborted", "AbortError"));
41
+ };
42
+ abortSignal.addEventListener("abort", onAbort, { once: true });
43
+ work.then(resolve, reject).finally(() => abortSignal.removeEventListener("abort", onAbort));
44
+ });
45
+ }
35
46
  function extractLcmConfig(cfg) {
36
47
  return {
37
48
  enabled: cfg.lcmEnabled === true,
@@ -228,14 +239,16 @@ var LcmEngine = class {
228
239
  await this.waitForPendingObserveInitIdle();
229
240
  await this.observeQueue?.whenIdle();
230
241
  }
231
- async waitForSessionObserveIdle(sessionId) {
242
+ async waitForSessionObserveIdle(sessionId, abortSignal) {
243
+ abortSignal?.throwIfAborted();
232
244
  if (!this.config.enabled || this.closed) return;
233
245
  const normalizedSessionId = normalizeLcmSessionId(sessionId);
234
246
  if (!normalizedSessionId) return;
235
247
  await this.ensureInitialized();
248
+ abortSignal?.throwIfAborted();
236
249
  if (this.closed) return;
237
- await this.waitForPendingObserveInitIdle(normalizedSessionId);
238
- await this.observeQueue?.whenSessionIdle(normalizedSessionId);
250
+ await this.waitForPendingObserveInitIdle(normalizedSessionId, abortSignal);
251
+ await this.observeQueue?.whenSessionIdle(normalizedSessionId, abortSignal) ?? Promise.resolve();
239
252
  }
240
253
  reservePendingObserveInit(sessionId) {
241
254
  const count = this.pendingObserveInitCounts.get(sessionId) ?? 0;
@@ -260,13 +273,25 @@ var LcmEngine = class {
260
273
  }
261
274
  this.pendingObserveInitCounts.set(sessionId, count - 1);
262
275
  }
263
- async waitForPendingObserveInitIdle(sessionId) {
276
+ async waitForPendingObserveInitIdle(sessionId, abortSignal) {
277
+ abortSignal?.throwIfAborted();
264
278
  if (sessionId) {
265
279
  if (!this.pendingObserveInitCounts.has(sessionId)) return;
266
- await new Promise((resolve) => {
280
+ await new Promise((resolve, reject) => {
281
+ const finish = () => {
282
+ abortSignal?.removeEventListener("abort", onAbort);
283
+ resolve();
284
+ };
285
+ const onAbort = () => {
286
+ const remaining = (this.pendingObserveInitWaiters.get(sessionId) ?? []).filter((waiter) => waiter !== finish);
287
+ if (remaining.length === 0) this.pendingObserveInitWaiters.delete(sessionId);
288
+ else this.pendingObserveInitWaiters.set(sessionId, remaining);
289
+ reject(abortSignal?.reason instanceof Error ? abortSignal.reason : new DOMException("Aborted", "AbortError"));
290
+ };
267
291
  const waiters = this.pendingObserveInitWaiters.get(sessionId) ?? [];
268
- waiters.push(resolve);
292
+ waiters.push(finish);
269
293
  this.pendingObserveInitWaiters.set(sessionId, waiters);
294
+ abortSignal?.addEventListener("abort", onAbort, { once: true });
270
295
  });
271
296
  return;
272
297
  }
@@ -320,15 +345,19 @@ var LcmEngine = class {
320
345
  ${lines.join("\n")}` : "";
321
346
  }
322
347
  /** Flush pending summaries before compaction (called from before_compaction hook). */
323
- async preCompactionFlush(sessionId) {
348
+ async preCompactionFlush(sessionId, abortSignal) {
349
+ abortSignal?.throwIfAborted();
324
350
  if (!this.config.enabled) return;
325
351
  const normalizedSessionId = normalizeLcmSessionId(sessionId);
326
352
  if (!normalizedSessionId) return;
327
353
  await this.ensureInitialized();
328
- await this.waitForSessionObserveIdle(normalizedSessionId);
354
+ abortSignal?.throwIfAborted();
355
+ await this.waitForSessionObserveIdle(normalizedSessionId, abortSignal);
356
+ abortSignal?.throwIfAborted();
329
357
  try {
330
- await this.summarizer.summarizeIncremental(normalizedSessionId);
358
+ await abortOnSignal(abortSignal, this.summarizer.summarizeIncremental(normalizedSessionId));
331
359
  } catch (err) {
360
+ if (abortSignal?.aborted) throw err;
332
361
  log.debug(`LCM pre-compaction flush error: ${err}`);
333
362
  }
334
363
  }
@@ -573,4 +602,4 @@ export {
573
602
  extractLcmConfig,
574
603
  LcmEngine
575
604
  };
576
- //# sourceMappingURL=chunk-2L5FSNPC.js.map
605
+ //# sourceMappingURL=chunk-5FNZ3G6X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lcm/engine.ts"],"sourcesContent":["import type Database from \"better-sqlite3\";\nimport { openLcmDatabase, ensureLcmStateDir } from \"./schema.js\";\nimport { LcmArchive, type LcmMessage, type LcmStructuredRecallMatch } from \"./archive.js\";\nimport { LcmDag } from \"./dag.js\";\nimport { LcmSummarizer, type SummarizeFn } from \"./summarizer.js\";\nimport {\n assembleCompressedHistoryWithTrace,\n type LcmRecallConfig,\n type LcmRecallWithTraceResult,\n} from \"./recall.js\";\nimport { LcmWorkQueue, type LcmObserveMessage } from \"./queue.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { estimateTokenCount } from \"../token-estimate.js\";\nimport { log } from \"../logger.js\";\nimport { nativeBindingRecoveryHint } from \"../native-binding-hint.js\";\nexport interface LcmEngineConfig {\n enabled: boolean;\n leafBatchSize: number;\n rollupFanIn: number;\n freshTailTurns: number;\n maxDepth: number;\n deterministicMaxTokens: number;\n archiveRetentionDays: number;\n recallBudgetShare: number;\n observeConcurrency: number;\n telemetryPrefilterEnabled: boolean;\n messagePartsEnabled: boolean;\n messagePartsRecallMaxResults: number;\n}\n\n/** An expanded archive row with stable lineage identity; content may be budget-truncated. */\nexport interface LcmExpandedMessage {\n id: number;\n session_id: string;\n turn_index: number;\n role: string;\n content: string;\n}\n\nfunction positiveInteger(value: unknown, fallback: number, min = 1): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return fallback;\n return Math.max(min, Math.floor(value));\n}\n\nfunction abortOnSignal<T>(abortSignal: AbortSignal | undefined, work: Promise<T>): Promise<T> {\n if (abortSignal === undefined) return work;\n abortSignal.throwIfAborted();\n return new Promise((resolve, reject) => {\n const onAbort = (): void => {\n reject(abortSignal.reason instanceof Error ? abortSignal.reason : new DOMException(\"Aborted\", \"AbortError\"));\n };\n abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n work.then(resolve, reject).finally(() => abortSignal.removeEventListener(\"abort\", onAbort));\n });\n}\n\nexport function extractLcmConfig(cfg: PluginConfig): LcmEngineConfig {\n return {\n enabled: (cfg as any).lcmEnabled === true,\n leafBatchSize: positiveInteger((cfg as any).lcmLeafBatchSize, 8),\n rollupFanIn: positiveInteger((cfg as any).lcmRollupFanIn, 4, 2),\n freshTailTurns: positiveInteger((cfg as any).lcmFreshTailTurns, 16),\n maxDepth: positiveInteger((cfg as any).lcmMaxDepth, 5),\n deterministicMaxTokens: positiveInteger((cfg as any).lcmDeterministicMaxTokens, 512),\n archiveRetentionDays: positiveInteger((cfg as any).lcmArchiveRetentionDays, 90, 0),\n recallBudgetShare: (cfg as any).lcmRecallBudgetShare ?? 0.15,\n observeConcurrency:\n typeof (cfg as any).lcmObserveConcurrency === \"number\" &&\n Number.isFinite((cfg as any).lcmObserveConcurrency)\n ? Math.max(1, Math.floor((cfg as any).lcmObserveConcurrency))\n : 1,\n telemetryPrefilterEnabled: (cfg as any).lcmTelemetryPrefilterEnabled !== false,\n messagePartsEnabled: (cfg as any).messagePartsEnabled === true,\n messagePartsRecallMaxResults:\n typeof (cfg as any).messagePartsRecallMaxResults === \"number\"\n ? Math.max(0, Math.floor((cfg as any).messagePartsRecallMaxResults))\n : 6,\n };\n}\n\nfunction normalizeLcmSessionId(sessionId: string): string {\n return sessionId.trim();\n}\n\nfunction normalizeOptionalLcmSessionId(sessionId?: string): string | undefined {\n if (sessionId === undefined) {\n return undefined;\n }\n const normalized = normalizeLcmSessionId(sessionId);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nconst EMPTY_LCM_STATS = {\n totalMessages: 0,\n totalSummaryNodes: 0,\n maxDepth: -1,\n} as const;\n\nexport class LcmEngine {\n private db: Database.Database | null = null;\n private archive: LcmArchive | null = null;\n private dag: LcmDag | null = null;\n private summarizer: LcmSummarizer | null = null;\n private observeQueue: LcmWorkQueue | null = null;\n private closed = false;\n private readonly config: LcmEngineConfig;\n private readonly memoryDir: string;\n private initPromise: Promise<void> | null = null;\n private readonly pendingObserveInitCounts = new Map<string, number>();\n private readonly pendingObserveInitWaiters = new Map<string, Array<() => void>>();\n private readonly pendingObserveInitIdleWaiters: Array<() => void> = [];\n\n constructor(\n pluginConfig: PluginConfig,\n private readonly summarizeFn: SummarizeFn,\n ) {\n this.config = extractLcmConfig(pluginConfig);\n this.memoryDir = pluginConfig.memoryDir;\n }\n\n get enabled(): boolean {\n return this.config.enabled;\n }\n\n /** Lazy init — open database on first use. */\n async ensureInitialized(): Promise<void> {\n if (this.closed) return;\n if (this.db) return;\n if (this.initPromise) {\n await this.initPromise;\n return;\n }\n this.initPromise = this.doInit().catch((err) => {\n // Reset so next call retries instead of caching the failure\n this.initPromise = null;\n throw err;\n });\n await this.initPromise;\n }\n\n private async doInit(): Promise<void> {\n await ensureLcmStateDir(this.memoryDir);\n const db = openLcmDatabase(this.memoryDir);\n const archive = new LcmArchive(db);\n const dag = new LcmDag(db);\n const { telemetryPrefilterEnabled } = this.config;\n const summarizer = new LcmSummarizer(\n archive,\n dag,\n this.summarizeFn,\n {\n leafBatchSize: this.config.leafBatchSize,\n rollupFanIn: this.config.rollupFanIn,\n maxDepth: this.config.maxDepth,\n deterministicMaxTokens: this.config.deterministicMaxTokens,\n telemetryPrefilterEnabled,\n },\n );\n const observeQueue = new LcmWorkQueue({\n concurrency: this.config.observeConcurrency,\n worker: async (sessionId, messages) => {\n await this.processObserveMessages(sessionId, messages);\n },\n hooks: {\n onJobStart: ({ sessionId, depth, inFlight, waitMs }) => {\n log.debug(\n `LCM observe queue start: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms`,\n );\n },\n onJobFinish: ({\n sessionId,\n depth,\n inFlight,\n waitMs,\n runMs,\n totalMs,\n error,\n }) => {\n if (error) {\n log.error(\n `LCM observe queue failure: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms, run=${runMs}ms, total=${totalMs}ms, error=${error}`,\n );\n return;\n }\n\n log.debug(\n `LCM observe queue finish: session=${sessionId}, depth=${depth}, inFlight=${inFlight}, wait=${waitMs}ms, run=${runMs}ms, total=${totalMs}ms`,\n );\n },\n },\n });\n\n if (this.closed) {\n db.close();\n return;\n }\n\n this.db = db;\n this.archive = archive;\n this.dag = dag;\n this.summarizer = summarizer;\n this.observeQueue = observeQueue;\n log.info(\"LCM engine initialized\");\n }\n\n /**\n * Enqueue messages from agent_end hook.\n * The queue worker performs the archive append and incremental summarization.\n */\n async observeMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): Promise<void> {\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n this.enqueueObserveMessages(normalizedSessionId, messages);\n }\n\n /** Enqueue an observe job without waiting for worker completion. */\n enqueueObserveMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): void {\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n if (messages.length === 0) return;\n\n this.reservePendingObserveInit(normalizedSessionId);\n\n void this.ensureInitialized()\n .then(() => {\n if (this.closed || !this.observeQueue) return;\n this.observeQueue.enqueue(normalizedSessionId, messages);\n log.debug(\n `LCM observe enqueued: session=${normalizedSessionId}, depth=${this.observeQueue.depth}, inFlight=${this.observeQueue.inFlightCount}`,\n );\n })\n .catch((err) => {\n if (this.closed) return;\n log.error(\n `LCM observe enqueue initialization error: ${err}${nativeBindingRecoveryHint(err)}`,\n );\n })\n .finally(() => {\n this.releasePendingObserveInit(normalizedSessionId);\n });\n }\n\n private async processObserveMessages(\n sessionId: string,\n messages: LcmObserveMessage[],\n ): Promise<void> {\n if (this.closed) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.summarizer) return;\n\n if (messages.length === 0) return;\n\n const currentMax = this.archive.getMaxTurnIndex(sessionId);\n const { messagePartsEnabled } = this.config;\n const newMessages = messages.map((m, i) => ({\n turnIndex: currentMax + 1 + i,\n role: m.role,\n content: m.content,\n parts: messagePartsEnabled ? m.parts : undefined,\n rawContent: messagePartsEnabled ? m.rawContent : undefined,\n sourceFormat: messagePartsEnabled ? m.sourceFormat : undefined,\n }));\n\n this.archive.appendMessages(sessionId, newMessages, {\n messagePartsEnabled,\n });\n\n // Trigger incremental summarization inside the worker, after append.\n try {\n await this.summarizer.summarizeIncremental(sessionId);\n } catch (err) {\n log.debug(`LCM incremental summarization error: ${err}`);\n }\n }\n\n get observeQueueDepth(): number {\n return this.observeQueue?.depth ?? 0;\n }\n\n get observeQueueInFlightCount(): number {\n return this.observeQueue?.inFlightCount ?? 0;\n }\n\n async waitForObserveQueueIdle(): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n await this.ensureInitialized();\n if (this.closed) return;\n await this.waitForPendingObserveInitIdle();\n await this.observeQueue?.whenIdle();\n }\n\n async waitForSessionObserveIdle(sessionId: string, abortSignal?: AbortSignal): Promise<void> {\n abortSignal?.throwIfAborted();\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n abortSignal?.throwIfAborted();\n if (this.closed) return;\n await this.waitForPendingObserveInitIdle(normalizedSessionId, abortSignal);\n await this.observeQueue?.whenSessionIdle(normalizedSessionId, abortSignal) ?? Promise.resolve();\n }\n\n private reservePendingObserveInit(sessionId: string): void {\n const count = this.pendingObserveInitCounts.get(sessionId) ?? 0;\n this.pendingObserveInitCounts.set(sessionId, count + 1);\n }\n\n private releasePendingObserveInit(sessionId: string): void {\n const count = this.pendingObserveInitCounts.get(sessionId);\n if (!count) return;\n\n if (count === 1) {\n this.pendingObserveInitCounts.delete(sessionId);\n const waiters = this.pendingObserveInitWaiters.get(sessionId) ?? [];\n this.pendingObserveInitWaiters.delete(sessionId);\n for (const resolve of waiters) resolve();\n if (this.pendingObserveInitCounts.size === 0) {\n const idleWaiters = this.pendingObserveInitIdleWaiters.splice(\n 0,\n this.pendingObserveInitIdleWaiters.length,\n );\n for (const resolve of idleWaiters) resolve();\n }\n return;\n }\n\n this.pendingObserveInitCounts.set(sessionId, count - 1);\n }\n\n private async waitForPendingObserveInitIdle(sessionId?: string, abortSignal?: AbortSignal): Promise<void> {\n abortSignal?.throwIfAborted();\n if (sessionId) {\n if (!this.pendingObserveInitCounts.has(sessionId)) return;\n await new Promise<void>((resolve, reject) => {\n const finish = (): void => {\n abortSignal?.removeEventListener(\"abort\", onAbort);\n resolve();\n };\n const onAbort = (): void => {\n const remaining = (this.pendingObserveInitWaiters.get(sessionId) ?? []).filter((waiter) => waiter !== finish);\n if (remaining.length === 0) this.pendingObserveInitWaiters.delete(sessionId);\n else this.pendingObserveInitWaiters.set(sessionId, remaining);\n reject(abortSignal?.reason instanceof Error ? abortSignal.reason : new DOMException(\"Aborted\", \"AbortError\"));\n };\n const waiters = this.pendingObserveInitWaiters.get(sessionId) ?? [];\n waiters.push(finish);\n this.pendingObserveInitWaiters.set(sessionId, waiters);\n abortSignal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n return;\n }\n\n if (this.pendingObserveInitCounts.size === 0) return;\n await new Promise<void>((resolve) => {\n this.pendingObserveInitIdleWaiters.push(resolve);\n });\n }\n\n /** Build the compressed history recall section for a session. */\n async assembleRecall(\n sessionId: string,\n budgetChars: number,\n ): Promise<string> {\n return (await this.assembleRecallWithTrace(sessionId, budgetChars)).text;\n }\n\n /** Build compressed recall plus content-free selected-summary receipts. */\n async assembleRecallWithTrace(\n sessionId: string,\n budgetChars: number,\n ): Promise<LcmRecallWithTraceResult> {\n if (!this.config.enabled) return { text: \"\", selectedSummaries: [] };\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return { text: \"\", selectedSummaries: [] };\n await this.ensureInitialized();\n\n const effectiveBudget = Math.ceil(\n budgetChars * this.config.recallBudgetShare,\n );\n if (effectiveBudget <= 0) return { text: \"\", selectedSummaries: [] };\n\n return assembleCompressedHistoryWithTrace(this.dag!, this.archive!, normalizedSessionId, {\n freshTailTurns: this.config.freshTailTurns,\n budgetChars: effectiveBudget,\n });\n }\n\n async searchStructuredParts(\n sessionId: string,\n query: string,\n limit = this.config.messagePartsRecallMaxResults,\n ): Promise<LcmStructuredRecallMatch[]> {\n const { messagePartsEnabled } = this.config;\n if (!this.config.enabled || !messagePartsEnabled) return [];\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return [];\n await this.ensureInitialized();\n if (!this.archive) return [];\n return this.archive.searchStructuredParts(query, limit, normalizedSessionId);\n }\n\n formatStructuredRecall(\n matches: LcmStructuredRecallMatch[],\n budgetChars: number,\n ): string {\n if (matches.length === 0 || budgetChars <= 0) return \"\";\n const lines: string[] = [];\n let used = \"## Structured Session Matches\\n\\n\".length;\n for (const match of matches) {\n const label = match.file_path\n ? `${match.kind} ${match.file_path}`\n : match.tool_name\n ? `${match.kind} ${match.tool_name}`\n : match.kind;\n const excerpt = match.content.replace(/\\s+/g, \" \").slice(0, 220);\n const line = `- turn ${match.turn_index} (${match.role}): ${label} — ${excerpt}`;\n if (used + line.length + 1 > budgetChars) break;\n lines.push(line);\n used += line.length + 1;\n }\n return lines.length > 0 ? `## Structured Session Matches\\n\\n${lines.join(\"\\n\")}` : \"\";\n }\n\n /** Flush pending summaries before compaction (called from before_compaction hook). */\n async preCompactionFlush(sessionId: string, abortSignal?: AbortSignal): Promise<void> {\n abortSignal?.throwIfAborted();\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n abortSignal?.throwIfAborted();\n await this.waitForSessionObserveIdle(normalizedSessionId, abortSignal);\n abortSignal?.throwIfAborted();\n\n try {\n await abortOnSignal(abortSignal, this.summarizer!.summarizeIncremental(normalizedSessionId));\n } catch (err) {\n if (abortSignal?.aborted) throw err;\n log.debug(`LCM pre-compaction flush error: ${err}`);\n }\n }\n\n /** Record a compaction event with real token counts (called from after_compaction hook). */\n async recordCompaction(\n sessionId: string,\n tokensBefore: number,\n tokensAfter: number,\n ): Promise<void> {\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n await this.waitForSessionObserveIdle(normalizedSessionId);\n\n const maxTurn = this.archive!.getMaxTurnIndex(normalizedSessionId);\n\n this.dag!.recordCompaction(normalizedSessionId, maxTurn, tokensBefore, tokensAfter);\n log.info(\n `LCM compaction recorded: session=${normalizedSessionId}, turn=${maxTurn}, tokens ${tokensBefore}→${tokensAfter}`,\n );\n }\n\n /** Verify archive coverage after compaction. */\n async verifyPostCompaction(sessionId: string): Promise<void> {\n if (!this.config.enabled) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n\n const msgCount = this.archive!.getMessageCount(normalizedSessionId);\n const nodeCount = this.dag!.getNodeCount(normalizedSessionId);\n log.debug(\n `LCM post-compaction verify: session=${normalizedSessionId}, messages=${msgCount}, summaryNodes=${nodeCount}`,\n );\n }\n\n // ── MCP Tool implementations ──\n\n /** Search across all conversation history via FTS (snippet mode). */\n async searchContext(\n query: string,\n limit: number,\n sessionId?: string,\n sessionPrefix?: string,\n ): Promise<\n Array<{\n turn_index: number;\n role: string;\n snippet: string;\n session_id: string;\n }>\n > {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) return [];\n const normalizedSessionPrefix = normalizeOptionalLcmSessionId(sessionPrefix);\n if (sessionPrefix !== undefined && !normalizedSessionPrefix) return [];\n await this.ensureInitialized();\n return this.archive!.search(query, limit, normalizedSessionId, normalizedSessionPrefix);\n }\n\n /** Search via FTS returning full message content (not snippets). */\n async searchContextFull(\n query: string,\n limit: number,\n sessionId?: string,\n sessionPrefix?: string,\n ): Promise<\n Array<{\n id: number;\n turn_index: number;\n role: string;\n content: string;\n session_id: string;\n score: number;\n }>\n > {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) return [];\n const normalizedSessionPrefix = normalizeOptionalLcmSessionId(sessionPrefix);\n if (sessionPrefix !== undefined && !normalizedSessionPrefix) return [];\n await this.ensureInitialized();\n return this.archive!.searchWithContent(\n query,\n limit,\n normalizedSessionId,\n 1000,\n normalizedSessionPrefix,\n );\n }\n\n /** Get a compressed summary of a turn range. */\n async describeContext(\n sessionId: string,\n fromTurn: number,\n toTurn: number,\n ): Promise<{ summary: string; turn_count: number; depth: number } | null> {\n if (!this.config.enabled) return null;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return null;\n await this.ensureInitialized();\n\n const nodes = this.dag!.getCoveringNodes(normalizedSessionId, fromTurn, toTurn);\n if (nodes.length === 0) {\n // No summary exists — build a description from raw messages\n const messages = this.archive!.getMessages(normalizedSessionId, fromTurn, toTurn);\n if (messages.length === 0) return null;\n const preview = messages\n .slice(0, 5)\n .map((m) => `[${m.role}] ${m.content.slice(0, 100)}`)\n .join(\"\\n\");\n return {\n summary: `No summary available for this range. Preview of ${messages.length} messages:\\n${preview}`,\n turn_count: messages.length,\n depth: -1,\n };\n }\n\n // Use the deepest covering node\n const best = nodes[0]; // Already sorted by depth DESC\n return {\n summary: best.summary_text,\n turn_count: best.msg_end - best.msg_start + 1,\n depth: best.depth,\n };\n }\n\n /**\n * Retrieve raw archived messages for a turn range (inclusive bounds),\n * read-only and unshaped — no token-budget trimming (issue #2331\n * episodic-context). Callers own truncation and cleaning.\n */\n async getTurnRange(\n sessionId: string,\n fromTurn: number,\n toTurn: number,\n ): Promise<LcmMessage[]> {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return [];\n await this.ensureInitialized();\n return this.archive!.getMessages(normalizedSessionId, fromTurn, toTurn);\n }\n\n /** Retrieve raw messages for a turn range (lossless expansion). */\n async expandContext(\n sessionId: string,\n fromTurn: number,\n toTurn: number,\n maxTokens: number,\n ): Promise<LcmExpandedMessage[]> {\n if (!this.config.enabled) return [];\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return [];\n await this.ensureInitialized();\n\n const messages = this.archive!.getMessages(normalizedSessionId, fromTurn, toTurn);\n if (messages.length === 0) return [];\n\n // Enforce the token budget while keeping the existing first/last shape.\n const tokenBudget = Math.max(0, Math.floor(maxTokens));\n if (tokenBudget === 0) return [];\n const totalTokens = messages.reduce(\n (sum, message) => sum + estimateTokenCount(message.content),\n 0,\n );\n if (totalTokens <= tokenBudget) {\n return messages.map((m) => ({\n id: m.id,\n session_id: m.session_id,\n turn_index: m.turn_index,\n role: m.role,\n content: m.content,\n }));\n }\n\n const result: LcmExpandedMessage[] = [];\n const lastMsg = messages[messages.length - 1];\n const reservedLastTokens = Math.min(\n estimateTokenCount(lastMsg.content),\n Math.max(1, Math.floor(tokenBudget * 0.3)),\n );\n let remainingTokens = tokenBudget - reservedLastTokens;\n\n for (let i = 0; i < messages.length - 1; i++) {\n if (remainingTokens <= 0) break;\n const content = truncateToTokenBudget(\n messages[i].content,\n remainingTokens,\n );\n if (!content) continue;\n result.push({\n id: messages[i].id,\n session_id: messages[i].session_id,\n turn_index: messages[i].turn_index,\n role: messages[i].role,\n content,\n });\n remainingTokens -= estimateTokenCount(content);\n }\n\n const lastContent = truncateToTokenBudget(\n lastMsg.content,\n reservedLastTokens + remainingTokens,\n );\n if (lastContent) {\n result.push({\n id: lastMsg.id,\n session_id: lastMsg.session_id,\n turn_index: lastMsg.turn_index,\n role: lastMsg.role,\n content: lastContent,\n });\n }\n return result;\n }\n\n\n /** Get statistics about the LCM archive. */\n async getStats(sessionId?: string): Promise<{\n totalMessages: number;\n totalSummaryNodes: number;\n maxDepth: number;\n maxTurnIndex?: number;\n }> {\n if (!this.config.enabled)\n return { totalMessages: 0, totalSummaryNodes: 0, maxDepth: -1 };\n const normalizedSessionId = normalizeOptionalLcmSessionId(sessionId);\n if (sessionId !== undefined && !normalizedSessionId) {\n return { ...EMPTY_LCM_STATS };\n }\n await this.ensureInitialized();\n\n if (normalizedSessionId) {\n return {\n totalMessages: this.archive!.getMessageCount(normalizedSessionId),\n totalSummaryNodes: this.dag!.getNodeCount(normalizedSessionId),\n maxDepth: this.dag!.getMaxDepth(normalizedSessionId),\n maxTurnIndex: this.archive!.getMaxTurnIndex(normalizedSessionId),\n };\n }\n\n return {\n totalMessages: this.archive!.getTotalMessageCount(),\n totalSummaryNodes: 0, // Would need a global count query\n maxDepth: -1,\n };\n }\n\n /** Clear all LCM archive and summary state for one session. */\n async clearSession(sessionId: string): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n const normalizedSessionId = normalizeLcmSessionId(sessionId);\n if (!normalizedSessionId) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.dag) return;\n await this.waitForSessionObserveIdle(normalizedSessionId);\n this.dag.deleteSession(normalizedSessionId);\n this.archive.deleteSession(normalizedSessionId);\n }\n\n /** Clear all LCM archive and summary state without closing the engine. */\n async clearAll(): Promise<void> {\n if (!this.config.enabled || this.closed) return;\n await this.ensureInitialized();\n if (this.closed || !this.archive || !this.dag) return;\n await this.waitForObserveQueueIdle();\n this.dag.deleteAll();\n this.archive.deleteAll();\n }\n\n /** Prune old data beyond retention period. */\n async prune(): Promise<{ messagesPruned: number; nodesPruned: number }> {\n if (!this.config.enabled) return { messagesPruned: 0, nodesPruned: 0 };\n await this.ensureInitialized();\n\n const messagesPruned = this.archive!.pruneOldMessages(\n this.config.archiveRetentionDays,\n );\n const nodesPruned = this.dag!.pruneOldNodes(\n this.config.archiveRetentionDays,\n );\n return { messagesPruned, nodesPruned };\n }\n\n /** Close the database connection. */\n close(): void {\n this.closed = true;\n if (this.db) {\n this.db.close();\n }\n this.db = null;\n this.archive = null;\n this.dag = null;\n this.summarizer = null;\n this.observeQueue = null;\n this.initPromise = null;\n }\n}\nfunction truncateToTokenBudget(text: string, maxTokens: number): string {\n if (maxTokens <= 0) return \"\";\n if (estimateTokenCount(text) <= maxTokens) return text;\n const codePoints = [...text];\n let low = 0;\n let high = codePoints.length;\n while (low < high) {\n const mid = Math.ceil((low + high) / 2);\n if (estimateTokenCount(codePoints.slice(0, mid).join(\"\")) <= maxTokens) {\n low = mid;\n } else {\n high = mid - 1;\n }\n }\n return codePoints.slice(0, low).join(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAS,gBAAgB,OAAgB,UAAkB,MAAM,GAAW;AAC1E,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,SAAO,KAAK,IAAI,KAAK,KAAK,MAAM,KAAK,CAAC;AACxC;AAEA,SAAS,cAAiB,aAAsC,MAA8B;AAC5F,MAAI,gBAAgB,OAAW,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ZWVZ7E.js";
5
5
  import {
6
6
  abortError,
7
7
  isAbortError
@@ -499,4 +499,4 @@ export {
499
499
  buildSupportPassportPublicRequestHandler,
500
500
  composeSupportPassportExternalRequestHandlers
501
501
  };
502
- //# sourceMappingURL=chunk-7QXTCONH.js.map
502
+ //# sourceMappingURL=chunk-7QK5TUTW.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6JMQR72P.js";
7
7
  import {
8
8
  StorageManager
9
- } from "./chunk-YUAOU2B2.js";
9
+ } from "./chunk-S55WTPFJ.js";
10
10
  import {
11
11
  normalizeEntityName
12
12
  } from "./chunk-YXZG5TVN.js";
@@ -962,4 +962,4 @@ export {
962
962
  resolveBriefingSaveDir,
963
963
  briefingFilename
964
964
  };
965
- //# sourceMappingURL=chunk-OJ3TV57W.js.map
965
+ //# sourceMappingURL=chunk-7UUKRS3J.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveCorpusNamespaceRoots
3
- } from "./chunk-RDUM6BKQ.js";
3
+ } from "./chunk-CRKWSSS4.js";
4
4
  import {
5
5
  capabilityAllowsNamespace
6
6
  } from "./chunk-IG747LRN.js";
@@ -200,4 +200,4 @@ async function readAggregateExtractionWatermark(options) {
200
200
  export {
201
201
  readAggregateExtractionWatermark
202
202
  };
203
- //# sourceMappingURL=chunk-DCPAAAIC.js.map
203
+ //# sourceMappingURL=chunk-AXDOF4VI.js.map
@@ -21,13 +21,13 @@ import {
21
21
  defineOperation,
22
22
  parseNamespacePreflightWriteOp,
23
23
  resolveAuthorizedNamespaceWritablePreflight
24
- } from "./chunk-FMT52ROU.js";
24
+ } from "./chunk-SVZWVZ7E.js";
25
25
  import {
26
26
  parseSharedWriteOutputControls
27
27
  } from "./chunk-IFBSZGW3.js";
28
28
  import {
29
29
  validateBriefingFormat
30
- } from "./chunk-OJ3TV57W.js";
30
+ } from "./chunk-7UUKRS3J.js";
31
31
  import {
32
32
  parseDeepRecallMaxSteps
33
33
  } from "./chunk-A7AISUJI.js";
@@ -379,7 +379,7 @@ defineOperation({
379
379
  })
380
380
  });
381
381
  defineOperation({ name: "lcm_search", description: "Search LCM.", schema: strictSchema({ query: S.str, sessionKey: S.str, sessionPrefix: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmSearch({ query: defStr(input.query, ""), sessionKey: optStr(input.sessionKey), sessionPrefix: optStr(input.sessionPrefix), namespace: optStr(input.namespace), limit: optNum(input.limit), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });
382
- defineOperation({ name: "lcm_compaction_flush", description: "Flush LCM compaction.", schema: strictSchema({ sessionKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionFlush({ sessionKey: optStr(input.sessionKey) ?? "", namespace: optStr(input.namespace), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });
382
+ defineOperation({ name: "lcm_compaction_flush", description: "Flush LCM compaction.", schema: strictSchema({ sessionKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionFlush({ sessionKey: optStr(input.sessionKey) ?? "", namespace: optStr(input.namespace), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), authenticatedPrincipal: ctx.authenticatedPrincipal, ...ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {} }) }) });
383
383
  defineOperation({ name: "extraction_force_flush", description: "Force-drain a session extraction buffer.", schema: strictSchema({ sessionKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str, deadlineMs: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.extractionForceFlush({ sessionKey: optStr(input.sessionKey) ?? "", namespace: optStr(input.namespace), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), deadlineMs: optNum(input.deadlineMs), authenticatedPrincipal: ctx.authenticatedPrincipal, onCommitted: ctx.hooks?.recordWriteCommit, ...ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {} }) }) });
384
384
  defineOperation({ name: "lcm_compaction_record", description: "Record LCM compaction.", schema: strictSchema({ sessionKey: S.str, namespace: S.str, tokensBefore: S.num, tokensAfter: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionRecord({ sessionKey: optStr(input.sessionKey) ?? "", namespace: optStr(input.namespace), tokensBefore: optNum(input.tokensBefore) ?? 0, tokensAfter: optNum(input.tokensAfter) ?? 0, authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });
385
385
  defineOperation({ name: "continuity_audit_generate", description: "Continuity audit.", fleetWide: true, schema: strictSchema({ period: S.str, key: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityAuditGenerate({ period: optStr(input.period) === "monthly" ? "monthly" : optStr(input.period) === "weekly" ? "weekly" : void 0, key: optStr(input.key) }) }) });
@@ -603,4 +603,4 @@ defineOperation({ name: "graph_events", description: "SSE graph events.", schema
603
603
  defineOperation({ name: "chat_message", description: "Chat message.", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
604
604
  defineOperation({ name: "chat_events", description: "SSE chat events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
605
605
  defineOperation({ name: "adapters_status", description: "Adapter registry metadata (issue #1850 round 5). Marker op: the HTTP transport builds the response from its own adapterRegistry, but the op still must be registered so it appears in listRegisteredOperations and enforceTokenOp can gate it for scoped tokens.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
606
- //# sourceMappingURL=chunk-RKTT72XV.js.map
606
+ //# sourceMappingURL=chunk-B47OHVFT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-operations-batch.ts"],"sourcesContent":["/**\n * Batch migration of remaining access-surface handlers through the boundary\n * (issue #1525 / #1668). Each operation routes MCP/HTTP/CLI dispatch through\n * the shared validation + error-mapping layer in access-boundary.ts.\n *\n * Strict per-tool Zod schemas replace the earlier permissive looseSchema (#1668).\n * Each schema validates known field types; .passthrough() tolerates MCP client\n * context injection (cwd/projectTag/sessionKey) without silent type coercion.\n * The stripNulls preprocessor handles the OpenAI-schema null-for-absent gotcha.\n */\n\nimport { randomUUID } from \"node:crypto\";\nimport { z } from \"zod\";\nimport type { DreamsPhase, RecallDisclosure, RecallPlanMode } from \"./types.js\";\nimport type { RemnicChatGptMemoryInspectorInput } from \"./mcp-memory-inspector-app.js\";\nimport { defineOperation } from \"./access-boundary.js\";\nimport { EngramAccessForbiddenError } from \"./access-errors.js\";\nimport {\n type ObserveRequest,\n observeRequestSchema,\n type RecallRequest,\n recallRequestSchema,\n retainedCategoryAlias,\n suggestionSubmitRequestSchema,\n} from \"./access-schema.js\";\nimport { EngramAccessInputError, type EngramAccessService } from \"./access-service.js\";\nimport { enforceNamespaceAllowList, tokenCapabilityStore } from \"./access-token-capabilities.js\";\nimport { projectTagProjectId } from \"./coding/coding-namespace.js\";\nimport {\n parseNamespacePreflightWriteOp,\n resolveAuthorizedNamespaceWritablePreflight,\n type EngramAccessNamespaceWritableRequest,\n} from \"./access-namespace-preflight.js\";\nimport { expandTildePath } from \"./utils/path.js\";\nimport { resolvePrincipal } from \"./namespaces/principal.js\";\nimport {\n parseSharedWriteOutputControls,\n type SharedWriteOutputControls,\n} from \"./shared-context/write-output-controls.js\";\nimport { getRecallTimingStatus, isRecallTimingsOperator } from \"./recall-timings.js\";\nimport { parseDeepRecallMaxSteps } from \"./deep-recall-config.js\";\nimport { validateBriefingFormat } from \"./briefing.js\";\nimport {\n buildChatGptMemoryInspectorActionRequest,\n buildChatGptMemoryInspectorResult,\n} from \"./mcp-memory-inspector-app.js\";\nimport { listPairs, isDefaultReviewNamespace, readPair } from \"./contradiction/contradiction-review.js\";\nimport { executeResolution, isValidResolutionVerb } from \"./contradiction/resolution.js\";\nimport { runContradictionScan } from \"./contradiction/contradiction-scan.js\";\nimport { runPreferenceDriftScan } from \"./preferences/preference-drift.js\";\nimport { runGraphEdgeDecayMaintenanceAcrossNamespaces } from \"./maintenance/graph-edge-decay.js\";\nimport { normalizeDreamsStatusWindowHours } from \"./maintenance/dreams-ledger.js\";\n\n// ---------------------------------------------------------------------------\n// Shared helpers\n// ---------------------------------------------------------------------------\n\nfunction stripNulls(data: unknown): unknown {\n if (data !== null && typeof data === \"object\" && !Array.isArray(data)) {\n const obj = data as Record<string, unknown>;\n const cleaned: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== null) cleaned[key] = value;\n }\n return cleaned;\n }\n return data;\n}\n\nfunction strictSchema<T extends z.ZodRawShape>(shape: T): z.ZodType<Record<string, unknown>> {\n return z.preprocess(stripNulls, z.object(shape).passthrough()) as unknown as z.ZodType<Record<string, unknown>>;\n}\n\n/**\n * stripNulls, but keys listed in `preserve` keep their null values. Used by\n * boundary schemas whose wire contract treats an explicit `null` as a\n * meaningful value (e.g. recall `codingContext: null` clears the session\n * context — it must not be collapsed into \"absent\").\n */\nfunction stripNullsExcept(data: unknown, preserve: readonly string[]): unknown {\n if (data !== null && typeof data === \"object\" && !Array.isArray(data)) {\n const cleaned: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n if (value !== null || preserve.includes(key)) cleaned[key] = value;\n }\n return cleaned;\n }\n return data;\n}\n\n\nfunction optStr(v: unknown): string | undefined { return typeof v === \"string\" ? v : undefined; }\nfunction reqStr(v: unknown, field: string): string {\n if (typeof v !== \"string\" || v.length === 0) throw new EngramAccessInputError(field + \" is required and must be a non-empty string\");\n return v;\n}\nfunction defStr(v: unknown, d: string): string { return typeof v === \"string\" ? v : d; }\nfunction optNum(v: unknown): number | undefined { return typeof v === \"number\" && Number.isFinite(v) ? v : undefined; }\nfunction optBool(v: unknown): boolean | undefined { return typeof v === \"boolean\" ? v : undefined; }\nfunction optStrArr(v: unknown): string[] | undefined { return Array.isArray(v) && v.every((x) => typeof x === \"string\") ? v : undefined; }\n\nconst S = {\n str: z.string().optional(),\n num: z.number().optional(),\n // Accept numbers and numeric strings (MCP clients sometimes send \"7\" for 7).\n flexNum: z.union([z.number(), z.string()]).optional(),\n bool: z.boolean().optional(),\n strArr: z.array(z.string()).optional(),\n};\n\n// === RECALL ===\n// Issue #2482: the boundary validates against the SAME canonical zod schema\n// the HTTP transport uses (recallRequestSchema). No parallel field list, no\n// silent defaults — a missing `query` or a bad enum is a 400 at the boundary.\n// `codingContext: null` survives the null-strip (explicit session-context\n// clear); every other null is the MCP null-for-absent idiom.\ndefineOperation({\n name: \"recall\",\n description: \"Semantic recall.\",\n schema: z.preprocess((data) => stripNullsExcept(data, [\"codingContext\"]), recallRequestSchema) as unknown as z.ZodType<RecallRequest>,\n handler: async (input, ctx) => ({\n result: await ctx.service.recall({\n ...input,\n authenticatedPrincipal: ctx.authenticatedPrincipal,\n ...(ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {}),\n ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}),\n }),\n }),\n});\ndefineOperation({ name: \"recall_explain\", description: \"Explain recall plan.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.recallExplain({ sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"set_coding_context\", description: \"Set coding context.\", schema: z.preprocess((data) => stripNullsExcept(data, [\"codingContext\"]), z.object({ sessionKey: S.str, codingContext: z.union([z.null(), z.object({ projectId: S.str, branch: z.union([z.string(), z.null()]).optional(), rootPath: S.str, defaultBranch: z.union([z.string(), z.null()]).optional() }).passthrough()]).optional(), projectTag: S.str }).passthrough()) as unknown as z.ZodType<Record<string, unknown>>, // codingContext: null = clear context (preserved).\n handler: async (input, ctx) => {\n const sessionKey = defStr(input.sessionKey, \"\");\n const projectTag = optStr(input.projectTag);\n const hasProjectTag = projectTag !== undefined && projectTag.trim().length > 0;\n const hasCodingContext = \"codingContext\" in input;\n if (!hasCodingContext && hasProjectTag) { const tag = projectTag!.trim(); const pid = projectTagProjectId(tag); ctx.service.setCodingContext({ sessionKey, codingContext: { projectId: pid, branch: null, rootPath: pid, defaultBranch: null } }); return { result: { ok: true } }; }\n if (!hasCodingContext && !hasProjectTag) throw new EngramAccessInputError(\"set_coding_context requires either codingContext or projectTag\");\n const rawCtx = (input as Record<string, unknown>).codingContext;\n let codingContext: { projectId: string; branch: string | null; rootPath: string; defaultBranch: string | null } | null = null;\n if (rawCtx !== null) { if (typeof rawCtx !== \"object\") throw new EngramAccessInputError(\"codingContext must be an object or null\"); const o = rawCtx as Record<string, unknown>; const branch = o.branch === null ? null : optStr(o.branch); const dB = o.defaultBranch === null ? null : optStr(o.defaultBranch); if (branch === undefined) throw new EngramAccessInputError(\"codingContext.branch must be a string or null\"); if (dB === undefined) throw new EngramAccessInputError(\"codingContext.defaultBranch must be a string or null\"); codingContext = { projectId: defStr(o.projectId, \"\"), branch, rootPath: defStr(o.rootPath, \"\"), defaultBranch: dB }; }\n ctx.service.setCodingContext({ sessionKey, codingContext });\n return { result: { ok: true } };\n },\n});\ndefineOperation({ name: \"recall_tier_explain\", description: \"Explain recall tiers.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str }), handler: async (input, ctx) => { const sk = optStr(input.sessionKey); const ns = optStr(input.namespace); return { result: await ctx.service.recallTierExplain(sk && sk.length > 0 ? sk : undefined, ns && ns.length > 0 ? ns : undefined, ctx.authenticatedPrincipal) }; } });\ndefineOperation({ name: \"recall_xray\", description: \"X-ray recall.\", schema: strictSchema({ query: S.str, sessionKey: S.str, namespace: S.str, budget: z.unknown().optional(), disclosure: S.str }),\n handler: async (input, ctx) => {\n let budget: number | undefined;\n if (input.budget !== undefined) { const p = typeof input.budget === \"number\" ? input.budget : typeof input.budget === \"string\" ? Number(input.budget) : undefined; if (p === undefined || !Number.isFinite(p) || p <= 0 || !Number.isInteger(p)) throw new EngramAccessInputError(\"recall_xray: budget expects a positive integer\"); budget = p; }\n const dr = optStr(input.disclosure);\n return { result: await ctx.service.recallXray({ query: defStr(input.query, \"\"), sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), budget, authenticatedPrincipal: ctx.authenticatedPrincipal, sourceConnector: ctx.sourceConnector, ...(dr && dr !== \"\" ? { disclosure: dr as RecallDisclosure } : {}), ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) };\n },\n});\ndefineOperation({ name: \"recall_why\", description: \"Diagnose why a query did not recall an expected memory (#3033). Read-only.\", schema: strictSchema({ query: S.str, expect: S.str, sessionKey: S.str, namespace: S.str }),\n handler: async (input, ctx) => {\n // A supplied-but-blank `expect` is a caller mistake: forward it so the\n // service rejects it, matching the HTTP route's 400 (checklist #39).\n const expect = optStr(input.expect);\n return { result: await ctx.service.recallWhy({ query: defStr(input.query, \"\"), ...(expect !== undefined ? { expect } : {}), sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal, sourceConnector: ctx.sourceConnector, ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) };\n },\n});\ndefineOperation({ name: \"who_knows\", description: \"Rank entities by demonstrated expertise for a topic (#2057).\", schema: strictSchema({ topic: S.str, limit: S.flexNum, namespace: S.str }),\n handler: async (input, ctx) => {\n const topic = defStr(input.topic, \"\");\n let limit: number | undefined;\n if (input.limit !== undefined) { const p = typeof input.limit === \"number\" ? input.limit : Number(input.limit); if (!Number.isInteger(p) || p < 1) throw new EngramAccessInputError(\"who_knows: limit expects a positive integer\"); limit = p; }\n return { result: await ctx.service.whoKnows({ topic, ...(limit !== undefined ? { limit } : {}), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) };\n },\n});\ndefineOperation({ name: \"promotion_candidates\", description: \"List agent-subject reuse-signaled promotion candidates (#2372).\", schema: strictSchema({ namespace: S.str, targetNamespace: S.str, limit: S.flexNum }),\n handler: async (input, ctx) => {\n let limit: number | undefined;\n if (input.limit !== undefined) { const p = typeof input.limit === \"number\" ? input.limit : Number(input.limit); if (!Number.isInteger(p) || p < 1 || p > 100) throw new EngramAccessInputError(\"promotion_candidates: limit expects an integer in [1, 100]\"); limit = p; }\n return { result: await ctx.service.promotionCandidates({ ...(limit !== undefined ? { limit } : {}), namespace: optStr(input.namespace), targetNamespace: optStr(input.targetNamespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) };\n },\n});\ndefineOperation({ name: \"namespace_writable\", description: \"Read-only preflight: is a namespace writable for the caller's principal?\", allowedByOps: [\"namespace_writable\", \"observe\", \"memory_store\"], schema: strictSchema({ namespace: S.str, sessionKey: S.str, op: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => {\n const writeOp = parseNamespacePreflightWriteOp(optStr(input.op));\n const namespace = optStr(input.namespace);\n const request: EngramAccessNamespaceWritableRequest = {\n sessionKey: optStr(input.sessionKey),\n authenticatedPrincipal: ctx.authenticatedPrincipal,\n cwd: optStr(input.cwd),\n projectTag: optStr(input.projectTag),\n ...(namespace ? { namespace } : {}),\n };\n return {\n result: await resolveAuthorizedNamespaceWritablePreflight(\n tokenCapabilityStore.getStore(),\n request,\n ctx.service.configRef.defaultNamespace,\n writeOp,\n (preflightRequest) => ctx.service.namespaceWritablePreflight(preflightRequest),\n ),\n };\n} });\n\n// === WEARABLES ===\ndefineOperation({ name: \"wearables_status\", description: \"Wearables status.\", schema: strictSchema({ namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.wearablesStatus({ authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }) }) });\ndefineOperation({ name: \"wearables_sync\", description: \"Sync wearables.\", schema: strictSchema({ source: S.str, date: S.str, days: S.flexNum, forceMemories: S.bool, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => { const summaries = await ctx.service.wearablesSync({ source: optStr(input.source), date: optStr(input.date), days: typeof input.days === \"number\" ? input.days : typeof input.days === \"string\" && Number.isFinite(Number(input.days)) ? Number(input.days) : undefined, forceMemories: optBool(input.forceMemories), authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }); return { result: { summaries } }; } });\ndefineOperation({ name: \"transcript_day\", description: \"Transcript for a day.\", schema: strictSchema({ date: S.str, source: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => { const d = defStr(input.date, \"\"); if (d.trim().length === 0) throw new EngramAccessInputError(\"transcript_day: date is required (YYYY-MM-DD)\"); const transcripts = await ctx.service.wearablesTranscriptDay({ date: d, source: optStr(input.source), authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }); return { result: { transcripts } }; } });\ndefineOperation({ name: \"transcript_search\", description: \"Search transcripts.\", schema: strictSchema({ query: S.str, source: S.str, from: S.str, to: S.str, limit: S.flexNum, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => { const q = defStr(input.query, \"\"); if (q.trim().length === 0) throw new EngramAccessInputError(\"transcript_search: query is required\"); const results = await ctx.service.wearablesTranscriptSearch({ query: q, source: optStr(input.source), from: optStr(input.from), to: optStr(input.to), limit: typeof input.limit === \"number\" ? input.limit : typeof input.limit === \"string\" && Number.isFinite(Number(input.limit)) ? Number(input.limit) : undefined, authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }); return { result: { results } }; } });\ndefineOperation({ name: \"transcript_memories\", description: \"Transcript memories.\", schema: strictSchema({ source: S.str, date: S.str, limit: S.flexNum, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => { const memories = await ctx.service.wearablesTranscriptMemories({ source: optStr(input.source), date: optStr(input.date), limit: typeof input.limit === \"number\" ? input.limit : typeof input.limit === \"string\" && Number.isFinite(Number(input.limit)) ? Number(input.limit) : undefined, authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }); return { result: { memories } }; } });\n\n// === MEETINGS (issue #1900) ===\ndefineOperation({ name: \"meetings_list\", description: \"List stored meeting records (all days, or one day).\", schema: strictSchema({ date: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => { const d = optStr(input.date); return { result: await ctx.service.meetingsList(d && d.length > 0 ? d : undefined, { authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }) }; } });\ndefineOperation({ name: \"meetings_get\", description: \"Get a stored meeting record by id.\", schema: strictSchema({ id: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.meetingsGet(reqStr(input.id, \"id\"), { authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }) }) });\ndefineOperation({ name: \"meetings_build\", description: \"Detect + fuse + store a day's meetings.\", schema: strictSchema({ date: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.meetingsBuild(reqStr(input.date, \"date\"), { authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey) }) }) });\n// === DEEP RECALL (issue #2332) — budgeted REFINE/EXPAND/STOP retrieval ===\ndefineOperation({ name: \"deep_recall\", description: \"Budgeted multi-hop deep recall over the anchor graph.\", schema: strictSchema({ query: S.str, maxSteps: S.flexNum, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => {\n const q = defStr(input.query, \"\");\n if (q.trim().length === 0) throw new EngramAccessInputError(\"deep_recall: query is required\");\n // Strict boundary parse (issue #2915): `\"abc\"` must NOT silently become the\n // configured default and `\"\"` must NOT become 0 — both are rejected.\n let maxSteps: number | undefined;\n try {\n maxSteps = parseDeepRecallMaxSteps(input.maxSteps);\n } catch (err) {\n throw new EngramAccessInputError(`deep_recall: ${err instanceof Error ? err.message : String(err)}`);\n }\n return { result: await ctx.service.deepRecall({ query: q, maxSteps, authenticatedPrincipal: ctx.authenticatedPrincipal, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) };\n} });\n\n// === ACTION CONFIDENCE + INSPECTOR + CAPSULE ===\ndefineOperation({ name: \"action_confidence\", description: \"Action confidence.\", schema: strictSchema({ intendedAction: S.str, confidence: S.num, risk: S.str, contextReadiness: S.str, currentContextScopes: S.strArr, userRules: z.array(z.unknown()).optional(), retrievedMemories: z.array(z.unknown()).optional() }), handler: async (input, ctx) => { const req: Record<string, unknown> = {}; if (input.intendedAction !== undefined) req.intendedAction = optStr(input.intendedAction); if (input.confidence !== undefined) req.confidence = optNum(input.confidence); if (input.risk !== undefined) req.risk = optStr(input.risk) as \"low\" | \"medium\" | \"high\" | \"irreversible\" | \"restricted\" | undefined; if (input.contextReadiness !== undefined) req.contextReadiness = optStr(input.contextReadiness) as \"none\" | \"partial\" | \"sufficient\" | undefined; if (input.currentContextScopes !== undefined) req.currentContextScopes = optStrArr(input.currentContextScopes); if (input.userRules !== undefined) req.userRules = input.userRules; if (input.retrievedMemories !== undefined) req.retrievedMemories = input.retrievedMemories; return { result: await ctx.service.actionConfidence(req) }; } });\ndefineOperation({ name: \"chatgpt_memory_inspector\", description: \"Memory inspector.\", schema: strictSchema({ query: S.str, sessionKey: S.str, namespace: S.str, currentContextScopes: S.strArr, allowUnverifiedPreview: S.bool }),\n handler: async (input, ctx) => {\n const q = defStr(input.query, \"\");\n if (q.trim().length === 0) throw new EngramAccessInputError(\"chatgpt_memory_inspector requires a non-empty query string\");\n const ii: RemnicChatGptMemoryInspectorInput = { query: q.trim() };\n if (typeof input.sessionKey === \"string\" && input.sessionKey.trim().length > 0) ii.sessionKey = input.sessionKey;\n if (typeof input.namespace === \"string\" && input.namespace.trim().length > 0) ii.namespace = input.namespace;\n if (input.currentContextScopes !== undefined) ii.currentContextScopes = input.currentContextScopes as string[];\n if (input.allowUnverifiedPreview !== undefined) ii.allowUnverifiedPreview = input.allowUnverifiedPreview as boolean;\n const rsk = ii.sessionKey ?? (ctx.authenticatedPrincipal ? \"remnic:chatgpt-memory-inspector:\" + randomUUID() : undefined);\n const xr = await ctx.service.recallXray({ query: ii.query, sessionKey: rsk, namespace: ii.namespace, currentContextScopes: ii.currentContextScopes, authenticatedPrincipal: ctx.authenticatedPrincipal, ...(ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {}), mode: \"full\", disclosure: \"chunk\", includeRecall: true, ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) });\n const x = xr.snapshotFound === true ? (xr.snapshot ?? null) : null;\n const r = xr.recall ?? { query: ii.query, namespace: ii.namespace ?? x?.namespace ?? \"global\", context: \"\", count: 0, memoryIds: [], results: [], fallbackUsed: false, sourcesUsed: [], disclosure: \"chunk\" as const };\n const ac = await ctx.service.actionConfidence(buildChatGptMemoryInspectorActionRequest(ii, r, x));\n return { result: buildChatGptMemoryInspectorResult(ii, r, x, ac) };\n },\n});\ndefineOperation({ name: \"day_summary\", description: \"Day summary.\", schema: strictSchema({ memories: S.str, includeLocation: S.bool, sessionKey: S.str, namespace: S.str, timeZone: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => { const req: Record<string, unknown> = {}; if (input.memories !== undefined) req.memories = optStr(input.memories); if (input.includeLocation !== undefined) req.includeLocation = optBool(input.includeLocation); if (input.sessionKey !== undefined) req.sessionKey = optStr(input.sessionKey); if (input.namespace !== undefined) req.namespace = optStr(input.namespace); if (input.timeZone !== undefined) req.timeZone = optStr(input.timeZone); const summary = await ctx.service.daySummary(req); return { result: summary ?? {} }; } });\ndefineOperation({ name: \"capsule_export\", description: \"Export capsule.\", schema: strictSchema({ name: S.str, namespace: S.str, since: S.str, includeKinds: S.strArr, peerIds: S.strArr, includeTranscripts: S.bool, encrypt: S.bool, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.capsuleExport({ name: optStr(input.name) ?? \"\", namespace: optStr(input.namespace), since: optStr(input.since), includeKinds: optStrArr(input.includeKinds), peerIds: optStrArr(input.peerIds), includeTranscripts: optBool(input.includeTranscripts as unknown), encrypt: optBool(input.encrypt as unknown), principal: ctx.authenticatedPrincipal } as unknown as Parameters<EngramAccessService[\"capsuleExport\"]>[0]) }) });\ndefineOperation({ name: \"capsule_import\", description: \"Import capsule.\", schema: strictSchema({ archivePath: S.str, namespace: S.str, mode: S.str, passphrase: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.capsuleImport({ archivePath: expandTildePath(optStr(input.archivePath) ?? \"\"), namespace: optStr(input.namespace), mode: optStr(input.mode) as \"skip\" | \"overwrite\" | \"fork\" | undefined, passphrase: optStr(input.passphrase), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"capsule_list\", description: \"List capsules.\", schema: strictSchema({ namespace: S.str, sessionKey: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => {\n const rp = ctx.authenticatedPrincipal ?? (typeof input.sessionKey === \"string\" && input.sessionKey.length > 0 && ctx.service.configRef ? resolvePrincipal(input.sessionKey, ctx.service.configRef) : undefined);\n return { result: await ctx.service.capsuleList({ namespace: optStr(input.namespace), principal: rp }) };\n} });\n\n// === GOVERNANCE ===\ndefineOperation({ name: \"memory_governance_run\", description: \"Run governance.\", schema: strictSchema({ namespace: S.str, mode: S.str, recentDays: S.num, maxMemories: S.num, batchSize: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.governanceRun({ namespace: optStr(input.namespace), mode: optStr(input.mode) === \"apply\" ? \"apply\" : \"shadow\", recentDays: optNum(input.recentDays), maxMemories: optNum(input.maxMemories), batchSize: optNum(input.batchSize), authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"entity_synthesis_run\", description: \"Bulk-drain the entity synthesis queue (issue #2136).\", schema: strictSchema({ namespace: S.str, maxEntities: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.entitySynthesisRun({ namespace: optStr(input.namespace), maxEntities: input.maxEntities === undefined ? undefined : (input.maxEntities as number), authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"procedure_mining_run\", description: \"Run procedure mining.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.procedureMiningRun({ namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"pattern_reinforcement_run\", description: \"Run pattern reinforcement.\", schema: strictSchema({ namespace: S.str, force: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.patternReinforcementRun({ namespace: optStr(input.namespace), force: input.force === true, authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"procedural_stats\", description: \"Procedural stats.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.procedureStats({ namespace: optStr(input.namespace) }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"procedure_library_maintenance\", description: \"Run procedure library maintenance (issue #2370): shadow-first merge / repair-flag / retire from outcome telemetry. apply=true plus procedural.maintenance.enabled required for writes.\", schema: strictSchema({ namespace: S.str, apply: S.bool, dryRun: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.procedureLibraryMaintenance({ namespace: optStr(input.namespace), apply: input.apply === true, dryRun: input.dryRun === true, authenticatedPrincipal: ctx.authenticatedPrincipal }, ctx.authenticatedPrincipal) }) });\n\n// === MEMORY/ENTITY/OBSERVE/LCM ===\ndefineOperation({ name: \"memory_timeline\", description: \"Memory timeline.\", schema: strictSchema({ memoryId: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.memoryTimeline(optStr(input.memoryId) ?? \"\", optStr(input.namespace), optNum(input.limit) ?? 200, ctx.authenticatedPrincipal) }) });\n// Issue #2482/#2829: suggestion_submit validates through the canonical\n// suggestionSubmitRequestSchema — the SAME schema the HTTP transport and the\n// MCP wire parse use, category alias transform included. The raw spelling\n// survives on `ctx.rawInput` for the coercion note.\ndefineOperation({\n name: \"suggestion_submit\",\n description: \"Submit suggestion.\",\n schema: z.preprocess((data) => stripNullsExcept(data, [\"codingContext\"]), suggestionSubmitRequestSchema),\n handler: async (input, ctx) => {\n const rawCategory = retainedCategoryAlias(ctx.rawInput);\n return {\n result: await ctx.service.suggestionSubmit({\n ...input,\n authenticatedPrincipal: ctx.authenticatedPrincipal,\n ...(ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {}),\n ...(rawCategory ? { rawCategory } : {}),\n }),\n };\n },\n});\ndefineOperation({ name: \"entity_get\", description: \"Get entity.\", schema: strictSchema({ name: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.entityGet(optStr(input.name) ?? \"\", optStr(input.namespace)) }) });\ndefineOperation({ name: \"review_queue_list\", description: \"List review queue.\", schema: strictSchema({ runId: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewQueue(optStr(input.runId) ?? \"\", optStr(input.namespace), ctx.authenticatedPrincipal) }) });\n// Issue #2482: observe validates through the canonical observeRequestSchema\n// (same as HTTP/MCP wire validation). Nullable wire fields (parts /\n// sourceFormat) map to undefined for the service's cleaned message form.\ndefineOperation({\n name: \"observe\",\n description: \"Observe messages.\",\n schema: z.preprocess(stripNulls, observeRequestSchema) as unknown as z.ZodType<ObserveRequest>,\n handler: async (input, ctx) => ({\n result: await ctx.service.observe(\n {\n sessionKey: input.sessionKey,\n messages: input.messages.map((message) => ({\n role: message.role,\n content: message.content,\n ...(message.parts ? { parts: message.parts } : {}),\n ...(message.rawContent !== undefined ? { rawContent: message.rawContent } : {}),\n ...(message.sourceFormat ? { sourceFormat: message.sourceFormat } : {}),\n })),\n skipExtraction: input.skipExtraction === true,\n idempotencyKey: input.idempotencyKey,\n namespace: input.namespace,\n authenticatedPrincipal: ctx.authenticatedPrincipal,\n cwd: input.cwd,\n projectTag: input.projectTag,\n ...(ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {}),\n },\n ctx.hooks?.enforceWriteQuota ? { enforceWriteQuota: ctx.hooks.enforceWriteQuota } : undefined,\n ),\n }),\n});\ndefineOperation({ name: \"lcm_search\", description: \"Search LCM.\", schema: strictSchema({ query: S.str, sessionKey: S.str, sessionPrefix: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmSearch({ query: defStr(input.query, \"\"), sessionKey: optStr(input.sessionKey), sessionPrefix: optStr(input.sessionPrefix), namespace: optStr(input.namespace), limit: optNum(input.limit), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"lcm_compaction_flush\", description: \"Flush LCM compaction.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionFlush({ sessionKey: optStr(input.sessionKey) ?? \"\", namespace: optStr(input.namespace), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), authenticatedPrincipal: ctx.authenticatedPrincipal, ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) }) });\ndefineOperation({ name: \"extraction_force_flush\", description: \"Force-drain a session extraction buffer.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str, cwd: S.str, projectTag: S.str, deadlineMs: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.extractionForceFlush({ sessionKey: optStr(input.sessionKey) ?? \"\", namespace: optStr(input.namespace), cwd: optStr(input.cwd), projectTag: optStr(input.projectTag), deadlineMs: optNum(input.deadlineMs), authenticatedPrincipal: ctx.authenticatedPrincipal, onCommitted: ctx.hooks?.recordWriteCommit, ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) }) });\ndefineOperation({ name: \"lcm_compaction_record\", description: \"Record LCM compaction.\", schema: strictSchema({ sessionKey: S.str, namespace: S.str, tokensBefore: S.num, tokensAfter: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.lcmCompactionRecord({ sessionKey: optStr(input.sessionKey) ?? \"\", namespace: optStr(input.namespace), tokensBefore: optNum(input.tokensBefore) ?? 0, tokensAfter: optNum(input.tokensAfter) ?? 0, authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\n\n// === CONTINUITY/IDENTITY ===\ndefineOperation({ name: \"continuity_audit_generate\", description: \"Continuity audit.\", fleetWide: true, schema: strictSchema({ period: S.str, key: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityAuditGenerate({ period: optStr(input.period) === \"monthly\" ? \"monthly\" : optStr(input.period) === \"weekly\" ? \"weekly\" : undefined, key: optStr(input.key) }) }) });\ndefineOperation({ name: \"continuity_incident_open\", description: \"Open incident.\", schema: strictSchema({ symptom: S.str, namespace: S.str, triggerWindow: S.str, suspectedCause: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityIncidentOpen({ symptom: optStr(input.symptom) ?? \"\", namespace: optStr(input.namespace), triggerWindow: optStr(input.triggerWindow), suspectedCause: optStr(input.suspectedCause), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"continuity_incident_close\", description: \"Close incident.\", schema: strictSchema({ id: S.str, namespace: S.str, fixApplied: S.str, verificationResult: S.str, preventiveRule: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityIncidentClose({ id: optStr(input.id) ?? \"\", namespace: optStr(input.namespace), fixApplied: optStr(input.fixApplied) ?? \"\", verificationResult: optStr(input.verificationResult) ?? \"\", preventiveRule: optStr(input.preventiveRule), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"continuity_incident_list\", description: \"List incidents.\", schema: strictSchema({ state: S.str, namespace: S.str, limit: S.num }), handler: async (input, ctx) => { const st = optStr(input.state); return { result: await ctx.service.continuityIncidentList({ state: st === \"closed\" ? \"closed\" : st === \"all\" ? \"all\" : st === \"open\" ? \"open\" : undefined, namespace: optStr(input.namespace), limit: optNum(input.limit), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"continuity_loop_add_or_update\", description: \"Add/update loop.\", schema: strictSchema({ id: S.str, cadence: S.str, purpose: S.str, status: S.str, killCondition: S.str, namespace: S.str, lastReviewed: S.str, notes: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.continuityLoopAddOrUpdate({ id: optStr(input.id) ?? \"\", cadence: (optStr(input.cadence) as \"daily\" | \"weekly\" | \"monthly\" | \"quarterly\") ?? \"weekly\", purpose: optStr(input.purpose) ?? \"\", status: (optStr(input.status) as \"active\" | \"paused\" | \"retired\") ?? \"active\", killCondition: optStr(input.killCondition) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, lastReviewed: optStr(input.lastReviewed), notes: optStr(input.notes) }) }) });\ndefineOperation({ name: \"continuity_loop_review\", description: \"Review loop.\", schema: strictSchema({ id: S.str, namespace: S.str, status: S.str, notes: S.str, reviewedAt: S.str }), handler: async (input, ctx) => { const st = optStr(input.status); return { result: await ctx.service.continuityLoopReview({ id: optStr(input.id) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, status: st === \"active\" || st === \"paused\" || st === \"retired\" ? st as \"active\" | \"paused\" | \"retired\" : undefined, notes: optStr(input.notes), reviewedAt: optStr(input.reviewedAt) }) }; } });\ndefineOperation({ name: \"identity_anchor_get\", description: \"Get identity anchor.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.identityAnchorGet({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"identity_anchor_update\", description: \"Update identity anchor.\", schema: strictSchema({ namespace: S.str, identityTraits: S.str, communicationPreferences: S.str, operatingPrinciples: S.str, continuityNotes: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.identityAnchorUpdate({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, identityTraits: optStr(input.identityTraits), communicationPreferences: optStr(input.communicationPreferences), operatingPrinciples: optStr(input.operatingPrinciples), continuityNotes: optStr(input.continuityNotes) }) }) });\ndefineOperation({ name: \"memory_identity\", description: \"Memory identity.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryIdentity({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\n\n// === WORK/SHARED ===\ndefineOperation({ name: \"work_task\", description: \"Manage work task.\", schema: strictSchema({ action: S.str, id: S.str, title: S.str, description: S.str, status: S.str, priority: S.str, owner: S.str, assignee: S.str, projectId: S.str, tags: S.strArr, dueAt: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.workTask({ action: (optStr(input.action) as \"update\" | \"list\" | \"get\" | \"create\" | \"delete\" | \"transition\") ?? \"list\", id: optStr(input.id), title: optStr(input.title), description: optStr(input.description), status: optStr(input.status), priority: optStr(input.priority), owner: optStr(input.owner), assignee: optStr(input.assignee), projectId: optStr(input.projectId), tags: optStrArr(input.tags), dueAt: optStr(input.dueAt) }) }) });\ndefineOperation({ name: \"work_project\", description: \"Manage work project.\", schema: strictSchema({ action: S.str, id: S.str, name: S.str, description: S.str, status: S.str, owner: S.str, tags: S.strArr, taskId: S.str, projectId: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.workProject({ action: (optStr(input.action) as \"update\" | \"list\" | \"get\" | \"create\" | \"delete\" | \"link_task\") ?? \"list\", id: optStr(input.id), name: optStr(input.name), description: optStr(input.description), status: optStr(input.status), owner: optStr(input.owner), tags: optStrArr(input.tags), taskId: optStr(input.taskId), projectId: optStr(input.projectId) }) }) });\ndefineOperation({ name: \"work_board\", description: \"Manage work board.\", schema: strictSchema({ action: S.str, projectId: S.str, snapshotJson: S.str, linkToMemory: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.workBoard({ action: (optStr(input.action) as \"export_markdown\" | \"export_snapshot\" | \"import_snapshot\") ?? \"export_markdown\", projectId: optStr(input.projectId) ?? \"\", snapshotJson: optStr(input.snapshotJson) ?? \"\", linkToMemory: input.linkToMemory === true }) }) });\n// Issue #2920: the envelope controls (authority/expiresAt/supersedes) are\n// parsed by the ONE canonical surface module shared with the OpenClaw tool\n// (write-output-controls.ts); semantics stay in composeWriteEnvelope. A\n// client-supplied principal/namespace is rejected here — identity and\n// scoping are server-resolved (ctx.authenticatedPrincipal).\ndefineOperation({\n name: \"shared_context_write_output\",\n description: \"Write shared output.\",\n schema: strictSchema({ agentId: S.str, title: S.str, content: S.str, authority: S.str, expiresAt: S.str, supersedes: S.str }),\n handler: async (input, ctx) => {\n let controls: SharedWriteOutputControls;\n try {\n controls = parseSharedWriteOutputControls(input);\n } catch (error) {\n throw new EngramAccessInputError(error instanceof Error ? error.message : String(error));\n }\n return {\n result: await ctx.service.sharedContextWriteOutput({\n agentId: optStr(input.agentId) ?? \"\",\n title: optStr(input.title) ?? \"\",\n content: optStr(input.content) ?? \"\",\n ...controls,\n principal: ctx.authenticatedPrincipal,\n }),\n };\n },\n});\ndefineOperation({ name: \"shared_feedback_record\", description: \"Record shared feedback.\", schema: strictSchema({ agent: S.str, decision: S.str, reason: S.str, date: S.str, learning: S.str, outcome: S.str, severity: S.str, confidence: S.num, workflow: S.str, tags: S.strArr, evidenceWindowStart: S.str, evidenceWindowEnd: S.str, refs: S.strArr }), handler: async (input, ctx) => { const sv = optStr(input.severity); return { result: await ctx.service.sharedFeedbackRecord({ agent: optStr(input.agent) ?? \"\", decision: (optStr(input.decision) as \"rejected\" | \"approved\" | \"approved_with_feedback\") ?? \"approved\", reason: optStr(input.reason) ?? \"\", date: optStr(input.date), learning: optStr(input.learning), outcome: optStr(input.outcome), severity: sv === \"low\" || sv === \"medium\" || sv === \"high\" ? sv as \"low\" | \"medium\" | \"high\" : undefined, confidence: optNum(input.confidence), workflow: optStr(input.workflow), tags: optStrArr(input.tags), evidenceWindowStart: optStr(input.evidenceWindowStart), evidenceWindowEnd: optStr(input.evidenceWindowEnd), refs: optStrArr(input.refs) }) }; } });\ndefineOperation({ name: \"shared_priorities_append\", description: \"Append priorities.\", schema: strictSchema({ agentId: S.str, text: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedPrioritiesAppend({ agentId: optStr(input.agentId) ?? \"\", text: optStr(input.text) ?? \"\" }) }) });\ndefineOperation({ name: \"shared_context_cross_signals_run\", description: \"Run cross signals.\", fleetWide: true, schema: strictSchema({ date: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedContextCrossSignalsRun({ date: optStr(input.date) }) }) });\ndefineOperation({ name: \"shared_context_curate_daily\", description: \"Curate daily.\", fleetWide: true, schema: strictSchema({ date: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.sharedContextCurateDaily({ date: optStr(input.date) }) }) });\ndefineOperation({ name: \"compounding_weekly_synthesize\", description: \"Weekly synthesize.\", fleetWide: true, schema: strictSchema({ weekId: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.compoundingWeeklySynthesize({ weekId: optStr(input.weekId) }) }) });\ndefineOperation({ name: \"compounding_promote_candidate\", description: \"Promote candidate.\", fleetWide: true, schema: strictSchema({ weekId: S.str, candidateId: S.str, dryRun: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.compoundingPromoteCandidate({ weekId: optStr(input.weekId) ?? \"\", candidateId: optStr(input.candidateId) ?? \"\", dryRun: input.dryRun === true }) }) });\ndefineOperation({ name: \"compression_guidelines_optimize\", description: \"Optimize guidelines.\", fleetWide: true, schema: strictSchema({ dryRun: S.bool, eventLimit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.compressionGuidelinesOptimize({ dryRun: input.dryRun === true, eventLimit: optNum(input.eventLimit) }) }) });\ndefineOperation({ name: \"compression_guidelines_activate\", description: \"Activate guidelines.\", fleetWide: true, schema: strictSchema({ expectedContentHash: S.str, expectedGuidelineVersion: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.compressionGuidelinesActivate({ expectedContentHash: optStr(input.expectedContentHash), expectedGuidelineVersion: optNum(input.expectedGuidelineVersion) }) }) });\n\n// === MEMORY DEBUG/GRAPH/FEEDBACK ===\ndefineOperation({ name: \"memory_profile\", description: \"Memory profile.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryProfile(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_entities_list\", description: \"List entities.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryEntitiesList(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_questions\", description: \"Memory questions.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryQuestions(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_last_recall\", description: \"Last recall.\", schema: strictSchema({ sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.lastRecallSnapshot(optStr(input.sessionKey)) }) });\ndefineOperation({ name: \"memory_intent_debug\", description: \"Debug intent.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.intentDebug(optStr(input.namespace)) }) });\ndefineOperation({ name: \"memory_qmd_debug\", description: \"Debug QMD.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.qmdDebug(optStr(input.namespace)) }) });\ndefineOperation({ name: \"memory_graph_explain\", description: \"Explain graph.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.graphExplainLastRecall(optStr(input.namespace)) }) });\ndefineOperation({ name: \"graph_snapshot\", description: \"Graph snapshot.\", schema: strictSchema({ namespace: S.str, limit: S.num, since: S.str, focusNodeId: S.str, categories: S.strArr }), handler: async (input, ctx) => ({ result: await ctx.service.graphSnapshot({ namespace: optStr(input.namespace), limit: optNum(input.limit), since: optStr(input.since), focusNodeId: optStr(input.focusNodeId), categories: optStrArr(input.categories) }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"memory_feedback\", description: \"Record feedback.\", schema: strictSchema({ memoryId: S.str, vote: S.str, note: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryFeedback({ memoryId: optStr(input.memoryId) ?? \"\", vote: optStr(input.vote) === \"down\" ? \"down\" : \"up\", note: optStr(input.note) }) }) });\ndefineOperation({ name: \"memory_promote\", description: \"Promote memory.\", schema: strictSchema({ memoryId: S.str, namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.memoryPromote({ memoryId: optStr(input.memoryId) ?? \"\", namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"memory_outcome\", description: \"Record outcome.\", schema: strictSchema({ memoryId: S.str, outcome: S.str, namespace: S.str, sessionKey: S.str, timestamp: S.str }), handler: async (input, ctx) => { const o = optStr(input.outcome); if (o !== \"success\" && o !== \"failure\") throw new EngramAccessInputError(\"memory_outcome: outcome must be \\\"success\\\" or \\\"failure\\\"; got \" + JSON.stringify(o)); return { result: await ctx.service.memoryOutcome({ memoryId: optStr(input.memoryId) ?? \"\", outcome: o, namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), timestamp: optStr(input.timestamp), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"memory_action_apply\", description: \"Apply action.\", schema: strictSchema({ action: S.str, outcome: S.str, reason: S.str, memoryId: S.str, namespace: S.str, sessionKey: S.str, content: S.str, category: S.str, linkTargetId: S.str, linkType: S.str, linkStrength: S.num, artifactType: S.str, execute: S.bool, sourcePrompt: S.str, dryRun: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.memoryActionApply({ action: optStr(input.action) ?? \"\", outcome: optStr(input.outcome), reason: optStr(input.reason), memoryId: optStr(input.memoryId) ?? \"\", namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), content: optStr(input.content), category: optStr(input.category), linkTargetId: optStr(input.linkTargetId), linkType: optStr(input.linkType), linkStrength: optNum(input.linkStrength), artifactType: optStr(input.artifactType), execute: optBool(input.execute), sourcePrompt: optStr(input.sourcePrompt), dryRun: input.dryRun === true, principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"context_checkpoint\", description: \"Context checkpoint.\", schema: strictSchema({ sessionKey: S.str, context: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.contextCheckpoint({ sessionKey: optStr(input.sessionKey) ?? \"\", context: optStr(input.context) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"briefing\", description: \"Daily briefing.\", schema: strictSchema({ since: S.str, focus: S.str, namespace: S.str, includeLocation: S.bool, format: S.str, maxFollowups: S.num }), handler: async (input, ctx) => { const rf = optStr(input.format); const fe = validateBriefingFormat(rf); if (fe) throw new EngramAccessInputError(fe); return { result: await ctx.service.briefing({ since: optStr(input.since), focus: optStr(input.focus), namespace: optStr(input.namespace), includeLocation: optBool(input.includeLocation), format: rf as \"json\" | \"markdown\" | undefined, maxFollowups: optNum(input.maxFollowups), principal: ctx.authenticatedPrincipal }) }; } });\n\n// === CONTRADICTION/REVIEW ===\ndefineOperation({ name: \"review_list\", description: \"List review pairs.\", schema: strictSchema({ filter: S.str, namespace: S.str, limit: S.num }),\n handler: async (input, ctx) => {\n const VF = new Set([\"all\", \"unresolved\", \"contradicts\", \"independent\", \"duplicates\", \"needs-user\"]);\n const rf = optStr(input.filter) ?? \"unresolved\";\n if (!VF.has(rf)) throw new EngramAccessInputError(\"Invalid filter '\" + rf + \"'. Valid: \" + [...VF].join(\", \"));\n const ns = optStr(input.namespace);\n const resolved = await ctx.service.getReadableStorageForNamespace(ns, ctx.authenticatedPrincipal);\n const rn = ctx.service.configRef.namespacesEnabled ? resolved.namespace : undefined;\n const iun = Boolean(rn && isDefaultReviewNamespace(ctx.service.configRef.defaultNamespace, ns, rn));\n return { result: await listPairs(ctx.service.memoryDir, { filter: rf as \"all\" | \"unresolved\" | \"contradicts\" | \"independent\" | \"duplicates\" | \"needs-user\", namespace: rn, includeUnscopedForNamespace: iun, limit: optNum(input.limit) ?? 50 }) };\n },\n});\ndefineOperation({ name: \"review_resolve\", description: \"Resolve pair.\", schema: strictSchema({ pairId: S.str, verb: S.str, mergedMemoryId: S.str, mergedContent: S.str }),\n handler: async (input, ctx) => {\n const pid = defStr(input.pairId, \"\"); const vb = defStr(input.verb, \"\");\n if (!pid) throw new EngramAccessInputError(\"pairId is required\");\n if (!vb) throw new EngramAccessInputError(\"verb is required\");\n if (!isValidResolutionVerb(vb)) throw new EngramAccessInputError(\"Invalid verb: \" + vb);\n // Per-token namespace enforcement (issue #1850 round 9): review_resolve\n // selects its target BY pairId, so the affected namespace comes from the\n // record — NOT a request param that the MCP-over-HTTP tools/call gate\n // (toolAcceptsNamespace) already enforces (this tool's schema carries no\n // `namespace` property). A namespace-scoped bearer must not mutate a\n // contradiction pair in a namespace outside its allow-list. Load the pair\n // to learn its namespace, enforce the token's scope via the SAME\n // effective-namespace chokepoint the HTTP review/resolve route uses\n // (enforceNamespaceAllowList maps undefined → default, so a scoped token\n // whose allow-list INCLUDES the default can resolve a legacy pair), and\n // fail closed BEFORE dispatching the (mutating) resolution. A missing pair\n // falls through to executeResolution's existing not-found result. No-op for\n // unrestricted/legacy tokens. Mirrors access-http.ts review/resolve exactly.\n const targetPair = readPair(ctx.service.memoryDir, pid);\n if (targetPair) {\n enforceNamespaceAllowList(\n tokenCapabilityStore.getStore(),\n targetPair.namespace,\n ctx.service.configRef?.defaultNamespace,\n );\n }\n return { result: await executeResolution(ctx.service.memoryDir, ctx.service.storageRef, pid, vb, { mergedMemoryId: optStr(input.mergedMemoryId), mergedContent: optStr(input.mergedContent), storageForNamespace: async (namespace) => { const r = await ctx.service.getWritableStorageForNamespace(namespace, ctx.authenticatedPrincipal); return r.storage; }, onMergedMemoryWritten: () => {} }) };\n },\n});\ndefineOperation({ name: \"contradiction_scan_run\", description: \"Run scan.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await runContradictionScan({ storage: ctx.service.storageRef, config: ctx.service.configRef, memoryDir: ctx.service.memoryDir, embeddingLookupFactory: ctx.service.embeddingLookupFactoryRef, storageForNamespace: (ns) => ctx.service.getWritableStorageForNamespace(ns ?? undefined, ctx.authenticatedPrincipal), localLlm: ctx.service.localLlmRef, fallbackLlm: ctx.service.fallbackLlmRef, namespace: optStr(input.namespace) }) }) });\ndefineOperation({ name: \"preference_drift_scan\", description: \"Run preference drift scan.\", schema: strictSchema({ namespace: S.str, apply: S.bool }), handler: async (input, ctx) => ({ result: await runPreferenceDriftScan({ storage: ctx.service.storageRef, config: ctx.service.configRef, memoryDir: ctx.service.memoryDir, embeddingLookupFactory: ctx.service.embeddingLookupFactoryRef, storageForNamespace: (ns) => ctx.service.getWritableStorageForNamespace(ns ?? undefined, ctx.authenticatedPrincipal), localLlm: ctx.service.localLlmRef, fallbackLlm: ctx.service.fallbackLlmRef, namespace: optStr(input.namespace), apply: input.apply === true }) }) });\ndefineOperation({ name: \"graph_edge_decay_run\", description: \"Run edge decay.\", fleetWide: true, schema: strictSchema({ dryRun: S.bool }), handler: async (input, ctx) => { const cfg = ctx.service.configRef; if (!cfg.graphEdgeDecayEnabled) return { result: { ranAt: new Date().toISOString(), disabled: true, reason: \"graphEdgeDecayEnabled is false\" } }; return { result: { results: await runGraphEdgeDecayMaintenanceAcrossNamespaces(ctx.service.memoryDir, { windowMs: cfg.graphEdgeDecayWindowMs, perWindow: cfg.graphEdgeDecayPerWindow, floor: cfg.graphEdgeDecayFloor, visibilityThreshold: cfg.graphEdgeDecayVisibilityThreshold, dryRun: input.dryRun === true, namespacesEnabled: cfg.namespacesEnabled === true, defaultNamespace: cfg.defaultNamespace }) } }; } });\n\n// === SUMMARIZE/PROFILING/PEERS/CONSOLE/DREAMS ===\ndefineOperation({ name: \"memory_summarize_hourly\", description: \"Hourly summarize.\", fleetWide: true, schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.memorySummarizeHourly() }) });\ndefineOperation({ name: \"conversation_index_update\", description: \"Update conv index.\", fleetWide: true, schema: strictSchema({ sessionKey: S.str, hours: S.num, embed: S.bool }), handler: async (input, ctx) => { if (input.sessionKey !== undefined && typeof input.sessionKey !== \"string\") throw new EngramAccessInputError(\"sessionKey must be a string when provided\"); return { result: await ctx.service.conversationIndexUpdate({ sessionKey: optStr(input.sessionKey), hours: optNum(input.hours), embed: optBool(input.embed) }) }; } });\ndefineOperation({ name: \"profiling_report\", description: \"Profiling report.\", schema: strictSchema({ format: S.str, limit: S.num }), handler: async (input, ctx) => { if (input.format !== undefined && typeof input.format !== \"string\") throw new EngramAccessInputError(\"format must be a string when provided\"); if (input.limit !== undefined && typeof input.limit !== \"number\") throw new EngramAccessInputError(\"limit must be a number when provided\"); return { result: await ctx.service.profilingReport({ format: optStr(input.format), limit: optNum(input.limit) }) }; } });\ndefineOperation({ name: \"live_connectors_run\", description: \"Run connectors.\", fleetWide: true, schema: strictSchema({ force: S.bool }), handler: async (input, ctx) => ({ result: await ctx.service.liveConnectorsRun({ authenticatedPrincipal: ctx.authenticatedPrincipal, force: input.force === true }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"peer_list\", description: \"List peers.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.peerList() }) });\ndefineOperation({ name: \"peer_get\", description: \"Get peer.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_get: id is required\"); return { result: await ctx.service.peerGet(id) }; } });\ndefineOperation({ name: \"peer_set\", description: \"Set peer.\", schema: strictSchema({ id: S.str, kind: S.str, displayName: S.str, notes: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_set: id is required\"); if (input.kind !== undefined && typeof input.kind !== \"string\") throw new EngramAccessInputError(\"peer_set: kind must be a string when provided\"); if (input.displayName !== undefined && typeof input.displayName !== \"string\") throw new EngramAccessInputError(\"peer_set: displayName must be a string when provided\"); if (input.notes !== undefined && typeof input.notes !== \"string\") throw new EngramAccessInputError(\"peer_set: notes must be a string when provided\"); return { result: await ctx.service.peerSet({ id, kind: optStr(input.kind), displayName: optStr(input.displayName), notes: optStr(input.notes) }) }; } });\ndefineOperation({ name: \"peer_delete\", description: \"Delete peer.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_delete: id is required\"); return { result: await ctx.service.peerDelete(id) }; } });\ndefineOperation({ name: \"peer_profile_get\", description: \"Get peer profile.\", schema: strictSchema({ id: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_profile_get: id is required\"); return { result: await ctx.service.peerProfileGet(id) }; } });\ndefineOperation({ name: \"peer_forget\", description: \"Forget peer.\", schema: strictSchema({ id: S.str, confirm: S.str }), handler: async (input, ctx) => { const id = defStr(input.id, \"\"); if (!id) throw new EngramAccessInputError(\"peer_forget: id is required\"); const c = optStr(input.confirm) ?? \"\"; if (c !== \"yes\") throw new EngramAccessInputError(\"peer_forget: confirm must be 'yes' to prevent accidental data loss\"); return { result: await ctx.service.peerForget(id, { confirm: \"yes\" }) }; } });\ndefineOperation({ name: \"console_state\", description: \"Console state.\", schema: strictSchema({ namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.consoleState(optStr(input.namespace), ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"dreams_status\", description: \"Dreams status.\", schema: strictSchema({ windowHours: S.num, namespace: S.str }), handler: async (input, ctx) => { let wh = 24; try { wh = normalizeDreamsStatusWindowHours(input.windowHours); } catch { throw new EngramAccessInputError(\"dreams_status: windowHours must be a positive integer. Got: \" + String(input.windowHours)); } return { result: await ctx.service.dreamsStatus({ windowHours: wh, namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }; } });\ndefineOperation({ name: \"dreams_run\", description: \"Run dreams.\", schema: strictSchema({ phase: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => { const VP = [\"lightSleep\", \"rem\", \"deepSleep\"]; const ph = optStr(input.phase) ?? \"\"; if (!ph || !VP.includes(ph)) throw new EngramAccessInputError(\"dreams_run: phase must be one of: \" + VP.join(\", \")); if (input.dryRun !== undefined && typeof input.dryRun !== \"boolean\") throw new EngramAccessInputError(\"dreams_run: dryRun must be boolean\"); return { result: await ctx.service.dreamsRun({ phase: ph as DreamsPhase, dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }; } });\n\ndefineOperation({ name: \"correction_pending\", description: \"List pending corrections (HTTP GET).\", schema: strictSchema({ namespace: S.str, sessionKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.correctionListPending({ namespace: optStr(input.namespace), sessionKey: optStr(input.sessionKey), principal: ctx.authenticatedPrincipal }) }) });\n\n// === HTTP-ONLY ===\ndefineOperation({ name: \"offline_sync_snapshot\", description: \"Offline sync snapshot.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.offlineSyncSnapshot() }) });\ndefineOperation({ name: \"offline_sync_files\", description: \"Offline sync files.\", schema: strictSchema({ paths: S.strArr, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncFiles({ paths: optStrArr(input.paths) ?? [], namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"offline_sync_file_content\", description: \"Read file content.\", schema: strictSchema({ path: S.str, namespace: S.str, offset: S.num, length: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncFileContent({ path: optStr(input.path) ?? \"\", namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, offset: optNum(input.offset), length: optNum(input.length) }) }) });\ndefineOperation({ name: \"offline_sync_apply_file_content\", description: \"Apply file content.\", schema: strictSchema({ sourceId: S.str, path: S.str, sha256: S.str, bytes: S.num, mtimeMs: S.num, offset: S.num, baseSha256: S.str, content: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncApplyFileContent({ sourceId: optStr(input.sourceId) ?? \"\", path: optStr(input.path) ?? \"\", sha256: optStr(input.sha256) ?? \"\", bytes: optNum(input.bytes) ?? 0, mtimeMs: optNum(input.mtimeMs) ?? 0, offset: optNum(input.offset), baseSha256: optStr(input.baseSha256), content: Buffer.from(defStr(input.content, \"\"), \"base64\"), namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"offline_sync_apply\", description: \"Apply sync.\", schema: strictSchema({ changeset: z.unknown().optional(), namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.offlineSyncApply({ changeset: input.changeset, namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"lcm_status\", description: \"LCM status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.lcmStatus() }) });\ndefineOperation({ name: \"memory_list\", description: \"List memories.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.memoryBrowse() }) });\ndefineOperation({\n name: \"recall_timings\",\n description: \"List recent recall timings.\",\n schema: strictSchema({}),\n handler: async (_input, ctx) => {\n if (\n !isRecallTimingsOperator(\n ctx.service.configRef,\n ctx.authenticatedPrincipal,\n ctx.operatorPrincipal,\n )\n ) {\n throw new EngramAccessForbiddenError(\"recall timings require the configured operator principal\");\n }\n return { result: getRecallTimingStatus(ctx.service.configRef) };\n },\n});\ndefineOperation({ name: \"entity_list\", description: \"List entities.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.entityList() }) });\ndefineOperation({ name: \"maintenance_status\", description: \"Maintenance status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.maintenance() }) });\ndefineOperation({ name: \"quality_status\", description: \"Quality status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.quality() }) });\ndefineOperation({ name: \"trust_zones_status\", description: \"Trust-zone status.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.trustZoneStatus() }) });\ndefineOperation({ name: \"trust_zones_records\", description: \"Browse trust-zone records.\", schema: strictSchema({ namespace: S.str, limit: S.num, offset: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.trustZoneBrowse({ namespace: optStr(input.namespace), limit: optNum(input.limit), offset: optNum(input.offset) }, ctx.authenticatedPrincipal) }) });\ndefineOperation({ name: \"review_disposition\", description: \"Review disposition.\", schema: strictSchema({ memoryId: S.str, status: S.str, reasonCode: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewDisposition({ memoryId: optStr(input.memoryId) ?? \"\", status: (optStr(input.status) ?? \"archived\") as never, reasonCode: optStr(input.reasonCode) ?? \"\", namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"review_deck_list\", description: \"List review deck.\", schema: strictSchema({ namespace: S.str, cursor: S.str, limit: S.num }), handler: async (input, ctx) => ({ result: await ctx.service.reviewDeckList({ namespace: optStr(input.namespace), principal: ctx.authenticatedPrincipal, cursor: optStr(input.cursor), limit: optNum(input.limit) ?? 1 }) }) });\ndefineOperation({ name: \"review_deck_action\", description: \"Apply review deck action.\", schema: strictSchema({ itemId: S.str, revision: S.str, action: S.str, correctionText: S.str, idempotencyKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewDeckAction({ schemaVersion: 1, itemId: reqStr(input.itemId, \"itemId\"), revision: reqStr(input.revision, \"revision\"), action: reqStr(input.action, \"action\") as \"keep\", idempotencyKey: reqStr(input.idempotencyKey, \"idempotencyKey\"), ...(optStr(input.correctionText) ? { correctionText: optStr(input.correctionText)! } : {}) } as never, { principal: ctx.authenticatedPrincipal, signal: ctx.abortSignal }) }) });\ndefineOperation({ name: \"review_deck_undo\", description: \"Undo review deck action.\", schema: strictSchema({ receiptId: S.str, expectedRevision: S.str, idempotencyKey: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.reviewDeckUndo({ schemaVersion: 1, receiptId: reqStr(input.receiptId, \"receiptId\"), expectedRevision: reqStr(input.expectedRevision, \"expectedRevision\"), idempotencyKey: reqStr(input.idempotencyKey, \"idempotencyKey\") }, { principal: ctx.authenticatedPrincipal, signal: ctx.abortSignal }) }) });\ndefineOperation({ name: \"trust_zones_promote\", description: \"Promote trust-zone.\", schema: strictSchema({ recordId: S.str, targetZone: S.str, promotionReason: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.trustZonePromote({ recordId: optStr(input.recordId) ?? \"\", targetZone: (optStr(input.targetZone) ?? \"working\") as never, promotionReason: optStr(input.promotionReason) ?? \"\", dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"trust_zones_demo_seed\", description: \"Demo seed.\", schema: strictSchema({ scenario: S.str, dryRun: S.bool, namespace: S.str }), handler: async (input, ctx) => ({ result: await ctx.service.trustZoneDemoSeed({ scenario: optStr(input.scenario), dryRun: input.dryRun === true, namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) }) });\ndefineOperation({ name: \"citations_observed\", description: \"Record citations.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });\ndefineOperation({ name: \"contradiction_detail\", description: \"Contradiction detail.\", schema: strictSchema({ id: S.str, namespace: S.str }), handler: async (input, ctx) => ({ result: await listPairs(ctx.service.memoryDir, { filter: \"all\" as const, namespace: optStr(input.namespace), includeUnscopedForNamespace: false, limit: 1 }) }) });\ndefineOperation({ name: \"offline_sync_snapshot_stream\", description: \"SSE stream.\", schema: strictSchema({}), handler: async (_i, ctx) => ({ result: await ctx.service.offlineSyncSnapshotStream() }) });\ndefineOperation({ name: \"graph_events\", description: \"SSE graph events.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: \"sse\" } }) });\ndefineOperation({ name: \"chat_message\", description: \"Chat message.\", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });\ndefineOperation({ name: \"chat_events\", description: \"SSE chat events.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: \"sse\" } }) });\ndefineOperation({ name: \"adapters_status\", description: \"Adapter registry metadata (issue #1850 round 5). Marker op: the HTTP transport builds the response from its own adapterRegistry, but the op still must be registered so it appears in listRegisteredOperations and enforceTokenOp can gate it for scoped tokens.\", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AA6ClB,SAAS,WAAW,MAAwB;AAC1C,MAAI,SAAS,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACrE,UAAM,MAAM;AACZ,UAAM,UAAmC,CAAC;AAC1C,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,UAAI,UAAU,KAAM,SAAQ,GAAG,IAAI;AAAA,IACrC;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,SAAS,aAAsC,OAA8C;AAC3F,SAAO,EAAE,WAAW,YAAY,EAAE,OAAO,KAAK,EAAE,YAAY,CAAC;AAC/D;AAQA,SAAS,iBAAiB,MAAe,UAAsC;AAC7E,MAAI,SAAS,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACrE,UAAM,UAAmC,CAAC;AAC1C,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAC1E,UAAI,UAAU,QAAQ,SAAS,SAAS,GAAG,EAAG,SAAQ,GAAG,IAAI;AAAA,IAC/D;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGA,SAAS,OAAO,GAAgC;AAAE,SAAO,OAAO,MAAM,WAAW,IAAI;AAAW;AAChG,SAAS,OAAO,GAAY,OAAuB;AACjD,MAAI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AAU,EAAE,QAAQ,EAAE,IAAI,KAAK,EAAE,GAAG,CAAC;AAC/L,gBAAgB,EAAE,MAAM,eAAe,aAAa,oBAAoB,QAAQ,aAAa,CAAC,CAAC,GAAG,SAAS,OAAO,IAAI,UAAU,EAAE,QAAQ,EAAE,QAAQ,MAAM,EAAE,GAAG,CAAC;AAChK,gBAAgB,EAAE,MAAM,mBAAmB,aAAa,oQAAoQ,QAAQ,aAAa,CAAC,CAAC,GAAG,SAAS,OAAO,IAAI,UAAU,EAAE,QAAQ,EAAE,IAAI,KAAK,EAAE,GAAG,CAAC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runLocationSync
3
- } from "./chunk-SUSMEKBE.js";
3
+ } from "./chunk-EU3N5MK3.js";
4
4
  import {
5
5
  log
6
6
  } from "./chunk-3WCASNQZ.js";
@@ -58,4 +58,4 @@ export {
58
58
  LOCATION_SYNC_DEFAULT_INTERVAL_MS,
59
59
  startLocationAutoSync
60
60
  };
61
- //# sourceMappingURL=chunk-NYZRJW5X.js.map
61
+ //# sourceMappingURL=chunk-BJX3VQWZ.js.map
@@ -6,4 +6,4 @@ function delegateExtractionForceFlush(delegate, request) {
6
6
  export {
7
7
  delegateExtractionForceFlush
8
8
  };
9
- //# sourceMappingURL=chunk-3QL24R5Y.js.map
9
+ //# sourceMappingURL=chunk-C2WWQ4OR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-service-helpers.ts"],"sourcesContent":["import type { CodingScopedWriteInput } from \"./access-service.js\";\n\n\nexport interface EngramAccessLcmCompactionFlushRequest extends CodingScopedWriteInput {\n sessionKey: string;\n namespace?: string;\n authenticatedPrincipal?: string;\n abortSignal?: AbortSignal;\n}\n\nexport interface EngramAccessLcmCompactionFlushResponse {\n enabled: boolean;\n flushed: boolean;\n sessionKey: string;\n namespace: string;\n reason?: string;\n}\n\nexport interface EngramAccessExtractionForceFlushRequest extends CodingScopedWriteInput {\n sessionKey: string;\n namespace?: string;\n authenticatedPrincipal?: string;\n deadlineMs?: number;\n abortSignal?: AbortSignal;\n /** Internal HTTP hook invoked at the durable commit boundary. */\n onCommitted?: () => void;\n}\n\nexport interface EngramAccessExtractionForceFlushResponse {\n flushed: boolean;\n sessionKey: string;\n namespace: string;\n effectiveNamespace: string;\n}\n\nexport interface ExtractionForceFlushDelegate {\n extractionForceFlush(\n request: EngramAccessExtractionForceFlushRequest,\n ): Promise<EngramAccessExtractionForceFlushResponse>;\n}\n\nexport function delegateExtractionForceFlush(\n delegate: ExtractionForceFlushDelegate,\n request: EngramAccessExtractionForceFlushRequest,\n): Promise<EngramAccessExtractionForceFlushResponse> {\n return delegate.extractionForceFlush(request);\n}\n"],"mappings":";AAyCO,SAAS,6BACd,UACA,SACmD;AACnD,SAAO,SAAS,qBAAqB,OAAO;AAC9C;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  getOperation,
4
4
  operationRequiresAuthorizedNamespace,
5
5
  operationUsesPrincipalNamespace
6
- } from "./chunk-FMT52ROU.js";
6
+ } from "./chunk-SVZWVZ7E.js";
7
7
  import {
8
8
  assertOperationAuthorizationAllowed
9
9
  } from "./chunk-IG747LRN.js";
@@ -60,4 +60,4 @@ export {
60
60
  authorizationProbeNamespaces,
61
61
  authorizationProbeRequiresPrincipalNamespace
62
62
  };
63
- //# sourceMappingURL=chunk-CDEI5S5W.js.map
63
+ //# sourceMappingURL=chunk-C7JAUNFC.js.map