@ai-dossier/cli 0.49.2 → 0.53.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 +46 -3
- package/dist/batch-suite-runner.d.ts +30 -6
- package/dist/batch-suite-runner.d.ts.map +1 -1
- package/dist/batch-suite-runner.js +86 -25
- package/dist/batch-suite-runner.js.map +1 -1
- package/dist/capability.d.ts +8 -0
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +16 -1
- package/dist/capability.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +10 -1
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/sched.d.ts.map +1 -1
- package/dist/commands/sched.js +78 -3
- package/dist/commands/sched.js.map +1 -1
- package/dist/commands/usage.d.ts +84 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +395 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/usage/collect-claude.d.ts +47 -0
- package/dist/usage/collect-claude.d.ts.map +1 -0
- package/dist/usage/collect-claude.js +237 -0
- package/dist/usage/collect-claude.js.map +1 -0
- package/dist/usage/collect-dispatch.d.ts +73 -0
- package/dist/usage/collect-dispatch.d.ts.map +1 -0
- package/dist/usage/collect-dispatch.js +297 -0
- package/dist/usage/collect-dispatch.js.map +1 -0
- package/dist/usage/collect-opencode.d.ts +74 -0
- package/dist/usage/collect-opencode.d.ts.map +1 -0
- package/dist/usage/collect-opencode.js +198 -0
- package/dist/usage/collect-opencode.js.map +1 -0
- package/dist/usage/host-session.d.ts +63 -0
- package/dist/usage/host-session.d.ts.map +1 -0
- package/dist/usage/host-session.js +325 -0
- package/dist/usage/host-session.js.map +1 -0
- package/dist/usage/ledger.d.ts +87 -0
- package/dist/usage/ledger.d.ts.map +1 -0
- package/dist/usage/ledger.js +268 -0
- package/dist/usage/ledger.js.map +1 -0
- package/dist/usage/types.d.ts +80 -0
- package/dist/usage/types.d.ts.map +1 -0
- package/dist/usage/types.js +11 -0
- package/dist/usage/types.js.map +1 -0
- package/dist/usage/util.d.ts +36 -0
- package/dist/usage/util.d.ts.map +1 -0
- package/dist/usage/util.js +158 -0
- package/dist/usage/util.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Ledger assembly + aggregation for `ai-dossier usage` (#769).
|
|
4
|
+
*
|
|
5
|
+
* `collectLedger` runs every collector for a time range and joins the
|
|
6
|
+
* attribution sources; the pure functions below turn rows into the views'
|
|
7
|
+
* numbers (so they are unit-testable without any store on disk).
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.LIMIT_REPEAT_GAP_MS = void 0;
|
|
44
|
+
exports.defaultLedgerPaths = defaultLedgerPaths;
|
|
45
|
+
exports.collectLedger = collectLedger;
|
|
46
|
+
exports.rowTotal = rowTotal;
|
|
47
|
+
exports.totalsOf = totalsOf;
|
|
48
|
+
exports.groupRows = groupRows;
|
|
49
|
+
exports.modelCoverage = modelCoverage;
|
|
50
|
+
exports.summarizeSessions = summarizeSessions;
|
|
51
|
+
exports.hourlyBurn = hourlyBurn;
|
|
52
|
+
exports.collapseLimitEvents = collapseLimitEvents;
|
|
53
|
+
exports.limitContexts = limitContexts;
|
|
54
|
+
const os = __importStar(require("node:os"));
|
|
55
|
+
const path = __importStar(require("node:path"));
|
|
56
|
+
const core_1 = require("@ai-dossier/core");
|
|
57
|
+
const collect_claude_1 = require("./collect-claude");
|
|
58
|
+
const collect_dispatch_1 = require("./collect-dispatch");
|
|
59
|
+
const collect_opencode_1 = require("./collect-opencode");
|
|
60
|
+
function defaultLedgerPaths(env = process.env) {
|
|
61
|
+
return {
|
|
62
|
+
claudeProjectsDir: (0, collect_claude_1.defaultClaudeProjectsDir)(env),
|
|
63
|
+
opencodeDb: (0, collect_opencode_1.defaultOpenCodeDbPath)(env),
|
|
64
|
+
schedRoot: path.join(os.homedir(), '.dossier', 'sched'),
|
|
65
|
+
runsLog: (0, core_1.runsLogPath)(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** Run every collector for `[sinceMs, untilMs)` and join attribution. Read-only; never throws for a missing store. */
|
|
69
|
+
function collectLedger(opts) {
|
|
70
|
+
const host = opts.host ?? os.hostname();
|
|
71
|
+
const collectors = [];
|
|
72
|
+
const rows = [];
|
|
73
|
+
const limits = [];
|
|
74
|
+
const claude = (0, collect_claude_1.collectClaude)({
|
|
75
|
+
projectsDir: opts.paths.claudeProjectsDir,
|
|
76
|
+
sinceMs: opts.sinceMs,
|
|
77
|
+
untilMs: opts.untilMs,
|
|
78
|
+
host,
|
|
79
|
+
});
|
|
80
|
+
rows.push(...claude.rows);
|
|
81
|
+
limits.push(...claude.limits);
|
|
82
|
+
collectors.push({
|
|
83
|
+
source: 'claude-code',
|
|
84
|
+
status: 'ok',
|
|
85
|
+
rows: claude.rows.length,
|
|
86
|
+
detail: `${claude.files} transcript(s) under ${opts.paths.claudeProjectsDir}`,
|
|
87
|
+
});
|
|
88
|
+
const opened = (opts.openOpenCode ?? collect_opencode_1.openOpenCodeDb)(opts.paths.opencodeDb);
|
|
89
|
+
if (opened.status === 'ok') {
|
|
90
|
+
try {
|
|
91
|
+
const oc = (0, collect_opencode_1.collectOpenCode)({
|
|
92
|
+
reader: opened.reader,
|
|
93
|
+
sinceMs: opts.sinceMs,
|
|
94
|
+
untilMs: opts.untilMs,
|
|
95
|
+
host,
|
|
96
|
+
});
|
|
97
|
+
rows.push(...oc);
|
|
98
|
+
collectors.push({ source: 'opencode', status: 'ok', rows: oc.length });
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
collectors.push({
|
|
102
|
+
source: 'opencode',
|
|
103
|
+
status: 'error',
|
|
104
|
+
rows: 0,
|
|
105
|
+
detail: err.message,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
opened.reader.close();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
collectors.push({ source: 'opencode', status: opened.status, rows: 0, detail: opened.detail });
|
|
114
|
+
}
|
|
115
|
+
const index = (0, collect_dispatch_1.indexDispatchLogs)(opts.paths.schedRoot, opts.sinceMs);
|
|
116
|
+
(0, collect_dispatch_1.applyDispatchIndex)(rows, index);
|
|
117
|
+
collectors.push({ source: 'sched-dispatch-logs', status: 'ok', rows: index.size });
|
|
118
|
+
limits.push(...(0, collect_dispatch_1.collectSchedLimitEvents)(opts.paths.schedRoot, opts.sinceMs, opts.untilMs, host));
|
|
119
|
+
limits.sort((a, b) => a.ts.localeCompare(b.ts));
|
|
120
|
+
const dossierRuns = (0, collect_dispatch_1.countDossierRuns)(opts.paths.runsLog, opts.sinceMs, opts.untilMs);
|
|
121
|
+
collectors.push({ source: 'dossier-runs', status: 'ok', rows: dossierRuns.size });
|
|
122
|
+
rows.sort((a, b) => a.ts.localeCompare(b.ts));
|
|
123
|
+
return { rows, limits, collectors, dossierRuns };
|
|
124
|
+
}
|
|
125
|
+
function rowTotal(row) {
|
|
126
|
+
return row.input + row.output + row.reasoning + row.cache_read + row.cache_write;
|
|
127
|
+
}
|
|
128
|
+
function totalsOf(rows) {
|
|
129
|
+
const t = {
|
|
130
|
+
input: 0,
|
|
131
|
+
output: 0,
|
|
132
|
+
reasoning: 0,
|
|
133
|
+
cache_read: 0,
|
|
134
|
+
cache_write: 0,
|
|
135
|
+
total: 0,
|
|
136
|
+
cost_usd: null,
|
|
137
|
+
messages: rows.length,
|
|
138
|
+
};
|
|
139
|
+
for (const row of rows) {
|
|
140
|
+
t.input += row.input;
|
|
141
|
+
t.output += row.output;
|
|
142
|
+
t.reasoning += row.reasoning;
|
|
143
|
+
t.cache_read += row.cache_read;
|
|
144
|
+
t.cache_write += row.cache_write;
|
|
145
|
+
t.total += rowTotal(row);
|
|
146
|
+
if (row.cost_usd !== null)
|
|
147
|
+
t.cost_usd = (t.cost_usd ?? 0) + row.cost_usd;
|
|
148
|
+
}
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
/** Group rows by `keyOf`, largest total first. */
|
|
152
|
+
function groupRows(rows, keyOf) {
|
|
153
|
+
const groups = new Map();
|
|
154
|
+
for (const row of rows) {
|
|
155
|
+
const key = keyOf(row);
|
|
156
|
+
const list = groups.get(key);
|
|
157
|
+
if (list)
|
|
158
|
+
list.push(row);
|
|
159
|
+
else
|
|
160
|
+
groups.set(key, [row]);
|
|
161
|
+
}
|
|
162
|
+
return [...groups.entries()]
|
|
163
|
+
.map(([key, list]) => ({ key, ...totalsOf(list) }))
|
|
164
|
+
.sort((a, b) => b.total - a.total || a.key.localeCompare(b.key));
|
|
165
|
+
}
|
|
166
|
+
/** Share of tokens (0..1) attributed to a concrete model id; 1 for an empty set. */
|
|
167
|
+
function modelCoverage(rows) {
|
|
168
|
+
let all = 0;
|
|
169
|
+
let known = 0;
|
|
170
|
+
for (const row of rows) {
|
|
171
|
+
const n = rowTotal(row);
|
|
172
|
+
all += n;
|
|
173
|
+
if (row.model)
|
|
174
|
+
known += n;
|
|
175
|
+
}
|
|
176
|
+
return all === 0 ? 1 : known / all;
|
|
177
|
+
}
|
|
178
|
+
/** Per-session totals, largest first. */
|
|
179
|
+
function summarizeSessions(rows) {
|
|
180
|
+
const bySession = new Map();
|
|
181
|
+
for (const row of rows) {
|
|
182
|
+
const list = bySession.get(row.session_id);
|
|
183
|
+
if (list)
|
|
184
|
+
list.push(row);
|
|
185
|
+
else
|
|
186
|
+
bySession.set(row.session_id, [row]);
|
|
187
|
+
}
|
|
188
|
+
const out = [];
|
|
189
|
+
for (const [session_id, list] of bySession) {
|
|
190
|
+
const first = list[0];
|
|
191
|
+
const models = [...new Set(list.map((r) => r.model).filter((m) => !!m))].sort();
|
|
192
|
+
const withIssue = list.find((r) => r.issue !== null);
|
|
193
|
+
out.push({
|
|
194
|
+
session_id,
|
|
195
|
+
parent_session_id: first.parent_session_id,
|
|
196
|
+
source: first.source,
|
|
197
|
+
models,
|
|
198
|
+
project: first.project,
|
|
199
|
+
issue: withIssue?.issue ?? null,
|
|
200
|
+
batch: list.find((r) => r.batch)?.batch ?? null,
|
|
201
|
+
unit: list.find((r) => r.unit)?.unit ?? null,
|
|
202
|
+
title: first.title,
|
|
203
|
+
first_ts: list.reduce((m, r) => (r.ts < m ? r.ts : m), first.ts),
|
|
204
|
+
last_ts: list.reduce((m, r) => (r.ts > m ? r.ts : m), first.ts),
|
|
205
|
+
...totalsOf(list),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return out.sort((a, b) => b.total - a.total || a.session_id.localeCompare(b.session_id));
|
|
209
|
+
}
|
|
210
|
+
/** Tokens per clock hour across `[sinceMs, untilMs)`, oldest first — the burn-rate series. */
|
|
211
|
+
function hourlyBurn(rows, sinceMs, untilMs) {
|
|
212
|
+
const HOUR = 3_600_000;
|
|
213
|
+
const start = Math.floor(sinceMs / HOUR) * HOUR;
|
|
214
|
+
const buckets = new Map();
|
|
215
|
+
for (let h = start; h < untilMs; h += HOUR)
|
|
216
|
+
buckets.set(h, { total: 0, messages: 0 });
|
|
217
|
+
for (const row of rows) {
|
|
218
|
+
const h = Math.floor(Date.parse(row.ts) / HOUR) * HOUR;
|
|
219
|
+
const bucket = buckets.get(h);
|
|
220
|
+
if (!bucket)
|
|
221
|
+
continue;
|
|
222
|
+
bucket.total += rowTotal(row);
|
|
223
|
+
bucket.messages += 1;
|
|
224
|
+
}
|
|
225
|
+
return [...buckets.entries()].map(([h, b]) => ({ hour: new Date(h).toISOString(), ...b }));
|
|
226
|
+
}
|
|
227
|
+
/** Repeats closer than this fold into one limit event (agents/cron retry a wall every few minutes). */
|
|
228
|
+
exports.LIMIT_REPEAT_GAP_MS = 60 * 60 * 1000;
|
|
229
|
+
/**
|
|
230
|
+
* Fold repeats of the same wall (same source, unit and message) into their
|
|
231
|
+
* first occurrence — `count`/`last_ts` record what was folded. A wall hit by a
|
|
232
|
+
* cron every 15 minutes is one event, not twenty; its onset is what needs
|
|
233
|
+
* explaining. Input must be sorted by `ts`.
|
|
234
|
+
*/
|
|
235
|
+
function collapseLimitEvents(events, gapMs = exports.LIMIT_REPEAT_GAP_MS) {
|
|
236
|
+
const open = new Map();
|
|
237
|
+
const out = [];
|
|
238
|
+
for (const event of events) {
|
|
239
|
+
const key = `${event.source}\u0000${event.unit ?? ''}\u0000${event.detail}`;
|
|
240
|
+
const current = open.get(key);
|
|
241
|
+
const lastMs = current ? Date.parse(current.last_ts ?? current.ts) : Number.NaN;
|
|
242
|
+
if (current && Date.parse(event.ts) - lastMs <= gapMs) {
|
|
243
|
+
current.count = (current.count ?? 1) + 1;
|
|
244
|
+
current.last_ts = event.ts;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const fresh = { ...event, count: 1, last_ts: event.ts };
|
|
248
|
+
open.set(key, fresh);
|
|
249
|
+
out.push(fresh);
|
|
250
|
+
}
|
|
251
|
+
return out;
|
|
252
|
+
}
|
|
253
|
+
/** For each limit event, the top `n` sessions by tokens in the `windowMs` before it. */
|
|
254
|
+
function limitContexts(limits, rows, windowMs, n = 3) {
|
|
255
|
+
return limits.map((event) => {
|
|
256
|
+
const end = Date.parse(event.ts);
|
|
257
|
+
const start = end - windowMs;
|
|
258
|
+
const inWindow = rows.filter((r) => {
|
|
259
|
+
const t = Date.parse(r.ts);
|
|
260
|
+
if (t < start || t > end)
|
|
261
|
+
return false;
|
|
262
|
+
// Claude limit events can only be explained by Anthropic spend.
|
|
263
|
+
return event.provider === null || r.provider === event.provider;
|
|
264
|
+
});
|
|
265
|
+
return { event, top: summarizeSessions(inWindow).slice(0, n), window_ms: windowMs };
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/usage/ledger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BH,gDAOC;AAYD,sCA0DC;AAmBD,4BAEC;AAED,4BAqBC;AAOD,8BAcC;AAGD,sCASC;AAiBD,8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its source store into {@link UsageRow} — one row
|
|
5
|
+
* per assistant message (the finest grain every store shares), so a view can
|
|
6
|
+
* group by model × source × project × issue × session without caring which
|
|
7
|
+
* tool produced the tokens.
|
|
8
|
+
*/
|
|
9
|
+
/** Which store a row was read from. */
|
|
10
|
+
export type UsageSource = 'claude-code' | 'opencode';
|
|
11
|
+
/** How a row's `issue` was attributed — a sched dispatch log is authoritative; a branch/dir name is a heuristic. */
|
|
12
|
+
export type IssueSource = 'dispatch' | 'branch';
|
|
13
|
+
export interface UsageRow {
|
|
14
|
+
/** ISO-8601 time the message completed (or was created, when no completion time is recorded). */
|
|
15
|
+
ts: string;
|
|
16
|
+
/** Host that produced the row (`os.hostname()` of the collecting machine). */
|
|
17
|
+
host: string;
|
|
18
|
+
/** Provider that served the tokens — `anthropic` for Claude Code, opencode's own `providerID` otherwise. */
|
|
19
|
+
provider: string;
|
|
20
|
+
/** Concrete model id as the provider reported it, or null when the store recorded none. */
|
|
21
|
+
model: string | null;
|
|
22
|
+
input: number;
|
|
23
|
+
output: number;
|
|
24
|
+
/** Reasoning tokens reported separately (opencode); Claude folds thinking into `output`. */
|
|
25
|
+
reasoning: number;
|
|
26
|
+
cache_read: number;
|
|
27
|
+
cache_write: number;
|
|
28
|
+
/** Cost the source recorded, or null when it records none (Claude Code transcripts carry no cost). */
|
|
29
|
+
cost_usd: number | null;
|
|
30
|
+
source: UsageSource;
|
|
31
|
+
/** Session the message belongs to — a Claude Code subagent is `<parent>/<agentId>`. */
|
|
32
|
+
session_id: string;
|
|
33
|
+
/** Parent session for subagents (Claude Code sidechains, opencode child sessions); null for a top-level session. */
|
|
34
|
+
parent_session_id: string | null;
|
|
35
|
+
/** Human label for the session when the store has one (opencode title, Claude subagent description). */
|
|
36
|
+
title: string | null;
|
|
37
|
+
cwd: string | null;
|
|
38
|
+
project: string | null;
|
|
39
|
+
branch: string | null;
|
|
40
|
+
issue: number | null;
|
|
41
|
+
issue_source: IssueSource | null;
|
|
42
|
+
batch: string | null;
|
|
43
|
+
/** Scheduler unit (`issue:<n>`, `batch:<id>`) when the session was sched-dispatched. */
|
|
44
|
+
unit: string | null;
|
|
45
|
+
}
|
|
46
|
+
/** A provider limit / rate-limit wall observed in a source store. */
|
|
47
|
+
export interface LimitEvent {
|
|
48
|
+
ts: string;
|
|
49
|
+
host: string;
|
|
50
|
+
/** Where the event was recorded. */
|
|
51
|
+
source: 'claude-code' | 'sched';
|
|
52
|
+
/** Provider hint — `anthropic` for Claude Code rows; sched events name none (null). */
|
|
53
|
+
provider: string | null;
|
|
54
|
+
session_id: string | null;
|
|
55
|
+
unit: string | null;
|
|
56
|
+
/** HTTP status when the store recorded one (e.g. 429). */
|
|
57
|
+
status: number | null;
|
|
58
|
+
/** The provider's own message, truncated. */
|
|
59
|
+
detail: string;
|
|
60
|
+
/** How many identical events this one stands for after {@link collapseLimitEvents}-style grouping (1 = itself). */
|
|
61
|
+
count?: number;
|
|
62
|
+
/** Timestamp of the last event folded into this one. */
|
|
63
|
+
last_ts?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Whether a collector ran, so a view can say "opencode: unavailable" instead of silently reporting zero. */
|
|
66
|
+
export interface CollectorStatus {
|
|
67
|
+
source: string;
|
|
68
|
+
status: 'ok' | 'unavailable' | 'error';
|
|
69
|
+
rows: number;
|
|
70
|
+
detail?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Everything one collection pass produced. */
|
|
73
|
+
export interface Ledger {
|
|
74
|
+
rows: UsageRow[];
|
|
75
|
+
limits: LimitEvent[];
|
|
76
|
+
collectors: CollectorStatus[];
|
|
77
|
+
/** `session_id` → number of `ai-dossier run` invocations recorded from that session (runs.jsonl). */
|
|
78
|
+
dossierRuns: Map<string, number>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/usage/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;A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C;IAChC,uFAAuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,mHAAmH;IACnH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,6GAA6G;AAC7G,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,GAAG,aAAa,GAAG,OAAO,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,+CAA+C;AAC/C,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,qGAAqG;IACrG,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Row shapes for the cross-provider token ledger (`ai-dossier usage`, #769).
|
|
4
|
+
*
|
|
5
|
+
* Every collector normalizes its source store into {@link UsageRow} — one row
|
|
6
|
+
* per assistant message (the finest grain every store shares), so a view can
|
|
7
|
+
* group by model × source × project × issue × session without caring which
|
|
8
|
+
* tool produced the tokens.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/usage/types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small shared helpers for the usage collectors (#769).
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
/**
|
|
6
|
+
* Call `onLine` for every line of `file`, reading it in fixed-size chunks so a
|
|
7
|
+
* multi-hundred-MB transcript never has to fit in memory as one string.
|
|
8
|
+
* Never throws: an unreadable file yields no lines and returns false.
|
|
9
|
+
*/
|
|
10
|
+
export declare function forEachLine(file: string, onLine: (line: string) => void): boolean;
|
|
11
|
+
/** Directory entries of `dir`, or `[]` when it does not exist / cannot be read. */
|
|
12
|
+
export declare function safeReaddir(dir: string): fs.Dirent[];
|
|
13
|
+
/** File mtime in ms, or null when the file cannot be stat'ed. */
|
|
14
|
+
export declare function mtimeMs(file: string): number | null;
|
|
15
|
+
/**
|
|
16
|
+
* A short project name for a working directory: the directory that holds a
|
|
17
|
+
* `worktrees/` checkout (`…/ai-dossier/worktrees/feat-x` → `ai-dossier`), the
|
|
18
|
+
* parent of a `main/` worktree (`…/ai-dossier/main` → `ai-dossier`), else the
|
|
19
|
+
* directory's own basename.
|
|
20
|
+
*/
|
|
21
|
+
export declare function projectOf(cwd: string | null | undefined): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The issue number a branch or worktree name refers to — `feat/769-usage`,
|
|
24
|
+
* `fix-4360-x`, `issue-12` — or null. Heuristic by nature (callers label it
|
|
25
|
+
* `issue_source: 'branch'`): it takes the first 2–6 digit number without a
|
|
26
|
+
* leading zero that stands alone between separators, which skips date-like
|
|
27
|
+
* batch ids (`b-20260920-01`) and pool worktree timestamps.
|
|
28
|
+
*/
|
|
29
|
+
export declare function issueFromRef(ref: string | null | undefined): number | null;
|
|
30
|
+
/** Non-negative finite number, else 0 — source stores are untrusted JSON. */
|
|
31
|
+
export declare function count(value: unknown): number;
|
|
32
|
+
/** Trim a free-text field from an untrusted store to one short line. */
|
|
33
|
+
export declare function oneLine(text: unknown, max?: number): string;
|
|
34
|
+
/** Matches provider limit / rate-limit wording in error text. */
|
|
35
|
+
export declare const LIMIT_TEXT_RE: RegExp;
|
|
36
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/usage/util.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAM9B;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAmCjF;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAMpD;AAED,iEAAiE;AACjE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQvE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAI1E;AAED,6EAA6E;AAC7E,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAM,GAAG,MAAM,CAIxD;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,QACqH,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Small shared helpers for the usage collectors (#769).
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.LIMIT_TEXT_RE = void 0;
|
|
40
|
+
exports.forEachLine = forEachLine;
|
|
41
|
+
exports.safeReaddir = safeReaddir;
|
|
42
|
+
exports.mtimeMs = mtimeMs;
|
|
43
|
+
exports.projectOf = projectOf;
|
|
44
|
+
exports.issueFromRef = issueFromRef;
|
|
45
|
+
exports.count = count;
|
|
46
|
+
exports.oneLine = oneLine;
|
|
47
|
+
const fs = __importStar(require("node:fs"));
|
|
48
|
+
const path = __importStar(require("node:path"));
|
|
49
|
+
/** Bytes read per chunk by {@link forEachLine} — bounded memory regardless of file size. */
|
|
50
|
+
const LINE_CHUNK_BYTES = 1024 * 1024;
|
|
51
|
+
/**
|
|
52
|
+
* Call `onLine` for every line of `file`, reading it in fixed-size chunks so a
|
|
53
|
+
* multi-hundred-MB transcript never has to fit in memory as one string.
|
|
54
|
+
* Never throws: an unreadable file yields no lines and returns false.
|
|
55
|
+
*/
|
|
56
|
+
function forEachLine(file, onLine) {
|
|
57
|
+
let fd = null;
|
|
58
|
+
try {
|
|
59
|
+
fd = fs.openSync(file, 'r');
|
|
60
|
+
const buffer = Buffer.allocUnsafe(LINE_CHUNK_BYTES);
|
|
61
|
+
let carry = Buffer.alloc(0);
|
|
62
|
+
let read = 0;
|
|
63
|
+
do {
|
|
64
|
+
read = fs.readSync(fd, buffer, 0, LINE_CHUNK_BYTES, null);
|
|
65
|
+
let chunk = read > 0 ? Buffer.concat([carry, buffer.subarray(0, read)]) : carry;
|
|
66
|
+
let start = 0;
|
|
67
|
+
for (let nl = chunk.indexOf(10, start); nl !== -1; nl = chunk.indexOf(10, start)) {
|
|
68
|
+
const line = chunk.subarray(start, nl).toString('utf-8');
|
|
69
|
+
if (line)
|
|
70
|
+
onLine(line);
|
|
71
|
+
start = nl + 1;
|
|
72
|
+
}
|
|
73
|
+
chunk = chunk.subarray(start);
|
|
74
|
+
if (read === 0) {
|
|
75
|
+
if (chunk.length > 0)
|
|
76
|
+
onLine(chunk.toString('utf-8'));
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
carry = Buffer.from(chunk);
|
|
80
|
+
} while (read > 0);
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
if (fd !== null) {
|
|
88
|
+
try {
|
|
89
|
+
fs.closeSync(fd);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// already closed
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** Directory entries of `dir`, or `[]` when it does not exist / cannot be read. */
|
|
98
|
+
function safeReaddir(dir) {
|
|
99
|
+
try {
|
|
100
|
+
return fs.readdirSync(dir, { withFileTypes: true });
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** File mtime in ms, or null when the file cannot be stat'ed. */
|
|
107
|
+
function mtimeMs(file) {
|
|
108
|
+
try {
|
|
109
|
+
return fs.statSync(file).mtimeMs;
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A short project name for a working directory: the directory that holds a
|
|
117
|
+
* `worktrees/` checkout (`…/ai-dossier/worktrees/feat-x` → `ai-dossier`), the
|
|
118
|
+
* parent of a `main/` worktree (`…/ai-dossier/main` → `ai-dossier`), else the
|
|
119
|
+
* directory's own basename.
|
|
120
|
+
*/
|
|
121
|
+
function projectOf(cwd) {
|
|
122
|
+
if (!cwd)
|
|
123
|
+
return null;
|
|
124
|
+
const parts = path.resolve(cwd).split(path.sep).filter(Boolean);
|
|
125
|
+
const wt = parts.lastIndexOf('worktrees');
|
|
126
|
+
if (wt > 0)
|
|
127
|
+
return parts[wt - 1];
|
|
128
|
+
const last = parts[parts.length - 1];
|
|
129
|
+
if (last === 'main' && parts.length > 1)
|
|
130
|
+
return parts[parts.length - 2];
|
|
131
|
+
return last ?? null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The issue number a branch or worktree name refers to — `feat/769-usage`,
|
|
135
|
+
* `fix-4360-x`, `issue-12` — or null. Heuristic by nature (callers label it
|
|
136
|
+
* `issue_source: 'branch'`): it takes the first 2–6 digit number without a
|
|
137
|
+
* leading zero that stands alone between separators, which skips date-like
|
|
138
|
+
* batch ids (`b-20260920-01`) and pool worktree timestamps.
|
|
139
|
+
*/
|
|
140
|
+
function issueFromRef(ref) {
|
|
141
|
+
if (!ref)
|
|
142
|
+
return null;
|
|
143
|
+
const match = ref.match(/(?:^|[/_-])(?:issue-?|gh-?)?([1-9]\d{1,5})(?=$|[/_-])/i);
|
|
144
|
+
return match ? Number.parseInt(match[1], 10) : null;
|
|
145
|
+
}
|
|
146
|
+
/** Non-negative finite number, else 0 — source stores are untrusted JSON. */
|
|
147
|
+
function count(value) {
|
|
148
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;
|
|
149
|
+
}
|
|
150
|
+
/** Trim a free-text field from an untrusted store to one short line. */
|
|
151
|
+
function oneLine(text, max = 200) {
|
|
152
|
+
const s = typeof text === 'string' ? text : '';
|
|
153
|
+
const flat = s.replace(/\s+/g, ' ').trim();
|
|
154
|
+
return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;
|
|
155
|
+
}
|
|
156
|
+
/** Matches provider limit / rate-limit wording in error text. */
|
|
157
|
+
exports.LIMIT_TEXT_RE = /usage limit|rate[ -]?limit|spend limit|hit your (?:\w+ )?limit|limit reached|limit will reset|limit resets|quota|too many requests|\b429\b/i;
|
|
158
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/usage/util.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaH,kCAmCC;AAGD,kCAMC;AAGD,0BAMC;AAQD,8BAQC;AASD,oCAIC;AAGD,sBAEC;AAGD,0BAIC;AAzGD,4CAA8B;AAC9B,gDAAkC;AAElC,4FAA4F;AAC5F,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI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AC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACjE,CAAC;AAED,iEAAiE;AACpD,QAAA,aAAa,GACxB,6IAA6I,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-dossier/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Create, verify, sign, publish, and run dossiers — portable, signed, versioned skills for any LLM tool. The dossier ⇄ Claude Code skill bridge (install-skill / skill-export).",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@ai-dossier/core": "^1.9.0",
|
|
57
|
-
"@ai-dossier/sched": "^0.
|
|
57
|
+
"@ai-dossier/sched": "^0.45.0",
|
|
58
58
|
"@ai-dossier/worktree-pool": "^0.7.0",
|
|
59
59
|
"commander": "^12.1.0",
|
|
60
60
|
"yaml": "^2.8.3"
|