chainlesschain 0.145.0 → 0.156.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 (184) hide show
  1. package/README.md +52 -3
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +201 -0
  4. package/src/commands/activitypub.js +207 -0
  5. package/src/commands/agent-network.js +217 -0
  6. package/src/commands/agent.js +1250 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +203 -0
  9. package/src/commands/browse.js +213 -0
  10. package/src/commands/chat.js +605 -0
  11. package/src/commands/cli-anything.js +426 -0
  12. package/src/commands/codegen.js +207 -0
  13. package/src/commands/collab.js +211 -0
  14. package/src/commands/compliance.js +822 -0
  15. package/src/commands/config.js +213 -0
  16. package/src/commands/cowork.js +1666 -0
  17. package/src/commands/crosschain.js +203 -0
  18. package/src/commands/dao.js +203 -0
  19. package/src/commands/dbevo.js +227 -0
  20. package/src/commands/dev.js +207 -0
  21. package/src/commands/did-v2.js +217 -0
  22. package/src/commands/did.js +221 -0
  23. package/src/commands/dlp.js +213 -0
  24. package/src/commands/economy.js +199 -0
  25. package/src/commands/encrypt.js +201 -0
  26. package/src/commands/evolution.js +199 -0
  27. package/src/commands/evomap.js +830 -0
  28. package/src/commands/export.js +213 -0
  29. package/src/commands/federation.js +209 -0
  30. package/src/commands/fusion.js +205 -0
  31. package/src/commands/governance.js +209 -0
  32. package/src/commands/hmemory.js +203 -0
  33. package/src/commands/hook.js +209 -0
  34. package/src/commands/import.js +209 -0
  35. package/src/commands/inference.js +207 -0
  36. package/src/commands/infra.js +203 -0
  37. package/src/commands/instinct.js +209 -0
  38. package/src/commands/ipfs.js +207 -0
  39. package/src/commands/kg.js +195 -0
  40. package/src/commands/llm.js +426 -0
  41. package/src/commands/matrix.js +207 -0
  42. package/src/commands/mcp.js +217 -0
  43. package/src/commands/memory.js +412 -0
  44. package/src/commands/multimodal.js +203 -0
  45. package/src/commands/nlprog.js +225 -0
  46. package/src/commands/nostr.js +209 -0
  47. package/src/commands/note.js +205 -0
  48. package/src/commands/ops.js +219 -0
  49. package/src/commands/orchestrate.js +406 -0
  50. package/src/commands/org.js +209 -0
  51. package/src/commands/p2p.js +209 -0
  52. package/src/commands/perception.js +209 -0
  53. package/src/commands/permmem.js +203 -0
  54. package/src/commands/pipeline.js +199 -0
  55. package/src/commands/planmode.js +426 -0
  56. package/src/commands/plugin-ecosystem.js +209 -0
  57. package/src/commands/plugin.js +209 -0
  58. package/src/commands/pqc.js +213 -0
  59. package/src/commands/quantization.js +207 -0
  60. package/src/commands/rcache.js +205 -0
  61. package/src/commands/recommend.js +233 -0
  62. package/src/commands/runtime.js +205 -0
  63. package/src/commands/scim.js +209 -0
  64. package/src/commands/services.js +207 -0
  65. package/src/commands/session.js +209 -0
  66. package/src/commands/setup.js +205 -0
  67. package/src/commands/skill.js +414 -0
  68. package/src/commands/social.js +201 -0
  69. package/src/commands/sso.js +209 -0
  70. package/src/commands/start.js +209 -0
  71. package/src/commands/stream.js +213 -0
  72. package/src/commands/sync.js +209 -0
  73. package/src/commands/tech.js +209 -0
  74. package/src/commands/tenant.js +217 -0
  75. package/src/commands/tokens.js +209 -0
  76. package/src/commands/trust.js +217 -0
  77. package/src/commands/ui.js +225 -0
  78. package/src/commands/wallet.js +209 -0
  79. package/src/commands/workflow.js +412 -0
  80. package/src/index.js +252 -0
  81. package/src/lib/a2a-protocol.js +332 -0
  82. package/src/lib/activitypub-bridge.js +334 -0
  83. package/src/lib/agent-coordinator.js +334 -0
  84. package/src/lib/agent-economy.js +334 -0
  85. package/src/lib/agent-network.js +341 -0
  86. package/src/lib/agent-router.js +333 -0
  87. package/src/lib/aiops.js +346 -0
  88. package/src/lib/automation-engine.js +335 -0
  89. package/src/lib/autonomous-agent.js +332 -0
  90. package/src/lib/autonomous-developer.js +332 -0
  91. package/src/lib/bi-engine.js +333 -0
  92. package/src/lib/browser-automation.js +334 -0
  93. package/src/lib/chat-core.js +335 -0
  94. package/src/lib/cli-anything-bridge.js +341 -0
  95. package/src/lib/cli-context-engineering.js +351 -0
  96. package/src/lib/code-agent.js +339 -0
  97. package/src/lib/collaboration-governance.js +334 -0
  98. package/src/lib/community-governance.js +346 -0
  99. package/src/lib/compliance-manager.js +334 -0
  100. package/src/lib/content-recommendation.js +351 -0
  101. package/src/lib/cowork-adapter.js +336 -0
  102. package/src/lib/cowork-evomap-adapter.js +341 -0
  103. package/src/lib/cowork-mcp-tools.js +341 -0
  104. package/src/lib/cowork-observe-html.js +341 -0
  105. package/src/lib/cowork-observe.js +341 -0
  106. package/src/lib/cowork-share.js +338 -0
  107. package/src/lib/cowork-task-templates.js +342 -1
  108. package/src/lib/cowork-template-marketplace.js +340 -0
  109. package/src/lib/cross-chain.js +339 -0
  110. package/src/lib/crypto-manager.js +334 -0
  111. package/src/lib/dao-governance.js +339 -0
  112. package/src/lib/dbevo.js +351 -0
  113. package/src/lib/decentral-infra.js +330 -0
  114. package/src/lib/did-manager.js +341 -0
  115. package/src/lib/did-v2-manager.js +341 -0
  116. package/src/lib/dlp-engine.js +339 -0
  117. package/src/lib/downloader.js +334 -0
  118. package/src/lib/evolution-system.js +334 -0
  119. package/src/lib/evomap-client.js +342 -0
  120. package/src/lib/evomap-federation.js +338 -0
  121. package/src/lib/evomap-governance.js +334 -0
  122. package/src/lib/evomap-manager.js +330 -0
  123. package/src/lib/execution-backend.js +330 -0
  124. package/src/lib/federation-hardening.js +340 -0
  125. package/src/lib/hashline.js +338 -0
  126. package/src/lib/hierarchical-memory.js +334 -0
  127. package/src/lib/hook-manager.js +341 -0
  128. package/src/lib/inference-network.js +341 -0
  129. package/src/lib/instinct-manager.js +346 -0
  130. package/src/lib/interaction-adapter.js +330 -0
  131. package/src/lib/interactive-planner.js +354 -0
  132. package/src/lib/ipfs-storage.js +334 -0
  133. package/src/lib/knowledge-exporter.js +341 -0
  134. package/src/lib/knowledge-graph.js +331 -0
  135. package/src/lib/knowledge-importer.js +341 -0
  136. package/src/lib/llm-providers.js +346 -0
  137. package/src/lib/matrix-bridge.js +339 -0
  138. package/src/lib/mcp-registry.js +346 -0
  139. package/src/lib/memory-manager.js +336 -0
  140. package/src/lib/multimodal.js +330 -0
  141. package/src/lib/nl-programming.js +341 -0
  142. package/src/lib/nostr-bridge.js +336 -0
  143. package/src/lib/note-versioning.js +339 -0
  144. package/src/lib/org-manager.js +336 -0
  145. package/src/lib/p2p-manager.js +341 -0
  146. package/src/lib/perception.js +346 -0
  147. package/src/lib/permanent-memory.js +327 -0
  148. package/src/lib/pipeline-orchestrator.js +332 -0
  149. package/src/lib/plan-mode.js +336 -0
  150. package/src/lib/plugin-autodiscovery.js +334 -0
  151. package/src/lib/plugin-ecosystem.js +346 -0
  152. package/src/lib/pqc-manager.js +346 -0
  153. package/src/lib/process-manager.js +336 -0
  154. package/src/lib/protocol-fusion.js +338 -0
  155. package/src/lib/provider-options.js +346 -0
  156. package/src/lib/provider-stream.js +348 -0
  157. package/src/lib/quantization.js +337 -0
  158. package/src/lib/response-cache.js +333 -0
  159. package/src/lib/scim-manager.js +346 -0
  160. package/src/lib/service-manager.js +337 -0
  161. package/src/lib/session-core-singletons.js +341 -0
  162. package/src/lib/session-manager.js +334 -0
  163. package/src/lib/skill-loader.js +334 -0
  164. package/src/lib/skill-mcp.js +336 -0
  165. package/src/lib/social-manager.js +330 -0
  166. package/src/lib/sso-manager.js +340 -0
  167. package/src/lib/stix-parser.js +346 -0
  168. package/src/lib/sub-agent-context.js +343 -0
  169. package/src/lib/sub-agent-profiles.js +335 -0
  170. package/src/lib/sub-agent-registry.js +336 -0
  171. package/src/lib/sync-manager.js +336 -0
  172. package/src/lib/tech-learning-engine.js +341 -0
  173. package/src/lib/tenant-saas.js +341 -0
  174. package/src/lib/threat-intel.js +330 -0
  175. package/src/lib/todo-manager.js +336 -0
  176. package/src/lib/token-tracker.js +336 -0
  177. package/src/lib/trust-security.js +343 -0
  178. package/src/lib/ueba.js +340 -0
  179. package/src/lib/universal-runtime.js +330 -0
  180. package/src/lib/wallet-manager.js +336 -0
  181. package/src/lib/web-ui-server.js +348 -0
  182. package/src/lib/workflow-engine.js +330 -0
  183. package/src/lib/workflow-expr.js +346 -0
  184. package/src/lib/ws-chat-handler.js +337 -0
