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 • 3.28 kB
JavaScript
import{X as e}from"./sdk-device.js";import{t}from"./application-lifecycle-runtime.js";import{i as n}from"./touch-runtime.js";import{C as r,D as i,F as a,M as o,R as s,V as c,W as l,_ as u,j as d,l as f,o as p,p as m,r as h,v as g,x as _}from"./tv-remote-runtime.js";import{n as v}from"./audio-probe-runtime.js";import{n as y}from"./perf-runtime.js";import{a as b}from"./screenshot-runtime2.js";import{t as x}from"./viewport-runtime.js";const S={appLog:!0,apps:!0,appDeployment:!0,appState:!0,network:!0,screenRecording:!0,screenshot:!0,snapshot:!0,viewport:!0,focus:!0,gesture:!0,scroll:!0,typeText:!0,touch:!0,elementText:!0,back:!0,orientation:!0,fold:!0,telephony:!0,tvRemote:!0,keyboard:!0,clipboard:!0,systemButton:!0,triggerAppEvent:!0,settings:!0,readAlert:!0,awaitAlert:!0,acceptAlert:!0,dismissAlert:!0,audioProbeCapture:!0,audioProbeQuery:!0,perf:!0,readiness:!0,shutdown:!0};function C(e){let t={};for(let n of Object.keys(S))t[n]=e(n);return t}function w(e){return Object.freeze({...C(()=>e),lifecycle:t({resolveOpenTarget:e,prepareApplicationOpen:e,openApplication:e,applyRuntimeHints:e,clearRuntimeHints:e,closeApplication:e,finalizeApplicationClose:e,prepareAppleRunner:e,configureProviderPortReverse:e})})}function T(e,t,n){return Object.freeze({device:e,owner:t,facts:E(e,t,n),operations:Object.freeze({}),[Symbol.asyncDispose]:async()=>void 0})}function E(t,S,C){let w=O(C);return Object.freeze({device:{...e(t),providerMode:D(S)},operations:{appLogInspect:w.appLog,appLogDoctor:w.appLog,appLogStart:w.appLog,appLogReattach:w.appLog,appLogCleanup:w.appLog,listApps:w.apps,deployApp:w.appDeployment,materializeAppSource:w.appDeployment,deployMaterializedApp:w.appDeployment,sendPushNotification:w.appDeployment,uninstallApp:w.appDeployment,appState:w.appState,networkDump:w.network,screenRecordingStart:w.screenRecording,screenRecordingReattach:w.screenRecording,screenRecordingCleanup:w.screenRecording,...b({capture:w.screenshot}),...d({capture:w.snapshot,customActions:w.snapshot,withoutActiveApp:w.snapshot}),...o({findText:w.snapshot,querySelector:w.snapshot}),...x({setViewport:w.viewport}),...c({focus:w.focus}),...s({unsupported:w.gesture}),...a({scroll:w.scroll}),...i({type:w.typeText}),...n({unsupported:w.touch,tap:w.touch,longPress:w.touch,fill:w.touch}),...l({readTextAtPoint:w.elementText}),...r({back:w.back}),...p({orientation:w.orientation,unlock:w.orientation}),setFoldPose:w.fold,sendTelephonyEvent:w.telephony,...h({tvRemote:w.tvRemote}),...f({unsupported:w.keyboard}),...m({unsupported:w.clipboard}),...u({unsupported:w.systemButton}),...g({triggerAppEvent:w.triggerAppEvent}),setSetting:w.settings,readSetting:w.settings,..._({read:w.readAlert,wait:w.awaitAlert,accept:w.acceptAlert,dismiss:w.dismissAlert}),...v({capture:w.audioProbeCapture,query:w.audioProbeQuery}),...y({frames:w.perf,memorySample:w.perf,memorySnapshot:w.perf,nativeCapture:w.perf,profileReport:w.perf}),ensureReady:w.readiness,bootTarget:w.readiness,bootTargetHeadless:w.readiness,shutdownTarget:w.shutdown,...w.lifecycle}})}function D(e){switch(e.kind){case`local-family`:return`local`;case`provider-runtime`:return`provider-runtime`}}function O(e){return Object.freeze({...C(t=>Object.freeze({...e[t]??e.network})),lifecycle:t(e.lifecycle)})}export{T as n,E as r,w as t};