@midscene/android 1.17.7 → 1.17.8-beta-20261110095715.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/140.mjs +105 -0
- package/dist/es/430.mjs +3456 -0
- package/dist/es/cli.mjs +2 -3552
- package/dist/es/index.mjs +2 -3621
- package/dist/es/test-runner.mjs +1 -105
- package/dist/lib/cli.js +2 -2
- package/dist/lib/index.js +2 -2
- package/dist/lib/test-runner.js +1 -1
- package/package.json +9 -9
package/dist/es/test-runner.mjs
CHANGED
|
@@ -1,105 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { z } from "zod/v4";
|
|
3
|
-
const defineAndroidAgentNode = createAgentTestRunnerNodeDefinition('an Android Agent');
|
|
4
|
-
const nonBlankText = (description)=>z.string().regex(/\S/, 'value must contain a non-whitespace character').describe(description);
|
|
5
|
-
const launchInputSchema = z.strictObject({
|
|
6
|
-
uri: nonBlankText('The app, URL, URI, or package name to launch.')
|
|
7
|
-
});
|
|
8
|
-
const terminateInputSchema = z.strictObject({
|
|
9
|
-
uri: nonBlankText('The package name or app name to terminate.')
|
|
10
|
-
});
|
|
11
|
-
const runAdbShellOptionsInputSchema = z.strictObject({
|
|
12
|
-
timeout: z.number().int().positive().optional().describe('ADB shell command timeout in milliseconds.')
|
|
13
|
-
});
|
|
14
|
-
const runAdbShellInputSchema = z.strictObject({
|
|
15
|
-
command: nonBlankText('The shell command to execute, without an adb shell prefix.'),
|
|
16
|
-
options: runAdbShellOptionsInputSchema.optional()
|
|
17
|
-
});
|
|
18
|
-
const emptyInputSchema = z.strictObject({});
|
|
19
|
-
const launchNode = defineAndroidAgentNode({
|
|
20
|
-
method: 'launch',
|
|
21
|
-
description: 'Launch an application through the current Android Agent.',
|
|
22
|
-
stringInputKey: 'uri',
|
|
23
|
-
inputSchema: launchInputSchema,
|
|
24
|
-
toArgs: (input)=>[
|
|
25
|
-
input.uri
|
|
26
|
-
],
|
|
27
|
-
toResult: (_output, input)=>({
|
|
28
|
-
summary: `Launched ${input.uri}`
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
const terminateNode = defineAndroidAgentNode({
|
|
32
|
-
method: 'terminate',
|
|
33
|
-
description: 'Terminate an application through the current Android Agent.',
|
|
34
|
-
stringInputKey: 'uri',
|
|
35
|
-
inputSchema: terminateInputSchema,
|
|
36
|
-
toArgs: (input)=>[
|
|
37
|
-
input.uri
|
|
38
|
-
],
|
|
39
|
-
toResult: (_output, input)=>({
|
|
40
|
-
summary: `Terminated ${input.uri}`
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
const runAdbShellNode = defineAndroidAgentNode({
|
|
44
|
-
method: 'runAdbShell',
|
|
45
|
-
title: 'Run an ADB shell command',
|
|
46
|
-
description: 'Execute a shell command through the current Android Agent. Pass only the shell command, without the adb shell prefix.',
|
|
47
|
-
stringInputKey: 'command',
|
|
48
|
-
inputSchema: runAdbShellInputSchema,
|
|
49
|
-
toArgs (input, context) {
|
|
50
|
-
context.signal.throwIfAborted();
|
|
51
|
-
if (/^\s*adb(?:\s|$)/i.test(input.command)) throw new TypeError('command must not include an adb or adb shell prefix.');
|
|
52
|
-
return [
|
|
53
|
-
input.command,
|
|
54
|
-
input.options
|
|
55
|
-
];
|
|
56
|
-
},
|
|
57
|
-
toResult (stdout) {
|
|
58
|
-
if ('string' != typeof stdout) throw new TypeError('runAdbShell() must return stdout as a string.');
|
|
59
|
-
return {
|
|
60
|
-
summary: `Executed ADB shell command (${stdout.length} stdout characters)`,
|
|
61
|
-
data: {
|
|
62
|
-
stdout
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
const backNode = defineAndroidAgentNode({
|
|
68
|
-
method: 'back',
|
|
69
|
-
description: 'Trigger the Android system back operation.',
|
|
70
|
-
stringInputKey: false,
|
|
71
|
-
inputSchema: emptyInputSchema,
|
|
72
|
-
toArgs: ()=>[],
|
|
73
|
-
toResult: ()=>({
|
|
74
|
-
summary: 'Triggered Android back'
|
|
75
|
-
})
|
|
76
|
-
});
|
|
77
|
-
const homeNode = defineAndroidAgentNode({
|
|
78
|
-
method: 'home',
|
|
79
|
-
description: 'Trigger the Android system home operation.',
|
|
80
|
-
stringInputKey: false,
|
|
81
|
-
inputSchema: emptyInputSchema,
|
|
82
|
-
toArgs: ()=>[],
|
|
83
|
-
toResult: ()=>({
|
|
84
|
-
summary: 'Triggered Android home'
|
|
85
|
-
})
|
|
86
|
-
});
|
|
87
|
-
const recentAppsNode = defineAndroidAgentNode({
|
|
88
|
-
method: 'recentApps',
|
|
89
|
-
description: 'Trigger the Android system recent apps operation.',
|
|
90
|
-
stringInputKey: false,
|
|
91
|
-
inputSchema: emptyInputSchema,
|
|
92
|
-
toArgs: ()=>[],
|
|
93
|
-
toResult: ()=>({
|
|
94
|
-
summary: 'Triggered Android recentApps'
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
const androidAgentTestRunnerNodeDefinitions = [
|
|
98
|
-
launchNode,
|
|
99
|
-
terminateNode,
|
|
100
|
-
runAdbShellNode,
|
|
101
|
-
backNode,
|
|
102
|
-
homeNode,
|
|
103
|
-
recentAppsNode
|
|
104
|
-
];
|
|
105
|
-
export { androidAgentTestRunnerNodeDefinitions, launchInputSchema, runAdbShellInputSchema, runAdbShellOptionsInputSchema, terminateInputSchema };
|
|
1
|
+
export { androidAgentTestRunnerNodeDefinitions, launchInputSchema, runAdbShellInputSchema, runAdbShellOptionsInputSchema, terminateInputSchema } from "./140.mjs";
|
package/dist/lib/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
-
return
|
|
3
|
+
return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
4
|
}();
|
|
5
5
|
var __webpack_modules__ = {
|
|
6
6
|
"./src/resource-path.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3573,7 +3573,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
3573
3573
|
const tools = new AndroidMidsceneTools();
|
|
3574
3574
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
|
|
3575
3575
|
stripPrefix: 'android_',
|
|
3576
|
-
version: "1.17.
|
|
3576
|
+
version: "1.17.8-beta-20261110095715.0",
|
|
3577
3577
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
3578
3578
|
}).catch((e)=>{
|
|
3579
3579
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
-
return
|
|
3
|
+
return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
4
|
}();
|
|
5
5
|
var __webpack_modules__ = {
|
|
6
6
|
"./src/resource-path.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1178,7 +1178,7 @@ function __webpack_require__(moduleId) {
|
|
|
1178
1178
|
})();
|
|
1179
1179
|
(()=>{
|
|
1180
1180
|
__webpack_require__.r = (exports1)=>{
|
|
1181
|
-
if (
|
|
1181
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
1182
1182
|
value: 'Module'
|
|
1183
1183
|
});
|
|
1184
1184
|
Object.defineProperty(exports1, '__esModule', {
|
package/dist/lib/test-runner.js
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/android",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.8-beta-20261110095715.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
"@yume-chan/adb-server-node-tcp": "2.5.2",
|
|
45
45
|
"@yume-chan/scrcpy": "2.3.0",
|
|
46
46
|
"@yume-chan/stream-extra": "2.6.1",
|
|
47
|
-
"appium-adb": "
|
|
48
|
-
"sharp": "^0.
|
|
47
|
+
"appium-adb": "15.0.9",
|
|
48
|
+
"sharp": "^0.35.5",
|
|
49
49
|
"zod": "^3.25.1",
|
|
50
|
-
"@midscene/
|
|
51
|
-
"@midscene/
|
|
50
|
+
"@midscene/core": "1.17.8-beta-20261110095715.0",
|
|
51
|
+
"@midscene/shared": "1.17.8-beta-20261110095715.0"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
54
|
"@ffmpeg-installer/ffmpeg": "^1.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@rslib/core": "
|
|
57
|
+
"@rslib/core": "~0.19.6",
|
|
58
58
|
"@rstest/core": "0.12.0",
|
|
59
59
|
"@types/node": "^18.0.0",
|
|
60
60
|
"dotenv": "^16.4.5",
|
|
61
|
-
"tsx": "^4.
|
|
61
|
+
"tsx": "^4.23.15",
|
|
62
62
|
"typescript": "^5.8.3",
|
|
63
|
-
"undici": "^
|
|
64
|
-
"@midscene/playground": "1.17.
|
|
63
|
+
"undici": "^7.30.1",
|
|
64
|
+
"@midscene/playground": "1.17.8-beta-20261110095715.0"
|
|
65
65
|
},
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"scripts": {
|