agent-device 0.21.16 → 0.21.17
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.16.apk → agent-device-android-ime-helper-0.21.17.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.17.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.16.manifest.json → agent-device-android-ime-helper-0.21.17.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.16.apk → agent-device-android-snapshot-helper-0.21.17.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.17.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.16.manifest.json → agent-device-android-snapshot-helper-0.21.17.manifest.json} +6 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +31 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +9 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +40 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +4 -0
- 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-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/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/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 -0
- package/dist/src/capture.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +6 -5
- package/dist/src/cli-runner.js +1 -1
- 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-types.d.ts +5 -5
- package/dist/src/clipboard-shell-response.js +1 -1
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/command-tools.js +3 -3
- 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-lease-beat.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon-client-transport.js +1 -1
- package/dist/src/daemon-policy-file.js +1 -0
- package/dist/src/daemon-process.js +1 -1
- package/dist/src/daemon-registration.js +1 -1
- package/dist/src/daemon-shutdown-report.js +1 -1
- package/dist/src/daemon.js +1 -1
- 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 -2
- package/dist/src/device-inventory-context.js +1 -1
- package/dist/src/{stop-sequence.js → device-readiness-runtime.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 -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/doctor-facade.js +1 -1
- package/dist/src/doctor2.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/exec.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/format.js +1 -2
- 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/helper.js +2 -2
- 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 +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 +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 +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/legacy-xctest-device-set.js +1 -0
- package/dist/src/limrun-download-file.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +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 +10 -10
- package/dist/src/multitouch-support.js +1 -1
- package/dist/src/observation.js +1 -1
- package/dist/src/overlay.js +3 -3
- package/dist/src/owner-identity.js +3 -3
- 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 +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-app-log-process.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-unavailable.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/process.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 +2 -2
- 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 +36 -36
- 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/result-serialization.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-metadata.js +3 -3
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-command-traits.js +1 -0
- 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 -0
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-owner-facade.js +1 -1
- package/dist/src/runner-session-types.js +1 -0
- package/dist/src/runner-start-budget.js +1 -0
- package/dist/src/runner-startup-transport.js +1 -0
- package/dist/src/runner-xctestrun.js +1 -0
- package/dist/src/runner.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-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.d.ts +4 -1
- package/dist/src/scroll-command.js +1 -1
- package/dist/src/scroll-gesture.js +1 -1
- package/dist/src/sdk-batch-runner.js +1 -1
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +10 -0
- 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/selection.js +0 -0
- 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 +1 -1
- package/dist/src/session2.js +5 -4
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-boot.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/target-evidence.js +1 -0
- 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/touch-runtime.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/vars.js +2 -0
- 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.16.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.16.apk.sha256 +0 -1
- package/dist/src/capture-disclosure.js +0 -1
- package/dist/src/fold-runtime.js +0 -1
- package/dist/src/native-build-cache.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{U 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{N 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,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e,P as t}from"./sdk-contracts.js";import{n}from"./device-shell.js";import{a as r,r as i}from"./adb-failure.js";import a from"node:path";function o(e){return e.startsWith(`emulator-`)}function s(e){return e.toLowerCase().replaceAll(`_`,` `).replaceAll(/\s+/g,` `).trim()}function c(e){let t=[];for(let n of e.split(`
|
|
2
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 l(e){return e.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0)}function u(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(`
|
package/dist/src/inventory2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";import{k 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);return{platform:`apple`,id:t,name:n,kind:`device`,target:r,appleOs:_(r,[x(e),...b(e)]),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]),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=[];for(let[r,i]of Object.entries(e.devices))if(p(r))for(let e of i){if(!e.isAvailable)continue;let i=f(r);n.push({platform:`apple`,id:e.udid,name:e.name,kind:`simulator`,target:i,appleOs:_(i,[r,e.deviceTypeIdentifier??``,e.name]),booted:e.state===`Booted`,...t?{simulatorSetPath:t}:{}})}return n}async function P(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 F(e){return Object.freeze({discover:async(t,n)=>await I(e,t,n)})}async function I(n,r,i){if(L(r))return[B(n)];if(n.hostOs!==`darwin`)throw z(n.hostOs);if(!await n.appleTools.isXcrunAvailable(i.signal))throw new e(`TOOL_MISSING`,`xcrun not found in PATH`);let a=P(n,r,i);if(r.kind===`simulator`)return await a;if(r.iosSimulatorSetPath||r.udid){let e=await a,o=[...e,B(n)];if(r.iosSimulatorSetPath||e.some(e=>e.id===r.udid))return t(o);let s=await k(n,i);return t(V(o,s))}let[o,s]=await Promise.all([a,k(n,i)]),c=[...o,B(n)];return t(V(c,s))}function L(e){return e.platform===`macos`||e.platform===`apple`&&e.target===`desktop`}const R={darwin:`macOS`,linux:`Linux`,win32:`Windows`,other:`a non-macOS host`};function z(t){return new e(`UNSUPPORTED_PLATFORM`,`Apple tools are only available on macOS`,{supportedOn:`macOS`,hostOs:t,retriable:!1,hint:`This host runs ${R[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 B(e){return{platform:`apple`,id:`host-macos-local`,name:e.hostName,kind:`device`,target:`desktop`,appleOs:`macos`,booted:!0}}function V(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{F as createAppleInventorySource};
|
package/dist/src/inventory3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N 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{N 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";import{i as t,r as n}from"./ios-snapshot-planning.js";import{i as r,r as i,t as a}from"./ios-snapshot-engine.js";const o={"acquisition-depth":`iOS snapshot acquisition does not report hierarchy completeness; provider-side depth or child limits may omit nodes.`,hittability:`iOS snapshot acquisition does not provide hittability evidence; regular snapshots omit unverified hittability while raw snapshots preserve supplied facts.`,truncation:`iOS snapshot acquisition does not expose truncation metadata; tree completeness is not independently verified.`};function s(e,t){let r=n({raw:t?.raw,interactiveOnly:t?.interactiveOnly,depth:t?.depth,scope:t?.scope,customActions:t?.customActions,acquisitionIntent:e.acquisition.intent}),i=c(e,r);try{let t=a(i,r);return{backend:`xctest`,producer:e.acquisition.producer,nodes:[...t.payload.nodes],comparisonIdentity:t.comparisonIdentity,...e.acquisition.truncated===void 0?{}:{truncated:e.acquisition.truncated},...l(e.acquisition.residue)}}catch(e){u(e)}}function c(e,n){let r=t(n);return e.acquisition.intent===`full`?{stage:`acquired`,acquisition:{...e.acquisition,intent:`full`,hint:{...r,acquisitionIntent:`full`}}}:{stage:`acquired`,acquisition:{...e.acquisition,intent:`surface-observation`,hint:{...r,acquisitionIntent:`surface-observation`}}}}function l(e){let t=new Set(e.flatMap(e=>{if(e.kind===`missing-viewport`)return[`iOS snapshot acquisition did not provide a valid viewport (${e.reason}); retry with --raw to inspect the acquired tree, while regular presentation requires viewport evidence.`];if(e.kind!==`unavailable-fact`)return[];let t=o[e.fact];return t?[t]:[]}));return t.size===0?{}:{warnings:[...t]}}function u(t){if(!(t instanceof i))throw t;let n=r(t),a=t.reason===`missing-viewport`||t.reason===`invalid-viewport`?`Use snapshot --raw to inspect the acquired iOS tree; regular presentation requires valid viewport evidence.`:void 0;throw new e(`COMMAND_FAILED`,t.message,{...n,...a?{hint:a}:{}},t)}export{s as presentIosSnapshotAcquisition};
|
package/dist/src/lease.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as e,L as t,N as n}from"./sdk-contracts.js";import{f as r,i,s as a,u as o}from"./lease-scope.js";import{rn as s}from"./sdk-batch.js";import{n as c}from"./catalog.js";import{i as l,r as u}from"./request-cancel.js";import"./request.js";import{a as d,n as f}from"./provider-session-ownership.js";import{n as p,r as m}from"./lease-context.js";async function h(e){let{req:t,sessionName:n,sessionStore:i,leaseRegistry:d,providerRuntimeIds:f,providerRuntimeRequiredIds:h,leaseLifecycleProvider:y,cloudArtifactProvider:b}=e,w=p(t);switch(t.command){case c.artifacts:return{ok:!0,data:await C(t,m(t,i.get(n)),d,b)};case`lease_allocate`:{S(w.leaseProvider,f,h);let e=d.allocateLease(a(w));return await d.runDeviceMutation(e,async()=>{let n;try{n=await y?.allocate?.(e,{...x(t),signal:u(t.meta?.requestId),deadline:Date.now()+s}),k(d,e,n)}catch(t){throw d.releaseLease(g(e)),t}if(l(t.meta?.requestId))throw await v(e,y,d);return{ok:!0,data:{lease:e,...n?{provider:n}:{}}}})}case`lease_heartbeat`:{let e=d.heartbeatLease(o(w)),n=await y?.heartbeat?.(e,x(t));return{ok:!0,data:{lease:e,...n?{provider:n}:{}}}}case`lease_release`:{let e=r(w),n=d.getLease(e),i=await d.runDeviceMutation(n,async()=>await _(d,y,n,e,x(t)));return{ok:!0,data:{released:i.registryReleased,...i.provider?{provider:i.provider}:{}}}}default:return null}}function g(e){return r({leaseId:e.leaseId,tenantId:e.tenantId,runId:e.runId,leaseBackend:e.backend,leaseProvider:e.leaseProvider,deviceKey:e.deviceKey,clientId:e.clientId})}async function _(e,t,n,r,i){let a=n?await t?.release?.(n,i):void 0;return n&&k(e,n,a),{registryReleased:e.releaseLease(r).released,provider:a}}async function v(e,n,r){let i=g(e),a,o;try{a=await _(r,n,e,i)}catch(e){o=t(e),a={registryReleased:r.releaseLease(i).released}}return y(e,a,o)}function y(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:b(o,t.leaseId,i)})}function b(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 x(e){return{flags:e.flags,...typeof e.flags?.providerApp==`string`?{initialApp:e.flags.providerApp}:{},cwd:typeof e.meta?.cwd==`string`?e.meta.cwd:void 0,...e.internal?.publicNetworkOnly?{publicNetworkOnly:!0}:{}}}function S(e,t,r){if(!(!e||t===void 0||r===void 0||!r.includes(e)||t.includes(e)))throw new n(`UNSUPPORTED_OPERATION`,`Provider "${e}" is not available in this daemon runtime.`,{provider:e,hint:`Restart the daemon with ${e} configured, then retry lease allocation.`})}async function C(e,t,n,r){let i=O(e.flags,`providerSessionId`);return w(t,i)?await T(t.tenantId):await E(t,i,n,r)}function w(e,t){return i(e)||!e.leaseProvider&&!t}async function T(e){let t=await d(e);return{source:`daemon`,status:`ready`,artifacts:t,...t.length===0?{message:`No daemon artifacts available.`}:{}}}async function E(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=D(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 D(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 O(e,t){let n=e?.[t];return typeof n==`string`&&n.trim().length>0?n.trim():void 0}function k(e,t,n){let r=f(n);r&&e.recordProviderSession(t,r)}export{h as handleLeaseCommands};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"node:path";import t from"node:fs";import n from"node:os";function r(r,c=e.join(n.homedir(),`Library`,`Developer`,`XCTestDevices`)){let l=`${c}.agent-device-backup`;try{if(o(c)){let e=s(c);i(c),r({phase:`ios_runner_legacy_xctest_device_set_link_removed`,resourcePath:c,data:{linkTarget:e}})}t.existsSync(l)&&!t.existsSync(c)&&(a(l,c),r({phase:`ios_runner_legacy_xctest_device_set_backup_restored`,resourcePath:c,data:{backupPath:l}}))}catch(e){r({phase:`ios_runner_legacy_xctest_device_set_restore_failed`,resourcePath:c,data:{error:e instanceof Error?e.message:String(e)}})}}function i(e){try{t.unlinkSync(e)}catch(t){if(o(e))throw t}}function a(e,n){try{t.renameSync(e,n)}catch(r){if(t.existsSync(e)&&!t.existsSync(n))throw r}}function o(e){return t.lstatSync(e,{throwIfNoEntry:!1})?.isSymbolicLink()??!1}function s(e){try{return t.readlinkSync(e)}catch{return}}export{r as restoreLegacyXctestDeviceSetRedirect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";import t from"node:path";import n from"node:fs";import{Readable as r}from"node:stream";import{pipeline as i}from"node:stream/promises";async function a(a){let s=AbortSignal.timeout(a.timeoutMs);try{await n.promises.mkdir(t.dirname(a.destinationPath),{recursive:!0});let c=await fetch(a.url,{method:`GET`,headers:a.headers,signal:s});if(!c.ok)throw await o(c,a);if(!c.body)throw new e(`COMMAND_FAILED`,`Limrun download returned no body`,{url:a.url});await i(r.fromWeb(c.body),n.createWriteStream(a.destinationPath),{signal:s})}catch(e){throw await n.promises.rm(a.destinationPath,{force:!0}).catch(()=>{}),c(e,a,s)}}async function o(t,n){return new e(`COMMAND_FAILED`,`Limrun download failed with HTTP ${t.status}`,{url:n.url,statusCode:t.status,body:await s(t)})}async function s(e){if(!e.body)return``;let t=e.body.getReader(),n=[],r=0;try{for(;r<500;){let{done:e,value:i}=await t.read();if(e)break;let a=500-r;n.push(i.subarray(0,a)),r+=i.byteLength}}finally{t.cancel().catch(()=>{})}return Buffer.concat(n).toString(`utf8`)}function c(t,n,r){return r.aborted?new e(`COMMAND_FAILED`,`Limrun download timed out`,{url:n.url,timeoutMs:n.timeoutMs}):t instanceof e?t:new e(`COMMAND_FAILED`,`Limrun download failed`,{url:n.url,reason:t instanceof Error?t.message:String(t)})}export{a as downloadLimrunFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime.js";import{N as t}from"./sdk-contracts.js";import{c as n,n as r}from"./exec.js";import"./command.js";import{a as i}from"./version.js";import{_ as a}from"./adb-executor.js";import{i as o,o as s,r as c}from"./adb-transport.js";import"./mechanics.js";import"./platform-runtime-android-adb-host.js";import{n as l}from"./android.js";var u=e({createLimrunRuntimeDependencies:()=>d});function d(){return{clientVersion:i(),android:{createInteractor:(e,t)=>l(e,t),createPortReverse:async e=>{let{createAndroidPortReverseManager:t}=await import(`./mechanics.js`).then(e=>e.r);return t(e)},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-runtime.js`).then(e=>e.a),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)=>o(s(e),t),hostAdbInvocation:e=>o(c(),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:{runAdb:async(e,t)=>await a(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 n(`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(` `),...r(s)})}},ios:{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}}}}export{u as n,d as t};
|
package/dist/src/limrun.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as Rect, D as IosTargetActivation, F as SnapshotOptions$1, I as SnapshotProvenance, N as SnapshotKeyboardBandFact, O as Point, S as DeviceTarget, b as DeviceInfo, f as LeaseBackend, k as RawSnapshotNode, w as PlatformSelector, x as DeviceKind } from "./sdk-contracts.js";
|
|
2
2
|
import { s as AppsFilter, t as GesturePlan } from "./gesture-plan-types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { A as SessionSurface, E as BackendSnapshotResult, b as ScrollDirection, c as BackMode, h as SettingOptions, i as DeviceRotation, m as ReadableSetting, n as ScrollExecutionOptions, p as ReadSettingResult, r as TvRemoteButton, v as CloudArtifactProvider } from "./scroll-command.js";
|
|
4
4
|
import { d as AndroidAdbProvider, m as AppStateRuntimeResult, n as AndroidKeyboardState, s as AndroidInputOwner, t as AndroidKeyboardDismissResult } from "./device-input-state.js";
|
|
5
5
|
//#region packages/contracts/src/device-inventory.d.ts
|
|
6
6
|
type DeviceInventoryRequest = {
|
package/dist/src/linux.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";import{c as t}from"./diagnostics.js";import"./diagnostics2.js";import{a as n}from"./gesture-plan.js";import{S as r,_ as i,a,b as o,d as s,f as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,x}from"./src5.js";function S(){return{open:e=>s(e),openDevice:()=>Promise.resolve(),close:e=>g(e),tap:(e,t)=>c(e,t),alternateClick:async(e,t)=>t===`secondary`?await l(e.x,e.y):await y(e.x,e.y),doubleTap:(e,t)=>u(e,t),longPress:(e,t,n)=>d(e,t,n),focus:(e,t)=>m(e,t),type:(e,t)=>x(e,t),fill:(e,t,n,r)=>a(e,t,n,r),scroll:(e,t)=>b(e,t),performGesture:async t=>{if(t.topology===`two`)throw new e(`UNSUPPORTED_OPERATION`,`Multi-touch gestures are not supported on Linux`);let{start:r,end:i}=n(t);await o(r.x,r.y,i.x,i.y,t.durationMs)},screenshot:(e,t)=>i(e,t),readTextAtPoint:async(e,t)=>await f(e.x,e.y,t?.surface),snapshot:async e=>await t(`snapshot_capture`,async()=>await p(e,e?.signal),{backend:`linux-atspi`}),back:()=>v(),home:()=>_(),setOrientation:()=>{throw new e(`UNSUPPORTED_OPERATION`,`orientation not supported on Linux`)},appSwitcher:()=>{throw new e(`UNSUPPORTED_OPERATION`,`appSwitcher not yet supported on Linux`)},tvRemote:()=>{throw new e(`UNSUPPORTED_OPERATION`,`tv-remote not supported on Linux`)},readClipboard:()=>h(),writeClipboard:e=>r(e),setSetting:()=>{throw new e(`UNSUPPORTED_OPERATION`,`setSetting not supported on Linux`)}}}export{S as createLinuxInteractor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";function t(t,n){if(t===void 0||t.trim()===``)throw new e(`INVALID_ARGS`,`settings location set requires ${n}`);return r(Number(t),n)}function n(e){return{latitude:r(e?.latitude,`latitude`),longitude:r(e?.longitude,`longitude`)}}function r(t,n){let r=n===`latitude`?-90:-180,i=n===`latitude`?90:180;if(typeof t!=`number`||!Number.isFinite(t)||t<r||t>i)throw new e(`INVALID_ARGS`,`${n} must be a number from ${r} to ${i}`);return t}export{n,t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e}from"./sdk-contracts.js";import{A as t,N as n}from"./sdk-device.js";import{t as r}from"./scoped-provider.js";const i=r(void 0);function a(){return i.resolve()}async function o(e,t){return await i.run(e,t)}function s(r,i){if(!n(t(r.device),t(i))||r.device.simulatorSetPath!==i.simulatorSetPath)throw new e(`COMMAND_FAILED`,`Managed automation cannot select another device.`,{reason:`managed-device-transport-mismatch`})}function c(){let e=a();if(e)return async t=>{s(e,t)}}async function l(e){let t=c();return t?(await t(e),!0):!1}export{o as a,c as i,a as n,l as r,s as t};
|