@agentguard-run/burn 0.7.0 → 0.7.1
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 +7 -0
- package/dist/src/canvas.d.ts +7 -1
- package/dist/src/canvas.js +17 -1
- package/dist/src/copy-ramp.d.ts +73 -0
- package/dist/src/copy-ramp.js +118 -0
- package/dist/src/dashboard-render.js +8 -4
- package/dist/src/live-panel.js +5 -2
- package/dist/src/render-recording.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.1 (2026-10-29)
|
|
4
|
+
|
|
5
|
+
- Brand ramp for the copies of a recorded run (`src/copy-ramp.ts`): fifteen oklch hues from teal 185 to violet 300 at chroma 0.105, chips at lightness 0.76, token cells at 0.63 with alpha 0.88, ledger text at 0.78, with the sRGB conversion and the nearest xterm index for 256-colour terminals. The canvas palette carries them as `copy01` to `copy15`, and showcase and phone frames use the same values. Teal stays for OK, red for STOP and every refused attempt, amber for WARN, and the done tick stays ink; no copy colour comes near any of them, so copy 1 no longer reads as allowed and copy 15 no longer reads as refused.
|
|
6
|
+
- The phone panel paints one ramp colour per launched copy instead of the spawn bar's state colour, which at the ceiling painted every copy red. The dashboard's ring markers and child cost bars carry the ramp too; the warn state stays on the arc, the bar and the counters.
|
|
7
|
+
- `ajv` moves to 8.18.0 (still an exact pin, was 8.17.1), which carries the upstream fix for GHSA-2g4f-4pwh-qvx6. The lockfile resolves `fast-uri` 3.1.9 (was 3.1.8), which carries the upstream fixes for GHSA-w74x-v6f9-j3xg and GHSA-wjr9-j795-jxcr.
|
|
8
|
+
- The `agentguard-burn` wrapper (0.7.1) requires `@agentguard-run/burn` ^0.7.1, so `npx agentguard-burn` gets this release.
|
|
9
|
+
|
|
3
10
|
## 0.7.0 (2026-10-28)
|
|
4
11
|
|
|
5
12
|
- Add `install`: one command for every agent host on this computer. It finds Claude Code, Codex, Cursor and Hermes by their command on PATH and their config folder, reading files only, and prints the plan: each host, the exact commands and the files they change. `--yes` carries it out: the AgentGuard plugin through Claude Code's and Codex's own plugin commands (with `npm ci` in Codex's plugin folder, and in Claude Code's only when it left the dependencies out), Burn's hook merged into `~/.cursor/hooks.json`, and `agentguard-spend-hermes` installed with uv into the Python environment Hermes runs from, then enabled. It then reads each host again and prints one line per host (installed, already installed, skipped, or failed with the reason) with the mode AgentGuard runs in and the status command that confirms the effective mode. `--only` and `--skip` choose hosts; `--json` gives an agent the plan and the results. A second run changes nothing. A failed host does not stop the others, and the exit code is 1. It never runs a downloaded script, never uses sudo, never installs a host itself, never asks for a key and never writes `burn-policy.json`, so the plugin's enforce default still applies to a fresh install.
|
package/dist/src/canvas.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { type CopyRampName } from './copy-ramp';
|
|
1
2
|
/**
|
|
2
3
|
* Heat ramps for calendar cells: `shade0` is a day with no tokens; `teal1` to
|
|
3
4
|
* `teal4` and `amber1` to `amber4` are the four token levels, mixed from the
|
|
4
5
|
* canvas background toward mint and amber, so the top level is the brand colour.
|
|
5
6
|
*/
|
|
6
7
|
export type CanvasHeatColor = 'shade0' | 'teal1' | 'teal2' | 'teal3' | 'teal4' | 'amber1' | 'amber2' | 'amber3' | 'amber4';
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* `copy01` to `copy15` are the brand ramp for the copies of a recorded run (see copy-ramp.ts): one hue per copy from
|
|
10
|
+
* teal into violet at one lightness, so no copy reads as allowed (mint) or refused (red). The values below are the
|
|
11
|
+
* chip colours of that ramp; tests/copy-ramp.test.ts checks them against the conversion.
|
|
12
|
+
*/
|
|
13
|
+
export type CanvasColor = 'mint' | 'slate' | 'amber' | 'red' | 'white' | 'none' | CanvasHeatColor | CopyRampName;
|
|
8
14
|
export type CanvasColorMode = 'truecolor' | '256' | 'none';
|
|
9
15
|
export interface CanvasCell {
|
|
10
16
|
char: string;
|
package/dist/src/canvas.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Canvas = exports.CANVAS_PALETTE = void 0;
|
|
4
4
|
/** A clipped grid of terminal cells. Rendering adds only palette-owned ANSI. */
|
|
5
5
|
const node_util_1 = require("node:util");
|
|
6
|
+
const copy_ramp_1 = require("./copy-ramp");
|
|
6
7
|
exports.CANVAS_PALETTE = {
|
|
7
8
|
mint: { hex: '#2ABCB4', rgb: [42, 188, 180], ansi256: 37 },
|
|
8
9
|
slate: { hex: '#64748B', rgb: [100, 116, 139], ansi256: 66 },
|
|
@@ -18,6 +19,21 @@ exports.CANVAS_PALETTE = {
|
|
|
18
19
|
amber2: { hex: '#8C5F10', rgb: [140, 95, 16], ansi256: 136 },
|
|
19
20
|
amber3: { hex: '#C27F0E', rgb: [194, 127, 14], ansi256: 172 },
|
|
20
21
|
amber4: { hex: '#F59E0B', rgb: [245, 158, 11], ansi256: 214 },
|
|
22
|
+
copy01: { hex: '#55C7BA', rgb: [85, 199, 186], ansi256: 79 },
|
|
23
|
+
copy02: { hex: '#50C6C4', rgb: [80, 198, 196], ansi256: 80 },
|
|
24
|
+
copy03: { hex: '#4FC5CD', rgb: [79, 197, 205], ansi256: 80 },
|
|
25
|
+
copy04: { hex: '#51C3D5', rgb: [81, 195, 213], ansi256: 74 },
|
|
26
|
+
copy05: { hex: '#57C1DD', rgb: [87, 193, 221], ansi256: 74 },
|
|
27
|
+
copy06: { hex: '#5EBFE4', rgb: [94, 191, 228], ansi256: 74 },
|
|
28
|
+
copy07: { hex: '#68BCEA', rgb: [104, 188, 234], ansi256: 74 },
|
|
29
|
+
copy08: { hex: '#72B9EE', rgb: [114, 185, 238], ansi256: 75 },
|
|
30
|
+
copy09: { hex: '#7DB6F2', rgb: [125, 182, 242], ansi256: 111 },
|
|
31
|
+
copy10: { hex: '#88B2F4', rgb: [136, 178, 244], ansi256: 111 },
|
|
32
|
+
copy11: { hex: '#93AFF4', rgb: [147, 175, 244], ansi256: 111 },
|
|
33
|
+
copy12: { hex: '#9EACF4', rgb: [158, 172, 244], ansi256: 147 },
|
|
34
|
+
copy13: { hex: '#A8A8F2', rgb: [168, 168, 242], ansi256: 147 },
|
|
35
|
+
copy14: { hex: '#B2A5EF', rgb: [178, 165, 239], ansi256: 147 },
|
|
36
|
+
copy15: { hex: '#BBA2EA', rgb: [187, 162, 234], ansi256: 146 },
|
|
21
37
|
};
|
|
22
38
|
const GLYPHS = {
|
|
23
39
|
'0': ['█▀█', '█ █', '█▄█'], '1': [' ▀█', ' █', ' █'],
|
|
@@ -40,7 +56,7 @@ const BIG_GLYPHS = {
|
|
|
40
56
|
'9': [' ### ', '# #', '# #', ' ####', ' #', ' #', ' ### '],
|
|
41
57
|
'-': [' ', ' ', ' ', '#####', ' ', ' ', ' '],
|
|
42
58
|
};
|
|
43
|
-
const colors = new Set(['mint', 'slate', 'amber', 'red', 'white', 'none', 'shade0', 'teal1', 'teal2', 'teal3', 'teal4', 'amber1', 'amber2', 'amber3', 'amber4']);
|
|
59
|
+
const colors = new Set(['mint', 'slate', 'amber', 'red', 'white', 'none', 'shade0', 'teal1', 'teal2', 'teal3', 'teal4', 'amber1', 'amber2', 'amber3', 'amber4', ...copy_ramp_1.COPY_RAMP_NAMES]);
|
|
44
60
|
function dimension(value, fallback, limit) {
|
|
45
61
|
return Math.max(1, Math.min(limit, Math.floor(typeof value === 'number' && Number.isFinite(value) ? value : fallback)));
|
|
46
62
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand ramp for the copies of a recorded run: fifteen hues from teal (185) through blue into violet (300) in oklch,
|
|
3
|
+
* at one lightness and one chroma, so copy 1 and copy 15 read as the same kind of thing. Teal stays reserved for OK,
|
|
4
|
+
* red for refusals and STOP, amber for WARN, and the done tick stays ink; no copy colour comes near any of them.
|
|
5
|
+
* Token sheet: oklch lightness 0.76 chroma 0.105 for chips, lightness 0.63 at alpha 0.88 for token cells,
|
|
6
|
+
* lightness 0.78 for ledger text in the copy's hue (Claude Design, Oct 28 2026).
|
|
7
|
+
*/
|
|
8
|
+
export declare const COPY_RAMP_SIZE = 15;
|
|
9
|
+
export declare const COPY_RAMP_HUE: Readonly<{
|
|
10
|
+
from: 185;
|
|
11
|
+
to: 300;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const COPY_RAMP_CHROMA = 0.105;
|
|
14
|
+
export declare const COPY_RAMP_LIGHTNESS: Readonly<{
|
|
15
|
+
chip: 0.76;
|
|
16
|
+
cell: 0.63;
|
|
17
|
+
ledger: 0.78;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const COPY_CELL_ALPHA = 0.88;
|
|
20
|
+
export type CopyRole = 'chip' | 'cell' | 'ledger';
|
|
21
|
+
export type Rgb = readonly [number, number, number];
|
|
22
|
+
export interface CopyRampEntry {
|
|
23
|
+
index: number;
|
|
24
|
+
name: CopyRampName;
|
|
25
|
+
hue: number;
|
|
26
|
+
chip: string;
|
|
27
|
+
cell: string;
|
|
28
|
+
ledger: string;
|
|
29
|
+
rgb: Rgb;
|
|
30
|
+
ansi256: number;
|
|
31
|
+
}
|
|
32
|
+
export type CopyRampName = 'copy01' | 'copy02' | 'copy03' | 'copy04' | 'copy05' | 'copy06' | 'copy07' | 'copy08' | 'copy09' | 'copy10' | 'copy11' | 'copy12' | 'copy13' | 'copy14' | 'copy15';
|
|
33
|
+
export declare const COPY_RAMP_NAMES: readonly CopyRampName[];
|
|
34
|
+
/** Copy k of 15 (0-based) sits at an even step from the first hue to the last, both inclusive. */
|
|
35
|
+
export declare function copyHue(index: number): number;
|
|
36
|
+
/** oklch to sRGB, the Ottosson matrices, gamma encoded and clipped to the sRGB cube. */
|
|
37
|
+
export declare function oklchToRgb(lightness: number, chroma: number, hue: number): [number, number, number];
|
|
38
|
+
export declare function rgbToHex(rgb: Rgb): string;
|
|
39
|
+
export declare function hexToRgb(hex: string): [number, number, number];
|
|
40
|
+
/** Nearest of the 240 xterm colours (the 6x6x6 cube and the grey ramp) by sRGB distance, for 256-colour terminals. */
|
|
41
|
+
export declare function nearestAnsi256(rgb: Rgb): number;
|
|
42
|
+
/** The fifteen ramp entries, computed once from the token sheet. */
|
|
43
|
+
export declare const COPY_RAMP: readonly CopyRampEntry[];
|
|
44
|
+
/** Copy k (0-based, wrapping past 15) in one role: the chip fill, the token cell fill, or the ledger line text. */
|
|
45
|
+
export declare function copyColor(index: number, role?: CopyRole): string;
|
|
46
|
+
/** Palette name of copy k, for terminal cells. */
|
|
47
|
+
export declare function copyName(index: number): CopyRampName;
|
|
48
|
+
/**
|
|
49
|
+
* Fixed meanings the ramp never borrows: OK is the brand teal, WARN amber, STOP and every refusal red. The done tick on a
|
|
50
|
+
* chip is drawn in the panel's ink, the same as the copy number, as the Claude Design sample keeps it; it is never a ramp colour.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ROLE_COLORS: Readonly<{
|
|
53
|
+
ok: "#2ABCB4";
|
|
54
|
+
done: "#0B1117";
|
|
55
|
+
warn: "#F59E0B";
|
|
56
|
+
stop: "#FF5A4E";
|
|
57
|
+
}>;
|
|
58
|
+
export type Verdict = 'OK' | 'WARN' | 'STOP';
|
|
59
|
+
export declare function verdictColor(verdict: Verdict): string;
|
|
60
|
+
/**
|
|
61
|
+
* One rule for every mark that stands for a copy or a decision. A refused attempt is red whatever its position;
|
|
62
|
+
* a finished copy keeps its ramp colour and earns an ink tick; a copy that is running is simply its ramp colour.
|
|
63
|
+
*/
|
|
64
|
+
export declare function copyPaint(input: {
|
|
65
|
+
index: number;
|
|
66
|
+
role?: CopyRole;
|
|
67
|
+
refused?: boolean;
|
|
68
|
+
done?: boolean;
|
|
69
|
+
}): {
|
|
70
|
+
color: string;
|
|
71
|
+
tick: string | null;
|
|
72
|
+
alpha: number;
|
|
73
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROLE_COLORS = exports.COPY_RAMP = exports.COPY_RAMP_NAMES = exports.COPY_CELL_ALPHA = exports.COPY_RAMP_LIGHTNESS = exports.COPY_RAMP_CHROMA = exports.COPY_RAMP_HUE = exports.COPY_RAMP_SIZE = void 0;
|
|
4
|
+
exports.copyHue = copyHue;
|
|
5
|
+
exports.oklchToRgb = oklchToRgb;
|
|
6
|
+
exports.rgbToHex = rgbToHex;
|
|
7
|
+
exports.hexToRgb = hexToRgb;
|
|
8
|
+
exports.nearestAnsi256 = nearestAnsi256;
|
|
9
|
+
exports.copyColor = copyColor;
|
|
10
|
+
exports.copyName = copyName;
|
|
11
|
+
exports.verdictColor = verdictColor;
|
|
12
|
+
exports.copyPaint = copyPaint;
|
|
13
|
+
/**
|
|
14
|
+
* Brand ramp for the copies of a recorded run: fifteen hues from teal (185) through blue into violet (300) in oklch,
|
|
15
|
+
* at one lightness and one chroma, so copy 1 and copy 15 read as the same kind of thing. Teal stays reserved for OK,
|
|
16
|
+
* red for refusals and STOP, amber for WARN, and the done tick stays ink; no copy colour comes near any of them.
|
|
17
|
+
* Token sheet: oklch lightness 0.76 chroma 0.105 for chips, lightness 0.63 at alpha 0.88 for token cells,
|
|
18
|
+
* lightness 0.78 for ledger text in the copy's hue (Claude Design, Oct 28 2026).
|
|
19
|
+
*/
|
|
20
|
+
exports.COPY_RAMP_SIZE = 15;
|
|
21
|
+
exports.COPY_RAMP_HUE = Object.freeze({ from: 185, to: 300 });
|
|
22
|
+
exports.COPY_RAMP_CHROMA = 0.105;
|
|
23
|
+
exports.COPY_RAMP_LIGHTNESS = Object.freeze({ chip: 0.76, cell: 0.63, ledger: 0.78 });
|
|
24
|
+
exports.COPY_CELL_ALPHA = 0.88;
|
|
25
|
+
exports.COPY_RAMP_NAMES = Object.freeze(['copy01', 'copy02', 'copy03', 'copy04', 'copy05', 'copy06', 'copy07', 'copy08', 'copy09', 'copy10', 'copy11', 'copy12', 'copy13', 'copy14', 'copy15']);
|
|
26
|
+
/** Copy k of 15 (0-based) sits at an even step from the first hue to the last, both inclusive. */
|
|
27
|
+
function copyHue(index) {
|
|
28
|
+
const k = ((Math.floor(index) % exports.COPY_RAMP_SIZE) + exports.COPY_RAMP_SIZE) % exports.COPY_RAMP_SIZE;
|
|
29
|
+
return exports.COPY_RAMP_HUE.from + k * (exports.COPY_RAMP_HUE.to - exports.COPY_RAMP_HUE.from) / (exports.COPY_RAMP_SIZE - 1);
|
|
30
|
+
}
|
|
31
|
+
/** oklch to sRGB, the Ottosson matrices, gamma encoded and clipped to the sRGB cube. */
|
|
32
|
+
function oklchToRgb(lightness, chroma, hue) {
|
|
33
|
+
const radians = hue * Math.PI / 180, a = chroma * Math.cos(radians), b = chroma * Math.sin(radians);
|
|
34
|
+
const l = Math.pow(lightness + 0.3963377774 * a + 0.2158037573 * b, 3);
|
|
35
|
+
const m = Math.pow(lightness - 0.1055613458 * a - 0.0638541728 * b, 3);
|
|
36
|
+
const s = Math.pow(lightness - 0.0894841775 * a - 1.2914855480 * b, 3);
|
|
37
|
+
const linear = [
|
|
38
|
+
4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
|
|
39
|
+
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
|
|
40
|
+
-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s,
|
|
41
|
+
];
|
|
42
|
+
return linear.map(value => {
|
|
43
|
+
const clipped = Math.max(0, Math.min(1, value));
|
|
44
|
+
const encoded = clipped <= 0.0031308 ? 12.92 * clipped : 1.055 * Math.pow(clipped, 1 / 2.4) - 0.055;
|
|
45
|
+
return Math.round(encoded * 255);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function rgbToHex(rgb) {
|
|
49
|
+
return `#${rgb.map(channel => Math.max(0, Math.min(255, Math.round(channel))).toString(16).padStart(2, '0').toUpperCase()).join('')}`;
|
|
50
|
+
}
|
|
51
|
+
function hexToRgb(hex) {
|
|
52
|
+
const match = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
53
|
+
if (!match)
|
|
54
|
+
throw new Error(`Not a six digit hex colour: ${hex}`);
|
|
55
|
+
const value = parseInt(match[1], 16);
|
|
56
|
+
return [value >> 16 & 255, value >> 8 & 255, value & 255];
|
|
57
|
+
}
|
|
58
|
+
const CUBE_LEVELS = [0, 95, 135, 175, 215, 255];
|
|
59
|
+
/** Nearest of the 240 xterm colours (the 6x6x6 cube and the grey ramp) by sRGB distance, for 256-colour terminals. */
|
|
60
|
+
function nearestAnsi256(rgb) {
|
|
61
|
+
let best = 16, bestDistance = Infinity;
|
|
62
|
+
const consider = (index, candidate) => {
|
|
63
|
+
const distance = (rgb[0] - candidate[0]) ** 2 + (rgb[1] - candidate[1]) ** 2 + (rgb[2] - candidate[2]) ** 2;
|
|
64
|
+
if (distance < bestDistance) {
|
|
65
|
+
best = index;
|
|
66
|
+
bestDistance = distance;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
for (let r = 0; r < 6; r++)
|
|
70
|
+
for (let g = 0; g < 6; g++)
|
|
71
|
+
for (let b = 0; b < 6; b++)
|
|
72
|
+
consider(16 + 36 * r + 6 * g + b, [CUBE_LEVELS[r], CUBE_LEVELS[g], CUBE_LEVELS[b]]);
|
|
73
|
+
for (let i = 0; i < 24; i++) {
|
|
74
|
+
const grey = 8 + 10 * i;
|
|
75
|
+
consider(232 + i, [grey, grey, grey]);
|
|
76
|
+
}
|
|
77
|
+
return best;
|
|
78
|
+
}
|
|
79
|
+
function entry(index) {
|
|
80
|
+
const hue = copyHue(index), rgb = oklchToRgb(exports.COPY_RAMP_LIGHTNESS.chip, exports.COPY_RAMP_CHROMA, hue);
|
|
81
|
+
return {
|
|
82
|
+
index, name: exports.COPY_RAMP_NAMES[index], hue,
|
|
83
|
+
chip: rgbToHex(rgb),
|
|
84
|
+
cell: rgbToHex(oklchToRgb(exports.COPY_RAMP_LIGHTNESS.cell, exports.COPY_RAMP_CHROMA, hue)),
|
|
85
|
+
ledger: rgbToHex(oklchToRgb(exports.COPY_RAMP_LIGHTNESS.ledger, exports.COPY_RAMP_CHROMA, hue)),
|
|
86
|
+
rgb, ansi256: nearestAnsi256(rgb),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** The fifteen ramp entries, computed once from the token sheet. */
|
|
90
|
+
exports.COPY_RAMP = Object.freeze(Array.from({ length: exports.COPY_RAMP_SIZE }, (_, index) => Object.freeze(entry(index))));
|
|
91
|
+
/** Copy k (0-based, wrapping past 15) in one role: the chip fill, the token cell fill, or the ledger line text. */
|
|
92
|
+
function copyColor(index, role = 'chip') {
|
|
93
|
+
const k = ((Math.floor(index) % exports.COPY_RAMP_SIZE) + exports.COPY_RAMP_SIZE) % exports.COPY_RAMP_SIZE;
|
|
94
|
+
return exports.COPY_RAMP[k][role];
|
|
95
|
+
}
|
|
96
|
+
/** Palette name of copy k, for terminal cells. */
|
|
97
|
+
function copyName(index) {
|
|
98
|
+
const k = ((Math.floor(index) % exports.COPY_RAMP_SIZE) + exports.COPY_RAMP_SIZE) % exports.COPY_RAMP_SIZE;
|
|
99
|
+
return exports.COPY_RAMP_NAMES[k];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Fixed meanings the ramp never borrows: OK is the brand teal, WARN amber, STOP and every refusal red. The done tick on a
|
|
103
|
+
* chip is drawn in the panel's ink, the same as the copy number, as the Claude Design sample keeps it; it is never a ramp colour.
|
|
104
|
+
*/
|
|
105
|
+
exports.ROLE_COLORS = Object.freeze({ ok: '#2ABCB4', done: '#0B1117', warn: '#F59E0B', stop: '#FF5A4E' });
|
|
106
|
+
function verdictColor(verdict) {
|
|
107
|
+
return verdict === 'STOP' ? exports.ROLE_COLORS.stop : verdict === 'WARN' ? exports.ROLE_COLORS.warn : exports.ROLE_COLORS.ok;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* One rule for every mark that stands for a copy or a decision. A refused attempt is red whatever its position;
|
|
111
|
+
* a finished copy keeps its ramp colour and earns an ink tick; a copy that is running is simply its ramp colour.
|
|
112
|
+
*/
|
|
113
|
+
function copyPaint(input) {
|
|
114
|
+
if (input.refused)
|
|
115
|
+
return { color: exports.ROLE_COLORS.stop, tick: null, alpha: 1 };
|
|
116
|
+
const role = input.role ?? 'chip';
|
|
117
|
+
return { color: copyColor(input.index, role), tick: input.done ? exports.ROLE_COLORS.done : null, alpha: role === 'cell' ? exports.COPY_CELL_ALPHA : 1 };
|
|
118
|
+
}
|
|
@@ -25,6 +25,7 @@ const node_child_process_1 = require("node:child_process");
|
|
|
25
25
|
const node_util_1 = require("node:util");
|
|
26
26
|
const node_path_1 = require("node:path");
|
|
27
27
|
const canvas_1 = require("@napi-rs/canvas");
|
|
28
|
+
const copy_ramp_1 = require("./copy-ramp");
|
|
28
29
|
const live_1 = require("./insights/live");
|
|
29
30
|
const render_recording_1 = require("./render-recording");
|
|
30
31
|
const dashboard_model_1 = require("./dashboard-model");
|
|
@@ -195,18 +196,19 @@ function ring(ctx, model, state, g, phases) {
|
|
|
195
196
|
ctx.lineTo(cx + gateW, cy - r);
|
|
196
197
|
ctx.stroke();
|
|
197
198
|
text(ctx, 'gate', cx - gateW - 14, cy - r + 8, g.small, { color: exports.INK.secondary, align: 'right' });
|
|
198
|
-
// One marker per recorded spawn, popping in at its decision time
|
|
199
|
+
// One marker per recorded spawn, popping in at its decision time, in its copy's ramp colour (teal into violet, copy 1 to 15).
|
|
200
|
+
// The warn state stays on the arc, the bar and the counters; a copy is never drawn amber or red, only the attempts are.
|
|
199
201
|
for (let k = 1; k <= shown; k++) {
|
|
200
202
|
const event = model.events.filter(event => event.verdict !== 'STOP')[k - 1];
|
|
201
203
|
const born = event ? event.offsetMs : 0, scale = easeOut((state.t - born) / 320);
|
|
202
204
|
if (scale <= 0)
|
|
203
205
|
continue;
|
|
204
|
-
const a = angle(k), x = cx + Math.cos(a) * r, y = cy + Math.sin(a) * r
|
|
206
|
+
const a = angle(k), x = cx + Math.cos(a) * r, y = cy + Math.sin(a) * r;
|
|
205
207
|
ctx.fillStyle = exports.INK.paper;
|
|
206
208
|
ctx.beginPath();
|
|
207
209
|
ctx.arc(x, y, 19 * scale, 0, Math.PI * 2);
|
|
208
210
|
ctx.fill();
|
|
209
|
-
ctx.fillStyle =
|
|
211
|
+
ctx.fillStyle = (0, copy_ramp_1.copyColor)(k - 1);
|
|
210
212
|
ctx.beginPath();
|
|
211
213
|
ctx.arc(x, y, 14 * scale, 0, Math.PI * 2);
|
|
212
214
|
ctx.fill();
|
|
@@ -305,6 +307,8 @@ function agents(ctx, model, state, g) {
|
|
|
305
307
|
text(ctx, who, x + 20, cap1, g.body, { color: exports.INK.ink, alpha: reveal });
|
|
306
308
|
text(ctx, 'list price · not a bill', x + 20, cap2, g.body, { color: exports.INK.secondary, alpha: reveal });
|
|
307
309
|
const sorted = [...economics.children].sort((a, b) => (b.tokens ?? 0) - (a.tokens ?? 0)), top = sorted.slice(0, rows), max = top[0]?.tokens ?? 1;
|
|
310
|
+
// A child's bar keeps the ramp colour of its launch position (the economics rows are in start order), so the same copy is the same colour everywhere.
|
|
311
|
+
const launchOrder = new Map(economics.children.map((child, index) => [child.child, index]));
|
|
308
312
|
const first = cap2 + g.body * .7, pitch = (h - (first - y) - 44) / rows, barW = w - 40 - g.number * 3.6;
|
|
309
313
|
top.forEach((child, i) => {
|
|
310
314
|
const row = first + i * pitch, fill = clamp01((child.tokens ?? 0) / max) * reveal;
|
|
@@ -312,7 +316,7 @@ function agents(ctx, model, state, g) {
|
|
|
312
316
|
ctx.beginPath();
|
|
313
317
|
ctx.roundRect(x + 20, row + pitch * .3, barW, 10, 5);
|
|
314
318
|
ctx.fill();
|
|
315
|
-
ctx.fillStyle =
|
|
319
|
+
ctx.fillStyle = (0, copy_ramp_1.copyColor)(launchOrder.get(child.child) ?? i);
|
|
316
320
|
ctx.beginPath();
|
|
317
321
|
ctx.roundRect(x + 20, row + pitch * .3, Math.max(10, barW * fill), 10, 5);
|
|
318
322
|
ctx.fill();
|
package/dist/src/live-panel.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.runLivePanel = runLivePanel;
|
|
|
13
13
|
const node_crypto_1 = require("node:crypto");
|
|
14
14
|
const node_fs_1 = require("node:fs");
|
|
15
15
|
const canvas_1 = require("./canvas");
|
|
16
|
+
const copy_ramp_1 = require("./copy-ramp");
|
|
16
17
|
const ledger_panel_1 = require("./ledger-panel");
|
|
17
18
|
const recording_1 = require("./recording");
|
|
18
19
|
const sessions_1 = require("./insights/sessions");
|
|
@@ -119,6 +120,8 @@ function renderPhonePanel(snapshot, options = {}) {
|
|
|
119
120
|
c.bar(13, 0, w, fraction, color).bar(14, 0, w, fraction, color);
|
|
120
121
|
// One block per copy that launched. The spawn-rate counter also counts the attempt that reached the ceiling and was refused,
|
|
121
122
|
// so once a STOP is shown the copies that ran are one fewer than the counter. The grid only exists when the ceiling was recorded.
|
|
123
|
+
// Each block carries its copy's ramp colour (copy01 to copy15, teal into violet), never the bar's state colour: at the
|
|
124
|
+
// ceiling the bar is red because the next attempt was refused, while the copies that ran are neither allowed-green nor refused-red.
|
|
122
125
|
if (snapshot.spawnCeiling !== null && snapshot.spawnCeiling > 0) {
|
|
123
126
|
const ceiling = snapshot.spawnCeiling, attempts = Math.min(ceiling, Math.max(0, snapshot.spawns ?? 0));
|
|
124
127
|
const filled = snapshot.stop && attempts >= ceiling ? attempts - 1 : attempts;
|
|
@@ -129,8 +132,8 @@ function renderPhonePanel(snapshot, options = {}) {
|
|
|
129
132
|
c.put(16, Math.max(13, w - tag.length), tag, refused ? 'red' : 'slate');
|
|
130
133
|
for (let index = 0; index < ceiling; index++) {
|
|
131
134
|
const row = 17 + Math.floor(index / perRow) * 2, col = (index % perRow) * (blockWidth + 1);
|
|
132
|
-
const on = index < filled, glyph = (on ? '█' : '░').repeat(blockWidth);
|
|
133
|
-
c.put(row, col, glyph,
|
|
135
|
+
const on = index < filled, glyph = (on ? '█' : '░').repeat(blockWidth), tint = on ? (0, copy_ramp_1.copyName)(index) : 'slate';
|
|
136
|
+
c.put(row, col, glyph, tint).put(row + 1, col, glyph, tint);
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
c.put(22, 0, 'LAST 3 DECISIONS', 'slate');
|
|
@@ -15,6 +15,7 @@ const node_util_1 = require("node:util");
|
|
|
15
15
|
const node_path_1 = require("node:path");
|
|
16
16
|
const canvas_1 = require("@napi-rs/canvas");
|
|
17
17
|
const canvas_2 = require("./canvas");
|
|
18
|
+
const copy_ramp_1 = require("./copy-ramp");
|
|
18
19
|
const frames_1 = require("./frames");
|
|
19
20
|
const recording_1 = require("./recording");
|
|
20
21
|
const run = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
@@ -95,7 +96,8 @@ async function renderCanvasPng(snapshot, width = 1920, height = 1080, style = 'd
|
|
|
95
96
|
ctx.font = `${style === 'default' ? '' : 'bold '}${26 * cellWidth / CELL_WIDTH}px "${FONT_ALIAS}"`;
|
|
96
97
|
ctx.textBaseline = 'alphabetic';
|
|
97
98
|
// Showcase and phone palette: brighter than the terminal palette so text survives re-encoding on social players.
|
|
98
|
-
|
|
99
|
+
// The copies' ramp (copy01 to copy15) is the same in both, one hue per copy from teal into violet.
|
|
100
|
+
const VIDEO_HEX = style === 'default' ? {} : { mint: '#2ABCB4', slate: '#B4BECF', amber: '#F59E0B', red: '#FF5A4E', white: '#FFFFFF', ...Object.fromEntries(copy_ramp_1.COPY_RAMP.map(entry => [entry.name, entry.chip])) };
|
|
99
101
|
for (let row = 0; row < snapshot.height; row++)
|
|
100
102
|
for (let col = 0; col < snapshot.width; col++) {
|
|
101
103
|
const cell = snapshot.cells[row][col];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentguard-run/burn",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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
|
"homepage": "https://agentguard.run/burn",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@napi-rs/canvas": "^1.0.9",
|
|
65
65
|
"@agentguard-run/spend": "0.22.0",
|
|
66
|
-
"ajv": "8.
|
|
66
|
+
"ajv": "8.18.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "^22",
|