@igorjpimenta/manifold 0.0.0-stage → 2026.11.22-beta.3
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/.migrations/ops/0000_futuristic_karma.sql +111 -0
- package/.migrations/ops/0001_low_maximus.sql +7 -0
- package/.migrations/ops/meta/0000_snapshot.json +763 -0
- package/.migrations/ops/meta/0001_snapshot.json +173 -0
- package/.migrations/ops/meta/_journal.json +20 -0
- package/.migrations/runtime/0000_real_boomer.sql +180 -0
- package/.migrations/runtime/0001_hot_dakota_north.sql +2 -0
- package/.migrations/runtime/0002_breezy_vertigo.sql +8 -0
- package/.migrations/runtime/0003_dashing_jack_flag.sql +5 -0
- package/.migrations/runtime/0004_panoramic_ego.sql +1 -0
- package/.migrations/runtime/0005_tidy_ben_grimm.sql +10 -0
- package/.migrations/runtime/0006_wet_nightmare.sql +57 -0
- package/.migrations/runtime/0007_ambiguous_chronomancer.sql +8 -0
- package/.migrations/runtime/0008_wealthy_thundra.sql +301 -0
- package/.migrations/runtime/0009_lying_shocker.sql +96 -0
- package/.migrations/runtime/0010_solid_phantom_reporter.sql +160 -0
- package/.migrations/runtime/0011_windy_demogoblin.sql +175 -0
- package/.migrations/runtime/0012_restore_harness_fks.sql +103 -0
- package/.migrations/runtime/meta/0000_snapshot.json +1181 -0
- package/.migrations/runtime/meta/0001_snapshot.json +1209 -0
- package/.migrations/runtime/meta/0002_snapshot.json +1261 -0
- package/.migrations/runtime/meta/0003_snapshot.json +1292 -0
- package/.migrations/runtime/meta/0004_snapshot.json +1240 -0
- package/.migrations/runtime/meta/0006_snapshot.json +1310 -0
- package/.migrations/runtime/meta/0007_snapshot.json +1362 -0
- package/.migrations/runtime/meta/0008_snapshot.json +1742 -0
- package/.migrations/runtime/meta/0009_snapshot.json +2413 -0
- package/.migrations/runtime/meta/0010_snapshot.json +2562 -0
- package/.migrations/runtime/meta/0011_snapshot.json +2812 -0
- package/.migrations/runtime/meta/0012_snapshot.json +2812 -0
- package/.migrations/runtime/meta/_journal.json +97 -0
- package/README.md +1583 -2
- package/RELEASING.md +89 -0
- package/agent/fleet.js +100 -0
- package/bin/cli.js +854 -0
- package/bin/manifold.js +4 -0
- package/boot/flow-revival.js +536 -0
- package/budget/index.js +495 -0
- package/budget/lib.js +59 -0
- package/dashboard/cost.js +528 -0
- package/dashboard/dist/assets/index-CUfp63sj.css +1 -0
- package/dashboard/dist/assets/index-Qy9JMpma.js +371 -0
- package/dashboard/dist/index.html +13 -0
- package/dashboard/event-log.js +267 -0
- package/dashboard/index.html +12 -0
- package/dashboard/package-lock.json +2877 -0
- package/dashboard/package.json +37 -0
- package/dashboard/pipeline-graph.js +131 -0
- package/dashboard/postcss.config.js +6 -0
- package/dashboard/search.js +183 -0
- package/dashboard/server.js +1015 -0
- package/dashboard/src/App.tsx +42 -0
- package/dashboard/src/api/client.ts +118 -0
- package/dashboard/src/api/types.ts +510 -0
- package/dashboard/src/api/ws.tsx +112 -0
- package/dashboard/src/components/CancelButton.tsx +63 -0
- package/dashboard/src/components/ClickToCopy.tsx +68 -0
- package/dashboard/src/components/CopyButton.tsx +61 -0
- package/dashboard/src/components/DailyCostTrend.tsx +85 -0
- package/dashboard/src/components/DailyTimeTrend.tsx +94 -0
- package/dashboard/src/components/Funnel.tsx +149 -0
- package/dashboard/src/components/GateForm.tsx +158 -0
- package/dashboard/src/components/GraphView.tsx +302 -0
- package/dashboard/src/components/GroupPathsSummary.tsx +47 -0
- package/dashboard/src/components/Histogram.tsx +292 -0
- package/dashboard/src/components/Layout.tsx +28 -0
- package/dashboard/src/components/NeedsAttention.tsx +98 -0
- package/dashboard/src/components/NodeContextCard.tsx +132 -0
- package/dashboard/src/components/PathTrail.tsx +35 -0
- package/dashboard/src/components/PipelineCostBreakdown.tsx +277 -0
- package/dashboard/src/components/RerunButton.tsx +46 -0
- package/dashboard/src/components/RunComparison.tsx +53 -0
- package/dashboard/src/components/Sparkline.tsx +94 -0
- package/dashboard/src/components/StatStrip.tsx +147 -0
- package/dashboard/src/components/StateTree.tsx +84 -0
- package/dashboard/src/components/StatusBadge.tsx +18 -0
- package/dashboard/src/components/SubflowPathPills.tsx +38 -0
- package/dashboard/src/components/SubflowSummary.tsx +24 -0
- package/dashboard/src/components/SubflowsCard.tsx +327 -0
- package/dashboard/src/components/TodayStrip.tsx +86 -0
- package/dashboard/src/components/TranscriptPane.tsx +99 -0
- package/dashboard/src/components/TranscriptRow.tsx +69 -0
- package/dashboard/src/components/ui/badge.tsx +38 -0
- package/dashboard/src/components/ui/button.tsx +28 -0
- package/dashboard/src/components/ui/card.tsx +42 -0
- package/dashboard/src/components/ui/skeleton.tsx +9 -0
- package/dashboard/src/components/ui/table.tsx +62 -0
- package/dashboard/src/index.css +26 -0
- package/dashboard/src/lib/anomaly.ts +42 -0
- package/dashboard/src/lib/format.ts +30 -0
- package/dashboard/src/lib/step-history.ts +13 -0
- package/dashboard/src/lib/subflow.ts +154 -0
- package/dashboard/src/lib/use-click-outside.ts +28 -0
- package/dashboard/src/lib/use-ignored-clusters.ts +67 -0
- package/dashboard/src/lib/utils.ts +6 -0
- package/dashboard/src/main.tsx +10 -0
- package/dashboard/src/types/shims.d.ts +4 -0
- package/dashboard/src/views/Home.tsx +478 -0
- package/dashboard/src/views/PipelineDetail.tsx +1185 -0
- package/dashboard/src/views/PipelinesList.tsx +111 -0
- package/dashboard/src/views/RunDetail.tsx +248 -0
- package/dashboard/src/views/Search.tsx +196 -0
- package/dashboard/stats.js +668 -0
- package/dashboard/tailwind.config.ts +43 -0
- package/dashboard/tree-stats.js +12 -0
- package/dashboard/tsconfig.json +25 -0
- package/dashboard/views.js +231 -0
- package/dashboard/vite.config.ts +34 -0
- package/drizzle.config.js +12 -0
- package/drizzle.config.ops.js +12 -0
- package/elevation.js +116 -0
- package/engine/admission-promotion-resume.js +127 -0
- package/engine/agent-dispatch.js +64 -0
- package/engine/child-resume-trigger.js +315 -0
- package/engine/executor-budget.js +87 -0
- package/engine/executor-cancel.js +83 -0
- package/engine/executor-errors.js +122 -0
- package/engine/executor-helpers.js +254 -0
- package/engine/executor-nodes.js +292 -0
- package/engine/executor-persist.js +212 -0
- package/engine/executor-subflow-children.js +275 -0
- package/engine/executor.js +1013 -0
- package/engine/global-concurrency.js +33 -0
- package/engine/loader.js +528 -0
- package/engine/needs-resolver.js +229 -0
- package/engine/pipelines-watcher.js +133 -0
- package/engine/result-replay.js +34 -0
- package/engine/revival-messages.js +11 -0
- package/engine/spawn-child.js +55 -0
- package/engine/wait-for-flow-settlement.js +109 -0
- package/events/catalog.js +26 -0
- package/events/emit.js +44 -0
- package/events/kinds.js +118 -0
- package/events/serve-ws.js +74 -0
- package/events/stream.js +35 -0
- package/events/ws-dialog.js +257 -0
- package/events/ws-frame.js +194 -0
- package/events/ws-run-events.js +70 -0
- package/events.js +32 -0
- package/gates/gate-resolver.js +576 -0
- package/gates/paused-flows.js +55 -0
- package/graphql/columns.js +67 -0
- package/graphql/schema.js +333 -0
- package/index.js +49 -0
- package/mcp/http.js +159 -0
- package/mcp/identity.js +94 -0
- package/mcp/stdio.js +80 -0
- package/mcp/tools.js +245 -0
- package/mcp/wire-ops.js +178 -0
- package/package.json +49 -4
- package/routes/bearer-auth.js +57 -0
- package/routes/discuss-audio.js +87 -0
- package/routes/discuss-component.js +39 -0
- package/routes/discuss-draft.js +159 -0
- package/routes/discuss-helpers.js +20 -0
- package/routes/discuss.js +848 -0
- package/routes/failures.js +104 -0
- package/routes/graphql.js +61 -0
- package/routes/health.js +54 -0
- package/routes/operator-discuss.js +193 -0
- package/routes/operator-resume.js +32 -0
- package/routes/operator-retry.js +301 -0
- package/routes/operator.js +539 -0
- package/routes/pipelines.js +118 -0
- package/routes/runs.js +1129 -0
- package/scripts/ci/import-check.mjs +50 -0
- package/scripts/link-core-self.mjs +31 -0
- package/scripts/with-guard.sh +24 -0
- package/server/app.js +503 -0
- package/server/registry.js +53 -0
- package/server/serve.js +163 -0
- package/state/admission-queue-store.js +325 -0
- package/state/attribution-registries.js +102 -0
- package/state/batch-writer.js +162 -0
- package/state/db-guard.js +63 -0
- package/state/db-health.js +27 -0
- package/state/db.js +122 -0
- package/state/discuss-store.js +299 -0
- package/state/failure-store.js +427 -0
- package/state/migrate.js +104 -0
- package/state/node-cost.js +67 -0
- package/state/node-executions.js +775 -0
- package/state/node-health-store.js +124 -0
- package/state/ops-merge.js +93 -0
- package/state/paths.js +146 -0
- package/state/pipeline-dirs.js +99 -0
- package/state/pipeline-registry.js +449 -0
- package/state/run-store.js +697 -0
- package/state/schema.js +438 -0
- package/state/schema.ops.js +44 -0
- package/state/session-index.js +177 -0
- package/state/session-keys.js +39 -0
- package/state/state-store.js +311 -0
- package/state/subflow-state.js +126 -0
- package/state/tool-handoff.js +169 -0
- package/telemetry/budget-alert.js +353 -0
- package/telemetry/cli.js +331 -0
- package/telemetry/grammar.js +119 -0
- package/telemetry/http-budget.js +132 -0
- package/telemetry/http-cost.js +670 -0
- package/telemetry/http-helpers.js +134 -0
- package/telemetry/http-tree.js +349 -0
- package/telemetry/http.js +44 -0
- package/telemetry/index.js +307 -0
- package/telemetry/ingest.js +134 -0
- package/telemetry/labels.js +115 -0
- package/telemetry/pricer.js +77 -0
- package/telemetry/resolver.js +314 -0
- package/telemetry/store.js +147 -0
- package/utils/run-patch.js +43 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
// Per-run / per-pipeline cost aggregation backed by runtime.sqlite::cost_by_call.
|
|
2
|
+
// The hook writer inserts one row per LLM call with full metadata (flow_id,
|
|
3
|
+
// node_id, item_key, model, tokens, cost_total) so all aggregations are
|
|
4
|
+
// single SQL queries rather than JSONL walks.
|
|
5
|
+
//
|
|
6
|
+
// Read-only, backed by state/db.js's shared getSharedDb() rather than a
|
|
7
|
+
// bespoke @libsql/client call — connections are cached per (dbPath, readonly)
|
|
8
|
+
// process-wide (see db.js) and reused across calls instead of opened+closed
|
|
9
|
+
// on every invocation, and shared with any other reader of the same file
|
|
10
|
+
// (e.g. state/node-cost.js's cost reader) instead of each keeping its
|
|
11
|
+
// own redundant connection. The path mirrors telemetry/store.js's
|
|
12
|
+
// DEFAULT_DB_PATH so cost.js stays in sync with where telemetry writes — if
|
|
13
|
+
// telemetry ever moves its file, update both.
|
|
14
|
+
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import os from "node:os";
|
|
18
|
+
import { getSharedDb, resolveStorePaths } from "../state/db.js";
|
|
19
|
+
import { getNodeExecutionsStore } from "../state/node-executions.js";
|
|
20
|
+
|
|
21
|
+
function defaultDbPath() {
|
|
22
|
+
return resolveStorePaths().runtimeDb;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getClient(dbPath) {
|
|
26
|
+
return getSharedDb(dbPath, { readonly: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// costForRun — sum all cost_by_call rows for a given flow_id.
|
|
30
|
+
// opts: { sinceMs?, untilMs?, _dbPath? }
|
|
31
|
+
// _sessionIndex: legacy param, accepted and ignored.
|
|
32
|
+
//
|
|
33
|
+
// Returns:
|
|
34
|
+
// { flowId, total, tokens, byModel, byNode, bySession }
|
|
35
|
+
//
|
|
36
|
+
// byModel: { [model]: { total, calls, inputTokens, outputTokens } }
|
|
37
|
+
// byNode: { [nodeId]: { total, calls, items: { [itemKey]: { total, calls } } } }
|
|
38
|
+
// bySession: { [session]: { total, calls, inputTokens, outputTokens, model, agentId } }
|
|
39
|
+
export async function costForRun(flowId, { sinceMs = null, untilMs = null, _dbPath = null } = {}, _sessionIndex = null) {
|
|
40
|
+
const result = {
|
|
41
|
+
flowId,
|
|
42
|
+
total: 0,
|
|
43
|
+
tokens: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
44
|
+
byModel: {},
|
|
45
|
+
byNode: {},
|
|
46
|
+
bySession: {},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const dbPath = _dbPath ?? defaultDbPath();
|
|
50
|
+
if (!existsSync(dbPath)) return result;
|
|
51
|
+
|
|
52
|
+
const { client } = await getClient(dbPath);
|
|
53
|
+
const conditions = ["flow_id = ?"];
|
|
54
|
+
const args = [flowId];
|
|
55
|
+
if (sinceMs != null) { conditions.push("ts >= ?"); args.push(sinceMs); }
|
|
56
|
+
const effectiveUntil = untilMs ?? (sinceMs ? Date.now() : null);
|
|
57
|
+
if (effectiveUntil != null) { conditions.push("ts <= ?"); args.push(effectiveUntil); }
|
|
58
|
+
|
|
59
|
+
const where = conditions.join(" AND ");
|
|
60
|
+
const { rows } = await client.execute({
|
|
61
|
+
sql: `
|
|
62
|
+
SELECT session_id, model, agent_id, node_id, item_key,
|
|
63
|
+
input_tokens, output_tokens, cache_read_tokens, cache_write_tokens,
|
|
64
|
+
cost_total
|
|
65
|
+
FROM cost_by_call
|
|
66
|
+
WHERE ${where}
|
|
67
|
+
`,
|
|
68
|
+
args,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
for (const row of rows) {
|
|
72
|
+
const cost = row.cost_total ?? 0;
|
|
73
|
+
result.total += cost;
|
|
74
|
+
result.tokens.input += row.input_tokens ?? 0;
|
|
75
|
+
result.tokens.output += row.output_tokens ?? 0;
|
|
76
|
+
result.tokens.cacheRead += row.cache_read_tokens ?? 0;
|
|
77
|
+
result.tokens.cacheWrite += row.cache_write_tokens ?? 0;
|
|
78
|
+
|
|
79
|
+
// byModel
|
|
80
|
+
const modelKey = row.model ?? "unknown";
|
|
81
|
+
const mAcc = result.byModel[modelKey] ?? { total: 0, calls: 0, inputTokens: 0, outputTokens: 0 };
|
|
82
|
+
mAcc.total += cost;
|
|
83
|
+
mAcc.calls += 1;
|
|
84
|
+
mAcc.inputTokens += row.input_tokens ?? 0;
|
|
85
|
+
mAcc.outputTokens += row.output_tokens ?? 0;
|
|
86
|
+
result.byModel[modelKey] = mAcc;
|
|
87
|
+
|
|
88
|
+
// byNode — lowercased: node_id casing has drifted across pipeline/executor
|
|
89
|
+
// versions ("SCORE" vs "score"), and the dashboard's per-node lookups
|
|
90
|
+
// (nodeKindMap, nodeGroupDefs, stepOrder) are all keyed lowercase.
|
|
91
|
+
// Without normalizing here, case variants of the same node split into
|
|
92
|
+
// separate rows instead of merging.
|
|
93
|
+
const nodeId = (row.node_id ?? "unknown").toLowerCase();
|
|
94
|
+
const nAcc = result.byNode[nodeId] ?? { total: 0, calls: 0, items: {} };
|
|
95
|
+
nAcc.total += cost;
|
|
96
|
+
nAcc.calls += 1;
|
|
97
|
+
if (row.item_key) {
|
|
98
|
+
const iAcc = nAcc.items[row.item_key] ?? { total: 0, calls: 0 };
|
|
99
|
+
iAcc.total += cost;
|
|
100
|
+
iAcc.calls += 1;
|
|
101
|
+
nAcc.items[row.item_key] = iAcc;
|
|
102
|
+
}
|
|
103
|
+
result.byNode[nodeId] = nAcc;
|
|
104
|
+
|
|
105
|
+
// bySession — keyed by the harness-written session_id column.
|
|
106
|
+
const sid = row.session_id ?? "unknown";
|
|
107
|
+
const sAcc = result.bySession[sid] ?? {
|
|
108
|
+
total: 0, calls: 0, inputTokens: 0, outputTokens: 0,
|
|
109
|
+
model: modelKey, agentId: row.agent_id ?? null,
|
|
110
|
+
};
|
|
111
|
+
sAcc.total += cost;
|
|
112
|
+
sAcc.calls += 1;
|
|
113
|
+
sAcc.inputTokens += row.input_tokens ?? 0;
|
|
114
|
+
sAcc.outputTokens += row.output_tokens ?? 0;
|
|
115
|
+
result.bySession[sid] = sAcc;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// costForPipeline — aggregate cost for one pipeline across all its runs.
|
|
122
|
+
// runs: full flow_run list from the state store (filtered to this pipeline here or by caller).
|
|
123
|
+
// opts: { sinceMs?, untilMs?, sinceDays?, priorWindowMs?, _dbPath? }
|
|
124
|
+
//
|
|
125
|
+
// Returns a PipelineCost:
|
|
126
|
+
// { pipelineId, runs, succeeded, total, mean, p50, p95, costPerSuccess,
|
|
127
|
+
// costPerSuccessPrior, byModel, byNode, byDay, since, until, byRun }
|
|
128
|
+
//
|
|
129
|
+
// byRun: [{ flowId, status, createdAt, total, byNode }] sorted by createdAt desc
|
|
130
|
+
// byDay: [{ day, total, runs }] sorted by day
|
|
131
|
+
// byNode: pipeline-wide per-node { cost, calls, p50Ms, p95Ms, meanMs, p50Cost, p95Cost, perDay }
|
|
132
|
+
//
|
|
133
|
+
// *Ms fields (byNode[x].p50Ms/p95Ms/meanMs, perDay[].p50Ms) come from
|
|
134
|
+
// runtime.sqlite::flow_step_timings (entered_at/exited_at), NOT cost_by_call
|
|
135
|
+
// — that table carries no duration column. Timings there only cover
|
|
136
|
+
// top-level pipeline steps (plus a fallback wrapper's own direct children);
|
|
137
|
+
// nodes running inside a subflow's per-item child iterations aren't timed at
|
|
138
|
+
// that granularity, so those legitimately stay null — the UI treats null
|
|
139
|
+
// as "—".
|
|
140
|
+
//
|
|
141
|
+
// `runs`/`succeeded` use the same active-in-window gate as
|
|
142
|
+
// costForAllPipelines: createdAt in window OR cost > 0 in window. A plain
|
|
143
|
+
// updatedAt filter inflates the count after any mass-touch event (see
|
|
144
|
+
// project memory reference_cost_window_gate).
|
|
145
|
+
export async function costForPipeline(runs, pipelineId, { sinceMs = null, untilMs = null, sinceDays = null, priorWindowMs = null, _dbPath = null } = {}) {
|
|
146
|
+
// Resolve window bounds.
|
|
147
|
+
let resolvedSince = sinceMs;
|
|
148
|
+
if (resolvedSince == null && sinceDays != null && Number.isFinite(sinceDays) && sinceDays > 0) {
|
|
149
|
+
resolvedSince = Date.now() - sinceDays * 86_400_000;
|
|
150
|
+
}
|
|
151
|
+
const resolvedUntil = untilMs ?? (resolvedSince ? Date.now() : null);
|
|
152
|
+
|
|
153
|
+
// Filter runs to this pipeline.
|
|
154
|
+
const mine = runs.filter((r) => {
|
|
155
|
+
const pid = r.pipelineId ?? r.stateJson?.pipelineId ?? "";
|
|
156
|
+
return pid === pipelineId;
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const empty = {
|
|
160
|
+
pipelineId, runs: 0, succeeded: 0, total: 0, mean: 0, p50: null, p95: null,
|
|
161
|
+
costPerSuccess: null, costPerSuccessPrior: null,
|
|
162
|
+
byModel: {}, byNode: {}, byDay: [],
|
|
163
|
+
since: resolvedSince, until: resolvedUntil, byRun: [],
|
|
164
|
+
};
|
|
165
|
+
if (mine.length === 0) return empty;
|
|
166
|
+
|
|
167
|
+
const flowIds = mine.map((r) => r.flowId).filter(Boolean);
|
|
168
|
+
if (flowIds.length === 0) return empty;
|
|
169
|
+
|
|
170
|
+
const dbPath = _dbPath ?? defaultDbPath();
|
|
171
|
+
if (!existsSync(dbPath)) return empty;
|
|
172
|
+
|
|
173
|
+
const { client } = await getClient(dbPath);
|
|
174
|
+
const result = await aggregatePipelineCost(client, pipelineId, flowIds, mine, resolvedSince, resolvedUntil);
|
|
175
|
+
|
|
176
|
+
// Prior-window costPerSuccess for the trend delta — same-length window
|
|
177
|
+
// immediately before `resolvedSince`. Only meaningful with a bounded
|
|
178
|
+
// window (sinceMs set); an all-time query has no "prior" to compare.
|
|
179
|
+
if (priorWindowMs != null && resolvedSince != null) {
|
|
180
|
+
const prior = await aggregatePipelineCost(client, pipelineId, flowIds, mine, resolvedSince - priorWindowMs, resolvedSince);
|
|
181
|
+
result.costPerSuccessPrior = prior.succeeded > 0 ? prior.total / prior.succeeded : null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function dayString(ts) {
|
|
188
|
+
return new Date(ts).toISOString().slice(0, 10);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// One windowed pass over cost_by_call for a pipeline's flows, producing a
|
|
192
|
+
// full PipelineCost (minus costPerSuccessPrior, filled in by the caller).
|
|
193
|
+
async function aggregatePipelineCost(client, pipelineId, flowIds, mine, sinceMs, untilMs) {
|
|
194
|
+
const placeholders = flowIds.map(() => "?").join(",");
|
|
195
|
+
const conditions = [`flow_id IN (${placeholders})`];
|
|
196
|
+
const args = [...flowIds];
|
|
197
|
+
if (sinceMs != null) { conditions.push("ts >= ?"); args.push(sinceMs); }
|
|
198
|
+
if (untilMs != null) { conditions.push("ts <= ?"); args.push(untilMs); }
|
|
199
|
+
const where = conditions.join(" AND ");
|
|
200
|
+
|
|
201
|
+
const { rows } = await client.execute({
|
|
202
|
+
sql: `
|
|
203
|
+
SELECT flow_id, node_id, model, cost_total, ts
|
|
204
|
+
FROM cost_by_call
|
|
205
|
+
WHERE ${where}
|
|
206
|
+
`,
|
|
207
|
+
args,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const flowCost = new Map(); // flowId → total cost
|
|
211
|
+
const modelCost = new Map(); // model → total cost
|
|
212
|
+
const nodeAcc = new Map(); // nodeId → { calls: number[], dayMap: Map<day, {cost, calls: number[]}> }
|
|
213
|
+
const dayAcc = new Map(); // day → { cost, calls: number[], runSet: Set<flowId> }
|
|
214
|
+
// Per-run per-node cost accumulator
|
|
215
|
+
const runNodeAcc = new Map(); // flowId → Map<nodeId, { total, calls }>
|
|
216
|
+
|
|
217
|
+
for (const row of rows) {
|
|
218
|
+
const cost = row.cost_total ?? 0;
|
|
219
|
+
const fid = row.flow_id;
|
|
220
|
+
flowCost.set(fid, (flowCost.get(fid) ?? 0) + cost);
|
|
221
|
+
|
|
222
|
+
const modelKey = row.model ?? "unknown";
|
|
223
|
+
modelCost.set(modelKey, (modelCost.get(modelKey) ?? 0) + cost);
|
|
224
|
+
|
|
225
|
+
const day = dayString(row.ts);
|
|
226
|
+
|
|
227
|
+
// Lowercased: node_id casing has drifted across pipeline/executor versions
|
|
228
|
+
// ("SCORE" vs "score"), and the dashboard's per-node lookups (nodeKindMap,
|
|
229
|
+
// nodeGroupDefs, stepOrder) are all keyed lowercase — without this,
|
|
230
|
+
// case variants of the same node split into separate byNode rows instead
|
|
231
|
+
// of merging, and node-group coalescing never matches.
|
|
232
|
+
const nodeId = (row.node_id ?? "unknown").toLowerCase();
|
|
233
|
+
const nAcc = nodeAcc.get(nodeId) ?? { calls: [], dayMap: new Map() };
|
|
234
|
+
nAcc.calls.push(cost);
|
|
235
|
+
const nDay = nAcc.dayMap.get(day) ?? { cost: 0, calls: [] };
|
|
236
|
+
nDay.cost += cost;
|
|
237
|
+
nDay.calls.push(cost);
|
|
238
|
+
nAcc.dayMap.set(day, nDay);
|
|
239
|
+
nodeAcc.set(nodeId, nAcc);
|
|
240
|
+
|
|
241
|
+
const dAcc = dayAcc.get(day) ?? { cost: 0, calls: [], runSet: new Set() };
|
|
242
|
+
dAcc.cost += cost;
|
|
243
|
+
dAcc.calls.push(cost);
|
|
244
|
+
dAcc.runSet.add(fid);
|
|
245
|
+
dayAcc.set(day, dAcc);
|
|
246
|
+
|
|
247
|
+
// Per-run per-node
|
|
248
|
+
if (!runNodeAcc.has(fid)) runNodeAcc.set(fid, new Map());
|
|
249
|
+
const rnMap = runNodeAcc.get(fid);
|
|
250
|
+
const rnAcc = rnMap.get(nodeId) ?? { total: 0, calls: 0 };
|
|
251
|
+
rnAcc.total += cost;
|
|
252
|
+
rnAcc.calls += 1;
|
|
253
|
+
rnMap.set(nodeId, rnAcc);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Wall-time: separate pass over flow_node_executions, since it's a
|
|
257
|
+
// different table at a different granularity (one row per node EXECUTION,
|
|
258
|
+
// vs one cost_by_call row per LLM call) — joined only at the (nodeId, day)
|
|
259
|
+
// key, same case-normalization as the cost pass above.
|
|
260
|
+
const nodeExecutionsStore = await getNodeExecutionsStore();
|
|
261
|
+
const timingRows = await nodeExecutionsStore.queryByPipeline({ pipelineId, sinceMs, untilMs });
|
|
262
|
+
const nodeTimingAcc = new Map(); // nodeId → { durations: number[], dayMap: Map<day, number[]> }
|
|
263
|
+
const dayTimingAcc = new Map(); // day → number[] (pipeline-wide durations)
|
|
264
|
+
for (const row of timingRows) {
|
|
265
|
+
const ms = row.exited_at - row.entered_at;
|
|
266
|
+
if (!Number.isFinite(ms) || ms < 0) continue;
|
|
267
|
+
const nodeId = (row.node_id ?? "unknown").toLowerCase();
|
|
268
|
+
const day = dayString(row.exited_at);
|
|
269
|
+
|
|
270
|
+
const tAcc = nodeTimingAcc.get(nodeId) ?? { durations: [], dayMap: new Map() };
|
|
271
|
+
tAcc.durations.push(ms);
|
|
272
|
+
const tDay = tAcc.dayMap.get(day) ?? [];
|
|
273
|
+
tDay.push(ms);
|
|
274
|
+
tAcc.dayMap.set(day, tDay);
|
|
275
|
+
nodeTimingAcc.set(nodeId, tAcc);
|
|
276
|
+
|
|
277
|
+
const dArr = dayTimingAcc.get(day) ?? [];
|
|
278
|
+
dArr.push(ms);
|
|
279
|
+
dayTimingAcc.set(day, dArr);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Active-in-window gate: a run counts if it started in-window, OR it has
|
|
283
|
+
// no createdAt-in-window overlap but still logged cost in-window (e.g. a
|
|
284
|
+
// long-running flow that started earlier). Unbounded window (sinceMs
|
|
285
|
+
// null) counts everything.
|
|
286
|
+
const gatedRuns = mine.filter((r) => {
|
|
287
|
+
if (sinceMs == null) return true;
|
|
288
|
+
const startedInWindow = (r.createdAt ?? 0) >= sinceMs && (untilMs == null || (r.createdAt ?? 0) <= untilMs);
|
|
289
|
+
const workedInWindow = (flowCost.get(r.flowId) ?? 0) > 0;
|
|
290
|
+
return startedInWindow || workedInWindow;
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
const succeededCount = gatedRuns.filter((r) => r.status === "succeeded").length;
|
|
294
|
+
const runTotals = gatedRuns.map((r) => flowCost.get(r.flowId) ?? 0);
|
|
295
|
+
const grandTotal = runTotals.reduce((s, c) => s + c, 0);
|
|
296
|
+
const mean = gatedRuns.length > 0 ? grandTotal / gatedRuns.length : 0;
|
|
297
|
+
|
|
298
|
+
// byRun: per-run cost with per-run node breakdown, sorted by createdAt desc
|
|
299
|
+
const byRun = gatedRuns
|
|
300
|
+
.map((r) => {
|
|
301
|
+
const rnMap = runNodeAcc.get(r.flowId);
|
|
302
|
+
const byNode = rnMap
|
|
303
|
+
? Object.fromEntries([...rnMap.entries()].map(([nid, acc]) => [nid, { total: acc.total, calls: acc.calls }]))
|
|
304
|
+
: {};
|
|
305
|
+
return {
|
|
306
|
+
flowId: r.flowId,
|
|
307
|
+
status: r.status ?? null,
|
|
308
|
+
createdAt: r.createdAt ?? null,
|
|
309
|
+
total: flowCost.get(r.flowId) ?? 0,
|
|
310
|
+
byNode,
|
|
311
|
+
};
|
|
312
|
+
})
|
|
313
|
+
.sort((a, b) => (b.createdAt ?? 0) - (a.createdAt ?? 0));
|
|
314
|
+
|
|
315
|
+
const byModel = Object.fromEntries(modelCost);
|
|
316
|
+
|
|
317
|
+
// Union of nodes with cost data and nodes with timing data — a code node
|
|
318
|
+
// that never calls an LLM (no cost_by_call rows) can still have real
|
|
319
|
+
// wall-time from flow_step_timings, and the UI's row filter already
|
|
320
|
+
// expects that (`v.cost > 0 || (v.p50Ms ?? 0) > 0`).
|
|
321
|
+
const byNode = {};
|
|
322
|
+
const allNodeIds = new Set([...nodeAcc.keys(), ...nodeTimingAcc.keys()]);
|
|
323
|
+
for (const nodeId of allNodeIds) {
|
|
324
|
+
const cAcc = nodeAcc.get(nodeId);
|
|
325
|
+
const tAcc = nodeTimingAcc.get(nodeId);
|
|
326
|
+
const nodeCost = cAcc ? cAcc.calls.reduce((s, c) => s + c, 0) : 0;
|
|
327
|
+
const days = new Set([...(cAcc?.dayMap.keys() ?? []), ...(tAcc?.dayMap.keys() ?? [])]);
|
|
328
|
+
const perDayEntries = [...days]
|
|
329
|
+
.map((day) => {
|
|
330
|
+
const cDay = cAcc?.dayMap.get(day);
|
|
331
|
+
const tDay = tAcc?.dayMap.get(day);
|
|
332
|
+
return {
|
|
333
|
+
day,
|
|
334
|
+
cost: cDay?.cost ?? 0,
|
|
335
|
+
calls: cDay?.calls.length ?? 0,
|
|
336
|
+
ms: tDay ? tDay.reduce((s, m) => s + m, 0) : 0,
|
|
337
|
+
p50Cost: cDay ? percentile(cDay.calls, 50) : null,
|
|
338
|
+
p50Ms: tDay ? percentile(tDay, 50) : null,
|
|
339
|
+
};
|
|
340
|
+
})
|
|
341
|
+
.sort((a, b) => a.day.localeCompare(b.day));
|
|
342
|
+
byNode[nodeId] = {
|
|
343
|
+
cost: nodeCost,
|
|
344
|
+
calls: cAcc?.calls.length ?? 0,
|
|
345
|
+
p50Ms: tAcc ? percentile(tAcc.durations, 50) : null,
|
|
346
|
+
p95Ms: tAcc ? percentile(tAcc.durations, 95) : null,
|
|
347
|
+
meanMs: tAcc && tAcc.durations.length > 0 ? tAcc.durations.reduce((s, m) => s + m, 0) / tAcc.durations.length : null,
|
|
348
|
+
p50Cost: cAcc ? percentile(cAcc.calls, 50) : null,
|
|
349
|
+
p95Cost: cAcc ? percentile(cAcc.calls, 95) : null,
|
|
350
|
+
perDay: perDayEntries,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const perDayDays = new Set([...dayAcc.keys(), ...dayTimingAcc.keys()]);
|
|
355
|
+
const byDay = [...perDayDays]
|
|
356
|
+
.map((day) => {
|
|
357
|
+
const d = dayAcc.get(day);
|
|
358
|
+
const t = dayTimingAcc.get(day);
|
|
359
|
+
return {
|
|
360
|
+
day,
|
|
361
|
+
total: d?.cost ?? 0,
|
|
362
|
+
runs: d?.runSet.size ?? 0,
|
|
363
|
+
p50Cost: d ? percentile(d.calls, 50) : null,
|
|
364
|
+
p50Ms: t ? percentile(t, 50) : null,
|
|
365
|
+
};
|
|
366
|
+
})
|
|
367
|
+
.sort((a, b) => a.day.localeCompare(b.day));
|
|
368
|
+
|
|
369
|
+
return {
|
|
370
|
+
pipelineId,
|
|
371
|
+
runs: gatedRuns.length,
|
|
372
|
+
succeeded: succeededCount,
|
|
373
|
+
total: grandTotal,
|
|
374
|
+
mean,
|
|
375
|
+
p50: percentile(runTotals, 50),
|
|
376
|
+
p95: percentile(runTotals, 95),
|
|
377
|
+
costPerSuccess: succeededCount > 0 ? grandTotal / succeededCount : null,
|
|
378
|
+
costPerSuccessPrior: null,
|
|
379
|
+
byModel,
|
|
380
|
+
byNode,
|
|
381
|
+
byDay,
|
|
382
|
+
since: sinceMs,
|
|
383
|
+
until: untilMs,
|
|
384
|
+
byRun,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// costForAllPipelines — home-page overview across every pipeline.
|
|
389
|
+
// runs: full flow_run list from the state store.
|
|
390
|
+
// opts: { sinceMs?, _dbPath? }
|
|
391
|
+
//
|
|
392
|
+
// Returns:
|
|
393
|
+
// { sinceMs, untilMs, total, pipelines }
|
|
394
|
+
//
|
|
395
|
+
// pipeline entry: { pipelineId, total, runCount, succeededToday, failedToday, costToday }
|
|
396
|
+
// total: cross-pipeline aggregate { spend, runs, succeeded, costPerSuccess }
|
|
397
|
+
export async function costForAllPipelines(runs, { sinceMs = null, _dbPath = null } = {}) {
|
|
398
|
+
const untilMs = sinceMs ? Date.now() : null;
|
|
399
|
+
|
|
400
|
+
const empty = { sinceMs, untilMs, pipelines: [], total: { spend: 0, runs: 0, succeeded: 0, costPerSuccess: null } };
|
|
401
|
+
if (!runs || runs.length === 0) return empty;
|
|
402
|
+
|
|
403
|
+
// Build a flowId → pipeline mapping from the runs list.
|
|
404
|
+
const flowToPipeline = new Map();
|
|
405
|
+
for (const r of runs) {
|
|
406
|
+
if (!r.flowId) continue;
|
|
407
|
+
const pid = r.pipelineId ?? r.stateJson?.pipelineId ?? "";
|
|
408
|
+
if (!pid) continue;
|
|
409
|
+
flowToPipeline.set(r.flowId, pid);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const flowIds = [...flowToPipeline.keys()];
|
|
413
|
+
if (flowIds.length === 0) return empty;
|
|
414
|
+
|
|
415
|
+
const dbPath = _dbPath ?? defaultDbPath();
|
|
416
|
+
if (!existsSync(dbPath)) {
|
|
417
|
+
// DB absent: still return pipeline entries derived purely from the runs list,
|
|
418
|
+
// all with zero cost (active-in-window gate still applies for run counts).
|
|
419
|
+
return _aggregateFromRunsOnly(runs, flowToPipeline, sinceMs, untilMs);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const { client } = await getClient(dbPath);
|
|
423
|
+
const placeholders = flowIds.map(() => "?").join(",");
|
|
424
|
+
const conditions = [`flow_id IN (${placeholders})`];
|
|
425
|
+
const args = [...flowIds];
|
|
426
|
+
if (sinceMs != null) { conditions.push("ts >= ?"); args.push(sinceMs); }
|
|
427
|
+
if (untilMs != null) { conditions.push("ts <= ?"); args.push(untilMs); }
|
|
428
|
+
const where = conditions.join(" AND ");
|
|
429
|
+
|
|
430
|
+
// Per-flow cost total in one query — enough to build per-pipeline rollup.
|
|
431
|
+
const { rows } = await client.execute({
|
|
432
|
+
sql: `
|
|
433
|
+
SELECT flow_id, SUM(cost_total) AS flow_total
|
|
434
|
+
FROM cost_by_call
|
|
435
|
+
WHERE ${where}
|
|
436
|
+
GROUP BY flow_id
|
|
437
|
+
`,
|
|
438
|
+
args,
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
// flowId → total cost from the DB
|
|
442
|
+
const dbFlowCost = new Map();
|
|
443
|
+
for (const row of rows) {
|
|
444
|
+
dbFlowCost.set(row.flow_id, row.flow_total ?? 0);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return _buildPipelineResult(runs, flowToPipeline, dbFlowCost, sinceMs, untilMs);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Build pipeline result when DB has no rows (absent or empty cost).
|
|
451
|
+
// All pipeline entries still appear, but with zero cost.
|
|
452
|
+
function _aggregateFromRunsOnly(runs, flowToPipeline, sinceMs, untilMs) {
|
|
453
|
+
const dbFlowCost = new Map(); // empty — no DB rows
|
|
454
|
+
return _buildPipelineResult(runs, flowToPipeline, dbFlowCost, sinceMs, untilMs);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function _buildPipelineResult(runs, flowToPipeline, dbFlowCost, sinceMs, untilMs) {
|
|
458
|
+
// Today boundary for succeededToday / failedToday / costToday.
|
|
459
|
+
const todayStart = (() => {
|
|
460
|
+
const d = new Date();
|
|
461
|
+
return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
|
|
462
|
+
})();
|
|
463
|
+
|
|
464
|
+
// Accumulate per-pipeline metrics.
|
|
465
|
+
const byPipeline = new Map();
|
|
466
|
+
|
|
467
|
+
for (const r of runs) {
|
|
468
|
+
if (!r.flowId) continue;
|
|
469
|
+
const pid = flowToPipeline.get(r.flowId);
|
|
470
|
+
if (!pid) continue;
|
|
471
|
+
|
|
472
|
+
// Active-in-window gate: must have been created in-window OR had DB cost in-window.
|
|
473
|
+
const startedInWindow = sinceMs == null || (r.createdAt ?? 0) >= sinceMs;
|
|
474
|
+
const workedInWindow = (dbFlowCost.get(r.flowId) ?? 0) > 0;
|
|
475
|
+
if (sinceMs != null && !startedInWindow && !workedInWindow) continue;
|
|
476
|
+
|
|
477
|
+
const runCost = dbFlowCost.get(r.flowId) ?? 0;
|
|
478
|
+
const isToday = (r.updatedAt ?? 0) >= todayStart;
|
|
479
|
+
|
|
480
|
+
const acc = byPipeline.get(pid) ?? {
|
|
481
|
+
pipelineId: pid, total: 0, runCount: 0,
|
|
482
|
+
succeeded: 0, succeededToday: 0, failedToday: 0, costToday: 0,
|
|
483
|
+
};
|
|
484
|
+
acc.total += runCost;
|
|
485
|
+
acc.runCount += 1;
|
|
486
|
+
if (r.status === "succeeded") {
|
|
487
|
+
acc.succeeded++;
|
|
488
|
+
if (isToday) acc.succeededToday++;
|
|
489
|
+
}
|
|
490
|
+
if (r.status === "failed" && isToday) acc.failedToday++;
|
|
491
|
+
if (isToday) acc.costToday += runCost;
|
|
492
|
+
byPipeline.set(pid, acc);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const pipelines = Array.from(byPipeline.values()).map((acc) => ({
|
|
496
|
+
pipelineId: acc.pipelineId,
|
|
497
|
+
total: acc.total,
|
|
498
|
+
runCount: acc.runCount,
|
|
499
|
+
succeededToday: acc.succeededToday,
|
|
500
|
+
failedToday: acc.failedToday,
|
|
501
|
+
costToday: acc.costToday,
|
|
502
|
+
}));
|
|
503
|
+
pipelines.sort((a, b) => b.total - a.total);
|
|
504
|
+
|
|
505
|
+
const totalSpend = pipelines.reduce((s, p) => s + p.total, 0);
|
|
506
|
+
const totalRuns = pipelines.reduce((s, p) => s + p.runCount, 0);
|
|
507
|
+
let allSucceeded = 0;
|
|
508
|
+
for (const acc of byPipeline.values()) allSucceeded += acc.succeeded;
|
|
509
|
+
|
|
510
|
+
return {
|
|
511
|
+
sinceMs,
|
|
512
|
+
untilMs,
|
|
513
|
+
pipelines,
|
|
514
|
+
total: {
|
|
515
|
+
spend: totalSpend,
|
|
516
|
+
runs: totalRuns,
|
|
517
|
+
succeeded: allSucceeded,
|
|
518
|
+
costPerSuccess: allSucceeded > 0 ? totalSpend / allSucceeded : null,
|
|
519
|
+
},
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
function percentile(arr, p) {
|
|
524
|
+
if (!arr || arr.length === 0) return null;
|
|
525
|
+
const sorted = arr.slice().sort((a, b) => a - b);
|
|
526
|
+
const idx = Math.max(0, Math.ceil((p / 100) * sorted.length) - 1);
|
|
527
|
+
return sorted[idx];
|
|
528
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html,body{margin:0;--tw-bg-opacity: 1;background-color:rgb(14 17 22 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(216 221 230 / var(--tw-text-opacity, 1));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.5}a{--tw-text-opacity: 1;color:rgb(88 166 255 / var(--tw-text-opacity, 1));text-decoration-line:none}a:hover{text-decoration-line:underline}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.col-span-5{grid-column:span 5 / span 5}.m-0{margin:0}.-mx-0\.5{margin-left:-.125rem;margin-right:-.125rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-\[18px\]{margin-bottom:18px}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-\[14px\]{margin-left:14px}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-40{height:10rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\[12px\]{height:12px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.min-h-12{min-height:3rem}.min-h-\[12px\]{min-height:12px}.min-h-\[14px\]{min-height:14px}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-60{width:15rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[3px\]{width:3px}.w-\[72px\]{width:72px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[100px\]{min-width:100px}.min-w-\[160px\]{min-width:160px}.min-w-\[30px\]{min-width:30px}.min-w-\[4px\]{min-width:4px}.min-w-\[6px\]{min-width:6px}.min-w-full{min-width:100%}.max-w-\[1400px\]{max-width:1400px}.max-w-\[260px\]{max-width:260px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-copy{cursor:copy}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.grid-cols-\[200px_1fr_40px\]{grid-template-columns:200px 1fr 40px}.grid-cols-\[56px_90px_1fr\]{grid-template-columns:56px 90px 1fr}.grid-cols-\[68px_1fr\]{grid-template-columns:68px 1fr}.grid-cols-\[auto_1fr_auto_auto\]{grid-template-columns:auto 1fr auto auto}.grid-cols-\[auto_1fr_auto_auto_auto\]{grid-template-columns:auto 1fr auto auto auto}.grid-cols-\[repeat\(auto-fit\,minmax\(150px\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\[1px\]{gap:1px}.gap-\[2px\]{gap:2px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-2\.5{-moz-column-gap:.625rem;column-gap:.625rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-1\.5{row-gap:.375rem}.gap-y-2{row-gap:.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[1px\]{border-radius:1px}.rounded-\[2px\]{border-radius:2px}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-l-\[2px\]{border-top-left-radius:2px;border-bottom-left-radius:2px}.rounded-r-\[2px\]{border-top-right-radius:2px;border-bottom-right-radius:2px}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-accent\/40{border-color:#58a6ff66}.border-border{--tw-border-opacity: 1;border-color:rgb(42 48 56 / var(--tw-border-opacity, 1))}.border-border\/60{border-color:#2a303899}.border-fg-dim{--tw-border-opacity: 1;border-color:rgb(139 148 158 / var(--tw-border-opacity, 1))}.border-status-amber\/30{border-color:#d299224d}.border-status-amber\/40{border-color:#d2992266}.border-status-blue\/40{border-color:#1f6feb66}.border-status-green\/35{border-color:#3fb95059}.border-status-green\/40{border-color:#3fb95066}.border-status-grey\/40{border-color:#6e768166}.border-status-red\/40{border-color:#f8514966}.border-status-red\/60{border-color:#f8514999}.border-transparent{border-color:transparent}.bg-bg{--tw-bg-opacity: 1;background-color:rgb(14 17 22 / var(--tw-bg-opacity, 1))}.bg-bg-elev{--tw-bg-opacity: 1;background-color:rgb(22 27 34 / var(--tw-bg-opacity, 1))}.bg-bg-elev2{--tw-bg-opacity: 1;background-color:rgb(31 38 46 / var(--tw-bg-opacity, 1))}.bg-bg-elev2\/20{background-color:#1f262e33}.bg-bg-elev2\/30{background-color:#1f262e4d}.bg-bg-elev2\/40{background-color:#1f262e66}.bg-status-amber{--tw-bg-opacity: 1;background-color:rgb(210 153 34 / var(--tw-bg-opacity, 1))}.bg-status-amber\/15{background-color:#d2992226}.bg-status-amber\/\[0\.04\]{background-color:#d299220a}.bg-status-blue{--tw-bg-opacity: 1;background-color:rgb(31 111 235 / var(--tw-bg-opacity, 1))}.bg-status-blue\/15{background-color:#1f6feb26}.bg-status-blue\/20{background-color:#1f6feb33}.bg-status-blue\/60{background-color:#1f6feb99}.bg-status-blue\/70{background-color:#1f6febb3}.bg-status-green{--tw-bg-opacity: 1;background-color:rgb(63 185 80 / var(--tw-bg-opacity, 1))}.bg-status-green\/10{background-color:#3fb9501a}.bg-status-green\/15{background-color:#3fb95026}.bg-status-grey{--tw-bg-opacity: 1;background-color:rgb(110 118 129 / var(--tw-bg-opacity, 1))}.bg-status-grey\/15{background-color:#6e768126}.bg-status-red{--tw-bg-opacity: 1;background-color:rgb(248 81 73 / var(--tw-bg-opacity, 1))}.bg-status-red\/15{background-color:#f8514926}.bg-transparent{background-color:transparent}.\!p-0{padding:0!important}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[14px\]{padding-left:14px;padding-right:14px}.px-\[6px\]{padding-left:6px;padding-right:6px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-\[10px\]{padding-top:10px;padding-bottom:10px}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.py-\[3px\]{padding-top:3px;padding-bottom:3px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:.25rem}.pb-1\.5{padding-bottom:.375rem}.pl-0\.5{padding-left:.125rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pr-0\.5{padding-right:.125rem}.pr-1{padding-right:.25rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-2\.5{padding-top:.625rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[0\.4px\]{letter-spacing:.4px}.tracking-\[0\.5px\]{letter-spacing:.5px}.tracking-normal{letter-spacing:0em}.tracking-wide{letter-spacing:.025em}.text-\[\#79b8ff\]{--tw-text-opacity: 1;color:rgb(121 184 255 / var(--tw-text-opacity, 1))}.text-accent{--tw-text-opacity: 1;color:rgb(88 166 255 / var(--tw-text-opacity, 1))}.text-fg{--tw-text-opacity: 1;color:rgb(216 221 230 / var(--tw-text-opacity, 1))}.text-fg-dim{--tw-text-opacity: 1;color:rgb(139 148 158 / var(--tw-text-opacity, 1))}.text-fg-dim\/60{color:#8b949e99}.text-fg-dim\/80{color:#8b949ecc}.text-status-amber{--tw-text-opacity: 1;color:rgb(210 153 34 / var(--tw-text-opacity, 1))}.text-status-green{--tw-text-opacity: 1;color:rgb(63 185 80 / var(--tw-text-opacity, 1))}.text-status-grey{--tw-text-opacity: 1;color:rgb(110 118 129 / var(--tw-text-opacity, 1))}.text-status-red{--tw-text-opacity: 1;color:rgb(248 81 73 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-75{opacity:.75}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.last\:mb-0:last-child{margin-bottom:0}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:border-border:hover{--tw-border-opacity: 1;border-color:rgb(42 48 56 / var(--tw-border-opacity, 1))}.hover\:bg-accent\/10:hover{background-color:#58a6ff1a}.hover\:bg-bg-elev:hover{--tw-bg-opacity: 1;background-color:rgb(22 27 34 / var(--tw-bg-opacity, 1))}.hover\:bg-bg-elev2:hover{--tw-bg-opacity: 1;background-color:rgb(31 38 46 / var(--tw-bg-opacity, 1))}.hover\:bg-status-green\/10:hover{background-color:#3fb9501a}.hover\:bg-status-red\/10:hover{background-color:#f851491a}.hover\:text-fg:hover{--tw-text-opacity: 1;color:rgb(216 221 230 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(88 166 255 / var(--tw-border-opacity, 1))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:bg-bg-elev2\/40{background-color:#1f262e66}.group:hover .group-hover\:bg-bg-elev2\/60{background-color:#1f262e99}@media (min-width: 640px){.sm\:col-span-4{grid-column:span 4 / span 4}.sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:hidden{display:none}.sm\:h-\[420px\]{height:420px}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[140px_1fr\]{grid-template-columns:140px 1fr}.sm\:grid-cols-\[80px_110px_1fr\]{grid-template-columns:80px 110px 1fr}.sm\:gap-4{gap:1rem}.sm\:p-4{padding:1rem}.sm\:p-5{padding:1.25rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}}@media (min-width: 768px){.md\:inline{display:inline}.md\:h-\[480px\]{height:480px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-5{gap:1.25rem}}@media (min-width: 1024px){.lg\:flex-row{flex-direction:row}.lg\:gap-5{gap:1.25rem}}.\[\&\:not\(\:last-child\)\]\:border-b:not(:last-child){border-bottom-width:1px}
|