chainlesschain 0.143.0 → 0.152.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +364 -27
  4. package/src/commands/agent-network.js +217 -0
  5. package/src/commands/agent.js +587 -103
  6. package/src/commands/audit.js +206 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +355 -27
  9. package/src/commands/bm25.js +111 -27
  10. package/src/commands/browse.js +403 -29
  11. package/src/commands/ccron.js +128 -28
  12. package/src/commands/chat.js +207 -0
  13. package/src/commands/codegen.js +207 -0
  14. package/src/commands/collab.js +211 -0
  15. package/src/commands/compliance.js +824 -34
  16. package/src/commands/compt.js +127 -29
  17. package/src/commands/consol.js +8 -2
  18. package/src/commands/cowork.js +783 -34
  19. package/src/commands/crosschain.js +182 -28
  20. package/src/commands/dao.js +182 -28
  21. package/src/commands/dbevo.js +227 -0
  22. package/src/commands/dev.js +207 -0
  23. package/src/commands/did-v2.js +217 -0
  24. package/src/commands/did.js +221 -0
  25. package/src/commands/dlp.js +385 -27
  26. package/src/commands/economy.js +205 -50
  27. package/src/commands/evolution.js +203 -50
  28. package/src/commands/evomap.js +387 -27
  29. package/src/commands/export.js +213 -0
  30. package/src/commands/federation.js +209 -0
  31. package/src/commands/fflag.js +74 -22
  32. package/src/commands/fusion.js +205 -0
  33. package/src/commands/git.js +177 -37
  34. package/src/commands/governance.js +209 -0
  35. package/src/commands/hardening.js +209 -0
  36. package/src/commands/hmemory.js +204 -50
  37. package/src/commands/hook.js +209 -0
  38. package/src/commands/import.js +209 -0
  39. package/src/commands/incentive.js +209 -0
  40. package/src/commands/inference.js +170 -34
  41. package/src/commands/infra.js +203 -0
  42. package/src/commands/instinct.js +209 -0
  43. package/src/commands/ipfs.js +207 -0
  44. package/src/commands/itbudget.js +149 -33
  45. package/src/commands/kg.js +206 -0
  46. package/src/commands/llm.js +217 -0
  47. package/src/commands/lowcode.js +195 -38
  48. package/src/commands/marketplace.js +206 -0
  49. package/src/commands/matrix.js +386 -27
  50. package/src/commands/mcp.js +217 -0
  51. package/src/commands/mcpscaf.js +145 -33
  52. package/src/commands/meminj.js +145 -33
  53. package/src/commands/memory.js +209 -0
  54. package/src/commands/multimodal.js +203 -0
  55. package/src/commands/nlprog.js +225 -0
  56. package/src/commands/nostr.js +387 -27
  57. package/src/commands/note.js +205 -0
  58. package/src/commands/ops.js +219 -0
  59. package/src/commands/orchestrate.js +217 -0
  60. package/src/commands/orchgov.js +144 -33
  61. package/src/commands/org.js +209 -0
  62. package/src/commands/p2p.js +209 -0
  63. package/src/commands/pdfp.js +109 -27
  64. package/src/commands/perception.js +209 -0
  65. package/src/commands/perf.js +169 -32
  66. package/src/commands/perm.js +144 -33
  67. package/src/commands/permmem.js +203 -0
  68. package/src/commands/pipeline.js +207 -52
  69. package/src/commands/planmode.js +141 -32
  70. package/src/commands/plugin-ecosystem.js +209 -0
  71. package/src/commands/pqc.js +213 -0
  72. package/src/commands/privacy.js +203 -0
  73. package/src/commands/promcomp.js +111 -27
  74. package/src/commands/quantization.js +207 -0
  75. package/src/commands/rcache.js +205 -0
  76. package/src/commands/recommend.js +410 -34
  77. package/src/commands/reputation.js +208 -0
  78. package/src/commands/runtime.js +205 -0
  79. package/src/commands/sandbox.js +206 -0
  80. package/src/commands/scim.js +209 -0
  81. package/src/commands/seshhook.js +145 -33
  82. package/src/commands/seshsearch.js +141 -33
  83. package/src/commands/seshtail.js +144 -33
  84. package/src/commands/seshu.js +152 -33
  85. package/src/commands/session.js +209 -0
  86. package/src/commands/sganal.js +123 -29
  87. package/src/commands/siem.js +201 -34
  88. package/src/commands/skill.js +207 -0
  89. package/src/commands/sla.js +212 -0
  90. package/src/commands/slotfill.js +146 -33
  91. package/src/commands/social.js +358 -32
  92. package/src/commands/sso.js +209 -0
  93. package/src/commands/stress.js +206 -0
  94. package/src/commands/svccont.js +145 -33
  95. package/src/commands/sync.js +209 -0
  96. package/src/commands/tech.js +209 -0
  97. package/src/commands/tenant.js +217 -0
  98. package/src/commands/terraform.js +206 -0
  99. package/src/commands/tms.js +171 -33
  100. package/src/commands/tokens.js +209 -0
  101. package/src/commands/topiccls.js +146 -33
  102. package/src/commands/trust.js +217 -0
  103. package/src/commands/uprof.js +141 -32
  104. package/src/commands/vcheck.js +122 -28
  105. package/src/commands/wallet.js +209 -0
  106. package/src/commands/webfetch.js +141 -32
  107. package/src/commands/workflow.js +203 -0
  108. package/src/commands/zkp.js +184 -28
  109. package/src/index.js +180 -0
  110. package/src/lib/a2a-protocol.js +319 -51
  111. package/src/lib/activitypub-bridge.js +622 -50
  112. package/src/lib/agent-economy.js +304 -51
  113. package/src/lib/agent-network.js +341 -0
  114. package/src/lib/aiops.js +346 -0
  115. package/src/lib/app-builder.js +279 -46
  116. package/src/lib/audit-logger.js +321 -0
  117. package/src/lib/automation-engine.js +335 -0
  118. package/src/lib/autonomous-agent.js +284 -48
  119. package/src/lib/autonomous-developer.js +332 -0
  120. package/src/lib/bi-engine.js +616 -49
  121. package/src/lib/bm25-search.js +301 -49
  122. package/src/lib/browser-automation.js +630 -49
  123. package/src/lib/chat-core.js +336 -0
  124. package/src/lib/claude-code-bridge.js +341 -0
  125. package/src/lib/code-agent.js +339 -0
  126. package/src/lib/collaboration-governance.js +334 -0
  127. package/src/lib/community-governance.js +346 -0
  128. package/src/lib/compliance-framework-reporter.js +305 -51
  129. package/src/lib/compliance-manager.js +330 -0
  130. package/src/lib/compression-telemetry.js +301 -49
  131. package/src/lib/content-recommendation.js +351 -0
  132. package/src/lib/content-recommender.js +317 -52
  133. package/src/lib/cowork-cron.js +298 -49
  134. package/src/lib/cowork-learning.js +333 -0
  135. package/src/lib/cowork-share.js +338 -0
  136. package/src/lib/cowork-task-runner.js +308 -51
  137. package/src/lib/cowork-workflow.js +327 -0
  138. package/src/lib/cross-chain.js +311 -51
  139. package/src/lib/dao-governance.js +280 -46
  140. package/src/lib/dbevo.js +351 -0
  141. package/src/lib/decentral-infra.js +330 -0
  142. package/src/lib/did-manager.js +341 -0
  143. package/src/lib/did-v2-manager.js +341 -0
  144. package/src/lib/dlp-engine.js +626 -49
  145. package/src/lib/evolution-system.js +278 -47
  146. package/src/lib/evomap-governance.js +334 -0
  147. package/src/lib/evomap-manager.js +280 -46
  148. package/src/lib/execution-backend.js +294 -48
  149. package/src/lib/feature-flags.js +294 -49
  150. package/src/lib/federation-hardening.js +340 -0
  151. package/src/lib/git-integration.js +285 -47
  152. package/src/lib/hardening-manager.js +341 -0
  153. package/src/lib/hierarchical-memory.js +284 -48
  154. package/src/lib/hook-manager.js +341 -0
  155. package/src/lib/inference-network.js +308 -51
  156. package/src/lib/instinct-manager.js +346 -0
  157. package/src/lib/ipfs-storage.js +334 -0
  158. package/src/lib/iteration-budget.js +302 -50
  159. package/src/lib/knowledge-exporter.js +341 -0
  160. package/src/lib/knowledge-graph.js +333 -0
  161. package/src/lib/knowledge-importer.js +341 -0
  162. package/src/lib/llm-providers.js +346 -0
  163. package/src/lib/matrix-bridge.js +620 -47
  164. package/src/lib/mcp-registry.js +346 -0
  165. package/src/lib/mcp-scaffold.js +318 -54
  166. package/src/lib/memory-injection.js +288 -49
  167. package/src/lib/memory-manager.js +336 -0
  168. package/src/lib/multimodal.js +330 -0
  169. package/src/lib/nl-programming.js +341 -0
  170. package/src/lib/nostr-bridge.js +622 -49
  171. package/src/lib/note-versioning.js +339 -0
  172. package/src/lib/orchestrator.js +293 -48
  173. package/src/lib/org-manager.js +336 -0
  174. package/src/lib/p2p-manager.js +341 -0
  175. package/src/lib/pdf-parser.js +298 -49
  176. package/src/lib/perception.js +346 -0
  177. package/src/lib/perf-tuning.js +309 -50
  178. package/src/lib/permanent-memory.js +327 -0
  179. package/src/lib/permission-engine.js +287 -49
  180. package/src/lib/pipeline-orchestrator.js +289 -49
  181. package/src/lib/plan-mode.js +298 -51
  182. package/src/lib/plugin-ecosystem.js +346 -0
  183. package/src/lib/pqc-manager.js +346 -0
  184. package/src/lib/privacy-computing.js +335 -0
  185. package/src/lib/protocol-fusion.js +338 -0
  186. package/src/lib/quantization.js +337 -0
  187. package/src/lib/reputation-optimizer.js +340 -0
  188. package/src/lib/response-cache.js +333 -0
  189. package/src/lib/sandbox-v2.js +327 -0
  190. package/src/lib/scim-manager.js +346 -0
  191. package/src/lib/service-container.js +313 -52
  192. package/src/lib/session-consolidator.js +296 -49
  193. package/src/lib/session-hooks.js +312 -53
  194. package/src/lib/session-manager.js +334 -0
  195. package/src/lib/session-search.js +304 -51
  196. package/src/lib/session-tail.js +288 -49
  197. package/src/lib/session-usage.js +298 -52
  198. package/src/lib/siem-exporter.js +298 -51
  199. package/src/lib/skill-loader.js +334 -0
  200. package/src/lib/skill-marketplace.js +345 -0
  201. package/src/lib/sla-manager.js +341 -0
  202. package/src/lib/slot-filler.js +303 -51
  203. package/src/lib/social-graph-analytics.js +295 -49
  204. package/src/lib/social-graph.js +272 -49
  205. package/src/lib/social-manager.js +330 -0
  206. package/src/lib/sso-manager.js +340 -0
  207. package/src/lib/stress-tester.js +342 -0
  208. package/src/lib/sub-agent-registry.js +302 -53
  209. package/src/lib/sync-manager.js +336 -0
  210. package/src/lib/task-model-selector.js +302 -50
  211. package/src/lib/tech-learning-engine.js +341 -0
  212. package/src/lib/tenant-saas.js +341 -0
  213. package/src/lib/terraform-manager.js +333 -0
  214. package/src/lib/threat-intel.js +330 -0
  215. package/src/lib/todo-manager.js +281 -47
  216. package/src/lib/token-incentive.js +341 -0
  217. package/src/lib/token-tracker.js +336 -0
  218. package/src/lib/topic-classifier.js +297 -49
  219. package/src/lib/trust-security.js +343 -0
  220. package/src/lib/ueba.js +340 -0
  221. package/src/lib/universal-runtime.js +330 -0
  222. package/src/lib/user-profile.js +294 -50
  223. package/src/lib/version-checker.js +304 -50
  224. package/src/lib/wallet-manager.js +336 -0
  225. package/src/lib/web-fetch.js +292 -51
  226. package/src/lib/workflow-engine.js +330 -0
  227. package/src/lib/zkp-engine.js +286 -49
