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
@@ -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
+ }
@@ -6,40 +6,178 @@
6
6
  */
7
7
 
8
8
  import {
9
- TMS_PROFILE_MATURITY_V2, TMS_SELECTION_LIFECYCLE_V2,
10
- setMaxActiveTmsProfilesPerOwnerV2, getMaxActiveTmsProfilesPerOwnerV2,
11
- setMaxPendingTmsSelectionsPerProfileV2, getMaxPendingTmsSelectionsPerProfileV2,
12
- setTmsProfileIdleMsV2, getTmsProfileIdleMsV2,
13
- setTmsSelectionStuckMsV2, getTmsSelectionStuckMsV2,
14
- registerTmsProfileV2, activateTmsProfileV2, staleTmsProfileV2, decommissionTmsProfileV2, touchTmsProfileV2, getTmsProfileV2, listTmsProfilesV2,
15
- createTmsSelectionV2, scoreTmsSelectionV2, completeTmsSelectionV2, failTmsSelectionV2, cancelTmsSelectionV2, getTmsSelectionV2, listTmsSelectionsV2,
16
- autoStaleIdleTmsProfilesV2, autoFailStuckTmsSelectionsV2, getTaskModelSelectorGovStatsV2, _resetStateTaskModelSelectorV2,
9
+ TMS_PROFILE_MATURITY_V2,
10
+ TMS_SELECTION_LIFECYCLE_V2,
11
+ setMaxActiveTmsProfilesPerOwnerV2,
12
+ getMaxActiveTmsProfilesPerOwnerV2,
13
+ setMaxPendingTmsSelectionsPerProfileV2,
14
+ getMaxPendingTmsSelectionsPerProfileV2,
15
+ setTmsProfileIdleMsV2,
16
+ getTmsProfileIdleMsV2,
17
+ setTmsSelectionStuckMsV2,
18
+ getTmsSelectionStuckMsV2,
19
+ registerTmsProfileV2,
20
+ activateTmsProfileV2,
21
+ staleTmsProfileV2,
22
+ decommissionTmsProfileV2,
23
+ touchTmsProfileV2,
24
+ getTmsProfileV2,
25
+ listTmsProfilesV2,
26
+ createTmsSelectionV2,
27
+ scoreTmsSelectionV2,
28
+ completeTmsSelectionV2,
29
+ failTmsSelectionV2,
30
+ cancelTmsSelectionV2,
31
+ getTmsSelectionV2,
32
+ listTmsSelectionsV2,
33
+ autoStaleIdleTmsProfilesV2,
34
+ autoFailStuckTmsSelectionsV2,
35
+ getTaskModelSelectorGovStatsV2,
36
+ _resetStateTaskModelSelectorV2,
17
37
  } from "../lib/task-model-selector.js";
18
38
 
