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.62 kB
JavaScript
import{v as e}from"./sdk-contracts.js";import{Ot as t}from"./sdk-io.js";import"./diagnostics.js";import{i as n}from"./gesture-plan.js";import{r}from"./scoped-provider.js";import{n as i,o as a,t as o}from"./tool-provider2.js";import{S as s,_ as c,a as l,b as u,d,f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,x as T}from"./src12.js";function E(e){let t=o({host:e});return r(D(),async e=>i()?await e():await a(t,e))}function D(){return{open:e=>d(e),openDevice:()=>Promise.resolve(),close:e=>b(e),tap:(e,t)=>f(e,t),alternateClick:async(e,t)=>t===`secondary`?await p(e.x,e.y):await C(e.x,e.y),doubleTap:(e,t)=>m(e,t),longPress:(e,t,n)=>h(e,t,n),focus:(e,t)=>v(e,t),type:(e,t)=>T(e,t),fill:(e,t,n,r)=>l(e,t,n,r),scroll:(e,t)=>w(e,t),performGesture:async t=>{if(t.topology!==`single`)throw new e(`UNSUPPORTED_OPERATION`,`Multi-touch gestures are not supported on Linux`);let{start:r,end:i}=n(t);await u(r.x,r.y,i.x,i.y,t.durationMs)},screenshot:(e,t)=>c(e,t),readTextAtPoint:async(e,t)=>await g(e.x,e.y,t?.surface),snapshot:async e=>await t(`snapshot_capture`,async()=>await _(e,e?.signal),{backend:`linux-atspi`}),back:()=>S(),home:()=>x(),setOrientation:()=>{throw new e(`UNSUPPORTED_OPERATION`,`orientation not supported on Linux`)},appSwitcher:()=>{throw new e(`UNSUPPORTED_OPERATION`,`appSwitcher not yet supported on Linux`)},tvRemote:()=>{throw new e(`UNSUPPORTED_OPERATION`,`tv-remote not supported on Linux`)},readClipboard:()=>y(),writeClipboard:e=>s(e),setSetting:()=>{throw new e(`UNSUPPORTED_OPERATION`,`setSetting not supported on Linux`)}}}export{E as createLinuxInteractor};