@remnic/core 9.3.702 → 9.3.704

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 (272) hide show
  1. package/dist/access-boundary.d.ts +7 -7
  2. package/dist/access-boundary.js +15 -15
  3. package/dist/access-cli.js +31 -31
  4. package/dist/access-http.d.ts +7 -7
  5. package/dist/access-http.js +19 -19
  6. package/dist/access-mcp.d.ts +7 -7
  7. package/dist/access-mcp.js +18 -18
  8. package/dist/access-operations.d.ts +7 -7
  9. package/dist/access-operations.js +17 -17
  10. package/dist/access-schema.js +3 -3
  11. package/dist/{access-service-COCzhgEL.d.ts → access-service-C8hc8N2i.d.ts} +4 -4
  12. package/dist/access-service.d.ts +7 -7
  13. package/dist/access-service.js +14 -14
  14. package/dist/access-surface-catalog.d.ts +7 -7
  15. package/dist/action-confidence.d.ts +3 -3
  16. package/dist/active-memory-bridge.d.ts +3 -3
  17. package/dist/active-recall.d.ts +3 -3
  18. package/dist/behavior-learner.d.ts +3 -3
  19. package/dist/behavior-signals.d.ts +3 -3
  20. package/dist/bootstrap.d.ts +6 -6
  21. package/dist/briefing.d.ts +3 -3
  22. package/dist/briefing.js +3 -3
  23. package/dist/buffer-surprise-report.d.ts +3 -3
  24. package/dist/buffer.d.ts +3 -3
  25. package/dist/bulk-import/index.d.ts +4 -4
  26. package/dist/calibration.d.ts +3 -3
  27. package/dist/capabilities.d.ts +3 -3
  28. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-GWVG7LGC.js} +2 -2
  29. package/dist/{catalog-DxCzhjE6.d.ts → catalog-CAeU0e1C.d.ts} +1 -1
  30. package/dist/causal-behavior.d.ts +3 -3
  31. package/dist/causal-consolidation.d.ts +3 -3
  32. package/dist/causal-consolidation.js +4 -4
  33. package/dist/{chunk-5VXVXJH6.js → chunk-25FHSOEB.js} +5 -5
  34. package/dist/{chunk-ZCEI242W.js → chunk-3EHCV6YV.js} +368 -358
  35. package/dist/chunk-3EHCV6YV.js.map +1 -0
  36. package/dist/{chunk-QQW2LIEA.js → chunk-53EEQYE5.js} +4 -4
  37. package/dist/{chunk-VDX2J7OX.js → chunk-5W7CTZ2E.js} +4 -4
  38. package/dist/{chunk-VPAFWWCL.js → chunk-6AFVIOVZ.js} +2 -2
  39. package/dist/{chunk-6TAETM63.js → chunk-6GHWF4QH.js} +2 -2
  40. package/dist/{chunk-EZR35XHX.js → chunk-6Q7JFY4P.js} +2 -2
  41. package/dist/{chunk-64XXOQRW.js → chunk-7G4KPGR3.js} +2 -2
  42. package/dist/{chunk-TGAHHCB6.js → chunk-AE3C4PY6.js} +2 -2
  43. package/dist/{chunk-CI7RKSRE.js → chunk-AQEJKOKI.js} +2 -1
  44. package/dist/{chunk-CZJ6QSKG.js → chunk-CTY6QSLZ.js} +4 -4
  45. package/dist/{chunk-FVI5B7DE.js → chunk-DE2OPIQD.js} +2 -2
  46. package/dist/{chunk-MDJURR27.js → chunk-HW5EF6LV.js} +2 -2
  47. package/dist/{chunk-BMFZLLNI.js → chunk-ICP53SKG.js} +2 -2
  48. package/dist/{chunk-MBUM2Y3L.js → chunk-K7QRDDSR.js} +2 -2
  49. package/dist/{chunk-GFIARMA7.js → chunk-NMW3T6T6.js} +5 -5
  50. package/dist/{chunk-6VVP6NK7.js → chunk-OCFNG4LB.js} +2 -2
  51. package/dist/{chunk-KC6TCAWV.js → chunk-OOEVMJK4.js} +5 -5
  52. package/dist/{chunk-MXEWQKM7.js → chunk-ORXVO6TH.js} +2 -2
  53. package/dist/{chunk-BXLOS5AJ.js → chunk-OWHERGF2.js} +2 -2
  54. package/dist/{chunk-EOOVJK2U.js → chunk-PJ5MDXOF.js} +3 -3
  55. package/dist/{chunk-X5J3JZR3.js → chunk-PKMQK2WY.js} +3 -3
  56. package/dist/{chunk-Q4O3ET6F.js → chunk-QDIVMS25.js} +2 -2
  57. package/dist/{chunk-EYJD6KIO.js → chunk-QHNJVWF6.js} +2 -2
  58. package/dist/{chunk-JMA4RYRN.js → chunk-QV5WFNZ2.js} +2 -2
  59. package/dist/{chunk-XGMCUY5P.js → chunk-R64MNFPV.js} +20 -20
  60. package/dist/{chunk-QGJAGC2J.js → chunk-RYDT7LAI.js} +2 -2
  61. package/dist/{chunk-JTKFZMZ7.js → chunk-S24J5LLQ.js} +3 -3
  62. package/dist/{chunk-AMNLZ6SF.js → chunk-TUPNAHHQ.js} +2 -2
  63. package/dist/{chunk-DL6H3D7S.js → chunk-UNNDFYUX.js} +5 -5
  64. package/dist/{chunk-QIMFOCSH.js → chunk-UOIRJ45Z.js} +2 -2
  65. package/dist/{chunk-DQEMWVMT.js → chunk-UVYI6VIX.js} +1 -1
  66. package/dist/{chunk-IX72AAMZ.js → chunk-WAHI7SPK.js} +2 -2
  67. package/dist/{chunk-7WWURLG6.js → chunk-XPOOY35N.js} +2 -2
  68. package/dist/{chunk-NUIJEGVD.js → chunk-XXDOJ5NL.js} +5 -5
  69. package/dist/{chunk-Z7XEIAV4.js → chunk-YLB7NMLD.js} +2 -2
  70. package/dist/{chunk-OXEAMU42.js → chunk-ZXFNSKPY.js} +8 -8
  71. package/dist/{cli-BM4xQPp4.d.ts → cli-ChE0XlJY.d.ts} +6 -6
  72. package/dist/cli.d.ts +9 -9
  73. package/dist/cli.js +31 -31
  74. package/dist/compounding/engine.d.ts +3 -3
  75. package/dist/compounding/engine.js +3 -3
  76. package/dist/compounding/preference-consolidator.d.ts +3 -3
  77. package/dist/compression-optimizer.d.ts +3 -3
  78. package/dist/config.d.ts +3 -3
  79. package/dist/connectors/codex-materialize-runner.d.ts +3 -3
  80. package/dist/connectors/codex-materialize-runner.js +3 -3
  81. package/dist/connectors/codex-materialize.d.ts +3 -3
  82. package/dist/connectors/index.d.ts +3 -3
  83. package/dist/connectors/index.js +3 -3
  84. package/dist/consolidation-provenance-check.d.ts +3 -3
  85. package/dist/consolidation-undo.d.ts +3 -3
  86. package/dist/contradiction/index.d.ts +3 -3
  87. package/dist/conversation-index/backend.d.ts +3 -3
  88. package/dist/conversation-index/chunker.d.ts +3 -3
  89. package/dist/conversation-index/faiss-adapter.d.ts +3 -3
  90. package/dist/conversation-index/indexer.d.ts +3 -3
  91. package/dist/conversation-index/search.d.ts +3 -3
  92. package/dist/day-summary.d.ts +3 -3
  93. package/dist/delinearize.d.ts +3 -3
  94. package/dist/direct-answer-wiring.d.ts +3 -3
  95. package/dist/direct-answer.d.ts +3 -3
  96. package/dist/embedding-fallback.d.ts +3 -3
  97. package/dist/enrichment/index.d.ts +3 -3
  98. package/dist/entity-retrieval.d.ts +3 -3
  99. package/dist/entity-retrieval.js +3 -3
  100. package/dist/entity-schema.d.ts +3 -3
  101. package/dist/explicit-capture.d.ts +6 -6
  102. package/dist/extraction-faithfulness.d.ts +3 -3
  103. package/dist/extraction-judge-telemetry.d.ts +3 -3
  104. package/dist/extraction-judge-training.d.ts +3 -3
  105. package/dist/extraction-judge.d.ts +3 -3
  106. package/dist/extraction.d.ts +3 -3
  107. package/dist/fallback-llm.d.ts +3 -3
  108. package/dist/identity-continuity.d.ts +3 -3
  109. package/dist/importance.d.ts +3 -3
  110. package/dist/importers/index.d.ts +2 -2
  111. package/dist/index.d.ts +14 -29
  112. package/dist/index.js +42 -42
  113. package/dist/intent.d.ts +3 -3
  114. package/dist/lcm/archive.d.ts +1 -1
  115. package/dist/lcm/archive.js +2 -2
  116. package/dist/lcm/engine.d.ts +3 -3
  117. package/dist/lcm/engine.js +4 -4
  118. package/dist/lcm/index.d.ts +3 -3
  119. package/dist/lcm/index.js +4 -4
  120. package/dist/lcm/queue.d.ts +1 -1
  121. package/dist/lcm/recall.d.ts +1 -1
  122. package/dist/lcm/summarizer.d.ts +1 -1
  123. package/dist/lcm/summarizer.js +3 -3
  124. package/dist/lcm/tools.d.ts +3 -3
  125. package/dist/lifecycle.d.ts +3 -3
  126. package/dist/live-connectors-runner.d.ts +3 -3
  127. package/dist/local-llm.d.ts +3 -3
  128. package/dist/maintenance/memory-governance.d.ts +3 -3
  129. package/dist/maintenance/memory-governance.js +3 -3
  130. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  131. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  132. package/dist/mcp-memory-inspector-app.d.ts +7 -7
  133. package/dist/memory-action-policy.d.ts +3 -3
  134. package/dist/memory-cache.d.ts +3 -3
  135. package/dist/memory-lifecycle-ledger-utils.d.ts +3 -3
  136. package/dist/memory-projection-store.d.ts +3 -3
  137. package/dist/memory-provenance.d.ts +3 -3
  138. package/dist/memory-worth-outcomes.d.ts +3 -3
  139. package/dist/{index-DJ9QWMw-.d.ts → message-parts/index.d.ts} +2 -1
  140. package/dist/message-parts/index.js +24 -0
  141. package/dist/models-json.d.ts +3 -3
  142. package/dist/namespaces/migrate.d.ts +4 -4
  143. package/dist/namespaces/migrate.js +8 -8
  144. package/dist/namespaces/principal.d.ts +3 -3
  145. package/dist/namespaces/search.d.ts +3 -3
  146. package/dist/namespaces/search.js +4 -4
  147. package/dist/namespaces/storage.d.ts +4 -4
  148. package/dist/namespaces/storage.js +3 -3
  149. package/dist/native-knowledge.d.ts +3 -3
  150. package/dist/objective-state-writers.d.ts +1 -1
  151. package/dist/objective-state-writers.js +2 -2
  152. package/dist/operator-toolkit.d.ts +3 -3
  153. package/dist/operator-toolkit.js +12 -12
  154. package/dist/orchestration/maintenance.d.ts +4 -4
  155. package/dist/orchestration/maintenance.js +5 -5
  156. package/dist/{orchestrator-C9CDWAm6.d.ts → orchestrator-m_PnhyHj.d.ts} +4 -4
  157. package/dist/orchestrator.d.ts +6 -6
  158. package/dist/orchestrator.js +22 -22
  159. package/dist/patterns-cli.d.ts +3 -3
  160. package/dist/{pipeline-BSTuml0d.d.ts → pipeline-DmqtvION.d.ts} +1 -1
  161. package/dist/policy-runtime.d.ts +3 -3
  162. package/dist/provenance.d.ts +3 -3
  163. package/dist/qmd-recall-cache.d.ts +3 -3
  164. package/dist/qmd.d.ts +3 -3
  165. package/dist/recall-disclosure-escalation.d.ts +3 -3
  166. package/dist/recall-explain-renderer.d.ts +3 -3
  167. package/dist/recall-planner-llm.d.ts +3 -3
  168. package/dist/recall-state.d.ts +3 -3
  169. package/dist/recall-tag-filter.d.ts +3 -3
  170. package/dist/recall-xray-cli.d.ts +3 -3
  171. package/dist/recall-xray-renderer.d.ts +3 -3
  172. package/dist/recall-xray.d.ts +3 -3
  173. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  174. package/dist/replay/normalizers/claude.d.ts +1 -1
  175. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  176. package/dist/replay/normalizers/shared.d.ts +1 -1
  177. package/dist/replay/runner.d.ts +1 -1
  178. package/dist/replay/types.d.ts +1 -1
  179. package/dist/resolve-auth-token.d.ts +3 -3
  180. package/dist/retrieval-agents.d.ts +3 -3
  181. package/dist/retrieval-tiers.d.ts +3 -3
  182. package/dist/routing/engine.d.ts +3 -3
  183. package/dist/routing/store.d.ts +3 -3
  184. package/dist/schemas.d.ts +22 -22
  185. package/dist/search/embed-helper.d.ts +3 -3
  186. package/dist/search/factory.d.ts +3 -3
  187. package/dist/search/factory.js +3 -3
  188. package/dist/search/index.d.ts +3 -3
  189. package/dist/search/index.js +7 -7
  190. package/dist/search/lancedb-backend.d.ts +3 -3
  191. package/dist/search/meilisearch-backend.d.ts +3 -3
  192. package/dist/search/noop-backend.d.ts +3 -3
  193. package/dist/search/orama-backend.d.ts +3 -3
  194. package/dist/search/port.d.ts +3 -3
  195. package/dist/search/remote-backend.d.ts +3 -3
  196. package/dist/{semantic-consolidation-DgFXyALl.d.ts → semantic-consolidation-DVBbq6Wr.d.ts} +1 -1
  197. package/dist/semantic-consolidation.d.ts +4 -4
  198. package/dist/semantic-consolidation.js +4 -4
  199. package/dist/semantic-rule-promotion.js +3 -3
  200. package/dist/semantic-rule-verifier.d.ts +3 -3
  201. package/dist/semantic-rule-verifier.js +3 -3
  202. package/dist/session-observer-bands.d.ts +3 -3
  203. package/dist/session-observer-state.d.ts +3 -3
  204. package/dist/shared-context/manager.d.ts +3 -3
  205. package/dist/signal.d.ts +3 -3
  206. package/dist/storage.d.ts +3 -3
  207. package/dist/storage.js +2 -2
  208. package/dist/summarizer.d.ts +3 -3
  209. package/dist/summary-snapshot.d.ts +3 -3
  210. package/dist/temporal-supersession.d.ts +3 -3
  211. package/dist/temporal-validity.d.ts +3 -3
  212. package/dist/threading.d.ts +3 -3
  213. package/dist/tier-migration.d.ts +3 -3
  214. package/dist/tier-routing.d.ts +3 -3
  215. package/dist/topics.d.ts +3 -3
  216. package/dist/transcript.d.ts +3 -3
  217. package/dist/transfer/backup.js +2 -2
  218. package/dist/transfer/capsule-export.js +2 -2
  219. package/dist/transfer/capsule-import.js +2 -2
  220. package/dist/transfer/types.d.ts +12 -12
  221. package/dist/{types-MWKPZnM0.d.ts → types-CJrvHJjx.d.ts} +2 -2
  222. package/dist/{types-ByK7T3L6.d.ts → types-gb_SNtjR.d.ts} +1 -1
  223. package/dist/types.d.ts +3 -3
  224. package/dist/utility-runtime.d.ts +3 -3
  225. package/dist/utils/path.d.ts +17 -0
  226. package/dist/utils/path.js +9 -0
  227. package/dist/utils/path.js.map +1 -0
  228. package/dist/verified-recall.js +3 -3
  229. package/package.json +27 -2
  230. package/src/cli/creation-ledger-commands.ts +346 -0
  231. package/src/cli/research-status-commands.ts +256 -0
  232. package/src/cli.ts +7 -516
  233. package/dist/chunk-ZCEI242W.js.map +0 -1
  234. package/dist/path-X2K5XCHL.js +0 -9
  235. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  236. /package/dist/{chunk-5VXVXJH6.js.map → chunk-25FHSOEB.js.map} +0 -0
  237. /package/dist/{chunk-QQW2LIEA.js.map → chunk-53EEQYE5.js.map} +0 -0
  238. /package/dist/{chunk-VDX2J7OX.js.map → chunk-5W7CTZ2E.js.map} +0 -0
  239. /package/dist/{chunk-VPAFWWCL.js.map → chunk-6AFVIOVZ.js.map} +0 -0
  240. /package/dist/{chunk-6TAETM63.js.map → chunk-6GHWF4QH.js.map} +0 -0
  241. /package/dist/{chunk-EZR35XHX.js.map → chunk-6Q7JFY4P.js.map} +0 -0
  242. /package/dist/{chunk-64XXOQRW.js.map → chunk-7G4KPGR3.js.map} +0 -0
  243. /package/dist/{chunk-TGAHHCB6.js.map → chunk-AE3C4PY6.js.map} +0 -0
  244. /package/dist/{chunk-CI7RKSRE.js.map → chunk-AQEJKOKI.js.map} +0 -0
  245. /package/dist/{chunk-CZJ6QSKG.js.map → chunk-CTY6QSLZ.js.map} +0 -0
  246. /package/dist/{chunk-FVI5B7DE.js.map → chunk-DE2OPIQD.js.map} +0 -0
  247. /package/dist/{chunk-MDJURR27.js.map → chunk-HW5EF6LV.js.map} +0 -0
  248. /package/dist/{chunk-BMFZLLNI.js.map → chunk-ICP53SKG.js.map} +0 -0
  249. /package/dist/{chunk-MBUM2Y3L.js.map → chunk-K7QRDDSR.js.map} +0 -0
  250. /package/dist/{chunk-GFIARMA7.js.map → chunk-NMW3T6T6.js.map} +0 -0
  251. /package/dist/{chunk-6VVP6NK7.js.map → chunk-OCFNG4LB.js.map} +0 -0
  252. /package/dist/{chunk-KC6TCAWV.js.map → chunk-OOEVMJK4.js.map} +0 -0
  253. /package/dist/{chunk-MXEWQKM7.js.map → chunk-ORXVO6TH.js.map} +0 -0
  254. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-OWHERGF2.js.map} +0 -0
  255. /package/dist/{chunk-EOOVJK2U.js.map → chunk-PJ5MDXOF.js.map} +0 -0
  256. /package/dist/{chunk-X5J3JZR3.js.map → chunk-PKMQK2WY.js.map} +0 -0
  257. /package/dist/{chunk-Q4O3ET6F.js.map → chunk-QDIVMS25.js.map} +0 -0
  258. /package/dist/{chunk-EYJD6KIO.js.map → chunk-QHNJVWF6.js.map} +0 -0
  259. /package/dist/{chunk-JMA4RYRN.js.map → chunk-QV5WFNZ2.js.map} +0 -0
  260. /package/dist/{chunk-XGMCUY5P.js.map → chunk-R64MNFPV.js.map} +0 -0
  261. /package/dist/{chunk-QGJAGC2J.js.map → chunk-RYDT7LAI.js.map} +0 -0
  262. /package/dist/{chunk-JTKFZMZ7.js.map → chunk-S24J5LLQ.js.map} +0 -0
  263. /package/dist/{chunk-AMNLZ6SF.js.map → chunk-TUPNAHHQ.js.map} +0 -0
  264. /package/dist/{chunk-DL6H3D7S.js.map → chunk-UNNDFYUX.js.map} +0 -0
  265. /package/dist/{chunk-QIMFOCSH.js.map → chunk-UOIRJ45Z.js.map} +0 -0
  266. /package/dist/{chunk-DQEMWVMT.js.map → chunk-UVYI6VIX.js.map} +0 -0
  267. /package/dist/{chunk-IX72AAMZ.js.map → chunk-WAHI7SPK.js.map} +0 -0
  268. /package/dist/{chunk-7WWURLG6.js.map → chunk-XPOOY35N.js.map} +0 -0
  269. /package/dist/{chunk-NUIJEGVD.js.map → chunk-XXDOJ5NL.js.map} +0 -0
  270. /package/dist/{chunk-Z7XEIAV4.js.map → chunk-YLB7NMLD.js.map} +0 -0
  271. /package/dist/{chunk-OXEAMU42.js.map → chunk-ZXFNSKPY.js.map} +0 -0
  272. /package/dist/{path-X2K5XCHL.js.map → message-parts/index.js.map} +0 -0
