chainlesschain 0.145.0 → 0.156.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 (184) hide show
  1. package/README.md +52 -3
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +201 -0
  4. package/src/commands/activitypub.js +207 -0
  5. package/src/commands/agent-network.js +217 -0
  6. package/src/commands/agent.js +1250 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +203 -0
  9. package/src/commands/browse.js +213 -0
  10. package/src/commands/chat.js +605 -0
  11. package/src/commands/cli-anything.js +426 -0
  12. package/src/commands/codegen.js +207 -0
  13. package/src/commands/collab.js +211 -0
  14. package/src/commands/compliance.js +822 -0
  15. package/src/commands/config.js +213 -0
  16. package/src/commands/cowork.js +1666 -0
  17. package/src/commands/crosschain.js +203 -0
  18. package/src/commands/dao.js +203 -0
  19. package/src/commands/dbevo.js +227 -0
  20. package/src/commands/dev.js +207 -0
  21. package/src/commands/did-v2.js +217 -0
  22. package/src/commands/did.js +221 -0
  23. package/src/commands/dlp.js +213 -0
  24. package/src/commands/economy.js +199 -0
  25. package/src/commands/encrypt.js +201 -0
  26. package/src/commands/evolution.js +199 -0
  27. package/src/commands/evomap.js +830 -0
  28. package/src/commands/export.js +213 -0
  29. package/src/commands/federation.js +209 -0
  30. package/src/commands/fusion.js +205 -0
  31. package/src/commands/governance.js +209 -0
  32. package/src/commands/hmemory.js +203 -0
  33. package/src/commands/hook.js +209 -0
  34. package/src/commands/import.js +209 -0
  35. package/src/commands/inference.js +207 -0
  36. package/src/commands/infra.js +203 -0
  37. package/src/commands/instinct.js +209 -0
  38. package/src/commands/ipfs.js +207 -0
  39. package/src/commands/kg.js +195 -0
  40. package/src/commands/llm.js +426 -0
  41. package/src/commands/matrix.js +207 -0
  42. package/src/commands/mcp.js +217 -0
  43. package/src/commands/memory.js +412 -0
  44. package/src/commands/multimodal.js +203 -0
  45. package/src/commands/nlprog.js +225 -0
  46. package/src/commands/nostr.js +209 -0
  47. package/src/commands/note.js +205 -0
  48. package/src/commands/ops.js +219 -0
  49. package/src/commands/orchestrate.js +406 -0
  50. package/src/commands/org.js +209 -0
  51. package/src/commands/p2p.js +209 -0
  52. package/src/commands/perception.js +209 -0
  53. package/src/commands/permmem.js +203 -0
  54. package/src/commands/pipeline.js +199 -0
  55. package/src/commands/planmode.js +426 -0
  56. package/src/commands/plugin-ecosystem.js +209 -0
  57. package/src/commands/plugin.js +209 -0
  58. package/src/commands/pqc.js +213 -0
  59. package/src/commands/quantization.js +207 -0
  60. package/src/commands/rcache.js +205 -0
  61. package/src/commands/recommend.js +233 -0
  62. package/src/commands/runtime.js +205 -0
  63. package/src/commands/scim.js +209 -0
  64. package/src/commands/services.js +207 -0
  65. package/src/commands/session.js +209 -0
  66. package/src/commands/setup.js +205 -0
  67. package/src/commands/skill.js +414 -0
  68. package/src/commands/social.js +201 -0
  69. package/src/commands/sso.js +209 -0
  70. package/src/commands/start.js +209 -0
  71. package/src/commands/stream.js +213 -0
  72. package/src/commands/sync.js +209 -0
  73. package/src/commands/tech.js +209 -0
  74. package/src/commands/tenant.js +217 -0
  75. package/src/commands/tokens.js +209 -0
  76. package/src/commands/trust.js +217 -0
  77. package/src/commands/ui.js +225 -0
  78. package/src/commands/wallet.js +209 -0
  79. package/src/commands/workflow.js +412 -0
  80. package/src/index.js +252 -0
  81. package/src/lib/a2a-protocol.js +332 -0
  82. package/src/lib/activitypub-bridge.js +334 -0
  83. package/src/lib/agent-coordinator.js +334 -0
  84. package/src/lib/agent-economy.js +334 -0
  85. package/src/lib/agent-network.js +341 -0
  86. package/src/lib/agent-router.js +333 -0
  87. package/src/lib/aiops.js +346 -0
  88. package/src/lib/automation-engine.js +335 -0
  89. package/src/lib/autonomous-agent.js +332 -0
  90. package/src/lib/autonomous-developer.js +332 -0
  91. package/src/lib/bi-engine.js +333 -0
  92. package/src/lib/browser-automation.js +334 -0
  93. package/src/lib/chat-core.js +335 -0
  94. package/src/lib/cli-anything-bridge.js +341 -0
  95. package/src/lib/cli-context-engineering.js +351 -0
  96. package/src/lib/code-agent.js +339 -0
  97. package/src/lib/collaboration-governance.js +334 -0
  98. package/src/lib/community-governance.js +346 -0
  99. package/src/lib/compliance-manager.js +334 -0
  100. package/src/lib/content-recommendation.js +351 -0
  101. package/src/lib/cowork-adapter.js +336 -0
  102. package/src/lib/cowork-evomap-adapter.js +341 -0
  103. package/src/lib/cowork-mcp-tools.js +341 -0
  104. package/src/lib/cowork-observe-html.js +341 -0
  105. package/src/lib/cowork-observe.js +341 -0
  106. package/src/lib/cowork-share.js +338 -0
  107. package/src/lib/cowork-task-templates.js +342 -1
  108. package/src/lib/cowork-template-marketplace.js +340 -0
  109. package/src/lib/cross-chain.js +339 -0
  110. package/src/lib/crypto-manager.js +334 -0
  111. package/src/lib/dao-governance.js +339 -0
  112. package/src/lib/dbevo.js +351 -0
  113. package/src/lib/decentral-infra.js +330 -0
  114. package/src/lib/did-manager.js +341 -0
  115. package/src/lib/did-v2-manager.js +341 -0
  116. package/src/lib/dlp-engine.js +339 -0
  117. package/src/lib/downloader.js +334 -0
  118. package/src/lib/evolution-system.js +334 -0
  119. package/src/lib/evomap-client.js +342 -0
  120. package/src/lib/evomap-federation.js +338 -0
  121. package/src/lib/evomap-governance.js +334 -0
  122. package/src/lib/evomap-manager.js +330 -0
  123. package/src/lib/execution-backend.js +330 -0
  124. package/src/lib/federation-hardening.js +340 -0
  125. package/src/lib/hashline.js +338 -0
  126. package/src/lib/hierarchical-memory.js +334 -0
  127. package/src/lib/hook-manager.js +341 -0
  128. package/src/lib/inference-network.js +341 -0
  129. package/src/lib/instinct-manager.js +346 -0
  130. package/src/lib/interaction-adapter.js +330 -0
  131. package/src/lib/interactive-planner.js +354 -0
  132. package/src/lib/ipfs-storage.js +334 -0
  133. package/src/lib/knowledge-exporter.js +341 -0
  134. package/src/lib/knowledge-graph.js +331 -0
  135. package/src/lib/knowledge-importer.js +341 -0
  136. package/src/lib/llm-providers.js +346 -0
  137. package/src/lib/matrix-bridge.js +339 -0
  138. package/src/lib/mcp-registry.js +346 -0
  139. package/src/lib/memory-manager.js +336 -0
  140. package/src/lib/multimodal.js +330 -0
  141. package/src/lib/nl-programming.js +341 -0
  142. package/src/lib/nostr-bridge.js +336 -0
  143. package/src/lib/note-versioning.js +339 -0
  144. package/src/lib/org-manager.js +336 -0
  145. package/src/lib/p2p-manager.js +341 -0
  146. package/src/lib/perception.js +346 -0
  147. package/src/lib/permanent-memory.js +327 -0
  148. package/src/lib/pipeline-orchestrator.js +332 -0
  149. package/src/lib/plan-mode.js +336 -0
  150. package/src/lib/plugin-autodiscovery.js +334 -0
  151. package/src/lib/plugin-ecosystem.js +346 -0
  152. package/src/lib/pqc-manager.js +346 -0
  153. package/src/lib/process-manager.js +336 -0
  154. package/src/lib/protocol-fusion.js +338 -0
  155. package/src/lib/provider-options.js +346 -0
  156. package/src/lib/provider-stream.js +348 -0
  157. package/src/lib/quantization.js +337 -0
  158. package/src/lib/response-cache.js +333 -0
  159. package/src/lib/scim-manager.js +346 -0
  160. package/src/lib/service-manager.js +337 -0
  161. package/src/lib/session-core-singletons.js +341 -0
  162. package/src/lib/session-manager.js +334 -0
  163. package/src/lib/skill-loader.js +334 -0
  164. package/src/lib/skill-mcp.js +336 -0
  165. package/src/lib/social-manager.js +330 -0
  166. package/src/lib/sso-manager.js +340 -0
  167. package/src/lib/stix-parser.js +346 -0
  168. package/src/lib/sub-agent-context.js +343 -0
  169. package/src/lib/sub-agent-profiles.js +335 -0
  170. package/src/lib/sub-agent-registry.js +336 -0
  171. package/src/lib/sync-manager.js +336 -0
  172. package/src/lib/tech-learning-engine.js +341 -0
  173. package/src/lib/tenant-saas.js +341 -0
  174. package/src/lib/threat-intel.js +330 -0
  175. package/src/lib/todo-manager.js +336 -0
  176. package/src/lib/token-tracker.js +336 -0
  177. package/src/lib/trust-security.js +343 -0
  178. package/src/lib/ueba.js +340 -0
  179. package/src/lib/universal-runtime.js +330 -0
  180. package/src/lib/wallet-manager.js +336 -0
  181. package/src/lib/web-ui-server.js +348 -0
  182. package/src/lib/workflow-engine.js +330 -0
  183. package/src/lib/workflow-expr.js +346 -0
  184. package/src/lib/ws-chat-handler.js +337 -0
