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 • 827 B
import{v as e}from"./sdk-contracts.js";import{s as t}from"./tool-provider.js";async function n(e,n){let r=await t(`ps`,[`-p`,String(e),`-o`,`lstart=`],{allowFailure:!0,signal:n.signal,timeoutMs:n.timeoutMs});return r.exitCode===0&&r.stdout.trim()||null}const r={unsupported:`UNSUPPORTED_OPERATION`,"malformed-tree":`COMMAND_FAILED`,"stale-target":`COMMAND_FAILED`,timeout:`COMMAND_FAILED`,cancelled:`COMMAND_FAILED`,"process-crash":`COMMAND_FAILED`,"transport-failure":`COMMAND_FAILED`,preparing:`COMMAND_FAILED`};var i=class extends e{failureKind;failureCode;constructor(e,t,n=`iOS Simulator snapshot source ${e}: ${t}`,i={},a){super(r[e],n,{...i,bridgeFailure:e,bridgeFailureCode:t,...e===`cancelled`?{reason:`request_canceled`}:{}},a),this.name=`SnapshotSourceError`,this.failureKind=e,this.failureCode=t}};export{n,i as t};