@aiscene/android 1.6.6 → 1.6.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 +8 -3
- package/dist/es/index.mjs +7 -2
- package/dist/es/mcp-server.mjs +8 -3
- package/dist/lib/cli.js +8 -3
- package/dist/lib/index.js +7 -2
- package/dist/lib/mcp-server.js +8 -3
- package/package.json +1 -1
package/dist/es/cli.mjs
CHANGED
|
@@ -935,14 +935,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
935
935
|
try {
|
|
936
936
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
937
937
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
938
|
-
|
|
938
|
+
const inputPromise = adb.shell(command);
|
|
939
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
940
|
+
await Promise.race([
|
|
941
|
+
inputPromise,
|
|
942
|
+
timeoutPromise
|
|
943
|
+
]);
|
|
939
944
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
940
945
|
} catch (error) {
|
|
941
946
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
942
947
|
if (isAccessibilityConflict) {
|
|
943
948
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
944
949
|
await this.inputViaClipboard(keyboardContent);
|
|
945
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
950
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
946
951
|
}
|
|
947
952
|
}
|
|
948
953
|
async inputViaClipboard(text) {
|
|
@@ -1919,7 +1924,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
1919
1924
|
const tools = new AndroidMidsceneTools();
|
|
1920
1925
|
runToolsCLI(tools, 'midscene-android', {
|
|
1921
1926
|
stripPrefix: 'android_',
|
|
1922
|
-
version: "1.6.
|
|
1927
|
+
version: "1.6.7"
|
|
1923
1928
|
}).catch((e)=>{
|
|
1924
1929
|
if (!(e instanceof CLIError)) console.error(e);
|
|
1925
1930
|
process.exit(e instanceof CLIError ? e.exitCode : 1);
|
package/dist/es/index.mjs
CHANGED
|
@@ -838,14 +838,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
838
838
|
try {
|
|
839
839
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
840
840
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
841
|
-
|
|
841
|
+
const inputPromise = adb.shell(command);
|
|
842
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
843
|
+
await Promise.race([
|
|
844
|
+
inputPromise,
|
|
845
|
+
timeoutPromise
|
|
846
|
+
]);
|
|
842
847
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
843
848
|
} catch (error) {
|
|
844
849
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
845
850
|
if (isAccessibilityConflict) {
|
|
846
851
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
847
852
|
await this.inputViaClipboard(keyboardContent);
|
|
848
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
853
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
849
854
|
}
|
|
850
855
|
}
|
|
851
856
|
async inputViaClipboard(text) {
|
package/dist/es/mcp-server.mjs
CHANGED
|
@@ -934,14 +934,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
934
934
|
try {
|
|
935
935
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
936
936
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
937
|
-
|
|
937
|
+
const inputPromise = adb.shell(command);
|
|
938
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
939
|
+
await Promise.race([
|
|
940
|
+
inputPromise,
|
|
941
|
+
timeoutPromise
|
|
942
|
+
]);
|
|
938
943
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
939
944
|
} catch (error) {
|
|
940
945
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
941
946
|
if (isAccessibilityConflict) {
|
|
942
947
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
943
948
|
await this.inputViaClipboard(keyboardContent);
|
|
944
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
949
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
945
950
|
}
|
|
946
951
|
}
|
|
947
952
|
async inputViaClipboard(text) {
|
|
@@ -1922,7 +1927,7 @@ class AndroidMCPServer extends BaseMCPServer {
|
|
|
1922
1927
|
constructor(toolsManager){
|
|
1923
1928
|
super({
|
|
1924
1929
|
name: '@midscene/android-mcp',
|
|
1925
|
-
version: "1.6.
|
|
1930
|
+
version: "1.6.7",
|
|
1926
1931
|
description: 'Control the Android device using natural language commands'
|
|
1927
1932
|
}, toolsManager);
|
|
1928
1933
|
}
|
package/dist/lib/cli.js
CHANGED
|
@@ -950,14 +950,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
950
950
|
try {
|
|
951
951
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
952
952
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
953
|
-
|
|
953
|
+
const inputPromise = adb.shell(command);
|
|
954
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
955
|
+
await Promise.race([
|
|
956
|
+
inputPromise,
|
|
957
|
+
timeoutPromise
|
|
958
|
+
]);
|
|
954
959
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
955
960
|
} catch (error) {
|
|
956
961
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
957
962
|
if (isAccessibilityConflict) {
|
|
958
963
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
959
964
|
await this.inputViaClipboard(keyboardContent);
|
|
960
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
965
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
961
966
|
}
|
|
962
967
|
}
|
|
963
968
|
async inputViaClipboard(text) {
|
|
@@ -1934,7 +1939,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1934
1939
|
const tools = new AndroidMidsceneTools();
|
|
1935
1940
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
|
|
1936
1941
|
stripPrefix: 'android_',
|
|
1937
|
-
version: "1.6.
|
|
1942
|
+
version: "1.6.7"
|
|
1938
1943
|
}).catch((e)=>{
|
|
1939
1944
|
if (!(e instanceof cli_namespaceObject.CLIError)) console.error(e);
|
|
1940
1945
|
process.exit(e instanceof cli_namespaceObject.CLIError ? e.exitCode : 1);
|
package/dist/lib/index.js
CHANGED
|
@@ -871,14 +871,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
871
871
|
try {
|
|
872
872
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
873
873
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
874
|
-
|
|
874
|
+
const inputPromise = adb.shell(command);
|
|
875
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
876
|
+
await Promise.race([
|
|
877
|
+
inputPromise,
|
|
878
|
+
timeoutPromise
|
|
879
|
+
]);
|
|
875
880
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
876
881
|
} catch (error) {
|
|
877
882
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
878
883
|
if (isAccessibilityConflict) {
|
|
879
884
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
880
885
|
await this.inputViaClipboard(keyboardContent);
|
|
881
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
886
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
882
887
|
}
|
|
883
888
|
}
|
|
884
889
|
async inputViaClipboard(text) {
|
package/dist/lib/mcp-server.js
CHANGED
|
@@ -965,14 +965,19 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
965
965
|
try {
|
|
966
966
|
const command = `app_process${this.getDisplayArg()} -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -keyboard "${keyboardContent}"`;
|
|
967
967
|
debugDevice(`Executing YADB input: "${keyboardContent}"`);
|
|
968
|
-
|
|
968
|
+
const inputPromise = adb.shell(command);
|
|
969
|
+
const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new Error('YADB timeout')), 1000));
|
|
970
|
+
await Promise.race([
|
|
971
|
+
inputPromise,
|
|
972
|
+
timeoutPromise
|
|
973
|
+
]);
|
|
969
974
|
debugDevice(`YADB input completed: "${keyboardContent}"`);
|
|
970
975
|
} catch (error) {
|
|
971
976
|
const isAccessibilityConflict = error?.cause?.stderr?.includes('UiAutomationService') || error?.cause?.stderr?.includes('already registered') || error?.message?.includes('UiAutomationService');
|
|
972
977
|
if (isAccessibilityConflict) {
|
|
973
978
|
debugDevice("YADB failed due to AccessibilityService conflict (likely Appium running), falling back to clipboard method");
|
|
974
979
|
await this.inputViaClipboard(keyboardContent);
|
|
975
|
-
} else debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
980
|
+
} else 'YADB timeout' === error.message ? debugDevice(`YADB timed out after 2s, assuming input succeeded: "${keyboardContent}"`) : debugDevice(`YADB execution may have completed despite error: ${error}`);
|
|
976
981
|
}
|
|
977
982
|
}
|
|
978
983
|
async inputViaClipboard(text) {
|
|
@@ -1953,7 +1958,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1953
1958
|
constructor(toolsManager){
|
|
1954
1959
|
super({
|
|
1955
1960
|
name: '@midscene/android-mcp',
|
|
1956
|
-
version: "1.6.
|
|
1961
|
+
version: "1.6.7",
|
|
1957
1962
|
description: 'Control the Android device using natural language commands'
|
|
1958
1963
|
}, toolsManager);
|
|
1959
1964
|
}
|