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
@@ -460,3 +460,212 @@ export function registerInstinctCommand(program) {
460
460
  console.log(JSON.stringify(autoDiscardStaleObservationsV2(), null, 2)),
461
461
  );
462
462
  }
463
+
464
+ // === Iter18 V2 governance overlay ===
465
+ export function registerInstgovV2Commands(program) {
466
+ const parent = program.commands.find((c) => c.name() === "instinct");
467
+ if (!parent) return;
468
+ const L = async () => await import("../lib/instinct-manager.js");
469
+ parent
470
+ .command("instgov-enums-v2")
471
+ .description("Show V2 enums")
472
+ .action(async () => {
473
+ const m = await L();
474
+ console.log(
475
+ JSON.stringify(
476
+ {
477
+ profileMaturity: m.INSTGOV_PROFILE_MATURITY_V2,
478
+ triggerLifecycle: m.INSTGOV_TRIGGER_LIFECYCLE_V2,
479
+ },
480
+ null,
481
+ 2,
482
+ ),
483
+ );
484
+ });
485
+ parent
486
+ .command("instgov-config-v2")
487
+ .description("Show V2 config")
488
+ .action(async () => {
489
+ const m = await L();
490
+ console.log(
491
+ JSON.stringify(
492
+ {
493
+ maxActive: m.getMaxActiveInstgovProfilesPerOwnerV2(),
494
+ maxPending: m.getMaxPendingInstgovTriggersPerProfileV2(),
495
+ idleMs: m.getInstgovProfileIdleMsV2(),
496
+ stuckMs: m.getInstgovTriggerStuckMsV2(),
497
+ },
498
+ null,
499
+ 2,
500
+ ),
501
+ );
502
+ });
503
+ parent
504
+ .command("instgov-set-max-active-v2 <n>")
505
+ .description("Set max active")
506
+ .action(async (n) => {
507
+ (await L()).setMaxActiveInstgovProfilesPerOwnerV2(Number(n));
508
+ console.log("ok");
509
+ });
510
+ parent
511
+ .command("instgov-set-max-pending-v2 <n>")
512
+ .description("Set max pending")
513
+ .action(async (n) => {
514
+ (await L()).setMaxPendingInstgovTriggersPerProfileV2(Number(n));
515
+ console.log("ok");
516
+ });
517
+ parent
518
+ .command("instgov-set-idle-ms-v2 <n>")
519
+ .description("Set idle threshold ms")
520
+ .action(async (n) => {
521
+ (await L()).setInstgovProfileIdleMsV2(Number(n));
522
+ console.log("ok");
523
+ });
524
+ parent
525
+ .command("instgov-set-stuck-ms-v2 <n>")
526
+ .description("Set stuck threshold ms")
527
+ .action(async (n) => {
528
+ (await L()).setInstgovTriggerStuckMsV2(Number(n));
529
+ console.log("ok");
530
+ });
531
+ parent
532
+ .command("instgov-register-v2 <id> <owner>")
533
+ .description("Register V2 profile")
534
+ .option("--priority <v>", "priority")
535
+ .action(async (id, owner, o) => {
536
+ const m = await L();
537
+ console.log(
538
+ JSON.stringify(
539
+ m.registerInstgovProfileV2({ id, owner, priority: o.priority }),
540
+ null,
541
+ 2,
542
+ ),
543
+ );
544
+ });
545
+ parent
546
+ .command("instgov-activate-v2 <id>")
547
+ .description("Activate profile")
548
+ .action(async (id) => {
549
+ console.log(
550
+ JSON.stringify((await L()).activateInstgovProfileV2(id), null, 2),
551
+ );
552
+ });
553
+ parent
554
+ .command("instgov-dormant-v2 <id>")
555
+ .description("Dormant profile")
556
+ .action(async (id) => {
557
+ console.log(
558
+ JSON.stringify((await L()).dormantInstgovProfileV2(id), null, 2),
559
+ );
560
+ });
561
+ parent
562
+ .command("instgov-archive-v2 <id>")
563
+ .description("Archive profile")
564
+ .action(async (id) => {
565
+ console.log(
566
+ JSON.stringify((await L()).archiveInstgovProfileV2(id), null, 2),
567
+ );
568
+ });
569
+ parent
570
+ .command("instgov-touch-v2 <id>")
571
+ .description("Touch profile")
572
+ .action(async (id) => {
573
+ console.log(
574
+ JSON.stringify((await L()).touchInstgovProfileV2(id), null, 2),
575
+ );
576
+ });
577
+ parent
578
+ .command("instgov-get-v2 <id>")
579
+ .description("Get profile")
580
+ .action(async (id) => {
581
+ console.log(JSON.stringify((await L()).getInstgovProfileV2(id), null, 2));
582
+ });
583
+ parent
584
+ .command("instgov-list-v2")
585
+ .description("List profiles")
586
+ .action(async () => {
587
+ console.log(JSON.stringify((await L()).listInstgovProfilesV2(), null, 2));
588
+ });
589
+ parent
590
+ .command("instgov-create-trigger-v2 <id> <profileId>")
591
+ .description("Create trigger")
592
+ .option("--pattern <v>", "pattern")
593
+ .action(async (id, profileId, o) => {
594
+ const m = await L();
595
+ console.log(
596
+ JSON.stringify(
597
+ m.createInstgovTriggerV2({ id, profileId, pattern: o.pattern }),
598
+ null,
599
+ 2,
600
+ ),
601
+ );
602
+ });
603
+ parent
604
+ .command("instgov-firing-trigger-v2 <id>")
605
+ .description("Mark trigger as firing")
606
+ .action(async (id) => {
607
+ console.log(
608
+ JSON.stringify((await L()).firingInstgovTriggerV2(id), null, 2),
609
+ );
610
+ });
611
+ parent
612
+ .command("instgov-complete-trigger-v2 <id>")
613
+ .description("Complete trigger")
614
+ .action(async (id) => {
615
+ console.log(
616
+ JSON.stringify((await L()).completeTriggerInstgovV2(id), null, 2),
617
+ );
618
+ });
619
+ parent
620
+ .command("instgov-fail-trigger-v2 <id> [reason]")
621
+ .description("Fail trigger")
622
+ .action(async (id, reason) => {
623
+ console.log(
624
+ JSON.stringify((await L()).failInstgovTriggerV2(id, reason), null, 2),
625
+ );
626
+ });
627
+ parent
628
+ .command("instgov-cancel-trigger-v2 <id> [reason]")
629
+ .description("Cancel trigger")
630
+ .action(async (id, reason) => {
631
+ console.log(
632
+ JSON.stringify((await L()).cancelInstgovTriggerV2(id, reason), null, 2),
633
+ );
634
+ });
635
+ parent
636
+ .command("instgov-get-trigger-v2 <id>")
637
+ .description("Get trigger")
638
+ .action(async (id) => {
639
+ console.log(JSON.stringify((await L()).getInstgovTriggerV2(id), null, 2));
640
+ });
641
+ parent
642
+ .command("instgov-list-triggers-v2")
643
+ .description("List triggers")
644
+ .action(async () => {
645
+ console.log(JSON.stringify((await L()).listInstgovTriggersV2(), null, 2));
646
+ });
647
+ parent
648
+ .command("instgov-auto-dormant-idle-v2")
649
+ .description("Auto-dormant idle")
650
+ .action(async () => {
651
+ console.log(
652
+ JSON.stringify((await L()).autoDormantIdleInstgovProfilesV2(), null, 2),
653
+ );
654
+ });
655
+ parent
656
+ .command("instgov-auto-fail-stuck-v2")
657
+ .description("Auto-fail stuck triggers")
658
+ .action(async () => {
659
+ console.log(
660
+ JSON.stringify((await L()).autoFailStuckInstgovTriggersV2(), null, 2),
661
+ );
662
+ });
663
+ parent
664
+ .command("instgov-gov-stats-v2")
665
+ .description("V2 gov stats")
666
+ .action(async () => {
667
+ console.log(
668
+ JSON.stringify((await L()).getInstinctManagerGovStatsV2(), null, 2),
669
+ );
670
+ });
671
+ }
@@ -708,3 +708,210 @@ export function registerIpfsCommand(program) {
708
708
 
709
709
  program.addCommand(ipfs);
710
710
  }
