@midscene/harmony 1.9.8 → 1.10.1-beta-20260624112700.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/cli.mjs +6 -6
- package/dist/es/index.mjs +5 -5
- package/dist/lib/cli.js +6 -6
- package/dist/lib/index.js +5 -5
- package/dist/types/index.d.ts +4 -4
- package/package.json +4 -9
- package/static/index.html +1 -1
- package/static/static/js/index.9bfbd9ec.js +951 -0
- package/static/static/js/index.9bfbd9ec.js.map +1 -0
- package/dist/es/mcp-server.mjs +0 -1116
- package/dist/lib/mcp-server.js +0 -1167
- package/dist/types/mcp-server.d.ts +0 -217
- package/static/static/js/index.44b83907.js +0 -948
- package/static/static/js/index.44b83907.js.map +0 -1
- /package/static/static/js/{index.44b83907.js.LICENSE.txt → index.9bfbd9ec.js.LICENSE.txt} +0 -0
package/dist/es/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createReportCliCommands, z } from "@midscene/core";
|
|
2
2
|
import { reportCLIError, runToolsCLI } from "@midscene/shared/cli";
|
|
3
|
+
import { agentBehaviorInitArgShape, extractAgentBehaviorInitArgs, getAgentInitArgsSignature, shouldRebuildAgentForInitArgs } from "@midscene/shared/agent-tools/agent-behavior-init-args";
|
|
4
|
+
import { BaseMidsceneTools } from "@midscene/shared/agent-tools/base-tools";
|
|
3
5
|
import { getDebug } from "@midscene/shared/logger";
|
|
4
|
-
import { agentBehaviorInitArgShape, extractAgentBehaviorInitArgs, getAgentInitArgsSignature, shouldRebuildAgentForInitArgs } from "@midscene/shared/mcp/agent-behavior-init-args";
|
|
5
|
-
import { BaseMidsceneTools } from "@midscene/shared/mcp/base-tools";
|
|
6
6
|
import { Agent } from "@midscene/core/agent";
|
|
7
7
|
import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from "@midscene/shared/utils";
|
|
8
8
|
import node_assert from "node:assert";
|
|
@@ -976,7 +976,7 @@ async function agentFromHdcDevice(deviceId, opts) {
|
|
|
976
976
|
await device.connect();
|
|
977
977
|
return new HarmonyAgent(device, opts);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function agent_tools_define_property(obj, key, value) {
|
|
980
980
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
981
981
|
value: value,
|
|
982
982
|
enumerable: true,
|
|
@@ -986,7 +986,7 @@ function mcp_tools_define_property(obj, key, value) {
|
|
|
986
986
|
else obj[key] = value;
|
|
987
987
|
return obj;
|
|
988
988
|
}
|
|
989
|
-
const debug = getDebug('
|
|
989
|
+
const debug = getDebug('agent-tools:harmony');
|
|
990
990
|
function adaptHarmonyInitArgs(extracted) {
|
|
991
991
|
if (!extracted) return;
|
|
992
992
|
const initArgs = {
|
|
@@ -1071,7 +1071,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
1071
1071
|
];
|
|
1072
1072
|
}
|
|
1073
1073
|
constructor(...args){
|
|
1074
|
-
super(...args),
|
|
1074
|
+
super(...args), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
|
|
1075
1075
|
namespace: 'harmony',
|
|
1076
1076
|
shape: {
|
|
1077
1077
|
deviceId: z.string().optional().describe('HarmonyOS device ID (from hdc list targets)'),
|
|
@@ -1087,7 +1087,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
1087
1087
|
const tools = new HarmonyMidsceneTools();
|
|
1088
1088
|
runToolsCLI(tools, 'midscene-harmony', {
|
|
1089
1089
|
stripPrefix: 'harmony_',
|
|
1090
|
-
version: "1.
|
|
1090
|
+
version: "1.10.1-beta-20260624112700.0",
|
|
1091
1091
|
extraCommands: createReportCliCommands()
|
|
1092
1092
|
}).catch((e)=>{
|
|
1093
1093
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -9,8 +9,8 @@ import { mergeAndNormalizeAppNameMapping, normalizeForComparison, repeat } from
|
|
|
9
9
|
import { execFile } from "node:child_process";
|
|
10
10
|
import { promisify } from "node:util";
|
|
11
11
|
import { Agent } from "@midscene/core/agent";
|
|
12
|
-
import { agentBehaviorInitArgShape, extractAgentBehaviorInitArgs, getAgentInitArgsSignature, shouldRebuildAgentForInitArgs } from "@midscene/shared/
|
|
13
|
-
import { BaseMidsceneTools } from "@midscene/shared/
|
|
12
|
+
import { agentBehaviorInitArgShape, extractAgentBehaviorInitArgs, getAgentInitArgsSignature, shouldRebuildAgentForInitArgs } from "@midscene/shared/agent-tools/agent-behavior-init-args";
|
|
13
|
+
import { BaseMidsceneTools } from "@midscene/shared/agent-tools/base-tools";
|
|
14
14
|
import { overrideAIConfig } from "@midscene/shared/env";
|
|
15
15
|
import node_path from "node:path";
|
|
16
16
|
import { select as prompts_select } from "@inquirer/prompts";
|
|
@@ -981,7 +981,7 @@ async function agentFromHdcDevice(deviceId, opts) {
|
|
|
981
981
|
await device.connect();
|
|
982
982
|
return new HarmonyAgent(device, opts);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function agent_tools_define_property(obj, key, value) {
|
|
985
985
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
986
986
|
value: value,
|
|
987
987
|
enumerable: true,
|
|
@@ -991,7 +991,7 @@ function mcp_tools_define_property(obj, key, value) {
|
|
|
991
991
|
else obj[key] = value;
|
|
992
992
|
return obj;
|
|
993
993
|
}
|
|
994
|
-
const debug = getDebug('
|
|
994
|
+
const debug = getDebug('agent-tools:harmony');
|
|
995
995
|
function adaptHarmonyInitArgs(extracted) {
|
|
996
996
|
if (!extracted) return;
|
|
997
997
|
const initArgs = {
|
|
@@ -1076,7 +1076,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
1076
1076
|
];
|
|
1077
1077
|
}
|
|
1078
1078
|
constructor(...args){
|
|
1079
|
-
super(...args),
|
|
1079
|
+
super(...args), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
|
|
1080
1080
|
namespace: 'harmony',
|
|
1081
1081
|
shape: {
|
|
1082
1082
|
deviceId: z.string().optional().describe('HarmonyOS device ID (from hdc list targets)'),
|
package/dist/lib/cli.js
CHANGED
|
@@ -23,9 +23,9 @@ var __webpack_require__ = {};
|
|
|
23
23
|
var __webpack_exports__ = {};
|
|
24
24
|
const core_namespaceObject = require("@midscene/core");
|
|
25
25
|
const cli_namespaceObject = require("@midscene/shared/cli");
|
|
26
|
+
const agent_behavior_init_args_namespaceObject = require("@midscene/shared/agent-tools/agent-behavior-init-args");
|
|
27
|
+
const base_tools_namespaceObject = require("@midscene/shared/agent-tools/base-tools");
|
|
26
28
|
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
27
|
-
const agent_behavior_init_args_namespaceObject = require("@midscene/shared/mcp/agent-behavior-init-args");
|
|
28
|
-
const base_tools_namespaceObject = require("@midscene/shared/mcp/base-tools");
|
|
29
29
|
const agent_namespaceObject = require("@midscene/core/agent");
|
|
30
30
|
const utils_namespaceObject = require("@midscene/shared/utils");
|
|
31
31
|
const defaultAppNameMapping = {
|
|
@@ -1001,7 +1001,7 @@ async function agentFromHdcDevice(deviceId, opts) {
|
|
|
1001
1001
|
await device.connect();
|
|
1002
1002
|
return new HarmonyAgent(device, opts);
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function agent_tools_define_property(obj, key, value) {
|
|
1005
1005
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
1006
1006
|
value: value,
|
|
1007
1007
|
enumerable: true,
|
|
@@ -1011,7 +1011,7 @@ function mcp_tools_define_property(obj, key, value) {
|
|
|
1011
1011
|
else obj[key] = value;
|
|
1012
1012
|
return obj;
|
|
1013
1013
|
}
|
|
1014
|
-
const debug = (0, logger_namespaceObject.getDebug)('
|
|
1014
|
+
const debug = (0, logger_namespaceObject.getDebug)('agent-tools:harmony');
|
|
1015
1015
|
function adaptHarmonyInitArgs(extracted) {
|
|
1016
1016
|
if (!extracted) return;
|
|
1017
1017
|
const initArgs = {
|
|
@@ -1096,7 +1096,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1096
1096
|
];
|
|
1097
1097
|
}
|
|
1098
1098
|
constructor(...args){
|
|
1099
|
-
super(...args),
|
|
1099
|
+
super(...args), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
|
|
1100
1100
|
namespace: 'harmony',
|
|
1101
1101
|
shape: {
|
|
1102
1102
|
deviceId: core_namespaceObject.z.string().optional().describe('HarmonyOS device ID (from hdc list targets)'),
|
|
@@ -1112,7 +1112,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1112
1112
|
const tools = new HarmonyMidsceneTools();
|
|
1113
1113
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
|
|
1114
1114
|
stripPrefix: 'harmony_',
|
|
1115
|
-
version: "1.
|
|
1115
|
+
version: "1.10.1-beta-20260624112700.0",
|
|
1116
1116
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
1117
1117
|
}).catch((e)=>{
|
|
1118
1118
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -1018,9 +1018,9 @@ async function agentFromHdcDevice(deviceId, opts) {
|
|
|
1018
1018
|
await device.connect();
|
|
1019
1019
|
return new HarmonyAgent(device, opts);
|
|
1020
1020
|
}
|
|
1021
|
-
const agent_behavior_init_args_namespaceObject = require("@midscene/shared/
|
|
1022
|
-
const base_tools_namespaceObject = require("@midscene/shared/
|
|
1023
|
-
function
|
|
1021
|
+
const agent_behavior_init_args_namespaceObject = require("@midscene/shared/agent-tools/agent-behavior-init-args");
|
|
1022
|
+
const base_tools_namespaceObject = require("@midscene/shared/agent-tools/base-tools");
|
|
1023
|
+
function agent_tools_define_property(obj, key, value) {
|
|
1024
1024
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
1025
1025
|
value: value,
|
|
1026
1026
|
enumerable: true,
|
|
@@ -1030,7 +1030,7 @@ function mcp_tools_define_property(obj, key, value) {
|
|
|
1030
1030
|
else obj[key] = value;
|
|
1031
1031
|
return obj;
|
|
1032
1032
|
}
|
|
1033
|
-
const debug = (0, logger_namespaceObject.getDebug)('
|
|
1033
|
+
const debug = (0, logger_namespaceObject.getDebug)('agent-tools:harmony');
|
|
1034
1034
|
function adaptHarmonyInitArgs(extracted) {
|
|
1035
1035
|
if (!extracted) return;
|
|
1036
1036
|
const initArgs = {
|
|
@@ -1115,7 +1115,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1115
1115
|
];
|
|
1116
1116
|
}
|
|
1117
1117
|
constructor(...args){
|
|
1118
|
-
super(...args),
|
|
1118
|
+
super(...args), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
|
|
1119
1119
|
namespace: 'harmony',
|
|
1120
1120
|
shape: {
|
|
1121
1121
|
deviceId: core_namespaceObject.z.string().optional().describe('HarmonyOS device ID (from hdc list targets)'),
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,21 +2,21 @@ import { AbstractInterface } from '@midscene/core/device';
|
|
|
2
2
|
import type { ActionParam } from '@midscene/core';
|
|
3
3
|
import type { ActionReturn } from '@midscene/core';
|
|
4
4
|
import { Agent } from '@midscene/core/agent';
|
|
5
|
-
import { AgentBehaviorInitArgs } from '@midscene/shared/
|
|
5
|
+
import { AgentBehaviorInitArgs } from '@midscene/shared/agent-tools/agent-behavior-init-args';
|
|
6
6
|
import { AgentOpt } from '@midscene/core/agent';
|
|
7
|
-
import { BaseMidsceneTools } from '@midscene/shared/
|
|
7
|
+
import { BaseMidsceneTools } from '@midscene/shared/agent-tools/base-tools';
|
|
8
8
|
import { DeviceAction } from '@midscene/core';
|
|
9
9
|
import type { ElementInfo } from '@midscene/shared/extractor';
|
|
10
10
|
import { HarmonyDeviceInputOpt as HarmonyDeviceInputOpt_2 } from '@midscene/core/device';
|
|
11
11
|
import { HarmonyDeviceOpt as HarmonyDeviceOpt_2 } from '@midscene/core/device';
|
|
12
|
-
import { InitArgSpec } from '@midscene/shared/
|
|
12
|
+
import { InitArgSpec } from '@midscene/shared/agent-tools/base-tools';
|
|
13
13
|
import { InterfaceType } from '@midscene/core';
|
|
14
14
|
import { MobileInputPrimitives } from '@midscene/core/device';
|
|
15
15
|
import { overrideAIConfig } from '@midscene/shared/env';
|
|
16
16
|
import { PlaygroundPlatformDescriptor } from '@midscene/playground';
|
|
17
17
|
import { Point } from '@midscene/core';
|
|
18
18
|
import { Size } from '@midscene/core';
|
|
19
|
-
import type { ToolDefinition } from '@midscene/shared/
|
|
19
|
+
import type { ToolDefinition } from '@midscene/shared/agent-tools/types';
|
|
20
20
|
|
|
21
21
|
declare type ActionArgs<T extends DeviceAction> = [ActionParam<T>] extends [undefined] ? [] : [ActionParam<T>];
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/harmony",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1-beta-20260624112700.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -31,11 +31,6 @@
|
|
|
31
31
|
"import": "./dist/es/index.mjs",
|
|
32
32
|
"require": "./dist/lib/index.js"
|
|
33
33
|
},
|
|
34
|
-
"./mcp-server": {
|
|
35
|
-
"types": "./dist/types/mcp-server.d.ts",
|
|
36
|
-
"import": "./dist/es/mcp-server.mjs",
|
|
37
|
-
"require": "./dist/lib/mcp-server.js"
|
|
38
|
-
},
|
|
39
34
|
"./bin": {
|
|
40
35
|
"types": "./dist/types/bin.d.ts",
|
|
41
36
|
"import": "./dist/es/bin.mjs",
|
|
@@ -46,9 +41,9 @@
|
|
|
46
41
|
"dependencies": {
|
|
47
42
|
"@inquirer/prompts": "^7.8.6",
|
|
48
43
|
"open": "10.1.0",
|
|
49
|
-
"@midscene/
|
|
50
|
-
"@midscene/shared": "1.
|
|
51
|
-
"@midscene/
|
|
44
|
+
"@midscene/playground": "1.10.1-beta-20260624112700.0",
|
|
45
|
+
"@midscene/shared": "1.10.1-beta-20260624112700.0",
|
|
46
|
+
"@midscene/core": "1.10.1-beta-20260624112700.0"
|
|
52
47
|
},
|
|
53
48
|
"devDependencies": {
|
|
54
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/905.8d12588e.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/905.8d12588e.js"></script><script defer src="/static/js/index.9bfbd9ec.js"></script><link href="/static/css/index.1293237f.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|