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.
- package/README.md +239 -67
- package/dist/cli.js +2140 -73
- package/dist/core/adapters.d.ts +26 -3
- package/dist/core/adapters.js +411 -25
- package/dist/core/agent-adapter.d.ts +67 -0
- package/dist/core/agent-adapter.js +312 -0
- package/dist/core/anti-cheat.d.ts +6 -0
- package/dist/core/anti-cheat.js +372 -0
- package/dist/core/badge.d.ts +18 -0
- package/dist/core/badge.js +360 -0
- package/dist/core/cache.d.ts +47 -0
- package/dist/core/cache.js +403 -0
- package/dist/core/ci-export.d.ts +35 -0
- package/dist/core/ci-export.js +796 -0
- package/dist/core/ci-formats.d.ts +21 -0
- package/dist/core/ci-formats.js +388 -0
- package/dist/core/client-codegen.d.ts +36 -0
- package/dist/core/client-codegen.js +2538 -0
- package/dist/core/compose.d.ts +71 -0
- package/dist/core/compose.js +1088 -0
- package/dist/core/docs-export.d.ts +37 -0
- package/dist/core/docs-export.js +2706 -0
- package/dist/core/doctor.d.ts +21 -1
- package/dist/core/doctor.js +234 -21
- package/dist/core/exec.d.ts +26 -2
- package/dist/core/exec.js +235 -8
- package/dist/core/fixtures.d.ts +153 -0
- package/dist/core/fixtures.js +2245 -0
- package/dist/core/format.d.ts +77 -0
- package/dist/core/format.js +632 -0
- package/dist/core/fs-snapshot.d.ts +37 -0
- package/dist/core/fs-snapshot.js +216 -0
- package/dist/core/graphql-export.d.ts +34 -0
- package/dist/core/graphql-export.js +2482 -0
- package/dist/core/har-export.d.ts +29 -0
- package/dist/core/har-export.js +988 -0
- package/dist/core/html-report.d.ts +27 -0
- package/dist/core/html-report.js +1535 -0
- package/dist/core/http-export.d.ts +31 -0
- package/dist/core/http-export.js +726 -0
- package/dist/core/impact.d.ts +80 -0
- package/dist/core/impact.js +1412 -0
- package/dist/core/lint.d.ts +38 -0
- package/dist/core/lint.js +1111 -0
- package/dist/core/load-export.d.ts +37 -0
- package/dist/core/load-export.js +1813 -0
- package/dist/core/mcp-export.d.ts +35 -0
- package/dist/core/mcp-export.js +1736 -0
- package/dist/core/mock-server.d.ts +47 -0
- package/dist/core/mock-server.js +1722 -0
- package/dist/core/openapi-export.d.ts +44 -0
- package/dist/core/openapi-export.js +1074 -0
- package/dist/core/parity.d.ts +6 -1
- package/dist/core/parity.js +36 -1
- package/dist/core/playwright-exporter.d.ts +23 -0
- package/dist/core/playwright-exporter.js +1343 -0
- package/dist/core/png.js +45 -9
- package/dist/core/regression.d.ts +54 -0
- package/dist/core/regression.js +529 -0
- package/dist/core/responsive.d.ts +86 -0
- package/dist/core/responsive.js +606 -0
- package/dist/core/run.d.ts +74 -0
- package/dist/core/run.js +696 -0
- package/dist/core/scheduler.d.ts +24 -0
- package/dist/core/scheduler.js +162 -0
- package/dist/core/schema-export.d.ts +29 -0
- package/dist/core/schema-export.js +2215 -0
- package/dist/core/schema.d.ts +3 -2
- package/dist/core/schema.js +460 -17
- package/dist/core/security.d.ts +233 -0
- package/dist/core/security.js +1839 -0
- package/dist/core/server-export.d.ts +38 -0
- package/dist/core/server-export.js +3198 -0
- package/dist/core/spec-writer.d.ts +9 -0
- package/dist/core/spec-writer.js +1202 -0
- package/dist/core/store.d.ts +11 -2
- package/dist/core/store.js +128 -8
- package/dist/core/target-map.d.ts +34 -0
- package/dist/core/target-map.js +262 -0
- package/dist/core/test-exporter.d.ts +25 -0
- package/dist/core/test-exporter.js +1918 -0
- package/dist/core/types.d.ts +182 -14
- package/dist/core/visual-semantic.d.ts +67 -0
- package/dist/core/visual-semantic.js +673 -0
- package/dist/core/visual.js +65 -16
- package/dist/core/watch.d.ts +28 -3
- package/dist/core/watch.js +222 -12
- package/dist/core/yaml.d.ts +5 -0
- package/dist/core/yaml.js +1009 -0
- package/dist/diagnostics/diagnose.d.ts +53 -0
- package/dist/diagnostics/diagnose.js +1083 -0
- package/dist/diagnostics/flake.d.ts +71 -0
- package/dist/diagnostics/flake.js +608 -0
- package/dist/diagnostics/mutation-audit.d.ts +69 -0
- package/dist/diagnostics/mutation-audit.js +769 -0
- package/dist/diagnostics/spatial.d.ts +42 -0
- package/dist/diagnostics/spatial.js +346 -0
- package/dist/diagnostics/trends.d.ts +122 -0
- package/dist/diagnostics/trends.js +1190 -0
- package/dist/discovery/discover.d.ts +111 -0
- package/dist/discovery/discover.js +2017 -0
- package/dist/discovery/lock.d.ts +116 -0
- package/dist/discovery/lock.js +1505 -0
- package/dist/discovery/routes.d.ts +36 -0
- package/dist/discovery/routes.js +1494 -0
- package/dist/discovery/test-importer.d.ts +92 -0
- package/dist/discovery/test-importer.js +4952 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +99 -0
- package/dist/ingestors/api-collections.d.ts +28 -0
- package/dist/ingestors/api-collections.js +2335 -0
- package/dist/ingestors/api-repo.d.ts +2 -1
- package/dist/ingestors/api-repo.js +483 -85
- package/dist/ingestors/asyncapi.d.ts +26 -0
- package/dist/ingestors/asyncapi.js +2105 -0
- package/dist/ingestors/bridges.d.ts +2 -0
- package/dist/ingestors/bridges.js +702 -0
- package/dist/ingestors/cli.d.ts +2 -1
- package/dist/ingestors/cli.js +234 -46
- package/dist/ingestors/curl.d.ts +14 -0
- package/dist/ingestors/curl.js +1024 -0
- package/dist/ingestors/graphql.d.ts +56 -0
- package/dist/ingestors/graphql.js +1852 -0
- package/dist/ingestors/http-file.d.ts +20 -0
- package/dist/ingestors/http-file.js +923 -0
- package/dist/ingestors/index.js +486 -6
- package/dist/ingestors/openrpc.d.ts +29 -0
- package/dist/ingestors/openrpc.js +1807 -0
- package/dist/ingestors/proto.d.ts +47 -0
- package/dist/ingestors/proto.js +2690 -0
- package/dist/ingestors/trace.d.ts +10 -0
- package/dist/ingestors/trace.js +599 -0
- package/dist/ingestors/video.d.ts +4 -1
- package/dist/ingestors/video.js +86 -36
- package/dist/ingestors/web.d.ts +16 -1
- package/dist/ingestors/web.js +474 -32
- package/dist/mcp/server.js +3532 -67
- package/dist/oracles/api-repo.js +102 -30
- package/dist/oracles/cli.js +65 -17
- package/dist/oracles/http-workflow.d.ts +68 -0
- package/dist/oracles/http-workflow.js +828 -0
- package/dist/oracles/image.js +178 -28
- package/dist/oracles/index.d.ts +3 -1
- package/dist/oracles/index.js +243 -14
- package/dist/oracles/perf-budget.d.ts +90 -0
- package/dist/oracles/perf-budget.js +1329 -0
- package/dist/oracles/stream.d.ts +94 -0
- package/dist/oracles/stream.js +1268 -0
- package/dist/oracles/ui-states.d.ts +49 -0
- package/dist/oracles/ui-states.js +894 -0
- package/dist/oracles/video.d.ts +1 -1
- package/dist/oracles/video.js +232 -16
- package/dist/oracles/web.js +464 -73
- package/dist/plugins/builtins.d.ts +12 -0
- package/dist/plugins/builtins.js +1052 -0
- package/dist/plugins/registry.d.ts +86 -0
- package/dist/plugins/registry.js +554 -0
- package/dist/setup/index.js +145 -33
- package/package.json +56 -47
- package/skills/vibecode-anything/SKILL.md +75 -52
package/dist/core/png.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import zlib from "node:zlib";
|
|
2
2
|
import { VibecodeError, errorMessage } from "./errors.js";
|
|
3
3
|
const PNG_SIG = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
4
|
+
const MAX_PNG_CHUNK_LEN = 0x7fffffff;
|
|
5
|
+
const MAX_PNG_DIMENSION = 32768;
|
|
6
|
+
const MAX_PNG_PIXELS = 64 * 1024 * 1024; // 64 MP cap (~256 MB RGBA) to prevent OOM/decompression bombs
|
|
4
7
|
const CRC_TABLE = (() => {
|
|
5
8
|
const table = new Uint32Array(256);
|
|
6
9
|
for (let n = 0; n < 256; n++) {
|
|
@@ -57,6 +60,8 @@ export function decodePng(buffer) {
|
|
|
57
60
|
}
|
|
58
61
|
let off = 8;
|
|
59
62
|
let width = 0, height = 0, bitDepth = 0, colorType = 0, interlace = 0;
|
|
63
|
+
let sawIhdr = false;
|
|
64
|
+
let sawIend = false;
|
|
60
65
|
let palette = null;
|
|
61
66
|
let trns = null;
|
|
62
67
|
const idat = [];
|
|
@@ -65,15 +70,30 @@ export function decodePng(buffer) {
|
|
|
65
70
|
const type = buf.toString("ascii", off + 4, off + 8);
|
|
66
71
|
const dataStart = off + 8;
|
|
67
72
|
const dataEnd = dataStart + len;
|
|
68
|
-
if (dataEnd + 4 > buf.length)
|
|
69
|
-
throw new VibecodeError("UNSUPPORTED_FORMAT", "Truncated PNG chunk");
|
|
73
|
+
if (len > MAX_PNG_CHUNK_LEN || dataEnd + 4 > buf.length) {
|
|
74
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", "Truncated or oversized PNG chunk");
|
|
75
|
+
}
|
|
76
|
+
const expectedCrc = readUInt32(buf, dataEnd);
|
|
77
|
+
const actualCrc = crc32(buf.subarray(off + 4, dataEnd));
|
|
78
|
+
if (actualCrc !== expectedCrc) {
|
|
79
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", `Corrupt PNG chunk CRC in ${type} (expected 0x${expectedCrc.toString(16)}, got 0x${actualCrc.toString(16)})`);
|
|
80
|
+
}
|
|
70
81
|
const data = buf.subarray(dataStart, dataEnd);
|
|
71
82
|
if (type === "IHDR") {
|
|
83
|
+
if (data.length !== 13) {
|
|
84
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", `Invalid PNG IHDR chunk length ${data.length}`);
|
|
85
|
+
}
|
|
86
|
+
sawIhdr = true;
|
|
72
87
|
width = readUInt32(data, 0);
|
|
73
88
|
height = readUInt32(data, 4);
|
|
74
89
|
bitDepth = data[8];
|
|
75
90
|
colorType = data[9];
|
|
91
|
+
const compression = data[10];
|
|
92
|
+
const filterMethod = data[11];
|
|
76
93
|
interlace = data[12];
|
|
94
|
+
if (compression !== 0 || filterMethod !== 0) {
|
|
95
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", `Unsupported PNG compression/filter method (${compression}/${filterMethod})`);
|
|
96
|
+
}
|
|
77
97
|
}
|
|
78
98
|
else if (type === "PLTE") {
|
|
79
99
|
palette = Buffer.from(data);
|
|
@@ -85,12 +105,20 @@ export function decodePng(buffer) {
|
|
|
85
105
|
idat.push(Buffer.from(data));
|
|
86
106
|
}
|
|
87
107
|
else if (type === "IEND") {
|
|
108
|
+
sawIend = true;
|
|
88
109
|
break;
|
|
89
110
|
}
|
|
90
|
-
off = dataEnd + 4;
|
|
111
|
+
off = dataEnd + 4;
|
|
112
|
+
}
|
|
113
|
+
if (!sawIend && off < buf.length) {
|
|
114
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", "Truncated PNG chunk header");
|
|
115
|
+
}
|
|
116
|
+
if (!sawIhdr || !width || !height) {
|
|
117
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", "PNG missing IHDR or has zero dimensions");
|
|
118
|
+
}
|
|
119
|
+
if (width > MAX_PNG_DIMENSION || height > MAX_PNG_DIMENSION || width * height > MAX_PNG_PIXELS) {
|
|
120
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", `PNG dimensions ${width}x${height} exceed maximum supported size`);
|
|
91
121
|
}
|
|
92
|
-
if (!width || !height)
|
|
93
|
-
throw new VibecodeError("UNSUPPORTED_FORMAT", "PNG missing IHDR");
|
|
94
122
|
if (bitDepth !== 8)
|
|
95
123
|
throw new VibecodeError("UNSUPPORTED_FORMAT", `Unsupported PNG bit depth ${bitDepth} (only 8-bit supported)`);
|
|
96
124
|
if (interlace !== 0)
|
|
@@ -98,15 +126,17 @@ export function decodePng(buffer) {
|
|
|
98
126
|
const channels = channelsFor(colorType);
|
|
99
127
|
if (colorType === 3 && !palette)
|
|
100
128
|
throw new VibecodeError("UNSUPPORTED_FORMAT", "Indexed PNG missing PLTE");
|
|
129
|
+
if (idat.length === 0)
|
|
130
|
+
throw new VibecodeError("UNSUPPORTED_FORMAT", "PNG missing IDAT chunk");
|
|
131
|
+
const rowLen = width * channels;
|
|
132
|
+
const expected = (rowLen + 1) * height;
|
|
101
133
|
let raw;
|
|
102
134
|
try {
|
|
103
|
-
raw = zlib.inflateSync(Buffer.concat(idat));
|
|
135
|
+
raw = zlib.inflateSync(Buffer.concat(idat), { maxOutputLength: expected + 1024 });
|
|
104
136
|
}
|
|
105
137
|
catch (err) {
|
|
106
138
|
throw new VibecodeError("UNSUPPORTED_FORMAT", `Failed to inflate PNG data: ${errorMessage(err)}`);
|
|
107
139
|
}
|
|
108
|
-
const rowLen = width * channels;
|
|
109
|
-
const expected = (rowLen + 1) * height;
|
|
110
140
|
if (raw.length < expected)
|
|
111
141
|
throw new VibecodeError("UNSUPPORTED_FORMAT", "PNG pixel data is truncated");
|
|
112
142
|
const pixels = new Uint8Array(height * rowLen);
|
|
@@ -232,7 +262,13 @@ export function readImageDimensions(buffer) {
|
|
|
232
262
|
if (buf.length >= 8 && buf.subarray(0, 8).equals(PNG_SIG)) {
|
|
233
263
|
if (buf.length < 24)
|
|
234
264
|
return null;
|
|
235
|
-
|
|
265
|
+
if (buf.toString("ascii", 12, 16) !== "IHDR" || readUInt32(buf, 8) < 13)
|
|
266
|
+
return null;
|
|
267
|
+
const width = readUInt32(buf, 16);
|
|
268
|
+
const height = readUInt32(buf, 20);
|
|
269
|
+
if (!width || !height)
|
|
270
|
+
return null;
|
|
271
|
+
return { format: "png", width, height };
|
|
236
272
|
}
|
|
237
273
|
// JPEG
|
|
238
274
|
if (buf.length >= 4 && buf[0] === 0xff && buf[1] === 0xd8) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zero-dependency ParityReport-to-ParityReport regression comparator,
|
|
3
|
+
* pretty terminal formatter, and PR/CI Markdown renderer.
|
|
4
|
+
*/
|
|
5
|
+
import type { GateStatus, ParityReport } from "./types.js";
|
|
6
|
+
export interface RegressionInvariantChange {
|
|
7
|
+
id: string;
|
|
8
|
+
severity: string;
|
|
9
|
+
beforeStatus: string | null;
|
|
10
|
+
afterStatus: string | null;
|
|
11
|
+
beforeScore: number | null;
|
|
12
|
+
afterScore: number | null;
|
|
13
|
+
redacted?: boolean;
|
|
14
|
+
failures?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ReportRegressionResult {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
regressed: boolean;
|
|
19
|
+
improved: boolean;
|
|
20
|
+
gateBefore: GateStatus;
|
|
21
|
+
gateAfter: GateStatus;
|
|
22
|
+
gateChanged: boolean;
|
|
23
|
+
hardParityBefore: number;
|
|
24
|
+
hardParityAfter: number;
|
|
25
|
+
hardParityDelta: number;
|
|
26
|
+
compositeScoreBefore: number;
|
|
27
|
+
compositeScoreAfter: number;
|
|
28
|
+
compositeScoreDelta: number;
|
|
29
|
+
newlyBroken: RegressionInvariantChange[];
|
|
30
|
+
newlyFixed: RegressionInvariantChange[];
|
|
31
|
+
stillFailing: RegressionInvariantChange[];
|
|
32
|
+
stillPassing: string[];
|
|
33
|
+
addedInvariants: string[];
|
|
34
|
+
removedInvariants: string[];
|
|
35
|
+
summary: string;
|
|
36
|
+
}
|
|
37
|
+
export interface CompareReportsOptions {
|
|
38
|
+
strict?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface FormatPrettyRegressionOptions {
|
|
41
|
+
color?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Compare a baseline ParityReport against a current ParityReport to detect regressions and improvements.
|
|
45
|
+
*/
|
|
46
|
+
export declare function compareReports(baseline: ParityReport, current: ParityReport, options?: CompareReportsOptions): ReportRegressionResult;
|
|
47
|
+
/**
|
|
48
|
+
* Format a ReportRegressionResult for terminal display (zero ANSI codes unless `options.color === true`).
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatPrettyRegression(diff: ReportRegressionResult, options?: FormatPrettyRegressionOptions): string;
|
|
51
|
+
/**
|
|
52
|
+
* Render a self-contained PR/CI Markdown summary section for a ReportRegressionResult.
|
|
53
|
+
*/
|
|
54
|
+
export declare function renderRegressionMarkdown(diff: ReportRegressionResult): string;
|