@swmansion/argent 0.34.1-next.6 → 0.34.1-next.7

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
@@ -36085,7 +36085,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
36085
36085
  var SESSION_ID2 = randomUUID5();
36086
36086
  function readCliVersion() {
36087
36087
  if (true) {
36088
- return "0.34.1-next.5";
36088
+ return "0.34.1-next.7";
36089
36089
  }
36090
36090
  return "0.0.0";
36091
36091
  }
@@ -16993,7 +16993,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16993
16993
  var SESSION_ID = randomUUID4();
16994
16994
  function readCliVersion() {
16995
16995
  if (true) {
16996
- return "0.34.1-next.5";
16996
+ return "0.34.1-next.7";
16997
16997
  }
16998
16998
  return "0.0.0";
16999
16999
  }
@@ -79847,10 +79847,10 @@ async function probeAlive(device) {
79847
79847
  async function listExternalDevices(options = {}) {
79848
79848
  const providers = discoverProviders();
79849
79849
  if (providers.length === 0) return [];
79850
- const devices = providers.flatMap((record2) => readProviderDevices2(record2));
79851
- if (options.probe === false) return devices;
79852
- const alive = await Promise.all(devices.map((device) => probeAlive(device).catch(() => false)));
79853
- return devices.filter((_, index) => alive[index]);
79850
+ const devices2 = providers.flatMap((record2) => readProviderDevices2(record2));
79851
+ if (options.probe === false) return devices2;
79852
+ const alive = await Promise.all(devices2.map((device) => probeAlive(device).catch(() => false)));
79853
+ return devices2.filter((_, index) => alive[index]);
79854
79854
  }
79855
79855
  function findExternalDevice(id) {
79856
79856
  const parsed = parseExternalId(id);
@@ -84120,7 +84120,7 @@ async function removeAdbReverse(serial, devicePort) {
84120
84120
  }
84121
84121
  }
84122
84122
  function parseAdbDevices(stdout) {
84123
- const devices = [];
84123
+ const devices2 = [];
84124
84124
  const lines = stdout.split("\n");
84125
84125
  for (const raw of lines) {
84126
84126
  const line = raw.trim();
@@ -84129,9 +84129,9 @@ function parseAdbDevices(stdout) {
84129
84129
  if (!match) continue;
84130
84130
  const state3 = match[2];
84131
84131
  if (!ADB_DEVICE_STATES.has(state3)) continue;
84132
- devices.push({ serial: match[1], state: state3 });
84132
+ devices2.push({ serial: match[1], state: state3 });
84133
84133
  }
84134
- return devices;
84134
+ return devices2;
84135
84135
  }
84136
84136
  function consolePortFromAdbSerial(serial) {
84137
84137
  const emu = serial.match(/^emulator-(\d+)$/);
@@ -101285,7 +101285,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101285
101285
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101286
101286
  function readCliVersion() {
101287
101287
  if (true) {
101288
- return "0.34.1-next.5";
101288
+ return "0.34.1-next.7";
101289
101289
  }
101290
101290
  return "0.0.0";
101291
101291
  }
@@ -103831,7 +103831,7 @@ async function setContainsUdid(deviceSet, udid) {
103831
103831
  );
103832
103832
  const data = JSON.parse(stdout);
103833
103833
  return Object.values(data.devices ?? {}).some(
103834
- (devices) => devices.some((d) => d.udid === udid)
103834
+ (devices2) => devices2.some((d) => d.udid === udid)
103835
103835
  );
103836
103836
  } catch {
103837
103837
  return false;
@@ -103930,10 +103930,10 @@ async function listDeviceSetSimulators(deviceSet) {
103930
103930
  const data = JSON.parse(stdout);
103931
103931
  const out = [];
103932
103932
  const deviceTypes = [];
103933
- for (const [runtimeId, devices] of Object.entries(data.devices)) {
103933
+ for (const [runtimeId, devices2] of Object.entries(data.devices)) {
103934
103934
  const runtimeKind = simulatorRuntimeKind(runtimeId);
103935
103935
  if (!runtimeKind) continue;
103936
- for (const d of devices) {
103936
+ for (const d of devices2) {
103937
103937
  if (!d.isAvailable) continue;
103938
103938
  out.push({
103939
103939
  udid: d.udid,
@@ -104184,8 +104184,8 @@ async function getRemoteSimulatorRuntimeKind(udid, options) {
104184
104184
  const cached3 = remoteRuntimeKindCache.get(id);
104185
104185
  if (cached3) return cached3;
104186
104186
  try {
104187
- const { devices } = await simctlListDevices(options);
104188
- for (const [runtime, entries] of Object.entries(devices)) {
104187
+ const { devices: devices2 } = await simctlListDevices(options);
104188
+ for (const [runtime, entries] of Object.entries(devices2)) {
104189
104189
  if (!entries.some((d) => d.udid === id)) continue;
104190
104190
  const kind = simulatorRuntimeKind(runtime);
104191
104191
  if (kind) remoteRuntimeKindCache.set(id, kind);
@@ -124806,8 +124806,8 @@ async function getBootedUdidsInSet(deviceSet, signal) {
124806
124806
  });
124807
124807
  const data = JSON.parse(stdout);
124808
124808
  const udids = /* @__PURE__ */ new Set();
124809
- for (const devices of Object.values(data.devices)) {
124810
- for (const device of devices) {
124809
+ for (const devices2 of Object.values(data.devices)) {
124810
+ for (const device of devices2) {
124811
124811
  if (device.state === "Booted") {
124812
124812
  udids.add(device.udid);
124813
124813
  rememberDeviceSet(device.udid, deviceSet);
@@ -125907,9 +125907,9 @@ async function listIosPhysicalDevices() {
125907
125907
  return [];
125908
125908
  }
125909
125909
  const payload = json2;
125910
- const devices = payload?.result?.devices ?? [];
125910
+ const devices2 = payload?.result?.devices ?? [];
125911
125911
  const out = [];
125912
- for (const d of devices) {
125912
+ for (const d of devices2) {
125913
125913
  const hardwareProperties = d.hardwareProperties ?? {};
125914
125914
  const udid = hardwareProperties.udid ?? d.identifier;
125915
125915
  if (!udid) {
@@ -128541,7 +128541,7 @@ async function listVvdImages() {
128541
128541
  var VEGA_DISCOVERY_LIST_TIMEOUT_MS = 6e3;
128542
128542
  var VEGA_DISCOVERY_INFO_TIMEOUT_MS = 4e3;
128543
128543
  function parseVegaDeviceList(stdout) {
128544
- const devices = [];
128544
+ const devices2 = [];
128545
128545
  for (const raw of stdout.split("\n")) {
128546
128546
  const line = raw.trim();
128547
128547
  const sep11 = line.indexOf(" : ");
@@ -128552,9 +128552,9 @@ function parseVegaDeviceList(stdout) {
128552
128552
  const parts2 = rhs.split(/\s+-\s+/);
128553
128553
  const serial = parts2[parts2.length - 1]?.trim();
128554
128554
  if (!serial) continue;
128555
- devices.push({ serial, type });
128555
+ devices2.push({ serial, type });
128556
128556
  }
128557
- return devices;
128557
+ return devices2;
128558
128558
  }
128559
128559
  function filterVvdShadowsFromAndroid(androidDevices2, vvdAdbSerials) {
128560
128560
  return androidDevices2.filter((d) => !vvdAdbSerials.has(d.serial));
@@ -128692,10 +128692,10 @@ async function listRemoteIosSimulators() {
128692
128692
  try {
128693
128693
  const result = await simctlListDevices();
128694
128694
  const out = [];
128695
- for (const [runtime, devices] of Object.entries(result.devices)) {
128695
+ for (const [runtime, devices2] of Object.entries(result.devices)) {
128696
128696
  const runtimeKind = simulatorRuntimeKind(runtime);
128697
128697
  if (!runtimeKind) continue;
128698
- for (const d of devices) {
128698
+ for (const d of devices2) {
128699
128699
  if (d.isAvailable === false) continue;
128700
128700
  out.push({
128701
128701
  platform: "ios-remote",
@@ -128939,7 +128939,7 @@ Chromium apps are discovered by probing CDP debugging ports (default 9222; exten
128939
128939
  osVersion: h.osVersion
128940
128940
  }))
128941
128941
  ];
128942
- const devices = [
128942
+ const devices2 = [
128943
128943
  ...iosTagged,
128944
128944
  ...iosPhysicalTagged,
128945
128945
  ...iosRemote,
@@ -128950,7 +128950,7 @@ Chromium apps are discovered by probing CDP debugging ports (default 9222; exten
128950
128950
  ...harmonyTagged,
128951
128951
  ...external.map(toListedExternal)
128952
128952
  ];
128953
- devices.sort((a, b) => readinessRank(a) - readinessRank(b));
128953
+ devices2.sort((a, b) => readinessRank(a) - readinessRank(b));
128954
128954
  const avdsTagged = avds.map(
128955
128955
  (a) => foldableAvds.has(a.name) ? { ...a, foldable: true } : a
128956
128956
  );
@@ -128962,7 +128962,7 @@ Chromium apps are discovered by probing CDP debugging ports (default 9222; exten
128962
128962
  ...adbPrefix ? [adbServerHint(adbPrefix)] : []
128963
128963
  ];
128964
128964
  return {
128965
- devices,
128965
+ devices: devices2,
128966
128966
  avds: avdsTagged,
128967
128967
  ...hints.length > 0 ? { hint: hints.join("\n\n") } : {}
128968
128968
  };
@@ -131812,16 +131812,16 @@ function createPreviewRouter(registry2) {
131812
131812
  const KNOWN_DEVICES_TTL_MS = 5e3;
131813
131813
  let knownDevices = null;
131814
131814
  let knownDevicesInFlight = null;
131815
- function deviceIdSet(devices) {
131815
+ function deviceIdSet(devices2) {
131816
131816
  const ids = /* @__PURE__ */ new Set();
131817
- for (const d of devices) {
131817
+ for (const d of devices2) {
131818
131818
  const id = d.platform === "ios" ? d.udid : d.serial;
131819
131819
  if (typeof id === "string") ids.add(id);
131820
131820
  }
131821
131821
  return ids;
131822
131822
  }
131823
- function rememberDevices(devices) {
131824
- knownDevices = { ids: deviceIdSet(devices), at: Date.now() };
131823
+ function rememberDevices(devices2) {
131824
+ knownDevices = { ids: deviceIdSet(devices2), at: Date.now() };
131825
131825
  }
131826
131826
  async function knownDeviceIds() {
131827
131827
  if (knownDevices && Date.now() - knownDevices.at < KNOWN_DEVICES_TTL_MS) {
@@ -133730,6 +133730,159 @@ async function resolveTvApi(registry2, udid) {
133730
133730
  init_adb();
133731
133731
  init_capability();
133732
133732
 
133733
+ // ../tool-server/src/utils/secrets.ts
133734
+ init_src2();
133735
+ init_capability();
133736
+ init_src();
133737
+ var SECRET_PLACEHOLDER_MARKER = "{{secret:";
133738
+ function resolveSecretPlaceholders(text, options = {}) {
133739
+ const secrets = [];
133740
+ let sources;
133741
+ const resolved = text.replace(SECRET_PLACEHOLDER_RE, (_placeholder, rawName) => {
133742
+ sources ??= [
133743
+ ...options.clientSecrets ? [clientSecretSource(options.clientSecrets)] : [],
133744
+ ...secretSources(options)
133745
+ ];
133746
+ const { name, value } = lookupPlaceholderSecret(rawName, sources);
133747
+ if (value === void 0) {
133748
+ const names = secretNames(sources);
133749
+ const where = options.clientSecrets ? `the required secret ${name} was not provided: the argent client forwards its secrets to this tool-server and has no value for it, and no source on the machine running the tool-server defines it either` : `no source on the machine running the tool-server defines ${name}`;
133750
+ throw new InvalidToolInputError(
133751
+ `Unknown secret "${rawName}" \u2014 ${where}. Available secrets: ${names.length ? names.join(", ") : "(none)"}.
133752
+ Sources consulted, first match wins:
133753
+ ${describeSecretSources(sources)}
133754
+ ` + (options.clientSecrets ? clientSecretPlacementAdvice(name) : secretPlacementAdvice(name, options)),
133755
+ {
133756
+ error_code: FAILURE_CODES.SECRET_PLACEHOLDER_UNKNOWN,
133757
+ failure_stage: "secret_placeholder_resolution",
133758
+ error_kind: "validation"
133759
+ }
133760
+ );
133761
+ }
133762
+ if (!secrets.some((s) => s.name === name)) secrets.push({ name, value });
133763
+ return value;
133764
+ });
133765
+ return { text: resolved, secrets };
133766
+ }
133767
+ function scrubSecretValues(text, secrets) {
133768
+ return scrubSecretChunk(text, secrets, true).emit;
133769
+ }
133770
+ function scrubSecretChunk(text, secrets, final) {
133771
+ const ordered = orderedSecrets(secrets);
133772
+ if (ordered.length === 0) return { emit: text, held: 0 };
133773
+ const longestValue = ordered[0].value.length;
133774
+ const names = new Set(ordered.map((secret) => secret.name));
133775
+ const longestName = Math.max(...ordered.map((secret) => secret.name.length));
133776
+ let out = "";
133777
+ let copied = 0;
133778
+ let at = 0;
133779
+ while (at < text.length) {
133780
+ const marker = markerLengthAt(text, at, names, longestName);
133781
+ if (marker > 0 && !valueLeavesMarker(text, at, at + marker, ordered)) {
133782
+ at += marker;
133783
+ continue;
133784
+ }
133785
+ if (!final && text.length - at < longestValue && beginsAValue(text, at, ordered)) break;
133786
+ const hit = ordered.find((secret) => text.startsWith(secret.value, at));
133787
+ if (hit) {
133788
+ out += `${text.slice(copied, at)}${SECRET_PLACEHOLDER_MARKER}${hit.name}}}`;
133789
+ at += hit.value.length;
133790
+ copied = at;
133791
+ continue;
133792
+ }
133793
+ at += 1;
133794
+ }
133795
+ return {
133796
+ emit: copied === 0 ? text.slice(0, at) : out + text.slice(copied, at),
133797
+ held: text.length - at
133798
+ };
133799
+ }
133800
+ function valueLeavesMarker(text, from2, end, ordered) {
133801
+ for (let at = from2; at < end; at++) {
133802
+ for (const { value } of ordered) {
133803
+ if (at + value.length >= end && text.startsWith(value, at)) return true;
133804
+ }
133805
+ }
133806
+ return false;
133807
+ }
133808
+ function beginsAValue(text, at, ordered) {
133809
+ const rest = text.slice(at);
133810
+ return ordered.some(({ value }) => value.length > rest.length && value.startsWith(rest));
133811
+ }
133812
+ function orderedSecrets(secrets) {
133813
+ return secrets.filter(({ value }) => value.length > 0).sort((a, b) => b.value.length - a.value.length);
133814
+ }
133815
+ function markerLengthAt(text, at, names, longestName) {
133816
+ if (!text.startsWith(SECRET_PLACEHOLDER_MARKER, at)) return 0;
133817
+ const from2 = at + SECRET_PLACEHOLDER_MARKER.length;
133818
+ const window2 = text.slice(from2, from2 + longestName + 2);
133819
+ const end = window2.indexOf("}}");
133820
+ return end >= 0 && names.has(window2.slice(0, end)) ? SECRET_PLACEHOLDER_MARKER.length + end + 2 : 0;
133821
+ }
133822
+ function redactSecretsFromError(err, secrets) {
133823
+ const forms = secrets.flatMap((secret) => {
133824
+ const quoted = secret.value.replaceAll("'", "'\\''");
133825
+ return quoted === secret.value ? [secret] : [secret, { name: secret.name, value: quoted }];
133826
+ });
133827
+ const scrub = (s) => scrubSecretValues(s, forms);
133828
+ if (err instanceof Error) {
133829
+ err.message = scrub(err.message);
133830
+ if (err.stack) err.stack = scrub(err.stack);
133831
+ return err;
133832
+ }
133833
+ if (typeof err === "string") return scrub(err);
133834
+ return err;
133835
+ }
133836
+
133837
+ // ../tool-server/src/utils/typed-secrets.ts
133838
+ var MAX_VALUES = 256;
133839
+ var devices = /* @__PURE__ */ new Map();
133840
+ function deviceKey(deviceId) {
133841
+ return deviceId.toLowerCase();
133842
+ }
133843
+ function noteTypedSecrets(deviceId, secrets) {
133844
+ if (secrets.length === 0) return;
133845
+ const key2 = deviceKey(deviceId);
133846
+ const values = devices.get(key2) ?? /* @__PURE__ */ new Map();
133847
+ devices.set(key2, values);
133848
+ for (const { name, value } of secrets) {
133849
+ if (value.length === 0) continue;
133850
+ values.delete(value);
133851
+ values.set(value, `${SECRET_PLACEHOLDER_MARKER}${name}}}`);
133852
+ if (values.size > MAX_VALUES) values.delete(values.keys().next().value);
133853
+ }
133854
+ }
133855
+ function secretTypedOn(deviceId) {
133856
+ return devices.has(deviceKey(deviceId));
133857
+ }
133858
+ var WITHHELD_INPUT_TEXT = "[text withheld: a secret was typed on this device]";
133859
+ function redactTypedSecrets(deviceId, text) {
133860
+ const values = devices.get(deviceKey(deviceId));
133861
+ if (!values || values.size === 0) return text;
133862
+ const longestFirst = [...values].sort((a, b) => b[0].length - a[0].length);
133863
+ let out = "";
133864
+ for (let at = 0; at < text.length; ) {
133865
+ const hit = longestFirst.find(([value]) => text.startsWith(value, at));
133866
+ out += hit ? hit[1] : text[at];
133867
+ at += hit ? hit[0].length : 1;
133868
+ }
133869
+ return out;
133870
+ }
133871
+ function twinOf(tree, quotable, node2) {
133872
+ if (tree === node2) return quotable;
133873
+ for (let i = 0; i < tree.children.length; i++) {
133874
+ const twin = quotable.children[i];
133875
+ const found = twin && twinOf(tree.children[i], twin, node2);
133876
+ if (found) return found;
133877
+ }
133878
+ return void 0;
133879
+ }
133880
+ function quotedText(data, deviceId, node2, read) {
133881
+ if (!data.quotableTree) return redactTypedSecrets(deviceId, read(node2));
133882
+ const twin = twinOf(data.tree, data.quotableTree, node2);
133883
+ return twin ? read(twin) : WITHHELD_INPUT_TEXT;
133884
+ }
133885
+
133733
133886
  // ../tool-server/src/utils/poll-describe-tree.ts
133734
133887
  init_src2();
133735
133888
  async function pollDescribeTree(args) {
@@ -142976,7 +143129,11 @@ function flattenHoisting(node2, project, out, scrollClip = null) {
142976
143129
  if (t) childText.push(t);
142977
143130
  }
142978
143131
  const descendantText2 = childText.join(" ");
142979
- const subtree = view.ownText && !includesWordsCI(descendantText2, view.ownText) ? [view.ownText, descendantText2].filter(Boolean).join(" ") : descendantText2 || view.ownText;
143132
+ const ownParts = view.ownTextParts ?? [view.ownText];
143133
+ const subtree = [
143134
+ ...ownParts.filter((part) => part && !includesWordsCI(descendantText2, part)),
143135
+ descendantText2
143136
+ ].filter(Boolean).join(" ");
142980
143137
  if (view.leaf) {
142981
143138
  if (subtree && subtree !== view.ownText) view.leaf.subtreeText = subtree;
142982
143139
  out.push(view.leaf);
@@ -143561,7 +143718,8 @@ function timeoutNote(params, lastTree, fetchError, lastData) {
143561
143718
  case "text": {
143562
143719
  const first = textCheckTarget(matches2, void 0, isMacos(params));
143563
143720
  const wanted = params.textMatch === "equals" ? "equal" : "contain";
143564
- base = first ? `element matched but its text was "${macFieldText(first, isMacos(params)) ?? assertText(first)}" (wanted to ${wanted} "${params.expectedText}")` : "no element matched the selector before timeout";
143721
+ const shown = first ? redactTypedSecrets(params.udid, macFieldText(first, isMacos(params)) ?? assertText(first)) : void 0;
143722
+ base = shown !== void 0 ? `element matched but its text was "${shown}" (wanted to ${wanted} "${params.expectedText}")` : "no element matched the selector before timeout";
143565
143723
  break;
143566
143724
  }
143567
143725
  case "hidden":
@@ -147796,7 +147954,7 @@ init_external_devices();
147796
147954
  var import_node_crypto13 = require("node:crypto");
147797
147955
  init_src2();
147798
147956
  init_device_info();
147799
- function deviceKey(target) {
147957
+ function deviceKey2(target) {
147800
147958
  const logicalId = target.reactNative?.logicalDeviceId;
147801
147959
  if (logicalId) return logicalId;
147802
147960
  try {
@@ -147825,13 +147983,13 @@ function describeDevice(target) {
147825
147983
  function macosAppTargets(pool, bundleId, port) {
147826
147984
  const own2 = pool.filter((t) => macosAppBundleIdOf(t)?.toLowerCase() === bundleId.toLowerCase());
147827
147985
  if (own2.length) return own2;
147828
- const devices = /* @__PURE__ */ new Map();
147986
+ const devices2 = /* @__PURE__ */ new Map();
147829
147987
  for (const t of pool) {
147830
- const key2 = deviceKey(t);
147831
- if (key2 && !devices.has(key2)) devices.set(key2, describeDevice(t));
147988
+ const key2 = deviceKey2(t);
147989
+ if (key2 && !devices2.has(key2)) devices2.set(key2, describeDevice(t));
147832
147990
  }
147833
147991
  throw new FailureError(
147834
- `No JS runtime of the Mac app ${bundleId} is connected to Metro on port ${port}. Metro lists: ${[...devices.values()].join(", ")}. If the app does not run, start it (launch-app), wait a few seconds for the bundle to load, then retry. Otherwise the app must be a Debug build of react-native-macos 0.76 or later that loads its bundle from this Metro; a Release build has no JS debugger. If the app uses another Metro, pass that port.`,
147992
+ `No JS runtime of the Mac app ${bundleId} is connected to Metro on port ${port}. Metro lists: ${[...devices2.values()].join(", ")}. If the app does not run, start it (launch-app), wait a few seconds for the bundle to load, then retry. Otherwise the app must be a Debug build of react-native-macos 0.76 or later that loads its bundle from this Metro; a Release build has no JS debugger. If the app uses another Metro, pass that port.`,
147835
147993
  {
147836
147994
  error_code: FAILURE_CODES.DEBUGGER_TARGET_DEVICE_MISMATCH,
147837
147995
  failure_stage: "debugger_select_target",
@@ -147859,7 +148017,7 @@ function selectTarget(targets, port, options) {
147859
148017
  } else {
147860
148018
  const distinctDevices = /* @__PURE__ */ new Map();
147861
148019
  for (const t of pool) {
147862
- const key2 = deviceKey(t);
148020
+ const key2 = deviceKey2(t);
147863
148021
  if (key2 && !distinctDevices.has(key2)) distinctDevices.set(key2, describeDevice(t));
147864
148022
  }
147865
148023
  if (distinctDevices.size > 1) {
@@ -151152,8 +151310,8 @@ async function awaitFirstRealFrame(serial, timeoutMs) {
151152
151310
  }
151153
151311
  async function findSerialByAvdName(avdName, deadline) {
151154
151312
  while (Date.now() < deadline) {
151155
- const devices = await listAndroidDevices().catch(() => []);
151156
- const match = devices.find((d) => d.isEmulator && d.avdName === avdName);
151313
+ const devices2 = await listAndroidDevices().catch(() => []);
151314
+ const match = devices2.find((d) => d.isEmulator && d.avdName === avdName);
151157
151315
  if (match) return match.serial;
151158
151316
  await new Promise((r) => setTimeout(r, BOOT_POLL_INTERVALS_MS.serialByAvd));
151159
151317
  }
@@ -151191,8 +151349,8 @@ async function awaitOwnEmulatorSettled(avdName, deadline) {
151191
151349
  while (Date.now() < deadline) {
151192
151350
  if (healthy) return healthy;
151193
151351
  if ((await listEmulatorPidsForAvd(avdName)).length === 0) return null;
151194
- listing ??= listAndroidDevices().then((devices) => {
151195
- if (devices.some((d) => isRunningAvd(d, avdName))) healthy = devices;
151352
+ listing ??= listAndroidDevices().then((devices2) => {
151353
+ if (devices2.some((d) => isRunningAvd(d, avdName))) healthy = devices2;
151196
151354
  }).catch(() => {
151197
151355
  }).finally(() => {
151198
151356
  listing = null;
@@ -151203,9 +151361,9 @@ async function awaitOwnEmulatorSettled(avdName, deadline) {
151203
151361
  }
151204
151362
  return healthy;
151205
151363
  }
151206
- async function dropUnreachableSerials(devices, serialsBefore) {
151364
+ async function dropUnreachableSerials(devices2, serialsBefore) {
151207
151365
  await Promise.all(
151208
- devices.filter((d) => d.isEmulator && !(d.state === "device" && d.avdName !== null)).map(async (d) => {
151366
+ devices2.filter((d) => d.isEmulator && !(d.state === "device" && d.avdName !== null)).map(async (d) => {
151209
151367
  if ((await readEmulatorConsoleAvdName(d.serial)).status === "unreachable") {
151210
151368
  serialsBefore.delete(d.serial);
151211
151369
  }
@@ -151363,8 +151521,8 @@ async function bootIosRemote(id, registry2, force) {
151363
151521
  let simState;
151364
151522
  try {
151365
151523
  const list = await simctlListDevices();
151366
- outer: for (const devices of Object.values(list.devices)) {
151367
- for (const d of devices) {
151524
+ outer: for (const devices2 of Object.values(list.devices)) {
151525
+ for (const d of devices2) {
151368
151526
  if (d.udid === udid) {
151369
151527
  simState = d.state;
151370
151528
  break outer;
@@ -156267,110 +156425,6 @@ init_zod();
156267
156425
  init_src2();
156268
156426
  init_capability();
156269
156427
 
156270
- // ../tool-server/src/utils/secrets.ts
156271
- init_src2();
156272
- init_capability();
156273
- init_src();
156274
- var SECRET_PLACEHOLDER_MARKER = "{{secret:";
156275
- function resolveSecretPlaceholders(text, options = {}) {
156276
- const secrets = [];
156277
- let sources;
156278
- const resolved = text.replace(SECRET_PLACEHOLDER_RE, (_placeholder, rawName) => {
156279
- sources ??= [
156280
- ...options.clientSecrets ? [clientSecretSource(options.clientSecrets)] : [],
156281
- ...secretSources(options)
156282
- ];
156283
- const { name, value } = lookupPlaceholderSecret(rawName, sources);
156284
- if (value === void 0) {
156285
- const names = secretNames(sources);
156286
- const where = options.clientSecrets ? `the required secret ${name} was not provided: the argent client forwards its secrets to this tool-server and has no value for it, and no source on the machine running the tool-server defines it either` : `no source on the machine running the tool-server defines ${name}`;
156287
- throw new InvalidToolInputError(
156288
- `Unknown secret "${rawName}" \u2014 ${where}. Available secrets: ${names.length ? names.join(", ") : "(none)"}.
156289
- Sources consulted, first match wins:
156290
- ${describeSecretSources(sources)}
156291
- ` + (options.clientSecrets ? clientSecretPlacementAdvice(name) : secretPlacementAdvice(name, options)),
156292
- {
156293
- error_code: FAILURE_CODES.SECRET_PLACEHOLDER_UNKNOWN,
156294
- failure_stage: "secret_placeholder_resolution",
156295
- error_kind: "validation"
156296
- }
156297
- );
156298
- }
156299
- if (!secrets.some((s) => s.name === name)) secrets.push({ name, value });
156300
- return value;
156301
- });
156302
- return { text: resolved, secrets };
156303
- }
156304
- function scrubSecretValues(text, secrets) {
156305
- return scrubSecretChunk(text, secrets, true).emit;
156306
- }
156307
- function scrubSecretChunk(text, secrets, final) {
156308
- const ordered = orderedSecrets(secrets);
156309
- if (ordered.length === 0) return { emit: text, held: 0 };
156310
- const longestValue = ordered[0].value.length;
156311
- const names = new Set(ordered.map((secret) => secret.name));
156312
- const longestName = Math.max(...ordered.map((secret) => secret.name.length));
156313
- let out = "";
156314
- let copied = 0;
156315
- let at = 0;
156316
- while (at < text.length) {
156317
- const marker = markerLengthAt(text, at, names, longestName);
156318
- if (marker > 0 && !valueLeavesMarker(text, at, at + marker, ordered)) {
156319
- at += marker;
156320
- continue;
156321
- }
156322
- if (!final && text.length - at < longestValue && beginsAValue(text, at, ordered)) break;
156323
- const hit = ordered.find((secret) => text.startsWith(secret.value, at));
156324
- if (hit) {
156325
- out += `${text.slice(copied, at)}${SECRET_PLACEHOLDER_MARKER}${hit.name}}}`;
156326
- at += hit.value.length;
156327
- copied = at;
156328
- continue;
156329
- }
156330
- at += 1;
156331
- }
156332
- return {
156333
- emit: copied === 0 ? text.slice(0, at) : out + text.slice(copied, at),
156334
- held: text.length - at
156335
- };
156336
- }
156337
- function valueLeavesMarker(text, from2, end, ordered) {
156338
- for (let at = from2; at < end; at++) {
156339
- for (const { value } of ordered) {
156340
- if (at + value.length >= end && text.startsWith(value, at)) return true;
156341
- }
156342
- }
156343
- return false;
156344
- }
156345
- function beginsAValue(text, at, ordered) {
156346
- const rest = text.slice(at);
156347
- return ordered.some(({ value }) => value.length > rest.length && value.startsWith(rest));
156348
- }
156349
- function orderedSecrets(secrets) {
156350
- return secrets.filter(({ value }) => value.length > 0).sort((a, b) => b.value.length - a.value.length);
156351
- }
156352
- function markerLengthAt(text, at, names, longestName) {
156353
- if (!text.startsWith(SECRET_PLACEHOLDER_MARKER, at)) return 0;
156354
- const from2 = at + SECRET_PLACEHOLDER_MARKER.length;
156355
- const window2 = text.slice(from2, from2 + longestName + 2);
156356
- const end = window2.indexOf("}}");
156357
- return end >= 0 && names.has(window2.slice(0, end)) ? SECRET_PLACEHOLDER_MARKER.length + end + 2 : 0;
156358
- }
156359
- function redactSecretsFromError(err, secrets) {
156360
- const forms = secrets.flatMap((secret) => {
156361
- const quoted = secret.value.replaceAll("'", "'\\''");
156362
- return quoted === secret.value ? [secret] : [secret, { name: secret.name, value: quoted }];
156363
- });
156364
- const scrub = (s) => scrubSecretValues(s, forms);
156365
- if (err instanceof Error) {
156366
- err.message = scrub(err.message);
156367
- if (err.stack) err.stack = scrub(err.stack);
156368
- return err;
156369
- }
156370
- if (typeof err === "string") return scrub(err);
156371
- return err;
156372
- }
156373
-
156374
156428
  // ../tool-server/src/tools/keyboard/simulator-server-keys.ts
156375
156429
  init_src2();
156376
156430
 
@@ -157114,6 +157168,7 @@ React Native: after typing, the next tap outside the field may only close the ke
157114
157168
  clientSecrets: options?.clientSecrets
157115
157169
  });
157116
157170
  if (secrets.length === 0) return dispatch(services, params, options);
157171
+ noteTypedSecrets(params.udid, secrets);
157117
157172
  try {
157118
157173
  const result = await dispatch(services, { ...params, text }, options);
157119
157174
  return { ...result, typed: params.text };
@@ -157306,6 +157361,7 @@ Tap the field first so it has focus. Returns { pasted: true }, plus via: "keyboa
157306
157361
  });
157307
157362
  return serializedPerDevice(params.udid, async () => {
157308
157363
  if (secrets.length === 0) return dispatch(services, params, options);
157364
+ noteTypedSecrets(params.udid, secrets);
157309
157365
  try {
157310
157366
  return await dispatch(services, { ...params, text, hasSecrets: true }, options);
157311
157367
  } catch (err) {
@@ -162255,6 +162311,7 @@ Fails with FILL_NO_FOCUSED_FIELD when nothing editable has focus, FILL_NOT_VERIF
162255
162311
  const { text, secrets } = resolveSecretPlaceholders(params.text, {
162256
162312
  clientSecrets: options?.clientSecrets
162257
162313
  });
162314
+ noteTypedSecrets(params.udid, secrets);
162258
162315
  try {
162259
162316
  return await dispatch(services, { udid: params.udid, text }, options);
162260
162317
  } catch (err) {
@@ -175045,8 +175102,8 @@ Fails if the input has an unknown key (e.g. \`udids\` instead of \`devices\`); o
175045
175102
  // "all" only holds for the unscoped sweep; a scoped call touches just the
175046
175103
  // ids it was given.
175047
175104
  startedMsg: ({ params }) => {
175048
- const devices = params?.devices;
175049
- return devices ? `Stopping simulator servers for ${devices.length} ${devices.length === 1 ? "device" : "devices"}` : "Stopping all simulator servers";
175105
+ const devices2 = params?.devices;
175106
+ return devices2 ? `Stopping simulator servers for ${devices2.length} ${devices2.length === 1 ? "device" : "devices"}` : "Stopping all simulator servers";
175050
175107
  },
175051
175108
  completedMsg: ({ result }) => {
175052
175109
  const n = result.stopped.length;
@@ -175070,8 +175127,8 @@ Fails if the input has an unknown key (e.g. \`udids\` instead of \`devices\`); o
175070
175127
  },
175071
175128
  services: () => ({}),
175072
175129
  async execute(_services, params, ctx) {
175073
- const devices = params.devices;
175074
- const scoped = devices !== void 0;
175130
+ const devices2 = params.devices;
175131
+ const scoped = devices2 !== void 0;
175075
175132
  const snapshot = registry2.getSnapshot();
175076
175133
  const stopped = [];
175077
175134
  const matchedIds = /* @__PURE__ */ new Set();
@@ -175082,7 +175139,7 @@ Fails if the input has an unknown key (e.g. \`udids\` instead of \`devices\`); o
175082
175139
  aborted2 = true;
175083
175140
  break;
175084
175141
  }
175085
- const matchedId = scoped ? deviceIdOwningUrn(urn, DEVICE_OWNED_NAMESPACES, devices) : void 0;
175142
+ const matchedId = scoped ? deviceIdOwningUrn(urn, DEVICE_OWNED_NAMESPACES, devices2) : void 0;
175086
175143
  const matches2 = scoped ? matchedId !== void 0 : isDeviceServiceUrn(urn, DEVICE_OWNED_NAMESPACES);
175087
175144
  if (matchedId !== void 0) matchedIds.add(matchedId.toLowerCase());
175088
175145
  if (matches2 && entry.state !== "IDLE" /* IDLE */) {
@@ -175096,7 +175153,7 @@ Fails if the input has an unknown key (e.g. \`udids\` instead of \`devices\`); o
175096
175153
  if (aborted2) return { stopped, aborted: true };
175097
175154
  if (!scoped) return { stopped };
175098
175155
  const seen = /* @__PURE__ */ new Set();
175099
- const unmatched = devices.filter((id) => {
175156
+ const unmatched = devices2.filter((id) => {
175100
175157
  const key2 = id.toLowerCase();
175101
175158
  if (matchedIds.has(key2) || seen.has(key2)) return false;
175102
175159
  seen.add(key2);
@@ -177915,14 +177972,14 @@ function isBooted(d, platform) {
177915
177972
  return false;
177916
177973
  }
177917
177974
  }
177918
- function connectedIosDeviceHint(devices, platform) {
177975
+ function connectedIosDeviceHint(devices2, platform) {
177919
177976
  if (platform && platform !== "ios") return "";
177920
- const ids = devices.filter((d) => d.platform === "ios" && d.kind === "device" && d.state === "connected").map((d) => d.udid).filter((id) => Boolean(id));
177977
+ const ids = devices2.filter((d) => d.platform === "ios" && d.kind === "device" && d.state === "connected").map((d) => d.udid).filter((id) => Boolean(id));
177921
177978
  if (ids.length === 0) return "";
177922
177979
  return ` A physical iPhone is connected (${ids.join(", ")}); hardware is never picked automatically, pass device <udid> (--device on the CLI) to run on it.`;
177923
177980
  }
177924
- function macosAppHint(devices, platform) {
177925
- if (platform || !devices.some((d) => d.platform === "macos")) return "";
177981
+ function macosAppHint(devices2, platform) {
177982
+ if (platform || !devices2.some((d) => d.platform === "macos")) return "";
177926
177983
  return " A Mac app is picked only with --platform macos or --device.";
177927
177984
  }
177928
177985
  function macosFlagHint(platform) {
@@ -178009,9 +178066,9 @@ async function assertDeviceMeetsRequires(device, requires, subject2 = "This e2e
178009
178066
  );
178010
178067
  }
178011
178068
  }
178012
- function unknownRuntimeKindError(requires, devices, subject2 = "This e2e test", remedy = "") {
178069
+ function unknownRuntimeKindError(requires, devices2, subject2 = "This e2e test", remedy = "") {
178013
178070
  return requirementsError(
178014
- `${subject2} declares ${describeRequires(requires)}, but the runtime kind of ${devices.join(", ")} could not be determined.${remedy}`,
178071
+ `${subject2} declares ${describeRequires(requires)}, but the runtime kind of ${devices2.join(", ")} could not be determined.${remedy}`,
178015
178072
  FAILURE_CODES.FLOW_DEVICE_RESOLUTION
178016
178073
  );
178017
178074
  }
@@ -178029,8 +178086,8 @@ async function resolveFlowDevice(registry2, ctx, opts) {
178029
178086
  if (macosRefusal) throw deviceResolutionError(`Cannot run on ${device.id}: ${macosRefusal}`);
178030
178087
  return device;
178031
178088
  }
178032
- const { devices } = await invokeSubTool(registry2, ctx, "list-devices", {});
178033
- const booted = devices.filter((d) => isBooted(d, opts.platform));
178089
+ const { devices: devices2 } = await invokeSubTool(registry2, ctx, "list-devices", {});
178090
+ const booted = devices2.filter((d) => isBooted(d, opts.platform));
178034
178091
  const scoped = opts.platform ? booted.filter((d) => d.platform === opts.platform) : booted;
178035
178092
  const requires = opts.requires;
178036
178093
  const candidates = requires ? scoped.filter((d) => platformMeets(d.platform, requires)) : scoped;
@@ -178072,8 +178129,8 @@ async function resolveFlowDevice(registry2, ctx, opts) {
178072
178129
  if (eligible.length === 0) {
178073
178130
  const what = opts.platform ? `No booted ${opts.platform} device found.` : "No booted device found.";
178074
178131
  throw deviceResolutionError(
178075
- `${what} Pass a device id or platform explicitly.${connectedIosDeviceHint(devices, opts.platform)}${macosAppHint(devices, opts.platform)}${macosFlagHint(opts.platform)}`,
178076
- devices
178132
+ `${what} Pass a device id or platform explicitly.${connectedIosDeviceHint(devices2, opts.platform)}${macosAppHint(devices2, opts.platform)}${macosFlagHint(opts.platform)}`,
178133
+ devices2
178077
178134
  );
178078
178135
  }
178079
178136
  throw deviceResolutionError(
@@ -178194,6 +178251,7 @@ function asViewNode(v) {
178194
178251
  className: nonEmptyString(r.className),
178195
178252
  identifier: nonEmptyString(r.identifier),
178196
178253
  label: nonEmptyString(r.label),
178254
+ value: nonEmptyString(r.value),
178197
178255
  frame: asRect2(r.frame),
178198
178256
  windowFrame: asRect2(r.windowFrame),
178199
178257
  screenFrame: asRect2(r.screenFrame),
@@ -178203,10 +178261,11 @@ function asViewNode(v) {
178203
178261
  children
178204
178262
  };
178205
178263
  }
178264
+ var IOS_TEXT_INPUT_ROLE = "AXTextField";
178206
178265
  function roleFromClassName(cn) {
178207
178266
  if (!cn) return "AXGroup";
178208
178267
  if (/Button/i.test(cn)) return "AXButton";
178209
- if (/(TextField|TextView|SearchField)/i.test(cn)) return "AXTextField";
178268
+ if (/(TextField|TextView|SearchField)/i.test(cn)) return IOS_TEXT_INPUT_ROLE;
178210
178269
  if (/(Label|Text)/i.test(cn)) return "AXStaticText";
178211
178270
  if (/Image/i.test(cn)) return "AXImage";
178212
178271
  if (/(Slider|Stepper|Switch|ProgressView)/i.test(cn)) return "AXAdjustable";
@@ -178229,9 +178288,12 @@ function normalizeFrame4(rect, screenW, screenH) {
178229
178288
  height: roundNormalized3(height)
178230
178289
  };
178231
178290
  }
178232
- function projectIosNode(node2, screenW, screenH) {
178291
+ function projectIosNode(node2, screenW, screenH, quotedLabel) {
178233
178292
  const skip = node2.hidden === true || node2.alpha !== void 0 && node2.alpha < 0.01;
178234
178293
  const role = roleFromClassName(node2.className);
178294
+ const held = role === IOS_TEXT_INPUT_ROLE && node2.value !== node2.label ? node2.value : void 0;
178295
+ const value = quotedLabel && held !== void 0 ? WITHHELD_INPUT_TEXT : held;
178296
+ const label = quotedLabel && node2.label !== void 0 ? quotedLabel(node2.label) : node2.label;
178235
178297
  const win = node2.screenFrame ?? node2.windowFrame;
178236
178298
  const rect = win ? { x: win.x, y: win.y, w: win.width, h: win.height } : null;
178237
178299
  let leaf = null;
@@ -178244,27 +178306,34 @@ function projectIosNode(node2, screenW, screenH) {
178244
178306
  role,
178245
178307
  frame: frame2,
178246
178308
  children: [],
178247
- label: node2.label,
178309
+ label,
178310
+ value,
178248
178311
  identifier: node2.identifier,
178249
178312
  focused: node2.firstResponder || void 0
178250
178313
  };
178251
178314
  }
178252
178315
  }
178316
+ const ownTextParts = frame2 ? [label, value].filter((text) => Boolean(text)) : [];
178253
178317
  return {
178254
178318
  skip,
178255
178319
  children: node2.children ?? [],
178256
178320
  // Text hoists only from on-screen nodes (frame is null when the view is
178257
178321
  // scrolled off or zero-area) — otherwise a text assert against an ancestor
178258
178322
  // would pass on content the screen doesn't show. A label makes a node
178259
- // leaf-eligible, so `frame` was computed for any node with text.
178260
- ownText: frame2 ? node2.label ?? "" : "",
178323
+ // leaf-eligible, and so does the text input role a value needs, so `frame`
178324
+ // was computed for any node with text. Mirrors what `nodeText` reads off
178325
+ // the leaf: the label plus a distinct value.
178326
+ ownText: ownTextParts.join(" "),
178327
+ // Apart as well: the view under an empty field that draws its placeholder
178328
+ // repeats the value and not the label, and a floating label the reverse.
178329
+ ownTextParts,
178261
178330
  leaf,
178262
178331
  shield: Boolean(node2.identifier),
178263
178332
  rect,
178264
178333
  scrolls: role === "AXScrollArea"
178265
178334
  };
178266
178335
  }
178267
- function adaptFullHierarchy(raw) {
178336
+ function adaptFullHierarchy(raw, quotedLabel) {
178268
178337
  const payload = typeof raw === "object" && raw !== null ? raw : {};
178269
178338
  const reportedScreen = typeof payload.screen === "object" && payload.screen !== null ? payload.screen : void 0;
178270
178339
  const windows = Array.isArray(payload.windows) ? payload.windows.map(asViewNode).filter((n) => n !== null) : [];
@@ -178286,7 +178355,7 @@ function adaptFullHierarchy(raw) {
178286
178355
  const children = [];
178287
178356
  if (screenW > 0 && screenH > 0) {
178288
178357
  for (const win of windows) {
178289
- flattenHoisting(win, (n) => projectIosNode(n, screenW, screenH), children);
178358
+ flattenHoisting(win, (n) => projectIosNode(n, screenW, screenH, quotedLabel), children);
178290
178359
  }
178291
178360
  }
178292
178361
  const tree = parseDescribeResult({
@@ -178307,6 +178376,9 @@ var FULL_HIERARCHY_FIELDS = [
178307
178376
  "className",
178308
178377
  "identifier",
178309
178378
  "label",
178379
+ // A text input's text; an injected framework that omits it leaves a filled
178380
+ // field reading as empty.
178381
+ "value",
178310
178382
  "frame",
178311
178383
  "windowFrame",
178312
178384
  "screenFrame",
@@ -178469,8 +178541,10 @@ async function queryFullHierarchyTree(registry2, device, target) {
178469
178541
  );
178470
178542
  }
178471
178543
  const { tree, screen, uiOrientation } = adaptFullHierarchy(rawResult);
178544
+ const quotableTree = secretTypedOn(device.id) ? adaptFullHierarchy(rawResult, (label) => redactTypedSecrets(device.id, label)).tree : void 0;
178472
178545
  return {
178473
178546
  tree,
178547
+ ...quotableTree ? { quotableTree } : {},
178474
178548
  source: "native-devtools",
178475
178549
  ...screen ? { screen } : {},
178476
178550
  ...uiOrientation ? { uiOrientation } : {}
@@ -179579,6 +179653,7 @@ async function runType(env, step) {
179579
179653
  async function waitForCondition(env, step, timeoutMs) {
179580
179654
  const deadline = Date.now() + timeoutMs;
179581
179655
  let lastMatches = [];
179656
+ let lastData;
179582
179657
  let fetchError;
179583
179658
  let everMatched = false;
179584
179659
  let lastTrustedReadAt;
@@ -179590,6 +179665,7 @@ async function waitForCondition(env, step, timeoutMs) {
179590
179665
  try {
179591
179666
  const data = await readFlowTree(env);
179592
179667
  lastMatches = flowFindAll(data.tree, step.selector, data.uiOrientation);
179668
+ lastData = data;
179593
179669
  fetchError = void 0;
179594
179670
  everMatched ||= lastMatches.length > 0;
179595
179671
  const blind = isBlindRead(data, everMatched, step.condition);
@@ -179657,7 +179733,10 @@ async function waitForCondition(env, step, timeoutMs) {
179657
179733
  // The read `lastMatches` came from is the last one that answered, and
179658
179734
  // only a read that answers writes the orientation.
179659
179735
  readingOrientation(env),
179660
- env.device.platform === "macos"
179736
+ env.device.platform === "macos",
179737
+ // The text of an element is the only part of a reason that comes off
179738
+ // the screen, where a field shows a typed secret.
179739
+ (node2, read) => lastData ? quotedText(lastData, env.device.id, node2, read) : read(node2)
179661
179740
  ) + blipNote
179662
179741
  };
179663
179742
  }
@@ -179877,7 +179956,7 @@ async function waitForIdle(env, step) {
179877
179956
  warning: `the screen never held still for ${MIN_STILL_INTERVALS} consecutive ${IDLE_POLL_MS}ms intervals${stableFor > 0 ? ` spanning ${stableFor}ms` : ""} within ${timeoutMs}ms, and was moving again on the last one, so this step went ahead without waiting it out. Either something on it never stops (a video, a looping animation, a carousel, live-updating text) or the screen never finished loading. Look at what is moving, and make sure the next action is gated on a stable element rather than on stillness.` + blipNote
179878
179957
  };
179879
179958
  }
179880
- function assertReason(condition, selector, expectedText, textMatch, matches2, orientation, macos) {
179959
+ function assertReason(condition, selector, expectedText, textMatch, matches2, orientation, macos, quoted) {
179881
179960
  const sel = describeSelector(selector);
179882
179961
  switch (condition) {
179883
179962
  case "exists":
@@ -179890,9 +179969,8 @@ function assertReason(condition, selector, expectedText, textMatch, matches2, or
179890
179969
  const first = textCheckTarget(matches2, orientation, macos);
179891
179970
  if (!first) return `no element matched selector ${sel}`;
179892
179971
  const wanted = describeTextExpectation(expectedText, textMatch, "infinitive");
179893
- const field = macFieldText(first, macos);
179894
- const shown = field ?? assertText(first);
179895
- const own2 = field ?? nodeText(first);
179972
+ const shown = quoted(first, (node2) => macFieldText(node2, macos) ?? assertText(node2));
179973
+ const own2 = quoted(first, (node2) => macFieldText(node2, macos) ?? nodeText(node2));
179896
179974
  const ownNote = own2 && own2 !== shown ? ` (own text "${own2}")` : "";
179897
179975
  return `element matched ${sel} but its text was "${shown}"${ownNote} (wanted to ${wanted})`;
179898
179976
  }
@@ -180718,6 +180796,9 @@ function innermostTreeReason(message) {
180718
180796
  const unwrapped = /helper is unavailable:\s*(.+)/s.exec(message)?.[1] ?? message;
180719
180797
  return unwrapped.replace(/^\[[^\]]+\]\s*/, "").trim();
180720
180798
  }
180799
+ function withoutTypedText(node2, { source }) {
180800
+ return source === "native-devtools" && node2.role === IOS_TEXT_INPUT_ROLE ? { ...node2, value: void 0 } : node2;
180801
+ }
180721
180802
  async function captureTapSelector(registry2, session, udid, point) {
180722
180803
  try {
180723
180804
  const device = resolveDevice(udid);
@@ -180730,7 +180811,7 @@ async function captureTapSelector(registry2, session, udid, point) {
180730
180811
  const { tree, uiOrientation } = data;
180731
180812
  const node2 = nodeAtPoint(tree, point);
180732
180813
  if (!node2) return { warning: "no element found under the tap; kept coordinates (brittle)" };
180733
- const selector = deriveSelector(node2);
180814
+ const selector = deriveSelector(withoutTypedText(node2, data));
180734
180815
  if (!selector)
180735
180816
  return { warning: "tapped element has no stable text/id; kept coordinates (brittle)" };
180736
180817
  const resolved = selectorToFrame(tree, selector, uiOrientation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.6",
3
+ "version": "0.34.1-next.7",
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",