@midscene/harmony 1.4.8-beta-20260227092357.0 → 1.5.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 CHANGED
@@ -869,18 +869,18 @@ class HarmonyAgent extends Agent {
869
869
  }
870
870
  }
871
871
  async function selectDevice() {
872
- console.log('Scanning for HarmonyOS devices...');
872
+ console.log('🔍 Scanning for HarmonyOS devices...');
873
873
  const devices = await utils_getConnectedDevices();
874
874
  if (0 === devices.length) {
875
- console.error('No HarmonyOS devices found!');
876
- console.log('Please ensure:');
877
- console.log(' - Your device is connected via USB');
878
- console.log(' - HDC is properly configured');
879
- console.log(' - Run `hdc list targets` to verify');
875
+ console.error('No HarmonyOS devices found!');
876
+ console.log('📱 Please ensure:');
877
+ console.log(' Your device is connected via USB');
878
+ console.log(' HDC is properly configured');
879
+ console.log(' Run `hdc list targets` to verify');
880
880
  process.exit(1);
881
881
  }
882
882
  if (1 === devices.length) {
883
- console.log(`Found device: ${devices[0].deviceId}`);
883
+ console.log(`📱 Found device: ${devices[0].deviceId}`);
884
884
  return devices[0].deviceId;
885
885
  }
886
886
  const choices = devices.map((d)=>({
@@ -888,7 +888,7 @@ async function selectDevice() {
888
888
  value: d.deviceId
889
889
  }));
890
890
  return prompts_select({
891
- message: 'Multiple devices found. Please select one:',
891
+ message: '📱 Multiple devices found. Please select one:',
892
892
  choices
893
893
  });
894
894
  }
@@ -897,20 +897,21 @@ const main = async ()=>{
897
897
  const { default: open } = await import("open");
898
898
  try {
899
899
  const selectedDeviceId = await selectDevice();
900
- console.log(`Selected device: ${selectedDeviceId}`);
900
+ console.log(`✅ Selected device: ${selectedDeviceId}`);
901
901
  const playgroundServer = new PlaygroundServer(async ()=>{
902
902
  const device = new device_HarmonyDevice(selectedDeviceId);
903
903
  await device.connect();
904
904
  return new HarmonyAgent(device);
905
905
  }, staticDir);
906
+ console.log('🚀 Starting server...');
906
907
  const availablePort = await findAvailablePort(PLAYGROUND_SERVER_PORT);
907
- if (availablePort !== PLAYGROUND_SERVER_PORT) console.log(`Port ${PLAYGROUND_SERVER_PORT} is busy, using port ${availablePort} instead`);
908
+ if (availablePort !== PLAYGROUND_SERVER_PORT) console.log(`⚠️ Port ${PLAYGROUND_SERVER_PORT} is busy, using port ${availablePort} instead`);
908
909
  await playgroundServer.launch(availablePort);
909
910
  console.log('');
910
- console.log('Midscene HarmonyOS Playground is ready!');
911
- console.log(`Playground: http://localhost:${playgroundServer.port}`);
912
- console.log(`Device: ${selectedDeviceId}`);
913
- console.log(`Server ID: ${playgroundServer.id}`);
911
+ console.log('Midscene HarmonyOS Playground is ready!');
912
+ console.log(`🎮 Playground: http://localhost:${playgroundServer.port}`);
913
+ console.log(`📱 Device: ${selectedDeviceId}`);
914
+ console.log(`🔑 Generated Server ID: ${playgroundServer.id}`);
914
915
  console.log('');
915
916
  open(`http://localhost:${playgroundServer.port}`);
916
917
  } catch (error) {
package/dist/lib/bin.js CHANGED
@@ -895,18 +895,18 @@ class HarmonyAgent extends agent_namespaceObject.Agent {
895
895
  }
896
896
  }
897
897
  async function selectDevice() {
898
- console.log('Scanning for HarmonyOS devices...');
898
+ console.log('🔍 Scanning for HarmonyOS devices...');
899
899
  const devices = await utils_getConnectedDevices();
900
900
  if (0 === devices.length) {
901
- console.error('No HarmonyOS devices found!');
902
- console.log('Please ensure:');
903
- console.log(' - Your device is connected via USB');
904
- console.log(' - HDC is properly configured');
905
- console.log(' - Run `hdc list targets` to verify');
901
+ console.error('No HarmonyOS devices found!');
902
+ console.log('📱 Please ensure:');
903
+ console.log(' Your device is connected via USB');
904
+ console.log(' HDC is properly configured');
905
+ console.log(' Run `hdc list targets` to verify');
906
906
  process.exit(1);
907
907
  }
908
908
  if (1 === devices.length) {
909
- console.log(`Found device: ${devices[0].deviceId}`);
909
+ console.log(`📱 Found device: ${devices[0].deviceId}`);
910
910
  return devices[0].deviceId;
911
911
  }
912
912
  const choices = devices.map((d)=>({
@@ -914,7 +914,7 @@ async function selectDevice() {
914
914
  value: d.deviceId
915
915
  }));
916
916
  return (0, prompts_namespaceObject.select)({
917
- message: 'Multiple devices found. Please select one:',
917
+ message: '📱 Multiple devices found. Please select one:',
918
918
  choices
919
919
  });
920
920
  }
@@ -923,20 +923,21 @@ const main = async ()=>{
923
923
  const { default: open } = await import("open");
924
924
  try {
925
925
  const selectedDeviceId = await selectDevice();
926
- console.log(`Selected device: ${selectedDeviceId}`);
926
+ console.log(`✅ Selected device: ${selectedDeviceId}`);
927
927
  const playgroundServer = new playground_namespaceObject.PlaygroundServer(async ()=>{
928
928
  const device = new device_HarmonyDevice(selectedDeviceId);
929
929
  await device.connect();
930
930
  return new HarmonyAgent(device);
931
931
  }, staticDir);
932
+ console.log('🚀 Starting server...');
932
933
  const availablePort = await (0, node_namespaceObject.findAvailablePort)(constants_namespaceObject.PLAYGROUND_SERVER_PORT);
933
- if (availablePort !== constants_namespaceObject.PLAYGROUND_SERVER_PORT) console.log(`Port ${constants_namespaceObject.PLAYGROUND_SERVER_PORT} is busy, using port ${availablePort} instead`);
934
+ if (availablePort !== constants_namespaceObject.PLAYGROUND_SERVER_PORT) console.log(`⚠️ Port ${constants_namespaceObject.PLAYGROUND_SERVER_PORT} is busy, using port ${availablePort} instead`);
934
935
  await playgroundServer.launch(availablePort);
935
936
  console.log('');
936
- console.log('Midscene HarmonyOS Playground is ready!');
937
- console.log(`Playground: http://localhost:${playgroundServer.port}`);
938
- console.log(`Device: ${selectedDeviceId}`);
939
- console.log(`Server ID: ${playgroundServer.id}`);
937
+ console.log('Midscene HarmonyOS Playground is ready!');
938
+ console.log(`🎮 Playground: http://localhost:${playgroundServer.port}`);
939
+ console.log(`📱 Device: ${selectedDeviceId}`);
940
+ console.log(`🔑 Generated Server ID: ${playgroundServer.id}`);
940
941
  console.log('');
941
942
  open(`http://localhost:${playgroundServer.port}`);
942
943
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/harmony",
3
- "version": "1.4.8-beta-20260227092357.0",
3
+ "version": "1.5.0",
4
4
  "description": "HarmonyOS automation library for Midscene",
5
5
  "keywords": [
6
6
  "HarmonyOS UI automation",
@@ -13,8 +13,7 @@
13
13
  "module": "./dist/es/index.mjs",
14
14
  "types": "./dist/types/index.d.ts",
15
15
  "bin": {
16
- "midscene-harmony": "./bin/midscene-harmony",
17
- "midscene-harmony-playground": "./bin/midscene-harmony-playground"
16
+ "midscene-harmony": "./bin/midscene-harmony"
18
17
  },
19
18
  "files": [
20
19
  "bin",
@@ -42,9 +41,9 @@
42
41
  "dependencies": {
43
42
  "@inquirer/prompts": "^7.8.6",
44
43
  "open": "10.1.0",
45
- "@midscene/core": "1.4.8-beta-20260227092357.0",
46
- "@midscene/shared": "1.4.8-beta-20260227092357.0",
47
- "@midscene/playground": "1.4.8-beta-20260227092357.0"
44
+ "@midscene/core": "1.5.0",
45
+ "@midscene/playground": "1.5.0",
46
+ "@midscene/shared": "1.5.0"
48
47
  },
49
48
  "devDependencies": {
50
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/853.673222dd.js"></script><script defer src="/static/js/index.88d25050.js"></script><link href="/static/css/index.33fcd75b.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/853.673222dd.js"></script><script defer src="/static/js/index.9c511a82.js"></script><link href="/static/css/index.33fcd75b.css" rel="stylesheet"></head><body><div id="root"></div></body></html>