@@ -691,3 +691,212 @@ export function registerWalletCommand(program) {
691
691
  console.log(JSON.stringify(autoFailStuckTxV2(), null, 2));
692
692
  });
693
693
  }
694
+
695
+ // === Iter20 V2 governance overlay ===
696
+ export function registerWalgovV2Commands(program) {
697
+ const parent = program.commands.find((c) => c.name() === "wallet");
698
+ if (!parent) return;
699
+ const L = async () => await import("../lib/wallet-manager.js");
700
+ parent
701
+ .command("walgov-enums-v2")
702
+ .description("Show V2 enums")
703
+ .action(async () => {
704
+ const m = await L();
705
+ console.log(
706
+ JSON.stringify(
707
+ {
708
+ profileMaturity: m.WALGOV_PROFILE_MATURITY_V2,
709
+ transferLifecycle: m.WALGOV_TRANSFER_LIFECYCLE_V2,
710
+ },
711
+ null,
712
+ 2,
713
+ ),
714
+ );
715
+ });
716
+ parent
717
+ .command("walgov-config-v2")
718
+ .description("Show V2 config")
719
+ .action(async () => {
720
+ const m = await L();
721
+ console.log(
722
+ JSON.stringify(
723
+ {
724
+ maxActive: m.getMaxActiveWalgovProfilesPerOwnerV2(),
725
+ maxPending: m.getMaxPendingWalgovTransfersPerProfileV2(),
726
+ idleMs: m.getWalgovProfileIdleMsV2(),
727
+ stuckMs: m.getWalgovTransferStuckMsV2(),
728
+ },
729
+ null,
730
+ 2,
731
+ ),
732
+ );
733
+ });
734
+ parent
735
+ .command("walgov-set-max-active-v2 <n>")
736
+ .description("Set max active")
737
+ .action(async (n) => {
738
+ (await L()).setMaxActiveWalgovProfilesPerOwnerV2(Number(n));
739
+ console.log("ok");
740
+ });
741
+ parent
742
+ .command("walgov-set-max-pending-v2 <n>")
743
+ .description("Set max pending")
744
+ .action(async (n) => {
745
+ (await L()).setMaxPendingWalgovTransfersPerProfileV2(Number(n));
746
+ console.log("ok");
747
+ });
748
+ parent
749
+ .command("walgov-set-idle-ms-v2 <n>")
750
+ .description("Set idle threshold ms")
751
+ .action(async (n) => {
752
+ (await L()).setWalgovProfileIdleMsV2(Number(n));
753
+ console.log("ok");
754
+ });
755
+ parent
756
+ .command("walgov-set-stuck-ms-v2 <n>")
757
+ .description("Set stuck threshold ms")
758
+ .action(async (n) => {
759
+ (await L()).setWalgovTransferStuckMsV2(Number(n));
760
+ console.log("ok");
761
+ });
762
+ parent
763
+ .command("walgov-register-v2 <id> <owner>")
764
+ .description("Register V2 profile")
765
+ .option("--chain <v>", "chain")
766
+ .action(async (id, owner, o) => {
767
+ const m = await L();
768
+ console.log(
769
+ JSON.stringify(
770
+ m.registerWalgovProfileV2({ id, owner, chain: o.chain }),
771
+ null,
772
+ 2,
773
+ ),
774
+ );
775
+ });
776
+ parent
777
+ .command("walgov-activate-v2 <id>")
778
+ .description("Activate profile")
779
+ .action(async (id) => {
780
+ console.log(
781
+ JSON.stringify((await L()).activateWalgovProfileV2(id), null, 2),
782
+ );
783
+ });
784
+ parent
785
+ .command("walgov-freeze-v2 <id>")
786
+ .description("Freeze profile")
787
+ .action(async (id) => {
788
+ console.log(
789
+ JSON.stringify((await L()).freezeWalgovProfileV2(id), null, 2),
790
+ );
791
+ });
792
+ parent
793
+ .command("walgov-archive-v2 <id>")
794
+ .description("Archive profile")
795
+ .action(async (id) => {
796
+ console.log(
797
+ JSON.stringify((await L()).archiveWalgovProfileV2(id), null, 2),
798
+ );
799
+ });
800
+ parent
801
+ .command("walgov-touch-v2 <id>")
802
+ .description("Touch profile")
803
+ .action(async (id) => {
804
+ console.log(
805
+ JSON.stringify((await L()).touchWalgovProfileV2(id), null, 2),
806
+ );
807
+ });
808
+ parent
809
+ .command("walgov-get-v2 <id>")
810
+ .description("Get profile")
811
+ .action(async (id) => {
812
+ console.log(JSON.stringify((await L()).getWalgovProfileV2(id), null, 2));
813
+ });
814
+ parent
815
+ .command("walgov-list-v2")
816
+ .description("List profiles")
817
+ .action(async () => {
818
+ console.log(JSON.stringify((await L()).listWalgovProfilesV2(), null, 2));
819
+ });
820
+ parent
821
+ .command("walgov-create-transfer-v2 <id> <profileId>")
822
+ .description("Create transfer")
823
+ .option("--to <v>", "to")
824
+ .action(async (id, profileId, o) => {
825
+ const m = await L();
826
+ console.log(
827
+ JSON.stringify(
828
+ m.createWalgovTransferV2({ id, profileId, to: o.to }),
829
+ null,
830
+ 2,
831
+ ),
832
+ );
833
+ });
834
+ parent
835
+ .command("walgov-signing-transfer-v2 <id>")
836
+ .description("Mark transfer as signing")
837
+ .action(async (id) => {
838
+ console.log(
839
+ JSON.stringify((await L()).signingWalgovTransferV2(id), null, 2),
840
+ );
841
+ });
842
+ parent
843
+ .command("walgov-complete-transfer-v2 <id>")
844
+ .description("Complete transfer")
845
+ .action(async (id) => {
846
+ console.log(
847
+ JSON.stringify((await L()).completeTransferWalgovV2(id), null, 2),
848
+ );
849
+ });
850
+ parent
851
+ .command("walgov-fail-transfer-v2 <id> [reason]")
852
+ .description("Fail transfer")
853
+ .action(async (id, reason) => {
854
+ console.log(
855
+ JSON.stringify((await L()).failWalgovTransferV2(id, reason), null, 2),
856
+ );
857
+ });
858
+ parent
859
+ .command("walgov-cancel-transfer-v2 <id> [reason]")
860
+ .description("Cancel transfer")
861
+ .action(async (id, reason) => {
862
+ console.log(
863
+ JSON.stringify((await L()).cancelWalgovTransferV2(id, reason), null, 2),
864
+ );
865
+ });
866
+ parent
867
+ .command("walgov-get-transfer-v2 <id>")
868
+ .description("Get transfer")
869
+ .action(async (id) => {
870
+ console.log(JSON.stringify((await L()).getWalgovTransferV2(id), null, 2));
871
+ });
872
+ parent
873
+ .command("walgov-list-transfers-v2")
874
+ .description("List transfers")
875
+ .action(async () => {
876
+ console.log(JSON.stringify((await L()).listWalgovTransfersV2(), null, 2));
877
+ });
878
+ parent
879
+ .command("walgov-auto-freeze-idle-v2")
880
+ .description("Auto-freeze idle")
881
+ .action(async () => {
882
+ console.log(
883
+ JSON.stringify((await L()).autoFreezeIdleWalgovProfilesV2(), null, 2),
884
+ );
885
+ });
886
+ parent
887
+ .command("walgov-auto-fail-stuck-v2")
888
+ .description("Auto-fail stuck transfers")
889
+ .action(async () => {
890
+ console.log(
891
+ JSON.stringify((await L()).autoFailStuckWalgovTransfersV2(), null, 2),
892
+ );
893
+ });
894
+ parent
895
+ .command("walgov-gov-stats-v2")
896
+ .description("V2 gov stats")
897
+ .action(async () => {
898
+ console.log(
899
+ JSON.stringify((await L()).getWalletManagerGovStatsV2(), null, 2),
900
+ );
901
+ });
902
+ }
@@ -848,3 +848,415 @@ export function registerWorkflowCommand(program) {
848
848
  .description("V2 auto-fail stuck")
849
849
  .action(() => _v2json(autoFailStuckRunsV2()));
850
850
  }
