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
@@ -39,44 +39,128 @@ export function registerPromcompCommand(program) {
39
39
 
40
40
  pc.command("enums-v2")
41
41
  .description("Show V2 enums")
42
- .action(() => console.log(JSON.stringify({ PCOMP_PROFILE_MATURITY_V2, PCOMP_RUN_LIFECYCLE_V2 }, null, 2)));
42
+ .action(() =>
43
+ console.log(
44
+ JSON.stringify(
45
+ { PCOMP_PROFILE_MATURITY_V2, PCOMP_RUN_LIFECYCLE_V2 },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
43
51
  pc.command("register-profile-v2")
44
52
  .requiredOption("--id <id>")
45
53
  .requiredOption("--owner <owner>")
46
54
  .option("--variant <variant>", "compressor variant", "default")
47
- .action((o) => console.log(JSON.stringify(registerPcompProfileV2(o), null, 2)));
48
- pc.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activatePcompProfileV2(id), null, 2)));
49
- pc.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(stalePcompProfileV2(id), null, 2)));
50
- pc.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archivePcompProfileV2(id), null, 2)));
51
- pc.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchPcompProfileV2(id), null, 2)));
52
- pc.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getPcompProfileV2(id), null, 2)));
53
- pc.command("list-profiles-v2").action(() => console.log(JSON.stringify(listPcompProfilesV2(), null, 2)));
55
+ .action((o) =>
56
+ console.log(JSON.stringify(registerPcompProfileV2(o), null, 2)),
57
+ );
58
+ pc.command("activate-profile-v2 <id>").action((id) =>
59
+ console.log(JSON.stringify(activatePcompProfileV2(id), null, 2)),
60
+ );
61
+ pc.command("stale-profile-v2 <id>").action((id) =>
62
+ console.log(JSON.stringify(stalePcompProfileV2(id), null, 2)),
63
+ );
64
+ pc.command("archive-profile-v2 <id>").action((id) =>
65
+ console.log(JSON.stringify(archivePcompProfileV2(id), null, 2)),
66
+ );
67
+ pc.command("touch-profile-v2 <id>").action((id) =>
68
+ console.log(JSON.stringify(touchPcompProfileV2(id), null, 2)),
69
+ );
70
+ pc.command("get-profile-v2 <id>").action((id) =>
71
+ console.log(JSON.stringify(getPcompProfileV2(id), null, 2)),
72
+ );
73
+ pc.command("list-profiles-v2").action(() =>
74
+ console.log(JSON.stringify(listPcompProfilesV2(), null, 2)),
75
+ );
54
76
 
55
77
  pc.command("create-run-v2")
56
78
  .requiredOption("--id <id>")
57
79
  .requiredOption("--profile-id <profileId>")
58
80
  .option("--input <input>", "input prompt", "")
59
81
  .action((o) => console.log(JSON.stringify(createPcompRunV2(o), null, 2)));
