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
@@ -662,3 +662,212 @@ export function registerP2pCommand(program) {
662
662
  else logger.log(JSON.stringify(s, null, 2));
663
663
  });
664
664
  }
665
+
666
+ // === Iter20 V2 governance overlay ===
667
+ export function registerP2pgovV2Commands(program) {
668
+ const parent = program.commands.find((c) => c.name() === "p2p");
669
+ if (!parent) return;
670
+ const L = async () => await import("../lib/p2p-manager.js");
671
+ parent
672
+ .command("p2pgov-enums-v2")
673
+ .description("Show V2 enums")
674
+ .action(async () => {
675
+ const m = await L();
676
+ console.log(
677
+ JSON.stringify(
678
+ {
679
+ profileMaturity: m.P2PGOV_PROFILE_MATURITY_V2,
680
+ gossipLifecycle: m.P2PGOV_GOSSIP_LIFECYCLE_V2,
681
+ },
682
+ null,
683
+ 2,
684
+ ),
685
+ );
686
+ });
687
+ parent
688
+ .command("p2pgov-config-v2")
689
+ .description("Show V2 config")
690
+ .action(async () => {
691
+ const m = await L();
692
+ console.log(
693
+ JSON.stringify(
694
+ {
695
+ maxActive: m.getMaxActiveP2pgovProfilesPerOwnerV2(),
696
+ maxPending: m.getMaxPendingP2pgovGossipsPerProfileV2(),
697
+ idleMs: m.getP2pgovProfileIdleMsV2(),
698
+ stuckMs: m.getP2pgovGossipStuckMsV2(),
699
+ },
700
+ null,
701
+ 2,
702
+ ),
703
+ );
704
+ });
705
+ parent
706
+ .command("p2pgov-set-max-active-v2 <n>")
707
+ .description("Set max active")
708
+ .action(async (n) => {
709
+ (await L()).setMaxActiveP2pgovProfilesPerOwnerV2(Number(n));
710
+ console.log("ok");
711
+ });
712
+ parent
713
+ .command("p2pgov-set-max-pending-v2 <n>")
714
+ .description("Set max pending")
715
+ .action(async (n) => {
716
+ (await L()).setMaxPendingP2pgovGossipsPerProfileV2(Number(n));
717
+ console.log("ok");
718
+ });
719
+ parent
720
+ .command("p2pgov-set-idle-ms-v2 <n>")
721
+ .description("Set idle threshold ms")
722
+ .action(async (n) => {
723
+ (await L()).setP2pgovProfileIdleMsV2(Number(n));
724
+ console.log("ok");
725
+ });
726
+ parent
727
+ .command("p2pgov-set-stuck-ms-v2 <n>")
728
+ .description("Set stuck threshold ms")
729
+ .action(async (n) => {
730
+ (await L()).setP2pgovGossipStuckMsV2(Number(n));
731
+ console.log("ok");
732
+ });
733
+ parent
734
+ .command("p2pgov-register-v2 <id> <owner>")
735
+ .description("Register V2 profile")
736
+ .option("--transport <v>", "transport")
737
+ .action(async (id, owner, o) => {
738
+ const m = await L();
739
+ console.log(
740
+ JSON.stringify(
741
+ m.registerP2pgovProfileV2({ id, owner, transport: o.transport }),
742
+ null,
743
+ 2,
744
+ ),
745
+ );
746
+ });
747
+ parent
748
+ .command("p2pgov-activate-v2 <id>")
749
+ .description("Activate profile")
750
+ .action(async (id) => {
751
+ console.log(
752
+ JSON.stringify((await L()).activateP2pgovProfileV2(id), null, 2),
753
+ );
754
+ });
755
+ parent
756
+ .command("p2pgov-suspend-v2 <id>")
757
+ .description("Suspend profile")
758
+ .action(async (id) => {
759
+ console.log(
760
+ JSON.stringify((await L()).suspendP2pgovProfileV2(id), null, 2),
761
+ );
762
+ });
763
+ parent
764
+ .command("p2pgov-archive-v2 <id>")
765
+ .description("Archive profile")
766
+ .action(async (id) => {
767
+ console.log(
768
+ JSON.stringify((await L()).archiveP2pgovProfileV2(id), null, 2),
769
+ );
770
+ });
771
+ parent
772
+ .command("p2pgov-touch-v2 <id>")
773
+ .description("Touch profile")
774
+ .action(async (id) => {
775
+ console.log(
776
+ JSON.stringify((await L()).touchP2pgovProfileV2(id), null, 2),
777
+ );
778
+ });
779
+ parent
780
+ .command("p2pgov-get-v2 <id>")
781
+ .description("Get profile")
782
+ .action(async (id) => {
783
+ console.log(JSON.stringify((await L()).getP2pgovProfileV2(id), null, 2));
784
+ });
785
+ parent
786
+ .command("p2pgov-list-v2")
787
+ .description("List profiles")
788
+ .action(async () => {
789
+ console.log(JSON.stringify((await L()).listP2pgovProfilesV2(), null, 2));
790
+ });
791
+ parent
792
+ .command("p2pgov-create-gossip-v2 <id> <profileId>")
793
+ .description("Create gossip")
794
+ .option("--topic <v>", "topic")
795
+ .action(async (id, profileId, o) => {
796
+ const m = await L();
797
+ console.log(
798
+ JSON.stringify(
799
+ m.createP2pgovGossipV2({ id, profileId, topic: o.topic }),
800
+ null,
801
+ 2,
802
+ ),
803
+ );
804
+ });
805
+ parent
806
+ .command("p2pgov-broadcasting-gossip-v2 <id>")
807
+ .description("Mark gossip as broadcasting")
808
+ .action(async (id) => {
809
+ console.log(
810
+ JSON.stringify((await L()).broadcastingP2pgovGossipV2(id), null, 2),
811
+ );
812
+ });
813
+ parent
814
+ .command("p2pgov-complete-gossip-v2 <id>")
815
+ .description("Complete gossip")
816
+ .action(async (id) => {
817
+ console.log(
818
+ JSON.stringify((await L()).completeGossipP2pgovV2(id), null, 2),
819
+ );
820
+ });
821
+ parent
822
+ .command("p2pgov-fail-gossip-v2 <id> [reason]")
823
+ .description("Fail gossip")
824
+ .action(async (id, reason) => {
825
+ console.log(
826
+ JSON.stringify((await L()).failP2pgovGossipV2(id, reason), null, 2),
827
+ );
828
+ });
829
+ parent
830
+ .command("p2pgov-cancel-gossip-v2 <id> [reason]")
831
+ .description("Cancel gossip")
832
+ .action(async (id, reason) => {
833
+ console.log(
834
+ JSON.stringify((await L()).cancelP2pgovGossipV2(id, reason), null, 2),
835
+ );
836
+ });
837
+ parent
838
+ .command("p2pgov-get-gossip-v2 <id>")
839
+ .description("Get gossip")
840
+ .action(async (id) => {
841
+ console.log(JSON.stringify((await L()).getP2pgovGossipV2(id), null, 2));
842
+ });
843
+ parent
844
+ .command("p2pgov-list-gossips-v2")
845
+ .description("List gossips")
846
+ .action(async () => {
847
+ console.log(JSON.stringify((await L()).listP2pgovGossipsV2(), null, 2));
848
+ });
849
+ parent
850
+ .command("p2pgov-auto-suspend-idle-v2")
851
+ .description("Auto-suspend idle")
852
+ .action(async () => {
853
+ console.log(
854
+ JSON.stringify((await L()).autoSuspendIdleP2pgovProfilesV2(), null, 2),
855
+ );
856
+ });
857
+ parent
858
+ .command("p2pgov-auto-fail-stuck-v2")
859
+ .description("Auto-fail stuck gossips")
860
+ .action(async () => {
861
+ console.log(
862
+ JSON.stringify((await L()).autoFailStuckP2pgovGossipsV2(), null, 2),
863
+ );
864
+ });
865
+ parent
866
+ .command("p2pgov-gov-stats-v2")
867
+ .description("V2 gov stats")
868
+ .action(async () => {
869
+ console.log(
870
+ JSON.stringify((await L()).getP2pManagerGovStatsV2(), null, 2),
871
+ );
872
+ });
873
+ }
@@ -673,3 +673,212 @@ export function registerPerceptionCommand(program) {
673
673
 
674
674
  program.addCommand(perc);
675
675
  }
