chainlesschain 0.66.0 → 0.132.0

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 (143) hide show
  1. package/bin/chainlesschain.js +0 -0
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +380 -0
  4. package/src/commands/agent-network.js +254 -1
  5. package/src/commands/audit.js +302 -0
  6. package/src/commands/automation.js +271 -1
  7. package/src/commands/bi.js +348 -0
  8. package/src/commands/codegen.js +224 -0
  9. package/src/commands/collab.js +341 -0
  10. package/src/commands/compliance.js +1035 -0
  11. package/src/commands/cowork.js +221 -0
  12. package/src/commands/crosschain.js +218 -0
  13. package/src/commands/dbevo.js +284 -0
  14. package/src/commands/dev.js +252 -0
  15. package/src/commands/did.js +358 -0
  16. package/src/commands/dlp.js +341 -0
  17. package/src/commands/encrypt.js +341 -0
  18. package/src/commands/evomap.js +394 -0
  19. package/src/commands/export.js +256 -1
  20. package/src/commands/federation.js +283 -0
  21. package/src/commands/fusion.js +258 -0
  22. package/src/commands/governance.js +325 -0
  23. package/src/commands/hardening.js +411 -0
  24. package/src/commands/hook.js +148 -0
  25. package/src/commands/import.js +252 -0
  26. package/src/commands/incentive.js +322 -0
  27. package/src/commands/inference.js +318 -0
  28. package/src/commands/infra.js +244 -0
  29. package/src/commands/instinct.js +260 -0
  30. package/src/commands/ipfs.js +318 -0
  31. package/src/commands/kg.js +387 -0
  32. package/src/commands/llm.js +263 -0
  33. package/src/commands/lowcode.js +356 -0
  34. package/src/commands/marketplace.js +256 -0
  35. package/src/commands/mcp.js +221 -0
  36. package/src/commands/memory.js +248 -0
  37. package/src/commands/multimodal.js +296 -0
  38. package/src/commands/nlprog.js +356 -0
  39. package/src/commands/note.js +244 -0
  40. package/src/commands/ops.js +354 -0
  41. package/src/commands/orchestrate.js +166 -0
  42. package/src/commands/org.js +277 -0
  43. package/src/commands/p2p.js +390 -0
  44. package/src/commands/perception.js +290 -0
  45. package/src/commands/permmem.js +251 -0
  46. package/src/commands/plugin-ecosystem.js +273 -0
  47. package/src/commands/pqc.js +393 -0
  48. package/src/commands/privacy.js +321 -0
  49. package/src/commands/quantization.js +351 -0
  50. package/src/commands/rcache.js +271 -0
  51. package/src/commands/recommend.js +340 -0
  52. package/src/commands/reputation.js +261 -0
  53. package/src/commands/runtime.js +307 -0
  54. package/src/commands/scim.js +262 -0
  55. package/src/commands/session.js +258 -0
  56. package/src/commands/siem.js +246 -0
  57. package/src/commands/skill.js +267 -1
  58. package/src/commands/sla.js +259 -0
  59. package/src/commands/social.js +256 -0
  60. package/src/commands/sso.js +186 -1
  61. package/src/commands/stress.js +230 -0
  62. package/src/commands/sync.js +256 -0
  63. package/src/commands/tech.js +338 -0
  64. package/src/commands/tenant.js +351 -0
  65. package/src/commands/terraform.js +245 -0
  66. package/src/commands/tokens.js +269 -0
  67. package/src/commands/trust.js +249 -0
  68. package/src/commands/wallet.js +277 -0
  69. package/src/commands/workflow.js +171 -0
  70. package/src/commands/zkp.js +335 -0
  71. package/src/index.js +4 -0
  72. package/src/lib/a2a-protocol.js +451 -0
  73. package/src/lib/agent-coordinator.js +325 -0
  74. package/src/lib/agent-network.js +387 -0
  75. package/src/lib/agent-router.js +395 -0
  76. package/src/lib/aiops.js +478 -0
  77. package/src/lib/app-builder.js +239 -0
  78. package/src/lib/audit-logger.js +379 -0
  79. package/src/lib/automation-engine.js +330 -0
  80. package/src/lib/autonomous-developer.js +350 -0
  81. package/src/lib/bi-engine.js +338 -0
  82. package/src/lib/code-agent.js +323 -0
  83. package/src/lib/collaboration-governance.js +364 -0
  84. package/src/lib/community-governance.js +436 -0
  85. package/src/lib/compliance-manager.js +434 -0
  86. package/src/lib/content-recommendation.js +469 -0
  87. package/src/lib/cross-chain.js +345 -0
  88. package/src/lib/crypto-manager.js +350 -0
  89. package/src/lib/dbevo.js +338 -0
  90. package/src/lib/decentral-infra.js +340 -0
  91. package/src/lib/did-manager.js +367 -0
  92. package/src/lib/dlp-engine.js +389 -0
  93. package/src/lib/evomap-federation.js +177 -0
  94. package/src/lib/evomap-governance.js +276 -0
  95. package/src/lib/federation-hardening.js +259 -0
  96. package/src/lib/hardening-manager.js +348 -0
  97. package/src/lib/hook-manager.js +380 -0
  98. package/src/lib/inference-network.js +330 -0
  99. package/src/lib/instinct-manager.js +332 -0
  100. package/src/lib/ipfs-storage.js +334 -0
  101. package/src/lib/knowledge-exporter.js +381 -0
  102. package/src/lib/knowledge-graph.js +432 -0
  103. package/src/lib/knowledge-importer.js +379 -0
  104. package/src/lib/llm-providers.js +391 -0
  105. package/src/lib/mcp-registry.js +333 -0
  106. package/src/lib/memory-manager.js +330 -0
  107. package/src/lib/multimodal.js +346 -0
  108. package/src/lib/nl-programming.js +343 -0
  109. package/src/lib/note-versioning.js +327 -0
  110. package/src/lib/org-manager.js +323 -0
  111. package/src/lib/p2p-manager.js +387 -0
  112. package/src/lib/perception.js +346 -0
  113. package/src/lib/perf-tuning.js +4 -1
  114. package/src/lib/permanent-memory.js +320 -0
  115. package/src/lib/plugin-ecosystem.js +377 -0
  116. package/src/lib/pqc-manager.js +368 -0
  117. package/src/lib/privacy-computing.js +427 -0
  118. package/src/lib/protocol-fusion.js +417 -0
  119. package/src/lib/quantization.js +325 -0
  120. package/src/lib/reputation-optimizer.js +299 -0
  121. package/src/lib/response-cache.js +327 -0
  122. package/src/lib/scim-manager.js +329 -0
  123. package/src/lib/session-manager.js +329 -0
  124. package/src/lib/siem-exporter.js +333 -0
  125. package/src/lib/skill-loader.js +377 -0
  126. package/src/lib/skill-marketplace.js +325 -0
  127. package/src/lib/sla-manager.js +275 -0
  128. package/src/lib/social-manager.js +326 -0
  129. package/src/lib/sso-manager.js +332 -0
  130. package/src/lib/stress-tester.js +330 -0
  131. package/src/lib/sync-manager.js +326 -0
  132. package/src/lib/tech-learning-engine.js +369 -0
  133. package/src/lib/tenant-saas.js +460 -0
  134. package/src/lib/terraform-manager.js +363 -0
  135. package/src/lib/threat-intel.js +335 -0
  136. package/src/lib/token-incentive.js +293 -0
  137. package/src/lib/token-tracker.js +329 -0
  138. package/src/lib/trust-security.js +390 -0
  139. package/src/lib/ueba.js +389 -0
  140. package/src/lib/universal-runtime.js +325 -0
  141. package/src/lib/wallet-manager.js +326 -0
  142. package/src/lib/workflow-engine.js +322 -0
  143. package/src/lib/zkp-engine.js +274 -0