60
- pc.command("compressing-run-v2 <id>").action((id) => console.log(JSON.stringify(compressingPcompRunV2(id), null, 2)));
61
- pc.command("compress-run-v2 <id>").action((id) => console.log(JSON.stringify(compressPcompRunV2(id), null, 2)));
62
- pc.command("fail-run-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(failPcompRunV2(id, o.reason), null, 2)));
63
- pc.command("cancel-run-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(cancelPcompRunV2(id, o.reason), null, 2)));
64
- pc.command("get-run-v2 <id>").action((id) => console.log(JSON.stringify(getPcompRunV2(id), null, 2)));
65
- pc.command("list-runs-v2").action(() => console.log(JSON.stringify(listPcompRunsV2(), null, 2)));
82
+ pc.command("compressing-run-v2 <id>").action((id) =>
83
+ console.log(JSON.stringify(compressingPcompRunV2(id), null, 2)),
84
+ );
85
+ pc.command("compress-run-v2 <id>").action((id) =>
86
+ console.log(JSON.stringify(compressPcompRunV2(id), null, 2)),
87
+ );
88
+ pc.command("fail-run-v2 <id>")
89
+ .option("--reason <r>")
90
+ .action((id, o) =>
91
+ console.log(JSON.stringify(failPcompRunV2(id, o.reason), null, 2)),
92
+ );
93
+ pc.command("cancel-run-v2 <id>")
94
+ .option("--reason <r>")
95
+ .action((id, o) =>
96
+ console.log(JSON.stringify(cancelPcompRunV2(id, o.reason), null, 2)),
97
+ );
98
+ pc.command("get-run-v2 <id>").action((id) =>
99
+ console.log(JSON.stringify(getPcompRunV2(id), null, 2)),
100
+ );
101
+ pc.command("list-runs-v2").action(() =>
102
+ console.log(JSON.stringify(listPcompRunsV2(), null, 2)),
103
+ );
66
104
 
67
105
  pc.command("config-v2").action(() =>
68
- console.log(JSON.stringify({
69
- maxActivePcompProfilesPerOwner: getMaxActivePcompProfilesPerOwnerV2(),
70
- maxPendingPcompRunsPerProfile: getMaxPendingPcompRunsPerProfileV2(),
71
- pcompProfileIdleMs: getPcompProfileIdleMsV2(),
72
- pcompRunStuckMs: getPcompRunStuckMsV2(),
73
- }, null, 2)),
106
+ console.log(
107
+ JSON.stringify(
108
+ {
109
+ maxActivePcompProfilesPerOwner: getMaxActivePcompProfilesPerOwnerV2(),
110
+ maxPendingPcompRunsPerProfile: getMaxPendingPcompRunsPerProfileV2(),
111
+ pcompProfileIdleMs: getPcompProfileIdleMsV2(),
112
+ pcompRunStuckMs: getPcompRunStuckMsV2(),
113
+ },
114
+ null,
115
+ 2,
116
+ ),
117
+ ),
118
+ );
119
+ pc.command("set-max-active-profiles-v2 <n>").action((n) => {
120
+ setMaxActivePcompProfilesPerOwnerV2(Number(n));
121
+ console.log(
122
+ JSON.stringify(
123
+ {
124
+ maxActivePcompProfilesPerOwner: getMaxActivePcompProfilesPerOwnerV2(),
125
+ },
126
+ null,
127
+ 2,
128
+ ),
129
+ );
130
+ });
131
+ pc.command("set-max-pending-runs-v2 <n>").action((n) => {
132
+ setMaxPendingPcompRunsPerProfileV2(Number(n));
133
+ console.log(
134
+ JSON.stringify(
135
+ { maxPendingPcompRunsPerProfile: getMaxPendingPcompRunsPerProfileV2() },
136
+ null,
137
+ 2,
138
+ ),
139
+ );
140
+ });
141
+ pc.command("set-profile-idle-ms-v2 <ms>").action((ms) => {
142
+ setPcompProfileIdleMsV2(Number(ms));
143
+ console.log(
144
+ JSON.stringify(
145
+ { pcompProfileIdleMs: getPcompProfileIdleMsV2() },
146
+ null,
147
+ 2,
148
+ ),
149
+ );
150
+ });
151
+ pc.command("set-run-stuck-ms-v2 <ms>").action((ms) => {
152
+ setPcompRunStuckMsV2(Number(ms));
153
+ console.log(
154
+ JSON.stringify({ pcompRunStuckMs: getPcompRunStuckMsV2() }, null, 2),
155
+ );
156
+ });
157
+ pc.command("auto-stale-idle-v2").action(() =>
158
+ console.log(JSON.stringify(autoStaleIdlePcompProfilesV2(), null, 2)),
159
+ );
160
+ pc.command("auto-fail-stuck-v2").action(() =>
161
+ console.log(JSON.stringify(autoFailStuckPcompRunsV2(), null, 2)),
162
+ );
163
+ pc.command("gov-stats-v2").action(() =>
164
+ console.log(JSON.stringify(getPromptCompressorGovStatsV2(), null, 2)),
74
165
  );
75
- pc.command("set-max-active-profiles-v2 <n>").action((n) => { setMaxActivePcompProfilesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActivePcompProfilesPerOwner: getMaxActivePcompProfilesPerOwnerV2() }, null, 2)); });
76
- pc.command("set-max-pending-runs-v2 <n>").action((n) => { setMaxPendingPcompRunsPerProfileV2(Number(n)); console.log(JSON.stringify({ maxPendingPcompRunsPerProfile: getMaxPendingPcompRunsPerProfileV2() }, null, 2)); });
77
- pc.command("set-profile-idle-ms-v2 <ms>").action((ms) => { setPcompProfileIdleMsV2(Number(ms)); console.log(JSON.stringify({ pcompProfileIdleMs: getPcompProfileIdleMsV2() }, null, 2)); });
78
- pc.command("set-run-stuck-ms-v2 <ms>").action((ms) => { setPcompRunStuckMsV2(Number(ms)); console.log(JSON.stringify({ pcompRunStuckMs: getPcompRunStuckMsV2() }, null, 2)); });
79
- pc.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdlePcompProfilesV2(), null, 2)));
80
- pc.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckPcompRunsV2(), null, 2)));
81
- pc.command("gov-stats-v2").action(() => console.log(JSON.stringify(getPromptCompressorGovStatsV2(), null, 2)));
82
166
  }
