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 • 663 B
import{v as e}from"./sdk-contracts.js";import{y as t}from"./daemon-http.js";function n(e,n){return t(e,n)?n:`${e}:${n}`}function r(e,n){return t(e,n)?n.slice(e.length+1):n}function i(e,t,n){let i=t.meta?.sessionIsolation===`tenant`?t.meta.tenantId:void 0;return n.kind===`cwd`&&e!==``?{kind:`workspace`,id:n.id}:i===void 0?{name:e}:{name:r(i,e),namespace:{kind:`tenant`,id:i}}}function a(t){let n=t.internal?.webSession;if(n===void 0)throw new e(`UNKNOWN`,`A request reached device resolution outside a request scope.`,{reason:`request_web_session_missing`});return n}function o(e,n){return!e.partitioned||t(e.tenant,n)}export{n as a,r as i,o as n,a as r,i as t};