exe-watcher 0.2.0 → 0.2.1
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/cli.js +29 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1628,6 +1628,28 @@ function aggregateProjectsIntoDays(projects) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return [...byDate.values()].sort((a, b) => a.date.localeCompare(b.date));
|
|
1630
1630
|
}
|
|
1631
|
+
function filterDaysToProvider(days, provider) {
|
|
1632
|
+
return days.map((d) => {
|
|
1633
|
+
const p = d.providers[provider];
|
|
1634
|
+
if (!p) return null;
|
|
1635
|
+
return {
|
|
1636
|
+
...d,
|
|
1637
|
+
cost: p.cost,
|
|
1638
|
+
calls: p.calls,
|
|
1639
|
+
// sessions count is not per-provider in cache — approximate at 0
|
|
1640
|
+
sessions: 0,
|
|
1641
|
+
inputTokens: 0,
|
|
1642
|
+
outputTokens: 0,
|
|
1643
|
+
cacheReadTokens: 0,
|
|
1644
|
+
cacheWriteTokens: 0,
|
|
1645
|
+
editTurns: 0,
|
|
1646
|
+
oneShotTurns: 0,
|
|
1647
|
+
models: {},
|
|
1648
|
+
categories: {},
|
|
1649
|
+
providers: { [provider]: p }
|
|
1650
|
+
};
|
|
1651
|
+
}).filter((d) => d !== null);
|
|
1652
|
+
}
|
|
1631
1653
|
function buildPeriodDataFromDays(days, label) {
|
|
1632
1654
|
let cost = 0, calls = 0, sessions = 0;
|
|
1633
1655
|
let inputTokens = 0, outputTokens = 0, cacheReadTokens = 0, cacheWriteTokens = 0;
|
|
@@ -6770,20 +6792,20 @@ program.command("status").description("Compact status output (today + week + mon
|
|
|
6770
6792
|
const todayRange = { start: todayStart, end: periodInfo.range.end };
|
|
6771
6793
|
const todayProjects = fp(await parseAllSessions(todayRange, "all"));
|
|
6772
6794
|
const todayDays = aggregateProjectsIntoDays(todayProjects);
|
|
6773
|
-
|
|
6795
|
+
{
|
|
6774
6796
|
const rangeStartStr = toDateString(periodInfo.range.start);
|
|
6775
6797
|
const rangeEndStr = toDateString(periodInfo.range.end);
|
|
6776
6798
|
const historicalDays = getDaysInRange(cache, rangeStartStr, yesterdayStr);
|
|
6777
6799
|
const todayOnly = todayDays.filter((d) => d.date > yesterdayStr && d.date <= rangeEndStr);
|
|
6778
6800
|
const allDays = [...historicalDays, ...todayOnly].sort((a, b) => a.date.localeCompare(b.date));
|
|
6779
|
-
|
|
6801
|
+
if (isAllProviders) {
|
|
6802
|
+
currentData = buildPeriodDataFromDays(allDays, periodInfo.label);
|
|
6803
|
+
} else {
|
|
6804
|
+
const providerDays = filterDaysToProvider(allDays, pf);
|
|
6805
|
+
currentData = buildPeriodDataFromDays(providerDays, periodInfo.label);
|
|
6806
|
+
}
|
|
6780
6807
|
scanProjects = todayProjects;
|
|
6781
6808
|
scanRange = periodInfo.range;
|
|
6782
|
-
} else {
|
|
6783
|
-
const projects = fp(await parseAllSessions(periodInfo.range, pf));
|
|
6784
|
-
currentData = buildPeriodData(periodInfo.label, projects);
|
|
6785
|
-
scanProjects = projects;
|
|
6786
|
-
scanRange = periodInfo.range;
|
|
6787
6809
|
}
|
|
6788
6810
|
const allProviders = await getAllProviders();
|
|
6789
6811
|
const displayNameByName = new Map(allProviders.map((p) => [p.name, p.displayName]));
|