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.71 kB
JavaScript
import{Ar as e,_i as t,br as n,fi as r}from"./sdk-batch.js";const i={state:`sparse`,backend:`tree`,reason:`legacy iOS capture exposed only the application root`,reasonCode:`sparse-tree`},a={sparse:`capture was sparse`,truncated:`capture was truncated`,unsettled:`the surface was still changing after a gesture`,loading:`the launched app was still loading its first screen`},o={unsettled:`unsettled`,loading:`loading`,"no-effect":void 0};function s(e){return typeof e==`string`&&Object.hasOwn(a,e)}function c(e){if(e.scope!==void 0)return`scope`;if(e.depth!==void 0)return`depth`}function l(e,t=`is`){let n=`${t} absent`;return e===`scope`?`${n} does not support --scope; it requires an unscoped capture`:`${n} does not support --depth; it requires a full-depth capture`}function u(e,t){let n=t[0]?m(t[0]):void 0,r=t.length;if(e.truncated===!0)return{kind:`truncated`,matches:r,...n?{firstMatch:n}:{}};let i=f(e);return i?{kind:`sparse`,matches:r,...n?{firstMatch:n}:{},quality:{state:i.state,backend:i.backend,...i.reason?{reason:i.reason}:{},...i.reasonCode?{reasonCode:i.reasonCode}:{}}}:r===0?d(e.postGestureOutcome):{kind:`present`,matches:r,firstMatch:n}}function d(e){let t=e?o[e.kind]:void 0;return t?{kind:t,matches:0}:{kind:`absent`,matches:0}}function f(e){let t=e.snapshotQuality;return t?.state===`sparse`?{state:t.state,backend:t.backend,...t.reason?{reason:t.reason}:{},...t.reasonCode?{reasonCode:t.reasonCode}:{}}:p(e)?i:void 0}function p(e){return e.snapshotQuality||e.backend!==`xctest`||e.nodes.length!==1?!1:t(e.nodes[0]?.type??``)===`application`}function m(t){let i=n(t),a=e(r(t),256);return{...i,...a&&a!==i.label?{text:a}:{}}}export{p as a,u as i,l as n,s as o,c as r,f as s,a as t};