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
@@ -0,0 +1,161 @@
1
+ /**
2
+ * `cc itbudget` — Iteration Budget V2 governance overlay.
3
+ *
4
+ * In-memory governance for iteration budget profiles + run lifecycle, layered
5
+ * atop `lib/iteration-budget.js`.
6
+ */
7
+
8
+ import {
9
+ ITER_BUDGET_PROFILE_MATURITY_V2,
10
+ ITER_RUN_LIFECYCLE_V2,
11
+ setMaxActiveIterBudgetProfilesPerOwnerV2,
12
+ getMaxActiveIterBudgetProfilesPerOwnerV2,
13
+ setMaxPendingIterRunsPerProfileV2,
14
+ getMaxPendingIterRunsPerProfileV2,
15
+ setIterBudgetProfileIdleMsV2,
16
+ getIterBudgetProfileIdleMsV2,
17
+ setIterRunStuckMsV2,
18
+ getIterRunStuckMsV2,
19
+ registerIterBudgetProfileV2,
20
+ activateIterBudgetProfileV2,
21
+ pauseIterBudgetProfileV2,
22
+ exhaustIterBudgetProfileV2,
23
+ touchIterBudgetProfileV2,
24
+ getIterBudgetProfileV2,
25
+ listIterBudgetProfilesV2,
26
+ createIterRunV2,
27
+ startIterRunV2,
28
+ completeIterRunV2,
29
+ failIterRunV2,
30
+ cancelIterRunV2,
31
+ getIterRunV2,
32
+ listIterRunsV2,
33
+ autoPauseIdleIterBudgetProfilesV2,
34
+ autoFailStuckIterRunsV2,
35
+ getIterationBudgetGovStatsV2,
36
+ _resetStateIterationBudgetV2,
37
+ } from "../lib/iteration-budget.js";
38
+
39
+ export function registerItBudgetCommand(program) {
40
+ const ib = program
41
+ .command("itbudget")
42
+ .description("Iteration Budget V2 governance");
43
+ ib.command("enums-v2").action(() =>
44
+ console.log(
45
+ JSON.stringify(
46
+ {
47
+ profileMaturity: ITER_BUDGET_PROFILE_MATURITY_V2,
48
+ runLifecycle: ITER_RUN_LIFECYCLE_V2,
49
+ },
50
+ null,
51
+ 2,
52
+ ),
53
+ ),
54
+ );
55
+ ib.command("config-v2").action(() =>
56
+ console.log(
57
+ JSON.stringify(
58
+ {
59
+ maxActiveIterBudgetProfilesPerOwner:
60
+ getMaxActiveIterBudgetProfilesPerOwnerV2(),
61
+ maxPendingIterRunsPerProfile: getMaxPendingIterRunsPerProfileV2(),
62
+ iterBudgetProfileIdleMs: getIterBudgetProfileIdleMsV2(),
63
+ iterRunStuckMs: getIterRunStuckMsV2(),
64
+ },
65
+ null,
66
+ 2,
67
+ ),
68
+ ),
69
+ );
70
+ ib.command("set-max-active-v2 <n>").action((n) => {
71
+ setMaxActiveIterBudgetProfilesPerOwnerV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ ib.command("set-max-pending-v2 <n>").action((n) => {
75
+ setMaxPendingIterRunsPerProfileV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ ib.command("set-idle-ms-v2 <n>").action((n) => {
79
+ setIterBudgetProfileIdleMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ ib.command("set-stuck-ms-v2 <n>").action((n) => {
83
+ setIterRunStuckMsV2(Number(n));
84
+ console.log("ok");
85
+ });
86
+ ib.command("register-profile-v2 <id> <owner>")
87
+ .option("--budget <n>", "budget")
88
+ .action((id, owner, o) =>
89
+ console.log(
90
+ JSON.stringify(
91
+ registerIterBudgetProfileV2({
92
+ id,
93
+ owner,
94
+ budget: o.budget ? Number(o.budget) : undefined,
95
+ }),
96
+ null,
97
+ 2,
98
+ ),
99
+ ),
100
+ );
101
+ ib.command("activate-profile-v2 <id>").action((id) =>
102
+ console.log(JSON.stringify(activateIterBudgetProfileV2(id), null, 2)),
103
+ );
104
+ ib.command("pause-profile-v2 <id>").action((id) =>
105
+ console.log(JSON.stringify(pauseIterBudgetProfileV2(id), null, 2)),
106
+ );
107
+ ib.command("exhaust-profile-v2 <id>").action((id) =>
108
+ console.log(JSON.stringify(exhaustIterBudgetProfileV2(id), null, 2)),
109
+ );
110
+ ib.command("touch-profile-v2 <id>").action((id) =>
111
+ console.log(JSON.stringify(touchIterBudgetProfileV2(id), null, 2)),
112
+ );
113
+ ib.command("get-profile-v2 <id>").action((id) =>
114
+ console.log(JSON.stringify(getIterBudgetProfileV2(id), null, 2)),
115
+ );
116
+ ib.command("list-profiles-v2").action(() =>
117
+ console.log(JSON.stringify(listIterBudgetProfilesV2(), null, 2)),
118
+ );
119
+ ib.command("create-run-v2 <id> <profileId>")
120
+ .option("--goal <g>", "goal")
121
+ .action((id, profileId, o) =>
122
+ console.log(
123
+ JSON.stringify(
124
+ createIterRunV2({ id, profileId, goal: o.goal }),
125
+ null,
126
+ 2,
127
+ ),
128
+ ),
129
+ );
130
+ ib.command("start-run-v2 <id>").action((id) =>
131
+ console.log(JSON.stringify(startIterRunV2(id), null, 2)),
132
+ );
133
+ ib.command("complete-run-v2 <id>").action((id) =>
134
+ console.log(JSON.stringify(completeIterRunV2(id), null, 2)),
135
+ );
136
+ ib.command("fail-run-v2 <id> [reason]").action((id, reason) =>
137
+ console.log(JSON.stringify(failIterRunV2(id, reason), null, 2)),
138
+ );
139
+ ib.command("cancel-run-v2 <id> [reason]").action((id, reason) =>
140
+ console.log(JSON.stringify(cancelIterRunV2(id, reason), null, 2)),
141
+ );
142
+ ib.command("get-run-v2 <id>").action((id) =>
143
+ console.log(JSON.stringify(getIterRunV2(id), null, 2)),
144
+ );
145
+ ib.command("list-runs-v2").action(() =>
146
+ console.log(JSON.stringify(listIterRunsV2(), null, 2)),
147
+ );
148
+ ib.command("auto-pause-idle-v2").action(() =>
149
+ console.log(JSON.stringify(autoPauseIdleIterBudgetProfilesV2(), null, 2)),
150
+ );
151
+ ib.command("auto-fail-stuck-v2").action(() =>
152
+ console.log(JSON.stringify(autoFailStuckIterRunsV2(), null, 2)),
153
+ );
154
+ ib.command("gov-stats-v2").action(() =>
155
+ console.log(JSON.stringify(getIterationBudgetGovStatsV2(), null, 2)),
156
+ );
157
+ ib.command("reset-state-v2").action(() => {
158
+ _resetStateIterationBudgetV2();
159
+ console.log(JSON.stringify({ ok: true }, null, 2));
160
+ });
161
+ }
@@ -756,3 +756,209 @@ export function registerKgCommand(program) {
756
756
  }
757
757
  });
758
758
  }
759
+
760
+ // === Iter16 V2 governance overlay ===
761
+ export function registerKgovV2Commands(program) {
762
+ const parent = program.commands.find((c) => c.name() === "kg");
763
+ if (!parent) return;
764
+ const L = async () => await import("../lib/knowledge-graph.js");
765
+ parent
766
+ .command("kgov-enums-v2")
767
+ .description("Show V2 enums (kgov maturity + import lifecycle)")
768
+ .action(async () => {
769
+ const m = await L();
770
+ console.log(
771
+ JSON.stringify(
772
+ {
773
+ profileMaturity: m.KGOV_PROFILE_MATURITY_V2,
774
+ importLifecycle: m.KGOV_IMPORT_LIFECYCLE_V2,
775
+ },
776
+ null,
777
+ 2,
778
+ ),
779
+ );
780
+ });
781
+ parent
782
+ .command("kgov-config-v2")
783
+ .description("Show V2 config thresholds")
784
+ .action(async () => {
785
+ const m = await L();
786
+ console.log(
787
+ JSON.stringify(
788
+ {
789
+ maxActive: m.getMaxActiveKgovProfilesPerOwnerV2(),
790
+ maxPending: m.getMaxPendingKgovImportsPerProfileV2(),
791
+ idleMs: m.getKgovProfileIdleMsV2(),
792
+ stuckMs: m.getKgovImportStuckMsV2(),
793
+ },
794
+ null,
795
+ 2,
796
+ ),
797
+ );
798
+ });
799
+ parent
800
+ .command("kgov-set-max-active-v2 <n>")
801
+ .description("Set max active profiles per owner")
802
+ .action(async (n) => {
803
+ const m = await L();
804
+ m.setMaxActiveKgovProfilesPerOwnerV2(Number(n));
805
+ console.log("ok");
806
+ });
807
+ parent
808
+ .command("kgov-set-max-pending-v2 <n>")
809
+ .description("Set max pending imports per profile")
810
+ .action(async (n) => {
811
+ const m = await L();
812
+ m.setMaxPendingKgovImportsPerProfileV2(Number(n));
813
+ console.log("ok");
814
+ });
815
+ parent
816
+ .command("kgov-set-idle-ms-v2 <n>")
817
+ .description("Set profile idle threshold (ms)")
818
+ .action(async (n) => {
819
+ const m = await L();
820
+ m.setKgovProfileIdleMsV2(Number(n));
821
+ console.log("ok");
822
+ });
823
+ parent
824
+ .command("kgov-set-stuck-ms-v2 <n>")
825
+ .description("Set import stuck threshold (ms)")
826
+ .action(async (n) => {
827
+ const m = await L();
828
+ m.setKgovImportStuckMsV2(Number(n));
829
+ console.log("ok");
830
+ });
831
+ parent
832
+ .command("kgov-register-v2 <id> <owner>")
833
+ .description("Register V2 kgov profile")
834
+ .option("--namespace <v>", "namespace")
835
+ .action(async (id, owner, o) => {
836
+ const m = await L();
837
+ console.log(
838
+ JSON.stringify(
839
+ m.registerKgovProfileV2({ id, owner, namespace: o.namespace }),
840
+ null,
841
+ 2,
842
+ ),
843
+ );
844
+ });
845
+ parent
846
+ .command("kgov-activate-v2 <id>")
847
+ .description("Activate profile")
848
+ .action(async (id) => {
849
+ const m = await L();
850
+ console.log(JSON.stringify(m.activateKgovProfileV2(id), null, 2));
851
+ });
852
+ parent
853
+ .command("kgov-stale-v2 <id>")
854
+ .description("Stale profile")
855
+ .action(async (id) => {
856
+ const m = await L();
857
+ console.log(JSON.stringify(m.staleKgovProfileV2(id), null, 2));
858
+ });
859
+ parent
860
+ .command("kgov-archive-v2 <id>")
861
+ .description("Archive profile (terminal)")
862
+ .action(async (id) => {
863
+ const m = await L();
864
+ console.log(JSON.stringify(m.archiveKgovProfileV2(id), null, 2));
865
+ });
866
+ parent
867
+ .command("kgov-touch-v2 <id>")
868
+ .description("Touch profile")
869
+ .action(async (id) => {
870
+ const m = await L();
871
+ console.log(JSON.stringify(m.touchKgovProfileV2(id), null, 2));
872
+ });
873
+ parent
874
+ .command("kgov-get-v2 <id>")
875
+ .description("Get profile")
876
+ .action(async (id) => {
877
+ const m = await L();
878
+ console.log(JSON.stringify(m.getKgovProfileV2(id), null, 2));
879
+ });
880
+ parent
881
+ .command("kgov-list-v2")
882
+ .description("List profiles")
883
+ .action(async () => {
884
+ const m = await L();
885
+ console.log(JSON.stringify(m.listKgovProfilesV2(), null, 2));
886
+ });
887
+ parent
888
+ .command("kgov-create-import-v2 <id> <profileId>")
889
+ .description("Create import (queued)")
890
+ .option("--source <v>", "source")
891
+ .action(async (id, profileId, o) => {
892
+ const m = await L();
893
+ console.log(
894
+ JSON.stringify(
895
+ m.createKgovImportV2({ id, profileId, source: o.source }),
896
+ null,
897
+ 2,
898
+ ),
899
+ );
900
+ });
901
+ parent
902
+ .command("kgov-importing-import-v2 <id>")
903
+ .description("Mark import as importing")
904
+ .action(async (id) => {
905
+ const m = await L();
906
+ console.log(JSON.stringify(m.importingKgovImportV2(id), null, 2));
907
+ });
908
+ parent
909
+ .command("kgov-complete-import-v2 <id>")
910
+ .description("Complete import")
911
+ .action(async (id) => {
912
+ const m = await L();
913
+ console.log(JSON.stringify(m.completeImportKgovV2(id), null, 2));
914
+ });
915
+ parent
916
+ .command("kgov-fail-import-v2 <id> [reason]")
917
+ .description("Fail import")
918
+ .action(async (id, reason) => {
919
+ const m = await L();
920
+ console.log(JSON.stringify(m.failKgovImportV2(id, reason), null, 2));
921
+ });
922
+ parent
923
+ .command("kgov-cancel-import-v2 <id> [reason]")
924
+ .description("Cancel import")
925
+ .action(async (id, reason) => {
926
+ const m = await L();
927
+ console.log(JSON.stringify(m.cancelKgovImportV2(id, reason), null, 2));
928
+ });
929
+ parent
930
+ .command("kgov-get-import-v2 <id>")
931
+ .description("Get import")
932
+ .action(async (id) => {
933
+ const m = await L();
934
+ console.log(JSON.stringify(m.getKgovImportV2(id), null, 2));
935
+ });
936
+ parent
937
+ .command("kgov-list-imports-v2")
938
+ .description("List imports")
939
+ .action(async () => {
940
+ const m = await L();
941
+ console.log(JSON.stringify(m.listKgovImportsV2(), null, 2));
942
+ });
943
+ parent
944
+ .command("kgov-auto-stale-idle-v2")
945
+ .description("Auto-stale idle profiles")
946
+ .action(async () => {
947
+ const m = await L();
948
+ console.log(JSON.stringify(m.autoStaleIdleKgovProfilesV2(), null, 2));
949
+ });
950
+ parent
951
+ .command("kgov-auto-fail-stuck-v2")
952
+ .description("Auto-fail stuck imports")
953
+ .action(async () => {
954
+ const m = await L();
955
+ console.log(JSON.stringify(m.autoFailStuckKgovImportsV2(), null, 2));
956
+ });
957
+ parent
958
+ .command("kgov-gov-stats-v2")
959
+ .description("V2 gov aggregate stats")
960
+ .action(async () => {
961
+ const m = await L();
962
+ console.log(JSON.stringify(m.getKnowledgeGraphGovStatsV2(), null, 2));
963
+ });
964
+ }
@@ -688,4 +688,205 @@ export function registerLowcodeCommand(program) {
688
688
  if (ctx) await shutdown(ctx);
689
689
  }
690
690
  });
691
+
692
+ _registerAppBuilderV2Commands(lowcode);
693
+ }
694
+
695
+ function _registerAppBuilderV2Commands(parent) {
696
+ const L = async () => await import("../lib/app-builder.js");
697
+ parent
698
+ .command("enums-v2")
699
+ .description("Show V2 enums (app maturity + build lifecycle)")
700
+ .action(async () => {
701
+ const m = await L();
702
+ console.log(
703
+ JSON.stringify(
704
+ {
705
+ appMaturity: m.APP_MATURITY_V2,
706
+ buildLifecycle: m.APP_BUILD_LIFECYCLE_V2,
707
+ },
708
+ null,
709
+ 2,
710
+ ),
711
+ );
712
+ });
713
+ parent
714
+ .command("config-v2")
715
+ .description("Show V2 config thresholds")
716
+ .action(async () => {
717
+ const m = await L();
718
+ console.log(
719
+ JSON.stringify(
720
+ {
721
+ maxActiveAppsPerOwner: m.getMaxActiveAppsPerOwnerV2(),
722
+ maxPendingAppBuildsPerApp: m.getMaxPendingAppBuildsPerAppV2(),
723
+ appIdleMs: m.getAppIdleMsV2(),
724
+ appBuildStuckMs: m.getAppBuildStuckMsV2(),
725
+ },
726
+ null,
727
+ 2,
728
+ ),
729
+ );
730
+ });
731
+ parent
732
+ .command("set-max-active-apps-v2 <n>")
733
+ .description("Set max active apps per owner")
734
+ .action(async (n) => {
735
+ const m = await L();
736
+ m.setMaxActiveAppsPerOwnerV2(Number(n));
737
+ console.log("ok");
738
+ });
739
+ parent
740
+ .command("set-max-pending-builds-v2 <n>")
741
+ .description("Set max pending builds per app")
742
+ .action(async (n) => {
743
+ const m = await L();
744
+ m.setMaxPendingAppBuildsPerAppV2(Number(n));
745
+ console.log("ok");
746
+ });
747
+ parent
748
+ .command("set-app-idle-ms-v2 <n>")
749
+ .description("Set app idle threshold (ms)")
750
+ .action(async (n) => {
751
+ const m = await L();
752
+ m.setAppIdleMsV2(Number(n));
753
+ console.log("ok");
754
+ });
755
+ parent
756
+ .command("set-build-stuck-ms-v2 <n>")
757
+ .description("Set build stuck threshold (ms)")
758
+ .action(async (n) => {
759
+ const m = await L();
760
+ m.setAppBuildStuckMsV2(Number(n));
761
+ console.log("ok");
762
+ });
763
+ parent
764
+ .command("register-app-v2 <id> <owner>")
765
+ .description("Register V2 app")
766
+ .option("--name <n>", "App name")
767
+ .action(async (id, owner, o) => {
768
+ const m = await L();
769
+ console.log(
770
+ JSON.stringify(m.registerAppV2({ id, owner, name: o.name }), null, 2),
771
+ );
772
+ });
773
+ parent
774
+ .command("activate-app-v2 <id>")
775
+ .description("Activate app")
776
+ .action(async (id) => {
777
+ const m = await L();
778
+ console.log(JSON.stringify(m.activateAppV2(id), null, 2));
779
+ });
780
+ parent
781
+ .command("pause-app-v2 <id>")
782
+ .description("Pause app")
783
+ .action(async (id) => {
784
+ const m = await L();
785
+ console.log(JSON.stringify(m.pauseAppV2(id), null, 2));
786
+ });
787
+ parent
788
+ .command("archive-app-v2 <id>")
789
+ .description("Archive app (terminal)")
790
+ .action(async (id) => {
791
+ const m = await L();
792
+ console.log(JSON.stringify(m.archiveAppV2(id), null, 2));
793
+ });
794
+ parent
795
+ .command("touch-app-v2 <id>")
796
+ .description("Touch app lastTouchedAt")
797
+ .action(async (id) => {
798
+ const m = await L();
799
+ console.log(JSON.stringify(m.touchAppV2(id), null, 2));
800
+ });
801
+ parent
802
+ .command("get-app-v2 <id>")
803
+ .description("Get V2 app")
804
+ .action(async (id) => {
805
+ const m = await L();
806
+ console.log(JSON.stringify(m.getAppV2(id), null, 2));
807
+ });
808
+ parent
809
+ .command("list-apps-v2")
810
+ .description("List V2 apps")
811
+ .action(async () => {
812
+ const m = await L();
813
+ console.log(JSON.stringify(m.listAppsV2(), null, 2));
814
+ });
815
+ parent
816
+ .command("create-build-v2 <id> <appId>")
817
+ .description("Create V2 app build (queued)")
818
+ .option("--target <t>", "Target", "web")
819
+ .action(async (id, appId, o) => {
820
+ const m = await L();
821
+ console.log(
822
+ JSON.stringify(
823
+ m.createAppBuildV2({ id, appId, target: o.target }),
824
+ null,
825
+ 2,
826
+ ),
827
+ );
828
+ });
829
+ parent
830
+ .command("start-build-v2 <id>")
831
+ .description("Start build")
832
+ .action(async (id) => {
833
+ const m = await L();
834
+ console.log(JSON.stringify(m.startAppBuildV2(id), null, 2));
835
+ });
836
+ parent
837
+ .command("succeed-build-v2 <id>")
838
+ .description("Succeed build")
839
+ .action(async (id) => {
840
+ const m = await L();
841
+ console.log(JSON.stringify(m.succeedAppBuildV2(id), null, 2));
842
+ });
843
+ parent
844
+ .command("fail-build-v2 <id> [reason]")
845
+ .description("Fail build")
846
+ .action(async (id, reason) => {
847
+ const m = await L();
848
+ console.log(JSON.stringify(m.failAppBuildV2(id, reason), null, 2));
849
+ });
850
+ parent
851
+ .command("cancel-build-v2 <id> [reason]")
852
+ .description("Cancel build")
853
+ .action(async (id, reason) => {
854
+ const m = await L();
855
+ console.log(JSON.stringify(m.cancelAppBuildV2(id, reason), null, 2));
856
+ });
857
+ parent
858
+ .command("get-build-v2 <id>")
859
+ .description("Get V2 build")
860
+ .action(async (id) => {
861
+ const m = await L();
862
+ console.log(JSON.stringify(m.getAppBuildV2(id), null, 2));
863
+ });
864
+ parent
865
+ .command("list-builds-v2")
866
+ .description("List V2 builds")
867
+ .action(async () => {
868
+ const m = await L();
869
+ console.log(JSON.stringify(m.listAppBuildsV2(), null, 2));
870
+ });
871
+ parent
872
+ .command("auto-pause-idle-v2")
873
+ .description("Auto-pause idle active apps")
874
+ .action(async () => {
875
+ const m = await L();
876
+ console.log(JSON.stringify(m.autoPauseIdleAppsV2(), null, 2));
877
+ });
878
+ parent
879
+ .command("auto-fail-stuck-v2")
880
+ .description("Auto-fail stuck building builds")
881
+ .action(async () => {
882
+ const m = await L();
883
+ console.log(JSON.stringify(m.autoFailStuckAppBuildsV2(), null, 2));
884
+ });
885
+ parent
886
+ .command("gov-stats-v2")
887
+ .description("V2 governance aggregate stats")
888
+ .action(async () => {
889
+ const m = await L();
890
+ console.log(JSON.stringify(m.getAppBuilderGovStatsV2(), null, 2));
891
+ });
691
892
  }