@@ -804,4 +804,225 @@ export function registerMcpCommand(program) {
804
804
  logger.log(` ${chalk.cyan(c)} ${chalk.dim(`(${count})`)}`);
805
805
  }
806
806
  });
807
+
808
+ // ===== V2 governance subcommands (mcp-registry V2) =====
809
+ mcp
810
+ .command("server-maturities-v2")
811
+ .description("List MCP server maturity states (V2)")
812
+ .action(async () => {
813
+ const m = await import("../lib/mcp-registry.js");
814
+ console.log(JSON.stringify(m.MCP_SERVER_MATURITY_V2, null, 2));
815
+ });
816
+ mcp
817
+ .command("invocation-lifecycle-v2")
818
+ .description("List MCP invocation lifecycle states (V2)")
819
+ .action(async () => {
820
+ const m = await import("../lib/mcp-registry.js");
821
+ console.log(JSON.stringify(m.MCP_INVOCATION_LIFECYCLE_V2, null, 2));
822
+ });
823
+ mcp
824
+ .command("stats-v2")
825
+ .description("Show MCP registry V2 stats")
826
+ .action(async () => {
827
+ const m = await import("../lib/mcp-registry.js");
828
+ console.log(JSON.stringify(m.getMcpRegistryStatsV2(), null, 2));
829
+ });
830
+ mcp
831
+ .command("config-v2")
832
+ .description("Show MCP registry V2 config")
833
+ .action(async () => {
834
+ const m = await import("../lib/mcp-registry.js");
835
+ console.log(
836
+ JSON.stringify(
837
+ {
838
+ maxActiveServersPerOwner: m.getMaxActiveServersPerOwnerV2(),
839
+ maxPendingInvocationsPerServer:
840
+ m.getMaxPendingInvocationsPerServerV2(),
841
+ serverIdleMs: m.getServerIdleMsV2(),
842
+ invocationStuckMs: m.getInvocationStuckMsV2(),
843
+ },
844
+ null,
845
+ 2,
846
+ ),
847
+ );
848
+ });
849
+ mcp
850
+ .command("register-server-v2 <id> <owner> <endpoint>")
851
+ .description("Register an MCP server (V2)")
852
+ .action(async (id, owner, endpoint) => {
853
+ const m = await import("../lib/mcp-registry.js");
854
+ console.log(
855
+ JSON.stringify(m.registerServerV2({ id, owner, endpoint }), null, 2),
856
+ );
857
+ });
858
+ mcp
859
+ .command("activate-server-v2 <id>")
860
+ .description("Activate an MCP server (V2)")
861
+ .action(async (id) => {
862
+ const m = await import("../lib/mcp-registry.js");
863
+ console.log(JSON.stringify(m.activateServerV2(id), null, 2));
864
+ });
865
+ mcp
866
+ .command("degrade-server-v2 <id>")
867
+ .description("Degrade an MCP server (V2)")
868
+ .action(async (id) => {
869
+ const m = await import("../lib/mcp-registry.js");
870
+ console.log(JSON.stringify(m.degradeServerV2(id), null, 2));
871
+ });
872
+ mcp
873
+ .command("retire-server-v2 <id>")
874
+ .description("Retire an MCP server (V2)")
875
+ .action(async (id) => {
876
+ const m = await import("../lib/mcp-registry.js");
877
+ console.log(JSON.stringify(m.retireServerV2(id), null, 2));
878
+ });
879
+ mcp
880
+ .command("touch-server-v2 <id>")
881
+ .description("Touch an MCP server (V2)")
882
+ .action(async (id) => {
883
+ const m = await import("../lib/mcp-registry.js");
884
+ console.log(JSON.stringify(m.touchServerV2(id), null, 2));
885
+ });
886
+ mcp
887
+ .command("get-server-v2 <id>")
888
+ .description("Get an MCP server (V2)")
889
+ .action(async (id) => {
890
+ const m = await import("../lib/mcp-registry.js");
891
+ console.log(JSON.stringify(m.getServerV2(id), null, 2));
892
+ });
893
+ mcp
894
+ .command("list-servers-v2")
895
+ .description("List MCP servers (V2)")
896
+ .action(async () => {
897
+ const m = await import("../lib/mcp-registry.js");
898
+ console.log(JSON.stringify(m.listServersV2(), null, 2));
899
+ });
900
+ mcp
901
+ .command("create-invocation-v2 <id> <serverId> <tool>")
902
+ .description("Create an MCP invocation (V2)")
903
+ .action(async (id, serverId, tool) => {
904
+ const m = await import("../lib/mcp-registry.js");
905
+ console.log(
906
+ JSON.stringify(m.createInvocationV2({ id, serverId, tool }), null, 2),
907
+ );
908
+ });
909
+ mcp
910
+ .command("dispatch-invocation-v2 <id>")
911
+ .description("Dispatch an MCP invocation (V2)")
912
+ .action(async (id) => {
913
+ const m = await import("../lib/mcp-registry.js");
914
+ console.log(JSON.stringify(m.dispatchInvocationV2(id), null, 2));
915
+ });
916
+ mcp
917
+ .command("complete-invocation-v2 <id>")
918
+ .description("Complete an MCP invocation (V2)")
919
+ .action(async (id) => {
920
+ const m = await import("../lib/mcp-registry.js");
921
+ console.log(JSON.stringify(m.completeInvocationV2(id), null, 2));
922
+ });
923
+ mcp
924
+ .command("fail-invocation-v2 <id> [reason]")
925
+ .description("Fail an MCP invocation (V2)")
926
+ .action(async (id, reason) => {
927
+ const m = await import("../lib/mcp-registry.js");
928
+ console.log(JSON.stringify(m.failInvocationV2(id, reason), null, 2));
929
+ });
930
+ mcp
931
+ .command("cancel-invocation-v2 <id> [reason]")
932
+ .description("Cancel an MCP invocation (V2)")
933
+ .action(async (id, reason) => {
934
+ const m = await import("../lib/mcp-registry.js");
935
+ console.log(JSON.stringify(m.cancelInvocationV2(id, reason), null, 2));
936
+ });
937
+ mcp
938
+ .command("get-invocation-v2 <id>")
939
+ .description("Get an MCP invocation (V2)")
940
+ .action(async (id) => {
941
+ const m = await import("../lib/mcp-registry.js");
942
+ console.log(JSON.stringify(m.getInvocationV2(id), null, 2));
943
+ });
944
+ mcp
945
+ .command("list-invocations-v2")
946
+ .description("List MCP invocations (V2)")
947
+ .action(async () => {
948
+ const m = await import("../lib/mcp-registry.js");
949
+ console.log(JSON.stringify(m.listInvocationsV2(), null, 2));
950
+ });
951
+ mcp
952
+ .command("auto-degrade-idle-servers-v2")
953
+ .description("Auto-degrade idle MCP servers (V2)")
954
+ .action(async () => {
955
+ const m = await import("../lib/mcp-registry.js");
956
+ console.log(JSON.stringify(m.autoDegradeIdleServersV2(), null, 2));
957
+ });
958
+ mcp
959
+ .command("auto-fail-stuck-invocations-v2")
960
+ .description("Auto-fail stuck MCP invocations (V2)")
961
+ .action(async () => {
962
+ const m = await import("../lib/mcp-registry.js");
963
+ console.log(JSON.stringify(m.autoFailStuckInvocationsV2(), null, 2));
964
+ });
965
+ mcp
966
+ .command("set-max-active-servers-v2 <n>")
967
+ .description("Set max active servers per owner (V2)")
968
+ .action(async (n) => {
969
+ const m = await import("../lib/mcp-registry.js");
970
+ m.setMaxActiveServersPerOwnerV2(parseInt(n, 10));
971
+ console.log(
972
+ JSON.stringify(
973
+ { maxActiveServersPerOwner: m.getMaxActiveServersPerOwnerV2() },
974
+ null,
975
+ 2,
976
+ ),
977
+ );
978
+ });
979
+ mcp
980
+ .command("set-max-pending-invocations-v2 <n>")
981
+ .description("Set max pending invocations per server (V2)")
982
+ .action(async (n) => {
983
+ const m = await import("../lib/mcp-registry.js");
984
+ m.setMaxPendingInvocationsPerServerV2(parseInt(n, 10));
985
+ console.log(
986
+ JSON.stringify(
987
+ {
988
+ maxPendingInvocationsPerServer:
989
+ m.getMaxPendingInvocationsPerServerV2(),
990
+ },
991
+ null,
992
+ 2,
993
+ ),
994
+ );
995
+ });
996
+ mcp
997
+ .command("set-server-idle-ms-v2 <n>")
998
+ .description("Set MCP server idle timeout in ms (V2)")
999
+ .action(async (n) => {
1000
+ const m = await import("../lib/mcp-registry.js");
1001
+ m.setServerIdleMsV2(parseInt(n, 10));
1002
+ console.log(
1003
+ JSON.stringify({ serverIdleMs: m.getServerIdleMsV2() }, null, 2),
1004
+ );
1005
+ });
1006
+ mcp
1007
+ .command("set-invocation-stuck-ms-v2 <n>")
1008
+ .description("Set MCP invocation stuck timeout in ms (V2)")
1009
+ .action(async (n) => {
1010
+ const m = await import("../lib/mcp-registry.js");
1011
+ m.setInvocationStuckMsV2(parseInt(n, 10));
1012
+ console.log(
1013
+ JSON.stringify(
1014
+ { invocationStuckMs: m.getInvocationStuckMsV2() },
1015
+ null,
1016
+ 2,
1017
+ ),
1018
+ );
1019
+ });
1020
+ mcp
1021
+ .command("reset-state-v2")
1022
+ .description("Reset MCP registry V2 in-memory state")
1023
+ .action(async () => {
1024
+ const m = await import("../lib/mcp-registry.js");
1025
+ m._resetStateMcpRegistryV2();
1026
+ console.log(JSON.stringify({ ok: true }, null, 2));
1027
+ });
807
1028
  }
