@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.
Files changed (248) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/MIGRATION.md +239 -0
  3. package/README.md +62 -17
  4. package/dist/app/interactive-app.d.ts +103 -0
  5. package/dist/app/interactive-app.d.ts.map +1 -0
  6. package/dist/app/interactive-app.js +328 -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 +166 -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 +415 -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 +46 -0
  37. package/dist/auth/ci-token.d.ts +8 -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 +11 -0
  49. package/dist/commands/a11y.d.ts.map +1 -0
  50. package/dist/commands/a11y.js +149 -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 +589 -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 +129 -0
  69. package/dist/commands/audit/policy.d.ts +27 -0
  70. package/dist/commands/audit/policy.d.ts.map +1 -0
  71. package/dist/commands/audit/policy.js +147 -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 +89 -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 -1097
  81. package/dist/commands/baseline.d.ts +2 -0
  82. package/dist/commands/baseline.d.ts.map +1 -1
  83. package/dist/commands/baseline.js +221 -123
  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 +127 -62
  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 +288 -181
  90. package/dist/commands/diff.d.ts +7 -0
  91. package/dist/commands/diff.d.ts.map +1 -1
  92. package/dist/commands/diff.js +181 -143
  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 +135 -77
  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 +166 -19
  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 +242 -156
  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 +154 -90
  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 +263 -92
  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 +160 -98
  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 +270 -125
  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 +128 -74
  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 +180 -83
  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 +207 -82
  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/config/schema.d.ts +4 -0
  148. package/dist/config/schema.d.ts.map +1 -1
  149. package/dist/index.d.ts +3 -2
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +127 -991
  152. package/dist/interactive/fix-wizard.d.ts +3 -0
  153. package/dist/interactive/fix-wizard.d.ts.map +1 -1
  154. package/dist/interactive/fix-wizard.js +130 -112
  155. package/dist/interactive/init-wizard.d.ts +3 -1
  156. package/dist/interactive/init-wizard.d.ts.map +1 -1
  157. package/dist/interactive/init-wizard.js +207 -138
  158. package/dist/interactive/prompts.d.ts +7 -3
  159. package/dist/interactive/prompts.d.ts.map +1 -1
  160. package/dist/interactive/prompts.js +44 -23
  161. package/dist/output/envelope.d.ts +9 -0
  162. package/dist/output/envelope.d.ts.map +1 -1
  163. package/dist/output/envelope.js +37 -3
  164. package/dist/output/factory.d.ts +2 -1
  165. package/dist/output/factory.d.ts.map +1 -1
  166. package/dist/output/html.d.ts +2 -1
  167. package/dist/output/html.d.ts.map +1 -1
  168. package/dist/output/html.js +3 -2
  169. package/dist/output/human.d.ts +2 -1
  170. package/dist/output/human.d.ts.map +1 -1
  171. package/dist/output/human.js +3 -2
  172. package/dist/output/json.d.ts +2 -1
  173. package/dist/output/json.d.ts.map +1 -1
  174. package/dist/output/junit.d.ts +2 -1
  175. package/dist/output/junit.d.ts.map +1 -1
  176. package/dist/output/sarif.d.ts +2 -1
  177. package/dist/output/sarif.d.ts.map +1 -1
  178. package/dist/policy/schema.d.ts +137 -0
  179. package/dist/policy/schema.d.ts.map +1 -1
  180. package/dist/policy/schema.js +107 -0
  181. package/dist/prompts/command-catalog.js +9 -9
  182. package/dist/types.d.ts +74 -0
  183. package/dist/types.d.ts.map +1 -0
  184. package/dist/types.js +5 -0
  185. package/dist/ui/banner.d.ts +34 -0
  186. package/dist/ui/banner.d.ts.map +1 -1
  187. package/dist/ui/banner.js +97 -5
  188. package/dist/ui/diagnostics.d.ts +9 -4
  189. package/dist/ui/diagnostics.d.ts.map +1 -1
  190. package/dist/ui/diagnostics.js +32 -82
  191. package/dist/ui/strings.d.ts +373 -0
  192. package/dist/ui/strings.d.ts.map +1 -0
  193. package/dist/ui/strings.js +499 -0
  194. package/dist/ui/table.d.ts +0 -2
  195. package/dist/ui/table.d.ts.map +1 -1
  196. package/dist/ui/table.js +3 -4
  197. package/dist/utils/api-client.d.ts +46 -0
  198. package/dist/utils/api-client.d.ts.map +1 -0
  199. package/dist/utils/api-client.js +170 -0
  200. package/dist/utils/client.d.ts +29 -18
  201. package/dist/utils/client.d.ts.map +1 -1
  202. package/dist/utils/client.js +104 -12
  203. package/dist/utils/formatters.d.ts +38 -0
  204. package/dist/utils/formatters.d.ts.map +1 -0
  205. package/dist/utils/formatters.js +277 -0
  206. package/dist/utils/root-args.d.ts +12 -0
  207. package/dist/utils/root-args.d.ts.map +1 -0
  208. package/dist/utils/root-args.js +44 -0
  209. package/dist/utils/stdin.d.ts +7 -0
  210. package/dist/utils/stdin.d.ts.map +1 -1
  211. package/dist/utils/stdin.js +32 -2
  212. package/dist/utils/url-classify.d.ts.map +1 -1
  213. package/dist/utils/url-classify.js +24 -3
  214. package/node_modules/@vertaaux/tui/dist/index.cjs +1216 -27
  215. package/node_modules/@vertaaux/tui/dist/index.cjs.map +1 -1
  216. package/node_modules/@vertaaux/tui/dist/index.d.cts +361 -4
  217. package/node_modules/@vertaaux/tui/dist/index.d.ts +361 -4
  218. package/node_modules/@vertaaux/tui/dist/index.js +1189 -27
  219. package/node_modules/@vertaaux/tui/dist/index.js.map +1 -1
  220. package/node_modules/@vertaaux/tui/package.json +2 -3
  221. package/node_modules/chalk/license +9 -0
  222. package/node_modules/chalk/package.json +83 -0
  223. package/node_modules/chalk/readme.md +297 -0
  224. package/node_modules/chalk/source/index.d.ts +325 -0
  225. package/node_modules/chalk/source/index.js +225 -0
  226. package/node_modules/chalk/source/utilities.js +33 -0
  227. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
  228. package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
  229. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
  230. package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
  231. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
  232. package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
  233. package/package.json +20 -5
  234. package/dist/commands/client.d.ts +0 -14
  235. package/dist/commands/client.d.ts.map +0 -1
  236. package/dist/commands/client.js +0 -362
  237. package/dist/commands/drift.d.ts +0 -15
  238. package/dist/commands/drift.d.ts.map +0 -1
  239. package/dist/commands/drift.js +0 -309
  240. package/dist/commands/protect.d.ts +0 -16
  241. package/dist/commands/protect.d.ts.map +0 -1
  242. package/dist/commands/protect.js +0 -323
  243. package/dist/commands/report.d.ts +0 -15
  244. package/dist/commands/report.d.ts.map +0 -1
  245. package/dist/commands/report.js +0 -214
  246. package/dist/policy/sync.d.ts +0 -67
  247. package/dist/policy/sync.d.ts.map +0 -1
  248. package/dist/policy/sync.js +0 -147