@@ -981,3 +981,212 @@ export function registerSsoCommand(program) {
981
981
  .description("V2 auto-fail stuck")
982
982
  .action(() => _v2json(autoFailStuckLoginsV2()));
983
983
  }
984
+
985
+ // === Iter19 V2 governance overlay ===
986
+ export function registerSsogovV2Commands(program) {
987
+ const parent = program.commands.find((c) => c.name() === "sso");
988
+ if (!parent) return;
989
+ const L = async () => await import("../lib/sso-manager.js");
990
+ parent
991
+ .command("ssogov-enums-v2")
992
+ .description("Show V2 enums")
993
+ .action(async () => {
994
+ const m = await L();
995
+ console.log(
996
+ JSON.stringify(
997
+ {
998
+ profileMaturity: m.SSOGOV_PROFILE_MATURITY_V2,
999
+ loginLifecycle: m.SSOGOV_LOGIN_LIFECYCLE_V2,
1000
+ },
1001
+ null,
1002
+ 2,
1003
+ ),
1004
+ );
1005
+ });
1006
+ parent
1007
+ .command("ssogov-config-v2")
1008
+ .description("Show V2 config")
1009
+ .action(async () => {
1010
+ const m = await L();
1011
+ console.log(
1012
+ JSON.stringify(
1013
+ {
1014
+ maxActive: m.getMaxActiveSsogovProfilesPerOwnerV2(),
1015
+ maxPending: m.getMaxPendingSsogovLoginsPerProfileV2(),
1016
+ idleMs: m.getSsogovProfileIdleMsV2(),
1017
+ stuckMs: m.getSsogovLoginStuckMsV2(),
1018
+ },
1019
+ null,
1020
+ 2,
1021
+ ),
1022
+ );
1023
+ });
1024
+ parent
1025
+ .command("ssogov-set-max-active-v2 <n>")
1026
+ .description("Set max active")
1027
+ .action(async (n) => {
1028
+ (await L()).setMaxActiveSsogovProfilesPerOwnerV2(Number(n));
1029
+ console.log("ok");
1030
+ });
1031
+ parent
1032
+ .command("ssogov-set-max-pending-v2 <n>")
1033
+ .description("Set max pending")
1034
+ .action(async (n) => {
1035
+ (await L()).setMaxPendingSsogovLoginsPerProfileV2(Number(n));
1036
+ console.log("ok");
1037
+ });
1038
+ parent
1039
+ .command("ssogov-set-idle-ms-v2 <n>")
1040
+ .description("Set idle threshold ms")
1041
+ .action(async (n) => {
1042
+ (await L()).setSsogovProfileIdleMsV2(Number(n));
1043
+ console.log("ok");
1044
+ });
1045
+ parent
1046
+ .command("ssogov-set-stuck-ms-v2 <n>")
1047
+ .description("Set stuck threshold ms")
1048
+ .action(async (n) => {
1049
+ (await L()).setSsogovLoginStuckMsV2(Number(n));
1050
+ console.log("ok");
1051
+ });
1052
+ parent
1053
+ .command("ssogov-register-v2 <id> <owner>")
1054
+ .description("Register V2 profile")
1055
+ .option("--protocol <v>", "protocol")
1056
+ .action(async (id, owner, o) => {
1057
+ const m = await L();
1058
+ console.log(
1059
+ JSON.stringify(
1060
+ m.registerSsogovProfileV2({ id, owner, protocol: o.protocol }),
1061
+ null,
1062
+ 2,
1063
+ ),
1064
+ );
1065
+ });
1066
+ parent
1067
+ .command("ssogov-activate-v2 <id>")
1068
+ .description("Activate profile")
1069
+ .action(async (id) => {
1070
+ console.log(
1071
+ JSON.stringify((await L()).activateSsogovProfileV2(id), null, 2),
1072
+ );
1073
+ });
1074
+ parent
1075
+ .command("ssogov-suspend-v2 <id>")
1076
+ .description("Suspend profile")
1077
+ .action(async (id) => {
1078
+ console.log(
1079
+ JSON.stringify((await L()).suspendSsogovProfileV2(id), null, 2),
1080
+ );
1081
+ });
1082
+ parent
1083
+ .command("ssogov-archive-v2 <id>")
1084
+ .description("Archive profile")
1085
+ .action(async (id) => {
1086
+ console.log(
1087
+ JSON.stringify((await L()).archiveSsogovProfileV2(id), null, 2),
1088
+ );
1089
+ });
1090
+ parent
1091
+ .command("ssogov-touch-v2 <id>")
1092
+ .description("Touch profile")
1093
+ .action(async (id) => {
1094
+ console.log(
1095
+ JSON.stringify((await L()).touchSsogovProfileV2(id), null, 2),
1096
+ );
1097
+ });
1098
+ parent
1099
+ .command("ssogov-get-v2 <id>")
1100
+ .description("Get profile")
1101
+ .action(async (id) => {
1102
+ console.log(JSON.stringify((await L()).getSsogovProfileV2(id), null, 2));
1103
+ });
1104
+ parent
1105
+ .command("ssogov-list-v2")
1106
+ .description("List profiles")
1107
+ .action(async () => {
1108
+ console.log(JSON.stringify((await L()).listSsogovProfilesV2(), null, 2));
1109
+ });
1110
+ parent
1111
+ .command("ssogov-create-login-v2 <id> <profileId>")
1112
+ .description("Create login")
1113
+ .option("--subject <v>", "subject")
1114
+ .action(async (id, profileId, o) => {
1115
+ const m = await L();
1116
+ console.log(
1117
+ JSON.stringify(
1118
+ m.createSsogovLoginV2({ id, profileId, subject: o.subject }),
1119
+ null,
1120
+ 2,
1121
+ ),
1122
+ );
1123
+ });
1124
+ parent
1125
+ .command("ssogov-authenticating-login-v2 <id>")
1126
+ .description("Mark login as authenticating")
1127
+ .action(async (id) => {
1128
+ console.log(
1129
+ JSON.stringify((await L()).authenticatingSsogovLoginV2(id), null, 2),
1130
+ );
1131
+ });
1132
+ parent
1133
+ .command("ssogov-complete-login-v2 <id>")
1134
+ .description("Complete login")
1135
+ .action(async (id) => {
1136
+ console.log(
1137
+ JSON.stringify((await L()).completeLoginSsogovV2(id), null, 2),
1138
+ );
1139
+ });
1140
+ parent
1141
+ .command("ssogov-fail-login-v2 <id> [reason]")
1142
+ .description("Fail login")
1143
+ .action(async (id, reason) => {
1144
+ console.log(
1145
+ JSON.stringify((await L()).failSsogovLoginV2(id, reason), null, 2),
1146
+ );
1147
+ });
1148
+ parent
1149
+ .command("ssogov-cancel-login-v2 <id> [reason]")
1150
+ .description("Cancel login")
1151
+ .action(async (id, reason) => {
1152
+ console.log(
1153
+ JSON.stringify((await L()).cancelSsogovLoginV2(id, reason), null, 2),
1154
+ );
1155
+ });
1156
+ parent
1157
+ .command("ssogov-get-login-v2 <id>")
1158
+ .description("Get login")
1159
+ .action(async (id) => {
1160
+ console.log(JSON.stringify((await L()).getSsogovLoginV2(id), null, 2));
1161
+ });
1162
+ parent
1163
+ .command("ssogov-list-logins-v2")
1164
+ .description("List logins")
1165
+ .action(async () => {
1166
+ console.log(JSON.stringify((await L()).listSsogovLoginsV2(), null, 2));
1167
+ });
1168
+ parent
1169
+ .command("ssogov-auto-suspend-idle-v2")
1170
+ .description("Auto-suspend idle")
1171
+ .action(async () => {
1172
+ console.log(
1173
+ JSON.stringify((await L()).autoSuspendIdleSsogovProfilesV2(), null, 2),
1174
+ );
1175
+ });
1176
+ parent
1177
+ .command("ssogov-auto-fail-stuck-v2")
1178
+ .description("Auto-fail stuck logins")
1179
+ .action(async () => {
1180
+ console.log(
1181
+ JSON.stringify((await L()).autoFailStuckSsogovLoginsV2(), null, 2),
1182
+ );
1183
+ });
1184
+ parent
1185
+ .command("ssogov-gov-stats-v2")
1186
+ .description("V2 gov stats")
1187
+ .action(async () => {
1188
+ console.log(
1189
+ JSON.stringify((await L()).getSsoManagerGovStatsV2(), null, 2),
1190
+ );
1191
+ });
1192
+ }
@@ -480,3 +480,209 @@ export function registerStressCommand(program) {
480
480
  console.log(JSON.stringify(getStressStatsV2(), null, 2));
481
481
  });