711
+
712
+ // === Iter20 V2 governance overlay ===
713
+ export function registerIpfsgovV2Commands(program) {
714
+ const parent = program.commands.find((c) => c.name() === "ipfs");
715
+ if (!parent) return;
716
+ const L = async () => await import("../lib/ipfs-storage.js");
717
+ parent
718
+ .command("ipfsgov-enums-v2")
719
+ .description("Show V2 enums")
720
+ .action(async () => {
721
+ const m = await L();
722
+ console.log(
723
+ JSON.stringify(
724
+ {
725
+ profileMaturity: m.IPFSGOV_PROFILE_MATURITY_V2,
726
+ pinLifecycle: m.IPFSGOV_PIN_LIFECYCLE_V2,
727
+ },
728
+ null,
729
+ 2,
730
+ ),
731
+ );
732
+ });
733
+ parent
734
+ .command("ipfsgov-config-v2")
735
+ .description("Show V2 config")
736
+ .action(async () => {
737
+ const m = await L();
738
+ console.log(
739
+ JSON.stringify(
740
+ {
741
+ maxActive: m.getMaxActiveIpfsgovProfilesPerOwnerV2(),
742
+ maxPending: m.getMaxPendingIpfsgovPinsPerProfileV2(),
743
+ idleMs: m.getIpfsgovProfileIdleMsV2(),
744
+ stuckMs: m.getIpfsgovPinStuckMsV2(),
745
+ },
746
+ null,
747
+ 2,
748
+ ),
749
+ );
750
+ });
751
+ parent
752
+ .command("ipfsgov-set-max-active-v2 <n>")
753
+ .description("Set max active")
754
+ .action(async (n) => {
755
+ (await L()).setMaxActiveIpfsgovProfilesPerOwnerV2(Number(n));
756
+ console.log("ok");
757
+ });
758
+ parent
759
+ .command("ipfsgov-set-max-pending-v2 <n>")
760
+ .description("Set max pending")
761
+ .action(async (n) => {
762
+ (await L()).setMaxPendingIpfsgovPinsPerProfileV2(Number(n));
763
+ console.log("ok");
764
+ });
765
+ parent
766
+ .command("ipfsgov-set-idle-ms-v2 <n>")
767
+ .description("Set idle threshold ms")
768
+ .action(async (n) => {
769
+ (await L()).setIpfsgovProfileIdleMsV2(Number(n));
770
+ console.log("ok");
771
+ });
772
+ parent
773
+ .command("ipfsgov-set-stuck-ms-v2 <n>")
774
+ .description("Set stuck threshold ms")
775
+ .action(async (n) => {
776
+ (await L()).setIpfsgovPinStuckMsV2(Number(n));
777
+ console.log("ok");
778
+ });
779
+ parent
780
+ .command("ipfsgov-register-v2 <id> <owner>")
781
+ .description("Register V2 profile")
782
+ .option("--mode <v>", "mode")
783
+ .action(async (id, owner, o) => {
784
+ const m = await L();
785
+ console.log(
786
+ JSON.stringify(
787
+ m.registerIpfsgovProfileV2({ id, owner, mode: o.mode }),
788
+ null,
789
+ 2,
790
+ ),
791
+ );
792
+ });
793
+ parent
794
+ .command("ipfsgov-activate-v2 <id>")
795
+ .description("Activate profile")
796
+ .action(async (id) => {
797
+ console.log(
798
+ JSON.stringify((await L()).activateIpfsgovProfileV2(id), null, 2),
799
+ );
800
+ });
801
+ parent
802
+ .command("ipfsgov-stale-v2 <id>")
803
+ .description("Stale profile")
804
+ .action(async (id) => {
805
+ console.log(
806
+ JSON.stringify((await L()).staleIpfsgovProfileV2(id), null, 2),
807
+ );
808
+ });
809
+ parent
810
+ .command("ipfsgov-archive-v2 <id>")
811
+ .description("Archive profile")
812
+ .action(async (id) => {
813
+ console.log(
814
+ JSON.stringify((await L()).archiveIpfsgovProfileV2(id), null, 2),
815
+ );
816
+ });
817
+ parent
818
+ .command("ipfsgov-touch-v2 <id>")
819
+ .description("Touch profile")
820
+ .action(async (id) => {
821
+ console.log(
822
+ JSON.stringify((await L()).touchIpfsgovProfileV2(id), null, 2),
823
+ );
824
+ });
825
+ parent
826
+ .command("ipfsgov-get-v2 <id>")
827
+ .description("Get profile")
828
+ .action(async (id) => {
829
+ console.log(JSON.stringify((await L()).getIpfsgovProfileV2(id), null, 2));
830
+ });
831
+ parent
832
+ .command("ipfsgov-list-v2")
833
+ .description("List profiles")
834
+ .action(async () => {
835
+ console.log(JSON.stringify((await L()).listIpfsgovProfilesV2(), null, 2));
836
+ });
837
+ parent
838
+ .command("ipfsgov-create-pin-v2 <id> <profileId>")
839
+ .description("Create pin")
840
+ .option("--cid <v>", "cid")
841
+ .action(async (id, profileId, o) => {
842
+ const m = await L();
843
+ console.log(
844
+ JSON.stringify(
845
+ m.createIpfsgovPinV2({ id, profileId, cid: o.cid }),
846
+ null,
847
+ 2,
848
+ ),
849
+ );
850
+ });
851
+ parent
852
+ .command("ipfsgov-pinning-pin-v2 <id>")
853
+ .description("Mark pin as pinning")
854
+ .action(async (id) => {
855
+ console.log(JSON.stringify((await L()).pinningIpfsgovPinV2(id), null, 2));
856
+ });
857
+ parent
858
+ .command("ipfsgov-complete-pin-v2 <id>")
859
+ .description("Complete pin")
860
+ .action(async (id) => {
861
+ console.log(
862
+ JSON.stringify((await L()).completePinIpfsgovV2(id), null, 2),
863
+ );
864
+ });
865
+ parent
866
+ .command("ipfsgov-fail-pin-v2 <id> [reason]")
867
+ .description("Fail pin")
868
+ .action(async (id, reason) => {
869
+ console.log(
870
+ JSON.stringify((await L()).failIpfsgovPinV2(id, reason), null, 2),
871
+ );
872
+ });
873
+ parent
874
+ .command("ipfsgov-cancel-pin-v2 <id> [reason]")
875
+ .description("Cancel pin")
876
+ .action(async (id, reason) => {
877
+ console.log(
878
+ JSON.stringify((await L()).cancelIpfsgovPinV2(id, reason), null, 2),
879
+ );
880
+ });
881
+ parent
882
+ .command("ipfsgov-get-pin-v2 <id>")
883
+ .description("Get pin")
884
+ .action(async (id) => {
885
+ console.log(JSON.stringify((await L()).getIpfsgovPinV2(id), null, 2));
886
+ });
887
+ parent
888
+ .command("ipfsgov-list-pins-v2")
889
+ .description("List pins")
890
+ .action(async () => {
891
+ console.log(JSON.stringify((await L()).listIpfsgovPinsV2(), null, 2));
892
+ });
893
+ parent
894
+ .command("ipfsgov-auto-stale-idle-v2")
895
+ .description("Auto-stale idle")
896
+ .action(async () => {
897
+ console.log(
898
+ JSON.stringify((await L()).autoStaleIdleIpfsgovProfilesV2(), null, 2),
899
+ );
900
+ });
901
+ parent
902
+ .command("ipfsgov-auto-fail-stuck-v2")
903
+ .description("Auto-fail stuck pins")
904
+ .action(async () => {
905
+ console.log(
906
+ JSON.stringify((await L()).autoFailStuckIpfsgovPinsV2(), null, 2),
907
+ );
908
+ });
909
+ parent
910
+ .command("ipfsgov-gov-stats-v2")
911
+ .description("V2 gov stats")
912
+ .action(async () => {
913
+ console.log(
914
+ JSON.stringify((await L()).getIpfsStorageGovStatsV2(), null, 2),
915
+ );
916
+ });
917
+ }
@@ -962,3 +962,198 @@ export function registerKgovV2Commands(program) {
962
962
  console.log(JSON.stringify(m.getKnowledgeGraphGovStatsV2(), null, 2));
963
963
  });
