@midscene/core 0.12.1 → 0.12.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/dist/lib/ai-model.js +2 -2
- package/dist/lib/{chunk-SE6FHTRR.js → chunk-6DPWW5RJ.js} +2 -2
- package/dist/lib/{chunk-2BACMIBG.js → chunk-NETSG4MY.js} +11 -11
- package/dist/lib/{chunk-AYXF4DBR.js → chunk-XEGSHWMP.js} +11 -8
- package/dist/lib/chunk-XEGSHWMP.js.map +1 -0
- package/dist/lib/evaluation.js +4 -4
- package/dist/lib/index.js +4 -4
- package/dist/lib/types/ai-model.d.ts +3 -3
- package/dist/lib/types/index.d.ts +4 -4
- package/dist/lib/types/{llm-planning-24988daa.d.ts → llm-planning-e8b915d3.d.ts} +1 -1
- package/dist/lib/types/tree.d.ts +1 -1
- package/dist/lib/types/{types-7768f478.d.ts → types-f45a4ee7.d.ts} +1 -1
- package/dist/lib/types/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/package.json +3 -3
- package/report/index.html +1 -1
- package/dist/lib/chunk-AYXF4DBR.js.map +0 -1
- /package/dist/lib/{chunk-SE6FHTRR.js.map → chunk-6DPWW5RJ.js.map} +0 -0
- /package/dist/lib/{chunk-2BACMIBG.js.map → chunk-NETSG4MY.js.map} +0 -0
package/dist/lib/evaluation.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-
|
|
2
|
-
require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-NETSG4MY.js');
|
|
2
|
+
require('./chunk-6DPWW5RJ.js');
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXEGSHWMPjs = require('./chunk-XEGSHWMP.js');
|
|
6
6
|
require('./chunk-XBSEZM3Y.js');
|
|
7
7
|
require('./chunk-LQ2VYIYD.js');
|
|
8
8
|
|
|
@@ -34,7 +34,7 @@ async function buildContext(targetDir) {
|
|
|
34
34
|
context: {
|
|
35
35
|
...baseContext,
|
|
36
36
|
describer: async () => {
|
|
37
|
-
return
|
|
37
|
+
return _chunkXEGSHWMPjs.describeUserPage.call(void 0, baseContext);
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
snapshotJson,
|
package/dist/lib/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkNETSG4MYjs = require('./chunk-NETSG4MY.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk6DPWW5RJjs = require('./chunk-6DPWW5RJ.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ var _chunkSE6FHTRRjs = require('./chunk-SE6FHTRR.js');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkXEGSHWMPjs = require('./chunk-XEGSHWMP.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -40,4 +40,4 @@ require('./chunk-LQ2VYIYD.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
exports.AIResponseFormat =
|
|
43
|
+
exports.AIResponseFormat = _chunkXEGSHWMPjs.AIResponseFormat; exports.AiAssert = _chunkXEGSHWMPjs.AiAssert; exports.AiInspectElement = _chunkXEGSHWMPjs.AiInspectElement; exports.BaseElement = _chunkXEGSHWMPjs.BaseElement; exports.Executor = _chunkNETSG4MYjs.Executor; exports.Insight = _chunkNETSG4MYjs.Insight; exports.MIDSCENE_MODEL_NAME = _chunkXBSEZM3Yjs.MIDSCENE_MODEL_NAME; exports.UIContext = _chunkXEGSHWMPjs.UIContext; exports.default = _chunkNETSG4MYjs.src_default; exports.describeUserPage = _chunkXEGSHWMPjs.describeUserPage; exports.getAIConfig = _chunkXBSEZM3Yjs.getAIConfig; exports.getLogDirByType = _chunk6DPWW5RJjs.getLogDirByType; exports.getVersion = _chunk6DPWW5RJjs.getVersion; exports.plan = _chunkXEGSHWMPjs.plan; exports.setLogDir = _chunk6DPWW5RJjs.setLogDir; exports.transformElementPositionToId = _chunkXEGSHWMPjs.transformElementPositionToId;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as AIUsageInfo, F as PlanningAction } from './types-
|
|
1
|
+
import { h as AIUsageInfo, F as PlanningAction } from './types-f45a4ee7.js';
|
|
2
2
|
import { ChatCompletionMessageParam } from 'openai/resources';
|
|
3
3
|
export { ChatCompletionMessageParam } from 'openai/resources';
|
|
4
|
-
import { b as AIActionType } from './llm-planning-
|
|
5
|
-
export { a as AiAssert, e as AiExtractElementInfo, A as AiInspectElement, c as callAiFn, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-
|
|
4
|
+
import { b as AIActionType } from './llm-planning-e8b915d3.js';
|
|
5
|
+
export { a as AiAssert, e as AiExtractElementInfo, A as AiInspectElement, c as callAiFn, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-e8b915d3.js';
|
|
6
6
|
import { actionParser } from '@ui-tars/action-parser';
|
|
7
7
|
import '@midscene/shared/constants';
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, B as BaseElement, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightOptions, e as InsightTaskInfo, f as InsightAssertionResponse, A as AISingleElementResponse } from './types-
|
|
2
|
-
export { p as AIAssertionResponse, m as AIElementCoordinatesResponse, l as AIElementIdResponse, n as AIElementResponse, i as AIResponseFormat, o as AISectionParseResponse, j as AISingleElementResponseById, k as AISingleElementResponseByPosition, h as AIUsageInfo, y as AgentAssertOpt, x as AgentWaitForOpt, X as BaseAgentParserOpt, C as CallAIFn, W as Color, s as DumpMeta, w as ElementById, g as ElementTreeNode, q as EnsureObject, _ as ExecutionRecorderItem, ag as ExecutionTaskAction, af as ExecutionTaskActionApply, ae as ExecutionTaskInsightAssertion, ad as ExecutionTaskInsightAssertionApply, ac as ExecutionTaskInsightAssertionParam, a5 as ExecutionTaskInsightDumpLog, a7 as ExecutionTaskInsightLocate, a6 as ExecutionTaskInsightLocateApply, a4 as ExecutionTaskInsightLocateOutput, a3 as ExecutionTaskInsightLocateParam, ab as ExecutionTaskInsightQuery, aa as ExecutionTaskInsightQueryApply, a9 as ExecutionTaskInsightQueryOutput, a8 as ExecutionTaskInsightQueryParam, ai as ExecutionTaskPlanning, ah as ExecutionTaskPlanningApply, a2 as ExecutionTaskReturn, $ as ExecutionTaskType, a0 as ExecutorContext, aj as GroupedActionDump, u as InsightDump, r as InsightExtractParam, L as LiteUISection, O as OnTaskStartTip, v as PartialInsightDumpFromSDK, G as PlanningAIResponse, F as PlanningAction, N as PlanningActionParamAssert, T as PlanningActionParamError, J as PlanningActionParamHover, K as PlanningActionParamInputOrKeyPress, M as PlanningActionParamScroll, Q as PlanningActionParamSleep, H as PlanningActionParamTap, V as PlanningActionParamWaitFor, z as PlanningLocateParam, Z as PlaywrightParserOpt, P as Point, Y as PuppeteerParserOpt, R as Rect, t as ReportDumpWithAttributes, S as Size, a1 as TaskCacheInfo } from './types-
|
|
3
|
-
import { c as callAiFn } from './llm-planning-
|
|
4
|
-
export { a as AiAssert, A as AiInspectElement, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-
|
|
1
|
+
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, B as BaseElement, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightOptions, e as InsightTaskInfo, f as InsightAssertionResponse, A as AISingleElementResponse } from './types-f45a4ee7.js';
|
|
2
|
+
export { p as AIAssertionResponse, m as AIElementCoordinatesResponse, l as AIElementIdResponse, n as AIElementResponse, i as AIResponseFormat, o as AISectionParseResponse, j as AISingleElementResponseById, k as AISingleElementResponseByPosition, h as AIUsageInfo, y as AgentAssertOpt, x as AgentWaitForOpt, X as BaseAgentParserOpt, C as CallAIFn, W as Color, s as DumpMeta, w as ElementById, g as ElementTreeNode, q as EnsureObject, _ as ExecutionRecorderItem, ag as ExecutionTaskAction, af as ExecutionTaskActionApply, ae as ExecutionTaskInsightAssertion, ad as ExecutionTaskInsightAssertionApply, ac as ExecutionTaskInsightAssertionParam, a5 as ExecutionTaskInsightDumpLog, a7 as ExecutionTaskInsightLocate, a6 as ExecutionTaskInsightLocateApply, a4 as ExecutionTaskInsightLocateOutput, a3 as ExecutionTaskInsightLocateParam, ab as ExecutionTaskInsightQuery, aa as ExecutionTaskInsightQueryApply, a9 as ExecutionTaskInsightQueryOutput, a8 as ExecutionTaskInsightQueryParam, ai as ExecutionTaskPlanning, ah as ExecutionTaskPlanningApply, a2 as ExecutionTaskReturn, $ as ExecutionTaskType, a0 as ExecutorContext, aj as GroupedActionDump, u as InsightDump, r as InsightExtractParam, L as LiteUISection, O as OnTaskStartTip, v as PartialInsightDumpFromSDK, G as PlanningAIResponse, F as PlanningAction, N as PlanningActionParamAssert, T as PlanningActionParamError, J as PlanningActionParamHover, K as PlanningActionParamInputOrKeyPress, M as PlanningActionParamScroll, Q as PlanningActionParamSleep, H as PlanningActionParamTap, V as PlanningActionParamWaitFor, z as PlanningLocateParam, Z as PlaywrightParserOpt, P as Point, Y as PuppeteerParserOpt, R as Rect, t as ReportDumpWithAttributes, S as Size, a1 as TaskCacheInfo } from './types-f45a4ee7.js';
|
|
3
|
+
import { c as callAiFn } from './llm-planning-e8b915d3.js';
|
|
4
|
+
export { a as AiAssert, A as AiInspectElement, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-e8b915d3.js';
|
|
5
5
|
export { getLogDirByType, getVersion, setLogDir } from './utils.js';
|
|
6
6
|
export { MIDSCENE_MODEL_NAME, getAIConfig } from './env.js';
|
|
7
7
|
import '@midscene/shared/constants';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as AIUsageInfo, B as BaseElement, U as UIContext, n as AIElementResponse, g as ElementTreeNode, l as AIElementIdResponse, A as AISingleElementResponse, k as AISingleElementResponseByPosition, w as ElementById, o as AISectionParseResponse, p as AIAssertionResponse, G as PlanningAIResponse } from './types-
|
|
1
|
+
import { h as AIUsageInfo, B as BaseElement, U as UIContext, n as AIElementResponse, g as ElementTreeNode, l as AIElementIdResponse, A as AISingleElementResponse, k as AISingleElementResponseByPosition, w as ElementById, o as AISectionParseResponse, p as AIAssertionResponse, G as PlanningAIResponse } from './types-f45a4ee7.js';
|
|
2
2
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
3
3
|
|
|
4
4
|
type AIArgs = [
|
package/dist/lib/types/tree.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _midscene_shared_constants from '@midscene/shared/constants';
|
|
2
|
-
import { B as BaseElement, g as ElementTreeNode } from './types-
|
|
2
|
+
import { B as BaseElement, g as ElementTreeNode } from './types-f45a4ee7.js';
|
|
3
3
|
import 'openai/resources';
|
|
4
4
|
|
|
5
5
|
declare function truncateText(text: string | number | object | undefined, maxLength?: number): string;
|
|
@@ -187,7 +187,7 @@ interface PlanningAction<ParamType = any> {
|
|
|
187
187
|
interface PlanningAIResponse {
|
|
188
188
|
action?: PlanningAction;
|
|
189
189
|
actions?: PlanningAction[];
|
|
190
|
-
|
|
190
|
+
more_actions_needed_by_instruction: boolean;
|
|
191
191
|
log: string;
|
|
192
192
|
sleep?: number;
|
|
193
193
|
error?: string;
|
package/dist/lib/utils.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk6DPWW5RJjs = require('./chunk-6DPWW5RJ.js');
|
|
19
19
|
require('./chunk-XBSEZM3Y.js');
|
|
20
20
|
require('./chunk-LQ2VYIYD.js');
|
|
21
21
|
|
|
@@ -35,4 +35,4 @@ require('./chunk-LQ2VYIYD.js');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.getLogDir =
|
|
38
|
+
exports.getLogDir = _chunk6DPWW5RJjs.getLogDir; exports.getLogDirByType = _chunk6DPWW5RJjs.getLogDirByType; exports.getTmpDir = _chunk6DPWW5RJjs.getTmpDir; exports.getTmpFile = _chunk6DPWW5RJjs.getTmpFile; exports.getVersion = _chunk6DPWW5RJjs.getVersion; exports.groupedActionDumpFileExt = _chunk6DPWW5RJjs.groupedActionDumpFileExt; exports.overlapped = _chunk6DPWW5RJjs.overlapped; exports.replaceStringWithFirstAppearance = _chunk6DPWW5RJjs.replaceStringWithFirstAppearance; exports.replacerForPageObject = _chunk6DPWW5RJjs.replacerForPageObject; exports.reportHTMLContent = _chunk6DPWW5RJjs.reportHTMLContent; exports.setLogDir = _chunk6DPWW5RJjs.setLogDir; exports.sleep = _chunk6DPWW5RJjs.sleep; exports.stringifyDumpData = _chunk6DPWW5RJjs.stringifyDumpData; exports.uploadTestInfoToServer = _chunk6DPWW5RJjs.uploadTestInfoToServer; exports.writeDumpReport = _chunk6DPWW5RJjs.writeDumpReport; exports.writeLogFile = _chunk6DPWW5RJjs.writeLogFile;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/core",
|
|
3
3
|
"description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.2",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"jsnext:source": "./src/index.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@ui-tars/action-parser": "1.0.1",
|
|
51
51
|
"openai": "4.81.0",
|
|
52
52
|
"socks-proxy-agent": "8.0.4",
|
|
53
|
-
"@midscene/shared": "0.12.
|
|
53
|
+
"@midscene/shared": "0.12.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@modern-js/module-tools": "2.60.6",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"build:watch": "modern build -w",
|
|
77
77
|
"new": "modern new",
|
|
78
78
|
"upgrade": "modern upgrade",
|
|
79
|
-
"test": "vitest --run
|
|
79
|
+
"test": "vitest --run",
|
|
80
80
|
"test:ai": "AITEST=true npm run test",
|
|
81
81
|
"computer": "TEST_COMPUTER=true npm run test:ai -- tests/ai/evaluate/computer.test.ts",
|
|
82
82
|
"test:parse-action": "npm run test:ai -- tests/ai/parse-action.test.ts"
|