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
@@ -503,3 +503,212 @@ export function registerSyncCommand(program) {
503
503
  console.log(JSON.stringify(flipped, null, 2));
504
504
  });
505
505
  }
506
+
507
+ // === Iter19 V2 governance overlay ===
508
+ export function registerSyncgovV2Commands(program) {
509
+ const parent = program.commands.find((c) => c.name() === "sync");
510
+ if (!parent) return;
511
+ const L = async () => await import("../lib/sync-manager.js");
512
+ parent
513
+ .command("syncgov-enums-v2")
514
+ .description("Show V2 enums")
515
+ .action(async () => {
516
+ const m = await L();
517
+ console.log(
518
+ JSON.stringify(
519
+ {
520
+ profileMaturity: m.SYNCGOV_PROFILE_MATURITY_V2,
521
+ batchLifecycle: m.SYNCGOV_BATCH_LIFECYCLE_V2,
522
+ },
523
+ null,
524
+ 2,
525
+ ),
526
+ );
527
+ });
528
+ parent
529
+ .command("syncgov-config-v2")
530
+ .description("Show V2 config")
531
+ .action(async () => {
532
+ const m = await L();
533
+ console.log(
534
+ JSON.stringify(
535
+ {
536
+ maxActive: m.getMaxActiveSyncgovProfilesPerOwnerV2(),
537
+ maxPending: m.getMaxPendingSyncgovBatchsPerProfileV2(),
538
+ idleMs: m.getSyncgovProfileIdleMsV2(),
539
+ stuckMs: m.getSyncgovBatchStuckMsV2(),
540
+ },
541
+ null,
542
+ 2,
543
+ ),
544
+ );
545
+ });
546
+ parent
547
+ .command("syncgov-set-max-active-v2 <n>")
548
+ .description("Set max active")
549
+ .action(async (n) => {
550
+ (await L()).setMaxActiveSyncgovProfilesPerOwnerV2(Number(n));
551
+ console.log("ok");
552
+ });
553
+ parent
554
+ .command("syncgov-set-max-pending-v2 <n>")
555
+ .description("Set max pending")
556
+ .action(async (n) => {
557
+ (await L()).setMaxPendingSyncgovBatchsPerProfileV2(Number(n));
558
+ console.log("ok");
559
+ });
560
+ parent
561
+ .command("syncgov-set-idle-ms-v2 <n>")
562
+ .description("Set idle threshold ms")
563
+ .action(async (n) => {
564
+ (await L()).setSyncgovProfileIdleMsV2(Number(n));
565
+ console.log("ok");
566
+ });
567
+ parent
568
+ .command("syncgov-set-stuck-ms-v2 <n>")
569
+ .description("Set stuck threshold ms")
570
+ .action(async (n) => {
571
+ (await L()).setSyncgovBatchStuckMsV2(Number(n));
572
+ console.log("ok");
573
+ });
574
+ parent
575
+ .command("syncgov-register-v2 <id> <owner>")
576
+ .description("Register V2 profile")
577
+ .option("--target <v>", "target")
578
+ .action(async (id, owner, o) => {
579
+ const m = await L();
580
+ console.log(
581
+ JSON.stringify(
582
+ m.registerSyncgovProfileV2({ id, owner, target: o.target }),
583
+ null,
584
+ 2,
585
+ ),
586
+ );
587
+ });
588
+ parent
589
+ .command("syncgov-activate-v2 <id>")
590
+ .description("Activate profile")
591
+ .action(async (id) => {
592
+ console.log(
593
+ JSON.stringify((await L()).activateSyncgovProfileV2(id), null, 2),
594
+ );
595
+ });
596
+ parent
597
+ .command("syncgov-stale-v2 <id>")
598
+ .description("Stale profile")
599
+ .action(async (id) => {
600
+ console.log(
601
+ JSON.stringify((await L()).staleSyncgovProfileV2(id), null, 2),
602
+ );
603
+ });
604
+ parent
605
+ .command("syncgov-archive-v2 <id>")
606
+ .description("Archive profile")
607
+ .action(async (id) => {
608
+ console.log(
609
+ JSON.stringify((await L()).archiveSyncgovProfileV2(id), null, 2),
610
+ );
611
+ });
612
+ parent
613
+ .command("syncgov-touch-v2 <id>")
614
+ .description("Touch profile")
615
+ .action(async (id) => {
616
+ console.log(
617
+ JSON.stringify((await L()).touchSyncgovProfileV2(id), null, 2),
618
+ );
619
+ });
620
+ parent
621
+ .command("syncgov-get-v2 <id>")
622
+ .description("Get profile")
623
+ .action(async (id) => {
624
+ console.log(JSON.stringify((await L()).getSyncgovProfileV2(id), null, 2));
625
+ });
626
+ parent
627
+ .command("syncgov-list-v2")
628
+ .description("List profiles")
629
+ .action(async () => {
630
+ console.log(JSON.stringify((await L()).listSyncgovProfilesV2(), null, 2));
631
+ });
632
+ parent
633
+ .command("syncgov-create-batch-v2 <id> <profileId>")
634
+ .description("Create batch")
635
+ .option("--scope <v>", "scope")
636
+ .action(async (id, profileId, o) => {
637
+ const m = await L();
638
+ console.log(
639
+ JSON.stringify(
640
+ m.createSyncgovBatchV2({ id, profileId, scope: o.scope }),
641
+ null,
642
+ 2,
643
+ ),
644
+ );
645
+ });
646
+ parent
647
+ .command("syncgov-replicating-batch-v2 <id>")
648
+ .description("Mark batch as replicating")
649
+ .action(async (id) => {
650
+ console.log(
651
+ JSON.stringify((await L()).replicatingSyncgovBatchV2(id), null, 2),
652
+ );
653
+ });
654
+ parent
655
+ .command("syncgov-complete-batch-v2 <id>")
656
+ .description("Complete batch")
657
+ .action(async (id) => {
658
+ console.log(
659
+ JSON.stringify((await L()).completeBatchSyncgovV2(id), null, 2),
660
+ );
661
+ });
662
+ parent
663
+ .command("syncgov-fail-batch-v2 <id> [reason]")
664
+ .description("Fail batch")
665
+ .action(async (id, reason) => {
666
+ console.log(
667
+ JSON.stringify((await L()).failSyncgovBatchV2(id, reason), null, 2),
668
+ );
669
+ });
670
+ parent
671
+ .command("syncgov-cancel-batch-v2 <id> [reason]")
672
+ .description("Cancel batch")
673
+ .action(async (id, reason) => {
674
+ console.log(
675
+ JSON.stringify((await L()).cancelSyncgovBatchV2(id, reason), null, 2),
676
+ );
677
+ });
678
+ parent
679
+ .command("syncgov-get-batch-v2 <id>")
680
+ .description("Get batch")
681
+ .action(async (id) => {
682
+ console.log(JSON.stringify((await L()).getSyncgovBatchV2(id), null, 2));
683
+ });
684
+ parent
685
+ .command("syncgov-list-batchs-v2")
686
+ .description("List batchs")
687
+ .action(async () => {
688
+ console.log(JSON.stringify((await L()).listSyncgovBatchsV2(), null, 2));
689
+ });
690
+ parent
691
+ .command("syncgov-auto-stale-idle-v2")
692
+ .description("Auto-stale idle")
693
+ .action(async () => {
694
+ console.log(
695
+ JSON.stringify((await L()).autoStaleIdleSyncgovProfilesV2(), null, 2),
696
+ );
697
+ });
698
+ parent
699
+ .command("syncgov-auto-fail-stuck-v2")
700
+ .description("Auto-fail stuck batchs")
701
+ .action(async () => {
702
+ console.log(
703
+ JSON.stringify((await L()).autoFailStuckSyncgovBatchsV2(), null, 2),
704
+ );
705
+ });
706
+ parent
707
+ .command("syncgov-gov-stats-v2")
708
+ .description("V2 gov stats")
709
+ .action(async () => {
710
+ console.log(
711
+ JSON.stringify((await L()).getSyncManagerGovStatsV2(), null, 2),
712
+ );
713
+ });
714
+ }
@@ -604,3 +604,212 @@ export function registerTechCommand(program) {
604
604
  console.log(JSON.stringify(autoFailStuckRunsV2(), null, 2));
605
605
  });
