@remnic/core 9.3.703 → 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 (270) 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/search/embed-helper.d.ts +3 -3
  185. package/dist/search/factory.d.ts +3 -3
  186. package/dist/search/factory.js +3 -3
  187. package/dist/search/index.d.ts +3 -3
  188. package/dist/search/index.js +7 -7
  189. package/dist/search/lancedb-backend.d.ts +3 -3
  190. package/dist/search/meilisearch-backend.d.ts +3 -3
  191. package/dist/search/noop-backend.d.ts +3 -3
  192. package/dist/search/orama-backend.d.ts +3 -3
  193. package/dist/search/port.d.ts +3 -3
  194. package/dist/search/remote-backend.d.ts +3 -3
  195. package/dist/{semantic-consolidation-DgFXyALl.d.ts → semantic-consolidation-DVBbq6Wr.d.ts} +1 -1
  196. package/dist/semantic-consolidation.d.ts +4 -4
  197. package/dist/semantic-consolidation.js +4 -4
  198. package/dist/semantic-rule-promotion.js +3 -3
  199. package/dist/semantic-rule-verifier.d.ts +3 -3
  200. package/dist/semantic-rule-verifier.js +3 -3
  201. package/dist/session-observer-bands.d.ts +3 -3
  202. package/dist/session-observer-state.d.ts +3 -3
  203. package/dist/shared-context/manager.d.ts +3 -3
  204. package/dist/signal.d.ts +3 -3
  205. package/dist/storage.d.ts +3 -3
  206. package/dist/storage.js +2 -2
  207. package/dist/summarizer.d.ts +3 -3
  208. package/dist/summary-snapshot.d.ts +3 -3
  209. package/dist/temporal-supersession.d.ts +3 -3
  210. package/dist/temporal-validity.d.ts +3 -3
  211. package/dist/threading.d.ts +3 -3
  212. package/dist/tier-migration.d.ts +3 -3
  213. package/dist/tier-routing.d.ts +3 -3
  214. package/dist/topics.d.ts +3 -3
  215. package/dist/transcript.d.ts +3 -3
  216. package/dist/transfer/backup.js +2 -2
  217. package/dist/transfer/capsule-export.js +2 -2
  218. package/dist/transfer/capsule-import.js +2 -2
  219. package/dist/{types-MWKPZnM0.d.ts → types-CJrvHJjx.d.ts} +2 -2
  220. package/dist/{types-ByK7T3L6.d.ts → types-gb_SNtjR.d.ts} +1 -1
  221. package/dist/types.d.ts +3 -3
  222. package/dist/utility-runtime.d.ts +3 -3
  223. package/dist/utils/path.d.ts +17 -0
  224. package/dist/utils/path.js +9 -0
  225. package/dist/utils/path.js.map +1 -0
  226. package/dist/verified-recall.js +3 -3
  227. package/package.json +27 -2
  228. package/src/cli/creation-ledger-commands.ts +346 -0
  229. package/src/cli/research-status-commands.ts +256 -0
  230. package/src/cli.ts +7 -516
  231. package/dist/chunk-ZCEI242W.js.map +0 -1
  232. package/dist/path-X2K5XCHL.js +0 -9
  233. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  234. /package/dist/{chunk-5VXVXJH6.js.map → chunk-25FHSOEB.js.map} +0 -0
  235. /package/dist/{chunk-QQW2LIEA.js.map → chunk-53EEQYE5.js.map} +0 -0
  236. /package/dist/{chunk-VDX2J7OX.js.map → chunk-5W7CTZ2E.js.map} +0 -0
  237. /package/dist/{chunk-VPAFWWCL.js.map → chunk-6AFVIOVZ.js.map} +0 -0
  238. /package/dist/{chunk-6TAETM63.js.map → chunk-6GHWF4QH.js.map} +0 -0
  239. /package/dist/{chunk-EZR35XHX.js.map → chunk-6Q7JFY4P.js.map} +0 -0
  240. /package/dist/{chunk-64XXOQRW.js.map → chunk-7G4KPGR3.js.map} +0 -0
  241. /package/dist/{chunk-TGAHHCB6.js.map → chunk-AE3C4PY6.js.map} +0 -0
  242. /package/dist/{chunk-CI7RKSRE.js.map → chunk-AQEJKOKI.js.map} +0 -0
  243. /package/dist/{chunk-CZJ6QSKG.js.map → chunk-CTY6QSLZ.js.map} +0 -0
  244. /package/dist/{chunk-FVI5B7DE.js.map → chunk-DE2OPIQD.js.map} +0 -0
  245. /package/dist/{chunk-MDJURR27.js.map → chunk-HW5EF6LV.js.map} +0 -0
  246. /package/dist/{chunk-BMFZLLNI.js.map → chunk-ICP53SKG.js.map} +0 -0
  247. /package/dist/{chunk-MBUM2Y3L.js.map → chunk-K7QRDDSR.js.map} +0 -0
  248. /package/dist/{chunk-GFIARMA7.js.map → chunk-NMW3T6T6.js.map} +0 -0
  249. /package/dist/{chunk-6VVP6NK7.js.map → chunk-OCFNG4LB.js.map} +0 -0
  250. /package/dist/{chunk-KC6TCAWV.js.map → chunk-OOEVMJK4.js.map} +0 -0
  251. /package/dist/{chunk-MXEWQKM7.js.map → chunk-ORXVO6TH.js.map} +0 -0
  252. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-OWHERGF2.js.map} +0 -0
  253. /package/dist/{chunk-EOOVJK2U.js.map → chunk-PJ5MDXOF.js.map} +0 -0
  254. /package/dist/{chunk-X5J3JZR3.js.map → chunk-PKMQK2WY.js.map} +0 -0
  255. /package/dist/{chunk-Q4O3ET6F.js.map → chunk-QDIVMS25.js.map} +0 -0
  256. /package/dist/{chunk-EYJD6KIO.js.map → chunk-QHNJVWF6.js.map} +0 -0
  257. /package/dist/{chunk-JMA4RYRN.js.map → chunk-QV5WFNZ2.js.map} +0 -0
  258. /package/dist/{chunk-XGMCUY5P.js.map → chunk-R64MNFPV.js.map} +0 -0
  259. /package/dist/{chunk-QGJAGC2J.js.map → chunk-RYDT7LAI.js.map} +0 -0
  260. /package/dist/{chunk-JTKFZMZ7.js.map → chunk-S24J5LLQ.js.map} +0 -0
  261. /package/dist/{chunk-AMNLZ6SF.js.map → chunk-TUPNAHHQ.js.map} +0 -0
  262. /package/dist/{chunk-DL6H3D7S.js.map → chunk-UNNDFYUX.js.map} +0 -0
  263. /package/dist/{chunk-QIMFOCSH.js.map → chunk-UOIRJ45Z.js.map} +0 -0
  264. /package/dist/{chunk-DQEMWVMT.js.map → chunk-UVYI6VIX.js.map} +0 -0
  265. /package/dist/{chunk-IX72AAMZ.js.map → chunk-WAHI7SPK.js.map} +0 -0
  266. /package/dist/{chunk-7WWURLG6.js.map → chunk-XPOOY35N.js.map} +0 -0
  267. /package/dist/{chunk-NUIJEGVD.js.map → chunk-XXDOJ5NL.js.map} +0 -0
  268. /package/dist/{chunk-Z7XEIAV4.js.map → chunk-YLB7NMLD.js.map} +0 -0
  269. /package/dist/{chunk-OXEAMU42.js.map → chunk-ZXFNSKPY.js.map} +0 -0
  270. /package/dist/{path-X2K5XCHL.js.map → message-parts/index.js.map} +0 -0
