chainlesschain 0.66.0 → 0.132.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 (143) hide show
  1. package/bin/chainlesschain.js +0 -0
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +380 -0
  4. package/src/commands/agent-network.js +254 -1
  5. package/src/commands/audit.js +302 -0
  6. package/src/commands/automation.js +271 -1
  7. package/src/commands/bi.js +348 -0
  8. package/src/commands/codegen.js +224 -0
  9. package/src/commands/collab.js +341 -0
  10. package/src/commands/compliance.js +1035 -0
  11. package/src/commands/cowork.js +221 -0
  12. package/src/commands/crosschain.js +218 -0
  13. package/src/commands/dbevo.js +284 -0
  14. package/src/commands/dev.js +252 -0
  15. package/src/commands/did.js +358 -0
  16. package/src/commands/dlp.js +341 -0
  17. package/src/commands/encrypt.js +341 -0
  18. package/src/commands/evomap.js +394 -0
  19. package/src/commands/export.js +256 -1
  20. package/src/commands/federation.js +283 -0
  21. package/src/commands/fusion.js +258 -0
  22. package/src/commands/governance.js +325 -0
  23. package/src/commands/hardening.js +411 -0
  24. package/src/commands/hook.js +148 -0
  25. package/src/commands/import.js +252 -0
  26. package/src/commands/incentive.js +322 -0
  27. package/src/commands/inference.js +318 -0
  28. package/src/commands/infra.js +244 -0
  29. package/src/commands/instinct.js +260 -0
  30. package/src/commands/ipfs.js +318 -0
  31. package/src/commands/kg.js +387 -0
  32. package/src/commands/llm.js +263 -0
  33. package/src/commands/lowcode.js +356 -0
  34. package/src/commands/marketplace.js +256 -0
  35. package/src/commands/mcp.js +221 -0
  36. package/src/commands/memory.js +248 -0
  37. package/src/commands/multimodal.js +296 -0
  38. package/src/commands/nlprog.js +356 -0
  39. package/src/commands/note.js +244 -0
  40. package/src/commands/ops.js +354 -0
  41. package/src/commands/orchestrate.js +166 -0
  42. package/src/commands/org.js +277 -0
  43. package/src/commands/p2p.js +390 -0
  44. package/src/commands/perception.js +290 -0
  45. package/src/commands/permmem.js +251 -0
  46. package/src/commands/plugin-ecosystem.js +273 -0
  47. package/src/commands/pqc.js +393 -0
  48. package/src/commands/privacy.js +321 -0
  49. package/src/commands/quantization.js +351 -0
  50. package/src/commands/rcache.js +271 -0
  51. package/src/commands/recommend.js +340 -0
  52. package/src/commands/reputation.js +261 -0
  53. package/src/commands/runtime.js +307 -0
  54. package/src/commands/scim.js +262 -0
  55. package/src/commands/session.js +258 -0
  56. package/src/commands/siem.js +246 -0
  57. package/src/commands/skill.js +267 -1
  58. package/src/commands/sla.js +259 -0
  59. package/src/commands/social.js +256 -0
  60. package/src/commands/sso.js +186 -1
  61. package/src/commands/stress.js +230 -0
  62. package/src/commands/sync.js +256 -0
  63. package/src/commands/tech.js +338 -0
  64. package/src/commands/tenant.js +351 -0
  65. package/src/commands/terraform.js +245 -0
  66. package/src/commands/tokens.js +269 -0
  67. package/src/commands/trust.js +249 -0
  68. package/src/commands/wallet.js +277 -0
  69. package/src/commands/workflow.js +171 -0
  70. package/src/commands/zkp.js +335 -0
  71. package/src/index.js +4 -0
  72. package/src/lib/a2a-protocol.js +451 -0
  73. package/src/lib/agent-coordinator.js +325 -0
  74. package/src/lib/agent-network.js +387 -0
  75. package/src/lib/agent-router.js +395 -0
  76. package/src/lib/aiops.js +478 -0
  77. package/src/lib/app-builder.js +239 -0
  78. package/src/lib/audit-logger.js +379 -0
  79. package/src/lib/automation-engine.js +330 -0
  80. package/src/lib/autonomous-developer.js +350 -0
  81. package/src/lib/bi-engine.js +338 -0
  82. package/src/lib/code-agent.js +323 -0
  83. package/src/lib/collaboration-governance.js +364 -0
  84. package/src/lib/community-governance.js +436 -0
  85. package/src/lib/compliance-manager.js +434 -0
  86. package/src/lib/content-recommendation.js +469 -0
  87. package/src/lib/cross-chain.js +345 -0
  88. package/src/lib/crypto-manager.js +350 -0
  89. package/src/lib/dbevo.js +338 -0
  90. package/src/lib/decentral-infra.js +340 -0
  91. package/src/lib/did-manager.js +367 -0
  92. package/src/lib/dlp-engine.js +389 -0
  93. package/src/lib/evomap-federation.js +177 -0
  94. package/src/lib/evomap-governance.js +276 -0
  95. package/src/lib/federation-hardening.js +259 -0
  96. package/src/lib/hardening-manager.js +348 -0
  97. package/src/lib/hook-manager.js +380 -0
  98. package/src/lib/inference-network.js +330 -0
  99. package/src/lib/instinct-manager.js +332 -0
  100. package/src/lib/ipfs-storage.js +334 -0
  101. package/src/lib/knowledge-exporter.js +381 -0
  102. package/src/lib/knowledge-graph.js +432 -0
  103. package/src/lib/knowledge-importer.js +379 -0
  104. package/src/lib/llm-providers.js +391 -0
  105. package/src/lib/mcp-registry.js +333 -0
  106. package/src/lib/memory-manager.js +330 -0
  107. package/src/lib/multimodal.js +346 -0
  108. package/src/lib/nl-programming.js +343 -0
  109. package/src/lib/note-versioning.js +327 -0
  110. package/src/lib/org-manager.js +323 -0
  111. package/src/lib/p2p-manager.js +387 -0
  112. package/src/lib/perception.js +346 -0
  113. package/src/lib/perf-tuning.js +4 -1
  114. package/src/lib/permanent-memory.js +320 -0
  115. package/src/lib/plugin-ecosystem.js +377 -0
  116. package/src/lib/pqc-manager.js +368 -0
  117. package/src/lib/privacy-computing.js +427 -0
  118. package/src/lib/protocol-fusion.js +417 -0
  119. package/src/lib/quantization.js +325 -0
  120. package/src/lib/reputation-optimizer.js +299 -0
  121. package/src/lib/response-cache.js +327 -0
  122. package/src/lib/scim-manager.js +329 -0
  123. package/src/lib/session-manager.js +329 -0
  124. package/src/lib/siem-exporter.js +333 -0
  125. package/src/lib/skill-loader.js +377 -0
  126. package/src/lib/skill-marketplace.js +325 -0
  127. package/src/lib/sla-manager.js +275 -0
  128. package/src/lib/social-manager.js +326 -0
  129. package/src/lib/sso-manager.js +332 -0
  130. package/src/lib/stress-tester.js +330 -0
  131. package/src/lib/sync-manager.js +326 -0
  132. package/src/lib/tech-learning-engine.js +369 -0
  133. package/src/lib/tenant-saas.js +460 -0
  134. package/src/lib/terraform-manager.js +363 -0
  135. package/src/lib/threat-intel.js +335 -0
  136. package/src/lib/token-incentive.js +293 -0
  137. package/src/lib/token-tracker.js +329 -0
  138. package/src/lib/trust-security.js +390 -0
  139. package/src/lib/ueba.js +389 -0
  140. package/src/lib/universal-runtime.js +325 -0
  141. package/src/lib/wallet-manager.js +326 -0
  142. package/src/lib/workflow-engine.js +322 -0
  143. package/src/lib/zkp-engine.js +274 -0
