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 • 786 B
import{v as e}from"./sdk-contracts.js";import{t}from"./await-with-signal.js";async function n(t,n){if(n.throwIfAborted(),!t)throw new e(`UNSUPPORTED_OPERATION`,`Limrun appstate requires an active provider session`,{reason:`owner-capability-missing`});if(t.platform===`ios`)return await r(t,n),{};let i=await t.getForegroundApp(n);return n.throwIfAborted(),{package:i?.appId,activity:i?.activity}}async function r(n,r){try{await t(n.listApps(),r)}catch(t){throw r.throwIfAborted(),new e(`COMMAND_FAILED`,`Could not confirm that the Limrun iOS instance is running, so its app state is unknown.`,{reason:`limrun_instance_unreachable`,hint:`Retry appstate. If it keeps failing, the instance may have been terminated: run connect limrun and open again.`},t)}}export{n as readLimrunAppState};