@vertaaux/cli 0.3.3 → 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.
Files changed (227) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/MIGRATION.md +239 -0
  3. package/README.md +34 -16
  4. package/dist/app/interactive-app.d.ts +101 -0
  5. package/dist/app/interactive-app.d.ts.map +1 -0
  6. package/dist/app/interactive-app.js +309 -0
  7. package/dist/app/layout/canvas.d.ts +23 -0
  8. package/dist/app/layout/canvas.d.ts.map +1 -0
  9. package/dist/app/layout/canvas.js +36 -0
  10. package/dist/app/layout/footer.d.ts +31 -0
  11. package/dist/app/layout/footer.d.ts.map +1 -0
  12. package/dist/app/layout/footer.js +41 -0
  13. package/dist/app/layout/header.d.ts +20 -0
  14. package/dist/app/layout/header.d.ts.map +1 -0
  15. package/dist/app/layout/header.js +27 -0
  16. package/dist/app/menu/categories.d.ts +20 -0
  17. package/dist/app/menu/categories.d.ts.map +1 -0
  18. package/dist/app/menu/categories.js +181 -0
  19. package/dist/app/menu/filter.d.ts +17 -0
  20. package/dist/app/menu/filter.d.ts.map +1 -0
  21. package/dist/app/menu/filter.js +33 -0
  22. package/dist/app/menu/menu-view.d.ts +35 -0
  23. package/dist/app/menu/menu-view.d.ts.map +1 -0
  24. package/dist/app/menu/menu-view.js +230 -0
  25. package/dist/app/menu/recent.d.ts +24 -0
  26. package/dist/app/menu/recent.d.ts.map +1 -0
  27. package/dist/app/menu/recent.js +49 -0
  28. package/dist/app/types.d.ts +43 -0
  29. package/dist/app/types.d.ts.map +1 -0
  30. package/dist/app/types.js +7 -0
  31. package/dist/app/views/command-runner.d.ts +36 -0
  32. package/dist/app/views/command-runner.d.ts.map +1 -0
  33. package/dist/app/views/command-runner.js +372 -0
  34. package/dist/app/views/help-overlay.d.ts +21 -0
  35. package/dist/app/views/help-overlay.d.ts.map +1 -0
  36. package/dist/app/views/help-overlay.js +45 -0
  37. package/dist/auth/ci-token.d.ts +14 -2
  38. package/dist/auth/ci-token.d.ts.map +1 -1
  39. package/dist/auth/ci-token.js +15 -30
  40. package/dist/auth/device-flow.d.ts +2 -1
  41. package/dist/auth/device-flow.d.ts.map +1 -1
  42. package/dist/auth/device-flow.js +13 -10
  43. package/dist/auth/token-store.d.ts.map +1 -1
  44. package/dist/auth/token-store.js +12 -2
  45. package/dist/baseline/diff.d.ts +2 -2
  46. package/dist/baseline/diff.d.ts.map +1 -1
  47. package/dist/baseline/diff.js +15 -34
  48. package/dist/commands/a11y.d.ts +9 -0
  49. package/dist/commands/a11y.d.ts.map +1 -0
  50. package/dist/commands/a11y.js +76 -0
  51. package/dist/commands/audit/artifacts.d.ts +27 -0
  52. package/dist/commands/audit/artifacts.d.ts.map +1 -0
  53. package/dist/commands/audit/artifacts.js +158 -0
  54. package/dist/commands/audit/ci-detection.d.ts +18 -0
  55. package/dist/commands/audit/ci-detection.d.ts.map +1 -0
  56. package/dist/commands/audit/ci-detection.js +71 -0
  57. package/dist/commands/audit/explain.d.ts +11 -0
  58. package/dist/commands/audit/explain.d.ts.map +1 -0
  59. package/dist/commands/audit/explain.js +45 -0
  60. package/dist/commands/audit/filters.d.ts +17 -0
  61. package/dist/commands/audit/filters.d.ts.map +1 -0
  62. package/dist/commands/audit/filters.js +40 -0
  63. package/dist/commands/audit/index.d.ts +18 -0
  64. package/dist/commands/audit/index.d.ts.map +1 -0
  65. package/dist/commands/audit/index.js +564 -0
  66. package/dist/commands/audit/output.d.ts +32 -0
  67. package/dist/commands/audit/output.d.ts.map +1 -0
  68. package/dist/commands/audit/output.js +130 -0
  69. package/dist/commands/audit/policy.d.ts +19 -0
  70. package/dist/commands/audit/policy.d.ts.map +1 -0
  71. package/dist/commands/audit/policy.js +102 -0
  72. package/dist/commands/audit/scoring.d.ts +23 -0
  73. package/dist/commands/audit/scoring.d.ts.map +1 -0
  74. package/dist/commands/audit/scoring.js +70 -0
  75. package/dist/commands/audit/types.d.ts +88 -0
  76. package/dist/commands/audit/types.d.ts.map +1 -0
  77. package/dist/commands/audit/types.js +8 -0
  78. package/dist/commands/audit.d.ts +2 -60
  79. package/dist/commands/audit.d.ts.map +1 -1
  80. package/dist/commands/audit.js +2 -1038
  81. package/dist/commands/baseline.d.ts +1 -0
  82. package/dist/commands/baseline.d.ts.map +1 -1
  83. package/dist/commands/baseline.js +205 -121
  84. package/dist/commands/comment.d.ts +22 -0
  85. package/dist/commands/comment.d.ts.map +1 -1
  86. package/dist/commands/comment.js +122 -58
  87. package/dist/commands/compare.d.ts +17 -0
  88. package/dist/commands/compare.d.ts.map +1 -1
  89. package/dist/commands/compare.js +287 -180
  90. package/dist/commands/diff.d.ts +5 -0
  91. package/dist/commands/diff.d.ts.map +1 -1
  92. package/dist/commands/diff.js +168 -141
  93. package/dist/commands/doc.d.ts +10 -0
  94. package/dist/commands/doc.d.ts.map +1 -1
  95. package/dist/commands/doc.js +134 -76
  96. package/dist/commands/doctor.d.ts +2 -0
  97. package/dist/commands/doctor.d.ts.map +1 -1
  98. package/dist/commands/doctor.js +164 -17
  99. package/dist/commands/download.d.ts +10 -0
  100. package/dist/commands/download.d.ts.map +1 -1
  101. package/dist/commands/download.js +169 -112
  102. package/dist/commands/explain.d.ts +5 -0
  103. package/dist/commands/explain.d.ts.map +1 -1
  104. package/dist/commands/explain.js +241 -155
  105. package/dist/commands/fix-all.d.ts +25 -0
  106. package/dist/commands/fix-all.d.ts.map +1 -0
  107. package/dist/commands/fix-all.js +206 -0
  108. package/dist/commands/fix-plan.d.ts +9 -0
  109. package/dist/commands/fix-plan.d.ts.map +1 -1
  110. package/dist/commands/fix-plan.js +152 -89
  111. package/dist/commands/fix.d.ts +17 -0
  112. package/dist/commands/fix.d.ts.map +1 -0
  113. package/dist/commands/fix.js +111 -0
  114. package/dist/commands/init.d.ts +11 -0
  115. package/dist/commands/init.d.ts.map +1 -1
  116. package/dist/commands/init.js +94 -42
  117. package/dist/commands/login.d.ts +18 -0
  118. package/dist/commands/login.d.ts.map +1 -1
  119. package/dist/commands/login.js +268 -95
  120. package/dist/commands/patch-review.d.ts +11 -0
  121. package/dist/commands/patch-review.d.ts.map +1 -1
  122. package/dist/commands/patch-review.js +159 -97
  123. package/dist/commands/policy.d.ts +31 -0
  124. package/dist/commands/policy.d.ts.map +1 -1
  125. package/dist/commands/policy.js +269 -124
  126. package/dist/commands/release-notes.d.ts +10 -0
  127. package/dist/commands/release-notes.d.ts.map +1 -1
  128. package/dist/commands/release-notes.js +127 -73
  129. package/dist/commands/scan.d.ts +13 -0
  130. package/dist/commands/scan.d.ts.map +1 -0
  131. package/dist/commands/scan.js +133 -0
  132. package/dist/commands/status.d.ts +9 -0
  133. package/dist/commands/status.d.ts.map +1 -0
  134. package/dist/commands/status.js +81 -0
  135. package/dist/commands/suggest.d.ts +10 -0
  136. package/dist/commands/suggest.d.ts.map +1 -1
  137. package/dist/commands/suggest.js +153 -82
  138. package/dist/commands/triage.d.ts +35 -0
  139. package/dist/commands/triage.d.ts.map +1 -1
  140. package/dist/commands/triage.js +206 -81
  141. package/dist/commands/upload.d.ts +9 -0
  142. package/dist/commands/upload.d.ts.map +1 -1
  143. package/dist/commands/upload.js +140 -101
  144. package/dist/commands/verify.d.ts +13 -0
  145. package/dist/commands/verify.d.ts.map +1 -0
  146. package/dist/commands/verify.js +118 -0
  147. package/dist/index.d.ts +3 -2
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/index.js +125 -990
  150. package/dist/interactive/fix-wizard.d.ts +3 -0
  151. package/dist/interactive/fix-wizard.d.ts.map +1 -1
  152. package/dist/interactive/fix-wizard.js +130 -112
  153. package/dist/interactive/init-wizard.d.ts +3 -1
  154. package/dist/interactive/init-wizard.d.ts.map +1 -1
  155. package/dist/interactive/init-wizard.js +207 -138
  156. package/dist/interactive/prompts.d.ts +7 -3
  157. package/dist/interactive/prompts.d.ts.map +1 -1
  158. package/dist/interactive/prompts.js +44 -23
  159. package/dist/output/envelope.d.ts +2 -0
  160. package/dist/output/envelope.d.ts.map +1 -1
  161. package/dist/output/envelope.js +18 -2
  162. package/dist/output/factory.d.ts +9 -1
  163. package/dist/output/factory.d.ts.map +1 -1
  164. package/dist/output/html.d.ts +2 -1
  165. package/dist/output/html.d.ts.map +1 -1
  166. package/dist/output/html.js +3 -2
  167. package/dist/output/human.d.ts +9 -1
  168. package/dist/output/human.d.ts.map +1 -1
  169. package/dist/output/human.js +17 -2
  170. package/dist/output/json.d.ts +2 -1
  171. package/dist/output/json.d.ts.map +1 -1
  172. package/dist/output/junit.d.ts +2 -1
  173. package/dist/output/junit.d.ts.map +1 -1
  174. package/dist/output/sarif.d.ts +2 -1
  175. package/dist/output/sarif.d.ts.map +1 -1
  176. package/dist/types.d.ts +74 -0
  177. package/dist/types.d.ts.map +1 -0
  178. package/dist/types.js +5 -0
  179. package/dist/ui/banner.d.ts +34 -0
  180. package/dist/ui/banner.d.ts.map +1 -1
  181. package/dist/ui/banner.js +97 -5
  182. package/dist/ui/diagnostics.d.ts +9 -4
  183. package/dist/ui/diagnostics.d.ts.map +1 -1
  184. package/dist/ui/diagnostics.js +32 -82
  185. package/dist/ui/strings.d.ts +373 -0
  186. package/dist/ui/strings.d.ts.map +1 -0
  187. package/dist/ui/strings.js +499 -0
  188. package/dist/ui/table.d.ts +0 -2
  189. package/dist/ui/table.d.ts.map +1 -1
  190. package/dist/ui/table.js +3 -4
  191. package/dist/utils/api-client.d.ts +46 -0
  192. package/dist/utils/api-client.d.ts.map +1 -0
  193. package/dist/utils/api-client.js +170 -0
  194. package/dist/utils/client.d.ts +29 -18
  195. package/dist/utils/client.d.ts.map +1 -1
  196. package/dist/utils/client.js +102 -12
  197. package/dist/utils/formatters.d.ts +38 -0
  198. package/dist/utils/formatters.d.ts.map +1 -0
  199. package/dist/utils/formatters.js +277 -0
  200. package/dist/utils/local-capture.d.ts +25 -0
  201. package/dist/utils/local-capture.d.ts.map +1 -0
  202. package/dist/utils/local-capture.js +57 -0
  203. package/dist/utils/url-classify.d.ts +18 -0
  204. package/dist/utils/url-classify.d.ts.map +1 -0
  205. package/dist/utils/url-classify.js +106 -0
  206. package/node_modules/@vertaaux/tui/dist/index.cjs +713 -20
  207. package/node_modules/@vertaaux/tui/dist/index.cjs.map +1 -1
  208. package/node_modules/@vertaaux/tui/dist/index.d.cts +361 -4
  209. package/node_modules/@vertaaux/tui/dist/index.d.ts +361 -4
  210. package/node_modules/@vertaaux/tui/dist/index.js +689 -21
  211. package/node_modules/@vertaaux/tui/dist/index.js.map +1 -1
  212. package/package.json +13 -5
  213. package/dist/commands/client.d.ts +0 -14
  214. package/dist/commands/client.d.ts.map +0 -1
  215. package/dist/commands/client.js +0 -362
  216. package/dist/commands/drift.d.ts +0 -15
  217. package/dist/commands/drift.d.ts.map +0 -1
  218. package/dist/commands/drift.js +0 -309
  219. package/dist/commands/protect.d.ts +0 -16
  220. package/dist/commands/protect.d.ts.map +0 -1
  221. package/dist/commands/protect.js +0 -323
  222. package/dist/commands/report.d.ts +0 -15
  223. package/dist/commands/report.d.ts.map +0 -1
  224. package/dist/commands/report.js +0 -214
  225. package/dist/policy/sync.d.ts +0 -67
  226. package/dist/policy/sync.d.ts.map +0 -1
  227. package/dist/policy/sync.js +0 -147
