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,653 @@
|
|
|
1
|
+
import { randomUUID } from "crypto";
|
|
2
|
+
import { readFileSync, writeFileSync, appendFileSync, existsSync, mkdirSync } from "fs";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { ensureLicense, incrementLocalUsage } from "./license.js";
|
|
6
|
+
import { connectedApps } from "./state.js";
|
|
7
|
+
import { getPostHogClient } from "./posthog.js";
|
|
8
|
+
import { CONFIG_DIR } from "./paths.js";
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Configuration
|
|
11
|
+
// ============================================================================
|
|
12
|
+
const TELEMETRY_ENDPOINT = "https://rn-debugger-telemetry.500griven.workers.dev";
|
|
13
|
+
const TELEMETRY_API_KEY = "6a630181cb391ed5c42a188428cc2d2623dfe9333ec048193bb711ab58afe85e";
|
|
14
|
+
// Replaced at npm-publish time by scripts/inject-build-token.mjs, which
|
|
15
|
+
// rewrites the compiled build/index.js. A source checkout (any fork) keeps
|
|
16
|
+
// this literal — the telemetry Worker compares it to its own secret and
|
|
17
|
+
// resolves a non-match to a fork. Never store/commit the real value here.
|
|
18
|
+
const BUILD_TOKEN = "8d755bc6f2da14077192795c2e3053a3123dc05a523e872bcfef26aa30068422";
|
|
19
|
+
export function getTelemetryEndpoint() { return TELEMETRY_ENDPOINT; }
|
|
20
|
+
export function getTelemetryApiKey() { return TELEMETRY_API_KEY; }
|
|
21
|
+
const REQUEST_TIMEOUT_MS = 5_000;
|
|
22
|
+
const CONFIG_FILE = join(CONFIG_DIR, "telemetry.json");
|
|
23
|
+
export const TELEMETRY_JSONL_PATH = "/tmp/rn-devtools-telemetry.jsonl";
|
|
24
|
+
// Read version from package.json dynamically
|
|
25
|
+
export function getServerVersion() {
|
|
26
|
+
try {
|
|
27
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const pkgPath = join(__dirname, "..", "..", "package.json");
|
|
29
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
30
|
+
return pkg.version || "unknown";
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return "unknown";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Read package name from package.json — differentiates canonical vs mirror publishes
|
|
37
|
+
export function getPackageName() {
|
|
38
|
+
try {
|
|
39
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
40
|
+
const pkgPath = join(__dirname, "..", "..", "package.json");
|
|
41
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
42
|
+
return pkg.name || "unknown";
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return "unknown";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// ============================================================================
|
|
49
|
+
// Error Categorization
|
|
50
|
+
// ============================================================================
|
|
51
|
+
export function categorizeError(errorMessage, errorContext) {
|
|
52
|
+
const lower = errorMessage.toLowerCase();
|
|
53
|
+
// UI driver not installed — must be checked before 'validation' which matches 'missing'/'install'.
|
|
54
|
+
// Covers iOS (idb/axe) and Android (adb): on Android, ADB plays the same role as a UI driver
|
|
55
|
+
// (required for accessibility enumeration, screenshots, and input). Treating it identically keeps
|
|
56
|
+
// the "driver_missing" bucket platform-agnostic and prevents these from polluting tap-tool error rates.
|
|
57
|
+
if (lower.includes('not installed') && (lower.includes('idb') || lower.includes('axe') || lower.includes('ui driver') || lower.includes('adb'))) {
|
|
58
|
+
return 'driver_missing';
|
|
59
|
+
}
|
|
60
|
+
// Strategy chain may contain driver-missing signals even when the primary error
|
|
61
|
+
// message doesn't (e.g., strategies skipped due to missing driver, last-resort
|
|
62
|
+
// strategy fails with "No element found" or "timed out")
|
|
63
|
+
if (errorContext) {
|
|
64
|
+
const ctxLower = errorContext.toLowerCase();
|
|
65
|
+
if (ctxLower.includes('ios ui driver is not instal') || ctxLower.includes('idb is not instal') || ctxLower.includes('adb is not installed') || ctxLower.includes('adb is not in path')) {
|
|
66
|
+
return 'driver_missing';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (lower.includes('websocket') || lower.includes('econnrefused') || lower.includes('socket') || lower.includes('fetch')) {
|
|
70
|
+
return 'network';
|
|
71
|
+
}
|
|
72
|
+
if (lower.includes('timeout') || lower.includes('timed out')) {
|
|
73
|
+
return 'timeout';
|
|
74
|
+
}
|
|
75
|
+
// Check connection errors before validation (since "no debuggable devices found" contains "no")
|
|
76
|
+
if (lower.includes('no apps connected') || lower.includes('scan_metro') || lower.includes('not connected') ||
|
|
77
|
+
lower.includes('no debuggable devices') || lower.includes('no metro server') || lower.includes('connection failed')) {
|
|
78
|
+
return 'connection';
|
|
79
|
+
}
|
|
80
|
+
// Syntax/compilation errors in JS code
|
|
81
|
+
if (lower.includes('compiling js failed') || lower.includes('syntaxerror')) {
|
|
82
|
+
return 'validation';
|
|
83
|
+
}
|
|
84
|
+
if (lower.includes('invalid') || lower.includes('required') || lower.includes('missing')) {
|
|
85
|
+
return 'validation';
|
|
86
|
+
}
|
|
87
|
+
if (lower.includes('evaluate') || lower.includes('execution') || lower.includes('runtime')) {
|
|
88
|
+
return 'execution';
|
|
89
|
+
}
|
|
90
|
+
// Tap element-not-found errors
|
|
91
|
+
if (lower.includes('no element found') || lower.includes('no pressable') || lower.includes('no focusable')) {
|
|
92
|
+
return 'validation';
|
|
93
|
+
}
|
|
94
|
+
// Tap connection errors (different message format from other tools)
|
|
95
|
+
if (lower.includes('no connected app') || lower.includes('connect_metro first') || lower.includes('auto-connect failed')) {
|
|
96
|
+
return 'connection';
|
|
97
|
+
}
|
|
98
|
+
return 'unknown';
|
|
99
|
+
}
|
|
100
|
+
// ============================================================================
|
|
101
|
+
// State
|
|
102
|
+
// ============================================================================
|
|
103
|
+
let telemetryEnabled = true;
|
|
104
|
+
let config = null;
|
|
105
|
+
let sessionStartTime = null;
|
|
106
|
+
let sessionId = null;
|
|
107
|
+
let isFirstRunSession = false;
|
|
108
|
+
let sessionStarted = false;
|
|
109
|
+
let lastToolTimestamp = null;
|
|
110
|
+
const SESSION_INACTIVITY_MS = 10 * 60 * 1000; // 10 minutes — matches dashboard SESSION_TIMEOUT_MS
|
|
111
|
+
// ============================================================================
|
|
112
|
+
// Configuration Management
|
|
113
|
+
// ============================================================================
|
|
114
|
+
function loadOrCreateConfig() {
|
|
115
|
+
if (config)
|
|
116
|
+
return config;
|
|
117
|
+
// Try to load existing config
|
|
118
|
+
try {
|
|
119
|
+
if (existsSync(CONFIG_FILE)) {
|
|
120
|
+
const data = readFileSync(CONFIG_FILE, "utf-8");
|
|
121
|
+
const parsed = JSON.parse(data);
|
|
122
|
+
// Mark as not first run for subsequent sessions
|
|
123
|
+
config = { ...parsed, isFirstRun: false };
|
|
124
|
+
isFirstRunSession = false;
|
|
125
|
+
return config;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Config file corrupted or unreadable, create new one
|
|
130
|
+
}
|
|
131
|
+
// Create new installation
|
|
132
|
+
const newConfig = {
|
|
133
|
+
installationId: randomUUID(),
|
|
134
|
+
firstRunTimestamp: Date.now(),
|
|
135
|
+
isFirstRun: true
|
|
136
|
+
};
|
|
137
|
+
try {
|
|
138
|
+
if (!existsSync(CONFIG_DIR)) {
|
|
139
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
140
|
+
}
|
|
141
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(newConfig, null, 2));
|
|
142
|
+
// Re-read to handle race condition with concurrent sessions
|
|
143
|
+
// The file on disk is the source of truth
|
|
144
|
+
try {
|
|
145
|
+
const data = readFileSync(CONFIG_FILE, "utf-8");
|
|
146
|
+
const persistedConfig = JSON.parse(data);
|
|
147
|
+
config = persistedConfig;
|
|
148
|
+
isFirstRunSession = persistedConfig.isFirstRun;
|
|
149
|
+
return config;
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// If re-read fails, use the config we created
|
|
153
|
+
config = newConfig;
|
|
154
|
+
isFirstRunSession = true;
|
|
155
|
+
return config;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// Failed to save config, continue with in-memory config
|
|
160
|
+
config = newConfig;
|
|
161
|
+
isFirstRunSession = true;
|
|
162
|
+
return config;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export function getInstallationId() {
|
|
166
|
+
return loadOrCreateConfig().installationId;
|
|
167
|
+
}
|
|
168
|
+
function isFirstRun() {
|
|
169
|
+
loadOrCreateConfig();
|
|
170
|
+
return isFirstRunSession;
|
|
171
|
+
}
|
|
172
|
+
// ============================================================================
|
|
173
|
+
// Telemetry Control
|
|
174
|
+
// ============================================================================
|
|
175
|
+
export function initTelemetry() {
|
|
176
|
+
// Check environment variable for opt-out
|
|
177
|
+
const envValue = process.env.EXECBRO_TELEMETRY ?? process.env.RN_DEBUGGER_TELEMETRY;
|
|
178
|
+
if (envValue === "false" || envValue === "0" || envValue === "off") {
|
|
179
|
+
telemetryEnabled = false;
|
|
180
|
+
console.error("[execbro] Telemetry disabled via EXECBRO_TELEMETRY");
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
// Check if dev mode is enabled in config (for local development)
|
|
184
|
+
const cfg = loadOrCreateConfig();
|
|
185
|
+
if (cfg.devMode) {
|
|
186
|
+
telemetryEnabled = false;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// Check if endpoint is configured (placeholder detection)
|
|
190
|
+
if (TELEMETRY_ENDPOINT.includes("YOUR_SUBDOMAIN") || TELEMETRY_API_KEY.includes("YOUR_API_KEY")) {
|
|
191
|
+
telemetryEnabled = false;
|
|
192
|
+
// Silently disable - endpoint not configured yet
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
// Load/create config (generates installation ID)
|
|
196
|
+
loadOrCreateConfig();
|
|
197
|
+
sessionId = randomUUID();
|
|
198
|
+
// Track that an AI agent session loaded our MCP server (regardless of tool usage)
|
|
199
|
+
trackEvent("session_start", {
|
|
200
|
+
isFirstRun: isFirstRun()
|
|
201
|
+
});
|
|
202
|
+
// Track session end on SIGINT/SIGTERM. Each event is dispatched immediately
|
|
203
|
+
// with keepalive, so no flush is needed — the OS completes the request even
|
|
204
|
+
// if the process exits right after.
|
|
205
|
+
const handleExit = () => {
|
|
206
|
+
if (sessionStarted && sessionStartTime) {
|
|
207
|
+
trackEvent("session_end", {
|
|
208
|
+
duration: Date.now() - sessionStartTime
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
process.exit(0);
|
|
212
|
+
};
|
|
213
|
+
process.on("SIGINT", handleExit);
|
|
214
|
+
process.on("SIGTERM", handleExit);
|
|
215
|
+
}
|
|
216
|
+
export function isTelemetryEnabled() {
|
|
217
|
+
return telemetryEnabled;
|
|
218
|
+
}
|
|
219
|
+
/** Check if the MCP server is running in dev mode (config-based). */
|
|
220
|
+
export function isDevMode() {
|
|
221
|
+
try {
|
|
222
|
+
const cfg = loadOrCreateConfig();
|
|
223
|
+
return cfg.devMode === true;
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// ============================================================================
|
|
230
|
+
// Event Tracking
|
|
231
|
+
// ============================================================================
|
|
232
|
+
function trackEvent(name, properties) {
|
|
233
|
+
if (!telemetryEnabled)
|
|
234
|
+
return;
|
|
235
|
+
dispatch({
|
|
236
|
+
name,
|
|
237
|
+
timestamp: Date.now(),
|
|
238
|
+
isFirstRun: isFirstRun(),
|
|
239
|
+
properties
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
export function trackToolInvocation(toolName, success, durationMs, errorMessage, errorContext, inputTokens, outputTokens, targetPlatform, emptyResult, meaningful, changeRate, tapStrategy, iosDriver, responsePreview, emptyReason, artifactKey, ocrClosestMatch, fiberPressableCount, accessibilityMatchCount, appRoute) {
|
|
243
|
+
// Append to local JSONL file for local dashboard (dev mode only)
|
|
244
|
+
if (isDevMode())
|
|
245
|
+
try {
|
|
246
|
+
const localEvent = {
|
|
247
|
+
name: "tool_invocation",
|
|
248
|
+
timestamp: Date.now(),
|
|
249
|
+
toolName,
|
|
250
|
+
success,
|
|
251
|
+
duration: durationMs,
|
|
252
|
+
isFirstRun: false,
|
|
253
|
+
};
|
|
254
|
+
if (!success && errorMessage) {
|
|
255
|
+
localEvent.errorCategory = categorizeError(errorMessage, errorContext);
|
|
256
|
+
localEvent.errorMessage = errorMessage.substring(0, 200);
|
|
257
|
+
}
|
|
258
|
+
// Always propagate errorContext when provided — unmeaningful taps are success=true
|
|
259
|
+
// but still carry triage context (predicate, strategy chain) that must reach blob8.
|
|
260
|
+
if (errorContext)
|
|
261
|
+
localEvent.errorContext = errorContext.substring(0, 150);
|
|
262
|
+
if (targetPlatform)
|
|
263
|
+
localEvent.targetPlatform = targetPlatform;
|
|
264
|
+
if (emptyResult !== undefined)
|
|
265
|
+
localEvent.emptyResult = emptyResult;
|
|
266
|
+
if (meaningful !== undefined)
|
|
267
|
+
localEvent.meaningful = meaningful;
|
|
268
|
+
if (changeRate !== undefined)
|
|
269
|
+
localEvent.changeRate = changeRate;
|
|
270
|
+
if (tapStrategy)
|
|
271
|
+
localEvent.tapStrategy = tapStrategy;
|
|
272
|
+
if (iosDriver)
|
|
273
|
+
localEvent.iosDriver = iosDriver;
|
|
274
|
+
if (emptyReason)
|
|
275
|
+
localEvent.emptyReason = emptyReason;
|
|
276
|
+
if (responsePreview)
|
|
277
|
+
localEvent.responsePreview = responsePreview;
|
|
278
|
+
if (artifactKey)
|
|
279
|
+
localEvent.artifactKey = artifactKey;
|
|
280
|
+
if (ocrClosestMatch)
|
|
281
|
+
localEvent.ocrClosestMatch = ocrClosestMatch;
|
|
282
|
+
if (fiberPressableCount)
|
|
283
|
+
localEvent.fiberPressableCount = fiberPressableCount;
|
|
284
|
+
if (accessibilityMatchCount)
|
|
285
|
+
localEvent.accessibilityMatchCount = accessibilityMatchCount;
|
|
286
|
+
if (appRoute)
|
|
287
|
+
localEvent.appRoute = appRoute;
|
|
288
|
+
appendFileSync(TELEMETRY_JSONL_PATH, JSON.stringify(localEvent) + "\n");
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
// Non-critical — local file sink failure should never affect tool execution
|
|
292
|
+
}
|
|
293
|
+
if (!telemetryEnabled)
|
|
294
|
+
return;
|
|
295
|
+
const now = Date.now();
|
|
296
|
+
// Start a new session on first tool use or after inactivity gap
|
|
297
|
+
if (!sessionStarted || (lastToolTimestamp && (now - lastToolTimestamp) > SESSION_INACTIVITY_MS)) {
|
|
298
|
+
if (sessionStarted) {
|
|
299
|
+
// End previous session before starting a new one
|
|
300
|
+
trackEvent("session_end", {
|
|
301
|
+
duration: lastToolTimestamp - sessionStartTime
|
|
302
|
+
});
|
|
303
|
+
sessionId = randomUUID();
|
|
304
|
+
}
|
|
305
|
+
sessionStarted = true;
|
|
306
|
+
sessionStartTime = now;
|
|
307
|
+
trackEvent("session_start_ai_devtools", {
|
|
308
|
+
isFirstRun: isFirstRun(),
|
|
309
|
+
firstTool: toolName
|
|
310
|
+
});
|
|
311
|
+
// Re-emit app_detected for any already-connected RN apps so the dashboard's
|
|
312
|
+
// period-scoped platform classification keeps working on long-lived sessions.
|
|
313
|
+
// Uses cached detection; no CDP round-trip.
|
|
314
|
+
for (const app of connectedApps.values()) {
|
|
315
|
+
if (app.appDetection)
|
|
316
|
+
trackAppDetection(app.appDetection);
|
|
317
|
+
}
|
|
318
|
+
// Lazy license check — runs once per session, tracked as tool_invocation for analytics
|
|
319
|
+
ensureLicense().then(({ source, status, durationMs }) => {
|
|
320
|
+
trackLicenseCheck(source, status.tier, durationMs);
|
|
321
|
+
}).catch(() => {
|
|
322
|
+
// License check failed — not critical, don't break tool flow
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
lastToolTimestamp = now;
|
|
326
|
+
const event = {
|
|
327
|
+
name: "tool_invocation",
|
|
328
|
+
timestamp: now,
|
|
329
|
+
toolName,
|
|
330
|
+
success,
|
|
331
|
+
duration: durationMs,
|
|
332
|
+
isFirstRun: isFirstRun()
|
|
333
|
+
};
|
|
334
|
+
if (!success && errorMessage) {
|
|
335
|
+
event.errorCategory = categorizeError(errorMessage, errorContext);
|
|
336
|
+
event.errorMessage = errorMessage.substring(0, 200);
|
|
337
|
+
}
|
|
338
|
+
// Always propagate errorContext when provided — unmeaningful taps are success=true
|
|
339
|
+
// but still carry triage context (predicate, strategy chain) that must reach blob8.
|
|
340
|
+
if (errorContext) {
|
|
341
|
+
event.errorContext = errorContext.substring(0, 150);
|
|
342
|
+
}
|
|
343
|
+
if (inputTokens !== undefined && inputTokens > 0)
|
|
344
|
+
event.inputTokens = inputTokens;
|
|
345
|
+
if (outputTokens !== undefined && outputTokens > 0)
|
|
346
|
+
event.outputTokens = outputTokens;
|
|
347
|
+
if (targetPlatform)
|
|
348
|
+
event.targetPlatform = targetPlatform;
|
|
349
|
+
if (emptyResult !== undefined)
|
|
350
|
+
event.emptyResult = emptyResult;
|
|
351
|
+
if (meaningful !== undefined)
|
|
352
|
+
event.meaningful = meaningful;
|
|
353
|
+
if (changeRate !== undefined)
|
|
354
|
+
event.changeRate = changeRate;
|
|
355
|
+
if (tapStrategy)
|
|
356
|
+
event.tapStrategy = tapStrategy;
|
|
357
|
+
if (iosDriver)
|
|
358
|
+
event.iosDriver = iosDriver;
|
|
359
|
+
if (emptyReason)
|
|
360
|
+
event.emptyReason = emptyReason;
|
|
361
|
+
if (artifactKey)
|
|
362
|
+
event.artifactKey = artifactKey;
|
|
363
|
+
if (ocrClosestMatch)
|
|
364
|
+
event.ocrClosestMatch = ocrClosestMatch;
|
|
365
|
+
if (fiberPressableCount)
|
|
366
|
+
event.fiberPressableCount = fiberPressableCount;
|
|
367
|
+
if (accessibilityMatchCount)
|
|
368
|
+
event.accessibilityMatchCount = accessibilityMatchCount;
|
|
369
|
+
if (appRoute)
|
|
370
|
+
event.appRoute = appRoute;
|
|
371
|
+
dispatch(event);
|
|
372
|
+
// Mirror tool_invocation to PostHog so insights/cohort filters can count
|
|
373
|
+
// per-tool usage natively. Cloudflare remains the source of truth; PostHog
|
|
374
|
+
// gets a parallel stream keyed on the same installation id.
|
|
375
|
+
try {
|
|
376
|
+
const client = getPostHogClient();
|
|
377
|
+
if (client) {
|
|
378
|
+
const phProps = {
|
|
379
|
+
tool_name: toolName,
|
|
380
|
+
success,
|
|
381
|
+
duration_ms: durationMs,
|
|
382
|
+
is_first_run: isFirstRun(),
|
|
383
|
+
server_version: getServerVersion(),
|
|
384
|
+
package_name: getPackageName(),
|
|
385
|
+
session_id: sessionId?.substring(0, 12) ?? "",
|
|
386
|
+
};
|
|
387
|
+
if (event.errorCategory)
|
|
388
|
+
phProps.error_category = event.errorCategory;
|
|
389
|
+
if (event.errorMessage)
|
|
390
|
+
phProps.error_message = event.errorMessage;
|
|
391
|
+
if (event.errorContext)
|
|
392
|
+
phProps.error_context = event.errorContext;
|
|
393
|
+
if (targetPlatform)
|
|
394
|
+
phProps.target_platform = targetPlatform;
|
|
395
|
+
if (emptyResult !== undefined)
|
|
396
|
+
phProps.empty_result = emptyResult;
|
|
397
|
+
if (meaningful !== undefined)
|
|
398
|
+
phProps.meaningful = meaningful;
|
|
399
|
+
if (changeRate !== undefined)
|
|
400
|
+
phProps.change_rate = changeRate;
|
|
401
|
+
if (tapStrategy)
|
|
402
|
+
phProps.tap_strategy = tapStrategy;
|
|
403
|
+
if (iosDriver)
|
|
404
|
+
phProps.ios_driver = iosDriver;
|
|
405
|
+
if (emptyReason)
|
|
406
|
+
phProps.empty_reason = emptyReason;
|
|
407
|
+
if (inputTokens !== undefined && inputTokens > 0)
|
|
408
|
+
phProps.input_tokens = inputTokens;
|
|
409
|
+
if (outputTokens !== undefined && outputTokens > 0)
|
|
410
|
+
phProps.output_tokens = outputTokens;
|
|
411
|
+
client.capture({
|
|
412
|
+
distinctId: getInstallationId(),
|
|
413
|
+
event: "tool_invocation",
|
|
414
|
+
properties: phProps,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
// PostHog errors must never affect tool flow.
|
|
420
|
+
}
|
|
421
|
+
// Increment local usage counter
|
|
422
|
+
incrementLocalUsage();
|
|
423
|
+
// Mirror platform-cohort signal to PostHog for native users.
|
|
424
|
+
// Mirrors the infra's native-user inference (backend/worker.ts:deriveNativePlatform)
|
|
425
|
+
// so PostHog cohort filters match the Cloudflare dashboard.
|
|
426
|
+
mirrorNativeCohortToPostHog(toolName);
|
|
427
|
+
}
|
|
428
|
+
// Track what we've already sent to PostHog so we don't re-identify on every tool call.
|
|
429
|
+
let _nativeKindSet = false;
|
|
430
|
+
let _lastNativePlatformSent = null;
|
|
431
|
+
function mirrorNativeCohortToPostHog(toolName) {
|
|
432
|
+
const platform = toolName.startsWith("ios_")
|
|
433
|
+
? "ios"
|
|
434
|
+
: toolName.startsWith("android_")
|
|
435
|
+
? "android"
|
|
436
|
+
: null;
|
|
437
|
+
if (!platform)
|
|
438
|
+
return;
|
|
439
|
+
// Skip when nothing new to send
|
|
440
|
+
if (_nativeKindSet && _lastNativePlatformSent === platform)
|
|
441
|
+
return;
|
|
442
|
+
try {
|
|
443
|
+
const client = getPostHogClient();
|
|
444
|
+
if (!client)
|
|
445
|
+
return;
|
|
446
|
+
const distinctId = getInstallationId();
|
|
447
|
+
const set = {};
|
|
448
|
+
const setOnce = {};
|
|
449
|
+
if (!_nativeKindSet) {
|
|
450
|
+
// $set_once: RN users keep platform_kind="rn" (set by trackAppDetection);
|
|
451
|
+
// native-only users get "native" the first time a platform-prefixed tool fires.
|
|
452
|
+
setOnce.platform_kind = "native";
|
|
453
|
+
_nativeKindSet = true;
|
|
454
|
+
}
|
|
455
|
+
if (_lastNativePlatformSent !== platform) {
|
|
456
|
+
set.platform_last_seen = platform;
|
|
457
|
+
_lastNativePlatformSent = platform;
|
|
458
|
+
}
|
|
459
|
+
client.identify({
|
|
460
|
+
distinctId,
|
|
461
|
+
properties: {
|
|
462
|
+
...(Object.keys(set).length > 0 ? { $set: set } : {}),
|
|
463
|
+
...(Object.keys(setOnce).length > 0 ? { $set_once: setOnce } : {}),
|
|
464
|
+
},
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
catch {
|
|
468
|
+
// PostHog errors must never affect tool flow.
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Records _license_check as a tool_invocation event without triggering session logic.
|
|
473
|
+
* Called from the ensureLicense() callback inside trackToolInvocation.
|
|
474
|
+
*/
|
|
475
|
+
function trackLicenseCheck(source, tier, durationMs) {
|
|
476
|
+
if (!telemetryEnabled)
|
|
477
|
+
return;
|
|
478
|
+
dispatch({
|
|
479
|
+
name: "tool_invocation",
|
|
480
|
+
timestamp: Date.now(),
|
|
481
|
+
toolName: "_license_check",
|
|
482
|
+
success: true,
|
|
483
|
+
duration: durationMs,
|
|
484
|
+
isFirstRun: isFirstRun(),
|
|
485
|
+
errorContext: `${source}:${tier}`
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Record auto-reconnect outcome for the CDP wrapper.
|
|
490
|
+
*
|
|
491
|
+
* Emits as a 'tool_invocation' row (so existing dashboards count it) with a
|
|
492
|
+
* synthetic toolName '_auto_reconnect' and `errorContext` carrying the
|
|
493
|
+
* outcome + originating toolName + transportPattern. Does not start a session
|
|
494
|
+
* or affect license counting.
|
|
495
|
+
*/
|
|
496
|
+
export function trackAutoReconnect(outcome, originatingToolName, transportPattern) {
|
|
497
|
+
if (!telemetryEnabled)
|
|
498
|
+
return;
|
|
499
|
+
// No-op outcomes ('not_needed') account for ~98% of events and carry zero
|
|
500
|
+
// signal — only emit when the wrapper actually attempted a reconnect.
|
|
501
|
+
if (outcome === "not_needed")
|
|
502
|
+
return;
|
|
503
|
+
// Skip events fired before a session_id is assigned (e.g. first
|
|
504
|
+
// executeInApp before session_start) — they're un-attributable.
|
|
505
|
+
if (!sessionId)
|
|
506
|
+
return;
|
|
507
|
+
dispatch({
|
|
508
|
+
name: "tool_invocation",
|
|
509
|
+
timestamp: Date.now(),
|
|
510
|
+
toolName: "_auto_reconnect",
|
|
511
|
+
success: outcome === "success",
|
|
512
|
+
duration: 0,
|
|
513
|
+
isFirstRun: isFirstRun(),
|
|
514
|
+
errorContext: JSON.stringify({
|
|
515
|
+
outcome,
|
|
516
|
+
tool: originatingToolName,
|
|
517
|
+
...(transportPattern ? { pattern: transportPattern } : {}),
|
|
518
|
+
}),
|
|
519
|
+
});
|
|
520
|
+
try {
|
|
521
|
+
const client = getPostHogClient();
|
|
522
|
+
if (client) {
|
|
523
|
+
client.capture({
|
|
524
|
+
distinctId: getInstallationId(),
|
|
525
|
+
event: "transport_auto_reconnect",
|
|
526
|
+
properties: {
|
|
527
|
+
outcome,
|
|
528
|
+
tool_name: originatingToolName,
|
|
529
|
+
transport_pattern: transportPattern,
|
|
530
|
+
server_version: getServerVersion(),
|
|
531
|
+
package_name: getPackageName(),
|
|
532
|
+
session_id: sessionId?.substring(0, 12) ?? "",
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
catch {
|
|
538
|
+
// PostHog errors must never affect tool flow.
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Records app detection result as an app_detected event.
|
|
543
|
+
* Called from appDetection.ts after successful detection.
|
|
544
|
+
*/
|
|
545
|
+
export function trackAppDetection(detection) {
|
|
546
|
+
if (!telemetryEnabled)
|
|
547
|
+
return;
|
|
548
|
+
dispatch({
|
|
549
|
+
name: "app_detected",
|
|
550
|
+
timestamp: Date.now(),
|
|
551
|
+
isFirstRun: isFirstRun(),
|
|
552
|
+
errorContext: JSON.stringify({
|
|
553
|
+
rn: detection.reactNativeVersion,
|
|
554
|
+
arch: detection.architecture,
|
|
555
|
+
eng: detection.jsEngine,
|
|
556
|
+
plat: detection.appPlatform,
|
|
557
|
+
os: detection.osVersion,
|
|
558
|
+
...(detection.expoSdkVersion ? { expo: detection.expoSdkVersion } : {}),
|
|
559
|
+
}),
|
|
560
|
+
targetPlatform: detection.appPlatform,
|
|
561
|
+
});
|
|
562
|
+
// Mirror to PostHog so insights/cohort filters can use kind + platform without custom queries.
|
|
563
|
+
try {
|
|
564
|
+
const client = getPostHogClient();
|
|
565
|
+
if (client) {
|
|
566
|
+
const distinctId = getInstallationId();
|
|
567
|
+
client.capture({
|
|
568
|
+
distinctId,
|
|
569
|
+
event: "app_detected",
|
|
570
|
+
properties: {
|
|
571
|
+
rn_version: detection.reactNativeVersion,
|
|
572
|
+
architecture: detection.architecture,
|
|
573
|
+
js_engine: detection.jsEngine,
|
|
574
|
+
platform: detection.appPlatform,
|
|
575
|
+
os_version: detection.osVersion,
|
|
576
|
+
...(detection.expoSdkVersion ? { expo_sdk: detection.expoSdkVersion } : {}),
|
|
577
|
+
platform_kind: "rn",
|
|
578
|
+
server_version: getServerVersion(),
|
|
579
|
+
package_name: getPackageName(),
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
// Person properties so cohort filters work natively in PostHog insights.
|
|
583
|
+
client.identify({
|
|
584
|
+
distinctId,
|
|
585
|
+
properties: {
|
|
586
|
+
$set: {
|
|
587
|
+
platform_kind: "rn",
|
|
588
|
+
platform_last_seen: detection.appPlatform,
|
|
589
|
+
rn_version: detection.reactNativeVersion,
|
|
590
|
+
architecture: detection.architecture,
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
// PostHog errors must never affect tool flow.
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Records a Fast Refresh recorder install event. Fired once per
|
|
602
|
+
* device-session by getRefreshStatus when the executor lazy-installs the
|
|
603
|
+
* recorder or detects an install failure. SDK-side installs (which happen
|
|
604
|
+
* before the executor sees the app) surface here as via != null with
|
|
605
|
+
* justInstalled = false on the first observation.
|
|
606
|
+
*/
|
|
607
|
+
export function trackFastRefreshInstall(detection) {
|
|
608
|
+
if (!telemetryEnabled)
|
|
609
|
+
return;
|
|
610
|
+
dispatch({
|
|
611
|
+
name: "fast_refresh_install",
|
|
612
|
+
timestamp: Date.now(),
|
|
613
|
+
isFirstRun: isFirstRun(),
|
|
614
|
+
errorContext: JSON.stringify({
|
|
615
|
+
via: detection.via,
|
|
616
|
+
installed: detection.recorderInstalled,
|
|
617
|
+
just: detection.justInstalled,
|
|
618
|
+
...(detection.reason ? { reason: detection.reason } : {}),
|
|
619
|
+
}),
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
// ============================================================================
|
|
623
|
+
// Event Dispatch
|
|
624
|
+
// ============================================================================
|
|
625
|
+
// One event per HTTP request, fired immediately. `keepalive: true` (undici,
|
|
626
|
+
// Node 18+) tells the runtime to complete the request even if the process
|
|
627
|
+
// exits right after — the Node equivalent of navigator.sendBeacon. No queue,
|
|
628
|
+
// no flush timer, no data loss on abrupt exit.
|
|
629
|
+
function dispatch(event) {
|
|
630
|
+
const payload = {
|
|
631
|
+
installationId: getInstallationId(),
|
|
632
|
+
sessionId: sessionId || undefined,
|
|
633
|
+
serverVersion: getServerVersion(),
|
|
634
|
+
packageName: getPackageName(),
|
|
635
|
+
buildToken: BUILD_TOKEN,
|
|
636
|
+
nodeVersion: process.version,
|
|
637
|
+
platform: process.platform,
|
|
638
|
+
events: [event]
|
|
639
|
+
};
|
|
640
|
+
fetch(TELEMETRY_ENDPOINT, {
|
|
641
|
+
method: "POST",
|
|
642
|
+
headers: {
|
|
643
|
+
"Content-Type": "application/json",
|
|
644
|
+
"X-API-Key": TELEMETRY_API_KEY
|
|
645
|
+
},
|
|
646
|
+
body: JSON.stringify(payload),
|
|
647
|
+
keepalive: true,
|
|
648
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
649
|
+
}).catch(() => {
|
|
650
|
+
// Silent: telemetry must never impact the user.
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
//# sourceMappingURL=telemetry.js.map
|