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.25 kB
import{Wi as e}from"./sdk-batch.js";import{v as t}from"./sdk-contracts.js";import{Ot as n}from"./sdk-io.js";import"./diagnostics.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,l as u,n as d,o as f,p,r as m,s as h,t as g,u as _,v,x as y,y as b}from"./src11.js";function x(x,S){let C=e=>async()=>{throw new t(`UNSUPPORTED_OPERATION`,`${e} is not supported on HarmonyOS`)};return{open:(e,t)=>u(x,e,{activity:t?.activity}),openDevice:()=>h(x),close:e=>m(x,e),tap:(e,t)=>o(x,e,t),doubleTap:(e,t)=>i(x,e,t),longPress:(e,t,n)=>a(x,e,t,n),focus:(e,t)=>o(x,e,t),type:(e,t)=>y(x,e,t),fill:(e,t,n,r)=>f(x,e,t,n,r),scroll:(e,t)=>c(x,e,t),performGesture:e=>_(x,e),gestureViewport:()=>p(x),screenshot:e=>l(x,e),snapshot:async t=>{let r=await n(`snapshot_capture`,async()=>await b(x,t),{backend:`harmonyos-arkui`});return e(r,{backend:`harmonyos-arkui`,producer:`harmonyos-uitest`})},back:()=>d(x),home:()=>h(x),setOrientation:e=>r(x,e),appSwitcher:()=>g(x),tvRemote:C(`tv-remote`),keyboardDismiss:async()=>(await s(x,`Back`),{kind:`acknowledged`}),keyboardEnter:async()=>(await s(x,`Enter`),{kind:`harmonyos-acknowledged`}),readClipboard:C(`clipboard`),writeClipboard:C(`clipboard`),setSetting:(e,t,n)=>v(x,e,t,n)}}export{x as createHarmonyInteractor};