chainlesschain 0.143.0 → 0.152.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 (227) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +364 -27
  4. package/src/commands/agent-network.js +217 -0
  5. package/src/commands/agent.js +587 -103
  6. package/src/commands/audit.js +206 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +355 -27
  9. package/src/commands/bm25.js +111 -27
  10. package/src/commands/browse.js +403 -29
  11. package/src/commands/ccron.js +128 -28
  12. package/src/commands/chat.js +207 -0
  13. package/src/commands/codegen.js +207 -0
  14. package/src/commands/collab.js +211 -0
  15. package/src/commands/compliance.js +824 -34
  16. package/src/commands/compt.js +127 -29
  17. package/src/commands/consol.js +8 -2
  18. package/src/commands/cowork.js +783 -34
  19. package/src/commands/crosschain.js +182 -28
  20. package/src/commands/dao.js +182 -28
  21. package/src/commands/dbevo.js +227 -0
  22. package/src/commands/dev.js +207 -0
  23. package/src/commands/did-v2.js +217 -0
  24. package/src/commands/did.js +221 -0
  25. package/src/commands/dlp.js +385 -27
  26. package/src/commands/economy.js +205 -50
  27. package/src/commands/evolution.js +203 -50
  28. package/src/commands/evomap.js +387 -27
  29. package/src/commands/export.js +213 -0
  30. package/src/commands/federation.js +209 -0
  31. package/src/commands/fflag.js +74 -22
  32. package/src/commands/fusion.js +205 -0
  33. package/src/commands/git.js +177 -37
  34. package/src/commands/governance.js +209 -0
  35. package/src/commands/hardening.js +209 -0
  36. package/src/commands/hmemory.js +204 -50
  37. package/src/commands/hook.js +209 -0
  38. package/src/commands/import.js +209 -0
  39. package/src/commands/incentive.js +209 -0
  40. package/src/commands/inference.js +170 -34
  41. package/src/commands/infra.js +203 -0
  42. package/src/commands/instinct.js +209 -0
  43. package/src/commands/ipfs.js +207 -0
  44. package/src/commands/itbudget.js +149 -33
  45. package/src/commands/kg.js +206 -0
  46. package/src/commands/llm.js +217 -0
  47. package/src/commands/lowcode.js +195 -38
  48. package/src/commands/marketplace.js +206 -0
  49. package/src/commands/matrix.js +386 -27
  50. package/src/commands/mcp.js +217 -0
  51. package/src/commands/mcpscaf.js +145 -33
  52. package/src/commands/meminj.js +145 -33
  53. package/src/commands/memory.js +209 -0
  54. package/src/commands/multimodal.js +203 -0
  55. package/src/commands/nlprog.js +225 -0
  56. package/src/commands/nostr.js +387 -27
  57. package/src/commands/note.js +205 -0
  58. package/src/commands/ops.js +219 -0
  59. package/src/commands/orchestrate.js +217 -0
  60. package/src/commands/orchgov.js +144 -33
  61. package/src/commands/org.js +209 -0
  62. package/src/commands/p2p.js +209 -0
  63. package/src/commands/pdfp.js +109 -27
  64. package/src/commands/perception.js +209 -0
  65. package/src/commands/perf.js +169 -32
  66. package/src/commands/perm.js +144 -33
  67. package/src/commands/permmem.js +203 -0
  68. package/src/commands/pipeline.js +207 -52
  69. package/src/commands/planmode.js +141 -32
  70. package/src/commands/plugin-ecosystem.js +209 -0
  71. package/src/commands/pqc.js +213 -0
  72. package/src/commands/privacy.js +203 -0
  73. package/src/commands/promcomp.js +111 -27
  74. package/src/commands/quantization.js +207 -0
  75. package/src/commands/rcache.js +205 -0
  76. package/src/commands/recommend.js +410 -34
  77. package/src/commands/reputation.js +208 -0
  78. package/src/commands/runtime.js +205 -0
  79. package/src/commands/sandbox.js +206 -0
  80. package/src/commands/scim.js +209 -0
  81. package/src/commands/seshhook.js +145 -33
  82. package/src/commands/seshsearch.js +141 -33
  83. package/src/commands/seshtail.js +144 -33
  84. package/src/commands/seshu.js +152 -33
  85. package/src/commands/session.js +209 -0
  86. package/src/commands/sganal.js +123 -29
  87. package/src/commands/siem.js +201 -34
  88. package/src/commands/skill.js +207 -0
  89. package/src/commands/sla.js +212 -0
  90. package/src/commands/slotfill.js +146 -33
  91. package/src/commands/social.js +358 -32
  92. package/src/commands/sso.js +209 -0
  93. package/src/commands/stress.js +206 -0
  94. package/src/commands/svccont.js +145 -33
  95. package/src/commands/sync.js +209 -0
  96. package/src/commands/tech.js +209 -0
  97. package/src/commands/tenant.js +217 -0
  98. package/src/commands/terraform.js +206 -0
  99. package/src/commands/tms.js +171 -33
  100. package/src/commands/tokens.js +209 -0
  101. package/src/commands/topiccls.js +146 -33
  102. package/src/commands/trust.js +217 -0
  103. package/src/commands/uprof.js +141 -32
  104. package/src/commands/vcheck.js +122 -28
  105. package/src/commands/wallet.js +209 -0
  106. package/src/commands/webfetch.js +141 -32
  107. package/src/commands/workflow.js +203 -0
  108. package/src/commands/zkp.js +184 -28
  109. package/src/index.js +180 -0
  110. package/src/lib/a2a-protocol.js +319 -51
  111. package/src/lib/activitypub-bridge.js +622 -50
  112. package/src/lib/agent-economy.js +304 -51
  113. package/src/lib/agent-network.js +341 -0
  114. package/src/lib/aiops.js +346 -0
  115. package/src/lib/app-builder.js +279 -46
  116. package/src/lib/audit-logger.js +321 -0
  117. package/src/lib/automation-engine.js +335 -0
  118. package/src/lib/autonomous-agent.js +284 -48
  119. package/src/lib/autonomous-developer.js +332 -0
  120. package/src/lib/bi-engine.js +616 -49
  121. package/src/lib/bm25-search.js +301 -49
  122. package/src/lib/browser-automation.js +630 -49
  123. package/src/lib/chat-core.js +336 -0
  124. package/src/lib/claude-code-bridge.js +341 -0
  125. package/src/lib/code-agent.js +339 -0
  126. package/src/lib/collaboration-governance.js +334 -0
  127. package/src/lib/community-governance.js +346 -0
  128. package/src/lib/compliance-framework-reporter.js +305 -51
  129. package/src/lib/compliance-manager.js +330 -0
  130. package/src/lib/compression-telemetry.js +301 -49
  131. package/src/lib/content-recommendation.js +351 -0
  132. package/src/lib/content-recommender.js +317 -52
  133. package/src/lib/cowork-cron.js +298 -49
  134. package/src/lib/cowork-learning.js +333 -0
  135. package/src/lib/cowork-share.js +338 -0
  136. package/src/lib/cowork-task-runner.js +308 -51
  137. package/src/lib/cowork-workflow.js +327 -0
  138. package/src/lib/cross-chain.js +311 -51
  139. package/src/lib/dao-governance.js +280 -46
  140. package/src/lib/dbevo.js +351 -0
  141. package/src/lib/decentral-infra.js +330 -0
  142. package/src/lib/did-manager.js +341 -0
  143. package/src/lib/did-v2-manager.js +341 -0
  144. package/src/lib/dlp-engine.js +626 -49
  145. package/src/lib/evolution-system.js +278 -47
  146. package/src/lib/evomap-governance.js +334 -0
  147. package/src/lib/evomap-manager.js +280 -46
  148. package/src/lib/execution-backend.js +294 -48
  149. package/src/lib/feature-flags.js +294 -49
  150. package/src/lib/federation-hardening.js +340 -0
  151. package/src/lib/git-integration.js +285 -47
  152. package/src/lib/hardening-manager.js +341 -0
  153. package/src/lib/hierarchical-memory.js +284 -48
  154. package/src/lib/hook-manager.js +341 -0
  155. package/src/lib/inference-network.js +308 -51
  156. package/src/lib/instinct-manager.js +346 -0
  157. package/src/lib/ipfs-storage.js +334 -0
  158. package/src/lib/iteration-budget.js +302 -50
  159. package/src/lib/knowledge-exporter.js +341 -0
  160. package/src/lib/knowledge-graph.js +333 -0
  161. package/src/lib/knowledge-importer.js +341 -0
  162. package/src/lib/llm-providers.js +346 -0
  163. package/src/lib/matrix-bridge.js +620 -47
  164. package/src/lib/mcp-registry.js +346 -0
  165. package/src/lib/mcp-scaffold.js +318 -54
  166. package/src/lib/memory-injection.js +288 -49
  167. package/src/lib/memory-manager.js +336 -0
  168. package/src/lib/multimodal.js +330 -0
  169. package/src/lib/nl-programming.js +341 -0
  170. package/src/lib/nostr-bridge.js +622 -49
  171. package/src/lib/note-versioning.js +339 -0
  172. package/src/lib/orchestrator.js +293 -48
  173. package/src/lib/org-manager.js +336 -0
  174. package/src/lib/p2p-manager.js +341 -0
  175. package/src/lib/pdf-parser.js +298 -49
  176. package/src/lib/perception.js +346 -0
  177. package/src/lib/perf-tuning.js +309 -50
  178. package/src/lib/permanent-memory.js +327 -0
  179. package/src/lib/permission-engine.js +287 -49
  180. package/src/lib/pipeline-orchestrator.js +289 -49
  181. package/src/lib/plan-mode.js +298 -51
  182. package/src/lib/plugin-ecosystem.js +346 -0
  183. package/src/lib/pqc-manager.js +346 -0
  184. package/src/lib/privacy-computing.js +335 -0
  185. package/src/lib/protocol-fusion.js +338 -0
  186. package/src/lib/quantization.js +337 -0
  187. package/src/lib/reputation-optimizer.js +340 -0
  188. package/src/lib/response-cache.js +333 -0
  189. package/src/lib/sandbox-v2.js +327 -0
  190. package/src/lib/scim-manager.js +346 -0
  191. package/src/lib/service-container.js +313 -52
  192. package/src/lib/session-consolidator.js +296 -49
  193. package/src/lib/session-hooks.js +312 -53
  194. package/src/lib/session-manager.js +334 -0
  195. package/src/lib/session-search.js +304 -51
  196. package/src/lib/session-tail.js +288 -49
  197. package/src/lib/session-usage.js +298 -52
  198. package/src/lib/siem-exporter.js +298 -51
  199. package/src/lib/skill-loader.js +334 -0
  200. package/src/lib/skill-marketplace.js +345 -0
  201. package/src/lib/sla-manager.js +341 -0
  202. package/src/lib/slot-filler.js +303 -51
  203. package/src/lib/social-graph-analytics.js +295 -49
  204. package/src/lib/social-graph.js +272 -49
  205. package/src/lib/social-manager.js +330 -0
  206. package/src/lib/sso-manager.js +340 -0
  207. package/src/lib/stress-tester.js +342 -0
  208. package/src/lib/sub-agent-registry.js +302 -53
  209. package/src/lib/sync-manager.js +336 -0
  210. package/src/lib/task-model-selector.js +302 -50
  211. package/src/lib/tech-learning-engine.js +341 -0
  212. package/src/lib/tenant-saas.js +341 -0
  213. package/src/lib/terraform-manager.js +333 -0
  214. package/src/lib/threat-intel.js +330 -0
  215. package/src/lib/todo-manager.js +281 -47
  216. package/src/lib/token-incentive.js +341 -0
  217. package/src/lib/token-tracker.js +336 -0
  218. package/src/lib/topic-classifier.js +297 -49
  219. package/src/lib/trust-security.js +343 -0
  220. package/src/lib/ueba.js +340 -0
  221. package/src/lib/universal-runtime.js +330 -0
  222. package/src/lib/user-profile.js +294 -50
  223. package/src/lib/version-checker.js +304 -50
  224. package/src/lib/wallet-manager.js +336 -0
  225. package/src/lib/web-fetch.js +292 -51
  226. package/src/lib/workflow-engine.js +330 -0
  227. package/src/lib/zkp-engine.js +286 -49