@@ -554,3 +554,367 @@ export function _resetState() {
554
554
  _agentLevels.clear();
555
555
  _seq = 0;
556
556
  }
557
+
558
+ /* ═══════════════════════════════════════════════════════════════
559
+ * V2 Surface — Collaboration Governance V2 (additive)
560
+ * ═══════════════════════════════════════════════════════════════ */
561
+
562
+ export const AGENT_MATURITY_CG_V2 = Object.freeze({
563
+ PROVISIONAL: "provisional",
564
+ ACTIVE: "active",
565
+ SUSPENDED: "suspended",
566
+ RETIRED: "retired",
567
+ });
568
+
569
+ export const PROPOSAL_LIFECYCLE_V2 = Object.freeze({
570
+ DRAFT: "draft",
571
+ VOTING: "voting",
572
+ APPROVED: "approved",
573
+ REJECTED: "rejected",
574
+ WITHDRAWN: "withdrawn",
575
+ });
576
+
577
+ const _AGENT_TRANS_CG_V2 = new Map([
578
+ [
579
+ AGENT_MATURITY_CG_V2.PROVISIONAL,
580
+ new Set([AGENT_MATURITY_CG_V2.ACTIVE, AGENT_MATURITY_CG_V2.RETIRED]),
581
+ ],
582
+ [
583
+ AGENT_MATURITY_CG_V2.ACTIVE,
584
+ new Set([AGENT_MATURITY_CG_V2.SUSPENDED, AGENT_MATURITY_CG_V2.RETIRED]),
585
+ ],
586
+ [
587
+ AGENT_MATURITY_CG_V2.SUSPENDED,
588
+ new Set([AGENT_MATURITY_CG_V2.ACTIVE, AGENT_MATURITY_CG_V2.RETIRED]),
589
+ ],
590
+ [AGENT_MATURITY_CG_V2.RETIRED, new Set()],
591
+ ]);
592
+
593
+ const _PROPOSAL_TRANS_V2 = new Map([
594
+ [
595
+ PROPOSAL_LIFECYCLE_V2.DRAFT,
596
+ new Set([PROPOSAL_LIFECYCLE_V2.VOTING, PROPOSAL_LIFECYCLE_V2.WITHDRAWN]),
597
+ ],
598
+ [
599
+ PROPOSAL_LIFECYCLE_V2.VOTING,
600
+ new Set([
601
+ PROPOSAL_LIFECYCLE_V2.APPROVED,
602
+ PROPOSAL_LIFECYCLE_V2.REJECTED,
603
+ PROPOSAL_LIFECYCLE_V2.WITHDRAWN,
604
+ ]),
605
+ ],
606
+ [PROPOSAL_LIFECYCLE_V2.APPROVED, new Set()],
607
+ [PROPOSAL_LIFECYCLE_V2.REJECTED, new Set()],
608
+ [PROPOSAL_LIFECYCLE_V2.WITHDRAWN, new Set()],
609
+ ]);
610
+
611
+ const _AGENT_TERMINAL_CG_V2 = new Set([AGENT_MATURITY_CG_V2.RETIRED]);
612
+ const _PROPOSAL_TERMINAL_V2 = new Set([
613
+ PROPOSAL_LIFECYCLE_V2.APPROVED,
614
+ PROPOSAL_LIFECYCLE_V2.REJECTED,
615
+ PROPOSAL_LIFECYCLE_V2.WITHDRAWN,
616
+ ]);
617
+
618
+ export const CG_DEFAULT_MAX_ACTIVE_AGENTS_PER_REALM = 10;
619
+ export const CG_DEFAULT_MAX_VOTING_PROPOSALS_PER_PROPOSER = 3;
620
+ export const CG_DEFAULT_AGENT_IDLE_MS = 30 * 24 * 60 * 60 * 1000;
621
+ export const CG_DEFAULT_PROPOSAL_STUCK_MS = 7 * 24 * 60 * 60 * 1000;
622
+
623
+ let _cgMaxActiveAgents = CG_DEFAULT_MAX_ACTIVE_AGENTS_PER_REALM;
624
+ let _cgMaxVotingProposals = CG_DEFAULT_MAX_VOTING_PROPOSALS_PER_PROPOSER;
625
+ let _cgAgentIdleMs = CG_DEFAULT_AGENT_IDLE_MS;
626
+ let _cgProposalStuckMs = CG_DEFAULT_PROPOSAL_STUCK_MS;
627
+
628
+ const _agentsCgV2 = new Map();
629
+ const _proposalsV2 = new Map();
630
+
631
+ function _posIntCgV2(n, label) {
632
+ const v = Number.isInteger(n) ? n : Math.floor(n);
633
+ if (!Number.isFinite(v) || v <= 0)
634
+ throw new Error(`${label} must be a positive integer`);
635
+ return v;
636
+ }
637
+
638
+ export function getMaxActiveAgentsPerRealmCgV2() {
639
+ return _cgMaxActiveAgents;
640
+ }
641
+ export function setMaxActiveAgentsPerRealmCgV2(n) {
642
+ _cgMaxActiveAgents = _posIntCgV2(n, "maxActiveAgentsPerRealm");
643
+ return _cgMaxActiveAgents;
644
+ }
645
+ export function getMaxVotingProposalsPerProposerV2() {
646
+ return _cgMaxVotingProposals;
647
+ }
648
+ export function setMaxVotingProposalsPerProposerV2(n) {
649
+ _cgMaxVotingProposals = _posIntCgV2(n, "maxVotingProposalsPerProposer");
650
+ return _cgMaxVotingProposals;
651
+ }
652
+ export function getAgentIdleMsCgV2() {
653
+ return _cgAgentIdleMs;
654
+ }
655
+ export function setAgentIdleMsCgV2(n) {
656
+ _cgAgentIdleMs = _posIntCgV2(n, "agentIdleMs");
657
+ return _cgAgentIdleMs;
658
+ }
659
+ export function getProposalStuckMsV2() {
660
+ return _cgProposalStuckMs;
661
+ }
662
+ export function setProposalStuckMsV2(n) {
663
+ _cgProposalStuckMs = _posIntCgV2(n, "proposalStuckMs");
664
+ return _cgProposalStuckMs;
665
+ }
666
+
667
+ export function getActiveAgentCountCgV2(realm) {
668
+ if (!realm) throw new Error("realm is required");
669
+ let c = 0;
670
+ for (const a of _agentsCgV2.values()) {
671
+ if (a.realm !== realm) continue;
672
+ if (a.status === AGENT_MATURITY_CG_V2.RETIRED) continue;
673
+ if (a.status === AGENT_MATURITY_CG_V2.PROVISIONAL) continue;
674
+ c++;
675
+ }
676
+ return c;
677
+ }
678
+
679
+ export function getVotingProposalCountV2(proposer) {
680
+ if (!proposer) throw new Error("proposer is required");
681
+ let c = 0;
682
+ for (const p of _proposalsV2.values()) {
683
+ if (p.proposer !== proposer) continue;
684
+ if (p.status !== PROPOSAL_LIFECYCLE_V2.VOTING) continue;
685
+ c++;
686
+ }
687
+ return c;
688
+ }
689
+
690
+ export function registerAgentCgV2({ id, realm, role, metadata }) {
691
+ if (!id) throw new Error("id is required");
692
+ if (!realm) throw new Error("realm is required");
693
+ if (!role) throw new Error("role is required");
694
+ if (_agentsCgV2.has(id)) throw new Error(`agent ${id} already exists`);
695
+ const now = Date.now();
696
+ const agent = {
697
+ id,
698
+ realm,
699
+ role: String(role),
700
+ status: AGENT_MATURITY_CG_V2.PROVISIONAL,
701
+ createdAt: now,
702
+ updatedAt: now,
703
+ activatedAt: null,
704
+ lastSeenAt: now,
705
+ metadata: metadata ? { ...metadata } : {},
706
+ };
707
+ _agentsCgV2.set(id, agent);
708
+ return { ...agent, metadata: { ...agent.metadata } };
709
+ }
710
+
711
+ export function getAgentCgV2(id) {
712
+ const a = _agentsCgV2.get(id);
713
+ if (!a) return null;
714
+ return { ...a, metadata: { ...a.metadata } };
715
+ }
716
+
717
+ export function listAgentsCgV2({ realm, status } = {}) {
718
+ const out = [];
719
+ for (const a of _agentsCgV2.values()) {
720
+ if (realm && a.realm !== realm) continue;
721
+ if (status && a.status !== status) continue;
722
+ out.push({ ...a, metadata: { ...a.metadata } });
723
+ }
724
+ return out;
725
+ }
726
+
727
+ export function setAgentMaturityCgV2(
728
+ id,
729
+ nextStatus,
730
+ { reason, metadata } = {},
731
+ ) {
732
+ const a = _agentsCgV2.get(id);
733
+ if (!a) throw new Error(`agent ${id} not found`);
734
+ if (!_AGENT_TRANS_CG_V2.has(a.status))
735
+ throw new Error(`unknown status ${a.status}`);
736
+ const allowed = _AGENT_TRANS_CG_V2.get(a.status);
737
+ if (!allowed.has(nextStatus)) {
738
+ throw new Error(
739
+ `cannot transition agent ${id} from ${a.status} to ${nextStatus}`,
740
+ );
741
+ }
742
+ if (nextStatus === AGENT_MATURITY_CG_V2.ACTIVE) {
743
+ const wasActive =
744
+ a.status === AGENT_MATURITY_CG_V2.ACTIVE ||
745
+ a.status === AGENT_MATURITY_CG_V2.SUSPENDED;
746
+ if (!wasActive && getActiveAgentCountCgV2(a.realm) >= _cgMaxActiveAgents) {
747
+ throw new Error(
748
+ `realm ${a.realm} exceeds max active agent cap ${_cgMaxActiveAgents}`,
749
+ );
750
+ }
751
+ }
752
+ const now = Date.now();
753
+ a.status = nextStatus;
754
+ a.updatedAt = now;
755
+ a.lastSeenAt = now;
756
+ if (nextStatus === AGENT_MATURITY_CG_V2.ACTIVE && !a.activatedAt)
757
+ a.activatedAt = now;
758
+ if (reason) a.reason = reason;
759
+ if (metadata) a.metadata = { ...a.metadata, ...metadata };
760
+ return { ...a, metadata: { ...a.metadata } };
761
+ }
762
+
763
+ export function activateAgentCgV2(id, opts) {
764
+ return setAgentMaturityCgV2(id, AGENT_MATURITY_CG_V2.ACTIVE, opts);
765
+ }
766
+ export function suspendAgentCgV2(id, opts) {
767
+ return setAgentMaturityCgV2(id, AGENT_MATURITY_CG_V2.SUSPENDED, opts);
768
+ }
769
+ export function retireAgentCgV2(id, opts) {
770
+ return setAgentMaturityCgV2(id, AGENT_MATURITY_CG_V2.RETIRED, opts);
771
+ }
772
+
773
+ export function touchAgentCgV2(id) {
774
+ const a = _agentsCgV2.get(id);
775
+ if (!a) throw new Error(`agent ${id} not found`);
776
+ if (_AGENT_TERMINAL_CG_V2.has(a.status))
777
+ throw new Error(`agent ${id} is terminal`);
778
+ a.lastSeenAt = Date.now();
779
+ return { ...a, metadata: { ...a.metadata } };
780
+ }
781
+
782
+ export function createProposalV2({ id, proposer, topic, metadata }) {
783
+ if (!id) throw new Error("id is required");
784
+ if (!proposer) throw new Error("proposer is required");
785
+ if (!topic) throw new Error("topic is required");
786
+ if (_proposalsV2.has(id)) throw new Error(`proposal ${id} already exists`);
787
+ const now = Date.now();
788
+ const prop = {
789
+ id,
790
+ proposer,
791
+ topic: String(topic),
792
+ status: PROPOSAL_LIFECYCLE_V2.DRAFT,
793
+ createdAt: now,
794
+ updatedAt: now,
795
+ votingStartedAt: null,
796
+ decidedAt: null,
797
+ metadata: metadata ? { ...metadata } : {},
798
+ };
799
+ _proposalsV2.set(id, prop);
800
+ return { ...prop, metadata: { ...prop.metadata } };
801
+ }
802
+
803
+ export function getProposalV2(id) {
804
+ const p = _proposalsV2.get(id);
805
+ if (!p) return null;
806
+ return { ...p, metadata: { ...p.metadata } };
807
+ }
808
+
809
+ export function listProposalsV2({ proposer, status } = {}) {
810
+ const out = [];
811
+ for (const p of _proposalsV2.values()) {
812
+ if (proposer && p.proposer !== proposer) continue;
813
+ if (status && p.status !== status) continue;
814
+ out.push({ ...p, metadata: { ...p.metadata } });
815
+ }
816
+ return out;
817
+ }
818
+
819
+ export function setProposalStatusV2(id, nextStatus, { reason, metadata } = {}) {
820
+ const p = _proposalsV2.get(id);
821
+ if (!p) throw new Error(`proposal ${id} not found`);
822
+ if (!_PROPOSAL_TRANS_V2.has(p.status))
823
+ throw new Error(`unknown status ${p.status}`);
824
+ const allowed = _PROPOSAL_TRANS_V2.get(p.status);
825
+ if (!allowed.has(nextStatus)) {
826
+ throw new Error(
827
+ `cannot transition proposal ${id} from ${p.status} to ${nextStatus}`,
828
+ );
829
+ }
830
+ if (nextStatus === PROPOSAL_LIFECYCLE_V2.VOTING) {
831
+ if (getVotingProposalCountV2(p.proposer) >= _cgMaxVotingProposals) {
832
+ throw new Error(
833
+ `proposer ${p.proposer} exceeds max voting proposal cap ${_cgMaxVotingProposals}`,
834
+ );
835
+ }
836
+ }
837
+ const now = Date.now();
838
+ p.status = nextStatus;
839
+ p.updatedAt = now;
840
+ if (nextStatus === PROPOSAL_LIFECYCLE_V2.VOTING && !p.votingStartedAt)
841
+ p.votingStartedAt = now;
842
+ if (_PROPOSAL_TERMINAL_V2.has(nextStatus)) p.decidedAt = now;
843
+ if (reason) p.reason = reason;
844
+ if (metadata) p.metadata = { ...p.metadata, ...metadata };
845
+ return { ...p, metadata: { ...p.metadata } };
846
+ }
847
+
848
+ export function startVotingV2(id, opts) {
849
+ return setProposalStatusV2(id, PROPOSAL_LIFECYCLE_V2.VOTING, opts);
850
+ }
851
+ export function approveProposalV2(id, opts) {
852
+ return setProposalStatusV2(id, PROPOSAL_LIFECYCLE_V2.APPROVED, opts);
853
+ }
854
+ export function rejectProposalV2(id, opts) {
855
+ return setProposalStatusV2(id, PROPOSAL_LIFECYCLE_V2.REJECTED, opts);
856
+ }
857
+ export function withdrawProposalV2(id, opts) {
858
+ return setProposalStatusV2(id, PROPOSAL_LIFECYCLE_V2.WITHDRAWN, opts);
859
+ }
860
+
861
+ export function autoRetireIdleAgentsCgV2({ now } = {}) {
862
+ const t = now ?? Date.now();
863
+ const out = [];
864
+ for (const a of _agentsCgV2.values()) {
865
+ if (a.status === AGENT_MATURITY_CG_V2.RETIRED) continue;
866
+ if (a.status === AGENT_MATURITY_CG_V2.PROVISIONAL) continue;
867
+ if (t - a.lastSeenAt > _cgAgentIdleMs) {
868
+ a.status = AGENT_MATURITY_CG_V2.RETIRED;
869
+ a.updatedAt = t;
870
+ out.push(a.id);
871
+ }
872
+ }
873
+ return out;
874
+ }
875
+
876
+ export function autoWithdrawStuckProposalsV2({ now } = {}) {
877
+ const t = now ?? Date.now();
878
+ const out = [];
879
+ for (const p of _proposalsV2.values()) {
880
+ if (p.status !== PROPOSAL_LIFECYCLE_V2.VOTING) continue;
881
+ if (p.votingStartedAt == null) continue;
882
+ if (t - p.votingStartedAt > _cgProposalStuckMs) {
883
+ p.status = PROPOSAL_LIFECYCLE_V2.WITHDRAWN;
884
+ p.decidedAt = t;
885
+ p.updatedAt = t;
886
+ p.reason = p.reason || "auto-withdraw: stuck voting";
887
+ out.push(p.id);
888
+ }
889
+ }
890
+ return out;
891
+ }
892
+
893
+ export function getCollaborationGovernanceStatsV2() {
894
+ const agentsByStatus = {};
895
+ for (const v of Object.values(AGENT_MATURITY_CG_V2)) agentsByStatus[v] = 0;
896
+ for (const a of _agentsCgV2.values()) agentsByStatus[a.status]++;
897
+ const proposalsByStatus = {};
898
+ for (const v of Object.values(PROPOSAL_LIFECYCLE_V2))
899
+ proposalsByStatus[v] = 0;
900
+ for (const p of _proposalsV2.values()) proposalsByStatus[p.status]++;
901
+ return {
902
+ totalAgentsCgV2: _agentsCgV2.size,
903
+ totalProposalsV2: _proposalsV2.size,
904
+ maxActiveAgentsPerRealm: _cgMaxActiveAgents,
905
+ maxVotingProposalsPerProposer: _cgMaxVotingProposals,
906
+ agentIdleMs: _cgAgentIdleMs,
907
+ proposalStuckMs: _cgProposalStuckMs,
908
+ agentsByStatus,
909
+ proposalsByStatus,
910
+ };
911
+ }
912
+
913
+ export function _resetStateCgV2() {
914
+ _agentsCgV2.clear();
915
+ _proposalsV2.clear();
916
+ _cgMaxActiveAgents = CG_DEFAULT_MAX_ACTIVE_AGENTS_PER_REALM;
917
+ _cgMaxVotingProposals = CG_DEFAULT_MAX_VOTING_PROPOSALS_PER_PROPOSER;
918
+ _cgAgentIdleMs = CG_DEFAULT_AGENT_IDLE_MS;
919
+ _cgProposalStuckMs = CG_DEFAULT_PROPOSAL_STUCK_MS;
920
+ }