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.04 kB
JavaScript
import{r as e}from"./rolldown-runtime.js";import{i as t}from"./lease-context.js";import{r as n}from"./session-tenant-scope.js";import{i as r,r as i}from"./dispatch-resolve.js";var a=e({resolveRequestTargetDevice:()=>s,resolveRequestTargetDeviceSelection:()=>c});function o(e,t){t.platform===`web`&&n(e)}async function s(e,t,n=e.flags??{}){let r=await i(await l(e,n),{...t,webSession:e.internal?.webSession});if(o(e,r),e.meta?.devicePin){let{assertDeviceHonorsPin:t}=await import(`./device-selection-resolver.js`).then(e=>e.t);t(e.meta.devicePin,r,n)}return r}async function c(e,t,n=e.flags??{}){let i=await r(await l(e,n),{...t,webSession:e.internal?.webSession});if(o(e,i.device),e.meta?.devicePin){let{assertDeviceHonorsPin:t}=await import(`./device-selection-resolver.js`).then(e=>e.t);t(e.meta.devicePin,i.device,n)}return i}async function l(e,n){let r=e.meta?.devicePin;if(r){let{effectiveDevicePinSelector:e}=await import(`./device-selection-resolver.js`).then(e=>e.t);n={...n,...e(r,n)}}return{...n,...t(e)}}export{s as n,c as r,a as t};