chainlesschain 0.143.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 (133) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +157 -27
  4. package/src/commands/agent.js +587 -103
  5. package/src/commands/audit.js +206 -0
  6. package/src/commands/bi.js +152 -27
  7. package/src/commands/bm25.js +111 -27
  8. package/src/commands/browse.js +190 -29
  9. package/src/commands/ccron.js +128 -28
  10. package/src/commands/chat.js +207 -0
  11. package/src/commands/compliance.js +414 -34
  12. package/src/commands/compt.js +127 -29
  13. package/src/commands/consol.js +8 -2
  14. package/src/commands/cowork.js +580 -34
  15. package/src/commands/crosschain.js +182 -28
  16. package/src/commands/dao.js +182 -28
  17. package/src/commands/dlp.js +172 -27
  18. package/src/commands/economy.js +205 -50
  19. package/src/commands/evolution.js +203 -50
  20. package/src/commands/evomap.js +182 -27
  21. package/src/commands/fflag.js +74 -22
  22. package/src/commands/git.js +177 -37
  23. package/src/commands/hardening.js +209 -0
  24. package/src/commands/hmemory.js +204 -50
  25. package/src/commands/incentive.js +209 -0
  26. package/src/commands/inference.js +170 -34
  27. package/src/commands/itbudget.js +149 -33
  28. package/src/commands/kg.js +206 -0
  29. package/src/commands/lowcode.js +195 -38
  30. package/src/commands/marketplace.js +206 -0
  31. package/src/commands/matrix.js +179 -27
  32. package/src/commands/mcpscaf.js +145 -33
  33. package/src/commands/meminj.js +145 -33
  34. package/src/commands/nostr.js +178 -27
  35. package/src/commands/orchestrate.js +217 -0
  36. package/src/commands/orchgov.js +144 -33
  37. package/src/commands/pdfp.js +109 -27
  38. package/src/commands/perf.js +169 -32
  39. package/src/commands/perm.js +144 -33
  40. package/src/commands/pipeline.js +207 -52
  41. package/src/commands/planmode.js +141 -32
  42. package/src/commands/privacy.js +203 -0
  43. package/src/commands/promcomp.js +111 -27
  44. package/src/commands/recommend.js +177 -34
  45. package/src/commands/reputation.js +208 -0
  46. package/src/commands/sandbox.js +206 -0
  47. package/src/commands/seshhook.js +145 -33
  48. package/src/commands/seshsearch.js +141 -33
  49. package/src/commands/seshtail.js +144 -33
  50. package/src/commands/seshu.js +152 -33
  51. package/src/commands/sganal.js +123 -29
  52. package/src/commands/siem.js +201 -34
  53. package/src/commands/sla.js +212 -0
  54. package/src/commands/slotfill.js +146 -33
  55. package/src/commands/social.js +157 -32
  56. package/src/commands/stress.js +206 -0
  57. package/src/commands/svccont.js +145 -33
  58. package/src/commands/terraform.js +206 -0
  59. package/src/commands/tms.js +171 -33
  60. package/src/commands/topiccls.js +146 -33
  61. package/src/commands/uprof.js +141 -32
  62. package/src/commands/vcheck.js +122 -28
  63. package/src/commands/webfetch.js +141 -32
  64. package/src/commands/zkp.js +184 -28
  65. package/src/index.js +40 -0
  66. package/src/lib/a2a-protocol.js +319 -51
  67. package/src/lib/activitypub-bridge.js +288 -50
  68. package/src/lib/agent-economy.js +304 -51
  69. package/src/lib/app-builder.js +279 -46
  70. package/src/lib/audit-logger.js +321 -0
  71. package/src/lib/autonomous-agent.js +284 -48
  72. package/src/lib/bi-engine.js +283 -49
  73. package/src/lib/bm25-search.js +301 -49
  74. package/src/lib/browser-automation.js +296 -49
  75. package/src/lib/chat-core.js +336 -0
  76. package/src/lib/claude-code-bridge.js +341 -0
  77. package/src/lib/compliance-framework-reporter.js +305 -51
  78. package/src/lib/compliance-manager.js +330 -0
  79. package/src/lib/compression-telemetry.js +301 -49
  80. package/src/lib/content-recommender.js +317 -52
  81. package/src/lib/cowork-cron.js +298 -49
  82. package/src/lib/cowork-learning.js +333 -0
  83. package/src/lib/cowork-task-runner.js +308 -51
  84. package/src/lib/cowork-workflow.js +327 -0
  85. package/src/lib/cross-chain.js +311 -51
  86. package/src/lib/dao-governance.js +280 -46
  87. package/src/lib/dlp-engine.js +287 -49
  88. package/src/lib/evolution-system.js +278 -47
  89. package/src/lib/evomap-manager.js +280 -46
  90. package/src/lib/execution-backend.js +294 -48
  91. package/src/lib/feature-flags.js +294 -49
  92. package/src/lib/git-integration.js +285 -47
  93. package/src/lib/hardening-manager.js +341 -0
  94. package/src/lib/hierarchical-memory.js +284 -48
  95. package/src/lib/inference-network.js +308 -51
  96. package/src/lib/iteration-budget.js +302 -50
  97. package/src/lib/knowledge-graph.js +333 -0
  98. package/src/lib/matrix-bridge.js +281 -47
  99. package/src/lib/mcp-scaffold.js +318 -54
  100. package/src/lib/memory-injection.js +288 -49
  101. package/src/lib/nostr-bridge.js +286 -49
  102. package/src/lib/orchestrator.js +293 -48
  103. package/src/lib/pdf-parser.js +298 -49
  104. package/src/lib/perf-tuning.js +309 -50
  105. package/src/lib/permission-engine.js +287 -49
  106. package/src/lib/pipeline-orchestrator.js +289 -49
  107. package/src/lib/plan-mode.js +298 -51
  108. package/src/lib/privacy-computing.js +335 -0
  109. package/src/lib/reputation-optimizer.js +340 -0
  110. package/src/lib/sandbox-v2.js +327 -0
  111. package/src/lib/service-container.js +313 -52
  112. package/src/lib/session-consolidator.js +296 -49
  113. package/src/lib/session-hooks.js +312 -53
  114. package/src/lib/session-search.js +304 -51
  115. package/src/lib/session-tail.js +288 -49
  116. package/src/lib/session-usage.js +298 -52
  117. package/src/lib/siem-exporter.js +298 -51
  118. package/src/lib/skill-marketplace.js +345 -0
  119. package/src/lib/sla-manager.js +341 -0
  120. package/src/lib/slot-filler.js +303 -51
  121. package/src/lib/social-graph-analytics.js +295 -49
  122. package/src/lib/social-graph.js +272 -49
  123. package/src/lib/stress-tester.js +342 -0
  124. package/src/lib/sub-agent-registry.js +302 -53
  125. package/src/lib/task-model-selector.js +302 -50
  126. package/src/lib/terraform-manager.js +333 -0
  127. package/src/lib/todo-manager.js +281 -47
  128. package/src/lib/token-incentive.js +341 -0
  129. package/src/lib/topic-classifier.js +297 -49
  130. package/src/lib/user-profile.js +294 -50
  131. package/src/lib/version-checker.js +304 -50
  132. package/src/lib/web-fetch.js +292 -51
  133. package/src/lib/zkp-engine.js +286 -49