@@ -13,6 +13,9 @@ import {
13
13
  import {
14
14
  importSqlite
15
15
  } from "./chunk-AGNBY3VG.js";
16
+ import {
17
+ backupMemoryDir
18
+ } from "./chunk-OWHERGF2.js";
16
19
  import {
17
20
  exportJsonBundle
18
21
  } from "./chunk-UP6MOYCB.js";
@@ -25,9 +28,6 @@ import {
25
28
  import {
26
29
  importJsonBundle
27
30
  } from "./chunk-2DL3OFLD.js";
28
- import {
29
- backupMemoryDir
30
- } from "./chunk-BXLOS5AJ.js";
31
31
  import {
32
32
  exportMarkdownBundle
33
33
  } from "./chunk-765K3SAT.js";
@@ -47,12 +47,12 @@ import {
47
47
  } from "./chunk-D6RIFG4O.js";
48
48
  import {
49
49
  rebuildMemoryLifecycleLedger
50
- } from "./chunk-TGAHHCB6.js";
50
+ } from "./chunk-AE3C4PY6.js";
51
51
  import {
52
52
  rebuildMemoryProjection,
53
53
  repairMemoryProjection,
54
54
  verifyMemoryProjection
55
- } from "./chunk-EOOVJK2U.js";
55
+ } from "./chunk-PJ5MDXOF.js";
56
56
  import {
57
57
  rebuildObservations
58
58
  } from "./chunk-LZZNTPLR.js";
