@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.
- package/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +43 -0
- package/build/cli/api-client.d.ts +170 -0
- package/build/cli/api-client.d.ts.map +1 -0
- package/build/cli/api-client.js +284 -0
- package/build/cli/api-client.js.map +1 -0
- package/build/cli/commands/agents.d.ts +7 -0
- package/build/cli/commands/agents.d.ts.map +1 -0
- package/build/cli/commands/agents.js +694 -0
- package/build/cli/commands/agents.js.map +1 -0
- package/build/cli/commands/completion.d.ts +9 -0
- package/build/cli/commands/completion.d.ts.map +1 -0
- package/build/cli/commands/completion.js +177 -0
- package/build/cli/commands/completion.js.map +1 -0
- package/build/cli/commands/config.d.ts +10 -0
- package/build/cli/commands/config.d.ts.map +1 -0
- package/build/cli/commands/config.js +284 -0
- package/build/cli/commands/config.js.map +1 -0
- package/build/cli/commands/health.d.ts +11 -0
- package/build/cli/commands/health.d.ts.map +1 -0
- package/build/cli/commands/health.js +38 -0
- package/build/cli/commands/health.js.map +1 -0
- package/build/cli/commands/help.d.ts +6 -0
- package/build/cli/commands/help.d.ts.map +1 -0
- package/build/cli/commands/help.js +20 -0
- package/build/cli/commands/help.js.map +1 -0
- package/build/cli/commands/history.d.ts +11 -0
- package/build/cli/commands/history.d.ts.map +1 -0
- package/build/cli/commands/history.js +50 -0
- package/build/cli/commands/history.js.map +1 -0
- package/build/cli/commands/jobs.d.ts +12 -0
- package/build/cli/commands/jobs.d.ts.map +1 -0
- package/build/cli/commands/jobs.js +84 -0
- package/build/cli/commands/jobs.js.map +1 -0
- package/build/cli/commands/lint.d.ts +15 -0
- package/build/cli/commands/lint.d.ts.map +1 -0
- package/build/cli/commands/lint.js +384 -0
- package/build/cli/commands/lint.js.map +1 -0
- package/build/cli/commands/ps.d.ts +8 -0
- package/build/cli/commands/ps.d.ts.map +1 -0
- package/build/cli/commands/ps.js +74 -0
- package/build/cli/commands/ps.js.map +1 -0
- package/build/cli/commands/reproduce.d.ts +9 -0
- package/build/cli/commands/reproduce.d.ts.map +1 -0
- package/build/cli/commands/reproduce.js +31 -0
- package/build/cli/commands/reproduce.js.map +1 -0
- package/build/cli/commands/reset.d.ts +5 -0
- package/build/cli/commands/reset.d.ts.map +1 -0
- package/build/cli/commands/reset.js +13 -0
- package/build/cli/commands/reset.js.map +1 -0
- package/build/cli/commands/results.d.ts +13 -0
- package/build/cli/commands/results.d.ts.map +1 -0
- package/build/cli/commands/results.js +129 -0
- package/build/cli/commands/results.js.map +1 -0
- package/build/cli/commands/rulesets/check.d.ts +12 -0
- package/build/cli/commands/rulesets/check.d.ts.map +1 -0
- package/build/cli/commands/rulesets/check.js +226 -0
- package/build/cli/commands/rulesets/check.js.map +1 -0
- package/build/cli/commands/rulesets/index.d.ts +5 -0
- package/build/cli/commands/rulesets/index.d.ts.map +1 -0
- package/build/cli/commands/rulesets/index.js +6 -0
- package/build/cli/commands/rulesets/index.js.map +1 -0
- package/build/cli/commands/rulesets/view.d.ts +16 -0
- package/build/cli/commands/rulesets/view.d.ts.map +1 -0
- package/build/cli/commands/rulesets/view.js +100 -0
- package/build/cli/commands/rulesets/view.js.map +1 -0
- package/build/cli/commands/start.d.ts +16 -0
- package/build/cli/commands/start.d.ts.map +1 -0
- package/build/cli/commands/start.js +167 -0
- package/build/cli/commands/start.js.map +1 -0
- package/build/cli/commands/status.d.ts +9 -0
- package/build/cli/commands/status.d.ts.map +1 -0
- package/build/cli/commands/status.js +46 -0
- package/build/cli/commands/status.js.map +1 -0
- package/build/cli/commands/stop.d.ts +11 -0
- package/build/cli/commands/stop.d.ts.map +1 -0
- package/build/cli/commands/stop.js +78 -0
- package/build/cli/commands/stop.js.map +1 -0
- package/build/cli/config-manager.d.ts +134 -0
- package/build/cli/config-manager.d.ts.map +1 -0
- package/build/cli/config-manager.js +288 -0
- package/build/cli/config-manager.js.map +1 -0
- package/build/cli/formatters.d.ts +62 -0
- package/build/cli/formatters.d.ts.map +1 -0
- package/build/cli/formatters.js +715 -0
- package/build/cli/formatters.js.map +1 -0
- package/build/cli/history-manager.d.ts +97 -0
- package/build/cli/history-manager.d.ts.map +1 -0
- package/build/cli/history-manager.js +201 -0
- package/build/cli/history-manager.js.map +1 -0
- package/build/cli/index.d.ts +16 -0
- package/build/cli/index.d.ts.map +1 -0
- package/build/cli/index.js +335 -0
- package/build/cli/index.js.map +1 -0
- package/build/cli/list-rulesets.d.ts +15 -0
- package/build/cli/list-rulesets.d.ts.map +1 -0
- package/build/cli/list-rulesets.js +193 -0
- package/build/cli/list-rulesets.js.map +1 -0
- package/build/cli/utils/connection-error.d.ts +9 -0
- package/build/cli/utils/connection-error.d.ts.map +1 -0
- package/build/cli/utils/connection-error.js +30 -0
- package/build/cli/utils/connection-error.js.map +1 -0
- package/build/cli/utils/embedded-server.d.ts +21 -0
- package/build/cli/utils/embedded-server.d.ts.map +1 -0
- package/build/cli/utils/embedded-server.js +61 -0
- package/build/cli/utils/embedded-server.js.map +1 -0
- package/build/cli/utils/mode-validator.d.ts +13 -0
- package/build/cli/utils/mode-validator.d.ts.map +1 -0
- package/build/cli/utils/mode-validator.js +31 -0
- package/build/cli/utils/mode-validator.js.map +1 -0
- package/build/cli/utils/port-checker.d.ts +20 -0
- package/build/cli/utils/port-checker.d.ts.map +1 -0
- package/build/cli/utils/port-checker.js +49 -0
- package/build/cli/utils/port-checker.js.map +1 -0
- package/build/config.d.ts +57 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.js +527 -0
- package/build/config.js.map +1 -0
- package/build/document-accessor.d.ts +79 -0
- package/build/document-accessor.d.ts.map +1 -0
- package/build/document-accessor.js +148 -0
- package/build/document-accessor.js.map +1 -0
- package/build/formatters/reproduce-markdown.d.ts +14 -0
- package/build/formatters/reproduce-markdown.d.ts.map +1 -0
- package/build/formatters/reproduce-markdown.js +182 -0
- package/build/formatters/reproduce-markdown.js.map +1 -0
- package/build/formatters/sarif-builder.d.ts +86 -0
- package/build/formatters/sarif-builder.d.ts.map +1 -0
- package/build/formatters/sarif-builder.js +276 -0
- package/build/formatters/sarif-builder.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +174 -0
- package/build/index.js.map +1 -0
- package/build/logger.d.ts +38 -0
- package/build/logger.d.ts.map +1 -0
- package/build/logger.js +105 -0
- package/build/logger.js.map +1 -0
- package/build/mock-server.d.ts +2 -0
- package/build/mock-server.d.ts.map +1 -0
- package/build/mock-server.js +290 -0
- package/build/mock-server.js.map +1 -0
- package/build/orchestrator.d.ts +149 -0
- package/build/orchestrator.d.ts.map +1 -0
- package/build/orchestrator.js +874 -0
- package/build/orchestrator.js.map +1 -0
- package/build/ruleset-loader.d.ts +79 -0
- package/build/ruleset-loader.d.ts.map +1 -0
- package/build/ruleset-loader.js +514 -0
- package/build/ruleset-loader.js.map +1 -0
- package/build/schemas.d.ts +2568 -0
- package/build/schemas.d.ts.map +1 -0
- package/build/schemas.js +674 -0
- package/build/schemas.js.map +1 -0
- package/build/server.d.ts +39 -0
- package/build/server.d.ts.map +1 -0
- package/build/server.js +834 -0
- package/build/server.js.map +1 -0
- package/build/storage/memory-storage.d.ts +190 -0
- package/build/storage/memory-storage.d.ts.map +1 -0
- package/build/storage/memory-storage.js +629 -0
- package/build/storage/memory-storage.js.map +1 -0
- package/build/storage/redis-storage.d.ts +134 -0
- package/build/storage/redis-storage.d.ts.map +1 -0
- package/build/storage/redis-storage.js +236 -0
- package/build/storage/redis-storage.js.map +1 -0
- package/build/storage/storage-adapter.d.ts +189 -0
- package/build/storage/storage-adapter.d.ts.map +1 -0
- package/build/storage/storage-adapter.js +36 -0
- package/build/storage/storage-adapter.js.map +1 -0
- package/build/types.d.ts +981 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +5 -0
- package/build/types.js.map +1 -0
- package/build/utils/version.d.ts +40 -0
- package/build/utils/version.d.ts.map +1 -0
- package/build/utils/version.js +94 -0
- package/build/utils/version.js.map +1 -0
- package/build/validation.d.ts +95 -0
- package/build/validation.d.ts.map +1 -0
- package/build/validation.js +150 -0
- package/build/validation.js.map +1 -0
- package/build/worker-pool.d.ts +137 -0
- package/build/worker-pool.d.ts.map +1 -0
- package/build/worker-pool.js +549 -0
- package/build/worker-pool.js.map +1 -0
- package/build/worker.d.ts +2 -0
- package/build/worker.d.ts.map +1 -0
- package/build/worker.js +427 -0
- package/build/worker.js.map +1 -0
- package/package.json +110 -0
- package/rulesets/CHANGELOG.md +25 -0
- package/rulesets/config/rulesets.yaml +96 -0
- package/rulesets/sources/README.md +47 -0
- package/rulesets/sources/example/oas-recommended/v1.0.0/ruleset.yaml +6 -0
- 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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SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,GAAW;QAClC,IAAI,CAAC;YACH,8EAA8E;YAC9E,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAE5C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,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,EACnB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM,CA0CpF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CA6C7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,S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