@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
package/dist/lib/common.js.bak
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED: ()=>ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED,
|
|
37
|
-
getMidsceneRunBaseDir: ()=>getMidsceneRunBaseDir,
|
|
38
|
-
getMidsceneRunDir: ()=>getMidsceneRunDir,
|
|
39
|
-
getMidsceneRunSubDir: ()=>getMidsceneRunSubDir,
|
|
40
|
-
defaultRunDirName: ()=>defaultRunDirName
|
|
41
|
-
});
|
|
42
|
-
const external_node_fs_namespaceObject = require("node:fs");
|
|
43
|
-
const external_node_os_namespaceObject = require("node:os");
|
|
44
|
-
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
-
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
-
const basic_js_namespaceObject = require("./env/basic.js");
|
|
47
|
-
const types_js_namespaceObject = require("./env/types.js");
|
|
48
|
-
const external_utils_js_namespaceObject = require("./utils.js");
|
|
49
|
-
const defaultRunDirName = 'midscene_run';
|
|
50
|
-
const getMidsceneRunDir = ()=>{
|
|
51
|
-
if (!external_utils_js_namespaceObject.ifInNode) return '';
|
|
52
|
-
return (0, basic_js_namespaceObject.getBasicEnvValue)(types_js_namespaceObject.MIDSCENE_RUN_DIR) || defaultRunDirName;
|
|
53
|
-
};
|
|
54
|
-
const getMidsceneRunBaseDir = ()=>{
|
|
55
|
-
if (!external_utils_js_namespaceObject.ifInNode) return '';
|
|
56
|
-
let basePath = external_node_path_default().resolve(process.cwd(), getMidsceneRunDir());
|
|
57
|
-
if (!(0, external_node_fs_namespaceObject.existsSync)(basePath)) try {
|
|
58
|
-
(0, external_node_fs_namespaceObject.mkdirSync)(basePath, {
|
|
59
|
-
recursive: true
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
basePath = external_node_path_default().join((0, external_node_os_namespaceObject.tmpdir)(), defaultRunDirName);
|
|
63
|
-
(0, external_node_fs_namespaceObject.mkdirSync)(basePath, {
|
|
64
|
-
recursive: true
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return basePath;
|
|
68
|
-
};
|
|
69
|
-
const getMidsceneRunSubDir = (subdir)=>{
|
|
70
|
-
if (!external_utils_js_namespaceObject.ifInNode) return '';
|
|
71
|
-
const basePath = getMidsceneRunBaseDir();
|
|
72
|
-
const logPath = external_node_path_default().join(basePath, subdir);
|
|
73
|
-
if (!(0, external_node_fs_namespaceObject.existsSync)(logPath)) (0, external_node_fs_namespaceObject.mkdirSync)(logPath, {
|
|
74
|
-
recursive: true
|
|
75
|
-
});
|
|
76
|
-
return logPath;
|
|
77
|
-
};
|
|
78
|
-
const ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = 'NOT_IMPLEMENTED_AS_DESIGNED';
|
|
79
|
-
exports.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED = __webpack_exports__.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED;
|
|
80
|
-
exports.defaultRunDirName = __webpack_exports__.defaultRunDirName;
|
|
81
|
-
exports.getMidsceneRunBaseDir = __webpack_exports__.getMidsceneRunBaseDir;
|
|
82
|
-
exports.getMidsceneRunDir = __webpack_exports__.getMidsceneRunDir;
|
|
83
|
-
exports.getMidsceneRunSubDir = __webpack_exports__.getMidsceneRunSubDir;
|
|
84
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
85
|
-
"ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED",
|
|
86
|
-
"defaultRunDirName",
|
|
87
|
-
"getMidsceneRunBaseDir",
|
|
88
|
-
"getMidsceneRunDir",
|
|
89
|
-
"getMidsceneRunSubDir"
|
|
90
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
91
|
-
Object.defineProperty(exports, '__esModule', {
|
|
92
|
-
value: true
|
|
93
|
-
});
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
PLAYWRIGHT_EXAMPLE_CODE: ()=>PLAYWRIGHT_EXAMPLE_CODE,
|
|
28
|
-
YAML_EXAMPLE_CODE: ()=>YAML_EXAMPLE_CODE
|
|
29
|
-
});
|
|
30
|
-
const PLAYWRIGHT_EXAMPLE_CODE = `
|
|
31
|
-
// Reference the following code to generate Midscene test cases
|
|
32
|
-
// The following is test code for Midscene AI, for reference
|
|
33
|
-
// The following is Playwright syntax, you can use Playwright to assist in test generation
|
|
34
|
-
IMPORTANT: Follow these exact type signatures for AI functions:
|
|
35
|
-
|
|
36
|
-
// Type signatures for AI functions:
|
|
37
|
-
aiAct(prompt: string, options?: { cacheable?: boolean, deepThink?: 'unset' | true | false }): Promise<void>
|
|
38
|
-
aiInput(text: string, locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
|
|
39
|
-
aiTap(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
|
|
40
|
-
aiHover(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
|
|
41
|
-
aiDoubleClick(locate: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
|
|
42
|
-
aiKeyboardPress(key: string, locate?: string, options?: { deepLocate?: boolean, xpath?: string, cacheable?: boolean }): Promise<void>
|
|
43
|
-
aiScroll(locate: string | undefined, options: {
|
|
44
|
-
direction?: 'up' | 'down' | 'left' | 'right',
|
|
45
|
-
scrollType?: 'singleAction' | 'scrollToBottom' | 'scrollToTop' | 'scrollToRight' | 'scrollToLeft',
|
|
46
|
-
distance?: number | null,
|
|
47
|
-
deepLocate?: boolean,
|
|
48
|
-
xpath?: string,
|
|
49
|
-
cacheable?: boolean
|
|
50
|
-
}): Promise<void>
|
|
51
|
-
aiAssert(assertion: string, options?: { errorMessage?: string }): Promise<void>
|
|
52
|
-
aiWaitFor(prompt: string, options?: { timeout?: number }): Promise<void>
|
|
53
|
-
aiQuery<T>(queryObject: Record<string, string>): Promise<T> // Extracts data from page based on descriptions
|
|
54
|
-
|
|
55
|
-
// examples:
|
|
56
|
-
// Reference the following code to generate Midscene test cases
|
|
57
|
-
// The following is test code for Midscene AI, for reference
|
|
58
|
-
// The following is Playwright syntax, you can use Playwright to assist in test generation
|
|
59
|
-
import { test as base } from '@playwright/test';
|
|
60
|
-
import type { PlayWrightAiFixtureType } from '@midscene/web/playwright';
|
|
61
|
-
import { PlaywrightAiFixture } from '@midscene/web/playwright';
|
|
62
|
-
|
|
63
|
-
const test = base.extend<PlayWrightAiFixtureType>(PlaywrightAiFixture({
|
|
64
|
-
waitForNetworkIdleTimeout: 2000, // optional, the timeout for waiting for network idle between each action, default is 2000ms
|
|
65
|
-
}));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
test.beforeEach(async ({ page }) => {
|
|
69
|
-
await page.goto('https://www.xxx.com/');
|
|
70
|
-
await page.setViewportSize({ width: 1920, height: 1080 });
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('ai shop', async ({
|
|
74
|
-
aiAct,
|
|
75
|
-
aiInput,
|
|
76
|
-
aiAssert,
|
|
77
|
-
aiQuery,
|
|
78
|
-
aiKeyboardPress,
|
|
79
|
-
aiHover,
|
|
80
|
-
aiTap,
|
|
81
|
-
aiWaitFor,
|
|
82
|
-
agentForPage,
|
|
83
|
-
page,
|
|
84
|
-
}) => {
|
|
85
|
-
// login
|
|
86
|
-
await aiAssert('The page shows the login interface');
|
|
87
|
-
await aiInput('user_name', 'in user name input');
|
|
88
|
-
await aiInput('password', 'in password input');
|
|
89
|
-
await aiKeyboardPress('Enter', 'Login Button');
|
|
90
|
-
|
|
91
|
-
// check the login success
|
|
92
|
-
await aiWaitFor('The page shows that the loading is complete');
|
|
93
|
-
await aiAssert('The current page shows the product detail page');
|
|
94
|
-
|
|
95
|
-
// check the product info
|
|
96
|
-
const dataA = await aiQuery({
|
|
97
|
-
userInfo: 'User information in the format {name: string}',
|
|
98
|
-
theFirstProductInfo: 'The first product info in the format {name: string, price: number}',
|
|
99
|
-
});
|
|
100
|
-
expect(dataA.theFirstProductInfo.name).toBe('xxx');
|
|
101
|
-
expect(dataA.theFirstProductInfo.price).toBe(100);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// add to cart
|
|
105
|
-
await aiTap('click add to cart button');
|
|
106
|
-
|
|
107
|
-
await aiTap('click right top cart icon');
|
|
108
|
-
await aiAssert('The cart icon shows the number 1');
|
|
109
|
-
});
|
|
110
|
-
`;
|
|
111
|
-
const YAML_EXAMPLE_CODE = `
|
|
112
|
-
1. Format:
|
|
113
|
-
|
|
114
|
-
web:
|
|
115
|
-
url: "starting_url"
|
|
116
|
-
viewportWidth: 1280
|
|
117
|
-
viewportHeight: 960
|
|
118
|
-
|
|
119
|
-
tasks:
|
|
120
|
-
- name: "descriptive task name"
|
|
121
|
-
flow:
|
|
122
|
-
- aiTap: "element description"
|
|
123
|
-
- aiInput: 'text value'
|
|
124
|
-
locate: 'input field description'
|
|
125
|
-
- aiScroll:
|
|
126
|
-
direction: down/up
|
|
127
|
-
scrollType: scrollToBottom/scrollToTop/singleAction
|
|
128
|
-
- aiAssert: "expected state"
|
|
129
|
-
- sleep: milliseconds
|
|
130
|
-
|
|
131
|
-
2. Action Types:
|
|
132
|
-
- aiTap: for clicks (natural language targeting)
|
|
133
|
-
- aiInput: for text input with 'locate' field
|
|
134
|
-
- aiScroll: with direction and scrollType
|
|
135
|
-
- aiAssert: for validations
|
|
136
|
-
- sleep: for delays (milliseconds)
|
|
137
|
-
|
|
138
|
-
3. Best Practices:
|
|
139
|
-
- Group related actions into logical tasks
|
|
140
|
-
- Use natural language descriptions
|
|
141
|
-
- Add deepLocate: true for complex interactions
|
|
142
|
-
- Keep task names concise but descriptive
|
|
143
|
-
|
|
144
|
-
4. CRITICAL - YAML Indentation Rules:
|
|
145
|
-
- For actions with additional parameters (aiScroll, aiInput, aiKeyboardPress), the parameters must be SIBLING keys, NOT nested children
|
|
146
|
-
- Parameters like direction, scrollType, locate must align with the action key, not indented further
|
|
147
|
-
- CORRECT indentation example:
|
|
148
|
-
- aiScroll:
|
|
149
|
-
direction: down
|
|
150
|
-
scrollType: singleAction
|
|
151
|
-
- WRONG indentation (DO NOT do this):
|
|
152
|
-
- aiScroll:
|
|
153
|
-
direction: down
|
|
154
|
-
scrollType: singleAction
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
YAML type
|
|
159
|
-
tasks:
|
|
160
|
-
- name: <name>
|
|
161
|
-
continueOnError: <boolean> # Optional, whether to continue to the next task on error, defaults to false.
|
|
162
|
-
flow:
|
|
163
|
-
# Auto Planning (.ai)
|
|
164
|
-
# ----------------
|
|
165
|
-
|
|
166
|
-
# Perform an interaction. \`ai\` is a shorthand for \`aiAct\`.
|
|
167
|
-
- ai: <prompt>
|
|
168
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
169
|
-
|
|
170
|
-
# This usage is the same as \`ai\`.
|
|
171
|
-
- aiAct: <prompt>
|
|
172
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
173
|
-
|
|
174
|
-
# Instant Action (.aiTap, .aiDoubleClick, .aiHover, .aiInput, .aiKeyboardPress, .aiScroll)
|
|
175
|
-
# ----------------
|
|
176
|
-
|
|
177
|
-
# Tap an element described by a prompt.
|
|
178
|
-
- aiTap: <prompt>
|
|
179
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
180
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
181
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
182
|
-
|
|
183
|
-
# Double click an element described by a prompt.
|
|
184
|
-
- aiDoubleClick: <prompt>
|
|
185
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
186
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
187
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
188
|
-
|
|
189
|
-
# Hover over an element described by a prompt.
|
|
190
|
-
- aiHover: <prompt>
|
|
191
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
192
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
193
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
194
|
-
|
|
195
|
-
# Input text into an element described by a prompt.
|
|
196
|
-
- aiInput: <final text content of the input>
|
|
197
|
-
locate: <prompt>
|
|
198
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
199
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
200
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
201
|
-
|
|
202
|
-
# Press a key (e.g., Enter, Tab, Escape) on an element described by a prompt.
|
|
203
|
-
- aiKeyboardPress: <key>
|
|
204
|
-
locate: <prompt>
|
|
205
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
206
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
207
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
208
|
-
|
|
209
|
-
# Scroll globally or on an element described by a prompt.
|
|
210
|
-
- aiScroll:
|
|
211
|
-
direction: 'up' # or 'down' | 'left' | 'right'
|
|
212
|
-
scrollType: 'singleAction' # or 'scrollToTop' | 'scrollToBottom' | 'scrollToLeft' | 'scrollToRight'
|
|
213
|
-
distance: <number> # Optional, the scroll distance in pixels.
|
|
214
|
-
locate: <prompt> # Optional, the element to scroll on.
|
|
215
|
-
deepLocate: <boolean> # Optional, whether to use deepLocate to precisely locate the element. Defaults to False.
|
|
216
|
-
xpath: <xpath> # Optional, the xpath of the target element for the operation. If provided, Midscene will prioritize this xpath to find the element before using the cache and the AI model. Defaults to empty.
|
|
217
|
-
cacheable: <boolean> # Optional, whether to cache the result of this API call when the [caching feature](./caching.mdx) is enabled. Defaults to True.
|
|
218
|
-
|
|
219
|
-
# Record the current screenshot with a description in the report file.
|
|
220
|
-
- recordToReport: <title> # Optional, the title of the screenshot. If not provided, the title will be 'untitled'.
|
|
221
|
-
content: <content> # Optional, the description of the screenshot.
|
|
222
|
-
|
|
223
|
-
# Data Extraction
|
|
224
|
-
# ----------------
|
|
225
|
-
|
|
226
|
-
# Perform a query that returns a JSON object.
|
|
227
|
-
- aiQuery: <prompt> # Remember to describe the format of the result in the prompt.
|
|
228
|
-
name: <name> # The key for the query result in the JSON output.
|
|
229
|
-
|
|
230
|
-
# More APIs
|
|
231
|
-
# ----------------
|
|
232
|
-
|
|
233
|
-
# Wait for a condition to be met, with a timeout (in ms, optional, defaults to 30000).
|
|
234
|
-
- aiWaitFor: <prompt>
|
|
235
|
-
timeout: <ms>
|
|
236
|
-
|
|
237
|
-
# Perform an assertion.
|
|
238
|
-
- aiAssert: <prompt>
|
|
239
|
-
errorMessage: <error-message> # Optional, the error message to print if the assertion fails.
|
|
240
|
-
|
|
241
|
-
# Wait for a specified amount of time.
|
|
242
|
-
- sleep: <ms>
|
|
243
|
-
|
|
244
|
-
# Execute a piece of JavaScript code in the web page context.
|
|
245
|
-
- javascript: <javascript>
|
|
246
|
-
name: <name> # Optional, assign a name to the return value, which will be used as a key in the JSON output.
|
|
247
|
-
|
|
248
|
-
- name: <name>
|
|
249
|
-
flow:
|
|
250
|
-
# ...
|
|
251
|
-
`;
|
|
252
|
-
exports.PLAYWRIGHT_EXAMPLE_CODE = __webpack_exports__.PLAYWRIGHT_EXAMPLE_CODE;
|
|
253
|
-
exports.YAML_EXAMPLE_CODE = __webpack_exports__.YAML_EXAMPLE_CODE;
|
|
254
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
255
|
-
"PLAYWRIGHT_EXAMPLE_CODE",
|
|
256
|
-
"YAML_EXAMPLE_CODE"
|
|
257
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
258
|
-
Object.defineProperty(exports, '__esModule', {
|
|
259
|
-
value: true
|
|
260
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT: ()=>DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT,
|
|
28
|
-
YAML_EXAMPLE_CODE: ()=>external_example_code_js_namespaceObject.YAML_EXAMPLE_CODE,
|
|
29
|
-
CONTAINER_MINI_WIDTH: ()=>CONTAINER_MINI_WIDTH,
|
|
30
|
-
DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY: ()=>DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY,
|
|
31
|
-
DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT: ()=>DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT,
|
|
32
|
-
PLAYGROUND_SERVER_PORT: ()=>PLAYGROUND_SERVER_PORT,
|
|
33
|
-
TEXT_MAX_SIZE: ()=>TEXT_MAX_SIZE,
|
|
34
|
-
WEBDRIVER_ELEMENT_ID_KEY: ()=>WEBDRIVER_ELEMENT_ID_KEY,
|
|
35
|
-
DEFAULT_WDA_PORT: ()=>DEFAULT_WDA_PORT,
|
|
36
|
-
NodeType: ()=>constants_NodeType,
|
|
37
|
-
PLAYWRIGHT_EXAMPLE_CODE: ()=>external_example_code_js_namespaceObject.PLAYWRIGHT_EXAMPLE_CODE,
|
|
38
|
-
CONTAINER_MINI_HEIGHT: ()=>CONTAINER_MINI_HEIGHT,
|
|
39
|
-
SCRCPY_SERVER_PORT: ()=>SCRCPY_SERVER_PORT,
|
|
40
|
-
TEXT_SIZE_THRESHOLD: ()=>TEXT_SIZE_THRESHOLD
|
|
41
|
-
});
|
|
42
|
-
const external_example_code_js_namespaceObject = require("./example-code.js");
|
|
43
|
-
const TEXT_SIZE_THRESHOLD = 9;
|
|
44
|
-
const TEXT_MAX_SIZE = 40;
|
|
45
|
-
const CONTAINER_MINI_HEIGHT = 3;
|
|
46
|
-
const CONTAINER_MINI_WIDTH = 3;
|
|
47
|
-
var constants_NodeType = /*#__PURE__*/ function(NodeType) {
|
|
48
|
-
NodeType["CONTAINER"] = "CONTAINER Node";
|
|
49
|
-
NodeType["FORM_ITEM"] = "FORM_ITEM Node";
|
|
50
|
-
NodeType["BUTTON"] = "BUTTON Node";
|
|
51
|
-
NodeType["A"] = "Anchor Node";
|
|
52
|
-
NodeType["IMG"] = "IMG Node";
|
|
53
|
-
NodeType["TEXT"] = "TEXT Node";
|
|
54
|
-
NodeType["POSITION"] = "POSITION Node";
|
|
55
|
-
return NodeType;
|
|
56
|
-
}({});
|
|
57
|
-
const PLAYGROUND_SERVER_PORT = 5800;
|
|
58
|
-
const SCRCPY_SERVER_PORT = 5700;
|
|
59
|
-
const WEBDRIVER_ELEMENT_ID_KEY = 'element-6066-11e4-a52e-4f735466cecf';
|
|
60
|
-
const DEFAULT_WDA_PORT = 8100;
|
|
61
|
-
const DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT = 5000;
|
|
62
|
-
const DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT = 2000;
|
|
63
|
-
const DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY = 2;
|
|
64
|
-
exports.CONTAINER_MINI_HEIGHT = __webpack_exports__.CONTAINER_MINI_HEIGHT;
|
|
65
|
-
exports.CONTAINER_MINI_WIDTH = __webpack_exports__.CONTAINER_MINI_WIDTH;
|
|
66
|
-
exports.DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT = __webpack_exports__.DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT;
|
|
67
|
-
exports.DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY = __webpack_exports__.DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY;
|
|
68
|
-
exports.DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT = __webpack_exports__.DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT;
|
|
69
|
-
exports.DEFAULT_WDA_PORT = __webpack_exports__.DEFAULT_WDA_PORT;
|
|
70
|
-
exports.NodeType = __webpack_exports__.NodeType;
|
|
71
|
-
exports.PLAYGROUND_SERVER_PORT = __webpack_exports__.PLAYGROUND_SERVER_PORT;
|
|
72
|
-
exports.PLAYWRIGHT_EXAMPLE_CODE = __webpack_exports__.PLAYWRIGHT_EXAMPLE_CODE;
|
|
73
|
-
exports.SCRCPY_SERVER_PORT = __webpack_exports__.SCRCPY_SERVER_PORT;
|
|
74
|
-
exports.TEXT_MAX_SIZE = __webpack_exports__.TEXT_MAX_SIZE;
|
|
75
|
-
exports.TEXT_SIZE_THRESHOLD = __webpack_exports__.TEXT_SIZE_THRESHOLD;
|
|
76
|
-
exports.WEBDRIVER_ELEMENT_ID_KEY = __webpack_exports__.WEBDRIVER_ELEMENT_ID_KEY;
|
|
77
|
-
exports.YAML_EXAMPLE_CODE = __webpack_exports__.YAML_EXAMPLE_CODE;
|
|
78
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
|
-
"CONTAINER_MINI_HEIGHT",
|
|
80
|
-
"CONTAINER_MINI_WIDTH",
|
|
81
|
-
"DEFAULT_WAIT_FOR_NAVIGATION_TIMEOUT",
|
|
82
|
-
"DEFAULT_WAIT_FOR_NETWORK_IDLE_CONCURRENCY",
|
|
83
|
-
"DEFAULT_WAIT_FOR_NETWORK_IDLE_TIMEOUT",
|
|
84
|
-
"DEFAULT_WDA_PORT",
|
|
85
|
-
"NodeType",
|
|
86
|
-
"PLAYGROUND_SERVER_PORT",
|
|
87
|
-
"PLAYWRIGHT_EXAMPLE_CODE",
|
|
88
|
-
"SCRCPY_SERVER_PORT",
|
|
89
|
-
"TEXT_MAX_SIZE",
|
|
90
|
-
"TEXT_SIZE_THRESHOLD",
|
|
91
|
-
"WEBDRIVER_ELEMENT_ID_KEY",
|
|
92
|
-
"YAML_EXAMPLE_CODE"
|
|
93
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
94
|
-
Object.defineProperty(exports, '__esModule', {
|
|
95
|
-
value: true
|
|
96
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
getBasicEnvValue: ()=>getBasicEnvValue
|
|
28
|
-
});
|
|
29
|
-
const external_types_js_namespaceObject = require("./types.js");
|
|
30
|
-
const getBasicEnvValue = (key)=>{
|
|
31
|
-
if (!external_types_js_namespaceObject.BASIC_ENV_KEYS.includes(key)) throw new Error(`getBasicEnvValue with key ${key} is not supported.`);
|
|
32
|
-
return process.env[key];
|
|
33
|
-
};
|
|
34
|
-
exports.getBasicEnvValue = __webpack_exports__.getBasicEnvValue;
|
|
35
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
36
|
-
"getBasicEnvValue"
|
|
37
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
38
|
-
Object.defineProperty(exports, '__esModule', {
|
|
39
|
-
value: true
|
|
40
|
-
});
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
INSIGHT_MODEL_CONFIG_KEYS: ()=>INSIGHT_MODEL_CONFIG_KEYS,
|
|
28
|
-
DEFAULT_MODEL_CONFIG_KEYS_LEGACY: ()=>DEFAULT_MODEL_CONFIG_KEYS_LEGACY,
|
|
29
|
-
DEFAULT_MODEL_CONFIG_KEYS: ()=>DEFAULT_MODEL_CONFIG_KEYS,
|
|
30
|
-
PLANNING_MODEL_CONFIG_KEYS: ()=>PLANNING_MODEL_CONFIG_KEYS
|
|
31
|
-
});
|
|
32
|
-
const external_types_js_namespaceObject = require("./types.js");
|
|
33
|
-
const INSIGHT_MODEL_CONFIG_KEYS = {
|
|
34
|
-
modelName: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_NAME,
|
|
35
|
-
socksProxy: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY,
|
|
36
|
-
httpProxy: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_HTTP_PROXY,
|
|
37
|
-
openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_BASE_URL,
|
|
38
|
-
openaiApiKey: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_API_KEY,
|
|
39
|
-
openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON,
|
|
40
|
-
extraBody: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON,
|
|
41
|
-
modelFamily: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_FAMILY,
|
|
42
|
-
timeout: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_TIMEOUT,
|
|
43
|
-
temperature: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_TEMPERATURE,
|
|
44
|
-
retryCount: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_RETRY_COUNT,
|
|
45
|
-
retryInterval: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_RETRY_INTERVAL,
|
|
46
|
-
reasoningEffort: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT,
|
|
47
|
-
reasoningEnabled: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_REASONING_ENABLED,
|
|
48
|
-
reasoningBudget: external_types_js_namespaceObject.MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET
|
|
49
|
-
};
|
|
50
|
-
const PLANNING_MODEL_CONFIG_KEYS = {
|
|
51
|
-
modelName: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_NAME,
|
|
52
|
-
socksProxy: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_SOCKS_PROXY,
|
|
53
|
-
httpProxy: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_HTTP_PROXY,
|
|
54
|
-
openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_BASE_URL,
|
|
55
|
-
openaiApiKey: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_API_KEY,
|
|
56
|
-
openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON,
|
|
57
|
-
extraBody: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON,
|
|
58
|
-
modelFamily: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_FAMILY,
|
|
59
|
-
timeout: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_TIMEOUT,
|
|
60
|
-
temperature: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_TEMPERATURE,
|
|
61
|
-
retryCount: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_RETRY_COUNT,
|
|
62
|
-
retryInterval: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_RETRY_INTERVAL,
|
|
63
|
-
reasoningEffort: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_REASONING_EFFORT,
|
|
64
|
-
reasoningEnabled: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_REASONING_ENABLED,
|
|
65
|
-
reasoningBudget: external_types_js_namespaceObject.MIDSCENE_PLANNING_MODEL_REASONING_BUDGET
|
|
66
|
-
};
|
|
67
|
-
const DEFAULT_MODEL_CONFIG_KEYS = {
|
|
68
|
-
modelName: external_types_js_namespaceObject.MIDSCENE_MODEL_NAME,
|
|
69
|
-
socksProxy: external_types_js_namespaceObject.MIDSCENE_MODEL_SOCKS_PROXY,
|
|
70
|
-
httpProxy: external_types_js_namespaceObject.MIDSCENE_MODEL_HTTP_PROXY,
|
|
71
|
-
openaiBaseURL: external_types_js_namespaceObject.MIDSCENE_MODEL_BASE_URL,
|
|
72
|
-
openaiApiKey: external_types_js_namespaceObject.MIDSCENE_MODEL_API_KEY,
|
|
73
|
-
openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_MODEL_INIT_CONFIG_JSON,
|
|
74
|
-
extraBody: external_types_js_namespaceObject.MIDSCENE_MODEL_EXTRA_BODY_JSON,
|
|
75
|
-
modelFamily: external_types_js_namespaceObject.MIDSCENE_MODEL_FAMILY,
|
|
76
|
-
timeout: external_types_js_namespaceObject.MIDSCENE_MODEL_TIMEOUT,
|
|
77
|
-
temperature: external_types_js_namespaceObject.MIDSCENE_MODEL_TEMPERATURE,
|
|
78
|
-
retryCount: external_types_js_namespaceObject.MIDSCENE_MODEL_RETRY_COUNT,
|
|
79
|
-
retryInterval: external_types_js_namespaceObject.MIDSCENE_MODEL_RETRY_INTERVAL,
|
|
80
|
-
reasoningEffort: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_EFFORT,
|
|
81
|
-
reasoningEnabled: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_ENABLED,
|
|
82
|
-
reasoningBudget: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_BUDGET
|
|
83
|
-
};
|
|
84
|
-
const DEFAULT_MODEL_CONFIG_KEYS_LEGACY = {
|
|
85
|
-
modelName: external_types_js_namespaceObject.MIDSCENE_MODEL_NAME,
|
|
86
|
-
socksProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_SOCKS_PROXY,
|
|
87
|
-
httpProxy: external_types_js_namespaceObject.MIDSCENE_OPENAI_HTTP_PROXY,
|
|
88
|
-
openaiBaseURL: external_types_js_namespaceObject.OPENAI_BASE_URL,
|
|
89
|
-
openaiApiKey: external_types_js_namespaceObject.OPENAI_API_KEY,
|
|
90
|
-
openaiExtraConfig: external_types_js_namespaceObject.MIDSCENE_OPENAI_INIT_CONFIG_JSON,
|
|
91
|
-
extraBody: external_types_js_namespaceObject.MIDSCENE_MODEL_EXTRA_BODY_JSON,
|
|
92
|
-
modelFamily: 'DEFAULT_MODEL_CONFIG_KEYS has no modelFamily key',
|
|
93
|
-
timeout: external_types_js_namespaceObject.MIDSCENE_MODEL_TIMEOUT,
|
|
94
|
-
temperature: external_types_js_namespaceObject.MIDSCENE_MODEL_TEMPERATURE,
|
|
95
|
-
retryCount: external_types_js_namespaceObject.MIDSCENE_MODEL_RETRY_COUNT,
|
|
96
|
-
retryInterval: external_types_js_namespaceObject.MIDSCENE_MODEL_RETRY_INTERVAL,
|
|
97
|
-
reasoningEffort: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_EFFORT,
|
|
98
|
-
reasoningEnabled: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_ENABLED,
|
|
99
|
-
reasoningBudget: external_types_js_namespaceObject.MIDSCENE_MODEL_REASONING_BUDGET
|
|
100
|
-
};
|
|
101
|
-
exports.DEFAULT_MODEL_CONFIG_KEYS = __webpack_exports__.DEFAULT_MODEL_CONFIG_KEYS;
|
|
102
|
-
exports.DEFAULT_MODEL_CONFIG_KEYS_LEGACY = __webpack_exports__.DEFAULT_MODEL_CONFIG_KEYS_LEGACY;
|
|
103
|
-
exports.INSIGHT_MODEL_CONFIG_KEYS = __webpack_exports__.INSIGHT_MODEL_CONFIG_KEYS;
|
|
104
|
-
exports.PLANNING_MODEL_CONFIG_KEYS = __webpack_exports__.PLANNING_MODEL_CONFIG_KEYS;
|
|
105
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
106
|
-
"DEFAULT_MODEL_CONFIG_KEYS",
|
|
107
|
-
"DEFAULT_MODEL_CONFIG_KEYS_LEGACY",
|
|
108
|
-
"INSIGHT_MODEL_CONFIG_KEYS",
|
|
109
|
-
"PLANNING_MODEL_CONFIG_KEYS"
|
|
110
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
111
|
-
Object.defineProperty(exports, '__esModule', {
|
|
112
|
-
value: true
|
|
113
|
-
});
|