676
+
677
+ // === Iter18 V2 governance overlay ===
678
+ export function registerPercgovV2Commands(program) {
679
+ const parent = program.commands.find((c) => c.name() === "perception");
680
+ if (!parent) return;
681
+ const L = async () => await import("../lib/perception.js");
682
+ parent
683
+ .command("percgov-enums-v2")
684
+ .description("Show V2 enums")
685
+ .action(async () => {
686
+ const m = await L();
687
+ console.log(
688
+ JSON.stringify(
689
+ {
690
+ profileMaturity: m.PERCGOV_PROFILE_MATURITY_V2,
691
+ signalLifecycle: m.PERCGOV_SIGNAL_LIFECYCLE_V2,
692
+ },
693
+ null,
694
+ 2,
695
+ ),
696
+ );
697
+ });
698
+ parent
699
+ .command("percgov-config-v2")
700
+ .description("Show V2 config")
701
+ .action(async () => {
702
+ const m = await L();
703
+ console.log(
704
+ JSON.stringify(
705
+ {
706
+ maxActive: m.getMaxActivePercgovProfilesPerOwnerV2(),
707
+ maxPending: m.getMaxPendingPercgovSignalsPerProfileV2(),
708
+ idleMs: m.getPercgovProfileIdleMsV2(),
709
+ stuckMs: m.getPercgovSignalStuckMsV2(),
710
+ },
711
+ null,
712
+ 2,
713
+ ),
714
+ );
715
+ });
716
+ parent
717
+ .command("percgov-set-max-active-v2 <n>")
718
+ .description("Set max active")
719
+ .action(async (n) => {
720
+ (await L()).setMaxActivePercgovProfilesPerOwnerV2(Number(n));
721
+ console.log("ok");
722
+ });
723
+ parent
724
+ .command("percgov-set-max-pending-v2 <n>")
725
+ .description("Set max pending")
726
+ .action(async (n) => {
727
+ (await L()).setMaxPendingPercgovSignalsPerProfileV2(Number(n));
728
+ console.log("ok");
729
+ });
730
+ parent
731
+ .command("percgov-set-idle-ms-v2 <n>")
732
+ .description("Set idle threshold ms")
733
+ .action(async (n) => {
734
+ (await L()).setPercgovProfileIdleMsV2(Number(n));
735
+ console.log("ok");
736
+ });
737
+ parent
738
+ .command("percgov-set-stuck-ms-v2 <n>")
739
+ .description("Set stuck threshold ms")
740
+ .action(async (n) => {
741
+ (await L()).setPercgovSignalStuckMsV2(Number(n));
742
+ console.log("ok");
743
+ });
744
+ parent
745
+ .command("percgov-register-v2 <id> <owner>")
746
+ .description("Register V2 profile")
747
+ .option("--modality <v>", "modality")
748
+ .action(async (id, owner, o) => {
749
+ const m = await L();
750
+ console.log(
751
+ JSON.stringify(
752
+ m.registerPercgovProfileV2({ id, owner, modality: o.modality }),
753
+ null,
754
+ 2,
755
+ ),
756
+ );
757
+ });
758
+ parent
759
+ .command("percgov-activate-v2 <id>")
760
+ .description("Activate profile")
761
+ .action(async (id) => {
762
+ console.log(
763
+ JSON.stringify((await L()).activatePercgovProfileV2(id), null, 2),
764
+ );
765
+ });
766
+ parent
767
+ .command("percgov-stale-v2 <id>")
768
+ .description("Stale profile")
769
+ .action(async (id) => {
770
+ console.log(
771
+ JSON.stringify((await L()).stalePercgovProfileV2(id), null, 2),
772
+ );
773
+ });
774
+ parent
775
+ .command("percgov-archive-v2 <id>")
776
+ .description("Archive profile")
777
+ .action(async (id) => {
778
+ console.log(
779
+ JSON.stringify((await L()).archivePercgovProfileV2(id), null, 2),
780
+ );
781
+ });
782
+ parent
783
+ .command("percgov-touch-v2 <id>")
784
+ .description("Touch profile")
785
+ .action(async (id) => {
786
+ console.log(
787
+ JSON.stringify((await L()).touchPercgovProfileV2(id), null, 2),
788
+ );
789
+ });
790
+ parent
791
+ .command("percgov-get-v2 <id>")
792
+ .description("Get profile")
793
+ .action(async (id) => {
794
+ console.log(JSON.stringify((await L()).getPercgovProfileV2(id), null, 2));
795
+ });
796
+ parent
797
+ .command("percgov-list-v2")
798
+ .description("List profiles")
799
+ .action(async () => {
800
+ console.log(JSON.stringify((await L()).listPercgovProfilesV2(), null, 2));
801
+ });
802
+ parent
803
+ .command("percgov-create-signal-v2 <id> <profileId>")
804
+ .description("Create signal")
805
+ .option("--source <v>", "source")
806
+ .action(async (id, profileId, o) => {
807
+ const m = await L();
808
+ console.log(
809
+ JSON.stringify(
810
+ m.createPercgovSignalV2({ id, profileId, source: o.source }),
811
+ null,
812
+ 2,
813
+ ),
814
+ );
815
+ });
816
+ parent
817
+ .command("percgov-analyzing-signal-v2 <id>")
818
+ .description("Mark signal as analyzing")
819
+ .action(async (id) => {
820
+ console.log(
821
+ JSON.stringify((await L()).analyzingPercgovSignalV2(id), null, 2),
822
+ );
823
+ });
824
+ parent
825
+ .command("percgov-complete-signal-v2 <id>")
826
+ .description("Complete signal")
827
+ .action(async (id) => {
828
+ console.log(
829
+ JSON.stringify((await L()).completeSignalPercgovV2(id), null, 2),
830
+ );
831
+ });
832
+ parent
833
+ .command("percgov-fail-signal-v2 <id> [reason]")
834
+ .description("Fail signal")
835
+ .action(async (id, reason) => {
836
+ console.log(
837
+ JSON.stringify((await L()).failPercgovSignalV2(id, reason), null, 2),
838
+ );
839
+ });
840
+ parent
841
+ .command("percgov-cancel-signal-v2 <id> [reason]")
842
+ .description("Cancel signal")
843
+ .action(async (id, reason) => {
844
+ console.log(
845
+ JSON.stringify((await L()).cancelPercgovSignalV2(id, reason), null, 2),
846
+ );
847
+ });
848
+ parent
849
+ .command("percgov-get-signal-v2 <id>")
850
+ .description("Get signal")
851
+ .action(async (id) => {
852
+ console.log(JSON.stringify((await L()).getPercgovSignalV2(id), null, 2));
853
+ });
854
+ parent
855
+ .command("percgov-list-signals-v2")
856
+ .description("List signals")
857
+ .action(async () => {
858
+ console.log(JSON.stringify((await L()).listPercgovSignalsV2(), null, 2));
859
+ });
860
+ parent
861
+ .command("percgov-auto-stale-idle-v2")
862
+ .description("Auto-stale idle")
863
+ .action(async () => {
864
+ console.log(
865
+ JSON.stringify((await L()).autoStaleIdlePercgovProfilesV2(), null, 2),
866
+ );
867
+ });
868
+ parent
869
+ .command("percgov-auto-fail-stuck-v2")
870
+ .description("Auto-fail stuck signals")
871
+ .action(async () => {
872
+ console.log(
873
+ JSON.stringify((await L()).autoFailStuckPercgovSignalsV2(), null, 2),
874
+ );
875
+ });
876
+ parent
877
+ .command("percgov-gov-stats-v2")
878
+ .description("V2 gov stats")
879
+ .action(async () => {
880
+ console.log(
881
+ JSON.stringify((await L()).getPerceptionGovStatsV2(), null, 2),
882
+ );
883
+ });
884
+ }
@@ -249,3 +249,206 @@ export function registerPermMemCommand(program) {
249
249
  .description("Auto-fail stuck V2 retention jobs")
250
250
  .action(() => out(autoFailStuckJobsV2()));
251
251
  }
