claude-cost-cry 0.3.0
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/LICENSE +21 -0
- package/README.ko.md +173 -0
- package/README.md +174 -0
- package/bin/cli.js +333 -0
- package/dist/calculator.d.ts +8 -0
- package/dist/calculator.js +74 -0
- package/dist/calculator.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +49 -0
- package/dist/config.js.map +1 -0
- package/dist/display.d.ts +11 -0
- package/dist/display.js +204 -0
- package/dist/display.js.map +1 -0
- package/dist/exchange.d.ts +5 -0
- package/dist/exchange.js +104 -0
- package/dist/exchange.js.map +1 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +176 -0
- package/dist/history.js.map +1 -0
- package/dist/i18n.d.ts +9 -0
- package/dist/i18n.js +34 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/en.d.ts +191 -0
- package/dist/locales/en.js +204 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/ko.d.ts +191 -0
- package/dist/locales/ko.js +204 -0
- package/dist/locales/ko.js.map +1 -0
- package/dist/messages.d.ts +9 -0
- package/dist/messages.js +73 -0
- package/dist/messages.js.map +1 -0
- package/dist/parser.d.ts +2 -0
- package/dist/parser.js +21 -0
- package/dist/parser.js.map +1 -0
- package/dist/pricing.d.ts +6 -0
- package/dist/pricing.js +49 -0
- package/dist/pricing.js.map +1 -0
- package/dist/providers/claude.d.ts +3 -0
- package/dist/providers/claude.js +79 -0
- package/dist/providers/claude.js.map +1 -0
- package/dist/providers/cursor.d.ts +9 -0
- package/dist/providers/cursor.js +217 -0
- package/dist/providers/cursor.js.map +1 -0
- package/dist/providers/google.d.ts +3 -0
- package/dist/providers/google.js +72 -0
- package/dist/providers/google.js.map +1 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.js +41 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/openai.d.ts +3 -0
- package/dist/providers/openai.js +90 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/report.d.ts +36 -0
- package/dist/report.js +203 -0
- package/dist/report.js.map +1 -0
- package/dist/types.d.ts +137 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/watcher.d.ts +12 -0
- package/dist/watcher.js +222 -0
- package/dist/watcher.js.map +1 -0
- package/electron/main.js +405 -0
- package/electron/overlay.html +1390 -0
- package/electron/package.json +1 -0
- package/electron/preload.js +15 -0
- package/package.json +65 -0
package/dist/history.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { readFile, readdir } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { calculateCost } from './calculator.js';
|
|
4
|
+
import { loadConfig } from './config.js';
|
|
5
|
+
import { buildLogSources } from './watcher.js';
|
|
6
|
+
import { getProvider } from './providers/index.js';
|
|
7
|
+
import { t } from './i18n.js';
|
|
8
|
+
function toDateKey(timestamp) {
|
|
9
|
+
const d = new Date(timestamp);
|
|
10
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
11
|
+
}
|
|
12
|
+
function getDayOfWeek(dateKey) {
|
|
13
|
+
const dayKeys = ['days.sun', 'days.mon', 'days.tue', 'days.wed', 'days.thu', 'days.fri', 'days.sat'];
|
|
14
|
+
return t(dayKeys[new Date(dateKey).getDay()]);
|
|
15
|
+
}
|
|
16
|
+
function parseLine(line) {
|
|
17
|
+
const trimmed = line.trim();
|
|
18
|
+
if (!trimmed)
|
|
19
|
+
return null;
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(trimmed);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function aggregateByDate(daysBack = 30) {
|
|
28
|
+
const config = loadConfig();
|
|
29
|
+
const sources = buildLogSources(config);
|
|
30
|
+
if (sources.length === 0)
|
|
31
|
+
return [];
|
|
32
|
+
const cutoff = new Date();
|
|
33
|
+
cutoff.setDate(cutoff.getDate() - daysBack);
|
|
34
|
+
cutoff.setHours(0, 0, 0, 0);
|
|
35
|
+
const cutoffMs = cutoff.getTime();
|
|
36
|
+
const dailyMap = new Map();
|
|
37
|
+
function addUsage(dateKey, cost, modelLabel, providerName) {
|
|
38
|
+
if (!dailyMap.has(dateKey)) {
|
|
39
|
+
dailyMap.set(dateKey, {
|
|
40
|
+
date: dateKey,
|
|
41
|
+
day: getDayOfWeek(dateKey),
|
|
42
|
+
totalCost: 0,
|
|
43
|
+
callCount: 0,
|
|
44
|
+
models: {},
|
|
45
|
+
providers: {},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const day = dailyMap.get(dateKey);
|
|
49
|
+
day.totalCost += cost;
|
|
50
|
+
day.callCount++;
|
|
51
|
+
if (!day.models[modelLabel]) {
|
|
52
|
+
day.models[modelLabel] = { cost: 0, calls: 0, provider: providerName };
|
|
53
|
+
}
|
|
54
|
+
day.models[modelLabel].cost += cost;
|
|
55
|
+
day.models[modelLabel].calls++;
|
|
56
|
+
day.providers[providerName] = (day.providers[providerName] || 0) + cost;
|
|
57
|
+
}
|
|
58
|
+
for (const source of sources) {
|
|
59
|
+
const provider = getProvider(source.provider);
|
|
60
|
+
if (!provider)
|
|
61
|
+
continue;
|
|
62
|
+
if (source.isApi) {
|
|
63
|
+
try {
|
|
64
|
+
let page = 1;
|
|
65
|
+
while (true) {
|
|
66
|
+
const data = await provider.fetchUsageEvents(cutoffMs, Date.now(), page, 100);
|
|
67
|
+
const events = data.usageEventsDisplay || [];
|
|
68
|
+
for (const ev of events) {
|
|
69
|
+
const usage = provider.parseApiEvent(ev);
|
|
70
|
+
const cost = provider.calculateCost(usage);
|
|
71
|
+
const dateKey = toDateKey(usage.timestamp);
|
|
72
|
+
const modelLabel = provider.getModelLabel(usage.model);
|
|
73
|
+
addUsage(dateKey, cost, modelLabel, source.provider);
|
|
74
|
+
}
|
|
75
|
+
if (events.length < 100)
|
|
76
|
+
break;
|
|
77
|
+
page++;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// skip on API failure
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const files = await findJsonlFiles(source.path);
|
|
86
|
+
for (const filePath of files) {
|
|
87
|
+
try {
|
|
88
|
+
const content = await readFile(filePath, 'utf-8');
|
|
89
|
+
const lines = content.split('\n');
|
|
90
|
+
for (const line of lines) {
|
|
91
|
+
const entry = parseLine(line);
|
|
92
|
+
if (!entry)
|
|
93
|
+
continue;
|
|
94
|
+
const usage = provider.parseLogLine(entry);
|
|
95
|
+
if (!usage)
|
|
96
|
+
continue;
|
|
97
|
+
const entryTime = new Date(usage.timestamp).getTime();
|
|
98
|
+
if (entryTime < cutoffMs)
|
|
99
|
+
continue;
|
|
100
|
+
const cost = calculateCost(usage);
|
|
101
|
+
const dateKey = toDateKey(usage.timestamp);
|
|
102
|
+
const modelLabel = provider.getModelLabel(usage.model);
|
|
103
|
+
addUsage(dateKey, cost, modelLabel, source.provider);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// skip
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const days = Array.from(dailyMap.values());
|
|
112
|
+
days.sort((a, b) => a.date.localeCompare(b.date));
|
|
113
|
+
const result = [];
|
|
114
|
+
if (days.length > 0) {
|
|
115
|
+
const startDate = new Date(days[0].date);
|
|
116
|
+
const endDate = new Date(days[days.length - 1].date);
|
|
117
|
+
const dayMap = new Map(days.map(d => [d.date, d]));
|
|
118
|
+
for (let d = new Date(startDate); d <= endDate; d.setDate(d.getDate() + 1)) {
|
|
119
|
+
const key = toDateKey(d.toISOString());
|
|
120
|
+
result.push(dayMap.get(key) || {
|
|
121
|
+
date: key,
|
|
122
|
+
day: getDayOfWeek(key),
|
|
123
|
+
totalCost: 0,
|
|
124
|
+
callCount: 0,
|
|
125
|
+
models: {},
|
|
126
|
+
providers: {},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
export function computeStats(dailyData) {
|
|
133
|
+
if (dailyData.length === 0) {
|
|
134
|
+
return { totalCost: 0, avgDaily: 0, maxDay: null, minDay: null, totalCalls: 0, daysActive: 0 };
|
|
135
|
+
}
|
|
136
|
+
let totalCost = 0;
|
|
137
|
+
let totalCalls = 0;
|
|
138
|
+
let maxDay = dailyData[0];
|
|
139
|
+
let minDay = null;
|
|
140
|
+
let daysActive = 0;
|
|
141
|
+
for (const day of dailyData) {
|
|
142
|
+
totalCost += day.totalCost;
|
|
143
|
+
totalCalls += day.callCount;
|
|
144
|
+
if (day.totalCost > maxDay.totalCost)
|
|
145
|
+
maxDay = day;
|
|
146
|
+
if (day.callCount > 0) {
|
|
147
|
+
daysActive++;
|
|
148
|
+
if (!minDay || day.totalCost < minDay.totalCost)
|
|
149
|
+
minDay = day;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return { totalCost, avgDaily: daysActive > 0 ? totalCost / daysActive : 0, maxDay, minDay, totalCalls, daysActive };
|
|
153
|
+
}
|
|
154
|
+
async function findJsonlFiles(dir) {
|
|
155
|
+
const files = [];
|
|
156
|
+
async function walk(currentDir) {
|
|
157
|
+
try {
|
|
158
|
+
const entries = await readdir(currentDir, { withFileTypes: true });
|
|
159
|
+
for (const entry of entries) {
|
|
160
|
+
const fullPath = join(currentDir, entry.name);
|
|
161
|
+
if (entry.isDirectory()) {
|
|
162
|
+
await walk(fullPath);
|
|
163
|
+
}
|
|
164
|
+
else if (entry.name.endsWith('.jsonl')) {
|
|
165
|
+
files.push(fullPath);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// skip
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
await walk(dir);
|
|
174
|
+
return files;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAG9B,SAAS,SAAS,CAAC,SAAiB;IAClC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACnH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,OAAO,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACrG,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,O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GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACtH,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,GAAW;IACvC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,UAAU,IAAI,CAAC,UAAkB;QACpC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;YACnE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC9C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;oBACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;qBAAM,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACzC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import en from './locales/en.js';
|
|
2
|
+
export type Locale = 'en' | 'ko';
|
|
3
|
+
type LocaleStrings = typeof en;
|
|
4
|
+
export declare function getLocale(): Locale;
|
|
5
|
+
export declare function setLocale(lang: Locale): void;
|
|
6
|
+
export declare function resetLocale(): void;
|
|
7
|
+
export declare function t(key: string, params?: Record<string, string | number>): string;
|
|
8
|
+
export declare function getLocaleStrings(lang?: Locale): LocaleStrings;
|
|
9
|
+
export {};
|
package/dist/i18n.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import en from './locales/en.js';
|
|
2
|
+
import ko from './locales/ko.js';
|
|
3
|
+
import { loadConfig } from './config.js';
|
|
4
|
+
const locales = { en, ko };
|
|
5
|
+
let currentLocale = null;
|
|
6
|
+
export function getLocale() {
|
|
7
|
+
if (currentLocale)
|
|
8
|
+
return currentLocale;
|
|
9
|
+
const config = loadConfig();
|
|
10
|
+
currentLocale = config.language || 'en';
|
|
11
|
+
return currentLocale;
|
|
12
|
+
}
|
|
13
|
+
export function setLocale(lang) {
|
|
14
|
+
currentLocale = lang;
|
|
15
|
+
}
|
|
16
|
+
export function resetLocale() {
|
|
17
|
+
currentLocale = null;
|
|
18
|
+
}
|
|
19
|
+
export function t(key, params) {
|
|
20
|
+
const locale = getLocale();
|
|
21
|
+
const strings = locales[locale] || locales.en;
|
|
22
|
+
let text = strings[key] ?? locales.en[key] ?? key;
|
|
23
|
+
if (params) {
|
|
24
|
+
for (const [k, v] of Object.entries(params)) {
|
|
25
|
+
text = text.replace(new RegExp(`\\{${k}\\}`, 'g'), String(v));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return text;
|
|
29
|
+
}
|
|
30
|
+
export function getLocaleStrings(lang) {
|
|
31
|
+
const l = lang || getLocale();
|
|
32
|
+
return locales[l] || locales.en;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=i18n.js.map
|
package/dist/i18n.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,MAAM,OAAO,GAAkC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAE1D,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC,MAAM,UAAU,SAAS;IACvB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culateCost, getSavingsNudge } from './calculator.js';
|
|
2
|
+
import { loadConfig, getBudgetStatus } from './config.js';
|
|
3
|
+
import { showBanner, showTodaySummary, showCostUpdate, showBudgetAlert, showShutdown, showError, showInfo } from './display.js';
|
|
4
|
+
import { scanToday, startWatching, getClaudeProjectsDir, buildLogSources } from './watcher.js';
|
|
5
|
+
import { getExchangeRate } from './exchange.js';
|
|
6
|
+
import { getModelLabel, getProviderEmoji, getProviderDisplayName, getProvider } from './providers/index.js';
|
|
7
|
+
import { t } from './i18n.js';
|
|
8
|
+
function truncatePrompt(text, maxLen = 30) {
|
|
9
|
+
if (!text)
|
|
10
|
+
return null;
|
|
11
|
+
const clean = text.replace(/\s+/g, ' ').trim();
|
|
12
|
+
if (clean.length <= maxLen)
|
|
13
|
+
return clean;
|
|
14
|
+
return clean.slice(0, maxLen - 1) + '…';
|
|
15
|
+
}
|
|
16
|
+
function recordRequest(topRequests, usage, cost) {
|
|
17
|
+
const totalInput = usage.inputTokens + usage.cacheCreationTokens + usage.cacheReadTokens;
|
|
18
|
+
const locale = (loadConfig().language || 'en') === 'ko' ? 'ko-KR' : 'en-US';
|
|
19
|
+
const time = usage.timestamp
|
|
20
|
+
? new Date(usage.timestamp).toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit' })
|
|
21
|
+
: '';
|
|
22
|
+
topRequests.push({
|
|
23
|
+
cost,
|
|
24
|
+
provider: usage.provider,
|
|
25
|
+
providerEmoji: getProviderEmoji(usage.provider),
|
|
26
|
+
model: getModelLabel(usage),
|
|
27
|
+
time,
|
|
28
|
+
inputTokens: totalInput,
|
|
29
|
+
outputTokens: usage.outputTokens,
|
|
30
|
+
prompt: truncatePrompt(usage.prompt),
|
|
31
|
+
});
|
|
32
|
+
topRequests.sort((a, b) => b.cost - a.cost);
|
|
33
|
+
if (topRequests.length > 3)
|
|
34
|
+
topRequests.length = 3;
|
|
35
|
+
}
|
|
36
|
+
export async function main() {
|
|
37
|
+
showBanner();
|
|
38
|
+
const config = loadConfig();
|
|
39
|
+
const sources = buildLogSources(config);
|
|
40
|
+
if (sources.length === 0) {
|
|
41
|
+
const claudeDir = getClaudeProjectsDir();
|
|
42
|
+
showError(t('index.noLogDir', { path: claudeDir }));
|
|
43
|
+
showInfo(t('index.addSource'));
|
|
44
|
+
showInfo(' cost-cry config --add-source openai:/path/to/logs');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const providerNames = [...new Set(sources.map(s => s.provider))];
|
|
48
|
+
const sourceInfo = providerNames
|
|
49
|
+
.map(p => `${getProviderEmoji(p)} ${getProviderDisplayName(p)}`)
|
|
50
|
+
.join(' + ');
|
|
51
|
+
showInfo(t('index.tracking', { sources: sourceInfo }));
|
|
52
|
+
const cursorProvider = getProvider('cursor');
|
|
53
|
+
if (cursorProvider?.isAvailable?.() && !providerNames.includes('cursor')) {
|
|
54
|
+
showInfo(t('index.cursorHint'));
|
|
55
|
+
}
|
|
56
|
+
showInfo(t('index.scanning'));
|
|
57
|
+
const exchange = await getExchangeRate(config);
|
|
58
|
+
const { usages: todayUsages, fileOffsets } = await scanToday(config);
|
|
59
|
+
let totalCost = 0;
|
|
60
|
+
let callCount = todayUsages.length;
|
|
61
|
+
let totalPotentialSavings = 0;
|
|
62
|
+
const topRequests = [];
|
|
63
|
+
const costByProvider = {};
|
|
64
|
+
for (const usage of todayUsages) {
|
|
65
|
+
const cost = calculateCost(usage);
|
|
66
|
+
totalCost += cost;
|
|
67
|
+
costByProvider[usage.provider] = (costByProvider[usage.provider] || 0) + cost;
|
|
68
|
+
recordRequest(topRequests, usage, cost);
|
|
69
|
+
const nudge = getSavingsNudge(usage, cost);
|
|
70
|
+
if (nudge)
|
|
71
|
+
totalPotentialSavings += nudge.saving;
|
|
72
|
+
}
|
|
73
|
+
if (process.stdout.isTTY) {
|
|
74
|
+
process.stdout.write('\x1B[1A\x1B[2K');
|
|
75
|
+
}
|
|
76
|
+
const budgetStatus = getBudgetStatus(totalCost, config.dailyBudget);
|
|
77
|
+
showTodaySummary(totalCost, callCount, budgetStatus, config, exchange, costByProvider);
|
|
78
|
+
const sessionStartCost = totalCost;
|
|
79
|
+
let lastBudgetStatus = budgetStatus.status;
|
|
80
|
+
const watcher = startWatching(fileOffsets, (usage) => {
|
|
81
|
+
const cost = calculateCost(usage);
|
|
82
|
+
totalCost += cost;
|
|
83
|
+
callCount++;
|
|
84
|
+
costByProvider[usage.provider] = (costByProvider[usage.provider] || 0) + cost;
|
|
85
|
+
recordRequest(topRequests, usage, cost);
|
|
86
|
+
const nudge = getSavingsNudge(usage, cost);
|
|
87
|
+
if (nudge)
|
|
88
|
+
totalPotentialSavings += nudge.saving;
|
|
89
|
+
showCostUpdate(usage, cost, totalCost, config, exchange);
|
|
90
|
+
if (config.dailyBudget) {
|
|
91
|
+
const newBudgetStatus = getBudgetStatus(totalCost, config.dailyBudget);
|
|
92
|
+
if (newBudgetStatus.status !== lastBudgetStatus &&
|
|
93
|
+
(newBudgetStatus.status === 'danger' || newBudgetStatus.status === 'exceeded')) {
|
|
94
|
+
showBudgetAlert(newBudgetStatus, exchange);
|
|
95
|
+
}
|
|
96
|
+
lastBudgetStatus = newBudgetStatus.status;
|
|
97
|
+
}
|
|
98
|
+
}, config);
|
|
99
|
+
if (!watcher) {
|
|
100
|
+
showError(t('index.watchFail'));
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
const shutdown = () => {
|
|
104
|
+
const sessionCost = totalCost - sessionStartCost;
|
|
105
|
+
showShutdown(sessionCost, totalCost, totalPotentialSavings, topRequests, config, exchange, costByProvider);
|
|
106
|
+
watcher.close();
|
|
107
|
+
process.exit(0);
|
|
108
|
+
};
|
|
109
|
+
process.on('SIGINT', shutdown);
|
|
110
|
+
process.on('SIGTERM', shutdown);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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0': string;
|
|
6
|
+
'tier.1.1': string;
|
|
7
|
+
'tier.1.2': string;
|
|
8
|
+
'tier.1.3': string;
|
|
9
|
+
'tier.2.0': string;
|
|
10
|
+
'tier.2.1': string;
|
|
11
|
+
'tier.2.2': string;
|
|
12
|
+
'tier.2.3': string;
|
|
13
|
+
'tier.3.0': string;
|
|
14
|
+
'tier.3.1': string;
|
|
15
|
+
'tier.3.2': string;
|
|
16
|
+
'tier.3.3': string;
|
|
17
|
+
'tier.3.4': string;
|
|
18
|
+
'tier.4.0': string;
|
|
19
|
+
'tier.4.1': string;
|
|
20
|
+
'tier.4.2': string;
|
|
21
|
+
'tier.4.3': string;
|
|
22
|
+
'tier.4.4': string;
|
|
23
|
+
'tier.5.0': string;
|
|
24
|
+
'tier.5.1': string;
|
|
25
|
+
'tier.5.2': string;
|
|
26
|
+
'tier.5.3': string;
|
|
27
|
+
'tier.5.4': string;
|
|
28
|
+
'mood.peace': string;
|
|
29
|
+
'mood.light': string;
|
|
30
|
+
'mood.cloudy': string;
|
|
31
|
+
'mood.rain': string;
|
|
32
|
+
'mood.storm': string;
|
|
33
|
+
'display.tagline': string;
|
|
34
|
+
'display.todayTotal': string;
|
|
35
|
+
'display.apiCalls': string;
|
|
36
|
+
'display.watching': string;
|
|
37
|
+
'display.exchangeManual': string;
|
|
38
|
+
'display.budget': string;
|
|
39
|
+
'display.budgetRemaining': string;
|
|
40
|
+
'display.budgetExceeded': string;
|
|
41
|
+
'display.budget90': string;
|
|
42
|
+
'display.budget70': string;
|
|
43
|
+
'display.budgetExceededBanner': string;
|
|
44
|
+
'display.budget90Alert': string;
|
|
45
|
+
'display.cumulative': string;
|
|
46
|
+
'display.nudge': string;
|
|
47
|
+
'display.topExpensive': string;
|
|
48
|
+
'display.sessionCost': string;
|
|
49
|
+
'display.todayCost': string;
|
|
50
|
+
'display.potentialSavings': string;
|
|
51
|
+
'display.goodbye': string;
|
|
52
|
+
'display.defaultUnit': string;
|
|
53
|
+
'report.noData': string;
|
|
54
|
+
'report.weeklyTitle': string;
|
|
55
|
+
'report.monthlyTitle': string;
|
|
56
|
+
'report.totalCost': string;
|
|
57
|
+
'report.dailyAvg': string;
|
|
58
|
+
'report.highestDay': string;
|
|
59
|
+
'report.lowestDay': string;
|
|
60
|
+
'report.totalCalls': string;
|
|
61
|
+
'report.callsSuffix': string;
|
|
62
|
+
'report.daysActive': string;
|
|
63
|
+
'report.modelBreakdown': string;
|
|
64
|
+
'report.savingHint': string;
|
|
65
|
+
'days.sun': string;
|
|
66
|
+
'days.mon': string;
|
|
67
|
+
'days.tue': string;
|
|
68
|
+
'days.wed': string;
|
|
69
|
+
'days.thu': string;
|
|
70
|
+
'days.fri': string;
|
|
71
|
+
'days.sat': string;
|
|
72
|
+
'equiv.americano': string;
|
|
73
|
+
'equiv.americano.unit': string;
|
|
74
|
+
'equiv.lunch': string;
|
|
75
|
+
'equiv.lunch.unit': string;
|
|
76
|
+
'equiv.chicken': string;
|
|
77
|
+
'equiv.chicken.unit': string;
|
|
78
|
+
'equiv.netflix': string;
|
|
79
|
+
'equiv.netflix.unit': string;
|
|
80
|
+
'equiv.tteokbokki': string;
|
|
81
|
+
'equiv.tteokbokki.unit': string;
|
|
82
|
+
'equiv.frappuccino': string;
|
|
83
|
+
'equiv.frappuccino.unit': string;
|
|
84
|
+
'exchange.unknown': string;
|
|
85
|
+
'exchange.src.api': string;
|
|
86
|
+
'exchange.src.cache': string;
|
|
87
|
+
'exchange.src.staleCache': string;
|
|
88
|
+
'exchange.src.manual': string;
|
|
89
|
+
'index.noLogDir': string;
|
|
90
|
+
'index.addSource': string;
|
|
91
|
+
'index.tracking': string;
|
|
92
|
+
'index.cursorHint': string;
|
|
93
|
+
'index.scanning': string;
|
|
94
|
+
'index.watchFail': string;
|
|
95
|
+
'tier.peace': string;
|
|
96
|
+
'tier.uneasy': string;
|
|
97
|
+
'tier.worry': string;
|
|
98
|
+
'tier.alert': string;
|
|
99
|
+
'tier.danger': string;
|
|
100
|
+
'tier.funeral': string;
|
|
101
|
+
'tray.today': string;
|
|
102
|
+
'tray.toggle': string;
|
|
103
|
+
'tray.quit': string;
|
|
104
|
+
'overlay.walletPeace': string;
|
|
105
|
+
'overlay.stillOk': string;
|
|
106
|
+
'overlay.todayCalls': string;
|
|
107
|
+
'overlay.nudge': string;
|
|
108
|
+
'overlay.chartTitle': string;
|
|
109
|
+
'overlay.modelsTitle': string;
|
|
110
|
+
'overlay.topTitle': string;
|
|
111
|
+
'overlay.topSummary': string;
|
|
112
|
+
'overlay.noRequests': string;
|
|
113
|
+
'overlay.loading': string;
|
|
114
|
+
'overlay.noData': string;
|
|
115
|
+
'overlay.totalCost': string;
|
|
116
|
+
'overlay.dailyAvg': string;
|
|
117
|
+
'overlay.totalCalls': string;
|
|
118
|
+
'overlay.callsSuffix': string;
|
|
119
|
+
'overlay.savingHint': string;
|
|
120
|
+
'overlay.clickToExpand': string;
|
|
121
|
+
'tooltip.chart': string;
|
|
122
|
+
'tooltip.models': string;
|
|
123
|
+
'tooltip.top': string;
|
|
124
|
+
'tooltip.settings': string;
|
|
125
|
+
'settings.currency': string;
|
|
126
|
+
'settings.dailyBudget': string;
|
|
127
|
+
'settings.budgetPlaceholder': string;
|
|
128
|
+
'settings.equivUnit': string;
|
|
129
|
+
'settings.autoUnit': string;
|
|
130
|
+
'settings.nudge': string;
|
|
131
|
+
'settings.save': string;
|
|
132
|
+
'settings.saved': string;
|
|
133
|
+
'settings.checkUpdate': string;
|
|
134
|
+
'settings.updateAvailable': string;
|
|
135
|
+
'settings.latestVersion': string;
|
|
136
|
+
'settings.checking': string;
|
|
137
|
+
'settings.checkFailed': string;
|
|
138
|
+
'settings.cmdCopied': string;
|
|
139
|
+
'settings.language': string;
|
|
140
|
+
'overlay.exchange.api': string;
|
|
141
|
+
'overlay.exchange.cache': string;
|
|
142
|
+
'overlay.exchange.staleCache': string;
|
|
143
|
+
'overlay.exchange.manual': string;
|
|
144
|
+
'cli.title': string;
|
|
145
|
+
'cli.usage': string;
|
|
146
|
+
'cli.cmdOverlay': string;
|
|
147
|
+
'cli.cmdCli': string;
|
|
148
|
+
'cli.cmdConfig': string;
|
|
149
|
+
'cli.cmdConfigEdit': string;
|
|
150
|
+
'cli.cmdReport': string;
|
|
151
|
+
'cli.cmdReportMonthly': string;
|
|
152
|
+
'cli.settingsTitle': string;
|
|
153
|
+
'cli.examplesTitle': string;
|
|
154
|
+
'cli.currentConfig': string;
|
|
155
|
+
'cli.dailyBudget': string;
|
|
156
|
+
'cli.monthlyBudget': string;
|
|
157
|
+
'cli.currency': string;
|
|
158
|
+
'cli.noLimit': string;
|
|
159
|
+
'cli.exchangeRate': string;
|
|
160
|
+
'cli.exchangeFixed': string;
|
|
161
|
+
'cli.nudge': string;
|
|
162
|
+
'cli.nudgeOn': string;
|
|
163
|
+
'cli.nudgeOff': string;
|
|
164
|
+
'cli.equivUnit': string;
|
|
165
|
+
'cli.autoUnit': string;
|
|
166
|
+
'cli.customUnits': string;
|
|
167
|
+
'cli.logSources': string;
|
|
168
|
+
'cli.claudeAuto': string;
|
|
169
|
+
'cli.apiPolling': string;
|
|
170
|
+
'cli.availableUnits': string;
|
|
171
|
+
'cli.supportedCurrencies': string;
|
|
172
|
+
'cli.configHint': string;
|
|
173
|
+
'cli.language': string;
|
|
174
|
+
'cli.unitFormatError': string;
|
|
175
|
+
'cli.unknownCurrency': string;
|
|
176
|
+
'cli.invalidRate': string;
|
|
177
|
+
'cli.unknownProvider': string;
|
|
178
|
+
'cli.sourceFormatError': string;
|
|
179
|
+
'cli.apiSourceHint': string;
|
|
180
|
+
'cli.providerHint': string;
|
|
181
|
+
'cli.notInstalled': string;
|
|
182
|
+
'cli.noToken': string;
|
|
183
|
+
'cli.unknownOption': string;
|
|
184
|
+
'cli.fatalError': string;
|
|
185
|
+
'cli.noElectron': string;
|
|
186
|
+
'cli.installElectron': string;
|
|
187
|
+
'cli.widgetLaunched': string;
|
|
188
|
+
'cli.electronFail': string;
|
|
189
|
+
'cli.unknownLang': string;
|
|
190
|
+
};
|
|
191
|
+
export default en;
|