@swmansion/argent 0.31.1-next.15 → 0.31.1-next.17

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
@@ -35740,7 +35740,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35740
35740
  var SESSION_ID2 = randomUUID5();
35741
35741
  function readCliVersion() {
35742
35742
  if (true) {
35743
- return "0.31.1-next.15";
35743
+ return "0.31.1-next.17";
35744
35744
  }
35745
35745
  return "0.0.0";
35746
35746
  }
@@ -16915,7 +16915,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16915
16915
  var SESSION_ID = randomUUID4();
16916
16916
  function readCliVersion() {
16917
16917
  if (true) {
16918
- return "0.31.1-next.15";
16918
+ return "0.31.1-next.17";
16919
16919
  }
16920
16920
  return "0.0.0";
16921
16921
  }
@@ -83951,8 +83951,8 @@ async function resolveRuntimeKindCached(serial, avdName) {
83951
83951
  androidRuntimeKindCache.set(serial, { avdName, kind });
83952
83952
  return kind;
83953
83953
  }
83954
- async function getAndroidRuntimeKind(serial) {
83955
- const serials = await listAndroidSerials();
83954
+ async function getAndroidRuntimeKind(serial, options = {}) {
83955
+ const serials = await listAndroidSerials(options);
83956
83956
  const ready2 = serials.find((d) => d.serial === serial && d.state === "device");
83957
83957
  if (!ready2) {
83958
83958
  androidRuntimeKindCache.delete(serial);
@@ -83961,8 +83961,8 @@ async function getAndroidRuntimeKind(serial) {
83961
83961
  const avdName = serial.startsWith("emulator-") ? await readAvdName(serial) : null;
83962
83962
  return resolveRuntimeKindCached(serial, avdName);
83963
83963
  }
83964
- async function isAndroidTv(serial) {
83965
- return await getAndroidRuntimeKind(serial) === "tv";
83964
+ async function isAndroidTv(serial, options = {}) {
83965
+ return await getAndroidRuntimeKind(serial, options) === "tv";
83966
83966
  }
83967
83967
  function getCachedAndroidRuntimeKind(serial) {
83968
83968
  return androidRuntimeKindCache.get(serial)?.kind;
@@ -101024,7 +101024,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101024
101024
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101025
101025
  function readCliVersion() {
101026
101026
  if (true) {
101027
- return "0.31.1-next.15";
101027
+ return "0.31.1-next.17";
101028
101028
  }
101029
101029
  return "0.0.0";
101030
101030
  }
@@ -142684,13 +142684,21 @@ function trainPaths(events, viewport) {
142684
142684
  if (index > 0) {
142685
142685
  tMs += event2.delayMs ?? FRAME_MS;
142686
142686
  }
142687
- first.points.push({ ...toPoints(viewport, event2.x, event2.y), tMs });
142687
+ stepTo(first, toPoints(viewport, event2.x, event2.y), tMs);
142688
142688
  if (event2.x2 !== void 0 && event2.y2 !== void 0) {
142689
- second.points.push({ ...toPoints(viewport, event2.x2, event2.y2), tMs });
142689
+ stepTo(second, toPoints(viewport, event2.x2, event2.y2), tMs);
142690
142690
  }
142691
142691
  });
142692
142692
  return second.points.length > 0 ? [first, second] : [first];
142693
142693
  }
142694
+ var STEP_MS = 1;
142695
+ function stepTo(finger, point, tMs) {
142696
+ const last = finger.points[finger.points.length - 1];
142697
+ if (last && tMs - last.tMs > STEP_MS && (last.x !== point.x || last.y !== point.y)) {
142698
+ finger.points.push({ x: last.x, y: last.y, tMs: tMs - STEP_MS });
142699
+ }
142700
+ finger.points.push({ ...point, tMs });
142701
+ }
142694
142702
 
142695
142703
  // ../tool-server/src/tools/gesture-custom/index.ts
142696
142704
  init_device_info();
@@ -144277,6 +144285,8 @@ Supports \`{{secret:<NAME>}}\` placeholders like \`keyboard\`; the value is neve
144277
144285
  // ../tool-server/src/tools/rotate/index.ts
144278
144286
  init_zod();
144279
144287
  init_device_info();
144288
+ init_adb();
144289
+ init_capability();
144280
144290
  var zodSchema26 = external_exports.object({
144281
144291
  udid: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
144282
144292
  orientation: external_exports.enum(["Portrait", "LandscapeLeft", "LandscapeRight", "PortraitUpsideDown"]).describe("Target orientation")
@@ -144286,28 +144296,37 @@ var capability19 = {
144286
144296
  appleRemote: { simulator: true },
144287
144297
  android: { emulator: true, device: true, unknown: true }
144288
144298
  };
144289
- var rotateTool = {
144290
- id: "rotate",
144291
- interaction: {
144292
- startedMsg: ({ params }) => `Rotating device to ${params.orientation}`,
144293
- completedMsg: ({ params }) => `Rotated device to ${params.orientation}`,
144294
- failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to rotate device: ${failureSignal2.error_code}`
144295
- },
144296
- description: `Set the device orientation to Portrait, LandscapeLeft, LandscapeRight, or PortraitUpsideDown.
144299
+ async function isAndroidTvForRotate(serial) {
144300
+ return isAndroidTv(serial, { devicesTimeoutMs: ADB_DEVICES_TIMEOUT_MS }).catch(() => false);
144301
+ }
144302
+ function createRotateTool(registry2) {
144303
+ return {
144304
+ id: "rotate",
144305
+ interaction: {
144306
+ startedMsg: ({ params }) => `Rotating device to ${params.orientation}`,
144307
+ completedMsg: ({ params }) => `Rotated device to ${params.orientation}`,
144308
+ failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to rotate device: ${failureSignal2.error_code}`
144309
+ },
144310
+ description: `Set the device orientation to Portrait, LandscapeLeft, LandscapeRight, or PortraitUpsideDown.
144297
144311
  Use to test layout in a different orientation. Re-run \`describe\` afterwards: frame coordinates change with the orientation.
144298
144312
  On an unfolded foldable iOS simulator (the iPhone Duo), the value sets the orientation of the device, not of the UI: \`Portrait\` gives a landscape UI and \`LandscapeLeft\` gives a portrait UI. To fold or unfold the device, use \`fold\`.
144299
- Returns { orientation }. Fails if the target device is not booted.`,
144300
- zodSchema: zodSchema26,
144301
- capability: capability19,
144302
- services: (params) => ({
144303
- simulatorServer: simulatorServerRef(resolveDevice(params.udid))
144304
- }),
144305
- async execute(services, params) {
144306
- const api = services.simulatorServer;
144307
- await sendCommand(api, { cmd: "rotate", direction: params.orientation });
144308
- return { orientation: params.orientation };
144309
- }
144310
- };
144313
+ Returns { orientation }. Fails on a TV target, or if the target device is not booted.`,
144314
+ zodSchema: zodSchema26,
144315
+ capability: capability19,
144316
+ // The simulator-server is resolved in execute, after the Android TV check, so a
144317
+ // TV is refused without first starting one.
144318
+ services: () => ({}),
144319
+ async execute(_services, params) {
144320
+ const device = resolveDevice(params.udid);
144321
+ if (device.platform === "android" && await isAndroidTvForRotate(device.id))
144322
+ throw new UnsupportedOperationError("rotate", device, "Android TV has a fixed orientation");
144323
+ const ref = simulatorServerRef(device);
144324
+ const api = await registry2.resolveService(ref.urn, ref.options);
144325
+ await sendCommand(api, { cmd: "rotate", direction: params.orientation });
144326
+ return { orientation: params.orientation };
144327
+ }
144328
+ };
144329
+ }
144311
144330
 
144312
144331
  // ../tool-server/src/tools/shake/schema.ts
144313
144332
  init_zod();
@@ -178803,7 +178822,7 @@ function createRegistry() {
178803
178822
  registry2.registerTool(buttonTool);
178804
178823
  registry2.registerTool(createKeyboardTool(registry2));
178805
178824
  registry2.registerTool(createPasteTool(registry2));
178806
- registry2.registerTool(rotateTool);
178825
+ registry2.registerTool(createRotateTool(registry2));
178807
178826
  registry2.registerTool(shakeTool);
178808
178827
  registry2.registerTool(foldTool);
178809
178828
  registry2.registerTool(createTvRemoteTool(registry2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.31.1-next.15",
3
+ "version": "0.31.1-next.17",
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",