@@ -629,3 +629,210 @@ export function registerQuantizationCommand(program) {
629
629
 
630
630
  program.addCommand(quant);
631
631
  }
632
+
633
+ // === Iter18 V2 governance overlay ===
634
+ export function registerQntgovV2Commands(program) {
635
+ const parent = program.commands.find((c) => c.name() === "quantize");
636
+ if (!parent) return;
637
+ const L = async () => await import("../lib/quantization.js");
638
+ parent
639
+ .command("qntgov-enums-v2")
640
+ .description("Show V2 enums")
641
+ .action(async () => {
642
+ const m = await L();
643
+ console.log(
644
+ JSON.stringify(
645
+ {
646
+ profileMaturity: m.QNTGOV_PROFILE_MATURITY_V2,
647
+ jobLifecycle: m.QNTGOV_JOB_LIFECYCLE_V2,
648
+ },
649
+ null,
650
+ 2,
651
+ ),
652
+ );
653
+ });
654
+ parent
655
+ .command("qntgov-config-v2")
656
+ .description("Show V2 config")
657
+ .action(async () => {
658
+ const m = await L();
659
+ console.log(
660
+ JSON.stringify(
661
+ {
662
+ maxActive: m.getMaxActiveQntgovProfilesPerOwnerV2(),
663
+ maxPending: m.getMaxPendingQntgovJobsPerProfileV2(),
664
+ idleMs: m.getQntgovProfileIdleMsV2(),
665
+ stuckMs: m.getQntgovJobStuckMsV2(),
666
+ },
667
+ null,
668
+ 2,
669
+ ),
670
+ );
671
+ });
672
+ parent
673
+ .command("qntgov-set-max-active-v2 <n>")
674
+ .description("Set max active")
675
+ .action(async (n) => {
676
+ (await L()).setMaxActiveQntgovProfilesPerOwnerV2(Number(n));
677
+ console.log("ok");
678
+ });
679
+ parent
680
+ .command("qntgov-set-max-pending-v2 <n>")
681
+ .description("Set max pending")
682
+ .action(async (n) => {
683
+ (await L()).setMaxPendingQntgovJobsPerProfileV2(Number(n));
684
+ console.log("ok");
685
+ });
686
+ parent
687
+ .command("qntgov-set-idle-ms-v2 <n>")
688
+ .description("Set idle threshold ms")
689
+ .action(async (n) => {
690
+ (await L()).setQntgovProfileIdleMsV2(Number(n));
691
+ console.log("ok");
692
+ });
693
+ parent
694
+ .command("qntgov-set-stuck-ms-v2 <n>")
695
+ .description("Set stuck threshold ms")
696
+ .action(async (n) => {
697
+ (await L()).setQntgovJobStuckMsV2(Number(n));
698
+ console.log("ok");
699
+ });
700
+ parent
701
+ .command("qntgov-register-v2 <id> <owner>")
702
+ .description("Register V2 profile")
703
+ .option("--precision <v>", "precision")
704
+ .action(async (id, owner, o) => {
705
+ const m = await L();
706
+ console.log(
707
+ JSON.stringify(
708
+ m.registerQntgovProfileV2({ id, owner, precision: o.precision }),
709
+ null,
710
+ 2,
711
+ ),
712
+ );
713
+ });
714
+ parent
715
+ .command("qntgov-activate-v2 <id>")
716
+ .description("Activate profile")
717
+ .action(async (id) => {
718
+ console.log(
719
+ JSON.stringify((await L()).activateQntgovProfileV2(id), null, 2),
720
+ );
721
+ });
722
+ parent
723
+ .command("qntgov-stale-v2 <id>")
724
+ .description("Stale profile")
725
+ .action(async (id) => {
726
+ console.log(
727
+ JSON.stringify((await L()).staleQntgovProfileV2(id), null, 2),
728
+ );
729
+ });
730
+ parent
731
+ .command("qntgov-archive-v2 <id>")
732
+ .description("Archive profile")
733
+ .action(async (id) => {
734
+ console.log(
735
+ JSON.stringify((await L()).archiveQntgovProfileV2(id), null, 2),
736
+ );
737
+ });
738
+ parent
739
+ .command("qntgov-touch-v2 <id>")
740
+ .description("Touch profile")
741
+ .action(async (id) => {
742
+ console.log(
743
+ JSON.stringify((await L()).touchQntgovProfileV2(id), null, 2),
744
+ );
745
+ });
746
+ parent
747
+ .command("qntgov-get-v2 <id>")
748
+ .description("Get profile")
749
+ .action(async (id) => {
750
+ console.log(JSON.stringify((await L()).getQntgovProfileV2(id), null, 2));
751
+ });
752
+ parent
753
+ .command("qntgov-list-v2")
754
+ .description("List profiles")
755
+ .action(async () => {
756
+ console.log(JSON.stringify((await L()).listQntgovProfilesV2(), null, 2));
757
+ });
758
+ parent
759
+ .command("qntgov-create-job-v2 <id> <profileId>")
760
+ .description("Create job")
761
+ .option("--model <v>", "model")
762
+ .action(async (id, profileId, o) => {
763
+ const m = await L();
764
+ console.log(
765
+ JSON.stringify(
766
+ m.createQntgovJobV2({ id, profileId, model: o.model }),
767
+ null,
768
+ 2,
769
+ ),
770
+ );
771
+ });
772
+ parent
773
+ .command("qntgov-quantizing-job-v2 <id>")
774
+ .description("Mark job as quantizing")
775
+ .action(async (id) => {
776
+ console.log(
777
+ JSON.stringify((await L()).quantizingQntgovJobV2(id), null, 2),
778
+ );
779
+ });
780
+ parent
781
+ .command("qntgov-complete-job-v2 <id>")
782
+ .description("Complete job")
783
+ .action(async (id) => {
784
+ console.log(JSON.stringify((await L()).completeJobQntgovV2(id), null, 2));
785
+ });
786
+ parent
787
+ .command("qntgov-fail-job-v2 <id> [reason]")
788
+ .description("Fail job")
789
+ .action(async (id, reason) => {
790
+ console.log(
791
+ JSON.stringify((await L()).failQntgovJobV2(id, reason), null, 2),
792
+ );
793
+ });
794
+ parent
795
+ .command("qntgov-cancel-job-v2 <id> [reason]")
796
+ .description("Cancel job")
797
+ .action(async (id, reason) => {
798
+ console.log(
799
+ JSON.stringify((await L()).cancelQntgovJobV2(id, reason), null, 2),
800
+ );
801
+ });
802
+ parent
803
+ .command("qntgov-get-job-v2 <id>")
804
+ .description("Get job")
805
+ .action(async (id) => {
806
+ console.log(JSON.stringify((await L()).getQntgovJobV2(id), null, 2));
807
+ });
808
+ parent
809
+ .command("qntgov-list-jobs-v2")
810
+ .description("List jobs")
811
+ .action(async () => {
812
+ console.log(JSON.stringify((await L()).listQntgovJobsV2(), null, 2));
813
+ });
814
+ parent
815
+ .command("qntgov-auto-stale-idle-v2")
816
+ .description("Auto-stale idle")
817
+ .action(async () => {
818
+ console.log(
819
+ JSON.stringify((await L()).autoStaleIdleQntgovProfilesV2(), null, 2),
820
+ );
821
+ });
822
+ parent
823
+ .command("qntgov-auto-fail-stuck-v2")
824
+ .description("Auto-fail stuck jobs")
825
+ .action(async () => {
826
+ console.log(
827
+ JSON.stringify((await L()).autoFailStuckQntgovJobsV2(), null, 2),
828
+ );
829
+ });
830
+ parent
831
+ .command("qntgov-gov-stats-v2")
832
+ .description("V2 gov stats")
833
+ .action(async () => {
834
+ console.log(
835
+ JSON.stringify((await L()).getQuantizationGovStatsV2(), null, 2),
836
+ );
837
+ });
838
+ }
@@ -269,3 +269,208 @@ export function registerRCacheCommand(program) {
269
269
  .description("Auto-fail stuck V2 refresh jobs")
270
270
  .action(() => out(autoFailStuckRefreshJobsV2()));
271
271
  }
