agent-device 0.21.13 → 0.21.14
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.13.apk → agent-device-android-ime-helper-0.21.14.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.14.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.13.manifest.json → agent-device-android-ime-helper-0.21.14.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.14.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.14.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.13.manifest.json → agent-device-android-snapshot-helper-0.21.14.manifest.json} +6 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +23 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +12 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +19 -15
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AlertObservation.swift +2 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +16 -20
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+GestureExecution.swift +8 -13
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +16 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollDragExecution.swift +8 -24
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +20 -42
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +7 -14
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +17 -17
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +2 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +48 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +0 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +0 -7
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +7 -14
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotCoordinateSpace.swift +16 -19
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotGeometry.swift +21 -9
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +59 -10
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationInvariant.swift +12 -10
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +13 -8
- 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 +1 -1
- package/dist/src/adb-transport.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/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 +1 -1
- package/dist/src/app-lifecycle2.js +1 -1
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-runtime2.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/archive.js +1 -1
- 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/backend-snapshot-options.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/capture-disclosure.js +1 -1
- package/dist/src/capture.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +2 -2
- package/dist/src/cli.js +4 -4
- package/dist/src/click-button.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/clipboard-shell-response.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 +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/debug-symbols-facade.js +1 -1
- package/dist/src/device-claim-rule.js +2 -2
- package/dist/src/device-inventory-context.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/device2.js +1 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/dispatch-resolve.js +1 -1
- package/dist/src/doctor2.js +1 -1
- 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/format.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/helper.js +1 -1
- package/dist/src/human-control-contract.js +1 -1
- package/dist/src/human-control.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-artifact-facade.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-ref-policy.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-binding.js +1 -1
- package/dist/src/interactor.js +1 -1
- 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 +2 -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 +1 -1
- 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-snapshot-runtime.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun-download-file.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/mechanics.js +5 -5
- package/dist/src/multitouch-support.js +1 -1
- package/dist/src/native-build-cache.js +1 -0
- package/dist/src/observation.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-runtime-plan.js +1 -1
- package/dist/src/perf-target.js +2 -2
- package/dist/src/perf.js +1 -1
- package/dist/src/physical-device-control.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 +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-process-host.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- 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/provider-session-ownership.js +1 -1
- package/dist/src/provider-webdriver.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/recording.js +1 -1
- package/dist/src/register-builtins.js +1 -1
- package/dist/src/registry.js +13 -13
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay.js +1 -1
- package/dist/src/reporting.js +1 -1
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-cancel.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-metadata.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-disposal.js +1 -1
- package/dist/src/runner-error-classification.js +2 -2
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +3 -3
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime2.js +1 -1
- 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/screenshot-density.js +1 -1
- package/dist/src/screenshot-image.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 +21 -2
- package/dist/src/sdk-contracts.js +1 -1
- 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/selector-runtime.js +1 -1
- package/dist/src/server.js +1 -1
- package/dist/src/session-allocation.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-store.js +2 -2
- package/dist/src/session2.js +3 -3
- package/dist/src/settings.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.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/string-enum.js +1 -1
- package/dist/src/takeover.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider-facade.js +1 -1
- package/dist/src/tool-provider.js +2 -2
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/transport.js +1 -1
- package/dist/src/tv-remote.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/verified-file.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 +1 -1
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.13.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.13.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.13.apk.sha256 +0 -1
- package/dist/src/snapshot-process.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{a as t,c as n,h as r,t as i}from"./exec.js";import"./command.js";import{t as a}from"./scoped-provider.js";import{f as o,u as s}from"./host-file.js";import c from"node:path";function l(e,t){return t===`user-installed`?e.filter(e=>!e.bundleId.startsWith(`com.apple.`)):e}function u(n,r){return{openBundle:async(e,t)=>{await n(`open`,d(e,t))},openTarget:async e=>{await n(`open`,[e])},readClipboard:async()=>t(await n(`pbpaste`,[],{allowFailure:!0}),`Failed to read macOS clipboard`).stdout.replaceAll(`\r
|
|
2
2
|
`,`
|
|
3
3
|
`).replace(/\n$/,``),writeClipboard:async e=>{t(await n(`pbcopy`,[],{allowFailure:!0,stdin:e}),`Failed to write macOS clipboard`)},readDarkMode:async()=>{let r=t(await n(`osascript`,[`-e`,`tell application "System Events" to tell appearance preferences to get dark mode`],{allowFailure:!0}),`Failed to read macOS appearance`),i=r.stdout.trim().toLowerCase();if(i===`true`)return!0;if(i===`false`)return!1;throw new e(`COMMAND_FAILED`,`Unable to determine current macOS appearance from osascript output: ${r.stdout.trim()}`)},setDarkMode:async e=>{t(await n(`osascript`,[`-e`,`tell application "System Events" to tell appearance preferences to set dark mode to ${e?`true`:`false`}`],{allowFailure:!0}),`Failed to set macOS appearance`)},listApps:async e=>await f(n,r,e)}}function d(e,t){let n=[`-b`,e];return t&&n.push(t),n}async function f(e,t,n){let r=[`/Applications`,`/System/Applications`,c.join(o(),`Applications`)],i=new Set;for(let t of r){if(!(await s(t).catch(()=>null))?.isDirectory())continue;let n=await e(`find`,[t,`-maxdepth`,`4`,`-type`,`d`,`-name`,`*.app`],{allowFailure:!0});if(n.exitCode===0)for(let e of n.stdout.split(`
|
|
4
|
-
`)){let t=e.trim();t&&i.add(t)}}return l((await Promise.all(Array.from(i).map(async e=>{let n=await p(e,t).catch(()=>({})),r=n.bundleId;return r?{bundleId:r,name:n.appName??c.basename(e,`.app`)}:null}))).filter(e=>e!==null).sort((e,t)=>e.name.localeCompare(t.name)),n)}async function p(e,t){for(let n of[c.join(e,`Contents`,`Info.plist`),c.join(e,`Info.plist`)]){let e=await t(n),r=m(e,`CFBundleIdentifier`),i=m(e,`CFBundleDisplayName`),a=m(e,`CFBundleName`);if(r||i||a)return{bundleId:r,appName:i??a}}return{}}function m(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}const
|
|
4
|
+
`)){let t=e.trim();t&&i.add(t)}}return l((await Promise.all(Array.from(i).map(async e=>{let n=await p(e,t).catch(()=>({})),r=n.bundleId;return r?{bundleId:r,name:n.appName??c.basename(e,`.app`)}:null}))).filter(e=>e!==null).sort((e,t)=>e.name.localeCompare(t.name)),n)}async function p(e,t){for(let n of[c.join(e,`Contents`,`Info.plist`),c.join(e,`Info.plist`)]){let e=await t(n),r=m(e,`CFBundleIdentifier`),i=m(e,`CFBundleDisplayName`),a=m(e,`CFBundleName`);if(r||i||a)return{bundleId:r,appName:i??a}}return{}}function m(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function h(e){return Object.freeze([`simctl`,...e])}async function g(e,t,n){return await e(`xcrun`,[...h(t)],n)}function _(e){return Object.freeze(e.slice(1))}const v={runCommand:n,simctl:{run:async(e,t)=>await g(n,e,t)},devicectl:{run:async(e,t)=>await n(`xcrun`,[`devicectl`,...e],t)},plist:{readJson:async(e,t)=>await A(n,e,t)},macosHost:u(n,async e=>await A(n,e)),whichCommand:r},y=a(v,D);function b(e={}){let t={...v,...e},n=e.plist??{readJson:async(e,n)=>await A(t.runCommand,e,n)};return{...t,simctl:e.simctl??{run:async(e,n)=>await g(t.runCommand,e,n)},devicectl:e.devicectl??{run:async(e,n)=>await t.runCommand(`xcrun`,[`devicectl`,...e],n)},plist:n,macosHost:e.macosHost??u(t.runCommand,async e=>await n.readJson(e))}}function x(e){return y.resolve(e)}async function S(e,t){return await y.run(e,t)}function C(){return y.hasScope()}async function w(e,t,n){return await x().runCommand(e,t,n)}async function T(e,t){let n=x();if(e[0]===`simctl`)return await n.simctl.run(_(e),t);let[r,...i]=e;return r===`devicectl`?await n.devicectl.run(i,t):await w(`xcrun`,[...e],t)}async function E(e,t){return await x().plist?.readJson(e,t)??null}function D(e){return b({...e,runCommand:O(e.runCommand),simctl:{run:k(e.simctl.run)},devicectl:{run:k(e.devicectl.run)},...e.macosHelper?{macosHelper:{run:k(e.macosHelper.run)}}:{}})}function O(e){return async(t,n,r)=>i(await e(t,n,r))}function k(e){return async(t,n)=>i(await e(t,n))}async function A(e,t,n){try{let r=await e(`plutil`,[`-convert`,`json`,`-o`,`-`,t],{allowFailure:!0,signal:n});return r.exitCode!==0||!r.stdout.trim()?null:JSON.parse(r.stdout)}catch{return n?.throwIfAborted(),null}}export{w as a,S as c,x as i,l,C as n,T as o,E as r,h as s,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime.js";import{O as t}from"./sdk-contracts.js";import{r as n}from"./diagnostics.js";import{c as r}from"./owner-identity.js";import{c as i,h as a}from"./exec.js";import{t as o}from"./timeouts.js";import"./diagnostics2.js";import"./command.js";import"./retry.js";import"./process.js";import{t as s}from"./scoped-provider.js";var c=e({createLocalLinuxToolProvider:()=>d,resolveLinuxToolProvider:()=>f,runLinuxToolCommand:()=>m,withLinuxToolProvider:()=>p});const l={runCommand:i,whichCommand:a,desktop:h(i,a),clipboard:g(i,a),screenshot:_(i,a)},u=s(l,d);function d(e={}){let t={...l,...e};return{...t,desktop:e.desktop??h(t.runCommand,t.whichCommand),clipboard:e.clipboard??g(t.runCommand,t.whichCommand),screenshot:e.screenshot??_(t.runCommand,t.whichCommand)}}function f(e){return u.resolve(e)}async function p(e,t){return await u.run(e,t)}async function m(e,t,n){return await f().runCommand(e,t,n)}function h(e,t){return{async openTarget(r){if(r.includes(`://`)||r.startsWith(`/`)){await e(`xdg-open`,[r]);return}if(await t(r)){e(r,[],{allowFailure:!0}).catch(e=>{n({level:`warn`,phase:`linux_app_launch`,data:{app:r,error:String(e)}})}),await o(500);return}await e(`xdg-open`,[r],{allowFailure:!0})},async closeApp(n){if(await t(`wmctrl`)){await e(`wmctrl`,[`-c`,n],{allowFailure:!0});return}await e(`pkill`,[`-x`,n],{allowFailure:!0})}}}function g(e,t){return{async readText(){let n=await w(t,y),r=x[n];return(await e(r.cmd,r.args,r.options)).stdout},async writeText(n){let r=await w(t,y),i=S[r](n);await e(i.cmd,i.args,i.options)}}}function _(e,t){return{async capture(n){let r=await w(t,b),i=C[r](n);await e(i.cmd,i.args,i.options)}}}const v=5e3,y={wayland:[{tool:`wl-clipboard`,command:`wl-paste`}],x11:[{tool:`xclip`,command:`xclip`},{tool:`xsel`,command:`xsel`}],waylandError:`wl-paste (wl-clipboard) is required for clipboard access on Wayland. Install via your package manager.`,x11Error:`xclip or xsel is required for clipboard access on X11. Install via your package manager.`},b={wayland:[{tool:`grim`,command:`grim`},{tool:`gnome-screenshot`,command:`gnome-screenshot`}],x11:[{tool:`scrot`,command:`scrot`},{tool:`import`,command:`import`},{tool:`gnome-screenshot`,command:`gnome-screenshot`}],waylandError:`grim or gnome-screenshot is required for screenshots on Wayland. Install via your package manager.`,x11Error:`scrot, import (ImageMagick), or gnome-screenshot is required for screenshots on X11. Install via your package manager.`},x={"wl-clipboard":{cmd:`wl-paste`,args:[`--no-newline`],options:{allowFailure:!0,timeoutMs:v}},xclip:{cmd:`xclip`,args:[`-selection`,`clipboard`,`-o`],options:{allowFailure:!0,timeoutMs:v}},xsel:{cmd:`xsel`,args:[`--clipboard`,`--output`],options:{allowFailure:!0,timeoutMs:v}}},S={"wl-clipboard":e=>({cmd:`wl-copy`,args:[`--`,e],options:{allowFailure:!1,timeoutMs:v}}),xclip:e=>({cmd:`xclip`,args:[`-selection`,`clipboard`],options:{allowFailure:!1,timeoutMs:v,stdin:e}}),xsel:e=>({cmd:`xsel`,args:[`--clipboard`,`--input`],options:{allowFailure:!1,timeoutMs:v,stdin:e}})},C={grim:e=>({cmd:`grim`,args:[e]}),scrot:e=>({cmd:`scrot`,args:[e]}),import:e=>({cmd:`import`,args:[`-window`,`root`,e]}),"gnome-screenshot":e=>({cmd:`gnome-screenshot`,args:[`-f`,e]})};async function w(e,n){let r=T()?`wayland`:`x11`;for(let t of n[r])if(await e(t.command))return t.tool;throw new t(`TOOL_MISSING`,r===`wayland`?n.waylandError:n.x11Error)}function T(){let e=r();return!!e.WAYLAND_DISPLAY||e.XDG_SESSION_TYPE===`wayland`}export{m as n,c as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{n as t,r as n}from"./interactor-operation-binding.js";function r(e){let t=t=>t??e.unsupported;return Object.freeze({tapPoint:e.tap,tapRef:t(e.tapRef),longPressPoint:e.longPress,hoverPoint:i(t(e.hover)),hoverRef:i(t(e.hoverRef)),fillPoint:e.fill,fillRef:t(e.fillRef),tapElementSelector:t(e.tapElementSelector)})}function i(e){return e.available?e:Object.freeze({...e,hint:e.hint??`hover raises pointer hover state and is available on web targets only. On touch platforms use longpress for hold gestures.`})}function a(e,t){return{...e.execution,appBundleId:e.appBundleId,signal:t}}function o(t,n,r,i){let o=async e=>(t.throwIfAborted(),await n(a(e,t))),l=async e=>{t.throwIfAborted(),c(e.options,r.longPressPoint);let n=await o(e);return e.options.button!==`primary`&&n.alternateClick?await n.alternateClick(e.point,e.options.button):n.pressPoint?await n.pressPoint(e.point,e.options):await u(n,e.point,e.options,i)},d=async t=>{let n=await o(t);if(!n.hover)throw new e(`UNSUPPORTED_OPERATION`,`Bound runtime advertised hover without an interactor.`);return await n.hover(t.point.x,t.point.y)},f=async e=>await(await o(e)).fill(e.point.x,e.point.y,e.text,e.delayMs,{allowNonHittableCoordinateFallback:e.allowNonHittableCoordinateFallback});return Object.freeze({...r.tapPoint.available?{tapPoint:l}:{},...r.tapRef.available?{tapRef:async e=>{let t=await o(e);return t.tapRef?await t.tapRef(e.ref):s(`tapRef`)}}:{},...r.longPressPoint.available?{longPressPoint:async e=>await(await o(e)).longPress(e.point.x,e.point.y,e.durationMs)}:{},...r.hoverPoint.available?{hoverPoint:d}:{},...r.hoverRef.available?{hoverRef:async e=>{let t=await o(e);return t.hoverRef?await t.hoverRef(e.ref):s(`hoverRef`)}}:{},...r.fillPoint.available?{fillPoint:f}:{},...r.fillRef.available?{fillRef:async e=>{let t=await o(e);return t.fillRef?await t.fillRef(e.ref,e.text,e.delayMs):s(`fillRef`)}}:{},...r.tapElementSelector.available?{tapElementSelector:async e=>{let t=await o(e);return t.tapElementSelector?await t.tapElementSelector(e.selector):s(`tapElementSelector`)}}:{}})}function s(t){throw new e(`UNSUPPORTED_OPERATION`,`Bound runtime advertised ${t} without an interactor.`)}function c(t,n){if(!(t.holdMs<=0||n.available))throw new e(`UNSUPPORTED_OPERATION`,`press-and-hold is not supported by this runtime.`,{reason:n.reason,...n.hint===void 0?{}:{hint:n.hint}})}function l(t){if(t.doubleTap)return t.doubleTap;throw new e(`UNSUPPORTED_OPERATION`,`double-tap is not supported by this runtime.`,{reason:`owner-capability-missing`,hint:`This runtime drives single presses; use --count to repeat them.`})}async function u(t,n,r,i){if(r.button!==`primary`)throw new e(`UNSUPPORTED_OPERATION`,`Bound runtime does not implement ${r.button} click.`);let a=r.doubleTap?l(t):void 0,o;for(let e=0;e<r.count;e+=1){let[s,c]=f(e,r.jitterPx),l=a?await a.call(t,n.x+s,n.y+c):r.holdMs>0?await t.longPress(n.x+s,n.y+c,r.holdMs):await t.tap(n.x+s,n.y+c);o??=l,e<r.count-1&&r.intervalMs>0&&await i(r.intervalMs)}return o}const d=[[0,0],[1,0],[0,1],[-1,0],[0,-1],[1,1],[-1,1],[1,-1],[-1,-1]];function f(e,t){if(t<=0)return[0,0];let[n,r]=d[e%d.length];return[n*t,r*t]}function p(e){return o(e.signal,t(e),e.facts,e.pause)}function m(e){return o(e.signal,n({...e,operation:`touch`}),e.facts,e.pause)}export{r as i,m as n,f as r,p as t};
|
package/dist/src/transport.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import t from"node:crypto";const n=`/agent-device`,r=`x-agent-device-tenant`,i=`x-agent-device-network-access`,a=`public-only`;function o(e){return s(e,n)}function s(e,t){let n=e.endsWith(`/`)?e:`${e}/`;return new URL(t.replace(/^\/+/,``),n).toString()}function c(e){let t=e?.trim();return t?{authorization:`Bearer ${t}`,"x-agent-device-token":t}:{}}function l(e){let t=e?.trim();return t?{[r]:t}:{}}function u(e,t,n={}){return{ok:!0,service:e,version:t,rpcProtocolVersion:2,...n.upstream===void 0?{}:{upstream:n.upstream}}}function d(e,t){let n=[],r=e+t.toString(),i=r.indexOf(`
|
|
2
2
|
`);for(;i!==-1;){let e=r.slice(0,i).trim();r=r.slice(i+1),e&&n.push(e),i=r.indexOf(`
|
|
3
3
|
`)}return{lines:n,buffer:r}}async function f(e){return e===`https:`?(await import(`node:https`)).default:(await import(`node:http`)).default}function p(e){return new Promise((t,n)=>{let r=``;e.setEncoding(`utf8`),e.on(`data`,e=>{r+=e}),e.on(`end`,()=>t(r)),e.on(`error`,n)})}async function m(t,n,r){let i=[],a=0;for await(let o of t){let t=Buffer.isBuffer(o)?o:Buffer.from(o);if(a+=t.length,a>n)throw new e(`INVALID_ARGS`,r);i.push(t)}return Buffer.concat(i)}function h(e,n){let r=t.createHash(`sha256`).update(e).digest(),i=t.createHash(`sha256`).update(n).digest();return t.timingSafeEqual(r,i)}export{h as a,a as c,c as d,o as f,p as i,r as l,s as m,f as n,n as o,l as p,m as r,i as s,d as t,u};
|
package/dist/src/tv-remote.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";const t={android:`longpress`,apple:`exact`,vega:`exact`},n={up:{aliases:[],androidKeyevent:`KEYCODE_DPAD_UP`,appleRemoteButton:`up`,vegaKey:`KEY_UP`},down:{aliases:[],androidKeyevent:`KEYCODE_DPAD_DOWN`,appleRemoteButton:`down`,vegaKey:`KEY_DOWN`},left:{aliases:[],androidKeyevent:`KEYCODE_DPAD_LEFT`,appleRemoteButton:`left`,vegaKey:`KEY_LEFT`},right:{aliases:[],androidKeyevent:`KEYCODE_DPAD_RIGHT`,appleRemoteButton:`right`,vegaKey:`KEY_RIGHT`},select:{aliases:[`ok`,`center`,`enter`],androidKeyevent:`KEYCODE_DPAD_CENTER`,appleRemoteButton:`select`,vegaKey:`KEY_ENTER`},menu:{aliases:[],androidKeyevent:`KEYCODE_MENU`,appleRemoteButton:`menu`,vegaKey:`KEY_MENU`},home:{aliases:[],androidKeyevent:`KEYCODE_HOME`,appleRemoteButton:`home`,vegaKey:`KEY_HOMEPAGE`},back:{aliases:[],androidKeyevent:`KEYCODE_BACK`,appleRemoteButton:`menu`,vegaKey:`KEY_BACK`}},r=Object.keys(n),i=`<${r.join(`|`)}>`;function a(t){let n=t?.toLowerCase();if(o(n))return n;let i=n?d.get(n):void 0;if(i)return i;throw new e(`INVALID_ARGS`,`tv-remote button must be one of: ${r.join(`, `)}.`)}function o(e){return typeof e==`string`&&r.includes(e)}function s(e){return n[e].appleRemoteButton}function c(e){return n[e].androidKeyevent}function l(e){return n[e].vegaKey}function u(e){return t[e]}const d=new Map(r.flatMap(e=>n[e].aliases.map(t=>[t,e])));export{s as a,c as i,i as n,l as o,a as r,u as s,r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{Kt as t}from"./sdk-batch.js";import{g as n,m as r}from"./session-snapshot.js";import{x as i}from"./runtime.js";import{r as a}from"./success-text.js";function o(e){let t=e?.trim().split(/\s+/,1)[0];if(!t||!t.startsWith(`@`)||t.length<3)return null;let n=t.slice(1);return/^[A-Za-z_-]*\d[\w-]*$/i.test(n)||/^(?:ref|node|element|el)[\w-]*$/i.test(n)?t:null}async function s(e){let r=await n({command:`type`,device:e.device,use:t,inspectFacts:e.inspectFacts,bindDevice:e.bindDevice});if(r.type===`response`)return{ok:!1,response:r.response};let i=r.runtime;return{ok:!0,typeText:async(e,t)=>await c(i,e,t)}}async function c(t,n,r){let s=o(n[0]);if(s)throw new e(`INVALID_ARGS`,`type does not accept a target ref like "${s}"`,{hint:`Use fill ${s} "text" to target that field, or press ${s} then type "text" to append.`});let c=n.join(` `);if(!c)throw new e(`INVALID_ARGS`,`type requires text`);let u=i(r.delayMs??0,`delay-ms`,0,1e4),d=(await t.operations.typeText(l(c,u,r)))?.textEntryRoute;return{...d===void 0?{}:{textEntryRoute:d},text:c,delayMs:u,...a(`Typed ${Array.from(c).length} chars`)}}function l(e,t,n){return{text:e,delayMs:t,...n.appBundleId===void 0?{}:{options:{appBundleId:n.appBundleId}},execution:r(n)}}export{s as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import t from"node:fs";const n=`agent-device only reads and writes regular files at this path. Remove the symbolic link or special file there and retry.`,r=`Another process replaced the file at this path while it was being opened. Stop the concurrent writer, then retry.`;function i(e){return s(e,t.constants.O_RDONLY,!1)}function a(e){return s(e,t.constants.O_WRONLY|t.constants.O_APPEND,!0)}function o(e){let n=s(e,t.constants.O_RDWR,!0);try{return t.ftruncateSync(n,0),n}catch(e){throw t.closeSync(n),e}}function s(t,n,i){for(let e=0;e<2;e+=1){let e=c(t,n,i);if(e.status!==`retry`)return e.status===`missing`?void 0:e.descriptor}throw new e(`COMMAND_FAILED`,`Final file could not be opened without an identity race: ${t}`,{hint:r})}function c(e,n,r){let i=p(e);if(!i&&!r)return{status:`missing`};let a=l(e,n,i===void 0,r);if(typeof a!=`number`)return a;try{return d(e,a,i),{status:`opened`,descriptor:a}}catch(e){throw t.closeSync(a),e}}function l(e,n,r,i){try{return t.openSync(e,n|g()|(r?t.constants.O_CREAT|t.constants.O_EXCL:0),384)}catch(e){let t=e.code,n=u(t,r,i);if(n)return n;throw e}}function u(e,t,n){if(e===`EEXIST`)return t?{status:`retry`}:void 0;if(e===`ENOENT`&&!t)return{status:n?`retry`:`missing`}}function d(e,n,r){let i=t.fstatSync(n),a=p(e);if(!i.isFile()||!a||!h(i,a)||r&&!h(r,i))throw f(e)}function f(t){return new e(`COMMAND_FAILED`,`Final file identity changed while it was opened: ${t}`,{hint:r})}function p(t){let r=m(t);if(r&&!r.isFile())throw new e(`COMMAND_FAILED`,`Final path must be a regular file: ${t}`,{hint:n});return r}function m(e){try{return t.lstatSync(e)}catch(e){if(e.code===`ENOENT`)return;throw e}}function h(e,t){return e.dev===t.dev&&e.ino===t.ino}function g(){let e=t.constants.O_NOFOLLOW;return Number.isInteger(e)&&e>0?e:0}export{o as a,i,m as n,a as r,n as t};
|
package/dist/src/video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{or as t}from"./sdk-batch.js";import{x as n}from"./owner-identity.js";import{c as r}from"./exec.js";import{t as i}from"./timeouts.js";import{n as a,t as o}from"./file.js";import"./command.js";import"./retry.js";import"./process.js";import s from"node:path";import c from"node:fs";import{createHash as l}from"node:crypto";import u from"node:os";import{fileURLToPath as d}from"node:url";const f=`apple/runner/AgentDeviceRunner/RecordingScripts`;function p(e,t,n,r){let i=`${f}/${e}`,a=`dist/${i}`;return[s.resolve(t,e),s.resolve(n,i),s.resolve(t,`../${i}`),s.resolve(t,`../../${i}`),s.resolve(t,`../../../${i}`),s.resolve(n,a),s.resolve(r,i)]}function m(t,n,r=s.dirname(d(import.meta.url)),i=process.cwd()){let a=p(t,r,n,i);for(let e of a)if(c.existsSync(e))return e;throw new e(`COMMAND_FAILED`,`Missing recording helper script: ${t}`,{hint:`Ensure ${f} is present in this checkout or bundled under dist/${f} in the package.`,scriptName:t,searchedPaths:a})}function h(e=process.env){let t=v(),n=s.join(t,`home`),r=s.join(t,`module-cache`);return c.mkdirSync(n,{recursive:!0}),c.mkdirSync(r,{recursive:!0}),{...e,HOME:n,CLANG_MODULE_CACHE_PATH:r}}async function g(e){let t=[e.sourcePath,...e.extraSourcePaths??[]],n=t.map(e=>({sourcePath:e,stat:c.statSync(e),source:c.readFileSync(e)})),r=S(e.cacheName??s.basename(e.sourcePath,s.extname(e.sourcePath))),i=C([`2`,process.platform,process.arch,...n.flatMap(({sourcePath:e,stat:t,source:n})=>[s.resolve(e),t.size,n])]),a=s.join(v(),`bin`,`${r}-${i}`);return await y({sourcePaths:t,executablePath:a,timeoutMs:e.timeoutMs}),a}async function _(e){let t=S(e.cacheName),n=C([`2`,process.platform,process.arch,e.source]),r=s.join(v(),`sources`,`${t}-${n}.swift`),i=s.join(v(),`bin`,`${t}-${n}`);return await y({sourcePaths:[r],executablePath:i,sourceText:e.source,timeoutMs:e.timeoutMs}),i}function v(){let e=process.env.AGENT_DEVICE_SWIFT_CACHE_DIR?.trim();return e?s.resolve(e):s.join(u.tmpdir(),`agent-device-swift-cache`)}async function y(e){if(x(e.executablePath))return;let t=s.dirname(e.executablePath);c.mkdirSync(t,{recursive:!0});let n=e.timeoutMs??12e4;await a({acquire:()=>b(`${e.executablePath}.lock`,n),task:async()=>{if(x(e.executablePath))return;let i=c.mkdtempSync(s.join(t,`.${s.basename(e.executablePath)}.${process.pid}.`)),a=s.join(i,s.basename(e.executablePath));try{let[t]=e.sourcePaths;e.sourceText!==void 0&&t&&!c.existsSync(t)&&(c.mkdirSync(s.dirname(t),{recursive:!0}),c.writeFileSync(t,e.sourceText)),await r(`xcrun`,[`swiftc`,...e.sourcePaths,`-o`,a],{timeoutMs:n,env:h()}),c.renameSync(a,e.executablePath)}finally{c.rmSync(i,{recursive:!0,force:!0})}}})}async function b(t,r){try{return await o({lockDirPath:t,owner:{pid:process.pid,startTime:n(process.pid),acquiredAtMs:Date.now()},timeoutMs:r,pollMs:25,ownerGraceMs:r,description:`Swift cache lock: ${t} (${r}ms)`})}catch(n){throw n instanceof e&&n.message.startsWith(`Timed out waiting for Swift cache lock:`)?new e(`COMMAND_FAILED`,n.message,{...n.details,lockDir:t,timeoutMs:r,hint:`Another agent-device process may still be compiling this Swift helper. Retry shortly; if no agent-device process is active, remove "${t}" and retry.`}):n}}function x(e){try{return c.accessSync(e,c.constants.X_OK),c.statSync(e).isFile()}catch{return!1}}function S(e){return t(e.replaceAll(/[^A-Za-z0-9._-]/g,`-`))||`swift-helper`}function C(e){let t=l(`sha256`);for(let n of e)t.update(Buffer.isBuffer(n)?n:String(n)),t.update(`\0`);return t.digest(`hex`).slice(0,16)}const w={block:161,blockGroup:160,cluster:524531317,codecId:134,documentType:17026,ebml:440786851,segment:408125543,simpleBlock:163,trackEntry:174,trackNumber:215,tracks:374648427,trackType:131};function T(e){let t=E(e);if(!t)return!1;let{bytes:n,fileSize:r}=t,i=L(n,0,n.length,r);if(!i||i.id!==w.ebml||!i.complete||i.unknownSize||!D(n,i))return!1;let a=L(n,i.nextOffset,n.length,r);return!a||a.id!==w.segment||!V(a,r)?!1:O(n,a,r)}function E(e){try{let t=c.openSync(e,`r`);try{let e=c.fstatSync(t).size;if(e<=0)return;let n=Buffer.alloc(Math.min(e,1048576));return c.readSync(t,n,0,n.length,0)===n.length?{bytes:n,fileSize:e}:void 0}finally{c.closeSync(t)}}catch{return}}function D(e,t){let n=I(e,t)?.find(e=>e.id===w.documentType);return n!==void 0&&e.toString(`ascii`,n.dataStart,n.dataEnd)===`webm`}function O(e,t,n){let r=new Set,i=new Set;for(let a=t.dataStart;a<t.dataEnd;){let o=L(e,a,t.dataEnd,n);if(!o||!V(o,n))return!1;if(o.id===w.tracks&&k(e,o,r),o.id===w.cluster&&j(e,o,n,i),H(r,i))return!0;if(!o.complete||o.unknownSize)return!1;a=o.nextOffset}return!1}function k(e,t,n){let r=I(e,t);if(r){for(let t of r)if(t.id===w.trackEntry){let r=A(e,t);r!==void 0&&n.add(r)}}}function A(e,t){let n=I(e,t),r=F(e,n,w.trackNumber),i=F(e,n,w.trackType),a=n?.find(e=>e.id===w.codecId),o=a?e.toString(`ascii`,a.dataStart,a.dataEnd):void 0;return i===1&&o?.startsWith(`V_`)?r:void 0}function j(e,t,n,r){for(let i=t.dataStart;i<t.dataEnd;){let a=L(e,i,t.dataEnd,n);if(!a||!V(a,n)||(a.id===w.simpleBlock&&N(e,a,r),a.id===w.blockGroup&&M(e,a,r),!a.complete||a.unknownSize))return;i=a.nextOffset}}function M(e,t,n){let r=I(e,t)?.find(e=>e.id===w.block);r&&N(e,r,n)}function N(e,t,n){if(!t.complete||t.unknownSize)return;let r=z(e,t.dataStart);!r||r.unknown||t.dataEnd-t.dataStart<r.length+4||n.add(r.value)}function P(e,t){let n=t.dataEnd-t.dataStart;if(n<1||n>6)return;let r=0;for(let n=t.dataStart;n<t.dataEnd;n+=1)r=r*256+e[n];return Number.isSafeInteger(r)?r:void 0}function F(e,t,n){let r=t?.find(e=>e.id===n);return r?P(e,r):void 0}function I(e,t){if(!t.complete||t.unknownSize)return;let n=[];for(let r=t.dataStart;r<t.dataEnd;){let i=L(e,r,t.dataEnd,e.length);if(!i||!i.complete||i.unknownSize)return;n.push(i),r=i.nextOffset}return n}function L(e,t,n,r){let i=R(e,t);if(!i)return;let a=z(e,t+i.length);if(!a)return;let o=t+i.length+a.length;if(o>n)return;let s=a.unknown?r:o+a.value;if(!(!Number.isSafeInteger(s)||s<o))return{id:i.value,dataStart:o,dataEnd:Math.min(s,n),nextOffset:s,complete:s<=n,unknownSize:a.unknown}}function R(e,t){let n=B(e,t,4);if(!n)return;let r=0;for(let i=0;i<n;i+=1)r=r*256+e[t+i];return{length:n,value:r}}function z(e,t){let n=B(e,t,8);if(!n)return;let r=e[t],i=128>>n-1;if((r&i-1)==i-1&&e.subarray(t+1,t+n).every(e=>e===255))return{length:n,value:0,unknown:!0};let a=r&i-1;for(let r=1;r<n;r+=1)a=a*256+e[t+r];return Number.isSafeInteger(a)?{length:n,value:a,unknown:!1}:void 0}function B(e,t,n){let r=e[t];if(r===void 0||r===0)return;let i=128,a=1;for(;(r&i)===0;)i>>=1,a+=1;return a<=n&&t+a<=e.length?a:void 0}function V(e,t){return e.unknownSize||e.nextOffset<=t}function H(e,t){for(let n of e)if(t.has(n))return!0;return!1}let U;async function W(e,t={}){let n=t.pollMs??150,r=t.attempts??12,a,o=0;for(let t=0;t<r;t+=1){let t=0;try{t=c.statSync(e).size}catch{t=0}if(t>0&&t===a){if(o+=1,o>=2)return}else o=0;a=t,await i(n)}}async function G(e){let t=await Z(e);if(!t)return!1;if(t===`webm`)return!0;try{let t=await K(),n=await r(t,[e],{allowFailure:!0,timeoutMs:1e4,env:h()});return n.exitCode===0||Y(n.stderr,n.stdout)}catch(e){if(q(e))return!0;throw e}}async function K(){U??=_({source:`import Foundation
|
|
2
2
|
import AVFoundation
|
|
3
3
|
|
|
4
4
|
let url = URL(fileURLWithPath: CommandLine.arguments[1])
|
package/dist/src/viewport.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";function t(t,n){let r=t===void 0?NaN:Number(t);if(!Number.isInteger(r)||r<1)throw new e(`INVALID_ARGS`,`viewport ${n} must be a positive integer`);return r}function n(n){if(n.length!==2)throw new e(`INVALID_ARGS`,`viewport requires exactly two arguments: <width> <height>`);return{width:t(n[0],`width`),height:t(n[1],`height`)}}export{n as t};
|
package/dist/src/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{printJson as t}from"./json.js";function n(){return Object.freeze({setup:async e=>{let{setupManagedAgentBrowser:t}=await import(`./src6.js`).then(e=>e.i);return await t(e)},doctor:async e=>{let{doctorManagedAgentBrowser:t}=await import(`./src6.js`).then(e=>e.i);return await t(e)}})}const r=n();async function i(t,n){switch(t[0]){case`setup`:{a(n.flags.json);let e=await r.setup({stateDir:n.stateDir});return o(n.flags.json,e),0}case`doctor`:{let e=await r.doctor({stateDir:n.stateDir});return s(n.flags.json,e.exitCode===0?`Web backend is healthy.`:`Web backend doctor reported issues.`,e),e.exitCode}default:throw new e(`INVALID_ARGS`,`web requires setup or doctor`)}}function a(e){e||process.stdout.write(`Setting up managed agent-browser backend (downloads if needed)...
|
|
2
2
|
`)}function o(e,n){if(e){t({success:!0,data:{status:c(n)}});return}process.stdout.write(`Managed web backend installed.\nagent-browser available at: ${n.binaryPath}\n`)}function s(e,n,r){if(e){t({success:!0,data:l(r)});return}process.stdout.write(`${n}\n`)}function c(e){let{socketDir:t,...n}=e;return n}function l(e){let t=e.status;return u(t)?{...e,status:c(t)}:e}function u(e){return typeof e==`object`&&!!e&&`socketDir`in e&&`installDir`in e&&`binaryPath`in e}export{i as runWebCommand};
|
package/dist/src/web2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./sdk-contracts.js";import{r as t}from"./interaction-positionals.js";import{c as n}from"./diagnostics.js";import"./diagnostics2.js";import{n as r}from"./src6.js";function i(t){let n=async n=>{throw new e(`UNSUPPORTED_OPERATION`,`${n} is not supported on ${t}`)};return{open:()=>n(`open`),openDevice:()=>n(`openDevice`),close:()=>n(`close`),tap:()=>n(`tap`),longPress:()=>n(`longPress`),focus:()=>n(`focus`),type:()=>n(`type`),fill:()=>n(`fill`),scroll:()=>n(`scroll`),screenshot:()=>n(`screenshot`),snapshot:()=>n(`snapshot`),back:()=>n(`back`),setOrientation:()=>n(`setOrientation`),setSetting:()=>n(`setSetting`)}}async function a(a){let o=a??await r(),s=o.clickRef,c=o.hover,l=o.hoverRef,u=o.fillRef;return{...i(`web`),open:(e,t)=>o.open(t?.url??e,{url:t?.url}),openDevice:()=>o.open(`about:blank`),close:e=>o.close(e),tap:(e,t)=>o.click(e,t),...s?{tapRef:async e=>(await s(e),{ref:t(e)})}:{},...c?{hover:async(e,t)=>await c(e,t)}:{},...l?{hoverRef:async e=>(await l(e),{ref:t(e)})}:{},focus:(e,t)=>o.click(e,t),type:(e,t)=>o.typeText(e,{delayMs:t}),fill:(e,t,n,r)=>o.fill(e,t,n,{delayMs:r}),...u?{fillRef:async(e,n,r)=>(await u(e,n,{delayMs:r}),{ref:t(e),text:n,delayMs:r??0})}:{},scroll:(e,t)=>o.scroll(e,t),screenshot:(e,t)=>o.screenshot(e,t),setViewport:(e,t)=>o.setViewport(e,t),snapshot:async e=>{let t=await n(`snapshot_capture`,async()=>await o.snapshot(e),{backend:`web`});return{nodes:t.nodes,truncated:t.truncated??!1,backend:`web`,producer:`agent-browser`}},setOrientation:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`orientation is not supported on web`)}}}export{a as createWebInteractor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime.js";import{O as t}from"./sdk-contracts.js";import{t as n}from"./bounds.js";import{t as r}from"./parser.js";var i=e({parseWebDriverSourceFacts:()=>p});function a(e){try{return r(e)}catch(e){throw new t(`COMMAND_FAILED`,`Failed to parse WebDriver page source XML: ${e instanceof Error?e.message:String(e)}`,void 0,e)}}function o(e){let t=n(e.bounds??null);if(t)return t;let r=d(e.x),i=d(e.y),a=d(e.width),o=d(e.height);if(r!==void 0&&i!==void 0&&a!==void 0&&o!==void 0)return{x:r,y:i,width:a,height:o}}function s(e,t){for(let n of t){let t=c(e[n]);if(t!==void 0)return t}}function c(e){return e||void 0}function l(e,t){return e===void 0?t:e===`true`||e===`1`?!0:e===`false`||e===`0`?!1:t===void 0&&void 0}function u(e){return!!(e&&e.width>0&&e.height>0)}function d(e){if(e===void 0||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function f(e,t){return c(t.class)??c(e.replace(/^XCUIElementType/,``).toLowerCase())}function p(e,t=`ios`){let n=a(e),r=[],i=[];for(let e of n)m(r,e,void 0,0,i,t);return{nodes:r,roots:i}}function m(e,t,n,r,i,a){let o=h(t,a)?n:g(e,t,n,r,i,a),s=o===n?r:r+1;for(let n of t.children)m(e,n,o,s,i,a)}function h(e,t){if(Object.keys(e.attributes).length===0)return!0;let n=e.name.toLowerCase();return t===`ios`&&(n===`hierarchy`||n===`appiumaut`)}function g(e,t,n,r,i,a){let s=e.length,c=o(t.attributes);return e.push(_(s,t.name,t.attributes,n,r,c,a)),n===void 0&&i.push({type:t.name,...c?{rect:c}:{},rectStatus:x(t.attributes,c)}),s}function _(e,t,n,r,i,a,o){return{index:e,type:t,role:f(t,n),label:s(n,[`content-desc`,`label`,`text`,`name`]),value:c(n.value),identifier:s(n,[`resource-id`,`id`,`accessibility-id`,`name`]),rect:a,...v(n,a,o),depth:i,parentIndex:r}}function v(e,t,n){let r=n===`android`||void 0,i=l(e.enabled,r),a=l(e.displayed??e.visible,r);return n===`android`?{enabled:i,selected:l(e.selected,!1),focused:l(e.focused,!1),visibleToUser:a,hittable:a===!0&&i===!0&&u(t)}:{...y(`enabled`,i),...y(`selected`,l(e.selected)),...y(`focused`,l(e.focused)),...y(`visibleToUser`,a),...b(e.hittable)}}function y(e,t){return t===void 0?{}:{[e]:t}}function b(e){let t=l(e);return t===void 0?{}:{hittable:t}}function x(e,t){let n=e.bounds!==void 0,r=[`x`,`y`,`width`,`height`].every(t=>e[t]!==void 0);return!n&&!r?`not-provided`:u(t)?`reported`:`invalid`}export{i as n,p as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-device",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.14",
|
|
4
4
|
"description": "Mobile app automation and verification for AI coding agents. CLI, MCP server, and typed Node.js API for iOS, Android, HarmonyOS, TV, web, macOS, and Linux.",
|
|
5
5
|
"mcpName": "io.github.callstack/agent-device",
|
|
6
6
|
"license": "MIT",
|
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/callstack/agent-device",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.21.
|
|
10
|
+
"version": "0.21.14",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "agent-device",
|
|
15
|
-
"version": "0.21.
|
|
15
|
+
"version": "0.21.14",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8388dc7a3c3f18aca7322cc50bc4f3ff769d426733746a764f45b56d50a0f267 agent-device-android-ime-helper-0.21.13.apk
|
|
Binary file
|
package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.13.apk.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e07b556384093a04be99af068b6493e0b0a66e7e7cf09264da4fe60f75f2d164 agent-device-android-snapshot-helper-0.21.13.apk
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./tool-provider.js";function t(e){let{waitMs:t,signal:n,stop:r,cancelled:i}=e;return new Promise((e,a)=>{let o=()=>l(()=>a(i())),s=()=>l(e),c=setTimeout(()=>l(e),t);function l(e){clearTimeout(c),n?.removeEventListener(`abort`,o),r?.removeEventListener(`abort`,s),e()}n?.addEventListener(`abort`,o,{once:!0}),r?.addEventListener(`abort`,s,{once:!0}),n?.aborted?o():r?.aborted&&s()})}function n(e){let t=e.now??Date.now,n=e.waitGrant??`every-caller`,r=new Map,i=(n,i)=>{let a={status:`pending`,value:void 0,error:void 0,settledAtMs:t(),waitSpent:!1,controller:new AbortController,settled:void 0},o=()=>{};a.settled=new Promise(e=>{o=e}),r.set(n,a);let s=(i,s)=>{a.status=i,i===`ready`?a.value=s:a.error=s,a.settledAtMs=t(),(i===`ready`||e.retryAfterMs===void 0)&&r.get(n)===a&&r.delete(n),o()};try{i(a.controller.signal).then(e=>s(`ready`,e),e=>s(`failed`,e))}catch(e){s(`failed`,e)}return a},a=(n,a)=>{let o=r.get(n);if(!o)return i(n,a);if(o.status!==`failed`)return o;let s=t()-o.settledAtMs;return e.retryAfterMs===void 0||s>=e.retryAfterMs?i(n,a):o};return{value:async(t,r)=>{let i=a(t,r.start);if(i.status===`pending`&&(n===`every-caller`||!i.waitSpent)){i.waitSpent=!0;let t=new AbortController,n=r.wait(e.waitMs,t.signal);n.catch(()=>{});try{await Promise.race([i.settled,n])}finally{t.abort()}}if(i.status===`ready`)return i.value;throw i.status===`failed`?i.error:r.pending()},close:()=>{let e=[...r.values()];r.clear();for(let t of e)t.controller.abort()}}}async function r(t,n){let r=await e(`ps`,[`-p`,String(t),`-o`,`lstart=`],{allowFailure:!0,signal:n.signal,timeoutMs:n.timeoutMs});return r.exitCode===0&&r.stdout.trim()||null}export{n,t as r,r as t};
|