llmtop 0.1.2 → 0.1.4
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 +24 -4
- package/bin/llmtop.mjs +75 -7
- package/dashboard/dist/assets/index-NQzaBVIY.css +1 -0
- package/dashboard/dist/assets/montserrat-cyrillic-ext-wght-normal-CO5hGrJv.woff2 +0 -0
- package/dashboard/dist/assets/montserrat-cyrillic-wght-normal-EAA9jha_.woff2 +0 -0
- package/dashboard/dist/assets/montserrat-latin-ext-wght-normal-BsZE-iaG.woff2 +0 -0
- package/dashboard/dist/assets/montserrat-latin-wght-normal-l_AIctKy.woff2 +0 -0
- package/dashboard/dist/assets/montserrat-vietnamese-wght-normal-k7S-YeeD.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-cyrillic-ext-wght-normal-BUDPrIko.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-cyrillic-wght-normal-HUlVHixE.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-greek-wght-normal-BJJTbwTT.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-latin-ext-wght-normal-QAYlOegK.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-latin-wght-normal-CZtBPCCa.woff2 +0 -0
- package/dashboard/dist/assets/roboto-mono-vietnamese-wght-normal-DlC-zuDL.woff2 +0 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/src/main.tsx +2 -0
- package/dashboard/src/styles.css +2 -2
- package/package.json +3 -1
- package/src/install.mjs +58 -0
- package/src/process.mjs +428 -0
- package/src/uninstall.mjs +179 -0
- package/src/update.mjs +194 -0
- package/dashboard/dist/assets/index-Cp7Swcz5.css +0 -1
- /package/dashboard/dist/assets/{index-BVbAwMVB.js → index-Ba0kF2tG.js} +0 -0
package/README.md
CHANGED
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm install -g llmtop
|
|
27
|
-
llmtop
|
|
27
|
+
llmtop start # Run in background (survives closing the terminal); llmtop stop to end
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Or run without installing
|
|
30
|
+
Or run in the foreground with `llmtop serve`, or without installing via `npx llmtop serve`. Open <http://localhost:4310>.
|
|
31
31
|
|
|
32
|
-
- **Local-only:** Binds `127.0.0.1` only; zero telemetry, zero
|
|
32
|
+
- **Local-only:** Binds `127.0.0.1` only; zero telemetry, zero background network requests (only `llmtop update` contacts npmjs when invoked), zero runtime npm dependencies.
|
|
33
33
|
- **Zero setup:** Automatically reads `~/.claude/projects`, `~/.codex/sessions`, and `~/.gemini/antigravity-cli`, skipping absent tools.
|
|
34
34
|
- **Persistent archive:** Copies transcripts into append-only `.jsonl.zst` frames and indexes them into SQLite (`node:sqlite`) under `~/.config/llmtop/data/`. Requires **Node.js 22.15+**.
|
|
35
35
|
|
|
@@ -90,15 +90,35 @@ Or run without installing: `npx llmtop serve`. Open <http://localhost:4310>.
|
|
|
90
90
|
CLI and dashboard totals stay identical for the same window and filters (`--json` supported on listing commands).
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
llmtop
|
|
93
|
+
llmtop start [--port n] # Start dashboard in background (log ~/.config/llmtop/data/serve.log)
|
|
94
|
+
llmtop serve [--port n] [--daemon] # Dashboard at http://localhost:4310 (--daemon detaches like start)
|
|
95
|
+
llmtop stop # Stop the running dashboard server
|
|
94
96
|
llmtop scan # Archive new transcript lines into usage.db
|
|
95
97
|
llmtop usage [--days n | --since d --until d] [--by day|model|provider|effort|project|session|hour|tool|skill|subagent]
|
|
96
98
|
[--provider name] [--project name] [--model family] [--effort level] [--json]
|
|
97
99
|
llmtop prices [--json] # Verify prices.md against host cost records
|
|
98
100
|
llmtop show <session>:<line> # Print one archived record
|
|
101
|
+
llmtop update [--check] [--json] [--force] # Check npmjs or upgrade to the latest release
|
|
102
|
+
llmtop uninstall [--purge] [--dry-run] [--yes]
|
|
103
|
+
# Stop llmtop and remove the global installation
|
|
99
104
|
llmtop --help | --version
|
|
100
105
|
```
|
|
101
106
|
|
|
107
|
+
## Update & Uninstall
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
llmtop update --check # Check npmjs for a newer release (supports --json)
|
|
111
|
+
llmtop update # Upgrade the global installation to the latest release
|
|
112
|
+
llmtop stop # Stop a running llmtop serve process
|
|
113
|
+
llmtop uninstall --dry-run # Preview what uninstall will stop, remove, or keep
|
|
114
|
+
llmtop uninstall # Stop llmtop and remove the global package (keeps ~/.config/llmtop)
|
|
115
|
+
llmtop uninstall --purge # Also remove ~/.config/llmtop (config, archive, and usage.db)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- **`llmtop start`** (or `llmtop serve --daemon`) detaches the dashboard from the terminal and writes logs to `~/.config/llmtop/data/serve.log` (using `systemd-run --user` on systemd Linux so closing the terminal will not stop it). Run `llmtop stop` to end it.
|
|
119
|
+
- **`llmtop update`** queries `registry.npmjs.org` only when invoked (never in the background), detects your global package manager (`npm`, `pnpm`, `yarn`, or `bun`), automatically stops a running background daemon (`llmtop start` / `--daemon`) before upgrading and restarts it on the new version, and warns if a foreground `llmtop serve` is running so you can restart it afterward. From a local Git checkout or `npx`, it prints manual steps unless `--force` is passed.
|
|
120
|
+
- **`llmtop uninstall`** stops running `llmtop serve` processes, removes the global package, and asks for confirmation in interactive terminals (pass `--yes` or `-y` in scripts). By default it keeps `~/.config/llmtop`; add `--purge` to delete local config, archive, and SQLite data. Original provider transcripts (`~/.claude`, `~/.codex`, `~/.gemini/antigravity-cli`) are never touched.
|
|
121
|
+
|
|
102
122
|
## Configuration
|
|
103
123
|
|
|
104
124
|
Optional settings live in `~/.config/llmtop/config.json` (see [llmtop.config.example.json](https://github.com/nguyencanhtrung/llmtop/blob/main/llmtop.config.example.json)). Override paths with `XDG_CONFIG_HOME`, `LLMTOP_CONFIG`, or `LLMTOP_DATA`. Token rates come from [prices.md](https://github.com/nguyencanhtrung/llmtop/blob/main/prices.md).
|
package/bin/llmtop.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { loadConfig, ROOT } from "../src/config.mjs";
|
|
4
|
+
import { defaultConfigDir, defaultConfigPath, loadConfig, ROOT } from "../src/config.mjs";
|
|
5
5
|
import { localTime } from "../src/format.mjs";
|
|
6
6
|
import { pricesCommand } from "../src/prices-command.mjs";
|
|
7
|
+
import { startCommand, stopCommand, writeServerState } from "../src/process.mjs";
|
|
7
8
|
import { scan, scanReport } from "../src/scan.mjs";
|
|
8
9
|
import { serve } from "../src/serve.mjs";
|
|
9
10
|
import { show } from "../src/show.mjs";
|
|
11
|
+
import { uninstallCommand } from "../src/uninstall.mjs";
|
|
12
|
+
import { updateCommand } from "../src/update.mjs";
|
|
10
13
|
import { usageCommand } from "../src/usage-command.mjs";
|
|
11
14
|
|
|
12
15
|
const { version: VERSION } = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8"));
|
|
@@ -18,15 +21,40 @@ const USAGE = `usage: llmtop <command> [options]
|
|
|
18
21
|
usage [--days n | --since d --until d] [--by day|model|provider|effort|project|session|hour|tool|skill|subagent]
|
|
19
22
|
[--provider name] [--project name] [--model family] [--effort level]
|
|
20
23
|
prices the price table checked against the host's cost records
|
|
21
|
-
serve [--port n]
|
|
24
|
+
serve [--port n] [--daemon] the built dashboard on http://localhost:<port>
|
|
25
|
+
start [--port n] start the dashboard in the background
|
|
26
|
+
stop stop the running llmtop serve process
|
|
27
|
+
update [--check] [--force] check npmjs or upgrade llmtop to the latest version
|
|
28
|
+
uninstall [--purge] [--dry-run] [--yes]
|
|
29
|
+
stop llmtop and remove the global installation
|
|
22
30
|
|
|
23
31
|
Options:
|
|
24
32
|
-h, --help show this help message
|
|
25
33
|
-v, --version show version (${VERSION})
|
|
26
34
|
|
|
27
|
-
Listing commands accept --json. Config and data default to ~/.config/llmtop
|
|
35
|
+
Listing commands and update --check accept --json. Config and data default to ~/.config/llmtop
|
|
28
36
|
(override with LLMTOP_CONFIG and LLMTOP_DATA).`;
|
|
29
37
|
|
|
38
|
+
function loadConfigOrDefault() {
|
|
39
|
+
try {
|
|
40
|
+
return loadConfig();
|
|
41
|
+
} catch {
|
|
42
|
+
return {
|
|
43
|
+
configPath: defaultConfigPath(),
|
|
44
|
+
data: process.env.LLMTOP_DATA || join(defaultConfigDir(), "data"),
|
|
45
|
+
providers: {},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function parsePort(options, config) {
|
|
51
|
+
const port = options.port === undefined ? config.port : Number(options.port);
|
|
52
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
53
|
+
throw new UsageError(`--port needs a port number, got ${options.port}`);
|
|
54
|
+
}
|
|
55
|
+
return port;
|
|
56
|
+
}
|
|
57
|
+
|
|
30
58
|
const COMMANDS = {
|
|
31
59
|
async scan({ config, out }) {
|
|
32
60
|
const t = await scan(config);
|
|
@@ -38,22 +66,61 @@ const COMMANDS = {
|
|
|
38
66
|
},
|
|
39
67
|
usage: usageCommand,
|
|
40
68
|
async serve({ config, options, out }) {
|
|
41
|
-
const port = options
|
|
42
|
-
if (
|
|
69
|
+
const port = parsePort(options, config);
|
|
70
|
+
if (options.daemon) {
|
|
71
|
+
return startCommand({ config, options: { ...options, port }, out });
|
|
72
|
+
}
|
|
73
|
+
if (process.env.LLMTOP_DAEMON === "1") {
|
|
74
|
+
process.on("SIGHUP", () => {});
|
|
75
|
+
}
|
|
43
76
|
const at = localTime(config.timeZone);
|
|
44
77
|
const server = await serve(config, { port, onScan: (t) => reportScan(t, out, `${at(new Date().toISOString())} `) });
|
|
78
|
+
const cleanup = writeServerState(config, {
|
|
79
|
+
pid: process.pid,
|
|
80
|
+
port: server.address().port,
|
|
81
|
+
version: VERSION,
|
|
82
|
+
token: process.env.LLMTOP_DAEMON_TOKEN,
|
|
83
|
+
daemon: process.env.LLMTOP_DAEMON === "1",
|
|
84
|
+
});
|
|
85
|
+
server.once("close", cleanup);
|
|
86
|
+
let closing = false;
|
|
87
|
+
const shutdown = () => {
|
|
88
|
+
if (closing) return;
|
|
89
|
+
closing = true;
|
|
90
|
+
cleanup();
|
|
91
|
+
server.closeAllConnections?.();
|
|
92
|
+
server.close(() => process.exit(0));
|
|
93
|
+
};
|
|
94
|
+
process.once("SIGINT", shutdown);
|
|
95
|
+
process.once("SIGTERM", shutdown);
|
|
45
96
|
out.write(`dashboard at http://localhost:${server.address().port}: its Refresh button scans again, Ctrl+C to stop\n`);
|
|
46
97
|
},
|
|
98
|
+
async start({ config, options, out }) {
|
|
99
|
+
const port = parsePort(options, config);
|
|
100
|
+
return startCommand({ config, options: { ...options, port }, out });
|
|
101
|
+
},
|
|
47
102
|
prices: pricesCommand,
|
|
103
|
+
stop: stopCommand,
|
|
104
|
+
update: updateCommand,
|
|
105
|
+
uninstall: uninstallCommand,
|
|
48
106
|
};
|
|
49
107
|
|
|
50
108
|
// Options are --name value or --flag; FLAGS lists the ones without a value.
|
|
51
|
-
const FLAGS = new Set(["json"]);
|
|
109
|
+
const FLAGS = new Set(["json", "check", "force", "purge", "dry-run", "yes", "daemon"]);
|
|
110
|
+
const LENIENT_CONFIG_COMMANDS = new Set(["stop", "update", "uninstall"]);
|
|
52
111
|
function parseArgs(argv) {
|
|
53
112
|
const positional = [];
|
|
54
113
|
const options = {};
|
|
55
114
|
for (let i = 0; i < argv.length; i++) {
|
|
56
115
|
const arg = argv[i];
|
|
116
|
+
if (arg === "-y") {
|
|
117
|
+
options.yes = true;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (arg === "-d") {
|
|
121
|
+
options.daemon = true;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
57
124
|
if (!arg.startsWith("--")) {
|
|
58
125
|
positional.push(arg);
|
|
59
126
|
continue;
|
|
@@ -90,7 +157,8 @@ async function main(argv) {
|
|
|
90
157
|
return 2;
|
|
91
158
|
}
|
|
92
159
|
const { positional, options } = parseArgs(rest);
|
|
93
|
-
|
|
160
|
+
const config = LENIENT_CONFIG_COMMANDS.has(command) ? loadConfigOrDefault() : loadConfig();
|
|
161
|
+
return (await run({ config, positional, options, out: process.stdout })) ?? 0;
|
|
94
162
|
}
|
|
95
163
|
|
|
96
164
|
try {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Montserrat Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/montserrat-cyrillic-ext-wght-normal-CO5hGrJv.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Montserrat Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/montserrat-cyrillic-wght-normal-EAA9jha_.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Montserrat Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/montserrat-vietnamese-wght-normal-k7S-YeeD.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Montserrat Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/montserrat-latin-ext-wght-normal-BsZE-iaG.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Montserrat Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/montserrat-latin-wght-normal-l_AIctKy.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-cyrillic-ext-wght-normal-BUDPrIko.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-cyrillic-wght-normal-HUlVHixE.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-greek-wght-normal-BJJTbwTT.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-vietnamese-wght-normal-DlC-zuDL.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-latin-ext-wght-normal-QAYlOegK.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/roboto-mono-latin-wght-normal-CZtBPCCa.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--brand-ink:#1a1a1a;--brand-paper:#f2f2f2;--brand-white:#fff;--brand-black:#000;--brand-tile-dark:#1a1a1a;--brand-tile-light:#f2f2f2;--brand-donut-1:#1a1a1a;--brand-donut-2:#3f3f3f;--brand-donut-3:#7f7f7f;--brand-donut-4:#d8d8d8;--page:var(--brand-paper);--surface:var(--brand-white);--raised:var(--brand-white);--ink:var(--brand-ink);--ink2:#3f3f3f;--muted:#7f7f7f;--hair:#e0e0e0;--base:#c8c8c8;--wash:#1a1a1a0d;--accent:#2a78d6;--accent-ink:#1c5cab;--s1:#2a78d6;--s2:#eb6834;--s3:#1baf7a;--s4:#eda100;--s5:#e87ba4;--s6:#0e9aa7;--s7:#8b5cf6;--s8:#6b8e23;--s9:#d946ef;--s10:#0284c7;--s11:#dc2626;--s12:#65a30d;--s13:#ea580c;--s14:#0d9488;--s15:#4f46e5;--s16:#ca8a04;--s0:#b9b8b0;--sub:#6d4fe8;--seq:#2a78d6;--v0:#c9c4fb;--v1:#9d93f5;--v2:#6f5ce6;--v3:#4630c0;--v4:#26177a;--k0:#d8d8d8;--k1:#888;--k2:#3f3f3f;--kw:repeating-linear-gradient(135deg, #d8d8d8 0 4px, #bebebe 4px 8px);--ck0:#3b6fd9;--ck1:#7c5bd1;--ck2:#a8864f;--good:#0ca30c;--up:#1c5cab;--neg:#d03b3b;--shadow:0 8px 28px #0000001a;--sb:#0b0b0b2e;--sb-hover:#0b0b0b57}:root[data-theme=dark]{--brand-donut-1:#fff;--brand-donut-2:#d8d8d8;--brand-donut-3:#888;--brand-donut-4:#3f3f3f;--page:#111;--surface:var(--brand-ink);--raised:#242424;--ink:var(--brand-white);--ink2:#d8d8d8;--muted:#888;--hair:#2c2c2c;--base:#3f3f3f;--wash:#ffffff12;--accent:#3987e5;--accent-ink:#86b6ef;--s1:#3987e5;--s2:#d95926;--s3:#199e70;--s4:#c98500;--s5:#d55181;--s6:#18b4c2;--s7:#a27bf8;--s8:#8ab03a;--s9:#e879f9;--s10:#38bdf8;--s11:#f87171;--s12:#a3e635;--s13:#fb923c;--s14:#2dd4bf;--s15:#818cf8;--s16:#facc15;--s0:#5a5a55;--sub:#7b66f0;--seq:#3987e5;--v0:#30286a;--v1:#4e42ae;--v2:#7c6ff0;--v3:#b2abff;--v4:#e4e1ff;--k0:#3f3f3f;--k1:#888;--k2:#d8d8d8;--kw:repeating-linear-gradient(135deg, #3f3f3f 0 4px, #555 4px 8px);--ck0:#5b8def;--ck1:#a07eea;--ck2:#c8a878;--good:#0ca30c;--up:#86b6ef;--neg:#e66767;--shadow:0 8px 28px #00000080;--sb:#ffffff29;--sb-hover:#ffffff52}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}body{background:var(--page);color:var(--ink);margin:0;font:14px/1.45 Montserrat Variable,Montserrat,system-ui,-apple-system,Segoe UI,sans-serif}button,select,input{font:inherit;color:inherit}code{font:12.5px/1 Roboto Mono Variable,Roboto Mono,ui-monospace,SF Mono,Menlo,monospace}.app{grid-template-columns:228px minmax(0,1fr);min-height:100vh;display:grid}.side{border-right:1px solid var(--hair);background:var(--surface);flex-direction:column;height:100vh;padding:22px 14px 16px;display:flex;position:sticky;top:0}.brand{align-items:center;padding:8px 10px 20px;display:flex}.brand .brand-lockup{flex:none;width:132px;height:auto;display:block}.navlabel{color:var(--muted);letter-spacing:.04em;text-transform:uppercase;margin:14px 10px 6px;font-size:11.5px;font-weight:600}.nav{flex-direction:column;gap:2px;display:flex}.nav button{text-align:left;cursor:pointer;width:100%;color:var(--ink2);background:0 0;border:0;border-radius:9px;align-items:center;gap:10px;padding:8px 10px;font-weight:500;display:flex}.nav button:hover{background:var(--wash);color:var(--ink)}.nav button[aria-current=page]{background:var(--wash);color:var(--ink);font-weight:600}.nav svg{stroke:currentColor;fill:none;stroke-width:1.7px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:16px;height:16px}.nav.quiet button{padding:6px 10px;font-size:13px}.side .foot{border-top:1px solid var(--hair);color:var(--ink2);grid-template-columns:minmax(0,1fr);gap:12px;margin-top:auto;padding:12px 0 0;font-size:12.5px;display:grid}.foot .scan{justify-content:space-between;align-items:center;gap:8px;padding-left:10px;display:flex}.foot .si{min-width:0;color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;line-height:1.4;overflow:hidden}.foot .si span{text-overflow:ellipsis;display:block;overflow:hidden}.foot .scan .icon{background:0 0}.foot .scan .icon:hover:not(:disabled){background:var(--wash)}.foot .prefs{justify-content:space-between;align-items:center;gap:8px;display:flex}.foot .icon{width:30px;height:30px;color:var(--ink2);border-radius:8px}.foot .icon:hover:not(:disabled){color:var(--ink)}.sr{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.mock{border:1px solid var(--base);border-radius:999px;margin-top:8px;padding:2px 8px;font-size:11.5px;font-weight:500;display:inline-block}main{min-width:0;padding:20px 36px 56px}.wrap{max-width:1320px;margin:0 auto}.seg{background:var(--wash);border-radius:10px;padding:3px;display:inline-flex}.seg button{cursor:pointer;color:var(--ink2);white-space:nowrap;background:0 0;border:0;border-radius:7px;padding:5px 11px;font-size:13px;font-weight:500}.seg button:hover{color:var(--ink)}.seg button[aria-pressed=true]{background:color-mix(in srgb, var(--accent) 16%, var(--raised));color:var(--accent-ink);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent)}.icon{background:var(--wash);cursor:pointer;border:0;border-radius:10px;place-items:center;width:34px;height:34px;display:grid}.icon svg{stroke:currentColor;fill:none;stroke-width:1.7px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px}.filters{flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 22px;display:flex}.field{border:1px solid var(--hair);background:var(--surface);height:34px;color:var(--ink2);border-radius:10px;align-items:center;gap:6px;padding:0 10px;font-size:13px;display:inline-flex}.field input{min-width:0;color:var(--ink);background:0 0;border:0;outline:none;font-size:13px}.clearall{color:var(--ink);cursor:pointer;gap:6px}.clearall svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;width:14px;height:14px}.clearall:hover{border-color:var(--base);background:var(--wash)}.rowlink{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;padding:0}.rowlink:focus-visible,.clearall:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.grid{gap:20px;display:grid}.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.two{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}.half{grid-template-columns:repeat(2,minmax(0,1fr))}.stack{gap:20px;display:grid}.card{border:1px solid var(--hair);background:var(--surface);border-radius:14px;min-width:0;padding:16px 20px 20px}.card>header{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 12px;min-height:28px;margin-bottom:14px;display:flex}.card>header .segs{flex-wrap:wrap;gap:8px;display:flex}.card>header .seg{padding:2px}.card>header .seg button{padding:3px 10px;line-height:18px}.card>header .field{height:28px}h2{letter-spacing:-.01em;margin:0;font-size:16px;font-weight:650}.hint{color:var(--ink2);font-size:12.5px}.link{color:var(--accent-ink);cursor:pointer;white-space:nowrap;background:0 0;border:0;padding:0;font-size:13px}.kpi{padding:16px 18px 14px}.kpi .l{color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;font-size:13px;overflow:hidden}.kpi .vr{justify-content:space-between;align-items:flex-end;gap:8px;margin-top:6px;display:flex}.kpi .v{letter-spacing:-.02em;min-width:0;font-size:28px;font-weight:620;line-height:1.1}.kpi .v small{letter-spacing:0;color:var(--ink2);white-space:nowrap;font-size:14px;font-weight:500}.kpi .d{color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;margin-top:10px;font-size:12.5px;overflow:hidden}.kpi .d b{color:var(--ink);font-weight:600}.kpi .d b.better{color:var(--good)}.kpi .d b.worse{color:var(--neg)}.kpi .d b.vol{color:var(--up)}.spark{flex:none;width:72px;height:24px;margin-bottom:4px;overflow:visible}.spark polyline{fill:none;stroke:var(--base);stroke-width:1.5px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}td .spark{margin:0}.spark circle{fill:var(--accent);stroke:var(--surface);stroke-width:2px}.legend{color:var(--ink2);flex-wrap:wrap;gap:4px 16px;margin:0 0 12px;padding:0;font-size:12.5px;list-style:none;display:flex}.legend i{vertical-align:-1px;border-radius:3px;width:10px;height:10px;margin-right:6px;display:inline-block}.legend b{color:var(--ink);margin-left:5px;font-weight:600}.v0{background:var(--v0)}.v1{background:var(--v1)}.v2{background:var(--v2)}.v3{background:var(--v3)}.v4{background:var(--v4)}.v5,.v6,.v7,.v8,.v9{background:var(--s0)}.split i.v0,.split i.v1{color:#0b0b0b}:root[data-theme=dark] .split i.v0,:root[data-theme=dark] .split i.v1{color:#fff}:root[data-theme=dark] .split i.v3,:root[data-theme=dark] .split i.v4{color:#0b0b0b}.lead{margin:0 0 16px;font-size:15.5px;line-height:1.5}.lead b{font-weight:650}.lead.accent{border-left:3px solid;padding:2px 0 2px 12px}.shares{grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:10px 14px;display:grid}.shares>span{color:var(--ink2);font-size:12.5px}.shares .split{margin:0}.lv{align-items:center;gap:7px;display:inline-flex}.lv i{border-radius:3px;width:9px;height:9px}.price td{padding-top:12px;padding-bottom:12px}.price td[data-tip]:hover{background:var(--wash)}.price .sub.up{color:var(--ink);font-weight:600}.x1{color:var(--ink2)}.c1{background:var(--s1)}.c2{background:var(--s2)}.c3{background:var(--s3)}.c4{background:var(--s4)}.c5{background:var(--s5)}.c6{background:var(--s6)}.c7{background:var(--s7)}.c8{background:var(--s8)}.c9{background:var(--s9)}.c10{background:var(--s10)}.c11{background:var(--s11)}.c12{background:var(--s12)}.c13{background:var(--s13)}.c14{background:var(--s14)}.c15{background:var(--s15)}.c16{background:var(--s16)}.c0{background:var(--s0)}.csub{background:var(--sub)}.chart{grid-template-columns:44px minmax(0,1fr);padding-top:10px;display:grid}.axis{height:230px;position:relative}.axis span{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:11.5px;position:absolute;right:8px;transform:translateY(50%)}.plot{border-bottom:1px solid var(--base);align-items:flex-end;height:230px;display:flex;position:relative}.plot .gl{background:var(--hair);height:1px;position:absolute;left:0;right:0}.col{outline:none;flex:1;justify-content:center;align-items:flex-end;min-width:0;height:100%;display:flex;position:relative}.col:hover,.col:focus-visible{background:var(--wash)}.bars{flex-direction:column;justify-content:flex-end;gap:2px;width:min(22px,64%);height:100%;display:flex}.bars i{min-height:1px;display:block}.bars i:first-child{border-radius:4px 4px 0 0}.col .x{color:var(--muted);white-space:nowrap;margin-top:8px;font-size:11.5px;position:absolute;top:100%}.col .x em{color:var(--ink2);margin-top:1px;font-style:normal;position:absolute;top:100%;left:0}.xpad{height:44px}.rank{grid-template-columns:minmax(84px,auto) minmax(0,1fr) auto;align-items:center;gap:9px 12px;display:grid}.rank .n{white-space:nowrap;text-overflow:ellipsis;max-width:170px;font-weight:550;overflow:hidden}.rank .n i{border-radius:3px;width:9px;height:9px;margin-right:7px;display:inline-block}.rank .b{background:var(--s1);border-radius:0 4px 4px 0;min-width:2px;height:8px;display:block}.rank .t{background:var(--wash);border-radius:4px;height:8px}.rank .val{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.rank .val small{color:var(--ink2);margin-left:6px;font-size:12px}.rank button.n{text-align:left;cursor:pointer;background:0 0;border:0;padding:0}.rank button.n:hover{color:var(--accent-ink)}.scroll{margin-inline:-10px;overflow-x:auto}table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%}th,td{text-align:left;vertical-align:top;border-bottom:1px solid var(--hair);white-space:nowrap;padding:10px 14px 10px 0;font-weight:400}tr:last-child td,tr:last-child th{border-bottom:0}th:first-child,td:first-child{padding-left:10px}th:last-child,td:last-child{padding-right:10px}thead th{color:var(--ink2);vertical-align:bottom;padding-top:0;padding-bottom:8px;font-size:12.5px;font-weight:500;border-bottom:1px solid var(--base)!important}thead th button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;padding:0}thead th[aria-sort] button{color:var(--ink);font-weight:600}.compare thead th,.wraphead thead th{white-space:normal;text-wrap:balance;min-width:76px}.flag{color:var(--ink2);vertical-align:super;cursor:default;outline-offset:2px;margin-left:2px;font-size:.55em}.num{text-align:right}.name{font-weight:550}.ph{display:none!important}.sub{color:var(--ink2);margin-top:2px;font-size:12.5px;font-weight:400;display:block}.title{white-space:normal;-webkit-line-clamp:2;-webkit-box-orient:vertical;min-width:140px;max-width:260px;display:-webkit-box;overflow:hidden}.sesstable .title,.sesstable td .sub{white-space:normal;max-width:460px}.sesstable .nw{white-space:nowrap}tbody tr.go{cursor:pointer}tbody tr.go:hover td,tbody tr.go:hover th{background:var(--wash)}.mix{gap:2px;width:84px;height:8px;margin-top:5px;display:flex}.mix i{min-width:2px;height:100%;display:block}.mix i:first-child{border-radius:4px 0 0 4px}.mix i:last-child{border-radius:0 4px 4px 0}.mix i:only-child{border-radius:4px}.heat{grid-template-columns:30px repeat(24,minmax(0,1fr));align-items:center;gap:2px;display:grid}.heat .rl{color:var(--ink2);font-size:12px}.heat .cl{color:var(--muted);text-align:left;padding-top:4px;font-size:11px}.heat .cell{aspect-ratio:1;background:color-mix(in srgb, var(--seq) var(--m), var(--wash));border-radius:3px;width:100%;max-height:26px}.heat .cell:hover{outline:2px solid var(--ink);outline-offset:-1px}.hstats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0 0;display:grid}.hstats div{align-content:start;gap:2px;min-width:0;display:grid}.hstats dt{color:var(--ink2);font-size:12px}.hstats dd{white-space:nowrap;align-items:center;gap:7px;margin:0;font-size:20px;font-weight:650;display:flex}.hstats .sub{color:var(--muted);font-size:12px}.hstats .sub .line{white-space:nowrap;display:block}.hstats dd.err{color:var(--neg)}.hstats+.rank,.hstats+.legend,.hstats+.rows{margin-top:18px}.lead+.hstats,header+.hstats{margin-top:2px}.hstats .gap{height:16px;display:block}.hstats .meter{background:var(--wash);border-radius:3px;height:6px;margin:6px 0 4px;display:block;overflow:hidden}.hstats .meter i{border-radius:3px;height:100%;display:block}.hstats .dots{flex-wrap:wrap;align-items:center;gap:3px;height:7px;margin:5px 0 4px;display:flex}.hstats .dots i{background:var(--wash);width:7px;height:7px;box-shadow:inset 0 0 0 1px var(--base);border-radius:50%}.hstats .dots i.on{background:var(--seq);box-shadow:none}.hstats .hsw{background:color-mix(in srgb, var(--seq) var(--m), var(--wash));border-radius:3px;width:12px;height:12px}.cseq{background:var(--seq)}.cneg{background:var(--neg)}.split{gap:2px;height:28px;margin:4px 0 12px;display:flex}.split i{color:#fff;white-space:nowrap;border-radius:4px;align-items:center;padding:0 9px;font-size:12.5px;font-style:normal;font-weight:600;display:flex;overflow:hidden}.split i:empty{padding:0}.split i.c4,.split i.c12,.split i.c14,.split i.c16{color:#0b0b0b}.split i.c0{color:var(--ink)}.money td.wide,.money th.wide{width:55%}.rank .b.k0{background:var(--k0)}.rank .b.k1{background:var(--k1)}.rank .b.k2{background:var(--k2)}.rank .b.kw{background:var(--kw)}.rank .b.kx{box-shadow:inset 0 0 0 1px var(--base);background:0 0}.split.kinds{cursor:default;min-width:240px;height:24px;margin:0}.k0{background:var(--k0)}.k1{background:var(--k1)}.k2{background:var(--k2)}.kw{background:var(--kw)}.kx{box-shadow:inset 0 0 0 1px var(--base);background:0 0}.split i.k0,.split i.k1,.split i.kw{color:#0b0b0b}.split i.k2{color:#fff}.split i.kx{color:var(--ink2)}:root[data-theme=dark] .split i.k0,:root[data-theme=dark] .split i.k1,:root[data-theme=dark] .split i.kw{color:#fff}:root[data-theme=dark] .split i.k2{color:#0b0b0b}.ck0{background:var(--ck0)}.ck1{background:var(--ck1)}.ck2{background:var(--ck2)}.empty{text-align:center;color:var(--ink2);padding:40px 0}#tip{z-index:9;border:1px solid var(--base);background:var(--raised);min-width:150px;max-width:400px;box-shadow:var(--shadow);pointer-events:none;border-radius:10px;padding:10px 12px;font-size:12.5px;display:none;position:fixed}#tip .h{color:var(--ink2);margin-bottom:6px}#tip .h:last-child{color:var(--ink);margin-bottom:0}#tip .r{align-items:center;gap:8px;display:flex}#tip .r span{flex:1;min-width:0}#tip .r b{white-space:nowrap}#tip .r i{border-radius:2px;flex:none;width:12px;height:3px}#tip .r span{color:var(--ink2)}#tip .r b{font-variant-numeric:tabular-nums;margin-left:auto;padding-left:16px;font-weight:600}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-corner{background:0 0}::-webkit-scrollbar-thumb{background:var(--sb) padding-box;border:3px solid #0000;border-radius:999px;min-height:36px}::-webkit-scrollbar-thumb:hover{background-color:var(--sb-hover)}@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:var(--sb) transparent}}.rank.tools .b{justify-content:flex-end;display:flex;overflow:hidden}.rank.tools .b i{background:var(--neg);height:100%}.rank .val small.err{color:var(--neg)}.rank .grp{color:var(--ink2);letter-spacing:.04em;text-transform:uppercase;grid-column:1/-1;margin-top:6px;font-size:11.5px;font-weight:600}.rank .grp:first-child{margin-top:0}.rank .b.parts{background:0 0;justify-content:flex-start;position:relative}.rank .b.parts b{flex:none;height:100%}.rank .b.parts i{position:absolute;top:0;right:0}.card>.disc.more{margin-top:10px}#tip .r i.neg{background:var(--neg)}.money td{vertical-align:middle}.sharebar{grid-template-columns:minmax(80px,1fr) 44px 64px;align-items:center;gap:10px;min-width:220px;padding-right:12px;display:grid}.sharebar .t{background:var(--wash);border-radius:4px;height:8px;overflow:hidden}.sharebar .t i{border-radius:4px;height:100%;display:block}.sharebar b{text-align:right;font-weight:600}.sharebar small{color:var(--ink2);text-align:right;font-size:12.5px}.rows{grid-template-columns:minmax(64px,auto) minmax(0,1fr);align-items:center;gap:10px 14px;display:grid}.rows.total{grid-template-columns:minmax(64px,auto) minmax(0,1fr) auto}.rows .num{color:var(--ink2);text-align:right;font-size:12.5px}.rows .n{white-space:nowrap;font-weight:550}.tree{position:relative}.tile{box-sizing:border-box;border:2px solid var(--surface);color:#fff;font:inherit;text-align:left;cursor:pointer;border-radius:10px;flex-direction:column;justify-content:flex-end;gap:2px;padding:8px 10px;transition:opacity .15s;display:flex;position:absolute;overflow:hidden}.tile b{white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}.tile span{opacity:.85;white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.tile.c4{color:#0b0b0b}.tile.c0{color:var(--ink)}.tile:hover{filter:brightness(1.08)}.tile:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.compare tfoot th,.compare tfoot td{color:var(--ink2);border-bottom:0;font-weight:600}.compare .quiet{color:var(--muted)}.ctl{flex:none;position:relative}.ctl svg,.search svg,.disc svg{fill:none;stroke:currentColor;stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:14px;height:14px}button.field{cursor:pointer}button.field:hover,button.field[aria-expanded=true],.field.search:focus-within{border-color:var(--base)}button.field:focus-visible,.disc:focus-visible,.clear:focus-visible,.cal-step:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.field.pick{color:var(--ink);gap:8px}.pick .pv{text-overflow:ellipsis;white-space:nowrap;max-width:200px;overflow:hidden}.pick .chev{color:var(--muted);transition:transform .15s}.field.pick.on{border-color:color-mix(in srgb, var(--accent) 45%, transparent);background:color-mix(in srgb, var(--accent) 9%, var(--surface));color:var(--accent-ink)}.field.pick.on .chev{color:var(--accent-ink)}.pick[aria-expanded=true] .chev{transform:rotate(180deg)}.pick .cal{color:var(--ink2)}.pop{z-index:8;border:1px solid var(--base);background:var(--raised);min-width:100%;box-shadow:var(--shadow);border-radius:12px;outline:none;padding:6px;position:absolute;top:calc(100% + 6px);left:0}.ttl{align-items:center;gap:6px;display:flex}.ib{width:22px;height:22px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;display:grid}.ib:hover,.ib[aria-expanded=true]{background:var(--wash);color:var(--ink)}.ib svg{fill:none;stroke:currentColor;stroke-width:1.4px;stroke-linecap:round;width:15px;height:15px}.pop.note{width:min(340px,100vw - 16px);color:var(--ink2);white-space:normal;padding:12px 14px;font-size:13px;line-height:1.5}.pop.note p{margin:0 0 8px}.pop.note ul{margin:0;padding-left:16px}.pop.note li+li{margin-top:4px}.note b{color:var(--ink);font-weight:600}.list{min-width:190px;max-height:340px;overflow-y:auto}.opt{color:var(--ink2);white-space:nowrap;cursor:pointer;border-radius:8px;justify-content:space-between;align-items:center;gap:16px;padding:7px 10px;font-size:13px;display:flex}.opt.active{background:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--ink)}.opt[aria-selected=true]{color:var(--accent-ink);font-weight:600}.opt .tick{color:var(--accent-ink)}.cal-pop{padding:12px 14px 10px}.cal-nav{pointer-events:none;justify-content:space-between;display:flex;position:absolute;top:12px;left:12px;right:12px}.cal-step{width:28px;height:28px;color:var(--ink2);cursor:pointer;pointer-events:auto;background:0 0;border:0;border-radius:8px;place-items:center;display:grid}.cal-step:hover:not(:disabled){background:var(--wash);color:var(--ink)}.cal-step:disabled{opacity:.3;cursor:default}.cal-months{gap:28px;display:flex}.cal-title{text-align:center;height:28px;margin-bottom:4px;font-size:13.5px;font-weight:600;line-height:28px}.cal-title:first-letter{text-transform:uppercase}.cal-row{grid-template-columns:repeat(7,36px);display:grid}.cal-wd{text-align:center;height:26px;color:var(--muted);font-size:11.5px;line-height:26px}.cal-cell{place-items:center;height:34px;margin:1px 0;display:grid}.cal-cell.in{background:color-mix(in srgb, var(--accent) 13%, transparent)}.cal-cell.lo,.cal-cell.in:first-child,.blank+.cal-cell.in{border-top-left-radius:9px;border-bottom-left-radius:9px}.cal-cell.hi,.cal-cell.in:last-child{border-top-right-radius:9px;border-bottom-right-radius:9px}.cal-cell.in:has(+.blank){border-top-right-radius:9px;border-bottom-right-radius:9px}.cal-day{width:34px;height:34px;color:var(--ink);font-variant-numeric:tabular-nums;cursor:pointer;background:0 0;border:0;border-radius:9px;font-size:13px}.cal-day:hover:not(:disabled){background:var(--wash)}.cal-day.today{box-shadow:inset 0 0 0 1px var(--base)}.cal-day.end,.cal-day.end:hover{background:var(--accent);color:#fff;box-shadow:none;font-weight:600}.cal-day:disabled{color:var(--muted);opacity:.45;cursor:default}.cal-day:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.field.search{gap:7px}.search .mag{color:var(--muted)}.search input{width:200px}.clear{width:22px;height:22px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;margin-right:-5px;display:grid}.clear:hover{background:var(--wash);color:var(--ink)}.disc{color:var(--ink2);cursor:pointer;background:0 0;border:0;border-radius:7px;align-items:center;gap:6px;margin-left:-6px;padding:4px 8px 4px 6px;font-size:12.5px;display:inline-flex}.disc:hover{background:var(--wash);color:var(--ink)}.disc svg{transition:transform .15s}.disc[aria-expanded=true] svg{transform:rotate(90deg)}.disclosure .scroll{margin-top:10px}@media (prefers-reduced-motion:reduce){.pick .chev,.disc svg{transition:none}}@media (width<=1400px){.o3{display:none}.filters{gap:8px}.pick .pv{max-width:112px}.range .pv{max-width:none}.filters .seg button{padding:5px 7px}}@media (width<=1500px){.wraphead .o3{display:none}}@media (width<=1060px){.two,.half{grid-template-columns:minmax(0,1fr)}.o2{display:none}}@media (width<=880px){.app{display:block}.side{border-right:0;border-bottom:1px solid var(--hair);scrollbar-width:none;flex-direction:row;align-items:center;gap:4px 6px;height:auto;padding:10px 16px;position:static;overflow-x:auto}.side::-webkit-scrollbar{display:none}.nav{flex:none}.brand{flex:none;padding:6px 10px 6px 2px}.brand .brand-lockup{width:120px}.navlabel,.foot .si{display:none}.foot .scan{padding:0}.foot .scan .icon{background:var(--wash)}.side .foot{background:var(--surface);border-top:0;align-self:stretch;align-items:center;gap:6px;margin:0 -16px 0 auto;padding:0 16px 0 10px;display:flex;position:sticky;right:-16px}.nav{flex-direction:row}.nav button{white-space:nowrap}.nav svg{display:none}.nav.quiet button{padding:8px 10px;font-size:14px}main{padding:20px 20px 48px}.title{max-width:200px}.filters{gap:8px}.filters .seg button{padding:5px 6px;font-size:12.5px}.field{padding:0 8px}}@media (width<=600px){main{padding:16px 16px 40px}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.grid,.stack{gap:14px}.kpi .spark{display:none}.kpi .d{white-space:normal}.kpi .v{font-size:24px}.card{padding:16px}.o1{display:none}.title{max-width:160px}.search input{width:150px}.ph{white-space:normal;max-width:170px;display:block!important}thead th{white-space:normal}.mix.wide{width:84px!important}th,td{padding-right:10px}.axis,.plot{height:190px}.chart{grid-template-columns:38px minmax(0,1fr)}.heat{grid-template-columns:32px repeat(24,minmax(0,1fr));gap:1px}.hstats{grid-template-columns:repeat(2,minmax(0,1fr))}.rank .n{max-width:120px}.price th,.price td{padding-right:8px;font-size:13px}.price .lv{gap:5px}}.refresh:disabled{cursor:progress}.refresh.busy svg{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.refresh.busy svg{animation-duration:3s}}.alert{color:var(--neg);margin:-6px 0 0;font-size:12.5px}.loading{text-align:center;color:var(--ink2);padding:80px 0}.boot{place-items:center;min-height:100vh;padding:24px 16px;display:grid}.boot-in{gap:14px;width:min(400px,100%);margin-top:-8vh;display:grid}.boot .brand{padding:8px 0 12px}.boot .brand .brand-lockup{width:160px}.boot-msg{margin:0;font-size:15px;font-weight:550}.boot-err{color:var(--neg);overflow-wrap:anywhere;margin:0;font-size:13px}.boot .clearall{justify-self:start}.boot-bar{background:var(--wash);border-radius:3px;height:6px;overflow:hidden}.boot-bar span{background:var(--accent);border-radius:3px;width:0;height:100%;transition:width .3s;display:block}.boot-bar.wait span{width:30%;animation:1.2s ease-in-out infinite boot-wait}@keyframes boot-wait{0%{transform:translate(-100%)}to{transform:translate(340%)}}.boot-count{color:var(--ink2);font-variant-numeric:tabular-nums;margin:0;font-size:12.5px}@media (prefers-reduced-motion:reduce){.boot-bar span{transition:none}.boot-bar.wait span{opacity:.35;width:100%;animation:none}}.plot .bands,.plot .bands i,.plot .bands svg{pointer-events:none;position:absolute;inset:0}.plot .bands svg{width:100%;height:100%;overflow:visible}.plot .bands i{opacity:.42;-webkit-mask-image:linear-gradient(#000 20%,#00000026);mask-image:linear-gradient(#000 20%,#00000026)}:root[data-theme=dark] .plot .bands i{opacity:.62}.plot .bands polyline{fill:none;stroke:var(--base);stroke-width:2px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}.plot .bands polyline.c0{stroke:var(--s0)}.plot .bands polyline.c1{stroke:var(--s1)}.plot .bands polyline.c2{stroke:var(--s2)}.plot .bands polyline.c3{stroke:var(--s3)}.plot .bands polyline.c4{stroke:var(--s4)}.plot .bands polyline.c5{stroke:var(--s5)}.plot .bands polyline.c6{stroke:var(--s6)}.plot .bands polyline.c7{stroke:var(--s7)}.plot .bands polyline.c8{stroke:var(--s8)}.plot .bands polyline.c9{stroke:var(--s9)}.plot .bands polyline.c10{stroke:var(--s10)}.plot .bands polyline.c11{stroke:var(--s11)}.plot .bands polyline.c12{stroke:var(--s12)}.plot .bands polyline.c13{stroke:var(--s13)}.plot .bands polyline.c14{stroke:var(--s14)}.plot .bands polyline.c15{stroke:var(--s15)}.plot .bands polyline.c16{stroke:var(--s16)}.plot .bands polyline.csub{stroke:var(--sub)}.plot .bands polyline.v0{stroke:var(--v0)}.plot .bands polyline.v1{stroke:var(--v1)}.plot .bands polyline.v2{stroke:var(--v2)}.plot .bands polyline.v3{stroke:var(--v3)}.plot .bands polyline.v4{stroke:var(--v4)}.plot .bands polyline.k0{stroke:var(--k0)}.plot .bands polyline.k1{stroke:var(--k1)}.plot .bands polyline.k2{stroke:var(--k2)}.plot .bands polyline.kw,.plot .bands polyline.kx{stroke:var(--base)}.plot.area .col:hover,.plot.area .col:focus-visible{background:0 0}.plot.area .col:hover:before,.plot.area .col:focus-visible:before{content:"";background:var(--ink);opacity:.55;width:1px;position:absolute;top:0;bottom:0;left:50%}.plot.area .col .dot{z-index:1;width:8px;height:8px;box-shadow:0 0 0 2px var(--surface);pointer-events:none;border-radius:50%;margin:0 0 -4px -4px;display:none;position:absolute;left:50%}.plot.area .col:hover .dot,.plot.area .col:focus-visible .dot{display:block}.spark polygon{stroke:none}.spark .g0{stop-color:var(--ink2);stop-opacity:.2}.spark .g1{stop-color:var(--ink2);stop-opacity:0}.magbar{min-width:56px;padding-bottom:6px;display:inline-block;position:relative}.magbar:after{content:"";height:3px;width:calc(var(--w) * 56px);background:var(--ink2);opacity:.55;border-radius:2px;position:absolute;bottom:0;right:0}.panels{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 32px;display:grid}.panel h3{color:var(--ink2);margin:0 0 10px;font-size:13px;font-weight:600}@media (width<=1060px){.panels{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=640px){.panels{grid-template-columns:minmax(0,1fr)}}.chartseg button{align-items:center;display:inline-flex}.chartseg svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px}.card>header .segs{align-items:center}.gauge{margin:2px 0 6px}.gauge .track{gap:2px;height:14px;display:flex}.gauge .track i{height:100%;display:block}.gauge .track i:first-child{border-radius:4px 0 0 4px}.gauge .track i:last-child{border-radius:0 4px 4px 0}.gauge .ticks{height:18px;color:var(--muted);font-variant-numeric:tabular-nums;margin-top:6px;font-size:11.5px;position:relative}.gauge .ticks span{white-space:nowrap;position:absolute;top:0;transform:translate(-50%)}.gauge .ticks span:first-child{transform:none}.gauge .ticks span:last-child{color:var(--ink2);transform:translate(-100%)}.ctx .hstats{grid-template-columns:repeat(3,minmax(0,1fr));margin:16px 0 18px}.ctx .hstats .tipped{cursor:default;-webkit-text-decoration:underline dotted var(--base);text-decoration:underline dotted var(--base);text-underline-offset:5px;outline-offset:3px}.ctx td,.ctx th{vertical-align:middle}.ctx td.lbl{font-weight:550}.ctx td.lbl .sub{margin:0 0 0 6px;display:inline}.ctx tfoot td{border-top:1px solid var(--base);color:var(--ink2);border-bottom:0;font-weight:600}.ctx .better{color:var(--good);font-weight:600}.ctx .worse{color:var(--neg);font-weight:600}.cell-bar{width:42%}td.cell-bar .split.kinds{min-width:0;height:20px;margin:0}.bar1{background:var(--s1);border-radius:0 4px 4px 0;min-width:2px;height:8px;display:block}.est{border:1px dashed var(--base);height:22px;color:var(--ink2);font:inherit;cursor:default;background:0 0;border-radius:999px;align-items:center;padding:0 9px;font-size:12px;font-weight:500;display:inline-flex}.est:hover,.est:focus-visible{color:var(--ink);border-color:var(--ink2)}.chip{background:color-mix(in srgb, var(--accent) 16%, var(--raised));color:var(--accent-ink);vertical-align:1px;border-radius:999px;margin-left:8px;padding:1px 7px;font-size:11.5px;font-weight:600;display:inline-block}.ctx tbody tr.now td{--line:color-mix(in srgb, var(--accent) 45%, transparent);background:color-mix(in srgb, var(--accent) 7%, transparent);box-shadow:inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line)}.ctx tbody tr.now td:first-child{box-shadow:inset 1px 1px 0 var(--line), inset 0 -1px 0 var(--line);border-radius:8px 0 0 8px}.ctx tbody tr.now td:last-child{box-shadow:inset -1px 1px 0 var(--line), inset 0 -1px 0 var(--line);border-radius:0 8px 8px 0}@media (width<=600px){.ctx .hstats{grid-template-columns:repeat(3,minmax(0,1fr))}.ctx .hstats dd{font-size:17px}}.kpi{container-type:inline-size}@container (width<=260px){.kpis:has(.v small) .spark{display:none}}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
|
10
10
|
<link rel="manifest" href="/site.webmanifest">
|
|
11
11
|
<meta name="theme-color" content="#1A1A1A">
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-Ba0kF2tG.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-NQzaBVIY.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
package/dashboard/src/main.tsx
CHANGED
package/dashboard/src/styles.css
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
* { box-sizing: border-box; }
|
|
26
26
|
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
|
|
27
27
|
html[data-theme="dark"] { color-scheme: dark; }
|
|
28
|
-
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
28
|
+
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 "Montserrat Variable", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
29
29
|
button, select, input { font: inherit; color: inherit; }
|
|
30
|
-
code { font: 12.5px/1 "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace; }
|
|
30
|
+
code { font: 12.5px/1 "Roboto Mono Variable", "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace; }
|
|
31
31
|
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
|
|
32
32
|
|
|
33
33
|
/* sidebar */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llmtop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local usage and cost analytics dashboard and CLI for Claude Code, Codex and Antigravity",
|
|
6
6
|
"author": "Trung Nguyen",
|
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
"test": "node --test \"test/*.test.mjs\" \"dashboard/src/*.test.ts\""
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
+
"@fontsource-variable/montserrat": "^5.3.0",
|
|
67
|
+
"@fontsource-variable/roboto-mono": "^5.3.0",
|
|
66
68
|
"@types/node": "^26.6.6",
|
|
67
69
|
"@types/react": "^19.3.0",
|
|
68
70
|
"@types/react-dom": "^19.3.0",
|
package/src/install.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { ROOT } from "./config.mjs";
|
|
5
|
+
|
|
6
|
+
export function detectInstallMode({ root = ROOT, exists = existsSync } = {}) {
|
|
7
|
+
const normalized = root.replace(/\\/g, "/");
|
|
8
|
+
if (normalized.includes("/_npx/")) return { mode: "npx", packageManager: "npm", root };
|
|
9
|
+
if (!normalized.includes("/node_modules/") && exists(join(root, ".git"))) return { mode: "local", packageManager: null, root };
|
|
10
|
+
if (normalized.includes("/pnpm/") || normalized.includes("/pnpm-global/")) return { mode: "global", packageManager: "pnpm", root };
|
|
11
|
+
if (normalized.includes("/yarn/") || normalized.includes("/.yarn/")) return { mode: "global", packageManager: "yarn", root };
|
|
12
|
+
if (normalized.includes("/.bun/")) return { mode: "global", packageManager: "bun", root };
|
|
13
|
+
if (normalized.includes("/node_modules/")) return { mode: "global", packageManager: "npm", root };
|
|
14
|
+
return { mode: "unknown", packageManager: "npm", root };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function packageManagerCommand(pm, action, spec) {
|
|
18
|
+
const table = {
|
|
19
|
+
npm: { install: ["npm", ["install", "-g", spec]], uninstall: ["npm", ["uninstall", "-g", spec]] },
|
|
20
|
+
pnpm: { install: ["pnpm", ["add", "-g", spec]], uninstall: ["pnpm", ["remove", "-g", spec]] },
|
|
21
|
+
yarn: { install: ["yarn", ["global", "add", spec]], uninstall: ["yarn", ["global", "remove", spec]] },
|
|
22
|
+
bun: { install: ["bun", ["add", "-g", spec]], uninstall: ["bun", ["remove", "-g", spec]] },
|
|
23
|
+
};
|
|
24
|
+
const manager = table[pm] ?? table.npm;
|
|
25
|
+
return manager[action];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function formatCommand(cmd, args) {
|
|
29
|
+
return [cmd, ...args].join(" ");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function runPackageManager(pm, action, spec, { spawn = spawnSync, platform = process.platform } = {}) {
|
|
33
|
+
const [cmd, args] = packageManagerCommand(pm, action, spec);
|
|
34
|
+
const command = formatCommand(cmd, args);
|
|
35
|
+
const res = spawn(cmd, args, { encoding: "utf8", stdio: "pipe", shell: platform === "win32" });
|
|
36
|
+
const stdout = res.stdout ?? "";
|
|
37
|
+
const stderr = res.stderr ?? "";
|
|
38
|
+
const error = res.error ? res.error.message : "";
|
|
39
|
+
const ok = !res.error && res.status === 0;
|
|
40
|
+
const permissionDenied = /EACCES|EPERM|permission denied/i.test(`${stderr}\n${error}`);
|
|
41
|
+
return { ok, code: res.status ?? 1, stdout, stderr, error, command, permissionDenied };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function hasGlobalPackage(pm = "npm", pkgName = "llmtop", { spawn = spawnSync, platform = process.platform } = {}) {
|
|
45
|
+
if (pm !== "npm") return false;
|
|
46
|
+
try {
|
|
47
|
+
const res = spawn("npm", ["list", "-g", pkgName, "--depth=0", "--json"], {
|
|
48
|
+
encoding: "utf8",
|
|
49
|
+
stdio: "pipe",
|
|
50
|
+
shell: platform === "win32",
|
|
51
|
+
});
|
|
52
|
+
if (res.status !== 0 || !res.stdout?.trim()) return false;
|
|
53
|
+
const parsed = JSON.parse(res.stdout);
|
|
54
|
+
return Boolean(parsed?.dependencies?.[pkgName]);
|
|
55
|
+
} catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/process.mjs
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { defaultConfigDir, ROOT } from "./config.mjs";
|
|
5
|
+
|
|
6
|
+
export function serverStatePath(config) {
|
|
7
|
+
return join(config.data, "serve.json");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function serverLogPath(config) {
|
|
11
|
+
return join(config.data, "serve.log");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Writes serve.json atomically and returns a cleanup callback that removes it only if the PID still matches.
|
|
15
|
+
export function writeServerState(config, { pid = process.pid, port, version, token, daemon = false }) {
|
|
16
|
+
const path = serverStatePath(config);
|
|
17
|
+
mkdirSync(config.data, { recursive: true });
|
|
18
|
+
const tmp = join(config.data, `.serve.${pid}.${process.hrtime.bigint()}.tmp`);
|
|
19
|
+
const body = { pid, port, startedAt: new Date().toISOString(), version, daemon: Boolean(daemon) };
|
|
20
|
+
if (token !== undefined) body.token = token;
|
|
21
|
+
const payload = JSON.stringify(body, null, 2);
|
|
22
|
+
writeFileSync(tmp, `${payload}\n`);
|
|
23
|
+
renameSync(tmp, path);
|
|
24
|
+
return () => {
|
|
25
|
+
try {
|
|
26
|
+
const current = JSON.parse(readFileSync(path, "utf8"));
|
|
27
|
+
if (current?.pid === pid) unlinkSync(path);
|
|
28
|
+
} catch {
|
|
29
|
+
// Missing or already replaced state file needs no cleanup.
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function readServerState(config, { exists = existsSync, readFile = readFileSync } = {}) {
|
|
35
|
+
const path = serverStatePath(config);
|
|
36
|
+
if (!exists(path)) return null;
|
|
37
|
+
try {
|
|
38
|
+
const parsed = JSON.parse(readFile(path, "utf8"));
|
|
39
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
40
|
+
} catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function isPidAlive(pid) {
|
|
46
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
47
|
+
try {
|
|
48
|
+
process.kill(pid, 0);
|
|
49
|
+
return true;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
return err?.code === "EPERM";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function isLlmtopServeCommand(command) {
|
|
56
|
+
if (typeof command !== "string") return false;
|
|
57
|
+
const trimmed = command.trim();
|
|
58
|
+
if (!trimmed) return false;
|
|
59
|
+
if (/^(?:\/[\w/.-]*\/)?(?:sh|bash|zsh|fish|grep|rg|awk|sed)\b/.test(trimmed)) return false;
|
|
60
|
+
return /(?:^|[\s"'/\\])llmtop(?:\.mjs|\.cmd|\.ps1)?["']?\s+serve(?:\s|$)/.test(trimmed);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function listOsProcesses({ spawn = spawnSync, platform = process.platform } = {}) {
|
|
64
|
+
try {
|
|
65
|
+
if (platform === "win32") {
|
|
66
|
+
const res = spawn(
|
|
67
|
+
"powershell.exe",
|
|
68
|
+
["-NoProfile", "-Command", "Get-CimInstance Win32_Process | Select-Object ProcessId,CommandLine | ConvertTo-Json -Compress"],
|
|
69
|
+
{ encoding: "utf8", stdio: "pipe" },
|
|
70
|
+
);
|
|
71
|
+
if (res.status !== 0 || !res.stdout?.trim()) return [];
|
|
72
|
+
const parsed = JSON.parse(res.stdout);
|
|
73
|
+
const list = Array.isArray(parsed) ? parsed : [parsed];
|
|
74
|
+
return list
|
|
75
|
+
.filter((item) => item && Number.isInteger(Number(item.ProcessId)) && Number(item.ProcessId) > 0)
|
|
76
|
+
.map((item) => ({ pid: Number(item.ProcessId), command: String(item.CommandLine || "") }));
|
|
77
|
+
}
|
|
78
|
+
const res = spawn("ps", ["-eo", "pid=,args="], { encoding: "utf8", stdio: "pipe" });
|
|
79
|
+
if (res.status !== 0 || !res.stdout) return [];
|
|
80
|
+
const processes = [];
|
|
81
|
+
for (const line of res.stdout.split(/\r?\n/)) {
|
|
82
|
+
const match = line.match(/^\s*(\d+)\s+(.+)$/);
|
|
83
|
+
if (!match) continue;
|
|
84
|
+
processes.push({ pid: Number(match[1]), command: match[2].trim() });
|
|
85
|
+
}
|
|
86
|
+
return processes;
|
|
87
|
+
} catch {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function parsePortFromCommand(command) {
|
|
93
|
+
const match = command.match(/(?:^|\s)--port(?:=|\s+)(\d+)\b/);
|
|
94
|
+
return match ? Number(match[1]) : null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function readProcEnv(pid, readFile = readFileSync) {
|
|
98
|
+
try {
|
|
99
|
+
const raw = readFile(`/proc/${pid}/environ`, "utf8");
|
|
100
|
+
const env = {};
|
|
101
|
+
for (const entry of raw.split("\0")) {
|
|
102
|
+
const idx = entry.indexOf("=");
|
|
103
|
+
if (idx > 0) env[entry.slice(0, idx)] = entry.slice(idx + 1);
|
|
104
|
+
}
|
|
105
|
+
return env;
|
|
106
|
+
} catch {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function belongsToConfig(pid, config, env, readFile) {
|
|
112
|
+
const procEnv = readProcEnv(pid, readFile);
|
|
113
|
+
if (!procEnv) return true;
|
|
114
|
+
if (procEnv.LLMTOP_DATA && resolve(procEnv.LLMTOP_DATA) !== resolve(config.data)) return false;
|
|
115
|
+
if (procEnv.LLMTOP_CONFIG && config.configPath && resolve(procEnv.LLMTOP_CONFIG) !== resolve(config.configPath)) return false;
|
|
116
|
+
if (procEnv.XDG_CONFIG_HOME !== env.XDG_CONFIG_HOME) return false;
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function findRunningServers(config, deps = {}) {
|
|
121
|
+
const {
|
|
122
|
+
listProcesses,
|
|
123
|
+
isAlive = isPidAlive,
|
|
124
|
+
selfPid = process.pid,
|
|
125
|
+
root = ROOT,
|
|
126
|
+
env = process.env,
|
|
127
|
+
exists = existsSync,
|
|
128
|
+
readFile = readFileSync,
|
|
129
|
+
} = deps;
|
|
130
|
+
const defaultDataDir = resolve(join(defaultConfigDir(env), "data"));
|
|
131
|
+
const isDefaultData = resolve(config.data) === defaultDataDir;
|
|
132
|
+
const isRepoData = resolve(config.data) === resolve(join(root, "data"));
|
|
133
|
+
const scanProcesses = deps.includeProcessScan ?? (Boolean(listProcesses) || isDefaultData);
|
|
134
|
+
const osList = (listProcesses ?? listOsProcesses)();
|
|
135
|
+
const osByPid = new Map(osList.map((p) => [p.pid, p]));
|
|
136
|
+
const byPid = new Map();
|
|
137
|
+
let staleState = false;
|
|
138
|
+
|
|
139
|
+
const statePath = serverStatePath(config);
|
|
140
|
+
if (exists(statePath)) {
|
|
141
|
+
const state = readServerState(config, { exists, readFile });
|
|
142
|
+
if (state && Number.isInteger(state.pid) && state.pid > 0) {
|
|
143
|
+
if (state.pid !== selfPid) {
|
|
144
|
+
const osEntry = osByPid.get(state.pid);
|
|
145
|
+
const matchesOs = osList.length === 0 || (osEntry && isLlmtopServeCommand(osEntry.command));
|
|
146
|
+
if (isAlive(state.pid) && matchesOs) {
|
|
147
|
+
byPid.set(state.pid, { pid: state.pid, port: state.port ?? null, source: "state", daemon: Boolean(state.daemon) });
|
|
148
|
+
} else {
|
|
149
|
+
staleState = true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
staleState = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const pidFile = join(root, "data", "serve.pid");
|
|
158
|
+
if (isRepoData && exists(pidFile)) {
|
|
159
|
+
try {
|
|
160
|
+
const pid = Number(readFile(pidFile, "utf8").trim());
|
|
161
|
+
if (Number.isInteger(pid) && pid > 0 && pid !== selfPid && isAlive(pid)) {
|
|
162
|
+
const osEntry = osByPid.get(pid);
|
|
163
|
+
if (osEntry && isLlmtopServeCommand(osEntry.command)) {
|
|
164
|
+
const existing = byPid.get(pid);
|
|
165
|
+
if (existing) existing.pidFile = pidFile;
|
|
166
|
+
else byPid.set(pid, { pid, port: parsePortFromCommand(osEntry.command), source: "pidfile", pidFile, daemon: false });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} catch {
|
|
170
|
+
// Ignore unreadable legacy pidfile.
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (scanProcesses) {
|
|
175
|
+
for (const proc of osList) {
|
|
176
|
+
if (proc.pid === selfPid || byPid.has(proc.pid) || !isLlmtopServeCommand(proc.command)) continue;
|
|
177
|
+
if (!listProcesses && !belongsToConfig(proc.pid, config, env, readFile)) continue;
|
|
178
|
+
byPid.set(proc.pid, { pid: proc.pid, port: parsePortFromCommand(proc.command), source: "process", daemon: false });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return { servers: [...byPid.values()].sort((a, b) => a.pid - b.pid), staleState };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async function waitForExit(pid, isAlive, sleep, timeoutMs) {
|
|
186
|
+
const deadline = Date.now() + timeoutMs;
|
|
187
|
+
while (isAlive(pid)) {
|
|
188
|
+
if (Date.now() >= deadline) return false;
|
|
189
|
+
await sleep(50);
|
|
190
|
+
}
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export async function stopRunningServers(config, deps = {}) {
|
|
195
|
+
const {
|
|
196
|
+
kill = process.kill,
|
|
197
|
+
sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
198
|
+
timeoutMs = 3000,
|
|
199
|
+
unlink = unlinkSync,
|
|
200
|
+
isAlive = isPidAlive,
|
|
201
|
+
exists = existsSync,
|
|
202
|
+
readFile = readFileSync,
|
|
203
|
+
} = deps;
|
|
204
|
+
const { servers, staleState } = findRunningServers(config, { ...deps, isAlive, exists, readFile });
|
|
205
|
+
const stopped = [];
|
|
206
|
+
const failed = [];
|
|
207
|
+
|
|
208
|
+
for (const server of servers) {
|
|
209
|
+
try {
|
|
210
|
+
kill(server.pid, "SIGTERM");
|
|
211
|
+
} catch (err) {
|
|
212
|
+
if (err?.code !== "ESRCH") {
|
|
213
|
+
failed.push({ ...server, error: err?.message ?? String(err) });
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
let exited = await waitForExit(server.pid, isAlive, sleep, timeoutMs);
|
|
218
|
+
if (!exited) {
|
|
219
|
+
try {
|
|
220
|
+
kill(server.pid, "SIGKILL");
|
|
221
|
+
} catch (err) {
|
|
222
|
+
if (err?.code !== "ESRCH") {
|
|
223
|
+
failed.push({ ...server, error: err?.message ?? String(err) });
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exited = await waitForExit(server.pid, isAlive, sleep, 500);
|
|
228
|
+
}
|
|
229
|
+
if (!exited && isAlive(server.pid)) {
|
|
230
|
+
failed.push({ ...server, error: "process did not exit" });
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
stopped.push(server);
|
|
234
|
+
if (server.pidFile) {
|
|
235
|
+
try {
|
|
236
|
+
unlink(server.pidFile);
|
|
237
|
+
} catch {
|
|
238
|
+
// Ignore missing legacy pidfile.
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
let cleanedState = false;
|
|
244
|
+
const statePath = serverStatePath(config);
|
|
245
|
+
if (exists(statePath)) {
|
|
246
|
+
const state = readServerState(config, { exists, readFile });
|
|
247
|
+
if (!state || !Number.isInteger(state.pid) || !isAlive(state.pid) || staleState) {
|
|
248
|
+
try {
|
|
249
|
+
unlink(statePath);
|
|
250
|
+
cleanedState = true;
|
|
251
|
+
} catch {
|
|
252
|
+
// Ignore already-deleted state file.
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return { stopped, failed, cleanedState };
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export async function stopCommand({ config, out, err = process.stderr, deps = {} }) {
|
|
261
|
+
const { stopped, failed } = await stopRunningServers(config, deps);
|
|
262
|
+
if (failed.length) {
|
|
263
|
+
for (const f of failed) err.write(`error: could not stop llmtop serve (pid ${f.pid}): ${f.error}\n`);
|
|
264
|
+
return 1;
|
|
265
|
+
}
|
|
266
|
+
if (!stopped.length) {
|
|
267
|
+
out.write("llmtop serve is not running\n");
|
|
268
|
+
return 0;
|
|
269
|
+
}
|
|
270
|
+
for (const s of stopped) {
|
|
271
|
+
out.write(`stopped llmtop serve (pid ${s.pid}${s.port ? `, port ${s.port}` : ""})\n`);
|
|
272
|
+
}
|
|
273
|
+
return 0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const FORWARDED_DAEMON_ENV = [
|
|
277
|
+
"HOME",
|
|
278
|
+
"PATH",
|
|
279
|
+
"USER",
|
|
280
|
+
"TZ",
|
|
281
|
+
"XDG_CONFIG_HOME",
|
|
282
|
+
"LLMTOP_CONFIG",
|
|
283
|
+
"LLMTOP_DATA",
|
|
284
|
+
"NODE_OPTIONS",
|
|
285
|
+
];
|
|
286
|
+
|
|
287
|
+
export function canUseSystemdUser({ platform = process.platform, spawn: spawnCmd = spawnSync, env = process.env } = {}) {
|
|
288
|
+
if (platform !== "linux" || env.LLMTOP_NO_SYSTEMD === "1") return false;
|
|
289
|
+
try {
|
|
290
|
+
const version = spawnCmd("systemd-run", ["--version"], { encoding: "utf8", stdio: "pipe" });
|
|
291
|
+
if (version.status !== 0) return false;
|
|
292
|
+
const mgr = spawnCmd("systemctl", ["--user", "show-environment"], { encoding: "utf8", stdio: "pipe" });
|
|
293
|
+
return mgr.status === 0;
|
|
294
|
+
} catch {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function readAppendedLog(logPath, startOffset, exists, readFile) {
|
|
300
|
+
if (!exists(logPath)) return "";
|
|
301
|
+
try {
|
|
302
|
+
const buf = readFile(logPath);
|
|
303
|
+
return buf.subarray(startOffset).toString("utf8").trim();
|
|
304
|
+
} catch {
|
|
305
|
+
return "";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export async function startBackgroundServer(config, { port, deps = {} } = {}) {
|
|
310
|
+
const {
|
|
311
|
+
env = process.env,
|
|
312
|
+
platform = process.platform,
|
|
313
|
+
root = ROOT,
|
|
314
|
+
binPath = join(ROOT, "bin", "llmtop.mjs"),
|
|
315
|
+
execPath = process.execPath,
|
|
316
|
+
spawn: spawnChild = spawn,
|
|
317
|
+
spawnSync: spawnCmd = spawnSync,
|
|
318
|
+
sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
319
|
+
timeoutMs = 5000,
|
|
320
|
+
isAlive = isPidAlive,
|
|
321
|
+
exists = existsSync,
|
|
322
|
+
readFile = readFileSync,
|
|
323
|
+
stat = statSync,
|
|
324
|
+
mkdir = mkdirSync,
|
|
325
|
+
unlink = unlinkSync,
|
|
326
|
+
open = openSync,
|
|
327
|
+
close = closeSync,
|
|
328
|
+
canUseSystemd = canUseSystemdUser,
|
|
329
|
+
} = deps;
|
|
330
|
+
|
|
331
|
+
const { servers, staleState } = findRunningServers(config, { ...deps, root, isAlive, exists, readFile });
|
|
332
|
+
if (servers.length > 0) {
|
|
333
|
+
return { ok: false, alreadyRunning: true, server: servers[0] };
|
|
334
|
+
}
|
|
335
|
+
if (staleState) {
|
|
336
|
+
try {
|
|
337
|
+
unlink(serverStatePath(config));
|
|
338
|
+
} catch {
|
|
339
|
+
// Ignore already-deleted stale state file.
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
mkdir(config.data, { recursive: true });
|
|
344
|
+
const logPath = serverLogPath(config);
|
|
345
|
+
const startOffset = exists(logPath) ? stat(logPath).size : 0;
|
|
346
|
+
const token = `${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
347
|
+
const childArgs = [binPath, "serve", ...(port !== undefined ? ["--port", String(port)] : [])];
|
|
348
|
+
|
|
349
|
+
let mode = null;
|
|
350
|
+
let unit = null;
|
|
351
|
+
let child = null;
|
|
352
|
+
|
|
353
|
+
if (canUseSystemd({ platform, spawn: spawnCmd, env })) {
|
|
354
|
+
unit = `llmtop-serve-${Date.now()}-${process.pid}`;
|
|
355
|
+
const setenvArgs = [];
|
|
356
|
+
for (const key of FORWARDED_DAEMON_ENV) {
|
|
357
|
+
if (env[key] !== undefined) setenvArgs.push(`--setenv=${key}=${env[key]}`);
|
|
358
|
+
}
|
|
359
|
+
setenvArgs.push("--setenv=LLMTOP_DAEMON=1", `--setenv=LLMTOP_DAEMON_TOKEN=${token}`);
|
|
360
|
+
const systemdArgs = [
|
|
361
|
+
"--user",
|
|
362
|
+
"--collect",
|
|
363
|
+
"--no-block",
|
|
364
|
+
`--unit=${unit}`,
|
|
365
|
+
"--description=llmtop local dashboard",
|
|
366
|
+
`--property=WorkingDirectory=${config.data}`,
|
|
367
|
+
`--property=StandardOutput=append:${logPath}`,
|
|
368
|
+
`--property=StandardError=append:${logPath}`,
|
|
369
|
+
...setenvArgs,
|
|
370
|
+
execPath,
|
|
371
|
+
...childArgs,
|
|
372
|
+
];
|
|
373
|
+
const res = spawnCmd("systemd-run", systemdArgs, { encoding: "utf8", stdio: "pipe" });
|
|
374
|
+
if (res.status === 0) mode = "systemd";
|
|
375
|
+
else unit = null;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (!mode) {
|
|
379
|
+
const logFd = open(logPath, "a");
|
|
380
|
+
try {
|
|
381
|
+
child = spawnChild(execPath, childArgs, {
|
|
382
|
+
detached: true,
|
|
383
|
+
stdio: ["ignore", logFd, logFd],
|
|
384
|
+
env: { ...env, LLMTOP_DAEMON: "1", LLMTOP_DAEMON_TOKEN: token },
|
|
385
|
+
});
|
|
386
|
+
} finally {
|
|
387
|
+
close(logFd);
|
|
388
|
+
}
|
|
389
|
+
child.unref();
|
|
390
|
+
mode = "detached";
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const deadline = Date.now() + timeoutMs;
|
|
394
|
+
while (Date.now() < deadline) {
|
|
395
|
+
const state = readServerState(config, { exists, readFile });
|
|
396
|
+
if (state && state.token === token && isAlive(state.pid)) {
|
|
397
|
+
return { ok: true, pid: state.pid, port: state.port, logPath, mode, unit };
|
|
398
|
+
}
|
|
399
|
+
if (mode === "detached" && child?.exitCode !== null) break;
|
|
400
|
+
if (mode === "systemd") {
|
|
401
|
+
const appended = readAppendedLog(logPath, startOffset, exists, readFile);
|
|
402
|
+
if (/^error:/m.test(appended)) break;
|
|
403
|
+
}
|
|
404
|
+
await sleep(50);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const appended = readAppendedLog(logPath, startOffset, exists, readFile);
|
|
408
|
+
return {
|
|
409
|
+
ok: false,
|
|
410
|
+
error: appended || "timed out waiting for llmtop serve to start",
|
|
411
|
+
logPath,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export async function startCommand({ config, options = {}, out, err = process.stderr, deps = {} }) {
|
|
416
|
+
const res = await startBackgroundServer(config, { port: options.port, deps });
|
|
417
|
+
if (res.alreadyRunning) {
|
|
418
|
+
const where = res.server.port ? `, http://localhost:${res.server.port}` : "";
|
|
419
|
+
err.write(`llmtop serve is already running (pid ${res.server.pid}${where}); run \`llmtop stop\` first\n`);
|
|
420
|
+
return 1;
|
|
421
|
+
}
|
|
422
|
+
if (!res.ok) {
|
|
423
|
+
err.write(`${res.error}\n`);
|
|
424
|
+
return 1;
|
|
425
|
+
}
|
|
426
|
+
out.write(`dashboard at http://localhost:${res.port} in the background (pid ${res.pid}, log ${res.logPath}); run \`llmtop stop\` to stop\n`);
|
|
427
|
+
return 0;
|
|
428
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { existsSync, readdirSync, rmSync, rmdirSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, resolve, sep } from "node:path";
|
|
4
|
+
import { createInterface } from "node:readline/promises";
|
|
5
|
+
import { defaultConfigDir } from "./config.mjs";
|
|
6
|
+
import { detectInstallMode, hasGlobalPackage, packageManagerCommand, formatCommand, runPackageManager } from "./install.mjs";
|
|
7
|
+
import { findRunningServers, stopRunningServers } from "./process.mjs";
|
|
8
|
+
|
|
9
|
+
function isSameOrInside(target, parent) {
|
|
10
|
+
return target === parent || target.startsWith(parent + sep);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function collectDataTargets(config, { env = process.env, home = homedir(), exists = existsSync } = {}) {
|
|
14
|
+
const defaultDir = resolve(defaultConfigDir(env, home));
|
|
15
|
+
const cfgPath = resolve(config.configPath);
|
|
16
|
+
const dataDir = resolve(config.data);
|
|
17
|
+
const homeDir = resolve(home);
|
|
18
|
+
const transcriptPaths = Object.values(config.providers ?? {})
|
|
19
|
+
.map((p) => p?.transcripts)
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.map((p) => resolve(p));
|
|
22
|
+
|
|
23
|
+
const isSafeTarget = (target) => {
|
|
24
|
+
if (!target || target === sep || target === "/" || target === homeDir) return false;
|
|
25
|
+
return !transcriptPaths.some((t) => isSameOrInside(t, target));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
if (isSameOrInside(cfgPath, defaultDir) && isSameOrInside(dataDir, defaultDir)) {
|
|
29
|
+
return exists(defaultDir) && isSafeTarget(defaultDir) ? [defaultDir] : [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const candidates = [dataDir, cfgPath];
|
|
33
|
+
if (exists(defaultDir)) candidates.push(defaultDir);
|
|
34
|
+
|
|
35
|
+
const targets = [];
|
|
36
|
+
for (const candidate of candidates) {
|
|
37
|
+
if (!exists(candidate) || !isSafeTarget(candidate)) continue;
|
|
38
|
+
if (targets.some((existing) => existing === candidate || isSameOrInside(candidate, existing))) continue;
|
|
39
|
+
targets.push(candidate);
|
|
40
|
+
}
|
|
41
|
+
return targets;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function promptConfirm(question, input, out) {
|
|
45
|
+
const rl = createInterface({ input, output: out });
|
|
46
|
+
try {
|
|
47
|
+
const answer = await rl.question(question);
|
|
48
|
+
return /^y(?:es)?$/i.test(answer.trim());
|
|
49
|
+
} finally {
|
|
50
|
+
rl.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function uninstallCommand({ config, options = {}, out, err = process.stderr, input = process.stdin, deps = {} }) {
|
|
55
|
+
const dryRun = Boolean(options["dry-run"]);
|
|
56
|
+
const yes = Boolean(options.yes);
|
|
57
|
+
let purge = Boolean(options.purge);
|
|
58
|
+
const env = deps.env ?? process.env;
|
|
59
|
+
const home = deps.home ?? homedir();
|
|
60
|
+
const isTTY = deps.isTTY ?? Boolean(input.isTTY && out.isTTY);
|
|
61
|
+
const exists = deps.exists ?? existsSync;
|
|
62
|
+
const remove = deps.rm ?? rmSync;
|
|
63
|
+
|
|
64
|
+
const install = (deps.detectInstallMode ?? detectInstallMode)();
|
|
65
|
+
const { servers, staleState } = (deps.findRunningServers ?? findRunningServers)(config);
|
|
66
|
+
const dataTargets = collectDataTargets(config, { env, home, exists });
|
|
67
|
+
|
|
68
|
+
let packageManager = null;
|
|
69
|
+
if (install.mode === "global") {
|
|
70
|
+
packageManager = install.packageManager || "npm";
|
|
71
|
+
} else if ((deps.hasGlobalPackage ?? hasGlobalPackage)("npm", "llmtop")) {
|
|
72
|
+
packageManager = "npm";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
out.write("llmtop uninstall plan:\n");
|
|
76
|
+
if (servers.length > 0) {
|
|
77
|
+
const summary = servers.map((s) => `pid ${s.pid}${s.port ? ` (port ${s.port})` : ""}`).join(", ");
|
|
78
|
+
out.write(` - stop running server(s): ${summary}\n`);
|
|
79
|
+
} else {
|
|
80
|
+
out.write(" - stop running server(s): none\n");
|
|
81
|
+
}
|
|
82
|
+
if (packageManager) {
|
|
83
|
+
const [cmd, args] = packageManagerCommand(packageManager, "uninstall", "llmtop");
|
|
84
|
+
out.write(` - remove global package: ${formatCommand(cmd, args)}\n`);
|
|
85
|
+
} else if (install.mode === "local") {
|
|
86
|
+
out.write(` - remove global package: none (local checkout at ${install.root} will not be deleted)\n`);
|
|
87
|
+
} else {
|
|
88
|
+
out.write(" - remove global package: none\n");
|
|
89
|
+
}
|
|
90
|
+
if (dataTargets.length === 0) {
|
|
91
|
+
out.write(" - local config and data: none\n");
|
|
92
|
+
} else if (purge) {
|
|
93
|
+
out.write(` - local config and data: remove ${dataTargets.join(", ")}\n`);
|
|
94
|
+
} else {
|
|
95
|
+
out.write(` - local config and data: keep ${dataTargets.join(", ")} (use --purge to remove)\n`);
|
|
96
|
+
}
|
|
97
|
+
out.write(" - provider transcripts (~/.claude, ~/.codex, ~/.gemini/antigravity-cli) will not be touched.\n");
|
|
98
|
+
|
|
99
|
+
if (dryRun) {
|
|
100
|
+
out.write("dry run: no changes made\n");
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!yes) {
|
|
105
|
+
if (!isTTY) {
|
|
106
|
+
err.write("error: uninstall requires confirmation; pass --yes in non-interactive shells\n");
|
|
107
|
+
return 1;
|
|
108
|
+
}
|
|
109
|
+
const confirm = deps.confirm ?? ((question) => promptConfirm(question, input, out));
|
|
110
|
+
if (!(await confirm("Proceed with uninstall? [y/N] "))) {
|
|
111
|
+
out.write("aborted\n");
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
if (!purge && dataTargets.length > 0) {
|
|
115
|
+
if (await confirm(`Also remove local config and archived data (${dataTargets.join(", ")})? [y/N] `)) {
|
|
116
|
+
purge = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (servers.length > 0 || staleState) {
|
|
122
|
+
const { stopped, failed } = await (deps.stopRunningServers ?? stopRunningServers)(config);
|
|
123
|
+
if (failed.length > 0) {
|
|
124
|
+
for (const f of failed) err.write(`error: could not stop llmtop serve (pid ${f.pid}): ${f.error}\n`);
|
|
125
|
+
return 1;
|
|
126
|
+
}
|
|
127
|
+
for (const s of stopped) {
|
|
128
|
+
out.write(`stopped llmtop serve (pid ${s.pid}${s.port ? `, port ${s.port}` : ""})\n`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (packageManager) {
|
|
133
|
+
const res = (deps.runPackageManager ?? runPackageManager)(packageManager, "uninstall", "llmtop");
|
|
134
|
+
if (!res.ok) {
|
|
135
|
+
err.write(`error: uninstall failed (${res.command}): ${res.error || res.stderr.trim() || `exit code ${res.code}`}\n`);
|
|
136
|
+
if (res.permissionDenied) {
|
|
137
|
+
err.write(`hint: try running \`sudo ${res.command}\`\n`);
|
|
138
|
+
}
|
|
139
|
+
if (purge && dataTargets.length > 0) {
|
|
140
|
+
err.write("skipped deleting local config and data because package removal failed\n");
|
|
141
|
+
}
|
|
142
|
+
return 1;
|
|
143
|
+
}
|
|
144
|
+
out.write(`removed global package (${res.command})\n`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (install.mode === "local") {
|
|
148
|
+
out.write(`kept local checkout at ${install.root}; remove it manually if no longer needed.\n`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (purge && dataTargets.length > 0) {
|
|
152
|
+
for (const target of dataTargets) {
|
|
153
|
+
remove(target, { recursive: true, force: true });
|
|
154
|
+
}
|
|
155
|
+
const defaultDir = resolve(defaultConfigDir(env, home));
|
|
156
|
+
if (exists(defaultDir) && readdirSync(defaultDir).length === 0) {
|
|
157
|
+
try {
|
|
158
|
+
rmdirSync(defaultDir);
|
|
159
|
+
} catch {
|
|
160
|
+
// Ignore if not removable.
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (const target of dataTargets) {
|
|
164
|
+
const parent = dirname(target);
|
|
165
|
+
if (parent === defaultDir && exists(parent) && readdirSync(parent).length === 0) {
|
|
166
|
+
try {
|
|
167
|
+
rmdirSync(parent);
|
|
168
|
+
} catch {
|
|
169
|
+
// Ignore if not removable.
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
out.write(`removed local data: ${dataTargets.join(", ")}\n`);
|
|
174
|
+
} else if (dataTargets.length > 0) {
|
|
175
|
+
out.write(`kept local data at: ${dataTargets.join(", ")}\n`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return 0;
|
|
179
|
+
}
|
package/src/update.mjs
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { ROOT } from "./config.mjs";
|
|
5
|
+
import { detectInstallMode, runPackageManager } from "./install.mjs";
|
|
6
|
+
import { findRunningServers, stopRunningServers } from "./process.mjs";
|
|
7
|
+
|
|
8
|
+
const VERSION = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")).version;
|
|
9
|
+
|
|
10
|
+
function parseSemver(raw) {
|
|
11
|
+
if (typeof raw !== "string") throw new Error(`invalid version: ${raw}`);
|
|
12
|
+
const cleaned = raw.trim().replace(/^v/, "").split("+")[0];
|
|
13
|
+
const match = cleaned.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);
|
|
14
|
+
if (!match) throw new Error(`invalid semver: ${raw}`);
|
|
15
|
+
return {
|
|
16
|
+
core: [Number(match[1]), Number(match[2]), Number(match[3])],
|
|
17
|
+
pre: match[4] ? match[4].split(".") : [],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function compareSemver(a, b) {
|
|
22
|
+
const pa = parseSemver(a);
|
|
23
|
+
const pb = parseSemver(b);
|
|
24
|
+
for (let i = 0; i < 3; i++) {
|
|
25
|
+
if (pa.core[i] !== pb.core[i]) return pa.core[i] < pb.core[i] ? -1 : 1;
|
|
26
|
+
}
|
|
27
|
+
if (!pa.pre.length && !pb.pre.length) return 0;
|
|
28
|
+
if (!pa.pre.length) return 1;
|
|
29
|
+
if (!pb.pre.length) return -1;
|
|
30
|
+
const len = Math.max(pa.pre.length, pb.pre.length);
|
|
31
|
+
for (let i = 0; i < len; i++) {
|
|
32
|
+
if (pa.pre[i] === undefined) return -1;
|
|
33
|
+
if (pb.pre[i] === undefined) return 1;
|
|
34
|
+
const na = /^\d+$/.test(pa.pre[i]);
|
|
35
|
+
const nb = /^\d+$/.test(pb.pre[i]);
|
|
36
|
+
if (na && nb) {
|
|
37
|
+
const va = Number(pa.pre[i]);
|
|
38
|
+
const vb = Number(pb.pre[i]);
|
|
39
|
+
if (va !== vb) return va < vb ? -1 : 1;
|
|
40
|
+
} else if (na !== nb) {
|
|
41
|
+
return na ? -1 : 1;
|
|
42
|
+
} else if (pa.pre[i] !== pb.pre[i]) {
|
|
43
|
+
return pa.pre[i] < pb.pre[i] ? -1 : 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function registryUrl(env = process.env) {
|
|
50
|
+
return (env.LLMTOP_REGISTRY || env.npm_config_registry || "https://registry.npmjs.org").replace(/\/+$/, "");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function fetchLatestVersion({
|
|
54
|
+
pkgName = "llmtop",
|
|
55
|
+
registry = registryUrl(),
|
|
56
|
+
fetchImpl = globalThis.fetch,
|
|
57
|
+
timeoutMs = 10_000,
|
|
58
|
+
} = {}) {
|
|
59
|
+
const url = `${registry}/${encodeURIComponent(pkgName)}/latest`;
|
|
60
|
+
let response;
|
|
61
|
+
try {
|
|
62
|
+
response = await fetchImpl(url, {
|
|
63
|
+
headers: { accept: "application/json" },
|
|
64
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
65
|
+
});
|
|
66
|
+
} catch (err) {
|
|
67
|
+
throw new Error(`failed to reach npm registry at ${registry}: ${err?.message ?? String(err)}`);
|
|
68
|
+
}
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
throw new Error(`npm registry returned HTTP ${response.status} for ${url}`);
|
|
71
|
+
}
|
|
72
|
+
let data;
|
|
73
|
+
try {
|
|
74
|
+
data = await response.json();
|
|
75
|
+
} catch {
|
|
76
|
+
throw new Error(`invalid JSON response from npm registry at ${url}`);
|
|
77
|
+
}
|
|
78
|
+
if (typeof data?.version !== "string" || !data.version.trim()) {
|
|
79
|
+
throw new Error(`npm registry response at ${url} did not contain a version`);
|
|
80
|
+
}
|
|
81
|
+
return data.version.trim();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function restartInstalledDaemon({ port, env = process.env, platform = process.platform, spawn = spawnSync } = {}) {
|
|
85
|
+
const args = ["start", ...(port ? ["--port", String(port)] : [])];
|
|
86
|
+
let res = spawn("llmtop", args, { encoding: "utf8", stdio: "pipe", env, shell: platform === "win32" });
|
|
87
|
+
if (res.error?.code === "ENOENT") {
|
|
88
|
+
res = spawn(process.execPath, [join(ROOT, "bin", "llmtop.mjs"), ...args], { encoding: "utf8", stdio: "pipe", env });
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
ok: !res.error && res.status === 0,
|
|
92
|
+
stdout: res.stdout ?? "",
|
|
93
|
+
stderr: res.stderr ?? "",
|
|
94
|
+
error: res.error?.message ?? "",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function updateCommand({ config, options = {}, out, err = process.stderr, deps = {} }) {
|
|
99
|
+
const current = deps.currentVersion ?? VERSION;
|
|
100
|
+
const env = deps.env ?? process.env;
|
|
101
|
+
const install = (deps.detectInstallMode ?? detectInstallMode)();
|
|
102
|
+
const latest = await (deps.fetchLatestVersion ?? fetchLatestVersion)({ registry: registryUrl(env) });
|
|
103
|
+
const updateAvailable = compareSemver(current, latest) < 0;
|
|
104
|
+
|
|
105
|
+
if (options.check) {
|
|
106
|
+
if (options.json) {
|
|
107
|
+
out.write(`${JSON.stringify({
|
|
108
|
+
current,
|
|
109
|
+
latest,
|
|
110
|
+
updateAvailable,
|
|
111
|
+
installMode: install.mode,
|
|
112
|
+
packageManager: install.packageManager,
|
|
113
|
+
}, null, 1)}\n`);
|
|
114
|
+
} else if (updateAvailable) {
|
|
115
|
+
out.write(`update available: llmtop ${current} -> ${latest}\n`);
|
|
116
|
+
} else {
|
|
117
|
+
out.write(`llmtop ${current} is up to date (latest: ${latest})\n`);
|
|
118
|
+
}
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!updateAvailable && !options.force) {
|
|
123
|
+
out.write(`llmtop ${current} is already up to date (latest: ${latest})\n`);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (!options.force) {
|
|
128
|
+
if (install.mode === "local") {
|
|
129
|
+
err.write(`llmtop is running from a local git checkout (${install.root}); run \`git pull && npm run build\`, or pass --force to install globally\n`);
|
|
130
|
+
return 1;
|
|
131
|
+
}
|
|
132
|
+
if (install.mode === "npx") {
|
|
133
|
+
err.write("llmtop is running via npx; run `npx llmtop@latest` or install globally with `npm install -g llmtop@latest` (pass --force to install globally)\n");
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const findServers = deps.findRunningServers ?? findRunningServers;
|
|
139
|
+
const stopServers = deps.stopRunningServers ?? stopRunningServers;
|
|
140
|
+
const restartDaemon = deps.restartDaemon ?? restartInstalledDaemon;
|
|
141
|
+
|
|
142
|
+
const before = findServers(config);
|
|
143
|
+
const daemons = before.servers.filter((s) => s.daemon);
|
|
144
|
+
let restartPort;
|
|
145
|
+
|
|
146
|
+
if (daemons.length > 0) {
|
|
147
|
+
restartPort = daemons[0].port;
|
|
148
|
+
const stopped = await stopServers(config);
|
|
149
|
+
if (stopped.failed.length > 0) {
|
|
150
|
+
for (const f of stopped.failed) {
|
|
151
|
+
err.write(`error: could not stop background llmtop serve (pid ${f.pid}) before upgrade: ${f.error}\n`);
|
|
152
|
+
}
|
|
153
|
+
return 1;
|
|
154
|
+
}
|
|
155
|
+
const details = stopped.stopped.map((s) => `pid ${s.pid}`).join(", ");
|
|
156
|
+
out.write(`stopped background llmtop serve before upgrade (${details})\n`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const pm = install.packageManager || "npm";
|
|
160
|
+
const res = (deps.runPackageManager ?? runPackageManager)(pm, "install", `llmtop@${latest}`);
|
|
161
|
+
if (!res.ok) {
|
|
162
|
+
err.write(`error: update failed (${res.command}): ${res.error || res.stderr.trim() || `exit code ${res.code}`}\n`);
|
|
163
|
+
if (res.permissionDenied) {
|
|
164
|
+
err.write(`hint: try running \`sudo ${res.command}\`\n`);
|
|
165
|
+
}
|
|
166
|
+
if (daemons.length > 0) {
|
|
167
|
+
const restored = restartDaemon({ port: restartPort, env });
|
|
168
|
+
if (restored.ok) {
|
|
169
|
+
out.write(`${restored.stdout.trim() || "restarted previous background llmtop serve"}\n`);
|
|
170
|
+
} else {
|
|
171
|
+
err.write(`warning: failed to restore background server: ${restored.stderr.trim() || restored.error}; run \`llmtop start\` manually\n`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
out.write(`updated llmtop ${current} -> ${latest}\n`);
|
|
178
|
+
if (daemons.length > 0) {
|
|
179
|
+
const restarted = restartDaemon({ port: restartPort, env });
|
|
180
|
+
if (restarted.ok) {
|
|
181
|
+
out.write(`${restarted.stdout.trim() || "restarted background llmtop serve"}\n`);
|
|
182
|
+
} else {
|
|
183
|
+
err.write(`warning: updated to ${latest} but failed to restart background server: ${restarted.stderr.trim() || restarted.error}; run \`llmtop start\` manually\n`);
|
|
184
|
+
return 1;
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
const { servers } = findServers(config);
|
|
188
|
+
if (servers.length > 0) {
|
|
189
|
+
const details = servers.map((s) => `pid ${s.pid}${s.port ? ` on port ${s.port}` : ""}`).join(", ");
|
|
190
|
+
out.write(`note: llmtop serve is still running (${details}); run \`llmtop stop\` and \`llmtop start\` (or \`llmtop serve\`) to use ${latest}.\n`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return 0;
|
|
194
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--brand-ink:#1a1a1a;--brand-paper:#f2f2f2;--brand-white:#fff;--brand-black:#000;--brand-tile-dark:#1a1a1a;--brand-tile-light:#f2f2f2;--brand-donut-1:#1a1a1a;--brand-donut-2:#3f3f3f;--brand-donut-3:#7f7f7f;--brand-donut-4:#d8d8d8;--page:var(--brand-paper);--surface:var(--brand-white);--raised:var(--brand-white);--ink:var(--brand-ink);--ink2:#3f3f3f;--muted:#7f7f7f;--hair:#e0e0e0;--base:#c8c8c8;--wash:#1a1a1a0d;--accent:#2a78d6;--accent-ink:#1c5cab;--s1:#2a78d6;--s2:#eb6834;--s3:#1baf7a;--s4:#eda100;--s5:#e87ba4;--s6:#0e9aa7;--s7:#8b5cf6;--s8:#6b8e23;--s9:#d946ef;--s10:#0284c7;--s11:#dc2626;--s12:#65a30d;--s13:#ea580c;--s14:#0d9488;--s15:#4f46e5;--s16:#ca8a04;--s0:#b9b8b0;--sub:#6d4fe8;--seq:#2a78d6;--v0:#c9c4fb;--v1:#9d93f5;--v2:#6f5ce6;--v3:#4630c0;--v4:#26177a;--k0:#d8d8d8;--k1:#888;--k2:#3f3f3f;--kw:repeating-linear-gradient(135deg, #d8d8d8 0 4px, #bebebe 4px 8px);--ck0:#3b6fd9;--ck1:#7c5bd1;--ck2:#a8864f;--good:#0ca30c;--up:#1c5cab;--neg:#d03b3b;--shadow:0 8px 28px #0000001a;--sb:#0b0b0b2e;--sb-hover:#0b0b0b57}:root[data-theme=dark]{--brand-donut-1:#fff;--brand-donut-2:#d8d8d8;--brand-donut-3:#888;--brand-donut-4:#3f3f3f;--page:#111;--surface:var(--brand-ink);--raised:#242424;--ink:var(--brand-white);--ink2:#d8d8d8;--muted:#888;--hair:#2c2c2c;--base:#3f3f3f;--wash:#ffffff12;--accent:#3987e5;--accent-ink:#86b6ef;--s1:#3987e5;--s2:#d95926;--s3:#199e70;--s4:#c98500;--s5:#d55181;--s6:#18b4c2;--s7:#a27bf8;--s8:#8ab03a;--s9:#e879f9;--s10:#38bdf8;--s11:#f87171;--s12:#a3e635;--s13:#fb923c;--s14:#2dd4bf;--s15:#818cf8;--s16:#facc15;--s0:#5a5a55;--sub:#7b66f0;--seq:#3987e5;--v0:#30286a;--v1:#4e42ae;--v2:#7c6ff0;--v3:#b2abff;--v4:#e4e1ff;--k0:#3f3f3f;--k1:#888;--k2:#d8d8d8;--kw:repeating-linear-gradient(135deg, #3f3f3f 0 4px, #555 4px 8px);--ck0:#5b8def;--ck1:#a07eea;--ck2:#c8a878;--good:#0ca30c;--up:#86b6ef;--neg:#e66767;--shadow:0 8px 28px #00000080;--sb:#ffffff29;--sb-hover:#ffffff52}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}body{background:var(--page);color:var(--ink);margin:0;font:14px/1.45 Montserrat,system-ui,-apple-system,Segoe UI,sans-serif}button,select,input{font:inherit;color:inherit}code{font:12.5px/1 Roboto Mono,ui-monospace,SF Mono,Menlo,monospace}.app{grid-template-columns:228px minmax(0,1fr);min-height:100vh;display:grid}.side{border-right:1px solid var(--hair);background:var(--surface);flex-direction:column;height:100vh;padding:22px 14px 16px;display:flex;position:sticky;top:0}.brand{align-items:center;padding:8px 10px 20px;display:flex}.brand .brand-lockup{flex:none;width:132px;height:auto;display:block}.navlabel{color:var(--muted);letter-spacing:.04em;text-transform:uppercase;margin:14px 10px 6px;font-size:11.5px;font-weight:600}.nav{flex-direction:column;gap:2px;display:flex}.nav button{text-align:left;cursor:pointer;width:100%;color:var(--ink2);background:0 0;border:0;border-radius:9px;align-items:center;gap:10px;padding:8px 10px;font-weight:500;display:flex}.nav button:hover{background:var(--wash);color:var(--ink)}.nav button[aria-current=page]{background:var(--wash);color:var(--ink);font-weight:600}.nav svg{stroke:currentColor;fill:none;stroke-width:1.7px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:16px;height:16px}.nav.quiet button{padding:6px 10px;font-size:13px}.side .foot{border-top:1px solid var(--hair);color:var(--ink2);grid-template-columns:minmax(0,1fr);gap:12px;margin-top:auto;padding:12px 0 0;font-size:12.5px;display:grid}.foot .scan{justify-content:space-between;align-items:center;gap:8px;padding-left:10px;display:flex}.foot .si{min-width:0;color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;line-height:1.4;overflow:hidden}.foot .si span{text-overflow:ellipsis;display:block;overflow:hidden}.foot .scan .icon{background:0 0}.foot .scan .icon:hover:not(:disabled){background:var(--wash)}.foot .prefs{justify-content:space-between;align-items:center;gap:8px;display:flex}.foot .icon{width:30px;height:30px;color:var(--ink2);border-radius:8px}.foot .icon:hover:not(:disabled){color:var(--ink)}.sr{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.mock{border:1px solid var(--base);border-radius:999px;margin-top:8px;padding:2px 8px;font-size:11.5px;font-weight:500;display:inline-block}main{min-width:0;padding:20px 36px 56px}.wrap{max-width:1320px;margin:0 auto}.seg{background:var(--wash);border-radius:10px;padding:3px;display:inline-flex}.seg button{cursor:pointer;color:var(--ink2);white-space:nowrap;background:0 0;border:0;border-radius:7px;padding:5px 11px;font-size:13px;font-weight:500}.seg button:hover{color:var(--ink)}.seg button[aria-pressed=true]{background:color-mix(in srgb, var(--accent) 16%, var(--raised));color:var(--accent-ink);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent)}.icon{background:var(--wash);cursor:pointer;border:0;border-radius:10px;place-items:center;width:34px;height:34px;display:grid}.icon svg{stroke:currentColor;fill:none;stroke-width:1.7px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px}.filters{flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 22px;display:flex}.field{border:1px solid var(--hair);background:var(--surface);height:34px;color:var(--ink2);border-radius:10px;align-items:center;gap:6px;padding:0 10px;font-size:13px;display:inline-flex}.field input{min-width:0;color:var(--ink);background:0 0;border:0;outline:none;font-size:13px}.clearall{color:var(--ink);cursor:pointer;gap:6px}.clearall svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;width:14px;height:14px}.clearall:hover{border-color:var(--base);background:var(--wash)}.rowlink{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;padding:0}.rowlink:focus-visible,.clearall:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.grid{gap:20px;display:grid}.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.two{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}.half{grid-template-columns:repeat(2,minmax(0,1fr))}.stack{gap:20px;display:grid}.card{border:1px solid var(--hair);background:var(--surface);border-radius:14px;min-width:0;padding:16px 20px 20px}.card>header{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 12px;min-height:28px;margin-bottom:14px;display:flex}.card>header .segs{flex-wrap:wrap;gap:8px;display:flex}.card>header .seg{padding:2px}.card>header .seg button{padding:3px 10px;line-height:18px}.card>header .field{height:28px}h2{letter-spacing:-.01em;margin:0;font-size:16px;font-weight:650}.hint{color:var(--ink2);font-size:12.5px}.link{color:var(--accent-ink);cursor:pointer;white-space:nowrap;background:0 0;border:0;padding:0;font-size:13px}.kpi{padding:16px 18px 14px}.kpi .l{color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;font-size:13px;overflow:hidden}.kpi .vr{justify-content:space-between;align-items:flex-end;gap:8px;margin-top:6px;display:flex}.kpi .v{letter-spacing:-.02em;min-width:0;font-size:28px;font-weight:620;line-height:1.1}.kpi .v small{letter-spacing:0;color:var(--ink2);white-space:nowrap;font-size:14px;font-weight:500}.kpi .d{color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;margin-top:10px;font-size:12.5px;overflow:hidden}.kpi .d b{color:var(--ink);font-weight:600}.kpi .d b.better{color:var(--good)}.kpi .d b.worse{color:var(--neg)}.kpi .d b.vol{color:var(--up)}.spark{flex:none;width:72px;height:24px;margin-bottom:4px;overflow:visible}.spark polyline{fill:none;stroke:var(--base);stroke-width:1.5px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}td .spark{margin:0}.spark circle{fill:var(--accent);stroke:var(--surface);stroke-width:2px}.legend{color:var(--ink2);flex-wrap:wrap;gap:4px 16px;margin:0 0 12px;padding:0;font-size:12.5px;list-style:none;display:flex}.legend i{vertical-align:-1px;border-radius:3px;width:10px;height:10px;margin-right:6px;display:inline-block}.legend b{color:var(--ink);margin-left:5px;font-weight:600}.v0{background:var(--v0)}.v1{background:var(--v1)}.v2{background:var(--v2)}.v3{background:var(--v3)}.v4{background:var(--v4)}.v5,.v6,.v7,.v8,.v9{background:var(--s0)}.split i.v0,.split i.v1{color:#0b0b0b}:root[data-theme=dark] .split i.v0,:root[data-theme=dark] .split i.v1{color:#fff}:root[data-theme=dark] .split i.v3,:root[data-theme=dark] .split i.v4{color:#0b0b0b}.lead{margin:0 0 16px;font-size:15.5px;line-height:1.5}.lead b{font-weight:650}.lead.accent{border-left:3px solid;padding:2px 0 2px 12px}.shares{grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:10px 14px;display:grid}.shares>span{color:var(--ink2);font-size:12.5px}.shares .split{margin:0}.lv{align-items:center;gap:7px;display:inline-flex}.lv i{border-radius:3px;width:9px;height:9px}.price td{padding-top:12px;padding-bottom:12px}.price td[data-tip]:hover{background:var(--wash)}.price .sub.up{color:var(--ink);font-weight:600}.x1{color:var(--ink2)}.c1{background:var(--s1)}.c2{background:var(--s2)}.c3{background:var(--s3)}.c4{background:var(--s4)}.c5{background:var(--s5)}.c6{background:var(--s6)}.c7{background:var(--s7)}.c8{background:var(--s8)}.c9{background:var(--s9)}.c10{background:var(--s10)}.c11{background:var(--s11)}.c12{background:var(--s12)}.c13{background:var(--s13)}.c14{background:var(--s14)}.c15{background:var(--s15)}.c16{background:var(--s16)}.c0{background:var(--s0)}.csub{background:var(--sub)}.chart{grid-template-columns:44px minmax(0,1fr);padding-top:10px;display:grid}.axis{height:230px;position:relative}.axis span{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:11.5px;position:absolute;right:8px;transform:translateY(50%)}.plot{border-bottom:1px solid var(--base);align-items:flex-end;height:230px;display:flex;position:relative}.plot .gl{background:var(--hair);height:1px;position:absolute;left:0;right:0}.col{outline:none;flex:1;justify-content:center;align-items:flex-end;min-width:0;height:100%;display:flex;position:relative}.col:hover,.col:focus-visible{background:var(--wash)}.bars{flex-direction:column;justify-content:flex-end;gap:2px;width:min(22px,64%);height:100%;display:flex}.bars i{min-height:1px;display:block}.bars i:first-child{border-radius:4px 4px 0 0}.col .x{color:var(--muted);white-space:nowrap;margin-top:8px;font-size:11.5px;position:absolute;top:100%}.col .x em{color:var(--ink2);margin-top:1px;font-style:normal;position:absolute;top:100%;left:0}.xpad{height:44px}.rank{grid-template-columns:minmax(84px,auto) minmax(0,1fr) auto;align-items:center;gap:9px 12px;display:grid}.rank .n{white-space:nowrap;text-overflow:ellipsis;max-width:170px;font-weight:550;overflow:hidden}.rank .n i{border-radius:3px;width:9px;height:9px;margin-right:7px;display:inline-block}.rank .b{background:var(--s1);border-radius:0 4px 4px 0;min-width:2px;height:8px;display:block}.rank .t{background:var(--wash);border-radius:4px;height:8px}.rank .val{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.rank .val small{color:var(--ink2);margin-left:6px;font-size:12px}.rank button.n{text-align:left;cursor:pointer;background:0 0;border:0;padding:0}.rank button.n:hover{color:var(--accent-ink)}.scroll{margin-inline:-10px;overflow-x:auto}table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%}th,td{text-align:left;vertical-align:top;border-bottom:1px solid var(--hair);white-space:nowrap;padding:10px 14px 10px 0;font-weight:400}tr:last-child td,tr:last-child th{border-bottom:0}th:first-child,td:first-child{padding-left:10px}th:last-child,td:last-child{padding-right:10px}thead th{color:var(--ink2);vertical-align:bottom;padding-top:0;padding-bottom:8px;font-size:12.5px;font-weight:500;border-bottom:1px solid var(--base)!important}thead th button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;padding:0}thead th[aria-sort] button{color:var(--ink);font-weight:600}.compare thead th,.wraphead thead th{white-space:normal;text-wrap:balance;min-width:76px}.flag{color:var(--ink2);vertical-align:super;cursor:default;outline-offset:2px;margin-left:2px;font-size:.55em}.num{text-align:right}.name{font-weight:550}.ph{display:none!important}.sub{color:var(--ink2);margin-top:2px;font-size:12.5px;font-weight:400;display:block}.title{white-space:normal;-webkit-line-clamp:2;-webkit-box-orient:vertical;min-width:140px;max-width:260px;display:-webkit-box;overflow:hidden}.sesstable .title,.sesstable td .sub{white-space:normal;max-width:460px}.sesstable .nw{white-space:nowrap}tbody tr.go{cursor:pointer}tbody tr.go:hover td,tbody tr.go:hover th{background:var(--wash)}.mix{gap:2px;width:84px;height:8px;margin-top:5px;display:flex}.mix i{min-width:2px;height:100%;display:block}.mix i:first-child{border-radius:4px 0 0 4px}.mix i:last-child{border-radius:0 4px 4px 0}.mix i:only-child{border-radius:4px}.heat{grid-template-columns:30px repeat(24,minmax(0,1fr));align-items:center;gap:2px;display:grid}.heat .rl{color:var(--ink2);font-size:12px}.heat .cl{color:var(--muted);text-align:left;padding-top:4px;font-size:11px}.heat .cell{aspect-ratio:1;background:color-mix(in srgb, var(--seq) var(--m), var(--wash));border-radius:3px;width:100%;max-height:26px}.heat .cell:hover{outline:2px solid var(--ink);outline-offset:-1px}.hstats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0 0;display:grid}.hstats div{align-content:start;gap:2px;min-width:0;display:grid}.hstats dt{color:var(--ink2);font-size:12px}.hstats dd{white-space:nowrap;align-items:center;gap:7px;margin:0;font-size:20px;font-weight:650;display:flex}.hstats .sub{color:var(--muted);font-size:12px}.hstats .sub .line{white-space:nowrap;display:block}.hstats dd.err{color:var(--neg)}.hstats+.rank,.hstats+.legend,.hstats+.rows{margin-top:18px}.lead+.hstats,header+.hstats{margin-top:2px}.hstats .gap{height:16px;display:block}.hstats .meter{background:var(--wash);border-radius:3px;height:6px;margin:6px 0 4px;display:block;overflow:hidden}.hstats .meter i{border-radius:3px;height:100%;display:block}.hstats .dots{flex-wrap:wrap;align-items:center;gap:3px;height:7px;margin:5px 0 4px;display:flex}.hstats .dots i{background:var(--wash);width:7px;height:7px;box-shadow:inset 0 0 0 1px var(--base);border-radius:50%}.hstats .dots i.on{background:var(--seq);box-shadow:none}.hstats .hsw{background:color-mix(in srgb, var(--seq) var(--m), var(--wash));border-radius:3px;width:12px;height:12px}.cseq{background:var(--seq)}.cneg{background:var(--neg)}.split{gap:2px;height:28px;margin:4px 0 12px;display:flex}.split i{color:#fff;white-space:nowrap;border-radius:4px;align-items:center;padding:0 9px;font-size:12.5px;font-style:normal;font-weight:600;display:flex;overflow:hidden}.split i:empty{padding:0}.split i.c4,.split i.c12,.split i.c14,.split i.c16{color:#0b0b0b}.split i.c0{color:var(--ink)}.money td.wide,.money th.wide{width:55%}.rank .b.k0{background:var(--k0)}.rank .b.k1{background:var(--k1)}.rank .b.k2{background:var(--k2)}.rank .b.kw{background:var(--kw)}.rank .b.kx{box-shadow:inset 0 0 0 1px var(--base);background:0 0}.split.kinds{cursor:default;min-width:240px;height:24px;margin:0}.k0{background:var(--k0)}.k1{background:var(--k1)}.k2{background:var(--k2)}.kw{background:var(--kw)}.kx{box-shadow:inset 0 0 0 1px var(--base);background:0 0}.split i.k0,.split i.k1,.split i.kw{color:#0b0b0b}.split i.k2{color:#fff}.split i.kx{color:var(--ink2)}:root[data-theme=dark] .split i.k0,:root[data-theme=dark] .split i.k1,:root[data-theme=dark] .split i.kw{color:#fff}:root[data-theme=dark] .split i.k2{color:#0b0b0b}.ck0{background:var(--ck0)}.ck1{background:var(--ck1)}.ck2{background:var(--ck2)}.empty{text-align:center;color:var(--ink2);padding:40px 0}#tip{z-index:9;border:1px solid var(--base);background:var(--raised);min-width:150px;max-width:400px;box-shadow:var(--shadow);pointer-events:none;border-radius:10px;padding:10px 12px;font-size:12.5px;display:none;position:fixed}#tip .h{color:var(--ink2);margin-bottom:6px}#tip .h:last-child{color:var(--ink);margin-bottom:0}#tip .r{align-items:center;gap:8px;display:flex}#tip .r span{flex:1;min-width:0}#tip .r b{white-space:nowrap}#tip .r i{border-radius:2px;flex:none;width:12px;height:3px}#tip .r span{color:var(--ink2)}#tip .r b{font-variant-numeric:tabular-nums;margin-left:auto;padding-left:16px;font-weight:600}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-corner{background:0 0}::-webkit-scrollbar-thumb{background:var(--sb) padding-box;border:3px solid #0000;border-radius:999px;min-height:36px}::-webkit-scrollbar-thumb:hover{background-color:var(--sb-hover)}@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:var(--sb) transparent}}.rank.tools .b{justify-content:flex-end;display:flex;overflow:hidden}.rank.tools .b i{background:var(--neg);height:100%}.rank .val small.err{color:var(--neg)}.rank .grp{color:var(--ink2);letter-spacing:.04em;text-transform:uppercase;grid-column:1/-1;margin-top:6px;font-size:11.5px;font-weight:600}.rank .grp:first-child{margin-top:0}.rank .b.parts{background:0 0;justify-content:flex-start;position:relative}.rank .b.parts b{flex:none;height:100%}.rank .b.parts i{position:absolute;top:0;right:0}.card>.disc.more{margin-top:10px}#tip .r i.neg{background:var(--neg)}.money td{vertical-align:middle}.sharebar{grid-template-columns:minmax(80px,1fr) 44px 64px;align-items:center;gap:10px;min-width:220px;padding-right:12px;display:grid}.sharebar .t{background:var(--wash);border-radius:4px;height:8px;overflow:hidden}.sharebar .t i{border-radius:4px;height:100%;display:block}.sharebar b{text-align:right;font-weight:600}.sharebar small{color:var(--ink2);text-align:right;font-size:12.5px}.rows{grid-template-columns:minmax(64px,auto) minmax(0,1fr);align-items:center;gap:10px 14px;display:grid}.rows.total{grid-template-columns:minmax(64px,auto) minmax(0,1fr) auto}.rows .num{color:var(--ink2);text-align:right;font-size:12.5px}.rows .n{white-space:nowrap;font-weight:550}.tree{position:relative}.tile{box-sizing:border-box;border:2px solid var(--surface);color:#fff;font:inherit;text-align:left;cursor:pointer;border-radius:10px;flex-direction:column;justify-content:flex-end;gap:2px;padding:8px 10px;transition:opacity .15s;display:flex;position:absolute;overflow:hidden}.tile b{white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}.tile span{opacity:.85;white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.tile.c4{color:#0b0b0b}.tile.c0{color:var(--ink)}.tile:hover{filter:brightness(1.08)}.tile:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.compare tfoot th,.compare tfoot td{color:var(--ink2);border-bottom:0;font-weight:600}.compare .quiet{color:var(--muted)}.ctl{flex:none;position:relative}.ctl svg,.search svg,.disc svg{fill:none;stroke:currentColor;stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:14px;height:14px}button.field{cursor:pointer}button.field:hover,button.field[aria-expanded=true],.field.search:focus-within{border-color:var(--base)}button.field:focus-visible,.disc:focus-visible,.clear:focus-visible,.cal-step:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.field.pick{color:var(--ink);gap:8px}.pick .pv{text-overflow:ellipsis;white-space:nowrap;max-width:200px;overflow:hidden}.pick .chev{color:var(--muted);transition:transform .15s}.field.pick.on{border-color:color-mix(in srgb, var(--accent) 45%, transparent);background:color-mix(in srgb, var(--accent) 9%, var(--surface));color:var(--accent-ink)}.field.pick.on .chev{color:var(--accent-ink)}.pick[aria-expanded=true] .chev{transform:rotate(180deg)}.pick .cal{color:var(--ink2)}.pop{z-index:8;border:1px solid var(--base);background:var(--raised);min-width:100%;box-shadow:var(--shadow);border-radius:12px;outline:none;padding:6px;position:absolute;top:calc(100% + 6px);left:0}.ttl{align-items:center;gap:6px;display:flex}.ib{width:22px;height:22px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;display:grid}.ib:hover,.ib[aria-expanded=true]{background:var(--wash);color:var(--ink)}.ib svg{fill:none;stroke:currentColor;stroke-width:1.4px;stroke-linecap:round;width:15px;height:15px}.pop.note{width:min(340px,100vw - 16px);color:var(--ink2);white-space:normal;padding:12px 14px;font-size:13px;line-height:1.5}.pop.note p{margin:0 0 8px}.pop.note ul{margin:0;padding-left:16px}.pop.note li+li{margin-top:4px}.note b{color:var(--ink);font-weight:600}.list{min-width:190px;max-height:340px;overflow-y:auto}.opt{color:var(--ink2);white-space:nowrap;cursor:pointer;border-radius:8px;justify-content:space-between;align-items:center;gap:16px;padding:7px 10px;font-size:13px;display:flex}.opt.active{background:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--ink)}.opt[aria-selected=true]{color:var(--accent-ink);font-weight:600}.opt .tick{color:var(--accent-ink)}.cal-pop{padding:12px 14px 10px}.cal-nav{pointer-events:none;justify-content:space-between;display:flex;position:absolute;top:12px;left:12px;right:12px}.cal-step{width:28px;height:28px;color:var(--ink2);cursor:pointer;pointer-events:auto;background:0 0;border:0;border-radius:8px;place-items:center;display:grid}.cal-step:hover:not(:disabled){background:var(--wash);color:var(--ink)}.cal-step:disabled{opacity:.3;cursor:default}.cal-months{gap:28px;display:flex}.cal-title{text-align:center;height:28px;margin-bottom:4px;font-size:13.5px;font-weight:600;line-height:28px}.cal-title:first-letter{text-transform:uppercase}.cal-row{grid-template-columns:repeat(7,36px);display:grid}.cal-wd{text-align:center;height:26px;color:var(--muted);font-size:11.5px;line-height:26px}.cal-cell{place-items:center;height:34px;margin:1px 0;display:grid}.cal-cell.in{background:color-mix(in srgb, var(--accent) 13%, transparent)}.cal-cell.lo,.cal-cell.in:first-child,.blank+.cal-cell.in{border-top-left-radius:9px;border-bottom-left-radius:9px}.cal-cell.hi,.cal-cell.in:last-child{border-top-right-radius:9px;border-bottom-right-radius:9px}.cal-cell.in:has(+.blank){border-top-right-radius:9px;border-bottom-right-radius:9px}.cal-day{width:34px;height:34px;color:var(--ink);font-variant-numeric:tabular-nums;cursor:pointer;background:0 0;border:0;border-radius:9px;font-size:13px}.cal-day:hover:not(:disabled){background:var(--wash)}.cal-day.today{box-shadow:inset 0 0 0 1px var(--base)}.cal-day.end,.cal-day.end:hover{background:var(--accent);color:#fff;box-shadow:none;font-weight:600}.cal-day:disabled{color:var(--muted);opacity:.45;cursor:default}.cal-day:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.field.search{gap:7px}.search .mag{color:var(--muted)}.search input{width:200px}.clear{width:22px;height:22px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;margin-right:-5px;display:grid}.clear:hover{background:var(--wash);color:var(--ink)}.disc{color:var(--ink2);cursor:pointer;background:0 0;border:0;border-radius:7px;align-items:center;gap:6px;margin-left:-6px;padding:4px 8px 4px 6px;font-size:12.5px;display:inline-flex}.disc:hover{background:var(--wash);color:var(--ink)}.disc svg{transition:transform .15s}.disc[aria-expanded=true] svg{transform:rotate(90deg)}.disclosure .scroll{margin-top:10px}@media (prefers-reduced-motion:reduce){.pick .chev,.disc svg{transition:none}}@media (width<=1400px){.o3{display:none}.filters{gap:8px}.pick .pv{max-width:112px}.range .pv{max-width:none}.filters .seg button{padding:5px 7px}}@media (width<=1500px){.wraphead .o3{display:none}}@media (width<=1060px){.two,.half{grid-template-columns:minmax(0,1fr)}.o2{display:none}}@media (width<=880px){.app{display:block}.side{border-right:0;border-bottom:1px solid var(--hair);scrollbar-width:none;flex-direction:row;align-items:center;gap:4px 6px;height:auto;padding:10px 16px;position:static;overflow-x:auto}.side::-webkit-scrollbar{display:none}.nav{flex:none}.brand{flex:none;padding:6px 10px 6px 2px}.brand .brand-lockup{width:120px}.navlabel,.foot .si{display:none}.foot .scan{padding:0}.foot .scan .icon{background:var(--wash)}.side .foot{background:var(--surface);border-top:0;align-self:stretch;align-items:center;gap:6px;margin:0 -16px 0 auto;padding:0 16px 0 10px;display:flex;position:sticky;right:-16px}.nav{flex-direction:row}.nav button{white-space:nowrap}.nav svg{display:none}.nav.quiet button{padding:8px 10px;font-size:14px}main{padding:20px 20px 48px}.title{max-width:200px}.filters{gap:8px}.filters .seg button{padding:5px 6px;font-size:12.5px}.field{padding:0 8px}}@media (width<=600px){main{padding:16px 16px 40px}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.grid,.stack{gap:14px}.kpi .spark{display:none}.kpi .d{white-space:normal}.kpi .v{font-size:24px}.card{padding:16px}.o1{display:none}.title{max-width:160px}.search input{width:150px}.ph{white-space:normal;max-width:170px;display:block!important}thead th{white-space:normal}.mix.wide{width:84px!important}th,td{padding-right:10px}.axis,.plot{height:190px}.chart{grid-template-columns:38px minmax(0,1fr)}.heat{grid-template-columns:32px repeat(24,minmax(0,1fr));gap:1px}.hstats{grid-template-columns:repeat(2,minmax(0,1fr))}.rank .n{max-width:120px}.price th,.price td{padding-right:8px;font-size:13px}.price .lv{gap:5px}}.refresh:disabled{cursor:progress}.refresh.busy svg{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.refresh.busy svg{animation-duration:3s}}.alert{color:var(--neg);margin:-6px 0 0;font-size:12.5px}.loading{text-align:center;color:var(--ink2);padding:80px 0}.boot{place-items:center;min-height:100vh;padding:24px 16px;display:grid}.boot-in{gap:14px;width:min(400px,100%);margin-top:-8vh;display:grid}.boot .brand{padding:8px 0 12px}.boot .brand .brand-lockup{width:160px}.boot-msg{margin:0;font-size:15px;font-weight:550}.boot-err{color:var(--neg);overflow-wrap:anywhere;margin:0;font-size:13px}.boot .clearall{justify-self:start}.boot-bar{background:var(--wash);border-radius:3px;height:6px;overflow:hidden}.boot-bar span{background:var(--accent);border-radius:3px;width:0;height:100%;transition:width .3s;display:block}.boot-bar.wait span{width:30%;animation:1.2s ease-in-out infinite boot-wait}@keyframes boot-wait{0%{transform:translate(-100%)}to{transform:translate(340%)}}.boot-count{color:var(--ink2);font-variant-numeric:tabular-nums;margin:0;font-size:12.5px}@media (prefers-reduced-motion:reduce){.boot-bar span{transition:none}.boot-bar.wait span{opacity:.35;width:100%;animation:none}}.plot .bands,.plot .bands i,.plot .bands svg{pointer-events:none;position:absolute;inset:0}.plot .bands svg{width:100%;height:100%;overflow:visible}.plot .bands i{opacity:.42;-webkit-mask-image:linear-gradient(#000 20%,#00000026);mask-image:linear-gradient(#000 20%,#00000026)}:root[data-theme=dark] .plot .bands i{opacity:.62}.plot .bands polyline{fill:none;stroke:var(--base);stroke-width:2px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}.plot .bands polyline.c0{stroke:var(--s0)}.plot .bands polyline.c1{stroke:var(--s1)}.plot .bands polyline.c2{stroke:var(--s2)}.plot .bands polyline.c3{stroke:var(--s3)}.plot .bands polyline.c4{stroke:var(--s4)}.plot .bands polyline.c5{stroke:var(--s5)}.plot .bands polyline.c6{stroke:var(--s6)}.plot .bands polyline.c7{stroke:var(--s7)}.plot .bands polyline.c8{stroke:var(--s8)}.plot .bands polyline.c9{stroke:var(--s9)}.plot .bands polyline.c10{stroke:var(--s10)}.plot .bands polyline.c11{stroke:var(--s11)}.plot .bands polyline.c12{stroke:var(--s12)}.plot .bands polyline.c13{stroke:var(--s13)}.plot .bands polyline.c14{stroke:var(--s14)}.plot .bands polyline.c15{stroke:var(--s15)}.plot .bands polyline.c16{stroke:var(--s16)}.plot .bands polyline.csub{stroke:var(--sub)}.plot .bands polyline.v0{stroke:var(--v0)}.plot .bands polyline.v1{stroke:var(--v1)}.plot .bands polyline.v2{stroke:var(--v2)}.plot .bands polyline.v3{stroke:var(--v3)}.plot .bands polyline.v4{stroke:var(--v4)}.plot .bands polyline.k0{stroke:var(--k0)}.plot .bands polyline.k1{stroke:var(--k1)}.plot .bands polyline.k2{stroke:var(--k2)}.plot .bands polyline.kw,.plot .bands polyline.kx{stroke:var(--base)}.plot.area .col:hover,.plot.area .col:focus-visible{background:0 0}.plot.area .col:hover:before,.plot.area .col:focus-visible:before{content:"";background:var(--ink);opacity:.55;width:1px;position:absolute;top:0;bottom:0;left:50%}.plot.area .col .dot{z-index:1;width:8px;height:8px;box-shadow:0 0 0 2px var(--surface);pointer-events:none;border-radius:50%;margin:0 0 -4px -4px;display:none;position:absolute;left:50%}.plot.area .col:hover .dot,.plot.area .col:focus-visible .dot{display:block}.spark polygon{stroke:none}.spark .g0{stop-color:var(--ink2);stop-opacity:.2}.spark .g1{stop-color:var(--ink2);stop-opacity:0}.magbar{min-width:56px;padding-bottom:6px;display:inline-block;position:relative}.magbar:after{content:"";height:3px;width:calc(var(--w) * 56px);background:var(--ink2);opacity:.55;border-radius:2px;position:absolute;bottom:0;right:0}.panels{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 32px;display:grid}.panel h3{color:var(--ink2);margin:0 0 10px;font-size:13px;font-weight:600}@media (width<=1060px){.panels{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=640px){.panels{grid-template-columns:minmax(0,1fr)}}.chartseg button{align-items:center;display:inline-flex}.chartseg svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;stroke-linejoin:round;width:16px;height:16px}.card>header .segs{align-items:center}.gauge{margin:2px 0 6px}.gauge .track{gap:2px;height:14px;display:flex}.gauge .track i{height:100%;display:block}.gauge .track i:first-child{border-radius:4px 0 0 4px}.gauge .track i:last-child{border-radius:0 4px 4px 0}.gauge .ticks{height:18px;color:var(--muted);font-variant-numeric:tabular-nums;margin-top:6px;font-size:11.5px;position:relative}.gauge .ticks span{white-space:nowrap;position:absolute;top:0;transform:translate(-50%)}.gauge .ticks span:first-child{transform:none}.gauge .ticks span:last-child{color:var(--ink2);transform:translate(-100%)}.ctx .hstats{grid-template-columns:repeat(3,minmax(0,1fr));margin:16px 0 18px}.ctx .hstats .tipped{cursor:default;-webkit-text-decoration:underline dotted var(--base);text-decoration:underline dotted var(--base);text-underline-offset:5px;outline-offset:3px}.ctx td,.ctx th{vertical-align:middle}.ctx td.lbl{font-weight:550}.ctx td.lbl .sub{margin:0 0 0 6px;display:inline}.ctx tfoot td{border-top:1px solid var(--base);color:var(--ink2);border-bottom:0;font-weight:600}.ctx .better{color:var(--good);font-weight:600}.ctx .worse{color:var(--neg);font-weight:600}.cell-bar{width:42%}td.cell-bar .split.kinds{min-width:0;height:20px;margin:0}.bar1{background:var(--s1);border-radius:0 4px 4px 0;min-width:2px;height:8px;display:block}.est{border:1px dashed var(--base);height:22px;color:var(--ink2);font:inherit;cursor:default;background:0 0;border-radius:999px;align-items:center;padding:0 9px;font-size:12px;font-weight:500;display:inline-flex}.est:hover,.est:focus-visible{color:var(--ink);border-color:var(--ink2)}.chip{background:color-mix(in srgb, var(--accent) 16%, var(--raised));color:var(--accent-ink);vertical-align:1px;border-radius:999px;margin-left:8px;padding:1px 7px;font-size:11.5px;font-weight:600;display:inline-block}.ctx tbody tr.now td{--line:color-mix(in srgb, var(--accent) 45%, transparent);background:color-mix(in srgb, var(--accent) 7%, transparent);box-shadow:inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line)}.ctx tbody tr.now td:first-child{box-shadow:inset 1px 1px 0 var(--line), inset 0 -1px 0 var(--line);border-radius:8px 0 0 8px}.ctx tbody tr.now td:last-child{box-shadow:inset -1px 1px 0 var(--line), inset 0 -1px 0 var(--line);border-radius:0 8px 8px 0}@media (width<=600px){.ctx .hstats{grid-template-columns:repeat(3,minmax(0,1fr))}.ctx .hstats dd{font-size:17px}}.kpi{container-type:inline-size}@container (width<=260px){.kpis:has(.v small) .spark{display:none}}
|
|
File without changes
|