chainlesschain 0.132.0 → 0.145.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 (135) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +230 -0
  3. package/src/commands/activitypub.js +191 -0
  4. package/src/commands/agent.js +601 -0
  5. package/src/commands/audit.js +206 -0
  6. package/src/commands/bi.js +186 -0
  7. package/src/commands/bm25.js +162 -0
  8. package/src/commands/browse.js +225 -0
  9. package/src/commands/ccron.js +178 -0
  10. package/src/commands/chat.js +207 -0
  11. package/src/commands/compliance.js +420 -0
  12. package/src/commands/compt.js +176 -0
  13. package/src/commands/consol.js +237 -0
  14. package/src/commands/cowork.js +588 -0
  15. package/src/commands/crosschain.js +216 -0
  16. package/src/commands/dao.js +216 -0
  17. package/src/commands/dlp.js +206 -0
  18. package/src/commands/economy.js +211 -0
  19. package/src/commands/evolution.js +209 -0
  20. package/src/commands/evomap.js +216 -0
  21. package/src/commands/fflag.js +230 -0
  22. package/src/commands/git.js +185 -0
  23. package/src/commands/hardening.js +209 -0
  24. package/src/commands/hmemory.js +210 -0
  25. package/src/commands/incentive.js +209 -0
  26. package/src/commands/inference.js +178 -0
  27. package/src/commands/itbudget.js +161 -0
  28. package/src/commands/kg.js +206 -0
  29. package/src/commands/lowcode.js +201 -0
  30. package/src/commands/marketplace.js +206 -0
  31. package/src/commands/matrix.js +214 -0
  32. package/src/commands/mcpscaf.js +153 -0
  33. package/src/commands/meminj.js +153 -0
  34. package/src/commands/nostr.js +213 -0
  35. package/src/commands/orchestrate.js +217 -0
  36. package/src/commands/orchgov.js +156 -0
  37. package/src/commands/pdfp.js +160 -0
  38. package/src/commands/perf.js +176 -0
  39. package/src/commands/perm.js +156 -0
  40. package/src/commands/pipeline.js +211 -0
  41. package/src/commands/planmode.js +154 -0
  42. package/src/commands/privacy.js +203 -0
  43. package/src/commands/promcomp.js +166 -0
  44. package/src/commands/recommend.js +185 -0
  45. package/src/commands/reputation.js +208 -0
  46. package/src/commands/sandbox.js +206 -0
  47. package/src/commands/seshhook.js +153 -0
  48. package/src/commands/seshsearch.js +149 -0
  49. package/src/commands/seshtail.js +152 -0
  50. package/src/commands/seshu.js +160 -0
  51. package/src/commands/sganal.js +172 -0
  52. package/src/commands/siem.js +207 -0
  53. package/src/commands/sla.js +212 -0
  54. package/src/commands/slotfill.js +154 -0
  55. package/src/commands/social.js +159 -0
  56. package/src/commands/stress.js +206 -0
  57. package/src/commands/svccont.js +157 -0
  58. package/src/commands/terraform.js +206 -0
  59. package/src/commands/tms.js +183 -0
  60. package/src/commands/topiccls.js +158 -0
  61. package/src/commands/uprof.js +154 -0
  62. package/src/commands/vcheck.js +172 -0
  63. package/src/commands/webfetch.js +150 -0
  64. package/src/commands/zkp.js +218 -0
  65. package/src/harness/prompt-compressor.js +331 -0
  66. package/src/index.js +101 -1
  67. package/src/lib/a2a-protocol.js +373 -0
  68. package/src/lib/activitypub-bridge.js +343 -0
  69. package/src/lib/agent-economy.js +358 -0
  70. package/src/lib/app-builder.js +338 -0
  71. package/src/lib/audit-logger.js +321 -0
  72. package/src/lib/autonomous-agent.js +341 -0
  73. package/src/lib/bi-engine.js +339 -0
  74. package/src/lib/bm25-search.js +333 -0
  75. package/src/lib/browser-automation.js +352 -0
  76. package/src/lib/chat-core.js +336 -0
  77. package/src/lib/claude-code-bridge.js +341 -0
  78. package/src/lib/compliance-framework-reporter.js +359 -0
  79. package/src/lib/compliance-manager.js +330 -0
  80. package/src/lib/compression-telemetry.js +333 -0
  81. package/src/lib/content-recommender.js +370 -0
  82. package/src/lib/cowork-cron.js +330 -0
  83. package/src/lib/cowork-learning.js +333 -0
  84. package/src/lib/cowork-task-runner.js +362 -0
  85. package/src/lib/cowork-workflow.js +327 -0
  86. package/src/lib/cross-chain.js +365 -0
  87. package/src/lib/dao-governance.js +339 -0
  88. package/src/lib/dlp-engine.js +343 -0
  89. package/src/lib/evolution-system.js +336 -0
  90. package/src/lib/evomap-manager.js +339 -0
  91. package/src/lib/execution-backend.js +351 -0
  92. package/src/lib/feature-flags.js +330 -0
  93. package/src/lib/git-integration.js +343 -0
  94. package/src/lib/hardening-manager.js +341 -0
  95. package/src/lib/hierarchical-memory.js +341 -0
  96. package/src/lib/inference-network.js +362 -0
  97. package/src/lib/iteration-budget.js +357 -0
  98. package/src/lib/knowledge-graph.js +333 -0
  99. package/src/lib/matrix-bridge.js +339 -0
  100. package/src/lib/mcp-scaffold.js +345 -0
  101. package/src/lib/memory-injection.js +320 -0
  102. package/src/lib/nostr-bridge.js +342 -0
  103. package/src/lib/orchestrator.js +350 -0
  104. package/src/lib/pdf-parser.js +330 -0
  105. package/src/lib/perf-tuning.js +364 -0
  106. package/src/lib/permission-engine.js +319 -0
  107. package/src/lib/pipeline-orchestrator.js +345 -0
  108. package/src/lib/plan-mode.js +328 -0
  109. package/src/lib/privacy-computing.js +335 -0
  110. package/src/lib/prompt-compressor.js +1 -10
  111. package/src/lib/reputation-optimizer.js +340 -0
  112. package/src/lib/sandbox-v2.js +327 -0
  113. package/src/lib/service-container.js +342 -0
  114. package/src/lib/session-consolidator.js +352 -0
  115. package/src/lib/session-hooks.js +340 -0
  116. package/src/lib/session-search.js +334 -0
  117. package/src/lib/session-tail.js +320 -0
  118. package/src/lib/session-usage.js +329 -0
  119. package/src/lib/siem-exporter.js +352 -0
  120. package/src/lib/skill-marketplace.js +345 -0
  121. package/src/lib/sla-manager.js +341 -0
  122. package/src/lib/slot-filler.js +333 -0
  123. package/src/lib/social-graph-analytics.js +327 -0
  124. package/src/lib/social-graph.js +304 -0
  125. package/src/lib/stress-tester.js +342 -0
  126. package/src/lib/sub-agent-registry.js +359 -0
  127. package/src/lib/task-model-selector.js +333 -0
  128. package/src/lib/terraform-manager.js +333 -0
  129. package/src/lib/todo-manager.js +339 -0
  130. package/src/lib/token-incentive.js +341 -0
  131. package/src/lib/topic-classifier.js +353 -0
  132. package/src/lib/user-profile.js +325 -0
  133. package/src/lib/version-checker.js +335 -0
  134. package/src/lib/web-fetch.js +322 -0
  135. package/src/lib/zkp-engine.js +342 -0
