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 • 2.26 kB
JavaScript
async function e(e,t,n){let{resolveAppleRunnerScreenRecordingTransport:r}=await import(`./platform-runtime-screen-recording-apple-runner-transport.js`),i=r();if(t.kind===`stop`){if(i.authority!==t.runnerAuthority)throw Error(`Apple runner recording ownership changed before cleanup`);return await i.stop({device:e,runnerSessionId:t.runnerSessionId,appBundleId:t.appBundleId,signal:n}),{}}let a=await i.start({device:e,appBundleId:t.appBundleId,outputPath:t.outputPath,fps:t.fps,signal:n});return Object.freeze({runnerSessionId:a.runnerSessionId,runnerAuthority:i.authority,...a.remotePath===void 0?{}:{remotePath:a.remotePath},...typeof a.recorderStartUptimeMs==`number`?{recorderStartUptimeMs:a.recorderStartUptimeMs}:{}})}async function t(e,t,n){let{resolveAppleRunnerScreenRecordingTransport:r}=await import(`./platform-runtime-screen-recording-apple-runner-transport.js`),i=r();return i.authority===n?await i.inspect(e,t):`ownership-lost`}async function n(e,t,n,r,i){i?.throwIfAborted();let{resolveIosPhysicalDeviceControl:a}=await import(`./physical-device-facade.js`);await a(e).copyRunnerFile(e,t,n,r),i?.throwIfAborted()}async function r(e,t,n,r){try{let[i,a]=await Promise.all([import(`./platform-runtime-screen-recording-apple-transport.js`).then(e=>e.resolveAppleSimulatorScreenRecordingTransport()),import(`./platform-runtime-screen-recording-apple-runner-transport.js`).then(e=>e.resolveAppleRunnerScreenRecordingTransport())]);if(i.mode===`transport-composed`&&a.authority!==`scoped-provider`)return;let{runAppleRunnerCommand:o}=await import(`./runner-operations-facade.js`).then(e=>e.t),s=await o(e,{command:`snapshot`,appBundleId:t,interactiveOnly:!0,depth:1},{signal:n,requestId:r}),c=Date.now();return typeof s.currentUptimeMs==`number`&&Number.isFinite(s.currentUptimeMs)&&s.currentUptimeMs>0?{wallClockAtMs:c,uptimeMs:s.currentUptimeMs}:void 0}catch{n?.throwIfAborted();let{throwIfRequestCanceled:e}=await import(`./request.js`).then(e=>e.t);e(r);return}}async function i(e,t){let{resolveRunnerContainerBundleIds:n}=await import(`./src8.js`).then(e=>e.u);return n(t).includes(e)}export{r as captureAppleClockAnchor,t as inspectAppleRunnerOwnership,i as isAppleRunnerBundleId,n as retrieveAppleRunnerRecording,e as runAppleRecordingRunner};