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 • 2.27 kB
import{C as e,D as t,b as n,c as r,dt as i,ft as a,u as o}from"./sdk-batch.js";const s=r(o),c=M(s);function l(e){return a(t(e.command),e)}function u(e,n=Date.now()){let r=i(t(e.command),e);return r===void 0?void 0:n+r}function d(e){return j(e)?.route??`generic`}function f(e){return j(e)?.sessionKind}function p(e){return j(e)?.leaseAdmissionExempt===!0}function m(e){return j(e)?.appLease===`allowed`}function h(e){return j(e)?.androidAvdSelection}function g(e){return j(e)?.selectorValidationExempt!==!0}function _(e){return j(e)?.sessionExecutionLockExempt!==!0}function v(e){return j(e)?.replayScopedAction===!0}function y(e){return j(e)?.allowInvalidRecording!==!0}function b(e){return j(e)?.saveScriptFlagOwner===!0}function x(){return s.filter(e=>e.saveScriptFlagOwner===!0).map(e=>e.command).sort()}function S(e){return j(e)?.lockPolicySelectorOverride===!0}function C(e){return j(e)?.androidBlockingDialogGuard===!0}function w(t){let r=e(t);return r===void 0?n(t.command)===`observe`:r===`observes-app`}function T(t){if(t.command===`human_control`||t.command===`lease_heartbeat`)return!1;let r=e(t);return r===void 0?f(t.command)!==`observability`&&n(t.command)!==`observe`:r!==`observes-app`}function E(e){return j(e.command)?.preferExplicitDeviceOverExistingSession===!0}function D(e){let t=j(e.command)?.allowSessionlessDefaultDevice;return typeof t==`function`&&t(e)}function O(e){return j(e.command)?.sessionlessLeaseAdmissionExemption?.(e)}function k(e){let t=j(e.command)?.refFrameEffect;return typeof t==`function`?t(e):t}function A(e,t){return t.hasExistingSession?E(e)&&t.hasExplicitDeviceIdentity?`explicit-device`:`existing-session`:N(e)?`skip`:t.hasDeviceSelectionInput?`explicit-device`:D(e)?`sessionless-default-device`:`skip`}function j(e){return c.descriptorsByCommand.get(e)}function M(e){let t=new Map;for(let n of e){if(t.has(n.command))throw Error(`Duplicate daemon command descriptor: ${n.command}`);t.set(n.command,n)}return{descriptorsByCommand:t}}function N(e){let t=j(e.command);if(t?.route===`lease`)return!0;let n=t?.skipSessionlessProviderDevice;return typeof n==`function`&&n(e)}export{y as _,m as a,g as b,w as c,h as d,u as f,O as g,k as h,f as i,x as l,A as m,v as n,T as o,l as p,d as r,p as s,S as t,b as u,C as v,_ as y};