@midscene/ios 1.7.5 → 1.7.6-beta-20260421072755.0

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
@@ -1241,8 +1241,12 @@ const runWdaRequestParamSchema = z.object({
1241
1241
  endpoint: z.string().describe('WebDriver API endpoint'),
1242
1242
  data: z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1243
1243
  });
1244
- const launchParamSchema = z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1245
- const terminateParamSchema = z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1244
+ const launchParamSchema = z.object({
1245
+ uri: z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1246
+ });
1247
+ const terminateParamSchema = z.object({
1248
+ uri: z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1249
+ });
1246
1250
  const createPlatformActions = (device)=>({
1247
1251
  RunWdaRequest: defineAction({
1248
1252
  name: 'RunWdaRequest',
@@ -1260,8 +1264,12 @@ const createPlatformActions = (device)=>({
1260
1264
  description: 'Launch an iOS app or URL',
1261
1265
  interfaceAlias: 'launch',
1262
1266
  paramSchema: launchParamSchema,
1267
+ sample: {
1268
+ uri: 'com.apple.Preferences'
1269
+ },
1263
1270
  call: async (param)=>{
1264
- await device.launch(param);
1271
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1272
+ await device.launch(param.uri);
1265
1273
  }
1266
1274
  }),
1267
1275
  Terminate: defineAction({
@@ -1269,8 +1277,12 @@ const createPlatformActions = (device)=>({
1269
1277
  description: 'Terminate (close) an iOS app by its bundle ID',
1270
1278
  interfaceAlias: 'terminate',
1271
1279
  paramSchema: terminateParamSchema,
1280
+ sample: {
1281
+ uri: 'com.apple.Preferences'
1282
+ },
1272
1283
  call: async (param)=>{
1273
- await device.terminate(param);
1284
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1285
+ await device.terminate(param.uri);
1274
1286
  }
1275
1287
  }),
1276
1288
  IOSHomeButton: defineAction({
@@ -1300,17 +1312,27 @@ function agent_define_property(obj, key, value) {
1300
1312
  }
1301
1313
  getDebug('ios:agent');
1302
1314
  class IOSAgent extends Agent {
1315
+ async launch(uri) {
1316
+ const action = this.wrapActionInActionSpace('Launch');
1317
+ return action({
1318
+ uri
1319
+ });
1320
+ }
1321
+ async terminate(uri) {
1322
+ const action = this.wrapActionInActionSpace('Terminate');
1323
+ return action({
1324
+ uri
1325
+ });
1326
+ }
1303
1327
  createActionWrapper(name) {
1304
1328
  const action = this.wrapActionInActionSpace(name);
1305
1329
  return (...args)=>action(args[0]);
1306
1330
  }
1307
1331
  constructor(device, opts){
1308
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1332
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1309
1333
  this.appNameMapping = mergeAndNormalizeAppNameMapping(defaultAppNameMapping, opts?.appNameMapping);
1310
1334
  device.setAppNameMapping(this.appNameMapping);
1311
- this.launch = this.createActionWrapper('Launch');
1312
1335
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1313
- this.terminate = this.createActionWrapper('Terminate');
1314
1336
  this.home = this.createActionWrapper('IOSHomeButton');
1315
1337
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1316
1338
  }
package/dist/es/cli.mjs CHANGED
@@ -1240,8 +1240,12 @@ const runWdaRequestParamSchema = z.object({
1240
1240
  endpoint: z.string().describe('WebDriver API endpoint'),
1241
1241
  data: z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1242
1242
  });
1243
- const launchParamSchema = z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1244
- const terminateParamSchema = z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1243
+ const launchParamSchema = z.object({
1244
+ uri: z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1245
+ });
1246
+ const terminateParamSchema = z.object({
1247
+ uri: z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1248
+ });
1245
1249
  const createPlatformActions = (device)=>({
1246
1250
  RunWdaRequest: defineAction({
1247
1251
  name: 'RunWdaRequest',
@@ -1259,8 +1263,12 @@ const createPlatformActions = (device)=>({
1259
1263
  description: 'Launch an iOS app or URL',
1260
1264
  interfaceAlias: 'launch',
1261
1265
  paramSchema: launchParamSchema,
1266
+ sample: {
1267
+ uri: 'com.apple.Preferences'
1268
+ },
1262
1269
  call: async (param)=>{
1263
- await device.launch(param);
1270
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1271
+ await device.launch(param.uri);
1264
1272
  }
1265
1273
  }),
1266
1274
  Terminate: defineAction({
@@ -1268,8 +1276,12 @@ const createPlatformActions = (device)=>({
1268
1276
  description: 'Terminate (close) an iOS app by its bundle ID',
1269
1277
  interfaceAlias: 'terminate',
1270
1278
  paramSchema: terminateParamSchema,
1279
+ sample: {
1280
+ uri: 'com.apple.Preferences'
1281
+ },
1271
1282
  call: async (param)=>{
1272
- await device.terminate(param);
1283
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1284
+ await device.terminate(param.uri);
1273
1285
  }
1274
1286
  }),
1275
1287
  IOSHomeButton: defineAction({
@@ -1299,17 +1311,27 @@ function agent_define_property(obj, key, value) {
1299
1311
  }
1300
1312
  const debugAgent = getDebug('ios:agent');
1301
1313
  class IOSAgent extends Agent {
1314
+ async launch(uri) {
1315
+ const action = this.wrapActionInActionSpace('Launch');
1316
+ return action({
1317
+ uri
1318
+ });
1319
+ }
1320
+ async terminate(uri) {
1321
+ const action = this.wrapActionInActionSpace('Terminate');
1322
+ return action({
1323
+ uri
1324
+ });
1325
+ }
1302
1326
  createActionWrapper(name) {
1303
1327
  const action = this.wrapActionInActionSpace(name);
1304
1328
  return (...args)=>action(args[0]);
1305
1329
  }
1306
1330
  constructor(device, opts){
1307
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1331
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1308
1332
  this.appNameMapping = mergeAndNormalizeAppNameMapping(defaultAppNameMapping, opts?.appNameMapping);
1309
1333
  device.setAppNameMapping(this.appNameMapping);
1310
- this.launch = this.createActionWrapper('Launch');
1311
1334
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1312
- this.terminate = this.createActionWrapper('Terminate');
1313
1335
  this.home = this.createActionWrapper('IOSHomeButton');
1314
1336
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1315
1337
  }
@@ -1407,7 +1429,7 @@ class IOSMidsceneTools extends BaseMidsceneTools {
1407
1429
  const tools = new IOSMidsceneTools();
1408
1430
  runToolsCLI(tools, 'midscene-ios', {
1409
1431
  stripPrefix: 'ios_',
1410
- version: "1.7.5",
1432
+ version: "1.7.6-beta-20260421072755.0",
1411
1433
  extraCommands: createReportCliCommands()
1412
1434
  }).catch((e)=>{
1413
1435
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -1062,8 +1062,12 @@ const runWdaRequestParamSchema = z.object({
1062
1062
  endpoint: z.string().describe('WebDriver API endpoint'),
1063
1063
  data: z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1064
1064
  });
1065
- const launchParamSchema = z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1066
- const terminateParamSchema = z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1065
+ const launchParamSchema = z.object({
1066
+ uri: z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1067
+ });
1068
+ const terminateParamSchema = z.object({
1069
+ uri: z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1070
+ });
1067
1071
  const createPlatformActions = (device)=>({
1068
1072
  RunWdaRequest: defineAction({
1069
1073
  name: 'RunWdaRequest',
@@ -1081,8 +1085,12 @@ const createPlatformActions = (device)=>({
1081
1085
  description: 'Launch an iOS app or URL',
1082
1086
  interfaceAlias: 'launch',
1083
1087
  paramSchema: launchParamSchema,
1088
+ sample: {
1089
+ uri: 'com.apple.Preferences'
1090
+ },
1084
1091
  call: async (param)=>{
1085
- await device.launch(param);
1092
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1093
+ await device.launch(param.uri);
1086
1094
  }
1087
1095
  }),
1088
1096
  Terminate: defineAction({
@@ -1090,8 +1098,12 @@ const createPlatformActions = (device)=>({
1090
1098
  description: 'Terminate (close) an iOS app by its bundle ID',
1091
1099
  interfaceAlias: 'terminate',
1092
1100
  paramSchema: terminateParamSchema,
1101
+ sample: {
1102
+ uri: 'com.apple.Preferences'
1103
+ },
1093
1104
  call: async (param)=>{
1094
- await device.terminate(param);
1105
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1106
+ await device.terminate(param.uri);
1095
1107
  }
1096
1108
  }),
1097
1109
  IOSHomeButton: defineAction({
@@ -1305,17 +1317,27 @@ function agent_define_property(obj, key, value) {
1305
1317
  }
1306
1318
  const debugAgent = getDebug('ios:agent');
1307
1319
  class IOSAgent extends Agent {
1320
+ async launch(uri) {
1321
+ const action = this.wrapActionInActionSpace('Launch');
1322
+ return action({
1323
+ uri
1324
+ });
1325
+ }
1326
+ async terminate(uri) {
1327
+ const action = this.wrapActionInActionSpace('Terminate');
1328
+ return action({
1329
+ uri
1330
+ });
1331
+ }
1308
1332
  createActionWrapper(name) {
1309
1333
  const action = this.wrapActionInActionSpace(name);
1310
1334
  return (...args)=>action(args[0]);
1311
1335
  }
1312
1336
  constructor(device, opts){
1313
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1337
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1314
1338
  this.appNameMapping = mergeAndNormalizeAppNameMapping(defaultAppNameMapping, opts?.appNameMapping);
1315
1339
  device.setAppNameMapping(this.appNameMapping);
1316
- this.launch = this.createActionWrapper('Launch');
1317
1340
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1318
- this.terminate = this.createActionWrapper('Terminate');
1319
1341
  this.home = this.createActionWrapper('IOSHomeButton');
1320
1342
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1321
1343
  }
@@ -1240,8 +1240,12 @@ const runWdaRequestParamSchema = z.object({
1240
1240
  endpoint: z.string().describe('WebDriver API endpoint'),
1241
1241
  data: z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1242
1242
  });
1243
- const launchParamSchema = z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1244
- const terminateParamSchema = z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1243
+ const launchParamSchema = z.object({
1244
+ uri: z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1245
+ });
1246
+ const terminateParamSchema = z.object({
1247
+ uri: z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1248
+ });
1245
1249
  const createPlatformActions = (device)=>({
1246
1250
  RunWdaRequest: defineAction({
1247
1251
  name: 'RunWdaRequest',
@@ -1259,8 +1263,12 @@ const createPlatformActions = (device)=>({
1259
1263
  description: 'Launch an iOS app or URL',
1260
1264
  interfaceAlias: 'launch',
1261
1265
  paramSchema: launchParamSchema,
1266
+ sample: {
1267
+ uri: 'com.apple.Preferences'
1268
+ },
1262
1269
  call: async (param)=>{
1263
- await device.launch(param);
1270
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1271
+ await device.launch(param.uri);
1264
1272
  }
1265
1273
  }),
1266
1274
  Terminate: defineAction({
@@ -1268,8 +1276,12 @@ const createPlatformActions = (device)=>({
1268
1276
  description: 'Terminate (close) an iOS app by its bundle ID',
1269
1277
  interfaceAlias: 'terminate',
1270
1278
  paramSchema: terminateParamSchema,
1279
+ sample: {
1280
+ uri: 'com.apple.Preferences'
1281
+ },
1271
1282
  call: async (param)=>{
1272
- await device.terminate(param);
1283
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1284
+ await device.terminate(param.uri);
1273
1285
  }
1274
1286
  }),
1275
1287
  IOSHomeButton: defineAction({
@@ -1299,17 +1311,27 @@ function agent_define_property(obj, key, value) {
1299
1311
  }
1300
1312
  const debugAgent = getDebug('ios:agent');
1301
1313
  class IOSAgent extends Agent {
1314
+ async launch(uri) {
1315
+ const action = this.wrapActionInActionSpace('Launch');
1316
+ return action({
1317
+ uri
1318
+ });
1319
+ }
1320
+ async terminate(uri) {
1321
+ const action = this.wrapActionInActionSpace('Terminate');
1322
+ return action({
1323
+ uri
1324
+ });
1325
+ }
1302
1326
  createActionWrapper(name) {
1303
1327
  const action = this.wrapActionInActionSpace(name);
1304
1328
  return (...args)=>action(args[0]);
1305
1329
  }
1306
1330
  constructor(device, opts){
1307
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1331
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1308
1332
  this.appNameMapping = mergeAndNormalizeAppNameMapping(defaultAppNameMapping, opts?.appNameMapping);
1309
1333
  device.setAppNameMapping(this.appNameMapping);
1310
- this.launch = this.createActionWrapper('Launch');
1311
1334
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1312
- this.terminate = this.createActionWrapper('Terminate');
1313
1335
  this.home = this.createActionWrapper('IOSHomeButton');
1314
1336
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1315
1337
  }
@@ -1411,7 +1433,7 @@ class IOSMCPServer extends BaseMCPServer {
1411
1433
  constructor(toolsManager){
1412
1434
  super({
1413
1435
  name: '@midscene/ios-mcp',
1414
- version: "1.7.5",
1436
+ version: "1.7.6-beta-20260421072755.0",
1415
1437
  description: 'Control the iOS device using natural language commands'
1416
1438
  }, toolsManager);
1417
1439
  }
package/dist/lib/bin.js CHANGED
@@ -1266,8 +1266,12 @@ const runWdaRequestParamSchema = core_namespaceObject.z.object({
1266
1266
  endpoint: core_namespaceObject.z.string().describe('WebDriver API endpoint'),
1267
1267
  data: core_namespaceObject.z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1268
1268
  });
1269
- const launchParamSchema = core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1270
- const terminateParamSchema = core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1269
+ const launchParamSchema = core_namespaceObject.z.object({
1270
+ uri: core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1271
+ });
1272
+ const terminateParamSchema = core_namespaceObject.z.object({
1273
+ uri: core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1274
+ });
1271
1275
  const createPlatformActions = (device)=>({
1272
1276
  RunWdaRequest: (0, device_namespaceObject.defineAction)({
1273
1277
  name: 'RunWdaRequest',
@@ -1285,8 +1289,12 @@ const createPlatformActions = (device)=>({
1285
1289
  description: 'Launch an iOS app or URL',
1286
1290
  interfaceAlias: 'launch',
1287
1291
  paramSchema: launchParamSchema,
1292
+ sample: {
1293
+ uri: 'com.apple.Preferences'
1294
+ },
1288
1295
  call: async (param)=>{
1289
- await device.launch(param);
1296
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1297
+ await device.launch(param.uri);
1290
1298
  }
1291
1299
  }),
1292
1300
  Terminate: (0, device_namespaceObject.defineAction)({
@@ -1294,8 +1302,12 @@ const createPlatformActions = (device)=>({
1294
1302
  description: 'Terminate (close) an iOS app by its bundle ID',
1295
1303
  interfaceAlias: 'terminate',
1296
1304
  paramSchema: terminateParamSchema,
1305
+ sample: {
1306
+ uri: 'com.apple.Preferences'
1307
+ },
1297
1308
  call: async (param)=>{
1298
- await device.terminate(param);
1309
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1310
+ await device.terminate(param.uri);
1299
1311
  }
1300
1312
  }),
1301
1313
  IOSHomeButton: (0, device_namespaceObject.defineAction)({
@@ -1325,17 +1337,27 @@ function agent_define_property(obj, key, value) {
1325
1337
  }
1326
1338
  (0, logger_namespaceObject.getDebug)('ios:agent');
1327
1339
  class IOSAgent extends agent_namespaceObject.Agent {
1340
+ async launch(uri) {
1341
+ const action = this.wrapActionInActionSpace('Launch');
1342
+ return action({
1343
+ uri
1344
+ });
1345
+ }
1346
+ async terminate(uri) {
1347
+ const action = this.wrapActionInActionSpace('Terminate');
1348
+ return action({
1349
+ uri
1350
+ });
1351
+ }
1328
1352
  createActionWrapper(name) {
1329
1353
  const action = this.wrapActionInActionSpace(name);
1330
1354
  return (...args)=>action(args[0]);
1331
1355
  }
1332
1356
  constructor(device, opts){
1333
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1357
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1334
1358
  this.appNameMapping = (0, utils_namespaceObject.mergeAndNormalizeAppNameMapping)(defaultAppNameMapping, opts?.appNameMapping);
1335
1359
  device.setAppNameMapping(this.appNameMapping);
1336
- this.launch = this.createActionWrapper('Launch');
1337
1360
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1338
- this.terminate = this.createActionWrapper('Terminate');
1339
1361
  this.home = this.createActionWrapper('IOSHomeButton');
1340
1362
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1341
1363
  }
package/dist/lib/cli.js CHANGED
@@ -1264,8 +1264,12 @@ const runWdaRequestParamSchema = core_namespaceObject.z.object({
1264
1264
  endpoint: core_namespaceObject.z.string().describe('WebDriver API endpoint'),
1265
1265
  data: core_namespaceObject.z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1266
1266
  });
1267
- const launchParamSchema = core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1268
- const terminateParamSchema = core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1267
+ const launchParamSchema = core_namespaceObject.z.object({
1268
+ uri: core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1269
+ });
1270
+ const terminateParamSchema = core_namespaceObject.z.object({
1271
+ uri: core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1272
+ });
1269
1273
  const createPlatformActions = (device)=>({
1270
1274
  RunWdaRequest: (0, device_namespaceObject.defineAction)({
1271
1275
  name: 'RunWdaRequest',
@@ -1283,8 +1287,12 @@ const createPlatformActions = (device)=>({
1283
1287
  description: 'Launch an iOS app or URL',
1284
1288
  interfaceAlias: 'launch',
1285
1289
  paramSchema: launchParamSchema,
1290
+ sample: {
1291
+ uri: 'com.apple.Preferences'
1292
+ },
1286
1293
  call: async (param)=>{
1287
- await device.launch(param);
1294
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1295
+ await device.launch(param.uri);
1288
1296
  }
1289
1297
  }),
1290
1298
  Terminate: (0, device_namespaceObject.defineAction)({
@@ -1292,8 +1300,12 @@ const createPlatformActions = (device)=>({
1292
1300
  description: 'Terminate (close) an iOS app by its bundle ID',
1293
1301
  interfaceAlias: 'terminate',
1294
1302
  paramSchema: terminateParamSchema,
1303
+ sample: {
1304
+ uri: 'com.apple.Preferences'
1305
+ },
1295
1306
  call: async (param)=>{
1296
- await device.terminate(param);
1307
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1308
+ await device.terminate(param.uri);
1297
1309
  }
1298
1310
  }),
1299
1311
  IOSHomeButton: (0, device_namespaceObject.defineAction)({
@@ -1323,17 +1335,27 @@ function agent_define_property(obj, key, value) {
1323
1335
  }
1324
1336
  const debugAgent = (0, logger_namespaceObject.getDebug)('ios:agent');
1325
1337
  class IOSAgent extends agent_namespaceObject.Agent {
1338
+ async launch(uri) {
1339
+ const action = this.wrapActionInActionSpace('Launch');
1340
+ return action({
1341
+ uri
1342
+ });
1343
+ }
1344
+ async terminate(uri) {
1345
+ const action = this.wrapActionInActionSpace('Terminate');
1346
+ return action({
1347
+ uri
1348
+ });
1349
+ }
1326
1350
  createActionWrapper(name) {
1327
1351
  const action = this.wrapActionInActionSpace(name);
1328
1352
  return (...args)=>action(args[0]);
1329
1353
  }
1330
1354
  constructor(device, opts){
1331
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1355
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1332
1356
  this.appNameMapping = (0, utils_namespaceObject.mergeAndNormalizeAppNameMapping)(defaultAppNameMapping, opts?.appNameMapping);
1333
1357
  device.setAppNameMapping(this.appNameMapping);
1334
- this.launch = this.createActionWrapper('Launch');
1335
1358
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1336
- this.terminate = this.createActionWrapper('Terminate');
1337
1359
  this.home = this.createActionWrapper('IOSHomeButton');
1338
1360
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1339
1361
  }
@@ -1431,7 +1453,7 @@ class IOSMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools {
1431
1453
  const tools = new IOSMidsceneTools();
1432
1454
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-ios', {
1433
1455
  stripPrefix: 'ios_',
1434
- version: "1.7.5",
1456
+ version: "1.7.6-beta-20260421072755.0",
1435
1457
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
1436
1458
  }).catch((e)=>{
1437
1459
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -1098,8 +1098,12 @@ const runWdaRequestParamSchema = core_namespaceObject.z.object({
1098
1098
  endpoint: core_namespaceObject.z.string().describe('WebDriver API endpoint'),
1099
1099
  data: core_namespaceObject.z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1100
1100
  });
1101
- const launchParamSchema = core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1102
- const terminateParamSchema = core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1101
+ const launchParamSchema = core_namespaceObject.z.object({
1102
+ uri: core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1103
+ });
1104
+ const terminateParamSchema = core_namespaceObject.z.object({
1105
+ uri: core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1106
+ });
1103
1107
  const createPlatformActions = (device)=>({
1104
1108
  RunWdaRequest: (0, device_namespaceObject.defineAction)({
1105
1109
  name: 'RunWdaRequest',
@@ -1117,8 +1121,12 @@ const createPlatformActions = (device)=>({
1117
1121
  description: 'Launch an iOS app or URL',
1118
1122
  interfaceAlias: 'launch',
1119
1123
  paramSchema: launchParamSchema,
1124
+ sample: {
1125
+ uri: 'com.apple.Preferences'
1126
+ },
1120
1127
  call: async (param)=>{
1121
- await device.launch(param);
1128
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1129
+ await device.launch(param.uri);
1122
1130
  }
1123
1131
  }),
1124
1132
  Terminate: (0, device_namespaceObject.defineAction)({
@@ -1126,8 +1134,12 @@ const createPlatformActions = (device)=>({
1126
1134
  description: 'Terminate (close) an iOS app by its bundle ID',
1127
1135
  interfaceAlias: 'terminate',
1128
1136
  paramSchema: terminateParamSchema,
1137
+ sample: {
1138
+ uri: 'com.apple.Preferences'
1139
+ },
1129
1140
  call: async (param)=>{
1130
- await device.terminate(param);
1141
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1142
+ await device.terminate(param.uri);
1131
1143
  }
1132
1144
  }),
1133
1145
  IOSHomeButton: (0, device_namespaceObject.defineAction)({
@@ -1342,17 +1354,27 @@ function agent_define_property(obj, key, value) {
1342
1354
  }
1343
1355
  const debugAgent = (0, logger_namespaceObject.getDebug)('ios:agent');
1344
1356
  class IOSAgent extends agent_namespaceObject.Agent {
1357
+ async launch(uri) {
1358
+ const action = this.wrapActionInActionSpace('Launch');
1359
+ return action({
1360
+ uri
1361
+ });
1362
+ }
1363
+ async terminate(uri) {
1364
+ const action = this.wrapActionInActionSpace('Terminate');
1365
+ return action({
1366
+ uri
1367
+ });
1368
+ }
1345
1369
  createActionWrapper(name) {
1346
1370
  const action = this.wrapActionInActionSpace(name);
1347
1371
  return (...args)=>action(args[0]);
1348
1372
  }
1349
1373
  constructor(device, opts){
1350
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1374
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1351
1375
  this.appNameMapping = (0, shared_utils_namespaceObject.mergeAndNormalizeAppNameMapping)(defaultAppNameMapping, opts?.appNameMapping);
1352
1376
  device.setAppNameMapping(this.appNameMapping);
1353
- this.launch = this.createActionWrapper('Launch');
1354
1377
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1355
- this.terminate = this.createActionWrapper('Terminate');
1356
1378
  this.home = this.createActionWrapper('IOSHomeButton');
1357
1379
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1358
1380
  }
@@ -1279,8 +1279,12 @@ const runWdaRequestParamSchema = core_namespaceObject.z.object({
1279
1279
  endpoint: core_namespaceObject.z.string().describe('WebDriver API endpoint'),
1280
1280
  data: core_namespaceObject.z.object({}).passthrough().optional().describe('Optional request body data as JSON object')
1281
1281
  });
1282
- const launchParamSchema = core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.');
1283
- const terminateParamSchema = core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.');
1282
+ const launchParamSchema = core_namespaceObject.z.object({
1283
+ uri: core_namespaceObject.z.string().describe('App name, bundle ID, or URL to launch. Prioritize using the exact bundle ID or URL the user has provided. If none provided, use the accurate app name.')
1284
+ });
1285
+ const terminateParamSchema = core_namespaceObject.z.object({
1286
+ uri: core_namespaceObject.z.string().describe('Bundle ID of the app to terminate (close). Use the exact bundle ID, e.g. com.apple.Preferences.')
1287
+ });
1284
1288
  const createPlatformActions = (device)=>({
1285
1289
  RunWdaRequest: (0, device_namespaceObject.defineAction)({
1286
1290
  name: 'RunWdaRequest',
@@ -1298,8 +1302,12 @@ const createPlatformActions = (device)=>({
1298
1302
  description: 'Launch an iOS app or URL',
1299
1303
  interfaceAlias: 'launch',
1300
1304
  paramSchema: launchParamSchema,
1305
+ sample: {
1306
+ uri: 'com.apple.Preferences'
1307
+ },
1301
1308
  call: async (param)=>{
1302
- await device.launch(param);
1309
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Launch requires a non-empty uri parameter');
1310
+ await device.launch(param.uri);
1303
1311
  }
1304
1312
  }),
1305
1313
  Terminate: (0, device_namespaceObject.defineAction)({
@@ -1307,8 +1315,12 @@ const createPlatformActions = (device)=>({
1307
1315
  description: 'Terminate (close) an iOS app by its bundle ID',
1308
1316
  interfaceAlias: 'terminate',
1309
1317
  paramSchema: terminateParamSchema,
1318
+ sample: {
1319
+ uri: 'com.apple.Preferences'
1320
+ },
1310
1321
  call: async (param)=>{
1311
- await device.terminate(param);
1322
+ if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
1323
+ await device.terminate(param.uri);
1312
1324
  }
1313
1325
  }),
1314
1326
  IOSHomeButton: (0, device_namespaceObject.defineAction)({
@@ -1338,17 +1350,27 @@ function agent_define_property(obj, key, value) {
1338
1350
  }
1339
1351
  const debugAgent = (0, logger_namespaceObject.getDebug)('ios:agent');
1340
1352
  class IOSAgent extends agent_namespaceObject.Agent {
1353
+ async launch(uri) {
1354
+ const action = this.wrapActionInActionSpace('Launch');
1355
+ return action({
1356
+ uri
1357
+ });
1358
+ }
1359
+ async terminate(uri) {
1360
+ const action = this.wrapActionInActionSpace('Terminate');
1361
+ return action({
1362
+ uri
1363
+ });
1364
+ }
1341
1365
  createActionWrapper(name) {
1342
1366
  const action = this.wrapActionInActionSpace(name);
1343
1367
  return (...args)=>action(args[0]);
1344
1368
  }
1345
1369
  constructor(device, opts){
1346
- super(device, opts), agent_define_property(this, "launch", void 0), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "terminate", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1370
+ super(device, opts), agent_define_property(this, "runWdaRequest", void 0), agent_define_property(this, "home", void 0), agent_define_property(this, "appSwitcher", void 0), agent_define_property(this, "appNameMapping", void 0);
1347
1371
  this.appNameMapping = (0, utils_namespaceObject.mergeAndNormalizeAppNameMapping)(defaultAppNameMapping, opts?.appNameMapping);
1348
1372
  device.setAppNameMapping(this.appNameMapping);
1349
- this.launch = this.createActionWrapper('Launch');
1350
1373
  this.runWdaRequest = this.createActionWrapper('RunWdaRequest');
1351
- this.terminate = this.createActionWrapper('Terminate');
1352
1374
  this.home = this.createActionWrapper('IOSHomeButton');
1353
1375
  this.appSwitcher = this.createActionWrapper('IOSAppSwitcher');
1354
1376
  }
@@ -1451,7 +1473,7 @@ class IOSMCPServer extends mcp_namespaceObject.BaseMCPServer {
1451
1473
  constructor(toolsManager){
1452
1474
  super({
1453
1475
  name: '@midscene/ios-mcp',
1454
- version: "1.7.5",
1476
+ version: "1.7.6-beta-20260421072755.0",
1455
1477
  description: 'Control the iOS device using natural language commands'
1456
1478
  }, toolsManager);
1457
1479
  }