@agentguard-run/burn 0.3.10 → 0.3.11
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 +6 -0
- package/README.md +1 -1
- package/dist/src/cli.js +6 -4
- package/dist/src/dashboard-model.d.ts +2 -0
- package/dist/src/dashboard-render.d.ts +1 -0
- package/dist/src/dashboard-render.js +28 -31
- package/dist/src/frames.d.ts +1 -0
- package/dist/src/live-panel.js +10 -8
- package/dist/src/render-recording.d.ts +1 -0
- package/dist/src/render-recording.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.11 (2026-09-23)
|
|
4
|
+
|
|
5
|
+
- `render --label <text>` for both the recorded render and the dashboard: a caller-supplied name for what the recording was (for example "deliberate fan-out test"), drawn in the frame and written to the provenance file. Never inferred.
|
|
6
|
+
- Dashboard: header counters step at the recorded event time, in the same frame as the log row and ring marker (no tween that lags them); the elapsed counter is labelled RECORDED TIME; the rate bar ticks read "warn at 8" and "refuse at 16"; the STOP card reads "window counter 16 of 16 · 15 active min · attempt refused"; the cost panel is titled "list cost after the run · not live", shows the final amount once with a fade (no counting up) and carries its qualifications at body size ("15 copies the gate allowed", "list price · not a bill").
|
|
7
|
+
- Recorded renders: "SPAWN ATTEMPTS IN WINDOW" (was AGENT SPAWNS), "COPIES LAUNCHED" with the tag "attempt refused", "Each copy runs its own context window." and "At the ceiling, the attempt is refused." replace the earlier explainers.
|
|
8
|
+
|
|
3
9
|
## 0.3.10 (2026-09-23)
|
|
4
10
|
|
|
5
11
|
- Dashboard render: the COPIES counter and the ring markers now count copies that launched (allowed decisions), not the ledger's spawn-attempt counter, which also counts the attempt that reached the ceiling and was refused. The rate bar is labelled SPAWN ATTEMPTS and keeps the attempt counter. The STOP card reads "attempt 16 of 16 in 15 active min · refused".
|
package/README.md
CHANGED
|
@@ -509,7 +509,7 @@ agentguard-burn render run.jsonl --mp4 run.mp4 --gif run.gif
|
|
|
509
509
|
agentguard-burn render run.jsonl --mp4 run-phone.mp4 --phone
|
|
510
510
|
```
|
|
511
511
|
|
|
512
|
-
`--phone` renders a 1080 by 1350 frame with a stacked 40 by 36 cell layout (spawn count, spawn attempts against the ceiling, one block per copy that launched, the last three decisions, the STOP card and an explainer), so a recorded run stays readable on a phone screen. The provenance file records the layout and frame size.
|
|
512
|
+
`--phone` renders a 1080 by 1350 frame with a stacked 40 by 36 cell layout (spawn count, spawn attempts against the ceiling, one block per copy that launched, the last three decisions, the STOP card and an explainer), so a recorded run stays readable on a phone screen. The provenance file records the layout and frame size. `--label <text>` (1 to 40 printable characters) names what the recording was, for example `--label "deliberate fan-out test"`; it is drawn in the frame (phone: the explainer row; wide: the header; dashboard: the session line) and recorded in the provenance file. It is never inferred from the recording.
|
|
513
513
|
|
|
514
514
|
`record` writes each decision at its real timestamp, with one frame per second
|
|
515
515
|
between decisions. Bounds are optional and otherwise use the session's first
|
package/dist/src/cli.js
CHANGED
|
@@ -162,22 +162,24 @@ async function main(argv) {
|
|
|
162
162
|
process.stdout.write('not supported on this platform yet\n');
|
|
163
163
|
return 0;
|
|
164
164
|
}
|
|
165
|
-
const source = rest[0], mp4 = flag('--mp4'), gif = flag('--gif'), economics = flag('--economics'), fpsFlag = flag('--fps');
|
|
166
|
-
const usage = 'Usage: agentguard-burn render <run.jsonl> --mp4 <out.mp4> [--gif <out.gif>] [--phone] | --dashboard [--wide] [--economics <blocks.json>] [--fps <n>]';
|
|
165
|
+
const source = rest[0], mp4 = flag('--mp4'), gif = flag('--gif'), economics = flag('--economics'), fpsFlag = flag('--fps'), label = flag('--label');
|
|
166
|
+
const usage = 'Usage: agentguard-burn render <run.jsonl> --mp4 <out.mp4> [--gif <out.gif>] [--phone] [--label <text>] | --dashboard [--wide] [--economics <blocks.json>] [--fps <n>] [--label <text>]';
|
|
167
|
+
if (has('--label') && (!label || label.startsWith('--')))
|
|
168
|
+
throw new Error(usage);
|
|
167
169
|
if (!source || source.startsWith('--') || !mp4 || mp4.startsWith('--') || (has('--gif') && (!gif || gif.startsWith('--'))))
|
|
168
170
|
throw new Error(usage);
|
|
169
171
|
if (has('--dashboard')) {
|
|
170
172
|
if (has('--gif') || has('--phone') || (has('--economics') && (!economics || economics.startsWith('--'))) || (has('--fps') && !/^\d{1,2}$/.test(fpsFlag ?? '')))
|
|
171
173
|
throw new Error(usage);
|
|
172
174
|
const { renderDashboard } = await Promise.resolve().then(() => __importStar(require('./dashboard-render')));
|
|
173
|
-
const result = await renderDashboard(source, { mp4, economics, wide: has('--wide'), ...(fpsFlag ? { fps: Number(fpsFlag) } : {}) });
|
|
175
|
+
const result = await renderDashboard(source, { mp4, economics, wide: has('--wide'), ...(fpsFlag ? { fps: Number(fpsFlag) } : {}), ...(label ? { label } : {}) });
|
|
174
176
|
show({ kind: 'command', command: 'render', values: { ...result } }, `PNG frames: ${result.framesDir}\n${result.mp4 ? `MP4: ${result.mp4}\n` : `ffmpeg unavailable. Run: ${result.ffmpegCommand}\n`}Provenance: ${result.provenancePath}\n`);
|
|
175
177
|
return 0;
|
|
176
178
|
}
|
|
177
179
|
if (has('--wide') || has('--economics') || has('--fps'))
|
|
178
180
|
throw new Error(usage);
|
|
179
181
|
const { renderRecording } = await Promise.resolve().then(() => __importStar(require('./render-recording')));
|
|
180
|
-
const result = await renderRecording(source, { mp4, gif, phone: has('--phone') });
|
|
182
|
+
const result = await renderRecording(source, { mp4, gif, phone: has('--phone'), ...(label ? { label } : {}) });
|
|
181
183
|
show({ kind: 'command', command: 'render', values: { ...result } }, `PNG frames: ${result.framesDir}\n${result.mp4 ? `MP4: ${result.mp4}\n` : `ffmpeg unavailable. Run: ${result.ffmpegCommand}\n`}${result.gif ? `GIF: ${result.gif}\n` : ''}Provenance: ${result.provenancePath}\n`);
|
|
182
184
|
return 0;
|
|
183
185
|
}
|
|
@@ -55,6 +55,8 @@ export interface DashboardModel {
|
|
|
55
55
|
windowActiveMinutes: number | null;
|
|
56
56
|
/** Spawn decisions the gate allowed (every non-STOP decision). The ledger's `spawns` counter also counts the refused attempt that reached the ceiling. */
|
|
57
57
|
launched: number;
|
|
58
|
+
/** Caller-supplied name for what the recording was (for example "deliberate fan-out test"); drawn in the header, never inferred. */
|
|
59
|
+
label?: string;
|
|
58
60
|
events: DashboardEvent[];
|
|
59
61
|
samples: DashboardSample[];
|
|
60
62
|
economics: DashboardEconomics | null;
|
|
@@ -134,14 +134,14 @@ function header(ctx, model, state, g) {
|
|
|
134
134
|
const wordSize = Math.round(g.number * 1.15);
|
|
135
135
|
const agent = text(ctx, 'Agent', g.margin, g.header.y, wordSize, { weight: 600 });
|
|
136
136
|
text(ctx, 'Guard', g.margin + agent, g.header.y, wordSize, { weight: 600, color: exports.INK.teal });
|
|
137
|
-
text(ctx, `session ${model.session} · ${model.startAt.slice(0, 10)} ${model.startAt.slice(11, 16)} UTC · spawn gate`, g.margin, g.header.y + 34, g.small, { color: exports.INK.secondary });
|
|
138
|
-
|
|
137
|
+
text(ctx, `session ${model.session} · ${model.startAt.slice(0, 10)} ${model.startAt.slice(11, 16)} UTC · spawn gate${model.label ? ` · ${model.label}` : ''}`, g.margin, g.header.y + 34, g.small, { color: exports.INK.secondary });
|
|
138
|
+
// Counters step at the recorded event time, in the same frame as the log row and the ring marker, so no frame shows
|
|
139
|
+
// a marker or log row the counters have not yet counted. Copies = allowed decisions; the ledger's attempt counter drives the rate bar.
|
|
139
140
|
const values = [
|
|
140
|
-
|
|
141
|
-
['
|
|
142
|
-
['
|
|
143
|
-
['
|
|
144
|
-
['elapsed', clock(state.elapsedMs), exports.INK.ink],
|
|
141
|
+
['copies', String(state.launched), state.warned ? exports.INK.amber : exports.INK.teal],
|
|
142
|
+
['decisions', String(state.decisions), exports.INK.ink],
|
|
143
|
+
['refused', String(state.refused), state.refused ? exports.INK.red : exports.INK.ink],
|
|
144
|
+
['recorded time', clock(state.elapsedMs), exports.INK.ink],
|
|
145
145
|
];
|
|
146
146
|
values.forEach(([label, value, color], index) => {
|
|
147
147
|
const x = g.header.counters.x + index * g.header.counters.step;
|
|
@@ -260,9 +260,9 @@ function bar(ctx, model, state, g) {
|
|
|
260
260
|
ctx.moveTo(wx, y - 8);
|
|
261
261
|
ctx.lineTo(wx, y + h + 8);
|
|
262
262
|
ctx.stroke();
|
|
263
|
-
text(ctx, `warn ${model.warnAt}`, wx + 10, y + h + 30, g.small, { color: exports.INK.amber });
|
|
263
|
+
text(ctx, `warn at ${model.warnAt}`, wx + 10, y + h + 30, g.small, { color: exports.INK.amber });
|
|
264
264
|
}
|
|
265
|
-
text(ctx, `
|
|
265
|
+
text(ctx, `refuse at ${ceiling}`, x + w, y + h + 30, g.small, { color: exports.INK.secondary, align: 'right' });
|
|
266
266
|
}
|
|
267
267
|
function log(ctx, state, g) {
|
|
268
268
|
const { x, y, w, h, rows } = g.log;
|
|
@@ -281,34 +281,28 @@ function log(ctx, state, g) {
|
|
|
281
281
|
}
|
|
282
282
|
function agents(ctx, model, state, g) {
|
|
283
283
|
const { x, y, w, h, rows } = g.agents, economics = model.economics;
|
|
284
|
-
panel(ctx, x, y, w, h, '
|
|
284
|
+
panel(ctx, x, y, w, h, 'list cost after the run · not live', g);
|
|
285
285
|
if (!economics) {
|
|
286
286
|
text(ctx, 'no subagent economics supplied', x + 20, y + 90, g.body, { color: exports.INK.secondary });
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
const revealAt = model.firstStopMs ?? model.durationMs, reveal = easeOut((state.t - revealAt) /
|
|
289
|
+
const revealAt = model.firstStopMs ?? model.durationMs, reveal = easeOut((state.t - revealAt) / 600);
|
|
290
290
|
// Recording scope: the dollars cover only the copies this recording allowed. Session scope: every child of the session.
|
|
291
291
|
const recorded = economics.scope === 'recording', found = economics.children.length, launched = economics.launched ?? found;
|
|
292
|
-
const
|
|
292
|
+
const who = recorded ? (found === launched ? `${found} copies the gate allowed` : `${found} of the ${launched} copies the gate allowed`) : `${found} subagent transcripts`;
|
|
293
293
|
if (reveal <= 0) {
|
|
294
|
-
text(ctx,
|
|
295
|
-
text(ctx, '
|
|
294
|
+
text(ctx, who, x + 20, y + 84, g.body, { color: exports.INK.secondary });
|
|
295
|
+
text(ctx, 'list price shown after the run', x + 20, y + 84 + g.body * 1.4, g.body, { color: exports.INK.secondary });
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
ctx
|
|
303
|
-
|
|
304
|
-
if (!wrapped)
|
|
305
|
-
text(ctx, caption, x + 20, y + 76 + g.bigNumber, g.small, { color: exports.INK.secondary });
|
|
306
|
-
else {
|
|
307
|
-
text(ctx, lead, x + 20, y + 76 + g.bigNumber, g.small, { color: exports.INK.secondary });
|
|
308
|
-
text(ctx, 'not a bill', x + 20, y + 76 + g.bigNumber + g.small * 1.15, g.small, { color: exports.INK.secondary });
|
|
309
|
-
}
|
|
298
|
+
// The final amount fades in once, at its full value: it never counts up, so it cannot read as a live meter.
|
|
299
|
+
const big = y + 52 + g.bigNumber, cap1 = big + g.body * 1.3, cap2 = cap1 + g.body * 1.25;
|
|
300
|
+
text(ctx, (0, live_1.dollars)(economics.totalUsd), x + 20, big, g.bigNumber, { family: 'mono', weight: 700, color: exports.INK.ink, alpha: reveal });
|
|
301
|
+
// The qualifications are body size, the same size as the decision log, not fine print, and clear of the amount's descenders.
|
|
302
|
+
text(ctx, who, x + 20, cap1, g.body, { color: exports.INK.ink, alpha: reveal });
|
|
303
|
+
text(ctx, 'list price · not a bill', x + 20, cap2, g.body, { color: exports.INK.secondary, alpha: reveal });
|
|
310
304
|
const sorted = [...economics.children].sort((a, b) => (b.tokens ?? 0) - (a.tokens ?? 0)), top = sorted.slice(0, rows), max = top[0]?.tokens ?? 1;
|
|
311
|
-
const first =
|
|
305
|
+
const first = cap2 + g.body * .7, pitch = (h - (first - y) - 44) / rows, barW = w - 40 - g.number * 3.6;
|
|
312
306
|
top.forEach((child, i) => {
|
|
313
307
|
const row = first + i * pitch, fill = clamp01((child.tokens ?? 0) / max) * reveal;
|
|
314
308
|
ctx.fillStyle = exports.INK.line;
|
|
@@ -337,11 +331,11 @@ function card(ctx, state, g) {
|
|
|
337
331
|
ctx.roundRect(x, y, w, h, 12);
|
|
338
332
|
ctx.fill();
|
|
339
333
|
ctx.stroke();
|
|
340
|
-
const outcome = state.stop.blocked === true ? 'refused' : state.stop.blocked === false ? 'shadow, copy allowed' : 'outcome not recorded';
|
|
334
|
+
const outcome = state.stop.blocked === true ? 'attempt refused' : state.stop.blocked === false ? 'shadow, copy allowed' : 'outcome not recorded';
|
|
341
335
|
text(ctx, 'STOP', x + 22, y + h / 2 + g.number * .36, g.number, { family: 'mono', weight: 700, color: exports.INK.red });
|
|
342
336
|
const ceiling = state.stop.ceiling ?? '?', window = state.stop.windowActiveMinutes ?? '?';
|
|
343
|
-
// The attempt that reached the ceiling
|
|
344
|
-
text(ctx, `
|
|
337
|
+
// The window counter includes the refused attempt that reached the ceiling; later refusals report the same counter value.
|
|
338
|
+
text(ctx, `window counter ${state.stop.copies} of ${ceiling} · ${window} active min · ${outcome}`, x + 22 + g.number * 3, y + h / 2 - 4, g.body, { color: exports.INK.ink });
|
|
345
339
|
text(ctx, `${state.stop.reason} · signed on this machine`, x + 22 + g.number * 3, y + h / 2 + g.small + 6, g.small, { color: exports.INK.secondary });
|
|
346
340
|
ctx.restore();
|
|
347
341
|
}
|
|
@@ -370,6 +364,8 @@ async function renderDashboard(source, options) {
|
|
|
370
364
|
const fps = options.fps ?? 30;
|
|
371
365
|
if (!Number.isInteger(fps) || fps < 1 || fps > 60)
|
|
372
366
|
throw new Error('Dashboard fps must be an integer from 1 to 60.');
|
|
367
|
+
if (options.label !== undefined && !/^[\x20-\x7e]{1,40}$/.test(options.label))
|
|
368
|
+
throw new Error('Render label must be 1 to 40 printable ASCII characters.');
|
|
373
369
|
const sourcePath = (0, node_path_1.resolve)(source), mp4Path = (0, node_path_1.resolve)(options.mp4), provenancePath = `${mp4Path}.provenance.json`;
|
|
374
370
|
const economicsPath = options.economics ? (0, node_path_1.resolve)(options.economics) : null;
|
|
375
371
|
const outputs = [mp4Path, provenancePath];
|
|
@@ -390,7 +386,7 @@ async function renderDashboard(source, options) {
|
|
|
390
386
|
const economics = economicsPath ? (0, dashboard_model_1.readDashboardEconomics)(economicsPath, frames[0].snapshot.session, (0, dashboard_model_1.recordingWindow)(frames)) : null;
|
|
391
387
|
if (!sourceBytes.equals(await (0, promises_1.readFile)(sourcePath)))
|
|
392
388
|
throw new Error('Recording changed while it was being read; render the saved file again.');
|
|
393
|
-
const model = (0, dashboard_model_1.dashboardModel)(frames, economics, dashboard_model_1.DASHBOARD_HOLD_MS);
|
|
389
|
+
const model = { ...(0, dashboard_model_1.dashboardModel)(frames, economics, dashboard_model_1.DASHBOARD_HOLD_MS), ...(options.label ? { label: options.label } : {}) };
|
|
394
390
|
const layout = options.wide ? 'wide' : 'phone', g = geometry(layout), seed = options.seed ?? exports.DASHBOARD_SEED;
|
|
395
391
|
const fonts = await registerFonts();
|
|
396
392
|
const total = Math.round((model.durationMs + model.holdMs) / 1000 * fps), frameCount = total + 1;
|
|
@@ -418,6 +414,7 @@ async function renderDashboard(source, options) {
|
|
|
418
414
|
rendered_at: new Date().toISOString(),
|
|
419
415
|
fonts, layout: 'dashboard', frame_size: { width: g.width, height: g.height }, aspect: layout, fps, seed,
|
|
420
416
|
frame_count: frameCount, frame_times: frameTimes,
|
|
417
|
+
label: options.label ?? null,
|
|
421
418
|
recording_span_seconds: model.durationMs / 1000, final_hold_seconds: model.holdMs / 1000,
|
|
422
419
|
video_timestamp_precision: 'microseconds; fixed 1/fps frame durations from the first recorded timestamp',
|
|
423
420
|
ffmpeg_command: command,
|
package/dist/src/frames.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface FrameOptions {
|
|
|
41
41
|
width?: number;
|
|
42
42
|
height?: number;
|
|
43
43
|
colour?: boolean;
|
|
44
|
+
label?: string;
|
|
44
45
|
}
|
|
45
46
|
export declare function auditFrame(command: 'ps' | 'reap', report: AuditReport): BurnFrame;
|
|
46
47
|
export declare function framePageCount(data: BurnFrame, options?: FrameOptions): number;
|
package/dist/src/live-panel.js
CHANGED
|
@@ -47,12 +47,13 @@ function elapsed(ms) {
|
|
|
47
47
|
function renderShowcasePanel(snapshot, options = {}) {
|
|
48
48
|
const c = new canvas_1.Canvas(options), w = c.width, h = c.height, split = Math.floor(w * .45), right = split + 3, room = w - right;
|
|
49
49
|
const at = options.at ?? new Date(snapshot.observedAt).toISOString(), color = spawnBarColor(snapshot.spawns, snapshot.spawnCeiling);
|
|
50
|
-
|
|
50
|
+
// A render label (for example "deliberate fan-out test") names what the recording was; it is caller-supplied, never inferred.
|
|
51
|
+
c.header('AGENTGUARD / BURN', options.label ? `${options.label.toUpperCase()} · RECORDED · 1x` : 'RECORDED RUN · 1x');
|
|
51
52
|
c.footer('local observation only', `elapsed ${snapshot.elapsedMs === null ? 'unknown' : elapsed(snapshot.elapsedMs ?? snapshot.observedAt - snapshot.startedAt)}`);
|
|
52
53
|
c.put(2, 0, `session ${snapshot.session} · ${at.slice(11, 19)} UTC`, 'slate');
|
|
53
54
|
for (let y = 3; y < h - 3; y++)
|
|
54
55
|
c.put(y, split + 1, '│', 'slate');
|
|
55
|
-
c.put(4, 0, '
|
|
56
|
+
c.put(4, 0, 'SPAWN ATTEMPTS IN WINDOW', 'slate');
|
|
56
57
|
c.bigDigits(6, 0, snapshot.spawns === null ? '-' : snapshot.spawns, color);
|
|
57
58
|
c.put(14, 0, `${snapshot.spawns ?? '?'} of ${snapshot.spawnCeiling ?? '?'} attempts · ${snapshot.windowActiveMinutes ?? '?'} active min`.slice(0, split), 'white');
|
|
58
59
|
const fraction = snapshot.spawns === null || snapshot.spawnCeiling === null ? 0 : snapshot.spawns / snapshot.spawnCeiling;
|
|
@@ -71,7 +72,7 @@ function renderShowcasePanel(snapshot, options = {}) {
|
|
|
71
72
|
}
|
|
72
73
|
if (y + 5 < h - 3) {
|
|
73
74
|
c.put(y, 0, 'WHAT A SPAWN IS', 'slate');
|
|
74
|
-
['Each spawn is a new agent copy
|
|
75
|
+
['Each spawn is a new agent copy with its own', 'context window and its own token usage.', 'At the ceiling, the attempt is refused.', 'Every decision is signed on this machine.']
|
|
75
76
|
.forEach((line, i) => c.put(y + 1 + i, 0, line.slice(0, split), 'white'));
|
|
76
77
|
}
|
|
77
78
|
c.put(4, right, 'LAST 8 DECISIONS', 'slate');
|
|
@@ -103,7 +104,7 @@ function renderPhonePanel(snapshot, options = {}) {
|
|
|
103
104
|
c.header('AGENTGUARD / BURN', 'RECORDED · 1x');
|
|
104
105
|
c.footer('signed on this machine', `elapsed ${snapshot.elapsedMs === null ? 'unknown' : elapsed(snapshot.elapsedMs ?? snapshot.observedAt - snapshot.startedAt)}`);
|
|
105
106
|
c.put(2, 0, `session ${snapshot.session} · ${at.slice(11, 19)} UTC`.slice(0, w), 'slate');
|
|
106
|
-
c.put(3, 0, '
|
|
107
|
+
c.put(3, 0, 'SPAWN ATTEMPTS IN WINDOW', 'slate');
|
|
107
108
|
c.bigDigits(4, 0, snapshot.spawns === null ? '-' : snapshot.spawns, color);
|
|
108
109
|
c.put(11, 0, `${snapshot.spawns ?? '?'} of ${snapshot.spawnCeiling ?? '?'} attempts · ${snapshot.windowActiveMinutes ?? '?'} active min`.slice(0, w), 'white');
|
|
109
110
|
const fraction = snapshot.spawns === null || snapshot.spawnCeiling === null ? 0 : snapshot.spawns / snapshot.spawnCeiling;
|
|
@@ -117,8 +118,8 @@ function renderPhonePanel(snapshot, options = {}) {
|
|
|
117
118
|
const filled = snapshot.stop && attempts >= ceiling ? attempts - 1 : attempts;
|
|
118
119
|
const perRow = Math.ceil(ceiling / 2), blockWidth = Math.max(1, Math.floor((w + 1) / perRow) - 1);
|
|
119
120
|
const refused = snapshot.stop !== undefined;
|
|
120
|
-
c.put(16, 0, '
|
|
121
|
-
const tag = refused ? '
|
|
121
|
+
c.put(16, 0, 'COPIES LAUNCHED', 'slate');
|
|
122
|
+
const tag = refused ? 'attempt refused' : 'one block per copy';
|
|
122
123
|
c.put(16, Math.max(13, w - tag.length), tag, refused ? 'red' : 'slate');
|
|
123
124
|
for (let index = 0; index < ceiling; index++) {
|
|
124
125
|
const row = 17 + Math.floor(index / perRow) * 2, col = (index % perRow) * (blockWidth + 1);
|
|
@@ -135,13 +136,14 @@ function renderPhonePanel(snapshot, options = {}) {
|
|
|
135
136
|
});
|
|
136
137
|
if (!snapshot.decisions.length)
|
|
137
138
|
c.put(23, 0, 'No recorded decisions yet.', 'slate');
|
|
138
|
-
|
|
139
|
+
// The caller's label (what this recording was) takes the explainer row when supplied.
|
|
140
|
+
c.put(29, 0, (options.label ? options.label.toUpperCase() : 'Each copy runs its own context window.').slice(0, w), options.label ? 'slate' : 'white');
|
|
139
141
|
if (snapshot.stop) {
|
|
140
142
|
c.put(30, 0, '─'.repeat(w), 'red');
|
|
141
143
|
c.put(31, 0, ('STOP · ' + (snapshot.stop.blocked === true ? 'blocked' : snapshot.stop.blocked === false ? 'shadow / allowed' : 'outcome unknown') + ' · ' + snapshot.stop.reason).slice(0, w), 'red');
|
|
142
144
|
c.put(32, 0, '─'.repeat(w), 'red');
|
|
143
145
|
}
|
|
144
|
-
c.put(33, 0, '
|
|
146
|
+
c.put(33, 0, 'At the ceiling, the attempt is refused.'.slice(0, w), 'white');
|
|
145
147
|
return c;
|
|
146
148
|
}
|
|
147
149
|
function renderLivePanel(snapshot, options = {}) {
|
|
@@ -117,6 +117,8 @@ async function renderCanvasPng(snapshot, width = 1920, height = 1080, style = 'd
|
|
|
117
117
|
return canvas.encode('png');
|
|
118
118
|
}
|
|
119
119
|
async function renderRecording(source, options) {
|
|
120
|
+
if (options.label !== undefined && !/^[\x20-\x7e]{1,40}$/.test(options.label))
|
|
121
|
+
throw new Error('Render label must be 1 to 40 printable ASCII characters.');
|
|
120
122
|
const sourcePath = (0, node_path_1.resolve)(source), mp4Path = (0, node_path_1.resolve)(options.mp4);
|
|
121
123
|
const gifPath = options.gif ? (0, node_path_1.resolve)(options.gif) : null;
|
|
122
124
|
const provenancePath = `${mp4Path}.provenance.json`;
|
|
@@ -160,7 +162,7 @@ async function renderRecording(source, options) {
|
|
|
160
162
|
const frame = frames[index];
|
|
161
163
|
const name = `frame-${String(index).padStart(6, '0')}.png`;
|
|
162
164
|
const viewport = options.phone ? exports.PHONE_VIEWPORT : { width: frame.viewport?.width ?? 104, height: frame.viewport?.height ?? 35 };
|
|
163
|
-
const image = (0, frames_1.renderFrame)(frame.data, { recorded: true, showcase: true, at: frame.at, width: viewport.width, height: viewport.height, colour: true });
|
|
165
|
+
const image = (0, frames_1.renderFrame)(frame.data, { recorded: true, showcase: true, at: frame.at, width: viewport.width, height: viewport.height, colour: true, ...(options.label ? { label: options.label } : {}) });
|
|
164
166
|
const size = options.phone ? exports.PHONE_FRAME : { width: 1920, height: 1080 };
|
|
165
167
|
await (0, promises_1.writeFile)((0, node_path_1.join)(framesDir, name), await renderCanvasPng(image.toJSON(), size.width, size.height, frame.data.kind !== 'live' ? 'default' : options.phone ? 'phone' : 'showcase'), { flag: 'wx', mode: 0o600 });
|
|
166
168
|
}
|
|
@@ -189,6 +191,7 @@ async function renderRecording(source, options) {
|
|
|
189
191
|
frame_times: frames.map(frame => frame.at),
|
|
190
192
|
frame_viewports: frames.map(frame => options.phone ? { ...exports.PHONE_VIEWPORT } : frame.viewport ?? { width: 104, height: 35 }),
|
|
191
193
|
layout: options.phone ? 'phone' : 'wide',
|
|
194
|
+
label: options.label ?? null,
|
|
192
195
|
frame_size: options.phone ? { ...exports.PHONE_FRAME } : { width: 1920, height: 1080 },
|
|
193
196
|
video_frame_indices: videoIndices,
|
|
194
197
|
video_timestamp_precision: 'microseconds; equal timestamps retain the last frame in video and every PNG',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentguard-run/burn",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
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",
|