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
@@ -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
+ }
@@ -0,0 +1,157 @@
1
+ /**
2
+ * `cc svccont` — Service Container V2 governance overlay.
3
+ *
4
+ * In-memory governance for service containers + resolution lifecycle, layered
5
+ * atop `lib/service-container.js`. Independent of legacy DI/registry helpers.
6
+ */
7
+
8
+ import {
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,
37
+ } from "../lib/service-container.js";
38
+
39
+ export function registerSvcContCommand(program) {
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
+ });
157
+ }
@@ -391,3 +391,209 @@ export function registerTerraformCommand(program) {
391
391
  });
392
392
  });
393
393
  }
394
+
395
+ // === Iter16 V2 governance overlay ===
396
+ export function registerTfgovV2Commands(program) {
397
+ const parent = program.commands.find((c) => c.name() === "terraform");
398
+ if (!parent) return;
399
+ const L = async () => await import("../lib/terraform-manager.js");
400
+ parent
401
+ .command("tfgov-enums-v2")
402
+ .description("Show V2 enums (tfgov maturity + apply lifecycle)")
403
+ .action(async () => {
404
+ const m = await L();
405
+ console.log(
406
+ JSON.stringify(
407
+ {
408
+ profileMaturity: m.TFGOV_PROFILE_MATURITY_V2,
409
+ applyLifecycle: m.TFGOV_APPLY_LIFECYCLE_V2,
410
+ },
411
+ null,
412
+ 2,
413
+ ),
414
+ );
415
+ });
416
+ parent
417
+ .command("tfgov-config-v2")
418
+ .description("Show V2 config thresholds")
419
+ .action(async () => {
420
+ const m = await L();
421
+ console.log(
422
+ JSON.stringify(
423
+ {
424
+ maxActive: m.getMaxActiveTfgovProfilesPerOwnerV2(),
425
+ maxPending: m.getMaxPendingTfgovApplysPerProfileV2(),
426
+ idleMs: m.getTfgovProfileIdleMsV2(),
427
+ stuckMs: m.getTfgovApplyStuckMsV2(),
428
+ },
429
+ null,
430
+ 2,
431
+ ),
432
+ );
433
+ });
434
+ parent
435
+ .command("tfgov-set-max-active-v2 <n>")
436
+ .description("Set max active profiles per owner")
437
+ .action(async (n) => {
438
+ const m = await L();
439
+ m.setMaxActiveTfgovProfilesPerOwnerV2(Number(n));
440
+ console.log("ok");
441
+ });
442
+ parent
443
+ .command("tfgov-set-max-pending-v2 <n>")
444
+ .description("Set max pending applys per profile")
445
+ .action(async (n) => {
446
+ const m = await L();
447
+ m.setMaxPendingTfgovApplysPerProfileV2(Number(n));
448
+ console.log("ok");
449
+ });
450
+ parent
451
+ .command("tfgov-set-idle-ms-v2 <n>")
452
+ .description("Set profile idle threshold (ms)")
453
+ .action(async (n) => {
454
+ const m = await L();
455
+ m.setTfgovProfileIdleMsV2(Number(n));
456
+ console.log("ok");
457
+ });
458
+ parent
459
+ .command("tfgov-set-stuck-ms-v2 <n>")
460
+ .description("Set apply stuck threshold (ms)")
461
+ .action(async (n) => {
462
+ const m = await L();
463
+ m.setTfgovApplyStuckMsV2(Number(n));
464
+ console.log("ok");
465
+ });
466
+ parent
467
+ .command("tfgov-register-v2 <id> <owner>")
468
+ .description("Register V2 tfgov profile")
469
+ .option("--provider <v>", "provider")
470
+ .action(async (id, owner, o) => {
471
+ const m = await L();
472
+ console.log(
473
+ JSON.stringify(
474
+ m.registerTfgovProfileV2({ id, owner, provider: o.provider }),
475
+ null,
476
+ 2,
477
+ ),
478
+ );
479
+ });
480
+ parent
481
+ .command("tfgov-activate-v2 <id>")
482
+ .description("Activate profile")
483
+ .action(async (id) => {
484
+ const m = await L();
485
+ console.log(JSON.stringify(m.activateTfgovProfileV2(id), null, 2));
486
+ });
487
+ parent
488
+ .command("tfgov-drift-v2 <id>")
489
+ .description("Drift profile")
490
+ .action(async (id) => {
491
+ const m = await L();
492
+ console.log(JSON.stringify(m.driftTfgovProfileV2(id), null, 2));
493
+ });
494
+ parent
495
+ .command("tfgov-archive-v2 <id>")
496
+ .description("Archive profile (terminal)")
497
+ .action(async (id) => {
498
+ const m = await L();
499
+ console.log(JSON.stringify(m.archiveTfgovProfileV2(id), null, 2));
500
+ });
501
+ parent
502
+ .command("tfgov-touch-v2 <id>")
503
+ .description("Touch profile")
504
+ .action(async (id) => {
505
+ const m = await L();
506
+ console.log(JSON.stringify(m.touchTfgovProfileV2(id), null, 2));
507
+ });
508
+ parent
509
+ .command("tfgov-get-v2 <id>")
510
+ .description("Get profile")
511
+ .action(async (id) => {
512
+ const m = await L();
513
+ console.log(JSON.stringify(m.getTfgovProfileV2(id), null, 2));
514
+ });
515
+ parent
516
+ .command("tfgov-list-v2")
517
+ .description("List profiles")
518
+ .action(async () => {
519
+ const m = await L();
520
+ console.log(JSON.stringify(m.listTfgovProfilesV2(), null, 2));
521
+ });
522
+ parent
523
+ .command("tfgov-create-apply-v2 <id> <profileId>")
524
+ .description("Create apply (queued)")
525
+ .option("--resource <v>", "resource")
526
+ .action(async (id, profileId, o) => {
527
+ const m = await L();
528
+ console.log(
529
+ JSON.stringify(
530
+ m.createTfgovApplyV2({ id, profileId, resource: o.resource }),
531
+ null,
532
+ 2,
533
+ ),
534
+ );
535
+ });
536
+ parent
537
+ .command("tfgov-applying-apply-v2 <id>")
538
+ .description("Mark apply as applying")
539
+ .action(async (id) => {
540
+ const m = await L();
541
+ console.log(JSON.stringify(m.applyingTfgovApplyV2(id), null, 2));
542
+ });
543
+ parent
544
+ .command("tfgov-complete-apply-v2 <id>")
545
+ .description("Complete apply")
546
+ .action(async (id) => {
547
+ const m = await L();
548
+ console.log(JSON.stringify(m.completeApplyTfgovV2(id), null, 2));
549
+ });
550
+ parent
551
+ .command("tfgov-fail-apply-v2 <id> [reason]")
552
+ .description("Fail apply")
553
+ .action(async (id, reason) => {
554
+ const m = await L();
555
+ console.log(JSON.stringify(m.failTfgovApplyV2(id, reason), null, 2));
556
+ });
557
+ parent
558
+ .command("tfgov-cancel-apply-v2 <id> [reason]")
559
+ .description("Cancel apply")
560
+ .action(async (id, reason) => {
561
+ const m = await L();
562
+ console.log(JSON.stringify(m.cancelTfgovApplyV2(id, reason), null, 2));
563
+ });
564
+ parent
565
+ .command("tfgov-get-apply-v2 <id>")
566
+ .description("Get apply")
567
+ .action(async (id) => {
568
+ const m = await L();
569
+ console.log(JSON.stringify(m.getTfgovApplyV2(id), null, 2));
570
+ });
571
+ parent
572
+ .command("tfgov-list-applys-v2")
573
+ .description("List applys")
574
+ .action(async () => {
575
+ const m = await L();
576
+ console.log(JSON.stringify(m.listTfgovApplysV2(), null, 2));
577
+ });
578
+ parent
579
+ .command("tfgov-auto-drift-idle-v2")
580
+ .description("Auto-drift idle profiles")
581
+ .action(async () => {
582
+ const m = await L();
583
+ console.log(JSON.stringify(m.autoDriftIdleTfgovProfilesV2(), null, 2));
584
+ });
585
+ parent
586
+ .command("tfgov-auto-fail-stuck-v2")
587
+ .description("Auto-fail stuck applys")
588
+ .action(async () => {
589
+ const m = await L();
590
+ console.log(JSON.stringify(m.autoFailStuckTfgovApplysV2(), null, 2));
591
+ });
592
+ parent
593
+ .command("tfgov-gov-stats-v2")
594
+ .description("V2 gov aggregate stats")
595
+ .action(async () => {
596
+ const m = await L();
597
+ console.log(JSON.stringify(m.getTerraformManagerGovStatsV2(), null, 2));
598
+ });
599
+ }