@midscene/android 0.27.3-beta-20250825082408.0 → 0.27.3

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/index.mjs CHANGED
@@ -3,9 +3,9 @@ import { randomUUID } from "node:crypto";
3
3
  import node_fs from "node:fs";
4
4
  import { createRequire } from "node:module";
5
5
  import node_path from "node:path";
6
- import { getAIConfig, getMidsceneLocationSchema, z } from "@midscene/core";
6
+ import { getMidsceneLocationSchema, z } from "@midscene/core";
7
7
  import { getTmpFile, sleep } from "@midscene/core/utils";
8
- import { MIDSCENE_ADB_PATH, MIDSCENE_ADB_REMOTE_HOST, MIDSCENE_ADB_REMOTE_PORT, MIDSCENE_ANDROID_IME_STRATEGY, overrideAIConfig, vlLocateMode } from "@midscene/shared/env";
8
+ import { MIDSCENE_ADB_PATH, MIDSCENE_ADB_REMOTE_HOST, MIDSCENE_ADB_REMOTE_PORT, MIDSCENE_ANDROID_IME_STRATEGY, globalConfigManager, overrideAIConfig, vlLocateMode } from "@midscene/shared/env";
9
9
  import { createImgBase64ByFormat, isValidPNGImageBuffer, resizeAndConvertImgBuffer } from "@midscene/shared/img";
10
10
  import { getDebug } from "@midscene/shared/logger";
11
11
  import { repeat } from "@midscene/shared/utils";
@@ -124,9 +124,9 @@ class AndroidDevice {
124
124
  debugPage(`Initializing ADB with device ID: ${this.deviceId}`);
125
125
  try {
126
126
  var _this_options, _this_options1, _this_options2;
127
- const androidAdbPath = (null == (_this_options = this.options) ? void 0 : _this_options.androidAdbPath) || getAIConfig(MIDSCENE_ADB_PATH);
128
- const remoteAdbHost = (null == (_this_options1 = this.options) ? void 0 : _this_options1.remoteAdbHost) || getAIConfig(MIDSCENE_ADB_REMOTE_HOST);
129
- const remoteAdbPort = (null == (_this_options2 = this.options) ? void 0 : _this_options2.remoteAdbPort) || getAIConfig(MIDSCENE_ADB_REMOTE_PORT);
127
+ const androidAdbPath = (null == (_this_options = this.options) ? void 0 : _this_options.androidAdbPath) || globalConfigManager.getEnvConfigValue(MIDSCENE_ADB_PATH);
128
+ const remoteAdbHost = (null == (_this_options1 = this.options) ? void 0 : _this_options1.remoteAdbHost) || globalConfigManager.getEnvConfigValue(MIDSCENE_ADB_REMOTE_HOST);
129
+ const remoteAdbPort = (null == (_this_options2 = this.options) ? void 0 : _this_options2.remoteAdbPort) || globalConfigManager.getEnvConfigValue(MIDSCENE_ADB_REMOTE_PORT);
130
130
  this.adb = await new ADB({
131
131
  udid: this.deviceId,
132
132
  adbExecTimeout: 60000,
@@ -630,7 +630,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
630
630
  if (!text) return;
631
631
  const adb = await this.getAdb();
632
632
  const isChinese = /[\p{Script=Han}\p{sc=Hani}]/u.test(text);
633
- const IME_STRATEGY = ((null == (_this_options = this.options) ? void 0 : _this_options.imeStrategy) || getAIConfig(MIDSCENE_ANDROID_IME_STRATEGY)) ?? 'always-yadb';
633
+ const IME_STRATEGY = ((null == (_this_options = this.options) ? void 0 : _this_options.imeStrategy) || globalConfigManager.getEnvConfigValue(MIDSCENE_ANDROID_IME_STRATEGY)) ?? 'always-yadb';
634
634
  const shouldAutoDismissKeyboard = (null == options ? void 0 : options.autoDismissKeyboard) ?? (null == (_this_options1 = this.options) ? void 0 : _this_options1.autoDismissKeyboard) ?? true;
635
635
  if ('always-yadb' === IME_STRATEGY || 'yadb-for-non-ascii' === IME_STRATEGY && isChinese) await this.execYadb(text);
636
636
  else await adb.inputText(text);
package/dist/lib/index.js CHANGED
@@ -171,9 +171,9 @@ class AndroidDevice {
171
171
  debugPage(`Initializing ADB with device ID: ${this.deviceId}`);
172
172
  try {
173
173
  var _this_options, _this_options1, _this_options2;
174
- const androidAdbPath = (null == (_this_options = this.options) ? void 0 : _this_options.androidAdbPath) || (0, core_namespaceObject.getAIConfig)(env_namespaceObject.MIDSCENE_ADB_PATH);
175
- const remoteAdbHost = (null == (_this_options1 = this.options) ? void 0 : _this_options1.remoteAdbHost) || (0, core_namespaceObject.getAIConfig)(env_namespaceObject.MIDSCENE_ADB_REMOTE_HOST);
176
- const remoteAdbPort = (null == (_this_options2 = this.options) ? void 0 : _this_options2.remoteAdbPort) || (0, core_namespaceObject.getAIConfig)(env_namespaceObject.MIDSCENE_ADB_REMOTE_PORT);
174
+ const androidAdbPath = (null == (_this_options = this.options) ? void 0 : _this_options.androidAdbPath) || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ADB_PATH);
175
+ const remoteAdbHost = (null == (_this_options1 = this.options) ? void 0 : _this_options1.remoteAdbHost) || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ADB_REMOTE_HOST);
176
+ const remoteAdbPort = (null == (_this_options2 = this.options) ? void 0 : _this_options2.remoteAdbPort) || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ADB_REMOTE_PORT);
177
177
  this.adb = await new external_appium_adb_namespaceObject.ADB({
178
178
  udid: this.deviceId,
179
179
  adbExecTimeout: 60000,
@@ -677,7 +677,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
677
677
  if (!text) return;
678
678
  const adb = await this.getAdb();
679
679
  const isChinese = /[\p{Script=Han}\p{sc=Hani}]/u.test(text);
680
- const IME_STRATEGY = ((null == (_this_options = this.options) ? void 0 : _this_options.imeStrategy) || (0, core_namespaceObject.getAIConfig)(env_namespaceObject.MIDSCENE_ANDROID_IME_STRATEGY)) ?? 'always-yadb';
680
+ const IME_STRATEGY = ((null == (_this_options = this.options) ? void 0 : _this_options.imeStrategy) || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ANDROID_IME_STRATEGY)) ?? 'always-yadb';
681
681
  const shouldAutoDismissKeyboard = (null == options ? void 0 : options.autoDismissKeyboard) ?? (null == (_this_options1 = this.options) ? void 0 : _this_options1.autoDismissKeyboard) ?? true;
682
682
  if ('always-yadb' === IME_STRATEGY || 'yadb-for-non-ascii' === IME_STRATEGY && isChinese) await this.execYadb(text);
683
683
  else await adb.inputText(text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "0.27.3-beta-20250825082408.0",
3
+ "version": "0.27.3",
4
4
  "description": "Android automation library for Midscene",
5
5
  "keywords": [
6
6
  "Android UI automation",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "appium-adb": "12.12.1",
30
- "@midscene/core": "0.27.3-beta-20250825082408.0",
31
- "@midscene/shared": "0.27.3-beta-20250825082408.0"
30
+ "@midscene/core": "0.27.3",
31
+ "@midscene/shared": "0.27.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@microsoft/api-extractor": "^7.52.10",