@swmansion/argent 0.35.1-next.13 → 0.35.1-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli-cmds.mjs CHANGED
@@ -41106,6 +41106,23 @@ ${renderSummary(report, { withDevice: true })}`);
41106
41106
  return exitAfterFlush(report.ok ? 0 : 1);
41107
41107
  }
41108
41108
 
41109
+ // ../argent-cli/src/run-device-env.ts
41110
+ var DEVICE_ENV_VAR = "ARGENT_UDID";
41111
+ var DEVICE_FIELDS = ["udid", "device_id"];
41112
+ function requiredDeviceField(schema) {
41113
+ const properties = schema?.properties ?? {};
41114
+ const required2 = schema?.required ?? [];
41115
+ return DEVICE_FIELDS.find(
41116
+ (name) => required2.includes(name) && properties[name] && !isRetiredField(properties[name])
41117
+ );
41118
+ }
41119
+ function applyDeviceFromEnv(payload, schema, env = process.env) {
41120
+ const deviceId = env[DEVICE_ENV_VAR]?.trim();
41121
+ if (!deviceId) return;
41122
+ const field = requiredDeviceField(schema);
41123
+ if (field && !Object.hasOwn(payload, field)) payload[field] = deviceId;
41124
+ }
41125
+
41109
41126
  // ../argent-cli/src/run.ts
41110
41127
  function splitOptions(argv) {
41111
41128
  let json2 = false;
@@ -41217,6 +41234,9 @@ Examples:
41217
41234
  argent run run-sequence --udid <UDID> --steps-json '[{"tool":"button","args":{"button":"home"}}]'
41218
41235
  argent run gesture-tap --args '{"udid":"<UDID>","x":0.5,"y":0.5}'
41219
41236
 
41237
+ Set ARGENT_UDID to use that device when a tool needs --udid or --device_id
41238
+ and the call does not pass one.
41239
+
41220
41240
  Exits 1 when the tool fails. Also exits 1 when the result reports that the
41221
41241
  call did not do its job: an e2e test that does not pass, an await-ui-element
41222
41242
  or await-network-request wait with success=false, a run-sequence that a step
@@ -41343,6 +41363,7 @@ settled=false or debugger-status's not_connected.
41343
41363
  for (const [k, v] of Object.entries(parsed.args)) {
41344
41364
  payload[k] = v;
41345
41365
  }
41366
+ applyDeviceFromEnv(payload, schema);
41346
41367
  const missing = findMissingRequired(payload, schema);
41347
41368
  if (missing.length > 0) {
41348
41369
  await failValidation({ missing, invalid: [], rawIssues: null }, "cli_run_required_flags");
@@ -523,6 +523,8 @@ export interface ArgentToolArgs {
523
523
  text?: string;
524
524
  /** 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. */
525
525
  key?: string;
526
+ /** Press `key` this many times in one call, e.g. `{ key: "backspace", repeat: 12 }`. Only valid with `key`. */
527
+ repeat?: number;
526
528
  /** 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. */
527
529
  delayMs?: number;
528
530
  };
@@ -75028,6 +75028,12 @@ var import_semver2 = __toESM(require_semver2());
75028
75028
  // ../tool-server/package.json
75029
75029
  var version2 = "0.35.0";
75030
75030
 
75031
+ // ../tool-server/src/utils/update-check-env.ts
75032
+ function isUpdateCheckDisabled() {
75033
+ const raw = process.env.ARGENT_DISABLE_UPDATE_CHECK;
75034
+ return raw === "1" || raw?.toLowerCase() === "true";
75035
+ }
75036
+
75031
75037
  // ../tool-server/src/utils/update-checker.ts
75032
75038
  var import_update_core = __toESM(require_dist7());
75033
75039
  init_src();
@@ -75127,6 +75133,10 @@ function startUpdateChecker(options = {}) {
75127
75133
  if (interval) {
75128
75134
  clearInterval(interval);
75129
75135
  }
75136
+ if (isUpdateCheckDisabled()) {
75137
+ return { dispose() {
75138
+ } };
75139
+ }
75130
75140
  check2(options, generation).catch(() => {
75131
75141
  });
75132
75142
  const lifecycleInterval = setInterval(() => {
@@ -78920,6 +78930,7 @@ var updateArgentTool = {
78920
78930
  id: "update-argent",
78921
78931
  description: "Apply a pending Argent update. Call this only when the user has explicitly consented in this conversation to updating Argent, e.g. after an update notification reports a new version. Returns { message } with the update status, version info, and whether the tool server restarts. Fails if no update is available or an update is already in progress.",
78922
78932
  zodSchema,
78933
+ hideWhen: isUpdateCheckDisabled,
78923
78934
  interaction: {
78924
78935
  startedMsg: () => `Updating Argent to ${getUpdateState().installableVersion ?? "latest"}`,
78925
78936
  completedMsg: () => `Updated Argent to ${getUpdateState().installableVersion ?? "latest"}`,
@@ -101749,11 +101760,11 @@ function scheduleGroupSigkill(pid, graceMs, opts) {
101749
101760
  }
101750
101761
  async function pollPidsUntilGone(pids, opts) {
101751
101762
  const isAlive2 = opts.isAlive ?? pidIsAlive;
101752
- const sleep20 = opts.sleep ?? ((ms3) => new Promise((resolve21) => setTimeout(resolve21, ms3)));
101763
+ const sleep21 = opts.sleep ?? ((ms3) => new Promise((resolve21) => setTimeout(resolve21, ms3)));
101753
101764
  const maxPolls = Math.max(1, Math.ceil(opts.timeoutMs / opts.pollIntervalMs));
101754
101765
  let remaining = pids.filter((pid) => isAlive2(pid));
101755
101766
  for (let poll = 0; poll < maxPolls && remaining.length > 0; poll += 1) {
101756
- await sleep20(opts.pollIntervalMs);
101767
+ await sleep21(opts.pollIntervalMs);
101757
101768
  remaining = remaining.filter((pid) => isAlive2(pid));
101758
101769
  }
101759
101770
  return remaining;
@@ -114375,10 +114386,11 @@ async function injectAndroidText(serial, text) {
114375
114386
  });
114376
114387
  }
114377
114388
  }
114378
- async function injectAndroidKeycode(serial, keycode) {
114379
- await adbShell(serial, `input keyevent ${keycode}`, { timeoutMs: ADB_INPUT_TIMEOUT_MS });
114389
+ async function injectAndroidKeycode(serial, keycode, repeat = 1) {
114390
+ const keycodes = Array(repeat).fill(keycode).join(" ");
114391
+ await adbShell(serial, `input keyevent ${keycodes}`, { timeoutMs: ADB_INPUT_TIMEOUT_MS });
114380
114392
  }
114381
- async function injectAndroidNamedKey(serial, name) {
114393
+ async function injectAndroidNamedKey(serial, name, repeat = 1) {
114382
114394
  const lower = name.toLowerCase();
114383
114395
  const keycode = Object.hasOwn(ANDROID_NAMED_KEYCODES, lower) ? ANDROID_NAMED_KEYCODES[lower] : void 0;
114384
114396
  if (keycode == null) {
@@ -114391,7 +114403,7 @@ async function injectAndroidNamedKey(serial, name) {
114391
114403
  }
114392
114404
  );
114393
114405
  }
114394
- await injectAndroidKeycode(serial, keycode);
114406
+ await injectAndroidKeycode(serial, keycode, repeat);
114395
114407
  }
114396
114408
 
114397
114409
  // ../tool-server/src/blueprints/android-tv-control.ts
@@ -139538,7 +139550,11 @@ async function typeSimulatorServer(registry2, device, params) {
139538
139550
  }
139539
139551
  );
139540
139552
  }
139541
- await pressKeyCode(namedKeyCode);
139553
+ const count2 = params.repeat ?? 1;
139554
+ for (let i = 0; i < count2; i++) {
139555
+ await pressKeyCode(namedKeyCode);
139556
+ if (i < count2 - 1) await sleep10(delay3);
139557
+ }
139542
139558
  }
139543
139559
  return { typed: params.text ?? params.key ?? "", keys: keysPressed };
139544
139560
  }
@@ -139754,15 +139770,20 @@ function makeIosDeviceImpl(registry2) {
139754
139770
  reactivated ||= typed.reactivated;
139755
139771
  keys += params.text.length;
139756
139772
  }
139773
+ const count2 = params.repeat ?? 1;
139757
139774
  if (key2 === "enter") {
139758
- const pressed = await mapNotFocused(pressKeyboardReturn(api, bundleId));
139759
- reactivated ||= pressed.reactivated;
139760
- keys += 1;
139775
+ for (let i = 0; i < count2; i++) {
139776
+ const pressed = await mapNotFocused(pressKeyboardReturn(api, bundleId));
139777
+ reactivated ||= pressed.reactivated;
139778
+ keys += 1;
139779
+ }
139761
139780
  }
139762
139781
  if (key2 === "backspace") {
139763
- const pressed = await mapNotFocused(pressKeyboardDelete(api, bundleId));
139764
- reactivated ||= pressed.reactivated;
139765
- keys += 1;
139782
+ for (let i = 0; i < count2; i++) {
139783
+ const pressed = await mapNotFocused(pressKeyboardDelete(api, bundleId));
139784
+ reactivated ||= pressed.reactivated;
139785
+ keys += 1;
139786
+ }
139766
139787
  }
139767
139788
  return {
139768
139789
  typed: params.text ?? params.key ?? "",
@@ -139782,8 +139803,9 @@ async function typeAndroidPhone(device, params) {
139782
139803
  keysPressed += params.text.length;
139783
139804
  }
139784
139805
  if (params.key) {
139785
- await injectAndroidNamedKey(device.id, params.key);
139786
- keysPressed++;
139806
+ const count2 = params.repeat ?? 1;
139807
+ await injectAndroidNamedKey(device.id, params.key, count2);
139808
+ keysPressed += count2;
139787
139809
  }
139788
139810
  return { typed: params.text ?? params.key ?? "", keys: keysPressed };
139789
139811
  }
@@ -139911,22 +139933,26 @@ async function runChromium(api, params) {
139911
139933
  }
139912
139934
  );
139913
139935
  }
139914
- await api.dispatchKeyEvent({
139915
- type: "keyDown",
139916
- // Chromium needs carriage-return text for Enter's default form submission.
139917
- ...named.key === "Enter" ? { text: "\r" } : {},
139918
- key: named.key,
139919
- code: named.code,
139920
- windowsVirtualKeyCode: named.windowsVirtualKeyCode
139921
- });
139922
- await sleep11(delay3);
139923
- await api.dispatchKeyEvent({
139924
- type: "keyUp",
139925
- key: named.key,
139926
- code: named.code,
139927
- windowsVirtualKeyCode: named.windowsVirtualKeyCode
139928
- });
139929
- keysPressed++;
139936
+ const count2 = params.repeat ?? 1;
139937
+ for (let i = 0; i < count2; i++) {
139938
+ await api.dispatchKeyEvent({
139939
+ type: "keyDown",
139940
+ // Chromium needs carriage-return text for Enter's default form submission.
139941
+ ...named.key === "Enter" ? { text: "\r" } : {},
139942
+ key: named.key,
139943
+ code: named.code,
139944
+ windowsVirtualKeyCode: named.windowsVirtualKeyCode
139945
+ });
139946
+ await sleep11(delay3);
139947
+ await api.dispatchKeyEvent({
139948
+ type: "keyUp",
139949
+ key: named.key,
139950
+ code: named.code,
139951
+ windowsVirtualKeyCode: named.windowsVirtualKeyCode
139952
+ });
139953
+ keysPressed++;
139954
+ if (i < count2 - 1) await sleep11(delay3);
139955
+ }
139930
139956
  }
139931
139957
  return { typed: params.text ?? params.key ?? "", keys: keysPressed };
139932
139958
  }
@@ -139941,6 +139967,7 @@ function makeChromiumImpl(registry2) {
139941
139967
  }
139942
139968
 
139943
139969
  // ../tool-server/src/tools/keyboard/platforms/macos.ts
139970
+ var sleep12 = (ms3) => new Promise((r) => setTimeout(r, ms3));
139944
139971
  function makeMacosImpl(registry2) {
139945
139972
  return {
139946
139973
  handler: async (_services, params, device) => {
@@ -139950,8 +139977,13 @@ function makeMacosImpl(registry2) {
139950
139977
  return { typed: params.text, keys };
139951
139978
  }
139952
139979
  if (params.key) {
139953
- await macosPressKey(app, params.key);
139954
- return { typed: params.key, keys: 1 };
139980
+ const count2 = params.repeat ?? 1;
139981
+ const delay3 = params.delayMs ?? 50;
139982
+ for (let i = 0; i < count2; i++) {
139983
+ await macosPressKey(app, params.key);
139984
+ if (i < count2 - 1) await sleep12(delay3);
139985
+ }
139986
+ return { typed: params.key, keys: count2 };
139955
139987
  }
139956
139988
  return { typed: "", keys: 0 };
139957
139989
  }
@@ -140061,8 +140093,11 @@ async function runVega2(params) {
140061
140093
  keysPressed += [...params.text].length;
140062
140094
  }
140063
140095
  if (params.key) {
140064
- await injectVegaNamedKey(params.key);
140065
- keysPressed++;
140096
+ const count2 = params.repeat ?? 1;
140097
+ for (let i = 0; i < count2; i++) {
140098
+ await injectVegaNamedKey(params.key);
140099
+ keysPressed++;
140100
+ }
140066
140101
  }
140067
140102
  return { typed: params.text ?? params.key ?? "", keys: keysPressed };
140068
140103
  }
@@ -140151,8 +140186,11 @@ async function typeHarmony(connectKey, params, signal) {
140151
140186
  keysPressed += [...params.text].length;
140152
140187
  }
140153
140188
  if (keycode !== null) {
140154
- await ui.keyEvent(String(keycode));
140155
- keysPressed++;
140189
+ const count2 = params.repeat ?? 1;
140190
+ for (let i = 0; i < count2; i++) {
140191
+ await ui.keyEvent(String(keycode));
140192
+ keysPressed++;
140193
+ }
140156
140194
  }
140157
140195
  },
140158
140196
  signal
@@ -140184,6 +140222,9 @@ var zodSchema27 = external_exports.object({
140184
140222
  key: external_exports.string().optional().describe(
140185
140223
  "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`.<flag:harmonyos> HarmonyOS: only enter (return), backspace (delete), space, arrow-left and arrow-right; any other key fails with 400 KEYBOARD_KEY_UNSUPPORTED.</flag:harmonyos><flag:macos-apps> 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.</flag:macos-apps>"
