@rpascene/shared 0.30.8 → 0.30.9

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 (56) hide show
  1. package/README.md +2 -2
  2. package/dist/es/common.mjs +9 -9
  3. package/dist/es/constants/example-code.mjs +10 -10
  4. package/dist/es/constants/index.mjs +1 -1
  5. package/dist/es/env/constants.mjs +77 -77
  6. package/dist/es/env/global-config-manager.mjs +1 -1
  7. package/dist/es/env/init-debug.mjs +5 -5
  8. package/dist/es/env/model-config-manager.mjs +1 -1
  9. package/dist/es/env/parse.mjs +11 -11
  10. package/dist/es/env/types.mjs +191 -191
  11. package/dist/es/env/utils.mjs +2 -2
  12. package/dist/es/extractor/debug.mjs +2 -2
  13. package/dist/es/extractor/util.mjs +11 -11
  14. package/dist/es/extractor/web-extractor.mjs +7 -7
  15. package/dist/es/logger.mjs +3 -3
  16. package/dist/es/node/fs.mjs +6 -6
  17. package/dist/es/utils.mjs +2 -2
  18. package/dist/lib/common.js +16 -16
  19. package/dist/lib/constants/example-code.js +10 -10
  20. package/dist/lib/constants/index.js +1 -1
  21. package/dist/lib/env/constants.js +76 -76
  22. package/dist/lib/env/global-config-manager.js +1 -1
  23. package/dist/lib/env/init-debug.js +4 -4
  24. package/dist/lib/env/model-config-manager.js +1 -1
  25. package/dist/lib/env/parse.js +10 -10
  26. package/dist/lib/env/types.js +478 -478
  27. package/dist/lib/env/utils.js +1 -1
  28. package/dist/lib/extractor/debug.js +1 -1
  29. package/dist/lib/extractor/util.js +16 -16
  30. package/dist/lib/extractor/web-extractor.js +6 -6
  31. package/dist/lib/logger.js +2 -2
  32. package/dist/lib/node/fs.js +6 -6
  33. package/dist/lib/utils.js +2 -2
  34. package/dist/types/common.d.ts +5 -5
  35. package/dist/types/constants/example-code.d.ts +2 -2
  36. package/dist/types/env/types.d.ts +180 -180
  37. package/dist/types/extractor/util.d.ts +2 -2
  38. package/dist/types/node/fs.d.ts +1 -1
  39. package/package.json +8 -3
  40. package/src/common.ts +10 -10
  41. package/src/constants/example-code.ts +10 -10
  42. package/src/constants/index.ts +1 -1
  43. package/src/env/constants.ts +144 -144
  44. package/src/env/decide-model-config.ts +1 -1
  45. package/src/env/global-config-manager.ts +1 -1
  46. package/src/env/init-debug.ts +5 -5
  47. package/src/env/model-config-manager.ts +1 -1
  48. package/src/env/parse.ts +15 -15
  49. package/src/env/types.ts +315 -315
  50. package/src/env/utils.ts +2 -2
  51. package/src/extractor/debug.ts +2 -2
  52. package/src/extractor/util.ts +15 -15
  53. package/src/extractor/web-extractor.ts +7 -7
  54. package/src/logger.ts +3 -3
  55. package/src/node/fs.ts +5 -5
  56. package/src/utils.ts +2 -2
@@ -35,9 +35,9 @@ __webpack_require__.r(__webpack_exports__);
35
35
  __webpack_require__.d(__webpack_exports__, {
36
36
  defaultRunDirName: ()=>defaultRunDirName,
37
37
  ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED: ()=>ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED,
38
- getRpasceneRunSubDir: ()=>getRpasceneRunSubDir,
39
- getRpasceneRunDir: ()=>getRpasceneRunDir,
40
- getRpasceneRunBaseDir: ()=>getRpasceneRunBaseDir
38
+ getMidsceneRunDir: ()=>getMidsceneRunDir,
39
+ getMidsceneRunSubDir: ()=>getMidsceneRunSubDir,
40
+ getMidsceneRunBaseDir: ()=>getMidsceneRunBaseDir
41
41
  });