@@ -10,28 +10,28 @@
10
10
  * vertaa suggest "compare two pages"
11
11
  * vertaa suggest "set up CI quality gate"
12
12
  */
13
- import chalk from "chalk";
13
+ import { bold, dim, colorize, boldColor, brand, severity as severityPalette, runSteps, createRenderer, renderWarning, renderError, isCI, isTTY } from "@vertaaux/tui";
14
14
  import { ExitCode } from "../utils/exit-codes.js";
15
15
  import { resolveApiBase, getApiKey, hasApiKey, apiRequest } from "../utils/client.js";
16
16
  import { resolveConfig } from "../config/loader.js";
17
17
  import { writeJsonOutput, writeOutput } from "../output/envelope.js";
18
18
  import { resolveCommandFormat } from "../output/formats.js";
19
- import { createSpinner, succeedSpinner, failSpinner } from "../ui/spinner.js";
20
19
  import { findMatches } from "../prompts/command-catalog.js";
21
20
  import { AI_TIMEOUT_MS } from "../utils/ai-error.js";
21
+ import { strings } from "../ui/strings.js";
22
22
  /**
23
23
  * Format suggestion for human-readable output.
24
24
  */
25
25
  function formatSuggestHuman(results) {
26
26
  const lines = [];
27
27
  for (const result of results) {
28
- lines.push(` ${chalk.cyan.bold("$")} ${chalk.bold(result.command)}`);
29
- lines.push(` ${chalk.dim(result.explanation)}`);
28
+ lines.push(` ${boldColor("$", brand.cyan)} ${bold(result.command)}`);
29
+ lines.push(` ${dim(result.explanation)}`);
30
30
  lines.push("");
31
31
  }
32
32
  if (results.length === 0) {
33
- lines.push(chalk.yellow("No matching commands found."));
34
- lines.push(chalk.dim("Try: vertaa --help"));
33
+ lines.push(colorize("No matching commands found.", severityPalette.warning));
34
+ lines.push(dim("Try: vertaa --help"));
35
35
  }
36
36
  return lines.join("\n");
37
37
  }
