agent-device 0.20.9 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.9.apk → agent-device-android-ime-helper-0.21.0.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.0.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.9.manifest.json → agent-device-android-ime-helper-0.21.0.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.20.9.manifest.json → agent-device-android-snapshot-helper-0.21.0.manifest.json} +6 -6
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AudioProbe.swift +35 -33
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +6 -1
- package/apple/snapshot-bridge/LICENSE.idb +23 -0
- package/apple/snapshot-bridge/README.md +49 -0
- package/apple/snapshot-bridge/SnapshotBridge.m +280 -0
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.h +33 -0
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +382 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +58 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +19 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAlertVerification.swift +36 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerStringNormalization.swift +8 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +12 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +100 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +2 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +21 -12
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +21 -88
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AlertObservation.swift +124 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +110 -107
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +6 -14
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +85 -114
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +13 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +72 -175
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +10 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXElementTypes.swift +12 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +78 -64
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +17 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +47 -13
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +232 -438
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +98 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +229 -168
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotPresentationInvariant.swift +19 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +110 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +206 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +147 -25
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +21 -18
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +24 -307
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +206 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +158 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +19 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +49 -16
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +2 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +4 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +16 -20
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +111 -0
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +42 -81
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-trim.swift +35 -82
- package/dist/apple/snapshot-presentation/Package.swift +21 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotGeometry.swift +56 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +259 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentation.swift +153 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationFailure.swift +27 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationInvariant.swift +91 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +161 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotScopePolicy.swift +53 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +242 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +97 -0
- package/dist/src/adapter.js +1 -0
- package/dist/src/adb-executor.js +2 -0
- package/dist/src/adb-failure.js +1 -0
- package/dist/src/adb-host.js +1 -0
- package/dist/src/adb.js +1 -0
- package/dist/src/agent-browser-lifecycle.js +1 -0
- package/dist/src/agent-browser-process-record.js +1 -0
- package/dist/src/agent-browser-provider.js +1 -0
- package/dist/src/agent-browser-tool.js +1 -1
- package/dist/src/agent-device-client.js +2 -2
- package/dist/src/ai-sdk.d.ts +61 -0
- package/dist/src/ai-sdk.js +1 -0
- package/dist/src/alert-contract.js +1 -0
- package/dist/src/alert-runtime.js +1 -0
- package/dist/src/android-adb.d.ts +27 -19
- package/dist/src/android-adb.js +1 -1
- package/dist/src/android-input-ownership.js +1 -0
- package/dist/src/android-system-chrome.js +1 -0
- package/dist/src/android.js +1 -1
- package/dist/src/api.js +11 -0
- package/dist/src/app-catalog.js +1 -0
- package/dist/src/app-deployment-resolution.js +2 -0
- package/dist/src/app-helpers.js +1 -1
- package/dist/src/app-inventory-contract.js +1 -0
- package/dist/src/app-inventory.js +1 -0
- package/dist/src/app-launch.js +2 -0
- package/dist/src/app-lifecycle-facade.js +1 -0
- package/dist/src/app-lifecycle.js +3 -6
- package/dist/src/app-lifecycle2.js +2 -2
- package/dist/src/app-lifecycle3.js +1 -0
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-reconnect.js +1 -1
- package/dist/src/app-log-runtime.js +1 -4
- package/dist/src/app-log-runtime2.js +4 -0
- package/dist/src/app-parsers.js +4 -0
- package/dist/src/app-resolution-cache.js +1 -0
- package/dist/src/app-resolution-facade.js +1 -0
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/app-state.js +1 -2
- package/dist/src/application-lifecycle-interaction.js +1 -0
- package/dist/src/application-lifecycle-runtime.js +1 -0
- package/dist/src/apps-simctl.js +1 -0
- package/dist/src/archive.js +4 -0
- package/dist/src/artifact-download.js +1 -0
- package/dist/src/artifacts.d.ts +6 -2
- package/dist/src/artifacts.js +1 -1
- package/dist/src/async-lifecycle.js +1 -0
- package/dist/src/audio-probe-result.js +1 -0
- package/dist/src/audio-probe-runtime.js +1 -0
- package/dist/src/audio-probe-support.js +1 -0
- package/dist/src/auth-session.js +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/back-mode.js +1 -0
- package/dist/src/{url.js → base-url.js} +1 -1
- package/dist/src/boot-diagnostics.js +2 -2
- package/dist/src/byte-limit-stream.js +1 -1
- package/dist/src/capabilities.js +1 -0
- package/dist/src/capture.js +1 -0
- package/dist/src/catalog.js +1 -0
- package/dist/src/cli-command-aliases.js +1 -0
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +77 -51
- package/dist/src/cli-output.js +1 -1
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +5 -7
- package/dist/src/click-button.js +1 -0
- package/dist/src/client-metro-companion.js +1 -0
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +1606 -0
- package/dist/src/clipboard.js +1 -0
- package/dist/src/code-signature-cache.js +1 -0
- package/dist/src/code-signature.js +1 -0
- package/dist/src/color.js +1 -0
- package/dist/src/command-metadata.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/command-surface.js +1 -1
- package/dist/src/command-tools.js +2 -0
- package/dist/src/command.js +1 -0
- package/dist/src/{selector-vocabulary.js → compatibility-policy.js} +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/config2.js +1 -0
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +5 -5
- package/dist/src/contracts.d.ts +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -0
- package/dist/src/daemon-process.js +1 -0
- package/dist/src/daemon-registration.js +1 -0
- package/dist/src/daemon-shutdown-report.js +1 -1
- package/dist/src/daemon.js +2 -2
- package/dist/src/debug-symbols-facade.js +5 -0
- package/dist/src/deploy-result-target.js +1 -0
- package/dist/src/device-claim-inspection.js +1 -1
- package/dist/src/device-claim-rule.js +1 -0
- package/dist/src/device-input-state.d.ts +190 -3
- package/dist/src/device-inventory-context.js +1 -0
- package/dist/src/device-isolation.js +1 -0
- package/dist/src/device-release.js +1 -0
- package/dist/src/device-rotation.js +1 -0
- package/dist/src/device-selection-resolver.js +1 -0
- package/dist/src/device-session.js +1 -0
- package/dist/src/device.js +1 -1
- package/dist/src/device2.js +3 -2
- package/dist/src/diagnostics.js +3 -0
- package/dist/src/diagnostics2.js +1 -0
- package/dist/src/dispatch-resolve.js +1 -0
- package/dist/src/doctor-facade.js +1 -0
- package/dist/src/doctor-output.js +1 -0
- package/dist/src/doctor.js +1 -0
- package/dist/src/doctor2.js +1 -0
- package/dist/src/doctor3.js +1 -0
- package/dist/src/durable-resource.js +1 -0
- package/dist/src/entities.js +1 -1
- package/dist/src/error.js +2 -0
- package/dist/src/exec.js +1 -0
- package/dist/src/file.js +1 -0
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/format.js +2 -0
- package/dist/src/generic-settle.js +1 -1
- package/dist/src/generic.js +1 -1
- package/dist/src/gesture-admission.js +1 -0
- package/dist/src/gesture-plan-types.js +1 -0
- package/dist/src/gesture-plan.js +1 -0
- package/dist/src/gesture-runtime.js +1 -0
- package/dist/src/harmonyos.js +1 -1
- package/dist/src/hdc.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/host-file.js +1 -0
- package/dist/src/human-control-contract.js +1 -0
- package/dist/src/human-control.js +1 -0
- package/dist/src/index.d.ts +2 -1578
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -4
- package/dist/src/input-actions2.js +2 -1
- package/dist/src/install-artifact-facade.js +1 -0
- package/dist/src/install-source-network-transport.js +1 -0
- package/dist/src/install-source.d.ts +3 -10
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-positionals.js +1 -0
- package/dist/src/interaction-ref-policy.js +1 -0
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-catalog.js +1 -0
- package/dist/src/interactor-types.js +1 -0
- package/dist/src/interactor.js +6 -2
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.d.ts +1 -1
- package/dist/src/internal/bin.js +1 -2
- package/dist/src/internal/companion-tunnel.d.ts +1 -1
- package/dist/src/internal/companion-tunnel.js +1 -1
- package/dist/src/internal/daemon.d.ts +1 -1
- package/dist/src/internal/daemon.js +2 -4
- package/dist/src/internal/png-worker.d.ts +4 -4
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/internal/run-script-http-child.d.ts +4 -0
- package/dist/src/internal/run-script-http-child.js +1 -0
- package/dist/src/internal/update-check-entry.d.ts +1 -1
- package/dist/src/inventory.js +4 -4
- package/dist/src/inventory2.js +1 -1
- package/dist/src/inventory3.js +1 -1
- package/dist/src/inventory5.js +1 -1
- package/dist/src/inventory6.js +1 -1
- package/dist/src/ios-client.js +16 -0
- package/dist/src/ios-snapshot-acquisition.js +1 -0
- package/dist/src/ios-snapshot-adapter.js +1 -0
- package/dist/src/ios-snapshot-planning.js +1 -0
- package/dist/src/ios-snapshot-runtime.js +1 -0
- package/dist/src/json.js +1 -0
- package/dist/src/keyboard-actions.js +1 -0
- package/dist/src/launch-console.js +1 -0
- package/dist/src/lease-context.js +1 -1
- package/dist/src/lease-scope.js +1 -0
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +1618 -7
- package/dist/src/limrun.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -0
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/logcat.js +1 -1
- package/dist/src/macos-facade.js +1 -0
- package/dist/src/managed-device-scope.js +1 -0
- package/dist/src/mechanics.js +19 -0
- package/dist/src/metro.d.ts +4 -2
- package/dist/src/metro.js +1 -1
- package/dist/src/metro2.js +1 -1
- package/dist/src/mobile-snapshot-semantics.js +1 -0
- package/dist/src/multitouch-support.js +1 -0
- package/dist/src/numeric.js +1 -0
- package/dist/src/observability.js +1 -1
- package/dist/src/observation.js +2 -0
- package/dist/src/output-path.js +1 -1
- package/dist/src/owner-identity.js +3 -1
- package/dist/src/parameterized-recorded-fill.js +1 -0
- package/dist/src/parser.js +1 -1
- package/dist/src/perf-facade.js +2 -0
- package/dist/src/perf-runtime-operation-builder.js +1 -0
- package/dist/src/perf-runtime-plan.js +1 -0
- package/dist/src/perf-runtime.js +1 -0
- package/dist/src/perf.js +1 -4
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/physical-device-facade.js +1 -0
- package/dist/src/platform-request-scope.js +1 -0
- package/dist/src/platform-runtime-android-adb-host.js +1 -0
- package/dist/src/platform-runtime-android-mechanics.js +1 -0
- package/dist/src/platform-runtime-app-log-android-transport.js +1 -1
- package/dist/src/platform-runtime-app-log-process.js +1 -1
- package/dist/src/platform-runtime-apple-resources.js +1 -0
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-managed-owner.js +1 -0
- package/dist/src/platform-runtime-network-web-transport.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +4 -4
- package/dist/src/platform-runtime-runtime-hints.js +2 -2
- package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-runner-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-transport.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-harmony-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +1 -0
- package/dist/src/platform-runtime-screen-recording-web-host.js +1 -1
- package/dist/src/platform-runtime-unavailable.js +1 -0
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/plist.js +1 -1
- package/dist/src/png-worker-contract.js +1 -1
- package/dist/src/prepare-kind.js +1 -15
- package/dist/src/process-exit.js +1 -1
- package/dist/src/process.js +1 -0
- package/dist/src/provider-device-runtime.js +1 -0
- package/dist/src/provider-session-ownership.js +2 -0
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/provider.js +1 -1
- package/dist/src/providers.js +1 -0
- package/dist/src/proxy.js +2 -2
- package/dist/src/react-native-overlay.js +1 -0
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/rect-center.js +1 -0
- package/dist/src/register-builtins.js +1 -0
- package/dist/src/registry.js +39 -28
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay-divergence.js +2 -0
- package/dist/src/replay.js +2 -2
- package/dist/src/reporting.js +8 -8
- package/dist/src/request-admission.js +1 -0
- package/dist/src/request-cancel.js +1 -0
- package/dist/src/request-cancellation.js +1 -0
- package/dist/src/request-progress-protocol.js +1 -0
- package/dist/src/request-providers.js +1 -0
- package/dist/src/request-runtime-binding.js +1 -0
- package/dist/src/request.js +1 -0
- package/dist/src/result-serialization.js +1 -0
- package/dist/src/retry.js +1 -0
- package/dist/src/rolldown-runtime.js +1 -1
- package/dist/src/runner-cache-metadata.js +2 -0
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -0
- package/dist/src/runner-owner-facade.js +1 -0
- package/dist/src/runner-owner-state.js +1 -0
- package/dist/src/runner-presentation.js +1 -0
- package/dist/src/runner-selector-query.js +1 -0
- package/dist/src/runner.js +1 -0
- package/dist/src/{runtime-transport.js → runtime-transport-hints.js} +1 -1
- package/dist/src/runtime.js +3 -3
- package/dist/src/runtime2.js +4 -4
- package/dist/src/runtime3.js +1 -1
- package/dist/src/runtime4.js +4 -3
- package/dist/src/runtime5.js +1 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +1 -1
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +1 -1
- package/dist/src/scoped-provider.js +1 -1
- package/dist/src/screen-recording-completion.js +1 -0
- package/dist/src/screen-recording-live-handle.js +1 -0
- package/dist/src/screen-recording-options.js +1 -0
- package/dist/src/screen-recording-resource-recovery.js +1 -0
- package/dist/src/screen-recording-runtime.js +1 -0
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-result.js +1 -6
- package/dist/src/screenshot-runtime.js +1 -0
- package/dist/src/screenshot.js +1 -1
- package/dist/src/screenshot2.js +1 -0
- package/dist/src/screenshot3.js +5 -0
- package/dist/src/script.js +1 -0
- package/dist/src/scroll-command.js +1 -0
- package/dist/src/scroll-gesture.js +1 -0
- package/dist/src/scroll-indicator.js +1 -0
- package/dist/src/sdk-batch-runner.d.ts +23 -6
- package/dist/src/sdk-batch-runner.js +2 -3
- package/dist/src/sdk-batch.js +2 -0
- package/dist/src/sdk-contracts.d.ts +222 -99
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.d.ts +1 -1
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-io.js +1 -1
- package/dist/src/sdk-remote-config.d.ts +1 -1
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +539 -199
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selection.js +1 -0
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/semantic-index.js +1 -0
- package/dist/src/server.js +10 -3
- package/dist/src/session-allocation.js +1 -0
- package/dist/src/session-artifact-paths.js +1 -0
- package/dist/src/session-paths.js +1 -0
- package/dist/src/session-repair-tombstone.js +1 -0
- package/dist/src/session-routing.js +1 -0
- package/dist/src/session-runtime-admission.js +1 -0
- package/dist/src/session-snapshot.js +1 -0
- package/dist/src/session-store.js +4 -0
- package/dist/src/session-target-evidence.js +1 -1
- package/dist/src/session2.js +5 -28
- package/dist/src/settings.js +1 -0
- package/dist/src/shared.js +2 -2
- package/dist/src/simctl-facade.js +1 -0
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-facade.js +1 -0
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-capture-annotations.js +1 -0
- package/dist/src/snapshot-desktop-projection.js +1 -0
- package/dist/src/snapshot-diagnostics.js +1 -0
- package/dist/src/snapshot-process.js +1 -0
- package/dist/src/snapshot-quality-backend-capabilities.js +1 -0
- package/dist/src/snapshot-quality-verdict.js +1 -0
- package/dist/src/snapshot-runtime-binding.js +1 -0
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-scope.js +1 -0
- package/dist/src/snapshot-state.js +1 -0
- package/dist/src/snapshot.js +1 -8
- package/dist/src/snapshot2.js +1 -1
- package/dist/src/snapshot3.js +1 -1
- package/dist/src/snapshot4.js +1 -0
- package/dist/src/src.js +1 -1
- package/dist/src/src2.js +1 -1
- package/dist/src/src3.js +1 -2
- package/dist/src/src4.js +1 -0
- package/dist/src/src5.js +1 -0
- package/dist/src/src6.js +1 -0
- package/dist/src/src7.js +2 -0
- package/dist/src/src8.js +115 -0
- package/dist/src/startup-recovery-fence.js +1 -0
- package/dist/src/status-markers.js +1 -0
- package/dist/src/string-enum.js +1 -1
- package/dist/src/success-text.js +1 -0
- package/dist/src/surface-snapshot.js +1 -0
- package/dist/src/surface-snapshot2.js +1 -0
- package/dist/src/takeover.js +5 -0
- package/dist/src/tool-provider-facade.js +1 -0
- package/dist/src/tool-provider.js +4 -3
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/tool-provider3.js +1 -0
- package/dist/src/toolchain-probe.js +2 -0
- package/dist/src/touch-runtime.js +1 -0
- package/dist/src/transport.js +3 -0
- package/dist/src/tree.js +1 -0
- package/dist/src/ttl-memo.js +1 -0
- package/dist/src/tv-remote.js +1 -0
- package/dist/src/type-text-runtime.js +1 -0
- package/dist/src/undici.js +99 -0
- package/dist/src/update-check.js +1 -1
- package/dist/src/verified-file.js +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/video.js +2 -2
- package/dist/src/web.js +2 -1
- package/dist/src/web2.js +1 -0
- package/dist/src/webdriver-ios-snapshot.js +1 -0
- package/dist/src/webdriver-source.js +1 -0
- package/linux/atspi-dump.py +54 -9
- package/package.json +73 -38
- package/server.json +9 -3
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.20.9.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.9.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.9.apk.sha256 +0 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CoordinateTextEntryTests.swift +0 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+FlatSnapshotFiltering.swift +0 -75
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+LifecycleCacheTests.swift +0 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+RecordingTests.swift +0 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SelectorMatchPolicyTests.swift +0 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTraversalIdentityTests.swift +0 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +0 -4
- package/dist/src/appearance.js +0 -1
- package/dist/src/apps.js +0 -5
- package/dist/src/audio-probe.js +0 -1
- package/dist/src/cancel.js +0 -1
- package/dist/src/cli-grammar.js +0 -1
- package/dist/src/command-catalog.js +0 -1
- package/dist/src/debug-symbols.js +0 -5
- package/dist/src/device-input-state.js +0 -2
- package/dist/src/device-ready.js +0 -1
- package/dist/src/dispatch.js +0 -1
- package/dist/src/handler-utils.js +0 -1
- package/dist/src/helper-package-install.js +0 -1
- package/dist/src/host-process.js +0 -3
- package/dist/src/ime-lifecycle.js +0 -2
- package/dist/src/ime-recovery-marker.js +0 -1
- package/dist/src/input-actions3.js +0 -1
- package/dist/src/install-artifact.js +0 -1
- package/dist/src/install-artifact2.js +0 -1
- package/dist/src/interaction-common.js +0 -1
- package/dist/src/interaction-runtime.js +0 -1
- package/dist/src/interaction-snapshot.js +0 -1
- package/dist/src/manifest.js +0 -1
- package/dist/src/method-scope.js +0 -1
- package/dist/src/png-resize.js +0 -1
- package/dist/src/process-lock.js +0 -1
- package/dist/src/runner-lease.js +0 -1
- package/dist/src/runner-sequence.js +0 -1
- package/dist/src/screenshot-geometry.js +0 -1
- package/dist/src/sdk-android-adb.d.ts +0 -245
- package/dist/src/sdk-android-adb.js +0 -4
- package/dist/src/sdk.js +0 -1
- package/dist/src/setting-state.js +0 -1
- package/dist/src/shell-quote.js +0 -1
- package/dist/src/snapshot-session.js +0 -1
- package/dist/src/timing-safe-equal.js +0 -1
- package/dist/src/unsupported-interactor.js +0 -1
- package/dist/src/verdict.js +0 -1
- /package/dist/src/{recording-telemetry.js → telemetry.js} +0 -0
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { D as Rect, T as Point } from "./sdk-contracts.js";
|
|
2
|
-
import { Readable, Writable } from "node:stream";
|
|
3
|
-
import { StdioOptions, spawn } from "node:child_process";
|
|
4
|
-
//#region src/platforms/android/ime-helper-types.d.ts
|
|
5
|
-
type AndroidImeHelperManifest = {
|
|
6
|
-
name: 'android-ime-helper';
|
|
7
|
-
version: string;
|
|
8
|
-
assetName: string;
|
|
9
|
-
sha256: string;
|
|
10
|
-
packageName: string;
|
|
11
|
-
versionCode: number;
|
|
12
|
-
serviceComponent: string;
|
|
13
|
-
broadcastProtocol: 'android-ime-helper-v1';
|
|
14
|
-
};
|
|
15
|
-
type AndroidImeHelperArtifact = {
|
|
16
|
-
apkPath: string;
|
|
17
|
-
manifest: AndroidImeHelperManifest;
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/platforms/android/snapshot-helper-types.d.ts
|
|
21
|
-
type AndroidSnapshotHelperManifest = {
|
|
22
|
-
name: 'android-snapshot-helper';
|
|
23
|
-
version: string;
|
|
24
|
-
releaseTag?: string;
|
|
25
|
-
assetName?: string;
|
|
26
|
-
apkUrl: string | null;
|
|
27
|
-
sha256: string;
|
|
28
|
-
checksumName?: string;
|
|
29
|
-
packageName: string;
|
|
30
|
-
versionCode: number;
|
|
31
|
-
instrumentationRunner: string;
|
|
32
|
-
minSdk: number;
|
|
33
|
-
targetSdk?: number;
|
|
34
|
-
outputFormat: 'uiautomator-xml';
|
|
35
|
-
statusProtocol: 'android-snapshot-helper-v1';
|
|
36
|
-
installArgs: string[];
|
|
37
|
-
};
|
|
38
|
-
type AndroidSnapshotHelperArtifact = {
|
|
39
|
-
apkPath: string;
|
|
40
|
-
manifest: AndroidSnapshotHelperManifest;
|
|
41
|
-
};
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region packages/contracts/src/scroll-gesture.d.ts
|
|
44
|
-
declare const SCROLL_INPUT_DIRECTIONS: readonly ['up', 'down', 'left', 'right', 'top', 'bottom'];
|
|
45
|
-
type ScrollInputDirection = (typeof SCROLL_INPUT_DIRECTIONS)[number];
|
|
46
|
-
declare const SCROLL_DIRECTIONS: readonly ['up', 'down', 'left', 'right'];
|
|
47
|
-
type ScrollDirection = (typeof SCROLL_DIRECTIONS)[number];
|
|
48
|
-
declare const SWIPE_PRESETS: readonly ['left', 'right', 'left-edge', 'right-edge'];
|
|
49
|
-
type SwipePreset = (typeof SWIPE_PRESETS)[number];
|
|
50
|
-
declare const SWIPE_PATTERNS: readonly ['one-way', 'ping-pong'];
|
|
51
|
-
type SwipePattern = (typeof SWIPE_PATTERNS)[number];
|
|
52
|
-
type TransformGestureParams = {
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
55
|
-
dx: number;
|
|
56
|
-
dy: number;
|
|
57
|
-
scale: number;
|
|
58
|
-
degrees: number;
|
|
59
|
-
durationMs?: number;
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region packages/contracts/src/gesture-plan-types.d.ts
|
|
63
|
-
type GesturePointerCount = 1 | 2;
|
|
64
|
-
/** Selects one-pointer release timing without changing semantic gesture intent. */
|
|
65
|
-
type GestureExecutionProfile = 'endpoint-hold' | 'timed-pan';
|
|
66
|
-
type PointerTrajectorySample = {
|
|
67
|
-
offsetMs: number;
|
|
68
|
-
point: Point;
|
|
69
|
-
};
|
|
70
|
-
type PointerTrajectory = {
|
|
71
|
-
pointerId: 0 | 1;
|
|
72
|
-
samples: readonly PointerTrajectorySample[];
|
|
73
|
-
};
|
|
74
|
-
type SinglePointerTrajectory = {
|
|
75
|
-
pointerId: 0;
|
|
76
|
-
samples: readonly [PointerTrajectorySample, PointerTrajectorySample, ...PointerTrajectorySample[]];
|
|
77
|
-
};
|
|
78
|
-
type SinglePointerGesturePlan = {
|
|
79
|
-
topology: 'single';
|
|
80
|
-
intent: 'fling' | 'pan';
|
|
81
|
-
executionProfile: GestureExecutionProfile;
|
|
82
|
-
durationMs: number;
|
|
83
|
-
viewport: Rect;
|
|
84
|
-
pointers: readonly [SinglePointerTrajectory];
|
|
85
|
-
};
|
|
86
|
-
type MultiTouchGesturePlan = {
|
|
87
|
-
topology: 'two';
|
|
88
|
-
intent: 'pan' | 'pinch' | 'rotate' | 'transform';
|
|
89
|
-
durationMs: number;
|
|
90
|
-
viewport: Rect;
|
|
91
|
-
pointers: readonly [PointerTrajectory, PointerTrajectory];
|
|
92
|
-
};
|
|
93
|
-
type GesturePlan = SinglePointerGesturePlan | MultiTouchGesturePlan;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/platforms/android/touch-plan.d.ts
|
|
96
|
-
type AndroidLongPressTouchPlan = {
|
|
97
|
-
topology: 'single';
|
|
98
|
-
intent: 'longPress';
|
|
99
|
-
durationMs: number;
|
|
100
|
-
pointers: readonly [PointerTrajectory];
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Transport samples are strictly denser than the canonical endpoint pair, so the shared plan a
|
|
104
|
-
* command builds cannot satisfy the transport types: skipping the lowering below is a type error
|
|
105
|
-
* at every injection seam rather than a silently sparse gesture.
|
|
106
|
-
*/
|
|
107
|
-
type AndroidTransportSamples = readonly [PointerTrajectorySample, PointerTrajectorySample, PointerTrajectorySample, ...PointerTrajectorySample[]];
|
|
108
|
-
type AndroidTransportSinglePointerTrajectory = {
|
|
109
|
-
pointerId: 0;
|
|
110
|
-
samples: AndroidTransportSamples;
|
|
111
|
-
};
|
|
112
|
-
type AndroidTransportSinglePointerGesturePlan = Omit<SinglePointerGesturePlan, 'pointers'> & {
|
|
113
|
-
pointers: readonly [AndroidTransportSinglePointerTrajectory];
|
|
114
|
-
};
|
|
115
|
-
type AndroidTransportGesturePlan = AndroidTransportSinglePointerGesturePlan | MultiTouchGesturePlan;
|
|
116
|
-
type AndroidProviderTouchPlan = AndroidTransportGesturePlan | (AndroidLongPressTouchPlan & {
|
|
117
|
-
viewport: Rect;
|
|
118
|
-
});
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/utils/exec.d.ts
|
|
121
|
-
type ExecResult = {
|
|
122
|
-
stdout: string;
|
|
123
|
-
stderr: string;
|
|
124
|
-
exitCode: number;
|
|
125
|
-
stdoutBuffer?: Buffer;
|
|
126
|
-
};
|
|
127
|
-
type ExecOptions = {
|
|
128
|
-
cwd?: string;
|
|
129
|
-
env?: NodeJS.ProcessEnv;
|
|
130
|
-
allowFailure?: boolean;
|
|
131
|
-
binaryStdout?: boolean;
|
|
132
|
-
stdin?: string | Buffer;
|
|
133
|
-
timeoutMs?: number;
|
|
134
|
-
detached?: boolean;
|
|
135
|
-
signal?: AbortSignal;
|
|
136
|
-
/** Max stdout/stderr bytes for synchronous runs (default Node ~1MB). */
|
|
137
|
-
maxBuffer?: number;
|
|
138
|
-
};
|
|
139
|
-
type ExecBackgroundOptions = ExecOptions & {
|
|
140
|
-
/**
|
|
141
|
-
* Capture stdout/stderr into the wait result when the child has piped stdio.
|
|
142
|
-
* Set false when the caller owns, ignores, or forwards the streams.
|
|
143
|
-
*/
|
|
144
|
-
captureOutput?: boolean;
|
|
145
|
-
stdio?: StdioOptions;
|
|
146
|
-
};
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/platforms/android/adb-executor.d.ts
|
|
149
|
-
type AndroidAdbExecutorOptions = Pick<ExecOptions, 'allowFailure' | 'timeoutMs' | 'binaryStdout' | 'stdin' | 'signal'>;
|
|
150
|
-
type AndroidAdbExecutorResult = Pick<ExecResult, 'exitCode' | 'stdout' | 'stderr' | 'stdoutBuffer'>;
|
|
151
|
-
type AndroidAdbProcess = {
|
|
152
|
-
pid?: number;
|
|
153
|
-
exitCode?: number | null;
|
|
154
|
-
signalCode?: NodeJS.Signals | null;
|
|
155
|
-
stdin: Writable | null;
|
|
156
|
-
stdout: Readable | null;
|
|
157
|
-
stderr: Readable | null;
|
|
158
|
-
killed: boolean;
|
|
159
|
-
kill(signal?: NodeJS.Signals | number): boolean;
|
|
160
|
-
once(event: 'exit' | 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): unknown;
|
|
161
|
-
on(event: 'error', listener: (error: Error) => void): unknown;
|
|
162
|
-
on(event: 'exit' | 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): unknown;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* Runs device-scoped adb arguments after the device serial has already been selected.
|
|
166
|
-
* Implementations must be safe to call concurrently for one request.
|
|
167
|
-
*/
|
|
168
|
-
type AndroidAdbExecutor = (args: string[], options?: AndroidAdbExecutorOptions) => Promise<AndroidAdbExecutorResult>;
|
|
169
|
-
type AndroidAdbSpawner = (args: string[], options?: ExecBackgroundOptions) => AndroidAdbProcess;
|
|
170
|
-
type AndroidPortReverseEndpoint = `tcp:${number}` | `localabstract:${string}`;
|
|
171
|
-
type AndroidPortReverseMapping = {
|
|
172
|
-
local: AndroidPortReverseEndpoint;
|
|
173
|
-
remote: AndroidPortReverseEndpoint;
|
|
174
|
-
ownerId?: string;
|
|
175
|
-
};
|
|
176
|
-
type AndroidPortReverseOptions = {
|
|
177
|
-
signal?: AbortSignal;
|
|
178
|
-
timeoutMs?: number;
|
|
179
|
-
};
|
|
180
|
-
type AndroidPortReverseProvider = {
|
|
181
|
-
ensure(mapping: AndroidPortReverseMapping, options?: AndroidPortReverseOptions): Promise<void>;
|
|
182
|
-
remove(local: AndroidPortReverseEndpoint, options?: AndroidPortReverseOptions): Promise<void>;
|
|
183
|
-
removeAllOwned(ownerId: string, options?: AndroidPortReverseOptions): Promise<void>;
|
|
184
|
-
list?(options?: AndroidPortReverseOptions): Promise<AndroidPortReverseMapping[]>;
|
|
185
|
-
};
|
|
186
|
-
type AndroidAdbTransferOptions = AndroidAdbExecutorOptions;
|
|
187
|
-
type AndroidAdbInstallOptions = AndroidAdbTransferOptions & {
|
|
188
|
-
replace?: boolean;
|
|
189
|
-
allowTestPackages?: boolean;
|
|
190
|
-
allowDowngrade?: boolean;
|
|
191
|
-
grantPermissions?: boolean;
|
|
192
|
-
};
|
|
193
|
-
type AndroidAdbPuller = (remotePath: string, localPath: string, options?: AndroidAdbTransferOptions) => Promise<AndroidAdbExecutorResult>;
|
|
194
|
-
/**
|
|
195
|
-
* Installs an APK path. Implementations are responsible for honoring semantic
|
|
196
|
-
* install options such as replace/test/downgrade/grant-permissions.
|
|
197
|
-
*/
|
|
198
|
-
type AndroidAdbInstaller = (apkPath: string, options?: AndroidAdbInstallOptions) => Promise<AndroidAdbExecutorResult>;
|
|
199
|
-
type AndroidBundleInstaller = (bundlePath: string, options: Readonly<{
|
|
200
|
-
mode: string;
|
|
201
|
-
signal?: AbortSignal;
|
|
202
|
-
}>) => Promise<void>;
|
|
203
|
-
type AndroidTextInputAction = 'type' | 'fill';
|
|
204
|
-
type AndroidTextInjectionRequest = {
|
|
205
|
-
action: AndroidTextInputAction;
|
|
206
|
-
text: string;
|
|
207
|
-
delayMs?: number;
|
|
208
|
-
/**
|
|
209
|
-
* Present only for fill. Providers must make this target the focused/replaced
|
|
210
|
-
* input for the request, not inject into an unrelated currently focused field.
|
|
211
|
-
*/
|
|
212
|
-
target?: {
|
|
213
|
-
x: number;
|
|
214
|
-
y: number;
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
type AndroidTextInjector = (request: AndroidTextInjectionRequest) => Promise<void>;
|
|
218
|
-
type AndroidTouchInjector = (request: AndroidProviderTouchPlan) => Promise<Record<string, unknown> | void>;
|
|
219
|
-
type AndroidGestureViewportProvider = () => Promise<Rect>;
|
|
220
|
-
type AndroidAdbProviderBase = {
|
|
221
|
-
/**
|
|
222
|
-
* Fallback executor for device-scoped adb arguments. Providers may omit explicit
|
|
223
|
-
* methods to keep the legacy exec-shaped pull/install fallback.
|
|
224
|
-
*/
|
|
225
|
-
exec: AndroidAdbExecutor;
|
|
226
|
-
spawn?: AndroidAdbSpawner;
|
|
227
|
-
reverse?: AndroidPortReverseProvider;
|
|
228
|
-
pull?: AndroidAdbPuller;
|
|
229
|
-
install?: AndroidAdbInstaller;
|
|
230
|
-
installBundle?: AndroidBundleInstaller;
|
|
231
|
-
text?: AndroidTextInjector;
|
|
232
|
-
snapshotHelperArtifact?: AndroidSnapshotHelperArtifact;
|
|
233
|
-
imeHelperArtifact?: AndroidImeHelperArtifact;
|
|
234
|
-
};
|
|
235
|
-
type AndroidTouchCapabilities = {
|
|
236
|
-
touch?: never;
|
|
237
|
-
gestureViewport?: never;
|
|
238
|
-
} | {
|
|
239
|
-
touch: AndroidTouchInjector;
|
|
240
|
-
gestureViewport: AndroidGestureViewportProvider;
|
|
241
|
-
};
|
|
242
|
-
type AndroidAdbProvider = AndroidAdbProviderBase & AndroidTouchCapabilities;
|
|
243
|
-
declare function createAndroidPortReverseManager(provider: AndroidAdbProvider | AndroidAdbExecutor): AndroidPortReverseProvider;
|
|
244
|
-
//#endregion
|
|
245
|
-
export { createAndroidPortReverseManager as a, ScrollDirection as c, SwipePreset as d, TransformGestureParams as f, AndroidPortReverseEndpoint as i, ScrollInputDirection as l, AndroidAdbExecutorOptions as n, GesturePlan as o, AndroidAdbProvider as r, GesturePointerCount as s, AndroidAdbExecutor as t, SwipePattern as u };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime.js";import{D as t,_ as n}from"./sdk-contracts.js";import r from"node:path";import i from"node:crypto";import{AsyncLocalStorage as a}from"node:async_hooks";import o,{constants as s}from"node:fs";import c from"node:os";import{pipeline as l}from"node:stream/promises";import{Readable as u}from"node:stream";import{access as d,stat as f}from"node:fs/promises";import{spawn as p,spawnSync as m}from"node:child_process";const h=new a;function g(){return i.randomBytes(8).toString(`hex`)}function ee(){return`${Date.now().toString(36)}-${i.randomBytes(4).toString(`hex`)}`}async function te(e,t){let n={...e,diagnosticId:ee(),events:[],liveWrittenEventCount:0,phaseCounts:new Map,sensitiveValues:new Set};return await h.run(n,t)}function _(e){let t=h.getStore();t&&Object.assign(t,e)}function v(){let e=h.getStore();return e?{diagnosticId:e.diagnosticId,requestId:e.requestId,session:e.session,command:e.command,debug:e.debug,flushOnSuccess:e.flushOnSuccess}:{}}function ne(e){e&&h.getStore()?.sensitiveValues.add(e)}function re(e){let t=h.getStore();if(!t)return 0;let n=0;for(let r of e)n+=t.phaseCounts.get(r)??0;return n}function y(e){let t=h.getStore();if(!t)return;let n={ts:new Date().toISOString(),level:e.level??`info`,phase:e.phase,session:t.session,requestId:t.requestId,command:t.command,durationMs:e.durationMs,data:e.data?b(t,e.data):void 0};if(t.events.push(n),t.phaseCounts.set(e.phase,(t.phaseCounts.get(e.phase)??0)+1),!t.debug&&!t.traceLogPath)return;let r=`${JSON.stringify(n)}\n`;try{t.debug&&t.logPath&&(S(t.logPath,r),t.liveWrittenEventCount=t.events.length),t.traceLogPath&&S(t.traceLogPath,r),t.debug&&!t.logPath&&!t.traceLogPath&&process.stderr.write(`[agent-device][diag] ${r}`)}catch{}}async function ie(e,t,n){let r=Date.now();try{let i=await t();return y({level:`info`,phase:e,durationMs:Date.now()-r,data:n}),i}catch(t){throw y({level:`error`,phase:e,durationMs:Date.now()-r,data:{...n??{},error:t instanceof Error?t.message:String(t)}}),t}}function ae(e={}){let t=h.getStore();if(!t||!e.force&&!t.debug&&!t.flushOnSuccess||t.events.length===0)return null;try{if(t.logPath){let e=t.events.slice(t.liveWrittenEventCount);if(e.length>0){let n=e.map(e=>JSON.stringify(b(t,e)));S(t.logPath,`${n.join(`
|
|
2
|
-
`)}\n`)}let n=t.logPath;return t.events=[],t.liveWrittenEventCount=0,n}let e=oe(t.session??`default`),n=new Date().toISOString().slice(0,10),i=r.join(c.homedir(),`.agent-device`,`logs`,e,n);o.mkdirSync(i,{recursive:!0});let a=new Date().toISOString().replace(/[:.]/g,`-`),s=r.join(i,`${a}-${t.diagnosticId}.ndjson`),l=t.events.map(e=>JSON.stringify(b(t,e)));return o.writeFileSync(s,`${l.join(`
|
|
3
|
-
`)}\n`),t.events=[],s}catch{return null}}function b(e,n){return x(t(n),[...e.sensitiveValues].sort((e,t)=>t.length-e.length))}function x(e,t){return typeof e==`string`?t.reduce((e,t)=>e.replaceAll(t,`[REDACTED]`),e):Array.isArray(e)?e.map(e=>x(e,t)):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,n])=>[e,x(n,t)]))}function oe(e){return e.replace(/[^a-zA-Z0-9._-]/g,`_`)}function S(e,t){o.mkdirSync(r.dirname(e),{recursive:!0}),o.appendFileSync(e,t,`utf8`)}const se=new Set([`1`,`true`,`yes`,`on`]),ce=new Set([`0`,`false`,`no`,`off`]);function le(e){return`AGENT_DEVICE_${e.replace(/([A-Z])/g,`_$1`).replace(/[^A-Za-z0-9_]/g,`_`).toUpperCase()}`}function ue(e,t,r,i){if(e.multiple)return(Array.isArray(t)?t:[t]).map(t=>ue({...e,multiple:!1},t,r,i));if(e.type===`boolean`)return de(t,r,i);if(e.type===`booleanOrString`){if(typeof t==`boolean`)return t;if(typeof t==`string`&&C(t)!==void 0)return C(t);if(typeof t==`string`&&t.trim().length>0)return t;throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Expected boolean or non-empty string.`)}if(e.type===`string`){if(typeof t==`string`&&t.trim().length>0)return t;throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Expected non-empty string.`)}if(e.type===`enum`){if(e.setValue!==void 0)return fe(e,t,r,i);if(typeof t!=`string`||!e.enumValues?.includes(t))throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Expected one of: ${e.enumValues?.join(`, `)}.`);return t}let a=typeof t==`number`?t:typeof t==`string`?Number(t):NaN;if(!Number.isFinite(a)||e.type===`int`&&!Number.isInteger(a))throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Expected ${e.type===`int`?`integer`:`number`}.`);if(typeof e.min==`number`&&a<e.min)throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Must be >= ${e.min}.`);if(typeof e.max==`number`&&a>e.max)throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Must be <= ${e.max}.`);return a}function de(e,t,r){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=C(e);if(t!==void 0)return t}throw new n(`INVALID_ARGS`,`Invalid value for "${r}" in ${t}. Expected boolean.`)}function C(e){let t=e.trim().toLowerCase();if(se.has(t))return!0;if(ce.has(t))return!1}function fe(e,t,r,i){let a=e.setValue;if(t===a)return a;if(typeof t==`string`){let e=t.trim();if(e===``||e===`true`||e===`1`)return a;if(e===`false`||e===`0`)return}if(t===!0)return a;if(t!==!1)throw new n(`INVALID_ARGS`,`Invalid value for "${i}" in ${r}. Expected boolean-like value for enum flag.`)}var pe=e({coerceExecResult:()=>O,execFailureDetails:()=>V,isExecutablePath:()=>H,requireExecSuccess:()=>we,resolveExecutableOverridePath:()=>A,resolveFileOverridePath:()=>ve,runCmd:()=>E,runCmdBackground:()=>P,runCmdDetached:()=>M,runCmdDetachedMonitored:()=>N,runCmdStreaming:()=>D,runCmdSync:()=>j,whichCmd:()=>_e,withCommandExecutorOverride:()=>ge,withoutCommandExecutorOverride:()=>T});const me=/^[A-Za-z0-9][A-Za-z0-9._+-]*$/,he=[`.com`,`.exe`,`.bat`,`.cmd`],w=new a;async function ge(e,t){return e?await w.run(e,t):await t()}async function T(e){return await w.run(void 0,e)}async function E(e,t,n={}){let r=w.getStore()?.(e,t,n);return r?O(await r):await k(e,t,n)}async function D(e,t,n={}){let r=w.getStore()?.(e,t,n);return r?O(await r):await k(e,t,n)}function O(e){let t=typeof e.stdout==`string`?e.stdout:String(e.stdout??``),n=typeof e.stderr==`string`?e.stderr:String(e.stderr??``),r=typeof e.exitCode==`number`?e.exitCode:1;return t===e.stdout&&n===e.stderr&&r===e.exitCode?e:{...e,stdout:t,stderr:n,exitCode:r}}function k(e,t,n={}){let r=L(e),i=F();return new Promise((a,o)=>{let s=p(r,t,{cwd:n.cwd,env:n.env,stdio:[`pipe`,`pipe`,`pipe`],detached:n.detached,windowsHide:!0,shell:!1});n.onSpawn?.(s);let c=``,l=n.binaryStdout?[]:void 0,u=``,d=!1,f=U(n.timeoutMs),m=f?setTimeout(()=>{d=!0,W(s,n.detached)},f):null,h=Me(s,n);n.binaryStdout||s.stdout.setEncoding(`utf8`),s.stderr.setEncoding(`utf8`),Ne(s,n.stdin).catch(i=>{h.didAbort||d||Pe(i)||(o(xe(r,e,t,i)),W(s,n.detached))}),s.stdout.on(`data`,e=>{if(n.binaryStdout){l?.push(Buffer.isBuffer(e)?e:Buffer.from(e));return}let t=String(e);c+=t,n.onStdoutChunk?.(t)}),s.stderr.on(`data`,e=>{let t=String(e);u+=t,n.onStderrChunk?.(t)}),s.on(`error`,n=>{m&&clearTimeout(m),h.dispose(),i.emitForegroundCompletion(e,t),o(Te(h,r,e,t,n))}),s.on(`close`,s=>{m&&clearTimeout(m),h.dispose(),i.emitForegroundCompletion(e,t);let p=s??1;if(!h.didAbort&&d&&f){o(Se(r,e,t,f,p,c,u));return}let g=Ee(h,r,e,t,p,n.allowFailure,c,u);if(g){o(g);return}a({stdout:c,stderr:u,exitCode:p,stdoutBuffer:l?Buffer.concat(l):void 0})})})}async function _e(e){let t=Oe(e);if(!t)return!1;if(r.isAbsolute(t))return H(t);let n=process.env.PATH;if(!n)return!1;let i=ke();for(let e of n.split(r.delimiter)){let n=e.trim();if(n){for(let e of Ae(t,i))if(await H(r.join(n,e)))return!0}}return!1}async function A(e,t){let r=De(e,t,`executable`);if(r){if(!await H(r))throw new n(`TOOL_MISSING`,`${t} points to a missing or non-executable file: ${r}`,{envName:t,path:r});return r}}async function ve(e,t){let r=De(e,t,`file`);if(r){if(!await je(r))throw new n(`TOOL_MISSING`,`${t} points to a missing or non-file path: ${r}`,{envName:t,path:r});return r}}function j(e,t,r={}){let i=L(e),a=m(i,t,{cwd:r.cwd,env:r.env,stdio:[`pipe`,`pipe`,`pipe`],encoding:r.binaryStdout?void 0:`utf8`,input:r.stdin,timeout:U(r.timeoutMs),windowsHide:!0,shell:!1,...r.maxBuffer===void 0?{}:{maxBuffer:r.maxBuffer}});if(a.error){let o=a.error.code;throw o===`ETIMEDOUT`?new n(`COMMAND_FAILED`,`${i} timed out after ${U(r.timeoutMs)}ms`,{cmd:e,args:t,timeoutMs:U(r.timeoutMs)},a.error):o===`ENOENT`?R(i,e,a.error):z(i,e,t,a.error)}let o=r.binaryStdout?Buffer.isBuffer(a.stdout)?a.stdout:Buffer.from(a.stdout??``):void 0,s=r.binaryStdout?``:typeof a.stdout==`string`?a.stdout:(a.stdout??``).toString(),c=typeof a.stderr==`string`?a.stderr:(a.stderr??``).toString(),l=a.status??1;if(l!==0&&!r.allowFailure)throw Ce(i,e,t,l,s,c);return{stdout:s,stderr:c,exitCode:l,stdoutBuffer:o}}function M(e,t,n={}){return N(e,t,n).pid}function N(e,t,n={}){let r=p(L(e),t,{cwd:n.cwd,env:n.env,stdio:n.stdio??`ignore`,detached:!0,windowsHide:!0,shell:!1}),i=r.pid??0,a=new Promise(e=>{r.once(`error`,t=>{e({pid:i,error:t.message})}),r.once(`exit`,(t,n)=>{e({pid:i,...typeof t==`number`?{exitCode:t}:{},...n?{signal:n}:{}})})});return r.unref(),{pid:i,exited:a}}function P(e,t,n={}){let r=L(e),i=F(),a=p(r,t,{cwd:n.cwd,env:n.env,stdio:n.stdio??[`ignore`,`pipe`,`pipe`],detached:n.detached,windowsHide:!0,shell:!1});i.emitBackgroundSpawn(e,t);let o=``,s=``,c=n.captureOutput??!0,l=Me(a,n);return c&&(a.stdout?.setEncoding(`utf8`),a.stderr?.setEncoding(`utf8`),a.stdout?.on(`data`,e=>{o+=e}),a.stderr?.on(`data`,e=>{s+=e})),{child:a,wait:new Promise((c,u)=>{a.on(`error`,n=>{l.dispose(),i.emitBackgroundCompletion(e,t,`error`),u(Te(l,r,e,t,n))}),a.on(`close`,a=>{l.dispose(),i.emitBackgroundCompletion(e,t,`exit`);let d=a??1,f=Ee(l,r,e,t,d,n.allowFailure,o,s);if(f){u(f);return}c({stdout:o,stderr:s,exitCode:d})})})}}function F(){let e=v(),t=e.debug===!0,n=C(process.env.AGENT_DEVICE_EXEC_TRACE??``)===!0;if(!t&&!n)return ye();n&&e.flushOnSuccess!==!0&&_({flushOnSuccess:!0});let r=Date.now(),i=!1;return{emitForegroundCompletion:(e,t)=>{i||(i=!0,I({cmd:e,args:t,startedAtMs:r}))},emitBackgroundSpawn:(e,t)=>{I({cmd:e,args:t,data:{event:`spawn`}})},emitBackgroundCompletion:(e,t,n)=>{i||(i=!0,I({cmd:e,args:t,startedAtMs:r,data:{event:n}}))}}}function ye(){return{emitForegroundCompletion:()=>{},emitBackgroundSpawn:()=>{},emitBackgroundCompletion:()=>{}}}function I(e){let t=e.args.slice(0,6);y({level:`debug`,phase:`exec_command`,durationMs:e.startedAtMs===void 0?void 0:Math.max(0,Date.now()-e.startedAtMs),data:{command:e.cmd,argsPrefix:t,...e.args.length>t.length?{omittedArgCount:e.args.length-t.length}:{},...e.data??{}}})}function L(e){let t=Oe(e);if(!t)throw new n(`INVALID_ARGS`,`Invalid executable command: ${JSON.stringify(e)}`,{cmd:e,hint:`Use a bare command name from PATH or an absolute executable path.`});return t}function be(e,t,n,r){return r.code===`ENOENT`?R(e,t,r):z(e,t,n,r)}function R(e,t,r){return new n(`TOOL_MISSING`,`${e} not found in PATH`,{cmd:t},r)}function z(e,t,r,i){return new n(`COMMAND_FAILED`,`Failed to run ${e}`,{cmd:t,args:r},i)}function xe(e,t,r,i){return new n(`COMMAND_FAILED`,`Failed to write stdin for ${e}`,{cmd:t,args:r},i instanceof Error?i:void 0)}function B(e,t,r){return new n(`COMMAND_FAILED`,`request canceled`,{cmd:t,args:r,executable:e,reason:`request_canceled`})}function Se(e,t,r,i,a,o,s){return new n(`COMMAND_FAILED`,`${e} timed out after ${i}ms`,{cmd:t,args:r,stdout:o,stderr:s,exitCode:a,timeoutMs:i})}function Ce(e,t,r,i,a,o){return new n(`COMMAND_FAILED`,`${e} exited with code ${i}`,V({stdout:a,stderr:o,exitCode:i},{cmd:t,args:r}))}function we(e,t,r){if(e.exitCode===0)return e;throw new n(`COMMAND_FAILED`,t,V(e,typeof r==`function`?r(e):r))}function V(e,t){return{stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode,processExitError:!0,...t}}function Te(e,t,n,r,i){return e.didAbort?B(t,n,r):be(t,n,r,i)}function Ee(e,t,n,r,i,a,o,s){return e.didAbort?B(t,n,r):i!==0&&!a?Ce(t,n,r,i,o,s):null}function De(e,t,i){let a=e?.trim();if(a){if(!r.isAbsolute(a)||a.includes(`\0`))throw new n(`INVALID_ARGS`,`${t} must be an absolute ${i} path, not ${JSON.stringify(e)}`,{envName:t,path:e});return a}}function Oe(e){let t=e.trim();return!t||t.includes(`\0`)?null:r.isAbsolute(t)?t:t.includes(`/`)||t.includes(`\\`)?null:me.test(t)?t:null}function ke(){if(process.platform!==`win32`)return[``];let e=process.env.PATHEXT;if(!e)return he;let t=e.split(`;`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0);return t.length>0?t:he}function Ae(e,t){if(process.platform!==`win32`)return[e];let n=e.toLowerCase();return t.some(e=>n.endsWith(e))?[e]:t.map(t=>`${e}${t}`)}async function H(e){try{return await je(e)?(await d(e,process.platform===`win32`?s.F_OK:s.X_OK),!0):!1}catch{return!1}}async function je(e){try{return(await f(e)).isFile()}catch{return!1}}function U(e){if(!Number.isFinite(e))return;let t=Math.floor(e);if(!(t<=0))return t}function Me(e,t){let n=!1,r=()=>{n=!0,W(e,t.detached)};return t.signal?.aborted?r():t.signal?.addEventListener(`abort`,r,{once:!0}),{get didAbort(){return n},dispose:()=>{t.signal?.removeEventListener(`abort`,r)}}}function W(e,t){if(t&&e.pid&&process.platform!==`win32`)try{process.kill(-e.pid,`SIGKILL`);return}catch{}e.kill(`SIGKILL`)}async function Ne(e,t){if(e.stdin){if(t===void 0){e.stdin?.end();return}await l(u.from([t]),e.stdin)}}function Pe(e){return e instanceof Error&&`code`in e&&e.code===`EPIPE`}var Fe=e({androidAdbResultError:()=>q,attachAdbFailureHint:()=>K,classifyAdbFailure:()=>Re,createAndroidPortReverseManager:()=>Ye,createDeviceAdbExecutor:()=>X,createLocalAndroidAdbProvider:()=>We,installAndroidAdbPackage:()=>Ze,pullAndroidAdbFile:()=>Xe,resolveAndroidAdbExecutor:()=>Ge,resolveAndroidAdbProvider:()=>Z,resolveAndroidTextInjector:()=>qe,resolveAndroidTouchProvider:()=>Je,resolveScopedAndroidAdbBackgroundTransport:()=>Ke,withAndroidAdbProvider:()=>Qe});const Ie=[{reason:`device_unauthorized`,pattern:/device unauthorized|device still authorizing/,hint:`USB debugging is not authorized — accept the authorization prompt on the device screen (re-plug the cable if none appears), then retry.`},{reason:`device_offline`,pattern:/device offline/,hint:`The device is connected but offline — wait for it to finish booting or run adb reconnect, then retry.`,retriable:!0},{reason:`multiple_devices`,pattern:/more than one (?:device\/emulator|device and emulator)/,hint:`Multiple Android devices are connected — pass --serial <serial> (see adb devices) to select one.`},{reason:`no_devices`,pattern:/no devices\/emulators found|no devices found/,hint:`No Android devices detected — boot an emulator or connect a device and verify it appears in adb devices.`},{reason:`device_not_found`,pattern:/device (?:'[^']*' )?not found/,hint:`The device disconnected or is restarting — verify it is listed in adb devices, then retry.`,retriable:!0},{reason:`server_version_mismatch`,pattern:/adb server version \(\d+\) doesn't match this client/,hint:`Multiple adb installs conflict — adb restarts its server automatically, so retry; align PATH to a single adb to stop recurrences.`,retriable:!0},{reason:`connection_dropped`,pattern:/transport error|connection reset|broken pipe|protocol fault/,hint:`The adb connection dropped — retry; if it persists, run adb kill-server and reconnect the device.`,retriable:!0},{reason:`install_insufficient_storage`,pattern:/install_failed_insufficient_storage/,hint:`The device is out of storage — free up space or uninstall unused apps, then retry the install.`,matchStdout:!0},{reason:`install_update_incompatible`,pattern:/install_failed_update_incompatible/,hint:`The installed app has an incompatible signature — uninstall the existing app first, then retry the install.`,matchStdout:!0},{reason:`install_version_downgrade`,pattern:/install_failed_version_downgrade/,hint:`The APK is older than the installed app — uninstall the app first (or install with downgrade allowed), then retry.`,matchStdout:!0},{reason:`install_failed`,pattern:/install_failed_\w+|install_parse_failed_\w+/,hint:`The Android package installer rejected the APK — see the INSTALL_FAILED code in the error output for the exact cause.`,matchStdout:!0}],Le=Object.freeze({reason:`timeout`,hint:`adb timed out — the adb server may be wedged. Run adb kill-server && adb start-server, check adb devices, then retry.`});function Re(e,t=``){let n=e.toLowerCase(),r=t.toLowerCase();for(let{pattern:e,matchStdout:t,...i}of Ie)if(e.test(n)||t&&e.test(r))return i}const G=new a;function K(e){if(!(e instanceof n)||e.code!==`COMMAND_FAILED`)return e;let t=ze(e);return t&&(e.details={...e.details,adbFailure:t.reason,...typeof e.details?.hint==`string`?{}:{hint:t.hint},...t.retriable!==void 0&&e.details?.retriable===void 0?{retriable:t.retriable}:{}}),e}function ze(e){return typeof e.details?.timeoutMs==`number`?Le:Re(typeof e.details?.stderr==`string`?e.details.stderr:``,typeof e.details?.stdout==`string`?e.details.stdout:``)}function q(e,t,r){return K(new n(`COMMAND_FAILED`,e,t.exitCode===0?{stdout:t.stdout,stderr:t.stderr,exitCode:t.exitCode,...r}:V(t,r)))}function J(e){return async(...t)=>{try{return await e(...t)}catch(e){throw K(e)}}}const Be=new WeakSet;function Ve(e){if(Be.has(e))return e;let t={...e,exec:J(Y(e.exec)),...e.pull?{pull:J(Y(e.pull))}:{},...e.install?{install:J(Y(e.install))}:{},...e.installBundle?{installBundle:J(e.installBundle)}:{}};return Be.add(t),t}function Y(e){return async(...t)=>O(await e(...t))}function X(e){return He(e.id)}function He(e){return J(async(t,n)=>await T(async()=>await E(`adb`,[`-s`,e,...t],{...n,detached:process.platform!==`win32`})))}function Ue(e){return(t,n)=>{let r=P(`adb`,[`-s`,e,...t],{...n,allowFailure:!0,captureOutput:!1});return r.wait.catch(()=>{}),r.child}}function We(e){let t=X(e);return{exec:t,spawn:Ue(e.id),reverse:nt(t),pull:async(e,n,r)=>await t([`pull`,e,n],r),install:async(e,n)=>{let{installArgs:r,execOptions:i}=at(n);return await t([`install`,...r,e],i)}}}function Ge(e,t){let n=G.getStore();return t||(n?.serial===e.id?n.provider.exec:X(e))}function Z(e,t){if(t)return Q(t);let n=G.getStore();return n?.serial===e.id?Q(n.provider):We(e)}function Ke(e){let t=G.getStore();return t?.serial===e.id?{mode:`transport-composed`,...t.provider.spawn?{spawn:t.provider.spawn}:{}}:{mode:`local`}}function qe(e){let t=G.getStore();return t?.serial===e.id?t.provider.text:void 0}function Je(e){let t=G.getStore();return t?.serial===e.id&&t.provider.touch?t.provider:void 0}function Ye(e){let t=Q(e);if(t.reverse&&tt.has(t.reverse))return t.reverse;let r=t.reverse??nt(t.exec),i=new Map,a={async ensure(e,t){let a=i.get(e.local);if(a&&a.ownerId!==e.ownerId)throw new n(`COMMAND_FAILED`,`Android port reverse ${e.local} is already owned by ${a.ownerId??`another session`}`,{current:a,requested:e});a?.remote!==e.remote&&(await r.ensure(e,t),i.set(e.local,{...e}))},async remove(e,t){if(!i.has(e)){await r.remove(e,t);return}await r.remove(e,t),i.delete(e)},async removeAllOwned(e,t){let n=[...i.values()].filter(t=>t.ownerId===e).map(e=>e.local);if(n.length===0){await r.removeAllOwned(e,t);return}for(let e of n)await r.remove(e,t),i.delete(e)},async list(e){return r.list?await r.list(e):[...i.values()]}};return tt.add(a),a}function Q(e){return Ve(typeof e==`function`?{exec:e}:e)}async function Xe(e,t,r){let{device:i,provider:a,...o}=r??{},s=$(i,a),c=s?.pull;if(c)return await T(async()=>await c(e,t,o));let l=s?.exec;if(!l)throw new n(`COMMAND_FAILED`,`Android adb pull requires an adb provider`);return await T(async()=>await l([`pull`,e,t],o))}async function Ze(e,t){let{device:r,provider:i,...a}=t??{},o=$(r,i),s=o?.install;if(s)return await T(async()=>await s(e,a));let c=o?.exec;if(!c)throw new n(`COMMAND_FAILED`,`Android adb install requires an adb provider`);let{installArgs:l,execOptions:u}=at(a);return await T(async()=>await c([`install`,...l,e],u))}function $(e,t){if(t)return Q(t);if(e)return Z(e);let n=G.getStore();if(n)return Q(n.provider)}async function Qe(e,t,n){if(!e)return await n();let r={provider:Q(e),serial:t.serial},i=$e(r);return await G.run(r,async()=>await ge(i,n))}function $e(e){return(t,n,r)=>{if(t!==`adb`)return;let i=et(n,e.serial);if(i)return T(async()=>await e.provider.exec(i,r))}}function et(e,t){if(!(e[0]!==`-s`||!e[1])&&e[1]===t)return e.slice(2)}const tt=new WeakSet;function nt(e){let t=new Map;return{async ensure(n,r){if(await e([`reverse`,n.local,n.remote],{allowFailure:!1,signal:r?.signal,timeoutMs:r?.timeoutMs}),n.ownerId){let e=t.get(n.ownerId)??new Set;e.add(n.local),t.set(n.ownerId,e)}},async remove(n,r){let i=await e([`reverse`,`--remove`,n],{allowFailure:!0,signal:r?.signal,timeoutMs:r?.timeoutMs});if(i.exitCode!==0&&!it(i.stdout,i.stderr))throw q(`Failed to remove Android port reverse ${n}`,i,{local:n});for(let e of t.values())e.delete(n)},async removeAllOwned(e,n){let r=[...t.get(e)??[]];for(let e of r)await this.remove(e,n);t.delete(e)},async list(n){let r=await e([`reverse`,`--list`],{allowFailure:!0,signal:n?.signal,timeoutMs:n?.timeoutMs});return r.exitCode===0?rt(r.stdout,t):[]}}}function rt(e,t){let n=new Map;for(let[e,r]of t)for(let t of r)n.set(t,e);return e.split(`
|
|
4
|
-
`).map(e=>e.trim().split(/\s+/)).filter(e=>e.length>=3).map(([,e,t])=>{let r=e;return{local:r,remote:t,ownerId:n.get(r)}})}function it(e,t){let n=`${e}\n${t}`.toLowerCase();return n.includes(`listener`)&&n.includes(`not found`)}function at(e){let{replace:t,allowTestPackages:n,allowDowngrade:r,grantPermissions:i,...a}=e??{},o=[];return t&&o.push(`-r`),n&&o.push(`-t`),r&&o.push(`-d`),i&&o.push(`-g`),{installArgs:o,execOptions:a}}export{y as A,_e as C,ue as D,C as E,ie as F,te as I,v as M,ne as N,re as O,_ as P,j as S,le as T,E as _,Xe as a,N as b,qe as c,O as d,V as f,A as g,we as h,Ze as i,ae as j,g as k,Je as l,H as m,q as n,Ge as o,pe as p,Ye as r,Z as s,Fe as t,Qe as u,P as v,T as w,D as x,M as y};
|
package/dist/src/sdk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime.js";import t from"node:path";import{promises as n}from"node:fs";import r from"node:os";var i=e({ensureAndroidSdkPathConfigured:()=>l,resolveAndroidSdkRoots:()=>s});const a=[`emulator`,`platform-tools`,t.join(`cmdline-tools`,`latest`,`bin`),t.join(`cmdline-tools`,`tools`,`bin`)];function o(e){let t=new Set,n=[];for(let r of e){let e=r.trim();!e||t.has(e)||(t.add(e),n.push(e))}return n}function s(e=process.env){let n=e.ANDROID_SDK_ROOT?.trim(),i=e.ANDROID_HOME?.trim(),a=e.HOME?.trim()||r.homedir(),s=a?t.join(a,`Android`,`Sdk`):``;return o([n??``,i??``,s])}async function c(e){try{return await n.access(e,n.constants.X_OK),!0}catch{return!1}}async function l(e=process.env){let n=[],r;for(let i of s(e)){let e=[];for(let n of a){let r=t.join(i,n);await c(r)&&e.push(r)}e.length!==0&&(r||=i,n.push(...e))}if(r&&(e.ANDROID_SDK_ROOT=e.ANDROID_SDK_ROOT?.trim()||r,e.ANDROID_HOME=e.ANDROID_HOME?.trim()||r),n.length===0)return;let i=(e.PATH??``).split(t.delimiter).map(e=>e.trim()).filter(e=>e.length>0);e.PATH=o([...n,...i]).join(t.delimiter)}export{i as n,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./sdk-contracts.js";function t(e){return e.map(e=>({args:e.args.join(` `),exitCode:e.exitCode,stderr:e.stderr.slice(0,400)}))}function n(t){let n=t.toLowerCase();if(n===`on`||n===`true`||n===`1`)return!0;if(n===`off`||n===`false`||n===`0`)return!1;throw new e(`INVALID_ARGS`,`Invalid setting state: ${t}`)}export{t as n,n as t};
|
package/dist/src/shell-quote.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=/^[A-Za-z0-9_@%+=:,./-]+$/;function t(e){return`'${e.replaceAll(`'`,`'\\''`)}'`}function n(n){return e.test(n)?n:t(n)}export{n,t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./sdk-contracts.js";import{c as t}from"./sdk-device.js";import"./screenshot-result.js";import{n}from"./runtime.js";import{A as r}from"./sdk-android-adb.js";import{p as i}from"./dispatch.js";import{p as a}from"./physical-device-control.js";import{s as o}from"./runner-client.js";import{a as s}from"./apps.js";import{t as c}from"./device-ready.js";function l(t,n={}){let r=n.plural===!0?`do`:`does`;return{resolveInput:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`${t} ${r} not resolve input artifacts`)},reserveOutput:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`${t} ${r} not reserve output artifacts`)},createTempFile:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`${t} ${r} not create temporary files`)}}}function u(e,t={}){return{artifacts:l(e,t),policy:n()}}async function d(e,t,n){let r=e.get(t),a=r?.device??await i(n??{});return r||await c(a),{session:r,device:a}}async function f(e,n,r){let i=!e&&t(n);try{return await r()}finally{i&&(await o(n.id),await p(n))}}async function p(e){let t=a();await s(e,t).catch(n=>{r({level:`debug`,phase:`ios_sessionless_runner_host_close_failed`,data:{deviceId:e.id,bundleId:t,error:n instanceof Error?n.message:String(n)}})})}function m(e,t,n,r){t&&e.recordAction(t,{command:n.command,positionals:n.positionals??[],flags:n.flags??{},result:r})}function h(e){let{session:t,sessionName:n,device:r,snapshot:i,appBundleId:a}=e;return t?{...t,snapshot:i,lastComparisonSafeSnapshot:i?.comparisonSafe===!0?i:t.lastComparisonSafeSnapshot}:{name:n,device:r,createdAt:Date.now(),appBundleId:a,snapshot:i,...i?.comparisonSafe===!0?{lastComparisonSafeSnapshot:i}:{},actions:[]}}export{u as a,f as i,m as n,d as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:crypto";function t(t,n){let r=e.createHash(`sha256`).update(t).digest(),i=e.createHash(`sha256`).update(n).digest();return e.timingSafeEqual(r,i)}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./sdk-contracts.js";function t(t){let n=async n=>{throw new e(`UNSUPPORTED_OPERATION`,`${n} is not supported on ${t}`)};return{open:()=>n(`open`),openDevice:()=>n(`openDevice`),close:()=>n(`close`),tap:()=>n(`tap`),doubleTap:()=>n(`doubleTap`),longPress:()=>n(`longPress`),focus:()=>n(`focus`),type:()=>n(`type`),fill:()=>n(`fill`),scroll:()=>n(`scroll`),screenshot:()=>n(`screenshot`),snapshot:()=>n(`snapshot`),back:()=>n(`back`),home:()=>n(`home`),setOrientation:()=>n(`setOrientation`),appSwitcher:()=>n(`appSwitcher`),tvRemote:()=>n(`tvRemote`),readClipboard:()=>n(`readClipboard`),writeClipboard:()=>n(`writeClipboard`),setSetting:()=>n(`setSetting`)}}export{t};
|
package/dist/src/verdict.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Set([`healthy`,`recovered`,`sparse`]),t=new Set([`tree`,`queries`,`private-ax`]),n=new Set([`ax-rejected`,`sparse-tree`,`budget`,`no-nodes`,`capture-failed`,`deferred`,`requested-backend`]);function r(r){if(!r||typeof r!=`object`)return;let a=r;if(!(typeof a.state!=`string`||!e.has(a.state))&&!(typeof a.backend!=`string`||!t.has(a.backend)))return{state:a.state,backend:a.backend,reason:typeof a.reason==`string`?a.reason:void 0,reasonCode:typeof a.reasonCode==`string`&&n.has(a.reasonCode)?a.reasonCode:void 0,customActions:i(a.customActions),effectiveDepth:typeof a.effectiveDepth==`number`?a.effectiveDepth:void 0,collapsedLeafIndexes:Array.isArray(a.collapsedLeafIndexes)?a.collapsedLeafIndexes.filter(e=>typeof e==`number`):void 0}}function i(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.read!=`number`||typeof t.candidates!=`number`))return{read:t.read,candidates:t.candidates,truncated:typeof t.truncated==`number`?t.truncated:0,blocked:t.blocked===!0}}function a(e){return e?.state===`sparse`}function o(e){return e?.backend===`private-ax`?`private-ax`:void 0}export{o as n,r,a as t};
|
|
File without changes
|