@remnic/core 1.1.10 → 1.1.12

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 (299) hide show
  1. package/README.md +3 -3
  2. package/dist/access-cli.js +67 -59
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-http.d.ts +7 -4
  5. package/dist/access-http.js +30 -26
  6. package/dist/access-mcp.d.ts +9 -4
  7. package/dist/access-mcp.js +29 -25
  8. package/dist/access-schema.d.ts +188 -8
  9. package/dist/access-schema.js +12 -3
  10. package/dist/{access-service-BTTNyo1i.d.ts → access-service-DDjzFALq.d.ts} +54 -5
  11. package/dist/access-service.d.ts +7 -4
  12. package/dist/access-service.js +26 -23
  13. package/dist/action-confidence.d.ts +83 -0
  14. package/dist/action-confidence.js +22 -0
  15. package/dist/active-memory-bridge.d.ts +1 -1
  16. package/dist/active-recall.d.ts +1 -1
  17. package/dist/behavior-learner.d.ts +1 -1
  18. package/dist/behavior-signals.d.ts +1 -1
  19. package/dist/bootstrap.d.ts +4 -2
  20. package/dist/briefing.d.ts +1 -1
  21. package/dist/briefing.js +5 -5
  22. package/dist/buffer-surprise-report.d.ts +1 -1
  23. package/dist/buffer.d.ts +1 -1
  24. package/dist/calibration.d.ts +1 -1
  25. package/dist/calibration.js +4 -4
  26. package/dist/{capsule-export-LLEVB2RG.js → capsule-export-7QNCBZOQ.js} +3 -3
  27. package/dist/{capsule-import-UW45R2MZ.js → capsule-import-EPBHD2EN.js} +3 -3
  28. package/dist/causal-behavior.d.ts +1 -1
  29. package/dist/causal-consolidation.d.ts +1 -1
  30. package/dist/causal-consolidation.js +11 -11
  31. package/dist/{chunk-VQXK37XA.js → chunk-23ZZK64Y.js} +1 -1
  32. package/dist/chunk-23ZZK64Y.js.map +1 -0
  33. package/dist/{chunk-HJYHRE4S.js → chunk-242S3I2A.js} +2 -2
  34. package/dist/{chunk-MCC6KDQF.js → chunk-3B6KIRBH.js} +131 -13
  35. package/dist/chunk-3B6KIRBH.js.map +1 -0
  36. package/dist/chunk-4RA3C3EV.js +60 -0
  37. package/dist/chunk-4RA3C3EV.js.map +1 -0
  38. package/dist/{chunk-EYNQTST2.js → chunk-4YM32CRU.js} +4 -4
  39. package/dist/{chunk-6AUUAZEX.js → chunk-5NXIJZFX.js} +38 -8
  40. package/dist/chunk-5NXIJZFX.js.map +1 -0
  41. package/dist/chunk-6NKAQ74D.js +2237 -0
  42. package/dist/chunk-6NKAQ74D.js.map +1 -0
  43. package/dist/{chunk-PHNGXFQ6.js → chunk-7V22HTMD.js} +3 -3
  44. package/dist/{chunk-363MWCD3.js → chunk-7ZM3BFKK.js} +84 -62
  45. package/dist/chunk-7ZM3BFKK.js.map +1 -0
  46. package/dist/chunk-AC5LO7IU.js +308 -0
  47. package/dist/chunk-AC5LO7IU.js.map +1 -0
  48. package/dist/chunk-AH2JUU6X.js +336 -0
  49. package/dist/chunk-AH2JUU6X.js.map +1 -0
  50. package/dist/{chunk-VX2IUQFE.js → chunk-AQJNPMOA.js} +41 -11
  51. package/dist/chunk-AQJNPMOA.js.map +1 -0
  52. package/dist/{chunk-P73JTV34.js → chunk-BBE34QBJ.js} +4 -4
  53. package/dist/{chunk-5GCNE7CN.js → chunk-BZSQEPRW.js} +454 -140
  54. package/dist/chunk-BZSQEPRW.js.map +1 -0
  55. package/dist/chunk-C5BCH4ZS.js +317 -0
  56. package/dist/chunk-C5BCH4ZS.js.map +1 -0
  57. package/dist/{chunk-C5HUWVH2.js → chunk-CPKTBRS2.js} +6 -6
  58. package/dist/{chunk-IBX3VFOM.js → chunk-D4GAOFF6.js} +118 -2
  59. package/dist/chunk-D4GAOFF6.js.map +1 -0
  60. package/dist/chunk-DB5A3NHS.js +906 -0
  61. package/dist/chunk-DB5A3NHS.js.map +1 -0
  62. package/dist/{chunk-I6BQZSML.js → chunk-DZZPC36E.js} +10 -10
  63. package/dist/{chunk-O4XJUPSF.js → chunk-E2UCDP5S.js} +39 -2
  64. package/dist/chunk-E2UCDP5S.js.map +1 -0
  65. package/dist/{chunk-SRBJUAMP.js → chunk-FMEBPEAO.js} +11 -67
  66. package/dist/chunk-FMEBPEAO.js.map +1 -0
  67. package/dist/{chunk-4DXC6HQQ.js → chunk-FQDPCE3I.js} +5 -5
  68. package/dist/{chunk-NN3LPQ5D.js → chunk-HELQZFZO.js} +155 -16
  69. package/dist/chunk-HELQZFZO.js.map +1 -0
  70. package/dist/{chunk-57QNCUEZ.js → chunk-HL5LRPNA.js} +2 -2
  71. package/dist/{chunk-VTU2B4VF.js → chunk-HQZVVSVB.js} +2 -1
  72. package/dist/chunk-HQZVVSVB.js.map +1 -0
  73. package/dist/{chunk-6Z6UH6TK.js → chunk-HY3L4WKC.js} +69 -3
  74. package/dist/chunk-HY3L4WKC.js.map +1 -0
  75. package/dist/{chunk-QIGOEM65.js → chunk-IB3BFHGN.js} +5 -5
  76. package/dist/{chunk-RXTFCYQF.js → chunk-JESOB2HO.js} +6 -6
  77. package/dist/{chunk-2YMTO4ZJ.js → chunk-JKDVIE52.js} +9 -2
  78. package/dist/chunk-JKDVIE52.js.map +1 -0
  79. package/dist/{chunk-WGK4VHGP.js → chunk-MNU6ZBWT.js} +302 -140
  80. package/dist/chunk-MNU6ZBWT.js.map +1 -0
  81. package/dist/chunk-OAZ5MFUB.js +4124 -0
  82. package/dist/chunk-OAZ5MFUB.js.map +1 -0
  83. package/dist/{chunk-ZTSE2ZJ6.js → chunk-OIGNEXKZ.js} +50 -3
  84. package/dist/chunk-OIGNEXKZ.js.map +1 -0
  85. package/dist/chunk-OZKZ2TRP.js +3729 -0
  86. package/dist/chunk-OZKZ2TRP.js.map +1 -0
  87. package/dist/{chunk-GGD5W7TB.js → chunk-PD6O7AXF.js} +7 -2
  88. package/dist/chunk-PD6O7AXF.js.map +1 -0
  89. package/dist/{chunk-S3IP6R6K.js → chunk-PH4C2U43.js} +23 -3
  90. package/dist/chunk-PH4C2U43.js.map +1 -0
  91. package/dist/chunk-PYPOFEMK.js +294 -0
  92. package/dist/chunk-PYPOFEMK.js.map +1 -0
  93. package/dist/{chunk-EQINRHYR.js → chunk-QDZ2RLEC.js} +243 -7
  94. package/dist/chunk-QDZ2RLEC.js.map +1 -0
  95. package/dist/{chunk-KWBPHZUU.js → chunk-RK6F44Y6.js} +3 -2
  96. package/dist/chunk-RK6F44Y6.js.map +1 -0
  97. package/dist/{chunk-36CTNQY7.js → chunk-RVPLBATS.js} +42 -10
  98. package/dist/chunk-RVPLBATS.js.map +1 -0
  99. package/dist/chunk-SOAU2OE2.js +125 -0
  100. package/dist/chunk-SOAU2OE2.js.map +1 -0
  101. package/dist/{chunk-A4ACKWIW.js → chunk-U5JMRGKX.js} +55 -4
  102. package/dist/chunk-U5JMRGKX.js.map +1 -0
  103. package/dist/{chunk-LIO5X3CM.js → chunk-UVMUAWVT.js} +2 -2
  104. package/dist/chunk-VWT3F4IV.js +2161 -0
  105. package/dist/chunk-VWT3F4IV.js.map +1 -0
  106. package/dist/{chunk-PB5KW5PL.js → chunk-WEJG4TB5.js} +6 -6
  107. package/dist/{chunk-KBYWQWSB.js → chunk-X7HPGUVG.js} +2 -2
  108. package/dist/{chunk-Y5KDIOKF.js → chunk-XAMBKFQS.js} +383 -9
  109. package/dist/chunk-XAMBKFQS.js.map +1 -0
  110. package/dist/{chunk-ZL4S7ARC.js → chunk-Y3VMVTYX.js} +3 -3
  111. package/dist/{chunk-Z5S5HNGY.js → chunk-ZG7PTKBK.js} +21 -5
  112. package/dist/chunk-ZG7PTKBK.js.map +1 -0
  113. package/dist/{chunk-6XA7UN4Z.js → chunk-ZNQN6ZTA.js} +2 -2
  114. package/dist/{chunk-WTFWLUSX.js → chunk-ZVTKDVVM.js} +2 -2
  115. package/dist/{cli-BrEwQTnW.d.ts → cli-BR8KpIU0.d.ts} +2 -2
  116. package/dist/cli.d.ts +7 -4
  117. package/dist/cli.js +44 -40
  118. package/dist/codex-cli-fallback.d.ts +1 -0
  119. package/dist/codex-cli-fallback.js +1 -1
  120. package/dist/compression-optimizer.d.ts +1 -1
  121. package/dist/config.d.ts +1 -1
  122. package/dist/config.js +1 -1
  123. package/dist/consolidation-provenance-check.d.ts +1 -1
  124. package/dist/consolidation-undo.d.ts +1 -1
  125. package/dist/{contradiction-scan-3Z6YW7YA.js → contradiction-scan-QTXAMBUA.js} +3 -2
  126. package/dist/contradiction-scan-QTXAMBUA.js.map +1 -0
  127. package/dist/day-summary.d.ts +1 -1
  128. package/dist/delinearize.d.ts +1 -1
  129. package/dist/direct-answer-wiring.d.ts +1 -1
  130. package/dist/direct-answer-wiring.js +1 -1
  131. package/dist/direct-answer.d.ts +1 -1
  132. package/dist/embedding-fallback.d.ts +1 -1
  133. package/dist/{engine-FOC3IJLA.js → engine-35M5BKQ7.js} +7 -7
  134. package/dist/entity-retrieval.d.ts +1 -1
  135. package/dist/entity-retrieval.js +5 -5
  136. package/dist/entity-schema.d.ts +1 -1
  137. package/dist/event-order-recall.d.ts +17 -0
  138. package/dist/event-order-recall.js +11 -0
  139. package/dist/event-order-recall.js.map +1 -0
  140. package/dist/evidence-pack.d.ts +3 -1
  141. package/dist/evidence-pack.js +5 -3
  142. package/dist/explicit-capture.d.ts +4 -2
  143. package/dist/explicit-cue-recall.d.ts +19 -1
  144. package/dist/explicit-cue-recall.js +10 -4
  145. package/dist/extraction-judge-telemetry.d.ts +1 -1
  146. package/dist/extraction-judge-training.d.ts +1 -1
  147. package/dist/extraction-judge.d.ts +1 -1
  148. package/dist/extraction.d.ts +1 -1
  149. package/dist/extraction.js +8 -7
  150. package/dist/fallback-llm.d.ts +2 -1
  151. package/dist/fallback-llm.js +4 -4
  152. package/dist/focused-list-recall.d.ts +17 -0
  153. package/dist/focused-list-recall.js +11 -0
  154. package/dist/focused-list-recall.js.map +1 -0
  155. package/dist/identity-continuity.d.ts +1 -1
  156. package/dist/importance.d.ts +1 -1
  157. package/dist/{index-1qIcnbG1.d.ts → index-DJ9QWMw-.d.ts} +3 -2
  158. package/dist/index.d.ts +49 -12
  159. package/dist/index.js +289 -115
  160. package/dist/index.js.map +1 -1
  161. package/dist/intent.d.ts +1 -1
  162. package/dist/intent.js +1 -1
  163. package/dist/lifecycle.d.ts +1 -1
  164. package/dist/live-connectors-runner.d.ts +1 -1
  165. package/dist/local-llm.d.ts +8 -4
  166. package/dist/local-llm.js +1 -1
  167. package/dist/mcp-memory-inspector-app.d.ts +106 -0
  168. package/dist/mcp-memory-inspector-app.js +20 -0
  169. package/dist/mcp-memory-inspector-app.js.map +1 -0
  170. package/dist/memory-action-policy.d.ts +1 -1
  171. package/dist/memory-cache.d.ts +1 -1
  172. package/dist/{memory-governance-F3QOJGEY.js → memory-governance-IMPQZXFC.js} +7 -7
  173. package/dist/memory-governance-IMPQZXFC.js.map +1 -0
  174. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  175. package/dist/memory-projection-store.d.ts +1 -1
  176. package/dist/memory-provenance.d.ts +57 -0
  177. package/dist/memory-provenance.js +13 -0
  178. package/dist/memory-provenance.js.map +1 -0
  179. package/dist/memory-worth-outcomes.d.ts +1 -1
  180. package/dist/models-json.d.ts +1 -1
  181. package/dist/native-knowledge.d.ts +1 -1
  182. package/dist/objective-state-writers.d.ts +1 -1
  183. package/dist/objective-state-writers.js +2 -2
  184. package/dist/operator-toolkit.d.ts +1 -1
  185. package/dist/operator-toolkit.js +11 -11
  186. package/dist/{orchestrator-6IvQ-Phj.d.ts → orchestrator-DDMPqU6R.d.ts} +10 -1
  187. package/dist/orchestrator.d.ts +4 -2
  188. package/dist/orchestrator.js +53 -46
  189. package/dist/patterns-cli.d.ts +1 -1
  190. package/dist/policy-runtime.d.ts +1 -1
  191. package/dist/qmd-recall-cache.d.ts +1 -1
  192. package/dist/qmd.d.ts +1 -1
  193. package/dist/recall-disclosure-escalation.d.ts +1 -1
  194. package/dist/recall-explain-renderer.d.ts +3 -1
  195. package/dist/recall-explain-renderer.js +5 -3
  196. package/dist/recall-state.d.ts +1 -1
  197. package/dist/recall-tag-filter.d.ts +3 -1
  198. package/dist/recall-xray-cli.d.ts +3 -1
  199. package/dist/recall-xray-cli.js +6 -4
  200. package/dist/recall-xray-renderer.d.ts +3 -1
  201. package/dist/recall-xray-renderer.js +5 -3
  202. package/dist/recall-xray.d.ts +8 -1
  203. package/dist/recall-xray.js +4 -2
  204. package/dist/resolve-auth-token.d.ts +1 -1
  205. package/dist/resolve-provider-secret.js +1 -1
  206. package/dist/response-guidance-recall.d.ts +18 -0
  207. package/dist/response-guidance-recall.js +11 -0
  208. package/dist/response-guidance-recall.js.map +1 -0
  209. package/dist/resume-bundles.js +3 -3
  210. package/dist/retrieval-agents.d.ts +1 -1
  211. package/dist/retrieval-tiers.d.ts +1 -1
  212. package/dist/sdk-compat.d.ts +3 -2
  213. package/dist/sdk-compat.js.map +1 -1
  214. package/dist/semantic-consolidation.d.ts +1 -1
  215. package/dist/semantic-consolidation.js +6 -6
  216. package/dist/semantic-rule-promotion.js +5 -5
  217. package/dist/semantic-rule-verifier.d.ts +1 -1
  218. package/dist/semantic-rule-verifier.js +6 -6
  219. package/dist/session-observer-bands.d.ts +1 -1
  220. package/dist/session-observer-state.d.ts +1 -1
  221. package/dist/signal.d.ts +1 -1
  222. package/dist/storage.d.ts +3 -1
  223. package/dist/storage.js +4 -4
  224. package/dist/summarizer.d.ts +1 -1
  225. package/dist/summarizer.js +6 -6
  226. package/dist/summary-snapshot.d.ts +1 -1
  227. package/dist/targeted-fact-recall.d.ts +17 -0
  228. package/dist/targeted-fact-recall.js +11 -0
  229. package/dist/targeted-fact-recall.js.map +1 -0
  230. package/dist/telemetry-transcript.d.ts +7 -0
  231. package/dist/telemetry-transcript.js +16 -0
  232. package/dist/telemetry-transcript.js.map +1 -0
  233. package/dist/temporal-supersession.d.ts +1 -1
  234. package/dist/temporal-supersession.js +2 -1
  235. package/dist/temporal-validity.d.ts +1 -1
  236. package/dist/threading.d.ts +1 -1
  237. package/dist/tier-migration.d.ts +1 -1
  238. package/dist/tier-routing.d.ts +1 -1
  239. package/dist/tokens.js +1 -1
  240. package/dist/topics.d.ts +1 -1
  241. package/dist/transcript.d.ts +1 -1
  242. package/dist/trust-zones.d.ts +3 -2
  243. package/dist/trust-zones.js +1 -1
  244. package/dist/types.d.ts +60 -2
  245. package/dist/types.js +1 -1
  246. package/dist/user-model.d.ts +37 -0
  247. package/dist/user-model.js +28 -0
  248. package/dist/user-model.js.map +1 -0
  249. package/dist/utility-runtime.d.ts +1 -1
  250. package/dist/verified-recall.js +6 -6
  251. package/package.json +1 -1
  252. package/dist/chunk-2YMTO4ZJ.js.map +0 -1
  253. package/dist/chunk-363MWCD3.js.map +0 -1
  254. package/dist/chunk-36CTNQY7.js.map +0 -1
  255. package/dist/chunk-5GCNE7CN.js.map +0 -1
  256. package/dist/chunk-6AUUAZEX.js.map +0 -1
  257. package/dist/chunk-6Z6UH6TK.js.map +0 -1
  258. package/dist/chunk-74WWN7ZW.js +0 -82
  259. package/dist/chunk-74WWN7ZW.js.map +0 -1
  260. package/dist/chunk-A4ACKWIW.js.map +0 -1
  261. package/dist/chunk-EQINRHYR.js.map +0 -1
  262. package/dist/chunk-ERUDW6DU.js +0 -965
  263. package/dist/chunk-ERUDW6DU.js.map +0 -1
  264. package/dist/chunk-GGD5W7TB.js.map +0 -1
  265. package/dist/chunk-IBX3VFOM.js.map +0 -1
  266. package/dist/chunk-KWBPHZUU.js.map +0 -1
  267. package/dist/chunk-MCC6KDQF.js.map +0 -1
  268. package/dist/chunk-NN3LPQ5D.js.map +0 -1
  269. package/dist/chunk-O4XJUPSF.js.map +0 -1
  270. package/dist/chunk-S3IP6R6K.js.map +0 -1
  271. package/dist/chunk-SRBJUAMP.js.map +0 -1
  272. package/dist/chunk-VQXK37XA.js.map +0 -1
  273. package/dist/chunk-VTU2B4VF.js.map +0 -1
  274. package/dist/chunk-VX2IUQFE.js.map +0 -1
  275. package/dist/chunk-WGK4VHGP.js.map +0 -1
  276. package/dist/chunk-Y5KDIOKF.js.map +0 -1
  277. package/dist/chunk-Z5S5HNGY.js.map +0 -1
  278. package/dist/chunk-ZTSE2ZJ6.js.map +0 -1
  279. package/dist/contradiction-scan-3Z6YW7YA.js.map +0 -1
  280. /package/dist/{capsule-export-LLEVB2RG.js.map → action-confidence.js.map} +0 -0
  281. /package/dist/{capsule-import-UW45R2MZ.js.map → capsule-export-7QNCBZOQ.js.map} +0 -0
  282. /package/dist/{engine-FOC3IJLA.js.map → capsule-import-EPBHD2EN.js.map} +0 -0
  283. /package/dist/{chunk-HJYHRE4S.js.map → chunk-242S3I2A.js.map} +0 -0
  284. /package/dist/{chunk-EYNQTST2.js.map → chunk-4YM32CRU.js.map} +0 -0
  285. /package/dist/{chunk-PHNGXFQ6.js.map → chunk-7V22HTMD.js.map} +0 -0
  286. /package/dist/{chunk-P73JTV34.js.map → chunk-BBE34QBJ.js.map} +0 -0
  287. /package/dist/{chunk-C5HUWVH2.js.map → chunk-CPKTBRS2.js.map} +0 -0
  288. /package/dist/{chunk-I6BQZSML.js.map → chunk-DZZPC36E.js.map} +0 -0
  289. /package/dist/{chunk-4DXC6HQQ.js.map → chunk-FQDPCE3I.js.map} +0 -0
  290. /package/dist/{chunk-57QNCUEZ.js.map → chunk-HL5LRPNA.js.map} +0 -0
  291. /package/dist/{chunk-QIGOEM65.js.map → chunk-IB3BFHGN.js.map} +0 -0
  292. /package/dist/{chunk-RXTFCYQF.js.map → chunk-JESOB2HO.js.map} +0 -0
  293. /package/dist/{chunk-LIO5X3CM.js.map → chunk-UVMUAWVT.js.map} +0 -0
  294. /package/dist/{chunk-PB5KW5PL.js.map → chunk-WEJG4TB5.js.map} +0 -0
  295. /package/dist/{chunk-KBYWQWSB.js.map → chunk-X7HPGUVG.js.map} +0 -0
  296. /package/dist/{chunk-ZL4S7ARC.js.map → chunk-Y3VMVTYX.js.map} +0 -0
  297. /package/dist/{chunk-6XA7UN4Z.js.map → chunk-ZNQN6ZTA.js.map} +0 -0
  298. /package/dist/{chunk-WTFWLUSX.js.map → chunk-ZVTKDVVM.js.map} +0 -0
  299. /package/dist/{memory-governance-F3QOJGEY.js.map → engine-35M5BKQ7.js.map} +0 -0
