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,588 @@
|
|
|
1
|
+
import { executeInApp, delay } from "./jsExecute.js";
|
|
2
|
+
import { formatSummaryToTonl } from "./screenLayout.js";
|
|
3
|
+
function formatFoundComponentsToTonl(components) {
|
|
4
|
+
const lines = ["#found{component,path,depth,key,layout}"];
|
|
5
|
+
for (const c of components) {
|
|
6
|
+
const layout = c.layout
|
|
7
|
+
? Object.entries(c.layout)
|
|
8
|
+
.map(([k, v]) => `${k}:${v}`)
|
|
9
|
+
.join(";")
|
|
10
|
+
: "";
|
|
11
|
+
lines.push(`${c.component}|${c.path}|${c.depth}|${c.key || ""}|${layout}`);
|
|
12
|
+
}
|
|
13
|
+
return lines.join("\n");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the React component tree from the running app.
|
|
17
|
+
* This traverses the fiber tree to extract component hierarchy with names.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Get layout data for visible components on the current screen.
|
|
21
|
+
* Uses measureInWindow to get actual screen positions and filters
|
|
22
|
+
* to only components within the viewport.
|
|
23
|
+
*
|
|
24
|
+
* Two-step approach (same as inspectAtPoint):
|
|
25
|
+
* Step 1: Walk fiber tree, dispatch measureInWindow on host components
|
|
26
|
+
* Step 2: After 300ms, read measurements, filter by viewport, build results
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Inspect a specific component by name, returning its props, state, and layout.
|
|
30
|
+
*/
|
|
31
|
+
export async function inspectComponent(componentName, options = {}) {
|
|
32
|
+
const { index = 0, includeState = true, includeChildren = false, childrenDepth = 1, includeStyle = false, shortPath = true, simplifyHooks = true, device, timeoutMs } = options;
|
|
33
|
+
const escapedName = componentName.replace(/'/g, "\\'");
|
|
34
|
+
const expression = `
|
|
35
|
+
(function() {
|
|
36
|
+
const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
37
|
+
if (!hook) return { error: 'React DevTools hook not found.' };
|
|
38
|
+
|
|
39
|
+
let roots = [];
|
|
40
|
+
if (hook.getFiberRoots) {
|
|
41
|
+
roots = [...(hook.getFiberRoots(1) || [])];
|
|
42
|
+
}
|
|
43
|
+
if (roots.length === 0 && hook.renderers) {
|
|
44
|
+
for (const [id] of hook.renderers) {
|
|
45
|
+
const r = hook.getFiberRoots ? [...(hook.getFiberRoots(id) || [])] : [];
|
|
46
|
+
if (r.length > 0) { roots = r; break; }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (roots.length === 0) return { error: 'No fiber roots found.' };
|
|
50
|
+
|
|
51
|
+
const targetName = '${escapedName}';
|
|
52
|
+
const targetIndex = ${index};
|
|
53
|
+
const includeState = ${includeState};
|
|
54
|
+
const includeChildren = ${includeChildren};
|
|
55
|
+
const childrenDepth = ${childrenDepth};
|
|
56
|
+
const includeStyle = ${includeStyle};
|
|
57
|
+
const shortPath = ${shortPath};
|
|
58
|
+
const simplifyHooks = ${simplifyHooks};
|
|
59
|
+
const pathSegments = 3;
|
|
60
|
+
|
|
61
|
+
function getComponentName(fiber) {
|
|
62
|
+
if (!fiber || !fiber.type) return null;
|
|
63
|
+
if (typeof fiber.type === 'string') return fiber.type;
|
|
64
|
+
return fiber.type.displayName || fiber.type.name || null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function formatPath(pathArray) {
|
|
68
|
+
if (!shortPath || pathArray.length <= pathSegments) {
|
|
69
|
+
return pathArray.join(' > ');
|
|
70
|
+
}
|
|
71
|
+
return '... > ' + pathArray.slice(-pathSegments).join(' > ');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function extractStyles(style) {
|
|
75
|
+
try {
|
|
76
|
+
if (!style) return null;
|
|
77
|
+
const merged = Array.isArray(style)
|
|
78
|
+
? Object.assign({}, ...style.filter(Boolean).map(s => {
|
|
79
|
+
try { return typeof s === 'object' ? s : {}; }
|
|
80
|
+
catch { return {}; }
|
|
81
|
+
}))
|
|
82
|
+
: (typeof style === 'object' ? style : {});
|
|
83
|
+
return Object.keys(merged).length > 0 ? merged : null;
|
|
84
|
+
} catch { return { _note: '[Contains animated styles]' }; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function serializeValue(val, depth = 0) {
|
|
88
|
+
if (depth > 3) return '[Max depth]';
|
|
89
|
+
if (val === null) return null;
|
|
90
|
+
if (val === undefined) return undefined;
|
|
91
|
+
if (typeof val === 'function') return '[Function]';
|
|
92
|
+
if (typeof val !== 'object') return val;
|
|
93
|
+
if (Array.isArray(val)) {
|
|
94
|
+
if (val.length > 10) return '[Array(' + val.length + ')]';
|
|
95
|
+
return val.map(v => serializeValue(v, depth + 1));
|
|
96
|
+
}
|
|
97
|
+
// Object
|
|
98
|
+
const keys = Object.keys(val);
|
|
99
|
+
if (keys.length > 20) return '[Object(' + keys.length + ' keys)]';
|
|
100
|
+
const result = {};
|
|
101
|
+
for (const k of keys) {
|
|
102
|
+
try {
|
|
103
|
+
result[k] = serializeValue(val[k], depth + 1);
|
|
104
|
+
} catch {
|
|
105
|
+
result[k] = '[Animated Value]';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const resolveRNStyle = (hook && hook.resolveRNStyle) || null;
|
|
112
|
+
|
|
113
|
+
function flattenStyleProp(style) {
|
|
114
|
+
if (style == null || style === false || style === true) return null;
|
|
115
|
+
if (typeof style === 'number') {
|
|
116
|
+
if (resolveRNStyle) {
|
|
117
|
+
try {
|
|
118
|
+
const resolved = resolveRNStyle(style);
|
|
119
|
+
return resolved ? flattenStyleProp(resolved) : null;
|
|
120
|
+
} catch { return null; }
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
if (Array.isArray(style)) {
|
|
125
|
+
const out = {};
|
|
126
|
+
for (const item of style) {
|
|
127
|
+
const flat = flattenStyleProp(item);
|
|
128
|
+
if (flat && typeof flat === 'object') Object.assign(out, flat);
|
|
129
|
+
}
|
|
130
|
+
return Object.keys(out).length ? out : null;
|
|
131
|
+
}
|
|
132
|
+
if (typeof style === 'object') return style;
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function sanitizeStyleObject(s) {
|
|
137
|
+
if (!s || typeof s !== 'object') return null;
|
|
138
|
+
const out = {};
|
|
139
|
+
for (const k of Object.keys(s)) {
|
|
140
|
+
const v = s[k];
|
|
141
|
+
if (v === undefined) continue;
|
|
142
|
+
if (v === null) { out[k] = null; continue; }
|
|
143
|
+
const t = typeof v;
|
|
144
|
+
if (t === 'function') { out[k] = '[Function]'; continue; }
|
|
145
|
+
if (t === 'object') {
|
|
146
|
+
try { JSON.stringify(v); out[k] = v; }
|
|
147
|
+
catch { out[k] = String(v); }
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
out[k] = v;
|
|
151
|
+
}
|
|
152
|
+
return Object.keys(out).length ? out : null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function getResolvedStyle(fiber) {
|
|
156
|
+
try {
|
|
157
|
+
const raw = fiber && fiber.memoizedProps && fiber.memoizedProps.style;
|
|
158
|
+
if (raw == null) return null;
|
|
159
|
+
return sanitizeStyleObject(flattenStyleProp(raw));
|
|
160
|
+
} catch { return null; }
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function getChildTree(fiber, depth) {
|
|
164
|
+
if (!fiber || depth <= 0) return null;
|
|
165
|
+
const children = [];
|
|
166
|
+
let child = fiber?.child;
|
|
167
|
+
while (child && children.length < 30) {
|
|
168
|
+
const name = getComponentName(child);
|
|
169
|
+
if (name) {
|
|
170
|
+
const style = includeStyle ? getResolvedStyle(child) : null;
|
|
171
|
+
if (depth === 1) {
|
|
172
|
+
if (includeStyle) {
|
|
173
|
+
const entry = { component: name };
|
|
174
|
+
if (style) entry.style = style;
|
|
175
|
+
children.push(entry);
|
|
176
|
+
} else {
|
|
177
|
+
children.push(name);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
const nestedChildren = getChildTree(child, depth - 1);
|
|
181
|
+
if (includeStyle) {
|
|
182
|
+
const entry = { component: name };
|
|
183
|
+
if (style) entry.style = style;
|
|
184
|
+
if (nestedChildren) entry.children = nestedChildren;
|
|
185
|
+
children.push(entry);
|
|
186
|
+
} else {
|
|
187
|
+
children.push(nestedChildren ? { component: name, children: nestedChildren } : name);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
child = child.sibling;
|
|
192
|
+
}
|
|
193
|
+
return children.length > 0 ? children : null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const matches = [];
|
|
197
|
+
|
|
198
|
+
function findComponent(fiber, path) {
|
|
199
|
+
if (!fiber) return;
|
|
200
|
+
|
|
201
|
+
const name = getComponentName(fiber);
|
|
202
|
+
if (name === targetName) {
|
|
203
|
+
matches.push({ fiber, path: [...path, name] });
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
let child = fiber.child;
|
|
207
|
+
while (child) {
|
|
208
|
+
const childName = getComponentName(child);
|
|
209
|
+
findComponent(child, childName ? [...path, childName] : path);
|
|
210
|
+
child = child.sibling;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
findComponent(roots[0].current, []);
|
|
215
|
+
|
|
216
|
+
if (matches.length === 0) {
|
|
217
|
+
return { error: 'Component "' + targetName + '" not found in the component tree.' };
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (targetIndex >= matches.length) {
|
|
221
|
+
return { error: 'Component "' + targetName + '" found ' + matches.length + ' times, but index ' + targetIndex + ' requested.' };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const { fiber, path } = matches[targetIndex];
|
|
225
|
+
|
|
226
|
+
const result = {
|
|
227
|
+
component: targetName,
|
|
228
|
+
path: formatPath(path),
|
|
229
|
+
instancesFound: matches.length,
|
|
230
|
+
instanceIndex: targetIndex
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// Props (excluding children)
|
|
234
|
+
if (fiber.memoizedProps) {
|
|
235
|
+
const props = {};
|
|
236
|
+
for (const key of Object.keys(fiber.memoizedProps)) {
|
|
237
|
+
if (key === 'children') continue;
|
|
238
|
+
try {
|
|
239
|
+
props[key] = serializeValue(fiber.memoizedProps[key]);
|
|
240
|
+
} catch {
|
|
241
|
+
props[key] = '[Animated Value]';
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
result.props = props;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Style separately for clarity
|
|
248
|
+
try {
|
|
249
|
+
if (fiber.memoizedProps?.style) {
|
|
250
|
+
result.style = extractStyles(fiber.memoizedProps.style);
|
|
251
|
+
}
|
|
252
|
+
} catch {
|
|
253
|
+
result.style = { _note: '[Contains animated styles]' };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// State (for hooks, this is a linked list)
|
|
257
|
+
if (includeState && fiber.memoizedState) {
|
|
258
|
+
// Simplified hook value serialization
|
|
259
|
+
function serializeHookValue(val, depth = 0) {
|
|
260
|
+
try {
|
|
261
|
+
if (depth > 2) return '[...]';
|
|
262
|
+
if (val === null || val === undefined) return val;
|
|
263
|
+
if (typeof val === 'function') return '[Function]';
|
|
264
|
+
if (typeof val !== 'object') return val;
|
|
265
|
+
// Skip React internal structures (effects, refs with destroy/create)
|
|
266
|
+
if (val.create && val.destroy !== undefined) return '[Effect]';
|
|
267
|
+
if (val.inst && val.deps) return '[Effect]';
|
|
268
|
+
if (val.current !== undefined && Object.keys(val).length === 1) {
|
|
269
|
+
// Ref object - just show current value
|
|
270
|
+
return { current: serializeHookValue(val.current, depth + 1) };
|
|
271
|
+
}
|
|
272
|
+
if (Array.isArray(val)) {
|
|
273
|
+
if (val.length > 5) return '[Array(' + val.length + ')]';
|
|
274
|
+
return val.slice(0, 5).map(v => serializeHookValue(v, depth + 1));
|
|
275
|
+
}
|
|
276
|
+
const keys = Object.keys(val);
|
|
277
|
+
if (keys.length > 10) return '[Object(' + keys.length + ' keys)]';
|
|
278
|
+
const result = {};
|
|
279
|
+
for (const k of keys.slice(0, 10)) {
|
|
280
|
+
try {
|
|
281
|
+
result[k] = serializeHookValue(val[k], depth + 1);
|
|
282
|
+
} catch {
|
|
283
|
+
result[k] = '[Animated Value]';
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return result;
|
|
287
|
+
} catch { return '[Animated Value]'; }
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// For function components with hooks
|
|
291
|
+
const states = [];
|
|
292
|
+
let state = fiber.memoizedState;
|
|
293
|
+
let hookIndex = 0;
|
|
294
|
+
while (state && hookIndex < 20) {
|
|
295
|
+
if (state.memoizedState !== undefined) {
|
|
296
|
+
const hookVal = simplifyHooks
|
|
297
|
+
? serializeHookValue(state.memoizedState)
|
|
298
|
+
: serializeValue(state.memoizedState);
|
|
299
|
+
// Skip effect hooks in simplified mode
|
|
300
|
+
if (!simplifyHooks || (hookVal !== '[Effect]' && hookVal !== undefined)) {
|
|
301
|
+
states.push({
|
|
302
|
+
hookIndex,
|
|
303
|
+
value: hookVal
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
state = state.next;
|
|
308
|
+
hookIndex++;
|
|
309
|
+
}
|
|
310
|
+
if (states.length > 0) result.hooks = states;
|
|
311
|
+
|
|
312
|
+
// For class components, memoizedState is the state object directly
|
|
313
|
+
if (states.length === 0 && typeof fiber.memoizedState === 'object') {
|
|
314
|
+
result.state = serializeValue(fiber.memoizedState);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Children tree (depth controlled by childrenDepth)
|
|
319
|
+
if (includeChildren) {
|
|
320
|
+
result.children = getChildTree(fiber, childrenDepth);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Scroll introspection — dispatch measurements for ScrollView-like fibers.
|
|
324
|
+
// A second roundtrip in TypeScript reads globalThis.__scrollMeasure to
|
|
325
|
+
// compute layout vs content size and an isScrollable verdict.
|
|
326
|
+
const isScrollable = (
|
|
327
|
+
targetName === 'ScrollView' ||
|
|
328
|
+
targetName === 'FlatList' ||
|
|
329
|
+
targetName === 'SectionList' ||
|
|
330
|
+
targetName.indexOf('ScrollView') !== -1 ||
|
|
331
|
+
(fiber.memoizedProps && typeof fiber.memoizedProps.onScroll === 'function')
|
|
332
|
+
);
|
|
333
|
+
if (isScrollable) {
|
|
334
|
+
function findFirstHost(f, d) {
|
|
335
|
+
if (!f || d > 10) return null;
|
|
336
|
+
if (typeof f.type === 'string' && f.stateNode) return f;
|
|
337
|
+
let c = f.child;
|
|
338
|
+
while (c) {
|
|
339
|
+
const h = findFirstHost(c, d + 1);
|
|
340
|
+
if (h) return h;
|
|
341
|
+
c = c.sibling;
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
function getMeasurable(f) {
|
|
346
|
+
const sn = f.stateNode;
|
|
347
|
+
if (!sn) return null;
|
|
348
|
+
if (typeof sn.measureInWindow === 'function') return sn;
|
|
349
|
+
if (sn.canonical && sn.canonical.publicInstance &&
|
|
350
|
+
typeof sn.canonical.publicInstance.measureInWindow === 'function') {
|
|
351
|
+
return sn.canonical.publicInstance;
|
|
352
|
+
}
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
const scrollHost = findFirstHost(fiber, 0);
|
|
356
|
+
const contentHost = scrollHost && scrollHost.child ? findFirstHost(scrollHost.child, 0) : null;
|
|
357
|
+
const sm = scrollHost ? getMeasurable(scrollHost) : null;
|
|
358
|
+
const cm = contentHost ? getMeasurable(contentHost) : null;
|
|
359
|
+
if (sm && cm) {
|
|
360
|
+
globalThis.__scrollMeasure = { layout: null, content: null };
|
|
361
|
+
try { sm.measureInWindow(function(x, y, w, h) { globalThis.__scrollMeasure.layout = { x: x, y: y, width: w, height: h }; }); } catch(e) {}
|
|
362
|
+
try { cm.measureInWindow(function(x, y, w, h) { globalThis.__scrollMeasure.content = { x: x, y: y, width: w, height: h }; }); } catch(e) {}
|
|
363
|
+
result.__scrollPending = true;
|
|
364
|
+
}
|
|
365
|
+
const sp = fiber.memoizedProps || {};
|
|
366
|
+
result.scroll = {
|
|
367
|
+
scrollEnabled: sp.scrollEnabled !== false,
|
|
368
|
+
horizontal: !!sp.horizontal,
|
|
369
|
+
bounces: sp.bounces
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return result;
|
|
374
|
+
})()
|
|
375
|
+
`;
|
|
376
|
+
const firstResult = await executeInApp(expression, false, { timeoutMs: timeoutMs ?? 5000, originatingToolName: "inspect_component" }, device);
|
|
377
|
+
if (!firstResult.success || !firstResult.result)
|
|
378
|
+
return firstResult;
|
|
379
|
+
// Parse and check for pending scroll measurement
|
|
380
|
+
let parsed;
|
|
381
|
+
try {
|
|
382
|
+
parsed = JSON.parse(firstResult.result);
|
|
383
|
+
}
|
|
384
|
+
catch {
|
|
385
|
+
return firstResult;
|
|
386
|
+
}
|
|
387
|
+
if (!parsed.__scrollPending)
|
|
388
|
+
return firstResult;
|
|
389
|
+
delete parsed.__scrollPending;
|
|
390
|
+
await delay(120);
|
|
391
|
+
const resolveScrollExpr = `
|
|
392
|
+
(function() {
|
|
393
|
+
const m = globalThis.__scrollMeasure;
|
|
394
|
+
globalThis.__scrollMeasure = null;
|
|
395
|
+
if (!m || !m.layout || !m.content) return { error: 'no_measurement' };
|
|
396
|
+
const horizontal = ${JSON.stringify(parsed.scroll && parsed.scroll.horizontal === true)};
|
|
397
|
+
const layoutWidth = m.layout.width;
|
|
398
|
+
const layoutHeight = m.layout.height;
|
|
399
|
+
const contentWidth = m.content.width;
|
|
400
|
+
const contentHeight = m.content.height;
|
|
401
|
+
const contentOffsetX = m.layout.x - m.content.x;
|
|
402
|
+
const contentOffsetY = m.layout.y - m.content.y;
|
|
403
|
+
const overflowAxis = horizontal ? contentWidth - layoutWidth : contentHeight - layoutHeight;
|
|
404
|
+
const offsetAxis = horizontal ? contentOffsetX : contentOffsetY;
|
|
405
|
+
const isScrollable = overflowAxis > 1;
|
|
406
|
+
const isAtTop = horizontal ? Math.abs(contentOffsetX) < 1 : Math.abs(contentOffsetY) < 1;
|
|
407
|
+
const isAtBottom = !isScrollable || (offsetAxis >= overflowAxis - 1);
|
|
408
|
+
return {
|
|
409
|
+
layoutWidth: Math.round(layoutWidth * 100) / 100,
|
|
410
|
+
layoutHeight: Math.round(layoutHeight * 100) / 100,
|
|
411
|
+
contentWidth: Math.round(contentWidth * 100) / 100,
|
|
412
|
+
contentHeight: Math.round(contentHeight * 100) / 100,
|
|
413
|
+
contentOffset: { x: Math.round(contentOffsetX * 100) / 100, y: Math.round(contentOffsetY * 100) / 100 },
|
|
414
|
+
isScrollable: isScrollable,
|
|
415
|
+
isAtTop: isAtTop,
|
|
416
|
+
isAtBottom: isAtBottom
|
|
417
|
+
};
|
|
418
|
+
})()
|
|
419
|
+
`;
|
|
420
|
+
const scrollResult = await executeInApp(resolveScrollExpr, false, { timeoutMs: 3000, originatingToolName: "inspect_component" }, device);
|
|
421
|
+
if (scrollResult.success && scrollResult.result) {
|
|
422
|
+
try {
|
|
423
|
+
const scrollData = JSON.parse(scrollResult.result);
|
|
424
|
+
if (!scrollData.error) {
|
|
425
|
+
parsed.scroll = { ...parsed.scroll, ...scrollData };
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
catch { /* keep partial scroll info */ }
|
|
429
|
+
}
|
|
430
|
+
return { ...firstResult, result: JSON.stringify(parsed, null, 2) };
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Find all components matching a name pattern and return summary info.
|
|
434
|
+
*/
|
|
435
|
+
export async function findComponents(pattern, options = {}) {
|
|
436
|
+
const { maxResults = 20, includeLayout = false, shortPath = true, summary = false, format = "tonl", device, timeoutMs } = options;
|
|
437
|
+
const escapedPattern = pattern.replace(/'/g, "\\'").replace(/\\/g, "\\\\");
|
|
438
|
+
const expression = `
|
|
439
|
+
(function() {
|
|
440
|
+
const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
441
|
+
if (!hook) return { error: 'React DevTools hook not found.' };
|
|
442
|
+
|
|
443
|
+
let roots = [];
|
|
444
|
+
if (hook.getFiberRoots) {
|
|
445
|
+
roots = [...(hook.getFiberRoots(1) || [])];
|
|
446
|
+
}
|
|
447
|
+
if (roots.length === 0 && hook.renderers) {
|
|
448
|
+
for (const [id] of hook.renderers) {
|
|
449
|
+
const r = hook.getFiberRoots ? [...(hook.getFiberRoots(id) || [])] : [];
|
|
450
|
+
if (r.length > 0) { roots = r; break; }
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (roots.length === 0) return { error: 'No fiber roots found.' };
|
|
454
|
+
|
|
455
|
+
const pattern = '${escapedPattern}';
|
|
456
|
+
const regex = new RegExp(pattern, 'i');
|
|
457
|
+
const maxResults = ${maxResults};
|
|
458
|
+
const includeLayout = ${includeLayout};
|
|
459
|
+
const shortPath = ${shortPath};
|
|
460
|
+
const summaryMode = ${summary};
|
|
461
|
+
const pathSegments = 3;
|
|
462
|
+
|
|
463
|
+
function getComponentName(fiber) {
|
|
464
|
+
if (!fiber || !fiber.type) return null;
|
|
465
|
+
if (typeof fiber.type === 'string') return fiber.type;
|
|
466
|
+
return fiber.type.displayName || fiber.type.name || null;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function formatPath(pathArray) {
|
|
470
|
+
if (!shortPath || pathArray.length <= pathSegments) {
|
|
471
|
+
return pathArray.join(' > ');
|
|
472
|
+
}
|
|
473
|
+
return '... > ' + pathArray.slice(-pathSegments).join(' > ');
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function extractLayoutStyles(style) {
|
|
477
|
+
try {
|
|
478
|
+
if (!style) return null;
|
|
479
|
+
const merged = Array.isArray(style)
|
|
480
|
+
? Object.assign({}, ...style.filter(Boolean).map(s => {
|
|
481
|
+
try { return typeof s === 'object' ? s : {}; }
|
|
482
|
+
catch { return {}; }
|
|
483
|
+
}))
|
|
484
|
+
: (typeof style === 'object' ? style : {});
|
|
485
|
+
|
|
486
|
+
const layout = {};
|
|
487
|
+
const keys = ['padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight',
|
|
488
|
+
'paddingHorizontal', 'paddingVertical', 'margin', 'marginTop', 'marginBottom',
|
|
489
|
+
'marginLeft', 'marginRight', 'marginHorizontal', 'marginVertical',
|
|
490
|
+
'width', 'height', 'flex', 'flexDirection', 'justifyContent', 'alignItems'];
|
|
491
|
+
for (const k of keys) {
|
|
492
|
+
if (merged[k] !== undefined) layout[k] = merged[k];
|
|
493
|
+
}
|
|
494
|
+
return Object.keys(layout).length > 0 ? layout : null;
|
|
495
|
+
} catch { return null; }
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
const results = [];
|
|
499
|
+
|
|
500
|
+
function search(fiber, path, depth) {
|
|
501
|
+
if (!fiber || results.length >= maxResults) return;
|
|
502
|
+
|
|
503
|
+
try {
|
|
504
|
+
var name = getComponentName(fiber);
|
|
505
|
+
if (name && regex.test(name)) {
|
|
506
|
+
var entry = {
|
|
507
|
+
component: name,
|
|
508
|
+
path: formatPath(path),
|
|
509
|
+
depth
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
if (fiber.memoizedProps && fiber.memoizedProps.testID) entry.testID = fiber.memoizedProps.testID;
|
|
513
|
+
if (fiber.key) entry.key = fiber.key;
|
|
514
|
+
|
|
515
|
+
if (includeLayout && fiber.memoizedProps && fiber.memoizedProps.style) {
|
|
516
|
+
try {
|
|
517
|
+
var layout = extractLayoutStyles(fiber.memoizedProps.style);
|
|
518
|
+
if (layout) entry.layout = layout;
|
|
519
|
+
} catch(e) {}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
results.push(entry);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
var child = fiber.child;
|
|
526
|
+
while (child && results.length < maxResults) {
|
|
527
|
+
var childName = getComponentName(child);
|
|
528
|
+
search(child, childName ? path.concat([childName]) : path, depth + 1);
|
|
529
|
+
child = child.sibling;
|
|
530
|
+
}
|
|
531
|
+
} catch(e) {
|
|
532
|
+
try {
|
|
533
|
+
var child = fiber.child;
|
|
534
|
+
while (child && results.length < maxResults) {
|
|
535
|
+
search(child, path, depth + 1);
|
|
536
|
+
child = child.sibling;
|
|
537
|
+
}
|
|
538
|
+
} catch(e2) {}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
search(roots[0].current, [], 0);
|
|
543
|
+
|
|
544
|
+
if (summaryMode) {
|
|
545
|
+
const counts = {};
|
|
546
|
+
for (const r of results) {
|
|
547
|
+
counts[r.component] = (counts[r.component] || 0) + 1;
|
|
548
|
+
}
|
|
549
|
+
const sorted = Object.entries(counts)
|
|
550
|
+
.sort((a, b) => b[1] - a[1])
|
|
551
|
+
.map(([name, count]) => ({ component: name, count }));
|
|
552
|
+
return {
|
|
553
|
+
pattern,
|
|
554
|
+
totalMatches: results.length,
|
|
555
|
+
uniqueComponents: sorted.length,
|
|
556
|
+
components: sorted
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return {
|
|
561
|
+
pattern,
|
|
562
|
+
found: results.length,
|
|
563
|
+
components: results
|
|
564
|
+
};
|
|
565
|
+
})()
|
|
566
|
+
`;
|
|
567
|
+
const result = await executeInApp(expression, false, { timeoutMs: timeoutMs ?? 5000, originatingToolName: "find_components" }, device);
|
|
568
|
+
if (format === "tonl" && result.success && result.result) {
|
|
569
|
+
try {
|
|
570
|
+
const parsed = JSON.parse(result.result);
|
|
571
|
+
if (parsed.components) {
|
|
572
|
+
if (parsed.totalMatches !== undefined) {
|
|
573
|
+
const tonl = formatSummaryToTonl(parsed.components, parsed.totalMatches);
|
|
574
|
+
return { success: true, result: `pattern: ${parsed.pattern}\n${tonl}` };
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
const tonl = formatFoundComponentsToTonl(parsed.components);
|
|
578
|
+
return { success: true, result: `pattern: ${parsed.pattern}\nfound: ${parsed.found}\n${tonl}` };
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
catch {
|
|
583
|
+
// If parsing fails, return original result
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return result;
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=componentSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentSearch.js","sourceRoot":"","sources":["../../src/core/component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|
+
maxDepth?: number;
|
|
4
|
+
includeProps?: boolean;
|
|
5
|
+
includeStyles?: boolean;
|
|
6
|
+
hideInternals?: boolean;
|
|
7
|
+
format?: "json" | "tonl";
|
|
8
|
+
structureOnly?: boolean;
|
|
9
|
+
focusedOnly?: boolean;
|
|
10
|
+
device?: string;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
}): Promise<ExecutionResult>;
|
|
13
|
+
//# sourceMappingURL=componentTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentTree.d.ts","sourceRoot":"","sources":["../../src/core/componentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA4DlD,wBAAsB,gBAAgB,CAClC,OAAO,GAAE;IACL,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACjB,GACP,OAAO,CAAC,eAAe,CAAC,CAwP1B"}
|