chainlesschain 0.152.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.
- package/README.md +52 -3
- package/package.json +1 -1
- package/src/commands/a2a.js +201 -0
- package/src/commands/agent.js +1250 -0
- package/src/commands/chat.js +605 -0
- package/src/commands/cli-anything.js +426 -0
- package/src/commands/compliance.js +412 -0
- package/src/commands/config.js +213 -0
- package/src/commands/cowork.js +1463 -0
- package/src/commands/crosschain.js +203 -0
- package/src/commands/dao.js +203 -0
- package/src/commands/economy.js +199 -0
- package/src/commands/encrypt.js +201 -0
- package/src/commands/evolution.js +199 -0
- package/src/commands/evomap.js +625 -0
- package/src/commands/hmemory.js +203 -0
- package/src/commands/inference.js +207 -0
- package/src/commands/kg.js +195 -0
- package/src/commands/llm.js +209 -0
- package/src/commands/memory.js +203 -0
- package/src/commands/orchestrate.js +406 -0
- package/src/commands/pipeline.js +199 -0
- package/src/commands/planmode.js +426 -0
- package/src/commands/plugin.js +209 -0
- package/src/commands/services.js +207 -0
- package/src/commands/setup.js +205 -0
- package/src/commands/skill.js +207 -0
- package/src/commands/start.js +209 -0
- package/src/commands/stream.js +213 -0
- package/src/commands/ui.js +225 -0
- package/src/commands/workflow.js +209 -0
- package/src/index.js +112 -0
- package/src/lib/a2a-protocol.js +332 -0
- package/src/lib/agent-coordinator.js +334 -0
- package/src/lib/agent-economy.js +334 -0
- package/src/lib/agent-router.js +333 -0
- package/src/lib/autonomous-agent.js +332 -0
- package/src/lib/chat-core.js +335 -0
- package/src/lib/cli-anything-bridge.js +341 -0
- package/src/lib/cli-context-engineering.js +351 -0
- package/src/lib/compliance-manager.js +334 -0
- package/src/lib/cowork-adapter.js +336 -0
- package/src/lib/cowork-evomap-adapter.js +341 -0
- package/src/lib/cowork-mcp-tools.js +341 -0
- package/src/lib/cowork-observe-html.js +341 -0
- package/src/lib/cowork-observe.js +341 -0
- package/src/lib/cowork-task-templates.js +342 -1
- package/src/lib/cowork-template-marketplace.js +340 -0
- package/src/lib/cross-chain.js +339 -0
- package/src/lib/crypto-manager.js +334 -0
- package/src/lib/dao-governance.js +339 -0
- package/src/lib/downloader.js +334 -0
- package/src/lib/evolution-system.js +334 -0
- package/src/lib/evomap-client.js +342 -0
- package/src/lib/evomap-federation.js +338 -0
- package/src/lib/evomap-manager.js +330 -0
- package/src/lib/execution-backend.js +330 -0
- package/src/lib/hashline.js +338 -0
- package/src/lib/hierarchical-memory.js +334 -0
- package/src/lib/inference-network.js +341 -0
- package/src/lib/interaction-adapter.js +330 -0
- package/src/lib/interactive-planner.js +354 -0
- package/src/lib/knowledge-graph.js +331 -0
- package/src/lib/pipeline-orchestrator.js +332 -0
- package/src/lib/plan-mode.js +336 -0
- package/src/lib/plugin-autodiscovery.js +334 -0
- package/src/lib/process-manager.js +336 -0
- package/src/lib/provider-options.js +346 -0
- package/src/lib/provider-stream.js +348 -0
- package/src/lib/service-manager.js +337 -0
- package/src/lib/session-core-singletons.js +341 -0
- package/src/lib/skill-mcp.js +336 -0
- package/src/lib/stix-parser.js +346 -0
- package/src/lib/sub-agent-context.js +343 -0
- package/src/lib/sub-agent-profiles.js +335 -0
- package/src/lib/sub-agent-registry.js +336 -0
- package/src/lib/todo-manager.js +336 -0
- package/src/lib/web-ui-server.js +348 -0
- package/src/lib/workflow-expr.js +346 -0
- package/src/lib/ws-chat-handler.js +337 -0
|
@@ -518,3 +518,354 @@ export class CLIContextEngineering {
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
+
|
|
522
|
+
// =====================================================================
|
|
523
|
+
// cli-context-engineering V2 governance overlay (iter26)
|
|
524
|
+
// =====================================================================
|
|
525
|
+
export const CTXENGGOV_PROFILE_MATURITY_V2 = Object.freeze({
|
|
526
|
+
PENDING: "pending",
|
|
527
|
+
ACTIVE: "active",
|
|
528
|
+
STALE: "stale",
|
|
529
|
+
ARCHIVED: "archived",
|
|
530
|
+
});
|
|
531
|
+
export const CTXENGGOV_BUILD_LIFECYCLE_V2 = Object.freeze({
|
|
532
|
+
QUEUED: "queued",
|
|
533
|
+
BUILDING: "building",
|
|
534
|
+
BUILT: "built",
|
|
535
|
+
FAILED: "failed",
|
|
536
|
+
CANCELLED: "cancelled",
|
|
537
|
+
});
|
|
538
|
+
const _ctxenggovPTrans = new Map([
|
|
539
|
+
[
|
|
540
|
+
CTXENGGOV_PROFILE_MATURITY_V2.PENDING,
|
|
541
|
+
new Set([
|
|
542
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
543
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
544
|
+
]),
|
|
545
|
+
],
|
|
546
|
+
[
|
|
547
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
548
|
+
new Set([
|
|
549
|
+
CTXENGGOV_PROFILE_MATURITY_V2.STALE,
|
|
550
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
551
|
+
]),
|
|
552
|
+
],
|
|
553
|
+
[
|
|
554
|
+
CTXENGGOV_PROFILE_MATURITY_V2.STALE,
|
|
555
|
+
new Set([
|
|
556
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
557
|
+
CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
558
|
+
]),
|
|
559
|
+
],
|
|
560
|
+
[CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED, new Set()],
|
|
561
|
+
]);
|
|
562
|
+
const _ctxenggovPTerminal = new Set([CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED]);
|
|
563
|
+
const _ctxenggovJTrans = new Map([
|
|
564
|
+
[
|
|
565
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.QUEUED,
|
|
566
|
+
new Set([
|
|
567
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING,
|
|
568
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.CANCELLED,
|
|
569
|
+
]),
|
|
570
|
+
],
|
|
571
|
+
[
|
|
572
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING,
|
|
573
|
+
new Set([
|
|
574
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.BUILT,
|
|
575
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.FAILED,
|
|
576
|
+
CTXENGGOV_BUILD_LIFECYCLE_V2.CANCELLED,
|
|
577
|
+
]),
|
|
578
|
+
],
|
|
579
|
+
[CTXENGGOV_BUILD_LIFECYCLE_V2.BUILT, new Set()],
|
|
580
|
+
[CTXENGGOV_BUILD_LIFECYCLE_V2.FAILED, new Set()],
|
|
581
|
+
[CTXENGGOV_BUILD_LIFECYCLE_V2.CANCELLED, new Set()],
|
|
582
|
+
]);
|
|
583
|
+
const _ctxenggovPsV2 = new Map();
|
|
584
|
+
const _ctxenggovJsV2 = new Map();
|
|
585
|
+
let _ctxenggovMaxActive = 8,
|
|
586
|
+
_ctxenggovMaxPending = 20,
|
|
587
|
+
_ctxenggovIdleMs = 30 * 24 * 60 * 60 * 1000,
|
|
588
|
+
_ctxenggovStuckMs = 60 * 1000;
|
|
589
|
+
function _ctxenggovPos(n, label) {
|
|
590
|
+
const v = Math.floor(Number(n));
|
|
591
|
+
if (!Number.isFinite(v) || v <= 0)
|
|
592
|
+
throw new Error(`${label} must be positive integer`);
|
|
593
|
+
return v;
|
|
594
|
+
}
|
|
595
|
+
function _ctxenggovCheckP(from, to) {
|
|
596
|
+
const a = _ctxenggovPTrans.get(from);
|
|
597
|
+
if (!a || !a.has(to))
|
|
598
|
+
throw new Error(`invalid ctxenggov profile transition ${from} → ${to}`);
|
|
599
|
+
}
|
|
600
|
+
function _ctxenggovCheckJ(from, to) {
|
|
601
|
+
const a = _ctxenggovJTrans.get(from);
|
|
602
|
+
if (!a || !a.has(to))
|
|
603
|
+
throw new Error(`invalid ctxenggov build transition ${from} → ${to}`);
|
|
604
|
+
}
|
|
605
|
+
function _ctxenggovCountActive(owner) {
|
|
606
|
+
let c = 0;
|
|
607
|
+
for (const p of _ctxenggovPsV2.values())
|
|
608
|
+
if (p.owner === owner && p.status === CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE)
|
|
609
|
+
c++;
|
|
610
|
+
return c;
|
|
611
|
+
}
|
|
612
|
+
function _ctxenggovCountPending(profileId) {
|
|
613
|
+
let c = 0;
|
|
614
|
+
for (const j of _ctxenggovJsV2.values())
|
|
615
|
+
if (
|
|
616
|
+
j.profileId === profileId &&
|
|
617
|
+
(j.status === CTXENGGOV_BUILD_LIFECYCLE_V2.QUEUED ||
|
|
618
|
+
j.status === CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING)
|
|
619
|
+
)
|
|
620
|
+
c++;
|
|
621
|
+
return c;
|
|
622
|
+
}
|
|
623
|
+
export function setMaxActiveCtxenggovProfilesPerOwnerV2(n) {
|
|
624
|
+
_ctxenggovMaxActive = _ctxenggovPos(n, "maxActiveCtxenggovProfilesPerOwner");
|
|
625
|
+
}
|
|
626
|
+
export function getMaxActiveCtxenggovProfilesPerOwnerV2() {
|
|
627
|
+
return _ctxenggovMaxActive;
|
|
628
|
+
}
|
|
629
|
+
export function setMaxPendingCtxenggovBuildsPerProfileV2(n) {
|
|
630
|
+
_ctxenggovMaxPending = _ctxenggovPos(
|
|
631
|
+
n,
|
|
632
|
+
"maxPendingCtxenggovBuildsPerProfile",
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
export function getMaxPendingCtxenggovBuildsPerProfileV2() {
|
|
636
|
+
return _ctxenggovMaxPending;
|
|
637
|
+
}
|
|
638
|
+
export function setCtxenggovProfileIdleMsV2(n) {
|
|
639
|
+
_ctxenggovIdleMs = _ctxenggovPos(n, "ctxenggovProfileIdleMs");
|
|
640
|
+
}
|
|
641
|
+
export function getCtxenggovProfileIdleMsV2() {
|
|
642
|
+
return _ctxenggovIdleMs;
|
|
643
|
+
}
|
|
644
|
+
export function setCtxenggovBuildStuckMsV2(n) {
|
|
645
|
+
_ctxenggovStuckMs = _ctxenggovPos(n, "ctxenggovBuildStuckMs");
|
|
646
|
+
}
|
|
647
|
+
export function getCtxenggovBuildStuckMsV2() {
|
|
648
|
+
return _ctxenggovStuckMs;
|
|
649
|
+
}
|
|
650
|
+
export function _resetStateCliContextEngineeringGovV2() {
|
|
651
|
+
_ctxenggovPsV2.clear();
|
|
652
|
+
_ctxenggovJsV2.clear();
|
|
653
|
+
_ctxenggovMaxActive = 8;
|
|
654
|
+
_ctxenggovMaxPending = 20;
|
|
655
|
+
_ctxenggovIdleMs = 30 * 24 * 60 * 60 * 1000;
|
|
656
|
+
_ctxenggovStuckMs = 60 * 1000;
|
|
657
|
+
}
|
|
658
|
+
export function registerCtxenggovProfileV2({
|
|
659
|
+
id,
|
|
660
|
+
owner,
|
|
661
|
+
scope,
|
|
662
|
+
metadata,
|
|
663
|
+
} = {}) {
|
|
664
|
+
if (!id || !owner) throw new Error("id and owner required");
|
|
665
|
+
if (_ctxenggovPsV2.has(id))
|
|
666
|
+
throw new Error(`ctxenggov profile ${id} already exists`);
|
|
667
|
+
const now = Date.now();
|
|
668
|
+
const p = {
|
|
669
|
+
id,
|
|
670
|
+
owner,
|
|
671
|
+
scope: scope || "session",
|
|
672
|
+
status: CTXENGGOV_PROFILE_MATURITY_V2.PENDING,
|
|
673
|
+
createdAt: now,
|
|
674
|
+
updatedAt: now,
|
|
675
|
+
lastTouchedAt: now,
|
|
676
|
+
activatedAt: null,
|
|
677
|
+
archivedAt: null,
|
|
678
|
+
metadata: { ...(metadata || {}) },
|
|
679
|
+
};
|
|
680
|
+
_ctxenggovPsV2.set(id, p);
|
|
681
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
682
|
+
}
|
|
683
|
+
export function activateCtxenggovProfileV2(id) {
|
|
684
|
+
const p = _ctxenggovPsV2.get(id);
|
|
685
|
+
if (!p) throw new Error(`ctxenggov profile ${id} not found`);
|
|
686
|
+
const isInitial = p.status === CTXENGGOV_PROFILE_MATURITY_V2.PENDING;
|
|
687
|
+
_ctxenggovCheckP(p.status, CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE);
|
|
688
|
+
if (isInitial && _ctxenggovCountActive(p.owner) >= _ctxenggovMaxActive)
|
|
689
|
+
throw new Error(
|
|
690
|
+
`max active ctxenggov profiles for owner ${p.owner} reached`,
|
|
691
|
+
);
|
|
692
|
+
const now = Date.now();
|
|
693
|
+
p.status = CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE;
|
|
694
|
+
p.updatedAt = now;
|
|
695
|
+
p.lastTouchedAt = now;
|
|
696
|
+
if (!p.activatedAt) p.activatedAt = now;
|
|
697
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
698
|
+
}
|
|
699
|
+
export function staleCtxenggovProfileV2(id) {
|
|
700
|
+
const p = _ctxenggovPsV2.get(id);
|
|
701
|
+
if (!p) throw new Error(`ctxenggov profile ${id} not found`);
|
|
702
|
+
_ctxenggovCheckP(p.status, CTXENGGOV_PROFILE_MATURITY_V2.STALE);
|
|
703
|
+
p.status = CTXENGGOV_PROFILE_MATURITY_V2.STALE;
|
|
704
|
+
p.updatedAt = Date.now();
|
|
705
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
706
|
+
}
|
|
707
|
+
export function archiveCtxenggovProfileV2(id) {
|
|
708
|
+
const p = _ctxenggovPsV2.get(id);
|
|
709
|
+
if (!p) throw new Error(`ctxenggov profile ${id} not found`);
|
|
710
|
+
_ctxenggovCheckP(p.status, CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED);
|
|
711
|
+
const now = Date.now();
|
|
712
|
+
p.status = CTXENGGOV_PROFILE_MATURITY_V2.ARCHIVED;
|
|
713
|
+
p.updatedAt = now;
|
|
714
|
+
if (!p.archivedAt) p.archivedAt = now;
|
|
715
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
716
|
+
}
|
|
717
|
+
export function touchCtxenggovProfileV2(id) {
|
|
718
|
+
const p = _ctxenggovPsV2.get(id);
|
|
719
|
+
if (!p) throw new Error(`ctxenggov profile ${id} not found`);
|
|
720
|
+
if (_ctxenggovPTerminal.has(p.status))
|
|
721
|
+
throw new Error(`cannot touch terminal ctxenggov profile ${id}`);
|
|
722
|
+
const now = Date.now();
|
|
723
|
+
p.lastTouchedAt = now;
|
|
724
|
+
p.updatedAt = now;
|
|
725
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
726
|
+
}
|
|
727
|
+
export function getCtxenggovProfileV2(id) {
|
|
728
|
+
const p = _ctxenggovPsV2.get(id);
|
|
729
|
+
if (!p) return null;
|
|
730
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
731
|
+
}
|
|
732
|
+
export function listCtxenggovProfilesV2() {
|
|
733
|
+
return [..._ctxenggovPsV2.values()].map((p) => ({
|
|
734
|
+
...p,
|
|
735
|
+
metadata: { ...p.metadata },
|
|
736
|
+
}));
|
|
737
|
+
}
|
|
738
|
+
export function createCtxenggovBuildV2({
|
|
739
|
+
id,
|
|
740
|
+
profileId,
|
|
741
|
+
prompt,
|
|
742
|
+
metadata,
|
|
743
|
+
} = {}) {
|
|
744
|
+
if (!id || !profileId) throw new Error("id and profileId required");
|
|
745
|
+
if (_ctxenggovJsV2.has(id))
|
|
746
|
+
throw new Error(`ctxenggov build ${id} already exists`);
|
|
747
|
+
if (!_ctxenggovPsV2.has(profileId))
|
|
748
|
+
throw new Error(`ctxenggov profile ${profileId} not found`);
|
|
749
|
+
if (_ctxenggovCountPending(profileId) >= _ctxenggovMaxPending)
|
|
750
|
+
throw new Error(
|
|
751
|
+
`max pending ctxenggov builds for profile ${profileId} reached`,
|
|
752
|
+
);
|
|
753
|
+
const now = Date.now();
|
|
754
|
+
const j = {
|
|
755
|
+
id,
|
|
756
|
+
profileId,
|
|
757
|
+
prompt: prompt || "",
|
|
758
|
+
status: CTXENGGOV_BUILD_LIFECYCLE_V2.QUEUED,
|
|
759
|
+
createdAt: now,
|
|
760
|
+
updatedAt: now,
|
|
761
|
+
startedAt: null,
|
|
762
|
+
settledAt: null,
|
|
763
|
+
metadata: { ...(metadata || {}) },
|
|
764
|
+
};
|
|
765
|
+
_ctxenggovJsV2.set(id, j);
|
|
766
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
767
|
+
}
|
|
768
|
+
export function buildingCtxenggovBuildV2(id) {
|
|
769
|
+
const j = _ctxenggovJsV2.get(id);
|
|
770
|
+
if (!j) throw new Error(`ctxenggov build ${id} not found`);
|
|
771
|
+
_ctxenggovCheckJ(j.status, CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING);
|
|
772
|
+
const now = Date.now();
|
|
773
|
+
j.status = CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING;
|
|
774
|
+
j.updatedAt = now;
|
|
775
|
+
if (!j.startedAt) j.startedAt = now;
|
|
776
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
777
|
+
}
|
|
778
|
+
export function completeBuildCtxenggovV2(id) {
|
|
779
|
+
const j = _ctxenggovJsV2.get(id);
|
|
780
|
+
if (!j) throw new Error(`ctxenggov build ${id} not found`);
|
|
781
|
+
_ctxenggovCheckJ(j.status, CTXENGGOV_BUILD_LIFECYCLE_V2.BUILT);
|
|
782
|
+
const now = Date.now();
|
|
783
|
+
j.status = CTXENGGOV_BUILD_LIFECYCLE_V2.BUILT;
|
|
784
|
+
j.updatedAt = now;
|
|
785
|
+
if (!j.settledAt) j.settledAt = now;
|
|
786
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
787
|
+
}
|
|
788
|
+
export function failCtxenggovBuildV2(id, reason) {
|
|
789
|
+
const j = _ctxenggovJsV2.get(id);
|
|
790
|
+
if (!j) throw new Error(`ctxenggov build ${id} not found`);
|
|
791
|
+
_ctxenggovCheckJ(j.status, CTXENGGOV_BUILD_LIFECYCLE_V2.FAILED);
|
|
792
|
+
const now = Date.now();
|
|
793
|
+
j.status = CTXENGGOV_BUILD_LIFECYCLE_V2.FAILED;
|
|
794
|
+
j.updatedAt = now;
|
|
795
|
+
if (!j.settledAt) j.settledAt = now;
|
|
796
|
+
if (reason) j.metadata.failReason = String(reason);
|
|
797
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
798
|
+
}
|
|
799
|
+
export function cancelCtxenggovBuildV2(id, reason) {
|
|
800
|
+
const j = _ctxenggovJsV2.get(id);
|
|
801
|
+
if (!j) throw new Error(`ctxenggov build ${id} not found`);
|
|
802
|
+
_ctxenggovCheckJ(j.status, CTXENGGOV_BUILD_LIFECYCLE_V2.CANCELLED);
|
|
803
|
+
const now = Date.now();
|
|
804
|
+
j.status = CTXENGGOV_BUILD_LIFECYCLE_V2.CANCELLED;
|
|
805
|
+
j.updatedAt = now;
|
|
806
|
+
if (!j.settledAt) j.settledAt = now;
|
|
807
|
+
if (reason) j.metadata.cancelReason = String(reason);
|
|
808
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
809
|
+
}
|
|
810
|
+
export function getCtxenggovBuildV2(id) {
|
|
811
|
+
const j = _ctxenggovJsV2.get(id);
|
|
812
|
+
if (!j) return null;
|
|
813
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
814
|
+
}
|
|
815
|
+
export function listCtxenggovBuildsV2() {
|
|
816
|
+
return [..._ctxenggovJsV2.values()].map((j) => ({
|
|
817
|
+
...j,
|
|
818
|
+
metadata: { ...j.metadata },
|
|
819
|
+
}));
|
|
820
|
+
}
|
|
821
|
+
export function autoStaleIdleCtxenggovProfilesV2({ now } = {}) {
|
|
822
|
+
const t = now ?? Date.now();
|
|
823
|
+
const flipped = [];
|
|
824
|
+
for (const p of _ctxenggovPsV2.values())
|
|
825
|
+
if (
|
|
826
|
+
p.status === CTXENGGOV_PROFILE_MATURITY_V2.ACTIVE &&
|
|
827
|
+
t - p.lastTouchedAt >= _ctxenggovIdleMs
|
|
828
|
+
) {
|
|
829
|
+
p.status = CTXENGGOV_PROFILE_MATURITY_V2.STALE;
|
|
830
|
+
p.updatedAt = t;
|
|
831
|
+
flipped.push(p.id);
|
|
832
|
+
}
|
|
833
|
+
return { flipped, count: flipped.length };
|
|
834
|
+
}
|
|
835
|
+
export function autoFailStuckCtxenggovBuildsV2({ now } = {}) {
|
|
836
|
+
const t = now ?? Date.now();
|
|
837
|
+
const flipped = [];
|
|
838
|
+
for (const j of _ctxenggovJsV2.values())
|
|
839
|
+
if (
|
|
840
|
+
j.status === CTXENGGOV_BUILD_LIFECYCLE_V2.BUILDING &&
|
|
841
|
+
j.startedAt != null &&
|
|
842
|
+
t - j.startedAt >= _ctxenggovStuckMs
|
|
843
|
+
) {
|
|
844
|
+
j.status = CTXENGGOV_BUILD_LIFECYCLE_V2.FAILED;
|
|
845
|
+
j.updatedAt = t;
|
|
846
|
+
if (!j.settledAt) j.settledAt = t;
|
|
847
|
+
j.metadata.failReason = "auto-fail-stuck";
|
|
848
|
+
flipped.push(j.id);
|
|
849
|
+
}
|
|
850
|
+
return { flipped, count: flipped.length };
|
|
851
|
+
}
|
|
852
|
+
export function getCliContextEngineeringGovStatsV2() {
|
|
853
|
+
const profilesByStatus = {};
|
|
854
|
+
for (const v of Object.values(CTXENGGOV_PROFILE_MATURITY_V2))
|
|
855
|
+
profilesByStatus[v] = 0;
|
|
856
|
+
for (const p of _ctxenggovPsV2.values()) profilesByStatus[p.status]++;
|
|
857
|
+
const buildsByStatus = {};
|
|
858
|
+
for (const v of Object.values(CTXENGGOV_BUILD_LIFECYCLE_V2))
|
|
859
|
+
buildsByStatus[v] = 0;
|
|
860
|
+
for (const j of _ctxenggovJsV2.values()) buildsByStatus[j.status]++;
|
|
861
|
+
return {
|
|
862
|
+
totalCtxenggovProfilesV2: _ctxenggovPsV2.size,
|
|
863
|
+
totalCtxenggovBuildsV2: _ctxenggovJsV2.size,
|
|
864
|
+
maxActiveCtxenggovProfilesPerOwner: _ctxenggovMaxActive,
|
|
865
|
+
maxPendingCtxenggovBuildsPerProfile: _ctxenggovMaxPending,
|
|
866
|
+
ctxenggovProfileIdleMs: _ctxenggovIdleMs,
|
|
867
|
+
ctxenggovBuildStuckMs: _ctxenggovStuckMs,
|
|
868
|
+
profilesByStatus,
|
|
869
|
+
buildsByStatus,
|
|
870
|
+
};
|
|
871
|
+
}
|
|
@@ -1052,3 +1052,337 @@ export function getComplianceManagerGovStatsV2() {
|
|
|
1052
1052
|
auditsByStatus,
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
|
+
|
|
1056
|
+
// === Iter28 V2 governance overlay: Cmpmgov ===
|
|
1057
|
+
export const CMPMGOV_PROFILE_MATURITY_V2 = Object.freeze({
|
|
1058
|
+
PENDING: "pending",
|
|
1059
|
+
ACTIVE: "active",
|
|
1060
|
+
STALE: "stale",
|
|
1061
|
+
ARCHIVED: "archived",
|
|
1062
|
+
});
|
|
1063
|
+
export const CMPMGOV_REPORT_LIFECYCLE_V2 = Object.freeze({
|
|
1064
|
+
QUEUED: "queued",
|
|
1065
|
+
REPORTING: "reporting",
|
|
1066
|
+
REPORTED: "reported",
|
|
1067
|
+
FAILED: "failed",
|
|
1068
|
+
CANCELLED: "cancelled",
|
|
1069
|
+
});
|
|
1070
|
+
const _cmpmgovPTrans = new Map([
|
|
1071
|
+
[
|
|
1072
|
+
CMPMGOV_PROFILE_MATURITY_V2.PENDING,
|
|
1073
|
+
new Set([
|
|
1074
|
+
CMPMGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
1075
|
+
CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
1076
|
+
]),
|
|
1077
|
+
],
|
|
1078
|
+
[
|
|
1079
|
+
CMPMGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
1080
|
+
new Set([
|
|
1081
|
+
CMPMGOV_PROFILE_MATURITY_V2.STALE,
|
|
1082
|
+
CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
1083
|
+
]),
|
|
1084
|
+
],
|
|
1085
|
+
[
|
|
1086
|
+
CMPMGOV_PROFILE_MATURITY_V2.STALE,
|
|
1087
|
+
new Set([
|
|
1088
|
+
CMPMGOV_PROFILE_MATURITY_V2.ACTIVE,
|
|
1089
|
+
CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED,
|
|
1090
|
+
]),
|
|
1091
|
+
],
|
|
1092
|
+
[CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED, new Set()],
|
|
1093
|
+
]);
|
|
1094
|
+
const _cmpmgovPTerminal = new Set([CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED]);
|
|
1095
|
+
const _cmpmgovJTrans = new Map([
|
|
1096
|
+
[
|
|
1097
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.QUEUED,
|
|
1098
|
+
new Set([
|
|
1099
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING,
|
|
1100
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.CANCELLED,
|
|
1101
|
+
]),
|
|
1102
|
+
],
|
|
1103
|
+
[
|
|
1104
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING,
|
|
1105
|
+
new Set([
|
|
1106
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.REPORTED,
|
|
1107
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.FAILED,
|
|
1108
|
+
CMPMGOV_REPORT_LIFECYCLE_V2.CANCELLED,
|
|
1109
|
+
]),
|
|
1110
|
+
],
|
|
1111
|
+
[CMPMGOV_REPORT_LIFECYCLE_V2.REPORTED, new Set()],
|
|
1112
|
+
[CMPMGOV_REPORT_LIFECYCLE_V2.FAILED, new Set()],
|
|
1113
|
+
[CMPMGOV_REPORT_LIFECYCLE_V2.CANCELLED, new Set()],
|
|
1114
|
+
]);
|
|
1115
|
+
const _cmpmgovPsV2 = new Map();
|
|
1116
|
+
const _cmpmgovJsV2 = new Map();
|
|
1117
|
+
let _cmpmgovMaxActive = 6,
|
|
1118
|
+
_cmpmgovMaxPending = 15,
|
|
1119
|
+
_cmpmgovIdleMs = 2592000000,
|
|
1120
|
+
_cmpmgovStuckMs = 60 * 1000;
|
|
1121
|
+
function _cmpmgovPos(n, label) {
|
|
1122
|
+
const v = Math.floor(Number(n));
|
|
1123
|
+
if (!Number.isFinite(v) || v <= 0)
|
|
1124
|
+
throw new Error(`${label} must be positive integer`);
|
|
1125
|
+
return v;
|
|
1126
|
+
}
|
|
1127
|
+
function _cmpmgovCheckP(from, to) {
|
|
1128
|
+
const a = _cmpmgovPTrans.get(from);
|
|
1129
|
+
if (!a || !a.has(to))
|
|
1130
|
+
throw new Error(`invalid cmpmgov profile transition ${from} → ${to}`);
|
|
1131
|
+
}
|
|
1132
|
+
function _cmpmgovCheckJ(from, to) {
|
|
1133
|
+
const a = _cmpmgovJTrans.get(from);
|
|
1134
|
+
if (!a || !a.has(to))
|
|
1135
|
+
throw new Error(`invalid cmpmgov report transition ${from} → ${to}`);
|
|
1136
|
+
}
|
|
1137
|
+
function _cmpmgovCountActive(owner) {
|
|
1138
|
+
let c = 0;
|
|
1139
|
+
for (const p of _cmpmgovPsV2.values())
|
|
1140
|
+
if (p.owner === owner && p.status === CMPMGOV_PROFILE_MATURITY_V2.ACTIVE)
|
|
1141
|
+
c++;
|
|
1142
|
+
return c;
|
|
1143
|
+
}
|
|
1144
|
+
function _cmpmgovCountPending(profileId) {
|
|
1145
|
+
let c = 0;
|
|
1146
|
+
for (const j of _cmpmgovJsV2.values())
|
|
1147
|
+
if (
|
|
1148
|
+
j.profileId === profileId &&
|
|
1149
|
+
(j.status === CMPMGOV_REPORT_LIFECYCLE_V2.QUEUED ||
|
|
1150
|
+
j.status === CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING)
|
|
1151
|
+
)
|
|
1152
|
+
c++;
|
|
1153
|
+
return c;
|
|
1154
|
+
}
|
|
1155
|
+
export function setMaxActiveCmpmProfilesPerOwnerV2(n) {
|
|
1156
|
+
_cmpmgovMaxActive = _cmpmgovPos(n, "maxActiveCmpmProfilesPerOwner");
|
|
1157
|
+
}
|
|
1158
|
+
export function getMaxActiveCmpmProfilesPerOwnerV2() {
|
|
1159
|
+
return _cmpmgovMaxActive;
|
|
1160
|
+
}
|
|
1161
|
+
export function setMaxPendingCmpmReportsPerProfileV2(n) {
|
|
1162
|
+
_cmpmgovMaxPending = _cmpmgovPos(n, "maxPendingCmpmReportsPerProfile");
|
|
1163
|
+
}
|
|
1164
|
+
export function getMaxPendingCmpmReportsPerProfileV2() {
|
|
1165
|
+
return _cmpmgovMaxPending;
|
|
1166
|
+
}
|
|
1167
|
+
export function setCmpmProfileIdleMsV2(n) {
|
|
1168
|
+
_cmpmgovIdleMs = _cmpmgovPos(n, "cmpmgovProfileIdleMs");
|
|
1169
|
+
}
|
|
1170
|
+
export function getCmpmProfileIdleMsV2() {
|
|
1171
|
+
return _cmpmgovIdleMs;
|
|
1172
|
+
}
|
|
1173
|
+
export function setCmpmReportStuckMsV2(n) {
|
|
1174
|
+
_cmpmgovStuckMs = _cmpmgovPos(n, "cmpmgovReportStuckMs");
|
|
1175
|
+
}
|
|
1176
|
+
export function getCmpmReportStuckMsV2() {
|
|
1177
|
+
return _cmpmgovStuckMs;
|
|
1178
|
+
}
|
|
1179
|
+
export function _resetStateCmpmgovV2() {
|
|
1180
|
+
_cmpmgovPsV2.clear();
|
|
1181
|
+
_cmpmgovJsV2.clear();
|
|
1182
|
+
_cmpmgovMaxActive = 6;
|
|
1183
|
+
_cmpmgovMaxPending = 15;
|
|
1184
|
+
_cmpmgovIdleMs = 2592000000;
|
|
1185
|
+
_cmpmgovStuckMs = 60 * 1000;
|
|
1186
|
+
}
|
|
1187
|
+
export function registerCmpmProfileV2({ id, owner, framework, metadata } = {}) {
|
|
1188
|
+
if (!id || !owner) throw new Error("id and owner required");
|
|
1189
|
+
if (_cmpmgovPsV2.has(id))
|
|
1190
|
+
throw new Error(`cmpmgov profile ${id} already exists`);
|
|
1191
|
+
const now = Date.now();
|
|
1192
|
+
const p = {
|
|
1193
|
+
id,
|
|
1194
|
+
owner,
|
|
1195
|
+
framework: framework || "soc2",
|
|
1196
|
+
status: CMPMGOV_PROFILE_MATURITY_V2.PENDING,
|
|
1197
|
+
createdAt: now,
|
|
1198
|
+
updatedAt: now,
|
|
1199
|
+
lastTouchedAt: now,
|
|
1200
|
+
activatedAt: null,
|
|
1201
|
+
archivedAt: null,
|
|
1202
|
+
metadata: { ...(metadata || {}) },
|
|
1203
|
+
};
|
|
1204
|
+
_cmpmgovPsV2.set(id, p);
|
|
1205
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1206
|
+
}
|
|
1207
|
+
export function activateCmpmProfileV2(id) {
|
|
1208
|
+
const p = _cmpmgovPsV2.get(id);
|
|
1209
|
+
if (!p) throw new Error(`cmpmgov profile ${id} not found`);
|
|
1210
|
+
const isInitial = p.status === CMPMGOV_PROFILE_MATURITY_V2.PENDING;
|
|
1211
|
+
_cmpmgovCheckP(p.status, CMPMGOV_PROFILE_MATURITY_V2.ACTIVE);
|
|
1212
|
+
if (isInitial && _cmpmgovCountActive(p.owner) >= _cmpmgovMaxActive)
|
|
1213
|
+
throw new Error(`max active cmpmgov profiles for owner ${p.owner} reached`);
|
|
1214
|
+
const now = Date.now();
|
|
1215
|
+
p.status = CMPMGOV_PROFILE_MATURITY_V2.ACTIVE;
|
|
1216
|
+
p.updatedAt = now;
|
|
1217
|
+
p.lastTouchedAt = now;
|
|
1218
|
+
if (!p.activatedAt) p.activatedAt = now;
|
|
1219
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1220
|
+
}
|
|
1221
|
+
export function staleCmpmProfileV2(id) {
|
|
1222
|
+
const p = _cmpmgovPsV2.get(id);
|
|
1223
|
+
if (!p) throw new Error(`cmpmgov profile ${id} not found`);
|
|
1224
|
+
_cmpmgovCheckP(p.status, CMPMGOV_PROFILE_MATURITY_V2.STALE);
|
|
1225
|
+
p.status = CMPMGOV_PROFILE_MATURITY_V2.STALE;
|
|
1226
|
+
p.updatedAt = Date.now();
|
|
1227
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1228
|
+
}
|
|
1229
|
+
export function archiveCmpmProfileV2(id) {
|
|
1230
|
+
const p = _cmpmgovPsV2.get(id);
|
|
1231
|
+
if (!p) throw new Error(`cmpmgov profile ${id} not found`);
|
|
1232
|
+
_cmpmgovCheckP(p.status, CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED);
|
|
1233
|
+
const now = Date.now();
|
|
1234
|
+
p.status = CMPMGOV_PROFILE_MATURITY_V2.ARCHIVED;
|
|
1235
|
+
p.updatedAt = now;
|
|
1236
|
+
if (!p.archivedAt) p.archivedAt = now;
|
|
1237
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1238
|
+
}
|
|
1239
|
+
export function touchCmpmProfileV2(id) {
|
|
1240
|
+
const p = _cmpmgovPsV2.get(id);
|
|
1241
|
+
if (!p) throw new Error(`cmpmgov profile ${id} not found`);
|
|
1242
|
+
if (_cmpmgovPTerminal.has(p.status))
|
|
1243
|
+
throw new Error(`cannot touch terminal cmpmgov profile ${id}`);
|
|
1244
|
+
const now = Date.now();
|
|
1245
|
+
p.lastTouchedAt = now;
|
|
1246
|
+
p.updatedAt = now;
|
|
1247
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1248
|
+
}
|
|
1249
|
+
export function getCmpmProfileV2(id) {
|
|
1250
|
+
const p = _cmpmgovPsV2.get(id);
|
|
1251
|
+
if (!p) return null;
|
|
1252
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
1253
|
+
}
|
|
1254
|
+
export function listCmpmProfilesV2() {
|
|
1255
|
+
return [..._cmpmgovPsV2.values()].map((p) => ({
|
|
1256
|
+
...p,
|
|
1257
|
+
metadata: { ...p.metadata },
|
|
1258
|
+
}));
|
|
1259
|
+
}
|
|
1260
|
+
export function createCmpmReportV2({ id, profileId, reportId, metadata } = {}) {
|
|
1261
|
+
if (!id || !profileId) throw new Error("id and profileId required");
|
|
1262
|
+
if (_cmpmgovJsV2.has(id))
|
|
1263
|
+
throw new Error(`cmpmgov report ${id} already exists`);
|
|
1264
|
+
if (!_cmpmgovPsV2.has(profileId))
|
|
1265
|
+
throw new Error(`cmpmgov profile ${profileId} not found`);
|
|
1266
|
+
if (_cmpmgovCountPending(profileId) >= _cmpmgovMaxPending)
|
|
1267
|
+
throw new Error(
|
|
1268
|
+
`max pending cmpmgov reports for profile ${profileId} reached`,
|
|
1269
|
+
);
|
|
1270
|
+
const now = Date.now();
|
|
1271
|
+
const j = {
|
|
1272
|
+
id,
|
|
1273
|
+
profileId,
|
|
1274
|
+
reportId: reportId || "",
|
|
1275
|
+
status: CMPMGOV_REPORT_LIFECYCLE_V2.QUEUED,
|
|
1276
|
+
createdAt: now,
|
|
1277
|
+
updatedAt: now,
|
|
1278
|
+
startedAt: null,
|
|
1279
|
+
settledAt: null,
|
|
1280
|
+
metadata: { ...(metadata || {}) },
|
|
1281
|
+
};
|
|
1282
|
+
_cmpmgovJsV2.set(id, j);
|
|
1283
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1284
|
+
}
|
|
1285
|
+
export function reportingCmpmReportV2(id) {
|
|
1286
|
+
const j = _cmpmgovJsV2.get(id);
|
|
1287
|
+
if (!j) throw new Error(`cmpmgov report ${id} not found`);
|
|
1288
|
+
_cmpmgovCheckJ(j.status, CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING);
|
|
1289
|
+
const now = Date.now();
|
|
1290
|
+
j.status = CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING;
|
|
1291
|
+
j.updatedAt = now;
|
|
1292
|
+
if (!j.startedAt) j.startedAt = now;
|
|
1293
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1294
|
+
}
|
|
1295
|
+
export function completeReportCmpmV2(id) {
|
|
1296
|
+
const j = _cmpmgovJsV2.get(id);
|
|
1297
|
+
if (!j) throw new Error(`cmpmgov report ${id} not found`);
|
|
1298
|
+
_cmpmgovCheckJ(j.status, CMPMGOV_REPORT_LIFECYCLE_V2.REPORTED);
|
|
1299
|
+
const now = Date.now();
|
|
1300
|
+
j.status = CMPMGOV_REPORT_LIFECYCLE_V2.REPORTED;
|
|
1301
|
+
j.updatedAt = now;
|
|
1302
|
+
if (!j.settledAt) j.settledAt = now;
|
|
1303
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1304
|
+
}
|
|
1305
|
+
export function failCmpmReportV2(id, reason) {
|
|
1306
|
+
const j = _cmpmgovJsV2.get(id);
|
|
1307
|
+
if (!j) throw new Error(`cmpmgov report ${id} not found`);
|
|
1308
|
+
_cmpmgovCheckJ(j.status, CMPMGOV_REPORT_LIFECYCLE_V2.FAILED);
|
|
1309
|
+
const now = Date.now();
|
|
1310
|
+
j.status = CMPMGOV_REPORT_LIFECYCLE_V2.FAILED;
|
|
1311
|
+
j.updatedAt = now;
|
|
1312
|
+
if (!j.settledAt) j.settledAt = now;
|
|
1313
|
+
if (reason) j.metadata.failReason = String(reason);
|
|
1314
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1315
|
+
}
|
|
1316
|
+
export function cancelCmpmReportV2(id, reason) {
|
|
1317
|
+
const j = _cmpmgovJsV2.get(id);
|
|
1318
|
+
if (!j) throw new Error(`cmpmgov report ${id} not found`);
|
|
1319
|
+
_cmpmgovCheckJ(j.status, CMPMGOV_REPORT_LIFECYCLE_V2.CANCELLED);
|
|
1320
|
+
const now = Date.now();
|
|
1321
|
+
j.status = CMPMGOV_REPORT_LIFECYCLE_V2.CANCELLED;
|
|
1322
|
+
j.updatedAt = now;
|
|
1323
|
+
if (!j.settledAt) j.settledAt = now;
|
|
1324
|
+
if (reason) j.metadata.cancelReason = String(reason);
|
|
1325
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1326
|
+
}
|
|
1327
|
+
export function getCmpmReportV2(id) {
|
|
1328
|
+
const j = _cmpmgovJsV2.get(id);
|
|
1329
|
+
if (!j) return null;
|
|
1330
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
1331
|
+
}
|
|
1332
|
+
export function listCmpmReportsV2() {
|
|
1333
|
+
return [..._cmpmgovJsV2.values()].map((j) => ({
|
|
1334
|
+
...j,
|
|
1335
|
+
metadata: { ...j.metadata },
|
|
1336
|
+
}));
|
|
1337
|
+
}
|
|
1338
|
+
export function autoStaleIdleCmpmProfilesV2({ now } = {}) {
|
|
1339
|
+
const t = now ?? Date.now();
|
|
1340
|
+
const flipped = [];
|
|
1341
|
+
for (const p of _cmpmgovPsV2.values())
|
|
1342
|
+
if (
|
|
1343
|
+
p.status === CMPMGOV_PROFILE_MATURITY_V2.ACTIVE &&
|
|
1344
|
+
t - p.lastTouchedAt >= _cmpmgovIdleMs
|
|
1345
|
+
) {
|
|
1346
|
+
p.status = CMPMGOV_PROFILE_MATURITY_V2.STALE;
|
|
1347
|
+
p.updatedAt = t;
|
|
1348
|
+
flipped.push(p.id);
|
|
1349
|
+
}
|
|
1350
|
+
return { flipped, count: flipped.length };
|
|
1351
|
+
}
|
|
1352
|
+
export function autoFailStuckCmpmReportsV2({ now } = {}) {
|
|
1353
|
+
const t = now ?? Date.now();
|
|
1354
|
+
const flipped = [];
|
|
1355
|
+
for (const j of _cmpmgovJsV2.values())
|
|
1356
|
+
if (
|
|
1357
|
+
j.status === CMPMGOV_REPORT_LIFECYCLE_V2.REPORTING &&
|
|
1358
|
+
j.startedAt != null &&
|
|
1359
|
+
t - j.startedAt >= _cmpmgovStuckMs
|
|
1360
|
+
) {
|
|
1361
|
+
j.status = CMPMGOV_REPORT_LIFECYCLE_V2.FAILED;
|
|
1362
|
+
j.updatedAt = t;
|
|
1363
|
+
if (!j.settledAt) j.settledAt = t;
|
|
1364
|
+
j.metadata.failReason = "auto-fail-stuck";
|
|
1365
|
+
flipped.push(j.id);
|
|
1366
|
+
}
|
|
1367
|
+
return { flipped, count: flipped.length };
|
|
1368
|
+
}
|
|
1369
|
+
export function getCmpmgovStatsV2() {
|
|
1370
|
+
const profilesByStatus = {};
|
|
1371
|
+
for (const v of Object.values(CMPMGOV_PROFILE_MATURITY_V2))
|
|
1372
|
+
profilesByStatus[v] = 0;
|
|
1373
|
+
for (const p of _cmpmgovPsV2.values()) profilesByStatus[p.status]++;
|
|
1374
|
+
const reportsByStatus = {};
|
|
1375
|
+
for (const v of Object.values(CMPMGOV_REPORT_LIFECYCLE_V2))
|
|
1376
|
+
reportsByStatus[v] = 0;
|
|
1377
|
+
for (const j of _cmpmgovJsV2.values()) reportsByStatus[j.status]++;
|
|
1378
|
+
return {
|
|
1379
|
+
totalCmpmProfilesV2: _cmpmgovPsV2.size,
|
|
1380
|
+
totalCmpmReportsV2: _cmpmgovJsV2.size,
|
|
1381
|
+
maxActiveCmpmProfilesPerOwner: _cmpmgovMaxActive,
|
|
1382
|
+
maxPendingCmpmReportsPerProfile: _cmpmgovMaxPending,
|
|
1383
|
+
cmpmgovProfileIdleMs: _cmpmgovIdleMs,
|
|
1384
|
+
cmpmgovReportStuckMs: _cmpmgovStuckMs,
|
|
1385
|
+
profilesByStatus,
|
|
1386
|
+
reportsByStatus,
|
|
1387
|
+
};
|
|
1388
|
+
}
|