@vertaaux/cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/MIGRATION.md +239 -0
- package/README.md +34 -16
- package/dist/app/interactive-app.d.ts +101 -0
- package/dist/app/interactive-app.d.ts.map +1 -0
- package/dist/app/interactive-app.js +309 -0
- package/dist/app/layout/canvas.d.ts +23 -0
- package/dist/app/layout/canvas.d.ts.map +1 -0
- package/dist/app/layout/canvas.js +36 -0
- package/dist/app/layout/footer.d.ts +31 -0
- package/dist/app/layout/footer.d.ts.map +1 -0
- package/dist/app/layout/footer.js +41 -0
- package/dist/app/layout/header.d.ts +20 -0
- package/dist/app/layout/header.d.ts.map +1 -0
- package/dist/app/layout/header.js +27 -0
- package/dist/app/menu/categories.d.ts +20 -0
- package/dist/app/menu/categories.d.ts.map +1 -0
- package/dist/app/menu/categories.js +181 -0
- package/dist/app/menu/filter.d.ts +17 -0
- package/dist/app/menu/filter.d.ts.map +1 -0
- package/dist/app/menu/filter.js +33 -0
- package/dist/app/menu/menu-view.d.ts +35 -0
- package/dist/app/menu/menu-view.d.ts.map +1 -0
- package/dist/app/menu/menu-view.js +230 -0
- package/dist/app/menu/recent.d.ts +24 -0
- package/dist/app/menu/recent.d.ts.map +1 -0
- package/dist/app/menu/recent.js +49 -0
- package/dist/app/types.d.ts +43 -0
- package/dist/app/types.d.ts.map +1 -0
- package/dist/app/types.js +7 -0
- package/dist/app/views/command-runner.d.ts +36 -0
- package/dist/app/views/command-runner.d.ts.map +1 -0
- package/dist/app/views/command-runner.js +372 -0
- package/dist/app/views/help-overlay.d.ts +21 -0
- package/dist/app/views/help-overlay.d.ts.map +1 -0
- package/dist/app/views/help-overlay.js +45 -0
- package/dist/auth/ci-token.d.ts +8 -2
- package/dist/auth/ci-token.d.ts.map +1 -1
- package/dist/auth/ci-token.js +15 -30
- package/dist/auth/device-flow.d.ts +2 -1
- package/dist/auth/device-flow.d.ts.map +1 -1
- package/dist/auth/device-flow.js +13 -10
- package/dist/auth/token-store.d.ts.map +1 -1
- package/dist/auth/token-store.js +12 -2
- package/dist/baseline/diff.d.ts +2 -2
- package/dist/baseline/diff.d.ts.map +1 -1
- package/dist/baseline/diff.js +15 -34
- package/dist/commands/a11y.d.ts +9 -0
- package/dist/commands/a11y.d.ts.map +1 -0
- package/dist/commands/a11y.js +76 -0
- package/dist/commands/audit/artifacts.d.ts +27 -0
- package/dist/commands/audit/artifacts.d.ts.map +1 -0
- package/dist/commands/audit/artifacts.js +158 -0
- package/dist/commands/audit/ci-detection.d.ts +18 -0
- package/dist/commands/audit/ci-detection.d.ts.map +1 -0
- package/dist/commands/audit/ci-detection.js +71 -0
- package/dist/commands/audit/explain.d.ts +11 -0
- package/dist/commands/audit/explain.d.ts.map +1 -0
- package/dist/commands/audit/explain.js +45 -0
- package/dist/commands/audit/filters.d.ts +17 -0
- package/dist/commands/audit/filters.d.ts.map +1 -0
- package/dist/commands/audit/filters.js +40 -0
- package/dist/commands/audit/index.d.ts +18 -0
- package/dist/commands/audit/index.d.ts.map +1 -0
- package/dist/commands/audit/index.js +564 -0
- package/dist/commands/audit/output.d.ts +32 -0
- package/dist/commands/audit/output.d.ts.map +1 -0
- package/dist/commands/audit/output.js +130 -0
- package/dist/commands/audit/policy.d.ts +19 -0
- package/dist/commands/audit/policy.d.ts.map +1 -0
- package/dist/commands/audit/policy.js +102 -0
- package/dist/commands/audit/scoring.d.ts +23 -0
- package/dist/commands/audit/scoring.d.ts.map +1 -0
- package/dist/commands/audit/scoring.js +70 -0
- package/dist/commands/audit/types.d.ts +88 -0
- package/dist/commands/audit/types.d.ts.map +1 -0
- package/dist/commands/audit/types.js +8 -0
- package/dist/commands/audit.d.ts +2 -60
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +2 -1097
- package/dist/commands/baseline.d.ts +1 -0
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +205 -121
- package/dist/commands/comment.d.ts +22 -0
- package/dist/commands/comment.d.ts.map +1 -1
- package/dist/commands/comment.js +122 -58
- package/dist/commands/compare.d.ts +17 -0
- package/dist/commands/compare.d.ts.map +1 -1
- package/dist/commands/compare.js +287 -180
- package/dist/commands/diff.d.ts +5 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +168 -141
- package/dist/commands/doc.d.ts +10 -0
- package/dist/commands/doc.d.ts.map +1 -1
- package/dist/commands/doc.js +134 -76
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +164 -17
- package/dist/commands/download.d.ts +10 -0
- package/dist/commands/download.d.ts.map +1 -1
- package/dist/commands/download.js +169 -112
- package/dist/commands/explain.d.ts +5 -0
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +241 -155
- package/dist/commands/fix-all.d.ts +25 -0
- package/dist/commands/fix-all.d.ts.map +1 -0
- package/dist/commands/fix-all.js +206 -0
- package/dist/commands/fix-plan.d.ts +9 -0
- package/dist/commands/fix-plan.d.ts.map +1 -1
- package/dist/commands/fix-plan.js +152 -89
- package/dist/commands/fix.d.ts +17 -0
- package/dist/commands/fix.d.ts.map +1 -0
- package/dist/commands/fix.js +111 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +94 -42
- package/dist/commands/login.d.ts +18 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +263 -92
- package/dist/commands/patch-review.d.ts +11 -0
- package/dist/commands/patch-review.d.ts.map +1 -1
- package/dist/commands/patch-review.js +159 -97
- package/dist/commands/policy.d.ts +31 -0
- package/dist/commands/policy.d.ts.map +1 -1
- package/dist/commands/policy.js +269 -124
- package/dist/commands/release-notes.d.ts +10 -0
- package/dist/commands/release-notes.d.ts.map +1 -1
- package/dist/commands/release-notes.js +127 -73
- package/dist/commands/scan.d.ts +13 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +133 -0
- package/dist/commands/status.d.ts +9 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +81 -0
- package/dist/commands/suggest.d.ts +10 -0
- package/dist/commands/suggest.d.ts.map +1 -1
- package/dist/commands/suggest.js +153 -82
- package/dist/commands/triage.d.ts +35 -0
- package/dist/commands/triage.d.ts.map +1 -1
- package/dist/commands/triage.js +206 -81
- package/dist/commands/upload.d.ts +9 -0
- package/dist/commands/upload.d.ts.map +1 -1
- package/dist/commands/upload.js +140 -101
- package/dist/commands/verify.d.ts +13 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +118 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +125 -990
- package/dist/interactive/fix-wizard.d.ts +3 -0
- package/dist/interactive/fix-wizard.d.ts.map +1 -1
- package/dist/interactive/fix-wizard.js +130 -112
- package/dist/interactive/init-wizard.d.ts +3 -1
- package/dist/interactive/init-wizard.d.ts.map +1 -1
- package/dist/interactive/init-wizard.js +207 -138
- package/dist/interactive/prompts.d.ts +7 -3
- package/dist/interactive/prompts.d.ts.map +1 -1
- package/dist/interactive/prompts.js +44 -23
- package/dist/output/envelope.d.ts +2 -0
- package/dist/output/envelope.d.ts.map +1 -1
- package/dist/output/envelope.js +18 -2
- package/dist/output/factory.d.ts +2 -1
- package/dist/output/factory.d.ts.map +1 -1
- package/dist/output/html.d.ts +2 -1
- package/dist/output/html.d.ts.map +1 -1
- package/dist/output/html.js +3 -2
- package/dist/output/human.d.ts +2 -1
- package/dist/output/human.d.ts.map +1 -1
- package/dist/output/human.js +3 -2
- package/dist/output/json.d.ts +2 -1
- package/dist/output/json.d.ts.map +1 -1
- package/dist/output/junit.d.ts +2 -1
- package/dist/output/junit.d.ts.map +1 -1
- package/dist/output/sarif.d.ts +2 -1
- package/dist/output/sarif.d.ts.map +1 -1
- package/dist/types.d.ts +74 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/ui/banner.d.ts +34 -0
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +97 -5
- package/dist/ui/diagnostics.d.ts +9 -4
- package/dist/ui/diagnostics.d.ts.map +1 -1
- package/dist/ui/diagnostics.js +32 -82
- package/dist/ui/strings.d.ts +373 -0
- package/dist/ui/strings.d.ts.map +1 -0
- package/dist/ui/strings.js +499 -0
- package/dist/ui/table.d.ts +0 -2
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +3 -4
- package/dist/utils/api-client.d.ts +46 -0
- package/dist/utils/api-client.d.ts.map +1 -0
- package/dist/utils/api-client.js +170 -0
- package/dist/utils/client.d.ts +29 -18
- package/dist/utils/client.d.ts.map +1 -1
- package/dist/utils/client.js +102 -12
- package/dist/utils/formatters.d.ts +38 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +277 -0
- package/dist/utils/url-classify.d.ts.map +1 -1
- package/dist/utils/url-classify.js +24 -3
- package/node_modules/@vertaaux/tui/dist/index.cjs +713 -20
- package/node_modules/@vertaaux/tui/dist/index.cjs.map +1 -1
- package/node_modules/@vertaaux/tui/dist/index.d.cts +361 -4
- package/node_modules/@vertaaux/tui/dist/index.d.ts +361 -4
- package/node_modules/@vertaaux/tui/dist/index.js +689 -21
- package/node_modules/@vertaaux/tui/dist/index.js.map +1 -1
- package/package.json +13 -5
- package/dist/commands/client.d.ts +0 -14
- package/dist/commands/client.d.ts.map +0 -1
- package/dist/commands/client.js +0 -362
- package/dist/commands/drift.d.ts +0 -15
- package/dist/commands/drift.d.ts.map +0 -1
- package/dist/commands/drift.js +0 -309
- package/dist/commands/protect.d.ts +0 -16
- package/dist/commands/protect.d.ts.map +0 -1
- package/dist/commands/protect.js +0 -323
- package/dist/commands/report.d.ts +0 -15
- package/dist/commands/report.d.ts.map +0 -1
- package/dist/commands/report.js +0 -214
- package/dist/policy/sync.d.ts +0 -67
- package/dist/policy/sync.d.ts.map +0 -1
- package/dist/policy/sync.js +0 -147
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { type EvidenceIssue } from "../commands/explain.js";
|
|
14
14
|
import type { Issue } from "../baseline/hash.js";
|
|
15
15
|
import type { VertaauxConfig } from "../config/schema.js";
|
|
16
|
+
import type { Renderer } from "@vertaaux/tui";
|
|
16
17
|
/**
|
|
17
18
|
* Options for running the fix wizard.
|
|
18
19
|
*/
|
|
@@ -25,6 +26,8 @@ export interface FixWizardOptions {
|
|
|
25
26
|
base?: string;
|
|
26
27
|
/** Config for API key */
|
|
27
28
|
config?: VertaauxConfig;
|
|
29
|
+
/** Optional renderer to suspend/resume during prompts */
|
|
30
|
+
renderer?: Renderer;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Run the interactive fix wizard.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-wizard.d.ts","sourceRoot":"","sources":["../../src/interactive/fix-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"fix-wizard.d.ts","sourceRoot":"","sources":["../../src/interactive/fix-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAS1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAOjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqB9C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAoGD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,CAAC,KAAK,GAAG,aAAa,CAAC,EAAE,EACjC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA8Pf"}
|
|
@@ -11,30 +11,12 @@
|
|
|
11
11
|
* CLI-09: vertaa audit --interactive steps through fixes
|
|
12
12
|
*/
|
|
13
13
|
import { select, confirm, input } from "@inquirer/prompts";
|
|
14
|
-
import
|
|
14
|
+
import { severityColor, bold, dim, boldColor, colorize, tokens } from "@vertaaux/tui";
|
|
15
|
+
import { writeOutput } from "../output/envelope.js";
|
|
15
16
|
import { explainIssue } from "../commands/explain.js";
|
|
16
17
|
import { loadBaseline, saveBaseline, createBaseline, addToBaseline, DEFAULT_BASELINE_PATH, } from "../baseline/manager.js";
|
|
17
18
|
import { requireInteractive } from "./prompts.js";
|
|
18
19
|
import { resolveApiBase, getApiKey, apiRequest, } from "../utils/client.js";
|
|
19
|
-
/**
|
|
20
|
-
* Get severity display with color.
|
|
21
|
-
*/
|
|
22
|
-
function coloredSeverity(severity) {
|
|
23
|
-
const sev = (severity || "info").toLowerCase();
|
|
24
|
-
switch (sev) {
|
|
25
|
-
case "critical":
|
|
26
|
-
case "error":
|
|
27
|
-
return chalk.red.bold(sev.toUpperCase());
|
|
28
|
-
case "serious":
|
|
29
|
-
case "warning":
|
|
30
|
-
return chalk.yellow.bold(sev.toUpperCase());
|
|
31
|
-
case "moderate":
|
|
32
|
-
case "minor":
|
|
33
|
-
return chalk.cyan(sev.toUpperCase());
|
|
34
|
-
default:
|
|
35
|
-
return chalk.dim(sev.toUpperCase());
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
20
|
/**
|
|
39
21
|
* Get severity rank for sorting (higher = more severe).
|
|
40
22
|
*/
|
|
@@ -65,11 +47,11 @@ function getRuleId(issue) {
|
|
|
65
47
|
*/
|
|
66
48
|
function formatDiff(search, replace) {
|
|
67
49
|
const lines = [];
|
|
68
|
-
lines.push(
|
|
69
|
-
lines.push(
|
|
70
|
-
lines.push(
|
|
71
|
-
lines.push(
|
|
72
|
-
lines.push(
|
|
50
|
+
lines.push(dim("--- before"));
|
|
51
|
+
lines.push(dim("+++ after"));
|
|
52
|
+
lines.push(dim("@@ -1,1 +1,1 @@"));
|
|
53
|
+
lines.push(colorize(`-${search}`, tokens.error));
|
|
54
|
+
lines.push(colorize(`+${replace}`, tokens.success));
|
|
73
55
|
return lines.join("\n");
|
|
74
56
|
}
|
|
75
57
|
/**
|
|
@@ -77,15 +59,15 @@ function formatDiff(search, replace) {
|
|
|
77
59
|
*/
|
|
78
60
|
function displayIssueSummary(issue, index, total) {
|
|
79
61
|
const ruleId = getRuleId(issue);
|
|
80
|
-
const severity =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
const severity = severityColor(issue.severity);
|
|
63
|
+
writeOutput("\n");
|
|
64
|
+
writeOutput(bold(`[${index + 1}/${total}] ${severity}: ${ruleId}`) + "\n");
|
|
65
|
+
writeOutput((issue.description || issue.title || "No description") + "\n");
|
|
66
|
+
writeOutput(dim(`Selector: ${issue.selector || "N/A"}`) + "\n");
|
|
85
67
|
if (issue.wcag_reference) {
|
|
86
|
-
|
|
68
|
+
writeOutput(dim(`WCAG: ${issue.wcag_reference}`) + "\n");
|
|
87
69
|
}
|
|
88
|
-
|
|
70
|
+
writeOutput("\n");
|
|
89
71
|
}
|
|
90
72
|
/**
|
|
91
73
|
* Fetch patch suggestion from API.
|
|
@@ -126,13 +108,14 @@ async function fetchPatchSuggestion(jobId, issueId, base, apiKey) {
|
|
|
126
108
|
export async function runFixWizard(issues, options) {
|
|
127
109
|
// Require interactive TTY
|
|
128
110
|
requireInteractive();
|
|
111
|
+
const { renderer } = options;
|
|
129
112
|
if (issues.length === 0) {
|
|
130
|
-
|
|
113
|
+
writeOutput(colorize("\nNo issues to review. Great job!", tokens.success) + "\n");
|
|
131
114
|
return;
|
|
132
115
|
}
|
|
133
116
|
// Sort issues by severity (critical first)
|
|
134
117
|
const sortedIssues = [...issues].sort((a, b) => severityRank(b.severity) - severityRank(a.severity));
|
|
135
|
-
|
|
118
|
+
writeOutput(bold(`\nFound ${sortedIssues.length} issues to review:\n`) + "\n");
|
|
136
119
|
// Load or create baseline
|
|
137
120
|
let baseline = await loadBaseline();
|
|
138
121
|
if (!baseline) {
|
|
@@ -156,88 +139,116 @@ export async function runFixWizard(issues, options) {
|
|
|
156
139
|
while (i < sortedIssues.length) {
|
|
157
140
|
const issue = sortedIssues[i];
|
|
158
141
|
displayIssueSummary(issue, i, sortedIssues.length);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
142
|
+
renderer?.suspend();
|
|
143
|
+
let action;
|
|
144
|
+
try {
|
|
145
|
+
action = await select({
|
|
146
|
+
message: "Action:",
|
|
147
|
+
choices: [
|
|
148
|
+
{
|
|
149
|
+
name: "Accept fix suggestion",
|
|
150
|
+
value: "accept",
|
|
151
|
+
description: "View and apply the suggested fix",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "Skip this issue",
|
|
155
|
+
value: "skip",
|
|
156
|
+
description: "Move to the next issue",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Explain in detail",
|
|
160
|
+
value: "explain",
|
|
161
|
+
description: "Show full evidence bundle",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "Add to baseline",
|
|
165
|
+
value: "baseline",
|
|
166
|
+
description: "Mark as accepted technical debt",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "Quit wizard",
|
|
170
|
+
value: "quit",
|
|
171
|
+
description: "Exit without processing remaining issues",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
}, { output: process.stderr });
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
renderer?.resume();
|
|
178
|
+
}
|
|
189
179
|
switch (action) {
|
|
190
180
|
case "accept": {
|
|
191
181
|
// Try to fetch and show patch suggestion
|
|
192
182
|
if (options.jobId && apiKey) {
|
|
193
|
-
|
|
183
|
+
writeOutput(dim("\nFetching fix suggestion...") + "\n");
|
|
194
184
|
const patch = await fetchPatchSuggestion(options.jobId, getRuleId(issue), base, apiKey);
|
|
195
185
|
if (patch) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
186
|
+
writeOutput("\n");
|
|
187
|
+
writeOutput(bold(`SUGGESTED FIX (Confidence: ${patch.confidence.label} ${patch.confidence.percentage}%)`) + "\n");
|
|
188
|
+
writeOutput("\n");
|
|
189
|
+
writeOutput(formatDiff(patch.search, patch.replace) + "\n");
|
|
190
|
+
writeOutput("\n");
|
|
201
191
|
if (patch.explanation) {
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
writeOutput(dim(patch.explanation) + "\n");
|
|
193
|
+
writeOutput("\n");
|
|
194
|
+
}
|
|
195
|
+
renderer?.suspend();
|
|
196
|
+
let applyFix;
|
|
197
|
+
try {
|
|
198
|
+
applyFix = await confirm({
|
|
199
|
+
message: "Apply this fix?",
|
|
200
|
+
default: true,
|
|
201
|
+
}, { output: process.stderr });
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
renderer?.resume();
|
|
204
205
|
}
|
|
205
|
-
const applyFix = await confirm({
|
|
206
|
-
message: "Apply this fix?",
|
|
207
|
-
default: true,
|
|
208
|
-
});
|
|
209
206
|
if (applyFix) {
|
|
210
207
|
// Note: Actual file modification is deferred to future version
|
|
211
|
-
|
|
208
|
+
writeOutput(colorize("Fix accepted (would apply in future version)", tokens.success) + "\n");
|
|
212
209
|
accepted++;
|
|
213
210
|
}
|
|
214
211
|
else {
|
|
215
|
-
|
|
212
|
+
writeOutput(dim("Fix declined, moving to next issue") + "\n");
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
else {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
216
|
+
writeOutput(colorize("\nNo fix suggestion available for this issue.", tokens.warning) + "\n");
|
|
217
|
+
renderer?.suspend();
|
|
218
|
+
let skipOrBaseline;
|
|
219
|
+
try {
|
|
220
|
+
skipOrBaseline = await select({
|
|
221
|
+
message: "What would you like to do?",
|
|
222
|
+
choices: [
|
|
223
|
+
{ name: "Skip to next issue", value: "skip" },
|
|
224
|
+
{ name: "Add to baseline", value: "baseline" },
|
|
225
|
+
],
|
|
226
|
+
}, { output: process.stderr });
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
renderer?.resume();
|
|
230
|
+
}
|
|
227
231
|
if (skipOrBaseline === "baseline") {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
renderer?.suspend();
|
|
233
|
+
let reason;
|
|
234
|
+
try {
|
|
235
|
+
reason = await input({
|
|
236
|
+
message: "Reason for baseline (optional):",
|
|
237
|
+
}, { output: process.stderr });
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
renderer?.resume();
|
|
241
|
+
}
|
|
231
242
|
baseline = addToBaseline(baseline, issue, reason || undefined);
|
|
232
243
|
await saveBaseline(baseline, DEFAULT_BASELINE_PATH);
|
|
233
|
-
|
|
244
|
+
writeOutput(dim("Added to baseline") + "\n");
|
|
234
245
|
baselined++;
|
|
235
246
|
}
|
|
236
247
|
}
|
|
237
248
|
}
|
|
238
249
|
else {
|
|
239
|
-
|
|
240
|
-
|
|
250
|
+
writeOutput(colorize("\nFix suggestions require a job ID and API key.", tokens.warning) + "\n");
|
|
251
|
+
writeOutput(dim("Run with `vertaa audit <url> --wait --interactive` for full functionality.") + "\n");
|
|
241
252
|
}
|
|
242
253
|
i++;
|
|
243
254
|
break;
|
|
@@ -248,39 +259,46 @@ export async function runFixWizard(issues, options) {
|
|
|
248
259
|
break;
|
|
249
260
|
case "explain": {
|
|
250
261
|
// Show full evidence bundle
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
writeOutput("\n");
|
|
263
|
+
writeOutput(explainIssue(issue) + "\n");
|
|
264
|
+
writeOutput("\n");
|
|
254
265
|
// Don't increment i - stay on same issue to pick another action
|
|
255
266
|
break;
|
|
256
267
|
}
|
|
257
268
|
case "baseline": {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
269
|
+
renderer?.suspend();
|
|
270
|
+
let reason;
|
|
271
|
+
try {
|
|
272
|
+
reason = await input({
|
|
273
|
+
message: "Reason for baseline (optional):",
|
|
274
|
+
}, { output: process.stderr });
|
|
275
|
+
}
|
|
276
|
+
finally {
|
|
277
|
+
renderer?.resume();
|
|
278
|
+
}
|
|
261
279
|
baseline = addToBaseline(baseline, issue, reason || undefined);
|
|
262
280
|
await saveBaseline(baseline, DEFAULT_BASELINE_PATH);
|
|
263
|
-
|
|
281
|
+
writeOutput(dim("Added to baseline") + "\n");
|
|
264
282
|
baselined++;
|
|
265
283
|
i++;
|
|
266
284
|
break;
|
|
267
285
|
}
|
|
268
286
|
case "quit":
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
287
|
+
writeOutput("\n");
|
|
288
|
+
writeOutput(bold("Wizard Summary:") + "\n");
|
|
289
|
+
writeOutput(` Accepted: ${accepted}\n`);
|
|
290
|
+
writeOutput(` Skipped: ${skipped}\n`);
|
|
291
|
+
writeOutput(` Baselined: ${baselined}\n`);
|
|
292
|
+
writeOutput(` Remaining: ${sortedIssues.length - i}\n`);
|
|
275
293
|
return;
|
|
276
294
|
}
|
|
277
295
|
}
|
|
278
296
|
// Summary
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
297
|
+
writeOutput("\n");
|
|
298
|
+
writeOutput(boldColor("All issues reviewed!", tokens.success) + "\n");
|
|
299
|
+
writeOutput("\n");
|
|
300
|
+
writeOutput(bold("Summary:") + "\n");
|
|
301
|
+
writeOutput(` Accepted: ${accepted}\n`);
|
|
302
|
+
writeOutput(` Skipped: ${skipped}\n`);
|
|
303
|
+
writeOutput(` Baselined: ${baselined}\n`);
|
|
286
304
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Guides users through project setup with sensible defaults.
|
|
5
5
|
*/
|
|
6
6
|
import type { AuditMode, FailOnSeverity, CITemplate } from "../config/schema.js";
|
|
7
|
+
import type { Renderer } from "@vertaaux/tui";
|
|
7
8
|
/**
|
|
8
9
|
* Configuration generated by the init wizard.
|
|
9
10
|
*/
|
|
@@ -26,7 +27,8 @@ export interface InitConfig {
|
|
|
26
27
|
*
|
|
27
28
|
* Guides user through configuration options and returns the chosen settings.
|
|
28
29
|
*
|
|
30
|
+
* @param renderer - Optional renderer to suspend/resume during prompts
|
|
29
31
|
* @returns Configuration object for writing to file
|
|
30
32
|
*/
|
|
31
|
-
export declare function runInitWizard(): Promise<InitConfig>;
|
|
33
|
+
export declare function runInitWizard(renderer?: Renderer): Promise<InitConfig>;
|
|
32
34
|
//# sourceMappingURL=init-wizard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-wizard.d.ts","sourceRoot":"","sources":["../../src/interactive/init-wizard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"init-wizard.d.ts","sourceRoot":"","sources":["../../src/interactive/init-wizard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,6BAA6B;IAC7B,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC;IAChC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,kBAAkB,EAAE,OAAO,CAAC;IAC5B,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAuR5E"}
|