vibecode-anything 0.0.0-stage → 0.3.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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +452 -0
  5. package/dist/core/adapters.d.ts +8 -0
  6. package/dist/core/adapters.js +92 -0
  7. package/dist/core/diff.d.ts +10 -0
  8. package/dist/core/diff.js +207 -0
  9. package/dist/core/doctor.d.ts +50 -0
  10. package/dist/core/doctor.js +312 -0
  11. package/dist/core/errors.d.ts +32 -0
  12. package/dist/core/errors.js +81 -0
  13. package/dist/core/exec.d.ts +14 -0
  14. package/dist/core/exec.js +109 -0
  15. package/dist/core/parity.d.ts +9 -0
  16. package/dist/core/parity.js +138 -0
  17. package/dist/core/png.d.ts +7 -0
  18. package/dist/core/png.js +303 -0
  19. package/dist/core/schema.d.ts +17 -0
  20. package/dist/core/schema.js +614 -0
  21. package/dist/core/slices.d.ts +24 -0
  22. package/dist/core/slices.js +294 -0
  23. package/dist/core/store.d.ts +17 -0
  24. package/dist/core/store.js +97 -0
  25. package/dist/core/types.d.ts +751 -0
  26. package/dist/core/types.js +4 -0
  27. package/dist/core/visual.d.ts +34 -0
  28. package/dist/core/visual.js +459 -0
  29. package/dist/core/watch.d.ts +53 -0
  30. package/dist/core/watch.js +285 -0
  31. package/dist/ingestors/api-repo.d.ts +5 -0
  32. package/dist/ingestors/api-repo.js +722 -0
  33. package/dist/ingestors/bridges.d.ts +3 -0
  34. package/dist/ingestors/bridges.js +562 -0
  35. package/dist/ingestors/cli.d.ts +9 -0
  36. package/dist/ingestors/cli.js +266 -0
  37. package/dist/ingestors/image.d.ts +2 -0
  38. package/dist/ingestors/image.js +147 -0
  39. package/dist/ingestors/index.d.ts +5 -0
  40. package/dist/ingestors/index.js +97 -0
  41. package/dist/ingestors/video.d.ts +47 -0
  42. package/dist/ingestors/video.js +605 -0
  43. package/dist/ingestors/web.d.ts +25 -0
  44. package/dist/ingestors/web.js +397 -0
  45. package/dist/mcp/server.d.ts +2 -0
  46. package/dist/mcp/server.js +504 -0
  47. package/dist/oracles/api-repo.d.ts +2 -0
  48. package/dist/oracles/api-repo.js +214 -0
  49. package/dist/oracles/cli.d.ts +2 -0
  50. package/dist/oracles/cli.js +157 -0
  51. package/dist/oracles/image.d.ts +2 -0
  52. package/dist/oracles/image.js +279 -0
  53. package/dist/oracles/index.d.ts +4 -0
  54. package/dist/oracles/index.js +91 -0
  55. package/dist/oracles/video.d.ts +21 -0
  56. package/dist/oracles/video.js +411 -0
  57. package/dist/oracles/web.d.ts +2 -0
  58. package/dist/oracles/web.js +480 -0
  59. package/dist/setup/index.d.ts +7 -0
  60. package/dist/setup/index.js +186 -0
  61. package/package.json +47 -6
  62. package/skills/vibecode-anything/SKILL.md +52 -0