@@ -661,3 +661,210 @@ export function registerDevCommand(program) {
661
661
  console.log(JSON.stringify(getAutonomousDeveloperStatsV2(), null, 2)),
662
662
  );
663
663
  }
664
+
665
+ // === Iter24 V2 governance overlay ===
666
+ export function registerDevgovV2Commands(program) {
667
+ const parent = program.commands.find((c) => c.name() === "dev");
668
+ if (!parent) return;
669
+ const L = async () => await import("../lib/autonomous-developer.js");
670
+ parent
671
+ .command("devgov-enums-v2")
672
+ .description("Show V2 enums")
673
+ .action(async () => {
674
+ const m = await L();
675
+ console.log(
676
+ JSON.stringify(
677
+ {
678
+ profileMaturity: m.DEVGOV_PROFILE_MATURITY_V2,
679
+ runLifecycle: m.DEVGOV_RUN_LIFECYCLE_V2,
680
+ },
681
+ null,
682
+ 2,
683
+ ),
684
+ );
685
+ });
686
+ parent
687
+ .command("devgov-config-v2")
688
+ .description("Show V2 config")
689
+ .action(async () => {
690
+ const m = await L();
691
+ console.log(
692
+ JSON.stringify(
693
+ {
694
+ maxActive: m.getMaxActiveDevgovProfilesPerOwnerV2(),
695
+ maxPending: m.getMaxPendingDevgovRunsPerProfileV2(),
696
+ idleMs: m.getDevgovProfileIdleMsV2(),
697
+ stuckMs: m.getDevgovRunStuckMsV2(),
698
+ },
699
+ null,
700
+ 2,
701
+ ),
702
+ );
703
+ });
704
+ parent
705
+ .command("devgov-set-max-active-v2 <n>")
706
+ .description("Set max active")
707
+ .action(async (n) => {
708
+ (await L()).setMaxActiveDevgovProfilesPerOwnerV2(Number(n));
709
+ console.log("ok");
710
+ });
711
+ parent
712
+ .command("devgov-set-max-pending-v2 <n>")
713
+ .description("Set max pending")
714
+ .action(async (n) => {
715
+ (await L()).setMaxPendingDevgovRunsPerProfileV2(Number(n));
716
+ console.log("ok");
717
+ });
718
+ parent
719
+ .command("devgov-set-idle-ms-v2 <n>")
720
+ .description("Set idle threshold ms")
721
+ .action(async (n) => {
722
+ (await L()).setDevgovProfileIdleMsV2(Number(n));
723
+ console.log("ok");
724
+ });
725
+ parent
726
+ .command("devgov-set-stuck-ms-v2 <n>")
727
+ .description("Set stuck threshold ms")
728
+ .action(async (n) => {
729
+ (await L()).setDevgovRunStuckMsV2(Number(n));
730
+ console.log("ok");
731
+ });
732
+ parent
733
+ .command("devgov-register-v2 <id> <owner>")
734
+ .description("Register V2 profile")
735
+ .option("--level <v>", "level")
736
+ .action(async (id, owner, o) => {
737
+ const m = await L();
738
+ console.log(
739
+ JSON.stringify(
740
+ m.registerDevgovProfileV2({ id, owner, level: o.level }),
741
+ null,
742
+ 2,
743
+ ),
744
+ );
745
+ });
746
+ parent
747
+ .command("devgov-activate-v2 <id>")
748
+ .description("Activate profile")
749
+ .action(async (id) => {
750
+ console.log(
751
+ JSON.stringify((await L()).activateDevgovProfileV2(id), null, 2),
752
+ );
753
+ });
754
+ parent
755
+ .command("devgov-pause-v2 <id>")
756
+ .description("Pause profile")
757
+ .action(async (id) => {
758
+ console.log(
759
+ JSON.stringify((await L()).pauseDevgovProfileV2(id), null, 2),
760
+ );
761
+ });
762
+ parent
763
+ .command("devgov-archive-v2 <id>")
764
+ .description("Archive profile")
765
+ .action(async (id) => {
766
+ console.log(
767
+ JSON.stringify((await L()).archiveDevgovProfileV2(id), null, 2),
768
+ );
769
+ });
770
+ parent
771
+ .command("devgov-touch-v2 <id>")
772
+ .description("Touch profile")
773
+ .action(async (id) => {
774
+ console.log(
775
+ JSON.stringify((await L()).touchDevgovProfileV2(id), null, 2),
776
+ );
777
+ });
778
+ parent
779
+ .command("devgov-get-v2 <id>")
780
+ .description("Get profile")
781
+ .action(async (id) => {
782
+ console.log(JSON.stringify((await L()).getDevgovProfileV2(id), null, 2));
783
+ });
784
+ parent
785
+ .command("devgov-list-v2")
786
+ .description("List profiles")
787
+ .action(async () => {
788
+ console.log(JSON.stringify((await L()).listDevgovProfilesV2(), null, 2));
789
+ });
790
+ parent
791
+ .command("devgov-create-run-v2 <id> <profileId>")
792
+ .description("Create run")
793
+ .option("--goal <v>", "goal")
794
+ .action(async (id, profileId, o) => {
795
+ const m = await L();
796
+ console.log(
797
+ JSON.stringify(
798
+ m.createDevgovRunV2({ id, profileId, goal: o.goal }),
799
+ null,
800
+ 2,
801
+ ),
802
+ );
803
+ });
804
+ parent
805
+ .command("devgov-developing-run-v2 <id>")
806
+ .description("Mark run as developing")
807
+ .action(async (id) => {
808
+ console.log(
809
+ JSON.stringify((await L()).developingDevgovRunV2(id), null, 2),
810
+ );
811
+ });
812
+ parent
813
+ .command("devgov-complete-run-v2 <id>")
814
+ .description("Complete run")
815
+ .action(async (id) => {
816
+ console.log(JSON.stringify((await L()).completeRunDevgovV2(id), null, 2));
817
+ });
818
+ parent
819
+ .command("devgov-fail-run-v2 <id> [reason]")
820
+ .description("Fail run")
821
+ .action(async (id, reason) => {
822
+ console.log(
823
+ JSON.stringify((await L()).failDevgovRunV2(id, reason), null, 2),
824
+ );
825
+ });
826
+ parent
827
+ .command("devgov-cancel-run-v2 <id> [reason]")
828
+ .description("Cancel run")
829
+ .action(async (id, reason) => {
830
+ console.log(
831
+ JSON.stringify((await L()).cancelDevgovRunV2(id, reason), null, 2),
832
+ );
833
+ });
834
+ parent
835
+ .command("devgov-get-run-v2 <id>")
836
+ .description("Get run")
837
+ .action(async (id) => {
838
+ console.log(JSON.stringify((await L()).getDevgovRunV2(id), null, 2));
839
+ });
840
+ parent
841
+ .command("devgov-list-runs-v2")
842
+ .description("List runs")
843
+ .action(async () => {
844
+ console.log(JSON.stringify((await L()).listDevgovRunsV2(), null, 2));
845
+ });
846
+ parent
847
+ .command("devgov-auto-pause-idle-v2")
848
+ .description("Auto-pause idle")
849
+ .action(async () => {
850
+ console.log(
851
+ JSON.stringify((await L()).autoPauseIdleDevgovProfilesV2(), null, 2),
852
+ );
853
+ });
854
+ parent
855
+ .command("devgov-auto-fail-stuck-v2")
856
+ .description("Auto-fail stuck runs")
857
+ .action(async () => {
858
+ console.log(
859
+ JSON.stringify((await L()).autoFailStuckDevgovRunsV2(), null, 2),
860
+ );
861
+ });
862
+ parent
863
+ .command("devgov-gov-stats-v2")
864
+ .description("V2 gov stats")
865
+ .action(async () => {
866
+ console.log(
867
+ JSON.stringify((await L()).getAutonomousDeveloperGovStatsV2(), null, 2),
868
+ );
869
+ });
870
+ }
@@ -618,3 +618,220 @@ export function registerDIDv2Command(program) {
618
618
 
619
619
  program.addCommand(didv2);
620
620
  }
