loki-mode 11.110.0 → 11.112.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 +4 -4
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/lib/setup-requirements.json +4 -5
- package/dashboard/__init__.py +1 -1
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +3 -5
- package/docs/alternative-installations.md +6 -7
- package/docs/v10/GUIDE.md +4 -3
- package/loki-ts/dist/loki.js +1557 -1556
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/packages/control-plane/dist/ask-tools-server.js +138 -91
- package/packages/control-plane/dist/server.js +7545 -4638
- package/packages/control-plane/drizzle/0007_outcome_metrics.sql +7 -0
- package/packages/control-plane/drizzle/meta/0007_snapshot.json +846 -0
- package/packages/control-plane/drizzle/meta/_journal.json +7 -0
- package/packages/control-plane/src/db/schema.ts +6 -1
- package/packages/control-plane/src/server/routes/cost.ts +18 -17
- package/packages/control-plane/src/server/routes/stats.ts +172 -13
- package/packages/control-plane/src/server/runs.ts +24 -8
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-D4cF1rIZ.js → AdminPage-DYoUXYdU.js} +1 -1
- package/web-app/dist/assets/{Avatar-BzP8tfUm.js → Avatar-BBaMPJfc.js} +1 -1
- package/web-app/dist/assets/{Badge-DHiXrt2w.js → Badge-Dt_ztUHa.js} +1 -1
- package/web-app/dist/assets/{Button-VW_O8cPs.js → Button-Cu-QdpUO.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-DjkhEbWq.js → CockpitPage-LMBCBSXS.js} +1 -1
- package/web-app/dist/assets/{ComparePage-DLlVSZRD.js → ComparePage-Bi5x5Kx8.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-lVnlq_o6.js → ErrorBoundary-Coi36uQa.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-DKTIY04g.js → EvidenceReceiptPanel-BjfnylRS.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-BzEuZ8ci.js → GitHubIssuesPanel-D5Apw6Oi.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-l2cGea-l.js → GitHubPRsPanel-5ZvMb91S.js} +1 -1
- package/web-app/dist/assets/{HomePage-Dr8vp_3u.js → HomePage-DNyTyTW6.js} +2 -2
- package/web-app/dist/assets/{LoginPage-CgbDB5yk.js → LoginPage-BmYbmrkg.js} +1 -1
- package/web-app/dist/assets/{MagicPage-413ACFN7.js → MagicPage-B1esRu80.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-BUZnmN6f.js → MetricsPage-D3lnwh_V.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-DMwCpNo-.js → NotFoundPage-BxxwqqL9.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-D2PXm_Z2.js → ProjectPage-DCgbdCM2.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-C4Z6bs4h.js → ProjectsPage-DME15NIM.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-B7U5W_zb.js → SettingsPage-DybJpnZ2.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-BowJuTpb.js → ShowcasePage-BwgWWjcD.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-Cwg3jmaI.js → SystemSettingsPage-ghxnJSGd.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-MFqradkQ.js → TeamsPage-8rcAs_4i.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-DxlIsCpO.js → TemplatesPage-D-YkyMid.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-5KpPXY2s.js → TerminalOutput-BAhHuPOd.js} +1 -1
- package/web-app/dist/assets/{activity-CK7Th554.js → activity-hdD5wW2u.js} +1 -1
- package/web-app/dist/assets/{bell-Da2vUkgy.js → bell-DjWf1-AD.js} +1 -1
- package/web-app/dist/assets/{bot-ZYBMnjxr.js → bot-B4smBIHH.js} +1 -1
- package/web-app/dist/assets/{check-DDvtqnGn.js → check-Bx8Vedfz.js} +1 -1
- package/web-app/dist/assets/{chevron-left-CWzC5TPz.js → chevron-left-Cqg-qMiB.js} +1 -1
- package/web-app/dist/assets/{circle-alert-Cy3pK14a.js → circle-alert-DJPTd64w.js} +1 -1
- package/web-app/dist/assets/{clock-CSJ_03ek.js → clock-DAwVo66N.js} +1 -1
- package/web-app/dist/assets/{cloud-00d8dA8K.js → cloud-cWtzmtCN.js} +1 -1
- package/web-app/dist/assets/{code-xml-CvvQVSmh.js → code-xml-DZ4-8xns.js} +1 -1
- package/web-app/dist/assets/{database-SRoWkIl2.js → database-KAOYEZLe.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-U4VZlNqY.js → dollar-sign-BgRpI1Or.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-CbTMgHZT.js → file-code-corner-BT_JXcbS.js} +1 -1
- package/web-app/dist/assets/{file-plus-Do8T6r6c.js → file-plus-D567SLBE.js} +1 -1
- package/web-app/dist/assets/{globe-C3NyfavU.js → globe-C8duz8y-.js} +1 -1
- package/web-app/dist/assets/{hammer-xRLjuRRo.js → hammer-DFgOZ55H.js} +1 -1
- package/web-app/dist/assets/{index-qz83Pq2m.js → index-Cqm7mcD3.js} +3 -3
- package/web-app/dist/assets/{layers-JPZePf7u.js → layers-D5SMi3KF.js} +1 -1
- package/web-app/dist/assets/{loader-circle-VGGdjbyB.js → loader-circle-yhfpH3HU.js} +1 -1
- package/web-app/dist/assets/{lock-Cmu-pxmX.js → lock-1pGkRsNY.js} +1 -1
- package/web-app/dist/assets/{package-CsR7U7E0.js → package-BZZ8rCmn.js} +1 -1
- package/web-app/dist/assets/{plus-ACxpSzwa.js → plus-D3dzuNA0.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-DEUod6qB.js → refresh-cw-C1EY9mdH.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-BEUC0FCQ.js → rotate-ccw-Zz24GUgC.js} +1 -1
- package/web-app/dist/assets/{scroll-text-CDEBT5kW.js → scroll-text-CprzZkhZ.js} +1 -1
- package/web-app/dist/assets/{server-CA-yxQGN.js → server-bv2lyoFf.js} +1 -1
- package/web-app/dist/assets/{shield-alert-cxvAEv6s.js → shield-alert-B8wSICzV.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-iN79euHQ.js → thumbs-up-DYxl-grX.js} +1 -1
- package/web-app/dist/assets/{trash-2-DAKpXlI3.js → trash-2-BFXmB-lq.js} +1 -1
- package/web-app/dist/assets/{trending-down-BETPoZ1b.js → trending-down-BOFHm0lm.js} +1 -1
- package/web-app/dist/assets/{trending-up-RT8Y4bH1.js → trending-up-0ERKZkIv.js} +1 -1
- package/web-app/dist/assets/{upload-DfDke1nO.js → upload-DS5z-6i4.js} +1 -1
- package/web-app/dist/assets/{usePolling-ap6dAXry.js → usePolling-H70WnOOu.js} +1 -1
- package/web-app/dist/assets/{user-D--LOGSn.js → user-ByTDBOqh.js} +1 -1
- package/web-app/dist/index.html +1 -1
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
3
|
"mcpName": "io.github.asklokesh/loki-mode",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.112.0",
|
|
5
5
|
"description": "An autonomous software factory that knows what it is supposed to deliver, and proves it did.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"agent",
|
|
@@ -162,5 +162,5 @@
|
|
|
162
162
|
"dependencies": {
|
|
163
163
|
"@resvg/resvg-wasm": "^2.6.2"
|
|
164
164
|
},
|
|
165
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "061785b4d15316e55118bf2bda7b91e7649fca3f"
|
|
166
166
|
}
|
|
@@ -38830,6 +38830,11 @@ var runs = sqliteTable("runs", {
|
|
|
38830
38830
|
tokenSessions: integer2("token_sessions"),
|
|
38831
38831
|
inputTokens: integer2("input_tokens").notNull(),
|
|
38832
38832
|
outputTokens: integer2("output_tokens").notNull(),
|
|
38833
|
+
cacheReadTokens: integer2("cache_read_tokens").notNull().default(0),
|
|
38834
|
+
cacheCreationTokens: integer2("cache_creation_tokens").notNull().default(0),
|
|
38835
|
+
fixRounds: integer2("fix_rounds").notNull().default(0),
|
|
38836
|
+
escalations: integer2("escalations").notNull().default(0),
|
|
38837
|
+
size: text("size"),
|
|
38833
38838
|
wallS: real("wall_s"),
|
|
38834
38839
|
lastSeq: integer2("last_seq").notNull(),
|
|
38835
38840
|
lastEventAt: text("last_event_at"),
|
|
@@ -40524,11 +40529,119 @@ function effectiveVerdict(r) {
|
|
|
40524
40529
|
return r.verdict;
|
|
40525
40530
|
}
|
|
40526
40531
|
|
|
40532
|
+
// src/server/routes/stats.ts
|
|
40533
|
+
var displayVerdict = (r) => r.verdict ? effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 }) : null;
|
|
40534
|
+
function outcomeClass(r) {
|
|
40535
|
+
const v = displayVerdict(r);
|
|
40536
|
+
if (v === null)
|
|
40537
|
+
return null;
|
|
40538
|
+
if (v === "VERIFIED")
|
|
40539
|
+
return "verified";
|
|
40540
|
+
if (v === "VERIFIED (signature not checked)")
|
|
40541
|
+
return "unchecked";
|
|
40542
|
+
if (v === "ALREADY_SATISFIED" || v === "ALREADY_SATISFIED (signature not checked)")
|
|
40543
|
+
return "satisfied";
|
|
40544
|
+
if (v === "FAILED" || v === "PARTIAL" || v === "TAMPERED")
|
|
40545
|
+
return "failed";
|
|
40546
|
+
return "other";
|
|
40547
|
+
}
|
|
40548
|
+
var r6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
40549
|
+
function computeStats(db, since) {
|
|
40550
|
+
const all = db.select().from(runs).all().filter((r) => !since || r.startedAt !== null && r.startedAt >= since);
|
|
40551
|
+
const by = {};
|
|
40552
|
+
let finished = 0, running = 0, blocked = 0, verified = 0, unchecked = 0, failed = 0, satisfied = 0, other = 0;
|
|
40553
|
+
let mUsd = 0, mRuns = 0, pUsd = 0, pRuns = 0;
|
|
40554
|
+
for (const r of all) {
|
|
40555
|
+
if (r.endedAt)
|
|
40556
|
+
finished++;
|
|
40557
|
+
else
|
|
40558
|
+
running++;
|
|
40559
|
+
const verdict = displayVerdict(r);
|
|
40560
|
+
if (verdict) {
|
|
40561
|
+
by[verdict] = (by[verdict] ?? 0) + 1;
|
|
40562
|
+
const k = r.endedAt ? outcomeClass(r) : null;
|
|
40563
|
+
if (k === "verified")
|
|
40564
|
+
verified++;
|
|
40565
|
+
else if (k === "unchecked")
|
|
40566
|
+
unchecked++;
|
|
40567
|
+
else if (k === "satisfied")
|
|
40568
|
+
satisfied++;
|
|
40569
|
+
else if (k === "failed")
|
|
40570
|
+
failed++;
|
|
40571
|
+
else if (k === "other")
|
|
40572
|
+
other++;
|
|
40573
|
+
}
|
|
40574
|
+
if (r.verdict === "SPEC_CONFLICT")
|
|
40575
|
+
blocked++;
|
|
40576
|
+
if (r.costUsd !== null) {
|
|
40577
|
+
mUsd += r.costUsd;
|
|
40578
|
+
mRuns++;
|
|
40579
|
+
} else if (r.totalSessions > 0) {
|
|
40580
|
+
pUsd += r.partialUsd;
|
|
40581
|
+
pRuns++;
|
|
40582
|
+
}
|
|
40583
|
+
}
|
|
40584
|
+
const keys = new Set(all.map((r) => `${r.sourceId}/${r.runId}`));
|
|
40585
|
+
let total = 0, signed = 0;
|
|
40586
|
+
for (const e of db.select({ s: events.sourceId, r: events.runId, data: events.data }).from(events).where(eq(events.type, "receipt.sealed")).all()) {
|
|
40587
|
+
if (!keys.has(`${e.s}/${e.r}`))
|
|
40588
|
+
continue;
|
|
40589
|
+
total++;
|
|
40590
|
+
if (e.data?.signed === true)
|
|
40591
|
+
signed++;
|
|
40592
|
+
}
|
|
40593
|
+
return {
|
|
40594
|
+
since,
|
|
40595
|
+
runs_total: all.length,
|
|
40596
|
+
runs_finished: finished,
|
|
40597
|
+
runs_running: running,
|
|
40598
|
+
by_verdict: by,
|
|
40599
|
+
blocked_waiting: blocked,
|
|
40600
|
+
verified_rate: verified + unchecked + failed ? verified / (verified + unchecked + failed) : null,
|
|
40601
|
+
breakdown: { verified, failed, already_satisfied: satisfied, other },
|
|
40602
|
+
verified_unchecked: unchecked,
|
|
40603
|
+
keys_configured: pubkeysFromEnv().configured === true,
|
|
40604
|
+
...pubkeysFromEnv().reason ? { keys_reason: pubkeysFromEnv().reason } : {},
|
|
40605
|
+
cost: {
|
|
40606
|
+
measured_usd: mRuns ? r6(mUsd) : null,
|
|
40607
|
+
measured_runs: mRuns,
|
|
40608
|
+
partial_usd: pRuns ? r6(pUsd) : null,
|
|
40609
|
+
partial_runs: pRuns,
|
|
40610
|
+
label: pRuns ? "partial" : mRuns ? "measured" : "not measured"
|
|
40611
|
+
},
|
|
40612
|
+
receipts: { total, signed }
|
|
40613
|
+
};
|
|
40614
|
+
}
|
|
40615
|
+
var label = (n) => n > 0 ? "measured" : "not measured";
|
|
40616
|
+
function costPerVerified(rows) {
|
|
40617
|
+
let spend = 0, priced = 0, unpriced = 0, verified = 0, pricedVerified = 0;
|
|
40618
|
+
for (const r of rows) {
|
|
40619
|
+
if (!r.endedAt || r.tampered === 1)
|
|
40620
|
+
continue;
|
|
40621
|
+
const ok = outcomeClass(r) === "verified";
|
|
40622
|
+
if (ok)
|
|
40623
|
+
verified++;
|
|
40624
|
+
if (r.costUsd === null) {
|
|
40625
|
+
unpriced++;
|
|
40626
|
+
continue;
|
|
40627
|
+
}
|
|
40628
|
+
priced++;
|
|
40629
|
+
spend += r.costUsd;
|
|
40630
|
+
if (ok)
|
|
40631
|
+
pricedVerified++;
|
|
40632
|
+
}
|
|
40633
|
+
return { value: pricedVerified ? r6(spend / pricedVerified) : null, n: pricedVerified, label: label(pricedVerified), spend_usd: priced ? r6(spend) : null, priced_runs: priced, unpriced_runs: unpriced, verified_runs: verified };
|
|
40634
|
+
}
|
|
40635
|
+
var cacheReadShare = (r) => {
|
|
40636
|
+
const d = r.inputTokens + r.cacheReadTokens + r.cacheCreationTokens;
|
|
40637
|
+
return d > 0 ? r6(r.cacheReadTokens / d) : null;
|
|
40638
|
+
};
|
|
40639
|
+
|
|
40527
40640
|
// src/server/routes/cost.ts
|
|
40528
40641
|
var COST_DIMS = ["day", "model", "repo", "provider"];
|
|
40529
40642
|
var DEFAULT_API_KEY_CAP_USD = 100;
|
|
40530
40643
|
var NONE2 = "unknown";
|
|
40531
|
-
var mk = (key) => ({ key, runs: 0, measured_runs: 0, partial_runs: 0, unmeasured_runs: 0, measured_usd: 0, partial_usd: 0, input_tokens: 0, output_tokens: 0, tk: 0, tn: 0 });
|
|
40644
|
+
var mk = (key) => ({ key, runs: 0, measured_runs: 0, partial_runs: 0, unmeasured_runs: 0, measured_usd: 0, partial_usd: 0, input_tokens: 0, output_tokens: 0, cache_read_tokens: 0, cache_creation_tokens: 0, tk: 0, tn: 0 });
|
|
40532
40645
|
var add = (a, r) => {
|
|
40533
40646
|
a.runs++;
|
|
40534
40647
|
if (r.costUsd !== null) {
|
|
@@ -40541,6 +40654,8 @@ var add = (a, r) => {
|
|
|
40541
40654
|
a.unmeasured_runs++;
|
|
40542
40655
|
a.input_tokens += r.inputTokens;
|
|
40543
40656
|
a.output_tokens += r.outputTokens;
|
|
40657
|
+
a.cache_read_tokens += r.cacheReadTokens;
|
|
40658
|
+
a.cache_creation_tokens += r.cacheCreationTokens;
|
|
40544
40659
|
if (r.tokenSessions !== null) {
|
|
40545
40660
|
a.tk += r.tokenSessions;
|
|
40546
40661
|
a.tn += r.totalSessions;
|
|
@@ -40548,31 +40663,26 @@ var add = (a, r) => {
|
|
|
40548
40663
|
};
|
|
40549
40664
|
var dimVal = (d, r) => d === "day" ? r.startedAt ? r.startedAt.slice(0, 10) : NONE2 : d === "model" ? r.model ?? NONE2 : d === "provider" ? r.provider ?? NONE2 : r.originRepo ?? NONE2;
|
|
40550
40665
|
var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
40551
|
-
var out = (a) => ({ ...a.key, runs: a.runs, measured_runs: a.measured_runs, partial_runs: a.partial_runs, unmeasured_runs: a.unmeasured_runs, measured_usd: round(a.measured_usd), partial_usd: round(a.partial_usd), input_tokens: a.input_tokens, output_tokens: a.output_tokens, ...a.tk < a.tn ? { token_sessions: a.tk, token_sessions_total: a.tn } : {} });
|
|
40666
|
+
var out = (a) => ({ ...a.key, runs: a.runs, measured_runs: a.measured_runs, partial_runs: a.partial_runs, unmeasured_runs: a.unmeasured_runs, measured_usd: round(a.measured_usd), partial_usd: round(a.partial_usd), input_tokens: a.input_tokens, output_tokens: a.output_tokens, cache_read_tokens: a.cache_read_tokens, cache_creation_tokens: a.cache_creation_tokens, ...a.tk < a.tn ? { token_sessions: a.tk, token_sessions_total: a.tn } : {} });
|
|
40552
40667
|
function mount2(ctx) {
|
|
40553
40668
|
ctx.app.get("/v1/cost/repos", (c) => {
|
|
40554
40669
|
const g = new Map;
|
|
40555
40670
|
for (const r of ctx.db.select().from(runs).all()) {
|
|
40556
40671
|
const k = r.originRepo ?? "(unknown)";
|
|
40557
|
-
|
|
40558
|
-
|
|
40559
|
-
|
|
40560
|
-
|
|
40561
|
-
|
|
40562
|
-
|
|
40563
|
-
|
|
40564
|
-
|
|
40565
|
-
|
|
40566
|
-
|
|
40567
|
-
|
|
40568
|
-
|
|
40569
|
-
|
|
40570
|
-
|
|
40571
|
-
total_usd: round(a.usd),
|
|
40572
|
-
avg_usd: a.priced ? round(a.usd / a.priced) : null,
|
|
40573
|
-
verified_runs: a.verified,
|
|
40574
|
-
usd_per_verified: a.verified ? round(a.usd / a.verified) : null
|
|
40575
|
-
}));
|
|
40672
|
+
g.set(k, [...g.get(k) ?? [], r]);
|
|
40673
|
+
}
|
|
40674
|
+
const rows = [...g.entries()].sort((x, y) => x[0].localeCompare(y[0])).map(([repo, rs]) => {
|
|
40675
|
+
const priced = rs.filter((r) => r.costUsd !== null), usd = priced.reduce((t, r) => t + r.costUsd, 0), cpv = costPerVerified(rs);
|
|
40676
|
+
return {
|
|
40677
|
+
repo,
|
|
40678
|
+
runs: rs.length,
|
|
40679
|
+
total_usd: round(usd),
|
|
40680
|
+
avg_usd: priced.length ? round(usd / priced.length) : null,
|
|
40681
|
+
verified_runs: cpv.verified_runs,
|
|
40682
|
+
usd_per_verified: cpv.value,
|
|
40683
|
+
usd_per_verified_n: cpv.n
|
|
40684
|
+
};
|
|
40685
|
+
});
|
|
40576
40686
|
return c.json({ rows });
|
|
40577
40687
|
});
|
|
40578
40688
|
ctx.app.get("/v1/stats/cost", (c) => {
|
|
@@ -40624,76 +40734,6 @@ function mount2(ctx) {
|
|
|
40624
40734
|
});
|
|
40625
40735
|
}
|
|
40626
40736
|
|
|
40627
|
-
// src/server/routes/stats.ts
|
|
40628
|
-
function computeStats(db, since) {
|
|
40629
|
-
const all = db.select().from(runs).all().filter((r) => !since || r.startedAt !== null && r.startedAt >= since);
|
|
40630
|
-
const by = {};
|
|
40631
|
-
let finished = 0, running = 0, blocked = 0, verified = 0, unchecked = 0, failed = 0, satisfied = 0, other = 0;
|
|
40632
|
-
let mUsd = 0, mRuns = 0, pUsd = 0, pRuns = 0;
|
|
40633
|
-
for (const r of all) {
|
|
40634
|
-
if (r.endedAt)
|
|
40635
|
-
finished++;
|
|
40636
|
-
else
|
|
40637
|
-
running++;
|
|
40638
|
-
const verdict = r.verdict ? effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 }) : null;
|
|
40639
|
-
if (verdict) {
|
|
40640
|
-
by[verdict] = (by[verdict] ?? 0) + 1;
|
|
40641
|
-
if (r.endedAt) {
|
|
40642
|
-
if (verdict === "VERIFIED")
|
|
40643
|
-
verified++;
|
|
40644
|
-
else if (verdict === "VERIFIED (signature not checked)")
|
|
40645
|
-
unchecked++;
|
|
40646
|
-
else if (verdict === "ALREADY_SATISFIED" || verdict === "ALREADY_SATISFIED (signature not checked)")
|
|
40647
|
-
satisfied++;
|
|
40648
|
-
else if (verdict === "FAILED" || verdict === "PARTIAL" || verdict === "TAMPERED")
|
|
40649
|
-
failed++;
|
|
40650
|
-
else
|
|
40651
|
-
other++;
|
|
40652
|
-
}
|
|
40653
|
-
}
|
|
40654
|
-
if (r.verdict === "SPEC_CONFLICT")
|
|
40655
|
-
blocked++;
|
|
40656
|
-
if (r.costUsd !== null) {
|
|
40657
|
-
mUsd += r.costUsd;
|
|
40658
|
-
mRuns++;
|
|
40659
|
-
} else if (r.totalSessions > 0) {
|
|
40660
|
-
pUsd += r.partialUsd;
|
|
40661
|
-
pRuns++;
|
|
40662
|
-
}
|
|
40663
|
-
}
|
|
40664
|
-
const keys = new Set(all.map((r) => `${r.sourceId}/${r.runId}`));
|
|
40665
|
-
let total = 0, signed = 0;
|
|
40666
|
-
for (const e of db.select({ s: events.sourceId, r: events.runId, data: events.data }).from(events).where(eq(events.type, "receipt.sealed")).all()) {
|
|
40667
|
-
if (!keys.has(`${e.s}/${e.r}`))
|
|
40668
|
-
continue;
|
|
40669
|
-
total++;
|
|
40670
|
-
if (e.data?.signed === true)
|
|
40671
|
-
signed++;
|
|
40672
|
-
}
|
|
40673
|
-
const r6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
40674
|
-
return {
|
|
40675
|
-
since,
|
|
40676
|
-
runs_total: all.length,
|
|
40677
|
-
runs_finished: finished,
|
|
40678
|
-
runs_running: running,
|
|
40679
|
-
by_verdict: by,
|
|
40680
|
-
blocked_waiting: blocked,
|
|
40681
|
-
verified_rate: verified + unchecked + failed ? verified / (verified + unchecked + failed) : null,
|
|
40682
|
-
breakdown: { verified, failed, already_satisfied: satisfied, other },
|
|
40683
|
-
verified_unchecked: unchecked,
|
|
40684
|
-
keys_configured: pubkeysFromEnv().configured === true,
|
|
40685
|
-
...pubkeysFromEnv().reason ? { keys_reason: pubkeysFromEnv().reason } : {},
|
|
40686
|
-
cost: {
|
|
40687
|
-
measured_usd: mRuns ? r6(mUsd) : null,
|
|
40688
|
-
measured_runs: mRuns,
|
|
40689
|
-
partial_usd: pRuns ? r6(pUsd) : null,
|
|
40690
|
-
partial_runs: pRuns,
|
|
40691
|
-
label: pRuns ? "partial" : mRuns ? "measured" : "not measured"
|
|
40692
|
-
},
|
|
40693
|
-
receipts: { total, signed }
|
|
40694
|
-
};
|
|
40695
|
-
}
|
|
40696
|
-
|
|
40697
40737
|
// ../../loki-ts/src/util/credential_env.ts
|
|
40698
40738
|
import { mkdtempSync, rmSync, statSync, lstatSync } from "fs";
|
|
40699
40739
|
import { tmpdir } from "os";
|
|
@@ -41249,6 +41289,7 @@ var str = (x) => typeof x === "string" ? x : null;
|
|
|
41249
41289
|
function loadEvents(db, sourceId2, runId) {
|
|
41250
41290
|
return db.select().from(events).where(and(eq(events.sourceId, sourceId2), eq(events.runId, runId))).orderBy(asc(events.seq)).all().map((r) => ({ v: 1, seq: r.seq, ts: r.ts, run: r.runId, type: r.type, stage: r.stage, data: r.data }));
|
|
41251
41291
|
}
|
|
41292
|
+
var ESCALATION_EVENTS = new Set(["escalated", "route.escalated"]);
|
|
41252
41293
|
var reasonsOf = (j) => {
|
|
41253
41294
|
try {
|
|
41254
41295
|
const x = JSON.parse(j ?? "[]");
|
|
@@ -41279,6 +41320,12 @@ var parseRun = (r) => ({
|
|
|
41279
41320
|
token_sessions: r.tokenSessions,
|
|
41280
41321
|
input_tokens: r.inputTokens,
|
|
41281
41322
|
output_tokens: r.outputTokens,
|
|
41323
|
+
cache_read_tokens: r.cacheReadTokens,
|
|
41324
|
+
cache_creation_tokens: r.cacheCreationTokens,
|
|
41325
|
+
cache_read_share: cacheReadShare(r),
|
|
41326
|
+
fix_rounds: r.fixRounds,
|
|
41327
|
+
escalations: r.escalations,
|
|
41328
|
+
size: r.size,
|
|
41282
41329
|
wall_s: r.wallS,
|
|
41283
41330
|
last_seq: r.lastSeq,
|
|
41284
41331
|
last_event_at: r.lastEventAt,
|