execbro 0.0.1-reserve → 1.10.13
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/LICENSE +32 -0
- package/README.md +496 -0
- package/build/__tests__/helpers/fake-cdp-server.d.ts +56 -0
- package/build/__tests__/helpers/fake-cdp-server.d.ts.map +1 -0
- package/build/__tests__/helpers/fake-cdp-server.js +120 -0
- package/build/__tests__/helpers/fake-cdp-server.js.map +1 -0
- package/build/__tests__/helpers/tap-test-helpers.d.ts +36 -0
- package/build/__tests__/helpers/tap-test-helpers.d.ts.map +1 -0
- package/build/__tests__/helpers/tap-test-helpers.js +130 -0
- package/build/__tests__/helpers/tap-test-helpers.js.map +1 -0
- package/build/__tests__/integration/auto-reconnect.test.d.ts +2 -0
- package/build/__tests__/integration/auto-reconnect.test.d.ts.map +1 -0
- package/build/__tests__/integration/auto-reconnect.test.js +118 -0
- package/build/__tests__/integration/auto-reconnect.test.js.map +1 -0
- package/build/__tests__/integration/connection-health.test.d.ts +2 -0
- package/build/__tests__/integration/connection-health.test.d.ts.map +1 -0
- package/build/__tests__/integration/connection-health.test.js +157 -0
- package/build/__tests__/integration/connection-health.test.js.map +1 -0
- package/build/__tests__/integration/execute-in-app.test.d.ts +2 -0
- package/build/__tests__/integration/execute-in-app.test.d.ts.map +1 -0
- package/build/__tests__/integration/execute-in-app.test.js +124 -0
- package/build/__tests__/integration/execute-in-app.test.js.map +1 -0
- package/build/__tests__/integration/per-call-timeout.test.d.ts +2 -0
- package/build/__tests__/integration/per-call-timeout.test.d.ts.map +1 -0
- package/build/__tests__/integration/per-call-timeout.test.js +103 -0
- package/build/__tests__/integration/per-call-timeout.test.js.map +1 -0
- package/build/__tests__/integration/tap-strategies.test.d.ts +2 -0
- package/build/__tests__/integration/tap-strategies.test.d.ts.map +1 -0
- package/build/__tests__/integration/tap-strategies.test.js +330 -0
- package/build/__tests__/integration/tap-strategies.test.js.map +1 -0
- package/build/__tests__/integration/tools.test.d.ts +2 -0
- package/build/__tests__/integration/tools.test.d.ts.map +1 -0
- package/build/__tests__/integration/tools.test.js +227 -0
- package/build/__tests__/integration/tools.test.js.map +1 -0
- package/build/__tests__/setup.d.ts +2 -0
- package/build/__tests__/setup.d.ts.map +1 -0
- package/build/__tests__/setup.js +15 -0
- package/build/__tests__/setup.js.map +1 -0
- package/build/__tests__/unit/androidEmulatorAvds.test.d.ts +2 -0
- package/build/__tests__/unit/androidEmulatorAvds.test.d.ts.map +1 -0
- package/build/__tests__/unit/androidEmulatorAvds.test.js +98 -0
- package/build/__tests__/unit/androidEmulatorAvds.test.js.map +1 -0
- package/build/__tests__/unit/buildToken.test.d.ts +2 -0
- package/build/__tests__/unit/buildToken.test.d.ts.map +1 -0
- package/build/__tests__/unit/buildToken.test.js +22 -0
- package/build/__tests__/unit/buildToken.test.js.map +1 -0
- package/build/__tests__/unit/bundle.test.d.ts +2 -0
- package/build/__tests__/unit/bundle.test.d.ts.map +1 -0
- package/build/__tests__/unit/bundle.test.js +53 -0
- package/build/__tests__/unit/bundle.test.js.map +1 -0
- package/build/__tests__/unit/burst.test.d.ts +2 -0
- package/build/__tests__/unit/burst.test.d.ts.map +1 -0
- package/build/__tests__/unit/burst.test.js +54 -0
- package/build/__tests__/unit/burst.test.js.map +1 -0
- package/build/__tests__/unit/connection-health.test.d.ts +2 -0
- package/build/__tests__/unit/connection-health.test.d.ts.map +1 -0
- package/build/__tests__/unit/connection-health.test.js +38 -0
- package/build/__tests__/unit/connection-health.test.js.map +1 -0
- package/build/__tests__/unit/debugGlobals.test.d.ts +2 -0
- package/build/__tests__/unit/debugGlobals.test.d.ts.map +1 -0
- package/build/__tests__/unit/debugGlobals.test.js +14 -0
- package/build/__tests__/unit/debugGlobals.test.js.map +1 -0
- package/build/__tests__/unit/deviceDiscovery.test.d.ts +2 -0
- package/build/__tests__/unit/deviceDiscovery.test.d.ts.map +1 -0
- package/build/__tests__/unit/deviceDiscovery.test.js +119 -0
- package/build/__tests__/unit/deviceDiscovery.test.js.map +1 -0
- package/build/__tests__/unit/deviceResolver.test.d.ts +2 -0
- package/build/__tests__/unit/deviceResolver.test.d.ts.map +1 -0
- package/build/__tests__/unit/deviceResolver.test.js +261 -0
- package/build/__tests__/unit/deviceResolver.test.js.map +1 -0
- package/build/__tests__/unit/escapeNonAscii.test.d.ts +2 -0
- package/build/__tests__/unit/escapeNonAscii.test.d.ts.map +1 -0
- package/build/__tests__/unit/escapeNonAscii.test.js +76 -0
- package/build/__tests__/unit/escapeNonAscii.test.js.map +1 -0
- package/build/__tests__/unit/exec.test.d.ts +2 -0
- package/build/__tests__/unit/exec.test.d.ts.map +1 -0
- package/build/__tests__/unit/exec.test.js +54 -0
- package/build/__tests__/unit/exec.test.js.map +1 -0
- package/build/__tests__/unit/executor.test.d.ts +2 -0
- package/build/__tests__/unit/executor.test.d.ts.map +1 -0
- package/build/__tests__/unit/executor.test.js +220 -0
- package/build/__tests__/unit/executor.test.js.map +1 -0
- package/build/__tests__/unit/failureArtifact.test.d.ts +2 -0
- package/build/__tests__/unit/failureArtifact.test.d.ts.map +1 -0
- package/build/__tests__/unit/failureArtifact.test.js +207 -0
- package/build/__tests__/unit/failureArtifact.test.js.map +1 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.d.ts +2 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.d.ts.map +1 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.js +68 -0
- package/build/__tests__/unit/fastRefreshRecorder.test.js.map +1 -0
- package/build/__tests__/unit/fastRefreshTools.test.d.ts +2 -0
- package/build/__tests__/unit/fastRefreshTools.test.d.ts.map +1 -0
- package/build/__tests__/unit/fastRefreshTools.test.js +112 -0
- package/build/__tests__/unit/fastRefreshTools.test.js.map +1 -0
- package/build/__tests__/unit/fiberMatch.test.d.ts +2 -0
- package/build/__tests__/unit/fiberMatch.test.d.ts.map +1 -0
- package/build/__tests__/unit/fiberMatch.test.js +114 -0
- package/build/__tests__/unit/fiberMatch.test.js.map +1 -0
- package/build/__tests__/unit/fingerprint.test.d.ts +2 -0
- package/build/__tests__/unit/fingerprint.test.d.ts.map +1 -0
- package/build/__tests__/unit/fingerprint.test.js +99 -0
- package/build/__tests__/unit/fingerprint.test.js.map +1 -0
- package/build/__tests__/unit/focusedInput.test.d.ts +2 -0
- package/build/__tests__/unit/focusedInput.test.d.ts.map +1 -0
- package/build/__tests__/unit/focusedInput.test.js +58 -0
- package/build/__tests__/unit/focusedInput.test.js.map +1 -0
- package/build/__tests__/unit/focusedInputTools.test.d.ts +2 -0
- package/build/__tests__/unit/focusedInputTools.test.d.ts.map +1 -0
- package/build/__tests__/unit/focusedInputTools.test.js +79 -0
- package/build/__tests__/unit/focusedInputTools.test.js.map +1 -0
- package/build/__tests__/unit/iconSemantics.test.d.ts +2 -0
- package/build/__tests__/unit/iconSemantics.test.d.ts.map +1 -0
- package/build/__tests__/unit/iconSemantics.test.js +80 -0
- package/build/__tests__/unit/iconSemantics.test.js.map +1 -0
- package/build/__tests__/unit/imageBuffer.test.d.ts +2 -0
- package/build/__tests__/unit/imageBuffer.test.d.ts.map +1 -0
- package/build/__tests__/unit/imageBuffer.test.js +128 -0
- package/build/__tests__/unit/imageBuffer.test.js.map +1 -0
- package/build/__tests__/unit/logs.test.d.ts +2 -0
- package/build/__tests__/unit/logs.test.d.ts.map +1 -0
- package/build/__tests__/unit/logs.test.js +90 -0
- package/build/__tests__/unit/logs.test.js.map +1 -0
- package/build/__tests__/unit/measureComponent.test.d.ts +2 -0
- package/build/__tests__/unit/measureComponent.test.d.ts.map +1 -0
- package/build/__tests__/unit/measureComponent.test.js +66 -0
- package/build/__tests__/unit/measureComponent.test.js.map +1 -0
- package/build/__tests__/unit/measureComponentTools.test.d.ts +2 -0
- package/build/__tests__/unit/measureComponentTools.test.d.ts.map +1 -0
- package/build/__tests__/unit/measureComponentTools.test.js +94 -0
- package/build/__tests__/unit/measureComponentTools.test.js.map +1 -0
- package/build/__tests__/unit/metro.test.d.ts +2 -0
- package/build/__tests__/unit/metro.test.d.ts.map +1 -0
- package/build/__tests__/unit/metro.test.js +61 -0
- package/build/__tests__/unit/metro.test.js.map +1 -0
- package/build/__tests__/unit/network.test.d.ts +2 -0
- package/build/__tests__/unit/network.test.d.ts.map +1 -0
- package/build/__tests__/unit/network.test.js +102 -0
- package/build/__tests__/unit/network.test.js.map +1 -0
- package/build/__tests__/unit/networkInterceptor.test.d.ts +2 -0
- package/build/__tests__/unit/networkInterceptor.test.d.ts.map +1 -0
- package/build/__tests__/unit/networkInterceptor.test.js +104 -0
- package/build/__tests__/unit/networkInterceptor.test.js.map +1 -0
- package/build/__tests__/unit/probe.test.d.ts +2 -0
- package/build/__tests__/unit/probe.test.d.ts.map +1 -0
- package/build/__tests__/unit/probe.test.js +62 -0
- package/build/__tests__/unit/probe.test.js.map +1 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts +2 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts.map +1 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.js +29 -0
- package/build/__tests__/unit/rnGlobalsBootstrap.test.js.map +1 -0
- package/build/__tests__/unit/screenState.test.d.ts +2 -0
- package/build/__tests__/unit/screenState.test.d.ts.map +1 -0
- package/build/__tests__/unit/screenState.test.js +384 -0
- package/build/__tests__/unit/screenState.test.js.map +1 -0
- package/build/__tests__/unit/screenshot-diff.test.d.ts +2 -0
- package/build/__tests__/unit/screenshot-diff.test.d.ts.map +1 -0
- package/build/__tests__/unit/screenshot-diff.test.js +97 -0
- package/build/__tests__/unit/screenshot-diff.test.js.map +1 -0
- package/build/__tests__/unit/tap-evidence.test.d.ts +2 -0
- package/build/__tests__/unit/tap-evidence.test.d.ts.map +1 -0
- package/build/__tests__/unit/tap-evidence.test.js +89 -0
- package/build/__tests__/unit/tap-evidence.test.js.map +1 -0
- package/build/__tests__/unit/tap.test.d.ts +2 -0
- package/build/__tests__/unit/tap.test.d.ts.map +1 -0
- package/build/__tests__/unit/tap.test.js +767 -0
- package/build/__tests__/unit/tap.test.js.map +1 -0
- package/build/__tests__/unit/timeoutClamp.test.d.ts +2 -0
- package/build/__tests__/unit/timeoutClamp.test.d.ts.map +1 -0
- package/build/__tests__/unit/timeoutClamp.test.js +17 -0
- package/build/__tests__/unit/timeoutClamp.test.js.map +1 -0
- package/build/__tests__/unit/toolDescriptions.test.d.ts +2 -0
- package/build/__tests__/unit/toolDescriptions.test.d.ts.map +1 -0
- package/build/__tests__/unit/toolDescriptions.test.js +145 -0
- package/build/__tests__/unit/toolDescriptions.test.js.map +1 -0
- package/build/__tests__/unit/transportClassify.test.d.ts +2 -0
- package/build/__tests__/unit/transportClassify.test.d.ts.map +1 -0
- package/build/__tests__/unit/transportClassify.test.js +60 -0
- package/build/__tests__/unit/transportClassify.test.js.map +1 -0
- package/build/__tests__/unit/verifyAction.test.d.ts +2 -0
- package/build/__tests__/unit/verifyAction.test.d.ts.map +1 -0
- package/build/__tests__/unit/verifyAction.test.js +26 -0
- package/build/__tests__/unit/verifyAction.test.js.map +1 -0
- package/build/core/android.d.ts +299 -0
- package/build/core/android.d.ts.map +1 -0
- package/build/core/android.js +1582 -0
- package/build/core/android.js.map +1 -0
- package/build/core/appDetection.d.ts +20 -0
- package/build/core/appDetection.d.ts.map +1 -0
- package/build/core/appDetection.js +167 -0
- package/build/core/appDetection.js.map +1 -0
- package/build/core/bundle.d.ts +49 -0
- package/build/core/bundle.d.ts.map +1 -0
- package/build/core/bundle.js +356 -0
- package/build/core/bundle.js.map +1 -0
- package/build/core/componentSearch.d.ts +41 -0
- package/build/core/componentSearch.d.ts.map +1 -0
- package/build/core/componentSearch.js +588 -0
- package/build/core/componentSearch.js.map +1 -0
- package/build/core/componentTree.d.ts +13 -0
- package/build/core/componentTree.d.ts.map +1 -0
- package/build/core/componentTree.js +275 -0
- package/build/core/componentTree.js.map +1 -0
- package/build/core/config.d.ts +9 -0
- package/build/core/config.d.ts.map +1 -0
- package/build/core/config.js +28 -0
- package/build/core/config.js.map +1 -0
- package/build/core/connection.d.ts +102 -0
- package/build/core/connection.d.ts.map +1 -0
- package/build/core/connection.js +1710 -0
- package/build/core/connection.js.map +1 -0
- package/build/core/connectionState.d.ts +122 -0
- package/build/core/connectionState.d.ts.map +1 -0
- package/build/core/connectionState.js +313 -0
- package/build/core/connectionState.js.map +1 -0
- package/build/core/debugGlobals.d.ts +6 -0
- package/build/core/debugGlobals.d.ts.map +1 -0
- package/build/core/debugGlobals.js +370 -0
- package/build/core/debugGlobals.js.map +1 -0
- package/build/core/deviceDiscovery.d.ts +52 -0
- package/build/core/deviceDiscovery.d.ts.map +1 -0
- package/build/core/deviceDiscovery.js +74 -0
- package/build/core/deviceDiscovery.js.map +1 -0
- package/build/core/deviceResolver.d.ts +44 -0
- package/build/core/deviceResolver.d.ts.map +1 -0
- package/build/core/deviceResolver.js +225 -0
- package/build/core/deviceResolver.js.map +1 -0
- package/build/core/errorScreenParser.d.ts +30 -0
- package/build/core/errorScreenParser.d.ts.map +1 -0
- package/build/core/errorScreenParser.js +198 -0
- package/build/core/errorScreenParser.js.map +1 -0
- package/build/core/errors.d.ts +14 -0
- package/build/core/errors.d.ts.map +1 -0
- package/build/core/errors.js +17 -0
- package/build/core/errors.js.map +1 -0
- package/build/core/escapeNonAscii.d.ts +18 -0
- package/build/core/escapeNonAscii.d.ts.map +1 -0
- package/build/core/escapeNonAscii.js +352 -0
- package/build/core/escapeNonAscii.js.map +1 -0
- package/build/core/exec.d.ts +22 -0
- package/build/core/exec.d.ts.map +1 -0
- package/build/core/exec.js +54 -0
- package/build/core/exec.js.map +1 -0
- package/build/core/executor.d.ts +9 -0
- package/build/core/executor.d.ts.map +1 -0
- package/build/core/executor.js +12 -0
- package/build/core/executor.js.map +1 -0
- package/build/core/failureArtifact.d.ts +120 -0
- package/build/core/failureArtifact.d.ts.map +1 -0
- package/build/core/failureArtifact.js +113 -0
- package/build/core/failureArtifact.js.map +1 -0
- package/build/core/fastRefreshRecorder.d.ts +23 -0
- package/build/core/fastRefreshRecorder.d.ts.map +1 -0
- package/build/core/fastRefreshRecorder.js +83 -0
- package/build/core/fastRefreshRecorder.js.map +1 -0
- package/build/core/fastRefreshTools.d.ts +19 -0
- package/build/core/fastRefreshTools.d.ts.map +1 -0
- package/build/core/fastRefreshTools.js +71 -0
- package/build/core/fastRefreshTools.js.map +1 -0
- package/build/core/feedback.d.ts +18 -0
- package/build/core/feedback.d.ts.map +1 -0
- package/build/core/feedback.js +73 -0
- package/build/core/feedback.js.map +1 -0
- package/build/core/fiberMatch.d.ts +25 -0
- package/build/core/fiberMatch.d.ts.map +1 -0
- package/build/core/fiberMatch.js +35 -0
- package/build/core/fiberMatch.js.map +1 -0
- package/build/core/fingerprint.d.ts +4 -0
- package/build/core/fingerprint.d.ts.map +1 -0
- package/build/core/fingerprint.js +47 -0
- package/build/core/fingerprint.js.map +1 -0
- package/build/core/focusedInput.d.ts +27 -0
- package/build/core/focusedInput.d.ts.map +1 -0
- package/build/core/focusedInput.js +110 -0
- package/build/core/focusedInput.js.map +1 -0
- package/build/core/focusedInputTools.d.ts +21 -0
- package/build/core/focusedInputTools.d.ts.map +1 -0
- package/build/core/focusedInputTools.js +51 -0
- package/build/core/focusedInputTools.js.map +1 -0
- package/build/core/format.d.ts +8 -0
- package/build/core/format.d.ts.map +1 -0
- package/build/core/format.js +34 -0
- package/build/core/format.js.map +1 -0
- package/build/core/guides.d.ts +21 -0
- package/build/core/guides.d.ts.map +1 -0
- package/build/core/guides.js +397 -0
- package/build/core/guides.js.map +1 -0
- package/build/core/iconSemantics.d.ts +18 -0
- package/build/core/iconSemantics.d.ts.map +1 -0
- package/build/core/iconSemantics.js +114 -0
- package/build/core/iconSemantics.js.map +1 -0
- package/build/core/imageBuffer.d.ts +37 -0
- package/build/core/imageBuffer.d.ts.map +1 -0
- package/build/core/imageBuffer.js +58 -0
- package/build/core/imageBuffer.js.map +1 -0
- package/build/core/index.d.ts +37 -0
- package/build/core/index.d.ts.map +1 -0
- package/build/core/index.js +66 -0
- package/build/core/index.js.map +1 -0
- package/build/core/inspector.d.ts +55 -0
- package/build/core/inspector.d.ts.map +1 -0
- package/build/core/inspector.js +603 -0
- package/build/core/inspector.js.map +1 -0
- package/build/core/ios.d.ts +263 -0
- package/build/core/ios.d.ts.map +1 -0
- package/build/core/ios.js +1705 -0
- package/build/core/ios.js.map +1 -0
- package/build/core/jsExecute.d.ts +62 -0
- package/build/core/jsExecute.d.ts.map +1 -0
- package/build/core/jsExecute.js +696 -0
- package/build/core/jsExecute.js.map +1 -0
- package/build/core/license.d.ts +48 -0
- package/build/core/license.d.ts.map +1 -0
- package/build/core/license.js +267 -0
- package/build/core/license.js.map +1 -0
- package/build/core/logbox.d.ts +58 -0
- package/build/core/logbox.d.ts.map +1 -0
- package/build/core/logbox.js +330 -0
- package/build/core/logbox.js.map +1 -0
- package/build/core/logs.d.ts +44 -0
- package/build/core/logs.d.ts.map +1 -0
- package/build/core/logs.js +149 -0
- package/build/core/logs.js.map +1 -0
- package/build/core/measureComponent.d.ts +19 -0
- package/build/core/measureComponent.d.ts.map +1 -0
- package/build/core/measureComponent.js +94 -0
- package/build/core/measureComponent.js.map +1 -0
- package/build/core/measureComponentTools.d.ts +6 -0
- package/build/core/measureComponentTools.d.ts.map +1 -0
- package/build/core/measureComponentTools.js +43 -0
- package/build/core/measureComponentTools.js.map +1 -0
- package/build/core/metro.d.ts +31 -0
- package/build/core/metro.d.ts.map +1 -0
- package/build/core/metro.js +124 -0
- package/build/core/metro.js.map +1 -0
- package/build/core/nativeOnlyHints.d.ts +14 -0
- package/build/core/nativeOnlyHints.d.ts.map +1 -0
- package/build/core/nativeOnlyHints.js +58 -0
- package/build/core/nativeOnlyHints.js.map +1 -0
- package/build/core/network.d.ts +43 -0
- package/build/core/network.d.ts.map +1 -0
- package/build/core/network.js +217 -0
- package/build/core/network.js.map +1 -0
- package/build/core/networkInterceptor.d.ts +30 -0
- package/build/core/networkInterceptor.d.ts.map +1 -0
- package/build/core/networkInterceptor.js +211 -0
- package/build/core/networkInterceptor.js.map +1 -0
- package/build/core/ocr.d.ts +87 -0
- package/build/core/ocr.d.ts.map +1 -0
- package/build/core/ocr.js +335 -0
- package/build/core/ocr.js.map +1 -0
- package/build/core/paths.d.ts +2 -0
- package/build/core/paths.d.ts.map +1 -0
- package/build/core/paths.js +28 -0
- package/build/core/paths.js.map +1 -0
- package/build/core/posthog.d.ts +5 -0
- package/build/core/posthog.d.ts.map +1 -0
- package/build/core/posthog.js +52 -0
- package/build/core/posthog.js.map +1 -0
- package/build/core/pressables.d.ts +46 -0
- package/build/core/pressables.d.ts.map +1 -0
- package/build/core/pressables.js +1719 -0
- package/build/core/pressables.js.map +1 -0
- package/build/core/probe.d.ts +12 -0
- package/build/core/probe.d.ts.map +1 -0
- package/build/core/probe.js +56 -0
- package/build/core/probe.js.map +1 -0
- package/build/core/redux.d.ts +22 -0
- package/build/core/redux.d.ts.map +1 -0
- package/build/core/redux.js +116 -0
- package/build/core/redux.js.map +1 -0
- package/build/core/register.d.ts +8 -0
- package/build/core/register.d.ts.map +1 -0
- package/build/core/register.js +202 -0
- package/build/core/register.js.map +1 -0
- package/build/core/rnGlobalsBootstrap.d.ts +16 -0
- package/build/core/rnGlobalsBootstrap.d.ts.map +1 -0
- package/build/core/rnGlobalsBootstrap.js +116 -0
- package/build/core/rnGlobalsBootstrap.js.map +1 -0
- package/build/core/screenLayout.d.ts +53 -0
- package/build/core/screenLayout.d.ts.map +1 -0
- package/build/core/screenLayout.js +878 -0
- package/build/core/screenLayout.js.map +1 -0
- package/build/core/screenState.d.ts +166 -0
- package/build/core/screenState.d.ts.map +1 -0
- package/build/core/screenState.js +1352 -0
- package/build/core/screenState.js.map +1 -0
- package/build/core/sdkBridge.d.ts +67 -0
- package/build/core/sdkBridge.d.ts.map +1 -0
- package/build/core/sdkBridge.js +148 -0
- package/build/core/sdkBridge.js.map +1 -0
- package/build/core/state.d.ts +37 -0
- package/build/core/state.d.ts.map +1 -0
- package/build/core/state.js +124 -0
- package/build/core/state.js.map +1 -0
- package/build/core/telemetry.d.ts +50 -0
- package/build/core/telemetry.d.ts.map +1 -0
- package/build/core/telemetry.js +653 -0
- package/build/core/telemetry.js.map +1 -0
- package/build/core/toolHelpers.d.ts +24 -0
- package/build/core/toolHelpers.d.ts.map +1 -0
- package/build/core/toolHelpers.js +118 -0
- package/build/core/toolHelpers.js.map +1 -0
- package/build/core/types.d.ts +162 -0
- package/build/core/types.d.ts.map +1 -0
- package/build/core/types.js +2 -0
- package/build/core/types.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +132 -0
- package/build/index.js.map +1 -0
- package/build/pro/screenshot-diff.d.ts +10 -0
- package/build/pro/screenshot-diff.d.ts.map +1 -0
- package/build/pro/screenshot-diff.js +38 -0
- package/build/pro/screenshot-diff.js.map +1 -0
- package/build/pro/tap.d.ts +291 -0
- package/build/pro/tap.d.ts.map +1 -0
- package/build/pro/tap.js +1839 -0
- package/build/pro/tap.js.map +1 -0
- package/build/pro/verifyAction.d.ts +50 -0
- package/build/pro/verifyAction.d.ts.map +1 -0
- package/build/pro/verifyAction.js +285 -0
- package/build/pro/verifyAction.js.map +1 -0
- package/build/tools/_deviceArg.d.ts +45 -0
- package/build/tools/_deviceArg.d.ts.map +1 -0
- package/build/tools/_deviceArg.js +58 -0
- package/build/tools/_deviceArg.js.map +1 -0
- package/build/tools/accountTools.d.ts +46 -0
- package/build/tools/accountTools.d.ts.map +1 -0
- package/build/tools/accountTools.js +223 -0
- package/build/tools/accountTools.js.map +1 -0
- package/build/tools/bundleTools.d.ts +3 -0
- package/build/tools/bundleTools.d.ts.map +1 -0
- package/build/tools/bundleTools.js +375 -0
- package/build/tools/bundleTools.js.map +1 -0
- package/build/tools/componentTools.d.ts +3 -0
- package/build/tools/componentTools.d.ts.map +1 -0
- package/build/tools/componentTools.js +746 -0
- package/build/tools/componentTools.js.map +1 -0
- package/build/tools/connectionTools.d.ts +3 -0
- package/build/tools/connectionTools.d.ts.map +1 -0
- package/build/tools/connectionTools.js +625 -0
- package/build/tools/connectionTools.js.map +1 -0
- package/build/tools/deviceTools.d.ts +3 -0
- package/build/tools/deviceTools.d.ts.map +1 -0
- package/build/tools/deviceTools.js +423 -0
- package/build/tools/deviceTools.js.map +1 -0
- package/build/tools/executionTools.d.ts +3 -0
- package/build/tools/executionTools.d.ts.map +1 -0
- package/build/tools/executionTools.js +243 -0
- package/build/tools/executionTools.js.map +1 -0
- package/build/tools/interactionTools.d.ts +3 -0
- package/build/tools/interactionTools.d.ts.map +1 -0
- package/build/tools/interactionTools.js +539 -0
- package/build/tools/interactionTools.js.map +1 -0
- package/build/tools/logTools.d.ts +3 -0
- package/build/tools/logTools.d.ts.map +1 -0
- package/build/tools/logTools.js +371 -0
- package/build/tools/logTools.js.map +1 -0
- package/build/tools/metaTools.d.ts +7 -0
- package/build/tools/metaTools.d.ts.map +1 -0
- package/build/tools/metaTools.js +186 -0
- package/build/tools/metaTools.js.map +1 -0
- package/build/tools/networkTools.d.ts +3 -0
- package/build/tools/networkTools.d.ts.map +1 -0
- package/build/tools/networkTools.js +478 -0
- package/build/tools/networkTools.js.map +1 -0
- package/build/tools/reduxTools.d.ts +3 -0
- package/build/tools/reduxTools.d.ts.map +1 -0
- package/build/tools/reduxTools.js +83 -0
- package/build/tools/reduxTools.js.map +1 -0
- package/build/tools/screenshotTools.d.ts +3 -0
- package/build/tools/screenshotTools.d.ts.map +1 -0
- package/build/tools/screenshotTools.js +703 -0
- package/build/tools/screenshotTools.js.map +1 -0
- package/package.json +63 -2
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { getConnectedApps } from "./connection.js";
|
|
2
|
+
import { listAllDevices } from "./deviceDiscovery.js";
|
|
3
|
+
const UDID_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;
|
|
4
|
+
const ADB_SERIAL_REGEX = /^emulator-\d+$/;
|
|
5
|
+
/**
|
|
6
|
+
* Lowercase and strip separators (whitespace, `_`, `-`) so substring matches
|
|
7
|
+
* survive punctuation drift between caller input and the device's reported
|
|
8
|
+
* name (e.g. "SM_A356N" vs "SM-A356N - 15 - API 35").
|
|
9
|
+
*/
|
|
10
|
+
function normalizeName(value) {
|
|
11
|
+
if (!value)
|
|
12
|
+
return "";
|
|
13
|
+
return value.toLowerCase().replace(/[\s_\-]+/g, "");
|
|
14
|
+
}
|
|
15
|
+
function err(code, message, candidates) {
|
|
16
|
+
return { ok: false, error: { code, message, candidates } };
|
|
17
|
+
}
|
|
18
|
+
function ok(target) {
|
|
19
|
+
return { ok: true, target };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Render a DeviceResolverError as a single string suitable for tool responses.
|
|
23
|
+
* Appends the candidates list when present so the agent can disambiguate
|
|
24
|
+
* without an extra list_devices call.
|
|
25
|
+
*/
|
|
26
|
+
export function formatResolverError(error) {
|
|
27
|
+
if (!error.candidates || error.candidates.length === 0)
|
|
28
|
+
return error.message;
|
|
29
|
+
const lines = error.candidates.map((c) => ` - ${c.name} (${c.platform}) → device="${c.identifier}"`);
|
|
30
|
+
return `${error.message}\nCandidates:\n${lines.join("\n")}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a single `device` string (UDID, adb serial, RN-registry deviceName,
|
|
34
|
+
* sim/emu name, or undefined) into a structured DeviceTarget.
|
|
35
|
+
*
|
|
36
|
+
* Resolution order:
|
|
37
|
+
* 1. UDID format → iOS simulator lookup (errors if shutdown).
|
|
38
|
+
* 2. emulator-NNNN format → Android serial lookup.
|
|
39
|
+
* 3. Substring match against the RN-connected registry.
|
|
40
|
+
* 4. Substring match against booted iOS sims and online Android devices.
|
|
41
|
+
* 5. No `device` argument → pick the single running device, or error.
|
|
42
|
+
*/
|
|
43
|
+
export async function resolveDeviceTarget(device) {
|
|
44
|
+
const trimmed = device?.trim();
|
|
45
|
+
// Step 1: UDID match.
|
|
46
|
+
if (trimmed && UDID_REGEX.test(trimmed)) {
|
|
47
|
+
const inv = await listAllDevices();
|
|
48
|
+
const sim = inv.ios.simulators.find((s) => s.udid.toLowerCase() === trimmed.toLowerCase());
|
|
49
|
+
if (!sim) {
|
|
50
|
+
return err("DEVICE_NOT_FOUND", `No iOS simulator with UDID "${trimmed}". Call list_devices to see available identifiers.`);
|
|
51
|
+
}
|
|
52
|
+
if (sim.state !== "booted") {
|
|
53
|
+
return err("SIMULATOR_NOT_BOOTED", `Simulator "${sim.name}" (${sim.udid}) is not booted. Boot it with ios_boot_simulator({ udid: "${sim.udid}" }).`);
|
|
54
|
+
}
|
|
55
|
+
return ok({
|
|
56
|
+
platform: "ios",
|
|
57
|
+
iosUdid: sim.udid,
|
|
58
|
+
deviceName: sim.name,
|
|
59
|
+
source: "udid"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// Step 2: adb serial format.
|
|
63
|
+
if (trimmed && ADB_SERIAL_REGEX.test(trimmed)) {
|
|
64
|
+
const inv = await listAllDevices();
|
|
65
|
+
const emu = inv.android.emulators.find((e) => e.serial === trimmed);
|
|
66
|
+
if (emu) {
|
|
67
|
+
// Prefer the RN registry's deviceName when an app is connected on
|
|
68
|
+
// this serial — the registry name (e.g. "sdk_gphone16k_arm64 - 16 -
|
|
69
|
+
// API 36") matches what every other code path emits; the AVD
|
|
70
|
+
// identifier ("Pixel_9_-_16kb") is confusing as a response label.
|
|
71
|
+
// OB2 (2026-05-20).
|
|
72
|
+
const registryApp = getConnectedApps().find((e) => e.app.platform === "android" && e.app.adbSerial === trimmed);
|
|
73
|
+
return ok({
|
|
74
|
+
platform: "android",
|
|
75
|
+
androidSerial: trimmed,
|
|
76
|
+
deviceName: registryApp?.app.deviceInfo.deviceName || emu.name,
|
|
77
|
+
source: "adb-serial"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const phys = inv.android.physical.find((p) => p.serial === trimmed);
|
|
81
|
+
if (phys) {
|
|
82
|
+
const registryApp = getConnectedApps().find((e) => e.app.platform === "android" && e.app.adbSerial === trimmed);
|
|
83
|
+
return ok({
|
|
84
|
+
platform: "android",
|
|
85
|
+
androidSerial: trimmed,
|
|
86
|
+
deviceName: registryApp?.app.deviceInfo.deviceName || phys.model,
|
|
87
|
+
source: "adb-serial"
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return err("DEVICE_NOT_FOUND", `No Android device with serial "${trimmed}". Call list_devices to see attached devices.`);
|
|
91
|
+
}
|
|
92
|
+
// Step 3: Registry substring match.
|
|
93
|
+
if (trimmed) {
|
|
94
|
+
const apps = getConnectedApps();
|
|
95
|
+
const needle = normalizeName(trimmed);
|
|
96
|
+
const matches = apps.filter((entry) => {
|
|
97
|
+
const name = normalizeName(entry.app.deviceInfo.deviceName);
|
|
98
|
+
return name.includes(needle);
|
|
99
|
+
});
|
|
100
|
+
if (matches.length === 1) {
|
|
101
|
+
const m = matches[0].app;
|
|
102
|
+
// When the iOS app's UDID hasn't been backfilled yet (the
|
|
103
|
+
// findSimulatorByName race during connection), look it up on
|
|
104
|
+
// demand. Without this, downstream callers default to whichever
|
|
105
|
+
// simulator simctl reports as active — which on a multi-sim
|
|
106
|
+
// setup can be the OTHER device. Bug #5 (2026-05-20).
|
|
107
|
+
let iosUdid = m.simulatorUdid;
|
|
108
|
+
if (m.platform === "ios" && !iosUdid && m.deviceInfo.deviceName) {
|
|
109
|
+
try {
|
|
110
|
+
const inv = await listAllDevices();
|
|
111
|
+
const sim = inv.ios.simulators.find((s) => s.state === "booted" && s.name === m.deviceInfo.deviceName);
|
|
112
|
+
if (sim)
|
|
113
|
+
iosUdid = sim.udid;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// best-effort; fall through with undefined udid
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return ok({
|
|
120
|
+
platform: m.platform,
|
|
121
|
+
iosUdid,
|
|
122
|
+
androidSerial: m.adbSerial,
|
|
123
|
+
deviceName: m.deviceInfo.deviceName,
|
|
124
|
+
source: "registry"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (matches.length > 1) {
|
|
128
|
+
return err("MULTIPLE_DEVICES_MATCH", `"${trimmed}" matches multiple connected devices. Pass a more specific identifier (full name, UDID, or adb serial).`, matches.map((m) => ({
|
|
129
|
+
name: m.app.deviceInfo.deviceName,
|
|
130
|
+
platform: m.app.platform,
|
|
131
|
+
identifier: m.app.simulatorUdid ?? m.app.adbSerial ?? m.app.deviceInfo.deviceName
|
|
132
|
+
})));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Step 4: OS-level name match.
|
|
136
|
+
const inv = await listAllDevices();
|
|
137
|
+
if (trimmed) {
|
|
138
|
+
const needle = normalizeName(trimmed);
|
|
139
|
+
const iosBootedMatches = inv.ios.simulators.filter((s) => s.state === "booted" && normalizeName(s.name).includes(needle));
|
|
140
|
+
const androidRunningMatches = inv.android.emulators.filter((e) => e.state === "running" && normalizeName(e.name).includes(needle));
|
|
141
|
+
const androidPhysicalMatches = inv.android.physical.filter((p) => p.state === "device" && normalizeName(p.model).includes(needle));
|
|
142
|
+
const totalMatches = iosBootedMatches.length + androidRunningMatches.length + androidPhysicalMatches.length;
|
|
143
|
+
if (totalMatches === 1) {
|
|
144
|
+
if (iosBootedMatches.length === 1) {
|
|
145
|
+
const s = iosBootedMatches[0];
|
|
146
|
+
return ok({
|
|
147
|
+
platform: "ios",
|
|
148
|
+
iosUdid: s.udid,
|
|
149
|
+
deviceName: s.name,
|
|
150
|
+
source: "name-match"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (androidRunningMatches.length === 1) {
|
|
154
|
+
const e = androidRunningMatches[0];
|
|
155
|
+
return ok({
|
|
156
|
+
platform: "android",
|
|
157
|
+
androidSerial: e.serial ?? undefined,
|
|
158
|
+
deviceName: e.name,
|
|
159
|
+
source: "name-match"
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
const p = androidPhysicalMatches[0];
|
|
163
|
+
return ok({
|
|
164
|
+
platform: "android",
|
|
165
|
+
androidSerial: p.serial,
|
|
166
|
+
deviceName: p.model,
|
|
167
|
+
source: "name-match"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (totalMatches > 1) {
|
|
171
|
+
const candidates = [
|
|
172
|
+
...iosBootedMatches.map((s) => ({ name: s.name, platform: "ios", identifier: s.udid })),
|
|
173
|
+
...androidRunningMatches.map((e) => ({ name: e.name, platform: "android", identifier: e.serial ?? e.name })),
|
|
174
|
+
...androidPhysicalMatches.map((p) => ({ name: p.model, platform: "android", identifier: p.serial }))
|
|
175
|
+
];
|
|
176
|
+
return err("MULTIPLE_DEVICES_MATCH", `"${trimmed}" matches multiple devices. Pass a UDID or adb serial to disambiguate.`, candidates);
|
|
177
|
+
}
|
|
178
|
+
return err("DEVICE_NOT_FOUND", `"${trimmed}" did not match any connected RN app, booted simulator, or attached Android device. Call list_devices to enumerate options.`);
|
|
179
|
+
}
|
|
180
|
+
// Step 5: No `device` argument — pick the single available device.
|
|
181
|
+
const bootedSims = inv.ios.simulators.filter((s) => s.state === "booted");
|
|
182
|
+
const runningEmus = inv.android.emulators.filter((e) => e.state === "running");
|
|
183
|
+
const onlinePhys = inv.android.physical.filter((p) => p.state === "device");
|
|
184
|
+
const totalRunning = bootedSims.length + runningEmus.length + onlinePhys.length;
|
|
185
|
+
if (totalRunning === 0) {
|
|
186
|
+
// Final fallback: if a single RN app is connected (e.g. physical iOS
|
|
187
|
+
// not in simctl), use it.
|
|
188
|
+
const apps = getConnectedApps();
|
|
189
|
+
if (apps.length === 1) {
|
|
190
|
+
const m = apps[0].app;
|
|
191
|
+
return ok({
|
|
192
|
+
platform: m.platform,
|
|
193
|
+
iosUdid: m.simulatorUdid,
|
|
194
|
+
androidSerial: m.adbSerial,
|
|
195
|
+
deviceName: m.deviceInfo.deviceName,
|
|
196
|
+
source: "default"
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return err("NO_DEVICES_FOUND", "No devices found. Boot an iOS simulator or start an Android emulator, then retry.");
|
|
200
|
+
}
|
|
201
|
+
if (totalRunning > 1) {
|
|
202
|
+
const candidates = [
|
|
203
|
+
...bootedSims.map((s) => ({ name: s.name, platform: "ios", identifier: s.udid })),
|
|
204
|
+
...runningEmus.map((e) => ({ name: e.name, platform: "android", identifier: e.serial ?? e.name })),
|
|
205
|
+
...onlinePhys.map((p) => ({ name: p.model, platform: "android", identifier: p.serial }))
|
|
206
|
+
];
|
|
207
|
+
return err("MULTIPLE_DEVICES_MATCH", "Multiple devices available. Specify device='...'. Call list_devices to enumerate.", candidates);
|
|
208
|
+
}
|
|
209
|
+
if (bootedSims.length === 1) {
|
|
210
|
+
const s = bootedSims[0];
|
|
211
|
+
return ok({ platform: "ios", iosUdid: s.udid, deviceName: s.name, source: "default" });
|
|
212
|
+
}
|
|
213
|
+
if (runningEmus.length === 1) {
|
|
214
|
+
const e = runningEmus[0];
|
|
215
|
+
return ok({
|
|
216
|
+
platform: "android",
|
|
217
|
+
androidSerial: e.serial ?? undefined,
|
|
218
|
+
deviceName: e.name,
|
|
219
|
+
source: "default"
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const p = onlinePhys[0];
|
|
223
|
+
return ok({ platform: "android", androidSerial: p.serial, deviceName: p.model, source: "default" });
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=deviceResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceResolver.js","sourceRoot":"","sources":["../../src/core/deviceResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkCtD,MAAM,UAAU,GAAG,iEAAiE,CAAC;AACrF,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAE1C;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAgC;IACnD,IAAI,CAAC,KAAK;QAAE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AAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,EAAE,CAAC;YACN,QAAQ,EAAE,SAAS;YACnB,aAAa,EAAE,CAAC,CAAC,MAAM,IAAI,SAAS;YACpC,UAAU,EAAE,CAAC,CAAC,IAAI;YAClB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Screen Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses React Native error screens from OCR text to extract structured error information.
|
|
5
|
+
* Used as fallback when CDP connection cannot be established due to bundle errors.
|
|
6
|
+
*/
|
|
7
|
+
import { BundleError } from "./bundle.js";
|
|
8
|
+
/**
|
|
9
|
+
* Result of parsing an error screen
|
|
10
|
+
*/
|
|
11
|
+
export interface ParsedErrorScreen {
|
|
12
|
+
found: boolean;
|
|
13
|
+
error?: BundleError;
|
|
14
|
+
rawText?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse OCR text from a React Native error screen (red screen of death)
|
|
18
|
+
*
|
|
19
|
+
* Common error formats:
|
|
20
|
+
* - "Unable to resolve \"@/module\" from \"path/to/file.ts\""
|
|
21
|
+
* - "SyntaxError: ..."
|
|
22
|
+
* - "TransformError: ..."
|
|
23
|
+
* - "Error: ..."
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseErrorScreenText(ocrText: string): ParsedErrorScreen;
|
|
26
|
+
/**
|
|
27
|
+
* Format parsed error for display
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatParsedError(parsed: ParsedErrorScreen): string;
|
|
30
|
+
//# sourceMappingURL=errorScreenParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorScreenParser.d.ts","sourceRoot":"","sources":["../../src/core/errorScreenParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CA2FvE;AAiGD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAgCnE"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Screen Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses React Native error screens from OCR text to extract structured error information.
|
|
5
|
+
* Used as fallback when CDP connection cannot be established due to bundle errors.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse OCR text from a React Native error screen (red screen of death)
|
|
9
|
+
*
|
|
10
|
+
* Common error formats:
|
|
11
|
+
* - "Unable to resolve \"@/module\" from \"path/to/file.ts\""
|
|
12
|
+
* - "SyntaxError: ..."
|
|
13
|
+
* - "TransformError: ..."
|
|
14
|
+
* - "Error: ..."
|
|
15
|
+
*/
|
|
16
|
+
export function parseErrorScreenText(ocrText) {
|
|
17
|
+
if (!ocrText || ocrText.trim().length === 0) {
|
|
18
|
+
return { found: false };
|
|
19
|
+
}
|
|
20
|
+
const normalizedText = normalizeOcrText(ocrText);
|
|
21
|
+
// Check if this looks like an error screen
|
|
22
|
+
if (!looksLikeErrorScreen(normalizedText)) {
|
|
23
|
+
return { found: false, rawText: ocrText };
|
|
24
|
+
}
|
|
25
|
+
const error = {
|
|
26
|
+
timestamp: new Date(),
|
|
27
|
+
type: "other",
|
|
28
|
+
message: ""
|
|
29
|
+
};
|
|
30
|
+
// Try to parse different error types
|
|
31
|
+
// 1. Module resolution errors: "Unable to resolve \"module\" from \"file\""
|
|
32
|
+
const resolutionMatch = normalizedText.match(/unable\s+to\s+resolve\s+["']([^"']+)["']\s+from\s+["']([^"']+)["']/i);
|
|
33
|
+
if (resolutionMatch) {
|
|
34
|
+
error.type = "resolution";
|
|
35
|
+
error.message = `Unable to resolve "${resolutionMatch[1]}"`;
|
|
36
|
+
error.file = resolutionMatch[2];
|
|
37
|
+
// Try to extract import stack
|
|
38
|
+
error.importStack = extractImportStack(normalizedText);
|
|
39
|
+
return { found: true, error, rawText: ocrText };
|
|
40
|
+
}
|
|
41
|
+
// 2. Syntax errors
|
|
42
|
+
const syntaxMatch = normalizedText.match(/syntax\s*error[:\s]+(.+?)(?:\n|$)/i);
|
|
43
|
+
if (syntaxMatch) {
|
|
44
|
+
error.type = "syntax";
|
|
45
|
+
error.message = `SyntaxError: ${syntaxMatch[1].trim()}`;
|
|
46
|
+
// Try to extract file location
|
|
47
|
+
const locationInfo = extractFileLocation(normalizedText);
|
|
48
|
+
if (locationInfo) {
|
|
49
|
+
error.file = locationInfo.file;
|
|
50
|
+
error.line = locationInfo.line;
|
|
51
|
+
error.column = locationInfo.column;
|
|
52
|
+
}
|
|
53
|
+
return { found: true, error, rawText: ocrText };
|
|
54
|
+
}
|
|
55
|
+
// 3. Transform errors (Babel/Metro transforms)
|
|
56
|
+
const transformMatch = normalizedText.match(/transform\s*error[:\s]+(.+?)(?:\n|$)/i);
|
|
57
|
+
if (transformMatch) {
|
|
58
|
+
error.type = "transform";
|
|
59
|
+
error.message = `TransformError: ${transformMatch[1].trim()}`;
|
|
60
|
+
const locationInfo = extractFileLocation(normalizedText);
|
|
61
|
+
if (locationInfo) {
|
|
62
|
+
error.file = locationInfo.file;
|
|
63
|
+
error.line = locationInfo.line;
|
|
64
|
+
error.column = locationInfo.column;
|
|
65
|
+
}
|
|
66
|
+
return { found: true, error, rawText: ocrText };
|
|
67
|
+
}
|
|
68
|
+
// 4. Generic error pattern: "Error: message"
|
|
69
|
+
const errorMatch = normalizedText.match(/error[:\s]+(.+?)(?:\n|$)/i);
|
|
70
|
+
if (errorMatch) {
|
|
71
|
+
error.message = errorMatch[1].trim();
|
|
72
|
+
const locationInfo = extractFileLocation(normalizedText);
|
|
73
|
+
if (locationInfo) {
|
|
74
|
+
error.file = locationInfo.file;
|
|
75
|
+
error.line = locationInfo.line;
|
|
76
|
+
error.column = locationInfo.column;
|
|
77
|
+
}
|
|
78
|
+
return { found: true, error, rawText: ocrText };
|
|
79
|
+
}
|
|
80
|
+
// 5. Fallback: use the entire text as the error message
|
|
81
|
+
// Truncate if too long
|
|
82
|
+
const maxLength = 500;
|
|
83
|
+
error.message = normalizedText.length > maxLength
|
|
84
|
+
? normalizedText.substring(0, maxLength) + "..."
|
|
85
|
+
: normalizedText;
|
|
86
|
+
return { found: true, error, rawText: ocrText };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Normalize OCR text by fixing common OCR errors and standardizing whitespace
|
|
90
|
+
*/
|
|
91
|
+
function normalizeOcrText(text) {
|
|
92
|
+
return text
|
|
93
|
+
// Replace multiple whitespace with single space
|
|
94
|
+
.replace(/\s+/g, " ")
|
|
95
|
+
// Fix common OCR misreadings
|
|
96
|
+
.replace(/[|l]mport/gi, "import")
|
|
97
|
+
.replace(/reso[|l]ve/gi, "resolve")
|
|
98
|
+
.replace(/unab[|l]e/gi, "unable")
|
|
99
|
+
.replace(/modu[|l]e/gi, "module")
|
|
100
|
+
// Normalize quotes
|
|
101
|
+
.replace(/[""'']/g, '"')
|
|
102
|
+
.trim();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Check if OCR text looks like a React Native error screen
|
|
106
|
+
*/
|
|
107
|
+
function looksLikeErrorScreen(text) {
|
|
108
|
+
const lowerText = text.toLowerCase();
|
|
109
|
+
const errorIndicators = [
|
|
110
|
+
"error",
|
|
111
|
+
"unable to resolve",
|
|
112
|
+
"syntax error",
|
|
113
|
+
"transform error",
|
|
114
|
+
"bundling failed",
|
|
115
|
+
"metro has encountered an error",
|
|
116
|
+
"failed to construct",
|
|
117
|
+
"unexpected token",
|
|
118
|
+
"module not found",
|
|
119
|
+
"cannot find module",
|
|
120
|
+
"import stack",
|
|
121
|
+
".tsx",
|
|
122
|
+
".ts",
|
|
123
|
+
".js",
|
|
124
|
+
".jsx"
|
|
125
|
+
];
|
|
126
|
+
return errorIndicators.some(indicator => lowerText.includes(indicator));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Extract file location (file:line:column) from text
|
|
130
|
+
*/
|
|
131
|
+
function extractFileLocation(text) {
|
|
132
|
+
// Pattern: /path/to/file.tsx:123:45 or /path/to/file.tsx:123
|
|
133
|
+
const locationMatch = text.match(/([a-zA-Z0-9_\-./\\@]+\.(tsx?|jsx?|mjs|cjs)):(\d+)(?::(\d+))?/i);
|
|
134
|
+
if (locationMatch) {
|
|
135
|
+
return {
|
|
136
|
+
file: locationMatch[1],
|
|
137
|
+
line: parseInt(locationMatch[3], 10),
|
|
138
|
+
column: locationMatch[4] ? parseInt(locationMatch[4], 10) : undefined
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Try to find just a file path
|
|
142
|
+
const fileMatch = text.match(/([a-zA-Z0-9_\-./\\@]+\.(tsx?|jsx?|mjs|cjs))/i);
|
|
143
|
+
if (fileMatch) {
|
|
144
|
+
return { file: fileMatch[1] };
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Extract import stack from error text
|
|
150
|
+
*/
|
|
151
|
+
function extractImportStack(text) {
|
|
152
|
+
const stack = [];
|
|
153
|
+
// Look for patterns like:
|
|
154
|
+
// - "import from file.tsx"
|
|
155
|
+
// - "app/hooks/useAuth.ts"
|
|
156
|
+
// - file references in the text
|
|
157
|
+
const filePattern = /([a-zA-Z0-9_\-./\\@]+\.(tsx?|jsx?|mjs|cjs))/gi;
|
|
158
|
+
let match;
|
|
159
|
+
while ((match = filePattern.exec(text)) !== null) {
|
|
160
|
+
const file = match[1];
|
|
161
|
+
// Avoid duplicates
|
|
162
|
+
if (!stack.includes(file)) {
|
|
163
|
+
stack.push(file);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return stack.length > 0 ? stack : undefined;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Format parsed error for display
|
|
170
|
+
*/
|
|
171
|
+
export function formatParsedError(parsed) {
|
|
172
|
+
if (!parsed.found || !parsed.error) {
|
|
173
|
+
return "No error detected in screenshot.";
|
|
174
|
+
}
|
|
175
|
+
const { error } = parsed;
|
|
176
|
+
const lines = [];
|
|
177
|
+
lines.push(`[Screenshot OCR] ${error.type.toUpperCase()} ERROR`);
|
|
178
|
+
lines.push(`Message: ${error.message}`);
|
|
179
|
+
if (error.file) {
|
|
180
|
+
let location = `File: ${error.file}`;
|
|
181
|
+
if (error.line) {
|
|
182
|
+
location += `:${error.line}`;
|
|
183
|
+
if (error.column) {
|
|
184
|
+
location += `:${error.column}`;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
lines.push(location);
|
|
188
|
+
}
|
|
189
|
+
if (error.importStack && error.importStack.length > 0) {
|
|
190
|
+
lines.push("\nImport Stack:");
|
|
191
|
+
error.importStack.forEach(imp => {
|
|
192
|
+
lines.push(` - ${imp}`);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
lines.push("\n(Captured via screenshot OCR fallback)");
|
|
196
|
+
return lines.join("\n");
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=errorScreenParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorScreenParser.js","sourceRoot":"","sources":["../../src/core/err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AW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IAEvD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker class for errors caused by invalid agent input (wrong device name,
|
|
3
|
+
* missing required predicate, ambiguous match, etc). H2 (Step 9 in the
|
|
4
|
+
* 2026-05-15 plan): the top-level catch in index.ts skips PostHog
|
|
5
|
+
* captureException for these so error tracking surfaces real product bugs,
|
|
6
|
+
* not validation noise (~13% of recent dashboard volume).
|
|
7
|
+
*
|
|
8
|
+
* The trade-off vs regex-matching the message: this is self-documenting at
|
|
9
|
+
* the throw site and survives message reformatting / translation.
|
|
10
|
+
*/
|
|
11
|
+
export declare class UserInputError extends Error {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker class for errors caused by invalid agent input (wrong device name,
|
|
3
|
+
* missing required predicate, ambiguous match, etc). H2 (Step 9 in the
|
|
4
|
+
* 2026-05-15 plan): the top-level catch in index.ts skips PostHog
|
|
5
|
+
* captureException for these so error tracking surfaces real product bugs,
|
|
6
|
+
* not validation noise (~13% of recent dashboard volume).
|
|
7
|
+
*
|
|
8
|
+
* The trade-off vs regex-matching the message: this is self-documenting at
|
|
9
|
+
* the throw site and survives message reformatting / translation.
|
|
10
|
+
*/
|
|
11
|
+
export class UserInputError extends Error {
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = "UserInputError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACrC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IACjC,CAAC;CACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type EscapeResult = {
|
|
2
|
+
ok: true;
|
|
3
|
+
expression: string;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
reason: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Walk a JS source string and rewrite non-ASCII-printable code points that
|
|
10
|
+
* occur inside string literals (single quote, double quote, template literal
|
|
11
|
+
* cooked body) to \uXXXX or \u{XXXXX} escape sequences. Code in regular
|
|
12
|
+
* expression bodies, comments, identifiers, and template-literal `${...}`
|
|
13
|
+
* substitution expressions is left untouched.
|
|
14
|
+
*
|
|
15
|
+
* Returns a structured error on unbalanced quotes / unterminated literals.
|
|
16
|
+
*/
|
|
17
|
+
export declare function escapeNonAsciiInStringLiterals(src: string): EscapeResult;
|
|
18
|
+
//# sourceMappingURL=escapeNonAscii.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeNonAscii.d.ts","sourceRoot":"","sources":["../../src/core/escapeNonAscii.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA4B5F;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAuVxE"}
|