@ekkos/cli 1.0.18 → 1.0.20
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.
|
@@ -412,7 +412,7 @@ async function waitForNewSession() {
|
|
|
412
412
|
if (launchCwd) {
|
|
413
413
|
const latestJsonl = findLatestJsonl(launchCwd, launchTs);
|
|
414
414
|
if (latestJsonl) {
|
|
415
|
-
const name = candidateName || '
|
|
415
|
+
const name = candidateName || path.basename(latestJsonl, '.jsonl');
|
|
416
416
|
console.log(chalk_1.default.green(` Found session via CWD: ${name}`));
|
|
417
417
|
return { sessionName: name, jsonlPath: latestJsonl };
|
|
418
418
|
}
|
|
@@ -443,9 +443,12 @@ async function waitForNewSession() {
|
|
|
443
443
|
})
|
|
444
444
|
.sort((a, b) => b.birthtime - a.birthtime);
|
|
445
445
|
if (allNewJsonl.length > 0) {
|
|
446
|
-
const
|
|
446
|
+
const jsonlPath = allNewJsonl[0].path;
|
|
447
|
+
// Derive name from filename (e.g. abc123.jsonl → use candidateName if set, else basename)
|
|
448
|
+
const baseName = path.basename(jsonlPath, '.jsonl');
|
|
449
|
+
const name = candidateName || baseName;
|
|
447
450
|
console.log(chalk_1.default.green(` Found session via scan: ${name}`));
|
|
448
|
-
return { sessionName: name, jsonlPath
|
|
451
|
+
return { sessionName: name, jsonlPath };
|
|
449
452
|
}
|
|
450
453
|
}
|
|
451
454
|
}
|
|
@@ -564,7 +567,7 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
564
567
|
function calcLayout() {
|
|
565
568
|
const H = screen.height;
|
|
566
569
|
const remaining = Math.max(6, H - FIXED_H);
|
|
567
|
-
const chartH = Math.max(
|
|
570
|
+
const chartH = Math.max(8, Math.floor(remaining * 0.30));
|
|
568
571
|
const tableH = Math.max(4, remaining - chartH);
|
|
569
572
|
return {
|
|
570
573
|
header: { top: 0, height: HEADER_H },
|
|
@@ -996,12 +999,20 @@ async function launchDashboard(initialSessionName, jsonlPath, refreshMs) {
|
|
|
996
999
|
*/
|
|
997
1000
|
async function fetchAnthropicUsage() {
|
|
998
1001
|
try {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1002
|
+
let token = null;
|
|
1003
|
+
if (process.platform === 'darwin') {
|
|
1004
|
+
const { execSync } = require('child_process');
|
|
1005
|
+
const credsJson = execSync('security find-generic-password -s "Claude Code-credentials" -w', { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
1006
|
+
token = JSON.parse(credsJson)?.claudeAiOauth?.accessToken ?? null;
|
|
1007
|
+
}
|
|
1008
|
+
else if (process.platform === 'win32') {
|
|
1009
|
+
// Windows: Claude Code stores credentials in ~/.claude/.credentials.json
|
|
1010
|
+
const credsPath = path.join(os.homedir(), '.claude', '.credentials.json');
|
|
1011
|
+
if (fs.existsSync(credsPath)) {
|
|
1012
|
+
const creds = JSON.parse(fs.readFileSync(credsPath, 'utf-8'));
|
|
1013
|
+
token = creds?.claudeAiOauth?.accessToken ?? null;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1005
1016
|
if (!token)
|
|
1006
1017
|
return null;
|
|
1007
1018
|
const resp = await fetch('https://api.anthropic.com/api/oauth/usage', {
|
|
@@ -582,12 +582,19 @@ async function launchSwarmDashboard(launchTs, refreshMs) {
|
|
|
582
582
|
// ── Usage window (Anthropic OAuth) ──
|
|
583
583
|
async function fetchAnthropicUsage() {
|
|
584
584
|
try {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
585
|
+
let token = null;
|
|
586
|
+
if (process.platform === 'darwin') {
|
|
587
|
+
const { execSync } = require('child_process');
|
|
588
|
+
const credsJson = execSync('security find-generic-password -s "Claude Code-credentials" -w', { encoding: 'utf-8', timeout: 5000 }).trim();
|
|
589
|
+
token = JSON.parse(credsJson)?.claudeAiOauth?.accessToken ?? null;
|
|
590
|
+
}
|
|
591
|
+
else if (process.platform === 'win32') {
|
|
592
|
+
const credsPath = path.join(os.homedir(), '.claude', '.credentials.json');
|
|
593
|
+
if (require('fs').existsSync(credsPath)) {
|
|
594
|
+
const creds = JSON.parse(require('fs').readFileSync(credsPath, 'utf-8'));
|
|
595
|
+
token = creds?.claudeAiOauth?.accessToken ?? null;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
591
598
|
if (!token)
|
|
592
599
|
return null;
|
|
593
600
|
const resp = await fetch('https://api.anthropic.com/api/oauth/usage', {
|