@vertaaux/cli 0.4.0 → 0.5.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 +116 -0
- package/MIGRATION.md +239 -0
- package/README.md +62 -17
- package/dist/app/interactive-app.d.ts +103 -0
- package/dist/app/interactive-app.d.ts.map +1 -0
- package/dist/app/interactive-app.js +328 -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 +166 -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 +415 -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 +46 -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 +11 -0
- package/dist/commands/a11y.d.ts.map +1 -0
- package/dist/commands/a11y.js +149 -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 +589 -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 +129 -0
- package/dist/commands/audit/policy.d.ts +27 -0
- package/dist/commands/audit/policy.d.ts.map +1 -0
- package/dist/commands/audit/policy.js +147 -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 +89 -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 +2 -0
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +221 -123
- package/dist/commands/comment.d.ts +22 -0
- package/dist/commands/comment.d.ts.map +1 -1
- package/dist/commands/comment.js +127 -62
- package/dist/commands/compare.d.ts +17 -0
- package/dist/commands/compare.d.ts.map +1 -1
- package/dist/commands/compare.js +288 -181
- package/dist/commands/diff.d.ts +7 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +181 -143
- package/dist/commands/doc.d.ts +10 -0
- package/dist/commands/doc.d.ts.map +1 -1
- package/dist/commands/doc.js +135 -77
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +166 -19
- 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 +242 -156
- 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 +154 -90
- 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 +160 -98
- package/dist/commands/policy.d.ts +31 -0
- package/dist/commands/policy.d.ts.map +1 -1
- package/dist/commands/policy.js +270 -125
- 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 +128 -74
- 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 +180 -83
- package/dist/commands/triage.d.ts +35 -0
- package/dist/commands/triage.d.ts.map +1 -1
- package/dist/commands/triage.js +207 -82
- 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/config/schema.d.ts +4 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127 -991
- 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 +9 -0
- package/dist/output/envelope.d.ts.map +1 -1
- package/dist/output/envelope.js +37 -3
- 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/policy/schema.d.ts +137 -0
- package/dist/policy/schema.d.ts.map +1 -1
- package/dist/policy/schema.js +107 -0
- package/dist/prompts/command-catalog.js +9 -9
- 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 +104 -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/root-args.d.ts +12 -0
- package/dist/utils/root-args.d.ts.map +1 -0
- package/dist/utils/root-args.js +44 -0
- package/dist/utils/stdin.d.ts +7 -0
- package/dist/utils/stdin.d.ts.map +1 -1
- package/dist/utils/stdin.js +32 -2
- 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 +1216 -27
- 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 +1189 -27
- package/node_modules/@vertaaux/tui/dist/index.js.map +1 -1
- package/node_modules/@vertaaux/tui/package.json +2 -3
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +83 -0
- package/node_modules/chalk/readme.md +297 -0
- package/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/chalk/source/index.js +225 -0
- package/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/package.json +20 -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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatting helpers for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { colorize, dim, brand, severity as severityPalette } from "@vertaaux/tui";
|
|
7
|
+
import { createEnvelope, writeDataOutput, writeJsonOutput, writeOutput } from "../../output/envelope.js";
|
|
8
|
+
/**
|
|
9
|
+
* Write output to file. Returns the resolved path if written to file, undefined otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export function writeOutputToFile(content, outputPath, defaultPath) {
|
|
12
|
+
// Determine the final output path
|
|
13
|
+
const finalPath = outputPath || defaultPath;
|
|
14
|
+
if (finalPath) {
|
|
15
|
+
// Write to file
|
|
16
|
+
const resolvedPath = path.resolve(process.cwd(), finalPath);
|
|
17
|
+
// Ensure directory exists
|
|
18
|
+
const dir = path.dirname(resolvedPath);
|
|
19
|
+
if (!fs.existsSync(dir)) {
|
|
20
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
fs.writeFileSync(resolvedPath, content, "utf-8");
|
|
23
|
+
return resolvedPath;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get default output path based on format.
|
|
29
|
+
* Returns undefined for formats that should go to stdout by default.
|
|
30
|
+
*/
|
|
31
|
+
export function getDefaultOutputPath(format) {
|
|
32
|
+
switch (format) {
|
|
33
|
+
case "html":
|
|
34
|
+
return "vertaaux-report.html";
|
|
35
|
+
default:
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Output results in fire-and-forget mode (--no-wait).
|
|
41
|
+
*/
|
|
42
|
+
export function outputFireAndForget(created, format, formatter, options, quiet) {
|
|
43
|
+
if (format === "json") {
|
|
44
|
+
if (options.output) {
|
|
45
|
+
const output = JSON.stringify(createEnvelope(created, "audit"), null, 2);
|
|
46
|
+
const filePath = writeOutputToFile(output, options.output);
|
|
47
|
+
if (filePath && !quiet) {
|
|
48
|
+
writeOutput(`Report written to: ${filePath}\n`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
writeJsonOutput(created, "audit");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const output = formatter.formatResult(created);
|
|
57
|
+
const defaultPath = getDefaultOutputPath(format);
|
|
58
|
+
const filePath = writeOutputToFile(output, options.output, defaultPath);
|
|
59
|
+
if (filePath && !quiet) {
|
|
60
|
+
writeOutput(`Report written to: ${filePath}\n`);
|
|
61
|
+
}
|
|
62
|
+
else if (!filePath) {
|
|
63
|
+
writeDataOutput(output);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Print quality gate result to stderr.
|
|
69
|
+
*/
|
|
70
|
+
export function outputQualityGateResult(gateResult) {
|
|
71
|
+
writeOutput("\n");
|
|
72
|
+
if (gateResult.bypassed) {
|
|
73
|
+
writeOutput(colorize(`Quality gate bypassed: ${gateResult.bypassReason}`, severityPalette.warning) + "\n");
|
|
74
|
+
}
|
|
75
|
+
else if (gateResult.passed) {
|
|
76
|
+
writeOutput(colorize("Quality gate: PASSED", brand.lime) + "\n");
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
writeOutput(colorize("Quality gate: FAILED", severityPalette.error) + "\n");
|
|
80
|
+
for (const violation of gateResult.violations) {
|
|
81
|
+
writeOutput(colorize(` - ${violation.message}`, severityPalette.error) + "\n");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
writeOutput("\n");
|
|
85
|
+
writeOutput(`New issues: ${gateResult.summary.newIssues.error} errors, ` +
|
|
86
|
+
`${gateResult.summary.newIssues.warning} warnings, ` +
|
|
87
|
+
`${gateResult.summary.newIssues.info} info\n`);
|
|
88
|
+
if (gateResult.summary.fixedIssues > 0) {
|
|
89
|
+
writeOutput(colorize(`Fixed: ${gateResult.summary.fixedIssues} issues`, brand.lime) + "\n");
|
|
90
|
+
}
|
|
91
|
+
if (gateResult.summary.existingIssues > 0) {
|
|
92
|
+
writeOutput(dim(`Existing (baselined): ${gateResult.summary.existingIssues} issues`) + "\n");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Write formatted audit results to output or stdout.
|
|
97
|
+
*/
|
|
98
|
+
export function outputFormattedResults(filteredResult, format, formatter, groupBy, options, quiet) {
|
|
99
|
+
const formatOptions = {
|
|
100
|
+
human: {
|
|
101
|
+
groupBy,
|
|
102
|
+
showScores: true,
|
|
103
|
+
showSummary: true,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
if (format === "json") {
|
|
107
|
+
if (options.output) {
|
|
108
|
+
const jsonStr = JSON.stringify(createEnvelope(filteredResult, "audit"), null, 2);
|
|
109
|
+
const filePath = writeOutputToFile(jsonStr, options.output);
|
|
110
|
+
if (filePath && !quiet) {
|
|
111
|
+
writeOutput(`Report written to: ${filePath}\n`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
writeJsonOutput(filteredResult, "audit");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const output = formatter.formatResult(filteredResult, formatOptions);
|
|
120
|
+
const defaultPath = getDefaultOutputPath(format);
|
|
121
|
+
const filePath = writeOutputToFile(output, options.output, defaultPath);
|
|
122
|
+
if (filePath && !quiet) {
|
|
123
|
+
writeOutput(`Report written to: ${filePath}\n`);
|
|
124
|
+
}
|
|
125
|
+
else if (!filePath) {
|
|
126
|
+
writeDataOutput(output);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy loading and quality gate configuration for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import type { VertaauxConfig } from "../../config/schema.js";
|
|
5
|
+
import { type PolicyFile } from "../../policy/index.js";
|
|
6
|
+
import { type AuditProfile } from "../../policy/schema.js";
|
|
7
|
+
import { type QualityGateConfig } from "../../quality-gate/index.js";
|
|
8
|
+
import type { AuditCommandOptions } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Resolve an audit profile by name from built-in profiles or config-defined profiles.
|
|
11
|
+
* Returns null if no profile is requested.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveAuditProfile(profileName: string | undefined, configProfiles?: Record<string, AuditProfile>): AuditProfile | null;
|
|
14
|
+
/**
|
|
15
|
+
* Build quality gate configuration from options, profile, and config.
|
|
16
|
+
*
|
|
17
|
+
* Precedence: CLI flags > config file > profile > defaults
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildQualityGateConfig(config: VertaauxConfig, options: AuditCommandOptions, profile?: AuditProfile | null): QualityGateConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Load and resolve a policy file with branch-specific overrides.
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadAndResolvePolicy(options: AuditCommandOptions, quiet: boolean): Promise<{
|
|
24
|
+
policy: PolicyFile | null;
|
|
25
|
+
path: string | null;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/commands/audit/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAKtD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAC5C,YAAY,GAAG,IAAI,CAoBrB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAC5B,iBAAiB,CAmEnB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAwD7D"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy loading and quality gate configuration for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { colorize, dim, severity as severityPalette } from "@vertaaux/tui";
|
|
6
|
+
import { writeOutput } from "../../output/envelope.js";
|
|
7
|
+
import semver from "semver";
|
|
8
|
+
import { ExitCode } from "../../utils/exit-codes.js";
|
|
9
|
+
import { loadPolicy, resolveBranchPolicy, } from "../../policy/index.js";
|
|
10
|
+
import { AUDIT_PROFILES, } from "../../policy/schema.js";
|
|
11
|
+
import { DEFAULT_QUALITY_GATE_CONFIG, } from "../../quality-gate/index.js";
|
|
12
|
+
import { CLI_VERSION } from "./types.js";
|
|
13
|
+
import { detectCurrentBranch } from "./ci-detection.js";
|
|
14
|
+
import { strings } from "../../ui/strings.js";
|
|
15
|
+
/**
|
|
16
|
+
* Resolve an audit profile by name from built-in profiles or config-defined profiles.
|
|
17
|
+
* Returns null if no profile is requested.
|
|
18
|
+
*/
|
|
19
|
+
export function resolveAuditProfile(profileName, configProfiles) {
|
|
20
|
+
if (!profileName)
|
|
21
|
+
return null;
|
|
22
|
+
// Check config-defined profiles first (user overrides)
|
|
23
|
+
if (configProfiles?.[profileName]) {
|
|
24
|
+
return configProfiles[profileName];
|
|
25
|
+
}
|
|
26
|
+
// Check built-in profiles
|
|
27
|
+
if (profileName in AUDIT_PROFILES) {
|
|
28
|
+
return AUDIT_PROFILES[profileName];
|
|
29
|
+
}
|
|
30
|
+
const validNames = [
|
|
31
|
+
...Object.keys(AUDIT_PROFILES),
|
|
32
|
+
...Object.keys(configProfiles || {}),
|
|
33
|
+
].join(", ");
|
|
34
|
+
throw new Error(`Unknown audit profile "${profileName}". Valid profiles: ${validNames}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build quality gate configuration from options, profile, and config.
|
|
38
|
+
*
|
|
39
|
+
* Precedence: CLI flags > config file > profile > defaults
|
|
40
|
+
*/
|
|
41
|
+
export function buildQualityGateConfig(config, options, profile) {
|
|
42
|
+
// Start with defaults
|
|
43
|
+
const gateConfig = { ...DEFAULT_QUALITY_GATE_CONFIG };
|
|
44
|
+
// Apply profile assertions (lowest override precedence)
|
|
45
|
+
if (profile?.assertions) {
|
|
46
|
+
if (profile.assertions.fail_on)
|
|
47
|
+
gateConfig.failOn = profile.assertions.fail_on;
|
|
48
|
+
if (profile.assertions.overall_score !== undefined) {
|
|
49
|
+
gateConfig.thresholds = { ...gateConfig.thresholds, overall: profile.assertions.overall_score };
|
|
50
|
+
}
|
|
51
|
+
if (profile.assertions.accessibility_score !== undefined) {
|
|
52
|
+
gateConfig.thresholds = { ...gateConfig.thresholds, accessibility: profile.assertions.accessibility_score };
|
|
53
|
+
}
|
|
54
|
+
if (profile.assertions.max_new_errors !== undefined) {
|
|
55
|
+
gateConfig.maxNew = { ...gateConfig.maxNew, error: profile.assertions.max_new_errors };
|
|
56
|
+
}
|
|
57
|
+
if (profile.assertions.max_new_warnings !== undefined) {
|
|
58
|
+
gateConfig.maxNew = { ...gateConfig.maxNew, warning: profile.assertions.max_new_warnings };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Apply profile thresholds
|
|
62
|
+
if (profile?.thresholds) {
|
|
63
|
+
gateConfig.thresholds = { ...gateConfig.thresholds, ...profile.thresholds };
|
|
64
|
+
}
|
|
65
|
+
// Apply config file settings
|
|
66
|
+
const configGate = config.qualityGate;
|
|
67
|
+
if (configGate) {
|
|
68
|
+
if (configGate.failOn)
|
|
69
|
+
gateConfig.failOn = configGate.failOn;
|
|
70
|
+
if (configGate.thresholds) {
|
|
71
|
+
gateConfig.thresholds = { ...gateConfig.thresholds, ...configGate.thresholds };
|
|
72
|
+
}
|
|
73
|
+
if (configGate.maxNew) {
|
|
74
|
+
gateConfig.maxNew = { ...gateConfig.maxNew, ...configGate.maxNew };
|
|
75
|
+
}
|
|
76
|
+
if (configGate.failOnExisting !== undefined) {
|
|
77
|
+
gateConfig.failOnExisting = configGate.failOnExisting;
|
|
78
|
+
}
|
|
79
|
+
if (configGate.bypassLabels) {
|
|
80
|
+
gateConfig.bypassLabels = configGate.bypassLabels;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Apply CLI flags (highest precedence)
|
|
84
|
+
if (options.failOn) {
|
|
85
|
+
gateConfig.failOn = options.failOn;
|
|
86
|
+
}
|
|
87
|
+
if (options.threshold !== undefined) {
|
|
88
|
+
gateConfig.thresholds.overall = options.threshold;
|
|
89
|
+
}
|
|
90
|
+
if (options.maxNewErrors !== undefined) {
|
|
91
|
+
gateConfig.maxNew.error = options.maxNewErrors;
|
|
92
|
+
}
|
|
93
|
+
if (options.maxNewWarnings !== undefined) {
|
|
94
|
+
gateConfig.maxNew.warning = options.maxNewWarnings;
|
|
95
|
+
}
|
|
96
|
+
if (options.failOnExisting !== undefined) {
|
|
97
|
+
gateConfig.failOnExisting = options.failOnExisting;
|
|
98
|
+
}
|
|
99
|
+
if (options.bypassLabels) {
|
|
100
|
+
gateConfig.bypassLabels = options.bypassLabels.split(",").map((l) => l.trim());
|
|
101
|
+
}
|
|
102
|
+
return gateConfig;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Load and resolve a policy file with branch-specific overrides.
|
|
106
|
+
*/
|
|
107
|
+
export async function loadAndResolvePolicy(options, quiet) {
|
|
108
|
+
let resolvedPolicy = null;
|
|
109
|
+
let policyPath = null;
|
|
110
|
+
try {
|
|
111
|
+
const policyResult = await loadPolicy(options.policy ? path.dirname(options.policy) : undefined);
|
|
112
|
+
if (options.policy) {
|
|
113
|
+
const { loadPolicyFile } = await import("../../policy/index.js");
|
|
114
|
+
resolvedPolicy = await loadPolicyFile(options.policy);
|
|
115
|
+
policyPath = options.policy;
|
|
116
|
+
}
|
|
117
|
+
else if (policyResult.path) {
|
|
118
|
+
resolvedPolicy = policyResult.policy;
|
|
119
|
+
policyPath = policyResult.path;
|
|
120
|
+
}
|
|
121
|
+
if (resolvedPolicy) {
|
|
122
|
+
const currentBranch = detectCurrentBranch();
|
|
123
|
+
if (currentBranch) {
|
|
124
|
+
resolvedPolicy = resolveBranchPolicy(resolvedPolicy, currentBranch);
|
|
125
|
+
}
|
|
126
|
+
if (!quiet && policyPath) {
|
|
127
|
+
writeOutput(dim(strings.policy.usingPolicy(policyPath, currentBranch ? ` (branch: ${currentBranch})` : "")) + "\n");
|
|
128
|
+
}
|
|
129
|
+
if (resolvedPolicy.required_version) {
|
|
130
|
+
if (!semver.satisfies(CLI_VERSION, resolvedPolicy.required_version)) {
|
|
131
|
+
writeOutput(colorize(`Policy requires CLI version ${resolvedPolicy.required_version}, ` +
|
|
132
|
+
`but current version is ${CLI_VERSION}`, severityPalette.error) + "\n");
|
|
133
|
+
process.exit(ExitCode.ERROR);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (options.policy) {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
if (!quiet) {
|
|
143
|
+
writeOutput(colorize(`Warning: Failed to load policy: ${error instanceof Error ? error.message : String(error)}`, severityPalette.warning) + "\n");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { policy: resolvedPolicy, path: policyPath };
|
|
147
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score computation helpers for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import type { AuditScores } from "@vertaaux/sdk";
|
|
5
|
+
/**
|
|
6
|
+
* Map API audit status to TUI phase name.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mapStatusToPhase(status: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Extract overall score from audit result.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getOverallScoreFromResult(result: {
|
|
13
|
+
scores?: unknown;
|
|
14
|
+
}): number | null;
|
|
15
|
+
/**
|
|
16
|
+
* Extract numeric scores from result scores object.
|
|
17
|
+
*/
|
|
18
|
+
export declare function extractNumericScores(scores?: AuditScores | Record<string, unknown>): Record<string, number>;
|
|
19
|
+
/**
|
|
20
|
+
* Count total issues from various result formats.
|
|
21
|
+
*/
|
|
22
|
+
export declare function countTotalIssues(issues: unknown): number;
|
|
23
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../src/commands/audit/scoring.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBvD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CASrF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAS3G;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAQxD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score computation helpers for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import { AuditPhase } from "@vertaaux/tui";
|
|
5
|
+
/**
|
|
6
|
+
* Map API audit status to TUI phase name.
|
|
7
|
+
*/
|
|
8
|
+
export function mapStatusToPhase(status) {
|
|
9
|
+
switch (status) {
|
|
10
|
+
case "queued":
|
|
11
|
+
case "pending":
|
|
12
|
+
return AuditPhase.Connecting;
|
|
13
|
+
case "crawling":
|
|
14
|
+
return AuditPhase.Crawling;
|
|
15
|
+
case "running":
|
|
16
|
+
case "analyzing":
|
|
17
|
+
return AuditPhase.Analyzing;
|
|
18
|
+
case "scoring":
|
|
19
|
+
return AuditPhase.Scoring;
|
|
20
|
+
case "completed":
|
|
21
|
+
return AuditPhase.Done;
|
|
22
|
+
case "failed":
|
|
23
|
+
return AuditPhase.Failed;
|
|
24
|
+
default:
|
|
25
|
+
return AuditPhase.Analyzing;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Extract overall score from audit result.
|
|
30
|
+
*/
|
|
31
|
+
export function getOverallScoreFromResult(result) {
|
|
32
|
+
if (!result.scores)
|
|
33
|
+
return null;
|
|
34
|
+
const scores = result.scores;
|
|
35
|
+
const direct = scores.overall ?? scores.ux ?? scores.total;
|
|
36
|
+
if (typeof direct === "number" && Number.isFinite(direct))
|
|
37
|
+
return direct;
|
|
38
|
+
const numeric = Object.values(scores)
|
|
39
|
+
.filter((v) => typeof v === "number" && Number.isFinite(v));
|
|
40
|
+
if (numeric.length === 0)
|
|
41
|
+
return null;
|
|
42
|
+
return Math.round(numeric.reduce((a, b) => a + b, 0) / numeric.length);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extract numeric scores from result scores object.
|
|
46
|
+
*/
|
|
47
|
+
export function extractNumericScores(scores) {
|
|
48
|
+
if (!scores)
|
|
49
|
+
return {};
|
|
50
|
+
const result = {};
|
|
51
|
+
for (const [key, value] of Object.entries(scores)) {
|
|
52
|
+
if (typeof value === "number" && key !== "overall") {
|
|
53
|
+
result[key] = value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Count total issues from various result formats.
|
|
60
|
+
*/
|
|
61
|
+
export function countTotalIssues(issues) {
|
|
62
|
+
if (Array.isArray(issues))
|
|
63
|
+
return issues.length;
|
|
64
|
+
if (issues && typeof issues === "object") {
|
|
65
|
+
return Object.values(issues)
|
|
66
|
+
.flatMap((v) => (Array.isArray(v) ? v : []))
|
|
67
|
+
.length;
|
|
68
|
+
}
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and constants for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Issue type for filtering.
|
|
6
|
+
*/
|
|
7
|
+
export interface IssueLike {
|
|
8
|
+
id?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
severity?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
recommendation?: string;
|
|
14
|
+
recommended_fix?: string;
|
|
15
|
+
wcag_reference?: string;
|
|
16
|
+
selector?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AuditCommandOptions {
|
|
19
|
+
url?: string;
|
|
20
|
+
repo?: string;
|
|
21
|
+
storybook?: string;
|
|
22
|
+
routes?: string;
|
|
23
|
+
authProfile?: string;
|
|
24
|
+
mode?: "basic" | "standard" | "deep";
|
|
25
|
+
wait?: boolean;
|
|
26
|
+
timeout?: number;
|
|
27
|
+
interval?: number;
|
|
28
|
+
format?: string;
|
|
29
|
+
json?: boolean;
|
|
30
|
+
output?: string;
|
|
31
|
+
groupBy?: "severity" | "category" | "route";
|
|
32
|
+
severity?: string;
|
|
33
|
+
category?: string;
|
|
34
|
+
failOn?: "error" | "warning" | "info" | "none";
|
|
35
|
+
threshold?: number;
|
|
36
|
+
maxNewErrors?: number;
|
|
37
|
+
maxNewWarnings?: number;
|
|
38
|
+
failOnExisting?: boolean;
|
|
39
|
+
bypassLabels?: string;
|
|
40
|
+
baseline?: string;
|
|
41
|
+
interactive?: boolean;
|
|
42
|
+
saveTrace?: boolean;
|
|
43
|
+
saveHar?: boolean;
|
|
44
|
+
screenshots?: boolean;
|
|
45
|
+
domSnapshots?: boolean;
|
|
46
|
+
concurrency?: number;
|
|
47
|
+
cache?: boolean;
|
|
48
|
+
uploadArtifacts?: boolean;
|
|
49
|
+
jobId?: string;
|
|
50
|
+
incremental?: boolean;
|
|
51
|
+
baseBranch?: string;
|
|
52
|
+
budget?: "quick" | "standard" | "full";
|
|
53
|
+
policy?: string;
|
|
54
|
+
profile?: string;
|
|
55
|
+
workspace?: string;
|
|
56
|
+
allWorkspaces?: boolean;
|
|
57
|
+
parallel?: boolean;
|
|
58
|
+
detectMatrix?: boolean;
|
|
59
|
+
noCache?: boolean;
|
|
60
|
+
cacheDir?: string;
|
|
61
|
+
jsonLogs?: boolean;
|
|
62
|
+
explain?: boolean;
|
|
63
|
+
strict?: boolean;
|
|
64
|
+
continueOnError?: boolean;
|
|
65
|
+
base?: string;
|
|
66
|
+
quiet?: boolean;
|
|
67
|
+
machine?: boolean;
|
|
68
|
+
dashboard?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Artifact manifest structure.
|
|
72
|
+
*/
|
|
73
|
+
export interface ArtifactManifest {
|
|
74
|
+
job_id: string;
|
|
75
|
+
timestamp: string;
|
|
76
|
+
files: string[];
|
|
77
|
+
audit_url?: string;
|
|
78
|
+
issue_count: {
|
|
79
|
+
error: number;
|
|
80
|
+
warning: number;
|
|
81
|
+
info: number;
|
|
82
|
+
};
|
|
83
|
+
exit_code: number;
|
|
84
|
+
}
|
|
85
|
+
/** Artifact directory */
|
|
86
|
+
export declare const ARTIFACTS_DIR = ".vertaaux/artifacts";
|
|
87
|
+
/** CLI version for policy version requirements (read from package.json) */
|
|
88
|
+
export declare const CLI_VERSION: string;
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/audit/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types and constants for the audit command.
|
|
3
|
+
*/
|
|
4
|
+
import { getVersion } from "../../ui/banner.js";
|
|
5
|
+
/** Artifact directory */
|
|
6
|
+
export const ARTIFACTS_DIR = ".vertaaux/artifacts";
|
|
7
|
+
/** CLI version for policy version requirements (read from package.json) */
|
|
8
|
+
export const CLI_VERSION = getVersion();
|
package/dist/commands/audit.d.ts
CHANGED
|
@@ -1,61 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Runs UX and accessibility audits on web pages.
|
|
5
|
-
* Supports various targets, output formats, and CI integration.
|
|
6
|
-
*/
|
|
7
|
-
import { Command } from "commander";
|
|
8
|
-
export interface AuditCommandOptions {
|
|
9
|
-
url?: string;
|
|
10
|
-
repo?: string;
|
|
11
|
-
storybook?: string;
|
|
12
|
-
routes?: string;
|
|
13
|
-
authProfile?: string;
|
|
14
|
-
mode?: "basic" | "standard" | "deep";
|
|
15
|
-
wait?: boolean;
|
|
16
|
-
timeout?: number;
|
|
17
|
-
interval?: number;
|
|
18
|
-
format?: string;
|
|
19
|
-
json?: boolean;
|
|
20
|
-
output?: string;
|
|
21
|
-
groupBy?: "severity" | "category" | "route";
|
|
22
|
-
severity?: string;
|
|
23
|
-
category?: string;
|
|
24
|
-
failOn?: "error" | "warning" | "info" | "none";
|
|
25
|
-
threshold?: number;
|
|
26
|
-
maxNewErrors?: number;
|
|
27
|
-
maxNewWarnings?: number;
|
|
28
|
-
failOnExisting?: boolean;
|
|
29
|
-
bypassLabels?: string;
|
|
30
|
-
baseline?: string;
|
|
31
|
-
interactive?: boolean;
|
|
32
|
-
saveTrace?: boolean;
|
|
33
|
-
saveHar?: boolean;
|
|
34
|
-
screenshots?: boolean;
|
|
35
|
-
domSnapshots?: boolean;
|
|
36
|
-
concurrency?: number;
|
|
37
|
-
cache?: boolean;
|
|
38
|
-
uploadArtifacts?: boolean;
|
|
39
|
-
jobId?: string;
|
|
40
|
-
incremental?: boolean;
|
|
41
|
-
baseBranch?: string;
|
|
42
|
-
budget?: "quick" | "standard" | "full";
|
|
43
|
-
policy?: string;
|
|
44
|
-
workspace?: string;
|
|
45
|
-
allWorkspaces?: boolean;
|
|
46
|
-
parallel?: boolean;
|
|
47
|
-
detectMatrix?: boolean;
|
|
48
|
-
noCache?: boolean;
|
|
49
|
-
cacheDir?: string;
|
|
50
|
-
jsonLogs?: boolean;
|
|
51
|
-
explain?: boolean;
|
|
52
|
-
base?: string;
|
|
53
|
-
quiet?: boolean;
|
|
54
|
-
machine?: boolean;
|
|
55
|
-
dashboard?: boolean;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Register the audit command with the Commander program.
|
|
59
|
-
*/
|
|
60
|
-
export declare function registerAuditCommand(program: Command): void;
|
|
1
|
+
export { registerAuditCommand } from "./audit/index.js";
|
|
2
|
+
export type { AuditCommandOptions } from "./audit/types.js";
|
|
61
3
|
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|