@midscene/android 1.8.1 → 1.8.2-beta-20260515014559.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/cli.mjs CHANGED
@@ -1771,7 +1771,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1771
1771
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1772
1772
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1773
1773
  const runAdbShellParamSchema = z.object({
1774
- command: z.string().describe('ADB shell command to execute')
1774
+ command: z.string().describe('ADB shell command to execute'),
1775
+ timeout: z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1775
1776
  });
1776
1777
  const launchParamSchema = z.object({
1777
1778
  uri: z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1786,12 +1787,15 @@ const createPlatformActions = (device)=>({
1786
1787
  interfaceAlias: 'runAdbShell',
1787
1788
  paramSchema: runAdbShellParamSchema,
1788
1789
  sample: {
1789
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1790
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1791
+ timeout: 60000
1790
1792
  },
1791
1793
  call: async (param)=>{
1792
1794
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1793
1795
  const adb = await device.getAdb();
1794
- return await adb.shell(param.command);
1796
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1797
+ timeout: param.timeout
1798
+ }) : await adb.shell(param.command);
1795
1799
  }
1796
1800
  }),
1797
1801
  Launch: defineAction({
@@ -1858,10 +1862,11 @@ class AndroidAgent extends Agent {
1858
1862
  uri
1859
1863
  });
1860
1864
  }