@@ -1,21 +1,29 @@
1
+ import {
2
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
3
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
4
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
5
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
6
+ buildChatGptMemoryInspectorActionRequest,
7
+ buildChatGptMemoryInspectorResult
8
+ } from "./chunk-C5BCH4ZS.js";
1
9
  import {
2
10
  buildCitationGuidance
3
11
  } from "./chunk-IQT3XTKW.js";
4
12
  import {
5
13
  EngramAccessInputError
6
- } from "./chunk-WGK4VHGP.js";
14
+ } from "./chunk-MNU6ZBWT.js";
15
+ import {
16
+ validateBriefingFormat
17
+ } from "./chunk-ZVTKDVVM.js";
7
18
  import {
8
19
  expandTildePath
9
20
  } from "./chunk-IXEJRKCZ.js";
10
- import {
11
- validateBriefingFormat
12
- } from "./chunk-WTFWLUSX.js";
13
21
  import {
14
22
  readEnvVar
15
23
  } from "./chunk-MARWOCVP.js";
16
24
  import {
17
25
  validateRequest
18
- } from "./chunk-A4ACKWIW.js";
26
+ } from "./chunk-U5JMRGKX.js";
19
27
 
20
28
  // src/access-mcp.ts
21
29
  import { readFile } from "fs/promises";
