@openai/codex-security 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -8
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
- package/_bundled_plugin/.mcp.json +24 -1
- package/_bundled_plugin/mcp/mcp-app.html.br +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/preflight/capability-profiles.toml +0 -57
- package/_bundled_plugin/references/config-preflight.md +1 -1
- package/_bundled_plugin/references/final-report.md +15 -7
- package/_bundled_plugin/references/scan-artifacts.md +11 -9
- package/_bundled_plugin/references/scan-contract.md +3 -1
- package/_bundled_plugin/schemas/definitions/artifact-common.schema.json +42 -0
- package/_bundled_plugin/schemas/definitions/discovery-candidate.schema.json +100 -0
- package/_bundled_plugin/schemas/tools/candidate-attack-paths.schema.json +181 -0
- package/_bundled_plugin/schemas/tools/candidate-validations.schema.json +166 -0
- package/_bundled_plugin/schemas/tools/deep-reducer.schema.json +120 -0
- package/_bundled_plugin/schemas/tools/discovery-candidates.schema.json +83 -0
- package/_bundled_plugin/schemas/tools/review-items.schema.json +80 -0
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +572 -0
- package/_bundled_plugin/schemas/tools/worker-threat-model.schema.json +18 -0
- package/_bundled_plugin/scripts/deep_scan_config.py +11 -3
- package/_bundled_plugin/scripts/deep_scan_workbench.py +153 -133
- package/_bundled_plugin/scripts/finalize_scan_contract.py +21 -0
- package/_bundled_plugin/scripts/generate_in_scope_files.py +134 -0
- package/_bundled_plugin/scripts/workbench_cli.py +33 -1
- package/_bundled_plugin/scripts/workbench_db.py +127 -117
- package/_bundled_plugin/scripts/workbench_feedback.py +2 -0
- package/_bundled_plugin/scripts/workbench_native_indexes.py +5 -49
- package/_bundled_plugin/scripts/workbench_progress.py +86 -3
- package/_bundled_plugin/scripts/workbench_remediation.py +19 -1
- package/_bundled_plugin/scripts/workbench_scan_history.py +7 -1
- package/_bundled_plugin/scripts/workbench_scan_start.py +11 -5
- package/_bundled_plugin/scripts/workbench_scan_usage.py +557 -0
- package/_bundled_plugin/scripts/workbench_schema.py +501 -0
- package/_bundled_plugin/scripts/workbench_validation.py +117 -13
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +4 -4
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +34 -28
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +11 -8
- package/_bundled_plugin/skills/security-scan/SKILL.md +16 -9
- package/_bundled_plugin/skills/security-scan/references/repository-wide-scan.md +26 -14
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +1 -1
- package/_bundled_plugin/skills/threat-model/SKILL.md +2 -2
- package/_bundled_plugin/skills/validation/SKILL.md +5 -5
- package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +145 -227
- package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +53 -68
- package/dist/api.d.ts +33 -7
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +361 -48
- package/dist/api.js.map +1 -1
- package/dist/auth.js +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +477 -40
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +29 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +47 -2
- package/dist/config.js.map +1 -1
- package/dist/cost.d.ts +7 -0
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +349 -18
- package/dist/cost.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/multiscan.d.ts +1 -0
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +3 -0
- package/dist/multiscan.js.map +1 -1
- package/dist/runtime.d.ts +16 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +540 -25
- package/dist/runtime.js.map +1 -1
- package/dist/scan-activity.d.ts +13 -0
- package/dist/scan-activity.d.ts.map +1 -0
- package/dist/scan-activity.js +319 -0
- package/dist/scan-activity.js.map +1 -0
- package/dist/scan-dashboard.d.ts +47 -0
- package/dist/scan-dashboard.d.ts.map +1 -0
- package/dist/scan-dashboard.js +444 -0
- package/dist/scan-dashboard.js.map +1 -0
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +4 -1
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/worker-progress.d.ts +7 -0
- package/dist/worker-progress.d.ts.map +1 -1
- package/dist/worker-progress.js +68 -0
- package/dist/worker-progress.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { basename, isAbsolute } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
|
+
import { formatUsd } from "./cost.js";
|
|
5
|
+
const HIDE_CURSOR = "\u001B[?25l";
|
|
6
|
+
const SHOW_CURSOR = "\u001B[?25h";
|
|
7
|
+
const ENTER_ALTERNATE_SCREEN = "\u001B[?1049h";
|
|
8
|
+
const EXIT_ALTERNATE_SCREEN = "\u001B[?1049l";
|
|
9
|
+
const ENABLE_ALTERNATE_SCROLL = "\u001B[?1007h";
|
|
10
|
+
const DISABLE_ALTERNATE_SCROLL = "\u001B[?1007l";
|
|
11
|
+
const CURSOR_HOME = "\u001B[H";
|
|
12
|
+
const ERASE_LINE = "\u001B[2K";
|
|
13
|
+
const MAX_HISTORY_ENTRIES = 2_000;
|
|
14
|
+
const FIXED_SCREEN_ROWS = 8;
|
|
15
|
+
const ACTIVITY_MARKERS = {
|
|
16
|
+
command: "✓",
|
|
17
|
+
tool: "✓",
|
|
18
|
+
message: "●",
|
|
19
|
+
reasoning: "◦",
|
|
20
|
+
status: "◆",
|
|
21
|
+
warning: "▲",
|
|
22
|
+
};
|
|
23
|
+
const LINE_STYLES = {
|
|
24
|
+
title: "1",
|
|
25
|
+
message: "36",
|
|
26
|
+
reasoning: "35",
|
|
27
|
+
tool: "36",
|
|
28
|
+
command: "2",
|
|
29
|
+
path: "2",
|
|
30
|
+
code: "2",
|
|
31
|
+
status: "32",
|
|
32
|
+
warning: "33",
|
|
33
|
+
};
|
|
34
|
+
export class ScanDashboard {
|
|
35
|
+
#stream;
|
|
36
|
+
#options;
|
|
37
|
+
#startedAt;
|
|
38
|
+
#activities = [];
|
|
39
|
+
#stage = "Preparing scan";
|
|
40
|
+
#files = null;
|
|
41
|
+
#cost = null;
|
|
42
|
+
#timer = null;
|
|
43
|
+
#scrollOffset = 0;
|
|
44
|
+
#inputWasRaw = false;
|
|
45
|
+
#noteCount = 0;
|
|
46
|
+
#onInput = (chunk) => {
|
|
47
|
+
const input = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
48
|
+
let lines = 0;
|
|
49
|
+
for (const key of input.match(/[\u0003\u0004\u0015]|\u001B\[(?:[ABHF]|[1456]~)/gu) ?? []) {
|
|
50
|
+
if (key === "\u0003") {
|
|
51
|
+
if (lines !== 0)
|
|
52
|
+
this.scroll(lines);
|
|
53
|
+
this.#options.onInterrupt?.();
|
|
54
|
+
lines = 0;
|
|
55
|
+
}
|
|
56
|
+
else if (key === "\u001B[A") {
|
|
57
|
+
lines += 1;
|
|
58
|
+
}
|
|
59
|
+
else if (key === "\u001B[B") {
|
|
60
|
+
lines -= 1;
|
|
61
|
+
}
|
|
62
|
+
else if (key === "\u0015") {
|
|
63
|
+
lines += Math.max(1, Math.floor(this.#activityRows() / 2));
|
|
64
|
+
}
|
|
65
|
+
else if (key === "\u0004") {
|
|
66
|
+
lines -= Math.max(1, Math.floor(this.#activityRows() / 2));
|
|
67
|
+
}
|
|
68
|
+
else if (key === "\u001B[5~") {
|
|
69
|
+
lines += this.#activityRows();
|
|
70
|
+
}
|
|
71
|
+
else if (key === "\u001B[6~") {
|
|
72
|
+
lines -= this.#activityRows();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (lines !== 0)
|
|
76
|
+
this.scroll(lines);
|
|
77
|
+
this.scroll(key === "\u001B[H" || key === "\u001B[1~"
|
|
78
|
+
? Number.MAX_SAFE_INTEGER
|
|
79
|
+
: -Number.MAX_SAFE_INTEGER);
|
|
80
|
+
lines = 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (lines !== 0)
|
|
84
|
+
this.scroll(lines);
|
|
85
|
+
};
|
|
86
|
+
constructor(stream, options) {
|
|
87
|
+
this.#stream = stream;
|
|
88
|
+
this.#options = options;
|
|
89
|
+
this.#startedAt = options.clock.now();
|
|
90
|
+
}
|
|
91
|
+
start() {
|
|
92
|
+
if (this.#timer !== null)
|
|
93
|
+
return;
|
|
94
|
+
this.#stream.write(`${ENTER_ALTERNATE_SCREEN}${HIDE_CURSOR}`);
|
|
95
|
+
const input = this.#options.input;
|
|
96
|
+
if (input?.isTTY === true) {
|
|
97
|
+
this.#inputWasRaw = input.isRaw === true;
|
|
98
|
+
input.setRawMode?.(true);
|
|
99
|
+
input.resume?.();
|
|
100
|
+
input.on("data", this.#onInput);
|
|
101
|
+
this.#stream.write(ENABLE_ALTERNATE_SCROLL);
|
|
102
|
+
}
|
|
103
|
+
this.#render();
|
|
104
|
+
this.#timer = this.#options.clock.setInterval(() => this.#render(), 1_000);
|
|
105
|
+
}
|
|
106
|
+
stop() {
|
|
107
|
+
if (this.#timer === null)
|
|
108
|
+
return;
|
|
109
|
+
this.#options.clock.clearInterval(this.#timer);
|
|
110
|
+
this.#timer = null;
|
|
111
|
+
const input = this.#options.input;
|
|
112
|
+
if (input?.isTTY === true) {
|
|
113
|
+
input.off("data", this.#onInput);
|
|
114
|
+
input.setRawMode?.(this.#inputWasRaw);
|
|
115
|
+
input.pause?.();
|
|
116
|
+
}
|
|
117
|
+
this.#stream.write(`${input?.isTTY === true ? DISABLE_ALTERNATE_SCROLL : ""}${SHOW_CURSOR}${EXIT_ALTERNATE_SCREEN}`);
|
|
118
|
+
}
|
|
119
|
+
setStage(stage) {
|
|
120
|
+
this.#stage = stage;
|
|
121
|
+
this.#refresh();
|
|
122
|
+
}
|
|
123
|
+
setFiles(files) {
|
|
124
|
+
this.#files = files;
|
|
125
|
+
this.#refresh();
|
|
126
|
+
}
|
|
127
|
+
setCost(cost) {
|
|
128
|
+
this.#cost = cost;
|
|
129
|
+
this.#refresh();
|
|
130
|
+
}
|
|
131
|
+
note(description) {
|
|
132
|
+
this.record({
|
|
133
|
+
id: `scan-note-${++this.#noteCount}`,
|
|
134
|
+
kind: "command",
|
|
135
|
+
status: "completed",
|
|
136
|
+
description,
|
|
137
|
+
paths: [],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
record(activity) {
|
|
141
|
+
const existing = this.#activities.findIndex((entry) => entry.id === activity.id ||
|
|
142
|
+
(entry.worker === activity.worker &&
|
|
143
|
+
isFileInventory(entry) &&
|
|
144
|
+
isFileInventory(activity)));
|
|
145
|
+
const previousRows = this.#scrollOffset === 0 ? 0 : this.#activityLines(this.#width()).length;
|
|
146
|
+
const recordedAt = existing < 0
|
|
147
|
+
? this.#options.clock.now()
|
|
148
|
+
: this.#activities[existing].recordedAt;
|
|
149
|
+
const entry = { ...activity, recordedAt };
|
|
150
|
+
if (existing < 0) {
|
|
151
|
+
this.#activities.push(entry);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
this.#activities[existing] = entry;
|
|
155
|
+
}
|
|
156
|
+
if (this.#activities.length > MAX_HISTORY_ENTRIES) {
|
|
157
|
+
this.#activities.splice(0, this.#activities.length - MAX_HISTORY_ENTRIES);
|
|
158
|
+
}
|
|
159
|
+
if (this.#scrollOffset !== 0) {
|
|
160
|
+
this.#scrollOffset += Math.max(0, this.#activityLines(this.#width()).length - previousRows);
|
|
161
|
+
}
|
|
162
|
+
this.#refresh();
|
|
163
|
+
}
|
|
164
|
+
scroll(lines) {
|
|
165
|
+
const maximum = Math.max(0, this.#activityLines(this.#width()).length - this.#activityRows());
|
|
166
|
+
this.#scrollOffset = Math.max(0, Math.min(maximum, this.#scrollOffset + lines));
|
|
167
|
+
this.#refresh();
|
|
168
|
+
}
|
|
169
|
+
#refresh() {
|
|
170
|
+
if (this.#timer !== null)
|
|
171
|
+
this.#render();
|
|
172
|
+
}
|
|
173
|
+
#render() {
|
|
174
|
+
const width = this.#width();
|
|
175
|
+
const activityRows = this.#activityRows();
|
|
176
|
+
const divider = ` ${"─".repeat(Math.max(0, width - 4))}`;
|
|
177
|
+
const elapsed = Math.max(0, Math.floor((this.#options.clock.now() - this.#startedAt) / 1_000));
|
|
178
|
+
const time = formatElapsed(elapsed);
|
|
179
|
+
const files = this.#files === null
|
|
180
|
+
? "waiting for inventory"
|
|
181
|
+
: `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed`;
|
|
182
|
+
const tokens = this.#cost === null
|
|
183
|
+
? "waiting for usage"
|
|
184
|
+
: `${formatCount(this.#cost.inputTokens)} in · ${formatCount(this.#cost.cachedInputTokens)} cached · ${formatCount(this.#cost.outputTokens)} out`;
|
|
185
|
+
const cost = this.#cost === null
|
|
186
|
+
? this.#options.maxCostUsd === undefined
|
|
187
|
+
? "waiting for usage"
|
|
188
|
+
: `— / ${formatUsd(this.#options.maxCostUsd)}`
|
|
189
|
+
: `${formatUsd(this.#cost.estimatedUsd)}${this.#options.maxCostUsd === undefined ? "" : ` / ${formatUsd(this.#options.maxCostUsd)} · ${budgetBar(this.#cost.estimatedUsd, this.#options.maxCostUsd)}`}`;
|
|
190
|
+
const history = this.#activityLines(width);
|
|
191
|
+
const maximumOffset = Math.max(0, history.length - activityRows);
|
|
192
|
+
this.#scrollOffset = Math.min(this.#scrollOffset, maximumOffset);
|
|
193
|
+
const first = Math.max(0, history.length - activityRows - this.#scrollOffset);
|
|
194
|
+
const activity = history.slice(first, first + activityRows);
|
|
195
|
+
if (activity.length === 0) {
|
|
196
|
+
activity.push({
|
|
197
|
+
text: ` [${formatLocalTime(this.#options.clock.now())}] · Waiting for scan activity…`,
|
|
198
|
+
kind: "path",
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
while (activity.length < activityRows) {
|
|
202
|
+
activity.push({ text: "", kind: "path" });
|
|
203
|
+
}
|
|
204
|
+
const scrollStatus = this.#scrollOffset === 0
|
|
205
|
+
? "Ctrl+C to exit"
|
|
206
|
+
: `${formatCount(this.#scrollOffset)} ${this.#scrollOffset === 1 ? "line" : "lines"} above live · Ctrl+C to exit`;
|
|
207
|
+
const model = this.#options.model;
|
|
208
|
+
const lines = [
|
|
209
|
+
` CODEX SECURITY · ${basename(this.#options.repository)}${model === undefined ? "" : ` · ${model.model} (${model.reasoningEffort})`}`,
|
|
210
|
+
divider,
|
|
211
|
+
...activity,
|
|
212
|
+
divider,
|
|
213
|
+
` STAGE ${this.#stage}`,
|
|
214
|
+
` FILES ${files}`,
|
|
215
|
+
` TOKENS ${tokens}`,
|
|
216
|
+
` COST ${cost}`,
|
|
217
|
+
` TIME ${time} · ${scrollStatus}`,
|
|
218
|
+
];
|
|
219
|
+
this.#stream.write(CURSOR_HOME +
|
|
220
|
+
lines
|
|
221
|
+
.map((line, index) => {
|
|
222
|
+
const text = typeof line === "string" ? line : line.text;
|
|
223
|
+
const clean = fitLine(this.#options.sanitize?.(text) ?? text, width);
|
|
224
|
+
const colored = this.#options.color === true
|
|
225
|
+
? styleLine(clean, typeof line === "string"
|
|
226
|
+
? index === 0
|
|
227
|
+
? "title"
|
|
228
|
+
: undefined
|
|
229
|
+
: line.kind)
|
|
230
|
+
: clean;
|
|
231
|
+
const formatted = typeof line === "string"
|
|
232
|
+
? colored
|
|
233
|
+
: linkActivity(this.#options.color === true
|
|
234
|
+
? styleInlineCode(colored, line.code, line.kind)
|
|
235
|
+
: colored, line.links, this.#options.sanitize);
|
|
236
|
+
return `${ERASE_LINE}${formatted}`;
|
|
237
|
+
})
|
|
238
|
+
.join("\n"));
|
|
239
|
+
}
|
|
240
|
+
#width() {
|
|
241
|
+
return Math.max(1, Math.min(this.#stream.columns ?? 88, 160));
|
|
242
|
+
}
|
|
243
|
+
#activityRows() {
|
|
244
|
+
return Math.max(1, (this.#stream.rows ?? 24) - FIXED_SCREEN_ROWS);
|
|
245
|
+
}
|
|
246
|
+
#activityLines(width) {
|
|
247
|
+
const elapsed = Math.max(0, Math.floor((this.#options.clock.now() - this.#startedAt) / 1_000));
|
|
248
|
+
const runningIcon = ["◐", "◓", "◑", "◒"][elapsed % 4];
|
|
249
|
+
const lines = [];
|
|
250
|
+
const append = (prefix, value, kind) => {
|
|
251
|
+
if (kind !== "message" && kind !== "reasoning") {
|
|
252
|
+
for (const text of wrapActivity(prefix, value, width)) {
|
|
253
|
+
lines.push({ text, kind });
|
|
254
|
+
}
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const continuation = " ".repeat(prefix.length);
|
|
258
|
+
let started = false;
|
|
259
|
+
let fenced = false;
|
|
260
|
+
for (const source of value.split(/\r?\n/u)) {
|
|
261
|
+
if (/^\s*```/u.test(source)) {
|
|
262
|
+
fenced = !fenced;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
const links = [];
|
|
266
|
+
const code = [];
|
|
267
|
+
const description = fenced
|
|
268
|
+
? source
|
|
269
|
+
: source.replaceAll(/`([^`\r\n]+)`|\[([^\]\r\n]+)\]\(([^)\r\n]+)\)/gu, (_match, inline, label, target) => {
|
|
270
|
+
if (inline !== undefined) {
|
|
271
|
+
code.push(inline);
|
|
272
|
+
return inline;
|
|
273
|
+
}
|
|
274
|
+
links.push({ label, target });
|
|
275
|
+
return label;
|
|
276
|
+
});
|
|
277
|
+
const wrapped = fenced
|
|
278
|
+
? wrapCode(started ? continuation : prefix, description, width)
|
|
279
|
+
: wrapActivity(started ? continuation : prefix, description, width);
|
|
280
|
+
for (const text of wrapped) {
|
|
281
|
+
lines.push({ text, kind: fenced ? "code" : kind, links, code });
|
|
282
|
+
started = true;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
for (const entry of this.#activities) {
|
|
287
|
+
const kind = entry.id.startsWith("scan-note-")
|
|
288
|
+
? /\b(?:warning|unavailable|interrupted|retrying)\b|could not be confirmed|capacity changed/iu.test(entry.description)
|
|
289
|
+
? "warning"
|
|
290
|
+
: "status"
|
|
291
|
+
: entry.kind;
|
|
292
|
+
const icon = entry.status === "failed"
|
|
293
|
+
? "×"
|
|
294
|
+
: entry.status === "running"
|
|
295
|
+
? runningIcon
|
|
296
|
+
: ACTIVITY_MARKERS[kind];
|
|
297
|
+
const timestamp = `[${formatLocalTime(entry.recordedAt)}]`;
|
|
298
|
+
const worker = entry.worker === undefined ? "" : `worker ${entry.worker} · `;
|
|
299
|
+
const prefix = ` ${timestamp} ${icon} `;
|
|
300
|
+
append(prefix, `${worker}${entry.description}`, kind);
|
|
301
|
+
for (const path of entry.paths) {
|
|
302
|
+
append(" ".repeat(prefix.length), path, "path");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return lines;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function styleInlineCode(value, code, kind) {
|
|
309
|
+
for (const text of code ?? []) {
|
|
310
|
+
value = value.replace(text, `\u001B[2m${text}\u001B[22m${kind === "message" ? "\u001B[1m" : ""}`);
|
|
311
|
+
}
|
|
312
|
+
return value;
|
|
313
|
+
}
|
|
314
|
+
function linkActivity(value, links, sanitize) {
|
|
315
|
+
for (const { label, target } of links ?? []) {
|
|
316
|
+
const safe = safeHyperlinkTarget(sanitize?.(target) ?? target);
|
|
317
|
+
if (safe !== undefined) {
|
|
318
|
+
value = value.replace(label, `\u001B]8;;${safe}\u0007${label}\u001B]8;;\u0007`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return value;
|
|
322
|
+
}
|
|
323
|
+
function safeHyperlinkTarget(value) {
|
|
324
|
+
if (/[\u0000-\u001F\u007F]/u.test(value))
|
|
325
|
+
return undefined;
|
|
326
|
+
if (isAbsolute(value))
|
|
327
|
+
return pathToFileURL(value).href;
|
|
328
|
+
if (!URL.canParse(value))
|
|
329
|
+
return undefined;
|
|
330
|
+
const url = new URL(value);
|
|
331
|
+
return url.protocol === "https:" || url.protocol === "http:"
|
|
332
|
+
? url.href
|
|
333
|
+
: undefined;
|
|
334
|
+
}
|
|
335
|
+
function isFileInventory(activity) {
|
|
336
|
+
return (activity.kind === "command" &&
|
|
337
|
+
activity.paths.length === 0 &&
|
|
338
|
+
/\brg\s+--files\b|\bgit\s+ls-files\b/u.test(activity.description));
|
|
339
|
+
}
|
|
340
|
+
function formatElapsed(seconds) {
|
|
341
|
+
return `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
342
|
+
}
|
|
343
|
+
function formatLocalTime(timestamp) {
|
|
344
|
+
const date = new Date(timestamp);
|
|
345
|
+
return [date.getHours(), date.getMinutes(), date.getSeconds()]
|
|
346
|
+
.map((part) => String(part).padStart(2, "0"))
|
|
347
|
+
.join(":");
|
|
348
|
+
}
|
|
349
|
+
function wrapActivity(prefix, value, width) {
|
|
350
|
+
const available = Math.max(1, width - prefix.length);
|
|
351
|
+
const continuation = " ".repeat(prefix.length);
|
|
352
|
+
const lines = [];
|
|
353
|
+
const append = (text) => {
|
|
354
|
+
lines.push(`${lines.length === 0 ? prefix : continuation}${text}`);
|
|
355
|
+
};
|
|
356
|
+
let current = "";
|
|
357
|
+
let separator = "";
|
|
358
|
+
for (const word of value.split(/(\s+)/u)) {
|
|
359
|
+
if (/^\s+$/u.test(word)) {
|
|
360
|
+
separator = word;
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
const characters = Array.from(word);
|
|
364
|
+
if (characters.length > available) {
|
|
365
|
+
if (current !== "") {
|
|
366
|
+
append(current);
|
|
367
|
+
current = "";
|
|
368
|
+
}
|
|
369
|
+
for (let start = 0; start < characters.length; start += available) {
|
|
370
|
+
const part = characters.slice(start, start + available).join("");
|
|
371
|
+
if (start + available < characters.length) {
|
|
372
|
+
append(part);
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
current = part;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
else if (current !== "" &&
|
|
380
|
+
Array.from(current).length +
|
|
381
|
+
Array.from(separator).length +
|
|
382
|
+
characters.length >
|
|
383
|
+
available) {
|
|
384
|
+
append(current);
|
|
385
|
+
current = word;
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
current = current === "" ? word : `${current}${separator}${word}`;
|
|
389
|
+
}
|
|
390
|
+
separator = "";
|
|
391
|
+
}
|
|
392
|
+
if (current !== "")
|
|
393
|
+
append(current);
|
|
394
|
+
return lines;
|
|
395
|
+
}
|
|
396
|
+
function wrapCode(prefix, value, width) {
|
|
397
|
+
const characters = Array.from(value);
|
|
398
|
+
const available = Math.max(1, width - prefix.length);
|
|
399
|
+
return Array.from({ length: Math.max(1, Math.ceil(characters.length / available)) }, (_, index) => `${index === 0 ? prefix : " ".repeat(prefix.length)}${characters
|
|
400
|
+
.slice(index * available, (index + 1) * available)
|
|
401
|
+
.join("")}`);
|
|
402
|
+
}
|
|
403
|
+
function styleLine(value, kind) {
|
|
404
|
+
if (kind === undefined)
|
|
405
|
+
return value;
|
|
406
|
+
const style = LINE_STYLES[kind];
|
|
407
|
+
if (kind === "message" ||
|
|
408
|
+
kind === "reasoning" ||
|
|
409
|
+
kind === "tool" ||
|
|
410
|
+
kind === "status" ||
|
|
411
|
+
kind === "warning") {
|
|
412
|
+
const activity = value.match(/^(\s*)(\[\d{2}:\d{2}:\d{2}\])(\s+)(\S+)(\s+)(worker \d+ · )?(.*)$/u);
|
|
413
|
+
if (activity === null) {
|
|
414
|
+
return kind === "message" || kind === "status" || kind === "warning"
|
|
415
|
+
? `\u001B[${kind === "message" ? "1" : style}m${value}\u001B[0m`
|
|
416
|
+
: value;
|
|
417
|
+
}
|
|
418
|
+
const [, padding, timestamp, gap, marker, separator, worker, description] = activity;
|
|
419
|
+
const prefix = `${padding}\u001B[2m${timestamp}\u001B[22m${gap}`;
|
|
420
|
+
if (kind === "status" || kind === "warning") {
|
|
421
|
+
return `${prefix}\u001B[${style}m${marker}${separator}${description}\u001B[0m`;
|
|
422
|
+
}
|
|
423
|
+
const workerLabel = worker === undefined ? "" : `\u001B[36m${worker}\u001B[39m`;
|
|
424
|
+
const prose = kind === "message" ? `\u001B[1m${description}\u001B[22m` : description;
|
|
425
|
+
return `${prefix}\u001B[${style}m${marker}\u001B[39m${separator}${workerLabel}${prose}`;
|
|
426
|
+
}
|
|
427
|
+
return `\u001B[${style}m${value}\u001B[0m`;
|
|
428
|
+
}
|
|
429
|
+
function formatCount(value) {
|
|
430
|
+
return value.toLocaleString("en-US");
|
|
431
|
+
}
|
|
432
|
+
function budgetBar(cost, limit) {
|
|
433
|
+
const proportion = Math.min(1, Math.max(0, cost / limit));
|
|
434
|
+
const filled = Math.round(proportion * 12);
|
|
435
|
+
return `[${"█".repeat(filled)}${"░".repeat(12 - filled)}] ${Math.round(proportion * 100)}%`;
|
|
436
|
+
}
|
|
437
|
+
function fitLine(value, width) {
|
|
438
|
+
const clean = stripVTControlCharacters(value).replaceAll(/[\u0000-\u001F\u007F]/gu, " ");
|
|
439
|
+
const characters = Array.from(clean);
|
|
440
|
+
return characters.length <= width
|
|
441
|
+
? clean
|
|
442
|
+
: `${characters.slice(0, Math.max(0, width - 1)).join("")}…`;
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=scan-dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-dashboard.js","sourceRoot":"","sources":["../src/scan-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EA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acters } from \"node:util\";\nimport type { ScanModelConfiguration } from \"./config.js\";\nimport { formatUsd, type ScanCost } from \"./cost.js\";\nimport type { ScanActivity } from \"./scan-activity.js\";\nimport type { ScanProgress } from \"./worker-progress.js\";\n\nconst HIDE_CURSOR = \"\\u001B[?25l\";\nconst SHOW_CURSOR = \"\\u001B[?25h\";\nconst ENTER_ALTERNATE_SCREEN = \"\\u001B[?1049h\";\nconst EXIT_ALTERNATE_SCREEN = \"\\u001B[?1049l\";\nconst ENABLE_ALTERNATE_SCROLL = \"\\u001B[?1007h\";\nconst DISABLE_ALTERNATE_SCROLL = \"\\u001B[?1007l\";\nconst CURSOR_HOME = \"\\u001B[H\";\nconst ERASE_LINE = \"\\u001B[2K\";\nconst MAX_HISTORY_ENTRIES = 2_000;\nconst FIXED_SCREEN_ROWS = 8;\n\ninterface DashboardStream {\n write(chunk: string): unknown;\n readonly columns?: number;\n readonly rows?: number;\n}\n\ninterface DashboardClock {\n now(): number;\n setInterval(callback: () => void, milliseconds: number): NodeJS.Timeout;\n clearInterval(timer: NodeJS.Timeout): void;\n}\n\ninterface DashboardInput {\n readonly isTTY?: boolean;\n readonly isRaw?: boolean;\n setRawMode?(mode: boolean): unknown;\n on(event: \"data\", listener: (chunk: string | Uint8Array) => void): unknown;\n off(event: \"data\", listener: (chunk: string | Uint8Array) => void): unknown;\n resume?(): unknown;\n pause?(): unknown;\n}\n\ninterface ScanDashboardOptions {\n repository: string;\n model?: ScanModelConfiguration;\n maxCostUsd?: number;\n clock: DashboardClock;\n color?: boolean;\n sanitize?: (value: string) => string;\n input?: DashboardInput;\n onInterrupt?: () => void;\n}\n\ninterface TimedScanActivity extends ScanActivity {\n recordedAt: number;\n}\n\ntype DashboardActivityKind = ScanActivity[\"kind\"] | \"status\" | \"warning\";\n\ninterface DashboardActivityLine {\n text: string;\n kind: DashboardActivityKind | \"path\" | \"code\";\n links?: readonly DashboardActivityLink[];\n code?: readonly string[];\n}\n\ninterface DashboardActivityLink {\n label: string;\n target: string;\n}\n\nconst ACTIVITY_MARKERS: Record<DashboardActivityKind, string> = {\n command: \"✓\",\n tool: \"✓\",\n message: \"●\",\n reasoning: \"◦\",\n status: \"◆\",\n warning: \"▲\",\n};\n\nconst LINE_STYLES: Record<DashboardActivityLine[\"kind\"] | \"title\", string> = {\n title: \"1\",\n message: \"36\",\n reasoning: \"35\",\n tool: \"36\",\n command: \"2\",\n path: \"2\",\n code: \"2\",\n status: \"32\",\n warning: \"33\",\n};\n\nexport class ScanDashboard {\n readonly #stream: DashboardStream;\n readonly #options: ScanDashboardOptions;\n readonly #startedAt: number;\n readonly #activities: TimedScanActivity[] = [];\n #stage = \"Preparing scan\";\n #files: ScanProgress | null = null;\n #cost: Readonly<ScanCost> | null = null;\n #timer: NodeJS.Timeout | null = null;\n #scrollOffset = 0;\n #inputWasRaw = false;\n #noteCount = 0;\n readonly #onInput = (chunk: string | Uint8Array): void => {\n const input =\n typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(\"utf8\");\n let lines = 0;\n for (const key of input.match(\n /[\\u0003\\u0004\\u0015]|\\u001B\\[(?:[ABHF]|[1456]~)/gu,\n ) ?? []) {\n if (key === \"\\u0003\") {\n if (lines !== 0) this.scroll(lines);\n this.#options.onInterrupt?.();\n lines = 0;\n } else if (key === \"\\u001B[A\") {\n lines += 1;\n } else if (key === \"\\u001B[B\") {\n lines -= 1;\n } else if (key === \"\\u0015\") {\n lines += Math.max(1, Math.floor(this.#activityRows() / 2));\n } else if (key === \"\\u0004\") {\n lines -= Math.max(1, Math.floor(this.#activityRows() / 2));\n } else if (key === \"\\u001B[5~\") {\n lines += this.#activityRows();\n } else if (key === \"\\u001B[6~\") {\n lines -= this.#activityRows();\n } else {\n if (lines !== 0) this.scroll(lines);\n this.scroll(\n key === \"\\u001B[H\" || key === \"\\u001B[1~\"\n ? Number.MAX_SAFE_INTEGER\n : -Number.MAX_SAFE_INTEGER,\n );\n lines = 0;\n }\n }\n if (lines !== 0) this.scroll(lines);\n };\n\n public constructor(stream: DashboardStream, options: ScanDashboardOptions) {\n this.#stream = stream;\n this.#options = options;\n this.#startedAt = options.clock.now();\n }\n\n public start(): void {\n if (this.#timer !== null) return;\n this.#stream.write(`${ENTER_ALTERNATE_SCREEN}${HIDE_CURSOR}`);\n const input = this.#options.input;\n if (input?.isTTY === true) {\n this.#inputWasRaw = input.isRaw === true;\n input.setRawMode?.(true);\n input.resume?.();\n input.on(\"data\", this.#onInput);\n this.#stream.write(ENABLE_ALTERNATE_SCROLL);\n }\n this.#render();\n this.#timer = this.#options.clock.setInterval(() => this.#render(), 1_000);\n }\n\n public stop(): void {\n if (this.#timer === null) return;\n this.#options.clock.clearInterval(this.#timer);\n this.#timer = null;\n const input = this.#options.input;\n if (input?.isTTY === true) {\n input.off(\"data\", this.#onInput);\n input.setRawMode?.(this.#inputWasRaw);\n input.pause?.();\n }\n this.#stream.write(\n `${input?.isTTY === true ? DISABLE_ALTERNATE_SCROLL : \"\"}${SHOW_CURSOR}${EXIT_ALTERNATE_SCREEN}`,\n );\n }\n\n public setStage(stage: string): void {\n this.#stage = stage;\n this.#refresh();\n }\n\n public setFiles(files: ScanProgress): void {\n this.#files = files;\n this.#refresh();\n }\n\n public setCost(cost: Readonly<ScanCost>): void {\n this.#cost = cost;\n this.#refresh();\n }\n\n public note(description: string): void {\n this.record({\n id: `scan-note-${++this.#noteCount}`,\n kind: \"command\",\n status: \"completed\",\n description,\n paths: [],\n });\n }\n\n public record(activity: ScanActivity): void {\n const existing = this.#activities.findIndex(\n (entry) =>\n entry.id === activity.id ||\n (entry.worker === activity.worker &&\n isFileInventory(entry) &&\n isFileInventory(activity)),\n );\n const previousRows =\n this.#scrollOffset === 0 ? 0 : this.#activityLines(this.#width()).length;\n const recordedAt =\n existing < 0\n ? this.#options.clock.now()\n : this.#activities[existing]!.recordedAt;\n const entry = { ...activity, recordedAt };\n if (existing < 0) {\n this.#activities.push(entry);\n } else {\n this.#activities[existing] = entry;\n }\n if (this.#activities.length > MAX_HISTORY_ENTRIES) {\n this.#activities.splice(0, this.#activities.length - MAX_HISTORY_ENTRIES);\n }\n if (this.#scrollOffset !== 0) {\n this.#scrollOffset += Math.max(\n 0,\n this.#activityLines(this.#width()).length - previousRows,\n );\n }\n this.#refresh();\n }\n\n public scroll(lines: number): void {\n const maximum = Math.max(\n 0,\n this.#activityLines(this.#width()).length - this.#activityRows(),\n );\n this.#scrollOffset = Math.max(\n 0,\n Math.min(maximum, this.#scrollOffset + lines),\n );\n this.#refresh();\n }\n\n #refresh(): void {\n if (this.#timer !== null) this.#render();\n }\n\n #render(): void {\n const width = this.#width();\n const activityRows = this.#activityRows();\n const divider = ` ${\"─\".repeat(Math.max(0, width - 4))}`;\n const elapsed = Math.max(\n 0,\n Math.floor((this.#options.clock.now() - this.#startedAt) / 1_000),\n );\n const time = formatElapsed(elapsed);\n const files =\n this.#files === null\n ? \"waiting for inventory\"\n : `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed`;\n const tokens =\n this.#cost === null\n ? \"waiting for usage\"\n : `${formatCount(this.#cost.inputTokens)} in · ${formatCount(this.#cost.cachedInputTokens)} cached · ${formatCount(this.#cost.outputTokens)} out`;\n const cost =\n this.#cost === null\n ? this.#options.maxCostUsd === undefined\n ? \"waiting for usage\"\n : `— / ${formatUsd(this.#options.maxCostUsd)}`\n : `${formatUsd(this.#cost.estimatedUsd)}${this.#options.maxCostUsd === undefined ? \"\" : ` / ${formatUsd(this.#options.maxCostUsd)} · ${budgetBar(this.#cost.estimatedUsd, this.#options.maxCostUsd)}`}`;\n\n const history = this.#activityLines(width);\n const maximumOffset = Math.max(0, history.length - activityRows);\n this.#scrollOffset = Math.min(this.#scrollOffset, maximumOffset);\n const first = Math.max(\n 0,\n history.length - activityRows - this.#scrollOffset,\n );\n const activity = history.slice(first, first + activityRows);\n if (activity.length === 0) {\n activity.push({\n text: ` [${formatLocalTime(this.#options.clock.now())}] · Waiting for scan activity…`,\n kind: \"path\",\n });\n }\n while (activity.length < activityRows) {\n activity.push({ text: \"\", kind: \"path\" });\n }\n const scrollStatus =\n this.#scrollOffset === 0\n ? \"Ctrl+C to exit\"\n : `${formatCount(this.#scrollOffset)} ${this.#scrollOffset === 1 ? \"line\" : \"lines\"} above live · Ctrl+C to exit`;\n const model = this.#options.model;\n\n const lines = [\n ` CODEX SECURITY · ${basename(this.#options.repository)}${model === undefined ? \"\" : ` · ${model.model} (${model.reasoningEffort})`}`,\n divider,\n ...activity,\n divider,\n ` STAGE ${this.#stage}`,\n ` FILES ${files}`,\n ` TOKENS ${tokens}`,\n ` COST ${cost}`,\n ` TIME ${time} · ${scrollStatus}`,\n ];\n\n this.#stream.write(\n CURSOR_HOME +\n lines\n .map((line, index) => {\n const text = typeof line === \"string\" ? line : line.text;\n const clean = fitLine(\n this.#options.sanitize?.(text) ?? text,\n width,\n );\n const colored =\n this.#options.color === true\n ? styleLine(\n clean,\n typeof line === \"string\"\n ? index === 0\n ? \"title\"\n : undefined\n : line.kind,\n )\n : clean;\n const formatted =\n typeof line === \"string\"\n ? colored\n : linkActivity(\n this.#options.color === true\n ? styleInlineCode(colored, line.code, line.kind)\n : colored,\n line.links,\n this.#options.sanitize,\n );\n return `${ERASE_LINE}${formatted}`;\n })\n .join(\"\\n\"),\n );\n }\n\n #width(): number {\n return Math.max(1, Math.min(this.#stream.columns ?? 88, 160));\n }\n\n #activityRows(): number {\n return Math.max(1, (this.#stream.rows ?? 24) - FIXED_SCREEN_ROWS);\n }\n\n #activityLines(width: number): DashboardActivityLine[] {\n const elapsed = Math.max(\n 0,\n Math.floor((this.#options.clock.now() - this.#startedAt) / 1_000),\n );\n const runningIcon = [\"◐\", \"◓\", \"◑\", \"◒\"][elapsed % 4];\n const lines: DashboardActivityLine[] = [];\n const append = (\n prefix: string,\n value: string,\n kind: DashboardActivityLine[\"kind\"],\n ): void => {\n if (kind !== \"message\" && kind !== \"reasoning\") {\n for (const text of wrapActivity(prefix, value, width)) {\n lines.push({ text, kind });\n }\n return;\n }\n\n const continuation = \" \".repeat(prefix.length);\n let started = false;\n let fenced = false;\n for (const source of value.split(/\\r?\\n/u)) {\n if (/^\\s*```/u.test(source)) {\n fenced = !fenced;\n continue;\n }\n const links: DashboardActivityLink[] = [];\n const code: string[] = [];\n const description = fenced\n ? source\n : source.replaceAll(\n /`([^`\\r\\n]+)`|\\[([^\\]\\r\\n]+)\\]\\(([^)\\r\\n]+)\\)/gu,\n (\n _match: string,\n inline: string,\n label: string,\n target: string,\n ) => {\n if (inline !== undefined) {\n code.push(inline);\n return inline;\n }\n links.push({ label, target });\n return label;\n },\n );\n const wrapped = fenced\n ? wrapCode(started ? continuation : prefix, description, width)\n : wrapActivity(started ? continuation : prefix, description, width);\n for (const text of wrapped) {\n lines.push({ text, kind: fenced ? \"code\" : kind, links, code });\n started = true;\n }\n }\n };\n for (const entry of this.#activities) {\n const kind: DashboardActivityKind = entry.id.startsWith(\"scan-note-\")\n ? /\\b(?:warning|unavailable|interrupted|retrying)\\b|could not be confirmed|capacity changed/iu.test(\n entry.description,\n )\n ? \"warning\"\n : \"status\"\n : entry.kind;\n const icon =\n entry.status === \"failed\"\n ? \"×\"\n : entry.status === \"running\"\n ? runningIcon\n : ACTIVITY_MARKERS[kind];\n const timestamp = `[${formatLocalTime(entry.recordedAt)}]`;\n const worker =\n entry.worker === undefined ? \"\" : `worker ${entry.worker} · `;\n const prefix = ` ${timestamp} ${icon} `;\n append(prefix, `${worker}${entry.description}`, kind);\n for (const path of entry.paths) {\n append(\" \".repeat(prefix.length), path, \"path\");\n }\n }\n return lines;\n }\n}\n\nfunction styleInlineCode(\n value: string,\n code: readonly string[] | undefined,\n kind: DashboardActivityLine[\"kind\"],\n): string {\n for (const text of code ?? []) {\n value = value.replace(\n text,\n `\\u001B[2m${text}\\u001B[22m${kind === \"message\" ? \"\\u001B[1m\" : \"\"}`,\n );\n }\n return value;\n}\n\nfunction linkActivity(\n value: string,\n links: readonly DashboardActivityLink[] | undefined,\n sanitize: ((value: string) => string) | undefined,\n): string {\n for (const { label, target } of links ?? []) {\n const safe = safeHyperlinkTarget(sanitize?.(target) ?? target);\n if (safe !== undefined) {\n value = value.replace(\n label,\n `\\u001B]8;;${safe}\\u0007${label}\\u001B]8;;\\u0007`,\n );\n }\n }\n return value;\n}\n\nfunction safeHyperlinkTarget(value: string): string | undefined {\n if (/[\\u0000-\\u001F\\u007F]/u.test(value)) return undefined;\n if (isAbsolute(value)) return pathToFileURL(value).href;\n if (!URL.canParse(value)) return undefined;\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\"\n ? url.href\n : undefined;\n}\n\nfunction isFileInventory(activity: ScanActivity): boolean {\n return (\n activity.kind === \"command\" &&\n activity.paths.length === 0 &&\n /\\brg\\s+--files\\b|\\bgit\\s+ls-files\\b/u.test(activity.description)\n );\n}\n\nfunction formatElapsed(seconds: number): string {\n return `${String(Math.floor(seconds / 60)).padStart(2, \"0\")}:${String(seconds % 60).padStart(2, \"0\")}`;\n}\n\nfunction formatLocalTime(timestamp: number): string {\n const date = new Date(timestamp);\n return [date.getHours(), date.getMinutes(), date.getSeconds()]\n .map((part) => String(part).padStart(2, \"0\"))\n .join(\":\");\n}\n\nfunction wrapActivity(prefix: string, value: string, width: number): string[] {\n const available = Math.max(1, width - prefix.length);\n const continuation = \" \".repeat(prefix.length);\n const lines: string[] = [];\n const append = (text: string): void => {\n lines.push(`${lines.length === 0 ? prefix : continuation}${text}`);\n };\n let current = \"\";\n let separator = \"\";\n for (const word of value.split(/(\\s+)/u)) {\n if (/^\\s+$/u.test(word)) {\n separator = word;\n continue;\n }\n const characters = Array.from(word);\n if (characters.length > available) {\n if (current !== \"\") {\n append(current);\n current = \"\";\n }\n for (let start = 0; start < characters.length; start += available) {\n const part = characters.slice(start, start + available).join(\"\");\n if (start + available < characters.length) {\n append(part);\n } else {\n current = part;\n }\n }\n } else if (\n current !== \"\" &&\n Array.from(current).length +\n Array.from(separator).length +\n characters.length >\n available\n ) {\n append(current);\n current = word;\n } else {\n current = current === \"\" ? word : `${current}${separator}${word}`;\n }\n separator = \"\";\n }\n if (current !== \"\") append(current);\n return lines;\n}\n\nfunction wrapCode(prefix: string, value: string, width: number): string[] {\n const characters = Array.from(value);\n const available = Math.max(1, width - prefix.length);\n return Array.from(\n { length: Math.max(1, Math.ceil(characters.length / available)) },\n (_, index) =>\n `${index === 0 ? prefix : \" \".repeat(prefix.length)}${characters\n .slice(index * available, (index + 1) * available)\n .join(\"\")}`,\n );\n}\n\nfunction styleLine(\n value: string,\n kind: DashboardActivityLine[\"kind\"] | \"title\" | undefined,\n): string {\n if (kind === undefined) return value;\n const style = LINE_STYLES[kind];\n if (\n kind === \"message\" ||\n kind === \"reasoning\" ||\n kind === \"tool\" ||\n kind === \"status\" ||\n kind === \"warning\"\n ) {\n const activity = value.match(\n /^(\\s*)(\\[\\d{2}:\\d{2}:\\d{2}\\])(\\s+)(\\S+)(\\s+)(worker \\d+ · )?(.*)$/u,\n );\n if (activity === null) {\n return kind === \"message\" || kind === \"status\" || kind === \"warning\"\n ? `\\u001B[${kind === \"message\" ? \"1\" : style}m${value}\\u001B[0m`\n : value;\n }\n const [, padding, timestamp, gap, marker, separator, worker, description] =\n activity;\n const prefix = `${padding}\\u001B[2m${timestamp}\\u001B[22m${gap}`;\n if (kind === \"status\" || kind === \"warning\") {\n return `${prefix}\\u001B[${style}m${marker}${separator}${description}\\u001B[0m`;\n }\n const workerLabel =\n worker === undefined ? \"\" : `\\u001B[36m${worker}\\u001B[39m`;\n const prose =\n kind === \"message\" ? `\\u001B[1m${description}\\u001B[22m` : description;\n return `${prefix}\\u001B[${style}m${marker}\\u001B[39m${separator}${workerLabel}${prose}`;\n }\n return `\\u001B[${style}m${value}\\u001B[0m`;\n}\n\nfunction formatCount(value: number): string {\n return value.toLocaleString(\"en-US\");\n}\n\nfunction budgetBar(cost: number, limit: number): string {\n const proportion = Math.min(1, Math.max(0, cost / limit));\n const filled = Math.round(proportion * 12);\n return `[${\"█\".repeat(filled)}${\"░\".repeat(12 - filled)}] ${Math.round(proportion * 100)}%`;\n}\n\nfunction fitLine(value: string, width: number): string {\n const clean = stripVTControlCharacters(value).replaceAll(\n /[\\u0000-\\u001F\\u007F]/gu,\n \" \",\n );\n const characters = Array.from(clean);\n return characters.length <= width\n ? clean\n : `${characters.slice(0, Math.max(0, width - 1)).join(\"\")}…`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-history-renderer.d.ts","sourceRoot":"","sources":["../src/scan-history-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AACvE,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAyCF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,eAAoB,GAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"scan-history-renderer.d.ts","sourceRoot":"","sources":["../src/scan-history-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AACvE,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAyCF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAgWR"}
|
|
@@ -180,7 +180,10 @@ export function renderScanHistory(result, command, options = {}) {
|
|
|
180
180
|
const config = recipe?.["config"];
|
|
181
181
|
if (config && Object.keys(config).length > 0) {
|
|
182
182
|
lines.push(` ${strong("CONFIGURATION")} ${Object.entries(config)
|
|
183
|
-
.map(([key, value]) =>
|
|
183
|
+
.map(([key, value]) => {
|
|
184
|
+
const rendered = typeof value === "object" ? JSON.stringify(value) : value;
|
|
185
|
+
return `${clean(key)}=${clean(rendered)}`;
|
|
186
|
+
})
|
|
184
187
|
.join(` ${accent("·")} `)}`);
|
|
185
188
|
}
|
|
186
189
|
const coverage = result["progress"]["coverage"];
|