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.02 kB
JavaScript
const e=new WeakMap;async function t(e,t){let n=r(e);if(n&&n.kind!==`reported`){let{AppError:e,discloseDispatch:n}=await import(`./sdk-contracts.js`).then(e=>e.M);throw n(new e(`COMMAND_FAILED`,`${t} has no established screen-coordinate origin`,{reason:`window-origin-unknown`,hint:`Take a fresh snapshot after the accessibility channel recovers, or use screenshot to choose screen coordinates.`}),`no`)}}function n(e,t){return a(e,{viewport:t})}function r(t){return t?e.get(t)?.viewport:void 0}function i(e,t){let i=r(e);return i?n(t,i):t}function a(t,n){return e.set(t,{...e.get(t),...n}),t}function o(e,t){return a(e,{clickability:t})}function s(t){return t?e.get(t)?.clickability:void 0}function c(e,t){let n=s(e);return n?o(t,n):t}function l(e,t){return a(e,{occlusionContext:t})}function u(t){return t?e.get(t)?.occlusionContext:void 0}function d(e,t){return a(e,{textInputGeometry:t})}function f(t){return t?e.get(t)?.textInputGeometry:void 0}export{n as a,s as c,d as i,u as l,o as n,c as o,l as r,i as s,t,f as u};