851
+
852
+ // === Iter21 V2 governance overlay ===
853
+ export function registerWfgovV2Commands(program) {
854
+ const parent = program.commands.find((c) => c.name() === "workflow");
855
+ if (!parent) return;
856
+ const L = async () => await import("../lib/workflow-engine.js");
857
+ parent
858
+ .command("wfgov-enums-v2")
859
+ .description("Show V2 enums")
860
+ .action(async () => {
861
+ const m = await L();
862
+ console.log(
863
+ JSON.stringify(
864
+ {
865
+ profileMaturity: m.WFGOV_PROFILE_MATURITY_V2,
866
+ stepLifecycle: m.WFGOV_STEP_LIFECYCLE_V2,
867
+ },
868
+ null,
869
+ 2,
870
+ ),
871
+ );
872
+ });
873
+ parent
874
+ .command("wfgov-config-v2")
875
+ .description("Show V2 config")
876
+ .action(async () => {
877
+ const m = await L();
878
+ console.log(
879
+ JSON.stringify(
880
+ {
881
+ maxActive: m.getMaxActiveWfgovProfilesPerOwnerV2(),
882
+ maxPending: m.getMaxPendingWfgovStepsPerProfileV2(),
883
+ idleMs: m.getWfgovProfileIdleMsV2(),
884
+ stuckMs: m.getWfgovStepStuckMsV2(),
885
+ },
886
+ null,
887
+ 2,
888
+ ),
889
+ );
890
+ });
891
+ parent
892
+ .command("wfgov-set-max-active-v2 <n>")
893
+ .description("Set max active")
894
+ .action(async (n) => {
895
+ (await L()).setMaxActiveWfgovProfilesPerOwnerV2(Number(n));
896
+ console.log("ok");
897
+ });
898
+ parent
899
+ .command("wfgov-set-max-pending-v2 <n>")
900
+ .description("Set max pending")
901
+ .action(async (n) => {
902
+ (await L()).setMaxPendingWfgovStepsPerProfileV2(Number(n));
903
+ console.log("ok");
904
+ });
905
+ parent
906
+ .command("wfgov-set-idle-ms-v2 <n>")
907
+ .description("Set idle threshold ms")
908
+ .action(async (n) => {
909
+ (await L()).setWfgovProfileIdleMsV2(Number(n));
910
+ console.log("ok");
911
+ });
912
+ parent
913
+ .command("wfgov-set-stuck-ms-v2 <n>")
914
+ .description("Set stuck threshold ms")
915
+ .action(async (n) => {
916
+ (await L()).setWfgovStepStuckMsV2(Number(n));
917
+ console.log("ok");
918
+ });
919
+ parent
920
+ .command("wfgov-register-v2 <id> <owner>")
921
+ .description("Register V2 profile")
922
+ .option("--kind <v>", "kind")
923
+ .action(async (id, owner, o) => {
924
+ const m = await L();
925
+ console.log(
926
+ JSON.stringify(
927
+ m.registerWfgovProfileV2({ id, owner, kind: o.kind }),
928
+ null,
929
+ 2,
930
+ ),
931
+ );
932
+ });
933
+ parent
934
+ .command("wfgov-activate-v2 <id>")
935
+ .description("Activate profile")
936
+ .action(async (id) => {
937
+ console.log(
938
+ JSON.stringify((await L()).activateWfgovProfileV2(id), null, 2),
939
+ );
940
+ });
941
+ parent
942
+ .command("wfgov-pause-v2 <id>")
943
+ .description("Pause profile")
944
+ .action(async (id) => {
945
+ console.log(JSON.stringify((await L()).pauseWfgovProfileV2(id), null, 2));
946
+ });
947
+ parent
948
+ .command("wfgov-archive-v2 <id>")
949
+ .description("Archive profile")
950
+ .action(async (id) => {
951
+ console.log(
952
+ JSON.stringify((await L()).archiveWfgovProfileV2(id), null, 2),
953
+ );
954
+ });
955
+ parent
956
+ .command("wfgov-touch-v2 <id>")
957
+ .description("Touch profile")
958
+ .action(async (id) => {
959
+ console.log(JSON.stringify((await L()).touchWfgovProfileV2(id), null, 2));
960
+ });
961
+ parent
962
+ .command("wfgov-get-v2 <id>")
963
+ .description("Get profile")
964
+ .action(async (id) => {
965
+ console.log(JSON.stringify((await L()).getWfgovProfileV2(id), null, 2));
966
+ });
967
+ parent
968
+ .command("wfgov-list-v2")
969
+ .description("List profiles")
970
+ .action(async () => {
971
+ console.log(JSON.stringify((await L()).listWfgovProfilesV2(), null, 2));
972
+ });
973
+ parent
974
+ .command("wfgov-create-step-v2 <id> <profileId>")
975
+ .description("Create step")
976
+ .option("--stepName <v>", "stepName")
977
+ .action(async (id, profileId, o) => {
978
+ const m = await L();
979
+ console.log(
980
+ JSON.stringify(
981
+ m.createWfgovStepV2({ id, profileId, stepName: o.stepName }),
982
+ null,
983
+ 2,
984
+ ),
985
+ );
986
+ });
987
+ parent
988
+ .command("wfgov-executing-step-v2 <id>")
989
+ .description("Mark step as executing")
990
+ .action(async (id) => {
991
+ console.log(
992
+ JSON.stringify((await L()).executingWfgovStepV2(id), null, 2),
993
+ );
994
+ });
995
+ parent
996
+ .command("wfgov-complete-step-v2 <id>")
997
+ .description("Complete step")
998
+ .action(async (id) => {
999
+ console.log(JSON.stringify((await L()).completeStepWfgovV2(id), null, 2));
1000
+ });
1001
+ parent
1002
+ .command("wfgov-fail-step-v2 <id> [reason]")
1003
+ .description("Fail step")
1004
+ .action(async (id, reason) => {
1005
+ console.log(
1006
+ JSON.stringify((await L()).failWfgovStepV2(id, reason), null, 2),
1007
+ );
1008
+ });
1009
+ parent
1010
+ .command("wfgov-cancel-step-v2 <id> [reason]")
1011
+ .description("Cancel step")
1012
+ .action(async (id, reason) => {
1013
+ console.log(
1014
+ JSON.stringify((await L()).cancelWfgovStepV2(id, reason), null, 2),
1015
+ );
1016
+ });
1017
+ parent
1018
+ .command("wfgov-get-step-v2 <id>")
1019
+ .description("Get step")
1020
+ .action(async (id) => {
1021
+ console.log(JSON.stringify((await L()).getWfgovStepV2(id), null, 2));
1022
+ });
1023
+ parent
1024
+ .command("wfgov-list-steps-v2")
1025
+ .description("List steps")
1026
+ .action(async () => {
1027
+ console.log(JSON.stringify((await L()).listWfgovStepsV2(), null, 2));
1028
+ });
1029
+ parent
1030
+ .command("wfgov-auto-pause-idle-v2")
1031
+ .description("Auto-pause idle")
1032
+ .action(async () => {
1033
+ console.log(
1034
+ JSON.stringify((await L()).autoPauseIdleWfgovProfilesV2(), null, 2),
1035
+ );
1036
+ });
1037
+ parent
1038
+ .command("wfgov-auto-fail-stuck-v2")
1039
+ .description("Auto-fail stuck steps")
1040
+ .action(async () => {
1041
+ console.log(
1042
+ JSON.stringify((await L()).autoFailStuckWfgovStepsV2(), null, 2),
1043
+ );
1044
+ });
1045
+ parent
1046
+ .command("wfgov-gov-stats-v2")
1047
+ .description("V2 gov stats")
1048
+ .action(async () => {
1049
+ console.log(
1050
+ JSON.stringify((await L()).getWorkflowEngineGovStatsV2(), null, 2),
1051
+ );
1052
+ });
1053
+ }
1054
+
1055
+ // === Iter26 V2 governance overlay ===
1056
+ export function registerWfexgovV2Commands(program) {
1057
+ const parent = program.commands.find((c) => c.name() === "workflow");
1058
+ if (!parent) return;
1059
+ const L = async () => await import("../lib/workflow-expr.js");
1060
+ parent
1061
+ .command("wfexgov-enums-v2")
1062
+ .description("Show V2 enums")
1063
+ .action(async () => {
1064
+ const m = await L();
1065
+ console.log(
1066
+ JSON.stringify(
1067
+ {
1068
+ profileMaturity: m.WFEXGOV_PROFILE_MATURITY_V2,
1069
+ evalLifecycle: m.WFEXGOV_EVAL_LIFECYCLE_V2,
1070
+ },
1071
+ null,
1072
+ 2,
1073
+ ),
1074
+ );
1075
+ });
1076
+ parent
1077
+ .command("wfexgov-config-v2")
1078
+ .description("Show V2 config")
1079
+ .action(async () => {
1080
+ const m = await L();
1081
+ console.log(
1082
+ JSON.stringify(
1083
+ {
1084
+ maxActive: m.getMaxActiveWfexgovProfilesPerOwnerV2(),
1085
+ maxPending: m.getMaxPendingWfexgovEvalsPerProfileV2(),
1086
+ idleMs: m.getWfexgovProfileIdleMsV2(),
1087
+ stuckMs: m.getWfexgovEvalStuckMsV2(),
1088
+ },
1089
+ null,
1090
+ 2,
1091
+ ),
1092
+ );
1093
+ });
1094
+ parent
1095
+ .command("wfexgov-set-max-active-v2 <n>")
1096
+ .description("Set max active")
1097
+ .action(async (n) => {
1098
+ (await L()).setMaxActiveWfexgovProfilesPerOwnerV2(Number(n));
1099
+ console.log("ok");
1100
+ });
1101
+ parent
1102
+ .command("wfexgov-set-max-pending-v2 <n>")
1103
+ .description("Set max pending")
1104
+ .action(async (n) => {
1105
+ (await L()).setMaxPendingWfexgovEvalsPerProfileV2(Number(n));
1106
+ console.log("ok");
1107
+ });
1108
+ parent
1109
+ .command("wfexgov-set-idle-ms-v2 <n>")
1110
+ .description("Set idle threshold ms")
1111
+ .action(async (n) => {
1112
+ (await L()).setWfexgovProfileIdleMsV2(Number(n));
1113
+ console.log("ok");
1114
+ });
1115
+ parent
1116
+ .command("wfexgov-set-stuck-ms-v2 <n>")
1117
+ .description("Set stuck threshold ms")
1118
+ .action(async (n) => {
1119
+ (await L()).setWfexgovEvalStuckMsV2(Number(n));
1120
+ console.log("ok");
1121
+ });
1122
+ parent
1123
+ .command("wfexgov-register-v2 <id> <owner>")
1124
+ .description("Register V2 profile")
1125
+ .option("--language <v>", "language")
1126
+ .action(async (id, owner, o) => {
1127
+ const m = await L();
1128
+ console.log(
1129
+ JSON.stringify(
1130
+ m.registerWfexgovProfileV2({ id, owner, language: o.language }),
1131
+ null,
1132
+ 2,
1133
+ ),
1134
+ );
1135
+ });
1136
+ parent
1137
+ .command("wfexgov-activate-v2 <id>")
1138
+ .description("Activate profile")
1139
+ .action(async (id) => {
1140
+ console.log(
1141
+ JSON.stringify((await L()).activateWfexgovProfileV2(id), null, 2),
1142
+ );
1143
+ });
1144
+ parent
1145
+ .command("wfexgov-pause-v2 <id>")
1146
+ .description("Pause profile")
1147
+ .action(async (id) => {
1148
+ console.log(
1149
+ JSON.stringify((await L()).pauseWfexgovProfileV2(id), null, 2),
1150
+ );
1151
+ });
1152
+ parent
1153
+ .command("wfexgov-archive-v2 <id>")
1154
+ .description("Archive profile")
1155
+ .action(async (id) => {
1156
+ console.log(
1157
+ JSON.stringify((await L()).archiveWfexgovProfileV2(id), null, 2),
1158
+ );
1159
+ });
1160
+ parent
1161
+ .command("wfexgov-touch-v2 <id>")
1162
+ .description("Touch profile")
1163
+ .action(async (id) => {
1164
+ console.log(
1165
+ JSON.stringify((await L()).touchWfexgovProfileV2(id), null, 2),
1166
+ );
1167
+ });
1168
+ parent
1169
+ .command("wfexgov-get-v2 <id>")
1170
+ .description("Get profile")
1171
+ .action(async (id) => {
1172
+ console.log(JSON.stringify((await L()).getWfexgovProfileV2(id), null, 2));
1173
+ });
1174
+ parent
1175
+ .command("wfexgov-list-v2")
1176
+ .description("List profiles")
1177
+ .action(async () => {
1178
+ console.log(JSON.stringify((await L()).listWfexgovProfilesV2(), null, 2));
1179
+ });
1180
+ parent
1181
+ .command("wfexgov-create-eval-v2 <id> <profileId>")
1182
+ .description("Create eval")
1183
+ .option("--expression <v>", "expression")
1184
+ .action(async (id, profileId, o) => {
1185
+ const m = await L();
1186
+ console.log(
1187
+ JSON.stringify(
1188
+ m.createWfexgovEvalV2({ id, profileId, expression: o.expression }),
1189
+ null,
1190
+ 2,
1191
+ ),
1192
+ );
1193
+ });
1194
+ parent
1195
+ .command("wfexgov-evaluating-eval-v2 <id>")
1196
+ .description("Mark eval as evaluating")
1197
+ .action(async (id) => {
1198
+ console.log(
1199
+ JSON.stringify((await L()).evaluatingWfexgovEvalV2(id), null, 2),
1200
+ );
1201
+ });
1202
+ parent
1203
+ .command("wfexgov-complete-eval-v2 <id>")
1204
+ .description("Complete eval")
1205
+ .action(async (id) => {
1206
+ console.log(
1207
+ JSON.stringify((await L()).completeEvalWfexgovV2(id), null, 2),
1208
+ );
1209
+ });
1210
+ parent
1211
+ .command("wfexgov-fail-eval-v2 <id> [reason]")
1212
+ .description("Fail eval")
1213
+ .action(async (id, reason) => {
1214
+ console.log(
1215
+ JSON.stringify((await L()).failWfexgovEvalV2(id, reason), null, 2),
1216
+ );
1217
+ });
1218
+ parent
1219
+ .command("wfexgov-cancel-eval-v2 <id> [reason]")
1220
+ .description("Cancel eval")
1221
+ .action(async (id, reason) => {
1222
+ console.log(
1223
+ JSON.stringify((await L()).cancelWfexgovEvalV2(id, reason), null, 2),
1224
+ );
1225
+ });
1226
+ parent
1227
+ .command("wfexgov-get-eval-v2 <id>")
1228
+ .description("Get eval")
1229
+ .action(async (id) => {
1230
+ console.log(JSON.stringify((await L()).getWfexgovEvalV2(id), null, 2));
1231
+ });
1232
+ parent
1233
+ .command("wfexgov-list-evals-v2")
1234
+ .description("List evals")
1235
+ .action(async () => {
1236
+ console.log(JSON.stringify((await L()).listWfexgovEvalsV2(), null, 2));
1237
+ });
1238
+ parent
1239
+ .command("wfexgov-auto-pause-idle-v2")
1240
+ .description("Auto-pause idle")
1241
+ .action(async () => {
1242
+ console.log(
1243
+ JSON.stringify((await L()).autoPauseIdleWfexgovProfilesV2(), null, 2),
1244
+ );
1245
+ });
1246
+ parent
1247
+ .command("wfexgov-auto-fail-stuck-v2")
1248
+ .description("Auto-fail stuck evals")
1249
+ .action(async () => {
1250
+ console.log(
1251
+ JSON.stringify((await L()).autoFailStuckWfexgovEvalsV2(), null, 2),
1252
+ );
1253
+ });
1254
+ parent
1255
+ .command("wfexgov-gov-stats-v2")
1256
+ .description("V2 gov stats")
1257
+ .action(async () => {
1258
+ console.log(
1259
+ JSON.stringify((await L()).getWorkflowExprGovStatsV2(), null, 2),
1260
+ );
1261
+ });
1262
+ }