spana-test 0.5.0 → 0.6.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/.agents/skills/spana-testing/SKILL.md +122 -246
- package/README.md +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +5 -5
- package/dist/{storybook-CxaP3YDz.d.ts → app-DcLXtpv4.d.ts} +205 -9
- package/dist/{chunk-3YE2POGD.js → chunk-3SH5JQF7.js} +143 -3
- package/dist/chunk-3SH5JQF7.js.map +1 -0
- package/dist/chunk-4K3FZTSV.js +179 -0
- package/dist/chunk-4K3FZTSV.js.map +1 -0
- package/dist/{chunk-H3RWZCID.js → chunk-C4E4XULT.js} +104 -3
- package/dist/chunk-C4E4XULT.js.map +1 -0
- package/dist/{chunk-SQL3YRR5.js → chunk-KBRLIQRA.js} +16 -1
- package/dist/chunk-KBRLIQRA.js.map +1 -0
- package/dist/{chunk-LRGT342X.js → chunk-KEUZLBQS.js} +1110 -475
- package/dist/chunk-KEUZLBQS.js.map +1 -0
- package/dist/{chunk-XENRC3YO.js → chunk-LCV673G3.js} +605 -41
- package/dist/chunk-LCV673G3.js.map +1 -0
- package/dist/{chunk-3TRMQCUT.js → chunk-PLE7RFQE.js} +31 -2
- package/dist/chunk-PLE7RFQE.js.map +1 -0
- package/dist/{chunk-PJKIXVSO.js → chunk-PWUJT5HE.js} +898 -238
- package/dist/chunk-PWUJT5HE.js.map +1 -0
- package/dist/{chunk-WSA5QPTA.js → chunk-S4JVAHBR.js} +2 -2
- package/dist/{chunk-UJQ7PID5.js → chunk-WBBMEAHU.js} +78 -3
- package/dist/chunk-WBBMEAHU.js.map +1 -0
- package/dist/{chunk-5245YBLL.js → chunk-Y2RZNOKU.js} +2 -2
- package/dist/cli.js +11 -11
- package/dist/cli.js.map +1 -1
- package/dist/config-loader-J4Z2PMUQ.js +9 -0
- package/dist/{doctor-command-WB3O2H64.js → doctor-command-WEHFANT7.js} +3 -3
- package/dist/{filters-Q3ALKWZ5.js → filters-MQG2RMPX.js} +4 -2
- package/dist/flow-C2JQ7gUu.d.ts +95 -0
- package/dist/gherkin/steps.d.ts +2 -2
- package/dist/index.d.ts +214 -20
- package/dist/index.js +173 -6
- package/dist/index.js.map +1 -1
- package/dist/{runner-6HK62Q7B.js → runner-TF4OKPYP.js} +2 -2
- package/dist/{screenshot-compare-3QRHHSFZ.js → screenshot-compare-5NINZVOK.js} +21 -1
- package/dist/screenshot-compare-5NINZVOK.js.map +1 -0
- package/dist/{server-QWJJB3WG.js → server-3MGZNK67.js} +2 -2
- package/dist/{server-PRM7BVVD.js → server-OANRDAHN.js} +5 -5
- package/dist/{session-Ddem-Q5n.d.ts → session-Daq0mE_a.d.ts} +22 -1
- package/dist/{session-2E6OK6BH.js → session-Q3QYHT4Q.js} +4 -4
- package/dist/{studio-command-O3NN5BCG.js → studio-command-RJYLJT4I.js} +2 -2
- package/dist/{test-command-FYOZ6QAE.js → test-command-ALH5ZQY5.js} +23 -9
- package/dist/test-command-ALH5ZQY5.js.map +1 -0
- package/dist/{validator-HZ2A3NEI.js → validator-BLOLIHUY.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-3TRMQCUT.js.map +0 -1
- package/dist/chunk-3YE2POGD.js.map +0 -1
- package/dist/chunk-H3RWZCID.js.map +0 -1
- package/dist/chunk-LRGT342X.js.map +0 -1
- package/dist/chunk-PJKIXVSO.js.map +0 -1
- package/dist/chunk-SQL3YRR5.js.map +0 -1
- package/dist/chunk-UJQ7PID5.js.map +0 -1
- package/dist/chunk-XENRC3YO.js.map +0 -1
- package/dist/config-loader-XGDDJGVY.js +0 -9
- package/dist/flow-CyRC-tTc.d.ts +0 -176
- package/dist/screenshot-compare-3QRHHSFZ.js.map +0 -1
- package/dist/test-command-FYOZ6QAE.js.map +0 -1
- /package/dist/{chunk-WSA5QPTA.js.map → chunk-S4JVAHBR.js.map} +0 -0
- /package/dist/{chunk-5245YBLL.js.map → chunk-Y2RZNOKU.js.map} +0 -0
- /package/dist/{config-loader-XGDDJGVY.js.map → config-loader-J4Z2PMUQ.js.map} +0 -0
- /package/dist/{doctor-command-WB3O2H64.js.map → doctor-command-WEHFANT7.js.map} +0 -0
- /package/dist/{filters-Q3ALKWZ5.js.map → filters-MQG2RMPX.js.map} +0 -0
- /package/dist/{runner-6HK62Q7B.js.map → runner-TF4OKPYP.js.map} +0 -0
- /package/dist/{server-QWJJB3WG.js.map → server-3MGZNK67.js.map} +0 -0
- /package/dist/{server-PRM7BVVD.js.map → server-OANRDAHN.js.map} +0 -0
- /package/dist/{session-2E6OK6BH.js.map → session-Q3QYHT4Q.js.map} +0 -0
- /package/dist/{studio-command-O3NN5BCG.js.map → studio-command-RJYLJT4I.js.map} +0 -0
- /package/dist/{validator-HZ2A3NEI.js.map → validator-BLOLIHUY.js.map} +0 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// src/core/native-accel.ts
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { createRequire } from "module";
|
|
4
|
+
import { dirname, resolve } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
var loadAttempted = false;
|
|
7
|
+
var cachedLib = null;
|
|
8
|
+
function libFileName() {
|
|
9
|
+
if (process.platform === "darwin") return "libspana_native.dylib";
|
|
10
|
+
if (process.platform === "win32") return "spana_native.dll";
|
|
11
|
+
return "libspana_native.so";
|
|
12
|
+
}
|
|
13
|
+
function findNativeLibraryPath() {
|
|
14
|
+
const envOverride = process.env["SPANA_NATIVE_LIB"];
|
|
15
|
+
if (envOverride && existsSync(envOverride)) return envOverride;
|
|
16
|
+
const file = libFileName();
|
|
17
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
const candidates = [
|
|
19
|
+
// Bundled inside packages/spana/native/
|
|
20
|
+
resolve(here, "../../native", file),
|
|
21
|
+
resolve(here, "../native", file),
|
|
22
|
+
// Monorepo cargo release / debug output
|
|
23
|
+
resolve(here, "../../../spana-native/target/release", file),
|
|
24
|
+
resolve(here, "../../../../packages/spana-native/target/release", file),
|
|
25
|
+
resolve(process.cwd(), "packages/spana-native/target/release", file)
|
|
26
|
+
];
|
|
27
|
+
for (const candidate of candidates) {
|
|
28
|
+
if (existsSync(candidate)) return candidate;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
function loadNativeAccelerator() {
|
|
33
|
+
if (loadAttempted) return cachedLib;
|
|
34
|
+
loadAttempted = true;
|
|
35
|
+
if (process.env["SPANA_DISABLE_NATIVE"] === "1") {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (typeof globalThis["Bun"] === "undefined") {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const libPath = findNativeLibraryPath();
|
|
42
|
+
if (!libPath) return null;
|
|
43
|
+
try {
|
|
44
|
+
const req = createRequire(import.meta.url);
|
|
45
|
+
const ffiModuleName = ["bun", "ffi"].join(":");
|
|
46
|
+
const ffi = req(ffiModuleName);
|
|
47
|
+
const lib = ffi.dlopen(libPath, {
|
|
48
|
+
spana_compare_png: {
|
|
49
|
+
args: [
|
|
50
|
+
ffi.FFIType.ptr,
|
|
51
|
+
ffi.FFIType.u64,
|
|
52
|
+
ffi.FFIType.ptr,
|
|
53
|
+
ffi.FFIType.u64,
|
|
54
|
+
ffi.FFIType.f64,
|
|
55
|
+
ffi.FFIType.f64,
|
|
56
|
+
ffi.FFIType.i32,
|
|
57
|
+
ffi.FFIType.ptr
|
|
58
|
+
],
|
|
59
|
+
returns: ffi.FFIType.void
|
|
60
|
+
},
|
|
61
|
+
spana_tokenize_xml: {
|
|
62
|
+
args: [ffi.FFIType.ptr, ffi.FFIType.u64, ffi.FFIType.ptr, ffi.FFIType.u64, ffi.FFIType.ptr],
|
|
63
|
+
returns: ffi.FFIType.i32
|
|
64
|
+
},
|
|
65
|
+
spana_free_buffer: {
|
|
66
|
+
args: [ffi.FFIType.ptr, ffi.FFIType.u64],
|
|
67
|
+
returns: ffi.FFIType.void
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const { spana_compare_png, spana_tokenize_xml, spana_free_buffer } = lib.symbols;
|
|
71
|
+
const resultScratch = new ArrayBuffer(40);
|
|
72
|
+
const resultView = new DataView(resultScratch);
|
|
73
|
+
const resultBytes = new Uint8Array(resultScratch);
|
|
74
|
+
const bufScratch = new ArrayBuffer(16);
|
|
75
|
+
const bufView = new DataView(bufScratch);
|
|
76
|
+
const bufBytes = new Uint8Array(bufScratch);
|
|
77
|
+
const textEncoder = new TextEncoder();
|
|
78
|
+
const textDecoder = new TextDecoder();
|
|
79
|
+
cachedLib = {
|
|
80
|
+
libraryPath: libPath,
|
|
81
|
+
comparePng: (expected, actual, threshold, maxDiffRatio, layoutTolerant) => {
|
|
82
|
+
const expArr = expected instanceof Uint8Array ? expected : new Uint8Array(expected);
|
|
83
|
+
const actArr = actual instanceof Uint8Array ? actual : new Uint8Array(actual);
|
|
84
|
+
if (expArr.byteLength === 0 || actArr.byteLength === 0) return null;
|
|
85
|
+
spana_compare_png(
|
|
86
|
+
ffi.ptr(expArr),
|
|
87
|
+
expArr.byteLength,
|
|
88
|
+
ffi.ptr(actArr),
|
|
89
|
+
actArr.byteLength,
|
|
90
|
+
threshold,
|
|
91
|
+
maxDiffRatio,
|
|
92
|
+
layoutTolerant ? 1 : 0,
|
|
93
|
+
ffi.ptr(resultBytes)
|
|
94
|
+
);
|
|
95
|
+
const matched = resultView.getInt32(0, true);
|
|
96
|
+
if (matched < 0) return null;
|
|
97
|
+
const sizeMismatch = resultView.getInt32(4, true) !== 0;
|
|
98
|
+
const diffPixelCount = resultView.getUint32(8, true);
|
|
99
|
+
const diffPixelRatio = resultView.getFloat64(16, true);
|
|
100
|
+
const diffPtr = Number(resultView.getBigUint64(24, true));
|
|
101
|
+
const diffLen = Number(resultView.getBigUint64(32, true));
|
|
102
|
+
let diffImage;
|
|
103
|
+
if (diffPtr !== 0 && diffLen > 0) {
|
|
104
|
+
try {
|
|
105
|
+
const view = new Uint8Array(ffi.toArrayBuffer(diffPtr, 0, diffLen));
|
|
106
|
+
diffImage = Buffer.from(view);
|
|
107
|
+
} finally {
|
|
108
|
+
spana_free_buffer(diffPtr, diffLen);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
match: matched === 1,
|
|
113
|
+
sizeMismatch,
|
|
114
|
+
diffPixelCount,
|
|
115
|
+
diffPixelRatio,
|
|
116
|
+
...diffImage ? { diffImage } : {}
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
tokenizeXml: (xml, wrapperTag) => {
|
|
120
|
+
const xmlBytes = textEncoder.encode(xml);
|
|
121
|
+
if (xmlBytes.byteLength === 0) return [];
|
|
122
|
+
const wrapBytes = textEncoder.encode(wrapperTag);
|
|
123
|
+
const rc = spana_tokenize_xml(
|
|
124
|
+
ffi.ptr(xmlBytes),
|
|
125
|
+
xmlBytes.byteLength,
|
|
126
|
+
wrapBytes.byteLength > 0 ? ffi.ptr(wrapBytes) : 0,
|
|
127
|
+
wrapBytes.byteLength,
|
|
128
|
+
ffi.ptr(bufBytes)
|
|
129
|
+
);
|
|
130
|
+
if (rc !== 0) return null;
|
|
131
|
+
const outPtr = Number(bufView.getBigUint64(0, true));
|
|
132
|
+
const outLen = Number(bufView.getBigUint64(8, true));
|
|
133
|
+
if (outPtr === 0 || outLen === 0) return [];
|
|
134
|
+
try {
|
|
135
|
+
const slice = new Uint8Array(ffi.toArrayBuffer(outPtr, 0, outLen));
|
|
136
|
+
const jsonStr = textDecoder.decode(slice);
|
|
137
|
+
return JSON.parse(jsonStr);
|
|
138
|
+
} finally {
|
|
139
|
+
spana_free_buffer(outPtr, outLen);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return cachedLib;
|
|
144
|
+
} catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function isNativeAcceleratorActive() {
|
|
149
|
+
return loadNativeAccelerator() !== null;
|
|
150
|
+
}
|
|
151
|
+
function getNativeAcceleratorPath() {
|
|
152
|
+
return loadNativeAccelerator()?.libraryPath ?? null;
|
|
153
|
+
}
|
|
154
|
+
function comparePngNative(expected, actual, threshold, maxDiffRatio, layoutTolerant) {
|
|
155
|
+
const lib = loadNativeAccelerator();
|
|
156
|
+
if (!lib) return null;
|
|
157
|
+
try {
|
|
158
|
+
return lib.comparePng(expected, actual, threshold, maxDiffRatio, layoutTolerant);
|
|
159
|
+
} catch {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function tokenizeXmlNative(xml, wrapperTag) {
|
|
164
|
+
const lib = loadNativeAccelerator();
|
|
165
|
+
if (!lib) return null;
|
|
166
|
+
try {
|
|
167
|
+
return lib.tokenizeXml(xml, wrapperTag);
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export {
|
|
174
|
+
isNativeAcceleratorActive,
|
|
175
|
+
getNativeAcceleratorPath,
|
|
176
|
+
comparePngNative,
|
|
177
|
+
tokenizeXmlNative
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=chunk-4K3FZTSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/native-accel.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport interface NativePngCompareResult {\n match: boolean;\n sizeMismatch: boolean;\n diffPixelCount: number;\n diffPixelRatio: number;\n diffImage?: Buffer;\n}\n\nexport interface NativeXmlRawNode {\n tagName: string;\n attrs: Record<string, string>;\n children: NativeXmlRawNode[];\n}\n\ninterface LoadedNativeLib {\n comparePng: (\n expected: Buffer | Uint8Array,\n actual: Buffer | Uint8Array,\n threshold: number,\n maxDiffRatio: number,\n layoutTolerant: boolean,\n ) => NativePngCompareResult | null;\n tokenizeXml: (xml: string, wrapperTag: string) => NativeXmlRawNode[] | null;\n libraryPath: string;\n}\n\nlet loadAttempted = false;\nlet cachedLib: LoadedNativeLib | null = null;\n\nfunction libFileName(): string {\n if (process.platform === \"darwin\") return \"libspana_native.dylib\";\n if (process.platform === \"win32\") return \"spana_native.dll\";\n return \"libspana_native.so\";\n}\n\nfunction findNativeLibraryPath(): string | null {\n const envOverride = process.env[\"SPANA_NATIVE_LIB\"];\n if (envOverride && existsSync(envOverride)) return envOverride;\n\n const file = libFileName();\n const here = dirname(fileURLToPath(import.meta.url));\n const candidates = [\n // Bundled inside packages/spana/native/\n resolve(here, \"../../native\", file),\n resolve(here, \"../native\", file),\n // Monorepo cargo release / debug output\n resolve(here, \"../../../spana-native/target/release\", file),\n resolve(here, \"../../../../packages/spana-native/target/release\", file),\n resolve(process.cwd(), \"packages/spana-native/target/release\", file),\n ];\n\n for (const candidate of candidates) {\n if (existsSync(candidate)) return candidate;\n }\n return null;\n}\n\nfunction loadNativeAccelerator(): LoadedNativeLib | null {\n if (loadAttempted) return cachedLib;\n loadAttempted = true;\n\n if (process.env[\"SPANA_DISABLE_NATIVE\"] === \"1\") {\n return null;\n }\n\n // Uses Bun's zero-overhead native FFI when running under Bun; Node.js falls back cleanly to JS\n if (typeof (globalThis as Record<string, unknown>)[\"Bun\"] === \"undefined\") {\n return null;\n }\n\n const libPath = findNativeLibraryPath();\n if (!libPath) return null;\n\n try {\n // Dynamic createRequire so bundlers targeting Node never fail on `bun:ffi`\n const req = createRequire(import.meta.url);\n const ffiModuleName = [\"bun\", \"ffi\"].join(\":\");\n const ffi = req(ffiModuleName) as {\n dlopen: (path: string, symbols: Record<string, unknown>) => { symbols: Record<string, any> };\n FFIType: Record<string, string>;\n ptr: (buf: Uint8Array) => number;\n toArrayBuffer: (p: number, offset: number, length: number) => ArrayBuffer;\n };\n\n const lib = ffi.dlopen(libPath, {\n spana_compare_png: {\n args: [\n ffi.FFIType.ptr,\n ffi.FFIType.u64,\n ffi.FFIType.ptr,\n ffi.FFIType.u64,\n ffi.FFIType.f64,\n ffi.FFIType.f64,\n ffi.FFIType.i32,\n ffi.FFIType.ptr,\n ],\n returns: ffi.FFIType.void,\n },\n spana_tokenize_xml: {\n args: [ffi.FFIType.ptr, ffi.FFIType.u64, ffi.FFIType.ptr, ffi.FFIType.u64, ffi.FFIType.ptr],\n returns: ffi.FFIType.i32,\n },\n spana_free_buffer: {\n args: [ffi.FFIType.ptr, ffi.FFIType.u64],\n returns: ffi.FFIType.void,\n },\n });\n\n const { spana_compare_png, spana_tokenize_xml, spana_free_buffer } = lib.symbols;\n\n // Struct layout of NativeCompareResult (repr(C) on 64-bit):\n // offset 0: matched (i32)\n // offset 4: size_mismatch (i32)\n // offset 8: diff_pixel_count (u32)\n // offset 12: [4 bytes padding]\n // offset 16: diff_pixel_ratio (f64)\n // offset 24: diff_png_ptr (*mut u8 / u64)\n // offset 32: diff_png_len (usize / u64)\n // Total = 40 bytes\n const resultScratch = new ArrayBuffer(40);\n const resultView = new DataView(resultScratch);\n const resultBytes = new Uint8Array(resultScratch);\n\n // Struct layout of NativeBuffer (repr(C) on 64-bit):\n // offset 0: ptr (*mut u8 / u64)\n // offset 8: len (usize / u64)\n const bufScratch = new ArrayBuffer(16);\n const bufView = new DataView(bufScratch);\n const bufBytes = new Uint8Array(bufScratch);\n\n const textEncoder = new TextEncoder();\n const textDecoder = new TextDecoder();\n\n cachedLib = {\n libraryPath: libPath,\n\n comparePng: (expected, actual, threshold, maxDiffRatio, layoutTolerant) => {\n const expArr = expected instanceof Uint8Array ? expected : new Uint8Array(expected);\n const actArr = actual instanceof Uint8Array ? actual : new Uint8Array(actual);\n if (expArr.byteLength === 0 || actArr.byteLength === 0) return null;\n\n spana_compare_png(\n ffi.ptr(expArr),\n expArr.byteLength,\n ffi.ptr(actArr),\n actArr.byteLength,\n threshold,\n maxDiffRatio,\n layoutTolerant ? 1 : 0,\n ffi.ptr(resultBytes),\n );\n\n const matched = resultView.getInt32(0, true);\n if (matched < 0) return null;\n const sizeMismatch = resultView.getInt32(4, true) !== 0;\n const diffPixelCount = resultView.getUint32(8, true);\n const diffPixelRatio = resultView.getFloat64(16, true);\n const diffPtr = Number(resultView.getBigUint64(24, true));\n const diffLen = Number(resultView.getBigUint64(32, true));\n\n let diffImage: Buffer | undefined;\n if (diffPtr !== 0 && diffLen > 0) {\n try {\n const view = new Uint8Array(ffi.toArrayBuffer(diffPtr, 0, diffLen));\n diffImage = Buffer.from(view);\n } finally {\n spana_free_buffer(diffPtr, diffLen);\n }\n }\n\n return {\n match: matched === 1,\n sizeMismatch,\n diffPixelCount,\n diffPixelRatio,\n ...(diffImage ? { diffImage } : {}),\n };\n },\n\n tokenizeXml: (xml, wrapperTag) => {\n const xmlBytes = textEncoder.encode(xml);\n if (xmlBytes.byteLength === 0) return [];\n const wrapBytes = textEncoder.encode(wrapperTag);\n const rc = spana_tokenize_xml(\n ffi.ptr(xmlBytes),\n xmlBytes.byteLength,\n wrapBytes.byteLength > 0 ? ffi.ptr(wrapBytes) : 0,\n wrapBytes.byteLength,\n ffi.ptr(bufBytes),\n );\n if (rc !== 0) return null;\n\n const outPtr = Number(bufView.getBigUint64(0, true));\n const outLen = Number(bufView.getBigUint64(8, true));\n if (outPtr === 0 || outLen === 0) return [];\n\n try {\n const slice = new Uint8Array(ffi.toArrayBuffer(outPtr, 0, outLen));\n const jsonStr = textDecoder.decode(slice);\n return JSON.parse(jsonStr) as NativeXmlRawNode[];\n } finally {\n spana_free_buffer(outPtr, outLen);\n }\n },\n };\n\n return cachedLib;\n } catch {\n return null;\n }\n}\n\n/** Check whether Spana's native Rust accelerator (`libspana_native`) is loaded and active. */\nexport function isNativeAcceleratorActive(): boolean {\n return loadNativeAccelerator() !== null;\n}\n\n/** Return the loaded native Rust library path, or `null` when running in pure-JS fallback mode. */\nexport function getNativeAcceleratorPath(): string | null {\n return loadNativeAccelerator()?.libraryPath ?? null;\n}\n\n/** Accelerated Rust PNG diff (returns `null` if unavailable so caller falls back cleanly to JS). */\nexport function comparePngNative(\n expected: Buffer | Uint8Array,\n actual: Buffer | Uint8Array,\n threshold: number,\n maxDiffRatio: number,\n layoutTolerant: boolean,\n): NativePngCompareResult | null {\n const lib = loadNativeAccelerator();\n if (!lib) return null;\n try {\n return lib.comparePng(expected, actual, threshold, maxDiffRatio, layoutTolerant);\n } catch {\n return null;\n }\n}\n\n/** Accelerated Rust XML hierarchy tokenizer (returns `null` if unavailable so caller falls back to JS). */\nexport function tokenizeXmlNative(xml: string, wrapperTag: string): NativeXmlRawNode[] | null {\n const lib = loadNativeAccelerator();\n if (!lib) return null;\n try {\n return lib.tokenizeXml(xml, wrapperTag);\n } catch {\n return null;\n }\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,eAAe;AACjC,SAAS,qBAAqB;AA4B9B,IAAI,gBAAgB;AACpB,IAAI,YAAoC;AAExC,SAAS,cAAsB;AAC7B,MAAI,QAAQ,aAAa,SAAU,QAAO;AAC1C,MAAI,QAAQ,aAAa,QAAS,QAAO;AACzC,SAAO;AACT;AAEA,SAAS,wBAAuC;AAC9C,QAAM,cAAc,QAAQ,IAAI,kBAAkB;AAClD,MAAI,eAAe,WAAW,WAAW,EAAG,QAAO;AAEnD,QAAM,OAAO,YAAY;AACzB,QAAM,OAAO,QAAQ,cAAc,YAAY,GAAG,CAAC;AACnD,QAAM,aAAa;AAAA;AAAA,IAEjB,QAAQ,MAAM,gBAAgB,IAAI;AAAA,IAClC,QAAQ,MAAM,aAAa,IAAI;AAAA;AAAA,IAE/B,QAAQ,MAAM,wCAAwC,IAAI;AAAA,IAC1D,QAAQ,MAAM,oDAAoD,IAAI;AAAA,IACtE,QAAQ,QAAQ,IAAI,GAAG,wCAAwC,IAAI;AAAA,EACrE;AAEA,aAAW,aAAa,YAAY;AAClC,QAAI,WAAW,SAAS,EAAG,QAAO;AAAA,EACpC;AACA,SAAO;AACT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MAAM,sBAAsB;AAClC,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACF,WAAO,IAAI,YAAY,KAAK,UAAU;AAAA,EACxC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -86,6 +86,18 @@ var SPANA_MCP_TOOLS = [
|
|
|
86
86
|
required: ["text"]
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
name: "spana_fill",
|
|
91
|
+
description: "Atomically focus, clear, and fill an input/textarea in 1 round trip and return the verified `app.fill(...)` line.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
selector: { type: "object" },
|
|
96
|
+
value: { type: "string" }
|
|
97
|
+
},
|
|
98
|
+
required: ["selector", "value"]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
89
101
|
{
|
|
90
102
|
name: "spana_assert_visible",
|
|
91
103
|
description: "Verify that an element matching selector is currently visible on screen and return the verified `expect(...)` line.",
|
|
@@ -97,6 +109,36 @@ var SPANA_MCP_TOOLS = [
|
|
|
97
109
|
required: ["selector"]
|
|
98
110
|
}
|
|
99
111
|
},
|
|
112
|
+
{
|
|
113
|
+
name: "spana_assert_accessible",
|
|
114
|
+
description: "Run a live WCAG accessibility audit (axe-core on web) and record `await expect.screen().toBeAccessible(...)` into the generated `.flow.ts`.",
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: "object",
|
|
117
|
+
properties: {
|
|
118
|
+
standard: {
|
|
119
|
+
type: "string",
|
|
120
|
+
enum: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"]
|
|
121
|
+
},
|
|
122
|
+
failOnSeverity: {
|
|
123
|
+
type: "string",
|
|
124
|
+
enum: ["critical", "serious", "moderate", "minor"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "spana_assert_screenshot",
|
|
131
|
+
description: "Capture/verify a visual regression checkpoint (accelerated by Spana's Rust SIMD PNG diff) and record `await expect.screen().toMatchScreenshot(...)` into the generated `.flow.ts`.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
name: { type: "string" },
|
|
136
|
+
mode: { type: "string", enum: ["pixel", "layout-tolerant"] },
|
|
137
|
+
maxDiffPixelRatio: { type: "number" }
|
|
138
|
+
},
|
|
139
|
+
required: ["name"]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
100
142
|
{
|
|
101
143
|
name: "spana_open_link",
|
|
102
144
|
description: "Navigate the active target to a URL or deep link and record the verified line.",
|
|
@@ -157,11 +199,11 @@ var SpanaMcpServer = class {
|
|
|
157
199
|
runFlowFn;
|
|
158
200
|
constructor(options = {}) {
|
|
159
201
|
this.connectFn = options.connectFn ?? (async (opts) => {
|
|
160
|
-
const { connect } = await import("./session-
|
|
202
|
+
const { connect } = await import("./session-Q3QYHT4Q.js");
|
|
161
203
|
return connect(opts);
|
|
162
204
|
});
|
|
163
205
|
this.runFlowFn = options.runFlowFn ?? (async ({ flowPath, platform }) => {
|
|
164
|
-
const { runTestCommand } = await import("./test-command-
|
|
206
|
+
const { runTestCommand } = await import("./test-command-ALH5ZQY5.js");
|
|
165
207
|
return runTestCommand({
|
|
166
208
|
flowPath,
|
|
167
209
|
platforms: platform ? [platform] : [],
|
|
@@ -290,6 +332,65 @@ var SpanaMcpServer = class {
|
|
|
290
332
|
this.recordedLines.push(codeLine);
|
|
291
333
|
return this.jsonResult({ ok: true, codeLine });
|
|
292
334
|
}
|
|
335
|
+
case "spana_fill": {
|
|
336
|
+
const session = this.requireSession();
|
|
337
|
+
const selector = args["selector"];
|
|
338
|
+
const value = String(args["value"] ?? "");
|
|
339
|
+
await session.tap(selector);
|
|
340
|
+
await session.inputText(value);
|
|
341
|
+
const codeLine = `await app.fill(${formatSelectorCode(selector)}, ${JSON.stringify(value)});`;
|
|
342
|
+
this.recordedLines.push(codeLine);
|
|
343
|
+
return this.jsonResult({ ok: true, codeLine });
|
|
344
|
+
}
|
|
345
|
+
case "spana_assert_accessible": {
|
|
346
|
+
const session = this.requireSession();
|
|
347
|
+
const standard = args["standard"] ?? "wcag21aa";
|
|
348
|
+
const failOnSeverity = args["failOnSeverity"] ?? "serious";
|
|
349
|
+
const optsObj = {};
|
|
350
|
+
if (args["standard"]) optsObj["standard"] = standard;
|
|
351
|
+
if (args["failOnSeverity"]) optsObj["failOnSeverity"] = failOnSeverity;
|
|
352
|
+
const optsArg = Object.keys(optsObj).length > 0 ? JSON.stringify(optsObj) : "";
|
|
353
|
+
const codeLine = `await expect.screen().toBeAccessible(${optsArg});`;
|
|
354
|
+
let quickIssues = [];
|
|
355
|
+
if (session.platform === "web") {
|
|
356
|
+
const elements = await session.selectors().catch(() => []);
|
|
357
|
+
quickIssues = elements.filter((e) => !e.text && !e.accessibilityLabel).slice(0, 10).map((e) => `Unlabeled interactive control (${e.elementType ?? "element"})`);
|
|
358
|
+
}
|
|
359
|
+
this.recordedLines.push(codeLine);
|
|
360
|
+
return this.jsonResult({
|
|
361
|
+
ok: true,
|
|
362
|
+
codeLine,
|
|
363
|
+
standard,
|
|
364
|
+
failOnSeverity,
|
|
365
|
+
quickIssues
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
case "spana_assert_screenshot": {
|
|
369
|
+
const session = this.requireSession();
|
|
370
|
+
const shotName = String(args["name"] ?? "screen");
|
|
371
|
+
const png = await session.screenshot();
|
|
372
|
+
const optsObj = {};
|
|
373
|
+
if (typeof args["mode"] === "string") optsObj["mode"] = args["mode"];
|
|
374
|
+
if (typeof args["maxDiffPixelRatio"] === "number") {
|
|
375
|
+
optsObj["maxDiffPixelRatio"] = args["maxDiffPixelRatio"];
|
|
376
|
+
}
|
|
377
|
+
const optsArg = Object.keys(optsObj).length > 0 ? `, ${JSON.stringify(optsObj)}` : "";
|
|
378
|
+
const codeLine = `await expect.screen().toMatchScreenshot(${JSON.stringify(shotName)}${optsArg});`;
|
|
379
|
+
this.recordedLines.push(codeLine);
|
|
380
|
+
return {
|
|
381
|
+
content: [
|
|
382
|
+
{
|
|
383
|
+
type: "text",
|
|
384
|
+
text: JSON.stringify({ ok: true, name: shotName, codeLine, bytes: png.byteLength })
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
type: "image",
|
|
388
|
+
data: Buffer.from(png).toString("base64"),
|
|
389
|
+
mimeType: "image/png"
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
};
|
|
393
|
+
}
|
|
293
394
|
case "spana_assert_visible": {
|
|
294
395
|
const session = this.requireSession();
|
|
295
396
|
const selector = args["selector"];
|
|
@@ -436,4 +537,4 @@ export {
|
|
|
436
537
|
SPANA_MCP_TOOLS,
|
|
437
538
|
SpanaMcpServer
|
|
438
539
|
};
|
|
439
|
-
//# sourceMappingURL=chunk-
|
|
540
|
+
//# sourceMappingURL=chunk-C4E4XULT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp/server.ts"],"sourcesContent":["import { createInterface } from \"node:readline\";\nimport type { ExtendedSelector, Platform } from \"../schemas/selector.js\";\nimport type { ConnectOptions, Session } from \"../agent/session.js\";\n\n/** MCP Tool definition advertised by `tools/list`. */\nexport interface McpToolDefinition {\n name: string;\n description: string;\n inputSchema: {\n type: \"object\";\n properties: Record<string, unknown>;\n required?: string[];\n };\n}\n\nexport interface McpContentBlock {\n type: \"text\" | \"image\";\n text?: string;\n data?: string;\n mimeType?: string;\n}\n\nexport interface McpToolResult {\n content: McpContentBlock[];\n isError?: boolean;\n}\n\nexport interface JsonRpcRequest {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n method: string;\n params?: Record<string, unknown>;\n}\n\nexport interface JsonRpcResponse {\n jsonrpc: \"2.0\";\n id: string | number | null;\n result?: unknown;\n error?: { code: number; message: string; data?: unknown };\n}\n\nexport interface SpanaMcpServerOptions {\n /** Custom session connector (defaults to `connect()` from `agent/session.js`). */\n connectFn?: (opts: ConnectOptions) => Promise<Session>;\n /** Custom flow runner for `spana_run_flow` (defaults to `runTestCommand`). */\n runFlowFn?: (opts: { flowPath: string; platform?: Platform }) => Promise<boolean>;\n}\n\n/** Format a Spana selector into clean TypeScript code for verified `.flow.ts` generation. */\nexport function formatSelectorCode(selector: ExtendedSelector): string {\n if (typeof selector === \"string\") {\n return JSON.stringify(selector);\n }\n const sel = selector as Record<string, unknown>;\n if (sel.systemUI === true) {\n const rest = { ...sel };\n delete rest.systemUI;\n return `systemUI(${JSON.stringify(rest)})`;\n }\n return JSON.stringify(selector);\n}\n\n/** Generate a complete `.flow.ts` file from recorded verified MCP actions. */\nexport function buildFlowFileFromLines(flowName: string, lines: string[]): string {\n const usesSystemUI = lines.some((l) => l.includes(\"systemUI(\"));\n const imports = usesSystemUI\n ? 'import { flow, systemUI } from \"spana-test\";'\n : 'import { flow } from \"spana-test\";';\n const body =\n lines.length > 0 ? lines.map((l) => ` ${l}`).join(\"\\n\") : \" // Add verified steps here\";\n return `${imports}\\n\\nexport default flow(${JSON.stringify(flowName)}, async ({ app, expect }) => {\\n${body}\\n});\\n`;\n}\n\nexport const SPANA_MCP_TOOLS: McpToolDefinition[] = [\n {\n name: \"spana_session_start\",\n description:\n \"Connect Spana to a live target (web, android, ios, electron, electrobun) and begin recording verified .flow.ts lines.\",\n inputSchema: {\n type: \"object\",\n properties: {\n platform: {\n type: \"string\",\n enum: [\"web\", \"android\", \"ios\", \"electron\", \"electrobun\"],\n },\n baseUrl: { type: \"string\" },\n packageName: { type: \"string\" },\n bundleId: { type: \"string\" },\n device: { type: \"string\" },\n headless: { type: \"boolean\" },\n cdpUrl: { type: \"string\" },\n },\n required: [\"platform\"],\n },\n },\n {\n name: \"spana_session_stop\",\n description:\n \"Disconnect the active Spana session and return the generated .flow.ts file containing every verified step.\",\n inputSchema: {\n type: \"object\",\n properties: {\n flowName: { type: \"string\" },\n },\n },\n },\n {\n name: \"spana_observe\",\n description:\n \"Inspect the current screen: returns actionable elements with suggested { testID } / systemUI() selectors plus recent console logs and JS errors.\",\n inputSchema: {\n type: \"object\",\n properties: {\n maxElements: { type: \"number\" },\n },\n },\n },\n {\n name: \"spana_tap\",\n description:\n \"Tap an element via Spana's dual-channel resolver and return the verified `.flow.ts` line.\",\n inputSchema: {\n type: \"object\",\n properties: {\n selector: { type: \"object\" },\n },\n required: [\"selector\"],\n },\n },\n {\n name: \"spana_input_text\",\n description: \"Type text into the focused element and return the verified `.flow.ts` line.\",\n inputSchema: {\n type: \"object\",\n properties: {\n text: { type: \"string\" },\n },\n required: [\"text\"],\n },\n },\n {\n name: \"spana_fill\",\n description:\n \"Atomically focus, clear, and fill an input/textarea in 1 round trip and return the verified `app.fill(...)` line.\",\n inputSchema: {\n type: \"object\",\n properties: {\n selector: { type: \"object\" },\n value: { type: \"string\" },\n },\n required: [\"selector\", \"value\"],\n },\n },\n {\n name: \"spana_assert_visible\",\n description:\n \"Verify that an element matching selector is currently visible on screen and return the verified `expect(...)` line.\",\n inputSchema: {\n type: \"object\",\n properties: {\n selector: { type: \"object\" },\n },\n required: [\"selector\"],\n },\n },\n {\n name: \"spana_assert_accessible\",\n description:\n \"Run a live WCAG accessibility audit (axe-core on web) and record `await expect.screen().toBeAccessible(...)` into the generated `.flow.ts`.\",\n inputSchema: {\n type: \"object\",\n properties: {\n standard: {\n type: \"string\",\n enum: [\"wcag2a\", \"wcag2aa\", \"wcag21a\", \"wcag21aa\", \"wcag22aa\"],\n },\n failOnSeverity: {\n type: \"string\",\n enum: [\"critical\", \"serious\", \"moderate\", \"minor\"],\n },\n },\n },\n },\n {\n name: \"spana_assert_screenshot\",\n description:\n \"Capture/verify a visual regression checkpoint (accelerated by Spana's Rust SIMD PNG diff) and record `await expect.screen().toMatchScreenshot(...)` into the generated `.flow.ts`.\",\n inputSchema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n mode: { type: \"string\", enum: [\"pixel\", \"layout-tolerant\"] },\n maxDiffPixelRatio: { type: \"number\" },\n },\n required: [\"name\"],\n },\n },\n {\n name: \"spana_open_link\",\n description: \"Navigate the active target to a URL or deep link and record the verified line.\",\n inputSchema: {\n type: \"object\",\n properties: {\n url: { type: \"string\" },\n },\n required: [\"url\"],\n },\n },\n {\n name: \"spana_screenshot\",\n description: \"Capture a live PNG screenshot of the current screen for visual verification.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n },\n },\n {\n name: \"spana_diagnostics\",\n description:\n \"Argent-inspired live runtime diagnostics: returns captured console logs, JS errors, element count, and platform metadata.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n },\n },\n {\n name: \"spana_export_flow\",\n description:\n \"Export all verified actions from the current session as a runnable TypeScript `.flow.ts` file without disconnecting.\",\n inputSchema: {\n type: \"object\",\n properties: {\n flowName: { type: \"string\" },\n },\n },\n },\n {\n name: \"spana_run_flow\",\n description:\n \"Run an existing `.flow.ts` test file via Spana and return pass/fail status for rapid agent fix-and-verify loops.\",\n inputSchema: {\n type: \"object\",\n properties: {\n flowPath: { type: \"string\" },\n platform: {\n type: \"string\",\n enum: [\"web\", \"android\", \"ios\", \"electron\", \"electrobun\"],\n },\n },\n required: [\"flowPath\"],\n },\n },\n];\n\n/**\n * Model-free MCP (Model Context Protocol) server for Spana.\n *\n * Lets coding agents (Claude Code, Codex, Cursor, Antigravity) drive live\n * web, iOS, Android, Electron, and Electrobun sessions, inspect unified\n * DOM/native + console/error diagnostics, and receive verified `.flow.ts` lines.\n */\nexport class SpanaMcpServer {\n private session: Session | null = null;\n private recordedLines: string[] = [];\n private readonly connectFn: (opts: ConnectOptions) => Promise<Session>;\n private readonly runFlowFn: (opts: { flowPath: string; platform?: Platform }) => Promise<boolean>;\n\n constructor(options: SpanaMcpServerOptions = {}) {\n this.connectFn =\n options.connectFn ??\n (async (opts) => {\n const { connect } = await import(\"../agent/session.js\");\n return connect(opts);\n });\n this.runFlowFn =\n options.runFlowFn ??\n (async ({ flowPath, platform }) => {\n const { runTestCommand } = await import(\"../cli/test-command.js\");\n return runTestCommand({\n flowPath,\n platforms: platform ? [platform] : [],\n quiet: true,\n });\n });\n }\n\n private requireSession(): Session {\n if (!this.session) {\n throw new Error(\n \"No active Spana MCP session. Call `spana_session_start` first with a target platform.\",\n );\n }\n return this.session;\n }\n\n async handleRequest(req: JsonRpcRequest): Promise<JsonRpcResponse | null> {\n const id = req.id ?? null;\n\n // Notifications (no id) get no JSON-RPC response\n if (req.method === \"notifications/initialized\" || req.id === undefined) {\n return null;\n }\n\n try {\n switch (req.method) {\n case \"initialize\":\n return {\n jsonrpc: \"2.0\",\n id,\n result: {\n protocolVersion: \"2024-11-05\",\n capabilities: { tools: {} },\n serverInfo: { name: \"spana-mcp\", version: \"1.0.0\" },\n },\n };\n\n case \"ping\":\n return { jsonrpc: \"2.0\", id, result: {} };\n\n case \"tools/list\":\n return {\n jsonrpc: \"2.0\",\n id,\n result: { tools: SPANA_MCP_TOOLS },\n };\n\n case \"tools/call\": {\n const name = String(req.params?.[\"name\"] ?? \"\");\n const args = (req.params?.[\"arguments\"] ?? {}) as Record<string, unknown>;\n const toolResult = await this.callTool(name, args);\n return { jsonrpc: \"2.0\", id, result: toolResult };\n }\n\n default:\n return {\n jsonrpc: \"2.0\",\n id,\n error: { code: -32601, message: `Method not found: ${req.method}` },\n };\n }\n } catch (err) {\n return {\n jsonrpc: \"2.0\",\n id,\n error: {\n code: -32603,\n message: err instanceof Error ? err.message : String(err),\n },\n };\n }\n }\n\n async callTool(name: string, args: Record<string, unknown>): Promise<McpToolResult> {\n try {\n switch (name) {\n case \"spana_session_start\": {\n if (this.session) {\n await this.session.disconnect().catch(() => undefined);\n this.session = null;\n }\n const platform = args[\"platform\"] as Platform;\n this.session = await this.connectFn({\n platform,\n baseUrl: args[\"baseUrl\"] as string | undefined,\n packageName: args[\"packageName\"] as string | undefined,\n bundleId: args[\"bundleId\"] as string | undefined,\n device: args[\"device\"] as string | undefined,\n headless: (args[\"headless\"] as boolean | undefined) ?? true,\n cdpUrl: args[\"cdpUrl\"] as string | undefined,\n });\n this.recordedLines = [];\n return this.jsonResult({ connected: true, platform });\n }\n\n case \"spana_session_stop\": {\n const flowName = (args[\"flowName\"] as string | undefined) ?? \"recorded flow\";\n const code = buildFlowFileFromLines(flowName, this.recordedLines);\n if (this.session) {\n await this.session.disconnect().catch(() => undefined);\n this.session = null;\n }\n return this.jsonResult({\n disconnected: true,\n stepCount: this.recordedLines.length,\n code,\n });\n }\n\n case \"spana_observe\": {\n const session = this.requireSession();\n const maxElements = (args[\"maxElements\"] as number | undefined) ?? 60;\n const elements = (await session.selectors()).slice(0, maxElements);\n const consoleLogs = await session.getConsoleLogs().catch(() => []);\n const jsErrors = await session.getJSErrors().catch(() => []);\n return this.jsonResult({\n platform: session.platform,\n elementCount: elements.length,\n elements,\n recentConsoleLogs: consoleLogs.slice(-15),\n jsErrors: jsErrors.slice(-10),\n });\n }\n\n case \"spana_tap\": {\n const session = this.requireSession();\n const selector = args[\"selector\"] as ExtendedSelector;\n await session.tap(selector);\n const codeLine = `await app.tap(${formatSelectorCode(selector)});`;\n this.recordedLines.push(codeLine);\n return this.jsonResult({ ok: true, codeLine });\n }\n\n case \"spana_input_text\": {\n const session = this.requireSession();\n const text = String(args[\"text\"] ?? \"\");\n await session.inputText(text);\n const codeLine = `await app.inputText(${JSON.stringify(text)});`;\n this.recordedLines.push(codeLine);\n return this.jsonResult({ ok: true, codeLine });\n }\n\n case \"spana_fill\": {\n const session = this.requireSession();\n const selector = args[\"selector\"] as ExtendedSelector;\n const value = String(args[\"value\"] ?? \"\");\n await session.tap(selector);\n await session.inputText(value);\n const codeLine = `await app.fill(${formatSelectorCode(selector)}, ${JSON.stringify(value)});`;\n this.recordedLines.push(codeLine);\n return this.jsonResult({ ok: true, codeLine });\n }\n\n case \"spana_assert_accessible\": {\n const session = this.requireSession();\n const standard = (args[\"standard\"] as string | undefined) ?? \"wcag21aa\";\n const failOnSeverity = (args[\"failOnSeverity\"] as string | undefined) ?? \"serious\";\n const optsObj: Record<string, string> = {};\n if (args[\"standard\"]) optsObj[\"standard\"] = standard;\n if (args[\"failOnSeverity\"]) optsObj[\"failOnSeverity\"] = failOnSeverity;\n const optsArg = Object.keys(optsObj).length > 0 ? JSON.stringify(optsObj) : \"\";\n const codeLine = `await expect.screen().toBeAccessible(${optsArg});`;\n // Run a fast DOM accessibility sanity snapshot when on web\n let quickIssues: string[] = [];\n if (session.platform === \"web\") {\n const elements = await session.selectors().catch(() => []);\n quickIssues = elements\n .filter((e) => !e.text && !e.accessibilityLabel)\n .slice(0, 10)\n .map((e) => `Unlabeled interactive control (${e.elementType ?? \"element\"})`);\n }\n this.recordedLines.push(codeLine);\n return this.jsonResult({\n ok: true,\n codeLine,\n standard,\n failOnSeverity,\n quickIssues,\n });\n }\n\n case \"spana_assert_screenshot\": {\n const session = this.requireSession();\n const shotName = String(args[\"name\"] ?? \"screen\");\n const png = await session.screenshot();\n const optsObj: Record<string, unknown> = {};\n if (typeof args[\"mode\"] === \"string\") optsObj[\"mode\"] = args[\"mode\"];\n if (typeof args[\"maxDiffPixelRatio\"] === \"number\") {\n optsObj[\"maxDiffPixelRatio\"] = args[\"maxDiffPixelRatio\"];\n }\n const optsArg = Object.keys(optsObj).length > 0 ? `, ${JSON.stringify(optsObj)}` : \"\";\n const codeLine = `await expect.screen().toMatchScreenshot(${JSON.stringify(shotName)}${optsArg});`;\n this.recordedLines.push(codeLine);\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ ok: true, name: shotName, codeLine, bytes: png.byteLength }),\n },\n {\n type: \"image\",\n data: Buffer.from(png).toString(\"base64\"),\n mimeType: \"image/png\",\n },\n ],\n };\n }\n\n case \"spana_assert_visible\": {\n const session = this.requireSession();\n const selector = args[\"selector\"] as ExtendedSelector;\n const elements = await session.selectors();\n const sel = selector as Record<string, unknown>;\n const matched = elements.some((el) => {\n if (typeof sel[\"testID\"] === \"string\") return el.id === sel[\"testID\"];\n if (typeof sel[\"text\"] === \"string\") return el.text?.includes(sel[\"text\"]);\n if (typeof sel[\"accessibilityLabel\"] === \"string\") {\n return el.accessibilityLabel === sel[\"accessibilityLabel\"];\n }\n return false;\n });\n if (!matched) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: JSON.stringify({\n ok: false,\n message: `Element not visible: ${formatSelectorCode(selector)}`,\n availableTestIDs: elements\n .map((e) => e.id)\n .filter(Boolean)\n .slice(0, 20),\n }),\n },\n ],\n };\n }\n const codeLine = `await expect(${formatSelectorCode(selector)}).toBeVisible();`;\n this.recordedLines.push(codeLine);\n return this.jsonResult({ ok: true, codeLine });\n }\n\n case \"spana_open_link\": {\n const session = this.requireSession();\n const url = String(args[\"url\"] ?? \"\");\n await session.openLink(url);\n const codeLine = `await app.openLink(${JSON.stringify(url)});`;\n this.recordedLines.push(codeLine);\n return this.jsonResult({ ok: true, codeLine });\n }\n\n case \"spana_screenshot\": {\n const session = this.requireSession();\n const png = await session.screenshot();\n return {\n content: [\n {\n type: \"image\",\n data: Buffer.from(png).toString(\"base64\"),\n mimeType: \"image/png\",\n },\n ],\n };\n }\n\n case \"spana_diagnostics\": {\n const session = this.requireSession();\n const [elements, consoleLogs, jsErrors] = await Promise.all([\n session.selectors().catch(() => []),\n session.getConsoleLogs().catch(() => []),\n session.getJSErrors().catch(() => []),\n ]);\n return this.jsonResult({\n platform: session.platform,\n actionableElements: elements.length,\n testIDCount: elements.filter((e) => Boolean(e.id)).length,\n consoleLogCount: consoleLogs.length,\n consoleLogs: consoleLogs.slice(-25),\n jsErrorCount: jsErrors.length,\n jsErrors: jsErrors.slice(-15),\n });\n }\n\n case \"spana_export_flow\": {\n const flowName = (args[\"flowName\"] as string | undefined) ?? \"recorded flow\";\n return this.jsonResult({\n flowName,\n stepCount: this.recordedLines.length,\n code: buildFlowFileFromLines(flowName, this.recordedLines),\n });\n }\n\n case \"spana_run_flow\": {\n const flowPath = String(args[\"flowPath\"] ?? \"\");\n const platform = args[\"platform\"] as Platform | undefined;\n const passed = await this.runFlowFn({ flowPath, platform });\n return this.jsonResult({ flowPath, platform: platform ?? \"default\", passed });\n }\n\n default:\n return {\n isError: true,\n content: [{ type: \"text\", text: `Unknown tool: ${name}` }],\n };\n }\n } catch (err) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: err instanceof Error ? err.message : String(err),\n },\n ],\n };\n }\n }\n\n private jsonResult(payload: unknown): McpToolResult {\n return {\n content: [{ type: \"text\", text: JSON.stringify(payload, null, 2) }],\n };\n }\n\n /** Run the server over newline-delimited JSON-RPC stdio until stdin closes. */\n async runStdio(): Promise<void> {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n for await (const line of rl) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n try {\n const req = JSON.parse(trimmed) as JsonRpcRequest;\n const res = await this.handleRequest(req);\n if (res) {\n process.stdout.write(`${JSON.stringify(res)}\\n`);\n }\n } catch (err) {\n const parseErr: JsonRpcResponse = {\n jsonrpc: \"2.0\",\n id: null,\n error: {\n code: -32700,\n message: err instanceof Error ? err.message : \"Parse error\",\n },\n };\n process.stdout.write(`${JSON.stringify(parseErr)}\\n`);\n }\n }\n if (this.session) {\n await this.session.disconnect().catch(() => undefined);\n this.session = null;\n }\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAiDzB,SAAS,mBAAmB,UAAoC;AACrE,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,KAAK,UAAU,QAAQ;AAAA,EAChC;AACA,QAAM,MAAM;AACZ,MAAI,IAAI,aAAa,MAAM;AACzB,UAAM,OAAO,EAAE,GAAG,IAAI;AACtB,WAAO,KAAK;AACZ,WAAO,YAAY,KAAK,UAAU,IAAI,CAAC;AAAA,EACzC;AACA,SAAO,KAAK,UAAU,QAAQ;AAChC;AAGO,SAAS,uBAAuB,UAAkB,OAAyB;AAChF,QAAM,eAAe,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,CAAC;AAC9D,QAAM,UAAU,eACZ,iDACA;AACJ,QAAM,OACJ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AAAA;AAAA,EAGA,MAAM,WAA0B;AAC9B,UAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,WAAW,SAAS,CAAC;AACxE,qBAAiB,QAAQ,IAAI;AAC3B,YAAM,UAAU,KAAK,KAAK;AAC1B,UAAI,CAAC,QAAS;AACd,UAAI;AACF,cAAM,MAAM,KAAK,MAAM,OAAO;AAC9B,cAAM,MAAM,MAAM,KAAK,cAAc,GAAG;AACxC,YAAI,KAAK;AACP,kBAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,GAAG,CAAC;AAAA,CAAI;AAAA,QACjD;AAAA,MACF,SAAS,KAAK;AACZ,cAAM,WAA4B;AAAA,UAChC,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,OAAO;AAAA,YACL,MAAM;AAAA,YACN,SAAS,eAAe,QAAQ,IAAI,UAAU;AAAA,UAChD;AAAA,QACF;AACA,gBAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,QAAQ,CAAC;AAAA,CAAI;AAAA,MACtD;AAAA,IACF;AACA,QAAI,KAAK,SAAS;AAChB,YAAM,KAAK,QAAQ,WAAW,EAAE,MAAM,MAAM,MAAS;AACrD,WAAK,UAAU;AAAA,IACjB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -109,15 +109,30 @@ var appiumExecutionConfigSchema = z.object({
|
|
|
109
109
|
autoStartBinary: z.string().min(1).optional(),
|
|
110
110
|
autoStartArgs: z.array(z.string()).optional()
|
|
111
111
|
}).strict();
|
|
112
|
+
var virtualAuthenticatorOptionsSchema = z.object({
|
|
113
|
+
protocol: z.enum(["ctap2", "u2f"]).optional(),
|
|
114
|
+
transport: z.enum(["usb", "nfc", "ble", "cable", "internal"]).optional(),
|
|
115
|
+
hasResidentKey: z.boolean().optional(),
|
|
116
|
+
hasUserVerification: z.boolean().optional(),
|
|
117
|
+
isUserVerified: z.boolean().optional(),
|
|
118
|
+
automaticPresenceSimulation: z.boolean().optional()
|
|
119
|
+
}).strict();
|
|
112
120
|
var webExecutionConfigSchema = z.object({
|
|
113
121
|
browser: z.enum(["chromium", "firefox", "webkit"]).optional(),
|
|
114
122
|
engine: z.enum(["playwright", "cdp", "lightpanda"]).optional(),
|
|
115
123
|
cdpUrl: z.string().url().optional(),
|
|
124
|
+
wsEndpoint: z.string().url().optional(),
|
|
125
|
+
executablePath: z.string().min(1).optional(),
|
|
126
|
+
channel: z.string().min(1).optional(),
|
|
116
127
|
headless: z.boolean().optional(),
|
|
117
128
|
waitUntil: z.enum(["domcontentloaded", "load", "networkidle", "commit"]).optional(),
|
|
118
129
|
instantAnimations: z.boolean().optional(),
|
|
119
130
|
blockResources: z.array(z.enum(["image", "font", "media", "stylesheet"])).optional(),
|
|
120
131
|
warmBrowser: z.boolean().optional(),
|
|
132
|
+
warmBrowserScope: z.string().min(1).optional(),
|
|
133
|
+
freshContextPerFlow: z.boolean().optional(),
|
|
134
|
+
maxContextsPerBrowser: z.number().int().positive().optional(),
|
|
135
|
+
virtualAuthenticator: z.union([z.boolean(), virtualAuthenticatorOptionsSchema]).optional(),
|
|
121
136
|
storageState: z.string().min(1).optional(),
|
|
122
137
|
verboseLogging: z.boolean().optional(),
|
|
123
138
|
storybook: storybookConfigSchema.optional()
|
|
@@ -224,4 +239,4 @@ export {
|
|
|
224
239
|
validateConfig,
|
|
225
240
|
formatConfigValidationError
|
|
226
241
|
};
|
|
227
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-KBRLIQRA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/config.ts"],"sourcesContent":["import type { Platform, TapMode } from \"./selector.js\";\nimport type {\n DeviceStateConfig,\n LaunchOptions,\n VirtualAuthenticatorOptions,\n} from \"../drivers/raw-driver.js\";\nimport { z, type ZodError } from \"zod\";\n\nexport type { DeviceStateConfig, LaunchOptions, VirtualAuthenticatorOptions };\n\nexport interface IOSSigningConfig {\n /** Apple Development Team ID (from developer.apple.com or Xcode) */\n teamId: string;\n /** Code signing identity (default: \"Apple Development\") */\n signingIdentity?: string;\n}\n\nexport interface BridgeConfig {\n /** Enable the in-app spana-bridge WebSocket server. Default: auto-detected when port/url is set. */\n enabled?: boolean;\n /** Port for the runner's spana-bridge WebSocket server (default: 9333). */\n port?: number;\n /** Host to bind the bridge server on (default: \"127.0.0.1\"). */\n host?: string;\n /** Explicit external bridge URL if already running (e.g. ws://127.0.0.1:9333). */\n url?: string;\n /** Connection timeout in ms when waiting for the app bridge to connect (default: 5000). */\n connectTimeout?: number;\n}\n\nexport interface WarmDaemonConfig {\n /** Keep WDA / UiAutomator2 daemons alive across test runs and reuse them. Default: false. */\n enabled?: boolean;\n /** Reuse a single browser process across flows with fresh BrowserContexts. Default: true. */\n reuseBrowserProcess?: boolean;\n /** Reuse an active WDA/UiAutomator2 session across flows instead of recreating. Default: true when warm daemons enabled. */\n reuseSession?: boolean;\n /** Optional path to store warm daemon metadata. */\n stateFile?: string;\n}\n\nexport interface AppConfig {\n url?: string;\n packageName?: string;\n bundleId?: string;\n /** Path to .app or .ipa for auto-install on device/simulator */\n appPath?: string;\n /** iOS code signing config for physical devices */\n signing?: IOSSigningConfig;\n /** Explicit WebKit Inspector URL or port for iOS WKWebView direct DOM access */\n webkitInspectorUrl?: string;\n webkitInspectorPort?: number;\n /** Explicit CDP port for Android WebView or desktop targets */\n cdpPort?: number;\n /** Pin device locale (e.g. \"en_US\", \"sv_SE\") for predictable system UI labels */\n locale?: string;\n /** Optional spana-bridge override for this app target */\n bridge?: BridgeConfig;\n}\n\nexport interface ElectronAppConfig {\n /** Path to Electron main entry file or app directory (passed to Playwright _electron.launch) */\n entry?: string;\n /** Path to a packaged Electron executable */\n executablePath?: string;\n /** Extra CLI arguments passed to Electron */\n args?: string[];\n /** Working directory for Electron launch */\n cwd?: string;\n /** Additional environment variables for Electron */\n env?: Record<string, string>;\n /** Attach to an already-running Electron app over CDP instead of launching */\n cdpUrl?: string;\n /** Remote debugging port when launching or attaching over CDP */\n cdpPort?: number;\n /** Optional URL to navigate to after launch */\n url?: string;\n /** Optional spana-bridge config */\n bridge?: BridgeConfig;\n}\n\nexport type ElectrobunRenderer = \"native\" | \"cef\";\n\nexport interface ElectrobunAppConfig {\n /** Path to Electrobun binary or packaged .app/.exe */\n executablePath?: string;\n /** Path to Electrobun project root (containing electrobun.config.ts) */\n appDir?: string;\n /** Extra CLI arguments passed to the Electrobun process */\n args?: string[];\n /** Working directory for launch */\n cwd?: string;\n /** Additional environment variables */\n env?: Record<string, string>;\n /** Renderer engine used by the Electrobun build: \"native\" (WKWebView/WebView2/WebKitGTK) or \"cef\" */\n renderer?: ElectrobunRenderer;\n /** Attach to an already-running Electrobun CEF/WebView2 app over CDP */\n cdpUrl?: string;\n /** Remote debugging port (ELECTROBUN_CDP_PORT / WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS) */\n cdpPort?: number;\n /** WebKit Inspector port for macOS WKWebView or Linux WebKitGTK */\n webkitInspectorPort?: number;\n /** Optional URL to navigate to after launch */\n url?: string;\n /** Optional spana-bridge config */\n bridge?: BridgeConfig;\n}\n\nexport type BrowserName = \"chromium\" | \"firefox\" | \"webkit\";\nexport type WebBrowserEngine = \"playwright\" | \"cdp\" | \"lightpanda\";\nexport type WebResourceBlockType = \"image\" | \"font\" | \"media\" | \"stylesheet\";\n\nexport type StorybookValue = string | number | boolean | null;\n\nexport interface StorybookConfig {\n /** Optional dedicated Storybook URL (falls back to apps.web.url when omitted) */\n url?: string;\n /** Preview iframe path used to render isolated stories (default: /iframe.html) */\n iframePath?: string;\n}\n\nexport interface WebExecutionConfig {\n browser?: BrowserName;\n /** Browser engine backend: \"playwright\" (default), \"cdp\" (direct CDP WebSocket — zero Playwright pipe), or \"lightpanda\". */\n engine?: WebBrowserEngine;\n /** Connect to an existing CDP browser / Lightpanda endpoint (e.g. \"http://127.0.0.1:9222\"). */\n cdpUrl?: string;\n /** Connect to a remote Playwright server WebSocket (e.g. BrowserStack Automate Web `wss://cdp.browserstack.com/playwright?...`). */\n wsEndpoint?: string;\n /** Explicit browser executable path (e.g. system Chrome or custom Chromium binary). */\n executablePath?: string;\n /** Browser release channel (e.g. \"chrome\", \"chrome-beta\", \"msedge\"). */\n channel?: string;\n headless?: boolean;\n /** Navigation readiness event for launchApp/openLink (default: \"load\"). */\n waitUntil?: \"domcontentloaded\" | \"load\" | \"networkidle\" | \"commit\";\n /** Collapse CSS transitions & animations to 0.001ms for faster deterministic runs. */\n instantAnimations?: boolean;\n /** Abort heavy asset requests (\"image\" | \"font\" | \"media\" | \"stylesheet\") during web runs. */\n blockResources?: WebResourceBlockType[];\n /** Reuse a persistent warm Chromium daemon across runs via CDP (chromium only). */\n warmBrowser?: boolean;\n /** Scope key for isolating warm Chromium daemons across concurrent repos/runs (defaults to cwd hash). */\n warmBrowserScope?: string;\n /** Create a fresh isolated BrowserContext per flow using pre-warmed context pooling + background teardown. */\n freshContextPerFlow?: boolean;\n /** Max worker contexts sharing one Chromium browser process under `--parallel` (default: 2 to avoid CDP/IO contention). */\n maxContextsPerBrowser?: number;\n /** Automatically attach a CDP WebAuthn virtual authenticator (passkey) to every fresh context. */\n virtualAuthenticator?: boolean | VirtualAuthenticatorOptions;\n /** Optional Playwright storage state JSON file to preload for web runs */\n storageState?: string;\n /** Print verbose Playwright runtime events to stdout for local web debugging */\n verboseLogging?: boolean;\n /** Optional Storybook config for isolated component/story flows in the browser runtime */\n storybook?: StorybookConfig;\n}\n\nexport interface CloudAppReferenceConfig {\n /** Existing remote app reference, e.g. bs://... or storage:... */\n id?: string;\n /** Local file path to upload when the provider supports managed upload */\n path?: string;\n /** Override the uploaded file name when the provider supports it */\n name?: string;\n}\n\nexport interface BrowserStackAppConfig extends CloudAppReferenceConfig {\n /** Stable BrowserStack app alias */\n customId?: string;\n}\n\nexport interface BrowserStackLocalConfig {\n enabled?: boolean;\n binary?: string;\n identifier?: string;\n args?: string[];\n}\n\nexport interface BrowserStackHelperConfig {\n app?: BrowserStackAppConfig;\n local?: BrowserStackLocalConfig;\n options?: Record<string, unknown>;\n}\n\nexport interface SauceConnectConfig {\n enabled?: boolean;\n binary?: string;\n tunnelName?: string;\n args?: string[];\n}\n\nexport interface SauceLabsHelperConfig {\n app?: CloudAppReferenceConfig;\n connect?: SauceConnectConfig;\n options?: Record<string, unknown>;\n}\n\nexport interface AppiumExecutionConfig {\n serverUrl?: string;\n capabilities?: Record<string, unknown>;\n /**\n * Platform-specific capabilities merged on top of `capabilities` when the\n * matching platform runs. Useful when you want different `appium:deviceName`\n * or `appium:platformVersion` for Android vs iOS.\n */\n platformCapabilities?: {\n android?: Record<string, unknown>;\n ios?: Record<string, unknown>;\n };\n capabilitiesFile?: string;\n reportToProvider?: boolean;\n browserstack?: BrowserStackHelperConfig;\n saucelabs?: SauceLabsHelperConfig;\n /** Path to a custom cloud provider module (default export must conform to CloudProvider interface). */\n cloudProvider?: string;\n /**\n * Opt in to having spana spawn a local `appium` subprocess for the\n * duration of the test run. Requires `appium` to be on PATH. When true,\n * `serverUrl` (if set) is ignored and a URL is assigned to the\n * auto-started server instead. Off by default — spana never spawns\n * background processes unless you ask.\n */\n autoStart?: boolean;\n /** Override the `appium` binary name. Default: \"appium\". */\n autoStartBinary?: string;\n /** Extra CLI args to forward to the spawned Appium process. */\n autoStartArgs?: readonly string[];\n}\n\nexport interface ExecutionConfig {\n mode?: \"local\" | \"appium\";\n web?: WebExecutionConfig;\n appium?: AppiumExecutionConfig;\n /** In-app spana-bridge configuration shared across webview targets */\n bridge?: BridgeConfig;\n /** Warm daemon & process reuse settings for fast repeated runs */\n warmDaemons?: WarmDaemonConfig;\n}\n\nexport interface ArtifactConfig {\n outputDir?: string;\n captureOnFailure?: boolean;\n captureOnSuccess?: boolean;\n captureSteps?: boolean;\n screenshot?: boolean;\n uiHierarchy?: boolean;\n consoleLogs?: boolean;\n jsErrors?: boolean;\n har?: boolean;\n}\n\nexport interface HookContext {\n app: unknown; // Will be typed properly when App is defined\n expect?: unknown;\n platform?: Platform;\n result?: unknown;\n summary?: unknown;\n}\n\nexport interface ProvConfig {\n apps?: {\n web?: AppConfig;\n android?: AppConfig;\n ios?: AppConfig;\n electron?: ElectronAppConfig;\n electrobun?: ElectrobunAppConfig;\n };\n defaults?: {\n waitTimeout?: number;\n pollInterval?: number;\n settleTimeout?: number;\n retries?: number;\n /** Pause after each action (tap, scroll) to let the UI settle. Default: 0 (disabled). */\n waitForIdleTimeout?: number;\n /** Delay between each character when typing. Default: 0 (instant). */\n typingDelay?: number;\n /** Starting poll interval for adaptive backoff. Default: 50ms. Set equal to pollInterval to disable adaptive backoff. */\n initialPollInterval?: number;\n /** Max age in ms before cached hierarchy is stale. Default: 100. Set to 0 to disable. */\n hierarchyCacheTtl?: number;\n /** Max depth for UI hierarchy snapshots on iOS. Default: 100. */\n snapshotMaxDepth?: number;\n /** Delay in ms between retry attempts of a failed flow. Default: 0 (immediate). */\n retryDelay?: number;\n /** Max workers per platform when using --parallel. */\n workers?: number;\n /** Default tap mode when a DOM channel resolves an element: \"native\" (real touch, default) or \"dom\" (fast synthetic click). */\n tapMode?: TapMode;\n /** Pin device locale across targets so system UI sheet labels stay deterministic. */\n locale?: string;\n /** Fail web element waits early when the page is idle & readyState === \"complete\" instead of waiting full waitTimeout. */\n failFastWhenIdle?: boolean;\n };\n platforms?: Platform[];\n /** Run platforms concurrently when they use independent resources. Default: false (serial). */\n parallelPlatforms?: boolean;\n flowDir?: string;\n launchOptions?: LaunchOptions;\n /**\n * Reporter names or module paths. Built-in: \"console\", \"json\", \"junit\", \"html\", \"allure\".\n * Custom reporters: provide a relative path (e.g., \"./reporters/slack.ts\") that default-exports\n * a Reporter object or a `(options: { outputDir: string }) => Reporter` factory function.\n */\n reporters?: string[];\n hooks?: {\n beforeAll?: (ctx: HookContext) => Promise<void>;\n beforeEach?: (ctx: HookContext) => Promise<void>;\n afterEach?: (ctx: HookContext) => Promise<void>;\n afterAll?: (ctx: HookContext) => Promise<void>;\n };\n artifacts?: ArtifactConfig;\n execution?: ExecutionConfig;\n visualRegression?: {\n threshold?: number;\n maxDiffPixelRatio?: number;\n baselinesDir?: string;\n mode?: \"pixel\" | \"layout-tolerant\";\n };\n /** Pluggable CI filters evaluated when `--changed-since <ref>` is passed. */\n filters?: Array<{\n name: string;\n filter: (flows: any[], context: any) => Promise<any> | any;\n }>;\n /** Verified replay cache settings for optional agentic steps (`.spana/cache/`). */\n replayCache?: {\n mode?: \"read-write\" | \"strict\" | \"off\";\n dir?: string;\n };\n}\n\nconst platformSchema = z.enum([\"web\", \"android\", \"ios\", \"electron\", \"electrobun\"]);\nconst reporterSchema = z.string().min(1);\nconst hookSchema = z.custom<(...args: unknown[]) => Promise<void>>(\n (value) => typeof value === \"function\",\n { message: \"Expected function\" },\n);\n\nconst iosSigningConfigSchema = z\n .object({\n teamId: z.string().min(1, \"teamId is required\"),\n signingIdentity: z.string().min(1).optional(),\n })\n .strict();\n\nconst bridgeConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n port: z.number().int().positive().optional(),\n host: z.string().min(1).optional(),\n url: z.string().min(1).optional(),\n connectTimeout: z.number().positive().optional(),\n })\n .strict();\n\nconst warmDaemonConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n reuseBrowserProcess: z.boolean().optional(),\n reuseSession: z.boolean().optional(),\n stateFile: z.string().min(1).optional(),\n })\n .strict();\n\nconst appConfigSchema = z\n .object({\n url: z.string().url().optional(),\n packageName: z.string().min(1).optional(),\n bundleId: z.string().min(1).optional(),\n appPath: z.string().min(1).optional(),\n signing: iosSigningConfigSchema.optional(),\n webkitInspectorUrl: z.string().min(1).optional(),\n webkitInspectorPort: z.number().int().positive().optional(),\n cdpPort: z.number().int().positive().optional(),\n locale: z.string().min(1).optional(),\n bridge: bridgeConfigSchema.optional(),\n })\n .strict();\n\nconst electronAppConfigSchema = z\n .object({\n entry: z.string().min(1).optional(),\n executablePath: z.string().min(1).optional(),\n args: z.array(z.string()).optional(),\n cwd: z.string().min(1).optional(),\n env: z.record(z.string(), z.string()).optional(),\n cdpUrl: z.string().url().optional(),\n cdpPort: z.number().int().positive().optional(),\n url: z.string().url().optional(),\n bridge: bridgeConfigSchema.optional(),\n })\n .strict();\n\nconst electrobunAppConfigSchema = z\n .object({\n executablePath: z.string().min(1).optional(),\n appDir: z.string().min(1).optional(),\n args: z.array(z.string()).optional(),\n cwd: z.string().min(1).optional(),\n env: z.record(z.string(), z.string()).optional(),\n renderer: z.enum([\"native\", \"cef\"]).optional(),\n cdpUrl: z.string().url().optional(),\n cdpPort: z.number().int().positive().optional(),\n webkitInspectorPort: z.number().int().positive().optional(),\n url: z.string().url().optional(),\n bridge: bridgeConfigSchema.optional(),\n })\n .strict();\n\nconst cloudAppReferenceSchema = z\n .object({\n id: z.string().min(1).optional(),\n path: z.string().min(1).optional(),\n name: z.string().min(1).optional(),\n })\n .strict();\n\nconst browserStackAppSchema = cloudAppReferenceSchema\n .extend({\n customId: z.string().min(1).optional(),\n })\n .strict();\n\nconst browserStackLocalSchema = z\n .object({\n enabled: z.boolean().optional(),\n binary: z.string().min(1).optional(),\n identifier: z.string().min(1).optional(),\n args: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nconst browserStackHelperSchema = z\n .object({\n app: browserStackAppSchema.optional(),\n local: browserStackLocalSchema.optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict();\n\nconst sauceConnectSchema = z\n .object({\n enabled: z.boolean().optional(),\n binary: z.string().min(1).optional(),\n tunnelName: z.string().min(1).optional(),\n args: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nconst sauceLabsHelperSchema = z\n .object({\n app: cloudAppReferenceSchema.optional(),\n connect: sauceConnectSchema.optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict();\n\nconst storybookConfigSchema = z\n .object({\n url: z.string().url().optional(),\n iframePath: z.string().min(1).optional(),\n })\n .strict();\n\nconst appiumExecutionConfigSchema = z\n .object({\n serverUrl: z.string().url().optional(),\n capabilities: z.record(z.string(), z.unknown()).optional(),\n platformCapabilities: z\n .object({\n android: z.record(z.string(), z.unknown()).optional(),\n ios: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n capabilitiesFile: z.string().min(1).optional(),\n reportToProvider: z.boolean().optional(),\n browserstack: browserStackHelperSchema.optional(),\n saucelabs: sauceLabsHelperSchema.optional(),\n cloudProvider: z.string().min(1).optional(),\n autoStart: z.boolean().optional(),\n autoStartBinary: z.string().min(1).optional(),\n autoStartArgs: z.array(z.string()).optional(),\n })\n .strict();\n\nconst virtualAuthenticatorOptionsSchema = z\n .object({\n protocol: z.enum([\"ctap2\", \"u2f\"]).optional(),\n transport: z.enum([\"usb\", \"nfc\", \"ble\", \"cable\", \"internal\"]).optional(),\n hasResidentKey: z.boolean().optional(),\n hasUserVerification: z.boolean().optional(),\n isUserVerified: z.boolean().optional(),\n automaticPresenceSimulation: z.boolean().optional(),\n })\n .strict();\n\nconst webExecutionConfigSchema = z\n .object({\n browser: z.enum([\"chromium\", \"firefox\", \"webkit\"]).optional(),\n engine: z.enum([\"playwright\", \"cdp\", \"lightpanda\"]).optional(),\n cdpUrl: z.string().url().optional(),\n wsEndpoint: z.string().url().optional(),\n executablePath: z.string().min(1).optional(),\n channel: z.string().min(1).optional(),\n headless: z.boolean().optional(),\n waitUntil: z.enum([\"domcontentloaded\", \"load\", \"networkidle\", \"commit\"]).optional(),\n instantAnimations: z.boolean().optional(),\n blockResources: z.array(z.enum([\"image\", \"font\", \"media\", \"stylesheet\"])).optional(),\n warmBrowser: z.boolean().optional(),\n warmBrowserScope: z.string().min(1).optional(),\n freshContextPerFlow: z.boolean().optional(),\n maxContextsPerBrowser: z.number().int().positive().optional(),\n virtualAuthenticator: z.union([z.boolean(), virtualAuthenticatorOptionsSchema]).optional(),\n storageState: z.string().min(1).optional(),\n verboseLogging: z.boolean().optional(),\n storybook: storybookConfigSchema.optional(),\n })\n .strict();\n\nconst executionConfigSchema = z\n .object({\n mode: z.enum([\"local\", \"appium\"]).optional(),\n web: webExecutionConfigSchema.optional(),\n appium: appiumExecutionConfigSchema.optional(),\n bridge: bridgeConfigSchema.optional(),\n warmDaemons: warmDaemonConfigSchema.optional(),\n })\n .strict();\n\nconst artifactConfigSchema = z\n .object({\n outputDir: z.string().min(1).optional(),\n captureOnFailure: z.boolean().optional(),\n captureOnSuccess: z.boolean().optional(),\n captureSteps: z.boolean().optional(),\n screenshot: z.boolean().optional(),\n uiHierarchy: z.boolean().optional(),\n consoleLogs: z.boolean().optional(),\n jsErrors: z.boolean().optional(),\n har: z.boolean().optional(),\n })\n .strict();\n\nconst deviceStateSchema = z\n .object({\n language: z.string().min(1).optional(),\n locale: z.string().min(1).optional(),\n timeZone: z.string().min(1).optional(),\n })\n .strict();\n\nconst launchOptionsSchema = z\n .object({\n clearState: z.boolean().optional(),\n clearKeychain: z.boolean().optional(),\n deepLink: z.string().min(1).optional(),\n launchArguments: z.record(z.string(), z.unknown()).optional(),\n deviceState: deviceStateSchema.optional(),\n })\n .strict();\n\nexport const provConfigSchema = z\n .object({\n apps: z\n .object({\n web: appConfigSchema.optional(),\n android: appConfigSchema.optional(),\n ios: appConfigSchema.optional(),\n electron: electronAppConfigSchema.optional(),\n electrobun: electrobunAppConfigSchema.optional(),\n })\n .strict()\n .optional(),\n defaults: z\n .object({\n waitTimeout: z.number().positive().optional(),\n pollInterval: z.number().positive().optional(),\n settleTimeout: z.number().nonnegative().optional(),\n retries: z.number().int().nonnegative().optional(),\n waitForIdleTimeout: z.number().nonnegative().optional(),\n typingDelay: z.number().nonnegative().optional(),\n initialPollInterval: z.number().positive().optional(),\n hierarchyCacheTtl: z.number().nonnegative().optional(),\n snapshotMaxDepth: z.number().int().positive().optional(),\n retryDelay: z.number().nonnegative().optional(),\n workers: z.number().int().positive().optional(),\n tapMode: z.enum([\"native\", \"dom\"]).optional(),\n locale: z.string().min(1).optional(),\n failFastWhenIdle: z.boolean().optional(),\n })\n .strict()\n .optional(),\n platforms: z.array(platformSchema).optional(),\n parallelPlatforms: z.boolean().optional(),\n flowDir: z.string().min(1).optional(),\n launchOptions: launchOptionsSchema.optional(),\n reporters: z.array(reporterSchema).optional(),\n hooks: z\n .object({\n beforeAll: hookSchema.optional(),\n beforeEach: hookSchema.optional(),\n afterEach: hookSchema.optional(),\n afterAll: hookSchema.optional(),\n })\n .strict()\n .optional(),\n artifacts: artifactConfigSchema.optional(),\n execution: executionConfigSchema.optional(),\n visualRegression: z\n .object({\n threshold: z.number().min(0).max(1).optional(),\n maxDiffPixelRatio: z.number().min(0).max(1).optional(),\n baselinesDir: z.string().optional(),\n mode: z.enum([\"pixel\", \"layout-tolerant\"]).optional(),\n })\n .optional(),\n filters: z\n .array(\n z.custom<{ name: string; filter: (...args: unknown[]) => unknown }>(\n (value) =>\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as Record<string, unknown>).name === \"string\" &&\n typeof (value as Record<string, unknown>).filter === \"function\",\n { message: \"Expected TestFilter ({ name, filter })\" },\n ),\n )\n .optional(),\n replayCache: z\n .object({\n mode: z.enum([\"read-write\", \"strict\", \"off\"]).optional(),\n dir: z.string().min(1).optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport function defineConfig(config: ProvConfig): ProvConfig {\n return config;\n}\n\nexport function validateConfig(config: unknown): ProvConfig {\n return provConfigSchema.parse(config) as ProvConfig;\n}\n\nexport function formatConfigValidationError(error: ZodError): string {\n return error.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? issue.path.join(\".\") : \"config\";\n return `- ${path}: ${issue.message}`;\n })\n .join(\"\\n\");\n}\n"],"mappings":";AAMA,SAAS,SAAwB;AAqUjC,IAAM,iBAAiB,EAAE,KAAK,CAAC,OAAO,WAAW,OAAO,YAAY,YAAY,CAAC;AACjF,IAAM,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC;AACvC,IAAM,aAAa,EAAE;AAAA,EACnB,CAAC,UAAU,OAAO,UAAU;AAAA,EAC5B,EAAE,SAAS,oBAAoB;AACjC;AAEA,IAAM,yBAAyB,EAC5B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