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
@@ -922,3 +922,204 @@ function _wire(root) {
922
922
  .description("Auto-fail stuck V2 executions")
923
923
  .action(() => outV2(autoFailStuckExecutionsV2()));
924
924
  }
925
+
926
+ // === Iter22 V2 governance overlay ===
927
+ export function registerAugovV2Commands(program) {
928
+ const parent = program.commands.find((c) => c.name() === "automation");
929
+ if (!parent) return;
930
+ const L = async () => await import("../lib/automation-engine.js");
931
+ parent
932
+ .command("augov-enums-v2")
933
+ .description("Show V2 enums")
934
+ .action(async () => {
935
+ const m = await L();
936
+ console.log(
937
+ JSON.stringify(
938
+ {
939
+ profileMaturity: m.AUGOV_PROFILE_MATURITY_V2,
940
+ flowLifecycle: m.AUGOV_FLOW_LIFECYCLE_V2,
941
+ },
942
+ null,
943
+ 2,
944
+ ),
945
+ );
946
+ });
947
+ parent
948
+ .command("augov-config-v2")
949
+ .description("Show V2 config")
950
+ .action(async () => {
951
+ const m = await L();
952
+ console.log(
953
+ JSON.stringify(
954
+ {
955
+ maxActive: m.getMaxActiveAugovProfilesPerOwnerV2(),
956
+ maxPending: m.getMaxPendingAugovFlowsPerProfileV2(),
957
+ idleMs: m.getAugovProfileIdleMsV2(),
958
+ stuckMs: m.getAugovFlowStuckMsV2(),
959
+ },
960
+ null,
961
+ 2,
962
+ ),
963
+ );
964
+ });
965
+ parent
966
+ .command("augov-set-max-active-v2 <n>")
967
+ .description("Set max active")
968
+ .action(async (n) => {
969
+ (await L()).setMaxActiveAugovProfilesPerOwnerV2(Number(n));
970
+ console.log("ok");
971
+ });
972
+ parent
973
+ .command("augov-set-max-pending-v2 <n>")
974
+ .description("Set max pending")
975
+ .action(async (n) => {
976
+ (await L()).setMaxPendingAugovFlowsPerProfileV2(Number(n));
977
+ console.log("ok");
978
+ });
979
+ parent
980
+ .command("augov-set-idle-ms-v2 <n>")
981
+ .description("Set idle threshold ms")
982
+ .action(async (n) => {
983
+ (await L()).setAugovProfileIdleMsV2(Number(n));
984
+ console.log("ok");
985
+ });
986
+ parent
987
+ .command("augov-set-stuck-ms-v2 <n>")
988
+ .description("Set stuck threshold ms")
989
+ .action(async (n) => {
990
+ (await L()).setAugovFlowStuckMsV2(Number(n));
991
+ console.log("ok");
992
+ });
993
+ parent
994
+ .command("augov-register-v2 <id> <owner>")
995
+ .description("Register V2 profile")
996
+ .option("--connector <v>", "connector")
997
+ .action(async (id, owner, o) => {
998
+ const m = await L();
999
+ console.log(
1000
+ JSON.stringify(
1001
+ m.registerAugovProfileV2({ id, owner, connector: o.connector }),
1002
+ null,
1003
+ 2,
1004
+ ),
1005
+ );
1006
+ });
1007
+ parent
1008
+ .command("augov-activate-v2 <id>")
1009
+ .description("Activate profile")
1010
+ .action(async (id) => {
1011
+ console.log(
1012
+ JSON.stringify((await L()).activateAugovProfileV2(id), null, 2),
1013
+ );
1014
+ });
1015
+ parent
1016
+ .command("augov-pause-v2 <id>")
1017
+ .description("Pause profile")
1018
+ .action(async (id) => {
1019
+ console.log(JSON.stringify((await L()).pauseAugovProfileV2(id), null, 2));
1020
+ });
1021
+ parent
1022
+ .command("augov-archive-v2 <id>")
1023
+ .description("Archive profile")
1024
+ .action(async (id) => {
1025
+ console.log(
1026
+ JSON.stringify((await L()).archiveAugovProfileV2(id), null, 2),
1027
+ );
1028
+ });
1029
+ parent
1030
+ .command("augov-touch-v2 <id>")
1031
+ .description("Touch profile")
1032
+ .action(async (id) => {
1033
+ console.log(JSON.stringify((await L()).touchAugovProfileV2(id), null, 2));
1034
+ });
1035
+ parent
1036
+ .command("augov-get-v2 <id>")
1037
+ .description("Get profile")
1038
+ .action(async (id) => {
1039
+ console.log(JSON.stringify((await L()).getAugovProfileV2(id), null, 2));
1040
+ });
1041
+ parent
1042
+ .command("augov-list-v2")
1043
+ .description("List profiles")
1044
+ .action(async () => {
1045
+ console.log(JSON.stringify((await L()).listAugovProfilesV2(), null, 2));
1046
+ });
1047
+ parent
1048
+ .command("augov-create-flow-v2 <id> <profileId>")
1049
+ .description("Create flow")
1050
+ .option("--trigger <v>", "trigger")
1051
+ .action(async (id, profileId, o) => {
1052
+ const m = await L();
1053
+ console.log(
1054
+ JSON.stringify(
1055
+ m.createAugovFlowV2({ id, profileId, trigger: o.trigger }),
1056
+ null,
1057
+ 2,
1058
+ ),
1059
+ );
1060
+ });
1061
+ parent
1062
+ .command("augov-running-flow-v2 <id>")
1063
+ .description("Mark flow as running")
1064
+ .action(async (id) => {
1065
+ console.log(JSON.stringify((await L()).runningAugovFlowV2(id), null, 2));
1066
+ });
1067
+ parent
1068
+ .command("augov-complete-flow-v2 <id>")
1069
+ .description("Complete flow")
1070
+ .action(async (id) => {
1071
+ console.log(JSON.stringify((await L()).completeFlowAugovV2(id), null, 2));
1072
+ });
1073
+ parent
1074
+ .command("augov-fail-flow-v2 <id> [reason]")
1075
+ .description("Fail flow")
1076
+ .action(async (id, reason) => {
1077
+ console.log(
1078
+ JSON.stringify((await L()).failAugovFlowV2(id, reason), null, 2),
1079
+ );
1080
+ });
1081
+ parent
1082
+ .command("augov-cancel-flow-v2 <id> [reason]")
1083
+ .description("Cancel flow")
1084
+ .action(async (id, reason) => {
1085
+ console.log(
1086
+ JSON.stringify((await L()).cancelAugovFlowV2(id, reason), null, 2),
1087
+ );
1088
+ });
1089
+ parent
1090
+ .command("augov-get-flow-v2 <id>")
1091
+ .description("Get flow")
1092
+ .action(async (id) => {
1093
+ console.log(JSON.stringify((await L()).getAugovFlowV2(id), null, 2));
1094
+ });
1095
+ parent
1096
+ .command("augov-list-flows-v2")
1097
+ .description("List flows")
1098
+ .action(async () => {
1099
+ console.log(JSON.stringify((await L()).listAugovFlowsV2(), null, 2));
1100
+ });
1101
+ parent
1102
+ .command("augov-auto-pause-idle-v2")
1103
+ .description("Auto-pause idle")
1104
+ .action(async () => {
1105
+ console.log(
1106
+ JSON.stringify((await L()).autoPauseIdleAugovProfilesV2(), null, 2),
1107
+ );
1108
+ });
1109
+ parent
1110
+ .command("augov-auto-fail-stuck-v2")
1111
+ .description("Auto-fail stuck flows")
1112
+ .action(async () => {
1113
+ console.log(
1114
+ JSON.stringify((await L()).autoFailStuckAugovFlowsV2(), null, 2),
1115
+ );
1116
+ });
1117
+ parent
1118
+ .command("augov-gov-stats-v2")
1119
+ .description("V2 gov stats")
1120
+ .action(async () => {
1121
+ console.log(
1122
+ JSON.stringify((await L()).getAutomationEngineGovStatsV2(), null, 2),
1123
+ );
1124
+ });
1125
+ }
@@ -772,3 +772,206 @@ export function registerBiV2Command(bi) {
772
772
  console.log(JSON.stringify(getBiEngineStatsV2(), null, 2));
773
773
  });
