@swmansion/argent 0.27.1-next.11 → 0.27.1-next.13

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
@@ -21916,7 +21916,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21916
21916
  var SESSION_ID2 = randomUUID5();
21917
21917
  function readCliVersion() {
21918
21918
  if (true) {
21919
- return "0.27.1-next.11";
21919
+ return "0.27.1-next.13";
21920
21920
  }
21921
21921
  return "0.0.0";
21922
21922
  }
package/dist/client.d.ts CHANGED
@@ -34,19 +34,24 @@ export interface UiTreeNode {
34
34
  width: number;
35
35
  height: number;
36
36
  };
37
- /** Android: the view class. */
37
+ /** Android: the view class. iOS: the XCUIElementType name, e.g. `TextField`. */
38
38
  type?: string;
39
39
  /** iOS: the accessibility trait names. */
40
40
  traits?: string[];
41
41
  roleDescription?: string;
42
42
  /** Android: the raw content-desc. */
43
43
  contentDescription?: string;
44
- /** Android window roots: the package. */
44
+ /** Roots: the app's bundle id (iOS) or package (Android). */
45
45
  bundleId?: string;
46
46
  editable?: boolean;
47
47
  heading?: boolean;
48
- /** iOS: on screen, but behind an in-app presentation. */
48
+ /** iOS: on screen, but behind an in-app presentation or a system alert. */
49
49
  covered?: boolean;
50
+ placeholder?: string;
51
+ /** The input shows its placeholder: it holds no text, and `value` is unset. */
52
+ hintShowing?: boolean;
53
+ /** No part of the frame is on screen inside its ancestors: scrolled out or clipped. */
54
+ hidden?: boolean;
50
55
  children: UiTreeNode[];
51
56
  }
52
57
  export interface UiTree {
@@ -57,10 +62,13 @@ export interface UiTree {
57
62
  width: number;
58
63
  height: number;
59
64
  };
65
+ /** While an iOS system alert shows, the system app first and the app it covers second. */
60
66
  roots: UiTreeNode[];
61
67
  truncated: boolean;
62
68
  alertVisible?: boolean;
63
69
  keyboardVisible?: boolean;
70
+ /** The bundle id of the app in front, under any system alert. */
71
+ foregroundApp?: string;
64
72
  /** Fields this source cannot report. */
65
73
  unsupportedFields: string[];
66
74
  }
@@ -16730,7 +16730,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16730
16730
  var SESSION_ID = randomUUID4();
16731
16731
  function readCliVersion() {
16732
16732
  if (true) {
16733
- return "0.27.1-next.11";
16733
+ return "0.27.1-next.13";
16734
16734
  }
16735
16735
  return "0.0.0";
16736
16736
  }
@@ -406,7 +406,7 @@ export interface ArgentToolArgs {
406
406
  bundleId: string;
407
407
  /** 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. */
408
408
  activity?: string;
409
- /** Apple simulators only: 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, including a physical iPhone. */
409
+ /** 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. */
410
410
  launchArgs?: Array<string>;
411
411
  };
412
412
  "list-devices": Record<string, never>;
@@ -749,7 +749,7 @@ export interface ArgentToolArgs {
749
749
  bundleId: string;
750
750
  /** 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. */
751
751
  activity?: string;
752
- /** Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets, including a physical iPhone. */
752
+ /** Apple simulators and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets. */
753
753
  launchArgs?: Array<string>;
754
754
  };
755
755
  rotate: {
@@ -94814,7 +94814,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94814
94814
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94815
94815
  function readCliVersion() {
94816
94816
  if (true) {
94817
- return "0.27.1-next.11";
94817
+ return "0.27.1-next.13";
94818
94818
  }
94819
94819
  return "0.0.0";
94820
94820
  }
@@ -97649,7 +97649,9 @@ var axServiceBlueprint = {
97649
97649
  alertVisible: result.alertVisible ?? false,
97650
97650
  screenFrame: result.screenFrame,
97651
97651
  nodes: result.nodes ?? [],
97652
- truncated: result.truncated === true
97652
+ truncated: result.truncated === true,
97653
+ foregroundApp: result.foregroundApp,
97654
+ treeVersion: result.treeVersion
97653
97655
  };
97654
97656
  },
97655
97657
  async livePanel() {
@@ -109190,6 +109192,9 @@ async function launchApp(udid, bundleId, opts = {}) {
109190
109192
  args.push("--payload-url", opts.payloadUrl);
109191
109193
  }
109192
109194
  args.push(bundleId);
109195
+ if (opts.args?.length) {
109196
+ args.push("--", ...opts.args);
109197
+ }
109193
109198
  await runDevicectl(args, `launch ${bundleId}`, { bundleId });
109194
109199
  }
