llmtop 0.1.5 → 0.1.6

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 (141) hide show
  1. package/README.md +70 -67
  2. package/dashboard/dist/assets/be-vietnam-pro-latin-400-normal-PpnXBOrz.woff2 +0 -0
  3. package/dashboard/dist/assets/be-vietnam-pro-latin-500-normal-B6LVzGNe.woff2 +0 -0
  4. package/dashboard/dist/assets/be-vietnam-pro-latin-600-normal-BZDkUTrt.woff2 +0 -0
  5. package/dashboard/dist/assets/be-vietnam-pro-latin-700-normal-DlW1Zbsh.woff2 +0 -0
  6. package/dashboard/dist/assets/be-vietnam-pro-latin-800-normal-BpHZASpI.woff2 +0 -0
  7. package/dashboard/dist/assets/be-vietnam-pro-latin-ext-400-normal-CiZNW1ec.woff2 +0 -0
  8. package/dashboard/dist/assets/be-vietnam-pro-latin-ext-500-normal-h0Fp6aX0.woff2 +0 -0
  9. package/dashboard/dist/assets/be-vietnam-pro-latin-ext-600-normal-BNd8euf0.woff2 +0 -0
  10. package/dashboard/dist/assets/be-vietnam-pro-latin-ext-700-normal-C8_gqRu2.woff2 +0 -0
  11. package/dashboard/dist/assets/be-vietnam-pro-latin-ext-800-normal-GEpNgheG.woff2 +0 -0
  12. package/dashboard/dist/assets/be-vietnam-pro-vietnamese-400-normal-CRcqvyg1.woff2 +0 -0
  13. package/dashboard/dist/assets/be-vietnam-pro-vietnamese-500-normal-DREgrEoJ.woff2 +0 -0
  14. package/dashboard/dist/assets/be-vietnam-pro-vietnamese-600-normal-nyU-ZL2p.woff2 +0 -0
  15. package/dashboard/dist/assets/be-vietnam-pro-vietnamese-700-normal-Csr0PCuG.woff2 +0 -0
  16. package/dashboard/dist/assets/be-vietnam-pro-vietnamese-800-normal-D4LFh2W4.woff2 +0 -0
  17. package/dashboard/dist/assets/index-C6JlgSDz.js +9 -0
  18. package/dashboard/dist/assets/index-CeDllzpB.css +1 -0
  19. package/dashboard/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  20. package/dashboard/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  21. package/dashboard/dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  22. package/dashboard/dist/index.html +2 -2
  23. package/dashboard/src/App.tsx +224 -88
  24. package/dashboard/src/controls/DateRange.tsx +3 -3
  25. package/dashboard/src/controls/Search.tsx +2 -2
  26. package/dashboard/src/controls/popover.tsx +24 -4
  27. package/dashboard/src/format.ts +1 -1
  28. package/dashboard/src/i18n.tsx +32 -4
  29. package/dashboard/src/main.tsx +11 -2
  30. package/dashboard/src/model.ts +1 -1
  31. package/dashboard/src/overview-flow.css +24 -0
  32. package/dashboard/src/overviewFlow.tsx +76 -0
  33. package/dashboard/src/sessionDetail.test.ts +19 -0
  34. package/dashboard/src/sessionScope.tsx +28 -0
  35. package/dashboard/src/shell/ConsoleFilters.tsx +203 -0
  36. package/dashboard/src/shell/Header.tsx +29 -0
  37. package/dashboard/src/shell/MobileSheet.tsx +29 -0
  38. package/dashboard/src/shell/Palette.tsx +114 -0
  39. package/dashboard/src/shell/Settings.tsx +37 -0
  40. package/dashboard/src/shell/SpecialStates.tsx +145 -0
  41. package/dashboard/src/shell/preferences.ts +71 -0
  42. package/dashboard/src/shell/styleColors.ts +5 -0
  43. package/dashboard/src/shell/useShortcuts.ts +67 -0
  44. package/dashboard/src/state.test.ts +9 -0
  45. package/dashboard/src/state.ts +13 -2
  46. package/dashboard/src/styles/commands.css +61 -0
  47. package/dashboard/src/styles/console.css +149 -0
  48. package/dashboard/src/styles/donut.css +83 -0
  49. package/dashboard/src/styles/fonts/be-vietnam-pro-LICENSE +93 -0
  50. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-400-normal.woff2 +0 -0
  51. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-500-normal.woff2 +0 -0
  52. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-600-normal.woff2 +0 -0
  53. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-700-normal.woff2 +0 -0
  54. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-800-normal.woff2 +0 -0
  55. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-ext-400-normal.woff2 +0 -0
  56. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-ext-500-normal.woff2 +0 -0
  57. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-ext-600-normal.woff2 +0 -0
  58. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-ext-700-normal.woff2 +0 -0
  59. package/dashboard/src/styles/fonts/be-vietnam-pro-latin-ext-800-normal.woff2 +0 -0
  60. package/dashboard/src/styles/fonts/be-vietnam-pro-vietnamese-400-normal.woff2 +0 -0
  61. package/dashboard/src/styles/fonts/be-vietnam-pro-vietnamese-500-normal.woff2 +0 -0
  62. package/dashboard/src/styles/fonts/be-vietnam-pro-vietnamese-600-normal.woff2 +0 -0
  63. package/dashboard/src/styles/fonts/be-vietnam-pro-vietnamese-700-normal.woff2 +0 -0
  64. package/dashboard/src/styles/fonts/be-vietnam-pro-vietnamese-800-normal.woff2 +0 -0
  65. package/dashboard/src/styles/fonts/jetbrains-mono-LICENSE +93 -0
  66. package/dashboard/src/styles/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  67. package/dashboard/src/styles/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  68. package/dashboard/src/styles/fonts/jetbrains-mono-vietnamese-wght-normal.woff2 +0 -0
  69. package/dashboard/src/styles/fonts.css +240 -0
  70. package/dashboard/src/styles/shell.css +151 -0
  71. package/dashboard/src/styles/states.css +32 -0
  72. package/dashboard/src/styles/tokens.css +159 -0
  73. package/dashboard/src/styles.css +13 -44
  74. package/dashboard/src/tip.ts +3 -1
  75. package/dashboard/src/treemap.ts +3 -0
  76. package/dashboard/src/ui.tsx +21 -32
  77. package/dashboard/src/views/Breakdown.tsx +46 -0
  78. package/dashboard/src/views/SessionDetail.tsx +67 -0
  79. package/dashboard/src/views/breakdown.css +33 -0
  80. package/dashboard/src/views/{Activity.tsx → classic/Activity.tsx} +31 -50
  81. package/dashboard/src/views/classic/Context.tsx +140 -0
  82. package/dashboard/src/views/{Models.tsx → classic/Models.tsx} +18 -35
  83. package/dashboard/src/views/classic/Overview.tsx +80 -0
  84. package/dashboard/src/views/classic/Projects.tsx +98 -0
  85. package/dashboard/src/views/{Sessions.tsx → classic/Sessions.tsx} +14 -17
  86. package/dashboard/src/views/{Subagents.tsx → classic/Subagents.tsx} +10 -34
  87. package/dashboard/src/views/console/Activity.tsx +241 -0
  88. package/dashboard/src/views/console/ConsoleBoot.tsx +73 -0
  89. package/dashboard/src/views/console/Context.tsx +162 -0
  90. package/dashboard/src/views/console/Models.tsx +187 -0
  91. package/dashboard/src/views/console/Overview.tsx +91 -0
  92. package/dashboard/src/views/console/Projects.tsx +6 -0
  93. package/dashboard/src/views/console/ProviderMeters.tsx +35 -0
  94. package/dashboard/src/views/console/Sessions.tsx +6 -0
  95. package/dashboard/src/views/console/Subagents.tsx +137 -0
  96. package/dashboard/src/views/console/activity-context.css +92 -0
  97. package/dashboard/src/views/console/console-boot.css +137 -0
  98. package/dashboard/src/views/console/modelVisuals.tsx +29 -0
  99. package/dashboard/src/views/console/models-subagents.css +203 -0
  100. package/dashboard/src/views/donut/Activity.tsx +247 -0
  101. package/dashboard/src/views/donut/Context.tsx +169 -0
  102. package/dashboard/src/views/donut/DonutBoot.tsx +68 -0
  103. package/dashboard/src/views/donut/Models.tsx +58 -0
  104. package/dashboard/src/views/donut/Overview.tsx +49 -0
  105. package/dashboard/src/views/donut/Projects.tsx +6 -0
  106. package/dashboard/src/views/donut/Ring.tsx +30 -0
  107. package/dashboard/src/views/donut/Sessions.tsx +6 -0
  108. package/dashboard/src/views/donut/Subagents.tsx +131 -0
  109. package/dashboard/src/views/donut/activity-context.css +154 -0
  110. package/dashboard/src/views/donut/donut-boot.css +165 -0
  111. package/dashboard/src/views/donut/models-subagents.css +157 -0
  112. package/dashboard/src/views/records/Projects.tsx +140 -0
  113. package/dashboard/src/views/records/Sessions.tsx +125 -0
  114. package/dashboard/src/views/records/records.css +119 -0
  115. package/dashboard/src/views/session-detail.css +44 -0
  116. package/dashboard/src/vm/activity.ts +72 -0
  117. package/dashboard/src/vm/colors.ts +57 -0
  118. package/dashboard/src/vm/context.ts +81 -0
  119. package/dashboard/src/vm/filterChoices.ts +27 -0
  120. package/dashboard/src/vm/models.ts +50 -0
  121. package/dashboard/src/vm/overview.ts +46 -0
  122. package/dashboard/src/vm/palette.ts +63 -0
  123. package/dashboard/src/vm/projects.ts +63 -0
  124. package/dashboard/src/vm/providerBreakdown.ts +19 -0
  125. package/dashboard/src/vm/sessionDetail.ts +16 -0
  126. package/dashboard/src/vm/sessions.ts +36 -0
  127. package/dashboard/src/vm/specialStates.ts +64 -0
  128. package/dashboard/src/vm/subagents.ts +36 -0
  129. package/dashboard/src/vm.test.ts +183 -0
  130. package/package.json +1 -1
  131. package/src/dashboard.mjs +4 -1
  132. package/dashboard/dist/assets/index-Ba0kF2tG.js +0 -9
  133. package/dashboard/dist/assets/index-NQzaBVIY.css +0 -1
  134. package/dashboard/dist/assets/montserrat-cyrillic-ext-wght-normal-CO5hGrJv.woff2 +0 -0
  135. package/dashboard/dist/assets/montserrat-cyrillic-wght-normal-EAA9jha_.woff2 +0 -0
  136. package/dashboard/dist/assets/roboto-mono-cyrillic-ext-wght-normal-BUDPrIko.woff2 +0 -0
  137. package/dashboard/dist/assets/roboto-mono-cyrillic-wght-normal-HUlVHixE.woff2 +0 -0
  138. package/dashboard/dist/assets/roboto-mono-greek-wght-normal-BJJTbwTT.woff2 +0 -0
  139. package/dashboard/src/views/Context.tsx +0 -183
  140. package/dashboard/src/views/Overview.tsx +0 -83
  141. package/dashboard/src/views/Projects.tsx +0 -116
