agent-device
Version:
Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.
1 lines • 3.39 kB
JavaScript
import{r as e}from"./rolldown-runtime.js";import{v as t}from"./sdk-contracts.js";import{t as n}from"./runner-startup-transport.js";import{S as r,g as i}from"./runner-contract.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./src8.js";import{S as f,_ as p,a as m,g as h,h as g,i as _,l as v,o as y,s as b}from"./runner-cache-metadata.js";import{E as x,O as S,d as C,h as w,k as T,y as E}from"./runner-lease.js";import{A as D,D as O,g as k,j as A}from"./runner-disposal.js";import{a as j,l as M,o as N,r as P,u as F}from"./runner-lifecycle.js";import{t as I}from"./runner-client.js";import L from"node:path";const R=[`ios`,`macos`,`tvos`,`visionos`,`watchos`];function z(e){return R.includes(e)}const B={ios:`mobile`,macos:`desktop`,tvos:`tv`,visionos:`mobile`,watchos:`mobile`},V={ios:`ios`,macos:`macos`,tvos:`tvos`,visionos:`visionos`,watchos:`watchos`};function H(e,t){let n=U(t);return{platform:`apple`,id:`runner-script-${e}`,name:`Apple runner build script (${e})`,kind:e===`macos`?`device`:n,target:B[e],appleOs:V[e]}}function U(e){let n=W(e);if(n===void 0)throw new t(`INVALID_ARGS`,`The Apple runner build destination must name its platform`,{destination:e,hint:`Pass a destination with a platform= token, e.g. generic/platform=iOS Simulator for a simulator or generic/platform=iOS for a physical device.`});return n.toLowerCase().endsWith(`simulator`)?`simulator`:`device`}function W(e){for(let t of e.split(`,`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e).trim().toLowerCase().replace(/^generic\//,``)===`platform`)return t.slice(e+1).trim()||void 0}}function G(e,t){let n=L.join(t,`.agent-device`,`apple-runner`,`derived`);return e===`ios`?n:L.join(n,e)}var K=e({RUNNER_STARTUP_TIMEOUT_MS:()=>n,RUNNER_XCTESTRUN_CAPTURE_OPTIONS:()=>O,applyXctestRunnerAppIconFromDerivedPath:()=>D,assertSafeDerivedCleanup:()=>E,cleanupRunnerLeasesForOwner:()=>q,createAppleRunnerRuntime:()=>J,createLaunchedAppleRunnerProvider:()=>d,detachIosRunnerSessionsForShutdown:()=>P,findRunnerXctestrun:()=>k,hasLiveIosRunnerSession:()=>s,isRunnerXcuitestScriptPlatform:()=>z,mintRunnerToken:()=>i,notifyIosRunnerAppRelaunched:()=>l,prepareIosRunner:()=>o,prewarmAppleRunnerCache:()=>a,prewarmIosRunnerSession:()=>c,readRunnerSessionLiveness:()=>j,readStaleRunnerLease:()=>C,releaseIosRunnerOnClose:()=>N,releaseSpeculativeIosRunnerSessionFor:()=>u,requireCertifiedRunnerCacheArtifacts:()=>x,requireRunnerBuildSettingsMatchBuildLog:()=>_,resolveExistingRunnerProductPaths:()=>A,resolveExpectedRunnerCacheMetadata:()=>m,resolveRunnerAppBundleId:()=>y,resolveRunnerArchBuildSettings:()=>b,resolveRunnerBundleBuildSettings:()=>v,resolveRunnerDerivedOverride:()=>f,resolveRunnerPerformanceBuildSettings:()=>g,resolveRunnerSandboxBuildArgs:()=>h,resolveRunnerScriptDefaultDerivedPath:()=>G,resolveRunnerScriptDevice:()=>H,resolveRunnerSigningBuildSettings:()=>p,runAppleRunnerCommand:()=>I,runnerListenerEnv:()=>r,shouldDeleteRunnerDerivedRootEntry:()=>S,stopAllIosRunnerSessions:()=>M,stopIosRunnerSession:()=>F,verifyLeaseRunnerPidIdentity:()=>w,writeRunnerCacheMetadataForArtifacts:()=>T});async function q(e){let{cleanupRunnerLeasesForOwner:t}=await import(`./runner-client.js`).then(e=>e.n),{runnerLeaseCleanupAdapter:n}=await import(`./src8.js`).then(e=>e.u);await t(e,n)}async function J(e){let{createAppleRunnerRuntime:t}=await import(`./runner-runtime.js`);return t(e)}export{K as t};