606
606
  }
607
+
608
+ // === Iter23 V2 governance overlay ===
609
+ export function registerTechgovV2Commands(program) {
610
+ const parent = program.commands.find((c) => c.name() === "tech");
611
+ if (!parent) return;
612
+ const L = async () => await import("../lib/tech-learning-engine.js");
613
+ parent
614
+ .command("techgov-enums-v2")
615
+ .description("Show V2 enums")
616
+ .action(async () => {
617
+ const m = await L();
618
+ console.log(
619
+ JSON.stringify(
620
+ {
621
+ profileMaturity: m.TECHGOV_PROFILE_MATURITY_V2,
622
+ lessonLifecycle: m.TECHGOV_LESSON_LIFECYCLE_V2,
623
+ },
624
+ null,
625
+ 2,
626
+ ),
627
+ );
628
+ });
629
+ parent
630
+ .command("techgov-config-v2")
631
+ .description("Show V2 config")
632
+ .action(async () => {
633
+ const m = await L();
634
+ console.log(
635
+ JSON.stringify(
636
+ {
637
+ maxActive: m.getMaxActiveTechgovProfilesPerOwnerV2(),
638
+ maxPending: m.getMaxPendingTechgovLessonsPerProfileV2(),
639
+ idleMs: m.getTechgovProfileIdleMsV2(),
640
+ stuckMs: m.getTechgovLessonStuckMsV2(),
641
+ },
642
+ null,
643
+ 2,
644
+ ),
645
+ );
646
+ });
647
+ parent
648
+ .command("techgov-set-max-active-v2 <n>")
649
+ .description("Set max active")
650
+ .action(async (n) => {
651
+ (await L()).setMaxActiveTechgovProfilesPerOwnerV2(Number(n));
652
+ console.log("ok");
653
+ });
654
+ parent
655
+ .command("techgov-set-max-pending-v2 <n>")
656
+ .description("Set max pending")
657
+ .action(async (n) => {
658
+ (await L()).setMaxPendingTechgovLessonsPerProfileV2(Number(n));
659
+ console.log("ok");
660
+ });
661
+ parent
662
+ .command("techgov-set-idle-ms-v2 <n>")
663
+ .description("Set idle threshold ms")
664
+ .action(async (n) => {
665
+ (await L()).setTechgovProfileIdleMsV2(Number(n));
666
+ console.log("ok");
667
+ });
668
+ parent
669
+ .command("techgov-set-stuck-ms-v2 <n>")
670
+ .description("Set stuck threshold ms")
671
+ .action(async (n) => {
672
+ (await L()).setTechgovLessonStuckMsV2(Number(n));
673
+ console.log("ok");
674
+ });
675
+ parent
676
+ .command("techgov-register-v2 <id> <owner>")
677
+ .description("Register V2 profile")
678
+ .option("--topic <v>", "topic")
679
+ .action(async (id, owner, o) => {
680
+ const m = await L();
681
+ console.log(
682
+ JSON.stringify(
683
+ m.registerTechgovProfileV2({ id, owner, topic: o.topic }),
684
+ null,
685
+ 2,
686
+ ),
687
+ );
688
+ });
689
+ parent
690
+ .command("techgov-activate-v2 <id>")
691
+ .description("Activate profile")
692
+ .action(async (id) => {
693
+ console.log(
694
+ JSON.stringify((await L()).activateTechgovProfileV2(id), null, 2),
695
+ );
696
+ });
697
+ parent
698
+ .command("techgov-stale-v2 <id>")
699
+ .description("Stale profile")
700
+ .action(async (id) => {
701
+ console.log(
702
+ JSON.stringify((await L()).staleTechgovProfileV2(id), null, 2),
703
+ );
704
+ });
705
+ parent
706
+ .command("techgov-archive-v2 <id>")
707
+ .description("Archive profile")
708
+ .action(async (id) => {
709
+ console.log(
710
+ JSON.stringify((await L()).archiveTechgovProfileV2(id), null, 2),
711
+ );
712
+ });
713
+ parent
714
+ .command("techgov-touch-v2 <id>")
715
+ .description("Touch profile")
716
+ .action(async (id) => {
717
+ console.log(
718
+ JSON.stringify((await L()).touchTechgovProfileV2(id), null, 2),
719
+ );
720
+ });
721
+ parent
722
+ .command("techgov-get-v2 <id>")
723
+ .description("Get profile")
724
+ .action(async (id) => {
725
+ console.log(JSON.stringify((await L()).getTechgovProfileV2(id), null, 2));
726
+ });
727
+ parent
728
+ .command("techgov-list-v2")
729
+ .description("List profiles")
730
+ .action(async () => {
731
+ console.log(JSON.stringify((await L()).listTechgovProfilesV2(), null, 2));
732
+ });
733
+ parent
734
+ .command("techgov-create-lesson-v2 <id> <profileId>")
735
+ .description("Create lesson")
736
+ .option("--source <v>", "source")
737
+ .action(async (id, profileId, o) => {
738
+ const m = await L();
739
+ console.log(
740
+ JSON.stringify(
741
+ m.createTechgovLessonV2({ id, profileId, source: o.source }),
742
+ null,
743
+ 2,
744
+ ),
745
+ );
746
+ });
747
+ parent
748
+ .command("techgov-studying-lesson-v2 <id>")
749
+ .description("Mark lesson as studying")
750
+ .action(async (id) => {
751
+ console.log(
752
+ JSON.stringify((await L()).studyingTechgovLessonV2(id), null, 2),
753
+ );
754
+ });
755
+ parent
756
+ .command("techgov-complete-lesson-v2 <id>")
757
+ .description("Complete lesson")
758
+ .action(async (id) => {
759
+ console.log(
760
+ JSON.stringify((await L()).completeLessonTechgovV2(id), null, 2),
761
+ );
762
+ });
763
+ parent
764
+ .command("techgov-fail-lesson-v2 <id> [reason]")
765
+ .description("Fail lesson")
766
+ .action(async (id, reason) => {
767
+ console.log(
768
+ JSON.stringify((await L()).failTechgovLessonV2(id, reason), null, 2),
769
+ );
770
+ });
771
+ parent
772
+ .command("techgov-cancel-lesson-v2 <id> [reason]")
773
+ .description("Cancel lesson")
774
+ .action(async (id, reason) => {
775
+ console.log(
776
+ JSON.stringify((await L()).cancelTechgovLessonV2(id, reason), null, 2),
777
+ );
778
+ });
779
+ parent
780
+ .command("techgov-get-lesson-v2 <id>")
781
+ .description("Get lesson")
782
+ .action(async (id) => {
783
+ console.log(JSON.stringify((await L()).getTechgovLessonV2(id), null, 2));
784
+ });
785
+ parent
786
+ .command("techgov-list-lessons-v2")
787
+ .description("List lessons")
788
+ .action(async () => {
789
+ console.log(JSON.stringify((await L()).listTechgovLessonsV2(), null, 2));
790
+ });
791
+ parent
792
+ .command("techgov-auto-stale-idle-v2")
793
+ .description("Auto-stale idle")
794
+ .action(async () => {
795
+ console.log(
796
+ JSON.stringify((await L()).autoStaleIdleTechgovProfilesV2(), null, 2),
797
+ );
798
+ });
799
+ parent
800
+ .command("techgov-auto-fail-stuck-v2")
801
+ .description("Auto-fail stuck lessons")
802
+ .action(async () => {
803
+ console.log(
804
+ JSON.stringify((await L()).autoFailStuckTechgovLessonsV2(), null, 2),
805
+ );
806
+ });
807
+ parent
808
+ .command("techgov-gov-stats-v2")
809
+ .description("V2 gov stats")
810
+ .action(async () => {
811
+ console.log(
812
+ JSON.stringify((await L()).getTechLearningEngineGovStatsV2(), null, 2),
813
+ );
814
+ });
815
+ }
@@ -925,3 +925,220 @@ export function registerTenantCommand(program) {
925
925
  else console.log(JSON.stringify(s, null, 2));
926
926
  });