@@ -950,4 +950,215 @@ export function registerEconomyCommand(program) {
950
950
  process.exit(1);
951
951
  }
952
952
  });
953
+
954
+ _registerEconomyV2Commands(economy);
955
+ }
956
+ function _registerEconomyV2Commands(parent) {
957
+ const L = async () => await import("../lib/agent-economy.js");
958
+
959
+ parent
960
+ .command("enums-v2")
961
+ .description("Show V2 enums (account maturity + tx lifecycle)")
962
+ .action(async () => {
963
+ const m = await L();
964
+ console.log(
965
+ JSON.stringify(
966
+ {
967
+ accountMaturity: m.ECONOMY_ACCOUNT_MATURITY_V2,
968
+ txLifecycle: m.ECONOMY_TX_LIFECYCLE_V2,
969
+ },
970
+ null,
971
+ 2,
972
+ ),
973
+ );
974
+ });
975
+ parent
976
+ .command("config-v2")
977
+ .description("Show V2 config thresholds")
978
+ .action(async () => {
979
+ const m = await L();
980
+ console.log(
981
+ JSON.stringify(
982
+ {
983
+ maxActiveEconomyAccountsPerHolder:
984
+ m.getMaxActiveEconomyAccountsPerHolderV2(),
985
+ maxPendingEconomyTxsPerAccount:
986
+ m.getMaxPendingEconomyTxsPerAccountV2(),
987
+ economyAccountIdleMs: m.getEconomyAccountIdleMsV2(),
988
+ economyTxStuckMs: m.getEconomyTxStuckMsV2(),
989
+ },
990
+ null,
991
+ 2,
992
+ ),
993
+ );
994
+ });
995
+ parent
996
+ .command("set-max-active-accounts-v2 <n>")
997
+ .description("Set max active accounts per holder")
998
+ .action(async (n) => {
999
+ const m = await L();
1000
+ m.setMaxActiveEconomyAccountsPerHolderV2(Number(n));
1001
+ console.log("ok");
1002
+ });
1003
+ parent
1004
+ .command("set-max-pending-txs-v2 <n>")
1005
+ .description("Set max pending txs per account")
1006
+ .action(async (n) => {
1007
+ const m = await L();
1008
+ m.setMaxPendingEconomyTxsPerAccountV2(Number(n));
1009
+ console.log("ok");
1010
+ });
1011
+ parent
1012
+ .command("set-account-idle-ms-v2 <n>")
1013
+ .description("Set account idle threshold (ms)")
1014
+ .action(async (n) => {
1015
+ const m = await L();
1016
+ m.setEconomyAccountIdleMsV2(Number(n));
1017
+ console.log("ok");
1018
+ });
1019
+ parent
1020
+ .command("set-tx-stuck-ms-v2 <n>")
1021
+ .description("Set tx stuck threshold (ms)")
1022
+ .action(async (n) => {
1023
+ const m = await L();
1024
+ m.setEconomyTxStuckMsV2(Number(n));
1025
+ console.log("ok");
1026
+ });
1027
+
1028
+ parent
1029
+ .command("register-account-v2 <id> <holder>")
1030
+ .description("Register V2 economy account")
1031
+ .option("--currency <c>", "Currency", "CLC")
1032
+ .action(async (id, holder, o) => {
1033
+ const m = await L();
1034
+ console.log(
1035
+ JSON.stringify(
1036
+ m.registerEconomyAccountV2({ id, holder, currency: o.currency }),
1037
+ null,
1038
+ 2,
1039
+ ),
1040
+ );
1041
+ });
1042
+ parent
1043
+ .command("activate-account-v2 <id>")
1044
+ .description("Activate account (pending→active or frozen→active)")
1045
+ .action(async (id) => {
1046
+ const m = await L();
1047
+ console.log(JSON.stringify(m.activateEconomyAccountV2(id), null, 2));
1048
+ });
1049
+ parent
1050
+ .command("freeze-account-v2 <id>")
1051
+ .description("Freeze account")
1052
+ .action(async (id) => {
1053
+ const m = await L();
1054
+ console.log(JSON.stringify(m.freezeEconomyAccountV2(id), null, 2));
1055
+ });
1056
+ parent
1057
+ .command("close-account-v2 <id>")
1058
+ .description("Close account (terminal)")
1059
+ .action(async (id) => {
1060
+ const m = await L();
1061
+ console.log(JSON.stringify(m.closeEconomyAccountV2(id), null, 2));
1062
+ });
1063
+ parent
1064
+ .command("touch-account-v2 <id>")
1065
+ .description("Touch account lastTouchedAt")
1066
+ .action(async (id) => {
1067
+ const m = await L();
1068
+ console.log(JSON.stringify(m.touchEconomyAccountV2(id), null, 2));
1069
+ });
1070
+ parent
1071
+ .command("get-account-v2 <id>")
1072
+ .description("Get V2 account")
1073
+ .action(async (id) => {
1074
+ const m = await L();
1075
+ console.log(JSON.stringify(m.getEconomyAccountV2(id), null, 2));
1076
+ });
1077
+ parent
1078
+ .command("list-accounts-v2")
1079
+ .description("List all V2 accounts")
1080
+ .action(async () => {
1081
+ const m = await L();
1082
+ console.log(JSON.stringify(m.listEconomyAccountsV2(), null, 2));
1083
+ });
1084
+
1085
+ parent
1086
+ .command("create-tx-v2 <id> <accountId>")
1087
+ .description("Create V2 tx (queued)")
1088
+ .option("--amount <a>", "Amount", "0")
1089
+ .action(async (id, accountId, o) => {
1090
+ const m = await L();
1091
+ console.log(
1092
+ JSON.stringify(
1093
+ m.createEconomyTxV2({ id, accountId, amount: o.amount }),
1094
+ null,
1095
+ 2,
1096
+ ),
1097
+ );
1098
+ });
1099
+ parent
1100
+ .command("start-tx-v2 <id>")
1101
+ .description("Start tx (queued→processing)")
1102
+ .action(async (id) => {
1103
+ const m = await L();
1104
+ console.log(JSON.stringify(m.startEconomyTxV2(id), null, 2));
1105
+ });
1106
+ parent
1107
+ .command("settle-tx-v2 <id>")
1108
+ .description("Settle tx (processing→settled)")
1109
+ .action(async (id) => {
1110
+ const m = await L();
1111
+ console.log(JSON.stringify(m.settleEconomyTxV2(id), null, 2));
1112
+ });
1113
+ parent
1114
+ .command("fail-tx-v2 <id> [reason]")
1115
+ .description("Fail tx")
1116
+ .action(async (id, reason) => {
1117
+ const m = await L();
1118
+ console.log(JSON.stringify(m.failEconomyTxV2(id, reason), null, 2));
1119
+ });
1120
+ parent
1121
+ .command("cancel-tx-v2 <id> [reason]")
1122
+ .description("Cancel tx")
1123
+ .action(async (id, reason) => {
1124
+ const m = await L();
1125
+ console.log(JSON.stringify(m.cancelEconomyTxV2(id, reason), null, 2));
1126
+ });
1127
+ parent
1128
+ .command("get-tx-v2 <id>")
1129
+ .description("Get V2 tx")
1130
+ .action(async (id) => {
1131
+ const m = await L();
1132
+ console.log(JSON.stringify(m.getEconomyTxV2(id), null, 2));
1133
+ });
1134
+ parent
1135
+ .command("list-txs-v2")
1136
+ .description("List all V2 txs")
1137
+ .action(async () => {
1138
+ const m = await L();
1139
+ console.log(JSON.stringify(m.listEconomyTxsV2(), null, 2));
1140
+ });
1141
+
1142
+ parent
1143
+ .command("auto-freeze-idle-v2")
1144
+ .description("Auto-freeze idle active accounts")
1145
+ .action(async () => {
1146
+ const m = await L();
1147
+ console.log(JSON.stringify(m.autoFreezeIdleEconomyAccountsV2(), null, 2));
1148
+ });
1149
+ parent
1150
+ .command("auto-fail-stuck-v2")
1151
+ .description("Auto-fail stuck processing txs")
1152
+ .action(async () => {
1153
+ const m = await L();
1154
+ console.log(JSON.stringify(m.autoFailStuckEconomyTxsV2(), null, 2));
1155
+ });
1156
+
1157
+ parent
1158
+ .command("gov-stats-v2")
1159
+ .description("V2 governance aggregate stats")
1160
+ .action(async () => {
1161
+ const m = await L();
1162
+ console.log(JSON.stringify(m.getAgentEconomyGovStatsV2(), null, 2));
1163
+ });
953
1164
  }