140186
140224
  ),
140225
+ repeat: external_exports.number().int().min(1).max(100).optional().describe(
140226
+ 'Press `key` this many times in one call, e.g. `{ key: "backspace", repeat: 12 }`. Only valid with `key`.'
140227
+ ),
140187
140228
  delayMs: external_exports.number().optional().describe(
140188
140229
  "Delay in ms between key presses (default 50). Ignored on Android phones/tablets, <flag:harmonyos>HarmonyOS, </flag:harmonyos>Vega, Apple TV / Android TV and physical iOS, which type the whole string in one shot or at their own cadence."
140189
140230
  )
@@ -140221,11 +140262,16 @@ React Native: after typing, the next tap outside the field may only close the ke
140221
140262
  // rejects (text+key, `{ key: "" }`), while `completedMsg` runs only after
140222
140263
  // a success and sees neither. Both see the empty request, a no-op.
140223
140264
  startedMsg: ({ params }) => {
140224
- if (params.text === void 0) return "Pressing a key";
140265
+ if (params.text === void 0) {
140266
+ return (params.repeat ?? 1) > 1 ? `Pressing a key ${params.repeat} times` : "Pressing a key";
140267
+ }
140225
140268
  if (params.key === void 0) return "Entering text";
140226
140269
  return "Entering text and pressing a key";
140227
140270
  },
