agentlytics 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cache.js +7 -1
- package/index.js +78 -11
- package/package.json +2 -1
- package/ui/src/App.jsx +18 -16
- package/ui/src/components/ActivityHeatmap.jsx +3 -3
- package/ui/src/components/AnimatedLogo.jsx +96 -0
- package/ui/src/components/ChatSidebar.jsx +7 -7
- package/ui/src/components/DateRangePicker.jsx +5 -5
- package/ui/src/components/EditorBreakdown.jsx +2 -2
- package/ui/src/components/EditorDot.jsx +1 -1
- package/ui/src/components/KpiCard.jsx +2 -2
- package/ui/src/components/LiveFeed.jsx +8 -8
- package/ui/src/components/LoginScreen.jsx +8 -6
- package/ui/src/components/MessageRenderer.jsx +5 -5
- package/ui/src/components/ModelBreakdown.jsx +3 -3
- package/ui/src/components/SectionTitle.jsx +1 -1
- package/ui/src/index.css +1 -1
- package/ui/src/pages/Compare.jsx +18 -18
- package/ui/src/pages/Dashboard.jsx +14 -14
- package/ui/src/pages/DeepAnalysis.jsx +27 -27
- package/ui/src/pages/ProjectDetail.jsx +11 -11
- package/ui/src/pages/Projects.jsx +5 -5
- package/ui/src/pages/RelayDashboard.jsx +29 -29
- package/ui/src/pages/RelaySessionDetail.jsx +1 -1
- package/ui/src/pages/RelayUserDetail.jsx +18 -18
- package/ui/src/pages/Sessions.jsx +19 -19
- package/ui/src/pages/SqlViewer.jsx +14 -14
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { Lock } from 'lucide-react'
|
|
3
3
|
import { login } from '../lib/api'
|
|
4
|
+
import AnimatedLogo from './AnimatedLogo'
|
|
4
5
|
|
|
5
6
|
export default function LoginScreen({ onSuccess }) {
|
|
6
7
|
const [password, setPassword] = useState('')
|
|
@@ -31,13 +32,14 @@ export default function LoginScreen({ onSuccess }) {
|
|
|
31
32
|
>
|
|
32
33
|
<Lock size={18} style={{ color: '#818cf8' }} />
|
|
33
34
|
</div>
|
|
34
|
-
<div className="text-sm font-bold" style={{ color: 'var(--c-white)' }}>
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
<div className="flex items-center gap-1.5 text-sm font-bold" style={{ color: 'var(--c-white)' }}>
|
|
36
|
+
<AnimatedLogo size={16} />
|
|
37
|
+
Agentlytics
|
|
38
|
+
<span className="text-[10px] font-medium px-1.5 py-0.5" style={{ background: 'rgba(99,102,241,0.15)', color: '#818cf8' }}>
|
|
37
39
|
relay
|
|
38
40
|
</span>
|
|
39
41
|
</div>
|
|
40
|
-
<div className="text-[
|
|
42
|
+
<div className="text-[11px] mt-1" style={{ color: 'var(--c-text3)' }}>
|
|
41
43
|
This relay is password-protected
|
|
42
44
|
</div>
|
|
43
45
|
</div>
|
|
@@ -57,12 +59,12 @@ export default function LoginScreen({ onSuccess }) {
|
|
|
57
59
|
}}
|
|
58
60
|
/>
|
|
59
61
|
{error && (
|
|
60
|
-
<div className="text-[
|
|
62
|
+
<div className="text-[11px]" style={{ color: '#f87171' }}>{error}</div>
|
|
61
63
|
)}
|
|
62
64
|
<button
|
|
63
65
|
type="submit"
|
|
64
66
|
disabled={loading || !password}
|
|
65
|
-
className="w-full py-2 text-[
|
|
67
|
+
className="w-full py-2 text-[12px] font-medium rounded transition"
|
|
66
68
|
style={{
|
|
67
69
|
background: '#6366f1',
|
|
68
70
|
color: '#fff',
|
|
@@ -52,7 +52,7 @@ export function ToolArgsDiff({ args }) {
|
|
|
52
52
|
const oldLines = (old || '').split('\n').slice(0, maxLines)
|
|
53
53
|
const newLines = (nw || '').split('\n').slice(0, maxLines)
|
|
54
54
|
return (
|
|
55
|
-
<div className="mt-1.5 text-[
|
|
55
|
+
<div className="mt-1.5 text-[10px] font-mono overflow-x-auto" style={{ border: '1px solid var(--c-border)' }}>
|
|
56
56
|
{(args.file_path || args.TargetFile) && (
|
|
57
57
|
<div className="px-2 py-0.5" style={{ background: 'var(--c-code-bg)', color: 'var(--c-text)' }}>{args.file_path || args.TargetFile}</div>
|
|
58
58
|
)}
|
|
@@ -85,7 +85,7 @@ export function ToolArgsDetail({ args }) {
|
|
|
85
85
|
const query = args.Query || args.query || args.search_term || null
|
|
86
86
|
const url = args.Url || args.url || null
|
|
87
87
|
return (
|
|
88
|
-
<div className="mt-1.5 text-[
|
|
88
|
+
<div className="mt-1.5 text-[10px] font-mono overflow-x-auto" style={{ background: 'var(--c-code-bg)', border: '1px solid var(--c-border)' }}>
|
|
89
89
|
{file && <div className="px-2 py-0.5" style={{ color: 'var(--c-text)' }}>file: {file}</div>}
|
|
90
90
|
{cmd && <div className="px-2 py-0.5" style={{ color: 'var(--c-text)' }}>cmd: {cmd}</div>}
|
|
91
91
|
{query && <div className="px-2 py-0.5" style={{ color: 'var(--c-text)' }}>query: {query}</div>}
|
|
@@ -101,7 +101,7 @@ export function ToolCallBlock({ name, args, detail }) {
|
|
|
101
101
|
const [open, setOpen] = useState(false)
|
|
102
102
|
const hasDetail = detail && Object.keys(detail).length > 0
|
|
103
103
|
return (
|
|
104
|
-
<div className="my-1 px-2.5 py-1.5 text-[
|
|
104
|
+
<div className="my-1 px-2.5 py-1.5 text-[11px]" style={{ background: 'var(--c-code-bg)', border: '1px solid var(--c-border)' }}>
|
|
105
105
|
<div className="flex items-center gap-2 cursor-pointer" onClick={() => hasDetail && setOpen(!open)}>
|
|
106
106
|
{hasDetail
|
|
107
107
|
? (open ? <ChevronDown size={10} style={{ color: '#a78bfa' }} /> : <ChevronRight size={10} style={{ color: '#a78bfa' }} />)
|
|
@@ -121,13 +121,13 @@ export function ToolResultBlock({ name, preview }) {
|
|
|
121
121
|
const isNoisy = preview.length > 120 || preview.startsWith('{') || preview.includes('contentId')
|
|
122
122
|
const short = isNoisy ? `${name} completed` : preview.substring(0, 120)
|
|
123
123
|
return (
|
|
124
|
-
<div className="my-1 px-2.5 py-1.5 text-[
|
|
124
|
+
<div className="my-1 px-2.5 py-1.5 text-[11px]" style={{ background: 'var(--c-code-bg)', border: '1px solid var(--c-border)' }}>
|
|
125
125
|
<div className="flex items-center gap-2 cursor-pointer" onClick={() => preview && setOpen(!open)}>
|
|
126
126
|
<CheckCircle size={10} style={{ color: '#34d399' }} />
|
|
127
127
|
<span className="truncate" style={{ color: 'var(--c-text)' }}>{short}</span>
|
|
128
128
|
{isNoisy && preview && <span style={{ color: 'var(--c-text3)' }}>{open ? '[-]' : '[+]'}</span>}
|
|
129
129
|
</div>
|
|
130
|
-
{open && <pre className="mt-1 text-[
|
|
130
|
+
{open && <pre className="mt-1 text-[10px] overflow-x-auto whitespace-pre-wrap break-all" style={{ color: 'var(--c-text2)' }}>{preview}</pre>}
|
|
131
131
|
</div>
|
|
132
132
|
)
|
|
133
133
|
}
|
|
@@ -9,15 +9,15 @@ export default function ModelBreakdown({ models }) {
|
|
|
9
9
|
return (
|
|
10
10
|
<div key={name} className="flex items-center gap-2">
|
|
11
11
|
<Cpu size={10} style={{ color: '#818cf8' }} />
|
|
12
|
-
<span className="text-[
|
|
12
|
+
<span className="text-[11px] truncate w-40" style={{ color: 'var(--c-text)' }}>{name}</span>
|
|
13
13
|
<div className="flex-1 h-2 relative" style={{ background: 'var(--c-card)' }}>
|
|
14
14
|
<div className="h-full" style={{ width: `${pct}%`, background: '#6366f1', opacity: 0.5 }} />
|
|
15
15
|
</div>
|
|
16
|
-
<span className="text-[
|
|
16
|
+
<span className="text-[11px] w-10 text-right" style={{ color: 'var(--c-text2)' }}>{count}</span>
|
|
17
17
|
</div>
|
|
18
18
|
)
|
|
19
19
|
})}
|
|
20
|
-
{models.length === 0 && <div className="text-[
|
|
20
|
+
{models.length === 0 && <div className="text-[11px]" style={{ color: 'var(--c-text3)' }}>No model data</div>}
|
|
21
21
|
</div>
|
|
22
22
|
)
|
|
23
23
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export default function SectionTitle({ children }) {
|
|
2
|
-
return <h3 className="text-[
|
|
2
|
+
return <h3 className="text-[11px] font-medium uppercase tracking-wider mb-2" style={{ color: 'var(--c-text2)' }}>{children}</h3>
|
|
3
3
|
}
|
package/ui/src/index.css
CHANGED
package/ui/src/pages/Compare.jsx
CHANGED
|
@@ -16,15 +16,15 @@ function MetricRow({ label, a, b, colorA, colorB }) {
|
|
|
16
16
|
const max = Math.max(numA, numB, 1)
|
|
17
17
|
return (
|
|
18
18
|
<div className="grid grid-cols-[1fr_100px_100px] gap-x-3 items-center py-0.5" style={{ borderBottom: '1px solid var(--c-border)' }}>
|
|
19
|
-
<div className="text-[
|
|
19
|
+
<div className="text-[11px]" style={{ color: 'var(--c-text2)' }}>{label}</div>
|
|
20
20
|
<div className="text-right">
|
|
21
|
-
<span className="text-[
|
|
21
|
+
<span className="text-[12px] font-mono font-medium" style={{ color: 'var(--c-white)' }}>
|
|
22
22
|
{typeof a === 'number' ? formatNumber(a) : a}
|
|
23
23
|
</span>
|
|
24
24
|
<div className="h-1 rounded-full mt-0.5 ml-auto" style={{ background: colorA, width: `${(numA / max * 100).toFixed(0)}%` }} />
|
|
25
25
|
</div>
|
|
26
26
|
<div className="text-right">
|
|
27
|
-
<span className="text-[
|
|
27
|
+
<span className="text-[12px] font-mono font-medium" style={{ color: 'var(--c-white)' }}>
|
|
28
28
|
{typeof b === 'number' ? formatNumber(b) : b}
|
|
29
29
|
</span>
|
|
30
30
|
<div className="h-1 rounded-full mt-0.5 ml-auto" style={{ background: colorB, width: `${(numB / max * 100).toFixed(0)}%` }} />
|
|
@@ -37,27 +37,27 @@ function ListCompare({ titleA, titleB, colorA, colorB, itemsA, itemsB, limit = 8
|
|
|
37
37
|
return (
|
|
38
38
|
<div className="grid grid-cols-2 gap-2">
|
|
39
39
|
<div>
|
|
40
|
-
<h4 className="text-[
|
|
40
|
+
<h4 className="text-[11px] font-medium uppercase tracking-wider mb-1" style={{ color: colorA }}>{titleA}</h4>
|
|
41
41
|
<div className="space-y-0.5">
|
|
42
42
|
{itemsA.slice(0, limit).map(t => (
|
|
43
|
-
<div key={t.name} className="flex justify-between text-[
|
|
43
|
+
<div key={t.name} className="flex justify-between text-[11px] py-0.5">
|
|
44
44
|
<span className="truncate" style={{ color: 'var(--c-text)' }}>{t.name}</span>
|
|
45
45
|
<span className="font-mono ml-2" style={{ color: 'var(--c-text3)' }}>{t.count}</span>
|
|
46
46
|
</div>
|
|
47
47
|
))}
|
|
48
|
-
{itemsA.length === 0 && <div className="text-[
|
|
48
|
+
{itemsA.length === 0 && <div className="text-[11px]" style={{ color: 'var(--c-text3)' }}>none</div>}
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
51
51
|
<div>
|
|
52
|
-
<h4 className="text-[
|
|
52
|
+
<h4 className="text-[11px] font-medium uppercase tracking-wider mb-1" style={{ color: colorB }}>{titleB}</h4>
|
|
53
53
|
<div className="space-y-0.5">
|
|
54
54
|
{itemsB.slice(0, limit).map(t => (
|
|
55
|
-
<div key={t.name} className="flex justify-between text-[
|
|
55
|
+
<div key={t.name} className="flex justify-between text-[11px] py-0.5">
|
|
56
56
|
<span className="truncate" style={{ color: 'var(--c-text)' }}>{t.name}</span>
|
|
57
57
|
<span className="font-mono ml-2" style={{ color: 'var(--c-text3)' }}>{t.count}</span>
|
|
58
58
|
</div>
|
|
59
59
|
))}
|
|
60
|
-
{itemsB.length === 0 && <div className="text-[
|
|
60
|
+
{itemsB.length === 0 && <div className="text-[11px]" style={{ color: 'var(--c-text3)' }}>none</div>}
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
@@ -156,7 +156,7 @@ export default function Compare({ overview }) {
|
|
|
156
156
|
<select
|
|
157
157
|
value={editorA}
|
|
158
158
|
onChange={e => setEditorA(e.target.value)}
|
|
159
|
-
className="px-2 py-1 text-[
|
|
159
|
+
className="px-2 py-1 text-[12px] outline-none"
|
|
160
160
|
style={{ background: 'var(--c-bg3)', color: 'var(--c-text)', border: '1px solid var(--c-border)' }}
|
|
161
161
|
>
|
|
162
162
|
{editors.map(e => <option key={e.id} value={e.id}>{editorLabel(e.id)}</option>)}
|
|
@@ -165,7 +165,7 @@ export default function Compare({ overview }) {
|
|
|
165
165
|
<select
|
|
166
166
|
value={editorB}
|
|
167
167
|
onChange={e => setEditorB(e.target.value)}
|
|
168
|
-
className="px-2 py-1 text-[
|
|
168
|
+
className="px-2 py-1 text-[12px] outline-none"
|
|
169
169
|
style={{ background: 'var(--c-bg3)', color: 'var(--c-text)', border: '1px solid var(--c-border)' }}
|
|
170
170
|
>
|
|
171
171
|
{editors.map(e => <option key={e.id} value={e.id}>{editorLabel(e.id)}</option>)}
|
|
@@ -179,8 +179,8 @@ export default function Compare({ overview }) {
|
|
|
179
179
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-2">
|
|
180
180
|
<div className="card p-3">
|
|
181
181
|
<div className="flex items-center justify-between mb-1.5">
|
|
182
|
-
<h3 className="text-[
|
|
183
|
-
<div className="flex items-center gap-3 text-[
|
|
182
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider" style={{ color: 'var(--c-text2)' }}>totals</h3>
|
|
183
|
+
<div className="flex items-center gap-3 text-[10px]">
|
|
184
184
|
<span style={{ color: colorA }}>● {nameA}</span>
|
|
185
185
|
<span style={{ color: colorB }}>● {nameB}</span>
|
|
186
186
|
</div>
|
|
@@ -188,7 +188,7 @@ export default function Compare({ overview }) {
|
|
|
188
188
|
{metrics.map(m => <MetricRow key={m.label} label={m.label} a={m.a} b={m.b} colorA={colorA} colorB={colorB} />)}
|
|
189
189
|
</div>
|
|
190
190
|
<div className="card p-3">
|
|
191
|
-
<h3 className="text-[
|
|
191
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider mb-1.5" style={{ color: 'var(--c-text2)' }}>efficiency</h3>
|
|
192
192
|
{ratios.map(m => <MetricRow key={m.label} label={m.label} a={m.a} b={m.b} colorA={colorA} colorB={colorB} />)}
|
|
193
193
|
</div>
|
|
194
194
|
</div>
|
|
@@ -196,14 +196,14 @@ export default function Compare({ overview }) {
|
|
|
196
196
|
{/* Charts row */}
|
|
197
197
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-2">
|
|
198
198
|
<div className="card p-3">
|
|
199
|
-
<h3 className="text-[
|
|
199
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider mb-2" style={{ color: 'var(--c-text2)' }}>usage</h3>
|
|
200
200
|
<div style={{ height: 160 }}>
|
|
201
201
|
<Bar data={barChart} options={barOpts} />
|
|
202
202
|
</div>
|
|
203
203
|
</div>
|
|
204
204
|
{tokenChart && (
|
|
205
205
|
<div className="card p-3">
|
|
206
|
-
<h3 className="text-[
|
|
206
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider mb-2" style={{ color: 'var(--c-text2)' }}>tokens</h3>
|
|
207
207
|
<div style={{ height: 160 }}>
|
|
208
208
|
<Bar data={tokenChart} options={barOpts} />
|
|
209
209
|
</div>
|
|
@@ -214,12 +214,12 @@ export default function Compare({ overview }) {
|
|
|
214
214
|
{/* Tools + Models side-by-side */}
|
|
215
215
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-2">
|
|
216
216
|
<div className="card p-3">
|
|
217
|
-
<h3 className="text-[
|
|
217
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider mb-2" style={{ color: 'var(--c-text2)' }}>top tools</h3>
|
|
218
218
|
<ListCompare titleA={nameA} titleB={nameB} colorA={colorA} colorB={colorB}
|
|
219
219
|
itemsA={result.deepA.topTools} itemsB={result.deepB.topTools} limit={10} />
|
|
220
220
|
</div>
|
|
221
221
|
<div className="card p-3">
|
|
222
|
-
<h3 className="text-[
|
|
222
|
+
<h3 className="text-[11px] font-medium uppercase tracking-wider mb-2" style={{ color: 'var(--c-text2)' }}>models</h3>
|
|
223
223
|
<ListCompare titleA={nameA} titleB={nameB} colorA={colorA} colorB={colorB}
|
|
224
224
|
itemsA={result.deepA.topModels} itemsB={result.deepB.topModels} limit={8} />
|
|
225
225
|
</div>
|
|
@@ -220,7 +220,7 @@ export default function Dashboard({ overview }) {
|
|
|
220
220
|
<button
|
|
221
221
|
onClick={handleShare}
|
|
222
222
|
disabled={sharing}
|
|
223
|
-
className="flex items-center gap-1.5 px-3 py-1 text-[
|
|
223
|
+
className="flex items-center gap-1.5 px-3 py-1 text-[12px] rounded-md transition hover:opacity-80"
|
|
224
224
|
style={{ background: '#6366f1', color: '#fff', opacity: sharing ? 0.5 : 1 }}
|
|
225
225
|
>
|
|
226
226
|
<Share2 size={12} />
|
|
@@ -236,7 +236,7 @@ export default function Dashboard({ overview }) {
|
|
|
236
236
|
return (
|
|
237
237
|
<button
|
|
238
238
|
key={e.id}
|
|
239
|
-
className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[
|
|
239
|
+
className="inline-flex items-center gap-1.5 px-2.5 py-1.5 text-[12px] cursor-pointer transition rounded-sm"
|
|
240
240
|
style={{
|
|
241
241
|
border: isSelected ? `1.5px solid ${editorColor(e.id)}` : '1px solid var(--c-border)',
|
|
242
242
|
background: isSelected ? editorColor(e.id) + '15' : 'transparent',
|
|
@@ -254,10 +254,10 @@ export default function Dashboard({ overview }) {
|
|
|
254
254
|
</div>
|
|
255
255
|
{selectedEditor && sel && (
|
|
256
256
|
<div className="mt-2 flex items-center gap-2">
|
|
257
|
-
<button onClick={() => navigate(`/sessions?editor=${selectedEditor}`)} className="flex items-center gap-1 text-[
|
|
257
|
+
<button onClick={() => navigate(`/sessions?editor=${selectedEditor}`)} className="flex items-center gap-1 text-[12px] px-2.5 py-1 transition" style={{ color: 'var(--c-accent)', border: '1px solid var(--c-border)' }}>
|
|
258
258
|
Show Sessions <ArrowRight size={11} />
|
|
259
259
|
</button>
|
|
260
|
-
<button onClick={() => setSelectedEditor(null)} className="flex items-center gap-1 text-[
|
|
260
|
+
<button onClick={() => setSelectedEditor(null)} className="flex items-center gap-1 text-[12px] px-2.5 py-1 transition" style={{ color: 'var(--c-text2)', border: '1px solid var(--c-border)' }}>
|
|
261
261
|
<X size={9} /> Clear
|
|
262
262
|
</button>
|
|
263
263
|
</div>
|
|
@@ -287,7 +287,7 @@ export default function Dashboard({ overview }) {
|
|
|
287
287
|
<SectionTitle>agentic coding activity</SectionTitle>
|
|
288
288
|
<div className="flex gap-4">
|
|
289
289
|
<div className="min-w-0 flex-shrink-0">
|
|
290
|
-
{dailyData ? <ActivityHeatmap dailyData={dailyData} /> : <div className="text-[
|
|
290
|
+
{dailyData ? <ActivityHeatmap dailyData={dailyData} /> : <div className="text-[11px]" style={{ color: 'var(--c-text3)' }}>loading...</div>}
|
|
291
291
|
</div>
|
|
292
292
|
{stats && dailyData && (() => {
|
|
293
293
|
const activeDays = dailyData.filter(d => d.total > 0)
|
|
@@ -295,7 +295,7 @@ export default function Dashboard({ overview }) {
|
|
|
295
295
|
const totalSessions = activeDays.reduce((s, d) => s + d.total, 0)
|
|
296
296
|
const avgPerDay = activeDays.length > 0 ? (totalSessions / activeDays.length).toFixed(1) : 0
|
|
297
297
|
return (
|
|
298
|
-
<div className="flex-1 grid grid-cols-3 gap-3 text-[
|
|
298
|
+
<div className="flex-1 grid grid-cols-3 gap-3 text-[11px] min-w-0" style={{ borderLeft: '1px solid var(--c-border)', paddingLeft: 16 }}>
|
|
299
299
|
<div className="space-y-2 min-w-0">
|
|
300
300
|
<div>
|
|
301
301
|
<div style={{ color: 'var(--c-text3)' }} className="uppercase tracking-wider mb-1">streaks</div>
|
|
@@ -452,11 +452,11 @@ export default function Dashboard({ overview }) {
|
|
|
452
452
|
<div className="space-y-1 max-h-[180px] overflow-y-auto scrollbar-thin">
|
|
453
453
|
{d.topProjects.slice(0, 12).map(p => (
|
|
454
454
|
<div key={p.name} className="flex items-center gap-1.5">
|
|
455
|
-
<div className="text-[
|
|
455
|
+
<div className="text-[10px] w-6 text-right" style={{ color: 'var(--c-text2)' }}>{p.count}</div>
|
|
456
456
|
<div className="flex-1 h-3 rounded-sm overflow-hidden" style={{ background: 'var(--c-code-bg)' }}>
|
|
457
457
|
<div className="h-full bg-accent/30 rounded-sm" style={{ width: `${(p.count / maxProject * 100).toFixed(1)}%` }} />
|
|
458
458
|
</div>
|
|
459
|
-
<div className="text-[
|
|
459
|
+
<div className="text-[10px] truncate max-w-[140px]" style={{ color: 'var(--c-text2)' }} title={p.fullPath}>{p.name}</div>
|
|
460
460
|
</div>
|
|
461
461
|
))}
|
|
462
462
|
</div>
|
|
@@ -473,13 +473,13 @@ export default function Dashboard({ overview }) {
|
|
|
473
473
|
const maxM = stats.topModels[0].count
|
|
474
474
|
return (
|
|
475
475
|
<div key={m.name} className="flex items-center gap-2">
|
|
476
|
-
<span className="text-[
|
|
476
|
+
<span className="text-[10px] w-3 text-right" style={{ color: 'var(--c-text3)' }}>{i + 1}</span>
|
|
477
477
|
<div className="flex-1 h-4 rounded-sm overflow-hidden" style={{ background: 'var(--c-code-bg)' }}>
|
|
478
478
|
<div className="h-full rounded-sm flex items-center px-1.5" style={{ width: `${(m.count / maxM * 100).toFixed(1)}%`, background: i === 0 ? '#6366f1' : i === 1 ? '#818cf8' : '#a5b4fc40' }}>
|
|
479
479
|
<span className="text-[8px] truncate" style={{ color: i < 2 ? '#fff' : 'var(--c-text2)' }}>{m.name}</span>
|
|
480
480
|
</div>
|
|
481
481
|
</div>
|
|
482
|
-
<span className="text-[
|
|
482
|
+
<span className="text-[10px] w-8 text-right" style={{ color: 'var(--c-text3)' }}>{m.count}</span>
|
|
483
483
|
</div>
|
|
484
484
|
)
|
|
485
485
|
})}
|
|
@@ -495,13 +495,13 @@ export default function Dashboard({ overview }) {
|
|
|
495
495
|
const maxT = stats.topTools[0].count
|
|
496
496
|
return (
|
|
497
497
|
<div key={t.name} className="flex items-center gap-2">
|
|
498
|
-
<span className="text-[
|
|
498
|
+
<span className="text-[10px] w-3 text-right" style={{ color: 'var(--c-text3)' }}>{i + 1}</span>
|
|
499
499
|
<div className="flex-1 h-4 rounded-sm overflow-hidden" style={{ background: 'var(--c-code-bg)' }}>
|
|
500
500
|
<div className="h-full rounded-sm flex items-center px-1.5" style={{ width: `${(t.count / maxT * 100).toFixed(1)}%`, background: i === 0 ? '#10b981' : i === 1 ? '#34d399' : '#6ee7b740' }}>
|
|
501
501
|
<span className="text-[8px] truncate font-mono" style={{ color: i < 2 ? '#fff' : 'var(--c-text2)' }}>{t.name}</span>
|
|
502
502
|
</div>
|
|
503
503
|
</div>
|
|
504
|
-
<span className="text-[
|
|
504
|
+
<span className="text-[10px] w-8 text-right" style={{ color: 'var(--c-text3)' }}>{formatNumber(t.count)}</span>
|
|
505
505
|
</div>
|
|
506
506
|
)
|
|
507
507
|
})}
|
|
@@ -527,9 +527,9 @@ export default function Dashboard({ overview }) {
|
|
|
527
527
|
onClick={() => navigate(`/sessions/${c.id}`)}
|
|
528
528
|
>
|
|
529
529
|
<EditorIcon source={c.source} size={10} />
|
|
530
|
-
<span className="text-[
|
|
530
|
+
<span className="text-[10px] truncate flex-1" style={{ color: 'var(--c-text)' }}>{c.name || 'Untitled'}</span>
|
|
531
531
|
<span
|
|
532
|
-
className="text-[
|
|
532
|
+
className="text-[10px] font-bold flex-shrink-0"
|
|
533
533
|
style={{ color: c.bubbleCount >= 500 ? '#ef4444' : '#f59e0b' }}
|
|
534
534
|
>
|
|
535
535
|
{c.bubbleCount}
|
|
@@ -75,7 +75,7 @@ function DiffBlock({ diff }) {
|
|
|
75
75
|
const oldLines = (diff.old || '').split('\n').slice(0, maxLines)
|
|
76
76
|
const newLines = (diff.new || '').split('\n').slice(0, maxLines)
|
|
77
77
|
return (
|
|
78
|
-
<div className="mt-1 text-[
|
|
78
|
+
<div className="mt-1 text-[10px] font-mono overflow-x-auto" style={{ border: '1px solid var(--c-border)' }}>
|
|
79
79
|
{diff.file && (
|
|
80
80
|
<div className="px-2 py-0.5" style={{ background: 'var(--c-code-bg)', color: 'var(--c-text2)' }}>{diff.file}</div>
|
|
81
81
|
)}
|
|
@@ -107,7 +107,7 @@ function ToolCallRow({ call, toolName, index }) {
|
|
|
107
107
|
const hasDetail = diff || (call.args && Object.keys(call.args).length > 0)
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
|
-
<div className="px-2 py-1 text-[
|
|
110
|
+
<div className="px-2 py-1 text-[11px]" style={{ background: index % 2 === 0 ? 'var(--c-code-bg)' : 'transparent' }}>
|
|
111
111
|
<div className="flex items-start gap-2 cursor-pointer" onClick={() => hasDetail && setExpanded(!expanded)}>
|
|
112
112
|
<EditorIcon source={call.source} size={10} />
|
|
113
113
|
<div className="flex-1 min-w-0">
|
|
@@ -124,7 +124,7 @@ function ToolCallRow({ call, toolName, index }) {
|
|
|
124
124
|
</div>
|
|
125
125
|
{expanded && diff && <DiffBlock diff={diff} />}
|
|
126
126
|
{expanded && !diff && call.args && Object.keys(call.args).length > 0 && (
|
|
127
|
-
<pre className="mt-1 px-2 py-1 text-[
|
|
127
|
+
<pre className="mt-1 px-2 py-1 text-[10px] overflow-x-auto whitespace-pre-wrap break-all" style={{ background: 'var(--c-code-bg)', color: 'var(--c-text2)' }}>
|
|
128
128
|
{JSON.stringify(call.args, null, 2)}
|
|
129
129
|
</pre>
|
|
130
130
|
)}
|
|
@@ -148,7 +148,7 @@ function ToolDrillDown({ toolName, folder, onClose }) {
|
|
|
148
148
|
<div className="flex items-center gap-2">
|
|
149
149
|
<Wrench size={12} style={{ color: 'var(--c-accent)' }} />
|
|
150
150
|
<span className="text-xs font-bold" style={{ color: 'var(--c-white)' }}>{toolName}</span>
|
|
151
|
-
<span className="text-[
|
|
151
|
+
<span className="text-[11px]" style={{ color: 'var(--c-text2)' }}>
|
|
152
152
|
{calls ? `${calls.length} calls` : '...'}
|
|
153
153
|
{calls && projectName ? ` in ${projectName}` : ''}
|
|
154
154
|
</span>
|
|
@@ -156,7 +156,7 @@ function ToolDrillDown({ toolName, folder, onClose }) {
|
|
|
156
156
|
<button onClick={onClose} className="p-0.5" style={{ color: 'var(--c-text2)' }}><X size={12} /></button>
|
|
157
157
|
</div>
|
|
158
158
|
{loading ? (
|
|
159
|
-
<div className="text-[
|
|
159
|
+
<div className="text-[11px] py-4 text-center" style={{ color: 'var(--c-text3)' }}>loading...</div>
|
|
160
160
|
) : calls && calls.length > 0 ? (
|
|
161
161
|
<div className="max-h-[500px] overflow-y-auto scrollbar-thin space-y-0.5">
|
|
162
162
|
{calls.map((c, i) => (
|
|
@@ -164,7 +164,7 @@ function ToolDrillDown({ toolName, folder, onClose }) {
|
|
|
164
164
|
))}
|
|
165
165
|
</div>
|
|
166
166
|
) : (
|
|
167
|
-
<div className="text-[
|
|
167
|
+
<div className="text-[11px] py-4 text-center" style={{ color: 'var(--c-text3)' }}>no calls found</div>
|
|
168
168
|
)}
|
|
169
169
|
</div>
|
|
170
170
|
)
|
|
@@ -247,7 +247,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
247
247
|
<select
|
|
248
248
|
value={editor}
|
|
249
249
|
onChange={e => setEditor(e.target.value)}
|
|
250
|
-
className="px-2 py-1.5 text-[
|
|
250
|
+
className="px-2 py-1.5 text-[12px] outline-none rounded-sm"
|
|
251
251
|
style={{ background: 'var(--c-bg3)', color: 'var(--c-text)', border: '1px solid var(--c-border)' }}
|
|
252
252
|
>
|
|
253
253
|
<option value="">All Editors</option>
|
|
@@ -258,7 +258,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
258
258
|
<select
|
|
259
259
|
value={folder}
|
|
260
260
|
onChange={e => setFolder(e.target.value)}
|
|
261
|
-
className="px-2 py-1.5 text-[
|
|
261
|
+
className="px-2 py-1.5 text-[12px] outline-none max-w-[200px] truncate rounded-sm"
|
|
262
262
|
style={{ background: 'var(--c-bg3)', color: 'var(--c-text)', border: '1px solid var(--c-border)' }}
|
|
263
263
|
>
|
|
264
264
|
<option value="">All Projects</option>
|
|
@@ -267,7 +267,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
267
267
|
))}
|
|
268
268
|
</select>
|
|
269
269
|
{loading && <Loader2 size={11} className="animate-spin" style={{ color: 'var(--c-text3)' }} />}
|
|
270
|
-
{data && <span className="text-[
|
|
270
|
+
{data && <span className="text-[11px]" style={{ color: 'var(--c-text2)' }}>{data.analyzedChats} sessions analyzed</span>}
|
|
271
271
|
<div className="ml-auto"><DateRangePicker value={dateRange} onChange={setDateRange} /></div>
|
|
272
272
|
</div>
|
|
273
273
|
|
|
@@ -290,7 +290,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
290
290
|
<div className="space-y-3 mt-2">
|
|
291
291
|
{/* Input tokens breakdown */}
|
|
292
292
|
<div>
|
|
293
|
-
<div className="flex items-center justify-between text-[
|
|
293
|
+
<div className="flex items-center justify-between text-[11px] mb-1">
|
|
294
294
|
<span style={{ color: 'var(--c-text2)' }}>input tokens</span>
|
|
295
295
|
<span className="font-bold" style={{ color: 'var(--c-white)' }}>{formatNumber(data.totalInputTokens)}</span>
|
|
296
296
|
</div>
|
|
@@ -298,14 +298,14 @@ export default function DeepAnalysis({ overview }) {
|
|
|
298
298
|
{ label: 'Fresh input', value: data.totalInputTokens - data.totalCacheRead, color: '#6366f1' },
|
|
299
299
|
{ label: 'Cache read', value: data.totalCacheRead, color: '#34d399' },
|
|
300
300
|
]} />
|
|
301
|
-
<div className="flex items-center gap-3 mt-1 text-[
|
|
301
|
+
<div className="flex items-center gap-3 mt-1 text-[10px]">
|
|
302
302
|
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-sm" style={{ background: '#6366f1' }} /> fresh {formatNumber(data.totalInputTokens - data.totalCacheRead)}</span>
|
|
303
303
|
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-sm" style={{ background: '#34d399' }} /> cached {formatNumber(data.totalCacheRead)}</span>
|
|
304
304
|
</div>
|
|
305
305
|
</div>
|
|
306
306
|
{/* Output tokens */}
|
|
307
307
|
<div>
|
|
308
|
-
<div className="flex items-center justify-between text-[
|
|
308
|
+
<div className="flex items-center justify-between text-[11px] mb-1">
|
|
309
309
|
<span style={{ color: 'var(--c-text2)' }}>output tokens</span>
|
|
310
310
|
<span className="font-bold" style={{ color: 'var(--c-white)' }}>{formatNumber(data.totalOutputTokens)}</span>
|
|
311
311
|
</div>
|
|
@@ -316,7 +316,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
316
316
|
{/* Cache write */}
|
|
317
317
|
{data.totalCacheWrite > 0 && (
|
|
318
318
|
<div>
|
|
319
|
-
<div className="flex items-center justify-between text-[
|
|
319
|
+
<div className="flex items-center justify-between text-[11px] mb-1">
|
|
320
320
|
<span style={{ color: 'var(--c-text2)' }}>cache write</span>
|
|
321
321
|
<span className="font-bold" style={{ color: 'var(--c-white)' }}>{formatNumber(data.totalCacheWrite)}</span>
|
|
322
322
|
</div>
|
|
@@ -327,14 +327,14 @@ export default function DeepAnalysis({ overview }) {
|
|
|
327
327
|
)}
|
|
328
328
|
{/* Overall ratio bar */}
|
|
329
329
|
<div className="pt-2" style={{ borderTop: '1px solid var(--c-border)' }}>
|
|
330
|
-
<div className="text-[
|
|
330
|
+
<div className="text-[10px] mb-1" style={{ color: 'var(--c-text3)' }}>overall token distribution</div>
|
|
331
331
|
<ProportionBar height={10} segments={[
|
|
332
332
|
{ label: 'Input', value: data.totalInputTokens, color: '#6366f1' },
|
|
333
333
|
{ label: 'Output', value: data.totalOutputTokens, color: '#a78bfa' },
|
|
334
334
|
{ label: 'Cache Read', value: data.totalCacheRead, color: '#34d399' },
|
|
335
335
|
{ label: 'Cache Write', value: data.totalCacheWrite, color: '#fbbf24' },
|
|
336
336
|
]} />
|
|
337
|
-
<div className="flex items-center gap-3 mt-1 text-[
|
|
337
|
+
<div className="flex items-center gap-3 mt-1 text-[10px]" style={{ color: 'var(--c-text3)' }}>
|
|
338
338
|
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-sm" style={{ background: '#6366f1' }} /> in</span>
|
|
339
339
|
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-sm" style={{ background: '#a78bfa' }} /> out</span>
|
|
340
340
|
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-sm" style={{ background: '#34d399' }} /> cache read</span>
|
|
@@ -350,12 +350,12 @@ export default function DeepAnalysis({ overview }) {
|
|
|
350
350
|
<div className="space-y-3 mt-2">
|
|
351
351
|
{/* Human vs AI chars */}
|
|
352
352
|
<div>
|
|
353
|
-
<div className="text-[
|
|
353
|
+
<div className="text-[11px] mb-1" style={{ color: 'var(--c-text2)' }}>you vs AI (characters)</div>
|
|
354
354
|
<ProportionBar height={8} segments={[
|
|
355
355
|
{ label: 'You', value: data.totalUserChars, color: '#6366f1' },
|
|
356
356
|
{ label: 'AI', value: data.totalAssistantChars, color: '#34d399' },
|
|
357
357
|
]} />
|
|
358
|
-
<div className="flex items-center justify-between mt-1 text-[
|
|
358
|
+
<div className="flex items-center justify-between mt-1 text-[10px]">
|
|
359
359
|
<span style={{ color: '#6366f1' }}>You: {formatNumber(data.totalUserChars)}</span>
|
|
360
360
|
<span style={{ color: '#34d399' }}>AI: {formatNumber(data.totalAssistantChars)}</span>
|
|
361
361
|
</div>
|
|
@@ -364,25 +364,25 @@ export default function DeepAnalysis({ overview }) {
|
|
|
364
364
|
{/* Metric cards */}
|
|
365
365
|
<div className="grid grid-cols-2 gap-2">
|
|
366
366
|
<div className="p-2 rounded-sm" style={{ background: 'var(--c-code-bg)' }}>
|
|
367
|
-
<div className="flex items-center gap-1 text-[
|
|
367
|
+
<div className="flex items-center gap-1 text-[10px]" style={{ color: 'var(--c-text3)' }}>
|
|
368
368
|
<TrendingUp size={9} /> output/input ratio
|
|
369
369
|
</div>
|
|
370
370
|
<div className="text-sm font-bold mt-0.5" style={{ color: 'var(--c-white)' }}>{insights.outputRatio}×</div>
|
|
371
371
|
</div>
|
|
372
372
|
<div className="p-2 rounded-sm" style={{ background: 'var(--c-code-bg)' }}>
|
|
373
|
-
<div className="flex items-center gap-1 text-[
|
|
373
|
+
<div className="flex items-center gap-1 text-[10px]" style={{ color: 'var(--c-text3)' }}>
|
|
374
374
|
<Zap size={9} /> cache hit rate
|
|
375
375
|
</div>
|
|
376
376
|
<div className="text-sm font-bold mt-0.5" style={{ color: parseFloat(insights.cacheHitRate) > 50 ? '#34d399' : parseFloat(insights.cacheHitRate) > 20 ? '#fbbf24' : 'var(--c-white)' }}>{insights.cacheHitRate}%</div>
|
|
377
377
|
</div>
|
|
378
378
|
<div className="p-2 rounded-sm" style={{ background: 'var(--c-code-bg)' }}>
|
|
379
|
-
<div className="flex items-center gap-1 text-[
|
|
379
|
+
<div className="flex items-center gap-1 text-[10px]" style={{ color: 'var(--c-text3)' }}>
|
|
380
380
|
<MessageSquare size={9} /> tokens per message
|
|
381
381
|
</div>
|
|
382
382
|
<div className="text-sm font-bold mt-0.5" style={{ color: 'var(--c-white)' }}>{formatNumber(insights.tokPerMsg)}</div>
|
|
383
383
|
</div>
|
|
384
384
|
<div className="p-2 rounded-sm" style={{ background: 'var(--c-code-bg)' }}>
|
|
385
|
-
<div className="flex items-center gap-1 text-[
|
|
385
|
+
<div className="flex items-center gap-1 text-[10px]" style={{ color: 'var(--c-text3)' }}>
|
|
386
386
|
<Wrench size={9} /> tools per session
|
|
387
387
|
</div>
|
|
388
388
|
<div className="text-sm font-bold mt-0.5" style={{ color: 'var(--c-white)' }}>{insights.toolsPerSession}</div>
|
|
@@ -391,9 +391,9 @@ export default function DeepAnalysis({ overview }) {
|
|
|
391
391
|
|
|
392
392
|
{/* AI amplification */}
|
|
393
393
|
<div className="p-2 rounded-sm text-center" style={{ background: 'var(--c-code-bg)' }}>
|
|
394
|
-
<div className="text-[
|
|
394
|
+
<div className="text-[10px]" style={{ color: 'var(--c-text3)' }}>AI amplification factor</div>
|
|
395
395
|
<div className="text-lg font-bold" style={{ color: 'var(--c-accent)' }}>{insights.aiVsHuman}×</div>
|
|
396
|
-
<div className="text-[
|
|
396
|
+
<div className="text-[10px]" style={{ color: 'var(--c-text3)' }}>AI writes {insights.aiVsHuman}× more than you type</div>
|
|
397
397
|
</div>
|
|
398
398
|
</div>
|
|
399
399
|
</div>
|
|
@@ -424,7 +424,7 @@ export default function DeepAnalysis({ overview }) {
|
|
|
424
424
|
plugins: { legend: { display: false }, tooltip: { bodyFont: { family: MONO, size: 10 }, titleFont: { family: MONO, size: 10 } } },
|
|
425
425
|
}}
|
|
426
426
|
/>
|
|
427
|
-
) : <div className="text-[
|
|
427
|
+
) : <div className="text-[11px] text-center py-8" style={{ color: 'var(--c-text3)' }}>no tool calls found</div>}
|
|
428
428
|
</div>
|
|
429
429
|
</div>
|
|
430
430
|
|
|
@@ -446,16 +446,16 @@ export default function DeepAnalysis({ overview }) {
|
|
|
446
446
|
},
|
|
447
447
|
}}
|
|
448
448
|
/>
|
|
449
|
-
) : <div className="text-[
|
|
449
|
+
) : <div className="text-[11px] text-center py-8" style={{ color: 'var(--c-text3)' }}>no model data</div>}
|
|
450
450
|
</div>
|
|
451
451
|
|
|
452
452
|
{/* Tool categories below models */}
|
|
453
453
|
{toolCategories.length > 0 && (
|
|
454
454
|
<div className="mt-3 pt-3" style={{ borderTop: '1px solid var(--c-border)' }}>
|
|
455
|
-
<div className="text-[
|
|
455
|
+
<div className="text-[10px] uppercase tracking-wider mb-2" style={{ color: 'var(--c-text3)' }}>tool categories</div>
|
|
456
456
|
<div className="space-y-1.5">
|
|
457
457
|
{toolCategories.map(([cat, { tools: catTools, total }]) => (
|
|
458
|
-
<div key={cat} className="flex items-center gap-2 text-[
|
|
458
|
+
<div key={cat} className="flex items-center gap-2 text-[11px]">
|
|
459
459
|
<span className="truncate flex-1" style={{ color: 'var(--c-text2)' }}>{cat}</span>
|
|
460
460
|
<span className="font-bold" style={{ color: 'var(--c-white)' }}>{total}</span>
|
|
461
461
|
<span style={{ color: 'var(--c-text3)' }}>({catTools.length})</span>
|