vibecode-anything 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +239 -67
  2. package/dist/cli.js +2140 -73
  3. package/dist/core/adapters.d.ts +26 -3
  4. package/dist/core/adapters.js +411 -25
  5. package/dist/core/agent-adapter.d.ts +67 -0
  6. package/dist/core/agent-adapter.js +312 -0
  7. package/dist/core/anti-cheat.d.ts +6 -0
  8. package/dist/core/anti-cheat.js +372 -0
  9. package/dist/core/badge.d.ts +18 -0
  10. package/dist/core/badge.js +360 -0
  11. package/dist/core/cache.d.ts +47 -0
  12. package/dist/core/cache.js +403 -0
  13. package/dist/core/ci-export.d.ts +35 -0
  14. package/dist/core/ci-export.js +796 -0
  15. package/dist/core/ci-formats.d.ts +21 -0
  16. package/dist/core/ci-formats.js +388 -0
  17. package/dist/core/client-codegen.d.ts +36 -0
  18. package/dist/core/client-codegen.js +2538 -0
  19. package/dist/core/compose.d.ts +71 -0
  20. package/dist/core/compose.js +1088 -0
  21. package/dist/core/docs-export.d.ts +37 -0
  22. package/dist/core/docs-export.js +2706 -0
  23. package/dist/core/doctor.d.ts +21 -1
  24. package/dist/core/doctor.js +234 -21
  25. package/dist/core/exec.d.ts +26 -2
  26. package/dist/core/exec.js +235 -8
  27. package/dist/core/fixtures.d.ts +153 -0
  28. package/dist/core/fixtures.js +2245 -0
  29. package/dist/core/format.d.ts +77 -0
  30. package/dist/core/format.js +632 -0
  31. package/dist/core/fs-snapshot.d.ts +37 -0
  32. package/dist/core/fs-snapshot.js +216 -0
  33. package/dist/core/graphql-export.d.ts +34 -0
  34. package/dist/core/graphql-export.js +2482 -0
  35. package/dist/core/har-export.d.ts +29 -0
  36. package/dist/core/har-export.js +988 -0
  37. package/dist/core/html-report.d.ts +27 -0
  38. package/dist/core/html-report.js +1535 -0
  39. package/dist/core/http-export.d.ts +31 -0
  40. package/dist/core/http-export.js +726 -0
  41. package/dist/core/impact.d.ts +80 -0
  42. package/dist/core/impact.js +1412 -0
  43. package/dist/core/lint.d.ts +38 -0
  44. package/dist/core/lint.js +1111 -0
  45. package/dist/core/load-export.d.ts +37 -0
  46. package/dist/core/load-export.js +1813 -0
  47. package/dist/core/mcp-export.d.ts +35 -0
  48. package/dist/core/mcp-export.js +1736 -0
  49. package/dist/core/mock-server.d.ts +47 -0
  50. package/dist/core/mock-server.js +1722 -0
  51. package/dist/core/openapi-export.d.ts +44 -0
  52. package/dist/core/openapi-export.js +1074 -0
  53. package/dist/core/parity.d.ts +6 -1
  54. package/dist/core/parity.js +36 -1
  55. package/dist/core/playwright-exporter.d.ts +23 -0
  56. package/dist/core/playwright-exporter.js +1343 -0
  57. package/dist/core/png.js +45 -9
  58. package/dist/core/regression.d.ts +54 -0
  59. package/dist/core/regression.js +529 -0
  60. package/dist/core/responsive.d.ts +86 -0
  61. package/dist/core/responsive.js +606 -0
  62. package/dist/core/run.d.ts +74 -0
  63. package/dist/core/run.js +696 -0
  64. package/dist/core/scheduler.d.ts +24 -0
  65. package/dist/core/scheduler.js +162 -0
  66. package/dist/core/schema-export.d.ts +29 -0
  67. package/dist/core/schema-export.js +2215 -0
  68. package/dist/core/schema.d.ts +3 -2
  69. package/dist/core/schema.js +460 -17
  70. package/dist/core/security.d.ts +233 -0
  71. package/dist/core/security.js +1839 -0
  72. package/dist/core/server-export.d.ts +38 -0
  73. package/dist/core/server-export.js +3198 -0
  74. package/dist/core/spec-writer.d.ts +9 -0
  75. package/dist/core/spec-writer.js +1202 -0
  76. package/dist/core/store.d.ts +11 -2
  77. package/dist/core/store.js +128 -8
  78. package/dist/core/target-map.d.ts +34 -0
  79. package/dist/core/target-map.js +262 -0
  80. package/dist/core/test-exporter.d.ts +25 -0
  81. package/dist/core/test-exporter.js +1918 -0
  82. package/dist/core/types.d.ts +182 -14
  83. package/dist/core/visual-semantic.d.ts +67 -0
  84. package/dist/core/visual-semantic.js +673 -0
  85. package/dist/core/visual.js +65 -16
  86. package/dist/core/watch.d.ts +28 -3
  87. package/dist/core/watch.js +222 -12
  88. package/dist/core/yaml.d.ts +5 -0
  89. package/dist/core/yaml.js +1009 -0
  90. package/dist/diagnostics/diagnose.d.ts +53 -0
  91. package/dist/diagnostics/diagnose.js +1083 -0
  92. package/dist/diagnostics/flake.d.ts +71 -0
  93. package/dist/diagnostics/flake.js +608 -0
  94. package/dist/diagnostics/mutation-audit.d.ts +69 -0
  95. package/dist/diagnostics/mutation-audit.js +769 -0
  96. package/dist/diagnostics/spatial.d.ts +42 -0
  97. package/dist/diagnostics/spatial.js +346 -0
  98. package/dist/diagnostics/trends.d.ts +122 -0
  99. package/dist/diagnostics/trends.js +1190 -0
  100. package/dist/discovery/discover.d.ts +111 -0
  101. package/dist/discovery/discover.js +2017 -0
  102. package/dist/discovery/lock.d.ts +116 -0
  103. package/dist/discovery/lock.js +1505 -0
  104. package/dist/discovery/routes.d.ts +36 -0
  105. package/dist/discovery/routes.js +1494 -0
  106. package/dist/discovery/test-importer.d.ts +92 -0
  107. package/dist/discovery/test-importer.js +4952 -0
  108. package/dist/index.d.ts +123 -0
  109. package/dist/index.js +99 -0
  110. package/dist/ingestors/api-collections.d.ts +28 -0
  111. package/dist/ingestors/api-collections.js +2335 -0
  112. package/dist/ingestors/api-repo.d.ts +2 -1
  113. package/dist/ingestors/api-repo.js +483 -85
  114. package/dist/ingestors/asyncapi.d.ts +26 -0
  115. package/dist/ingestors/asyncapi.js +2105 -0
  116. package/dist/ingestors/bridges.d.ts +2 -0
  117. package/dist/ingestors/bridges.js +702 -0
  118. package/dist/ingestors/cli.d.ts +2 -1
  119. package/dist/ingestors/cli.js +234 -46
  120. package/dist/ingestors/curl.d.ts +14 -0
  121. package/dist/ingestors/curl.js +1024 -0
  122. package/dist/ingestors/graphql.d.ts +56 -0
  123. package/dist/ingestors/graphql.js +1852 -0
  124. package/dist/ingestors/http-file.d.ts +20 -0
  125. package/dist/ingestors/http-file.js +923 -0
  126. package/dist/ingestors/index.js +486 -6
  127. package/dist/ingestors/openrpc.d.ts +29 -0
  128. package/dist/ingestors/openrpc.js +1807 -0
  129. package/dist/ingestors/proto.d.ts +47 -0
  130. package/dist/ingestors/proto.js +2690 -0
  131. package/dist/ingestors/trace.d.ts +10 -0
  132. package/dist/ingestors/trace.js +599 -0
  133. package/dist/ingestors/video.d.ts +4 -1
  134. package/dist/ingestors/video.js +86 -36
  135. package/dist/ingestors/web.d.ts +16 -1
  136. package/dist/ingestors/web.js +474 -32
  137. package/dist/mcp/server.js +3532 -67
  138. package/dist/oracles/api-repo.js +102 -30
  139. package/dist/oracles/cli.js +65 -17
  140. package/dist/oracles/http-workflow.d.ts +68 -0
  141. package/dist/oracles/http-workflow.js +828 -0
  142. package/dist/oracles/image.js +178 -28
  143. package/dist/oracles/index.d.ts +3 -1
  144. package/dist/oracles/index.js +243 -14
  145. package/dist/oracles/perf-budget.d.ts +90 -0
  146. package/dist/oracles/perf-budget.js +1329 -0
  147. package/dist/oracles/stream.d.ts +94 -0
  148. package/dist/oracles/stream.js +1268 -0
  149. package/dist/oracles/ui-states.d.ts +49 -0
  150. package/dist/oracles/ui-states.js +894 -0
  151. package/dist/oracles/video.d.ts +1 -1
  152. package/dist/oracles/video.js +232 -16
  153. package/dist/oracles/web.js +464 -73
  154. package/dist/plugins/builtins.d.ts +12 -0
  155. package/dist/plugins/builtins.js +1052 -0
  156. package/dist/plugins/registry.d.ts +86 -0
  157. package/dist/plugins/registry.js +554 -0
  158. package/dist/setup/index.js +145 -33
  159. package/package.json +56 -47
  160. package/skills/vibecode-anything/SKILL.md +75 -52
