@midscene/harmony 1.8.4-beta-20260521065716.0 → 1.8.4
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 +6 -3
- package/dist/es/cli.mjs +7 -4
- package/dist/es/index.mjs +6 -3
- package/dist/es/mcp-server.mjs +7 -4
- package/dist/lib/bin.js +6 -3
- package/dist/lib/cli.js +7 -4
- package/dist/lib/index.js +6 -3
- package/dist/lib/mcp-server.js +7 -4
- package/package.json +4 -4
- package/static/index.html +1 -1
- package/static/static/js/{index.c59d69ce.js → index.c3c091dd.js} +58 -46
- package/static/static/js/index.c3c091dd.js.map +1 -0
- package/static/static/js/index.c59d69ce.js.map +0 -1
- /package/static/static/js/{index.c59d69ce.js.LICENSE.txt → index.c3c091dd.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -478,7 +478,7 @@ class device_HarmonyDevice {
|
|
|
478
478
|
const hdc = await this.getHdc();
|
|
479
479
|
await hdc.longClick(point.x, point.y);
|
|
480
480
|
}
|
|
481
|
-
async typeText(text, element, shouldReplace) {
|
|
481
|
+
async typeText(text, element, shouldReplace, options) {
|
|
482
482
|
if (!text) return;
|
|
483
483
|
const hdc = await this.getHdc();
|
|
484
484
|
let x;
|
|
@@ -499,7 +499,8 @@ class device_HarmonyDevice {
|
|
|
499
499
|
await sleep(100);
|
|
500
500
|
}
|
|
501
501
|
await hdc.inputText(x, y, text);
|
|
502
|
-
|
|
502
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
503
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
503
504
|
}
|
|
504
505
|
async clearInput(element) {
|
|
505
506
|
const hdc = await this.getHdc();
|
|
@@ -721,7 +722,9 @@ class device_HarmonyDevice {
|
|
|
721
722
|
},
|
|
722
723
|
keyboard: {
|
|
723
724
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
724
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
725
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
726
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
727
|
+
}),
|
|
725
728
|
clearInput: (target)=>this.clearInput(target),
|
|
726
729
|
cursorMove: async (direction, times = 1)=>{
|
|
727
730
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
package/dist/es/cli.mjs
CHANGED
|
@@ -475,7 +475,7 @@ class HarmonyDevice {
|
|
|
475
475
|
const hdc = await this.getHdc();
|
|
476
476
|
await hdc.longClick(point.x, point.y);
|
|
477
477
|
}
|
|
478
|
-
async typeText(text, element, shouldReplace) {
|
|
478
|
+
async typeText(text, element, shouldReplace, options) {
|
|
479
479
|
if (!text) return;
|
|
480
480
|
const hdc = await this.getHdc();
|
|
481
481
|
let x;
|
|
@@ -496,7 +496,8 @@ class HarmonyDevice {
|
|
|
496
496
|
await sleep(100);
|
|
497
497
|
}
|
|
498
498
|
await hdc.inputText(x, y, text);
|
|
499
|
-
|
|
499
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
500
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
500
501
|
}
|
|
501
502
|
async clearInput(element) {
|
|
502
503
|
const hdc = await this.getHdc();
|
|
@@ -718,7 +719,9 @@ class HarmonyDevice {
|
|
|
718
719
|
},
|
|
719
720
|
keyboard: {
|
|
720
721
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
721
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
722
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
723
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
724
|
+
}),
|
|
722
725
|
clearInput: (target)=>this.clearInput(target),
|
|
723
726
|
cursorMove: async (direction, times = 1)=>{
|
|
724
727
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -991,7 +994,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
991
994
|
const tools = new HarmonyMidsceneTools();
|
|
992
995
|
runToolsCLI(tools, 'midscene-harmony', {
|
|
993
996
|
stripPrefix: 'harmony_',
|
|
994
|
-
version: "1.8.4
|
|
997
|
+
version: "1.8.4",
|
|
995
998
|
extraCommands: createReportCliCommands()
|
|
996
999
|
}).catch((e)=>{
|
|
997
1000
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -446,7 +446,7 @@ class HarmonyDevice {
|
|
|
446
446
|
const hdc = await this.getHdc();
|
|
447
447
|
await hdc.longClick(point.x, point.y);
|
|
448
448
|
}
|
|
449
|
-
async typeText(text, element, shouldReplace) {
|
|
449
|
+
async typeText(text, element, shouldReplace, options) {
|
|
450
450
|
if (!text) return;
|
|
451
451
|
const hdc = await this.getHdc();
|
|
452
452
|
let x;
|
|
@@ -467,7 +467,8 @@ class HarmonyDevice {
|
|
|
467
467
|
await sleep(100);
|
|
468
468
|
}
|
|
469
469
|
await hdc.inputText(x, y, text);
|
|
470
|
-
|
|
470
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
471
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
471
472
|
}
|
|
472
473
|
async clearInput(element) {
|
|
473
474
|
const hdc = await this.getHdc();
|
|
@@ -689,7 +690,9 @@ class HarmonyDevice {
|
|
|
689
690
|
},
|
|
690
691
|
keyboard: {
|
|
691
692
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
692
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
693
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
694
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
695
|
+
}),
|
|
693
696
|
clearInput: (target)=>this.clearInput(target),
|
|
694
697
|
cursorMove: async (direction, times = 1)=>{
|
|
695
698
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
package/dist/es/mcp-server.mjs
CHANGED
|
@@ -475,7 +475,7 @@ class HarmonyDevice {
|
|
|
475
475
|
const hdc = await this.getHdc();
|
|
476
476
|
await hdc.longClick(point.x, point.y);
|
|
477
477
|
}
|
|
478
|
-
async typeText(text, element, shouldReplace) {
|
|
478
|
+
async typeText(text, element, shouldReplace, options) {
|
|
479
479
|
if (!text) return;
|
|
480
480
|
const hdc = await this.getHdc();
|
|
481
481
|
let x;
|
|
@@ -496,7 +496,8 @@ class HarmonyDevice {
|
|
|
496
496
|
await sleep(100);
|
|
497
497
|
}
|
|
498
498
|
await hdc.inputText(x, y, text);
|
|
499
|
-
|
|
499
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
500
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
500
501
|
}
|
|
501
502
|
async clearInput(element) {
|
|
502
503
|
const hdc = await this.getHdc();
|
|
@@ -718,7 +719,9 @@ class HarmonyDevice {
|
|
|
718
719
|
},
|
|
719
720
|
keyboard: {
|
|
720
721
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
721
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
722
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
723
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
724
|
+
}),
|
|
722
725
|
clearInput: (target)=>this.clearInput(target),
|
|
723
726
|
cursorMove: async (direction, times = 1)=>{
|
|
724
727
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -995,7 +998,7 @@ class HarmonyMCPServer extends BaseMCPServer {
|
|
|
995
998
|
constructor(toolsManager){
|
|
996
999
|
super({
|
|
997
1000
|
name: '@midscene/harmony-mcp',
|
|
998
|
-
version: "1.8.4
|
|
1001
|
+
version: "1.8.4",
|
|
999
1002
|
description: 'Control the HarmonyOS device using natural language commands'
|
|
1000
1003
|
}, toolsManager);
|
|
1001
1004
|
}
|
package/dist/lib/bin.js
CHANGED
|
@@ -504,7 +504,7 @@ class device_HarmonyDevice {
|
|
|
504
504
|
const hdc = await this.getHdc();
|
|
505
505
|
await hdc.longClick(point.x, point.y);
|
|
506
506
|
}
|
|
507
|
-
async typeText(text, element, shouldReplace) {
|
|
507
|
+
async typeText(text, element, shouldReplace, options) {
|
|
508
508
|
if (!text) return;
|
|
509
509
|
const hdc = await this.getHdc();
|
|
510
510
|
let x;
|
|
@@ -525,7 +525,8 @@ class device_HarmonyDevice {
|
|
|
525
525
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
526
526
|
}
|
|
527
527
|
await hdc.inputText(x, y, text);
|
|
528
|
-
|
|
528
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
529
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
529
530
|
}
|
|
530
531
|
async clearInput(element) {
|
|
531
532
|
const hdc = await this.getHdc();
|
|
@@ -747,7 +748,9 @@ class device_HarmonyDevice {
|
|
|
747
748
|
},
|
|
748
749
|
keyboard: {
|
|
749
750
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
750
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
751
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
752
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
753
|
+
}),
|
|
751
754
|
clearInput: (target)=>this.clearInput(target),
|
|
752
755
|
cursorMove: async (direction, times = 1)=>{
|
|
753
756
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
package/dist/lib/cli.js
CHANGED
|
@@ -500,7 +500,7 @@ class HarmonyDevice {
|
|
|
500
500
|
const hdc = await this.getHdc();
|
|
501
501
|
await hdc.longClick(point.x, point.y);
|
|
502
502
|
}
|
|
503
|
-
async typeText(text, element, shouldReplace) {
|
|
503
|
+
async typeText(text, element, shouldReplace, options) {
|
|
504
504
|
if (!text) return;
|
|
505
505
|
const hdc = await this.getHdc();
|
|
506
506
|
let x;
|
|
@@ -521,7 +521,8 @@ class HarmonyDevice {
|
|
|
521
521
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
522
522
|
}
|
|
523
523
|
await hdc.inputText(x, y, text);
|
|
524
|
-
|
|
524
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
525
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
525
526
|
}
|
|
526
527
|
async clearInput(element) {
|
|
527
528
|
const hdc = await this.getHdc();
|
|
@@ -743,7 +744,9 @@ class HarmonyDevice {
|
|
|
743
744
|
},
|
|
744
745
|
keyboard: {
|
|
745
746
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
746
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
747
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
748
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
749
|
+
}),
|
|
747
750
|
clearInput: (target)=>this.clearInput(target),
|
|
748
751
|
cursorMove: async (direction, times = 1)=>{
|
|
749
752
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -1016,7 +1019,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1016
1019
|
const tools = new HarmonyMidsceneTools();
|
|
1017
1020
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
|
|
1018
1021
|
stripPrefix: 'harmony_',
|
|
1019
|
-
version: "1.8.4
|
|
1022
|
+
version: "1.8.4",
|
|
1020
1023
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
1021
1024
|
}).catch((e)=>{
|
|
1022
1025
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -483,7 +483,7 @@ class HarmonyDevice {
|
|
|
483
483
|
const hdc = await this.getHdc();
|
|
484
484
|
await hdc.longClick(point.x, point.y);
|
|
485
485
|
}
|
|
486
|
-
async typeText(text, element, shouldReplace) {
|
|
486
|
+
async typeText(text, element, shouldReplace, options) {
|
|
487
487
|
if (!text) return;
|
|
488
488
|
const hdc = await this.getHdc();
|
|
489
489
|
let x;
|
|
@@ -504,7 +504,8 @@ class HarmonyDevice {
|
|
|
504
504
|
await (0, utils_namespaceObject.sleep)(100);
|
|
505
505
|
}
|
|
506
506
|
await hdc.inputText(x, y, text);
|
|
507
|
-
|
|
507
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
508
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
508
509
|
}
|
|
509
510
|
async clearInput(element) {
|
|
510
511
|
const hdc = await this.getHdc();
|
|
@@ -726,7 +727,9 @@ class HarmonyDevice {
|
|
|
726
727
|
},
|
|
727
728
|
keyboard: {
|
|
728
729
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
729
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
730
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
731
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
732
|
+
}),
|
|
730
733
|
clearInput: (target)=>this.clearInput(target),
|
|
731
734
|
cursorMove: async (direction, times = 1)=>{
|
|
732
735
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -516,7 +516,7 @@ class HarmonyDevice {
|
|
|
516
516
|
const hdc = await this.getHdc();
|
|
517
517
|
await hdc.longClick(point.x, point.y);
|
|
518
518
|
}
|
|
519
|
-
async typeText(text, element, shouldReplace) {
|
|
519
|
+
async typeText(text, element, shouldReplace, options) {
|
|
520
520
|
if (!text) return;
|
|
521
521
|
const hdc = await this.getHdc();
|
|
522
522
|
let x;
|
|
@@ -537,7 +537,8 @@ class HarmonyDevice {
|
|
|
537
537
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
538
538
|
}
|
|
539
539
|
await hdc.inputText(x, y, text);
|
|
540
|
-
|
|
540
|
+
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
|
|
541
|
+
if (shouldAutoDismissKeyboard) await this.hideKeyboard();
|
|
541
542
|
}
|
|
542
543
|
async clearInput(element) {
|
|
543
544
|
const hdc = await this.getHdc();
|
|
@@ -759,7 +760,9 @@ class HarmonyDevice {
|
|
|
759
760
|
},
|
|
760
761
|
keyboard: {
|
|
761
762
|
keyboardPress: (keyName)=>this.pressKey(keyName),
|
|
762
|
-
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true
|
|
763
|
+
typeText: (value, opts)=>opts?.focusOnly ? Promise.resolve() : this.typeText(value, opts?.target, opts?.replace ?? true, {
|
|
764
|
+
autoDismissKeyboard: opts?.autoDismissKeyboard
|
|
765
|
+
}),
|
|
763
766
|
clearInput: (target)=>this.clearInput(target),
|
|
764
767
|
cursorMove: async (direction, times = 1)=>{
|
|
765
768
|
const arrowKey = 'left' === direction ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -1036,7 +1039,7 @@ class HarmonyMCPServer extends mcp_namespaceObject.BaseMCPServer {
|
|
|
1036
1039
|
constructor(toolsManager){
|
|
1037
1040
|
super({
|
|
1038
1041
|
name: '@midscene/harmony-mcp',
|
|
1039
|
-
version: "1.8.4
|
|
1042
|
+
version: "1.8.4",
|
|
1040
1043
|
description: 'Control the HarmonyOS device using natural language commands'
|
|
1041
1044
|
}, toolsManager);
|
|
1042
1045
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/harmony",
|
|
3
|
-
"version": "1.8.4
|
|
3
|
+
"version": "1.8.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "^7.8.6",
|
|
48
48
|
"open": "10.1.0",
|
|
49
|
-
"@midscene/
|
|
50
|
-
"@midscene/
|
|
51
|
-
"@midscene/shared": "1.8.4
|
|
49
|
+
"@midscene/core": "1.8.4",
|
|
50
|
+
"@midscene/playground": "1.8.4",
|
|
51
|
+
"@midscene/shared": "1.8.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@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/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.c3c091dd.js"></script><link href="/static/css/index.75cf2c82.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|