@@ -952,7 +952,6 @@ export function registerEvoMapCommand(program) {
952
952
  registerEvoMapV2Command(evomap);
953
953
  }
954
954
 
955
-
956
955
  import {
957
956
  EVOMAP_MAP_MATURITY_V2,
958
957
  EVOMAP_EVOLUTION_LIFECYCLE_V2,
@@ -984,30 +983,186 @@ import {
984
983
  } from "../lib/evomap-manager.js";
985
984
 
986
985
  export function registerEvoMapV2Command(evomap) {
987
- evomap.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ EVOMAP_MAP_MATURITY_V2, EVOMAP_EVOLUTION_LIFECYCLE_V2 }, null, 2)); });
988
- evomap.command("register-map-v2").description("Register an evomap profile (pending)")
989
- .requiredOption("--id <id>").requiredOption("--owner <owner>").option("--name <name>")
990
- .action((o) => { console.log(JSON.stringify(registerEvoMapV2(o), null, 2)); });
991
- evomap.command("activate-map-v2 <id>").description("Activate map").action((id) => { console.log(JSON.stringify(activateEvoMapV2(id), null, 2)); });
992
- evomap.command("stale-map-v2 <id>").description("Mark map stale").action((id) => { console.log(JSON.stringify(staleEvoMapV2(id), null, 2)); });
993
- evomap.command("archive-map-v2 <id>").description("Archive map (terminal)").action((id) => { console.log(JSON.stringify(archiveEvoMapV2(id), null, 2)); });
994
- evomap.command("touch-map-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchEvoMapV2(id), null, 2)); });
995
- evomap.command("get-map-v2 <id>").description("Get map").action((id) => { console.log(JSON.stringify(getEvoMapV2(id), null, 2)); });
996
- evomap.command("list-maps-v2").description("List maps").action(() => { console.log(JSON.stringify(listEvoMapsV2(), null, 2)); });
997
- evomap.command("create-evolution-v2").description("Create an evolution (queued)")
998
- .requiredOption("--id <id>").requiredOption("--map-id <mapId>").option("--strategy <strategy>")
999
- .action((o) => { console.log(JSON.stringify(createEvoEvolutionV2({ id: o.id, mapId: o.mapId, strategy: o.strategy }), null, 2)); });
1000
- evomap.command("start-evolution-v2 <id>").description("Transition evolution to running").action((id) => { console.log(JSON.stringify(startEvoEvolutionV2(id), null, 2)); });
1001
- evomap.command("complete-evolution-v2 <id>").description("Transition evolution to completed").action((id) => { console.log(JSON.stringify(completeEvoEvolutionV2(id), null, 2)); });
1002
- evomap.command("fail-evolution-v2 <id>").description("Fail evolution").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failEvoEvolutionV2(id, o.reason), null, 2)); });
1003
- evomap.command("cancel-evolution-v2 <id>").description("Cancel evolution").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelEvoEvolutionV2(id, o.reason), null, 2)); });
1004
- evomap.command("get-evolution-v2 <id>").description("Get evolution").action((id) => { console.log(JSON.stringify(getEvoEvolutionV2(id), null, 2)); });
1005
- evomap.command("list-evolutions-v2").description("List evolutions").action(() => { console.log(JSON.stringify(listEvoEvolutionsV2(), null, 2)); });
1006
- evomap.command("set-max-active-maps-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveEvoMapsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveEvoMapsPerOwner: getMaxActiveEvoMapsPerOwnerV2() }, null, 2)); });
1007
- evomap.command("set-max-pending-evolutions-v2 <n>").description("Set per-map pending cap").action((n) => { setMaxPendingEvoEvolutionsPerMapV2(Number(n)); console.log(JSON.stringify({ maxPendingEvoEvolutionsPerMap: getMaxPendingEvoEvolutionsPerMapV2() }, null, 2)); });
1008
- evomap.command("set-map-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setEvoMapIdleMsV2(Number(n)); console.log(JSON.stringify({ evoMapIdleMs: getEvoMapIdleMsV2() }, null, 2)); });
1009
- evomap.command("set-evolution-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setEvoEvolutionStuckMsV2(Number(n)); console.log(JSON.stringify({ evoEvolutionStuckMs: getEvoEvolutionStuckMsV2() }, null, 2)); });
1010
- evomap.command("auto-stale-idle-maps-v2").description("Auto-stale idle maps").action(() => { console.log(JSON.stringify(autoStaleIdleEvoMapsV2(), null, 2)); });
1011
- evomap.command("auto-fail-stuck-evolutions-v2").description("Auto-fail stuck running evolutions").action(() => { console.log(JSON.stringify(autoFailStuckEvoEvolutionsV2(), null, 2)); });
1012
- evomap.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getEvoMapManagerStatsV2(), null, 2)); });
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
+ });
1013
1168
  }