@@ -0,0 +1,499 @@
1
+ /**
2
+ * Tone-of-voice catalogue for VertaaUX CLI.
3
+ *
4
+ * Centralizes all user-facing strings for consistent messaging:
5
+ * - Gerund during action, past tense on completion (COPY-02)
6
+ * - Specific error messages with em-dash separator (COPY-03)
7
+ * - Recovery commands in every error (COPY-03)
8
+ * - Success messages include counts when applicable (COPY-04)
9
+ *
10
+ * Usage:
11
+ * import { strings } from "../ui/strings.js";
12
+ * createSpinner(strings.audit.run.action)
13
+ * succeedSpinner(strings.audit.run.done(issueCount, url))
14
+ * process.stderr.write(strings.common.notAuthenticated + "\n")
15
+ */
16
+ // ---------------------------------------------------------------------------
17
+ // Catalogue
18
+ // ---------------------------------------------------------------------------
19
+ export const strings = {
20
+ // ── Common ───────────────────────────────────────────────────────────────
21
+ common: {
22
+ /** Not authenticated error shown before any API command */
23
+ notAuthenticated: "Not authenticated — your credentials are missing or expired.\nRun vertaa login to authenticate.",
24
+ /** Invalid or expired token */
25
+ invalidToken: "Token invalid or expired — the stored credentials cannot be used.\nRun vertaa login to refresh your credentials.",
26
+ /** Network unreachable error */
27
+ networkError: "Network unreachable — the VertaaUX API could not be reached.\nRun vertaa doctor to diagnose connectivity.",
28
+ /** Config invalid error */
29
+ configInvalid: "Configuration invalid — .vertaaux.yml contains errors.\nRun vertaa doctor to validate your configuration.",
30
+ /** Generic API error fallback */
31
+ apiError: (code) => `API request failed — the server returned error ${code}.\nRun vertaa doctor to check connectivity and credentials.`,
32
+ /** Rate limit exceeded */
33
+ rateLimitExceeded: "Rate limit exceeded — you have reached the maximum request rate.\nRun vertaa status to check your quota and wait before retrying.",
34
+ /** Permission denied */
35
+ permissionDenied: "Permission denied — your account does not have access to this resource.\nRun vertaa doctor to verify your credentials and plan.",
36
+ },
37
+ // ── Audit ─────────────────────────────────────────────────────────────────
38
+ audit: {
39
+ /** Running the audit */
40
+ run: {
41
+ action: "Running audit...",
42
+ done: (issueCount, url) => `Audited ${url} — found ${issueCount} issue${issueCount === 1 ? "" : "s"}`,
43
+ },
44
+ /** Waiting for audit to complete */
45
+ wait: {
46
+ action: "Waiting for audit to complete...",
47
+ done: (issueCount) => `Audit complete — ${issueCount} issue${issueCount === 1 ? "" : "s"} found`,
48
+ },
49
+ /** Local URL capture */
50
+ localCapture: "Local URL detected — capturing page locally...",
51
+ /** Incremental mode */
52
+ incremental: (routeCount) => `Incremental mode — auditing ${routeCount} changed route${routeCount === 1 ? "" : "s"}`,
53
+ /** No route changes */
54
+ noRouteChanges: "No relevant route changes detected — skipping audit.",
55
+ /** Local page fetch in progress */
56
+ localFetch: {
57
+ action: "Fetching local page...",
58
+ done: () => "Local page fetched",
59
+ },
60
+ /** Analyzing captured local page */
61
+ localAnalyze: {
62
+ action: "Analyzing captured page...",
63
+ done: () => "Page analysis complete",
64
+ },
65
+ /** Progress update with URL */
66
+ progress: (url) => `Auditing ${url}`,
67
+ errors: {
68
+ /** All workspaces flag not yet implemented */
69
+ allWorkspacesNotImplemented: "--all-workspaces is not yet implemented — this feature is coming soon.\nRun vertaa audit <url> to audit individual workspace URLs.",
70
+ /** Audit job failed */
71
+ jobFailed: (jobId) => `Audit job failed — job ${jobId} did not complete successfully.\nRun vertaa doctor to check API connectivity.`,
72
+ },
73
+ },
74
+ // ── Upload ────────────────────────────────────────────────────────────────
75
+ upload: {
76
+ /** Uploading artifacts */
77
+ run: {
78
+ action: "Uploading audit results...",
79
+ done: (count) => `Uploaded ${count} artifact${count === 1 ? "" : "s"} to VertaaUX cloud`,
80
+ },
81
+ noJobId: "No job ID provided and no local results found.\nRun vertaa audit --save-trace to save local results first.",
82
+ shareUrl: "Share this URL with your team to view the results.",
83
+ errors: {
84
+ notAuthenticated: "Not authenticated — upload requires valid credentials.\nRun vertaa login to authenticate.",
85
+ uploadFailed: (reason) => `Upload failed — ${reason}.\nRun vertaa doctor to diagnose the issue.`,
86
+ },
87
+ success: (url) => `Uploaded results for: ${url}`,
88
+ },
89
+ // ── Login / Auth ──────────────────────────────────────────────────────────
90
+ login: {
91
+ /** Device flow in progress */
92
+ deviceFlow: {
93
+ action: "Starting device authentication flow...",
94
+ done: () => "Authentication successful",
95
+ },
96
+ /** Token validation */
97
+ validating: {
98
+ action: "Validating token...",
99
+ done: () => "Token validated",
100
+ },
101
+ success: "Authentication successful",
102
+ successWithName: (displayName) => `Authenticated as ${displayName}`,
103
+ logoutSuccess: "Logged out successfully.",
104
+ ssoNotImplemented: "SSO login is not yet implemented.\nUse --token for CI/API token authentication or omit flags for device code flow.",
105
+ validatingToken: "Validating token...",
106
+ tokenSaved: "Token saved to ~/.vertaaux/credentials.json",
107
+ envTokenFound: "Found token in environment, validating...",
108
+ envTokenSaved: "Token from environment saved to ~/.vertaaux/credentials.json",
109
+ startingAuth: "Starting authentication...",
110
+ noStoredCredentials: "No stored credentials found.",
111
+ credentialsRemoved: "Credentials removed from ~/.vertaaux/credentials.json",
112
+ runLoginHint: "\nRun vertaa login to authenticate.",
113
+ runLoginRefreshHint: "\nRun vertaa login to re-authenticate.",
114
+ errors: {
115
+ invalidToken: "Token invalid — the provided token could not be verified.\nRun vertaa login to authenticate with a valid token.",
116
+ envTokenInvalid: "Environment token invalid — VERTAAUX_API_KEY could not be verified.\nSet VERTAAUX_API_KEY to a valid API key to proceed.",
117
+ requiresTerminal: "Interactive login requires a terminal — no TTY detected.\nSet VERTAAUX_API_KEY environment variable for non-interactive authentication.",
118
+ loginFailed: (message) => `Login failed — ${message}.\nRun vertaa login to try again.`,
119
+ },
120
+ notAuthenticated: "Not authenticated.",
121
+ tokenExpired: "Token expired.",
122
+ tokenInvalidOrExpired: "Token invalid or expired.",
123
+ },
124
+ // ── Doctor ────────────────────────────────────────────────────────────────
125
+ doctor: {
126
+ /** Running all checks */
127
+ run: {
128
+ action: "Running diagnostics...",
129
+ done: (passCount, failCount) => `Diagnostics complete — ${passCount} passed, ${failCount} failed`,
130
+ },
131
+ title: (version) => `VertaaUX Doctor v${version}`,
132
+ results: {
133
+ allPassed: (count) => `All ${count} checks passed.`,
134
+ withWarnings: (count) => `All checks passed (${count} warning${count === 1 ? "" : "s"}).`,
135
+ withFailures: (failCount, total) => `${failCount} of ${total} check${failCount === 1 ? "" : "s"} failed.`,
136
+ },
137
+ checks: {
138
+ fix: "Fix:",
139
+ detail: "Detail:",
140
+ },
141
+ },
142
+ // ── Init ──────────────────────────────────────────────────────────────────
143
+ init: {
144
+ /** Writing config file */
145
+ run: {
146
+ action: "Initializing project...",
147
+ done: () => "Project initialized",
148
+ },
149
+ configExists: (path) => `Configuration file ${path} already exists — use --force to overwrite.`,
150
+ configCreated: (path) => `Created ${path}`,
151
+ templateCreated: (path) => `Created ${path}`,
152
+ templateNote: (instructions) => `Note: ${instructions}`,
153
+ success: "VertaaUX initialized successfully!",
154
+ cancelled: "Initialization cancelled.",
155
+ nextStepsHeader: "Next steps:",
156
+ nextSteps: {
157
+ runAudit: "Run your first audit with: vertaa audit <url>",
158
+ addGithubSecret: "Add VERTAAUX_API_KEY to GitHub Secrets",
159
+ addCISecret: "Add VERTAAUX_API_KEY to your CI environment",
160
+ createBaseline: "Create baseline for existing issues: vertaa baseline create",
161
+ },
162
+ errors: {
163
+ writeConfigFailed: (path, reason) => `Config write failed — could not create ${path}: ${reason}.\nCheck write permissions and try again.`,
164
+ },
165
+ },
166
+ // ── Baseline ─────────────────────────────────────────────────────────────
167
+ baseline: {
168
+ /** Creating baseline */
169
+ create: {
170
+ action: "Creating baseline...",
171
+ done: (issueCount) => `Created baseline with ${issueCount} issue${issueCount === 1 ? "" : "s"}`,
172
+ },
173
+ /** Listing baseline */
174
+ list: {
175
+ action: "Loading baseline...",
176
+ done: (issueCount) => `Baseline contains ${issueCount} issue${issueCount === 1 ? "" : "s"}`,
177
+ },
178
+ errors: {
179
+ loadFailed: (path) => `Baseline load failed — could not read ${path}.\nRun vertaa baseline create to initialize a baseline.`,
180
+ saveFailed: (reason) => `Baseline save failed — ${reason}.\nCheck write permissions and try again.`,
181
+ auditNotFound: (jobId) => `Audit not found — job ${jobId} does not exist or is still in progress.\nRun vertaa status ${jobId} to check audit status.`,
182
+ },
183
+ },
184
+ // ── Comment ───────────────────────────────────────────────────────────────
185
+ comment: {
186
+ /** Generating comment */
187
+ generate: {
188
+ action: "Generating PR comment...",
189
+ done: (issueCount) => `Generated comment with ${issueCount} issue${issueCount === 1 ? "" : "s"}`,
190
+ },
191
+ /** Posting comment */
192
+ post: {
193
+ action: "Posting comment...",
194
+ done: () => "Comment posted successfully",
195
+ },
196
+ errors: {
197
+ noInput: "No audit input provided — pipe JSON or specify --input.\nRun vertaa audit <url> --json | vertaa comment to generate a comment.",
198
+ postFailed: (reason) => `Comment post failed — ${reason}.\nRun vertaa comment --help to see posting options.`,
199
+ },
200
+ },
201
+ // ── Compare ───────────────────────────────────────────────────────────────
202
+ compare: {
203
+ /** Running comparison */
204
+ run: {
205
+ action: "Comparing audits...",
206
+ done: (deltaCount) => `Compared — ${Math.abs(deltaCount)} issue${Math.abs(deltaCount) === 1 ? "" : "s"} ${deltaCount >= 0 ? "improved" : "regressed"}`,
207
+ },
208
+ /** LLM analysis */
209
+ analyze: {
210
+ action: "Analyzing changes...",
211
+ done: () => "Analysis complete",
212
+ },
213
+ /** Running audit A */
214
+ auditA: {
215
+ action: "Running audit A...",
216
+ done: () => "Audit A complete",
217
+ },
218
+ /** Running audit B */
219
+ auditB: {
220
+ action: "Running audit B...",
221
+ done: () => "Audit B complete",
222
+ },
223
+ headings: {
224
+ comparison: "Audit Comparison",
225
+ overallScores: "Overall Scores",
226
+ categoryScores: "Category Scores",
227
+ issueCounts: "Issue Counts",
228
+ analysis: "Analysis",
229
+ improvements: (count) => `Improvements (${count})`,
230
+ regressions: (count) => `Regressions (${count})`,
231
+ unchanged: (count) => `Unchanged: ${count}`,
232
+ },
233
+ errors: {
234
+ bothUrlsRequired: "Both URLs required — provide two URLs to compare.\nRun vertaa compare <url-a> <url-b> to compare two pages.",
235
+ inputRequired: "No input provided — pipe diff JSON or specify --before/--after.\nRun vertaa diff --job-a <id> --job-b <id> --json | vertaa compare to compare audits.",
236
+ missingJobIds: "Missing job IDs — comparison requires two audit job IDs.\nRun vertaa compare --help to see usage.",
237
+ urlsOrFilesRequired: "Both URLs or both files required — provide two URLs or use --before/--after.\nUsage:\n vertaa compare https://a.com https://b.com --wait\n vertaa compare --before baseline.json --after current.json\nRun vertaa compare --help to see all options.",
238
+ beforeAfterRequired: "Both files required — --before and --after are required for file-based comparison.\nRun vertaa compare --before <file> --after <file>.",
239
+ readFailed: "Could not read audit files — check that the paths are correct.\nRun vertaa compare --help to see file input options.",
240
+ },
241
+ },
242
+ // ── Diff ──────────────────────────────────────────────────────────────────
243
+ diff: {
244
+ /** Computing diff */
245
+ run: {
246
+ action: "Computing diff...",
247
+ done: (newCount, fixedCount) => `Diff complete — ${newCount} new, ${fixedCount} fixed`,
248
+ },
249
+ errors: {
250
+ noBaseline: "No baseline found — create a baseline before diffing.\nRun vertaa baseline create to create a baseline.",
251
+ auditNotFound: (jobId) => `Audit not found — job ${jobId} does not exist.\nRun vertaa audit <url> --wait to run a new audit.`,
252
+ },
253
+ },
254
+ // ── Doc ───────────────────────────────────────────────────────────────────
255
+ doc: {
256
+ /** Generating playbook */
257
+ generate: {
258
+ action: "Generating team playbook...",
259
+ done: (sectionCount) => `Generated playbook with ${sectionCount} section${sectionCount === 1 ? "" : "s"}`,
260
+ },
261
+ errors: {
262
+ noInput: "No audit input provided — pipe JSON or specify --file or --job.\nRun vertaa audit <url> --json | vertaa doc to generate a playbook.",
263
+ generationFailed: (reason) => `Playbook generation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
264
+ },
265
+ },
266
+ // ── Download ──────────────────────────────────────────────────────────────
267
+ download: {
268
+ /** Downloading artifacts */
269
+ run: {
270
+ action: "Downloading audit results...",
271
+ done: (count) => `Downloaded ${count} artifact${count === 1 ? "" : "s"}`,
272
+ },
273
+ /** Listing available audits */
274
+ list: {
275
+ action: "Fetching audit list...",
276
+ done: (count) => `Found ${count} audit${count === 1 ? "" : "s"}`,
277
+ },
278
+ /** Saving files */
279
+ saving: {
280
+ action: "Saving files...",
281
+ done: (count) => `Saved ${count} file${count === 1 ? "" : "s"}`,
282
+ },
283
+ /** Overwrite confirmation */
284
+ confirmOverwrite: (path) => `File ${path} already exists. Overwrite?`,
285
+ skipAuditResults: "Skipping audit results (file exists).",
286
+ skipAuditResultsWarn: (path) => `Skipping ${path} (already exists, use --force to overwrite)`,
287
+ skipBaseline: "Skipping baseline (file exists).",
288
+ skipBaselineWarn: "Skipping baseline (already exists, use --force to overwrite)",
289
+ pathTraversal: (filename) => `Security: Rejected artifact "${filename}" — path traversal outside output directory.`,
290
+ errors: {
291
+ notAuthenticated: "Not authenticated — download requires valid credentials.\nRun vertaa login to authenticate.",
292
+ downloadFailed: (reason) => `Download failed — ${reason}.\nRun vertaa doctor to diagnose the issue.`,
293
+ },
294
+ },
295
+ // ── Explain ───────────────────────────────────────────────────────────────
296
+ explain: {
297
+ /** Loading explanation */
298
+ run: {
299
+ action: "Generating explanation...",
300
+ done: (issueCount) => `Explained ${issueCount} issue${issueCount === 1 ? "" : "s"}`,
301
+ },
302
+ headings: {
303
+ aiExplanation: "AI Explanation",
304
+ summary: "Summary",
305
+ issues: "Issues",
306
+ issue: (ruleId, severity) => `ISSUE: ${ruleId} (${severity})`,
307
+ description: "DESCRIPTION",
308
+ selector: "SELECTOR",
309
+ wcag: "WCAG REFERENCE",
310
+ recommendation: "RECOMMENDATION",
311
+ evidence: "EVIDENCE",
312
+ fix: "Fix:",
313
+ },
314
+ errors: {
315
+ noInput: "No audit input provided — pipe JSON or specify --file or --job.\nRun vertaa audit <url> --json | vertaa explain to explain issues.",
316
+ issueNotFound: (id) => `Issue not found — finding ${id} does not exist in the audit results.\nRun vertaa audit <url> --json to get current issue IDs.`,
317
+ explanationFailed: (reason) => `Explanation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
318
+ fileNotFound: (path) => `File not found — ${path} does not exist.\nCheck the path and try again.`,
319
+ noRecentAudits: "No recent audits found — provide --job or --file option.\nRun vertaa audit <url> --json | vertaa explain to explain issues.",
320
+ findingNotFound: (id, source) => `Finding "${id}" not found${source ? ` in ${source}` : ""}.\nRun vertaa audit <url> --json to get current issue IDs.`,
321
+ noAuditData: "No audit data provided — pipe JSON or specify --file or --job.\nRun vertaa audit https://example.com --json | vertaa explain to get started.",
322
+ noIssuesFound: "No issues found — the audit data contains no reported issues.\nRun vertaa audit <url> to generate a fresh audit.",
323
+ },
324
+ aiUnavailable: (reason) => `AI explanation unavailable — ${reason}.`,
325
+ },
326
+ // ── Fix Plan ──────────────────────────────────────────────────────────────
327
+ fixPlan: {
328
+ /** Generating fix plan */
329
+ generate: {
330
+ action: "Generating remediation plan...",
331
+ done: (itemCount) => `Generated plan with ${itemCount} fix item${itemCount === 1 ? "" : "s"}`,
332
+ },
333
+ summary: (itemCount, totalEffort) => `Remediation Plan (${itemCount} item${itemCount === 1 ? "" : "s"}) — estimated effort: ${totalEffort}`,
334
+ errors: {
335
+ noInput: "No audit input provided — pipe JSON or specify --file or --job.\nRun vertaa audit <url> --json | vertaa fix-plan to generate a plan.",
336
+ planFailed: (reason) => `Fix plan generation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
337
+ },
338
+ labels: {
339
+ effort: "Effort:",
340
+ type: "Type:",
341
+ hint: "Hint:",
342
+ },
343
+ },
344
+ // ── Fix ───────────────────────────────────────────────────────────────────
345
+ fix: {
346
+ /** Generating patch */
347
+ generate: {
348
+ action: "Generating patch...",
349
+ done: () => "Patch generated",
350
+ },
351
+ dryRun: "Showing patch preview — no changes applied.",
352
+ errors: {
353
+ missingArgs: "Missing required arguments — fix requires --file-content.\nRun vertaa fix --help to see all required options.",
354
+ patchFailed: (reason) => `Patch generation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
355
+ },
356
+ },
357
+ // ── Fix All ───────────────────────────────────────────────────────────────
358
+ fixAll: {
359
+ /** Fetching audit for batch fix */
360
+ fetchAudit: {
361
+ action: "Fetching audit...",
362
+ done: (issueCount) => `Fetched audit — ${issueCount} issue${issueCount === 1 ? "" : "s"} to process`,
363
+ },
364
+ /** Generating patches */
365
+ generate: {
366
+ action: "Generating patches...",
367
+ done: (patchCount) => `Generated ${patchCount} patch${patchCount === 1 ? "" : "es"}`,
368
+ },
369
+ auditIncomplete: (jobId, status) => `Audit ${jobId} is not complete — current status: ${status}`,
370
+ errors: {
371
+ missingArgs: "Missing required arguments — fix-all requires --file-content.\nRun vertaa fix-all --help to see all required options.",
372
+ patchFailed: (reason) => `Batch patch generation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
373
+ },
374
+ },
375
+ // ── Patch Review ─────────────────────────────────────────────────────────
376
+ patchReview: {
377
+ /** Analyzing patch */
378
+ analyze: {
379
+ action: "Analyzing patch...",
380
+ done: (verdict) => `Analysis complete — verdict: ${verdict}`,
381
+ },
382
+ dryRun: "Would analyze diff against findings",
383
+ headings: {
384
+ concerns: "Concerns:",
385
+ findingsAddressed: (count) => `Findings addressed (${count}):`,
386
+ findingsRemaining: (count) => `Findings remaining (${count}):`,
387
+ },
388
+ errors: {
389
+ noInput: "No diff input provided — pipe a diff via stdin.\nRun vertaa patch-review --help to see input options.",
390
+ reviewFailed: (reason) => `Patch review failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
391
+ },
392
+ },
393
+ // ── Policy ────────────────────────────────────────────────────────────────
394
+ policy: {
395
+ /** Validating policy */
396
+ validate: {
397
+ action: "Validating policy...",
398
+ done: () => "Policy validated",
399
+ },
400
+ fileExists: (path) => `Policy file already exists — ${path}. Use --force to overwrite.`,
401
+ unknownTemplate: (template, available) => `Unknown template — '${template}' is not a valid policy template.\nAvailable templates: ${available}`,
402
+ created: (path, template) => `Created policy file: ${path} (template: ${template})`,
403
+ noPolicy: "No policy file found — using defaults.",
404
+ noPolicyHint: "Create a policy file with: vertaa policy init",
405
+ valid: (path) => `Policy file valid: ${path}`,
406
+ usingPolicy: (path, branchInfo) => `Policy: ${path}${branchInfo}`,
407
+ usingDefault: (branchInfo) => `Using default policy${branchInfo}`,
408
+ errors: {
409
+ validationFailed: "Policy validation failed — the policy file contains errors.\nRun vertaa policy validate to see detailed validation results.",
410
+ loadFailed: (message) => `Policy load failed — ${message}.\nRun vertaa policy validate to diagnose policy issues.`,
411
+ },
412
+ },
413
+ // ── Release Notes ─────────────────────────────────────────────────────────
414
+ releaseNotes: {
415
+ /** Generating release notes */
416
+ generate: {
417
+ action: "Generating release notes...",
418
+ done: () => "Release notes generated",
419
+ },
420
+ errors: {
421
+ noInput: "No diff input provided — pipe diff JSON or specify --file.\nRun vertaa diff --json | vertaa release-notes to generate notes.",
422
+ generationFailed: (reason) => `Release notes generation failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
423
+ },
424
+ },
425
+ // ── Scan ──────────────────────────────────────────────────────────────────
426
+ scan: {
427
+ /** Running scan (alias for audit) */
428
+ run: {
429
+ action: "Scanning...",
430
+ done: (issueCount, url) => `Scanned ${url} — ${issueCount} issue${issueCount === 1 ? "" : "s"} found`,
431
+ },
432
+ errors: {
433
+ scanFailed: (reason) => `Scan failed — ${reason}.\nRun vertaa doctor to diagnose the issue.`,
434
+ },
435
+ },
436
+ // ── Status ────────────────────────────────────────────────────────────────
437
+ status: {
438
+ /** Fetching job status */
439
+ fetch: {
440
+ action: "Fetching audit status...",
441
+ done: (status) => `Status: ${status}`,
442
+ },
443
+ errors: {
444
+ jobNotFound: (jobId) => `Job not found — ${jobId} does not exist.\nRun vertaa audit <url> to start a new audit.`,
445
+ fetchFailed: (reason) => `Status fetch failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
446
+ },
447
+ },
448
+ // ── Suggest ───────────────────────────────────────────────────────────────
449
+ suggest: {
450
+ /** Finding command suggestions */
451
+ search: {
452
+ action: "Finding matching commands...",
453
+ done: (count) => `Found ${count} matching command${count === 1 ? "" : "s"}`,
454
+ },
455
+ noMatches: "No matching commands found.",
456
+ noMatchesHint: "Run vertaa --help to see all commands.",
457
+ errors: {
458
+ noQuery: "No query provided — describe what you want to do.\nRun vertaa suggest \"check color contrast\" to get command suggestions.",
459
+ searchFailed: (reason) => `Command search failed — ${reason}.\nRun vertaa --help to browse available commands.`,
460
+ apiUnavailable: "API unavailable — using local catalog.\nRun vertaa doctor to check API connectivity.",
461
+ },
462
+ },
463
+ // ── Triage ────────────────────────────────────────────────────────────────
464
+ triage: {
465
+ /** Triaging issues */
466
+ run: {
467
+ action: "Triaging issues...",
468
+ done: (p0Count, p1Count, p2Count) => `Triage complete — ${p0Count} critical, ${p1Count} high, ${p2Count} medium`,
469
+ },
470
+ errors: {
471
+ noInput: "No audit input provided — pipe JSON or specify --file or --job.\nRun vertaa audit <url> --json | vertaa triage to triage issues.",
472
+ triageFailed: (reason) => `Triage failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
473
+ },
474
+ },
475
+ // ── Verify ────────────────────────────────────────────────────────────────
476
+ verify: {
477
+ /** Running verification */
478
+ run: {
479
+ action: "Verifying fix...",
480
+ done: (passed) => passed ? "Verification passed — fix is effective" : "Verification failed — issue still present",
481
+ },
482
+ dryRun: "Showing verification preview — no changes applied.",
483
+ errors: {
484
+ missingArgs: "Missing required arguments — verify requires --search, --replace, --issue, --url, and --selector.\nRun vertaa verify --help to see all required options.",
485
+ verifyFailed: (reason) => `Verification failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
486
+ },
487
+ },
488
+ // ── A11y ──────────────────────────────────────────────────────────────────
489
+ a11y: {
490
+ /** Running accessibility audit */
491
+ run: {
492
+ action: "Running accessibility audit...",
493
+ done: (issueCount, url) => `Audited ${url} — ${issueCount} accessibility issue${issueCount === 1 ? "" : "s"} found`,
494
+ },
495
+ errors: {
496
+ auditFailed: (reason) => `Accessibility audit failed — ${reason}.\nRun vertaa doctor to check API connectivity.`,
497
+ },
498
+ },
499
+ };
@@ -14,8 +14,6 @@ export interface Issue {
14
14
  wcag_reference?: string;
15
15
  }