774
774
  }
775
+
776
+ // === Iter21 V2 governance overlay ===
777
+ export function registerBigovV2Commands(program) {
778
+ const parent = program.commands.find((c) => c.name() === "bi");
779
+ if (!parent) return;
780
+ const L = async () => await import("../lib/bi-engine.js");
781
+ parent
782
+ .command("bigov-enums-v2")
783
+ .description("Show V2 enums")
784
+ .action(async () => {
785
+ const m = await L();
786
+ console.log(
787
+ JSON.stringify(
788
+ {
789
+ profileMaturity: m.BIGOV_PROFILE_MATURITY_V2,
790
+ queryLifecycle: m.BIGOV_QUERY_LIFECYCLE_V2,
791
+ },
792
+ null,
793
+ 2,
794
+ ),
795
+ );
796
+ });
797
+ parent
798
+ .command("bigov-config-v2")
799
+ .description("Show V2 config")
800
+ .action(async () => {
801
+ const m = await L();
802
+ console.log(
803
+ JSON.stringify(
804
+ {
805
+ maxActive: m.getMaxActiveBigovProfilesPerOwnerV2(),
806
+ maxPending: m.getMaxPendingBigovQuerysPerProfileV2(),
807
+ idleMs: m.getBigovProfileIdleMsV2(),
808
+ stuckMs: m.getBigovQueryStuckMsV2(),
809
+ },
810
+ null,
811
+ 2,
812
+ ),
813
+ );
814
+ });
815
+ parent
816
+ .command("bigov-set-max-active-v2 <n>")
817
+ .description("Set max active")
818
+ .action(async (n) => {
819
+ (await L()).setMaxActiveBigovProfilesPerOwnerV2(Number(n));
820
+ console.log("ok");
821
+ });
822
+ parent
823
+ .command("bigov-set-max-pending-v2 <n>")
824
+ .description("Set max pending")
825
+ .action(async (n) => {
826
+ (await L()).setMaxPendingBigovQuerysPerProfileV2(Number(n));
827
+ console.log("ok");
828
+ });
829
+ parent
830
+ .command("bigov-set-idle-ms-v2 <n>")
831
+ .description("Set idle threshold ms")
832
+ .action(async (n) => {
833
+ (await L()).setBigovProfileIdleMsV2(Number(n));
834
+ console.log("ok");
835
+ });
836
+ parent
837
+ .command("bigov-set-stuck-ms-v2 <n>")
838
+ .description("Set stuck threshold ms")
839
+ .action(async (n) => {
840
+ (await L()).setBigovQueryStuckMsV2(Number(n));
841
+ console.log("ok");
842
+ });
843
+ parent
844
+ .command("bigov-register-v2 <id> <owner>")
845
+ .description("Register V2 profile")
846
+ .option("--dataset <v>", "dataset")
847
+ .action(async (id, owner, o) => {
848
+ const m = await L();
849
+ console.log(
850
+ JSON.stringify(
851
+ m.registerBigovProfileV2({ id, owner, dataset: o.dataset }),
852
+ null,
853
+ 2,
854
+ ),
855
+ );
856
+ });
857
+ parent
858
+ .command("bigov-activate-v2 <id>")
859
+ .description("Activate profile")
860
+ .action(async (id) => {
861
+ console.log(
862
+ JSON.stringify((await L()).activateBigovProfileV2(id), null, 2),
863
+ );
864
+ });
865
+ parent
866
+ .command("bigov-stale-v2 <id>")
867
+ .description("Stale profile")
868
+ .action(async (id) => {
869
+ console.log(JSON.stringify((await L()).staleBigovProfileV2(id), null, 2));
870
+ });
871
+ parent
872
+ .command("bigov-archive-v2 <id>")
873
+ .description("Archive profile")
874
+ .action(async (id) => {
875
+ console.log(
876
+ JSON.stringify((await L()).archiveBigovProfileV2(id), null, 2),
877
+ );
878
+ });
879
+ parent
880
+ .command("bigov-touch-v2 <id>")
881
+ .description("Touch profile")
882
+ .action(async (id) => {
883
+ console.log(JSON.stringify((await L()).touchBigovProfileV2(id), null, 2));
884
+ });
885
+ parent
886
+ .command("bigov-get-v2 <id>")
887
+ .description("Get profile")
888
+ .action(async (id) => {
889
+ console.log(JSON.stringify((await L()).getBigovProfileV2(id), null, 2));
890
+ });
891
+ parent
892
+ .command("bigov-list-v2")
893
+ .description("List profiles")
894
+ .action(async () => {
895
+ console.log(JSON.stringify((await L()).listBigovProfilesV2(), null, 2));
896
+ });
897
+ parent
898
+ .command("bigov-create-query-v2 <id> <profileId>")
899
+ .description("Create query")
900
+ .option("--kpi <v>", "kpi")
901
+ .action(async (id, profileId, o) => {
902
+ const m = await L();
903
+ console.log(
904
+ JSON.stringify(
905
+ m.createBigovQueryV2({ id, profileId, kpi: o.kpi }),
906
+ null,
907
+ 2,
908
+ ),
909
+ );
910
+ });
911
+ parent
912
+ .command("bigov-querying-query-v2 <id>")
913
+ .description("Mark query as querying")
914
+ .action(async (id) => {
915
+ console.log(
916
+ JSON.stringify((await L()).queryingBigovQueryV2(id), null, 2),
917
+ );
918
+ });
919
+ parent
920
+ .command("bigov-complete-query-v2 <id>")
921
+ .description("Complete query")
922
+ .action(async (id) => {
923
+ console.log(
924
+ JSON.stringify((await L()).completeQueryBigovV2(id), null, 2),
925
+ );
926
+ });
927
+ parent
928
+ .command("bigov-fail-query-v2 <id> [reason]")
929
+ .description("Fail query")
930
+ .action(async (id, reason) => {
931
+ console.log(
932
+ JSON.stringify((await L()).failBigovQueryV2(id, reason), null, 2),
933
+ );
934
+ });
935
+ parent
936
+ .command("bigov-cancel-query-v2 <id> [reason]")
937
+ .description("Cancel query")
938
+ .action(async (id, reason) => {
939
+ console.log(
940
+ JSON.stringify((await L()).cancelBigovQueryV2(id, reason), null, 2),
941
+ );
942
+ });
943
+ parent
944
+ .command("bigov-get-query-v2 <id>")
945
+ .description("Get query")
946
+ .action(async (id) => {
947
+ console.log(JSON.stringify((await L()).getBigovQueryV2(id), null, 2));
948
+ });
949
+ parent
950
+ .command("bigov-list-querys-v2")
951
+ .description("List querys")
952
+ .action(async () => {
953
+ console.log(JSON.stringify((await L()).listBigovQuerysV2(), null, 2));
954
+ });
955
+ parent
956
+ .command("bigov-auto-stale-idle-v2")
957
+ .description("Auto-stale idle")
958
+ .action(async () => {
959
+ console.log(
960
+ JSON.stringify((await L()).autoStaleIdleBigovProfilesV2(), null, 2),
961
+ );
962
+ });
963
+ parent
964
+ .command("bigov-auto-fail-stuck-v2")
965
+ .description("Auto-fail stuck querys")
966
+ .action(async () => {
967
+ console.log(
968
+ JSON.stringify((await L()).autoFailStuckBigovQuerysV2(), null, 2),
969
+ );
970
+ });
971
+ parent
972
+ .command("bigov-gov-stats-v2")
973
+ .description("V2 gov stats")
974
+ .action(async () => {
975
+ console.log(JSON.stringify((await L()).getBiEngineGovStatsV2(), null, 2));
976
+ });
977
+ }
@@ -407,3 +407,216 @@ export function registerBrowseV2Command(browse) {
407
407
  console.log(JSON.stringify(getBrowserAutomationStatsV2(), null, 2));
408
408
  });
