agent-device 0.21.20 → 0.21.22
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/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.20.apk → agent-device-android-ime-helper-0.21.22.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.22.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.20.manifest.json → agent-device-android-ime-helper-0.21.22.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.22.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.22.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.20.manifest.json → agent-device-android-snapshot-helper-0.21.22.manifest.json} +6 -6
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AppWindowScreenshot.swift +73 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift +557 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/GhostCursor.swift +141 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +107 -3
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +136 -22
- package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/BackgroundInteractionTests.swift +88 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +121 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +10 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +36 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +28 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +27 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +6 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +7 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +21 -7
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +121 -17
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +179 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +119 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +8 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +23 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +59 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +112 -23
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +25 -12
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +6 -1
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +43 -13
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb-executor.js +2 -2
- package/dist/src/adb-failure.js +1 -1
- package/dist/src/adb-transport.js +1 -1
- package/dist/src/agent-browser-lifecycle.js +1 -1
- package/dist/src/agent-browser-process-record.js +1 -1
- package/dist/src/agent-browser-provider.js +1 -1
- package/dist/src/agent-browser-tool.js +1 -1
- package/dist/src/agent-device-client.js +2 -2
- package/dist/src/ai-sdk.js +1 -1
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/alert.js +1 -1
- package/dist/src/android-adb.d.ts +12 -0
- package/dist/src/android-input-ownership.js +1 -1
- package/dist/src/app-backend.js +1 -0
- package/dist/src/app-catalog.js +1 -1
- package/dist/src/app-deployment-resolution.js +1 -1
- package/dist/src/app-inventory.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +2 -2
- package/dist/src/app-lifecycle2.js +1 -1
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-reconnect.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-log-session-resource.js +1 -0
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/apple-runner-platform.js +1 -1
- package/dist/src/application-lifecycle-interaction.js +1 -1
- package/dist/src/archive.js +2 -2
- package/dist/src/artifact-download.js +1 -1
- package/dist/src/auth-session.js +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/back-mode.js +1 -1
- package/dist/src/backend-snapshot-options.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/cache.js +1 -1
- package/dist/src/capabilities.js +1 -1
- package/dist/src/capture.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +13 -5
- package/dist/src/cli.js +4 -4
- package/dist/src/click-button.js +1 -1
- package/dist/src/client-metro-companion.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-options.js +3 -0
- package/dist/src/client-types.d.ts +88 -5
- package/dist/src/clipboard-shell-response.js +1 -1
- package/dist/src/cloud-artifacts.d.ts +7 -2
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/code-signature.js +1 -1
- package/dist/src/command-schema.js +1 -1
- package/dist/src/command-tools.js +2 -2
- 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-artifacts.js +1 -0
- package/dist/src/daemon-client-lease-beat.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon-client-liveness-probe.js +1 -0
- package/dist/src/daemon-client-transport.js +1 -1
- package/dist/src/daemon-http.js +1 -0
- package/dist/src/daemon-policy-file.js +1 -1
- package/dist/src/daemon-registration-owner.js +1 -0
- package/dist/src/daemon-registration.js +1 -1
- package/dist/src/daemon-resolution.js +1 -1
- package/dist/src/daemon-shutdown-report.js +1 -1
- package/dist/src/daemon.js +2 -2
- package/dist/src/debug-symbols-facade.js +1 -1
- package/dist/src/device-claim-inspection.js +1 -1
- package/dist/src/device-claim-rule.js +1 -1
- package/dist/src/device-inventory-context.js +1 -1
- package/dist/src/device-readiness-runtime.js +1 -1
- package/dist/src/device-release.js +1 -1
- package/dist/src/device-rotation.js +1 -1
- package/dist/src/device-selection-resolver.js +1 -1
- package/dist/src/device-session.js +1 -1
- package/dist/src/device-shell.js +1 -1
- package/dist/src/device.js +1 -1
- package/dist/src/device2.js +1 -3
- package/dist/src/device3.js +3 -0
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +3 -3
- package/dist/src/dispatch-resolve.js +4 -1
- package/dist/src/display-inventory.js +1 -1
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/doctor2.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -0
- package/dist/src/engine-eval-script.js +1 -1
- package/dist/src/error.js +1 -1
- package/dist/src/exec.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/generic-settle.js +1 -1
- package/dist/src/generic.js +1 -1
- package/dist/src/gesture-admission.js +1 -1
- package/dist/src/gesture-plan.js +1 -1
- package/dist/src/gesture-runtime.js +1 -1
- 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 -1
- package/dist/src/host.js +1 -1
- package/dist/src/human-control-contract.js +1 -1
- package/dist/src/human-control.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +2 -2
- package/dist/src/install-artifact-facade.js +1 -1
- package/dist/src/install-source-network-transport.js +1 -1
- package/dist/src/install-source.d.ts +5 -0
- package/dist/src/install-source2.js +1 -1
- package/dist/src/instance-client.js +1 -0
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction-ref-policy.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-binding.js +1 -1
- package/dist/src/interactor.js +5 -5
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +1 -2
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/internal/run-script-http-child.js +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/ios-client.js +4 -30
- package/dist/src/ios-settings.js +1 -0
- package/dist/src/ios-snapshot-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/launch-confirmation.js +1 -1
- package/dist/src/lease-context.js +1 -1
- package/dist/src/lease-registry-scope.js +1 -0
- package/dist/src/lease-scope.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/legacy-xctest-device-set.js +1 -1
- package/dist/src/limrun-download-file.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +28 -2
- package/dist/src/limrun.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/load.js +1 -0
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/macos-facade.js +1 -1
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/mechanics.js +16 -16
- package/dist/src/observation.js +1 -1
- package/dist/src/observe-until.js +1 -1
- package/dist/src/overlay.js +2 -2
- package/dist/src/owner-identity.js +3 -3
- package/dist/src/path-resolution.js +1 -1
- package/dist/src/perf-facade.js +1 -1
- package/dist/src/perf-runtime-operation-builder.js +1 -1
- package/dist/src/perf-runtime-plan.js +1 -1
- package/dist/src/perf-target.js +1 -1
- package/dist/src/perf.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-request-scope.js +1 -1
- package/dist/src/platform-runtime-android-adb-host.js +1 -1
- package/dist/src/platform-runtime-app-log-process.js +1 -1
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-managed-owner.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +2 -2
- 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-transport.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-output-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
- package/dist/src/platform-runtime-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/plugins.d.ts +9 -0
- package/dist/src/plugins.js +1 -0
- package/dist/src/plugins2.js +2 -0
- package/dist/src/png-crop-bytes.js +1 -1
- package/dist/src/png-size.js +1 -1
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/png.js +1 -1
- package/dist/src/prepare-kind.js +1 -1
- package/dist/src/process.js +1 -1
- package/dist/src/project-runtime.js +1 -1
- package/dist/src/provider-credential-fingerprint.js +1 -0
- package/dist/src/provider-device-admission.js +1 -1
- package/dist/src/provider-device-runtimes.js +1 -0
- package/dist/src/provider-limrun-credentials.js +1 -0
- package/dist/src/provider-profile-fields.js +1 -0
- package/dist/src/provider-session-ownership.js +2 -2
- package/dist/src/provider-webdriver.js +2 -1
- package/dist/src/providers.js +1 -1
- package/dist/src/proxy.js +1 -1
- package/dist/src/quality-warnings.js +1 -1
- 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/recording.js +1 -1
- package/dist/src/rect-center.js +1 -1
- package/dist/src/register-builtins.js +1 -1
- package/dist/src/registry.js +39 -39
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay.js +2 -2
- package/dist/src/reporting.js +5 -5
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-cancel.js +1 -1
- package/dist/src/request-cancellation.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-artifact-manifest.js +1 -1
- package/dist/src/runner-cache-metadata.js +3 -3
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-dev-tools-security.js +1 -1
- package/dist/src/runner-device-readiness.js +1 -1
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-error-classification.js +2 -2
- package/dist/src/runner-exchange.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-session-types.js +1 -1
- package/dist/src/runner-start-budget.js +1 -1
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime-admission.js +1 -1
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime2.js +3 -3
- package/dist/src/runtime3.js +1 -1
- package/dist/src/runtime4.js +5 -5
- 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/screen-recording-admission-ledger.js +1 -1
- package/dist/src/screen-recording-completion.js +1 -1
- package/dist/src/screen-recording-options.js +1 -1
- package/dist/src/screen-recording-resource-recovery.js +1 -1
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-image.js +1 -1
- package/dist/src/screenshot-result.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot.js +1 -1
- package/dist/src/screenshot3.js +1 -1
- package/dist/src/script.js +1 -1
- package/dist/src/scroll-command.js +1 -1
- package/dist/src/scroll-gesture.js +1 -1
- package/dist/src/sdk-batch-runner.js +2 -2
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +45 -2
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-io.js +1 -1
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +33 -4
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.d.ts +2 -2
- package/dist/src/selectors.js +1 -1
- package/dist/src/server.js +1 -1
- package/dist/src/session-allocation.js +1 -1
- package/dist/src/session-artifact-paths.js +1 -1
- package/dist/src/session-repair-tombstone.js +1 -1
- package/dist/src/session-routing.js +1 -1
- package/dist/src/session-runtime-admission.js +1 -1
- package/dist/src/session-snapshot.js +1 -1
- package/dist/src/session-stream.js +27 -0
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -1
- package/dist/src/simctl-settings-facade.js +1 -0
- package/dist/src/simctl-settings.js +1 -0
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-diagnostics.js +1 -1
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-state.js +1 -1
- package/dist/src/snapshot2.js +1 -1
- package/dist/src/snapshot3.js +1 -1
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src7.js +1 -1
- package/dist/src/src8.js +2 -2
- package/dist/src/store.js +1 -0
- package/dist/src/string-enum.js +1 -1
- package/dist/src/surface-snapshot.js +1 -1
- package/dist/src/takeover.js +1 -1
- package/dist/src/target-evidence.js +1 -1
- package/dist/src/telemetry.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider.js +1 -1
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/toolchain-probe.js +2 -2
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/touch-runtime2.js +1 -1
- package/dist/src/transport.js +2 -2
- package/dist/src/tv-remote.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/vars.js +1 -1
- package/dist/src/verified-file.js +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/video.js +1 -1
- package/dist/src/viewport.js +1 -1
- package/dist/src/web.js +1 -1
- package/dist/src/web2.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +5 -1
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.20.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.20.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.20.apk.sha256 +0 -1
- package/dist/src/api.js +0 -3
- package/dist/src/daemon-process.js +0 -1
- package/dist/src/multitouch-support.js +0 -1
- package/dist/src/parameterized-recorded-fill.js +0 -1
- package/dist/src/runner-startup-transport.js +0 -1
- package/dist/src/runner-xctestrun.js +0 -1
- package/dist/src/session-store.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as e}from"../sdk-contracts.js";import{r as t,t as n}from"../png.js";import{n as r,r as i,t as a}from"../png-worker-contract.js";import{t as o}from"../png-crop-bytes.js";import{parentPort as s}from"node:worker_threads";async function c(e){switch(e.kind){case`decode`:{let t=n(a(e.png),e.label);return{kind:`decode`,width:t.width,height:t.height,data:t.data}}case`decode-image`:{let{decodeScreenshotImage:t}=await import(`../screenshot-image.js`),n=t(a(e.image),e.label);return{kind:`decode-image`,width:n.width,height:n.height,data:n.data}}case`encode`:{let n=new t.PNG({width:e.width,height:e.height});return n.data=a(e.data),{kind:`encode`,png:t.PNG.sync.write(n)}}case`crop`:return{kind:`crop`,png:o(a(e.png),e.box,e.label)};case`rgb-difference`:{let t=n(a(e.firstPng),e.label),i=n(a(e.secondPng),e.label);return{kind:`rgb-difference`,...r(t,i)}}case`diff-pixels`:return{kind:`diff-pixels`,...i(e)};case`jpeg-to-png`:{let{transcodeScreenshotToPng:t}=await import(`../screenshot-image.js`);return{kind:`jpeg-to-png`,png:t(a(e.image),e.label)}}}}function l(e){return e.buffer instanceof ArrayBuffer&&e.byteOffset===0&&e.byteLength===e.buffer.byteLength}function u(e){return d(e).filter(l).map(e=>e.buffer)}function d(e){switch(e.kind){case`decode`:case`decode-image`:return[e.data];case`encode`:return[e.png];case`crop`:return e.png===null?[]:[e.png];case`rgb-difference`:return[];case`diff-pixels`:return[e.diffData,e.diffMask];case`jpeg-to-png`:return[e.png]}}const f=s;f&&f.on(`message`,async t=>{let n;try{n={id:t.id,ok:!0,result:await c(t)}}catch(r){n={id:t.id,ok:!1,error:e(r)}}f.postMessage(n,n.ok?u(n.result):[])});export{u as resultTransferList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e}from"../sdk-contracts.js";import{n as t,r as n}from"../install-source-network-transport.js";import{t as r}from"../undici.js";import{readFileSync as i}from"node:fs";import a from"node:net";import{pathToFileURL as o}from"node:url";var s=r();async function c(e){return e.publicNetworkOnly?await u(e):await l(e)}async function l(e){if(typeof fetch!=`function`)throw Error(`global fetch is required for Maestro runScript http helpers`);return await y(await fetch(e.url,d(e)))}async function u(t){let n=v(t.url),r=AbortSignal.timeout(3e4),i=new f(n.protocol===`https:`,r);try{return await y(await(0,s.fetch)(n,{...d(t),dispatcher:i,signal:r}),8388608)}catch(t){throw t instanceof TypeError&&t.cause instanceof e?t.cause:t}finally{await i.dispose()}}function d(e){return{method:e.method,headers:e.headers,...e.body===void 0?{}:{body:e.body}}}var f=class extends s.Dispatcher{#e=new Set;#t;#n;constructor(e,t){super(),this.#t=e,this.#n=t}dispatch(e,t){return this.dispatchApproved(e,t).catch(e=>{t.onError?.(e instanceof Error?e:Error(String(e)))}),!0}async dispose(){await Promise.all([...this.#e].map(async e=>await e.close()))}async dispatchApproved(r,i){let a=_(r);if(this.#t&&a.protocol!==`https:`)throw new e(`COMMAND_FAILED`,`Maestro runScript HTTP redirect downgraded HTTPS`);a.protocol===`https:`&&(this.#t=!0);let o=await n(a,this.#n),s=t(a),c=s?m(s,a):p(o.address,o.family);this.#e.add(c),c.dispatch(s?h(r,a,o.address,o.family):r,i)}};function p(e,t){return new s.Agent({connect:{lookup:(n,r,i)=>{if(r.all){i(null,[{address:e,family:t}]);return}i(null,e,t)}}})}function m(e,t){let n=g(t.hostname);return new s.ProxyAgent({uri:e,proxyTunnel:!0,requestTls:t.protocol===`https:`&&a.isIP(n)===0?{servername:n}:void 0})}function h(e,t,n,r){let i=new URL(t);i.hostname=r===6?`[${g(n)}]`:n;let a=Array.isArray(e.headers)?[...e.headers,`host`,t.host]:{...e.headers,host:t.host};return{...e,origin:i.origin,headers:a}}function g(e){return e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1):e}function _(t){if(!t.origin)throw new e(`INVALID_ARGS`,`Invalid Maestro runScript HTTP URL`);return new URL(t.path,t.origin)}function v(t){try{return new URL(t)}catch{throw new e(`INVALID_ARGS`,`Invalid Maestro runScript HTTP URL`)}}async function y(e,t){return{status:e.status,body:await b(e,t),headers:Object.fromEntries(e.headers.entries())}}async function b(t,n){if(n===void 0)return await t.text();let r=[],i=0,a=t.body?.getReader();if(!a)return``;for(;;){let{done:o,value:s}=await a.read();if(o)break;if(i+=s.byteLength,i>n)throw await a.cancel(),new e(`COMMAND_FAILED`,`Maestro runScript HTTP response exceeded ${n} bytes`,{limitBytes:n,status:t.status});r.push(s)}return Buffer.concat(r,i).toString(`utf8`)}async function x(){let e=await c(JSON.parse(i(0,`utf8`)));process.stdout.write(JSON.stringify(e))}process.argv[1]&&o(process.argv[1]).href===import.meta.url&&x().catch(e=>{console.error(e instanceof Error?e.stack??e.message:String(e)),process.exitCode=1});export{x as runScriptHttpChild};
|
package/dist/src/inventory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)){let e=n.trim().split(/\s+/),r=e[0];!r||r===`List`||e[1]!==`device`||t.push({serial:r,rawModel:(e.find(e=>e.startsWith(`model:`))??``).replace(`model:`,``)})}return t}function
|
|
3
|
-
`).map(e=>e.trim()).filter(e=>e.length>0)}function
|
|
1
|
+
import{F as e,P as t}from"./sdk-contracts.js";import{a as n,n as r}from"./device-shell.js";import{a as i,r as a}from"./adb-failure.js";import o from"node:path";function s(e){return e.startsWith(`emulator-`)}function c(e){return e.toLowerCase().replaceAll(`_`,` `).replaceAll(/\s+/g,` `).trim()}function l(e){let t=[];for(let n of e.split(`
|
|
2
|
+
`)){let e=n.trim().split(/\s+/),r=e[0];!r||r===`List`||e[1]!==`device`||t.push({serial:r,rawModel:(e.find(e=>e.startsWith(`model:`))??``).replace(`model:`,``)})}return t}function u(e){let[t,n]=e.split(/\r?\n/).map(e=>e.trim());return{...t?{model:t}:{},...n?{osVersion:n}:{}}}function d(e){return e.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function f(e){let t=e.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(e=>e.length>0);return t.at(-1)===`OK`&&t.pop(),t.join(`
|
|
5
|
-
`).trim()||void 0}function
|
|
5
|
+
`).trim()||void 0}function p(e){let t=e.toLowerCase();return t.includes(`tv`)||t.includes(`leanback`)?`tv`:null}function m(e){return/feature:android\.(software\.leanback(_only)?|hardware\.type\.television)\b/i.test(e)}function h(e){return/\b(tv|television)\b/i.test(c(e))?`tv`:`mobile`}const g=1e4,_=n(`getprop ro.product.model; getprop ro.build.version.release`),v=[`android.software.leanback`,`android.software.leanback_only`,`android.hardware.type.television`];function y(e,t={sdkRoots:[]}){return{discover:async(n,r)=>await b(e,t,n,r)}}async function b(e,n,r,i){await e.toolchains.prepare(`android`);let a=[...n.sdkRoots,o.join(e.homeDirectory,`Android`,`Sdk`)],s=await S(e,`adb`,a,[`platform-tools`,`adb`]);if(!s)throw new t(`TOOL_MISSING`,`adb not found in PATH`);let c={host:e,adb:s,emulator:await S(e,`emulator`,a,[`emulator`,`emulator`]),scope:i},l=x(r),u=await I((await C(c)).filter(e=>!l||l.has(e.serial)),3,async e=>await w(c,e));return[...u,...r.androidAvdSelection===`running-only`?[]:await j(c,u)]}function x(e){let t=e.serial?.trim(),n=e.androidSerialAllowlist;return t?n?new Set(n.includes(t)?[t]:[]):new Set([t]):n?new Set(n):void 0}async function S(e,t,n,r){for(let t of n){let n=o.join(t,...r);if(await e.files.isExecutable(n))return n}return await e.commands.which(t)}async function C(e){let t=await P(e,e.adb,[`devices`,`-l`]);if(t.exitCode!==0)throw a(`Failed to list Android devices`,t,"Verify adb is running and the device appears in `adb devices`.");return l(t.stdout)}async function w(e,t){let[n,r,i,a]=await Promise.all([E(e,t),k(e,t.serial),A(e,t.serial),T(e,t.serial)]);return{platform:`android`,id:t.serial,name:n,kind:s(t.serial)?`emulator`:`device`,target:i,...a,booted:r}}async function T(e,t){try{let n=await N(e,t,[_],2e3);return n.exitCode===0?u(n.stdout):{}}catch(t){if(e.scope.signal.aborted)throw t;return{}}}async function E(e,t){let n=t.rawModel.replaceAll(`_`,` `).trim();return s(t.serial)?(await D(e,t.serial))?.replaceAll(`_`,` `)||n||t.serial:n||t.serial}async function D(e,t){for(let n of[`ro.boot.qemu.avd_name`,`persist.sys.avd_name`]){let r=await O(e,M(t,[`getprop`,n])),i=r?.stdout.trim();if(r?.exitCode===0&&i)return i}let n=await O(e,[`-s`,t,`emu`,`avd`,`name`]),r=n&&f(n.stdout);return n?.exitCode===0?r:void 0}async function O(t,n){try{return await P(t,t.adb,n)}catch(t){let n=e(t);if(n.code===`COMMAND_FAILED`&&typeof n.details?.timeoutMs==`number`)return;throw t}}async function k(e,t){try{return(await N(e,t,[`getprop`,`sys.boot_completed`])).stdout.trim()===`1`}catch(t){if(e.scope.signal.aborted)throw t;return!1}}async function A(e,t){return p(F(await N(e,t,[`getprop`,`ro.build.characteristics`])))===`tv`||(await I(v,2,async n=>await N(e,t,[`cmd`,`package`,`has-feature`,n]))).some(e=>F(e).toLowerCase().includes(`true`))||m(F(await N(e,t,[`pm`,`list`,`features`])))?`tv`:`mobile`}async function j(e,t){if(!e.emulator)return[];let n;try{n=await P(e,e.emulator,[`-list-avds`])}catch(t){if(e.scope.signal.aborted)throw t;return[]}if(n.exitCode!==0)return[];let r=new Set(t.filter(e=>e.kind===`emulator`).map(e=>c(e.name)));return d(n.stdout).filter(e=>!r.has(c(e))).map(e=>({platform:`android`,id:e,name:e,kind:`emulator`,target:h(e),booted:!1}))}function M(e,t){return r(`adb`,`shell`,t,[`-s`,e])}async function N(e,t,n,r=g){return await P(e,e.adb,M(t,n),r)}async function P(e,t,n,r=g){try{return await e.host.commands.run({executable:t,args:n,allowFailure:!0,timeoutMs:r},e.scope.signal)}catch(e){throw i(e)}}function F(e){return`${e.stdout}\n${e.stderr}`}async function I(e,t,n){let r=Array(e.length),i=0;return await Promise.all(Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t])}})),r}export{y as createAndroidInventory};
|
package/dist/src/inventory2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e}from"./sdk-contracts.js";import{A as t}from"./sdk-device.js";import{c as n}from"./simctl.js";const r=/^(iphone|ipad|ipod|appletv|realitydevice)/i,i=/ipad/i,a=/\b(apple vision|vision pro|xros|visionos|realitydevice)\b/i,o=/\b(iphone|ipad|ipod)\b/i,s=/^appletv/i,c=[`apple tv`,`appletv`,`tvos`];function l(e){return(e??``).trim().toLowerCase()}function u(e){return e.includes(`tvos`)}function d(e){return e.includes(`xros`)||e.includes(`visionos`)}function f(e){return u(l(e))?`tv`:`mobile`}function p(e){let t=l(e);return t.includes(`ios`)||t.includes(`tvos`)||t.includes(`xros`)||t.includes(`visionos`)}function m(e){let t=l(e);return c.some(e=>t.includes(e))}function h(e){return o.test(e.trim())}function g(e){return m(e)?`tv`:h(e)||a.test(e)?`mobile`:null}function _(e,t){return e===`tv`?`tvos`:t.some(e=>a.test(e))?`visionos`:t.some(e=>i.test(e))?`ipados`:`ios`}function v(e){return r.test(e.trim())}function y(e){return s.test(e.trim())}function b(e){return[e.name??``,e.deviceProperties?.name??``,e.deviceProperties?.deviceType??``]}function x(e){return e.hardwareProperties?.productType??e.deviceProperties?.productType??``}function S(e){return u(l(e.hardwareProperties?.platform))||y(x(e))||b(e).some(m)?`tv`:`mobile`}function C(e){let t=l(e.hardwareProperties?.platform);return t.includes(`ios`)||u(t)||d(t)||v(x(e))?!0:b(e).some(m)}function w(e){if(!C(e))return null;let t=e.hardwareProperties?.udid??e.identifier??``,n=e.name??e.deviceProperties?.name??t;if(!t)return null;let r=S(e),i=e.hardwareProperties?.marketingName?.trim(),a=e.deviceProperties?.osVersionNumber?.trim();return{platform:`apple`,id:t,name:n,kind:`device`,target:r,appleOs:_(r,[x(e),...b(e)]),...i?{model:i}:{},...a?{osVersion:a}:{},iosPhysicalDeviceBackend:`coredevice`,booted:!0}}const T=/^==\s*(.+?)\s*==$/,E=/^(?<name>.+?)\s+(?:\[(?<idBracket>[^[\]]+)\]|\((?<osVersion>[^)]+)\)\s+\((?<idParen>[^)]+)\))\s*$/;function D(e){let t=[],n=null;for(let r of e.split(/\r?\n/)){let e=r.trim();if(!e)continue;let i=T.exec(e);if(i){n=i[1]?.trim()??null;continue}if(n!==`Devices`)continue;let a=O(e);a&&t.push(a)}return t}function O(e){let t=E.exec(e)?.groups;if(!t)return;let n=t.name?.trim(),r=t.idBracket?.trim()||t.idParen?.trim();if(!n||!r)return;let i=g(n);if(!i)return;let a=t.osVersion?.trim();return{platform:`apple`,id:r,name:n,kind:`device`,target:i,appleOs:_(i,a?[n,a]:[n]),...a?{osVersion:a}:{},iosPhysicalDeviceBackend:`xctest`,booted:!0}}async function k(e,t){let[n,r]=await Promise.all([A(e,t),j(e,t)]);return M(n,r)}async function A(e,t){let n;try{return n=await e.files.createTemporaryTextFile({prefix:`agent-device-devicectl-`,suffix:`.json`}),(await e.appleTools.run({tool:`devicectl`,args:[`list`,`devices`,`--json-output`,n.path],allowFailure:!0,timeoutMs:8e3},t.signal)).exitCode===0?(JSON.parse(await n.readText()).result?.devices??[]).flatMap(e=>{let t=w(e);return t?[t]:[]}):[]}catch{return t.signal.throwIfAborted(),[]}finally{try{await n?.[Symbol.asyncDispose]()}catch{}}}async function j(e,t){try{let n=await e.appleTools.run({tool:`xctrace`,args:[`list`,`devices`],allowFailure:!0},t.signal);return n.exitCode===0?D(n.stdout):[]}catch{return t.signal.throwIfAborted(),[]}}function M(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r}function N(e,t){let n=P(e),r=[];for(let[i,a]of Object.entries(e.devices))if(p(i))for(let e of a){if(!e.isAvailable)continue;let a=f(i);r.push({platform:`apple`,id:e.udid,name:e.name,kind:`simulator`,target:a,appleOs:_(a,[i,e.deviceTypeIdentifier??``,e.name]),...n(i,e),booted:e.state===`Booted`,...t?{simulatorSetPath:t}:{}})}return r}function P(e){let t=new Map(e.devicetypes?.map(e=>[e.identifier,e.name])),n=new Map(e.runtimes?.map(e=>[e.identifier,e.version]));return(e,r)=>{let i=t.get(r.deviceTypeIdentifier??``),a=n.get(e);return{...i?{model:i}:{},...a?{osVersion:a}:{}}}}async function F(r,i,a){let o=i.iosSimulatorSetPath?.trim()||void 0,s=await r.appleTools.run({tool:`simctl`,args:n(o),...i.booted===!0?{timeoutMs:3e3}:{}},a.signal),c;try{c=N(JSON.parse(s.stdout),o)}catch(t){throw new e(`COMMAND_FAILED`,`Failed to parse simctl devices JSON`,void 0,t)}for(let e of c)e.booted===!0&&await r.observations.deviceBooted(e);return t(c)}function I(e){return Object.freeze({discover:async(t,n)=>await L(e,t,n)})}async function L(n,r,i){if(R(r))return[V(n)];if(n.hostOs!==`darwin`)throw B(n.hostOs);if(!await n.appleTools.isXcrunAvailable(i.signal))throw new e(`TOOL_MISSING`,`xcrun not found in PATH`);let a=F(n,r,i);if(r.kind===`simulator`)return await a;if(r.iosSimulatorSetPath||r.udid){let e=await a,o=[...e,V(n)];if(r.iosSimulatorSetPath||e.some(e=>e.id===r.udid))return t(o);let s=await k(n,i);return t(H(o,s))}let[o,s]=await Promise.all([a,k(n,i)]),c=[...o,V(n)];return t(H(c,s))}function R(e){return e.platform===`macos`||e.platform===`apple`&&e.target===`desktop`}const z={darwin:`macOS`,linux:`Linux`,win32:`Windows`,other:`a non-macOS host`};function B(t){return new e(`UNSUPPORTED_PLATFORM`,`Apple tools are only available on macOS`,{supportedOn:`macOS`,hostOs:t,retriable:!1,hint:`This host runs ${z[t]}, so it cannot boot iOS Simulators or run macOS sessions. Drive Android here instead with the same command shape: agent-device devices --platform android to list targets, then agent-device open <app.apk> --platform android. To use an iOS Simulator from this machine, run agent-device on a macOS host and pass --daemon-base-url <that daemon URL>.`})}function V(e){return{platform:`apple`,id:`host-macos-local`,name:e.hostName,kind:`device`,target:`desktop`,appleOs:`macos`,booted:!0}}function H(e,t){let n=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!n.has(e.id)&&(n.add(e.id),!0))]}export{I as createAppleInventorySource};
|
package/dist/src/inventory3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e}from"./sdk-contracts.js";import{n as t}from"./device-shell.js";import n from"node:path";function r(e,t={}){return{discover:async(n,r)=>await a(e,t,n,r)}}function i(e){return e.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(e=>e.length>0&&e!==`[Empty]`)}async function a(t,n,r,a){await t.toolchains.prepare(`harmonyos`);let u=await s(t,o(n));if(!u)throw new e(`TOOL_MISSING`,`hdc not found in PATH`,{hint:`Install HarmonyOS Command Line Tools, then add its sdk/default/openharmony/toolchains directory to PATH.`});let d=await l(t,u,[`list`,`targets`],a);if(d.exitCode!==0)throw new e(`COMMAND_FAILED`,`hdc list targets failed`,{stderr:d.stderr,hint:`Confirm the HarmonyOS emulator or device is running, then run hdc list targets.`});let f=i(d.stdout).filter(e=>!r.serial||r.serial===e);return await Promise.all(f.map(async e=>await c(t,u,e,a)))}function o(e){return[e.hdcSdkPath,e.devecoSdkHome&&n.join(e.devecoSdkHome,`default`,`openharmony`,`toolchains`),e.commandLineToolsHome&&n.join(e.commandLineToolsHome,`sdk`,`default`,`openharmony`,`toolchains`)].filter(e=>e!==void 0)}async function s(e,t){for(let r of t){let t=n.join(r,`hdc`);if(await e.files.isExecutable(t))return t}return await e.commands.which(`hdc`)}async function c(e,n,r,i){let[a,o]=await Promise.all([l(e,n,t(`hdc`,`shell`,[`param`,`get`,`const.product.name`],[`-t`,r]),i),l(e,n,t(`hdc`,`shell`,[`param`,`get`,`const.build.characteristics`],[`-t`,r]),i)]),s=a.exitCode===0?a.stdout.trim():``,c=s.toLowerCase()===`emulator`;return{platform:`harmonyos`,id:r,name:s||r,kind:c?`emulator`:`device`,target:o.stdout.toLowerCase().includes(`tv`)?`tv`:`mobile`,booted:!0}}async function l(e,t,n,r){return await e.commands.run({executable:t,args:n,allowFailure:!0,timeoutMs:1e4},r.signal)}export{r as createHarmonyInventory};
|
package/dist/src/inventory5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e}from"./sdk-contracts.js";import t from"node:path";const n=`VirtualDevice`;function r(e){return{discover:async(t,n)=>await a(e,n)}}function i(e){return l(e).some(c)?[{platform:`vega`,id:n,name:`Vega Virtual Device (${n})`,kind:`emulator`,target:`tv`,booted:!0}]:[]}async function a(t,n){let r=await o(t);if(!r)throw new e(`TOOL_MISSING`,`Vega CLI not found in PATH`,{hint:`Install Vega Developer Tools, source ~/vega/env, and retry devices.`});let a=await t.commands.run({executable:r,args:[`device`,`list`],allowFailure:!0,timeoutMs:1e4},n.signal);s(a);let c=i(a.stdout),u=l(a.stdout);if(c.length===0&&u.length>0)throw new e(`DEVICE_NOT_FOUND`,`Vega CLI found devices, but no supported Vega Virtual Device is running.`,{listedSerials:u,hint:`Start the Vega Virtual Device, then retry with --platform vega --target tv.`});return c}async function o(e){let n=await e.commands.which(`vega`);if(n)return n;let r=t.join(e.homeDirectory,`vega`,`bin`,`vega`);return await e.files.isExecutable(r)?r:void 0}function s(t){if(t.exitCode!==0)throw new e(`COMMAND_FAILED`,`Failed to list Vega devices`,{stdout:t.stdout,stderr:t.stderr,exitCode:t.exitCode,processExitError:!0})}function c(e){return e.toLowerCase()===`virtualdevice`}function l(e){let t=new Set;for(let n of e.split(/\r?\n/)){let e=/^\s*([^\s:]+)\s*:\s*\S/.exec(n)?.[1]?.trim();e&&t.add(e)}return[...t]}export{r as createVegaInventory};
|