109195
109200
  async function deviceInfoDetails(udid, opts = {}) {
@@ -122280,9 +122285,16 @@ async function signingUnreadyNote() {
122280
122285
  var iosDeviceImpl = {
122281
122286
  requires: ["xcrun"],
122282
122287
  handler: async (_services, params) => {
122288
+ const launchArgs = params.launchArgs?.length ? params.launchArgs : void 0;
122289
+ const systemUi = isSessionOnlySystemUi(params.bundleId);
122290
+ if (systemUi && launchArgs) {
122291
+ throw new InvalidToolInputError(
122292
+ `${params.bundleId} is system UI: it is always running and cannot take launch arguments.`
122293
+ );
122294
+ }
122283
122295
  await ensureDeviceReady(params.udid);
122284
- if (!isSessionOnlySystemUi(params.bundleId)) {
122285
- await launchApp(params.udid, params.bundleId);
122296
+ if (!systemUi) {
122297
+ await (launchArgs ? launchApp(params.udid, params.bundleId, { terminateExisting: true, args: launchArgs }) : launchApp(params.udid, params.bundleId));
122286
122298
  }
122287
122299
  setCurrentIosDeviceApp(params.udid, params.bundleId);
122288
122300
  const note = await signingUnreadyNote();
@@ -122450,7 +122462,7 @@ var zodSchema10 = external_exports.object({
122450
122462
  "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."
122451
122463
  ),
122452
122464
  launchArgs: external_exports.array(external_exports.string()).optional().describe(
122453
- 'Apple simulators only: 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, including a physical iPhone.'
122465
+ '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.'
122454
122466
  )
122455
122467
  });
122456
122468
  var capability2 = {
@@ -122562,7 +122574,10 @@ var iosDeviceImpl2 = {
122562
122574
  );
122563
122575
  }
122564
122576
  await ensureDeviceReady(params.udid);
122565
- await launchApp(params.udid, params.bundleId, { terminateExisting: true });
122577
+ await launchApp(params.udid, params.bundleId, {
122578
+ terminateExisting: true,
122579
+ args: params.launchArgs
122580
+ });
122566
122581
  setCurrentIosDeviceApp(params.udid, params.bundleId);
122567
122582
  return {
122568
122583
  restarted: true,
@@ -122667,7 +122682,7 @@ var zodSchema11 = external_exports.object({
122667
122682
  "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."
122668
122683
  ),
122669
122684
  launchArgs: external_exports.array(external_exports.string()).optional().describe(
122670
- 'Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets, including a physical iPhone.'
122685
+ 'Apple simulators and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets.'
122671
122686
  )
122672
122687
  });
122673
122688
  var capability3 = {
@@ -136113,14 +136128,115 @@ back/menu/home), then call describe again to confirm where focus landed.`,
136113
136128
  init_zod();
136114
136129
 
136115
136130
  // ../tool-server/src/tools/ui-tree/ios.ts
136116
- var UNSUPPORTED_FIELDS = [
136131
+ var LEGACY_UNSUPPORTED_FIELDS = [
136117
136132
  "type",
136118
136133
  "password",
136119
136134
  "placeholder",
136120
136135
  "hintShowing",
136121
- "hidden",
136136
+ "bundleId",
136122
136137
  "foregroundApp"
136123
136138
  ];
136139
+ var ELEMENT_TYPES = [
136140
+ "Any",
136141
+ "Other",
136142
+ "Application",
136143
+ "Group",
136144
+ "Window",
136145
+ "Sheet",
136146
+ "Drawer",
136147
+ "Alert",
136148
+ "Dialog",
136149
+ "Button",
136150
+ "RadioButton",
136151
+ "RadioGroup",
136152
+ "CheckBox",
136153
+ "DisclosureTriangle",
136154
+ "PopUpButton",
136155
+ "ComboBox",
136156
+ "MenuButton",
136157
+ "ToolbarButton",
136158
+ "Popover",
136159
+ "Keyboard",
136160
+ "Key",
136161
+ "NavigationBar",
136162
+ "TabBar",
136163
+ "TabGroup",
136164
+ "Toolbar",
136165
+ "StatusBar",
136166
+ "Table",
136167
+ "TableRow",
136168
+ "TableColumn",
136169
+ "Outline",
136170
+ "OutlineRow",
136171
+ "Browser",
136172
+ "CollectionView",
136173
+ "Slider",
136174
+ "PageIndicator",
136175
+ "ProgressIndicator",
136176
+ "ActivityIndicator",
136177
+ "SegmentedControl",
136178
+ "Picker",
136179
+ "PickerWheel",
136180
+ "Switch",
136181
+ "Toggle",
136182
+ "Link",
136183
+ "Image",
136184
+ "Icon",
136185
+ "SearchField",
136186
+ "ScrollView",
136187
+ "ScrollBar",
136188
+ "StaticText",
136189
+ "TextField",
136190
+ "SecureTextField",
136191
+ "DatePicker",
136192
+ "TextView",
136193
+ "Menu",
136194
+ "MenuItem",
136195
+ "MenuBar",
136196
+ "MenuBarItem",
136197
+ "Map",
136198
+ "WebView",
136199
+ "IncrementArrow",
136200
+ "DecrementArrow",
136201
+ "Timeline",
136202
+ "RatingIndicator",
136203
+ "ValueIndicator",
136204
+ "SplitGroup",
136205
+ "Splitter",
136206
+ "RelevanceIndicator",
136207
+ "ColorWell",
136208
+ "HelpTag",
136209
+ "Matte",
136210
+ "DockItem",
136211
+ "Ruler",
136212
+ "RulerMarker",
136213
+ "Grid",
136214
+ "LevelIndicator",
136215
+ "Cell",
136216
+ "LayoutArea",
136217
+ "LayoutItem",
136218
+ "Handle",
136219
+ "Stepper",
136220
+ "Tab",
136221
+ "TouchBar",
136222
+ "StatusItem"
136223
+ ];
136224
+ var FULL_SCREEN = { x: 0, y: 0, width: 1, height: 1 };
136225
+ function intersect(a, b) {
136226
+ const x = Math.max(a.x, b.x);
136227
+ const y = Math.max(a.y, b.y);
136228
+ const right = Math.min(a.x + a.width, b.x + b.width);
136229
+ const bottom = Math.min(a.y + a.height, b.y + b.height);
136230
+ return right > x && bottom > y ? { x, y, width: right - x, height: bottom - y } : void 0;
136231
+ }
136232
+ function markHidden(node, clip3) {
136233
+ let inner = clip3;
136234
+ if (node.frame) {
136235
+ inner = clip3 && intersect(node.frame, clip3);
136236
+ if (!inner) node.hidden = true;
136237
+ }
136238
+ for (const child of node.children) markHidden(child, inner);
136239
+ }
136124
136240
  function adaptAxTree(response) {
136125
136241
  const byIndex = /* @__PURE__ */ new Map();
136126
136242
  const roots = [];
@@ -136132,18 +136248,25 @@ function adaptAxTree(response) {
136132
136248
  const node = {
136133
136249
  role: mapNativeTraitsToDescribeRole(traits),
136134
136250
  label: raw.label,
136135
- value: raw.value,
136251
+ // AX answers an empty input's placeholder as its value.
136252
+ value: raw.hintShowing ? void 0 : raw.value,
136136
136253
  identifier: raw.identifier,
136137
136254
  roleDescription: raw.roleDescription,
136138
136255
  frame: raw.frame,
136139
136256
  children: []
136140
136257
  };
136258
+ if (raw.elementType !== void 0)
136259
+ node.type = raw.elementType === 0 ? "Other" : ELEMENT_TYPES[raw.elementType] ?? String(raw.elementType);
136141
136260
  if (traits.length > 0) node.traits = traits;
136261
+ if (raw.bundleId) node.bundleId = raw.bundleId;
136142
136262
  if (has("header")) node.heading = true;
136143
136263
  if (has("notEnabled")) node.disabled = true;
136144
136264
  if (has("selected")) node.selected = true;
136145
136265
  if (has("isEditing")) node.focused = true;
136146
136266
  if (has("textEntry") || has("searchField")) node.editable = true;
136267
+ if (has("secureTextEntry")) node.password = true;
136268
+ if (raw.placeholder) node.placeholder = raw.placeholder;
136269
+ if (raw.hintShowing) node.hintShowing = true;
136147
136270
  if (has("toggleButton") && (raw.value === "1" || raw.value === "0")) {
136148
136271
  node.checked = raw.value === "1";
136149
136272
  }
@@ -136152,6 +136275,7 @@ function adaptAxTree(response) {
136152
136275
  byIndex.set(raw.index, node);
136153
136276
  (parent ? parent.children : roots).push(node);
136154
136277
  }
136278
+ for (const root of roots) markHidden(root, FULL_SCREEN);
136155
136279
  return {
136156
136280
  schemaVersion: 1,
136157
136281
  source: "ax-service",
@@ -136161,7 +136285,8 @@ function adaptAxTree(response) {
136161
136285
  alertVisible: response.alertVisible,
136162
136286
  // A truncated walk may have cut the keyboard, so absence is unknown there.
136163
136287
  keyboardVisible: keyboardVisible || (response.truncated ? void 0 : false),
136164
- unsupportedFields: UNSUPPORTED_FIELDS
136288
+ foregroundApp: response.foregroundApp,
136289
+ unsupportedFields: (response.treeVersion ?? 1) >= 2 ? [] : LEGACY_UNSUPPORTED_FIELDS
136165
136290
  };
136166
136291
  }
136167
136292
  async function readIosUiTree(registry2, device) {
@@ -136329,7 +136454,7 @@ async function queryAndroidFullHierarchy(registry2, device) {
136329
136454
  }
136330
136455
 
136331
136456
  // ../tool-server/src/tools/ui-tree/android.ts
136332
- var UNSUPPORTED_FIELDS2 = [
136457
+ var UNSUPPORTED_FIELDS = [
136333
136458
  "placeholder",
136334
136459
  "hintShowing",
136335
136460
  "hidden",
@@ -136380,7 +136505,7 @@ function adaptAndroidTree(xml, truncated, screen) {
136380
136505
  screen: { width: screen.width, height: screen.height },
136381
136506
  roots,
136382
136507
  truncated,
136383
- unsupportedFields: UNSUPPORTED_FIELDS2
136508
+ unsupportedFields: UNSUPPORTED_FIELDS
136384
136509
  };
136385
136510
  }
136386
136511
  async function readAndroidUiTree(registry2, device) {
@@ -136411,7 +136536,7 @@ function createUiTreeTool(registry2) {
136411
136536
  },
136412
136537
  description: `Read the raw accessibility tree of the screen as nested JSON, for SDK callers.
136413
136538
  Use when a program needs element ancestry, such as an e2e engine's scoped selectors; agents use describe.
136414
- Returns { schemaVersion, roots, truncated, alertVisible, keyboardVisible, unsupportedFields }.
136539
+ Returns { schemaVersion, roots, truncated, alertVisible, keyboardVisible, foregroundApp, unsupportedFields }.
136415
136540
  Fails if the iOS ax-service predates the tree command; update argent.`,
136416
136541
  hideFromMcp: true,
136417
136542
  zodSchema: zodSchema40,
@@ -150102,7 +150227,7 @@ var SETTLE_MIN_READS = 2;
150102
150227
  var MAX_SCROLL_ITERATIONS = 25;
150103
150228
  var SCROLL_INCREMENT = 0.5;
150104
150229
  var MIN_SCROLL_INCREMENT = 0.05;
150105
- var FULL_SCREEN = { x: 0, y: 0, width: 1, height: 1 };
150230
+ var FULL_SCREEN2 = { x: 0, y: 0, width: 1, height: 1 };
150106
150231
  function clamp014(v) {
150107
150232
  return v < 0 ? 0 : v > 1 ? 1 : v;
150108
150233
  }
@@ -150315,7 +150440,7 @@ async function scrollToVisible(env, target, direction, within) {
150315
150440
  if (!tree) return { aborted: true };
150316
150441
  const orientation = readingOrientation(env);
150317
150442
  const axisDirection = nativeDirection(direction, orientation);
150318
- const region = within ? flowSelectorToFrame(tree, within, orientation) : FULL_SCREEN;
150443
+ const region = within ? flowSelectorToFrame(tree, within, orientation) : FULL_SCREEN2;
150319
150444
  if (!region) {
150320
150445
  return { reason: `scroll container ${describeSelector(within)} is not visible` };
150321
150446
  }
@@ -150324,7 +150449,7 @@ async function scrollToVisible(env, target, direction, within) {
150324
150449
  return { frame, ...warnedBy(warning) };
150325
150450
  }
150326
150451
  const scope = within ? [region] : anchorScrollFrames(tree, getDescribeTapPoint(region));
150327
- if (scope.length === 0) scope.push(FULL_SCREEN);
150452
+ if (scope.length === 0) scope.push(FULL_SCREEN2);
150328
150453
  const fp = treeFingerprint(tree, (node) => scope.some((r) => framesOverlap(node.frame, r)));
150329
150454
  if (prevFp !== void 0 && fp === prevFp) {
150330
150455
  if (frame) return { frame, ...warnedBy(warning) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.27.1-next.11",
3
+ "version": "0.27.1-next.13",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",