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
|
@@ -41,8 +41,13 @@ export const runs = sqliteTable("runs", {
|
|
|
41
41
|
measuredSessions: integer("measured_sessions").notNull(),
|
|
42
42
|
totalSessions: integer("total_sessions").notNull(),
|
|
43
43
|
tokenSessions: integer("token_sessions"), // FC-44: cost events that carried usage; null on rows ingested before it existed
|
|
44
|
-
inputTokens: integer("input_tokens").notNull(),
|
|
44
|
+
inputTokens: integer("input_tokens").notNull(), // L002: uncached input only (0007 recomputes older rows, which folded cache tokens in)
|
|
45
45
|
outputTokens: integer("output_tokens").notNull(),
|
|
46
|
+
cacheReadTokens: integer("cache_read_tokens").notNull().default(0),
|
|
47
|
+
cacheCreationTokens: integer("cache_creation_tokens").notNull().default(0),
|
|
48
|
+
fixRounds: integer("fix_rounds").notNull().default(0), // fix.round events
|
|
49
|
+
escalations: integer("escalations").notNull().default(0), // escalated + route.escalated events
|
|
50
|
+
size: text("size"), // the plan stage's task size (small, normal, large); null when the run never sized
|
|
46
51
|
wallS: real("wall_s"),
|
|
47
52
|
lastSeq: integer("last_seq").notNull(),
|
|
48
53
|
lastEventAt: text("last_event_at"),
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Unmeasured = no priced session (subscription or local provider): never summed as 0.
|
|
4
4
|
import { gte } from "drizzle-orm";
|
|
5
5
|
import { runs } from "../../db/schema.ts";
|
|
6
|
-
import { effectiveVerdict, SUCCESS_VERDICTS } from "../integrity.ts";
|
|
7
6
|
import type { RouteCtx } from "./index.ts";
|
|
7
|
+
import { costPerVerified } from "./stats.ts";
|
|
8
8
|
|
|
9
9
|
export const COST_DIMS = ["day", "model", "repo", "provider"] as const;
|
|
10
10
|
type CostDim = (typeof COST_DIMS)[number];
|
|
@@ -14,39 +14,40 @@ export const DEFAULT_API_KEY_CAP_USD = 100;
|
|
|
14
14
|
|
|
15
15
|
const NONE = "unknown";
|
|
16
16
|
type Run = typeof runs.$inferSelect;
|
|
17
|
-
type Acc = { key: Record<string, string>; runs: number; measured_runs: number; partial_runs: number; unmeasured_runs: number; measured_usd: number; partial_usd: number; input_tokens: number; output_tokens: number; tk: number; tn: number };
|
|
18
|
-
const mk = (key: Record<string, string>): Acc => ({ 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 });
|
|
17
|
+
type Acc = { key: Record<string, string>; runs: number; measured_runs: number; partial_runs: number; unmeasured_runs: number; measured_usd: number; partial_usd: number; input_tokens: number; output_tokens: number; cache_read_tokens: number; cache_creation_tokens: number; tk: number; tn: number };
|
|
18
|
+
const mk = (key: Record<string, string>): Acc => ({ 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 });
|
|
19
19
|
const add = (a: Acc, r: Run) => {
|
|
20
20
|
a.runs++;
|
|
21
21
|
if (r.costUsd !== null) { a.measured_runs++; a.measured_usd += r.costUsd; }
|
|
22
22
|
else if (r.measuredSessions > 0) { a.partial_runs++; a.partial_usd += r.partialUsd; }
|
|
23
23
|
else a.unmeasured_runs++;
|
|
24
|
-
a.input_tokens += r.inputTokens;
|
|
24
|
+
a.input_tokens += r.inputTokens; // L002: uncached input; cache reads and writes are summed apart
|
|
25
25
|
a.output_tokens += r.outputTokens;
|
|
26
|
+
a.cache_read_tokens += r.cacheReadTokens;
|
|
27
|
+
a.cache_creation_tokens += r.cacheCreationTokens;
|
|
26
28
|
if (r.tokenSessions !== null) { a.tk += r.tokenSessions; a.tn += r.totalSessions; } // FC-44: sessions that carried usage, of all cost events
|
|
27
29
|
};
|
|
28
30
|
const dimVal = (d: CostDim, r: Run): string =>
|
|
29
31
|
d === "day" ? (r.startedAt ? r.startedAt.slice(0, 10) : NONE) : d === "model" ? (r.model ?? NONE) : d === "provider" ? (r.provider ?? NONE) : (r.originRepo ?? NONE);
|
|
30
32
|
const round = (n: number) => Math.round(n * 1e6) / 1e6;
|
|
31
|
-
const out = (a: Acc) => ({ ...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 } : {}) });
|
|
33
|
+
const out = (a: Acc) => ({ ...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 } : {}) });
|
|
32
34
|
|
|
33
35
|
export function mount(ctx: RouteCtx): void {
|
|
34
|
-
// B8: per-repo breakdown. total_usd sums measured runs only (never invents a zero); avg_usd is over measured runs
|
|
36
|
+
// B8: per-repo breakdown. total_usd sums measured runs only (never invents a zero); avg_usd is over measured runs.
|
|
37
|
+
// L002: verified_runs and usd_per_verified come from stats.ts costPerVerified, the one cost-per-VERIFIED definition (plain VERIFIED only, finished priced runs).
|
|
35
38
|
ctx.app.get("/v1/cost/repos", (c) => {
|
|
36
|
-
const g = new Map<string,
|
|
39
|
+
const g = new Map<string, Run[]>();
|
|
37
40
|
for (const r of ctx.db.select().from(runs).all()) {
|
|
38
41
|
const k = r.originRepo ?? "(unknown)";
|
|
39
|
-
|
|
40
|
-
a.runs++;
|
|
41
|
-
if (r.costUsd !== null) { a.priced++; a.usd += r.costUsd; }
|
|
42
|
-
const ev = effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 });
|
|
43
|
-
if (ev !== null && SUCCESS_VERDICTS.has(ev)) a.verified++;
|
|
44
|
-
g.set(k, a);
|
|
42
|
+
g.set(k, [...(g.get(k) ?? []), r]);
|
|
45
43
|
}
|
|
46
|
-
const rows = [...g.entries()].sort((x, y) => x[0].localeCompare(y[0])).map(([repo,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
const rows = [...g.entries()].sort((x, y) => x[0].localeCompare(y[0])).map(([repo, rs]) => {
|
|
45
|
+
const priced = rs.filter((r) => r.costUsd !== null), usd = priced.reduce((t, r) => t + r.costUsd!, 0), cpv = costPerVerified(rs);
|
|
46
|
+
return {
|
|
47
|
+
repo, runs: rs.length, total_usd: round(usd), avg_usd: priced.length ? round(usd / priced.length) : null,
|
|
48
|
+
verified_runs: cpv.verified_runs, usd_per_verified: cpv.value, usd_per_verified_n: cpv.n,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
50
51
|
return c.json({ rows });
|
|
51
52
|
});
|
|
52
53
|
ctx.app.get("/v1/stats/cost", (c) => {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// GET /v1/stats?since=<ISO>: counts, verified rate, cost (measured and partial kept apart) and the receipts count, folded from the runs projection and stored events.
|
|
2
2
|
// An unpriced run is never summed as zero: its known part is reported as partial, and a window with nothing priced reads null.
|
|
3
|
+
// GET /v1/stats/outcomes?since=<ISO>&repo=<origin>: L002 outcome metrics (sessions, fix rounds, escalations, cache-read share, cost per VERIFIED run,
|
|
4
|
+
// first-pass rate, wall time percentiles), for the window and per repo. `loki stats --outcomes` computes the same numbers from local runs through computeOutcomes.
|
|
3
5
|
import { eq } from "drizzle-orm";
|
|
4
6
|
import type { Db } from "../../db/migrate.ts";
|
|
5
7
|
import { events, runs } from "../../db/schema.ts";
|
|
6
8
|
import { effectiveVerdict, pubkeysFromEnv } from "../integrity.ts";
|
|
7
|
-
import type {
|
|
9
|
+
import type { Hono } from "hono";
|
|
8
10
|
|
|
9
11
|
export interface Stats {
|
|
10
12
|
since: string | null;
|
|
@@ -35,6 +37,29 @@ export interface Stats {
|
|
|
35
37
|
receipts: { total: number; signed: number };
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
type Run = typeof runs.$inferSelect;
|
|
41
|
+
/** The run fields the outcome metrics read: a stored runs row, or runs.ts projectRun over a local events.jsonl (loki stats --outcomes). */
|
|
42
|
+
export type OutcomeRow = Pick<Run, "originRepo" | "startedAt" | "endedAt" | "verdict" | "tampered" | "attested" | "sigChecked" | "costUsd" | "totalSessions" | "fixRounds" | "escalations" | "inputTokens" | "cacheReadTokens" | "cacheCreationTokens" | "wallS" | "size">;
|
|
43
|
+
type VerdictFields = Pick<Run, "verdict" | "tampered" | "attested" | "sigChecked">;
|
|
44
|
+
|
|
45
|
+
/** FC-08 effective verdict: a tampered log reads TAMPERED, an unattested or unchecked success is never counted as plain VERIFIED (L3, L7). */
|
|
46
|
+
const displayVerdict = (r: VerdictFields): string | null =>
|
|
47
|
+
r.verdict ? effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 }) : null;
|
|
48
|
+
export type OutcomeClass = "verified" | "unchecked" | "satisfied" | "failed" | "other";
|
|
49
|
+
/** The one outcome classifier: verified = plain VERIFIED (attested, signature-checked); unchecked = VERIFIED (signature not checked); satisfied = ALREADY_SATISFIED in either
|
|
50
|
+
* signature state; failed = FAILED, PARTIAL, TAMPERED; other = SPEC_CONFLICT, UNVERIFIED, unattested and anything else. Null when the run has no verdict. */
|
|
51
|
+
export function outcomeClass(r: VerdictFields): OutcomeClass | null {
|
|
52
|
+
const v = displayVerdict(r);
|
|
53
|
+
if (v === null) return null;
|
|
54
|
+
if (v === "VERIFIED") return "verified";
|
|
55
|
+
if (v === "VERIFIED (signature not checked)") return "unchecked";
|
|
56
|
+
if (v === "ALREADY_SATISFIED" || v === "ALREADY_SATISFIED (signature not checked)") return "satisfied";
|
|
57
|
+
if (v === "FAILED" || v === "PARTIAL" || v === "TAMPERED") return "failed";
|
|
58
|
+
return "other";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const r6 = (n: number): number => Math.round(n * 1e6) / 1e6;
|
|
62
|
+
|
|
38
63
|
export function computeStats(db: Db, since: string | null): Stats {
|
|
39
64
|
const all = db.select().from(runs).all().filter((r) => !since || (r.startedAt !== null && r.startedAt >= since));
|
|
40
65
|
const by: Record<string, number> = {};
|
|
@@ -42,17 +67,15 @@ export function computeStats(db: Db, since: string | null): Stats {
|
|
|
42
67
|
let mUsd = 0, mRuns = 0, pUsd = 0, pRuns = 0;
|
|
43
68
|
for (const r of all) {
|
|
44
69
|
if (r.endedAt) finished++; else running++;
|
|
45
|
-
|
|
46
|
-
const verdict = r.verdict ? effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 }) : null;
|
|
70
|
+
const verdict = displayVerdict(r);
|
|
47
71
|
if (verdict) {
|
|
48
72
|
by[verdict] = (by[verdict] ?? 0) + 1;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
73
|
+
const k = r.endedAt ? outcomeClass(r) : null;
|
|
74
|
+
if (k === "verified") verified++;
|
|
75
|
+
else if (k === "unchecked") unchecked++;
|
|
76
|
+
else if (k === "satisfied") satisfied++;
|
|
77
|
+
else if (k === "failed") failed++;
|
|
78
|
+
else if (k === "other") other++;
|
|
56
79
|
}
|
|
57
80
|
if (r.verdict === "SPEC_CONFLICT") blocked++;
|
|
58
81
|
if (r.costUsd !== null) { mUsd += r.costUsd; mRuns++; }
|
|
@@ -65,7 +88,6 @@ export function computeStats(db: Db, since: string | null): Stats {
|
|
|
65
88
|
total++;
|
|
66
89
|
if ((e.data as { signed?: unknown } | null)?.signed === true) signed++;
|
|
67
90
|
}
|
|
68
|
-
const r6 = (n: number): number => Math.round(n * 1e6) / 1e6;
|
|
69
91
|
return {
|
|
70
92
|
since, runs_total: all.length, runs_finished: finished, runs_running: running, by_verdict: by, blocked_waiting: blocked,
|
|
71
93
|
verified_rate: verified + unchecked + failed ? verified / (verified + unchecked + failed) : null,
|
|
@@ -78,10 +100,147 @@ export function computeStats(db: Db, since: string | null): Stats {
|
|
|
78
100
|
};
|
|
79
101
|
}
|
|
80
102
|
|
|
81
|
-
|
|
103
|
+
// ---- L002 outcome metrics ----
|
|
104
|
+
// Definitions are shared with benchmarks/h2h/h2h.py where they overlap: sessions = cost events in the run's events.jsonl (h2h loki_metrics priced + unpriced; the
|
|
105
|
+
// child-session ledger is not in events.jsonl), p50 = the median (h2h statistics.median), every other percentile = h2h pct(). Every value carries its n, and
|
|
106
|
+
// n = 0 reads "not measured" with a null value.
|
|
107
|
+
|
|
108
|
+
/** h2h.py pct(): the sorted value at index round(q * (n - 1)), with Python's round half to even. Null for no values. */
|
|
109
|
+
export function pct(vals: readonly number[], q: number): number | null {
|
|
110
|
+
if (vals.length === 0) return null;
|
|
111
|
+
const s = [...vals].sort((a, b) => a - b), x = q * (s.length - 1), f = Math.floor(x), d = x - f;
|
|
112
|
+
const k = d > 0.5 ? f + 1 : d < 0.5 ? f : f % 2 === 0 ? f : f + 1;
|
|
113
|
+
return s[Math.max(0, Math.min(s.length - 1, k))]!;
|
|
114
|
+
}
|
|
115
|
+
/** h2h.py statistics.median: the middle value, or the mean of the two middle values. Null for no values. */
|
|
116
|
+
export function median(vals: readonly number[]): number | null {
|
|
117
|
+
if (vals.length === 0) return null;
|
|
118
|
+
const s = [...vals].sort((a, b) => a - b), m = s.length >> 1;
|
|
119
|
+
return s.length % 2 ? s[m]! : r6((s[m - 1]! + s[m]!) / 2);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type Label = "measured" | "not measured";
|
|
123
|
+
const label = (n: number): Label => (n > 0 ? "measured" : "not measured");
|
|
124
|
+
export type Percentiles<K extends string> = { [P in "p50" | K]: number | null } & { n: number; label: Label };
|
|
125
|
+
const spread = <K extends string>(vals: number[], hi: K, q: number): Percentiles<K> =>
|
|
126
|
+
({ p50: median(vals), [hi]: pct(vals, q), n: vals.length, label: label(vals.length) }) as Percentiles<K>;
|
|
127
|
+
export interface Count { total: number; mean: number | null; n: number; label: Label }
|
|
128
|
+
const count = (vals: number[]): Count => {
|
|
129
|
+
const t = vals.reduce((a, b) => a + b, 0);
|
|
130
|
+
return { total: t, mean: vals.length ? r6(t / vals.length) : null, n: vals.length, label: label(vals.length) };
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export interface CostPerVerified {
|
|
134
|
+
/** Spend of finished priced runs divided by the plain VERIFIED runs among them. ALREADY_SATISFIED and signature-unchecked successes are not successes here. Null when n = 0. */
|
|
135
|
+
value: number | null;
|
|
136
|
+
/** The denominator: finished, priced, plain VERIFIED runs. */
|
|
137
|
+
n: number;
|
|
138
|
+
label: Label;
|
|
139
|
+
/** Sum of cost_usd over finished, priced (every session priced), non-tampered runs, whatever their verdict; null when none is priced. */
|
|
140
|
+
spend_usd: number | null;
|
|
141
|
+
priced_runs: number;
|
|
142
|
+
/** Finished non-tampered runs without a full price (subscription, local provider or an unpriced session): left out of both sides. */
|
|
143
|
+
unpriced_runs: number;
|
|
144
|
+
/** Every finished plain VERIFIED run, priced or not. */
|
|
145
|
+
verified_runs: number;
|
|
146
|
+
}
|
|
147
|
+
/** THE cost per VERIFIED run. /v1/stats/outcomes, /v1/cost/repos and `loki stats --outcomes` all read it; nothing else divides spend by verified runs. */
|
|
148
|
+
export function costPerVerified(rows: readonly OutcomeRow[]): CostPerVerified {
|
|
149
|
+
let spend = 0, priced = 0, unpriced = 0, verified = 0, pricedVerified = 0;
|
|
150
|
+
for (const r of rows) {
|
|
151
|
+
if (!r.endedAt || r.tampered === 1) continue; // a tampered log reports no trusted dollars (engine10 partialCost)
|
|
152
|
+
const ok = outcomeClass(r) === "verified";
|
|
153
|
+
if (ok) verified++;
|
|
154
|
+
if (r.costUsd === null) { unpriced++; continue; }
|
|
155
|
+
priced++; spend += r.costUsd;
|
|
156
|
+
if (ok) pricedVerified++;
|
|
157
|
+
}
|
|
158
|
+
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 };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** cache_read / (input + cache_read + cache_creation) for one run; null when it recorded no input tokens. */
|
|
162
|
+
export const cacheReadShare = (r: Pick<Run, "inputTokens" | "cacheReadTokens" | "cacheCreationTokens">): number | null => {
|
|
163
|
+
const d = r.inputTokens + r.cacheReadTokens + r.cacheCreationTokens;
|
|
164
|
+
return d > 0 ? r6(r.cacheReadTokens / d) : null;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export interface Outcomes {
|
|
168
|
+
runs_finished: number;
|
|
169
|
+
/** Finished runs whose log failed integrity: counted as failures in first_pass_rate, left out of every per-run count (their numbers are untrusted). */
|
|
170
|
+
runs_tampered: number;
|
|
171
|
+
sessions: Percentiles<"p90">;
|
|
172
|
+
fix_rounds: Count;
|
|
173
|
+
escalations: Count;
|
|
174
|
+
cache_read_share: { value: number | null; n: number; label: Label; cache_read_tokens: number; input_tokens_total: number };
|
|
175
|
+
cost_per_verified_usd: CostPerVerified;
|
|
176
|
+
first_pass_rate: { value: number | null; n: number; label: Label; first_pass_runs: number };
|
|
177
|
+
wall_s: { all: Percentiles<"p95">; by_size: Record<string, Percentiles<"p95">> };
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const OUTCOME_DEFINITIONS = {
|
|
181
|
+
sessions: "cost events per finished run (h2h sessions); p50 is the median, p90 is h2h pct()",
|
|
182
|
+
fix_rounds: "fix.round events per finished run",
|
|
183
|
+
escalations: "escalated plus route.escalated events per finished run",
|
|
184
|
+
cache_read_share: "cache_read_tokens over input + cache_read + cache_creation tokens, summed over finished runs that recorded input tokens",
|
|
185
|
+
cost_per_verified_usd: "spend of finished priced runs over the plain VERIFIED runs among them; ALREADY_SATISFIED is not a success here",
|
|
186
|
+
first_pass_rate: "plain VERIFIED runs with 0 fix rounds over finished verifiable runs (VERIFIED, VERIFIED signature not checked, FAILED, PARTIAL, TAMPERED)",
|
|
187
|
+
wall_s: "run.completed wall_s of finished runs: p50 (median) and p95 (h2h pct()), overall and by the plan stage's task size",
|
|
188
|
+
n: "every value carries its n; n = 0 reads not measured and the value is null",
|
|
189
|
+
} as const;
|
|
190
|
+
|
|
191
|
+
/** Outcome metrics over the given runs. Running runs are left out; a tampered run counts only as a failure. */
|
|
192
|
+
export function computeOutcomes(rows: readonly OutcomeRow[]): Outcomes {
|
|
193
|
+
const fin = rows.filter((r) => r.endedAt);
|
|
194
|
+
const ok = fin.filter((r) => r.tampered !== 1);
|
|
195
|
+
let fp = 0, verifiable = 0, cr = 0, tot = 0, crN = 0;
|
|
196
|
+
for (const r of fin) {
|
|
197
|
+
const k = outcomeClass(r);
|
|
198
|
+
if (k === "verified" || k === "unchecked" || k === "failed") verifiable++;
|
|
199
|
+
if (k === "verified" && r.fixRounds === 0) fp++;
|
|
200
|
+
}
|
|
201
|
+
for (const r of ok) {
|
|
202
|
+
const d = r.inputTokens + r.cacheReadTokens + r.cacheCreationTokens;
|
|
203
|
+
if (d > 0) { cr += r.cacheReadTokens; tot += d; crN++; }
|
|
204
|
+
}
|
|
205
|
+
const walled = ok.filter((r) => r.wallS !== null);
|
|
206
|
+
const sizeOf = (r: OutcomeRow): string => r.size ?? "unknown";
|
|
207
|
+
const sizes = [...new Set(walled.map(sizeOf))].sort();
|
|
208
|
+
return {
|
|
209
|
+
runs_finished: fin.length, runs_tampered: fin.length - ok.length,
|
|
210
|
+
sessions: spread(ok.map((r) => r.totalSessions), "p90", 0.9),
|
|
211
|
+
fix_rounds: count(ok.map((r) => r.fixRounds)),
|
|
212
|
+
escalations: count(ok.map((r) => r.escalations)),
|
|
213
|
+
cache_read_share: { value: crN ? r6(cr / tot) : null, n: crN, label: label(crN), cache_read_tokens: cr, input_tokens_total: tot },
|
|
214
|
+
cost_per_verified_usd: costPerVerified(rows),
|
|
215
|
+
first_pass_rate: { value: verifiable ? r6(fp / verifiable) : null, n: verifiable, label: label(verifiable), first_pass_runs: fp },
|
|
216
|
+
wall_s: {
|
|
217
|
+
all: spread(walled.map((r) => r.wallS!), "p95", 0.95),
|
|
218
|
+
by_size: Object.fromEntries(sizes.map((z) => [z, spread(walled.filter((r) => sizeOf(r) === z).map((r) => r.wallS!), "p95", 0.95)])),
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** The whole set plus one block per repo (origin_repo; "(unknown)" when the run recorded none, as /v1/cost/repos keys it) and the field definitions. */
|
|
224
|
+
export function outcomesReport(rows: readonly OutcomeRow[]) {
|
|
225
|
+
const byRepo = new Map<string, OutcomeRow[]>();
|
|
226
|
+
for (const r of rows) { const k = r.originRepo ?? "(unknown)"; byRepo.set(k, [...(byRepo.get(k) ?? []), r]); }
|
|
227
|
+
return { ...computeOutcomes(rows), by_repo: Object.fromEntries([...byRepo.keys()].sort().map((k) => [k, computeOutcomes(byRepo.get(k)!)])), definitions: OUTCOME_DEFINITIONS };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const badSince = (s: string): boolean => !/^\d{4}-\d{2}-\d{2}/.test(s) || Number.isNaN(Date.parse(s));
|
|
231
|
+
|
|
232
|
+
// Typed by the two fields it reads (not RouteCtx) so `loki stats --outcomes` can import this file without type-checking the whole route registry.
|
|
233
|
+
export function mount(ctx: { app: Hono; db: Db }): void {
|
|
82
234
|
ctx.app.get("/v1/stats", (c) => {
|
|
83
235
|
const since = c.req.query("since") ?? null;
|
|
84
|
-
if (since !== null && (
|
|
236
|
+
if (since !== null && badSince(since)) return c.json({ error: "since must be an ISO date or timestamp" }, 400);
|
|
85
237
|
return c.json(computeStats(ctx.db, since === null ? null : new Date(since).toISOString()));
|
|
86
238
|
});
|
|
239
|
+
ctx.app.get("/v1/stats/outcomes", (c) => {
|
|
240
|
+
const since = c.req.query("since") ?? null, repo = c.req.query("repo") ?? null;
|
|
241
|
+
if (since !== null && badSince(since)) return c.json({ error: "since must be an ISO date or timestamp" }, 400);
|
|
242
|
+
const iso = since === null ? null : new Date(since).toISOString();
|
|
243
|
+
const rows = ctx.db.select().from(runs).all().filter((r) => (!iso || (r.startedAt !== null && r.startedAt >= iso)) && (repo === null || (r.originRepo ?? "(unknown)") === repo));
|
|
244
|
+
return c.json({ since: iso, repo, ...outcomesReport(rows) });
|
|
245
|
+
});
|
|
87
246
|
}
|
|
@@ -5,6 +5,7 @@ import type { Db } from "../db/migrate.ts";
|
|
|
5
5
|
import { events, runs } from "../db/schema.ts";
|
|
6
6
|
import { blockedQuestion } from "./answer.ts";
|
|
7
7
|
import { diffStatFor } from "./diffstat.ts";
|
|
8
|
+
import { cacheReadShare } from "./routes/stats.ts";
|
|
8
9
|
import { effectiveVerdict, pubkeysFromEnv, sealedPrefix, SUCCESS_VERDICTS, verifyRunIntegrity } from "./integrity.ts";
|
|
9
10
|
|
|
10
11
|
const str = (x: unknown): string | null => (typeof x === "string" ? x : null);
|
|
@@ -14,11 +15,16 @@ export function loadEvents(db: Db, sourceId: string, runId: string): EventEnvelo
|
|
|
14
15
|
.map((r) => ({ v: 1, seq: r.seq, ts: r.ts, run: r.runId, type: r.type, stage: r.stage, data: r.data }) as EventEnvelope);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/** The task size the plan stage recorded (`variant` data.size, else the plan stage's own data.size: small, normal or large); null when the run never sized. */
|
|
19
|
+
const sizeOf = (evs: EventEnvelope[]): string | null =>
|
|
20
|
+
str(evs.findLast((e) => e.type === "variant" && typeof e.data.size === "string")?.data.size) ?? str(evs.findLast((e) => e.stage === "plan" && e.type.startsWith("stage.") && typeof e.data.size === "string")?.data.size);
|
|
21
|
+
/** L002: event types counted per run. fix_rounds = fix.round lines; escalations = escalated (the worker stopped the run with a stop reason) plus route.escalated (the router climbed to a stronger model). */
|
|
22
|
+
export const ESCALATION_EVENTS: ReadonlySet<string> = new Set(["escalated", "route.escalated"]);
|
|
23
|
+
|
|
24
|
+
/** The runs-projection row for one run's events, without the ingest-owned conflict flag. The one event-to-row mapping: rebuildRun stores it and `loki stats --outcomes` reads local runs through it. */
|
|
25
|
+
export function projectRun(evs: EventEnvelope[], sourceId: string, runId: string) {
|
|
26
|
+
const sealed = sealedPrefix(evs); // the verdict comes from the authenticated prefix; lines after the sealing line are unauthenticated
|
|
27
|
+
const f = fold(sealed);
|
|
22
28
|
const keys = pubkeysFromEnv();
|
|
23
29
|
const integ = verifyRunIntegrity(evs, { pubkeyFor: keys }); // EL-FC08b: tampered is the supervisor flag OR any ingest-side integrity failure
|
|
24
30
|
const tampered = f.run.tampered || integ.tampered;
|
|
@@ -26,7 +32,7 @@ export function rebuildRun(db: Db, sourceId: string, runId: string): void {
|
|
|
26
32
|
const sd = f.run.started?.data ?? {};
|
|
27
33
|
const done = f.run.completed?.data ?? {};
|
|
28
34
|
const pr = evs.find((e) => e.type === "pr.opened")?.data;
|
|
29
|
-
|
|
35
|
+
return {
|
|
30
36
|
sourceId, runId,
|
|
31
37
|
originRepo: str(sd.origin_repo), issueRef: str(sd.issue_ref), taskSource: str(sd.task_source),
|
|
32
38
|
provider: str(sd.provider), model: str(sd.model), groupId: str(sd.group_id), unitId: str(sd.unit_id),
|
|
@@ -34,11 +40,20 @@ export function rebuildRun(db: Db, sourceId: string, runId: string): void {
|
|
|
34
40
|
verdict: f.run.verdict,
|
|
35
41
|
prUrl: str(done.pr_url) ?? str(pr?.url), prDraft: typeof pr?.draft === "boolean" ? Number(pr.draft) : null,
|
|
36
42
|
costUsd: f.cost.usd, partialUsd: pc.usd, measuredSessions: pc.measured, totalSessions: pc.total, tokenSessions: tampered ? null : evs.filter((e) => e.type === "cost" && typeof e.data.input_tokens === "number").length,
|
|
37
|
-
|
|
43
|
+
// L002: input_tokens is uncached input only; cache reads and cache writes have their own columns
|
|
44
|
+
inputTokens: f.cost.inputTokens, outputTokens: f.cost.outputTokens, cacheReadTokens: f.cost.cacheReadTokens, cacheCreationTokens: f.cost.cacheCreationTokens,
|
|
45
|
+
fixRounds: sealed.filter((e) => e.type === "fix.round").length, escalations: sealed.filter((e) => ESCALATION_EVENTS.has(e.type)).length, size: sizeOf(sealed),
|
|
38
46
|
wallS: typeof done.wall_s === "number" ? done.wall_s : null,
|
|
39
47
|
lastSeq: f.lastSeq, lastEventAt: evs[evs.length - 1]?.ts ?? null, tampered: Number(tampered),
|
|
40
48
|
attested: Number(integ.attested), sigChecked: Number(integ.sig_checked), integrityKeyFp: keys.fingerprint ?? "", integrityReasons: JSON.stringify(integ.reasons),
|
|
41
49
|
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Rebuilds the runs projection row from stored events with the real fold(). The only writer of `runs`. */
|
|
53
|
+
export function rebuildRun(db: Db, sourceId: string, runId: string): void {
|
|
54
|
+
const evs = loadEvents(db, sourceId, runId);
|
|
55
|
+
if (evs.length === 0) return;
|
|
56
|
+
const row = projectRun(evs, sourceId, runId);
|
|
42
57
|
// conflict is owned by ingest, so it is left out of the update set and survives a rebuild
|
|
43
58
|
db.insert(runs).values(row).onConflictDoUpdate({ target: [runs.sourceId, runs.runId], set: row }).run();
|
|
44
59
|
}
|
|
@@ -50,7 +65,8 @@ const parseRun = (r: typeof runs.$inferSelect) => ({
|
|
|
50
65
|
group_id: r.groupId, unit_id: r.unitId, provider: r.provider, model: r.model, started_at: r.startedAt, ended_at: r.endedAt, verdict: r.verdict,
|
|
51
66
|
pr_url: r.prUrl, pr_draft: r.prDraft === null ? null : r.prDraft === 1,
|
|
52
67
|
cost_usd: r.costUsd, partial_usd: r.partialUsd, measured_sessions: r.measuredSessions, total_sessions: r.totalSessions, token_sessions: r.tokenSessions,
|
|
53
|
-
input_tokens: r.inputTokens, output_tokens: r.outputTokens,
|
|
68
|
+
input_tokens: r.inputTokens, output_tokens: r.outputTokens, cache_read_tokens: r.cacheReadTokens, cache_creation_tokens: r.cacheCreationTokens,
|
|
69
|
+
cache_read_share: cacheReadShare(r), fix_rounds: r.fixRounds, escalations: r.escalations, size: r.size, wall_s: r.wallS, last_seq: r.lastSeq,
|
|
54
70
|
last_event_at: r.lastEventAt, tampered: r.tampered === 1, conflict: r.conflict === 1,
|
|
55
71
|
attested: r.attested === 1, sig_checked: r.sigChecked === 1, integrity_reasons: reasonsOf(r.integrityReasons),
|
|
56
72
|
effective_verdict: effectiveVerdict({ verdict: r.verdict, tampered: r.tampered === 1, attested: r.attested === 1, sig_checked: r.sigChecked === 1 }),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "loki-mode",
|
|
4
4
|
"displayName": "Loki Mode",
|
|
5
|
-
"version": "11.
|
|
5
|
+
"version": "11.112.0",
|
|
6
6
|
"description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Autonomi",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-
|
|
1
|
+
import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-Cqm7mcD3.js";import{B as C}from"./Button-Cu-QdpUO.js";import{T as $e}from"./trending-up-0ERKZkIv.js";import{C as z}from"./clock-DAwVo66N.js";import{A as Be,U as ue,M as De}from"./Avatar-BBaMPJfc.js";import{A as J}from"./activity-hdD5wW2u.js";import{R as pe}from"./refresh-cw-C1EY9mdH.js";import{G as ze}from"./globe-C8duz8y-.js";import{C as Le}from"./chevron-left-Cqg-qMiB.js";import{C as je}from"./check-Bx8Vedfz.js";import{D as Y}from"./dollar-sign-BgRpI1Or.js";import{U as Te}from"./user-ByTDBOqh.js";import{D as Me}from"./database-KAOYEZLe.js";import{L as Ue}from"./lock-1pGkRsNY.js";import{S as Re}from"./scroll-text-CprzZkhZ.js";import{S as Ie}from"./shield-alert-B8wSICzV.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-Cqm7mcD3.js";import{C as r}from"./clock-DAwVo66N.js";import{C as a}from"./circle-alert-DJPTd64w.js";import{C as l}from"./check-Bx8Vedfz.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,j as t}from"./index-
|
|
1
|
+
import{r as p,j as t}from"./index-Cqm7mcD3.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-
|
|
1
|
+
import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-Cqm7mcD3.js";import{P as K,S as He,E as Be}from"./ErrorBoundary-Coi36uQa.js";import{C as qe,F as Ge,M as Ue,H as Ke,a as We,G as Ve,T as Qe}from"./thumbs-up-DYxl-grX.js";import{C as oe}from"./check-Bx8Vedfz.js";import{C as Ye}from"./clock-DAwVo66N.js";import{D as Xe}from"./dollar-sign-BgRpI1Or.js";import{U as Ze}from"./upload-DS5z-6i4.js";import{L as V}from"./loader-circle-yhfpH3HU.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e}from"./index-qz83Pq2m.js";function f({value:r,prefix:t="",suffix:s=""}){const[u,n]=o.useState(0),c=o.useRef(0);return o.useEffect(()=>{const a=c.current,h=r-a;if(h===0)return;const i=600,d=performance.now();function l(b){const v=b-d,m=Math.min(v/i,1),N=1-Math.pow(1-m,3),p=Math.round(a+h*N);n(p),c.current=p,m<1&&requestAnimationFrame(l)}requestAnimationFrame(l)},[r]),e.jsxs("span",{className:"tabular-nums",children:[t,u.toLocaleString(),s]})}function g(){const[r,t]=o.useState(5),[s,u]=o.useState(30),[n,c]=o.useState(75),a=.4,i=Math.round(r*s*a*4.33),d=Math.round(i*n);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[r," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:r,onChange:l=>t(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:l=>u(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",n,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:n,onChange:l=>c(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(f,{value:i,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(f,{value:d,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. cost saved / month"})]})]}),e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:[e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["If Loki Mode saved ",Math.round(a*100),"% of coding time, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[i.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",d.toLocaleString()]})," ","per month."]}),e.jsxs("p",{className:"mt-2 text-xs text-[#6B6960] text-center",children:["The ",Math.round(a*100),"% is an assumption, not a measurement. Model and API spend is not included."]})]})]})]})}const j=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"GPT-4o / Codex",category:"AI Models",lokiMode:!0,boltNew:!0,replit:!0,lovable:!1},{feature:"5-provider auto-failover",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"8 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function y(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function w(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function x({value:r}){return typeof r=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:r}):r?e.jsx(y,{}):e.jsx(w,{})}const k=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"8 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function C(){const r=[...new Set(j.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:r.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),j.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:k.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(g,{})})]})})}export{C as default};
|
|
1
|
+
import{r as o,j as e}from"./index-Cqm7mcD3.js";function f({value:r,prefix:t="",suffix:s=""}){const[u,n]=o.useState(0),c=o.useRef(0);return o.useEffect(()=>{const a=c.current,h=r-a;if(h===0)return;const i=600,d=performance.now();function l(b){const v=b-d,m=Math.min(v/i,1),N=1-Math.pow(1-m,3),p=Math.round(a+h*N);n(p),c.current=p,m<1&&requestAnimationFrame(l)}requestAnimationFrame(l)},[r]),e.jsxs("span",{className:"tabular-nums",children:[t,u.toLocaleString(),s]})}function g(){const[r,t]=o.useState(5),[s,u]=o.useState(30),[n,c]=o.useState(75),a=.4,i=Math.round(r*s*a*4.33),d=Math.round(i*n);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[r," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:r,onChange:l=>t(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:l=>u(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",n,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:n,onChange:l=>c(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(f,{value:i,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(f,{value:d,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. cost saved / month"})]})]}),e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:[e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["If Loki Mode saved ",Math.round(a*100),"% of coding time, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[i.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",d.toLocaleString()]})," ","per month."]}),e.jsxs("p",{className:"mt-2 text-xs text-[#6B6960] text-center",children:["The ",Math.round(a*100),"% is an assumption, not a measurement. Model and API spend is not included."]})]})]})]})}const j=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"GPT-4o / Codex",category:"AI Models",lokiMode:!0,boltNew:!0,replit:!0,lovable:!1},{feature:"5-provider auto-failover",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"8 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function y(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function w(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function x({value:r}){return typeof r=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:r}):r?e.jsx(y,{}):e.jsx(w,{})}const k=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"8 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function C(){const r=[...new Set(j.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:r.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),j.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:k.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(g,{})})]})})}export{C as default};
|
package/web-app/dist/assets/{EvidenceReceiptPanel-DKTIY04g.js → EvidenceReceiptPanel-BjfnylRS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,a as x,j as e}from"./index-
|
|
1
|
+
import{r as l,a as x,j as e}from"./index-Cqm7mcD3.js";const N={verified:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Verified",proven:"The server recomputed the integrity hash and it matches, and the gpg signature verified against its keyring.",notProven:"That the code is correct, or that the recorded diff still matches your repo. A receipt records which checks ran, not that the result is right."},unsigned:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Unsigned",proven:"The server recomputed the integrity hash and it matches these receipt bytes.",notProven:"Who produced it. An unsigned receipt is forgeable: whoever controls the builder can rewrite the facts and recompute the hash."},unchecked:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Not checked",proven:"The server recomputed the integrity hash and it matches.",notProven:"Provenance. A signature is present but was not evaluated here, which is not the same as a bad signature."},tampered:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Tampered",proven:"Nothing. The server recomputed the integrity hash and it does not match the contents.",notProven:"Anything at all. This receipt was edited after it was written. Do not trust this build."},failed:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Failed verification",proven:"Nothing. A verification check ran on the server and said no.",notProven:"Anything the receipt claims. Read the reason below."},not_verified:{badge:"border-muted/20 text-muted",dot:"bg-muted/40",label:"Not verified here",proven:"Nothing. No verification result was computed for this receipt here.",notProven:"Integrity or provenance. Run the command below to check it yourself."}};function w(t){const n=t==null?void 0:t.integrity_check,r=t==null?void 0:t.verification;return n?n.status==="tampered"?"tampered":n.status==="failed"?"failed":n.status!=="verified"?"not_verified":n.gpg_ok===!0?"verified":r!=null&&r.attestation||r!=null&&r.gpg_signature?"unchecked":"unsigned":"not_verified"}const v=[{key:"verified",label:"Verified",bar:"bg-success",text:"text-success"},{key:"with_gaps",label:"With gaps",bar:"bg-warning",text:"text-warning"},{key:"not_verified",label:"Not verified",bar:"bg-danger",text:"text-danger"},{key:"unknown",label:"Unknown",bar:"bg-muted/40",text:"text-muted"}];function y({summary:t}){const n=t.total_receipts;return n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-muted/10",children:v.map(({key:r,bar:s})=>{const i=t[r];return i?e.jsx("div",{className:s,style:{width:`${i/n*100}%`},title:`${i} ${r}`},r):null})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:v.map(({key:r,label:s,text:i})=>{const c=t[r];return c?e.jsxs("span",{className:i,children:[e.jsx("span",{className:"font-semibold",children:c})," ",s.toLowerCase()]},r):null})}),e.jsxs("p",{className:"text-muted text-xs",children:["Recorded verdicts across ",n," receipt",n===1?"":"s",", not re-verified here."]})]}):null}function u({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline gap-2 text-xs",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:t}),e.jsx("span",{className:"font-mono truncate",title:n,children:n})]})}function k({proof:t}){var m,p,g,f,b;const[n,r]=l.useState(!1),[s,i]=l.useState(null),[c,d]=l.useState(null);l.useEffect(()=>{if(!n||s||c)return;let o=!1;return x.getProof(t.run_id).then(h=>{o||i(h)}).catch(h=>{o||d((h==null?void 0:h.message)||"could not load this receipt")}),()=>{o=!0}},[n,t.run_id,s,c]);const a=N[w(s)],j=t.generated_at?new Date(t.generated_at).toLocaleString():"unknown";return e.jsxs("div",{className:`border rounded-card overflow-hidden ${s?a.badge:"border-muted/20"}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>r(!n),"aria-expanded":n,children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?a.dot:"bg-muted/40"}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.headline?`Recorded: ${t.headline}`:t.run_id}),t.final_verdict&&e.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider flex-shrink-0 text-muted",children:["council ",t.final_verdict]}),e.jsx("span",{className:"text-muted text-xs flex-shrink-0",children:n?"−":"+"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-current/10 pt-3",children:[c&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load this receipt: ",c]}),!c&&!s&&e.jsx("p",{className:"text-xs text-muted",children:"Loading receipt…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(u,{label:"Run",value:s.run_id}),e.jsx(u,{label:"Generated",value:j}),e.jsx(u,{label:"Loki version",value:s.loki_version||"unknown"}),e.jsx(u,{label:"Cost",value:typeof((m=s.cost)==null?void 0:m.usd)=="number"?`${s.cost.cost_partial===!0?"at least ":""}$${s.cost.usd.toFixed(2)}`:"unknown"}),e.jsx(u,{label:"Files changed",value:typeof((p=s.files_changed)==null?void 0:p.count)=="number"?String(s.files_changed.count):"unknown"}),((g=s.verification)==null?void 0:g.hash)&&e.jsx(u,{label:"Recorded hash",value:s.verification.hash})]}),e.jsxs("div",{className:`rounded-card border px-3 py-2 ${a.badge}`,children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-1",children:a.label}),e.jsxs("p",{className:"text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",children:"Proven: "}),a.proven]}),e.jsxs("p",{className:"text-xs opacity-80",children:[e.jsx("span",{className:"font-semibold",children:"Not proven: "}),a.notProven]}),(((f=s.integrity_check)==null?void 0:f.reasons)||[]).slice(0,2).map(o=>e.jsx("p",{className:"text-xs opacity-80 mt-1",children:o},o))]}),e.jsxs("p",{className:"text-xs text-muted",children:["Verify it yourself (also re-derives the diff against your repo):"," ",e.jsxs("code",{className:"font-mono",children:["loki proof verify ",s.run_id,(b=s.verification)!=null&&b.attestation?" --jwks <url|file>":""]})]}),t.pr_url&&e.jsx("a",{href:t.pr_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-primary underline",children:"View the pull request"})]})]})]})}function P(){const[t,n]=l.useState(null),[r,s]=l.useState(null),[i,c]=l.useState(null);return l.useEffect(()=>{let d=!1;return x.listProofs().then(a=>{d||n(a.proofs||[])}).catch(a=>{d||c((a==null?void 0:a.message)||"could not load receipts")}),x.proofsSummary().then(a=>{d||s(a)}).catch(()=>{}),()=>{d=!0}},[]),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Evidence Receipts"}),e.jsx("p",{className:"text-muted text-xs mt-1",children:"What each build actually checked, recorded so you can verify it yourself."})]}),i&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load receipts: ",i]}),!i&&t===null&&e.jsx("p",{className:"text-xs text-muted",children:"Loading…"}),r&&e.jsx(y,{summary:r}),t!==null&&t.length===0&&e.jsxs("p",{className:"text-xs text-muted",children:["No receipts yet. One is written at the end of each run (set ",e.jsx("code",{className:"font-mono",children:"LOKI_PROOF=0"})," to opt out)."]}),e.jsx("div",{className:"space-y-2",children:t==null?void 0:t.map(d=>e.jsx(k,{proof:d},d.run_id))})]})}export{P as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _,r as o,a as k,j as e,m as B,J as v,N as h,a5 as H,M as L,l as q}from"./index-
|
|
1
|
+
import{c as _,r as o,a as k,j as e,m as B,J as v,N as h,a5 as H,M as L,l as q}from"./index-Cqm7mcD3.js";import{B as N}from"./Button-Cu-QdpUO.js";import{C as y}from"./thumbs-up-DYxl-grX.js";import{R as S}from"./refresh-cw-C1EY9mdH.js";import{C as z}from"./circle-alert-DJPTd64w.js";import{U as D}from"./user-ByTDBOqh.js";import{L as G}from"./loader-circle-yhfpH3HU.js";import{R as T}from"./rotate-ccw-Zz24GUgC.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as I,r as c,a as b,j as e,G as me,A as ue,S as Z,k as ee,m as pe,h as he,p as fe,X as te,M as be}from"./index-
|
|
1
|
+
import{c as I,r as c,a as b,j as e,G as me,A as ue,S as Z,k as ee,m as pe,h as he,p as fe,X as te,M as be}from"./index-Cqm7mcD3.js";import{B as y}from"./Button-Cu-QdpUO.js";import{C as ge}from"./chevron-left-Cqg-qMiB.js";import{G as P}from"./thumbs-up-DYxl-grX.js";import{R as $}from"./refresh-cw-C1EY9mdH.js";import{C as Ne}from"./circle-alert-DJPTd64w.js";import{L as Q,S as je}from"./ProjectPage-DCgbdCM2.js";import{S as se}from"./shield-alert-B8wSICzV.js";import{F as ye}from"./file-code-corner-BT_JXcbS.js";import{C as V}from"./clock-DAwVo66N.js";import{C as re}from"./check-Bx8Vedfz.js";import"./ErrorBoundary-Coi36uQa.js";import"./TerminalOutput-BAhHuPOd.js";import"./lock-1pGkRsNY.js";import"./package-BZZ8rCmn.js";import"./file-plus-D567SLBE.js";import"./activity-hdD5wW2u.js";import"./scroll-text-CprzZkhZ.js";import"./bot-B4smBIHH.js";import"./loader-circle-yhfpH3HU.js";import"./hammer-DFgOZ55H.js";import"./dollar-sign-BgRpI1Or.js";import"./globe-C8duz8y-.js";import"./trash-2-BFXmB-lq.js";import"./upload-DS5z-6i4.js";import"./plus-D3dzuNA0.js";import"./rotate-ccw-Zz24GUgC.js";import"./code-xml-DZ4-8xns.js";import"./trending-up-0ERKZkIv.js";import"./layers-D5SMi3KF.js";import"./trending-down-BOFHm0lm.js";import"./server-bv2lyoFf.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|