claude-code-cost 0.26.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/hub-app.json +25 -0
  2. package/lib/net-guard.js +6 -1
  3. package/package.json +2 -1
  4. package/public/app.js +36 -111
  5. package/public/fonts/OFL-IBM-Plex.txt +93 -0
  6. package/public/fonts/OFL-Playfair-Display.txt +93 -0
  7. package/public/fonts/fonts.css +244 -0
  8. package/public/fonts/ibm-plex-mono-cyrillic-400.woff2 +0 -0
  9. package/public/fonts/ibm-plex-mono-cyrillic-500.woff2 +0 -0
  10. package/public/fonts/ibm-plex-mono-cyrillic-600.woff2 +0 -0
  11. package/public/fonts/ibm-plex-mono-cyrillic-ext-400.woff2 +0 -0
  12. package/public/fonts/ibm-plex-mono-cyrillic-ext-500.woff2 +0 -0
  13. package/public/fonts/ibm-plex-mono-cyrillic-ext-600.woff2 +0 -0
  14. package/public/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  15. package/public/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  16. package/public/fonts/ibm-plex-mono-latin-600.woff2 +0 -0
  17. package/public/fonts/ibm-plex-mono-latin-ext-400.woff2 +0 -0
  18. package/public/fonts/ibm-plex-mono-latin-ext-500.woff2 +0 -0
  19. package/public/fonts/ibm-plex-mono-latin-ext-600.woff2 +0 -0
  20. package/public/fonts/ibm-plex-mono-vietnamese-400.woff2 +0 -0
  21. package/public/fonts/ibm-plex-mono-vietnamese-500.woff2 +0 -0
  22. package/public/fonts/ibm-plex-mono-vietnamese-600.woff2 +0 -0
  23. package/public/fonts/playfair-display-cyrillic-400.woff2 +0 -0
  24. package/public/fonts/playfair-display-latin-400.woff2 +0 -0
  25. package/public/fonts/playfair-display-latin-ext-400.woff2 +0 -0
  26. package/public/fonts/playfair-display-vietnamese-400.woff2 +0 -0
  27. package/public/index.html +3 -3
  28. package/public/style.css +31 -2
  29. package/public/themes.css +0 -34
  30. package/public/vendor/claude-hub-sdk.js +50 -0
  31. package/server.js +3 -4
package/hub-app.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "manifest": 1,
3
+ "id": "cost",
4
+ "name": "Cost",
5
+ "icon": "dollar-sign",
6
+ "run": { "entry": "server.js", "defaultPort": 3543 },
7
+ "loading": {
8
+ "verbs": [
9
+ "Counting tokens…",
10
+ "Tallying the bill…",
11
+ "Stacking bars…",
12
+ "Crunching numbers…",
13
+ "Checking the cache hits…",
14
+ "Adding up the days…",
15
+ "Balancing the books…",
16
+ "Plotting the trend…",
17
+ "Weighing the models…"
18
+ ]
19
+ },
20
+ "actions": {
21
+ "handles": {
22
+ "session.cost": { "params": { "session": "string?" }, "url": "?view=detail&session={session}", "mode": "message" }
23
+ }
24
+ }
25
+ }
package/lib/net-guard.js CHANGED
@@ -36,6 +36,7 @@ const PORT_RE = /^[0-9]{1,5}$/;
36
36
  // The port is validated but not compared — the listen(0) fallbacks make the real
37
37
  // port dynamic, so only the host is allowlisted.
38
38
  const validPort = (p) => PORT_RE.test(p) && Number(p) >= 1 && Number(p) <= 65535;
39
+ const KEEP_ALIVE_MS = 65000;
39
40
 
