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.09 kB
import{r as e}from"./rolldown-runtime.js";import{v as t}from"./sdk-contracts.js";import{c as n,s as r}from"./sdk-remote-config.js";var i=e({rejectRefusedProviderProfileFields:()=>a,requireResolvedProfilePlatform:()=>s,requireResolvedProfileValue:()=>o});function a(e,n){let i=Object.keys(n.fields).filter(t=>n.fields[t]===`refused`&&l(e?.[t]));if(i.length===0)return;let a=i.length!==1;throw new t(`INVALID_ARGS`,`${i.map(c).join(`, `)} ${a?`are`:`is`} not supported by ${n.label}.`,{hint:`Drop ${a?`those flags`:`the flag`} or use a provider that supports ${a?`them`:`it`}.`,provider:n.provider,flags:i.map(e=>r[e])})}function o(e,n){if(e!==void 0)return e;throw new t(`COMMAND_FAILED`,n,{hint:`Reconnect to regenerate and validate the provider profile.`})}function s(e,n){if(e===`android`||e===`ios`)return e;throw new t(`COMMAND_FAILED`,`${n} profile missed a mobile platform.`,{hint:`Reconnect with --platform ios|android.`})}function c(e){let t=n[e],i=r[e];return t?.length?`${i} (${t.join(`, `)})`:i}function l(e){return e!=null&&e!==!1&&e!==``}export{o as i,a as n,s as r,i as t};