@@ -786,4 +786,213 @@ export function registerEvolutionCommand(program) {
786
786
  );
787
787
  }
788
788
  });
789
+
790
+ _registerEvolutionV2Commands(evolution);
791
+ }
792
+ function _registerEvolutionV2Commands(parent) {
793
+ const L = async () => await import("../lib/evolution-system.js");
794
+
795
+ parent
796
+ .command("enums-v2")
797
+ .description("Show V2 enums (goal maturity + cycle lifecycle)")
798
+ .action(async () => {
799
+ const m = await L();
800
+ console.log(
801
+ JSON.stringify(
802
+ {
803
+ goalMaturity: m.EVO_GOAL_MATURITY_V2,
804
+ cycleLifecycle: m.EVO_CYCLE_LIFECYCLE_V2,
805
+ },
806
+ null,
807
+ 2,
808
+ ),
809
+ );
810
+ });
811
+ parent
812
+ .command("config-v2")
813
+ .description("Show V2 config thresholds")
814
+ .action(async () => {
815
+ const m = await L();
816
+ console.log(
817
+ JSON.stringify(
818
+ {
819
+ maxActiveEvoGoalsPerOwner: m.getMaxActiveEvoGoalsPerOwnerV2(),
820
+ maxPendingEvoCyclesPerGoal: m.getMaxPendingEvoCyclesPerGoalV2(),
821
+ evoGoalIdleMs: m.getEvoGoalIdleMsV2(),
822
+ evoCycleStuckMs: m.getEvoCycleStuckMsV2(),
823
+ },
824
+ null,
825
+ 2,
826
+ ),
827
+ );
828
+ });
829
+ parent
830
+ .command("set-max-active-goals-v2 <n>")
831
+ .description("Set max active goals per owner")
832
+ .action(async (n) => {
833
+ const m = await L();
834
+ m.setMaxActiveEvoGoalsPerOwnerV2(Number(n));
835
+ console.log("ok");
836
+ });
837
+ parent
838
+ .command("set-max-pending-cycles-v2 <n>")
839
+ .description("Set max pending cycles per goal")
840
+ .action(async (n) => {
841
+ const m = await L();
842
+ m.setMaxPendingEvoCyclesPerGoalV2(Number(n));
843
+ console.log("ok");
844
+ });
845
+ parent
846
+ .command("set-goal-idle-ms-v2 <n>")
847
+ .description("Set goal idle threshold (ms)")
848
+ .action(async (n) => {
849
+ const m = await L();
850
+ m.setEvoGoalIdleMsV2(Number(n));
851
+ console.log("ok");
852
+ });
853
+ parent
854
+ .command("set-cycle-stuck-ms-v2 <n>")
855
+ .description("Set cycle stuck threshold (ms)")
856
+ .action(async (n) => {
857
+ const m = await L();
858
+ m.setEvoCycleStuckMsV2(Number(n));
859
+ console.log("ok");
860
+ });
861
+
862
+ parent
863
+ .command("register-goal-v2 <id> <owner>")
864
+ .description("Register V2 evo goal")
865
+ .option("--objective <o>", "Objective description")
866
+ .action(async (id, owner, o) => {
867
+ const m = await L();
868
+ console.log(
869
+ JSON.stringify(
870
+ m.registerEvoGoalV2({ id, owner, objective: o.objective }),
871
+ null,
872
+ 2,
873
+ ),
874
+ );
875
+ });
876
+ parent
877
+ .command("activate-goal-v2 <id>")
878
+ .description("Activate evo goal")
879
+ .action(async (id) => {
880
+ const m = await L();
881
+ console.log(JSON.stringify(m.activateEvoGoalV2(id), null, 2));
882
+ });
883
+ parent
884
+ .command("pause-goal-v2 <id>")
885
+ .description("Pause evo goal")
886
+ .action(async (id) => {
887
+ const m = await L();
888
+ console.log(JSON.stringify(m.pauseEvoGoalV2(id), null, 2));
889
+ });
890
+ parent
891
+ .command("archive-goal-v2 <id>")
892
+ .description("Archive goal (terminal)")
893
+ .action(async (id) => {
894
+ const m = await L();
895
+ console.log(JSON.stringify(m.archiveEvoGoalV2(id), null, 2));
896
+ });
897
+ parent
898
+ .command("touch-goal-v2 <id>")
899
+ .description("Touch goal lastTouchedAt")
900
+ .action(async (id) => {
901
+ const m = await L();
902
+ console.log(JSON.stringify(m.touchEvoGoalV2(id), null, 2));
903
+ });
904
+ parent
905
+ .command("get-goal-v2 <id>")
906
+ .description("Get V2 goal")
907
+ .action(async (id) => {
908
+ const m = await L();
909
+ console.log(JSON.stringify(m.getEvoGoalV2(id), null, 2));
910
+ });
911
+ parent
912
+ .command("list-goals-v2")
913
+ .description("List all V2 goals")
914
+ .action(async () => {
915
+ const m = await L();
916
+ console.log(JSON.stringify(m.listEvoGoalsV2(), null, 2));
917
+ });
918
+
919
+ parent
920
+ .command("create-cycle-v2 <id> <goalId>")
921
+ .description("Create V2 cycle (queued)")
922
+ .option("--generation <n>", "Generation", "0")
923
+ .action(async (id, goalId, o) => {
924
+ const m = await L();
925
+ console.log(
926
+ JSON.stringify(
927
+ m.createEvoCycleV2({ id, goalId, generation: Number(o.generation) }),
928
+ null,
929
+ 2,
930
+ ),
931
+ );
932
+ });
933
+ parent
934
+ .command("start-cycle-v2 <id>")
935
+ .description("Start cycle (queued→running)")
936
+ .action(async (id) => {
937
+ const m = await L();
938
+ console.log(JSON.stringify(m.startEvoCycleV2(id), null, 2));
939
+ });
940
+ parent
941
+ .command("complete-cycle-v2 <id>")
942
+ .description("Complete cycle (running→completed)")
943
+ .action(async (id) => {
944
+ const m = await L();
945
+ console.log(JSON.stringify(m.completeEvoCycleV2(id), null, 2));
946
+ });
947
+ parent
948
+ .command("fail-cycle-v2 <id> [reason]")
949
+ .description("Fail cycle")
950
+ .action(async (id, reason) => {
951
+ const m = await L();
952
+ console.log(JSON.stringify(m.failEvoCycleV2(id, reason), null, 2));
953
+ });
954
+ parent
955
+ .command("cancel-cycle-v2 <id> [reason]")
956
+ .description("Cancel cycle")
957
+ .action(async (id, reason) => {
958
+ const m = await L();
959
+ console.log(JSON.stringify(m.cancelEvoCycleV2(id, reason), null, 2));
960
+ });
961
+ parent
962
+ .command("get-cycle-v2 <id>")
963
+ .description("Get V2 cycle")
964
+ .action(async (id) => {
965
+ const m = await L();
966
+ console.log(JSON.stringify(m.getEvoCycleV2(id), null, 2));
967
+ });
968
+ parent
969
+ .command("list-cycles-v2")
970
+ .description("List all V2 cycles")
971
+ .action(async () => {
972
+ const m = await L();
973
+ console.log(JSON.stringify(m.listEvoCyclesV2(), null, 2));
974
+ });
975
+
976
+ parent
977
+ .command("auto-pause-idle-v2")
978
+ .description("Auto-pause idle active goals")
979
+ .action(async () => {
980
+ const m = await L();
981
+ console.log(JSON.stringify(m.autoPauseIdleEvoGoalsV2(), null, 2));
982
+ });
983
+ parent
984
+ .command("auto-fail-stuck-v2")
985
+ .description("Auto-fail stuck running cycles")
986
+ .action(async () => {
987
+ const m = await L();
988
+ console.log(JSON.stringify(m.autoFailStuckEvoCyclesV2(), null, 2));
989
+ });
990
+
991
+ parent
992
+ .command("gov-stats-v2")
993
+ .description("V2 governance aggregate stats")
994
+ .action(async () => {
995
+ const m = await L();
996
+ console.log(JSON.stringify(m.getEvolutionSystemGovStatsV2(), null, 2));
997
+ });
789
998
  }
