@midscene/ios 1.8.5-beta-20260525033347.0 → 1.8.5
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 +7 -25
- package/dist/es/cli.mjs +8 -26
- package/dist/es/index.mjs +7 -25
- package/dist/es/mcp-server.mjs +8 -26
- package/dist/lib/bin.js +7 -25
- package/dist/lib/cli.js +8 -26
- package/dist/lib/index.js +7 -25
- package/dist/lib/mcp-server.js +8 -26
- package/dist/types/index.d.ts +1 -3
- package/package.json +7 -7
- package/static/index.html +1 -1
- package/static/static/js/{index.fe9e4f0b.js → index.ef742dc1.js} +40 -40
- package/static/static/js/index.ef742dc1.js.map +1 -0
- package/static/static/js/index.fe9e4f0b.js.map +0 -1
- /package/static/static/js/{index.fe9e4f0b.js.LICENSE.txt → index.ef742dc1.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -398,25 +398,14 @@ class IOSWebDriverClient extends WebDriverClient {
|
|
|
398
398
|
return false;
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
async typeText(text
|
|
401
|
+
async typeText(text) {
|
|
402
402
|
this.ensureSession();
|
|
403
|
-
const cleanText = text.trim();
|
|
404
|
-
if (!cleanText) return;
|
|
405
|
-
const chars = Array.from(cleanText);
|
|
406
|
-
const delayMs = options?.delayMs ?? 0;
|
|
407
403
|
try {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
chars[i]
|
|
412
|
-
]
|
|
413
|
-
});
|
|
414
|
-
if (i < chars.length - 1) await sleep(delayMs);
|
|
415
|
-
}
|
|
416
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
417
|
-
value: chars
|
|
404
|
+
const cleanText = text.trim();
|
|
405
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
406
|
+
value: cleanText.split('')
|
|
418
407
|
});
|
|
419
|
-
debugIOS(`Typed text: "${text}"
|
|
408
|
+
debugIOS(`Typed text: "${text}"`);
|
|
420
409
|
} catch (error) {
|
|
421
410
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
422
411
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -879,13 +868,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
879
868
|
async typeText(text, options) {
|
|
880
869
|
if (!text) return;
|
|
881
870
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
882
|
-
|
|
883
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
871
|
+
debugDevice(`Typing text: "${text}"`);
|
|
884
872
|
try {
|
|
885
873
|
await sleep(200);
|
|
886
|
-
await this.wdaBackend.typeText(text
|
|
887
|
-
delayMs
|
|
888
|
-
});
|
|
874
|
+
await this.wdaBackend.typeText(text);
|
|
889
875
|
await sleep(300);
|
|
890
876
|
} catch (error) {
|
|
891
877
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1281,8 +1267,6 @@ const createPlatformActions = (device)=>({
|
|
|
1281
1267
|
sample: {
|
|
1282
1268
|
uri: 'com.apple.Preferences'
|
|
1283
1269
|
},
|
|
1284
|
-
delayBeforeRunner: 0,
|
|
1285
|
-
delayAfterRunner: 0,
|
|
1286
1270
|
call: async (param)=>{
|
|
1287
1271
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1288
1272
|
await device.terminate(param.uri);
|
|
@@ -1291,8 +1275,6 @@ const createPlatformActions = (device)=>({
|
|
|
1291
1275
|
IOSHomeButton: defineAction({
|
|
1292
1276
|
name: 'IOSHomeButton',
|
|
1293
1277
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1294
|
-
delayBeforeRunner: 0,
|
|
1295
|
-
delayAfterRunner: 0,
|
|
1296
1278
|
call: async ()=>{
|
|
1297
1279
|
await device.home();
|
|
1298
1280
|
}
|
package/dist/es/cli.mjs
CHANGED
|
@@ -397,25 +397,14 @@ class IOSWebDriverClient extends WebDriverClient {
|
|
|
397
397
|
return false;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
async typeText(text
|
|
400
|
+
async typeText(text) {
|
|
401
401
|
this.ensureSession();
|
|
402
|
-
const cleanText = text.trim();
|
|
403
|
-
if (!cleanText) return;
|
|
404
|
-
const chars = Array.from(cleanText);
|
|
405
|
-
const delayMs = options?.delayMs ?? 0;
|
|
406
402
|
try {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
chars[i]
|
|
411
|
-
]
|
|
412
|
-
});
|
|
413
|
-
if (i < chars.length - 1) await sleep(delayMs);
|
|
414
|
-
}
|
|
415
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
416
|
-
value: chars
|
|
403
|
+
const cleanText = text.trim();
|
|
404
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
405
|
+
value: cleanText.split('')
|
|
417
406
|
});
|
|
418
|
-
debugIOS(`Typed text: "${text}"
|
|
407
|
+
debugIOS(`Typed text: "${text}"`);
|
|
419
408
|
} catch (error) {
|
|
420
409
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
421
410
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -878,13 +867,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
878
867
|
async typeText(text, options) {
|
|
879
868
|
if (!text) return;
|
|
880
869
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
881
|
-
|
|
882
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
870
|
+
debugDevice(`Typing text: "${text}"`);
|
|
883
871
|
try {
|
|
884
872
|
await sleep(200);
|
|
885
|
-
await this.wdaBackend.typeText(text
|
|
886
|
-
delayMs
|
|
887
|
-
});
|
|
873
|
+
await this.wdaBackend.typeText(text);
|
|
888
874
|
await sleep(300);
|
|
889
875
|
} catch (error) {
|
|
890
876
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1280,8 +1266,6 @@ const createPlatformActions = (device)=>({
|
|
|
1280
1266
|
sample: {
|
|
1281
1267
|
uri: 'com.apple.Preferences'
|
|
1282
1268
|
},
|
|
1283
|
-
delayBeforeRunner: 0,
|
|
1284
|
-
delayAfterRunner: 0,
|
|
1285
1269
|
call: async (param)=>{
|
|
1286
1270
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1287
1271
|
await device.terminate(param.uri);
|
|
@@ -1290,8 +1274,6 @@ const createPlatformActions = (device)=>({
|
|
|
1290
1274
|
IOSHomeButton: defineAction({
|
|
1291
1275
|
name: 'IOSHomeButton',
|
|
1292
1276
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1293
|
-
delayBeforeRunner: 0,
|
|
1294
|
-
delayAfterRunner: 0,
|
|
1295
1277
|
call: async ()=>{
|
|
1296
1278
|
await device.home();
|
|
1297
1279
|
}
|
|
@@ -1471,7 +1453,7 @@ class IOSMidsceneTools extends BaseMidsceneTools {
|
|
|
1471
1453
|
const tools = new IOSMidsceneTools();
|
|
1472
1454
|
runToolsCLI(tools, 'midscene-ios', {
|
|
1473
1455
|
stripPrefix: 'ios_',
|
|
1474
|
-
version: "1.8.5
|
|
1456
|
+
version: "1.8.5",
|
|
1475
1457
|
extraCommands: createReportCliCommands()
|
|
1476
1458
|
}).catch((e)=>{
|
|
1477
1459
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -218,25 +218,14 @@ class IOSWebDriverClient extends WebDriverClient {
|
|
|
218
218
|
return false;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
async typeText(text
|
|
221
|
+
async typeText(text) {
|
|
222
222
|
this.ensureSession();
|
|
223
|
-
const cleanText = text.trim();
|
|
224
|
-
if (!cleanText) return;
|
|
225
|
-
const chars = Array.from(cleanText);
|
|
226
|
-
const delayMs = options?.delayMs ?? 0;
|
|
227
223
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
chars[i]
|
|
232
|
-
]
|
|
233
|
-
});
|
|
234
|
-
if (i < chars.length - 1) await sleep(delayMs);
|
|
235
|
-
}
|
|
236
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
237
|
-
value: chars
|
|
224
|
+
const cleanText = text.trim();
|
|
225
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
226
|
+
value: cleanText.split('')
|
|
238
227
|
});
|
|
239
|
-
debugIOS(`Typed text: "${text}"
|
|
228
|
+
debugIOS(`Typed text: "${text}"`);
|
|
240
229
|
} catch (error) {
|
|
241
230
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
242
231
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -699,13 +688,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
699
688
|
async typeText(text, options) {
|
|
700
689
|
if (!text) return;
|
|
701
690
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
702
|
-
|
|
703
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
691
|
+
debugDevice(`Typing text: "${text}"`);
|
|
704
692
|
try {
|
|
705
693
|
await sleep(200);
|
|
706
|
-
await this.wdaBackend.typeText(text
|
|
707
|
-
delayMs
|
|
708
|
-
});
|
|
694
|
+
await this.wdaBackend.typeText(text);
|
|
709
695
|
await sleep(300);
|
|
710
696
|
} catch (error) {
|
|
711
697
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1101,8 +1087,6 @@ const createPlatformActions = (device)=>({
|
|
|
1101
1087
|
sample: {
|
|
1102
1088
|
uri: 'com.apple.Preferences'
|
|
1103
1089
|
},
|
|
1104
|
-
delayBeforeRunner: 0,
|
|
1105
|
-
delayAfterRunner: 0,
|
|
1106
1090
|
call: async (param)=>{
|
|
1107
1091
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1108
1092
|
await device.terminate(param.uri);
|
|
@@ -1111,8 +1095,6 @@ const createPlatformActions = (device)=>({
|
|
|
1111
1095
|
IOSHomeButton: defineAction({
|
|
1112
1096
|
name: 'IOSHomeButton',
|
|
1113
1097
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1114
|
-
delayBeforeRunner: 0,
|
|
1115
|
-
delayAfterRunner: 0,
|
|
1116
1098
|
call: async ()=>{
|
|
1117
1099
|
await device.home();
|
|
1118
1100
|
}
|
package/dist/es/mcp-server.mjs
CHANGED
|
@@ -397,25 +397,14 @@ class IOSWebDriverClient extends WebDriverClient {
|
|
|
397
397
|
return false;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
async typeText(text
|
|
400
|
+
async typeText(text) {
|
|
401
401
|
this.ensureSession();
|
|
402
|
-
const cleanText = text.trim();
|
|
403
|
-
if (!cleanText) return;
|
|
404
|
-
const chars = Array.from(cleanText);
|
|
405
|
-
const delayMs = options?.delayMs ?? 0;
|
|
406
402
|
try {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
chars[i]
|
|
411
|
-
]
|
|
412
|
-
});
|
|
413
|
-
if (i < chars.length - 1) await sleep(delayMs);
|
|
414
|
-
}
|
|
415
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
416
|
-
value: chars
|
|
403
|
+
const cleanText = text.trim();
|
|
404
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
405
|
+
value: cleanText.split('')
|
|
417
406
|
});
|
|
418
|
-
debugIOS(`Typed text: "${text}"
|
|
407
|
+
debugIOS(`Typed text: "${text}"`);
|
|
419
408
|
} catch (error) {
|
|
420
409
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
421
410
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -878,13 +867,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
878
867
|
async typeText(text, options) {
|
|
879
868
|
if (!text) return;
|
|
880
869
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
881
|
-
|
|
882
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
870
|
+
debugDevice(`Typing text: "${text}"`);
|
|
883
871
|
try {
|
|
884
872
|
await sleep(200);
|
|
885
|
-
await this.wdaBackend.typeText(text
|
|
886
|
-
delayMs
|
|
887
|
-
});
|
|
873
|
+
await this.wdaBackend.typeText(text);
|
|
888
874
|
await sleep(300);
|
|
889
875
|
} catch (error) {
|
|
890
876
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1280,8 +1266,6 @@ const createPlatformActions = (device)=>({
|
|
|
1280
1266
|
sample: {
|
|
1281
1267
|
uri: 'com.apple.Preferences'
|
|
1282
1268
|
},
|
|
1283
|
-
delayBeforeRunner: 0,
|
|
1284
|
-
delayAfterRunner: 0,
|
|
1285
1269
|
call: async (param)=>{
|
|
1286
1270
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1287
1271
|
await device.terminate(param.uri);
|
|
@@ -1290,8 +1274,6 @@ const createPlatformActions = (device)=>({
|
|
|
1290
1274
|
IOSHomeButton: defineAction({
|
|
1291
1275
|
name: 'IOSHomeButton',
|
|
1292
1276
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1293
|
-
delayBeforeRunner: 0,
|
|
1294
|
-
delayAfterRunner: 0,
|
|
1295
1277
|
call: async ()=>{
|
|
1296
1278
|
await device.home();
|
|
1297
1279
|
}
|
|
@@ -1475,7 +1457,7 @@ class IOSMCPServer extends BaseMCPServer {
|
|
|
1475
1457
|
constructor(toolsManager){
|
|
1476
1458
|
super({
|
|
1477
1459
|
name: '@midscene/ios-mcp',
|
|
1478
|
-
version: "1.8.5
|
|
1460
|
+
version: "1.8.5",
|
|
1479
1461
|
description: 'Control the iOS device using natural language commands'
|
|
1480
1462
|
}, toolsManager);
|
|
1481
1463
|
}
|
package/dist/lib/bin.js
CHANGED
|
@@ -423,25 +423,14 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
|
|
|
423
423
|
return false;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
async typeText(text
|
|
426
|
+
async typeText(text) {
|
|
427
427
|
this.ensureSession();
|
|
428
|
-
const cleanText = text.trim();
|
|
429
|
-
if (!cleanText) return;
|
|
430
|
-
const chars = Array.from(cleanText);
|
|
431
|
-
const delayMs = options?.delayMs ?? 0;
|
|
432
428
|
try {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
chars[i]
|
|
437
|
-
]
|
|
438
|
-
});
|
|
439
|
-
if (i < chars.length - 1) await (0, core_utils_namespaceObject.sleep)(delayMs);
|
|
440
|
-
}
|
|
441
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
442
|
-
value: chars
|
|
429
|
+
const cleanText = text.trim();
|
|
430
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
431
|
+
value: cleanText.split('')
|
|
443
432
|
});
|
|
444
|
-
debugIOS(`Typed text: "${text}"
|
|
433
|
+
debugIOS(`Typed text: "${text}"`);
|
|
445
434
|
} catch (error) {
|
|
446
435
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
447
436
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -904,13 +893,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
904
893
|
async typeText(text, options) {
|
|
905
894
|
if (!text) return;
|
|
906
895
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
907
|
-
|
|
908
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
896
|
+
debugDevice(`Typing text: "${text}"`);
|
|
909
897
|
try {
|
|
910
898
|
await (0, core_utils_namespaceObject.sleep)(200);
|
|
911
|
-
await this.wdaBackend.typeText(text
|
|
912
|
-
delayMs
|
|
913
|
-
});
|
|
899
|
+
await this.wdaBackend.typeText(text);
|
|
914
900
|
await (0, core_utils_namespaceObject.sleep)(300);
|
|
915
901
|
} catch (error) {
|
|
916
902
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1306,8 +1292,6 @@ const createPlatformActions = (device)=>({
|
|
|
1306
1292
|
sample: {
|
|
1307
1293
|
uri: 'com.apple.Preferences'
|
|
1308
1294
|
},
|
|
1309
|
-
delayBeforeRunner: 0,
|
|
1310
|
-
delayAfterRunner: 0,
|
|
1311
1295
|
call: async (param)=>{
|
|
1312
1296
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1313
1297
|
await device.terminate(param.uri);
|
|
@@ -1316,8 +1300,6 @@ const createPlatformActions = (device)=>({
|
|
|
1316
1300
|
IOSHomeButton: (0, device_namespaceObject.defineAction)({
|
|
1317
1301
|
name: 'IOSHomeButton',
|
|
1318
1302
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1319
|
-
delayBeforeRunner: 0,
|
|
1320
|
-
delayAfterRunner: 0,
|
|
1321
1303
|
call: async ()=>{
|
|
1322
1304
|
await device.home();
|
|
1323
1305
|
}
|
package/dist/lib/cli.js
CHANGED
|
@@ -421,25 +421,14 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
|
|
|
421
421
|
return false;
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
async typeText(text
|
|
424
|
+
async typeText(text) {
|
|
425
425
|
this.ensureSession();
|
|
426
|
-
const cleanText = text.trim();
|
|
427
|
-
if (!cleanText) return;
|
|
428
|
-
const chars = Array.from(cleanText);
|
|
429
|
-
const delayMs = options?.delayMs ?? 0;
|
|
430
426
|
try {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
chars[i]
|
|
435
|
-
]
|
|
436
|
-
});
|
|
437
|
-
if (i < chars.length - 1) await (0, core_utils_namespaceObject.sleep)(delayMs);
|
|
438
|
-
}
|
|
439
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
440
|
-
value: chars
|
|
427
|
+
const cleanText = text.trim();
|
|
428
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
429
|
+
value: cleanText.split('')
|
|
441
430
|
});
|
|
442
|
-
debugIOS(`Typed text: "${text}"
|
|
431
|
+
debugIOS(`Typed text: "${text}"`);
|
|
443
432
|
} catch (error) {
|
|
444
433
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
445
434
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -902,13 +891,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
902
891
|
async typeText(text, options) {
|
|
903
892
|
if (!text) return;
|
|
904
893
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
905
|
-
|
|
906
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
894
|
+
debugDevice(`Typing text: "${text}"`);
|
|
907
895
|
try {
|
|
908
896
|
await (0, core_utils_namespaceObject.sleep)(200);
|
|
909
|
-
await this.wdaBackend.typeText(text
|
|
910
|
-
delayMs
|
|
911
|
-
});
|
|
897
|
+
await this.wdaBackend.typeText(text);
|
|
912
898
|
await (0, core_utils_namespaceObject.sleep)(300);
|
|
913
899
|
} catch (error) {
|
|
914
900
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1304,8 +1290,6 @@ const createPlatformActions = (device)=>({
|
|
|
1304
1290
|
sample: {
|
|
1305
1291
|
uri: 'com.apple.Preferences'
|
|
1306
1292
|
},
|
|
1307
|
-
delayBeforeRunner: 0,
|
|
1308
|
-
delayAfterRunner: 0,
|
|
1309
1293
|
call: async (param)=>{
|
|
1310
1294
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1311
1295
|
await device.terminate(param.uri);
|
|
@@ -1314,8 +1298,6 @@ const createPlatformActions = (device)=>({
|
|
|
1314
1298
|
IOSHomeButton: (0, device_namespaceObject.defineAction)({
|
|
1315
1299
|
name: 'IOSHomeButton',
|
|
1316
1300
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1317
|
-
delayBeforeRunner: 0,
|
|
1318
|
-
delayAfterRunner: 0,
|
|
1319
1301
|
call: async ()=>{
|
|
1320
1302
|
await device.home();
|
|
1321
1303
|
}
|
|
@@ -1495,7 +1477,7 @@ class IOSMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools {
|
|
|
1495
1477
|
const tools = new IOSMidsceneTools();
|
|
1496
1478
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-ios', {
|
|
1497
1479
|
stripPrefix: 'ios_',
|
|
1498
|
-
version: "1.8.5
|
|
1480
|
+
version: "1.8.5",
|
|
1499
1481
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
1500
1482
|
}).catch((e)=>{
|
|
1501
1483
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -254,25 +254,14 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
|
|
|
254
254
|
return false;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
async typeText(text
|
|
257
|
+
async typeText(text) {
|
|
258
258
|
this.ensureSession();
|
|
259
|
-
const cleanText = text.trim();
|
|
260
|
-
if (!cleanText) return;
|
|
261
|
-
const chars = Array.from(cleanText);
|
|
262
|
-
const delayMs = options?.delayMs ?? 0;
|
|
263
259
|
try {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
chars[i]
|
|
268
|
-
]
|
|
269
|
-
});
|
|
270
|
-
if (i < chars.length - 1) await (0, utils_namespaceObject.sleep)(delayMs);
|
|
271
|
-
}
|
|
272
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
273
|
-
value: chars
|
|
260
|
+
const cleanText = text.trim();
|
|
261
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
262
|
+
value: cleanText.split('')
|
|
274
263
|
});
|
|
275
|
-
debugIOS(`Typed text: "${text}"
|
|
264
|
+
debugIOS(`Typed text: "${text}"`);
|
|
276
265
|
} catch (error) {
|
|
277
266
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
278
267
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -735,13 +724,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
735
724
|
async typeText(text, options) {
|
|
736
725
|
if (!text) return;
|
|
737
726
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
738
|
-
|
|
739
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
727
|
+
debugDevice(`Typing text: "${text}"`);
|
|
740
728
|
try {
|
|
741
729
|
await (0, utils_namespaceObject.sleep)(200);
|
|
742
|
-
await this.wdaBackend.typeText(text
|
|
743
|
-
delayMs
|
|
744
|
-
});
|
|
730
|
+
await this.wdaBackend.typeText(text);
|
|
745
731
|
await (0, utils_namespaceObject.sleep)(300);
|
|
746
732
|
} catch (error) {
|
|
747
733
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1137,8 +1123,6 @@ const createPlatformActions = (device)=>({
|
|
|
1137
1123
|
sample: {
|
|
1138
1124
|
uri: 'com.apple.Preferences'
|
|
1139
1125
|
},
|
|
1140
|
-
delayBeforeRunner: 0,
|
|
1141
|
-
delayAfterRunner: 0,
|
|
1142
1126
|
call: async (param)=>{
|
|
1143
1127
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1144
1128
|
await device.terminate(param.uri);
|
|
@@ -1147,8 +1131,6 @@ const createPlatformActions = (device)=>({
|
|
|
1147
1131
|
IOSHomeButton: (0, device_namespaceObject.defineAction)({
|
|
1148
1132
|
name: 'IOSHomeButton',
|
|
1149
1133
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1150
|
-
delayBeforeRunner: 0,
|
|
1151
|
-
delayAfterRunner: 0,
|
|
1152
1134
|
call: async ()=>{
|
|
1153
1135
|
await device.home();
|
|
1154
1136
|
}
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -436,25 +436,14 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
|
|
|
436
436
|
return false;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
async typeText(text
|
|
439
|
+
async typeText(text) {
|
|
440
440
|
this.ensureSession();
|
|
441
|
-
const cleanText = text.trim();
|
|
442
|
-
if (!cleanText) return;
|
|
443
|
-
const chars = Array.from(cleanText);
|
|
444
|
-
const delayMs = options?.delayMs ?? 0;
|
|
445
441
|
try {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
chars[i]
|
|
450
|
-
]
|
|
451
|
-
});
|
|
452
|
-
if (i < chars.length - 1) await (0, core_utils_namespaceObject.sleep)(delayMs);
|
|
453
|
-
}
|
|
454
|
-
else await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
455
|
-
value: chars
|
|
442
|
+
const cleanText = text.trim();
|
|
443
|
+
await this.makeRequest('POST', `/session/${this.sessionId}/wda/keys`, {
|
|
444
|
+
value: cleanText.split('')
|
|
456
445
|
});
|
|
457
|
-
debugIOS(`Typed text: "${text}"
|
|
446
|
+
debugIOS(`Typed text: "${text}"`);
|
|
458
447
|
} catch (error) {
|
|
459
448
|
debugIOS(`Failed to type text "${text}": ${error}`);
|
|
460
449
|
throw new Error(`Failed to type text: ${error}`);
|
|
@@ -917,13 +906,10 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
|
|
|
917
906
|
async typeText(text, options) {
|
|
918
907
|
if (!text) return;
|
|
919
908
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
920
|
-
|
|
921
|
-
debugDevice(`Typing text: "${text}" (delayMs=${delayMs})`);
|
|
909
|
+
debugDevice(`Typing text: "${text}"`);
|
|
922
910
|
try {
|
|
923
911
|
await (0, core_utils_namespaceObject.sleep)(200);
|
|
924
|
-
await this.wdaBackend.typeText(text
|
|
925
|
-
delayMs
|
|
926
|
-
});
|
|
912
|
+
await this.wdaBackend.typeText(text);
|
|
927
913
|
await (0, core_utils_namespaceObject.sleep)(300);
|
|
928
914
|
} catch (error) {
|
|
929
915
|
debugDevice(`Failed to type text with WDA: ${error}`);
|
|
@@ -1319,8 +1305,6 @@ const createPlatformActions = (device)=>({
|
|
|
1319
1305
|
sample: {
|
|
1320
1306
|
uri: 'com.apple.Preferences'
|
|
1321
1307
|
},
|
|
1322
|
-
delayBeforeRunner: 0,
|
|
1323
|
-
delayAfterRunner: 0,
|
|
1324
1308
|
call: async (param)=>{
|
|
1325
1309
|
if (!param.uri || '' === param.uri.trim()) throw new Error('Terminate requires a non-empty uri parameter');
|
|
1326
1310
|
await device.terminate(param.uri);
|
|
@@ -1329,8 +1313,6 @@ const createPlatformActions = (device)=>({
|
|
|
1329
1313
|
IOSHomeButton: (0, device_namespaceObject.defineAction)({
|
|
1330
1314
|
name: 'IOSHomeButton',
|
|
1331
1315
|
description: 'Trigger the system "home" operation on iOS devices',
|
|
1332
|
-
delayBeforeRunner: 0,
|
|
1333
|
-
delayAfterRunner: 0,
|
|
1334
1316
|
call: async ()=>{
|
|
1335
1317
|
await device.home();
|
|
1336
1318
|
}
|
|
@@ -1515,7 +1497,7 @@ class IOSMCPServer extends mcp_namespaceObject.BaseMCPServer {
|
|
|
1515
1497
|
constructor(toolsManager){
|
|
1516
1498
|
super({
|
|
1517
1499
|
name: '@midscene/ios-mcp',
|
|
1518
|
-
version: "1.8.5
|
|
1500
|
+
version: "1.8.5",
|
|
1519
1501
|
description: 'Control the iOS device using natural language commands'
|
|
1520
1502
|
}, toolsManager);
|
|
1521
1503
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -227,9 +227,7 @@ export declare class IOSWebDriverClient extends WebDriverClient {
|
|
|
227
227
|
clearActiveElement(): Promise<boolean>;
|
|
228
228
|
private normalizeKeyName;
|
|
229
229
|
dismissKeyboard(keyNames?: string[]): Promise<boolean>;
|
|
230
|
-
typeText(text: string
|
|
231
|
-
delayMs?: number;
|
|
232
|
-
}): Promise<void>;
|
|
230
|
+
typeText(text: string): Promise<void>;
|
|
233
231
|
tap(x: number, y: number): Promise<void>;
|
|
234
232
|
swipe(fromX: number, fromY: number, toX: number, toY: number, duration?: number): Promise<void>;
|
|
235
233
|
pinch(centerX: number, centerY: number, startDistance: number, endDistance: number, duration?: number): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/ios",
|
|
3
|
-
"version": "1.8.5
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@inquirer/prompts": "^7.8.6",
|
|
50
50
|
"open": "10.1.0",
|
|
51
|
-
"@midscene/core": "1.8.5
|
|
52
|
-
"@midscene/
|
|
53
|
-
"@midscene/
|
|
54
|
-
"@midscene/
|
|
51
|
+
"@midscene/core": "1.8.5",
|
|
52
|
+
"@midscene/webdriver": "1.8.5",
|
|
53
|
+
"@midscene/playground": "1.8.5",
|
|
54
|
+
"@midscene/shared": "1.8.5"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@rslib/core": "^0.18.3",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"playground": "DEBUG=midscene:* tsx demo/playground.ts",
|
|
71
71
|
"test": "vitest --run",
|
|
72
72
|
"test:u": "vitest --run -u",
|
|
73
|
-
"test:ai": "AI_TEST_TYPE=iOS
|
|
74
|
-
"test:ai:cache": "MIDSCENE_CACHE=true AI_TEST_TYPE=iOS
|
|
73
|
+
"test:ai": "AI_TEST_TYPE=iOS vitest --run",
|
|
74
|
+
"test:ai:cache": "MIDSCENE_CACHE=true AI_TEST_TYPE=iOS vitest --run"
|
|
75
75
|
}
|
|
76
76
|
}
|
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/596.5426be9e.js"></script><script defer src="/static/js/index.
|
|
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/596.5426be9e.js"></script><script defer src="/static/js/index.ef742dc1.js"></script><link href="/static/css/index.75cf2c82.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|