482
482
  }
483
+
484
+ // === Iter16 V2 governance overlay ===
485
+ export function registerStrgovV2Commands(program) {
486
+ const parent = program.commands.find((c) => c.name() === "stress");
487
+ if (!parent) return;
488
+ const L = async () => await import("../lib/stress-tester.js");
489
+ parent
490
+ .command("strgov-enums-v2")
491
+ .description("Show V2 enums (strgov maturity + run lifecycle)")
492
+ .action(async () => {
493
+ const m = await L();
494
+ console.log(
495
+ JSON.stringify(
496
+ {
497
+ profileMaturity: m.STRGOV_PROFILE_MATURITY_V2,
498
+ runLifecycle: m.STRGOV_RUN_LIFECYCLE_V2,
499
+ },
500
+ null,
501
+ 2,
502
+ ),
503
+ );
504
+ });
505
+ parent
506
+ .command("strgov-config-v2")
507
+ .description("Show V2 config thresholds")
508
+ .action(async () => {
509
+ const m = await L();
510
+ console.log(
511
+ JSON.stringify(
512
+ {
513
+ maxActive: m.getMaxActiveStrgovProfilesPerOwnerV2(),
514
+ maxPending: m.getMaxPendingStrgovRunsPerProfileV2(),
515
+ idleMs: m.getStrgovProfileIdleMsV2(),
516
+ stuckMs: m.getStrgovRunStuckMsV2(),
517
+ },
518
+ null,
519
+ 2,
520
+ ),
521
+ );
522
+ });
523
+ parent
524
+ .command("strgov-set-max-active-v2 <n>")
525
+ .description("Set max active profiles per owner")
526
+ .action(async (n) => {
527
+ const m = await L();
528
+ m.setMaxActiveStrgovProfilesPerOwnerV2(Number(n));
529
+ console.log("ok");
530
+ });
531
+ parent
532
+ .command("strgov-set-max-pending-v2 <n>")
533
+ .description("Set max pending runs per profile")
534
+ .action(async (n) => {
535
+ const m = await L();
536
+ m.setMaxPendingStrgovRunsPerProfileV2(Number(n));
537
+ console.log("ok");
538
+ });
539
+ parent
540
+ .command("strgov-set-idle-ms-v2 <n>")
541
+ .description("Set profile idle threshold (ms)")
542
+ .action(async (n) => {
543
+ const m = await L();
544
+ m.setStrgovProfileIdleMsV2(Number(n));
545
+ console.log("ok");
546
+ });
547
+ parent
548
+ .command("strgov-set-stuck-ms-v2 <n>")
549
+ .description("Set run stuck threshold (ms)")
550
+ .action(async (n) => {
551
+ const m = await L();
552
+ m.setStrgovRunStuckMsV2(Number(n));
553
+ console.log("ok");
554
+ });
555
+ parent
556
+ .command("strgov-register-v2 <id> <owner>")
557
+ .description("Register V2 strgov profile")
558
+ .option("--scenario <v>", "scenario")
559
+ .action(async (id, owner, o) => {
560
+ const m = await L();
561
+ console.log(
562
+ JSON.stringify(
563
+ m.registerStrgovProfileV2({ id, owner, scenario: o.scenario }),
564
+ null,
565
+ 2,
566
+ ),
567
+ );
568
+ });
569
+ parent
570
+ .command("strgov-activate-v2 <id>")
571
+ .description("Activate profile")
572
+ .action(async (id) => {
573
+ const m = await L();
574
+ console.log(JSON.stringify(m.activateStrgovProfileV2(id), null, 2));
575
+ });
576
+ parent
577
+ .command("strgov-stale-v2 <id>")
578
+ .description("Stale profile")
579
+ .action(async (id) => {
580
+ const m = await L();
581
+ console.log(JSON.stringify(m.staleStrgovProfileV2(id), null, 2));
582
+ });
583
+ parent
584
+ .command("strgov-archive-v2 <id>")
585
+ .description("Archive profile (terminal)")
586
+ .action(async (id) => {
587
+ const m = await L();
588
+ console.log(JSON.stringify(m.archiveStrgovProfileV2(id), null, 2));
589
+ });
590
+ parent
591
+ .command("strgov-touch-v2 <id>")
592
+ .description("Touch profile")
593
+ .action(async (id) => {
594
+ const m = await L();
595
+ console.log(JSON.stringify(m.touchStrgovProfileV2(id), null, 2));
596
+ });
597
+ parent
598
+ .command("strgov-get-v2 <id>")
599
+ .description("Get profile")
600
+ .action(async (id) => {
601
+ const m = await L();
602
+ console.log(JSON.stringify(m.getStrgovProfileV2(id), null, 2));
603
+ });
604
+ parent
605
+ .command("strgov-list-v2")
606
+ .description("List profiles")
607
+ .action(async () => {
608
+ const m = await L();
609
+ console.log(JSON.stringify(m.listStrgovProfilesV2(), null, 2));
610
+ });
611
+ parent
612
+ .command("strgov-create-run-v2 <id> <profileId>")
613
+ .description("Create run (queued)")
614
+ .option("--profileRef <v>", "profileRef")
615
+ .action(async (id, profileId, o) => {
616
+ const m = await L();
617
+ console.log(
618
+ JSON.stringify(
619
+ m.createStrgovRunV2({ id, profileId, profileRef: o.profileRef }),
620
+ null,
621
+ 2,
622
+ ),
623
+ );
624
+ });
625
+ parent
626
+ .command("strgov-running-run-v2 <id>")
627
+ .description("Mark run as running")
628
+ .action(async (id) => {
629
+ const m = await L();
630
+ console.log(JSON.stringify(m.runningStrgovRunV2(id), null, 2));
631
+ });
632
+ parent
633
+ .command("strgov-complete-run-v2 <id>")
634
+ .description("Complete run")
635
+ .action(async (id) => {
636
+ const m = await L();
637
+ console.log(JSON.stringify(m.completeRunStrgovV2(id), null, 2));
638
+ });
639
+ parent
640
+ .command("strgov-fail-run-v2 <id> [reason]")
641
+ .description("Fail run")
642
+ .action(async (id, reason) => {
643
+ const m = await L();
644
+ console.log(JSON.stringify(m.failStrgovRunV2(id, reason), null, 2));
645
+ });
646
+ parent
647
+ .command("strgov-cancel-run-v2 <id> [reason]")
648
+ .description("Cancel run")
649
+ .action(async (id, reason) => {
650
+ const m = await L();
651
+ console.log(JSON.stringify(m.cancelStrgovRunV2(id, reason), null, 2));
652
+ });
653
+ parent
654
+ .command("strgov-get-run-v2 <id>")
655
+ .description("Get run")
656
+ .action(async (id) => {
657
+ const m = await L();
658
+ console.log(JSON.stringify(m.getStrgovRunV2(id), null, 2));
659
+ });
660
+ parent
661
+ .command("strgov-list-runs-v2")
662
+ .description("List runs")
663
+ .action(async () => {
664
+ const m = await L();
665
+ console.log(JSON.stringify(m.listStrgovRunsV2(), null, 2));
666
+ });
667
+ parent
668
+ .command("strgov-auto-stale-idle-v2")
669
+ .description("Auto-stale idle profiles")
670
+ .action(async () => {
671
+ const m = await L();
672
+ console.log(JSON.stringify(m.autoStaleIdleStrgovProfilesV2(), null, 2));
673
+ });
674
+ parent
675
+ .command("strgov-auto-fail-stuck-v2")
676
+ .description("Auto-fail stuck runs")
677
+ .action(async () => {
678
+ const m = await L();
679
+ console.log(JSON.stringify(m.autoFailStuckStrgovRunsV2(), null, 2));
680
+ });
681
+ parent
682
+ .command("strgov-gov-stats-v2")
683
+ .description("V2 gov aggregate stats")
684
+ .action(async () => {
685
+ const m = await L();
686
+ console.log(JSON.stringify(m.getStressTesterGovStatsV2(), null, 2));
687
+ });
688
+ }
@@ -6,40 +6,152 @@
6
6
  */
