big-spender 0.9.0 → 0.10.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/README.md +7 -2
- package/dist/collector.mjs +224 -1
- package/dist/schema.d.ts +9 -1
- package/dist/schema.js +2 -1
- package/package.json +1 -1
- package/templates/env.example +1 -1
package/README.md
CHANGED
|
@@ -336,8 +336,9 @@ about 15 to 20 percent less.
|
|
|
336
336
|
| Grok Build (experimental) | `~/.grok/sessions/**/updates.jsonl`, `$GROK_HOME/sessions` | **Experimental:** checked against ccusage on test fixtures built from its Grok parser tests, not yet against real Grok Build logs. `turn_completed` lines, one row per model in `usage.modelUsage` (the top-level usage under `summary.json`'s `current_model_id` when that map is missing). De-duplicated by `eventId` + model, also across sessions, since one event can be exported into several; a row without `eventId` by its full content within its file. `cachedReadTokens` and `cacheCreationTokens` are part of `inputTokens`; reasoning is part of `outputTokens`. Always the base rate: a turn sums several API requests, so its total cannot pick the long-context tier; a request of its own above 200K tokens is under-priced. A model id that is a file path is reduced to its file name. A turn cut off before it completes is never logged, so it is not counted. |
|
|
337
337
|
| GitHub Copilot CLI (experimental) | `~/.copilot/session-state/*/events.jsonl`, `$COPILOT_HOME/session-state` | Experimental: so far compared with ccusage only on a few sessions from one machine and on ccusage's test fixtures, not on regular use. `session.usage_record` events (one per model call). Older versions log only `session.shutdown`; its cumulative `modelMetrics` count as the growth since the previous shutdown, and only when no per-call record came in that interval. `inputTokens` includes cache reads and writes, so input counts uncached tokens only. Reasoning is part of `outputTokens`. A `-1m` or `-1m-internal` model suffix is dropped. Only the top-level `events.jsonl` of each session is read, not the OpenTelemetry export or `session-store.db`. |
|
|
338
338
|
| Antigravity (experimental) | `~/.gemini/antigravity*/conversations/**/*.db`, `~/.config/antigravity/conversations` | **Experimental:** read only with `BIG_SPENDER_EXPERIMENTAL=antigravity`; checked against ccusage on test fixtures, not yet against real Antigravity data. `antigravity*` is `antigravity` and its `-cli`, `-ide`, `-backup` and `-acp` variants; `$ANTIGRAVITY_DATA_DIR` (comma-separated) is read too. Read with `node:sqlite` (Node 22.13+, else skipped with a warning). Usage messages in `gen_metadata` and `steps`, retries included; copies sharing a response, provider or message id merge and keep the largest counts. A later copy can move a response to another day or model; the day and model it left are sent as a zero row, which takes them back on the server. A model name with a slash (possibly a path) becomes `gemini-internal-model`. Reasoning is part of output. |
|
|
339
|
+
| Gemini CLI (experimental) | `~/.gemini/tmp/**/*.json` and `*.jsonl`, `$GEMINI_DATA_DIR` (comma-separated) | **Experimental:** read only with `BIG_SPENDER_EXPERIMENTAL=gemini`; checked against ccusage on test fixtures, not yet against real Gemini CLI data. `gemini` chat messages with `tokens`, and saved headless `stats` (per model, or with the last model named, else `unknown`). A changed file is read whole and its counts replace what it counted before, as ccusage counts each file as it is; in JSONL the last copy of a message id counts. `input` excludes `cached` when the total shows it was inside (always in stats), and `tool` tokens count as input. Reasoning (`thoughts`) and any total beyond the parts count as output, as ccusage bills them, though its per-model output leaves reasoning out. A model id that is a file path is reduced to its file name. `$GEMINI_DATA_DIR` adds dirs to the default rather than replacing it. |
|
|
339
340
|
|
|
340
|
-
**Pricing.** Claude Code, Codex, pi, Grok Build, GitHub Copilot CLI and
|
|
341
|
+
**Pricing.** Claude Code, Codex, pi, Grok Build, GitHub Copilot CLI, Antigravity and Gemini CLI use LiteLLM
|
|
341
342
|
`model_prices_and_context_window.json`, cached for 24 hours in `~/.cache/big-spender/`. Each source lists the LiteLLM keys to try for a model. Claude
|
|
342
343
|
Code and Codex try the exact model, then the `anthropic/` or `openai/` prefix, then without a date
|
|
343
344
|
suffix. pi tries the LiteLLM prefixes of the providers pi supports too (`openrouter/`, `fireworks_ai/`,
|
|
@@ -347,6 +348,10 @@ both without a trailing `-build`. Antigravity tries the model, the model without
|
|
|
347
348
|
suffix, Anthropic's spelling of a Claude name (`claude-sonnet-4-5` for `claude-4.5-sonnet`) and the
|
|
348
349
|
`-preview` name, each bare and with the `google/`, `gemini/`, `vertex_ai/` and `openrouter/google/`
|
|
349
350
|
prefixes (a Claude name also with `vercel_ai_gateway/anthropic/`, which still lists retired models).
|
|
351
|
+
Gemini CLI tries `gemini/`, `vertex_ai/` and `openrouter/google/`, then the bare model. ccusage prices
|
|
352
|
+
Gemini from models.dev's `google/` entries first, and for `gemini-2.5-flash` that entry is $0.15
|
|
353
|
+
input and $1.25 output per million tokens, half of LiteLLM's (and models.dev's own `gemini/` entry)
|
|
354
|
+
$0.30 and $2.50. So ccusage shows about half the collector's cost for that model.
|
|
350
355
|
Unknown models count with cost 0 and log a warning.
|
|
351
356
|
Long-context tiers
|
|
352
357
|
(`*_above_<N>k_tokens`) are applied per request; a missing cache price is derived from the base
|
|
@@ -358,7 +363,7 @@ for a dash in Claude model names (`claude-opus-4.6` is priced as `claude-opus-4-
|
|
|
358
363
|
**Experimental sources.** A source whose counts match ccusage on test data but have not been checked
|
|
359
364
|
against real usage yet is marked `experimental` in `SOURCES`. The collector reads and sends it only
|
|
360
365
|
when `BIG_SPENDER_EXPERIMENTAL` (comma-separated provider ids, in the environment or the env file)
|
|
361
|
-
names it. Antigravity
|
|
366
|
+
names it. Antigravity and Gemini CLI are gated this way. Removing it from the list stops sending its rows on the
|
|
362
367
|
next run; adding it back recounts them without counting anything twice.
|
|
363
368
|
|
|
364
369
|
**Adding a provider.** Add an entry to `SOURCES` in `src/collector.mjs`, the provider id to
|
package/dist/collector.mjs
CHANGED
|
@@ -135,7 +135,8 @@ async function acquireLock() {
|
|
|
135
135
|
* A seen entry is the first timestamp, or for Claude [first timestamp, output tokens counted].
|
|
136
136
|
* A bare number on a Claude key means the counted output is unknown (state from an older version).
|
|
137
137
|
* Antigravity keeps a merged response under each of its ids: see agStoreGroup.
|
|
138
|
-
*
|
|
138
|
+
* Gemini keeps a file's counts under `gm:` and its path: [latest hour, counts]; see readGemini.
|
|
139
|
+
* @typedef {number | [number, number] | [number, string] | [number, number, string, ...(number | string)[]] | [number, Record<string, any>]} Seen
|
|
139
140
|
* One subscription usage window instance; see limitWindowSchema in src/schema.ts.
|
|
140
141
|
* @typedef {{ provider: string, window: string, resetsAt: string, peakPercent: number, hitAt?: string }} Limit
|
|
141
142
|
* @typedef {{ version: number, files: Record<string, FileState>, seen: Record<string, Seen>, buckets: Record<string, Bucket>, limits?: Record<string, Limit>, fixes?: string[], rescan?: string[], cursorBackfills?: string[] }} State
|
|
@@ -939,6 +940,214 @@ function copilotLineHandler(state, file, resolvePrice, cutoffMs, sessionDir) {
|
|
|
939
940
|
|
|
940
941
|
const allJsonl = (dir) => walk(dir, (name) => name.endsWith('.jsonl'));
|
|
941
942
|
|
|
943
|
+
// Gemini CLI keeps each chat under ~/.gemini/tmp/<project hash>/chats, as a JSON file it rewrites
|
|
944
|
+
// after every message or as JSONL it appends to, and headless runs can save their stats there too.
|
|
945
|
+
// Every .json and .jsonl file under it is read with ccusage's rules for these shapes.
|
|
946
|
+
|
|
947
|
+
const GEMINI_TOKEN_KEYS = {
|
|
948
|
+
input: ['input', 'prompt', 'input_tokens', 'prompt_tokens'],
|
|
949
|
+
output: ['output', 'candidates', 'output_tokens', 'candidates_tokens'],
|
|
950
|
+
cached: ['cached', 'cached_tokens'],
|
|
951
|
+
thoughts: ['thoughts', 'reasoning', 'thoughts_tokens', 'reasoning_tokens'],
|
|
952
|
+
tool: ['tool', 'tool_tokens']
|
|
953
|
+
};
|
|
954
|
+
const GEMINI_TIME =
|
|
955
|
+
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{3})?(Z|[+-]\d{2}:\d{2})$/;
|
|
956
|
+
// Gemini's context is a few million tokens, so a larger count is corrupt. Capping each record also
|
|
957
|
+
// keeps a bucket's sum under the snapshot schema's limit.
|
|
958
|
+
const GEMINI_MAX_TOKENS = 1e9;
|
|
959
|
+
|
|
960
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
961
|
+
const nonEmpty = (v) => (typeof v === 'string' && v.trim() ? v.trim() : undefined);
|
|
962
|
+
// Date.parse would roll an hour of 24 or February 30 over to the next day; ccusage rejects them.
|
|
963
|
+
const geminiTime = (v) => {
|
|
964
|
+
const m = typeof v === 'string' ? GEMINI_TIME.exec(v) : null;
|
|
965
|
+
if (!m) return undefined;
|
|
966
|
+
const [, y, mo, d, h, mi, sec] = m.map(Number);
|
|
967
|
+
const day = new Date(Date.UTC(y, mo - 1, d));
|
|
968
|
+
if (day.getUTCMonth() !== mo - 1 || day.getUTCDate() !== d || h > 23 || mi > 59 || sec > 59) {
|
|
969
|
+
return undefined;
|
|
970
|
+
}
|
|
971
|
+
const ms = Date.parse(v);
|
|
972
|
+
return plausibleTime(ms) ? ms : undefined;
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* One request's tokens. Headless stats always count cached tokens inside `input`; a chat message
|
|
977
|
+
* does when its total equals the parts without them, as Gemini's totalTokenCount does. Reasoning
|
|
978
|
+
* and whatever the total has beyond the parts are billed as output.
|
|
979
|
+
*/
|
|
980
|
+
function geminiUsage(raw, cachedInInput) {
|
|
981
|
+
if (!isObject(raw)) return null;
|
|
982
|
+
const count = (v) => (typeof v === 'number' ? Math.trunc(Math.max(0, v)) : undefined);
|
|
983
|
+
const tokenKeys = [...Object.values(GEMINI_TOKEN_KEYS).flat(), 'total', 'total_tokens'];
|
|
984
|
+
if (tokenKeys.some((k) => typeof raw[k] === 'number' && !(raw[k] < GEMINI_MAX_TOKENS)))
|
|
985
|
+
return null;
|
|
986
|
+
const pick = (keys) => keys.map((k) => count(raw[k])).find((v) => v !== undefined) ?? 0;
|
|
987
|
+
const { input, output, cached, thoughts, tool } = Object.fromEntries(
|
|
988
|
+
Object.entries(GEMINI_TOKEN_KEYS).map(([name, keys]) => [name, pick(keys)])
|
|
989
|
+
);
|
|
990
|
+
const total = 'total' in raw ? count(raw.total) : count(raw.total_tokens);
|
|
991
|
+
const overlap = cachedInInput || (cached > 0 && total === input + output + thoughts + tool);
|
|
992
|
+
const prompt = (overlap ? input - Math.min(input, cached) : input) + tool;
|
|
993
|
+
const known = prompt + output + cached + thoughts;
|
|
994
|
+
const billedOutput = output + thoughts + Math.max(0, (total ?? known) - known);
|
|
995
|
+
if (!prompt && !cached && !billedOutput) return null;
|
|
996
|
+
return { input: prompt, cacheRead: cached, output: billedOutput };
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* The usage events in one Gemini file, or null for a file that may be half written: JSON that
|
|
1001
|
+
* does not parse, or JSONL whose last line does not. `id` is the message id when the event has one. In JSONL a line's session id
|
|
1002
|
+
* and model carry over to the lines after it, and a message logged again with its id replaces
|
|
1003
|
+
* the earlier copy, as in ccusage.
|
|
1004
|
+
*/
|
|
1005
|
+
function geminiEvents(path, text, mtimeMs) {
|
|
1006
|
+
const events = [];
|
|
1007
|
+
let session = basename(path).replace(/\.jsonl?$/, '');
|
|
1008
|
+
const push = (raw, model, ts, cachedInInput, id) => {
|
|
1009
|
+
const u = model && geminiUsage(raw, cachedInInput);
|
|
1010
|
+
if (u) events.push({ ...u, model, ts, session, id });
|
|
1011
|
+
};
|
|
1012
|
+
const pushStats = (o, model, ts) => {
|
|
1013
|
+
const stats = o.stats ?? (isObject(o.result) ? o.result.stats : undefined);
|
|
1014
|
+
if (!isObject(stats)) return;
|
|
1015
|
+
const before = events.length;
|
|
1016
|
+
if (isObject(stats.models)) {
|
|
1017
|
+
for (const [name, m] of Object.entries(stats.models)) {
|
|
1018
|
+
if (isObject(m)) push(m.tokens, nonEmpty(name), ts, true);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (events.length === before) push(stats, model ?? 'unknown', ts, true);
|
|
1022
|
+
};
|
|
1023
|
+
const sessionOf = (o) => nonEmpty(o.sessionId) ?? nonEmpty(o.session_id) ?? session;
|
|
1024
|
+
const direct = (o, model, fallbackMs) =>
|
|
1025
|
+
push(
|
|
1026
|
+
o.tokens,
|
|
1027
|
+
model,
|
|
1028
|
+
geminiTime(o.timestamp) ?? geminiTime(o.created_at) ?? fallbackMs,
|
|
1029
|
+
false,
|
|
1030
|
+
nonEmpty(o.id)
|
|
1031
|
+
);
|
|
1032
|
+
|
|
1033
|
+
if (path.endsWith('.jsonl')) {
|
|
1034
|
+
let model;
|
|
1035
|
+
const byId = new Map();
|
|
1036
|
+
const lines = text.split('\n');
|
|
1037
|
+
const last = lines.findLast((line) => line.trim());
|
|
1038
|
+
if (last !== undefined && parseJson(last) === null) return null;
|
|
1039
|
+
for (const line of lines) {
|
|
1040
|
+
const o = parseJson(line);
|
|
1041
|
+
if (!isObject(o)) continue;
|
|
1042
|
+
session = sessionOf(o);
|
|
1043
|
+
model = nonEmpty(o.model) ?? model;
|
|
1044
|
+
if (o.type !== 'gemini') {
|
|
1045
|
+
pushStats(o, model, geminiTime(o.timestamp) ?? mtimeMs);
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
const n = events.length;
|
|
1049
|
+
direct(o, model, mtimeMs);
|
|
1050
|
+
const id = events[n]?.id;
|
|
1051
|
+
if (id === undefined) continue;
|
|
1052
|
+
if (byId.has(id)) events[byId.get(id)] = events.pop();
|
|
1053
|
+
else byId.set(id, n);
|
|
1054
|
+
}
|
|
1055
|
+
return events;
|
|
1056
|
+
}
|
|
1057
|
+
const o = parseJson(text);
|
|
1058
|
+
if (o === null) return null;
|
|
1059
|
+
if (!isObject(o)) return events;
|
|
1060
|
+
session = sessionOf(o);
|
|
1061
|
+
if (Array.isArray(o.messages)) {
|
|
1062
|
+
const start = geminiTime(o.startTime) ?? geminiTime(o.lastUpdated) ?? mtimeMs;
|
|
1063
|
+
for (const m of o.messages) {
|
|
1064
|
+
if (isObject(m) && m.type === 'gemini') direct(m, nonEmpty(m.model), start);
|
|
1065
|
+
}
|
|
1066
|
+
} else if (o.type === 'gemini') {
|
|
1067
|
+
direct(o, nonEmpty(o.model), mtimeMs);
|
|
1068
|
+
} else {
|
|
1069
|
+
pushStats(o, nonEmpty(o.model), geminiTime(o.timestamp) ?? mtimeMs);
|
|
1070
|
+
}
|
|
1071
|
+
return events;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Gemini rewrites its files, so a changed file is read whole and what it counts now replaces
|
|
1076
|
+
* what it counted before, as ccusage counts each file as it is. `state.seen` keeps each file's
|
|
1077
|
+
* counts per hour, model, tier and session so they can be taken back, also after the file was
|
|
1078
|
+
* skipped for a while (an experimental source turned off). A message updated, corrected or
|
|
1079
|
+
* removed in the file changes the count with it, and an hour or model it leaves is sent as a
|
|
1080
|
+
* zero row.
|
|
1081
|
+
* @type {Source['read']}
|
|
1082
|
+
*/
|
|
1083
|
+
async function readGemini(paths, ctx, provider) {
|
|
1084
|
+
const { state, cutoffMs } = ctx;
|
|
1085
|
+
for (const dir of paths) {
|
|
1086
|
+
// A symlinked GEMINI_DATA_DIR reaches the same files as the default under another name.
|
|
1087
|
+
const root = await realpath(dir).catch(() => null);
|
|
1088
|
+
if (!root) continue;
|
|
1089
|
+
for await (const path of walk(root, (name) => /\.jsonl?$/.test(name))) {
|
|
1090
|
+
if (ctx.seenPaths.has(path)) continue;
|
|
1091
|
+
ctx.seenPaths.add(path);
|
|
1092
|
+
let st;
|
|
1093
|
+
let text;
|
|
1094
|
+
try {
|
|
1095
|
+
st = await stat(path);
|
|
1096
|
+
if (st.mtimeMs < cutoffMs) {
|
|
1097
|
+
delete state.files[path];
|
|
1098
|
+
continue;
|
|
1099
|
+
}
|
|
1100
|
+
const prev = state.files[path];
|
|
1101
|
+
const rescan = state.rescan?.includes(provider);
|
|
1102
|
+
if (!rescan && prev && prev.size === st.size && prev.mtimeMs === st.mtimeMs) continue;
|
|
1103
|
+
text = await readFile(path, 'utf8');
|
|
1104
|
+
} catch (err) {
|
|
1105
|
+
log(`skipping unreadable file: ${err.message}`);
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
ctx.filesRead++;
|
|
1109
|
+
ctx.parsedBytes += st.size;
|
|
1110
|
+
const events = geminiEvents(path, text, st.mtimeMs);
|
|
1111
|
+
state.files[path] = { size: st.size, mtimeMs: st.mtimeMs, offset: st.size };
|
|
1112
|
+
// Half written: keep what it counted until the write completes and changes the file.
|
|
1113
|
+
if (!events) continue;
|
|
1114
|
+
/** @type {Record<string, ReturnType<typeof geminiRecord>>} */
|
|
1115
|
+
const counts = {};
|
|
1116
|
+
for (const e of events) {
|
|
1117
|
+
if (e.ts < cutoffMs) continue;
|
|
1118
|
+
const model = localModelName(e.model) || 'unknown';
|
|
1119
|
+
const tier = tierFor(ctx.resolvePrice(provider, model), e.input + e.cacheRead);
|
|
1120
|
+
const r = geminiRecord(e.ts, model, tier, shortHash(`gemini:${e.session}`));
|
|
1121
|
+
const c = (counts[`${recordBucketKey(r)}|${r.session}`] ??= r);
|
|
1122
|
+
c.input += e.input;
|
|
1123
|
+
c.cacheRead += e.cacheRead;
|
|
1124
|
+
c.output += e.output;
|
|
1125
|
+
}
|
|
1126
|
+
const seenKey = `gm:${shortHash(path)}`;
|
|
1127
|
+
const before = state.seen[seenKey];
|
|
1128
|
+
for (const r of Object.values(Array.isArray(before) ? before[1] : {})) removeRecord(state, r);
|
|
1129
|
+
for (const r of Object.values(counts)) addRecord(state, r);
|
|
1130
|
+
const latest = Math.max(...Object.values(counts).map((r) => r.ts));
|
|
1131
|
+
if (Number.isFinite(latest)) state.seen[seenKey] = [latest, counts];
|
|
1132
|
+
else delete state.seen[seenKey];
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/** A Gemini count for one hour, model, tier and session, in the shape addRecord takes. */
|
|
1138
|
+
const geminiRecord = (ts, model, tier, session) => ({
|
|
1139
|
+
ts: Math.floor(ts / HOUR_MS) * HOUR_MS,
|
|
1140
|
+
provider: 'gemini',
|
|
1141
|
+
model,
|
|
1142
|
+
tier,
|
|
1143
|
+
session,
|
|
1144
|
+
input: 0,
|
|
1145
|
+
cacheRead: 0,
|
|
1146
|
+
cacheWrite5m: 0,
|
|
1147
|
+
cacheWrite1h: 0,
|
|
1148
|
+
output: 0
|
|
1149
|
+
});
|
|
1150
|
+
|
|
942
1151
|
/**
|
|
943
1152
|
* A reader for JSONL logs that only grow: reads the files `files` lists under each path (every
|
|
944
1153
|
* `*.jsonl` below it by default) and parses only the bytes added since the last run. `lines`
|
|
@@ -1795,6 +2004,20 @@ const SOURCES = {
|
|
|
1795
2004
|
envPaths: antigravityEnvDirs,
|
|
1796
2005
|
read: readAntigravity,
|
|
1797
2006
|
priceKeys: antigravityPriceKeys
|
|
2007
|
+
},
|
|
2008
|
+
gemini: {
|
|
2009
|
+
experimental: true,
|
|
2010
|
+
paths: [join(HOME, '.gemini', 'tmp')],
|
|
2011
|
+
envPaths: () =>
|
|
2012
|
+
(process.env.GEMINI_DATA_DIR ?? '')
|
|
2013
|
+
.split(',')
|
|
2014
|
+
.map((p) => p.trim())
|
|
2015
|
+
.filter(Boolean),
|
|
2016
|
+
read: readGemini,
|
|
2017
|
+
priceKeys: (model) => [
|
|
2018
|
+
...['gemini', 'vertex_ai', 'openrouter/google'].map((p) => `${p}/${model}`),
|
|
2019
|
+
model
|
|
2020
|
+
]
|
|
1798
2021
|
}
|
|
1799
2022
|
};
|
|
1800
2023
|
|
package/dist/schema.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const EARLIEST_DATE = "2020-01-01T00:00:00Z";
|
|
|
3
3
|
export declare const MAX_ROWS = 50000;
|
|
4
4
|
export declare const DEVICE_ID: RegExp;
|
|
5
5
|
export declare const CURSOR_DEVICE_ID = "cursor";
|
|
6
|
-
export declare const PROVIDERS: readonly ['claude', 'codex', 'cursor', 'pi', 'grok', 'copilot', 'antigravity'];
|
|
6
|
+
export declare const PROVIDERS: readonly ['claude', 'codex', 'cursor', 'pi', 'grok', 'copilot', 'antigravity', 'gemini'];
|
|
7
7
|
export declare const RANGES: readonly ['7d', '30d', '90d', 'all'];
|
|
8
8
|
export declare const usageRowSchema: z.ZodObject<{
|
|
9
9
|
hour: z.ZodISODateTime;
|
|
@@ -17,6 +17,7 @@ export declare const usageRowSchema: z.ZodObject<{
|
|
|
17
17
|
codex: "codex";
|
|
18
18
|
copilot: "copilot";
|
|
19
19
|
cursor: "cursor";
|
|
20
|
+
gemini: "gemini";
|
|
20
21
|
grok: "grok";
|
|
21
22
|
pi: "pi";
|
|
22
23
|
}>;
|
|
@@ -43,6 +44,7 @@ export declare const limitWindowSchema: z.ZodObject<{
|
|
|
43
44
|
codex: "codex";
|
|
44
45
|
copilot: "copilot";
|
|
45
46
|
cursor: "cursor";
|
|
47
|
+
gemini: "gemini";
|
|
46
48
|
grok: "grok";
|
|
47
49
|
pi: "pi";
|
|
48
50
|
}>;
|
|
@@ -69,6 +71,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
69
71
|
codex: "codex";
|
|
70
72
|
copilot: "copilot";
|
|
71
73
|
cursor: "cursor";
|
|
74
|
+
gemini: "gemini";
|
|
72
75
|
grok: "grok";
|
|
73
76
|
pi: "pi";
|
|
74
77
|
}>;
|
|
@@ -96,6 +99,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
96
99
|
antigravity: z.ZodOptional<z.ZodNumber>;
|
|
97
100
|
copilot: z.ZodOptional<z.ZodNumber>;
|
|
98
101
|
cursor: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
gemini: z.ZodOptional<z.ZodNumber>;
|
|
99
103
|
grok: z.ZodOptional<z.ZodNumber>;
|
|
100
104
|
pi: z.ZodOptional<z.ZodNumber>;
|
|
101
105
|
}, z.core.$strict>>;
|
|
@@ -106,6 +110,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
106
110
|
antigravity: z.ZodOptional<z.ZodNumber>;
|
|
107
111
|
copilot: z.ZodOptional<z.ZodNumber>;
|
|
108
112
|
cursor: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
gemini: z.ZodOptional<z.ZodNumber>;
|
|
109
114
|
grok: z.ZodOptional<z.ZodNumber>;
|
|
110
115
|
pi: z.ZodOptional<z.ZodNumber>;
|
|
111
116
|
}, z.core.$strict>;
|
|
@@ -116,6 +121,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
116
121
|
antigravity: z.ZodOptional<z.ZodNumber>;
|
|
117
122
|
copilot: z.ZodOptional<z.ZodNumber>;
|
|
118
123
|
cursor: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
gemini: z.ZodOptional<z.ZodNumber>;
|
|
119
125
|
grok: z.ZodOptional<z.ZodNumber>;
|
|
120
126
|
pi: z.ZodOptional<z.ZodNumber>;
|
|
121
127
|
}, z.core.$strict>;
|
|
@@ -126,6 +132,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
126
132
|
antigravity: z.ZodOptional<z.ZodNumber>;
|
|
127
133
|
copilot: z.ZodOptional<z.ZodNumber>;
|
|
128
134
|
cursor: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
gemini: z.ZodOptional<z.ZodNumber>;
|
|
129
136
|
grok: z.ZodOptional<z.ZodNumber>;
|
|
130
137
|
pi: z.ZodOptional<z.ZodNumber>;
|
|
131
138
|
}, z.core.$strict>;
|
|
@@ -137,6 +144,7 @@ export declare const usageSnapshotSchema: z.ZodObject<{
|
|
|
137
144
|
codex: "codex";
|
|
138
145
|
copilot: "copilot";
|
|
139
146
|
cursor: "cursor";
|
|
147
|
+
gemini: "gemini";
|
|
140
148
|
grok: "grok";
|
|
141
149
|
pi: "pi";
|
|
142
150
|
}>;
|
package/dist/schema.js
CHANGED
|
@@ -21,7 +21,8 @@ export const PROVIDERS = [
|
|
|
21
21
|
'pi',
|
|
22
22
|
'grok',
|
|
23
23
|
'copilot',
|
|
24
|
-
'antigravity'
|
|
24
|
+
'antigravity',
|
|
25
|
+
'gemini'
|
|
25
26
|
];
|
|
26
27
|
// Public ranges. 7d, 30d and 90d are bucketed by UTC day, `all` by ISO week. Nothing is finer
|
|
27
28
|
// than a day: an hourly view would show when each machine is in use.
|
package/package.json
CHANGED
package/templates/env.example
CHANGED
|
@@ -11,5 +11,5 @@ BIG_SPENDER_INGEST_TOKEN=
|
|
|
11
11
|
# usage from Cursor's API and sends it as the device "cursor". Set by `big-spender install --cursor`.
|
|
12
12
|
# BIG_SPENDER_CURSOR_API_KEY=
|
|
13
13
|
# Optional: experimental sources to read too, comma-separated. Their counts match ccusage on test
|
|
14
|
-
# data but have not been checked against real usage yet. Available: antigravity.
|
|
14
|
+
# data but have not been checked against real usage yet. Available: antigravity, gemini.
|
|
15
15
|
# BIG_SPENDER_EXPERIMENTAL=antigravity
|