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,603 @@
|
|
|
1
|
+
import { executeInApp } from "./jsExecute.js";
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// Coordinate-Based Element Inspection (via DevTools Inspector API)
|
|
4
|
+
// ============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Toggle the Element Inspector via DevSettings native module.
|
|
7
|
+
* This enables the inspector overlay programmatically.
|
|
8
|
+
*/
|
|
9
|
+
export async function toggleElementInspector(device) {
|
|
10
|
+
const expression = `
|
|
11
|
+
(function() {
|
|
12
|
+
const ds = globalThis.nativeModuleProxy?.DevSettings;
|
|
13
|
+
if (!ds) return { error: 'DevSettings not available' };
|
|
14
|
+
|
|
15
|
+
const proto = Object.getPrototypeOf(ds);
|
|
16
|
+
if (!proto || typeof proto.toggleElementInspector !== 'function') {
|
|
17
|
+
return { error: 'toggleElementInspector not found' };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
proto.toggleElementInspector.call(ds);
|
|
22
|
+
return { success: true, message: 'Element Inspector toggled' };
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return { error: 'Failed to toggle: ' + e.message };
|
|
25
|
+
}
|
|
26
|
+
})()
|
|
27
|
+
`;
|
|
28
|
+
return executeInApp(expression, false, { originatingToolName: "toggle_element_inspector" }, device);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if the Element Inspector overlay is currently active.
|
|
32
|
+
*/
|
|
33
|
+
export async function isInspectorActive(device) {
|
|
34
|
+
const expression = `
|
|
35
|
+
(function() {
|
|
36
|
+
const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
37
|
+
if (!hook) return false;
|
|
38
|
+
|
|
39
|
+
let roots = [...(hook.getFiberRoots?.(1) || [])];
|
|
40
|
+
if (roots.length === 0) {
|
|
41
|
+
for (const [id] of (hook.renderers || [])) {
|
|
42
|
+
roots = [...(hook.getFiberRoots?.(id) || [])];
|
|
43
|
+
if (roots.length > 0) break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (roots.length === 0) return false;
|
|
47
|
+
|
|
48
|
+
function findComponent(fiber, targetName, depth = 0) {
|
|
49
|
+
if (!fiber || depth > 5000) return null;
|
|
50
|
+
const name = fiber.type?.displayName || fiber.type?.name;
|
|
51
|
+
if (name === targetName) return fiber;
|
|
52
|
+
let child = fiber.child;
|
|
53
|
+
while (child) {
|
|
54
|
+
const found = findComponent(child, targetName, depth + 1);
|
|
55
|
+
if (found) return found;
|
|
56
|
+
child = child.sibling;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return !!findComponent(roots[0].current, 'InspectorPanel');
|
|
62
|
+
})()
|
|
63
|
+
`;
|
|
64
|
+
const result = await executeInApp(expression, false, { originatingToolName: "is_inspector_active" }, device);
|
|
65
|
+
if (result.success && result.result) {
|
|
66
|
+
return result.result === "true";
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the currently selected element from the Element Inspector overlay.
|
|
72
|
+
* This reads the InspectorPanel component's props to get the hierarchy, frame, and style.
|
|
73
|
+
* Requires the Element Inspector to be enabled and an element to be selected.
|
|
74
|
+
*/
|
|
75
|
+
export async function getInspectorSelection(device) {
|
|
76
|
+
const expression = `
|
|
77
|
+
(function() {
|
|
78
|
+
const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
79
|
+
if (!hook) return { error: 'React DevTools hook not available.' };
|
|
80
|
+
|
|
81
|
+
// Find fiber roots
|
|
82
|
+
let roots = [...(hook.getFiberRoots?.(1) || [])];
|
|
83
|
+
if (roots.length === 0) {
|
|
84
|
+
for (const [id] of (hook.renderers || [])) {
|
|
85
|
+
roots = [...(hook.getFiberRoots?.(id) || [])];
|
|
86
|
+
if (roots.length > 0) break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (roots.length === 0) return { error: 'No fiber roots found.' };
|
|
90
|
+
|
|
91
|
+
// Find all InspectorPanel instances (apps with modals may have multiple)
|
|
92
|
+
function findAllPanels(fiber, targetName, depth, results) {
|
|
93
|
+
if (!fiber || depth > 5000) return;
|
|
94
|
+
const name = fiber.type?.displayName || fiber.type?.name;
|
|
95
|
+
if (name === targetName) results.push(fiber);
|
|
96
|
+
let child = fiber.child;
|
|
97
|
+
while (child) {
|
|
98
|
+
findAllPanels(child, targetName, depth + 1, results);
|
|
99
|
+
child = child.sibling;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const panels = [];
|
|
104
|
+
findAllPanels(roots[0].current, 'InspectorPanel', 0, panels);
|
|
105
|
+
if (panels.length === 0) {
|
|
106
|
+
return {
|
|
107
|
+
error: 'Element Inspector is not active.',
|
|
108
|
+
hint: 'Use toggle_element_inspector to enable the inspector, then tap an element to select it.'
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Prefer the panel that has an active selection
|
|
113
|
+
const panelFiber = panels.find(p => p.memoizedProps.hierarchy?.length > 0) || panels[0];
|
|
114
|
+
const props = panelFiber.memoizedProps;
|
|
115
|
+
if (!props.hierarchy || props.hierarchy.length === 0) {
|
|
116
|
+
return {
|
|
117
|
+
error: 'No element selected.',
|
|
118
|
+
hint: 'Tap on an element in the app to select it for inspection.'
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Build the path from hierarchy
|
|
123
|
+
const path = props.hierarchy.map(h => h.name).join(' > ');
|
|
124
|
+
const element = props.hierarchy[props.hierarchy.length - 1]?.name || 'Unknown';
|
|
125
|
+
|
|
126
|
+
// Extract style info
|
|
127
|
+
let style = {};
|
|
128
|
+
if (props.inspected?.style) {
|
|
129
|
+
const styles = Array.isArray(props.inspected.style)
|
|
130
|
+
? props.inspected.style
|
|
131
|
+
: [props.inspected.style];
|
|
132
|
+
for (const s of styles) {
|
|
133
|
+
if (s && typeof s === 'object') {
|
|
134
|
+
Object.assign(style, s);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
element,
|
|
141
|
+
path,
|
|
142
|
+
frame: props.inspected?.frame || null,
|
|
143
|
+
style: Object.keys(style).length > 0 ? style : null,
|
|
144
|
+
selection: props.selection,
|
|
145
|
+
hierarchyLength: props.hierarchy.length
|
|
146
|
+
};
|
|
147
|
+
})()
|
|
148
|
+
`;
|
|
149
|
+
return executeInApp(expression, false, { originatingToolName: "get_inspector_selection" }, device);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolve the component at (x, y) using RN's built-in Element Inspector.
|
|
153
|
+
*
|
|
154
|
+
* Strategy: programmatically toggle the inspector overlay on (if needed),
|
|
155
|
+
* then call InspectorOverlay.props.onTouchPoint(x, y) directly — bypassing
|
|
156
|
+
* the broken adb-tap → PanResponder route on Bridgeless / new-arch RN.
|
|
157
|
+
* This populates InspectorPanel with RN's full curated hierarchy, the
|
|
158
|
+
* inspected element's frame, and per-component style data (margin, padding,
|
|
159
|
+
* border, layout) — exactly what the on-device overlay shows.
|
|
160
|
+
*
|
|
161
|
+
* Returns the rich hierarchy with style merged from each entry's
|
|
162
|
+
* getInspectorData(...).props.style, plus the inspected frame and style.
|
|
163
|
+
*
|
|
164
|
+
* Auto-hides the overlay after capture so subsequent screenshots stay clean.
|
|
165
|
+
*/
|
|
166
|
+
export async function getInspectorSelectionAtPoint(x, y, device) {
|
|
167
|
+
// Step 1: ensure the inspector overlay is mounted (toggle on if currently off).
|
|
168
|
+
const setupExpression = `
|
|
169
|
+
(function() {
|
|
170
|
+
var ds = globalThis.nativeModuleProxy && globalThis.nativeModuleProxy.DevSettings;
|
|
171
|
+
if (!ds) return { error: 'DevSettings native module not available.' };
|
|
172
|
+
var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
173
|
+
if (!hook) return { error: 'React DevTools hook not available. Make sure you are running a development build.' };
|
|
174
|
+
|
|
175
|
+
function findOverlays() {
|
|
176
|
+
var roots = [];
|
|
177
|
+
if (hook.renderers) {
|
|
178
|
+
for (var entry of hook.renderers) {
|
|
179
|
+
try { roots = roots.concat(Array.from(hook.getFiberRoots(entry[0]) || [])); } catch(e) {}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
var overlays = [];
|
|
183
|
+
function walk(f, d) {
|
|
184
|
+
if (!f || d > 800) return;
|
|
185
|
+
if (f.type && typeof f.type !== 'string' &&
|
|
186
|
+
(f.type.displayName || f.type.name) === 'InspectorOverlay') {
|
|
187
|
+
overlays.push(f);
|
|
188
|
+
}
|
|
189
|
+
var c = f.child;
|
|
190
|
+
while (c) { walk(c, d + 1); c = c.sibling; }
|
|
191
|
+
}
|
|
192
|
+
for (var r of roots) { walk(r.current, 0); }
|
|
193
|
+
return overlays;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var overlays = findOverlays();
|
|
197
|
+
// Two overlays expected when active: one per fiber root (LogBox + app).
|
|
198
|
+
var wasActive = overlays.length >= 2;
|
|
199
|
+
if (!wasActive) {
|
|
200
|
+
var proto = Object.getPrototypeOf(ds);
|
|
201
|
+
if (typeof proto.toggleElementInspector !== 'function') {
|
|
202
|
+
return { error: 'toggleElementInspector not found on DevSettings.' };
|
|
203
|
+
}
|
|
204
|
+
proto.toggleElementInspector.call(ds);
|
|
205
|
+
}
|
|
206
|
+
return { wasActive: wasActive };
|
|
207
|
+
})()
|
|
208
|
+
`;
|
|
209
|
+
const setup = await executeInApp(setupExpression, false, { originatingToolName: "inspect_at_point" }, device);
|
|
210
|
+
if (!setup.success)
|
|
211
|
+
return setup;
|
|
212
|
+
try {
|
|
213
|
+
const parsed = JSON.parse(setup.result || "{}");
|
|
214
|
+
if (parsed.error)
|
|
215
|
+
return { success: false, error: parsed.error };
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
/* ignore */
|
|
219
|
+
}
|
|
220
|
+
// Allow the inspector overlay to mount.
|
|
221
|
+
await new Promise((resolve) => setTimeout(resolve, 350));
|
|
222
|
+
// Step 2: locate the app InspectorOverlay (skip LogBox at index 0) and dispatch onTouchPoint.
|
|
223
|
+
const tapExpression = `
|
|
224
|
+
(function() {
|
|
225
|
+
var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
226
|
+
var roots = [];
|
|
227
|
+
for (var entry of hook.renderers) {
|
|
228
|
+
try { roots = roots.concat(Array.from(hook.getFiberRoots(entry[0]) || [])); } catch(e) {}
|
|
229
|
+
}
|
|
230
|
+
var overlays = [];
|
|
231
|
+
function walk(f, d) {
|
|
232
|
+
if (!f || d > 800) return;
|
|
233
|
+
if (f.type && typeof f.type !== 'string' &&
|
|
234
|
+
(f.type.displayName || f.type.name) === 'InspectorOverlay') {
|
|
235
|
+
overlays.push(f);
|
|
236
|
+
}
|
|
237
|
+
var c = f.child;
|
|
238
|
+
while (c) { walk(c, d + 1); c = c.sibling; }
|
|
239
|
+
}
|
|
240
|
+
for (var r of roots) { walk(r.current, 0); }
|
|
241
|
+
|
|
242
|
+
// The LogBox renderer's overlay is mounted first; the app overlay is the last one.
|
|
243
|
+
var overlay = overlays[overlays.length - 1];
|
|
244
|
+
if (!overlay || !overlay.memoizedProps || typeof overlay.memoizedProps.onTouchPoint !== 'function') {
|
|
245
|
+
return { error: 'InspectorOverlay.onTouchPoint unavailable. Inspector may not be mounted.' };
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
overlay.memoizedProps.onTouchPoint(${x}, ${y});
|
|
249
|
+
} catch (e) {
|
|
250
|
+
return { error: 'onTouchPoint failed: ' + (e && e.message || String(e)) };
|
|
251
|
+
}
|
|
252
|
+
return { ok: true };
|
|
253
|
+
})()
|
|
254
|
+
`;
|
|
255
|
+
const tap = await executeInApp(tapExpression, false, { originatingToolName: "inspect_at_point" }, device);
|
|
256
|
+
if (!tap.success)
|
|
257
|
+
return tap;
|
|
258
|
+
try {
|
|
259
|
+
const parsed = JSON.parse(tap.result || "{}");
|
|
260
|
+
if (parsed.error)
|
|
261
|
+
return { success: false, error: parsed.error };
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
/* ignore */
|
|
265
|
+
}
|
|
266
|
+
// Allow setState/render to propagate before reading panel props.
|
|
267
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
268
|
+
// Step 3: read the populated InspectorPanel and shape the response.
|
|
269
|
+
const readExpression = `
|
|
270
|
+
(function() {
|
|
271
|
+
var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
272
|
+
var roots = [];
|
|
273
|
+
for (var entry of hook.renderers) {
|
|
274
|
+
try { roots = roots.concat(Array.from(hook.getFiberRoots(entry[0]) || [])); } catch(e) {}
|
|
275
|
+
}
|
|
276
|
+
var panels = [];
|
|
277
|
+
function walk(f, d) {
|
|
278
|
+
if (!f || d > 800) return;
|
|
279
|
+
if (f.type && typeof f.type !== 'string' &&
|
|
280
|
+
(f.type.displayName || f.type.name) === 'InspectorPanel') {
|
|
281
|
+
panels.push(f);
|
|
282
|
+
}
|
|
283
|
+
var c = f.child;
|
|
284
|
+
while (c) { walk(c, d + 1); c = c.sibling; }
|
|
285
|
+
}
|
|
286
|
+
for (var r of roots) { walk(r.current, 0); }
|
|
287
|
+
|
|
288
|
+
var withSel = panels.filter(function(p) {
|
|
289
|
+
return p.memoizedProps && p.memoizedProps.hierarchy && p.memoizedProps.hierarchy.length > 0;
|
|
290
|
+
});
|
|
291
|
+
if (withSel.length === 0) {
|
|
292
|
+
return { error: 'Inspector did not select an element at (${x}, ${y}). Coordinates may be outside the app bounds.' };
|
|
293
|
+
}
|
|
294
|
+
var props = withSel[withSel.length - 1].memoizedProps;
|
|
295
|
+
|
|
296
|
+
function flattenStyle(raw) {
|
|
297
|
+
if (!raw) return null;
|
|
298
|
+
var arr = Array.isArray(raw) ? raw : [raw];
|
|
299
|
+
var merged = {};
|
|
300
|
+
for (var i = 0; i < arr.length; i++) {
|
|
301
|
+
var v = arr[i];
|
|
302
|
+
if (v && typeof v === 'object') {
|
|
303
|
+
var keys = Object.keys(v);
|
|
304
|
+
for (var k = 0; k < keys.length; k++) merged[keys[k]] = v[keys[k]];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return Object.keys(merged).length > 0 ? merged : null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var idFn = function(x) { return x; };
|
|
311
|
+
// Build hierarchy with style + source per entry; dedupe consecutive duplicates.
|
|
312
|
+
var hierarchy = [];
|
|
313
|
+
var prevName = null;
|
|
314
|
+
for (var i = 0; i < props.hierarchy.length; i++) {
|
|
315
|
+
var h = props.hierarchy[i];
|
|
316
|
+
var name = h.name;
|
|
317
|
+
if (!name || name === prevName) continue;
|
|
318
|
+
prevName = name;
|
|
319
|
+
var data = h.getInspectorData ? h.getInspectorData(idFn) : null;
|
|
320
|
+
var style = data && data.props ? flattenStyle(data.props.style) : null;
|
|
321
|
+
var entry = { name: name };
|
|
322
|
+
if (style) entry.style = style;
|
|
323
|
+
if (data && data.source && data.source.fileName) {
|
|
324
|
+
entry.source = data.source.fileName + (data.source.lineNumber ? (':' + data.source.lineNumber) : '');
|
|
325
|
+
}
|
|
326
|
+
hierarchy.push(entry);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
var element = hierarchy.length > 0 ? hierarchy[hierarchy.length - 1].name : 'Unknown';
|
|
330
|
+
var path = hierarchy.map(function(e) { return e.name; }).join(' > ') || element;
|
|
331
|
+
|
|
332
|
+
return {
|
|
333
|
+
element: element,
|
|
334
|
+
path: path,
|
|
335
|
+
frame: props.inspected ? props.inspected.frame : null,
|
|
336
|
+
style: props.inspected ? flattenStyle(props.inspected.style) : null,
|
|
337
|
+
hierarchy: hierarchy,
|
|
338
|
+
selection: props.selection
|
|
339
|
+
};
|
|
340
|
+
})()
|
|
341
|
+
`;
|
|
342
|
+
const readResult = await executeInApp(readExpression, false, { originatingToolName: "inspect_at_point" }, device);
|
|
343
|
+
// Step 4: hide the overlay so it doesn't pollute subsequent screenshots.
|
|
344
|
+
// We always hide after a successful capture — agents don't manually toggle.
|
|
345
|
+
const teardownExpression = `
|
|
346
|
+
(function() {
|
|
347
|
+
var ds = globalThis.nativeModuleProxy && globalThis.nativeModuleProxy.DevSettings;
|
|
348
|
+
if (!ds) return { skipped: true };
|
|
349
|
+
var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
350
|
+
if (!hook) return { skipped: true };
|
|
351
|
+
var roots = [];
|
|
352
|
+
for (var entry of hook.renderers) {
|
|
353
|
+
try { roots = roots.concat(Array.from(hook.getFiberRoots(entry[0]) || [])); } catch(e) {}
|
|
354
|
+
}
|
|
355
|
+
var overlays = 0;
|
|
356
|
+
function walk(f, d) {
|
|
357
|
+
if (!f || d > 800) return;
|
|
358
|
+
if (f.type && typeof f.type !== 'string' &&
|
|
359
|
+
(f.type.displayName || f.type.name) === 'InspectorOverlay') overlays++;
|
|
360
|
+
var c = f.child;
|
|
361
|
+
while (c) { walk(c, d + 1); c = c.sibling; }
|
|
362
|
+
}
|
|
363
|
+
for (var r of roots) { walk(r.current, 0); }
|
|
364
|
+
if (overlays >= 2) {
|
|
365
|
+
try { Object.getPrototypeOf(ds).toggleElementInspector.call(ds); } catch(e) {}
|
|
366
|
+
}
|
|
367
|
+
return { ok: true };
|
|
368
|
+
})()
|
|
369
|
+
`;
|
|
370
|
+
try {
|
|
371
|
+
await executeInApp(teardownExpression, false, { originatingToolName: "inspect_at_point" }, device);
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
/* best-effort hide; don't fail the call */
|
|
375
|
+
}
|
|
376
|
+
return readResult;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Inspect the React component at a specific (x, y) coordinate.
|
|
380
|
+
*
|
|
381
|
+
* Works on both Paper and Fabric (New Architecture). Walks the fiber tree,
|
|
382
|
+
* fires measureInWindow on each host component, and resolves a Promise once
|
|
383
|
+
* either all callbacks have reported or a 300 ms timeout elapses — then
|
|
384
|
+
* hit-tests against the target coordinates and returns the innermost match.
|
|
385
|
+
*
|
|
386
|
+
* The whole flow happens inside a single Runtime.evaluate with awaitPromise.
|
|
387
|
+
* An earlier two-call design (dispatch → wait 300ms → resolve, bridged via
|
|
388
|
+
* globalThis.__inspectFibers/Measurements) was racy: any JS-context reset
|
|
389
|
+
* between the calls — Fast Refresh full-reload, CDP auto-reconnect landing
|
|
390
|
+
* on a different pageId — wiped the globals and surfaced as the cryptic
|
|
391
|
+
* "No measurement data available. Run inspect_at_point again." error
|
|
392
|
+
* (~13 events / 2 days, all on RN 1.10.0). Collapsing into one call closes
|
|
393
|
+
* that window by construction.
|
|
394
|
+
*/
|
|
395
|
+
export async function inspectAtPoint(x, y, options = {}) {
|
|
396
|
+
const { includeProps = true, includeFrame = true, device } = options;
|
|
397
|
+
const expression = `
|
|
398
|
+
new Promise(function(resolve) {
|
|
399
|
+
var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
400
|
+
if (!hook) return resolve({ error: 'React DevTools hook not available. Make sure you are running a development build.' });
|
|
401
|
+
|
|
402
|
+
var roots = [];
|
|
403
|
+
if (hook.getFiberRoots) {
|
|
404
|
+
try { roots = Array.from(hook.getFiberRoots(1) || []); } catch(e) {}
|
|
405
|
+
}
|
|
406
|
+
if (roots.length === 0 && hook.renderers) {
|
|
407
|
+
for (var entry of hook.renderers) {
|
|
408
|
+
try {
|
|
409
|
+
var r = Array.from(hook.getFiberRoots ? (hook.getFiberRoots(entry[0]) || []) : []);
|
|
410
|
+
if (r.length > 0) { roots = r; break; }
|
|
411
|
+
} catch(e) {}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (roots.length === 0) return resolve({ error: 'No fiber roots found. The app may not have rendered yet.' });
|
|
415
|
+
|
|
416
|
+
// Paper: measureInWindow is on stateNode directly.
|
|
417
|
+
// Fabric: measureInWindow is on stateNode.canonical.publicInstance.
|
|
418
|
+
function getMeasurable(fiber) {
|
|
419
|
+
var sn = fiber.stateNode;
|
|
420
|
+
if (!sn) return null;
|
|
421
|
+
if (typeof sn.measureInWindow === 'function') return sn;
|
|
422
|
+
if (sn.canonical && sn.canonical.publicInstance &&
|
|
423
|
+
typeof sn.canonical.publicInstance.measureInWindow === 'function') {
|
|
424
|
+
return sn.canonical.publicInstance;
|
|
425
|
+
}
|
|
426
|
+
// Fabric leaf nodes like RCTText have no publicInstance. Measure via
|
|
427
|
+
// the native Fabric UIManager using the shadow node instead — needed
|
|
428
|
+
// for text bounds that are tight around the glyphs (not the scroll
|
|
429
|
+
// container the text happens to live inside).
|
|
430
|
+
if (sn.node && globalThis.nativeFabricUIManager &&
|
|
431
|
+
typeof globalThis.nativeFabricUIManager.measureInWindow === 'function') {
|
|
432
|
+
var node = sn.node;
|
|
433
|
+
return {
|
|
434
|
+
measureInWindow: function(cb) {
|
|
435
|
+
try { globalThis.nativeFabricUIManager.measureInWindow(node, cb); } catch(e) {}
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
var hostFibers = [];
|
|
443
|
+
function walkFibers(fiber, depth) {
|
|
444
|
+
var cur = fiber;
|
|
445
|
+
while (cur) {
|
|
446
|
+
if (hostFibers.length >= 500) return;
|
|
447
|
+
if (typeof cur.type === 'string' && getMeasurable(cur)) hostFibers.push(cur);
|
|
448
|
+
if (cur.child && depth < 250) walkFibers(cur.child, depth + 1);
|
|
449
|
+
cur = cur.sibling;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
for (var root of roots) { walkFibers(root.current, 0); }
|
|
453
|
+
|
|
454
|
+
if (hostFibers.length === 0) return resolve({ error: 'No measurable host components found. App may not be fully rendered.' });
|
|
455
|
+
|
|
456
|
+
var measurements = new Array(hostFibers.length).fill(null);
|
|
457
|
+
var pending = hostFibers.length;
|
|
458
|
+
var settled = false;
|
|
459
|
+
|
|
460
|
+
function done() {
|
|
461
|
+
if (settled) return;
|
|
462
|
+
settled = true;
|
|
463
|
+
resolve(buildResult(hostFibers, measurements));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
hostFibers.forEach(function(fiber, i) {
|
|
467
|
+
try {
|
|
468
|
+
getMeasurable(fiber).measureInWindow(function(fx, fy, fw, fh) {
|
|
469
|
+
measurements[i] = { x: fx, y: fy, width: fw, height: fh };
|
|
470
|
+
if (--pending === 0) done();
|
|
471
|
+
});
|
|
472
|
+
} catch(e) {
|
|
473
|
+
// Subtract from pending so a throwing measureInWindow doesn't stall the
|
|
474
|
+
// 'all callbacks fired' path. Slot stays null; hit-test ignores nulls.
|
|
475
|
+
if (--pending === 0) done();
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// Fallback: some measureInWindow callbacks never fire (off-screen Fabric leaves,
|
|
480
|
+
// detached ScrollView content). Resolve with whatever measurements landed in 300ms.
|
|
481
|
+
setTimeout(done, 300);
|
|
482
|
+
|
|
483
|
+
function buildResult(fibers, measurements) {
|
|
484
|
+
var targetX = ${x};
|
|
485
|
+
var targetY = ${y};
|
|
486
|
+
|
|
487
|
+
var hits = [];
|
|
488
|
+
for (var i = 0; i < measurements.length; i++) {
|
|
489
|
+
var m = measurements[i];
|
|
490
|
+
if (m && m.width > 0 && m.height > 0 &&
|
|
491
|
+
targetX >= m.x && targetX <= m.x + m.width &&
|
|
492
|
+
targetY >= m.y && targetY <= m.y + m.height) {
|
|
493
|
+
hits.push({ fiber: fibers[i], x: m.x, y: m.y, width: m.width, height: m.height });
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (hits.length === 0) {
|
|
498
|
+
return { point: { x: targetX, y: targetY }, error: 'No component found at this point. Coordinates may be outside the app bounds or over a native-only element.' };
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Smallest area = innermost (most specific) component
|
|
502
|
+
hits.sort(function(a, b) { return (a.width * a.height) - (b.width * b.height); });
|
|
503
|
+
var best = hits[0];
|
|
504
|
+
|
|
505
|
+
// RN primitives and internal components to skip when surfacing the "element" name.
|
|
506
|
+
// We want the nearest *custom* component, not a library wrapper.
|
|
507
|
+
var RN_PRIMITIVES = /^(View|Text|Image|ScrollView|FlatList|SectionList|TextInput|TouchableOpacity|TouchableHighlight|TouchableNativeFeedback|TouchableWithoutFeedback|Pressable|Button|Switch|ActivityIndicator|SafeAreaView|KeyboardAvoidingView|Animated\\(.*|withAnimated.*|ForwardRef.*|memo\\(.*|Context\\.Consumer|Context\\.Provider|VirtualizedList.*|CellRenderer.*|FrameSizeProvider|MaybeScreenContainer|RCT.*|RNS.*|Navigation.*|Screen$|ScreenStack|ScreenContainer|ScreenContentWrapper|SceneView|DelayedFreeze|Freeze|Suspender|DebugContainer|StaticContainer|Expo.*|LinearGradient|ViewManagerAdapter_.*|Svg.*|Defs|Path|Rect|Circle|G|Line|Polygon|Polyline|Ellipse|ClipPath|GestureHandler.*|NativeViewGestureHandler|Reanimated.*|BottomTabNavigator|TabLayout|RouteNode|Route$|MaybeScreen|SafeAreaProvider.*|GestureDetector|PanGestureHandler|DropShadow|BlurView|MaskedView.*)$/;
|
|
508
|
+
|
|
509
|
+
function getNearestNamed(fiber, skipPrimitives) {
|
|
510
|
+
var cur = fiber;
|
|
511
|
+
var fallback = null;
|
|
512
|
+
while (cur) {
|
|
513
|
+
if (cur.type && typeof cur.type !== 'string') {
|
|
514
|
+
var name = cur.type.displayName || cur.type.name;
|
|
515
|
+
if (name) {
|
|
516
|
+
if (!fallback) fallback = { name: name, fiber: cur };
|
|
517
|
+
if (!skipPrimitives || !RN_PRIMITIVES.test(name)) {
|
|
518
|
+
return { name: name, fiber: cur };
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
cur = cur.return;
|
|
523
|
+
}
|
|
524
|
+
return fallback;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function buildPath(fiber) {
|
|
528
|
+
var path = [];
|
|
529
|
+
var cur = fiber;
|
|
530
|
+
while (cur) {
|
|
531
|
+
if (cur.type) {
|
|
532
|
+
var n = typeof cur.type === 'string'
|
|
533
|
+
? cur.type
|
|
534
|
+
: (cur.type.displayName || cur.type.name);
|
|
535
|
+
if (n) path.unshift(n);
|
|
536
|
+
}
|
|
537
|
+
cur = cur.return;
|
|
538
|
+
}
|
|
539
|
+
return path.slice(-8).join(' > ');
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Find nearest custom component (skipping RN primitives) for the element name,
|
|
543
|
+
// but fall back to the nearest named component if nothing custom is found.
|
|
544
|
+
var named = getNearestNamed(best.fiber.return || best.fiber, true);
|
|
545
|
+
var result = {
|
|
546
|
+
point: { x: targetX, y: targetY },
|
|
547
|
+
element: named ? named.name : best.fiber.type,
|
|
548
|
+
nativeElement: best.fiber.type,
|
|
549
|
+
path: buildPath(best.fiber)
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
if (${includeFrame}) {
|
|
553
|
+
result.frame = { x: best.x, y: best.y, width: best.width, height: best.height };
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (${includeProps} && named && named.fiber.memoizedProps) {
|
|
557
|
+
var props = {};
|
|
558
|
+
var keys = Object.keys(named.fiber.memoizedProps);
|
|
559
|
+
for (var i = 0; i < keys.length; i++) {
|
|
560
|
+
var key = keys[i];
|
|
561
|
+
if (key === 'children') continue;
|
|
562
|
+
var val = named.fiber.memoizedProps[key];
|
|
563
|
+
if (typeof val === 'function') {
|
|
564
|
+
props[key] = '[Function]';
|
|
565
|
+
} else if (typeof val === 'object' && val !== null) {
|
|
566
|
+
try {
|
|
567
|
+
var str = JSON.stringify(val);
|
|
568
|
+
props[key] = str.length > 200
|
|
569
|
+
? (Array.isArray(val) ? '[Array(' + val.length + ')]' : '[Object]')
|
|
570
|
+
: val;
|
|
571
|
+
} catch(e) {
|
|
572
|
+
props[key] = '[Object]';
|
|
573
|
+
}
|
|
574
|
+
} else {
|
|
575
|
+
props[key] = val;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (Object.keys(props).length > 0) result.props = props;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Hierarchy: custom-named component for each hit, deduped, innermost→outermost
|
|
582
|
+
var hierarchy = [];
|
|
583
|
+
for (var j = 0; j < Math.min(hits.length, 15); j++) {
|
|
584
|
+
var n2 = getNearestNamed(hits[j].fiber.return, true) || getNearestNamed(hits[j].fiber, true);
|
|
585
|
+
if (n2 && !hierarchy.some(function(h) { return h.name === n2.name; })) {
|
|
586
|
+
hierarchy.push({
|
|
587
|
+
name: n2.name,
|
|
588
|
+
frame: { x: hits[j].x, y: hits[j].y, width: hits[j].width, height: hits[j].height }
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
if (hierarchy.length > 1) result.hierarchy = hierarchy;
|
|
593
|
+
|
|
594
|
+
return result;
|
|
595
|
+
}
|
|
596
|
+
})
|
|
597
|
+
`;
|
|
598
|
+
// awaitPromise:true so CDP Runtime.evaluate returns the resolved value.
|
|
599
|
+
// 5000ms timeout >> the inner 300ms cap; leaves headroom for slow Fabric
|
|
600
|
+
// measure paths without letting a hung Hermes runtime stall the tool.
|
|
601
|
+
return executeInApp(expression, true, { timeoutMs: 5000, originatingToolName: "inspect_at_point" }, device);
|
|
602
|
+
}
|
|
603
|
+
//# sourceMappingURL=inspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../src/core/inspector.ts"],"names":[],"mappings":"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"}
|