7
7
 
8
8
  import {
9
- SVC_CONTAINER_MATURITY_V2, SVC_RESOLUTION_LIFECYCLE_V2,
10
- setMaxActiveSvcContainersPerOwnerV2, getMaxActiveSvcContainersPerOwnerV2,
11
- setMaxPendingSvcResolutionsPerContainerV2, getMaxPendingSvcResolutionsPerContainerV2,
12
- setSvcContainerIdleMsV2, getSvcContainerIdleMsV2,
13
- setSvcResolutionStuckMsV2, getSvcResolutionStuckMsV2,
14
- registerSvcContainerV2, activateSvcContainerV2, degradeSvcContainerV2, decommissionSvcContainerV2, touchSvcContainerV2, getSvcContainerV2, listSvcContainersV2,
15
- createSvcResolutionV2, resolvingSvcResolutionV2, resolveSvcResolutionV2, failSvcResolutionV2, cancelSvcResolutionV2, getSvcResolutionV2, listSvcResolutionsV2,
16
- autoDegradeIdleSvcContainersV2, autoFailStuckSvcResolutionsV2, getServiceContainerGovStatsV2, _resetStateServiceContainerV2,
9
+ SVC_CONTAINER_MATURITY_V2,
10
+ SVC_RESOLUTION_LIFECYCLE_V2,
11
+ setMaxActiveSvcContainersPerOwnerV2,
12
+ getMaxActiveSvcContainersPerOwnerV2,
13
+ setMaxPendingSvcResolutionsPerContainerV2,
14
+ getMaxPendingSvcResolutionsPerContainerV2,
15
+ setSvcContainerIdleMsV2,
16
+ getSvcContainerIdleMsV2,
17
+ setSvcResolutionStuckMsV2,
18
+ getSvcResolutionStuckMsV2,
19
+ registerSvcContainerV2,
20
+ activateSvcContainerV2,
21
+ degradeSvcContainerV2,
22
+ decommissionSvcContainerV2,
23
+ touchSvcContainerV2,
24
+ getSvcContainerV2,
25
+ listSvcContainersV2,
26
+ createSvcResolutionV2,
27
+ resolvingSvcResolutionV2,
28
+ resolveSvcResolutionV2,
29
+ failSvcResolutionV2,
30
+ cancelSvcResolutionV2,
31
+ getSvcResolutionV2,
32
+ listSvcResolutionsV2,
33
+ autoDegradeIdleSvcContainersV2,
34
+ autoFailStuckSvcResolutionsV2,
35
+ getServiceContainerGovStatsV2,
36
+ _resetStateServiceContainerV2,
17
37
  } from "../lib/service-container.js";
