@xiuchang-midscene/shared 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/oss/index.mjs +1 -1
- package/dist/lib/oss/index.js +1 -1
- package/package.json +1 -1
- package/src/oss/index.ts +1 -1
- package/dist/es/baseDB.mjs.bak +0 -109
- package/dist/es/build/copy-static.mjs.bak +0 -31
- package/dist/es/build/rspack-config.mjs.bak +0 -4
- package/dist/es/cli/cli-runner.mjs.bak +0 -140
- package/dist/es/cli/index.mjs.bak +0 -2
- package/dist/es/common.mjs.bak +0 -37
- package/dist/es/constants/example-code.mjs.bak +0 -223
- package/dist/es/constants/index.mjs.bak +0 -23
- package/dist/es/env/basic.mjs.bak +0 -6
- package/dist/es/env/constants.mjs.bak +0 -70
- package/dist/es/env/global-config-manager.mjs.bak +0 -94
- package/dist/es/env/helper.mjs.bak +0 -43
- package/dist/es/env/index.mjs.bak +0 -5
- package/dist/es/env/init-debug.mjs.bak +0 -18
- package/dist/es/env/model-config-manager.mjs.bak +0 -79
- package/dist/es/env/parse-model-config.mjs.bak +0 -132
- package/dist/es/env/types.mjs.bak +0 -220
- package/dist/es/env/utils.mjs.bak +0 -26
- package/dist/es/extractor/constants.mjs.bak +0 -2
- package/dist/es/extractor/debug.mjs.bak +0 -6
- package/dist/es/extractor/dom-util.mjs.bak +0 -92
- package/dist/es/extractor/index.mjs.bak +0 -5
- package/dist/es/extractor/locator.mjs.bak +0 -250
- package/dist/es/extractor/tree.mjs.bak +0 -78
- package/dist/es/extractor/util.mjs.bak +0 -245
- package/dist/es/extractor/web-extractor.mjs.bak +0 -303
- package/dist/es/img/box-select.mjs.bak +0 -824
- package/dist/es/img/canvas-fallback.mjs.bak +0 -238
- package/dist/es/img/get-photon.mjs.bak +0 -45
- package/dist/es/img/get-sharp.mjs.bak +0 -11
- package/dist/es/img/index.mjs.bak +0 -4
- package/dist/es/img/info.mjs.bak +0 -29
- package/dist/es/img/transform.mjs.bak +0 -295
- package/dist/es/index.mjs.bak +0 -4
- package/dist/es/logger.mjs.bak +0 -64
- package/dist/es/mcp/base-server.mjs.bak +0 -281
- package/dist/es/mcp/base-tools.mjs.bak +0 -91
- package/dist/es/mcp/chrome-path.mjs.bak +0 -35
- package/dist/es/mcp/index.mjs.bak +0 -7
- package/dist/es/mcp/inject-report-html-plugin.mjs.bak +0 -53
- package/dist/es/mcp/launcher-helper.mjs.bak +0 -52
- package/dist/es/mcp/tool-generator.mjs.bak +0 -297
- package/dist/es/mcp/types.mjs.bak +0 -3
- package/dist/es/node/fs.mjs.bak +0 -44
- package/dist/es/node/index.mjs.bak +0 -2
- package/dist/es/node/port.mjs.bak +0 -24
- package/dist/es/oss/demo.mjs.bak +0 -30
- package/dist/es/oss/index.mjs.bak +0 -90
- package/dist/es/polyfills/async-hooks.mjs.bak +0 -2
- package/dist/es/polyfills/index.mjs.bak +0 -1
- package/dist/es/types/index.mjs.bak +0 -3
- package/dist/es/us-keyboard-layout.mjs.bak +0 -1414
- package/dist/es/utils.mjs.bak +0 -72
- package/dist/es/zod-schema-utils.mjs.bak +0 -54
- package/dist/lib/baseDB.js.bak +0 -149
- package/dist/lib/build/copy-static.js.bak +0 -79
- package/dist/lib/build/rspack-config.js.bak +0 -38
- package/dist/lib/cli/cli-runner.js.bak +0 -196
- package/dist/lib/cli/index.js.bak +0 -48
- package/dist/lib/common.js.bak +0 -93
- package/dist/lib/constants/example-code.js.bak +0 -260
- package/dist/lib/constants/index.js.bak +0 -96
- package/dist/lib/env/basic.js.bak +0 -40
- package/dist/lib/env/constants.js.bak +0 -113
- package/dist/lib/env/global-config-manager.js.bak +0 -128
- package/dist/lib/env/helper.js.bak +0 -80
- package/dist/lib/env/index.js.bak +0 -90
- package/dist/lib/env/init-debug.js.bak +0 -52
- package/dist/lib/env/model-config-manager.js.bak +0 -113
- package/dist/lib/env/parse-model-config.js.bak +0 -178
- package/dist/lib/env/types.js.bak +0 -554
- package/dist/lib/env/utils.js.bak +0 -72
- package/dist/lib/extractor/constants.js.bak +0 -42
- package/dist/lib/extractor/debug.js.bak +0 -12
- package/dist/lib/extractor/dom-util.js.bak +0 -153
- package/dist/lib/extractor/index.js.bak +0 -81
- package/dist/lib/extractor/locator.js.bak +0 -296
- package/dist/lib/extractor/tree.js.bak +0 -124
- package/dist/lib/extractor/util.js.bak +0 -336
- package/dist/lib/extractor/web-extractor.js.bak +0 -349
- package/dist/lib/img/box-select.js.bak +0 -875
- package/dist/lib/img/canvas-fallback.js.bak +0 -305
- package/dist/lib/img/get-photon.js.bak +0 -82
- package/dist/lib/img/get-sharp.js.bak +0 -45
- package/dist/lib/img/index.js.bak +0 -95
- package/dist/lib/img/info.js.bak +0 -83
- package/dist/lib/img/transform.js.bak +0 -387
- package/dist/lib/index.js.bak +0 -47
- package/dist/lib/logger.js.bak +0 -114
- package/dist/lib/mcp/base-server.js.bak +0 -331
- package/dist/lib/mcp/base-tools.js.bak +0 -125
- package/dist/lib/mcp/chrome-path.js.bak +0 -72
- package/dist/lib/mcp/index.js.bak +0 -100
- package/dist/lib/mcp/inject-report-html-plugin.js.bak +0 -98
- package/dist/lib/mcp/launcher-helper.js.bak +0 -86
- package/dist/lib/mcp/tool-generator.js.bak +0 -334
- package/dist/lib/mcp/types.js.bak +0 -40
- package/dist/lib/node/fs.js.bak +0 -97
- package/dist/lib/node/index.js.bak +0 -65
- package/dist/lib/node/port.js.bak +0 -61
- package/dist/lib/oss/demo.js.bak +0 -36
- package/dist/lib/oss/index.js.bak +0 -138
- package/dist/lib/polyfills/async-hooks.js.bak +0 -36
- package/dist/lib/polyfills/index.js.bak +0 -58
- package/dist/lib/types/index.js.bak +0 -37
- package/dist/lib/us-keyboard-layout.js.bak +0 -1457
- package/dist/lib/utils.js.bak +0 -148
- package/dist/lib/zod-schema-utils.js.bak +0 -97
- package/dist/types/baseDB.d.ts.bak +0 -25
- package/dist/types/build/copy-static.d.ts.bak +0 -31
- package/dist/types/build/rspack-config.d.ts.bak +0 -8
- package/dist/types/cli/cli-runner.d.ts.bak +0 -14
- package/dist/types/cli/index.d.ts.bak +0 -2
- package/dist/types/common.d.ts.bak +0 -12
- package/dist/types/constants/example-code.d.ts.bak +0 -2
- package/dist/types/constants/index.d.ts.bak +0 -21
- package/dist/types/env/basic.d.ts.bak +0 -6
- package/dist/types/env/constants.d.ts.bak +0 -40
- package/dist/types/env/global-config-manager.d.ts.bak +0 -32
- package/dist/types/env/helper.d.ts.bak +0 -4
- package/dist/types/env/index.d.ts.bak +0 -4
- package/dist/types/env/init-debug.d.ts.bak +0 -1
- package/dist/types/env/model-config-manager.d.ts.bak +0 -25
- package/dist/types/env/parse-model-config.d.ts.bak +0 -31
- package/dist/types/env/types.d.ts.bak +0 -318
- package/dist/types/env/utils.d.ts.bak +0 -38
- package/dist/types/extractor/constants.d.ts.bak +0 -1
- package/dist/types/extractor/debug.d.ts.bak +0 -1
- package/dist/types/extractor/dom-util.d.ts.bak +0 -56
- package/dist/types/extractor/index.d.ts.bak +0 -32
- package/dist/types/extractor/locator.d.ts.bak +0 -9
- package/dist/types/extractor/tree.d.ts.bak +0 -6
- package/dist/types/extractor/util.d.ts.bak +0 -47
- package/dist/types/extractor/web-extractor.d.ts.bak +0 -19
- package/dist/types/img/box-select.d.ts.bak +0 -26
- package/dist/types/img/canvas-fallback.d.ts.bak +0 -105
- package/dist/types/img/get-photon.d.ts.bak +0 -19
- package/dist/types/img/get-sharp.d.ts.bak +0 -3
- package/dist/types/img/index.d.ts.bak +0 -3
- package/dist/types/img/info.d.ts.bak +0 -29
- package/dist/types/img/transform.d.ts.bak +0 -107
- package/dist/types/index.d.ts.bak +0 -4
- package/dist/types/logger.d.ts.bak +0 -5
- package/dist/types/mcp/base-server.d.ts.bak +0 -93
- package/dist/types/mcp/base-tools.d.ts.bak +0 -79
- package/dist/types/mcp/chrome-path.d.ts.bak +0 -2
- package/dist/types/mcp/index.d.ts.bak +0 -7
- package/dist/types/mcp/inject-report-html-plugin.d.ts.bak +0 -18
- package/dist/types/mcp/launcher-helper.d.ts.bak +0 -94
- package/dist/types/mcp/tool-generator.d.ts.bak +0 -10
- package/dist/types/mcp/types.d.ts.bak +0 -103
- package/dist/types/node/fs.d.ts.bak +0 -15
- package/dist/types/node/index.d.ts.bak +0 -2
- package/dist/types/node/port.d.ts.bak +0 -8
- package/dist/types/oss/demo.d.ts.bak +0 -1
- package/dist/types/oss/index.d.ts.bak +0 -34
- package/dist/types/polyfills/async-hooks.d.ts.bak +0 -6
- package/dist/types/polyfills/index.d.ts.bak +0 -4
- package/dist/types/types/index.d.ts.bak +0 -34
- package/dist/types/us-keyboard-layout.d.ts.bak +0 -32
- package/dist/types/utils.d.ts.bak +0 -34
- package/dist/types/zod-schema-utils.d.ts.bak +0 -23
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
export declare const MIDSCENE_MODEL_INIT_CONFIG_JSON = "MIDSCENE_MODEL_INIT_CONFIG_JSON";
|
|
2
|
-
export declare const MIDSCENE_MODEL_EXTRA_BODY_JSON = "MIDSCENE_MODEL_EXTRA_BODY_JSON";
|
|
3
|
-
export declare const MIDSCENE_MODEL_NAME = "MIDSCENE_MODEL_NAME";
|
|
4
|
-
export declare const MIDSCENE_DEBUG_MODEL_PROFILE = "MIDSCENE_DEBUG_MODEL_PROFILE";
|
|
5
|
-
export declare const MIDSCENE_DEBUG_MODEL_RESPONSE = "MIDSCENE_DEBUG_MODEL_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
|
-
export declare const DOCKER_CONTAINER = "DOCKER_CONTAINER";
|
|
12
|
-
export declare const MIDSCENE_LANGSMITH_DEBUG = "MIDSCENE_LANGSMITH_DEBUG";
|
|
13
|
-
export declare const MIDSCENE_LANGFUSE_DEBUG = "MIDSCENE_LANGFUSE_DEBUG";
|
|
14
|
-
export declare const MIDSCENE_MODEL_SOCKS_PROXY = "MIDSCENE_MODEL_SOCKS_PROXY";
|
|
15
|
-
export declare const MIDSCENE_MODEL_HTTP_PROXY = "MIDSCENE_MODEL_HTTP_PROXY";
|
|
16
|
-
export declare const MIDSCENE_MODEL_API_KEY = "MIDSCENE_MODEL_API_KEY";
|
|
17
|
-
export declare const MIDSCENE_MODEL_BASE_URL = "MIDSCENE_MODEL_BASE_URL";
|
|
18
|
-
export declare const MIDSCENE_MODEL_MAX_TOKENS = "MIDSCENE_MODEL_MAX_TOKENS";
|
|
19
|
-
export declare const MIDSCENE_MODEL_TIMEOUT = "MIDSCENE_MODEL_TIMEOUT";
|
|
20
|
-
export declare const MIDSCENE_MODEL_TEMPERATURE = "MIDSCENE_MODEL_TEMPERATURE";
|
|
21
|
-
export declare const MIDSCENE_MODEL_RETRY_COUNT = "MIDSCENE_MODEL_RETRY_COUNT";
|
|
22
|
-
export declare const MIDSCENE_MODEL_RETRY_INTERVAL = "MIDSCENE_MODEL_RETRY_INTERVAL";
|
|
23
|
-
export declare const MIDSCENE_MODEL_REASONING_EFFORT = "MIDSCENE_MODEL_REASONING_EFFORT";
|
|
24
|
-
export declare const MIDSCENE_MODEL_REASONING_ENABLED = "MIDSCENE_MODEL_REASONING_ENABLED";
|
|
25
|
-
export declare const MIDSCENE_MODEL_REASONING_BUDGET = "MIDSCENE_MODEL_REASONING_BUDGET";
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Use MIDSCENE_MODEL_API_KEY instead. This is kept for backward compatibility.
|
|
28
|
-
*/
|
|
29
|
-
export declare const OPENAI_API_KEY = "OPENAI_API_KEY";
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Use MIDSCENE_MODEL_BASE_URL instead. This is kept for backward compatibility.
|
|
32
|
-
*/
|
|
33
|
-
export declare const OPENAI_BASE_URL = "OPENAI_BASE_URL";
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use MIDSCENE_MODEL_INIT_CONFIG_JSON instead. This is kept for backward compatibility.
|
|
36
|
-
*/
|
|
37
|
-
export declare const MIDSCENE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_OPENAI_INIT_CONFIG_JSON";
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use MIDSCENE_MODEL_HTTP_PROXY instead. This is kept for backward compatibility.
|
|
40
|
-
*/
|
|
41
|
-
export declare const MIDSCENE_OPENAI_HTTP_PROXY = "MIDSCENE_OPENAI_HTTP_PROXY";
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated Use MIDSCENE_MODEL_SOCKS_PROXY instead. This is kept for backward compatibility.
|
|
44
|
-
*/
|
|
45
|
-
export declare const MIDSCENE_OPENAI_SOCKS_PROXY = "MIDSCENE_OPENAI_SOCKS_PROXY";
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated Use MIDSCENE_MODEL_MAX_TOKENS instead. This is kept for backward compatibility.
|
|
48
|
-
*/
|
|
49
|
-
export declare const OPENAI_MAX_TOKENS = "OPENAI_MAX_TOKENS";
|
|
50
|
-
export declare const MIDSCENE_ADB_PATH = "MIDSCENE_ADB_PATH";
|
|
51
|
-
export declare const MIDSCENE_ADB_REMOTE_HOST = "MIDSCENE_ADB_REMOTE_HOST";
|
|
52
|
-
export declare const MIDSCENE_ADB_REMOTE_PORT = "MIDSCENE_ADB_REMOTE_PORT";
|
|
53
|
-
export declare const MIDSCENE_ANDROID_IME_STRATEGY = "MIDSCENE_ANDROID_IME_STRATEGY";
|
|
54
|
-
export declare const MIDSCENE_IOS_DEVICE_UDID = "MIDSCENE_IOS_DEVICE_UDID";
|
|
55
|
-
export declare const MIDSCENE_IOS_SIMULATOR_UDID = "MIDSCENE_IOS_SIMULATOR_UDID";
|
|
56
|
-
export declare const MIDSCENE_CACHE = "MIDSCENE_CACHE";
|
|
57
|
-
export declare const MIDSCENE_USE_VLM_UI_TARS = "MIDSCENE_USE_VLM_UI_TARS";
|
|
58
|
-
export declare const MIDSCENE_USE_QWEN_VL = "MIDSCENE_USE_QWEN_VL";
|
|
59
|
-
export declare const MIDSCENE_USE_QWEN3_VL = "MIDSCENE_USE_QWEN3_VL";
|
|
60
|
-
export declare const MIDSCENE_USE_DOUBAO_VISION = "MIDSCENE_USE_DOUBAO_VISION";
|
|
61
|
-
export declare const MIDSCENE_USE_GEMINI = "MIDSCENE_USE_GEMINI";
|
|
62
|
-
export declare const MIDSCENE_USE_VL_MODEL = "MIDSCENE_USE_VL_MODEL";
|
|
63
|
-
export declare const MATCH_BY_POSITION = "MATCH_BY_POSITION";
|
|
64
|
-
export declare const MIDSCENE_REPORT_TAG_NAME = "MIDSCENE_REPORT_TAG_NAME";
|
|
65
|
-
export declare const MIDSCENE_REPORT_QUIET = "MIDSCENE_REPORT_QUIET";
|
|
66
|
-
export declare const MIDSCENE_PREFERRED_LANGUAGE = "MIDSCENE_PREFERRED_LANGUAGE";
|
|
67
|
-
export declare const MIDSCENE_CACHE_MAX_FILENAME_LENGTH = "MIDSCENE_CACHE_MAX_FILENAME_LENGTH";
|
|
68
|
-
export declare const MIDSCENE_REPLANNING_CYCLE_LIMIT = "MIDSCENE_REPLANNING_CYCLE_LIMIT";
|
|
69
|
-
export declare const MIDSCENE_RUN_DIR = "MIDSCENE_RUN_DIR";
|
|
70
|
-
export declare const MIDSCENE_OSS_ENABLE = "MIDSCENE_OSS_ENABLE";
|
|
71
|
-
export declare const MIDSCENE_OSS_TOKEN_URL = "MIDSCENE_OSS_TOKEN_URL";
|
|
72
|
-
export declare const MIDSCENE_OSS_TOKEN_RESPONSE_PATH = "MIDSCENE_OSS_TOKEN_RESPONSE_PATH";
|
|
73
|
-
export declare const MIDSCENE_OSS_REGION = "MIDSCENE_OSS_REGION";
|
|
74
|
-
export declare const MIDSCENE_OSS_BUCKET = "MIDSCENE_OSS_BUCKET";
|
|
75
|
-
export declare const MIDSCENE_OSS_ENDPOINT = "MIDSCENE_OSS_ENDPOINT";
|
|
76
|
-
export declare const MIDSCENE_OSS_PREFIX = "MIDSCENE_OSS_PREFIX";
|
|
77
|
-
export declare const MIDSCENE_OSS_DOMAIN = "MIDSCENE_OSS_DOMAIN";
|
|
78
|
-
export declare const MIDSCENE_REPORT_JPEG_QUALITY = "MIDSCENE_REPORT_JPEG_QUALITY";
|
|
79
|
-
export declare const MIDSCENE_INSIGHT_MODEL_NAME = "MIDSCENE_INSIGHT_MODEL_NAME";
|
|
80
|
-
export declare const MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY = "MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY";
|
|
81
|
-
export declare const MIDSCENE_INSIGHT_MODEL_HTTP_PROXY = "MIDSCENE_INSIGHT_MODEL_HTTP_PROXY";
|
|
82
|
-
export declare const MIDSCENE_INSIGHT_MODEL_BASE_URL = "MIDSCENE_INSIGHT_MODEL_BASE_URL";
|
|
83
|
-
export declare const MIDSCENE_INSIGHT_MODEL_API_KEY = "MIDSCENE_INSIGHT_MODEL_API_KEY";
|
|
84
|
-
export declare const MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON = "MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON";
|
|
85
|
-
export declare const MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON = "MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON";
|
|
86
|
-
export declare const MIDSCENE_INSIGHT_MODEL_TIMEOUT = "MIDSCENE_INSIGHT_MODEL_TIMEOUT";
|
|
87
|
-
export declare const MIDSCENE_INSIGHT_MODEL_TEMPERATURE = "MIDSCENE_INSIGHT_MODEL_TEMPERATURE";
|
|
88
|
-
export declare const MIDSCENE_INSIGHT_MODEL_RETRY_COUNT = "MIDSCENE_INSIGHT_MODEL_RETRY_COUNT";
|
|
89
|
-
export declare const MIDSCENE_INSIGHT_MODEL_RETRY_INTERVAL = "MIDSCENE_INSIGHT_MODEL_RETRY_INTERVAL";
|
|
90
|
-
export declare const MIDSCENE_INSIGHT_MODEL_FAMILY = "MIDSCENE_INSIGHT_MODEL_FAMILY";
|
|
91
|
-
export declare const MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT = "MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT";
|
|
92
|
-
export declare const MIDSCENE_INSIGHT_MODEL_REASONING_ENABLED = "MIDSCENE_INSIGHT_MODEL_REASONING_ENABLED";
|
|
93
|
-
export declare const MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET = "MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET";
|
|
94
|
-
export declare const MIDSCENE_PLANNING_MODEL_NAME = "MIDSCENE_PLANNING_MODEL_NAME";
|
|
95
|
-
export declare const MIDSCENE_PLANNING_MODEL_SOCKS_PROXY = "MIDSCENE_PLANNING_MODEL_SOCKS_PROXY";
|
|
96
|
-
export declare const MIDSCENE_PLANNING_MODEL_HTTP_PROXY = "MIDSCENE_PLANNING_MODEL_HTTP_PROXY";
|
|
97
|
-
export declare const MIDSCENE_PLANNING_MODEL_BASE_URL = "MIDSCENE_PLANNING_MODEL_BASE_URL";
|
|
98
|
-
export declare const MIDSCENE_PLANNING_MODEL_API_KEY = "MIDSCENE_PLANNING_MODEL_API_KEY";
|
|
99
|
-
export declare const MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON = "MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON";
|
|
100
|
-
export declare const MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON = "MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON";
|
|
101
|
-
export declare const MIDSCENE_PLANNING_MODEL_TIMEOUT = "MIDSCENE_PLANNING_MODEL_TIMEOUT";
|
|
102
|
-
export declare const MIDSCENE_PLANNING_MODEL_TEMPERATURE = "MIDSCENE_PLANNING_MODEL_TEMPERATURE";
|
|
103
|
-
export declare const MIDSCENE_PLANNING_MODEL_RETRY_COUNT = "MIDSCENE_PLANNING_MODEL_RETRY_COUNT";
|
|
104
|
-
export declare const MIDSCENE_PLANNING_MODEL_RETRY_INTERVAL = "MIDSCENE_PLANNING_MODEL_RETRY_INTERVAL";
|
|
105
|
-
export declare const MIDSCENE_PLANNING_MODEL_FAMILY = "MIDSCENE_PLANNING_MODEL_FAMILY";
|
|
106
|
-
export declare const MIDSCENE_PLANNING_MODEL_REASONING_EFFORT = "MIDSCENE_PLANNING_MODEL_REASONING_EFFORT";
|
|
107
|
-
export declare const MIDSCENE_PLANNING_MODEL_REASONING_ENABLED = "MIDSCENE_PLANNING_MODEL_REASONING_ENABLED";
|
|
108
|
-
export declare const MIDSCENE_PLANNING_MODEL_REASONING_BUDGET = "MIDSCENE_PLANNING_MODEL_REASONING_BUDGET";
|
|
109
|
-
export declare const MIDSCENE_MODEL_FAMILY = "MIDSCENE_MODEL_FAMILY";
|
|
110
|
-
/**
|
|
111
|
-
* env keys declared but unused
|
|
112
|
-
*/
|
|
113
|
-
export declare const UNUSED_ENV_KEYS: string[];
|
|
114
|
-
/**
|
|
115
|
-
* env keys for debug or basic run
|
|
116
|
-
* can not be override by overrideAIConfig
|
|
117
|
-
*/
|
|
118
|
-
export declare const BASIC_ENV_KEYS: readonly ["MIDSCENE_DEBUG_MODE", "MIDSCENE_DEBUG_MODEL_PROFILE", "MIDSCENE_DEBUG_MODEL_RESPONSE", "MIDSCENE_RUN_DIR"];
|
|
119
|
-
export declare const BOOLEAN_ENV_KEYS: readonly ["MIDSCENE_CACHE", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_LANGFUSE_DEBUG", "MIDSCENE_REPORT_QUIET"];
|
|
120
|
-
export declare const NUMBER_ENV_KEYS: readonly ["MIDSCENE_MODEL_MAX_TOKENS", "MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT"];
|
|
121
|
-
export declare const STRING_ENV_KEYS: readonly ["MIDSCENE_MODEL_MAX_TOKENS", "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"];
|
|
122
|
-
/**
|
|
123
|
-
* Non model related env keys, used for globally controlling the behavior of midscene
|
|
124
|
-
* Can not be override by agent.modelConfig but can be override by overrideAIConfig
|
|
125
|
-
* Can be access at any time
|
|
126
|
-
*/
|
|
127
|
-
export declare const GLOBAL_ENV_KEYS: readonly ["MIDSCENE_CACHE", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_LANGFUSE_DEBUG", "MIDSCENE_REPORT_QUIET", "MIDSCENE_MODEL_MAX_TOKENS", "MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT", "MIDSCENE_MODEL_MAX_TOKENS", "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"];
|
|
128
|
-
/**
|
|
129
|
-
* Model related eve keys, used for declare which model to use.
|
|
130
|
-
* Can be override by both agent.modelConfig and overrideAIConfig
|
|
131
|
-
* Can only be access after agent.constructor
|
|
132
|
-
*/
|
|
133
|
-
export declare const MODEL_ENV_KEYS: readonly ["MIDSCENE_MODEL_NAME", "MIDSCENE_MODEL_INIT_CONFIG_JSON", "MIDSCENE_MODEL_EXTRA_BODY_JSON", "MIDSCENE_MODEL_API_KEY", "MIDSCENE_MODEL_BASE_URL", "MIDSCENE_MODEL_SOCKS_PROXY", "MIDSCENE_MODEL_HTTP_PROXY", "MIDSCENE_MODEL_TIMEOUT", "MIDSCENE_MODEL_TEMPERATURE", "MIDSCENE_MODEL_RETRY_COUNT", "MIDSCENE_MODEL_RETRY_INTERVAL", "MIDSCENE_MODEL_REASONING_EFFORT", "MIDSCENE_MODEL_REASONING_ENABLED", "MIDSCENE_MODEL_REASONING_BUDGET", "MIDSCENE_USE_VLM_UI_TARS", "MIDSCENE_USE_QWEN_VL", "MIDSCENE_USE_QWEN3_VL", "MIDSCENE_USE_DOUBAO_VISION", "MIDSCENE_USE_GEMINI", "MIDSCENE_USE_VL_MODEL", "OPENAI_API_KEY", "OPENAI_BASE_URL", "MIDSCENE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_OPENAI_HTTP_PROXY", "MIDSCENE_OPENAI_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_NAME", "MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_HTTP_PROXY", "MIDSCENE_INSIGHT_MODEL_BASE_URL", "MIDSCENE_INSIGHT_MODEL_API_KEY", "MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON", "MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON", "MIDSCENE_INSIGHT_MODEL_TIMEOUT", "MIDSCENE_INSIGHT_MODEL_TEMPERATURE", "MIDSCENE_INSIGHT_MODEL_RETRY_COUNT", "MIDSCENE_INSIGHT_MODEL_RETRY_INTERVAL", "MIDSCENE_INSIGHT_MODEL_FAMILY", "MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT", "MIDSCENE_INSIGHT_MODEL_REASONING_ENABLED", "MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET", "MIDSCENE_PLANNING_MODEL_NAME", "MIDSCENE_PLANNING_MODEL_SOCKS_PROXY", "MIDSCENE_PLANNING_MODEL_HTTP_PROXY", "MIDSCENE_PLANNING_MODEL_BASE_URL", "MIDSCENE_PLANNING_MODEL_API_KEY", "MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON", "MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON", "MIDSCENE_PLANNING_MODEL_TIMEOUT", "MIDSCENE_PLANNING_MODEL_TEMPERATURE", "MIDSCENE_PLANNING_MODEL_RETRY_COUNT", "MIDSCENE_PLANNING_MODEL_RETRY_INTERVAL", "MIDSCENE_PLANNING_MODEL_FAMILY", "MIDSCENE_PLANNING_MODEL_REASONING_EFFORT", "MIDSCENE_PLANNING_MODEL_REASONING_ENABLED", "MIDSCENE_PLANNING_MODEL_REASONING_BUDGET", "MIDSCENE_MODEL_FAMILY"];
|
|
134
|
-
export declare const ALL_ENV_KEYS: readonly [...string[], "MIDSCENE_DEBUG_MODE", "MIDSCENE_DEBUG_MODEL_PROFILE", "MIDSCENE_DEBUG_MODEL_RESPONSE", "MIDSCENE_RUN_DIR", "MIDSCENE_CACHE", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_LANGFUSE_DEBUG", "MIDSCENE_REPORT_QUIET", "MIDSCENE_MODEL_MAX_TOKENS", "MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT", "MIDSCENE_MODEL_MAX_TOKENS", "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", "MIDSCENE_MODEL_NAME", "MIDSCENE_MODEL_INIT_CONFIG_JSON", "MIDSCENE_MODEL_EXTRA_BODY_JSON", "MIDSCENE_MODEL_API_KEY", "MIDSCENE_MODEL_BASE_URL", "MIDSCENE_MODEL_SOCKS_PROXY", "MIDSCENE_MODEL_HTTP_PROXY", "MIDSCENE_MODEL_TIMEOUT", "MIDSCENE_MODEL_TEMPERATURE", "MIDSCENE_MODEL_RETRY_COUNT", "MIDSCENE_MODEL_RETRY_INTERVAL", "MIDSCENE_MODEL_REASONING_EFFORT", "MIDSCENE_MODEL_REASONING_ENABLED", "MIDSCENE_MODEL_REASONING_BUDGET", "MIDSCENE_USE_VLM_UI_TARS", "MIDSCENE_USE_QWEN_VL", "MIDSCENE_USE_QWEN3_VL", "MIDSCENE_USE_DOUBAO_VISION", "MIDSCENE_USE_GEMINI", "MIDSCENE_USE_VL_MODEL", "OPENAI_API_KEY", "OPENAI_BASE_URL", "MIDSCENE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_OPENAI_HTTP_PROXY", "MIDSCENE_OPENAI_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_NAME", "MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_HTTP_PROXY", "MIDSCENE_INSIGHT_MODEL_BASE_URL", "MIDSCENE_INSIGHT_MODEL_API_KEY", "MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON", "MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON", "MIDSCENE_INSIGHT_MODEL_TIMEOUT", "MIDSCENE_INSIGHT_MODEL_TEMPERATURE", "MIDSCENE_INSIGHT_MODEL_RETRY_COUNT", "MIDSCENE_INSIGHT_MODEL_RETRY_INTERVAL", "MIDSCENE_INSIGHT_MODEL_FAMILY", "MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT", "MIDSCENE_INSIGHT_MODEL_REASONING_ENABLED", "MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET", "MIDSCENE_PLANNING_MODEL_NAME", "MIDSCENE_PLANNING_MODEL_SOCKS_PROXY", "MIDSCENE_PLANNING_MODEL_HTTP_PROXY", "MIDSCENE_PLANNING_MODEL_BASE_URL", "MIDSCENE_PLANNING_MODEL_API_KEY", "MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON", "MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON", "MIDSCENE_PLANNING_MODEL_TIMEOUT", "MIDSCENE_PLANNING_MODEL_TEMPERATURE", "MIDSCENE_PLANNING_MODEL_RETRY_COUNT", "MIDSCENE_PLANNING_MODEL_RETRY_INTERVAL", "MIDSCENE_PLANNING_MODEL_FAMILY", "MIDSCENE_PLANNING_MODEL_REASONING_EFFORT", "MIDSCENE_PLANNING_MODEL_REASONING_ENABLED", "MIDSCENE_PLANNING_MODEL_REASONING_BUDGET", "MIDSCENE_MODEL_FAMILY"];
|
|
135
|
-
export type TEnvKeys = (typeof ALL_ENV_KEYS)[number];
|
|
136
|
-
export type TGlobalConfig = Record<TEnvKeys, string | undefined>;
|
|
137
|
-
/**
|
|
138
|
-
* valid Model family types
|
|
139
|
-
*/
|
|
140
|
-
export type TModelFamily = 'qwen2.5-vl' | 'qwen3-vl' | 'qwen3.5' | 'doubao-vision' | 'doubao-seed' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v' | 'auto-glm' | 'auto-glm-multilingual' | 'gpt-5';
|
|
141
|
-
export declare const MODEL_FAMILY_VALUES: TModelFamily[];
|
|
142
|
-
export interface IModelConfigForInsight {
|
|
143
|
-
[MIDSCENE_INSIGHT_MODEL_NAME]: string;
|
|
144
|
-
[MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY]?: string;
|
|
145
|
-
[MIDSCENE_INSIGHT_MODEL_HTTP_PROXY]?: string;
|
|
146
|
-
[MIDSCENE_INSIGHT_MODEL_BASE_URL]?: string;
|
|
147
|
-
[MIDSCENE_INSIGHT_MODEL_API_KEY]?: string;
|
|
148
|
-
[MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON]?: string;
|
|
149
|
-
[MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON]?: string;
|
|
150
|
-
[MIDSCENE_INSIGHT_MODEL_TIMEOUT]?: string;
|
|
151
|
-
[MIDSCENE_INSIGHT_MODEL_TEMPERATURE]?: string;
|
|
152
|
-
[MIDSCENE_INSIGHT_MODEL_FAMILY]?: TModelFamily;
|
|
153
|
-
}
|
|
154
|
-
export interface IModelConfigForPlanning {
|
|
155
|
-
[MIDSCENE_PLANNING_MODEL_NAME]: string;
|
|
156
|
-
[MIDSCENE_PLANNING_MODEL_SOCKS_PROXY]?: string;
|
|
157
|
-
[MIDSCENE_PLANNING_MODEL_HTTP_PROXY]?: string;
|
|
158
|
-
[MIDSCENE_PLANNING_MODEL_BASE_URL]?: string;
|
|
159
|
-
[MIDSCENE_PLANNING_MODEL_API_KEY]?: string;
|
|
160
|
-
[MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON]?: string;
|
|
161
|
-
[MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON]?: string;
|
|
162
|
-
[MIDSCENE_PLANNING_MODEL_TIMEOUT]?: string;
|
|
163
|
-
[MIDSCENE_PLANNING_MODEL_TEMPERATURE]?: string;
|
|
164
|
-
[MIDSCENE_PLANNING_MODEL_FAMILY]?: TModelFamily;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Model configuration for Planning intent.
|
|
168
|
-
*
|
|
169
|
-
* IMPORTANT: Planning MUST use a vision language model (VL mode).
|
|
170
|
-
* DOM-based planning is not supported.
|
|
171
|
-
*
|
|
172
|
-
* Required: MIDSCENE_MODEL_FAMILY must be set to one of 「TModelFamily」
|
|
173
|
-
*/
|
|
174
|
-
export interface IModelConfigForDefault {
|
|
175
|
-
[MIDSCENE_MODEL_NAME]: string;
|
|
176
|
-
[MIDSCENE_MODEL_SOCKS_PROXY]?: string;
|
|
177
|
-
[MIDSCENE_MODEL_HTTP_PROXY]?: string;
|
|
178
|
-
[MIDSCENE_MODEL_BASE_URL]?: string;
|
|
179
|
-
[MIDSCENE_MODEL_API_KEY]?: string;
|
|
180
|
-
[MIDSCENE_MODEL_INIT_CONFIG_JSON]?: string;
|
|
181
|
-
[MIDSCENE_MODEL_EXTRA_BODY_JSON]?: string;
|
|
182
|
-
[MIDSCENE_MODEL_FAMILY]?: TModelFamily;
|
|
183
|
-
[MIDSCENE_MODEL_TEMPERATURE]?: string;
|
|
184
|
-
[MIDSCENE_MODEL_REASONING_EFFORT]?: string;
|
|
185
|
-
[MIDSCENE_MODEL_REASONING_ENABLED]?: string;
|
|
186
|
-
[MIDSCENE_MODEL_REASONING_BUDGET]?: string;
|
|
187
|
-
}
|
|
188
|
-
export interface IModelConfigForDefaultLegacy {
|
|
189
|
-
[MIDSCENE_MODEL_NAME]: string;
|
|
190
|
-
[MIDSCENE_OPENAI_SOCKS_PROXY]?: string;
|
|
191
|
-
[MIDSCENE_OPENAI_HTTP_PROXY]?: string;
|
|
192
|
-
[OPENAI_BASE_URL]?: string;
|
|
193
|
-
[OPENAI_API_KEY]?: string;
|
|
194
|
-
[MIDSCENE_OPENAI_INIT_CONFIG_JSON]?: string;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* - insight: Visual Question Answering and Visual Grounding (unified)
|
|
198
|
-
* - planning: planning
|
|
199
|
-
* - default: all except insight、planning
|
|
200
|
-
*/
|
|
201
|
-
export type TIntent = 'insight' | 'planning' | 'default';
|
|
202
|
-
/**
|
|
203
|
-
* Env-style model configuration map supplied directly to the agent.
|
|
204
|
-
* Numbers are allowed so callers can pass numeric env values (e.g. limits) without casting.
|
|
205
|
-
*/
|
|
206
|
-
export type TModelConfig = Record<string, string | number>;
|
|
207
|
-
export declare enum UITarsModelVersion {
|
|
208
|
-
V1_0 = "1.0",
|
|
209
|
-
V1_5 = "1.5",
|
|
210
|
-
DOUBAO_1_5_15B = "doubao-1.5-15B",
|
|
211
|
-
DOUBAO_1_5_20B = "doubao-1.5-20B"
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Callback to create custom OpenAI client instance
|
|
215
|
-
* @param config - Resolved model configuration including apiKey, baseURL, modelName, intent, etc.
|
|
216
|
-
* @returns OpenAI client instance (can be wrapped with langsmith, langfuse, etc.)
|
|
217
|
-
*
|
|
218
|
-
* Note: Wrapper functions like langsmith's wrapOpenAI() return the same OpenAI instance
|
|
219
|
-
* with enhanced behavior, so the return type remains compatible with OpenAI.
|
|
220
|
-
*
|
|
221
|
-
* Note: The return type is `any` in the shared package to avoid requiring openai as a dependency.
|
|
222
|
-
* The actual implementation should return an OpenAI instance.
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* ```typescript
|
|
226
|
-
* import OpenAI from 'openai';
|
|
227
|
-
* import { wrapOpenAI } from 'langsmith/wrappers';
|
|
228
|
-
*
|
|
229
|
-
* createOpenAIClient: async (openai, opts) => {
|
|
230
|
-
* // Wrap with langsmith for planning tasks
|
|
231
|
-
* if (opts.baseURL?.includes('planning')) {
|
|
232
|
-
* return wrapOpenAI(openai, { metadata: { task: 'planning' } });
|
|
233
|
-
* }
|
|
234
|
-
*
|
|
235
|
-
* return openai;
|
|
236
|
-
* }
|
|
237
|
-
* ```
|
|
238
|
-
*/
|
|
239
|
-
export type CreateOpenAIClientFn = (openAIInstance: any, options: Record<string, unknown>) => Promise<any>;
|
|
240
|
-
export interface IModelConfig {
|
|
241
|
-
/**
|
|
242
|
-
* proxy
|
|
243
|
-
*/
|
|
244
|
-
socksProxy?: string;
|
|
245
|
-
httpProxy?: string;
|
|
246
|
-
/**
|
|
247
|
-
* model
|
|
248
|
-
*/
|
|
249
|
-
modelName: string;
|
|
250
|
-
/**
|
|
251
|
-
* OpenAI
|
|
252
|
-
*/
|
|
253
|
-
openaiBaseURL?: string;
|
|
254
|
-
openaiApiKey?: string;
|
|
255
|
-
openaiExtraConfig?: Record<string, unknown>;
|
|
256
|
-
/**
|
|
257
|
-
* Extra body parameters merged into each chat completion request body.
|
|
258
|
-
* Unlike openaiExtraConfig (which configures the OpenAI client instance),
|
|
259
|
-
* this is spread directly into the completion.create() call body.
|
|
260
|
-
* Example: { "chat_template_kwargs": { "enable_thinking": true } }
|
|
261
|
-
*/
|
|
262
|
-
extraBody?: Record<string, unknown>;
|
|
263
|
-
/**
|
|
264
|
-
* Timeout for API calls in milliseconds.
|
|
265
|
-
* If not set, uses OpenAI SDK default (10 minutes).
|
|
266
|
-
*/
|
|
267
|
-
timeout?: number;
|
|
268
|
-
/**
|
|
269
|
-
* Temperature for model sampling.
|
|
270
|
-
*/
|
|
271
|
-
temperature?: number;
|
|
272
|
-
/**
|
|
273
|
-
* Number of retries when AI call fails.
|
|
274
|
-
* Default is 1 (retry once after failure).
|
|
275
|
-
*/
|
|
276
|
-
retryCount?: number;
|
|
277
|
-
/**
|
|
278
|
-
* Interval between retries in milliseconds.
|
|
279
|
-
* Default is 2000.
|
|
280
|
-
*/
|
|
281
|
-
retryInterval?: number;
|
|
282
|
-
/**
|
|
283
|
-
* Reasoning effort level for the model.
|
|
284
|
-
* Passed through to model-family-specific parameters (e.g., reasoning_effort for doubao, reasoning.effort for gpt-5).
|
|
285
|
-
*/
|
|
286
|
-
reasoningEffort?: string;
|
|
287
|
-
/**
|
|
288
|
-
* Enable/disable reasoning for the model.
|
|
289
|
-
* Passed through to model-family-specific parameters (e.g., enable_thinking for qwen, thinking.type for doubao/glm-v).
|
|
290
|
-
*/
|
|
291
|
-
reasoningEnabled?: boolean;
|
|
292
|
-
/**
|
|
293
|
-
* Reasoning token budget for the model.
|
|
294
|
-
* Passed through to model-family-specific parameters (e.g., thinking_budget for qwen).
|
|
295
|
-
*/
|
|
296
|
-
reasoningBudget?: number;
|
|
297
|
-
/**
|
|
298
|
-
* Model family - unified model configuration
|
|
299
|
-
* Maps directly to model families like 'qwen2.5-vl', 'qwen3-vl', 'doubao-vision', 'doubao-seed', etc.
|
|
300
|
-
*/
|
|
301
|
-
modelFamily?: TModelFamily;
|
|
302
|
-
uiTarsModelVersion?: UITarsModelVersion;
|
|
303
|
-
modelDescription: string;
|
|
304
|
-
/**
|
|
305
|
-
* original intent from the config
|
|
306
|
-
*/
|
|
307
|
-
intent: TIntent;
|
|
308
|
-
/**
|
|
309
|
-
* Custom OpenAI client factory function
|
|
310
|
-
*
|
|
311
|
-
* If provided, this function will be called to create OpenAI client instances
|
|
312
|
-
* for each AI call, allowing you to:
|
|
313
|
-
* - Wrap clients with observability tools (langsmith, langfuse)
|
|
314
|
-
* - Use custom OpenAI-compatible clients
|
|
315
|
-
* - Apply different configurations based on intent
|
|
316
|
-
*/
|
|
317
|
-
createOpenAIClient?: CreateOpenAIClientFn;
|
|
318
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { GlobalConfigManager } from './global-config-manager';
|
|
2
|
-
import { ModelConfigManager } from './model-config-manager';
|
|
3
|
-
import { type GLOBAL_ENV_KEYS, type MODEL_ENV_KEYS } from './types';
|
|
4
|
-
export declare const globalModelConfigManager: ModelConfigManager;
|
|
5
|
-
export declare const globalConfigManager: GlobalConfigManager;
|
|
6
|
-
/**
|
|
7
|
-
* Interface for devices that support getTimestamp method.
|
|
8
|
-
* This is a minimal interface to avoid circular dependencies with @midscene/core.
|
|
9
|
-
*/
|
|
10
|
-
export interface DeviceWithTimestamp {
|
|
11
|
-
getTimestamp?: () => Promise<number>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get the current timestamp, optionally from the target device.
|
|
15
|
-
*
|
|
16
|
-
* When useDeviceTimestamp is enabled and a device with getTimestamp is provided,
|
|
17
|
-
* this function will return the device's time. Otherwise, it returns the system time.
|
|
18
|
-
*
|
|
19
|
-
* This is useful when:
|
|
20
|
-
* - Testing on devices with different time zones
|
|
21
|
-
* - Debugging time-sensitive features
|
|
22
|
-
* - The system clock and device clock are not synchronized
|
|
23
|
-
*
|
|
24
|
-
* @param device Optional device interface that supports getTimestamp
|
|
25
|
-
* @param useDeviceTimestamp Whether to use device timestamp (from agent config)
|
|
26
|
-
* @returns Timestamp in milliseconds
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // Without device - always returns system time
|
|
30
|
-
* const systemTime = await getCurrentTime();
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* // With device and config enabled - returns device time
|
|
34
|
-
* const deviceTime = await getCurrentTime(androidDevice, true);
|
|
35
|
-
*/
|
|
36
|
-
export declare function getCurrentTime(device?: DeviceWithTimestamp, useDeviceTimestamp?: boolean): Promise<number>;
|
|
37
|
-
export declare const getPreferredLanguage: () => string;
|
|
38
|
-
export declare const overrideAIConfig: (newConfig: Partial<Record<(typeof GLOBAL_ENV_KEYS)[number] | (typeof MODEL_ENV_KEYS)[number], string>>, extendMode?: boolean) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NodeType, TEXT_MAX_SIZE, TEXT_SIZE_THRESHOLD, } from '../constants/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { LocateResultElement } from '../types';
|
|
2
|
-
export declare function isFormElement(node: globalThis.Node): boolean;
|
|
3
|
-
export declare function isButtonElement(node: globalThis.Node): node is globalThis.HTMLButtonElement;
|
|
4
|
-
export declare function isAElement(node: globalThis.Node): node is globalThis.HTMLButtonElement;
|
|
5
|
-
export declare function isSvgElement(node: globalThis.Node): node is globalThis.SVGSVGElement;
|
|
6
|
-
export declare function isImgElement(node: globalThis.Node): node is globalThis.HTMLImageElement;
|
|
7
|
-
export declare function isNotContainerElement(node: globalThis.Node): boolean;
|
|
8
|
-
export declare function isTextElement(node: globalThis.Node): node is globalThis.HTMLTextAreaElement;
|
|
9
|
-
export declare function isContainerElement(node: globalThis.Node): node is globalThis.HTMLElement;
|
|
10
|
-
/**
|
|
11
|
-
* Generate a LocateResultElement from a point.
|
|
12
|
-
* This function creates an expanded rect around the given center point.
|
|
13
|
-
*
|
|
14
|
-
* Note: Center coordinates should be integers for pixel-aligned positioning.
|
|
15
|
-
* If decimal values are provided, they will be used as-is, which may result in
|
|
16
|
-
* non-pixel-aligned rect positions.
|
|
17
|
-
*
|
|
18
|
-
* The rect positioning behavior:
|
|
19
|
-
* - When edgeSize is even: center is at the top-left of the four center pixels
|
|
20
|
-
* For example, with edgeSize=4 and center=[10, 10]:
|
|
21
|
-
* □□□□
|
|
22
|
-
* □■□□ (■ represents the center point at pixel 10)
|
|
23
|
-
* □□□□
|
|
24
|
-
* □□□□
|
|
25
|
-
*
|
|
26
|
-
* - When edgeSize is odd: center is at the exact middle pixel
|
|
27
|
-
* For example, with edgeSize=5 and center=[10, 10]:
|
|
28
|
-
* □□□□□
|
|
29
|
-
* □□■□□ (■ represents the center point at pixel 10)
|
|
30
|
-
* □□□□□
|
|
31
|
-
*
|
|
32
|
-
* @param center - Center point coordinates as [x, y] (should be integers)
|
|
33
|
-
* @param description - Description of the element
|
|
34
|
-
* @param edgeSize - Size to expand around the center point (default: 8)
|
|
35
|
-
* @returns A LocateResultElement with rect, center, and description
|
|
36
|
-
*/
|
|
37
|
-
export declare function generateElementByPoint(center: [number, number], description: string, edgeSize?: number): LocateResultElement;
|
|
38
|
-
/**
|
|
39
|
-
* Generate a LocateResultElement from a rect.
|
|
40
|
-
* This function calculates the center point from the rect and expands the rect by edgeSize.
|
|
41
|
-
*
|
|
42
|
-
* Note: The rect uses inclusive coordinates where:
|
|
43
|
-
* - A rect from [left=10, top=10] with [width=1, height=1] covers exactly 1 pixel
|
|
44
|
-
* - The actual pixel range is [left, left+width) which means width pixels
|
|
45
|
-
*
|
|
46
|
-
* @param sourceRect - The source rect to generate element from (typically contains integer values)
|
|
47
|
-
* @param description - Description of the element
|
|
48
|
-
* @param edgeSize - Size to expand around the center point (default: 8)
|
|
49
|
-
* @returns A LocateResultElement with rect, center (always integers), and description
|
|
50
|
-
*/
|
|
51
|
-
export declare function generateElementByRect(sourceRect: {
|
|
52
|
-
left: number;
|
|
53
|
-
top: number;
|
|
54
|
-
width: number;
|
|
55
|
-
height: number;
|
|
56
|
-
}, description: string, edgeSize?: number): LocateResultElement;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '../constants/index';
|
|
2
|
-
export interface ElementInfo {
|
|
3
|
-
id: string;
|
|
4
|
-
indexId: number;
|
|
5
|
-
nodeHashId: string;
|
|
6
|
-
xpaths?: string[];
|
|
7
|
-
attributes: {
|
|
8
|
-
nodeType: NodeType;
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
};
|
|
11
|
-
nodeType: NodeType;
|
|
12
|
-
content: string;
|
|
13
|
-
rect: {
|
|
14
|
-
left: number;
|
|
15
|
-
top: number;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
};
|
|
19
|
-
center: [number, number];
|
|
20
|
-
isVisible: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ElementNode {
|
|
23
|
-
node: ElementInfo | null;
|
|
24
|
-
children: ElementNode[];
|
|
25
|
-
}
|
|
26
|
-
export { descriptionOfTree, traverseTree, treeToList, truncateText, trimAttributes, } from './tree';
|
|
27
|
-
export { extractTextWithPosition as webExtractTextWithPosition } from './web-extractor';
|
|
28
|
-
export { extractTreeNode as webExtractNodeTree } from './web-extractor';
|
|
29
|
-
export { extractTreeNodeAsString as webExtractNodeTreeAsString } from './web-extractor';
|
|
30
|
-
export { getXpathsByPoint, getXpathsById, getNodeInfoByXpath, getElementInfoByXpath, getElementXpath, } from './locator';
|
|
31
|
-
export { generateElementByRect } from './dom-util';
|
|
32
|
-
export { isNotContainerElement } from './dom-util';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ElementInfo } from '.';
|
|
2
|
-
import type { Point } from '../types';
|
|
3
|
-
export declare const getElementXpath: (element: Node, isOrderSensitive?: boolean, isLeafElement?: boolean, limitToCurrentDocument?: boolean) => string;
|
|
4
|
-
/** Retrieve XPath for a previously cached node by its hash ID.
|
|
5
|
-
* Returns a local xpath within the node's own document (limitToCurrentDocument=true). */
|
|
6
|
-
export declare function getXpathsById(id: string): string[] | null;
|
|
7
|
-
export declare function getXpathsByPoint(point: Point, isOrderSensitive: boolean): string[] | null;
|
|
8
|
-
export declare function getNodeInfoByXpath(xpath: string): Node | null;
|
|
9
|
-
export declare function getElementInfoByXpath(xpath: string): ElementInfo | null;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BaseElement, ElementTreeNode } from '../types';
|
|
2
|
-
export declare function truncateText(text: string | number | object | undefined, maxLength?: number): string;
|
|
3
|
-
export declare function trimAttributes(attributes: Record<string, any>, truncateTextLength?: number): Record<string, string>;
|
|
4
|
-
export declare function descriptionOfTree<ElementType extends BaseElement = BaseElement>(tree: ElementTreeNode<ElementType>, truncateTextLength?: number, filterNonTextContent?: boolean, visibleOnly?: boolean): string;
|
|
5
|
-
export declare function treeToList<T extends BaseElement>(tree: ElementTreeNode<T>): T[];
|
|
6
|
-
export declare function traverseTree<T extends BaseElement, ReturnNodeType extends BaseElement>(tree: ElementTreeNode<T>, onNode: (node: T) => ReturnNodeType): ElementTreeNode<ReturnNodeType>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Rect } from '../types';
|
|
2
|
-
export declare function setDebugMode(mode: boolean): void;
|
|
3
|
-
export declare function getDebugMode(): boolean;
|
|
4
|
-
export declare function logger(..._msg: any[]): void;
|
|
5
|
-
export declare function isElementPartiallyInViewport(rect: ReturnType<typeof getRect>, currentWindow: typeof window, currentDocument: typeof document, visibleAreaRatio?: number): boolean;
|
|
6
|
-
export declare function getPseudoElementContent(element: globalThis.Node, currentWindow: typeof globalThis.window): {
|
|
7
|
-
before: string;
|
|
8
|
-
after: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function hasOverflowY(element: globalThis.HTMLElement, currentWindow: typeof globalThis.window): boolean;
|
|
11
|
-
export interface ExtractedRect {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
left: number;
|
|
15
|
-
top: number;
|
|
16
|
-
right: number;
|
|
17
|
-
bottom: number;
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
zoom: number;
|
|
21
|
-
}
|
|
22
|
-
export declare function overlappedRect(rect1: ExtractedRect, rect2: ExtractedRect): ExtractedRect | null;
|
|
23
|
-
export declare function getRect(el: globalThis.HTMLElement | globalThis.Node, baseZoom: number, // base zoom
|
|
24
|
-
currentWindow: typeof globalThis.window): ExtractedRect;
|
|
25
|
-
export declare function elementRect(el: globalThis.HTMLElement | globalThis.Node | null, currentWindow: typeof globalThis.window, currentDocument: typeof globalThis.document, baseZoom?: number): {
|
|
26
|
-
left: number;
|
|
27
|
-
top: number;
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
zoom: number;
|
|
31
|
-
isVisible: boolean;
|
|
32
|
-
} | false;
|
|
33
|
-
export declare function validTextNodeContent(node: globalThis.Node): string | false;
|
|
34
|
-
export declare function getNodeAttributes(node: globalThis.HTMLElement | globalThis.Node, currentWindow: typeof globalThis.window): Record<string, string>;
|
|
35
|
-
/**
|
|
36
|
-
* Reset the node hash cache. Call at the beginning of each extraction cycle
|
|
37
|
-
* to prevent stale DOM references from accumulating.
|
|
38
|
-
*/
|
|
39
|
-
export declare function setNodeHashCacheListOnWindow(): void;
|
|
40
|
-
export declare function setNodeToCacheList(node: globalThis.Node, id: string): void;
|
|
41
|
-
export declare function getNodeFromCacheList(id: string): globalThis.Node | undefined;
|
|
42
|
-
export declare function midsceneGenerateHash(node: globalThis.Node | null, content: string, rect: Rect): string;
|
|
43
|
-
export declare function generateId(numberId: number): string;
|
|
44
|
-
export declare function setGenerateHashOnWindow(): void;
|
|
45
|
-
export declare function setMidsceneVisibleRectOnWindow(): void;
|
|
46
|
-
export declare function setExtractTextWithPositionOnWindow(): void;
|
|
47
|
-
export declare function getTopDocument(): globalThis.HTMLElement;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { WebElementInfo } from '../types';
|
|
2
|
-
import type { Point } from '../types';
|
|
3
|
-
export declare function collectElementInfo(node: Node, currentWindow: typeof window, currentDocument: typeof document, baseZoom?: number, basePoint?: Point, isContainer?: boolean): WebElementInfo | null | any;
|
|
4
|
-
interface WebElementNode {
|
|
5
|
-
node: WebElementInfo | null;
|
|
6
|
-
children: WebElementNode[];
|
|
7
|
-
}
|
|
8
|
-
export declare function extractTextWithPosition(initNode: globalThis.Node, debugMode?: boolean): WebElementInfo[];
|
|
9
|
-
export declare function extractTreeNodeAsString(initNode: globalThis.Node, visibleOnly?: boolean, debugMode?: boolean): string;
|
|
10
|
-
export declare function extractTreeNode(initNode: globalThis.Node, debugMode?: boolean): WebElementNode;
|
|
11
|
-
export declare function mergeElementAndChildrenRects(node: Node, currentWindow: typeof window, currentDocument: typeof document, baseZoom?: number): {
|
|
12
|
-
left: number;
|
|
13
|
-
top: number;
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
zoom: number;
|
|
17
|
-
isVisible: boolean;
|
|
18
|
-
} | null;
|
|
19
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { BaseElement, Rect } from '../types';
|
|
2
|
-
interface ElementForOverlay {
|
|
3
|
-
rect: Rect;
|
|
4
|
-
indexId?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const compositeElementInfoImg: (options: {
|
|
7
|
-
inputImgBase64: string;
|
|
8
|
-
elementsPositionInfo: Array<ElementForOverlay>;
|
|
9
|
-
size?: {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
};
|
|
13
|
-
annotationPadding?: number;
|
|
14
|
-
borderThickness?: number;
|
|
15
|
-
prompt?: string;
|
|
16
|
-
}) => Promise<string>;
|
|
17
|
-
export declare const processImageElementInfo: (options: {
|
|
18
|
-
inputImgBase64: string;
|
|
19
|
-
elementsPositionInfo: Array<BaseElement>;
|
|
20
|
-
elementsPositionInfoWithoutText: Array<BaseElement>;
|
|
21
|
-
}) => Promise<{
|
|
22
|
-
compositeElementInfoImgBase64: string;
|
|
23
|
-
compositeElementInfoImgWithoutTextBase64: string;
|
|
24
|
-
}>;
|
|
25
|
-
export declare function annotateRects(imgBase64: string, rects: Rect[], prompt?: string): Promise<string>;
|
|
26
|
-
export {};
|