252
+
253
+ // === Iter23 V2 governance overlay ===
254
+ export function registerPmgovV2Commands(program) {
255
+ const parent = program.commands.find((c) => c.name() === "permmem");
256
+ if (!parent) return;
257
+ const L = async () => await import("../lib/permanent-memory.js");
258
+ parent
259
+ .command("pmgov-enums-v2")
260
+ .description("Show V2 enums")
261
+ .action(async () => {
262
+ const m = await L();
263
+ console.log(
264
+ JSON.stringify(
265
+ {
266
+ profileMaturity: m.PMGOV_PROFILE_MATURITY_V2,
267
+ pinLifecycle: m.PMGOV_PIN_LIFECYCLE_V2,
268
+ },
269
+ null,
270
+ 2,
271
+ ),
272
+ );
273
+ });
274
+ parent
275
+ .command("pmgov-config-v2")
276
+ .description("Show V2 config")
277
+ .action(async () => {
278
+ const m = await L();
279
+ console.log(
280
+ JSON.stringify(
281
+ {
282
+ maxActive: m.getMaxActivePmgovProfilesPerOwnerV2(),
283
+ maxPending: m.getMaxPendingPmgovPinsPerProfileV2(),
284
+ idleMs: m.getPmgovProfileIdleMsV2(),
285
+ stuckMs: m.getPmgovPinStuckMsV2(),
286
+ },
287
+ null,
288
+ 2,
289
+ ),
290
+ );
291
+ });
292
+ parent
293
+ .command("pmgov-set-max-active-v2 <n>")
294
+ .description("Set max active")
295
+ .action(async (n) => {
296
+ (await L()).setMaxActivePmgovProfilesPerOwnerV2(Number(n));
297
+ console.log("ok");
298
+ });
299
+ parent
300
+ .command("pmgov-set-max-pending-v2 <n>")
301
+ .description("Set max pending")
302
+ .action(async (n) => {
303
+ (await L()).setMaxPendingPmgovPinsPerProfileV2(Number(n));
304
+ console.log("ok");
305
+ });
306
+ parent
307
+ .command("pmgov-set-idle-ms-v2 <n>")
308
+ .description("Set idle threshold ms")
309
+ .action(async (n) => {
310
+ (await L()).setPmgovProfileIdleMsV2(Number(n));
311
+ console.log("ok");
312
+ });
313
+ parent
314
+ .command("pmgov-set-stuck-ms-v2 <n>")
315
+ .description("Set stuck threshold ms")
316
+ .action(async (n) => {
317
+ (await L()).setPmgovPinStuckMsV2(Number(n));
318
+ console.log("ok");
319
+ });
320
+ parent
321
+ .command("pmgov-register-v2 <id> <owner>")
322
+ .description("Register V2 profile")
323
+ .option("--bucket <v>", "bucket")
324
+ .action(async (id, owner, o) => {
325
+ const m = await L();
326
+ console.log(
327
+ JSON.stringify(
328
+ m.registerPmgovProfileV2({ id, owner, bucket: o.bucket }),
329
+ null,
330
+ 2,
331
+ ),
332
+ );
333
+ });
334
+ parent
335
+ .command("pmgov-activate-v2 <id>")
336
+ .description("Activate profile")
337
+ .action(async (id) => {
338
+ console.log(
339
+ JSON.stringify((await L()).activatePmgovProfileV2(id), null, 2),
340
+ );
341
+ });
342
+ parent
343
+ .command("pmgov-dormant-v2 <id>")
344
+ .description("Dormant profile")
345
+ .action(async (id) => {
346
+ console.log(
347
+ JSON.stringify((await L()).dormantPmgovProfileV2(id), null, 2),
348
+ );
349
+ });
350
+ parent
351
+ .command("pmgov-archive-v2 <id>")
352
+ .description("Archive profile")
353
+ .action(async (id) => {
354
+ console.log(
355
+ JSON.stringify((await L()).archivePmgovProfileV2(id), null, 2),
356
+ );
357
+ });
358
+ parent
359
+ .command("pmgov-touch-v2 <id>")
360
+ .description("Touch profile")
361
+ .action(async (id) => {
362
+ console.log(JSON.stringify((await L()).touchPmgovProfileV2(id), null, 2));
363
+ });
364
+ parent
365
+ .command("pmgov-get-v2 <id>")
366
+ .description("Get profile")
367
+ .action(async (id) => {
368
+ console.log(JSON.stringify((await L()).getPmgovProfileV2(id), null, 2));
369
+ });
370
+ parent
371
+ .command("pmgov-list-v2")
372
+ .description("List profiles")
373
+ .action(async () => {
374
+ console.log(JSON.stringify((await L()).listPmgovProfilesV2(), null, 2));
375
+ });
376
+ parent
377
+ .command("pmgov-create-pin-v2 <id> <profileId>")
378
+ .description("Create pin")
379
+ .option("--key <v>", "key")
380
+ .action(async (id, profileId, o) => {
381
+ const m = await L();
382
+ console.log(
383
+ JSON.stringify(
384
+ m.createPmgovPinV2({ id, profileId, key: o.key }),
385
+ null,
386
+ 2,
387
+ ),
388
+ );
389
+ });
390
+ parent
391
+ .command("pmgov-pinning-pin-v2 <id>")
392
+ .description("Mark pin as pinning")
393
+ .action(async (id) => {
394
+ console.log(JSON.stringify((await L()).pinningPmgovPinV2(id), null, 2));
395
+ });
396
+ parent
397
+ .command("pmgov-complete-pin-v2 <id>")
398
+ .description("Complete pin")
399
+ .action(async (id) => {
400
+ console.log(JSON.stringify((await L()).completePinPmgovV2(id), null, 2));
401
+ });
402
+ parent
403
+ .command("pmgov-fail-pin-v2 <id> [reason]")
404
+ .description("Fail pin")
405
+ .action(async (id, reason) => {
406
+ console.log(
407
+ JSON.stringify((await L()).failPmgovPinV2(id, reason), null, 2),
408
+ );
409
+ });
410
+ parent
411
+ .command("pmgov-cancel-pin-v2 <id> [reason]")
412
+ .description("Cancel pin")
413
+ .action(async (id, reason) => {
414
+ console.log(
415
+ JSON.stringify((await L()).cancelPmgovPinV2(id, reason), null, 2),
416
+ );
417
+ });
418
+ parent
419
+ .command("pmgov-get-pin-v2 <id>")
420
+ .description("Get pin")
421
+ .action(async (id) => {
422
+ console.log(JSON.stringify((await L()).getPmgovPinV2(id), null, 2));
423
+ });
424
+ parent
425
+ .command("pmgov-list-pins-v2")
426
+ .description("List pins")
427
+ .action(async () => {
428
+ console.log(JSON.stringify((await L()).listPmgovPinsV2(), null, 2));
429
+ });
430
+ parent
431
+ .command("pmgov-auto-dormant-idle-v2")
432
+ .description("Auto-dormant idle")
433
+ .action(async () => {
434
+ console.log(
435
+ JSON.stringify((await L()).autoDormantIdlePmgovProfilesV2(), null, 2),
436
+ );
437
+ });
438
+ parent
439
+ .command("pmgov-auto-fail-stuck-v2")
440
+ .description("Auto-fail stuck pins")
441
+ .action(async () => {
442
+ console.log(
443
+ JSON.stringify((await L()).autoFailStuckPmgovPinsV2(), null, 2),
444
+ );
445
+ });
446
+ parent
447
+ .command("pmgov-gov-stats-v2")
448
+ .description("V2 gov stats")
449
+ .action(async () => {
450
+ console.log(
451
+ JSON.stringify((await L()).getPermanentMemoryGovStatsV2(), null, 2),
452
+ );
453
+ });
454
+ }