@@ -0,0 +1,159 @@
1
+ /* llmtop design tokens — Console & Donut styles, light & dark themes.
2
+ Apply on <html data-style="console|donut|classic" data-theme="light|dark">.
3
+ Rule: components read only these variables; no hex values in component CSS.
4
+
5
+ Three layers:
6
+ 1. type + shape (per style)
7
+ 2. surfaces + ink (per style × theme)
8
+ 3. data colours (per theme only — the same meaning in Console and Donut)
9
+
10
+ Data colour meanings (keep them on every tab):
11
+ --prov-* a provider; --model-<prov>-1..5 the models of that provider (1 = most used)
12
+ --proj-1..6 projects by rank (output tokens, model.ts projectRank); --proj-other the rest
13
+ --work-* agent work and time (heatmap, working time, context window)
14
+ --cost money; --req / --req-weak request counts
15
+ --effort-1..5 effort low → max
16
+ --good / --bad better / worse (deltas, failed calls, avoidable cost)
17
+ */
18
+
19
+ /* Classic renderers retain their original token values. */
20
+ :root {
21
+ --brand-ink: #1A1A1A; --brand-paper: #F2F2F2; --brand-white: #FFFFFF;
22
+ --classic-text-dark: #0b0b0b; --classic-mask-solid: #000; --classic-mask-fade: rgba(0, 0, 0, .15);
23
+ --page: var(--brand-paper); --surface: var(--brand-white); --raised: var(--brand-white); --ink: var(--brand-ink); --ink2: #3F3F3F; --muted: #7F7F7F;
24
+ --hair: #E0E0E0; --base: #C8C8C8; --wash: rgba(26,26,26,.05); --accent: #2a78d6; --accent-ink: #1c5cab;
25
+ --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;
26
+ --v0: #c9c4fb; --v1: #9d93f5; --v2: #6f5ce6; --v3: #4630c0; --v4: #26177a;
27
+ --k0: #D8D8D8; --k1: #888888; --k2: #3F3F3F; --kw: repeating-linear-gradient(135deg, #D8D8D8 0 4px, #BEBEBE 4px 8px);
28
+ --ck0: #3b6fd9; --ck1: #7c5bd1; --ck2: #a8864f;
29
+ --good: #0ca30c; --up: #1c5cab; --neg: #d03b3b; --shadow: 0 8px 28px rgba(0,0,0,.10);
30
+ --sb: rgba(11,11,11,.18); --sb-hover: rgba(11,11,11,.34);
31
+ }
32
+ :root[data-theme="dark"] {
33
+ --page: #111111; --surface: var(--brand-ink); --raised: #242424; --ink: var(--brand-white); --ink2: #D8D8D8; --muted: #888888;
34
+ --hair: #2C2C2C; --base: #3F3F3F; --wash: rgba(255,255,255,.07); --accent: #3987e5; --accent-ink: #86b6ef;
35
+ --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;
36
+ --v0: #30286a; --v1: #4e42ae; --v2: #7c6ff0; --v3: #b2abff; --v4: #e4e1ff;
37
+ --k0: #3F3F3F; --k1: #888888; --k2: #D8D8D8; --kw: repeating-linear-gradient(135deg, #3F3F3F 0 4px, #555555 4px 8px);
38
+ --ck0: #5b8def; --ck1: #a07eea; --ck2: #c8a878;
39
+ --good: #0ca30c; --up: #86b6ef; --neg: #e66767; --shadow: 0 8px 28px rgba(0,0,0,.5);
40
+ --sb: rgba(255,255,255,.16); --sb-hover: rgba(255,255,255,.32);
41
+ }
42
+ /* ---------- 1. type + shape ---------- */
43
+ :root {
44
+ --font-sans: "Be Vietnam Pro", system-ui, sans-serif; /* full Vietnamese coverage */
45
+ --font-mono: "JetBrains Mono", ui-monospace, monospace; /* all numbers, Console labels */
46
+ --font-logo: "Roboto Mono", monospace; /* wordmark only (brand) */
47
+
48
+ --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px;
49
+ --fs-kpi: 30px; --fs-kpi-lead: 56px; --fs-ring: 40px;
50
+ --lh-tight: 1.15; --lh-body: 1.45; /* ≥1.4 for Vietnamese: stacked diacritics */
51
+ --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-heavy: 800;
52
+
53
+ --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
54
+ --tap-min: 44px; /* every touch target on mobile */
55
+ --content-max: 1376px;
56
+ --bp-mobile: 640px; /* below: mobile layout (tabs swipe, filter sheet) */
57
+ --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
58
+ }
59
+
60
+ [data-style="console"] {
61
+ --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px; --radius-pill: 4px;
62
+ --font-heading: var(--font-mono);
63
+ --bar-fill: pipe; /* bars drawn as repeating 3px/2px stripes */
64
+ --bar-height: 12px; --bar-radius: 0;
65
+ --heat-radius: 0;
66
+ }
67
+ [data-style="donut"] {
68
+ --radius-sm: 8px; --radius-md: 14px; --radius-lg: 20px; --radius-pill: 999px;
69
+ --font-heading: var(--font-sans);
70
+ --bar-fill: solid;
71
+ --bar-height: 14px; --bar-radius: 7px;
72
+ --heat-radius: 4px;
73
+ }
74
+
75
+ /* ---------- 2. surfaces + ink (style × theme) ---------- */
76
+ [data-style="console"][data-theme="dark"] {
77
+ --bg: #0E0E0E; --panel: #121212; --sunken: #141414; --popover: #181818;
78
+ --line: #262626; --line-strong: #333333; --line-dashed: #555555; --grid: #232323; --axis: #444444;
79
+ --ink: #F2F2F2; --ink-2: #C4C4C4; --muted: #8F8F8F; --track: #1F1F1F;
80
+ --inverse-bg: #F2F2F2; --inverse-ink: #0E0E0E; --row-active: #2A2A2A;
81
+ --backdrop: rgba(0, 0, 0, .72); --shadow: 0 12px 32px rgba(0, 0, 0, .6);
82
+ --focus: #6BD48A; --prompt: #6BD48A;
83
+ }
84
+ [data-style="console"][data-theme="light"] {
85
+ --bg: #F6F6F4; --panel: #FFFFFF; --sunken: #EFEFEC; --popover: #FFFFFF;
86
+ --line: #DADAD6; --line-strong: #CCCCC8; --line-dashed: #9A9A96; --grid: #E4E4E1; --axis: #B5B5B1;
87
+ --ink: #141414; --ink-2: #3D3D3D; --muted: #666662; --track: #EAEAE7;
88
+ --inverse-bg: #141414; --inverse-ink: #F6F6F4; --row-active: #ECECE8;
89
+ --backdrop: rgba(20, 20, 20, .35); --shadow: 0 12px 32px rgba(20, 20, 20, .18);
90
+ --focus: #08642F; --prompt: #0B7A3B;
91
+ }
92
+ [data-style="donut"][data-theme="light"] {
93
+ --bg: #F2F2F2; --panel: #FFFFFF; --sunken: #FAFAFA; --popover: #FFFFFF;
94
+ --line: #E0E0E0; --line-strong: #CFCFCF; --line-dashed: #9A9A9A; --grid: #EDEDED; --axis: #1A1A1A;
95
+ --ink: #1A1A1A; --ink-2: #3F3F3F; --muted: #666666; --track: #EDEDED;
96
+ --inverse-bg: #1A1A1A; --inverse-ink: #FFFFFF; --row-active: #F5F5F5;
97
+ --backdrop: rgba(26, 26, 26, .45); --shadow: 0 16px 40px rgba(0, 0, 0, .14);
98
+ --focus: #245BB6; --prompt: #1A1A1A;
99
+ }
100
+ [data-style="donut"][data-theme="dark"] {
101
+ --bg: #121317; --panel: #1B1C21; --sunken: #202127; --popover: #1B1C21;
102
+ --line: #2C2E35; --line-strong: #3A3C44; --line-dashed: #6E707A; --grid: #26272E; --axis: #F1F1F3;
103
+ --ink: #F1F1F3; --ink-2: #C9CAD0; --muted: #9A9CA6; --track: #26272E;
104
+ --inverse-bg: #F1F1F3; --inverse-ink: #1B1C21; --row-active: #24252C;
105
+ --backdrop: rgba(0, 0, 0, .6); --shadow: 0 16px 40px rgba(0, 0, 0, .5);
106
+ --focus: #5B9BF0; --prompt: #F1F1F3;
107
+ }
108
+
109
+ [data-style="console"], [data-style="donut"] {
110
+ --selected-bg: color-mix(in srgb, var(--ink) 14%, var(--panel));
111
+ --selected-line: color-mix(in srgb, var(--ink) 50%, var(--panel));
112
+ }
113
+
114
+ /* ---------- 3. data colours (per theme) ---------- */
115
+ [data-theme="light"] {
116
+ /* providers: one hue family each; model 1 = base, 2 = dark, 3 = light, 4 = mid-dark, 5 = pale */
117
+ --prov-claude: #D9622B; --model-claude-1: #D5602A; --model-claude-2: #8A3A0F; --model-claude-3: #9C7B66; --model-claude-4: #B04A18; --model-claude-5: #8D7F77;
118
+ --prov-codex: #2F6FD6; --model-codex-1: #2F6FD6; --model-codex-2: #163E80; --model-codex-3: #7083A2; --model-codex-4: #2556A8; --model-codex-5: #7D848F;
119
+ --prov-antigravity: #7A55E0; --model-antigravity-1: #7A55E0; --model-antigravity-2: #4A2BA8; --model-antigravity-3: #877DA4; --model-antigravity-4: #6340C4; --model-antigravity-5: #84808E;
120
+ --prov-4: #0E7FA8; --model-4-1: #0E7FA8; --model-4-2: #075673; --model-4-3: #658997; /* a 4th provider (e.g. local) */
121
+ --prov-5: #7D8B1A; --model-5-1: #7D8B1A; --model-5-2: #525C0E; --model-5-3: #81865A;
122
+ --prov-unknown: #838383;
123
+
124
+ --proj-1: #0E9384; --proj-2: #C2417F; --proj-3: #AB7A00; --proj-4: #4B962C; --proj-5: #5B6B8C; --proj-6: #9A6B3F; --proj-other: #838383;
125
+ --proj-ink-1: #1A1A1A; --proj-ink-2: #FFFFFF; --proj-ink-3: #1A1A1A; --proj-ink-4: #1A1A1A; --proj-ink-5: #FFFFFF; --proj-ink-6: #FFFFFF; --proj-ink-other: #1A1A1A;
126
+
127
+ --work: #0E9384; --work-weak: #5E8B85; --work-strong: #05514A;
128
+ --heat-0: #EEF2F1; --heat-1: #6E8683; --heat-2: #478E84; --heat-3: #0E9384; --heat-4: #05514A;
129
+ --cost: #AB7A00; --cost-ink: #1A1A1A;
130
+ --req: #5B6B8C; --req-weak: #7D838F;
131
+ --effort-1: #647B22; --effort-2: #097D6D; --effort-3: #8B6907; --effort-4: #B33643; --effort-5: #8C246E;
132
+ --good: #0B7A3B; --bad: #B3261E;
133
+ }
134
+ [data-theme="dark"] {
135
+ --prov-claude: #F08A4B; --model-claude-1: #F08A4B; --model-claude-2: #AF5F2E; --model-claude-3: #FFD3B5; --model-claude-4: #C96A30; --model-claude-5: #FFE9DA;
136
+ --prov-codex: #5B9BF0; --model-codex-1: #5B9BF0; --model-codex-2: #4A74B5; --model-codex-3: #C4DCFC; --model-codex-4: #3F7BD0; --model-codex-5: #E2EDFD;
137
+ --prov-antigravity: #A98BF5; --model-antigravity-1: #A98BF5; --model-antigravity-2: #7C61CF; --model-antigravity-3: #E4DAFE; --model-antigravity-4: #8C6CE6; --model-antigravity-5: #F2EDFF;
138
+ --prov-4: #3FB6DE; --model-4-1: #3FB6DE; --model-4-2: #1C7FA3; --model-4-3: #B5E6F6;
139
+ --prov-5: #B4C440; --model-5-1: #B4C440; --model-5-2: #7A8622; --model-5-3: #E3EBA8;
140
+ --prov-unknown: #747474;
141
+
142
+ --proj-1: #2BB5A3; --proj-2: #E0679E; --proj-3: #F2B630; --proj-4: #7CC456; --proj-5: #8FA0C0; --proj-6: #C99561; --proj-other: #7C7C7C;
143
+ --proj-ink-1: #0E0E0E; --proj-ink-2: #0E0E0E; --proj-ink-3: #0E0E0E; --proj-ink-4: #0E0E0E; --proj-ink-5: #0E0E0E; --proj-ink-6: #0E0E0E; --proj-ink-other: #0E0E0E;
144
+
145
+ --work: #2BB5A3; --work-weak: #218075; --work-strong: #9BE6DA;
146
+ --heat-0: #1E2423; --heat-1: #507B76; --heat-2: #218075; --heat-3: #2BB5A3; --heat-4: #9BE6DA;
147
+ --cost: #F2B630; --cost-ink: #0E0E0E;
148
+ --req: #8FA0C0; --req-weak: #697488;
149
+ --effort-1: #ABC768; --effort-2: #4BC9A5; --effort-3: #E0BC55; --effort-4: #F57978; --effort-5: #F3A9D5;
150
+ --good: #6BD48A; --bad: #F07A6B;
151
+ }
152
+
153
+ /* ---------- helpers ---------- */
154
+ /* Console bars are striped; Donut bars are solid and rounded. Use one class and let the style decide. */
155
+ [data-style="console"] .bar-fill { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 5px); }
156
+ [data-style="donut"] .bar-fill { background: var(--c); border-radius: var(--bar-radius); }
157
+ [data-renderer="console"] .num, [data-renderer="donut"] .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
158
+ .swipe { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
159
+ .swipe::-webkit-scrollbar { display: none; }
@@ -1,27 +1,3 @@
1
- :root {
2
- --brand-ink: #1A1A1A; --brand-paper: #F2F2F2; --brand-white: #FFFFFF; --brand-black: #000000;
3
- --brand-tile-dark: #1A1A1A; --brand-tile-light: #F2F2F2;
4
- --brand-donut-1: #1A1A1A; --brand-donut-2: #3F3F3F; --brand-donut-3: #7F7F7F; --brand-donut-4: #D8D8D8;
5
- --page: var(--brand-paper); --surface: var(--brand-white); --raised: var(--brand-white); --ink: var(--brand-ink); --ink2: #3F3F3F; --muted: #7F7F7F;
6
- --hair: #E0E0E0; --base: #C8C8C8; --wash: rgba(26,26,26,.05); --accent: #2a78d6; --accent-ink: #1c5cab;
7
- --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;
8
- --v0: #c9c4fb; --v1: #9d93f5; --v2: #6f5ce6; --v3: #4630c0; --v4: #26177a;
9
- --k0: #D8D8D8; --k1: #888888; --k2: #3F3F3F; --kw: repeating-linear-gradient(135deg, #D8D8D8 0 4px, #BEBEBE 4px 8px);
10
- --ck0: #3b6fd9; --ck1: #7c5bd1; --ck2: #a8864f;
11
- --good: #0ca30c; --up: #1c5cab; --neg: #d03b3b; --shadow: 0 8px 28px rgba(0,0,0,.10);
12
- --sb: rgba(11,11,11,.18); --sb-hover: rgba(11,11,11,.34);
13
- }
14
- :root[data-theme="dark"] {
15
- --brand-donut-1: #FFFFFF; --brand-donut-2: #D8D8D8; --brand-donut-3: #888888; --brand-donut-4: #3F3F3F;
16
- --page: #111111; --surface: var(--brand-ink); --raised: #242424; --ink: var(--brand-white); --ink2: #D8D8D8; --muted: #888888;
17
- --hair: #2C2C2C; --base: #3F3F3F; --wash: rgba(255,255,255,.07); --accent: #3987e5; --accent-ink: #86b6ef;
18
- --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;
19
- --v0: #30286a; --v1: #4e42ae; --v2: #7c6ff0; --v3: #b2abff; --v4: #e4e1ff;
20
- --k0: #3F3F3F; --k1: #888888; --k2: #D8D8D8; --kw: repeating-linear-gradient(135deg, #3F3F3F 0 4px, #555555 4px 8px);
21
- --ck0: #5b8def; --ck1: #a07eea; --ck2: #c8a878;
22
- --good: #0ca30c; --up: #86b6ef; --neg: #e66767; --shadow: 0 8px 28px rgba(0,0,0,.5);
23
- --sb: rgba(255,255,255,.16); --sb-hover: rgba(255,255,255,.32);
24
- }
25
1
  * { box-sizing: border-box; }
26
2
  html { -webkit-text-size-adjust: 100%; color-scheme: light; }
27
3
  html[data-theme="dark"] { color-scheme: dark; }
@@ -41,13 +17,7 @@ code { font: 12.5px/1 "Roboto Mono Variable", "Roboto Mono", ui-monospace, "SF M
41
17
  .nav button[aria-current="page"] { background: var(--wash); color: var(--ink); font-weight: 600; }
42
18
  .nav svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
43
19
  .nav.quiet button { font-size: 13px; padding: 6px 10px; }
44
- .side .foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--hair); color: var(--ink2); font-size: 12.5px; }
45
- .foot .scan { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 10px; } .foot .si { min-width: 0; color: var(--ink2); font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .foot .si span { display: block; overflow: hidden; text-overflow: ellipsis; }
46
- .foot .scan .icon { background: none; } .foot .scan .icon:hover:not(:disabled) { background: var(--wash); }
47
- .foot .prefs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
48
- .foot .icon { width: 30px; height: 30px; border-radius: 8px; color: var(--ink2); } .foot .icon:hover:not(:disabled) { color: var(--ink); }
49
20
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
50
- .mock { display: inline-block; margin-top: 8px; padding: 2px 8px; border: 1px solid var(--base); border-radius: 999px; font-size: 11.5px; font-weight: 500; }
51
21
 
52
22
  /* main */
53
23
  main { min-width: 0; padding: 20px 36px 56px; }
@@ -100,9 +70,9 @@ td .spark { margin: 0; }
100
70
  .legend b { margin-left: 5px; color: var(--ink); font-weight: 600; }
101
71
  /* effort levels: one violet ramp, low → max; text on a segment follows its lightness; a value outside the five is grey */
102
72
  .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); }
