@midscene/android 1.7.6-beta-20260425023224.0 → 1.7.6

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
@@ -1945,12 +1945,10 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1945
1945
  }
1946
1946
  if (this.agent) return this.agent;
1947
1947
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
1948
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
1948
+ const reportOptions = this.readCliReportAgentOptions();
1949
1949
  const agent = await agentFromAdbDevice(deviceId, {
1950
1950
  autoDismissKeyboard: false,
1951
- ...reportFileName ? {
1952
- reportFileName
1953
- } : {}
1951
+ ...reportOptions ?? {}
1954
1952
  });
1955
1953
  this.agent = agent;
1956
1954
  return agent;
@@ -1964,8 +1962,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1964
1962
  cli: this.getAgentInitArgCliMetadata(),
1965
1963
  handler: async (args)=>{
1966
1964
  const deviceId = this.extractAgentInitParam(args);
1967
- const reportSession = this.createNewCliReportSession();
1968
- this.pendingReportFileName = reportSession?.reportFileName;
1965
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1966
+ this.commitCliReportSession(reportSession);
1969
1967
  if (this.agent) {
1970
1968
  try {
1971
1969
  await this.agent.destroy?.();
@@ -1974,13 +1972,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1974
1972
  }
1975
1973
  this.agent = void 0;
1976
1974
  }
1977
- let agent;
1978
- try {
1979
- agent = await this.ensureAgent(deviceId);
1980
- } finally{
1981
- this.pendingReportFileName = void 0;
1982
- }
1983
- this.commitCliReportSession(reportSession);
1975
+ const agent = await this.ensureAgent(deviceId);
1984
1976
  const screenshot = await agent.page.screenshotBase64();
1985
1977
  return {
1986
1978
  content: [
@@ -2003,7 +1995,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2003
1995
  ];
2004
1996
  }
2005
1997
  constructor(...args){
2006
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1998
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2007
1999
  namespace: 'android',
2008
2000
  shape: {
2009
2001
  deviceId: z.string().optional().describe('Android device ID (from adb devices)')
@@ -2018,7 +2010,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2018
2010
  const tools = new AndroidMidsceneTools();
2019
2011
  runToolsCLI(tools, 'midscene-android', {
2020
2012
  stripPrefix: 'android_',
2021
- version: "1.7.6-beta-20260425023224.0",
2013
+ version: "1.7.6",
2022
2014
  extraCommands: createReportCliCommands()
2023
2015
  }).catch((e)=>{
2024
2016
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -2011,12 +2011,10 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2011
2011
  }
2012
2012
  if (this.agent) return this.agent;
2013
2013
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
2014
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
2014
+ const reportOptions = this.readCliReportAgentOptions();
2015
2015
  const agent = await agentFromAdbDevice(deviceId, {
2016
2016
  autoDismissKeyboard: false,
2017
- ...reportFileName ? {
2018
- reportFileName
2019
- } : {}
2017
+ ...reportOptions ?? {}
2020
2018
  });
2021
2019
  this.agent = agent;
2022
2020
  return agent;
@@ -2030,8 +2028,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2030
2028
  cli: this.getAgentInitArgCliMetadata(),
2031
2029
  handler: async (args)=>{
2032
2030
  const deviceId = this.extractAgentInitParam(args);
2033
- const reportSession = this.createNewCliReportSession();
2034
- this.pendingReportFileName = reportSession?.reportFileName;
2031
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
2032
+ this.commitCliReportSession(reportSession);
2035
2033
  if (this.agent) {
2036
2034
  try {
2037
2035
  await this.agent.destroy?.();
@@ -2040,13 +2038,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2040
2038
  }
2041
2039
  this.agent = void 0;
2042
2040
  }
2043
- let agent;
2044
- try {
2045
- agent = await this.ensureAgent(deviceId);
2046
- } finally{
2047
- this.pendingReportFileName = void 0;
2048
- }
2049
- this.commitCliReportSession(reportSession);
2041
+ const agent = await this.ensureAgent(deviceId);
2050
2042
  const screenshot = await agent.page.screenshotBase64();
2051
2043
  return {
2052
2044
  content: [
@@ -2069,7 +2061,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2069
2061
  ];
2070
2062
  }
2071
2063
  constructor(...args){
2072
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
2064
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2073
2065
  namespace: 'android',
2074
2066
  shape: {
2075
2067
  deviceId: z.string().optional().describe('Android device ID (from adb devices)')
@@ -1945,12 +1945,10 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1945
1945
  }
1946
1946
  if (this.agent) return this.agent;
1947
1947
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
1948
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
1948
+ const reportOptions = this.readCliReportAgentOptions();
1949
1949
  const agent = await agentFromAdbDevice(deviceId, {
1950
1950
  autoDismissKeyboard: false,
1951
- ...reportFileName ? {
1952
- reportFileName
1953
- } : {}
1951
+ ...reportOptions ?? {}
1954
1952
  });
1955
1953
  this.agent = agent;
1956
1954
  return agent;
@@ -1964,8 +1962,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1964
1962
  cli: this.getAgentInitArgCliMetadata(),
1965
1963
  handler: async (args)=>{
1966
1964
  const deviceId = this.extractAgentInitParam(args);
1967
- const reportSession = this.createNewCliReportSession();
1968
- this.pendingReportFileName = reportSession?.reportFileName;
1965
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1966
+ this.commitCliReportSession(reportSession);
1969
1967
  if (this.agent) {
1970
1968
  try {
1971
1969
  await this.agent.destroy?.();
@@ -1974,13 +1972,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
1974
1972
  }
1975
1973
  this.agent = void 0;
1976
1974
  }
1977
- let agent;
1978
- try {
1979
- agent = await this.ensureAgent(deviceId);
1980
- } finally{
1981
- this.pendingReportFileName = void 0;
1982
- }
1983
- this.commitCliReportSession(reportSession);
1975
+ const agent = await this.ensureAgent(deviceId);
1984
1976
  const screenshot = await agent.page.screenshotBase64();
1985
1977
  return {
1986
1978
  content: [
@@ -2003,7 +1995,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
2003
1995
  ];
2004
1996
  }
2005
1997
  constructor(...args){
2006
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
1998
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2007
1999
  namespace: 'android',
2008
2000
  shape: {
2009
2001
  deviceId: z.string().optional().describe('Android device ID (from adb devices)')
@@ -2022,7 +2014,7 @@ class AndroidMCPServer extends BaseMCPServer {
2022
2014
  constructor(toolsManager){
2023
2015
  super({
2024
2016
  name: '@midscene/android-mcp',
2025
- version: "1.7.6-beta-20260425023224.0",
2017
+ version: "1.7.6",
2026
2018
  description: 'Control the Android device using natural language commands'
2027
2019
  }, toolsManager);
2028
2020
  }
package/dist/lib/cli.js CHANGED
@@ -1960,12 +1960,10 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1960
1960
  }
1961
1961
  if (this.agent) return this.agent;
1962
1962
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
1963
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
1963
+ const reportOptions = this.readCliReportAgentOptions();
1964
1964
  const agent = await agentFromAdbDevice(deviceId, {
1965
1965
  autoDismissKeyboard: false,
1966
- ...reportFileName ? {
1967
- reportFileName
1968
- } : {}
1966
+ ...reportOptions ?? {}
1969
1967
  });
1970
1968
  this.agent = agent;
1971
1969
  return agent;
@@ -1979,8 +1977,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1979
1977
  cli: this.getAgentInitArgCliMetadata(),
1980
1978
  handler: async (args)=>{
1981
1979
  const deviceId = this.extractAgentInitParam(args);
1982
- const reportSession = this.createNewCliReportSession();
1983
- this.pendingReportFileName = reportSession?.reportFileName;
1980
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1981
+ this.commitCliReportSession(reportSession);
1984
1982
  if (this.agent) {
1985
1983
  try {
1986
1984
  await this.agent.destroy?.();
@@ -1989,13 +1987,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1989
1987
  }
1990
1988
  this.agent = void 0;
1991
1989
  }
1992
- let agent;
1993
- try {
1994
- agent = await this.ensureAgent(deviceId);
1995
- } finally{
1996
- this.pendingReportFileName = void 0;
1997
- }
1998
- this.commitCliReportSession(reportSession);
1990
+ const agent = await this.ensureAgent(deviceId);
1999
1991
  const screenshot = await agent.page.screenshotBase64();
2000
1992
  return {
2001
1993
  content: [
@@ -2018,7 +2010,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2018
2010
  ];
2019
2011
  }
2020
2012
  constructor(...args){
2021
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
2013
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2022
2014
  namespace: 'android',
2023
2015
  shape: {
2024
2016
  deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
@@ -2033,7 +2025,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2033
2025
  const tools = new AndroidMidsceneTools();
2034
2026
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
2035
2027
  stripPrefix: 'android_',
2036
- version: "1.7.6-beta-20260425023224.0",
2028
+ version: "1.7.6",
2037
2029
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
2038
2030
  }).catch((e)=>{
2039
2031
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -2047,12 +2047,10 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2047
2047
  }
2048
2048
  if (this.agent) return this.agent;
2049
2049
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
2050
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
2050
+ const reportOptions = this.readCliReportAgentOptions();
2051
2051
  const agent = await agentFromAdbDevice(deviceId, {
2052
2052
  autoDismissKeyboard: false,
2053
- ...reportFileName ? {
2054
- reportFileName
2055
- } : {}
2053
+ ...reportOptions ?? {}
2056
2054
  });
2057
2055
  this.agent = agent;
2058
2056
  return agent;
@@ -2066,8 +2064,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2066
2064
  cli: this.getAgentInitArgCliMetadata(),
2067
2065
  handler: async (args)=>{
2068
2066
  const deviceId = this.extractAgentInitParam(args);
2069
- const reportSession = this.createNewCliReportSession();
2070
- this.pendingReportFileName = reportSession?.reportFileName;
2067
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
2068
+ this.commitCliReportSession(reportSession);
2071
2069
  if (this.agent) {
2072
2070
  try {
2073
2071
  await this.agent.destroy?.();
@@ -2076,13 +2074,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2076
2074
  }
2077
2075
  this.agent = void 0;
2078
2076
  }
2079
- let agent;
2080
- try {
2081
- agent = await this.ensureAgent(deviceId);
2082
- } finally{
2083
- this.pendingReportFileName = void 0;
2084
- }
2085
- this.commitCliReportSession(reportSession);
2077
+ const agent = await this.ensureAgent(deviceId);
2086
2078
  const screenshot = await agent.page.screenshotBase64();
2087
2079
  return {
2088
2080
  content: [
@@ -2105,7 +2097,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2105
2097
  ];
2106
2098
  }
2107
2099
  constructor(...args){
2108
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
2100
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2109
2101
  namespace: 'android',
2110
2102
  shape: {
2111
2103
  deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
@@ -1976,12 +1976,10 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1976
1976
  }
1977
1977
  if (this.agent) return this.agent;
1978
1978
  debug('Creating Android agent with deviceId:', deviceId || 'auto-detect');
1979
- const reportFileName = this.pendingReportFileName ?? this.readCliReportFileName();
1979
+ const reportOptions = this.readCliReportAgentOptions();
1980
1980
  const agent = await agentFromAdbDevice(deviceId, {
1981
1981
  autoDismissKeyboard: false,
1982
- ...reportFileName ? {
1983
- reportFileName
1984
- } : {}
1982
+ ...reportOptions ?? {}
1985
1983
  });
1986
1984
  this.agent = agent;
1987
1985
  return agent;
@@ -1995,8 +1993,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
1995
1993
  cli: this.getAgentInitArgCliMetadata(),
1996
1994
  handler: async (args)=>{
1997
1995
  const deviceId = this.extractAgentInitParam(args);
1998
- const reportSession = this.createNewCliReportSession();
1999
- this.pendingReportFileName = reportSession?.reportFileName;
1996
+ const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
1997
+ this.commitCliReportSession(reportSession);
2000
1998
  if (this.agent) {
2001
1999
  try {
2002
2000
  await this.agent.destroy?.();
@@ -2005,13 +2003,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2005
2003
  }
2006
2004
  this.agent = void 0;
2007
2005
  }
2008
- let agent;
2009
- try {
2010
- agent = await this.ensureAgent(deviceId);
2011
- } finally{
2012
- this.pendingReportFileName = void 0;
2013
- }
2014
- this.commitCliReportSession(reportSession);
2006
+ const agent = await this.ensureAgent(deviceId);
2015
2007
  const screenshot = await agent.page.screenshotBase64();
2016
2008
  return {
2017
2009
  content: [
@@ -2034,7 +2026,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2034
2026
  ];
2035
2027
  }
2036
2028
  constructor(...args){
2037
- super(...args), mcp_tools_define_property(this, "pendingReportFileName", void 0), mcp_tools_define_property(this, "initArgSpec", {
2029
+ super(...args), mcp_tools_define_property(this, "initArgSpec", {
2038
2030
  namespace: 'android',
2039
2031
  shape: {
2040
2032
  deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
@@ -2053,7 +2045,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
2053
2045
  constructor(toolsManager){
2054
2046
  super({
2055
2047
  name: '@midscene/android-mcp',
2056
- version: "1.7.6-beta-20260425023224.0",
2048
+ version: "1.7.6",
2057
2049
  description: 'Control the Android device using natural language commands'
2058
2050
  }, toolsManager);
2059
2051
  }
@@ -240,7 +240,6 @@ export declare class AndroidDevice implements AbstractInterface {
240
240
  */
241
241
  export declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent, string> {
242
242
  protected getCliReportSessionName(): string;
243
- private pendingReportFileName?;
244
243
  protected readonly initArgSpec: InitArgSpec<string>;
245
244
  protected createTemporaryDevice(): AndroidDevice;
246
245
  protected ensureAgent(deviceId?: string): Promise<AndroidAgent>;
@@ -241,7 +241,6 @@ export declare class AndroidMCPServer extends BaseMCPServer {
241
241
  */
242
242
  declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent, string> {
243
243
  protected getCliReportSessionName(): string;
244
- private pendingReportFileName?;
245
244
  protected readonly initArgSpec: InitArgSpec<string>;
246
245
  protected createTemporaryDevice(): AndroidDevice;
247
246
  protected ensureAgent(deviceId?: string): Promise<AndroidAgent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.7.6-beta-20260425023224.0",
3
+ "version": "1.7.6",
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/core": "1.7.6-beta-20260425023224.0",
45
- "@midscene/shared": "1.7.6-beta-20260425023224.0"
44
+ "@midscene/core": "1.7.6",
45
+ "@midscene/shared": "1.7.6"
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.7.6-beta-20260425023224.0"
59
+ "@midscene/playground": "1.7.6"
60
60
  },
61
61
  "license": "MIT",
62
62
  "scripts": {