UNPKG

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 • 2.03 kB
function e(e={}){return Object.freeze({projection:e.projection??(e.raw===!0?`raw`:`regular`),interactiveOnly:e.interactiveOnly===!0,depth:typeof e.depth==`number`?e.depth:null,scope:e.scope?.trim()||null,customActions:e.customActions===!0,acquisitionIntent:e.acquisitionIntent??`full`})}function t(e){return Object.freeze({projection:e.projection,interactiveOnly:e.interactiveOnly,depth:e.depth,scope:e.scope,customActions:e.customActions})}function n(e){let t=e.scope!==null,n=e.projection===`raw`;return Object.freeze({projection:e.projection,rawTraversalDepth:n&&!t?e.depth:null,regularPresentedDepth:!n&&!t?e.depth:null,interactiveOnly:!n&&e.interactiveOnly,customActions:e.customActions,acquisitionIntent:e.acquisitionIntent})}function r(e){return JSON.stringify({producer:e.producer,intent:e.intent,lineage:e.lineage,presentationKey:e.presentationKey,residue:e.residue.map(a).sort()})}function i(e,n){return e.stage===`acquired`?Object.freeze({producer:e.acquisition.producer,intent:e.acquisition.intent,lineage:e.acquisition.lineage,presentationKey:t(n),residue:Object.freeze([...e.acquisition.residue])}):Object.freeze({producer:e.presentation.producer,intent:e.presentation.intent,lineage:e.validation.lineage,presentationKey:e.validation.presentationKey,residue:Object.freeze([...e.validation.residue])})}function a(e){switch(e.kind){case`provider-pruned`:return JSON.stringify({kind:e.kind,fields:[...e.fields].sort()});case`missing-viewport`:return JSON.stringify({kind:e.kind,reason:e.reason});case`truncated`:return JSON.stringify({kind:e.kind});case`stale-generation`:return JSON.stringify({kind:e.kind,expected:e.expected,observed:e.observed});case`unknown-generation`:return JSON.stringify({kind:e.kind,captureId:e.captureId});case`unavailable-fact`:return JSON.stringify({kind:e.kind,fact:e.fact});case`fallback-source`:return JSON.stringify({kind:e.kind,producer:e.producer});case`collapsed-tab-bar-probe-failed`:return JSON.stringify({kind:e.kind,reason:e.reason})}}export{r as a,n as i,t as n,e as r,i as t};