16
16
  export interface FormatTableOptions {
17
- /** Maximum width for description column */
18
- maxDescriptionWidth?: number;
19
17
  /** Maximum width for selector column */
20
18
  maxSelectorWidth?: number;
21
19
  /** Whether to show the selector column */
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/ui/table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAaD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CASrE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CASrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAuCR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,CA2BlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA4B1D"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/ui/table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAaD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CASrE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CASrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAqCR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,CA2BlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA4B1D"}
package/dist/ui/table.js CHANGED
@@ -51,12 +51,12 @@ export function formatIssuesTable(issues, options = {}) {
51
51
  ? text.success("No issues found.")
52
52
  : "No issues found.";
53
53
  }
54
- const { maxDescriptionWidth = 50, maxSelectorWidth = 30, showSelector = true, showCategory = false, } = options;
54
+ const { maxSelectorWidth = 30, showSelector = false, showCategory = false, } = options;
55
55
  const sorted = sortBySeverity(issues);
56
+ // Description gets remaining width — no fixed truncation
56
57
  const columns = [
57
58
  { key: "severity", label: "Severity", width: 10, color: (val) => text.severityBadge(val) },
58
- { key: "id", label: "ID", width: 20 },
59
- { key: "description", label: "Description", width: maxDescriptionWidth },
59
+ { key: "description", label: "Description" },
60
60
  ];
