@midscene/android 1.7.2-beta-20260409032436.0 → 1.7.2

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/bin/yadb CHANGED
Binary file
package/dist/es/cli.mjs CHANGED
@@ -719,7 +719,8 @@ class AndroidDevice {
719
719
  if (!param || !param.value) return;
720
720
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
721
721
  await this.keyboardType(param.value, {
722
- autoDismissKeyboard
722
+ autoDismissKeyboard,
723
+ overwrite: 'typeOnly' !== param.mode
723
724
  });
724
725
  }
725
726
  }),
@@ -987,10 +988,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
987
988
  });
988
989
  }
989
990
  }
990
- async execYadb(keyboardContent) {
991
+ async execYadb(keyboardContent, options) {
991
992
  await this.ensureYadb();
992
993
  const adb = await this.getAdb();
993
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
994
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
995
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
994
996
  }
995
997
  async getElementsInfo() {
996
998
  return [];
@@ -1482,7 +1484,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1482
1484
  const IME_STRATEGY = (this.options?.imeStrategy || globalConfigManager.getEnvConfigValue(MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1483
1485
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1484
1486
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1485
- if (useYadb) await this.execYadb(escapeForShell(text));
1487
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1488
+ overwrite: options?.overwrite
1489
+ });
1486
1490
  else {
1487
1491
  const segments = text.split('\n');
1488
1492
  for(let i = 0; i < segments.length; i++){
@@ -1952,7 +1956,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1952
1956
  const tools = new AndroidMidsceneTools();
1953
1957
  runToolsCLI(tools, 'midscene-android', {
1954
1958
  stripPrefix: 'android_',
1955
- version: "1.7.2-beta-20260409032436.0",
1959
+ version: "1.7.2",
1956
1960
  extraCommands: createReportCliCommands()
1957
1961
  }).catch((e)=>{
1958
1962
  if (!(e instanceof CLIError)) console.error(e);
package/dist/es/index.mjs CHANGED
@@ -622,7 +622,8 @@ class AndroidDevice {
622
622
  if (!param || !param.value) return;
623
623
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
624
624
  await this.keyboardType(param.value, {
625
- autoDismissKeyboard
625
+ autoDismissKeyboard,
626
+ overwrite: 'typeOnly' !== param.mode
626
627
  });
627
628
  }
628
629
  }),
@@ -890,10 +891,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
890
891
  });
891
892
  }
892
893
  }
893
- async execYadb(keyboardContent) {
894
+ async execYadb(keyboardContent, options) {
894
895
  await this.ensureYadb();
895
896
  const adb = await this.getAdb();
896
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
897
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
898
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
897
899
  }
898
900
  async getElementsInfo() {
899
901
  return [];
@@ -1385,7 +1387,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1385
1387
  const IME_STRATEGY = (this.options?.imeStrategy || globalConfigManager.getEnvConfigValue(MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1386
1388
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1387
1389
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1388
- if (useYadb) await this.execYadb(escapeForShell(text));
1390
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1391
+ overwrite: options?.overwrite
1392
+ });
1389
1393
  else {
1390
1394
  const segments = text.split('\n');
1391
1395
  for(let i = 0; i < segments.length; i++){
@@ -718,7 +718,8 @@ class AndroidDevice {
718
718
  if (!param || !param.value) return;
719
719
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
720
720
  await this.keyboardType(param.value, {
721
- autoDismissKeyboard
721
+ autoDismissKeyboard,
722
+ overwrite: 'typeOnly' !== param.mode
722
723
  });
723
724
  }
724
725
  }),
@@ -986,10 +987,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
986
987
  });
987
988
  }
988
989
  }
989
- async execYadb(keyboardContent) {
990
+ async execYadb(keyboardContent, options) {
990
991
  await this.ensureYadb();
991
992
  const adb = await this.getAdb();
992
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
993
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
994
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
993
995
  }
994
996
  async getElementsInfo() {
995
997
  return [];
@@ -1481,7 +1483,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1481
1483
  const IME_STRATEGY = (this.options?.imeStrategy || globalConfigManager.getEnvConfigValue(MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1482
1484
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1483
1485
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1484
- if (useYadb) await this.execYadb(escapeForShell(text));
1486
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1487
+ overwrite: options?.overwrite
1488
+ });
1485
1489
  else {
1486
1490
  const segments = text.split('\n');
1487
1491
  for(let i = 0; i < segments.length; i++){
@@ -1955,7 +1959,7 @@ class AndroidMCPServer extends BaseMCPServer {
1955
1959
  constructor(toolsManager){
1956
1960
  super({
1957
1961
  name: '@midscene/android-mcp',
1958
- version: "1.7.2-beta-20260409032436.0",
1962
+ version: "1.7.2",
1959
1963
  description: 'Control the Android device using natural language commands'
1960
1964
  }, toolsManager);
1961
1965
  }
package/dist/lib/cli.js CHANGED
@@ -734,7 +734,8 @@ var __webpack_exports__ = {};
734
734
  if (!param || !param.value) return;
735
735
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
736
736
  await this.keyboardType(param.value, {
737
- autoDismissKeyboard
737
+ autoDismissKeyboard,
738
+ overwrite: 'typeOnly' !== param.mode
738
739
  });
739
740
  }
740
741
  }),
@@ -1002,10 +1003,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1002
1003
  });