927
927
  }
928
+
929
+ // === Iter18 V2 governance overlay ===
930
+ export function registerTnsgovV2Commands(program) {
931
+ const parent = program.commands.find((c) => c.name() === "tenant");
932
+ if (!parent) return;
933
+ const L = async () => await import("../lib/tenant-saas.js");
934
+ parent
935
+ .command("tnsgov-enums-v2")
936
+ .description("Show V2 enums")
937
+ .action(async () => {
938
+ const m = await L();
939
+ console.log(
940
+ JSON.stringify(
941
+ {
942
+ profileMaturity: m.TNSGOV_PROFILE_MATURITY_V2,
943
+ allocationLifecycle: m.TNSGOV_ALLOCATION_LIFECYCLE_V2,
944
+ },
945
+ null,
946
+ 2,
947
+ ),
948
+ );
949
+ });
950
+ parent
951
+ .command("tnsgov-config-v2")
952
+ .description("Show V2 config")
953
+ .action(async () => {
954
+ const m = await L();
955
+ console.log(
956
+ JSON.stringify(
957
+ {
958
+ maxActive: m.getMaxActiveTnsgovProfilesPerOwnerV2(),
959
+ maxPending: m.getMaxPendingTnsgovAllocationsPerProfileV2(),
960
+ idleMs: m.getTnsgovProfileIdleMsV2(),
961
+ stuckMs: m.getTnsgovAllocationStuckMsV2(),
962
+ },
963
+ null,
964
+ 2,
965
+ ),
966
+ );
967
+ });
968
+ parent
969
+ .command("tnsgov-set-max-active-v2 <n>")
970
+ .description("Set max active")
971
+ .action(async (n) => {
972
+ (await L()).setMaxActiveTnsgovProfilesPerOwnerV2(Number(n));
973
+ console.log("ok");
974
+ });
975
+ parent
976
+ .command("tnsgov-set-max-pending-v2 <n>")
977
+ .description("Set max pending")
978
+ .action(async (n) => {
979
+ (await L()).setMaxPendingTnsgovAllocationsPerProfileV2(Number(n));
980
+ console.log("ok");
981
+ });
982
+ parent
983
+ .command("tnsgov-set-idle-ms-v2 <n>")
984
+ .description("Set idle threshold ms")
985
+ .action(async (n) => {
986
+ (await L()).setTnsgovProfileIdleMsV2(Number(n));
987
+ console.log("ok");
988
+ });
989
+ parent
990
+ .command("tnsgov-set-stuck-ms-v2 <n>")
991
+ .description("Set stuck threshold ms")
992
+ .action(async (n) => {
993
+ (await L()).setTnsgovAllocationStuckMsV2(Number(n));
994
+ console.log("ok");
995
+ });
996
+ parent
997
+ .command("tnsgov-register-v2 <id> <owner>")
998
+ .description("Register V2 profile")
999
+ .option("--plan <v>", "plan")
1000
+ .action(async (id, owner, o) => {
1001
+ const m = await L();
1002
+ console.log(
1003
+ JSON.stringify(
1004
+ m.registerTnsgovProfileV2({ id, owner, plan: o.plan }),
1005
+ null,
1006
+ 2,
1007
+ ),
1008
+ );
1009
+ });
1010
+ parent
1011
+ .command("tnsgov-activate-v2 <id>")
1012
+ .description("Activate profile")
1013
+ .action(async (id) => {
1014
+ console.log(
1015
+ JSON.stringify((await L()).activateTnsgovProfileV2(id), null, 2),
1016
+ );
1017
+ });
1018
+ parent
1019
+ .command("tnsgov-suspend-v2 <id>")
1020
+ .description("Suspend profile")
1021
+ .action(async (id) => {
1022
+ console.log(
1023
+ JSON.stringify((await L()).suspendTnsgovProfileV2(id), null, 2),
1024
+ );
1025
+ });
1026
+ parent
1027
+ .command("tnsgov-archive-v2 <id>")
1028
+ .description("Archive profile")
1029
+ .action(async (id) => {
1030
+ console.log(
1031
+ JSON.stringify((await L()).archiveTnsgovProfileV2(id), null, 2),
1032
+ );
1033
+ });
1034
+ parent
1035
+ .command("tnsgov-touch-v2 <id>")
1036
+ .description("Touch profile")
1037
+ .action(async (id) => {
1038
+ console.log(
1039
+ JSON.stringify((await L()).touchTnsgovProfileV2(id), null, 2),
1040
+ );
1041
+ });
1042
+ parent
1043
+ .command("tnsgov-get-v2 <id>")
1044
+ .description("Get profile")
1045
+ .action(async (id) => {
1046
+ console.log(JSON.stringify((await L()).getTnsgovProfileV2(id), null, 2));
1047
+ });
1048
+ parent
1049
+ .command("tnsgov-list-v2")
1050
+ .description("List profiles")
1051
+ .action(async () => {
1052
+ console.log(JSON.stringify((await L()).listTnsgovProfilesV2(), null, 2));
1053
+ });
1054
+ parent
1055
+ .command("tnsgov-create-allocation-v2 <id> <profileId>")
1056
+ .description("Create allocation")
1057
+ .option("--resource <v>", "resource")
1058
+ .action(async (id, profileId, o) => {
1059
+ const m = await L();
1060
+ console.log(
1061
+ JSON.stringify(
1062
+ m.createTnsgovAllocationV2({ id, profileId, resource: o.resource }),
1063
+ null,
1064
+ 2,
1065
+ ),
1066
+ );
1067
+ });
1068
+ parent
1069
+ .command("tnsgov-provisioning-allocation-v2 <id>")
1070
+ .description("Mark allocation as provisioning")
1071
+ .action(async (id) => {
1072
+ console.log(
1073
+ JSON.stringify((await L()).provisioningTnsgovAllocationV2(id), null, 2),
1074
+ );
1075
+ });
1076
+ parent
1077
+ .command("tnsgov-complete-allocation-v2 <id>")
1078
+ .description("Complete allocation")
1079
+ .action(async (id) => {
1080
+ console.log(
1081
+ JSON.stringify((await L()).completeAllocationTnsgovV2(id), null, 2),
1082
+ );
1083
+ });
1084
+ parent
1085
+ .command("tnsgov-fail-allocation-v2 <id> [reason]")
1086
+ .description("Fail allocation")
1087
+ .action(async (id, reason) => {
1088
+ console.log(
1089
+ JSON.stringify((await L()).failTnsgovAllocationV2(id, reason), null, 2),
1090
+ );
1091
+ });
1092
+ parent
1093
+ .command("tnsgov-cancel-allocation-v2 <id> [reason]")
1094
+ .description("Cancel allocation")
1095
+ .action(async (id, reason) => {
1096
+ console.log(
1097
+ JSON.stringify(
1098
+ (await L()).cancelTnsgovAllocationV2(id, reason),
1099
+ null,
1100
+ 2,
1101
+ ),
1102
+ );
1103
+ });
1104
+ parent
1105
+ .command("tnsgov-get-allocation-v2 <id>")
1106
+ .description("Get allocation")
1107
+ .action(async (id) => {
1108
+ console.log(
1109
+ JSON.stringify((await L()).getTnsgovAllocationV2(id), null, 2),
1110
+ );
1111
+ });
1112
+ parent
1113
+ .command("tnsgov-list-allocations-v2")
1114
+ .description("List allocations")
1115
+ .action(async () => {
1116
+ console.log(
1117
+ JSON.stringify((await L()).listTnsgovAllocationsV2(), null, 2),
1118
+ );
1119
+ });
1120
+ parent
1121
+ .command("tnsgov-auto-suspend-idle-v2")
1122
+ .description("Auto-suspend idle")
1123
+ .action(async () => {
1124
+ console.log(
1125
+ JSON.stringify((await L()).autoSuspendIdleTnsgovProfilesV2(), null, 2),
1126
+ );
1127
+ });
1128
+ parent
1129
+ .command("tnsgov-auto-fail-stuck-v2")
1130
+ .description("Auto-fail stuck allocations")
1131
+ .action(async () => {
1132
+ console.log(
1133
+ JSON.stringify((await L()).autoFailStuckTnsgovAllocationsV2(), null, 2),
1134
+ );
1135
+ });
1136
+ parent
1137
+ .command("tnsgov-gov-stats-v2")
1138
+ .description("V2 gov stats")
1139
+ .action(async () => {
1140
+ console.log(
1141
+ JSON.stringify((await L()).getTenantSaasGovStatsV2(), null, 2),
1142
+ );
1143
+ });
1144
+ }