@swmansion/argent 0.35.1-next.31 → 0.35.1-next.32

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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -38595,7 +38595,7 @@ function isCi(env = process.env) {
38595
38595
  var SESSION_ID2 = randomUUID5();
38596
38596
  function readCliVersion() {
38597
38597
  if (true) {
38598
- return "0.35.1-next.30";
38598
+ return "0.35.1-next.32";
38599
38599
  }
38600
38600
  return "0.0.0";
38601
38601
  }
@@ -17117,7 +17117,7 @@ function isCi(env = process.env) {
17117
17117
  var SESSION_ID = randomUUID4();
17118
17118
  function readCliVersion() {
17119
17119
  if (true) {
17120
- return "0.35.1-next.30";
17120
+ return "0.35.1-next.32";
17121
17121
  }
17122
17122
  return "0.0.0";
17123
17123
  }
@@ -38154,7 +38154,7 @@ async function startMcpServer(options) {
38154
38154
  const autoDescribeOn = autoDescribeEnabled();
38155
38155
  const whatsNewOn = whatsNewEnabled();
38156
38156
  const installedVersion = getInstalledVersion();
38157
- const highlightsVersion = true ? "0.35.1-next.30" : installedVersion;
38157
+ const highlightsVersion = true ? "0.35.1-next.32" : installedVersion;
38158
38158
  const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
38159
38159
  const trees = createTreeMemory();
38160
38160
  const screenshots = createScreenshotMemory();
@@ -51836,16 +51836,16 @@ var require_foldFlowLines = __commonJS({
51836
51836
  onFold();
51837
51837
  let res = text.slice(0, folds[0]);
51838
51838
  for (let i2 = 0; i2 < folds.length; ++i2) {
51839
- const fold2 = folds[i2];
51839
+ const fold3 = folds[i2];
51840
51840
  const end2 = folds[i2 + 1] || text.length;
51841
- if (fold2 === 0)
51841
+ if (fold3 === 0)
51842
51842
  res = `
51843
51843
  ${indent}${text.slice(0, end2)}`;
51844
51844
  else {
51845
- if (mode === FOLD_QUOTED && escapedFolds[fold2])
51846
- res += `${text[fold2]}\\`;
51845
+ if (mode === FOLD_QUOTED && escapedFolds[fold3])
51846
+ res += `${text[fold3]}\\`;
51847
51847
  res += `
51848
- ${indent}${text.slice(fold2 + 1, end2)}`;
51848
+ ${indent}${text.slice(fold3 + 1, end2)}`;
51849
51849
  }
51850
51850
  }
51851
51851
  return res;
@@ -55484,8 +55484,8 @@ var require_resolve_flow_scalar = __commonJS({
55484
55484
  if (ch === "\r" && source[i + 1] === "\n")
55485
55485
  continue;
55486
55486
  if (ch === "\n") {
55487
- const { fold: fold2, offset } = foldNewline(source, i);
55488
- res += fold2;
55487
+ const { fold: fold3, offset } = foldNewline(source, i);
55488
+ res += fold3;
55489
55489
  i = offset;
55490
55490
  } else if (ch === "\\") {
55491
55491
  let next = source[++i];
@@ -55525,19 +55525,19 @@ var require_resolve_flow_scalar = __commonJS({
55525
55525
  return res;
55526
55526
  }
55527
55527
  function foldNewline(source, offset) {
55528
- let fold2 = "";
55528
+ let fold3 = "";
55529
55529
  let ch = source[offset + 1];
55530
55530
  while (ch === " " || ch === " " || ch === "\n" || ch === "\r") {
55531
55531
  if (ch === "\r" && source[offset + 2] !== "\n")
55532
55532
  break;
55533
55533
  if (ch === "\n")
55534
- fold2 += "\n";
55534
+ fold3 += "\n";
55535
55535
  offset += 1;
55536
55536
  ch = source[offset + 1];
55537
55537
  }
55538
- if (!fold2)
55539
- fold2 = " ";
55540
- return { fold: fold2, offset };
55538
+ if (!fold3)
55539
+ fold3 = " ";
55540
+ return { fold: fold3, offset };
55541
55541
  }
55542
55542
  var escapeCodes = {
55543
55543
  "0": "\0",
@@ -72978,7 +72978,7 @@ function isCi(env = process.env) {
72978
72978
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
72979
72979
  function readCliVersion() {
72980
72980
  if (true) {
72981
- return "0.35.1-next.30";
72981
+ return "0.35.1-next.32";
72982
72982
  }
72983
72983
  return "0.0.0";
72984
72984
  }
@@ -79801,6 +79801,7 @@ function getCachedSimulatorRuntimeKind(udid) {
79801
79801
  }
79802
79802
  var deviceTypeFoldableCache = /* @__PURE__ */ new Map();
79803
79803
  var deviceTypeBundlePaths = null;
79804
+ var deviceTypeReread = null;
79804
79805
  var foldableCache = /* @__PURE__ */ new Map();
79805
79806
  async function listDeviceTypeBundlePaths() {
79806
79807
  try {
@@ -79823,11 +79824,17 @@ async function listDeviceTypeBundlePaths() {
79823
79824
  }
79824
79825
  async function deviceTypeBundlePath(identifier) {
79825
79826
  deviceTypeBundlePaths ??= listDeviceTypeBundlePaths();
79826
- let paths = await deviceTypeBundlePaths;
79827
+ const paths = await deviceTypeBundlePaths;
79827
79828
  if (paths.has(identifier)) return paths.get(identifier);
79828
- deviceTypeBundlePaths = listDeviceTypeBundlePaths();
79829
- paths = await deviceTypeBundlePaths;
79830
- return paths.get(identifier);
79829
+ if (!deviceTypeReread) {
79830
+ const reread = listDeviceTypeBundlePaths();
79831
+ deviceTypeReread = reread;
79832
+ deviceTypeBundlePaths = reread;
79833
+ void reread.finally(() => {
79834
+ if (deviceTypeReread === reread) deviceTypeReread = null;
79835
+ });
79836
+ }
79837
+ return (await deviceTypeReread).get(identifier);
79831
79838
  }
79832
79839
  async function countIntegratedDisplays(bundlePath) {
79833
79840
  const plist = path20.join(bundlePath, "Contents", "Resources", "capabilities.plist");
@@ -79845,14 +79852,22 @@ async function countIntegratedDisplays(bundlePath) {
79845
79852
  return 0;
79846
79853
  }
79847
79854
  }
79848
- async function isFoldableDeviceType(identifier) {
79849
- const cached3 = deviceTypeFoldableCache.get(identifier);
79850
- if (cached3 !== void 0) return cached3;
79851
- const bundlePath = await deviceTypeBundlePath(identifier);
79852
- const foldable = bundlePath ? await countIntegratedDisplays(bundlePath) > 1 : false;
79853
- deviceTypeFoldableCache.set(identifier, foldable);
79855
+ function isFoldableDeviceType(identifier) {
79856
+ let foldable = deviceTypeFoldableCache.get(identifier);
79857
+ if (!foldable) {
79858
+ foldable = deviceTypeBundlePath(identifier).then(
79859
+ async (bundlePath) => bundlePath ? await countIntegratedDisplays(bundlePath) > 1 : false
79860
+ );
79861
+ deviceTypeFoldableCache.set(identifier, foldable);
79862
+ }
79854
79863
  return foldable;
79855
79864
  }
79865
+ var KNOWN_FOLDABLE_DEVICE_TYPES = /* @__PURE__ */ new Set([
79866
+ "com.apple.CoreSimulator.SimDeviceType.iPhone-Duo"
79867
+ ]);
79868
+ async function isRemoteFoldableDeviceType(identifier) {
79869
+ return KNOWN_FOLDABLE_DEVICE_TYPES.has(identifier) || await isFoldableDeviceType(identifier);
79870
+ }
79856
79871
  async function isFoldableSimulator(udid) {
79857
79872
  const device = resolveDevice(udid);
79858
79873
  if (device.platform !== "ios" || device.kind !== "simulator") return false;
@@ -97901,6 +97916,7 @@ function installNodeWebTransport() {
97901
97916
  // ../tool-server/src/utils/sim-remote.ts
97902
97917
  var import_node_child_process14 = require("node:child_process");
97903
97918
  var import_node_util11 = require("node:util");
97919
+ init_zod();
97904
97920
  init_device_info();
97905
97921
  var execFileAsync10 = (0, import_node_util11.promisify)(import_node_child_process14.execFile);
97906
97922
  var SIM_REMOTE_TIMEOUT_MS = 3e4;
@@ -97913,7 +97929,8 @@ async function run(args, options) {
97913
97929
  timeout: options?.timeoutMs ?? SIM_REMOTE_TIMEOUT_MS,
97914
97930
  maxBuffer: 16 * 1024 * 1024,
97915
97931
  encoding: "utf8",
97916
- input: options?.stdin
97932
+ input: options?.stdin,
97933
+ signal: options?.signal
97917
97934
  });
97918
97935
  return { stdout: typeof stdout === "string" ? stdout : stdout.toString("utf8") };
97919
97936
  } catch (err) {
@@ -98070,6 +98087,28 @@ async function screenRecordFetch(udid, recording, outputFile) {
98070
98087
  { timeoutMs: RECORDING_DOWNLOAD_TIMEOUT_MS }
98071
98088
  );
98072
98089
  }
98090
+ var remoteFoldSchema = external_exports.object({
98091
+ /** The angle the hinge was moved to, in degrees. */
98092
+ hinge_angle: external_exports.number(),
98093
+ /** Screen id of the panel the device renders to; null when the runner could not tell. */
98094
+ live_screen: external_exports.number().nullable(),
98095
+ warning: external_exports.string().optional()
98096
+ });
98097
+ var FOLD_TIMEOUT_MS = 6e4;
98098
+ async function fold(udid, target, signal) {
98099
+ const args = ["fold", stripRemotePrefix(udid), target, "--json"];
98100
+ const { stdout } = await run(args, { timeoutMs: FOLD_TIMEOUT_MS, signal });
98101
+ try {
98102
+ return remoteFoldSchema.parse(JSON.parse(stdout));
98103
+ } catch (err) {
98104
+ throw new Error(
98105
+ `sim-remote fold printed something other than a fold: ${err.message}`,
98106
+ {
98107
+ cause: err
98108
+ }
98109
+ );
98110
+ }
98111
+ }
98073
98112
  async function moqInfo(udid) {
98074
98113
  const { stdout } = await run(["moq-info", stripRemotePrefix(udid)]);
98075
98114
  try {
@@ -106125,26 +106164,52 @@ function readinessRank(d) {
106125
106164
  if ("kind" in d && d.kind === "device") return d.state === "connected" ? 0 : 1;
106126
106165
  return d.state === "Booted" ? 0 : 1;
106127
106166
  }
106167
+ var REMOTE_FOLDABLE_LOOKUP_MS = 5e3;
106168
+ var REMOTE_LISTING_MARGIN_MS = 2e3;
106169
+ async function remoteFoldableTypes(deviceTypes, budgetMs) {
106170
+ const foldable = /* @__PURE__ */ new Set();
106171
+ const asked = [];
106172
+ for (const type of deviceTypes) {
106173
+ if (KNOWN_FOLDABLE_DEVICE_TYPES.has(type)) foldable.add(type);
106174
+ else asked.push(isFoldableDeviceType(type).then((is) => void (is && foldable.add(type))));
106175
+ }
106176
+ let timer;
106177
+ const gaveUp = new Promise((resolve24) => {
106178
+ timer = setTimeout(resolve24, budgetMs);
106179
+ });
106180
+ await Promise.race([Promise.allSettled(asked), gaveUp]);
106181
+ clearTimeout(timer);
106182
+ return new Set(foldable);
106183
+ }
106128
106184
  async function listRemoteIosSimulators() {
106129
106185
  try {
106186
+ const started = Date.now();
106130
106187
  const result = await simctlListDevices();
106131
- const out = [];
106132
- for (const [runtime, devices2] of Object.entries(result.devices)) {
106188
+ const listed = Object.entries(result.devices).flatMap(([runtime, devices2]) => {
106133
106189
  const runtimeKind = simulatorRuntimeKind(runtime);
106134
- if (!runtimeKind) continue;
106135
- for (const d of devices2) {
106136
- if (d.isAvailable === false) continue;
106137
- out.push({
106138
- platform: "ios-remote",
106139
- kind: "simulator",
106140
- udid: withRemotePrefix(d.udid),
106141
- name: d.name,
106142
- state: d.state,
106143
- runtime,
106144
- runtimeKind
106145
- });
106146
- }
106147
- }
106190
+ if (!runtimeKind) return [];
106191
+ return devices2.filter((d) => d.isAvailable !== false).map((d) => ({ runtime, runtimeKind, d }));
106192
+ });
106193
+ const mobileTypes = new Set(
106194
+ listed.flatMap(
106195
+ ({ runtimeKind, d }) => runtimeKind === "mobile" && d.deviceTypeIdentifier ? [d.deviceTypeIdentifier] : []
106196
+ )
106197
+ );
106198
+ const left = BRANCH_DEADLINE_MS - REMOTE_LISTING_MARGIN_MS - (Date.now() - started);
106199
+ const foldableTypes = await remoteFoldableTypes(
106200
+ mobileTypes,
106201
+ Math.max(0, Math.min(REMOTE_FOLDABLE_LOOKUP_MS, left))
106202
+ );
106203
+ const out = listed.map(({ runtime, runtimeKind, d }) => ({
106204
+ platform: "ios-remote",
106205
+ kind: "simulator",
106206
+ udid: withRemotePrefix(d.udid),
106207
+ name: d.name,
106208
+ state: d.state,
106209
+ runtime,
106210
+ runtimeKind,
106211
+ ...runtimeKind === "mobile" && foldableTypes.has(d.deviceTypeIdentifier ?? "") ? { foldable: true } : {}
106212
+ }));
106148
106213
  return { devices: out, cloud: "logged-in" };
106149
106214
  } catch (err) {
106150
106215
  if (simRemoteExecError(err).code === "ENOENT") {
@@ -127066,7 +127131,7 @@ function createInspector(serial, packageName, initialMetroPort) {
127066
127131
  if (!conn) return;
127067
127132
  if (msg.type === "CDP") {
127068
127133
  if (cdp.handleResponse(payload)) return;
127069
- if (typeof payload.method === "string") fold2(conn, payload.method, payload.params);
127134
+ if (typeof payload.method === "string") fold3(conn, payload.method, payload.params);
127070
127135
  return;
127071
127136
  }
127072
127137
  if (msg.type === "Status") onStatus(conn, payload);
@@ -127337,7 +127402,7 @@ function createInspector(serial, packageName, initialMetroPort) {
127337
127402
  }
127338
127403
  return foreground === appUser ? `the app restarted as pid ${next.pid}, and this tool-server did not attach capture to that process; call network-capture-start to attach it` : `Android user ${foreground} is in the foreground now, and its process of ${packageName} runs without capture; restart-app attaches capture to it, or call network-capture-start`;
127339
127404
  }
127340
- function fold2(conn, method, params) {
127405
+ function fold3(conn, method, params) {
127341
127406
  if (typeof params !== "object" || params === null) return;
127342
127407
  const p = params;
127343
127408
  const layerId = typeof p.requestId === "string" ? p.requestId : null;
@@ -142204,7 +142269,7 @@ async function readDeviceStates(serial) {
142204
142269
  return /* @__PURE__ */ new Map();
142205
142270
  }
142206
142271
  }
142207
- async function fold(serial, params, device, signal) {
142272
+ async function fold2(serial, params, device, signal) {
142208
142273
  signal?.throwIfAborted();
142209
142274
  const states = await readDeviceStates(serial);
142210
142275
  const byId = new Map([...states].map(([name, id]) => [id, name]));
@@ -142305,26 +142370,97 @@ var androidImpl8 = {
142305
142370
  "android_fold_not_emulator"
142306
142371
  );
142307
142372
  }
142308
- return withDeviceLock2(serial, () => fold(serial, params, device, signal));
142373
+ return withDeviceLock2(serial, () => fold2(serial, params, device, signal));
142309
142374
  }
142310
142375
  };
142311
142376
 
142312
- // ../tool-server/src/tools/fold/index.ts
142377
+ // ../tool-server/src/tools/fold/platforms/ios-remote.ts
142378
+ init_src2();
142379
+ init_device_info();
142313
142380
  var POSTURES2 = ["closed", "half-open", "open"];
142314
142381
  var POSTURE_ANGLE = { "closed": 0, "half-open": 120, "open": 180 };
142382
+ async function listedAsNotFoldable(udid, signal) {
142383
+ try {
142384
+ const bare = stripRemotePrefix(udid);
142385
+ const listed = Object.values((await simctlListDevices({ signal })).devices).flat().find((d) => d.udid === bare);
142386
+ const type = listed?.deviceTypeIdentifier;
142387
+ return type !== void 0 && !await isRemoteFoldableDeviceType(type);
142388
+ } catch {
142389
+ return false;
142390
+ }
142391
+ }
142392
+ async function foldFailure(err, udid, signal) {
142393
+ const message = err instanceof Error ? err.message : String(err);
142394
+ const cause = err instanceof Error ? { cause: err } : void 0;
142395
+ if (await listedAsNotFoldable(udid, signal)) {
142396
+ return new FailureError(
142397
+ message,
142398
+ {
142399
+ error_code: FAILURE_CODES.IOS_FOLD_UNSUPPORTED,
142400
+ failure_stage: "sim_remote_fold_not_foldable",
142401
+ failure_area: "tool_server",
142402
+ error_kind: "unsupported"
142403
+ },
142404
+ cause
142405
+ );
142406
+ }
142407
+ return new FailureError(
142408
+ message,
142409
+ {
142410
+ error_code: FAILURE_CODES.IOS_FOLD_FAILED,
142411
+ failure_stage: "sim_remote_fold",
142412
+ failure_area: "tool_server",
142413
+ error_kind: "subprocess",
142414
+ failure_command: "sim_remote"
142415
+ },
142416
+ cause
142417
+ );
142418
+ }
142419
+ var iosRemoteImpl7 = {
142420
+ requires: ["sim-remote"],
142421
+ async handler(_services, params, _device, ctx) {
142422
+ ctx?.signal?.throwIfAborted();
142423
+ const target = params.posture ?? String(params.angle);
142424
+ const folded = await fold(params.udid, target, ctx?.signal).catch(async (err) => {
142425
+ ctx?.signal?.throwIfAborted();
142426
+ const failure3 = await foldFailure(err, params.udid, ctx?.signal);
142427
+ ctx?.signal?.throwIfAborted();
142428
+ throw failure3;
142429
+ });
142430
+ const hingeAngle = folded.hinge_angle;
142431
+ const atStop2 = hingeAngle <= POSTURE_ANGLE.closed || hingeAngle >= POSTURE_ANGLE.open;
142432
+ await sleepOrAbort(atStop2 ? INPUT_READY_HOLD_MS : INPUT_READY_HOLD_MID_ANGLE_MS, ctx?.signal);
142433
+ ctx?.signal?.throwIfAborted();
142434
+ const activeScreen = folded.live_screen ?? MAIN_SCREEN_ID;
142435
+ const posture = params.posture ?? POSTURES2.find((p) => POSTURE_ANGLE[p] === hingeAngle);
142436
+ const warning = folded.warning ?? (folded.live_screen === null ? "The runner could not tell which panel the device renders to. argent takes it to be the cover panel; fold to closed or open to be sure." : void 0);
142437
+ return {
142438
+ activeScreen,
142439
+ screen: { id: activeScreen, panel: panelName(activeScreen) },
142440
+ ...posture ? { posture } : {},
142441
+ hingeAngle,
142442
+ ...warning ? { warning } : {}
142443
+ };
142444
+ }
142445
+ };
142446
+
142447
+ // ../tool-server/src/tools/fold/index.ts
142448
+ var POSTURES3 = ["closed", "half-open", "open"];
142449
+ var POSTURE_ANGLE2 = { "closed": 0, "half-open": 120, "open": 180 };
142315
142450
  var HINGE_REQUEST_TIMEOUT_MS = 3e4;
142316
142451
  var capability23 = {
142317
- // Local simulators only. A remote (MoQ) simulator is driven on its main
142318
- // screen and carries no hinge message; the server itself rejects a device
142319
- // that is not foldable, with its own reason.
142452
+ // The server itself rejects a device that is not foldable, with its own
142453
+ // reason.
142320
142454
  apple: { simulator: true },
142455
+ // Folded by the runner, through `sim-remote fold`.
142456
+ appleRemote: { simulator: true },
142321
142457
  // Emulators only: the hinge is moved through the emulator console. `unknown`
142322
142458
  // is let through and the handler rejects a serial with no console; it also
142323
142459
  // rejects a profile with no hinge, which the capability cannot see.
142324
142460
  android: { emulator: true, unknown: true }
142325
142461
  };
142326
142462
  function presetAtAngle(angle) {
142327
- return POSTURES2.find((p) => POSTURE_ANGLE[p] === angle);
142463
+ return POSTURES3.find((p) => POSTURE_ANGLE2[p] === angle);
142328
142464
  }
142329
142465
  function classifyHingeRefusal(err, known) {
142330
142466
  if (known?.foldable !== false) return err;
@@ -142350,19 +142486,19 @@ function targetLabel2(params) {
142350
142486
  return params.posture ?? `${params.angle}\xB0`;
142351
142487
  }
142352
142488
  function targetAngle(params) {
142353
- return params.angle ?? POSTURE_ANGLE[params.posture ?? "closed"];
142489
+ return params.angle ?? POSTURE_ANGLE2[params.posture ?? "closed"];
142354
142490
  }
142355
142491
  function atStop(angle) {
142356
- return angle <= POSTURE_ANGLE.closed || angle >= POSTURE_ANGLE.open;
142492
+ return angle <= POSTURE_ANGLE2.closed || angle >= POSTURE_ANGLE2.open;
142357
142493
  }
142358
142494
  function sweepStartFor(serverAngle, liveScreen, panels) {
142359
- const start2 = serverAngle ?? POSTURE_ANGLE.closed;
142495
+ const start2 = serverAngle ?? POSTURE_ANGLE2.closed;
142360
142496
  if (panelForHingeAngle(start2, panels) === liveScreen) return void 0;
142361
142497
  return liveScreen === MAIN_SCREEN_ID ? "closed" : "open";
142362
142498
  }
142363
142499
  function sweepStartAngle(start2, serverAngle) {
142364
- if (start2 !== void 0) return POSTURE_ANGLE[start2];
142365
- return serverAngle ?? POSTURE_ANGLE.closed;
142500
+ if (start2 !== void 0) return POSTURE_ANGLE2[start2];
142501
+ return serverAngle ?? POSTURE_ANGLE2.closed;
142366
142502
  }
142367
142503
  function screenResult(activeScreen, panels) {
142368
142504
  const panel = panels?.find((p) => p.screenId === activeScreen);
@@ -142435,7 +142571,7 @@ var zodSchema29 = external_exports.object({
142435
142571
  udid: external_exports.string().describe(
142436
142572
  "Foldable device id from `list-devices` (iOS simulator UDID or Android emulator serial)."
142437
142573
  ),
142438
- posture: external_exports.enum(POSTURES2).optional().describe("Target posture: `closed` (cover panel), `half-open`, or `open` (inner panel)."),
142574
+ posture: external_exports.enum(POSTURES3).optional().describe("Target posture: `closed` (cover panel), `half-open`, or `open` (inner panel)."),
142439
142575
  angle: external_exports.number().min(0).max(180).optional().describe("Hinge angle in degrees (0 = closed, 180 = open).")
142440
142576
  }).refine((p) => p.posture === void 0 !== (p.angle === void 0), {
142441
142577
  message: "Pass exactly one of `posture` and `angle`."
@@ -142444,8 +142580,8 @@ var foldTool = {
142444
142580
  id: "fold",
142445
142581
  description: `Move a foldable iOS simulator or Android emulator hinge to a \`posture\` or \`angle\` (pass exactly one) and wait until input is ready.
142446
142582
  Use when testing an app across folded/unfolded postures (\`list-devices\` marks \`foldable: true\`; use \`rotate\` for orientation). Coordinates change with the active panel, so read the returned tree or call \`describe\` before tapping.
142447
- iOS: fold to \`closed\`/\`open\` to guarantee a panel switch; returns \`{ activeScreen, screen, posture?, hingeAngle, warning? }\`. Android: returns \`{ posture?, deviceState, hingeAngle?, warning? }\` (use Pixel Fold AVD for accurate cover-panel coords).
142448
- Fails if the device is not foldable, is a remote simulator, or is a physical Android device.`,
142583
+ iOS: fold to \`closed\`/\`open\` to guarantee a panel switch; returns \`{ activeScreen, screen, posture?, hingeAngle, warning? }\`. A remote iOS simulator returns it without the panel size. Android: returns \`{ posture?, deviceState, hingeAngle?, warning? }\` (use Pixel Fold AVD for accurate cover-panel coords).
142584
+ Fails if the device is not foldable or is a physical Android device.`,
142449
142585
  zodSchema: zodSchema29,
142450
142586
  searchHint: "fold unfold hinge foldable duo posture open closed half-open panel screen split view",
142451
142587
  interaction: {
@@ -142453,17 +142589,23 @@ Fails if the device is not foldable, is a remote simulator, or is a physical And
142453
142589
  completedMsg: ({ params, result }) => "activeScreen" in result ? `Folded device to ${targetLabel2(params)}; it renders to screen ${result.activeScreen} (${result.screen.panel})` : `Folded device to ${targetLabel2(params)}; it is in device state ${result.deviceState}`,
142454
142590
  failedMsg: ({ params, failureSignal: failureSignal2 }) => `Failed to fold device to ${targetLabel2(params)}: ${failureSignal2.error_code}`
142455
142591
  },
142592
+ // A fold can outlast the MCP adapter's per-attempt timeout, which would
142593
+ // send it again while the first is still moving the hinge. Every wait in
142594
+ // it has a bound of its own.
142595
+ longRunning: true,
142456
142596
  capability: capability23,
142457
- // The Android hinge is moved through `adb`, so no simulator-server is
142458
- // spawned for it; the server follows the new panel on its own.
142597
+ // The Android hinge is moved through `adb` and a remote one by its runner,
142598
+ // so no simulator-server is spawned for either; the server follows the new
142599
+ // panel on its own.
142459
142600
  services: (params) => {
142460
142601
  const device = resolveDevice(params.udid);
142461
- return device.platform === "android" ? {} : { simulatorServer: simulatorServerRef(device) };
142602
+ return device.platform === "ios" ? { simulatorServer: simulatorServerRef(device) } : {};
142462
142603
  },
142463
142604
  execute: dispatchByPlatform({
142464
142605
  toolId: "fold",
142465
142606
  capability: capability23,
142466
142607
  ios: iosImpl6,
142608
+ iosRemote: iosRemoteImpl7,
142467
142609
  android: androidImpl8
142468
142610
  })
142469
142611
  };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.35.1-next.31",
3
+ "version": "0.35.1-next.32",
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": "c6cd14078b30ddf98be3cb622174d4b030bd0fb9"
101
+ "gitHead": "4a8a259f63adb69c4463fe78f962cdd660d3c31b"
102
102
  }