621
+
622
+ // === Iter22 V2 governance overlay ===
623
+ export function registerDv2govV2Commands(program) {
624
+ const parent = program.commands.find((c) => c.name() === "did-v2");
625
+ if (!parent) return;
626
+ const L = async () => await import("../lib/did-v2-manager.js");
627
+ parent
628
+ .command("dv2gov-enums-v2")
629
+ .description("Show V2 enums")
630
+ .action(async () => {
631
+ const m = await L();
632
+ console.log(
633
+ JSON.stringify(
634
+ {
635
+ profileMaturity: m.DV2GOV_PROFILE_MATURITY_V2,
636
+ credentialLifecycle: m.DV2GOV_CREDENTIAL_LIFECYCLE_V2,
637
+ },
638
+ null,
639
+ 2,
640
+ ),
641
+ );
642
+ });
643
+ parent
644
+ .command("dv2gov-config-v2")
645
+ .description("Show V2 config")
646
+ .action(async () => {
647
+ const m = await L();
648
+ console.log(
649
+ JSON.stringify(
650
+ {
651
+ maxActive: m.getMaxActiveDv2govProfilesPerOwnerV2(),
652
+ maxPending: m.getMaxPendingDv2govCredentialsPerProfileV2(),
653
+ idleMs: m.getDv2govProfileIdleMsV2(),
654
+ stuckMs: m.getDv2govCredentialStuckMsV2(),
655
+ },
656
+ null,
657
+ 2,
658
+ ),
659
+ );
660
+ });
661
+ parent
662
+ .command("dv2gov-set-max-active-v2 <n>")
663
+ .description("Set max active")
664
+ .action(async (n) => {
665
+ (await L()).setMaxActiveDv2govProfilesPerOwnerV2(Number(n));
666
+ console.log("ok");
667
+ });
668
+ parent
669
+ .command("dv2gov-set-max-pending-v2 <n>")
670
+ .description("Set max pending")
671
+ .action(async (n) => {
672
+ (await L()).setMaxPendingDv2govCredentialsPerProfileV2(Number(n));
673
+ console.log("ok");
674
+ });
675
+ parent
676
+ .command("dv2gov-set-idle-ms-v2 <n>")
677
+ .description("Set idle threshold ms")
678
+ .action(async (n) => {
679
+ (await L()).setDv2govProfileIdleMsV2(Number(n));
680
+ console.log("ok");
681
+ });
682
+ parent
683
+ .command("dv2gov-set-stuck-ms-v2 <n>")
684
+ .description("Set stuck threshold ms")
685
+ .action(async (n) => {
686
+ (await L()).setDv2govCredentialStuckMsV2(Number(n));
687
+ console.log("ok");
688
+ });
689
+ parent
690
+ .command("dv2gov-register-v2 <id> <owner>")
691
+ .description("Register V2 profile")
692
+ .option("--method <v>", "method")
693
+ .action(async (id, owner, o) => {
694
+ const m = await L();
695
+ console.log(
696
+ JSON.stringify(
697
+ m.registerDv2govProfileV2({ id, owner, method: o.method }),
698
+ null,
699
+ 2,
700
+ ),
701
+ );
702
+ });
703
+ parent
704
+ .command("dv2gov-activate-v2 <id>")
705
+ .description("Activate profile")
706
+ .action(async (id) => {
707
+ console.log(
708
+ JSON.stringify((await L()).activateDv2govProfileV2(id), null, 2),
709
+ );
710
+ });
711
+ parent
712
+ .command("dv2gov-suspend-v2 <id>")
713
+ .description("Suspend profile")
714
+ .action(async (id) => {
715
+ console.log(
716
+ JSON.stringify((await L()).suspendDv2govProfileV2(id), null, 2),
717
+ );
718
+ });
719
+ parent
720
+ .command("dv2gov-archive-v2 <id>")
721
+ .description("Archive profile")
722
+ .action(async (id) => {
723
+ console.log(
724
+ JSON.stringify((await L()).archiveDv2govProfileV2(id), null, 2),
725
+ );
726
+ });
727
+ parent
728
+ .command("dv2gov-touch-v2 <id>")
729
+ .description("Touch profile")
730
+ .action(async (id) => {
731
+ console.log(
732
+ JSON.stringify((await L()).touchDv2govProfileV2(id), null, 2),
733
+ );
734
+ });
735
+ parent
736
+ .command("dv2gov-get-v2 <id>")
737
+ .description("Get profile")
738
+ .action(async (id) => {
739
+ console.log(JSON.stringify((await L()).getDv2govProfileV2(id), null, 2));
740
+ });
741
+ parent
742
+ .command("dv2gov-list-v2")
743
+ .description("List profiles")
744
+ .action(async () => {
745
+ console.log(JSON.stringify((await L()).listDv2govProfilesV2(), null, 2));
746
+ });
747
+ parent
748
+ .command("dv2gov-create-credential-v2 <id> <profileId>")
749
+ .description("Create credential")
750
+ .option("--subject <v>", "subject")
751
+ .action(async (id, profileId, o) => {
752
+ const m = await L();
753
+ console.log(
754
+ JSON.stringify(
755
+ m.createDv2govCredentialV2({ id, profileId, subject: o.subject }),
756
+ null,
757
+ 2,
758
+ ),
759
+ );
760
+ });
761
+ parent
762
+ .command("dv2gov-issuing-credential-v2 <id>")
763
+ .description("Mark credential as issuing")
764
+ .action(async (id) => {
765
+ console.log(
766
+ JSON.stringify((await L()).issuingDv2govCredentialV2(id), null, 2),
767
+ );
768
+ });
769
+ parent
770
+ .command("dv2gov-complete-credential-v2 <id>")
771
+ .description("Complete credential")
772
+ .action(async (id) => {
773
+ console.log(
774
+ JSON.stringify((await L()).completeCredentialDv2govV2(id), null, 2),
775
+ );
776
+ });
777
+ parent
778
+ .command("dv2gov-fail-credential-v2 <id> [reason]")
779
+ .description("Fail credential")
780
+ .action(async (id, reason) => {
781
+ console.log(
782
+ JSON.stringify((await L()).failDv2govCredentialV2(id, reason), null, 2),
783
+ );
784
+ });
785
+ parent
786
+ .command("dv2gov-cancel-credential-v2 <id> [reason]")
787
+ .description("Cancel credential")
788
+ .action(async (id, reason) => {
789
+ console.log(
790
+ JSON.stringify(
791
+ (await L()).cancelDv2govCredentialV2(id, reason),
792
+ null,
793
+ 2,
794
+ ),
795
+ );
796
+ });
797
+ parent
798
+ .command("dv2gov-get-credential-v2 <id>")
799
+ .description("Get credential")
800
+ .action(async (id) => {
801
+ console.log(
802
+ JSON.stringify((await L()).getDv2govCredentialV2(id), null, 2),
803
+ );
804
+ });
805
+ parent
806
+ .command("dv2gov-list-credentials-v2")
807
+ .description("List credentials")
808
+ .action(async () => {
809
+ console.log(
810
+ JSON.stringify((await L()).listDv2govCredentialsV2(), null, 2),
811
+ );
812
+ });
813
+ parent
814
+ .command("dv2gov-auto-suspend-idle-v2")
815
+ .description("Auto-suspend idle")
816
+ .action(async () => {
817
+ console.log(
818
+ JSON.stringify((await L()).autoSuspendIdleDv2govProfilesV2(), null, 2),
819
+ );
820
+ });
821
+ parent
822
+ .command("dv2gov-auto-fail-stuck-v2")
823
+ .description("Auto-fail stuck credentials")
824
+ .action(async () => {
825
+ console.log(
826
+ JSON.stringify((await L()).autoFailStuckDv2govCredentialsV2(), null, 2),
827
+ );
828
+ });
829
+ parent
830
+ .command("dv2gov-gov-stats-v2")
831
+ .description("V2 gov stats")
832
+ .action(async () => {
833
+ console.log(
834
+ JSON.stringify((await L()).getDidV2ManagerGovStatsV2(), null, 2),
835
+ );
836
+ });
837
+ }
@@ -732,3 +732,224 @@ export function registerDidCommand(program) {
732
732
  .option("--json")
733
733
  .action(() => console.log(JSON.stringify(getDidManagerStatsV2(), null, 2)));
734
734
  }
