@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.
@@ -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-2BACMIBG.js');
2
- require('./chunk-SE6FHTRR.js');
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 _chunkAYXF4DBRjs = require('./chunk-AYXF4DBR.js');
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 _chunkAYXF4DBRjs.describeUserPage.call(void 0, baseContext);
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 _chunk2BACMIBGjs = require('./chunk-2BACMIBG.js');
5
+ var _chunkNETSG4MYjs = require('./chunk-NETSG4MY.js');
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkSE6FHTRRjs = require('./chunk-SE6FHTRR.js');
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 _chunkAYXF4DBRjs = require('./chunk-AYXF4DBR.js');
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 = _chunkAYXF4DBRjs.AIResponseFormat; exports.AiAssert = _chunkAYXF4DBRjs.AiAssert; exports.AiInspectElement = _chunkAYXF4DBRjs.AiInspectElement; exports.BaseElement = _chunkAYXF4DBRjs.BaseElement; exports.Executor = _chunk2BACMIBGjs.Executor; exports.Insight = _chunk2BACMIBGjs.Insight; exports.MIDSCENE_MODEL_NAME = _chunkXBSEZM3Yjs.MIDSCENE_MODEL_NAME; exports.UIContext = _chunkAYXF4DBRjs.UIContext; exports.default = _chunk2BACMIBGjs.src_default; exports.describeUserPage = _chunkAYXF4DBRjs.describeUserPage; exports.getAIConfig = _chunkXBSEZM3Yjs.getAIConfig; exports.getLogDirByType = _chunkSE6FHTRRjs.getLogDirByType; exports.getVersion = _chunkSE6FHTRRjs.getVersion; exports.plan = _chunkAYXF4DBRjs.plan; exports.setLogDir = _chunkSE6FHTRRjs.setLogDir; exports.transformElementPositionToId = _chunkAYXF4DBRjs.transformElementPositionToId;
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-7768f478.js';
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-24988daa.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-24988daa.js';
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-7768f478.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-7768f478.js';
3
- import { c as callAiFn } from './llm-planning-24988daa.js';
4
- export { a as AiAssert, A as AiInspectElement, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-24988daa.js';
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-7768f478.js';
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 = [
@@ -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-7768f478.js';
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
- finish: boolean;
190
+ more_actions_needed_by_instruction: boolean;
191
191
  log: string;
192
192
  sleep?: number;
193
193
  error?: string;
@@ -1,4 +1,4 @@
1
- import { t as ReportDumpWithAttributes, R as Rect } from './types-7768f478.js';
1
+ import { t as ReportDumpWithAttributes, R as Rect } from './types-f45a4ee7.js';
2
2
  import '@midscene/shared/constants';
3
3
  import 'openai/resources';
4
4
 
package/dist/lib/utils.js CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
 
17
17
 
18
- var _chunkSE6FHTRRjs = require('./chunk-SE6FHTRR.js');
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 = _chunkSE6FHTRRjs.getLogDir; exports.getLogDirByType = _chunkSE6FHTRRjs.getLogDirByType; exports.getTmpDir = _chunkSE6FHTRRjs.getTmpDir; exports.getTmpFile = _chunkSE6FHTRRjs.getTmpFile; exports.getVersion = _chunkSE6FHTRRjs.getVersion; exports.groupedActionDumpFileExt = _chunkSE6FHTRRjs.groupedActionDumpFileExt; exports.overlapped = _chunkSE6FHTRRjs.overlapped; exports.replaceStringWithFirstAppearance = _chunkSE6FHTRRjs.replaceStringWithFirstAppearance; exports.replacerForPageObject = _chunkSE6FHTRRjs.replacerForPageObject; exports.reportHTMLContent = _chunkSE6FHTRRjs.reportHTMLContent; exports.setLogDir = _chunkSE6FHTRRjs.setLogDir; exports.sleep = _chunkSE6FHTRRjs.sleep; exports.stringifyDumpData = _chunkSE6FHTRRjs.stringifyDumpData; exports.uploadTestInfoToServer = _chunkSE6FHTRRjs.uploadTestInfoToServer; exports.writeDumpReport = _chunkSE6FHTRRjs.writeDumpReport; exports.writeLogFile = _chunkSE6FHTRRjs.writeLogFile;
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.1",
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.1"
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 -u",
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"