1003
1004
  }
1004
1005
  }
1005
- async execYadb(keyboardContent) {
1006
+ async execYadb(keyboardContent, options) {
1006
1007
  await this.ensureYadb();
1007
1008
  const adb = await this.getAdb();
1008
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
1009
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
1010
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
1009
1011
  }
1010
1012
  async getElementsInfo() {
1011
1013
  return [];
@@ -1497,7 +1499,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1497
1499
  const IME_STRATEGY = (this.options?.imeStrategy || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1498
1500
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1499
1501
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1500
- if (useYadb) await this.execYadb(escapeForShell(text));
1502
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1503
+ overwrite: options?.overwrite
1504
+ });
1501
1505
  else {
1502
1506
  const segments = text.split('\n');
1503
1507
  for(let i = 0; i < segments.length; i++){
@@ -1967,7 +1971,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1967
1971
  const tools = new AndroidMidsceneTools();
1968
1972
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
1969
1973
  stripPrefix: 'android_',
1970
- version: "1.7.2-beta-20260409032436.0",
1974
+ version: "1.7.2",
1971
1975
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
1972
1976
  }).catch((e)=>{
1973
1977
  if (!(e instanceof cli_namespaceObject.CLIError)) console.error(e);
package/dist/lib/index.js CHANGED
@@ -656,7 +656,8 @@ var __webpack_exports__ = {};
656
656
  if (!param || !param.value) return;
657
657
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
658
658
  await this.keyboardType(param.value, {
659
- autoDismissKeyboard
659
+ autoDismissKeyboard,
660
+ overwrite: 'typeOnly' !== param.mode
660
661
  });
661
662
  }
662
663
  }),
@@ -924,10 +925,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
924
925
  });
925
926
  }
926
927
  }
927
- async execYadb(keyboardContent) {
928
+ async execYadb(keyboardContent, options) {
928
929
  await this.ensureYadb();
929
930
  const adb = await this.getAdb();
930
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
931
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
932
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
931
933
  }
932
934
  async getElementsInfo() {
933
935
  return [];
@@ -1419,7 +1421,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1419
1421
  const IME_STRATEGY = (this.options?.imeStrategy || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1420
1422
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1421
1423
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1422
- if (useYadb) await this.execYadb(escapeForShell(text));
1424
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1425
+ overwrite: options?.overwrite
1426
+ });
1423
1427
  else {
1424
1428
  const segments = text.split('\n');
1425
1429
  for(let i = 0; i < segments.length; i++){
@@ -749,7 +749,8 @@ var __webpack_exports__ = {};
749
749
  if (!param || !param.value) return;
750
750
  const autoDismissKeyboard = param.autoDismissKeyboard ?? this.options?.autoDismissKeyboard;
751
751
  await this.keyboardType(param.value, {
752
- autoDismissKeyboard
752
+ autoDismissKeyboard,
753
+ overwrite: 'typeOnly' !== param.mode
753
754
  });
754
755
  }
755
756
  }),
@@ -1017,10 +1018,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1017
1018
  });
1018
1019
  }
1019
1020
  }
