@cisco_open/linting-orchestrator 1.0.0-rc.4

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 (197) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +43 -0
  4. package/build/cli/api-client.d.ts +170 -0
  5. package/build/cli/api-client.d.ts.map +1 -0
  6. package/build/cli/api-client.js +284 -0
  7. package/build/cli/api-client.js.map +1 -0
  8. package/build/cli/commands/agents.d.ts +7 -0
  9. package/build/cli/commands/agents.d.ts.map +1 -0
  10. package/build/cli/commands/agents.js +694 -0
  11. package/build/cli/commands/agents.js.map +1 -0
  12. package/build/cli/commands/completion.d.ts +9 -0
  13. package/build/cli/commands/completion.d.ts.map +1 -0
  14. package/build/cli/commands/completion.js +177 -0
  15. package/build/cli/commands/completion.js.map +1 -0
  16. package/build/cli/commands/config.d.ts +10 -0
  17. package/build/cli/commands/config.d.ts.map +1 -0
  18. package/build/cli/commands/config.js +284 -0
  19. package/build/cli/commands/config.js.map +1 -0
  20. package/build/cli/commands/health.d.ts +11 -0
  21. package/build/cli/commands/health.d.ts.map +1 -0
  22. package/build/cli/commands/health.js +38 -0
  23. package/build/cli/commands/health.js.map +1 -0
  24. package/build/cli/commands/help.d.ts +6 -0
  25. package/build/cli/commands/help.d.ts.map +1 -0
  26. package/build/cli/commands/help.js +20 -0
  27. package/build/cli/commands/help.js.map +1 -0
  28. package/build/cli/commands/history.d.ts +11 -0
  29. package/build/cli/commands/history.d.ts.map +1 -0
  30. package/build/cli/commands/history.js +50 -0
  31. package/build/cli/commands/history.js.map +1 -0
  32. package/build/cli/commands/jobs.d.ts +12 -0
  33. package/build/cli/commands/jobs.d.ts.map +1 -0
  34. package/build/cli/commands/jobs.js +84 -0
  35. package/build/cli/commands/jobs.js.map +1 -0
  36. package/build/cli/commands/lint.d.ts +15 -0
  37. package/build/cli/commands/lint.d.ts.map +1 -0
  38. package/build/cli/commands/lint.js +384 -0
  39. package/build/cli/commands/lint.js.map +1 -0
  40. package/build/cli/commands/ps.d.ts +8 -0
  41. package/build/cli/commands/ps.d.ts.map +1 -0
  42. package/build/cli/commands/ps.js +74 -0
  43. package/build/cli/commands/ps.js.map +1 -0
  44. package/build/cli/commands/reproduce.d.ts +9 -0
  45. package/build/cli/commands/reproduce.d.ts.map +1 -0
  46. package/build/cli/commands/reproduce.js +31 -0
  47. package/build/cli/commands/reproduce.js.map +1 -0
  48. package/build/cli/commands/reset.d.ts +5 -0
  49. package/build/cli/commands/reset.d.ts.map +1 -0
  50. package/build/cli/commands/reset.js +13 -0
  51. package/build/cli/commands/reset.js.map +1 -0
  52. package/build/cli/commands/results.d.ts +13 -0
  53. package/build/cli/commands/results.d.ts.map +1 -0
  54. package/build/cli/commands/results.js +129 -0
  55. package/build/cli/commands/results.js.map +1 -0
  56. package/build/cli/commands/rulesets/check.d.ts +12 -0
  57. package/build/cli/commands/rulesets/check.d.ts.map +1 -0
  58. package/build/cli/commands/rulesets/check.js +226 -0
  59. package/build/cli/commands/rulesets/check.js.map +1 -0
  60. package/build/cli/commands/rulesets/index.d.ts +5 -0
  61. package/build/cli/commands/rulesets/index.d.ts.map +1 -0
  62. package/build/cli/commands/rulesets/index.js +6 -0
  63. package/build/cli/commands/rulesets/index.js.map +1 -0
  64. package/build/cli/commands/rulesets/view.d.ts +16 -0
  65. package/build/cli/commands/rulesets/view.d.ts.map +1 -0
  66. package/build/cli/commands/rulesets/view.js +100 -0
  67. package/build/cli/commands/rulesets/view.js.map +1 -0
  68. package/build/cli/commands/start.d.ts +16 -0
  69. package/build/cli/commands/start.d.ts.map +1 -0
  70. package/build/cli/commands/start.js +167 -0
  71. package/build/cli/commands/start.js.map +1 -0
  72. package/build/cli/commands/status.d.ts +9 -0
  73. package/build/cli/commands/status.d.ts.map +1 -0
  74. package/build/cli/commands/status.js +46 -0
  75. package/build/cli/commands/status.js.map +1 -0
  76. package/build/cli/commands/stop.d.ts +11 -0
  77. package/build/cli/commands/stop.d.ts.map +1 -0
  78. package/build/cli/commands/stop.js +78 -0
  79. package/build/cli/commands/stop.js.map +1 -0
  80. package/build/cli/config-manager.d.ts +134 -0
  81. package/build/cli/config-manager.d.ts.map +1 -0
  82. package/build/cli/config-manager.js +288 -0
  83. package/build/cli/config-manager.js.map +1 -0
  84. package/build/cli/formatters.d.ts +62 -0
  85. package/build/cli/formatters.d.ts.map +1 -0
  86. package/build/cli/formatters.js +715 -0
  87. package/build/cli/formatters.js.map +1 -0
  88. package/build/cli/history-manager.d.ts +97 -0
  89. package/build/cli/history-manager.d.ts.map +1 -0
  90. package/build/cli/history-manager.js +201 -0
  91. package/build/cli/history-manager.js.map +1 -0
  92. package/build/cli/index.d.ts +16 -0
  93. package/build/cli/index.d.ts.map +1 -0
  94. package/build/cli/index.js +335 -0
  95. package/build/cli/index.js.map +1 -0
  96. package/build/cli/list-rulesets.d.ts +15 -0
  97. package/build/cli/list-rulesets.d.ts.map +1 -0
  98. package/build/cli/list-rulesets.js +193 -0
  99. package/build/cli/list-rulesets.js.map +1 -0
  100. package/build/cli/utils/connection-error.d.ts +9 -0
  101. package/build/cli/utils/connection-error.d.ts.map +1 -0
  102. package/build/cli/utils/connection-error.js +30 -0
  103. package/build/cli/utils/connection-error.js.map +1 -0
  104. package/build/cli/utils/embedded-server.d.ts +21 -0
  105. package/build/cli/utils/embedded-server.d.ts.map +1 -0
  106. package/build/cli/utils/embedded-server.js +61 -0
  107. package/build/cli/utils/embedded-server.js.map +1 -0
  108. package/build/cli/utils/mode-validator.d.ts +13 -0
  109. package/build/cli/utils/mode-validator.d.ts.map +1 -0
  110. package/build/cli/utils/mode-validator.js +31 -0
  111. package/build/cli/utils/mode-validator.js.map +1 -0
  112. package/build/cli/utils/port-checker.d.ts +20 -0
  113. package/build/cli/utils/port-checker.d.ts.map +1 -0
  114. package/build/cli/utils/port-checker.js +49 -0
  115. package/build/cli/utils/port-checker.js.map +1 -0
  116. package/build/config.d.ts +57 -0
  117. package/build/config.d.ts.map +1 -0
  118. package/build/config.js +527 -0
  119. package/build/config.js.map +1 -0
  120. package/build/document-accessor.d.ts +79 -0
  121. package/build/document-accessor.d.ts.map +1 -0
  122. package/build/document-accessor.js +148 -0
  123. package/build/document-accessor.js.map +1 -0
  124. package/build/formatters/reproduce-markdown.d.ts +14 -0
  125. package/build/formatters/reproduce-markdown.d.ts.map +1 -0
  126. package/build/formatters/reproduce-markdown.js +182 -0
  127. package/build/formatters/reproduce-markdown.js.map +1 -0
  128. package/build/formatters/sarif-builder.d.ts +86 -0
  129. package/build/formatters/sarif-builder.d.ts.map +1 -0
  130. package/build/formatters/sarif-builder.js +276 -0
  131. package/build/formatters/sarif-builder.js.map +1 -0
  132. package/build/index.d.ts +3 -0
  133. package/build/index.d.ts.map +1 -0
  134. package/build/index.js +174 -0
  135. package/build/index.js.map +1 -0
  136. package/build/logger.d.ts +38 -0
  137. package/build/logger.d.ts.map +1 -0
  138. package/build/logger.js +105 -0
  139. package/build/logger.js.map +1 -0
  140. package/build/mock-server.d.ts +2 -0
  141. package/build/mock-server.d.ts.map +1 -0
  142. package/build/mock-server.js +290 -0
  143. package/build/mock-server.js.map +1 -0
  144. package/build/orchestrator.d.ts +149 -0
  145. package/build/orchestrator.d.ts.map +1 -0
  146. package/build/orchestrator.js +874 -0
  147. package/build/orchestrator.js.map +1 -0
  148. package/build/ruleset-loader.d.ts +79 -0
  149. package/build/ruleset-loader.d.ts.map +1 -0
  150. package/build/ruleset-loader.js +514 -0
  151. package/build/ruleset-loader.js.map +1 -0
  152. package/build/schemas.d.ts +2568 -0
  153. package/build/schemas.d.ts.map +1 -0
  154. package/build/schemas.js +674 -0
  155. package/build/schemas.js.map +1 -0
  156. package/build/server.d.ts +39 -0
  157. package/build/server.d.ts.map +1 -0
  158. package/build/server.js +834 -0
  159. package/build/server.js.map +1 -0
  160. package/build/storage/memory-storage.d.ts +190 -0
  161. package/build/storage/memory-storage.d.ts.map +1 -0
  162. package/build/storage/memory-storage.js +629 -0
  163. package/build/storage/memory-storage.js.map +1 -0
  164. package/build/storage/redis-storage.d.ts +134 -0
  165. package/build/storage/redis-storage.d.ts.map +1 -0
  166. package/build/storage/redis-storage.js +236 -0
  167. package/build/storage/redis-storage.js.map +1 -0
  168. package/build/storage/storage-adapter.d.ts +189 -0
  169. package/build/storage/storage-adapter.d.ts.map +1 -0
  170. package/build/storage/storage-adapter.js +36 -0
  171. package/build/storage/storage-adapter.js.map +1 -0
  172. package/build/types.d.ts +981 -0
  173. package/build/types.d.ts.map +1 -0
  174. package/build/types.js +5 -0
  175. package/build/types.js.map +1 -0
  176. package/build/utils/version.d.ts +40 -0
  177. package/build/utils/version.d.ts.map +1 -0
  178. package/build/utils/version.js +94 -0
  179. package/build/utils/version.js.map +1 -0
  180. package/build/validation.d.ts +95 -0
  181. package/build/validation.d.ts.map +1 -0
  182. package/build/validation.js +150 -0
  183. package/build/validation.js.map +1 -0
  184. package/build/worker-pool.d.ts +137 -0
  185. package/build/worker-pool.d.ts.map +1 -0
  186. package/build/worker-pool.js +549 -0
  187. package/build/worker-pool.js.map +1 -0
  188. package/build/worker.d.ts +2 -0
  189. package/build/worker.d.ts.map +1 -0
  190. package/build/worker.js +427 -0
  191. package/build/worker.js.map +1 -0
  192. package/package.json +110 -0
  193. package/rulesets/CHANGELOG.md +25 -0
  194. package/rulesets/config/rulesets.yaml +96 -0
  195. package/rulesets/sources/README.md +47 -0
  196. package/rulesets/sources/example/oas-recommended/v1.0.0/ruleset.yaml +6 -0
  197. package/rulesets/sources/example/oas-recommended/v2.0.0/ruleset.yaml +14 -0
