@swmansion/argent 0.35.1-next.2 → 0.35.1-next.20

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.
Files changed (52) hide show
  1. package/bin/argent-android-devtools-0.4.0.apk +0 -0
  2. package/bin/darwin/argent-macos-helper +0 -0
  3. package/bin/darwin/ax-service +0 -0
  4. package/bin/darwin/tvos-ax-service +0 -0
  5. package/bin/darwin/tvos-hid-daemon +0 -0
  6. package/bin/network-inspector/network-inspector.jar +0 -0
  7. package/bin/tcp/ax-service +0 -0
  8. package/dist/cli-cmds.mjs +1782 -1642
  9. package/dist/client.js +267 -250
  10. package/dist/fatal-handlers.js +7 -1
  11. package/dist/fatal-handlers.js.map +1 -1
  12. package/dist/installer.mjs +768 -550
  13. package/dist/mcp-server.mjs +1224 -1173
  14. package/dist/tool-args.generated.d.ts +353 -317
  15. package/dist/tool-server.cjs +103420 -102271
  16. package/dylibs/libArgentAudio.dylib +0 -0
  17. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  18. package/dylibs/libKeyboardPatch.dylib +0 -0
  19. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  20. package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
  21. package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
  22. package/dylibs/tcp/argent-audio-feeder +0 -0
  23. package/dylibs/tcp/libArgentAudio.dylib +0 -0
  24. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  25. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  26. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  27. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  28. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  29. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  30. package/package.json +2 -2
  31. package/skills/argent-android-emulator-setup/SKILL.md +2 -2
  32. package/skills/argent-create-e2e/SKILL.md +1 -1
  33. package/skills/argent-create-e2e/references/e2e-yaml.md +23 -2
  34. package/skills/argent-create-e2e/references/live-authoring.md +9 -0
  35. package/skills/argent-device-interact/SKILL.md +21 -94
  36. package/skills/argent-device-interact/references/advanced.md +64 -0
  37. package/skills/argent-ios-device-interact/SKILL.md +1 -1
  38. package/skills/argent-ios-device-setup/SKILL.md +1 -1
  39. package/skills/argent-ios-simulator-setup/SKILL.md +1 -1
  40. package/skills/argent-lens/SKILL.md +1 -1
  41. package/skills/argent-macos-app-interact/SKILL.md +1 -1
  42. package/skills/argent-metro-debugger/SKILL.md +1 -1
  43. package/skills/argent-native-profiler/SKILL.md +1 -1
  44. package/skills/argent-qa-e2e/SKILL.md +1 -1
  45. package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
  46. package/skills/argent-react-native-optimization/SKILL.md +1 -1
  47. package/skills/argent-react-native-profiler/SKILL.md +1 -1
  48. package/skills/argent-screen-recording/SKILL.md +1 -1
  49. package/skills/argent-screenshot-diff/SKILL.md +1 -1
  50. package/skills/argent-settings-permissions/SKILL.md +1 -1
  51. package/skills/argent-test-ui-flow/SKILL.md +1 -1
  52. package/skills/argent-tv-interact/SKILL.md +1 -1
@@ -16,23 +16,23 @@ export interface ArgentToolArgs {
16
16
  bundleId?: string;
17
17
  };
18
18
  "await-network-request": {
19
- /** Device ID passed as udid to network-capture-start. The wait reuses its Metro target. */
19
+ /** Device ID used in `network-capture-start`. */
20
20
  udid: string;
21
- /** The bundleId used for network-capture-start. On Chromium, use a valid placeholder such as argent.capture. */
21
+ /** `bundleId` used in `network-capture-start` (Chromium: placeholder like `argent.capture`). */
22
22
  bundleId: string;
23
- /** URL text or a pattern. Match a part with no secrets. The result includes the full URL and secret placeholders are rejected. */
23
+ /** URL text/regex to match (no `{{secret:...}}` placeholders; full URL is returned). */
24
24
  url: string;
25
- /** contains (default) and equals ignore case. matches uses a case-sensitive JavaScript regular expression with no implicit anchors. */
25
+ /** `contains` (default) / `equals` (case-insensitive) or `matches` (case-sensitive JS regex). */
26
26
  urlMatch?: "contains" | "equals" | "matches";
27
- /** HTTP method, matched without regard to case. */
27
+ /** HTTP method (case-insensitive). */
28
28
  method?: string;
29
- /** Exact HTTP status or a class such as "2xx". Failed requests can match if they received response headers. */
29
+ /** Exact HTTP status or class (e.g. "2xx"). */
30
30
  status?: "1xx" | "2xx" | "3xx" | "4xx" | "5xx" | number;
31
- /** complete (default) accepts a finished response, including HTTP errors. failed accepts a request error. any accepts either. */
31
+ /** `complete` (default, incl. HTTP errors), `failed` (network error), or `any`. */
32
32
  outcome?: "complete" | "failed" | "any";
33
- /** Wait limit in milliseconds. Default 10000. */
33
+ /** Timeout in ms (default 10000). */
34
34
  timeoutMs?: number;
35
- /** Interval between capture reads in milliseconds. Default 400. */
35
+ /** Poll interval in ms (default 400). */
36
36
  pollIntervalMs?: number;
37
37
  };
