@midscene/ios 1.4.1 → 1.4.2

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/es/bin.mjs CHANGED
@@ -197,6 +197,9 @@ const defaultAppNameMapping = {
197
197
  'Keynote 讲演': 'com.apple.Keynote'
198
198
  };
199
199
  const debugIOS = getDebug('webdriver:ios');
200
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
201
+ const WDA_MJPEG_FRAMERATE = 30;
202
+ const WDA_MJPEG_SCALING_FACTOR = 50;
200
203
  class IOSWebDriverClient extends WebDriverClient {
201
204
  async launchApp(bundleId) {
202
205
  this.ensureSession();
@@ -545,9 +548,12 @@ class IOSWebDriverClient extends WebDriverClient {
545
548
  try {
546
549
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
547
550
  snapshotMaxDepth: 50,
548
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
551
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
552
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
553
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
554
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
549
555
  });
550
- debugIOS('iOS session configuration applied');
556
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
551
557
  } catch (error) {
552
558
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
553
559
  }
@@ -573,6 +579,7 @@ const WDA_HTTP_METHODS = [
573
579
  'DELETE',
574
580
  'PUT'
575
581
  ];
582
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
576
583
  class device_IOSDevice {
577
584
  actionSpace() {
578
585
  const defaultActions = [
@@ -1108,6 +1115,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1108
1115
  _define_property(this, "customActions", void 0);
1109
1116
  _define_property(this, "wdaBackend", void 0);
1110
1117
  _define_property(this, "wdaManager", void 0);
1118
+ _define_property(this, "mjpegStreamUrl", void 0);
1111
1119
  _define_property(this, "appNameMapping", {});
1112
1120
  _define_property(this, "interfaceType", 'ios');
1113
1121
  _define_property(this, "uri", void 0);
@@ -1117,11 +1125,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1117
1125
  this.customActions = options?.customActions;
1118
1126
  const wdaPort = options?.wdaPort || DEFAULT_WDA_PORT;
1119
1127
  const wdaHost = options?.wdaHost || 'localhost';
1128
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1120
1129
  this.wdaBackend = new IOSWebDriverClient({
1121
1130
  port: wdaPort,
1122
1131
  host: wdaHost
1123
1132
  });
1124
1133
  this.wdaManager = WDAManager.getInstance(wdaPort, wdaHost);
1134
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1125
1135
  }
1126
1136
  }
1127
1137
  const runWdaRequestParamSchema = z.object({
package/dist/es/cli.mjs CHANGED
@@ -195,6 +195,9 @@ const defaultAppNameMapping = {
195
195
  'Keynote 讲演': 'com.apple.Keynote'
196
196
  };
197
197
  const debugIOS = getDebug('webdriver:ios');
198
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
199
+ const WDA_MJPEG_FRAMERATE = 30;
200
+ const WDA_MJPEG_SCALING_FACTOR = 50;
198
201
  class IOSWebDriverClient extends WebDriverClient {
199
202
  async launchApp(bundleId) {
200
203
  this.ensureSession();
@@ -543,9 +546,12 @@ class IOSWebDriverClient extends WebDriverClient {
543
546
  try {
544
547
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
545
548
  snapshotMaxDepth: 50,
546
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
549
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
550
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
551
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
552
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
547
553
  });
548
- debugIOS('iOS session configuration applied');
554
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
549
555
  } catch (error) {
550
556
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
551
557
  }
@@ -571,6 +577,7 @@ const WDA_HTTP_METHODS = [
571
577
  'DELETE',
572
578
  'PUT'
573
579
  ];
580
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
574
581
  class IOSDevice {
575
582
  actionSpace() {
576
583
  const defaultActions = [
@@ -1106,6 +1113,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1106
1113
  _define_property(this, "customActions", void 0);
1107
1114
  _define_property(this, "wdaBackend", void 0);
1108
1115
  _define_property(this, "wdaManager", void 0);
1116
+ _define_property(this, "mjpegStreamUrl", void 0);
1109
1117
  _define_property(this, "appNameMapping", {});
1110
1118
  _define_property(this, "interfaceType", 'ios');
1111
1119
  _define_property(this, "uri", void 0);
@@ -1115,11 +1123,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1115
1123
  this.customActions = options?.customActions;
1116
1124
  const wdaPort = options?.wdaPort || DEFAULT_WDA_PORT;
1117
1125
  const wdaHost = options?.wdaHost || 'localhost';
1126
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1118
1127
  this.wdaBackend = new IOSWebDriverClient({
1119
1128
  port: wdaPort,
1120
1129
  host: wdaHost
1121
1130
  });
1122
1131
  this.wdaManager = WDAManager.getInstance(wdaPort, wdaHost);
1132
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1123
1133
  }
1124
1134
  }
1125
1135
  const runWdaRequestParamSchema = z.object({
package/dist/es/index.mjs CHANGED
@@ -13,6 +13,9 @@ import { exec } from "node:child_process";
13
13
  import { platform } from "node:os";
14
14
  import { promisify } from "node:util";
15
15
  const debugIOS = getDebug('webdriver:ios');
16
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
17
+ const WDA_MJPEG_FRAMERATE = 30;
18
+ const WDA_MJPEG_SCALING_FACTOR = 50;
16
19
  class IOSWebDriverClient extends WebDriverClient {
17
20
  async launchApp(bundleId) {
18
21
  this.ensureSession();
@@ -361,9 +364,12 @@ class IOSWebDriverClient extends WebDriverClient {
361
364
  try {
362
365
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
363
366
  snapshotMaxDepth: 50,
364
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
367
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
368
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
369
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
370
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
365
371
  });
366
- debugIOS('iOS session configuration applied');
372
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
367
373
  } catch (error) {
368
374
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
369
375
  }
@@ -389,6 +395,7 @@ const WDA_HTTP_METHODS = [
389
395
  'DELETE',
390
396
  'PUT'
391
397
  ];
398
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
392
399
  class IOSDevice {
393
400
  actionSpace() {
394
401
  const defaultActions = [
@@ -924,6 +931,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
924
931
  _define_property(this, "customActions", void 0);
925
932
  _define_property(this, "wdaBackend", void 0);
926
933
  _define_property(this, "wdaManager", void 0);
934
+ _define_property(this, "mjpegStreamUrl", void 0);
927
935
  _define_property(this, "appNameMapping", {});
928
936
  _define_property(this, "interfaceType", 'ios');
929
937
  _define_property(this, "uri", void 0);
@@ -933,11 +941,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
933
941
  this.customActions = options?.customActions;
934
942
  const wdaPort = options?.wdaPort || DEFAULT_WDA_PORT;
935
943
  const wdaHost = options?.wdaHost || 'localhost';
944
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
936
945
  this.wdaBackend = new IOSWebDriverClient({
937
946
  port: wdaPort,
938
947
  host: wdaHost
939
948
  });
940
949
  this.wdaManager = WDAManager.getInstance(wdaPort, wdaHost);
950
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
941
951
  }
942
952
  }
943
953
  const runWdaRequestParamSchema = z.object({
@@ -194,6 +194,9 @@ const defaultAppNameMapping = {
194
194
  'Keynote 讲演': 'com.apple.Keynote'
195
195
  };
196
196
  const debugIOS = getDebug('webdriver:ios');
197
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
198
+ const WDA_MJPEG_FRAMERATE = 30;
199
+ const WDA_MJPEG_SCALING_FACTOR = 50;
197
200
  class IOSWebDriverClient extends WebDriverClient {
198
201
  async launchApp(bundleId) {
199
202
  this.ensureSession();
@@ -542,9 +545,12 @@ class IOSWebDriverClient extends WebDriverClient {
542
545
  try {
543
546
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
544
547
  snapshotMaxDepth: 50,
545
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
548
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
549
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
550
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
551
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
546
552
  });
547
- debugIOS('iOS session configuration applied');
553
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
548
554
  } catch (error) {
549
555
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
550
556
  }
@@ -570,6 +576,7 @@ const WDA_HTTP_METHODS = [
570
576
  'DELETE',
571
577
  'PUT'
572
578
  ];
579
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
573
580
  class IOSDevice {
574
581
  actionSpace() {
575
582
  const defaultActions = [
@@ -1105,6 +1112,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1105
1112
  _define_property(this, "customActions", void 0);
1106
1113
  _define_property(this, "wdaBackend", void 0);
1107
1114
  _define_property(this, "wdaManager", void 0);
1115
+ _define_property(this, "mjpegStreamUrl", void 0);
1108
1116
  _define_property(this, "appNameMapping", {});
1109
1117
  _define_property(this, "interfaceType", 'ios');
1110
1118
  _define_property(this, "uri", void 0);
@@ -1114,11 +1122,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1114
1122
  this.customActions = options?.customActions;
1115
1123
  const wdaPort = options?.wdaPort || DEFAULT_WDA_PORT;
1116
1124
  const wdaHost = options?.wdaHost || 'localhost';
1125
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1117
1126
  this.wdaBackend = new IOSWebDriverClient({
1118
1127
  port: wdaPort,
1119
1128
  host: wdaHost
1120
1129
  });
1121
1130
  this.wdaManager = WDAManager.getInstance(wdaPort, wdaHost);
1131
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1122
1132
  }
1123
1133
  }
1124
1134
  const runWdaRequestParamSchema = z.object({
@@ -1241,7 +1251,7 @@ class IOSMCPServer extends BaseMCPServer {
1241
1251
  constructor(toolsManager){
1242
1252
  super({
1243
1253
  name: '@midscene/ios-mcp',
1244
- version: "1.4.1",
1254
+ version: "1.4.2",
1245
1255
  description: 'Control the iOS device using natural language commands'
1246
1256
  }, toolsManager);
1247
1257
  }
package/dist/lib/bin.js CHANGED
@@ -222,6 +222,9 @@ const core_utils_namespaceObject = require("@midscene/core/utils");
222
222
  const img_namespaceObject = require("@midscene/shared/img");
223
223
  const webdriver_namespaceObject = require("@midscene/webdriver");
224
224
  const debugIOS = (0, logger_namespaceObject.getDebug)('webdriver:ios');
225
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
226
+ const WDA_MJPEG_FRAMERATE = 30;
227
+ const WDA_MJPEG_SCALING_FACTOR = 50;
225
228
  class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
226
229
  async launchApp(bundleId) {
227
230
  this.ensureSession();
@@ -570,9 +573,12 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
570
573
  try {
571
574
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
572
575
  snapshotMaxDepth: 50,
573
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
576
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
577
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
578
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
579
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
574
580
  });
575
- debugIOS('iOS session configuration applied');
581
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
576
582
  } catch (error) {
577
583
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
578
584
  }
@@ -598,6 +604,7 @@ const WDA_HTTP_METHODS = [
598
604
  'DELETE',
599
605
  'PUT'
600
606
  ];
607
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
601
608
  class device_IOSDevice {
602
609
  actionSpace() {
603
610
  const defaultActions = [
@@ -1133,6 +1140,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1133
1140
  _define_property(this, "customActions", void 0);
1134
1141
  _define_property(this, "wdaBackend", void 0);
1135
1142
  _define_property(this, "wdaManager", void 0);
1143
+ _define_property(this, "mjpegStreamUrl", void 0);
1136
1144
  _define_property(this, "appNameMapping", {});
1137
1145
  _define_property(this, "interfaceType", 'ios');
1138
1146
  _define_property(this, "uri", void 0);
@@ -1142,11 +1150,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1142
1150
  this.customActions = options?.customActions;
1143
1151
  const wdaPort = options?.wdaPort || constants_namespaceObject.DEFAULT_WDA_PORT;
1144
1152
  const wdaHost = options?.wdaHost || 'localhost';
1153
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1145
1154
  this.wdaBackend = new IOSWebDriverClient({
1146
1155
  port: wdaPort,
1147
1156
  host: wdaHost
1148
1157
  });
1149
1158
  this.wdaManager = webdriver_namespaceObject.WDAManager.getInstance(wdaPort, wdaHost);
1159
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1150
1160
  }
1151
1161
  }
1152
1162
  const runWdaRequestParamSchema = core_namespaceObject.z.object({
package/dist/lib/cli.js CHANGED
@@ -219,6 +219,9 @@ const constants_namespaceObject = require("@midscene/shared/constants");
219
219
  const img_namespaceObject = require("@midscene/shared/img");
220
220
  const webdriver_namespaceObject = require("@midscene/webdriver");
221
221
  const debugIOS = (0, logger_namespaceObject.getDebug)('webdriver:ios');
222
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
223
+ const WDA_MJPEG_FRAMERATE = 30;
224
+ const WDA_MJPEG_SCALING_FACTOR = 50;
222
225
  class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
223
226
  async launchApp(bundleId) {
224
227
  this.ensureSession();
@@ -567,9 +570,12 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
567
570
  try {
568
571
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
569
572
  snapshotMaxDepth: 50,
570
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
573
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
574
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
575
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
576
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
571
577
  });
572
- debugIOS('iOS session configuration applied');
578
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
573
579
  } catch (error) {
574
580
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
575
581
  }
@@ -595,6 +601,7 @@ const WDA_HTTP_METHODS = [
595
601
  'DELETE',
596
602
  'PUT'
597
603
  ];
604
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
598
605
  class IOSDevice {
599
606
  actionSpace() {
600
607
  const defaultActions = [
@@ -1130,6 +1137,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1130
1137
  _define_property(this, "customActions", void 0);
1131
1138
  _define_property(this, "wdaBackend", void 0);
1132
1139
  _define_property(this, "wdaManager", void 0);
1140
+ _define_property(this, "mjpegStreamUrl", void 0);
1133
1141
  _define_property(this, "appNameMapping", {});
1134
1142
  _define_property(this, "interfaceType", 'ios');
1135
1143
  _define_property(this, "uri", void 0);
@@ -1139,11 +1147,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1139
1147
  this.customActions = options?.customActions;
1140
1148
  const wdaPort = options?.wdaPort || constants_namespaceObject.DEFAULT_WDA_PORT;
1141
1149
  const wdaHost = options?.wdaHost || 'localhost';
1150
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1142
1151
  this.wdaBackend = new IOSWebDriverClient({
1143
1152
  port: wdaPort,
1144
1153
  host: wdaHost
1145
1154
  });
1146
1155
  this.wdaManager = webdriver_namespaceObject.WDAManager.getInstance(wdaPort, wdaHost);
1156
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1147
1157
  }
1148
1158
  }
1149
1159
  const runWdaRequestParamSchema = core_namespaceObject.z.object({
package/dist/lib/index.js CHANGED
@@ -51,6 +51,9 @@ const logger_namespaceObject = require("@midscene/shared/logger");
51
51
  const shared_utils_namespaceObject = require("@midscene/shared/utils");
52
52
  const webdriver_namespaceObject = require("@midscene/webdriver");
53
53
  const debugIOS = (0, logger_namespaceObject.getDebug)('webdriver:ios');
54
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
55
+ const WDA_MJPEG_FRAMERATE = 30;
56
+ const WDA_MJPEG_SCALING_FACTOR = 50;
54
57
  class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
55
58
  async launchApp(bundleId) {
56
59
  this.ensureSession();
@@ -399,9 +402,12 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
399
402
  try {
400
403
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
401
404
  snapshotMaxDepth: 50,
402
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
405
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
406
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
407
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
408
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
403
409
  });
404
- debugIOS('iOS session configuration applied');
410
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
405
411
  } catch (error) {
406
412
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
407
413
  }
@@ -427,6 +433,7 @@ const WDA_HTTP_METHODS = [
427
433
  'DELETE',
428
434
  'PUT'
429
435
  ];
436
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
430
437
  class IOSDevice {
431
438
  actionSpace() {
432
439
  const defaultActions = [
@@ -962,6 +969,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
962
969
  _define_property(this, "customActions", void 0);
963
970
  _define_property(this, "wdaBackend", void 0);
964
971
  _define_property(this, "wdaManager", void 0);
972
+ _define_property(this, "mjpegStreamUrl", void 0);
965
973
  _define_property(this, "appNameMapping", {});
966
974
  _define_property(this, "interfaceType", 'ios');
967
975
  _define_property(this, "uri", void 0);
@@ -971,11 +979,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
971
979
  this.customActions = options?.customActions;
972
980
  const wdaPort = options?.wdaPort || constants_namespaceObject.DEFAULT_WDA_PORT;
973
981
  const wdaHost = options?.wdaHost || 'localhost';
982
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
974
983
  this.wdaBackend = new IOSWebDriverClient({
975
984
  port: wdaPort,
976
985
  host: wdaHost
977
986
  });
978
987
  this.wdaManager = webdriver_namespaceObject.WDAManager.getInstance(wdaPort, wdaHost);
988
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
979
989
  }
980
990
  }
981
991
  const runWdaRequestParamSchema = core_namespaceObject.z.object({
@@ -234,6 +234,9 @@ const constants_namespaceObject = require("@midscene/shared/constants");
234
234
  const img_namespaceObject = require("@midscene/shared/img");
235
235
  const webdriver_namespaceObject = require("@midscene/webdriver");
236
236
  const debugIOS = (0, logger_namespaceObject.getDebug)('webdriver:ios');
237
+ const WDA_MJPEG_SCREENSHOT_QUALITY = 50;
238
+ const WDA_MJPEG_FRAMERATE = 30;
239
+ const WDA_MJPEG_SCALING_FACTOR = 50;
237
240
  class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
238
241
  async launchApp(bundleId) {
239
242
  this.ensureSession();
@@ -582,9 +585,12 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
582
585
  try {
583
586
  await this.makeRequest('POST', `/session/${this.sessionId}/appium/settings`, {
584
587
  snapshotMaxDepth: 50,
585
- elementResponseAttributes: 'type,label,name,value,rect,enabled,visible'
588
+ elementResponseAttributes: 'type,label,name,value,rect,enabled,visible',
589
+ mjpegServerScreenshotQuality: WDA_MJPEG_SCREENSHOT_QUALITY,
590
+ mjpegServerFramerate: WDA_MJPEG_FRAMERATE,
591
+ mjpegScalingFactor: WDA_MJPEG_SCALING_FACTOR
586
592
  });
587
- debugIOS('iOS session configuration applied');
593
+ debugIOS('iOS session configuration applied (including MJPEG settings)');
588
594
  } catch (error) {
589
595
  debugIOS(`Failed to apply iOS session configuration: ${error}`);
590
596
  }
@@ -610,6 +616,7 @@ const WDA_HTTP_METHODS = [
610
616
  'DELETE',
611
617
  'PUT'
612
618
  ];
619
+ const DEFAULT_WDA_MJPEG_PORT = 9100;
613
620
  class IOSDevice {
614
621
  actionSpace() {
615
622
  const defaultActions = [
@@ -1145,6 +1152,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1145
1152
  _define_property(this, "customActions", void 0);
1146
1153
  _define_property(this, "wdaBackend", void 0);
1147
1154
  _define_property(this, "wdaManager", void 0);
1155
+ _define_property(this, "mjpegStreamUrl", void 0);
1148
1156
  _define_property(this, "appNameMapping", {});
1149
1157
  _define_property(this, "interfaceType", 'ios');
1150
1158
  _define_property(this, "uri", void 0);
@@ -1154,11 +1162,13 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
1154
1162
  this.customActions = options?.customActions;
1155
1163
  const wdaPort = options?.wdaPort || constants_namespaceObject.DEFAULT_WDA_PORT;
1156
1164
  const wdaHost = options?.wdaHost || 'localhost';
1165
+ const mjpegPort = options?.wdaMjpegPort ?? DEFAULT_WDA_MJPEG_PORT;
1157
1166
  this.wdaBackend = new IOSWebDriverClient({
1158
1167
  port: wdaPort,
1159
1168
  host: wdaHost
1160
1169
  });
1161
1170
  this.wdaManager = webdriver_namespaceObject.WDAManager.getInstance(wdaPort, wdaHost);
1171
+ this.mjpegStreamUrl = `http://${wdaHost}:${mjpegPort}`;
1162
1172
  }
1163
1173
  }
1164
1174
  const runWdaRequestParamSchema = core_namespaceObject.z.object({
@@ -1281,7 +1291,7 @@ class IOSMCPServer extends mcp_namespaceObject.BaseMCPServer {
1281
1291
  constructor(toolsManager){
1282
1292
  super({
1283
1293
  name: '@midscene/ios-mcp',
1284
- version: "1.4.1",
1294
+ version: "1.4.2",
1285
1295
  description: 'Control the iOS device using natural language commands'
1286
1296
  }, toolsManager);
1287
1297
  }
@@ -75,6 +75,8 @@ export declare class IOSDevice implements AbstractInterface {
75
75
  private customActions?;
76
76
  private wdaBackend;
77
77
  private wdaManager;
78
+ /** URL of WDA's native MJPEG server for real-time streaming */
79
+ mjpegStreamUrl: string;
78
80
  private appNameMapping;
79
81
  interfaceType: InterfaceType;
80
82
  uri: string | undefined;
@@ -72,6 +72,8 @@ declare class IOSDevice implements AbstractInterface {
72
72
  private customActions?;
73
73
  private wdaBackend;
74
74
  private wdaManager;
75
+ /** URL of WDA's native MJPEG server for real-time streaming */
76
+ mjpegStreamUrl: string;
75
77
  private appNameMapping;
76
78
  interfaceType: InterfaceType;
77
79
  uri: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/ios",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "iOS automation library for Midscene",
5
5
  "keywords": [
6
6
  "iOS UI automation",
@@ -43,10 +43,10 @@
43
43
  "dependencies": {
44
44
  "@inquirer/prompts": "^7.8.6",
45
45
  "open": "10.1.0",
46
- "@midscene/core": "1.4.1",
47
- "@midscene/webdriver": "1.4.1",
48
- "@midscene/shared": "1.4.1",
49
- "@midscene/playground": "1.4.1"
46
+ "@midscene/webdriver": "1.4.2",
47
+ "@midscene/shared": "1.4.2",
48
+ "@midscene/core": "1.4.2",
49
+ "@midscene/playground": "1.4.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@rslib/core": "^0.18.3",
package/static/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/853.673222dd.js"></script><script defer src="/static/js/index.b87668f7.js"></script><link href="/static/css/index.33fcd75b.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+ <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/853.673222dd.js"></script><script defer src="/static/js/index.5aaeb49d.js"></script><link href="/static/css/index.33fcd75b.css" rel="stylesheet"></head><body><div id="root"></div></body></html>