claude-burn 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/public/renderChart.js
CHANGED
|
@@ -5,6 +5,10 @@ export function destroyChart(state) {
|
|
|
5
5
|
state.chart.destroy();
|
|
6
6
|
state.chart = null;
|
|
7
7
|
}
|
|
8
|
+
if (state.contextChart) {
|
|
9
|
+
state.contextChart.destroy();
|
|
10
|
+
state.contextChart = null;
|
|
11
|
+
}
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
export function renderChart(state, session) {
|
|
@@ -43,6 +47,7 @@ export function renderChart(state, session) {
|
|
|
43
47
|
options: {
|
|
44
48
|
responsive: true,
|
|
45
49
|
maintainAspectRatio: false,
|
|
50
|
+
animation: false,
|
|
46
51
|
plugins: {
|
|
47
52
|
legend: { display: false },
|
|
48
53
|
tooltip: {
|
|
@@ -77,4 +82,65 @@ export function renderChart(state, session) {
|
|
|
77
82
|
},
|
|
78
83
|
},
|
|
79
84
|
});
|
|
85
|
+
|
|
86
|
+
// Context size per message chart
|
|
87
|
+
const contextCanvas = document.getElementById('context-chart');
|
|
88
|
+
if (!contextCanvas) return;
|
|
89
|
+
|
|
90
|
+
const contextData = timeline.map((point) => point.context || 0);
|
|
91
|
+
const hasContextData = contextData.some((v) => v > 0);
|
|
92
|
+
if (!hasContextData) return;
|
|
93
|
+
|
|
94
|
+
state.contextChart = new globalThis.Chart(contextCanvas, {
|
|
95
|
+
type: 'line',
|
|
96
|
+
data: {
|
|
97
|
+
labels,
|
|
98
|
+
datasets: [{
|
|
99
|
+
data: contextData,
|
|
100
|
+
borderColor: '#f59e0b',
|
|
101
|
+
backgroundColor: 'rgba(245,158,11,0.08)',
|
|
102
|
+
fill: true,
|
|
103
|
+
tension: 0.3,
|
|
104
|
+
pointRadius: 0,
|
|
105
|
+
borderWidth: 1.5,
|
|
106
|
+
}],
|
|
107
|
+
},
|
|
108
|
+
options: {
|
|
109
|
+
responsive: true,
|
|
110
|
+
maintainAspectRatio: false,
|
|
111
|
+
animation: false,
|
|
112
|
+
plugins: {
|
|
113
|
+
legend: { display: false },
|
|
114
|
+
tooltip: {
|
|
115
|
+
backgroundColor: '#e4e4e7',
|
|
116
|
+
titleColor: '#09090b',
|
|
117
|
+
bodyColor: '#09090b',
|
|
118
|
+
bodyFont: { family: "'Geist Mono'", size: 11 },
|
|
119
|
+
titleFont: { family: "'Geist Mono'", size: 10 },
|
|
120
|
+
padding: 8,
|
|
121
|
+
cornerRadius: 6,
|
|
122
|
+
displayColors: false,
|
|
123
|
+
callbacks: {
|
|
124
|
+
label: (ctx) => `${fmt(ctx.raw)} context`,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
scales: {
|
|
129
|
+
x: {
|
|
130
|
+
ticks: { color: '#52525b', font: { size: 10, family: "'Geist Mono'" }, maxTicksLimit: 6 },
|
|
131
|
+
grid: { color: 'rgba(39,39,42,0.5)' },
|
|
132
|
+
border: { display: false },
|
|
133
|
+
},
|
|
134
|
+
y: {
|
|
135
|
+
ticks: {
|
|
136
|
+
color: '#52525b',
|
|
137
|
+
font: { size: 10, family: "'Geist Mono'" },
|
|
138
|
+
callback: (value) => fmt(value),
|
|
139
|
+
},
|
|
140
|
+
grid: { color: 'rgba(39,39,42,0.3)' },
|
|
141
|
+
border: { display: false },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
80
146
|
}
|
package/public/renderDetail.js
CHANGED
|
@@ -139,6 +139,13 @@ export function renderDetail(state) {
|
|
|
139
139
|
<canvas id="timeline-chart"></canvas>
|
|
140
140
|
</div>
|
|
141
141
|
</div>
|
|
142
|
+
|
|
143
|
+
<div class="detail-section">
|
|
144
|
+
<h3>Context Size <span class="tip" data-tip="Cache read tokens per API call — shows the actual context size sent each turn. Drops indicate /compact or context compression. Lower is cheaper.">?</span></h3>
|
|
145
|
+
<div class="chart-container">
|
|
146
|
+
<canvas id="context-chart"></canvas>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
142
149
|
`;
|
|
143
150
|
|
|
144
151
|
renderChart(state, session);
|
|
@@ -42,6 +42,7 @@ function buildCumulativeTimeline(timeline) {
|
|
|
42
42
|
cumulativeTimeline.push({
|
|
43
43
|
ts: timeline[i].ts,
|
|
44
44
|
cumulative,
|
|
45
|
+
context: timeline[i].cache_read || 0,
|
|
45
46
|
agent: timeline[i].agent,
|
|
46
47
|
});
|
|
47
48
|
}
|
|
@@ -195,7 +196,7 @@ function buildSessionAggregate(sessionPath, options = {}) {
|
|
|
195
196
|
stats.messages++;
|
|
196
197
|
|
|
197
198
|
if (ts) {
|
|
198
|
-
timeline.push({ ts, tokens: totalTokensForMessage, agent: agentName });
|
|
199
|
+
timeline.push({ ts, tokens: totalTokensForMessage, cache_read: cacheReadTokens, agent: agentName });
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
}
|