@midscene/harmony 1.7.5 → 1.7.6-beta-20260423130231.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 +5 -18
- package/dist/es/cli.mjs +6 -19
- package/dist/es/index.mjs +5 -18
- package/dist/es/mcp-server.mjs +6 -19
- package/dist/lib/bin.js +4 -17
- package/dist/lib/cli.js +5 -18
- package/dist/lib/index.js +4 -17
- package/dist/lib/mcp-server.js +5 -18
- package/package.json +4 -4
- package/static/index.html +1 -1
- package/static/static/js/{index.3bea1f00.js → index.40f13c41.js} +44 -40
- package/static/static/js/index.40f13c41.js.map +1 -0
- package/static/static/js/index.3bea1f00.js.map +0 -1
- /package/static/static/js/{index.3bea1f00.js.LICENSE.txt → index.40f13c41.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from
|
|
|
9
9
|
import node_assert from "node:assert";
|
|
10
10
|
import node_fs, { accessSync, constants } from "node:fs";
|
|
11
11
|
import { getMidsceneLocationSchema, z } from "@midscene/core";
|
|
12
|
-
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
12
|
+
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
13
13
|
import { getTmpFile, sleep } from "@midscene/core/utils";
|
|
14
14
|
import { createImgBase64ByFormat } from "@midscene/shared/img";
|
|
15
15
|
import { execFile } from "node:child_process";
|
|
@@ -377,23 +377,10 @@ class device_HarmonyDevice {
|
|
|
377
377
|
await sleep(100);
|
|
378
378
|
}
|
|
379
379
|
}),
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
duration: z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
385
|
-
locate: getMidsceneLocationSchema().describe('The element to be long pressed')
|
|
386
|
-
}),
|
|
387
|
-
sample: {
|
|
388
|
-
locate: {
|
|
389
|
-
prompt: 'the message bubble'
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
call: async (param)=>{
|
|
393
|
-
const element = param.locate;
|
|
394
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
395
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
396
|
-
}
|
|
380
|
+
defineActionLongPress(async (param)=>{
|
|
381
|
+
const element = param.locate;
|
|
382
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
383
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
397
384
|
}),
|
|
398
385
|
defineActionClearInput(async (param)=>{
|
|
399
386
|
await this.clearInput(param.locate);
|
package/dist/es/cli.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { Agent } from "@midscene/core/agent";
|
|
|
6
6
|
import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from "@midscene/shared/utils";
|
|
7
7
|
import node_assert from "node:assert";
|
|
8
8
|
import node_fs, { accessSync, constants } from "node:fs";
|
|
9
|
-
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
9
|
+
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
10
10
|
import { getTmpFile, sleep } from "@midscene/core/utils";
|
|
11
11
|
import { createImgBase64ByFormat } from "@midscene/shared/img";
|
|
12
12
|
import { execFile } from "node:child_process";
|
|
@@ -374,23 +374,10 @@ class HarmonyDevice {
|
|
|
374
374
|
await sleep(100);
|
|
375
375
|
}
|
|
376
376
|
}),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
duration: z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
382
|
-
locate: getMidsceneLocationSchema().describe('The element to be long pressed')
|
|
383
|
-
}),
|
|
384
|
-
sample: {
|
|
385
|
-
locate: {
|
|
386
|
-
prompt: 'the message bubble'
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
call: async (param)=>{
|
|
390
|
-
const element = param.locate;
|
|
391
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
392
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
393
|
-
}
|
|
377
|
+
defineActionLongPress(async (param)=>{
|
|
378
|
+
const element = param.locate;
|
|
379
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
380
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
394
381
|
}),
|
|
395
382
|
defineActionClearInput(async (param)=>{
|
|
396
383
|
await this.clearInput(param.locate);
|
|
@@ -1012,7 +999,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
1012
999
|
const tools = new HarmonyMidsceneTools();
|
|
1013
1000
|
runToolsCLI(tools, 'midscene-harmony', {
|
|
1014
1001
|
stripPrefix: 'harmony_',
|
|
1015
|
-
version: "1.7.
|
|
1002
|
+
version: "1.7.6-beta-20260423130231.0",
|
|
1016
1003
|
extraCommands: createReportCliCommands()
|
|
1017
1004
|
}).catch((e)=>{
|
|
1018
1005
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import node_assert from "node:assert";
|
|
2
2
|
import node_fs, { accessSync, constants } from "node:fs";
|
|
3
3
|
import { getMidsceneLocationSchema, z } from "@midscene/core";
|
|
4
|
-
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
4
|
+
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
5
5
|
import { getTmpFile, sleep } from "@midscene/core/utils";
|
|
6
6
|
import { createImgBase64ByFormat } from "@midscene/shared/img";
|
|
7
7
|
import { getDebug } from "@midscene/shared/logger";
|
|
@@ -345,23 +345,10 @@ class HarmonyDevice {
|
|
|
345
345
|
await sleep(100);
|
|
346
346
|
}
|
|
347
347
|
}),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
duration: z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
353
|
-
locate: getMidsceneLocationSchema().describe('The element to be long pressed')
|
|
354
|
-
}),
|
|
355
|
-
sample: {
|
|
356
|
-
locate: {
|
|
357
|
-
prompt: 'the message bubble'
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
call: async (param)=>{
|
|
361
|
-
const element = param.locate;
|
|
362
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
363
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
364
|
-
}
|
|
348
|
+
defineActionLongPress(async (param)=>{
|
|
349
|
+
const element = param.locate;
|
|
350
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
351
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
365
352
|
}),
|
|
366
353
|
defineActionClearInput(async (param)=>{
|
|
367
354
|
await this.clearInput(param.locate);
|
package/dist/es/mcp-server.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { Agent } from "@midscene/core/agent";
|
|
|
6
6
|
import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from "@midscene/shared/utils";
|
|
7
7
|
import node_assert from "node:assert";
|
|
8
8
|
import node_fs, { accessSync, constants } from "node:fs";
|
|
9
|
-
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
9
|
+
import { defineAction, defineActionClearInput, defineActionCursorMove, defineActionDoubleClick, defineActionDragAndDrop, defineActionKeyboardPress, defineActionLongPress, defineActionScroll, defineActionSwipe, defineActionTap, normalizeMobileSwipeParam } from "@midscene/core/device";
|
|
10
10
|
import { getTmpFile, sleep } from "@midscene/core/utils";
|
|
11
11
|
import { createImgBase64ByFormat } from "@midscene/shared/img";
|
|
12
12
|
import { execFile } from "node:child_process";
|
|
@@ -374,23 +374,10 @@ class HarmonyDevice {
|
|
|
374
374
|
await sleep(100);
|
|
375
375
|
}
|
|
376
376
|
}),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
duration: z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
382
|
-
locate: getMidsceneLocationSchema().describe('The element to be long pressed')
|
|
383
|
-
}),
|
|
384
|
-
sample: {
|
|
385
|
-
locate: {
|
|
386
|
-
prompt: 'the message bubble'
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
call: async (param)=>{
|
|
390
|
-
const element = param.locate;
|
|
391
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
392
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
393
|
-
}
|
|
377
|
+
defineActionLongPress(async (param)=>{
|
|
378
|
+
const element = param.locate;
|
|
379
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
380
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
394
381
|
}),
|
|
395
382
|
defineActionClearInput(async (param)=>{
|
|
396
383
|
await this.clearInput(param.locate);
|
|
@@ -1016,7 +1003,7 @@ class HarmonyMCPServer extends BaseMCPServer {
|
|
|
1016
1003
|
constructor(toolsManager){
|
|
1017
1004
|
super({
|
|
1018
1005
|
name: '@midscene/harmony-mcp',
|
|
1019
|
-
version: "1.7.
|
|
1006
|
+
version: "1.7.6-beta-20260423130231.0",
|
|
1020
1007
|
description: 'Control the HarmonyOS device using natural language commands'
|
|
1021
1008
|
}, toolsManager);
|
|
1022
1009
|
}
|
package/dist/lib/bin.js
CHANGED
|
@@ -403,23 +403,10 @@ class device_HarmonyDevice {
|
|
|
403
403
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
404
404
|
}
|
|
405
405
|
}),
|
|
406
|
-
(0, device_namespaceObject.
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
411
|
-
locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
|
|
412
|
-
}),
|
|
413
|
-
sample: {
|
|
414
|
-
locate: {
|
|
415
|
-
prompt: 'the message bubble'
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
call: async (param)=>{
|
|
419
|
-
const element = param.locate;
|
|
420
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
421
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
422
|
-
}
|
|
406
|
+
(0, device_namespaceObject.defineActionLongPress)(async (param)=>{
|
|
407
|
+
const element = param.locate;
|
|
408
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
409
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
423
410
|
}),
|
|
424
411
|
(0, device_namespaceObject.defineActionClearInput)(async (param)=>{
|
|
425
412
|
await this.clearInput(param.locate);
|
package/dist/lib/cli.js
CHANGED
|
@@ -399,23 +399,10 @@ class HarmonyDevice {
|
|
|
399
399
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
400
400
|
}
|
|
401
401
|
}),
|
|
402
|
-
(0, device_namespaceObject.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
407
|
-
locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
|
|
408
|
-
}),
|
|
409
|
-
sample: {
|
|
410
|
-
locate: {
|
|
411
|
-
prompt: 'the message bubble'
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
call: async (param)=>{
|
|
415
|
-
const element = param.locate;
|
|
416
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
417
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
418
|
-
}
|
|
402
|
+
(0, device_namespaceObject.defineActionLongPress)(async (param)=>{
|
|
403
|
+
const element = param.locate;
|
|
404
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
405
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
419
406
|
}),
|
|
420
407
|
(0, device_namespaceObject.defineActionClearInput)(async (param)=>{
|
|
421
408
|
await this.clearInput(param.locate);
|
|
@@ -1037,7 +1024,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1037
1024
|
const tools = new HarmonyMidsceneTools();
|
|
1038
1025
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
|
|
1039
1026
|
stripPrefix: 'harmony_',
|
|
1040
|
-
version: "1.7.
|
|
1027
|
+
version: "1.7.6-beta-20260423130231.0",
|
|
1041
1028
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
1042
1029
|
}).catch((e)=>{
|
|
1043
1030
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -382,23 +382,10 @@ class HarmonyDevice {
|
|
|
382
382
|
await (0, utils_namespaceObject.sleep)(100);
|
|
383
383
|
}
|
|
384
384
|
}),
|
|
385
|
-
(0, device_namespaceObject.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
390
|
-
locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
|
|
391
|
-
}),
|
|
392
|
-
sample: {
|
|
393
|
-
locate: {
|
|
394
|
-
prompt: 'the message bubble'
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
call: async (param)=>{
|
|
398
|
-
const element = param.locate;
|
|
399
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
400
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
401
|
-
}
|
|
385
|
+
(0, device_namespaceObject.defineActionLongPress)(async (param)=>{
|
|
386
|
+
const element = param.locate;
|
|
387
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
388
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
402
389
|
}),
|
|
403
390
|
(0, device_namespaceObject.defineActionClearInput)(async (param)=>{
|
|
404
391
|
await this.clearInput(param.locate);
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -415,23 +415,10 @@ class HarmonyDevice {
|
|
|
415
415
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
416
416
|
}
|
|
417
417
|
}),
|
|
418
|
-
(0, device_namespaceObject.
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
duration: core_namespaceObject.z.number().optional().describe('The duration of the long press in milliseconds'),
|
|
423
|
-
locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed')
|
|
424
|
-
}),
|
|
425
|
-
sample: {
|
|
426
|
-
locate: {
|
|
427
|
-
prompt: 'the message bubble'
|
|
428
|
-
}
|
|
429
|
-
},
|
|
430
|
-
call: async (param)=>{
|
|
431
|
-
const element = param.locate;
|
|
432
|
-
if (!element) throw new Error('LongPress requires an element to be located');
|
|
433
|
-
await this.longPress(element.center[0], element.center[1]);
|
|
434
|
-
}
|
|
418
|
+
(0, device_namespaceObject.defineActionLongPress)(async (param)=>{
|
|
419
|
+
const element = param.locate;
|
|
420
|
+
if (!element) throw new Error('LongPress requires an element to be located');
|
|
421
|
+
await this.longPress(element.center[0], element.center[1]);
|
|
435
422
|
}),
|
|
436
423
|
(0, device_namespaceObject.defineActionClearInput)(async (param)=>{
|
|
437
424
|
await this.clearInput(param.locate);
|
|
@@ -1057,7 +1044,7 @@ class HarmonyMCPServer extends mcp_namespaceObject.BaseMCPServer {
|
|
|
1057
1044
|
constructor(toolsManager){
|
|
1058
1045
|
super({
|
|
1059
1046
|
name: '@midscene/harmony-mcp',
|
|
1060
|
-
version: "1.7.
|
|
1047
|
+
version: "1.7.6-beta-20260423130231.0",
|
|
1061
1048
|
description: 'Control the HarmonyOS device using natural language commands'
|
|
1062
1049
|
}, toolsManager);
|
|
1063
1050
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/harmony",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6-beta-20260423130231.0",
|
|
4
4
|
"description": "HarmonyOS automation library for Midscene",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HarmonyOS UI automation",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@inquirer/prompts": "^7.8.6",
|
|
43
43
|
"open": "10.1.0",
|
|
44
|
-
"@midscene/playground": "1.7.
|
|
45
|
-
"@midscene/core": "1.7.
|
|
46
|
-
"@midscene/shared": "1.7.
|
|
44
|
+
"@midscene/playground": "1.7.6-beta-20260423130231.0",
|
|
45
|
+
"@midscene/core": "1.7.6-beta-20260423130231.0",
|
|
46
|
+
"@midscene/shared": "1.7.6-beta-20260423130231.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@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/883.516361ae.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/883.516361ae.js"></script><script defer src="/static/js/index.40f13c41.js"></script><link href="/static/css/index.dc500f18.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|