103
- .split i.v0, .split i.v1 { color: #0b0b0b; }
104
- :root[data-theme="dark"] .split i.v0, :root[data-theme="dark"] .split i.v1 { color: #fff; }
105
- :root[data-theme="dark"] .split i.v3, :root[data-theme="dark"] .split i.v4 { color: #0b0b0b; }
73
+ .split i.v0, .split i.v1 { color: var(--classic-text-dark); }
74
+ :root[data-theme="dark"] .split i.v0, :root[data-theme="dark"] .split i.v1 { color: var(--brand-white); }
75
+ :root[data-theme="dark"] .split i.v3, :root[data-theme="dark"] .split i.v4 { color: var(--classic-text-dark); }
106
76
  .lead { margin: 0 0 16px; font-size: 15.5px; line-height: 1.5; }
107
77
  .lead b { font-weight: 650; }
108
78
  .lead.accent { padding: 2px 0 2px 12px; border-left: 3px solid; }
@@ -176,16 +146,16 @@ tbody tr.go:hover td, tbody tr.go:hover th { background: var(--wash); }
176
146
  .hstats .dots { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; height: 7px; margin: 5px 0 4px; } .hstats .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--wash); box-shadow: inset 0 0 0 1px var(--base); } .hstats .dots i.on { background: var(--seq); box-shadow: none; }
177
147
  .hstats .hsw { width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--seq) var(--m), var(--wash)); } .cseq { background: var(--seq); } .cneg { background: var(--neg); }