@@ -17,6 +17,35 @@ import {
17
17
  listDailyNotes,
18
18
  getMemoryFile,
19
19
  updateMemoryFile,
20
+ ENTRY_MATURITY_V2,
21
+ CONSOLIDATION_LIFECYCLE_V2,
22
+ getMaxActiveEntriesPerCategoryV2,
23
+ setMaxActiveEntriesPerCategoryV2,
24
+ getMaxRunningJobsPerSourceV2,
25
+ setMaxRunningJobsPerSourceV2,
26
+ getEntryIdleMsV2,
27
+ setEntryIdleMsV2,
28
+ getJobStuckMsV2,
29
+ setJobStuckMsV2,
30
+ getActiveEntryCountV2,
31
+ getRunningJobCountV2,
32
+ registerEntryV2,
33
+ getEntryV2,
34
+ listEntriesV2,
35
+ activateEntryV2,
36
+ parkEntryV2,
37
+ archiveEntryV2,
38
+ touchEntryV2,
39
+ createConsolidationJobV2,
40
+ getConsolidationJobV2,
41
+ listConsolidationJobsV2,
42
+ startConsolidationJobV2,
43
+ succeedConsolidationJobV2,
44
+ failConsolidationJobV2,
45
+ cancelConsolidationJobV2,
46
+ autoParkIdleEntriesV2,
47
+ autoFailStuckJobsV2,
48
+ getMemoryManagerStatsV2,
20
49
  } from "../lib/memory-manager.js";
