@agentguard-run/burn 0.3.3 → 0.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.5 (2026-09-22)
4
+
5
+ - Price `claude-opus-5-5` (4, 0.2, 5, 8, 20 USD per million tokens), `gpt-6-sol` (2, 0.2, 2.5, 10) and `gpt-6-luna` (0.1, 0.01, 0.125, 0.5) at the published list rates checked on 2026-09-22. The two OpenAI rows use the documented 272K input threshold for long-context pricing. Sessions on these models were previously reported as unpriced.
6
+ - Recorded renders use a showcase layout for live frames: seven-row spawn digits, the spawn-rate bar, a short explanation of what a spawn is and a boxed STOP card. Token and replay panels appear only when the recording measured them. Video output uses bold white text, a frame margin and CRF 16.
7
+
8
+ ## 0.3.4 (2026-09-22)
9
+
10
+ - Add local, read-only `limits` reports for Claude plan rejections, allowed warnings and HTTP 429 events, with reset interval arithmetic and nearby Burn decisions. Keep Codex limits unsupported and label proximity as correlation.
11
+ - Add local, read-only `price-shadow` reports for every stored shadow decision. Reuse provider response deduplication and pinned API list rates, retain missing evidence as unpriced, and show exposure after the first would-block point as an upper bound. Fable 5.1 and Sonnet 5 repricing is sensitivity, never measurement or a bill.
12
+
3
13
  ## 0.3.3 (2026-09-21)
4
14
 
5
15
  - Add developer-only `guard-candidates` to deduplicate shell text already recorded in local ledgers into private review files. Optional `--rank` uses jsort with an environment key, prints every provider request body before forwarding, and adds relative scores without changing hooks, policies or rules.
package/README.md CHANGED
@@ -211,6 +211,51 @@ stay unavailable. Use `blocks all json` for structured output. Session
211
211
  attribution uses local receipt identifiers without copying transcript content
212
212
  into the ledger.
213
213
 
214
+ ## Local limits and shadow exposure
215
+
216
+ ```sh
217
+ agentguard-burn limits
218
+ agentguard-burn limits SESSION_ID
219
+ agentguard-burn limits all
220
+ agentguard-burn price-shadow
221
+ agentguard-burn price-shadow SESSION_ID
222
+ agentguard-burn price-shadow all
223
+ ```
224
+
225
+ Both commands are read-only. They read the existing local host transcripts and
226
+ Burn ledgers, use no network or data plane, and do not load or change policy,
227
+ create receipts, or record frames. A session can also be a local transcript
228
+ path. Append `json` for structured arithmetic.
229
+
230
+ `limits` reports Claude Code plan-window rejections and allowed warnings, plus
231
+ HTTP 429 rate-limit errors. Each event shows its recorded time, window, reset,
232
+ model when present, and the closest earlier Burn WARN or STOP in that session.
233
+ The rollup counts rejected events, not allowed warnings. Reset durations use
234
+ the union of overlapping rejection-to-reset intervals, including across
235
+ sessions, so retries and shared windows do not multiply minutes. This is the
236
+ time until the recorded reset, not a measurement of time unable to work. An
237
+ absent reset stays unknown. Fan-out means a fanout, spawn_rate or depth finding
238
+ within the preceding 60 minutes. Proximity is correlation. Codex limits remain
239
+ unsupported until a verified transcript format is available.
240
+
241
+ `price-shadow` prices every explicitly recorded shadow decision using the
242
+ shipped API list snapshot, including OK and WARN rows. It includes only children
243
+ whose recorded start is strictly after that decision. Claude starts come from
244
+ the child's own sidechain user event or a timestamped fork marker; Codex starts
245
+ come from session metadata with explicit parent lineage. Existing children
246
+ that continue running after a decision do not enter its cohort. Copied parent
247
+ responses are excluded; provider response ids reconcile streaming updates and
248
+ copies across child transcripts. Medians and maxima use each child's full
249
+ available usage. Unknown starts, missing transcripts, unresolved spawn results
250
+ and unknown inherited-history boundaries are unpriced. Nothing is imputed.
251
+
252
+ Decision cohorts overlap. Totals use only the first would-block point per
253
+ session and label the resulting list-price exposure an upper bound. A known
254
+ priced subset is separate from an unpriced total. Fable 5.1 and Sonnet 5
255
+ reprice the same recorded token categories as sensitivity, never measurement.
256
+ Unknown cache-write lifetimes produce a range. Dollars are list-price
257
+ equivalents, not the bill. Neither command changes enforcement.
258
+
214
259
  Cache-read ratio was about 98% in the original calibration, healthy and pathological alike. It
215
260
  is shown as an explanation and never used to decide.
216
261
 
@@ -27,6 +27,8 @@ export declare class Canvas {
27
27
  });
28
28
  put(row: number, col: number, text: string, color?: CanvasColor): this;
29
29
  digits(row: number, col: number, value: string | number, color?: CanvasColor): this;
30
+ /** Seven-row block digits, two cells per pixel, for recorded showcase frames. */
31
+ bigDigits(row: number, col: number, value: string | number, color?: CanvasColor): this;
30
32
  bar(row: number, col: number, width: number, fraction: number, color?: CanvasColor): this;
31
33
  rule(row: number, col: number, width?: number): this;
32
34
  header(left?: string, right?: string): this;
@@ -18,6 +18,19 @@ const GLYPHS = {
18
18
  '8': ['█▀█', '█▀█', '█▄█'], '9': ['█▀█', '▀▀█', '▄▄█'],
19
19
  '.': [' ', ' ', '▄'], '-': [' ', '▀▀▀', ' '],
20
20
  };
21
+ const BIG_GLYPHS = {
22
+ '0': [' ### ', '# #', '# #', '# #', '# #', '# #', ' ### '],
23
+ '1': [' # ', ' ## ', ' # ', ' # ', ' # ', ' # ', ' ### '],
24
+ '2': [' ### ', '# #', ' #', ' # ', ' # ', ' # ', '#####'],
25
+ '3': ['#### ', ' #', ' #', ' ### ', ' #', ' #', '#### '],
26
+ '4': [' # ', ' ## ', ' # # ', '# # ', '#####', ' # ', ' # '],
27
+ '5': ['#####', '# ', '#### ', ' #', ' #', '# #', ' ### '],
28
+ '6': [' ### ', '# ', '# ', '#### ', '# #', '# #', ' ### '],
29
+ '7': ['#####', ' #', ' # ', ' # ', ' # ', ' # ', ' # '],
30
+ '8': [' ### ', '# #', '# #', ' ### ', '# #', '# #', ' ### '],
31
+ '9': [' ### ', '# #', '# #', ' ####', ' #', ' #', ' ### '],
32
+ '-': [' ', ' ', ' ', '#####', ' ', ' ', ' '],
33
+ };
21
34
  const colors = new Set(['mint', 'slate', 'amber', 'red', 'white', 'none']);
22
35
  function dimension(value, fallback, limit) {
23
36
  return Math.max(1, Math.min(limit, Math.floor(typeof value === 'number' && Number.isFinite(value) ? value : fallback)));
@@ -76,6 +89,19 @@ class Canvas {
76
89
  }
77
90
  return this;
78
91
  }
