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,216 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { diffLines } from "./diff.js";
5
+ import { spawnBoundedCommand } from "./exec.js";
6
+ export const DETERMINISTIC_CLI_ENV = {
7
+ TZ: "UTC",
8
+ LC_ALL: "C"
9
+ };
10
+ export const MAX_SNAPSHOT_FILE_BYTES = 256 * 1024;
11
+ export const MAX_SNAPSHOT_PREVIEW_CHARS = 4096;
12
+ export const IGNORED_DIRS = new Set([".git", "node_modules"]);
13
+ const MAX_BUFFER_BYTES = 10 * 1024 * 1024;
14
+ function compareStrings(a, b) {
15
+ return a < b ? -1 : a > b ? 1 : 0;
16
+ }
17
+ function normalizeEffectPath(p) {
18
+ return p.replace(/\\/g, "/").replace(/^\.\//, "");
19
+ }
20
+ export function sha256Text(text) {
21
+ return crypto.createHash("sha256").update(text, "utf8").digest("hex");
22
+ }
23
+ /**
24
+ * Recursively snapshot regular files under rootDir, keyed by sorted POSIX relative paths.
25
+ */
26
+ export function takeFsSnapshot(rootDir) {
27
+ if (!rootDir || !fs.existsSync(rootDir)) {
28
+ return new Map();
29
+ }
30
+ const collected = [];
31
+ const walk = (dir) => {
32
+ let entries;
33
+ try {
34
+ entries = fs.readdirSync(dir, { withFileTypes: true });
35
+ }
36
+ catch {
37
+ return;
38
+ }
39
+ for (const entry of entries) {
40
+ if (entry.isDirectory()) {
41
+ if (IGNORED_DIRS.has(entry.name))
42
+ continue;
43
+ walk(path.join(dir, entry.name));
44
+ continue;
45
+ }
46
+ if (!entry.isFile())
47
+ continue;
48
+ const fullPath = path.join(dir, entry.name);
49
+ let stat;
50
+ try {
51
+ stat = fs.statSync(fullPath);
52
+ }
53
+ catch {
54
+ continue;
55
+ }
56
+ const rel = path.relative(rootDir, fullPath).replace(/\\/g, "/");
57
+ const record = { size: stat.size };
58
+ if (stat.size <= MAX_SNAPSHOT_FILE_BYTES) {
59
+ try {
60
+ const buf = fs.readFileSync(fullPath);
61
+ record.sha256 = crypto.createHash("sha256").update(buf).digest("hex");
62
+ if (!buf.includes(0)) {
63
+ record.preview = buf.toString("utf8").slice(0, MAX_SNAPSHOT_PREVIEW_CHARS);
64
+ }
65
+ }
66
+ catch {
67
+ // Leave hash/preview unset if file became unreadable mid-walk.
68
+ }
69
+ }
70
+ collected.push([rel, record]);
71
+ }
72
+ };
73
+ walk(rootDir);
74
+ collected.sort((a, b) => compareStrings(a[0], b[0]));
75
+ return new Map(collected);
76
+ }
77
+ /**
78
+ * Compute sorted filesystem side effects between two directory snapshots.
79
+ */
80
+ export function diffFsSnapshots(before, after) {
81
+ const allPaths = Array.from(new Set([...before.keys(), ...after.keys()])).sort(compareStrings);
82
+ const effects = [];
83
+ for (const rel of allPaths) {
84
+ const prev = before.get(rel);
85
+ const next = after.get(rel);
86
+ if (!prev && next) {
87
+ effects.push({
88
+ path: rel,
89
+ status: "created",
90
+ ...(next.sha256 ? { sha256: next.sha256 } : {}),
91
+ size: next.size,
92
+ ...(next.preview !== undefined ? { preview: next.preview } : {})
93
+ });
94
+ }
95
+ else if (prev && !next) {
96
+ effects.push({ path: rel, status: "deleted" });
97
+ }
98
+ else if (prev && next && (prev.size !== next.size || prev.sha256 !== next.sha256)) {
99
+ effects.push({
100
+ path: rel,
101
+ status: "modified",
102
+ ...(next.sha256 ? { sha256: next.sha256 } : {}),
103
+ size: next.size,
104
+ ...(next.preview !== undefined ? { preview: next.preview } : {})
105
+ });
106
+ }
107
+ }
108
+ return effects;
109
+ }
110
+ /**
111
+ * Verify actual filesystem side effects against expected effects from a contract invariant.
112
+ */
113
+ export function verifyFsEffects(expected, actual) {
114
+ const expectedMap = new Map();
115
+ for (const entry of expected) {
116
+ expectedMap.set(normalizeEffectPath(entry.path), entry);
117
+ }
118
+ const actualMap = new Map();
119
+ for (const entry of actual) {
120
+ actualMap.set(normalizeEffectPath(entry.path), entry);
121
+ }
122
+ const allPaths = Array.from(new Set([...expectedMap.keys(), ...actualMap.keys()])).sort(compareStrings);
123
+ const failures = [];
124
+ const diffs = [];
125
+ for (const rel of allPaths) {
126
+ const exp = expectedMap.get(rel);
127
+ const act = actualMap.get(rel);
128
+ if (exp && !act) {
129
+ failures.push(`fsEffect ${rel}: expected ${exp.status}, got none`);
130
+ diffs.push({ path: rel, kind: "missing", expected: exp, actual: null });
131
+ continue;
132
+ }
133
+ if (!exp && act) {
134
+ failures.push(`fsEffect ${rel}: unexpected ${act.status}`);
135
+ diffs.push({ path: rel, kind: "unexpected", expected: null, actual: act });
136
+ continue;
137
+ }
138
+ if (!exp || !act)
139
+ continue;
140
+ if (exp.status !== act.status) {
141
+ failures.push(`fsEffect ${rel}: expected status ${exp.status}, got ${act.status}`);
142
+ diffs.push({ path: rel, kind: "status", expected: exp.status, actual: act.status });
143
+ continue;
144
+ }
145
+ if (exp.status === "deleted") {
146
+ continue;
147
+ }
148
+ const shaMismatch = exp.sha256 !== undefined && act.sha256 !== exp.sha256;
149
+ const sizeMismatch = exp.size !== undefined && act.size !== exp.size;
150
+ let lineDiff;
151
+ if (exp.preview !== undefined && act.preview !== undefined) {
152
+ lineDiff = diffLines(exp.preview, act.preview, { context: 2, maxLines: 40 });
153
+ }
154
+ if (shaMismatch) {
155
+ failures.push(`fsEffect ${rel}: sha256 mismatch (expected ${exp.sha256.slice(0, 12)}, got ${act.sha256 ? act.sha256.slice(0, 12) : "none"})`);
156
+ }
157
+ if (sizeMismatch) {
158
+ failures.push(`fsEffect ${rel}: size mismatch (expected ${exp.size}, got ${act.size ?? "unknown"})`);
159
+ }
160
+ if (lineDiff && !lineDiff.identical && !shaMismatch) {
161
+ failures.push(`fsEffect ${rel}: preview content mismatch (${lineDiff.added} added, ${lineDiff.removed} removed)`);
162
+ }
163
+ if (shaMismatch || sizeMismatch || (lineDiff && !lineDiff.identical)) {
164
+ const entryDiff = {
165
+ path: rel,
166
+ kind: shaMismatch || (lineDiff && !lineDiff.identical) ? "content" : "size"
167
+ };
168
+ if (shaMismatch) {
169
+ entryDiff.expectedSha256 = exp.sha256;
170
+ entryDiff.actualSha256 = act.sha256;
171
+ }
172
+ if (sizeMismatch) {
173
+ entryDiff.expectedSize = exp.size;
174
+ entryDiff.actualSize = act.size;
175
+ }
176
+ if (lineDiff && !lineDiff.identical) {
177
+ entryDiff.unified = lineDiff.unified;
178
+ entryDiff.diff = lineDiff;
179
+ }
180
+ diffs.push(entryDiff);
181
+ }
182
+ }
183
+ return { failures, diffs };
184
+ }
185
+ /**
186
+ * Resolve relative executable and script/fixture path tokens against workspaceCwd
187
+ * before running the command inside an isolated temp directory.
188
+ */
189
+ export function resolveCommandForSandbox(tokens, workspaceCwd) {
190
+ const baseCwd = workspaceCwd || process.cwd();
191
+ return tokens.map((tok, idx) => {
192
+ if (!tok || path.isAbsolute(tok))
193
+ return tok;
194
+ if (idx === 0) {
195
+ if (tok.startsWith(".") || tok.includes("/") || tok.includes("\\")) {
196
+ const candidate = path.resolve(baseCwd, tok);
197
+ if (fs.existsSync(candidate))
198
+ return candidate;
199
+ }
200
+ return tok;
201
+ }
202
+ if (!tok.startsWith("-")) {
203
+ const candidate = path.resolve(baseCwd, tok);
204
+ if (fs.existsSync(candidate))
205
+ return candidate;
206
+ }
207
+ return tok;
208
+ });
209
+ }
210
+ /**
211
+ * Execute a CLI command with deterministic stdio handling, bounded output buffering,
212
+ * and full process-tree termination on timeout.
213
+ */
214
+ export async function runSandboxedCommand(target, args = [], options = {}) {
215
+ return spawnBoundedCommand(target, args, { ...options, maxBufferBytes: MAX_BUFFER_BYTES });
216
+ }
@@ -0,0 +1,34 @@
1
+ import type { ContractV02 } from "./types.js";
2
+ export type GraphqlExportFormat = "sdl" | "introspection";
3
+ export interface ExportGraphqlOptions {
4
+ format?: GraphqlExportFormat;
5
+ title?: string;
6
+ includeRestFallback?: boolean;
7
+ includeSkippedComments?: boolean;
8
+ }
9
+ export interface ExportGraphqlResult {
10
+ format: GraphqlExportFormat;
11
+ suggestedFilename: string;
12
+ content: string;
13
+ exportedCount: number;
14
+ skippedCount: number;
15
+ warnings: string[];
16
+ queryFields: string[];
17
+ mutationFields: string[];
18
+ typeNames: string[];
19
+ outPath?: string;
20
+ }
21
+ /**
22
+ * Compile visible HTTP invariants from a ContractV02 into a valid GraphQL SDL (`.graphql`)
23
+ * or W3C GraphQL Introspection JSON (`{ __schema: ... }`) schema.
24
+ */
25
+ export declare function exportGraphqlSchema(contract: ContractV02, options?: ExportGraphqlOptions): ExportGraphqlResult;
26
+ /**
27
+ * Export and atomically write a GraphQL SDL or Introspection JSON schema to disk
28
+ * (temp file + rename in target parent directory).
29
+ */
30
+ export declare function writeGraphqlSchema(contract: ContractV02, outPath: string, options?: ExportGraphqlOptions): ExportGraphqlResult;
31
+ /**
32
+ * Format a concise, sanitized terminal summary for a GraphQL schema export result.
33
+ */
34
+ export declare function formatPrettyGraphqlExport(result: ExportGraphqlResult, outPath?: string, color?: boolean): string;