@swmansion/argent 0.27.1-next.12 → 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.12";
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.12";
16733
+ return "0.27.1-next.13";
16734
16734
  }
16735
16735
  return "0.0.0";
16736
16736
  }
@@ -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.12";
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() {
@@ -136126,14 +136128,115 @@ back/menu/home), then call describe again to confirm where focus landed.`,
136126
136128
  init_zod();
136127
136129
 
136128
136130
  // ../tool-server/src/tools/ui-tree/ios.ts
136129
- var UNSUPPORTED_FIELDS = [
136131
+ var LEGACY_UNSUPPORTED_FIELDS = [
136130
136132
  "type",
136131
136133
  "password",
136132
136134
  "placeholder",
136133
136135
  "hintShowing",
136134
- "hidden",
136136
+ "bundleId",
136135
136137
  "foregroundApp"
136136
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
+ }
136137
136240
  function adaptAxTree(response) {
136138
136241
  const byIndex = /* @__PURE__ */ new Map();
136139
136242
  const roots = [];
@@ -136145,18 +136248,25 @@ function adaptAxTree(response) {
136145
136248
  const node = {
136146
136249
  role: mapNativeTraitsToDescribeRole(traits),
136147
136250
  label: raw.label,
136148
- value: raw.value,
136251
+ // AX answers an empty input's placeholder as its value.
136252
+ value: raw.hintShowing ? void 0 : raw.value,
136149
136253
  identifier: raw.identifier,
136150
136254
  roleDescription: raw.roleDescription,
136151
136255
  frame: raw.frame,
136152
136256
  children: []
136153
136257
  };
136258
+ if (raw.elementType !== void 0)
136259
+ node.type = raw.elementType === 0 ? "Other" : ELEMENT_TYPES[raw.elementType] ?? String(raw.elementType);
136154
136260
  if (traits.length > 0) node.traits = traits;
136261
+ if (raw.bundleId) node.bundleId = raw.bundleId;
136155
136262
  if (has("header")) node.heading = true;
136156
136263
  if (has("notEnabled")) node.disabled = true;
136157
136264
  if (has("selected")) node.selected = true;
136158
136265
  if (has("isEditing")) node.focused = true;
136159
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;
136160
136270
  if (has("toggleButton") && (raw.value === "1" || raw.value === "0")) {
136161
136271
  node.checked = raw.value === "1";
136162
136272
  }
@@ -136165,6 +136275,7 @@ function adaptAxTree(response) {
136165
136275
  byIndex.set(raw.index, node);
136166
136276
  (parent ? parent.children : roots).push(node);
136167
136277
  }
136278
+ for (const root of roots) markHidden(root, FULL_SCREEN);
136168
136279
  return {
136169
136280
  schemaVersion: 1,
136170
136281
  source: "ax-service",
@@ -136174,7 +136285,8 @@ function adaptAxTree(response) {
136174
136285
  alertVisible: response.alertVisible,
136175
136286
  // A truncated walk may have cut the keyboard, so absence is unknown there.
136176
136287
  keyboardVisible: keyboardVisible || (response.truncated ? void 0 : false),
136177
- unsupportedFields: UNSUPPORTED_FIELDS
136288
+ foregroundApp: response.foregroundApp,
136289
+ unsupportedFields: (response.treeVersion ?? 1) >= 2 ? [] : LEGACY_UNSUPPORTED_FIELDS
136178
136290
  };
136179
136291
  }
136180
136292
  async function readIosUiTree(registry2, device) {
@@ -136342,7 +136454,7 @@ async function queryAndroidFullHierarchy(registry2, device) {
136342
136454
  }
136343
136455
 
136344
136456
  // ../tool-server/src/tools/ui-tree/android.ts
136345
- var UNSUPPORTED_FIELDS2 = [
136457
+ var UNSUPPORTED_FIELDS = [
136346
136458
  "placeholder",
136347
136459
  "hintShowing",
136348
136460
  "hidden",
@@ -136393,7 +136505,7 @@ function adaptAndroidTree(xml, truncated, screen) {
136393
136505
  screen: { width: screen.width, height: screen.height },
136394
136506
  roots,
136395
136507
  truncated,
136396
- unsupportedFields: UNSUPPORTED_FIELDS2
136508
+ unsupportedFields: UNSUPPORTED_FIELDS
136397
136509
  };
136398
136510
  }
136399
136511
  async function readAndroidUiTree(registry2, device) {
@@ -136424,7 +136536,7 @@ function createUiTreeTool(registry2) {
136424
136536
  },
136425
136537
  description: `Read the raw accessibility tree of the screen as nested JSON, for SDK callers.
136426
136538
  Use when a program needs element ancestry, such as an e2e engine's scoped selectors; agents use describe.
136427
- Returns { schemaVersion, roots, truncated, alertVisible, keyboardVisible, unsupportedFields }.
136539
+ Returns { schemaVersion, roots, truncated, alertVisible, keyboardVisible, foregroundApp, unsupportedFields }.
136428
136540
  Fails if the iOS ax-service predates the tree command; update argent.`,
136429
136541
  hideFromMcp: true,
136430
136542
  zodSchema: zodSchema40,
@@ -150115,7 +150227,7 @@ var SETTLE_MIN_READS = 2;
150115
150227
  var MAX_SCROLL_ITERATIONS = 25;
150116
150228
  var SCROLL_INCREMENT = 0.5;
150117
150229
  var MIN_SCROLL_INCREMENT = 0.05;
150118
- var FULL_SCREEN = { x: 0, y: 0, width: 1, height: 1 };
150230
+ var FULL_SCREEN2 = { x: 0, y: 0, width: 1, height: 1 };
150119
150231
  function clamp014(v) {
150120
150232
  return v < 0 ? 0 : v > 1 ? 1 : v;
150121
150233
  }
@@ -150328,7 +150440,7 @@ async function scrollToVisible(env, target, direction, within) {
150328
150440
  if (!tree) return { aborted: true };
150329
150441
  const orientation = readingOrientation(env);
150330
150442
  const axisDirection = nativeDirection(direction, orientation);
150331
- const region = within ? flowSelectorToFrame(tree, within, orientation) : FULL_SCREEN;
150443
+ const region = within ? flowSelectorToFrame(tree, within, orientation) : FULL_SCREEN2;
150332
150444
  if (!region) {
150333
150445
  return { reason: `scroll container ${describeSelector(within)} is not visible` };
150334
150446
  }
@@ -150337,7 +150449,7 @@ async function scrollToVisible(env, target, direction, within) {
150337
150449
  return { frame, ...warnedBy(warning) };
150338
150450
  }
150339
150451
  const scope = within ? [region] : anchorScrollFrames(tree, getDescribeTapPoint(region));
150340
- if (scope.length === 0) scope.push(FULL_SCREEN);
150452
+ if (scope.length === 0) scope.push(FULL_SCREEN2);
150341
150453
  const fp = treeFingerprint(tree, (node) => scope.some((r) => framesOverlap(node.frame, r)));
150342
150454
  if (prevFp !== void 0 && fp === prevFp) {
150343
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.12",
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",