735
+
736
+ // === Iter19 V2 governance overlay ===
737
+ export function registerDidgovV2Commands(program) {
738
+ const parent = program.commands.find((c) => c.name() === "did");
739
+ if (!parent) return;
740
+ const L = async () => await import("../lib/did-manager.js");
741
+ parent
742
+ .command("didgov-enums-v2")
743
+ .description("Show V2 enums")
744
+ .action(async () => {
745
+ const m = await L();
746
+ console.log(
747
+ JSON.stringify(
748
+ {
749
+ profileMaturity: m.DIDGOV_PROFILE_MATURITY_V2,
750
+ resolutionLifecycle: m.DIDGOV_RESOLUTION_LIFECYCLE_V2,
751
+ },
752
+ null,
753
+ 2,
754
+ ),
755
+ );
756
+ });
757
+ parent
758
+ .command("didgov-config-v2")
759
+ .description("Show V2 config")
760
+ .action(async () => {
761
+ const m = await L();
762
+ console.log(
763
+ JSON.stringify(
764
+ {
765
+ maxActive: m.getMaxActiveDidgovProfilesPerOwnerV2(),
766
+ maxPending: m.getMaxPendingDidgovResolutionsPerProfileV2(),
767
+ idleMs: m.getDidgovProfileIdleMsV2(),
768
+ stuckMs: m.getDidgovResolutionStuckMsV2(),
769
+ },
770
+ null,
771
+ 2,
772
+ ),
773
+ );
774
+ });
775
+ parent
776
+ .command("didgov-set-max-active-v2 <n>")
777
+ .description("Set max active")
778
+ .action(async (n) => {
779
+ (await L()).setMaxActiveDidgovProfilesPerOwnerV2(Number(n));
780
+ console.log("ok");
781
+ });
782
+ parent
783
+ .command("didgov-set-max-pending-v2 <n>")
784
+ .description("Set max pending")
785
+ .action(async (n) => {
786
+ (await L()).setMaxPendingDidgovResolutionsPerProfileV2(Number(n));
787
+ console.log("ok");
788
+ });
789
+ parent
790
+ .command("didgov-set-idle-ms-v2 <n>")
791
+ .description("Set idle threshold ms")
792
+ .action(async (n) => {
793
+ (await L()).setDidgovProfileIdleMsV2(Number(n));
794
+ console.log("ok");
795
+ });
796
+ parent
797
+ .command("didgov-set-stuck-ms-v2 <n>")
798
+ .description("Set stuck threshold ms")
799
+ .action(async (n) => {
800
+ (await L()).setDidgovResolutionStuckMsV2(Number(n));
801
+ console.log("ok");
802
+ });
803
+ parent
804
+ .command("didgov-register-v2 <id> <owner>")
805
+ .description("Register V2 profile")
806
+ .option("--method <v>", "method")
807
+ .action(async (id, owner, o) => {
808
+ const m = await L();
809
+ console.log(
810
+ JSON.stringify(
811
+ m.registerDidgovProfileV2({ id, owner, method: o.method }),
812
+ null,
813
+ 2,
814
+ ),
815
+ );
816
+ });
817
+ parent
818
+ .command("didgov-activate-v2 <id>")
819
+ .description("Activate profile")
820
+ .action(async (id) => {
821
+ console.log(
822
+ JSON.stringify((await L()).activateDidgovProfileV2(id), null, 2),
823
+ );
824
+ });
825
+ parent
826
+ .command("didgov-suspend-v2 <id>")
827
+ .description("Suspend profile")
828
+ .action(async (id) => {
829
+ console.log(
830
+ JSON.stringify((await L()).suspendDidgovProfileV2(id), null, 2),
831
+ );
832
+ });
833
+ parent
834
+ .command("didgov-archive-v2 <id>")
835
+ .description("Archive profile")
836
+ .action(async (id) => {
837
+ console.log(
838
+ JSON.stringify((await L()).archiveDidgovProfileV2(id), null, 2),
839
+ );
840
+ });
841
+ parent
842
+ .command("didgov-touch-v2 <id>")
843
+ .description("Touch profile")
844
+ .action(async (id) => {
845
+ console.log(
846
+ JSON.stringify((await L()).touchDidgovProfileV2(id), null, 2),
847
+ );
848
+ });
849
+ parent
850
+ .command("didgov-get-v2 <id>")
851
+ .description("Get profile")
852
+ .action(async (id) => {
853
+ console.log(JSON.stringify((await L()).getDidgovProfileV2(id), null, 2));
854
+ });
855
+ parent
856
+ .command("didgov-list-v2")
857
+ .description("List profiles")
858
+ .action(async () => {
859
+ console.log(JSON.stringify((await L()).listDidgovProfilesV2(), null, 2));
860
+ });
861
+ parent
862
+ .command("didgov-create-resolution-v2 <id> <profileId>")
863
+ .description("Create resolution")
864
+ .option("--identifier <v>", "identifier")
865
+ .action(async (id, profileId, o) => {
866
+ const m = await L();
867
+ console.log(
868
+ JSON.stringify(
869
+ m.createDidgovResolutionV2({
870
+ id,
871
+ profileId,
872
+ identifier: o.identifier,
873
+ }),
874
+ null,
875
+ 2,
876
+ ),
877
+ );
878
+ });
879
+ parent
880
+ .command("didgov-resolving-resolution-v2 <id>")
881
+ .description("Mark resolution as resolving")
882
+ .action(async (id) => {
883
+ console.log(
884
+ JSON.stringify((await L()).resolvingDidgovResolutionV2(id), null, 2),
885
+ );
886
+ });
887
+ parent
888
+ .command("didgov-complete-resolution-v2 <id>")
889
+ .description("Complete resolution")
890
+ .action(async (id) => {
891
+ console.log(
892
+ JSON.stringify((await L()).completeResolutionDidgovV2(id), null, 2),
893
+ );
894
+ });
895
+ parent
896
+ .command("didgov-fail-resolution-v2 <id> [reason]")
897
+ .description("Fail resolution")
898
+ .action(async (id, reason) => {
899
+ console.log(
900
+ JSON.stringify((await L()).failDidgovResolutionV2(id, reason), null, 2),
901
+ );
902
+ });
903
+ parent
904
+ .command("didgov-cancel-resolution-v2 <id> [reason]")
905
+ .description("Cancel resolution")
906
+ .action(async (id, reason) => {
907
+ console.log(
908
+ JSON.stringify(
909
+ (await L()).cancelDidgovResolutionV2(id, reason),
910
+ null,
911
+ 2,
912
+ ),
913
+ );
914
+ });
915
+ parent
916
+ .command("didgov-get-resolution-v2 <id>")
917
+ .description("Get resolution")
918
+ .action(async (id) => {
919
+ console.log(
920
+ JSON.stringify((await L()).getDidgovResolutionV2(id), null, 2),
921
+ );
922
+ });
923
+ parent
924
+ .command("didgov-list-resolutions-v2")
925
+ .description("List resolutions")
926
+ .action(async () => {
927
+ console.log(
928
+ JSON.stringify((await L()).listDidgovResolutionsV2(), null, 2),
929
+ );
930
+ });
931
+ parent
932
+ .command("didgov-auto-suspend-idle-v2")
933
+ .description("Auto-suspend idle")
934
+ .action(async () => {
935
+ console.log(
936
+ JSON.stringify((await L()).autoSuspendIdleDidgovProfilesV2(), null, 2),
937
+ );
938
+ });
939
+ parent
940
+ .command("didgov-auto-fail-stuck-v2")
941
+ .description("Auto-fail stuck resolutions")
942
+ .action(async () => {
943
+ console.log(
944
+ JSON.stringify((await L()).autoFailStuckDidgovResolutionsV2(), null, 2),
945
+ );
946
+ });
947
+ parent
948
+ .command("didgov-gov-stats-v2")
949
+ .description("V2 gov stats")
950
+ .action(async () => {
951
+ console.log(
952
+ JSON.stringify((await L()).getDidManagerGovStatsV2(), null, 2),
953
+ );
954
+ });
955
+ }