19
39
  export function registerTmsCommand(program) {
20
- const tms = program.command("tms").description("Task Model Selector V2 governance");
21
- tms.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: TMS_PROFILE_MATURITY_V2, selectionLifecycle: TMS_SELECTION_LIFECYCLE_V2 }, null, 2)));
22
- tms.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveTmsProfilesPerOwner: getMaxActiveTmsProfilesPerOwnerV2(), maxPendingTmsSelectionsPerProfile: getMaxPendingTmsSelectionsPerProfileV2(), tmsProfileIdleMs: getTmsProfileIdleMsV2(), tmsSelectionStuckMs: getTmsSelectionStuckMsV2() }, null, 2)));
23
- tms.command("set-max-active-v2 <n>").action((n) => { setMaxActiveTmsProfilesPerOwnerV2(Number(n)); console.log("ok"); });
24
- tms.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingTmsSelectionsPerProfileV2(Number(n)); console.log("ok"); });
25
- tms.command("set-idle-ms-v2 <n>").action((n) => { setTmsProfileIdleMsV2(Number(n)); console.log("ok"); });
26
- tms.command("set-stuck-ms-v2 <n>").action((n) => { setTmsSelectionStuckMsV2(Number(n)); console.log("ok"); });
27
- tms.command("register-profile-v2 <id> <owner>").option("--strategy <s>", "strategy").action((id, owner, o) => console.log(JSON.stringify(registerTmsProfileV2({ id, owner, strategy: o.strategy }), null, 2)));
28
- tms.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateTmsProfileV2(id), null, 2)));
29
- tms.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleTmsProfileV2(id), null, 2)));
30
- tms.command("decommission-profile-v2 <id>").action((id) => console.log(JSON.stringify(decommissionTmsProfileV2(id), null, 2)));
31
- tms.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchTmsProfileV2(id), null, 2)));
32
- tms.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getTmsProfileV2(id), null, 2)));
33
- tms.command("list-profiles-v2").action(() => console.log(JSON.stringify(listTmsProfilesV2(), null, 2)));
34
- tms.command("create-selection-v2 <id> <profileId>").option("--task <t>", "task").action((id, profileId, o) => console.log(JSON.stringify(createTmsSelectionV2({ id, profileId, task: o.task }), null, 2)));
35
- tms.command("score-selection-v2 <id>").action((id) => console.log(JSON.stringify(scoreTmsSelectionV2(id), null, 2)));
36
- tms.command("complete-selection-v2 <id>").action((id) => console.log(JSON.stringify(completeTmsSelectionV2(id), null, 2)));
37
- tms.command("fail-selection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failTmsSelectionV2(id, reason), null, 2)));
38
- tms.command("cancel-selection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelTmsSelectionV2(id, reason), null, 2)));
39
- tms.command("get-selection-v2 <id>").action((id) => console.log(JSON.stringify(getTmsSelectionV2(id), null, 2)));
40
- tms.command("list-selections-v2").action(() => console.log(JSON.stringify(listTmsSelectionsV2(), null, 2)));
41
- tms.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleTmsProfilesV2(), null, 2)));
42
- tms.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckTmsSelectionsV2(), null, 2)));
43
- tms.command("gov-stats-v2").action(() => console.log(JSON.stringify(getTaskModelSelectorGovStatsV2(), null, 2)));
44
- tms.command("reset-state-v2").action(() => { _resetStateTaskModelSelectorV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
40
+ const tms = program
41
+ .command("tms")
42
+ .description("Task Model Selector V2 governance");
43
+ tms.command("enums-v2").action(() =>
44
+ console.log(
45
+ JSON.stringify(
46
+ {
47
+ profileMaturity: TMS_PROFILE_MATURITY_V2,
48
+ selectionLifecycle: TMS_SELECTION_LIFECYCLE_V2,
49
+ },
50
+ null,
51
+ 2,
52
+ ),
53
+ ),
54
+ );
55
+ tms.command("config-v2").action(() =>
56
+ console.log(
57
+ JSON.stringify(
58
+ {
59
+ maxActiveTmsProfilesPerOwner: getMaxActiveTmsProfilesPerOwnerV2(),
60
+ maxPendingTmsSelectionsPerProfile:
61
+ getMaxPendingTmsSelectionsPerProfileV2(),
62
+ tmsProfileIdleMs: getTmsProfileIdleMsV2(),
63
+ tmsSelectionStuckMs: getTmsSelectionStuckMsV2(),
64
+ },
65
+ null,
66
+ 2,
67
+ ),
68
+ ),
69
+ );
70
+ tms.command("set-max-active-v2 <n>").action((n) => {
71
+ setMaxActiveTmsProfilesPerOwnerV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ tms.command("set-max-pending-v2 <n>").action((n) => {
75
+ setMaxPendingTmsSelectionsPerProfileV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ tms.command("set-idle-ms-v2 <n>").action((n) => {
79
+ setTmsProfileIdleMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ tms.command("set-stuck-ms-v2 <n>").action((n) => {
83
+ setTmsSelectionStuckMsV2(Number(n));
84
+ console.log("ok");
85
+ });
86
+ tms
87
+ .command("register-profile-v2 <id> <owner>")
88
+ .option("--strategy <s>", "strategy")
89
+ .action((id, owner, o) =>
90
+ console.log(
91
+ JSON.stringify(
92
+ registerTmsProfileV2({ id, owner, strategy: o.strategy }),
93
+ null,
94
+ 2,
95
+ ),
96
+ ),
97
+ );
98
+ tms
99
+ .command("activate-profile-v2 <id>")
100
+ .action((id) =>
101
+ console.log(JSON.stringify(activateTmsProfileV2(id), null, 2)),
102
+ );
103
+ tms
104
+ .command("stale-profile-v2 <id>")
105
+ .action((id) =>
106
+ console.log(JSON.stringify(staleTmsProfileV2(id), null, 2)),
107
+ );
108
+ tms
109
+ .command("decommission-profile-v2 <id>")
110
+ .action((id) =>
111
+ console.log(JSON.stringify(decommissionTmsProfileV2(id), null, 2)),
112
+ );
113
+ tms
114
+ .command("touch-profile-v2 <id>")
115
+ .action((id) =>
116
+ console.log(JSON.stringify(touchTmsProfileV2(id), null, 2)),
117
+ );
118
+ tms
119
+ .command("get-profile-v2 <id>")
120
+ .action((id) => console.log(JSON.stringify(getTmsProfileV2(id), null, 2)));
121
+ tms
122
+ .command("list-profiles-v2")
123
+ .action(() => console.log(JSON.stringify(listTmsProfilesV2(), null, 2)));
124
+ tms
125
+ .command("create-selection-v2 <id> <profileId>")
126
+ .option("--task <t>", "task")
127
+ .action((id, profileId, o) =>
128
+ console.log(
129
+ JSON.stringify(
130
+ createTmsSelectionV2({ id, profileId, task: o.task }),
131
+ null,
132
+ 2,
133
+ ),
134
+ ),
135
+ );
136
+ tms
137
+ .command("score-selection-v2 <id>")
138
+ .action((id) =>
139
+ console.log(JSON.stringify(scoreTmsSelectionV2(id), null, 2)),
140
+ );
141
+ tms
142
+ .command("complete-selection-v2 <id>")
143
+ .action((id) =>
144
+ console.log(JSON.stringify(completeTmsSelectionV2(id), null, 2)),
145
+ );
146
+ tms
147
+ .command("fail-selection-v2 <id> [reason]")
148
+ .action((id, reason) =>
149
+ console.log(JSON.stringify(failTmsSelectionV2(id, reason), null, 2)),
150
+ );
151
+ tms
152
+ .command("cancel-selection-v2 <id> [reason]")
153
+ .action((id, reason) =>
154
+ console.log(JSON.stringify(cancelTmsSelectionV2(id, reason), null, 2)),
155
+ );
156
+ tms
157
+ .command("get-selection-v2 <id>")
158
+ .action((id) =>
159
+ console.log(JSON.stringify(getTmsSelectionV2(id), null, 2)),
160
+ );
161
+ tms
162
+ .command("list-selections-v2")
163
+ .action(() => console.log(JSON.stringify(listTmsSelectionsV2(), null, 2)));
164
+ tms
165
+ .command("auto-stale-idle-v2")
166
+ .action(() =>
167
+ console.log(JSON.stringify(autoStaleIdleTmsProfilesV2(), null, 2)),
168
+ );
169
+ tms
170
+ .command("auto-fail-stuck-v2")
171
+ .action(() =>
172
+ console.log(JSON.stringify(autoFailStuckTmsSelectionsV2(), null, 2)),
173
+ );
174
+ tms
175
+ .command("gov-stats-v2")
176
+ .action(() =>
177
+ console.log(JSON.stringify(getTaskModelSelectorGovStatsV2(), null, 2)),
178
+ );
179
+ tms.command("reset-state-v2").action(() => {
180
+ _resetStateTaskModelSelectorV2();
181
+ console.log(JSON.stringify({ ok: true }, null, 2));
182
+ });
45
183
  }
@@ -481,3 +481,212 @@ export function registerTokensCommand(program) {
481
481
  .description("Auto-reject stale V2 records")
482
482
  .action(() => out(true, autoRejectStaleRecordsV2()));
483
483
  }
484
+
485
+ // === Iter24 V2 governance overlay ===
486
+ export function registerToktgovV2Commands(program) {
487
+ const parent = program.commands.find((c) => c.name() === "tokens");
488
+ if (!parent) return;
489
+ const L = async () => await import("../lib/token-tracker.js");
490
+ parent
491
+ .command("toktgov-enums-v2")
492
+ .description("Show V2 enums")
493
+ .action(async () => {
494
+ const m = await L();
495
+ console.log(
496
+ JSON.stringify(
497
+ {
498
+ profileMaturity: m.TOKTGOV_PROFILE_MATURITY_V2,
499
+ usageLifecycle: m.TOKTGOV_USAGE_LIFECYCLE_V2,
500
+ },
501
+ null,
502
+ 2,
503
+ ),
504
+ );
505
+ });
506
+ parent
507
+ .command("toktgov-config-v2")
508
+ .description("Show V2 config")
509
+ .action(async () => {
510
+ const m = await L();
511
+ console.log(
512
+ JSON.stringify(
513
+ {
514
+ maxActive: m.getMaxActiveToktgovProfilesPerOwnerV2(),
515
+ maxPending: m.getMaxPendingToktgovUsagesPerProfileV2(),
516
+ idleMs: m.getToktgovProfileIdleMsV2(),
517
+ stuckMs: m.getToktgovUsageStuckMsV2(),
518
+ },
519
+ null,
520
+ 2,
521
+ ),
522
+ );
523
+ });
524
+ parent
525
+ .command("toktgov-set-max-active-v2 <n>")
526
+ .description("Set max active")
527
+ .action(async (n) => {
528
+ (await L()).setMaxActiveToktgovProfilesPerOwnerV2(Number(n));
529
+ console.log("ok");
530
+ });
531
+ parent
532
+ .command("toktgov-set-max-pending-v2 <n>")
533
+ .description("Set max pending")
534
+ .action(async (n) => {
535
+ (await L()).setMaxPendingToktgovUsagesPerProfileV2(Number(n));
536
+ console.log("ok");
537
+ });
538
+ parent
539
+ .command("toktgov-set-idle-ms-v2 <n>")
540
+ .description("Set idle threshold ms")
541
+ .action(async (n) => {
542
+ (await L()).setToktgovProfileIdleMsV2(Number(n));
543
+ console.log("ok");
544
+ });
545
+ parent
546
+ .command("toktgov-set-stuck-ms-v2 <n>")
547
+ .description("Set stuck threshold ms")
548
+ .action(async (n) => {
549
+ (await L()).setToktgovUsageStuckMsV2(Number(n));
550
+ console.log("ok");
551
+ });
552
+ parent
553
+ .command("toktgov-register-v2 <id> <owner>")
554
+ .description("Register V2 profile")
555
+ .option("--budget <v>", "budget")
556
+ .action(async (id, owner, o) => {
557
+ const m = await L();
558
+ console.log(
559
+ JSON.stringify(
560
+ m.registerToktgovProfileV2({ id, owner, budget: o.budget }),
561
+ null,
562
+ 2,
563
+ ),
564
+ );
565
+ });
566
+ parent
567
+ .command("toktgov-activate-v2 <id>")
568
+ .description("Activate profile")
569
+ .action(async (id) => {
570
+ console.log(
571
+ JSON.stringify((await L()).activateToktgovProfileV2(id), null, 2),
572
+ );
573
+ });
574
+ parent
575
+ .command("toktgov-stale-v2 <id>")
576
+ .description("Stale profile")
577
+ .action(async (id) => {
578
+ console.log(
579
+ JSON.stringify((await L()).staleToktgovProfileV2(id), null, 2),
580
+ );
581
+ });
582
+ parent
583
+ .command("toktgov-archive-v2 <id>")
584
+ .description("Archive profile")
585
+ .action(async (id) => {
586
+ console.log(
587
+ JSON.stringify((await L()).archiveToktgovProfileV2(id), null, 2),
588
+ );
589
+ });
590
+ parent
591
+ .command("toktgov-touch-v2 <id>")
592
+ .description("Touch profile")
593
+ .action(async (id) => {
594
+ console.log(
595
+ JSON.stringify((await L()).touchToktgovProfileV2(id), null, 2),
596
+ );
597
+ });
598
+ parent
599
+ .command("toktgov-get-v2 <id>")
600
+ .description("Get profile")
601
+ .action(async (id) => {
602
+ console.log(JSON.stringify((await L()).getToktgovProfileV2(id), null, 2));
603
+ });
604
+ parent
605
+ .command("toktgov-list-v2")
606
+ .description("List profiles")
607
+ .action(async () => {
608
+ console.log(JSON.stringify((await L()).listToktgovProfilesV2(), null, 2));
609
+ });
610
+ parent
611
+ .command("toktgov-create-usage-v2 <id> <profileId>")
612
+ .description("Create usage")
613
+ .option("--model <v>", "model")
614
+ .action(async (id, profileId, o) => {
615
+ const m = await L();
616
+ console.log(
617
+ JSON.stringify(
618
+ m.createToktgovUsageV2({ id, profileId, model: o.model }),
619
+ null,
620
+ 2,
621
+ ),
622
+ );
623
+ });
624
+ parent
625
+ .command("toktgov-recording-usage-v2 <id>")
626
+ .description("Mark usage as recording")
627
+ .action(async (id) => {
628
+ console.log(
629
+ JSON.stringify((await L()).recordingToktgovUsageV2(id), null, 2),
630
+ );
631
+ });
632
+ parent
633
+ .command("toktgov-complete-usage-v2 <id>")
634
+ .description("Complete usage")
635
+ .action(async (id) => {
636
+ console.log(
637
+ JSON.stringify((await L()).completeUsageToktgovV2(id), null, 2),
638
+ );
639
+ });
640
+ parent
641
+ .command("toktgov-fail-usage-v2 <id> [reason]")
642
+ .description("Fail usage")
643
+ .action(async (id, reason) => {
644
+ console.log(
645
+ JSON.stringify((await L()).failToktgovUsageV2(id, reason), null, 2),
646
+ );
647
+ });
648
+ parent
649
+ .command("toktgov-cancel-usage-v2 <id> [reason]")
650
+ .description("Cancel usage")
651
+ .action(async (id, reason) => {
652
+ console.log(
653
+ JSON.stringify((await L()).cancelToktgovUsageV2(id, reason), null, 2),
654
+ );
655
+ });
656
+ parent
657
+ .command("toktgov-get-usage-v2 <id>")
658
+ .description("Get usage")
659
+ .action(async (id) => {
660
+ console.log(JSON.stringify((await L()).getToktgovUsageV2(id), null, 2));
661
+ });
662
+ parent
663
+ .command("toktgov-list-usages-v2")
664
+ .description("List usages")
665
+ .action(async () => {
666
+ console.log(JSON.stringify((await L()).listToktgovUsagesV2(), null, 2));
667
+ });
668
+ parent
669
+ .command("toktgov-auto-stale-idle-v2")
670
+ .description("Auto-stale idle")
671
+ .action(async () => {
672
+ console.log(
673
+ JSON.stringify((await L()).autoStaleIdleToktgovProfilesV2(), null, 2),
674
+ );
675
+ });
676
+ parent
677
+ .command("toktgov-auto-fail-stuck-v2")
678
+ .description("Auto-fail stuck usages")
679
+ .action(async () => {
680
+ console.log(
681
+ JSON.stringify((await L()).autoFailStuckToktgovUsagesV2(), null, 2),
682
+ );
683
+ });
684
+ parent
685
+ .command("toktgov-gov-stats-v2")
686
+ .description("V2 gov stats")
687
+ .action(async () => {
688
+ console.log(
689
+ JSON.stringify((await L()).getTokenTrackerGovStatsV2(), null, 2),
690
+ );
691
+ });
692
+ }