@@ -0,0 +1,288 @@
1
+ /**
2
+ * Config Manager - Manages CLI configuration in ~/.spectify/config.json
3
+ */
4
+ import fs from 'fs/promises';
5
+ import path from 'path';
6
+ import os from 'os';
7
+ /**
8
+ * Resolve the orchestrator home directory.
9
+ * SPECTIFY_HOME env var overrides the default ~/.spectify.
10
+ */
11
+ function spectifyHome() {
12
+ return process.env.SPECTIFY_HOME || path.join(os.homedir(), '.spectify');
13
+ }
14
+ const DEFAULT_CONFIG = {
15
+ defaultMode: 'standalone',
16
+ ports: {
17
+ standalone: 3003,
18
+ embedded: 3005, // Separate port to avoid conflict with standalone (auto-start/stop per command)
19
+ companion: 3004, // Different port to avoid conflict with standalone
20
+ },
21
+ };
22
+ export class ConfigManager {
23
+ configDir;
24
+ configPath;
25
+ processesPath;
26
+ config = null;
27
+ constructor() {
28
+ this.configDir = spectifyHome();
29
+ this.configPath = path.join(this.configDir, 'config.json');
30
+ this.processesPath = path.join(this.configDir, 'processes.json');
31
+ }
32
+ /**
33
+ * Ensure config directory exists
34
+ */
35
+ async ensureConfigDir() {
36
+ try {
37
+ await fs.access(this.configDir);
38
+ }
39
+ catch {
40
+ await fs.mkdir(this.configDir, { recursive: true });
41
+ }
42
+ }
43
+ /**
44
+ * Load config from disk, create if doesn't exist
45
+ */
46
+ async load() {
47
+ if (this.config) {
48
+ return this.config;
49
+ }
50
+ await this.ensureConfigDir();
51
+ try {
52
+ const content = await fs.readFile(this.configPath, 'utf-8');
53
+ this.config = JSON.parse(content);
54
+ // Validate and merge with defaults
55
+ this.config = {
56
+ ...DEFAULT_CONFIG,
57
+ ...this.config,
58
+ ports: {
59
+ ...DEFAULT_CONFIG.ports,
60
+ ...this.config?.ports,
61
+ },
62
+ };
63
+ }
64
+ catch (error) {
65
+ // File doesn't exist or is invalid - create default
66
+ this.config = { ...DEFAULT_CONFIG };
67
+ await this.save();
68
+ }
69
+ return this.config;
70
+ }
71
+ /**
72
+ * Save config to disk
73
+ */
74
+ async save() {
75
+ if (!this.config) {
76
+ throw new Error('Config not loaded');
77
+ }
78
+ await this.ensureConfigDir();
79
+ await fs.writeFile(this.configPath, JSON.stringify(this.config, null, 2), 'utf-8');
80
+ }
81
+ /**
82
+ * Get current config (loads if not cached)
83
+ */
84
+ async get() {
85
+ return await this.load();
86
+ }
87
+ /**
88
+ * Update default mode
89
+ */
90
+ async setDefaultMode(mode) {
91
+ const config = await this.load();
92
+ config.defaultMode = mode;
93
+ await this.save();
94
+ }
95
+ /**
96
+ * Update port for a mode
97
+ */
98
+ async setPort(mode, port) {
99
+ const config = await this.load();
100
+ config.ports[mode] = port;
101
+ await this.save();
102
+ }
103
+ /**
104
+ * Update last used settings
105
+ */
106
+ async setLastUsed(mode, port) {
107
+ const config = await this.load();
108
+ config.lastUsed = { mode, port };
109
+ await this.save();
110
+ }
111
+ /**
112
+ * Get port for a specific mode
113
+ */
114
+ async getPort(mode) {
115
+ const config = await this.load();
116
+ return config.ports[mode];
117
+ }
118
+ /**
119
+ * Get API URL for the given (or default) mode.
120
+ *
121
+ * Resolution order:
122
+ * 1. SPECTIFYD_URL env var (session override, highest priority)
123
+ * 2. config.url (persistent override via `spectify config set url <url>`)
124
+ * 3. http://localhost:<port> (default)
125
+ *
126
+ * The URL override is intentionally ignored for `embedded` mode because
127
+ * embedded mode manages a local process — it must always bind to localhost.
128
+ */
129
+ async getApiUrl(mode) {
130
+ const config = await this.load();
131
+ const targetMode = mode || config.defaultMode;
132
+ if (targetMode !== 'embedded') {
133
+ if (process.env.SPECTIFYD_URL) {
134
+ return process.env.SPECTIFYD_URL;
135
+ }
136
+ if (config.url) {
137
+ return config.url;
138
+ }
139
+ }
140
+ const port = config.ports[targetMode];
141
+ return `http://localhost:${port}`;
142
+ }
143
+ /**
144
+ * Set (or clear) the persistent URL override.
145
+ * Pass undefined to remove the override and revert to localhost:<port>.
146
+ */
147
+ async setUrl(url) {
148
+ const config = await this.load();
149
+ config.url = url;
150
+ await this.save();
151
+ }
152
+ /**
153
+ * Reset config to defaults
154
+ */
155
+ async reset() {
156
+ this.config = { ...DEFAULT_CONFIG };
157
+ await this.save();
158
+ }
159
+ /**
160
+ * Get config file path
161
+ */
162
+ getConfigPath() {
163
+ return this.configPath;
164
+ }
165
+ /**
166
+ * Check if config file exists
167
+ */
168
+ async exists() {
169
+ try {
170
+ await fs.access(this.configPath);
171
+ return true;
172
+ }
173
+ catch {
174
+ return false;
175
+ }
176
+ }
177
+ // ============================================
178
+ // Process Management
179
+ // ============================================
180
+ /**
181
+ * Load process registry
182
+ */
183
+ async loadProcesses() {
184
+ try {
185
+ const content = await fs.readFile(this.processesPath, 'utf-8');
186
+ return JSON.parse(content);
187
+ }
188
+ catch {
189
+ return {};
190
+ }
191
+ }
192
+ /**
193
+ * Save process registry
194
+ */
195
+ async saveProcesses(registry) {
196
+ await this.ensureConfigDir();
197
+ await fs.writeFile(this.processesPath, JSON.stringify(registry, null, 2), 'utf-8');
198
+ }
199
+ /**
200
+ * Register a running process
201
+ */
202
+ async registerProcess(mode, pid, port) {
203
+ const registry = await this.loadProcesses();
204
+ registry[mode] = {
205
+ pid,
206
+ port,
207
+ mode,
208
+ startedAt: new Date().toISOString(),
209
+ };
210
+ await this.saveProcesses(registry);
211
+ }
212
+ /**
213
+ * Unregister a process
214
+ */
215
+ async unregisterProcess(mode) {
216
+ const registry = await this.loadProcesses();
217
+ delete registry[mode];
218
+ await this.saveProcesses(registry);
219
+ }
220
+ /**
221
+ * Get running process for a mode
222
+ */
223
+ async getProcess(mode) {
224
+ const registry = await this.loadProcesses();
225
+ const process = registry[mode];
226
+ if (!process) {
227
+ return null;
228
+ }
229
+ // Check if process is actually running
230
+ if (!this.isProcessRunning(process.pid)) {
231
+ // Clean up stale entry
232
+ await this.unregisterProcess(mode);
233
+ return null;
234
+ }
235
+ return process;
236
+ }
237
+ /**
238
+ * Get all running processes
239
+ */
240
+ async getAllProcesses() {
241
+ const registry = await this.loadProcesses();
242
+ const processes = [];
243
+ for (const [mode, process] of Object.entries(registry)) {
244
+ if (process && this.isProcessRunning(process.pid)) {
245
+ processes.push(process);
246
+ }
247
+ else if (process) {
248
+ // Clean up stale entry
249
+ await this.unregisterProcess(mode);
250
+ }
251
+ }
252
+ return processes;
253
+ }
254
+ /**
255
+ * Check if a process is running
256
+ */
257
+ isProcessRunning(pid) {
258
+ try {
259
+ // Sending signal 0 checks if process exists without actually sending a signal
260
+ process.kill(pid, 0);
261
+ return true;
262
+ }
263
+ catch {
264
+ return false;
265
+ }
266
+ }
267
+ /**
268
+ * Find process by port
269
+ */
270
+ async getProcessByPort(port) {
271
+ const registry = await this.loadProcesses();
272
+ for (const proc of Object.values(registry)) {
273
+ if (proc && proc.port === port && this.isProcessRunning(proc.pid)) {
274
+ return proc;
275
+ }
276
+ }
277
+ return null;
278
+ }
279
+ }
280
+ // Singleton instance
281
+ let instance = null;
282
+ export function getConfigManager() {
283
+ if (!instance) {
284
+ instance = new ConfigManager();
285
+ }
286
+ return instance;
287
+ }
288
+ //# sourceMappingURL=config-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../src/cli/config-manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB;;;GAGG;AACH,SAAS,YAAY;IACnB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC3E,CAAC;AAmCD,MAAM,cAAc,GAAmB;IACrC,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE;QACL,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI,EAAG,gFAAgF;QACjG,SAAS,EAAE,IAAI,EAAG,mDAAmD;KACtE;CACF,CAAC;AAEF,MAAM,OAAO,aAAa;IAChB,SAAS,CAAS;IAClB,UAAU,CAAS;IACnB,aAAa,CAAS;IACtB,MAAM,GAA0B,IAAI,CAAC;IAE7C;QACE,IAAI,CAAC,SAAS,GAAG,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,CA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AC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3C,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClE,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,qBAAqB;AACrB,IAAI,QAAQ,GAAyB,IAAI,CAAC;AAE1C,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;IACjC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Formatters for orchestrator CLI output
3
+ * Handles color coding, tables, and summary displays
4
+ */
5
+ import { LintJobResult, LintIssue, RuleSeverity } from '../types.js';
6
+ import { HistoryEntry } from './history-manager.js';
7
+ import { RulesetInfo } from './api-client.js';
8
+ /**
9
+ * Get colored severity indicator
10
+ */
11
+ export declare function formatSeverity(severity: number | RuleSeverity): string;
12
+ /**
13
+ * Get severity icon
14
+ */
15
+ export declare function getSeverityIcon(severity: number | RuleSeverity): string;
16
+ /**
17
+ * Format ruleset display name with override info.
18
+ * Returns long form: "pubhub v1.1.0 (2 rules excluded, 1 severity override)"
19
+ * Or short form: "pubhub v1.1.0" when no overrides present.
20
+ */
21
+ export declare function formatRulesetDisplay(rulesetName: string, rulesetVersion: string, ruleOverrides?: Record<string, string>): string;
22
+ /**
23
+ * Format ruleset name in short form: "pubhub*" if overrides present, "pubhub" otherwise.
24
+ */
25
+ export declare function formatRulesetShort(rulesetName: string, ruleOverrides?: Record<string, string>): string;
26
+ /**
27
+ * Format lint result summary
28
+ */
29
+ export declare function formatSummary(result: LintJobResult, dimmed?: boolean): string;
30
+ /**
31
+ * Format lint issues as a table
32
+ */
33
+ export declare function formatIssuesTable(issues: LintIssue[], limit?: number): string;
34
+ /**
35
+ * Format issues grouped by rule (summary view for drill-down)
36
+ */
37
+ export declare function formatRuleSummaryTable(issues: LintIssue[]): string;
38
+ /**
39
+ * Format issues for a specific rule (detail view without repetition)
40
+ */
41
+ export declare function formatRuleDetailView(issues: LintIssue[]): string;
42
+ /**
43
+ * Format history entries as a table
44
+ */
45
+ export declare function formatHistoryTable(entries: HistoryEntry[]): string;
46
+ /**
47
+ * Format rulesets as a table
48
+ */
49
+ export declare function formatRulesetsTable(rulesets: RulesetInfo[]): string;
50
+ /**
51
+ * Format job status
52
+ */
53
+ export declare function formatJobStatus(status: any): string;
54
+ /**
55
+ * Format health status
56
+ */
57
+ export declare function formatHealth(health: any): string;
58
+ /**
59
+ * Format jobs list as a table
60
+ */
61
+ export declare function formatJobsTable(jobs: any[], detailed?: boolean): string;
62
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/cli/formatters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAW9C;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAgBtE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAgBvE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,CAaR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,E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