@@ -0,0 +1,1024 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { VibecodeError, errorMessage } from "../core/errors.js";
4
+ import { validateContract } from "../core/schema.js";
5
+ import { isSensitiveHeader, isSensitiveQueryParam, mergeHeaders, redactHeaders } from "./trace.js";
6
+ const CURL_MAX_INVARIANTS = 50;
7
+ const MAX_JSON_SCHEMA_DEPTH = 16;
8
+ const MAX_JSON_SCHEMA_KEYS = 200;
9
+ const DEFAULT_PROBE_TIMEOUT_MS = 10000;
10
+ const SAFE_METHODS = new Set(["GET", "HEAD", "OPTIONS"]);
11
+ const EXTRA_SENSITIVE_HEADERS = new Set([
12
+ "x-csrf-token",
13
+ "x-xsrf-token",
14
+ "csrf-token"
15
+ ]);
16
+ const SHORT_BOOL_FLAGS = new Set([
17
+ "s", "S", "L", "i", "I", "k", "v", "f", "G", "g", "N", "O", "4", "6", "0"
18
+ ]);
19
+ const SHORT_VALUE_FLAGS = new Set([
20
+ "X", "H", "d", "u", "U", "b", "A", "e", "o", "w", "m", "x", "c", "F", "T"
21
+ ]);
22
+ const LONG_BOOL_FLAGS = new Set([
23
+ "--compressed",
24
+ "--silent",
25
+ "--show-error",
26
+ "--location",
27
+ "--location-trusted",
28
+ "--include",
29
+ "--head",
30
+ "--insecure",
31
+ "--verbose",
32
+ "--fail",
33
+ "--fail-with-body",
34
+ "--get",
35
+ "--globoff",
36
+ "--raw",
37
+ "--no-buffer",
38
+ "--remote-name",
39
+ "--ipv4",
40
+ "--ipv6",
41
+ "--http1.0",
42
+ "--http1.1",
43
+ "--http2",
44
+ "--http3",
45
+ "--tr-encoding",
46
+ "--tcp-nodelay",
47
+ "--no-keepalive"
48
+ ]);
49
+ const LONG_SKIP_VALUE_FLAGS = new Set([
50
+ "--referer",
51
+ "--output",
52
+ "--write-out",
53
+ "--max-time",
54
+ "--connect-timeout",
55
+ "--proxy",
56
+ "--cookie-jar",
57
+ "--resolve",
58
+ "--cacert",
59
+ "--cert",
60
+ "--key",
61
+ "--retry",
62
+ "--retry-delay",
63
+ "--interface",
64
+ "--ciphers",
65
+ "--tls-max",
66
+ "--proto",
67
+ "--max-redirs",
68
+ "--upload-file"
69
+ ]);
70
+ function isObject(v) {
71
+ return v !== null && typeof v === "object" && !Array.isArray(v);
72
+ }
73
+ function isCurlSensitiveHeader(name) {
74
+ const lower = name.trim().toLowerCase();
75
+ return isSensitiveHeader(lower) || EXTRA_SENSITIVE_HEADERS.has(lower);
76
+ }
77
+ function stripSensitiveHeaders(headers) {
78
+ if (!isObject(headers))
79
+ return { safe: {}, redacted: false };
80
+ const candidate = {};
81
+ let redacted = false;
82
+ for (const [rawKey, rawVal] of Object.entries(headers)) {
83
+ const key = rawKey.trim();
84
+ if (!key || rawVal === undefined || rawVal === null)
85
+ continue;
86
+ if (isCurlSensitiveHeader(key)) {
87
+ redacted = true;
88
+ continue;
89
+ }
90
+ candidate[key] = String(rawVal);
91
+ }
92
+ const safe = redactHeaders(candidate, "strip");
93
+ if (Object.keys(safe).length < Object.keys(candidate).length) {
94
+ redacted = true;
95
+ }
96
+ return { safe, redacted };
97
+ }
98
+ function setHeaderCaseInsensitive(headers, name, value) {
99
+ const lower = name.toLowerCase();
100
+ for (const existingKey of Object.keys(headers)) {
101
+ if (existingKey.toLowerCase() === lower && existingKey !== name) {
102
+ delete headers[existingKey];
103
+ }
104
+ }
105
+ headers[name] = value;
106
+ }
107
+ function deleteHeaderCaseInsensitive(headers, name) {
108
+ const lower = name.toLowerCase();
109
+ for (const existingKey of Object.keys(headers)) {
110
+ if (existingKey.toLowerCase() === lower) {
111
+ delete headers[existingKey];
112
+ }
113
+ }
114
+ }
115
+ function hasHeaderCaseInsensitive(headers, name) {
116
+ const lower = name.toLowerCase();
117
+ return Object.keys(headers).some((k) => k.toLowerCase() === lower);
118
+ }
119
+ function isCurlCommandToken(token) {
120
+ if (!token)
121
+ return false;
122
+ const base = path.posix.basename(token.replace(/\\/g, "/")).toLowerCase();
123
+ return base === "curl" || base === "curl.exe";
124
+ }
125
+ function decodeAnsiCEscape(text, startIndex) {
126
+ const ch = text[startIndex];
127
+ if (ch === undefined)
128
+ return { char: "\\", nextIndex: startIndex };
129
+ switch (ch) {
130
+ case "n": return { char: "\n", nextIndex: startIndex + 1 };
131
+ case "r": return { char: "\r", nextIndex: startIndex + 1 };
132
+ case "t": return { char: "\t", nextIndex: startIndex + 1 };
133
+ case "'": return { char: "'", nextIndex: startIndex + 1 };
134
+ case '"': return { char: '"', nextIndex: startIndex + 1 };
135
+ case "\\": return { char: "\\", nextIndex: startIndex + 1 };
136
+ case "b": return { char: "\b", nextIndex: startIndex + 1 };
137
+ case "f": return { char: "\f", nextIndex: startIndex + 1 };
138
+ case "v": return { char: "\v", nextIndex: startIndex + 1 };
139
+ case "a": return { char: "\x07", nextIndex: startIndex + 1 };
140
+ case "e":
141
+ case "E": return { char: "\x1b", nextIndex: startIndex + 1 };
142
+ case "x": {
143
+ const m = /^[0-9a-fA-F]{1,2}/.exec(text.slice(startIndex + 1));
144
+ if (m) {
145
+ return { char: String.fromCharCode(parseInt(m[0], 16)), nextIndex: startIndex + 1 + m[0].length };
146
+ }
147
+ return { char: "\\x", nextIndex: startIndex + 1 };
148
+ }
149
+ case "u": {
150
+ const m = /^[0-9a-fA-F]{1,4}/.exec(text.slice(startIndex + 1));
151
+ if (m) {
152
+ return { char: String.fromCharCode(parseInt(m[0], 16)), nextIndex: startIndex + 1 + m[0].length };
153
+ }
154
+ return { char: "\\u", nextIndex: startIndex + 1 };
155
+ }
156
+ case "U": {
157
+ const m = /^[0-9a-fA-F]{1,8}/.exec(text.slice(startIndex + 1));
158
+ if (m) {
159
+ const code = parseInt(m[0], 16);
160
+ if (code <= 0x10ffff) {
161
+ return { char: String.fromCodePoint(code), nextIndex: startIndex + 1 + m[0].length };
162
+ }
163
+ }
164
+ return { char: "\\U", nextIndex: startIndex + 1 };
165
+ }
166
+ default: {
167
+ if (ch >= "0" && ch <= "7") {
168
+ const m = /^[0-7]{1,3}/.exec(text.slice(startIndex));
169
+ if (m) {
170
+ return { char: String.fromCharCode(parseInt(m[0], 8) & 0xff), nextIndex: startIndex + m[0].length };
171
+ }
172
+ }
173
+ return { char: `\\${ch}`, nextIndex: startIndex + 1 };
174
+ }
175
+ }
176
+ }
177
+ /**
178
+ * Single-pass shell tokenizer that joins POSIX (`\`) and Windows cmd (`^`) line
179
+ * continuations, splits multi-command scripts on unquoted `;`, `&&`, `||`, `|`,
180
+ * and newlines, and decodes `'...'`, `"..."`, `$'...'`, and cmd `^"...^"` quotes.
181
+ */
182
+ function tokenizeShellCommands(rawText) {
183
+ const text = rawText.charCodeAt(0) === 0xfeff ? rawText.slice(1) : rawText;
184
+ const commands = [];
185
+ let currentCmd = [];
186
+ let currentTok = "";
187
+ let inToken = false;
188
+ const flushToken = () => {
189
+ if (inToken) {
190
+ currentCmd.push(currentTok);
191
+ currentTok = "";
192
+ inToken = false;
193
+ }
194
+ };
195
+ const flushCommand = () => {
196
+ flushToken();
197
+ if (currentCmd.length > 0) {
198
+ commands.push(currentCmd);
199
+ currentCmd = [];
200
+ }
201
+ };
202
+ let i = 0;
203
+ const len = text.length;
204
+ while (i < len) {
205
+ const ch = text[i];
206
+ // Comments (only when not mid-token)
207
+ if (!inToken && ch === "#") {
208
+ while (i < len && text[i] !== "\n")
209
+ i += 1;
210
+ continue;
211
+ }
212
+ // POSIX line continuation: `\` + `\r?\n`
213
+ if (ch === "\\") {
214
+ if (text[i + 1] === "\n") {
215
+ i += 2;
216
+ continue;
217
+ }
218
+ if (text[i + 1] === "\r" && text[i + 2] === "\n") {
219
+ i += 3;
220
+ continue;
221
+ }
222
+ if (i + 1 < len) {
223
+ currentTok += text[i + 1];
224
+ inToken = true;
225
+ i += 2;
226
+ continue;
227
+ }
228
+ currentTok += "\\";
229
+ inToken = true;
230
+ i += 1;
231
+ continue;
232
+ }
233
+ // Windows cmd line continuation: `^` + `[ \t]*\r?\n`
234
+ if (ch === "^") {
235
+ let k = i + 1;
236
+ while (k < len && (text[k] === " " || text[k] === "\t"))
237
+ k += 1;
238
+ if (text[k] === "\n") {
239
+ i = k + 1;
240
+ continue;
241
+ }
242
+ if (text[k] === "\r" && text[k + 1] === "\n") {
243
+ i = k + 2;
244
+ continue;
245
+ }
246
+ // Chrome DevTools "Copy as cURL (cmd)" caret-quoted string: `^"...^"`
247
+ if (text[i + 1] === '"') {
248
+ inToken = true;
249
+ i += 2;
250
+ while (i < len) {
251
+ if (text.startsWith('^\\^"', i)) {
252
+ currentTok += '"';
253
+ i += 4;
254
+ continue;
255
+ }
256
+ if (text[i] === "^" && text[i + 1] === '"') {
257
+ i += 2;
258
+ break;
259
+ }
260
+ if (text[i] === "^") {
261
+ let ck = i + 1;
262
+ while (ck < len && (text[ck] === " " || text[ck] === "\t"))
263
+ ck += 1;
264
+ if (text[ck] === "\n") {
265
+ i = ck + 1;
266
+ continue;
267
+ }
268
+ if (text[ck] === "\r" && text[ck + 1] === "\n") {
269
+ i = ck + 2;
270
+ continue;
271
+ }
272
+ if (i + 1 < len) {
273
+ currentTok += text[i + 1];
274
+ i += 2;
275
+ continue;
276
+ }
277
+ }
278
+ currentTok += text[i];
279
+ i += 1;
280
+ }
281
+ continue;
282
+ }
283
+ }
284
+ // Command boundary separators (outside quotes)
285
+ if (ch === "\n" || ch === "\r") {
286
+ flushCommand();
287
+ i += 1;
288
+ continue;
289
+ }
290
+ if (ch === ";") {
291
+ flushCommand();
292
+ i += 1;
293
+ continue;
294
+ }
295
+ if (ch === "&" && text[i + 1] === "&") {
296
+ flushCommand();
297
+ i += 2;
298
+ continue;
299
+ }
300
+ if (ch === "|") {
301
+ flushCommand();
302
+ i += text[i + 1] === "|" ? 2 : 1;
303
+ continue;
304
+ }
305
+ // Horizontal whitespace
306
+ if (ch === " " || ch === "\t") {
307
+ flushToken();
308
+ i += 1;
309
+ continue;
310
+ }
311
+ // ANSI-C quoting: `$'...'`
312
+ if (ch === "$" && text[i + 1] === "'") {
313
+ inToken = true;
314
+ i += 2;
315
+ while (i < len && text[i] !== "'") {
316
+ if (text[i] === "\\") {
317
+ const decoded = decodeAnsiCEscape(text, i + 1);
318
+ currentTok += decoded.char;
319
+ i = decoded.nextIndex;
320
+ }
321
+ else {
322
+ currentTok += text[i];
323
+ i += 1;
324
+ }
325
+ }
326
+ if (i < len && text[i] === "'")
327
+ i += 1;
328
+ continue;
329
+ }
330
+ // Single quotes: `'...'`
331
+ if (ch === "'") {
332
+ inToken = true;
333
+ i += 1;
334
+ while (i < len && text[i] !== "'") {
335
+ currentTok += text[i];
336
+ i += 1;
337
+ }
338
+ if (i < len && text[i] === "'")
339
+ i += 1;
340
+ continue;
341
+ }
342
+ // Double quotes: `"..."`
343
+ if (ch === '"') {
344
+ inToken = true;
345
+ i += 1;
346
+ while (i < len && text[i] !== '"') {
347
+ if (text[i] === "\\") {
348
+ if (text[i + 1] === "\n") {
349
+ i += 2;
350
+ continue;
351
+ }
352
+ if (text[i + 1] === "\r" && text[i + 2] === "\n") {
353
+ i += 3;
354
+ continue;
355
+ }
356
+ const next = text[i + 1];
357
+ if (next === '"' || next === "\\" || next === "$" || next === "`") {
358
+ currentTok += next;
359
+ i += 2;
360
+ continue;
361
+ }
362
+ }
363
+ currentTok += text[i];
364
+ i += 1;
365
+ }
366
+ if (i < len && text[i] === '"')
367
+ i += 1;
368
+ continue;
369
+ }
370
+ // Ordinary character
371
+ currentTok += ch;
372
+ inToken = true;
373
+ i += 1;
374
+ }
375
+ flushCommand();
376
+ return commands;
377
+ }
378
+ function encodeDataUrlencodePart(raw) {
379
+ const eqIdx = raw.indexOf("=");
380
+ if (eqIdx === 0) {
381
+ return encodeURIComponent(raw.slice(1));
382
+ }
383
+ if (eqIdx > 0) {
384
+ const key = raw.slice(0, eqIdx);
385
+ const val = raw.slice(eqIdx + 1);
386
+ return `${key}=${encodeURIComponent(val)}`;
387
+ }
388
+ return encodeURIComponent(raw);
389
+ }
390
+ function parseSingleCurlTokens(tokens) {
391
+ if (tokens.length < 2 || !isCurlCommandToken(tokens[0])) {
392
+ return null;
393
+ }
394
+ let explicitMethod = null;
395
+ let isHead = false;
396
+ let useGet = false;
397
+ let hasData = false;
398
+ let hasJsonFlag = false;
399
+ let hasFormFlag = false;
400
+ let rawUrl = "";
401
+ let redactedSecrets = false;
402
+ const dataParts = [];
403
+ const rawHeaders = {};
404
+ let basicUser = null;
405
+ let cookieFlagVal = null;
406
+ let afterDoubleDash = false;
407
+ const applyHeader = (headerLine) => {
408
+ const colonIdx = headerLine.indexOf(":");
409
+ if (colonIdx <= 0)
410
+ return;
411
+ const name = headerLine.slice(0, colonIdx).trim();
412
+ const value = headerLine.slice(colonIdx + 1).trim();
413
+ if (!name)
414
+ return;
415
+ if (isCurlSensitiveHeader(name)) {
416
+ redactedSecrets = true;
417
+ }
418
+ if (value === "") {
419
+ deleteHeaderCaseInsensitive(rawHeaders, name);
420
+ return;
421
+ }
422
+ setHeaderCaseInsensitive(rawHeaders, name, value);
423
+ };
424
+ let idx = 1;
425
+ const takeNext = () => {
426
+ if (idx + 1 < tokens.length) {
427
+ idx += 1;
428
+ return tokens[idx];
429
+ }
430
+ return undefined;
431
+ };
432
+ for (; idx < tokens.length; idx += 1) {
433
+ const arg = tokens[idx];
434
+ if (afterDoubleDash) {
435
+ if (!rawUrl && /^https?:\/\//i.test(arg))
436
+ rawUrl = arg;
437
+ continue;
438
+ }
439
+ if (arg === "--") {
440
+ afterDoubleDash = true;
441
+ continue;
442
+ }
443
+ // Long options (`--...`)
444
+ if (arg.startsWith("--")) {
445
+ const eqIdx = arg.indexOf("=");
446
+ const flag = eqIdx > 0 ? arg.slice(0, eqIdx) : arg;
447
+ const inlineVal = eqIdx > 0 ? arg.slice(eqIdx + 1) : undefined;
448
+ const getVal = () => (inlineVal !== undefined ? inlineVal : takeNext());
449
+ if (flag === "--request") {
450
+ const val = getVal();
451
+ if (val && val.trim())
452
+ explicitMethod = val.trim().toUpperCase();
453
+ continue;
454
+ }
455
+ if (flag === "--header") {
456
+ const val = getVal();
457
+ if (val !== undefined)
458
+ applyHeader(val);
459
+ continue;
460
+ }
461
+ if (flag === "--data" || flag === "--data-raw" || flag === "--data-binary" || flag === "--data-ascii") {
462
+ const val = getVal();
463
+ if (val !== undefined) {
464
+ dataParts.push(val);
465
+ hasData = true;
466
+ }
467
+ continue;
468
+ }
469
+ if (flag === "--data-urlencode") {
470
+ const val = getVal();
471
+ if (val !== undefined) {
472
+ dataParts.push(encodeDataUrlencodePart(val));
473
+ hasData = true;
474
+ }
475
+ continue;
476
+ }
477
+ if (flag === "--json") {
478
+ const val = getVal();
479
+ if (val !== undefined) {
480
+ dataParts.push(val);
481
+ hasData = true;
482
+ hasJsonFlag = true;
483
+ }
484
+ continue;
485
+ }
486
+ if (flag === "--get") {
487
+ useGet = true;
488
+ continue;
489
+ }
490
+ if (flag === "--head") {
491
+ isHead = true;
492
+ continue;
493
+ }
494
+ if (flag === "--user") {
495
+ const val = getVal();
496
+ if (val !== undefined) {
497
+ basicUser = val;
498
+ redactedSecrets = true;
499
+ }
500
+ continue;
501
+ }
502
+ if (flag === "--proxy-user" || flag === "--oauth2-bearer") {
503
+ const val = getVal();
504
+ if (val !== undefined)
505
+ redactedSecrets = true;
506
+ continue;
507
+ }
508
+ if (flag === "--cookie") {
509
+ const val = getVal();
510
+ if (val !== undefined) {
511
+ cookieFlagVal = val;
512
+ redactedSecrets = true;
513
+ }
514
+ continue;
515
+ }
516
+ if (flag === "--user-agent") {
517
+ const val = getVal();
518
+ if (val !== undefined && val.trim()) {
519
+ setHeaderCaseInsensitive(rawHeaders, "User-Agent", val);
520
+ }
521
+ continue;
522
+ }
523
+ if (flag === "--url") {
524
+ const val = getVal();
525
+ if (val && val.trim())
526
+ rawUrl = val.trim();
527
+ continue;
528
+ }
529
+ if (flag === "--form" || flag === "--form-string") {
530
+ getVal();
531
+ hasFormFlag = true;
532
+ continue;
533
+ }
534
+ if (LONG_BOOL_FLAGS.has(flag)) {
535
+ continue;
536
+ }
537
+ if (LONG_SKIP_VALUE_FLAGS.has(flag)) {
538
+ getVal();
539
+ continue;
540
+ }
541
+ // Unknown long option: skip without consuming a positional URL
542
+ continue;
543
+ }
544
+ // Short options (`-X`, `-sSL`, `-XPOST`, etc.)
545
+ if (arg.startsWith("-") && arg.length > 1) {
546
+ for (let j = 1; j < arg.length; j += 1) {
547
+ const c = arg[j];
548
+ if (SHORT_BOOL_FLAGS.has(c)) {
549
+ if (c === "I")
550
+ isHead = true;
551
+ if (c === "G")
552
+ useGet = true;
553
+ continue;
554
+ }
555
+ if (SHORT_VALUE_FLAGS.has(c)) {
556
+ const val = j + 1 < arg.length ? arg.slice(j + 1) : takeNext();
557
+ if (val !== undefined) {
558
+ if (c === "X") {
559
+ if (val.trim())
560
+ explicitMethod = val.trim().toUpperCase();
561
+ }
562
+ else if (c === "H") {
563
+ applyHeader(val);
564
+ }
565
+ else if (c === "d") {
566
+ dataParts.push(val);
567
+ hasData = true;
568
+ }
569
+ else if (c === "u") {
570
+ basicUser = val;
571
+ redactedSecrets = true;
572
+ }
573
+ else if (c === "U") {
574
+ redactedSecrets = true;
575
+ }
576
+ else if (c === "b") {
577
+ cookieFlagVal = val;
578
+ redactedSecrets = true;
579
+ }
580
+ else if (c === "A") {
581
+ if (val.trim())
582
+ setHeaderCaseInsensitive(rawHeaders, "User-Agent", val);
583
+ }
584
+ else if (c === "F") {
585
+ hasFormFlag = true;
586
+ }
587
+ }
588
+ break;
589
+ }
590
+ // Unknown short flag char: stop parsing this flag cluster
591
+ break;
592
+ }
593
+ continue;
594
+ }
595
+ // Positional URL argument (`http://` or `https://`)
596
+ if (!rawUrl && /^https?:\/\//i.test(arg)) {
597
+ rawUrl = arg;
598
+ }
599
+ }
600
+ if (!rawUrl)
601
+ return null;
602
+ let parsedUrl;
603
+ try {
604
+ parsedUrl = new URL(rawUrl);
605
+ }
606
+ catch {
607
+ return null;
608
+ }
609
+ if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
610
+ return null;
611
+ }
612
+ // Strip URL userinfo (`https://user:pass@host`)
613
+ let urlUserinfoAuth = null;
614
+ if (parsedUrl.username || parsedUrl.password) {
615
+ redactedSecrets = true;
616
+ try {
617
+ const decUser = decodeURIComponent(parsedUrl.username);
618
+ const decPass = decodeURIComponent(parsedUrl.password);
619
+ urlUserinfoAuth = `${decUser}:${decPass}`;
620
+ }
621
+ catch {
622
+ urlUserinfoAuth = `${parsedUrl.username}:${parsedUrl.password}`;
623
+ }
624
+ parsedUrl.username = "";
625
+ parsedUrl.password = "";
626
+ }
627
+ // Resolve HTTP method
628
+ let method;
629
+ if (explicitMethod) {
630
+ method = explicitMethod;
631
+ }
632
+ else if (useGet) {
633
+ method = "GET";
634
+ }
635
+ else if (isHead) {
636
+ method = "HEAD";
637
+ }
638
+ else if (hasData || hasFormFlag) {
639
+ method = "POST";
640
+ }
641
+ else {
642
+ method = "GET";
643
+ }
644
+ // Collect and sanitize URL query params (and `-G -d` data params)
645
+ const safeSearchParams = new URLSearchParams();
646
+ const safeQuery = {};
647
+ const addQueryParam = (rawKey, rawVal) => {
648
+ const key = rawKey.trim();
649
+ if (!key)
650
+ return;
651
+ if (isSensitiveQueryParam(key)) {
652
+ redactedSecrets = true;
653
+ return;
654
+ }
655
+ safeSearchParams.append(rawKey, rawVal);
656
+ safeQuery[rawKey] = rawVal;
657
+ };
658
+ for (const [k, v] of parsedUrl.searchParams.entries()) {
659
+ addQueryParam(k, v);
660
+ }
661
+ let body = undefined;
662
+ if (hasData) {
663
+ const joinedData = dataParts.join("&");
664
+ if (useGet) {
665
+ const dataParams = new URLSearchParams(joinedData);
666
+ for (const [k, v] of dataParams.entries()) {
667
+ addQueryParam(k, v);
668
+ }
669
+ }
670
+ else {
671
+ const trimmedBody = joinedData.trim();
672
+ if (trimmedBody.length > 0) {
673
+ try {
674
+ body = JSON.parse(trimmedBody);
675
+ }
676
+ catch {
677
+ body = joinedData;
678
+ }
679
+ }
680
+ else {
681
+ body = joinedData;
682
+ }
683
+ }
684
+ }
685
+ if (hasJsonFlag && !hasHeaderCaseInsensitive(rawHeaders, "content-type")) {
686
+ setHeaderCaseInsensitive(rawHeaders, "content-type", "application/json");
687
+ }
688
+ const { safe: safeHeaders, redacted: headersRedacted } = stripSensitiveHeaders(rawHeaders);
689
+ if (headersRedacted)
690
+ redactedSecrets = true;
691
+ // Ephemeral runtime headers for live probing ONLY — NEVER persisted!
692
+ const runtimeHeaders = { ...rawHeaders };
693
+ const authCreds = basicUser ?? urlUserinfoAuth;
694
+ if (authCreds !== null && !hasHeaderCaseInsensitive(runtimeHeaders, "authorization")) {
695
+ const encoded = Buffer.from(authCreds, "utf8").toString("base64");
696
+ setHeaderCaseInsensitive(runtimeHeaders, "Authorization", `Basic ${encoded}`);
697
+ }
698
+ if (cookieFlagVal !== null && cookieFlagVal.includes("=") && !hasHeaderCaseInsensitive(runtimeHeaders, "cookie")) {
699
+ setHeaderCaseInsensitive(runtimeHeaders, "Cookie", cookieFlagVal);
700
+ }
701
+ const pathname = parsedUrl.pathname || "/";
702
+ const origin = parsedUrl.origin;
703
+ const serializedSearch = safeSearchParams.toString();
704
+ const sanitizedUrl = `${origin}${pathname}${serializedSearch ? `?${serializedSearch}` : ""}`;
705
+ return {
706
+ request: {
707
+ method,
708
+ url: sanitizedUrl,
709
+ origin,
710
+ pathname,
711
+ query: safeQuery,
712
+ headers: safeHeaders,
713
+ body,
714
+ redactedSecrets
715
+ },
716
+ runtimeHeaders
717
+ };
718
+ }
719
+ function parseCurlCommandsInternal(text) {
720
+ const commandTokenLists = tokenizeShellCommands(text);
721
+ const parsed = [];
722
+ for (const tokens of commandTokenLists) {
723
+ if (!isCurlCommandToken(tokens[0]))
724
+ continue;
725
+ const item = parseSingleCurlTokens(tokens);
726
+ if (item)
727
+ parsed.push(item);
728
+ }
729
+ return parsed;
730
+ }
731
+ export function isCurlCommandText(text) {
732
+ if (typeof text !== "string" || !text.trim())
733
+ return false;
734
+ return parseCurlCommandsInternal(text).length > 0;
735
+ }
736
+ export function parseCurlCommands(text) {
737
+ if (typeof text !== "string" || !text.trim()) {
738
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", "cURL input is empty or not a string");
739
+ }
740
+ const items = parseCurlCommandsInternal(text);
741
+ if (items.length === 0) {
742
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", "No valid cURL commands with HTTP(S) URLs found");
743
+ }
744
+ return items.map((item) => item.request);
745
+ }
746
+ function synthesizeSchema(value, depth = 0) {
747
+ if (depth >= MAX_JSON_SCHEMA_DEPTH)
748
+ return {};
749
+ if (value === null)
750
+ return { type: "null" };
751
+ if (Array.isArray(value)) {
752
+ return { type: "array", items: value.length ? synthesizeSchema(value[0], depth + 1) : {} };
753
+ }
754
+ if (isObject(value)) {
755
+ const entries = Object.entries(value).slice(0, MAX_JSON_SCHEMA_KEYS);
756
+ const properties = {};
757
+ const required = [];
758
+ for (const [k, v] of entries) {
759
+ properties[k] = synthesizeSchema(v, depth + 1);
760
+ required.push(k);
761
+ }
762
+ return { type: "object", required, properties };
763
+ }
764
+ if (Number.isInteger(value))
765
+ return { type: "integer" };
766
+ return { type: typeof value };
767
+ }
768
+ async function fetchJson(url, { method = "GET", headers = {}, body, timeoutMs = DEFAULT_PROBE_TIMEOUT_MS } = {}) {
769
+ const ctrl = new AbortController();
770
+ const t = setTimeout(() => ctrl.abort(), timeoutMs);
771
+ const upperMethod = method.toUpperCase();
772
+ const canHaveBody = upperMethod !== "GET" && upperMethod !== "HEAD";
773
+ const serializedBody = !canHaveBody || body === undefined || body === null
774
+ ? undefined
775
+ : typeof body === "string"
776
+ ? body
777
+ : JSON.stringify(body);
778
+ try {
779
+ const res = await fetch(url, {
780
+ method: upperMethod,
781
+ headers,
782
+ body: serializedBody,
783
+ signal: ctrl.signal
784
+ });
785
+ const text = await res.text();
786
+ let json = null;
787
+ try {
788
+ json = text ? JSON.parse(text) : null;
789
+ }
790
+ catch {
791
+ // ignore non-JSON body
792
+ }
793
+ const headersObj = {};
794
+ for (const [k, v] of res.headers.entries())
795
+ headersObj[k.toLowerCase()] = v;
796
+ return { status: res.status, headers: headersObj, text, json };
797
+ }
798
+ finally {
799
+ clearTimeout(t);
800
+ }
801
+ }
802
+ function buildProbeUrl(baseUrl, pathname, query) {
803
+ const normalizedBase = /^https?:\/\//i.test(baseUrl) ? baseUrl : `http://${baseUrl}`;
804
+ const baseObj = new URL(normalizedBase);
805
+ baseObj.username = "";
806
+ baseObj.password = "";
807
+ const basePath = baseObj.pathname.replace(/\/$/, "");
808
+ const cleanPath = pathname.startsWith("/") ? pathname : `/${pathname}`;
809
+ const url = new URL(baseObj.origin);
810
+ url.pathname = `${basePath}${cleanPath}` || "/";
811
+ for (const [k, v] of Object.entries(query)) {
812
+ url.searchParams.set(k, v);
813
+ }
814
+ return url.toString();
815
+ }
816
+ function sanitizeBaseUrl(rawBase) {
817
+ try {
818
+ const normalized = /^https?:\/\//i.test(rawBase) ? rawBase : `http://${rawBase}`;
819
+ const u = new URL(normalized);
820
+ if (u.protocol !== "http:" && u.protocol !== "https:")
821
+ return "";
822
+ const basePath = u.pathname.replace(/\/+$/, "");
823
+ return `${u.origin}${basePath}`;
824
+ }
825
+ catch {
826
+ return "";
827
+ }
828
+ }
829
+ function slugify(text, fallback = "root") {
830
+ const s = String(text || "")
831
+ .toLowerCase()
832
+ .replace(/[^a-z0-9]+/g, "-")
833
+ .replace(/^-+|-+$/g, "")
834
+ .slice(0, 64);
835
+ return s || fallback;
836
+ }
837
+ function uniqueId(base, used) {
838
+ let id = slugify(base, "inv");
839
+ if (!id.startsWith("inv-"))
840
+ id = `inv-${id}`;
841
+ if (!used.has(id)) {
842
+ used.add(id);
843
+ return id;
844
+ }
845
+ let n = 2;
846
+ while (used.has(`${id}-${n}`))
847
+ n += 1;
848
+ const out = `${id}-${n}`;
849
+ used.add(out);
850
+ return out;
851
+ }
852
+ function validateInvariantsOrThrow(invariants) {
853
+ const contract = {
854
+ schemaVersion: "0.2.0",
855
+ target: { name: "curl", domains: ["api"], sources: [{ id: "src-1", kind: "curl", ref: "inline", meta: {} }] },
856
+ artifacts: { root: ".vibecode/artifacts", files: {} },
857
+ thresholds: { hardBehavioralParity: 1, softPerceptualParity: 0.85, softGateMode: "warn", defaults: {} },
858
+ invariants
859
+ };
860
+ const res = validateContract(contract);
861
+ if (!res.ok) {
862
+ const err = res.errors[0];
863
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", `curl ingestor produced invalid invariant: ${err.path} ${err.message}`, { details: res.errors });
864
+ }
865
+ }
866
+ export async function ingestCurl(options = {}, deps = {}) {
867
+ if (typeof options.source !== "string" || !options.source.trim()) {
868
+ throw new VibecodeError("TARGET_MISSING", "cURL ingestor requires --source <file.curl-or-curl-command>");
869
+ }
870
+ const cwd = options.cwd || process.cwd();
871
+ const rawSource = options.source;
872
+ const trimmedSource = rawSource.trim();
873
+ let rawText = "";
874
+ let isFileSource = false;
875
+ if (!/[\r\n]/.test(trimmedSource)) {
876
+ const candidatePath = path.resolve(cwd, trimmedSource);
877
+ let isRegularFile = false;
878
+ try {
879
+ isRegularFile = fs.existsSync(candidatePath) && fs.statSync(candidatePath).isFile();
880
+ }
881
+ catch {
882
+ isRegularFile = false;
883
+ }
884
+ if (isRegularFile) {
885
+ isFileSource = true;
886
+ try {
887
+ rawText = fs.readFileSync(candidatePath, "utf8");
888
+ }
889
+ catch (err) {
890
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", `Failed to read cURL file ${trimmedSource}: ${errorMessage(err)}`);
891
+ }
892
+ }
893
+ }
894
+ if (!isFileSource) {
895
+ if (!isCurlCommandText(rawSource)) {
896
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", "Source is neither an existing file nor valid cURL command text");
897
+ }
898
+ rawText = rawSource;
899
+ }
900
+ const parsedEntries = parseCurlCommandsInternal(rawText);
901
+ if (parsedEntries.length === 0) {
902
+ throw new VibecodeError("BRIDGE_FORMAT_ERROR", "No valid cURL commands with HTTP(S) URLs found");
903
+ }
904
+ const includeMutating = options.includeMutating === true;
905
+ const offline = options.offline === true;
906
+ const globalHeaders = isObject(options.headers) ? options.headers : undefined;
907
+ const baseUrlOverride = typeof options.baseUrl === "string" && options.baseUrl.trim() ? options.baseUrl.trim() : "";
908
+ const timeoutMs = typeof deps.timeoutMs === "number" && deps.timeoutMs > 0 ? deps.timeoutMs : DEFAULT_PROBE_TIMEOUT_MS;
909
+ const doFetch = deps.fetchJson || fetchJson;
910
+ const warnings = [];
911
+ const filtered = [];
912
+ let skippedMutatingCount = 0;
913
+ for (const entry of parsedEntries) {
914
+ if (!SAFE_METHODS.has(entry.request.method) && !includeMutating) {
915
+ skippedMutatingCount += 1;
916
+ continue;
917
+ }
918
+ filtered.push(entry);
919
+ }
920
+ if (skippedMutatingCount > 0) {
921
+ warnings.push({
922
+ code: "BRIDGE_FORMAT_WARNING",
923
+ message: `Skipped ${skippedMutatingCount} mutating cURL request(s) (POST/PUT/PATCH/DELETE); pass includeMutating: true to include them.`,
924
+ details: { skippedMutatingCount }
925
+ });
926
+ }
927
+ let selected = filtered;
928
+ if (filtered.length > CURL_MAX_INVARIANTS) {
929
+ selected = filtered.slice(0, CURL_MAX_INVARIANTS);
930
+ warnings.push({
931
+ code: "BRIDGE_FORMAT_WARNING",
932
+ message: `cURL input exceeded maximum of ${CURL_MAX_INVARIANTS} emitted invariants; remaining requests were skipped.`
933
+ });
934
+ }
935
+ const usedIds = new Set();
936
+ const invariants = [];
937
+ const firstOrigin = parsedEntries[0]?.request.origin || "";
938
+ const anyRedactedSecrets = parsedEntries.some((entry) => entry.request.redactedSecrets);
939
+ for (const entry of selected) {
940
+ const req = entry.request;
941
+ const probeHeaders = mergeHeaders(entry.runtimeHeaders, globalHeaders);
942
+ const persistedHeaders = stripSensitiveHeaders(mergeHeaders(req.headers, globalHeaders)).safe;
943
+ const probeUrl = baseUrlOverride ? buildProbeUrl(baseUrlOverride, req.pathname, req.query) : req.url;
944
+ let observed = null;
945
+ let probeFailed = null;
946
+ if (!offline) {
947
+ try {
948
+ observed = await doFetch(probeUrl, {
949
+ method: req.method,
950
+ headers: probeHeaders,
951
+ body: req.body,
952
+ timeoutMs
953
+ });
954
+ }
955
+ catch (err) {
956
+ probeFailed = err;
957
+ }
958
+ }
959
+ const expected = {};
960
+ if (observed) {
961
+ expected.status = observed.status;
962
+ if (observed.json !== null && (isObject(observed.json) || Array.isArray(observed.json))) {
963
+ expected.jsonSchema = synthesizeSchema(observed.json);
964
+ }
965
+ if (observed.json !== null && isObject(observed.json)) {
966
+ expected.jsonSubset = observed.json;
967
+ }
968
+ }
969
+ else {
970
+ expected.status = 200;
971
+ if (offline) {
972
+ warnings.push({
973
+ code: "ADAPTER_DEGRADED",
974
+ message: `Offline spec-only mode: emitted ${req.method} ${req.pathname} without live HTTP probe.`
975
+ });
976
+ }
977
+ else {
978
+ warnings.push({
979
+ code: "EXEC_ERROR",
980
+ message: `Live probe failed for ${req.method} ${req.pathname}; fell back to spec-only status 200: ${probeFailed ? errorMessage(probeFailed) : "unknown error"}`
981
+ });
982
+ }
983
+ }
984
+ const input = {
985
+ method: req.method,
986
+ path: req.pathname,
987
+ ...(Object.keys(req.query).length > 0 ? { query: { ...req.query } } : {}),
988
+ ...(Object.keys(persistedHeaders).length > 0 ? { headers: persistedHeaders } : {}),
989
+ ...(req.body !== undefined ? { body: req.body } : {})
990
+ };
991
+ invariants.push({
992
+ id: uniqueId(`inv-curl-${req.method.toLowerCase()}-${slugify(req.pathname)}`, usedIds),
993
+ domain: "api",
994
+ type: "http",
995
+ severity: "hard",
996
+ description: `cURL ${req.method} ${req.pathname} matches ${observed ? "observed" : "spec-only"} HTTP contract`,
997
+ tags: ["api", "http", "curl", observed ? "observed" : "spec-only"],
998
+ sourceId: "src-1",
999
+ input,
1000
+ expected,
1001
+ tolerance: {}
1002
+ });
1003
+ }
1004
+ validateInvariantsOrThrow(invariants);
1005
+ const safeBaseUrl = (baseUrlOverride ? sanitizeBaseUrl(baseUrlOverride) : "") || firstOrigin || undefined;
1006
+ return {
1007
+ domain: "api",
1008
+ sources: [
1009
+ {
1010
+ id: "src-1",
1011
+ kind: "curl",
1012
+ ref: isFileSource ? trimmedSource : (safeBaseUrl || "inline"),
1013
+ meta: {
1014
+ ...(safeBaseUrl ? { baseUrl: safeBaseUrl } : {}),
1015
+ commandCount: parsedEntries.length,
1016
+ ...(anyRedactedSecrets ? { redactedSecrets: true } : {})
1017
+ }
1018
+ }
1019
+ ],
1020
+ artifacts: { root: ".vibecode/artifacts", files: {} },
1021
+ invariants,
1022
+ warnings
1023
+ };
1024
+ }