@midscene/harmony 1.9.8-beta-20260618014851.0 → 1.9.8

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 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";
5
3
  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 agent_tools_define_property(obj, key, value) {
979
+ function mcp_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 agent_tools_define_property(obj, key, value) {
986
986
  else obj[key] = value;
987
987
  return obj;
988
988
  }
989
- const debug = getDebug('agent-tools:harmony');
989
+ const debug = getDebug('mcp:harmony-tools');
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), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
1074
+ super(...args), mcp_tools_define_property(this, "lastInitArgsSignature", void 0), mcp_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.9.8-beta-20260618014851.0",
1090
+ version: "1.9.8",
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/agent-tools/agent-behavior-init-args";
13
- import { BaseMidsceneTools } from "@midscene/shared/agent-tools/base-tools";
12
+ import { agentBehaviorInitArgShape, extractAgentBehaviorInitArgs, getAgentInitArgsSignature, shouldRebuildAgentForInitArgs } from "@midscene/shared/mcp/agent-behavior-init-args";
13
+ import { BaseMidsceneTools } from "@midscene/shared/mcp/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 agent_tools_define_property(obj, key, value) {
984
+ function mcp_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 agent_tools_define_property(obj, key, value) {
991
991
  else obj[key] = value;
992
992
  return obj;
993
993
  }
994
- const debug = getDebug('agent-tools:harmony');
994
+ const debug = getDebug('mcp:harmony-tools');
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), agent_tools_define_property(this, "lastInitArgsSignature", void 0), agent_tools_define_property(this, "initArgSpec", {
1079
+ super(...args), mcp_tools_define_property(this, "lastInitArgsSignature", void 0), mcp_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)'),