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 • 1.5 kB
import{r as e}from"./rolldown-runtime.js";import{v as t}from"./sdk-contracts.js";import{rt as n}from"./sdk-io.js";import"./command.js";import{t as r}from"./scoped-provider.js";import{n as i,t as a}from"./vega-executable.js";var o=e({createLocalVegaCliAdapter:()=>s,createLocalVegaToolProvider:()=>d,hasScopedVegaToolProvider:()=>p,resolveVegaToolProvider:()=>f,withVegaToolProvider:()=>m});function s(e){let t=a(e.env),r,o=async()=>r||(r=await i(t),r);return{run:async(e,t)=>await n(await o()??`vega`,e,t),isAvailable:async()=>!!await o()}}function c(){let e=async()=>{throw new t(`COMMAND_FAILED`,`The Vega CLI adapter is not bound to a host.`,{reason:`vega-adapter-host-unbound`})};return{run:e,isAvailable:e}}const l=d(c()),u=r(l);function d(e){return{isAvailable:async()=>await e.isAvailable(),version:async t=>await e.run([`--version`],t),listDevices:async t=>await e.run([`device`,`list`],t),checkConnected:async(t,n)=>await e.run([`device`,`is-connected`,`--device`,t],n),launchApp:async(t,n,r)=>await e.run([`device`,`launch-app`,`--device`,t,`--appName`,n],r),terminateApp:async(t,n,r)=>await e.run([`device`,`terminate-app`,`--device`,t,`--appName`,n],r),pressRemote:async(t,n,r,i)=>await e.run([`device`,`run-cmd`,`--device`,t,`--command`,[`inputd-cli`,`button_press`,n,...r===void 0?[]:[`--holdDuration`,String(r)]].join(` `)],i)}}function f(e){return u.resolve(e)}function p(){return u.hasScope()}async function m(e,t){return await u.run(e,t)}export{o as a,f as i,d as n,p as r,s as t};