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.01 kB
JavaScript
import{B as e,v as t}from"./sdk-contracts.js";async function n(t){try{return{available:!0,...await t}}catch(t){let n=e(t);return{available:!1,reason:n.message,error:n}}}function r(e,t){return{available:!1,reason:`No ${e} app ${t} is associated with this session. Run open <app> first.`}}function i(e,t,n,r){return{artifact:{available:!1,kind:t,reason:`${e} perf memory snapshot does not support ${t}.`,hint:r,support:n},support:n}}function a(){return new t(`INVALID_ARGS`,`perf memory snapshot requires an active app session`,{hint:`Run open <app> first so perf memory snapshot can resolve the app process.`})}function o(e){return Object.freeze({perfNativeCaptureStart:e.start,perfNativeCaptureReattach:e.reattach,perfNativeCaptureCleanup:e.cleanup,perfProfileReport:async n=>{if(n.kind!==e.expectedProfileKind)throw new t(`INVALID_ARGS`,`${e.platform} native perf requires --kind ${e.expectedProfileKind}, not ${n.kind}`);return await e.writeProfileReport(n)}})}export{i as a,n as i,r as n,a as r,o as t};