42
42
  const external_node_fs_namespaceObject = require("node:fs");
43
43
  const external_node_os_namespaceObject = require("node:os");
@@ -46,14 +46,14 @@ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_no
46
46
  const basic_js_namespaceObject = require("./env/basic.js");
47
47
  const types_js_namespaceObject = require("./env/types.js");
48
48
  const external_utils_js_namespaceObject = require("./utils.js");
49
- const defaultRunDirName = 'rpascene_run';
50
- const getRpasceneRunDir = ()=>{
49
+ const defaultRunDirName = 'midscene_run';
50
+ const getMidsceneRunDir = ()=>{
51
51
  if (!external_utils_js_namespaceObject.ifInNode) return '';
52
- return (0, basic_js_namespaceObject.getBasicEnvValue)(types_js_namespaceObject.RPASCENE_RUN_DIR) || defaultRunDirName;
52
+ return (0, basic_js_namespaceObject.getBasicEnvValue)(types_js_namespaceObject.MIDSCENE_RUN_DIR) || defaultRunDirName;
53
53
  };
54
- const getRpasceneRunBaseDir = ()=>{
54
+ const getMidsceneRunBaseDir = ()=>{
55
55
  if (!external_utils_js_namespaceObject.ifInNode) return '';
56
- let basePath = external_node_path_default().resolve(process.cwd(), getRpasceneRunDir());
56
+ let basePath = external_node_path_default().resolve(process.cwd(), getMidsceneRunDir());
57
57
  if (!(0, external_node_fs_namespaceObject.existsSync)(basePath)) try {
58
58
  (0, external_node_fs_namespaceObject.mkdirSync)(basePath, {
59
59
  recursive: true
@@ -66,9 +66,9 @@ const getRpasceneRunBaseDir = ()=>{
66
66
  }
67
67
  return basePath;
68
68
  };
69
- const getRpasceneRunSubDir = (subdir)=>{
69
+ const getMidsceneRunSubDir = (subdir)=>{
70
70
  if (!external_utils_js_namespaceObject.ifInNode) return '';
71
- const basePath = getRpasceneRunBaseDir();
71
+ const basePath = getMidsceneRunBaseDir();
72
72
  const logPath = external_node_path_default().join(basePath, subdir);
73
73
  if (!(0, external_node_fs_namespaceObject.existsSync)(logPath)) (0, external_node_fs_namespaceObject.mkdirSync)(logPath, {
74
74
  recursive: true
@@ -78,15 +78,15 @@ const getRpasceneRunSubDir = (subdir)=>{
78
78
  const ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = 'NOT_IMPLEMENTED_AS_DESIGNED';
79
79
  exports.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = __webpack_exports__.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED;
80
80
  exports.defaultRunDirName = __webpack_exports__.defaultRunDirName;
81
- exports.getRpasceneRunBaseDir = __webpack_exports__.getRpasceneRunBaseDir;
82
- exports.getRpasceneRunDir = __webpack_exports__.getRpasceneRunDir;
83
- exports.getRpasceneRunSubDir = __webpack_exports__.getRpasceneRunSubDir;
81
+ exports.getMidsceneRunBaseDir = __webpack_exports__.getMidsceneRunBaseDir;
82
+ exports.getMidsceneRunDir = __webpack_exports__.getMidsceneRunDir;
83
+ exports.getMidsceneRunSubDir = __webpack_exports__.getMidsceneRunSubDir;
84
84
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
85
85
  "ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED",
86
86
  "defaultRunDirName",
87
- "getRpasceneRunBaseDir",
88
- "getRpasceneRunDir",
89
- "getRpasceneRunSubDir"
87
+ "getMidsceneRunBaseDir",
88
+ "getMidsceneRunDir",
89
+ "getMidsceneRunSubDir"
90
90
  ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
91
91
  Object.defineProperty(exports, '__esModule', {
92
92
  value: true
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  YAML_EXAMPLE_CODE: ()=>YAML_EXAMPLE_CODE
29
29
  });
30
30
  const PLAYWRIGHT_EXAMPLE_CODE = `
31
- // Reference the following code to generate Rpascene test cases
32
- // The following is test code for Rpascene AI, for reference
31
+ // Reference the following code to generate Midscene test cases
32
+ // The following is test code for Midscene AI, for reference
33
33
  // The following is Playwright syntax, you can use Playwright to assist in test generation
34
34
  IMPORTANT: Follow these exact type signatures for AI functions:
35
35
 
@@ -46,8 +46,8 @@ aiAssert(assertion: string): Promise<void>
46
46
  aiQuery<T>(queryObject: Record<string, string>): Promise<T> // Extracts data from page based on descriptions
47
47
 
48
48
  // examples:
49
- // Reference the following code to generate Rpascene test cases
50
- // The following is test code for Rpascene AI, for reference
49
+ // Reference the following code to generate Midscene test cases
50
+ // The following is test code for Midscene AI, for reference
51
51
  // The following is Playwright syntax, you can use Playwright to assist in test generation
52
52
  import { test as base } from '@playwright/test';
53
53
  import type { PlayWrightAiFixtureType } from '@rpascene/web/playwright';
@@ -156,33 +156,33 @@ tasks:
156
156
  # Tap an element described by a prompt.
157
157
  - aiTap: <prompt>
158
158
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
159
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
159
+ 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.
160
160
  cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
161
161
 
162
162
  # Double click an element described by a prompt.
163
163
  - aiDoubleClick: <prompt>
164
164
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
165
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
165
+ 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.
166
166
  cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
167
167
 
168
168
  # Hover over an element described by a prompt.
169
169
  - aiHover: <prompt>
170
170
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
171
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
171
+ 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.
172
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
173
 
174
174
  # Input text into an element described by a prompt.
175
175
  - aiInput: <final text content of the input>
176
176
  locate: <prompt>
177
177
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
178
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
178
+ 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.
179
179
  cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
180
180
 
181
181
  # Press a key (e.g., Enter, Tab, Escape) on an element described by a prompt.
182
182
  - aiKeyboardPress: <key>
183
183
  locate: <prompt>
184
184
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
185
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
185
+ 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.
186
186
  cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
187
187
 
188
188
  # Scroll globally or on an element described by a prompt.
@@ -192,7 +192,7 @@ tasks:
192
192
  distance: <number> # Optional, the scroll distance in pixels.
193
193
  locate: <prompt> # Optional, the element to scroll on.
194
194
  deepThink: <boolean> # Optional, whether to use deepThink to precisely locate the element. Defaults to False.
195
- xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Rpascene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
195
+ 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.
196
196
  cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
197
197
 
198
198
  # Log the current screenshot with a description in the report file.
@@ -82,7 +82,7 @@ const commandMap = {
82
82
  DisplayName: "\u9F20\u6807\u60AC\u505C"
83
83
  },
84
84
  Input: {
85
- CommandName: "SeleniumSetTextCommand",
85
+ CommandName: "SeleniumSetValueCommand",
86
86
  DisplayName: "\u8BBE\u7F6E\u6587\u672C"
87
87
  },
88
88
  KeyboardPress: {
@@ -32,97 +32,97 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  });
33
33
  const external_types_js_namespaceObject = require("./types.js");
34
34
  const VQA_MODEL_CONFIG_KEYS = {
35
- modelName: external_types_js_namespaceObject.RPASCENE_VQA_MODEL_NAME,
36
- socksProxy: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_SOCKS_PROXY,
37
- httpProxy: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_HTTP_PROXY,
38
- openaiBaseURL: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_BASE_URL,
39
- openaiApiKey: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_API_KEY,
40
- openaiExtraConfig: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_INIT_CONFIG_JSON,
41
- openaiUseAzureDeprecated: external_types_js_namespaceObject.RPASCENE_VQA_OPENAI_USE_AZURE,
42
- useAzureOpenai: external_types_js_namespaceObject.RPASCENE_VQA_USE_AZURE_OPENAI,
43
- azureOpenaiScope: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_SCOPE,
44
- azureOpenaiKey: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_KEY,
45
- azureOpenaiEndpoint: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_ENDPOINT,
46
- azureOpenaiApiVersion: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_API_VERSION,
47
- azureOpenaiDeployment: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_DEPLOYMENT,
48
- azureExtraConfig: external_types_js_namespaceObject.RPASCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON,
49
- useAnthropicSdk: external_types_js_namespaceObject.RPASCENE_VQA_USE_ANTHROPIC_SDK,
50
- anthropicApiKey: external_types_js_namespaceObject.RPASCENE_VQA_ANTHROPIC_API_KEY,
51
- vlMode: external_types_js_namespaceObject.RPASCENE_VQA_VL_MODE
35
+ modelName: external_types_js_namespaceObject.MIDSCENE_VQA_MODEL_NAME,
36
+ socksProxy: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_SOCKS_PROXY,
37
+ httpProxy: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_HTTP_PROXY,
38
+ openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_BASE_URL,
39
+ openaiApiKey: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_API_KEY,
40
+ openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_INIT_CONFIG_JSON,
41
+ openaiUseAzureDeprecated: external_types_js_namespaceObject.MIDSCENE_VQA_OPENAI_USE_AZURE,
42
+ useAzureOpenai: external_types_js_namespaceObject.MIDSCENE_VQA_USE_AZURE_OPENAI,
43
+ azureOpenaiScope: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_SCOPE,
44
+ azureOpenaiKey: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_KEY,
45
+ azureOpenaiEndpoint: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_ENDPOINT,
46
+ azureOpenaiApiVersion: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_API_VERSION,
47
+ azureOpenaiDeployment: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_DEPLOYMENT,
48
+ azureExtraConfig: external_types_js_namespaceObject.MIDSCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON,
49
+ useAnthropicSdk: external_types_js_namespaceObject.MIDSCENE_VQA_USE_ANTHROPIC_SDK,
50
+ anthropicApiKey: external_types_js_namespaceObject.MIDSCENE_VQA_ANTHROPIC_API_KEY,
51
+ vlMode: external_types_js_namespaceObject.MIDSCENE_VQA_VL_MODE
52
52
  };
53
53
  const GROUNDING_MODEL_CONFIG_KEYS = {
54
- modelName: external_types_js_namespaceObject.RPASCENE_GROUNDING_MODEL_NAME,
55
- socksProxy: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_SOCKS_PROXY,
56
- httpProxy: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_HTTP_PROXY,
57
- openaiBaseURL: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_BASE_URL,
58
- openaiApiKey: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_API_KEY,
59
- openaiExtraConfig: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON,
60
- openaiUseAzureDeprecated: external_types_js_namespaceObject.RPASCENE_GROUNDING_OPENAI_USE_AZURE,
61
- useAzureOpenai: external_types_js_namespaceObject.RPASCENE_GROUNDING_USE_AZURE_OPENAI,
62
- azureOpenaiScope: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_SCOPE,
63
- azureOpenaiKey: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_KEY,
64
- azureOpenaiEndpoint: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_ENDPOINT,
65
- azureOpenaiApiVersion: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_API_VERSION,
66
- azureOpenaiDeployment: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT,
67
- azureExtraConfig: external_types_js_namespaceObject.RPASCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON,
68
- useAnthropicSdk: external_types_js_namespaceObject.RPASCENE_GROUNDING_USE_ANTHROPIC_SDK,
69
- anthropicApiKey: external_types_js_namespaceObject.RPASCENE_GROUNDING_ANTHROPIC_API_KEY,
70
- vlMode: external_types_js_namespaceObject.RPASCENE_GROUNDING_VL_MODE
54
+ modelName: external_types_js_namespaceObject.MIDSCENE_GROUNDING_MODEL_NAME,
55
+ socksProxy: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_SOCKS_PROXY,
56
+ httpProxy: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_HTTP_PROXY,
57
+ openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_BASE_URL,
58
+ openaiApiKey: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_API_KEY,
59
+ openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON,
60
+ openaiUseAzureDeprecated: external_types_js_namespaceObject.MIDSCENE_GROUNDING_OPENAI_USE_AZURE,
61
+ useAzureOpenai: external_types_js_namespaceObject.MIDSCENE_GROUNDING_USE_AZURE_OPENAI,
62
+ azureOpenaiScope: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_SCOPE,
63
+ azureOpenaiKey: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_KEY,
64
+ azureOpenaiEndpoint: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_ENDPOINT,
65
+ azureOpenaiApiVersion: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_API_VERSION,
66
+ azureOpenaiDeployment: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT,
67
+ azureExtraConfig: external_types_js_namespaceObject.MIDSCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON,
68
+ useAnthropicSdk: external_types_js_namespaceObject.MIDSCENE_GROUNDING_USE_ANTHROPIC_SDK,
69
+ anthropicApiKey: external_types_js_namespaceObject.MIDSCENE_GROUNDING_ANTHROPIC_API_KEY,
70
+ vlMode: external_types_js_namespaceObject.MIDSCENE_GROUNDING_VL_MODE
71
71
  };
72
72
  const PLANNING_MODEL_CONFIG_KEYS = {
73
- modelName: external_types_js_namespaceObject.RPASCENE_PLANNING_MODEL_NAME,
74
- socksProxy: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_SOCKS_PROXY,
75
- httpProxy: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_HTTP_PROXY,
76
- openaiBaseURL: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_BASE_URL,
77
- openaiApiKey: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_API_KEY,
78
- openaiExtraConfig: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_INIT_CONFIG_JSON,
79
- openaiUseAzureDeprecated: external_types_js_namespaceObject.RPASCENE_PLANNING_OPENAI_USE_AZURE,
80
- useAzureOpenai: external_types_js_namespaceObject.RPASCENE_PLANNING_USE_AZURE_OPENAI,
81
- azureOpenaiScope: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_SCOPE,
82
- azureOpenaiKey: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_KEY,
83
- azureOpenaiEndpoint: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_ENDPOINT,
84
- azureOpenaiApiVersion: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_API_VERSION,
85
- azureOpenaiDeployment: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT,
86
- azureExtraConfig: external_types_js_namespaceObject.RPASCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON,
87
- useAnthropicSdk: external_types_js_namespaceObject.RPASCENE_PLANNING_USE_ANTHROPIC_SDK,
88
- anthropicApiKey: external_types_js_namespaceObject.RPASCENE_PLANNING_ANTHROPIC_API_KEY,
89
- vlMode: external_types_js_namespaceObject.RPASCENE_PLANNING_VL_MODE
73
+ modelName: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_NAME,
74
+ socksProxy: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_SOCKS_PROXY,
75
+ httpProxy: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_HTTP_PROXY,
76
+ openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_BASE_URL,
77
+ openaiApiKey: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_API_KEY,
78
+ openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_INIT_CONFIG_JSON,
79
+ openaiUseAzureDeprecated: external_types_js_namespaceObject.MIDSCENE_PLANNING_OPENAI_USE_AZURE,
80
+ useAzureOpenai: external_types_js_namespaceObject.MIDSCENE_PLANNING_USE_AZURE_OPENAI,
81
+ azureOpenaiScope: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_SCOPE,
82
+ azureOpenaiKey: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_KEY,
83
+ azureOpenaiEndpoint: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_ENDPOINT,
84
+ azureOpenaiApiVersion: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_API_VERSION,
85
+ azureOpenaiDeployment: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT,
86
+ azureExtraConfig: external_types_js_namespaceObject.MIDSCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON,
87
+ useAnthropicSdk: external_types_js_namespaceObject.MIDSCENE_PLANNING_USE_ANTHROPIC_SDK,
88
+ anthropicApiKey: external_types_js_namespaceObject.MIDSCENE_PLANNING_ANTHROPIC_API_KEY,
89
+ vlMode: external_types_js_namespaceObject.MIDSCENE_PLANNING_VL_MODE
90
90
  };
91
91
  const DEFAULT_MODEL_CONFIG_KEYS = {
92
- modelName: external_types_js_namespaceObject.RPASCENE_MODEL_NAME,
93
- socksProxy: external_types_js_namespaceObject.RPASCENE_OPENAI_SOCKS_PROXY,
94
- httpProxy: external_types_js_namespaceObject.RPASCENE_OPENAI_HTTP_PROXY,
95
- openaiBaseURL: external_types_js_namespaceObject.RPASCENE_OPENAI_BASE_URL,
96
- openaiApiKey: external_types_js_namespaceObject.RPASCENE_OPENAI_API_KEY,
97
- openaiExtraConfig: external_types_js_namespaceObject.RPASCENE_OPENAI_INIT_CONFIG_JSON,
98
- openaiUseAzureDeprecated: external_types_js_namespaceObject.RPASCENE_OPENAI_USE_AZURE,
99
- useAzureOpenai: external_types_js_namespaceObject.RPASCENE_USE_AZURE_OPENAI,
100
- azureOpenaiScope: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_SCOPE,
101
- azureOpenaiKey: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_KEY,
102
- azureOpenaiEndpoint: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_ENDPOINT,
103
- azureOpenaiApiVersion: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_API_VERSION,
104
- azureOpenaiDeployment: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_DEPLOYMENT,
105
- azureExtraConfig: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_INIT_CONFIG_JSON,
106
- useAnthropicSdk: external_types_js_namespaceObject.RPASCENE_USE_ANTHROPIC_SDK,
107
- anthropicApiKey: external_types_js_namespaceObject.RPASCENE_ANTHROPIC_API_KEY,
108
- vlMode: external_types_js_namespaceObject.RPASCENE_VL_MODE
92
+ modelName: external_types_js_namespaceObject.MIDSCENE_MODEL_NAME,
93
+ socksProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_SOCKS_PROXY,
94
+ httpProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_HTTP_PROXY,
95
+ openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_OPENAI_BASE_URL,
96
+ openaiApiKey: external_types_js_namespaceObject.MIDSCENE_OPENAI_API_KEY,
97
+ openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_OPENAI_INIT_CONFIG_JSON,
98
+ openaiUseAzureDeprecated: external_types_js_namespaceObject.MIDSCENE_OPENAI_USE_AZURE,
99
+ useAzureOpenai: external_types_js_namespaceObject.MIDSCENE_USE_AZURE_OPENAI,
100
+ azureOpenaiScope: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_SCOPE,
101
+ azureOpenaiKey: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_KEY,
102
+ azureOpenaiEndpoint: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_ENDPOINT,
103
+ azureOpenaiApiVersion: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_API_VERSION,
104
+ azureOpenaiDeployment: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_DEPLOYMENT,
105
+ azureExtraConfig: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON,
106
+ useAnthropicSdk: external_types_js_namespaceObject.MIDSCENE_USE_ANTHROPIC_SDK,
107
+ anthropicApiKey: external_types_js_namespaceObject.MIDSCENE_ANTHROPIC_API_KEY,
108
+ vlMode: external_types_js_namespaceObject.MIDSCENE_VL_MODE
109
109
  };
110
110
  const DEFAULT_MODEL_CONFIG_KEYS_LEGACY = {
111
- modelName: external_types_js_namespaceObject.RPASCENE_MODEL_NAME,
112
- socksProxy: external_types_js_namespaceObject.RPASCENE_OPENAI_SOCKS_PROXY,
113
- httpProxy: external_types_js_namespaceObject.RPASCENE_OPENAI_HTTP_PROXY,
111
+ modelName: external_types_js_namespaceObject.MIDSCENE_MODEL_NAME,
112
+ socksProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_SOCKS_PROXY,
113
+ httpProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_HTTP_PROXY,
114
114
  openaiBaseURL: external_types_js_namespaceObject.OPENAI_BASE_URL,
115
115
  openaiApiKey: external_types_js_namespaceObject.OPENAI_API_KEY,
116
- openaiExtraConfig: external_types_js_namespaceObject.RPASCENE_OPENAI_INIT_CONFIG_JSON,
116
+ openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_OPENAI_INIT_CONFIG_JSON,
117
117
  openaiUseAzureDeprecated: external_types_js_namespaceObject.OPENAI_USE_AZURE,
118
- useAzureOpenai: external_types_js_namespaceObject.RPASCENE_USE_AZURE_OPENAI,
119
- azureOpenaiScope: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_SCOPE,
118
+ useAzureOpenai: external_types_js_namespaceObject.MIDSCENE_USE_AZURE_OPENAI,
119
+ azureOpenaiScope: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_SCOPE,
120
120
  azureOpenaiKey: external_types_js_namespaceObject.AZURE_OPENAI_KEY,
121
121
  azureOpenaiEndpoint: external_types_js_namespaceObject.AZURE_OPENAI_ENDPOINT,
122
122
  azureOpenaiApiVersion: external_types_js_namespaceObject.AZURE_OPENAI_API_VERSION,
123
123
  azureOpenaiDeployment: external_types_js_namespaceObject.AZURE_OPENAI_DEPLOYMENT,
124
- azureExtraConfig: external_types_js_namespaceObject.RPASCENE_AZURE_OPENAI_INIT_CONFIG_JSON,
125
- useAnthropicSdk: external_types_js_namespaceObject.RPASCENE_USE_ANTHROPIC_SDK,
124
+ azureExtraConfig: external_types_js_namespaceObject.MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON,
125
+ useAnthropicSdk: external_types_js_namespaceObject.MIDSCENE_USE_ANTHROPIC_SDK,
126
126
  anthropicApiKey: external_types_js_namespaceObject.ANTHROPIC_API_KEY,
127
127
  vlMode: 'DEFAULT_MODEL_CONFIG_KEYS has no vlMode key'
128
128
  };
@@ -59,7 +59,7 @@ class GlobalConfigManager {
59
59
  getEnvConfigValue(key) {
60
60
  const allConfig = this.getAllEnvConfig();
61
61
  if (!external_types_js_namespaceObject.STRING_ENV_KEYS.includes(key)) throw new Error(`getEnvConfigValue with key ${key} is not supported.`);
62
- if (key === external_types_js_namespaceObject.MATCH_BY_POSITION) throw new Error('MATCH_BY_POSITION is deprecated, use RPASCENE_USE_VL_MODEL instead');
62
+ if (key === external_types_js_namespaceObject.MATCH_BY_POSITION) throw new Error('MATCH_BY_POSITION is deprecated, use MIDSCENE_USE_VL_MODEL instead');
63
63
  const value = allConfig[key];
64
64
  this.keysHaveBeenRead[key] = true;
65
65
  if ('string' == typeof value) return value.trim();
@@ -30,15 +30,15 @@ const external_logger_js_namespaceObject = require("../logger.js");
30
30
  const external_basic_js_namespaceObject = require("./basic.js");
31
31
  const external_types_js_namespaceObject = require("./types.js");
32
32
  const initDebugConfig = ()=>{
33
- const shouldPrintTiming = (0, external_basic_js_namespaceObject.getBasicEnvValue)(external_types_js_namespaceObject.RPASCENE_DEBUG_AI_PROFILE);
33
+ const shouldPrintTiming = (0, external_basic_js_namespaceObject.getBasicEnvValue)(external_types_js_namespaceObject.MIDSCENE_DEBUG_AI_PROFILE);
34
34
  let debugConfig = '';
35
35
  if (shouldPrintTiming) {
36
- console.warn('RPASCENE_DEBUG_AI_PROFILE is deprecated, use DEBUG=rpascene:ai:profile instead');
36
+ console.warn('MIDSCENE_DEBUG_AI_PROFILE is deprecated, use DEBUG=midscene:ai:profile instead');
37
37
  debugConfig = 'ai:profile';
38
38
  }
39
- const shouldPrintAIResponse = (0, external_basic_js_namespaceObject.getBasicEnvValue)(external_types_js_namespaceObject.RPASCENE_DEBUG_AI_RESPONSE);
39
+ const shouldPrintAIResponse = (0, external_basic_js_namespaceObject.getBasicEnvValue)(external_types_js_namespaceObject.MIDSCENE_DEBUG_AI_RESPONSE);
40
40
  if (shouldPrintAIResponse) {
41
- console.warn('RPASCENE_DEBUG_AI_RESPONSE is deprecated, use DEBUG=rpascene:ai:response instead');
41
+ console.warn('MIDSCENE_DEBUG_AI_RESPONSE is deprecated, use DEBUG=midscene:ai:response instead');
42
42
  debugConfig = debugConfig ? 'ai:*' : 'ai:call';
43
43
  }
44
44
  if (debugConfig) (0, external_logger_js_namespaceObject.enableDebug)(debugConfig);
@@ -111,7 +111,7 @@ class ModelConfigManager {
111
111
  }
112
112
  throwErrorIfNonVLModel(intent = 'grounding') {
113
113
  const modelConfig = this.getModelConfig(intent);
114
- if (!modelConfig.vlMode) throw new Error('No visual language model (VL model) detected for the current scenario. Element localization may be inaccurate. Please verify your model configuration. Learn more: https://rpascenejs.com/choose-a-model');
114
+ if (!modelConfig.vlMode) throw new Error('No visual language model (VL model) detected for the current scenario. Element localization may be inaccurate. Please verify your model configuration. Learn more: https://midscenejs.com/choose-a-model');
115
115
  }
116
116
  constructor(modelConfigFn){
117
117
  _define_property(this, "modelConfigMap", void 0);
@@ -49,17 +49,17 @@ const parseVlModeAndUiTarsModelVersionFromRawValue = (vlModeRaw)=>{
49
49
  };
50
50
  };
51
51
  const parseVlModeAndUiTarsFromGlobalConfig = (provider)=>{
52
- const isDoubao = provider[external_types_js_namespaceObject.RPASCENE_USE_DOUBAO_VISION];
53
- const isQwen = provider[external_types_js_namespaceObject.RPASCENE_USE_QWEN_VL];
54
- const isQwen3 = provider[external_types_js_namespaceObject.RPASCENE_USE_QWEN3_VL];
55
- const isUiTars = provider[external_types_js_namespaceObject.RPASCENE_USE_VLM_UI_TARS];
56
- const isGemini = provider[external_types_js_namespaceObject.RPASCENE_USE_GEMINI];
52
+ const isDoubao = provider[external_types_js_namespaceObject.MIDSCENE_USE_DOUBAO_VISION];
53
+ const isQwen = provider[external_types_js_namespaceObject.MIDSCENE_USE_QWEN_VL];
54
+ const isQwen3 = provider[external_types_js_namespaceObject.MIDSCENE_USE_QWEN3_VL];
55
+ const isUiTars = provider[external_types_js_namespaceObject.MIDSCENE_USE_VLM_UI_TARS];
56
+ const isGemini = provider[external_types_js_namespaceObject.MIDSCENE_USE_GEMINI];
57
57
  const enabledModes = [
58
- isDoubao && external_types_js_namespaceObject.RPASCENE_USE_DOUBAO_VISION,
59
- isQwen && external_types_js_namespaceObject.RPASCENE_USE_QWEN_VL,
60
- isQwen3 && external_types_js_namespaceObject.RPASCENE_USE_QWEN3_VL,
61
- isUiTars && external_types_js_namespaceObject.RPASCENE_USE_VLM_UI_TARS,
62
- isGemini && external_types_js_namespaceObject.RPASCENE_USE_GEMINI
58
+ isDoubao && external_types_js_namespaceObject.MIDSCENE_USE_DOUBAO_VISION,
59
+ isQwen && external_types_js_namespaceObject.MIDSCENE_USE_QWEN_VL,
60
+ isQwen3 && external_types_js_namespaceObject.MIDSCENE_USE_QWEN3_VL,
61
+ isUiTars && external_types_js_namespaceObject.MIDSCENE_USE_VLM_UI_TARS,
62
+ isGemini && external_types_js_namespaceObject.MIDSCENE_USE_GEMINI
63
63
  ].filter(Boolean);
64
64
  if (enabledModes.length > 1) throw new Error(`Only one vision mode can be enabled at a time. Currently enabled modes: ${enabledModes.join(', ')}. Please disable all but one mode.`);
65
65
  if (isQwen3) return {