@@ -35,6 +43,11 @@ function withToolAliases(tool) {
35
43
  if (canonicalName === tool.name) return [canonicalTool];
36
44
  return [canonicalTool, tool];
37
45
  }
46
+ function resolveChatGptInspectorRecallSessionKey(explicitSessionKey, authenticatedPrincipal) {
47
+ if (explicitSessionKey) return explicitSessionKey;
48
+ if (!authenticatedPrincipal) return void 0;
49
+ return `remnic:chatgpt-memory-inspector:${randomUUID()}`;
50
+ }
38
51
  var STRICT_MCP_SCHEMA_KEYS = {
39
52
  capsuleExport: [
40
53
  "name",
@@ -84,6 +97,31 @@ var EngramMcpServer = class {
84
97
  this.citationsEnabled = options.citationsEnabled === true;
85
98
  this.citationsAutoDetect = options.citationsAutoDetect !== false;
86
99
  this.authenticatedPrincipal = options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0;
100
+ this.resources = [
101
+ {
102
+ uri: REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
103
+ name: "remnic-memory-inspector",
104
+ title: "Remnic Memory Inspector",
105
+ description: "Apps-compatible widget for inspecting retrieved Remnic memories, provenance, safety, and correction/scoping affordances.",
106
+ mimeType: REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
107
+ _meta: {
108
+ ui: {
109
+ csp: {
110
+ connectDomains: [],
111
+ resourceDomains: []
112
+ },
113
+ prefersBorder: true
114
+ },
115
+ "openai/widgetDescription": "Inspect retrieved Remnic memories, provenance, safety, and correction/scoping affordances."
116
+ }
117
+ }
118
+ ];
119
+ this.resourceTextByUri = /* @__PURE__ */ new Map([
120
+ [
121
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
122
+ REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML
123
+ ]
124
+ ]);
87
125
  this.tools = [
88
126
  {
89
127
  name: "engram.recall",
@@ -225,6 +263,158 @@ var EngramMcpServer = class {
225
263
  additionalProperties: false
226
264
  }
227
265
  },
266
+ {
267
+ name: "engram.action_confidence",
268
+ description: "Advisory ask/draft/act/refuse/escalate decision helper for interruption budgeting. Read-only; never mutates memory.",
269
+ inputSchema: {
270
+ type: "object",
271
+ properties: {
272
+ intendedAction: { type: "string" },
273
+ confidence: { type: "number", minimum: 0, maximum: 1 },
274
+ risk: {
275
+ type: "string",
276
+ enum: ["low", "medium", "high", "irreversible", "restricted"]
277
+ },
278
+ contextReadiness: {
279
+ type: "string",
280
+ enum: ["none", "partial", "sufficient"]
281
+ },
282
+ currentContextScopes: {
283
+ type: "array",
284
+ items: { type: "string" }
285
+ },
286
+ userRules: {
287
+ type: "array",
288
+ items: {
289
+ type: "object",
290
+ properties: {
291
+ kind: {
292
+ type: "string",
293
+ enum: [
294
+ "ask-before",
295
+ "do-not-use-outside-this-context",
296
+ "never",
297
+ "requires-escalation"
298
+ ]
299
+ },
300
+ description: { type: "string" },
301
+ matched: { type: "boolean" }
302
+ },
303
+ required: ["kind"],
304
+ additionalProperties: false
305
+ }
306
+ },
307
+ retrievedMemories: {
308
+ type: "array",
309
+ items: {
310
+ type: "object",
311
+ properties: {
312
+ source: { type: "string" },
313
+ created: { type: "string" },
314
+ updated: { type: "string" },
315
+ scope: { type: "string" },
316
+ userContextScopes: {
317
+ type: "array",
318
+ items: { type: "string" }
319
+ },
320
+ retrievalReason: { type: "string" },
321
+ confidence: { type: "number", minimum: 0, maximum: 1 },
322
+ stale: { type: "boolean" },
323
+ corrected: { type: "boolean" },
324
+ correctionState: {
325
+ type: "string",
326
+ enum: ["none", "correction", "superseded", "disputed", "forgotten"]
327
+ },
328
+ safeToUse: { type: "boolean" },
329
+ safety: {
330
+ type: "string",
331
+ enum: ["safe", "requires-review", "blocked"]
332
+ },
333
+ safetyReasons: {
334
+ type: "array",
335
+ items: { type: "string" }
336
+ }
337
+ },
338
+ additionalProperties: false
339
+ }
340
+ }
341
+ },
342
+ additionalProperties: false
343
+ }
344
+ },
345
+ {
346
+ name: REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
347
+ title: "Show Remnic Memory Inspector",
348
+ description: "Use this when the user wants a ChatGPT Apps-compatible UI for inspecting Remnic recall, provenance, safety, and correction/forget/scoping affordances. Read-only; correction and forget actions are proposed as follow-up prompts.",
349
+ inputSchema: {
350
+ type: "object",
351
+ properties: {
352
+ query: {
353
+ type: "string",
354
+ description: "Memory question to inspect."
355
+ },
356
+ sessionKey: {
357
+ type: "string",
358
+ description: "Optional Remnic session key for scoped recall."
359
+ },
360
+ namespace: {
361
+ type: "string",
362
+ description: "Optional Remnic namespace to inspect."
363
+ },
364
+ currentContextScopes: {
365
+ type: "array",
366
+ items: { type: "string" },
367
+ description: "Optional current user-context scopes, such as repo, work, personal, client, or private."
368
+ }
369
+ },
370
+ required: ["query"],
371
+ additionalProperties: false
372
+ },
373
+ outputSchema: {
374
+ type: "object",
375
+ properties: {
376
+ app: { type: "object" },
377
+ query: { type: "string" },
378
+ sessionKey: { type: "string" },
379
+ namespace: { type: "string" },
380
+ safeRecallPreview: { type: "string" },
381
+ memoryCount: { type: "number" },
382
+ memoryIds: { type: "array", items: { type: "string" } },
383
+ memories: { type: "array", items: { type: "object" } },
384
+ actionConfidence: { type: "object" },
385
+ affordances: { type: "array", items: { type: "object" } },
386
+ guidance: { type: "object" }
387
+ },
388
+ required: [
389
+ "app",
390
+ "query",
391
+ "namespace",
392
+ "safeRecallPreview",
393
+ "memoryCount",
394
+ "memoryIds",
395
+ "memories",
396
+ "actionConfidence",
397
+ "affordances",
398
+ "guidance"
399
+ ],
400
+ additionalProperties: false
401
+ },
402
+ annotations: {
403
+ readOnlyHint: true,
404
+ destructiveHint: false,
405
+ idempotentHint: true,
406
+ openWorldHint: false
407
+ },
408
+ _meta: {
409
+ ui: {
410
+ resourceUri: REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
411
+ visibility: ["model", "app"]
412
+ },
413
+ "openai/outputTemplate": REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
414
+ "openai/toolInvocation/invoking": "Inspecting Remnic memory...",
415
+ "openai/toolInvocation/invoked": "Remnic memory inspector ready."
416
+ }
417
+ },
228
418
  {
229
419
  name: "engram.day_summary",
230
420
  description: "Generate a structured end-of-day summary. When memories is omitted or empty, auto-gathers today's facts and hourly summaries from storage.",
@@ -469,7 +659,7 @@ var EngramMcpServer = class {
469
659
  content: { type: "string" },
470
660
  sourceFormat: {
471
661
  type: "string",
472
- enum: ["openai", "anthropic", "openclaw", "lossless-claw", "remnic"]
662
+ enum: ["openai", "anthropic", "openclaw", "pi", "lossless-claw", "remnic"]
473
663
  },
474
664
  rawContent: {
475
665
  description: "Optional native provider content blocks for structured message-part capture."
@@ -538,6 +728,34 @@ var EngramMcpServer = class {
538
728
  additionalProperties: false
539
729
  }
540
730
  },
731
+ {
732
+ name: "engram.lcm_compaction_flush",
733
+ description: "Flush pending LCM observe work and incremental summaries before a host compacts session context.",
734
+ inputSchema: {
735
+ type: "object",
736
+ properties: {
737
+ sessionKey: { type: "string", description: "Conversation session identifier" },
738
+ namespace: { type: "string" }
739
+ },
740
+ required: ["sessionKey"],
741
+ additionalProperties: false
742
+ }
743
+ },
744
+ {
745
+ name: "engram.lcm_compaction_record",
746
+ description: "Record a host compaction event with before/after token counts in the LCM archive.",
747
+ inputSchema: {
748
+ type: "object",
749
+ properties: {
750
+ sessionKey: { type: "string", description: "Conversation session identifier" },
751
+ namespace: { type: "string" },
752
+ tokensBefore: { type: "integer", minimum: 0 },
753
+ tokensAfter: { type: "integer", minimum: 0 }
754
+ },
755
+ required: ["sessionKey", "tokensBefore", "tokensAfter"],
756
+ additionalProperties: false
757
+ }
758
+ },
541
759
  // ── Continuity / Identity tools ─────────────────────────────────────
542
760
  {
543
761
  name: "engram.continuity_audit_generate",
@@ -1322,6 +1540,8 @@ var EngramMcpServer = class {
1322
1540
  buffer = Buffer.alloc(0);
1323
1541
  flushTask = null;
1324
1542
  tools;
1543
+ resources;
1544
+ resourceTextByUri;
1325
1545
  authenticatedPrincipal;
1326
1546
  /**
1327
1547
  * MCP client info keyed by server-assigned session ID. On each `initialize`
@@ -1382,7 +1602,8 @@ var EngramMcpServer = class {
1382
1602
  result: {
1383
1603
  protocolVersion: MCP_PROTOCOL_VERSION,
1384
1604
  capabilities: {
1385
- tools: {}
1605
+ tools: {},
1606
+ resources: {}
1386
1607
  },
1387
1608
  serverInfo: {
1388
1609
  name: "remnic",
@@ -1400,6 +1621,64 @@ var EngramMcpServer = class {
1400
1621
  }
1401
1622
  };
1402
1623
  }
1624
+ if (method === "resources/list") {
1625
+ return {
1626
+ jsonrpc: "2.0",
1627
+ id,
1628
+ result: {
1629
+ resources: this.resources
1630
+ }
1631
+ };
1632
+ }
1633
+ if (method === "resources/templates/list") {
1634
+ return {
1635
+ jsonrpc: "2.0",
1636
+ id,
1637
+ result: {
1638
+ resourceTemplates: []
1639
+ }
1640
+ };
1641
+ }
1642
+ if (method === "resources/read") {
1643
+ const params = request.params ?? {};
1644
+ const uri = typeof params.uri === "string" ? params.uri : "";
1645
+ const resource = this.resources.find((entry) => entry.uri === uri);
1646
+ if (!resource) {
1647
+ return {
1648
+ jsonrpc: "2.0",
1649
+ id,
1650
+ error: {
1651
+ code: -32602,
1652
+ message: `Unknown resource URI: ${uri}`
1653
+ }
1654
+ };
1655
+ }
1656
+ const text = this.resourceTextByUri.get(resource.uri);
1657
+ if (text === void 0) {
1658
+ return {
1659
+ jsonrpc: "2.0",
1660
+ id,
1661
+ error: {
1662
+ code: -32603,
1663
+ message: `Resource content unavailable: ${resource.uri}`
1664
+ }
1665
+ };
1666
+ }
1667
+ return {
1668
+ jsonrpc: "2.0",
1669
+ id,
1670
+ result: {
1671
+ contents: [
1672
+ {
1673
+ uri: resource.uri,
1674
+ mimeType: resource.mimeType,
1675
+ text,
1676
+ _meta: resource._meta
1677
+ }
1678
+ ]
1679
+ }
1680
+ };
1681
+ }
1403
1682
  if (method === "tools/call") {
1404
1683
  const params = request.params ?? {};
1405
1684
  const name = typeof params.name === "string" ? params.name : "";
@@ -1607,6 +1886,7 @@ ${body}`;
1607
1886
  const response = await this.service.recall({
1608
1887
  query: typeof args.query === "string" ? args.query : "",
1609
1888
  sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
1889
+ authenticatedPrincipal: effectivePrincipal,
1610
1890
  namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1611
1891
  topK: typeof args.topK === "number" && Number.isFinite(args.topK) ? args.topK : void 0,
1612
1892
  mode: typeof args.mode === "string" ? args.mode : void 0,
@@ -1723,6 +2003,82 @@ ${body}`;
1723
2003
  ...disclosure !== void 0 ? { disclosure } : {}
1724
2004
  });
1725
2005
  }
2006
+ case "engram.action_confidence": {
2007
+ const body = parseMcpRequest("actionConfidence", args);
2008
+ return this.service.actionConfidence(body);
2009
+ }
2010
+ case REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL: {
2011
+ if (typeof args.query !== "string" || args.query.trim().length === 0) {
2012
+ throw new EngramAccessInputError(
2013
+ "chatgpt_memory_inspector requires a non-empty query string"
2014
+ );
2015
+ }
2016
+ if ("sessionKey" in args && args.sessionKey !== void 0 && args.sessionKey !== null && typeof args.sessionKey !== "string") {
2017
+ throw new EngramAccessInputError("sessionKey must be a string");
2018
+ }
2019
+ if ("namespace" in args && args.namespace !== void 0 && args.namespace !== null && typeof args.namespace !== "string") {
2020
+ throw new EngramAccessInputError("namespace must be a string");
2021
+ }
2022
+ let currentContextScopes;
2023
+ if (args.currentContextScopes !== void 0 && args.currentContextScopes !== null) {
2024
+ if (!Array.isArray(args.currentContextScopes) || !args.currentContextScopes.every((scope) => typeof scope === "string")) {
2025
+ throw new EngramAccessInputError(
2026
+ "currentContextScopes must be an array of strings"
2027
+ );
2028
+ }
2029
+ currentContextScopes = args.currentContextScopes;
2030
+ }
2031
+ const input = {
2032
+ query: args.query.trim()
2033
+ };
2034
+ if (typeof args.sessionKey === "string" && args.sessionKey.trim().length > 0) {
2035
+ input.sessionKey = args.sessionKey;
2036
+ }
2037
+ if (typeof args.namespace === "string" && args.namespace.trim().length > 0) {
2038
+ input.namespace = args.namespace;
2039
+ }
2040
+ if (currentContextScopes !== void 0) {
2041
+ input.currentContextScopes = currentContextScopes;
2042
+ }
2043
+ const recallSessionKey = resolveChatGptInspectorRecallSessionKey(
2044
+ input.sessionKey,
2045
+ effectivePrincipal
2046
+ );
2047
+ const xrayResponse = await this.service.recallXray({
2048
+ query: input.query,
2049
+ sessionKey: recallSessionKey,
2050
+ namespace: input.namespace,
2051
+ currentContextScopes: input.currentContextScopes,
2052
+ authenticatedPrincipal: effectivePrincipal,
2053
+ mode: "full",
2054
+ disclosure: "chunk",
2055
+ includeRecall: true
2056
+ });
2057
+ const xray = xrayResponse.snapshotFound === true ? xrayResponse.snapshot ?? null : null;
2058
+ const recall = xrayResponse.recall ?? {
2059
+ query: input.query,
2060
+ namespace: input.namespace ?? xray?.namespace ?? "global",
2061
+ context: "",
2062
+ count: 0,
2063
+ memoryIds: [],
2064
+ results: [],
2065
+ fallbackUsed: false,
2066
+ sourcesUsed: [],
2067
+ disclosure: "chunk"
2068
+ };
2069
+ const actionRequest = buildChatGptMemoryInspectorActionRequest(
2070
+ input,
2071
+ recall,
2072
+ xray
2073
+ );
2074
+ const actionConfidence = await this.service.actionConfidence(actionRequest);
2075
+ return buildChatGptMemoryInspectorResult(
2076
+ input,
2077
+ recall,
2078
+ xray,
2079
+ actionConfidence
2080
+ );
2081
+ }
1726
2082
  case "engram.day_summary":
1727
2083
  return this.service.daySummary({
1728
2084
  memories: typeof args.memories === "string" ? args.memories : "",
@@ -1876,6 +2232,24 @@ ${body}`;
1876
2232
  limit: typeof args.limit === "number" && Number.isFinite(args.limit) ? args.limit : void 0,
1877
2233
  authenticatedPrincipal: effectivePrincipal
1878
2234
  });
2235
+ case "engram.lcm_compaction_flush": {
2236
+ const body = parseMcpRequest("lcmCompactionFlush", args);
2237
+ return this.service.lcmCompactionFlush({
2238
+ sessionKey: body.sessionKey,
2239
+ namespace: body.namespace,
2240
+ authenticatedPrincipal: effectivePrincipal
2241
+ });
2242
+ }
2243
+ case "engram.lcm_compaction_record": {
2244
+ const body = parseMcpRequest("lcmCompactionRecord", args);
2245
+ return this.service.lcmCompactionRecord({
2246
+ sessionKey: body.sessionKey,
2247
+ namespace: body.namespace,
2248
+ tokensBefore: body.tokensBefore,
2249
+ tokensAfter: body.tokensAfter,
2250
+ authenticatedPrincipal: effectivePrincipal
2251
+ });
2252
+ }
1879
2253
  // ── Continuity / Identity tools ───────────────────────────────────
1880
2254
  case "engram.continuity_audit_generate":
1881
2255
  return this.service.continuityAuditGenerate({
@@ -2210,7 +2584,7 @@ ${body}`;
2210
2584
  }
2211
2585
  case "engram.contradiction_scan_run":
2212
2586
  case "remnic.contradiction_scan_run": {
2213
- const { runContradictionScan } = await import("./contradiction-scan-3Z6YW7YA.js");
2587
+ const { runContradictionScan } = await import("./contradiction-scan-QTXAMBUA.js");
2214
2588
  return runContradictionScan({
2215
2589
  storage: this.service.storageRef,
2216
2590
  config: this.service.configRef,
@@ -2400,4 +2774,4 @@ ${body}`;
2400
2774
  export {
2401
2775
  EngramMcpServer
2402
2776
  };
2403
- //# sourceMappingURL=chunk-Y5KDIOKF.js.map
2777
+ //# sourceMappingURL=chunk-XAMBKFQS.js.map