@xiuchang-midscene/shared 2.0.2
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 +9 -0
- package/dist/es/baseDB.mjs +109 -0
- package/dist/es/baseDB.mjs.bak +109 -0
- package/dist/es/build/copy-static.mjs +31 -0
- package/dist/es/build/copy-static.mjs.bak +31 -0
- package/dist/es/build/rspack-config.mjs +4 -0
- package/dist/es/build/rspack-config.mjs.bak +4 -0
- package/dist/es/cli/cli-runner.mjs +140 -0
- package/dist/es/cli/cli-runner.mjs.bak +140 -0
- package/dist/es/cli/index.mjs +2 -0
- package/dist/es/cli/index.mjs.bak +2 -0
- package/dist/es/common.mjs +37 -0
- package/dist/es/common.mjs.bak +37 -0
- package/dist/es/constants/example-code.mjs +223 -0
- package/dist/es/constants/example-code.mjs.bak +223 -0
- package/dist/es/constants/index.mjs +23 -0
- package/dist/es/constants/index.mjs.bak +23 -0
- package/dist/es/env/basic.mjs +6 -0
- package/dist/es/env/basic.mjs.bak +6 -0
- package/dist/es/env/constants.mjs +70 -0
- package/dist/es/env/constants.mjs.bak +70 -0
- package/dist/es/env/global-config-manager.mjs +94 -0
- package/dist/es/env/global-config-manager.mjs.bak +94 -0
- package/dist/es/env/helper.mjs +43 -0
- package/dist/es/env/helper.mjs.bak +43 -0
- package/dist/es/env/index.mjs +5 -0
- package/dist/es/env/index.mjs.bak +5 -0
- package/dist/es/env/init-debug.mjs +18 -0
- package/dist/es/env/init-debug.mjs.bak +18 -0
- package/dist/es/env/model-config-manager.mjs +79 -0
- package/dist/es/env/model-config-manager.mjs.bak +79 -0
- package/dist/es/env/parse-model-config.mjs +132 -0
- package/dist/es/env/parse-model-config.mjs.bak +132 -0
- package/dist/es/env/types.mjs +220 -0
- package/dist/es/env/types.mjs.bak +220 -0
- package/dist/es/env/utils.mjs +26 -0
- package/dist/es/env/utils.mjs.bak +26 -0
- package/dist/es/extractor/constants.mjs +2 -0
- package/dist/es/extractor/constants.mjs.bak +2 -0
- package/dist/es/extractor/debug.mjs +6 -0
- package/dist/es/extractor/debug.mjs.bak +6 -0
- package/dist/es/extractor/dom-util.mjs +92 -0
- package/dist/es/extractor/dom-util.mjs.bak +92 -0
- package/dist/es/extractor/index.mjs +5 -0
- package/dist/es/extractor/index.mjs.bak +5 -0
- package/dist/es/extractor/locator.mjs +250 -0
- package/dist/es/extractor/locator.mjs.bak +250 -0
- package/dist/es/extractor/tree.mjs +78 -0
- package/dist/es/extractor/tree.mjs.bak +78 -0
- package/dist/es/extractor/util.mjs +245 -0
- package/dist/es/extractor/util.mjs.bak +245 -0
- package/dist/es/extractor/web-extractor.mjs +303 -0
- package/dist/es/extractor/web-extractor.mjs.bak +303 -0
- package/dist/es/img/box-select.mjs +824 -0
- package/dist/es/img/box-select.mjs.bak +824 -0
- package/dist/es/img/canvas-fallback.mjs +238 -0
- package/dist/es/img/canvas-fallback.mjs.bak +238 -0
- package/dist/es/img/get-photon.mjs +45 -0
- package/dist/es/img/get-photon.mjs.bak +45 -0
- package/dist/es/img/get-sharp.mjs +11 -0
- package/dist/es/img/get-sharp.mjs.bak +11 -0
- package/dist/es/img/index.mjs +4 -0
- package/dist/es/img/index.mjs.bak +4 -0
- package/dist/es/img/info.mjs +29 -0
- package/dist/es/img/info.mjs.bak +29 -0
- package/dist/es/img/transform.mjs +295 -0
- package/dist/es/img/transform.mjs.bak +295 -0
- package/dist/es/index.mjs +4 -0
- package/dist/es/index.mjs.bak +4 -0
- package/dist/es/logger.mjs +64 -0
- package/dist/es/logger.mjs.bak +64 -0
- package/dist/es/mcp/base-server.mjs +281 -0
- package/dist/es/mcp/base-server.mjs.bak +281 -0
- package/dist/es/mcp/base-tools.mjs +91 -0
- package/dist/es/mcp/base-tools.mjs.bak +91 -0
- package/dist/es/mcp/chrome-path.mjs +35 -0
- package/dist/es/mcp/chrome-path.mjs.bak +35 -0
- package/dist/es/mcp/index.mjs +7 -0
- package/dist/es/mcp/index.mjs.bak +7 -0
- package/dist/es/mcp/inject-report-html-plugin.mjs +53 -0
- package/dist/es/mcp/inject-report-html-plugin.mjs.bak +53 -0
- package/dist/es/mcp/launcher-helper.mjs +52 -0
- package/dist/es/mcp/launcher-helper.mjs.bak +52 -0
- package/dist/es/mcp/tool-generator.mjs +297 -0
- package/dist/es/mcp/tool-generator.mjs.bak +297 -0
- package/dist/es/mcp/types.mjs +3 -0
- package/dist/es/mcp/types.mjs.bak +3 -0
- package/dist/es/node/fs.mjs +44 -0
- package/dist/es/node/fs.mjs.bak +44 -0
- package/dist/es/node/index.mjs +2 -0
- package/dist/es/node/index.mjs.bak +2 -0
- package/dist/es/node/port.mjs +24 -0
- package/dist/es/node/port.mjs.bak +24 -0
- package/dist/es/oss/demo.mjs +30 -0
- package/dist/es/oss/demo.mjs.bak +30 -0
- package/dist/es/oss/index.mjs +90 -0
- package/dist/es/oss/index.mjs.bak +90 -0
- package/dist/es/polyfills/async-hooks.mjs +2 -0
- package/dist/es/polyfills/async-hooks.mjs.bak +2 -0
- package/dist/es/polyfills/index.mjs +1 -0
- package/dist/es/polyfills/index.mjs.bak +1 -0
- package/dist/es/types/index.mjs +3 -0
- package/dist/es/types/index.mjs.bak +3 -0
- package/dist/es/us-keyboard-layout.mjs +1414 -0
- package/dist/es/us-keyboard-layout.mjs.LICENSE.txt +5 -0
- package/dist/es/us-keyboard-layout.mjs.bak +1414 -0
- package/dist/es/utils.mjs +72 -0
- package/dist/es/utils.mjs.bak +72 -0
- package/dist/es/zod-schema-utils.mjs +54 -0
- package/dist/es/zod-schema-utils.mjs.bak +54 -0
- package/dist/lib/baseDB.js +149 -0
- package/dist/lib/baseDB.js.bak +149 -0
- package/dist/lib/build/copy-static.js +79 -0
- package/dist/lib/build/copy-static.js.bak +79 -0
- package/dist/lib/build/rspack-config.js +38 -0
- package/dist/lib/build/rspack-config.js.bak +38 -0
- package/dist/lib/cli/cli-runner.js +196 -0
- package/dist/lib/cli/cli-runner.js.bak +196 -0
- package/dist/lib/cli/index.js +48 -0
- package/dist/lib/cli/index.js.bak +48 -0
- package/dist/lib/common.js +93 -0
- package/dist/lib/common.js.bak +93 -0
- package/dist/lib/constants/example-code.js +260 -0
- package/dist/lib/constants/example-code.js.bak +260 -0
- package/dist/lib/constants/index.js +96 -0
- package/dist/lib/constants/index.js.bak +96 -0
- package/dist/lib/env/basic.js +40 -0
- package/dist/lib/env/basic.js.bak +40 -0
- package/dist/lib/env/constants.js +113 -0
- package/dist/lib/env/constants.js.bak +113 -0
- package/dist/lib/env/global-config-manager.js +128 -0
- package/dist/lib/env/global-config-manager.js.bak +128 -0
- package/dist/lib/env/helper.js +80 -0
- package/dist/lib/env/helper.js.bak +80 -0
- package/dist/lib/env/index.js +90 -0
- package/dist/lib/env/index.js.bak +90 -0
- package/dist/lib/env/init-debug.js +52 -0
- package/dist/lib/env/init-debug.js.bak +52 -0
- package/dist/lib/env/model-config-manager.js +113 -0
- package/dist/lib/env/model-config-manager.js.bak +113 -0
- package/dist/lib/env/parse-model-config.js +178 -0
- package/dist/lib/env/parse-model-config.js.bak +178 -0
- package/dist/lib/env/types.js +554 -0
- package/dist/lib/env/types.js.bak +554 -0
- package/dist/lib/env/utils.js +72 -0
- package/dist/lib/env/utils.js.bak +72 -0
- package/dist/lib/extractor/constants.js +42 -0
- package/dist/lib/extractor/constants.js.bak +42 -0
- package/dist/lib/extractor/debug.js +12 -0
- package/dist/lib/extractor/debug.js.bak +12 -0
- package/dist/lib/extractor/dom-util.js +153 -0
- package/dist/lib/extractor/dom-util.js.bak +153 -0
- package/dist/lib/extractor/index.js +81 -0
- package/dist/lib/extractor/index.js.bak +81 -0
- package/dist/lib/extractor/locator.js +296 -0
- package/dist/lib/extractor/locator.js.bak +296 -0
- package/dist/lib/extractor/tree.js +124 -0
- package/dist/lib/extractor/tree.js.bak +124 -0
- package/dist/lib/extractor/util.js +336 -0
- package/dist/lib/extractor/util.js.bak +336 -0
- package/dist/lib/extractor/web-extractor.js +349 -0
- package/dist/lib/extractor/web-extractor.js.bak +349 -0
- package/dist/lib/img/box-select.js +875 -0
- package/dist/lib/img/box-select.js.bak +875 -0
- package/dist/lib/img/canvas-fallback.js +305 -0
- package/dist/lib/img/canvas-fallback.js.bak +305 -0
- package/dist/lib/img/get-photon.js +82 -0
- package/dist/lib/img/get-photon.js.bak +82 -0
- package/dist/lib/img/get-sharp.js +45 -0
- package/dist/lib/img/get-sharp.js.bak +45 -0
- package/dist/lib/img/index.js +95 -0
- package/dist/lib/img/index.js.bak +95 -0
- package/dist/lib/img/info.js +83 -0
- package/dist/lib/img/info.js.bak +83 -0
- package/dist/lib/img/transform.js +387 -0
- package/dist/lib/img/transform.js.bak +387 -0
- package/dist/lib/index.js +47 -0
- package/dist/lib/index.js.bak +47 -0
- package/dist/lib/logger.js +114 -0
- package/dist/lib/logger.js.bak +114 -0
- package/dist/lib/mcp/base-server.js +331 -0
- package/dist/lib/mcp/base-server.js.bak +331 -0
- package/dist/lib/mcp/base-tools.js +125 -0
- package/dist/lib/mcp/base-tools.js.bak +125 -0
- package/dist/lib/mcp/chrome-path.js +72 -0
- package/dist/lib/mcp/chrome-path.js.bak +72 -0
- package/dist/lib/mcp/index.js +100 -0
- package/dist/lib/mcp/index.js.bak +100 -0
- package/dist/lib/mcp/inject-report-html-plugin.js +98 -0
- package/dist/lib/mcp/inject-report-html-plugin.js.bak +98 -0
- package/dist/lib/mcp/launcher-helper.js +86 -0
- package/dist/lib/mcp/launcher-helper.js.bak +86 -0
- package/dist/lib/mcp/tool-generator.js +334 -0
- package/dist/lib/mcp/tool-generator.js.bak +334 -0
- package/dist/lib/mcp/types.js +40 -0
- package/dist/lib/mcp/types.js.bak +40 -0
- package/dist/lib/node/fs.js +97 -0
- package/dist/lib/node/fs.js.bak +97 -0
- package/dist/lib/node/index.js +65 -0
- package/dist/lib/node/index.js.bak +65 -0
- package/dist/lib/node/port.js +61 -0
- package/dist/lib/node/port.js.bak +61 -0
- package/dist/lib/oss/demo.js +36 -0
- package/dist/lib/oss/demo.js.bak +36 -0
- package/dist/lib/oss/index.js +138 -0
- package/dist/lib/oss/index.js.bak +138 -0
- package/dist/lib/polyfills/async-hooks.js +36 -0
- package/dist/lib/polyfills/async-hooks.js.bak +36 -0
- package/dist/lib/polyfills/index.js +58 -0
- package/dist/lib/polyfills/index.js.bak +58 -0
- package/dist/lib/types/index.js +37 -0
- package/dist/lib/types/index.js.bak +37 -0
- package/dist/lib/us-keyboard-layout.js +1457 -0
- package/dist/lib/us-keyboard-layout.js.LICENSE.txt +5 -0
- package/dist/lib/us-keyboard-layout.js.bak +1457 -0
- package/dist/lib/utils.js +148 -0
- package/dist/lib/utils.js.bak +148 -0
- package/dist/lib/zod-schema-utils.js +97 -0
- package/dist/lib/zod-schema-utils.js.bak +97 -0
- package/dist/types/baseDB.d.ts +25 -0
- package/dist/types/baseDB.d.ts.bak +25 -0
- package/dist/types/build/copy-static.d.ts +31 -0
- package/dist/types/build/copy-static.d.ts.bak +31 -0
- package/dist/types/build/rspack-config.d.ts +8 -0
- package/dist/types/build/rspack-config.d.ts.bak +8 -0
- package/dist/types/cli/cli-runner.d.ts +14 -0
- package/dist/types/cli/cli-runner.d.ts.bak +14 -0
- package/dist/types/cli/index.d.ts +2 -0
- package/dist/types/cli/index.d.ts.bak +2 -0
- package/dist/types/common.d.ts +12 -0
- package/dist/types/common.d.ts.bak +12 -0
- package/dist/types/constants/example-code.d.ts +2 -0
- package/dist/types/constants/example-code.d.ts.bak +2 -0
- package/dist/types/constants/index.d.ts +21 -0
- package/dist/types/constants/index.d.ts.bak +21 -0
- package/dist/types/env/basic.d.ts +6 -0
- package/dist/types/env/basic.d.ts.bak +6 -0
- package/dist/types/env/constants.d.ts +40 -0
- package/dist/types/env/constants.d.ts.bak +40 -0
- package/dist/types/env/global-config-manager.d.ts +32 -0
- package/dist/types/env/global-config-manager.d.ts.bak +32 -0
- package/dist/types/env/helper.d.ts +4 -0
- package/dist/types/env/helper.d.ts.bak +4 -0
- package/dist/types/env/index.d.ts +4 -0
- package/dist/types/env/index.d.ts.bak +4 -0
- package/dist/types/env/init-debug.d.ts +1 -0
- package/dist/types/env/init-debug.d.ts.bak +1 -0
- package/dist/types/env/model-config-manager.d.ts +25 -0
- package/dist/types/env/model-config-manager.d.ts.bak +25 -0
- package/dist/types/env/parse-model-config.d.ts +31 -0
- package/dist/types/env/parse-model-config.d.ts.bak +31 -0
- package/dist/types/env/types.d.ts +318 -0
- package/dist/types/env/types.d.ts.bak +318 -0
- package/dist/types/env/utils.d.ts +38 -0
- package/dist/types/env/utils.d.ts.bak +38 -0
- package/dist/types/extractor/constants.d.ts +1 -0
- package/dist/types/extractor/constants.d.ts.bak +1 -0
- package/dist/types/extractor/debug.d.ts +1 -0
- package/dist/types/extractor/debug.d.ts.bak +1 -0
- package/dist/types/extractor/dom-util.d.ts +56 -0
- package/dist/types/extractor/dom-util.d.ts.bak +56 -0
- package/dist/types/extractor/index.d.ts +32 -0
- package/dist/types/extractor/index.d.ts.bak +32 -0
- package/dist/types/extractor/locator.d.ts +9 -0
- package/dist/types/extractor/locator.d.ts.bak +9 -0
- package/dist/types/extractor/tree.d.ts +6 -0
- package/dist/types/extractor/tree.d.ts.bak +6 -0
- package/dist/types/extractor/util.d.ts +47 -0
- package/dist/types/extractor/util.d.ts.bak +47 -0
- package/dist/types/extractor/web-extractor.d.ts +19 -0
- package/dist/types/extractor/web-extractor.d.ts.bak +19 -0
- package/dist/types/img/box-select.d.ts +26 -0
- package/dist/types/img/box-select.d.ts.bak +26 -0
- package/dist/types/img/canvas-fallback.d.ts +105 -0
- package/dist/types/img/canvas-fallback.d.ts.bak +105 -0
- package/dist/types/img/get-photon.d.ts +19 -0
- package/dist/types/img/get-photon.d.ts.bak +19 -0
- package/dist/types/img/get-sharp.d.ts +3 -0
- package/dist/types/img/get-sharp.d.ts.bak +3 -0
- package/dist/types/img/index.d.ts +3 -0
- package/dist/types/img/index.d.ts.bak +3 -0
- package/dist/types/img/info.d.ts +29 -0
- package/dist/types/img/info.d.ts.bak +29 -0
- package/dist/types/img/transform.d.ts +107 -0
- package/dist/types/img/transform.d.ts.bak +107 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.bak +4 -0
- package/dist/types/logger.d.ts +5 -0
- package/dist/types/logger.d.ts.bak +5 -0
- package/dist/types/mcp/base-server.d.ts +93 -0
- package/dist/types/mcp/base-server.d.ts.bak +93 -0
- package/dist/types/mcp/base-tools.d.ts +79 -0
- package/dist/types/mcp/base-tools.d.ts.bak +79 -0
- package/dist/types/mcp/chrome-path.d.ts +2 -0
- package/dist/types/mcp/chrome-path.d.ts.bak +2 -0
- package/dist/types/mcp/index.d.ts +7 -0
- package/dist/types/mcp/index.d.ts.bak +7 -0
- package/dist/types/mcp/inject-report-html-plugin.d.ts +18 -0
- package/dist/types/mcp/inject-report-html-plugin.d.ts.bak +18 -0
- package/dist/types/mcp/launcher-helper.d.ts +94 -0
- package/dist/types/mcp/launcher-helper.d.ts.bak +94 -0
- package/dist/types/mcp/tool-generator.d.ts +10 -0
- package/dist/types/mcp/tool-generator.d.ts.bak +10 -0
- package/dist/types/mcp/types.d.ts +103 -0
- package/dist/types/mcp/types.d.ts.bak +103 -0
- package/dist/types/node/fs.d.ts +15 -0
- package/dist/types/node/fs.d.ts.bak +15 -0
- package/dist/types/node/index.d.ts +2 -0
- package/dist/types/node/index.d.ts.bak +2 -0
- package/dist/types/node/port.d.ts +8 -0
- package/dist/types/node/port.d.ts.bak +8 -0
- package/dist/types/oss/demo.d.ts +1 -0
- package/dist/types/oss/demo.d.ts.bak +1 -0
- package/dist/types/oss/index.d.ts +34 -0
- package/dist/types/oss/index.d.ts.bak +34 -0
- package/dist/types/polyfills/async-hooks.d.ts +6 -0
- package/dist/types/polyfills/async-hooks.d.ts.bak +6 -0
- package/dist/types/polyfills/index.d.ts +4 -0
- package/dist/types/polyfills/index.d.ts.bak +4 -0
- package/dist/types/types/index.d.ts +34 -0
- package/dist/types/types/index.d.ts.bak +34 -0
- package/dist/types/us-keyboard-layout.d.ts +32 -0
- package/dist/types/us-keyboard-layout.d.ts.bak +32 -0
- package/dist/types/utils.d.ts +34 -0
- package/dist/types/utils.d.ts.bak +34 -0
- package/dist/types/zod-schema-utils.d.ts +23 -0
- package/dist/types/zod-schema-utils.d.ts.bak +23 -0
- package/package.json +132 -0
- package/src/baseDB.ts +158 -0
- package/src/build/copy-static.ts +68 -0
- package/src/build/rspack-config.ts +12 -0
- package/src/cli/cli-runner.ts +224 -0
- package/src/cli/index.ts +8 -0
- package/src/common.ts +67 -0
- package/src/constants/example-code.ts +223 -0
- package/src/constants/index.ts +29 -0
- package/src/env/basic.ts +12 -0
- package/src/env/constants.ts +234 -0
- package/src/env/global-config-manager.ts +191 -0
- package/src/env/helper.ts +58 -0
- package/src/env/index.ts +4 -0
- package/src/env/init-debug.ts +34 -0
- package/src/env/model-config-manager.ts +149 -0
- package/src/env/parse-model-config.ts +294 -0
- package/src/env/types.ts +547 -0
- package/src/env/utils.ts +89 -0
- package/src/extractor/constants.ts +5 -0
- package/src/extractor/debug.ts +10 -0
- package/src/extractor/dom-util.ts +226 -0
- package/src/extractor/index.ts +48 -0
- package/src/extractor/locator.ts +469 -0
- package/src/extractor/tree.ts +179 -0
- package/src/extractor/util.ts +482 -0
- package/src/extractor/web-extractor.ts +481 -0
- package/src/img/box-select.ts +588 -0
- package/src/img/canvas-fallback.ts +393 -0
- package/src/img/get-photon.ts +108 -0
- package/src/img/get-sharp.ts +18 -0
- package/src/img/index.ts +26 -0
- package/src/img/info.ts +75 -0
- package/src/img/transform.ts +594 -0
- package/src/index.ts +8 -0
- package/src/logger.ts +96 -0
- package/src/mcp/base-server.ts +502 -0
- package/src/mcp/base-tools.ts +185 -0
- package/src/mcp/chrome-path.ts +48 -0
- package/src/mcp/index.ts +7 -0
- package/src/mcp/inject-report-html-plugin.ts +119 -0
- package/src/mcp/launcher-helper.ts +200 -0
- package/src/mcp/tool-generator.ts +429 -0
- package/src/mcp/types.ts +112 -0
- package/src/node/fs.ts +84 -0
- package/src/node/index.ts +2 -0
- package/src/node/port.ts +37 -0
- package/src/oss/demo.ts +61 -0
- package/src/oss/index.ts +187 -0
- package/src/polyfills/async-hooks.ts +6 -0
- package/src/polyfills/index.ts +4 -0
- package/src/types/index.ts +52 -0
- package/src/us-keyboard-layout.ts +723 -0
- package/src/utils.ts +149 -0
- package/src/zod-schema-utils.ts +133 -0
|
@@ -0,0 +1,318 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,318 @@
|
|
|
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
|
+
}
|