@midscene/android 1.8.7-beta-20260528040154.0 → 1.8.7
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 +17 -6
- package/dist/es/index.mjs +16 -5
- package/dist/es/mcp-server.mjs +17 -6
- package/dist/lib/cli.js +17 -6
- package/dist/lib/index.js +16 -5
- package/dist/lib/mcp-server.js +17 -6
- package/dist/types/index.d.ts +12 -3
- package/dist/types/mcp-server.d.ts +12 -3
- package/package.json +4 -4
package/dist/es/cli.mjs
CHANGED
|
@@ -1912,7 +1912,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1912
1912
|
createTemporaryDevice() {
|
|
1913
1913
|
return new AndroidDevice('temp-for-action-space', {});
|
|
1914
1914
|
}
|
|
1915
|
-
async ensureAgent(
|
|
1915
|
+
async ensureAgent(initArgs) {
|
|
1916
|
+
const deviceId = initArgs?.deviceId;
|
|
1916
1917
|
if (this.agent && deviceId) {
|
|
1917
1918
|
try {
|
|
1918
1919
|
await this.agent.destroy?.();
|
|
@@ -1926,6 +1927,11 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1926
1927
|
const reportOptions = this.readCliReportAgentOptions();
|
|
1927
1928
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
1928
1929
|
autoDismissKeyboard: false,
|
|
1930
|
+
...initArgs?.useScrcpy ? {
|
|
1931
|
+
scrcpyConfig: {
|
|
1932
|
+
enabled: true
|
|
1933
|
+
}
|
|
1934
|
+
} : {},
|
|
1929
1935
|
...reportOptions ?? {}
|
|
1930
1936
|
});
|
|
1931
1937
|
this.agent = agent;
|
|
@@ -1939,7 +1945,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1939
1945
|
schema: this.getAgentInitArgSchema(),
|
|
1940
1946
|
cli: this.getAgentInitArgCliMetadata(),
|
|
1941
1947
|
handler: async (args)=>{
|
|
1942
|
-
const
|
|
1948
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
1949
|
+
const deviceId = initArgs?.deviceId;
|
|
1943
1950
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
1944
1951
|
this.commitCliReportSession(reportSession);
|
|
1945
1952
|
if (this.agent) {
|
|
@@ -1950,7 +1957,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1950
1957
|
}
|
|
1951
1958
|
this.agent = void 0;
|
|
1952
1959
|
}
|
|
1953
|
-
const agent = await this.ensureAgent(
|
|
1960
|
+
const agent = await this.ensureAgent(initArgs);
|
|
1954
1961
|
const screenshot = await agent.page.screenshotBase64();
|
|
1955
1962
|
return {
|
|
1956
1963
|
content: [
|
|
@@ -1976,19 +1983,23 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1976
1983
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
1977
1984
|
namespace: 'android',
|
|
1978
1985
|
shape: {
|
|
1979
|
-
deviceId: z.string().optional().describe('Android device ID (from adb devices)')
|
|
1986
|
+
deviceId: z.string().optional().describe('Android device ID (from adb devices)'),
|
|
1987
|
+
useScrcpy: z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
1980
1988
|
},
|
|
1981
1989
|
cli: {
|
|
1982
1990
|
preferBareKeys: true
|
|
1983
1991
|
},
|
|
1984
|
-
adapt: (extracted)=>
|
|
1992
|
+
adapt: (extracted)=>({
|
|
1993
|
+
deviceId: extracted?.deviceId,
|
|
1994
|
+
useScrcpy: extracted?.useScrcpy
|
|
1995
|
+
})
|
|
1985
1996
|
});
|
|
1986
1997
|
}
|
|
1987
1998
|
}
|
|
1988
1999
|
const tools = new AndroidMidsceneTools();
|
|
1989
2000
|
runToolsCLI(tools, 'midscene-android', {
|
|
1990
2001
|
stripPrefix: 'android_',
|
|
1991
|
-
version: "1.8.7
|
|
2002
|
+
version: "1.8.7",
|
|
1992
2003
|
extraCommands: createReportCliCommands()
|
|
1993
2004
|
}).catch((e)=>{
|
|
1994
2005
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -1978,7 +1978,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1978
1978
|
createTemporaryDevice() {
|
|
1979
1979
|
return new AndroidDevice('temp-for-action-space', {});
|
|
1980
1980
|
}
|
|
1981
|
-
async ensureAgent(
|
|
1981
|
+
async ensureAgent(initArgs) {
|
|
1982
|
+
const deviceId = initArgs?.deviceId;
|
|
1982
1983
|
if (this.agent && deviceId) {
|
|
1983
1984
|
try {
|
|
1984
1985
|
await this.agent.destroy?.();
|
|
@@ -1992,6 +1993,11 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1992
1993
|
const reportOptions = this.readCliReportAgentOptions();
|
|
1993
1994
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
1994
1995
|
autoDismissKeyboard: false,
|
|
1996
|
+
...initArgs?.useScrcpy ? {
|
|
1997
|
+
scrcpyConfig: {
|
|
1998
|
+
enabled: true
|
|
1999
|
+
}
|
|
2000
|
+
} : {},
|
|
1995
2001
|
...reportOptions ?? {}
|
|
1996
2002
|
});
|
|
1997
2003
|
this.agent = agent;
|
|
@@ -2005,7 +2011,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
2005
2011
|
schema: this.getAgentInitArgSchema(),
|
|
2006
2012
|
cli: this.getAgentInitArgCliMetadata(),
|
|
2007
2013
|
handler: async (args)=>{
|
|
2008
|
-
const
|
|
2014
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
2015
|
+
const deviceId = initArgs?.deviceId;
|
|
2009
2016
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
2010
2017
|
this.commitCliReportSession(reportSession);
|
|
2011
2018
|
if (this.agent) {
|
|
@@ -2016,7 +2023,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
2016
2023
|
}
|
|
2017
2024
|
this.agent = void 0;
|
|
2018
2025
|
}
|
|
2019
|
-
const agent = await this.ensureAgent(
|
|
2026
|
+
const agent = await this.ensureAgent(initArgs);
|
|
2020
2027
|
const screenshot = await agent.page.screenshotBase64();
|
|
2021
2028
|
return {
|
|
2022
2029
|
content: [
|
|
@@ -2042,12 +2049,16 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
2042
2049
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
2043
2050
|
namespace: 'android',
|
|
2044
2051
|
shape: {
|
|
2045
|
-
deviceId: z.string().optional().describe('Android device ID (from adb devices)')
|
|
2052
|
+
deviceId: z.string().optional().describe('Android device ID (from adb devices)'),
|
|
2053
|
+
useScrcpy: z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
2046
2054
|
},
|
|
2047
2055
|
cli: {
|
|
2048
2056
|
preferBareKeys: true
|
|
2049
2057
|
},
|
|
2050
|
-
adapt: (extracted)=>
|
|
2058
|
+
adapt: (extracted)=>({
|
|
2059
|
+
deviceId: extracted?.deviceId,
|
|
2060
|
+
useScrcpy: extracted?.useScrcpy
|
|
2061
|
+
})
|
|
2051
2062
|
});
|
|
2052
2063
|
}
|
|
2053
2064
|
}
|
package/dist/es/mcp-server.mjs
CHANGED
|
@@ -1912,7 +1912,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1912
1912
|
createTemporaryDevice() {
|
|
1913
1913
|
return new AndroidDevice('temp-for-action-space', {});
|
|
1914
1914
|
}
|
|
1915
|
-
async ensureAgent(
|
|
1915
|
+
async ensureAgent(initArgs) {
|
|
1916
|
+
const deviceId = initArgs?.deviceId;
|
|
1916
1917
|
if (this.agent && deviceId) {
|
|
1917
1918
|
try {
|
|
1918
1919
|
await this.agent.destroy?.();
|
|
@@ -1926,6 +1927,11 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1926
1927
|
const reportOptions = this.readCliReportAgentOptions();
|
|
1927
1928
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
1928
1929
|
autoDismissKeyboard: false,
|
|
1930
|
+
...initArgs?.useScrcpy ? {
|
|
1931
|
+
scrcpyConfig: {
|
|
1932
|
+
enabled: true
|
|
1933
|
+
}
|
|
1934
|
+
} : {},
|
|
1929
1935
|
...reportOptions ?? {}
|
|
1930
1936
|
});
|
|
1931
1937
|
this.agent = agent;
|
|
@@ -1939,7 +1945,8 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1939
1945
|
schema: this.getAgentInitArgSchema(),
|
|
1940
1946
|
cli: this.getAgentInitArgCliMetadata(),
|
|
1941
1947
|
handler: async (args)=>{
|
|
1942
|
-
const
|
|
1948
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
1949
|
+
const deviceId = initArgs?.deviceId;
|
|
1943
1950
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
1944
1951
|
this.commitCliReportSession(reportSession);
|
|
1945
1952
|
if (this.agent) {
|
|
@@ -1950,7 +1957,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1950
1957
|
}
|
|
1951
1958
|
this.agent = void 0;
|
|
1952
1959
|
}
|
|
1953
|
-
const agent = await this.ensureAgent(
|
|
1960
|
+
const agent = await this.ensureAgent(initArgs);
|
|
1954
1961
|
const screenshot = await agent.page.screenshotBase64();
|
|
1955
1962
|
return {
|
|
1956
1963
|
content: [
|
|
@@ -1976,12 +1983,16 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1976
1983
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
1977
1984
|
namespace: 'android',
|
|
1978
1985
|
shape: {
|
|
1979
|
-
deviceId: z.string().optional().describe('Android device ID (from adb devices)')
|
|
1986
|
+
deviceId: z.string().optional().describe('Android device ID (from adb devices)'),
|
|
1987
|
+
useScrcpy: z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
1980
1988
|
},
|
|
1981
1989
|
cli: {
|
|
1982
1990
|
preferBareKeys: true
|
|
1983
1991
|
},
|
|
1984
|
-
adapt: (extracted)=>
|
|
1992
|
+
adapt: (extracted)=>({
|
|
1993
|
+
deviceId: extracted?.deviceId,
|
|
1994
|
+
useScrcpy: extracted?.useScrcpy
|
|
1995
|
+
})
|
|
1985
1996
|
});
|
|
1986
1997
|
}
|
|
1987
1998
|
}
|
|
@@ -1992,7 +2003,7 @@ class AndroidMCPServer extends BaseMCPServer {
|
|
|
1992
2003
|
constructor(toolsManager){
|
|
1993
2004
|
super({
|
|
1994
2005
|
name: '@midscene/android-mcp',
|
|
1995
|
-
version: "1.8.7
|
|
2006
|
+
version: "1.8.7",
|
|
1996
2007
|
description: 'Control the Android device using natural language commands'
|
|
1997
2008
|
}, toolsManager);
|
|
1998
2009
|
}
|
package/dist/lib/cli.js
CHANGED
|
@@ -1927,7 +1927,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1927
1927
|
createTemporaryDevice() {
|
|
1928
1928
|
return new AndroidDevice('temp-for-action-space', {});
|
|
1929
1929
|
}
|
|
1930
|
-
async ensureAgent(
|
|
1930
|
+
async ensureAgent(initArgs) {
|
|
1931
|
+
const deviceId = initArgs?.deviceId;
|
|
1931
1932
|
if (this.agent && deviceId) {
|
|
1932
1933
|
try {
|
|
1933
1934
|
await this.agent.destroy?.();
|
|
@@ -1941,6 +1942,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1941
1942
|
const reportOptions = this.readCliReportAgentOptions();
|
|
1942
1943
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
1943
1944
|
autoDismissKeyboard: false,
|
|
1945
|
+
...initArgs?.useScrcpy ? {
|
|
1946
|
+
scrcpyConfig: {
|
|
1947
|
+
enabled: true
|
|
1948
|
+
}
|
|
1949
|
+
} : {},
|
|
1944
1950
|
...reportOptions ?? {}
|
|
1945
1951
|
});
|
|
1946
1952
|
this.agent = agent;
|
|
@@ -1954,7 +1960,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1954
1960
|
schema: this.getAgentInitArgSchema(),
|
|
1955
1961
|
cli: this.getAgentInitArgCliMetadata(),
|
|
1956
1962
|
handler: async (args)=>{
|
|
1957
|
-
const
|
|
1963
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
1964
|
+
const deviceId = initArgs?.deviceId;
|
|
1958
1965
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
1959
1966
|
this.commitCliReportSession(reportSession);
|
|
1960
1967
|
if (this.agent) {
|
|
@@ -1965,7 +1972,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1965
1972
|
}
|
|
1966
1973
|
this.agent = void 0;
|
|
1967
1974
|
}
|
|
1968
|
-
const agent = await this.ensureAgent(
|
|
1975
|
+
const agent = await this.ensureAgent(initArgs);
|
|
1969
1976
|
const screenshot = await agent.page.screenshotBase64();
|
|
1970
1977
|
return {
|
|
1971
1978
|
content: [
|
|
@@ -1991,19 +1998,23 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1991
1998
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
1992
1999
|
namespace: 'android',
|
|
1993
2000
|
shape: {
|
|
1994
|
-
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
|
|
2001
|
+
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)'),
|
|
2002
|
+
useScrcpy: core_namespaceObject.z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
1995
2003
|
},
|
|
1996
2004
|
cli: {
|
|
1997
2005
|
preferBareKeys: true
|
|
1998
2006
|
},
|
|
1999
|
-
adapt: (extracted)=>
|
|
2007
|
+
adapt: (extracted)=>({
|
|
2008
|
+
deviceId: extracted?.deviceId,
|
|
2009
|
+
useScrcpy: extracted?.useScrcpy
|
|
2010
|
+
})
|
|
2000
2011
|
});
|
|
2001
2012
|
}
|
|
2002
2013
|
}
|
|
2003
2014
|
const tools = new AndroidMidsceneTools();
|
|
2004
2015
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
|
|
2005
2016
|
stripPrefix: 'android_',
|
|
2006
|
-
version: "1.8.7
|
|
2017
|
+
version: "1.8.7",
|
|
2007
2018
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
2008
2019
|
}).catch((e)=>{
|
|
2009
2020
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -2014,7 +2014,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2014
2014
|
createTemporaryDevice() {
|
|
2015
2015
|
return new AndroidDevice('temp-for-action-space', {});
|
|
2016
2016
|
}
|
|
2017
|
-
async ensureAgent(
|
|
2017
|
+
async ensureAgent(initArgs) {
|
|
2018
|
+
const deviceId = initArgs?.deviceId;
|
|
2018
2019
|
if (this.agent && deviceId) {
|
|
2019
2020
|
try {
|
|
2020
2021
|
await this.agent.destroy?.();
|
|
@@ -2028,6 +2029,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2028
2029
|
const reportOptions = this.readCliReportAgentOptions();
|
|
2029
2030
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
2030
2031
|
autoDismissKeyboard: false,
|
|
2032
|
+
...initArgs?.useScrcpy ? {
|
|
2033
|
+
scrcpyConfig: {
|
|
2034
|
+
enabled: true
|
|
2035
|
+
}
|
|
2036
|
+
} : {},
|
|
2031
2037
|
...reportOptions ?? {}
|
|
2032
2038
|
});
|
|
2033
2039
|
this.agent = agent;
|
|
@@ -2041,7 +2047,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2041
2047
|
schema: this.getAgentInitArgSchema(),
|
|
2042
2048
|
cli: this.getAgentInitArgCliMetadata(),
|
|
2043
2049
|
handler: async (args)=>{
|
|
2044
|
-
const
|
|
2050
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
2051
|
+
const deviceId = initArgs?.deviceId;
|
|
2045
2052
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
2046
2053
|
this.commitCliReportSession(reportSession);
|
|
2047
2054
|
if (this.agent) {
|
|
@@ -2052,7 +2059,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2052
2059
|
}
|
|
2053
2060
|
this.agent = void 0;
|
|
2054
2061
|
}
|
|
2055
|
-
const agent = await this.ensureAgent(
|
|
2062
|
+
const agent = await this.ensureAgent(initArgs);
|
|
2056
2063
|
const screenshot = await agent.page.screenshotBase64();
|
|
2057
2064
|
return {
|
|
2058
2065
|
content: [
|
|
@@ -2078,12 +2085,16 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2078
2085
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
2079
2086
|
namespace: 'android',
|
|
2080
2087
|
shape: {
|
|
2081
|
-
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
|
|
2088
|
+
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)'),
|
|
2089
|
+
useScrcpy: core_namespaceObject.z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
2082
2090
|
},
|
|
2083
2091
|
cli: {
|
|
2084
2092
|
preferBareKeys: true
|
|
2085
2093
|
},
|
|
2086
|
-
adapt: (extracted)=>
|
|
2094
|
+
adapt: (extracted)=>({
|
|
2095
|
+
deviceId: extracted?.deviceId,
|
|
2096
|
+
useScrcpy: extracted?.useScrcpy
|
|
2097
|
+
})
|
|
2087
2098
|
});
|
|
2088
2099
|
}
|
|
2089
2100
|
}
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -1943,7 +1943,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1943
1943
|
createTemporaryDevice() {
|
|
1944
1944
|
return new AndroidDevice('temp-for-action-space', {});
|
|
1945
1945
|
}
|
|
1946
|
-
async ensureAgent(
|
|
1946
|
+
async ensureAgent(initArgs) {
|
|
1947
|
+
const deviceId = initArgs?.deviceId;
|
|
1947
1948
|
if (this.agent && deviceId) {
|
|
1948
1949
|
try {
|
|
1949
1950
|
await this.agent.destroy?.();
|
|
@@ -1957,6 +1958,11 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1957
1958
|
const reportOptions = this.readCliReportAgentOptions();
|
|
1958
1959
|
const agent = await agentFromAdbDevice(deviceId, {
|
|
1959
1960
|
autoDismissKeyboard: false,
|
|
1961
|
+
...initArgs?.useScrcpy ? {
|
|
1962
|
+
scrcpyConfig: {
|
|
1963
|
+
enabled: true
|
|
1964
|
+
}
|
|
1965
|
+
} : {},
|
|
1960
1966
|
...reportOptions ?? {}
|
|
1961
1967
|
});
|
|
1962
1968
|
this.agent = agent;
|
|
@@ -1970,7 +1976,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1970
1976
|
schema: this.getAgentInitArgSchema(),
|
|
1971
1977
|
cli: this.getAgentInitArgCliMetadata(),
|
|
1972
1978
|
handler: async (args)=>{
|
|
1973
|
-
const
|
|
1979
|
+
const initArgs = this.extractAgentInitParam(args);
|
|
1980
|
+
const deviceId = initArgs?.deviceId;
|
|
1974
1981
|
const reportSession = this.createNewCliReportSession(deviceId ?? 'auto');
|
|
1975
1982
|
this.commitCliReportSession(reportSession);
|
|
1976
1983
|
if (this.agent) {
|
|
@@ -1981,7 +1988,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1981
1988
|
}
|
|
1982
1989
|
this.agent = void 0;
|
|
1983
1990
|
}
|
|
1984
|
-
const agent = await this.ensureAgent(
|
|
1991
|
+
const agent = await this.ensureAgent(initArgs);
|
|
1985
1992
|
const screenshot = await agent.page.screenshotBase64();
|
|
1986
1993
|
return {
|
|
1987
1994
|
content: [
|
|
@@ -2007,12 +2014,16 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2007
2014
|
super(...args), mcp_tools_define_property(this, "initArgSpec", {
|
|
2008
2015
|
namespace: 'android',
|
|
2009
2016
|
shape: {
|
|
2010
|
-
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)')
|
|
2017
|
+
deviceId: core_namespaceObject.z.string().optional().describe('Android device ID (from adb devices)'),
|
|
2018
|
+
useScrcpy: core_namespaceObject.z.boolean().optional().describe('Enable scrcpy accelerated screenshots')
|
|
2011
2019
|
},
|
|
2012
2020
|
cli: {
|
|
2013
2021
|
preferBareKeys: true
|
|
2014
2022
|
},
|
|
2015
|
-
adapt: (extracted)=>
|
|
2023
|
+
adapt: (extracted)=>({
|
|
2024
|
+
deviceId: extracted?.deviceId,
|
|
2025
|
+
useScrcpy: extracted?.useScrcpy
|
|
2026
|
+
})
|
|
2016
2027
|
});
|
|
2017
2028
|
}
|
|
2018
2029
|
}
|
|
@@ -2023,7 +2034,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2023
2034
|
constructor(toolsManager){
|
|
2024
2035
|
super({
|
|
2025
2036
|
name: '@midscene/android-mcp',
|
|
2026
|
-
version: "1.8.7
|
|
2037
|
+
version: "1.8.7",
|
|
2027
2038
|
description: 'Control the Android device using natural language commands'
|
|
2028
2039
|
}, toolsManager);
|
|
2029
2040
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -238,11 +238,20 @@ export declare class AndroidDevice implements AbstractInterface {
|
|
|
238
238
|
* Android-specific tools manager
|
|
239
239
|
* Extends BaseMidsceneTools to provide Android ADB device connection tools
|
|
240
240
|
*/
|
|
241
|
-
export declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent,
|
|
241
|
+
export declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent, {
|
|
242
|
+
deviceId?: string;
|
|
243
|
+
useScrcpy?: boolean;
|
|
244
|
+
}> {
|
|
242
245
|
protected getCliReportSessionName(): string;
|
|
243
|
-
protected readonly initArgSpec: InitArgSpec<
|
|
246
|
+
protected readonly initArgSpec: InitArgSpec<{
|
|
247
|
+
deviceId?: string;
|
|
248
|
+
useScrcpy?: boolean;
|
|
249
|
+
}>;
|
|
244
250
|
protected createTemporaryDevice(): AndroidDevice;
|
|
245
|
-
protected ensureAgent(
|
|
251
|
+
protected ensureAgent(initArgs?: {
|
|
252
|
+
deviceId?: string;
|
|
253
|
+
useScrcpy?: boolean;
|
|
254
|
+
}): Promise<AndroidAgent>;
|
|
246
255
|
/**
|
|
247
256
|
* Provide Android-specific platform tools
|
|
248
257
|
*/
|
|
@@ -239,11 +239,20 @@ export declare class AndroidMCPServer extends BaseMCPServer {
|
|
|
239
239
|
* Android-specific tools manager
|
|
240
240
|
* Extends BaseMidsceneTools to provide Android ADB device connection tools
|
|
241
241
|
*/
|
|
242
|
-
declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent,
|
|
242
|
+
declare class AndroidMidsceneTools extends BaseMidsceneTools<AndroidAgent, {
|
|
243
|
+
deviceId?: string;
|
|
244
|
+
useScrcpy?: boolean;
|
|
245
|
+
}> {
|
|
243
246
|
protected getCliReportSessionName(): string;
|
|
244
|
-
protected readonly initArgSpec: InitArgSpec<
|
|
247
|
+
protected readonly initArgSpec: InitArgSpec<{
|
|
248
|
+
deviceId?: string;
|
|
249
|
+
useScrcpy?: boolean;
|
|
250
|
+
}>;
|
|
245
251
|
protected createTemporaryDevice(): AndroidDevice;
|
|
246
|
-
protected ensureAgent(
|
|
252
|
+
protected ensureAgent(initArgs?: {
|
|
253
|
+
deviceId?: string;
|
|
254
|
+
useScrcpy?: boolean;
|
|
255
|
+
}): Promise<AndroidAgent>;
|
|
247
256
|
/**
|
|
248
257
|
* Provide Android-specific platform tools
|
|
249
258
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/android",
|
|
3
|
-
"version": "1.8.7
|
|
3
|
+
"version": "1.8.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@yume-chan/stream-extra": "2.1.0",
|
|
47
47
|
"appium-adb": "12.12.1",
|
|
48
48
|
"sharp": "^0.34.3",
|
|
49
|
-
"@midscene/core": "1.8.7
|
|
50
|
-
"@midscene/shared": "1.8.7
|
|
49
|
+
"@midscene/core": "1.8.7",
|
|
50
|
+
"@midscene/shared": "1.8.7"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
53
|
"@ffmpeg-installer/ffmpeg": "^1.1.0"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"undici": "^6.0.0",
|
|
62
62
|
"vitest": "3.0.5",
|
|
63
63
|
"zod": "^3.25.1",
|
|
64
|
-
"@midscene/playground": "1.8.7
|
|
64
|
+
"@midscene/playground": "1.8.7"
|
|
65
65
|
},
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"scripts": {
|