agent-device 0.21.30 → 0.21.31
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.30.apk → agent-device-android-ime-helper-0.21.31.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.31.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.30.manifest.json → agent-device-android-ime-helper-0.21.31.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.31.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.31.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.30.manifest.json → agent-device-android-snapshot-helper-0.21.31.manifest.json} +7 -7
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift +20 -6
- package/apple/snapshot-bridge/README.md +16 -3
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +33 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +110 -8
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAppScreenCapture.swift +20 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +4 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +30 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +14 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +81 -41
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +40 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +5 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +74 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +33 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +2 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +23 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +158 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +165 -70
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +2 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +49 -27
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +17 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +30 -28
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +87 -87
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +4 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +13 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +45 -0
- package/dist/src/absence-observation-errors.js +1 -1
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb-executor.js +1 -1
- package/dist/src/adb-failure.js +2 -2
- 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 +1 -1
- package/dist/src/alert-tree-driver.js +1 -1
- package/dist/src/alert.js +1 -1
- package/dist/src/alert2.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-backend.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +4 -4
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-log-session-resource.js +1 -1
- package/dist/src/app-resolution-facade.js +1 -1
- 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/artifact-tracking.js +1 -1
- package/dist/src/automation-helper-artifact.js +1 -1
- package/dist/src/automation-helper.js +1 -1
- package/dist/src/back-mode.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/browser-launch.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +35 -29
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +3 -3
- package/dist/src/client-metro-companion.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +3 -3
- package/dist/src/cloud-artifacts.d.ts +5 -4
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/command-metadata.js +10 -10
- package/dist/src/command-tools.js +2 -2
- package/dist/src/command.js +1 -1
- package/dist/src/composed-inventory-gateways.js +1 -1
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +5 -5
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-ensure.js +1 -1
- 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 -1
- package/dist/src/daemon-client.js +1 -1
- package/dist/src/daemon-command-registry.js +1 -1
- package/dist/src/daemon-composition.js +1 -1
- package/dist/src/daemon-policy-file.js +1 -1
- package/dist/src/daemon-registration-owner.js +3 -3
- package/dist/src/daemon-resolution.js +1 -1
- package/dist/src/daemon-startup-diagnostics.js +1 -1
- package/dist/src/debug-symbols-facade.js +3 -3
- package/dist/src/device-claim-recovery.js +1 -1
- package/dist/src/device-claims.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-selection-resolver.js +1 -1
- package/dist/src/device.js +1 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/display-inventory.js +1 -1
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -1
- package/dist/src/durable-resource.js +1 -1
- package/dist/src/engine-eval-script.js +1 -1
- package/dist/src/error.js +1 -1
- package/dist/src/explicit-session-resolution.js +1 -1
- package/dist/src/expo-dev-client-launch.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.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/hdc.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/host.js +1 -1
- package/dist/src/host2.js +1 -1
- package/dist/src/host3.js +1 -1
- package/dist/src/host4.js +1 -1
- package/dist/src/host5.js +1 -0
- package/dist/src/human-control.js +1 -1
- package/dist/src/ime-rebind.js +1 -1
- package/dist/src/ime-state.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +1 -1
- package/dist/src/install-source-network-transport.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-catalog.js +1 -1
- package/dist/src/interactor.js +5 -5
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactor3.js +1 -1
- package/dist/src/interactor4.js +1 -1
- package/dist/src/interactor5.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 -1
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/inventory.js +1 -1
- package/dist/src/inventory2.js +1 -1
- package/dist/src/inventory6.js +1 -1
- package/dist/src/ios-node-interpretation.js +1 -1
- package/dist/src/ios-settings.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/keyboard-occlusion.js +1 -1
- package/dist/src/keyed-lock.js +1 -1
- package/dist/src/launch-confirmation.js +1 -1
- package/dist/src/launch-services-registration.js +4 -4
- package/dist/src/lease.js +1 -1
- package/dist/src/legacy.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/mechanics.js +12 -12
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/observability.js +1 -1
- package/dist/src/output-path.js +1 -1
- package/dist/src/parameterized-recorded-fill.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-target.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-runtime-android-adb-host.js +1 -1
- package/dist/src/platform-runtime-claim-recovery.js +1 -1
- package/dist/src/platform-runtime-daemon-services.js +1 -1
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +5 -5
- package/dist/src/platform-runtime-runtime-hints.js +2 -2
- 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-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/png-resize.js +1 -1
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/process-exit.js +1 -1
- package/dist/src/provider-device-runtime.d.ts +28 -0
- package/dist/src/provider-plugin-catalog.js +2 -0
- package/dist/src/provider-plugin.d.ts +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/proxy.js +1 -1
- package/dist/src/react-native-overlay2.js +1 -1
- package/dist/src/react-native.js +1 -1
- package/dist/src/react-profile-command.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/recording-scope.js +1 -1
- package/dist/src/recording.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/remote-config-core.js +1 -1
- package/dist/src/replay-backend-host.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay-maestro-backend.js +3 -3
- package/dist/src/replay-script-selection.js +1 -1
- package/dist/src/replay2.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/request.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-retention.js +1 -1
- 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-device-set.js +1 -1
- package/dist/src/runner-error-classification.js +2 -2
- package/dist/src/runner-exchange.js +1 -1
- package/dist/src/runner-lease.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-retention.js +1 -1
- package/dist/src/runner-selector-query.js +1 -1
- package/dist/src/runner-start-budget.js +1 -1
- package/dist/src/runner-startup-transport.js +1 -1
- package/dist/src/runner-toolchain-probe.js +1 -1
- package/dist/src/runner.js +2 -2
- package/dist/src/runtime-admission.js +1 -1
- package/dist/src/runtime-deployment.js +1 -1
- package/dist/src/runtime-factory.js +1 -1
- package/dist/src/runtime-session.js +1 -1
- package/dist/src/runtime.js +4 -4
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime2.js +1 -1
- package/dist/src/runtime3.js +5 -5
- package/dist/src/runtime4.js +1 -1
- 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 +2 -2
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot3.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 +9 -0
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-io.js +5 -5
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-pipeline-policy.js +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/server-startup.js +1 -1
- package/dist/src/session-paths.js +1 -1
- package/dist/src/session-replay-vars.js +1 -1
- package/dist/src/session-runtime.js +1 -1
- package/dist/src/session-store.js +3 -3
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings-bluetooth.js +1 -1
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -1
- package/dist/src/settle-observation-capture.js +1 -1
- package/dist/src/simctl-settings.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-boot.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-chrome.js +1 -1
- package/dist/src/snapshot-desktop-projection.js +1 -1
- package/dist/src/snapshot-helper-install.js +6 -6
- package/dist/src/snapshot-node-lookup.js +1 -1
- package/dist/src/snapshot-occlusion.js +1 -1
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime-capture-input.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-state.js +1 -1
- package/dist/src/snapshot.js +1 -1
- package/dist/src/snapshot3.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src3.js +1 -1
- package/dist/src/src4.js +1 -1
- package/dist/src/store.js +1 -1
- package/dist/src/tap-keyboard-occlusion.js +1 -1
- package/dist/src/target-evidence-tree.js +1 -1
- package/dist/src/target-evidence.js +1 -1
- package/dist/src/telephony-runtime.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider.js +3 -3
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/tool-provider3.js +1 -1
- package/dist/src/toolchain-probe.js +1 -1
- package/dist/src/touch-reference-frame.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/touch-runtime2.js +1 -1
- package/dist/src/tree.js +1 -1
- package/dist/src/tv-remote-runtime.js +1 -1
- package/dist/src/tv-remote.js +2 -2
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/vega-executable.js +1 -1
- package/dist/src/video.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +7 -6
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.30.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.30.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.30.apk.sha256 +0 -1
- package/dist/src/physical-device-apps.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as e}from"./sdk-contracts.js";import{
|
|
1
|
+
import{R as e}from"./sdk-contracts.js";import{_t as t}from"./sdk-io.js";import"./diagnostics.js";import{xn as n}from"./sdk-batch.js";import{s as r}from"./app-resolution.js";import{n as i}from"./alert.js";const a=`launch_confirmation_foreign_app`,o=/^Open in [“"].+[”"]\?$/u,s=1e4;async function c(n){let r=await u(()=>n.awaitAlert());if(`outcome`in r)return r;let i=r.alert;if(!i)return{outcome:`absent`};if(!p(i))return t({level:`warn`,phase:`ios_launch_confirmation_unanswered`,data:{reason:`alert-unrecognized`,title:i.message,buttons:i.items}}),{outcome:`unanswered`,reason:`alert-unrecognized`};let o=await d(n);if(`outcome`in o)return o;if(o.owner===void 0)return h(`url-owner-unresolved`,{}),{outcome:`unanswered`,reason:`url-owner-unresolved`};if(o.owner!==n.appBundleId)throw new e(`COMMAND_FAILED`,`The launch URL asks to open ${o.owner} instead.`,{reason:a,foreignAppBundleId:o.owner,sessionAppBundleId:n.appBundleId,hint:`iOS is asking whether to open ${o.owner}. Answer it with alert accept or alert dismiss, and pass a launch URL whose scheme belongs to the session app.`});return await n.acceptAlert().then(f,async e=>await l(n,i,e))}async function l(e,t,n){let r=await u(()=>e.readAlert());return`outcome`in r?m(`alert-accept`)(n):r.alert&&p(r.alert)&&r.alert.message===t.message?(h(`alert-still-present`,{}),{outcome:`unanswered`,reason:`alert-still-present`}):m(`alert-accept`)(n)}async function u(e){return await e().then(e=>({alert:e}),m(`alert-read`))}async function d(e){return await e.resolveUrlOwner().then(e=>({owner:e}),m(`url-owner`))}function f(){return{outcome:`accepted`}}function p(e){let t=e.message,n=e.items;return typeof t==`string`&&o.test(t)&&Array.isArray(n)&&n.length===2&&n.includes(`Cancel`)&&n.includes(`Open`)}function m(t){return n=>(h(`step-failed`,{step:t,code:n instanceof e?n.code:void 0}),{outcome:`unreadable`,step:t})}function h(e,n){t({level:`debug`,phase:`ios_launch_confirmation_unanswered`,data:{reason:e,...n}})}async function g(e,t,n,r){let i=await n.then(e=>({interactor:e}),m(`runner`));return`outcome`in i?i:await c(_(e,t,i.interactor,r))}function _(e,{url:t,appBundleId:a},o,c){let l=o.awaitAlert?.bind(o),u=o.readAlert?.bind(o),d=o.acceptAlert?.bind(o);if(!l||!u||!d)throw n(`Apple interactor has no alert wait, read or accept leg`);let f={appBundleId:a,surface:`app`};return Object.freeze({appBundleId:a,awaitAlert:async()=>await i(l({...f,timeoutMs:3e3})),readAlert:async()=>await i(u(f)),acceptAlert:async()=>await d(f),resolveUrlOwner:async()=>await r(e,t,{timeoutMs:s,signal:c})})}export{a as LAUNCH_CONFIRMATION_FOREIGN_APP_REASON,s as URL_OWNER_LOOKUP_TIMEOUT_MS,c as answerLaunchConfirmation,g as answerSimulatorLaunchConfirmation,_ as createLaunchConfirmationPort};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as e}from"./sdk-contracts.js";import{C as t,
|
|
2
|
-
`),o=t.filter(e=>!
|
|
3
|
-
`).some(e=>e.startsWith(t)&&e[t.length]===`:`)}function
|
|
4
|
-
`)?e.slice(0,-1):e}function
|
|
1
|
+
import{R as e}from"./sdk-contracts.js";import{C as t,L as n,_t as r,q as i}from"./sdk-io.js";import"./diagnostics.js";import"./command.js";import"./retry.js";import a from"node:path";import{setTimeout as o}from"node:timers/promises";const s=`Contents/Info.plist`,c=/ASN:/;async function l(t,i){let a=n.fromTimeoutMs(2500);try{let e=await d(t,i,a);if(e===void 0)return;let n=await f(t,i,a);return n.size===0||!e&&!await u(t,i,[...n.values()].flat(),a)?void 0:n.size===1?[...n.keys()][0]:void 0}catch(t){r({level:`warn`,phase:`macos_launch_services_registration_probe_failed`,data:{bundleId:i,reason:t instanceof e?t.code:`probe_read_failed`}});return}}async function u(e,t,n,r){for(let i=0;i<10;i+=1){if(r.remainingMs()<300)return!1;await o(200);for(let i of n)if(await d(e,t,r,i)===!0)return!0}return!1}async function d(e,t,n,r){let a=_(n,1e3);if(a===void 0)return;let o;try{o=await e(`/usr/bin/lsappinfo`,[`find`,`bundleid=${t}`,...r===void 0?[]:[`pid=${r}`]],{allowFailure:!0,timeoutMs:a})}catch(e){if(i(e))return;throw e}if(o.exitCode===0)return c.test(o.stdout)}async function f(e,n,i){let o=_(i,2e3);if(o===void 0)return new Map;let c=await t({runCommand:e,timeoutMs:o});if(c.length===0)return r({level:`warn`,phase:`macos_launch_services_process_table_unreadable`,data:{bundleId:n}}),new Map;let l=new Map;for(let e of c){let t=p(e.command);if(t===void 0)continue;let n=l.get(t);n?n.push(e.pid):l.set(t,[e.pid])}if(l.size===0)return l;let u=Array.from(l.keys()),d=await m(e,u.map(e=>a.join(e,s)),i);return new Map(u.filter(e=>d.get(a.join(e,s))?.trim().toLowerCase()===n.toLowerCase()).map(e=>[e,l.get(e)]))}function p(e){if(!a.isAbsolute(e))return;let t=e.indexOf(`/Contents/MacOS/`);if(t<=0)return;let n=e.slice(0,t);return n.endsWith(`.app`)?n:void 0}async function m(e,t,n){let r=_(n,1500);if(r===void 0)return new Map;let i=await e(`plutil`,[`-extract`,`CFBundleIdentifier`,`raw`,...t],{allowFailure:!0,timeoutMs:r}),a=g(i.stdout).split(`
|
|
2
|
+
`),o=t.filter(e=>!h(i.stderr,e));if(a.length!==o.length)return new Map;let s=new Map;return o.forEach((e,t)=>{let n=a[t]?.trim();n&&s.set(e,n)}),s}function h(e,t){return e.split(`
|
|
3
|
+
`).some(e=>e.startsWith(t)&&e[t.length]===`:`)}function g(e){return e.endsWith(`
|
|
4
|
+
`)?e.slice(0,-1):e}function _(e,t){let n=e.remainingMs();return n<100?void 0:Math.min(t,n)}export{l as resolveListedRunningBundle};
|
package/dist/src/lease.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{H as e,J as t,R as n,m as r}from"./sdk-contracts.js";import{E as i,St as a,_t as o,bt as s,ft as c,mt as l,pt as u}from"./back-mode.js";import{I as d}from"./sdk-device.js";import{et as f}from"./sdk-batch.js";import{P as p}from"./src.js";import{c as m}from"./device-shell.js";import{r as h}from"./artifact-tracking.js";import{g,l as _,m as v}from"./lease-registry-scope.js";import{n as y,r as b}from"./lease-context.js";import{o as x,s as S}from"./request.js";async function C(e){let{req:t,sessionName:n,sessionStore:r,leaseRegistry:o,providerRuntimeIds:c,failedPlugins:l,providerCredentials:u,leaseLifecycleProvider:d,cloudArtifactProvider:p,endSessionsForLease:m}=e,h=y(t);switch(t.command){case i.artifacts:return{ok:!0,data:await P(t,b(t,r.get(n)),o,p,e.host.env)};case`lease_allocate`:{H(h.leaseBackend);let n=g(h.leaseProvider);M(n,c??[],l??[]),N({leaseProvider:n,leaseBackend:h.leaseBackend},t.meta?.providerCredentialFingerprint,u);let{lease:r,reused:i}=await w(t,h,o,e.host),a=t.meta?.requestId;return await o.runDeviceMutation(r,async()=>{let n,s=d?.allocate?o.retainLeaseWork(r,()=>!S(a)):void 0;try{n=await d?.allocate?.(r,{...j(t,e.host),signal:x(a),deadline:Date.now()+f}),B(o,r,n)}catch(e){throw await D(r,i,a,d,o),e}finally{s?.release()}if(S(a))throw await O(r,d,o);return{ok:!0,data:{lease:o.getLease(_(r))??r,...n?{provider:n}:{}}}})}case`lease_heartbeat`:{let n=o.heartbeatLease(s(h)),r=await d?.heartbeat?.(n,j(t,e.host));return{ok:!0,data:{lease:n,...r?{provider:r}:{}}}}case`lease_release`:{let n=a(h),r=o.getLease(n);V(r);let i=await o.runDeviceMutation(r,async()=>await E(o,d,r,n,j(t,e.host)));return r&&i.registryReleased&&await m?.(r.leaseId),{ok:!0,data:{released:i.registryReleased,...i.provider?{provider:i.provider}:{}}}}default:return null}}async function w(e,t,n,r){let i=o(t),a=n.renewRequestedLease(i);if(a)return{lease:a,reused:!0};let s=await T(e,t,r.env),c=new Set(n.listActiveLeases().map(e=>e.leaseId)),l=n.allocateLease(s?{...i,deviceKey:s}:i);return{lease:l,reused:c.has(l.leaseId)}}async function T(e,t,n){if(!c(t)||t.deviceKey)return;let i=e.flags??{},{hasDeviceSelectionInput:a}=await import(`./src.js`).then(e=>e.T);if(!a(i))return;let{resolveTargetDevice:o}=await import(`./replay-script-selection.js`).then(e=>e.l),s=await o({platform:i.platform??(t.leaseBackend?r(t.leaseBackend):void 0),target:i.target,device:i.device,udid:i.udid,serial:i.serial,iosSimulatorDeviceSet:i.iosSimulatorDeviceSet,androidDeviceAllowlist:i.androidDeviceAllowlist},{env:n});return u({platform:d(s),target:s.target,id:s.id})}async function E(e,t,n,r,i){let a=n?await t?.release?.(n,i):void 0;return n&&B(e,n,a),{registryReleased:e.releaseLease(r).released,provider:a}}async function D(e,t,n,r,i){if(!t){i.releaseLease(_(e));return}if(S(n))throw await O(e,r,i)}async function O(e,n,r){let i=_(e),a,o;try{a=await E(r,n,e,i)}catch(e){o=t(e),a={registryReleased:r.releaseLease(i).released}}return k(e,a,o)}function k(t,n,r){let i=n.provider?.providerSessionId,a=Array.isArray(n.provider?.warnings)?n.provider.warnings:[],o=n.registryReleased&&r===void 0&&a.length===0;return e({leaseId:t.leaseId,leaseProvider:t.leaseProvider,released:o,registryReleased:n.registryReleased,providerSessionId:i,...a.length>0?{warnings:a}:{},...r===void 0?{}:{releaseError:r},hint:A(o,t.leaseId,i)})}function A(e,t,n){return e?`The lease request was canceled while the provider was still allocating; the session it produced was released.`:`The lease request was canceled while the provider was still allocating, and the session it produced could NOT be confirmed released — it may still be running and billing. Stop provider session ${String(n??`(unknown)`)} for lease ${t} by hand.`}function j(e,t){return{flags:e.flags,...typeof e.flags?.providerApp==`string`?{initialApp:e.flags.providerApp}:{},cwd:typeof e.meta?.cwd==`string`?e.meta.cwd:t.cwd,...e.internal?.publicNetworkOnly?{publicNetworkOnly:!0}:{}}}function M(e,t,r){let i=l({leaseProvider:e});if(i===void 0||t.includes(i))return;let a=r.flatMap(e=>e.state===`failed`&&(e.provider===i||e.provider===void 0)?[{...e.provider===void 0?{}:{provider:e.provider},...e.package===void 0?{}:{package:e.package},code:e.error.code,...e.error.reason===void 0?{}:{reason:e.error.reason},message:e.error.message}]:[]);throw new n(`UNSUPPORTED_OPERATION`,`Provider "${i}" is not available in this daemon runtime.`,{reason:`provider-not-registered`,provider:i,registeredProviders:[...t],...a.length>0?{failedPlugins:a}:{},hint:a.length>0?`Fix the plugin that failed to register (see failedPlugins or agent-device daemon status), restart the daemon, then retry lease allocation.`:`Restart the daemon with ${i} configured, then retry lease allocation.`})}function N({leaseProvider:e,leaseBackend:t},r,i){if(!i||!e||!r)return;let a=i.fingerprint(e,t);if(r!==a)throw new n(`INVALID_ARGS`,a?`The running daemon holds different ${e} credentials than this shell.`:`The running daemon was started without the ${e} credentials this shell holds.`,{reason:`provider-credentials-changed`,provider:e,hint:`Stop it with agent-device daemon stop --state-dir ${m(i.stateDir)}, then rerun the command so a new daemon starts with this shell's environment.`})}async function P(e,t,n,r,i){let a=z(e.flags,`providerSessionId`);return F(t,a)?await I(t.tenantId,i):await L(t,a,n,r)}function F(e,t){return c(e)||!e.leaseProvider&&!t}async function I(e,t){let n=await h(e,t);return{source:`daemon`,status:`ready`,artifacts:n,...n.length===0?{message:`No daemon artifacts available.`}:{}}}async function L(e,t,r,i){if(!e.leaseProvider)throw new n(`INVALID_ARGS`,`artifacts requires --provider for provider session lookup or an active cloud connection.`);if(!e.leaseId&&!t)throw new n(`INVALID_ARGS`,`artifacts requires an active cloud lease or --provider-session <id>.`);let a=R(r,e,t),o=await i?.listCloudArtifacts?.({provider:e.leaseProvider,leaseId:a?.leaseId??e.leaseId,providerSessionId:t});if(!o)throw new n(`UNSUPPORTED_OPERATION`,`Cloud artifacts are not available for provider "${e.leaseProvider}".`);return o}function R(e,t,r){if(!r)return;let i=e.resolveProviderSession({provider:t.leaseProvider,providerSessionId:r,tenantId:t.tenantId});if(i)return i;throw new n(`UNAUTHORIZED`,`Provider session is not owned by the request tenant`,{reason:`PROVIDER_SESSION_NOT_OWNED`})}function z(e,t){let n=e?.[t];return typeof n==`string`&&n.trim().length>0?n.trim():void 0}function B(e,t,n){let r=p(n);r&&e.recordProviderSession(t,r)}function V(e){if(e?.backend===`macos-app`)throw new n(`UNAUTHORIZED`,`A macos-app lease is released by the host administrator.`,{reason:`MACOS_APP_LEASE_HOST_OWNED`,retriable:!1,hint:`Disconnect only drops the client connection; the host ends the lease.`})}function H(e){if(v(e)===`macos-app`)throw new n(`UNAUTHORIZED`,`A macos-app lease is allocated by the host administrator.`,{reason:`MACOS_APP_LEASE_HOST_ALLOCATED`,retriable:!1,hint:`Ask the host administrator for a macos-app lease and connect with its leaseId.`})}export{C as handleLeaseCommands};
|
package/dist/src/legacy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as e}from"./sdk-contracts.js";import{v as t}from"./sdk-batch-runner.js";import{u as n}from"./store.js";import{t as r}from"./
|
|
1
|
+
import{R as e}from"./sdk-contracts.js";import{v as t}from"./sdk-batch-runner.js";import{u as n}from"./store.js";import{t as r}from"./host4.js";import{pathToFileURL as i}from"node:url";function a(a,s,c){let l=a.agentDevicePlugin,u=async t=>{let r=await import(i(n(s,l.entry)).href);if(typeof r.default!=`function`)throw new e(`INVALID_ARGS`,`Plugin must export a default factory: ${a.name}`,{reason:`invalid_plugin`});return await r.default(t)},d=async(n,i)=>{let s=await u(r(n,c));try{let n=t(s)?s.connection:void 0;if(!t(n)||!o(n.resolve)||!o(n.verify))throw new e(`INVALID_ARGS`,`Plugin connection must provide resolve and verify: ${a.name}`,{reason:`invalid_plugin`});return await i(n)}finally{let e=t(s)?s.runtime:void 0;o(e?.shutdown)&&await Promise.allSettled([e.shutdown()])}};return{apiVersion:2,provider:l.provider,credentials:{variables:l.credentialVariables??[]},...l.connection?{connection:{capabilities:l.connection,resolve:async e=>await d(e.env,t=>t.resolve(e)),verify:async e=>await d(e.env,t=>t.verify(e))}}:{},setup:async e=>{let n=await u(e);return t(n)&&`webDriver`in n?{webDriver:n.webDriver}:n}}}function o(e){return typeof e==`function`}export{a as adaptLegacyPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.js";import{R as t}from"./sdk-contracts.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime.js";import{R as t}from"./sdk-contracts.js";import{K as n,Q as r,st as i}from"./sdk-io.js";import"./command.js";import{a}from"./version.js";import{C as o,g as s,h as c,m as l}from"./adb-executor.js";import"./mechanics.js";import"./platform-runtime-android-adb-host.js";import{r as u}from"./scoped-provider.js";import{n as d}from"./android.js";var f=e({createLimrunRuntimeDependencies:()=>p});function p(e){let f=t=>i({host:e,requestEnv:void 0},t);return{clientVersion:a(),android:{createInteractor:(e,t)=>u(d(e,t),f),createPortReverse:async(e,t)=>{let{createAndroidPortReverseManager:n}=await import(`./mechanics.js`).then(e=>e.r);return n(e,t)},inferAppName:async e=>{let{inferAndroidAppName:t}=await import(`./mechanics.js`).then(e=>e.r);return t(e)},listApps:async(e,t)=>{let{listAndroidAppsWithAdb:n}=await import(`./mechanics.js`).then(e=>e.r);return(await n(e,{filter:t,target:`mobile`})).map(e=>({id:e.package,name:e.name}))},getForegroundApp:async(e,t,n)=>{let{getAndroidAppStateWithAdb:r}=await import(`./platform-runtime2.js`),i=await r(async(e,r)=>await t(e,{...r,signal:n}),n);return i.package?{appId:i.package,activity:i.activity}:void 0},getKeyboardState:async e=>{let{getAndroidKeyboardStatusWithAdb:t}=await import(`./mechanics.js`).then(e=>e.r);return await t(e)},dismissKeyboard:async e=>{let{dismissAndroidKeyboardWithAdb:t}=await import(`./mechanics.js`).then(e=>e.r);return await t(e)},readLogs:async(e,t)=>{let{captureAndroidLogcatWithAdb:n}=await import(`./mechanics.js`).then(e=>e.r);return await n(e,{lines:t,timeoutMs:5e3})},forceStopApp:async(e,t,n)=>{let{runAdbShell:r}=await import(`./mechanics.js`).then(e=>e.r);await r(async(t,r)=>await e(t,{...r,signal:n}),[`am`,`force-stop`,t],{allowFailure:!0})},deviceAdbInvocation:(e,t)=>c(s(e),t),hostAdbInvocation:e=>c(l(),e),adbError:async(e,t,n)=>{let{androidAdbResultError:r,serializeAndroidAdbInvocation:i}=await import(`./mechanics.js`).then(e=>e.r);return r(e,t,n?{command:`adb ${i(n).join(` `)}`}:void 0)}},host:u({runAdb:async(e,t)=>await o(e,t),downloadFile:async e=>{let{downloadLimrunFile:t}=await import(`./limrun-download-file.js`);await t(e)},archiveDirectory:async({sourceDirectory:e,entryName:i,archivePath:a})=>{let o=[`-qr`,a,i],s=await r(`zip`,o,{cwd:e,timeoutMs:12e4});if(s.exitCode!==0)throw new t(`COMMAND_FAILED`,`Failed to package iOS .app for Limrun install`,{command:[`zip`,...o].join(` `),...n(s)})}},f),ios:u({applySimctlSetting:async e=>{let{applySimctlSetting:t}=await import(`./simctl-settings-facade.js`);return await t(e)},resolveAppAlias:async e=>{let{resolveIosAppAlias:t}=await import(`./app-resolution-facade.js`);return t(e)},readBundleAppName:async e=>{let{readIosBundleInfo:t}=await import(`./install-artifact-facade.js`);return(await t(e)).appName}},f)}}export{f as n,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bn as e}from"./sdk-batch.js";import{t}from"./touch-runtime.js";import{E as n,P as r,V as i,W as a,X as o,q as s}from"./tv-remote-runtime.js";import{t as c}from"./interactor-operation-catalog.js";function l(l){let{facts:u,pause:d}=l,f={device:l.device,signal:l.signal,resolveInteractor:l.resolveInteractor};return{...u.captureScreenshot.available?r(f):{},...u.focusPoint.available?s(f):{},...a({...f,facts:u}),...u.scrollDirection.available?i(f):{},...u.typeText.available?n(f):{},...u.readTextAtPoint.available?o(f):{},...e(u.tapPoint,()=>t({...f,facts:u,pause:d})),...c({...f,facts:u})}}export{l as t};
|