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 • 1.41 kB
import{v as e}from"./sdk-contracts.js";import{i as t,t as n}from"./toolchain-probe.js";import{i as r,n as i,r as a,t as o}from"./tool-provider3.js";async function s(e,s){let l=a()?r():i(o(s));if(!await l.isAvailable())return{id:`toolchain`,status:`info`,summary:`Vega toolchain: Vega CLI not found.`,hint:`Install Vega Developer Tools or ensure ~/vega/bin/vega is executable.`,command:`vega --version`};let u=await l.version({allowFailure:!0,timeoutMs:n}),f=await c(e),p=t(u.stdout),m=f.devices.some(e=>e.platform===`vega`&&e.kind===`emulator`&&e.target===`tv`&&e.booted===!0);return{id:`toolchain`,status:u.exitCode===0?`pass`:`info`,summary:p?`Vega toolchain: ${p}; ${m?`VVD running`:`no running VVD`}.`:`Vega toolchain: CLI found but version check failed.`,hint:m?void 0:`Start the Vega Virtual Device and retry doctor.`,evidence:{vegaVersion:p??null,deviceList:d(f)}}}async function c(e){try{return{devices:await e.listLocalDeviceInventory({platform:`vega`,target:`tv`}),listedSerials:[]}}catch(t){if(e.shouldPropagateInventoryProbeError(t))throw t;return{devices:[],listedSerials:l(t)}}}function l(t){if(!(t instanceof e)||t.code!==`DEVICE_NOT_FOUND`)return[];let n=t.details?.listedSerials;return u(n)?n:[]}function u(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function d(e){return(e.devices.length>0?e.devices.map(e=>e.id):e.listedSerials).join(`, `)||null}export{s as vegaToolchainCheck};