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 • 504 B
JavaScript
function e(e){let t=e.trim().toLowerCase();return t?/^(vertical|horizontal)\s+scroll\s+bar(?:,?\s*\d+\s+pages?)?$/.test(t):!1}function t(e,t){if(!(e?.trim().toLowerCase()??``).includes(`vertical scroll bar`))return null;let r=n(t);return r===null?null:r<=1?{above:!1,below:!0}:r>=99?{above:!0,below:!1}:{above:!0,below:!0}}function n(e){if(!e)return null;let t=/^(\d{1,3})%$/.exec(e.trim());if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Math.max(0,Math.min(100,n)):null}export{e as n,t};