@@ -70,7 +70,7 @@ import {
70
70
  } from "./chunk-GQL52GQ5.js";
71
71
  import {
72
72
  promoteSemanticRuleFromMemory
73
- } from "./chunk-IX72AAMZ.js";
73
+ } from "./chunk-WAHI7SPK.js";
74
74
  import {
75
75
  resolveAgentAccessAuthToken
76
76
  } from "./chunk-TGQ2NTWH.js";
@@ -98,12 +98,12 @@ import {
98
98
  runOperatorInventory,
99
99
  runOperatorRepair,
100
100
  runOperatorSetup
101
- } from "./chunk-NUIJEGVD.js";
101
+ } from "./chunk-XXDOJ5NL.js";
102
102
  import {
103
103
  listNamespaces,
104
104
  runNamespaceMigration,
105
105
  verifyNamespaces
106
- } from "./chunk-JTKFZMZ7.js";
106
+ } from "./chunk-S24J5LLQ.js";
107
107
  import {
108
108
  GraphDashboardServer
109
109
  } from "./chunk-YNDLCWXS.js";
@@ -116,7 +116,7 @@ import {
116
116
  } from "./chunk-WIWPSQYU.js";
117
117
  import {
118
118
  searchVerifiedEpisodes
119
- } from "./chunk-MXEWQKM7.js";
119
+ } from "./chunk-ORXVO6TH.js";
120
120
  import {
121
121
  getUtilityLearningStatus,
122
122
  learnUtilityPromotionWeights
@@ -130,7 +130,7 @@ import {
130
130
  } from "./chunk-QRDOSYOR.js";
131
131
  import {
132
132
  searchVerifiedSemanticRules
133
- } from "./chunk-EYJD6KIO.js";
133
+ } from "./chunk-QHNJVWF6.js";
134
134
  import {
135
135
  getWorkProductLedgerStatus,
136
136
  recordWorkProductLedgerEntry,
@@ -145,7 +145,7 @@ import {
145
145
  } from "./chunk-33JBK2XP.js";
146
146
  import {
147
147
  formatNamespaceMaintenanceHealthText
148
- } from "./chunk-EZR35XHX.js";
148
+ } from "./chunk-6Q7JFY4P.js";
149
149
  import {
150
150
  analyzeSessionIntegrity,
151
151
  applySessionRepair,
@@ -215,16 +215,16 @@ import {
215
215
  } from "./chunk-OADWQ5CR.js";
216
216
  import {
217
217
  EngramAccessHttpServer
218
- } from "./chunk-5VXVXJH6.js";
218
+ } from "./chunk-25FHSOEB.js";
219
219
  import {
220
220
  WearablesInputError
221
221
  } from "./chunk-7WV3F5DQ.js";
222
222
  import {
223
223
  EngramMcpServer
224
- } from "./chunk-KC6TCAWV.js";
224
+ } from "./chunk-OOEVMJK4.js";
225
225
  import {
226
226
  EngramAccessService
227
- } from "./chunk-OXEAMU42.js";
227
+ } from "./chunk-ZXFNSKPY.js";
228
228
  import {
229
229
  WorkStorage
230
230
  } from "./chunk-GDB4J2H3.js";
@@ -250,7 +250,7 @@ import {
250
250
  readMemoryGovernanceRunArtifact,
251
251
  restoreMemoryGovernanceRun,
252
252
  runMemoryGovernance
253
- } from "./chunk-MBUM2Y3L.js";
253
+ } from "./chunk-K7QRDDSR.js";
254
254
  import {
255
255
  analyzeGraphHealth
256
256
  } from "./chunk-KF74X62T.js";
@@ -709,6 +709,352 @@ function formatRule(rule) {
709
709
  return parts.join(" ");
710
710
  }
711
711
 
