@remnic/core 9.3.703 → 9.3.705

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 (324) hide show
  1. package/dist/access-boundary.d.ts +8 -8
  2. package/dist/access-boundary.js +27 -27
  3. package/dist/access-cli.js +57 -56
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +7 -7
  6. package/dist/access-http.js +32 -31
  7. package/dist/access-mcp.d.ts +7 -7
  8. package/dist/access-mcp.js +31 -30
  9. package/dist/access-operations-batch.d.ts +2 -0
  10. package/dist/access-operations-batch.js +120 -0
  11. package/dist/access-operations.d.ts +8 -7
  12. package/dist/access-operations.js +30 -29
  13. package/dist/access-schema.js +3 -3
  14. package/dist/{access-service-COCzhgEL.d.ts → access-service-C8hc8N2i.d.ts} +4 -4
  15. package/dist/access-service.d.ts +7 -7
  16. package/dist/access-service.js +26 -26
  17. package/dist/access-surface-catalog.d.ts +7 -7
  18. package/dist/access-surface-catalog.js +57 -54
  19. package/dist/access-surface-catalog.js.map +1 -1
  20. package/dist/action-confidence.d.ts +3 -3
  21. package/dist/active-memory-bridge.d.ts +3 -3
  22. package/dist/active-recall.d.ts +3 -3
  23. package/dist/{auto-sync-3AAP25FV.js → auto-sync-24NNS3GU.js} +3 -3
  24. package/dist/behavior-learner.d.ts +3 -3
  25. package/dist/behavior-signals.d.ts +3 -3
  26. package/dist/bootstrap.d.ts +6 -6
  27. package/dist/briefing.d.ts +3 -3
  28. package/dist/briefing.js +5 -5
  29. package/dist/buffer-surprise-report.d.ts +3 -3
  30. package/dist/buffer.d.ts +3 -3
  31. package/dist/bulk-import/index.d.ts +4 -4
  32. package/dist/calibration.d.ts +3 -3
  33. package/dist/capabilities.d.ts +3 -3
  34. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
  35. package/dist/{catalog-DxCzhjE6.d.ts → catalog-CAeU0e1C.d.ts} +1 -1
  36. package/dist/causal-behavior.d.ts +3 -3
  37. package/dist/causal-behavior.js +5 -5
  38. package/dist/causal-chain.js +3 -3
  39. package/dist/causal-consolidation.d.ts +3 -3
  40. package/dist/causal-consolidation.js +9 -9
  41. package/dist/causal-retrieval.js +3 -3
  42. package/dist/causal-trajectory-graph.js +2 -2
  43. package/dist/causal-trajectory.js +1 -1
  44. package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
  45. package/dist/{chunk-EOOVJK2U.js → chunk-2SYPOX45.js} +10 -10
  46. package/dist/{chunk-64XXOQRW.js → chunk-47LPHBIP.js} +2 -2
  47. package/dist/{chunk-QGJAGC2J.js → chunk-5DTWZ66X.js} +2 -2
  48. package/dist/chunk-5DTWZ66X.js.map +1 -0
  49. package/dist/{chunk-6VVP6NK7.js → chunk-6GJ2WQRK.js} +2 -2
  50. package/dist/{chunk-4NFVPDIL.js → chunk-74MYJSKB.js} +5 -5
  51. package/dist/{chunk-X5J3JZR3.js → chunk-773DPI6T.js} +6 -6
  52. package/dist/{chunk-FVI5B7DE.js → chunk-7ARKLLCV.js} +6 -6
  53. package/dist/{chunk-ZCEI242W.js → chunk-7L54YZUI.js} +411 -401
  54. package/dist/chunk-7L54YZUI.js.map +1 -0
  55. package/dist/{chunk-AGNBY3VG.js → chunk-APJQ6UEA.js} +4 -4
  56. package/dist/{chunk-CI7RKSRE.js → chunk-AQEJKOKI.js} +2 -1
  57. package/dist/{chunk-DL6H3D7S.js → chunk-ARV3AUOM.js} +2 -2
  58. package/dist/{chunk-JTKFZMZ7.js → chunk-BKBSE3BU.js} +3 -3
  59. package/dist/{chunk-TGAHHCB6.js → chunk-BMKGG7GC.js} +2 -2
  60. package/dist/{chunk-GFIARMA7.js → chunk-C2EHWNP2.js} +13 -13
  61. package/dist/{chunk-VKJHM6PL.js → chunk-DGTDRIUO.js} +5 -5
  62. package/dist/chunk-GI3MTYDU.js +1303 -0
  63. package/dist/chunk-GI3MTYDU.js.map +1 -0
  64. package/dist/{chunk-5VXVXJH6.js → chunk-GT4VBKM4.js} +59 -5
  65. package/dist/chunk-GT4VBKM4.js.map +1 -0
  66. package/dist/{chunk-KC6TCAWV.js → chunk-HEHPVBWA.js} +6 -6
  67. package/dist/{chunk-MDJURR27.js → chunk-HW5EF6LV.js} +2 -2
  68. package/dist/{chunk-BMFZLLNI.js → chunk-ICP53SKG.js} +2 -2
  69. package/dist/{chunk-YOI3ELXF.js → chunk-IF362TF6.js} +2 -2
  70. package/dist/{chunk-ABCGDW3A.js → chunk-IFR23TC5.js} +4 -4
  71. package/dist/{chunk-OXEAMU42.js → chunk-JHAYR2JY.js} +33 -33
  72. package/dist/{chunk-CZJ6QSKG.js → chunk-JZCKDTAS.js} +4 -4
  73. package/dist/{chunk-CZJ6QSKG.js.map → chunk-JZCKDTAS.js.map} +1 -1
  74. package/dist/{chunk-VPAFWWCL.js → chunk-K22IJO4R.js} +2 -2
  75. package/dist/{chunk-JMA4RYRN.js → chunk-KFU2SKDD.js} +2 -2
  76. package/dist/{chunk-VDX2J7OX.js → chunk-KQAFEZQX.js} +2 -2
  77. package/dist/{chunk-AMNLZ6SF.js → chunk-KZMMAVR2.js} +2 -2
  78. package/dist/{chunk-EZR35XHX.js → chunk-LY4FJLPT.js} +2 -2
  79. package/dist/{chunk-NUIJEGVD.js → chunk-M5MWSG4S.js} +7 -7
  80. package/dist/{chunk-Z7XEIAV4.js → chunk-MNH2OODZ.js} +2 -2
  81. package/dist/{chunk-MXEWQKM7.js → chunk-NFGJBEPT.js} +6 -6
  82. package/dist/{chunk-Q4O3ET6F.js → chunk-NUWZFSKC.js} +2 -2
  83. package/dist/{chunk-6TAETM63.js → chunk-OM6ETLLH.js} +2 -2
  84. package/dist/{chunk-QQW2LIEA.js → chunk-OMSTU233.js} +7 -7
  85. package/dist/{chunk-XGMCUY5P.js → chunk-S3WYRPSA.js} +64 -64
  86. package/dist/{chunk-QIMFOCSH.js → chunk-S5APSA3U.js} +2 -2
  87. package/dist/{chunk-IX72AAMZ.js → chunk-SY6WG6DB.js} +2 -2
  88. package/dist/{chunk-MBUM2Y3L.js → chunk-ULVM34NP.js} +5 -5
  89. package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
  90. package/dist/{chunk-7WWURLG6.js → chunk-XPOOY35N.js} +2 -2
  91. package/dist/{chunk-EYJD6KIO.js → chunk-Y4PMATX2.js} +6 -6
  92. package/dist/{chunk-KF74X62T.js → chunk-YGKUAX2B.js} +4 -4
  93. package/dist/{chunk-YN4ZT4CW.js → chunk-YI7RZO7Y.js} +1 -1
  94. package/dist/{cli-BM4xQPp4.d.ts → cli-ChE0XlJY.d.ts} +6 -6
  95. package/dist/cli.d.ts +9 -9
  96. package/dist/cli.js +55 -54
  97. package/dist/compounding/engine.d.ts +3 -3
  98. package/dist/compounding/engine.js +5 -5
  99. package/dist/compounding/preference-consolidator.d.ts +3 -3
  100. package/dist/compression-optimizer.d.ts +3 -3
  101. package/dist/config.d.ts +3 -3
  102. package/dist/connectors/codex-materialize-runner.d.ts +3 -3
  103. package/dist/connectors/codex-materialize-runner.js +5 -5
  104. package/dist/connectors/codex-materialize.d.ts +3 -3
  105. package/dist/connectors/index.d.ts +3 -3
  106. package/dist/connectors/index.js +5 -5
  107. package/dist/consolidation-provenance-check.d.ts +3 -3
  108. package/dist/consolidation-undo.d.ts +3 -3
  109. package/dist/contradiction/index.d.ts +3 -3
  110. package/dist/conversation-index/backend.d.ts +3 -3
  111. package/dist/conversation-index/chunker.d.ts +3 -3
  112. package/dist/conversation-index/faiss-adapter.d.ts +3 -3
  113. package/dist/conversation-index/indexer.d.ts +3 -3
  114. package/dist/conversation-index/search.d.ts +3 -3
  115. package/dist/day-summary.d.ts +3 -3
  116. package/dist/delinearize.d.ts +3 -3
  117. package/dist/direct-answer-wiring.d.ts +3 -3
  118. package/dist/direct-answer.d.ts +3 -3
  119. package/dist/embedding-fallback.d.ts +3 -3
  120. package/dist/enrichment/index.d.ts +3 -3
  121. package/dist/entity-retrieval.d.ts +3 -3
  122. package/dist/entity-retrieval.js +5 -5
  123. package/dist/entity-schema.d.ts +3 -3
  124. package/dist/explicit-capture.d.ts +6 -6
  125. package/dist/extraction-faithfulness.d.ts +3 -3
  126. package/dist/extraction-judge-telemetry.d.ts +3 -3
  127. package/dist/extraction-judge-training.d.ts +3 -3
  128. package/dist/extraction-judge.d.ts +3 -3
  129. package/dist/extraction.d.ts +3 -3
  130. package/dist/extraction.js +2 -2
  131. package/dist/fallback-llm.d.ts +3 -3
  132. package/dist/{graph-edge-decay-D7OESCBR.js → graph-edge-decay-JLOF3YW4.js} +3 -3
  133. package/dist/graph-snapshot.js +3 -3
  134. package/dist/graph.js +2 -2
  135. package/dist/identity-continuity.d.ts +3 -3
  136. package/dist/importance.d.ts +3 -3
  137. package/dist/importers/index.d.ts +2 -2
  138. package/dist/index.d.ts +14 -29
  139. package/dist/index.js +100 -99
  140. package/dist/index.js.map +1 -1
  141. package/dist/intent.d.ts +3 -3
  142. package/dist/lcm/archive.d.ts +1 -1
  143. package/dist/lcm/archive.js +2 -2
  144. package/dist/lcm/engine.d.ts +3 -3
  145. package/dist/lcm/engine.js +5 -5
  146. package/dist/lcm/index.d.ts +3 -3
  147. package/dist/lcm/index.js +7 -7
  148. package/dist/lcm/queue.d.ts +1 -1
  149. package/dist/lcm/recall.d.ts +1 -1
  150. package/dist/lcm/summarizer.d.ts +1 -1
  151. package/dist/lcm/summarizer.js +3 -3
  152. package/dist/lcm/tools.d.ts +3 -3
  153. package/dist/lifecycle.d.ts +3 -3
  154. package/dist/live-connectors-runner.d.ts +3 -3
  155. package/dist/local-llm.d.ts +3 -3
  156. package/dist/maintenance/memory-governance.d.ts +3 -3
  157. package/dist/maintenance/memory-governance.js +6 -6
  158. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
  159. package/dist/maintenance/rebuild-memory-projection.js +7 -7
  160. package/dist/mcp-memory-inspector-app.d.ts +7 -7
  161. package/dist/memory-action-policy.d.ts +3 -3
  162. package/dist/memory-cache.d.ts +3 -3
  163. package/dist/memory-lifecycle-ledger-utils.d.ts +3 -3
  164. package/dist/memory-projection-store.d.ts +3 -3
  165. package/dist/memory-provenance.d.ts +3 -3
  166. package/dist/memory-worth-outcomes.d.ts +3 -3
  167. package/dist/{index-DJ9QWMw-.d.ts → message-parts/index.d.ts} +2 -1
  168. package/dist/message-parts/index.js +24 -0
  169. package/dist/message-parts/index.js.map +1 -0
  170. package/dist/models-json.d.ts +3 -3
  171. package/dist/namespaces/migrate.d.ts +4 -4
  172. package/dist/namespaces/migrate.js +10 -10
  173. package/dist/namespaces/principal.d.ts +3 -3
  174. package/dist/namespaces/search.d.ts +3 -3
  175. package/dist/namespaces/search.js +4 -4
  176. package/dist/namespaces/storage.d.ts +4 -4
  177. package/dist/namespaces/storage.js +5 -5
  178. package/dist/native-knowledge.d.ts +3 -3
  179. package/dist/objective-state-writers.d.ts +1 -1
  180. package/dist/objective-state-writers.js +2 -2
  181. package/dist/operator-toolkit.d.ts +3 -3
  182. package/dist/operator-toolkit.js +17 -17
  183. package/dist/orchestration/maintenance.d.ts +4 -4
  184. package/dist/orchestration/maintenance.js +7 -7
  185. package/dist/{orchestrator-C9CDWAm6.d.ts → orchestrator-m_PnhyHj.d.ts} +4 -4
  186. package/dist/orchestrator.d.ts +6 -6
  187. package/dist/orchestrator.js +44 -44
  188. package/dist/patterns-cli.d.ts +3 -3
  189. package/dist/{pipeline-BSTuml0d.d.ts → pipeline-DmqtvION.d.ts} +1 -1
  190. package/dist/policy-runtime.d.ts +3 -3
  191. package/dist/provenance.d.ts +3 -3
  192. package/dist/qmd-recall-cache.d.ts +3 -3
  193. package/dist/qmd.d.ts +3 -3
  194. package/dist/recall-disclosure-escalation.d.ts +3 -3
  195. package/dist/recall-explain-renderer.d.ts +3 -3
  196. package/dist/recall-planner-llm.d.ts +3 -3
  197. package/dist/recall-state.d.ts +3 -3
  198. package/dist/recall-tag-filter.d.ts +3 -3
  199. package/dist/recall-xray-cli.d.ts +3 -3
  200. package/dist/recall-xray-renderer.d.ts +3 -3
  201. package/dist/recall-xray.d.ts +3 -3
  202. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  203. package/dist/replay/normalizers/claude.d.ts +1 -1
  204. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  205. package/dist/replay/normalizers/shared.d.ts +1 -1
  206. package/dist/replay/runner.d.ts +1 -1
  207. package/dist/replay/types.d.ts +1 -1
  208. package/dist/resolve-auth-token.d.ts +3 -3
  209. package/dist/resume-bundles.js +1 -1
  210. package/dist/retrieval-agents.d.ts +3 -3
  211. package/dist/retrieval-tiers.d.ts +3 -3
  212. package/dist/routing/engine.d.ts +3 -3
  213. package/dist/routing/store.d.ts +3 -3
  214. package/dist/search/embed-helper.d.ts +3 -3
  215. package/dist/search/factory.d.ts +3 -3
  216. package/dist/search/factory.js +3 -3
  217. package/dist/search/index.d.ts +3 -3
  218. package/dist/search/index.js +7 -7
  219. package/dist/search/lancedb-backend.d.ts +3 -3
  220. package/dist/search/meilisearch-backend.d.ts +3 -3
  221. package/dist/search/noop-backend.d.ts +3 -3
  222. package/dist/search/orama-backend.d.ts +3 -3
  223. package/dist/search/port.d.ts +3 -3
  224. package/dist/search/remote-backend.d.ts +3 -3
  225. package/dist/{semantic-consolidation-DgFXyALl.d.ts → semantic-consolidation-DVBbq6Wr.d.ts} +1 -1
  226. package/dist/semantic-consolidation.d.ts +4 -4
  227. package/dist/semantic-consolidation.js +7 -7
  228. package/dist/semantic-rule-promotion.js +5 -5
  229. package/dist/semantic-rule-verifier.d.ts +3 -3
  230. package/dist/semantic-rule-verifier.js +6 -6
  231. package/dist/session-observer-bands.d.ts +3 -3
  232. package/dist/session-observer-state.d.ts +3 -3
  233. package/dist/shared-context/manager.d.ts +3 -3
  234. package/dist/signal.d.ts +3 -3
  235. package/dist/storage.d.ts +3 -3
  236. package/dist/storage.js +4 -4
  237. package/dist/summarizer.d.ts +3 -3
  238. package/dist/summary-snapshot.d.ts +3 -3
  239. package/dist/temporal-supersession.d.ts +3 -3
  240. package/dist/temporal-validity.d.ts +3 -3
  241. package/dist/threading.d.ts +3 -3
  242. package/dist/tier-migration.d.ts +3 -3
  243. package/dist/tier-routing.d.ts +3 -3
  244. package/dist/topics.d.ts +3 -3
  245. package/dist/transcript.d.ts +3 -3
  246. package/dist/transfer/backup.js +2 -2
  247. package/dist/transfer/capsule-export.js +2 -2
  248. package/dist/transfer/capsule-import.js +2 -2
  249. package/dist/transfer/import-sqlite.js +2 -2
  250. package/dist/{types-MWKPZnM0.d.ts → types-CJrvHJjx.d.ts} +2 -2
  251. package/dist/{types-ByK7T3L6.d.ts → types-gb_SNtjR.d.ts} +1 -1
  252. package/dist/types.d.ts +3 -3
  253. package/dist/utility-runtime.d.ts +3 -3
  254. package/dist/utils/path.d.ts +17 -0
  255. package/dist/utils/path.js +9 -0
  256. package/dist/utils/path.js.map +1 -0
  257. package/dist/verified-recall.js +6 -6
  258. package/package.json +27 -2
  259. package/src/access-boundary.ts +102 -1
  260. package/src/access-http.ts +54 -0
  261. package/src/access-operations-batch.ts +1468 -0
  262. package/src/access-operations.ts +4 -0
  263. package/src/access-surface-catalog.test.ts +17 -1
  264. package/src/access-surface-catalog.ts +57 -54
  265. package/src/cli/creation-ledger-commands.ts +346 -0
  266. package/src/cli/research-status-commands.ts +256 -0
  267. package/src/cli.ts +7 -516
  268. package/src/storage-contract/atomicity.test.ts +113 -0
  269. package/src/storage-contract/cache-coherence.test.ts +100 -0
  270. package/src/storage-contract/content-hash.test.ts +102 -0
  271. package/src/storage-contract/failure-semantics.test.ts +108 -0
  272. package/src/storage-contract/harness.ts +148 -0
  273. package/src/storage-contract/namespace-routing.test.ts +135 -0
  274. package/src/storage-contract/round-trip.test.ts +226 -0
  275. package/src/storage-contract/surface.test.ts +90 -0
  276. package/src/storage-contract/versioning.test.ts +139 -0
  277. package/dist/chunk-5VXVXJH6.js.map +0 -1
  278. package/dist/chunk-QGJAGC2J.js.map +0 -1
  279. package/dist/chunk-ZCEI242W.js.map +0 -1
  280. package/dist/path-X2K5XCHL.js +0 -9
  281. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → access-operations-batch.js.map} +0 -0
  282. /package/dist/{auto-sync-3AAP25FV.js.map → auto-sync-24NNS3GU.js.map} +0 -0
  283. /package/dist/{path-X2K5XCHL.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  284. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
  285. /package/dist/{chunk-EOOVJK2U.js.map → chunk-2SYPOX45.js.map} +0 -0
  286. /package/dist/{chunk-64XXOQRW.js.map → chunk-47LPHBIP.js.map} +0 -0
  287. /package/dist/{chunk-6VVP6NK7.js.map → chunk-6GJ2WQRK.js.map} +0 -0
  288. /package/dist/{chunk-4NFVPDIL.js.map → chunk-74MYJSKB.js.map} +0 -0
  289. /package/dist/{chunk-X5J3JZR3.js.map → chunk-773DPI6T.js.map} +0 -0
  290. /package/dist/{chunk-FVI5B7DE.js.map → chunk-7ARKLLCV.js.map} +0 -0
  291. /package/dist/{chunk-AGNBY3VG.js.map → chunk-APJQ6UEA.js.map} +0 -0
  292. /package/dist/{chunk-CI7RKSRE.js.map → chunk-AQEJKOKI.js.map} +0 -0
  293. /package/dist/{chunk-DL6H3D7S.js.map → chunk-ARV3AUOM.js.map} +0 -0
  294. /package/dist/{chunk-JTKFZMZ7.js.map → chunk-BKBSE3BU.js.map} +0 -0
  295. /package/dist/{chunk-TGAHHCB6.js.map → chunk-BMKGG7GC.js.map} +0 -0
  296. /package/dist/{chunk-GFIARMA7.js.map → chunk-C2EHWNP2.js.map} +0 -0
  297. /package/dist/{chunk-VKJHM6PL.js.map → chunk-DGTDRIUO.js.map} +0 -0
  298. /package/dist/{chunk-KC6TCAWV.js.map → chunk-HEHPVBWA.js.map} +0 -0
  299. /package/dist/{chunk-MDJURR27.js.map → chunk-HW5EF6LV.js.map} +0 -0
  300. /package/dist/{chunk-BMFZLLNI.js.map → chunk-ICP53SKG.js.map} +0 -0
  301. /package/dist/{chunk-YOI3ELXF.js.map → chunk-IF362TF6.js.map} +0 -0
  302. /package/dist/{chunk-ABCGDW3A.js.map → chunk-IFR23TC5.js.map} +0 -0
  303. /package/dist/{chunk-OXEAMU42.js.map → chunk-JHAYR2JY.js.map} +0 -0
  304. /package/dist/{chunk-VPAFWWCL.js.map → chunk-K22IJO4R.js.map} +0 -0
  305. /package/dist/{chunk-JMA4RYRN.js.map → chunk-KFU2SKDD.js.map} +0 -0
  306. /package/dist/{chunk-VDX2J7OX.js.map → chunk-KQAFEZQX.js.map} +0 -0
  307. /package/dist/{chunk-AMNLZ6SF.js.map → chunk-KZMMAVR2.js.map} +0 -0
  308. /package/dist/{chunk-EZR35XHX.js.map → chunk-LY4FJLPT.js.map} +0 -0
  309. /package/dist/{chunk-NUIJEGVD.js.map → chunk-M5MWSG4S.js.map} +0 -0
  310. /package/dist/{chunk-Z7XEIAV4.js.map → chunk-MNH2OODZ.js.map} +0 -0
  311. /package/dist/{chunk-MXEWQKM7.js.map → chunk-NFGJBEPT.js.map} +0 -0
  312. /package/dist/{chunk-Q4O3ET6F.js.map → chunk-NUWZFSKC.js.map} +0 -0
  313. /package/dist/{chunk-6TAETM63.js.map → chunk-OM6ETLLH.js.map} +0 -0
  314. /package/dist/{chunk-QQW2LIEA.js.map → chunk-OMSTU233.js.map} +0 -0
  315. /package/dist/{chunk-XGMCUY5P.js.map → chunk-S3WYRPSA.js.map} +0 -0
  316. /package/dist/{chunk-QIMFOCSH.js.map → chunk-S5APSA3U.js.map} +0 -0
  317. /package/dist/{chunk-IX72AAMZ.js.map → chunk-SY6WG6DB.js.map} +0 -0
  318. /package/dist/{chunk-MBUM2Y3L.js.map → chunk-ULVM34NP.js.map} +0 -0
  319. /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
  320. /package/dist/{chunk-7WWURLG6.js.map → chunk-XPOOY35N.js.map} +0 -0
  321. /package/dist/{chunk-EYJD6KIO.js.map → chunk-Y4PMATX2.js.map} +0 -0
  322. /package/dist/{chunk-KF74X62T.js.map → chunk-YGKUAX2B.js.map} +0 -0
  323. /package/dist/{chunk-YN4ZT4CW.js.map → chunk-YI7RZO7Y.js.map} +0 -0
  324. /package/dist/{graph-edge-decay-D7OESCBR.js.map → graph-edge-decay-JLOF3YW4.js.map} +0 -0
@@ -549,6 +549,10 @@ export const codegraphIngestTracesOperation = defineOperation<
549
549
  },
