@swmansion/argent 0.30.2-next.1 → 0.30.2-next.3

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.
@@ -1,6 +1,6 @@
1
1
  export interface ArgentToolArgs {
2
2
  "await-screen-idle": {
3
- /** Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id). */
3
+ /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
4
4
  udid: string;
5
5
  /** Max time to wait for the screen to settle before giving up (default 3000). */
6
6
  timeoutMs?: number;
@@ -10,7 +10,7 @@ export interface ArgentToolArgs {
10
10
  minStableMs?: number;
11
11
  };
12
12
  "await-ui-element": {
13
- /** Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id). */
13
+ /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
14
14
  udid: string;
15
15
  /** What to wait for. `exists`: selector is anywhere in the tree. `visible`: selector is present with a non-zero on-screen frame. `hidden`: selector is absent or zero-area. `text`: the first visible match in reading order (topmost), falling back to the first match overall if none is visible, contains (or, with textMatch `equals`, exactly matches) expectedText. If a loose selector hits several elements, only that one is checked, so narrow it to target the intended element. */
16
16
  condition: "exists" | "visible" | "hidden" | "text";
@@ -27,7 +27,7 @@ export interface ArgentToolArgs {
27
27
  expectedText?: string;
28
28
  /** For condition `text`: how expectedText is compared. `contains` (default) is a case-insensitive substring; `equals` is a case-insensitive full-string match. */
29
29
  textMatch?: "contains" | "equals";
30
- /** Optional iOS app bundle id, passed to the describe fallback (see `describe`). Ignored on Android / Chromium, and on physical iOS. */
30
+ /** Optional iOS app bundle id, passed to the describe fallback (see `describe`). Ignored on every other platform, including physical iOS. */
31
31
  bundleId?: string;
32
32
  /** Max time to wait for the condition before giving up (default 5000). */
33
33
  timeoutMs?: number;
@@ -39,21 +39,23 @@ export interface ArgentToolArgs {
39
39
  timeoutSeconds?: number;
40
40
  };
41
41
  "boot-device": {
42
- /** iOS: simulator UDID to boot (from `list-devices`). Provide exactly one of `udid`, `avdName`, `vvdImage`, or `electronAppPath`. */
42
+ /** iOS: simulator UDID to boot (from `list-devices`). Provide exactly one of `udid`, `avdName`, `vvdImage`, `harmonyInstance`, or `electronAppPath`. */
43
43
  udid?: string;
44
- /** Android: AVD name to launch a new emulator from (from `list-devices` → `avds[].name`). Provide exactly one of `udid`, `avdName`, `vvdImage`, or `electronAppPath`. */
44
+ /** Android: AVD name to launch a new emulator from (from `list-devices` → `avds[].name`). Provide exactly one of `udid`, `avdName`, `vvdImage`, `harmonyInstance`, or `electronAppPath`. */
45
45
  avdName?: string;
46
- /** Vega (Fire TV): VVD image to boot: the `vvdImage` of a Vega device from `list-devices` (e.g. `tv`). Starts the single SDK-managed Vega Virtual Device. Provide exactly one of `udid`, `avdName`, `vvdImage`, or `electronAppPath`. */
46
+ /** Vega (Fire TV): VVD image to boot: the `vvdImage` of a Vega device from `list-devices` (e.g. `tv`). Starts the single SDK-managed Vega Virtual Device. Provide exactly one of `udid`, `avdName`, `vvdImage`, `harmonyInstance`, or `electronAppPath`. */
47
47
  vvdImage?: string;
48
- /** Android/Vega: overall budget for the boot sequence. Default 480000 (8 min) on Android, 120000 (2 min) on Vega. Clamped to [30s, 15min]. Ignored on iOS. */
48
+ /** 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. Provide exactly one of `udid`, `avdName`, `vvdImage`, `harmonyInstance`, or `electronAppPath`. */
49
+ harmonyInstance?: string;
50
+ /** 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. Clamped to [30s, 15min]. Ignored on iOS. */
49
51
  bootTimeoutMs?: number;
50
- /** Shut down and re-boot the device even if already running. */
52
+ /** Shut down and re-boot the device even if already running. On HarmonyOS it is also what ties an already-running instance to the `hdc` connect key it registered under, since the emulator manager never reports one: without it the instance is left alone and the payload names the instance rather than a key (`list-devices` lists the keys, but not which instance each belongs to). Ignored for Electron, which always spawns a fresh process. */
51
53
  force?: boolean;
52
- /** Android only: boot the emulator with audio output enabled. Defaults to false: argent boots emulators MUTED so several agent-driven devices don't all play sound on the host machine; 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` to reboot it with sound. A boot snapshot saved in the other audio mode can't be reused, so the first boot after toggling is a slower cold boot. The `boot-sound` argent flag flips this default to true. Ignored on iOS/Vega/Electron, which argent never mutes. */
54
+ /** Android only: boot the emulator with audio output enabled. Defaults to false: argent boots emulators MUTED so several agent-driven devices don't all play sound on the host machine; 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` to reboot it with sound. A boot snapshot saved in the other audio mode can't be reused, so the first boot after toggling is a slower cold boot. The `boot-sound` argent flag flips this default to true. Ignored on iOS/Vega/HarmonyOS/Electron, which argent never mutes. */
53
55
  sound?: boolean;
54
- /** 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; used by Argent Lens. Set the `ARGENT_SIMULATOR_NO_WINDOW` env var (1/true/yes) to force this host-wide without passing the flag per call (the iOS analog of `ARGENT_EMULATOR_NO_WINDOW`). Ignored on Android/Vega/Electron, which have no equivalent GUI step. */
56
+ /** 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; used by Argent Lens. Set the `ARGENT_SIMULATOR_NO_WINDOW` env var (1/true/yes) to force this host-wide without passing the flag per call (the iOS analog of `ARGENT_EMULATOR_NO_WINDOW`). Ignored on Android/Vega/HarmonyOS/Electron, which have no equivalent GUI step. */
55
57
  headless?: boolean;
56
- /** 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. Mutually exclusive with udid/avdName. */
58
+ /** 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. Provide exactly one of `udid`, `avdName`, `vvdImage`, `harmonyInstance`, or `electronAppPath`. */
57
59
  electronAppPath?: string;
58
60
  /** Electron-only: CDP remote-debugging port to expose. Defaults to a free port; the resulting device id is `chromium-cdp-<port>`. */
59
61
  electronPort?: number;
@@ -61,7 +63,7 @@ export interface ArgentToolArgs {
61
63
  electronArgs?: Array<string>;
62
64
  };
63
65
  button: {
64
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
66
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
65
67
  udid: string;
66
68
  /** Hardware button to press */
67
69
  button: "home" | "back" | "power" | "volumeUp" | "volumeDown" | "appSwitch" | "actionButton";
@@ -179,9 +181,9 @@ export interface ArgentToolArgs {
179
181
  device_id: string;
180
182
  };
181
183
  describe: {
182
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id). */
184
+ /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, or Chromium id). */
183
185
  udid: string;
184
- /** Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on Android / Chromium, and on a physical iOS device. */
186
+ /** Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool 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. */
185
187
  bundleId?: string;
186
188
  };
187
189
  "dismiss-update": {
@@ -320,7 +322,7 @@ export interface ArgentToolArgs {
320
322
  momentum?: boolean;
321
323
  };
322
324
  "gesture-pinch": {
323
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
325
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
324
326
  udid: string;
325
327
  /** Center of pinch, horizontal: normalized 0.0–1.0 (fraction of screen width, not pixels) */
326
328
  centerX: number;
@@ -336,7 +338,7 @@ export interface ArgentToolArgs {
336
338
  endCenterY?: number;
337
339
  /** Axis angle in degrees along which the fingers are placed (default 0 = horizontal). */
338
340
  angle?: number;
339
- /** Total gesture duration in milliseconds (default 300) */
341
+ /** 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. */
340
342
  durationMs?: number;
341
343
  };
342
344
  "gesture-rotate": {
@@ -374,7 +376,7 @@ export interface ArgentToolArgs {
374
376
  durationMs?: number;
375
377
  };
376
378
  "gesture-swipe": {
377
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
379
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
378
380
  udid: string;
379
381
  /** Start x: normalized 0.0–1.0 (not pixels; same as tap) */
380
382
  fromX: number;
@@ -390,31 +392,31 @@ export interface ArgentToolArgs {
390
392
  momentum?: boolean;
391
393
  };
392
394
  "gesture-tap": {
393
- /** Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id). */
395
+ /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
394
396
  udid: string;
395
397
  /** Normalized horizontal position 0.0–1.0 (left=0, right=1), not pixels */
396
398
  x: number;
397
399
  /** Normalized vertical position 0.0–1.0 (top=0, bottom=1), not pixels */
398
400
  y: number;
399
- /** Number of taps/clicks dispatched as ONE multi-tap gesture (2 = double-tap / double-click). The taps land inside the OS double-tap window; on Chromium each click carries an escalating CDP clickCount so dblclick actually fires; on physical iOS 2 is the native double-tap and higher counts land as separate taps. Default 1. */
401
+ /** Number of taps/clicks dispatched as ONE multi-tap gesture (2 = double-tap / double-click). The taps land inside the OS double-tap window; on Chromium each click carries an escalating CDP clickCount so dblclick actually fires; on physical iOS 2 is the native double-tap and higher counts land as separate taps. On HarmonyOS only 2 is one gesture; 3 or more are separate injections a device round trip apart, which the OS reads as single taps. Default 1. */
400
402
  clickCount?: number;
401
403
  };
402
404
  keyboard: {
403
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id). */
405
+ /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, or Chromium id). */
404
406
  udid: string;
405
407
  /** Text to type character by character. Cannot be combined with `key` in one call (one call per action); to type and then press a key, put two `keyboard` steps in one `run-sequence`. Handles uppercase and common punctuation. To type a credential without its plaintext ever entering your context, use a secret placeholder: `{{secret:<NAME>}}`, e.g. text: "{{secret:APP_PASSWORD}}". The value 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. Placeholders can be embedded in longer text and are never echoed back resolved. If the secret you need is not set, the failure lists the available names and every source it looked in; 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. */
406
408
  text?: string;
407
- /** Named key to press: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1-f12. Cannot be combined with `text` in one call: one call per action; to type and then press a key, put two `keyboard` steps in one `run-sequence`. Not supported on TV targets; move focus with `tv-remote` (up/down/left/right) instead. Physical iOS: only `enter` and `backspace`. */
409
+ /** Named key to press: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1-f12. Cannot be combined with `text` in one call: one call per action; to type and then press a key, put two `keyboard` steps in one `run-sequence`. Not supported on TV targets; 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. */
408
410
  key?: string;
409
- /** Delay in ms between key presses (default 50). Ignored on Android phones/tablets (typed via `adb input text`, which has no per-key cadence), on Vega (text/keys injected in a single shot), on TV targets (Apple TV / Android TV type the whole string at the daemon's own cadence), and on physical iOS. */
411
+ /** Delay in ms between key presses (default 50). Ignored on Android phones/tablets (typed via `adb input text`, which has no per-key cadence), on HarmonyOS (`uitest uiInput text` types the whole string in one shot), on Vega (text/keys injected in a single shot), on TV targets (Apple TV / Android TV type the whole string at the daemon's own cadence), and on physical iOS. */
410
412
  delayMs?: number;
411
413
  };
412
414
  "launch-app": {
413
- /** Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id). */
415
+ /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
414
416
  udid: string;
415
- /** App identifier. iOS: bundle id (e.g. com.apple.MobileSMS). Android: package name from build.gradle `applicationId` (e.g. com.android.settings). Chromium: any tag matching the same alphabet (letters, digits, '.', '_' and '-'); the call is a no-op since the renderer is already running. */
417
+ /** App identifier. iOS: bundle id (e.g. com.apple.MobileSMS). Android: package name from build.gradle `applicationId` (e.g. com.android.settings). HarmonyOS: bundle name as listed by `bm dump -a` (e.g. com.huawei.hmos.calculator). Chromium: any tag matching the same alphabet (letters, digits, '.', '_' and '-'); the call is a no-op since the renderer is already running. */
416
418
  bundleId: string;
417
- /** Android-only: fully-qualified Activity name (e.g. `.MainActivity` or `com.example/com.example.MainActivity`). If omitted on Android, the app's default launcher activity is used. Ignored on iOS / Chromium. */
419
+ /** Android-only: fully-qualified Activity name (e.g. `.MainActivity` or `com.example/com.example.MainActivity`). If omitted on Android, the app's default launcher activity is used. Ignored on iOS / Chromium / HarmonyOS (a HarmonyOS ability is resolved from the bundle's own `abilityInfos`). */
418
420
  activity?: string;
419
421
  /** Apple simulators 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. Ignored on other targets. */
420
422
  launchArgs?: Array<string>;
@@ -545,7 +547,7 @@ export interface ArgentToolArgs {
545
547
  maxDepth?: number;
546
548
  };
547
549
  "open-url": {
548
- /** Target device id from `list-devices` (iOS UDID, Android serial, or Chromium id). */
550
+ /** Target device id from `list-devices` (iOS UDID, Android serial, HarmonyOS id, or Chromium id). */
549
551
  udid: string;
550
552
  /** URL or scheme to open (e.g. https://example.com, messages://, tel:555, geo:37.0,-122.0). For Chromium this navigates the renderer. */
551
553
  url: string;
@@ -745,19 +747,19 @@ export interface ArgentToolArgs {
745
747
  device_id: string;
746
748
  };
747
749
  "reinstall-app": {
748
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
750
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
749
751
  udid: string;
750
- /** App identifier that matches the bundle at `appPath`. iOS: bundle id (used to uninstall first). Android: package name (used to uninstall first; the install itself identifies the app from the APK). Vega: interactive component app id (e.g. com.example.app.main), used to uninstall first. */
752
+ /** App identifier that matches the bundle at `appPath`. iOS: bundle id (used to uninstall first). Android: package name (used to uninstall first; the install itself identifies the app from the APK). Vega: interactive component app id (e.g. com.example.app.main), used to uninstall first. HarmonyOS: bundle name, which must match `app.bundleName` in the `.hap`. */
751
753
  bundleId: string;
752
- /** 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. Relative paths are resolved from the current working directory. */
754
+ /** 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. */
753
755
  appPath: string;
754
756
  };
755
757
  "restart-app": {
756
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
758
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
757
759
  udid: string;
758
- /** App identifier. iOS: bundle id. Android: package name. */
760
+ /** App identifier. iOS: bundle id. Android: package name. HarmonyOS: bundle name. */
759
761
  bundleId: string;
760
- /** 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. Ignored on iOS. */
762
+ /** 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. Ignored on iOS / HarmonyOS. */
761
763
  activity?: string;
762
764
  /** Apple simulators and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets. */
763
765
  launchArgs?: Array<string>;
@@ -769,7 +771,7 @@ export interface ArgentToolArgs {
769
771
  orientation: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
770
772
  };
771
773
  "run-sequence": {
772
- /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id), shared across all steps. */
774
+ /** Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, HarmonyOS id, or Chromium id), shared across all steps. */
773
775
  udid: string;
774
776
  /** Ordered list of interaction steps to execute sequentially */
775
777
  steps: Array<{
@@ -798,11 +800,11 @@ export interface ArgentToolArgs {
798
800
  udid: string;
799
801
  };
800
802
  screenshot: {
801
- /** Target device id from `list-devices` (iOS UDID, Android serial, Apple TV UDID, Vega serial, or Chromium id). */
803
+ /** Target device id from `list-devices` (iOS UDID, Android serial, Apple TV UDID, Vega serial, HarmonyOS id, or Chromium id). */
802
804
  udid: string;
803
- /** Orientation override for the screenshot (rotates the captured image after Page.captureScreenshot on Chromium). On Android the capture already follows the device's rotation. Ignored on physical iPhones. */
805
+ /** Orientation override for the screenshot (rotates the captured image after Page.captureScreenshot on Chromium). On Android the capture already follows the device's rotation. Rejected on HarmonyOS, which captures the display in its current orientation and has no override. Ignored on physical iPhones. */
804
806
  rotation?: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
805
- /** Scale factor (0.01-1.0). Defaults to ARGENT_SCREENSHOT_SCALE env var, or 0.25 if unset for iOS/Android. 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); an Android TV whose form factor or display size cannot be read in time keeps 0.25. On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency. */
807
+ /** Scale factor (0.01-1.0). 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); an Android TV whose form factor or display size cannot be read in time keeps 0.25. On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency. */
806
808
  scale?: number;
807
809
  /** Default true. 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. */
808
810
  includeImageInContext?: boolean;
@@ -814,13 +816,13 @@ export interface ArgentToolArgs {
814
816
  baselinePath?: string;
815
817
  /** Path to the current PNG file. Required unless captureCurrent is true. */
816
818
  currentPath?: string;
817
- /** Target device id from `list-devices` (iOS UDID or Android serial). */
819
+ /** Target device id from `list-devices` (iOS UDID, HarmonyOS id, or Android serial). */
818
820
  udid: string;
819
821
  /** Capture the baseline screenshot live at full resolution before diffing. Cannot be combined with captureCurrent. */
820
822
  captureBaseline?: boolean;
821
823
  /** Capture the current screenshot live at full resolution before diffing. Cannot be combined with captureBaseline. */
822
824
  captureCurrent?: boolean;
823
- /** Orientation override for live baseline/current captures. Ignored on physical iPhones. */
825
+ /** 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. */
824
826
  rotation?: "Portrait" | "LandscapeLeft" | "LandscapeRight" | "PortraitUpsideDown";
825
827
  /** Directory where diff artifacts should be written. Optional: defaults to a temp directory; the diff images are returned in the result either way. */
826
828
  outputDir?: string;