UNPKG

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 • 952 B
import{r as e}from"./rolldown-runtime.js";import{n as t,t as n}from"./parser.js";import{b as r}from"./host-file.js";import{a as i,s as a,t as o}from"./tool-provider.js";var s=e({parseApplePlist:()=>u,readInfoPlistString:()=>c});async function c(e,t,n){try{let r=(await i(e,n))?.[t];if(typeof r==`string`&&r.length>0)return r}catch{n?.throwIfAborted()}try{let r=await a(`plutil`,[`-extract`,t,`raw`,`-o`,`-`,e],{allowFailure:!0,timeoutMs:o,signal:n});if(r.exitCode===0){let e=r.stdout.trim();if(e.length>0)return e}}catch{n?.throwIfAborted()}try{return l(await r(e,{signal:n}),t)}catch{n?.throwIfAborted();return}}function l(e,r){let i;return t(n(e),(e,t)=>{i===void 0&&e===r&&t.name===`string`&&(i=t.text??void 0)}),i}async function u(e){let{parse:t}=await import(`./dist2.js`),n=t(new TextDecoder().decode(e.subarray(0,8))===`bplist00`?e:new TextDecoder().decode(e));return typeof n==`object`&&n&&!Array.isArray(n)?n:null}export{s as n,c as r,u as t};