92
+ /** Seven-row block digits, two cells per pixel, for recorded showcase frames. */
93
+ bigDigits(row, col, value, color = 'mint') {
94
+ let x = col;
95
+ for (const char of characters(String(value))) {
96
+ const glyph = BIG_GLYPHS[char] ?? BIG_GLYPHS['-'];
97
+ for (let y = 0; y < 7; y++)
98
+ this.put(row + y, x, glyph[y].replace(/#/g, '██').replace(/ /g, ' '), color);
99
+ x += 12;
100
+ if (x >= this.width)
101
+ break;
102
+ }
103
+ return this;
104
+ }
79
105
  bar(row, col, width, fraction, color = 'mint') {
80
106
  if (!Number.isFinite(width) || width <= 0)
81
107
  return this;
package/dist/src/cli.js CHANGED
@@ -420,7 +420,7 @@ async function main(argv) {
420
420
  return 0;
421
421
  }
422
422
  default:
423
- show({ kind: 'command', command: 'help', values: { commands: ['ps', 'reap', 'live', 'record', 'render', 'blocks', 'why', 'rewrites', 'pace', 'statusline', 'pricing', 'replay', 'calibrate', 'status', 'init', 'enforce', 'shadow', 'resume', 'proxy', 'conformance'] } }, 'agentguard-burn <ps|reap|live|record|render|blocks|why|rewrites|pace|statusline|pricing|replay|calibrate|status|init|enforce|shadow|resume|proxy|conformance>\n' +
423
+ show({ kind: 'command', command: 'help', values: { commands: ['ps', 'reap', 'live', 'record', 'render', 'blocks', 'limits', 'price-shadow', 'why', 'rewrites', 'pace', 'statusline', 'pricing', 'replay', 'calibrate', 'status', 'init', 'enforce', 'shadow', 'resume', 'proxy', 'conformance'] } }, 'agentguard-burn <ps|reap|live|record|render|blocks|limits|price-shadow|why|rewrites|pace|statusline|pricing|replay|calibrate|status|init|enforce|shadow|resume|proxy|conformance>\n' +
424
424
  ' ps [--json] local agent processes, held memory and workspace disk\n' +
425
425
  ' render <run.jsonl> --mp4 <out.mp4> [--gif <out.gif>] local recorded-run export\n' +
426
426
  ' record --session <id> [--from <iso>] [--to <iso>] --out <run.jsonl> reconstruct local ledger frames\n' +
@@ -428,6 +428,8 @@ async function main(argv) {
428
428
  ' --record <file.jsonl> append structured frames for any command; --no-color keeps plain output\n' +
429
429
  ' reap numbered interactive SIGTERM, never delete or force-kill\n' +
430
430
  ' blocks [session|all] stored WARN/STOP receipts and that session\'s child usage\n' +
431
+ ' limits [session|all] local plan walls and prior Burn decisions\n' +
432
+ ' price-shadow [session|all] local child list-price exposure and sensitivity\n' +
431
433
  ' why [session] token attribution and API list-price equivalents\n' +
432
434
  ' rewrites [session|all] full-prefix cache writes by cause\n' +
433
435
  ' pace [session] ten-minute pace and next-hour projection\n' +
@@ -453,6 +455,24 @@ async function main(argv) {
453
455
  }
454
456
  async function run() {
455
457
  const parsed = (0, recording_1.recordingArguments)(process.argv.slice(2));
458
+ if (parsed.args[0] === 'limits' || parsed.args[0] === 'price-shadow') {
459
+ if (parsed.file)
460
+ throw new Error('These reports are read-only; recording is not supported.');
461
+ const args = parsed.args.slice(1), json = args.includes('json'), selectors = args.filter(arg => arg !== 'json');
462
+ if (selectors.length > 1 || selectors.some(arg => arg.startsWith('-')))
463
+ throw new Error(`Usage: agentguard-burn ${parsed.args[0]} [session|all] [json]`);
464
+ if (parsed.args[0] === 'limits') {
465
+ const { limitsReport, renderLimits } = await Promise.resolve().then(() => __importStar(require('./insights/limits')));
466
+ const report = limitsReport(HOME, selectors[0]);
467
+ process.stdout.write((json ? JSON.stringify(report, null, 2) : renderLimits(report)) + '\n');
468
+ }
469
+ else {
470
+ const { priceShadowReport, renderPriceShadow } = await Promise.resolve().then(() => __importStar(require('./insights/price-shadow')));
471
+ const report = priceShadowReport(HOME, selectors[0]);
472
+ process.stdout.write((json ? JSON.stringify(report, null, 2) : renderPriceShadow(report)) + '\n');
473
+ }
474
+ return 0;
475
+ }
456
476
  if (parsed.args[0] === 'guard-candidates') {
457
477
  if (parsed.file)
458
478
  throw new Error('guard-candidates creates review files only. --record is not supported.');
@@ -36,6 +36,7 @@ export type BurnFrame = {
36
36
  };
37
37
  export interface FrameOptions {
38
38
  recorded?: boolean;
39
+ showcase?: boolean;
39
40
  at?: string;
40
41
  width?: number;
41
42
  height?: number;
@@ -0,0 +1,34 @@
1
+ import { type TranscriptLocation } from './sessions';
2
+ export type Row = Record<string, unknown>;
3
+ export declare const object: (value: unknown) => Row;
4
+ export declare const identifier: (value: unknown) => string | null;
5
+ export declare function timestamp(value: unknown): number | null;
6
+ export interface Scan {
7
+ malformed: number;
8
+ }
9
+ /** Bounded input buffers; no transcript content is retained or written. */
10
+ export declare function jsonRows(file: string, scan?: Scan): Generator<Row>;
11
+ export interface HistoryDecision {
12
+ id: string;
13
+ session: string;
14
+ digest: string;
15
+ at: number | null;
16
+ verdict: 'OK' | 'WARN' | 'STOP';
17
+ mode: string | null;
18
+ blocked: boolean | null;
19
+ wouldBlock: boolean;
20
+ action: string | null;
21
+ detectors: string[];
22
+ }
23
+ /** The receipt and flat ledger are two views of a decision, not two decisions. */
24
+ export declare function historyDecisions(home: string): {
25
+ decisions: HistoryDecision[];
26
+ malformed: number;
27
+ };
28
+ export declare const locationId: (item: TranscriptLocation) => string;
29
+ export declare function selectHistory(session: string | undefined, locations: TranscriptLocation[], decisions: HistoryDecision[]): {
30
+ locations: TranscriptLocation[];
31
+ decisions: HistoryDecision[];
32
+ };
33
+ export declare function reportTable(headers: string[], rows: string[][]): string;
34
+ export declare const atText: (at: number | null) => string;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.atText = exports.locationId = exports.identifier = exports.object = void 0;
4
+ exports.timestamp = timestamp;
5
+ exports.jsonRows = jsonRows;
6
+ exports.historyDecisions = historyDecisions;
7
+ exports.selectHistory = selectHistory;
8
+ exports.reportTable = reportTable;
9
+ const node_fs_1 = require("node:fs");
10
+ const node_path_1 = require("node:path");
11
+ const node_string_decoder_1 = require("node:string_decoder");
12
+ const receipt_1 = require("../receipt");
13
+ const sessions_1 = require("./sessions");
14
+ const object = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
15
+ exports.object = object;
16
+ const identifier = (value) => typeof value === 'string' && /^[A-Za-z0-9_.:/-]{1,160}$/.test(value) ? value : null;
17
+ exports.identifier = identifier;
18
+ function timestamp(value) {
19
+ const n = typeof value === 'string' ? Date.parse(value) : typeof value === 'number' ? value : NaN;
20
+ return Number.isFinite(n) && n >= 0 && n <= 8.64e15 ? n : null;
21
+ }
22
+ /** Bounded input buffers; no transcript content is retained or written. */
23
+ function* jsonRows(file, scan = { malformed: 0 }) {
24
+ const fd = (0, node_fs_1.openSync)(file, 'r'), bytes = Buffer.alloc(64 * 1024), decoder = new node_string_decoder_1.StringDecoder('utf8');
25
+ let pending = '';
26
+ function parse(line) {
27
+ if (!line.trim())
28
+ return null;
29
+ try {
30
+ return (0, exports.object)(JSON.parse(line));
31
+ }
32
+ catch {
33
+ scan.malformed++;
34
+ return null;
35
+ }
36
+ }
37
+ try {
38
+ let length;
39
+ while ((length = (0, node_fs_1.readSync)(fd, bytes, 0, bytes.length, null))) {
40
+ pending += decoder.write(bytes.subarray(0, length));
41
+ let end;
42
+ while ((end = pending.indexOf('\n')) >= 0) {
43
+ const row = parse(pending.slice(0, end));
44
+ pending = pending.slice(end + 1);
45
+ if (row)
46
+ yield row;
47
+ }
48
+ }
49
+ const row = parse(pending + decoder.end());
50
+ if (row)
51
+ yield row;
52
+ }
53
+ finally {
54
+ (0, node_fs_1.closeSync)(fd);
55
+ }
56
+ }
57
+ /** The receipt and flat ledger are two views of a decision, not two decisions. */
58
+ function historyDecisions(home) {
59
+ const scan = { malformed: 0 }, decisions = [], matched = new Set();
60
+ for (const file of ['decisions.ndjson', 'receipts.ndjson']) {
61
+ try {
62
+ for (const raw of jsonRows((0, node_path_1.join)(home, file), scan)) {
63
+ const p = Object.keys((0, exports.object)(raw.payload)).length ? (0, exports.object)(raw.payload) : raw;
64
+ if (!['OK', 'WARN', 'STOP'].includes(String(p.verdict)))
65
+ continue;
66
+ const sessionId = (0, exports.identifier)(p.sessionId ?? p.session_id);
67
+ const digest = sessionId ? (0, receipt_1.sha256)(sessionId) : typeof p.sessionDigest === 'string' && /^[a-f0-9]{64}$/.test(p.sessionDigest) ? p.sessionDigest : null;
68
+ if (!digest)
69
+ continue;
70
+ const findings = Array.isArray(p.findings) ? p.findings.map(exports.object) : [];
71
+ const reasons = Array.isArray(p.reasons) ? p.reasons : findings.map(f => f.detector);
72
+ const row = {
73
+ id: (0, exports.identifier)(p.decisionId ?? p.toolUseId) ?? (0, receipt_1.sha256)(JSON.stringify(p)), session: sessionId ?? `sha256:${digest}`, digest,
74
+ at: timestamp(p.at ?? p.timestamp), verdict: p.verdict,
75
+ mode: (0, exports.identifier)(p.mode ?? (0, exports.object)(p.policy).mode),
76
+ blocked: typeof p.enforced === 'boolean' ? p.enforced : typeof p.blocked === 'boolean' ? p.blocked : null,
77
+ wouldBlock: typeof p.wouldDeny === 'boolean' ? p.wouldDeny : p.verdict === 'STOP', action: (0, exports.identifier)(p.action ?? p.tool),
78
+ detectors: [...new Set(reasons.flatMap(r => typeof r === 'string' && /^[a-z][a-z0-9_]*(?::(?:OK|WARN|STOP))?$/.test(r) ? [r.split(':')[0]] : []))],
79
+ };
80
+ const duplicate = file === 'receipts.ndjson' ? decisions.findIndex((d, i) => !matched.has(i) && d.digest === digest && d.at === row.at
81
+ && d.verdict === row.verdict && d.blocked === row.blocked && (!d.action || !row.action || d.action === row.action)) : -1;
82
+ if (duplicate >= 0) {
83
+ matched.add(duplicate);
84
+ const prior = decisions[duplicate];
85
+ decisions[duplicate] = { ...prior, id: row.id, mode: prior.mode ?? row.mode, detectors: [...new Set([...prior.detectors, ...row.detectors])] };
86
+ }
87
+ else
88
+ decisions.push(row);
89
+ }
90
+ }
91
+ catch (error) {
92
+ if (error.code !== 'ENOENT')
93
+ throw error;
94
+ }
95
+ }
96
+ return { decisions: decisions.sort((a, b) => (a.at ?? Infinity) - (b.at ?? Infinity)), malformed: scan.malformed };
97
+ }
98
+ const locationId = (item) => item.host === 'codex'
99
+ ? /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/i.exec(item.sessionId)?.[1] ?? item.sessionId : item.sessionId;
100
+ exports.locationId = locationId;
101
+ function selectHistory(session, locations, decisions) {
102
+ if (session === 'all')
103
+ return { locations, decisions };
104
+ const requested = session || process.env.AGENTGUARD_SESSION_ID || process.env.CLAUDE_SESSION_ID || process.env.CODEX_THREAD_ID;
105
+ let selected;
106
+ try {
107
+ selected = (0, sessions_1.selectInsightTranscript)(requested, locations.filter(l => !/[\\/]subagents[\\/]/.test(l.path)));
108
+ }
109
+ catch (error) {
110
+ if (!requested || !decisions.some(d => d.session === requested || d.digest === requested.replace(/^sha256:/, '') || d.digest === (0, receipt_1.sha256)(requested)))
111
+ throw error;
112
+ }
113
+ const ids = new Set([requested, selected?.sessionId, selected && (0, exports.locationId)(selected)].filter((x) => Boolean(x)));
114
+ const digests = new Set([...ids].flatMap(id => [(0, receipt_1.sha256)(id), id.replace(/^sha256:/, '')]));
115
+ return { locations: selected ? [selected] : [], decisions: decisions.filter(d => ids.has(d.session) || digests.has(d.digest)) };
116
+ }
117
+ function reportTable(headers, rows) {
118
+ const widths = headers.map((h, i) => rows.reduce((n, r) => Math.max(n, r[i]?.length ?? 0), h.length));
119
+ return [headers, ...rows].map(row => row.map((cell, i) => cell.padEnd(widths[i])).join(' ').trimEnd()).join('\n');
120
+ }
121
+ const atText = (at) => at === null ? 'unknown' : new Date(at).toISOString();
122
+ exports.atText = atText;
@@ -0,0 +1,50 @@
1
+ import { type HistoryDecision, type Row } from './history';
2
+ import { type TranscriptLocation } from './sessions';
3
+ export interface LimitEvent {
4
+ id: string;
5
+ at: number | null;
6
+ status: 'rejected' | 'allowed_warning' | 'rate_limit';
7
+ window: string | null;
8
+ resetsAt: number | null;
9
+ lockedMinutes: number | null;
10
+ model: string | null;
11
+ http429: boolean;
12
+ }
13
+ /** Known Claude metadata only. Text mentioning a limit is not a host event. */
14
+ export declare function parseLimitEvent(raw: Row): LimitEvent | null;
15
+ export interface CorrelatedLimit extends LimitEvent {
16
+ nearest: HistoryDecision | null;
17
+ gapMinutes: number | null;
18
+ fanoutWithin60: boolean;
19
+ }
20
+ export declare function correlateLimit(event: LimitEvent, decisions: HistoryDecision[]): CorrelatedLimit;
21
+ /** Union the recorded rejection-to-reset intervals, not repeated retry durations. */
22
+ export declare function lockedMinutes(events: LimitEvent[]): number;
23
+ export declare function limitsReport(home: string, session?: string, options?: {
24
+ locations?: TranscriptLocation[];
25
+ }): {
26
+ method: {
27
+ proximity: string;
28
+ duration: string;
29
+ codex: string;
30
+ };
31
+ sessions: {
32
+ events: CorrelatedLimit[];
33
+ lockedMinutes: number;
34
+ session: string;
35
+ host: string;
36
+ status: string;
37
+ unreadable: number;
38
+ }[];
39
+ totals: {
40
+ wallsHit: number;
41
+ warnings: number;
42
+ lockedMinutes: number;
43
+ sessionLockedMinutes: number;
44
+ unknownResetWalls: number;
45
+ fanoutWithin60: number;
46
+ unsupportedSessions: number;
47
+ };
48
+ malformedLines: number;
49
+ };
50
+ export declare function renderLimits(report: ReturnType<typeof limitsReport>): string;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseLimitEvent = parseLimitEvent;
4
+ exports.correlateLimit = correlateLimit;
5
+ exports.lockedMinutes = lockedMinutes;
6
+ exports.limitsReport = limitsReport;
7
+ exports.renderLimits = renderLimits;
8
+ const node_path_1 = require("node:path");
9
+ const receipt_1 = require("../receipt");
10
+ const history_1 = require("./history");
11
+ const sessions_1 = require("./sessions");
12
+ /** Known Claude metadata only. Text mentioning a limit is not a host event. */
13
+ function parseLimitEvent(raw) {
14
+ const info = (0, history_1.object)(raw.quotaLimits ?? raw.rateLimitInfo ?? raw.rateLimitEvent);
15
+ const error = (0, history_1.object)(raw.error);
16
+ const http429 = (raw.apiErrorStatus === 429 || raw.statusCode === 429 || error.status === 429)
17
+ && (raw.error === 'rate_limit' || error.type === 'rate_limit_error');
18
+ const status = info.status === 'rejected' || info.status === 'allowed_warning' ? info.status : http429 ? 'rate_limit' : null;
19
+ if (!status)
20
+ return null;
21
+ const at = (0, history_1.timestamp)(raw.timestamp ?? raw.at);
22
+ const resetsAt = typeof info.resetsAt === 'number' && Number.isFinite(info.resetsAt) && info.resetsAt > 0 ? (0, history_1.timestamp)(info.resetsAt * 1000) : null;
23
+ let detail = (0, history_1.object)(raw.errorDetails);
24
+ if (typeof raw.errorDetails === 'string') {
25
+ try {
26
+ detail = (0, history_1.object)(JSON.parse(raw.errorDetails.replace(/^429\s+/, '')));
27
+ }
28
+ catch { /* No free-text quota or date inference. */ }
29
+ }
30
+ const detailMessage = (0, history_1.object)(detail.error).message;
31
+ const namedModels = typeof detailMessage === 'string' ? [...new Set(detailMessage.match(/\bclaude-[a-z0-9]+(?:-[a-z0-9]+)+\b/g) ?? [])] : [];
32
+ const model = (0, history_1.identifier)(info.model ?? error.model ?? (0, history_1.object)(detail.error).model ?? detail.model ?? raw.model ?? (0, history_1.object)(raw.message).model)
33
+ ?? (http429 && namedModels.length === 1 ? namedModels[0] : null);
34
+ const value = { at, status, window: (0, history_1.identifier)(info.rateLimitType), resetsAt,
35
+ lockedMinutes: status === 'allowed_warning' && !http429 ? 0 : at !== null && resetsAt !== null ? Math.max(0, resetsAt - at) / 60000 : null,
36
+ model, http429 };
37
+ return { id: (0, history_1.identifier)(raw.uuid) ?? (0, receipt_1.sha256)(JSON.stringify(value)), ...value };
38
+ }
39
+ function correlateLimit(event, decisions) {
40
+ const before = event.at === null ? [] : decisions.filter(d => d.at !== null && d.at < event.at && (d.verdict === 'WARN' || d.verdict === 'STOP')).sort((a, b) => b.at - a.at);
41
+ const nearest = before[0] ?? null;
42
+ return { ...event, nearest, gapMinutes: nearest ? (event.at - nearest.at) / 60000 : null,
43
+ fanoutWithin60: before.some(d => event.at - d.at <= 3600000 && d.detectors.some(name => ['fanout', 'spawn_rate', 'depth'].includes(name))) };
44
+ }
45
+ /** Union the recorded rejection-to-reset intervals, not repeated retry durations. */
46
+ function lockedMinutes(events) {
47
+ const spans = events.filter(e => (e.status !== 'allowed_warning' || e.http429) && e.at !== null && e.resetsAt !== null && e.resetsAt > e.at)
48
+ .map(e => [e.at, e.resetsAt]).sort((a, b) => a[0] - b[0]);
49
+ let end = 0, total = 0;
50
+ for (const [start, reset] of spans) {
51
+ total += Math.max(0, reset - Math.max(start, end));
52
+ end = Math.max(end, reset);
53
+ }
54
+ return total / 60000;
55
+ }
56
+ function limitsReport(home, session, options = {}) {
57
+ const ledger = (0, history_1.historyDecisions)(home), all = options.locations ?? (0, sessions_1.discoverInsightTranscripts)();
58
+ const selected = (0, history_1.selectHistory)(session, all, ledger.decisions);
59
+ const groups = new Map();
60
+ const scan = { malformed: 0 };
61
+ const locations = session === 'all' ? all : selected.locations.flatMap(item => [item, ...all.filter(child => child.path.startsWith((0, node_path_1.join)(item.path.replace(/\.jsonl$/, ''), 'subagents') + '/'))]);
62
+ for (const item of locations) {
63
+ const id = item.host === 'claude' && (0, node_path_1.basename)((0, node_path_1.dirname)(item.path)) === 'subagents' ? (0, node_path_1.basename)((0, node_path_1.dirname)((0, node_path_1.dirname)(item.path))) : (0, history_1.locationId)(item);
64
+ let group = groups.get(id);
65
+ if (!group) {
66
+ group = { session: id, host: item.host, status: item.host === 'codex' ? 'unsupported' : 'supported', events: [], unreadable: 0 };
67
+ groups.set(id, group);
68
+ }
69
+ if (item.host === 'codex')
70
+ continue;
71
+ const decisions = ledger.decisions.filter(d => d.digest === (0, receipt_1.sha256)(id));
72
+ try {
73
+ for (const row of (0, history_1.jsonRows)(item.path, scan)) {
74
+ const event = parseLimitEvent(row);
75
+ if (event && !group.events.some(e => e.id === event.id))
76
+ group.events.push(correlateLimit(event, decisions));
77
+ }
78
+ }
79
+ catch {
80
+ group.unreadable++;
81
+ }
82
+ }
83
+ for (const d of selected.decisions)
84
+ if (![...groups.values()].some(g => (0, receipt_1.sha256)(g.session) === d.digest) && !groups.has(d.session))
85
+ groups.set(d.session, { session: d.session, host: 'unknown', status: 'transcript missing', events: [], unreadable: 1 });
86
+ const sessions = [...groups.values()].map(group => ({ ...group, events: group.events.sort((a, b) => (a.at ?? Infinity) - (b.at ?? Infinity)), lockedMinutes: lockedMinutes(group.events) }));
87
+ const events = sessions.flatMap(g => g.events), walls = events.filter(e => e.status !== 'allowed_warning' || e.http429);
88
+ return { method: { proximity: 'Proximity is correlation.', duration: 'Recorded rejection-to-reset interval union, not measured inability to work.', codex: 'unsupported' },
89
+ sessions, totals: { wallsHit: walls.length, warnings: events.length - walls.length, lockedMinutes: lockedMinutes(walls),
90
+ sessionLockedMinutes: sessions.reduce((n, s) => n + s.lockedMinutes, 0), unknownResetWalls: walls.filter(e => e.lockedMinutes === null).length,
91
+ fanoutWithin60: walls.filter(e => e.fanoutWithin60).length, unsupportedSessions: sessions.filter(s => s.status === 'unsupported').length },
92
+ malformedLines: scan.malformed + ledger.malformed };
93
+ }
94
+ function renderLimits(report) {
95
+ const lines = ['AgentGuard limits: local Claude Code plan-window events', 'Proximity is correlation, not evidence that fan-out caused a limit.',
96
+ 'Allowed warnings are not walls and add zero lockout minutes. HTTP 429 without a reset has unknown lockout.',
97
+ 'Minutes are time from rejection until the recorded reset, not measured time unable to work. Overlapping intervals count once.',
98
+ 'Codex limit format is unsupported. No Codex limits are inferred.'];
99
+ for (const s of report.sessions) {
100
+ lines.push('', `Session ${s.session} (${s.host}): ${s.status}`);
101
+ if (s.status === 'unsupported')
102
+ continue;
103
+ if (s.unreadable)
104
+ lines.push(`${s.unreadable} transcripts missing or unreadable. Coverage is incomplete.`);
105
+ if (!s.events.length) {
106
+ lines.push('No known limit events found in readable transcripts.');
107
+ continue;
108
+ }
109
+ lines.push((0, history_1.reportTable)(['Time (UTC)', 'Status', 'Window', 'Reset (UTC)', 'Locked minutes', 'Model', 'HTTP 429', 'Prior Burn', 'Gap minutes', 'Fan-out within 60 min'], s.events.map(e => [(0, history_1.atText)(e.at), e.status, e.window ?? 'unknown', (0, history_1.atText)(e.resetsAt), e.lockedMinutes?.toFixed(3) ?? 'unknown', e.model ?? 'unknown', e.http429 ? 'yes' : 'no',
110
+ e.nearest ? `${e.nearest.verdict} ${e.nearest.detectors.join(',')} at ${(0, history_1.atText)(e.nearest.at)}` : 'none', e.gapMinutes?.toFixed(3) ?? 'unknown', e.fanoutWithin60 ? 'yes' : 'no'])));
111
+ lines.push(`Session lockout interval union: ${s.lockedMinutes.toFixed(3)} minutes.`);
112
+ }
113
+ const t = report.totals;
114
+ lines.push('', `Rollup: ${t.wallsHit} walls hit; ${t.warnings} allowed warnings; ${t.lockedMinutes.toFixed(3)} minutes locked out until recorded resets (machine interval union).`, `Sum of session interval unions: ${t.sessionLockedMinutes.toFixed(3)} minutes. Concurrent sessions can share plan windows.`, `${t.unknownResetWalls} walls have unknown reset duration; ${t.fanoutWithin60} walls had a fan-out WARN or STOP within 60 minutes before them.`, `${t.unsupportedSessions} Codex sessions unsupported; ${report.malformedLines} malformed lines skipped. Proximity is correlation.`);
115
+ return lines.join('\n');
116
+ }
@@ -0,0 +1,84 @@
1
+ import { childStatistics, type ChildEconomics } from './blocks';
2
+ import { type DollarRange } from './pricing';
3
+ import { type TranscriptLocation } from './sessions';
4
+ export declare const PRICE_LABEL = "Dollars are list-price equivalents, not the bill.";
5
+ export interface ShadowChild extends ChildEconomics {
6
+ startedAt: number | null;
7
+ found: boolean;
8
+ models: string[];
9
+ responses: number;
10
+ reason: string | null;
11
+ }
12
+ export interface Exposure {
13
+ children: ShadowChild[];
14
+ statistics: ReturnType<typeof childStatistics>;
15
+ found: number;
16
+ unknownStartChildren: number;
17
+ unresolvedSpawns: number;
18
+ usd: DollarRange | null;
19
+ knownUsd: DollarRange;
20
+ sensitivities: Record<string, DollarRange | null>;
21
+ knownSensitivities: Record<string, DollarRange | null>;
22
+ modelMix: Array<{
23
+ model: string;
24
+ responses: number;
25
+ tokens: number;
26
+ usd: DollarRange | null;
27
+ input: number;
28
+ cacheRead: number;
29
+ cacheWrite: number;
30
+ write5m: number;
31
+ write1h: number;
32
+ writeUnknown: number;
33
+ output: number;
34
+ }>;
35
+ }
36
+ export declare function priceShadowReport(home: string, session?: string, options?: {
37
+ locations?: TranscriptLocation[];
38
+ }): {
39
+ method: {
40
+ dollars: string;
41
+ total: string;
42
+ sensitivity: string;
43
+ snapshot: string;
44
+ missing: string;
45
+ };
46
+ sessions: {
47
+ session: string;
48
+ notes: string[];
49
+ malformedLines: number;
50
+ decisions: {
51
+ exposure: Exposure;
52
+ id: string;
53
+ session: string;
54
+ digest: string;
55
+ at: number | null;
56
+ verdict: "OK" | "WARN" | "STOP";
57
+ mode: string | null;
58
+ blocked: boolean | null;
59
+ wouldBlock: boolean;
60
+ action: string | null;
61
+ detectors: string[];
62
+ }[];
63
+ firstWouldBlock: number | null;
64
+ hasWouldBlock: boolean;
65
+ total: Exposure | null;
66
+ }[];
67
+ totals: {
68
+ shadowDecisions: number;
69
+ wouldBlockDecisions: number;
70
+ sessionsWithWouldBlock: number;
71
+ unpricedSessions: number;
72
+ usd: DollarRange | null;
73
+ knownUsd: DollarRange;
74
+ sensitivities: {
75
+ [k: string]: DollarRange | null;
76
+ };
77
+ knownSensitivities: {
78
+ [k: string]: DollarRange | null;
79
+ };
80
+ };
81
+ pricing: Readonly<Record<string, import("./pricing").ModelPricing>>;
82
+ malformedLedgerLines: number;
83
+ };
84
+ export declare function renderPriceShadow(report: ReturnType<typeof priceShadowReport>): string;
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRICE_LABEL = void 0;
4
+ exports.priceShadowReport = priceShadowReport;
5
+ exports.renderPriceShadow = renderPriceShadow;
6
+ const node_fs_1 = require("node:fs");
7
+ const node_path_1 = require("node:path");
8
+ const receipt_1 = require("../receipt");
9
+ const blocks_1 = require("./blocks");
10
+ const history_1 = require("./history");
11
+ const pricing_1 = require("./pricing");
12
+ const render_1 = require("./render");
13
+ const sessions_1 = require("./sessions");
14
+ const transcript_1 = require("./transcript");
15
+ exports.PRICE_LABEL = 'Dollars are list-price equivalents, not the bill.';
16
+ const SENSITIVITY = ['claude-fable-5-1', 'claude-sonnet-5'];
17
+ /** Reuse the usage parser incrementally, retaining metadata and response counts only. */
18
+ function readHistory(location, onRow) {
19
+ let result = (0, transcript_1.parseInsightTranscript)('', { host: location.host, sessionId: (0, history_1.locationId)(location), spawnedSession: /[\\/]subagents[\\/]/.test(location.path) });
20
+ const scan = { malformed: 0 };
21
+ let batch = [];
22
+ const flush = () => { if (batch.length) {
23
+ result = (0, transcript_1.parseInsightTranscript)(batch.join('\n'), { state: result.state });
24
+ batch = [];
25
+ } };
26
+ for (const row of (0, history_1.jsonRows)(location.path, scan)) {
27
+ onRow(row);
28
+ batch.push(JSON.stringify(row));
29
+ if (batch.length >= 128)
30
+ flush();
31
+ }
32
+ flush();
33
+ result.diagnostics.malformedLines += scan.malformed;
34
+ return result;
35
+ }
36
+ /** Only structured tool results establish child ids. Never mine prompt text. */
37
+ function collectSpawns(row, calls) {
38
+ const message = (0, history_1.object)(row.message), payload = (0, history_1.object)(row.payload), at = (0, history_1.timestamp)(row.timestamp);
39
+ const content = Array.isArray(message.content) ? message.content.map(history_1.object) : [];
40
+ if (row.type === 'response_item')
41
+ content.push(payload);
42
+ for (const block of content) {
43
+ const name = (0, history_1.identifier)(block.name), id = (0, history_1.identifier)(block.id ?? block.call_id ?? block.tool_use_id);
44
+ if (!id)
45
+ continue;
46
+ if (['tool_use', 'function_call', 'custom_tool_call'].includes(String(block.type)) && name && /^(?:(?:functions\.)?(?:Agent|Task|spawn_agent))$/.test(name)) {
47
+ if (!calls.has(id))
48
+ calls.set(id, { at });
49
+ }
50
+ if (!['tool_result', 'function_call_output', 'custom_tool_call_output'].includes(String(block.type)))
51
+ continue;
52
+ const call = calls.get(id);
53
+ if (!call)
54
+ continue;
55
+ let result = (0, history_1.object)(row.toolUseResult);
56
+ if (typeof block.output === 'string') {
57
+ try {
58
+ result = (0, history_1.object)(JSON.parse(block.output));
59
+ }
60
+ catch { /* A text summary is not child lineage. */ }
61
+ }
62
+ const child = (0, history_1.identifier)(result.agentId ?? result.agent_id);
63
+ if (child)
64
+ call.child = child;
65
+ if (block.is_error === true || result.status === 'failed')
66
+ call.failed = true;
67
+ }
68
+ }
69
+ function loadChildren(parentLocation, locations) {
70
+ const notes = [], calls = new Map();
71
+ let parent;
72
+ try {
73
+ parent = readHistory(parentLocation, row => collectSpawns(row, calls));
74
+ }
75
+ catch {
76
+ return { children: [], available: false, notes: ['Parent transcript missing or unreadable: unpriced.'], malformed: 0, unresolved: [] };
77
+ }
78
+ const ids = new Set([parentLocation.sessionId, (0, history_1.locationId)(parentLocation), parent.state.lineage?.sessionId].filter(Boolean));
79
+ let candidates, available = true;
80
+ if (parentLocation.host === 'claude') {
81
+ const directory = (0, node_path_1.join)(parentLocation.path.replace(/\.jsonl$/, ''), 'subagents');
82
+ try {
83
+ candidates = (0, node_fs_1.readdirSync)(directory).filter(n => n.endsWith('.jsonl')).sort().map(n => ({ path: (0, node_path_1.join)(directory, n), host: 'claude', sessionId: (0, node_path_1.basename)(n, '.jsonl'), modifiedAt: 0 }));
84
+ }
85
+ catch {
86
+ candidates = [];
87
+ available = false;
88
+ notes.push('Child directory missing or unreadable: unpriced, never evidence of zero children.');
89
+ }
90
+ }
91
+ else
92
+ candidates = locations.filter(l => l.host === 'codex' && l.path !== parentLocation.path);
93
+ const children = [];
94
+ let malformed = parent.diagnostics.malformedLines;
95
+ for (const item of candidates) {
96
+ let startedAt = null, declaredParent = null;
97
+ const childName = (0, history_1.locationId)(item).replace(/^agent-/, '');
98
+ try {
99
+ const parsed = readHistory(item, row => {
100
+ if (row.type === 'session_meta') {
101
+ const p = (0, history_1.object)(row.payload);
102
+ declaredParent = (0, history_1.identifier)(p.parent_thread_id ?? (0, history_1.object)((0, history_1.object)((0, history_1.object)(p.source).subagent).thread_spawn).parent_thread_id);
103
+ startedAt = (0, history_1.timestamp)(p.timestamp ?? row.timestamp);
104
+ }
105
+ else if (row.type === 'fork-context-ref') {
106
+ declaredParent = (0, history_1.identifier)(row.parentSessionId);
107
+ startedAt = (0, history_1.timestamp)(row.timestamp);
108
+ }
109
+ else if (item.host === 'claude' && startedAt === null && row.type === 'user'
110
+ && (0, history_1.identifier)(row.agentId) === childName && row.isSidechain === true)
111
+ startedAt = (0, history_1.timestamp)(row.timestamp);
112
+ });
113
+ if ((declaredParent && !ids.has(declaredParent)) || (item.host === 'codex' && !declaredParent))
114
+ continue;
115
+ malformed += parsed.diagnostics.malformedLines;
116
+ children.push({ child: childName, startedAt, turns: parsed.turns, missing: false,
117
+ unknownBoundary: parsed.state.forkHistoryBoundaryUnknown === true, forked: parsed.state.lineage?.forked === true });
118
+ }
119
+ catch {
120
+ if (item.host === 'claude')
121
+ children.push({ child: childName, startedAt, turns: [], missing: true, unknownBoundary: false, forked: false });
122
+ else {
123
+ available = false;
124
+ notes.push('A Codex transcript is unreadable; child discovery is incomplete.');
125
+ }
126
+ }
127
+ }
128
+ for (const call of calls.values())
129
+ if (call.child && !call.failed && !children.some(c => c.child === call.child))
130
+ children.push({ child: call.child, startedAt: call.at, turns: [], missing: true, unknownBoundary: false, forked: false });
131
+ const parentIds = new Set(parent.turns.map(turn => turn.id));
132
+ const own = (0, transcript_1.deduplicateTurns)(children.flatMap(c => c.turns).filter(turn => !parentIds.has(turn.id)));
133
+ for (const child of children) {
134
+ const sessionIds = new Set(child.turns.map(t => t.sessionId));
135
+ child.turns = own.filter(t => sessionIds.has(t.sessionId));
136
+ }
137
+ if (malformed) {
138
+ available = false;
139
+ notes.push('Malformed transcript rows make full exposure unpriced; the known subset is shown separately.');
140
+ }
141
+ return { children, available, notes, malformed, unresolved: [...calls.values()].filter(c => !c.child && !c.failed).map(c => c.at) };
142
+ }
143
+ function exposure(history, at) {
144
+ const eligible = history.children.filter(c => at !== null && c.startedAt !== null && c.startedAt > at);
145
+ const unknown = history.children.filter(c => c.startedAt === null).length;
146
+ const unresolvedSpawns = history.unresolved.filter(start => start === null || at === null || start > at).length;
147
+ const children = eligible.map(c => {
148
+ const reason = c.missing ? 'transcript missing' : c.unknownBoundary ? 'inherited usage boundary unknown' : !c.turns.length ? 'no attributable usage' : null;
149
+ return { child: c.child, startedAt: c.startedAt, found: !c.missing, kind: c.forked ? 'fork' : 'fresh', forkContextRef: c.forked,
150
+ tokens: reason ? null : c.turns.reduce((n, t) => n + (0, render_1.totalTokens)(t), 0), usd: reason ? null : (0, render_1.sumPrices)(c.turns.map(t => (0, pricing_1.priceTurn)(t).usd)),
151
+ unknownModels: [...new Set(c.turns.filter(t => !(0, pricing_1.priceTurn)(t).usd).map(t => t.model ?? 'unknown'))],
152
+ models: [...new Set(c.turns.map(t => t.model ?? 'unknown'))], responses: c.turns.length, reason };
153
+ });
154
+ const complete = history.available && at !== null && !unknown && !unresolvedSpawns && children.every(c => c.tokens !== null);
155
+ const turns = (0, transcript_1.deduplicateTurns)(eligible.filter(c => !c.missing && !c.unknownBoundary).flatMap(c => c.turns));
156
+ const knownTurns = turns.filter(t => (0, pricing_1.priceTurn)(t).usd !== null);
157
+ const modelMix = [...new Set(turns.map(t => t.model ?? 'unknown'))].sort().map(model => {
158
+ const selected = turns.filter(t => (t.model ?? 'unknown') === model);
159
+ const sum = (key) => selected.reduce((n, t) => n + t[key], 0);
160
+ const writes = selected.reduce((totals, t) => {
161
+ const five = t.cacheWrite5mTokens ?? 0, hour = t.cacheWrite1hTokens ?? 0, other = t.cacheWriteTokens - five - hour;
162
+ totals.write5m += five + (t.cacheTtlSeconds === 300 ? other : 0);
163
+ totals.write1h += hour + (t.cacheTtlSeconds === 3600 ? other : 0);
164
+ totals.writeUnknown += t.cacheTtlSeconds ? 0 : other;
165
+ return totals;
166
+ }, { write5m: 0, write1h: 0, writeUnknown: 0 });
167
+ return { model, responses: selected.length, tokens: selected.reduce((n, t) => n + (0, render_1.totalTokens)(t), 0), usd: (0, render_1.sumPrices)(selected.map(t => (0, pricing_1.priceTurn)(t).usd)),
168
+ input: sum('inputTokens'), cacheRead: sum('cacheReadTokens'), cacheWrite: sum('cacheWriteTokens'), output: sum('outputTokens'), ...writes };
169
+ });
170
+ return { children, statistics: (0, blocks_1.childStatistics)(children), found: children.filter(c => c.found).length, unknownStartChildren: unknown, unresolvedSpawns,
171
+ usd: complete ? (0, render_1.sumPrices)(turns.map(t => (0, pricing_1.priceTurn)(t).usd)) : null,
172
+ knownUsd: (0, render_1.sumPrices)(turns.map(t => (0, pricing_1.priceTurn)(t).usd).filter((x) => x !== null)),
173
+ sensitivities: Object.fromEntries(SENSITIVITY.map(model => [model, complete ? (0, render_1.sumPrices)(turns.map(t => (0, pricing_1.priceTurn)({ ...t, model }).usd)) : null])),
174
+ knownSensitivities: Object.fromEntries(SENSITIVITY.map(model => [model, (0, render_1.sumPrices)(knownTurns.map(t => (0, pricing_1.priceTurn)({ ...t, model }).usd))])), modelMix };
175
+ }
176
+ function priceShadowReport(home, session, options = {}) {
177
+ const ledger = (0, history_1.historyDecisions)(home), locations = options.locations ?? (0, sessions_1.discoverInsightTranscripts)();
178
+ const selection = (0, history_1.selectHistory)(session, locations, ledger.decisions);
179
+ const decisions = selection.decisions.filter(d => d.mode === 'shadow' && d.blocked !== true);
180
+ const aliases = new Map();
181
+ for (const item of [...selection.locations, ...locations])
182
+ for (const id of [item.sessionId, (0, history_1.locationId)(item)])
183
+ if (!aliases.has((0, receipt_1.sha256)(id)))
184
+ aliases.set((0, receipt_1.sha256)(id), item);
185
+ const groups = new Map();
186
+ for (const d of decisions)
187
+ groups.set(d.digest, [...groups.get(d.digest) ?? [], d]);
188
+ const sessions = [...groups].map(([digest, rows]) => {
189
+ const location = aliases.get(digest);
190
+ const history = location ? loadChildren(location, locations) : { children: [], available: false, notes: ['No matching local transcript: unpriced.'], malformed: 0, unresolved: [] };
191
+ const first = rows.find(d => d.wouldBlock && d.at === null) ?? rows.find(d => d.wouldBlock);
192
+ return { session: location ? (0, history_1.locationId)(location) : rows[0].session, notes: history.notes, malformedLines: history.malformed,
193
+ decisions: rows.map(d => ({ ...d, exposure: exposure(history, d.at) })), firstWouldBlock: first ? first.at : null,
194
+ hasWouldBlock: Boolean(first), total: first ? exposure(history, first.at) : null };
195
+ });
196
+ const totals = sessions.flatMap(s => s.total ? [s.total] : []);
197
+ return { method: { dollars: exports.PRICE_LABEL, total: 'Upper bound after the first would-block point per session.', sensitivity: 'Sensitivity, never measurement.',
198
+ snapshot: 'Shipped MODEL_PRICING; local overrides are not used.', missing: 'Unpriced, never imputed.' },
199
+ sessions, totals: { shadowDecisions: decisions.length, wouldBlockDecisions: decisions.filter(d => d.wouldBlock).length,
200
+ sessionsWithWouldBlock: totals.length, unpricedSessions: totals.filter(t => t.usd === null).length,
201
+ usd: (0, render_1.sumPrices)(totals.map(t => t.usd)), knownUsd: (0, render_1.sumPrices)(totals.map(t => t.knownUsd)),
202
+ sensitivities: Object.fromEntries(SENSITIVITY.map(model => [model, (0, render_1.sumPrices)(totals.map(t => t.sensitivities[model] ?? null))])),
203
+ knownSensitivities: Object.fromEntries(SENSITIVITY.map(model => [model, (0, render_1.sumPrices)(totals.map(t => t.knownSensitivities[model] ?? null))])) },
204
+ pricing: pricing_1.MODEL_PRICING, malformedLedgerLines: ledger.malformed };
205
+ }
206
+ function dollars(value) {
207
+ if (!value)
208
+ return 'unpriced';
209
+ return value.min === value.max ? `$${value.min.toFixed(6)}` : `$${value.min.toFixed(6)} to $${value.max.toFixed(6)}`;
210
+ }
211
+ const number = (n) => n === null ? 'unpriced' : n.toLocaleString('en-US');
212
+ function modelTable(value) {
213
+ return exports.PRICE_LABEL + '\n' + (0, history_1.reportTable)(['Model', 'Responses', 'Input tokens', 'Cache-read tokens', 'Write 5m tokens', 'Write 1h tokens', 'Write unknown TTL tokens', 'Output tokens', 'List USD'], value.modelMix.map(m => [m.model, String(m.responses), number(m.input), number(m.cacheRead), number(m.write5m), number(m.write1h), number(m.writeUnknown), number(m.output), dollars(m.usd)]));
214
+ }
215
+ function renderPriceShadow(report) {
216
+ const lines = ['AgentGuard price-shadow: stored local shadow decisions', exports.PRICE_LABEL,
217
+ 'Pinned API list snapshot. Child usage is deduplicated by provider response id; inherited parent responses are excluded.',
218
+ 'Children must start strictly after the decision. A Claude child start is its first own sidechain user event or timestamped fork marker; Codex uses session metadata.',
219
+ 'Missing transcripts, unknown start times, unresolved spawns and unknown inherited boundaries are unpriced. Nothing is imputed.',
220
+ 'Each cohort covers the full available child transcript. Decision cohorts overlap and must not be added together.',
221
+ 'Exposure after the first would-block point is an upper bound, not attributable prevention. Sensitivity re-prices recorded token categories, never a measurement.'];
222
+ for (const s of report.sessions) {
223
+ lines.push('', `Session ${s.session}`, ...s.notes, exports.PRICE_LABEL, (0, history_1.reportTable)(['Decision (UTC)', 'Verdict', 'Would block', 'Children found', 'Measured', 'Median tokens', 'Max tokens', 'Median list USD', 'Max list USD', 'Model mix'], s.decisions.map(d => {
224
+ const e = d.exposure, stats = e.statistics;
225
+ return [(0, history_1.atText)(d.at), d.verdict, d.wouldBlock ? 'yes' : 'no', String(e.found), String(stats.measuredCount), number(stats.medianTokens), number(stats.maxTokens),
226
+ dollars(e.usd === null ? null : stats.medianUsd), dollars(e.usd === null ? null : stats.maxUsd), e.modelMix.map(m => `${m.model}:${m.responses} responses`).join(', ') || 'unpriced'];
227
+ })));
228
+ for (const d of s.decisions)
229
+ if (d.exposure.unknownStartChildren || d.exposure.unresolvedSpawns || d.exposure.children.some(c => c.reason))
230
+ lines.push(`${(0, history_1.atText)(d.at)}: ${d.exposure.unknownStartChildren} children with unknown start; ${d.exposure.unresolvedSpawns} unresolved spawns; ${d.exposure.children.filter(c => c.reason).length} children unpriced.`);
231
+ if (!s.total) {
232
+ lines.push('No would-block point in this session; no exposure total.');
233
+ continue;
234
+ }
235
+ lines.push(`First would-block point: ${(0, history_1.atText)(s.firstWouldBlock)}. Upper bound: ${dollars(s.total.usd)}. Known priced subset: ${dollars(s.total.knownUsd)}.`, `Sensitivity, never measurement: Fable 5.1 ${dollars(s.total.sensitivities[SENSITIVITY[0]] ?? null)}; Sonnet 5 ${dollars(s.total.sensitivities[SENSITIVITY[1]] ?? null)}.`, modelTable(s.total), exports.PRICE_LABEL, (0, history_1.reportTable)(['Child', 'Start (UTC)', 'Found', 'Responses', 'Tokens', 'List USD', 'Models', 'Unpriced reason'], s.total.children.map(c => [c.child, (0, history_1.atText)(c.startedAt), c.found ? 'yes' : 'no', String(c.responses), number(c.tokens), dollars(c.usd), c.models.join(',') || 'unknown', c.reason ?? c.unknownModels.join(',')])));
236
+ }
237
+ const t = report.totals;
238
+ lines.push('', exports.PRICE_LABEL, `Rollup: ${t.shadowDecisions} shadow decisions; ${t.wouldBlockDecisions} would-block decisions in ${t.sessionsWithWouldBlock} sessions.`, `Upper bound after each session's first would-block point: ${dollars(t.usd)}; ${t.unpricedSessions} sessions unpriced. Known priced subset: ${dollars(t.knownUsd)}.`, `Sensitivity, never measurement: all children on Fable 5.1 ${dollars(t.sensitivities[SENSITIVITY[0]] ?? null)}; all children on Sonnet 5 ${dollars(t.sensitivities[SENSITIVITY[1]] ?? null)}.`, `Known priced subset sensitivity, never measurement: Fable 5.1 ${dollars(t.knownSensitivities[SENSITIVITY[0]] ?? null)}; Sonnet 5 ${dollars(t.knownSensitivities[SENSITIVITY[1]] ?? null)}.`, 'Arithmetic: each native token category multiplied by its pinned USD per million rate, divided by 1,000,000; sum distinct responses once per session.', 'Pinned long-context multipliers apply where the original request input exceeds the snapshot threshold. Sensitivity preserves token categories, not model behavior.', 'Unknown cache-write TTL yields the range between the pinned five-minute and one-hour rates. Unknown model prices remain unpriced.', exports.PRICE_LABEL, (0, history_1.reportTable)(['Pinned model', 'Input per M', 'Cache read per M', 'Write 5 min per M', 'Write 1 hour per M', 'Output per M', 'Snapshot date'], Object.entries(report.pricing).map(([model, r]) => [model, ...[r.input, r.cacheRead, r.cacheWrite5m, r.cacheWrite1h, r.output].map(v => v === null ? 'unpriced' : String(v)), r.verifiedAt])), `${report.malformedLedgerLines + report.sessions.reduce((n, s) => n + s.malformedLines, 0)} malformed lines skipped.`);
239
+ return lines.join('\n');
240
+ }
@@ -13,11 +13,15 @@ const openaiRates = (input, cacheRead, cacheWrite, output, sourceUrl, longContex
13
13
  exports.MODEL_PRICING = Object.freeze({
14
14
  'claude-fable-5-1': rates(10, 0.25, 12.5, 20, 50),
15
15
  'claude-fable-5': rates(10, 1, 12.5, 20, 50),
16
+ // Verified 2026-09-22: cache hits on Opus 5.5 are 0.05x base input.
17
+ 'claude-opus-5-5': Object.freeze({ ...rates(4, 0.2, 5, 8, 20), verifiedAt: '2026-09-22' }),
16
18
  'claude-opus-5': rates(5, 0.5, 6.25, 10, 25),
17
19
  'claude-opus-4-8': rates(5, 0.5, 6.25, 10, 25),
18
20
  'claude-sonnet-5': rates(2, 0.2, 2.5, 4, 10),
19
21
  'claude-haiku-4-5-20251001': rates(1, 0.1, 1.25, 2, 5),
20
22
  'gpt-6-astra': openaiRates(10, 1, 12.5, 50, 'https://developers.openai.com/api/docs/pricing'),
23
+ 'gpt-6-sol': Object.freeze({ ...openaiRates(2, 0.2, 2.5, 10, 'https://developers.openai.com/api/docs/pricing'), verifiedAt: '2026-09-22' }),
24
+ 'gpt-6-luna': Object.freeze({ ...openaiRates(0.1, 0.01, 0.125, 0.5, 'https://developers.openai.com/api/docs/pricing'), verifiedAt: '2026-09-22' }),
21
25
  'gpt-5.6-sol': openaiRates(4, 0.4, 5, 20, 'https://developers.openai.com/api/docs/pricing'),
22
26
  'gpt-5.6-luna': openaiRates(0.2, 0.02, 0.25, 1.2, 'https://developers.openai.com/api/docs/pricing'),
23
27
  'gpt-5.4-mini': openaiRates(0.75, 0.075, null, 4.5, 'https://developers.openai.com/api/docs/models/gpt-5.4-mini', false),
@@ -40,6 +40,8 @@ export declare class SessionFollow {
40
40
  update(snapshot: LivePanelSnapshot, now: number): LivePanelSnapshot;
41
41
  }
42
42
  export declare function spawnBarColor(spawns: number | null, ceiling: number | null): CanvasColor;
43
+ /** Recorded showcase layout: the spawn count is the hero, unrecorded panels are omitted, never faked. */
44
+ export declare function renderShowcasePanel(snapshot: LivePanelSnapshot, options?: FrameOptions): Canvas;
43
45
  export declare function renderLivePanel(snapshot: LivePanelSnapshot, options?: FrameOptions): Canvas;
44
46
  /** STOP report adaptation uses only already-computed metadata, never local I/O. */
45
47
  export declare function panelFromReport(report: BurnReport, at: number, outcome?: 'blocked' | 'shadow' | 'overridden' | 'allowed', subject?: 'spawn' | 'call'): LivePanelSnapshot;
@@ -4,6 +4,7 @@ exports.StopHold = exports.SessionFollow = void 0;
4
4
  exports.panelDecisions = panelDecisions;
5
5
  exports.collectLivePanel = collectLivePanel;
6
6
  exports.spawnBarColor = spawnBarColor;
7
+ exports.renderShowcasePanel = renderShowcasePanel;
7
8
  exports.renderLivePanel = renderLivePanel;
8
9
  exports.panelFromReport = panelFromReport;
9
10
  exports.runLivePanel = runLivePanel;
@@ -41,7 +42,62 @@ function elapsed(ms) {
41
42
  const seconds = Math.max(0, Math.floor(ms / 1000));
42
43
  return `${String(Math.floor(seconds / 3600)).padStart(2, '0')}:${String(Math.floor(seconds / 60) % 60).padStart(2, '0')}:${String(seconds % 60).padStart(2, '0')}`;
43
44
  }
45
+ /** Recorded showcase layout: the spawn count is the hero, unrecorded panels are omitted, never faked. */
46
+ function renderShowcasePanel(snapshot, options = {}) {
47
+ const c = new canvas_1.Canvas(options), w = c.width, h = c.height, split = Math.floor(w * .45), right = split + 3, room = w - right;
48
+ const at = options.at ?? new Date(snapshot.observedAt).toISOString(), color = spawnBarColor(snapshot.spawns, snapshot.spawnCeiling);
49
+ c.header('AGENTGUARD / BURN', 'RECORDED RUN · 1x');
50
+ c.footer('local observation only', `elapsed ${snapshot.elapsedMs === null ? 'unknown' : elapsed(snapshot.elapsedMs ?? snapshot.observedAt - snapshot.startedAt)}`);
51
+ c.put(2, 0, `session ${snapshot.session} · ${at.slice(11, 19)} UTC`, 'slate');
52
+ for (let y = 3; y < h - 3; y++)
53
+ c.put(y, split + 1, '│', 'slate');
54
+ c.put(4, 0, 'AGENT SPAWNS IN WINDOW', 'slate');
55
+ c.bigDigits(6, 0, snapshot.spawns === null ? '-' : snapshot.spawns, color);
56
+ c.put(14, 0, `${snapshot.spawns ?? '?'} of ${snapshot.spawnCeiling ?? '?'} allowed · ${snapshot.windowActiveMinutes ?? '?'} active min`.slice(0, split), 'white');
57
+ const fraction = snapshot.spawns === null || snapshot.spawnCeiling === null ? 0 : snapshot.spawns / snapshot.spawnCeiling;
58
+ const rate = `${snapshot.spawns ?? '?'} / ${snapshot.spawnCeiling ?? '?'}`;
59
+ c.put(16, 0, 'SPAWN RATE', 'slate').put(16, Math.max(11, split - rate.length), rate, color);
60
+ c.bar(17, 0, split, fraction, color).bar(18, 0, split, fraction, color);
61
+ let y = 21;
62
+ if (snapshot.tokens !== null) {
63
+ const tokens = compact(snapshot.tokens);
64
+ c.put(y, 0, 'TOKENS IN WINDOW', 'slate').digits(y + 1, 0, tokens.digits, 'mint').put(y + 4, 0, tokens.unit.slice(0, split), 'slate');
65
+ y += 6;
66
+ }
67
+ if (snapshot.replayShare !== null && y + 5 < h - 3) {
68
+ c.put(y, 0, 'REPLAY SHARE %', 'slate').digits(y + 1, 0, Math.round(snapshot.replayShare * 100), 'mint').put(y + 4, 0, 'session cache-read / tokens'.slice(0, split), 'slate');
69
+ y += 6;
70
+ }
71
+ if (y + 5 < h - 3) {
72
+ c.put(y, 0, 'WHAT A SPAWN IS', 'slate');
73
+ ['Each spawn is a new agent copy that re-reads', 'the whole context and burns its own tokens.', 'Past the ceiling, the next spawn is refused.', 'Every decision is signed on this machine.']
74
+ .forEach((line, i) => c.put(y + 1 + i, 0, line.slice(0, split), 'white'));
75
+ }
76
+ c.put(4, right, 'LAST 8 DECISIONS', 'slate');
77
+ snapshot.decisions.slice(-8).forEach((d, index) => {
78
+ const row = 5 + index * 2, chip = d.verdict === 'OK' ? 'clean' : d.verdict, tint = d.verdict === 'STOP' ? 'red' : d.verdict === 'WARN' ? 'amber' : 'mint';
79
+ c.put(row, right, `${new Date(d.at).toISOString().slice(11, 19)} ${d.tool}`.slice(0, Math.max(0, room - 8)), 'white');
80
+ c.put(row, Math.max(right, w - 7), `[${chip}]`, tint);
81
+ c.put(row + 1, right, d.reason.slice(0, room), 'slate');
82
+ });
83
+ if (!snapshot.decisions.length)
84
+ c.put(6, right, 'No recorded decisions yet.', 'slate');
85
+ if (snapshot.stop) {
86
+ const top = h - 11;
87
+ for (let i = 0; i < 5; i++)
88
+ c.put(top + i, right, ' '.repeat(room), 'none');
89
+ c.put(top - 1, right, '─'.repeat(room), 'red');
90
+ c.put(top, right, 'STOP · ' + (snapshot.stop.blocked === true ? 'blocked' : snapshot.stop.blocked === false ? 'shadow / allowed' : 'outcome unknown'), 'red');
91
+ c.put(top + 1, right, snapshot.stop.reason.slice(0, room), 'red');
92
+ c.put(top + 2, right, snapshot.stopHold === false ? 'Latest STOP reason.' : 'Reason held for 2 seconds.', 'slate');
93
+ c.put(top + 3, right, '─'.repeat(room), 'red');
94
+ }
95
+ c.put(h - 3, 0, snapshot.note.slice(0, w), 'slate');
96
+ return c;
97
+ }
44
98
  function renderLivePanel(snapshot, options = {}) {
99
+ if (options.showcase && (options.height ?? 35) >= 30 && (options.width ?? 104) >= 80)
100
+ return renderShowcasePanel(snapshot, options);
45
101
  const c = new canvas_1.Canvas(options), w = c.width, h = c.height, narrow = w < 80, split = narrow ? w : Math.floor(w * .45), right = narrow ? 0 : split + 3, room = w - right;
46
102
  const at = options.at ?? new Date(snapshot.observedAt).toISOString(), color = spawnBarColor(snapshot.spawns, snapshot.spawnCeiling);
47
103
  c.header('AGENTGUARD / BURN', options.recorded ? 'RECORDED RUN · 1x' : 'LIVE');
@@ -7,7 +7,7 @@ export interface RenderRecordingResult {
7
7
  ffmpegCommand: string;
8
8
  frameCount: number;
9
9
  }
10
- export declare function renderCanvasPng(snapshot: CanvasSnapshot, width?: number, height?: number): Promise<Buffer>;
10
+ export declare function renderCanvasPng(snapshot: CanvasSnapshot, width?: number, height?: number, style?: 'default' | 'showcase'): Promise<Buffer>;
11
11
  export declare function renderRecording(source: string, options: {
12
12
  mp4: string;
13
13
  gif?: string;
@@ -68,26 +68,30 @@ function timestampMicros(at) {
68
68
  const fraction = /\.(\d+)(?:Z|[+-]\d{2}:?\d{2})$/i.exec(at)?.[1] ?? '';
69
69
  return BigInt(milliseconds) * 1000n + BigInt(fraction.slice(3, 6).padEnd(3, '0'));
70
70
  }
71
- async function renderCanvasPng(snapshot, width = 1920, height = 1080) {
71
+ async function renderCanvasPng(snapshot, width = 1920, height = 1080, style = 'default') {
72
72
  await font();
73
73
  if (!Number.isInteger(width) || !Number.isInteger(height) || width < 64 || height < 64 || width > 4096 || height > 4096)
74
74
  throw new Error('Canvas raster dimensions must be integers between 64 and 4096.');
75
75
  const canvas = (0, canvas_1.createCanvas)(width, height);
76
- const cellWidth = Math.min(CELL_WIDTH, Math.max(1, Math.floor((width - 32) / snapshot.width)));
77
- const cellHeight = Math.min(CELL_HEIGHT, Math.max(1, Math.floor((height - 32) / snapshot.height)), Math.round(cellWidth * CELL_HEIGHT / CELL_WIDTH));
76
+ // Showcase frames keep a real margin so block digits never touch the frame edge; other frames keep the exact recorded geometry.
77
+ const marginX = style === 'showcase' ? 160 : 32, marginY = style === 'showcase' ? 120 : 32;
78
+ const cellWidth = Math.min(CELL_WIDTH, Math.max(1, Math.floor((width - marginX) / snapshot.width)));
79
+ const cellHeight = Math.min(CELL_HEIGHT, Math.max(1, Math.floor((height - marginY) / snapshot.height)), Math.round(cellWidth * CELL_HEIGHT / CELL_WIDTH));
78
80
  const paddingX = Math.floor((canvas.width - snapshot.width * cellWidth) / 2);
79
81
  const paddingY = Math.floor((canvas.height - snapshot.height * cellHeight) / 2);
80
82
  const ctx = canvas.getContext('2d');
81
83
  ctx.fillStyle = '#0B1117';
82
84
  ctx.fillRect(0, 0, canvas.width, canvas.height);
83
- ctx.font = `${26 * cellWidth / CELL_WIDTH}px "${FONT_ALIAS}"`;
85
+ ctx.font = `${style === 'showcase' ? 'bold ' : ''}${26 * cellWidth / CELL_WIDTH}px "${FONT_ALIAS}"`;
84
86
  ctx.textBaseline = 'alphabetic';
87
+ // Showcase palette: brighter than the terminal palette so text survives re-encoding on social players.
88
+ const VIDEO_HEX = style === 'showcase' ? { mint: '#2ABCB4', slate: '#B4BECF', amber: '#F59E0B', red: '#FF5A4E', white: '#FFFFFF' } : {};
85
89
  for (let row = 0; row < snapshot.height; row++)
86
90
  for (let col = 0; col < snapshot.width; col++) {
87
91
  const cell = snapshot.cells[row][col];
88
92
  if (cell.char === ' ')
89
93
  continue;
90
- ctx.fillStyle = canvas_2.CANVAS_PALETTE[cell.color === 'none' ? 'white' : cell.color].hex;
94
+ ctx.fillStyle = VIDEO_HEX[cell.color === 'none' ? 'white' : cell.color] ?? canvas_2.CANVAS_PALETTE[cell.color === 'none' ? 'white' : cell.color].hex;
91
95
  const x = paddingX + col * cellWidth, y = paddingY + row * cellHeight;
92
96
  if (cell.char === '█')
93
97
  ctx.fillRect(x, y, cellWidth, cellHeight);
@@ -145,8 +149,8 @@ async function renderRecording(source, options) {
145
149
  for (let index = 0; index < frames.length; index++) {
146
150
  const frame = frames[index];
147
151
  const name = `frame-${String(index).padStart(6, '0')}.png`;
148
- const image = (0, frames_1.renderFrame)(frame.data, { recorded: true, at: frame.at, width: frame.viewport?.width ?? 104, height: frame.viewport?.height ?? 35, colour: true });
149
- await (0, promises_1.writeFile)((0, node_path_1.join)(framesDir, name), await renderCanvasPng(image.toJSON()), { flag: 'wx', mode: 0o600 });
152
+ const image = (0, frames_1.renderFrame)(frame.data, { recorded: true, showcase: true, at: frame.at, width: frame.viewport?.width ?? 104, height: frame.viewport?.height ?? 35, colour: true });
153
+ await (0, promises_1.writeFile)((0, node_path_1.join)(framesDir, name), await renderCanvasPng(image.toJSON(), 1920, 1080, frame.data.kind === 'live' ? 'showcase' : 'default'), { flag: 'wx', mode: 0o600 });
150
154
  }
151
155
  for (const [position, index] of videoIndices.entries()) {
152
156
  const next = videoIndices[position + 1];
@@ -160,7 +164,7 @@ async function renderRecording(source, options) {
160
164
  const common = ['-hide_banner', '-loglevel', 'error', '-nostdin', '-n', '-protocol_whitelist', 'file,pipe', '-f', 'concat', '-safe', '0', '-i', concatPath];
161
165
  // B-frame reordering can collapse the MP4 track duration to rapid DTS steps even
162
166
  // when the final presentation timestamp correctly includes the one-second hold.
163
- const mp4Args = [...common, '-fps_mode', 'vfr', '-c:v', 'libx264', '-bf', '0', '-enc_time_base', '1:1000000', '-video_track_timescale', '1000000', '-pix_fmt', 'yuv420p', '-movflags', '+faststart', mp4Path];
167
+ const mp4Args = [...common, '-fps_mode', 'vfr', '-c:v', 'libx264', '-crf', '16', '-preset', 'slow', '-bf', '0', '-enc_time_base', '1:1000000', '-video_track_timescale', '1000000', '-pix_fmt', 'yuv420p', '-movflags', '+faststart', mp4Path];
164
168
  const gifArgs = [...common, '-fps_mode', 'vfr', '-frames:v', String(videoIndices.length), '-final_delay', '100', '-vf', 'split[a][b];[a]palettegen[p];[b][p]paletteuse', '-loop', '0', ...(gifPath ? [gifPath] : [])];
165
169
  const command = [ffmpeg || 'ffmpeg', ...mp4Args].map(shellWord).join(' ')
166
170
  + (gifPath ? `\n${[ffmpeg || 'ffmpeg', ...gifArgs].map(shellWord).join(' ')}` : '');
@@ -39,12 +39,13 @@ For `claude-fable-5-1`, 500,000 cache-read tokens have a $0.125 API equivalent.
39
39
 
40
40
  ## Pricing sources and overrides
41
41
 
42
- Every bundled row includes its exact model identifier, `sourceUrl` and `verifiedAt`. The rates were checked on 2026-09-17. The runtime never downloads pricing. Run `agentguard-burn pricing` to inspect the installed table.
42
+ Every bundled row includes its exact model identifier, `sourceUrl` and `verifiedAt`. The rates were checked on 2026-09-17, except `claude-opus-5-5`, `gpt-6-sol` and `gpt-6-luna`, which were checked on 2026-09-22. The runtime never downloads pricing. Run `agentguard-burn pricing` to inspect the installed table.
43
43
 
44
44
  The Claude rows use the [official model price list](https://platform.claude.com/docs/en/about-claude/pricing). Amounts below are USD per million tokens in the order fresh input, cache read, five-minute write, one-hour write, output:
45
45
 
46
46
  * `claude-fable-5-1`: 10, 0.25, 12.5, 20, 50.
47
47
  * `claude-fable-5`: 10, 1, 12.5, 20, 50.
48
+ * `claude-opus-5-5`: 4, 0.2, 5, 8, 20.
48
49
  * `claude-opus-5` and `claude-opus-4-8`: 5, 0.5, 6.25, 10, 25.
49
50
  * `claude-sonnet-5`: 2, 0.2, 2.5, 4, 10.
50
51
  * `claude-haiku-4-5-20251001`: 1, 0.1, 1.25, 2, 5.
@@ -52,6 +53,8 @@ The Claude rows use the [official model price list](https://platform.claude.com/
52
53
  The [OpenAI API price list](https://developers.openai.com/api/docs/pricing) supplies these standard rates in the order fresh input, cache read, cache write, output:
53
54
 
54
55
  * `gpt-6-astra`: 10, 1, 12.5, 50.
56
+ * `gpt-6-sol`: 2, 0.2, 2.5, 10.
57
+ * `gpt-6-luna`: 0.1, 0.01, 0.125, 0.5.
55
58
  * `gpt-5.6-sol`: 4, 0.4, 5, 20. These are the published promotional rates on the verification date.
56
59
  * `gpt-5.6-luna`: 0.2, 0.02, 0.25, 1.2.
57
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentguard-run/burn",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Local session usage and runaway-agent circuit breaker. Explain tokens, cache rewrites and API list cost, track pace, warn on heavy turns, and gate agent fan-out with signed receipts. Developer command ranking requires explicit --rank.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "commonjs",