272
+
273
+ // === Iter23 V2 governance overlay ===
274
+ export function registerRcgovV2Commands(program) {
275
+ const parent = program.commands.find((c) => c.name() === "rcache");
276
+ if (!parent) return;
277
+ const L = async () => await import("../lib/response-cache.js");
278
+ parent
279
+ .command("rcgov-enums-v2")
280
+ .description("Show V2 enums")
281
+ .action(async () => {
282
+ const m = await L();
283
+ console.log(
284
+ JSON.stringify(
285
+ {
286
+ profileMaturity: m.RCGOV_PROFILE_MATURITY_V2,
287
+ refreshLifecycle: m.RCGOV_REFRESH_LIFECYCLE_V2,
288
+ },
289
+ null,
290
+ 2,
291
+ ),
292
+ );
293
+ });
294
+ parent
295
+ .command("rcgov-config-v2")
296
+ .description("Show V2 config")
297
+ .action(async () => {
298
+ const m = await L();
299
+ console.log(
300
+ JSON.stringify(
301
+ {
302
+ maxActive: m.getMaxActiveRcgovProfilesPerOwnerV2(),
303
+ maxPending: m.getMaxPendingRcgovRefreshsPerProfileV2(),
304
+ idleMs: m.getRcgovProfileIdleMsV2(),
305
+ stuckMs: m.getRcgovRefreshStuckMsV2(),
306
+ },
307
+ null,
308
+ 2,
309
+ ),
310
+ );
311
+ });
312
+ parent
313
+ .command("rcgov-set-max-active-v2 <n>")
314
+ .description("Set max active")
315
+ .action(async (n) => {
316
+ (await L()).setMaxActiveRcgovProfilesPerOwnerV2(Number(n));
317
+ console.log("ok");
318
+ });
319
+ parent
320
+ .command("rcgov-set-max-pending-v2 <n>")
321
+ .description("Set max pending")
322
+ .action(async (n) => {
323
+ (await L()).setMaxPendingRcgovRefreshsPerProfileV2(Number(n));
324
+ console.log("ok");
325
+ });
326
+ parent
327
+ .command("rcgov-set-idle-ms-v2 <n>")
328
+ .description("Set idle threshold ms")
329
+ .action(async (n) => {
330
+ (await L()).setRcgovProfileIdleMsV2(Number(n));
331
+ console.log("ok");
332
+ });
333
+ parent
334
+ .command("rcgov-set-stuck-ms-v2 <n>")
335
+ .description("Set stuck threshold ms")
336
+ .action(async (n) => {
337
+ (await L()).setRcgovRefreshStuckMsV2(Number(n));
338
+ console.log("ok");
339
+ });
340
+ parent
341
+ .command("rcgov-register-v2 <id> <owner>")
342
+ .description("Register V2 profile")
343
+ .option("--lane <v>", "lane")
344
+ .action(async (id, owner, o) => {
345
+ const m = await L();
346
+ console.log(
347
+ JSON.stringify(
348
+ m.registerRcgovProfileV2({ id, owner, lane: o.lane }),
349
+ null,
350
+ 2,
351
+ ),
352
+ );
353
+ });
354
+ parent
355
+ .command("rcgov-activate-v2 <id>")
356
+ .description("Activate profile")
357
+ .action(async (id) => {
358
+ console.log(
359
+ JSON.stringify((await L()).activateRcgovProfileV2(id), null, 2),
360
+ );
361
+ });
362
+ parent
363
+ .command("rcgov-stale-v2 <id>")
364
+ .description("Stale profile")
365
+ .action(async (id) => {
366
+ console.log(JSON.stringify((await L()).staleRcgovProfileV2(id), null, 2));
367
+ });
368
+ parent
369
+ .command("rcgov-archive-v2 <id>")
370
+ .description("Archive profile")
371
+ .action(async (id) => {
372
+ console.log(
373
+ JSON.stringify((await L()).archiveRcgovProfileV2(id), null, 2),
374
+ );
375
+ });
376
+ parent
377
+ .command("rcgov-touch-v2 <id>")
378
+ .description("Touch profile")
379
+ .action(async (id) => {
380
+ console.log(JSON.stringify((await L()).touchRcgovProfileV2(id), null, 2));
381
+ });
382
+ parent
383
+ .command("rcgov-get-v2 <id>")
384
+ .description("Get profile")
385
+ .action(async (id) => {
386
+ console.log(JSON.stringify((await L()).getRcgovProfileV2(id), null, 2));
387
+ });
388
+ parent
389
+ .command("rcgov-list-v2")
390
+ .description("List profiles")
391
+ .action(async () => {
392
+ console.log(JSON.stringify((await L()).listRcgovProfilesV2(), null, 2));
393
+ });
394
+ parent
395
+ .command("rcgov-create-refresh-v2 <id> <profileId>")
396
+ .description("Create refresh")
397
+ .option("--source <v>", "source")
398
+ .action(async (id, profileId, o) => {
399
+ const m = await L();
400
+ console.log(
401
+ JSON.stringify(
402
+ m.createRcgovRefreshV2({ id, profileId, source: o.source }),
403
+ null,
404
+ 2,
405
+ ),
406
+ );
407
+ });
408
+ parent
409
+ .command("rcgov-refreshing-refresh-v2 <id>")
410
+ .description("Mark refresh as refreshing")
411
+ .action(async (id) => {
412
+ console.log(
413
+ JSON.stringify((await L()).refreshingRcgovRefreshV2(id), null, 2),
414
+ );
415
+ });
416
+ parent
417
+ .command("rcgov-complete-refresh-v2 <id>")
418
+ .description("Complete refresh")
419
+ .action(async (id) => {
420
+ console.log(
421
+ JSON.stringify((await L()).completeRefreshRcgovV2(id), null, 2),
422
+ );
423
+ });
424
+ parent
425
+ .command("rcgov-fail-refresh-v2 <id> [reason]")
426
+ .description("Fail refresh")
427
+ .action(async (id, reason) => {
428
+ console.log(
429
+ JSON.stringify((await L()).failRcgovRefreshV2(id, reason), null, 2),
430
+ );
431
+ });
432
+ parent
433
+ .command("rcgov-cancel-refresh-v2 <id> [reason]")
434
+ .description("Cancel refresh")
435
+ .action(async (id, reason) => {
436
+ console.log(
437
+ JSON.stringify((await L()).cancelRcgovRefreshV2(id, reason), null, 2),
438
+ );
439
+ });
440
+ parent
441
+ .command("rcgov-get-refresh-v2 <id>")
442
+ .description("Get refresh")
443
+ .action(async (id) => {
444
+ console.log(JSON.stringify((await L()).getRcgovRefreshV2(id), null, 2));
445
+ });
446
+ parent
447
+ .command("rcgov-list-refreshs-v2")
448
+ .description("List refreshs")
449
+ .action(async () => {
450
+ console.log(JSON.stringify((await L()).listRcgovRefreshsV2(), null, 2));
451
+ });
452
+ parent
453
+ .command("rcgov-auto-stale-idle-v2")
454
+ .description("Auto-stale idle")
455
+ .action(async () => {
456
+ console.log(
457
+ JSON.stringify((await L()).autoStaleIdleRcgovProfilesV2(), null, 2),
458
+ );
459
+ });
460
+ parent
461
+ .command("rcgov-auto-fail-stuck-v2")
462
+ .description("Auto-fail stuck refreshs")
463
+ .action(async () => {
464
+ console.log(
465
+ JSON.stringify((await L()).autoFailStuckRcgovRefreshsV2(), null, 2),
466
+ );
467
+ });
468
+ parent
469
+ .command("rcgov-gov-stats-v2")
470
+ .description("V2 gov stats")
471
+ .action(async () => {
472
+ console.log(
473
+ JSON.stringify((await L()).getResponseCacheGovStatsV2(), null, 2),
474
+ );
475
+ });
476
+ }