@midscene/harmony 1.7.6-beta-20260425023224.0 → 1.7.6

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
@@ -949,12 +949,10 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
949
949
  }
950
950
  if (this.agent) return this.agent;
951
951
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
952
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
952
+ const reportOptions = this.readCliReportAgentOptions();
953
953
  const agent = await agentFromHdcDevice(deviceId, {
954
954
  autoDismissKeyboard: false,
955
- ...reportFileName ? {
956
- reportFileName
957
- } : {}
955
+ ...reportOptions ?? {}
958
956
  });
959
957
  this.agent = agent;
960
958
  return agent;
@@ -968,8 +966,8 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
968
966
  cli: this.getAgentInitArgCliMetadata(),
969
967
  handler: async (args)=>{
970
968
  const deviceId = this.extractAgentInitParam(args);
971
- const reportSession = this.createNewCliReportSession();
972
- this.pendingReportFileName = reportSession?.reportFileName;
969
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
970
+ this.commitCliReportSession(reportSession);
973
971
  if (this.agent) {
974
972
  try {
975
973
  await this.agent.destroy?.();
@@ -978,13 +976,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
978
976
  }
979
977
  this.agent = void 0;
980
978
  }
981
- let agent;
982
- try {
983
- agent = await this.ensureAgent(deviceId);
984
- } finally{
985
- this.pendingReportFileName = void 0;
986
- }
987
- this.commitCliReportSession(reportSession);
979
+ const agent = await this.ensureAgent(deviceId);
988
980
  const screenshot = await agent.page.screenshotBase64();
989
981
  return {
990
982
  content: [
@@ -1007,7 +999,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
1007
999
  ];
1008
1000
  }
1009
1001
  constructor(...args){
1010
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1002
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1011
1003
  namespace: 'harmony',
1012
1004
  shape: {
1013
1005
  deviceId: z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -1022,7 +1014,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
1022
1014
  const tools = new HarmonyMidsceneTools();
1023
1015
  runToolsCLI(tools, 'midscene-harmony', {
1024
1016
  stripPrefix: 'harmony_',
1025
- version: "1.7.6-beta-20260425023224.0",
1017
+ version: "1.7.6",
1026
1018
  extraCommands: createReportCliCommands()
1027
1019
  }).catch((e)=>{
1028
1020
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -954,12 +954,10 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
954
954
  }
955
955
  if (this.agent) return this.agent;
956
956
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
957
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
957
+ const reportOptions = this.readCliReportAgentOptions();
958
958
  const agent = await agentFromHdcDevice(deviceId, {
959
959
  autoDismissKeyboard: false,
960
- ...reportFileName ? {
961
- reportFileName
962
- } : {}
960
+ ...reportOptions ?? {}
963
961
  });
964
962
  this.agent = agent;
965
963
  return agent;
@@ -973,8 +971,8 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
973
971
  cli: this.getAgentInitArgCliMetadata(),
974
972
  handler: async (args)=>{
975
973
  const deviceId = this.extractAgentInitParam(args);
976
- const reportSession = this.createNewCliReportSession();
977
- this.pendingReportFileName = reportSession?.reportFileName;
974
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
975
+ this.commitCliReportSession(reportSession);
978
976
  if (this.agent) {
979
977
  try {
980
978
  await this.agent.destroy?.();
@@ -983,13 +981,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
983
981
  }
984
982
  this.agent = void 0;
985
983
  }
986
- let agent;
987
- try {
988
- agent = await this.ensureAgent(deviceId);
989
- } finally{
990
- this.pendingReportFileName = void 0;
991
- }
992
- this.commitCliReportSession(reportSession);
984
+ const agent = await this.ensureAgent(deviceId);
993
985
  const screenshot = await agent.page.screenshotBase64();
994
986
  return {
995
987
  content: [
@@ -1012,7 +1004,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
1012
1004
  ];
1013
1005
  }
1014
1006
  constructor(...args){
1015
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1007
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1016
1008
  namespace: 'harmony',
1017
1009
  shape: {
1018
1010
  deviceId: z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -949,12 +949,10 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
949
949
  }
950
950
  if (this.agent) return this.agent;
951
951
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
952
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
952
+ const reportOptions = this.readCliReportAgentOptions();
953
953
  const agent = await agentFromHdcDevice(deviceId, {
954
954
  autoDismissKeyboard: false,
955
- ...reportFileName ? {
956
- reportFileName
957
- } : {}
955
+ ...reportOptions ?? {}
958
956
  });
959
957
  this.agent = agent;
960
958
  return agent;
@@ -968,8 +966,8 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
968
966
  cli: this.getAgentInitArgCliMetadata(),
969
967
  handler: async (args)=>{
970
968
  const deviceId = this.extractAgentInitParam(args);
971
- const reportSession = this.createNewCliReportSession();
972
- this.pendingReportFileName = reportSession?.reportFileName;
969
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
970
+ this.commitCliReportSession(reportSession);
973
971
  if (this.agent) {
974
972
  try {
975
973
  await this.agent.destroy?.();
@@ -978,13 +976,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
978
976
  }
979
977
  this.agent = void 0;
980
978
  }
981
- let agent;
982
- try {
983
- agent = await this.ensureAgent(deviceId);
984
- } finally{
985
- this.pendingReportFileName = void 0;
986
- }
987
- this.commitCliReportSession(reportSession);
979
+ const agent = await this.ensureAgent(deviceId);
988
980
  const screenshot = await agent.page.screenshotBase64();
989
981
  return {
990
982
  content: [
@@ -1007,7 +999,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
1007
999
  ];
1008
1000
  }
1009
1001
  constructor(...args){
1010
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1002
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1011
1003
  namespace: 'harmony',
1012
1004
  shape: {
1013
1005
  deviceId: z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -1026,7 +1018,7 @@ class HarmonyMCPServer extends BaseMCPServer {
1026
1018
  constructor(toolsManager){
1027
1019
  super({
1028
1020
  name: '@midscene/harmony-mcp',
1029
- version: "1.7.6-beta-20260425023224.0",
1021
+ version: "1.7.6",
1030
1022
  description: 'Control the HarmonyOS device using natural language commands'
1031
1023
  }, toolsManager);
1032
1024
  }
package/dist/lib/cli.js CHANGED
@@ -974,12 +974,10 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
974
974
  }
975
975
  if (this.agent) return this.agent;
976
976
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
977
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
977
+ const reportOptions = this.readCliReportAgentOptions();
978
978
  const agent = await agentFromHdcDevice(deviceId, {
979
979
  autoDismissKeyboard: false,
980
- ...reportFileName ? {
981
- reportFileName
982
- } : {}
980
+ ...reportOptions ?? {}
983
981
  });
984
982
  this.agent = agent;
985
983
  return agent;
@@ -993,8 +991,8 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
993
991
  cli: this.getAgentInitArgCliMetadata(),
994
992
  handler: async (args)=>{
995
993
  const deviceId = this.extractAgentInitParam(args);
996
- const reportSession = this.createNewCliReportSession();
997
- this.pendingReportFileName = reportSession?.reportFileName;
994
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
995
+ this.commitCliReportSession(reportSession);
998
996
  if (this.agent) {
999
997
  try {
1000
998
  await this.agent.destroy?.();
@@ -1003,13 +1001,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1003
1001
  }
1004
1002
  this.agent = void 0;
1005
1003
  }
1006
- let agent;
1007
- try {
1008
- agent = await this.ensureAgent(deviceId);
1009
- } finally{
1010
- this.pendingReportFileName = void 0;
1011
- }
1012
- this.commitCliReportSession(reportSession);
1004
+ const agent = await this.ensureAgent(deviceId);
1013
1005
  const screenshot = await agent.page.screenshotBase64();
1014
1006
  return {
1015
1007
  content: [
@@ -1032,7 +1024,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1032
1024
  ];
1033
1025
  }
1034
1026
  constructor(...args){
1035
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1027
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1036
1028
  namespace: 'harmony',
1037
1029
  shape: {
1038
1030
  deviceId: core_namespaceObject.z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -1047,7 +1039,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1047
1039
  const tools = new HarmonyMidsceneTools();
1048
1040
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
1049
1041
  stripPrefix: 'harmony_',
1050
- version: "1.7.6-beta-20260425023224.0",
1042
+ version: "1.7.6",
1051
1043
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
1052
1044
  }).catch((e)=>{
1053
1045
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -993,12 +993,10 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
993
993
  }
994
994
  if (this.agent) return this.agent;
995
995
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
996
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
996
+ const reportOptions = this.readCliReportAgentOptions();
997
997
  const agent = await agentFromHdcDevice(deviceId, {
998
998
  autoDismissKeyboard: false,
999
- ...reportFileName ? {
1000
- reportFileName
1001
- } : {}
999
+ ...reportOptions ?? {}
1002
1000
  });
1003
1001
  this.agent = agent;
1004
1002
  return agent;
@@ -1012,8 +1010,8 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1012
1010
  cli: this.getAgentInitArgCliMetadata(),
1013
1011
  handler: async (args)=>{
1014
1012
  const deviceId = this.extractAgentInitParam(args);
1015
- const reportSession = this.createNewCliReportSession();
1016
- this.pendingReportFileName = reportSession?.reportFileName;
1013
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1014
+ this.commitCliReportSession(reportSession);
1017
1015
  if (this.agent) {
1018
1016
  try {
1019
1017
  await this.agent.destroy?.();
@@ -1022,13 +1020,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1022
1020
  }
1023
1021
  this.agent = void 0;
1024
1022
  }
1025
- let agent;
1026
- try {
1027
- agent = await this.ensureAgent(deviceId);
1028
- } finally{
1029
- this.pendingReportFileName = void 0;
1030
- }
1031
- this.commitCliReportSession(reportSession);
1023
+ const agent = await this.ensureAgent(deviceId);
1032
1024
  const screenshot = await agent.page.screenshotBase64();
1033
1025
  return {
1034
1026
  content: [
@@ -1051,7 +1043,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1051
1043
  ];
1052
1044
  }
1053
1045
  constructor(...args){
1054
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1046
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1055
1047
  namespace: 'harmony',
1056
1048
  shape: {
1057
1049
  deviceId: core_namespaceObject.z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -990,12 +990,10 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
990
990
  }
991
991
  if (this.agent) return this.agent;
992
992
  debug('Creating Harmony agent with deviceId:', deviceId || 'auto-detect');
993
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
993
+ const reportOptions = this.readCliReportAgentOptions();
994
994
  const agent = await agentFromHdcDevice(deviceId, {
995
995
  autoDismissKeyboard: false,
996
- ...reportFileName ? {
997
- reportFileName
998
- } : {}
996
+ ...reportOptions ?? {}
999
997
  });
1000
998
  this.agent = agent;
1001
999
  return agent;
@@ -1009,8 +1007,8 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1009
1007
  cli: this.getAgentInitArgCliMetadata(),
1010
1008
  handler: async (args)=>{
1011
1009
  const deviceId = this.extractAgentInitParam(args);
1012
- const reportSession = this.createNewCliReportSession();
1013
- this.pendingReportFileName = reportSession?.reportFileName;
1010
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1011
+ this.commitCliReportSession(reportSession);
1014
1012
  if (this.agent) {
1015
1013
  try {
1016
1014
  await this.agent.destroy?.();
@@ -1019,13 +1017,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1019
1017
  }
1020
1018
  this.agent = void 0;
1021
1019
  }
1022
- let agent;
1023
- try {
1024
- agent = await this.ensureAgent(deviceId);
1025
- } finally{
1026
- this.pendingReportFileName = void 0;
1027
- }
1028
- this.commitCliReportSession(reportSession);
1020
+ const agent = await this.ensureAgent(deviceId);
1029
1021
  const screenshot = await agent.page.screenshotBase64();
1030
1022
  return {
1031
1023
  content: [
@@ -1048,7 +1040,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
1048
1040
  ];
1049
1041
  }
1050
1042
  constructor(...args){
1051
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1043
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
1052
1044
  namespace: 'harmony',
1053
1045
  shape: {
1054
1046
  deviceId: core_namespaceObject.z.string().optional().describe('HarmonyOS device ID (from hdc list targets)')
@@ -1067,7 +1059,7 @@ class HarmonyMCPServer extends mcp_namespaceObject.BaseMCPServer {
1067
1059
  constructor(toolsManager){
1068
1060
  super({
1069
1061
  name: '@midscene/harmony-mcp',
1070
- version: "1.7.6-beta-20260425023224.0",
1062
+ version: "1.7.6",
1071
1063
  description: 'Control the HarmonyOS device using natural language commands'
1072
1064
  }, toolsManager);
1073
1065
  }
@@ -114,7 +114,6 @@ declare interface HarmonyDeviceInfo {
114
114
 
115
115
  export declare class HarmonyMidsceneTools extends BaseMidsceneTools<HarmonyAgent, string> {
116
116
  protected getCliReportSessionName(): string;
117
- private pendingReportFileName?;
118
117
  protected readonly initArgSpec: InitArgSpec<string>;
119
118
  protected createTemporaryDevice(): HarmonyDevice;
120
119
  protected ensureAgent(deviceId?: string): Promise<HarmonyAgent>;
@@ -113,7 +113,6 @@ export declare class HarmonyMCPServer extends BaseMCPServer {
113
113
 
114
114
  declare class HarmonyMidsceneTools extends BaseMidsceneTools<HarmonyAgent, string> {
115
115
  protected getCliReportSessionName(): string;
116
- private pendingReportFileName?;
117
116
  protected readonly initArgSpec: InitArgSpec<string>;
118
117
  protected createTemporaryDevice(): HarmonyDevice;
119
118
  protected ensureAgent(deviceId?: string): Promise<HarmonyAgent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/harmony",
3
- "version": "1.7.6-beta-20260425023224.0",
3
+ "version": "1.7.6",
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.6-beta-20260425023224.0",
45
- "@midscene/shared": "1.7.6-beta-20260425023224.0",
46
- "@midscene/core": "1.7.6-beta-20260425023224.0"
44
+ "@midscene/core": "1.7.6",
45
+ "@midscene/playground": "1.7.6",
46
+ "@midscene/shared": "1.7.6"
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.bfac9a93.js"></script><link href="/static/css/index.dc500f18.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
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.8f7b788e.js"></script><link href="/static/css/index.dc500f18.css" rel="stylesheet"></head><body><div id="root"></div></body></html>