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 • 421 B
JavaScript
import{Ki as e,fi as t,mi as n}from"./sdk-batch.js";function r(t,n){return t.find(t=>e(t,n))??null}function i(e,r){let i=t(e);return i&&n(i)?i:a(e,r)}function a(e,r){if(!e.rect)return;let i=e.rect.y+e.rect.height/2,a=null;for(let e of r){if(!e.rect)continue;let r=t(e);if(!r||!n(r))continue;let o=e.rect.y+e.rect.height/2,s=Math.abs(o-i);(!a||s<a.distance)&&(a={label:r,distance:s})}return a?.label}export{r as n,i as t};