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 • 491 B
let e,t=0;function n(e,t){return e.baseUrl===t.baseUrl&&e.token===t.token&&e.pid===t.pid}function r(e){return e.reachable&&!!e.instanceId&&(!e.upstream||!!e.upstream.instanceId)}function i(t,n){r(n)&&(e={baseUrl:t.baseUrl??``,token:t.token,pid:t.pid,health:n})}function a(r){t+=1,e&&n(e,r)&&(e=void 0)}async function o(r,a){if(e&&n(e,r))return e.health;let o=t,s=await a();return o===t&&i(r,s),s}export{i as cacheRemoteDaemonHealth,o as cachedRemoteHealth,a as invalidateRemoteDaemonHealth};