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.37 kB
JavaScript
import{n as e}from"./snapshot-quality-backend-capabilities.js";const t={healthy:!0,recovered:!0,sparse:!0},n={"ax-rejected":!0,"sparse-tree":!0,budget:!0,"no-nodes":!0,"capture-failed":!0,"presentation-failed":!0,deferred:!0,"requested-backend":!0};function r(e,t){return typeof t==`string`&&Object.hasOwn(e,t)}function i(i){if(!i||typeof i!=`object`)return;let s=i;if(!r(t,s.state)||!r(e,s.backend))return;let c=a(s.timing);return{state:s.state,backend:s.backend,reason:typeof s.reason==`string`?s.reason:void 0,reasonCode:r(n,s.reasonCode)?s.reasonCode:void 0,customActions:o(s.customActions),effectiveDepth:typeof s.effectiveDepth==`number`?s.effectiveDepth:void 0,collapsedLeafIndexes:Array.isArray(s.collapsedLeafIndexes)?s.collapsedLeafIndexes.filter(e=>typeof e==`number`):void 0,...c?{timing:c}:{}}}function a(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.acquisitionMs==`number`&&typeof t.presentationMs==`number`)return{acquisitionMs:t.acquisitionMs,presentationMs:t.presentationMs}}function o(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.read==`number`&&typeof t.candidates==`number`)return{read:t.read,candidates:t.candidates,truncated:typeof t.truncated==`number`?t.truncated:0,blocked:t.blocked===!0}}function s(e){return e?.state===`sparse`}function c(e){return e?.backend===`private-ax`?`private-ax`:void 0}export{c as n,i as r,s as t};