@@ -949,4 +949,220 @@ export function registerEvoMapCommand(program) {
949
949
  process.exit(1);
950
950
  }
951
951
  });
952
+ registerEvoMapV2Command(evomap);
953
+ }
954
+
955
+ import {
956
+ EVOMAP_MAP_MATURITY_V2,
957
+ EVOMAP_EVOLUTION_LIFECYCLE_V2,
958
+ registerEvoMapV2,
959
+ activateEvoMapV2,
960
+ staleEvoMapV2,
961
+ archiveEvoMapV2,
962
+ touchEvoMapV2,
963
+ getEvoMapV2,
964
+ listEvoMapsV2,
965
+ createEvoEvolutionV2,
966
+ startEvoEvolutionV2,
967
+ completeEvoEvolutionV2,
968
+ failEvoEvolutionV2,
969
+ cancelEvoEvolutionV2,
970
+ getEvoEvolutionV2,
971
+ listEvoEvolutionsV2,
972
+ setMaxActiveEvoMapsPerOwnerV2,
973
+ getMaxActiveEvoMapsPerOwnerV2,
974
+ setMaxPendingEvoEvolutionsPerMapV2,
975
+ getMaxPendingEvoEvolutionsPerMapV2,
976
+ setEvoMapIdleMsV2,
977
+ getEvoMapIdleMsV2,
978
+ setEvoEvolutionStuckMsV2,
979
+ getEvoEvolutionStuckMsV2,
980
+ autoStaleIdleEvoMapsV2,
981
+ autoFailStuckEvoEvolutionsV2,
982
+ getEvoMapManagerStatsV2,
983
+ } from "../lib/evomap-manager.js";
984
+
985
+ export function registerEvoMapV2Command(evomap) {
986
+ evomap
987
+ .command("enums-v2")
988
+ .description("Show V2 governance enums")
989
+ .action(() => {
990
+ console.log(
991
+ JSON.stringify(
992
+ { EVOMAP_MAP_MATURITY_V2, EVOMAP_EVOLUTION_LIFECYCLE_V2 },
993
+ null,
994
+ 2,
995
+ ),
996
+ );
997
+ });
998
+ evomap
999
+ .command("register-map-v2")
1000
+ .description("Register an evomap profile (pending)")
1001
+ .requiredOption("--id <id>")
1002
+ .requiredOption("--owner <owner>")
1003
+ .option("--name <name>")
1004
+ .action((o) => {
1005
+ console.log(JSON.stringify(registerEvoMapV2(o), null, 2));
1006
+ });
1007
+ evomap
1008
+ .command("activate-map-v2 <id>")
1009
+ .description("Activate map")
1010
+ .action((id) => {
1011
+ console.log(JSON.stringify(activateEvoMapV2(id), null, 2));
1012
+ });
1013
+ evomap
1014
+ .command("stale-map-v2 <id>")
1015
+ .description("Mark map stale")
1016
+ .action((id) => {
1017
+ console.log(JSON.stringify(staleEvoMapV2(id), null, 2));
1018
+ });
1019
+ evomap
1020
+ .command("archive-map-v2 <id>")
1021
+ .description("Archive map (terminal)")
1022
+ .action((id) => {
1023
+ console.log(JSON.stringify(archiveEvoMapV2(id), null, 2));
1024
+ });
1025
+ evomap
1026
+ .command("touch-map-v2 <id>")
1027
+ .description("Refresh lastTouchedAt")
1028
+ .action((id) => {
1029
+ console.log(JSON.stringify(touchEvoMapV2(id), null, 2));
1030
+ });
1031
+ evomap
1032
+ .command("get-map-v2 <id>")
1033
+ .description("Get map")
1034
+ .action((id) => {
1035
+ console.log(JSON.stringify(getEvoMapV2(id), null, 2));
1036
+ });
1037
+ evomap
1038
+ .command("list-maps-v2")
1039
+ .description("List maps")
1040
+ .action(() => {
1041
+ console.log(JSON.stringify(listEvoMapsV2(), null, 2));
1042
+ });
1043
+ evomap
1044
+ .command("create-evolution-v2")
1045
+ .description("Create an evolution (queued)")
1046
+ .requiredOption("--id <id>")
1047
+ .requiredOption("--map-id <mapId>")
1048
+ .option("--strategy <strategy>")
1049
+ .action((o) => {
1050
+ console.log(
1051
+ JSON.stringify(
1052
+ createEvoEvolutionV2({
1053
+ id: o.id,
1054
+ mapId: o.mapId,
1055
+ strategy: o.strategy,
1056
+ }),
1057
+ null,
1058
+ 2,
1059
+ ),
1060
+ );
1061
+ });
1062
+ evomap
1063
+ .command("start-evolution-v2 <id>")
1064
+ .description("Transition evolution to running")
1065
+ .action((id) => {
1066
+ console.log(JSON.stringify(startEvoEvolutionV2(id), null, 2));
1067
+ });
1068
+ evomap
1069
+ .command("complete-evolution-v2 <id>")
1070
+ .description("Transition evolution to completed")
1071
+ .action((id) => {
1072
+ console.log(JSON.stringify(completeEvoEvolutionV2(id), null, 2));
1073
+ });
1074
+ evomap
1075
+ .command("fail-evolution-v2 <id>")
1076
+ .description("Fail evolution")
1077
+ .option("--reason <r>")
1078
+ .action((id, o) => {
1079
+ console.log(JSON.stringify(failEvoEvolutionV2(id, o.reason), null, 2));
1080
+ });
1081
+ evomap
1082
+ .command("cancel-evolution-v2 <id>")
1083
+ .description("Cancel evolution")
1084
+ .option("--reason <r>")
1085
+ .action((id, o) => {
1086
+ console.log(JSON.stringify(cancelEvoEvolutionV2(id, o.reason), null, 2));
1087
+ });
1088
+ evomap
1089
+ .command("get-evolution-v2 <id>")
1090
+ .description("Get evolution")
1091
+ .action((id) => {
1092
+ console.log(JSON.stringify(getEvoEvolutionV2(id), null, 2));
1093
+ });
1094
+ evomap
1095
+ .command("list-evolutions-v2")
1096
+ .description("List evolutions")
1097
+ .action(() => {
1098
+ console.log(JSON.stringify(listEvoEvolutionsV2(), null, 2));
1099
+ });
1100
+ evomap
1101
+ .command("set-max-active-maps-v2 <n>")
1102
+ .description("Set per-owner active cap")
1103
+ .action((n) => {
1104
+ setMaxActiveEvoMapsPerOwnerV2(Number(n));
1105
+ console.log(
1106
+ JSON.stringify(
1107
+ { maxActiveEvoMapsPerOwner: getMaxActiveEvoMapsPerOwnerV2() },
1108
+ null,
1109
+ 2,
1110
+ ),
1111
+ );
1112
+ });
1113
+ evomap
1114
+ .command("set-max-pending-evolutions-v2 <n>")
1115
+ .description("Set per-map pending cap")
1116
+ .action((n) => {
1117
+ setMaxPendingEvoEvolutionsPerMapV2(Number(n));
1118
+ console.log(
1119
+ JSON.stringify(
1120
+ {
1121
+ maxPendingEvoEvolutionsPerMap: getMaxPendingEvoEvolutionsPerMapV2(),
1122
+ },
1123
+ null,
1124
+ 2,
1125
+ ),
1126
+ );
1127
+ });
1128
+ evomap
1129
+ .command("set-map-idle-ms-v2 <n>")
1130
+ .description("Set idle threshold")
1131
+ .action((n) => {
1132
+ setEvoMapIdleMsV2(Number(n));
1133
+ console.log(
1134
+ JSON.stringify({ evoMapIdleMs: getEvoMapIdleMsV2() }, null, 2),
1135
+ );
1136
+ });
1137
+ evomap
1138
+ .command("set-evolution-stuck-ms-v2 <n>")
1139
+ .description("Set stuck threshold")
1140
+ .action((n) => {
1141
+ setEvoEvolutionStuckMsV2(Number(n));
1142
+ console.log(
1143
+ JSON.stringify(
1144
+ { evoEvolutionStuckMs: getEvoEvolutionStuckMsV2() },
1145
+ null,
1146
+ 2,
1147
+ ),
1148
+ );
1149
+ });
1150
+ evomap
1151
+ .command("auto-stale-idle-maps-v2")
1152
+ .description("Auto-stale idle maps")
1153
+ .action(() => {
1154
+ console.log(JSON.stringify(autoStaleIdleEvoMapsV2(), null, 2));
1155
+ });
1156
+ evomap
1157
+ .command("auto-fail-stuck-evolutions-v2")
1158
+ .description("Auto-fail stuck running evolutions")
1159
+ .action(() => {
1160
+ console.log(JSON.stringify(autoFailStuckEvoEvolutionsV2(), null, 2));
1161
+ });
1162
+ evomap
1163
+ .command("gov-stats-v2")
1164
+ .description("V2 governance aggregate stats")
1165
+ .action(() => {
1166
+ console.log(JSON.stringify(getEvoMapManagerStatsV2(), null, 2));
1167
+ });
952
1168
  }