@godscene/shared 1.7.11

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.
Files changed (236) hide show
  1. package/README.md +9 -0
  2. package/dist/es/baseDB.mjs +109 -0
  3. package/dist/es/cli/cli-args.mjs +95 -0
  4. package/dist/es/cli/cli-error.mjs +24 -0
  5. package/dist/es/cli/cli-runner.mjs +122 -0
  6. package/dist/es/cli/index.mjs +4 -0
  7. package/dist/es/common.mjs +37 -0
  8. package/dist/es/constants/example-code.mjs +227 -0
  9. package/dist/es/constants/index.mjs +124 -0
  10. package/dist/es/env/basic.mjs +6 -0
  11. package/dist/es/env/constants.mjs +110 -0
  12. package/dist/es/env/global-config-manager.mjs +94 -0
  13. package/dist/es/env/helper.mjs +43 -0
  14. package/dist/es/env/index.mjs +5 -0
  15. package/dist/es/env/init-debug.mjs +18 -0
  16. package/dist/es/env/model-config-manager.mjs +79 -0
  17. package/dist/es/env/parse-model-config.mjs +165 -0
  18. package/dist/es/env/types.mjs +232 -0
  19. package/dist/es/env/utils.mjs +18 -0
  20. package/dist/es/extractor/constants.mjs +2 -0
  21. package/dist/es/extractor/cs_postmessage.mjs +61 -0
  22. package/dist/es/extractor/customLocator.mjs +641 -0
  23. package/dist/es/extractor/debug.mjs +6 -0
  24. package/dist/es/extractor/dom-util.mjs +96 -0
  25. package/dist/es/extractor/index.mjs +5 -0
  26. package/dist/es/extractor/locator.mjs +250 -0
  27. package/dist/es/extractor/tree.mjs +78 -0
  28. package/dist/es/extractor/util.mjs +245 -0
  29. package/dist/es/extractor/web-extractor.mjs +393 -0
  30. package/dist/es/img/box-select.mjs +824 -0
  31. package/dist/es/img/canvas-fallback.mjs +238 -0
  32. package/dist/es/img/get-photon.mjs +45 -0
  33. package/dist/es/img/get-sharp.mjs +11 -0
  34. package/dist/es/img/index.mjs +4 -0
  35. package/dist/es/img/info.mjs +35 -0
  36. package/dist/es/img/transform.mjs +275 -0
  37. package/dist/es/index.mjs +2 -0
  38. package/dist/es/key-alias-utils.mjs +19 -0
  39. package/dist/es/logger.mjs +64 -0
  40. package/dist/es/mcp/base-server.mjs +282 -0
  41. package/dist/es/mcp/base-tools.mjs +159 -0
  42. package/dist/es/mcp/chrome-path.mjs +35 -0
  43. package/dist/es/mcp/cli-report-session.mjs +78 -0
  44. package/dist/es/mcp/error-formatter.mjs +19 -0
  45. package/dist/es/mcp/index.mjs +9 -0
  46. package/dist/es/mcp/init-arg-utils.mjs +38 -0
  47. package/dist/es/mcp/inject-report-html-plugin.mjs +53 -0
  48. package/dist/es/mcp/launcher-helper.mjs +52 -0
  49. package/dist/es/mcp/tool-generator.mjs +419 -0
  50. package/dist/es/mcp/types.mjs +3 -0
  51. package/dist/es/node/fs.mjs +44 -0
  52. package/dist/es/node/index.mjs +2 -0
  53. package/dist/es/node/port.mjs +24 -0
  54. package/dist/es/polyfills/async-hooks.mjs +2 -0
  55. package/dist/es/polyfills/index.mjs +1 -0
  56. package/dist/es/types/index.mjs +3 -0
  57. package/dist/es/us-keyboard-layout.mjs +1414 -0
  58. package/dist/es/us-keyboard-layout.mjs.LICENSE.txt +5 -0
  59. package/dist/es/utils.mjs +72 -0
  60. package/dist/es/zod-schema-utils.mjs +54 -0
  61. package/dist/lib/baseDB.js +149 -0
  62. package/dist/lib/cli/cli-args.js +138 -0
  63. package/dist/lib/cli/cli-error.js +61 -0
  64. package/dist/lib/cli/cli-runner.js +181 -0
  65. package/dist/lib/cli/index.js +53 -0
  66. package/dist/lib/common.js +93 -0
  67. package/dist/lib/constants/example-code.js +264 -0
  68. package/dist/lib/constants/index.js +221 -0
  69. package/dist/lib/env/basic.js +40 -0
  70. package/dist/lib/env/constants.js +153 -0
  71. package/dist/lib/env/global-config-manager.js +128 -0
  72. package/dist/lib/env/helper.js +80 -0
  73. package/dist/lib/env/index.js +90 -0
  74. package/dist/lib/env/init-debug.js +52 -0
  75. package/dist/lib/env/model-config-manager.js +113 -0
  76. package/dist/lib/env/parse-model-config.js +211 -0
  77. package/dist/lib/env/types.js +572 -0
  78. package/dist/lib/env/utils.js +61 -0
  79. package/dist/lib/extractor/constants.js +42 -0
  80. package/dist/lib/extractor/cs_postmessage.js +98 -0
  81. package/dist/lib/extractor/customLocator.js +693 -0
  82. package/dist/lib/extractor/debug.js +12 -0
  83. package/dist/lib/extractor/dom-util.js +157 -0
  84. package/dist/lib/extractor/index.js +87 -0
  85. package/dist/lib/extractor/locator.js +296 -0
  86. package/dist/lib/extractor/tree.js +124 -0
  87. package/dist/lib/extractor/util.js +336 -0
  88. package/dist/lib/extractor/web-extractor.js +442 -0
  89. package/dist/lib/img/box-select.js +875 -0
  90. package/dist/lib/img/canvas-fallback.js +305 -0
  91. package/dist/lib/img/get-photon.js +82 -0
  92. package/dist/lib/img/get-sharp.js +45 -0
  93. package/dist/lib/img/index.js +95 -0
  94. package/dist/lib/img/info.js +92 -0
  95. package/dist/lib/img/transform.js +364 -0
  96. package/dist/lib/index.js +36 -0
  97. package/dist/lib/key-alias-utils.js +62 -0
  98. package/dist/lib/logger.js +114 -0
  99. package/dist/lib/mcp/base-server.js +332 -0
  100. package/dist/lib/mcp/base-tools.js +193 -0
  101. package/dist/lib/mcp/chrome-path.js +72 -0
  102. package/dist/lib/mcp/cli-report-session.js +121 -0
  103. package/dist/lib/mcp/error-formatter.js +53 -0
  104. package/dist/lib/mcp/index.js +114 -0
  105. package/dist/lib/mcp/init-arg-utils.js +78 -0
  106. package/dist/lib/mcp/inject-report-html-plugin.js +98 -0
  107. package/dist/lib/mcp/launcher-helper.js +86 -0
  108. package/dist/lib/mcp/tool-generator.js +456 -0
  109. package/dist/lib/mcp/types.js +40 -0
  110. package/dist/lib/node/fs.js +97 -0
  111. package/dist/lib/node/index.js +65 -0
  112. package/dist/lib/node/port.js +61 -0
  113. package/dist/lib/polyfills/async-hooks.js +36 -0
  114. package/dist/lib/polyfills/index.js +58 -0
  115. package/dist/lib/types/index.js +37 -0
  116. package/dist/lib/us-keyboard-layout.js +1457 -0
  117. package/dist/lib/us-keyboard-layout.js.LICENSE.txt +5 -0
  118. package/dist/lib/utils.js +148 -0
  119. package/dist/lib/zod-schema-utils.js +97 -0
  120. package/dist/types/baseDB.d.ts +25 -0
  121. package/dist/types/cli/cli-args.d.ts +8 -0
  122. package/dist/types/cli/cli-error.d.ts +5 -0
  123. package/dist/types/cli/cli-runner.d.ts +19 -0
  124. package/dist/types/cli/index.d.ts +4 -0
  125. package/dist/types/common.d.ts +12 -0
  126. package/dist/types/constants/example-code.d.ts +2 -0
  127. package/dist/types/constants/index.d.ts +61 -0
  128. package/dist/types/env/basic.d.ts +6 -0
  129. package/dist/types/env/constants.d.ts +50 -0
  130. package/dist/types/env/global-config-manager.d.ts +32 -0
  131. package/dist/types/env/helper.d.ts +4 -0
  132. package/dist/types/env/index.d.ts +4 -0
  133. package/dist/types/env/init-debug.d.ts +1 -0
  134. package/dist/types/env/model-config-manager.d.ts +25 -0
  135. package/dist/types/env/parse-model-config.d.ts +31 -0
  136. package/dist/types/env/types.d.ts +339 -0
  137. package/dist/types/env/utils.d.ts +7 -0
  138. package/dist/types/extractor/constants.d.ts +1 -0
  139. package/dist/types/extractor/cs_postmessage.d.ts +2 -0
  140. package/dist/types/extractor/customLocator.d.ts +69 -0
  141. package/dist/types/extractor/debug.d.ts +1 -0
  142. package/dist/types/extractor/dom-util.d.ts +57 -0
  143. package/dist/types/extractor/index.d.ts +33 -0
  144. package/dist/types/extractor/locator.d.ts +9 -0
  145. package/dist/types/extractor/tree.d.ts +6 -0
  146. package/dist/types/extractor/util.d.ts +47 -0
  147. package/dist/types/extractor/web-extractor.d.ts +24 -0
  148. package/dist/types/img/box-select.d.ts +26 -0
  149. package/dist/types/img/canvas-fallback.d.ts +105 -0
  150. package/dist/types/img/get-photon.d.ts +19 -0
  151. package/dist/types/img/get-sharp.d.ts +3 -0
  152. package/dist/types/img/index.d.ts +3 -0
  153. package/dist/types/img/info.d.ts +34 -0
  154. package/dist/types/img/transform.d.ts +98 -0
  155. package/dist/types/index.d.ts +2 -0
  156. package/dist/types/key-alias-utils.d.ts +9 -0
  157. package/dist/types/logger.d.ts +5 -0
  158. package/dist/types/mcp/base-server.d.ts +93 -0
  159. package/dist/types/mcp/base-tools.d.ts +148 -0
  160. package/dist/types/mcp/chrome-path.d.ts +2 -0
  161. package/dist/types/mcp/cli-report-session.d.ts +12 -0
  162. package/dist/types/mcp/error-formatter.d.ts +12 -0
  163. package/dist/types/mcp/index.d.ts +9 -0
  164. package/dist/types/mcp/init-arg-utils.d.ts +13 -0
  165. package/dist/types/mcp/inject-report-html-plugin.d.ts +18 -0
  166. package/dist/types/mcp/launcher-helper.d.ts +94 -0
  167. package/dist/types/mcp/tool-generator.d.ts +10 -0
  168. package/dist/types/mcp/types.d.ts +113 -0
  169. package/dist/types/node/fs.d.ts +15 -0
  170. package/dist/types/node/index.d.ts +2 -0
  171. package/dist/types/node/port.d.ts +8 -0
  172. package/dist/types/polyfills/async-hooks.d.ts +6 -0
  173. package/dist/types/polyfills/index.d.ts +4 -0
  174. package/dist/types/types/index.d.ts +36 -0
  175. package/dist/types/us-keyboard-layout.d.ts +32 -0
  176. package/dist/types/utils.d.ts +34 -0
  177. package/dist/types/zod-schema-utils.d.ts +23 -0
  178. package/package.json +125 -0
  179. package/src/baseDB.ts +158 -0
  180. package/src/cli/cli-args.ts +173 -0
  181. package/src/cli/cli-error.ts +24 -0
  182. package/src/cli/cli-runner.ts +230 -0
  183. package/src/cli/index.ts +4 -0
  184. package/src/common.ts +67 -0
  185. package/src/constants/example-code.ts +227 -0
  186. package/src/constants/index.ts +139 -0
  187. package/src/env/basic.ts +12 -0
  188. package/src/env/constants.ts +303 -0
  189. package/src/env/global-config-manager.ts +191 -0
  190. package/src/env/helper.ts +58 -0
  191. package/src/env/index.ts +4 -0
  192. package/src/env/init-debug.ts +34 -0
  193. package/src/env/model-config-manager.ts +149 -0
  194. package/src/env/parse-model-config.ts +357 -0
  195. package/src/env/types.ts +583 -0
  196. package/src/env/utils.ts +39 -0
  197. package/src/extractor/constants.ts +5 -0
  198. package/src/extractor/cs_postmessage.ts +136 -0
  199. package/src/extractor/customLocator.ts +1245 -0
  200. package/src/extractor/debug.ts +10 -0
  201. package/src/extractor/dom-util.ts +231 -0
  202. package/src/extractor/index.ts +50 -0
  203. package/src/extractor/locator.ts +469 -0
  204. package/src/extractor/tree.ts +179 -0
  205. package/src/extractor/util.ts +482 -0
  206. package/src/extractor/web-extractor.ts +617 -0
  207. package/src/img/box-select.ts +588 -0
  208. package/src/img/canvas-fallback.ts +393 -0
  209. package/src/img/get-photon.ts +108 -0
  210. package/src/img/get-sharp.ts +18 -0
  211. package/src/img/index.ts +27 -0
  212. package/src/img/info.ts +102 -0
  213. package/src/img/transform.ts +553 -0
  214. package/src/index.ts +1 -0
  215. package/src/key-alias-utils.ts +23 -0
  216. package/src/logger.ts +96 -0
  217. package/src/mcp/base-server.ts +500 -0
  218. package/src/mcp/base-tools.ts +391 -0
  219. package/src/mcp/chrome-path.ts +48 -0
  220. package/src/mcp/cli-report-session.ts +130 -0
  221. package/src/mcp/error-formatter.ts +52 -0
  222. package/src/mcp/index.ts +9 -0
  223. package/src/mcp/init-arg-utils.ts +105 -0
  224. package/src/mcp/inject-report-html-plugin.ts +119 -0
  225. package/src/mcp/launcher-helper.ts +200 -0
  226. package/src/mcp/tool-generator.ts +658 -0
  227. package/src/mcp/types.ts +131 -0
  228. package/src/node/fs.ts +84 -0
  229. package/src/node/index.ts +2 -0
  230. package/src/node/port.ts +37 -0
  231. package/src/polyfills/async-hooks.ts +6 -0
  232. package/src/polyfills/index.ts +4 -0
  233. package/src/types/index.ts +54 -0
  234. package/src/us-keyboard-layout.ts +723 -0
  235. package/src/utils.ts +149 -0
  236. package/src/zod-schema-utils.ts +133 -0
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ CLIError: ()=>external_cli_error_js_namespaceObject.CLIError,
28
+ parseCliArgs: ()=>external_cli_args_js_namespaceObject.parseCliArgs,
29
+ parseValue: ()=>external_cli_args_js_namespaceObject.parseValue,
30
+ runToolsCLI: ()=>external_cli_runner_js_namespaceObject.runToolsCLI,
31
+ reportCLIError: ()=>external_cli_error_js_namespaceObject.reportCLIError,
32
+ removePrefix: ()=>external_cli_runner_js_namespaceObject.removePrefix
33
+ });
34
+ const external_cli_error_js_namespaceObject = require("./cli-error.js");
35
+ const external_cli_args_js_namespaceObject = require("./cli-args.js");
36
+ const external_cli_runner_js_namespaceObject = require("./cli-runner.js");
37
+ exports.CLIError = __webpack_exports__.CLIError;
38
+ exports.parseCliArgs = __webpack_exports__.parseCliArgs;
39
+ exports.parseValue = __webpack_exports__.parseValue;
40
+ exports.removePrefix = __webpack_exports__.removePrefix;
41
+ exports.reportCLIError = __webpack_exports__.reportCLIError;
42
+ exports.runToolsCLI = __webpack_exports__.runToolsCLI;
43
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
44
+ "CLIError",
45
+ "parseCliArgs",
46
+ "parseValue",
47
+ "removePrefix",
48
+ "reportCLIError",
49
+ "runToolsCLI"
50
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
51
+ Object.defineProperty(exports, '__esModule', {
52
+ value: true
53
+ });
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED: ()=>ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED,
37
+ getMidsceneRunBaseDir: ()=>getMidsceneRunBaseDir,
38
+ getMidsceneRunDir: ()=>getMidsceneRunDir,
39
+ getMidsceneRunSubDir: ()=>getMidsceneRunSubDir,
40
+ defaultRunDirName: ()=>defaultRunDirName
41
+ });
42
+ const external_node_fs_namespaceObject = require("node:fs");
43
+ const external_node_os_namespaceObject = require("node:os");
44
+ const external_node_path_namespaceObject = require("node:path");
45
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
46
+ const basic_js_namespaceObject = require("./env/basic.js");
47
+ const types_js_namespaceObject = require("./env/types.js");
48
+ const external_utils_js_namespaceObject = require("./utils.js");
49
+ const defaultRunDirName = 'midscene_run';
50
+ const getMidsceneRunDir = ()=>{
51
+ if (!external_utils_js_namespaceObject.ifInNode) return '';
52
+ return (0, basic_js_namespaceObject.getBasicEnvValue)(types_js_namespaceObject.MIDSCENE_RUN_DIR) || defaultRunDirName;
53
+ };
54
+ const getMidsceneRunBaseDir = ()=>{
55
+ if (!external_utils_js_namespaceObject.ifInNode) return '';
56
+ let basePath = external_node_path_default().resolve(process.cwd(), getMidsceneRunDir());
57
+ if (!(0, external_node_fs_namespaceObject.existsSync)(basePath)) try {
58
+ (0, external_node_fs_namespaceObject.mkdirSync)(basePath, {
59
+ recursive: true
60
+ });
61
+ } catch (error) {
62
+ basePath = external_node_path_default().join((0, external_node_os_namespaceObject.tmpdir)(), defaultRunDirName);
63
+ (0, external_node_fs_namespaceObject.mkdirSync)(basePath, {
64
+ recursive: true
65
+ });
66
+ }
67
+ return basePath;
68
+ };
69
+ const getMidsceneRunSubDir = (subdir)=>{
70
+ if (!external_utils_js_namespaceObject.ifInNode) return '';
71
+ const basePath = getMidsceneRunBaseDir();
72
+ const logPath = external_node_path_default().join(basePath, subdir);
73
+ if (!(0, external_node_fs_namespaceObject.existsSync)(logPath)) (0, external_node_fs_namespaceObject.mkdirSync)(logPath, {
74
+ recursive: true
75
+ });
76
+ return logPath;
77
+ };
78
+ const ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = 'NOT_IMPLEMENTED_AS_DESIGNED';
79
+ exports.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = __webpack_exports__.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED;
80
+ exports.defaultRunDirName = __webpack_exports__.defaultRunDirName;
81
+ exports.getMidsceneRunBaseDir = __webpack_exports__.getMidsceneRunBaseDir;
82
+ exports.getMidsceneRunDir = __webpack_exports__.getMidsceneRunDir;
83
+ exports.getMidsceneRunSubDir = __webpack_exports__.getMidsceneRunSubDir;
84
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
85
+ "ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED",
86
+ "defaultRunDirName",
87
+ "getMidsceneRunBaseDir",
88
+ "getMidsceneRunDir",
89
+ "getMidsceneRunSubDir"
90
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
91
+ Object.defineProperty(exports, '__esModule', {
92
+ value: true
93
+ });
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ PLAYWRIGHT_EXAMPLE_CODE: ()=>PLAYWRIGHT_EXAMPLE_CODE,
28
+ YAML_EXAMPLE_CODE: ()=>YAML_EXAMPLE_CODE
29
+ });
30
+ const PLAYWRIGHT_EXAMPLE_CODE = `
31
+ // Reference the following code to generate Midscene test cases
32
+ // The following is test code for Midscene AI, for reference
33
+ // The following is Playwright syntax, you can use Playwright to assist in test generation
34
+ IMPORTANT: Follow these exact type signatures for AI functions:
35
+
36
+ // Type signatures for AI functions:
37
+ aiAct(prompt: string, options?: { cacheable?: boolean, deepThink?: 'unset' | true | false }): Promise<void>
38
+ aiInput(text: string, locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
39
+ aiTap(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
40
+ aiHover(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
41
+ aiDoubleClick(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
42
+ aiKeyboardPress(key: string, locate?: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
43
+ aiScroll(locate: string | undefined, options: {
44
+ direction?: 'up' | 'down' | 'left' | 'right',
45
+ scrollType?: 'singleAction' | 'scrollToBottom' | 'scrollToTop' | 'scrollToRight' | 'scrollToLeft',
46
+ distance?: number | null,
47
+ deepLocate?: boolean,
48
+ xpath?: string,
49
+ cacheable?: boolean
50
+ }): Promise<void>
51
+ aiAssert(assertion: string, options?: { errorMessage?: string }): Promise<void>
52
+ aiWaitFor(prompt: string, options?: { timeout?: number }): Promise<void>
53
+ aiQuery<T>(queryObject: Record<string, string>): Promise<T> // Extracts data from page based on descriptions
54
+
55
+ // examples:
56
+ // Reference the following code to generate Midscene test cases
57
+ // The following is test code for Midscene AI, for reference
58
+ // The following is Playwright syntax, you can use Playwright to assist in test generation
59
+ import { test as base } from '@playwright/test';
60
+ import type { PlayWrightAiFixtureType } from '@godscene/web/playwright';
61
+ import { PlaywrightAiFixture } from '@godscene/web/playwright';
62
+
63
+ const test = base.extend<PlayWrightAiFixtureType>(PlaywrightAiFixture({
64
+ waitForNetworkIdleTimeout: 2000, // optional, the timeout for waiting for network idle between each action, default is 2000ms
65
+ }));
66
+
67
+
68
+ test.beforeEach(async ({ page }) => {
69
+ await page.goto('https://www.xxx.com/');
70
+ await page.setViewportSize({ width: 1920, height: 1080 });
71
+ });
72
+
73
+ test('ai shop', async ({
74
+ aiAct,
75
+ aiInput,
76
+ aiAssert,
77
+ aiQuery,
78
+ aiKeyboardPress,
79
+ aiHover,
80
+ aiTap,
81
+ aiWaitFor,
82
+ agentForPage,
83
+ page,
84
+ }) => {
85
+ // login
86
+ await aiAssert('The page shows the login interface');
87
+ await aiInput('user_name', 'in user name input');
88
+ await aiInput('password', 'in password input');
89
+ await aiKeyboardPress('Enter', 'Login Button');
90
+
91
+ // check the login success
92
+ await aiWaitFor('The page shows that the loading is complete');
93
+ await aiAssert('The current page shows the product detail page');
94
+
95
+ // check the product info
96
+ const dataA = await aiQuery({
97
+ userInfo: 'User information in the format {name: string}',
98
+ theFirstProductInfo: 'The first product info in the format {name: string, price: number}',
99
+ });
100
+ expect(dataA.theFirstProductInfo.name).toBe('xxx');
101
+ expect(dataA.theFirstProductInfo.price).toBe(100);
102
+
103
+
104
+ // add to cart
105
+ await aiTap('click add to cart button');
106
+
107
+ await aiTap('click right top cart icon');
108
+ await aiAssert('The cart icon shows the number 1');
109
+ });
110
+ `;
111
+ const YAML_EXAMPLE_CODE = `
112
+ CRITICAL - YAML Indentation Rules:
113
+ For actions with additional parameters (aiScroll, aiInput, aiKeyboardPress), the parameters must be SIBLING keys at the SAME indentation level as the action key, NOT nested children indented further.
114
+ CORRECT (parameters align with the action key):
115
+ - aiScroll:
116
+ direction: 'down'
117
+ scrollType: 'singleAction'
118
+ distance: 500
119
+ locate: "main content area"
120
+ - aiInput: 'text value'
121
+ locate: 'input field description'
122
+ WRONG (parameters are indented further than the action key, DO NOT do this):
123
+ - aiScroll:
124
+ direction: 'down'
125
+ scrollType: 'singleAction'
126
+ - aiInput: 'text value'
127
+ locate: 'input field description'
128
+
129
+ 1. Format:
130
+
131
+ web:
132
+ url: "starting_url"
133
+ viewportWidth: 1280
134
+ viewportHeight: 960
135
+
136
+ tasks:
137
+ - name: "descriptive task name"
138
+ flow:
139
+ - aiTap: "element description"
140
+ xpath: '/html/body/div[1]/button[1]'
141
+ - aiInput: 'text value'
142
+ locate: 'input field description'
143
+ xpath: '/html/body/div[1]/input[1]'
144
+ - aiScroll:
145
+ direction: 'down'
146
+ scrollType: 'singleAction'
147
+ distance: 500
148
+ locate: "scrollable area description"
149
+ xpath: '/html/body/div[1]/main[1]'
150
+ - aiAssert: "expected state"
151
+ - sleep: 1000
152
+
153
+ 2. Action Types:
154
+ - aiTap: for clicks (natural language targeting)
155
+ - aiInput: for text input with 'locate' field
156
+ - aiScroll: with direction and scrollType
157
+ - aiAssert: for validations
158
+ - sleep: for delays (milliseconds)
159
+
160
+
161
+
162
+ YAML type
163
+ tasks:
164
+ - name: <name>
165
+ continueOnError: <boolean> # Optional, whether to continue to the next task on error, defaults to false.
166
+ flow:
167
+ # Auto Planning (.ai)
168
+ # ----------------
169
+
170
+ # Perform an interaction. \`ai\` is a shorthand for \`aiAct\`.
171
+ - ai: <prompt>
172
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
173
+
174
+ # This usage is the same as \`ai\`.
175
+ - aiAct: <prompt>
176
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
177
+
178
+ # Instant Action (.aiTap, .aiDoubleClick, .aiHover, .aiInput, .aiKeyboardPress, .aiScroll)
179
+ # ----------------
180
+
181
+ # Tap an element described by a prompt.
182
+ - aiTap: <prompt>
183
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
184
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
185
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
186
+
187
+ # Double click an element described by a prompt.
188
+ - aiDoubleClick: <prompt>
189
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
190
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
191
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
192
+
193
+ # Hover over an element described by a prompt.
194
+ - aiHover: <prompt>
195
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
196
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
197
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
198
+
199
+ # Input text into an element described by a prompt.
200
+ - aiInput: <final text content of the input>
201
+ locate: <prompt>
202
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
203
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
204
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
205
+
206
+ # Press a key (e.g., Enter, Tab, Escape) on an element described by a prompt.
207
+ - aiKeyboardPress: <key>
208
+ locate: <prompt>
209
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
210
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
211
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
212
+
213
+ # Scroll globally or on an element described by a prompt.
214
+ - aiScroll:
215
+ direction: 'up' # or 'down' | 'left' | 'right'
216
+ scrollType: 'singleAction' # or 'scrollToTop' | 'scrollToBottom' | 'scrollToLeft' | 'scrollToRight'
217
+ distance: <number> # Optional, the scroll distance in pixels.
218
+ locate: <prompt> # Optional, the element to scroll on.
219
+ deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
220
+ xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
221
+ cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
222
+
223
+ # Record the current screenshot with a description in the report file.
224
+ - recordToReport: <title> # Optional, the title of the screenshot. If not provided, the title will be 'untitled'.
225
+ content: <content> # Optional, the description of the screenshot.
226
+
227
+ # Data Extraction
228
+ # ----------------
229
+
230
+ # Perform a query that returns a JSON object.
231
+ - aiQuery: <prompt> # Remember to describe the format of the result in the prompt.
232
+ name: <name> # The key for the query result in the JSON output.
233
+
234
+ # More APIs
235
+ # ----------------
236
+
237
+ # Wait for a condition to be met, with a timeout (in ms, optional, defaults to 30000).
238
+ - aiWaitFor: <prompt>
239
+ timeout: <ms>
240
+
241
+ # Perform an assertion.
242
+ - aiAssert: <prompt>
243
+ errorMessage: <error-message> # Optional, the error message to print if the assertion fails.
244
+
245
+ # Wait for a specified amount of time.
246
+ - sleep: <ms>
247
+
248
+ # Execute a piece of JavaScript code in the web page context.
249
+ - javascript: <javascript>
250
+ name: <name> # Optional, assign a name to the return value, which will be used as a key in the JSON output.
251
+
252
+ - name: <name>
253
+ flow:
254
+ # ...
255
+ `;
256
+ exports.PLAYWRIGHT_EXAMPLE_CODE = __webpack_exports__.PLAYWRIGHT_EXAMPLE_CODE;
257
+ exports.YAML_EXAMPLE_CODE = __webpack_exports__.YAML_EXAMPLE_CODE;
258
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
259
+ "PLAYWRIGHT_EXAMPLE_CODE",
260
+ "YAML_EXAMPLE_CODE"
261
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
262
+ Object.defineProperty(exports, '__esModule', {
263
+ value: true
264
+ });
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT: ()=>DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT,
28
+ SCRCPY_PUSH_TIMEOUT_MS: ()=>SCRCPY_PUSH_TIMEOUT_MS,
29
+ CONTAINER_MINI_WIDTH: ()=>CONTAINER_MINI_WIDTH,
30
+ DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY: ()=>DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY,
31
+ DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT: ()=>DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT,
32
+ TEXT_MAX_SIZE: ()=>TEXT_MAX_SIZE,
33
+ SCRCPY_PREVIEW_METADATA_TIMEOUT_MS: ()=>SCRCPY_PREVIEW_METADATA_TIMEOUT_MS,
34
+ WEBDRIVER_ELEMENT_ID_KEY: ()=>WEBDRIVER_ELEMENT_ID_KEY,
35
+ YAML_EXAMPLE_CODE: ()=>external_example_code_js_namespaceObject.YAML_EXAMPLE_CODE,
36
+ rpastudioCommand: ()=>rpastudioCommand,
37
+ CONTAINER_MINI_HEIGHT: ()=>CONTAINER_MINI_HEIGHT,
38
+ SCRCPY_VIDEO_STREAM_TIMEOUT_MS: ()=>SCRCPY_VIDEO_STREAM_TIMEOUT_MS,
39
+ SCRCPY_ADB_CONNECT_TIMEOUT_MS: ()=>SCRCPY_ADB_CONNECT_TIMEOUT_MS,
40
+ SCRCPY_START_TIMEOUT_MS: ()=>SCRCPY_START_TIMEOUT_MS,
41
+ rpasceneCommand: ()=>rpasceneCommand,
42
+ PLAYGROUND_SERVER_PORT: ()=>PLAYGROUND_SERVER_PORT,
43
+ commandMap: ()=>commandMap,
44
+ DEFAULT_WDA_PORT: ()=>DEFAULT_WDA_PORT,
45
+ NodeType: ()=>constants_NodeType,
46
+ PLAYWRIGHT_EXAMPLE_CODE: ()=>external_example_code_js_namespaceObject.PLAYWRIGHT_EXAMPLE_CODE,
47
+ SCRCPY_SERVER_PORT: ()=>SCRCPY_SERVER_PORT,
48
+ TEXT_SIZE_THRESHOLD: ()=>TEXT_SIZE_THRESHOLD
49
+ });
50
+ const external_example_code_js_namespaceObject = require("./example-code.js");
51
+ const TEXT_SIZE_THRESHOLD = 9;
52
+ const TEXT_MAX_SIZE = 40;
53
+ const CONTAINER_MINI_HEIGHT = 3;
54
+ const CONTAINER_MINI_WIDTH = 3;
55
+ var constants_NodeType = /*#__PURE__*/ function(NodeType) {
56
+ NodeType["CONTAINER"] = "CONTAINER Node";
57
+ NodeType["FORM_ITEM"] = "FORM_ITEM Node";
58
+ NodeType["BUTTON"] = "BUTTON Node";
59
+ NodeType["A"] = "Anchor Node";
60
+ NodeType["IMG"] = "IMG Node";
61
+ NodeType["TEXT"] = "TEXT Node";
62
+ NodeType["POSITION"] = "POSITION Node";
63
+ return NodeType;
64
+ }({});
65
+ const PLAYGROUND_SERVER_PORT = 5800;
66
+ const SCRCPY_SERVER_PORT = 5700;
67
+ const SCRCPY_ADB_CONNECT_TIMEOUT_MS = 10000;
68
+ const SCRCPY_PUSH_TIMEOUT_MS = 10000;
69
+ const SCRCPY_START_TIMEOUT_MS = 15000;
70
+ const SCRCPY_VIDEO_STREAM_TIMEOUT_MS = 15000;
71
+ const SCRCPY_PREVIEW_METADATA_TIMEOUT_MS = SCRCPY_ADB_CONNECT_TIMEOUT_MS + SCRCPY_PUSH_TIMEOUT_MS + SCRCPY_START_TIMEOUT_MS + SCRCPY_VIDEO_STREAM_TIMEOUT_MS + 5000;
72
+ const WEBDRIVER_ELEMENT_ID_KEY = 'element-6066-11e4-a52e-4f735466cecf';
73
+ const DEFAULT_WDA_PORT = 8100;
74
+ const DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT = 5000;
75
+ const DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT = 2000;
76
+ const DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY = 2;
77
+ const rpasceneCommand = {
78
+ Tap: 'Tap',
79
+ RightClick: 'RightClick',
80
+ DoubleClick: 'DoubleClick',
81
+ Hover: 'Hover',
82
+ Input: 'Input',
83
+ KeyboardPress: 'KeyboardPress',
84
+ Scroll: 'Scroll',
85
+ DragAndDrop: 'DragAndDrop',
86
+ ClearInput: 'ClearInput',
87
+ Sleep: 'Sleep',
88
+ LongPress: 'LongPress',
89
+ Swipe: 'Swipe',
90
+ Reload: 'Reload',
91
+ GoBack: 'GoBack',
92
+ Navigate: 'Navigate'
93
+ };
94
+ const rpastudioCommand = {
95
+ SeleniumClickCommand: 'SeleniumClickCommand',
96
+ SeleniumRightClickCommand: 'SeleniumRightClickCommand',
97
+ SeleniumDoubleClickCommand: 'SeleniumDoubleClickCommand',
98
+ SeleniumMouseHoverCommand: 'SeleniumMouseHoverCommand',
99
+ SeleniumSetValueCommand: 'SeleniumSetValueCommand',
100
+ SeleniumElementSendKeysCommand: 'SeleniumElementSendKeysCommand',
101
+ SeleniumSendKeysCommand: 'SeleniumSendKeysCommand',
102
+ SeleniumElementScrollCommand: 'SeleniumElementScrollCommand',
103
+ SeleniumWindowScrollCommand: 'SeleniumWindowScrollCommand',
104
+ SeleniumDragAndDropCommand: 'SeleniumDragAndDropCommand',
105
+ SeleniumClearValueCommand: 'SeleniumClearValueCommand',
106
+ PauseCommand: 'PauseCommand',
107
+ SeleniumBrowserRefreshCommand: 'SeleniumBrowserRefreshCommand',
108
+ SeleniumBrowserNavigateBackCommand: 'SeleniumBrowserNavigateBackCommand',
109
+ SeleniumBrowserNavigateCommand: 'SeleniumBrowserNavigateCommand'
110
+ };
111
+ const commandMap = {
112
+ [rpasceneCommand.Tap]: {
113
+ CommandName: rpastudioCommand.SeleniumClickCommand,
114
+ DisplayName: '元素点击'
115
+ },
116
+ [rpasceneCommand.RightClick]: {
117
+ CommandName: rpastudioCommand.SeleniumRightClickCommand,
118
+ DisplayName: '元素右键点击'
119
+ },
120
+ [rpasceneCommand.DoubleClick]: {
121
+ CommandName: rpastudioCommand.SeleniumDoubleClickCommand,
122
+ DisplayName: '元素双击'
123
+ },
124
+ [rpasceneCommand.Hover]: {
125
+ CommandName: rpastudioCommand.SeleniumMouseHoverCommand,
126
+ DisplayName: '鼠标悬停'
127
+ },
128
+ [rpasceneCommand.Input]: {
129
+ CommandName: rpastudioCommand.SeleniumSetValueCommand,
130
+ DisplayName: '设置文本'
131
+ },
132
+ [rpasceneCommand.KeyboardPress]: {
133
+ CommandName: rpastudioCommand.SeleniumElementSendKeysCommand,
134
+ DisplayName: '模拟按键'
135
+ },
136
+ [rpasceneCommand.Scroll]: {
137
+ CommandName: rpastudioCommand.SeleniumElementScrollCommand,
138
+ DisplayName: '元素滚动'
139
+ },
140
+ [rpasceneCommand.DragAndDrop]: {
141
+ CommandName: rpastudioCommand.SeleniumDragAndDropCommand,
142
+ DisplayName: '元素拖拽(至指定元素)'
143
+ },
144
+ [rpasceneCommand.ClearInput]: {
145
+ CommandName: rpastudioCommand.SeleniumClearValueCommand,
146
+ DisplayName: '清空文本'
147
+ },
148
+ [rpasceneCommand.Sleep]: {
149
+ CommandName: rpastudioCommand.PauseCommand,
150
+ DisplayName: '暂停脚本'
151
+ },
152
+ [rpasceneCommand.LongPress]: {
153
+ CommandName: '',
154
+ DisplayName: ''
155
+ },
156
+ [rpasceneCommand.Swipe]: {
157
+ CommandName: '',
158
+ DisplayName: ''
159
+ },
160
+ [rpasceneCommand.Reload]: {
161
+ CommandName: rpastudioCommand.SeleniumBrowserRefreshCommand,
162
+ DisplayName: '刷新'
163
+ },
164
+ [rpasceneCommand.GoBack]: {
165
+ CommandName: rpastudioCommand.SeleniumBrowserNavigateBackCommand,
166
+ DisplayName: '后退'
167
+ },
168
+ [rpasceneCommand.Navigate]: {
169
+ CommandName: rpastudioCommand.SeleniumBrowserNavigateCommand,
170
+ DisplayName: '打开页面'
171
+ }
172
+ };
173
+ exports.CONTAINER_MINI_HEIGHT = __webpack_exports__.CONTAINER_MINI_HEIGHT;
174
+ exports.CONTAINER_MINI_WIDTH = __webpack_exports__.CONTAINER_MINI_WIDTH;
175
+ exports.DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT = __webpack_exports__.DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT;
176
+ exports.DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY = __webpack_exports__.DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY;
177
+ exports.DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT = __webpack_exports__.DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT;
178
+ exports.DEFAULT_WDA_PORT = __webpack_exports__.DEFAULT_WDA_PORT;
179
+ exports.NodeType = __webpack_exports__.NodeType;
180
+ exports.PLAYGROUND_SERVER_PORT = __webpack_exports__.PLAYGROUND_SERVER_PORT;
181
+ exports.PLAYWRIGHT_EXAMPLE_CODE = __webpack_exports__.PLAYWRIGHT_EXAMPLE_CODE;
182
+ exports.SCRCPY_ADB_CONNECT_TIMEOUT_MS = __webpack_exports__.SCRCPY_ADB_CONNECT_TIMEOUT_MS;
183
+ exports.SCRCPY_PREVIEW_METADATA_TIMEOUT_MS = __webpack_exports__.SCRCPY_PREVIEW_METADATA_TIMEOUT_MS;
184
+ exports.SCRCPY_PUSH_TIMEOUT_MS = __webpack_exports__.SCRCPY_PUSH_TIMEOUT_MS;
185
+ exports.SCRCPY_SERVER_PORT = __webpack_exports__.SCRCPY_SERVER_PORT;
186
+ exports.SCRCPY_START_TIMEOUT_MS = __webpack_exports__.SCRCPY_START_TIMEOUT_MS;
187
+ exports.SCRCPY_VIDEO_STREAM_TIMEOUT_MS = __webpack_exports__.SCRCPY_VIDEO_STREAM_TIMEOUT_MS;
188
+ exports.TEXT_MAX_SIZE = __webpack_exports__.TEXT_MAX_SIZE;
189
+ exports.TEXT_SIZE_THRESHOLD = __webpack_exports__.TEXT_SIZE_THRESHOLD;
190
+ exports.WEBDRIVER_ELEMENT_ID_KEY = __webpack_exports__.WEBDRIVER_ELEMENT_ID_KEY;
191
+ exports.YAML_EXAMPLE_CODE = __webpack_exports__.YAML_EXAMPLE_CODE;
192
+ exports.commandMap = __webpack_exports__.commandMap;
193
+ exports.rpasceneCommand = __webpack_exports__.rpasceneCommand;
194
+ exports.rpastudioCommand = __webpack_exports__.rpastudioCommand;
195
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
196
+ "CONTAINER_MINI_HEIGHT",
197
+ "CONTAINER_MINI_WIDTH",
198
+ "DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT",
199
+ "DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY",
200
+ "DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT",
201
+ "DEFAULT_WDA_PORT",
202
+ "NodeType",
203
+ "PLAYGROUND_SERVER_PORT",
204
+ "PLAYWRIGHT_EXAMPLE_CODE",
205
+ "SCRCPY_ADB_CONNECT_TIMEOUT_MS",
206
+ "SCRCPY_PREVIEW_METADATA_TIMEOUT_MS",
207
+ "SCRCPY_PUSH_TIMEOUT_MS",
208
+ "SCRCPY_SERVER_PORT",
209
+ "SCRCPY_START_TIMEOUT_MS",
210
+ "SCRCPY_VIDEO_STREAM_TIMEOUT_MS",
211
+ "TEXT_MAX_SIZE",
212
+ "TEXT_SIZE_THRESHOLD",
213
+ "WEBDRIVER_ELEMENT_ID_KEY",
214
+ "YAML_EXAMPLE_CODE",
215
+ "commandMap",
216
+ "rpasceneCommand",
217
+ "rpastudioCommand"
218
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
219
+ Object.defineProperty(exports, '__esModule', {
220
+ value: true
221
+ });
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ getBasicEnvValue: ()=>getBasicEnvValue
28
+ });
29
+ const external_types_js_namespaceObject = require("./types.js");
30
+ const getBasicEnvValue = (key)=>{
31
+ if (!external_types_js_namespaceObject.BASIC_ENV_KEYS.includes(key)) throw new Error(`getBasicEnvValue with key ${key} is not supported.`);
32
+ return process.env[key];
33
+ };
34
+ exports.getBasicEnvValue = __webpack_exports__.getBasicEnvValue;
35
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
36
+ "getBasicEnvValue"
37
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
38
+ Object.defineProperty(exports, '__esModule', {
39
+ value: true
40
+ });