178
148
  .split { display: flex; gap: 2px; height: 28px; margin: 4px 0 12px; }
179
- .split i { display: flex; align-items: center; padding: 0 9px; border-radius: 4px; color: #fff; font-size: 12.5px; font-style: normal; font-weight: 600; overflow: hidden; white-space: nowrap; } .split i:empty { padding: 0; }
180
- .split i.c4, .split i.c12, .split i.c14, .split i.c16 { color: #0b0b0b; } .split i.c0 { color: var(--ink); }
149
+ .split i { display: flex; align-items: center; padding: 0 9px; border-radius: 4px; color: var(--brand-white); font-size: 12.5px; font-style: normal; font-weight: 600; overflow: hidden; white-space: nowrap; } .split i:empty { padding: 0; }
150
+ .split i.c4, .split i.c12, .split i.c14, .split i.c16 { color: var(--classic-text-dark); } .split i.c0 { color: var(--ink); }
181
151
  .money td.wide, .money th.wide { width: 55%; }
182
152
  .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 { background: transparent; box-shadow: inset 0 0 0 1px var(--base); }
183
153
  .split.kinds { height: 24px; min-width: 240px; margin: 0; cursor: default; }
184
154
  /* Cost kinds: a neutral ramp, so money reads as neither gained nor lost; web search, a fee rather than tokens, is striped;
185
155
  a part that cannot be split is only outlined. */
186
156
  .k0 { background: var(--k0); } .k1 { background: var(--k1); } .k2 { background: var(--k2); } .kw { background: var(--kw); } .kx { background: transparent; box-shadow: inset 0 0 0 1px var(--base); }
187
- .split i.k0, .split i.k1, .split i.kw { color: #0b0b0b; } .split i.k2 { color: #fff; } .split i.kx { color: var(--ink2); }
188
- :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; }
157
+ .split i.k0, .split i.k1, .split i.kw { color: var(--classic-text-dark); } .split i.k2 { color: var(--brand-white); } .split i.kx { color: var(--ink2); }
158
+ :root[data-theme="dark"] .split i.k0, :root[data-theme="dark"] .split i.k1, :root[data-theme="dark"] .split i.kw { color: var(--brand-white); } :root[data-theme="dark"] .split i.k2 { color: var(--classic-text-dark); }
189
159
  /* Context cost parts: distinct hues of equal weight, none red or green, which mark the difference column. */
190
160
  .ck0 { background: var(--ck0); } .ck1 { background: var(--ck1); } .ck2 { background: var(--ck2); }
191
161
  .empty { padding: 40px 0; text-align: center; color: var(--ink2); }
@@ -231,10 +201,10 @@ tbody tr.go:hover td, tbody tr.go:hover th { background: var(--wash); }
231
201
 
232
202
  /* projects: each project's share as a treemap, and the table that compares them */
233
203
  .tree { position: relative; }
234
- .tile { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px 10px; border: 2px solid var(--surface); border-radius: 10px; color: #fff; font: inherit; text-align: left; overflow: hidden; cursor: pointer; transition: opacity .15s; }
204
+ .tile { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px 10px; border: 2px solid var(--surface); border-radius: 10px; color: var(--brand-white); font: inherit; text-align: left; overflow: hidden; cursor: pointer; transition: opacity .15s; }
235
205
  .tile b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
236
206
  .tile span { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
237
- .tile.c4 { color: #0b0b0b; } .tile.c0 { color: var(--ink); }
207
+ .tile.c4 { color: var(--classic-text-dark); } .tile.c0 { color: var(--ink); }
238
208
  .tile:hover { filter: brightness(1.08); }
239
209
  .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
240
210
  .compare tfoot th, .compare tfoot td { border-bottom: 0; color: var(--ink2); font-weight: 600; }
@@ -251,7 +221,7 @@ button.field:focus-visible, .disc:focus-visible, .clear:focus-visible, .cal-step
251
221
  .pick .chev { color: var(--muted); transition: transform .15s; }
252
222
  /* a filter set to anything but its "all" choice is tinted, so the narrowed view is visible at a glance */
253
223
  .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); }
254
- .field.pick.on .chev { color: var(--accent-ink); }
224
+ .field.pick.on .chev { color: inherit; }
255
225
  .pick[aria-expanded="true"] .chev { transform: rotate(180deg); }
256
226
  .pick .cal { color: var(--ink2); }
257
227
  .pop { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; min-width: 100%; padding: 6px; border: 1px solid var(--base); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow); outline: none; }
@@ -284,7 +254,7 @@ button.field:focus-visible, .disc:focus-visible, .clear:focus-visible, .cal-step
284
254
  .cal-day { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
285
255
  .cal-day:hover:not(:disabled) { background: var(--wash); }
286
256
  .cal-day.today { box-shadow: inset 0 0 0 1px var(--base); }
287
- .cal-day.end, .cal-day.end:hover { background: var(--accent); color: #fff; font-weight: 600; box-shadow: none; }
257
+ .cal-day.end, .cal-day.end:hover { background: var(--accent); color: var(--brand-white); font-weight: 600; box-shadow: none; }
288
258
  .cal-day:disabled { color: var(--muted); opacity: .45; cursor: default; }
289
259
  .cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
290
260
  .field.search { gap: 7px; }
@@ -306,8 +276,7 @@ button.field:focus-visible, .disc:focus-visible, .clear:focus-visible, .cal-step
306
276
  .app { display: block; }
307
277
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 4px 6px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
308
278
  .side::-webkit-scrollbar { display: none; } .nav { flex: none; }
309
- .brand { padding: 6px 10px 6px 2px; flex: none; } .brand .brand-lockup { width: 120px; } .navlabel, .foot .si { display: none; } .foot .scan { padding: 0; } .foot .scan .icon { background: var(--wash); }
310
- .side .foot { position: sticky; right: -16px; display: flex; align-self: stretch; align-items: center; gap: 6px; margin: 0 -16px 0 auto; padding: 0 16px 0 10px; border-top: 0; background: var(--surface); }
279
+ .brand { padding: 6px 10px 6px 2px; flex: none; } .brand .brand-lockup { width: 120px; } .navlabel { display: none; }
311
280
  .nav { flex-direction: row; } .nav button { white-space: nowrap; } .nav svg { display: none; } .nav.quiet button { font-size: 14px; padding: 8px 10px; }
312
281
  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; }
313
282
  }
@@ -346,7 +315,7 @@ button.field:focus-visible, .disc:focus-visible, .clear:focus-visible, .cal-step
346
315
  .plot .bands, .plot .bands i, .plot .bands svg { position: absolute; inset: 0; pointer-events: none; }
347
316
  .plot .bands svg { width: 100%; height: 100%; overflow: visible; }
348
317
  /* Each band a light wash of its color fading toward the axis, under a crisp line in the same color along its top. */
349
- .plot .bands i { opacity: .42; -webkit-mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, .15)); mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, .15)); }
318
+ .plot .bands i { opacity: .42; -webkit-mask-image: linear-gradient(to bottom, var(--classic-mask-solid) 20%, var(--classic-mask-fade)); mask-image: linear-gradient(to bottom, var(--classic-mask-solid) 20%, var(--classic-mask-fade)); }
350
319
  :root[data-theme="dark"] .plot .bands i { opacity: .62; }