61
61
  if (showCategory) {
62
62
  columns.push({ key: "category", label: "Category", width: 15 });
@@ -66,7 +66,6 @@ export function formatIssuesTable(issues, options = {}) {
66
66
  }
67
67
  const rows = sorted.map((issue) => ({
68
68
  severity: issue.severity?.toLowerCase() || "info",
69
- id: issue.id || "-",
70
69
  description: issue.description || issue.title || "-",
71
70
  category: issue.category || "-",
72
71
  selector: issue.selector || "-",
@@ -0,0 +1,46 @@
1
+ /**
2
+ * API client utilities for the VertaaUX CLI legacy commands.
3
+ * Provides argument parsing helpers, API request function, and polling utilities.
4
+ *
5
+ * NOTE: resolveApiBase, getApiKey, sleep, apiRequest, and waitForAudit are
6
+ * now imported from ./client to avoid duplication. The legacy DEFAULT_API_BASE
7
+ * (which had a wrong path) is replaced by the corrected value in client.ts.
8
+ */
9
+ import type { Flags } from "../types.js";
10
+ import type { Audit } from "@vertaaux/sdk";
11
+ import { sleep, createClient } from "./client.js";
12
+ export type { Audit as AuditResponse };
13
+ export { sleep, createClient };
14
+ /**
15
+ * Legacy 3-arg apiRequest wrapper for legacy commands that don't pass apiKey
16
+ * explicitly (they rely on VERTAAUX_API_KEY from environment).
17
+ * Delegates to client.ts apiRequest with the key resolved internally.
18
+ */
19
+ export declare function apiRequest<T>(base: string, reqPath: string, options: {
20
+ method: string;
21
+ body?: unknown;
22
+ }): Promise<T>;
23
+ /**
24
+ * Legacy waitForAudit wrapper that accepts base/jobId/timeout/interval (no apiKey param).
25
+ * Delegates to client.ts waitForAudit with key resolved internally.
26
+ */
27
+ export declare function waitForAudit(base: string, jobId: string, timeoutMs: number, intervalMs: number): Promise<Audit>;
28
+ export declare function parseArgs(args: string[]): {
29
+ positional: string[];
30
+ flags: Flags;
31
+ };
32
+ export declare function getString(flags: Flags, key: string): string | undefined;
33
+ export declare function getBool(flags: Flags, key: string): boolean;
34
+ export declare function getNumber(flags: Flags, key: string): number | undefined;
35
+ export declare function resolveFormat(flags: Flags): "json" | "md";
36
+ /**
37
+ * Resolve API base URL for legacy commands that pass Flags objects.
38
+ * Delegates to client.ts resolveApiBase with the corrected default base URL.
39
+ */
40
+ export declare function resolveApiBase(flags: Flags): string;
41
+ /**
42
+ * Get API key for legacy commands.
43
+ * Delegates to client.ts getApiKey.
44
+ */
45
+ export declare function getApiKey(): string;
46
+ //# sourceMappingURL=api-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/utils/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAGL,KAAK,EAGL,YAAY,EAEb,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,KAAK,IAAI,aAAa,EAAE,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AAE/B;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1C,OAAO,CAAC,CAAC,CAAC,CAGZ;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,KAAK,CAAC,CAGhB;AAMD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE;;;EA8EvC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUvE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAM1D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQvE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAMzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAGnD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC"}