@algosuite/vo-mcp 0.2.0-beta.30 → 0.2.0-beta.34
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/dist/agent-auth-probe-cli.mjs +187 -6
- package/dist/cli.js +65 -6
- package/dist/cli.js.map +2 -2
- package/dist/index.js +65 -6
- package/dist/index.js.map +2 -2
- package/dist/runner-cli.js +935 -166
- package/dist/runner-cli.js.map +4 -4
- package/dist/runner-supervisor.js +99 -2
- package/dist/runner-supervisor.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1546,6 +1546,42 @@ function toEventPerModelVerdicts(src) {
|
|
|
1546
1546
|
};
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
|
+
function aggregateEventTokenUsage(src, engineUsage) {
|
|
1550
|
+
if (engineUsage !== void 0) {
|
|
1551
|
+
const hasIn = Object.keys(engineUsage.per_model_tokens_in).length > 0;
|
|
1552
|
+
const hasOut = Object.keys(engineUsage.per_model_tokens_out).length > 0;
|
|
1553
|
+
return {
|
|
1554
|
+
per_model_tokens_in: hasIn ? engineUsage.per_model_tokens_in : null,
|
|
1555
|
+
per_model_tokens_out: hasOut ? engineUsage.per_model_tokens_out : null,
|
|
1556
|
+
total_cost_usd: engineUsage.cost_micro_usd === null ? null : engineUsage.cost_micro_usd / 1e6
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
const tokensIn = {};
|
|
1560
|
+
const tokensOut = {};
|
|
1561
|
+
let anyTokensIn = false;
|
|
1562
|
+
let anyTokensOut = false;
|
|
1563
|
+
let costMicroUsd = 0;
|
|
1564
|
+
let anyCost = false;
|
|
1565
|
+
for (const v of src) {
|
|
1566
|
+
if (typeof v.input_tokens === "number") {
|
|
1567
|
+
tokensIn[v.model] = (tokensIn[v.model] ?? 0) + v.input_tokens;
|
|
1568
|
+
anyTokensIn = true;
|
|
1569
|
+
}
|
|
1570
|
+
if (typeof v.output_tokens === "number") {
|
|
1571
|
+
tokensOut[v.model] = (tokensOut[v.model] ?? 0) + v.output_tokens;
|
|
1572
|
+
anyTokensOut = true;
|
|
1573
|
+
}
|
|
1574
|
+
if (typeof v.cost_micro_usd === "number") {
|
|
1575
|
+
costMicroUsd += v.cost_micro_usd;
|
|
1576
|
+
anyCost = true;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
per_model_tokens_in: anyTokensIn ? tokensIn : null,
|
|
1581
|
+
per_model_tokens_out: anyTokensOut ? tokensOut : null,
|
|
1582
|
+
total_cost_usd: anyCost ? costMicroUsd / 1e6 : null
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1549
1585
|
function toEventSynthesizedVerdict(src) {
|
|
1550
1586
|
return {
|
|
1551
1587
|
verdict: src.verdict,
|
|
@@ -1917,7 +1953,8 @@ async function handleCheckHollowTest(deps, rawInput, signal) {
|
|
|
1917
1953
|
synthesized_verdict: synthForEvent,
|
|
1918
1954
|
consensus_confidence: engineResult.synthesized_verdict.confidence,
|
|
1919
1955
|
duration_ms: engineResult.duration_ms,
|
|
1920
|
-
consensus_engine_version: engineResult.engine_version
|
|
1956
|
+
consensus_engine_version: engineResult.engine_version,
|
|
1957
|
+
...aggregateEventTokenUsage(engineResult.per_model_verdicts, engineResult.token_usage)
|
|
1921
1958
|
};
|
|
1922
1959
|
const payload = {
|
|
1923
1960
|
verdict: engineResult.synthesized_verdict.verdict,
|
|
@@ -2099,7 +2136,8 @@ async function handleVerifyAnswer(deps, rawInput, signal) {
|
|
|
2099
2136
|
synthesized_verdict: synthForEvent,
|
|
2100
2137
|
consensus_confidence: engineResult.synthesized_verdict.confidence,
|
|
2101
2138
|
duration_ms: engineResult.duration_ms,
|
|
2102
|
-
consensus_engine_version: engineResult.engine_version
|
|
2139
|
+
consensus_engine_version: engineResult.engine_version,
|
|
2140
|
+
...aggregateEventTokenUsage(engineResult.per_model_verdicts, engineResult.token_usage)
|
|
2103
2141
|
};
|
|
2104
2142
|
const payload = {
|
|
2105
2143
|
verdict: engineResult.synthesized_verdict.verdict,
|
|
@@ -2108,6 +2146,7 @@ async function handleVerifyAnswer(deps, rawInput, signal) {
|
|
|
2108
2146
|
synthesized_verdict: synthForEvent,
|
|
2109
2147
|
engine_version: engineResult.engine_version,
|
|
2110
2148
|
degraded: engineResult.degraded,
|
|
2149
|
+
...engineResult.quorum_failed === true ? { quorum_failed: true } : {},
|
|
2111
2150
|
gate_type: gateType,
|
|
2112
2151
|
...kbResult.error !== null ? { kb_unavailable: true } : {},
|
|
2113
2152
|
...kbTruncated > 0 ? { kb_rules_truncated: kbTruncated } : {}
|
|
@@ -2361,7 +2400,8 @@ async function handleConsensusJudgment(deps, rawInput, signal) {
|
|
|
2361
2400
|
duration_ms: engineResult.duration_ms,
|
|
2362
2401
|
consensus_engine_version: engineResult.engine_version,
|
|
2363
2402
|
per_model_verdicts: perModelForEvent,
|
|
2364
|
-
synthesized_verdict: synthForEvent
|
|
2403
|
+
synthesized_verdict: synthForEvent,
|
|
2404
|
+
...aggregateEventTokenUsage(engineResult.per_model_verdicts, engineResult.token_usage)
|
|
2365
2405
|
};
|
|
2366
2406
|
const payload = {
|
|
2367
2407
|
verdict: engineResult.synthesized_verdict.verdict,
|
|
@@ -2370,6 +2410,7 @@ async function handleConsensusJudgment(deps, rawInput, signal) {
|
|
|
2370
2410
|
synthesized_verdict: synthForEvent,
|
|
2371
2411
|
engine_version: engineResult.engine_version,
|
|
2372
2412
|
degraded: engineResult.degraded,
|
|
2413
|
+
...engineResult.quorum_failed === true ? { quorum_failed: true } : {},
|
|
2373
2414
|
gate_type: gateType,
|
|
2374
2415
|
// ─── Consensus-engine feature outputs (additive; 2026-06-13) ─────────────
|
|
2375
2416
|
// Feature 2 (calibrated-confidence) — ON by default; the engine attaches
|
|
@@ -2568,7 +2609,8 @@ async function handleArchitectureReview(deps, rawInput, signal) {
|
|
|
2568
2609
|
synthesized_verdict: synthForEvent,
|
|
2569
2610
|
consensus_confidence: engineResult.synthesized_verdict.confidence,
|
|
2570
2611
|
duration_ms: engineResult.duration_ms,
|
|
2571
|
-
consensus_engine_version: engineResult.engine_version
|
|
2612
|
+
consensus_engine_version: engineResult.engine_version,
|
|
2613
|
+
...aggregateEventTokenUsage(engineResult.per_model_verdicts, engineResult.token_usage)
|
|
2572
2614
|
};
|
|
2573
2615
|
const escalationRequired = engineResult.escalation_required === true || engineResult.escalation_required === void 0 && engineResult.synthesized_verdict.dissent_summary !== null;
|
|
2574
2616
|
const escalationReason = engineResult.escalation_reason ?? engineResult.synthesized_verdict.dissent_summary ?? "";
|
|
@@ -4053,7 +4095,8 @@ Produce the JSON dispatch plan now.`;
|
|
|
4053
4095
|
duration_ms: engineResult.duration_ms,
|
|
4054
4096
|
consensus_engine_version: engineResult.engine_version,
|
|
4055
4097
|
per_model_verdicts: toEventPerModelVerdicts(engineResult.per_model_verdicts),
|
|
4056
|
-
synthesized_verdict: toEventSynthesizedVerdict(engineResult.synthesized_verdict)
|
|
4098
|
+
synthesized_verdict: toEventSynthesizedVerdict(engineResult.synthesized_verdict),
|
|
4099
|
+
...aggregateEventTokenUsage(engineResult.per_model_verdicts, engineResult.token_usage)
|
|
4057
4100
|
};
|
|
4058
4101
|
deps.events.append(enrichedEvent);
|
|
4059
4102
|
return jsonContent(envelope);
|
|
@@ -4795,7 +4838,8 @@ async function handleReviewMerge(deps, rawInput, signal) {
|
|
|
4795
4838
|
duration_ms: result.duration_ms,
|
|
4796
4839
|
consensus_engine_version: result.engine_version,
|
|
4797
4840
|
per_model_verdicts: perModel,
|
|
4798
|
-
synthesized_verdict: synth
|
|
4841
|
+
synthesized_verdict: synth,
|
|
4842
|
+
...aggregateEventTokenUsage(result.per_model_verdicts, result.token_usage)
|
|
4799
4843
|
});
|
|
4800
4844
|
}
|
|
4801
4845
|
|
|
@@ -7432,6 +7476,14 @@ function shadowEnabled(env) {
|
|
|
7432
7476
|
const norm = raw.trim().toLowerCase();
|
|
7433
7477
|
return !(norm === "0" || norm === "false" || norm === "no" || norm === "off" || norm === "");
|
|
7434
7478
|
}
|
|
7479
|
+
var MIN_RESPONDERS_ENV_VAR = "VO_CONSENSUS_MIN_RESPONDERS";
|
|
7480
|
+
function resolveMinResponders(env) {
|
|
7481
|
+
const raw = (env ?? {})[MIN_RESPONDERS_ENV_VAR];
|
|
7482
|
+
if (raw === void 0 || raw.trim() === "") return 2;
|
|
7483
|
+
const parsed = Number.parseInt(raw.trim(), 10);
|
|
7484
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return void 0;
|
|
7485
|
+
return parsed;
|
|
7486
|
+
}
|
|
7435
7487
|
function mapShadowSynthesis(s) {
|
|
7436
7488
|
if (s === void 0) return void 0;
|
|
7437
7489
|
return {
|
|
@@ -7581,9 +7633,11 @@ function createEngineConsensusClient(options) {
|
|
|
7581
7633
|
...options.agreement_gate_enabled !== void 0 ? { configEnabled: options.agreement_gate_enabled } : {},
|
|
7582
7634
|
...options.env !== void 0 ? { env: options.env } : {}
|
|
7583
7635
|
});
|
|
7636
|
+
const minResponders = resolveMinResponders(options.env);
|
|
7584
7637
|
const engineOptions = {
|
|
7585
7638
|
panel,
|
|
7586
7639
|
...options.per_model_timeout_ms !== void 0 ? { per_model_timeout_ms: options.per_model_timeout_ms } : {},
|
|
7640
|
+
...minResponders !== void 0 ? { min_responders: minResponders } : {},
|
|
7587
7641
|
...agreementGate !== void 0 ? { agreement_gate: agreementGate } : {},
|
|
7588
7642
|
// Stage A7-shadow: run the adaptive verdict alongside the live one for grading.
|
|
7589
7643
|
// Cheap (pure log-odds over already-fetched verdicts; no extra model calls),
|
|
@@ -7636,8 +7690,13 @@ function createEngineConsensusClient(options) {
|
|
|
7636
7690
|
synthesized_verdict: response.synthesized_verdict,
|
|
7637
7691
|
per_model_verdicts: response.per_model_verdicts,
|
|
7638
7692
|
degraded: response.degraded,
|
|
7693
|
+
...response.quorum_failed === true ? { quorum_failed: true } : {},
|
|
7639
7694
|
duration_ms: response.duration_ms,
|
|
7640
7695
|
engine_version: response.engine_version,
|
|
7696
|
+
// Cumulative cross-round inference usage (B44-3). Absent when no panel
|
|
7697
|
+
// member reported usage; forwarded verbatim — the aggregator prefers it
|
|
7698
|
+
// over summing final-round verdicts (which under-reports deliberation).
|
|
7699
|
+
...response.token_usage !== void 0 ? { token_usage: response.token_usage } : {},
|
|
7641
7700
|
// Phase 2 Lane D-1 — forward escalation signal when present. The
|
|
7642
7701
|
// source-grounded layer's own escalation (from the citation grade)
|
|
7643
7702
|
// takes precedence when set, else the synthesizer's.
|