@rpascene/shared 0.30.8 → 0.30.10
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/README.md +1 -2
- package/dist/es/common.mjs +2 -2
- package/dist/es/constants/index.mjs +1 -1
- package/dist/es/env/constants.mjs +77 -77
- package/dist/es/env/global-config-manager.mjs +1 -1
- package/dist/es/env/init-debug.mjs +5 -5
- package/dist/es/env/parse.mjs +11 -11
- package/dist/es/env/types.mjs +191 -191
- package/dist/es/env/utils.mjs +2 -2
- package/dist/lib/common.js +1 -1
- package/dist/lib/constants/index.js +1 -1
- package/dist/lib/env/constants.js +76 -76
- package/dist/lib/env/global-config-manager.js +1 -1
- package/dist/lib/env/init-debug.js +4 -4
- package/dist/lib/env/parse.js +10 -10
- package/dist/lib/env/types.js +478 -478
- package/dist/lib/env/utils.js +1 -1
- package/dist/types/env/types.d.ts +179 -179
- package/package.json +19 -14
- package/src/common.ts +3 -3
- package/src/constants/index.ts +1 -1
- package/src/env/constants.ts +144 -144
- package/src/env/decide-model-config.ts +1 -1
- package/src/env/global-config-manager.ts +1 -1
- package/src/env/init-debug.ts +5 -5
- package/src/env/parse.ts +15 -15
- package/src/env/types.ts +314 -314
- package/src/env/utils.ts +2 -2
package/dist/lib/env/utils.js
CHANGED
|
@@ -37,7 +37,7 @@ const globalConfigManager = new external_global_config_manager_js_namespaceObjec
|
|
|
37
37
|
globalConfigManager.registerModelConfigManager(globalModelConfigManager);
|
|
38
38
|
globalModelConfigManager.registerGlobalConfigManager(globalConfigManager);
|
|
39
39
|
const getPreferredLanguage = ()=>{
|
|
40
|
-
const prefer = globalConfigManager.getEnvConfigValue(external_types_js_namespaceObject.
|
|
40
|
+
const prefer = globalConfigManager.getEnvConfigValue(external_types_js_namespaceObject.MIDSCENE_PREFERRED_LANGUAGE);
|
|
41
41
|
if (prefer) return prefer;
|
|
42
42
|
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
43
43
|
const isChina = 'Asia/Shanghai' === timeZone;
|
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
1
|
+
export declare const MIDSCENE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_OPENAI_INIT_CONFIG_JSON";
|
|
2
|
+
export declare const MIDSCENE_MODEL_NAME = "MIDSCENE_MODEL_NAME";
|
|
3
|
+
export declare const MIDSCENE_LANGSMITH_DEBUG = "MIDSCENE_LANGSMITH_DEBUG";
|
|
4
|
+
export declare const MIDSCENE_DEBUG_AI_PROFILE = "MIDSCENE_DEBUG_AI_PROFILE";
|
|
5
|
+
export declare const MIDSCENE_DEBUG_AI_RESPONSE = "MIDSCENE_DEBUG_AI_RESPONSE";
|
|
6
|
+
export declare const MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG = "MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG";
|
|
7
|
+
export declare const MIDSCENE_DEBUG_MODE = "MIDSCENE_DEBUG_MODE";
|
|
8
|
+
export declare const MIDSCENE_MCP_USE_PUPPETEER_MODE = "MIDSCENE_MCP_USE_PUPPETEER_MODE";
|
|
9
|
+
export declare const MIDSCENE_MCP_CHROME_PATH = "MIDSCENE_MCP_CHROME_PATH";
|
|
10
|
+
export declare const MIDSCENE_MCP_ANDROID_MODE = "MIDSCENE_MCP_ANDROID_MODE";
|
|
11
11
|
export declare const DOCKER_CONTAINER = "DOCKER_CONTAINER";
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
12
|
+
export declare const MIDSCENE_FORCE_DEEP_THINK = "MIDSCENE_FORCE_DEEP_THINK";
|
|
13
|
+
export declare const MIDSCENE_OPENAI_SOCKS_PROXY = "MIDSCENE_OPENAI_SOCKS_PROXY";
|
|
14
|
+
export declare const MIDSCENE_OPENAI_HTTP_PROXY = "MIDSCENE_OPENAI_HTTP_PROXY";
|
|
15
15
|
export declare const OPENAI_API_KEY = "OPENAI_API_KEY";
|
|
16
16
|
export declare const OPENAI_BASE_URL = "OPENAI_BASE_URL";
|
|
17
17
|
export declare const OPENAI_MAX_TOKENS = "OPENAI_MAX_TOKENS";
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
29
|
-
export declare const
|
|
30
|
-
export declare const
|
|
18
|
+
export declare const MIDSCENE_ADB_PATH = "MIDSCENE_ADB_PATH";
|
|
19
|
+
export declare const MIDSCENE_ADB_REMOTE_HOST = "MIDSCENE_ADB_REMOTE_HOST";
|
|
20
|
+
export declare const MIDSCENE_ADB_REMOTE_PORT = "MIDSCENE_ADB_REMOTE_PORT";
|
|
21
|
+
export declare const MIDSCENE_ANDROID_IME_STRATEGY = "MIDSCENE_ANDROID_IME_STRATEGY";
|
|
22
|
+
export declare const MIDSCENE_IOS_DEVICE_UDID = "MIDSCENE_IOS_DEVICE_UDID";
|
|
23
|
+
export declare const MIDSCENE_IOS_SIMULATOR_UDID = "MIDSCENE_IOS_SIMULATOR_UDID";
|
|
24
|
+
export declare const MIDSCENE_CACHE = "MIDSCENE_CACHE";
|
|
25
|
+
export declare const MIDSCENE_USE_VLM_UI_TARS = "MIDSCENE_USE_VLM_UI_TARS";
|
|
26
|
+
export declare const MIDSCENE_USE_QWEN_VL = "MIDSCENE_USE_QWEN_VL";
|
|
27
|
+
export declare const MIDSCENE_USE_QWEN3_VL = "MIDSCENE_USE_QWEN3_VL";
|
|
28
|
+
export declare const MIDSCENE_USE_DOUBAO_VISION = "MIDSCENE_USE_DOUBAO_VISION";
|
|
29
|
+
export declare const MIDSCENE_USE_GEMINI = "MIDSCENE_USE_GEMINI";
|
|
30
|
+
export declare const MIDSCENE_USE_VL_MODEL = "MIDSCENE_USE_VL_MODEL";
|
|
31
31
|
export declare const MATCH_BY_POSITION = "MATCH_BY_POSITION";
|
|
32
|
-
export declare const
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const
|
|
37
|
-
export declare const
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
32
|
+
export declare const MIDSCENE_API_TYPE = "MIDSCENE-API-TYPE";
|
|
33
|
+
export declare const MIDSCENE_REPORT_TAG_NAME = "MIDSCENE_REPORT_TAG_NAME";
|
|
34
|
+
export declare const MIDSCENE_REPLANNING_CYCLE_LIMIT = "MIDSCENE_REPLANNING_CYCLE_LIMIT";
|
|
35
|
+
export declare const MIDSCENE_PREFERRED_LANGUAGE = "MIDSCENE_PREFERRED_LANGUAGE";
|
|
36
|
+
export declare const MIDSCENE_USE_AZURE_OPENAI = "MIDSCENE_USE_AZURE_OPENAI";
|
|
37
|
+
export declare const MIDSCENE_AZURE_OPENAI_SCOPE = "MIDSCENE_AZURE_OPENAI_SCOPE";
|
|
38
|
+
export declare const MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON";
|
|
39
|
+
export declare const MIDSCENE_CACHE_MAX_FILENAME_LENGTH = "MIDSCENE_CACHE_MAX_FILENAME_LENGTH";
|
|
40
40
|
export declare const AZURE_OPENAI_ENDPOINT = "AZURE_OPENAI_ENDPOINT";
|
|
41
41
|
export declare const AZURE_OPENAI_KEY = "AZURE_OPENAI_KEY";
|
|
42
42
|
export declare const AZURE_OPENAI_API_VERSION = "AZURE_OPENAI_API_VERSION";
|
|
43
43
|
export declare const AZURE_OPENAI_DEPLOYMENT = "AZURE_OPENAI_DEPLOYMENT";
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const MIDSCENE_USE_ANTHROPIC_SDK = "MIDSCENE_USE_ANTHROPIC_SDK";
|
|
45
45
|
export declare const ANTHROPIC_API_KEY = "ANTHROPIC_API_KEY";
|
|
46
|
-
export declare const
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const
|
|
50
|
-
export declare const
|
|
51
|
-
export declare const
|
|
52
|
-
export declare const
|
|
53
|
-
export declare const
|
|
54
|
-
export declare const
|
|
55
|
-
export declare const
|
|
56
|
-
export declare const
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const
|
|
61
|
-
export declare const
|
|
62
|
-
export declare const
|
|
63
|
-
export declare const
|
|
64
|
-
export declare const
|
|
65
|
-
export declare const
|
|
66
|
-
export declare const
|
|
67
|
-
export declare const
|
|
68
|
-
export declare const
|
|
69
|
-
export declare const
|
|
70
|
-
export declare const
|
|
71
|
-
export declare const
|
|
72
|
-
export declare const
|
|
73
|
-
export declare const
|
|
74
|
-
export declare const
|
|
75
|
-
export declare const
|
|
76
|
-
export declare const
|
|
77
|
-
export declare const
|
|
78
|
-
export declare const
|
|
79
|
-
export declare const
|
|
80
|
-
export declare const
|
|
81
|
-
export declare const
|
|
82
|
-
export declare const
|
|
83
|
-
export declare const
|
|
84
|
-
export declare const
|
|
85
|
-
export declare const
|
|
86
|
-
export declare const
|
|
87
|
-
export declare const
|
|
88
|
-
export declare const
|
|
89
|
-
export declare const
|
|
90
|
-
export declare const
|
|
91
|
-
export declare const
|
|
92
|
-
export declare const
|
|
93
|
-
export declare const
|
|
94
|
-
export declare const
|
|
95
|
-
export declare const
|
|
96
|
-
export declare const
|
|
97
|
-
export declare const
|
|
98
|
-
export declare const
|
|
99
|
-
export declare const
|
|
100
|
-
export declare const
|
|
101
|
-
export declare const
|
|
102
|
-
export declare const
|
|
103
|
-
export declare const
|
|
104
|
-
export declare const
|
|
105
|
-
export declare const
|
|
106
|
-
export declare const
|
|
46
|
+
export declare const MIDSCENE_RUN_DIR = "MIDSCENE_RUN_DIR";
|
|
47
|
+
export declare const MIDSCENE_OPENAI_BASE_URL = "MIDSCENE_OPENAI_BASE_URL";
|
|
48
|
+
export declare const MIDSCENE_OPENAI_API_KEY = "MIDSCENE_OPENAI_API_KEY";
|
|
49
|
+
export declare const MIDSCENE_OPENAI_USE_AZURE = "MIDSCENE_OPENAI_USE_AZURE";
|
|
50
|
+
export declare const MIDSCENE_AZURE_OPENAI_KEY = "MIDSCENE_AZURE_OPENAI_KEY";
|
|
51
|
+
export declare const MIDSCENE_AZURE_OPENAI_ENDPOINT = "MIDSCENE_AZURE_OPENAI_ENDPOINT";
|
|
52
|
+
export declare const MIDSCENE_AZURE_OPENAI_API_VERSION = "MIDSCENE_AZURE_OPENAI_API_VERSION";
|
|
53
|
+
export declare const MIDSCENE_AZURE_OPENAI_DEPLOYMENT = "MIDSCENE_AZURE_OPENAI_DEPLOYMENT";
|
|
54
|
+
export declare const MIDSCENE_ANTHROPIC_API_KEY = "MIDSCENE_ANTHROPIC_API_KEY";
|
|
55
|
+
export declare const MIDSCENE_VL_MODE = "MIDSCENE_VL_MODE";
|
|
56
|
+
export declare const MIDSCENE_VQA_MODEL_NAME = "MIDSCENE_VQA_MODEL_NAME";
|
|
57
|
+
export declare const MIDSCENE_VQA_OPENAI_SOCKS_PROXY = "MIDSCENE_VQA_OPENAI_SOCKS_PROXY";
|
|
58
|
+
export declare const MIDSCENE_VQA_OPENAI_HTTP_PROXY = "MIDSCENE_VQA_OPENAI_HTTP_PROXY";
|
|
59
|
+
export declare const MIDSCENE_VQA_OPENAI_BASE_URL = "MIDSCENE_VQA_OPENAI_BASE_URL";
|
|
60
|
+
export declare const MIDSCENE_VQA_OPENAI_API_KEY = "MIDSCENE_VQA_OPENAI_API_KEY";
|
|
61
|
+
export declare const MIDSCENE_VQA_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_VQA_OPENAI_INIT_CONFIG_JSON";
|
|
62
|
+
export declare const MIDSCENE_VQA_OPENAI_USE_AZURE = "MIDSCENE_VQA_OPENAI_USE_AZURE";
|
|
63
|
+
export declare const MIDSCENE_VQA_USE_AZURE_OPENAI = "MIDSCENE_VQA_USE_AZURE_OPENAI";
|
|
64
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_SCOPE = "MIDSCENE_VQA_AZURE_OPENAI_SCOPE";
|
|
65
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_KEY = "MIDSCENE_VQA_AZURE_OPENAI_KEY";
|
|
66
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_ENDPOINT = "MIDSCENE_VQA_AZURE_OPENAI_ENDPOINT";
|
|
67
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_API_VERSION = "MIDSCENE_VQA_AZURE_OPENAI_API_VERSION";
|
|
68
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_DEPLOYMENT = "MIDSCENE_VQA_AZURE_OPENAI_DEPLOYMENT";
|
|
69
|
+
export declare const MIDSCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON";
|
|
70
|
+
export declare const MIDSCENE_VQA_USE_ANTHROPIC_SDK = "MIDSCENE_VQA_USE_ANTHROPIC_SDK";
|
|
71
|
+
export declare const MIDSCENE_VQA_ANTHROPIC_API_KEY = "MIDSCENE_VQA_ANTHROPIC_API_KEY";
|
|
72
|
+
export declare const MIDSCENE_VQA_VL_MODE = "MIDSCENE_VQA_VL_MODE";
|
|
73
|
+
export declare const MIDSCENE_PLANNING_MODEL_NAME = "MIDSCENE_PLANNING_MODEL_NAME";
|
|
74
|
+
export declare const MIDSCENE_PLANNING_OPENAI_SOCKS_PROXY = "MIDSCENE_PLANNING_OPENAI_SOCKS_PROXY";
|
|
75
|
+
export declare const MIDSCENE_PLANNING_OPENAI_HTTP_PROXY = "MIDSCENE_PLANNING_OPENAI_HTTP_PROXY";
|
|
76
|
+
export declare const MIDSCENE_PLANNING_OPENAI_BASE_URL = "MIDSCENE_PLANNING_OPENAI_BASE_URL";
|
|
77
|
+
export declare const MIDSCENE_PLANNING_OPENAI_API_KEY = "MIDSCENE_PLANNING_OPENAI_API_KEY";
|
|
78
|
+
export declare const MIDSCENE_PLANNING_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_PLANNING_OPENAI_INIT_CONFIG_JSON";
|
|
79
|
+
export declare const MIDSCENE_PLANNING_OPENAI_USE_AZURE = "MIDSCENE_PLANNING_OPENAI_USE_AZURE";
|
|
80
|
+
export declare const MIDSCENE_PLANNING_USE_AZURE_OPENAI = "MIDSCENE_PLANNING_USE_AZURE_OPENAI";
|
|
81
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_SCOPE = "MIDSCENE_PLANNING_AZURE_OPENAI_SCOPE";
|
|
82
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_KEY = "MIDSCENE_PLANNING_AZURE_OPENAI_KEY";
|
|
83
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_ENDPOINT = "MIDSCENE_PLANNING_AZURE_OPENAI_ENDPOINT";
|
|
84
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_API_VERSION = "MIDSCENE_PLANNING_AZURE_OPENAI_API_VERSION";
|
|
85
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT = "MIDSCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT";
|
|
86
|
+
export declare const MIDSCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON";
|
|
87
|
+
export declare const MIDSCENE_PLANNING_USE_ANTHROPIC_SDK = "MIDSCENE_PLANNING_USE_ANTHROPIC_SDK";
|
|
88
|
+
export declare const MIDSCENE_PLANNING_ANTHROPIC_API_KEY = "MIDSCENE_PLANNING_ANTHROPIC_API_KEY";
|
|
89
|
+
export declare const MIDSCENE_PLANNING_VL_MODE = "MIDSCENE_PLANNING_VL_MODE";
|
|
90
|
+
export declare const MIDSCENE_GROUNDING_MODEL_NAME = "MIDSCENE_GROUNDING_MODEL_NAME";
|
|
91
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_SOCKS_PROXY = "MIDSCENE_GROUNDING_OPENAI_SOCKS_PROXY";
|
|
92
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_HTTP_PROXY = "MIDSCENE_GROUNDING_OPENAI_HTTP_PROXY";
|
|
93
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_BASE_URL = "MIDSCENE_GROUNDING_OPENAI_BASE_URL";
|
|
94
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_API_KEY = "MIDSCENE_GROUNDING_OPENAI_API_KEY";
|
|
95
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON";
|
|
96
|
+
export declare const MIDSCENE_GROUNDING_OPENAI_USE_AZURE = "MIDSCENE_GROUNDING_OPENAI_USE_AZURE";
|
|
97
|
+
export declare const MIDSCENE_GROUNDING_USE_AZURE_OPENAI = "MIDSCENE_GROUNDING_USE_AZURE_OPENAI";
|
|
98
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_SCOPE = "MIDSCENE_GROUNDING_AZURE_OPENAI_SCOPE";
|
|
99
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_KEY = "MIDSCENE_GROUNDING_AZURE_OPENAI_KEY";
|
|
100
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_ENDPOINT = "MIDSCENE_GROUNDING_AZURE_OPENAI_ENDPOINT";
|
|
101
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_API_VERSION = "MIDSCENE_GROUNDING_AZURE_OPENAI_API_VERSION";
|
|
102
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT = "MIDSCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT";
|
|
103
|
+
export declare const MIDSCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON";
|
|
104
|
+
export declare const MIDSCENE_GROUNDING_USE_ANTHROPIC_SDK = "MIDSCENE_GROUNDING_USE_ANTHROPIC_SDK";
|
|
105
|
+
export declare const MIDSCENE_GROUNDING_ANTHROPIC_API_KEY = "MIDSCENE_GROUNDING_ANTHROPIC_API_KEY";
|
|
106
|
+
export declare const MIDSCENE_GROUNDING_VL_MODE = "MIDSCENE_GROUNDING_VL_MODE";
|
|
107
107
|
export declare const OPENAI_USE_AZURE = "OPENAI_USE_AZURE";
|
|
108
108
|
/**
|
|
109
109
|
* env keys declared but unused
|
|
@@ -113,22 +113,22 @@ export declare const UNUSED_ENV_KEYS: string[];
|
|
|
113
113
|
* env keys for debug or basic run
|
|
114
114
|
* can not be override by overrideAIConfig
|
|
115
115
|
*/
|
|
116
|
-
export declare const BASIC_ENV_KEYS: readonly ["
|
|
117
|
-
export declare const BOOLEAN_ENV_KEYS: readonly ["
|
|
118
|
-
export declare const NUMBER_ENV_KEYS: readonly ["
|
|
119
|
-
export declare const STRING_ENV_KEYS: readonly ["OPENAI_MAX_TOKENS", "
|
|
116
|
+
export declare const BASIC_ENV_KEYS: readonly ["MIDSCENE_DEBUG_MODE", "MIDSCENE_DEBUG_AI_PROFILE", "MIDSCENE_DEBUG_AI_RESPONSE", "MIDSCENE_RUN_DIR"];
|
|
117
|
+
export declare const BOOLEAN_ENV_KEYS: readonly ["MIDSCENE_CACHE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_FORCE_DEEP_THINK", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE"];
|
|
118
|
+
export declare const NUMBER_ENV_KEYS: readonly ["MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT"];
|
|
119
|
+
export declare const STRING_ENV_KEYS: readonly ["OPENAI_MAX_TOKENS", "MIDSCENE_ADB_PATH", "MIDSCENE_ADB_REMOTE_HOST", "MIDSCENE_ADB_REMOTE_PORT", "MIDSCENE_ANDROID_IME_STRATEGY", "MIDSCENE_IOS_DEVICE_UDID", "MIDSCENE_IOS_SIMULATOR_UDID", "MIDSCENE_REPORT_TAG_NAME", "MIDSCENE_PREFERRED_LANGUAGE", "MATCH_BY_POSITION", "MIDSCENE_MCP_CHROME_PATH", "DOCKER_CONTAINER"];
|
|
120
120
|
/**
|
|
121
121
|
* Non model related env keys, used for globally controlling the behavior of rpascene
|
|
122
122
|
* Can not be override by agent.modelConfig but can be override by overrideAIConfig
|
|
123
123
|
* Can be access at any time
|
|
124
124
|
*/
|
|
125
|
-
export declare const GLOBAL_ENV_KEYS: readonly ["
|
|
125
|
+
export declare const GLOBAL_ENV_KEYS: readonly ["MIDSCENE_CACHE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_FORCE_DEEP_THINK", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE", "MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT", "OPENAI_MAX_TOKENS", "MIDSCENE_ADB_PATH", "MIDSCENE_ADB_REMOTE_HOST", "MIDSCENE_ADB_REMOTE_PORT", "MIDSCENE_ANDROID_IME_STRATEGY", "MIDSCENE_IOS_DEVICE_UDID", "MIDSCENE_IOS_SIMULATOR_UDID", "MIDSCENE_REPORT_TAG_NAME", "MIDSCENE_PREFERRED_LANGUAGE", "MATCH_BY_POSITION", "MIDSCENE_MCP_CHROME_PATH", "DOCKER_CONTAINER"];
|
|
126
126
|
/**
|
|
127
127
|
* Model related eve keys, used for declare which model to use.
|
|
128
128
|
* Can be override by both agent.modelConfig and overrideAIConfig
|
|
129
129
|
* Can only be access after agent.constructor
|
|
130
130
|
*/
|
|
131
|
-
export declare const MODEL_ENV_KEYS: readonly ["
|
|
131
|
+
export declare const MODEL_ENV_KEYS: readonly ["MIDSCENE_MODEL_NAME", "MIDSCENE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_OPENAI_API_KEY", "MIDSCENE_OPENAI_BASE_URL", "MIDSCENE_OPENAI_USE_AZURE", "MIDSCENE_OPENAI_SOCKS_PROXY", "MIDSCENE_OPENAI_HTTP_PROXY", "MIDSCENE_USE_AZURE_OPENAI", "MIDSCENE_AZURE_OPENAI_SCOPE", "MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_USE_ANTHROPIC_SDK", "MIDSCENE_USE_VLM_UI_TARS", "MIDSCENE_USE_QWEN_VL", "MIDSCENE_USE_QWEN3_VL", "MIDSCENE_USE_DOUBAO_VISION", "MIDSCENE_USE_GEMINI", "MIDSCENE_USE_VL_MODEL", "ANTHROPIC_API_KEY", "MIDSCENE_AZURE_OPENAI_ENDPOINT", "MIDSCENE_AZURE_OPENAI_KEY", "MIDSCENE_AZURE_OPENAI_API_VERSION", "MIDSCENE_AZURE_OPENAI_DEPLOYMENT", "MIDSCENE_VL_MODE", "OPENAI_API_KEY", "OPENAI_BASE_URL", "OPENAI_USE_AZURE", "ANTHROPIC_API_KEY", "AZURE_OPENAI_ENDPOINT", "AZURE_OPENAI_KEY", "AZURE_OPENAI_API_VERSION", "AZURE_OPENAI_DEPLOYMENT", "MIDSCENE_VQA_MODEL_NAME", "MIDSCENE_VQA_OPENAI_SOCKS_PROXY", "MIDSCENE_VQA_OPENAI_HTTP_PROXY", "MIDSCENE_VQA_OPENAI_BASE_URL", "MIDSCENE_VQA_OPENAI_API_KEY", "MIDSCENE_VQA_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_VQA_OPENAI_USE_AZURE", "MIDSCENE_VQA_USE_AZURE_OPENAI", "MIDSCENE_VQA_AZURE_OPENAI_SCOPE", "MIDSCENE_VQA_AZURE_OPENAI_KEY", "MIDSCENE_VQA_AZURE_OPENAI_ENDPOINT", "MIDSCENE_VQA_AZURE_OPENAI_API_VERSION", "MIDSCENE_VQA_AZURE_OPENAI_DEPLOYMENT", "MIDSCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_VQA_USE_ANTHROPIC_SDK", "MIDSCENE_VQA_ANTHROPIC_API_KEY", "MIDSCENE_VQA_VL_MODE", "MIDSCENE_PLANNING_MODEL_NAME", "MIDSCENE_PLANNING_OPENAI_SOCKS_PROXY", "MIDSCENE_PLANNING_OPENAI_HTTP_PROXY", "MIDSCENE_PLANNING_OPENAI_BASE_URL", "MIDSCENE_PLANNING_OPENAI_API_KEY", "MIDSCENE_PLANNING_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_PLANNING_OPENAI_USE_AZURE", "MIDSCENE_PLANNING_USE_AZURE_OPENAI", "MIDSCENE_PLANNING_AZURE_OPENAI_SCOPE", "MIDSCENE_PLANNING_AZURE_OPENAI_KEY", "MIDSCENE_PLANNING_AZURE_OPENAI_ENDPOINT", "MIDSCENE_PLANNING_AZURE_OPENAI_API_VERSION", "MIDSCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT", "MIDSCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_PLANNING_USE_ANTHROPIC_SDK", "MIDSCENE_PLANNING_ANTHROPIC_API_KEY", "MIDSCENE_PLANNING_VL_MODE", "MIDSCENE_GROUNDING_MODEL_NAME", "MIDSCENE_GROUNDING_OPENAI_SOCKS_PROXY", "MIDSCENE_GROUNDING_OPENAI_HTTP_PROXY", "MIDSCENE_GROUNDING_OPENAI_BASE_URL", "MIDSCENE_GROUNDING_OPENAI_API_KEY", "MIDSCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_GROUNDING_OPENAI_USE_AZURE", "MIDSCENE_GROUNDING_USE_AZURE_OPENAI", "MIDSCENE_GROUNDING_AZURE_OPENAI_SCOPE", "MIDSCENE_GROUNDING_AZURE_OPENAI_KEY", "MIDSCENE_GROUNDING_AZURE_OPENAI_ENDPOINT", "MIDSCENE_GROUNDING_AZURE_OPENAI_API_VERSION", "MIDSCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT", "MIDSCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_GROUNDING_USE_ANTHROPIC_SDK", "MIDSCENE_GROUNDING_ANTHROPIC_API_KEY", "MIDSCENE_GROUNDING_VL_MODE"];
|
|
132
132
|
export declare const Yht_ENV_KEYS: string[];
|
|
133
133
|
export declare const ALL_ENV_KEYS: readonly string[];
|
|
134
134
|
export type TEnvKeys = (typeof ALL_ENV_KEYS)[number];
|
|
@@ -136,99 +136,99 @@ export type TGlobalConfig = Record<TEnvKeys, string | undefined>;
|
|
|
136
136
|
export type TVlModeValues = 'qwen-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5';
|
|
137
137
|
export type TVlModeTypes = 'qwen-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars';
|
|
138
138
|
export interface IModelConfigForVQA {
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
[
|
|
143
|
-
[
|
|
144
|
-
[
|
|
145
|
-
[
|
|
146
|
-
[
|
|
147
|
-
[
|
|
148
|
-
[
|
|
149
|
-
[
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
139
|
+
[MIDSCENE_VQA_MODEL_NAME]: string;
|
|
140
|
+
[MIDSCENE_VQA_OPENAI_SOCKS_PROXY]?: string;
|
|
141
|
+
[MIDSCENE_VQA_OPENAI_HTTP_PROXY]?: string;
|
|
142
|
+
[MIDSCENE_VQA_OPENAI_BASE_URL]?: string;
|
|
143
|
+
[MIDSCENE_VQA_OPENAI_API_KEY]?: string;
|
|
144
|
+
[MIDSCENE_VQA_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
145
|
+
[MIDSCENE_VQA_OPENAI_USE_AZURE]?: string;
|
|
146
|
+
[MIDSCENE_VQA_USE_AZURE_OPENAI]?: string;
|
|
147
|
+
[MIDSCENE_VQA_AZURE_OPENAI_SCOPE]?: string;
|
|
148
|
+
[MIDSCENE_VQA_AZURE_OPENAI_KEY]?: string;
|
|
149
|
+
[MIDSCENE_VQA_AZURE_OPENAI_ENDPOINT]?: string;
|
|
150
|
+
[MIDSCENE_VQA_AZURE_OPENAI_API_VERSION]?: string;
|
|
151
|
+
[MIDSCENE_VQA_AZURE_OPENAI_DEPLOYMENT]?: string;
|
|
152
|
+
[MIDSCENE_VQA_AZURE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
153
|
+
[MIDSCENE_VQA_USE_ANTHROPIC_SDK]?: string;
|
|
154
|
+
[MIDSCENE_VQA_ANTHROPIC_API_KEY]?: string;
|
|
155
|
+
[MIDSCENE_VQA_VL_MODE]?: TVlModeValues;
|
|
156
156
|
}
|
|
157
157
|
export interface IModelConfigForPlanning {
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
158
|
+
[MIDSCENE_PLANNING_MODEL_NAME]: string;
|
|
159
|
+
[MIDSCENE_PLANNING_OPENAI_SOCKS_PROXY]?: string;
|
|
160
|
+
[MIDSCENE_PLANNING_OPENAI_HTTP_PROXY]?: string;
|
|
161
|
+
[MIDSCENE_PLANNING_OPENAI_BASE_URL]?: string;
|
|
162
|
+
[MIDSCENE_PLANNING_OPENAI_API_KEY]?: string;
|
|
163
|
+
[MIDSCENE_PLANNING_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
164
|
+
[MIDSCENE_PLANNING_OPENAI_USE_AZURE]?: string;
|
|
165
|
+
[MIDSCENE_PLANNING_USE_AZURE_OPENAI]?: string;
|
|
166
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_SCOPE]?: string;
|
|
167
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_KEY]?: string;
|
|
168
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_ENDPOINT]?: string;
|
|
169
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_API_VERSION]?: string;
|
|
170
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_DEPLOYMENT]?: string;
|
|
171
|
+
[MIDSCENE_PLANNING_AZURE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
172
|
+
[MIDSCENE_PLANNING_USE_ANTHROPIC_SDK]?: string;
|
|
173
|
+
[MIDSCENE_PLANNING_ANTHROPIC_API_KEY]?: string;
|
|
174
|
+
[MIDSCENE_PLANNING_VL_MODE]?: TVlModeValues;
|
|
175
175
|
}
|
|
176
176
|
export interface IModeConfigForGrounding {
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[
|
|
184
|
-
[
|
|
185
|
-
[
|
|
186
|
-
[
|
|
187
|
-
[
|
|
188
|
-
[
|
|
189
|
-
[
|
|
190
|
-
[
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
177
|
+
[MIDSCENE_GROUNDING_MODEL_NAME]: string;
|
|
178
|
+
[MIDSCENE_GROUNDING_OPENAI_SOCKS_PROXY]?: string;
|
|
179
|
+
[MIDSCENE_GROUNDING_OPENAI_HTTP_PROXY]?: string;
|
|
180
|
+
[MIDSCENE_GROUNDING_OPENAI_BASE_URL]?: string;
|
|
181
|
+
[MIDSCENE_GROUNDING_OPENAI_API_KEY]?: string;
|
|
182
|
+
[MIDSCENE_GROUNDING_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
183
|
+
[MIDSCENE_GROUNDING_OPENAI_USE_AZURE]?: string;
|
|
184
|
+
[MIDSCENE_GROUNDING_USE_AZURE_OPENAI]?: string;
|
|
185
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_SCOPE]?: string;
|
|
186
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_KEY]?: string;
|
|
187
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_ENDPOINT]?: string;
|
|
188
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_API_VERSION]?: string;
|
|
189
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_DEPLOYMENT]?: string;
|
|
190
|
+
[MIDSCENE_GROUNDING_AZURE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
191
|
+
[MIDSCENE_GROUNDING_USE_ANTHROPIC_SDK]?: string;
|
|
192
|
+
[MIDSCENE_GROUNDING_ANTHROPIC_API_KEY]?: string;
|
|
193
|
+
[MIDSCENE_GROUNDING_VL_MODE]?: TVlModeValues;
|
|
194
194
|
}
|
|
195
195
|
export interface IModelConfigForDefault {
|
|
196
|
-
[
|
|
197
|
-
[
|
|
198
|
-
[
|
|
199
|
-
[
|
|
200
|
-
[
|
|
201
|
-
[
|
|
202
|
-
[
|
|
203
|
-
[
|
|
204
|
-
[
|
|
205
|
-
[
|
|
206
|
-
[
|
|
207
|
-
[
|
|
208
|
-
[
|
|
209
|
-
[
|
|
210
|
-
[
|
|
211
|
-
[
|
|
212
|
-
[
|
|
196
|
+
[MIDSCENE_MODEL_NAME]: string;
|
|
197
|
+
[MIDSCENE_OPENAI_SOCKS_PROXY]?: string;
|
|
198
|
+
[MIDSCENE_OPENAI_HTTP_PROXY]?: string;
|
|
199
|
+
[MIDSCENE_OPENAI_BASE_URL]?: string;
|
|
200
|
+
[MIDSCENE_OPENAI_API_KEY]?: string;
|
|
201
|
+
[MIDSCENE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
202
|
+
[MIDSCENE_OPENAI_USE_AZURE]?: string;
|
|
203
|
+
[MIDSCENE_USE_AZURE_OPENAI]?: string;
|
|
204
|
+
[MIDSCENE_AZURE_OPENAI_SCOPE]?: string;
|
|
205
|
+
[MIDSCENE_AZURE_OPENAI_KEY]?: string;
|
|
206
|
+
[MIDSCENE_AZURE_OPENAI_ENDPOINT]?: string;
|
|
207
|
+
[MIDSCENE_AZURE_OPENAI_API_VERSION]?: string;
|
|
208
|
+
[MIDSCENE_AZURE_OPENAI_DEPLOYMENT]?: string;
|
|
209
|
+
[MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
210
|
+
[MIDSCENE_USE_ANTHROPIC_SDK]?: string;
|
|
211
|
+
[MIDSCENE_ANTHROPIC_API_KEY]?: string;
|
|
212
|
+
[MIDSCENE_VL_MODE]?: TVlModeValues;
|
|
213
213
|
}
|
|
214
214
|
export interface IModelConfigForDefaultLegacy {
|
|
215
|
-
[
|
|
216
|
-
[
|
|
217
|
-
[
|
|
215
|
+
[MIDSCENE_MODEL_NAME]: string;
|
|
216
|
+
[MIDSCENE_OPENAI_SOCKS_PROXY]?: string;
|
|
217
|
+
[MIDSCENE_OPENAI_HTTP_PROXY]?: string;
|
|
218
218
|
[OPENAI_BASE_URL]?: string;
|
|
219
219
|
[OPENAI_API_KEY]?: string;
|
|
220
|
-
[
|
|
220
|
+
[MIDSCENE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
221
221
|
[OPENAI_USE_AZURE]?: string;
|
|
222
|
-
[
|
|
223
|
-
[
|
|
222
|
+
[MIDSCENE_USE_AZURE_OPENAI]?: string;
|
|
223
|
+
[MIDSCENE_AZURE_OPENAI_SCOPE]?: string;
|
|
224
224
|
[AZURE_OPENAI_KEY]?: string;
|
|
225
225
|
[AZURE_OPENAI_ENDPOINT]?: string;
|
|
226
226
|
[AZURE_OPENAI_API_VERSION]?: string;
|
|
227
227
|
[AZURE_OPENAI_DEPLOYMENT]?: string;
|
|
228
|
-
[
|
|
229
|
-
[
|
|
228
|
+
[MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
229
|
+
[MIDSCENE_USE_ANTHROPIC_SDK]?: string;
|
|
230
230
|
[ANTHROPIC_API_KEY]?: string;
|
|
231
|
-
[
|
|
231
|
+
[MIDSCENE_VL_MODE]?: TVlModeValues;
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* - VQA: Visual Question Answering
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpascene/shared",
|
|
3
|
-
"
|
|
3
|
+
"description": "RPA shared",
|
|
4
|
+
"version": "0.30.10",
|
|
4
5
|
"repository": "",
|
|
5
6
|
"homepage": "",
|
|
6
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -63,17 +64,11 @@
|
|
|
63
64
|
"require": "./dist/lib/*.js"
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
"files": [
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"build:script": "rslib build -c ./rslib.inspect.config.ts",
|
|
72
|
-
"build:watch": "npm run build:script && rslib build --watch",
|
|
73
|
-
"reset": "rimraf ./**/node_modules",
|
|
74
|
-
"test": "vitest --run",
|
|
75
|
-
"test:u": "vitest --run -u"
|
|
76
|
-
},
|
|
67
|
+
"files": [
|
|
68
|
+
"dist",
|
|
69
|
+
"src",
|
|
70
|
+
"README.md"
|
|
71
|
+
],
|
|
77
72
|
"dependencies": {
|
|
78
73
|
"@silvia-odwyer/photon": "0.3.3",
|
|
79
74
|
"@silvia-odwyer/photon-node": "0.3.3",
|
|
@@ -98,5 +93,15 @@
|
|
|
98
93
|
"access": "public",
|
|
99
94
|
"registry": "https://registry.npmjs.org/"
|
|
100
95
|
},
|
|
101
|
-
"license": "MIT"
|
|
102
|
-
|
|
96
|
+
"license": "MIT",
|
|
97
|
+
"scripts": {
|
|
98
|
+
"dev": "npm run build:watch",
|
|
99
|
+
"build": "npm run build:script && npm run build:pkg",
|
|
100
|
+
"build:pkg": "rslib build",
|
|
101
|
+
"build:script": "rslib build -c ./rslib.inspect.config.ts",
|
|
102
|
+
"build:watch": "npm run build:script && rslib build --watch",
|
|
103
|
+
"reset": "rimraf ./**/node_modules",
|
|
104
|
+
"test": "vitest --run",
|
|
105
|
+
"test:u": "vitest --run -u"
|
|
106
|
+
}
|
|
107
|
+
}
|
package/src/common.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
// do not import getBasicEnvValue and
|
|
4
|
+
// do not import getBasicEnvValue and MIDSCENE_RUN_DIR directly from ./env,
|
|
5
5
|
// because it will cause circular dependency
|
|
6
6
|
import { getBasicEnvValue } from './env/basic';
|
|
7
|
-
import {
|
|
7
|
+
import { MIDSCENE_RUN_DIR } from './env/types';
|
|
8
8
|
import { ifInNode } from './utils';
|
|
9
9
|
|
|
10
10
|
export const defaultRunDirName = 'rpascene_run';
|
|
@@ -15,7 +15,7 @@ export const getRpasceneRunDir = () => {
|
|
|
15
15
|
return '';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return getBasicEnvValue(
|
|
18
|
+
return getBasicEnvValue(MIDSCENE_RUN_DIR) || defaultRunDirName;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const getRpasceneRunBaseDir = () => {
|