712
+ // src/cli/research-status-commands.ts
713
+ function registerResearchStatusCommands(cmd, orchestrator) {
714
+ cmd.command("objective-state-status").description("Show objective-state store status, snapshot counts, and latest stored snapshot").action(async () => {
715
+ const status = await runObjectiveStateStatusCliCommand({
716
+ memoryDir: orchestrator.config.memoryDir,
717
+ objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
718
+ objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
719
+ objectiveStateSnapshotWritesEnabled: orchestrator.config.objectiveStateSnapshotWritesEnabled
720
+ });
721
+ console.log(JSON.stringify(status, null, 2));
722
+ console.log("OK");
723
+ });
724
+ cmd.command("causal-trajectory-status").description("Show causal-trajectory store status, record counts, and latest stored chain").action(async () => {
725
+ const status = await runCausalTrajectoryStatusCliCommand({
726
+ memoryDir: orchestrator.config.memoryDir,
727
+ causalTrajectoryStoreDir: orchestrator.config.causalTrajectoryStoreDir,
728
+ causalTrajectoryMemoryEnabled: orchestrator.config.causalTrajectoryMemoryEnabled
729
+ });
730
+ console.log(JSON.stringify(status, null, 2));
731
+ console.log("OK");
732
+ });
733
+ cmd.command("trust-zone-status").description("Show trust-zone store status, zoned record counts, and latest stored record").action(async () => {
734
+ const status = await runTrustZoneStatusCliCommand({
735
+ memoryDir: orchestrator.config.memoryDir,
736
+ trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
737
+ trustZonesEnabled: orchestrator.config.trustZonesEnabled,
738
+ quarantinePromotionEnabled: orchestrator.config.quarantinePromotionEnabled,
739
+ memoryPoisoningDefenseEnabled: orchestrator.config.memoryPoisoningDefenseEnabled
740
+ });
741
+ console.log(JSON.stringify(status, null, 2));
742
+ console.log("OK");
743
+ });
744
+ cmd.command("trust-zone-demo-seed").description("Explicitly seed an opt-in trust-zone demo dataset for buyer-facing walkthroughs").option("--scenario <scenario>", "Demo scenario id (default: enterprise-buyer-v1)").option("--recorded-at <isoTimestamp>", "Base ISO timestamp used to anchor demo records").option("--dry-run", "Preview the demo dataset without writing any trust-zone records").action(async (...args) => {
745
+ const options = args[0] ?? {};
746
+ const result = await runTrustZoneDemoSeedCliCommand({
747
+ memoryDir: orchestrator.config.memoryDir,
748
+ trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
749
+ trustZonesEnabled: orchestrator.config.trustZonesEnabled,
750
+ scenario: typeof options.scenario === "string" ? options.scenario : void 0,
751
+ recordedAt: typeof options.recordedAt === "string" ? options.recordedAt : void 0,
752
+ dryRun: options.dryRun === true
753
+ });
754
+ console.log(JSON.stringify(result, null, 2));
755
+ console.log("OK");
756
+ });
757
+ cmd.command("abstraction-node-status").description("Show abstraction-node store status, abstraction counts, and latest stored node").action(async () => {
758
+ const status = await runAbstractionNodeStatusCliCommand({
759
+ memoryDir: orchestrator.config.memoryDir,
760
+ abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
761
+ harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
762
+ abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled
763
+ });
764
+ console.log(JSON.stringify(status, null, 2));
765
+ console.log("OK");
766
+ });
767
+ cmd.command("cue-anchor-status").description("Show cue-anchor index status, anchor counts, and the latest stored cue anchor").action(async () => {
768
+ const status = await runCueAnchorStatusCliCommand({
769
+ memoryDir: orchestrator.config.memoryDir,
770
+ abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
771
+ harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
772
+ abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled
773
+ });
774
+ console.log(JSON.stringify(status, null, 2));
775
+ console.log("OK");
776
+ });
777
+ cmd.command("harmonic-search").description("Preview harmonic retrieval blending over abstraction nodes and cue anchors").argument("<query>", "Prompt-like query to evaluate against harmonic retrieval storage").option("--max-results <count>", "Maximum number of blended results to return", "3").option("--session-key <sessionKey>", "Optional session key for same-session tie-breaking").action(async (...args) => {
778
+ const query = typeof args[0] === "string" ? args[0] : "";
779
+ const options = args[1] ?? {};
780
+ const maxResults = typeof options.maxResults === "string" ? Number.parseInt(options.maxResults, 10) : 3;
781
+ const results = await runHarmonicSearchCliCommand({
782
+ memoryDir: orchestrator.config.memoryDir,
783
+ abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
784
+ harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
785
+ abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
786
+ query,
787
+ maxResults: Number.isFinite(maxResults) ? maxResults : 3,
788
+ sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : void 0
789
+ });
790
+ console.log(JSON.stringify(results, null, 2));
791
+ console.log("OK");
792
+ });
793
+ cmd.command("utility-status").description("Show utility-learning telemetry status, event counts, and the latest utility event").action(async () => {
794
+ const status = await runUtilityTelemetryStatusCliCommand({
795
+ memoryDir: orchestrator.config.memoryDir,
796
+ memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
797
+ promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled
798
+ });
799
+ console.log(JSON.stringify(status, null, 2));
800
+ console.log("OK");
801
+ });
802
+ cmd.command("utility-record").description("Record a utility-learning telemetry event when utility learning is enabled").requiredOption("--event-id <eventId>", "Utility telemetry event id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the event").requiredOption("--session-key <sessionKey>", "Session key associated with the event").requiredOption("--source <source>", "Event source (cli|system|benchmark|tool_result)").requiredOption("--target <target>", "Telemetry target (promotion|ranking)").requiredOption("--decision <decision>", "Decision taken (promote|demote|hold|boost|suppress)").requiredOption("--outcome <outcome>", "Observed outcome (helpful|neutral|harmful)").requiredOption("--utility-score <utilityScore>", "Bounded utility score between -1 and 1").requiredOption("--summary <summary>", "Human-readable summary of the measured utility event").option("--memory-id <memoryId...>", "Memory ids linked to the utility event").option("--entity-ref <entityRef...>", "Entity refs linked to the utility event").option("--tag <tag...>", "Tags to attach to the utility event").action(async (...args) => {
803
+ const options = args[0] ?? {};
804
+ const utilityScore = typeof options.utilityScore === "string" ? Number.parseFloat(options.utilityScore) : Number.NaN;
805
+ const filePath = await runUtilityTelemetryRecordCliCommand({
806
+ memoryDir: orchestrator.config.memoryDir,
807
+ memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
808
+ event: {
809
+ schemaVersion: 1,
810
+ eventId: String(options.eventId ?? ""),
811
+ recordedAt: String(options.recordedAt ?? ""),
812
+ sessionKey: String(options.sessionKey ?? ""),
813
+ source: String(options.source ?? ""),
814
+ target: String(options.target ?? ""),
815
+ decision: String(options.decision ?? ""),
816
+ outcome: String(options.outcome ?? ""),
817
+ utilityScore,
818
+ summary: String(options.summary ?? ""),
819
+ memoryIds: Array.isArray(options.memoryId) ? options.memoryId.map(String) : void 0,
820
+ entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
821
+ tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0
822
+ }
823
+ });
824
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
825
+ console.log("OK");
826
+ });
827
+ cmd.command("utility-learning-status").description("Show offline utility-learning snapshot status and learned weight counts").action(async () => {
828
+ const status = await runUtilityLearningStatusCliCommand({
829
+ memoryDir: orchestrator.config.memoryDir,
830
+ memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
831
+ promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled
832
+ });
833
+ console.log(JSON.stringify(status, null, 2));
834
+ console.log("OK");
835
+ });
836
+ cmd.command("utility-learn").description("Learn bounded offline promotion/ranking weights from recorded utility telemetry").option("--window-days <days>", "Telemetry lookback window in days", "14").option("--min-event-count <count>", "Minimum event count required per target/decision group", "3").option("--max-weight-magnitude <value>", "Maximum absolute learned weight magnitude", "0.35").action(async (...args) => {
837
+ const options = args[0] ?? {};
838
+ const learningWindowDays = typeof options.windowDays === "string" ? Number.parseInt(options.windowDays, 10) : 14;
839
+ const minEventCount = typeof options.minEventCount === "string" ? Number.parseInt(options.minEventCount, 10) : 3;
840
+ const maxWeightMagnitude = typeof options.maxWeightMagnitude === "string" ? Number.parseFloat(options.maxWeightMagnitude) : 0.35;
841
+ const result = await runUtilityLearningCliCommand({
842
+ memoryDir: orchestrator.config.memoryDir,
843
+ memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
844
+ learningWindowDays,
845
+ minEventCount,
846
+ maxWeightMagnitude
847
+ });
848
+ console.log(JSON.stringify(result, null, 2));
849
+ console.log("OK");
850
+ });
851
+ }
852
+
853
+ // src/cli/creation-ledger-commands.ts
854
+ function registerCreationLedgerCommands(cmd, orchestrator) {
855
+ cmd.command("resume-bundle-status").description("Show resume bundle status, bundle counts, and the latest recorded handoff bundle").action(async () => {
856
+ const status = await runResumeBundleStatusCliCommand({
857
+ memoryDir: orchestrator.config.memoryDir,
858
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
859
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
860
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled
861
+ });
862
+ console.log(JSON.stringify(status, null, 2));
863
+ console.log("OK");
864
+ });
865
+ cmd.command("resume-bundle-record").description("Record an explicit resume bundle when creation-memory handoff bundles are enabled").requiredOption("--bundle-id <bundleId>", "Resume bundle id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle").requiredOption("--session-key <sessionKey>", "Session key that owns the bundle").requiredOption("--source <source>", "Bundle source (tool_result|cli|system|manual)").requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle").requiredOption("--summary <summary>", "Human-readable summary of what this bundle preserves").option("--key-fact <keyFact...>", "Short facts that a resumed agent should retain").option("--next-action <nextAction...>", "Explicit next actions for the resumed agent").option("--risk-flag <riskFlag...>", "Open risks or cautions attached to the bundle").option(
866
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
867
+ "Objective-state snapshot refs attached to the bundle"
868
+ ).option(
869
+ "--work-product-entry-ref <workProductEntryRef...>",
870
+ "Work-product ledger refs attached to the bundle"
871
+ ).option(
872
+ "--commitment-entry-ref <commitmentEntryRef...>",
873
+ "Commitment ledger refs attached to the bundle"
874
+ ).action(async (...args) => {
875
+ const options = args[0] ?? {};
876
+ const filePath = await runResumeBundleRecordCliCommand({
877
+ memoryDir: orchestrator.config.memoryDir,
878
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
879
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
880
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
881
+ bundle: {
882
+ schemaVersion: 1,
883
+ bundleId: String(options.bundleId ?? ""),
884
+ recordedAt: String(options.recordedAt ?? ""),
885
+ sessionKey: String(options.sessionKey ?? ""),
886
+ source: String(options.source ?? ""),
887
+ scope: String(options.scope ?? ""),
888
+ summary: String(options.summary ?? ""),
889
+ keyFacts: Array.isArray(options.keyFact) ? options.keyFact.map(String) : void 0,
890
+ nextActions: Array.isArray(options.nextAction) ? options.nextAction.map(String) : void 0,
891
+ riskFlags: Array.isArray(options.riskFlag) ? options.riskFlag.map(String) : void 0,
892
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0,
893
+ workProductEntryRefs: Array.isArray(options.workProductEntryRef) ? options.workProductEntryRef.map(String) : void 0,
894
+ commitmentEntryRefs: Array.isArray(options.commitmentEntryRef) ? options.commitmentEntryRef.map(String) : void 0
895
+ }
896
+ });
897
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
898
+ console.log("OK");
899
+ });
900
+ cmd.command("resume-bundle-build").description("Build and persist a resume bundle from transcript recovery, objective state, work products, and open commitments").requiredOption("--bundle-id <bundleId>", "Resume bundle id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle").requiredOption("--session-key <sessionKey>", "Session key that owns the bundle").requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle").action(async (...args) => {
901
+ const options = args[0] ?? {};
902
+ const built = await runResumeBundleBuildCliCommand({
903
+ memoryDir: orchestrator.config.memoryDir,
904
+ resumeBundleDir: orchestrator.config.resumeBundleDir,
905
+ objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
906
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
907
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
908
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
909
+ resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
910
+ transcriptEnabled: orchestrator.config.transcriptEnabled,
911
+ objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
912
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
913
+ bundleId: String(options.bundleId ?? ""),
914
+ recordedAt: String(options.recordedAt ?? ""),
915
+ sessionKey: String(options.sessionKey ?? ""),
916
+ scope: String(options.scope ?? "")
917
+ });
918
+ console.log(JSON.stringify({
919
+ wrote: built !== null,
920
+ filePath: built?.filePath ?? null,
921
+ bundle: built?.bundle ?? null
922
+ }, null, 2));
923
+ console.log("OK");
924
+ });
925
+ cmd.command("commitment-status").description("Show commitment ledger status, entry counts, and the latest recorded commitment").action(async () => {
926
+ const status = await runCommitmentStatusCliCommand({
927
+ memoryDir: orchestrator.config.memoryDir,
928
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
929
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
930
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
931
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
932
+ commitmentStaleDays: orchestrator.config.commitmentStaleDays,
933
+ commitmentDecayDays: orchestrator.config.commitmentDecayDays
934
+ });
935
+ console.log(JSON.stringify(status, null, 2));
936
+ console.log("OK");
937
+ });
938
+ cmd.command("commitment-record").description("Record a commitment ledger entry when commitment memory is enabled").requiredOption("--entry-id <entryId>", "Commitment entry id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry").requiredOption("--session-key <sessionKey>", "Session key that owns the commitment").requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)").requiredOption("--kind <kind>", "Entry kind (promise|follow_up|deadline|deliverable)").requiredOption("--state <state>", "Entry state (open|fulfilled|cancelled|expired)").requiredOption("--scope <scope>", "Primary scope or identifier for the commitment").requiredOption("--summary <summary>", "Human-readable summary of the commitment").option("--due-at <dueAt>", "Optional due timestamp for the commitment").option("--tag <tag...>", "Tags to attach to the commitment entry").option("--entity-ref <entityRef...>", "Entity refs to attach to the commitment entry").option(
939
+ "--work-product-entry-ref <workProductEntryRef...>",
940
+ "Work-product ledger refs that this commitment depends on"
941
+ ).option(
942
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
943
+ "Objective-state snapshot refs to link to this commitment"
944
+ ).action(async (...args) => {
945
+ const options = args[0] ?? {};
946
+ const filePath = await runCommitmentRecordCliCommand({
947
+ memoryDir: orchestrator.config.memoryDir,
948
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
949
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
950
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
951
+ entry: {
952
+ schemaVersion: 1,
953
+ entryId: String(options.entryId ?? ""),
954
+ recordedAt: String(options.recordedAt ?? ""),
955
+ sessionKey: String(options.sessionKey ?? ""),
956
+ source: String(options.source ?? ""),
957
+ kind: String(options.kind ?? ""),
958
+ state: String(options.state ?? ""),
959
+ scope: String(options.scope ?? ""),
960
+ summary: String(options.summary ?? ""),
961
+ dueAt: typeof options.dueAt === "string" ? options.dueAt : void 0,
962
+ tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0,
963
+ entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
964
+ workProductEntryRefs: Array.isArray(options.workProductEntryRef) ? options.workProductEntryRef.map(String) : void 0,
965
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0
966
+ }
967
+ });
968
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
969
+ console.log("OK");
970
+ });
971
+ cmd.command("commitment-set-state").description("Transition an existing commitment ledger entry when commitment lifecycle is enabled").requiredOption("--entry-id <entryId>", "Commitment entry id").requiredOption("--state <state>", "Next state (open|fulfilled|cancelled|expired)").requiredOption("--changed-at <changedAt>", "ISO timestamp for the lifecycle transition").action(async (...args) => {
972
+ const options = args[0] ?? {};
973
+ const entry = await runCommitmentSetStateCliCommand({
974
+ memoryDir: orchestrator.config.memoryDir,
975
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
976
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
977
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
978
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
979
+ entryId: String(options.entryId ?? ""),
980
+ nextState: String(options.state ?? ""),
981
+ changedAt: String(options.changedAt ?? "")
982
+ });
983
+ console.log(JSON.stringify({ updated: entry !== null, entry }, null, 2));
984
+ console.log("OK");
985
+ });
986
+ cmd.command("commitment-lifecycle-run").description("Apply overdue-expiry and resolved-entry cleanup to the commitment ledger").option("--now <now>", "Override the lifecycle timestamp for testing or backfills").action(async (...args) => {
987
+ const options = args[0] ?? {};
988
+ const result = await runCommitmentLifecycleCliCommand({
989
+ memoryDir: orchestrator.config.memoryDir,
990
+ commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
991
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
992
+ commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
993
+ commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
994
+ commitmentDecayDays: orchestrator.config.commitmentDecayDays,
995
+ now: typeof options.now === "string" ? options.now : void 0
996
+ });
997
+ console.log(JSON.stringify({ applied: result !== null, result }, null, 2));
998
+ console.log("OK");
999
+ });
1000
+ cmd.command("work-product-status").description("Show work-product ledger status, entry counts, and the latest recorded work product").action(async () => {
1001
+ const status = await runWorkProductStatusCliCommand({
1002
+ memoryDir: orchestrator.config.memoryDir,
1003
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
1004
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled
1005
+ });
1006
+ console.log(JSON.stringify(status, null, 2));
1007
+ console.log("OK");
1008
+ });
1009
+ cmd.command("work-product-record").description("Record a work-product ledger entry when creation-memory is enabled").requiredOption("--entry-id <entryId>", "Ledger entry id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry").requiredOption("--session-key <sessionKey>", "Session key that created the work product").requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)").requiredOption("--kind <kind>", "Entry kind (artifact|file|record|report|workspace)").requiredOption(
1010
+ "--entry-action <entryAction>",
1011
+ "Entry action (created|updated|deleted|referenced|published)"
1012
+ ).requiredOption("--scope <scope>", "Primary scope or identifier for the created work product").requiredOption("--summary <summary>", "Human-readable summary of the work product").option("--artifact-path <artifactPath>", "Optional path to the created artifact").option("--tag <tag...>", "Tags to attach to the work-product entry").option("--entity-ref <entityRef...>", "Entity refs to attach to the work-product entry").option(
1013
+ "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
1014
+ "Objective-state snapshot refs to link to this work product"
1015
+ ).action(async (...args) => {
1016
+ const options = args[0] ?? {};
1017
+ const filePath = await runWorkProductRecordCliCommand({
1018
+ memoryDir: orchestrator.config.memoryDir,
1019
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
1020
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
1021
+ entry: {
1022
+ schemaVersion: 1,
1023
+ entryId: String(options.entryId ?? ""),
1024
+ recordedAt: String(options.recordedAt ?? ""),
1025
+ sessionKey: String(options.sessionKey ?? ""),
1026
+ source: String(options.source ?? ""),
1027
+ kind: String(options.kind ?? ""),
1028
+ action: String(options.entryAction ?? ""),
1029
+ scope: String(options.scope ?? ""),
1030
+ summary: String(options.summary ?? ""),
1031
+ artifactPath: typeof options.artifactPath === "string" ? options.artifactPath : void 0,
1032
+ tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0,
1033
+ entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
1034
+ objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0
1035
+ }
1036
+ });
1037
+ console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
1038
+ console.log("OK");
1039
+ });
1040
+ cmd.command("work-product-recall-search").description("Preview work-product recovery candidates when creation-memory recall is enabled").argument("<query>", "Prompt-like query to evaluate against the work-product ledger").option("--max-results <count>", "Maximum number of work-product results to return", "3").option("--session-key <sessionKey>", "Optional session key to boost same-session work products").action(async (...args) => {
1041
+ const query = typeof args[0] === "string" ? args[0] : "";
1042
+ const options = args[1] ?? {};
1043
+ const maxResults = typeof options.maxResults === "string" ? Number.parseInt(options.maxResults, 10) : 3;
1044
+ const results = await runWorkProductRecallSearchCliCommand({
1045
+ memoryDir: orchestrator.config.memoryDir,
1046
+ workProductLedgerDir: orchestrator.config.workProductLedgerDir,
1047
+ creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
1048
+ workProductRecallEnabled: orchestrator.config.workProductRecallEnabled,
1049
+ query,
1050
+ maxResults: Number.isFinite(maxResults) ? maxResults : 3,
1051
+ sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : void 0
1052
+ });
1053
+ console.log(JSON.stringify(results, null, 2));
1054
+ console.log("OK");
1055
+ });
1056
+ }
1057
+
712
1058
  // src/training-export/converter.ts
