chainlesschain 0.132.0 → 0.145.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/package.json +1 -1
- package/src/commands/a2a.js +230 -0
- package/src/commands/activitypub.js +191 -0
- package/src/commands/agent.js +601 -0
- package/src/commands/audit.js +206 -0
- package/src/commands/bi.js +186 -0
- package/src/commands/bm25.js +162 -0
- package/src/commands/browse.js +225 -0
- package/src/commands/ccron.js +178 -0
- package/src/commands/chat.js +207 -0
- package/src/commands/compliance.js +420 -0
- package/src/commands/compt.js +176 -0
- package/src/commands/consol.js +237 -0
- package/src/commands/cowork.js +588 -0
- package/src/commands/crosschain.js +216 -0
- package/src/commands/dao.js +216 -0
- package/src/commands/dlp.js +206 -0
- package/src/commands/economy.js +211 -0
- package/src/commands/evolution.js +209 -0
- package/src/commands/evomap.js +216 -0
- package/src/commands/fflag.js +230 -0
- package/src/commands/git.js +185 -0
- package/src/commands/hardening.js +209 -0
- package/src/commands/hmemory.js +210 -0
- package/src/commands/incentive.js +209 -0
- package/src/commands/inference.js +178 -0
- package/src/commands/itbudget.js +161 -0
- package/src/commands/kg.js +206 -0
- package/src/commands/lowcode.js +201 -0
- package/src/commands/marketplace.js +206 -0
- package/src/commands/matrix.js +214 -0
- package/src/commands/mcpscaf.js +153 -0
- package/src/commands/meminj.js +153 -0
- package/src/commands/nostr.js +213 -0
- package/src/commands/orchestrate.js +217 -0
- package/src/commands/orchgov.js +156 -0
- package/src/commands/pdfp.js +160 -0
- package/src/commands/perf.js +176 -0
- package/src/commands/perm.js +156 -0
- package/src/commands/pipeline.js +211 -0
- package/src/commands/planmode.js +154 -0
- package/src/commands/privacy.js +203 -0
- package/src/commands/promcomp.js +166 -0
- package/src/commands/recommend.js +185 -0
- package/src/commands/reputation.js +208 -0
- package/src/commands/sandbox.js +206 -0
- package/src/commands/seshhook.js +153 -0
- package/src/commands/seshsearch.js +149 -0
- package/src/commands/seshtail.js +152 -0
- package/src/commands/seshu.js +160 -0
- package/src/commands/sganal.js +172 -0
- package/src/commands/siem.js +207 -0
- package/src/commands/sla.js +212 -0
- package/src/commands/slotfill.js +154 -0
- package/src/commands/social.js +159 -0
- package/src/commands/stress.js +206 -0
- package/src/commands/svccont.js +157 -0
- package/src/commands/terraform.js +206 -0
- package/src/commands/tms.js +183 -0
- package/src/commands/topiccls.js +158 -0
- package/src/commands/uprof.js +154 -0
- package/src/commands/vcheck.js +172 -0
- package/src/commands/webfetch.js +150 -0
- package/src/commands/zkp.js +218 -0
- package/src/harness/prompt-compressor.js +331 -0
- package/src/index.js +101 -1
- package/src/lib/a2a-protocol.js +373 -0
- package/src/lib/activitypub-bridge.js +343 -0
- package/src/lib/agent-economy.js +358 -0
- package/src/lib/app-builder.js +338 -0
- package/src/lib/audit-logger.js +321 -0
- package/src/lib/autonomous-agent.js +341 -0
- package/src/lib/bi-engine.js +339 -0
- package/src/lib/bm25-search.js +333 -0
- package/src/lib/browser-automation.js +352 -0
- package/src/lib/chat-core.js +336 -0
- package/src/lib/claude-code-bridge.js +341 -0
- package/src/lib/compliance-framework-reporter.js +359 -0
- package/src/lib/compliance-manager.js +330 -0
- package/src/lib/compression-telemetry.js +333 -0
- package/src/lib/content-recommender.js +370 -0
- package/src/lib/cowork-cron.js +330 -0
- package/src/lib/cowork-learning.js +333 -0
- package/src/lib/cowork-task-runner.js +362 -0
- package/src/lib/cowork-workflow.js +327 -0
- package/src/lib/cross-chain.js +365 -0
- package/src/lib/dao-governance.js +339 -0
- package/src/lib/dlp-engine.js +343 -0
- package/src/lib/evolution-system.js +336 -0
- package/src/lib/evomap-manager.js +339 -0
- package/src/lib/execution-backend.js +351 -0
- package/src/lib/feature-flags.js +330 -0
- package/src/lib/git-integration.js +343 -0
- package/src/lib/hardening-manager.js +341 -0
- package/src/lib/hierarchical-memory.js +341 -0
- package/src/lib/inference-network.js +362 -0
- package/src/lib/iteration-budget.js +357 -0
- package/src/lib/knowledge-graph.js +333 -0
- package/src/lib/matrix-bridge.js +339 -0
- package/src/lib/mcp-scaffold.js +345 -0
- package/src/lib/memory-injection.js +320 -0
- package/src/lib/nostr-bridge.js +342 -0
- package/src/lib/orchestrator.js +350 -0
- package/src/lib/pdf-parser.js +330 -0
- package/src/lib/perf-tuning.js +364 -0
- package/src/lib/permission-engine.js +319 -0
- package/src/lib/pipeline-orchestrator.js +345 -0
- package/src/lib/plan-mode.js +328 -0
- package/src/lib/privacy-computing.js +335 -0
- package/src/lib/prompt-compressor.js +1 -10
- package/src/lib/reputation-optimizer.js +340 -0
- package/src/lib/sandbox-v2.js +327 -0
- package/src/lib/service-container.js +342 -0
- package/src/lib/session-consolidator.js +352 -0
- package/src/lib/session-hooks.js +340 -0
- package/src/lib/session-search.js +334 -0
- package/src/lib/session-tail.js +320 -0
- package/src/lib/session-usage.js +329 -0
- package/src/lib/siem-exporter.js +352 -0
- package/src/lib/skill-marketplace.js +345 -0
- package/src/lib/sla-manager.js +341 -0
- package/src/lib/slot-filler.js +333 -0
- package/src/lib/social-graph-analytics.js +327 -0
- package/src/lib/social-graph.js +304 -0
- package/src/lib/stress-tester.js +342 -0
- package/src/lib/sub-agent-registry.js +359 -0
- package/src/lib/task-model-selector.js +333 -0
- package/src/lib/terraform-manager.js +333 -0
- package/src/lib/todo-manager.js +339 -0
- package/src/lib/token-incentive.js +341 -0
- package/src/lib/topic-classifier.js +353 -0
- package/src/lib/user-profile.js +325 -0
- package/src/lib/version-checker.js +335 -0
- package/src/lib/web-fetch.js +322 -0
- package/src/lib/zkp-engine.js +342 -0
package/src/lib/orchestrator.js
CHANGED
|
@@ -436,3 +436,353 @@ function _extractChangedFiles(output) {
|
|
|
436
436
|
const matches = output.match(/(?:modified|created|deleted):\s+(\S+)/g) || [];
|
|
437
437
|
return matches.map((m) => m.split(/:\s+/)[1]).filter(Boolean);
|
|
438
438
|
}
|
|
439
|
+
|
|
440
|
+
// ===== V2 Surface: Orchestrator governance overlay (CLI v0.140.0) =====
|
|
441
|
+
export const ORCH_PROFILE_MATURITY_V2 = Object.freeze({
|
|
442
|
+
PENDING: "pending",
|
|
443
|
+
ACTIVE: "active",
|
|
444
|
+
PAUSED: "paused",
|
|
445
|
+
RETIRED: "retired",
|
|
446
|
+
});
|
|
447
|
+
export const ORCH_TASK_LIFECYCLE_V2 = Object.freeze({
|
|
448
|
+
QUEUED: "queued",
|
|
449
|
+
DISPATCHING: "dispatching",
|
|
450
|
+
COMPLETED: "completed",
|
|
451
|
+
FAILED: "failed",
|
|
452
|
+
CANCELLED: "cancelled",
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
const _opTrans = new Map([
|
|
456
|
+
[
|
|
457
|
+
ORCH_PROFILE_MATURITY_V2.PENDING,
|
|
458
|
+
new Set([
|
|
459
|
+
ORCH_PROFILE_MATURITY_V2.ACTIVE,
|
|
460
|
+
ORCH_PROFILE_MATURITY_V2.RETIRED,
|
|
461
|
+
]),
|
|
462
|
+
],
|
|
463
|
+
[
|
|
464
|
+
ORCH_PROFILE_MATURITY_V2.ACTIVE,
|
|
465
|
+
new Set([
|
|
466
|
+
ORCH_PROFILE_MATURITY_V2.PAUSED,
|
|
467
|
+
ORCH_PROFILE_MATURITY_V2.RETIRED,
|
|
468
|
+
]),
|
|
469
|
+
],
|
|
470
|
+
[
|
|
471
|
+
ORCH_PROFILE_MATURITY_V2.PAUSED,
|
|
472
|
+
new Set([
|
|
473
|
+
ORCH_PROFILE_MATURITY_V2.ACTIVE,
|
|
474
|
+
ORCH_PROFILE_MATURITY_V2.RETIRED,
|
|
475
|
+
]),
|
|
476
|
+
],
|
|
477
|
+
[ORCH_PROFILE_MATURITY_V2.RETIRED, new Set()],
|
|
478
|
+
]);
|
|
479
|
+
const _opTerminal = new Set([ORCH_PROFILE_MATURITY_V2.RETIRED]);
|
|
480
|
+
const _otTrans = new Map([
|
|
481
|
+
[
|
|
482
|
+
ORCH_TASK_LIFECYCLE_V2.QUEUED,
|
|
483
|
+
new Set([
|
|
484
|
+
ORCH_TASK_LIFECYCLE_V2.DISPATCHING,
|
|
485
|
+
ORCH_TASK_LIFECYCLE_V2.CANCELLED,
|
|
486
|
+
]),
|
|
487
|
+
],
|
|
488
|
+
[
|
|
489
|
+
ORCH_TASK_LIFECYCLE_V2.DISPATCHING,
|
|
490
|
+
new Set([
|
|
491
|
+
ORCH_TASK_LIFECYCLE_V2.COMPLETED,
|
|
492
|
+
ORCH_TASK_LIFECYCLE_V2.FAILED,
|
|
493
|
+
ORCH_TASK_LIFECYCLE_V2.CANCELLED,
|
|
494
|
+
]),
|
|
495
|
+
],
|
|
496
|
+
[ORCH_TASK_LIFECYCLE_V2.COMPLETED, new Set()],
|
|
497
|
+
[ORCH_TASK_LIFECYCLE_V2.FAILED, new Set()],
|
|
498
|
+
[ORCH_TASK_LIFECYCLE_V2.CANCELLED, new Set()],
|
|
499
|
+
]);
|
|
500
|
+
|
|
501
|
+
const _opsV2 = new Map();
|
|
502
|
+
const _otsV2 = new Map();
|
|
503
|
+
let _opMaxActivePerOwner = 6;
|
|
504
|
+
let _opMaxPendingTasksPerProfile = 12;
|
|
505
|
+
let _opIdleMs = 14 * 24 * 60 * 60 * 1000;
|
|
506
|
+
let _otStuckMs = 15 * 60 * 1000;
|
|
507
|
+
|
|
508
|
+
function _opPos(n, lbl) {
|
|
509
|
+
const v = Math.floor(Number(n));
|
|
510
|
+
if (!Number.isFinite(v) || v <= 0)
|
|
511
|
+
throw new Error(`${lbl} must be positive integer`);
|
|
512
|
+
return v;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export function setMaxActiveOrchProfilesPerOwnerV2(n) {
|
|
516
|
+
_opMaxActivePerOwner = _opPos(n, "maxActiveOrchProfilesPerOwner");
|
|
517
|
+
}
|
|
518
|
+
export function getMaxActiveOrchProfilesPerOwnerV2() {
|
|
519
|
+
return _opMaxActivePerOwner;
|
|
520
|
+
}
|
|
521
|
+
export function setMaxPendingOrchTasksPerProfileV2(n) {
|
|
522
|
+
_opMaxPendingTasksPerProfile = _opPos(n, "maxPendingOrchTasksPerProfile");
|
|
523
|
+
}
|
|
524
|
+
export function getMaxPendingOrchTasksPerProfileV2() {
|
|
525
|
+
return _opMaxPendingTasksPerProfile;
|
|
526
|
+
}
|
|
527
|
+
export function setOrchProfileIdleMsV2(n) {
|
|
528
|
+
_opIdleMs = _opPos(n, "orchProfileIdleMs");
|
|
529
|
+
}
|
|
530
|
+
export function getOrchProfileIdleMsV2() {
|
|
531
|
+
return _opIdleMs;
|
|
532
|
+
}
|
|
533
|
+
export function setOrchTaskStuckMsV2(n) {
|
|
534
|
+
_otStuckMs = _opPos(n, "orchTaskStuckMs");
|
|
535
|
+
}
|
|
536
|
+
export function getOrchTaskStuckMsV2() {
|
|
537
|
+
return _otStuckMs;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export function _resetStateOrchestratorV2() {
|
|
541
|
+
_opsV2.clear();
|
|
542
|
+
_otsV2.clear();
|
|
543
|
+
_opMaxActivePerOwner = 6;
|
|
544
|
+
_opMaxPendingTasksPerProfile = 12;
|
|
545
|
+
_opIdleMs = 14 * 24 * 60 * 60 * 1000;
|
|
546
|
+
_otStuckMs = 15 * 60 * 1000;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export function registerOrchProfileV2({ id, owner, source, metadata } = {}) {
|
|
550
|
+
if (!id || typeof id !== "string") throw new Error("id is required");
|
|
551
|
+
if (!owner || typeof owner !== "string") throw new Error("owner is required");
|
|
552
|
+
if (_opsV2.has(id)) throw new Error(`orch profile ${id} already registered`);
|
|
553
|
+
const now = Date.now();
|
|
554
|
+
const p = {
|
|
555
|
+
id,
|
|
556
|
+
owner,
|
|
557
|
+
source: source || "cli",
|
|
558
|
+
status: ORCH_PROFILE_MATURITY_V2.PENDING,
|
|
559
|
+
createdAt: now,
|
|
560
|
+
updatedAt: now,
|
|
561
|
+
activatedAt: null,
|
|
562
|
+
retiredAt: null,
|
|
563
|
+
lastTouchedAt: now,
|
|
564
|
+
metadata: { ...(metadata || {}) },
|
|
565
|
+
};
|
|
566
|
+
_opsV2.set(id, p);
|
|
567
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
568
|
+
}
|
|
569
|
+
function _opCheckP(from, to) {
|
|
570
|
+
const a = _opTrans.get(from);
|
|
571
|
+
if (!a || !a.has(to))
|
|
572
|
+
throw new Error(`invalid orch profile transition ${from} → ${to}`);
|
|
573
|
+
}
|
|
574
|
+
function _opCountActive(owner) {
|
|
575
|
+
let n = 0;
|
|
576
|
+
for (const p of _opsV2.values())
|
|
577
|
+
if (p.owner === owner && p.status === ORCH_PROFILE_MATURITY_V2.ACTIVE) n++;
|
|
578
|
+
return n;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export function activateOrchProfileV2(id) {
|
|
582
|
+
const p = _opsV2.get(id);
|
|
583
|
+
if (!p) throw new Error(`orch profile ${id} not found`);
|
|
584
|
+
_opCheckP(p.status, ORCH_PROFILE_MATURITY_V2.ACTIVE);
|
|
585
|
+
const recovery = p.status === ORCH_PROFILE_MATURITY_V2.PAUSED;
|
|
586
|
+
if (!recovery) {
|
|
587
|
+
const c = _opCountActive(p.owner);
|
|
588
|
+
if (c >= _opMaxActivePerOwner)
|
|
589
|
+
throw new Error(
|
|
590
|
+
`max active orch profiles per owner (${_opMaxActivePerOwner}) reached for ${p.owner}`,
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
const now = Date.now();
|
|
594
|
+
p.status = ORCH_PROFILE_MATURITY_V2.ACTIVE;
|
|
595
|
+
p.updatedAt = now;
|
|
596
|
+
p.lastTouchedAt = now;
|
|
597
|
+
if (!p.activatedAt) p.activatedAt = now;
|
|
598
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
599
|
+
}
|
|
600
|
+
export function pauseOrchProfileV2(id) {
|
|
601
|
+
const p = _opsV2.get(id);
|
|
602
|
+
if (!p) throw new Error(`orch profile ${id} not found`);
|
|
603
|
+
_opCheckP(p.status, ORCH_PROFILE_MATURITY_V2.PAUSED);
|
|
604
|
+
p.status = ORCH_PROFILE_MATURITY_V2.PAUSED;
|
|
605
|
+
p.updatedAt = Date.now();
|
|
606
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
607
|
+
}
|
|
608
|
+
export function retireOrchProfileV2(id) {
|
|
609
|
+
const p = _opsV2.get(id);
|
|
610
|
+
if (!p) throw new Error(`orch profile ${id} not found`);
|
|
611
|
+
_opCheckP(p.status, ORCH_PROFILE_MATURITY_V2.RETIRED);
|
|
612
|
+
const now = Date.now();
|
|
613
|
+
p.status = ORCH_PROFILE_MATURITY_V2.RETIRED;
|
|
614
|
+
p.updatedAt = now;
|
|
615
|
+
if (!p.retiredAt) p.retiredAt = now;
|
|
616
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
617
|
+
}
|
|
618
|
+
export function touchOrchProfileV2(id) {
|
|
619
|
+
const p = _opsV2.get(id);
|
|
620
|
+
if (!p) throw new Error(`orch profile ${id} not found`);
|
|
621
|
+
if (_opTerminal.has(p.status))
|
|
622
|
+
throw new Error(`cannot touch terminal orch profile ${id}`);
|
|
623
|
+
const now = Date.now();
|
|
624
|
+
p.lastTouchedAt = now;
|
|
625
|
+
p.updatedAt = now;
|
|
626
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
627
|
+
}
|
|
628
|
+
export function getOrchProfileV2(id) {
|
|
629
|
+
const p = _opsV2.get(id);
|
|
630
|
+
if (!p) return null;
|
|
631
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
632
|
+
}
|
|
633
|
+
export function listOrchProfilesV2() {
|
|
634
|
+
return [..._opsV2.values()].map((p) => ({
|
|
635
|
+
...p,
|
|
636
|
+
metadata: { ...p.metadata },
|
|
637
|
+
}));
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function _otCountPending(profileId) {
|
|
641
|
+
let n = 0;
|
|
642
|
+
for (const t of _otsV2.values())
|
|
643
|
+
if (
|
|
644
|
+
t.profileId === profileId &&
|
|
645
|
+
(t.status === ORCH_TASK_LIFECYCLE_V2.QUEUED ||
|
|
646
|
+
t.status === ORCH_TASK_LIFECYCLE_V2.DISPATCHING)
|
|
647
|
+
)
|
|
648
|
+
n++;
|
|
649
|
+
return n;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export function createOrchTaskV2({ id, profileId, prompt, metadata } = {}) {
|
|
653
|
+
if (!id || typeof id !== "string") throw new Error("id is required");
|
|
654
|
+
if (!profileId || typeof profileId !== "string")
|
|
655
|
+
throw new Error("profileId is required");
|
|
656
|
+
if (_otsV2.has(id)) throw new Error(`orch task ${id} already exists`);
|
|
657
|
+
if (!_opsV2.has(profileId))
|
|
658
|
+
throw new Error(`orch profile ${profileId} not found`);
|
|
659
|
+
const pending = _otCountPending(profileId);
|
|
660
|
+
if (pending >= _opMaxPendingTasksPerProfile)
|
|
661
|
+
throw new Error(
|
|
662
|
+
`max pending orch tasks per profile (${_opMaxPendingTasksPerProfile}) reached for ${profileId}`,
|
|
663
|
+
);
|
|
664
|
+
const now = Date.now();
|
|
665
|
+
const t = {
|
|
666
|
+
id,
|
|
667
|
+
profileId,
|
|
668
|
+
prompt: prompt || "",
|
|
669
|
+
status: ORCH_TASK_LIFECYCLE_V2.QUEUED,
|
|
670
|
+
createdAt: now,
|
|
671
|
+
updatedAt: now,
|
|
672
|
+
startedAt: null,
|
|
673
|
+
settledAt: null,
|
|
674
|
+
metadata: { ...(metadata || {}) },
|
|
675
|
+
};
|
|
676
|
+
_otsV2.set(id, t);
|
|
677
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
678
|
+
}
|
|
679
|
+
function _otCheckT(from, to) {
|
|
680
|
+
const a = _otTrans.get(from);
|
|
681
|
+
if (!a || !a.has(to))
|
|
682
|
+
throw new Error(`invalid orch task transition ${from} → ${to}`);
|
|
683
|
+
}
|
|
684
|
+
export function dispatchOrchTaskV2(id) {
|
|
685
|
+
const t = _otsV2.get(id);
|
|
686
|
+
if (!t) throw new Error(`orch task ${id} not found`);
|
|
687
|
+
_otCheckT(t.status, ORCH_TASK_LIFECYCLE_V2.DISPATCHING);
|
|
688
|
+
const now = Date.now();
|
|
689
|
+
t.status = ORCH_TASK_LIFECYCLE_V2.DISPATCHING;
|
|
690
|
+
t.updatedAt = now;
|
|
691
|
+
if (!t.startedAt) t.startedAt = now;
|
|
692
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
693
|
+
}
|
|
694
|
+
export function completeOrchTaskV2(id) {
|
|
695
|
+
const t = _otsV2.get(id);
|
|
696
|
+
if (!t) throw new Error(`orch task ${id} not found`);
|
|
697
|
+
_otCheckT(t.status, ORCH_TASK_LIFECYCLE_V2.COMPLETED);
|
|
698
|
+
const now = Date.now();
|
|
699
|
+
t.status = ORCH_TASK_LIFECYCLE_V2.COMPLETED;
|
|
700
|
+
t.updatedAt = now;
|
|
701
|
+
if (!t.settledAt) t.settledAt = now;
|
|
702
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
703
|
+
}
|
|
704
|
+
export function failOrchTaskV2(id, reason) {
|
|
705
|
+
const t = _otsV2.get(id);
|
|
706
|
+
if (!t) throw new Error(`orch task ${id} not found`);
|
|
707
|
+
_otCheckT(t.status, ORCH_TASK_LIFECYCLE_V2.FAILED);
|
|
708
|
+
const now = Date.now();
|
|
709
|
+
t.status = ORCH_TASK_LIFECYCLE_V2.FAILED;
|
|
710
|
+
t.updatedAt = now;
|
|
711
|
+
if (!t.settledAt) t.settledAt = now;
|
|
712
|
+
if (reason) t.metadata.failReason = String(reason);
|
|
713
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
714
|
+
}
|
|
715
|
+
export function cancelOrchTaskV2(id, reason) {
|
|
716
|
+
const t = _otsV2.get(id);
|
|
717
|
+
if (!t) throw new Error(`orch task ${id} not found`);
|
|
718
|
+
_otCheckT(t.status, ORCH_TASK_LIFECYCLE_V2.CANCELLED);
|
|
719
|
+
const now = Date.now();
|
|
720
|
+
t.status = ORCH_TASK_LIFECYCLE_V2.CANCELLED;
|
|
721
|
+
t.updatedAt = now;
|
|
722
|
+
if (!t.settledAt) t.settledAt = now;
|
|
723
|
+
if (reason) t.metadata.cancelReason = String(reason);
|
|
724
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
725
|
+
}
|
|
726
|
+
export function getOrchTaskV2(id) {
|
|
727
|
+
const t = _otsV2.get(id);
|
|
728
|
+
if (!t) return null;
|
|
729
|
+
return { ...t, metadata: { ...t.metadata } };
|
|
730
|
+
}
|
|
731
|
+
export function listOrchTasksV2() {
|
|
732
|
+
return [..._otsV2.values()].map((t) => ({
|
|
733
|
+
...t,
|
|
734
|
+
metadata: { ...t.metadata },
|
|
735
|
+
}));
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export function autoPauseIdleOrchProfilesV2({ now } = {}) {
|
|
739
|
+
const t = now ?? Date.now();
|
|
740
|
+
const flipped = [];
|
|
741
|
+
for (const p of _opsV2.values())
|
|
742
|
+
if (
|
|
743
|
+
p.status === ORCH_PROFILE_MATURITY_V2.ACTIVE &&
|
|
744
|
+
t - p.lastTouchedAt >= _opIdleMs
|
|
745
|
+
) {
|
|
746
|
+
p.status = ORCH_PROFILE_MATURITY_V2.PAUSED;
|
|
747
|
+
p.updatedAt = t;
|
|
748
|
+
flipped.push(p.id);
|
|
749
|
+
}
|
|
750
|
+
return { flipped, count: flipped.length };
|
|
751
|
+
}
|
|
752
|
+
export function autoFailStuckOrchTasksV2({ now } = {}) {
|
|
753
|
+
const t = now ?? Date.now();
|
|
754
|
+
const flipped = [];
|
|
755
|
+
for (const x of _otsV2.values())
|
|
756
|
+
if (
|
|
757
|
+
x.status === ORCH_TASK_LIFECYCLE_V2.DISPATCHING &&
|
|
758
|
+
x.startedAt != null &&
|
|
759
|
+
t - x.startedAt >= _otStuckMs
|
|
760
|
+
) {
|
|
761
|
+
x.status = ORCH_TASK_LIFECYCLE_V2.FAILED;
|
|
762
|
+
x.updatedAt = t;
|
|
763
|
+
if (!x.settledAt) x.settledAt = t;
|
|
764
|
+
x.metadata.failReason = "auto-fail-stuck";
|
|
765
|
+
flipped.push(x.id);
|
|
766
|
+
}
|
|
767
|
+
return { flipped, count: flipped.length };
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
export function getOrchestratorGovStatsV2() {
|
|
771
|
+
const profilesByStatus = {};
|
|
772
|
+
for (const s of Object.values(ORCH_PROFILE_MATURITY_V2))
|
|
773
|
+
profilesByStatus[s] = 0;
|
|
774
|
+
for (const p of _opsV2.values()) profilesByStatus[p.status]++;
|
|
775
|
+
const tasksByStatus = {};
|
|
776
|
+
for (const s of Object.values(ORCH_TASK_LIFECYCLE_V2)) tasksByStatus[s] = 0;
|
|
777
|
+
for (const t of _otsV2.values()) tasksByStatus[t.status]++;
|
|
778
|
+
return {
|
|
779
|
+
totalOrchProfilesV2: _opsV2.size,
|
|
780
|
+
totalOrchTasksV2: _otsV2.size,
|
|
781
|
+
maxActiveOrchProfilesPerOwner: _opMaxActivePerOwner,
|
|
782
|
+
maxPendingOrchTasksPerProfile: _opMaxPendingTasksPerProfile,
|
|
783
|
+
orchProfileIdleMs: _opIdleMs,
|
|
784
|
+
orchTaskStuckMs: _otStuckMs,
|
|
785
|
+
profilesByStatus,
|
|
786
|
+
tasksByStatus,
|
|
787
|
+
};
|
|
788
|
+
}
|
package/src/lib/pdf-parser.js
CHANGED
|
@@ -94,3 +94,333 @@ function decodePdfString(str) {
|
|
|
94
94
|
.replace(/\\\)/g, ")")
|
|
95
95
|
.replace(/\\\\/g, "\\");
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
// =====================================================================
|
|
99
|
+
// PDF Parser V2 governance overlay
|
|
100
|
+
// =====================================================================
|
|
101
|
+
export const PDFP_PROFILE_MATURITY_V2 = Object.freeze({
|
|
102
|
+
PENDING: "pending",
|
|
103
|
+
ACTIVE: "active",
|
|
104
|
+
STALE: "stale",
|
|
105
|
+
ARCHIVED: "archived",
|
|
106
|
+
});
|
|
107
|
+
export const PDFP_PARSE_LIFECYCLE_V2 = Object.freeze({
|
|
108
|
+
QUEUED: "queued",
|
|
109
|
+
PARSING: "parsing",
|
|
110
|
+
PARSED: "parsed",
|
|
111
|
+
FAILED: "failed",
|
|
112
|
+
CANCELLED: "cancelled",
|
|
113
|
+
});
|
|
114
|
+
const _pdfpPTrans = new Map([
|
|
115
|
+
[
|
|
116
|
+
PDFP_PROFILE_MATURITY_V2.PENDING,
|
|
117
|
+
new Set([
|
|
118
|
+
PDFP_PROFILE_MATURITY_V2.ACTIVE,
|
|
119
|
+
PDFP_PROFILE_MATURITY_V2.ARCHIVED,
|
|
120
|
+
]),
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
PDFP_PROFILE_MATURITY_V2.ACTIVE,
|
|
124
|
+
new Set([
|
|
125
|
+
PDFP_PROFILE_MATURITY_V2.STALE,
|
|
126
|
+
PDFP_PROFILE_MATURITY_V2.ARCHIVED,
|
|
127
|
+
]),
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
PDFP_PROFILE_MATURITY_V2.STALE,
|
|
131
|
+
new Set([
|
|
132
|
+
PDFP_PROFILE_MATURITY_V2.ACTIVE,
|
|
133
|
+
PDFP_PROFILE_MATURITY_V2.ARCHIVED,
|
|
134
|
+
]),
|
|
135
|
+
],
|
|
136
|
+
[PDFP_PROFILE_MATURITY_V2.ARCHIVED, new Set()],
|
|
137
|
+
]);
|
|
138
|
+
const _pdfpPTerminal = new Set([PDFP_PROFILE_MATURITY_V2.ARCHIVED]);
|
|
139
|
+
const _pdfpJTrans = new Map([
|
|
140
|
+
[
|
|
141
|
+
PDFP_PARSE_LIFECYCLE_V2.QUEUED,
|
|
142
|
+
new Set([
|
|
143
|
+
PDFP_PARSE_LIFECYCLE_V2.PARSING,
|
|
144
|
+
PDFP_PARSE_LIFECYCLE_V2.CANCELLED,
|
|
145
|
+
]),
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
PDFP_PARSE_LIFECYCLE_V2.PARSING,
|
|
149
|
+
new Set([
|
|
150
|
+
PDFP_PARSE_LIFECYCLE_V2.PARSED,
|
|
151
|
+
PDFP_PARSE_LIFECYCLE_V2.FAILED,
|
|
152
|
+
PDFP_PARSE_LIFECYCLE_V2.CANCELLED,
|
|
153
|
+
]),
|
|
154
|
+
],
|
|
155
|
+
[PDFP_PARSE_LIFECYCLE_V2.PARSED, new Set()],
|
|
156
|
+
[PDFP_PARSE_LIFECYCLE_V2.FAILED, new Set()],
|
|
157
|
+
[PDFP_PARSE_LIFECYCLE_V2.CANCELLED, new Set()],
|
|
158
|
+
]);
|
|
159
|
+
const _pdfpPsV2 = new Map();
|
|
160
|
+
const _pdfpJsV2 = new Map();
|
|
161
|
+
let _pdfpMaxActive = 6,
|
|
162
|
+
_pdfpMaxPending = 12,
|
|
163
|
+
_pdfpIdleMs = 30 * 24 * 60 * 60 * 1000,
|
|
164
|
+
_pdfpStuckMs = 60 * 1000;
|
|
165
|
+
function _pdfpPos(n, label) {
|
|
166
|
+
const v = Math.floor(Number(n));
|
|
167
|
+
if (!Number.isFinite(v) || v <= 0)
|
|
168
|
+
throw new Error(`${label} must be positive integer`);
|
|
169
|
+
return v;
|
|
170
|
+
}
|
|
171
|
+
function _pdfpCheckP(from, to) {
|
|
172
|
+
const a = _pdfpPTrans.get(from);
|
|
173
|
+
if (!a || !a.has(to))
|
|
174
|
+
throw new Error(`invalid pdfp profile transition ${from} → ${to}`);
|
|
175
|
+
}
|
|
176
|
+
function _pdfpCheckJ(from, to) {
|
|
177
|
+
const a = _pdfpJTrans.get(from);
|
|
178
|
+
if (!a || !a.has(to))
|
|
179
|
+
throw new Error(`invalid pdfp parse transition ${from} → ${to}`);
|
|
180
|
+
}
|
|
181
|
+
function _pdfpCountActive(owner) {
|
|
182
|
+
let c = 0;
|
|
183
|
+
for (const p of _pdfpPsV2.values())
|
|
184
|
+
if (p.owner === owner && p.status === PDFP_PROFILE_MATURITY_V2.ACTIVE) c++;
|
|
185
|
+
return c;
|
|
186
|
+
}
|
|
187
|
+
function _pdfpCountPending(profileId) {
|
|
188
|
+
let c = 0;
|
|
189
|
+
for (const j of _pdfpJsV2.values())
|
|
190
|
+
if (
|
|
191
|
+
j.profileId === profileId &&
|
|
192
|
+
(j.status === PDFP_PARSE_LIFECYCLE_V2.QUEUED ||
|
|
193
|
+
j.status === PDFP_PARSE_LIFECYCLE_V2.PARSING)
|
|
194
|
+
)
|
|
195
|
+
c++;
|
|
196
|
+
return c;
|
|
197
|
+
}
|
|
198
|
+
export function setMaxActivePdfpProfilesPerOwnerV2(n) {
|
|
199
|
+
_pdfpMaxActive = _pdfpPos(n, "maxActivePdfpProfilesPerOwner");
|
|
200
|
+
}
|
|
201
|
+
export function getMaxActivePdfpProfilesPerOwnerV2() {
|
|
202
|
+
return _pdfpMaxActive;
|
|
203
|
+
}
|
|
204
|
+
export function setMaxPendingPdfpParsesPerProfileV2(n) {
|
|
205
|
+
_pdfpMaxPending = _pdfpPos(n, "maxPendingPdfpParsesPerProfile");
|
|
206
|
+
}
|
|
207
|
+
export function getMaxPendingPdfpParsesPerProfileV2() {
|
|
208
|
+
return _pdfpMaxPending;
|
|
209
|
+
}
|
|
210
|
+
export function setPdfpProfileIdleMsV2(n) {
|
|
211
|
+
_pdfpIdleMs = _pdfpPos(n, "pdfpProfileIdleMs");
|
|
212
|
+
}
|
|
213
|
+
export function getPdfpProfileIdleMsV2() {
|
|
214
|
+
return _pdfpIdleMs;
|
|
215
|
+
}
|
|
216
|
+
export function setPdfpParseStuckMsV2(n) {
|
|
217
|
+
_pdfpStuckMs = _pdfpPos(n, "pdfpParseStuckMs");
|
|
218
|
+
}
|
|
219
|
+
export function getPdfpParseStuckMsV2() {
|
|
220
|
+
return _pdfpStuckMs;
|
|
221
|
+
}
|
|
222
|
+
export function _resetStatePdfParserV2() {
|
|
223
|
+
_pdfpPsV2.clear();
|
|
224
|
+
_pdfpJsV2.clear();
|
|
225
|
+
_pdfpMaxActive = 6;
|
|
226
|
+
_pdfpMaxPending = 12;
|
|
227
|
+
_pdfpIdleMs = 30 * 24 * 60 * 60 * 1000;
|
|
228
|
+
_pdfpStuckMs = 60 * 1000;
|
|
229
|
+
}
|
|
230
|
+
export function registerPdfpProfileV2({ id, owner, encoding, metadata } = {}) {
|
|
231
|
+
if (!id || !owner) throw new Error("id and owner required");
|
|
232
|
+
if (_pdfpPsV2.has(id)) throw new Error(`pdfp profile ${id} already exists`);
|
|
233
|
+
const now = Date.now();
|
|
234
|
+
const p = {
|
|
235
|
+
id,
|
|
236
|
+
owner,
|
|
237
|
+
encoding: encoding || "utf-8",
|
|
238
|
+
status: PDFP_PROFILE_MATURITY_V2.PENDING,
|
|
239
|
+
createdAt: now,
|
|
240
|
+
updatedAt: now,
|
|
241
|
+
lastTouchedAt: now,
|
|
242
|
+
activatedAt: null,
|
|
243
|
+
archivedAt: null,
|
|
244
|
+
metadata: { ...(metadata || {}) },
|
|
245
|
+
};
|
|
246
|
+
_pdfpPsV2.set(id, p);
|
|
247
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
248
|
+
}
|
|
249
|
+
export function activatePdfpProfileV2(id) {
|
|
250
|
+
const p = _pdfpPsV2.get(id);
|
|
251
|
+
if (!p) throw new Error(`pdfp profile ${id} not found`);
|
|
252
|
+
const isInitial = p.status === PDFP_PROFILE_MATURITY_V2.PENDING;
|
|
253
|
+
_pdfpCheckP(p.status, PDFP_PROFILE_MATURITY_V2.ACTIVE);
|
|
254
|
+
if (isInitial && _pdfpCountActive(p.owner) >= _pdfpMaxActive)
|
|
255
|
+
throw new Error(`max active pdfp profiles for owner ${p.owner} reached`);
|
|
256
|
+
const now = Date.now();
|
|
257
|
+
p.status = PDFP_PROFILE_MATURITY_V2.ACTIVE;
|
|
258
|
+
p.updatedAt = now;
|
|
259
|
+
p.lastTouchedAt = now;
|
|
260
|
+
if (!p.activatedAt) p.activatedAt = now;
|
|
261
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
262
|
+
}
|
|
263
|
+
export function stalePdfpProfileV2(id) {
|
|
264
|
+
const p = _pdfpPsV2.get(id);
|
|
265
|
+
if (!p) throw new Error(`pdfp profile ${id} not found`);
|
|
266
|
+
_pdfpCheckP(p.status, PDFP_PROFILE_MATURITY_V2.STALE);
|
|
267
|
+
p.status = PDFP_PROFILE_MATURITY_V2.STALE;
|
|
268
|
+
p.updatedAt = Date.now();
|
|
269
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
270
|
+
}
|
|
271
|
+
export function archivePdfpProfileV2(id) {
|
|
272
|
+
const p = _pdfpPsV2.get(id);
|
|
273
|
+
if (!p) throw new Error(`pdfp profile ${id} not found`);
|
|
274
|
+
_pdfpCheckP(p.status, PDFP_PROFILE_MATURITY_V2.ARCHIVED);
|
|
275
|
+
const now = Date.now();
|
|
276
|
+
p.status = PDFP_PROFILE_MATURITY_V2.ARCHIVED;
|
|
277
|
+
p.updatedAt = now;
|
|
278
|
+
if (!p.archivedAt) p.archivedAt = now;
|
|
279
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
280
|
+
}
|
|
281
|
+
export function touchPdfpProfileV2(id) {
|
|
282
|
+
const p = _pdfpPsV2.get(id);
|
|
283
|
+
if (!p) throw new Error(`pdfp profile ${id} not found`);
|
|
284
|
+
if (_pdfpPTerminal.has(p.status))
|
|
285
|
+
throw new Error(`cannot touch terminal pdfp profile ${id}`);
|
|
286
|
+
const now = Date.now();
|
|
287
|
+
p.lastTouchedAt = now;
|
|
288
|
+
p.updatedAt = now;
|
|
289
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
290
|
+
}
|
|
291
|
+
export function getPdfpProfileV2(id) {
|
|
292
|
+
const p = _pdfpPsV2.get(id);
|
|
293
|
+
if (!p) return null;
|
|
294
|
+
return { ...p, metadata: { ...p.metadata } };
|
|
295
|
+
}
|
|
296
|
+
export function listPdfpProfilesV2() {
|
|
297
|
+
return [..._pdfpPsV2.values()].map((p) => ({
|
|
298
|
+
...p,
|
|
299
|
+
metadata: { ...p.metadata },
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
export function createPdfpParseV2({ id, profileId, path, metadata } = {}) {
|
|
303
|
+
if (!id || !profileId) throw new Error("id and profileId required");
|
|
304
|
+
if (_pdfpJsV2.has(id)) throw new Error(`pdfp parse ${id} already exists`);
|
|
305
|
+
if (!_pdfpPsV2.has(profileId))
|
|
306
|
+
throw new Error(`pdfp profile ${profileId} not found`);
|
|
307
|
+
if (_pdfpCountPending(profileId) >= _pdfpMaxPending)
|
|
308
|
+
throw new Error(`max pending pdfp parses for profile ${profileId} reached`);
|
|
309
|
+
const now = Date.now();
|
|
310
|
+
const j = {
|
|
311
|
+
id,
|
|
312
|
+
profileId,
|
|
313
|
+
path: path || "",
|
|
314
|
+
status: PDFP_PARSE_LIFECYCLE_V2.QUEUED,
|
|
315
|
+
createdAt: now,
|
|
316
|
+
updatedAt: now,
|
|
317
|
+
startedAt: null,
|
|
318
|
+
settledAt: null,
|
|
319
|
+
metadata: { ...(metadata || {}) },
|
|
320
|
+
};
|
|
321
|
+
_pdfpJsV2.set(id, j);
|
|
322
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
323
|
+
}
|
|
324
|
+
export function parsingPdfpParseV2(id) {
|
|
325
|
+
const j = _pdfpJsV2.get(id);
|
|
326
|
+
if (!j) throw new Error(`pdfp parse ${id} not found`);
|
|
327
|
+
_pdfpCheckJ(j.status, PDFP_PARSE_LIFECYCLE_V2.PARSING);
|
|
328
|
+
const now = Date.now();
|
|
329
|
+
j.status = PDFP_PARSE_LIFECYCLE_V2.PARSING;
|
|
330
|
+
j.updatedAt = now;
|
|
331
|
+
if (!j.startedAt) j.startedAt = now;
|
|
332
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
333
|
+
}
|
|
334
|
+
export function parsePdfpParseV2(id) {
|
|
335
|
+
const j = _pdfpJsV2.get(id);
|
|
336
|
+
if (!j) throw new Error(`pdfp parse ${id} not found`);
|
|
337
|
+
_pdfpCheckJ(j.status, PDFP_PARSE_LIFECYCLE_V2.PARSED);
|
|
338
|
+
const now = Date.now();
|
|
339
|
+
j.status = PDFP_PARSE_LIFECYCLE_V2.PARSED;
|
|
340
|
+
j.updatedAt = now;
|
|
341
|
+
if (!j.settledAt) j.settledAt = now;
|
|
342
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
343
|
+
}
|
|
344
|
+
export function failPdfpParseV2(id, reason) {
|
|
345
|
+
const j = _pdfpJsV2.get(id);
|
|
346
|
+
if (!j) throw new Error(`pdfp parse ${id} not found`);
|
|
347
|
+
_pdfpCheckJ(j.status, PDFP_PARSE_LIFECYCLE_V2.FAILED);
|
|
348
|
+
const now = Date.now();
|
|
349
|
+
j.status = PDFP_PARSE_LIFECYCLE_V2.FAILED;
|
|
350
|
+
j.updatedAt = now;
|
|
351
|
+
if (!j.settledAt) j.settledAt = now;
|
|
352
|
+
if (reason) j.metadata.failReason = String(reason);
|
|
353
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
354
|
+
}
|
|
355
|
+
export function cancelPdfpParseV2(id, reason) {
|
|
356
|
+
const j = _pdfpJsV2.get(id);
|
|
357
|
+
if (!j) throw new Error(`pdfp parse ${id} not found`);
|
|
358
|
+
_pdfpCheckJ(j.status, PDFP_PARSE_LIFECYCLE_V2.CANCELLED);
|
|
359
|
+
const now = Date.now();
|
|
360
|
+
j.status = PDFP_PARSE_LIFECYCLE_V2.CANCELLED;
|
|
361
|
+
j.updatedAt = now;
|
|
362
|
+
if (!j.settledAt) j.settledAt = now;
|
|
363
|
+
if (reason) j.metadata.cancelReason = String(reason);
|
|
364
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
365
|
+
}
|
|
366
|
+
export function getPdfpParseV2(id) {
|
|
367
|
+
const j = _pdfpJsV2.get(id);
|
|
368
|
+
if (!j) return null;
|
|
369
|
+
return { ...j, metadata: { ...j.metadata } };
|
|
370
|
+
}
|
|
371
|
+
export function listPdfpParsesV2() {
|
|
372
|
+
return [..._pdfpJsV2.values()].map((j) => ({
|
|
373
|
+
...j,
|
|
374
|
+
metadata: { ...j.metadata },
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
export function autoStaleIdlePdfpProfilesV2({ now } = {}) {
|
|
378
|
+
const t = now ?? Date.now();
|
|
379
|
+
const flipped = [];
|
|
380
|
+
for (const p of _pdfpPsV2.values())
|
|
381
|
+
if (
|
|
382
|
+
p.status === PDFP_PROFILE_MATURITY_V2.ACTIVE &&
|
|
383
|
+
t - p.lastTouchedAt >= _pdfpIdleMs
|
|
384
|
+
) {
|
|
385
|
+
p.status = PDFP_PROFILE_MATURITY_V2.STALE;
|
|
386
|
+
p.updatedAt = t;
|
|
387
|
+
flipped.push(p.id);
|
|
388
|
+
}
|
|
389
|
+
return { flipped, count: flipped.length };
|
|
390
|
+
}
|
|
391
|
+
export function autoFailStuckPdfpParsesV2({ now } = {}) {
|
|
392
|
+
const t = now ?? Date.now();
|
|
393
|
+
const flipped = [];
|
|
394
|
+
for (const j of _pdfpJsV2.values())
|
|
395
|
+
if (
|
|
396
|
+
j.status === PDFP_PARSE_LIFECYCLE_V2.PARSING &&
|
|
397
|
+
j.startedAt != null &&
|
|
398
|
+
t - j.startedAt >= _pdfpStuckMs
|
|
399
|
+
) {
|
|
400
|
+
j.status = PDFP_PARSE_LIFECYCLE_V2.FAILED;
|
|
401
|
+
j.updatedAt = t;
|
|
402
|
+
if (!j.settledAt) j.settledAt = t;
|
|
403
|
+
j.metadata.failReason = "auto-fail-stuck";
|
|
404
|
+
flipped.push(j.id);
|
|
405
|
+
}
|
|
406
|
+
return { flipped, count: flipped.length };
|
|
407
|
+
}
|
|
408
|
+
export function getPdfParserGovStatsV2() {
|
|
409
|
+
const profilesByStatus = {};
|
|
410
|
+
for (const v of Object.values(PDFP_PROFILE_MATURITY_V2))
|
|
411
|
+
profilesByStatus[v] = 0;
|
|
412
|
+
for (const p of _pdfpPsV2.values()) profilesByStatus[p.status]++;
|
|
413
|
+
const parsesByStatus = {};
|
|
414
|
+
for (const v of Object.values(PDFP_PARSE_LIFECYCLE_V2)) parsesByStatus[v] = 0;
|
|
415
|
+
for (const j of _pdfpJsV2.values()) parsesByStatus[j.status]++;
|
|
416
|
+
return {
|
|
417
|
+
totalPdfpProfilesV2: _pdfpPsV2.size,
|
|
418
|
+
totalPdfpParsesV2: _pdfpJsV2.size,
|
|
419
|
+
maxActivePdfpProfilesPerOwner: _pdfpMaxActive,
|
|
420
|
+
maxPendingPdfpParsesPerProfile: _pdfpMaxPending,
|
|
421
|
+
pdfpProfileIdleMs: _pdfpIdleMs,
|
|
422
|
+
pdfpParseStuckMs: _pdfpStuckMs,
|
|
423
|
+
profilesByStatus,
|
|
424
|
+
parsesByStatus,
|
|
425
|
+
};
|
|
426
|
+
}
|