expect-sdk 0.0.24 → 0.0.25
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/.turbo/turbo-build.log +160 -15
- package/.turbo/turbo-check.log +3 -3
- package/.turbo/turbo-format.log +5 -0
- package/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/assets/resolver.darwin-arm64-DG19oi97.node +0 -0
- package/dist/chunk-CBBoxR_p.mjs +26 -0
- package/dist/constants-CiYaLOeC.mjs +21537 -0
- package/dist/constants-CiYaLOeC.mjs.map +1 -0
- package/dist/dist-UC7-qr_C.mjs +48328 -0
- package/dist/dist-UC7-qr_C.mjs.map +1 -0
- package/dist/effect.d.mts +2 -7
- package/dist/effect.d.mts.map +1 -1
- package/dist/effect.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -4
- package/dist/index.mjs.map +1 -1
- package/dist/libsql-iuT0m15F.mjs +695 -0
- package/dist/libsql-iuT0m15F.mjs.map +1 -0
- package/dist/oxc-resolver-CciJEGzv.mjs +523 -0
- package/dist/oxc-resolver-CciJEGzv.mjs.map +1 -0
- package/dist/{types-0J0EwTM4.d.mts → types-tiwbDMA0.d.mts} +2 -2
- package/dist/{types-0J0EwTM4.d.mts.map → types-tiwbDMA0.d.mts.map} +1 -1
- package/package.json +23 -12
- package/vite.config.ts +3 -0
- package/dist/constants-DFJAD4-F.mjs +0 -152
- package/dist/constants-DFJAD4-F.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxc-resolver-CciJEGzv.mjs","names":[],"sources":["../../../node_modules/.pnpm/@oxc-resolver+binding-darwin-arm64@11.19.1/node_modules/@oxc-resolver/binding-darwin-arm64/package.json","../../../node_modules/.pnpm/oxc-resolver@11.19.1/node_modules/oxc-resolver/webcontainer-fallback.js","../../../node_modules/.pnpm/oxc-resolver@11.19.1/node_modules/oxc-resolver/index.js"],"sourcesContent":["","const fs = require('node:fs');\nconst childProcess = require('node:child_process');\n\nconst pkg = JSON.parse(\n fs.readFileSync(require.resolve('oxc-resolver/package.json'), 'utf-8'),\n);\nconst version = pkg.version;\nconst baseDir = `/tmp/oxc-resolver-${version}`;\nconst bindingEntry = `${baseDir}/node_modules/@oxc-resolver/binding-wasm32-wasi/resolver.wasi.cjs`;\n\nif (!fs.existsSync(bindingEntry)) {\n fs.rmSync(baseDir, { recursive: true, force: true });\n fs.mkdirSync(baseDir, { recursive: true });\n const bindingPkg = `@oxc-resolver/binding-wasm32-wasi@${version}`;\n // eslint-disable-next-line: no-console\n console.log(`[oxc-resolver] Downloading ${bindingPkg} on WebContainer...`);\n childProcess.execFileSync('pnpm', ['i', bindingPkg], {\n cwd: baseDir,\n stdio: 'inherit',\n });\n}\n\nmodule.exports = require(bindingEntry);\n","// prettier-ignore\n/* eslint-disable */\n// @ts-nocheck\n/* auto-generated by NAPI-RS */\n\nconst { readFileSync } = require('node:fs')\nlet nativeBinding = null\nconst loadErrors = []\n\nconst isMusl = () => {\n let musl = false\n if (process.platform === 'linux') {\n musl = isMuslFromFilesystem()\n if (musl === null) {\n musl = isMuslFromReport()\n }\n if (musl === null) {\n musl = isMuslFromChildProcess()\n }\n }\n return musl\n}\n\nconst isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')\n\nconst isMuslFromFilesystem = () => {\n try {\n return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')\n } catch {\n return null\n }\n}\n\nconst isMuslFromReport = () => {\n let report = null\n if (typeof process.report?.getReport === 'function') {\n process.report.excludeNetwork = true\n report = process.report.getReport()\n }\n if (!report) {\n return null\n }\n if (report.header && report.header.glibcVersionRuntime) {\n return false\n }\n if (Array.isArray(report.sharedObjects)) {\n if (report.sharedObjects.some(isFileMusl)) {\n return true\n }\n }\n return false\n}\n\nconst isMuslFromChildProcess = () => {\n try {\n return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')\n } catch (e) {\n // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false\n return false\n }\n}\n\nfunction requireNative() {\n if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {\n try {\n return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);\n } catch (err) {\n loadErrors.push(err)\n }\n } else if (process.platform === 'android') {\n if (process.arch === 'arm64') {\n try {\n return require('./resolver.android-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-android-arm64')\n const bindingPackageVersion = require('@oxc-resolver/binding-android-arm64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./resolver.android-arm-eabi.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-android-arm-eabi')\n const bindingPackageVersion = require('@oxc-resolver/binding-android-arm-eabi/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))\n }\n } else if (process.platform === 'win32') {\n if (process.arch === 'x64') {\n if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {\n try {\n return require('./resolver.win32-x64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-win32-x64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-win32-x64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.win32-x64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-win32-x64-msvc')\n const bindingPackageVersion = require('@oxc-resolver/binding-win32-x64-msvc/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'ia32') {\n try {\n return require('./resolver.win32-ia32-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-win32-ia32-msvc')\n const bindingPackageVersion = require('@oxc-resolver/binding-win32-ia32-msvc/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./resolver.win32-arm64-msvc.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-win32-arm64-msvc')\n const bindingPackageVersion = require('@oxc-resolver/binding-win32-arm64-msvc/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))\n }\n } else if (process.platform === 'darwin') {\n try {\n return require('./resolver.darwin-universal.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-darwin-universal')\n const bindingPackageVersion = require('@oxc-resolver/binding-darwin-universal/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n if (process.arch === 'x64') {\n try {\n return require('./resolver.darwin-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-darwin-x64')\n const bindingPackageVersion = require('@oxc-resolver/binding-darwin-x64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./resolver.darwin-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-darwin-arm64')\n const bindingPackageVersion = require('@oxc-resolver/binding-darwin-arm64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))\n }\n } else if (process.platform === 'freebsd') {\n if (process.arch === 'x64') {\n try {\n return require('./resolver.freebsd-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-freebsd-x64')\n const bindingPackageVersion = require('@oxc-resolver/binding-freebsd-x64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm64') {\n try {\n return require('./resolver.freebsd-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-freebsd-arm64')\n const bindingPackageVersion = require('@oxc-resolver/binding-freebsd-arm64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))\n }\n } else if (process.platform === 'linux') {\n if (process.arch === 'x64') {\n if (isMusl()) {\n try {\n return require('./resolver.linux-x64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-x64-musl')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-x64-musl/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.linux-x64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-x64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-x64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm64') {\n if (isMusl()) {\n try {\n return require('./resolver.linux-arm64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-arm64-musl')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm64-musl/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.linux-arm64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-arm64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'arm') {\n if (isMusl()) {\n try {\n return require('./resolver.linux-arm-musleabihf.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-arm-musleabihf')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm-musleabihf/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.linux-arm-gnueabihf.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-arm-gnueabihf')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm-gnueabihf/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'loong64') {\n if (isMusl()) {\n try {\n return require('./resolver.linux-loong64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-loong64-musl')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-loong64-musl/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.linux-loong64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-loong64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-loong64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'riscv64') {\n if (isMusl()) {\n try {\n return require('./resolver.linux-riscv64-musl.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-riscv64-musl')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-riscv64-musl/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n try {\n return require('./resolver.linux-riscv64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-riscv64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-riscv64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n }\n } else if (process.arch === 'ppc64') {\n try {\n return require('./resolver.linux-ppc64-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-ppc64-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-ppc64-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 's390x') {\n try {\n return require('./resolver.linux-s390x-gnu.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-linux-s390x-gnu')\n const bindingPackageVersion = require('@oxc-resolver/binding-linux-s390x-gnu/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))\n }\n } else if (process.platform === 'openharmony') {\n if (process.arch === 'arm64') {\n try {\n return require('./resolver.openharmony-arm64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-openharmony-arm64')\n const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-arm64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'x64') {\n try {\n return require('./resolver.openharmony-x64.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-openharmony-x64')\n const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-x64/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else if (process.arch === 'arm') {\n try {\n return require('./resolver.openharmony-arm.node')\n } catch (e) {\n loadErrors.push(e)\n }\n try {\n const binding = require('@oxc-resolver/binding-openharmony-arm')\n const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-arm/package.json').version\n if (bindingPackageVersion !== '11.19.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n throw new Error(`Native binding package version mismatch, expected 11.19.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n }\n return binding\n } catch (e) {\n loadErrors.push(e)\n }\n } else {\n loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))\n }\n } else {\n loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))\n }\n}\n\nnativeBinding = requireNative()\n\nif (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {\n let wasiBinding = null\n let wasiBindingError = null\n try {\n wasiBinding = require('./resolver.wasi.cjs')\n nativeBinding = wasiBinding\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n wasiBindingError = err\n }\n }\n if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {\n try {\n wasiBinding = require('@oxc-resolver/binding-wasm32-wasi')\n nativeBinding = wasiBinding\n } catch (err) {\n if (process.env.NAPI_RS_FORCE_WASI) {\n if (!wasiBindingError) {\n wasiBindingError = err\n } else {\n wasiBindingError.cause = err\n }\n loadErrors.push(err)\n }\n }\n }\n if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {\n const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')\n error.cause = wasiBindingError\n throw error\n }\n}\n\nif (!nativeBinding && globalThis.process?.versions?.[\"webcontainer\"]) {\n try {\n nativeBinding = require('./webcontainer-fallback.js');\n } catch (err) {\n loadErrors.push(err)\n }\n}\n\nif (!nativeBinding) {\n if (loadErrors.length > 0) {\n throw new Error(\n `Cannot find native binding. ` +\n `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +\n 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',\n {\n cause: loadErrors.reduce((err, cur) => {\n cur.cause = err\n return cur\n }),\n },\n )\n }\n throw new Error(`Failed to load native binding`)\n}\n\nmodule.exports = nativeBinding\nmodule.exports.ResolverFactory = nativeBinding.ResolverFactory\nmodule.exports.EnforceExtension = nativeBinding.EnforceExtension\nmodule.exports.ModuleType = nativeBinding.ModuleType\nmodule.exports.sync = nativeBinding.sync\n\nif (process.versions.pnp) {\n process.env.OXC_RESOLVER_YARN_PNP = '1'\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CCAA,MAAM,KAAA,UAAa,UAAU;CAC7B,MAAM,eAAA,UAAuB,qBAAqB;CAKlD,MAAM,UAHM,KAAK,MACf,GAAG,aAAA,UAAqB,QAAQ,4BAA4B,EAAE,QAAQ,CACvE,CACmB;CACpB,MAAM,UAAU,qBAAqB;CACrC,MAAM,eAAe,GAAG,QAAQ;AAEhC,KAAI,CAAC,GAAG,WAAW,aAAa,EAAE;AA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
|
2
|
-
import * as effect_Cause0 from "effect/Cause";
|
|
3
2
|
import { BrowserContext, Cookie, Page } from "playwright";
|
|
3
|
+
import * as effect_Cause0 from "effect/Cause";
|
|
4
4
|
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
|
|
6
6
|
//#region src/errors.d.ts
|
|
@@ -121,4 +121,4 @@ interface ExpectConfig {
|
|
|
121
121
|
}
|
|
122
122
|
//#endregion
|
|
123
123
|
export { DEFAULT_AGENT_BACKEND as _, ExpectConfig as a, ExpectTimeoutError as b, SessionTestInput as c, Test as d, TestEvent as f, Tool$1 as g, TestRun as h, CookieInput as i, Status as l, TestResult as m, BrowserName as n, ExpectSession as o, TestInput as p, Cookie as r, SessionConfig as s, Action as t, StepResult as u, DEFAULT_TIMEOUT_MS as v, ExpectConfigError as y };
|
|
124
|
-
//# sourceMappingURL=types-
|
|
124
|
+
//# sourceMappingURL=types-tiwbDMA0.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-tiwbDMA0.d.mts","names":[],"sources":["../src/errors.ts","../src/constants.ts","../src/types.ts"],"mappings":";;;;;;cAAgC,uBAAA;;;;cAEnB,kBAAA,SAA2B,uBAAA;EAMtC,OAAA;AAAA;AAAA,cAGW,iBAAA,SAA0B,KAAA;cACzB,OAAA,UAAiB,GAAA;AAAA;;;cCZlB,kBAAA;AAAA,cACA,qBAAA;;;KCID,MAAA,cAAoB,IAAA,EAAM,IAAA,KAAS,OAAA;AAAA,KAEnC,WAAA;AAAA,KAEA,WAAA,UAAqB,WAAA,GAAc,WAAA,KAAgB,MAAA;AAAA,KAEnD,IAAA;EAAkB,KAAA;EAAgB,MAAA;AAAA;AAAA,KAElC,MAAA;AAAA,UAEK,MAAA,SAAa,IAAA,CAAK,IAAA;EAAA,SACxB,OAAA,GAAU,KAAA,EAAO,MAAA,sBAA4B,OAAA;AAAA;AAAA,UAGvC,UAAA;EAAA,SACN,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A,UAGM,gBAAA;EAAA,SACN,GAAA;EAAA,SACA,KAAA,EAAO,IAAA;EAAA,SACP,MAAA,GAAS,MAAA;EAAA,SACT,KAAA,GAAQ,MAAA;EAAA,SACR,IAAA;EAAA,SACA,OAAA;EAAA,SACA,WAAA;AAAA;AAAA,UAGM,aAAA;EACf,IAAA,CAAK,KAAA,EAAO,gBAAA,GAAmB,OAAA;EAC/B,KAAA,IAAS,OAAA;EAAA,CACR,MAAA,CAAO,YAAP,KAAwB,OAAA;AAAA;AAAA,UAGV,YAAA;EAAA,SACN,OAAA;EAAA,SACA,OAAA,GAAU,WAAA;EAAA,SACV,IAAA;EAAA,SACA,OAAA,GAAU,WAAA;EAAA,SACV,OAAA;EAAA,SACA,KAAA;EAAA,SACA,MAAA;EAAA,SACA,OAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"tag": "alpha"
|
|
6
|
-
},
|
|
3
|
+
"version": "0.0.25",
|
|
7
4
|
"type": "module",
|
|
8
5
|
"exports": {
|
|
9
|
-
".":
|
|
10
|
-
|
|
6
|
+
".": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"default": "./dist/index.mjs"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"./effect": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/effect.d.mts",
|
|
15
|
+
"default": "./dist/effect.mjs"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"tag": "alpha"
|
|
11
21
|
},
|
|
12
22
|
"dependencies": {
|
|
13
23
|
"@effect/platform-node": "4.0.0-beta.35",
|
|
14
24
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
15
25
|
"@standard-schema/spec": "^1.1.0",
|
|
16
|
-
"effect": "4.0.0-beta.35"
|
|
17
|
-
"@expect/agent": "0.0.24",
|
|
18
|
-
"@expect/shared": "0.0.24",
|
|
19
|
-
"@expect/supervisor": "0.0.24",
|
|
20
|
-
"@expect/cookies": "0.0.24"
|
|
26
|
+
"effect": "4.0.0-beta.35"
|
|
21
27
|
},
|
|
22
28
|
"devDependencies": {
|
|
23
29
|
"@types/bun": "^1.3.11",
|
|
24
30
|
"@types/node": "^22.15.0",
|
|
25
|
-
"typescript": "^5.7.0"
|
|
31
|
+
"typescript": "^5.7.0",
|
|
32
|
+
"@expect/agent": "0.0.25",
|
|
33
|
+
"@expect/cookies": "0.0.25",
|
|
34
|
+
"@expect/shared": "0.0.25",
|
|
35
|
+
"@expect/browser": "0.0.25",
|
|
36
|
+
"@expect/supervisor": "0.0.25"
|
|
26
37
|
},
|
|
27
38
|
"peerDependencies": {
|
|
28
39
|
"playwright": ">=1.50.0"
|
package/vite.config.ts
CHANGED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { DateTime, Layer, Option, References, Schema } from "effect";
|
|
2
|
-
import { Executor, Git } from "@expect/supervisor";
|
|
3
|
-
import { Agent } from "@expect/agent";
|
|
4
|
-
//#region src/errors.ts
|
|
5
|
-
var ExpectTimeoutError = class extends Schema.ErrorClass("ExpectTimeoutError")({
|
|
6
|
-
_tag: Schema.tag("ExpectTimeoutError"),
|
|
7
|
-
timeoutMs: Schema.Number
|
|
8
|
-
}) {
|
|
9
|
-
message = `expect execution timed out after ${this.timeoutMs}ms`;
|
|
10
|
-
};
|
|
11
|
-
var ExpectConfigError = class extends Error {
|
|
12
|
-
constructor(message, fix) {
|
|
13
|
-
super(`${message}\n\nFix: ${fix}`);
|
|
14
|
-
this.name = "ExpectConfigError";
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/build-instruction.ts
|
|
19
|
-
const resolveUrl = (url, baseUrl) => {
|
|
20
|
-
if (typeof url !== "string") throw new ExpectConfigError(`Expected a URL string, got ${typeof url}.`, `Expect.test({ url: "http://localhost:3000/login", tests: [...] })`);
|
|
21
|
-
try {
|
|
22
|
-
return new URL(url).href;
|
|
23
|
-
} catch {}
|
|
24
|
-
if (!baseUrl) throw new ExpectConfigError(`No baseUrl configured and URL "${url}" is relative.`, `configure({ baseUrl: "http://localhost:3000" })\nOr use a full URL: Expect.test({ url: "http://localhost:3000${url}", tests: [...] })`);
|
|
25
|
-
return new URL(url, baseUrl).href;
|
|
26
|
-
};
|
|
27
|
-
const buildInstruction = (url, tests) => {
|
|
28
|
-
const lines = [`Navigate to ${url} and verify the following requirements:`, ""];
|
|
29
|
-
for (const [index, title] of tests.entries()) lines.push(`${index + 1}. ${title}`);
|
|
30
|
-
return lines.join("\n");
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/layers.ts
|
|
34
|
-
const layerSdk = (agentBackend, rootDir) => {
|
|
35
|
-
const gitLayer = Git.withRepoRoot(rootDir);
|
|
36
|
-
const agentLayer = Agent.layerFor(agentBackend);
|
|
37
|
-
const executorLayer = Executor.layer.pipe(Layer.provide(gitLayer));
|
|
38
|
-
return Layer.mergeAll(executorLayer, gitLayer).pipe(Layer.provideMerge(agentLayer), Layer.provideMerge(Layer.succeed(References.MinimumLogLevel, "Error")));
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/result-builder.ts
|
|
42
|
-
const REPLAY_SESSION_PREFIX = "rrweb replay:";
|
|
43
|
-
const SCREENSHOT_PREFIX = "Screenshot:";
|
|
44
|
-
const stepDurationMs = (step) => {
|
|
45
|
-
if (Option.isNone(step.startedAt)) return 0;
|
|
46
|
-
if (Option.isNone(step.endedAt)) return Date.now() - Number(DateTime.toEpochMillis(step.startedAt.value));
|
|
47
|
-
return Number(DateTime.toEpochMillis(step.endedAt.value)) - Number(DateTime.toEpochMillis(step.startedAt.value));
|
|
48
|
-
};
|
|
49
|
-
const stepStatusToResultStatus = (status) => {
|
|
50
|
-
if (status === "passed") return "passed";
|
|
51
|
-
if (status === "failed" || status === "skipped") return "failed";
|
|
52
|
-
return "pending";
|
|
53
|
-
};
|
|
54
|
-
const extractArtifacts = (events) => {
|
|
55
|
-
const closeResult = events.slice().reverse().find((event) => event._tag === "ToolResult" && event.toolName === "close" && !event.isError && event.result.length > 0);
|
|
56
|
-
if (!closeResult || closeResult._tag !== "ToolResult") return {
|
|
57
|
-
recordingPath: void 0,
|
|
58
|
-
screenshotPaths: []
|
|
59
|
-
};
|
|
60
|
-
const lines = closeResult.result.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
61
|
-
return {
|
|
62
|
-
recordingPath: lines.find((line) => line.startsWith(REPLAY_SESSION_PREFIX))?.replace(REPLAY_SESSION_PREFIX, "").trim() || void 0,
|
|
63
|
-
screenshotPaths: lines.filter((line) => line.startsWith(SCREENSHOT_PREFIX)).map((line) => line.replace(SCREENSHOT_PREFIX, "").trim()).filter((value) => value.length > 0)
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
const buildStepResult = (step, screenshotPaths, stepIndex) => ({
|
|
67
|
-
title: step.title,
|
|
68
|
-
status: stepStatusToResultStatus(step.status),
|
|
69
|
-
summary: Option.getOrElse(step.summary, () => ""),
|
|
70
|
-
screenshotPath: screenshotPaths[stepIndex],
|
|
71
|
-
duration: stepDurationMs(step)
|
|
72
|
-
});
|
|
73
|
-
const buildTestResult = (executed, url, startedAt, artifacts) => {
|
|
74
|
-
const steps = executed.steps.map((step, index) => buildStepResult(step, artifacts.screenshotPaths, index));
|
|
75
|
-
const errors = steps.filter((step) => step.status === "failed");
|
|
76
|
-
const hasFailure = errors.length > 0;
|
|
77
|
-
const hasPending = steps.some((step) => step.status === "pending");
|
|
78
|
-
let status = "passed";
|
|
79
|
-
if (hasFailure) status = "failed";
|
|
80
|
-
else if (hasPending || steps.length === 0) status = "pending";
|
|
81
|
-
return {
|
|
82
|
-
status,
|
|
83
|
-
url,
|
|
84
|
-
duration: Date.now() - startedAt,
|
|
85
|
-
recordingPath: artifacts.recordingPath,
|
|
86
|
-
steps,
|
|
87
|
-
errors
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
const mapExecutionEvent = (event, context) => {
|
|
91
|
-
switch (event._tag) {
|
|
92
|
-
case "RunStarted": return {
|
|
93
|
-
type: "run:started",
|
|
94
|
-
title: event.plan.title,
|
|
95
|
-
baseUrl: Option.getOrUndefined(event.plan.baseUrl)
|
|
96
|
-
};
|
|
97
|
-
case "StepStarted": return {
|
|
98
|
-
type: "step:started",
|
|
99
|
-
title: event.title
|
|
100
|
-
};
|
|
101
|
-
case "StepCompleted": {
|
|
102
|
-
const step = context.stepMap.get(event.stepId);
|
|
103
|
-
const index = context.stepIndexMap.get(event.stepId) ?? -1;
|
|
104
|
-
return step ? {
|
|
105
|
-
type: "step:passed",
|
|
106
|
-
step: buildStepResult(step, context.artifacts.screenshotPaths, index)
|
|
107
|
-
} : void 0;
|
|
108
|
-
}
|
|
109
|
-
case "StepFailed": {
|
|
110
|
-
const step = context.stepMap.get(event.stepId);
|
|
111
|
-
const index = context.stepIndexMap.get(event.stepId) ?? -1;
|
|
112
|
-
return step ? {
|
|
113
|
-
type: "step:failed",
|
|
114
|
-
step: buildStepResult(step, context.artifacts.screenshotPaths, index)
|
|
115
|
-
} : void 0;
|
|
116
|
-
}
|
|
117
|
-
case "StepSkipped": return {
|
|
118
|
-
type: "step:skipped",
|
|
119
|
-
title: context.stepMap.get(event.stepId)?.title ?? event.stepId,
|
|
120
|
-
reason: event.reason
|
|
121
|
-
};
|
|
122
|
-
case "ToolResult": return event.toolName.endsWith("__screenshot") && !event.isError ? {
|
|
123
|
-
type: "screenshot",
|
|
124
|
-
title: event.toolName,
|
|
125
|
-
path: event.result
|
|
126
|
-
} : void 0;
|
|
127
|
-
case "RunFinished": return {
|
|
128
|
-
type: "completed",
|
|
129
|
-
result: buildTestResult(context.executed, context.url, context.startedAt, context.artifacts)
|
|
130
|
-
};
|
|
131
|
-
default: return;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const diffEvents = (previous, current, executed, url, startedAt) => {
|
|
135
|
-
const context = {
|
|
136
|
-
stepMap: new Map(executed.steps.map((step) => [step.id, step])),
|
|
137
|
-
stepIndexMap: new Map(executed.steps.map((step, index) => [step.id, index])),
|
|
138
|
-
artifacts: extractArtifacts(executed.events),
|
|
139
|
-
executed,
|
|
140
|
-
url,
|
|
141
|
-
startedAt
|
|
142
|
-
};
|
|
143
|
-
return current.slice(previous.length).map((event) => mapExecutionEvent(event, context)).filter((event) => event !== void 0);
|
|
144
|
-
};
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/constants.ts
|
|
147
|
-
const DEFAULT_TIMEOUT_MS = 300 * 1e3;
|
|
148
|
-
const DEFAULT_AGENT_BACKEND = "claude";
|
|
149
|
-
//#endregion
|
|
150
|
-
export { diffEvents as a, buildInstruction as c, ExpectTimeoutError as d, buildTestResult as i, resolveUrl as l, DEFAULT_TIMEOUT_MS as n, extractArtifacts as o, buildStepResult as r, layerSdk as s, DEFAULT_AGENT_BACKEND as t, ExpectConfigError as u };
|
|
151
|
-
|
|
152
|
-
//# sourceMappingURL=constants-DFJAD4-F.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-DFJAD4-F.mjs","names":[],"sources":["../src/errors.ts","../src/build-instruction.ts","../src/layers.ts","../src/result-builder.ts","../src/constants.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport class ExpectTimeoutError extends Schema.ErrorClass<ExpectTimeoutError>(\"ExpectTimeoutError\")(\n {\n _tag: Schema.tag(\"ExpectTimeoutError\"),\n timeoutMs: Schema.Number,\n },\n) {\n message = `expect execution timed out after ${this.timeoutMs}ms`;\n}\n\nexport class ExpectConfigError extends Error {\n constructor(message: string, fix: string) {\n super(`${message}\\n\\nFix: ${fix}`);\n this.name = \"ExpectConfigError\";\n }\n}\n","import { ExpectConfigError } from \"./errors\";\n\nexport const resolveUrl = (url: unknown, baseUrl: string | undefined): string => {\n if (typeof url !== \"string\") {\n throw new ExpectConfigError(\n `Expected a URL string, got ${typeof url}.`,\n `Expect.test({ url: \"http://localhost:3000/login\", tests: [...] })`,\n );\n }\n\n try {\n return new URL(url).href;\n } catch {\n /* relative URL — falls through to baseUrl resolution */\n }\n\n if (!baseUrl) {\n throw new ExpectConfigError(\n `No baseUrl configured and URL \"${url}\" is relative.`,\n `configure({ baseUrl: \"http://localhost:3000\" })\\nOr use a full URL: Expect.test({ url: \"http://localhost:3000${url}\", tests: [...] })`,\n );\n }\n\n return new URL(url, baseUrl).href;\n};\n\nexport const buildInstruction = (url: string, tests: readonly string[]): string => {\n const lines = [`Navigate to ${url} and verify the following requirements:`, \"\"];\n\n for (const [index, title] of tests.entries()) {\n lines.push(`${index + 1}. ${title}`);\n }\n\n return lines.join(\"\\n\");\n};\n","import { Layer, References } from \"effect\";\nimport { Executor, Git } from \"@expect/supervisor\";\nimport { Agent, type AgentBackend } from \"@expect/agent\";\n\nexport const layerSdk = (agentBackend: AgentBackend, rootDir: string) => {\n const gitLayer = Git.withRepoRoot(rootDir);\n const agentLayer = Agent.layerFor(agentBackend);\n const executorLayer = Executor.layer.pipe(Layer.provide(gitLayer));\n\n return Layer.mergeAll(executorLayer, gitLayer).pipe(\n Layer.provideMerge(agentLayer),\n Layer.provideMerge(Layer.succeed(References.MinimumLogLevel, \"Error\")),\n );\n};\n","import { DateTime, Option } from \"effect\";\nimport type { ExecutedTestPlan, TestPlanStep, ExecutionEvent } from \"@expect/shared/models\";\nimport type { Status, StepResult, TestResult, TestEvent } from \"./types\";\n\nconst REPLAY_SESSION_PREFIX = \"rrweb replay:\";\nconst SCREENSHOT_PREFIX = \"Screenshot:\";\n\nconst stepDurationMs = (step: TestPlanStep): number => {\n if (Option.isNone(step.startedAt)) return 0;\n if (Option.isNone(step.endedAt))\n return Date.now() - Number(DateTime.toEpochMillis(step.startedAt.value));\n return (\n Number(DateTime.toEpochMillis(step.endedAt.value)) -\n Number(DateTime.toEpochMillis(step.startedAt.value))\n );\n};\n\nconst stepStatusToResultStatus = (status: string): Status => {\n if (status === \"passed\") return \"passed\";\n if (status === \"failed\" || status === \"skipped\") return \"failed\";\n return \"pending\";\n};\n\nexport interface ExecutionArtifacts {\n readonly recordingPath: string | undefined;\n readonly screenshotPaths: readonly string[];\n}\n\nexport const extractArtifacts = (events: readonly ExecutionEvent[]): ExecutionArtifacts => {\n const closeResult = events\n .slice()\n .reverse()\n .find(\n (event) =>\n event._tag === \"ToolResult\" &&\n event.toolName === \"close\" &&\n !event.isError &&\n event.result.length > 0,\n );\n\n if (!closeResult || closeResult._tag !== \"ToolResult\") {\n return { recordingPath: undefined, screenshotPaths: [] };\n }\n\n const lines = closeResult.result\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n const replayLine = lines.find((line) => line.startsWith(REPLAY_SESSION_PREFIX));\n const recordingPath = replayLine?.replace(REPLAY_SESSION_PREFIX, \"\").trim() || undefined;\n\n const screenshotPaths = lines\n .filter((line) => line.startsWith(SCREENSHOT_PREFIX))\n .map((line) => line.replace(SCREENSHOT_PREFIX, \"\").trim())\n .filter((value) => value.length > 0);\n\n return { recordingPath, screenshotPaths };\n};\n\nexport const buildStepResult = (\n step: TestPlanStep,\n screenshotPaths: readonly string[],\n stepIndex: number,\n): StepResult => ({\n title: step.title,\n status: stepStatusToResultStatus(step.status),\n summary: Option.getOrElse(step.summary, () => \"\"),\n screenshotPath: screenshotPaths[stepIndex],\n duration: stepDurationMs(step),\n});\n\nexport const buildTestResult = (\n executed: ExecutedTestPlan,\n url: string,\n startedAt: number,\n artifacts: ExecutionArtifacts,\n): TestResult => {\n const steps = executed.steps.map((step, index) =>\n buildStepResult(step, artifacts.screenshotPaths, index),\n );\n const errors = steps.filter((step) => step.status === \"failed\");\n const hasFailure = errors.length > 0;\n const hasPending = steps.some((step) => step.status === \"pending\");\n\n let status: Status = \"passed\";\n if (hasFailure) status = \"failed\";\n else if (hasPending || steps.length === 0) status = \"pending\";\n\n return {\n status,\n url,\n duration: Date.now() - startedAt,\n recordingPath: artifacts.recordingPath,\n steps,\n errors,\n };\n};\n\ninterface DiffContext {\n readonly stepMap: ReadonlyMap<string, TestPlanStep>;\n readonly stepIndexMap: ReadonlyMap<string, number>;\n readonly artifacts: ExecutionArtifacts;\n readonly executed: ExecutedTestPlan;\n readonly url: string;\n readonly startedAt: number;\n}\n\nconst mapExecutionEvent = (event: ExecutionEvent, context: DiffContext): TestEvent | undefined => {\n switch (event._tag) {\n case \"RunStarted\":\n return {\n type: \"run:started\",\n title: event.plan.title,\n baseUrl: Option.getOrUndefined(event.plan.baseUrl),\n };\n case \"StepStarted\":\n return { type: \"step:started\", title: event.title };\n case \"StepCompleted\": {\n const step = context.stepMap.get(event.stepId);\n const index = context.stepIndexMap.get(event.stepId) ?? -1;\n return step\n ? {\n type: \"step:passed\",\n step: buildStepResult(step, context.artifacts.screenshotPaths, index),\n }\n : undefined;\n }\n case \"StepFailed\": {\n const step = context.stepMap.get(event.stepId);\n const index = context.stepIndexMap.get(event.stepId) ?? -1;\n return step\n ? {\n type: \"step:failed\",\n step: buildStepResult(step, context.artifacts.screenshotPaths, index),\n }\n : undefined;\n }\n case \"StepSkipped\":\n return {\n type: \"step:skipped\",\n title: context.stepMap.get(event.stepId)?.title ?? event.stepId,\n reason: event.reason,\n };\n case \"ToolResult\":\n return event.toolName.endsWith(\"__screenshot\") && !event.isError\n ? { type: \"screenshot\", title: event.toolName, path: event.result }\n : undefined;\n case \"RunFinished\":\n return {\n type: \"completed\",\n result: buildTestResult(\n context.executed,\n context.url,\n context.startedAt,\n context.artifacts,\n ),\n };\n default:\n return undefined;\n }\n};\n\nexport const diffEvents = (\n previous: readonly ExecutionEvent[],\n current: readonly ExecutionEvent[],\n executed: ExecutedTestPlan,\n url: string,\n startedAt: number,\n): TestEvent[] => {\n const context: DiffContext = {\n stepMap: new Map(executed.steps.map((step) => [step.id, step])),\n stepIndexMap: new Map(executed.steps.map((step, index) => [step.id, index])),\n artifacts: extractArtifacts(executed.events),\n executed,\n url,\n startedAt,\n };\n\n return current\n .slice(previous.length)\n .map((event) => mapExecutionEvent(event, context))\n .filter((event): event is TestEvent => event !== undefined);\n};\n","export const DEFAULT_TIMEOUT_MS = 5 * 60 * 1000;\nexport const DEFAULT_AGENT_BACKEND = \"claude\" as const;\n"],"mappings":";;;;AAEA,IAAa,qBAAb,cAAwC,OAAO,WAA+B,qBAAqB,CACjG;CACE,MAAM,OAAO,IAAI,qBAAqB;CACtC,WAAW,OAAO;CACnB,CACF,CAAC;CACA,UAAU,oCAAoC,KAAK,UAAU;;AAG/D,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,SAAiB,KAAa;AACxC,QAAM,GAAG,QAAQ,WAAW,MAAM;AAClC,OAAK,OAAO;;;;;ACZhB,MAAa,cAAc,KAAc,YAAwC;AAC/E,KAAI,OAAO,QAAQ,SACjB,OAAM,IAAI,kBACR,8BAA8B,OAAO,IAAI,IACzC,oEACD;AAGH,KAAI;AACF,SAAO,IAAI,IAAI,IAAI,CAAC;SACd;AAIR,KAAI,CAAC,QACH,OAAM,IAAI,kBACR,kCAAkC,IAAI,iBACtC,gHAAgH,IAAI,oBACrH;AAGH,QAAO,IAAI,IAAI,KAAK,QAAQ,CAAC;;AAG/B,MAAa,oBAAoB,KAAa,UAAqC;CACjF,MAAM,QAAQ,CAAC,eAAe,IAAI,0CAA0C,GAAG;AAE/E,MAAK,MAAM,CAAC,OAAO,UAAU,MAAM,SAAS,CAC1C,OAAM,KAAK,GAAG,QAAQ,EAAE,IAAI,QAAQ;AAGtC,QAAO,MAAM,KAAK,KAAK;;;;AC7BzB,MAAa,YAAY,cAA4B,YAAoB;CACvE,MAAM,WAAW,IAAI,aAAa,QAAQ;CAC1C,MAAM,aAAa,MAAM,SAAS,aAAa;CAC/C,MAAM,gBAAgB,SAAS,MAAM,KAAK,MAAM,QAAQ,SAAS,CAAC;AA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