@@ -48,6 +48,137 @@ function formatSuggestJson(results) {
48
48
  })),
49
49
  };
50
50
  }
51
+ export async function handleSuggest(opts) {
52
+ const format = resolveCommandFormat("suggest", opts.format, opts.machine || false);
53
+ const config = { apiKey: opts.apiKey };
54
+ const intent = opts.intent;
55
+ // Resolve fail-fast mode: --strict > --continue-on-error > auto-detect
56
+ let failFast;
57
+ if (opts.strict && opts.continueOnError) {
58
+ writeOutput(renderWarning({ message: "--strict and --continue-on-error both set — --strict takes precedence" }));
59
+ failFast = true;
60
+ }
61
+ else if (opts.strict) {
62
+ failFast = true;
63
+ }
64
+ else if (opts.continueOnError) {
65
+ failFast = false;
66
+ }
67
+ else {
68
+ failFast = isCI() || !isTTY();
69
+ }
70
+ let results = [];
71
+ const renderer = createRenderer("auto");
72
+ const baseState = {
73
+ phase: "suggest",
74
+ phaseIndex: 1,
75
+ phaseTotal: 1,
76
+ url: "",
77
+ mode: "suggest",
78
+ progress: {},
79
+ totals: {},
80
+ issueCount: 0,
81
+ scorePreview: null,
82
+ verbose: false,
83
+ elapsed: 0,
84
+ };
85
+ const steps = [
86
+ {
87
+ id: "search",
88
+ actionText: strings.suggest.search.action,
89
+ summaryText: strings.suggest.search.done(0),
90
+ run: async () => {
91
+ // Step 1: Local fuzzy match against command catalog
92
+ const localMatches = findMatches(intent);
93
+ if (localMatches.length > 0 && localMatches[0].score >= 0.2) {
94
+ // Good local matches — use them
95
+ results = localMatches.map((m) => ({
96
+ command: m.entry.command,
97
+ explanation: m.entry.description,
98
+ source: "local",
99
+ confidence: Math.round(m.score * 100),
100
+ }));
101
+ }
102
+ else if (hasApiKey(config)) {
103
+ // No strong local match — try API
104
+ const base = resolveApiBase(opts.base);
105
+ const apiKey = getApiKey(config.apiKey);
106
+ try {
107
+ const response = await Promise.race([
108
+ apiRequest(base, "/cli/ai/suggest", { method: "POST", body: { intent } }, apiKey),
109
+ new Promise((_, reject) => setTimeout(() => reject(new Error("LLM request timed out")), AI_TIMEOUT_MS)),
110
+ ]);
111
+ if (response.data?.suggestions?.length) {
112
+ results = response.data.suggestions.map((s) => ({
113
+ command: s.command,
114
+ explanation: s.explanation,
115
+ source: "api",
116
+ confidence: 80,
117
+ }));
118
+ }
119
+ else {
120
+ results = localMatches.map((m) => ({
121
+ command: m.entry.command,
122
+ explanation: m.entry.description,
123
+ source: "local",
124
+ confidence: Math.round(m.score * 100),
125
+ }));
126
+ }
127
+ }
128
+ catch {
129
+ // API failed — suggest degrades gracefully to local catalog
130
+ writeOutput(strings.suggest.errors.apiUnavailable + "\n");
131
+ results = localMatches.map((m) => ({
132
+ command: m.entry.command,
133
+ explanation: m.entry.description,
134
+ source: "local",
135
+ confidence: Math.round(m.score * 100),
136
+ }));
137
+ }
138
+ }
139
+ else {
140
+ // No API key — use partial local matches
141
+ results = localMatches.map((m) => ({
142
+ command: m.entry.command,
143
+ explanation: m.entry.description,
144
+ source: "local",
145
+ confidence: Math.round(m.score * 100),
146
+ }));
147
+ }
148
+ },
149
+ },
150
+ ];
151
+ const { success, states } = await runSteps(steps, {
152
+ failFast,
153
+ onStateChange: (stepStates) => {
154
+ renderer.update({ ...baseState, stepStates });
155
+ },
156
+ });
157
+ renderer.finish({
158
+ url: "",
159
+ mode: "suggest",
160
+ overallScore: success ? 100 : 0,
161
+ scores: {},
162
+ issueCount: 0,
163
+ passed: success,
164
+ elapsed: 0,
165
+ });
166
+ if (!success) {
167
+ const failedStep = states.find((s) => s.status === "failed");
168
+ process.stderr.write(renderError({
169
+ message: strings.suggest.errors.searchFailed(failedStep?.failReason ?? "unknown error"),
170
+ suggestion: "vertaa --help",
171
+ }) + "\n");
172
+ process.exit(ExitCode.ERROR);
173
+ }
174
+ // Output
175
+ if (format === "json") {
176
+ writeJsonOutput(formatSuggestJson(results), "suggest");
177
+ }
178
+ else {
179
+ writeOutput(formatSuggestHuman(results));
180
+ }
181
+ }
51
182
  /**
52
183
  * Register the suggest command with the Commander program.
53
184
  */