964
964
  }
965
+
966
+ // === Iter28 V2 governance overlay: Kggov ===
967
+ export function registerKgV2Commands(program) {
968
+ const parent = program.commands.find((c) => c.name() === "kg");
969
+ if (!parent) return;
970
+ const L = async () => await import("../lib/knowledge-graph.js");
971
+ parent
972
+ .command("kggov-enums-v2")
973
+ .description("Show V2 enums")
974
+ .action(async () => {
975
+ const m = await L();
976
+ console.log(
977
+ JSON.stringify(
978
+ {
979
+ profileMaturity: m.KGGOV_PROFILE_MATURITY_V2,
980
+ queryLifecycle: m.KGGOV_QUERY_LIFECYCLE_V2,
981
+ },
982
+ null,
983
+ 2,
984
+ ),
985
+ );
986
+ });
987
+ parent
988
+ .command("kggov-config-v2")
989
+ .description("Show V2 config")
990
+ .action(async () => {
991
+ const m = await L();
992
+ console.log(
993
+ JSON.stringify(
994
+ {
995
+ maxActive: m.getMaxActiveKgProfilesPerOwnerV2(),
996
+ maxPending: m.getMaxPendingKgQuerysPerProfileV2(),
997
+ idleMs: m.getKgProfileIdleMsV2(),
998
+ stuckMs: m.getKgQueryStuckMsV2(),
999
+ },
1000
+ null,
1001
+ 2,
1002
+ ),
1003
+ );
1004
+ });
1005
+ parent
1006
+ .command("kggov-set-max-active-v2 <n>")
1007
+ .description("Set max active")
1008
+ .action(async (n) => {
1009
+ (await L()).setMaxActiveKgProfilesPerOwnerV2(Number(n));
1010
+ console.log("ok");
1011
+ });
1012
+ parent
1013
+ .command("kggov-set-max-pending-v2 <n>")
1014
+ .description("Set max pending")
1015
+ .action(async (n) => {
1016
+ (await L()).setMaxPendingKgQuerysPerProfileV2(Number(n));
1017
+ console.log("ok");
1018
+ });
1019
+ parent
1020
+ .command("kggov-set-idle-ms-v2 <n>")
1021
+ .description("Set idle threshold ms")
1022
+ .action(async (n) => {
1023
+ (await L()).setKgProfileIdleMsV2(Number(n));
1024
+ console.log("ok");
1025
+ });
1026
+ parent
1027
+ .command("kggov-set-stuck-ms-v2 <n>")
1028
+ .description("Set stuck threshold ms")
1029
+ .action(async (n) => {
1030
+ (await L()).setKgQueryStuckMsV2(Number(n));
1031
+ console.log("ok");
1032
+ });
1033
+ parent
1034
+ .command("kggov-register-v2 <id> <owner>")
1035
+ .description("Register V2 profile")
1036
+ .option("--kind <v>", "kind")
1037
+ .action(async (id, owner, o) => {
1038
+ const m = await L();
1039
+ console.log(
1040
+ JSON.stringify(
1041
+ m.registerKgProfileV2({ id, owner, kind: o.kind }),
1042
+ null,
1043
+ 2,
1044
+ ),
1045
+ );
1046
+ });
1047
+ parent
1048
+ .command("kggov-activate-v2 <id>")
1049
+ .description("Activate profile")
1050
+ .action(async (id) => {
1051
+ console.log(JSON.stringify((await L()).activateKgProfileV2(id), null, 2));
1052
+ });
1053
+ parent
1054
+ .command("kggov-stale-v2 <id>")
1055
+ .description("Stale profile")
1056
+ .action(async (id) => {
1057
+ console.log(JSON.stringify((await L()).staleKgProfileV2(id), null, 2));
1058
+ });
1059
+ parent
1060
+ .command("kggov-archive-v2 <id>")
1061
+ .description("Archive profile")
1062
+ .action(async (id) => {
1063
+ console.log(JSON.stringify((await L()).archiveKgProfileV2(id), null, 2));
1064
+ });
1065
+ parent
1066
+ .command("kggov-touch-v2 <id>")
1067
+ .description("Touch profile")
1068
+ .action(async (id) => {
1069
+ console.log(JSON.stringify((await L()).touchKgProfileV2(id), null, 2));
1070
+ });
1071
+ parent
1072
+ .command("kggov-get-v2 <id>")
1073
+ .description("Get profile")
1074
+ .action(async (id) => {
1075
+ console.log(JSON.stringify((await L()).getKgProfileV2(id), null, 2));
1076
+ });
1077
+ parent
1078
+ .command("kggov-list-v2")
1079
+ .description("List profiles")
1080
+ .action(async () => {
1081
+ console.log(JSON.stringify((await L()).listKgProfilesV2(), null, 2));
1082
+ });
1083
+ parent
1084
+ .command("kggov-create-query-v2 <id> <profileId>")
1085
+ .description("Create query")
1086
+ .option("--queryId <v>", "queryId")
1087
+ .action(async (id, profileId, o) => {
1088
+ const m = await L();
1089
+ console.log(
1090
+ JSON.stringify(
1091
+ m.createKgQueryV2({ id, profileId, queryId: o.queryId }),
1092
+ null,
1093
+ 2,
1094
+ ),
1095
+ );
1096
+ });
1097
+ parent
1098
+ .command("kggov-querying-query-v2 <id>")
1099
+ .description("Mark query as querying")
1100
+ .action(async (id) => {
1101
+ console.log(JSON.stringify((await L()).queryingKgQueryV2(id), null, 2));
1102
+ });
1103
+ parent
1104
+ .command("kggov-complete-query-v2 <id>")
1105
+ .description("Complete query")
1106
+ .action(async (id) => {
1107
+ console.log(JSON.stringify((await L()).completeQueryKgV2(id), null, 2));
1108
+ });
1109
+ parent
1110
+ .command("kggov-fail-query-v2 <id> [reason]")
1111
+ .description("Fail query")
1112
+ .action(async (id, reason) => {
1113
+ console.log(
1114
+ JSON.stringify((await L()).failKgQueryV2(id, reason), null, 2),
1115
+ );
1116
+ });
1117
+ parent
1118
+ .command("kggov-cancel-query-v2 <id> [reason]")
1119
+ .description("Cancel query")
1120
+ .action(async (id, reason) => {
1121
+ console.log(
1122
+ JSON.stringify((await L()).cancelKgQueryV2(id, reason), null, 2),
1123
+ );
1124
+ });
1125
+ parent
1126
+ .command("kggov-get-query-v2 <id>")
1127
+ .description("Get query")
1128
+ .action(async (id) => {
1129
+ console.log(JSON.stringify((await L()).getKgQueryV2(id), null, 2));
1130
+ });
1131
+ parent
1132
+ .command("kggov-list-querys-v2")
1133
+ .description("List querys")
1134
+ .action(async () => {
1135
+ console.log(JSON.stringify((await L()).listKgQuerysV2(), null, 2));
1136
+ });
1137
+ parent
1138
+ .command("kggov-auto-stale-idle-v2")
1139
+ .description("Auto-stale idle")
1140
+ .action(async () => {
1141
+ console.log(
1142
+ JSON.stringify((await L()).autoStaleIdleKgProfilesV2(), null, 2),
1143
+ );
1144
+ });
1145
+ parent
1146
+ .command("kggov-auto-fail-stuck-v2")
1147
+ .description("Auto-fail stuck querys")
1148
+ .action(async () => {
1149
+ console.log(
1150
+ JSON.stringify((await L()).autoFailStuckKgQuerysV2(), null, 2),
1151
+ );
1152
+ });
1153
+ parent
1154
+ .command("kggov-gov-stats-v2")
1155
+ .description("V2 gov stats")
1156
+ .action(async () => {
1157
+ console.log(JSON.stringify((await L()).getKggovStatsV2(), null, 2));
1158
+ });
1159
+ }