550
550
  });
551
551
 
552
+ // Batch-migrated operations (issue #1525): registers all remaining
553
+ // handlers through the boundary as a side effect of importing this module.
554
+ import "./access-operations-batch.js";
555
+
552
556
  export const REGISTERED_OPERATIONS = [
553
557
  memoryGetOperation.spec.name,
554
558
  memorySearchOperation.spec.name,
@@ -44,7 +44,7 @@ import {
44
44
  // catalog-completeness correction: adding routes that were always live but
45
45
  // omitted from the catalog (review-caught). Such a bump MUST be accompanied
46
46
  // by the newly-cataloged entries; the higher count is the honest baseline.
47
- const UNMIGRATED_HANDLER_BASELINE = 134;
47
+ const UNMIGRATED_HANDLER_BASELINE = 80;
48
48
 
49
49
  // Keep the import live — `getOperation` is the call surfaces use at dispatch
50
50
  // time; referencing it here pins the registry's lookup contract.
@@ -187,6 +187,7 @@ function extractHttpRouteDispatchMap(): Map<string, Set<string>> {
187
187
  const lines = source.split("\n");
188
188
  const routeOps = new Map<string, Set<string>>();
189
189
  let currentKey: string | null = null;
190
+ let lastSeenPathname: string | null = null;
190
191
 
191
192
  for (let i = 0; i < lines.length; i++) {
192
193
  const line = lines[i]!;
@@ -217,6 +218,7 @@ function extractHttpRouteDispatchMap(): Map<string, Set<string>> {
217
218
  }
218
219
 
219
220
  if (pathname) {
221
+ lastSeenPathname = pathname;
220
222
  // Determine the HTTP method: same line first, then backward for
221
223
  // exact-match routes, forward for dynamic routes. Check both positive
222
224
  // (===) and negated (!==) method patterns — `req.method !== "GET"` as
@@ -253,6 +255,20 @@ function extractHttpRouteDispatchMap(): Map<string, Set<string>> {
253
255
  continue;
254
256
  }
255
257
 
258
+ // Detect method changes within a shared route block (e.g. a single
259
+ // regex match with GET/PUT/DELETE branches). When a new method check
260
+ // appears after a route pattern was already detected, update currentKey
261
+ // to the new method + the same pathname so per-method getOperation
262
+ // calls are tracked against the right route key.
263
+ const methodChange = line.match(/req\.method\s*===\s*"(\w+)"/);
264
+ if (methodChange && lastSeenPathname) {
265
+ const newKey = methodChange[1]! + " " + lastSeenPathname;
266
+ if (!routeOps.has(newKey)) {
267
+ routeOps.set(newKey, new Set<string>());
268
+ }
269
+ currentKey = newKey;
270
+ }
271
+
256
272
  // Collect getOperation calls within the current route block.
257
273
  if (currentKey) {
258
274
  const opMatch = line.match(/getOperation\("(\w+)"\)/);
@@ -160,65 +160,68 @@ export const MCP_TOOLS: readonly McpToolEntry[] = [
160
160
  // (health, adapters, the /mcp delegate, admin console, SSE-only endpoints)
161
161
  // carry no user request envelope and are intentionally excluded.
162
162
  export const HTTP_ROUTES: readonly HttpRouteEntry[] = [
163
- { method: "POST", pathname: "/engram/v1/recall", operation: null },
164
- { method: "POST", pathname: "/engram/v1/coding-context", operation: null },
165
- { method: "POST", pathname: "/engram/v1/capsules/export", operation: null },
166
- { method: "POST", pathname: "/engram/v1/capsules/import", operation: null },
167
- { method: "GET", pathname: "/engram/v1/offline-sync/snapshot", operation: null },
168
- { method: "GET", pathname: "/engram/v1/offline-sync/snapshot-stream", operation: null },
169
- { method: "POST", pathname: "/engram/v1/offline-sync/snapshot", operation: null },
170
- { method: "POST", pathname: "/engram/v1/offline-sync/files", operation: null },
171
- { method: "POST", pathname: "/engram/v1/offline-sync/file-content", operation: null },
172
- { method: "POST", pathname: "/engram/v1/offline-sync/apply-file-content", operation: null },
173
- { method: "POST", pathname: "/engram/v1/offline-sync/apply", operation: null },
174
- { method: "POST", pathname: "/engram/v1/recall/explain", operation: null },
175
- { method: "POST", pathname: "/engram/v1/action-confidence", operation: null },
176
- { method: "GET", pathname: "/engram/v1/recall/tier-explain", operation: null },
177
- { method: "GET", pathname: "/engram/v1/recall/xray", operation: null },
178
- { method: "GET", pathname: "/engram/v1/wearables/status", operation: null },
179
- { method: "POST", pathname: "/engram/v1/wearables/sync", operation: null },
180
- { method: "GET", pathname: "/engram/v1/wearables/transcript", operation: null },
181
- { method: "GET", pathname: "/engram/v1/wearables/transcripts/search", operation: null },
182
- { method: "GET", pathname: "/engram/v1/wearables/memories", operation: null },
183
- { method: "POST", pathname: "/engram/v1/observe", operation: null },
184
- { method: "POST", pathname: "/engram/v1/lcm/search", operation: null },
185
- { method: "POST", pathname: "/engram/v1/lcm/compaction/flush", operation: null },
186
- { method: "POST", pathname: "/engram/v1/lcm/compaction/record", operation: null },
187
- { method: "GET", pathname: "/engram/v1/lcm/status", operation: null },
163
+ { method: "POST", pathname: "/engram/v1/recall", operation: "recall" },
164
+ { method: "POST", pathname: "/engram/v1/coding-context", operation: "set_coding_context" },
165
+ { method: "POST", pathname: "/engram/v1/capsules/export", operation: "capsule_export" },
166
+ { method: "POST", pathname: "/engram/v1/capsules/import", operation: "capsule_import" },
167
+ { method: "GET", pathname: "/engram/v1/offline-sync/snapshot", operation: "offline_sync_snapshot" },
168
+ { method: "POST", pathname: "/engram/v1/offline-sync/snapshot", operation: "offline_sync_snapshot" },
169
+ { method: "POST", pathname: "/engram/v1/offline-sync/files", operation: "offline_sync_files" },
170
+ { method: "POST", pathname: "/engram/v1/offline-sync/file-content", operation: "offline_sync_file_content" },
171
+ { method: "POST", pathname: "/engram/v1/offline-sync/apply-file-content", operation: "offline_sync_apply_file_content" },
172
+ { method: "POST", pathname: "/engram/v1/offline-sync/apply", operation: "offline_sync_apply" },
173
+ { method: "POST", pathname: "/engram/v1/recall/explain", operation: "recall_explain" },
174
+ { method: "POST", pathname: "/engram/v1/action-confidence", operation: "action_confidence" },
175
+ { method: "GET", pathname: "/engram/v1/recall/tier-explain", operation: "recall_tier_explain" },
176
+ { method: "GET", pathname: "/engram/v1/recall/xray", operation: "recall_xray" },
177
+ { method: "GET", pathname: "/engram/v1/wearables/status", operation: "wearables_status" },
178
+ { method: "POST", pathname: "/engram/v1/wearables/sync", operation: "wearables_sync" },
179
+ { method: "GET", pathname: "/engram/v1/wearables/transcript", operation: "transcript_day" },
180
+ { method: "GET", pathname: "/engram/v1/wearables/transcripts/search", operation: "transcript_search" },
181
+ { method: "GET", pathname: "/engram/v1/wearables/memories", operation: "transcript_memories" },
182
+ { method: "POST", pathname: "/engram/v1/observe", operation: "observe" },
183
+ { method: "POST", pathname: "/engram/v1/lcm/search", operation: "lcm_search" },
184
+ { method: "POST", pathname: "/engram/v1/lcm/compaction/flush", operation: "lcm_compaction_flush" },
185
+ { method: "POST", pathname: "/engram/v1/lcm/compaction/record", operation: "lcm_compaction_record" },
186
+ { method: "GET", pathname: "/engram/v1/lcm/status", operation: "lcm_status" },
188
187
  { method: "POST", pathname: "/engram/v1/memories", operation: "memory_store" },
189
188
  { method: "POST", pathname: "/engram/v1/coding/decisions", operation: "coding_decision" },
190
189
  { method: "POST", pathname: "/engram/v1/coding/architecture", operation: "coding_architecture" },
191
190
  { method: "POST", pathname: "/engram/v1/coding/delta", operation: "coding_delta" },
192
- { method: "POST", pathname: "/engram/v1/suggestions", operation: null },
193
- { method: "GET", pathname: "/engram/v1/memories", operation: null },
191
+ { method: "POST", pathname: "/engram/v1/suggestions", operation: "suggestion_submit" },
192
+ { method: "GET", pathname: "/engram/v1/memories", operation: "memory_list" },
194
193
  { method: "GET", pathname: "/engram/v1/memories/:id", operation: "memory_get" },
195
- { method: "GET", pathname: "/engram/v1/memories/:id/timeline", operation: null },
196
- { method: "GET", pathname: "/engram/v1/entities", operation: null },
197
- { method: "GET", pathname: "/engram/v1/entities/:id", operation: null },
198
- { method: "GET", pathname: "/engram/v1/review-queue", operation: null },
199
- { method: "GET", pathname: "/engram/v1/maintenance", operation: null },
200
- { method: "GET", pathname: "/engram/v1/quality", operation: null },
201
- { method: "GET", pathname: "/engram/v1/trust-zones/status", operation: null },
202
- { method: "GET", pathname: "/engram/v1/procedural/stats", operation: null },
203
- { method: "GET", pathname: "/engram/v1/trust-zones/records", operation: null },
204
- { method: "POST", pathname: "/engram/v1/review-disposition", operation: null },
205
- { method: "POST", pathname: "/engram/v1/trust-zones/promote", operation: null },
206
- { method: "POST", pathname: "/engram/v1/trust-zones/demo-seed", operation: null },
207
- { method: "POST", pathname: "/v1/citations/observed", operation: null },
208
- { method: "GET", pathname: "/engram/v1/review/contradictions", operation: null },
209
- { method: "GET", pathname: "/engram/v1/review/contradictions/:id", operation: null },
210
- { method: "POST", pathname: "/engram/v1/review/resolve", operation: null },
211
- { method: "GET", pathname: "/engram/v1/graph/snapshot", operation: null },
212
- { method: "POST", pathname: "/engram/v1/contradiction-scan", operation: null },
213
- { method: "GET", pathname: "/engram/v1/graph/events", operation: null },
214
- { method: "GET", pathname: "/engram/v1/console/state", operation: null },
215
- { method: "GET", pathname: "/engram/v1/peers", operation: null },
216
- { method: "GET", pathname: "/engram/v1/peers/:id/profile", operation: null },
217
- { method: "GET", pathname: "/engram/v1/peers/:id", operation: null },
218
- { method: "PUT", pathname: "/engram/v1/peers/:id", operation: null },
219
- { method: "DELETE", pathname: "/engram/v1/peers/:id", operation: null },
220
- { method: "GET", pathname: "/engram/v1/dreams/status", operation: null },
221
- { method: "POST", pathname: "/engram/v1/dreams/run", operation: null },
194
+ { method: "GET", pathname: "/engram/v1/memories/:id/timeline", operation: "memory_timeline" },
195
+ { method: "GET", pathname: "/engram/v1/entities", operation: "entity_list" },
196
+ { method: "GET", pathname: "/engram/v1/entities/:id", operation: "entity_get" },
197
+ { method: "GET", pathname: "/engram/v1/review-queue", operation: "review_queue_list" },
198
+ { method: "GET", pathname: "/engram/v1/maintenance", operation: "maintenance_status" },
199
+ { method: "GET", pathname: "/engram/v1/quality", operation: "quality_status" },
200
+ { method: "GET", pathname: "/engram/v1/trust-zones/status", operation: "trust_zones_status" },
201
+ { method: "GET", pathname: "/engram/v1/procedural/stats", operation: "procedural_stats" },
202
+ { method: "GET", pathname: "/engram/v1/trust-zones/records", operation: "trust_zones_records" },
203
+ { method: "POST", pathname: "/engram/v1/review-disposition", operation: "review_disposition" },
204
+ { method: "POST", pathname: "/engram/v1/trust-zones/promote", operation: "trust_zones_promote" },
205
+ { method: "POST", pathname: "/engram/v1/trust-zones/demo-seed", operation: "trust_zones_demo_seed" },
206
+ { method: "POST", pathname: "/v1/citations/observed", operation: "citations_observed" },
207
+ { method: "GET", pathname: "/engram/v1/review/contradictions", operation: "review_list" },
208
+ { method: "GET", pathname: "/engram/v1/review/contradictions/:id", operation: "contradiction_detail" },
209
+ { method: "POST", pathname: "/engram/v1/review/resolve", operation: "review_resolve" },
210
+ { method: "GET", pathname: "/engram/v1/graph/snapshot", operation: "graph_snapshot" },
211
+ { method: "POST", pathname: "/engram/v1/contradiction-scan", operation: "contradiction_scan_run" },
212
+ { method: "GET", pathname: "/engram/v1/console/state", operation: "console_state" },
213
+ { method: "GET", pathname: "/engram/v1/peers", operation: "peer_list" },
214
+ { method: "GET", pathname: "/engram/v1/peers/:id/profile", operation: "peer_profile_get" },
215
+ { method: "GET", pathname: "/engram/v1/peers/:id", operation: "peer_get" },
216
+ { method: "PUT", pathname: "/engram/v1/peers/:id", operation: "peer_set" },
217
+ { method: "DELETE", pathname: "/engram/v1/peers/:id", operation: "peer_delete" },
218
+ { method: "GET", pathname: "/engram/v1/dreams/status", operation: "dreams_status" },
219
+ { method: "POST", pathname: "/engram/v1/dreams/run", operation: "dreams_run" },
220
+ // SSE-only endpoints: carried in the catalog for completeness tracking.
221
+ // The operation registration makes them visible to the boundary; the
222
+ // streaming lifecycle is owned by the HTTP transport (handleGraphEventsSSE).
223
+ { method: "GET", pathname: "/engram/v1/offline-sync/snapshot-stream", operation: "offline_sync_snapshot_stream" },
224
+ { method: "GET", pathname: "/engram/v1/graph/events", operation: "graph_events" },
222
225
  ];
223
226
 
224
227
  /**
@@ -0,0 +1,346 @@
1
+ /**
2
+ * Creation-memory ledger command group — extracted from cli.ts (#1532 Phase B).
3
+ *
4
+ * Ten creation-memory ledger commands — thin wrappers over exported
5
+ * runXxxCliCommand helpers across three ledgers:
6
+ * - resume-bundle (status / record / build)
7
+ * - commitment (status / record / set-state / lifecycle)
8
+ * - work-product (status / record / recall-search)
9
+ *
10
+ * Behaviour is identical to the inline registration it replaces — the
11
+ * cli-command-surface contract tests guard against silent drift.
12
+ *
13
+ * Circular import note: same safe pattern as research-status-commands.ts —
14
+ * the runXxx helpers are referenced only inside action callbacks invoked at
15
+ * runtime, never at module-eval time.
16
+ */
17
+
18
+ import type { Orchestrator } from "../orchestrator.js";
19
+ import type { CliCommand } from "../cli.js";
20
+ import type { CommitmentLedgerEntry } from "../commitment-ledger.js";
21
+ import type { WorkProductLedgerEntry } from "../work-product-ledger.js";
22
+ import type { ResumeBundle } from "../resume-bundles.js";
23
+ import {
24
+ runResumeBundleStatusCliCommand,
25
+ runResumeBundleRecordCliCommand,
26
+ runResumeBundleBuildCliCommand,
27
+ runCommitmentStatusCliCommand,
28
+ runCommitmentRecordCliCommand,
29
+ runCommitmentSetStateCliCommand,
30
+ runCommitmentLifecycleCliCommand,
31
+ runWorkProductStatusCliCommand,
32
+ runWorkProductRecordCliCommand,
33
+ runWorkProductRecallSearchCliCommand,
34
+ } from "../cli.js";
35
+
36
+ /**
37
+ * Register the creation-memory ledger command group on the parent `engram`
38
+ * command. Extracted verbatim from registerCli; behaviour-preserving.
39
+ */
40
+ export function registerCreationLedgerCommands(
41
+ cmd: CliCommand,
42
+ orchestrator: Orchestrator,
43
+ ): void {
44
+ cmd
45
+ .command("resume-bundle-status")
46
+ .description("Show resume bundle status, bundle counts, and the latest recorded handoff bundle")
47
+ .action(async () => {
48
+ const status = await runResumeBundleStatusCliCommand({
49
+ memoryDir: orchestrator.config.memoryDir,
50
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
51
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
52
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
53
+ });
54
+ console.log(JSON.stringify(status, null, 2));
55
+ console.log("OK");
56
+ });
57
+
58
+ cmd
59
+ .command("resume-bundle-record")
60
+ .description("Record an explicit resume bundle when creation-memory handoff bundles are enabled")
61
+ .requiredOption("--bundle-id <bundleId>", "Resume bundle id")
62
+ .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle")
63
+ .requiredOption("--session-key <sessionKey>", "Session key that owns the bundle")
64
+ .requiredOption("--source <source>", "Bundle source (tool_result|cli|system|manual)")
65
+ .requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle")
66
+ .requiredOption("--summary <summary>", "Human-readable summary of what this bundle preserves")
67
+ .option("--key-fact <keyFact...>", "Short facts that a resumed agent should retain")
68
+ .option("--next-action <nextAction...>", "Explicit next actions for the resumed agent")
69
+ .option("--risk-flag <riskFlag...>", "Open risks or cautions attached to the bundle")
70
+ .option(
71
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
72
+ "Objective-state snapshot refs attached to the bundle",
73
+ )
74
+ .option(
75
+ "--work-product-entry-ref <workProductEntryRef...>",
76
+ "Work-product ledger refs attached to the bundle",
77
+ )
78
+ .option(
79
+ "--commitment-entry-ref <commitmentEntryRef...>",
80
+ "Commitment ledger refs attached to the bundle",
81
+ )
82
+ .action(async (...args: unknown[]) => {
83
+ const options = (args[0] ?? {}) as Record<string, unknown>;
84
+ const filePath = await runResumeBundleRecordCliCommand({
85
+ memoryDir: orchestrator.config.memoryDir,
86
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
87
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
88
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
89
+ bundle: {
90
+ schemaVersion: 1,
91
+ bundleId: String(options.bundleId ?? ""),
92
+ recordedAt: String(options.recordedAt ?? ""),
93
+ sessionKey: String(options.sessionKey ?? ""),
94
+ source: String(options.source ?? "") as ResumeBundle["source"],
95
+ scope: String(options.scope ?? ""),
96
+ summary: String(options.summary ?? ""),
97
+ keyFacts: Array.isArray(options.keyFact) ? options.keyFact.map(String) : undefined,
98
+ nextActions: Array.isArray(options.nextAction) ? options.nextAction.map(String) : undefined,
99
+ riskFlags: Array.isArray(options.riskFlag) ? options.riskFlag.map(String) : undefined,
100
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
101
+ ? options.objectiveStateSnapshotRef.map(String)
102
+ : undefined,
103
+ workProductEntryRefs: Array.isArray(options.workProductEntryRef)
104
+ ? options.workProductEntryRef.map(String)
105
+ : undefined,
106
+ commitmentEntryRefs: Array.isArray(options.commitmentEntryRef)
107
+ ? options.commitmentEntryRef.map(String)
108
+ : undefined,
109
+ },
110
+ });
111
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
112
+ console.log("OK");
113
+ });
114
+
115
+ cmd
116
+ .command("resume-bundle-build")
117
+ .description("Build and persist a resume bundle from transcript recovery, objective state, work products, and open commitments")
118
+ .requiredOption("--bundle-id <bundleId>", "Resume bundle id")
119
+ .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle")
120
+ .requiredOption("--session-key <sessionKey>", "Session key that owns the bundle")
121
+ .requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle")
122
+ .action(async (...args: unknown[]) => {
123
+ const options = (args[0] ?? {}) as Record<string, unknown>;
124
+ const built = await runResumeBundleBuildCliCommand({
125
+ memoryDir: orchestrator.config.memoryDir,
126
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
127
+ objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
128
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
129
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
130
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
131
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
132
+ transcriptEnabled: orchestrator.config.transcriptEnabled,
133
+ objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
134
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
135
+ bundleId: String(options.bundleId ?? ""),
136
+ recordedAt: String(options.recordedAt ?? ""),
137
+ sessionKey: String(options.sessionKey ?? ""),
138
+ scope: String(options.scope ?? ""),
139
+ });
140
+ console.log(JSON.stringify({
141
+ wrote: built !== null,
142
+ filePath: built?.filePath ?? null,
143
+ bundle: built?.bundle ?? null,
144
+ }, null, 2));
145
+ console.log("OK");
146
+ });
147
+
148
+ cmd
149
+ .command("commitment-status")
150
+ .description("Show commitment ledger status, entry counts, and the latest recorded commitment")
151
+ .action(async () => {
152
+ const status = await runCommitmentStatusCliCommand({
153
+ memoryDir: orchestrator.config.memoryDir,
154
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
155
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
156
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
157
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
158
+ commitmentStaleDays: orchestrator.config.commitmentStaleDays,
159
+ commitmentDecayDays: orchestrator.config.commitmentDecayDays,
160
+ });
161
+ console.log(JSON.stringify(status, null, 2));
162
+ console.log("OK");
163
+ });
164
+
165
+ cmd
166
+ .command("commitment-record")
167
+ .description("Record a commitment ledger entry when commitment memory is enabled")
168
+ .requiredOption("--entry-id <entryId>", "Commitment entry id")
169
+ .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry")
170
+ .requiredOption("--session-key <sessionKey>", "Session key that owns the commitment")
171
+ .requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)")
172
+ .requiredOption("--kind <kind>", "Entry kind (promise|follow_up|deadline|deliverable)")
173
+ .requiredOption("--state <state>", "Entry state (open|fulfilled|cancelled|expired)")
174
+ .requiredOption("--scope <scope>", "Primary scope or identifier for the commitment")
175
+ .requiredOption("--summary <summary>", "Human-readable summary of the commitment")
176
+ .option("--due-at <dueAt>", "Optional due timestamp for the commitment")
177
+ .option("--tag <tag...>", "Tags to attach to the commitment entry")
178
+ .option("--entity-ref <entityRef...>", "Entity refs to attach to the commitment entry")
179
+ .option(
180
+ "--work-product-entry-ref <workProductEntryRef...>",
181
+ "Work-product ledger refs that this commitment depends on",
182
+ )
183
+ .option(
184
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
185
+ "Objective-state snapshot refs to link to this commitment",
186
+ )
187
+ .action(async (...args: unknown[]) => {
188
+ const options = (args[0] ?? {}) as Record<string, unknown>;
189
+ const filePath = await runCommitmentRecordCliCommand({
190
+ memoryDir: orchestrator.config.memoryDir,
191
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
192
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
193
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
194
+ entry: {
195
+ schemaVersion: 1,
196
+ entryId: String(options.entryId ?? ""),
197
+ recordedAt: String(options.recordedAt ?? ""),
198
+ sessionKey: String(options.sessionKey ?? ""),
199
+ source: String(options.source ?? "") as CommitmentLedgerEntry["source"],
200
+ kind: String(options.kind ?? "") as CommitmentLedgerEntry["kind"],
201
+ state: String(options.state ?? "") as CommitmentLedgerEntry["state"],
202
+ scope: String(options.scope ?? ""),
203
+ summary: String(options.summary ?? ""),
204
+ dueAt: typeof options.dueAt === "string" ? options.dueAt : undefined,
205
+ tags: Array.isArray(options.tag) ? options.tag.map(String) : undefined,
206
+ entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : undefined,
207
+ workProductEntryRefs: Array.isArray(options.workProductEntryRef)
208
+ ? options.workProductEntryRef.map(String)
209
+ : undefined,
210
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
211
+ ? options.objectiveStateSnapshotRef.map(String)
212
+ : undefined,
213
+ },
214
+ });
215
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
216
+ console.log("OK");
217
+ });
218
+
219
+ cmd
220
+ .command("commitment-set-state")
221
+ .description("Transition an existing commitment ledger entry when commitment lifecycle is enabled")
222
+ .requiredOption("--entry-id <entryId>", "Commitment entry id")
223
+ .requiredOption("--state <state>", "Next state (open|fulfilled|cancelled|expired)")
224
+ .requiredOption("--changed-at <changedAt>", "ISO timestamp for the lifecycle transition")
225
+ .action(async (...args: unknown[]) => {
226
+ const options = (args[0] ?? {}) as Record<string, unknown>;
227
+ const entry = await runCommitmentSetStateCliCommand({
228
+ memoryDir: orchestrator.config.memoryDir,
229
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
230
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
231
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
232
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
233
+ entryId: String(options.entryId ?? ""),
234
+ nextState: String(options.state ?? "") as CommitmentLedgerEntry["state"],
235
+ changedAt: String(options.changedAt ?? ""),
236
+ });
237
+ console.log(JSON.stringify({ updated: entry !== null, entry }, null, 2));
238
+ console.log("OK");
239
+ });
240
+
241
+ cmd
242
+ .command("commitment-lifecycle-run")
243
+ .description("Apply overdue-expiry and resolved-entry cleanup to the commitment ledger")
244
+ .option("--now <now>", "Override the lifecycle timestamp for testing or backfills")
245
+ .action(async (...args: unknown[]) => {
246
+ const options = (args[0] ?? {}) as Record<string, unknown>;
247
+ const result = await runCommitmentLifecycleCliCommand({
248
+ memoryDir: orchestrator.config.memoryDir,
249
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
250
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
251
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
252
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
253
+ commitmentDecayDays: orchestrator.config.commitmentDecayDays,
254
+ now: typeof options.now === "string" ? options.now : undefined,
255
+ });
256
+ console.log(JSON.stringify({ applied: result !== null, result }, null, 2));
257
+ console.log("OK");
258
+ });
259
+
260
+ cmd
261
+ .command("work-product-status")
262
+ .description("Show work-product ledger status, entry counts, and the latest recorded work product")
263
+ .action(async () => {
264
+ const status = await runWorkProductStatusCliCommand({
265
+ memoryDir: orchestrator.config.memoryDir,
266
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
267
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
268
+ });
269
+ console.log(JSON.stringify(status, null, 2));
270
+ console.log("OK");
271
+ });
272
+
273
+ cmd
274
+ .command("work-product-record")
275
+ .description("Record a work-product ledger entry when creation-memory is enabled")
276
+ .requiredOption("--entry-id <entryId>", "Ledger entry id")
277
+ .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry")
278
+ .requiredOption("--session-key <sessionKey>", "Session key that created the work product")
279
+ .requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)")
280
+ .requiredOption("--kind <kind>", "Entry kind (artifact|file|record|report|workspace)")
281
+ .requiredOption(
282
+ "--entry-action <entryAction>",
283
+ "Entry action (created|updated|deleted|referenced|published)",
284
+ )
285
+ .requiredOption("--scope <scope>", "Primary scope or identifier for the created work product")
286
+ .requiredOption("--summary <summary>", "Human-readable summary of the work product")
287
+ .option("--artifact-path <artifactPath>", "Optional path to the created artifact")
288
+ .option("--tag <tag...>", "Tags to attach to the work-product entry")
289
+ .option("--entity-ref <entityRef...>", "Entity refs to attach to the work-product entry")
290
+ .option(
291
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
292
+ "Objective-state snapshot refs to link to this work product",
293
+ )
294
+ .action(async (...args: unknown[]) => {
295
+ const options = (args[0] ?? {}) as Record<string, unknown>;
296
+ const filePath = await runWorkProductRecordCliCommand({
297
+ memoryDir: orchestrator.config.memoryDir,
298
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
299
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
300
+ entry: {
301
+ schemaVersion: 1,
302
+ entryId: String(options.entryId ?? ""),
303
+ recordedAt: String(options.recordedAt ?? ""),
304
+ sessionKey: String(options.sessionKey ?? ""),
305
+ source: String(options.source ?? "") as WorkProductLedgerEntry["source"],
306
+ kind: String(options.kind ?? "") as WorkProductLedgerEntry["kind"],
307
+ action: String(options.entryAction ?? "") as WorkProductLedgerEntry["action"],
308
+ scope: String(options.scope ?? ""),
309
+ summary: String(options.summary ?? ""),
310
+ artifactPath: typeof options.artifactPath === "string" ? options.artifactPath : undefined,
311
+ tags: Array.isArray(options.tag) ? options.tag.map(String) : undefined,
312
+ entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : undefined,
313
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
314
+ ? options.objectiveStateSnapshotRef.map(String)
315
+ : undefined,
316
+ },
317
+ });
318
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
319
+ console.log("OK");
320
+ });
321
+
322
+ cmd
323
+ .command("work-product-recall-search")
324
+ .description("Preview work-product recovery candidates when creation-memory recall is enabled")
325
+ .argument("<query>", "Prompt-like query to evaluate against the work-product ledger")
326
+ .option("--max-results <count>", "Maximum number of work-product results to return", "3")
327
+ .option("--session-key <sessionKey>", "Optional session key to boost same-session work products")
328
+ .action(async (...args: unknown[]) => {
329
+ const query = typeof args[0] === "string" ? args[0] : "";
330
+ const options = (args[1] ?? {}) as Record<string, unknown>;
331
+ const maxResults = typeof options.maxResults === "string"
332
+ ? Number.parseInt(options.maxResults, 10)
333
+ : 3;
334
+ const results = await runWorkProductRecallSearchCliCommand({
335
+ memoryDir: orchestrator.config.memoryDir,
336
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
337
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
338
+ workProductRecallEnabled: orchestrator.config.workProductRecallEnabled,
339
+ query,
340
+ maxResults: Number.isFinite(maxResults) ? maxResults : 3,
341
+ sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : undefined,
342
+ });
343
+ console.log(JSON.stringify(results, null, 2));
344
+ console.log("OK");
345
+ });
346
+ }