@@ -0,0 +1,751 @@
1
+ /**
2
+ * Shared TypeScript types and interfaces for vibecode-anything.
3
+ */
4
+ export type Domain = "cli" | "web" | "image" | "video" | "api" | "repo";
5
+ export type IngestDomain = Domain | "script" | "url" | "rea" | "cli-anything";
6
+ export type InvariantSeverity = "hard" | "soft";
7
+ export type InvariantType = "command" | "web_route" | "web_flow" | "web_network" | "image_layout" | "image_perceptual" | "video_timeline" | "http" | "repo_exports";
8
+ export type SoftGateMode = "warn" | "fail";
9
+ export type NormalizeMode = "crlf" | "ansi" | "timestamps" | "paths" | "trim";
10
+ export type InvariantStatus = "pass" | "fail" | "skipped" | "warn" | "error";
11
+ export type GateStatus = "pass" | "pass_with_warnings" | "fail" | "incomplete";
12
+ export type NextAction = "none" | "fix_hard_invariants_first" | "add_or_enable_invariants_or_adapters" | "review_soft_warnings";
13
+ export type ErrorCode = "CONTRACT_INVALID" | "CONTRACT_NOT_FOUND" | "ADAPTER_MISSING" | "ADAPTER_DEGRADED" | "TARGET_MISSING" | "EXEC_TIMEOUT" | "UNSUPPORTED_FORMAT" | "BRIDGE_FORMAT_ERROR" | "CONFIG_INVALID" | "NOT_FOUND" | "EXEC_ERROR" | "INTERNAL_ERROR" | "PARSE_WARNING" | "READ_WARNING" | "BRIDGE_FORMAT_WARNING" | "UNKNOWN_CLIENT";
14
+ export interface VibecodeErrorOptions {
15
+ adapter?: string;
16
+ installHint?: string;
17
+ fallbackHint?: string;
18
+ details?: unknown;
19
+ }
20
+ /** Structured diagnostic envelope shared across modules, CLI, and MCP. */
21
+ export interface Diagnostic {
22
+ code: string;
23
+ message: string;
24
+ adapter?: string;
25
+ installHint?: string;
26
+ fallbackHint?: string;
27
+ details?: unknown;
28
+ }
29
+ export interface ValidationError {
30
+ path: string;
31
+ message: string;
32
+ }
33
+ export interface ValidationResult {
34
+ ok: boolean;
35
+ errors: ValidationError[];
36
+ }
37
+ export interface JsonSchema {
38
+ type?: string | string[];
39
+ const?: unknown;
40
+ enum?: unknown[];
41
+ minLength?: number;
42
+ maxLength?: number;
43
+ pattern?: string;
44
+ minimum?: number;
45
+ maximum?: number;
46
+ minItems?: number;
47
+ items?: JsonSchema | JsonSchema[];
48
+ required?: string[];
49
+ properties?: Record<string, JsonSchema>;
50
+ additionalProperties?: boolean | JsonSchema;
51
+ allOf?: JsonSchema[];
52
+ anyOf?: JsonSchema[];
53
+ oneOf?: JsonSchema[];
54
+ $ref?: string;
55
+ example?: unknown;
56
+ default?: unknown;
57
+ [key: string]: unknown;
58
+ }
59
+ export interface JsonPathAssertion {
60
+ path: string;
61
+ equals?: unknown;
62
+ matches?: string;
63
+ }
64
+ export interface JsonPathQueryResult {
65
+ found: boolean;
66
+ value: unknown;
67
+ }
68
+ export interface RgbaImage {
69
+ width: number;
70
+ height: number;
71
+ data: Uint8Array;
72
+ }
73
+ export interface DecodedImage extends RgbaImage {
74
+ format: string;
75
+ backend: "png-native" | "sharp";
76
+ }
77
+ export interface ImageDimensions {
78
+ format: "png" | "jpeg" | "webp";
79
+ width: number;
80
+ height: number;
81
+ }
82
+ export interface PaletteEntry {
83
+ hex: string;
84
+ weight: number;
85
+ }
86
+ export interface BBox {
87
+ x: number;
88
+ y: number;
89
+ w: number;
90
+ h: number;
91
+ }
92
+ export interface LayoutRegion {
93
+ id: string;
94
+ bbox: BBox;
95
+ }
96
+ export interface MatchedRegion {
97
+ refId: string;
98
+ candId: string;
99
+ iou: number;
100
+ }
101
+ export interface TypographyBand {
102
+ level: "display" | "heading" | "body" | "caption";
103
+ estimatedHeightPx: number;
104
+ bandCount: number;
105
+ }
106
+ export interface Viewport {
107
+ width: number;
108
+ height: number;
109
+ }
110
+ export interface DiffLinesOptions {
111
+ context?: number;
112
+ maxLines?: number;
113
+ }
114
+ export interface DiffLinesResult {
115
+ identical: boolean;
116
+ added: number;
117
+ removed: number;
118
+ truncated: boolean;
119
+ unified: string;
120
+ }
121
+ export interface JsonSubsetDiff {
122
+ path: string;
123
+ expected: unknown;
124
+ actual: unknown;
125
+ }
126
+ export interface CommandExecOptions {
127
+ stdin?: string | null;
128
+ env?: Record<string, string | undefined>;
129
+ cwd?: string;
130
+ timeoutMs?: number;
131
+ shell?: boolean;
132
+ }
133
+ export interface CommandExecResult {
134
+ exitCode: number | null;
135
+ signal: NodeJS.Signals | null;
136
+ stdout: string;
137
+ stderr: string;
138
+ timedOut: boolean;
139
+ durationMs: number;
140
+ error: Error | null;
141
+ }
142
+ export interface WorkspacePaths {
143
+ rootDir: string;
144
+ contractPath: string;
145
+ reportPath: string;
146
+ artifactsDir: string;
147
+ cacheDir: string;
148
+ }
149
+ export interface AdapterProbeEntry {
150
+ available: boolean;
151
+ installHint: string;
152
+ version?: string;
153
+ path?: string;
154
+ }
155
+ export interface AdapterProbeResults {
156
+ playwright: AdapterProbeEntry;
157
+ ffmpeg: AdapterProbeEntry;
158
+ ffprobe: AdapterProbeEntry;
159
+ sharp: AdapterProbeEntry;
160
+ }
161
+ export interface SubtitleCue {
162
+ startMs: number;
163
+ endMs: number;
164
+ text: string;
165
+ }
166
+ export interface FfmpegFrame {
167
+ path: string;
168
+ timestampMs: number;
169
+ }
170
+ export interface FfmpegAdapter {
171
+ ffmpeg?: string;
172
+ ffprobe?: string;
173
+ probeDuration(src: string): number | null;
174
+ probeScenes(src: string, sceneThreshold: number, maxFrames: number): number[] | null;
175
+ extractFrames(src: string, timestampsMs: number[], outDir: string): FfmpegFrame[];
176
+ }
177
+ export interface ExtractedVideoState {
178
+ id: string;
179
+ timestampMs: number;
180
+ path: string;
181
+ img: DecodedImage;
182
+ dHash: string;
183
+ palette: PaletteEntry[];
184
+ regions: LayoutRegion[];
185
+ subtitleCue: string | null;
186
+ }
187
+ export interface VideoTransition {
188
+ from: string;
189
+ to: string;
190
+ changedRegion: BBox;
191
+ minDeltaSSIM: number;
192
+ eventHint: string;
193
+ audioCue: string | null;
194
+ subtitleCue: string | null;
195
+ }
196
+ export interface ContractGenerator {
197
+ name: string;
198
+ version: string;
199
+ adapter: string;
200
+ }
201
+ export interface ContractSource {
202
+ id: string;
203
+ kind: string;
204
+ ref: string;
205
+ meta: Record<string, unknown>;
206
+ }
207
+ export interface ContractTarget {
208
+ name: string;
209
+ domains: Domain[];
210
+ sources: ContractSource[];
211
+ }
212
+ export interface ContractArtifacts {
213
+ root: string;
214
+ files: Record<string, string>;
215
+ }
216
+ export interface ParityThresholdDefaults {
217
+ minSSIM: number;
218
+ maxPixelDiffRatio: number;
219
+ colorDelta: number;
220
+ minLayoutIoU: number;
221
+ minPaletteSimilarity: number;
222
+ stateMatchFloor: number;
223
+ minMotionRegionIoU: number;
224
+ }
225
+ export interface ParityThresholds {
226
+ hardBehavioralParity: number;
227
+ softPerceptualParity: number;
228
+ softGateMode: SoftGateMode;
229
+ defaults: ParityThresholdDefaults;
230
+ }
231
+ export interface WebLandmark {
232
+ tag: string;
233
+ required?: boolean;
234
+ textContains?: string;
235
+ }
236
+ export interface WebBoundingBox {
237
+ selector?: string;
238
+ id?: string;
239
+ bbox: BBox;
240
+ }
241
+ export interface WebFlowStep {
242
+ action: string;
243
+ selector?: string;
244
+ value?: unknown;
245
+ key?: string;
246
+ url?: string;
247
+ path?: string;
248
+ waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
249
+ timeoutMs?: number;
250
+ text?: string;
251
+ [key: string]: unknown;
252
+ }
253
+ export interface WebDomAssertion {
254
+ selector: string;
255
+ count?: number;
256
+ minCount?: number;
257
+ }
258
+ export interface WebNetworkExpectation {
259
+ method?: string;
260
+ pathPattern?: string;
261
+ path?: string;
262
+ status?: number;
263
+ contentType?: string;
264
+ jsonSchema?: JsonSchema;
265
+ }
266
+ export interface RepoExportEntry {
267
+ name: string;
268
+ kind: string;
269
+ }
270
+ export interface VideoStateExpected {
271
+ id: string;
272
+ timestampMs?: number;
273
+ keyframeArtifact: string;
274
+ dHash?: string;
275
+ palette?: PaletteEntry[];
276
+ regions?: LayoutRegion[];
277
+ subtitleCue?: string | null;
278
+ required?: boolean;
279
+ }
280
+ export interface VideoTransitionExpected {
281
+ from: string;
282
+ to: string;
283
+ changedRegion?: BBox;
284
+ minDeltaSSIM?: number;
285
+ eventHint?: string;
286
+ audioCue?: string | null;
287
+ subtitleCue?: string | null;
288
+ }
289
+ export interface ImageDimensionsExpected {
290
+ width?: number;
291
+ height?: number;
292
+ aspectRatio?: number;
293
+ aspectRatioTolerance?: number;
294
+ }
295
+ export interface InvariantInput {
296
+ args?: string[];
297
+ stdin?: string | null;
298
+ env?: Record<string, string | undefined>;
299
+ cwd?: string;
300
+ timeoutMs?: number;
301
+ shell?: boolean;
302
+ path?: string;
303
+ startPath?: string;
304
+ triggerPath?: string;
305
+ viewport?: Viewport;
306
+ waitUntil?: string;
307
+ steps?: WebFlowStep[];
308
+ method?: string;
309
+ headers?: Record<string, string>;
310
+ query?: Record<string, string | number | boolean>;
311
+ body?: unknown;
312
+ modulePath?: string;
313
+ language?: string;
314
+ referenceArtifact?: string;
315
+ orderMode?: string;
316
+ perceptualOnly?: boolean;
317
+ dimensions?: ImageDimensionsExpected;
318
+ [key: string]: unknown;
319
+ }
320
+ export interface InvariantExpected {
321
+ exitCode?: number | number[];
322
+ stdoutExact?: string | null;
323
+ stdoutContains?: string[];
324
+ stdoutNotContains?: string[];
325
+ stdoutRegex?: string[];
326
+ stderrExact?: string | null;
327
+ stderrContains?: string[];
328
+ goldenStdout?: string | null;
329
+ normalize?: NormalizeMode[];
330
+ jsonSchema?: JsonSchema;
331
+ jsonSubset?: unknown;
332
+ jsonPaths?: JsonPathAssertion[];
333
+ status?: number | number[];
334
+ maxLatencyMs?: number;
335
+ bodyExact?: string;
336
+ bodyContains?: string | string[];
337
+ headers?: Record<string, string>;
338
+ titleContains?: string;
339
+ landmarks?: WebLandmark[];
340
+ boundingBoxes?: WebBoundingBox[];
341
+ finalUrlIncludes?: string;
342
+ visibleText?: string[];
343
+ hiddenText?: string[];
344
+ domAssertions?: WebDomAssertion[];
345
+ networkCalls?: WebNetworkExpectation[];
346
+ noConsoleErrors?: boolean;
347
+ noUncaughtExceptions?: boolean;
348
+ dimensions?: ImageDimensionsExpected;
349
+ nonBlank?: boolean;
350
+ palette?: PaletteEntry[];
351
+ regions?: LayoutRegion[];
352
+ typographyHierarchy?: TypographyBand[];
353
+ referenceHash?: string | null;
354
+ durationMs?: number;
355
+ states?: VideoStateExpected[];
356
+ transitions?: VideoTransitionExpected[];
357
+ filesPresent?: string[];
358
+ exports?: RepoExportEntry[];
359
+ assertions?: unknown[];
360
+ [key: string]: unknown;
361
+ }
362
+ export interface InvariantTolerance {
363
+ minSSIM?: number;
364
+ maxPixelDiffRatio?: number;
365
+ colorDelta?: number;
366
+ minLayoutIoU?: number;
367
+ minPaletteSimilarity?: number;
368
+ stateMatchFloor?: number;
369
+ minKeyframeSSIM?: number;
370
+ maxHammingDistance?: number;
371
+ minMotionRegionIoU?: number;
372
+ [key: string]: unknown;
373
+ }
374
+ export interface Invariant {
375
+ id: string;
376
+ domain: Domain;
377
+ type: InvariantType;
378
+ severity: InvariantSeverity;
379
+ description: string;
380
+ tags: string[];
381
+ sourceId?: string;
382
+ input: InvariantInput;
383
+ expected: InvariantExpected;
384
+ tolerance: InvariantTolerance;
385
+ }
386
+ export type SliceStatus = "pending" | "in_progress" | "passed" | "failed" | "skipped";
387
+ export interface ContractSlice {
388
+ id: string;
389
+ title: string;
390
+ description?: string;
391
+ invariantIds: string[];
392
+ dependsOn?: string[];
393
+ status: SliceStatus;
394
+ lastVerifiedAt?: string;
395
+ lastScore?: number;
396
+ notes?: string;
397
+ }
398
+ export interface SliceSummaryItem {
399
+ id: string;
400
+ title: string;
401
+ status: SliceStatus;
402
+ invariantCount: number;
403
+ dependsOn: string[];
404
+ lastVerifiedAt?: string;
405
+ lastScore?: number;
406
+ }
407
+ export interface SliceSummary {
408
+ total: number;
409
+ passed: number;
410
+ failed: number;
411
+ inProgress: number;
412
+ pending: number;
413
+ skipped: number;
414
+ completionRatio: number;
415
+ nextSlice: string | null;
416
+ slices: SliceSummaryItem[];
417
+ }
418
+ export interface ContractV02 {
419
+ schemaVersion: string;
420
+ createdAt: string;
421
+ generator: ContractGenerator;
422
+ target: ContractTarget;
423
+ artifacts: ContractArtifacts;
424
+ thresholds: ParityThresholds;
425
+ invariants: Invariant[];
426
+ slices?: ContractSlice[];
427
+ }
428
+ export interface InvariantResult {
429
+ id: string;
430
+ type: InvariantType | string;
431
+ severity: InvariantSeverity;
432
+ status: InvariantStatus;
433
+ score: number;
434
+ failures?: string[];
435
+ reason?: string;
436
+ diff?: Record<string, unknown>;
437
+ metrics?: Record<string, unknown>;
438
+ diagnostic?: Diagnostic;
439
+ durationMs?: number;
440
+ }
441
+ export interface OracleInvariantOutcome {
442
+ status: InvariantStatus;
443
+ score: number;
444
+ failures?: string[];
445
+ reason?: string;
446
+ diff?: Record<string, unknown>;
447
+ metrics?: Record<string, unknown>;
448
+ diagnostic?: Diagnostic;
449
+ }
450
+ export interface ParityReport {
451
+ schemaVersion: string;
452
+ timestamp: string;
453
+ passed: number;
454
+ total: number;
455
+ parity: number;
456
+ compositeScore: number;
457
+ hard: {
458
+ passed: number;
459
+ failed: number;
460
+ skipped: number;
461
+ evaluated: number;
462
+ total: number;
463
+ parity: number;
464
+ };
465
+ soft: {
466
+ passed: number;
467
+ warned: number;
468
+ failed: number;
469
+ skipped: number;
470
+ evaluated: number;
471
+ total: number;
472
+ meanScore: number;
473
+ parity: number;
474
+ };
475
+ gate: {
476
+ passed: boolean;
477
+ status: GateStatus;
478
+ exitCode: number;
479
+ reasons: string[];
480
+ };
481
+ nextAction: NextAction;
482
+ results: InvariantResult[];
483
+ }
484
+ export interface CliProbeSpec {
485
+ name?: string;
486
+ args: string[];
487
+ stdin?: string;
488
+ env?: Record<string, string | undefined>;
489
+ expected?: InvariantExpected;
490
+ }
491
+ export interface WebRouteOption {
492
+ path?: string;
493
+ viewport?: Viewport;
494
+ waitUntil?: string;
495
+ id?: string;
496
+ titleContains?: string;
497
+ }
498
+ export interface WebFlowOption {
499
+ id?: string;
500
+ description?: string;
501
+ startPath?: string;
502
+ viewport?: Viewport;
503
+ steps?: WebFlowStep[];
504
+ expected?: InvariantExpected;
505
+ }
506
+ export interface ApiEndpointOption {
507
+ id?: string;
508
+ method?: string;
509
+ path?: string;
510
+ url?: string;
511
+ headers?: Record<string, string>;
512
+ query?: Record<string, string | number | boolean>;
513
+ body?: unknown;
514
+ expectedStatus?: number | number[];
515
+ jsonSchema?: JsonSchema;
516
+ jsonPaths?: JsonPathAssertion[];
517
+ timeoutMs?: number;
518
+ }
519
+ export interface IngestOptions {
520
+ domain?: IngestDomain | string;
521
+ source?: string;
522
+ name?: string;
523
+ cwd?: string;
524
+ probes?: Array<string | CliProbeSpec> | string | CliProbeSpec;
525
+ routes?: Array<string | WebRouteOption>;
526
+ flow?: WebFlowOption | null;
527
+ endpoints?: Array<string | ApiEndpointOption> | null;
528
+ endpointsFile?: string;
529
+ baseUrl?: string;
530
+ includeMutating?: boolean;
531
+ offline?: boolean;
532
+ sceneThreshold?: number;
533
+ maxFrames?: number;
534
+ defaults?: Record<string, unknown>;
535
+ forceManifest?: boolean;
536
+ }
537
+ export interface IngestResult {
538
+ domain: Domain;
539
+ sources: ContractSource[];
540
+ artifacts: ContractArtifacts;
541
+ invariants: Invariant[];
542
+ warnings: Diagnostic[];
543
+ }
544
+ export interface HttpResponseObservation {
545
+ status: number;
546
+ headers: Record<string, string>;
547
+ text: string;
548
+ json: unknown;
549
+ }
550
+ export interface FetchRouteObservation {
551
+ status: number;
552
+ title: string;
553
+ landmarks: WebLandmark[];
554
+ html: string;
555
+ headers?: Record<string, string>;
556
+ }
557
+ export interface PlaywrightResponseLike {
558
+ url(): string;
559
+ status(): number;
560
+ request(): {
561
+ method(): string;
562
+ };
563
+ headers(): Record<string, string>;
564
+ }
565
+ export interface PlaywrightConsoleMessageLike {
566
+ type(): string;
567
+ text(): string;
568
+ }
569
+ export interface PlaywrightPageLike {
570
+ goto(url: string, options?: {
571
+ waitUntil?: string;
572
+ timeout?: number;
573
+ }): Promise<PlaywrightResponseLike | null>;
574
+ title(): Promise<string>;
575
+ $$eval<R>(selector: string, pageFunction: (elements: Element[]) => R): Promise<R>;
576
+ $eval<R>(selector: string, pageFunction: (element: Element) => R): Promise<R>;
577
+ screenshot(options?: {
578
+ path?: string;
579
+ fullPage?: boolean;
580
+ }): Promise<Buffer>;
581
+ close?(): Promise<void>;
582
+ fill(selector: string, value: string): Promise<void>;
583
+ click(selector: string): Promise<void>;
584
+ press(selector: string, key: string): Promise<void>;
585
+ selectOption(selector: string, value: unknown): Promise<unknown>;
586
+ waitForFunction?<Arg>(pageFunction: (arg: Arg) => unknown, arg: Arg, options?: {
587
+ timeout?: number;
588
+ }): Promise<unknown>;
589
+ waitForTimeout?(timeout: number): Promise<void>;
590
+ waitForSelector(selector: string, options?: {
591
+ timeout?: number;
592
+ }): Promise<unknown>;
593
+ url?(): string;
594
+ evaluate<R>(pageFunction: () => R): Promise<R>;
595
+ on?(event: "response", listener: (res: PlaywrightResponseLike) => void): void;
596
+ on?(event: "console", listener: (msg: PlaywrightConsoleMessageLike) => void): void;
597
+ on?(event: "pageerror", listener: (err: Error) => void): void;
598
+ __networkCalls?: Array<{
599
+ method: string;
600
+ pathPattern: string;
601
+ status: number;
602
+ contentType?: string;
603
+ }>;
604
+ __consoleErrors?: string[];
605
+ __pageErrors?: string[];
606
+ }
607
+ export interface PlaywrightBrowserLike {
608
+ newPage(options?: {
609
+ viewport?: Viewport;
610
+ }): Promise<PlaywrightPageLike>;
611
+ close(): Promise<void>;
612
+ }
613
+ export interface PlaywrightLike {
614
+ version?: string;
615
+ chromium: {
616
+ launch(options?: {
617
+ headless?: boolean;
618
+ }): Promise<PlaywrightBrowserLike>;
619
+ };
620
+ }
621
+ export interface SharpPipelineLike {
622
+ ensureAlpha(): SharpPipelineLike;
623
+ raw(): SharpPipelineLike;
624
+ toBuffer(options: {
625
+ resolveWithObject: true;
626
+ }): Promise<{
627
+ data: Buffer | Uint8Array;
628
+ info: {
629
+ width: number;
630
+ height: number;
631
+ };
632
+ }>;
633
+ }
634
+ export type SharpLike = (input: Buffer) => SharpPipelineLike;
635
+ export interface IngestDeps {
636
+ tmpDir?: string;
637
+ timeoutMs?: number;
638
+ sharp?: SharpLike | null;
639
+ playwright?: PlaywrightLike | null;
640
+ ffmpegAdapter?: FfmpegAdapter | null;
641
+ fetchRoute?: (url: string, viewport?: Viewport, timeoutMs?: number) => Promise<FetchRouteObservation>;
642
+ fetchJson?: (url: string, options?: {
643
+ method?: string;
644
+ headers?: Record<string, string>;
645
+ body?: unknown;
646
+ timeoutMs?: number;
647
+ }) => Promise<HttpResponseObservation>;
648
+ }
649
+ export type IngestorFn = (options?: IngestOptions, deps?: IngestDeps) => Promise<IngestResult>;
650
+ export interface VerifyOptions {
651
+ target: string;
652
+ strict?: boolean;
653
+ invariantIds?: string[];
654
+ sliceIds?: string[];
655
+ cwd?: string;
656
+ }
657
+ export interface OracleContext {
658
+ target: string;
659
+ cwd?: string;
660
+ contract?: ContractV02;
661
+ artifactsDir?: string;
662
+ cacheDir?: string;
663
+ strict?: boolean;
664
+ invariantIds?: string[];
665
+ viewport?: Viewport;
666
+ currentInvariantId?: string;
667
+ runtimeCache?: Record<string, unknown>;
668
+ }
669
+ export interface VerifyDeps {
670
+ sharp?: SharpLike | null;
671
+ playwright?: PlaywrightLike | null;
672
+ ffmpegAdapter?: FfmpegAdapter | null;
673
+ fetchRoute?: (url: string, timeoutMs?: number) => Promise<FetchRouteObservation>;
674
+ fetchWithTimeout?: (url: string, options?: {
675
+ method?: string;
676
+ headers?: Record<string, string>;
677
+ body?: unknown;
678
+ timeoutMs?: number;
679
+ }) => Promise<HttpResponseObservation>;
680
+ }
681
+ export type OracleFn = (invariant: Invariant, ctx: OracleContext, deps?: VerifyDeps) => Promise<OracleInvariantOutcome>;
682
+ export interface McpTextContent {
683
+ type: "text";
684
+ text: string;
685
+ }
686
+ export interface McpToolResult<T = unknown> {
687
+ content: McpTextContent[];
688
+ structuredContent: T;
689
+ isError?: boolean;
690
+ }
691
+ export interface McpServerDeps {
692
+ probeAdapters?: () => Promise<AdapterProbeResults>;
693
+ ingestDeps?: IngestDeps;
694
+ verifyDeps?: VerifyDeps;
695
+ }
696
+ export interface McpServerOptions {
697
+ cwd?: string;
698
+ stdin?: NodeJS.ReadableStream;
699
+ stdout?: NodeJS.WritableStream;
700
+ stderr?: NodeJS.WritableStream;
701
+ deps?: McpServerDeps;
702
+ }
703
+ export interface McpServerInstance {
704
+ start(): void;
705
+ handleMessage(msg: unknown): Promise<unknown>;
706
+ rootDir: string;
707
+ }
708
+ export type SetupScope = "project" | "global";
709
+ export interface SetupOptions {
710
+ clients?: string | string[];
711
+ scope?: SetupScope | string;
712
+ local?: boolean;
713
+ dryRun?: boolean;
714
+ cwd?: string;
715
+ homeDir?: string;
716
+ antigravityDir?: string;
717
+ }
718
+ export interface SetupChange {
719
+ client: string;
720
+ kind: "mcp" | "skill";
721
+ path: string;
722
+ action: "create" | "update" | "unchanged";
723
+ }
724
+ export interface SetupWarning {
725
+ code: string;
726
+ message: string;
727
+ client: string;
728
+ supported: string[];
729
+ }
730
+ export interface SetupReport {
731
+ ok: boolean;
732
+ dryRun: boolean;
733
+ scope: SetupScope;
734
+ local: boolean;
735
+ clients: string[];
736
+ server: {
737
+ command: string;
738
+ args: string[];
739
+ };
740
+ skillSource: string;
741
+ summary: {
742
+ created: number;
743
+ updated: number;
744
+ unchanged: number;
745
+ written: number;
746
+ warnings: number;
747
+ };
748
+ changes: SetupChange[];
749
+ written: string[];
750
+ warnings: SetupWarning[];
751
+ }