@@ -56,6 +187,8 @@ export function registerSuggestCommand(program) {
56
187
  .command("suggest <intent...>")
57
188
  .description("Convert natural language to exact CLI command(s)")
58
189
  .option("-f, --format <format>", "Output format: json | human")
190
+ .option("--strict", "Fail immediately on first step error")
191
+ .option("--continue-on-error", "Continue on step errors even in CI")
59
192
  .addHelpText("after", `
60
193
  Examples:
61
194
  vertaa suggest "check accessibility"
@@ -68,84 +201,22 @@ Examples:
68
201
  const globalOpts = command.optsWithGlobals();
69
202
  const config = await resolveConfig(globalOpts.config);
70
203
  const machineMode = globalOpts.machine || false;
71
- const format = resolveCommandFormat("suggest", options.format, machineMode);
72
- const intent = intentParts.join(" ");
73
- // Step 1: Local fuzzy match against command catalog
74
- const localMatches = findMatches(intent);
75
- let results;
76
- if (localMatches.length > 0 && localMatches[0].score >= 0.2) {
77
- // Good local matches — use them
78
- results = localMatches.map((m) => ({
79
- command: m.entry.command,
80
- explanation: m.entry.description,
81
- source: "local",
82
- confidence: Math.round(m.score * 100),
83
- }));
84
- }
85
- else if (hasApiKey(config)) {
86
- // No strong local match — try API
87
- const spinner = createSpinner("Thinking...");
88
- try {
89
- const base = resolveApiBase(globalOpts.base);
90
- const apiKey = getApiKey(config.apiKey);
91
- const response = await Promise.race([
92
- apiRequest(base, "/cli/ai/suggest", {
93
- method: "POST",
94
- body: { intent },
95
- }, apiKey),
96
- new Promise((_, reject) => setTimeout(() => reject(new Error("LLM request timed out")), AI_TIMEOUT_MS)),
97
- ]);
98
- succeedSpinner(spinner, "Done");
99
- if (response.data?.suggestions?.length) {
100
- results = response.data.suggestions.map((s) => ({
101
- command: s.command,
102
- explanation: s.explanation,
103
- source: "api",
104
- confidence: 80,
105
- }));
106
- }
107
- else {
108
- // API returned nothing — fall back to partial local matches
109
- results = localMatches.map((m) => ({
110
- command: m.entry.command,
111
- explanation: m.entry.description,
112
- source: "local",
113
- confidence: Math.round(m.score * 100),
114
- }));
115
- }
116
- }
117
- catch (error) {
118
- // Suggest degrades gracefully — fall back to local catalog
119
- // instead of hard exit via handleAiCommandError
120
- failSpinner(spinner, "API unavailable — using local catalog");
121
- // API failed — use whatever local matches we have
122
- results = localMatches.map((m) => ({
123
- command: m.entry.command,
124
- explanation: m.entry.description,
125
- source: "local",
126
- confidence: Math.round(m.score * 100),
127
- }));
128
- }
129
- }
130
- else {
131
- // No API key — use partial local matches
132
- results = localMatches.map((m) => ({
133
- command: m.entry.command,
134
- explanation: m.entry.description,
135
- source: "local",
136
- confidence: Math.round(m.score * 100),
137
- }));
138
- }
139
- // Output
140
- if (format === "json") {
141
- writeJsonOutput(formatSuggestJson(results), "suggest");
142
- }
143
- else {
144
- writeOutput(formatSuggestHuman(results));
145
- }
204
+ await handleSuggest({
205
+ intent: intentParts.join(" "),
206
+ format: options.format,
207
+ strict: options.strict,
208
+ continueOnError: options.continueOnError,
209
+ machine: machineMode,
210
+ base: globalOpts.base,
211
+ apiKey: config.apiKey,
212
+ });
146
213
  }
147
214
  catch (error) {
148
- console.error("Error:", error instanceof Error ? error.message : String(error));
215
+ process.stderr.write(renderError({
216
+ message: error instanceof Error ? error.message : String(error),
217
+ suggestion: "vertaa --help",
218
+ exitCode: ExitCode.ERROR,
219
+ }) + "\n");
149
220
  process.exit(ExitCode.ERROR);
150
221
  }
151
222
  });
@@ -13,5 +13,40 @@
13
13
  * vertaa triage --file audit.json --verbose
14
14
  */
15
15
  import { Command } from "commander";
16
+ import { type ViewportItem } from "@vertaaux/tui";
17
+ interface TriageItem {
18
+ id: string | null;
19
+ title: string;
20
+ reason: string;
21
+ effort: "trivial" | "small" | "medium" | "large";
22
+ }
23
+ interface TriageApiResponse {
24
+ data: {
25
+ p0_critical: TriageItem[];
26
+ p1_important: TriageItem[];
27
+ p2_nice_to_have: TriageItem[];
28
+ quick_wins: string[];
29
+ };
30
+ }
31
+ /**
32
+ * Flatten triage p0/p1/p2 buckets into a ViewportItem array.
33
+ *
34
+ * Order: p0_critical → p1_important → p2_nice_to_have (preserves API order within buckets).
35
+ * Severity mapping: p0 → "critical", p1 → "warning", p2 → "moderate".
36
+ */
37
+ export declare function buildViewportItems(data: TriageApiResponse["data"]): ViewportItem[];
38
+ export interface TriageCommandOptions {
39
+ job?: string;
40
+ file?: string;
41
+ format?: string;
42
+ strict?: boolean;
43
+ continueOnError?: boolean;
44
+ machine?: boolean;
45
+ verbose?: boolean;
46
+ base?: string;
47
+ apiKey?: string;
48
+ }
49
+ export declare function handleTriage(opts: TriageCommandOptions): Promise<void>;
16
50
  export declare function registerTriageCommand(program: Command): void;
51
+ export {};
17
52
  //# sourceMappingURL=triage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../src/commands/triage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuJpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+G5D"}
1
+ {"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../src/commands/triage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAwK,KAAK,YAAY,EAAqC,MAAM,eAAe,CAAC;AAc3P,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CAClD;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE;QACJ,WAAW,EAAE,UAAU,EAAE,CAAC;QAC1B,YAAY,EAAE,UAAU,EAAE,CAAC;QAC3B,eAAe,EAAE,UAAU,EAAE,CAAC;QAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACH;AA0HD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAAG,YAAY,EAAE,CAkClF;AAMD,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwJ5E;AAMD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+C5D"}