21
50
 
22
51
  export function registerMemoryCommand(program) {
@@ -454,4 +483,223 @@ export function registerMemoryCommand(program) {
454
483
  process.exit(1);
455
484
  }
456
485
  });
486
+
487
+ // ─── V2 governance surface ─────────────────────────────────
488
+
489
+ memory
490
+ .command("entry-maturities-v2")
491
+ .description("List V2 entry maturity states")
492
+ .action(() => {
493
+ console.log(JSON.stringify(Object.values(ENTRY_MATURITY_V2), null, 2));
494
+ });
495
+
496
+ memory
497
+ .command("consolidation-lifecycles-v2")
498
+ .description("List V2 consolidation job lifecycle states")
499
+ .action(() => {
500
+ console.log(
501
+ JSON.stringify(Object.values(CONSOLIDATION_LIFECYCLE_V2), null, 2),
502
+ );
503
+ });
504
+
505
+ memory
506
+ .command("stats-v2")
507
+ .description("Show V2 governance stats")
508
+ .action(() => {
509
+ console.log(JSON.stringify(getMemoryManagerStatsV2(), null, 2));
510
+ });
511
+
512
+ memory
513
+ .command("get-max-active-entries-v2")
514
+ .description("Get max active entries per category")
515
+ .action(() => console.log(getMaxActiveEntriesPerCategoryV2()));
516
+
517
+ memory
518
+ .command("set-max-active-entries-v2 <n>")
519
+ .description("Set max active entries per category")
520
+ .action((n) => {
521
+ setMaxActiveEntriesPerCategoryV2(Number(n));
522
+ console.log(getMaxActiveEntriesPerCategoryV2());
523
+ });
524
+
525
+ memory
526
+ .command("get-max-running-jobs-v2")
527
+ .description("Get max running jobs per source")
528
+ .action(() => console.log(getMaxRunningJobsPerSourceV2()));
529
+
530
+ memory
531
+ .command("set-max-running-jobs-v2 <n>")
532
+ .description("Set max running jobs per source")
533
+ .action((n) => {
534
+ setMaxRunningJobsPerSourceV2(Number(n));
535
+ console.log(getMaxRunningJobsPerSourceV2());
536
+ });
537
+
538
+ memory
539
+ .command("get-entry-idle-ms-v2")
540
+ .description("Get entry idle threshold (ms)")
541
+ .action(() => console.log(getEntryIdleMsV2()));
542
+
543
+ memory
544
+ .command("set-entry-idle-ms-v2 <n>")
545
+ .description("Set entry idle threshold (ms)")
546
+ .action((n) => {
547
+ setEntryIdleMsV2(Number(n));
548
+ console.log(getEntryIdleMsV2());
549
+ });
550
+
551
+ memory
552
+ .command("get-job-stuck-ms-v2")
553
+ .description("Get job stuck threshold (ms)")
554
+ .action(() => console.log(getJobStuckMsV2()));
555
+
556
+ memory
557
+ .command("set-job-stuck-ms-v2 <n>")
558
+ .description("Set job stuck threshold (ms)")
559
+ .action((n) => {
560
+ setJobStuckMsV2(Number(n));
561
+ console.log(getJobStuckMsV2());
562
+ });
563
+
564
+ memory
565
+ .command("active-entry-count-v2 <category>")
566
+ .description("Count active entries for a category")
567
+ .action((category) => console.log(getActiveEntryCountV2(category)));
568
+
569
+ memory
570
+ .command("running-job-count-v2 <source>")
571
+ .description("Count running jobs for a source")
572
+ .action((source) => console.log(getRunningJobCountV2(source)));
573
+
574
+ memory
575
+ .command("register-entry-v2 <id>")
576
+ .description("Register a V2 entry")
577
+ .requiredOption("-c, --category <category>", "Category")
578
+ .requiredOption("-s, --summary <summary>", "Summary")
579
+ .action((id, opts) => {
580
+ const e = registerEntryV2(id, {
581
+ category: opts.category,
582
+ summary: opts.summary,
583
+ });
584
+ console.log(JSON.stringify(e, null, 2));
585
+ });
586
+
587
+ memory
588
+ .command("get-entry-v2 <id>")
589
+ .description("Get a V2 entry")
590
+ .action((id) => {
591
+ const e = getEntryV2(id);
592
+ console.log(e ? JSON.stringify(e, null, 2) : "null");
593
+ });
594
+
595
+ memory
596
+ .command("list-entries-v2")
597
+ .description("List V2 entries")
598
+ .option("-c, --category <category>", "Filter by category")
599
+ .option("-s, --status <status>", "Filter by status")
600
+ .action((opts) => {
601
+ console.log(
602
+ JSON.stringify(
603
+ listEntriesV2({ category: opts.category, status: opts.status }),
604
+ null,
605
+ 2,
606
+ ),
607
+ );
608
+ });
609
+
610
+ memory
611
+ .command("activate-entry-v2 <id>")
612
+ .description("pending|parked → active")
613
+ .action((id) => console.log(JSON.stringify(activateEntryV2(id), null, 2)));
614
+
615
+ memory
616
+ .command("park-entry-v2 <id>")
617
+ .description("active → parked")
618
+ .action((id) => console.log(JSON.stringify(parkEntryV2(id), null, 2)));
619
+
620
+ memory
621
+ .command("archive-entry-v2 <id>")
622
+ .description("→ archived (terminal)")
623
+ .action((id) => console.log(JSON.stringify(archiveEntryV2(id), null, 2)));
624
+
625
+ memory
626
+ .command("touch-entry-v2 <id>")
627
+ .description("Update lastSeenAt")
628
+ .action((id) => console.log(JSON.stringify(touchEntryV2(id), null, 2)));
629
+
630
+ memory
631
+ .command("create-job-v2 <id>")
632
+ .description("Create a V2 consolidation job")
633
+ .requiredOption("-s, --source <source>", "Source")
634
+ .requiredOption("-c, --scope <scope>", "Scope")
635
+ .action((id, opts) => {
636
+ const j = createConsolidationJobV2(id, {
637
+ source: opts.source,
638
+ scope: opts.scope,
639
+ });
640
+ console.log(JSON.stringify(j, null, 2));
641
+ });
642
+
643
+ memory
644
+ .command("get-job-v2 <id>")
645
+ .description("Get a V2 consolidation job")
646
+ .action((id) => {
647
+ const j = getConsolidationJobV2(id);
648
+ console.log(j ? JSON.stringify(j, null, 2) : "null");
649
+ });
650
+
651
+ memory
652
+ .command("list-jobs-v2")
653
+ .description("List V2 consolidation jobs")
654
+ .option("-s, --source <source>", "Filter by source")
655
+ .option("--status <status>", "Filter by status")
656
+ .action((opts) => {
657
+ console.log(
658
+ JSON.stringify(
659
+ listConsolidationJobsV2({ source: opts.source, status: opts.status }),
660
+ null,
661
+ 2,
662
+ ),
663
+ );
664
+ });
665
+
666
+ memory
667
+ .command("start-job-v2 <id>")
668
+ .description("queued → running")
669
+ .action((id) =>
670
+ console.log(JSON.stringify(startConsolidationJobV2(id), null, 2)),
671
+ );
672
+
673
+ memory
674
+ .command("succeed-job-v2 <id>")
675
+ .description("running → succeeded (terminal)")
676
+ .action((id) =>
677
+ console.log(JSON.stringify(succeedConsolidationJobV2(id), null, 2)),
678
+ );
679
+
680
+ memory
681
+ .command("fail-job-v2 <id>")
682
+ .description("running → failed (terminal)")
683
+ .action((id) =>
684
+ console.log(JSON.stringify(failConsolidationJobV2(id), null, 2)),
685
+ );
686
+
687
+ memory
688
+ .command("cancel-job-v2 <id>")
689
+ .description("queued|running → cancelled (terminal)")
690
+ .action((id) =>
691
+ console.log(JSON.stringify(cancelConsolidationJobV2(id), null, 2)),
692
+ );
693
+
694
+ memory
695
+ .command("auto-park-idle-entries-v2")
696
+ .description("Flip idle active entries → parked")
697
+ .action(() =>
698
+ console.log(JSON.stringify(autoParkIdleEntriesV2(), null, 2)),
699
+ );
700
+
701
+ memory
702
+ .command("auto-fail-stuck-jobs-v2")
703
+ .description("Flip stuck running jobs → failed")
704
+ .action(() => console.log(JSON.stringify(autoFailStuckJobsV2(), null, 2)));
457
705
  }