351
320
  .plot .bands polyline { fill: none; stroke: var(--base); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
352
321
  .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); }
@@ -10,7 +10,9 @@ export function installTip(el: HTMLElement) {
10
10
  const h = document.createElement("div"); h.className = "h"; h.textContent = d.h; el.append(h);
11
11
  for (const [cls, name, value] of d.r) {
12
12
  const row = document.createElement("div"); row.className = "r";
13
- const key = document.createElement("i"); key.className = cls;
13
+ const key = document.createElement("i");
14
+ if (cls.startsWith("--")) key.style.background = `var(${cls})`;
15
+ else key.className = cls;
14
16
  const label = document.createElement("span"); label.textContent = name;
15
17
  const b = document.createElement("b"); b.textContent = value;
16
18
  row.append(key, label, b); el.append(row);
@@ -2,6 +2,9 @@
2
2
  // as close to square as the order allows. Values are laid out in the order given, largest first reads best.
3
3
  export type Rect = { x: number; y: number; w: number; h: number };
4
4
 
5
+ // Give desktop tiles enough room for both the project name and its value.
6
+ export const projectMapHeight = (width: number) => width < 640 ? 300 : Math.round(Math.min(700, Math.max(340, width * 0.55)));
7
+
5
8
  export function squarify(values: number[], box: Rect): Rect[] {
6
9
  const total = values.reduce((a, b) => a + b, 0);
7
10
  if (!total || !box.w || !box.h) return values.map(() => ({ x: box.x, y: box.y, w: 0, h: 0 }));
@@ -1,3 +1,4 @@
1
+ import type { ActivityVM } from "./vm/activity.ts";
1
2
  // Pieces the views share: charts, ranked bars, the hour heatmap, mixes, cost cells and the notes on cost.
2
3
  import { useId, type CSSProperties, type ReactNode } from "react";
3
4
  import { usePopover } from "./controls/popover.tsx";
@@ -5,7 +6,8 @@ import { useDash } from "./dash.ts";
5
6
  import type { Fact, Metric, Run, SessionRow } from "./model.ts";
6
7
  import type { UrlState } from "./state.ts";
7
8
 
8
- type Group = { n: string; c: string };
9
+ type Group = { n: string; c: string; token?: string };
10
+ const groupFill = (g: Group) => g.token ? { "--group-color": `var(${g.token})` } as CSSProperties : undefined;
9
11
  export type TipRow = [cls: string, name: string, value: string];
10
12
 
11
13
  // A tooltip's content, read by tip.ts from the data-tip attribute of the hovered or focused element.
@@ -54,7 +56,7 @@ function niceTop(max: number) {
54
56
  // Stacked columns per day, or per hour when list holds hours; with share, each column is the groups' split of 100%.
55
57
  // Totals draw as stacked areas when the chart toggle says so, each slot still a column to hover; a share keeps its
56
58
  // columns, since a day without use has no split to draw. fmt replaces the metric's format; extra adds tooltip rows for a column.
57
- export function Columns({ list, rows, groups, metric, fmt, extra }: { list: (string | number)[]; rows: number[][]; groups: Group[]; metric: Metric; fmt?: (v: number) => string; extra?: (i: number) => TipRow[] }) {
59
+ export function Columns({ list, rows, groups, metric, fmt, extra, onSlot }: { list: (string | number)[]; rows: number[][]; groups: Group[]; metric: Metric; fmt?: (v: number) => string; extra?: (i: number) => TipRow[]; onSlot?: (slot: string | number) => void }) {
58
60
  const { f, S } = useDash();
59
61
  const share = S.chart === "share";
60
62
  const show = fmt ?? ((v: number) => f.fmt(metric, v));
@@ -77,9 +79,9 @@ export function Columns({ list, rows, groups, metric, fmt, extra }: { list: (str
77
79
  {ticks.slice(1).map((v) => <div key={v} className="gl" style={{ bottom: `${(v / top) * 100}%` }} />)}
78
80
  {area ? (
79
81
  <div className="bands" aria-hidden="true">
80
- {groups.map((g, k) => <i key={k} className={g.c} style={{ clipPath: `polygon(${band(k)})` }} />)}
82
+ {groups.map((g, k) => <i key={k} className={g.c} style={{ ...groupFill(g), clipPath: `polygon(${band(k)})` }} />)}
81
83
  <svg viewBox="0 0 100 100" preserveAspectRatio="none">{/* Top group first, so where a group is empty the line of the group below it shows. */}
82
- {groups.map((g, k) => <polyline key={k} className={g.c} points={list.map((_, i) => `${px(i)},${py(cum[i][k + 1])}`).join(" ")} />).reverse()}</svg>
84
+ {groups.map((g, k) => <polyline key={k} className={g.c} style={groupFill(g)} points={list.map((_, i) => `${px(i)},${py(cum[i][k + 1])}`).join(" ")} />).reverse()}</svg>
83
85
  </div>
84
86
  ) : null}
85
87
  {list.map((d, i) => {
@@ -87,8 +89,10 @@ export function Columns({ list, rows, groups, metric, fmt, extra }: { list: (str
87
89
  const month = !hourly && (i === 0 || dn === 1) ? <em>{f.month(d as string)}</em> : null;
88
90
  const head = (hourly ? d + ":00" : f.dshort(d as string)) + " · " + show(sum);
89
91
  return (
90
- <div key={d} className="col" tabIndex={0} data-tip={tip(head, [...groups.map((g, k): TipRow => [g.c, g.n, (share ? f.pct(h(i, k)) + " · " : "") + show(rows[i][k])]).filter((_, k) => rows[i][k]), ...(extra?.(i) ?? [])])}>
91
- {area ? groups.map((g, k) => (rows[i][k] ? <b key={k} className={`dot ${g.c}`} style={{ bottom: `${(cum[i][k + 1] / top) * 100}%` }} /> : null)) : <div className="bars">{groups.map((g, k) => (rows[i][k] ? <i key={k} className={g.c} style={{ height: `${(h(i, k) / top) * 100}%` }} /> : null)).reverse()}</div>}
92
+ <div key={d} className="col" tabIndex={0} role={onSlot ? "button" : undefined} aria-label={onSlot ? head : undefined}
93
+ onClick={onSlot ? () => onSlot(d) : undefined}
94
+ onKeyDown={onSlot ? (event) => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); onSlot(d); } } : undefined} data-tip={tip(head, [...groups.map((g, k): TipRow => [g.token ?? g.c, g.n, (share ? f.pct(h(i, k)) + " · " : "") + show(rows[i][k])]).filter((_, k) => rows[i][k]), ...(extra?.(i) ?? [])])}>
95
+ {area ? groups.map((g, k) => (rows[i][k] ? <b key={k} className={`dot ${g.c}`} style={{ ...groupFill(g), bottom: `${(cum[i][k + 1] / top) * 100}%` }} /> : null)) : <div className="bars">{groups.map((g, k) => (rows[i][k] ? <i key={k} className={g.c} style={{ ...groupFill(g), height: `${(h(i, k) / top) * 100}%` }} /> : null)).reverse()}</div>}
92
96
  {i % every === 0 || month ? <span className="x">{dn}{month}</span> : null}
93
97
  </div>
94
98
  );
@@ -104,7 +108,7 @@ export function Legend({ groups, sums, metric, style }: { groups: Group[]; sums?
104
108
  const { f } = useDash();
105
109
  return (
106
110
  <ul className="legend" style={style}>
107
- {groups.map((g, k) => (!sums || sums[k] ? <li key={k}><i className={g.c} />{g.n}{sums ? <b>{f.fmt(metric, sums[k])}</b> : null}</li> : null))}
111
+ {groups.map((g, k) => (!sums || sums[k] ? <li key={k}><i className={g.c} style={groupFill(g)} />{g.n}{sums ? <b>{f.fmt(metric, sums[k])}</b> : null}</li> : null))}
108
112
  </ul>
109
113
  );
110
114
  }
@@ -174,26 +178,11 @@ export function Rank({ rows, metric, color, fmt }: { rows: RankRow[]; metric: Me
174
178
  }
175
179
 
176
180
  // Activity per weekday and hour, by requests (each step the agent took, whatever its context or output) or by output.
177
- export function Heat({ F, by }: { F: Fact[]; by: "req" | "out" }) {
181
+ export function Heat({ data, by }: { data: ActivityVM["heat"]; by: "req" | "out" }) {
178
182
  const { t, f, L } = useDash();
179
183
  const label = by === "req" ? t("requests") : t("out"), show = by === "req" ? f.int : f.cmp;
180
- const g = Array.from({ length: 7 }, () => new Array<number>(24).fill(0));
181
- let max = 0, peak = [0, 0];
182
- // Beside the grid: the weekend's and the night's share, and how many sessions had requests in the same hour.
183
- let all = 0, weekend = 0, night = 0;
184
- const slots = new Map<string, Set<number>>();
185
- for (const x of F) {
186
- const wd = (new Date(x.d + "T00:00:00Z").getUTCDay() + 6) % 7, v = by === "req" ? x.q : x.o;
187
- g[wd][x.h] += v; all += v;
188
- if (wd >= 5) weekend += v;
189
- if (x.h >= 22 || x.h < 6) night += v;
190
- if (g[wd][x.h] > max) { max = g[wd][x.h]; peak = [wd, x.h]; }
191
- const k = x.d + " " + x.h;
192
- if (!slots.has(k)) slots.set(k, new Set());
193
- slots.get(k)!.add(x.s);
194
- }
184
+ const { g, max, peak, all, weekend, night, mid, most } = data;
195
185
  if (!max) return <Empty />;
196
- const same = [...slots.values()].map((s) => s.size).sort((a, b) => a - b), mid = same[Math.floor(same.length / 2)], most = same[same.length - 1];
197
186
  return (
198
187
  <>
199
188
  <div className="heat">
@@ -246,20 +235,20 @@ export function HeatSeg() {
246
235
  }
247
236
 
248
237
  // Shares of a total as one thin bar, colored by model.
249
- export function Mix({ arr, className = "mix", style, tip: about }: { arr: number[]; className?: string; style?: CSSProperties; tip?: string }) {
238
+ export function Mix({ arr, className = "mix", style, tip: about, colors }: { arr: number[]; colors?: string[]; className?: string; style?: CSSProperties; tip?: string }) {
250
239
  const { M } = useDash();
251
240
  const sum = arr.reduce((a, b) => a + b, 0) || 1;
252
- return <span className={className} style={style} data-tip={about}>{arr.map((v, k) => (v ? <i key={k} className={M.mColor(k)} style={{ width: `${(v / sum) * 100}%` }} /> : null))}</span>;
241
+ return <span className={className} style={style} data-tip={about}>{arr.map((v, k) => (v ? <i key={k} className={M.mColor(k)} style={{ width: `${(v / sum) * 100}%`, background: colors ? `var(${colors[k]})` : undefined }} /> : null))}</span>;
253
242
  }
254
243
 
255
244
  // A session's output tokens per model, the main thread and subagents apart, largest first.
256
- export function SessionMix({ r }: { r: SessionRow }) {
245
+ export function SessionMix({ r, colors }: { r: SessionRow; colors?: string[] }) {
257
246
  const { M, t, f } = useDash();
258
247
  if (r.mix.filter((v) => v > 0).length < 2) return null; // one model needs no bar
259
248
  const sum = r.mix.reduce((a, b) => a + b, 0) || 1;
260
249
  const parts = r.mix.flatMap((v, k) => [{ k, n: v - r.subMix[k], who: t("mainThread") }, { k, n: r.subMix[k], who: t("subs") }]).filter((p) => p.n > 0);
261
250
  parts.sort((a, b) => b.n - a.n);
262
- return <Mix arr={r.mix} tip={tip(t("out"), parts.map(({ k, n, who }): TipRow => [M.mColor(k), `${M.models[k]} · ${who}`, `${f.cmp(n)} · ${f.pct(n / sum)}`]))} />;
251
+ return <Mix arr={r.mix} colors={colors} tip={tip(t("out"), parts.map(({ k, n, who }): TipRow => [colors?.[k] ?? M.mColor(k), `${M.models[k]} · ${who}`, `${f.cmp(n)} · ${f.pct(n / sum)}`]))} />;
263
252
  }
264
253
 
265
254
  // A session's effort runs in time order, each as wide as its requests.
@@ -277,15 +266,15 @@ export function RunsStrip({ runs, wide }: { runs: Run[]; wide?: boolean }) {
277
266
  export function CostCell({ r }: { r: SessionRow }) {
278
267
  const { t, f } = useDash();
279
268
  const s = r.x.costState;
280
- if (s === "unknown") return <span data-tip={tip(t("costUnknown"), [])}>—</span>;
281
- if (s === "incomplete") return <span data-tip={tip(t("costPartial"), [])}>{f.usd(r.c)}*</span>;
282
- if (s === "estimated") return <span data-tip={tip(t("costEstimated"), [])}>{f.usd(r.c)}*</span>;
269
+ if (s === "unknown") return <span title={t("costUnknown")} data-tip={tip(t("costUnknown"), [])}>?</span>;
270
+ if (s === "incomplete") return <span title={t("costPartial")} data-tip={tip(t("costPartial"), [])}>{f.usd(r.c)} !</span>;
271
+ if (s === "estimated") return <span title={t("costEstimated")} data-tip={tip(t("costEstimated"), [])}>≈{f.usd(r.c)}</span>;
283
272
  return <>{f.usd(r.c)}</>;
284
273
  }
285
274
 
286
275
  export function Title({ title }: { title: string }) {
287
276
  const { t } = useDash();
288
- return <div className="title">{title || <span className="sub" style={{ display: "inline" }}>{t("untitled")}</span>}</div>;
277
+ return <div className="title" title={title || undefined} data-tip={title ? tip(title, []) : undefined}>{title || <span className="sub" style={{ display: "inline" }}>{t("untitled")}</span>}</div>;
289
278
  }
290
279
 
291
280
  // What makes a cost figure uncertain, as tooltip rows: sessions whose cost is missing, partial or estimated,
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from "react";
2
+ import { useDash } from "../dash.ts";
3
+ import { toUrl, type UrlState } from "../state.ts";
4
+ import "./breakdown.css";
5
+
6
+ type Breakdown = { project: string; count: string } | { model: string; provider?: string };
7
+
8
+ export function BreakdownSessions({ children, detail, ...breakdown }: Breakdown & { children: ReactNode; detail?: string }) {
9
+ const { S, t, set } = useDash();
10
+ const isProject = "project" in breakdown;
11
+ const name = isProject ? breakdown.project : breakdown.model;
12
+ const scope = isProject ? { project: name } : breakdown;
13
+ const patch: Partial<UrlState> = { ...scope, view: "sessions", q: "", sessionsBy: "" };
14
+ const label = `${t("viewSessions")} · ${name}`;
15
+ return (
16
+ <a className={isProject ? "breakdown-count" : "breakdown-bar"} href={toUrl({ ...S, ...patch })}
17
+ aria-label={isProject ? `${breakdown.count} · ${label}` : label} title={label} data-tip={detail}
18
+ onClick={(event) => {
19
+ event.stopPropagation();
20
+ if (event.button !== 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
21
+ event.preventDefault();
22
+ set(patch);
23
+ }}>{children}</a>
24
+ );
25
+ }
26
+
27
+ export function ProjectComparison() {
28
+ const { M, filter, t } = useDash();
29
+ const project = M.projects[filter.project];
30
+ if (!project) return null;
31
+ return (
32
+ <p className="hint breakdown-note">
33
+ {t("projectComparison")} · {t("selectedProject")} <strong>{project}</strong>
34
+ </p>
35
+ );
36
+ }
37
+
38
+ export function ReplayNotes({ count, cost }: { count: number; cost: number }) {
39
+ const { L, f, t } = useDash();
40
+ return (
41
+ <div className="hint breakdown-note">
42
+ <p><strong>{t("recorded")}</strong> · {L.recordedVal(f.int(count), f.usd(cost))}</p>
43
+ <p><strong>{t("estimate")}</strong> · {L.estNotes.join(". ")}.</p>
44
+ </div>
45
+ );
46
+ }
@@ -0,0 +1,67 @@
1
+ import { useDash } from "../dash.ts";
2
+ import { mainLevel, sessionRows, type Session } from "../model.ts";
3
+ import { MobileSheet } from "../shell/MobileSheet.tsx";
4
+ import { toUrl } from "../state.ts";
5
+ import { findSessionIndex, sessionKey, sessionReference } from "../vm/sessionDetail.ts";
6
+ import "./session-detail.css";
7
+
8
+ export function SessionLink({ session }: { session: Session }) {
9
+ const { M, S, f, set, t } = useDash();
10
+ const title = session.title || t("untitled");
11
+ const key = sessionKey(session);
12
+ const label = [title, M.projects[session.p], f.startText(session), key].filter(Boolean).join(" · ");
13
+ return <a className="session-link" title={label} aria-label={label} aria-haspopup="dialog"
14
+ href={toUrl({ ...S, session: key })} onClick={(event) => {
15
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
16
+ event.preventDefault();
17
+ set({ session: key });
18
+ }}>{title}</a>;
19
+ }
20
+
21
+ export function SessionDetail({ sessionKey: key, onClose }: { sessionKey: string; onClose: () => void }) {
22
+ const { M, f, t } = useDash();
23
+ const index = findSessionIndex(M.sessions, key);
24
+ const session = M.sessions[index];
25
+ const facts = session ? M.facts.filter(({ s }) => s === index) : [];
26
+ const totals = sessionRows(M, facts)[0];
27
+ const daily = new Map<string, number>();
28
+ for (const { d, o } of facts) daily.set(d, (daily.get(d) ?? 0) + o);
29
+ const dash = "—";
30
+ const effort = session?.runs.length ? M.efforts[mainLevel(session.runs)] : undefined;
31
+ const provider = session ? M.providers[session.pr ?? 0] : undefined;
32
+ const costStatus = session?.costState === "estimated" ? t("costEstimated")
33
+ : session?.costState === "incomplete" ? t("costPartial")
34
+ : session?.costState === "unknown" ? t("costUnknown") : "";
35
+ const cost = totals && session?.costState !== "unknown" ? f.usd(totals.c) : dash;
36
+ const cache = totals && (totals.cr + totals.i + totals.cw) > 0 ? f.pct(totals.hit) : dash;
37
+ const fact = (label: string, value: string, note?: string) => (
38
+ <div><dt>{label}</dt><dd>{value}</dd>{note ? <dd className="session-detail-note">{note}</dd> : null}</div>
39
+ );
40
+
41
+ return <MobileSheet title={t("sessionDetails")} closeLabel={t("close")} onClose={onClose}>
42
+ {session ? <article className="session-detail">
43
+ <h3>{session.title || t("untitled")}</h3>
44
+ <p className="session-detail-meta">{[provider, M.projects[session.p], f.startText(session), sessionReference(M.sessions, session)].filter(Boolean).join(" · ")}</p>
45
+ <p className="session-detail-note">{t("wholeSession")}</p>
46
+ <dl className="session-detail-metrics">
47
+ {fact(t(session.costState === "estimated" ? "estimatedCost" : "cost"), cost, costStatus)}
48
+ {fact(t("out"), totals ? f.int(totals.o) : dash)}
49
+ {fact(t("dur"), f.dur(session.dur))}
50
+ {fact(t("requests"), totals ? f.int(totals.q) : dash)}
51
+ {fact(t("mainModel"), M.models[session.parent] ?? dash)}
52
+ {fact(t("effort"), effort ?? dash)}
53
+ {fact(t("cache"), cache)}
54
+ {fact(t("ctxPerReq"), totals?.q ? f.cmp(totals.ctx) : dash)}
55
+ {fact(t("compactions"), f.int(session.compact))}
56
+ {fact(t("subagents"), f.int(session.subs.length))}
57
+ </dl>
58
+ {daily.size > 1 ? <table className="session-detail-days">
59
+ <caption>{t("dailyTable")}</caption>
60
+ <thead><tr><th scope="col">{t("day")}</th><th scope="col" className="num">{t("out")}</th></tr></thead>
61
+ <tbody>{[...daily].sort(([a], [b]) => a.localeCompare(b)).map(([day, output]) =>
62
+ <tr key={day}><th scope="row">{f.dshort(day)}</th><td className="num">{f.int(output)}</td></tr>
63
+ )}</tbody>
64
+ </table> : null}
65
+ </article> : <p>{t("sessionUnavailable")}</p>}
66
+ </MobileSheet>;
67
+ }
@@ -0,0 +1,33 @@
1
+ .breakdown-note {
2
+ margin: 0 0 var(--space-3);
3
+ overflow-wrap: anywhere;
4
+ }
5
+ .breakdown-note p { margin: 0 0 var(--space-1); }
6
+ .breakdown-count {
7
+ color: inherit;
8
+ text-decoration: underline;
9
+ text-decoration-style: dotted;
10
+ text-underline-offset: 0.18em;
11
+ }
12
+ .breakdown-count:hover { text-decoration-style: solid; }
13
+ .breakdown-count:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
14
+ :is(.record-projects, .compare) tr[aria-current="true"] > * { background: var(--sunken); }
15
+ .breakdown-bar {
16
+ display: flex;
17
+ align-items: center;
18
+ min-width: 0;
19
+ min-height: var(--space-6);
20
+ width: 100%;
21
+ text-decoration: none;
22
+ }
23
+ .breakdown-bar:hover,
24
+ .breakdown-bar:focus-visible {
25
+ outline: 1px solid var(--focus);
26
+ outline-offset: 2px;
27
+ border-radius: var(--bar-radius);
28
+ }
29
+ .breakdown-bar .split.kinds {
30
+ width: 100%;
31
+ background: var(--hair);
32
+ cursor: pointer;
33
+ }