713
1059
  import { constants } from "fs";
714
1060
  import { lstat, open, readdir, realpath } from "fs/promises";
@@ -3635,7 +3981,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
3635
3981
  }
3636
3982
  }
3637
3983
  if (sourceArchive.endsWith(".enc")) {
3638
- const { isEncryptedCapsuleFile } = await import("./capsule-crypto-YO5QJ6L3.js");
3984
+ const { isEncryptedCapsuleFile } = await import("./capsule-crypto-GWVG7LGC.js");
3639
3985
  const encDetected = await isEncryptedCapsuleFile(sourceArchive).catch(() => true);
3640
3986
  if (encDetected) {
3641
3987
  throw new Error(
@@ -3798,7 +4144,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
3798
4144
  const { parseExportBundle } = await import("./transfer/types.js");
3799
4145
  let decryptedBuf;
3800
4146
  try {
3801
- const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-YO5QJ6L3.js");
4147
+ const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-GWVG7LGC.js");
3802
4148
  decryptedBuf = await decryptCapsuleFileInMemory(archivePath, memoryDir);
3803
4149
  } catch (decErr) {
3804
4150
  const msg = decErr instanceof Error ? decErr.message : String(decErr);
@@ -4699,344 +5045,8 @@ ${doc.content}` : doc.content,
4699
5045
  }
4700
5046
  console.log("OK");
4701
5047
  });
4702
- cmd.command("objective-state-status").description("Show objective-state store status, snapshot counts, and latest stored snapshot").action(async () => {
4703
- const status = await runObjectiveStateStatusCliCommand({
4704
- memoryDir: orchestrator.config.memoryDir,
4705
- objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
4706
- objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
4707
- objectiveStateSnapshotWritesEnabled: orchestrator.config.objectiveStateSnapshotWritesEnabled
4708
- });
4709
- console.log(JSON.stringify(status, null, 2));
4710
- console.log("OK");
4711
- });
4712
- cmd.command("causal-trajectory-status").description("Show causal-trajectory store status, record counts, and latest stored chain").action(async () => {
4713
- const status = await runCausalTrajectoryStatusCliCommand({
4714
- memoryDir: orchestrator.config.memoryDir,
4715
- causalTrajectoryStoreDir: orchestrator.config.causalTrajectoryStoreDir,
4716
- causalTrajectoryMemoryEnabled: orchestrator.config.causalTrajectoryMemoryEnabled
4717
- });
4718
- console.log(JSON.stringify(status, null, 2));
4719
- console.log("OK");
4720
- });
4721
- cmd.command("trust-zone-status").description("Show trust-zone store status, zoned record counts, and latest stored record").action(async () => {
4722
- const status = await runTrustZoneStatusCliCommand({
4723
- memoryDir: orchestrator.config.memoryDir,
4724
- trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
4725
- trustZonesEnabled: orchestrator.config.trustZonesEnabled,
4726
- quarantinePromotionEnabled: orchestrator.config.quarantinePromotionEnabled,
4727
- memoryPoisoningDefenseEnabled: orchestrator.config.memoryPoisoningDefenseEnabled
4728
- });
4729
- console.log(JSON.stringify(status, null, 2));
4730
- console.log("OK");
4731
- });
4732
- cmd.command("trust-zone-demo-seed").description("Explicitly seed an opt-in trust-zone demo dataset for buyer-facing walkthroughs").option("--scenario <scenario>", "Demo scenario id (default: enterprise-buyer-v1)").option("--recorded-at <isoTimestamp>", "Base ISO timestamp used to anchor demo records").option("--dry-run", "Preview the demo dataset without writing any trust-zone records").action(async (...args) => {
4733
- const options = args[0] ?? {};
4734
- const result = await runTrustZoneDemoSeedCliCommand({
4735
- memoryDir: orchestrator.config.memoryDir,
4736
- trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
4737
- trustZonesEnabled: orchestrator.config.trustZonesEnabled,
4738
- scenario: typeof options.scenario === "string" ? options.scenario : void 0,
4739
- recordedAt: typeof options.recordedAt === "string" ? options.recordedAt : void 0,
4740
- dryRun: options.dryRun === true
4741
- });
4742
- console.log(JSON.stringify(result, null, 2));
4743
- console.log("OK");
4744
- });
4745
- cmd.command("abstraction-node-status").description("Show abstraction-node store status, abstraction counts, and latest stored node").action(async () => {
4746
- const status = await runAbstractionNodeStatusCliCommand({
4747
- memoryDir: orchestrator.config.memoryDir,
4748
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
4749
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
4750
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled
4751
- });
4752
- console.log(JSON.stringify(status, null, 2));
4753
- console.log("OK");
4754
- });
4755
- cmd.command("cue-anchor-status").description("Show cue-anchor index status, anchor counts, and the latest stored cue anchor").action(async () => {
4756
- const status = await runCueAnchorStatusCliCommand({
4757
- memoryDir: orchestrator.config.memoryDir,
4758
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
4759
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
4760
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled
4761
- });
4762
- console.log(JSON.stringify(status, null, 2));
4763
- console.log("OK");
4764
- });
4765
- cmd.command("harmonic-search").description("Preview harmonic retrieval blending over abstraction nodes and cue anchors").argument("<query>", "Prompt-like query to evaluate against harmonic retrieval storage").option("--max-results <count>", "Maximum number of blended results to return", "3").option("--session-key <sessionKey>", "Optional session key for same-session tie-breaking").action(async (...args) => {
4766
- const query = typeof args[0] === "string" ? args[0] : "";
4767
- const options = args[1] ?? {};
4768
- const maxResults = typeof options.maxResults === "string" ? Number.parseInt(options.maxResults, 10) : 3;
4769
- const results = await runHarmonicSearchCliCommand({
4770
- memoryDir: orchestrator.config.memoryDir,
4771
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
4772
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
4773
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
4774
- query,
4775
- maxResults: Number.isFinite(maxResults) ? maxResults : 3,
4776
- sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : void 0
4777
- });
4778
- console.log(JSON.stringify(results, null, 2));
4779
- console.log("OK");
4780
- });
4781
- cmd.command("utility-status").description("Show utility-learning telemetry status, event counts, and the latest utility event").action(async () => {
4782
- const status = await runUtilityTelemetryStatusCliCommand({
4783
- memoryDir: orchestrator.config.memoryDir,
4784
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
4785
- promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled
4786
- });
4787
- console.log(JSON.stringify(status, null, 2));
4788
- console.log("OK");
4789
- });
4790
- cmd.command("utility-record").description("Record a utility-learning telemetry event when utility learning is enabled").requiredOption("--event-id <eventId>", "Utility telemetry event id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the event").requiredOption("--session-key <sessionKey>", "Session key associated with the event").requiredOption("--source <source>", "Event source (cli|system|benchmark|tool_result)").requiredOption("--target <target>", "Telemetry target (promotion|ranking)").requiredOption("--decision <decision>", "Decision taken (promote|demote|hold|boost|suppress)").requiredOption("--outcome <outcome>", "Observed outcome (helpful|neutral|harmful)").requiredOption("--utility-score <utilityScore>", "Bounded utility score between -1 and 1").requiredOption("--summary <summary>", "Human-readable summary of the measured utility event").option("--memory-id <memoryId...>", "Memory ids linked to the utility event").option("--entity-ref <entityRef...>", "Entity refs linked to the utility event").option("--tag <tag...>", "Tags to attach to the utility event").action(async (...args) => {
4791
- const options = args[0] ?? {};
4792
- const utilityScore = typeof options.utilityScore === "string" ? Number.parseFloat(options.utilityScore) : Number.NaN;
4793
- const filePath = await runUtilityTelemetryRecordCliCommand({
4794
- memoryDir: orchestrator.config.memoryDir,
4795
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
4796
- event: {
4797
- schemaVersion: 1,
4798
- eventId: String(options.eventId ?? ""),
4799
- recordedAt: String(options.recordedAt ?? ""),
4800
- sessionKey: String(options.sessionKey ?? ""),
4801
- source: String(options.source ?? ""),
4802
- target: String(options.target ?? ""),
4803
- decision: String(options.decision ?? ""),
4804
- outcome: String(options.outcome ?? ""),
4805
- utilityScore,
4806
- summary: String(options.summary ?? ""),
4807
- memoryIds: Array.isArray(options.memoryId) ? options.memoryId.map(String) : void 0,
4808
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
4809
- tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0
4810
- }
4811
- });
4812
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
4813
- console.log("OK");
4814
- });
4815
- cmd.command("utility-learning-status").description("Show offline utility-learning snapshot status and learned weight counts").action(async () => {
4816
- const status = await runUtilityLearningStatusCliCommand({
4817
- memoryDir: orchestrator.config.memoryDir,
4818
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
4819
- promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled
4820
- });
4821
- console.log(JSON.stringify(status, null, 2));
4822
- console.log("OK");
4823
- });
4824
- cmd.command("utility-learn").description("Learn bounded offline promotion/ranking weights from recorded utility telemetry").option("--window-days <days>", "Telemetry lookback window in days", "14").option("--min-event-count <count>", "Minimum event count required per target/decision group", "3").option("--max-weight-magnitude <value>", "Maximum absolute learned weight magnitude", "0.35").action(async (...args) => {
4825
- const options = args[0] ?? {};
4826
- const learningWindowDays = typeof options.windowDays === "string" ? Number.parseInt(options.windowDays, 10) : 14;
4827
- const minEventCount = typeof options.minEventCount === "string" ? Number.parseInt(options.minEventCount, 10) : 3;
4828
- const maxWeightMagnitude = typeof options.maxWeightMagnitude === "string" ? Number.parseFloat(options.maxWeightMagnitude) : 0.35;
4829
- const result = await runUtilityLearningCliCommand({
4830
- memoryDir: orchestrator.config.memoryDir,
4831
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
4832
- learningWindowDays,
4833
- minEventCount,
4834
- maxWeightMagnitude
4835
- });
4836
- console.log(JSON.stringify(result, null, 2));
4837
- console.log("OK");
4838
- });
4839
- cmd.command("resume-bundle-status").description("Show resume bundle status, bundle counts, and the latest recorded handoff bundle").action(async () => {
4840
- const status = await runResumeBundleStatusCliCommand({
4841
- memoryDir: orchestrator.config.memoryDir,
4842
- resumeBundleDir: orchestrator.config.resumeBundleDir,
4843
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4844
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled
4845
- });
4846
- console.log(JSON.stringify(status, null, 2));
4847
- console.log("OK");
4848
- });
4849
- cmd.command("resume-bundle-record").description("Record an explicit resume bundle when creation-memory handoff bundles are enabled").requiredOption("--bundle-id <bundleId>", "Resume bundle id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle").requiredOption("--session-key <sessionKey>", "Session key that owns the bundle").requiredOption("--source <source>", "Bundle source (tool_result|cli|system|manual)").requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle").requiredOption("--summary <summary>", "Human-readable summary of what this bundle preserves").option("--key-fact <keyFact...>", "Short facts that a resumed agent should retain").option("--next-action <nextAction...>", "Explicit next actions for the resumed agent").option("--risk-flag <riskFlag...>", "Open risks or cautions attached to the bundle").option(
4850
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
4851
- "Objective-state snapshot refs attached to the bundle"
4852
- ).option(
4853
- "--work-product-entry-ref <workProductEntryRef...>",
4854
- "Work-product ledger refs attached to the bundle"
4855
- ).option(
4856
- "--commitment-entry-ref <commitmentEntryRef...>",
4857
- "Commitment ledger refs attached to the bundle"
4858
- ).action(async (...args) => {
4859
- const options = args[0] ?? {};
4860
- const filePath = await runResumeBundleRecordCliCommand({
4861
- memoryDir: orchestrator.config.memoryDir,
4862
- resumeBundleDir: orchestrator.config.resumeBundleDir,
4863
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4864
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
4865
- bundle: {
4866
- schemaVersion: 1,
4867
- bundleId: String(options.bundleId ?? ""),
4868
- recordedAt: String(options.recordedAt ?? ""),
4869
- sessionKey: String(options.sessionKey ?? ""),
4870
- source: String(options.source ?? ""),
4871
- scope: String(options.scope ?? ""),
4872
- summary: String(options.summary ?? ""),
4873
- keyFacts: Array.isArray(options.keyFact) ? options.keyFact.map(String) : void 0,
4874
- nextActions: Array.isArray(options.nextAction) ? options.nextAction.map(String) : void 0,
4875
- riskFlags: Array.isArray(options.riskFlag) ? options.riskFlag.map(String) : void 0,
4876
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0,
4877
- workProductEntryRefs: Array.isArray(options.workProductEntryRef) ? options.workProductEntryRef.map(String) : void 0,
4878
- commitmentEntryRefs: Array.isArray(options.commitmentEntryRef) ? options.commitmentEntryRef.map(String) : void 0
4879
- }
4880
- });
4881
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
4882
- console.log("OK");
4883
- });
4884
- cmd.command("resume-bundle-build").description("Build and persist a resume bundle from transcript recovery, objective state, work products, and open commitments").requiredOption("--bundle-id <bundleId>", "Resume bundle id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle").requiredOption("--session-key <sessionKey>", "Session key that owns the bundle").requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle").action(async (...args) => {
4885
- const options = args[0] ?? {};
4886
- const built = await runResumeBundleBuildCliCommand({
4887
- memoryDir: orchestrator.config.memoryDir,
4888
- resumeBundleDir: orchestrator.config.resumeBundleDir,
4889
- objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
4890
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
4891
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
4892
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4893
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
4894
- transcriptEnabled: orchestrator.config.transcriptEnabled,
4895
- objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
4896
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
4897
- bundleId: String(options.bundleId ?? ""),
4898
- recordedAt: String(options.recordedAt ?? ""),
4899
- sessionKey: String(options.sessionKey ?? ""),
4900
- scope: String(options.scope ?? "")
4901
- });
4902
- console.log(JSON.stringify({
4903
- wrote: built !== null,
4904
- filePath: built?.filePath ?? null,
4905
- bundle: built?.bundle ?? null
4906
- }, null, 2));
4907
- console.log("OK");
4908
- });
4909
- cmd.command("commitment-status").description("Show commitment ledger status, entry counts, and the latest recorded commitment").action(async () => {
4910
- const status = await runCommitmentStatusCliCommand({
4911
- memoryDir: orchestrator.config.memoryDir,
4912
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
4913
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4914
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
4915
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
4916
- commitmentStaleDays: orchestrator.config.commitmentStaleDays,
4917
- commitmentDecayDays: orchestrator.config.commitmentDecayDays
4918
- });
4919
- console.log(JSON.stringify(status, null, 2));
4920
- console.log("OK");
4921
- });
4922
- cmd.command("commitment-record").description("Record a commitment ledger entry when commitment memory is enabled").requiredOption("--entry-id <entryId>", "Commitment entry id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry").requiredOption("--session-key <sessionKey>", "Session key that owns the commitment").requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)").requiredOption("--kind <kind>", "Entry kind (promise|follow_up|deadline|deliverable)").requiredOption("--state <state>", "Entry state (open|fulfilled|cancelled|expired)").requiredOption("--scope <scope>", "Primary scope or identifier for the commitment").requiredOption("--summary <summary>", "Human-readable summary of the commitment").option("--due-at <dueAt>", "Optional due timestamp for the commitment").option("--tag <tag...>", "Tags to attach to the commitment entry").option("--entity-ref <entityRef...>", "Entity refs to attach to the commitment entry").option(
4923
- "--work-product-entry-ref <workProductEntryRef...>",
4924
- "Work-product ledger refs that this commitment depends on"
4925
- ).option(
4926
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
4927
- "Objective-state snapshot refs to link to this commitment"
4928
- ).action(async (...args) => {
4929
- const options = args[0] ?? {};
4930
- const filePath = await runCommitmentRecordCliCommand({
4931
- memoryDir: orchestrator.config.memoryDir,
4932
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
4933
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4934
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
4935
- entry: {
4936
- schemaVersion: 1,
4937
- entryId: String(options.entryId ?? ""),
4938
- recordedAt: String(options.recordedAt ?? ""),
4939
- sessionKey: String(options.sessionKey ?? ""),
4940
- source: String(options.source ?? ""),
4941
- kind: String(options.kind ?? ""),
4942
- state: String(options.state ?? ""),
4943
- scope: String(options.scope ?? ""),
4944
- summary: String(options.summary ?? ""),
4945
- dueAt: typeof options.dueAt === "string" ? options.dueAt : void 0,
4946
- tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0,
4947
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
4948
- workProductEntryRefs: Array.isArray(options.workProductEntryRef) ? options.workProductEntryRef.map(String) : void 0,
4949
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0
4950
- }
4951
- });
4952
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
4953
- console.log("OK");
4954
- });
4955
- cmd.command("commitment-set-state").description("Transition an existing commitment ledger entry when commitment lifecycle is enabled").requiredOption("--entry-id <entryId>", "Commitment entry id").requiredOption("--state <state>", "Next state (open|fulfilled|cancelled|expired)").requiredOption("--changed-at <changedAt>", "ISO timestamp for the lifecycle transition").action(async (...args) => {
4956
- const options = args[0] ?? {};
4957
- const entry = await runCommitmentSetStateCliCommand({
4958
- memoryDir: orchestrator.config.memoryDir,
4959
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
4960
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4961
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
4962
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
4963
- entryId: String(options.entryId ?? ""),
4964
- nextState: String(options.state ?? ""),
4965
- changedAt: String(options.changedAt ?? "")
4966
- });
4967
- console.log(JSON.stringify({ updated: entry !== null, entry }, null, 2));
4968
- console.log("OK");
4969
- });
4970
- cmd.command("commitment-lifecycle-run").description("Apply overdue-expiry and resolved-entry cleanup to the commitment ledger").option("--now <now>", "Override the lifecycle timestamp for testing or backfills").action(async (...args) => {
4971
- const options = args[0] ?? {};
4972
- const result = await runCommitmentLifecycleCliCommand({
4973
- memoryDir: orchestrator.config.memoryDir,
4974
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
4975
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
4976
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
4977
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
4978
- commitmentDecayDays: orchestrator.config.commitmentDecayDays,
4979
- now: typeof options.now === "string" ? options.now : void 0
4980
- });
4981
- console.log(JSON.stringify({ applied: result !== null, result }, null, 2));
4982
- console.log("OK");
4983
- });
4984
- cmd.command("work-product-status").description("Show work-product ledger status, entry counts, and the latest recorded work product").action(async () => {
4985
- const status = await runWorkProductStatusCliCommand({
4986
- memoryDir: orchestrator.config.memoryDir,
4987
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
4988
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled
4989
- });
4990
- console.log(JSON.stringify(status, null, 2));
4991
- console.log("OK");
4992
- });
4993
- cmd.command("work-product-record").description("Record a work-product ledger entry when creation-memory is enabled").requiredOption("--entry-id <entryId>", "Ledger entry id").requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry").requiredOption("--session-key <sessionKey>", "Session key that created the work product").requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)").requiredOption("--kind <kind>", "Entry kind (artifact|file|record|report|workspace)").requiredOption(
4994
- "--entry-action <entryAction>",
4995
- "Entry action (created|updated|deleted|referenced|published)"
4996
- ).requiredOption("--scope <scope>", "Primary scope or identifier for the created work product").requiredOption("--summary <summary>", "Human-readable summary of the work product").option("--artifact-path <artifactPath>", "Optional path to the created artifact").option("--tag <tag...>", "Tags to attach to the work-product entry").option("--entity-ref <entityRef...>", "Entity refs to attach to the work-product entry").option(
4997
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
4998
- "Objective-state snapshot refs to link to this work product"
4999
- ).action(async (...args) => {
5000
- const options = args[0] ?? {};
5001
- const filePath = await runWorkProductRecordCliCommand({
5002
- memoryDir: orchestrator.config.memoryDir,
5003
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
5004
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
5005
- entry: {
5006
- schemaVersion: 1,
5007
- entryId: String(options.entryId ?? ""),
5008
- recordedAt: String(options.recordedAt ?? ""),
5009
- sessionKey: String(options.sessionKey ?? ""),
5010
- source: String(options.source ?? ""),
5011
- kind: String(options.kind ?? ""),
5012
- action: String(options.entryAction ?? ""),
5013
- scope: String(options.scope ?? ""),
5014
- summary: String(options.summary ?? ""),
5015
- artifactPath: typeof options.artifactPath === "string" ? options.artifactPath : void 0,
5016
- tags: Array.isArray(options.tag) ? options.tag.map(String) : void 0,
5017
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : void 0,
5018
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef) ? options.objectiveStateSnapshotRef.map(String) : void 0
5019
- }
5020
- });
5021
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
5022
- console.log("OK");
5023
- });
5024
- cmd.command("work-product-recall-search").description("Preview work-product recovery candidates when creation-memory recall is enabled").argument("<query>", "Prompt-like query to evaluate against the work-product ledger").option("--max-results <count>", "Maximum number of work-product results to return", "3").option("--session-key <sessionKey>", "Optional session key to boost same-session work products").action(async (...args) => {
5025
- const query = typeof args[0] === "string" ? args[0] : "";
5026
- const options = args[1] ?? {};
5027
- const maxResults = typeof options.maxResults === "string" ? Number.parseInt(options.maxResults, 10) : 3;
5028
- const results = await runWorkProductRecallSearchCliCommand({
5029
- memoryDir: orchestrator.config.memoryDir,
5030
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
5031
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
5032
- workProductRecallEnabled: orchestrator.config.workProductRecallEnabled,
5033
- query,
5034
- maxResults: Number.isFinite(maxResults) ? maxResults : 3,
5035
- sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : void 0
5036
- });
5037
- console.log(JSON.stringify(results, null, 2));
5038
- console.log("OK");
5039
- });
5048
+ registerResearchStatusCommands(cmd, orchestrator);
5049
+ registerCreationLedgerCommands(cmd, orchestrator);
5040
5050
  cmd.command("trust-zone-promote").description("Dry-run or apply a trust-zone promotion with provenance enforcement").requiredOption("--record-id <recordId>", "Source trust-zone record id").requiredOption("--target-zone <targetZone>", "Promotion target zone (working|trusted)").requiredOption("--reason <reason>", "Human-readable promotion reason").option("--recorded-at <isoTimestamp>", "Promotion timestamp (defaults to now)").option("--summary <summary>", "Optional replacement summary for the promoted record").option("--dry-run", "Show the promotion plan without writing the promoted record").action(async (...args) => {
5041
5051
  const options = args[0] ?? {};
5042
5052
  const result = await runTrustZonePromoteCliCommand({
@@ -7146,7 +7156,7 @@ Legacy identity-anchor files are untouched. Verify the migration result`);
7146
7156
  }
7147
7157
  if (typeof options.trace === "string" && options.trace.length > 0) {
7148
7158
  const { replayTrace, parseSpeedFlag } = await import("./trace-ZFVRH4GO.js");
7149
- const { expandTildePath: expandTildePath2 } = await import("./path-X2K5XCHL.js");
7159
+ const { expandTildePath: expandTildePath2 } = await import("./utils/path.js");
7150
7160
  const tracePath = expandTildePath2(options.trace);
7151
7161
  let speed;
7152
7162
  try {
@@ -7177,7 +7187,7 @@ Legacy identity-anchor files are untouched. Verify the migration result`);
7177
7187
  let recorder = null;
7178
7188
  if (typeof options.recordTrace === "string" && options.recordTrace.length > 0) {
7179
7189
  const { openTraceRecorder } = await import("./trace-ZFVRH4GO.js");
7180
- const { expandTildePath: expandTildePath2 } = await import("./path-X2K5XCHL.js");
7190
+ const { expandTildePath: expandTildePath2 } = await import("./utils/path.js");
7181
7191
  recorder = await openTraceRecorder(
7182
7192
  expandTildePath2(options.recordTrace)
7183
7193
  );
@@ -7328,4 +7338,4 @@ export {
7328
7338
  listMemoryMarkdownFilePaths,
7329
7339
  registerCli
7330
7340
  };
7331
- //# sourceMappingURL=chunk-ZCEI242W.js.map
7341
+ //# sourceMappingURL=chunk-3EHCV6YV.js.map