@ekkos/cli 1.0.20 → 1.0.22
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/dist/commands/dashboard.js +34 -12
- package/package.json +1 -1
|
@@ -446,7 +446,8 @@ async function waitForNewSession() {
|
|
|
446
446
|
const jsonlPath = allNewJsonl[0].path;
|
|
447
447
|
// Derive name from filename (e.g. abc123.jsonl → use candidateName if set, else basename)
|
|
448
448
|
const baseName = path.basename(jsonlPath, '.jsonl');
|
|
449
|
-
const
|
|
449
|
+
const derivedName = /^[0-9a-f]{8}-/.test(baseName) ? (0, state_js_1.uuidToWords)(baseName) : baseName;
|
|
450
|
+
const name = candidateName || derivedName;
|
|
450
451
|
console.log(chalk_1.default.green(` Found session via scan: ${name}`));
|
|
451
452
|
return { sessionName: name, jsonlPath };
|
|
452
453
|
}
|
|
@@ -697,6 +698,13 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
697
698
|
footerBox.left = H_PAD;
|
|
698
699
|
footerBox.width = contentWidth;
|
|
699
700
|
footerBox.height = layout.footer.height;
|
|
701
|
+
// Force blessed-contrib to re-render the chart canvas at the new dimensions
|
|
702
|
+
if (lastChartSeries) {
|
|
703
|
+
try {
|
|
704
|
+
tokenChart.setData(lastChartSeries);
|
|
705
|
+
}
|
|
706
|
+
catch { }
|
|
707
|
+
}
|
|
700
708
|
}
|
|
701
709
|
// Track geometry so we can re-anchor widgets even if tmux resize events are flaky
|
|
702
710
|
let lastLayoutW = screen.width || 0;
|
|
@@ -766,6 +774,7 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
766
774
|
// ── Update function ──
|
|
767
775
|
let lastFileSize = 0;
|
|
768
776
|
let lastData = null;
|
|
777
|
+
let lastChartSeries = null;
|
|
769
778
|
let lastScrollPerc = 0; // Preserve scroll position across updates
|
|
770
779
|
const debugLog = path.join(os.homedir(), '.ekkos', 'dashboard.log');
|
|
771
780
|
function dlog(msg) {
|
|
@@ -848,11 +857,12 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
848
857
|
const recent = data.turns.slice(-30);
|
|
849
858
|
if (recent.length >= 2) {
|
|
850
859
|
const x = recent.map(t => String(t.turn));
|
|
851
|
-
|
|
860
|
+
lastChartSeries = [
|
|
852
861
|
{ title: 'Rd', x, y: recent.map(t => Math.round(t.cacheRead / 1000)), style: { line: 'green' } },
|
|
853
862
|
{ title: 'Wr', x, y: recent.map(t => Math.round(t.cacheCreate / 1000)), style: { line: 'yellow' } },
|
|
854
863
|
{ title: 'Out', x, y: recent.map(t => Math.round(t.output / 1000)), style: { line: 'cyan' } },
|
|
855
|
-
]
|
|
864
|
+
];
|
|
865
|
+
tokenChart.setData(lastChartSeries);
|
|
856
866
|
}
|
|
857
867
|
}
|
|
858
868
|
catch (err) {
|
|
@@ -974,6 +984,7 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
974
984
|
const savingsStr = totalSavings > 0
|
|
975
985
|
? ` {green-fg}saved $${totalSavings.toFixed(2)}{/green-fg}`
|
|
976
986
|
: '';
|
|
987
|
+
footerBox.setLabel(` ${sessionName} `);
|
|
977
988
|
footerBox.setContent(` {green-fg}$${data.totalCost.toFixed(2)}{/green-fg}` +
|
|
978
989
|
` ${totalTokensM}M` +
|
|
979
990
|
` ${routingStr}` +
|
|
@@ -1078,10 +1089,19 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
1078
1089
|
screen.on('resize', () => {
|
|
1079
1090
|
try {
|
|
1080
1091
|
ensureLayoutSynced();
|
|
1081
|
-
if (lastData)
|
|
1092
|
+
if (lastData) {
|
|
1082
1093
|
updateDashboard();
|
|
1083
|
-
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
// Even without data, re-apply chart series so the canvas redraws at new size
|
|
1097
|
+
if (lastChartSeries) {
|
|
1098
|
+
try {
|
|
1099
|
+
tokenChart.setData(lastChartSeries);
|
|
1100
|
+
}
|
|
1101
|
+
catch { }
|
|
1102
|
+
}
|
|
1084
1103
|
screen.render();
|
|
1104
|
+
}
|
|
1085
1105
|
}
|
|
1086
1106
|
catch (err) {
|
|
1087
1107
|
dlog(`Resize: ${err.message}`);
|
|
@@ -1165,13 +1185,15 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
1165
1185
|
});
|
|
1166
1186
|
screen.append(help);
|
|
1167
1187
|
screen.render();
|
|
1168
|
-
//
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1188
|
+
// Defer listener so the '?' keypress that opened help doesn't immediately close it
|
|
1189
|
+
setImmediate(() => {
|
|
1190
|
+
const closeHelp = () => {
|
|
1191
|
+
help.destroy();
|
|
1192
|
+
screen.render();
|
|
1193
|
+
screen.removeListener('key', closeHelp);
|
|
1194
|
+
};
|
|
1195
|
+
screen.once('key', closeHelp);
|
|
1196
|
+
});
|
|
1175
1197
|
});
|
|
1176
1198
|
// Clear terminal buffer — prevents garbage text from previous commands
|
|
1177
1199
|
screen.program.clear();
|