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
|
@@ -30,30 +30,25 @@ struct GestureEvent: Decodable {
|
|
|
30
30
|
let edge: String?
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
enum
|
|
34
|
-
case
|
|
35
|
-
case
|
|
36
|
-
|
|
33
|
+
enum ExportQuality: String {
|
|
34
|
+
case medium
|
|
35
|
+
case high
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
/// Entry point: `@main` because multi-file swiftc compilation reserves top-level statements for
|
|
39
|
+
/// `main.swift`, which cannot be shared per-script.
|
|
40
|
+
@main
|
|
41
|
+
enum RecordingOverlay {
|
|
42
|
+
static func main() {
|
|
43
|
+
do {
|
|
44
|
+
try run()
|
|
45
|
+
} catch {
|
|
46
|
+
fputs("recording-overlay: \(error)\n", stderr)
|
|
47
|
+
exit(1)
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
do {
|
|
51
|
-
try run()
|
|
52
|
-
} catch {
|
|
53
|
-
fputs("recording-overlay: \(error)\n", stderr)
|
|
54
|
-
exit(1)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
52
|
func run() throws {
|
|
58
53
|
let arguments = Array(CommandLine.arguments.dropFirst())
|
|
59
54
|
let parsedArgs = try parseArguments(arguments)
|
|
@@ -61,9 +56,7 @@ func run() throws {
|
|
|
61
56
|
let outputURL = URL(fileURLWithPath: parsedArgs.outputPath)
|
|
62
57
|
let eventsURL = URL(fileURLWithPath: parsedArgs.eventsPath)
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
try FileManager.default.removeItem(at: outputURL)
|
|
66
|
-
}
|
|
59
|
+
try removeStaleOutput(outputURL)
|
|
67
60
|
|
|
68
61
|
let payload = try Data(contentsOf: eventsURL)
|
|
69
62
|
let envelope = try JSONDecoder().decode(GestureEnvelope.self, from: payload)
|
|
@@ -74,27 +67,15 @@ func run() throws {
|
|
|
74
67
|
}
|
|
75
68
|
|
|
76
69
|
let asset = AVURLAsset(url: inputURL)
|
|
77
|
-
|
|
78
|
-
throw OverlayError.missingVideoTrack
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
let composition = AVMutableComposition()
|
|
82
|
-
guard let compositionVideoTrack = composition.addMutableTrack(
|
|
83
|
-
withMediaType: .video,
|
|
84
|
-
preferredTrackID: kCMPersistentTrackID_Invalid
|
|
85
|
-
) else {
|
|
86
|
-
throw OverlayError.exportFailed("Failed to create composition video track.")
|
|
87
|
-
}
|
|
88
|
-
|
|
70
|
+
let sourceVideoTrack = try sourceVideoTrack(of: asset)
|
|
89
71
|
let fullRange = CMTimeRange(start: .zero, duration: asset.duration)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
try? compositionAudioTrack.insertTimeRange(fullRange, of: sourceAudioTrack, at: .zero)
|
|
72
|
+
let composition = try makeRecordingComposition(
|
|
73
|
+
asset: asset,
|
|
74
|
+
videoTrack: sourceVideoTrack,
|
|
75
|
+
timeRange: fullRange
|
|
76
|
+
)
|
|
77
|
+
guard let compositionVideoTrack = composition.tracks(withMediaType: .video).first else {
|
|
78
|
+
throw RecordingScriptError.exportFailed("Failed to create composition video track.")
|
|
98
79
|
}
|
|
99
80
|
|
|
100
81
|
let renderSize = resolvedRenderSize(for: sourceVideoTrack)
|
|
@@ -149,32 +130,17 @@ func run() throws {
|
|
|
149
130
|
// while avoiding very slow highest-quality exports. Pass --quality high to opt into
|
|
150
131
|
// the slower highest-quality export.
|
|
151
132
|
let presetName = exportPresetName(for: parsedArgs.exportQuality, compatibleWith: composition)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
semaphore.signal()
|
|
164
|
-
}
|
|
165
|
-
if semaphore.wait(timeout: .now() + 120) == .timedOut {
|
|
166
|
-
exporter.cancelExport()
|
|
167
|
-
throw OverlayError.exportFailed("Touch overlay export timed out.")
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if exporter.status != .completed {
|
|
171
|
-
throw OverlayError.exportFailed(exporter.error?.localizedDescription ?? "Touch overlay export failed.")
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
enum ExportQuality: String {
|
|
176
|
-
case medium
|
|
177
|
-
case high
|
|
133
|
+
let exporter = try makeRecordingExporter(
|
|
134
|
+
composition,
|
|
135
|
+
presetName: presetName,
|
|
136
|
+
outputURL: outputURL,
|
|
137
|
+
videoComposition: videoComposition
|
|
138
|
+
)
|
|
139
|
+
try runRecordingExport(
|
|
140
|
+
exporter,
|
|
141
|
+
timeoutMessage: "Touch overlay export timed out.",
|
|
142
|
+
failureMessage: "Touch overlay export failed."
|
|
143
|
+
)
|
|
178
144
|
}
|
|
179
145
|
|
|
180
146
|
func parseArguments(
|
|
@@ -193,33 +159,28 @@ func parseArguments(
|
|
|
193
159
|
let nextIndex = index + 1
|
|
194
160
|
switch argument {
|
|
195
161
|
case "--input":
|
|
196
|
-
|
|
197
|
-
inputPath = arguments[nextIndex]
|
|
162
|
+
inputPath = try recordingOptionValue(arguments, nextIndex, "--input")
|
|
198
163
|
index += 2
|
|
199
164
|
case "--output":
|
|
200
|
-
|
|
201
|
-
outputPath = arguments[nextIndex]
|
|
165
|
+
outputPath = try recordingOptionValue(arguments, nextIndex, "--output")
|
|
202
166
|
index += 2
|
|
203
167
|
case "--events":
|
|
204
|
-
|
|
205
|
-
eventsPath = arguments[nextIndex]
|
|
168
|
+
eventsPath = try recordingOptionValue(arguments, nextIndex, "--events")
|
|
206
169
|
index += 2
|
|
207
170
|
case "--quality":
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
guard let parsed = ExportQuality(rawValue: arguments[nextIndex]) else {
|
|
212
|
-
throw OverlayError.invalidArgs("--quality must be one of: medium, high")
|
|
171
|
+
let rawValue = try recordingOptionValue(arguments, nextIndex, "--quality")
|
|
172
|
+
guard let parsed = ExportQuality(rawValue: rawValue) else {
|
|
173
|
+
throw RecordingScriptError.invalidArgs("--quality must be one of: medium, high")
|
|
213
174
|
}
|
|
214
175
|
exportQuality = parsed
|
|
215
176
|
index += 2
|
|
216
177
|
default:
|
|
217
|
-
throw
|
|
178
|
+
throw RecordingScriptError.invalidArgs("Unknown argument: \(argument)")
|
|
218
179
|
}
|
|
219
180
|
}
|
|
220
181
|
|
|
221
182
|
guard let inputPath, let outputPath, let eventsPath else {
|
|
222
|
-
throw
|
|
183
|
+
throw RecordingScriptError.invalidArgs(
|
|
223
184
|
"Usage: recording-overlay.swift --input <video> --output <video> --events <json> [--quality <medium|high>]"
|
|
224
185
|
)
|
|
225
186
|
}
|
|
@@ -1,102 +1,59 @@
|
|
|
1
1
|
import AVFoundation
|
|
2
2
|
import Foundation
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case .invalidTrimRange:
|
|
15
|
-
return "Trim start must be before the end of the recording."
|
|
16
|
-
case .missingVideoTrack:
|
|
17
|
-
return "Input video does not contain a video track."
|
|
18
|
-
case .exportFailed(let message):
|
|
19
|
-
return message
|
|
4
|
+
/// Entry point: `@main` because multi-file swiftc compilation reserves top-level statements for
|
|
5
|
+
/// `main.swift`, which cannot be shared per-script.
|
|
6
|
+
@main
|
|
7
|
+
enum RecordingTrim {
|
|
8
|
+
static func main() {
|
|
9
|
+
do {
|
|
10
|
+
try run()
|
|
11
|
+
} catch {
|
|
12
|
+
fputs("recording-trim: \(error)\n", stderr)
|
|
13
|
+
exit(1)
|
|
20
14
|
}
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
17
|
|
|
24
|
-
do {
|
|
25
|
-
try run()
|
|
26
|
-
} catch {
|
|
27
|
-
fputs("recording-trim: \(error)\n", stderr)
|
|
28
|
-
exit(1)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
func run() throws {
|
|
32
19
|
let arguments = Array(CommandLine.arguments.dropFirst())
|
|
33
20
|
let parsedArgs = try parseArguments(arguments)
|
|
34
21
|
let inputURL = URL(fileURLWithPath: parsedArgs.inputPath)
|
|
35
22
|
let outputURL = URL(fileURLWithPath: parsedArgs.outputPath)
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
try FileManager.default.removeItem(at: outputURL)
|
|
39
|
-
}
|
|
24
|
+
try removeStaleOutput(outputURL)
|
|
40
25
|
|
|
41
26
|
let asset = AVURLAsset(url: inputURL)
|
|
42
|
-
|
|
43
|
-
throw TrimError.missingVideoTrack
|
|
44
|
-
}
|
|
45
|
-
|
|
27
|
+
let videoTrack = try sourceVideoTrack(of: asset)
|
|
46
28
|
let trimStart = CMTime(seconds: parsedArgs.trimStartMs / 1000.0, preferredTimescale: 600)
|
|
47
29
|
guard CMTimeCompare(trimStart, asset.duration) < 0 else {
|
|
48
|
-
throw
|
|
30
|
+
throw RecordingScriptError.invalidTrimRange
|
|
49
31
|
}
|
|
50
32
|
|
|
51
33
|
let trimmedDuration = CMTimeSubtract(asset.duration, trimStart)
|
|
52
34
|
guard CMTimeCompare(trimmedDuration, .zero) > 0 else {
|
|
53
|
-
throw
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
let composition = AVMutableComposition()
|
|
57
|
-
let trimmedRange = CMTimeRange(start: trimStart, duration: trimmedDuration)
|
|
58
|
-
|
|
59
|
-
guard let compositionVideoTrack = composition.addMutableTrack(
|
|
60
|
-
withMediaType: .video,
|
|
61
|
-
preferredTrackID: kCMPersistentTrackID_Invalid
|
|
62
|
-
) else {
|
|
63
|
-
throw TrimError.exportFailed("Failed to create composition video track.")
|
|
35
|
+
throw RecordingScriptError.invalidTrimRange
|
|
64
36
|
}
|
|
65
|
-
try compositionVideoTrack.insertTimeRange(trimmedRange, of: sourceVideoTrack, at: .zero)
|
|
66
|
-
compositionVideoTrack.preferredTransform = sourceVideoTrack.preferredTransform
|
|
67
37
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
38
|
+
let composition = try makeRecordingComposition(
|
|
39
|
+
asset: asset,
|
|
40
|
+
videoTrack: videoTrack,
|
|
41
|
+
timeRange: CMTimeRange(start: trimStart, duration: trimmedDuration)
|
|
42
|
+
)
|
|
43
|
+
composition.tracks(withMediaType: .video).first?.preferredTransform = videoTrack.preferredTransform
|
|
75
44
|
|
|
45
|
+
// Passthrough keeps the trim lossless when the composition supports it; otherwise re-encode at
|
|
46
|
+
// highest quality.
|
|
76
47
|
let presetName = AVAssetExportSession.exportPresets(compatibleWith: composition)
|
|
77
48
|
.contains(AVAssetExportPresetPassthrough)
|
|
78
49
|
? AVAssetExportPresetPassthrough
|
|
79
50
|
: AVAssetExportPresetHighestQuality
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
exporter.shouldOptimizeForNetworkUse = true
|
|
87
|
-
|
|
88
|
-
let semaphore = DispatchSemaphore(value: 0)
|
|
89
|
-
exporter.exportAsynchronously {
|
|
90
|
-
semaphore.signal()
|
|
91
|
-
}
|
|
92
|
-
if semaphore.wait(timeout: .now() + 120) == .timedOut {
|
|
93
|
-
exporter.cancelExport()
|
|
94
|
-
throw TrimError.exportFailed("Trim export timed out.")
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if exporter.status != .completed {
|
|
98
|
-
throw TrimError.exportFailed(exporter.error?.localizedDescription ?? "Trim export failed.")
|
|
99
|
-
}
|
|
51
|
+
let exporter = try makeRecordingExporter(composition, presetName: presetName, outputURL: outputURL)
|
|
52
|
+
try runRecordingExport(
|
|
53
|
+
exporter,
|
|
54
|
+
timeoutMessage: "Trim export timed out.",
|
|
55
|
+
failureMessage: "Trim export failed."
|
|
56
|
+
)
|
|
100
57
|
}
|
|
101
58
|
|
|
102
59
|
func parseArguments(_ arguments: [String]) throws -> (inputPath: String, outputPath: String, trimStartMs: Double) {
|
|
@@ -110,29 +67,25 @@ func parseArguments(_ arguments: [String]) throws -> (inputPath: String, outputP
|
|
|
110
67
|
let nextIndex = index + 1
|
|
111
68
|
switch argument {
|
|
112
69
|
case "--input":
|
|
113
|
-
|
|
114
|
-
inputPath = arguments[nextIndex]
|
|
70
|
+
inputPath = try recordingOptionValue(arguments, nextIndex, "--input")
|
|
115
71
|
index += 2
|
|
116
72
|
case "--output":
|
|
117
|
-
|
|
118
|
-
outputPath = arguments[nextIndex]
|
|
73
|
+
outputPath = try recordingOptionValue(arguments, nextIndex, "--output")
|
|
119
74
|
index += 2
|
|
120
75
|
case "--trim-start-ms":
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
guard let parsed = Double(arguments[nextIndex]), parsed >= 0 else {
|
|
125
|
-
throw TrimError.invalidArgs("--trim-start-ms must be a non-negative number")
|
|
76
|
+
let rawValue = try recordingOptionValue(arguments, nextIndex, "--trim-start-ms")
|
|
77
|
+
guard let parsed = Double(rawValue), parsed >= 0 else {
|
|
78
|
+
throw RecordingScriptError.invalidArgs("--trim-start-ms must be a non-negative number")
|
|
126
79
|
}
|
|
127
80
|
trimStartMs = parsed
|
|
128
81
|
index += 2
|
|
129
82
|
default:
|
|
130
|
-
throw
|
|
83
|
+
throw RecordingScriptError.invalidArgs("Unknown argument: \(argument)")
|
|
131
84
|
}
|
|
132
85
|
}
|
|
133
86
|
|
|
134
87
|
guard let inputPath, let outputPath, let trimStartMs else {
|
|
135
|
-
throw
|
|
88
|
+
throw RecordingScriptError.invalidArgs(
|
|
136
89
|
"Usage: recording-trim.swift --input <video> --output <video> --trim-start-ms <ms>"
|
|
137
90
|
)
|
|
138
91
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "agent-device-snapshot-presentation",
|
|
6
|
+
platforms: [
|
|
7
|
+
.iOS(.v15),
|
|
8
|
+
.macOS(.v13),
|
|
9
|
+
.tvOS(.v15),
|
|
10
|
+
.visionOS(.v1),
|
|
11
|
+
],
|
|
12
|
+
products: [
|
|
13
|
+
.library(
|
|
14
|
+
name: "AgentDeviceSnapshotPresentation",
|
|
15
|
+
targets: ["AgentDeviceSnapshotPresentation"]
|
|
16
|
+
),
|
|
17
|
+
],
|
|
18
|
+
targets: [
|
|
19
|
+
.target(name: "AgentDeviceSnapshotPresentation"),
|
|
20
|
+
]
|
|
21
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import CoreGraphics
|
|
3
|
+
|
|
4
|
+
public enum SnapshotGeometry {
|
|
5
|
+
public static func effectiveFrame(
|
|
6
|
+
reportedFrame: CGRect,
|
|
7
|
+
viewport: CGRect,
|
|
8
|
+
ancestorClip: CGRect?
|
|
9
|
+
) -> CGRect {
|
|
10
|
+
var frame = reportedFrame
|
|
11
|
+
if !viewport.isInfinite {
|
|
12
|
+
frame = clipped(frame, to: viewport)
|
|
13
|
+
}
|
|
14
|
+
if let ancestorClip {
|
|
15
|
+
frame = clipped(frame, to: ancestorClip)
|
|
16
|
+
}
|
|
17
|
+
return frame
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public static func snapshotRect(from frame: CGRect, reportedFrame: CGRect) -> SnapshotRect {
|
|
21
|
+
guard !frame.isNull, !frame.isEmpty else {
|
|
22
|
+
return SnapshotRect(
|
|
23
|
+
x: Double(reportedFrame.minX),
|
|
24
|
+
y: Double(reportedFrame.minY),
|
|
25
|
+
width: 0,
|
|
26
|
+
height: 0
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
return SnapshotRect(
|
|
30
|
+
x: Double(frame.origin.x),
|
|
31
|
+
y: Double(frame.origin.y),
|
|
32
|
+
width: Double(max(0, frame.size.width)),
|
|
33
|
+
height: Double(max(0, frame.size.height))
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static func isGeometricallyActionable(
|
|
38
|
+
enabled: Bool,
|
|
39
|
+
frame: CGRect,
|
|
40
|
+
viewport: CGRect
|
|
41
|
+
) -> Bool {
|
|
42
|
+
guard enabled, !frame.isNull, !frame.isEmpty else { return false }
|
|
43
|
+
if viewport.isInfinite { return true }
|
|
44
|
+
let center = CGPoint(x: frame.midX, y: frame.midY)
|
|
45
|
+
return viewport.contains(center)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private static func clipped(_ frame: CGRect, to clip: CGRect) -> CGRect {
|
|
49
|
+
guard !frame.isNull, !frame.isEmpty else { return frame }
|
|
50
|
+
let intersection = frame.intersection(clip)
|
|
51
|
+
guard !intersection.isNull, !intersection.isEmpty else {
|
|
52
|
+
return CGRect(x: frame.minX, y: frame.minY, width: 0, height: 0)
|
|
53
|
+
}
|
|
54
|
+
return intersection
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import CoreGraphics
|
|
3
|
+
|
|
4
|
+
public struct SnapshotRect: Codable, Equatable {
|
|
5
|
+
public let x: Double
|
|
6
|
+
public let y: Double
|
|
7
|
+
public let width: Double
|
|
8
|
+
public let height: Double
|
|
9
|
+
|
|
10
|
+
public init(x: Double, y: Double, width: Double, height: Double) {
|
|
11
|
+
self.x = x
|
|
12
|
+
self.y = y
|
|
13
|
+
self.width = width
|
|
14
|
+
self.height = height
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public var cgRect: CGRect {
|
|
18
|
+
CGRect(x: x, y: y, width: width, height: height)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public struct RawAXNode: Equatable {
|
|
23
|
+
public let index: Int
|
|
24
|
+
public let type: String
|
|
25
|
+
public let label: String?
|
|
26
|
+
public let identifier: String?
|
|
27
|
+
public let value: String?
|
|
28
|
+
public let rect: SnapshotRect
|
|
29
|
+
public let enabled: Bool
|
|
30
|
+
public let focused: Bool?
|
|
31
|
+
public let selected: Bool?
|
|
32
|
+
public let hittable: Bool
|
|
33
|
+
public let depth: Int
|
|
34
|
+
public let parentIndex: Int?
|
|
35
|
+
public let hiddenContentAbove: Bool?
|
|
36
|
+
public let hiddenContentBelow: Bool?
|
|
37
|
+
public var actions: [String]?
|
|
38
|
+
|
|
39
|
+
public init(
|
|
40
|
+
index: Int,
|
|
41
|
+
type: String,
|
|
42
|
+
label: String?,
|
|
43
|
+
identifier: String?,
|
|
44
|
+
value: String?,
|
|
45
|
+
rect: SnapshotRect,
|
|
46
|
+
enabled: Bool,
|
|
47
|
+
focused: Bool?,
|
|
48
|
+
selected: Bool?,
|
|
49
|
+
hittable: Bool,
|
|
50
|
+
depth: Int,
|
|
51
|
+
parentIndex: Int?,
|
|
52
|
+
hiddenContentAbove: Bool?,
|
|
53
|
+
hiddenContentBelow: Bool?,
|
|
54
|
+
actions: [String]? = nil
|
|
55
|
+
) {
|
|
56
|
+
self.index = index
|
|
57
|
+
self.type = type
|
|
58
|
+
self.label = label
|
|
59
|
+
self.identifier = identifier
|
|
60
|
+
self.value = value
|
|
61
|
+
self.rect = rect
|
|
62
|
+
self.enabled = enabled
|
|
63
|
+
self.focused = focused
|
|
64
|
+
self.selected = selected
|
|
65
|
+
self.hittable = hittable
|
|
66
|
+
self.depth = depth
|
|
67
|
+
self.parentIndex = parentIndex
|
|
68
|
+
self.hiddenContentAbove = hiddenContentAbove
|
|
69
|
+
self.hiddenContentBelow = hiddenContentBelow
|
|
70
|
+
self.actions = actions
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public var hasSemanticContent: Bool {
|
|
74
|
+
[label, identifier, value].contains {
|
|
75
|
+
!($0?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ?? true)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public struct CaptureHint: Equatable {
|
|
81
|
+
public enum Projection: String {
|
|
82
|
+
case regular
|
|
83
|
+
case raw
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public let projection: Projection
|
|
87
|
+
public let depth: Int?
|
|
88
|
+
public let regularPresentedDepth: Int?
|
|
89
|
+
public let interactiveOnly: Bool
|
|
90
|
+
public let customActions: Bool
|
|
91
|
+
|
|
92
|
+
public init(
|
|
93
|
+
projection: Projection,
|
|
94
|
+
depth: Int?,
|
|
95
|
+
regularPresentedDepth: Int?,
|
|
96
|
+
interactiveOnly: Bool,
|
|
97
|
+
customActions: Bool
|
|
98
|
+
) {
|
|
99
|
+
self.projection = projection
|
|
100
|
+
self.depth = depth
|
|
101
|
+
self.regularPresentedDepth = regularPresentedDepth
|
|
102
|
+
self.interactiveOnly = interactiveOnly
|
|
103
|
+
self.customActions = customActions
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public var rawTraversalDepth: Int? {
|
|
107
|
+
projection == .raw ? depth : nil
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public var isRaw: Bool {
|
|
111
|
+
projection == .raw
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public struct PresentationOptions: Equatable {
|
|
116
|
+
public let interactiveOnly: Bool
|
|
117
|
+
public let depth: Int?
|
|
118
|
+
public let scope: String?
|
|
119
|
+
public let raw: Bool
|
|
120
|
+
public var preferredBackend: String?
|
|
121
|
+
public var customActions: Bool
|
|
122
|
+
|
|
123
|
+
public init(
|
|
124
|
+
interactiveOnly: Bool,
|
|
125
|
+
depth: Int?,
|
|
126
|
+
scope: String?,
|
|
127
|
+
raw: Bool,
|
|
128
|
+
preferredBackend: String? = nil,
|
|
129
|
+
customActions: Bool = false
|
|
130
|
+
) {
|
|
131
|
+
self.interactiveOnly = interactiveOnly
|
|
132
|
+
self.depth = depth
|
|
133
|
+
self.scope = scope
|
|
134
|
+
self.raw = raw
|
|
135
|
+
self.preferredBackend = preferredBackend
|
|
136
|
+
self.customActions = customActions
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
public struct SnapshotAcquisition {
|
|
141
|
+
public let hint: CaptureHint
|
|
142
|
+
public let nodes: [RawAXNode]
|
|
143
|
+
public let truncated: Bool
|
|
144
|
+
public let effectiveDepth: Int?
|
|
145
|
+
public var customActions: SnapshotCustomActionCoverage?
|
|
146
|
+
public let viewport: CGRect
|
|
147
|
+
|
|
148
|
+
public init(
|
|
149
|
+
hint: CaptureHint,
|
|
150
|
+
nodes: [RawAXNode],
|
|
151
|
+
truncated: Bool,
|
|
152
|
+
effectiveDepth: Int?,
|
|
153
|
+
customActions: SnapshotCustomActionCoverage? = nil,
|
|
154
|
+
viewport: CGRect
|
|
155
|
+
) {
|
|
156
|
+
self.hint = hint
|
|
157
|
+
self.nodes = nodes
|
|
158
|
+
self.truncated = truncated
|
|
159
|
+
self.effectiveDepth = effectiveDepth
|
|
160
|
+
self.customActions = customActions
|
|
161
|
+
self.viewport = viewport
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public struct SnapshotCustomActionCoverage: Codable, Equatable {
|
|
166
|
+
public let read: Int
|
|
167
|
+
public let candidates: Int
|
|
168
|
+
public let truncated: Int
|
|
169
|
+
public let blocked: Bool
|
|
170
|
+
|
|
171
|
+
public init(read: Int, candidates: Int, truncated: Int, blocked: Bool) {
|
|
172
|
+
self.read = read
|
|
173
|
+
self.candidates = candidates
|
|
174
|
+
self.truncated = truncated
|
|
175
|
+
self.blocked = blocked
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public struct SnapshotPresentationNode {
|
|
180
|
+
public let raw: RawAXNode
|
|
181
|
+
public let effectiveRect: SnapshotRect
|
|
182
|
+
|
|
183
|
+
public init(raw: RawAXNode, effectiveRect: SnapshotRect) {
|
|
184
|
+
self.raw = raw
|
|
185
|
+
self.effectiveRect = effectiveRect
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public static func reported(_ raw: RawAXNode) -> Self {
|
|
189
|
+
Self(raw: raw, effectiveRect: raw.rect)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public struct PresentedNode: Codable, Equatable {
|
|
194
|
+
public let index: Int
|
|
195
|
+
public let type: String
|
|
196
|
+
public let label: String?
|
|
197
|
+
public let identifier: String?
|
|
198
|
+
public let value: String?
|
|
199
|
+
public let rect: SnapshotRect
|
|
200
|
+
public let enabled: Bool
|
|
201
|
+
public let focused: Bool?
|
|
202
|
+
public let selected: Bool?
|
|
203
|
+
public let hittable: Bool
|
|
204
|
+
public let depth: Int
|
|
205
|
+
public let parentIndex: Int?
|
|
206
|
+
public let hiddenContentAbove: Bool?
|
|
207
|
+
public let hiddenContentBelow: Bool?
|
|
208
|
+
public let actions: [String]?
|
|
209
|
+
|
|
210
|
+
internal init(
|
|
211
|
+
presenting raw: RawAXNode,
|
|
212
|
+
rect: SnapshotRect? = nil,
|
|
213
|
+
index: Int? = nil,
|
|
214
|
+
depth: Int? = nil,
|
|
215
|
+
parentIndex: Int?? = nil
|
|
216
|
+
) {
|
|
217
|
+
self.index = index ?? raw.index
|
|
218
|
+
self.type = raw.type
|
|
219
|
+
self.label = raw.label
|
|
220
|
+
self.identifier = raw.identifier
|
|
221
|
+
self.value = raw.value
|
|
222
|
+
self.rect = rect ?? raw.rect
|
|
223
|
+
self.enabled = raw.enabled
|
|
224
|
+
self.focused = raw.focused
|
|
225
|
+
self.selected = raw.selected
|
|
226
|
+
self.hittable = raw.hittable
|
|
227
|
+
self.depth = depth ?? raw.depth
|
|
228
|
+
self.parentIndex = parentIndex ?? raw.parentIndex
|
|
229
|
+
self.hiddenContentAbove = raw.hiddenContentAbove
|
|
230
|
+
self.hiddenContentBelow = raw.hiddenContentBelow
|
|
231
|
+
self.actions = raw.actions
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
internal init(presenting node: SnapshotPresentationNode) {
|
|
235
|
+
self.init(presenting: node.raw, rect: node.effectiveRect)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
public struct SnapshotPresentationResult {
|
|
240
|
+
public let nodes: [PresentedNode]
|
|
241
|
+
public let truncated: Bool
|
|
242
|
+
public let effectiveDepth: Int?
|
|
243
|
+
public let customActions: SnapshotCustomActionCoverage?
|
|
244
|
+
public let qualityNodes: [PresentedNode]?
|
|
245
|
+
|
|
246
|
+
public init(
|
|
247
|
+
nodes: [PresentedNode],
|
|
248
|
+
truncated: Bool,
|
|
249
|
+
effectiveDepth: Int?,
|
|
250
|
+
customActions: SnapshotCustomActionCoverage?,
|
|
251
|
+
qualityNodes: [PresentedNode]?
|
|
252
|
+
) {
|
|
253
|
+
self.nodes = nodes
|
|
254
|
+
self.truncated = truncated
|
|
255
|
+
self.effectiveDepth = effectiveDepth
|
|
256
|
+
self.customActions = customActions
|
|
257
|
+
self.qualityNodes = qualityNodes
|
|
258
|
+
}
|
|
259
|
+
}
|