40
41
  function isLoopbackAddress(host) {
41
42
  if (!host) return false;
@@ -249,6 +250,10 @@ function createNetGuard(config = {}) {
249
250
  const serverOpts = opts.maxHeaderSize ? { maxHeaderSize: opts.maxHeaderSize } : {};
250
251
  const makeServer = (handler) => {
251
252
  const s = http.createServer(serverOpts, handler);
253
+ // Node's 5 s default closes idle sockets that the hub proxy and the browser would reuse, and a
254
+ // fresh loopback connect is the one that some Windows network filters drop. The hub's agent
255
+ // drops its idle sockets before this, so it never reuses one the server is closing.
256
+ s.keepAliveTimeout = KEEP_ALIVE_MS;
252
257
  if (opts.onUpgrade) s.on('upgrade', opts.onUpgrade);
253
258
  return s;
254
259
  };
@@ -281,4 +286,4 @@ function createNetGuard(config = {}) {
281
286
  return { BIND_HOST, ALLOWED_HOSTS, EXPOSED, hostGuard, originGuard, upgradeVerdict, frameGuard, listenLoopback, exposureWarning };
282
287
  }
283
288
 
284
- module.exports = { createNetGuard, parseHostHeader, isLoopbackAddress };
289
+ module.exports = { createNetGuard, parseHostHeader, isLoopbackAddress, KEEP_ALIVE_MS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-cost",
3
- "version": "0.26.0",
3
+ "version": "1.1.0",
4
4
  "description": "Cost dashboard for Claude Code usage",
5
5
  "main": "server.js",
6
6
  "type": "commonjs",
@@ -45,6 +45,7 @@
45
45
  "license": "MIT",
46
46
  "files": [
47
47
  "server.js",
48
+ "hub-app.json",
48
49
  "lib/",
49
50
  "public/",
50
51
  "README.md",
package/public/app.js CHANGED
@@ -2118,15 +2118,17 @@ function loadTheme() {
2118
2118
  syncColorThemeSelect(colorTheme || 'ember');
2119
2119
  }
2120
2120
 
2121
- function buildThemeMenu() {
2121
+ function buildThemeMenu(themes = COLOR_THEMES) {
2122
2122
  const menu = document.getElementById('themeMenu');
2123
- menu.innerHTML = COLOR_THEMES.map(
2124
- ([id, label]) =>
2125
- `<button type="button" class="theme-menu-item theme-swatch-${id}" data-theme-id="${id}"
2123
+ menu.innerHTML = themes
2124
+ .map(
2125
+ ([id, label]) =>
2126
+ `<button type="button" class="theme-menu-item theme-swatch-${id}" data-theme-id="${id}"
2126
2127
  onclick="event.stopPropagation(); setColorTheme('${id}'); toggleThemeMenu()">
2127
- <span class="theme-swatch theme-swatch-${id}"><i class="sw-bg"></i><i class="sw-accent"></i><i class="sw-ink"></i></span>${label}
2128
+ <span class="theme-swatch theme-swatch-${id}"><i class="sw-bg"></i><i class="sw-accent"></i><i class="sw-ink"></i></span>${esc(label)}
2128
2129
  </button>`,
2129
- ).join('');
2130
+ )
2131
+ .join('');
2130
2132
  }
2131
2133
 
2132
2134
  // biome-ignore lint/correctness/noUnusedVariables: called from topbar markup
@@ -2526,7 +2528,6 @@ async function navigateToSessions(encodedPath, name) {
2526
2528
  await navigate('sessions', { project: encodedPath, projectName: name });
2527
2529
  }
2528
2530
 
2529
- // biome-ignore lint/correctness/noUnusedVariables: called from HTML onclick
2530
2531
  async function navigateToDetail(sessionId) {
2531
2532
  lastSelectedSession = sessionId;
2532
2533
  currentSessionId = sessionId;
@@ -2882,6 +2883,8 @@ const SHORTCUT_PAIRS = [
2882
2883
  { keys: ['Ctrl', 'Alt', '←/→'], combo: true, label: 'Previous / next hub app' },
2883
2884
  { keys: ['Alt', '1…9'], combo: true, label: 'Jump to hub app by number' },
2884
2885
  { keys: ['Ctrl', 'Alt', 'P'], combo: true, label: 'Project picker' },
2886
+ { keys: ['Ctrl', 'Alt', 'W'], combo: true, label: 'Config dir picker' },
2887
+ { keys: ['Ctrl', 'Alt', 'A'], combo: true, label: 'App launcher' },
2885
2888
  ],
2886
2889
  },
2887
2890
  ],
@@ -3148,7 +3151,7 @@ function renderLimits() {
3148
3151
  function toggleHelpModal() {
3149
3152
  const list = document.getElementById('helpShortcuts');
3150
3153
  if (!list.childElementCount) list.innerHTML = buildHelpShortcuts();
3151
- list.classList.toggle('sc-standalone', !window.__HUB__?.enabled);
3154
+ list.classList.toggle('sc-standalone', hub.status === 'standalone');
3152
3155
  document.getElementById('helpModal').classList.toggle('visible');
3153
3156
  }
3154
3157
 
@@ -3369,123 +3372,45 @@ async function refreshIfStale() {
3369
3372
 
3370
3373
  // #region HUB_INTEGRATION
3371
3374
 
3372
- (async function initHub() {
3373
- const cfg = await fetch('/hub-config')
3374
- .then((r) => r.json())
3375
- .catch(() => ({}));
3376
- if (!cfg.enabled) return;
3377
-
3378
- window.__HUB__ = cfg;
3379
-
3380
- // e.code travels with e.key because macOS composes Option+<key> into a character (Option+P is
3381
- // 'π'), so the key alone cannot identify the binding. The hub owns the keymap and normalizes;
3382
- // these tests only decide whether a press is the hub's to handle.
3383
- document.addEventListener('keydown', (e) => {
3384
- if (!isHubKey(e)) return;
3385
- e.preventDefault();
3386
- hubPost({ type: 'hub:keydown', key: e.key, code: e.code, ctrl: e.ctrlKey, alt: e.altKey, shift: e.shiftKey });
3387
- });
3388
- })();
3389
-
3390
- // The combos the hub binds, from its hub:keys message. Null until one arrives: a hub from before
3391
- // hub:keys sends none, and the fallback filter below is what such a hub expects.
3392
- let hubKeys = null;
3393
-
3394
- // A copy of the hub's comboOf(): its names must match the hub:keys list.
3395
- function hubCombo(e) {
3396
- const lower = (e.key || '').toLowerCase();
3397
- const m = /^(?:Key|Digit)([A-Z1-9])$/.exec(e.code || '');
3398
- const key = /^[a-z1-9]$/.test(lower) ? lower : m ? m[1].toLowerCase() : e.key;
3399
- const mods = [e.ctrlKey && 'ctrl', e.altKey && 'alt', e.shiftKey && 'shift', e.metaKey && 'meta'];
3400
- return [...mods, key].filter(Boolean).join('+');
3401
- }
3375
+ const hub = ClaudeHub.connect();
3402
3376
 
3403
- function isHubKey(e) {
3404
- if (hubKeys) return hubKeys.has(hubCombo(e));
3405
- if (e.ctrlKey && e.altKey && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) return true;
3406
- // Own branch: the Alt+digit case below requires !ctrlKey. The hub owns the Ctrl+Alt+letter
3407
- // keymap and ignores unbound letters.
3408
- if (e.ctrlKey && e.altKey && !e.shiftKey && !e.metaKey && (/^[a-z]$/i.test(e.key) || /^Key[A-Z]$/.test(e.code))) {
3409
- return true;
3410
- }
3411
- return e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey && (/^[1-9]$/.test(e.key) || /^Digit[1-9]$/.test(e.code));
3412
- }
3377
+ document.getElementById('helpDocs')?.addEventListener('click', (e) => {
3378
+ e.preventDefault();
3379
+ hub.openExternal(e.currentTarget.href);
3380
+ });
3413
3381
 
3414
- // Hoisted out of initHubTheme so initHubProject can share it.
3415
- const hubOrigin = () => (window.__HUB__?.url ? new URL(window.__HUB__.url).origin : null);
3382
+ hub.onActive((active) => {
3383
+ hubActive = active;
3384
+ // Becoming active is the main refresh trigger — the interval only covers staying active.
3385
+ if (hubActive) refreshIfStale();
3386
+ });
3416
3387
 
3417
- // Every send is addressed to the hub explicitly. With targetOrigin '*' any page that
3418
- // framed this app also received the forwarded keystrokes and navigation intents.
3419
- function hubPost(message) {
3420
- const origin = hubOrigin();
3421
- if (origin) window.parent?.postMessage(message, origin);
3422
- }
3388
+ // The hub owns the abs->encoded transform, so cost never converts anything itself.
3389
+ hub.subscribe('project.changed', (p) => applyScope(p?.encoded ?? null, p?.name));
3423
3390
 
3424
- window.hubNavigate = function hubNavigate(app, url) {
3425
- if (!window.__HUB__?.enabled) return;
3426
- hubPost({ type: 'hub:navigate', app, url });
3427
- };
3391
+ hub.handle('session.cost', (p) => p.session && navigateToDetail(p.session));
3428
3392
 
3429
3393
  (function initHubTheme() {
3430
3394
  const getTheme = () => (document.body.classList.contains('light') ? 'light' : 'dark');
3431
3395
  const getColorTheme = () => document.body.dataset.colorTheme || 'ember';
3432
- // lastTheme/lastColorTheme are updated synchronously when applying a hub
3433
- // message, so the (async) observer sees no diff and doesn't echo it back.
3434
- let lastTheme = getTheme();
3435
- let lastColorTheme = getColorTheme();
3436
- window.addEventListener('message', (e) => {
3437
- if (e.source !== window.parent || e.origin !== hubOrigin()) return;
3438
- if (e.data?.type !== 'hub:theme') return;
3439
- if (typeof e.data.colorTheme === 'string' && e.data.colorTheme !== getColorTheme()) {
3440
- setColorTheme(e.data.colorTheme);
3441
- lastColorTheme = getColorTheme();
3442
- }
3443
- if (getTheme() !== e.data.theme) {
3444
- window.toggleTheme();
3445
- lastTheme = getTheme();
3446
- }
3396
+ const report = hub.bindTheme({
3397
+ get: () => ({ theme: getTheme(), colorTheme: getColorTheme() }),
3398
+ set: ({ theme, colorTheme }) => {
3399
+ if (colorTheme !== getColorTheme()) setColorTheme(colorTheme);
3400
+ if (theme !== getTheme()) toggleTheme();
3401
+ },
3447
3402
  });
3448
- new MutationObserver(() => {
3449
- const t = getTheme();
3450
- const ct = getColorTheme();
3451
- if (t === lastTheme && ct === lastColorTheme) return;
3452
- lastTheme = t;
3453
- lastColorTheme = ct;
3454
- hubPost({ type: 'hub:theme', theme: t, colorTheme: ct });
3455
- }).observe(document.body, {
3403
+ new MutationObserver(report).observe(document.body, {
3456
3404
  attributes: true,
3457
3405
  attributeFilter: ['class', 'data-color-theme'],
3458
3406
  });
3459
3407
  })();
3460
3408
 
3461
- (function initHubKeys() {
3462
- window.addEventListener('message', (e) => {
3463
- if (e.source !== window.parent || e.origin !== hubOrigin()) return;
3464
- if (e.data?.type !== 'hub:keys' || !Array.isArray(e.data.keys)) return;
3465
- hubKeys = new Set(e.data.keys.filter((k) => typeof k === 'string'));
3466
- });
3467
- })();
3468
-
3469
- (function initHubActive() {
3470
- window.addEventListener('message', (e) => {
3471
- if (e.source !== window.parent || e.origin !== hubOrigin()) return;
3472
- if (e.data?.type !== 'hub:active') return;
3473
- hubActive = !!e.data.active;
3474
- // Becoming active is the main refresh trigger — the interval only covers staying active.
3475
- if (hubActive) refreshIfStale();
3476
- });
3477
- })();
3478
-
3479
- (function initHubProject() {
3480
- window.addEventListener('message', (e) => {
3481
- if (e.source !== window.parent || e.origin !== hubOrigin()) return;
3482
- if (e.data?.type !== 'hub:project') return;
3483
- // The hub owns the abs->encoded transform, so cost never converts anything itself.
3484
- const encoded = e.data.encoded;
3485
- if (typeof encoded !== 'string' || !encoded) return;
3486
- applyScope(encoded, e.data.name);
3487
- });
3488
- })();
3409
+ // Under the hub the picker lists the hub's themes, which include the user's own (protocol section 6, rule 5).
3410
+ hub.onThemes((themes) => {
3411
+ buildThemeMenu(themes.map((t) => [t.id, t.label]));
3412
+ syncColorThemeSelect(document.body.dataset.colorTheme);
3413
+ });
3489
3414
 
3490
3415
  // #endregion
3491
3416
 
@@ -0,0 +1,93 @@
1
+ Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+
5
+ This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2017 The Playfair Display Project Authors (https://github.com/clauseggers/Playfair-Display), with Reserved Font Name "Playfair Display"
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,244 @@
1
+ /* IBM Plex Mono and Playfair Display, SIL Open Font License 1.1 (see the OFL-*.txt files). Mirrored from Google Fonts. */
2
+ /* cyrillic-ext */
3
+ @font-face {
4
+ font-family: 'IBM Plex Mono';
5
+ font-style: normal;
6
+ font-weight: 400;
7
+ font-display: swap;
8
+ src: url(ibm-plex-mono-cyrillic-ext-400.woff2) format('woff2');
9
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
10
+ }
11
+ /* cyrillic */
12
+ @font-face {
13
+ font-family: 'IBM Plex Mono';
14
+ font-style: normal;
15
+ font-weight: 400;
16
+ font-display: swap;
17
+ src: url(ibm-plex-mono-cyrillic-400.woff2) format('woff2');
18
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
19
+ }
20
+ /* vietnamese */
21
+ @font-face {
22
+ font-family: 'IBM Plex Mono';
23
+ font-style: normal;
24
+ font-weight: 400;
25
+ font-display: swap;
26
+ src: url(ibm-plex-mono-vietnamese-400.woff2) format('woff2');
27
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
28
+ }
29
+ /* latin-ext */
30
+ @font-face {
31
+ font-family: 'IBM Plex Mono';
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ font-display: swap;
35
+ src: url(ibm-plex-mono-latin-ext-400.woff2) format('woff2');
36
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
37
+ }
38
+ /* latin */
39
+ @font-face {
40
+ font-family: 'IBM Plex Mono';
41
+ font-style: normal;
42
+ font-weight: 400;
43
+ font-display: swap;
44
+ src: url(ibm-plex-mono-latin-400.woff2) format('woff2');
45
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
46
+ }
47
+ /* cyrillic-ext */
48
+ @font-face {
49
+ font-family: 'IBM Plex Mono';
50
+ font-style: normal;
51
+ font-weight: 500;
52
+ font-display: swap;
53
+ src: url(ibm-plex-mono-cyrillic-ext-500.woff2) format('woff2');
54
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
55
+ }
56
+ /* cyrillic */
57
+ @font-face {
58
+ font-family: 'IBM Plex Mono';
59
+ font-style: normal;
60
+ font-weight: 500;
61
+ font-display: swap;
62
+ src: url(ibm-plex-mono-cyrillic-500.woff2) format('woff2');
63
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
64
+ }
65
+ /* vietnamese */
66
+ @font-face {
67
+ font-family: 'IBM Plex Mono';
68
+ font-style: normal;
69
+ font-weight: 500;
70
+ font-display: swap;
71
+ src: url(ibm-plex-mono-vietnamese-500.woff2) format('woff2');
72
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
73
+ }
74
+ /* latin-ext */
75
+ @font-face {
76
+ font-family: 'IBM Plex Mono';
77
+ font-style: normal;
78
+ font-weight: 500;
79
+ font-display: swap;
80
+ src: url(ibm-plex-mono-latin-ext-500.woff2) format('woff2');
81
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
82
+ }
83
+ /* latin */
84
+ @font-face {
85
+ font-family: 'IBM Plex Mono';
86
+ font-style: normal;
87
+ font-weight: 500;
88
+ font-display: swap;
89
+ src: url(ibm-plex-mono-latin-500.woff2) format('woff2');
90
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
91
+ }
92
+ /* cyrillic-ext */
93
+ @font-face {
94
+ font-family: 'IBM Plex Mono';
95
+ font-style: normal;
96
+ font-weight: 600;
97
+ font-display: swap;
98
+ src: url(ibm-plex-mono-cyrillic-ext-600.woff2) format('woff2');
99
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
100
+ }
101
+ /* cyrillic */
102
+ @font-face {
103
+ font-family: 'IBM Plex Mono';
104
+ font-style: normal;
105
+ font-weight: 600;
106
+ font-display: swap;
107
+ src: url(ibm-plex-mono-cyrillic-600.woff2) format('woff2');
108
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
109
+ }
110
+ /* vietnamese */
111
+ @font-face {
112
+ font-family: 'IBM Plex Mono';
113
+ font-style: normal;
114
+ font-weight: 600;
115
+ font-display: swap;
116
+ src: url(ibm-plex-mono-vietnamese-600.woff2) format('woff2');
117
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
118
+ }
119
+ /* latin-ext */
120
+ @font-face {
121
+ font-family: 'IBM Plex Mono';
122
+ font-style: normal;
123
+ font-weight: 600;
124
+ font-display: swap;
125
+ src: url(ibm-plex-mono-latin-ext-600.woff2) format('woff2');
126
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
127
+ }
128
+ /* latin */
129
+ @font-face {
130
+ font-family: 'IBM Plex Mono';
131
+ font-style: normal;
132
+ font-weight: 600;
133
+ font-display: swap;
134
+ src: url(ibm-plex-mono-latin-600.woff2) format('woff2');
135
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
136
+ }
137
+ /* cyrillic */
138
+ @font-face {
139
+ font-family: 'Playfair Display';
140
+ font-style: normal;
141
+ font-weight: 400;
142
+ font-display: swap;
143
+ src: url(playfair-display-cyrillic-400.woff2) format('woff2');
144
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
145
+ }
146
+ /* vietnamese */
147
+ @font-face {
148
+ font-family: 'Playfair Display';
149
+ font-style: normal;
150
+ font-weight: 400;
151
+ font-display: swap;
152
+ src: url(playfair-display-vietnamese-400.woff2) format('woff2');
153
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
154
+ }
155
+ /* latin-ext */
156
+ @font-face {
157
+ font-family: 'Playfair Display';
158
+ font-style: normal;
159
+ font-weight: 400;
160
+ font-display: swap;
161
+ src: url(playfair-display-latin-ext-400.woff2) format('woff2');
162
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
163
+ }
164
+ /* latin */
165
+ @font-face {
166
+ font-family: 'Playfair Display';
167
+ font-style: normal;
168
+ font-weight: 400;
169
+ font-display: swap;
170
+ src: url(playfair-display-latin-400.woff2) format('woff2');
171
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
172
+ }
173
+ /* cyrillic */
174
+ @font-face {
175
+ font-family: 'Playfair Display';
176
+ font-style: normal;
177
+ font-weight: 500;
178
+ font-display: swap;
179
+ src: url(playfair-display-cyrillic-400.woff2) format('woff2');
180
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
181
+ }
182
+ /* vietnamese */
183
+ @font-face {
184
+ font-family: 'Playfair Display';
185
+ font-style: normal;
186
+ font-weight: 500;
187
+ font-display: swap;
188
+ src: url(playfair-display-vietnamese-400.woff2) format('woff2');
189
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
190
+ }
191
+ /* latin-ext */
192
+ @font-face {
193
+ font-family: 'Playfair Display';
194
+ font-style: normal;
195
+ font-weight: 500;
196
+ font-display: swap;
197
+ src: url(playfair-display-latin-ext-400.woff2) format('woff2');
198
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
199
+ }
200
+ /* latin */
201
+ @font-face {
202
+ font-family: 'Playfair Display';
203
+ font-style: normal;
204
+ font-weight: 500;
205
+ font-display: swap;
206
+ src: url(playfair-display-latin-400.woff2) format('woff2');
207
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
208
+ }
209
+ /* cyrillic */
210
+ @font-face {
211
+ font-family: 'Playfair Display';
212
+ font-style: normal;
213
+ font-weight: 600;
214
+ font-display: swap;
215
+ src: url(playfair-display-cyrillic-400.woff2) format('woff2');
216
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
217
+ }
218
+ /* vietnamese */
219
+ @font-face {
220
+ font-family: 'Playfair Display';
221
+ font-style: normal;
222
+ font-weight: 600;
223
+ font-display: swap;
224
+ src: url(playfair-display-vietnamese-400.woff2) format('woff2');
225
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
226
+ }
227
+ /* latin-ext */
228
+ @font-face {
229
+ font-family: 'Playfair Display';
230
+ font-style: normal;
231
+ font-weight: 600;
232
+ font-display: swap;
233
+ src: url(playfair-display-latin-ext-400.woff2) format('woff2');
234
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
235
+ }
236
+ /* latin */
237
+ @font-face {
238
+ font-family: 'Playfair Display';
239
+ font-style: normal;
240
+ font-weight: 600;
241
+ font-display: swap;
242
+ src: url(playfair-display-latin-400.woff2) format('woff2');
243
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
244
+ }
package/public/index.html CHANGED
@@ -4,9 +4,7 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Claude Code Cost</title>
7
- <link rel="preconnect" href="https://fonts.googleapis.com">
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Playfair+Display:wght@400;500;600&display=swap" rel="stylesheet">
7
+ <link rel="stylesheet" href="fonts/fonts.css">
10
8
  <link rel="stylesheet" href="style.css">
11
9
  <link rel="stylesheet" href="themes.css">
12
10
  <script defer src="https://cdn.jsdelivr.net/npm/chart.js"></script>
@@ -20,6 +18,7 @@
20
18
  <script defer src="/app.js"></script>
21
19
  </head>
22
20
  <body>
21
+ <script src="/vendor/claude-hub-sdk.js"></script>
23
22
  <div class="topbar">
24
23
  <div class="topbar-logo">
25
24
  <div class="logo-mark">
@@ -102,6 +101,7 @@
102
101
  <div class="modal-box modal-help">
103
102
  <div class="modal-header">
104
103
  <div class="modal-title">Cost Dashboard</div>
104
+ <a class="help-docs" id="helpDocs" href="https://nikiforovall.blog/claude-code-cost/" target="_blank" rel="noopener">Docs ↗</a>
105
105
  <button class="modal-close" aria-label="Close dialog" onclick="toggleHelpModal()">&#10005;</button>
106
106
  </div>
107
107
  <div class="modal-body">
package/public/style.css CHANGED
@@ -14,7 +14,6 @@
14
14
  --accent-text: #f0a070;
15
15
  --accent-dim: rgba(232, 111, 51, 0.25);
16
16
  --accent-glow: rgba(232, 111, 51, 0.55);
17
- --chart-fill: rgba(232, 111, 51, 0.32);
18
17
  --success: #3ecf8e;
19
18
  --success-dim: rgba(62, 207, 142, 0.18);
20
19
  --warning: #f0b429;
@@ -33,6 +32,11 @@
33
32
  --workflow: var(--chart-2);
34
33
  }
35
34
 
35
+ /* On body, not :root: the hub SDK writes theme vars on body, and var() resolves where the property is declared. */
36
+ body {
37
+ --chart-fill: color-mix(in srgb, var(--accent) 32%, transparent);
38
+ }
39
+
36
40
  /* #endregion */
37
41
 
38
42
  /* #region RESET */
@@ -48,6 +52,13 @@
48
52
  display: none !important;
49
53
  }
50
54
 
55
+ button,
56
+ input,
57
+ select,
58
+ textarea {
59
+ font-family: inherit;
60
+ }
61
+
51
62
  body {
52
63
  font-family: var(--mono);
53
64
  font-size: 13px;
@@ -1906,6 +1917,25 @@ body.light .rb-window {
1906
1917
  font-weight: 600;
1907
1918
  }
1908
1919
 
1920
+ .help-docs {
1921
+ margin: 0 12px 0 auto;
1922
+ padding: 4px 10px;
1923
+ border: 1px solid var(--border);
1924
+ border-radius: 6px;
1925
+ color: var(--text-secondary);
1926
+ font-size: 12px;
1927
+ text-decoration: none;
1928
+ white-space: nowrap;
1929
+ transition:
1930
+ color 0.15s ease,
1931
+ border-color 0.15s ease;
1932
+ }
1933
+
1934
+ .help-docs:hover {
1935
+ color: var(--accent);
1936
+ border-color: var(--accent);
1937
+ }
1938
+
1909
1939
  /* One shared grid for both halves (key | label | spacer | key | label): each key
1910
1940
  gutter is sized by its column's widest combo, and left/right rows share row
1911
1941
  tracks, so paired groups line up — a shorter group just leaves empty rows.
@@ -2195,7 +2225,6 @@ body.light {
2195
2225
  --accent-text: #a0501c;
2196
2226
  --accent-dim: rgba(184, 90, 32, 0.18);
2197
2227
  --accent-glow: rgba(232, 111, 51, 0.5);
2198
- --chart-fill: rgba(232, 111, 51, 0.32);
2199
2228
  --success: #1a8a5a;
2200
2229
  --success-dim: rgba(26, 138, 90, 0.15);
2201
2230
  --warning: #b07d0a;
package/public/themes.css CHANGED
@@ -53,7 +53,6 @@ body:not([data-color-theme]):not(.light) {
53
53
  --text-secondary: #c2c4c9;
54
54
  --text-tertiary: #9a9da5;
55
55
  --text-muted: #7d808a;
56
- --chart-fill: rgba(232, 111, 51, 0.32);
57
56
  }
58
57
  body.light:not([data-color-theme]) {
59
58
  --accent: #e86f33;
@@ -69,7 +68,6 @@ body.light:not([data-color-theme]) {
69
68
  --text-secondary: #2c2c2c;
70
69
  --text-tertiary: #565656;
71
70
  --text-muted: #767676;
72
- --chart-fill: rgba(232, 111, 51, 0.32);
73
71
  }
74
72
 
75
73
  /* Gruvbox */
@@ -87,7 +85,6 @@ body[data-color-theme="gruvbox"]:not(.light) {
87
85
  --text-secondary: #d5c4a1;
88
86
  --text-tertiary: #bdae93;
89
87
  --text-muted: #928374;
90
- --chart-fill: rgba(254, 128, 25, 0.32);
91
88
  }
92
89
  body.light[data-color-theme="gruvbox"] {
93
90
  --accent: #d65d0e;
@@ -103,7 +100,6 @@ body.light[data-color-theme="gruvbox"] {
103
100
  --text-secondary: #504945;
104
101
  --text-tertiary: #665c54;
105
102
  --text-muted: #7c6f64;
106
- --chart-fill: rgba(214, 93, 14, 0.32);
107
103
  }
108
104
 
109
105
  /* Catppuccin */
@@ -121,7 +117,6 @@ body[data-color-theme="catppuccin"]:not(.light) {
121
117
  --text-secondary: #bac2de;
122
118
  --text-tertiary: #a6adc8;
123
119
  --text-muted: #7f849c;
124
- --chart-fill: rgba(203, 166, 247, 0.32);
125
120
  }
126
121
  body.light[data-color-theme="catppuccin"] {
127
122
  --accent: #8839ef;
@@ -137,7 +132,6 @@ body.light[data-color-theme="catppuccin"] {
137
132
  --text-secondary: #5c5f77;
138
133
  --text-tertiary: #6c6f85;
139
134
  --text-muted: #8c8fa1;
140
- --chart-fill: rgba(136, 57, 239, 0.32);
141
135
  }
142
136
 
143
137
  /* Tokyo Night */
@@ -155,7 +149,6 @@ body[data-color-theme="tokyo-night"]:not(.light) {
155
149
  --text-secondary: #a9b1d6;
156
150
  --text-tertiary: #787c99;
157
151
  --text-muted: #565f89;
158
- --chart-fill: rgba(122, 162, 247, 0.32);
159
152
  }
160
153
  body.light[data-color-theme="tokyo-night"] {
161
154
  --accent: #2e7de9;
@@ -171,7 +164,6 @@ body.light[data-color-theme="tokyo-night"] {
171
164
  --text-secondary: #565a6e;
172
165
  --text-tertiary: #6c6e75;
173
166
  --text-muted: #848cb5;
174
- --chart-fill: rgba(46, 125, 233, 0.32);
175
167
  }
176
168
 
177
169
  /* Solarized */
@@ -189,7 +181,6 @@ body[data-color-theme="solarized"]:not(.light) {
189
181
  --text-secondary: #b7c0bf;
190
182
  --text-tertiary: #93a1a1;
191
183
  --text-muted: #839496;
192
- --chart-fill: rgba(201, 111, 71, 0.32);
193
184
  }
194
185
  body.light[data-color-theme="solarized"] {
195
186
  --accent: #2280c2;
@@ -207,7 +198,6 @@ body.light[data-color-theme="solarized"] {
207
198
  --text-muted: #728589;
208
199
  --sidebar-bg: #e6dfc7;
209
200
  --sidebar-item-bg: #f3ecd6;
210
- --chart-fill: rgba(34, 128, 194, 0.32);
211
201
  }
212
202
 
213
203
  /* Dracula */
@@ -225,7 +215,6 @@ body[data-color-theme="dracula"]:not(.light) {
225
215
  --text-secondary: #d8d8d2;
226
216
  --text-tertiary: #b0b3c5;
227
217
  --text-muted: #6272a4;
228
- --chart-fill: rgba(189, 147, 249, 0.32);
229
218
  }
230
219
  body.light[data-color-theme="dracula"] {
231
220
  --accent: #7c3aed;
@@ -241,7 +230,6 @@ body.light[data-color-theme="dracula"] {
241
230
  --text-secondary: #34343f;
242
231
  --text-tertiary: #5a5a68;
243
232
  --text-muted: #787885;
244
- --chart-fill: rgba(124, 58, 237, 0.32);
245
233
  }
246
234
 
247
235
  /* Nord */
@@ -259,7 +247,6 @@ body[data-color-theme="nord"]:not(.light) {
259
247
  --text-secondary: #d8dee9;
260
248
  --text-tertiary: #aeb6c5;
261
249
  --text-muted: #7b88a1;
262
- --chart-fill: rgba(136, 192, 208, 0.32);
263
250
  }
264
251
  body.light[data-color-theme="nord"] {
265
252
  --accent: #5e81ac;
@@ -275,7 +262,6 @@ body.light[data-color-theme="nord"] {
275
262
  --text-secondary: #3b4252;
276
263
  --text-tertiary: #4c566a;
277
264
  --text-muted: #6b7589;
278
- --chart-fill: rgba(94, 129, 172, 0.32);
279
265
  }
280
266
 
281
267
  /* Rosé Pine */
@@ -293,7 +279,6 @@ body[data-color-theme="rose-pine"]:not(.light) {
293
279
  --text-secondary: #c5c2dd;
294
280
  --text-tertiary: #908caa;
295
281
  --text-muted: #6e6a86;
296
- --chart-fill: rgba(196, 167, 231, 0.32);
297
282
  }
298
283
  body.light[data-color-theme="rose-pine"] {
299
284
  --accent: #907aa9;
@@ -309,7 +294,6 @@ body.light[data-color-theme="rose-pine"] {
309
294
  --text-secondary: #635e87;
310
295
  --text-tertiary: #6e6a88;
311
296
  --text-muted: #857f96;
312
- --chart-fill: rgba(144, 122, 169, 0.32);
313
297
  }
314
298
 
315
299
  /* Everforest */
@@ -327,7 +311,6 @@ body[data-color-theme="everforest"]:not(.light) {
327
311
  --text-secondary: #bfb6a3;
328
312
  --text-tertiary: #9da9a0;
329
313
  --text-muted: #859289;
330
- --chart-fill: rgba(167, 192, 128, 0.32);
331
314
  }
332
315
  body.light[data-color-theme="everforest"] {
333
316
  --accent: #6f8352;
@@ -343,7 +326,6 @@ body.light[data-color-theme="everforest"] {
343
326
  --text-secondary: #55636b;
344
327
  --text-tertiary: #66705f;
345
328
  --text-muted: #7a8577;
346
- --chart-fill: rgba(111, 131, 82, 0.32);
347
329
  }
348
330
 
349
331
  /* Kanagawa */
@@ -361,7 +343,6 @@ body[data-color-theme="kanagawa"]:not(.light) {
361
343
  --text-secondary: #c8c093;
362
344
  --text-tertiary: #a6a69c;
363
345
  --text-muted: #727169;
364
- --chart-fill: rgba(126, 156, 216, 0.32);
365
346
  }
366
347
  body.light[data-color-theme="kanagawa"] {
367
348
  --accent: #4d699b;
@@ -377,7 +358,6 @@ body.light[data-color-theme="kanagawa"] {
377
358
  --text-secondary: #66667a;
378
359
  --text-tertiary: #716e61;
379
360
  --text-muted: #8a8775;
380
- --chart-fill: rgba(77, 105, 155, 0.32);
381
361
  }
382
362
 
383
363
  /* One Dark */
@@ -395,7 +375,6 @@ body[data-color-theme="one-dark"]:not(.light) {
395
375
  --text-secondary: #abb2bf;
396
376
  --text-tertiary: #8b919e;
397
377
  --text-muted: #5c6370;
398
- --chart-fill: rgba(97, 175, 239, 0.32);
399
378
  }
400
379
  body.light[data-color-theme="one-dark"] {
401
380
  --accent: #4078f2;
@@ -411,7 +390,6 @@ body.light[data-color-theme="one-dark"] {
411
390
  --text-secondary: #50525a;
412
391
  --text-tertiary: #696c77;
413
392
  --text-muted: #a0a1a7;
414
- --chart-fill: rgba(64, 120, 242, 0.32);
415
393
  }
416
394
 
417
395
  /* Night Owl */
@@ -429,7 +407,6 @@ body[data-color-theme="night-owl"]:not(.light) {
429
407
  --text-secondary: #b8c5d6;
430
408
  --text-tertiary: #8ba3b8;
431
409
  --text-muted: #637777;
432
- --chart-fill: rgba(130, 170, 255, 0.32);
433
410
  }
434
411
  body.light[data-color-theme="night-owl"] {
435
412
  --accent: #0c969b;
@@ -445,7 +422,6 @@ body.light[data-color-theme="night-owl"] {
445
422
  --text-secondary: #545167;
446
423
  --text-tertiary: #6f6e85;
447
424
  --text-muted: #989fb1;
448
- --chart-fill: rgba(12, 150, 155, 0.32);
449
425
  }
450
426
 
451
427
  /* Monokai Pro */
@@ -463,7 +439,6 @@ body[data-color-theme="monokai"]:not(.light) {
463
439
  --text-secondary: #d9d8d6;
464
440
  --text-tertiary: #939293;
465
441
  --text-muted: #727072;
466
- --chart-fill: rgba(255, 216, 102, 0.32);
467
442
  }
468
443
  body.light[data-color-theme="monokai"] {
469
444
  --accent: #c08a00;
@@ -479,7 +454,6 @@ body.light[data-color-theme="monokai"] {
479
454
  --text-secondary: #46434a;
480
455
  --text-tertiary: #6b686d;
481
456
  --text-muted: #8d8a8d;
482
- --chart-fill: rgba(192, 138, 0, 0.32);
483
457
  }
484
458
 
485
459
  /* GitHub */
@@ -497,7 +471,6 @@ body[data-color-theme="github"]:not(.light) {
497
471
  --text-secondary: #d1d5da;
498
472
  --text-tertiary: #959da5;
499
473
  --text-muted: #6a737d;
500
- --chart-fill: rgba(88, 166, 255, 0.32);
501
474
  }
502
475
  body.light[data-color-theme="github"] {
503
476
  --accent: #0366d6;
@@ -513,7 +486,6 @@ body.light[data-color-theme="github"] {
513
486
  --text-secondary: #444d56;
514
487
  --text-tertiary: #586069;
515
488
  --text-muted: #6a737d;
516
- --chart-fill: rgba(3, 102, 214, 0.32);
517
489
  }
518
490
 
519
491
  /* Ayu */
@@ -531,7 +503,6 @@ body[data-color-theme="ayu"]:not(.light) {
531
503
  --text-secondary: #a8a6a0;
532
504
  --text-tertiary: #8a9199;
533
505
  --text-muted: #6c7380;
534
- --chart-fill: rgba(230, 180, 80, 0.32);
535
506
  }
536
507
  body.light[data-color-theme="ayu"] {
537
508
  --accent: #c97612;
@@ -547,7 +518,6 @@ body.light[data-color-theme="ayu"] {
547
518
  --text-secondary: #5c6166;
548
519
  --text-tertiary: #787b80;
549
520
  --text-muted: #8a9199;
550
- --chart-fill: rgba(201, 118, 18, 0.32);
551
521
  }
552
522
 
553
523
  /* Vitesse */
@@ -565,7 +535,6 @@ body[data-color-theme="vitesse"]:not(.light) {
565
535
  --text-secondary: #bfbaaa;
566
536
  --text-tertiary: #8f8f85;
567
537
  --text-muted: #758575;
568
- --chart-fill: rgba(77, 147, 117, 0.32);
569
538
  }
570
539
  body.light[data-color-theme="vitesse"] {
571
540
  --accent: #1c6b48;
@@ -581,7 +550,6 @@ body.light[data-color-theme="vitesse"] {
581
550
  --text-secondary: #4e4f47;
582
551
  --text-tertiary: #6b6d63;
583
552
  --text-muted: #a0ada0;
584
- --chart-fill: rgba(28, 107, 72, 0.32);
585
553
  }
586
554
 
587
555
  /* Synthwave '84 */
@@ -599,7 +567,6 @@ body[data-color-theme="synthwave"]:not(.light) {
599
567
  --text-secondary: #d8d6e8;
600
568
  --text-tertiary: #b6b1d8;
601
569
  --text-muted: #848bbd;
602
- --chart-fill: rgba(255, 126, 219, 0.32);
603
570
  }
604
571
  body.light[data-color-theme="synthwave"] {
605
572
  --accent: #c936a6;
@@ -615,5 +582,4 @@ body.light[data-color-theme="synthwave"] {
615
582
  --text-secondary: #3d3455;
616
583
  --text-tertiary: #5c5380;
617
584
  --text-muted: #7d76a3;
618
- --chart-fill: rgba(201, 54, 166, 0.32);
619
585
  }
@@ -0,0 +1,50 @@
1
+ // claude-hub-sdk 1.1.0 (sha256 0fed14faa670). Copied by npm run sdk:sync in claude-code-hub. Do not edit.
2
+ // Claude Code Hub SDK stub: what an app serves when no hub runs it. Under a hub, the hub hands the
3
+ // app its real SDK (client.js) in place of this file. The API must match client.js; a test checks it.
4
+ ((root) => {
5
+ 'use strict';
6
+
7
+ function createClaudeHub(win) {
8
+ let hub = null;
9
+ const off = () => {};
10
+
11
+ function connect({ standalone = {} } = {}) {
12
+ if (hub) return hub;
13
+ const standaloneFn = (action) => {
14
+ const fn = (typeof standalone === 'function' ? standalone() : standalone)[action];
15
+ return typeof fn === 'function' ? fn : null;
16
+ };
17
+ hub = {
18
+ status: 'standalone',
19
+ themes: [],
20
+ inHub: false,
21
+ onStatus: () => off,
22
+ onActive: () => off,
23
+ onThemes: () => off,
24
+ subscribe: () => off,
25
+ bindTheme: () => off,
26
+ handle() {},
27
+ publish() {},
28
+ invoke(action, params = {}) {
29
+ const target = standaloneFn(action)?.(params);
30
+ if (!target) return Promise.resolve({ ok: false, reason: 'unhandled' });
31
+ win.open(target, '_blank', 'noopener');
32
+ return Promise.resolve({ ok: true, handledBy: 'standalone' });
33
+ },
34
+ can: (action) => !!standaloneFn(action),
35
+ forwards: () => false,
36
+ closeGuard() {},
37
+ openExternal(url) {
38
+ win.open(url, '_blank', 'noopener');
39
+ },
40
+ terminalToken: () => Promise.resolve(null),
41
+ };
42
+ return hub;
43
+ }
44
+
45
+ return { connect };
46
+ }
47
+
48
+ if (typeof module === 'object' && module.exports) module.exports = { createClaudeHub };
49
+ else root.ClaudeHub = createClaudeHub(root);
50
+ })(typeof window !== 'undefined' ? window : globalThis);
package/server.js CHANGED
@@ -1401,11 +1401,10 @@ app.use(net.frameGuard);
1401
1401
  app.use(net.originGuard);
1402
1402
 
1403
1403
  app.use(express.json());
1404
- app.use(express.static(path.join(__dirname, 'public')));
1404
+ // Under a hub, the hub hands over its SDK. Alone, public/vendor/claude-hub-sdk.js is a stub.
1405
+ if (process.env.HUB_SDK_SERVER) require(process.env.HUB_SDK_SERVER).mount(app);
1405
1406
 
1406
- app.get('/hub-config', (_req, res) => {
1407
- res.json({ enabled: !!process.env.CLAUDE_HUB, url: process.env.HUB_URL || null });
1408
- });
1407
+ app.use(express.static(path.join(__dirname, 'public')));
1409
1408
 
1410
1409
  function parseRange(raw, fallback = null) {
1411
1410
  if (raw === 'today') return 'today';