409
409
  }
410
+
411
+ // === Iter20 V2 governance overlay ===
412
+ export function registerBagovV2Commands(program) {
413
+ const parent = program.commands.find((c) => c.name() === "browse");
414
+ if (!parent) return;
415
+ const L = async () => await import("../lib/browser-automation.js");
416
+ parent
417
+ .command("bagov-enums-v2")
418
+ .description("Show V2 enums")
419
+ .action(async () => {
420
+ const m = await L();
421
+ console.log(
422
+ JSON.stringify(
423
+ {
424
+ profileMaturity: m.BAGOV_PROFILE_MATURITY_V2,
425
+ navigationLifecycle: m.BAGOV_NAVIGATION_LIFECYCLE_V2,
426
+ },
427
+ null,
428
+ 2,
429
+ ),
430
+ );
431
+ });
432
+ parent
433
+ .command("bagov-config-v2")
434
+ .description("Show V2 config")
435
+ .action(async () => {
436
+ const m = await L();
437
+ console.log(
438
+ JSON.stringify(
439
+ {
440
+ maxActive: m.getMaxActiveBagovProfilesPerOwnerV2(),
441
+ maxPending: m.getMaxPendingBagovNavigationsPerProfileV2(),
442
+ idleMs: m.getBagovProfileIdleMsV2(),
443
+ stuckMs: m.getBagovNavigationStuckMsV2(),
444
+ },
445
+ null,
446
+ 2,
447
+ ),
448
+ );
449
+ });
450
+ parent
451
+ .command("bagov-set-max-active-v2 <n>")
452
+ .description("Set max active")
453
+ .action(async (n) => {
454
+ (await L()).setMaxActiveBagovProfilesPerOwnerV2(Number(n));
455
+ console.log("ok");
456
+ });
457
+ parent
458
+ .command("bagov-set-max-pending-v2 <n>")
459
+ .description("Set max pending")
460
+ .action(async (n) => {
461
+ (await L()).setMaxPendingBagovNavigationsPerProfileV2(Number(n));
462
+ console.log("ok");
463
+ });
464
+ parent
465
+ .command("bagov-set-idle-ms-v2 <n>")
466
+ .description("Set idle threshold ms")
467
+ .action(async (n) => {
468
+ (await L()).setBagovProfileIdleMsV2(Number(n));
469
+ console.log("ok");
470
+ });
471
+ parent
472
+ .command("bagov-set-stuck-ms-v2 <n>")
473
+ .description("Set stuck threshold ms")
474
+ .action(async (n) => {
475
+ (await L()).setBagovNavigationStuckMsV2(Number(n));
476
+ console.log("ok");
477
+ });
478
+ parent
479
+ .command("bagov-register-v2 <id> <owner>")
480
+ .description("Register V2 profile")
481
+ .option("--engine <v>", "engine")
482
+ .action(async (id, owner, o) => {
483
+ const m = await L();
484
+ console.log(
485
+ JSON.stringify(
486
+ m.registerBagovProfileV2({ id, owner, engine: o.engine }),
487
+ null,
488
+ 2,
489
+ ),
490
+ );
491
+ });
492
+ parent
493
+ .command("bagov-activate-v2 <id>")
494
+ .description("Activate profile")
495
+ .action(async (id) => {
496
+ console.log(
497
+ JSON.stringify((await L()).activateBagovProfileV2(id), null, 2),
498
+ );
499
+ });
500
+ parent
501
+ .command("bagov-stale-v2 <id>")
502
+ .description("Stale profile")
503
+ .action(async (id) => {
504
+ console.log(JSON.stringify((await L()).staleBagovProfileV2(id), null, 2));
505
+ });
506
+ parent
507
+ .command("bagov-archive-v2 <id>")
508
+ .description("Archive profile")
509
+ .action(async (id) => {
510
+ console.log(
511
+ JSON.stringify((await L()).archiveBagovProfileV2(id), null, 2),
512
+ );
513
+ });
514
+ parent
515
+ .command("bagov-touch-v2 <id>")
516
+ .description("Touch profile")
517
+ .action(async (id) => {
518
+ console.log(JSON.stringify((await L()).touchBagovProfileV2(id), null, 2));
519
+ });
520
+ parent
521
+ .command("bagov-get-v2 <id>")
522
+ .description("Get profile")
523
+ .action(async (id) => {
524
+ console.log(JSON.stringify((await L()).getBagovProfileV2(id), null, 2));
525
+ });
526
+ parent
527
+ .command("bagov-list-v2")
528
+ .description("List profiles")
529
+ .action(async () => {
530
+ console.log(JSON.stringify((await L()).listBagovProfilesV2(), null, 2));
531
+ });
532
+ parent
533
+ .command("bagov-create-navigation-v2 <id> <profileId>")
534
+ .description("Create navigation")
535
+ .option("--url <v>", "url")
536
+ .action(async (id, profileId, o) => {
537
+ const m = await L();
538
+ console.log(
539
+ JSON.stringify(
540
+ m.createBagovNavigationV2({ id, profileId, url: o.url }),
541
+ null,
542
+ 2,
543
+ ),
544
+ );
545
+ });
546
+ parent
547
+ .command("bagov-navigating-navigation-v2 <id>")
548
+ .description("Mark navigation as navigating")
549
+ .action(async (id) => {
550
+ console.log(
551
+ JSON.stringify((await L()).navigatingBagovNavigationV2(id), null, 2),
552
+ );
553
+ });
554
+ parent
555
+ .command("bagov-complete-navigation-v2 <id>")
556
+ .description("Complete navigation")
557
+ .action(async (id) => {
558
+ console.log(
559
+ JSON.stringify((await L()).completeNavigationBagovV2(id), null, 2),
560
+ );
561
+ });
562
+ parent
563
+ .command("bagov-fail-navigation-v2 <id> [reason]")
564
+ .description("Fail navigation")
565
+ .action(async (id, reason) => {
566
+ console.log(
567
+ JSON.stringify((await L()).failBagovNavigationV2(id, reason), null, 2),
568
+ );
569
+ });
570
+ parent
571
+ .command("bagov-cancel-navigation-v2 <id> [reason]")
572
+ .description("Cancel navigation")
573
+ .action(async (id, reason) => {
574
+ console.log(
575
+ JSON.stringify(
576
+ (await L()).cancelBagovNavigationV2(id, reason),
577
+ null,
578
+ 2,
579
+ ),
580
+ );
581
+ });
582
+ parent
583
+ .command("bagov-get-navigation-v2 <id>")
584
+ .description("Get navigation")
585
+ .action(async (id) => {
586
+ console.log(
587
+ JSON.stringify((await L()).getBagovNavigationV2(id), null, 2),
588
+ );
589
+ });
590
+ parent
591
+ .command("bagov-list-navigations-v2")
592
+ .description("List navigations")
593
+ .action(async () => {
594
+ console.log(
595
+ JSON.stringify((await L()).listBagovNavigationsV2(), null, 2),
596
+ );
597
+ });
598
+ parent
599
+ .command("bagov-auto-stale-idle-v2")
600
+ .description("Auto-stale idle")
601
+ .action(async () => {
602
+ console.log(
603
+ JSON.stringify((await L()).autoStaleIdleBagovProfilesV2(), null, 2),
604
+ );
605
+ });
606
+ parent
607
+ .command("bagov-auto-fail-stuck-v2")
608
+ .description("Auto-fail stuck navigations")
609
+ .action(async () => {
610
+ console.log(
611
+ JSON.stringify((await L()).autoFailStuckBagovNavigationsV2(), null, 2),
612
+ );
613
+ });
614
+ parent
615
+ .command("bagov-gov-stats-v2")
616
+ .description("V2 gov stats")
617
+ .action(async () => {
618
+ console.log(
619
+ JSON.stringify((await L()).getBrowserAutomationGovStatsV2(), null, 2),
620
+ );
621
+ });
622
+ }