agent-device 0.19.0 → 0.19.2
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/README.md +5 -1
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.19.2.apk +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.19.2.apk.sha256 +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.19.0.manifest.json → agent-device-android-multitouch-helper-0.19.2.manifest.json} +4 -4
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.19.0.apk → agent-device-android-snapshot-helper-0.19.2.apk} +0 -0
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.19.2.apk.sha256 +1 -0
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.19.0.manifest.json → agent-device-android-snapshot-helper-0.19.2.manifest.json} +6 -6
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +24 -7
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +506 -119
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +153 -48
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +172 -0
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +76 -5
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +60 -52
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +159 -56
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +142 -0
- package/dist/apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +16 -14
- package/dist/src/android-adb.d.ts +1 -2
- package/dist/src/android-adb.js +1 -1
- package/dist/src/android-input-ownership.js +6 -0
- package/dist/src/android.js +1 -1
- package/dist/src/app-lifecycle.js +3 -3
- package/dist/src/apple-runner-options.js +1 -1
- package/dist/src/apps.js +5 -5
- package/dist/src/cli-help.js +149 -37
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +11 -11
- package/dist/src/client.js +2 -2
- package/dist/src/command-metadata.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/device-input-state.js +2 -2
- package/dist/src/devices2.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/generic.js +1 -1
- package/dist/src/index.d.ts +224 -20
- package/dist/src/input-actions.js +3 -3
- package/dist/src/interaction-snapshot.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interactor.js +2 -2
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +17 -15
- package/dist/src/lease.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/metro.d.ts +0 -1
- package/dist/src/notifications.js +1 -1
- package/dist/src/points.js +1 -1
- package/dist/src/project-runtime.js +1 -1
- package/dist/src/providers.js +1 -1
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-trace-recording.js +2 -2
- package/dist/src/record-trace.js +1 -1
- package/dist/src/registry.js +24 -23
- package/dist/src/reporting.js +3 -3
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runtime.js +2 -2
- package/dist/src/sdk-android-adb.d.ts +2 -2
- package/dist/src/sdk-batch-runner.d.ts +0 -1
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-finders.d.ts +1 -2
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-io.d.ts +0 -1
- package/dist/src/sdk-remote-config.d.ts +1 -2
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.d.ts +0 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/selectors2.js +1 -1
- package/dist/src/server.js +3 -3
- package/dist/src/session.js +10 -10
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-diagnostics.js +2 -2
- package/dist/src/snapshot-helper.js +4 -4
- package/dist/src/snapshot-quality.js +1 -1
- package/dist/src/snapshot2.js +2 -2
- package/dist/src/tv-remote.js +14 -0
- package/dist/src/version.js +1 -1
- package/dist/src/web.js +1 -1
- package/package.json +5 -4
- package/server.json +2 -2
- package/skills/agent-device/SKILL.md +8 -7
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.19.0.apk +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.19.0.apk.sha256 +0 -1
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.19.0.apk.sha256 +0 -1
- package/dist/src/device-rotation.js +0 -14
- package/dist/src/logcat.js +0 -6
package/dist/src/cli-help.js
CHANGED
|
@@ -1,13 +1,48 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{er as e}from"./tv-remote.js";import{h as t,v as n}from"./registry.js";import{n as r,r as i}from"./command-schema.js";const a=[{label:`agent-device help manual-qa`,description:`Follow a manual test script with exact interactions and verification`},{label:`agent-device help dogfood`,description:`Explore an app and report issues with evidence`},{label:`agent-device help validate`,description:`Validate code changes, perf, visuals, logs, and cleanup`},{label:`agent-device help workflow`,description:`Full app automation reference for commands, refs, selectors, and waits`},{label:`agent-device help debugging`,description:`Use when logs, network, audio, perf memory, traces, alerts, or diagnostics matter`},{label:`agent-device help tv`,description:`Use when navigating Android TV or tvOS focus-first surfaces`},{label:`agent-device help react-native`,description:`Use when the target app is React Native, Expo, or a dev client`},{label:`agent-device help react-devtools`,description:`Use when inspecting components, props/state/hooks, renders, or profiles`},{label:`agent-device help cdp`,description:`Use when investigating JS heap growth, heap snapshots, or retainers`},{label:`agent-device help physical-device`,description:`Use when using a connected phone/tablet or iOS signing setup`},{label:`agent-device help remote`,description:`Use when working through cloud config, tenants, leases, or local tunnels`},{label:`agent-device help web`,description:`Use when automating a browser through agent-device sessions`},{label:`agent-device help macos`,description:`Use when targeting desktop, frontmost app, or menu bar surfaces`}],o=[`Write full command lines starting with agent-device; do not output pseudo commands, helper prose, pipes, grep, jq, or hidden stderr.`,`Default app loop: agent-device open <app> -> agent-device snapshot -i -> agent-device press/fill/click <target> --settle -> continue from that settled diff -> agent-device close.`,`Use --settle on every mutating app action that supports it: press, click, fill, longpress.`,`The settled diff is the next snapshot. Do not run wait stable or snapshot after settled:true unless the diff lacks the next target/evidence.`,`If --settle prints not settled, follow its hint before the next ref-based action.`,`Use refs or selectors as targets: @e12, label="Search", role=button label="Follow".`,`Pick the help mode below when the task is manual QA, dogfooding, engineering validation, or debugging.`],s=[`Planning output contract: when asked to plan commands, output command lines only: no prose, numbering, Markdown fences, pipes, or shell helpers.`,`If you did not use --settle, verify a mutation with diff snapshot (or diff snapshot -i), not a full snapshot: it prints only the added/removed/changed lines since the last snapshot in this session.`,`Network-backed or debounced results may arrive after the --settle quiet window; follow the settled action with wait text "Expected result" or wait <selector> instead of polling full snapshots.`,`Pin a raw CLI ref to the response that minted it with ~s<n> (n = refsGeneration): press @e12~s4; plain refs stay valid input.`,`Plain snapshot reads state; snapshot -i refreshes current interactive refs only.`,`Default snapshot text is an agent-facing, token-efficient view for planning and targeting actions.`,`Read-only visible/state question: use snapshot/get/is/find; use snapshot -i only when refs are needed.`,`Truncated text/input preview: expand first with snapshot -s @e12, not get text.`,`React Native apps: read help react-native.`,`Text fields: use fill <target> <text> --settle to replace a field value. Use type <text> only to append after focusing a field with press.`,`Clearing text: do not use fill <target> ""; use a visible clear/reset control or report that clearing is unsupported.`,`Implicit default sessions are scoped to the current worktree; if a prompt names a Session, include --session <name> on every command in that flow.`,`Run mutating commands serially within one session; parallelize only read-only commands or separate sessions/devices.`,`After mutation: refs are stale. If the next target is known, use its selector directly; otherwise refresh with snapshot -i, scoped with -s when a stable container is known. Use press/click for taps.`,`macOS context menus use click <ref> --button secondary, then snapshot -i. Longpress is for mobile hold gestures, not macOS secondary-click menus.`,`Remote lifecycle: use connect, then open, commands, close, and disconnect. Read help remote for proxy, cloud, and device-cloud provider flows.`,`TV/D-pad targets: read help tv. Web browser sessions: read help web.`,`Debug evidence: Session state contains request diagnostics and runner.log; use logs clear --restart/mark/path, trace, and network dump --include headers for app evidence.`,`Routine QA loop with concrete command shapes: agent-device help manual-qa. Full operating guide: agent-device help workflow. Exploratory QA: agent-device help dogfood.`],c=[`Default config files: ~/.agent-device/config.json, ./agent-device.json`,`Use --config <path> or AGENT_DEVICE_CONFIG to load one explicit config file.`],l=[{label:`AGENT_DEVICE_SESSION`,description:`Explicit session name`},{label:`AGENT_DEVICE_PLATFORM`,description:`Default platform binding`},{label:`AGENT_DEVICE_SESSION_LOCK`,description:`Bound-session conflict mode`},{label:`AGENT_DEVICE_DAEMON_BASE_URL`,description:`Connect to remote daemon`},{label:`AGENT_DEVICE_DAEMON_AUTH_TOKEN`,description:`Remote daemon service/API token`},{label:`AGENT_DEVICE_CLOUD_BASE_URL`,description:`Bridge/control-plane API origin for cloud auth and /api-keys`}],u=[`agent-device open Settings --platform ios`,`agent-device open https://example.com --platform web`,`agent-device snapshot -i`,`agent-device fill @e3 "test@example.com"`,`agent-device replay ./session.ad`,`agent-device test ./suite --platform android`],d={"manual-qa":{summary:`Follow manual test scripts with exact interactions and verification`,body:`agent-device help manual-qa
|
|
2
|
+
|
|
3
|
+
Use this when asked to follow a manual QA script, test case, checklist, acceptance flow, or user-provided instructions.
|
|
4
|
+
|
|
5
|
+
Contract:
|
|
6
|
+
Execute the script. Do not explore unrelated screens, read app source, invent missing requirements, or broaden scope.
|
|
7
|
+
Stop and report ambiguity when a required target or expected result is not visible after the documented recovery steps.
|
|
8
|
+
|
|
9
|
+
Loop:
|
|
10
|
+
1. Open the requested app; use --relaunch only when the script needs fresh state.
|
|
11
|
+
2. Run snapshot -i to get current refs for the next step.
|
|
12
|
+
3. Run press/fill/click/longpress <ref-or-selector> --settle for each mutating step.
|
|
13
|
+
4. Treat a settled:true diff as the next observation. Do not add wait stable or another snapshot when the diff already shows the next target or expected result.
|
|
14
|
+
5. If --settle prints not settled, follow its hint before the next ref-based action.
|
|
15
|
+
6. Verify named expectations with wait text/selector, get, is, find, or the settled diff. A bare screenshot/snapshot is not verification for a named expectation.
|
|
16
|
+
7. Close the session when the script ends.
|
|
17
|
+
|
|
18
|
+
Command shapes:
|
|
19
|
+
agent-device open com.example.app --relaunch
|
|
20
|
+
agent-device open https://example.com/deep-link
|
|
21
|
+
agent-device snapshot -i
|
|
22
|
+
agent-device press @e12 --settle
|
|
23
|
+
agent-device press 'label="Follow"'
|
|
24
|
+
agent-device fill @e13 "qa@example.com" --settle
|
|
25
|
+
agent-device wait text "Order placed" 3000
|
|
26
|
+
agent-device close
|
|
27
|
+
--relaunch forces fresh app state; a deep link/URL open does not need it. Labels with an apostrophe or quote (label="Don't leave") are shell-quoting hazards: prefer the @ref from the latest snapshot/settle output over quoting the literal label.
|
|
28
|
+
|
|
29
|
+
Targets:
|
|
30
|
+
Prefer refs from the latest snapshot -i or settled diff. Use durable selectors when the label/id is known: label="Search", id="submit", role=button label="Follow".
|
|
31
|
+
For text fields, use fill <target> <text> --settle to replace the field value; use type only to append to an already-focused field.
|
|
32
|
+
Do not use placeholders such as @ref, @eN, <button>, or <selector> in a final command plan. If the ref is unknown, first run snapshot -i.
|
|
33
|
+
Coordinates are fallback-only after refs/selectors fail or accessibility omits the target; use screenshot or snapshot -i --json to choose a visible center point.
|
|
34
|
+
|
|
35
|
+
Recovery:
|
|
36
|
+
Network/typeahead result missing: wait text "Expected result" or wait <selector>.
|
|
37
|
+
Keyboard blocks target: keyboard dismiss when supported, then snapshot -i.
|
|
38
|
+
Sparse or recovered accessibility snapshot: use screenshot as visual truth, leave the bad screen if needed, then retry snapshot -i.
|
|
39
|
+
Non-hittable success hint: verify with the settled diff or snapshot; retarget by a better ref/selector if the UI did not change.`},workflow:{summary:`Normal agent-device bootstrap, exploration, and validation loop`,body:`agent-device help workflow
|
|
2
40
|
|
|
3
41
|
Version-matched operating guide for normal agent-device work.
|
|
4
42
|
|
|
5
43
|
Core loop:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Fresh machine or first iOS run:
|
|
10
|
-
Run agent-device doctor --platform ios first. Besides preflight checks it warms the iOS XCTest runner build cache in the background, so the first open skips the runner build (~10s). To block until fully warm instead, run agent-device prepare ios-runner.
|
|
44
|
+
Start with the top-level Agent Starting Point for the default settle-first loop. This topic is the full reference for command shapes, refs, selectors, waits, recovery, and platform limits.
|
|
45
|
+
If you intentionally skip --settle or use a command that does not support it, verify a mutation with diff snapshot (or diff snapshot -i) instead of a full snapshot: it diffs the rendered snapshot lines against the previous one in this session and prints only what changed.
|
|
11
46
|
|
|
12
47
|
Command shape:
|
|
13
48
|
Plans should use agent-device commands, not raw platform tools, pseudo commands, package-manager aliases, or helper prose.
|
|
@@ -19,7 +54,7 @@ Command shape:
|
|
|
19
54
|
Snapshot refs look like @e12. After snapshot -i, use the exact @eN ref from that output.
|
|
20
55
|
If the exact ref is not known yet, first output snapshot -i, then use a concrete example shape like press @e12 in the next command; do not write @<ref>, @ref, @Label_Name, or @eN placeholders.
|
|
21
56
|
Close means agent-device close. App-owned back means back; system back means back --system.
|
|
22
|
-
Taps are press or click; tap is an alias for press. Gestures use swipe, longpress, or gesture <pan|fling|swipe|pinch|rotate|transform>. Use gesture swipe left|right for reliable in-page horizontal swipes, and gesture swipe right-edge for left-edge navigation/back gestures. Android swipe, pinch, rotate, and transform use provider-native touch injection when available, then the bundled touch helper. iOS simulator transform uses private XCTest synthesis for a continuous two-finger pan/scale/rotation path; otherwise it reports UNSUPPORTED_OPERATION.
|
|
57
|
+
Taps are press or click; tap is an alias for press. On Android TV and tvOS, read help tv and use tv-remote press up|down|left|right|select to move D-pad/remote focus before activating controls; use tv-remote longpress <button> for a held remote button. Gestures use swipe, longpress, or gesture <pan|fling|swipe|pinch|rotate|transform>. Use gesture swipe left|right for reliable in-page horizontal swipes, and gesture swipe right-edge for left-edge navigation/back gestures. Android swipe, pinch, rotate, and transform use provider-native touch injection when available, then the bundled touch helper. iOS simulator transform uses private XCTest synthesis for a continuous two-finger pan/scale/rotation path; otherwise it reports UNSUPPORTED_OPERATION.
|
|
23
58
|
|
|
24
59
|
Bootstrap:
|
|
25
60
|
agent-device devices --platform ios
|
|
@@ -46,17 +81,18 @@ Snapshots and refs:
|
|
|
46
81
|
@e13 [textinput] label="Notes" preview="Leave at side..." truncated -> snapshot -s @e13 before reading.
|
|
47
82
|
@e14 [cell] label="Profiles" focused -> tvOS focus is currently on this row.
|
|
48
83
|
[off-screen below] 4 items: "Privacy", "About" -> scroll down, then snapshot -i; those are hints, not refs.
|
|
49
|
-
|
|
84
|
+
For press/fill/click/longpress, prefer --settle and continue from its settled diff when it exposes the next target or evidence. Refresh with snapshot -i only when you did not settle, settle printed not settled, or the settle output lacks what you need.
|
|
50
85
|
Anti-pattern: snapshot -i followed by snapshot -i | grep ..., or adding 2>/dev/null | jq ... before reading the raw command output.
|
|
51
86
|
Refs from the first snapshot remain valid until you press, click, fill, type, scroll, go back, wait for async UI, or otherwise change app state.
|
|
52
|
-
|
|
53
|
-
After a mutation, prefer a known selector/label directly (for example press 'label="Send"') because interaction commands refresh interactive state internally. If you need to discover
|
|
87
|
+
Pinned refs (@e12~s4, generation from refsGeneration or settle.refsGeneration) get exact staleness warnings instead of the coarse tree-changed one; plain refs stay valid input.
|
|
88
|
+
After a mutation, prefer a known selector/label directly (for example press 'label="Send"') because interaction commands refresh interactive state internally. A settled diff with no added refs (for example a modal dismiss) also lists an "unchanged interactive" tail of still-present refs, so check that before falling back. If you need to discover a new control not shown by settle or its tail, use snapshot -i, or snapshot -i -s "Composer" when a stable container label/id can scope the refresh.
|
|
54
89
|
If typing/fill opened the keyboard or changed layout and the next target has no stable selector, run snapshot -i, use the fresh ref, then verify with wait/find or diff snapshot -i.
|
|
55
90
|
For a targeted query, use find/get/is. If you truly need the full tree again, pass --force-full.
|
|
56
91
|
Off-screen summaries are scroll hints; use scroll, not swipe, then snapshot -i.
|
|
57
92
|
Missing target in a long list: use a short manual scroll + snapshot loop with a max attempt count. If a named target is summarized as off-screen below/above, use scroll down/up, then snapshot -i; do not use scroll bottom/top because the target may appear before the absolute list edge. Use scroll bottom/top only when the task explicitly asks for the list edge. Edge scrolls verify hidden content with snapshots and stop when no matching hidden content remains.
|
|
58
93
|
Truncated text/input previews: do not use get text first; expand with snapshot -s @ref (for example snapshot -s @e7), then read the scoped output.
|
|
59
94
|
Rare iOS accessibility gaps: if a row ref is shown disabled/hittable:false and press @ref reports success but no UI change, or a horizontal tab/filter bar is collapsed into one composite/seekbar with no child refs, run agent-device snapshot -i --json to read rects, compute the target center, press x y, then diff snapshot -i. Coordinates are fallback-only; document why you used them.
|
|
95
|
+
TV focus gaps: read help tv. If a fresh snapshot exposes focused nodes, verify with is focused <selector>; use wait focused=true only on apps where repeated snapshots preserve focus metadata. If the app exposes only a surface view or focus metadata is transient, use screenshot/snapshot diff as visual truth and tv-remote press directions/select; do not switch to raw adb keyevent in command plans.
|
|
60
96
|
|
|
61
97
|
Selectors:
|
|
62
98
|
Use selectors as positional targets: id="field-email" or label="Allow".
|
|
@@ -100,7 +136,7 @@ Read-only and waits:
|
|
|
100
136
|
For network-backed search/typeahead, --settle confirms the local UI quieted after fill/press; use wait text "Expected result" or wait <result selector> for server-loaded content that can arrive later.
|
|
101
137
|
agent-device find "Increment" press --json
|
|
102
138
|
For async/list text presence, prefer wait text over is visible when no interaction is needed.
|
|
103
|
-
wait stable [quietMs] [timeoutMs] (defaults 500/10000)
|
|
139
|
+
wait stable [quietMs] [timeoutMs] (defaults 500/10000) is a fallback for open/relaunch/navigation, unsupported mutating commands, or a mutation where you intentionally did not use --settle. Do not insert wait stable after press/fill/click/longpress --settle when the settled diff already shows what changed. wait stable polls the interactive-only tree and resolves once two or more consecutive captures are unchanged for quietMs, or fails with the standard wait-timeout shape plus capture stats (captures, nodeCount).
|
|
104
140
|
Use snapshot -i only when refs are needed for an action or targeted query.
|
|
105
141
|
Ambiguous find: add --first or --last. If info is not visible/exposed, report that gap instead of typing/searching/navigating to reveal it.
|
|
106
142
|
|
|
@@ -113,6 +149,7 @@ Navigation and gestures:
|
|
|
113
149
|
If app-owned back is ambiguous or has just misrouted, prefer a visible nav/back button ref, tab-bar ref, or deep link over repeated back/system back.
|
|
114
150
|
App-owned action sheets, menus, and camera/scan screens are normal UI. After opening one, run snapshot -i or wait for the option, press by label/ref, handle visible permission sheets through UI or platform-supported native alerts, then wait for a concrete result before returning to chat/form state.
|
|
115
151
|
Keep count/pause/pattern on one swipe; flags are --count, --pause-ms, --pattern ping-pong.
|
|
152
|
+
For repeated iOS gesture smoke checks, use press <x> <y> --count <n> --jitter-px <n> for tap series and swipe <x1> <y1> <x2> <y2> --count <n> for drag series.
|
|
116
153
|
longpress accepts coordinates, @refs, or selectors. Prefer @ref/selector from snapshot -i; use coordinates only as a fallback when accessibility refs miss the exact target. Duration and gesture scale/center are positional:
|
|
117
154
|
agent-device longpress 300 500 800
|
|
118
155
|
agent-device longpress @e12 800
|
|
@@ -145,7 +182,7 @@ Validation and evidence:
|
|
|
145
182
|
agent-device press 124 817
|
|
146
183
|
agent-device snapshot -i
|
|
147
184
|
Startup/CPU/memory/frame first pass: perf metrics --json (bare perf and metrics are aliases). Focused frame/jank health: perf frames --json. Memory-only sample: perf memory sample --json returns compact JSON with bounded top offenders. Heap/memgraph artifact escalation: perf memory snapshot --out heap.artifact; use --kind android-hprof on Android or --kind memgraph on supported Apple simulator/macOS app sessions. Android native profiling: perf cpu profile start|stop|report --kind simpleperf --out <path>; Android native traces: perf trace start|stop --kind perfetto --out <path>. Artifact collectors return compact state/path/size metadata only; raw heap/profile/trace files stay on disk. Treat native perf output as the agent evidence: for example, a Perfetto stop can return state=stopped, outPath=/tmp/app.perfetto-trace, sizeBytes=5392410, and method=adb-shell-perfetto while the 5.3 MB raw trace stays in the artifact. This is better than raw dumps for agents because it is stable, bounded, and keeps large artifacts out of context. heapprofd is deferred until Perfetto plumbing is available. Replay maintenance: replay -u ./flow.ad.
|
|
148
|
-
Recording: record start/stop. Use --max-size to cap the longest edge and --quality medium|high to choose output quality across Android and Apple targets. By default, stop burns touch overlays into the video; use record start --hide-touches for the fastest raw recording. Android record start publishes a durable device manifest. Android adb screenrecord has a 180s platform limit, so longer Android recordings are returned as multiple MP4 chunks while the daemon stays alive; after daemon restart, record stop recovers only manifest-owned chunks and warns when gesture overlays are unavailable. For gesture-heavy iOS simulator proof videos, prefer --hide-touches because overlay timing depends on a stable runner session while gestures are executing. Tracing: trace start ./trace.log, trace stop ./trace.log. Paths are positional.
|
|
185
|
+
Recording: record start/stop. The default scope is app and expects an active session created by open <app>; this keeps app proof videos tied to the intended app session. Use record start --scope device/system to explicitly request whole-screen capture where the selected backend supports it, such as recordings that intentionally span multiple apps, home screen, settings, or app transitions. Use --max-size to cap the longest edge and --quality medium|high to choose output quality across Android and Apple targets. By default, stop burns touch overlays into the video; use record start --hide-touches for the fastest raw recording. Android record start publishes a durable device manifest. Android adb screenrecord has a 180s platform limit, so longer Android recordings are returned as multiple MP4 chunks while the daemon stays alive; after daemon restart, record stop recovers only manifest-owned chunks and warns when gesture overlays are unavailable. For gesture-heavy iOS simulator proof videos, prefer --hide-touches because overlay timing depends on a stable runner session while gestures are executing. Tracing: trace start ./trace.log, trace stop ./trace.log. Paths are positional.
|
|
149
186
|
Stable known flow: batch ./steps.json, not workflow batch.
|
|
150
187
|
Inline batch JSON example:
|
|
151
188
|
agent-device batch --steps '[{"command":"open","input":{"app":"settings"}},{"command":"wait","input":{"kind":"duration","durationMs":100}}]'
|
|
@@ -183,12 +220,12 @@ Validation and evidence:
|
|
|
183
220
|
agent-device test ./e2e/maestro --maestro --device udid1,emulator-5554 --shard-all 2
|
|
184
221
|
|
|
185
222
|
React Native dev loop:
|
|
186
|
-
JS-only change with Metro connected:
|
|
223
|
+
JS-only change with Metro or Re.Pack connected:
|
|
187
224
|
agent-device metro reload
|
|
188
225
|
agent-device find "Home"
|
|
189
226
|
Do not use agent-device reload. Use open --relaunch for native startup reset.
|
|
190
|
-
React Native apps: use help react-native for Metro/Fast Refresh, DevTools routing, and RN-specific blockers; use react-native dismiss-overlay for LogBox/RedBox overlays.
|
|
191
|
-
Android RN/Expo
|
|
227
|
+
React Native apps: use help react-native for Metro/Re.Pack Fast Refresh, DevTools routing, and RN-specific blockers; use react-native dismiss-overlay for LogBox/RedBox overlays.
|
|
228
|
+
Android RN/Expo/Re.Pack dev server: direct Android URL opens to localhost/127.0.0.1/[::1] with a port auto-configure host reachability. Manual adb reverse tcp:<port> tcp:<port> is only needed for app/package launches or unsupported flows where the app cannot reach the local dev server.
|
|
192
229
|
Expo Go is a host shell. Use a provided project URL instead of inventing a bundle id; if no URL is provided but a target/app name is provided, open that target and do not inspect project files to find one. On iOS, prefer host + URL when the host shell is known because direct URL open can report success while leaving the runner/shell focused; verify with snapshot -i after opening:
|
|
193
230
|
agent-device open "Expo Go" exp://127.0.0.1:8081 --platform ios
|
|
194
231
|
agent-device snapshot -i --platform ios
|
|
@@ -200,7 +237,9 @@ React Native dev loop:
|
|
|
200
237
|
agent-device open exp://127.0.0.1:8081 --platform android
|
|
201
238
|
Android URL/deep-link opens infer the foreground package after launch when possible, so logs/perf can remain package-bound. If perf still says no package is associated, open the host package/app id first, then open the URL in the same session.
|
|
202
239
|
If apps lookup misses the project but shows Expo Go/dev-client and a project URL is available, open the URL/host shell; if no URL is available, ask instead of inventing an app id.
|
|
203
|
-
Expo Dev Client/development builds: open the installed dev-client app id/name; if a dev-client URL is provided, open that URL next. For
|
|
240
|
+
Expo Dev Client/development builds: open the installed dev-client app id/name; if a dev-client URL is provided, open that URL next. For Expo setup use metro prepare --kind expo.
|
|
241
|
+
Re.Pack/Rspack apps: use metro prepare --kind repack, or rely on auto-detection when @callstack/repack is in the selected package.json. The command name remains metro for compatibility, but prepare/reload use the shared React Native dev-server /status, /reload, and bundle URL protocol. prepare runs react-native rspack-start when rspack.config.* exists, and react-native webpack-start when webpack.config.* exists.
|
|
242
|
+
Module Federation super-apps: treat the native host and each JS-only remote as separate dev-server endpoints. Prepare or reload the host/root with its port, and pass a remote's --bundle-url or --metro-port when you need to target that remote's Re.Pack server.
|
|
204
243
|
|
|
205
244
|
Guarantees:
|
|
206
245
|
Statements of fact for agents to reason from without probing them via trial commands. Each is backed by source in the agent-device repo; behavior changes land with an updated statement here.
|
|
@@ -208,17 +247,54 @@ Guarantees:
|
|
|
208
247
|
Hittability: iOS AX hittable:false on a resolved node does not block resolution or fail the command; non-hittable resolution is allowed by design because iOS AX hittable flags are unreliable on deep React Native trees. press/fill/click success responses carry targetHittable: false plus a hint when the resolved ref or selector target reports hittable: false, so treat that as a signal to verify with a snapshot or re-target, not as a failure.
|
|
209
248
|
Open: on iOS, open <app> without --relaunch dispatches a plain simctl launch, which is idempotent-foreground for an already-running app (it brings the process forward; it does not restart it). open --relaunch restarts the app; on iOS simulators (not real devices or macOS) this collapses to one simctl launch --terminate-running-process call instead of a separate terminate-then-launch, so relaunch is a single step there.
|
|
210
249
|
Close and runner retention: close keeps a healthy iOS simulator XCTest runner warm by default so the next open on that device skips the runner build, unless --shutdown was requested, the session was recording, the session held a device lease, or the device used a scoped (non-default) simulator set — any of those tear the runner down on close. A retained runner auto-stops after an idle window (default 5 minutes) to release the device's runner lease for other daemons; set AGENT_DEVICE_IOS_RUNNER_IDLE_STOP_MS to override the window, or 0 to disable idle stop and retain until daemon exit.
|
|
250
|
+
Daemon lifetime and stale lease takeover: each AGENT_DEVICE_STATE_DIR runs its own daemon. It self-exits after an idle window (default 5 minutes, matching the runner idle-stop default) once it has no open sessions, no in-flight requests, and no active recording; an open session always blocks this even if quiet for minutes between commands. Set AGENT_DEVICE_DAEMON_IDLE_TIMEOUT_MS to override the window, or 0 to disable idle reap and run until killed. A stale iOS runner lease — its owner process dead, or its AGENT_DEVICE_STATE_DIR deleted — is reclaimed automatically instead of failing with "is already owned by another agent-device daemon"; a genuinely live owner whose state dir still exists still rejects with that error.
|
|
211
251
|
Ref lifetime: refs from a snapshot/snapshot -i are only valid until the next state-changing command. open and open --relaunch clear the session's stored snapshot outright, so every ref from before an open/relaunch is invalid; press/fill/click/scroll/back and similar mutations invalidate refs from prior turns even though the session snapshot itself is refreshed internally by those commands.
|
|
212
252
|
Snapshot diff: diff snapshot compares the current capture against the session's last stored snapshot (from any prior snapshot, snapshot -i, or diff snapshot call), not a fixed baseline from session start. If no prior snapshot exists yet, diff snapshot initializes the baseline and reports zero additions/removals instead of failing.
|
|
213
253
|
Wait: wait text|selector|@ref polls on a fixed interval (300ms) up to a timeout (10s default, override with the trailing timeoutMs positional) by re-capturing state each poll; it does not push/subscribe. Timing out raises a command failure rather than returning a not-found result.
|
|
214
254
|
|
|
215
255
|
Escalate:
|
|
256
|
+
help manual-qa scripted manual QA and acceptance checks
|
|
257
|
+
help dogfood exploratory QA report workflow
|
|
258
|
+
help validate engineering self-validation loops
|
|
216
259
|
help debugging logs, network, alerts, traces, flaky runtime failures
|
|
260
|
+
help tv Android TV and tvOS focus-first remote navigation
|
|
217
261
|
help react-devtools React Native performance, profiling, props/state/hooks, slow renders, rerenders
|
|
218
|
-
help react-native React Native app automation hazards, overlays, Metro, and routing
|
|
262
|
+
help react-native React Native app automation hazards, overlays, Metro/Re.Pack, and routing
|
|
219
263
|
help remote remote/cloud config, tenant, lease, local service tunnels
|
|
220
|
-
help macos desktop, frontmost-app, menu bar surfaces
|
|
221
|
-
|
|
264
|
+
help macos desktop, frontmost-app, menu bar surfaces`},tv:{summary:`Android TV and tvOS focus-first remote navigation`,body:`agent-device help tv
|
|
265
|
+
|
|
266
|
+
Use this when the target is Android TV, Apple TV, or tvOS. TV surfaces are focus-first: move focus with remote/D-pad buttons, then activate the focused control.
|
|
267
|
+
|
|
268
|
+
Core loop:
|
|
269
|
+
agent-device open Settings --platform android --target tv --session tv
|
|
270
|
+
agent-device snapshot -i --platform android --target tv --session tv
|
|
271
|
+
agent-device tv-remote press down --platform android --target tv --session tv
|
|
272
|
+
agent-device is focused 'label="Profiles"' --platform android --target tv --session tv
|
|
273
|
+
agent-device tv-remote press select --platform android --target tv --session tv
|
|
274
|
+
agent-device screenshot ./tv-focus.png --overlay-refs --platform android --target tv --session tv
|
|
275
|
+
|
|
276
|
+
Buttons:
|
|
277
|
+
tv-remote press up|down|left|right|select|menu|home|back
|
|
278
|
+
tv-remote longpress select
|
|
279
|
+
tv-remote press select --duration-ms 500
|
|
280
|
+
ok, center, and enter are input aliases for select; command output still reports button: "select".
|
|
281
|
+
longpress is CLI sugar for --duration-ms 500. --duration-ms overrides that preset.
|
|
282
|
+
--duration-ms holds a tvOS remote button for that duration. On Android TV, any positive duration maps to the ADB longpress form because Android input keyevent has no exact hold duration.
|
|
283
|
+
|
|
284
|
+
Android TV:
|
|
285
|
+
Android TV uses ADB keyevents behind agent-device tv-remote. Keep command plans on agent-device; do not switch to raw adb keyevent.
|
|
286
|
+
Use --target tv when a host has both phone/tablet and TV emulators/devices.
|
|
287
|
+
|
|
288
|
+
tvOS:
|
|
289
|
+
tvOS is driven by the Siri Remote focus engine, not coordinate taps.
|
|
290
|
+
back maps to the Menu remote button; home maps to the Home remote button.
|
|
291
|
+
Use --platform ios --target tv for Apple TV simulators and devices.
|
|
292
|
+
|
|
293
|
+
Focus and visual truth:
|
|
294
|
+
If snapshot -i exposes a focused node, verify it with is focused <selector>.
|
|
295
|
+
Use wait focused=true only when repeated snapshots preserve focus metadata for the app.
|
|
296
|
+
If the app exposes only a surface view, or focus metadata is transient, use screenshot --overlay-refs, screenshot, or diff snapshot as visual truth and keep moving focus with tv-remote.
|
|
297
|
+
Do not assume press/click @ref works on Android TV or tvOS until the desired element is focused.`},debugging:{summary:`Targeted failure evidence without dumping stale context`,body:`agent-device help debugging
|
|
222
298
|
|
|
223
299
|
Use this when behavior fails, hangs, times out, throws alerts, or needs runtime evidence.
|
|
224
300
|
|
|
@@ -236,6 +312,12 @@ Logs:
|
|
|
236
312
|
agent-device open MyApp --platform ios --relaunch --launch-console ./artifacts/app.console.log
|
|
237
313
|
--launch-console is only for direct iOS simulator app launches, not URL opens.
|
|
238
314
|
|
|
315
|
+
Events:
|
|
316
|
+
Use events for a compact session timeline without dumping full app logs.
|
|
317
|
+
agent-device events
|
|
318
|
+
agent-device events 50 100
|
|
319
|
+
Events preserve command names, status, durations, paths, session/device/app identifiers, refs/selectors, and coordinates. Typed text, clipboard writes, push/event payloads, raw unknown command arguments, and matching raw message fragments are replaced with length-only placeholders. --no-record suppresses action.recorded entries, but request start/finish entries still record command, status, and timing.
|
|
320
|
+
|
|
239
321
|
Network:
|
|
240
322
|
Use network dump for recent session HTTP traffic parsed from app logs.
|
|
241
323
|
agent-device network dump --include headers
|
|
@@ -443,27 +525,24 @@ This topic covers React Native-specific automation hazards and routes deeper
|
|
|
443
525
|
questions to the owning help topic.
|
|
444
526
|
|
|
445
527
|
Choose the next help topic:
|
|
446
|
-
|
|
528
|
+
Routine QA/dogfood/manual-test flow (open, snapshot -i, press/fill --settle, verify, close): help manual-qa; it has the concrete command shapes, so you should not need generic navigation help for a normal pass.
|
|
529
|
+
Deep exploration of navigation/selector/ref edge cases, or a serial-command question manual-qa does not answer: help workflow (full reference, larger read).
|
|
447
530
|
Logs, network, diagnostics, traces, permission dialogs, or runtime failures: help debugging.
|
|
448
531
|
Component tree, props/state/hooks, slow renders, rerenders, or render causes: help react-devtools.
|
|
449
532
|
JS heap growth, heap snapshots, allocation hotspots, or retained-object leaks: help cdp.
|
|
450
533
|
Remote/cloud config, leases, and local service tunnels: help remote.
|
|
451
534
|
|
|
452
535
|
React Native dev loop:
|
|
453
|
-
|
|
454
|
-
agent-device doctor --platform android
|
|
455
|
-
agent-device doctor --platform ios
|
|
456
|
-
agent-device doctor --platform android --app com.example.app
|
|
457
|
-
agent-device doctor --remote --remote-config ./remote.json
|
|
536
|
+
Do not run doctor as routine QA/dogfood prep. Use doctor only when the user asks for setup diagnostics or a command failure points to an unhealthy device, runner, dev-server, or remote environment.
|
|
458
537
|
For "start from screen X" flows, prefer open --relaunch before the first snapshot so the app does not reuse a prior in-progress navigation state.
|
|
459
|
-
JS-only change with Metro connected:
|
|
538
|
+
JS-only change with Metro or Re.Pack connected:
|
|
460
539
|
agent-device metro reload
|
|
461
540
|
agent-device find "Home"
|
|
462
541
|
Do not use agent-device reload. Use open --relaunch for native startup reset.
|
|
463
|
-
Android RN/Expo
|
|
464
|
-
Verify Metro from the same host context that owns
|
|
465
|
-
adb reverse only affects Android device-to-host traffic. It does not prove host-to-
|
|
466
|
-
Multiple local worktrees can reuse one native iOS simulator build by running each worktree's
|
|
542
|
+
Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability. For app/package launches, run metro prepare when the app cannot reach the local dev server.
|
|
543
|
+
Verify Metro/Re.Pack from the same host context that owns the dev server. If a sandboxed shell cannot curl localhost:8081/status but an unrestricted host shell can, the dev server is running and the sandbox probe is not authoritative.
|
|
544
|
+
adb reverse only affects Android device-to-host traffic. It does not prove host-to-dev-server reachability, and it does not fix a redbox caused by a stale or wrong bundle/app state.
|
|
545
|
+
Multiple local worktrees can reuse one native iOS simulator build by running each worktree's dev server on a different port and opening the same installed app on different simulators with explicit runtime hints:
|
|
467
546
|
agent-device open "React Navigation Example" --platform ios --device "iPhone 17" --session rn-a --metro-host 127.0.0.1 --metro-port 8081 --relaunch
|
|
468
547
|
agent-device open "React Navigation Example" --platform ios --device "iPhone 17 Pro" --session rn-b --metro-host 127.0.0.1 --metro-port 8082 --relaunch
|
|
469
548
|
iOS simulator opens write React Native's per-simulator debug server settings before launch, so those ports do not conflict across simulators. Use separate sessions/devices, close both sessions when done, and rebuild only for native changes or dependency changes that affect the binary. One simulator cannot run two copies of the same bundle id.
|
|
@@ -519,7 +598,7 @@ Slow-flow investigation:
|
|
|
519
598
|
Report React render offenders separately from network/backend waits and device frame/CPU/memory findings.`},"physical-device":{summary:`Connected phone/tablet setup and iOS signing prerequisites`,body:`agent-device help physical-device
|
|
520
599
|
|
|
521
600
|
Use this when the target is connected hardware instead of a simulator/emulator.
|
|
522
|
-
For simulator/emulator
|
|
601
|
+
For simulator/emulator flows, use help manual-qa for routine QA or help workflow for the full reference.
|
|
523
602
|
|
|
524
603
|
Discovery:
|
|
525
604
|
agent-device devices --platform ios
|
|
@@ -721,7 +800,7 @@ Coverage:
|
|
|
721
800
|
Navigation, forms, empty/error/loading states, offline or retry behavior, permissions, settings, accessibility labels, orientation/keyboard, and obvious performance stalls.
|
|
722
801
|
React Native warning/error overlays can be real findings or test blockers. Capture them, use react-native dismiss-overlay if unrelated, re-snapshot, and report them.
|
|
723
802
|
Expo Go/dev-client shells: use the provided exp:// or dev-client URL and record whether the shell, project load, or app UI is being tested. On iOS dogfood, prefer agent-device open "Expo Go" <url> when Expo Go is the known shell, then snapshot -i to confirm the project UI rather than the runner splash.
|
|
724
|
-
Android RN/Expo
|
|
803
|
+
Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability.
|
|
725
804
|
Categories: visual, functional, UX, content, performance, diagnostics, permissions, accessibility.
|
|
726
805
|
Severity: critical blocks a core flow/data/crashes; high breaks a major feature; medium has friction or workaround; low is polish.
|
|
727
806
|
|
|
@@ -752,12 +831,44 @@ Report shape:
|
|
|
752
831
|
|
|
753
832
|
Rules:
|
|
754
833
|
Findings must come from observed runtime behavior, not source reads.
|
|
755
|
-
|
|
834
|
+
After each mutation, use the --settle diff as evidence when available; otherwise re-snapshot.
|
|
756
835
|
Keep commands in the report reproducible; use selectors or refs from fresh snapshots, not guessed coordinates.
|
|
757
836
|
Prefer refs for exploration and selectors for deterministic replay.
|
|
758
837
|
Use logs, network, screenshot --overlay-refs, trace, perf metrics, perf frames, or react-devtools only when they add evidence to a specific issue.
|
|
759
838
|
Never delete screenshots, videos, traces, or report artifacts during a session.
|
|
760
|
-
Escalate to help debugging or help react-devtools when runtime symptoms require those tools.`}
|
|
839
|
+
Escalate to help debugging or help react-devtools when runtime symptoms require those tools.`},validate:{summary:`Engineering self-validation with device evidence and cleanup`,body:`agent-device help validate
|
|
840
|
+
|
|
841
|
+
Use this when validating a code change, release candidate, performance fix, visual behavior, logging path, replay, or device-facing regression.
|
|
842
|
+
|
|
843
|
+
Contract:
|
|
844
|
+
Prove the changed behavior through public agent-device surfaces. Do not validate against stale dist output, a retained stale daemon, or a runner built before the change.
|
|
845
|
+
Keep evidence reproducible: exact commands, target device/app, observed output, artifact paths, and cleanup status.
|
|
846
|
+
|
|
847
|
+
Before device verification:
|
|
848
|
+
If TypeScript runtime or CLI output changed, run pnpm build first, then pnpm clean:daemon so bin/agent-device.mjs uses current dist and no stale daemon is serving old code.
|
|
849
|
+
If Apple runner code changed, run pnpm build:xcuitest and avoid inherited retained runners from older source.
|
|
850
|
+
Use open --relaunch when startup state matters. Use a purpose-specific --session for multi-step validation.
|
|
851
|
+
|
|
852
|
+
Loop:
|
|
853
|
+
1. Build or prepare the changed surface with the repo command that owns it.
|
|
854
|
+
2. Open the target app/device state explicitly.
|
|
855
|
+
3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps.
|
|
856
|
+
4. Use the settled diff as evidence when it shows the changed behavior; otherwise verify with wait/get/is/find, screenshot, logs, network, perf, or trace based on the claim.
|
|
857
|
+
5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question.
|
|
858
|
+
6. Close sessions and release leases before finishing.
|
|
859
|
+
|
|
860
|
+
Evidence:
|
|
861
|
+
CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test.
|
|
862
|
+
Apple runner freshness: pnpm build:xcuitest, then a live agent-device command on the target simulator/device.
|
|
863
|
+
Visual claim: screenshot, optionally screenshot --overlay-refs when target mapping matters.
|
|
864
|
+
Runtime/logging claim: logs clear --restart, logs mark, reproduce, logs path.
|
|
865
|
+
Network claim: network dump --include headers when headers are relevant.
|
|
866
|
+
Performance claim: perf metrics, perf frames, perf memory sample, or trace artifacts with bounded output.
|
|
867
|
+
Replay/regression claim: replay or test through the public command path.
|
|
868
|
+
|
|
869
|
+
Report:
|
|
870
|
+
Summarize what changed, exact validation commands, pass/fail observations, artifact paths, and residual risk.
|
|
871
|
+
If live validation is blocked, state the blocker, device/session, and exact next command needed.`}};function f(e){let t=e.endsWith(`?`),n=t?e.slice(0,-1):e;return t?`[${n}]`:`<${n}>`}function p(e,t,n){let r=n.endsWith(`?`),i=r?n.slice(0,-1):n,a=/^[a-z-]+(?:\|[a-z-]+)+$/i.test(i),o=a||t.usageOverride!==void 0&&t.usageOverride.startsWith(`${e} ${i}`);return r?a?`[${i}]`:o?i:`[${i}]`:o?i:`<${i}>`}function m(e,t){if(t.usageOverride)return t.usageOverride;let n=(t.positionalArgs??[]).map(f),r=(t.allowedFlags??[]).flatMap(e=>h(e).map(e=>e.usageLabel??e.names[0])).map(e=>`[${e}]`);return[e,...n,...r].join(` `)}function h(e){return n().filter(t=>t.key===e)}function g(e,t){return t.listUsageOverride?t.listUsageOverride:[e,...(t.positionalArgs??[]).map(n=>p(e,t,n))].join(` `)}function _(){let n=C(e().map(e=>{let t=r(e);return{name:e,schema:t,usage:g(e,t)}})),i=b(`Global Flags:`,y(t)),d=S(`Agent Starting Point:`,o),f=S(`Agent Quickstart:`,s);return`agent-device <command> [args] [--json]
|
|
761
872
|
|
|
762
873
|
CLI to automate supported app, device, desktop, and web targets for AI agents.
|
|
763
874
|
|
|
@@ -765,7 +876,7 @@ ${d}
|
|
|
765
876
|
|
|
766
877
|
${x(`Agent Workflows:`,a)}
|
|
767
878
|
|
|
768
|
-
${
|
|
879
|
+
${n}
|
|
769
880
|
|
|
770
881
|
${i}
|
|
771
882
|
|
|
@@ -776,7 +887,7 @@ ${S(`Configuration:`,c)}
|
|
|
776
887
|
${x(`Environment:`,l)}
|
|
777
888
|
|
|
778
889
|
${S(`Examples:`,u)}
|
|
779
|
-
`}function v(){return _()}function y(e){return
|
|
890
|
+
`}function v(){return _()}function y(e){return n().filter(t=>e.has(t.key)&&t.usageLabel!==void 0&&t.usageDescription!==void 0)}function b(e,t){return x(e,t.map(e=>({label:e.usageLabel??``,description:e.usageDescription??``})))}function x(e,t){if(t.length===0)return`${e}\n (none)`;let n=Math.max(...t.map(e=>Math.min(e.label.length,26)))+2,r=[e];for(let e of t){let t=e.label.length<=26?e.label.padEnd(n):`${e.label} `;r.push(` ${t}${e.description}`)}return r.join(`
|
|
780
891
|
`)}function S(e,t){return t.length===0?`${e}\n (none)`:[e,...t.map(e=>` ${e}`)].join(`
|
|
781
892
|
`)}function C(e){return x(`Commands:`,e.map(e=>({label:e.usage,description:e.schema.summary??e.schema.helpDescription})))}function w(e){let t=T(e);if(t)return t;let n=i(e);if(!n)return null;let r=m(e,n),a=y(new Set(n.allowedFlags??[])),o=[];a.length>0&&o.push(b(`Command flags:`,a));let s=o.length>0?`\n\n${o.join(`
|
|
782
893
|
|
|
@@ -791,5 +902,6 @@ Usage:
|
|
|
791
902
|
Related:
|
|
792
903
|
agent-device help command list and global flags
|
|
793
904
|
agent-device help <command> command-specific flags
|
|
794
|
-
agent-device help
|
|
905
|
+
agent-device help manual-qa routine QA loop with concrete command shapes
|
|
906
|
+
agent-device help workflow full app automation reference
|
|
795
907
|
`:null}export{w as buildCommandUsageText,v as buildUsageText};
|
package/dist/src/cli-runner.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e}from"./tv-remote.js";import{n as t}from"./registry.js";import{t as n}from"./cli-output.js";import{n as r}from"./command-surface.js";function i(t,n,r){if(t.json){e({success:!0,data:n});return}let i=r?.();i&&a(i)}function a(e){process.stdout.write(e.endsWith(`
|
|
2
2
|
`)?e:`${e}\n`)}const o=t();function s(e,t,n){let r=o[e];if(!r)throw Error(`Missing CLI reader for command: ${e}`);return r(t,n)}async function c(e){return(await l(e)).result}async function l(e){let t=s(e.command,e.positionals,e.flags),i=await r(e.client,e.command,t);return{result:i,cliOutput:n({name:e.command,input:t,result:i})}}export{i,l as n,s as r,c as t};
|