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 • 1.23 kB
JavaScript
import{r as e}from"./rolldown-runtime.js";import{w as t}from"./sdk-device.js";import{r as n}from"./device-isolation.js";var r=e({SIMCTL_SHUTDOWN_STATE:()=>d,buildSimctlArgsForAddress:()=>l,buildSimctlArgsForDevice:()=>u,readSimctlContainerPath:()=>m,readSimctlDeviceState:()=>p,readSimctlDevicesByRuntime:()=>f,scopeSimctlArgsForDevice:()=>c,simctlAvailabilityProbeArgs:()=>o,simctlListInventoryArgs:()=>s,simulatorAddressFor:()=>i});function i(e){let r=t(e)&&e.kind===`simulator`?n(e.simulatorSetPath):void 0;return Object.freeze({udid:e.id,simulatorSetPath:r})}function a(e,t){let r=n(e),i=r?[`--set`,r,...t]:[...t];return Object.freeze(i)}function o(){return a(void 0,[`help`])}function s(e){return a(e,[`list`,`-j`])}function c(e,t){return a(i(e).simulatorSetPath,t)}function l(e,t){return Object.freeze([`simctl`,...a(e.simulatorSetPath,t)])}function u(e,t){return l(i(e),t)}const d=`Shutdown`;function f(e){return JSON.parse(e).devices??{}}function p(e,t){try{for(let n of Object.values(f(e))){let e=n.find(e=>e.udid===t);if(e)return e.state??null}return null}catch{return null}}function m(e){let t=e.trim();if(!(!t||t===`(null)`))return t}export{p as a,o as c,i as d,m as i,s as l,l as n,f as o,u as r,c as s,d as t,r as u};