@@ -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
  }
@@ -216,45 +216,185 @@ export function registerGitCommand(program) {
216
216
  _registerGitV2(git);
217
217
  }
218
218
 
219
-
220
219
  import {
221
- GIT_REPO_MATURITY_V2, GIT_COMMIT_LIFECYCLE_V2,
222
- setMaxActiveGitReposPerOwnerV2, setMaxPendingGitCommitsPerRepoV2, setGitRepoIdleMsV2, setGitCommitStuckMsV2,
223
- registerGitRepoV2, activateGitRepoV2, archiveGitRepoV2, decommissionGitRepoV2, touchGitRepoV2, getGitRepoV2, listGitReposV2,
224
- createGitCommitV2, startGitCommitV2, commitGitCommitV2, failGitCommitV2, cancelGitCommitV2, getGitCommitV2, listGitCommitsV2,
225
- autoArchiveIdleGitReposV2, autoFailStuckGitCommitsV2, getGitIntegrationGovStatsV2,
220
+ GIT_REPO_MATURITY_V2,
221
+ GIT_COMMIT_LIFECYCLE_V2,
222
+ setMaxActiveGitReposPerOwnerV2,
223
+ setMaxPendingGitCommitsPerRepoV2,
224
+ setGitRepoIdleMsV2,
225
+ setGitCommitStuckMsV2,
226
+ registerGitRepoV2,
227
+ activateGitRepoV2,
228
+ archiveGitRepoV2,
229
+ decommissionGitRepoV2,
230
+ touchGitRepoV2,
231
+ getGitRepoV2,
232
+ listGitReposV2,
233
+ createGitCommitV2,
234
+ startGitCommitV2,
235
+ commitGitCommitV2,
236
+ failGitCommitV2,
237
+ cancelGitCommitV2,
238
+ getGitCommitV2,
239
+ listGitCommitsV2,
240
+ autoArchiveIdleGitReposV2,
241
+ autoFailStuckGitCommitsV2,
242
+ getGitIntegrationGovStatsV2,
226
243
  } from "../lib/git-integration.js";