1020
- async execYadb(keyboardContent) {
1021
+ async execYadb(keyboardContent, options) {
1021
1022
  await this.ensureYadb();
1022
1023
  const adb = await this.getAdb();
1023
- await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'`);
1024
+ const overwriteFlag = options?.overwrite ? ' --overwrite' : '';
1025
+ await adb.shell(`app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard '${keyboardContent}'${overwriteFlag}`);
1024
1026
  }
1025
1027
  async getElementsInfo() {
1026
1028
  return [];
@@ -1512,7 +1514,9 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1512
1514
  const IME_STRATEGY = (this.options?.imeStrategy || env_namespaceObject.globalConfigManager.getEnvConfigValue(env_namespaceObject.MIDSCENE_ANDROID_IME_STRATEGY)) ?? IME_STRATEGY_YADB_FOR_NON_ASCII;
1513
1515
  const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
1514
1516
  const useYadb = IME_STRATEGY === IME_STRATEGY_ALWAYS_YADB || IME_STRATEGY === IME_STRATEGY_YADB_FOR_NON_ASCII && this.shouldUseYadbForText(text);
1515
- if (useYadb) await this.execYadb(escapeForShell(text));
1517
+ if (useYadb) await this.execYadb(escapeForShell(text), {
1518
+ overwrite: options?.overwrite
1519
+ });
1516
1520
  else {
1517
1521
  const segments = text.split('\n');
1518
1522
  for(let i = 0; i < segments.length; i++){
@@ -1986,7 +1990,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1986
1990
  constructor(toolsManager){
1987
1991
  super({
1988
1992
  name: '@midscene/android-mcp',
1989
- version: "1.7.2-beta-20260409032436.0",
1993
+ version: "1.7.2",
1990
1994
  description: 'Control the Android device using natural language commands'
1991
1995
  }, toolsManager);
1992
1996
  }
@@ -125,7 +125,9 @@ export declare class AndroidDevice implements AbstractInterface {
125
125
  * If uri contains "/" (e.g. com.example.app/.MainActivity), only the package part is used.
126
126
  */
127
127
  terminate(uri: string): Promise<void>;
128
- execYadb(keyboardContent: string): Promise<void>;
128
+ execYadb(keyboardContent: string, options?: {
129
+ overwrite?: boolean;
130
+ }): Promise<void>;
129
131
  getElementsInfo(): Promise<ElementInfo[]>;
130
132
  getElementsNodeTree(): Promise<any>;
131
133
  getScreenSize(): Promise<{
@@ -193,7 +195,9 @@ export declare class AndroidDevice implements AbstractInterface {
193
195
  * via escapeForShell + double-quoted shell context.
194
196
  */
195
197
  private shouldUseYadbForText;
196
- keyboardType(text: string, options?: AndroidDeviceInputOpt): Promise<void>;
198
+ keyboardType(text: string, options?: AndroidDeviceInputOpt & {
199
+ overwrite?: boolean;
200
+ }): Promise<void>;
197
201
  private normalizeKeyName;
198
202
  keyboardPress(key: string): Promise<void>;
199
203
  mouseClick(x: number, y: number): Promise<void>;
@@ -117,7 +117,9 @@ declare class AndroidDevice implements AbstractInterface {
117
117
  * If uri contains "/" (e.g. com.example.app/.MainActivity), only the package part is used.
118
118
  */
119
119
  terminate(uri: string): Promise<void>;
120
- execYadb(keyboardContent: string): Promise<void>;
120
+ execYadb(keyboardContent: string, options?: {
121
+ overwrite?: boolean;
122
+ }): Promise<void>;
121
123
  getElementsInfo(): Promise<ElementInfo[]>;
122
124
  getElementsNodeTree(): Promise<any>;
123
125
  getScreenSize(): Promise<{
@@ -185,7 +187,9 @@ declare class AndroidDevice implements AbstractInterface {
185
187
  * via escapeForShell + double-quoted shell context.
186
188
  */
187
189
  private shouldUseYadbForText;
188
- keyboardType(text: string, options?: AndroidDeviceInputOpt): Promise<void>;
190
+ keyboardType(text: string, options?: AndroidDeviceInputOpt & {
191
+ overwrite?: boolean;
192
+ }): Promise<void>;
189
193
  private normalizeKeyName;
190
194
  keyboardPress(key: string): Promise<void>;
191
195
  mouseClick(x: number, y: number): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.7.2-beta-20260409032436.0",
3
+ "version": "1.7.2",
4
4
  "description": "Android automation library for Midscene",
5
5
  "keywords": [
6
6
  "Android UI automation",
@@ -41,8 +41,8 @@
41
41
  "@yume-chan/stream-extra": "2.1.0",
42
42
  "appium-adb": "12.12.1",
43
43
  "sharp": "^0.34.3",
44
- "@midscene/shared": "1.7.2-beta-20260409032436.0",
45
- "@midscene/core": "1.7.2-beta-20260409032436.0"
44
+ "@midscene/core": "1.7.2",
45
+ "@midscene/shared": "1.7.2"
46
46
  },
47
47
  "optionalDependencies": {
48
48
  "@ffmpeg-installer/ffmpeg": "^1.1.0"
@@ -56,7 +56,7 @@
56
56
  "tsx": "^4.19.2",
57
57
  "vitest": "3.0.5",
58
58
  "zod": "3.24.3",
59
- "@midscene/playground": "1.7.2-beta-20260409032436.0"
59
+ "@midscene/playground": "1.7.2"
60
60
  },
61
61
  "license": "MIT",
62
62
  "scripts": {