18
38
 
19
39
  export function registerSvcContCommand(program) {
20
- const sc = program.command("svccont").description("Service Container V2 governance");
21
- sc.command("enums-v2").action(() => console.log(JSON.stringify({ containerMaturity: SVC_CONTAINER_MATURITY_V2, resolutionLifecycle: SVC_RESOLUTION_LIFECYCLE_V2 }, null, 2)));
22
- sc.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveSvcContainersPerOwner: getMaxActiveSvcContainersPerOwnerV2(), maxPendingSvcResolutionsPerContainer: getMaxPendingSvcResolutionsPerContainerV2(), svcContainerIdleMs: getSvcContainerIdleMsV2(), svcResolutionStuckMs: getSvcResolutionStuckMsV2() }, null, 2)));
23
- sc.command("set-max-active-v2 <n>").action((n) => { setMaxActiveSvcContainersPerOwnerV2(Number(n)); console.log("ok"); });
24
- sc.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingSvcResolutionsPerContainerV2(Number(n)); console.log("ok"); });
25
- sc.command("set-idle-ms-v2 <n>").action((n) => { setSvcContainerIdleMsV2(Number(n)); console.log("ok"); });
26
- sc.command("set-stuck-ms-v2 <n>").action((n) => { setSvcResolutionStuckMsV2(Number(n)); console.log("ok"); });
27
- sc.command("register-container-v2 <id> <owner>").option("--scope <s>", "scope").action((id, owner, o) => console.log(JSON.stringify(registerSvcContainerV2({ id, owner, scope: o.scope }), null, 2)));
28
- sc.command("activate-container-v2 <id>").action((id) => console.log(JSON.stringify(activateSvcContainerV2(id), null, 2)));
29
- sc.command("degrade-container-v2 <id>").action((id) => console.log(JSON.stringify(degradeSvcContainerV2(id), null, 2)));
30
- sc.command("decommission-container-v2 <id>").action((id) => console.log(JSON.stringify(decommissionSvcContainerV2(id), null, 2)));
31
- sc.command("touch-container-v2 <id>").action((id) => console.log(JSON.stringify(touchSvcContainerV2(id), null, 2)));
32
- sc.command("get-container-v2 <id>").action((id) => console.log(JSON.stringify(getSvcContainerV2(id), null, 2)));
33
- sc.command("list-containers-v2").action(() => console.log(JSON.stringify(listSvcContainersV2(), null, 2)));
34
- sc.command("create-resolution-v2 <id> <containerId>").option("--token <t>", "token").action((id, containerId, o) => console.log(JSON.stringify(createSvcResolutionV2({ id, containerId, token: o.token }), null, 2)));
35
- sc.command("resolving-resolution-v2 <id>").action((id) => console.log(JSON.stringify(resolvingSvcResolutionV2(id), null, 2)));
36
- sc.command("resolve-resolution-v2 <id>").action((id) => console.log(JSON.stringify(resolveSvcResolutionV2(id), null, 2)));
37
- sc.command("fail-resolution-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failSvcResolutionV2(id, reason), null, 2)));
38
- sc.command("cancel-resolution-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelSvcResolutionV2(id, reason), null, 2)));
39
- sc.command("get-resolution-v2 <id>").action((id) => console.log(JSON.stringify(getSvcResolutionV2(id), null, 2)));
40
- sc.command("list-resolutions-v2").action(() => console.log(JSON.stringify(listSvcResolutionsV2(), null, 2)));
41
- sc.command("auto-degrade-idle-v2").action(() => console.log(JSON.stringify(autoDegradeIdleSvcContainersV2(), null, 2)));
42
- sc.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckSvcResolutionsV2(), null, 2)));
43
- sc.command("gov-stats-v2").action(() => console.log(JSON.stringify(getServiceContainerGovStatsV2(), null, 2)));
44
- sc.command("reset-state-v2").action(() => { _resetStateServiceContainerV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
40
+ const sc = program
41
+ .command("svccont")
42
+ .description("Service Container V2 governance");
43
+ sc.command("enums-v2").action(() =>
44
+ console.log(
45
+ JSON.stringify(
46
+ {
47
+ containerMaturity: SVC_CONTAINER_MATURITY_V2,
48
+ resolutionLifecycle: SVC_RESOLUTION_LIFECYCLE_V2,
49
+ },
50
+ null,
51
+ 2,
52
+ ),
53
+ ),
54
+ );
55
+ sc.command("config-v2").action(() =>
56
+ console.log(
57
+ JSON.stringify(
58
+ {
59
+ maxActiveSvcContainersPerOwner: getMaxActiveSvcContainersPerOwnerV2(),
60
+ maxPendingSvcResolutionsPerContainer:
61
+ getMaxPendingSvcResolutionsPerContainerV2(),
62
+ svcContainerIdleMs: getSvcContainerIdleMsV2(),
63
+ svcResolutionStuckMs: getSvcResolutionStuckMsV2(),
64
+ },
65
+ null,
66
+ 2,
67
+ ),
68
+ ),
69
+ );
70
+ sc.command("set-max-active-v2 <n>").action((n) => {
71
+ setMaxActiveSvcContainersPerOwnerV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ sc.command("set-max-pending-v2 <n>").action((n) => {
75
+ setMaxPendingSvcResolutionsPerContainerV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ sc.command("set-idle-ms-v2 <n>").action((n) => {
79
+ setSvcContainerIdleMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ sc.command("set-stuck-ms-v2 <n>").action((n) => {
83
+ setSvcResolutionStuckMsV2(Number(n));
84
+ console.log("ok");
85
+ });
86
+ sc.command("register-container-v2 <id> <owner>")
87
+ .option("--scope <s>", "scope")
88
+ .action((id, owner, o) =>
89
+ console.log(
90
+ JSON.stringify(
91
+ registerSvcContainerV2({ id, owner, scope: o.scope }),
92
+ null,
93
+ 2,
94
+ ),
95
+ ),
96
+ );
97
+ sc.command("activate-container-v2 <id>").action((id) =>
98
+ console.log(JSON.stringify(activateSvcContainerV2(id), null, 2)),
99
+ );
100
+ sc.command("degrade-container-v2 <id>").action((id) =>
101
+ console.log(JSON.stringify(degradeSvcContainerV2(id), null, 2)),
102
+ );
103
+ sc.command("decommission-container-v2 <id>").action((id) =>
104
+ console.log(JSON.stringify(decommissionSvcContainerV2(id), null, 2)),
105
+ );
106
+ sc.command("touch-container-v2 <id>").action((id) =>
107
+ console.log(JSON.stringify(touchSvcContainerV2(id), null, 2)),
108
+ );
109
+ sc.command("get-container-v2 <id>").action((id) =>
110
+ console.log(JSON.stringify(getSvcContainerV2(id), null, 2)),
111
+ );
112
+ sc.command("list-containers-v2").action(() =>
113
+ console.log(JSON.stringify(listSvcContainersV2(), null, 2)),
114
+ );
115
+ sc.command("create-resolution-v2 <id> <containerId>")
116
+ .option("--token <t>", "token")
117
+ .action((id, containerId, o) =>
118
+ console.log(
119
+ JSON.stringify(
120
+ createSvcResolutionV2({ id, containerId, token: o.token }),
121
+ null,
122
+ 2,
123
+ ),
124
+ ),
125
+ );
126
+ sc.command("resolving-resolution-v2 <id>").action((id) =>
127
+ console.log(JSON.stringify(resolvingSvcResolutionV2(id), null, 2)),
128
+ );
129
+ sc.command("resolve-resolution-v2 <id>").action((id) =>
130
+ console.log(JSON.stringify(resolveSvcResolutionV2(id), null, 2)),
131
+ );
132
+ sc.command("fail-resolution-v2 <id> [reason]").action((id, reason) =>
133
+ console.log(JSON.stringify(failSvcResolutionV2(id, reason), null, 2)),
134
+ );
135
+ sc.command("cancel-resolution-v2 <id> [reason]").action((id, reason) =>
136
+ console.log(JSON.stringify(cancelSvcResolutionV2(id, reason), null, 2)),
137
+ );
138
+ sc.command("get-resolution-v2 <id>").action((id) =>
139
+ console.log(JSON.stringify(getSvcResolutionV2(id), null, 2)),
140
+ );
141
+ sc.command("list-resolutions-v2").action(() =>
142
+ console.log(JSON.stringify(listSvcResolutionsV2(), null, 2)),
143
+ );
144
+ sc.command("auto-degrade-idle-v2").action(() =>
145
+ console.log(JSON.stringify(autoDegradeIdleSvcContainersV2(), null, 2)),
146
+ );
147
+ sc.command("auto-fail-stuck-v2").action(() =>
148
+ console.log(JSON.stringify(autoFailStuckSvcResolutionsV2(), null, 2)),
149
+ );
150
+ sc.command("gov-stats-v2").action(() =>
151
+ console.log(JSON.stringify(getServiceContainerGovStatsV2(), null, 2)),
152
+ );
153
+ sc.command("reset-state-v2").action(() => {
154
+ _resetStateServiceContainerV2();
155
+ console.log(JSON.stringify({ ok: true }, null, 2));
156
+ });
45
157
  }