@@ -708,3 +708,212 @@ export function registerFederationCommand(program) {
708
708
 
709
709
  program.addCommand(fed);
710
710
  }
711
+
712
+ // === Iter20 V2 governance overlay ===
713
+ export function registerFedgovV2Commands(program) {
714
+ const parent = program.commands.find((c) => c.name() === "federation");
715
+ if (!parent) return;
716
+ const L = async () => await import("../lib/federation-hardening.js");
717
+ parent
718
+ .command("fedgov-enums-v2")
719
+ .description("Show V2 enums")
720
+ .action(async () => {
721
+ const m = await L();
722
+ console.log(
723
+ JSON.stringify(
724
+ {
725
+ profileMaturity: m.FEDGOV_PROFILE_MATURITY_V2,
726
+ probeLifecycle: m.FEDGOV_PROBE_LIFECYCLE_V2,
727
+ },
728
+ null,
729
+ 2,
730
+ ),
731
+ );
732
+ });
733
+ parent
734
+ .command("fedgov-config-v2")
735
+ .description("Show V2 config")
736
+ .action(async () => {
737
+ const m = await L();
738
+ console.log(
739
+ JSON.stringify(
740
+ {
741
+ maxActive: m.getMaxActiveFedgovProfilesPerOwnerV2(),
742
+ maxPending: m.getMaxPendingFedgovProbesPerProfileV2(),
743
+ idleMs: m.getFedgovProfileIdleMsV2(),
744
+ stuckMs: m.getFedgovProbeStuckMsV2(),
745
+ },
746
+ null,
747
+ 2,
748
+ ),
749
+ );
750
+ });
751
+ parent
752
+ .command("fedgov-set-max-active-v2 <n>")
753
+ .description("Set max active")
754
+ .action(async (n) => {
755
+ (await L()).setMaxActiveFedgovProfilesPerOwnerV2(Number(n));
756
+ console.log("ok");
757
+ });
758
+ parent
759
+ .command("fedgov-set-max-pending-v2 <n>")
760
+ .description("Set max pending")
761
+ .action(async (n) => {
762
+ (await L()).setMaxPendingFedgovProbesPerProfileV2(Number(n));
763
+ console.log("ok");
764
+ });
765
+ parent
766
+ .command("fedgov-set-idle-ms-v2 <n>")
767
+ .description("Set idle threshold ms")
768
+ .action(async (n) => {
769
+ (await L()).setFedgovProfileIdleMsV2(Number(n));
770
+ console.log("ok");
771
+ });
772
+ parent
773
+ .command("fedgov-set-stuck-ms-v2 <n>")
774
+ .description("Set stuck threshold ms")
775
+ .action(async (n) => {
776
+ (await L()).setFedgovProbeStuckMsV2(Number(n));
777
+ console.log("ok");
778
+ });
779
+ parent
780
+ .command("fedgov-register-v2 <id> <owner>")
781
+ .description("Register V2 profile")
782
+ .option("--region <v>", "region")
783
+ .action(async (id, owner, o) => {
784
+ const m = await L();
785
+ console.log(
786
+ JSON.stringify(
787
+ m.registerFedgovProfileV2({ id, owner, region: o.region }),
788
+ null,
789
+ 2,
790
+ ),
791
+ );
792
+ });
793
+ parent
794
+ .command("fedgov-activate-v2 <id>")
795
+ .description("Activate profile")
796
+ .action(async (id) => {
797
+ console.log(
798
+ JSON.stringify((await L()).activateFedgovProfileV2(id), null, 2),
799
+ );
800
+ });
801
+ parent
802
+ .command("fedgov-degrade-v2 <id>")
803
+ .description("Degrade profile")
804
+ .action(async (id) => {
805
+ console.log(
806
+ JSON.stringify((await L()).degradeFedgovProfileV2(id), null, 2),
807
+ );
808
+ });
809
+ parent
810
+ .command("fedgov-archive-v2 <id>")
811
+ .description("Archive profile")
812
+ .action(async (id) => {
813
+ console.log(
814
+ JSON.stringify((await L()).archiveFedgovProfileV2(id), null, 2),
815
+ );
816
+ });
817
+ parent
818
+ .command("fedgov-touch-v2 <id>")
819
+ .description("Touch profile")
820
+ .action(async (id) => {
821
+ console.log(
822
+ JSON.stringify((await L()).touchFedgovProfileV2(id), null, 2),
823
+ );
824
+ });
825
+ parent
826
+ .command("fedgov-get-v2 <id>")
827
+ .description("Get profile")
828
+ .action(async (id) => {
829
+ console.log(JSON.stringify((await L()).getFedgovProfileV2(id), null, 2));
830
+ });
831
+ parent
832
+ .command("fedgov-list-v2")
833
+ .description("List profiles")
834
+ .action(async () => {
835
+ console.log(JSON.stringify((await L()).listFedgovProfilesV2(), null, 2));
836
+ });
837
+ parent
838
+ .command("fedgov-create-probe-v2 <id> <profileId>")
839
+ .description("Create probe")
840
+ .option("--endpoint <v>", "endpoint")
841
+ .action(async (id, profileId, o) => {
842
+ const m = await L();
843
+ console.log(
844
+ JSON.stringify(
845
+ m.createFedgovProbeV2({ id, profileId, endpoint: o.endpoint }),
846
+ null,
847
+ 2,
848
+ ),
849
+ );
850
+ });
851
+ parent
852
+ .command("fedgov-probing-probe-v2 <id>")
853
+ .description("Mark probe as probing")
854
+ .action(async (id) => {
855
+ console.log(
856
+ JSON.stringify((await L()).probingFedgovProbeV2(id), null, 2),
857
+ );
858
+ });
859
+ parent
860
+ .command("fedgov-complete-probe-v2 <id>")
861
+ .description("Complete probe")
862
+ .action(async (id) => {
863
+ console.log(
864
+ JSON.stringify((await L()).completeProbeFedgovV2(id), null, 2),
865
+ );
866
+ });
867
+ parent
868
+ .command("fedgov-fail-probe-v2 <id> [reason]")
869
+ .description("Fail probe")
870
+ .action(async (id, reason) => {
871
+ console.log(
872
+ JSON.stringify((await L()).failFedgovProbeV2(id, reason), null, 2),
873
+ );
874
+ });
875
+ parent
876
+ .command("fedgov-cancel-probe-v2 <id> [reason]")
877
+ .description("Cancel probe")
878
+ .action(async (id, reason) => {
879
+ console.log(
880
+ JSON.stringify((await L()).cancelFedgovProbeV2(id, reason), null, 2),
881
+ );
882
+ });
883
+ parent
884
+ .command("fedgov-get-probe-v2 <id>")
885
+ .description("Get probe")
886
+ .action(async (id) => {
887
+ console.log(JSON.stringify((await L()).getFedgovProbeV2(id), null, 2));
888
+ });
889
+ parent
890
+ .command("fedgov-list-probes-v2")
891
+ .description("List probes")
892
+ .action(async () => {
893
+ console.log(JSON.stringify((await L()).listFedgovProbesV2(), null, 2));
894
+ });
895
+ parent
896
+ .command("fedgov-auto-degrade-idle-v2")
897
+ .description("Auto-degrade idle")
898
+ .action(async () => {
899
+ console.log(
900
+ JSON.stringify((await L()).autoDegradeIdleFedgovProfilesV2(), null, 2),
901
+ );
902
+ });
903
+ parent
904
+ .command("fedgov-auto-fail-stuck-v2")
905
+ .description("Auto-fail stuck probes")
906
+ .action(async () => {
907
+ console.log(
908
+ JSON.stringify((await L()).autoFailStuckFedgovProbesV2(), null, 2),
909
+ );
910
+ });
911
+ parent
912
+ .command("fedgov-gov-stats-v2")
913
+ .description("V2 gov stats")
914
+ .action(async () => {
915
+ console.log(
916
+ JSON.stringify((await L()).getFederationHardeningGovStatsV2(), null, 2),
917
+ );
918
+ });
919
+ }
@@ -56,27 +56,39 @@ export function registerFflagCommand(program) {
56
56
  .requiredOption("--id <id>")
57
57
  .requiredOption("--owner <owner>")
58
58
  .option("--scope <scope>", "scope tag", "*")
59
- .action((o) => console.log(JSON.stringify(registerFflagProfileV2(o), null, 2)));
59
+ .action((o) =>
60
+ console.log(JSON.stringify(registerFflagProfileV2(o), null, 2)),
61
+ );
60
62
  fflag
61
63
  .command("activate-profile-v2 <id>")
62
64
  .description("Transition profile to active")
63
- .action((id) => console.log(JSON.stringify(activateFflagProfileV2(id), null, 2)));
65
+ .action((id) =>
66
+ console.log(JSON.stringify(activateFflagProfileV2(id), null, 2)),
67
+ );
64
68
  fflag
65
69
  .command("pause-profile-v2 <id>")
66
70
  .description("Transition profile to paused")
67
- .action((id) => console.log(JSON.stringify(pauseFflagProfileV2(id), null, 2)));
71
+ .action((id) =>
72
+ console.log(JSON.stringify(pauseFflagProfileV2(id), null, 2)),
73
+ );
68
74
  fflag
69
75
  .command("archive-profile-v2 <id>")
70
76
  .description("Transition profile to archived (terminal)")
71
- .action((id) => console.log(JSON.stringify(archiveFflagProfileV2(id), null, 2)));
77
+ .action((id) =>
78
+ console.log(JSON.stringify(archiveFflagProfileV2(id), null, 2)),
79
+ );
72
80
  fflag
73
81
  .command("touch-profile-v2 <id>")
74
82
  .description("Refresh lastTouchedAt")
75
- .action((id) => console.log(JSON.stringify(touchFflagProfileV2(id), null, 2)));
83
+ .action((id) =>
84
+ console.log(JSON.stringify(touchFflagProfileV2(id), null, 2)),
85
+ );
76
86
  fflag
77
87
  .command("get-profile-v2 <id>")
78
88
  .description("Get a profile by id")
79
- .action((id) => console.log(JSON.stringify(getFflagProfileV2(id), null, 2)));
89
+ .action((id) =>
90
+ console.log(JSON.stringify(getFflagProfileV2(id), null, 2)),
91
+ );
80
92
  fflag
81
93
  .command("list-profiles-v2")
82
94
  .description("List all profiles")
@@ -88,27 +100,33 @@ export function registerFflagCommand(program) {
88
100
  .requiredOption("--id <id>")
89
101
  .requiredOption("--profile-id <profileId>")
90
102
  .option("--key <key>", "flag key", "")
91
- .action((o) =>
92
- console.log(JSON.stringify(createFflagEvalV2(o), null, 2)),
93
- );
103
+ .action((o) => console.log(JSON.stringify(createFflagEvalV2(o), null, 2)));
94
104
  fflag
95
105
  .command("evaluating-eval-v2 <id>")
96
106
  .description("Mark eval as evaluating")
97
- .action((id) => console.log(JSON.stringify(evaluatingFflagEvalV2(id), null, 2)));
107
+ .action((id) =>
108
+ console.log(JSON.stringify(evaluatingFflagEvalV2(id), null, 2)),
109
+ );
98
110
  fflag
99
111
  .command("evaluate-eval-v2 <id>")
100
112
  .description("Mark eval as evaluated (terminal)")
101
- .action((id) => console.log(JSON.stringify(evaluateFflagEvalV2(id), null, 2)));
113
+ .action((id) =>
114
+ console.log(JSON.stringify(evaluateFflagEvalV2(id), null, 2)),
115
+ );
102
116
  fflag
103
117
  .command("fail-eval-v2 <id>")
104
118
  .description("Mark eval as failed (terminal)")
105
119
  .option("--reason <reason>")
106
- .action((id, o) => console.log(JSON.stringify(failFflagEvalV2(id, o.reason), null, 2)));
120
+ .action((id, o) =>
121
+ console.log(JSON.stringify(failFflagEvalV2(id, o.reason), null, 2)),
122
+ );
107
123
  fflag
108
124
  .command("cancel-eval-v2 <id>")
109
125
  .description("Mark eval as cancelled (terminal)")
110
126
  .option("--reason <reason>")
111
- .action((id, o) => console.log(JSON.stringify(cancelFflagEvalV2(id, o.reason), null, 2)));
127
+ .action((id, o) =>
128
+ console.log(JSON.stringify(cancelFflagEvalV2(id, o.reason), null, 2)),
129
+ );
112
130
  fflag
113
131
  .command("get-eval-v2 <id>")
114
132
  .description("Get an eval by id")
@@ -125,8 +143,10 @@ export function registerFflagCommand(program) {
125
143
  console.log(
126
144
  JSON.stringify(
127
145
  {
128
- maxActiveFflagProfilesPerOwner: getMaxActiveFflagProfilesPerOwnerV2(),
129
- maxPendingFflagEvalsPerProfile: getMaxPendingFflagEvalsPerProfileV2(),
146
+ maxActiveFflagProfilesPerOwner:
147
+ getMaxActiveFflagProfilesPerOwnerV2(),
148
+ maxPendingFflagEvalsPerProfile:
149
+ getMaxPendingFflagEvalsPerProfileV2(),
130
150
  fflagProfileIdleMs: getFflagProfileIdleMsV2(),
131
151
  fflagEvalStuckMs: getFflagEvalStuckMsV2(),
132
152
  },
@@ -140,39 +160,71 @@ export function registerFflagCommand(program) {
140
160
  .description("Set max active profiles per owner")
141
161
  .action((n) => {
142
162
  setMaxActiveFflagProfilesPerOwnerV2(Number(n));
143
- console.log(JSON.stringify({ maxActiveFflagProfilesPerOwner: getMaxActiveFflagProfilesPerOwnerV2() }, null, 2));
163
+ console.log(
164
+ JSON.stringify(
165
+ {
166
+ maxActiveFflagProfilesPerOwner:
167
+ getMaxActiveFflagProfilesPerOwnerV2(),
168
+ },
169
+ null,
170
+ 2,
171
+ ),
172
+ );
144
173
  });
145
174
  fflag
146
175
  .command("set-max-pending-evals-v2 <n>")
147
176
  .description("Set max pending evals per profile")
148
177
  .action((n) => {
149
178
  setMaxPendingFflagEvalsPerProfileV2(Number(n));
150
- console.log(JSON.stringify({ maxPendingFflagEvalsPerProfile: getMaxPendingFflagEvalsPerProfileV2() }, null, 2));
179
+ console.log(
180
+ JSON.stringify(
181
+ {
182
+ maxPendingFflagEvalsPerProfile:
183
+ getMaxPendingFflagEvalsPerProfileV2(),
184
+ },
185
+ null,
186
+ 2,
187
+ ),
188
+ );
151
189
  });
152
190
  fflag
153
191
  .command("set-profile-idle-ms-v2 <ms>")
154
192
  .description("Set profile idle window")
155
193
  .action((ms) => {
156
194
  setFflagProfileIdleMsV2(Number(ms));
157
- console.log(JSON.stringify({ fflagProfileIdleMs: getFflagProfileIdleMsV2() }, null, 2));
195
+ console.log(
196
+ JSON.stringify(
197
+ { fflagProfileIdleMs: getFflagProfileIdleMsV2() },
198
+ null,
199
+ 2,
200
+ ),
201
+ );
158
202
  });
159
203
  fflag
160
204
  .command("set-eval-stuck-ms-v2 <ms>")
161
205
  .description("Set eval stuck window")
162
206
  .action((ms) => {
163
207
  setFflagEvalStuckMsV2(Number(ms));
164
- console.log(JSON.stringify({ fflagEvalStuckMs: getFflagEvalStuckMsV2() }, null, 2));
208
+ console.log(
209
+ JSON.stringify({ fflagEvalStuckMs: getFflagEvalStuckMsV2() }, null, 2),
210
+ );
165
211
  });
166
212
  fflag
167
213
  .command("auto-pause-idle-v2")
168
214
  .description("Auto-pause idle active profiles")
169
- .action(() => console.log(JSON.stringify(autoPauseIdleFflagProfilesV2(), null, 2)));
215
+ .action(() =>
216
+ console.log(JSON.stringify(autoPauseIdleFflagProfilesV2(), null, 2)),
217
+ );
170
218
  fflag
171
219
  .command("auto-fail-stuck-v2")
172
220
  .description("Auto-fail stuck evaluating evals")
173
- .action(() => console.log(JSON.stringify(autoFailStuckFflagEvalsV2(), null, 2)));
221
+ .action(() =>
222
+ console.log(JSON.stringify(autoFailStuckFflagEvalsV2(), null, 2)),
223
+ );
174
224
  fflag
175
225
  .command("gov-stats-v2")
176
226
  .description("Show V2 governance stats")
177
- .action(() => console.log(JSON.stringify(getFeatureFlagsGovStatsV2(), null, 2)));
227
+ .action(() =>
228
+ console.log(JSON.stringify(getFeatureFlagsGovStatsV2(), null, 2)),
229
+ );
178
230
  }
@@ -588,3 +588,208 @@ export function registerFusionCommand(program) {
588
588
 
589
589
  program.addCommand(fu);
590
590
  }
591
+
592
+ // === Iter23 V2 governance overlay ===
593
+ export function registerPfgovV2Commands(program) {
594
+ const parent = program.commands.find((c) => c.name() === "fusion");
595
+ if (!parent) return;
596
+ const L = async () => await import("../lib/protocol-fusion.js");
597
+ parent
598
+ .command("pfgov-enums-v2")
599
+ .description("Show V2 enums")
600
+ .action(async () => {
601
+ const m = await L();
602
+ console.log(
603
+ JSON.stringify(
604
+ {
605
+ profileMaturity: m.PFGOV_PROFILE_MATURITY_V2,
606
+ routeLifecycle: m.PFGOV_ROUTE_LIFECYCLE_V2,
607
+ },
608
+ null,
609
+ 2,
610
+ ),
611
+ );
612
+ });
613
+ parent
614
+ .command("pfgov-config-v2")
615
+ .description("Show V2 config")
616
+ .action(async () => {
617
+ const m = await L();
618
+ console.log(
619
+ JSON.stringify(
620
+ {
621
+ maxActive: m.getMaxActivePfgovProfilesPerOwnerV2(),
622
+ maxPending: m.getMaxPendingPfgovRoutesPerProfileV2(),
623
+ idleMs: m.getPfgovProfileIdleMsV2(),
624
+ stuckMs: m.getPfgovRouteStuckMsV2(),
625
+ },
626
+ null,
627
+ 2,
628
+ ),
629
+ );
630
+ });
631
+ parent
632
+ .command("pfgov-set-max-active-v2 <n>")
633
+ .description("Set max active")
634
+ .action(async (n) => {
635
+ (await L()).setMaxActivePfgovProfilesPerOwnerV2(Number(n));
636
+ console.log("ok");
637
+ });
638
+ parent
639
+ .command("pfgov-set-max-pending-v2 <n>")
640
+ .description("Set max pending")
641
+ .action(async (n) => {
642
+ (await L()).setMaxPendingPfgovRoutesPerProfileV2(Number(n));
643
+ console.log("ok");
644
+ });
645
+ parent
646
+ .command("pfgov-set-idle-ms-v2 <n>")
647
+ .description("Set idle threshold ms")
648
+ .action(async (n) => {
649
+ (await L()).setPfgovProfileIdleMsV2(Number(n));
650
+ console.log("ok");
651
+ });
652
+ parent
653
+ .command("pfgov-set-stuck-ms-v2 <n>")
654
+ .description("Set stuck threshold ms")
655
+ .action(async (n) => {
656
+ (await L()).setPfgovRouteStuckMsV2(Number(n));
657
+ console.log("ok");
658
+ });
659
+ parent
660
+ .command("pfgov-register-v2 <id> <owner>")
661
+ .description("Register V2 profile")
662
+ .option("--protocol <v>", "protocol")
663
+ .action(async (id, owner, o) => {
664
+ const m = await L();
665
+ console.log(
666
+ JSON.stringify(
667
+ m.registerPfgovProfileV2({ id, owner, protocol: o.protocol }),
668
+ null,
669
+ 2,
670
+ ),
671
+ );
672
+ });
673
+ parent
674
+ .command("pfgov-activate-v2 <id>")
675
+ .description("Activate profile")
676
+ .action(async (id) => {
677
+ console.log(
678
+ JSON.stringify((await L()).activatePfgovProfileV2(id), null, 2),
679
+ );
680
+ });
681
+ parent
682
+ .command("pfgov-degrade-v2 <id>")
683
+ .description("Degrade profile")
684
+ .action(async (id) => {
685
+ console.log(
686
+ JSON.stringify((await L()).degradePfgovProfileV2(id), null, 2),
687
+ );
688
+ });
689
+ parent
690
+ .command("pfgov-archive-v2 <id>")
691
+ .description("Archive profile")
692
+ .action(async (id) => {
693
+ console.log(
694
+ JSON.stringify((await L()).archivePfgovProfileV2(id), null, 2),
695
+ );
696
+ });
697
+ parent
698
+ .command("pfgov-touch-v2 <id>")
699
+ .description("Touch profile")
700
+ .action(async (id) => {
701
+ console.log(JSON.stringify((await L()).touchPfgovProfileV2(id), null, 2));
702
+ });
703
+ parent
704
+ .command("pfgov-get-v2 <id>")
705
+ .description("Get profile")
706
+ .action(async (id) => {
707
+ console.log(JSON.stringify((await L()).getPfgovProfileV2(id), null, 2));
708
+ });
709
+ parent
710
+ .command("pfgov-list-v2")
711
+ .description("List profiles")
712
+ .action(async () => {
713
+ console.log(JSON.stringify((await L()).listPfgovProfilesV2(), null, 2));
714
+ });
715
+ parent
716
+ .command("pfgov-create-route-v2 <id> <profileId>")
717
+ .description("Create route")
718
+ .option("--destination <v>", "destination")
719
+ .action(async (id, profileId, o) => {
720
+ const m = await L();
721
+ console.log(
722
+ JSON.stringify(
723
+ m.createPfgovRouteV2({ id, profileId, destination: o.destination }),
724
+ null,
725
+ 2,
726
+ ),
727
+ );
728
+ });
729
+ parent
730
+ .command("pfgov-routing-route-v2 <id>")
731
+ .description("Mark route as routing")
732
+ .action(async (id) => {
733
+ console.log(JSON.stringify((await L()).routingPfgovRouteV2(id), null, 2));
734
+ });
735
+ parent
736
+ .command("pfgov-complete-route-v2 <id>")
737
+ .description("Complete route")
738
+ .action(async (id) => {
739
+ console.log(
740
+ JSON.stringify((await L()).completeRoutePfgovV2(id), null, 2),
741
+ );
742
+ });
743
+ parent
744
+ .command("pfgov-fail-route-v2 <id> [reason]")
745
+ .description("Fail route")
746
+ .action(async (id, reason) => {
747
+ console.log(
748
+ JSON.stringify((await L()).failPfgovRouteV2(id, reason), null, 2),
749
+ );
750
+ });
751
+ parent
752
+ .command("pfgov-cancel-route-v2 <id> [reason]")
753
+ .description("Cancel route")
754
+ .action(async (id, reason) => {
755
+ console.log(
756
+ JSON.stringify((await L()).cancelPfgovRouteV2(id, reason), null, 2),
757
+ );
758
+ });
759
+ parent
760
+ .command("pfgov-get-route-v2 <id>")
761
+ .description("Get route")
762
+ .action(async (id) => {
763
+ console.log(JSON.stringify((await L()).getPfgovRouteV2(id), null, 2));
764
+ });
765
+ parent
766
+ .command("pfgov-list-routes-v2")
767
+ .description("List routes")
768
+ .action(async () => {
769
+ console.log(JSON.stringify((await L()).listPfgovRoutesV2(), null, 2));
770
+ });
771
+ parent
772
+ .command("pfgov-auto-degrade-idle-v2")
773
+ .description("Auto-degrade idle")
774
+ .action(async () => {
775
+ console.log(
776
+ JSON.stringify((await L()).autoDegradeIdlePfgovProfilesV2(), null, 2),
777
+ );
778
+ });
779
+ parent
780
+ .command("pfgov-auto-fail-stuck-v2")
781
+ .description("Auto-fail stuck routes")
782
+ .action(async () => {
783
+ console.log(
784
+ JSON.stringify((await L()).autoFailStuckPfgovRoutesV2(), null, 2),
785
+ );
786
+ });
787
+ parent
788
+ .command("pfgov-gov-stats-v2")
789
+ .description("V2 gov stats")
790
+ .action(async () => {
791
+ console.log(
792
+ JSON.stringify((await L()).getProtocolFusionGovStatsV2(), null, 2),
793
+ );
794
+ });
795
+ }