227
244
 
228
245
  function _registerGitV2(parent) {
229
- parent.command("enums-v2").description("List Git V2 enums").option("--json", "JSON").action((opts) => {
230
- const out = { repoMaturity: GIT_REPO_MATURITY_V2, commitLifecycle: GIT_COMMIT_LIFECYCLE_V2 };
231
- if (opts.json) console.log(JSON.stringify(out, null, 2)); else console.log(out);
232
- });
233
- parent.command("config-set-v2").description("Set Git V2 caps/thresholds").option("--max-active <n>", "max active repos per owner").option("--max-pending <n>", "max pending commits per repo").option("--idle-ms <n>", "repo idle ms").option("--stuck-ms <n>", "commit stuck ms").action((opts) => {
234
- if (opts.maxActive) setMaxActiveGitReposPerOwnerV2(parseInt(opts.maxActive, 10));
235
- if (opts.maxPending) setMaxPendingGitCommitsPerRepoV2(parseInt(opts.maxPending, 10));
236
- if (opts.idleMs) setGitRepoIdleMsV2(parseInt(opts.idleMs, 10));
237
- if (opts.stuckMs) setGitCommitStuckMsV2(parseInt(opts.stuckMs, 10));
238
- console.log("ok");
239
- });
240
- parent.command("register-repo-v2 <id>").description("Register Git V2 repo").requiredOption("--owner <owner>", "owner").option("--branch <branch>", "branch").option("--json", "JSON").action((id, opts) => {
241
- const r = registerGitRepoV2({ id, owner: opts.owner, branch: opts.branch });
242
- if (opts.json) console.log(JSON.stringify(r, null, 2)); else console.log(r);
243
- });
244
- parent.command("activate-repo-v2 <id>").description("Activate Git V2 repo").action((id) => { console.log(activateGitRepoV2(id)); });
245
- parent.command("archive-repo-v2 <id>").description("Archive Git V2 repo").action((id) => { console.log(archiveGitRepoV2(id)); });
246
- parent.command("decommission-repo-v2 <id>").description("Decommission Git V2 repo").action((id) => { console.log(decommissionGitRepoV2(id)); });
247
- parent.command("touch-repo-v2 <id>").description("Touch Git V2 repo").action((id) => { console.log(touchGitRepoV2(id)); });
248
- parent.command("get-repo-v2 <id>").description("Get Git V2 repo").option("--json", "JSON").action((id, opts) => { const r = getGitRepoV2(id); if (opts.json) console.log(JSON.stringify(r, null, 2)); else console.log(r); });
249
- parent.command("list-repos-v2").description("List Git V2 repos").option("--json", "JSON").action((opts) => { const r = listGitReposV2(); if (opts.json) console.log(JSON.stringify(r, null, 2)); else console.log(r); });
250
- parent.command("create-commit-v2 <id>").description("Create Git V2 commit").requiredOption("--repo-id <repoId>", "repo id").option("--message <msg>", "commit message").action((id, opts) => { console.log(createGitCommitV2({ id, repoId: opts.repoId, message: opts.message })); });
251
- parent.command("start-commit-v2 <id>").description("Start Git V2 commit").action((id) => { console.log(startGitCommitV2(id)); });
252
- parent.command("commit-commit-v2 <id>").description("Commit Git V2 commit").action((id) => { console.log(commitGitCommitV2(id)); });
253
- parent.command("fail-commit-v2 <id>").description("Fail Git V2 commit").option("--reason <r>", "reason").action((id, opts) => { console.log(failGitCommitV2(id, opts.reason)); });
254
- parent.command("cancel-commit-v2 <id>").description("Cancel Git V2 commit").option("--reason <r>", "reason").action((id, opts) => { console.log(cancelGitCommitV2(id, opts.reason)); });
255
- parent.command("get-commit-v2 <id>").description("Get Git V2 commit").action((id) => { console.log(getGitCommitV2(id)); });
256
- parent.command("list-commits-v2").description("List Git V2 commits").action(() => { console.log(listGitCommitsV2()); });
257
- parent.command("auto-archive-repos-v2").description("Auto-archive idle Git V2 repos").action(() => { console.log(autoArchiveIdleGitReposV2()); });
258
- parent.command("auto-fail-commits-v2").description("Auto-fail stuck Git V2 commits").action(() => { console.log(autoFailStuckGitCommitsV2()); });
259
- parent.command("gov-stats-v2").description("Git V2 governance stats").option("--json", "JSON").action((opts) => { const s = getGitIntegrationGovStatsV2(); if (opts.json) console.log(JSON.stringify(s, null, 2)); else console.log(s); });
246
+ parent
247
+ .command("enums-v2")
248
+ .description("List Git V2 enums")
249
+ .option("--json", "JSON")
250
+ .action((opts) => {
251
+ const out = {
252
+ repoMaturity: GIT_REPO_MATURITY_V2,
253
+ commitLifecycle: GIT_COMMIT_LIFECYCLE_V2,
254
+ };
255
+ if (opts.json) console.log(JSON.stringify(out, null, 2));
256
+ else console.log(out);
257
+ });
258
+ parent
259
+ .command("config-set-v2")
260
+ .description("Set Git V2 caps/thresholds")
261
+ .option("--max-active <n>", "max active repos per owner")
262
+ .option("--max-pending <n>", "max pending commits per repo")
263
+ .option("--idle-ms <n>", "repo idle ms")
264
+ .option("--stuck-ms <n>", "commit stuck ms")
265
+ .action((opts) => {
266
+ if (opts.maxActive)
267
+ setMaxActiveGitReposPerOwnerV2(parseInt(opts.maxActive, 10));
268
+ if (opts.maxPending)
269
+ setMaxPendingGitCommitsPerRepoV2(parseInt(opts.maxPending, 10));
270
+ if (opts.idleMs) setGitRepoIdleMsV2(parseInt(opts.idleMs, 10));
271
+ if (opts.stuckMs) setGitCommitStuckMsV2(parseInt(opts.stuckMs, 10));
272
+ console.log("ok");
273
+ });
274
+ parent
275
+ .command("register-repo-v2 <id>")
276
+ .description("Register Git V2 repo")
277
+ .requiredOption("--owner <owner>", "owner")
278
+ .option("--branch <branch>", "branch")
279
+ .option("--json", "JSON")
280
+ .action((id, opts) => {
281
+ const r = registerGitRepoV2({
282
+ id,
283
+ owner: opts.owner,
284
+ branch: opts.branch,
285
+ });
286
+ if (opts.json) console.log(JSON.stringify(r, null, 2));
287
+ else console.log(r);
288
+ });
289
+ parent
290
+ .command("activate-repo-v2 <id>")
291
+ .description("Activate Git V2 repo")
292
+ .action((id) => {
293
+ console.log(activateGitRepoV2(id));
294
+ });
295
+ parent
296
+ .command("archive-repo-v2 <id>")
297
+ .description("Archive Git V2 repo")
298
+ .action((id) => {
299
+ console.log(archiveGitRepoV2(id));
300
+ });
301
+ parent
302
+ .command("decommission-repo-v2 <id>")
303
+ .description("Decommission Git V2 repo")
304
+ .action((id) => {
305
+ console.log(decommissionGitRepoV2(id));
306
+ });
307
+ parent
308
+ .command("touch-repo-v2 <id>")
309
+ .description("Touch Git V2 repo")
310
+ .action((id) => {
311
+ console.log(touchGitRepoV2(id));
312
+ });
313
+ parent
314
+ .command("get-repo-v2 <id>")
315
+ .description("Get Git V2 repo")
316
+ .option("--json", "JSON")
317
+ .action((id, opts) => {
318
+ const r = getGitRepoV2(id);
319
+ if (opts.json) console.log(JSON.stringify(r, null, 2));
320
+ else console.log(r);
321
+ });
322
+ parent
323
+ .command("list-repos-v2")
324
+ .description("List Git V2 repos")
325
+ .option("--json", "JSON")
326
+ .action((opts) => {
327
+ const r = listGitReposV2();
328
+ if (opts.json) console.log(JSON.stringify(r, null, 2));
329
+ else console.log(r);
330
+ });
331
+ parent
332
+ .command("create-commit-v2 <id>")
333
+ .description("Create Git V2 commit")
334
+ .requiredOption("--repo-id <repoId>", "repo id")
335
+ .option("--message <msg>", "commit message")
336
+ .action((id, opts) => {
337
+ console.log(
338
+ createGitCommitV2({ id, repoId: opts.repoId, message: opts.message }),
339
+ );
340
+ });
341
+ parent
342
+ .command("start-commit-v2 <id>")
343
+ .description("Start Git V2 commit")
344
+ .action((id) => {
345
+ console.log(startGitCommitV2(id));
346
+ });
347
+ parent
348
+ .command("commit-commit-v2 <id>")
349
+ .description("Commit Git V2 commit")
350
+ .action((id) => {
351
+ console.log(commitGitCommitV2(id));
352
+ });
353
+ parent
354
+ .command("fail-commit-v2 <id>")
355
+ .description("Fail Git V2 commit")
356
+ .option("--reason <r>", "reason")
357
+ .action((id, opts) => {
358
+ console.log(failGitCommitV2(id, opts.reason));
359
+ });
360
+ parent
361
+ .command("cancel-commit-v2 <id>")
362
+ .description("Cancel Git V2 commit")
363
+ .option("--reason <r>", "reason")
364
+ .action((id, opts) => {
365
+ console.log(cancelGitCommitV2(id, opts.reason));
366
+ });
367
+ parent
368
+ .command("get-commit-v2 <id>")
369
+ .description("Get Git V2 commit")
370
+ .action((id) => {
371
+ console.log(getGitCommitV2(id));
372
+ });
373
+ parent
374
+ .command("list-commits-v2")
375
+ .description("List Git V2 commits")
376
+ .action(() => {
377
+ console.log(listGitCommitsV2());
378
+ });
379
+ parent
380
+ .command("auto-archive-repos-v2")
381
+ .description("Auto-archive idle Git V2 repos")
382
+ .action(() => {
383
+ console.log(autoArchiveIdleGitReposV2());
384
+ });
385
+ parent
386
+ .command("auto-fail-commits-v2")
387
+ .description("Auto-fail stuck Git V2 commits")
388
+ .action(() => {
389
+ console.log(autoFailStuckGitCommitsV2());
390
+ });
391
+ parent
392
+ .command("gov-stats-v2")
393
+ .description("Git V2 governance stats")
394
+ .option("--json", "JSON")
395
+ .action((opts) => {
396
+ const s = getGitIntegrationGovStatsV2();
397
+ if (opts.json) console.log(JSON.stringify(s, null, 2));
398
+ else console.log(s);
399
+ });
260
400
  }