@midscene/harmony 1.5.5-beta-20260313092855.0 → 1.5.5

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 CHANGED
@@ -200,10 +200,11 @@ class HdcClient {
200
200
  }
201
201
  async getScreenInfo() {
202
202
  const stdout = await this.shell('hidumper -s RenderService -a screen');
203
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
203
204
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
204
205
  if (activeFoldMatch) {
205
206
  const activeId = activeFoldMatch[1];
206
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
207
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
207
208
  const screenMatch = stdout.match(screenRegex);
208
209
  if (screenMatch) {
209
210
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -213,7 +214,7 @@ class HdcClient {
213
214
  };
214
215
  }
215
216
  }
216
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
217
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
217
218
  if (renderSizeMatch) return {
218
219
  width: Number.parseInt(renderSizeMatch[1], 10),
219
220
  height: Number.parseInt(renderSizeMatch[2], 10)
package/dist/es/cli.mjs CHANGED
@@ -197,10 +197,11 @@ class HdcClient {
197
197
  }
198
198
  async getScreenInfo() {
199
199
  const stdout = await this.shell('hidumper -s RenderService -a screen');
200
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
200
201
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
201
202
  if (activeFoldMatch) {
202
203
  const activeId = activeFoldMatch[1];
203
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
204
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
204
205
  const screenMatch = stdout.match(screenRegex);
205
206
  if (screenMatch) {
206
207
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -210,7 +211,7 @@ class HdcClient {
210
211
  };
211
212
  }
212
213
  }
213
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
214
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
214
215
  if (renderSizeMatch) return {
215
216
  width: Number.parseInt(renderSizeMatch[1], 10),
216
217
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -951,7 +952,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
951
952
  const tools = new HarmonyMidsceneTools();
952
953
  runToolsCLI(tools, 'midscene-harmony', {
953
954
  stripPrefix: 'harmony_',
954
- version: "1.5.5-beta-20260313092855.0"
955
+ version: "1.5.5"
955
956
  }).catch((e)=>{
956
957
  if (!(e instanceof CLIError)) console.error(e);
957
958
  process.exit(e instanceof CLIError ? e.exitCode : 1);
package/dist/es/index.mjs CHANGED
@@ -164,10 +164,11 @@ class HdcClient {
164
164
  }
165
165
  async getScreenInfo() {
166
166
  const stdout = await this.shell('hidumper -s RenderService -a screen');
167
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
167
168
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
168
169
  if (activeFoldMatch) {
169
170
  const activeId = activeFoldMatch[1];
170
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
171
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
171
172
  const screenMatch = stdout.match(screenRegex);
172
173
  if (screenMatch) {
173
174
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -177,7 +178,7 @@ class HdcClient {
177
178
  };
178
179
  }
179
180
  }
180
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
181
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
181
182
  if (renderSizeMatch) return {
182
183
  width: Number.parseInt(renderSizeMatch[1], 10),
183
184
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -196,10 +196,11 @@ class HdcClient {
196
196
  }
197
197
  async getScreenInfo() {
198
198
  const stdout = await this.shell('hidumper -s RenderService -a screen');
199
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
199
200
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
200
201
  if (activeFoldMatch) {
201
202
  const activeId = activeFoldMatch[1];
202
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
203
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
203
204
  const screenMatch = stdout.match(screenRegex);
204
205
  if (screenMatch) {
205
206
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -209,7 +210,7 @@ class HdcClient {
209
210
  };
210
211
  }
211
212
  }
212
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
213
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
213
214
  if (renderSizeMatch) return {
214
215
  width: Number.parseInt(renderSizeMatch[1], 10),
215
216
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -954,7 +955,7 @@ class HarmonyMCPServer extends BaseMCPServer {
954
955
  constructor(toolsManager){
955
956
  super({
956
957
  name: '@midscene/harmony-mcp',
957
- version: "1.5.5-beta-20260313092855.0",
958
+ version: "1.5.5",
958
959
  description: 'Control the HarmonyOS device using natural language commands'
959
960
  }, toolsManager);
960
961
  }
package/dist/lib/bin.js CHANGED
@@ -226,10 +226,11 @@ class HdcClient {
226
226
  }
227
227
  async getScreenInfo() {
228
228
  const stdout = await this.shell('hidumper -s RenderService -a screen');
229
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
229
230
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
230
231
  if (activeFoldMatch) {
231
232
  const activeId = activeFoldMatch[1];
232
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
233
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
233
234
  const screenMatch = stdout.match(screenRegex);
234
235
  if (screenMatch) {
235
236
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -239,7 +240,7 @@ class HdcClient {
239
240
  };
240
241
  }
241
242
  }
242
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
243
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
243
244
  if (renderSizeMatch) return {
244
245
  width: Number.parseInt(renderSizeMatch[1], 10),
245
246
  height: Number.parseInt(renderSizeMatch[2], 10)
package/dist/lib/cli.js CHANGED
@@ -222,10 +222,11 @@ class HdcClient {
222
222
  }
223
223
  async getScreenInfo() {
224
224
  const stdout = await this.shell('hidumper -s RenderService -a screen');
225
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
225
226
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
226
227
  if (activeFoldMatch) {
227
228
  const activeId = activeFoldMatch[1];
228
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
229
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
229
230
  const screenMatch = stdout.match(screenRegex);
230
231
  if (screenMatch) {
231
232
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -235,7 +236,7 @@ class HdcClient {
235
236
  };
236
237
  }
237
238
  }
238
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
239
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
239
240
  if (renderSizeMatch) return {
240
241
  width: Number.parseInt(renderSizeMatch[1], 10),
241
242
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -976,7 +977,7 @@ class HarmonyMidsceneTools extends mcp_namespaceObject.BaseMidsceneTools {
976
977
  const tools = new HarmonyMidsceneTools();
977
978
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
978
979
  stripPrefix: 'harmony_',
979
- version: "1.5.5-beta-20260313092855.0"
980
+ version: "1.5.5"
980
981
  }).catch((e)=>{
981
982
  if (!(e instanceof cli_namespaceObject.CLIError)) console.error(e);
982
983
  process.exit(e instanceof cli_namespaceObject.CLIError ? e.exitCode : 1);
package/dist/lib/index.js CHANGED
@@ -205,10 +205,11 @@ class HdcClient {
205
205
  }
206
206
  async getScreenInfo() {
207
207
  const stdout = await this.shell('hidumper -s RenderService -a screen');
208
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
208
209
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
209
210
  if (activeFoldMatch) {
210
211
  const activeId = activeFoldMatch[1];
211
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
212
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
212
213
  const screenMatch = stdout.match(screenRegex);
213
214
  if (screenMatch) {
214
215
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -218,7 +219,7 @@ class HdcClient {
218
219
  };
219
220
  }
220
221
  }
221
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
222
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
222
223
  if (renderSizeMatch) return {
223
224
  width: Number.parseInt(renderSizeMatch[1], 10),
224
225
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -237,10 +237,11 @@ class HdcClient {
237
237
  }
238
238
  async getScreenInfo() {
239
239
  const stdout = await this.shell('hidumper -s RenderService -a screen');
240
+ const renderDimensionPattern = 'render\\s+(?:size|resolution)\\s*[:=]\\s*(\\d{3,5})x(\\d{3,5})';
240
241
  const activeFoldMatch = stdout.match(/foldScreenId:(\d+),\s*isConnected:\d+,\s*isPowerOn:1/);
241
242
  if (activeFoldMatch) {
242
243
  const activeId = activeFoldMatch[1];
243
- const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?render size:\\s*(\\d{3,5})x(\\d{3,5})`);
244
+ const screenRegex = new RegExp(`screen\\[\\d+\\]:\\s*id=${activeId},.*?${renderDimensionPattern}`);
244
245
  const screenMatch = stdout.match(screenRegex);
245
246
  if (screenMatch) {
246
247
  debugHdc(`Foldable screen detected, active screen id=${activeId}: ${screenMatch[1]}x${screenMatch[2]}`);
@@ -250,7 +251,7 @@ class HdcClient {
250
251
  };
251
252
  }
252
253
  }
253
- const renderSizeMatch = stdout.match(/render size:\s*(\d{3,5})x(\d{3,5})/);
254
+ const renderSizeMatch = stdout.match(new RegExp(renderDimensionPattern));
254
255
  if (renderSizeMatch) return {
255
256
  width: Number.parseInt(renderSizeMatch[1], 10),
256
257
  height: Number.parseInt(renderSizeMatch[2], 10)
@@ -995,7 +996,7 @@ class HarmonyMCPServer extends mcp_namespaceObject.BaseMCPServer {
995
996
  constructor(toolsManager){
996
997
  super({
997
998
  name: '@midscene/harmony-mcp',
998
- version: "1.5.5-beta-20260313092855.0",
999
+ version: "1.5.5",
999
1000
  description: 'Control the HarmonyOS device using natural language commands'
1000
1001
  }, toolsManager);
1001
1002
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/harmony",
3
- "version": "1.5.5-beta-20260313092855.0",
3
+ "version": "1.5.5",
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.5.5-beta-20260313092855.0",
45
- "@midscene/core": "1.5.5-beta-20260313092855.0",
46
- "@midscene/shared": "1.5.5-beta-20260313092855.0"
44
+ "@midscene/playground": "1.5.5",
45
+ "@midscene/shared": "1.5.5",
46
+ "@midscene/core": "1.5.5"
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/148.23cd9828.js"></script><script defer src="/static/js/index.a3b1f078.js"></script><link href="/static/css/index.30e8a752.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/148.23cd9828.js"></script><script defer src="/static/js/index.b06cefb6.js"></script><link href="/static/css/index.30e8a752.css" rel="stylesheet"></head><body><div id="root"></div></body></html>