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.
2 lines • 4.57 kB
JavaScript
import{r as e}from"./rolldown-runtime.js";import{t}from"./snapshot-capture-annotations.js";import"./capture.js";import{A as n}from"./sdk-device.js";import{i as r,r as i}from"./success-text.js";import{n as a,t as o}from"./deploy-result-target.js";var s=e({formatDeliveredArtifactLines:()=>y,serializeCloseResult:()=>v,serializeDeployResult:()=>p,serializeDevice:()=>d,serializeInstallFromSourceResult:()=>m,serializeOpenResult:()=>h,serializeSessionListEntry:()=>u,serializeSnapshotResult:()=>f});function c(e,t={}){let n=t.includeSerial??!0,r=l(e);return{platform:e.platform,target:e.target,device:e.name,id:e.id,...e.kind?{kind:e.kind}:{},...e.model?{model:e.model}:{},...e.osVersion?{osVersion:e.osVersion}:{},...e.platform===`ios`?{device_udid:e.ios?.udid??e.id,ios_simulator_device_set:e.ios?.simulatorSetPath??null}:{},...n&&r?{serial:r}:{}}}function l(e){return n(e.platform)?e.identifiers.serial??e.id:void 0}function u(e){return{name:e.name,...e.address?{address:e.address}:{},...e.sessionStateDir?{sessionStateDir:e.sessionStateDir}:{},...e.runnerLogPath?{runnerLogPath:e.runnerLogPath}:{},...c(e.device,{includeSerial:!1}),createdAt:e.createdAt}}function d(e){return{platform:e.platform,...e.appleOs?{appleOs:e.appleOs}:{},id:e.id,name:e.name,kind:e.kind,target:e.target,...e.model?{model:e.model}:{},...e.osVersion?{osVersion:e.osVersion}:{},...typeof e.booted==`boolean`?{booted:e.booted}:{},...e.claimedBy?{claimedBy:e.claimedBy}:{}}}function f(e){return{nodes:e.nodes,...e.truncated===void 0?{}:{truncated:e.truncated},...e.appName?{appName:e.appName}:{},...e.appBundleId?{appBundleId:e.appBundleId}:{},...e.visibility?{visibility:e.visibility}:{},...e.keyboard?{keyboard:e.keyboard}:{},...e.viewport?{viewport:e.viewport}:{},...e.presentedSurface?{presentedSurface:e.presentedSurface}:{},...e.postGestureOutcome?{postGestureOutcome:e.postGestureOutcome}:{},...t({...e,...e.snapshotQuality?{quality:e.snapshotQuality}:{},...e.snapshotQualityNotes?{qualityNotes:e.snapshotQualityNotes}:{}}),...e.unchanged?{unchanged:e.unchanged}:{},...e.snapshotDiagnostics?{snapshotDiagnostics:e.snapshotDiagnostics}:{},..._(e),...e.fallbackScreenshotPath?{fallbackScreenshotPath:e.fallbackScreenshotPath}:{},...e.refsGeneration===void 0?{}:{refsGeneration:e.refsGeneration}}}function p(e){return r({app:e.app,appPath:e.appPath,platform:e.platform,...e.appId?{appId:e.appId}:{},...e.bundleId?{bundleId:e.bundleId}:{},...e.package?{package:e.package}:{}},`Installed: ${o(e)}`)}function m(e){return r({launchTarget:e.launchTarget,...e.appName?{appName:e.appName}:{},...e.appId?{appId:e.appId}:{},...e.bundleId?{bundleId:e.bundleId}:{},...e.packageName?{package:e.packageName}:{},...e.installablePath?{installablePath:e.installablePath}:{},...e.archivePath?{archivePath:e.archivePath}:{},...e.materializationId?{materializationId:e.materializationId}:{},...e.materializationExpiresAt?{materializationExpiresAt:e.materializationExpiresAt}:{}},`Installed: ${a(e)}`)}function h(e){let t=e.appName??e.appBundleId??e.session;return r({session:e.session,..._(e),...g(e),...e.appName?{appName:e.appName}:{},...e.appBundleId?{appBundleId:e.appBundleId}:{},...e.selection?{selection:e.selection}:{},...e.startup?{startup:e.startup}:{},...e.runtime?{runtime:e.runtime}:{},...e.device?c(e.device):{},...e.launchConfirmation?{launchConfirmation:e.launchConfirmation}:{},...e.launchConfirmation===`unanswered`&&e.launchConfirmationReason?{launchConfirmationReason:e.launchConfirmationReason}:{},...e.launchConfirmationProbeFailure?{launchConfirmationProbeFailure:e.launchConfirmationProbeFailure}:{},...e.snapshot?{snapshot:e.snapshot}:{},...e.initialSnapshotError?{initialSnapshotError:e.initialSnapshotError}:{}},t?`Opened: ${t}`:`Opened`)}function g(e){return{...e.sessionStateDir?{sessionStateDir:e.sessionStateDir}:{},...e.runnerLogPath?{runnerLogPath:e.runnerLogPath}:{},...e.requestLogPath?{requestLogPath:e.requestLogPath}:{},...e.eventLogPath?{eventLogPath:e.eventLogPath}:{}}}function _(e){return{...e.warnings?.length?{warnings:e.warnings}:{},...e.scriptDeliveryFailure?{scriptDeliveryFailure:e.scriptDeliveryFailure}:{}}}function v(e){return{session:e.session,...e.shutdown?{shutdown:e.shutdown}:{},...`provider`in e&&e.provider?{provider:e.provider}:{},..._(e),...i([e.session?`Closed: ${e.session}`:`Closed`,...y(`provider`in e?e.provider?.cloudArtifacts:void 0)].join(`
`))}}function y(e){return[...(e?.cloudArtifacts??[]).filter(e=>(e.availability??`ready`)===`ready`&&e.url).slice(0,3).map(e=>`${e.name}: ${e.url}`),...e?.message?[e.message]:[]]}export{s as n,d as r,y as t};