autoremediator 0.7.0 → 0.9.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.
- package/README.md +92 -69
- package/dist/{chunk-MUFP2DQX.js → chunk-EDPCMRUW.js} +3510 -2170
- package/dist/chunk-EDPCMRUW.js.map +1 -0
- package/dist/cli.js +195 -8
- package/dist/cli.js.map +1 -1
- package/dist/index-Di8lB6CG.d.ts +401 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +9 -5
- package/dist/mcp/server.d.ts +75 -2
- package/dist/mcp/server.js +72 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/openapi/server.d.ts +444 -137
- package/dist/openapi/server.js +358 -147
- package/dist/openapi/server.js.map +1 -1
- package/dist/{options-schema-DfLBOsPI.d.ts → options-schema-CH5GjZY1.d.ts} +18 -2
- package/llms.txt +36 -7
- package/package.json +10 -5
- package/dist/chunk-MUFP2DQX.js.map +0 -1
- package/dist/remediate-from-scan-C-E7gqxF.d.ts +0 -211
package/dist/openapi/server.d.ts
CHANGED
|
@@ -1,68 +1,115 @@
|
|
|
1
|
-
import { J as JsonSchemaProperty } from '../options-schema-DfLBOsPI.js';
|
|
2
1
|
import http from 'node:http';
|
|
3
|
-
import {
|
|
2
|
+
import { B as remediate, E as remediateFromScan, z as planRemediation, y as listPatchArtifacts, x as inspectPatchArtifact, F as validatePatchArtifact } from '../index-Di8lB6CG.js';
|
|
3
|
+
import { J as JsonSchemaProperty } from '../options-schema-CH5GjZY1.js';
|
|
4
4
|
|
|
5
|
-
interface OpenApiServerDeps {
|
|
6
|
-
remediateFn: typeof remediate;
|
|
7
|
-
remediateFromScanFn: typeof remediateFromScan;
|
|
8
|
-
planRemediationFn: typeof planRemediation;
|
|
9
|
-
}
|
|
10
|
-
declare function createOpenApiServer(deps?: OpenApiServerDeps): http.Server;
|
|
11
5
|
declare const OPENAPI_SPEC: {
|
|
12
|
-
openapi:
|
|
13
|
-
info: {
|
|
14
|
-
title:
|
|
15
|
-
version: string;
|
|
16
|
-
description:
|
|
6
|
+
readonly openapi: "3.1.0";
|
|
7
|
+
readonly info: {
|
|
8
|
+
readonly title: "autoremediator";
|
|
9
|
+
readonly version: string;
|
|
10
|
+
readonly description: "Agentic CVE remediation for Node.js dependency projects";
|
|
17
11
|
};
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
readonly servers: readonly [{
|
|
13
|
+
readonly url: "http://localhost:3000";
|
|
14
|
+
readonly description: "Local development server";
|
|
15
|
+
}];
|
|
16
|
+
readonly "x-agent-compatible": true;
|
|
17
|
+
readonly "x-agent-use-cases": readonly ["plan-first remediation", "scanner-driven batch remediation", "patch lifecycle validation"];
|
|
18
|
+
readonly paths: {
|
|
19
|
+
readonly "/remediate": {
|
|
20
|
+
readonly post: {
|
|
21
|
+
readonly operationId: "remediate";
|
|
22
|
+
readonly summary: "Remediate a single CVE";
|
|
23
|
+
readonly requestBody: {
|
|
24
|
+
readonly required: true;
|
|
25
|
+
readonly content: {
|
|
26
|
+
readonly "application/json": {
|
|
27
|
+
readonly schema: {
|
|
28
|
+
readonly type: "object";
|
|
29
|
+
readonly required: readonly ["cveId"];
|
|
30
|
+
readonly properties: {
|
|
31
|
+
readonly cveId: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly description: "CVE ID, e.g. CVE-2021-23337";
|
|
34
|
+
readonly pattern: "^CVE-\\d{4}-\\d+$";
|
|
35
35
|
};
|
|
36
|
-
options: {
|
|
37
|
-
type:
|
|
38
|
-
description:
|
|
39
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
36
|
+
readonly options: {
|
|
37
|
+
readonly type: "object";
|
|
38
|
+
readonly description: "RemediateOptions";
|
|
39
|
+
readonly properties: Record<string, JsonSchemaProperty>;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
responses: {
|
|
47
|
-
"200": {
|
|
48
|
-
description:
|
|
49
|
-
content: {
|
|
50
|
-
"application/json": {
|
|
51
|
-
schema: {
|
|
52
|
-
type:
|
|
46
|
+
readonly responses: {
|
|
47
|
+
readonly "200": {
|
|
48
|
+
readonly description: "RemediationReport";
|
|
49
|
+
readonly content: {
|
|
50
|
+
readonly "application/json": {
|
|
51
|
+
readonly schema: {
|
|
52
|
+
readonly type: "object";
|
|
53
|
+
readonly properties: {
|
|
54
|
+
readonly cveId: {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
};
|
|
57
|
+
readonly cveDetails: {
|
|
58
|
+
readonly type: readonly ["object", "null"];
|
|
59
|
+
};
|
|
60
|
+
readonly vulnerablePackages: {
|
|
61
|
+
readonly type: "array";
|
|
62
|
+
readonly items: {
|
|
63
|
+
readonly type: "object";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly results: {
|
|
67
|
+
readonly type: "array";
|
|
68
|
+
readonly items: {
|
|
69
|
+
readonly type: "object";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly agentSteps: {
|
|
73
|
+
readonly type: "number";
|
|
74
|
+
};
|
|
75
|
+
readonly summary: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
};
|
|
78
|
+
readonly evidenceFile: {
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
};
|
|
81
|
+
readonly llmUsage: {
|
|
82
|
+
readonly type: "array";
|
|
83
|
+
readonly items: {
|
|
84
|
+
readonly type: "object";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
readonly correlation: {
|
|
88
|
+
readonly type: "object";
|
|
89
|
+
};
|
|
90
|
+
readonly provenance: {
|
|
91
|
+
readonly type: "object";
|
|
92
|
+
};
|
|
93
|
+
readonly constraints: {
|
|
94
|
+
readonly type: "object";
|
|
95
|
+
};
|
|
96
|
+
readonly resumedFromCache: {
|
|
97
|
+
readonly type: "boolean";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
53
100
|
};
|
|
54
101
|
};
|
|
55
102
|
};
|
|
56
103
|
};
|
|
57
|
-
"400": {
|
|
58
|
-
description:
|
|
59
|
-
content: {
|
|
60
|
-
"application/json": {
|
|
61
|
-
schema: {
|
|
62
|
-
type:
|
|
63
|
-
properties: {
|
|
64
|
-
error: {
|
|
65
|
-
type: string;
|
|
104
|
+
readonly "400": {
|
|
105
|
+
readonly description: "Invalid input or remediation error";
|
|
106
|
+
readonly content: {
|
|
107
|
+
readonly "application/json": {
|
|
108
|
+
readonly schema: {
|
|
109
|
+
readonly type: "object";
|
|
110
|
+
readonly properties: {
|
|
111
|
+
readonly error: {
|
|
112
|
+
readonly type: "string";
|
|
66
113
|
};
|
|
67
114
|
};
|
|
68
115
|
};
|
|
@@ -72,53 +119,100 @@ declare const OPENAPI_SPEC: {
|
|
|
72
119
|
};
|
|
73
120
|
};
|
|
74
121
|
};
|
|
75
|
-
"/plan-remediation": {
|
|
76
|
-
post: {
|
|
77
|
-
operationId:
|
|
78
|
-
summary:
|
|
79
|
-
requestBody: {
|
|
80
|
-
required:
|
|
81
|
-
content: {
|
|
82
|
-
"application/json": {
|
|
83
|
-
schema: {
|
|
84
|
-
type:
|
|
85
|
-
required:
|
|
86
|
-
properties: {
|
|
87
|
-
cveId: {
|
|
88
|
-
type: string;
|
|
89
|
-
description: "CVE ID, e.g. CVE-2021-23337";
|
|
90
|
-
pattern:
|
|
122
|
+
readonly "/plan-remediation": {
|
|
123
|
+
readonly post: {
|
|
124
|
+
readonly operationId: "planRemediation";
|
|
125
|
+
readonly summary: "Generate a non-mutating remediation preview";
|
|
126
|
+
readonly requestBody: {
|
|
127
|
+
readonly required: true;
|
|
128
|
+
readonly content: {
|
|
129
|
+
readonly "application/json": {
|
|
130
|
+
readonly schema: {
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly required: readonly ["cveId"];
|
|
133
|
+
readonly properties: {
|
|
134
|
+
readonly cveId: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly description: "CVE ID, e.g. CVE-2021-23337";
|
|
137
|
+
readonly pattern: "^CVE-\\d{4}-\\d+$";
|
|
91
138
|
};
|
|
92
|
-
options: {
|
|
93
|
-
type:
|
|
94
|
-
description:
|
|
95
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
139
|
+
readonly options: {
|
|
140
|
+
readonly type: "object";
|
|
141
|
+
readonly description: "RemediateOptions";
|
|
142
|
+
readonly properties: Record<string, JsonSchemaProperty>;
|
|
96
143
|
};
|
|
97
144
|
};
|
|
98
145
|
};
|
|
99
146
|
};
|
|
100
147
|
};
|
|
101
148
|
};
|
|
102
|
-
responses: {
|
|
103
|
-
"200": {
|
|
104
|
-
description:
|
|
105
|
-
content: {
|
|
106
|
-
"application/json": {
|
|
107
|
-
schema: {
|
|
108
|
-
type:
|
|
149
|
+
readonly responses: {
|
|
150
|
+
readonly "200": {
|
|
151
|
+
readonly description: "RemediationReport";
|
|
152
|
+
readonly content: {
|
|
153
|
+
readonly "application/json": {
|
|
154
|
+
readonly schema: {
|
|
155
|
+
readonly type: "object";
|
|
156
|
+
readonly properties: {
|
|
157
|
+
readonly cveId: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
};
|
|
160
|
+
readonly cveDetails: {
|
|
161
|
+
readonly type: readonly ["object", "null"];
|
|
162
|
+
};
|
|
163
|
+
readonly vulnerablePackages: {
|
|
164
|
+
readonly type: "array";
|
|
165
|
+
readonly items: {
|
|
166
|
+
readonly type: "object";
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly results: {
|
|
170
|
+
readonly type: "array";
|
|
171
|
+
readonly items: {
|
|
172
|
+
readonly type: "object";
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
readonly agentSteps: {
|
|
176
|
+
readonly type: "number";
|
|
177
|
+
};
|
|
178
|
+
readonly summary: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
};
|
|
181
|
+
readonly evidenceFile: {
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
};
|
|
184
|
+
readonly llmUsage: {
|
|
185
|
+
readonly type: "array";
|
|
186
|
+
readonly items: {
|
|
187
|
+
readonly type: "object";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
readonly correlation: {
|
|
191
|
+
readonly type: "object";
|
|
192
|
+
};
|
|
193
|
+
readonly provenance: {
|
|
194
|
+
readonly type: "object";
|
|
195
|
+
};
|
|
196
|
+
readonly constraints: {
|
|
197
|
+
readonly type: "object";
|
|
198
|
+
};
|
|
199
|
+
readonly resumedFromCache: {
|
|
200
|
+
readonly type: "boolean";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
109
203
|
};
|
|
110
204
|
};
|
|
111
205
|
};
|
|
112
206
|
};
|
|
113
|
-
"400": {
|
|
114
|
-
description:
|
|
115
|
-
content: {
|
|
116
|
-
"application/json": {
|
|
117
|
-
schema: {
|
|
118
|
-
type:
|
|
119
|
-
properties: {
|
|
120
|
-
error: {
|
|
121
|
-
type: string;
|
|
207
|
+
readonly "400": {
|
|
208
|
+
readonly description: "Invalid input or remediation error";
|
|
209
|
+
readonly content: {
|
|
210
|
+
readonly "application/json": {
|
|
211
|
+
readonly schema: {
|
|
212
|
+
readonly type: "object";
|
|
213
|
+
readonly properties: {
|
|
214
|
+
readonly error: {
|
|
215
|
+
readonly type: "string";
|
|
122
216
|
};
|
|
123
217
|
};
|
|
124
218
|
};
|
|
@@ -128,53 +222,53 @@ declare const OPENAPI_SPEC: {
|
|
|
128
222
|
};
|
|
129
223
|
};
|
|
130
224
|
};
|
|
131
|
-
"/remediate-from-scan": {
|
|
132
|
-
post: {
|
|
133
|
-
operationId:
|
|
134
|
-
summary:
|
|
135
|
-
requestBody: {
|
|
136
|
-
required:
|
|
137
|
-
content: {
|
|
138
|
-
"application/json": {
|
|
139
|
-
schema: {
|
|
140
|
-
type:
|
|
141
|
-
required:
|
|
142
|
-
properties: {
|
|
143
|
-
inputPath: {
|
|
144
|
-
type: string;
|
|
145
|
-
description: "Absolute path to the scanner output file";
|
|
225
|
+
readonly "/remediate-from-scan": {
|
|
226
|
+
readonly post: {
|
|
227
|
+
readonly operationId: "remediateFromScan";
|
|
228
|
+
readonly summary: "Parse a scanner file and remediate all found CVEs";
|
|
229
|
+
readonly requestBody: {
|
|
230
|
+
readonly required: true;
|
|
231
|
+
readonly content: {
|
|
232
|
+
readonly "application/json": {
|
|
233
|
+
readonly schema: {
|
|
234
|
+
readonly type: "object";
|
|
235
|
+
readonly required: readonly ["inputPath"];
|
|
236
|
+
readonly properties: {
|
|
237
|
+
readonly inputPath: {
|
|
238
|
+
readonly type: "string";
|
|
239
|
+
readonly description: "Absolute path to the scanner output file";
|
|
146
240
|
};
|
|
147
|
-
options: {
|
|
148
|
-
type:
|
|
149
|
-
description:
|
|
150
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
241
|
+
readonly options: {
|
|
242
|
+
readonly type: "object";
|
|
243
|
+
readonly description: "ScanOptions";
|
|
244
|
+
readonly properties: Record<string, JsonSchemaProperty>;
|
|
151
245
|
};
|
|
152
246
|
};
|
|
153
247
|
};
|
|
154
248
|
};
|
|
155
249
|
};
|
|
156
250
|
};
|
|
157
|
-
responses: {
|
|
158
|
-
"200": {
|
|
159
|
-
description:
|
|
160
|
-
content: {
|
|
161
|
-
"application/json": {
|
|
162
|
-
schema: {
|
|
163
|
-
type:
|
|
164
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
251
|
+
readonly responses: {
|
|
252
|
+
readonly "200": {
|
|
253
|
+
readonly description: "ScanReport";
|
|
254
|
+
readonly content: {
|
|
255
|
+
readonly "application/json": {
|
|
256
|
+
readonly schema: {
|
|
257
|
+
readonly type: "object";
|
|
258
|
+
readonly properties: Record<string, JsonSchemaProperty>;
|
|
165
259
|
};
|
|
166
260
|
};
|
|
167
261
|
};
|
|
168
262
|
};
|
|
169
|
-
"400": {
|
|
170
|
-
description:
|
|
171
|
-
content: {
|
|
172
|
-
"application/json": {
|
|
173
|
-
schema: {
|
|
174
|
-
type:
|
|
175
|
-
properties: {
|
|
176
|
-
error: {
|
|
177
|
-
type: string;
|
|
263
|
+
readonly "400": {
|
|
264
|
+
readonly description: "Invalid input or remediation error";
|
|
265
|
+
readonly content: {
|
|
266
|
+
readonly "application/json": {
|
|
267
|
+
readonly schema: {
|
|
268
|
+
readonly type: "object";
|
|
269
|
+
readonly properties: {
|
|
270
|
+
readonly error: {
|
|
271
|
+
readonly type: "string";
|
|
178
272
|
};
|
|
179
273
|
};
|
|
180
274
|
};
|
|
@@ -184,20 +278,214 @@ declare const OPENAPI_SPEC: {
|
|
|
184
278
|
};
|
|
185
279
|
};
|
|
186
280
|
};
|
|
187
|
-
"/
|
|
188
|
-
|
|
189
|
-
operationId:
|
|
190
|
-
summary:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
281
|
+
readonly "/patches/list": {
|
|
282
|
+
readonly post: {
|
|
283
|
+
readonly operationId: "listPatchArtifacts";
|
|
284
|
+
readonly summary: "List stored patch artifacts";
|
|
285
|
+
readonly requestBody: {
|
|
286
|
+
readonly required: false;
|
|
287
|
+
readonly content: {
|
|
288
|
+
readonly "application/json": {
|
|
289
|
+
readonly schema: {
|
|
290
|
+
readonly type: "object";
|
|
291
|
+
readonly properties: {
|
|
292
|
+
readonly options: {
|
|
293
|
+
readonly type: "object";
|
|
294
|
+
readonly description: "PatchArtifactQueryOptions";
|
|
295
|
+
readonly properties: {
|
|
296
|
+
readonly cwd: {
|
|
297
|
+
readonly type: "string";
|
|
298
|
+
readonly description: "Absolute path to the project root (default: process.cwd())";
|
|
299
|
+
};
|
|
300
|
+
readonly patchesDir: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
readonly description: "Directory to write .patch files (default: ./patches)";
|
|
303
|
+
};
|
|
304
|
+
readonly packageManager: {
|
|
305
|
+
readonly type: "string";
|
|
306
|
+
readonly enum: readonly ["npm", "pnpm", "yarn"];
|
|
307
|
+
readonly description: "Package manager override (auto-detected by default)";
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
readonly responses: {
|
|
317
|
+
readonly "200": {
|
|
318
|
+
readonly description: "Patch artifact summaries";
|
|
319
|
+
readonly content: {
|
|
320
|
+
readonly "application/json": {
|
|
321
|
+
readonly schema: {
|
|
322
|
+
readonly type: "array";
|
|
323
|
+
readonly items: {
|
|
324
|
+
readonly type: "object";
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
readonly "400": {
|
|
331
|
+
readonly description: "Invalid input";
|
|
332
|
+
readonly content: {
|
|
333
|
+
readonly "application/json": {
|
|
334
|
+
readonly schema: {
|
|
335
|
+
readonly type: "object";
|
|
336
|
+
readonly properties: {
|
|
337
|
+
readonly error: {
|
|
338
|
+
readonly type: "string";
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
readonly "/patches/inspect": {
|
|
349
|
+
readonly post: {
|
|
350
|
+
readonly operationId: "inspectPatchArtifact";
|
|
351
|
+
readonly summary: "Inspect a stored patch artifact";
|
|
352
|
+
readonly requestBody: {
|
|
353
|
+
readonly required: true;
|
|
354
|
+
readonly content: {
|
|
355
|
+
readonly "application/json": {
|
|
356
|
+
readonly schema: {
|
|
357
|
+
readonly type: "object";
|
|
358
|
+
readonly required: readonly ["patchFilePath"];
|
|
359
|
+
readonly properties: {
|
|
360
|
+
readonly patchFilePath: {
|
|
361
|
+
readonly type: "string";
|
|
362
|
+
};
|
|
363
|
+
readonly options: {
|
|
364
|
+
readonly type: "object";
|
|
365
|
+
readonly description: "PatchArtifactQueryOptions";
|
|
366
|
+
readonly properties: {
|
|
367
|
+
readonly cwd: {
|
|
368
|
+
readonly type: "string";
|
|
369
|
+
readonly description: "Absolute path to the project root (default: process.cwd())";
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
readonly responses: {
|
|
379
|
+
readonly "200": {
|
|
380
|
+
readonly description: "Patch artifact inspection";
|
|
381
|
+
readonly content: {
|
|
382
|
+
readonly "application/json": {
|
|
383
|
+
readonly schema: {
|
|
384
|
+
readonly type: "object";
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
readonly "400": {
|
|
390
|
+
readonly description: "Invalid input";
|
|
391
|
+
readonly content: {
|
|
392
|
+
readonly "application/json": {
|
|
393
|
+
readonly schema: {
|
|
394
|
+
readonly type: "object";
|
|
395
|
+
readonly properties: {
|
|
396
|
+
readonly error: {
|
|
397
|
+
readonly type: "string";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
readonly "/patches/validate": {
|
|
408
|
+
readonly post: {
|
|
409
|
+
readonly operationId: "validatePatchArtifact";
|
|
410
|
+
readonly summary: "Validate a stored patch artifact";
|
|
411
|
+
readonly requestBody: {
|
|
412
|
+
readonly required: true;
|
|
413
|
+
readonly content: {
|
|
414
|
+
readonly "application/json": {
|
|
415
|
+
readonly schema: {
|
|
416
|
+
readonly type: "object";
|
|
417
|
+
readonly required: readonly ["patchFilePath"];
|
|
418
|
+
readonly properties: {
|
|
419
|
+
readonly patchFilePath: {
|
|
420
|
+
readonly type: "string";
|
|
421
|
+
};
|
|
422
|
+
readonly options: {
|
|
423
|
+
readonly type: "object";
|
|
424
|
+
readonly description: "PatchArtifactQueryOptions";
|
|
425
|
+
readonly properties: {
|
|
426
|
+
readonly cwd: {
|
|
427
|
+
readonly type: "string";
|
|
428
|
+
readonly description: "Absolute path to the project root (default: process.cwd())";
|
|
429
|
+
};
|
|
430
|
+
readonly patchesDir: {
|
|
431
|
+
readonly type: "string";
|
|
432
|
+
readonly description: "Directory to write .patch files (default: ./patches)";
|
|
433
|
+
};
|
|
434
|
+
readonly packageManager: {
|
|
435
|
+
readonly type: "string";
|
|
436
|
+
readonly enum: readonly ["npm", "pnpm", "yarn"];
|
|
437
|
+
readonly description: "Package manager override (auto-detected by default)";
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
readonly responses: {
|
|
447
|
+
readonly "200": {
|
|
448
|
+
readonly description: "Patch artifact validation report";
|
|
449
|
+
readonly content: {
|
|
450
|
+
readonly "application/json": {
|
|
451
|
+
readonly schema: {
|
|
452
|
+
readonly type: "object";
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly "400": {
|
|
458
|
+
readonly description: "Invalid input";
|
|
459
|
+
readonly content: {
|
|
460
|
+
readonly "application/json": {
|
|
461
|
+
readonly schema: {
|
|
462
|
+
readonly type: "object";
|
|
463
|
+
readonly properties: {
|
|
464
|
+
readonly error: {
|
|
465
|
+
readonly type: "string";
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
readonly "/health": {
|
|
476
|
+
readonly get: {
|
|
477
|
+
readonly operationId: "health";
|
|
478
|
+
readonly summary: "Health check";
|
|
479
|
+
readonly responses: {
|
|
480
|
+
readonly "200": {
|
|
481
|
+
readonly description: "Server is healthy";
|
|
482
|
+
readonly content: {
|
|
483
|
+
readonly "application/json": {
|
|
484
|
+
readonly schema: {
|
|
485
|
+
readonly type: "object";
|
|
486
|
+
readonly properties: {
|
|
487
|
+
readonly status: {
|
|
488
|
+
readonly type: "string";
|
|
201
489
|
};
|
|
202
490
|
};
|
|
203
491
|
};
|
|
@@ -210,4 +498,23 @@ declare const OPENAPI_SPEC: {
|
|
|
210
498
|
};
|
|
211
499
|
};
|
|
212
500
|
|
|
213
|
-
|
|
501
|
+
/**
|
|
502
|
+
* autoremediator OpenAPI HTTP server
|
|
503
|
+
*
|
|
504
|
+
* Exposes POST /remediate and POST /remediate-from-scan as a lightweight
|
|
505
|
+
* HTTP server using Node.js built-in http module (no framework dependency).
|
|
506
|
+
*
|
|
507
|
+
* Start: node dist/openapi/server.js [--port 3000]
|
|
508
|
+
*/
|
|
509
|
+
|
|
510
|
+
interface OpenApiServerDeps {
|
|
511
|
+
remediateFn: typeof remediate;
|
|
512
|
+
remediateFromScanFn: typeof remediateFromScan;
|
|
513
|
+
planRemediationFn: typeof planRemediation;
|
|
514
|
+
listPatchArtifactsFn: typeof listPatchArtifacts;
|
|
515
|
+
inspectPatchArtifactFn: typeof inspectPatchArtifact;
|
|
516
|
+
validatePatchArtifactFn: typeof validatePatchArtifact;
|
|
517
|
+
}
|
|
518
|
+
declare function createOpenApiServer(deps?: OpenApiServerDeps): http.Server;
|
|
519
|
+
|
|
520
|
+
export { OPENAPI_SPEC, type OpenApiServerDeps, createOpenApiServer };
|