1861
- async runAdbShell(command) {
1865
+ async runAdbShell(command, opt) {
1862
1866
  const action = this.wrapActionInActionSpace('RunAdbShell');
1863
1867
  return action({
1864
- command
1868
+ command,
1869
+ ...opt
1865
1870
  });
1866
1871
  }
1867
1872
  createActionWrapper(name) {
@@ -1982,7 +1987,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1982
1987
  const tools = new AndroidMidsceneTools();
1983
1988
  runToolsCLI(tools, 'midscene-android', {
1984
1989
  stripPrefix: 'android_',
1985
- version: "1.8.1",
1990
+ version: "1.8.2-beta-20260515014559.0",
1986
1991
  extraCommands: createReportCliCommands()
1987
1992
  }).catch((e)=>{
1988
1993
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -1674,7 +1674,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1674
1674
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1675
1675
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1676
1676
  const runAdbShellParamSchema = z.object({
1677
- command: z.string().describe('ADB shell command to execute')
1677
+ command: z.string().describe('ADB shell command to execute'),
1678
+ timeout: z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1678
1679
  });
1679
1680
  const launchParamSchema = z.object({
1680
1681
  uri: z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1689,12 +1690,15 @@ const createPlatformActions = (device)=>({
1689
1690
  interfaceAlias: 'runAdbShell',
1690
1691
  paramSchema: runAdbShellParamSchema,
1691
1692
  sample: {
1692
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1693
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1694
+ timeout: 60000
1693
1695
  },
1694
1696
  call: async (param)=>{
1695
1697
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1696
1698
  const adb = await device.getAdb();
1697
- return await adb.shell(param.command);
1699
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1700
+ timeout: param.timeout
1701
+ }) : await adb.shell(param.command);
1698
1702
  }
1699
1703
  }),
1700
1704
  Launch: defineAction({
@@ -1924,10 +1928,11 @@ class AndroidAgent extends Agent {
1924
1928
  uri
1925
1929
  });
1926
1930
  }
1927
- async runAdbShell(command) {
1931
+ async runAdbShell(command, opt) {
1928
1932
  const action = this.wrapActionInActionSpace('RunAdbShell');
1929
1933
  return action({
1930
- command
1934
+ command,
1935
+ ...opt
1931
1936
  });
1932
1937
  }
1933
1938
  createActionWrapper(name) {
@@ -1771,7 +1771,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1771
1771
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1772
1772
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1773
1773
  const runAdbShellParamSchema = z.object({
1774
- command: z.string().describe('ADB shell command to execute')
1774
+ command: z.string().describe('ADB shell command to execute'),
1775
+ timeout: z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1775
1776
  });
1776
1777
  const launchParamSchema = z.object({
1777
1778
  uri: z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1786,12 +1787,15 @@ const createPlatformActions = (device)=>({
1786
1787
  interfaceAlias: 'runAdbShell',
1787
1788
  paramSchema: runAdbShellParamSchema,
1788
1789
  sample: {
1789
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1790
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1791
+ timeout: 60000
1790
1792
  },
1791
1793
  call: async (param)=>{
1792
1794
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1793
1795
  const adb = await device.getAdb();
1794
- return await adb.shell(param.command);
1796
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1797
+ timeout: param.timeout
1798
+ }) : await adb.shell(param.command);
1795
1799
  }
1796
1800
  }),
1797
1801
  Launch: defineAction({
@@ -1858,10 +1862,11 @@ class AndroidAgent extends Agent {
1858
1862
  uri
1859
1863
  });
1860
1864
  }
1861
- async runAdbShell(command) {
1865
+ async runAdbShell(command, opt) {
1862
1866
  const action = this.wrapActionInActionSpace('RunAdbShell');
1863
1867
  return action({
1864
- command
1868
+ command,
1869
+ ...opt
1865
1870
  });
1866
1871
  }
1867
1872
  createActionWrapper(name) {
@@ -1986,7 +1991,7 @@ class AndroidMCPServer extends BaseMCPServer {
1986
1991
  constructor(toolsManager){
1987
1992
  super({
1988
1993
  name: '@midscene/android-mcp',
1989
- version: "1.8.1",
1994
+ version: "1.8.2-beta-20260515014559.0",
1990
1995
  description: 'Control the Android device using natural language commands'
1991
1996
  }, toolsManager);
1992
1997
  }
package/dist/lib/cli.js CHANGED
@@ -1786,7 +1786,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1786
1786
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1787
1787
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1788
1788
  const runAdbShellParamSchema = core_namespaceObject.z.object({
1789
- command: core_namespaceObject.z.string().describe('ADB shell command to execute')
1789
+ command: core_namespaceObject.z.string().describe('ADB shell command to execute'),
1790
+ timeout: core_namespaceObject.z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1790
1791
  });
1791
1792
  const launchParamSchema = core_namespaceObject.z.object({
1792
1793
  uri: core_namespaceObject.z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1801,12 +1802,15 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1801
1802
  interfaceAlias: 'runAdbShell',
1802
1803
  paramSchema: runAdbShellParamSchema,
1803
1804
  sample: {
1804
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1805
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1806
+ timeout: 60000
1805
1807
  },
1806
1808
  call: async (param)=>{
1807
1809
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1808
1810
  const adb = await device.getAdb();
1809
- return await adb.shell(param.command);
1811
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1812
+ timeout: param.timeout
1813
+ }) : await adb.shell(param.command);
1810
1814
  }
1811
1815
  }),
1812
1816
  Launch: (0, device_namespaceObject.defineAction)({
@@ -1873,10 +1877,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1873
1877
  uri
1874
1878
  });
1875
1879
  }
1876
- async runAdbShell(command) {
1880
+ async runAdbShell(command, opt) {
1877
1881
  const action = this.wrapActionInActionSpace('RunAdbShell');
1878
1882
  return action({
1879
- command
1883
+ command,
1884
+ ...opt
1880
1885
  });
1881
1886
  }
1882
1887
  createActionWrapper(name) {
@@ -1997,7 +2002,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1997
2002
  const tools = new AndroidMidsceneTools();
1998
2003
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
1999
2004
  stripPrefix: 'android_',
2000
- version: "1.8.1",
2005
+ version: "1.8.2-beta-20260515014559.0",
2001
2006
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
2002
2007
  }).catch((e)=>{
2003
2008
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -1708,7 +1708,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1708
1708
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1709
1709
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1710
1710
  const runAdbShellParamSchema = core_namespaceObject.z.object({
1711
- command: core_namespaceObject.z.string().describe('ADB shell command to execute')
1711
+ command: core_namespaceObject.z.string().describe('ADB shell command to execute'),
1712
+ timeout: core_namespaceObject.z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1712
1713
  });
1713
1714
  const launchParamSchema = core_namespaceObject.z.object({
1714
1715
  uri: core_namespaceObject.z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1723,12 +1724,15 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1723
1724
  interfaceAlias: 'runAdbShell',
1724
1725
  paramSchema: runAdbShellParamSchema,
1725
1726
  sample: {
1726
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1727
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1728
+ timeout: 60000
1727
1729
  },
1728
1730
  call: async (param)=>{
1729
1731
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1730
1732
  const adb = await device.getAdb();
1731
- return await adb.shell(param.command);
1733
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1734
+ timeout: param.timeout
1735
+ }) : await adb.shell(param.command);
1732
1736
  }
1733
1737
  }),
1734
1738
  Launch: (0, device_namespaceObject.defineAction)({
@@ -1959,10 +1963,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1959
1963
  uri
1960
1964
  });
1961
1965
  }
1962
- async runAdbShell(command) {
1966
+ async runAdbShell(command, opt) {
1963
1967
  const action = this.wrapActionInActionSpace('RunAdbShell');
1964
1968
  return action({
1965
- command
1969
+ command,
1970
+ ...opt
1966
1971
  });
1967
1972
  }
1968
1973
  createActionWrapper(name) {
@@ -1801,7 +1801,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1801
1801
  device_define_property(AndroidDevice, "TAKE_SCREENSHOT_FAIL_THRESHOLD", 3);
1802
1802
  device_define_property(AndroidDevice, "DEFAULT_MIN_SCREENSHOT_BUFFER_SIZE", 1024);
1803
1803
  const runAdbShellParamSchema = core_namespaceObject.z.object({
1804
- command: core_namespaceObject.z.string().describe('ADB shell command to execute')
1804
+ command: core_namespaceObject.z.string().describe('ADB shell command to execute'),
1805
+ timeout: core_namespaceObject.z.number().int().positive().optional().describe('ADB shell command execution timeout in milliseconds')
1805
1806
  });
1806
1807
  const launchParamSchema = core_namespaceObject.z.object({
1807
1808
  uri: core_namespaceObject.z.string().describe('App name, package name, or URL to launch. Prioritize using the exact package name or URL the user has provided. If none provided, use the accurate app name.')
@@ -1816,12 +1817,15 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1816
1817
  interfaceAlias: 'runAdbShell',
1817
1818
  paramSchema: runAdbShellParamSchema,
1818
1819
  sample: {
1819
- command: 'dumpsys window displays | grep -E "mCurrentFocus"'
1820
+ command: 'dumpsys window displays | grep -E "mCurrentFocus"',
1821
+ timeout: 60000
1820
1822
  },
1821
1823
  call: async (param)=>{
1822
1824
  if (!param.command || '' === param.command.trim()) throw new Error('RunAdbShell requires a non-empty command parameter');
1823
1825
  const adb = await device.getAdb();
1824
- return await adb.shell(param.command);
1826
+ return void 0 !== param.timeout ? await adb.shell(param.command, {
1827
+ timeout: param.timeout
1828
+ }) : await adb.shell(param.command);
1825
1829
  }
1826
1830
  }),
1827
1831
  Launch: (0, device_namespaceObject.defineAction)({
@@ -1888,10 +1892,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1888
1892
  uri
1889
1893
  });
1890
1894
  }
1891
- async runAdbShell(command) {
1895
+ async runAdbShell(command, opt) {
1892
1896
  const action = this.wrapActionInActionSpace('RunAdbShell');
1893
1897
  return action({
1894
- command
1898
+ command,
1899
+ ...opt
1895
1900
  });
1896
1901
  }
1897
1902
  createActionWrapper(name) {
@@ -2017,7 +2022,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2017
2022
  constructor(toolsManager){
2018
2023
  super({
2019
2024
  name: '@midscene/android-mcp',
2020
- version: "1.8.1",
2025
+ version: "1.8.2-beta-20260515014559.0",
2021
2026
  description: 'Control the Android device using natural language commands'
2022
2027
  }, toolsManager);
2023
2028
  }
@@ -54,8 +54,9 @@ export declare class AndroidAgent extends Agent<AndroidDevice> {
54
54
  /**
55
55
  * Execute ADB shell command on Android device
56
56
  * @param command - ADB shell command to execute
57
+ * @param opt - Optional ADB shell execution settings
57
58
  */
58
- runAdbShell(command: string): Promise<string>;
59
+ runAdbShell(command: string, opt?: RunAdbShellOpt): Promise<string>;
59
60
  private createActionWrapper;
60
61
  }
61
62
 
@@ -275,6 +276,13 @@ declare interface ResolvedScrcpyConfig {
275
276
  idleTimeoutMs: number;
276
277
  }
277
278
 
279
+ declare type RunAdbShellOpt = {
280
+ /**
281
+ * ADB shell command execution timeout in milliseconds.
282
+ */
283
+ timeout?: number;
284
+ };
285
+
278
286
  declare interface ScrcpyConfig {
279
287
  enabled?: boolean;
280
288
  maxSize?: number;
@@ -53,8 +53,9 @@ declare class AndroidAgent extends Agent<AndroidDevice> {
53
53
  /**
54
54
  * Execute ADB shell command on Android device
55
55
  * @param command - ADB shell command to execute
56
+ * @param opt - Optional ADB shell execution settings
56
57
  */
57
- runAdbShell(command: string): Promise<string>;
58
+ runAdbShell(command: string, opt?: RunAdbShellOpt): Promise<string>;
58
59
  private createActionWrapper;
59
60
  }
60
61
 
@@ -273,6 +274,13 @@ export declare function mcpServerForAgent(agent: Agent | AndroidAgent): {
273
274
  launchHttp(options: LaunchMCPServerOptions): Promise<LaunchMCPServerResult>;
274
275
  };
275
276
 
277
+ declare type RunAdbShellOpt = {
278
+ /**
279
+ * ADB shell command execution timeout in milliseconds.
280
+ */
281
+ timeout?: number;
282
+ };
283
+
276
284
  declare type ScrollDirection = 'up' | 'down' | 'left' | 'right';
277
285
 
278
286
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.8.1",
3
+ "version": "1.8.2-beta-20260515014559.0",
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.8.1",
45
- "@midscene/core": "1.8.1"
44
+ "@midscene/core": "1.8.2-beta-20260515014559.0",
45
+ "@midscene/shared": "1.8.2-beta-20260515014559.0"
46
46
  },
47
47
  "optionalDependencies": {
48
48
  "@ffmpeg-installer/ffmpeg": "^1.1.0"
@@ -56,7 +56,7 @@
56
56
  "undici": "^6.0.0",
57
57
  "vitest": "3.0.5",
58
58
  "zod": "^3.25.1",
59
- "@midscene/playground": "1.8.1"
59
+ "@midscene/playground": "1.8.2-beta-20260515014559.0"
60
60
  },
61
61
  "license": "MIT",
62
62
  "scripts": {