package/src/cli.ts CHANGED
@@ -7,6 +7,8 @@ import type { Orchestrator } from "./orchestrator.js";
7
7
  import { ThreadingManager } from "./threading.js";
8
8
  import { utcDayRange } from "./transcript.js";
9
9
  import { runWearablesCliCommand } from "./wearables/cli.js";
10
+ import { registerResearchStatusCommands } from "./cli/research-status-commands.js";
11
+ import { registerCreationLedgerCommands } from "./cli/creation-ledger-commands.js";
10
12
  import type {
11
13
  BehaviorSignalEvent,
12
14
  ContinuityIncidentRecord,
@@ -265,7 +267,7 @@ import {
265
267
  type LiveConnector,
266
268
  } from "./connectors/live/index.js";
267
269
 
268
- interface CliApi {
270
+ export interface CliApi {
269
271
  registerCli(
270
272
  handler: (opts: { program: CliProgram }) => void,
271
273
  options: { commands: string[] },
@@ -281,11 +283,11 @@ type RegisterCliOptions = {
281
283
  | undefined;
282
284
  };
283
285
 
284
- interface CliProgram {
286
+ export interface CliProgram {
285
287
  command(name: string): CliCommand;
286
288
  }
287
289
 
288
- interface CliCommand {
290
+ export interface CliCommand {
289
291
  description(desc: string): CliCommand;
290
292
  option(
291
293
  flags: string,
@@ -6203,520 +6205,9 @@ export function registerCli(
6203
6205
  console.log("OK");
6204
6206
  });
6205
6207
 
6206
- cmd
6207
- .command("objective-state-status")
6208
- .description("Show objective-state store status, snapshot counts, and latest stored snapshot")
6209
- .action(async () => {
6210
- const status = await runObjectiveStateStatusCliCommand({
6211
- memoryDir: orchestrator.config.memoryDir,
6212
- objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
6213
- objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
6214
- objectiveStateSnapshotWritesEnabled: orchestrator.config.objectiveStateSnapshotWritesEnabled,
6215
- });
6216
- console.log(JSON.stringify(status, null, 2));
6217
- console.log("OK");
6218
- });
6219
-
6220
- cmd
6221
- .command("causal-trajectory-status")
6222
- .description("Show causal-trajectory store status, record counts, and latest stored chain")
6223
- .action(async () => {
6224
- const status = await runCausalTrajectoryStatusCliCommand({
6225
- memoryDir: orchestrator.config.memoryDir,
6226
- causalTrajectoryStoreDir: orchestrator.config.causalTrajectoryStoreDir,
6227
- causalTrajectoryMemoryEnabled: orchestrator.config.causalTrajectoryMemoryEnabled,
6228
- });
6229
- console.log(JSON.stringify(status, null, 2));
6230
- console.log("OK");
6231
- });
6232
-
6233
- cmd
6234
- .command("trust-zone-status")
6235
- .description("Show trust-zone store status, zoned record counts, and latest stored record")
6236
- .action(async () => {
6237
- const status = await runTrustZoneStatusCliCommand({
6238
- memoryDir: orchestrator.config.memoryDir,
6239
- trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
6240
- trustZonesEnabled: orchestrator.config.trustZonesEnabled,
6241
- quarantinePromotionEnabled: orchestrator.config.quarantinePromotionEnabled,
6242
- memoryPoisoningDefenseEnabled: orchestrator.config.memoryPoisoningDefenseEnabled,
6243
- });
6244
- console.log(JSON.stringify(status, null, 2));
6245
- console.log("OK");
6246
- });
6247
-
6248
- cmd
6249
- .command("trust-zone-demo-seed")
6250
- .description("Explicitly seed an opt-in trust-zone demo dataset for buyer-facing walkthroughs")
6251
- .option("--scenario <scenario>", "Demo scenario id (default: enterprise-buyer-v1)")
6252
- .option("--recorded-at <isoTimestamp>", "Base ISO timestamp used to anchor demo records")
6253
- .option("--dry-run", "Preview the demo dataset without writing any trust-zone records")
6254
- .action(async (...args: unknown[]) => {
6255
- const options = (args[0] ?? {}) as Record<string, unknown>;
6256
- const result = await runTrustZoneDemoSeedCliCommand({
6257
- memoryDir: orchestrator.config.memoryDir,
6258
- trustZoneStoreDir: orchestrator.config.trustZoneStoreDir,
6259
- trustZonesEnabled: orchestrator.config.trustZonesEnabled,
6260
- scenario: typeof options.scenario === "string" ? options.scenario : undefined,
6261
- recordedAt: typeof options.recordedAt === "string" ? options.recordedAt : undefined,
6262
- dryRun: options.dryRun === true,
6263
- });
6264
- console.log(JSON.stringify(result, null, 2));
6265
- console.log("OK");
6266
- });
6267
-
6268
- cmd
6269
- .command("abstraction-node-status")
6270
- .description("Show abstraction-node store status, abstraction counts, and latest stored node")
6271
- .action(async () => {
6272
- const status = await runAbstractionNodeStatusCliCommand({
6273
- memoryDir: orchestrator.config.memoryDir,
6274
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
6275
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
6276
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
6277
- });
6278
- console.log(JSON.stringify(status, null, 2));
6279
- console.log("OK");
6280
- });
6281
-
6282
- cmd
6283
- .command("cue-anchor-status")
6284
- .description("Show cue-anchor index status, anchor counts, and the latest stored cue anchor")
6285
- .action(async () => {
6286
- const status = await runCueAnchorStatusCliCommand({
6287
- memoryDir: orchestrator.config.memoryDir,
6288
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
6289
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
6290
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
6291
- });
6292
- console.log(JSON.stringify(status, null, 2));
6293
- console.log("OK");
6294
- });
6295
-
6296
- cmd
6297
- .command("harmonic-search")
6298
- .description("Preview harmonic retrieval blending over abstraction nodes and cue anchors")
6299
- .argument("<query>", "Prompt-like query to evaluate against harmonic retrieval storage")
6300
- .option("--max-results <count>", "Maximum number of blended results to return", "3")
6301
- .option("--session-key <sessionKey>", "Optional session key for same-session tie-breaking")
6302
- .action(async (...args: unknown[]) => {
6303
- const query = typeof args[0] === "string" ? args[0] : "";
6304
- const options = (args[1] ?? {}) as Record<string, unknown>;
6305
- const maxResults = typeof options.maxResults === "string"
6306
- ? Number.parseInt(options.maxResults, 10)
6307
- : 3;
6308
- const results = await runHarmonicSearchCliCommand({
6309
- memoryDir: orchestrator.config.memoryDir,
6310
- abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
6311
- harmonicRetrievalEnabled: orchestrator.config.harmonicRetrievalEnabled,
6312
- abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
6313
- query,
6314
- maxResults: Number.isFinite(maxResults) ? maxResults : 3,
6315
- sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : undefined,
6316
- });
6317
- console.log(JSON.stringify(results, null, 2));
6318
- console.log("OK");
6319
- });
6320
-
6321
- cmd
6322
- .command("utility-status")
6323
- .description("Show utility-learning telemetry status, event counts, and the latest utility event")
6324
- .action(async () => {
6325
- const status = await runUtilityTelemetryStatusCliCommand({
6326
- memoryDir: orchestrator.config.memoryDir,
6327
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
6328
- promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled,
6329
- });
6330
- console.log(JSON.stringify(status, null, 2));
6331
- console.log("OK");
6332
- });
6333
-
6334
- cmd
6335
- .command("utility-record")
6336
- .description("Record a utility-learning telemetry event when utility learning is enabled")
6337
- .requiredOption("--event-id <eventId>", "Utility telemetry event id")
6338
- .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the event")
6339
- .requiredOption("--session-key <sessionKey>", "Session key associated with the event")
6340
- .requiredOption("--source <source>", "Event source (cli|system|benchmark|tool_result)")
6341
- .requiredOption("--target <target>", "Telemetry target (promotion|ranking)")
6342
- .requiredOption("--decision <decision>", "Decision taken (promote|demote|hold|boost|suppress)")
6343
- .requiredOption("--outcome <outcome>", "Observed outcome (helpful|neutral|harmful)")
6344
- .requiredOption("--utility-score <utilityScore>", "Bounded utility score between -1 and 1")
6345
- .requiredOption("--summary <summary>", "Human-readable summary of the measured utility event")
6346
- .option("--memory-id <memoryId...>", "Memory ids linked to the utility event")
6347
- .option("--entity-ref <entityRef...>", "Entity refs linked to the utility event")
6348
- .option("--tag <tag...>", "Tags to attach to the utility event")
6349
- .action(async (...args: unknown[]) => {
6350
- const options = (args[0] ?? {}) as Record<string, unknown>;
6351
- const utilityScore = typeof options.utilityScore === "string"
6352
- ? Number.parseFloat(options.utilityScore)
6353
- : Number.NaN;
6354
- const filePath = await runUtilityTelemetryRecordCliCommand({
6355
- memoryDir: orchestrator.config.memoryDir,
6356
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
6357
- event: {
6358
- schemaVersion: 1,
6359
- eventId: String(options.eventId ?? ""),
6360
- recordedAt: String(options.recordedAt ?? ""),
6361
- sessionKey: String(options.sessionKey ?? ""),
6362
- source: String(options.source ?? "") as UtilityTelemetryEvent["source"],
6363
- target: String(options.target ?? "") as UtilityTelemetryEvent["target"],
6364
- decision: String(options.decision ?? "") as UtilityTelemetryEvent["decision"],
6365
- outcome: String(options.outcome ?? "") as UtilityTelemetryEvent["outcome"],
6366
- utilityScore,
6367
- summary: String(options.summary ?? ""),
6368
- memoryIds: Array.isArray(options.memoryId) ? options.memoryId.map(String) : undefined,
6369
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : undefined,
6370
- tags: Array.isArray(options.tag) ? options.tag.map(String) : undefined,
6371
- },
6372
- });
6373
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
6374
- console.log("OK");
6375
- });
6376
-
6377
- cmd
6378
- .command("utility-learning-status")
6379
- .description("Show offline utility-learning snapshot status and learned weight counts")
6380
- .action(async () => {
6381
- const status = await runUtilityLearningStatusCliCommand({
6382
- memoryDir: orchestrator.config.memoryDir,
6383
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
6384
- promotionByOutcomeEnabled: orchestrator.config.promotionByOutcomeEnabled,
6385
- });
6386
- console.log(JSON.stringify(status, null, 2));
6387
- console.log("OK");
6388
- });
6389
-
6390
- cmd
6391
- .command("utility-learn")
6392
- .description("Learn bounded offline promotion/ranking weights from recorded utility telemetry")
6393
- .option("--window-days <days>", "Telemetry lookback window in days", "14")
6394
- .option("--min-event-count <count>", "Minimum event count required per target/decision group", "3")
6395
- .option("--max-weight-magnitude <value>", "Maximum absolute learned weight magnitude", "0.35")
6396
- .action(async (...args: unknown[]) => {
6397
- const options = (args[0] ?? {}) as Record<string, unknown>;
6398
- const learningWindowDays = typeof options.windowDays === "string"
6399
- ? Number.parseInt(options.windowDays, 10)
6400
- : 14;
6401
- const minEventCount = typeof options.minEventCount === "string"
6402
- ? Number.parseInt(options.minEventCount, 10)
6403
- : 3;
6404
- const maxWeightMagnitude = typeof options.maxWeightMagnitude === "string"
6405
- ? Number.parseFloat(options.maxWeightMagnitude)
6406
- : 0.35;
6407
- const result = await runUtilityLearningCliCommand({
6408
- memoryDir: orchestrator.config.memoryDir,
6409
- memoryUtilityLearningEnabled: orchestrator.config.memoryUtilityLearningEnabled,
6410
- learningWindowDays,
6411
- minEventCount,
6412
- maxWeightMagnitude,
6413
- });
6414
- console.log(JSON.stringify(result, null, 2));
6415
- console.log("OK");
6416
- });
6417
-
6418
- cmd
6419
- .command("resume-bundle-status")
6420
- .description("Show resume bundle status, bundle counts, and the latest recorded handoff bundle")
6421
- .action(async () => {
6422
- const status = await runResumeBundleStatusCliCommand({
6423
- memoryDir: orchestrator.config.memoryDir,
6424
- resumeBundleDir: orchestrator.config.resumeBundleDir,
6425
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6426
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
6427
- });
6428
- console.log(JSON.stringify(status, null, 2));
6429
- console.log("OK");
6430
- });
6431
-
6432
- cmd
6433
- .command("resume-bundle-record")
6434
- .description("Record an explicit resume bundle when creation-memory handoff bundles are enabled")
6435
- .requiredOption("--bundle-id <bundleId>", "Resume bundle id")
6436
- .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle")
6437
- .requiredOption("--session-key <sessionKey>", "Session key that owns the bundle")
6438
- .requiredOption("--source <source>", "Bundle source (tool_result|cli|system|manual)")
6439
- .requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle")
6440
- .requiredOption("--summary <summary>", "Human-readable summary of what this bundle preserves")
6441
- .option("--key-fact <keyFact...>", "Short facts that a resumed agent should retain")
6442
- .option("--next-action <nextAction...>", "Explicit next actions for the resumed agent")
6443
- .option("--risk-flag <riskFlag...>", "Open risks or cautions attached to the bundle")
6444
- .option(
6445
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
6446
- "Objective-state snapshot refs attached to the bundle",
6447
- )
6448
- .option(
6449
- "--work-product-entry-ref <workProductEntryRef...>",
6450
- "Work-product ledger refs attached to the bundle",
6451
- )
6452
- .option(
6453
- "--commitment-entry-ref <commitmentEntryRef...>",
6454
- "Commitment ledger refs attached to the bundle",
6455
- )
6456
- .action(async (...args: unknown[]) => {
6457
- const options = (args[0] ?? {}) as Record<string, unknown>;
6458
- const filePath = await runResumeBundleRecordCliCommand({
6459
- memoryDir: orchestrator.config.memoryDir,
6460
- resumeBundleDir: orchestrator.config.resumeBundleDir,
6461
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6462
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
6463
- bundle: {
6464
- schemaVersion: 1,
6465
- bundleId: String(options.bundleId ?? ""),
6466
- recordedAt: String(options.recordedAt ?? ""),
6467
- sessionKey: String(options.sessionKey ?? ""),
6468
- source: String(options.source ?? "") as ResumeBundle["source"],
6469
- scope: String(options.scope ?? ""),
6470
- summary: String(options.summary ?? ""),
6471
- keyFacts: Array.isArray(options.keyFact) ? options.keyFact.map(String) : undefined,
6472
- nextActions: Array.isArray(options.nextAction) ? options.nextAction.map(String) : undefined,
6473
- riskFlags: Array.isArray(options.riskFlag) ? options.riskFlag.map(String) : undefined,
6474
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
6475
- ? options.objectiveStateSnapshotRef.map(String)
6476
- : undefined,
6477
- workProductEntryRefs: Array.isArray(options.workProductEntryRef)
6478
- ? options.workProductEntryRef.map(String)
6479
- : undefined,
6480
- commitmentEntryRefs: Array.isArray(options.commitmentEntryRef)
6481
- ? options.commitmentEntryRef.map(String)
6482
- : undefined,
6483
- },
6484
- });
6485
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
6486
- console.log("OK");
6487
- });
6488
-
6489
- cmd
6490
- .command("resume-bundle-build")
6491
- .description("Build and persist a resume bundle from transcript recovery, objective state, work products, and open commitments")
6492
- .requiredOption("--bundle-id <bundleId>", "Resume bundle id")
6493
- .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the bundle")
6494
- .requiredOption("--session-key <sessionKey>", "Session key that owns the bundle")
6495
- .requiredOption("--scope <scope>", "Primary scope or recovery domain for the bundle")
6496
- .action(async (...args: unknown[]) => {
6497
- const options = (args[0] ?? {}) as Record<string, unknown>;
6498
- const built = await runResumeBundleBuildCliCommand({
6499
- memoryDir: orchestrator.config.memoryDir,
6500
- resumeBundleDir: orchestrator.config.resumeBundleDir,
6501
- objectiveStateStoreDir: orchestrator.config.objectiveStateStoreDir,
6502
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
6503
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
6504
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6505
- resumeBundlesEnabled: orchestrator.config.resumeBundlesEnabled,
6506
- transcriptEnabled: orchestrator.config.transcriptEnabled,
6507
- objectiveStateMemoryEnabled: orchestrator.config.objectiveStateMemoryEnabled,
6508
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
6509
- bundleId: String(options.bundleId ?? ""),
6510
- recordedAt: String(options.recordedAt ?? ""),
6511
- sessionKey: String(options.sessionKey ?? ""),
6512
- scope: String(options.scope ?? ""),
6513
- });
6514
- console.log(JSON.stringify({
6515
- wrote: built !== null,
6516
- filePath: built?.filePath ?? null,
6517
- bundle: built?.bundle ?? null,
6518
- }, null, 2));
6519
- console.log("OK");
6520
- });
6521
-
6522
- cmd
6523
- .command("commitment-status")
6524
- .description("Show commitment ledger status, entry counts, and the latest recorded commitment")
6525
- .action(async () => {
6526
- const status = await runCommitmentStatusCliCommand({
6527
- memoryDir: orchestrator.config.memoryDir,
6528
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
6529
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6530
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
6531
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
6532
- commitmentStaleDays: orchestrator.config.commitmentStaleDays,
6533
- commitmentDecayDays: orchestrator.config.commitmentDecayDays,
6534
- });
6535
- console.log(JSON.stringify(status, null, 2));
6536
- console.log("OK");
6537
- });
6208
+ registerResearchStatusCommands(cmd, orchestrator);
6538
6209
 
6539
- cmd
6540
- .command("commitment-record")
6541
- .description("Record a commitment ledger entry when commitment memory is enabled")
6542
- .requiredOption("--entry-id <entryId>", "Commitment entry id")
6543
- .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry")
6544
- .requiredOption("--session-key <sessionKey>", "Session key that owns the commitment")
6545
- .requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)")
6546
- .requiredOption("--kind <kind>", "Entry kind (promise|follow_up|deadline|deliverable)")
6547
- .requiredOption("--state <state>", "Entry state (open|fulfilled|cancelled|expired)")
6548
- .requiredOption("--scope <scope>", "Primary scope or identifier for the commitment")
6549
- .requiredOption("--summary <summary>", "Human-readable summary of the commitment")
6550
- .option("--due-at <dueAt>", "Optional due timestamp for the commitment")
6551
- .option("--tag <tag...>", "Tags to attach to the commitment entry")
6552
- .option("--entity-ref <entityRef...>", "Entity refs to attach to the commitment entry")
6553
- .option(
6554
- "--work-product-entry-ref <workProductEntryRef...>",
6555
- "Work-product ledger refs that this commitment depends on",
6556
- )
6557
- .option(
6558
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
6559
- "Objective-state snapshot refs to link to this commitment",
6560
- )
6561
- .action(async (...args: unknown[]) => {
6562
- const options = (args[0] ?? {}) as Record<string, unknown>;
6563
- const filePath = await runCommitmentRecordCliCommand({
6564
- memoryDir: orchestrator.config.memoryDir,
6565
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
6566
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6567
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
6568
- entry: {
6569
- schemaVersion: 1,
6570
- entryId: String(options.entryId ?? ""),
6571
- recordedAt: String(options.recordedAt ?? ""),
6572
- sessionKey: String(options.sessionKey ?? ""),
6573
- source: String(options.source ?? "") as CommitmentLedgerEntry["source"],
6574
- kind: String(options.kind ?? "") as CommitmentLedgerEntry["kind"],
6575
- state: String(options.state ?? "") as CommitmentLedgerEntry["state"],
6576
- scope: String(options.scope ?? ""),
6577
- summary: String(options.summary ?? ""),
6578
- dueAt: typeof options.dueAt === "string" ? options.dueAt : undefined,
6579
- tags: Array.isArray(options.tag) ? options.tag.map(String) : undefined,
6580
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : undefined,
6581
- workProductEntryRefs: Array.isArray(options.workProductEntryRef)
6582
- ? options.workProductEntryRef.map(String)
6583
- : undefined,
6584
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
6585
- ? options.objectiveStateSnapshotRef.map(String)
6586
- : undefined,
6587
- },
6588
- });
6589
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
6590
- console.log("OK");
6591
- });
6592
-
6593
- cmd
6594
- .command("commitment-set-state")
6595
- .description("Transition an existing commitment ledger entry when commitment lifecycle is enabled")
6596
- .requiredOption("--entry-id <entryId>", "Commitment entry id")
6597
- .requiredOption("--state <state>", "Next state (open|fulfilled|cancelled|expired)")
6598
- .requiredOption("--changed-at <changedAt>", "ISO timestamp for the lifecycle transition")
6599
- .action(async (...args: unknown[]) => {
6600
- const options = (args[0] ?? {}) as Record<string, unknown>;
6601
- const entry = await runCommitmentSetStateCliCommand({
6602
- memoryDir: orchestrator.config.memoryDir,
6603
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
6604
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6605
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
6606
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
6607
- entryId: String(options.entryId ?? ""),
6608
- nextState: String(options.state ?? "") as CommitmentLedgerEntry["state"],
6609
- changedAt: String(options.changedAt ?? ""),
6610
- });
6611
- console.log(JSON.stringify({ updated: entry !== null, entry }, null, 2));
6612
- console.log("OK");
6613
- });
6614
-
6615
- cmd
6616
- .command("commitment-lifecycle-run")
6617
- .description("Apply overdue-expiry and resolved-entry cleanup to the commitment ledger")
6618
- .option("--now <now>", "Override the lifecycle timestamp for testing or backfills")
6619
- .action(async (...args: unknown[]) => {
6620
- const options = (args[0] ?? {}) as Record<string, unknown>;
6621
- const result = await runCommitmentLifecycleCliCommand({
6622
- memoryDir: orchestrator.config.memoryDir,
6623
- commitmentLedgerDir: orchestrator.config.commitmentLedgerDir,
6624
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6625
- commitmentLedgerEnabled: orchestrator.config.commitmentLedgerEnabled,
6626
- commitmentLifecycleEnabled: orchestrator.config.commitmentLifecycleEnabled,
6627
- commitmentDecayDays: orchestrator.config.commitmentDecayDays,
6628
- now: typeof options.now === "string" ? options.now : undefined,
6629
- });
6630
- console.log(JSON.stringify({ applied: result !== null, result }, null, 2));
6631
- console.log("OK");
6632
- });
6633
-
6634
- cmd
6635
- .command("work-product-status")
6636
- .description("Show work-product ledger status, entry counts, and the latest recorded work product")
6637
- .action(async () => {
6638
- const status = await runWorkProductStatusCliCommand({
6639
- memoryDir: orchestrator.config.memoryDir,
6640
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
6641
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6642
- });
6643
- console.log(JSON.stringify(status, null, 2));
6644
- console.log("OK");
6645
- });
6646
-
6647
- cmd
6648
- .command("work-product-record")
6649
- .description("Record a work-product ledger entry when creation-memory is enabled")
6650
- .requiredOption("--entry-id <entryId>", "Ledger entry id")
6651
- .requiredOption("--recorded-at <recordedAt>", "ISO timestamp for the entry")
6652
- .requiredOption("--session-key <sessionKey>", "Session key that created the work product")
6653
- .requiredOption("--source <source>", "Entry source (tool_result|cli|system|manual)")
6654
- .requiredOption("--kind <kind>", "Entry kind (artifact|file|record|report|workspace)")
6655
- .requiredOption(
6656
- "--entry-action <entryAction>",
6657
- "Entry action (created|updated|deleted|referenced|published)",
6658
- )
6659
- .requiredOption("--scope <scope>", "Primary scope or identifier for the created work product")
6660
- .requiredOption("--summary <summary>", "Human-readable summary of the work product")
6661
- .option("--artifact-path <artifactPath>", "Optional path to the created artifact")
6662
- .option("--tag <tag...>", "Tags to attach to the work-product entry")
6663
- .option("--entity-ref <entityRef...>", "Entity refs to attach to the work-product entry")
6664
- .option(
6665
- "--objective-state-snapshot-ref <objectiveStateSnapshotRef...>",
6666
- "Objective-state snapshot refs to link to this work product",
6667
- )
6668
- .action(async (...args: unknown[]) => {
6669
- const options = (args[0] ?? {}) as Record<string, unknown>;
6670
- const filePath = await runWorkProductRecordCliCommand({
6671
- memoryDir: orchestrator.config.memoryDir,
6672
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
6673
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6674
- entry: {
6675
- schemaVersion: 1,
6676
- entryId: String(options.entryId ?? ""),
6677
- recordedAt: String(options.recordedAt ?? ""),
6678
- sessionKey: String(options.sessionKey ?? ""),
6679
- source: String(options.source ?? "") as WorkProductLedgerEntry["source"],
6680
- kind: String(options.kind ?? "") as WorkProductLedgerEntry["kind"],
6681
- action: String(options.entryAction ?? "") as WorkProductLedgerEntry["action"],
6682
- scope: String(options.scope ?? ""),
6683
- summary: String(options.summary ?? ""),
6684
- artifactPath: typeof options.artifactPath === "string" ? options.artifactPath : undefined,
6685
- tags: Array.isArray(options.tag) ? options.tag.map(String) : undefined,
6686
- entityRefs: Array.isArray(options.entityRef) ? options.entityRef.map(String) : undefined,
6687
- objectiveStateSnapshotRefs: Array.isArray(options.objectiveStateSnapshotRef)
6688
- ? options.objectiveStateSnapshotRef.map(String)
6689
- : undefined,
6690
- },
6691
- });
6692
- console.log(JSON.stringify({ wrote: filePath !== null, filePath }, null, 2));
6693
- console.log("OK");
6694
- });
6695
-
6696
- cmd
6697
- .command("work-product-recall-search")
6698
- .description("Preview work-product recovery candidates when creation-memory recall is enabled")
6699
- .argument("<query>", "Prompt-like query to evaluate against the work-product ledger")
6700
- .option("--max-results <count>", "Maximum number of work-product results to return", "3")
6701
- .option("--session-key <sessionKey>", "Optional session key to boost same-session work products")
6702
- .action(async (...args: unknown[]) => {
6703
- const query = typeof args[0] === "string" ? args[0] : "";
6704
- const options = (args[1] ?? {}) as Record<string, unknown>;
6705
- const maxResults = typeof options.maxResults === "string"
6706
- ? Number.parseInt(options.maxResults, 10)
6707
- : 3;
6708
- const results = await runWorkProductRecallSearchCliCommand({
6709
- memoryDir: orchestrator.config.memoryDir,
6710
- workProductLedgerDir: orchestrator.config.workProductLedgerDir,
6711
- creationMemoryEnabled: orchestrator.config.creationMemoryEnabled,
6712
- workProductRecallEnabled: orchestrator.config.workProductRecallEnabled,
6713
- query,
6714
- maxResults: Number.isFinite(maxResults) ? maxResults : 3,
6715
- sessionKey: typeof options.sessionKey === "string" ? options.sessionKey : undefined,
6716
- });
6717
- console.log(JSON.stringify(results, null, 2));
6718
- console.log("OK");
6719
- });
6210
+ registerCreationLedgerCommands(cmd, orchestrator);
6720
6211
 
6721
6212
  cmd
6722
6213
  .command("trust-zone-promote")