spana-test 0.10.0 → 0.12.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 +0 -0
- package/LICENSE +0 -0
- package/README.md +4 -1
- package/dist/{accessibility-audit-YZOPUY3D.js → accessibility-audit-MHQ65DUD.js} +61 -12
- package/dist/accessibility-audit-MHQ65DUD.js.map +1 -0
- package/dist/agent/index.d.ts +3 -11
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +20 -12
- package/dist/agent/index.js.map +1 -1
- package/dist/{session-Bt_mbUWg.d.ts → agent/session.d.ts} +14 -42
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent-fixture-H6GOUHNX.js +20 -0
- package/dist/{android-6BOQTMM3.js.map → agent-fixture-H6GOUHNX.js.map} +0 -0
- package/dist/{allure-FGVR5LND.js → allure-XOM7BXL5.js} +5 -2
- package/dist/{allure-FGVR5LND.js.map → allure-XOM7BXL5.js.map} +1 -1
- package/dist/{android-6BOQTMM3.js → android-C2S4B4TH.js} +3 -3
- package/dist/{chunk-DGUM43GV.js.map → android-C2S4B4TH.js.map} +0 -0
- package/dist/api/agent-fixture.d.ts +119 -0
- package/dist/api/agent-fixture.d.ts.map +1 -0
- package/dist/api/app.d.ts +359 -0
- package/dist/api/app.d.ts.map +1 -0
- package/dist/api/expect.d.ts +167 -0
- package/dist/api/expect.d.ts.map +1 -0
- package/dist/api/fixtures.d.ts +165 -0
- package/dist/api/fixtures.d.ts.map +1 -0
- package/dist/api/flow.d.ts +123 -0
- package/dist/api/flow.d.ts.map +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/snapshots.d.ts +26 -0
- package/dist/api/snapshots.d.ts.map +1 -0
- package/dist/api/storybook.d.ts +18 -0
- package/dist/api/storybook.d.ts.map +1 -0
- package/dist/api/suite.d.ts +46 -0
- package/dist/api/suite.d.ts.map +1 -0
- package/dist/app-CBHH5GMB.js +10 -0
- package/dist/{config-loader-WLPQ5WVH.js.map → app-CBHH5GMB.js.map} +0 -0
- package/dist/{appium-server-66GVUL24.js → appium-server-M6CWWUWF.js} +5 -2
- package/dist/{appium-server-66GVUL24.js.map → appium-server-M6CWWUWF.js.map} +1 -1
- package/dist/{baseline-manager-5TIUCNP5.js → baseline-manager-LVUVH2MJ.js} +5 -2
- package/dist/{baseline-manager-5TIUCNP5.js.map → baseline-manager-LVUVH2MJ.js.map} +1 -1
- package/dist/cache-command-OL7HUK2K.js +12 -0
- package/dist/{daemon-manager-2EQDVUVM.js.map → cache-command-OL7HUK2K.js.map} +0 -0
- package/dist/channels/android-cdp.d.ts +71 -0
- package/dist/channels/android-cdp.d.ts.map +1 -0
- package/dist/channels/apple-webinspector.d.ts +85 -0
- package/dist/channels/apple-webinspector.d.ts.map +1 -0
- package/dist/channels/bidi-client.d.ts +79 -0
- package/dist/channels/bidi-client.d.ts.map +1 -0
- package/dist/channels/bridge-server.d.ts +69 -0
- package/dist/channels/bridge-server.d.ts.map +1 -0
- package/dist/channels/cdp-client.d.ts +102 -0
- package/dist/channels/cdp-client.d.ts.map +1 -0
- package/dist/channels/dom-channel.d.ts +246 -0
- package/dist/channels/dom-channel.d.ts.map +1 -0
- package/dist/channels/index.d.ts +8 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/webkit-inspector.d.ts +85 -0
- package/dist/channels/webkit-inspector.d.ts.map +1 -0
- package/dist/channels/ws-server.d.ts +21 -0
- package/dist/channels/ws-server.d.ts.map +1 -0
- package/dist/{chunk-WV3ALL3H.js → chunk-2MA5G2VH.js} +6 -2
- package/dist/{chunk-WV3ALL3H.js.map → chunk-2MA5G2VH.js.map} +1 -1
- package/dist/{chunk-6GBAPW6K.js → chunk-53TGNQTM.js} +22 -14
- package/dist/{chunk-6GBAPW6K.js.map → chunk-53TGNQTM.js.map} +1 -1
- package/dist/{chunk-JPZCZHL4.js → chunk-7Q7TSUNL.js} +6 -1
- package/dist/{chunk-JPZCZHL4.js.map → chunk-7Q7TSUNL.js.map} +1 -1
- package/dist/{chunk-X2TJP7LB.js → chunk-7WHQIQPM.js} +11 -1
- package/dist/chunk-7WHQIQPM.js.map +1 -0
- package/dist/{chunk-IXON7DMB.js → chunk-AMBU26PB.js} +9 -3
- package/dist/{chunk-IXON7DMB.js.map → chunk-AMBU26PB.js.map} +1 -1
- package/dist/{chunk-66D3C7NB.js → chunk-BWEQ4XT2.js} +1707 -2159
- package/dist/chunk-BWEQ4XT2.js.map +1 -0
- package/dist/{chunk-Y6KMJJ2T.js → chunk-F2YUBD4E.js} +364 -3
- package/dist/chunk-F2YUBD4E.js.map +1 -0
- package/dist/chunk-F3AFZ6UX.js +326 -0
- package/dist/chunk-F3AFZ6UX.js.map +1 -0
- package/dist/{chunk-Z6K4QQAR.js → chunk-FHCOPLYB.js} +36 -7
- package/dist/chunk-FHCOPLYB.js.map +1 -0
- package/dist/{chunk-3SH5JQF7.js → chunk-FSPMFRJO.js} +6 -1
- package/dist/{chunk-3SH5JQF7.js.map → chunk-FSPMFRJO.js.map} +1 -1
- package/dist/chunk-FTXUQMGH.js +56 -0
- package/dist/chunk-FTXUQMGH.js.map +1 -0
- package/dist/chunk-GAWJL6Q3.js +2268 -0
- package/dist/chunk-GAWJL6Q3.js.map +1 -0
- package/dist/{chunk-B473XZOM.js → chunk-GDDCZ2PL.js} +183 -2004
- package/dist/chunk-GDDCZ2PL.js.map +1 -0
- package/dist/chunk-HIGFQRWM.js +562 -0
- package/dist/chunk-HIGFQRWM.js.map +1 -0
- package/dist/chunk-LQQNE2OE.js +4358 -0
- package/dist/chunk-LQQNE2OE.js.map +1 -0
- package/dist/{chunk-KJPHH2TW.js → chunk-NHT3XSX3.js} +6 -1
- package/dist/{chunk-KJPHH2TW.js.map → chunk-NHT3XSX3.js.map} +1 -1
- package/dist/{chunk-3FSZNKEF.js → chunk-NXET4BFJ.js} +7 -1
- package/dist/{chunk-3FSZNKEF.js.map → chunk-NXET4BFJ.js.map} +1 -1
- package/dist/chunk-OQRGR542.js +3061 -0
- package/dist/chunk-OQRGR542.js.map +1 -0
- package/dist/{chunk-B35G77DN.js → chunk-PPAPRKQU.js} +734 -3493
- package/dist/chunk-PPAPRKQU.js.map +1 -0
- package/dist/{chunk-DP7MGXHN.js → chunk-PRQTAIYA.js} +56 -6
- package/dist/chunk-PRQTAIYA.js.map +1 -0
- package/dist/{chunk-SF7UYW4I.js → chunk-QOL44BNJ.js} +8 -4
- package/dist/{chunk-SF7UYW4I.js.map → chunk-QOL44BNJ.js.map} +1 -1
- package/dist/{chunk-CY3DKTBZ.js → chunk-RIXZISMX.js} +6 -1
- package/dist/{chunk-CY3DKTBZ.js.map → chunk-RIXZISMX.js.map} +1 -1
- package/dist/chunk-TFEXYI6N.js +77 -0
- package/dist/chunk-TFEXYI6N.js.map +1 -0
- package/dist/chunk-U56N5JCJ.js +19842 -0
- package/dist/chunk-U56N5JCJ.js.map +1 -0
- package/dist/{chunk-IHVZKQQW.js → chunk-UKUXNFQP.js} +6 -1
- package/dist/{chunk-IHVZKQQW.js.map → chunk-UKUXNFQP.js.map} +1 -1
- package/dist/{chunk-54ASKII6.js → chunk-VOYJQDSI.js} +6 -1
- package/dist/{chunk-54ASKII6.js.map → chunk-VOYJQDSI.js.map} +1 -1
- package/dist/{chunk-C2HBFEMQ.js → chunk-WJH5K42V.js} +6 -2
- package/dist/{chunk-C2HBFEMQ.js.map → chunk-WJH5K42V.js.map} +1 -1
- package/dist/{chunk-VP6V4XEJ.js → chunk-XD6A3VXB.js} +10 -5
- package/dist/{chunk-VP6V4XEJ.js.map → chunk-XD6A3VXB.js.map} +1 -1
- package/dist/chunk-XQRXQBDQ.js +133 -0
- package/dist/chunk-XQRXQBDQ.js.map +1 -0
- package/dist/{chunk-2AFWVHQK.js → chunk-XVL4FHXA.js} +6 -1
- package/dist/{chunk-2AFWVHQK.js.map → chunk-XVL4FHXA.js.map} +1 -1
- package/dist/{chunk-LAMTF4LX.js → chunk-ZIETAMAD.js} +6 -1
- package/dist/{chunk-LAMTF4LX.js.map → chunk-ZIETAMAD.js.map} +1 -1
- package/dist/cli/cache-command.d.ts +29 -0
- package/dist/cli/cache-command.d.ts.map +1 -0
- package/dist/cli/command-errors.d.ts +7 -0
- package/dist/cli/command-errors.d.ts.map +1 -0
- package/dist/cli/config-loader.d.ts +11 -0
- package/dist/cli/config-loader.d.ts.map +1 -0
- package/dist/cli/doctor-command.d.ts +64 -0
- package/dist/cli/doctor-command.d.ts.map +1 -0
- package/dist/cli/gen-types-command.d.ts +2 -0
- package/dist/cli/gen-types-command.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/init-command.d.ts +7 -0
- package/dist/cli/init-command.d.ts.map +1 -0
- package/dist/cli/init-flow-command.d.ts +11 -0
- package/dist/cli/init-flow-command.d.ts.map +1 -0
- package/dist/cli/iteration.d.ts +44 -0
- package/dist/cli/iteration.d.ts.map +1 -0
- package/dist/cli/scaffolds.d.ts +13 -0
- package/dist/cli/scaffolds.d.ts.map +1 -0
- package/dist/cli/studio-command.d.ts +8 -0
- package/dist/cli/studio-command.d.ts.map +1 -0
- package/dist/cli/test-command.d.ts +61 -0
- package/dist/cli/test-command.d.ts.map +1 -0
- package/dist/cli/watch-mode.d.ts +9 -0
- package/dist/cli/watch-mode.d.ts.map +1 -0
- package/dist/cli.js +255 -26
- package/dist/cli.js.map +1 -1
- package/dist/cloud/browserstack.d.ts +9 -0
- package/dist/cloud/browserstack.d.ts.map +1 -0
- package/dist/cloud/common.d.ts +26 -0
- package/dist/cloud/common.d.ts.map +1 -0
- package/dist/cloud/provider.d.ts +21 -0
- package/dist/cloud/provider.d.ts.map +1 -0
- package/dist/cloud/saucelabs.d.ts +9 -0
- package/dist/cloud/saucelabs.d.ts.map +1 -0
- package/dist/{compiler-X6WTFMYF.js → compiler-44UW2FID.js} +7 -3
- package/dist/{compiler-X6WTFMYF.js.map → compiler-44UW2FID.js.map} +1 -1
- package/dist/config-loader-V26XXHPH.js +10 -0
- package/dist/{discover-RLSKEBAX.js.map → config-loader-V26XXHPH.js.map} +0 -0
- package/dist/{console-DIYEJSSP.js → console-T6TVZ65G.js} +8 -2
- package/dist/console-T6TVZ65G.js.map +1 -0
- package/dist/core/accessibility-audit.d.ts +29 -0
- package/dist/core/accessibility-audit.d.ts.map +1 -0
- package/dist/core/artifacts.d.ts +27 -0
- package/dist/core/artifacts.d.ts.map +1 -0
- package/dist/core/baseline-manager.d.ts +18 -0
- package/dist/core/baseline-manager.d.ts.map +1 -0
- package/dist/core/benchmark.d.ts +21 -0
- package/dist/core/benchmark.d.ts.map +1 -0
- package/dist/core/debug-repl.d.ts +17 -0
- package/dist/core/debug-repl.d.ts.map +1 -0
- package/dist/core/engine.d.ts +51 -0
- package/dist/core/engine.d.ts.map +1 -0
- package/dist/core/filters.d.ts +248 -0
- package/dist/core/filters.d.ts.map +1 -0
- package/dist/core/flow-generator.d.ts +13 -0
- package/dist/core/flow-generator.d.ts.map +1 -0
- package/dist/core/graphemes.d.ts +2 -0
- package/dist/core/graphemes.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/native-accel.d.ts +21 -0
- package/dist/core/native-accel.d.ts.map +1 -0
- package/dist/core/network-cache.d.ts +68 -0
- package/dist/core/network-cache.d.ts.map +1 -0
- package/dist/core/orchestrator.d.ts +44 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/parallel.d.ts +42 -0
- package/dist/core/parallel.d.ts.map +1 -0
- package/dist/core/port-allocator.d.ts +16 -0
- package/dist/core/port-allocator.d.ts.map +1 -0
- package/dist/core/projects.d.ts +60 -0
- package/dist/core/projects.d.ts.map +1 -0
- package/dist/core/replay-cache.d.ts +127 -0
- package/dist/core/replay-cache.d.ts.map +1 -0
- package/dist/core/runner.d.ts +50 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/screenshot-compare.d.ts +50 -0
- package/dist/core/screenshot-compare.d.ts.map +1 -0
- package/dist/core/session-manager.d.ts +35 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/step-recorder.d.ts +20 -0
- package/dist/core/step-recorder.d.ts.map +1 -0
- package/dist/core/target-matrix.d.ts +29 -0
- package/dist/core/target-matrix.d.ts.map +1 -0
- package/dist/core/trace-viewer.d.ts +91 -0
- package/dist/core/trace-viewer.d.ts.map +1 -0
- package/dist/core/validator.d.ts +18 -0
- package/dist/core/validator.d.ts.map +1 -0
- package/dist/core/video-recorder.d.ts +120 -0
- package/dist/core/video-recorder.d.ts.map +1 -0
- package/dist/core/worker-pool.d.ts +87 -0
- package/dist/core/worker-pool.d.ts.map +1 -0
- package/dist/{daemon-manager-2EQDVUVM.js → daemon-manager-2SK5PHJR.js} +3 -3
- package/dist/{filters-MQG2RMPX.js.map → daemon-manager-2SK5PHJR.js.map} +0 -0
- package/dist/device/android.d.ts +66 -0
- package/dist/device/android.d.ts.map +1 -0
- package/dist/device/discover.d.ts +15 -0
- package/dist/device/discover.d.ts.map +1 -0
- package/dist/device/index.d.ts +4 -0
- package/dist/device/index.d.ts.map +1 -0
- package/dist/device/ios.d.ts +126 -0
- package/dist/device/ios.d.ts.map +1 -0
- package/dist/diagnostics/live-inspector.d.ts +121 -0
- package/dist/diagnostics/live-inspector.d.ts.map +1 -0
- package/dist/diagnostics/native-logs.d.ts +38 -0
- package/dist/diagnostics/native-logs.d.ts.map +1 -0
- package/dist/discover-43C3BE7I.js +15 -0
- package/dist/{github-pr-YMWIPCCZ.js.map → discover-43C3BE7I.js.map} +0 -0
- package/dist/{doctor-command-QIYBI7ZF.js → doctor-command-CLKEEOAX.js} +14 -10
- package/dist/{doctor-command-QIYBI7ZF.js.map → doctor-command-CLKEEOAX.js.map} +1 -1
- package/dist/drivers/adapter-registry.d.ts +96 -0
- package/dist/drivers/adapter-registry.d.ts.map +1 -0
- package/dist/drivers/appium/android.d.ts +22 -0
- package/dist/drivers/appium/android.d.ts.map +1 -0
- package/dist/drivers/appium/client.d.ts +26 -0
- package/dist/drivers/appium/client.d.ts.map +1 -0
- package/dist/drivers/appium/ios.d.ts +28 -0
- package/dist/drivers/appium/ios.d.ts.map +1 -0
- package/dist/drivers/appium/window-size.d.ts +8 -0
- package/dist/drivers/appium/window-size.d.ts.map +1 -0
- package/dist/drivers/browser-extensions.d.ts +62 -0
- package/dist/drivers/browser-extensions.d.ts.map +1 -0
- package/dist/drivers/cdp-browser.d.ts +102 -0
- package/dist/drivers/cdp-browser.d.ts.map +1 -0
- package/dist/drivers/common/xml-tokenizer.d.ts +26 -0
- package/dist/drivers/common/xml-tokenizer.d.ts.map +1 -0
- package/dist/drivers/device-controls.d.ts +36 -0
- package/dist/drivers/device-controls.d.ts.map +1 -0
- package/dist/drivers/electrobun.d.ts +47 -0
- package/dist/drivers/electrobun.d.ts.map +1 -0
- package/dist/drivers/electron.d.ts +36 -0
- package/dist/drivers/electron.d.ts.map +1 -0
- package/dist/drivers/index.d.ts +2 -0
- package/dist/drivers/index.d.ts.map +1 -0
- package/dist/drivers/launch-options.d.ts +10 -0
- package/dist/drivers/launch-options.d.ts.map +1 -0
- package/dist/drivers/network-profiles.d.ts +9 -0
- package/dist/drivers/network-profiles.d.ts.map +1 -0
- package/dist/drivers/playwright-parser.d.ts +16 -0
- package/dist/drivers/playwright-parser.d.ts.map +1 -0
- package/dist/drivers/playwright.d.ts +69 -0
- package/dist/drivers/playwright.d.ts.map +1 -0
- package/dist/drivers/raw-driver.d.ts +399 -0
- package/dist/drivers/raw-driver.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/client.d.ts +77 -0
- package/dist/drivers/uiautomator2/client.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/driver.d.ts +20 -0
- package/dist/drivers/uiautomator2/driver.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/index.d.ts +5 -0
- package/dist/drivers/uiautomator2/index.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/installer.d.ts +20 -0
- package/dist/drivers/uiautomator2/installer.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/pagesource.d.ts +12 -0
- package/dist/drivers/uiautomator2/pagesource.d.ts.map +1 -0
- package/dist/drivers/wda/client.d.ts +116 -0
- package/dist/drivers/wda/client.d.ts.map +1 -0
- package/dist/drivers/wda/driver.d.ts +26 -0
- package/dist/drivers/wda/driver.d.ts.map +1 -0
- package/dist/drivers/wda/index.d.ts +5 -0
- package/dist/drivers/wda/index.d.ts.map +1 -0
- package/dist/drivers/wda/installer.d.ts +51 -0
- package/dist/drivers/wda/installer.d.ts.map +1 -0
- package/dist/drivers/wda/pagesource.d.ts +12 -0
- package/dist/drivers/wda/pagesource.d.ts.map +1 -0
- package/dist/errors.d.ts +82 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/{filters-MQG2RMPX.js → filters-5DCGGJRN.js} +3 -3
- package/dist/{installer-5UHTYQTB.js.map → filters-5DCGGJRN.js.map} +0 -0
- package/dist/gherkin/compiler.d.ts +3 -0
- package/dist/gherkin/compiler.d.ts.map +1 -0
- package/dist/gherkin/index.d.ts +7 -0
- package/dist/gherkin/index.d.ts.map +1 -0
- package/dist/gherkin/matcher.d.ts +9 -0
- package/dist/gherkin/matcher.d.ts.map +1 -0
- package/dist/gherkin/registry.d.ts +28 -0
- package/dist/gherkin/registry.d.ts.map +1 -0
- package/dist/gherkin/steps.d.ts +13 -32
- package/dist/gherkin/steps.d.ts.map +1 -0
- package/dist/gherkin/steps.js +5 -2
- package/dist/gherkin/steps.js.map +1 -1
- package/dist/gherkin/world.d.ts +15 -0
- package/dist/gherkin/world.d.ts.map +1 -0
- package/dist/{github-pr-YMWIPCCZ.js → github-pr-RYO6IAKD.js} +3 -3
- package/dist/{ios-Y4TO5MBR.js.map → github-pr-RYO6IAKD.js.map} +0 -0
- package/dist/{html-FLMWPFQD.js → html-KJ2QAGF4.js} +6 -3
- package/dist/{html-FLMWPFQD.js.map → html-KJ2QAGF4.js.map} +1 -1
- package/dist/index.d.ts +54 -1912
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +534 -291
- package/dist/index.js.map +1 -1
- package/dist/{init-command-Z3QREABL.js → init-command-V5VGN3IS.js} +5 -2
- package/dist/{init-command-Z3QREABL.js.map → init-command-V5VGN3IS.js.map} +1 -1
- package/dist/{init-flow-command-4EKRVTNT.js → init-flow-command-INYUCC6N.js} +6 -3
- package/dist/{init-flow-command-4EKRVTNT.js.map → init-flow-command-INYUCC6N.js.map} +1 -1
- package/dist/{installer-5UHTYQTB.js → installer-DMTY47SI.js} +5 -5
- package/dist/{machine-6H25TRTU.js.map → installer-DMTY47SI.js.map} +0 -0
- package/dist/{ios-Y4TO5MBR.js → ios-SZ4RBI7Q.js} +4 -4
- package/dist/{provider-YIPU5K42.js.map → ios-SZ4RBI7Q.js.map} +0 -0
- package/dist/json-57Z2YSES.js +39 -0
- package/dist/json-57Z2YSES.js.map +1 -0
- package/dist/{junit-CGB3LKHD.js → junit-MHD5AXBU.js} +26 -6
- package/dist/junit-MHD5AXBU.js.map +1 -0
- package/dist/local-RH5EFGYF.js +31 -0
- package/dist/{runner-JID2YWRE.js.map → local-RH5EFGYF.js.map} +0 -0
- package/dist/{machine-6H25TRTU.js → machine-NOOFRT45.js} +3 -3
- package/dist/{server-UIRGHUYM.js.map → machine-NOOFRT45.js.map} +0 -0
- package/dist/machine.d.ts +20 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +73 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/{provider-YIPU5K42.js → provider-CBAXZ2VA.js} +3 -3
- package/dist/{session-BE6U34DA.js.map → provider-CBAXZ2VA.js.map} +0 -0
- package/dist/{redact-U72BUBBR.js → redact-OG4M3IEU.js} +5 -2
- package/dist/{redact-U72BUBBR.js.map → redact-OG4M3IEU.js.map} +1 -1
- package/dist/report/allure.d.ts +3 -0
- package/dist/report/allure.d.ts.map +1 -0
- package/dist/report/classify-error.d.ts +7 -0
- package/dist/report/classify-error.d.ts.map +1 -0
- package/dist/report/code-frame.d.ts +16 -0
- package/dist/report/code-frame.d.ts.map +1 -0
- package/dist/report/console.d.ts +7 -0
- package/dist/report/console.d.ts.map +1 -0
- package/dist/report/failure-bundle.d.ts +66 -0
- package/dist/report/failure-bundle.d.ts.map +1 -0
- package/dist/report/failure-diagnostics.d.ts +11 -0
- package/dist/report/failure-diagnostics.d.ts.map +1 -0
- package/dist/report/github-pr.d.ts +20 -0
- package/dist/report/github-pr.d.ts.map +1 -0
- package/dist/report/html.d.ts +3 -0
- package/dist/report/html.d.ts.map +1 -0
- package/dist/report/index.d.ts +8 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/json.d.ts +3 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/junit.d.ts +3 -0
- package/dist/report/junit.d.ts.map +1 -0
- package/dist/report/redact.d.ts +29 -0
- package/dist/report/redact.d.ts.map +1 -0
- package/dist/report/selector-guardrails.d.ts +12 -0
- package/dist/report/selector-guardrails.d.ts.map +1 -0
- package/dist/report/types.d.ts +164 -0
- package/dist/report/types.d.ts.map +1 -0
- package/dist/{runner-JID2YWRE.js → runner-ABGUVOJG.js} +5 -3
- package/dist/{validator-YWNHCU2S.js.map → runner-ABGUVOJG.js.map} +0 -0
- package/dist/runtime/appium-server.d.ts +34 -0
- package/dist/runtime/appium-server.d.ts.map +1 -0
- package/dist/runtime/appium.d.ts +5 -0
- package/dist/runtime/appium.d.ts.map +1 -0
- package/dist/runtime/capabilities.d.ts +19 -0
- package/dist/runtime/capabilities.d.ts.map +1 -0
- package/dist/runtime/daemon-manager.d.ts +83 -0
- package/dist/runtime/daemon-manager.d.ts.map +1 -0
- package/dist/runtime/local.d.ts +38 -0
- package/dist/runtime/local.d.ts.map +1 -0
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/web-server.d.ts +57 -0
- package/dist/runtime/web-server.d.ts.map +1 -0
- package/dist/schemas/config.d.ts +780 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/device.d.ts +12 -0
- package/dist/schemas/device.d.ts.map +1 -0
- package/dist/schemas/element.d.ts +66 -0
- package/dist/schemas/element.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/selector.d.ts +193 -0
- package/dist/schemas/selector.d.ts.map +1 -0
- package/dist/screenshot-compare-V4JQG73R.js +2410 -0
- package/dist/screenshot-compare-V4JQG73R.js.map +1 -0
- package/dist/server-D45AO34E.js +6731 -0
- package/dist/server-D45AO34E.js.map +1 -0
- package/dist/{server-UIRGHUYM.js → server-KLZBJOMQ.js} +3 -3
- package/dist/server-KLZBJOMQ.js.map +1 -0
- package/dist/session-N6DEYVPM.js +21 -0
- package/dist/session-N6DEYVPM.js.map +1 -0
- package/dist/smart/auto-wait.d.ts +38 -0
- package/dist/smart/auto-wait.d.ts.map +1 -0
- package/dist/smart/channel-resolver.d.ts +90 -0
- package/dist/smart/channel-resolver.d.ts.map +1 -0
- package/dist/smart/coordinator.d.ts +162 -0
- package/dist/smart/coordinator.d.ts.map +1 -0
- package/dist/smart/diagnostics.d.ts +15 -0
- package/dist/smart/diagnostics.d.ts.map +1 -0
- package/dist/smart/element-matcher.d.ts +24 -0
- package/dist/smart/element-matcher.d.ts.map +1 -0
- package/dist/smart/hierarchy-cache.d.ts +16 -0
- package/dist/smart/hierarchy-cache.d.ts.map +1 -0
- package/dist/smart/index.d.ts +4 -0
- package/dist/smart/index.d.ts.map +1 -0
- package/dist/studio/api.d.ts +317 -0
- package/dist/studio/api.d.ts.map +1 -0
- package/dist/studio/context.d.ts +7 -0
- package/dist/studio/context.d.ts.map +1 -0
- package/dist/studio/core/element-tree.d.ts +15 -0
- package/dist/studio/core/element-tree.d.ts.map +1 -0
- package/dist/studio/effect-handler.d.ts +3 -0
- package/dist/studio/effect-handler.d.ts.map +1 -0
- package/dist/studio/procedures.d.ts +4 -0
- package/dist/studio/procedures.d.ts.map +1 -0
- package/dist/studio/recording-session.d.ts +31 -0
- package/dist/studio/recording-session.d.ts.map +1 -0
- package/dist/studio/routers/devices.d.ts +11 -0
- package/dist/studio/routers/devices.d.ts.map +1 -0
- package/dist/studio/routers/inspector.d.ts +104 -0
- package/dist/studio/routers/inspector.d.ts.map +1 -0
- package/dist/studio/routers/recording.d.ts +130 -0
- package/dist/studio/routers/recording.d.ts.map +1 -0
- package/dist/studio/routers/tests.d.ts +93 -0
- package/dist/studio/routers/tests.d.ts.map +1 -0
- package/dist/studio/server.d.ts +12 -0
- package/dist/studio/server.d.ts.map +1 -0
- package/dist/{studio-command-TXQTIWRS.js → studio-command-TNSJGTFA.js} +6 -3
- package/dist/{studio-command-TXQTIWRS.js.map → studio-command-TNSJGTFA.js.map} +1 -1
- package/dist/{test-command-CCSQPKWU.js → test-command-EXPYFDTF.js} +452 -85
- package/dist/test-command-EXPYFDTF.js.map +1 -0
- package/dist/{validator-YWNHCU2S.js → validator-AJNOFBQM.js} +4 -4
- package/dist/validator-AJNOFBQM.js.map +1 -0
- package/native/darwin-arm64/libspana_native.dylib +0 -0
- package/native/darwin-x64/libspana_native.dylib +0 -0
- package/native/linux-arm64/libspana_native.so +0 -0
- package/native/linux-x64/libspana_native.so +0 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +15 -18
- package/studio-dist/assets/index-CHLA4F7b.css +2 -0
- package/studio-dist/assets/index-DXGUfzm3.js +23 -0
- package/studio-dist/index.html +2 -2
- package/dist/accessibility-audit-YZOPUY3D.js.map +0 -1
- package/dist/app-xIYd2jde.d.ts +0 -1309
- package/dist/chunk-66D3C7NB.js.map +0 -1
- package/dist/chunk-7QFJ7MDH.js +0 -249
- package/dist/chunk-7QFJ7MDH.js.map +0 -1
- package/dist/chunk-B35G77DN.js.map +0 -1
- package/dist/chunk-B473XZOM.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DP7MGXHN.js.map +0 -1
- package/dist/chunk-X2TJP7LB.js.map +0 -1
- package/dist/chunk-Y6KMJJ2T.js.map +0 -1
- package/dist/chunk-Z6K4QQAR.js.map +0 -1
- package/dist/config-loader-WLPQ5WVH.js +0 -9
- package/dist/console-DIYEJSSP.js.map +0 -1
- package/dist/discover-RLSKEBAX.js +0 -15
- package/dist/flow-CI5parw2.d.ts +0 -90
- package/dist/json-JMRPUVY2.js +0 -20
- package/dist/json-JMRPUVY2.js.map +0 -1
- package/dist/junit-CGB3LKHD.js.map +0 -1
- package/dist/screenshot-compare-POTXVUTL.js +0 -136
- package/dist/screenshot-compare-POTXVUTL.js.map +0 -1
- package/dist/server-6KQSTQIG.js +0 -852
- package/dist/server-6KQSTQIG.js.map +0 -1
- package/dist/session-BE6U34DA.js +0 -18
- package/dist/test-command-CCSQPKWU.js.map +0 -1
- package/studio-dist/assets/index-CBFsOh-9.js +0 -193
- package/studio-dist/assets/index-DH_18EyL.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_MAX_WORKERS_PER_PROCESS,
|
|
3
|
-
UPLOAD_ATTACH_TIMEOUT_MS,
|
|
4
3
|
buildPlaybackTraceFromSteps,
|
|
4
|
+
buildRichFlowTrace,
|
|
5
|
+
captureAndroidLogcat,
|
|
6
|
+
captureIosSimulatorCrashLogs,
|
|
7
|
+
checkServerReady,
|
|
5
8
|
createRemoteFlowClaimer,
|
|
6
9
|
exportFramesToMp4,
|
|
7
10
|
extractCodeFrame,
|
|
11
|
+
filterFlowsForProject,
|
|
8
12
|
formatCodeFrame,
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
isHttpUrlReady,
|
|
14
|
+
isTcpPortOpen,
|
|
11
15
|
orderFlowsLongestFirst,
|
|
12
16
|
partitionFlowsAcrossProcesses,
|
|
13
17
|
planProcessPool,
|
|
14
|
-
|
|
18
|
+
renderTraceViewerHtml,
|
|
19
|
+
resolveProjectExecutionPlan,
|
|
15
20
|
runMultiProcessPool,
|
|
16
|
-
speculativelyPrelaunchWebBrowser,
|
|
17
21
|
startAndroidVideoRecorder,
|
|
18
22
|
startCdpScreencastRecorder,
|
|
19
23
|
startIosSimulatorVideoRecorder,
|
|
20
24
|
startSharedFlowQueueServer,
|
|
25
|
+
startWebServer,
|
|
26
|
+
startWebServers,
|
|
27
|
+
step,
|
|
28
|
+
suite,
|
|
29
|
+
withActiveStepRecorder,
|
|
30
|
+
writeRichTraceBundle,
|
|
21
31
|
writeWorkerProcessReport
|
|
22
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-OQRGR542.js";
|
|
23
33
|
import {
|
|
34
|
+
NetworkEventBuffer,
|
|
24
35
|
SPANA_MCP_TOOLS,
|
|
25
36
|
SpanaMcpServer,
|
|
37
|
+
buildComponentTreeScript,
|
|
26
38
|
buildFlowFileFromLines,
|
|
39
|
+
buildPerformanceProfileScript,
|
|
27
40
|
formatSelectorCode
|
|
28
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-F2YUBD4E.js";
|
|
29
42
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
clearReplayCache,
|
|
44
|
+
formatCacheInspectTable,
|
|
45
|
+
inspectReplayCache
|
|
46
|
+
} from "./chunk-TFEXYI6N.js";
|
|
47
|
+
import "./chunk-7WHQIQPM.js";
|
|
33
48
|
import {
|
|
34
49
|
createGitHubPrReporter,
|
|
35
50
|
formatGitHubPrMarkdown
|
|
36
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZIETAMAD.js";
|
|
37
52
|
import {
|
|
38
53
|
applyTestFilters,
|
|
39
54
|
buildFilterCandidates,
|
|
@@ -45,46 +60,59 @@ import {
|
|
|
45
60
|
formatFilterSummary,
|
|
46
61
|
pathRuleFilter,
|
|
47
62
|
probabilityFromTopLogprobs
|
|
48
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-FSPMFRJO.js";
|
|
64
|
+
import {
|
|
65
|
+
defineConfig
|
|
66
|
+
} from "./chunk-F3AFZ6UX.js";
|
|
67
|
+
import "./chunk-U56N5JCJ.js";
|
|
68
|
+
import {
|
|
69
|
+
UPLOAD_ATTACH_TIMEOUT_MS,
|
|
70
|
+
applyExtensionChromeArgs,
|
|
71
|
+
defineDomTransport,
|
|
72
|
+
defineDriverAdapter,
|
|
73
|
+
getLoadedExtensions,
|
|
74
|
+
launchDirectCdpBrowser,
|
|
75
|
+
listDomTransports,
|
|
76
|
+
listDriverAdapters,
|
|
77
|
+
makeLightweightCdpDriver,
|
|
78
|
+
registerDomTransport,
|
|
79
|
+
registerDriverAdapter,
|
|
80
|
+
resolveBrowserExtensions,
|
|
81
|
+
resolveDomTransport,
|
|
82
|
+
resolveDriverAdapter,
|
|
83
|
+
resolveWebEngine,
|
|
84
|
+
runOAuthPopupFlow,
|
|
85
|
+
speculativelyPrelaunchWebBrowser,
|
|
86
|
+
unregisterDomTransport,
|
|
87
|
+
unregisterDriverAdapter
|
|
88
|
+
} from "./chunk-BWEQ4XT2.js";
|
|
89
|
+
import {
|
|
90
|
+
ReplayCacheStore,
|
|
91
|
+
ReplaySession,
|
|
92
|
+
buildReplayCacheKey,
|
|
93
|
+
createFlowAgent,
|
|
94
|
+
createOpenAICompatibleAgentProvider,
|
|
95
|
+
formatActionsAsFlowCode,
|
|
96
|
+
isSecretValue,
|
|
97
|
+
replayRecordedAction,
|
|
98
|
+
runExploreSession,
|
|
99
|
+
secret,
|
|
100
|
+
unique
|
|
101
|
+
} from "./chunk-HIGFQRWM.js";
|
|
49
102
|
import {
|
|
50
|
-
byCss,
|
|
51
|
-
byRole,
|
|
52
103
|
connectPlaywrightOverCDP,
|
|
53
104
|
connectPlaywrightOverWS,
|
|
54
|
-
domRectToScreenBounds,
|
|
55
105
|
ensureWarmBrowserDaemon,
|
|
56
|
-
filterSelector,
|
|
57
|
-
findWebViewFrame,
|
|
58
|
-
first,
|
|
59
|
-
inFrame,
|
|
60
|
-
invalidateWebViewFrameCache,
|
|
61
|
-
isComposableDomSelector,
|
|
62
|
-
isOffscreenInViewport,
|
|
63
|
-
isSystemUISelector,
|
|
64
|
-
isTestIDSelector,
|
|
65
|
-
last,
|
|
66
106
|
launchPlaywrightBrowser,
|
|
67
|
-
makeElectronDriver
|
|
68
|
-
|
|
69
|
-
or,
|
|
70
|
-
resolveElementAcrossChannels,
|
|
71
|
-
systemUI,
|
|
72
|
-
within
|
|
73
|
-
} from "./chunk-B35G77DN.js";
|
|
107
|
+
makeElectronDriver
|
|
108
|
+
} from "./chunk-PPAPRKQU.js";
|
|
74
109
|
import {
|
|
75
110
|
AndroidWebViewCdpChannel,
|
|
76
111
|
AppleWebInspectorClient,
|
|
77
112
|
CdpDomChannel,
|
|
78
|
-
SPANA_INJECTED_RUNTIME_SCRIPT,
|
|
79
113
|
SpanaBridgeChannel,
|
|
80
114
|
TARGET_CHANNEL_MATRIX,
|
|
81
115
|
WebKitInspectorChannel,
|
|
82
|
-
buildDomActionabilityDiagScript,
|
|
83
|
-
buildDomFillScript,
|
|
84
|
-
buildDomWaitForHiddenScript,
|
|
85
|
-
buildDomWaitForMatchScript,
|
|
86
|
-
buildDomWaitForSelectorScript,
|
|
87
|
-
buildInjectedCallScript,
|
|
88
116
|
createAndroidWebViewCdpChannel,
|
|
89
117
|
createCdpDomChannel,
|
|
90
118
|
createCompositeDomChannel,
|
|
@@ -100,12 +128,13 @@ import {
|
|
|
100
128
|
resolveElectrobunEngine,
|
|
101
129
|
resolveElectrobunLaunchPlan,
|
|
102
130
|
resolveTargetDescriptor
|
|
103
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-GDDCZ2PL.js";
|
|
132
|
+
import "./chunk-XVL4FHXA.js";
|
|
104
133
|
import {
|
|
105
134
|
cloneIOSSimulator,
|
|
106
135
|
deleteIOSSimulator
|
|
107
|
-
} from "./chunk-
|
|
108
|
-
import "./chunk-
|
|
136
|
+
} from "./chunk-2MA5G2VH.js";
|
|
137
|
+
import "./chunk-XD6A3VXB.js";
|
|
109
138
|
import {
|
|
110
139
|
DEFAULT_WARM_DAEMON_IDLE_TTL_MS,
|
|
111
140
|
defaultDaemonStateDir,
|
|
@@ -116,23 +145,68 @@ import {
|
|
|
116
145
|
stopWarmDaemon,
|
|
117
146
|
sweepOrphanedSpanaBrowsers,
|
|
118
147
|
updateWarmDaemonSession
|
|
119
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-FHCOPLYB.js";
|
|
120
149
|
import {
|
|
121
150
|
allocateFreePort,
|
|
122
151
|
assertPortAvailable,
|
|
123
152
|
isPortAvailable
|
|
124
|
-
} from "./chunk-
|
|
125
|
-
import "./chunk-
|
|
153
|
+
} from "./chunk-7Q7TSUNL.js";
|
|
154
|
+
import "./chunk-PRQTAIYA.js";
|
|
126
155
|
import {
|
|
127
156
|
comparePngNative,
|
|
128
157
|
getNativeAcceleratorPath,
|
|
129
158
|
isNativeAcceleratorActive,
|
|
130
159
|
tokenizeXmlNative
|
|
131
|
-
} from "./chunk-
|
|
132
|
-
import
|
|
133
|
-
|
|
160
|
+
} from "./chunk-VOYJQDSI.js";
|
|
161
|
+
import {
|
|
162
|
+
and,
|
|
163
|
+
assertDataSnapshot,
|
|
164
|
+
byAltText,
|
|
165
|
+
byCss,
|
|
166
|
+
byLabel,
|
|
167
|
+
byPlaceholder,
|
|
168
|
+
byRole,
|
|
169
|
+
byTitle,
|
|
170
|
+
domRectToScreenBounds,
|
|
171
|
+
filterSelector,
|
|
172
|
+
findWebViewFrame,
|
|
173
|
+
first,
|
|
174
|
+
inFrame,
|
|
175
|
+
invalidateWebViewFrameCache,
|
|
176
|
+
isComposableDomSelector,
|
|
177
|
+
isOffscreenInViewport,
|
|
178
|
+
isSystemUISelector,
|
|
179
|
+
isTestIDSelector,
|
|
180
|
+
last,
|
|
181
|
+
matchDataSnapshot,
|
|
182
|
+
nth,
|
|
183
|
+
or,
|
|
184
|
+
resolveElementAcrossChannels,
|
|
185
|
+
systemUI,
|
|
186
|
+
within
|
|
187
|
+
} from "./chunk-LQQNE2OE.js";
|
|
188
|
+
import "./chunk-XQRXQBDQ.js";
|
|
189
|
+
import {
|
|
190
|
+
SPANA_INJECTED_RUNTIME_SCRIPT,
|
|
191
|
+
buildDomActionabilityDiagScript,
|
|
192
|
+
buildDomFillScript,
|
|
193
|
+
buildDomQueryScript,
|
|
194
|
+
buildDomScrollIntoViewScript,
|
|
195
|
+
buildDomTapScript,
|
|
196
|
+
buildDomWaitForHiddenScript,
|
|
197
|
+
buildDomWaitForMatchScript,
|
|
198
|
+
buildDomWaitForSelectorScript,
|
|
199
|
+
buildInjectedCallScript
|
|
200
|
+
} from "./chunk-GAWJL6Q3.js";
|
|
201
|
+
import {
|
|
202
|
+
init_esm_shims
|
|
203
|
+
} from "./chunk-FTXUQMGH.js";
|
|
204
|
+
|
|
205
|
+
// src/index.ts
|
|
206
|
+
init_esm_shims();
|
|
134
207
|
|
|
135
208
|
// src/api/flow.ts
|
|
209
|
+
init_esm_shims();
|
|
136
210
|
function flow(name, configOrFn, maybeFn) {
|
|
137
211
|
if (typeof configOrFn === "function") {
|
|
138
212
|
return { name, fn: configOrFn, config: {} };
|
|
@@ -151,9 +225,11 @@ function modifyFlow(modifier) {
|
|
|
151
225
|
flow2.skip = modifyFlow("skip");
|
|
152
226
|
flow2.fixme = modifyFlow("fixme");
|
|
153
227
|
flow2.only = modifyFlow("only");
|
|
228
|
+
flow2.fail = modifyFlow("fail");
|
|
154
229
|
})(flow || (flow = {}));
|
|
155
230
|
|
|
156
231
|
// src/schemas/element.ts
|
|
232
|
+
init_esm_shims();
|
|
157
233
|
import { Schema } from "effect";
|
|
158
234
|
var Bounds = Schema.Struct({
|
|
159
235
|
x: Schema.Number,
|
|
@@ -175,10 +251,12 @@ var Element = Schema.Struct({
|
|
|
175
251
|
visible: Schema.optional(Schema.Boolean),
|
|
176
252
|
clickable: Schema.optional(Schema.Boolean),
|
|
177
253
|
focused: Schema.optional(Schema.Boolean),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
254
|
+
checked: Schema.optional(Schema.Boolean),
|
|
255
|
+
editable: Schema.optional(Schema.Boolean),
|
|
256
|
+
empty: Schema.optional(Schema.Boolean),
|
|
257
|
+
className: Schema.optional(Schema.String),
|
|
258
|
+
attributes: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
259
|
+
children: Schema.optional(Schema.Array(Schema.suspend(() => Element)))
|
|
182
260
|
});
|
|
183
261
|
var ViewHierarchy = Schema.Struct({
|
|
184
262
|
root: Element,
|
|
@@ -186,25 +264,30 @@ var ViewHierarchy = Schema.Struct({
|
|
|
186
264
|
});
|
|
187
265
|
|
|
188
266
|
// src/schemas/device.ts
|
|
267
|
+
init_esm_shims();
|
|
189
268
|
import { Schema as Schema2 } from "effect";
|
|
190
269
|
var DeviceInfo = Schema2.Struct({
|
|
191
|
-
platform: Schema2.
|
|
270
|
+
platform: Schema2.Literals(["android", "ios", "web", "electron", "electrobun"]),
|
|
192
271
|
deviceId: Schema2.String,
|
|
193
272
|
name: Schema2.String,
|
|
194
273
|
isEmulator: Schema2.Boolean,
|
|
195
274
|
screenWidth: Schema2.Number,
|
|
196
275
|
screenHeight: Schema2.Number,
|
|
197
|
-
driverType: Schema2.
|
|
276
|
+
driverType: Schema2.Literals([
|
|
198
277
|
"playwright",
|
|
199
278
|
"uiautomator2",
|
|
200
279
|
"wda",
|
|
201
280
|
"appium",
|
|
202
281
|
"electron",
|
|
203
282
|
"electrobun"
|
|
204
|
-
)
|
|
283
|
+
])
|
|
205
284
|
});
|
|
206
285
|
|
|
286
|
+
// src/report/types.ts
|
|
287
|
+
init_esm_shims();
|
|
288
|
+
|
|
207
289
|
// src/api/fixtures.ts
|
|
290
|
+
init_esm_shims();
|
|
208
291
|
function defineSetup(name, config) {
|
|
209
292
|
return { name, ...config };
|
|
210
293
|
}
|
|
@@ -609,256 +692,31 @@ var PersonaAuthCache = class {
|
|
|
609
692
|
}
|
|
610
693
|
};
|
|
611
694
|
|
|
612
|
-
// src/core/replay-cache.ts
|
|
613
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
614
|
-
import { dirname, join } from "path";
|
|
615
|
-
import { createHash } from "crypto";
|
|
616
|
-
function buildReplayCacheKey(flowName, platform, goal) {
|
|
617
|
-
const hash = createHash("sha256").update(`${flowName}\0${platform}\0${goal.trim()}`).digest("hex").slice(0, 16);
|
|
618
|
-
const slug = flowName.toLowerCase().replaceAll(/[^a-z0-9]+/g, "-").replaceAll(/^-|-$/g, "").slice(0, 40);
|
|
619
|
-
return `${slug || "flow"}-${platform}-${hash}`;
|
|
620
|
-
}
|
|
621
|
-
var ReplayCacheStore = class {
|
|
622
|
-
cacheDir;
|
|
623
|
-
constructor(cacheDir = ".spana/cache") {
|
|
624
|
-
this.cacheDir = cacheDir;
|
|
625
|
-
}
|
|
626
|
-
filePath(key) {
|
|
627
|
-
return join(this.cacheDir, `${key}.json`);
|
|
628
|
-
}
|
|
629
|
-
get(key) {
|
|
630
|
-
const p = this.filePath(key);
|
|
631
|
-
if (!existsSync(p)) return null;
|
|
632
|
-
try {
|
|
633
|
-
const raw = readFileSync(p, "utf-8");
|
|
634
|
-
const parsed = JSON.parse(raw);
|
|
635
|
-
if (parsed.schemaVersion !== 1 || !Array.isArray(parsed.actions)) return null;
|
|
636
|
-
return parsed;
|
|
637
|
-
} catch {
|
|
638
|
-
return null;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
set(entry) {
|
|
642
|
-
const p = this.filePath(entry.key);
|
|
643
|
-
mkdirSync(dirname(p), { recursive: true });
|
|
644
|
-
writeFileSync(p, JSON.stringify(entry, null, 2), "utf-8");
|
|
645
|
-
}
|
|
646
|
-
delete(key) {
|
|
647
|
-
const p = this.filePath(key);
|
|
648
|
-
if (!existsSync(p)) return false;
|
|
649
|
-
rmSync(p, { force: true });
|
|
650
|
-
return true;
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
async function replayRecordedAction(app, action) {
|
|
654
|
-
switch (action.kind) {
|
|
655
|
-
case "tap":
|
|
656
|
-
await app.tap(action.selector);
|
|
657
|
-
break;
|
|
658
|
-
case "doubleTap":
|
|
659
|
-
await app.doubleTap(action.selector);
|
|
660
|
-
break;
|
|
661
|
-
case "longPress":
|
|
662
|
-
await app.longPress(action.selector);
|
|
663
|
-
break;
|
|
664
|
-
case "inputText":
|
|
665
|
-
await app.inputText(action.text);
|
|
666
|
-
break;
|
|
667
|
-
case "pressKey":
|
|
668
|
-
await app.pressKey(action.key);
|
|
669
|
-
break;
|
|
670
|
-
case "scroll":
|
|
671
|
-
await app.scroll(action.direction);
|
|
672
|
-
break;
|
|
673
|
-
case "scrollUntilVisible":
|
|
674
|
-
await app.scrollUntilVisible(action.selector);
|
|
675
|
-
break;
|
|
676
|
-
case "openLink":
|
|
677
|
-
await app.openLink(action.url);
|
|
678
|
-
break;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
var ReplaySession = class {
|
|
682
|
-
flowName;
|
|
683
|
-
platform;
|
|
684
|
-
app;
|
|
685
|
-
store;
|
|
686
|
-
mode;
|
|
687
|
-
executor;
|
|
688
|
-
pendingWrites = [];
|
|
689
|
-
replayedKeys = [];
|
|
690
|
-
outcomes = [];
|
|
691
|
-
constructor(options) {
|
|
692
|
-
this.flowName = options.flowName;
|
|
693
|
-
this.platform = options.platform;
|
|
694
|
-
this.app = options.app;
|
|
695
|
-
this.store = options.store ?? new ReplayCacheStore();
|
|
696
|
-
this.mode = options.mode ?? "read-write";
|
|
697
|
-
this.executor = options.executor;
|
|
698
|
-
}
|
|
699
|
-
/** Execute a natural-language goal using replay cache first, falling back to `executor`. */
|
|
700
|
-
async act(goal) {
|
|
701
|
-
const key = buildReplayCacheKey(this.flowName, this.platform, goal);
|
|
702
|
-
const cached = this.mode === "off" ? null : this.store.get(key);
|
|
703
|
-
if (cached && cached.actions.length > 0) {
|
|
704
|
-
try {
|
|
705
|
-
for (const action of cached.actions) {
|
|
706
|
-
await replayRecordedAction(this.app, action);
|
|
707
|
-
}
|
|
708
|
-
const outcome = {
|
|
709
|
-
goal,
|
|
710
|
-
key,
|
|
711
|
-
status: "replayed",
|
|
712
|
-
writeStatus: "kept",
|
|
713
|
-
actionCount: cached.actions.length
|
|
714
|
-
};
|
|
715
|
-
const idx = this.outcomes.push(outcome) - 1;
|
|
716
|
-
this.replayedKeys.push({ key, outcomeIndex: idx });
|
|
717
|
-
return outcome;
|
|
718
|
-
} catch (err) {
|
|
719
|
-
const errMsg = err instanceof Error ? err.message : String(err);
|
|
720
|
-
if (this.mode === "strict") {
|
|
721
|
-
throw new Error(
|
|
722
|
-
`Strict replay cache mismatch for "${goal}" (${key}): ${errMsg}. Re-run locally without --strict-cache to self-heal and update .spana/cache/.`,
|
|
723
|
-
{ cause: err }
|
|
724
|
-
);
|
|
725
|
-
}
|
|
726
|
-
return this.runLiveAndQueue(goal, key, true, errMsg);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
if (this.mode === "strict") {
|
|
730
|
-
throw new Error(
|
|
731
|
-
`Strict replay cache miss for "${goal}" (${key}). No verified recording found in ${this.store.cacheDir}.`
|
|
732
|
-
);
|
|
733
|
-
}
|
|
734
|
-
return this.runLiveAndQueue(goal, key, false);
|
|
735
|
-
}
|
|
736
|
-
async runLiveAndQueue(goal, key, wasExisting, handoffReason) {
|
|
737
|
-
if (!this.executor) {
|
|
738
|
-
throw new Error(
|
|
739
|
-
`No agent executor configured for goal "${goal}" and no cached replay exists.`
|
|
740
|
-
);
|
|
741
|
-
}
|
|
742
|
-
const result = await this.executor.act({
|
|
743
|
-
goal,
|
|
744
|
-
app: this.app,
|
|
745
|
-
handoffReason
|
|
746
|
-
});
|
|
747
|
-
const outcome = {
|
|
748
|
-
goal,
|
|
749
|
-
key,
|
|
750
|
-
status: wasExisting ? "handed-off" : this.mode === "off" ? "live" : "missed",
|
|
751
|
-
writeStatus: this.mode === "off" ? "skipped" : "unconfirmed",
|
|
752
|
-
actionCount: result.actions.length
|
|
753
|
-
};
|
|
754
|
-
const idx = this.outcomes.push(outcome) - 1;
|
|
755
|
-
if (this.mode === "read-write" && result.actions.length > 0) {
|
|
756
|
-
this.pendingWrites.push({
|
|
757
|
-
wasExisting,
|
|
758
|
-
outcomeIndex: idx,
|
|
759
|
-
entry: {
|
|
760
|
-
schemaVersion: 1,
|
|
761
|
-
key,
|
|
762
|
-
goal,
|
|
763
|
-
flowName: this.flowName,
|
|
764
|
-
platform: this.platform,
|
|
765
|
-
actions: result.actions,
|
|
766
|
-
recordedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
767
|
-
verifiedBy: ""
|
|
768
|
-
}
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
return outcome;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Call when a real post-action assertion (`expect(...).toBeVisible()`, `toHaveText()`, etc.)
|
|
775
|
-
* succeeds. Flushes all preceding pending recordings to disk in `read-write` mode.
|
|
776
|
-
*/
|
|
777
|
-
markVerified(verifierName) {
|
|
778
|
-
if (this.mode !== "read-write") return 0;
|
|
779
|
-
let saved = 0;
|
|
780
|
-
for (const pending of this.pendingWrites) {
|
|
781
|
-
pending.entry.verifiedBy = verifierName;
|
|
782
|
-
this.store.set(pending.entry);
|
|
783
|
-
this.outcomes[pending.outcomeIndex].writeStatus = "saved";
|
|
784
|
-
saved += 1;
|
|
785
|
-
}
|
|
786
|
-
this.pendingWrites = [];
|
|
787
|
-
return saved;
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Call when the flow attempt fails: evicts any replayed recordings involved in the
|
|
791
|
-
* failure (in `read-write` mode) and discards unconfirmed recordings so broken paths
|
|
792
|
-
* are never persisted.
|
|
793
|
-
*/
|
|
794
|
-
markFailed() {
|
|
795
|
-
let evicted = 0;
|
|
796
|
-
if (this.mode === "read-write") {
|
|
797
|
-
for (const replayed of this.replayedKeys) {
|
|
798
|
-
if (this.store.delete(replayed.key)) {
|
|
799
|
-
this.outcomes[replayed.outcomeIndex].writeStatus = "evicted";
|
|
800
|
-
evicted += 1;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
for (const pending of this.pendingWrites) {
|
|
804
|
-
if (pending.wasExisting && this.store.delete(pending.entry.key)) {
|
|
805
|
-
this.outcomes[pending.outcomeIndex].writeStatus = "evicted";
|
|
806
|
-
evicted += 1;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
this.pendingWrites = [];
|
|
811
|
-
this.replayedKeys = [];
|
|
812
|
-
return evicted;
|
|
813
|
-
}
|
|
814
|
-
getOutcomes() {
|
|
815
|
-
return [...this.outcomes];
|
|
816
|
-
}
|
|
817
|
-
getSummary() {
|
|
818
|
-
const summary = {
|
|
819
|
-
replayed: 0,
|
|
820
|
-
handedOff: 0,
|
|
821
|
-
missed: 0,
|
|
822
|
-
saved: 0,
|
|
823
|
-
evicted: 0,
|
|
824
|
-
unconfirmed: 0
|
|
825
|
-
};
|
|
826
|
-
for (const o of this.outcomes) {
|
|
827
|
-
if (o.status === "replayed") summary.replayed++;
|
|
828
|
-
else if (o.status === "handed-off") summary.handedOff++;
|
|
829
|
-
else if (o.status === "missed") summary.missed++;
|
|
830
|
-
if (o.writeStatus === "saved") summary.saved++;
|
|
831
|
-
else if (o.writeStatus === "evicted") summary.evicted++;
|
|
832
|
-
else if (o.writeStatus === "unconfirmed") summary.unconfirmed++;
|
|
833
|
-
}
|
|
834
|
-
return summary;
|
|
835
|
-
}
|
|
836
|
-
};
|
|
837
|
-
|
|
838
695
|
// src/core/network-cache.ts
|
|
839
|
-
|
|
840
|
-
import {
|
|
841
|
-
import {
|
|
696
|
+
init_esm_shims();
|
|
697
|
+
import { createHash } from "crypto";
|
|
698
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
699
|
+
import { join } from "path";
|
|
842
700
|
function buildNetworkCacheKey(method, url) {
|
|
843
701
|
const normalizedMethod = method.toUpperCase();
|
|
844
|
-
const hash =
|
|
702
|
+
const hash = createHash("sha256").update(`${normalizedMethod} ${url}`).digest("hex").slice(0, 16);
|
|
845
703
|
const slug = url.replace(/^https?:\/\//, "").replaceAll(/[^a-zA-Z0-9-_]/g, "_").replaceAll(/_+/g, "_").slice(0, 48);
|
|
846
704
|
return `${normalizedMethod.toLowerCase()}-${slug}-${hash}`;
|
|
847
705
|
}
|
|
848
706
|
var NetworkReplayCache = class {
|
|
849
707
|
cacheDir;
|
|
850
708
|
constructor(options = {}) {
|
|
851
|
-
this.cacheDir = options.cacheDir ??
|
|
709
|
+
this.cacheDir = options.cacheDir ?? join(process.cwd(), ".spana", "network-cache");
|
|
852
710
|
}
|
|
853
711
|
entryPath(key) {
|
|
854
|
-
return
|
|
712
|
+
return join(this.cacheDir, `${key}.json`);
|
|
855
713
|
}
|
|
856
714
|
get(method, url) {
|
|
857
715
|
const key = buildNetworkCacheKey(method, url);
|
|
858
716
|
const filePath = this.entryPath(key);
|
|
859
|
-
if (!
|
|
717
|
+
if (!existsSync(filePath)) return null;
|
|
860
718
|
try {
|
|
861
|
-
const parsed = JSON.parse(
|
|
719
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf8"));
|
|
862
720
|
if (parsed && parsed.version === 1 && typeof parsed.body === "string") {
|
|
863
721
|
return parsed;
|
|
864
722
|
}
|
|
@@ -867,7 +725,7 @@ var NetworkReplayCache = class {
|
|
|
867
725
|
return null;
|
|
868
726
|
}
|
|
869
727
|
set(entry) {
|
|
870
|
-
|
|
728
|
+
mkdirSync(this.cacheDir, { recursive: true });
|
|
871
729
|
const key = buildNetworkCacheKey(entry.method, entry.url);
|
|
872
730
|
const record = {
|
|
873
731
|
version: 1,
|
|
@@ -880,7 +738,7 @@ var NetworkReplayCache = class {
|
|
|
880
738
|
body: entry.body,
|
|
881
739
|
recordedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
882
740
|
};
|
|
883
|
-
|
|
741
|
+
writeFileSync(this.entryPath(key), JSON.stringify(record, null, 2), "utf8");
|
|
884
742
|
return record;
|
|
885
743
|
}
|
|
886
744
|
/**
|
|
@@ -937,12 +795,346 @@ async function attachNetworkReplayCache(app, options) {
|
|
|
937
795
|
totalRoutes: options.routes.length
|
|
938
796
|
};
|
|
939
797
|
}
|
|
798
|
+
|
|
799
|
+
// src/channels/bidi-client.ts
|
|
800
|
+
init_esm_shims();
|
|
801
|
+
function deserializeBidiRemoteValue(remote) {
|
|
802
|
+
if (!remote || typeof remote !== "object") return remote;
|
|
803
|
+
const obj = remote;
|
|
804
|
+
const type = obj["type"];
|
|
805
|
+
switch (type) {
|
|
806
|
+
case "undefined":
|
|
807
|
+
return void 0;
|
|
808
|
+
case "null":
|
|
809
|
+
return null;
|
|
810
|
+
case "string":
|
|
811
|
+
case "boolean":
|
|
812
|
+
case "number":
|
|
813
|
+
return obj["value"];
|
|
814
|
+
case "bigint":
|
|
815
|
+
return BigInt(String(obj["value"] ?? "0"));
|
|
816
|
+
case "array":
|
|
817
|
+
case "set":
|
|
818
|
+
return Array.isArray(obj["value"]) ? obj["value"].map(deserializeBidiRemoteValue) : [];
|
|
819
|
+
case "object": {
|
|
820
|
+
const out = {};
|
|
821
|
+
if (Array.isArray(obj["value"])) {
|
|
822
|
+
for (const pair of obj["value"]) {
|
|
823
|
+
if (!Array.isArray(pair) || pair.length < 2) continue;
|
|
824
|
+
const k = typeof pair[0] === "string" ? pair[0] : String(deserializeBidiRemoteValue(pair[0]));
|
|
825
|
+
out[k] = deserializeBidiRemoteValue(pair[1]);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return out;
|
|
829
|
+
}
|
|
830
|
+
default:
|
|
831
|
+
return "value" in obj ? obj["value"] : obj;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
var WebDriverBidiClient = class {
|
|
835
|
+
webSocketUrl;
|
|
836
|
+
commandTimeoutMs;
|
|
837
|
+
createWebSocket;
|
|
838
|
+
ws = null;
|
|
839
|
+
nextId = 1;
|
|
840
|
+
pending = /* @__PURE__ */ new Map();
|
|
841
|
+
eventListeners = /* @__PURE__ */ new Map();
|
|
842
|
+
activeContextId;
|
|
843
|
+
constructor(options) {
|
|
844
|
+
this.webSocketUrl = options.webSocketUrl;
|
|
845
|
+
this.activeContextId = options.contextId;
|
|
846
|
+
this.commandTimeoutMs = options.commandTimeoutMs ?? 15e3;
|
|
847
|
+
this.createWebSocket = options.createWebSocket ?? ((url) => new WebSocket(url));
|
|
848
|
+
}
|
|
849
|
+
get contextId() {
|
|
850
|
+
return this.activeContextId;
|
|
851
|
+
}
|
|
852
|
+
isConnected() {
|
|
853
|
+
return this.ws !== null && this.ws.readyState === 1;
|
|
854
|
+
}
|
|
855
|
+
async connect() {
|
|
856
|
+
if (this.isConnected()) return;
|
|
857
|
+
await new Promise((resolve, reject) => {
|
|
858
|
+
const ws = this.createWebSocket(this.webSocketUrl);
|
|
859
|
+
this.ws = ws;
|
|
860
|
+
let settled = false;
|
|
861
|
+
const done = (err) => {
|
|
862
|
+
if (settled) return;
|
|
863
|
+
settled = true;
|
|
864
|
+
if (err) reject(err);
|
|
865
|
+
else resolve();
|
|
866
|
+
};
|
|
867
|
+
ws.addEventListener("open", () => done());
|
|
868
|
+
ws.addEventListener(
|
|
869
|
+
"error",
|
|
870
|
+
(ev) => done(new Error(`BiDi WebSocket error: ${String(ev?.message ?? ev)}`))
|
|
871
|
+
);
|
|
872
|
+
ws.addEventListener("close", () => {
|
|
873
|
+
for (const [, p] of this.pending) {
|
|
874
|
+
clearTimeout(p.timer);
|
|
875
|
+
p.reject(new Error("WebDriver BiDi WebSocket closed"));
|
|
876
|
+
}
|
|
877
|
+
this.pending.clear();
|
|
878
|
+
this.ws = null;
|
|
879
|
+
});
|
|
880
|
+
ws.addEventListener("message", (ev) => {
|
|
881
|
+
this.handleMessage(typeof ev?.data === "string" ? ev.data : String(ev?.data ?? ""));
|
|
882
|
+
});
|
|
883
|
+
if (ws.readyState === 1) done();
|
|
884
|
+
});
|
|
885
|
+
if (!this.activeContextId) {
|
|
886
|
+
const tree = await this.send("browsingContext.getTree", {}).catch(() => null);
|
|
887
|
+
const contexts = tree?.["contexts"] ?? [];
|
|
888
|
+
if (contexts[0]?.context) {
|
|
889
|
+
this.activeContextId = contexts[0].context;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
async disconnect() {
|
|
894
|
+
const ws = this.ws;
|
|
895
|
+
this.ws = null;
|
|
896
|
+
for (const [, p] of this.pending) {
|
|
897
|
+
clearTimeout(p.timer);
|
|
898
|
+
p.reject(new Error("WebDriver BiDi client disconnected"));
|
|
899
|
+
}
|
|
900
|
+
this.pending.clear();
|
|
901
|
+
if (ws) {
|
|
902
|
+
try {
|
|
903
|
+
ws.close();
|
|
904
|
+
} catch {
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
async send(method, params = {}) {
|
|
909
|
+
if (!this.ws) {
|
|
910
|
+
throw new Error(`WebDriver BiDi client is not connected (attempted ${method})`);
|
|
911
|
+
}
|
|
912
|
+
const id = this.nextId++;
|
|
913
|
+
return new Promise((resolve, reject) => {
|
|
914
|
+
const timer = setTimeout(() => {
|
|
915
|
+
this.pending.delete(id);
|
|
916
|
+
reject(
|
|
917
|
+
new Error(
|
|
918
|
+
`WebDriver BiDi command timed out (${method}) after ${this.commandTimeoutMs}ms`
|
|
919
|
+
)
|
|
920
|
+
);
|
|
921
|
+
}, this.commandTimeoutMs);
|
|
922
|
+
this.pending.set(id, { resolve, reject, timer });
|
|
923
|
+
this.ws.send(JSON.stringify({ id, method, params }));
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
onEvent(method, listener) {
|
|
927
|
+
let set = this.eventListeners.get(method);
|
|
928
|
+
if (!set) {
|
|
929
|
+
set = /* @__PURE__ */ new Set();
|
|
930
|
+
this.eventListeners.set(method, set);
|
|
931
|
+
}
|
|
932
|
+
set.add(listener);
|
|
933
|
+
return () => {
|
|
934
|
+
set?.delete(listener);
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
async subscribe(events, contexts) {
|
|
938
|
+
await this.send("session.subscribe", {
|
|
939
|
+
events,
|
|
940
|
+
...contexts ? { contexts } : {}
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
async navigate(url, wait = "interactive") {
|
|
944
|
+
const context = this.requireContextId();
|
|
945
|
+
await this.send("browsingContext.navigate", { context, url, wait });
|
|
946
|
+
}
|
|
947
|
+
async reload(wait = "interactive") {
|
|
948
|
+
const context = this.requireContextId();
|
|
949
|
+
await this.send("browsingContext.reload", { context, wait });
|
|
950
|
+
}
|
|
951
|
+
async evaluate(expression, awaitPromise = true) {
|
|
952
|
+
const context = this.requireContextId();
|
|
953
|
+
const res = await this.send("script.evaluate", {
|
|
954
|
+
expression,
|
|
955
|
+
target: { context },
|
|
956
|
+
awaitPromise,
|
|
957
|
+
resultOwnership: "none"
|
|
958
|
+
});
|
|
959
|
+
if (res["type"] === "exception") {
|
|
960
|
+
const details = res["exceptionDetails"];
|
|
961
|
+
throw new Error(`BiDi script exception: ${details?.text ?? JSON.stringify(details)}`);
|
|
962
|
+
}
|
|
963
|
+
return deserializeBidiRemoteValue(res["result"]);
|
|
964
|
+
}
|
|
965
|
+
async captureScreenshot() {
|
|
966
|
+
const context = this.requireContextId();
|
|
967
|
+
const res = await this.send("browsingContext.captureScreenshot", { context });
|
|
968
|
+
return new Uint8Array(Buffer.from(String(res["data"] ?? ""), "base64"));
|
|
969
|
+
}
|
|
970
|
+
requireContextId() {
|
|
971
|
+
if (!this.activeContextId) {
|
|
972
|
+
throw new Error("No active WebDriver BiDi browsing context.");
|
|
973
|
+
}
|
|
974
|
+
return this.activeContextId;
|
|
975
|
+
}
|
|
976
|
+
handleMessage(raw) {
|
|
977
|
+
let msg;
|
|
978
|
+
try {
|
|
979
|
+
msg = JSON.parse(raw);
|
|
980
|
+
} catch {
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (typeof msg["id"] === "number") {
|
|
984
|
+
const pending = this.pending.get(msg["id"]);
|
|
985
|
+
if (!pending) return;
|
|
986
|
+
this.pending.delete(msg["id"]);
|
|
987
|
+
clearTimeout(pending.timer);
|
|
988
|
+
if (msg["type"] === "error") {
|
|
989
|
+
pending.reject(
|
|
990
|
+
new Error(
|
|
991
|
+
`WebDriver BiDi error (${String(msg["error"] ?? "unknown")}): ${String(msg["message"] ?? "")}`
|
|
992
|
+
)
|
|
993
|
+
);
|
|
994
|
+
} else {
|
|
995
|
+
pending.resolve(msg["result"] ?? {});
|
|
996
|
+
}
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
if (msg["type"] === "event" && typeof msg["method"] === "string") {
|
|
1000
|
+
const listeners = this.eventListeners.get(msg["method"]);
|
|
1001
|
+
if (listeners) {
|
|
1002
|
+
const params = msg["params"] ?? {};
|
|
1003
|
+
for (const fn of listeners) {
|
|
1004
|
+
try {
|
|
1005
|
+
fn(params);
|
|
1006
|
+
} catch {
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
var BidiDomChannel = class {
|
|
1014
|
+
kind = "bidi";
|
|
1015
|
+
client;
|
|
1016
|
+
constructor(options) {
|
|
1017
|
+
this.client = new WebDriverBidiClient(options);
|
|
1018
|
+
}
|
|
1019
|
+
isConnected() {
|
|
1020
|
+
return this.client.isConnected();
|
|
1021
|
+
}
|
|
1022
|
+
async connect() {
|
|
1023
|
+
await this.client.connect();
|
|
1024
|
+
}
|
|
1025
|
+
async disconnect() {
|
|
1026
|
+
await this.client.disconnect();
|
|
1027
|
+
}
|
|
1028
|
+
async getTargetInfo() {
|
|
1029
|
+
const info = await this.client.evaluate(
|
|
1030
|
+
"({ url: window.location.href, title: document.title })",
|
|
1031
|
+
false
|
|
1032
|
+
);
|
|
1033
|
+
return {
|
|
1034
|
+
id: this.client.contextId ?? "bidi-context",
|
|
1035
|
+
url: info?.url,
|
|
1036
|
+
title: info?.title,
|
|
1037
|
+
type: "page"
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
async query(selector) {
|
|
1041
|
+
const res = await this.client.evaluate(buildDomQueryScript(selector), false);
|
|
1042
|
+
return Array.isArray(res) ? res : [];
|
|
1043
|
+
}
|
|
1044
|
+
async evaluate(script, ...args) {
|
|
1045
|
+
if (typeof script === "string") {
|
|
1046
|
+
return this.client.evaluate(script, true);
|
|
1047
|
+
}
|
|
1048
|
+
const serializedArgs = args.map((a) => JSON.stringify(a)).join(", ");
|
|
1049
|
+
return this.client.evaluate(`(${script.toString()})(${serializedArgs})`, true);
|
|
1050
|
+
}
|
|
1051
|
+
async waitForIdle(options) {
|
|
1052
|
+
const quietMs = 150;
|
|
1053
|
+
const timeoutMs = Math.max(50, options?.timeout ?? 5e3);
|
|
1054
|
+
await this.client.evaluate(
|
|
1055
|
+
`new Promise((resolve) => {
|
|
1056
|
+
const deadline = setTimeout(resolve, ${timeoutMs});
|
|
1057
|
+
requestAnimationFrame(() => setTimeout(() => { clearTimeout(deadline); resolve(undefined); }, ${quietMs}));
|
|
1058
|
+
})`,
|
|
1059
|
+
true
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1062
|
+
async scrollIntoView(selector) {
|
|
1063
|
+
return this.client.evaluate(
|
|
1064
|
+
buildDomScrollIntoViewScript(selector),
|
|
1065
|
+
false
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
async tapDom(selector) {
|
|
1069
|
+
return Boolean(await this.client.evaluate(buildDomTapScript(selector), false));
|
|
1070
|
+
}
|
|
1071
|
+
async fillDom(selector, value, options) {
|
|
1072
|
+
return Boolean(
|
|
1073
|
+
await this.client.evaluate(buildDomFillScript(selector, value, options), true)
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
async waitForSelector(selector, options) {
|
|
1077
|
+
const res = await this.client.evaluate(
|
|
1078
|
+
buildDomWaitForSelectorScript(selector, options),
|
|
1079
|
+
true
|
|
1080
|
+
);
|
|
1081
|
+
return Array.isArray(res) ? res : [];
|
|
1082
|
+
}
|
|
1083
|
+
async waitForHidden(selector, options) {
|
|
1084
|
+
return Boolean(
|
|
1085
|
+
await this.client.evaluate(buildDomWaitForHiddenScript(selector, options), true)
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
async waitForMatch(selector, options) {
|
|
1089
|
+
return this.client.evaluate(
|
|
1090
|
+
buildDomWaitForMatchScript(selector, options),
|
|
1091
|
+
true
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
async setStorage(entries) {
|
|
1095
|
+
const serialized = JSON.stringify(entries);
|
|
1096
|
+
await this.client.evaluate(
|
|
1097
|
+
`((payload) => {
|
|
1098
|
+
if (payload.localStorage) {
|
|
1099
|
+
for (const [k, v] of Object.entries(payload.localStorage)) window.localStorage.setItem(k, String(v));
|
|
1100
|
+
}
|
|
1101
|
+
if (payload.sessionStorage) {
|
|
1102
|
+
for (const [k, v] of Object.entries(payload.sessionStorage)) window.sessionStorage.setItem(k, String(v));
|
|
1103
|
+
}
|
|
1104
|
+
if (payload.cookies) {
|
|
1105
|
+
for (const c of payload.cookies) {
|
|
1106
|
+
document.cookie = encodeURIComponent(c.name) + "=" + encodeURIComponent(c.value) + "; path=" + (c.path || "/");
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
})(${serialized})`,
|
|
1110
|
+
false
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
async clearStorage(options) {
|
|
1114
|
+
const serialized = JSON.stringify(options ?? {});
|
|
1115
|
+
await this.client.evaluate(
|
|
1116
|
+
`((opts) => {
|
|
1117
|
+
if (opts.localStorage !== false) { try { window.localStorage.clear(); } catch {} }
|
|
1118
|
+
if (opts.sessionStorage !== false) { try { window.sessionStorage.clear(); } catch {} }
|
|
1119
|
+
})(${serialized})`,
|
|
1120
|
+
false
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
async reload() {
|
|
1124
|
+
await this.client.reload("interactive");
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
function createBidiDomChannel(options) {
|
|
1128
|
+
return new BidiDomChannel(options);
|
|
1129
|
+
}
|
|
940
1130
|
export {
|
|
941
1131
|
AndroidWebViewCdpChannel,
|
|
942
1132
|
AppleWebInspectorClient,
|
|
1133
|
+
BidiDomChannel,
|
|
943
1134
|
CdpDomChannel,
|
|
944
1135
|
DEFAULT_MAX_WORKERS_PER_PROCESS,
|
|
945
1136
|
DEFAULT_WARM_DAEMON_IDLE_TTL_MS,
|
|
1137
|
+
NetworkEventBuffer,
|
|
946
1138
|
NetworkReplayCache,
|
|
947
1139
|
PersonaAuthCache,
|
|
948
1140
|
ReplayCacheStore,
|
|
@@ -954,12 +1146,17 @@ export {
|
|
|
954
1146
|
TARGET_CHANNEL_MATRIX,
|
|
955
1147
|
UPLOAD_ATTACH_TIMEOUT_MS,
|
|
956
1148
|
VirtualCredentialStore,
|
|
1149
|
+
WebDriverBidiClient,
|
|
957
1150
|
WebKitInspectorChannel,
|
|
958
1151
|
allocateFreePort,
|
|
1152
|
+
and,
|
|
1153
|
+
applyExtensionChromeArgs,
|
|
959
1154
|
applyNamedSetup,
|
|
960
1155
|
applyTestFilters,
|
|
1156
|
+
assertDataSnapshot,
|
|
961
1157
|
assertPortAvailable,
|
|
962
1158
|
attachNetworkReplayCache,
|
|
1159
|
+
buildComponentTreeScript,
|
|
963
1160
|
buildDomActionabilityDiagScript,
|
|
964
1161
|
buildDomFillScript,
|
|
965
1162
|
buildDomWaitForHiddenScript,
|
|
@@ -969,10 +1166,20 @@ export {
|
|
|
969
1166
|
buildFlowFileFromLines,
|
|
970
1167
|
buildInjectedCallScript,
|
|
971
1168
|
buildNetworkCacheKey,
|
|
1169
|
+
buildPerformanceProfileScript,
|
|
972
1170
|
buildPlaybackTraceFromSteps,
|
|
973
1171
|
buildReplayCacheKey,
|
|
1172
|
+
buildRichFlowTrace,
|
|
1173
|
+
byAltText,
|
|
974
1174
|
byCss,
|
|
1175
|
+
byLabel,
|
|
1176
|
+
byPlaceholder,
|
|
975
1177
|
byRole,
|
|
1178
|
+
byTitle,
|
|
1179
|
+
captureAndroidLogcat,
|
|
1180
|
+
captureIosSimulatorCrashLogs,
|
|
1181
|
+
checkServerReady,
|
|
1182
|
+
clearReplayCache,
|
|
976
1183
|
cloneIOSSimulator,
|
|
977
1184
|
collectGitChanges,
|
|
978
1185
|
comparePngNative,
|
|
@@ -981,12 +1188,15 @@ export {
|
|
|
981
1188
|
createAndroidWebViewCdpChannel,
|
|
982
1189
|
createApiClient,
|
|
983
1190
|
createApiFixture,
|
|
1191
|
+
createBidiDomChannel,
|
|
984
1192
|
createCdpDomChannel,
|
|
985
1193
|
createCompositeDomChannel,
|
|
1194
|
+
createFlowAgent,
|
|
986
1195
|
createFlowWithFixtures,
|
|
987
1196
|
createGitHubPrReporter,
|
|
988
1197
|
createLogprobDecisionJudge,
|
|
989
1198
|
createOllamaDecisionJudge,
|
|
1199
|
+
createOpenAICompatibleAgentProvider,
|
|
990
1200
|
createRemoteFlowClaimer,
|
|
991
1201
|
createSpanaBridgeChannel,
|
|
992
1202
|
createWebKitInspectorChannel,
|
|
@@ -994,9 +1204,12 @@ export {
|
|
|
994
1204
|
decodeWebInspectorFrames,
|
|
995
1205
|
defaultDaemonStateDir,
|
|
996
1206
|
defineConfig,
|
|
1207
|
+
defineDomTransport,
|
|
1208
|
+
defineDriverAdapter,
|
|
997
1209
|
definePersona,
|
|
998
1210
|
defineSetup,
|
|
999
1211
|
deleteIOSSimulator,
|
|
1212
|
+
deserializeBidiRemoteValue,
|
|
1000
1213
|
deterministicImpactFilter,
|
|
1001
1214
|
domRectToScreenBounds,
|
|
1002
1215
|
encodeWebInspectorPacket,
|
|
@@ -1004,33 +1217,44 @@ export {
|
|
|
1004
1217
|
exportFramesToMp4,
|
|
1005
1218
|
extractCodeFrame,
|
|
1006
1219
|
extractDestructuredParamNames,
|
|
1220
|
+
filterFlowsForProject,
|
|
1007
1221
|
filterSelector,
|
|
1008
1222
|
findSimulatorWebInspectorSocket,
|
|
1009
1223
|
findWebViewFrame,
|
|
1010
1224
|
first,
|
|
1011
1225
|
flow,
|
|
1226
|
+
formatActionsAsFlowCode,
|
|
1227
|
+
formatCacheInspectTable,
|
|
1012
1228
|
formatCodeFrame,
|
|
1013
1229
|
formatFilterSummary,
|
|
1014
1230
|
formatGitHubPrMarkdown,
|
|
1015
1231
|
formatSelectorCode,
|
|
1016
1232
|
formatTargetMatrixTable,
|
|
1017
1233
|
getHealthyWarmDaemon,
|
|
1234
|
+
getLoadedExtensions,
|
|
1018
1235
|
getNativeAcceleratorPath,
|
|
1019
1236
|
inFrame,
|
|
1237
|
+
inspectReplayCache,
|
|
1020
1238
|
invalidateWebViewFrameCache,
|
|
1021
1239
|
isComposableDomSelector,
|
|
1240
|
+
isHttpUrlReady,
|
|
1022
1241
|
isNativeAcceleratorActive,
|
|
1023
1242
|
isOffscreenInViewport,
|
|
1024
1243
|
isPortAvailable,
|
|
1244
|
+
isSecretValue,
|
|
1025
1245
|
isSystemUISelector,
|
|
1246
|
+
isTcpPortOpen,
|
|
1026
1247
|
isTestIDSelector,
|
|
1027
1248
|
last,
|
|
1028
1249
|
launchDirectCdpBrowser,
|
|
1029
1250
|
launchPlaywrightBrowser,
|
|
1251
|
+
listDomTransports,
|
|
1252
|
+
listDriverAdapters,
|
|
1030
1253
|
listWarmDaemons,
|
|
1031
1254
|
makeElectrobunDriver,
|
|
1032
1255
|
makeElectronDriver,
|
|
1033
1256
|
makeLightweightCdpDriver,
|
|
1257
|
+
matchDataSnapshot,
|
|
1034
1258
|
nth,
|
|
1035
1259
|
or,
|
|
1036
1260
|
orderFlowsLongestFirst,
|
|
@@ -1041,25 +1265,44 @@ export {
|
|
|
1041
1265
|
planProcessPool,
|
|
1042
1266
|
probabilityFromTopLogprobs,
|
|
1043
1267
|
reapIdleWarmDaemons,
|
|
1268
|
+
registerDomTransport,
|
|
1269
|
+
registerDriverAdapter,
|
|
1270
|
+
renderTraceViewerHtml,
|
|
1044
1271
|
replayRecordedAction,
|
|
1272
|
+
resolveBrowserExtensions,
|
|
1273
|
+
resolveDomTransport,
|
|
1274
|
+
resolveDriverAdapter,
|
|
1045
1275
|
resolveElectrobunEngine,
|
|
1046
1276
|
resolveElectrobunLaunchPlan,
|
|
1047
1277
|
resolveElementAcrossChannels,
|
|
1278
|
+
resolveProjectExecutionPlan,
|
|
1048
1279
|
resolveTargetDescriptor,
|
|
1049
1280
|
resolveWebEngine,
|
|
1281
|
+
runExploreSession,
|
|
1050
1282
|
runMultiProcessPool,
|
|
1283
|
+
runOAuthPopupFlow,
|
|
1284
|
+
secret,
|
|
1051
1285
|
speculativelyPrelaunchWebBrowser,
|
|
1052
1286
|
startAndroidVideoRecorder,
|
|
1053
1287
|
startCdpScreencastRecorder,
|
|
1054
1288
|
startIosSimulatorVideoRecorder,
|
|
1055
1289
|
startSharedFlowQueueServer,
|
|
1290
|
+
startWebServer,
|
|
1291
|
+
startWebServers,
|
|
1292
|
+
step,
|
|
1056
1293
|
stopAllWarmDaemons,
|
|
1057
1294
|
stopWarmDaemon,
|
|
1295
|
+
suite,
|
|
1058
1296
|
sweepOrphanedSpanaBrowsers,
|
|
1059
1297
|
systemUI,
|
|
1060
1298
|
tokenizeXmlNative,
|
|
1299
|
+
unique,
|
|
1300
|
+
unregisterDomTransport,
|
|
1301
|
+
unregisterDriverAdapter,
|
|
1061
1302
|
updateWarmDaemonSession,
|
|
1303
|
+
withActiveStepRecorder,
|
|
1062
1304
|
within,
|
|
1305
|
+
writeRichTraceBundle,
|
|
1063
1306
|
writeWorkerProcessReport
|
|
1064
1307
|
};
|
|
1065
1308
|
//# sourceMappingURL=index.js.map
|