140228
- completedMsg: ({ params }) => params.text === void 0 ? "Pressed a key" : "Entered text",
140271
+ completedMsg: ({ params }) => {
140272
+ if (params.text !== void 0) return "Entered text";
140273
+ return (params.repeat ?? 1) > 1 ? `Pressed a key ${params.repeat} times` : "Pressed a key";
140274
+ },
140229
140275
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to use keyboard: ${failureSignal2.error_code}`
140230
140276
  },
140231
140277
  capability: capability18,
@@ -140269,6 +140315,14 @@ React Native: after typing, the next tap outside the field may only close the ke
140269
140315
  }
140270
140316
  );
140271
140317
  }
140318
+ if (params.repeat !== void 0 && params.key === void 0) {
140319
+ throw new InvalidToolInputError(
140320
+ '`repeat` only applies to `key`, not `text` or an empty request \u2014 nothing was typed. Pass a named `key` (e.g. { key: "backspace", repeat: 5 }), or omit `repeat`.',
140321
+ {
140322
+ failure_stage: "keyboard_repeat_without_key"
140323
+ }
140324
+ );
140325
+ }
140272
140326
  if (params.text === void 0) return dispatch(services, params, options);
140273
140327
  const { text, secrets } = resolveSecretPlaceholders(params.text, {
140274
140328
  clientSecrets: options?.clientSecrets
@@ -140302,7 +140356,7 @@ init_capability();
140302
140356
  var LEFT_GUI_KEYCODE = 227;
140303
140357
  var V_KEYCODE = charToKeyPress("v").keyCode;
140304
140358
  var CHORD_STEP_MS = 50;
140305
- var sleep12 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140359
+ var sleep13 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140306
140360
  var typesAsText = (char) => !"\n\r ".includes(char) && !!charToKeyPress(char);
140307
140361
  function rejectTv(device) {
140308
140362
  throw new UnsupportedOperationError(
@@ -140328,13 +140382,13 @@ async function pasteSimulator(registry2, device, api, params) {
140328
140382
  return { pasted: true, via: "keyboard" };
140329
140383
  }
140330
140384
  await api.pressKey("Down", LEFT_GUI_KEYCODE);
140331
- await sleep12(CHORD_STEP_MS);
140385
+ await sleep13(CHORD_STEP_MS);
140332
140386
  await api.pressKey("Down", V_KEYCODE);
140333
- await sleep12(CHORD_STEP_MS);
140387
+ await sleep13(CHORD_STEP_MS);
140334
140388
  await api.pressKey("Up", V_KEYCODE);
140335
- await sleep12(CHORD_STEP_MS);
140389
+ await sleep13(CHORD_STEP_MS);
140336
140390
  await api.pressKey("Up", LEFT_GUI_KEYCODE);
140337
- await sleep12(CHORD_STEP_MS);
140391
+ await sleep13(CHORD_STEP_MS);
140338
140392
  return { pasted: true };
140339
140393
  }
140340
140394
  function makeIosImpl4(registry2) {
@@ -140746,7 +140800,7 @@ async function prepareHostWindowShake(target) {
140746
140800
  var execFileAsync36 = (0, import_node_util37.promisify)(import_node_child_process48.execFile);
140747
140801
  var SHAKE_NOTIFICATION = "com.apple.UIKit.SimulatorShake";
140748
140802
  var SHAKE_INTERVAL_MS = 400;
140749
- var sleep13 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140803
+ var sleep14 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140750
140804
  var NOTIFYUTIL_ARGV = ["notifyutil", "-p", SHAKE_NOTIFICATION];
140751
140805
  function rejectTv2(toolId, device) {
140752
140806
  throw new UnsupportedOperationError(
@@ -140782,7 +140836,7 @@ var iosImpl4 = {
140782
140836
  const args = await simctlArgsForUdid(udid, ["spawn", udid, ...NOTIFYUTIL_ARGV]);
140783
140837
  const shaker = await prepareHostWindowShake({ kind: "ios", udid, name: device.name });
140784
140838
  for (let i = 0; i < count2; i++) {
140785
- if (i > 0) await sleep13(SHAKE_INTERVAL_MS);
140839
+ if (i > 0) await sleep14(SHAKE_INTERVAL_MS);
140786
140840
  shaker.begin();
140787
140841
  try {
140788
140842
  await execFileAsync36("xcrun", args, { timeout: 15e3 });
@@ -140802,7 +140856,7 @@ var iosRemoteImpl6 = {
140802
140856
  const count2 = params.count ?? 1;
140803
140857
  if (await isRemoteTvOsSimulator(udid)) rejectTv2("shake", device);
140804
140858
  for (let i = 0; i < count2; i++) {
140805
- if (i > 0) await sleep13(SHAKE_INTERVAL_MS);
140859
+ if (i > 0) await sleep14(SHAKE_INTERVAL_MS);
140806
140860
  let result;
140807
140861
  try {
140808
140862
  result = await simctlSpawn(udid, { args: NOTIFYUTIL_ARGV });
@@ -140850,7 +140904,7 @@ function restingVectorFrom(stdout) {
140850
140904
  return read;
140851
140905
  }
140852
140906
  var fmt = (v) => `${v.x.toFixed(4)}:${v.y.toFixed(4)}:${v.z.toFixed(4)}`;
140853
- var sleep14 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140907
+ var sleep15 = (ms3) => new Promise((r) => setTimeout(r, ms3));
140854
140908
  var inFlightByDevice = /* @__PURE__ */ new Map();
140855
140909
  function withDeviceLock(serial, fn) {
140856
140910
  const previous = inFlightByDevice.get(serial) ?? Promise.resolve();
@@ -140915,7 +140969,7 @@ var androidImpl6 = {
140915
140969
  y: rest.y,
140916
140970
  z: rest.z
140917
140971
  });
140918
- await sleep14(SWING_INTERVAL_MS);
140972
+ await sleep15(SWING_INTERVAL_MS);
140919
140973
  }
140920
140974
  }
140921
140975
  } catch (err) {
@@ -141287,7 +141341,7 @@ var DISMISS_SPACING_MS = 1e3;
141287
141341
  var DISMISS_TIMEOUT_MS = 5e3;
141288
141342
  var WAKE_GRACE_READS = 2;
141289
141343
  var abortReason2 = (signal) => signal.reason instanceof Error ? signal.reason : new Error("The fold was cancelled.");
141290
- var sleep15 = (ms3, signal) => new Promise((resolve21, reject) => {
141344
+ var sleep16 = (ms3, signal) => new Promise((resolve21, reject) => {
141291
141345
  if (signal?.aborted) return reject(abortReason2(signal));
141292
141346
  const timer = setTimeout(resolve21, ms3);
141293
141347
  signal?.addEventListener(
@@ -141361,7 +141415,7 @@ async function awaitSettled(serial, expected, wake, signal) {
141361
141415
  let agreeing = 0;
141362
141416
  const deadline = Date.now() + SETTLE_TIMEOUT_MS2;
141363
141417
  while (Date.now() < deadline) {
141364
- await sleep15(POLL_MS2, signal);
141418
+ await sleep16(POLL_MS2, signal);
141365
141419
  const read = await readSnapshot(serial);
141366
141420
  const same = read.state === last?.state && read.awake === last?.awake;
141367
141421
  if (!isReady(read, expected)) agreeing = 0;
@@ -141396,7 +141450,7 @@ async function dismissFoldLockScreen(serial, signal) {
141396
141450
  await shell(serial, "wm dismiss-keyguard");
141397
141451
  }
141398
141452
  }
141399
- await sleep15(POLL_MS2, signal);
141453
+ await sleep16(POLL_MS2, signal);
141400
141454
  }
141401
141455
  return "The fold raised the lock screen and argent could not dismiss it (a PIN or password keeps it up). Unlock the device before the next action.";
141402
141456
  }
@@ -142154,7 +142208,7 @@ Allowed tools, args (? = optional) and targets. Positions and distances are 0\u2
142154
142208
  gesture-pinch: centerX, centerY, startDistance, endDistance, endCenterX?, endCenterY?, angle?, durationMs? [ios/android<flag:harmonyos>/harmony</flag:harmonyos>]
142155
142209
  gesture-rotate: centerX, centerY, startAngle, endAngle, radius (or radiusX + radiusY), durationMs? [ios/android]
142156
142210
  button: button: "home"|"back"|"power"|"volumeUp"|"volumeDown"|"appSwitch"|"actionButton" [ios/android<flag:harmonyos>; harmony: home/back/power</flag:harmonyos>]
142157
- keyboard: text? or key? (one per step, e.g. key "enter"), delayMs?; text may hold {{secret:<NAME>}} placeholders, resolved server-side [all; Apple TV/Android TV: text only]
142211
+ keyboard: text? or key? (one per step, e.g. key "enter"), repeat?, delayMs?; text may hold {{secret:<NAME>}} placeholders, resolved server-side [all; Apple TV/Android TV: text only]
142158
142212
  paste: text (only where a user would paste, e.g. an OTP) [ios sim/android emu<flag:macos-apps>/macos</flag:macos-apps>]
142159
142213
  rotate: orientation: "Portrait"|"LandscapeLeft"|"LandscapeRight"|"PortraitUpsideDown" [ios sim/android]
142160
142214
  shake: count? [ios sim/android emu]
@@ -145599,8 +145653,13 @@ function formatLine(n, indent, source) {
145599
145653
  const annotated = annotations ? ` ${annotations}` : "";
145600
145654
  return `${pad}${n.role}${annotated} ${fmtFrame(n.frame)}`;
145601
145655
  }
145656
+ var IOS_SCROLL_BAR_LABEL = /^(Vertical|Horizontal) scroll bar, .+\bpages?$/;
145657
+ var PERCENT_VALUE = /^\d+(?:\.\d+)?%$/;
145658
+ function isIosScrollBar(n) {
145659
+ return n.role === "AXAdjustable" && !n.identifier && !n.hint && typeof n.label === "string" && IOS_SCROLL_BAR_LABEL.test(n.label) && (n.value === void 0 || PERCENT_VALUE.test(n.value));
145660
+ }
145602
145661
  function renderFlat(root, contentRoles, source) {
145603
- return root.children.filter((n) => shouldEmit(n, contentRoles) || hasIosState(n)).slice().sort((a, b) => a.frame.y - b.frame.y || a.frame.x - b.frame.x).map((n) => formatLine(n, 1, source));
145662
+ return root.children.filter((n) => !isIosScrollBar(n) && (shouldEmit(n, contentRoles) || hasIosState(n))).slice().sort((a, b) => a.frame.y - b.frame.y || a.frame.x - b.frame.x).map((n) => formatLine(n, 1, source));
145604
145663
  }
145605
145664
  function renderNested(root, contentRoles, source) {
145606
145665
  const lines = [];
@@ -145649,7 +145708,7 @@ function formatDescribeTree(root, opts) {
145649
145708
  }
145650
145709
 
145651
145710
  // ../tool-server/src/tools/describe/platforms/tv.ts
145652
- var sleep16 = (ms3) => new Promise((r) => setTimeout(r, ms3));
145711
+ var sleep17 = (ms3) => new Promise((r) => setTimeout(r, ms3));
145653
145712
  var EMPTY_RETRY_ATTEMPTS = 3;
145654
145713
  var EMPTY_RETRY_DELAY_MS = 600;
145655
145714
  var EMPTY_HINT2 = "No focusable elements after retrying and recycling the read path. Either the app is still loading or mid-transition (after launch-app / restart-app, or a press that opened an app), or the screen has nothing focusable (sleep, screensaver, video playback). Wait ~2-3s and call describe again; a React Native app only exposes focus once its JS bundle has loaded. If it stays empty, take a screenshot to confirm what's actually on screen.";
@@ -145681,7 +145740,7 @@ async function describeTv(registry2, device) {
145681
145740
  let res = await api.describe();
145682
145741
  if (device.platform !== "android") {
145683
145742
  for (let attempt = 1; attempt < EMPTY_RETRY_ATTEMPTS && isEmptyFocus(res); attempt++) {
145684
- await sleep16(EMPTY_RETRY_DELAY_MS);
145743
+ await sleep17(EMPTY_RETRY_DELAY_MS);
145685
145744
  res = await api.describe();
145686
145745
  }
145687
145746
  }
@@ -146361,7 +146420,7 @@ init_src2();
146361
146420
  var MAX_CLEAR_KEYS = 100;
146362
146421
  var XCTEST_DELETE = "\b";
146363
146422
  var KEY_TIMING = { holdMs: 20, settleMs: 300, typeDelayMs: 30 };
146364
- var sleep17 = (ms3) => new Promise((r) => setTimeout(r, ms3));
146423
+ var sleep18 = (ms3) => new Promise((r) => setTimeout(r, ms3));
146365
146424
  function typeableOnSimulator(text) {
146366
146425
  for (const char of text) if (!charToKeyPress(char)) return false;
146367
146426
  return true;
@@ -146386,9 +146445,9 @@ async function pressSimulatorBackspace(registry2, device) {
146386
146445
  const ref = simulatorServerRef(device);
146387
146446
  const api = await registry2.resolveService(ref.urn, ref.options);
146388
146447
  await api.pressKey("Down", NAMED_KEYS.backspace);
146389
- await sleep17(KEY_TIMING.holdMs);
146448
+ await sleep18(KEY_TIMING.holdMs);
146390
146449
  await api.pressKey("Up", NAMED_KEYS.backspace);
146391
- await sleep17(KEY_TIMING.settleMs);
146450
+ await sleep18(KEY_TIMING.settleMs);
146392
146451
  }
146393
146452
  async function typeOnSimulator(registry2, device, text) {
146394
146453
  if (!text) return;
@@ -173423,6 +173482,7 @@ var dismissUpdateTool = {
173423
173482
  id: "dismiss-update",
173424
173483
  description: "Postpone the Argent update reminder and the automatic update, on every tool-server on this machine, when the user wants it later or tomorrow, wants it stopped, or never wants it (87600 hours). Installs nothing. A memory or a reminder of your own does not change it. Returns { message, remindersResumeAt, persisted, pendingVersion }: tell the user when reminders resume, and if persisted is false, that it did not fully hold.",
173425
173484
  zodSchema: zodSchema79,
173485
+ hideWhen: isUpdateCheckDisabled,
173426
173486
  interaction: {
173427
173487
  startedMsg: () => "Dismissing Argent update",
173428
173488
  completedMsg: () => "Dismissed Argent update",
@@ -174337,7 +174397,7 @@ var path71 = __toESM(require("node:path"));
174337
174397
  init_zod();
174338
174398
  init_capability();
174339
174399
  init_device_info();
174340
- var sleep18 = (ms3) => new Promise((r) => setTimeout(r, ms3));
174400
+ var sleep19 = (ms3) => new Promise((r) => setTimeout(r, ms3));
174341
174401
  var DEFAULT_PANEL_TIMEOUT_MS = 5e3;
174342
174402
  var MAX_PANEL_TIMEOUT_MS = 3e4;
174343
174403
  var PANEL_POLL_MS2 = 100;
@@ -174447,7 +174507,7 @@ async function waitForPanel(app, params, signal) {
174447
174507
  "file_panel_not_open"
174448
174508
  );
174449
174509
  }
174450
- await sleep18(PANEL_POLL_MS2);
174510
+ await sleep19(PANEL_POLL_MS2);
174451
174511
  }
174452
174512
  }
174453
174513
  async function choose(app, params, ctx) {
@@ -174567,7 +174627,7 @@ Fails if no panel appears within timeoutMs, if more than one panel is open and p
174567
174627
  init_zod();
174568
174628
  init_capability();
174569
174629
  init_device_info();
174570
- var sleep19 = (ms3) => new Promise((r) => setTimeout(r, ms3));
174630
+ var sleep20 = (ms3) => new Promise((r) => setTimeout(r, ms3));
174571
174631
  var MAX_PATH_TITLES = 9;
174572
174632
  var capability41 = {
174573
174633
  macos: { app: true, catalyst: true }
@@ -174692,7 +174752,7 @@ Fails if no item matches (the error lists the titles at that level), if the item
174692
174752
  "Menu.perform",
174693
174753
  params.path !== void 0 ? { path: params.path } : { identifier: params.identifier }
174694
174754
  );
174695
- await sleep19(MACOS_CLICK_SETTLE_MS);
174755
+ await sleep20(MACOS_CLICK_SETTLE_MS);
174696
174756
  return {
174697
174757
  chosen: chosen.path,
174698
174758
  ...chosen.identifier !== void 0 ? { identifier: chosen.identifier } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.35.1-next.13",
3
+ "version": "0.35.1-next.15",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "eb7163afb29cd09a2d784f78f33cc51cdd9e8edb"
101
+ "gitHead": "bdf1c1ea412400691634b21833c87573590d81bc"
102
102
  }