38
38
  "await-screen-idle": {
@@ -46,11 +46,11 @@ export interface ArgentToolArgs {
46
46
  minStableMs?: number;
47
47
  };
48
48
  "await-ui-element": {
49
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
49
+ /** Target device id from `list-devices`. */
50
50
  udid: string;
51
- /** What to wait for. `exists`: the selector matches an element anywhere in the tree. `visible`: it matches one with a non-zero on-screen frame. `hidden`: it matches nothing, or only a zero-area element (e.g. a spinner that went away). `text`: the first visible match in reading order (topmost, then leftmost; the first match overall if none is visible) contains expectedText, or equals it with textMatch `equals`. Only that match is checked, so if a loose selector hits several elements, narrow it to the one holding the text. On a Mac app, a match in an open menu comes first, then one in an alert, sheet or popover, then one in the window. */
51
+ /** `exists`: in tree; `visible`: non-zero on-screen frame; `hidden`: absent or zero-area; `text`: first visible match in reading order matches `expectedText`. On a Mac app, open menus match before alerts/sheets and the window. */
52
52
  condition: "exists" | "visible" | "hidden" | "text";
53
- /** Element to match. Give at least one field; every given field must match. */
53
+ /** Element matcher (at least one field; all given fields must match). */
54
54
  selector: {
55
55
  /** Case-insensitive substring of the element's visible label or value. */
56
56
  text?: string;
@@ -59,15 +59,15 @@ export interface ArgentToolArgs {
59
59
  /** Case-insensitive substring of the element's role (e.g. AXButton, button, TextView). */
60
60
  role?: string;
61
61
  };
62
- /** Required for condition `text`: the string the checked match must contain or equal (see `textMatch`). */
62
+ /** Required for `text`: expected substring or full string (see `textMatch`). */
63
63
  expectedText?: string;
64
- /** For condition `text`: how expectedText is compared. `contains` (default) is a case-insensitive substring; `equals` is a case-insensitive full-string match. */
64
+ /** Case-insensitive match mode for `text`: `contains` (default) or `equals`. */
65
65
  textMatch?: "contains" | "equals";
66
- /** iOS app bundle id, passed to the describe fallback (see `describe`). Ignored on every other platform, including physical iOS. */
66
+ /** iOS simulator only: fallback bundle id for `describe`. */
67
67
  bundleId?: string;
68
- /** Max time to wait for the condition before giving up (default 5000). */
68
+ /** Timeout in ms (default 5000). */
69
69
  timeoutMs?: number;
70
- /** How often to re-check the tree (default 400). */
70
+ /** Poll interval in ms (default 400). */
71
71
  pollIntervalMs?: number;
72
72
  };
73
73
  await_user_selection: {
@@ -75,37 +75,39 @@ export interface ArgentToolArgs {
75
75
  timeoutSeconds?: number;
76
76
  };
77
77
  "boot-device": {
78
- /** iOS: simulator UDID to boot (from `list-devices`). A Mac app id (`macos-app-<bundle id>`) starts that app again from its last path. */
78
+ /** iOS simulator UDID from `list-devices`. Or Mac app id (`macos-app-<bundle id>`) to relaunch from its last path. */
79
79
  udid?: string;
80
- /** Android: AVD to start, the `avdName` of a `list-devices` entry with kind 'avd'. A running emulator of it is reused when it fits the call: see `readOnly` and `port`. */
80
+ /** Android AVD name (`kind: 'avd'` from `list-devices`). Reuses a compatible running emulator. */
81
81
  avdName?: string;
82
- /** Vega (Fire TV): VVD image to boot: the `vvdImage` of a Vega device from `list-devices` (e.g. `tv`). */
82
+ /** Vega (Fire TV) VVD image name from `list-devices` (e.g. `tv`). */
83
83
  vvdImage?: string;
84
- /** HarmonyOS: emulator instance to start: the `name` of a `kind: "emulator"` device from `list-devices` (e.g. `Phone_1`); the `harmony-emulator-<name>` id that entry reports as its `udid` is accepted too. */
84
+ /** HarmonyOS emulator instance name or `harmony-emulator-<name>` id from `list-devices`. */
85
85
  harmonyInstance?: string;
86
- /** Android/Vega/HarmonyOS: overall budget for the boot sequence. Default 480000 (8 min) on Android, 120000 (2 min) on Vega, 180000 (3 min) on HarmonyOS, where with `force` it spans the shutdown as well as the boot. */
86
+ /** Overall boot budget in ms (Android default 480000, Vega 120000, HarmonyOS 180000). On HarmonyOS with `force`, this spans shutdown too. */
87
87
  bootTimeoutMs?: number;
88
- /** Shut down and re-boot the device even if already running. On HarmonyOS it is also what ties an already-running instance to its `hdc` connect key: without it the instance is left alone and its key stays unresolved (`list-devices` lists the keys, but not which instance each belongs to). On a Mac app it quits and restarts the app, also a copy of the same build running without the argent library: that copy loses its unsaved changes. When the app argent runs answers the quit with a save prompt, the call fails and the app keeps running. Force never quits a copy of another build (another .app path). Ignored for Electron, which always spawns a fresh process. */
88
+ /** Shut down and reboot even if already running. On HarmonyOS, also ties a running instance to its `hdc` connect key. On a Mac app, quits and restarts the same .app build, including a copy running without the argent library (losing its unsaved changes); fails if the app shows a save prompt. Ignored for Electron. */
89
89
  force?: boolean;
90
- /** Android only (argent never mutes other platforms): boot the emulator with audio output enabled. Defaults to false, so several agent-driven emulators don't all play sound on the host; pass `true` when the task involves playing, hearing, or testing audio. Takes effect at boot: if the emulator is already running muted, add `force: true`. The first boot after toggling is a slower cold boot (the snapshot was saved in the other audio mode). The `boot-sound` argent flag flips this default to true. */
90
+ /** Android only: enable emulator audio (default false, or `boot-sound` flag). Pair with `force: true` to toggle a running emulator. */
91
91
  sound?: boolean;
92
- /** Android on a macOS host only: boot the emulator with guest Vulkan. Defaults to false: guest Vulkan crashes Chrome's GPU process, which breaks Chrome and Custom Tab sign-in flows. Without it apps find no Vulkan device, although the guest still lists the Vulkan features, so a Vulkan-only renderer such as WebGPU (react-native-wgpu) draws nothing; pass `true` to test one. Takes effect at boot: an emulator already running in the other mode is reused with a `note`, and `force: true` reboots it. A boot snapshot saved in the other mode can't be reused, so the first boot after toggling is a slower cold boot. The `ARGENT_EMULATOR_GUEST_VULKAN` env var flips this default to true. Ignored on other hosts and platforms. */
92
+ /** Android on a macOS host only: enable guest Vulkan (default false; true needed for WebGPU/Vulkan renderers, may crash Chrome GPU). Pair with `force: true` to toggle. */
93
93
  guestVulkan?: boolean;
94
- /** Android only: boot the emulator with `-read-only`, so that several emulators can run one AVD at once, for example one per agent. Defaults to false. A read-only emulator saves no snapshot and loses its changes when it exits, so the AVD and its quickboot snapshot stay as they were. The emulator runs an AVD either writable once or read-only any number of times, never both, so the boot fails while the AVD runs writable, and a writable boot fails while the AVD runs in any instance it cannot reuse. A read-only boot reuses only a running read-only emulator. Ignored on other platforms. */
94
+ /** Android only: boot `-read-only` (default false) to run multiple concurrent instances of one AVD without saving snapshot changes. */
95
95
  readOnly?: boolean;
96
- /** Android only: the emulator's console port, an even number from 5554 to 5584 (`emulator -port`), the range adb finds emulators in; its serial is `emulator-<port>`. Without it the emulator takes the first free port from 5554 up, as Android Studio does. The gRPC server Argent needs for screenshots and gestures goes on the port plus 3000, which must be free too. Given a port, the tool reuses only the emulator on that port and fails if another emulator holds it, or if this AVD runs there writable on a read-only boot and `force` is not set. A read-only emulator started with `-port` belongs to the calls that give that port: a call without `port` never reuses or shuts it down. Where the process list cannot be read (Windows, or a failed `ps`), Argent knows only the pinned emulators it booted itself, so a writable call without `port` can reuse, or with `force` shut down, one that someone else pinned. A writable one is still reused, or with `force` shut down, by a writable call without `port`, since the AVD runs one writable emulator at a time. `force` shuts nothing down when another emulator of the AVD would still block the boot. Ignored on other platforms. */
96
+ /** Android only: emulator console port (even, 5554–5584; serial `emulator-<port>`, gRPC on port+3000). Defaults to first free port. */
97
97
  port?: number;
98
- /** iOS only: boot the simulator core WITHOUT opening its GUI window (Simulator.app, or Device Hub on Xcode 27+). The device still streams via simulator-server. The `ARGENT_SIMULATOR_NO_WINDOW` env var (1/true/yes) forces this host-wide. */
98
+ /** Local iOS simulator only: apply accessibility prefs to a Shutdown simulator without booting. Cannot combine with `force: true`. */
99
+ prepareOnly?: boolean;
100
+ /** iOS only: boot simulator core without opening Simulator.app (`ARGENT_SIMULATOR_NO_WINDOW=1` forces host-wide). */
99
101
  headless?: boolean;
100
- /** Electron: path to the Electron app to launch. Either a packaged .app bundle / executable, or a project directory whose package.json points the Electron binary at the entry script. */
102
+ /** Electron: path to `.app` bundle, executable, or project directory with `package.json`. */
101
103
  electronAppPath?: string;
102
- /** Electron-only: CDP remote-debugging port to expose. Defaults to a free port; the resulting device id is `chromium-cdp-<port>`. */
104
+ /** Electron only: CDP remote-debugging port (default: free port; id `chromium-cdp-<port>`). */
103
105
  electronPort?: number;
104
- /** Electron-only: extra CLI arguments forwarded to the Electron binary after the app path. */
106
+ /** Electron only: extra CLI args forwarded to the Electron binary. */
105
107
  electronArgs?: Array<string>;
106
- /** Mac app: path to the .app bundle to start with the argent library; its device id is `macos-app-<bundle id>`. An exported or notarized Release build with the hardened runtime cannot be driven without extra entitlements; a hardened Debug build needs the step the error names. */
108
+ /** Mac app: path to `.app` bundle (id `macos-app-<bundle id>`). */
107
109
  macosAppPath?: string;
108
- /** Mac app only: arguments for the app executable. Omitted, the app starts with none, also when an earlier start had some. */
110
+ /** Mac app only: launch arguments (omitted = none). */
109
111
  macosAppArgs?: Array<string>;
110
112
  };
111
113
  button: {
@@ -115,27 +117,27 @@ export interface ArgentToolArgs {
115
117
  button: "home" | "back" | "power" | "volumeUp" | "volumeDown" | "appSwitch" | "actionButton";
116
118
  };
117
119
  "chromium-cookies": {
118
- /** Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`). */
120
+ /** Chromium device id (`chromium-cdp-<port>`). */
119
121
  udid: string;
120
- /** get: read cookies. set: create/update a cookie. delete: remove matching cookies. clear: remove ALL browser cookies. */
122
+ /** get: read cookies. set: create/update a cookie. delete: remove matching cookies. clear: remove ALL browser cookies across all domains (ignores url/domain). */
121
123
  action: "get" | "set" | "delete" | "clear";
122
- /** Cookie name. */
124
+ /** Cookie name (required for `set`/`delete`). */
123
125
  name?: string;
124
- /** Cookie value. */
126
+ /** Cookie value (required for `set`). */
125
127
  value?: string;
126
- /** get: restrict to this URL (defaults to the active page). set/delete: scope the cookie by URL. */
128
+ /** URL filter for `get` (defaults to the active page) or scope for `set`/`delete`. */
127
129
  url?: string;
128
- /** set/delete: scope the cookie by domain. */
130
+ /** Domain scope (`set`/`delete`). */
129
131
  domain?: string;
130
- /** set/delete: cookie path (default /). */
132
+ /** Path scope (default `/`). */
131
133
  path?: string;
132
- /** set: mark Secure. */
134
+ /** Secure flag (`set`). */
133
135
  secure?: boolean;
134
- /** set: mark HttpOnly. */
136
+ /** HttpOnly flag (`set`). */
135
137
  httpOnly?: boolean;
136
- /** set: SameSite policy. */
138
+ /** SameSite policy (`set`). */
137
139
  sameSite?: "Strict" | "Lax" | "None";
138
- /** set: expiry as a Unix timestamp (seconds). Omit for a session cookie. */
140
+ /** Unix expiry in seconds (`set`; omit for session). */
139
141
  expires?: number;
140
142
  };
141
143
  "chromium-storage": {
@@ -151,88 +153,90 @@ export interface ArgentToolArgs {
151
153
  value?: string;
152
154
  };
153
155
  "chromium-tabs": {
154
- /** Chromium device id from `list-devices` (e.g. `chromium-cdp-9222`). */
156
+ /** Chromium device id (`chromium-cdp-<port>`). */
155
157
  udid: string;
156
- /** list: enumerate tabs/windows. select: make a tab active. new: open a tab and activate it. close: close a tab; if it was active, another live tab becomes active. */
158
+ /** Tab operation. */
157
159
  action: "list" | "select" | "new" | "close";
158
- /** Target tab for `select` (required) / `close`: a tabId like `t2` or a label. `close` defaults to the active tab. */
160
+ /** Tab id (e.g. `t2`) or label (`select` required; `close` defaults to active). */
159
161
  tab?: string;
160
- /** `new` only: URL to open (defaults to about:blank). */
162
+ /** URL for `new` (default `about:blank`). */
161
163
  url?: string;
162
- /** `new` only: a memorable label usable interchangeably with the tabId. */
164
+ /** Optional alias label for `new`. */
163
165
  label?: string;
164
166
  };
165
167
  "debugger-component-tree": {
166
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
168
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
167
169
  port?: number;
168
- /** Device id used with debugger-connect. For macOS, use the Mac app id. */
170
+ /** Device id from `debugger-connect` (macOS: Mac app id). */
169
171
  device_id: string;
170
- /** When true, only components visible on screen are returned. Set to false to include all mounted components, including those scrolled off-screen, e.g. to understand the full page structure. */
172
+ /** Only on-screen components (default true; false includes off-screen mounted nodes). */
171
173
  onScreenOnly?: boolean;
172
- /** Maximum total nodes to include. When exceeded, intermediate single-child wrapper chains are collapsed to preserve both root structure and leaf elements. Default: no limit. */
174
+ /** Max nodes to return (collapses single-child wrappers when exceeded). */
173
175
  maxNodes?: number;
174
- /** When true, appends a summary of all filtered components: total fiber count and skip counts by component name and by filter. */
176
+ /** Append filtered/skipped fiber counts summary. */
175
177
  includeSkipped?: boolean;
176
178
  };
177
179
  "debugger-connect": {
178
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
180
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
179
181
  port?: number;
180
- /** Device id from list-devices: iOS simulator UDID, Android serial, Vega serial (amazon-...), Mac app id (macos-app-<bundle id>), or Chromium device id (chromium-cdp-<port>). Pass this SAME id as device_id to every subsequent debugger-* call to pin them to this device. The returned logicalDeviceId is informational (Metro's own per-connection handle, absent on Vega); you do not switch to it. Forwarding it still resolves here, but the list-devices id is the stable one. On a Metro shared by several devices, a simulator UDID or Android serial is matched by the device's name (a simulator's name; an Android model, release and API level); the app's device log must then confirm it runs there. When another booted simulator or attached device shares that name, or the log does not confirm it, the error asks for the logicalDeviceId instead. */
182
+ /** Device id from `list-devices`: iOS UDID, Android/Vega serial, Mac app id (`macos-app-<bundle id>`), or Chromium id (`chromium-cdp-<port>`). Reuse this same id on subsequent `debugger-*` calls (or pass the error's `logicalDeviceId` if shared Metro is ambiguous). */
181
183
  device_id: string;
182
184
  };
183
185
  "debugger-evaluate": {
184
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
186
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
185
187
  port?: number;
186
- /** Device id used with debugger-connect. For macOS, use the Mac app id. */
188
+ /** Device id from `debugger-connect` (macOS: Mac app id). */
187
189
  device_id: string;
188
- /** JavaScript expression to evaluate in the app runtime */
190
+ /** JavaScript expression to evaluate. */
189
191
  expression: string;
190
192
  };
191
193
  "debugger-inspect-element": {
192
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
194
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
193
195
  port?: number;
194
- /** Device id used with debugger-connect. For macOS, use the Mac app id. */
196
+ /** Device id from `debugger-connect` (macOS: Mac app id). */
195
197
  device_id: string;
196
- /** Horizontal position in logical pixels from the left edge of the screen, or in points from the left edge of the Mac app window, title bar included. */
198
+ /** X in logical pixels from screen left (or Mac app window left, title bar included). */
197
199
  x: number;
198
- /** Vertical position in logical pixels from the top edge of the screen, or in points from the top edge of the Mac app window, title bar included. */
200
+ /** Y in logical pixels from screen top (or Mac app window top, title bar included). */
199
201
  y: number;
200
- /** Lines of source context to include around the component definition */
202
+ /** Source context lines around each component. */
201
203
  contextLines?: number;
202
- /** When true, resolves bundled frame locations to original source files via Metro symbolication and includes a code fragment. When false, returns the raw bundled frame info (file, line, column) without a code fragment. */
204
+ /** Symbolicate via Metro and include code snippets (false = raw bundle frames). */
203
205
  resolveSourceMaps?: boolean;
204
- /** Maximum number of hierarchy items to return, most specific first. The default covers all app-specific code; increase to 70+ to also see the navigation/screen structure. */
206
+ /** Max hierarchy items, most specific first (default 35). */
205
207
  maxItems?: number;
206
- /** When true, items that would normally be filtered are kept in the response with skipped=true and a skipReason. */
208
+ /** Keep normally filtered items marked `skipped: true`. */
207
209
  includeSkipped?: boolean;
208
210
  };
209
211
  "debugger-log-registry": {
210
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
212
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
211
213
  port?: number;
212
- /** Device id used with debugger-connect. For macOS, use the Mac app id. */
214
+ /** Device id from `debugger-connect` (macOS: Mac app id). */
213
215
  device_id: string;
214
- /** How many of the newest entries to return in `entries`. Default 20. */
216
+ /** Newest entries to inline (default 20). */
215
217
  tail?: number;
216
- /** Return only these levels in `entries`, e.g. ["warning", "error"]. Stats and clusters stay unfiltered. */
218
+ /** Filter inline `entries` by level (e.g. ["warning", "error"]). */
217
219
  levels?: Array<"log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd">;
218
220
  };
219
221
  "debugger-reload-metro": {
220
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
222
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
221
223
  port?: number;
222
224
  /** Device id used with debugger-connect. For macOS, use the Mac app id. */
223
225
  device_id: string;
224
226
  };
225
227
  "debugger-status": {
226
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
228
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
227
229
  port?: number;
228
- /** Device id used with debugger-connect. For macOS, use the Mac app id. */
230
+ /** Device id from `debugger-connect` (macOS: Mac app id). */
229
231
  device_id: string;
230
232
  };
231
233
  describe: {
232
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
234
+ /** Target device id from `list-devices`. */
233
235
  udid: string;
234
- /** App bundle ID, used as a target hint on iOS when the AX-service returns no elements and describe falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on every other platform, including a physical iOS device. */
236
+ /** iOS simulator only: fallback bundle id when AX-service returns empty (auto-detects frontmost if omitted). */
235
237
  bundleId?: string;
238
+ /** Return the unpruned tree, keeping bare structural wrapper containers and duplicate child labels omitted by default. */
239
+ raw?: boolean;
236
240
  };
237
241
  "dismiss-update": {
238
242
  /** Hours until reminders resume: 168 is a week, 87600 is the longest, 0 turns them back on */
@@ -245,55 +249,69 @@ export interface ArgentToolArgs {
245
249
  project_root: string;
246
250
  /** Text the echo step prints */
247
251
  message: string;
252
+ /** Save the message in the shutdown list. stepCount counts shutdown entries. */
253
+ shutdown?: boolean;
248
254
  };
249
255
  "e2e-add-script": {
250
- /** E2E test name passed to e2e-start-recording. */
256
+ /** E2E test name from `e2e-start-recording`. */
251
257
  name: string;
252
- /** Absolute project root passed to e2e-start-recording. */
258
+ /** Project root from `e2e-start-recording`. */
253
259
  project_root: string;
254
- /** Path to the script file (.mjs, .mts, .js or .ts), relative to the e2e test YAML. For example: "../../scripts/seed-order.mjs". */
260
+ /** Script path (.mjs/.mts/.js/.ts) relative to the test YAML. */
255
261
  path: string;
256
- /** Time limit in milliseconds. The default is 30000 and the minimum is 100. */
262
+ /** Timeout in ms (default 30000, min 100). */
257
263
  timeout?: number;
264
+ /** Env overrides (supports `{{secret:NAME}}` and `{{output:PATH}}`). */
265
+ env?: {
266
+ [key: string]: string;
267
+ };
268
+ /** Save the script in the shutdown list. Pending fragment cleanup runs before the script. The script's output reaches only later shutdown steps. stepCount counts shutdown entries. */
269
+ shutdown?: boolean;
258
270
  };
259
271
  "e2e-add-step": {
260
- /** Name of the e2e test being recorded: the one passed to e2e-start-recording. */
272
+ /** E2E test name from `e2e-start-recording`. */
261
273
  name: string;
262
- /** Absolute path to the project root of the e2e test being recorded: the same value passed to e2e-start-recording. */
274
+ /** Project root from `e2e-start-recording`. */
263
275
  project_root: string;
264
- /** MCP tool to execute and record, for example "gesture-tap". Do not pass an e2e test directive or a recording tool. Call e2e-add-script directly for a requested script step. */
276
+ /** MCP tool id to run and record (e.g. "gesture-tap"; call `e2e-add-script` directly for scripts). */
265
277
  command: string;
266
- /** Tool arguments as a JSON string, e.g. '{"udid": "ABC", "x": 0.5, "y": 0.3}'. Omit for tools with no arguments. */
278
+ /** JSON string of tool arguments (omit if none). */
267
279
  args?: string;
268
- /** Milliseconds to sleep before executing this step during replay. */
280
+ /** Replay delay in ms before this step. */
269
281
  delayMs?: number;
282
+ /** Save the call in the shutdown list. Pending fragment cleanup runs before the call. stepCount counts shutdown entries. */
283
+ shutdown?: boolean;
270
284
  };
271
285
  "e2e-execute": {
272
- /** Name of a saved e2e test to run from `<project_root>/.argent/e2e`, or `.argent/flows` when it is not there (e.g. "settings-explore"). */
286
+ /** Saved e2e test name in `<project_root>/.argent/e2e/` (or `.argent/flows/`). */
273
287
  name?: string;
274
- /** Absolute path to the calling agent's project root: the cwd it is working in, also with e2e_test_path, where the e2e test, its run: siblings, its script: paths and baselines resolve beside the YAML instead. A script still RUNS in this root. */
288
+ /** Absolute path to the project root (script cwd; with e2e_test_path, run:/script:/baselines resolve beside the YAML). */
275
289
  project_root: string;
276
- /** Path to the e2e test .yaml as readable by the tool-server. Internal: the argent client derives it from project_root and name automatically; leave unset. */
290
+ /** Internal; leave unset (derived from `project_root` and `name`). */
277
291
  e2e_test_file?: string;
278
- /** Absolute path to an e2e test .yaml on the client. */
292
+ /** Absolute path to an e2e test `.yaml` on the client. */
279
293
  e2e_test_path?: string;
280
- /** Device id to run against (iOS UDID, Android/Vega serial, Chromium id, Mac app id), as list-devices reports it. Auto-detected when omitted, but only when exactly one booted device matches (optionally narrowed by `platform` and the e2e test's `requires:` block); with several booted the run fails and lists them, so pass this explicitly whenever more than one device is up. */
294
+ /** Target device id from `list-devices` (iOS UDID, Android/Vega serial, Chromium id, Mac app id). Auto-detected only when one booted device matches; pass explicitly if multiple are booted. */
281
295
  device?: string;
282
- /** Restrict auto-detection to this platform when several devices are booted. `ios` selects local simulators only; `ios-remote` selects a remote one. `chromium` with no `device` also makes the runner boot an Electron instance for a standalone e2e test from its `launch` step's chromium value and tear it down after the run, with no fallback to auto-detection (a single-key `launch: { chromium: … }` map, or a `requires:` block that allows only chromium, does this on its own; a fragment, or a launch map without a `chromium` key, is still auto-detected). That value must be an Electron app path on the tool-server host: the bare-string `launch:` the recorder writes holds a bundle id, which fails the run with `Electron boot: path does not exist`, so first edit it to `{ chromium: <app path> }`. `macos` with no `device` runs a standalone e2e test on the Mac app its `launch` names, which need not be running (a single-key `launch: { macos: … }` map does this on its own). Auto-detection never picks a Mac app otherwise. */
296
+ /** Filter auto-detection (`ios` = local simulator, `ios-remote` = remote). With `chromium` and no `device`, boots Electron from `launch: { chromium: <app path> }` and tears it down after. With `macos` and no `device`, runs on the Mac app named in `launch` (auto-detection never picks Mac apps otherwise). */
283
297
  platform?: "ios" | "android" | "chromium" | "vega" | "macos" | "ios-remote";
284
- /** Write/refresh screenshot baselines for `snapshot` steps instead of diffing against them, also in the e2e tests that tool: e2e-execute steps run, unless such a step sets updateBaselines itself. Over a link, the client writes the new baselines when the run ends. */
298
+ /** Refresh screenshot baselines for `snapshot` steps instead of diffing. */
285
299
  updateBaselines?: boolean;
286
- /** Set to true to confirm the execution prerequisite has been met. Required when a fragment defines an executionPrerequisite: without it, the call runs no step and returns the prerequisite text. Not a dry run: an e2e test with no prerequisite runs in full. To read a prerequisite without running, read executionPrerequisite in the YAML file. */
300
+ /** Set true to confirm a fragment's `executionPrerequisite` is met; otherwise returns the prerequisite text without running. Not a dry run: a test with no prerequisite runs in full (read `executionPrerequisite` in the YAML to inspect without running). */
287
301
  prerequisiteAcknowledged?: boolean;
302
+ /** Script env overrides (also for `run:` fragments). Supports `{{secret:NAME}}`. */
303
+ env?: {
304
+ [key: string]: string;
305
+ };
288
306
  /** @deprecated Renamed to `e2e_test_path`. */
289
307
  flow_path?: string;
290
308
  /** @deprecated Renamed to `e2e_test_file`. */
291
309
  flow_file?: string;
292
310
  };
293
311
  "e2e-finish-recording": {
294
- /** Name of the e2e test being recorded: the one passed to e2e-start-recording. */
312
+ /** E2E test name from `e2e-start-recording`. */
295
313
  name: string;
296
- /** Absolute path to the project root of the e2e test being recorded: the same value passed to e2e-start-recording. */
314
+ /** Project root from `e2e-start-recording`. */
297
315
  project_root: string;
298
316
  };
299
317
  "e2e-read-prerequisite": {
@@ -310,18 +328,32 @@ export interface ArgentToolArgs {
310
328
  /** @deprecated Renamed to `e2e_test_file`. */
311
329
  flow_file?: string;
312
330
  };
331
+ "e2e-set-env": {
332
+ /** Test name passed to e2e-start-recording. */
333
+ name: string;
334
+ /** Absolute project root passed to e2e-start-recording. */
335
+ project_root: string;
336
+ /** Variable names to update. A null value removes that name. Omitted names keep their values. Use {{secret:NAME}} for credentials. */
337
+ env: {
338
+ [key: string]: string | null;
339
+ };
340
+ };
313
341
  "e2e-start-recording": {
314
- /** Name for this e2e test (e.g. "settings-explore"): letters, digits, underscore and hyphen only. */
342
+ /** E2E test name (letters, digits, `_`, `-`). */
315
343
  name: string;
316
- /** Absolute path to the project root directory (the directory that contains or should contain `.argent/e2e/`). */
344
+ /** Absolute path to the project root containing `.argent/e2e/`. */
317
345
  project_root: string;
318
- /** Fragments only: the app/device state assumed on entry (e.g. "Settings app open on General page"). Omit it for a standalone e2e test. restart-app has no chromium support, so a chromium e2e test records as a fragment; add the `launch: { chromium: <app path> }` line to the YAML afterward, deleting the executionPrerequisite line if you passed one, since an e2e test that starts with a launch must not declare it. */
346
+ /** Fragments only: entry state assumed. Omit for standalone tests (Chromium records as a fragment, then add `launch: { chromium: <app path> }` and remove this). */
319
347
  executionPrerequisite?: string;
320
- /** The e2e test's `requires:` block: the targets it supports, ANDed. `platform` is one platform or a list (`ios` also covers a remote simulator); `runtimeKind` is `tv` or `mobile`. Omit it for a test that runs on any target. */
348
+ /** Supported target filter (`platform` and/or `runtimeKind`, ANDed). Omit for any. */
321
349
  requires?: {
322
350
  platform?: "ios" | "android" | "chromium" | "vega" | "macos" | Array<"ios" | "android" | "chromium" | "vega" | "macos">;
323
351
  runtimeKind?: "mobile" | "tv";
324
352
  };
353
+ /** Top-level script env defaults. Supports `{{secret:NAME}}`. */
354
+ env?: {
355
+ [key: string]: string;
356
+ };
325
357
  };
326
358
  "file-panel": {
327
359
  /** Mac app id from `list-devices` (macos-app-<bundle id>). */
@@ -348,11 +380,11 @@ export interface ArgentToolArgs {
348
380
  text: string;
349
381
  };
350
382
  fold: {
351
- /** Target device id from `list-devices` (a foldable iOS simulator UDID or Android emulator serial). */
383
+ /** Foldable device id from `list-devices` (iOS simulator UDID or Android emulator serial). */
352
384
  udid: string;
353
- /** Where to move the hinge: `closed` shows the cover panel, `half-open` and `open` show the inner panel. */
385
+ /** Target posture: `closed` (cover panel), `half-open`, or `open` (inner panel). */
354
386
  posture?: "closed" | "half-open" | "open";
355
- /** The hinge angle in degrees: 0 = closed, 180 = open. */
387
+ /** Hinge angle in degrees (0 = closed, 180 = open). */
356
388
  angle?: number;
357
389
  };
358
390
  "foreground-app": {
@@ -366,144 +398,148 @@ export interface ArgentToolArgs {
366
398
  "gesture-custom": {
367
399
  /** Target device id from `list-devices` (iOS UDID or Android serial). */
368
400
  udid: string;
369
- /** Starting edge in upright screen coordinates for a single-finger system gesture on a local iOS simulator. */
401
+ /** Starting screen edge for a single-finger system gesture (local iOS simulator). */
370
402
  edge?: "top" | "right" | "bottom" | "left";
371
- /** Touch events, dispatched in order. */
403
+ /** Ordered touch events. */
372
404
  events: Array<{
373
- /** Touch event type */
405
+ /** Touch event type. */
374
406
  type: "Down" | "Move" | "Up";
375
- /** Touch x. */
407
+ /** Normalized x. */
376
408
  x: number;
377
- /** Touch y. */
409
+ /** Normalized y. */
378
410
  y: number;
379
- /** Second finger x, for two-finger gestures. */
411
+ /** Second finger x. */
380
412
  x2?: number;
381
- /** Second finger y, for two-finger gestures. */
413
+ /** Second finger y. */
382
414
  y2?: number;
383
- /** Delay before this event in milliseconds (default 16ms ≈ 60fps) */
415
+ /** Delay before event in ms (default 16). */
384
416
  delayMs?: number;
385
417
  }>;
386
- /** Number of Move events to insert between each pair of consecutive events, linearly interpolating both x,y and x2,y2 and splitting the delay evenly, for a smooth gesture. Default: no interpolation. */
418
+ /** Insert N linearly interpolated Move events between consecutive events (default 0). */
387
419
  interpolate?: number;
388
420
  };
389
421
  "gesture-drag": {
390
- /** Target Chromium device id from `list-devices` (chromium-cdp-<port>), or a Mac app id. */
422
+ /** Chromium device id (`chromium-cdp-<port>`) or Mac app id from `list-devices`. */
391
423
  udid: string;
392
- /** Press x. */
424
+ /** Start x. */
393
425
  fromX: number;
394
- /** Press y. */
426
+ /** Start y. */
395
427
  fromY: number;
396
- /** Release x. */
428
+ /** End x. */
397
429
  toX: number;
398
- /** Release y. */
430
+ /** End y. */
399
431
  toY: number;
400
- /** Total drag duration in milliseconds (default 300, 800 for a long press on a Mac app); the button stays down this long. */
432
+ /** Drag duration in ms (default 300; 800 for a Mac app long press). */
401
433
  durationMs?: number;
402
- /** Whether the drag releases with momentum; default true (a constant-speed drag). false decelerates into the release point, so an app that derives a fling from the release velocity (carousels, drag libraries) applies little to no momentum: use it when the drag must stop where it was aimed. Under ~100ms durationMs some fling survives; keep the default 300 when the fling must be fully suppressed. */
434
+ /** Default true (constant speed). false decelerates into release to avoid fling. */
403
435
  momentum?: boolean;
404
436
  };
405
437
  "gesture-pinch": {
406
- /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
438
+ /** Device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
407
439
  udid: string;
408
- /** Center of the pinch, horizontal. */
440
+ /** Normalized center x. */
409
441
  centerX: number;
410
- /** Center of the pinch, vertical. */
442
+ /** Normalized center y. */
411
443
  centerY: number;
412
- /** Initial distance between the two fingers. */
444
+ /** Initial normalized finger distance. */
413
445
  startDistance: number;
414
- /** Final distance between the two fingers. */
446
+ /** Final normalized finger distance (> start = zoom in). */
415
447
  endDistance: number;
416
- /** Final horizontal center of the pinch. When set, the centroid drifts linearly from centerX to endCenterX over the gesture (e.g. to keep expanding fingers on-screen near an edge). Omit for a fixed center. */
448
+ /** Optional final center x (centroid drifts linearly). */
417
449
  endCenterX?: number;
418
- /** Final vertical center of the pinch; drifts from centerY like endCenterX. Omit for a fixed center. */
450
+ /** Optional final center y. */
419
451
  endCenterY?: number;
420
- /** Angle in degrees of the axis the fingers lie on: 0 = horizontal (default), 90 = vertical. */
452
+ /** Finger axis angle in degrees (0 = horizontal, 90 = vertical). */
421
453
  angle?: number;
422
- /** Total gesture duration in milliseconds (default 300). On HarmonyOS the device runs the whole move itself and takes this as wall-clock time, clamped to the 1–15000ms range `uinput` accepts. */
454
+ /** Duration in ms (default 300); clamped to 1–15000ms on HarmonyOS. */
423
455
  durationMs?: number;
424
456
  };
425
457
  "gesture-rotate": {
426
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
458
+ /** Device id from `list-devices` (iOS UDID or Android serial). */
427
459
  udid: string;
428
- /** Center of rotation, horizontal. */
460
+ /** Normalized rotation center x. */
429
461
  centerX: number;
430
- /** Center of rotation, vertical. */
462
+ /** Normalized rotation center y. */
431
463
  centerY: number;
432
- /** Distance from the center to each finger. */
464
+ /** Normalized finger orbit radius (e.g. 0.15). */
433
465
  radius?: number;
434
- /** Finger distance along the horizontal axis, as a fraction of screen WIDTH. */
466
+ /** Horizontal radius fraction of screen width (pair with `radiusY`). */
435
467
  radiusX?: number;
436
- /** Finger distance along the vertical axis, as a fraction of screen HEIGHT. */
468
+ /** Vertical radius fraction of screen height (pair with `radiusX`). */
437
469
  radiusY?: number;
438
- /** Starting angle in degrees (0 = right, 90 = down) */
470
+ /** Start angle in degrees (0 = right, 90 = down). */
439
471
  startAngle: number;
440
- /** Ending angle in degrees. */
472
+ /** End angle in degrees (> startAngle = clockwise). */
441
473
  endAngle: number;
442
- /** Total gesture duration in milliseconds (default 300) */
474
+ /** Duration in ms (default 300). */
443
475
  durationMs?: number;
444
476
  };
445
477
  "gesture-scroll": {
446
- /** Target Chromium device id from `list-devices` (chromium-cdp-<port>), or a Mac app id. */
478
+ /** Chromium device id (`chromium-cdp-<port>`) or Mac app id from `list-devices`. */
447
479
  udid: string;
448
- /** Anchor x. The wheel events land here; put it over the element you want to scroll. */
480
+ /** Normalized anchor x over the scrollable element. */
449
481
  x: number;
450
- /** Anchor y. */
482
+ /** Normalized anchor y. */
451
483
  y: number;
452
- /** Horizontal scroll distance as a fraction of the window width. Positive reveals content to the right; negative scrolls back left. */
484
+ /** Horizontal scroll fraction (+ right, - left). */
453
485
  deltaX?: number;
454
- /** Vertical scroll distance as a fraction of the window height (0.5 = half a window). Positive scrolls down (reveals content below), like rolling a mouse wheel toward you; negative scrolls back up. */
486
+ /** Vertical scroll fraction (+ down, - up; e.g. 0.5). */
455
487
  deltaY?: number;
456
- /** Spread the scroll over this many milliseconds in wheel-event steps (default 300) so scroll handlers fire progressively. Ignored on a Mac app. */
488
+ /** Scroll duration in ms (default 300); ignored on Mac apps. */
457
489
  durationMs?: number;
458
490
  };
459
491
  "gesture-swipe": {
460
- /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
492
+ /** Target device id from `list-devices`. */
461
493
  udid: string;
462
- /** Start x. */
494
+ /** Start x [0,1]. */
463
495
  fromX: number;
464
- /** Start y. */
496
+ /** Start y [0,1]. */
465
497
  fromY: number;
466
- /** End x. */
498
+ /** End x [0,1]. */
467
499
  toX: number;
468
- /** End y. */
500
+ /** End y [0,1]. */
469
501
  toY: number;
470
- /** Total gesture duration in milliseconds (default 300); the finger stays down this long. Below ~32ms the whole travel lands in one or two frames, which the OS flings as hard as any flick. */
502
+ /** Swipe duration in ms (default 300). */
471
503
  durationMs?: number;
472
- /** Whether the swipe releases with momentum; default true (a natural flinging swipe). false eases the finger into the end point so the OS applies little to no fling and the content stops where the finger lifts: use it when you need a deterministic scroll distance, e.g. in scroll-to-element loops. false needs durationMs >= 150 and is rejected below that; near 150 it can still land short or fling, so keep the default 300. */
504
+ /** Default true (flinging swipe). Set false to ease out with no fling for deterministic scroll distance (requires durationMs >= 150). */
473
505
  momentum?: boolean;
474
506
  };
475
507
  "gesture-tap": {
476
- /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, Mac app id, or Chromium id). */
508
+ /** Target device id from `list-devices`. */
477
509
  udid: string;
478
- /** Horizontal position: 0 = left edge, 1 = right edge. */
510
+ /** Horizontal screen fraction [0,1]. */
479
511
  x: number;
480
- /** Vertical position: 0 = top edge, 1 = bottom edge. */
512
+ /** Vertical screen fraction [0,1]. */
481
513
  y: number;
482
- /** Number of taps/clicks dispatched as ONE gesture inside the OS double-tap window (2 = double-tap / double-click), which two separate tap calls cannot guarantee. On physical iOS, higher counts loop single taps, which a double-tap recognizer may pair. On HarmonyOS they land as separate taps. Default 1. */
514
+ /** Tap/click count as one OS gesture (2 = double-tap; default 1). On physical iOS, higher counts loop single taps, which a double-tap recognizer may pair. */
483
515
  clickCount?: number;
484
- /** Mouse button, Mac app only: "right" is a right-click, for example to open a context menu; any other device refuses it. Default "left". */
516
+ /** Mac app only: mouse button ("left" default, or "right"). */
485
517
  button?: "left" | "right";
486
- /** Keys held throughout a click or multi-click gesture. Mac apps only. An empty list leaves the click unmodified. */
518
+ /** Mac app only: modifier keys held during click. */
487
519
  modifiers?: Array<"control" | "option" | "shift" | "command">;
488
520
  };
489
521
  keyboard: {
490
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
522
+ /** Target device id from `list-devices`. */
491
523
  udid: string;
492
- /** Text to type character by character; handles uppercase, digits and common punctuation. Cannot be combined with `key`: to type and then press a key, send two `keyboard` steps in one `run-sequence` ({ text: "hello" } then { key: "enter" }). To type a credential without its plaintext ever entering your context, use a secret placeholder `{{secret:<NAME>}}`, e.g. "{{secret:APP_PASSWORD}}", alone or inside longer text. It is resolved on the machine running the tool-server, from the first source that defines the name: the `ARGENT_SECRET_<NAME>` environment variable, `.argent/secrets.env` in the project, the project's `.env.local` / `.env` (only their `ARGENT_SECRET_`-prefixed keys), then `~/.argent/secrets.env`. Nothing else on the host is reachable. Over a link with the `forward-secrets` flag on, the client's own sources are checked first. The result echoes the placeholder, never the value, and the auto-screenshot after typing is skipped. To submit after a secret, put both steps in ONE `run-sequence`: that keeps the skip covering the Enter, which a second bare `keyboard` call would not. If the secret is not set, the failure lists the available names and the sources it checked; ask the user to add it to one of them (a secrets file applies immediately, an env var needs a restart). NEVER ask the user to paste the secret value into the conversation. */
524
+ /** Text to type. Cannot be combined with `key` (use two steps in `run-sequence` to type then press enter). Supports `{{secret:<NAME>}}` placeholders resolved server-side from `ARGENT_SECRET_<NAME>` / `.argent/secrets.env` (auto-screenshot is skipped; combine with submit in one `run-sequence` to keep the skip; never ask the user for plaintext). */
493
525
  text?: string;
494
- /** Named key to press: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1-f12. Cannot be combined with `text`; to do both, send two `keyboard` steps in one `run-sequence`. Not supported on Apple TV / Android TV; move focus with `tv-remote` (up/down/left/right) instead. Physical iOS: only `enter` and `backspace`. HarmonyOS: only enter (return), backspace (delete), space, arrow-left and arrow-right; any other key fails with 400 KEYBOARD_KEY_UNSUPPORTED. Mac app: also delete (forward delete), home, end, page-up, page-down, and shortcuts with modifiers joined by + (command, shift, option, control), e.g. command+a. */
526
+ /** Named key. Cannot be combined with `text` or `clear` (use two steps in `run-sequence`). Values: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1-f12. Not supported on Apple TV / Android TV (use `tv-remote`). Physical iOS: enter/backspace only. HarmonyOS: enter, backspace, space, arrow-left/right. Mac app: also delete (forward delete), home, end, page-up/down, and modifier shortcuts (e.g. command+a). */
495
527
  key?: string;
496
- /** Delay in ms between key presses (default 50). Ignored on Android phones/tablets, HarmonyOS, Vega, Apple TV / Android TV and physical iOS, which type the whole string in one shot or at their own cadence. */
528
+ /** Clear the focused text field before typing `text` (or alone when `text` is omitted). Cannot be combined with `key`. Fails if nothing editable has focus. On physical iOS, deletes up to 100 characters before the caret, unverified, and returns no `cleared`. Not supported on Mac apps, HarmonyOS, Apple TV, Android TV, or Vega. */
529
+ clear?: boolean;
530
+ /** Press `key` this many times in one call, e.g. `{ key: "backspace", repeat: 12 }`. Only valid with `key`. */
531
+ repeat?: number;
532
+ /** Delay in ms between key presses (default 50; ignored on platforms that type in one shot). */
497
533
  delayMs?: number;
498
534
  };
499
535
  "launch-app": {
500
- /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, Mac app id, or Chromium id). */
536
+ /** Target device id from `list-devices`. */
501
537
  udid: string;
502
- /** App identifier. iOS: bundle id. Android: package name from build.gradle `applicationId`. Vega (Fire TV): the interactive component app id from manifest.toml (e.g. com.example.app.main). HarmonyOS: bundle name as listed by `bm dump -a` (e.g. com.huawei.hmos.calculator). Chromium: any tag matching the pattern. Mac app: the bundle id in the device id. */
538
+ /** App identifier (iOS/Mac app bundle id, Android package name, Vega interactive component app id from manifest.toml e.g. `com.example.app.main`, HarmonyOS bundle name from `bm dump -a`, or Chromium tag). */
503
539
  bundleId: string;
504
- /** Android-only: fully-qualified Activity name (e.g. `.MainActivity` or `com.example/com.example.MainActivity`). If omitted, the app's default launcher activity is used. */
540
+ /** Android only: Activity name (default: launcher activity). */
505
541
  activity?: string;
506
- /** Apple simulators, Mac apps and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. A running app is relaunched to apply them, except a Mac app: use restart-app for that. Omitted on a Mac app, a stopped app gets the arguments of its last start. The call fails, launching nothing, if terminating it does not finish within 15s on a local iOS simulator, or fails for a reason other than the app not running on a remote one. */
542
+ /** Apple targets only: process launch args, e.g. `["-FeatureFlag", "YES"]`. Relaunches running simulators/phones to apply. */
507
543
  launchArgs?: Array<string>;
508
544
  };
509
545
  "list-devices": Record<string, never>;
@@ -538,21 +574,21 @@ export interface ArgentToolArgs {
538
574
  udid: string;
539
575
  /** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
540
576
  bundleId: string;
541
- /** UIView class name to match (exact, e.g. UIButton) */
577
+ /** Exact UIView class name (e.g. UIButton). */
542
578
  className?: string;
543
- /** Accessibility identifier to match (exact) */
579
+ /** Exact accessibility identifier. */
544
580
  identifier?: string;
545
- /** Accessibility label to match (exact) */
581
+ /** Exact accessibility label. */
546
582
  label?: string;
547
- /** UIView tag integer to match */
583
+ /** UIView integer tag. */
548
584
  tag?: number;
549
- /** React Native nativeID prop to match (exact) */
585
+ /** Exact React Native nativeID. */
550
586
  nativeID?: string;
551
- /** Include ancestor chain for each matched view (default true) */
587
+ /** Include ancestor chain (default true). */
552
588
  includeAncestors?: boolean;
553
- /** Include child views for each matched view (default true) */
589
+ /** Include child views (default true). */
554
590
  includeChildren?: boolean;
555
- /** View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder */
591
+ /** View fields to return (defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID; extra: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder). */
556
592
  fields?: Array<string>;
557
593
  };
558
594
  "native-full-hierarchy": {
@@ -560,25 +596,25 @@ export interface ArgentToolArgs {
560
596
  udid: string;
561
597
  /** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
562
598
  bundleId: string;
563
- /** View fields to include. Use EXACT names. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder */
599
+ /** Exact view fields to return (defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID; extra: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder). */
564
600
  fields?: Array<string>;
565
- /** Exact UIView class names whose entire subtree should be pruned (e.g. ["UIImageView"] to drop image leaf nodes) */
601
+ /** Exact UIView classes to prune (e.g. ["UIImageView"]). */
566
602
  skipClasses?: Array<string>;
567
- /** Class name prefixes to prune entire subtrees. For SwiftUI apps use ["_TtGC7SwiftUI"] to drop mangled SwiftUI generic type subtrees while keeping _UIHostingView and UIKit bridges. Avoid broad prefixes like "_UI": they prune useful system views. */
603
+ /** Class prefixes to prune (e.g. ["_TtGC7SwiftUI"] for SwiftUI; avoid broad "_UI"). */
568
604
  skipClassPrefixes?: Array<string>;
569
- /** Maximum recursion depth (default 8). Raise it to reach deeper views. */
605
+ /** Max recursion depth (default 8). */
570
606
  maxDepth?: number;
571
607
  };
572
608
  "native-network-logs": {
573
- /** Device ID from list-devices: an iOS simulator UDID or Android serial, or a Mac app id (macos-app-<bundle id>) */
609
+ /** Device ID from `list-devices`: iOS simulator UDID, Android serial, or Mac app id (`macos-app-<bundle id>`). */
574
610
  udid: string;
575
- /** App bundle ID on iOS or package name on Android. On macOS, omit the macos-app- prefix. */
611
+ /** Bundle ID (iOS) or package name (Android); on macOS, omit `macos-app-`. */
576
612
  bundleId: string;
577
- /** Exclude requests to this Metro port on local addresses. Omit it to use the device's Metro port (usually 8081). */
613
+ /** Metro port to exclude from logs (omit for device default, usually 8081). */
578
614
  port?: number;
579
- /** Take the newest matching requests and return them oldest first. Use 0 for capture status and totals without entries. */
615
+ /** Newest requests to return oldest-first (default 50; 0 = status/totals only). */
580
616
  limit?: number;
581
- /** Hide existing history from later lists. Cleared request IDs still work in view-network-request-details. */
617
+ /** Hide current history from later lists (IDs still work in `view-network-request-details`). */
582
618
  clear?: boolean;
583
619
  };
584
620
  "native-profiler-analyze": {
@@ -586,25 +622,25 @@ export interface ArgentToolArgs {
586
622
  device_id: string;
587
623
  };
588
624
  "native-profiler-launch-analysis": {
589
- /** measure: time five launches with XCTest. profile: record one Instruments App Launch trace. */
625
+ /** `measure`: 5 XCTest timed launches. `profile`: 1 Instruments App Launch trace. */
590
626
  mode: "measure" | "profile";
591
- /** Bundle ID of the Release build already installed on the device. The tool does not build or install the app. */
627
+ /** Installed Release build bundle ID (not built or installed by this tool). */
592
628
  bundle_id: string;
593
- /** Connected iPhone UDID; required for a physical-device run. With allow_simulator, a booted simulator UDID also works. */
629
+ /** iPhone UDID (or booted simulator UDID with `allow_simulator: true`). */
594
630
  device_id?: string;
595
- /** Explicitly allow a booted simulator when no iPhone is selected. */
631
+ /** Allow booted simulator when no iPhone is selected. */
596
632
  allow_simulator?: boolean;
597
- /** profile mode only: App Launch trace recording length in seconds (default 8). Rejected in measure mode. */
633
+ /** `profile` mode only: trace duration in s (default 8). */
598
634
  duration_seconds?: number;
599
635
  };
600
636
  "native-profiler-start": {
601
637
  /** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
602
638
  device_id: string;
603
- /** iOS: the CFBundleExecutable or display name of the app to profile. Android: the app's package name. If omitted, auto-detects the foreground app; set it only if auto-detection picks the wrong app. Do not set it for a Mac app: the tool refuses it, because the device id names the app. */
639
+ /** iOS executable/name or Android package (auto-detects foreground app if omitted); omit for Mac apps. */
604
640
  app_process?: string;
605
- /** iOS and Mac apps only. Path to an Instruments .tracetemplate file, or the name of a built-in template such as "Time Profiler" (defaults to the bundled Argent template). */
641
+ /** iOS/Mac app Instruments `.tracetemplate` path or built-in name (e.g. "Time Profiler"; default: bundled template). */
606
642
  template_path?: string;
607
- /** iOS and Mac apps only. Enable allocation stacks from app launch. Restarts the app, clears its current state, and adds CPU and memory overhead. Leave it off for CPU and hang timing. On iOS, attach recordings typically lack allocation stacks. The all-processes capture (including ARGENT_IOS_CAPTURE=all-processes) rejects this option and records no leaks. On a Mac app, argent restarts the app with MallocStackLogging=1 and then attaches, and logging stays active until restart-app. The bundled template can capture stacks for allocations during recording, so enable this for older allocations. */
643
+ /** iOS/Mac apps only: restart app with allocation stacks from launch (adds overhead; leave off for CPU/hang timing). */
608
644
  malloc_stack_logging?: boolean;
609
645
  };
610
646
  "native-profiler-stop": {
@@ -616,21 +652,21 @@ export interface ArgentToolArgs {
616
652
  udid: string;
617
653
  /** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
618
654
  bundleId: string;
619
- /** Raw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames); on a Mac app, points from the top-left of the area describe reports. NOT normalized [0,1] tap space. */
655
+ /** Raw X in upright UI points (Mac app: from describe area top-left). Not normalized [0,1]. */
620
656
  x: number;
621
- /** Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space. */
657
+ /** Raw Y in upright UI points. Not normalized [0,1]. */
622
658
  y: number;
623
- /** Include ancestor chain for the matched view (default true) */
659
+ /** Include ancestor chain (default true). */
624
660
  includeAncestors?: boolean;
625
- /** Include child views for the matched view (default false) */
661
+ /** Include child views (default false). */
626
662
  includeChildren?: boolean;
627
- /** View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder */
663
+ /** View fields to return (defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID; extra: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder). */
628
664
  fields?: Array<string>;
629
- /** Exact UIView class names whose entire subtree should be pruned */
665
+ /** Exact UIView class names to prune. */
630
666
  skipClasses?: Array<string>;
631
- /** Class name prefixes to prune entire subtrees */
667
+ /** Class name prefixes to prune. */
632
668
  skipClassPrefixes?: Array<string>;
633
- /** Maximum depth for returned child/ancestor serialization (default 150) */
669
+ /** Max serialization depth (default 150). */
634
670
  maxDepth?: number;
635
671
  };
636
672
  "native-view-at-point": {
@@ -638,157 +674,157 @@ export interface ArgentToolArgs {
638
674
  udid: string;
639
675
  /** Bundle ID of the app (on a Mac app, the bundle id in the device id) */
640
676
  bundleId: string;
641
- /** Raw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames); on a Mac app, points from the top-left of the area describe reports. NOT normalized [0,1] tap space. */
677
+ /** Raw X in upright UI points (Mac app: from describe area top-left). Not normalized [0,1]. */
642
678
  x: number;
643
- /** Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space. */
679
+ /** Raw Y in upright UI points. Not normalized [0,1]. */
644
680
  y: number;
645
- /** Include ancestor chain for the matched view (default true) */
681
+ /** Include ancestor chain (default true). */
646
682
  includeAncestors?: boolean;
647
- /** Include child views for the matched view (default false) */
683
+ /** Include child views (default false). */
648
684
  includeChildren?: boolean;
649
- /** View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder */
685
+ /** View fields to return (defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID; extra: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder). */
650
686
  fields?: Array<string>;
651
- /** Exact UIView class names whose entire subtree should be pruned */
687
+ /** Exact UIView class names to prune. */
652
688
  skipClasses?: Array<string>;
653
- /** Class name prefixes to prune entire subtrees */
689
+ /** Class name prefixes to prune. */
654
690
  skipClassPrefixes?: Array<string>;
655
- /** Maximum depth for returned child/ancestor serialization (default 150) */
691
+ /** Max serialization depth (default 150). */
656
692
  maxDepth?: number;
657
- /** true returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view. */
693
+ /** true: touch-receiving view (UIKit hit-test). false (default): deepest visible view. */
658
694
  hitTest?: boolean;
659
695
  };
660
696
  "network-capture-start": {
661
- /** Device ID from list-devices. For Mac builds started outside Argent, use macos-app-<bundle id>. */
697
+ /** Device ID from `list-devices` (external Mac builds: `macos-app-<bundle id>`). */
662
698
  udid: string;
663
- /** App bundle ID on iOS or package name on Android. On Mac, omit the macos-app- prefix. On Chromium, use a valid placeholder such as argent.capture. */
699
+ /** Bundle ID (iOS) / package (Android) / Mac bundle ID / placeholder on Chromium (e.g. `argent.capture`). */
664
700
  bundleId: string;
665
- /** The app's Metro port for JS capture and native log filtering. Omit it only when the app uses the device's port (usually 8081); otherwise check the project's Metro start script. Chromium uses the CDP port in udid. */
701
+ /** Metro port for JS capture and native filtering (omit for device default, usually 8081; ignored on Chromium). */
666
702
  port?: number;
667
- /** Omit to control both layers. Selecting one leaves the other alone. Chromium ignores this setting. */
703
+ /** Control one layer only (default: both; ignored on Chromium). */
668
704
  layer?: "js" | "native";
669
- /** For iOS simulators and Android on shared Metro, use the logical ID for the intended device if requested. Reuse it for start and stop, and as device_id for JS reads. For Mac apps, omit logicalDeviceId and keep the Mac app id even on shared Metro. */
705
+ /** Shared-Metro logical ID for iOS/Android if requested (reuse for start/stop/JS reads); omit on Mac apps. */
670
706
  logicalDeviceId?: string;
671
707
  };
672
708
  "network-capture-stop": {
673
- /** Device ID from list-devices. For Mac builds started outside Argent, use macos-app-<bundle id>. */
709
+ /** Device ID from `list-devices` (external Mac builds: `macos-app-<bundle id>`). */
674
710
  udid: string;
675
- /** App bundle ID on iOS or package name on Android. On Mac, omit the macos-app- prefix. On Chromium, use a valid placeholder such as argent.capture. */
711
+ /** Bundle ID (iOS) / package (Android) / Mac bundle ID / placeholder on Chromium (e.g. `argent.capture`). */
676
712
  bundleId: string;
677
- /** The app's Metro port for JS capture and native log filtering. Omit it only when the app uses the device's port (usually 8081); otherwise check the project's Metro start script. Chromium uses the CDP port in udid. */
713
+ /** Metro port for JS capture and native filtering (omit for device default, usually 8081; ignored on Chromium). */
678
714
  port?: number;
679
- /** Omit to control both layers. Selecting one leaves the other alone. Chromium ignores this setting. */
715
+ /** Control one layer only (default: both; ignored on Chromium). */
680
716
  layer?: "js" | "native";
681
- /** For iOS simulators and Android on shared Metro, use the logical ID for the intended device if requested. Reuse it for start and stop, and as device_id for JS reads. For Mac apps, omit logicalDeviceId and keep the Mac app id even on shared Metro. */
717
+ /** Shared-Metro logical ID for iOS/Android if requested (reuse for start/stop/JS reads); omit on Mac apps. */
682
718
  logicalDeviceId?: string;
683
719
  };
684
720
  "network-conditions": {
685
- /** Device ID from list-devices. */
721
+ /** Device ID from `list-devices`. */
686
722
  udid: string;
687
- /** Bundle ID of the app to shape. Required on iOS and ignored elsewhere. */
723
+ /** App bundle ID (required on iOS; ignored elsewhere). */
688
724
  bundleId?: string;
689
- /** Metro port to exempt from shaping on iOS and Android. Omit for the device's port (usually 8081). */
725
+ /** Metro port exempt from shaping (omit for device default, usually 8081). */
690
726
  port?: number;
691
- /** Delay in milliseconds. Android adds it per round trip. iOS and Chromium use it as a minimum response delay. */
727
+ /** Added latency in ms. */
692
728
  latencyMs?: number;
693
- /** Download limit in kilobits per second. */
729
+ /** Download cap in kbps. */
694
730
  downloadKbps?: number;
695
- /** Upload limit in kilobits per second. */
731
+ /** Upload cap in kbps. */
696
732
  uploadKbps?: number;
697
- /** Make requests fail as if the network were down. On Android, adb reverse ports stay reachable, but Metro at 10.0.2.2 does not. False alone resets the conditions. */
733
+ /** Simulate offline (on Android, `adb reverse` ports stay reachable while Metro at `10.0.2.2` does not; `false` alone resets conditions). */
698
734
  offline?: boolean;
699
735
  };
700
736
  "open-url": {
701
- /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
737
+ /** Device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
702
738
  udid: string;
703
- /** URL or scheme to open (e.g. https://example.com, messages://, tel:555, geo:37.0,-122.0). */
739
+ /** URL or custom scheme (e.g. https://example.com, myapp://path). */
704
740
  url: string;
705
- /** Physical iOS only: the app that receives the URL. Defaults to Safari for http(s); required for any other scheme. */
741
+ /** Physical iOS only: receiving app (defaults to Safari for http/https; required otherwise). */
706
742
  bundleId?: string;
707
743
  };
708
744
  paste: {
709
- /** Target device id from `list-devices` (iOS simulator UDID or Android emulator serial, or Mac app id). */
745
+ /** Device id from `list-devices` (iOS simulator UDID, Android emulator serial, or Mac app id). */
710
746
  udid: string;
711
- /** Text to put on the device clipboard and paste into the focused field. Supports `{{secret:<NAME>}}` placeholders, resolved on the tool-server from the `ARGENT_SECRET_<NAME>` environment variable or an argent secrets file (the same sources as `keyboard`), so a credential never enters your context and is never echoed back. If the secret is not set, the failure lists the available names and every source it looked in; ask the user to add it there, NEVER ask for the value in the conversation. */
747
+ /** Text to paste. Supports `{{secret:<NAME>}}` placeholders resolved server-side (never ask the user for plaintext). */
712
748
  text: string;
713
749
  };
714
750
  "profiler-combined-report": {
715
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
751
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
716
752
  port?: number;
717
753
  /** Device ID from list-devices used for the native profile (iOS simulator UDID, Android serial, or Mac app ID). */
718
754
  device_id: string;
719
755
  };
720
756
  "profiler-commit-query": {
721
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
757
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
722
758
  port?: number;
723
759
  /** Device ID used to record or load the React profile. For a Mac app, use its ID from list-devices. */
724
760
  device_id: string;
725
- /** Query mode; see Modes in the tool description. */
761
+ /** Query mode. */
726
762
  mode: "by_component" | "by_time_range" | "by_index" | "cascade_tree" | "render_counts";
727
- /** Component name; optional for render_counts, which it narrows to one component */
763
+ /** Component name (optional filter for `render_counts`). */
728
764
  component_name?: string;
729
- /** Time range in ms since profiling started, the clock this tool prints */
765
+ /** Range in ms since profiling started. */
730
766
  time_range_ms?: {
731
- /** Start of range in ms */
767
+ /** Start ms. */
732
768
  start: number;
733
- /** End of range in ms */
769
+ /** End ms. */
734
770
  end: number;
735
771
  };
736
- /** Commit index */
772
+ /** Commit index. */
737
773
  commit_index?: number | null;
738
- /** Max results to return. Defaults to 20 for by_component / by_time_range, which count commits, and render_counts, which counts components. by_index counts individual fibers and returns all of them unless this is set; a small cap there can show less than the analyze report it is meant to expand on. */
774
+ /** Max results (default 20; unlimited for `by_index`). */
739
775
  top_n?: number;
740
776
  };
741
777
  "profiler-cpu-query": {
742
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
778
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
743
779
  port?: number;
744
780
  /** Device ID used to record or load the React profile. For a Mac app, use its ID from list-devices. */
745
781
  device_id: string;
746
- /** Query mode; see Modes in the tool description. */
782
+ /** Query mode. */
747
783
  mode: "top_functions" | "time_window" | "call_tree" | "component_cpu";
748
- /** Time window in ms since profiling started, the same clock profiler-commit-query prints */
784
+ /** Window in ms since profiling started (same clock as `profiler-commit-query`). */
749
785
  time_window_ms?: {
750
- /** Start of window in ms */
786
+ /** Start ms. */
751
787
  start: number;
752
- /** End of window in ms */
788
+ /** End ms. */
753
789
  end: number;
754
790
  };
755
- /** Component name */
791
+ /** Component name. */
756
792
  component_name?: string;
757
- /** Function name */
793
+ /** Function name. */
758
794
  function_name?: string;
759
- /** Number of results to return */
795
+ /** Max rows (default 15). */
760
796
  top_n?: number;
761
- /** Also show callers of the function */
797
+ /** Include callers (`call_tree`). */
762
798
  include_callers?: boolean;
763
- /** top_functions and time_window: list only React component functions (PascalCase names) */
799
+ /** Only PascalCase React components. */
764
800
  react_only?: boolean;
765
801
  };
766
802
  "profiler-load": {
767
- /** What to do; see Modes in the tool description. */
803
+ /** `list`, `load_react`, or `load_native`. */
768
804
  mode: "list" | "load_react" | "load_native";
769
- /** Timestamp-based session identifier (e.g. '20250313-143022') from the list output. */
805
+ /** Session ID from `list` (required for `load_*`). */
770
806
  session_id?: string;
771
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
807
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
772
808
  port?: number;
773
- /** Target device id from `list-devices`. Used to cache the loaded React session under the correct port+device key, and required to resolve the native profiler session for load_native. */
809
+ /** Device id from `list-devices` to bind the loaded session to. */
774
810
  device_id: string;
775
- /** Android package name to pass when restoring an older load_native .pftrace session that has no metadata sidecar. */
811
+ /** Android package name for legacy `.pftrace` sessions without metadata. */
776
812
  app_process?: string;
777
813
  };
778
814
  "profiler-stack-query": {
779
815
  /** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
780
816
  device_id: string;
781
- /** Query mode; see Modes in the tool description. */
817
+ /** Query mode. */
782
818
  mode: "hang_stacks" | "function_callers" | "thread_breakdown" | "leak_stacks";
783
- /** 0-based index into the hang list */
819
+ /** 0-based hang index. */
784
820
  hang_index?: number | null;
785
- /** Native function name */
821
+ /** Native function name. */
786
822
  function_name?: string;
787
- /** Thread filter. thread_breakdown: case-insensitive substring match. function_callers: exact raw thread name (e.g. ".blueskyweb.app"), or "main" for the UI thread; omit to search ALL threads (each result is tagged with its thread). Run thread_breakdown first to see the exact raw names. */
823
+ /** Thread filter (substring for `thread_breakdown`; exact raw name or `"main"` for `function_callers`). */
788
824
  thread?: string;
789
- /** Object type filter */
825
+ /** Object type filter (`leak_stacks`). */
790
826
  object_type?: string;
791
- /** Max results to return */
827
+ /** Max results (default 15). */
792
828
  top_n?: number;
793
829
  };
794
830
  propose_variant: {
@@ -825,21 +861,21 @@ export interface ArgentToolArgs {
825
861
  };
826
862
  };
827
863
  "react-profiler-analyze": {
828
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
864
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
829
865
  port?: number;
830
- /** Device ID used to record or load the React profile. For a Mac app, use its ID from list-devices. */
866
+ /** Device ID from list-devices used for the profile (Mac app: its list-devices ID). */
831
867
  device_id: string;
832
- /** Absolute path to the RN project root for session context detection */
868
+ /** Absolute path to the RN project root. */
833
869
  project_root: string;
834
- /** Platform for source lookup when the recording does not identify one. */
870
+ /** Fallback platform for source lookup if absent from recording. */
835
871
  platform?: "ios" | "android" | "macos";
836
- /** React Native version (e.g. "0.73.4") */
872
+ /** RN version (e.g. "0.73.4"). */
837
873
  rn_version?: string;
838
- /** User actions to annotate the report's commits with: each commit shows the action that preceded it. */
874
+ /** User actions to annotate report commits. */
839
875
  annotations?: Array<{
840
- /** Milliseconds since profiling started: tapTimestampMs - startedAtEpochMs, where tapTimestampMs is the timestampMs a tap/swipe tool returned and startedAtEpochMs is the value react-profiler-start returned. */
876
+ /** Ms since profiling started (`tapTimestampMs - startedAtEpochMs`). */
841
877
  offsetMs: number;
842
- /** Description of the action performed */
878
+ /** Action label. */
843
879
  label: string;
844
880
  }>;
845
881
  };
@@ -850,7 +886,7 @@ export interface ArgentToolArgs {
850
886
  project_root: string;
851
887
  };
852
888
  "react-profiler-cpu-summary": {
853
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
889
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
854
890
  port?: number;
855
891
  /** Device ID used to record or load the React profile. For a Mac app, use its ID from list-devices. */
856
892
  device_id: string;
@@ -860,7 +896,7 @@ export interface ArgentToolArgs {
860
896
  react_only?: boolean;
861
897
  };
862
898
  "react-profiler-fiber-tree": {
863
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
899
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
864
900
  port?: number;
865
901
  /** Device ID of the app to inspect. For a Mac app, use its ID from list-devices. During a recording, use the ID passed to react-profiler-start. */
866
902
  device_id: string;
@@ -870,7 +906,7 @@ export interface ArgentToolArgs {
870
906
  filter?: string;
871
907
  };
872
908
  "react-profiler-renders": {
873
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
909
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
874
910
  port?: number;
875
911
  /** Device ID of the app to inspect. For a Mac app, use its ID from list-devices. During a recording, use the ID passed to react-profiler-start. */
876
912
  device_id: string;
@@ -878,43 +914,43 @@ export interface ArgentToolArgs {
878
914
  top_n?: number;
879
915
  };
880
916
  "react-profiler-start": {
881
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
917
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
882
918
  port?: number;
883
- /** Device ID from list-devices, including a Mac app ID. For iOS or Android on a shared Metro, use the target's logicalDeviceId if asked to disambiguate. */
919
+ /** Device ID from list-devices, including a Mac app ID (or `logicalDeviceId` on shared Metro if requested). */
884
920
  device_id: string;
885
- /** CPU sampling interval in microseconds */
921
+ /** CPU sampling interval in microseconds. */
886
922
  sample_interval_us?: number;
887
- /** Take over an active profiling session even when it is owned by another tool-server and still fresh. Set to true only when you know the prior owner is gone. */
923
+ /** Take over another active fresh session (ask user approval first). */
888
924
  force?: boolean;
889
925
  };
890
926
  "react-profiler-status": {
891
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
927
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
892
928
  port?: number;
893
929
  /** Device ID of the app to inspect. For a Mac app, use its ID from list-devices. During a recording, use the ID passed to react-profiler-start. */
894
930
  device_id: string;
895
931
  };
896
932
  "react-profiler-stop": {
897
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
933
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
898
934
  port?: number;
899
935
  /** Device ID passed to react-profiler-start. For a Mac app, use its ID from list-devices. */
900
936
  device_id: string;
901
937
  };
902
938
  "reinstall-app": {
903
- /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
939
+ /** Device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
904
940
  udid: string;
905
- /** App identifier, used to uninstall the previous installation. iOS: bundle id. Android: package name. Vega: interactive component app id (e.g. com.example.app.main). HarmonyOS: bundle name (`app.bundleName` in the `.hap`). */
941
+ /** Bundle id (iOS), package name (Android), component id (Vega), or bundleName (HarmonyOS). */
906
942
  bundleId: string;
907
- /** Path to the app bundle. iOS: `.app` directory (e.g. ./build/.../MyApp.app). Android: `.apk` file (e.g. android/app/build/outputs/apk/debug/app-debug.apk). Vega: `.vpkg` file. HarmonyOS: `.hap` file. Relative paths are resolved from the current working directory. */
943
+ /** Path to `.app` (iOS), `.apk` (Android), `.vpkg` (Vega), or `.hap` (HarmonyOS). */
908
944
  appPath: string;
909
945
  };
910
946
  "restart-app": {
911
- /** Target device id from `list-devices` (iOS UDID, Mac app id, HarmonyOS id, or Android serial). */
947
+ /** Target device id from `list-devices`. */
912
948
  udid: string;
913
- /** App identifier. iOS: bundle id. Android: package name. Vega: interactive component app id. HarmonyOS: bundle name. Mac app: the bundle id in the device id. */
949
+ /** App identifier (iOS/Mac app bundle id, Android package name, Vega interactive component app id, or HarmonyOS bundle name). */
914
950
  bundleId: string;
915
- /** Android-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used. */
951
+ /** Android only: Activity name to relaunch (default: launcher activity). */
916
952
  activity?: string;
917
- /** Apple simulators, Mac apps and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Omitted on a Mac app, the app gets the arguments of its last start. */
953
+ /** Apple targets only: process launch args, e.g. `["-FeatureFlag", "YES"]`. */
918
954
  launchArgs?: Array<string>;
919
955
  };
920
956
  rotate: {
@@ -924,30 +960,30 @@ export interface ArgentToolArgs {
924
960
  orientation: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
925
961
  };
926
962
  "run-sequence": {
927
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, Mac app id, or Chromium id), shared across all steps. */
963
+ /** Target device id from `list-devices`, shared across all steps. */
928
964
  udid: string;
929
- /** Ordered list of interaction steps to execute sequentially */
965
+ /** Ordered steps to execute. */
930
966
  steps: Array<{
931
- /** Tool name: one of the allowed tools listed in the description. */
967
+ /** Allowed tool name (see description). */
932
968
  tool: string;
933
- /** Tool arguments (excluding udid, which is injected automatically) */
969
+ /** Tool arguments (omit `udid`, injected automatically). */
934
970
  args: {
935
971
  [key: string]: unknown;
936
972
  };
937
- /** Wait time in ms after this step (and after the settle wait) before the next (default 100) */
973
+ /** Extra pause in ms after step settle (default 100). */
938
974
  delayMs?: number;
939
975
  }>;
940
- /** Wait up to 1000ms after a screen-changing step for the element tree to settle before the next step. Default true; set false on a screen that never stops changing. */
976
+ /** Wait up to 1000ms for tree settle between screen-changing steps (default true). */
941
977
  settle?: boolean;
942
978
  };
943
979
  "screen-recording-start": {
944
- /** Target ID from `list-devices`. For a Mac app, use its device ID, such as `macos-app-com.example.notes`. */
980
+ /** Target ID from `list-devices` (Mac app: `macos-app-<bundle id>`). */
945
981
  udid: string;
946
- /** Auto-stop cap in seconds (default 180). Set it to slightly more than the interaction you plan to capture. */
982
+ /** Auto-stop cap in seconds (default 180). */
947
983
  timeLimitSeconds?: number;
948
- /** Default true. Collapse stretches where the screen does not change: the first second of each still stretch is kept, then unchanged frames are dropped until something moves again, so a long recording with brief activity comes back short instead of full of dead air. Set false to keep a faithful real-time recording. */
984
+ /** Collapse idle unchanged stretches after 1s (default true; false = real-time). */
949
985
  trimStatic?: boolean;
950
- /** Draw touch markers in the video (default true). Recordings of physical iPhones have no touch markers. For Mac apps, this shows the agent's pointer, a click ring, and a dot while a mouse button is held. */
986
+ /** Draw touch markers (default true; unsupported on physical iPhones). Mac apps: shows pointer, click ring, and hold dot. */
951
987
  showTouches?: boolean;
952
988
  };
953
989
  "screen-recording-stop": {
@@ -955,41 +991,41 @@ export interface ArgentToolArgs {
955
991
  udid: string;
956
992
  };
957
993
  screenshot: {
958
- /** Target device id from `list-devices` (iOS UDID, Android serial, Apple TV UDID, Vega serial, HarmonyOS id, Mac app id, or Chromium id). */
994
+ /** Target device id from `list-devices`. */
959
995
  udid: string;
960
- /** Orientation override for the screenshot (on Chromium it rotates the captured image). Rarely needed: on Android and iOS simulators the capture already follows the UI's orientation, the space describe frames and gesture coordinates use, and an override can make the image disagree with them. Rejected on HarmonyOS, which captures the display in its current orientation and has no override. Ignored on physical iPhones. */
996
+ /** Orientation override (rarely needed; captures already follow UI orientation). Rejected on HarmonyOS (captures display in current orientation). Ignored on physical iPhones. */
961
997
  rotation?: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
962
- /** Scale factor. Defaults to ARGENT_SCREENSHOT_SCALE env var, or 0.25 if unset for iOS/Android/HarmonyOS. On a local Apple TV simulator, an Android TV or Vega, with neither set, the capture is downscaled to a 576 px long side (0.15 of a 4K capture). On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency. On a Mac app the default is one pixel per window point, downscaled to a 768 px long side for a larger window. */
998
+ /** Scale factor (default 0.25 on iOS/Android/HarmonyOS or `ARGENT_SCREENSHOT_SCALE`, 576px long side on TV, 1.0 on Chromium, <=768px on Mac). */
963
999
  scale?: number;
964
- /** Set false only when capturing a full-resolution PNG (scale: 1.0) to save as a baseline/current for screenshot-diff. The file is still written, but the image bytes are not attached to the agent context. */
1000
+ /** Set false only when saving a full-res (`scale: 1.0`) baseline/current for `screenshot-diff`. */
965
1001
  includeImageInContext?: boolean;
966
- /** Downscaling algorithm when scale<1 on Chromium. Defaults to lanczos3 (highest quality). Ignored on every other platform. */
1002
+ /** Chromium only: downscaler when scale < 1 (default lanczos3). */
967
1003
  downscaler?: "lanczos3" | "box" | "bilinear" | "nearest";
968
1004
  };
969
1005
  "screenshot-diff": {
970
- /** Path to the saved baseline PNG file. Required unless captureBaseline is true; do not pass both. */
1006
+ /** Saved baseline PNG path (omit when `captureBaseline: true`). */
971
1007
  baselinePath?: string;
972
- /** Path to the saved current PNG file. Required unless captureCurrent is true; do not pass both. */
1008
+ /** Saved current PNG path (omit when `captureCurrent: true`). */
973
1009
  currentPath?: string;
974
- /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial, or a Mac app id). */
1010
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial, or Mac app id). */
975
1011
  udid: string;
976
- /** Capture the baseline screenshot live from the device, at full resolution, before diffing. Cannot be combined with captureCurrent. */
1012
+ /** Capture baseline live from the device, at full resolution (mutually exclusive with `captureCurrent`). */
977
1013
  captureBaseline?: boolean;
978
- /** Capture the current screenshot live from the device, at full resolution, before diffing. Cannot be combined with captureBaseline. */
1014
+ /** Capture current live from the device, at full resolution (mutually exclusive with `captureBaseline`). */
979
1015
  captureCurrent?: boolean;
980
- /** Orientation override for live baseline/current captures. Rejected on HarmonyOS, which captures the display in its current orientation and has no override. Ignored on physical iPhones. */
1016
+ /** Orientation override for live captures. Rejected on HarmonyOS. Ignored on physical iPhones. */
981
1017
  rotation?: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
982
- /** Directory where diff artifacts should be written (default: a temp directory). */
1018
+ /** Output directory for diff artifacts (default: temp dir). */
983
1019
  outputDir?: string;
984
1020
  };
985
1021
  "settings-permissions": {
986
- /** Target device id from `list-devices` (iOS simulator UDID or Android serial). */
1022
+ /** Device id from `list-devices` (iOS simulator UDID or Android serial). */
987
1023
  udid: string;
988
- /** `grant` pre-authorizes the permission, `deny` refuses it, `reset` returns it to the not-yet-asked state so the app prompts on next use. */
1024
+ /** `grant` (pre-authorize), `deny`, or `reset` (re-prompt on next use). */
989
1025
  action: "grant" | "deny" | "reset";
990
- /** The permission to change. `notifications` is Android-only; `reminders` is iOS-only; `camera` works on Android, and on iOS only when the simulator's runtime models the service. */
1026
+ /** Permission name (`notifications` = Android-only; `reminders` = iOS-only). */
991
1027
  permission: "camera" | "microphone" | "photos" | "contacts" | "notifications" | "calendar" | "location" | "location-always" | "media-library" | "motion" | "reminders";
992
- /** App to change the permission for; every action, `reset` included, applies to this app only. iOS: bundle id (e.g. com.example.app). Android: package name. */
1028
+ /** Target app bundle id (iOS) or package name (Android). */
993
1029
  bundleId: string;
994
1030
  };
995
1031
  shake: {
@@ -1017,11 +1053,11 @@ export interface ArgentToolArgs {
1017
1053
  bundleId: string;
1018
1054
  };
1019
1055
  "tv-remote": {
1020
- /** Target TV device id from `list-devices` (Apple TV, Android TV, or Vega). */
1056
+ /** TV device id from `list-devices` (Apple TV, Android TV, or Vega). */
1021
1057
  udid: string;
1022
- /** A single TV-remote button, or a path of them run in one call. Move focus with up/down/left/right, confirm with select, go back with back/menu, exit with home; the media and volume buttons press the matching remote keys. For multi-step navigation pass an array, e.g. ["up","right","right","select"]; strongly prefer this over multiple `tv-remote` calls: the whole path runs in a single call. */
1058
+ /** Single remote button or array path run in one call (e.g. ["up","right","select"]; prefer an array over repeated calls). */
1023
1059
  button: "up" | "down" | "left" | "right" | "select" | "back" | "home" | "menu" | "playPause" | "rewind" | "fastForward" | "next" | "previous" | "volumeUp" | "volumeDown" | "mute" | Array<"up" | "down" | "left" | "right" | "select" | "back" | "home" | "menu" | "playPause" | "rewind" | "fastForward" | "next" | "previous" | "volumeUp" | "volumeDown" | "mute">;
1024
- /** Repeat the whole `button` value this many times (default 1). Compact for long same-button runs, e.g. { button: "down", repeat: 12 }. */
1060
+ /** Repeat `button` N times (default 1, e.g. `{ button: "down", repeat: 12 }`). */
1025
1061
  repeat?: number;
1026
1062
  };
1027
1063
  "ui-tree": {
@@ -1033,21 +1069,21 @@ export interface ArgentToolArgs {
1033
1069
  target?: "auto" | "global" | "local" | "both";
1034
1070
  };
1035
1071
  "view-network-logs": {
1036
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
1072
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
1037
1073
  port?: number;
1038
- /** Device ID from list-devices. For iOS simulators and Android, use logicalDeviceId if capture started with it. For a Mac app, keep the Mac app id macos-app-<bundle id> on shared Metro and for builds started outside Argent. */
1074
+ /** Device ID from `list-devices` (or `logicalDeviceId` if shared Metro capture used it); Mac app: Mac app id `macos-app-<bundle id>`. */
1039
1075
  device_id: string;
1040
- /** Zero-based page index. "latest" and null select the newest page. Each page contains up to 50 entries. */
1076
+ /** 0-based page index, or `"latest"`/null for newest (50 entries/page). */
1041
1077
  pageIndex?: number | "latest" | null;
1042
1078
  };
1043
1079
  "view-network-request-details": {
1044
- /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
1080
+ /** Metro port (omit to use this device's port, default 8081; ignored on Chromium). */
1045
1081
  port?: number;
1046
- /** Device ID for the matching log. For JS capture on iOS simulators and Android, use the logicalDeviceId if capture started with it. For a Mac app, keep the Mac app id even on shared Metro. */
1082
+ /** Device ID for the log (or `logicalDeviceId` if JS capture used it); Mac app: Mac app id. */
1047
1083
  device_id: string;
1048
- /** Request ID from either network log or await-network-request. */
1084
+ /** Request ID from `view-network-logs`, `native-network-logs`, or `await-network-request`. */
1049
1085
  requestId: string;
1050
- /** Set false to omit the response body. The request body can still appear. */
1086
+ /** Include response body (default true). */
1051
1087
  includeBody?: boolean;
1052
1088
  };
1053
1089
  /** @deprecated Renamed to `e2e-add-echo`. */