agent-device 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/224.js +2 -2
- package/dist/src/331.js +1 -1
- package/dist/src/bin.js +61 -60
- package/dist/src/client-shared.d.ts +20 -0
- package/dist/src/core/dispatch-resolve.d.ts +2 -2
- package/dist/src/daemon/handlers/session-batch.d.ts +2 -0
- package/dist/src/daemon/handlers/session-close.d.ts +31 -0
- package/dist/src/daemon/handlers/session-deploy.d.ts +37 -0
- package/dist/src/daemon/handlers/session-device-utils.d.ts +25 -0
- package/dist/src/daemon/handlers/session-open-target.d.ts +3 -0
- package/dist/src/daemon/handlers/session-open.d.ts +22 -0
- package/dist/src/daemon/handlers/session-perf.d.ts +2 -0
- package/dist/src/daemon/handlers/session-runtime-command.d.ts +9 -0
- package/dist/src/daemon/handlers/session-runtime.d.ts +41 -0
- package/dist/src/daemon/handlers/session-startup-metrics.d.ts +11 -0
- package/dist/src/daemon/handlers/session.d.ts +4 -29
- package/dist/src/daemon/selectors-build.d.ts +4 -0
- package/dist/src/daemon/selectors-match.d.ts +5 -0
- package/dist/src/daemon/selectors-parse.d.ts +29 -0
- package/dist/src/daemon/selectors-resolve.d.ts +32 -0
- package/dist/src/daemon/selectors.d.ts +5 -65
- package/dist/src/daemon.js +36 -36
- package/dist/src/platforms/android/index.d.ts +2 -1
- package/dist/src/platforms/android/screenshot.d.ts +16 -0
- package/dist/src/platforms/android/snapshot.d.ts +0 -1
- package/dist/src/platforms/ios/config.d.ts +1 -0
- package/dist/src/platforms/ios/index.d.ts +1 -1
- package/dist/src/platforms/ios/screenshot-status-bar.d.ts +2 -0
- package/dist/src/platforms/ios/screenshot.d.ts +2 -1
- package/dist/src/utils/command-schema.d.ts +2 -0
- package/dist/src/utils/device.d.ts +1 -1
- package/dist/src/utils/interactors.d.ts +7 -0
- package/dist/src/utils/output.d.ts +3 -1
- package/dist/src/utils/path-resolution.d.ts +8 -0
- package/dist/src/utils/screenshot-diff.d.ts +23 -0
- package/package.json +5 -5
- package/skills/agent-device/SKILL.md +4 -0
- package/skills/agent-device/references/snapshot-refs.md +1 -0
- package/skills/dogfood/SKILL.md +12 -12
- package/skills/dogfood/references/issue-taxonomy.md +5 -5
- package/skills/dogfood/templates/dogfood-report-template.md +19 -19
- package/dist/src/utils/interactive.d.ts +0 -1
package/dist/src/bin.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import{formatSnapshotLine as e,SETTINGS_USAGE_OVERRIDE as t,styleText as s,parseBatchStepsJson as o,buildSnapshotDisplayLines as i}from"./274.js";import{createRequestId as a,node_path as r,asAppError as n,normalizeError as l,pathToFileURL as p,AppError as d,node_fs as u,node_os as c,readVersion as g,withDiagnosticsScope as m,getDiagnosticsMeta as f,flushDiagnosticsToSessionFile as h,resolveDaemonPaths as y,emitDiagnostic as v}from"./331.js";import{createAgentDeviceClient as w,sendToDaemon as b}from"./224.js";let k=["snapshotInteractiveOnly","snapshotCompact","snapshotDepth","snapshotScope","snapshotRaw"],$=["snapshotDepth","snapshotScope","snapshotRaw"],S=[{key:"config",names:["--config"],type:"string",usageLabel:"--config <path>",usageDescription:"Load CLI defaults from a specific config file"},{key:"stateDir",names:["--state-dir"],type:"string",usageLabel:"--state-dir <path>",usageDescription:"Daemon state directory (defaults to ~/.agent-device)"},{key:"daemonBaseUrl",names:["--daemon-base-url"],type:"string",usageLabel:"--daemon-base-url <url>",usageDescription:"Explicit remote HTTP daemon base URL (skip local daemon discovery/startup)"},{key:"daemonAuthToken",names:["--daemon-auth-token"],type:"string",usageLabel:"--daemon-auth-token <token>",usageDescription:"Remote HTTP daemon auth token (sent as request token and bearer header)"},{key:"daemonTransport",names:["--daemon-transport"],type:"enum",enumValues:["auto","socket","http"],usageLabel:"--daemon-transport auto|socket|http",usageDescription:"Daemon client transport preference"},{key:"daemonServerMode",names:["--daemon-server-mode"],type:"enum",enumValues:["socket","http","dual"],usageLabel:"--daemon-server-mode socket|http|dual",usageDescription:"Daemon server mode used when spawning daemon"},{key:"tenant",names:["--tenant"],type:"string",usageLabel:"--tenant <id>",usageDescription:"Tenant scope identifier for isolated daemon sessions"},{key:"sessionIsolation",names:["--session-isolation"],type:"enum",enumValues:["none","tenant"],usageLabel:"--session-isolation none|tenant",usageDescription:"Session isolation strategy (tenant prefixes session namespace)"},{key:"runId",names:["--run-id"],type:"string",usageLabel:"--run-id <id>",usageDescription:"Run identifier used for tenant lease admission checks"},{key:"leaseId",names:["--lease-id"],type:"string",usageLabel:"--lease-id <id>",usageDescription:"Lease identifier bound to tenant/run admission scope"},{key:"sessionLock",names:["--session-lock"],type:"enum",enumValues:["reject","strip"],usageLabel:"--session-lock reject|strip",usageDescription:"Lock bound-session device routing for this CLI invocation and nested batch steps"},{key:"sessionLocked",names:["--session-locked"],type:"boolean",usageLabel:"--session-locked",usageDescription:"Deprecated alias for --session-lock reject"},{key:"sessionLockConflicts",names:["--session-lock-conflicts"],type:"enum",enumValues:["reject","strip"],usageLabel:"--session-lock-conflicts reject|strip",usageDescription:"Deprecated alias for --session-lock"},{key:"platform",names:["--platform"],type:"enum",enumValues:["ios","android","apple"],usageLabel:"--platform ios|android|apple",usageDescription:"Platform to target (`apple` aliases the iOS/tvOS backend)"},{key:"target",names:["--target"],type:"enum",enumValues:["mobile","tv"],usageLabel:"--target mobile|tv",usageDescription:"Device target class to match"},{key:"device",names:["--device"],type:"string",usageLabel:"--device <name>",usageDescription:"Device name to target"},{key:"udid",names:["--udid"],type:"string",usageLabel:"--udid <udid>",usageDescription:"iOS device UDID"},{key:"serial",names:["--serial"],type:"string",usageLabel:"--serial <serial>",usageDescription:"Android device serial"},{key:"headless",names:["--headless"],type:"boolean",usageLabel:"--headless",usageDescription:"Boot: launch Android emulator without a GUI window"},{key:"runtime",names:["--runtime"],type:"string",usageLabel:"--runtime <id>",usageDescription:"ensure-simulator: CoreSimulator runtime identifier (e.g. com.apple.CoreSimulator.SimRuntime.iOS-18-0)"},{key:"metroHost",names:["--metro-host"],type:"string",usageLabel:"--metro-host <host>",usageDescription:"runtime set: session-scoped Metro/debug host hint"},{key:"metroPort",names:["--metro-port"],type:"int",min:1,max:65535,usageLabel:"--metro-port <port>",usageDescription:"runtime set: session-scoped Metro/debug port hint"},{key:"bundleUrl",names:["--bundle-url"],type:"string",usageLabel:"--bundle-url <url>",usageDescription:"runtime set: session-scoped bundle URL hint"},{key:"launchUrl",names:["--launch-url"],type:"string",usageLabel:"--launch-url <url>",usageDescription:"runtime set: session-scoped deep link / launch URL hint"},{key:"boot",names:["--boot"],type:"boolean",usageLabel:"--boot",usageDescription:"ensure-simulator: boot the simulator after ensuring it exists"},{key:"reuseExisting",names:["--reuse-existing"],type:"boolean",usageLabel:"--reuse-existing",usageDescription:"ensure-simulator: reuse an existing simulator (default: true)"},{key:"iosSimulatorDeviceSet",names:["--ios-simulator-device-set"],type:"string",usageLabel:"--ios-simulator-device-set <path>",usageDescription:"Scope iOS simulator discovery/commands to this simulator device set"},{key:"androidDeviceAllowlist",names:["--android-device-allowlist"],type:"string",usageLabel:"--android-device-allowlist <serials>",usageDescription:"Comma/space separated Android serial allowlist for discovery/selection"},{key:"activity",names:["--activity"],type:"string",usageLabel:"--activity <component>",usageDescription:"Android app launch activity (package/Activity); not for URL opens"},{key:"session",names:["--session"],type:"string",usageLabel:"--session <name>",usageDescription:"Named session"},{key:"count",names:["--count"],type:"int",min:1,max:200,usageLabel:"--count <n>",usageDescription:"Repeat count for press/swipe series"},{key:"fps",names:["--fps"],type:"int",min:1,max:120,usageLabel:"--fps <n>",usageDescription:"Record: target frames per second (iOS physical device runner)"},{key:"intervalMs",names:["--interval-ms"],type:"int",min:0,max:1e4,usageLabel:"--interval-ms <ms>",usageDescription:"Delay between press iterations"},{key:"holdMs",names:["--hold-ms"],type:"int",min:0,max:1e4,usageLabel:"--hold-ms <ms>",usageDescription:"Press hold duration for each iteration"},{key:"jitterPx",names:["--jitter-px"],type:"int",min:0,max:100,usageLabel:"--jitter-px <n>",usageDescription:"Deterministic coordinate jitter radius for press"},{key:"doubleTap",names:["--double-tap"],type:"boolean",usageLabel:"--double-tap",usageDescription:"Use double-tap gesture per press iteration"},{key:"pauseMs",names:["--pause-ms"],type:"int",min:0,max:1e4,usageLabel:"--pause-ms <ms>",usageDescription:"Delay between swipe iterations"},{key:"pattern",names:["--pattern"],type:"enum",enumValues:["one-way","ping-pong"],usageLabel:"--pattern one-way|ping-pong",usageDescription:"Swipe repeat pattern"},{key:"verbose",names:["--debug","--verbose","-v"],type:"boolean",usageLabel:"--debug, --verbose, -v",usageDescription:"Enable debug diagnostics and stream daemon/runner logs"},{key:"json",names:["--json"],type:"boolean",usageLabel:"--json",usageDescription:"JSON output"},{key:"help",names:["--help","-h"],type:"boolean",usageLabel:"--help, -h",usageDescription:"Print help and exit"},{key:"version",names:["--version","-V"],type:"boolean",usageLabel:"--version, -V",usageDescription:"Print version and exit"},{key:"saveScript",names:["--save-script"],type:"booleanOrString",usageLabel:"--save-script [path]",usageDescription:"Save session script (.ad) on close; optional custom output path"},{key:"shutdown",names:["--shutdown"],type:"boolean",usageLabel:"--shutdown",usageDescription:"close: shutdown associated iOS simulator after ending session"},{key:"relaunch",names:["--relaunch"],type:"boolean",usageLabel:"--relaunch",usageDescription:"open: terminate app process before launching it"},{key:"restart",names:["--restart"],type:"boolean",usageLabel:"--restart",usageDescription:"logs clear: stop active stream, clear logs, then start streaming again"},{key:"noRecord",names:["--no-record"],type:"boolean",usageLabel:"--no-record",usageDescription:"Do not record this action"},{key:"replayUpdate",names:["--update","-u"],type:"boolean",usageLabel:"--update, -u",usageDescription:"Replay: update selectors and rewrite replay file in place"},{key:"steps",names:["--steps"],type:"string",usageLabel:"--steps <json>",usageDescription:"Batch: JSON array of steps"},{key:"stepsFile",names:["--steps-file"],type:"string",usageLabel:"--steps-file <path>",usageDescription:"Batch: read steps JSON from file"},{key:"batchOnError",names:["--on-error"],type:"enum",enumValues:["stop"],usageLabel:"--on-error stop",usageDescription:"Batch: stop when a step fails"},{key:"batchMaxSteps",names:["--max-steps"],type:"int",min:1,max:1e3,usageLabel:"--max-steps <n>",usageDescription:"Batch: maximum number of allowed steps"},{key:"appsFilter",names:["--user-installed"],type:"enum",setValue:"user-installed",usageLabel:"--user-installed",usageDescription:"Apps: list user-installed apps"},{key:"appsFilter",names:["--all"],type:"enum",setValue:"all",usageLabel:"--all",usageDescription:"Apps: list all apps (include system/default apps)"},{key:"snapshotInteractiveOnly",names:["-i"],type:"boolean",usageLabel:"-i",usageDescription:"Snapshot: interactive elements only"},{key:"snapshotCompact",names:["-c"],type:"boolean",usageLabel:"-c",usageDescription:"Snapshot: compact output (drop empty structure)"},{key:"snapshotDepth",names:["--depth","-d"],type:"int",min:0,usageLabel:"--depth, -d <depth>",usageDescription:"Snapshot: limit snapshot depth"},{key:"snapshotScope",names:["--scope","-s"],type:"string",usageLabel:"--scope, -s <scope>",usageDescription:"Snapshot: scope snapshot to label/identifier"},{key:"snapshotRaw",names:["--raw"],type:"boolean",usageLabel:"--raw",usageDescription:"Snapshot: raw node output"},{key:"out",names:["--out"],type:"string",usageLabel:"--out <path>",usageDescription:"Output path"}],A=new Set(["json","config","stateDir","daemonBaseUrl","daemonAuthToken","daemonTransport","daemonServerMode","tenant","sessionIsolation","runId","leaseId","sessionLock","sessionLocked","sessionLockConflicts","help","version","verbose","platform","target","device","udid","serial","iosSimulatorDeviceSet","androidDeviceAllowlist","session","noRecord"]),I={boot:{description:"Ensure target device/simulator is booted and ready",positionalArgs:[],allowedFlags:["headless"]},open:{description:"Boot device/simulator; optionally launch app or deep link URL",positionalArgs:["appOrUrl?","url?"],allowedFlags:["activity","saveScript","relaunch"]},close:{description:"Close app or just end session",positionalArgs:["app?"],allowedFlags:["saveScript","shutdown"]},reinstall:{description:"Uninstall + install app from binary path",positionalArgs:["app","path"],allowedFlags:[]},install:{description:"Install app from binary path without uninstalling first",positionalArgs:["app","path"],allowedFlags:[]},push:{description:"Simulate push notification payload delivery",positionalArgs:["bundleOrPackage","payloadOrJson"],allowedFlags:[]},snapshot:{description:"Capture accessibility tree",positionalArgs:[],allowedFlags:[...k]},diff:{usageOverride:"diff snapshot",description:"Diff current accessibility snapshot against previous baseline",positionalArgs:["kind"],allowedFlags:[...k]},"ensure-simulator":{description:"Ensure an iOS simulator exists in a device set (create if missing)",positionalArgs:[],allowedFlags:["runtime","boot","reuseExisting"],skipCapabilityCheck:!0},devices:{description:"List available devices",positionalArgs:[],allowedFlags:[],skipCapabilityCheck:!0},apps:{description:"List installed apps (includes default/system apps by default)",positionalArgs:[],allowedFlags:["appsFilter"],defaults:{appsFilter:"all"}},appstate:{description:"Show foreground app/activity",positionalArgs:[],allowedFlags:[],skipCapabilityCheck:!0},runtime:{usageOverride:"runtime set|show|clear",description:"Manage session-scoped runtime hints",positionalArgs:["set|show|clear"],allowedFlags:["metroHost","metroPort","bundleUrl","launchUrl"],skipCapabilityCheck:!0},clipboard:{usageOverride:"clipboard read | clipboard write <text>",description:"Read or write device clipboard text",positionalArgs:["read|write","text?"],allowsExtraPositionals:!0,allowedFlags:[]},keyboard:{usageOverride:"keyboard [status|get|dismiss]",description:"Inspect Android keyboard visibility/type or dismiss it",positionalArgs:["action?"],allowedFlags:[]},perf:{description:"Show session performance metrics (startup timing)",positionalArgs:[],allowedFlags:[]},back:{description:"Navigate back (where supported)",positionalArgs:[],allowedFlags:[]},home:{description:"Go to home screen (where supported)",positionalArgs:[],allowedFlags:[]},"app-switcher":{description:"Open app switcher (where supported)",positionalArgs:[],allowedFlags:[]},wait:{usageOverride:"wait <ms>|text <text>|@ref|<selector> [timeoutMs]",description:"Wait for duration, text, ref, or selector to appear",positionalArgs:["durationOrSelector","timeoutMs?"],allowsExtraPositionals:!0,allowedFlags:[...$]},alert:{usageOverride:"alert [get|accept|dismiss|wait] [timeout]",description:"Inspect or handle alert (iOS simulator)",positionalArgs:["action?","timeout?"],allowedFlags:[]},click:{usageOverride:"click <x y|@ref|selector>",description:"Tap/click by coordinates, snapshot ref, or selector",positionalArgs:["target"],allowsExtraPositionals:!0,allowedFlags:["count","intervalMs","holdMs","jitterPx","doubleTap",...$]},get:{usageOverride:"get text|attrs <@ref|selector>",description:"Return element text/attributes by ref or selector",positionalArgs:["subcommand","target"],allowedFlags:[...$]},replay:{description:"Replay a recorded session",positionalArgs:["path"],allowedFlags:["replayUpdate"],skipCapabilityCheck:!0},batch:{usageOverride:"batch [--steps <json> | --steps-file <path>]",description:"Execute multiple commands in one daemon request",positionalArgs:[],allowedFlags:["steps","stepsFile","batchOnError","batchMaxSteps","out"],skipCapabilityCheck:!0},press:{usageOverride:"press <x y|@ref|selector>",description:"Tap/press by coordinates, snapshot ref, or selector (supports repeated series)",positionalArgs:["targetOrX","y?"],allowsExtraPositionals:!0,allowedFlags:["count","intervalMs","holdMs","jitterPx","doubleTap",...$]},longpress:{description:"Long press by coordinates (iOS and Android)",positionalArgs:["x","y","durationMs?"],allowedFlags:[]},swipe:{description:"Swipe coordinates with optional repeat pattern",positionalArgs:["x1","y1","x2","y2","durationMs?"],allowedFlags:["count","pauseMs","pattern"]},focus:{description:"Focus input at coordinates",positionalArgs:["x","y"],allowedFlags:[]},type:{description:"Type text in focused field",positionalArgs:["text"],allowsExtraPositionals:!0,allowedFlags:[]},fill:{usageOverride:"fill <x> <y> <text> | fill <@ref|selector> <text>",description:"Tap then type",positionalArgs:["targetOrX","yOrText","text?"],allowsExtraPositionals:!0,allowedFlags:[...$]},scroll:{description:"Scroll in direction (0-1 amount)",positionalArgs:["direction","amount?"],allowedFlags:[]},scrollintoview:{usageOverride:"scrollintoview <text|@ref>",description:"Scroll until text appears or a snapshot ref is brought into view",positionalArgs:["target"],allowsExtraPositionals:!0,allowedFlags:[]},pinch:{description:"Pinch/zoom gesture (iOS simulator)",positionalArgs:["scale","x?","y?"],allowedFlags:[]},screenshot:{description:"Capture screenshot",positionalArgs:["path?"],allowedFlags:["out"]},"trigger-app-event":{usageOverride:"trigger-app-event <event> [payloadJson]",description:"Trigger app-defined event hook via deep link template",positionalArgs:["event","payloadJson?"],allowedFlags:[]},record:{usageOverride:"record start [path] [--fps <n>] | record stop",description:"Start/stop screen recording",positionalArgs:["start|stop","path?"],allowedFlags:["fps"]},trace:{usageOverride:"trace start [path] | trace stop [path]",description:"Start/stop trace log capture",positionalArgs:["start|stop","path?"],allowedFlags:[],skipCapabilityCheck:!0},logs:{usageOverride:"logs path | logs start | logs stop | logs clear [--restart] | logs doctor | logs mark [message...]",description:"Session app log info, start/stop streaming, diagnostics, and markers",positionalArgs:["path|start|stop|clear|doctor|mark","message?"],allowsExtraPositionals:!0,allowedFlags:["restart"]},network:{usageOverride:"network dump [limit] [summary|headers|body|all] | network log [limit] [summary|headers|body|all]",description:"Dump recent HTTP(s) traffic parsed from the session app log",positionalArgs:["dump|log","limit?","include?"],allowedFlags:[]},find:{usageOverride:"find <locator|text> <action> [value]",description:"Find by text/label/value/role/id and run action",positionalArgs:["query","action","value?"],allowsExtraPositionals:!0,allowedFlags:["snapshotDepth","snapshotRaw"]},is:{description:"Assert UI state (visible|hidden|exists|editable|selected|text)",positionalArgs:["predicate","selector","value?"],allowsExtraPositionals:!0,allowedFlags:[...$]},settings:{usageOverride:t,description:"Toggle OS settings, appearance, and app permissions (session app scope for permission actions)",positionalArgs:["setting","state","target?","mode?"],allowedFlags:[]},session:{usageOverride:"session list",description:"List active sessions",positionalArgs:["list?"],allowedFlags:[],skipCapabilityCheck:!0}},D=new Map,L=new Map;for(let e of S){for(let t of e.names)D.set(t,e);let t=L.get(e.key);t?t.push(e):L.set(e.key,[e])}function x(e){if(e)return I[e]}function O(){return Object.keys(I)}function N(e){let t=e.endsWith("?"),s=t?e.slice(0,-1):e;return t?`[${s}]`:`<${s}>`}function _(e,t){return t.usageOverride?t.usageOverride:[e,...t.positionalArgs.map(N),...t.allowedFlags.flatMap(e=>(L.get(e)??[]).map(e=>e.usageLabel??e.names[0])).map(e=>`[${e}]`)].join(" ")}let F=function(){let e=`agent-device <command> [args] [--json]
|
|
1
|
+
import{PNG as e}from"pngjs";import{formatSnapshotLine as t,SETTINGS_USAGE_OVERRIDE as s,styleText as i,parseBatchStepsJson as o,buildSnapshotDisplayLines as a}from"./274.js";import{createRequestId as r,node_path as n,normalizeError as l,resolveUserPath as d,readVersion as p,getDiagnosticsMeta as u,emitDiagnostic as c,promises as g,asAppError as f,expandUserHomePath as m,pathToFileURL as h,AppError as y,node_fs as w,node_os as v,withDiagnosticsScope as b,flushDiagnosticsToSessionFile as $,resolveDaemonPaths as k}from"./331.js";import{serializeOpenResult as S,sendToDaemon as A,serializeSessionListEntry as D,serializeDeployResult as I,serializeSnapshotResult as L,serializeCloseResult as x,serializeRuntimeResult as N,serializeEnsureSimulatorResult as O,createAgentDeviceClient as F,serializeDevice as _}from"./224.js";let E=["snapshotInteractiveOnly","snapshotCompact","snapshotDepth","snapshotScope","snapshotRaw"],C=["snapshotDepth","snapshotScope","snapshotRaw"],j=[{key:"config",names:["--config"],type:"string",usageLabel:"--config <path>",usageDescription:"Load CLI defaults from a specific config file"},{key:"stateDir",names:["--state-dir"],type:"string",usageLabel:"--state-dir <path>",usageDescription:"Daemon state directory (defaults to ~/.agent-device)"},{key:"daemonBaseUrl",names:["--daemon-base-url"],type:"string",usageLabel:"--daemon-base-url <url>",usageDescription:"Explicit remote HTTP daemon base URL (skip local daemon discovery/startup)"},{key:"daemonAuthToken",names:["--daemon-auth-token"],type:"string",usageLabel:"--daemon-auth-token <token>",usageDescription:"Remote HTTP daemon auth token (sent as request token and bearer header)"},{key:"daemonTransport",names:["--daemon-transport"],type:"enum",enumValues:["auto","socket","http"],usageLabel:"--daemon-transport auto|socket|http",usageDescription:"Daemon client transport preference"},{key:"daemonServerMode",names:["--daemon-server-mode"],type:"enum",enumValues:["socket","http","dual"],usageLabel:"--daemon-server-mode socket|http|dual",usageDescription:"Daemon server mode used when spawning daemon"},{key:"tenant",names:["--tenant"],type:"string",usageLabel:"--tenant <id>",usageDescription:"Tenant scope identifier for isolated daemon sessions"},{key:"sessionIsolation",names:["--session-isolation"],type:"enum",enumValues:["none","tenant"],usageLabel:"--session-isolation none|tenant",usageDescription:"Session isolation strategy (tenant prefixes session namespace)"},{key:"runId",names:["--run-id"],type:"string",usageLabel:"--run-id <id>",usageDescription:"Run identifier used for tenant lease admission checks"},{key:"leaseId",names:["--lease-id"],type:"string",usageLabel:"--lease-id <id>",usageDescription:"Lease identifier bound to tenant/run admission scope"},{key:"sessionLock",names:["--session-lock"],type:"enum",enumValues:["reject","strip"],usageLabel:"--session-lock reject|strip",usageDescription:"Lock bound-session device routing for this CLI invocation and nested batch steps"},{key:"sessionLocked",names:["--session-locked"],type:"boolean",usageLabel:"--session-locked",usageDescription:"Deprecated alias for --session-lock reject"},{key:"sessionLockConflicts",names:["--session-lock-conflicts"],type:"enum",enumValues:["reject","strip"],usageLabel:"--session-lock-conflicts reject|strip",usageDescription:"Deprecated alias for --session-lock"},{key:"platform",names:["--platform"],type:"enum",enumValues:["ios","android","apple"],usageLabel:"--platform ios|android|apple",usageDescription:"Platform to target (`apple` aliases the iOS/tvOS backend)"},{key:"target",names:["--target"],type:"enum",enumValues:["mobile","tv"],usageLabel:"--target mobile|tv",usageDescription:"Device target class to match"},{key:"device",names:["--device"],type:"string",usageLabel:"--device <name>",usageDescription:"Device name to target"},{key:"udid",names:["--udid"],type:"string",usageLabel:"--udid <udid>",usageDescription:"iOS device UDID"},{key:"serial",names:["--serial"],type:"string",usageLabel:"--serial <serial>",usageDescription:"Android device serial"},{key:"headless",names:["--headless"],type:"boolean",usageLabel:"--headless",usageDescription:"Boot: launch Android emulator without a GUI window"},{key:"runtime",names:["--runtime"],type:"string",usageLabel:"--runtime <id>",usageDescription:"ensure-simulator: CoreSimulator runtime identifier (e.g. com.apple.CoreSimulator.SimRuntime.iOS-18-0)"},{key:"metroHost",names:["--metro-host"],type:"string",usageLabel:"--metro-host <host>",usageDescription:"runtime set: session-scoped Metro/debug host hint"},{key:"metroPort",names:["--metro-port"],type:"int",min:1,max:65535,usageLabel:"--metro-port <port>",usageDescription:"runtime set: session-scoped Metro/debug port hint"},{key:"bundleUrl",names:["--bundle-url"],type:"string",usageLabel:"--bundle-url <url>",usageDescription:"runtime set: session-scoped bundle URL hint"},{key:"launchUrl",names:["--launch-url"],type:"string",usageLabel:"--launch-url <url>",usageDescription:"runtime set: session-scoped deep link / launch URL hint"},{key:"boot",names:["--boot"],type:"boolean",usageLabel:"--boot",usageDescription:"ensure-simulator: boot the simulator after ensuring it exists"},{key:"reuseExisting",names:["--reuse-existing"],type:"boolean",usageLabel:"--reuse-existing",usageDescription:"ensure-simulator: reuse an existing simulator (default: true)"},{key:"iosSimulatorDeviceSet",names:["--ios-simulator-device-set"],type:"string",usageLabel:"--ios-simulator-device-set <path>",usageDescription:"Scope iOS simulator discovery/commands to this simulator device set"},{key:"androidDeviceAllowlist",names:["--android-device-allowlist"],type:"string",usageLabel:"--android-device-allowlist <serials>",usageDescription:"Comma/space separated Android serial allowlist for discovery/selection"},{key:"activity",names:["--activity"],type:"string",usageLabel:"--activity <component>",usageDescription:"Android app launch activity (package/Activity); not for URL opens"},{key:"session",names:["--session"],type:"string",usageLabel:"--session <name>",usageDescription:"Named session"},{key:"count",names:["--count"],type:"int",min:1,max:200,usageLabel:"--count <n>",usageDescription:"Repeat count for press/swipe series"},{key:"fps",names:["--fps"],type:"int",min:1,max:120,usageLabel:"--fps <n>",usageDescription:"Record: target frames per second (iOS physical device runner)"},{key:"intervalMs",names:["--interval-ms"],type:"int",min:0,max:1e4,usageLabel:"--interval-ms <ms>",usageDescription:"Delay between press iterations"},{key:"holdMs",names:["--hold-ms"],type:"int",min:0,max:1e4,usageLabel:"--hold-ms <ms>",usageDescription:"Press hold duration for each iteration"},{key:"jitterPx",names:["--jitter-px"],type:"int",min:0,max:100,usageLabel:"--jitter-px <n>",usageDescription:"Deterministic coordinate jitter radius for press"},{key:"doubleTap",names:["--double-tap"],type:"boolean",usageLabel:"--double-tap",usageDescription:"Use double-tap gesture per press iteration"},{key:"pauseMs",names:["--pause-ms"],type:"int",min:0,max:1e4,usageLabel:"--pause-ms <ms>",usageDescription:"Delay between swipe iterations"},{key:"pattern",names:["--pattern"],type:"enum",enumValues:["one-way","ping-pong"],usageLabel:"--pattern one-way|ping-pong",usageDescription:"Swipe repeat pattern"},{key:"verbose",names:["--debug","--verbose","-v"],type:"boolean",usageLabel:"--debug, --verbose, -v",usageDescription:"Enable debug diagnostics and stream daemon/runner logs"},{key:"json",names:["--json"],type:"boolean",usageLabel:"--json",usageDescription:"JSON output"},{key:"help",names:["--help","-h"],type:"boolean",usageLabel:"--help, -h",usageDescription:"Print help and exit"},{key:"version",names:["--version","-V"],type:"boolean",usageLabel:"--version, -V",usageDescription:"Print version and exit"},{key:"saveScript",names:["--save-script"],type:"booleanOrString",usageLabel:"--save-script [path]",usageDescription:"Save session script (.ad) on close; optional custom output path"},{key:"shutdown",names:["--shutdown"],type:"boolean",usageLabel:"--shutdown",usageDescription:"close: shutdown associated iOS simulator after ending session"},{key:"relaunch",names:["--relaunch"],type:"boolean",usageLabel:"--relaunch",usageDescription:"open: terminate app process before launching it"},{key:"restart",names:["--restart"],type:"boolean",usageLabel:"--restart",usageDescription:"logs clear: stop active stream, clear logs, then start streaming again"},{key:"noRecord",names:["--no-record"],type:"boolean",usageLabel:"--no-record",usageDescription:"Do not record this action"},{key:"replayUpdate",names:["--update","-u"],type:"boolean",usageLabel:"--update, -u",usageDescription:"Replay: update selectors and rewrite replay file in place"},{key:"steps",names:["--steps"],type:"string",usageLabel:"--steps <json>",usageDescription:"Batch: JSON array of steps"},{key:"stepsFile",names:["--steps-file"],type:"string",usageLabel:"--steps-file <path>",usageDescription:"Batch: read steps JSON from file"},{key:"batchOnError",names:["--on-error"],type:"enum",enumValues:["stop"],usageLabel:"--on-error stop",usageDescription:"Batch: stop when a step fails"},{key:"batchMaxSteps",names:["--max-steps"],type:"int",min:1,max:1e3,usageLabel:"--max-steps <n>",usageDescription:"Batch: maximum number of allowed steps"},{key:"appsFilter",names:["--user-installed"],type:"enum",setValue:"user-installed",usageLabel:"--user-installed",usageDescription:"Apps: list user-installed apps"},{key:"appsFilter",names:["--all"],type:"enum",setValue:"all",usageLabel:"--all",usageDescription:"Apps: list all apps (include system/default apps)"},{key:"snapshotInteractiveOnly",names:["-i"],type:"boolean",usageLabel:"-i",usageDescription:"Snapshot: interactive elements only"},{key:"snapshotCompact",names:["-c"],type:"boolean",usageLabel:"-c",usageDescription:"Snapshot: compact output (drop empty structure)"},{key:"snapshotDepth",names:["--depth","-d"],type:"int",min:0,usageLabel:"--depth, -d <depth>",usageDescription:"Snapshot: limit snapshot depth"},{key:"snapshotScope",names:["--scope","-s"],type:"string",usageLabel:"--scope, -s <scope>",usageDescription:"Snapshot: scope snapshot to label/identifier"},{key:"snapshotRaw",names:["--raw"],type:"boolean",usageLabel:"--raw",usageDescription:"Snapshot: raw node output"},{key:"out",names:["--out"],type:"string",usageLabel:"--out <path>",usageDescription:"Output path"},{key:"baseline",names:["--baseline","-b"],type:"string",usageLabel:"--baseline, -b <path>",usageDescription:"Diff screenshot: path to baseline image file"},{key:"threshold",names:["--threshold"],type:"string",usageLabel:"--threshold <0-1>",usageDescription:"Diff screenshot: color distance threshold (default 0.1)"}],P=new Set(["json","config","stateDir","daemonBaseUrl","daemonAuthToken","daemonTransport","daemonServerMode","tenant","sessionIsolation","runId","leaseId","sessionLock","sessionLocked","sessionLockConflicts","help","version","verbose","platform","target","device","udid","serial","iosSimulatorDeviceSet","androidDeviceAllowlist","session","noRecord"]),R={boot:{description:"Ensure target device/simulator is booted and ready",positionalArgs:[],allowedFlags:["headless"]},open:{description:"Boot device/simulator; optionally launch app or deep link URL",positionalArgs:["appOrUrl?","url?"],allowedFlags:["activity","saveScript","relaunch"]},close:{description:"Close app or just end session",positionalArgs:["app?"],allowedFlags:["saveScript","shutdown"]},reinstall:{description:"Uninstall + install app from binary path",positionalArgs:["app","path"],allowedFlags:[]},install:{description:"Install app from binary path without uninstalling first",positionalArgs:["app","path"],allowedFlags:[]},push:{description:"Simulate push notification payload delivery",positionalArgs:["bundleOrPackage","payloadOrJson"],allowedFlags:[]},snapshot:{description:"Capture accessibility tree",positionalArgs:[],allowedFlags:[...E]},diff:{usageOverride:"diff snapshot | diff screenshot --baseline <path> [--out <diff.png>] [--threshold <0-1>]",description:"Diff accessibility snapshot or compare screenshots pixel-by-pixel",positionalArgs:["kind"],allowedFlags:[...E,"baseline","threshold","out"]},"ensure-simulator":{description:"Ensure an iOS simulator exists in a device set (create if missing)",positionalArgs:[],allowedFlags:["runtime","boot","reuseExisting"],skipCapabilityCheck:!0},devices:{description:"List available devices",positionalArgs:[],allowedFlags:[],skipCapabilityCheck:!0},apps:{description:"List installed apps (includes default/system apps by default)",positionalArgs:[],allowedFlags:["appsFilter"],defaults:{appsFilter:"all"}},appstate:{description:"Show foreground app/activity",positionalArgs:[],allowedFlags:[],skipCapabilityCheck:!0},runtime:{usageOverride:"runtime set|show|clear",description:"Manage session-scoped runtime hints",positionalArgs:["set|show|clear"],allowedFlags:["metroHost","metroPort","bundleUrl","launchUrl"],skipCapabilityCheck:!0},clipboard:{usageOverride:"clipboard read | clipboard write <text>",description:"Read or write device clipboard text",positionalArgs:["read|write","text?"],allowsExtraPositionals:!0,allowedFlags:[]},keyboard:{usageOverride:"keyboard [status|get|dismiss]",description:"Inspect Android keyboard visibility/type or dismiss it",positionalArgs:["action?"],allowedFlags:[]},perf:{description:"Show session performance metrics (startup timing)",positionalArgs:[],allowedFlags:[]},back:{description:"Navigate back (where supported)",positionalArgs:[],allowedFlags:[]},home:{description:"Go to home screen (where supported)",positionalArgs:[],allowedFlags:[]},"app-switcher":{description:"Open app switcher (where supported)",positionalArgs:[],allowedFlags:[]},wait:{usageOverride:"wait <ms>|text <text>|@ref|<selector> [timeoutMs]",description:"Wait for duration, text, ref, or selector to appear",positionalArgs:["durationOrSelector","timeoutMs?"],allowsExtraPositionals:!0,allowedFlags:[...C]},alert:{usageOverride:"alert [get|accept|dismiss|wait] [timeout]",description:"Inspect or handle alert (iOS simulator)",positionalArgs:["action?","timeout?"],allowedFlags:[]},click:{usageOverride:"click <x y|@ref|selector>",description:"Tap/click by coordinates, snapshot ref, or selector",positionalArgs:["target"],allowsExtraPositionals:!0,allowedFlags:["count","intervalMs","holdMs","jitterPx","doubleTap",...C]},get:{usageOverride:"get text|attrs <@ref|selector>",description:"Return element text/attributes by ref or selector",positionalArgs:["subcommand","target"],allowedFlags:[...C]},replay:{description:"Replay a recorded session",positionalArgs:["path"],allowedFlags:["replayUpdate"],skipCapabilityCheck:!0},batch:{usageOverride:"batch [--steps <json> | --steps-file <path>]",description:"Execute multiple commands in one daemon request",positionalArgs:[],allowedFlags:["steps","stepsFile","batchOnError","batchMaxSteps","out"],skipCapabilityCheck:!0},press:{usageOverride:"press <x y|@ref|selector>",description:"Tap/press by coordinates, snapshot ref, or selector (supports repeated series)",positionalArgs:["targetOrX","y?"],allowsExtraPositionals:!0,allowedFlags:["count","intervalMs","holdMs","jitterPx","doubleTap",...C]},longpress:{description:"Long press by coordinates (iOS and Android)",positionalArgs:["x","y","durationMs?"],allowedFlags:[]},swipe:{description:"Swipe coordinates with optional repeat pattern",positionalArgs:["x1","y1","x2","y2","durationMs?"],allowedFlags:["count","pauseMs","pattern"]},focus:{description:"Focus input at coordinates",positionalArgs:["x","y"],allowedFlags:[]},type:{description:"Type text in focused field",positionalArgs:["text"],allowsExtraPositionals:!0,allowedFlags:[]},fill:{usageOverride:"fill <x> <y> <text> | fill <@ref|selector> <text>",description:"Tap then type",positionalArgs:["targetOrX","yOrText","text?"],allowsExtraPositionals:!0,allowedFlags:[...C]},scroll:{description:"Scroll in direction (0-1 amount)",positionalArgs:["direction","amount?"],allowedFlags:[]},scrollintoview:{usageOverride:"scrollintoview <text|@ref>",description:"Scroll until text appears or a snapshot ref is brought into view",positionalArgs:["target"],allowsExtraPositionals:!0,allowedFlags:[]},pinch:{description:"Pinch/zoom gesture (iOS simulator)",positionalArgs:["scale","x?","y?"],allowedFlags:[]},screenshot:{description:"Capture screenshot",positionalArgs:["path?"],allowedFlags:["out"]},"trigger-app-event":{usageOverride:"trigger-app-event <event> [payloadJson]",description:"Trigger app-defined event hook via deep link template",positionalArgs:["event","payloadJson?"],allowedFlags:[]},record:{usageOverride:"record start [path] [--fps <n>] | record stop",description:"Start/stop screen recording",positionalArgs:["start|stop","path?"],allowedFlags:["fps"]},trace:{usageOverride:"trace start [path] | trace stop [path]",description:"Start/stop trace log capture",positionalArgs:["start|stop","path?"],allowedFlags:[],skipCapabilityCheck:!0},logs:{usageOverride:"logs path | logs start | logs stop | logs clear [--restart] | logs doctor | logs mark [message...]",description:"Session app log info, start/stop streaming, diagnostics, and markers",positionalArgs:["path|start|stop|clear|doctor|mark","message?"],allowsExtraPositionals:!0,allowedFlags:["restart"]},network:{usageOverride:"network dump [limit] [summary|headers|body|all] | network log [limit] [summary|headers|body|all]",description:"Dump recent HTTP(s) traffic parsed from the session app log",positionalArgs:["dump|log","limit?","include?"],allowedFlags:[]},find:{usageOverride:"find <locator|text> <action> [value]",description:"Find by text/label/value/role/id and run action",positionalArgs:["query","action","value?"],allowsExtraPositionals:!0,allowedFlags:["snapshotDepth","snapshotRaw"]},is:{description:"Assert UI state (visible|hidden|exists|editable|selected|text)",positionalArgs:["predicate","selector","value?"],allowsExtraPositionals:!0,allowedFlags:[...C]},settings:{usageOverride:s,description:"Toggle OS settings, appearance, and app permissions (session app scope for permission actions)",positionalArgs:["setting","state","target?","mode?"],allowedFlags:[]},session:{usageOverride:"session list",description:"List active sessions",positionalArgs:["list?"],allowedFlags:[],skipCapabilityCheck:!0}},V=new Map,T=new Map;for(let e of j){for(let t of e.names)V.set(t,e);let t=T.get(e.key);t?t.push(e):T.set(e.key,[e])}function M(e){if(e)return R[e]}function G(){return Object.keys(R)}function U(e){let t=e.endsWith("?"),s=t?e.slice(0,-1):e;return t?`[${s}]`:`<${s}>`}function B(e,t){return t.usageOverride?t.usageOverride:[e,...t.positionalArgs.map(U),...t.allowedFlags.flatMap(e=>(T.get(e)??[]).map(e=>e.usageLabel??e.names[0])).map(e=>`[${e}]`)].join(" ")}let q=function(){let e=`agent-device <command> [args] [--json]
|
|
2
2
|
|
|
3
3
|
CLI to control iOS and Android devices for AI agents.
|
|
4
|
-
`,t=
|
|
5
|
-
${
|
|
4
|
+
`,t=G().map(e=>{let t=R[e];if(!t)throw Error(`Missing command schema for ${e}`);return{name:e,schema:t,usage:B(e,t)}}),s=Math.max(...t.map(e=>e.usage.length))+2,i=["Commands:"];for(let e of t)i.push(` ${e.usage.padEnd(s)}${e.schema.description}`);let o=W("Flags:",j.filter(e=>e.usageLabel&&e.usageDescription));return`${e}
|
|
5
|
+
${i.join("\n")}
|
|
6
6
|
|
|
7
|
-
${
|
|
8
|
-
`}();function
|
|
9
|
-
(none)`;let s=Math.max(...t.map(e=>(e.usageLabel??"").length))+2,
|
|
10
|
-
`)}function
|
|
7
|
+
${o}
|
|
8
|
+
`}();function J(e){return j.filter(t=>e.has(t.key)&&void 0!==t.usageLabel&&void 0!==t.usageDescription)}function W(e,t){if(0===t.length)return`${e}
|
|
9
|
+
(none)`;let s=Math.max(...t.map(e=>(e.usageLabel??"").length))+2,i=[e];for(let e of t)i.push(` ${(e.usageLabel??"").padEnd(s)}${e.usageDescription??""}`);return i.join("\n")}let z=new Set(["config","help","version","batchSteps"]),H={iosSimulatorDeviceSet:["IOS_SIMULATOR_DEVICE_SET"],androidDeviceAllowlist:["ANDROID_DEVICE_ALLOWLIST"]},K=new Set(["1","true","yes","on"]),Z=new Set(["0","false","no","off"]),X=function(){let e=new Map;for(let t of j){let s=e.get(t.key);s?s.push(t):e.set(t.key,[t])}let t=new Map;for(let e of P)t.set(e,new Set(["*"]));for(let e of G()){let s=M(e);if(s)for(let i of s.allowedFlags){let s=t.get(i);s&&s.has("*")||(s?s.add(e):t.set(i,new Set([e])))}}return[...e.entries()].map(([e,s])=>{var i;return{key:e,flagDefinitions:s,config:{enabled:!z.has(e),key:e},env:{names:[(i=e,`AGENT_DEVICE_${i.replace(/([A-Z])/g,"_$1").replace(/[^A-Za-z0-9_]/g,"_").toUpperCase()}`),...H[e]??[]]},supportsCommand(s){let i=t.get(e);return!!i&&(!!i.has("*")||!!s&&i.has(s))}}}).sort((e,t)=>e.key.localeCompare(t.key))}(),Y=new Map(X.map(e=>[e.key,e]));function Q(e,t){return Y.get(e)?.supportsCommand(t)??!1}function ee(e,t,s,i){let o=function(e){let t=e.flagDefinitions.find(e=>void 0===e.setValue);if(t)return t;let s=function(e){let t=e.flagDefinitions[0];if(!t)throw Error(`Missing flag definition for option ${e.key}`);return t}(e);if("enum"===s.type){let t=e.flagDefinitions.map(e=>e.setValue).filter(e=>void 0!==e);return{...s,setValue:void 0,enumValues:t}}return s}(e);if("boolean"===o.type){var a=t,r=s,n=i;if("boolean"==typeof a)return a;if("string"==typeof a){let e=et(a);if(void 0!==e)return e}throw new y("INVALID_ARGS",`Invalid value for "${n}" in ${r}. Expected boolean.`)}if("booleanOrString"===o.type){if("boolean"==typeof t)return t;if("string"==typeof t&&void 0!==et(t))return et(t);if("string"==typeof t&&t.trim().length>0)return t;throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Expected boolean or non-empty string.`)}if("string"===o.type){if("string"==typeof t&&t.trim().length>0)return t;throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Expected non-empty string.`)}if("enum"===o.type){if(void 0!==o.setValue){var l=o,d=t,p=s,u=i;let e=l.setValue;if(d===e)return e;if("string"==typeof d){let t=d.trim();if(""===t||"true"===t||"1"===t)return e;if("false"===t||"0"===t)return}if(!0===d)return e;if(!1!==d)throw new y("INVALID_ARGS",`Invalid value for "${u}" in ${p}. Expected boolean or ${String(e)}.`);return}if("string"!=typeof t||!o.enumValues?.includes(t))throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Expected one of: ${o.enumValues?.join(", ")}.`);return t}let c="number"==typeof t?t:"string"==typeof t?Number(t):NaN;if(!Number.isFinite(c)||!Number.isInteger(c))throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Expected integer.`);if("number"==typeof o.min&&c<o.min)throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Must be >= ${o.min}.`);if("number"==typeof o.max&&c>o.max)throw new y("INVALID_ARGS",`Invalid value for "${i}" in ${s}. Must be <= ${o.max}.`);return c}function et(e){let t=e.trim().toLowerCase();return!!K.has(t)||!Z.has(t)&&void 0}function es(e){let t=e.indexOf("=");return -1===t?[e,void 0]:[e.slice(0,t),e.slice(t+1)]}function ei(e){return e.replace(/^-+/,"")}function eo(e){if(!e.startsWith("-")||"-"===e)return!1;let[t]=e.startsWith("--")?es(e):[e,void 0];return void 0!==V.get(t)}function ea(e){return"long-press"===e?"longpress":"metrics"===e?"perf":e}function er(e,t){for(let[s,i]of Object.entries(t))void 0!==i&&(e[s]=i);return e}function en(e){process.stdout.write(`${JSON.stringify(e,null,2)}
|
|
10
|
+
`)}function el(e,t={}){let s=e instanceof y?l(e):e;process.stderr.write(`Error (${s.code}): ${s.message}
|
|
11
11
|
`),s.hint&&process.stderr.write(`Hint: ${s.hint}
|
|
12
12
|
`),s.diagnosticId&&process.stderr.write(`Diagnostic ID: ${s.diagnosticId}
|
|
13
13
|
`),s.logPath&&process.stderr.write(`Diagnostics Log: ${s.logPath}
|
|
14
14
|
`),t.showDetails&&s.details&&process.stderr.write(`${JSON.stringify(s.details,null,2)}
|
|
15
|
-
`)}function
|
|
16
|
-
`:"";if(0===
|
|
17
|
-
`;if(s.raw){let e=
|
|
15
|
+
`)}function ed(e,s={}){let i=e.nodes,o=Array.isArray(i)?i:[],r=!!e.truncated,n="string"==typeof e.appName?e.appName:void 0,l="string"==typeof e.appBundleId?e.appBundleId:void 0,d=[];n&&d.push(`Page: ${n}`),l&&d.push(`App: ${l}`);let p=`Snapshot: ${o.length} nodes${r?" (truncated)":""}`,u=d.length>0?`${d.join("\n")}
|
|
16
|
+
`:"";if(0===o.length)return`${u}${p}
|
|
17
|
+
`;if(s.raw){let e=o.map(e=>JSON.stringify(e));return`${u}${p}
|
|
18
18
|
${e.join("\n")}
|
|
19
|
-
`}if(s.flatten){let
|
|
20
|
-
${
|
|
21
|
-
`}let c=
|
|
19
|
+
`}if(s.flatten){let e=o.map(e=>t(e,0,!1));return`${u}${p}
|
|
20
|
+
${e.join("\n")}
|
|
21
|
+
`}let c=a(o).map(e=>e.text);return`${u}${p}
|
|
22
22
|
${c.join("\n")}
|
|
23
|
-
`}function
|
|
24
|
-
`),!0},devices:async({flags:e,client:t})=>{let s=await t.devices.list(
|
|
25
|
-
`),!0},"ensure-simulator":async({flags:e,client:t})=>{
|
|
26
|
-
`),
|
|
27
|
-
`)}return!0},runtime:async({positionals:e,flags:t,client:s})=>{let
|
|
28
|
-
`),!0}
|
|
29
|
-
`
|
|
30
|
-
`);
|
|
31
|
-
`)
|
|
32
|
-
`),process.exit(0));let
|
|
23
|
+
`}function ep(e){return"number"==typeof e&&Number.isFinite(e)?e:0}function eu(){let e=process.env.FORCE_COLOR;return"string"==typeof e?"0"!==e:"string"!=typeof process.env.NO_COLOR&&!!process.stdout.isTTY}let ec=255*Math.sqrt(3);async function eg(t,s,i={}){await ef(t,"Baseline image not found"),await ef(s,"Current screenshot not found");let o=i.outputPath,[a,r]=await Promise.all([g.readFile(t),g.readFile(s)]),l=em(a,"baseline"),d=em(r,"current"),p=i.threshold??.1;if(l.width!==d.width||l.height!==d.height){let e=l.width*l.height;return await eh(i.outputPath),{match:!1,mismatchPercentage:100,totalPixels:e,differentPixels:e,dimensionMismatch:{expected:{width:l.width,height:l.height},actual:{width:d.width,height:d.height}}}}let u=l.width*l.height,c=p*ec,f=new e({width:l.width,height:l.height}),m=0;for(let e=0;e<l.data.length;e+=4){if(Math.sqrt((l.data[e]-d.data[e])**2+(l.data[e+1]-d.data[e+1])**2+(l.data[e+2]-d.data[e+2])**2)>c){m+=1,f.data[e]=255,f.data[e+1]=0,f.data[e+2]=0,f.data[e+3]=255;continue}let t=Math.round(.3*Math.round((l.data[e]+l.data[e+1]+l.data[e+2])/3));f.data[e]=t,f.data[e+1]=t,f.data[e+2]=t,f.data[e+3]=255}m>0&&o?(await g.mkdir(n.dirname(o),{recursive:!0}),await g.writeFile(o,e.sync.write(f))):await eh(i.outputPath);let h=u>0?Math.round(m/u*1e4)/100:0;return{...m>0&&o?{diffPath:o}:{},totalPixels:u,differentPixels:m,mismatchPercentage:h,match:0===m}}async function ef(e,t){try{await g.access(e)}catch{throw new y("INVALID_ARGS",`${t}: ${e}`)}}function em(t,s){try{return e.sync.read(t)}catch(e){throw new y("COMMAND_FAILED",`Failed to decode ${s} screenshot as PNG`,{label:s,reason:e instanceof Error?e.message:String(e)})}}async function eh(e){if(e)try{await g.unlink(e)}catch(e){var t;if(!("object"==typeof(t=e)&&null!==t&&"code"in t&&"ENOENT"===t.code))throw e}}async function ey(e){let t=ew[e.command];return!!t&&await t(e)}let ew={session:async({positionals:e,flags:t,client:s})=>{if("list"!==(e[0]??"list"))throw new y("INVALID_ARGS","session only supports list");let i={sessions:(await s.sessions.list()).map(D)};return t.json?en({success:!0,data:i}):process.stdout.write(`${JSON.stringify(i,null,2)}
|
|
24
|
+
`),!0},devices:async({flags:e,client:t})=>{let s=await t.devices.list(e$(e)),i={devices:s.map(_)};return e.json?en({success:!0,data:i}):process.stdout.write(`${s.map(ek).join("\n")}
|
|
25
|
+
`),!0},"ensure-simulator":async({flags:e,client:t})=>{if(!e.device)throw new y("INVALID_ARGS","ensure-simulator requires --device <name>");let s=await t.simulators.ensure({device:e.device,runtime:e.runtime,boot:e.boot,reuseExisting:e.reuseExisting,iosSimulatorDeviceSet:e.iosSimulatorDeviceSet}),i=O(s);if(e.json)en({success:!0,data:i});else{let e=s.created?"Created":"Reused",t=s.booted?" (booted)":"";process.stdout.write(`${e}: ${s.device} ${s.udid}${t}
|
|
26
|
+
`),s.runtime&&process.stdout.write(`Runtime: ${s.runtime}
|
|
27
|
+
`)}return!0},runtime:async({positionals:e,flags:t,client:s})=>{let i=(e[0]??"show").toLowerCase();return"set"===i?(eb(await s.runtime.set({platform:t.platform,metroHost:t.metroHost,metroPort:t.metroPort,bundleUrl:t.bundleUrl,launchUrl:t.launchUrl}),t),!0):"show"===i&&(eb(await s.runtime.show(),t),!0)},install:async({positionals:e,flags:t,client:s})=>{let i=await ev("install",e,t,s);return t.json&&en({success:!0,data:I(i)}),!0},reinstall:async({positionals:e,flags:t,client:s})=>{let i=await ev("reinstall",e,t,s);return t.json&&en({success:!0,data:I(i)}),!0},open:async({positionals:e,flags:t,client:s})=>{if(!e[0])return!1;let i=await s.apps.open({app:e[0],url:e[1],activity:t.activity,relaunch:t.relaunch,saveScript:t.saveScript,noRecord:t.noRecord,...e$(t)});return t.json&&en({success:!0,data:S(i)}),!0},close:async({positionals:e,flags:t,client:s})=>{let i=e[0]?await s.apps.close({app:e[0],shutdown:t.shutdown}):await s.sessions.close({shutdown:t.shutdown});return t.json&&en({success:!0,data:x(i)}),!0},snapshot:async({flags:e,client:t})=>{let s=L(await t.capture.snapshot({...e$(e),interactiveOnly:e.snapshotInteractiveOnly,compact:e.snapshotCompact,depth:e.snapshotDepth,scope:e.snapshotScope,raw:e.snapshotRaw}));return e.json?en({success:!0,data:s}):process.stdout.write(ed(s,{raw:e.snapshotRaw,flatten:e.snapshotInteractiveOnly})),!0},screenshot:async({positionals:e,flags:t,client:s})=>{let i=await s.capture.screenshot({path:e[0]??t.out}),o={path:i.path};return t.json?en({success:!0,data:o}):process.stdout.write(`${i.path}
|
|
28
|
+
`),!0},diff:async({positionals:e,flags:t,client:s})=>{let o;if("screenshot"!==e[0])return!1;let a=t.baseline;if(!a||"string"!=typeof a)throw new y("INVALID_ARGS","diff screenshot requires --baseline <path>");let r=d(a),l="string"==typeof t.out?d(t.out):void 0,p=.1;if(null!=t.threshold&&""!==t.threshold&&(Number.isNaN(p=Number(t.threshold))||p<0||p>1))throw new y("INVALID_ARGS","--threshold must be a number between 0 and 1");let u=w.mkdtempSync(n.join(v.tmpdir(),"agent-device-diff-current-")),c=n.join(u,`current-${Date.now()}.png`),g=(await s.capture.screenshot({path:c})).path;try{o=await eg(r,g,{threshold:p,outputPath:l})}finally{try{w.unlinkSync(g)}catch{}try{w.rmSync(u,{recursive:!0,force:!0})}catch{}}return t.json?en({success:!0,data:o}):process.stdout.write(function(e){var t,s;let o=eu(),a=!0===e.match,r=ep(e.differentPixels),l=ep(e.totalPixels),d=ep(e.mismatchPercentage),p=e.diffPath,u=e.dimensionMismatch,c=[];if(a){let e=o?i("green","✓"):"✓";c.push(`${e} Screenshots match.`)}else if(u){let e=o?i("red","✗"):"✗",t=u.expected,s=u.actual;c.push(`${e} Screenshots have different dimensions: expected ${t?.width}x${t?.height}, got ${s?.width}x${s?.height}`)}else{let e=o?i("red","✗"):"✗",t=0===d&&r>0?"<0.01":String(d);c.push(`${e} ${t}% pixels differ`)}if(p&&!a){let e,s,a=(t=p,e=process.cwd(),""!==(s=n.relative(e,t))&&(s.startsWith("..")||n.isAbsolute(s))?t:""===s?".":`.${n.sep}${s}`),r=o?i("dim","Diff image:"):"Diff image:",l=o?i("green",a):a;c.push(` ${r} ${l}`)}if(!a&&!u){let e=o?(s=String(r),i("red",s)):String(r);c.push(` ${e} different / ${l} total pixels`)}return`${c.join("\n")}
|
|
29
|
+
`}(o)),!0}};async function ev(e,t,s,i){let o=t[0],a=t[1];if(!o||!a)throw new y("INVALID_ARGS",`${e} requires: ${e} <app> <path-to-app-binary>`);let r={app:o,appPath:a,...e$(s)};return"install"===e?await i.apps.install(r):await i.apps.reinstall(r)}function eb(e,t){let s=N(e);t.json?en({success:!0,data:s}):e.configured?process.stdout.write(`${JSON.stringify(e.runtime??{},null,2)}
|
|
30
|
+
`):process.stdout.write("No runtime hints configured\n")}function e$(e){return{platform:e.platform,target:e.target,device:e.device,udid:e.udid,serial:e.serial,iosSimulatorDeviceSet:e.iosSimulatorDeviceSet,androidDeviceAllowlist:e.androidDeviceAllowlist}}function ek(e){let t=e.kind?` ${e.kind}`:"",s=e.target?` target=${e.target}`:"",i="boolean"==typeof e.booted?` booted=${e.booted}`:"";return`${e.name} (${e.platform}${t}${s})${i}`}function eS(e,t={}){let s=eA(t),i={...e};return s.defaultPlatform&&void 0===i.platform&&(i.platform=s.defaultPlatform),i}function eA(e){var t,s,i,o;let a,r=e.env??process.env,n=e.inheritedPlatform??e.configuredPlatform??function(e){if(void 0===e)return;let t=e.trim().toLowerCase();if(t){if("ios"===t||"android"===t||"apple"===t)return t;throw new y("INVALID_ARGS",`Invalid AGENT_DEVICE_PLATFORM: ${e}. Use ios, android, or apple.`)}}(r.AGENT_DEVICE_PLATFORM),l="string"==typeof(t=e.configuredSession??r.AGENT_DEVICE_SESSION)&&t.trim().length>0;return{defaultPlatform:n,lockPolicy:(s=e.policyOverrides,i=r,o=l,(a=s?.sessionLock??s?.sessionLockConflicts??eD(i.AGENT_DEVICE_SESSION_LOCK)??eD(i.AGENT_DEVICE_SESSION_LOCK_CONFLICTS))||(s?.sessionLocked===!0||function(e){if(!e)return!1;switch(e.trim().toLowerCase()){case"1":case"true":case"yes":case"on":return!0;default:return!1}}(i.AGENT_DEVICE_SESSION_LOCKED)||o?"reject":void 0))}}function eD(e){if(void 0===e)return;let t=e.trim().toLowerCase();if(t){if("reject"===t||"strip"===t)return t;throw new y("INVALID_ARGS",`Invalid session lock mode: ${e}. Use reject or strip.`)}}function eI(e,t){for(let[s,i]of Object.entries(t))void 0!==i&&(e[s]=i);return e}let eL={sendToDaemon:A};async function ex(e,t=eL){let s=r(),a=e.includes("--debug")||e.includes("--verbose")||e.includes("-v"),g=e.includes("--json"),h=function(e){for(let t=0;t<e.length;t+=1){let s=e[t];if(s.startsWith("--session=")){let e=s.slice(10).trim();return e.length>0?e:null}if("--session"===s){let s=e[t+1]?.trim();if(s&&!s.startsWith("-"))return s;break}}return null}(e)??process.env.AGENT_DEVICE_SESSION??"default";await b({session:h,requestId:s,command:e[0],debug:a},async()=>{var r,h,v,b,S,A,D,I,L,x,N;let O;try{let t,s,i,o,a,l,p;r={cwd:process.cwd(),env:process.env},t=function(e){let t={json:!1,help:!1,version:!1},s=null,i=[],o=[],a=!0;for(let r=0;r<e.length;r+=1){let n=e[r];if(a&&"--"===n){a=!1;continue}if(!a){s?i.push(n):s=ea(n);continue}let l=n.startsWith("--"),d=n.startsWith("-")&&n.length>1;if(!l&&!d){s?i.push(n):s=ea(n);continue}let[p,u]=l?es(n):[n,void 0],c=V.get(p);if(!c){if(function(e,t,s){var i;if(i=s,!/^-\d+(\.\d+)?$/.test(i)||!e)return!1;let o=M(e);return!o||!!o.allowsExtraPositionals||0!==o.positionalArgs.length&&(t.length<o.positionalArgs.length||o.positionalArgs.some(e=>e.includes("?")))}(s,i,n)){s?i.push(n):s=n;continue}throw new y("INVALID_ARGS",`Unknown flag: ${p}`)}let g=function(e,t,s,i){if(void 0!==e.setValue){if(void 0!==s)throw new y("INVALID_ARGS",`Flag ${t} does not take a value.`);return{value:e.setValue,consumeNext:!1}}if("boolean"===e.type){if(void 0!==s)throw new y("INVALID_ARGS",`Flag ${t} does not take a value.`);return{value:!0,consumeNext:!1}}if("booleanOrString"===e.type){if(void 0!==s){if(0===s.trim().length)throw new y("INVALID_ARGS",`Flag ${t} requires a non-empty value when provided.`);return{value:s,consumeNext:!1}}return void 0===i||eo(i)||!function(e){let t=e.trim();return!(!t||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t))&&!!(t.startsWith("./")||t.startsWith("../")||t.startsWith("~/")||t.startsWith("/")||t.includes("/")||t.includes("\\"))}(i)?{value:!0,consumeNext:!1}:{value:i,consumeNext:!0}}let o=s??i;if(void 0===o||void 0===s&&eo(o))throw new y("INVALID_ARGS",`Flag ${t} requires a value.`);if("string"===e.type)return{value:o,consumeNext:void 0===s};if("enum"===e.type){if(!e.enumValues?.includes(o))throw new y("INVALID_ARGS",`Invalid ${ei(t)}: ${o}`);return{value:o,consumeNext:void 0===s}}let a=Number(o);if(!Number.isFinite(a)||"number"==typeof e.min&&a<e.min||"number"==typeof e.max&&a>e.max)throw new y("INVALID_ARGS",`Invalid ${ei(t)}: ${o}`);return{value:Math.floor(a),consumeNext:void 0===s}}(c,p,u,e[r+1]);g.consumeNext&&(r+=1),t[c.key]=g.value,o.push({key:c.key,token:p})}return{command:s,positionals:i,flags:t,warnings:[],providedFlags:o}}(e),s=r?.env??process.env,i=r?.cwd??process.cwd(),o=(h={command:t.command,cwd:i,cliFlags:t.flags,env:s}).env??process.env,a=eI({},function(e){let t={};for(let s of e)eI(t,function(e,t){let s,i;if(!w.existsSync(e)){if(t)throw new y("INVALID_ARGS",`Config file not found: ${e}`);return{}}try{s=w.readFileSync(e,"utf8")}catch(t){throw new y("INVALID_ARGS",`Failed to read config file: ${e}`,{cause:t instanceof Error?t.message:String(t)})}try{i=JSON.parse(s)}catch(t){throw new y("INVALID_ARGS",`Invalid JSON in config file: ${e}`,{cause:t instanceof Error?t.message:String(t)})}if(!i||"object"!=typeof i||Array.isArray(i))throw new y("INVALID_ARGS",`Config file must contain a JSON object: ${e}`);return function(e,t){let s={};for(let[i,o]of Object.entries(e)){let e=Y.get(i);if(!e)throw new y("INVALID_ARGS",`Unknown config key "${i}" in ${t}.`);if(!e.config.enabled)throw new y("INVALID_ARGS",`Unsupported config key "${i}" in ${t}.`);s[i]=ee(e,o,t,i)}return s}(i,`config file ${e}`)}(s.path,s.required));return t}((v=h.cwd,b=h.cliFlags.config,S=o,(p=b??S.AGENT_DEVICE_CONFIG)?[{path:(A=p,D=v,I=S,d(A,{cwd:D,env:I})),required:!0}]:[{path:(L=S,n.join(m("~",{env:L}),".agent-device","config.json")),required:!1},{path:n.resolve(v,"agent-device.json"),required:!1}]))),l=eI(a,function(e,t){let s={};for(let i of X.filter(e=>e.config.enabled&&e.supportsCommand(t))){let t=i.env.names.map(t=>({name:t,value:e[t]})).find(e=>"string"==typeof e.value&&e.value.trim().length>0);t&&(s[i.key]=ee(i,t.value,`environment variable ${t.name}`,t.name))}return s}(o,h.command)),O=function(e,t){let s=t?.strictFlags??function(e){if(!e)return!1;let t=e.trim().toLowerCase();return"1"===t||"true"===t||"yes"===t||"on"===t}(process.env.AGENT_DEVICE_STRICT_FLAGS),i=[...e.warnings],o=er({json:!1,help:!1,version:!1},t?.defaultFlags??{});er(o,e.flags);let a=M(e.command),r=e.providedFlags.filter(t=>!Q(t.key,e.command));if(r.length>0){var n,l;let t=r.map(e=>e.token),a=(n=e.command,l=t,n?1===l.length?`Flag ${l[0]} is not supported for command ${n}.`:`Flags ${l.join(", ")} are not supported for command ${n}.`:1===l.length?`Flag ${l[0]} requires a command that supports it.`:`Flags ${l.join(", ")} require a command that supports them.`);if(s)throw new y("INVALID_ARGS",a);for(let e of(i.push(`${a} Enable AGENT_DEVICE_STRICT_FLAGS=1 to fail fast.`),r))delete o[e.key]}for(let t of Object.keys(o))void 0!==o[t]&&(Q(t,e.command)||delete o[t]);if(a?.defaults)for(let[e,t]of Object.entries(a.defaults))void 0===o[e]&&(o[e]=t);if("batch"===e.command&&1!=+!!o.steps+ +!!o.stepsFile)throw new y("INVALID_ARGS","batch requires exactly one step source: --steps or --steps-file.");return{command:e.command,positionals:e.positionals,flags:o,warnings:i}}(t,{strictFlags:r?.strictFlags,defaultFlags:l})}catch(t){c({level:"error",phase:"cli_parse_failed",data:{error:t instanceof Error?t.message:String(t)}});let e=l(t,{diagnosticId:u().diagnosticId,logPath:$({force:!0})??void 0});g?en({success:!1,error:e}):el(e,{showDetails:a}),process.exit(1);return}for(let e of O.warnings)process.stderr.write(`Warning: ${e}
|
|
31
|
+
`);O.flags.version&&(process.stdout.write(`${p()}
|
|
32
|
+
`),process.exit(0));let _="help"===O.command,E=O.flags.help;if(_||E){_&&O.positionals.length>1&&(el(new y("INVALID_ARGS","help accepts at most one command.")),process.exit(1));let e=_?O.positionals[0]:O.command;e||(process.stdout.write(`${q}
|
|
33
|
+
`),process.exit(0));let t=function(e){let t=M(e);if(!t)return null;let s=B(e,t),i=J(new Set(t.allowedFlags)),o=J(P),a=[];return i.length>0&&a.push(W("Command flags:",i)),a.push(W("Global flags:",o)),`agent-device ${s}
|
|
33
34
|
|
|
34
35
|
${t.description}
|
|
35
36
|
|
|
@@ -37,48 +38,48 @@ Usage:
|
|
|
37
38
|
agent-device ${s}
|
|
38
39
|
|
|
39
40
|
${a.join("\n\n")}
|
|
40
|
-
`}(
|
|
41
|
-
`),process.exit(1)}
|
|
42
|
-
`),process.exit(1));let{command:
|
|
43
|
-
`)),
|
|
44
|
-
`;let
|
|
45
|
-
`:"";if(!
|
|
46
|
-
`;let f=`${(t=String(
|
|
47
|
-
`}(e.data??{})),
|
|
48
|
-
`),
|
|
49
|
-
`),
|
|
50
|
-
`),
|
|
51
|
-
`),
|
|
52
|
-
`),
|
|
53
|
-
`),
|
|
54
|
-
`),
|
|
55
|
-
`),
|
|
56
|
-
`),
|
|
57
|
-
`),
|
|
58
|
-
`),
|
|
59
|
-
`),
|
|
60
|
-
`);let e="boolean"==typeof t?.active?t.active:void 0,
|
|
61
|
-
`)}if(!
|
|
62
|
-
`)}if(t?.hint&&!
|
|
63
|
-
`),Array.isArray(t?.notes)&&!
|
|
64
|
-
`)}
|
|
65
|
-
`),
|
|
66
|
-
`);let
|
|
41
|
+
`}(ea(e));t&&(process.stdout.write(t),process.exit(0)),el(new y("INVALID_ARGS",`Unknown command: ${e}`)),process.stdout.write(`${q}
|
|
42
|
+
`),process.exit(1)}O.command||(process.stdout.write(`${q}
|
|
43
|
+
`),process.exit(1));let{command:C,positionals:j}=O,R=eA({policyOverrides:O.flags,configuredPlatform:O.flags.platform,configuredSession:O.flags.session}),T=R.lockPolicy?{...O.flags}:eS(O.flags,{policyOverrides:O.flags,configuredPlatform:O.flags.platform,configuredSession:O.flags.session}),G=function(e){let{json:t,config:s,help:i,version:o,sessionLock:a,sessionLocked:r,sessionLockConflicts:n,...l}=e;return l}(T),U=k(T.stateDir),z=T.session??"default",H=T.daemonBaseUrl,K=!T.verbose||T.json||H?null:function(e){try{let t=0,s=!1,i=setInterval(()=>{if(!s&&w.existsSync(e))try{let s=w.statSync(e);if(s.size<t&&(t=0),s.size<=t)return;let i=w.openSync(e,"r");try{let e=Buffer.alloc(s.size-t);w.readSync(i,e,0,e.length,t),t=s.size,e.length>0&&process.stdout.write(e.toString("utf8"))}finally{w.closeSync(i)}}catch{}},200);return()=>{s=!0,clearInterval(i)}}catch{return null}}(U.logPath),Z=F({session:z,requestId:s,stateDir:T.stateDir,daemonBaseUrl:T.daemonBaseUrl,daemonAuthToken:T.daemonAuthToken,daemonTransport:T.daemonTransport,daemonServerMode:T.daemonServerMode,tenant:T.tenant,sessionIsolation:T.sessionIsolation,runId:T.runId,leaseId:T.leaseId,lockPolicy:R.lockPolicy,lockPlatform:R.defaultPlatform,cwd:process.cwd(),debug:!!T.verbose},{transport:t.sendToDaemon}),et=async e=>await t.sendToDaemon({session:z,command:e.command,positionals:e.positionals,flags:e.flags,meta:{requestId:s,debug:!!T.verbose,cwd:process.cwd(),tenantId:T.tenant,runId:T.runId,leaseId:T.leaseId,sessionIsolation:T.sessionIsolation,lockPolicy:R.lockPolicy,lockPlatform:R.defaultPlatform}});try{if("batch"===C){let e,t,s;if(j.length>0)throw new y("INVALID_ARGS","batch does not accept positional arguments.");let i=(function(e){let t="";if(e.steps)t=e.steps;else if(e.stepsFile)try{t=w.readFileSync(e.stepsFile,"utf8")}catch(s){let t=s instanceof Error?s.message:String(s);throw new y("INVALID_ARGS",`Failed to read --steps-file ${e.stepsFile}: ${t}`)}return o(t)})(T).map((e,t)=>({...e,flags:R.lockPolicy&&void 0===T.platform?{...e.flags??{}}:eS(e.flags??{},{policyOverrides:T,configuredPlatform:T.platform,configuredSession:T.session,inheritedPlatform:T.platform})})),a={...G,batchSteps:i};delete a.steps,delete a.stepsFile;let r=await et({command:"batch",positionals:j,flags:a});if(!r.ok)throw new y(r.error.code,r.error.message,{...r.error.details??{},hint:r.error.hint,diagnosticId:r.error.diagnosticId,logPath:r.error.logPath});T.json?en({success:!0,data:r.data??{}}):(x=r.data??{},e="number"==typeof x.total?x.total:0,t="number"==typeof x.executed?x.executed:0,s="number"==typeof x.totalDurationMs?x.totalDurationMs:void 0,process.stdout.write(`Batch completed: ${t}/${e} steps${void 0!==s?` in ${s}ms`:""}
|
|
44
|
+
`)),K&&K();return}if(await ey({command:C,positionals:j,flags:T,client:Z})){K&&K();return}let e=await et({command:C,positionals:j,flags:G});if(e.ok){if(T.json){en({success:!0,data:e.data??{}}),K&&K();return}if("snapshot"===C){process.stdout.write(ed(e.data??{},{raw:T.snapshotRaw,flatten:T.snapshotInteractiveOnly})),K&&K();return}if("diff"===C&&"snapshot"===j[0]){process.stdout.write(function(e){var t,s,o,a;let r=!0===e.baselineInitialized,n=e.summary??{},l=ep(n.additions),d=ep(n.removals),p=ep(n.unchanged),u=eu();if(r)return`Baseline initialized (${p} lines).
|
|
45
|
+
`;let c=(function(e,t){if(0===e.length)return e;let s=e.map((e,t)=>({index:t,kind:e.kind})).filter(e=>"added"===e.kind||"removed"===e.kind).map(e=>e.index);if(0===s.length)return e;let i=Array(e.length).fill(!1);for(let t of s){let s=Math.max(0,t-1),o=Math.min(e.length-1,t+1);for(let e=s;e<=o;e+=1)i[e]=!0}return e.filter((e,t)=>i[t])})(Array.isArray(e.lines)?e.lines:[],1).map(e=>{var t,s,o,a;let r="string"==typeof e.text?e.text:"";if("added"===e.kind){let e=r.startsWith(" ")?`+${r}`:`+ ${r}`;return u?(t=e,s="green",i(s,t)):e}if("removed"===e.kind){let e=r.startsWith(" ")?`-${r}`:`- ${r}`;return u?(o=e,i("red",o)):e}return u?(a=r,i("dim",a)):r}),g=c.length>0?`${c.join("\n")}
|
|
46
|
+
`:"";if(!u)return`${g}${l} additions, ${d} removals, ${p} unchanged
|
|
47
|
+
`;let f=`${(t=String(l),s="green",i(s,t))} additions, ${(o=String(d),i("red",o))} removals, ${(a=String(p),i("dim",a))} unchanged`;return`${g}${f}
|
|
48
|
+
`}(e.data??{})),K&&K();return}if("get"===C){let t=j[0];if("text"===t){let t=e.data?.text??"";process.stdout.write(`${t}
|
|
49
|
+
`),K&&K();return}if("attrs"===t){let t=e.data?.node??{};process.stdout.write(`${JSON.stringify(t,null,2)}
|
|
50
|
+
`),K&&K();return}}if("find"===C){let t=e.data;if("string"==typeof t?.text){process.stdout.write(`${t.text}
|
|
51
|
+
`),K&&K();return}if("boolean"==typeof t?.found){process.stdout.write(`Found: ${t.found}
|
|
52
|
+
`),K&&K();return}if(t?.node){process.stdout.write(`${JSON.stringify(t.node,null,2)}
|
|
53
|
+
`),K&&K();return}}if("is"===C){let t=e.data?.predicate??"assertion";process.stdout.write(`Passed: is ${t}
|
|
54
|
+
`),K&&K();return}if("boot"===C){let t=e.data?.platform??"unknown",s=e.data?.device??e.data?.id??"unknown";process.stdout.write(`Boot ready: ${s} (${t})
|
|
55
|
+
`),K&&K();return}if("ensure-simulator"===C){let t=e.data,s="string"==typeof t?.udid?t.udid:"unknown",i="string"==typeof t?.device?t.device:"unknown",o="string"==typeof t?.runtime?t.runtime:"",a=t?.created===!0,r=t?.booted===!0;process.stdout.write(`${a?"Created":"Reused"}: ${i} ${s}${r?" (booted)":""}
|
|
56
|
+
`),o&&process.stdout.write(`Runtime: ${o}
|
|
57
|
+
`),K&&K();return}if("runtime"===C){let t=e.data,s=t?.cleared===!0,i=t?.configured===!0;if(s){process.stdout.write("Runtime hints cleared\n"),K&&K();return}if(!i){process.stdout.write("No runtime hints configured\n"),K&&K();return}process.stdout.write(`${JSON.stringify(t?.runtime??{},null,2)}
|
|
58
|
+
`),K&&K();return}if("screenshot"===C){let t="string"==typeof e.data?.path?e.data.path:"";t&&process.stdout.write(`${t}
|
|
59
|
+
`),K&&K();return}if("record"===C){let t=e.data,s="string"==typeof t?.outPath?t.outPath:"";s&&process.stdout.write(`${s}
|
|
60
|
+
`),K&&K();return}if("logs"===C){let t=e.data,s="string"==typeof t?.path?t.path:"";if(s){process.stdout.write(`${s}
|
|
61
|
+
`);let e="boolean"==typeof t?.active?t.active:void 0,i="string"==typeof t?.state?t.state:void 0,o="string"==typeof t?.backend?t.backend:void 0,a="number"==typeof t?.sizeBytes?t.sizeBytes:void 0,r=t?.started===!0,n=t?.stopped===!0,l=t?.marked===!0,d=t?.cleared===!0,p=t?.restarted===!0,u="number"==typeof t?.removedRotatedFiles?t.removedRotatedFiles:void 0;if(!T.json&&(void 0!==e||i||o||void 0!==a)){let t=[void 0!==e?`active=${e}`:"",i?`state=${i}`:"",o?`backend=${o}`:"",void 0!==a?`sizeBytes=${a}`:""].filter(Boolean).join(" ");t&&process.stderr.write(`${t}
|
|
62
|
+
`)}if(!T.json&&(r||n||l||d||p||void 0!==u)){let e=[r?"started=true":"",n?"stopped=true":"",l?"marked=true":"",d?"cleared=true":"",p?"restarted=true":"",void 0!==u?`removedRotatedFiles=${u}`:""].filter(Boolean).join(" ");e&&process.stderr.write(`${e}
|
|
63
|
+
`)}if(t?.hint&&!T.json&&process.stderr.write(`${t.hint}
|
|
64
|
+
`),Array.isArray(t?.notes)&&!T.json)for(let e of t.notes)"string"==typeof e&&e.length>0&&process.stderr.write(`${e}
|
|
65
|
+
`)}K&&K();return}if("clipboard"===C){let t=e.data,s=(j[0]??("string"==typeof t?.action?t.action:"")).toLowerCase();if("read"===s){let e="string"==typeof t?.text?t.text:"";process.stdout.write(`${e}
|
|
66
|
+
`),K&&K();return}if("write"===s){process.stdout.write("Clipboard updated\n"),K&&K();return}}if("network"===C){let t=e.data,s="string"==typeof t?.path?t.path:"";s&&process.stdout.write(`${s}
|
|
67
|
+
`);let i=Array.isArray(t?.entries)?t.entries:[];if(0===i.length)process.stdout.write("No recent HTTP(s) entries found.\n");else for(let e of i){let t="string"==typeof e.method?e.method:"HTTP",s="string"==typeof e.url?e.url:"<unknown-url>",i="number"==typeof e.status?` status=${e.status}`:"",o="string"==typeof e.timestamp?`${e.timestamp} `:"";process.stdout.write(`${o}${t} ${s}${i}
|
|
67
68
|
`),"string"==typeof e.headers&&process.stdout.write(` headers: ${e.headers}
|
|
68
69
|
`),"string"==typeof e.requestBody&&process.stdout.write(` request: ${e.requestBody}
|
|
69
70
|
`),"string"==typeof e.responseBody&&process.stdout.write(` response: ${e.responseBody}
|
|
70
|
-
`)}let
|
|
71
|
+
`)}let o="boolean"==typeof t?.active?t.active:void 0,a="string"==typeof t?.state?t.state:void 0,r="string"==typeof t?.backend?t.backend:void 0,n="number"==typeof t?.scannedLines?t.scannedLines:void 0,l="number"==typeof t?.matchedLines?t.matchedLines:void 0,d="string"==typeof t?.include?t.include:void 0,p=[void 0!==o?`active=${o}`:"",a?`state=${a}`:"",r?`backend=${r}`:"",d?`include=${d}`:"",void 0!==n?`scannedLines=${n}`:"",void 0!==l?`matchedLines=${l}`:""].filter(Boolean).join(" ");if(p&&process.stderr.write(`${p}
|
|
71
72
|
`),Array.isArray(t?.notes))for(let e of t.notes)"string"==typeof e&&e.length>0&&process.stderr.write(`${e}
|
|
72
|
-
`);
|
|
73
|
-
`),
|
|
74
|
-
`),
|
|
75
|
-
`),
|
|
73
|
+
`);K&&K();return}if("click"===C||"press"===C){let t=e.data?.ref??"",s=e.data?.x,i=e.data?.y;t&&"number"==typeof s&&"number"==typeof i&&process.stdout.write(`Tapped @${t} (${s}, ${i})
|
|
74
|
+
`),K&&K();return}if(e.data&&"object"==typeof e.data){let t=e.data;if("devices"===C){let e=(Array.isArray(t.devices)?t.devices:[]).map(e=>{let t=e?.name??e?.id??"unknown",s=e?.platform??"unknown",i=e?.kind?` ${e.kind}`:"",o=e?.target?` target=${e.target}`:"",a="boolean"==typeof e?.booted?` booted=${e.booted}`:"";return`${t} (${s}${i}${o})${a}`});process.stdout.write(`${e.join("\n")}
|
|
75
|
+
`),K&&K();return}if("apps"===C){let e=(Array.isArray(t.apps)?t.apps:[]).map(e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){let t=e.bundleId??e.package,s=e.name??e.label;return s&&t?`${s} (${t})`:t?String(t):JSON.stringify(e)}return String(e)});process.stdout.write(`${e.join("\n")}
|
|
76
|
+
`),K&&K();return}if("appstate"===C){let e=t?.platform,s=t?.appBundleId,i=t?.appName,o=t?.source,a=t?.package,r=t?.activity;if("ios"===e){process.stdout.write(`Foreground app: ${i??s??"unknown"}
|
|
76
77
|
`),s&&process.stdout.write(`Bundle: ${s}
|
|
77
|
-
`),
|
|
78
|
-
`),
|
|
78
|
+
`),o&&process.stdout.write(`Source: ${o}
|
|
79
|
+
`),K&&K();return}if("android"===e){process.stdout.write(`Foreground app: ${a??"unknown"}
|
|
79
80
|
`),r&&process.stdout.write(`Activity: ${r}
|
|
80
|
-
`),
|
|
81
|
-
`),
|
|
81
|
+
`),K&&K();return}}if("perf"===C){process.stdout.write(`${JSON.stringify(t,null,2)}
|
|
82
|
+
`),K&&K();return}}K&&K();return}throw new y(e.error.code,e.error.message,{...e.error.details??{},hint:e.error.hint,diagnosticId:e.error.diagnosticId,logPath:e.error.logPath})}catch(s){let e=f(s),t=l(e,{diagnosticId:u().diagnosticId,logPath:$({force:!0})??void 0});if("close"===C&&"COMMAND_FAILED"===(N=e).code&&(N.details?.kind==="daemon_startup_failed"||N.message.toLowerCase().includes("failed to start daemon")&&("string"==typeof N.details?.infoPath||"string"==typeof N.details?.lockPath))){T.json&&en({success:!0,data:{closed:"session",source:"no-daemon"}}),K&&K();return}if(T.json)en({success:!1,error:t});else if(el(t,{showDetails:T.verbose}),T.verbose)try{let e=U.logPath;if(w.existsSync(e)){let t=w.readFileSync(e,"utf8").split("\n"),s=t.slice(Math.max(0,t.length-200)).join("\n");s.trim().length>0&&process.stderr.write(`
|
|
82
83
|
[daemon log]
|
|
83
84
|
${s}
|
|
84
|
-
`)}}catch{}
|
|
85
|
+
`)}}catch{}K&&K(),process.exit(1)}})}h(process.argv[1]??"").href===import.meta.url&&ex(process.argv.slice(2)).catch(e=>{el(l(f(e)),{showDetails:!0}),process.exit(1)}),ex(process.argv.slice(2));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentDeviceDevice, AgentDeviceIdentifiers, AgentDeviceSession, AgentDeviceSessionDevice, AppCloseResult, AppDeployResult, AppOpenResult, CaptureSnapshotResult, EnsureSimulatorResult, RuntimeResult, SessionCloseResult } from './client-types.ts';
|
|
2
|
+
import type { Platform } from './utils/device.ts';
|
|
3
|
+
export declare function buildAppIdentifiers(params: {
|
|
4
|
+
session?: string;
|
|
5
|
+
bundleId?: string;
|
|
6
|
+
packageName?: string;
|
|
7
|
+
appId?: string;
|
|
8
|
+
}): AgentDeviceIdentifiers;
|
|
9
|
+
export declare function buildDeviceIdentifiers(platform: Platform, id: string, name: string): AgentDeviceIdentifiers;
|
|
10
|
+
export declare function serializeSessionDevice(device: AgentDeviceSessionDevice, options?: {
|
|
11
|
+
includeAndroidSerial?: boolean;
|
|
12
|
+
}): Record<string, unknown>;
|
|
13
|
+
export declare function serializeSessionListEntry(session: AgentDeviceSession): Record<string, unknown>;
|
|
14
|
+
export declare function serializeDevice(device: AgentDeviceDevice): Record<string, unknown>;
|
|
15
|
+
export declare function serializeEnsureSimulatorResult(result: EnsureSimulatorResult): Record<string, unknown>;
|
|
16
|
+
export declare function serializeRuntimeResult(result: RuntimeResult): Record<string, unknown>;
|
|
17
|
+
export declare function serializeDeployResult(result: AppDeployResult): Record<string, unknown>;
|
|
18
|
+
export declare function serializeOpenResult(result: AppOpenResult): Record<string, unknown>;
|
|
19
|
+
export declare function serializeCloseResult(result: SessionCloseResult | AppCloseResult): Record<string, unknown>;
|
|
20
|
+
export declare function serializeSnapshotResult(result: CaptureSnapshotResult): Record<string, unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveDevice, type DeviceInfo } from '../utils/device.ts';
|
|
2
2
|
import { findBootableIosSimulator } from '../platforms/ios/devices.ts';
|
|
3
3
|
import type { CliFlags } from '../utils/command-schema.ts';
|
|
4
4
|
import type { DeviceTarget } from '../utils/device.ts';
|
|
@@ -11,7 +11,7 @@ type IosDeviceSelector = {
|
|
|
11
11
|
serial?: string;
|
|
12
12
|
};
|
|
13
13
|
type ResolveIosDeviceDeps = {
|
|
14
|
-
|
|
14
|
+
resolveDevice: typeof resolveDevice;
|
|
15
15
|
findBootableSimulator: typeof findBootableIosSimulator;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DeviceInfo } from '../../utils/device.ts';
|
|
2
|
+
import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
|
|
3
|
+
import { SessionStore } from '../session-store.ts';
|
|
4
|
+
import { stopIosRunnerSession } from '../../platforms/ios/runner-client.ts';
|
|
5
|
+
import { shutdownSimulator } from '../../platforms/ios/simulator.ts';
|
|
6
|
+
import { clearRuntimeHintsFromApp } from '../runtime-hints.ts';
|
|
7
|
+
import { settleIosSimulator } from './session-device-utils.ts';
|
|
8
|
+
type AppLogStream = NonNullable<SessionState['appLog']>;
|
|
9
|
+
declare function shutdownAndroidEmulator(device: DeviceInfo): Promise<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
exitCode: number;
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type ShutdownAndroidEmulatorFn = typeof shutdownAndroidEmulator;
|
|
16
|
+
export declare function handleCloseCommand(params: {
|
|
17
|
+
req: DaemonRequest;
|
|
18
|
+
sessionName: string;
|
|
19
|
+
logPath: string;
|
|
20
|
+
sessionStore: SessionStore;
|
|
21
|
+
dispatch: (device: DeviceInfo, command: string, positionals: string[], out?: string, context?: Record<string, unknown>) => Promise<Record<string, unknown> | void>;
|
|
22
|
+
stopIosRunner?: typeof stopIosRunnerSession;
|
|
23
|
+
clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
|
|
24
|
+
settleSimulator?: typeof settleIosSimulator;
|
|
25
|
+
shutdownSimulator?: typeof shutdownSimulator;
|
|
26
|
+
shutdownAndroidEmulator?: ShutdownAndroidEmulatorFn;
|
|
27
|
+
appLogOps: {
|
|
28
|
+
stop: (stream: AppLogStream) => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
}): Promise<DaemonResponse>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { resolveTargetDevice } from '../../core/dispatch.ts';
|
|
2
|
+
import { ensureDeviceReady } from '../device-ready.ts';
|
|
3
|
+
import type { DeviceInfo } from '../../utils/device.ts';
|
|
4
|
+
import type { DaemonRequest, DaemonResponse } from '../types.ts';
|
|
5
|
+
import { SessionStore } from '../session-store.ts';
|
|
6
|
+
export type ReinstallOps = {
|
|
7
|
+
ios: (device: DeviceInfo, app: string, appPath: string) => Promise<{
|
|
8
|
+
bundleId: string;
|
|
9
|
+
}>;
|
|
10
|
+
android: (device: DeviceInfo, app: string, appPath: string) => Promise<{
|
|
11
|
+
package: string;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export type AppDeployOps = {
|
|
15
|
+
ios: (device: DeviceInfo, app: string, appPath: string) => Promise<{
|
|
16
|
+
bundleId?: string;
|
|
17
|
+
appName?: string;
|
|
18
|
+
launchTarget?: string;
|
|
19
|
+
}>;
|
|
20
|
+
android: (device: DeviceInfo, app: string, appPath: string) => Promise<{
|
|
21
|
+
package?: string;
|
|
22
|
+
appName?: string;
|
|
23
|
+
launchTarget?: string;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
export type InstallOps = AppDeployOps;
|
|
27
|
+
export declare const defaultReinstallOps: ReinstallOps;
|
|
28
|
+
export declare const defaultInstallOps: InstallOps;
|
|
29
|
+
export declare function handleAppDeployCommand(params: {
|
|
30
|
+
req: DaemonRequest;
|
|
31
|
+
command: 'install' | 'reinstall';
|
|
32
|
+
sessionName: string;
|
|
33
|
+
sessionStore: SessionStore;
|
|
34
|
+
ensureReady: typeof ensureDeviceReady;
|
|
35
|
+
resolveDevice: typeof resolveTargetDevice;
|
|
36
|
+
deployOps: AppDeployOps;
|
|
37
|
+
}): Promise<DaemonResponse>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type DeviceInfo } from '../../utils/device.ts';
|
|
2
|
+
import { ensureDeviceReady } from '../device-ready.ts';
|
|
3
|
+
import { resolveTargetDevice } from '../../core/dispatch.ts';
|
|
4
|
+
import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
|
|
5
|
+
export declare const IOS_SIMULATOR_POST_CLOSE_SETTLE_MS: number;
|
|
6
|
+
export declare const IOS_SIMULATOR_POST_OPEN_SETTLE_MS: number;
|
|
7
|
+
export declare function requireSessionOrExplicitSelector(command: string, session: SessionState | undefined, flags: DaemonRequest['flags'] | undefined): DaemonResponse | null;
|
|
8
|
+
export declare function hasExplicitDeviceSelector(flags: DaemonRequest['flags'] | undefined): boolean;
|
|
9
|
+
export declare function hasExplicitSessionFlag(flags: DaemonRequest['flags'] | undefined): boolean;
|
|
10
|
+
export declare function isIosSimulator(device: DeviceInfo): boolean;
|
|
11
|
+
export declare function isAndroidEmulator(device: DeviceInfo): boolean;
|
|
12
|
+
export declare function settleIosSimulator(device: DeviceInfo, delayMs: number): Promise<void>;
|
|
13
|
+
export declare function resolveCommandDevice(params: {
|
|
14
|
+
session: SessionState | undefined;
|
|
15
|
+
flags: DaemonRequest['flags'] | undefined;
|
|
16
|
+
ensureReadyFn: typeof ensureDeviceReady;
|
|
17
|
+
resolveTargetDeviceFn: typeof resolveTargetDevice;
|
|
18
|
+
ensureReady?: boolean;
|
|
19
|
+
}): Promise<DeviceInfo>;
|
|
20
|
+
export declare function resolveAndroidEmulatorAvdName(params: {
|
|
21
|
+
flags: DaemonRequest['flags'] | undefined;
|
|
22
|
+
sessionDevice?: DeviceInfo;
|
|
23
|
+
resolvedDevice?: DeviceInfo;
|
|
24
|
+
}): string | undefined;
|
|
25
|
+
export declare function selectorTargetsSessionDevice(flags: DaemonRequest['flags'] | undefined, session: SessionState | undefined): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DeviceInfo } from '../../utils/device.ts';
|
|
2
|
+
export declare function resolveAndroidPackageForOpen(device: DeviceInfo, openTarget: string | undefined): Promise<string | undefined>;
|
|
3
|
+
export declare function resolveSessionAppBundleIdForTarget(device: DeviceInfo, openTarget: string | undefined, currentAppBundleId: string | undefined, resolveAndroidPackageForOpenFn: (device: DeviceInfo, openTarget: string | undefined) => Promise<string | undefined>): Promise<string | undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { dispatchCommand, resolveTargetDevice } from '../../core/dispatch.ts';
|
|
2
|
+
import { ensureDeviceReady } from '../device-ready.ts';
|
|
3
|
+
import { stopIosRunnerSession } from '../../platforms/ios/runner-client.ts';
|
|
4
|
+
import { applyRuntimeHintsToApp, clearRuntimeHintsFromApp } from '../runtime-hints.ts';
|
|
5
|
+
import type { DeviceInfo } from '../../utils/device.ts';
|
|
6
|
+
import type { DaemonRequest, DaemonResponse } from '../types.ts';
|
|
7
|
+
import { SessionStore } from '../session-store.ts';
|
|
8
|
+
import { settleIosSimulator } from './session-device-utils.ts';
|
|
9
|
+
export declare function handleOpenCommand(params: {
|
|
10
|
+
req: DaemonRequest;
|
|
11
|
+
sessionName: string;
|
|
12
|
+
logPath: string;
|
|
13
|
+
sessionStore: SessionStore;
|
|
14
|
+
dispatch: typeof dispatchCommand;
|
|
15
|
+
ensureReady: typeof ensureDeviceReady;
|
|
16
|
+
resolveDevice: typeof resolveTargetDevice;
|
|
17
|
+
applyRuntimeHints?: typeof applyRuntimeHintsToApp;
|
|
18
|
+
clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
|
|
19
|
+
stopIosRunner?: typeof stopIosRunnerSession;
|
|
20
|
+
settleSimulator?: typeof settleIosSimulator;
|
|
21
|
+
resolveAndroidPackageForOpen?: (device: DeviceInfo, openTarget: string | undefined) => Promise<string | undefined>;
|
|
22
|
+
}): Promise<DaemonResponse>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DaemonRequest, DaemonResponse } from '../types.ts';
|
|
2
|
+
import { SessionStore } from '../session-store.ts';
|
|
3
|
+
import { clearRuntimeHintsFromApp } from '../runtime-hints.ts';
|
|
4
|
+
export declare function handleRuntimeCommand(params: {
|
|
5
|
+
req: DaemonRequest;
|
|
6
|
+
sessionName: string;
|
|
7
|
+
sessionStore: SessionStore;
|
|
8
|
+
clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
|
|
9
|
+
}): Promise<DaemonResponse>;
|