@midscene/core 0.19.1 → 0.20.0
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/ai-model.d.ts +3 -3
- package/dist/es/{chunk-EK5ECFRX.js → chunk-L7JRT3WI.js} +3 -3
- package/dist/es/index.d.ts +4 -4
- package/dist/es/index.js +1 -1
- package/dist/{lib/llm-planning-a951deb9.d.ts → es/llm-planning-fe687364.d.ts} +1 -1
- package/dist/{lib/types-dce56c26.d.ts → es/types-b0b4c68e.d.ts} +13 -7
- package/dist/es/utils.d.ts +1 -1
- package/dist/es/utils.js +1 -1
- package/dist/lib/ai-model.d.ts +3 -3
- package/dist/lib/{chunk-EK5ECFRX.js → chunk-L7JRT3WI.js} +3 -3
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +4 -4
- package/dist/{types/llm-planning-a951deb9.d.ts → lib/llm-planning-fe687364.d.ts} +1 -1
- package/dist/{types/types-dce56c26.d.ts → lib/types-b0b4c68e.d.ts} +13 -7
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/ai-model.d.ts +3 -3
- package/dist/types/index.d.ts +4 -4
- package/dist/{es/llm-planning-a951deb9.d.ts → types/llm-planning-fe687364.d.ts} +1 -1
- package/dist/{es/types-dce56c26.d.ts → types/types-b0b4c68e.d.ts} +13 -7
- package/dist/types/utils.d.ts +1 -1
- package/package.json +3 -3
- /package/dist/es/{chunk-EK5ECFRX.js.map → chunk-L7JRT3WI.js.map} +0 -0
- /package/dist/lib/{chunk-EK5ECFRX.js.map → chunk-L7JRT3WI.js.map} +0 -0
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-
|
|
2
|
-
export { v as AIAssertionResponse, t as AIDataExtractionResponse, r as AIElementCoordinatesResponse, q as AIElementLocatorResponse, s as AIElementResponse, m as AIResponseFormat, u as AISectionLocatorResponse, p as AISingleElementResponse, n as AISingleElementResponseById, o as AISingleElementResponseByPosition, l as AIUsageInfo, Q as AgentAssertOpt, y as AgentDescribeElementAtPointResult, N as AgentWaitForOpt, a4 as BaseAgentParserOpt, C as CallAIFn, a3 as Color, G as DumpMeta, K as ElementById, z as EnsureObject, a7 as ExecutionRecorderItem, ap as ExecutionTaskAction, ao as ExecutionTaskActionApply, an as ExecutionTaskInsightAssertion, am as ExecutionTaskInsightAssertionApply, al as ExecutionTaskInsightAssertionParam, ae as ExecutionTaskInsightDumpLog, ag as ExecutionTaskInsightLocate, af as ExecutionTaskInsightLocateApply, ad as ExecutionTaskInsightLocateOutput, ac as ExecutionTaskInsightLocateParam, ak as ExecutionTaskInsightQuery, aj as ExecutionTaskInsightQueryApply, ai as ExecutionTaskInsightQueryOutput, ah as ExecutionTaskInsightQueryParam, ar as ExecutionTaskLog, aq as ExecutionTaskLogApply, at as ExecutionTaskPlanning, as as ExecutionTaskPlanningApply, ab as ExecutionTaskReturn, a8 as ExecutionTaskType, a9 as ExecutorContext,
|
|
3
|
-
import { c as callAiFn } from './llm-planning-
|
|
4
|
-
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-
|
|
1
|
+
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-b0b4c68e.js';
|
|
2
|
+
export { v as AIAssertionResponse, t as AIDataExtractionResponse, r as AIElementCoordinatesResponse, q as AIElementLocatorResponse, s as AIElementResponse, m as AIResponseFormat, u as AISectionLocatorResponse, p as AISingleElementResponse, n as AISingleElementResponseById, o as AISingleElementResponseByPosition, l as AIUsageInfo, Q as AgentAssertOpt, y as AgentDescribeElementAtPointResult, N as AgentWaitForOpt, a4 as BaseAgentParserOpt, C as CallAIFn, a3 as Color, G as DumpMeta, K as ElementById, z as EnsureObject, a7 as ExecutionRecorderItem, ap as ExecutionTaskAction, ao as ExecutionTaskActionApply, aa as ExecutionTaskHitBy, an as ExecutionTaskInsightAssertion, am as ExecutionTaskInsightAssertionApply, al as ExecutionTaskInsightAssertionParam, ae as ExecutionTaskInsightDumpLog, ag as ExecutionTaskInsightLocate, af as ExecutionTaskInsightLocateApply, ad as ExecutionTaskInsightLocateOutput, ac as ExecutionTaskInsightLocateParam, ak as ExecutionTaskInsightQuery, aj as ExecutionTaskInsightQueryApply, ai as ExecutionTaskInsightQueryOutput, ah as ExecutionTaskInsightQueryParam, ar as ExecutionTaskLog, aq as ExecutionTaskLogApply, at as ExecutionTaskPlanning, as as ExecutionTaskPlanningApply, ab as ExecutionTaskReturn, a8 as ExecutionTaskType, a9 as ExecutorContext, aU as FreeFn, au as GroupedActionDump, H as InsightDump, B as InsightExtractParam, J as LiteUISection, aw as LocateOption, F as LocateResultElement, x as LocateValidatorResult, w as LocatorValidatorOption, j as MidsceneYamlFlowItem, aD as MidsceneYamlFlowItemAIAction, aI as MidsceneYamlFlowItemAIAsk, aE as MidsceneYamlFlowItemAIAssert, aJ as MidsceneYamlFlowItemAIBoolean, aN as MidsceneYamlFlowItemAIHover, aO as MidsceneYamlFlowItemAIInput, aP as MidsceneYamlFlowItemAIKeyboardPress, aK as MidsceneYamlFlowItemAILocate, aG as MidsceneYamlFlowItemAINumber, aF as MidsceneYamlFlowItemAIQuery, k as MidsceneYamlFlowItemAIRightClick, aQ as MidsceneYamlFlowItemAIScroll, aH as MidsceneYamlFlowItemAIString, aM as MidsceneYamlFlowItemAITap, aL as MidsceneYamlFlowItemAIWaitFor, aR as MidsceneYamlFlowItemEvaluateJavaScript, aT as MidsceneYamlFlowItemLogScreenshot, aS as MidsceneYamlFlowItemSleep, M as MidsceneYamlScript, aB as MidsceneYamlScriptAndroidEnv, aC as MidsceneYamlScriptEnv, az as MidsceneYamlScriptEnvBase, aA as MidsceneYamlScriptWebEnv, i as MidsceneYamlTask, O as OnTaskStartTip, av as PageType, P as PartialInsightDumpFromSDK, V as PlanningAIResponse, T as PlanningAction, $ as PlanningActionParamAssert, a1 as PlanningActionParamError, X as PlanningActionParamHover, Z as PlanningActionParamInputOrKeyPress, Y as PlanningActionParamRightClick, _ as PlanningActionParamScroll, a0 as PlanningActionParamSleep, W as PlanningActionParamTap, a2 as PlanningActionParamWaitFor, S as PlanningLocateParam, a6 as PlaywrightParserOpt, a5 as PuppeteerParserOpt, ax as ReferenceImage, R as ReportDumpWithAttributes, aW as ScriptPlayerStatusValue, aV as ScriptPlayerTaskStatus, ay as scrollParam } from './types-b0b4c68e.js';
|
|
3
|
+
import { c as callAiFn } from './llm-planning-fe687364.js';
|
|
4
|
+
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-fe687364.js';
|
|
5
5
|
import { BaseElement, Rect } from '@midscene/shared/types';
|
|
6
6
|
export { BaseElement, ElementTreeNode, Point, Rect, Size } from '@midscene/shared/types';
|
|
7
7
|
export { getVersion } from './utils.js';
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL7JRT3WIjs = require('./chunk-L7JRT3WI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -171,7 +171,7 @@ ${_optionalChain([this, 'access', _7 => _7.latestErrorTask, 'call', _8 => _8(),
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
const dumpData = {
|
|
174
|
-
sdkVersion:
|
|
174
|
+
sdkVersion: _chunkL7JRT3WIjs.getVersion.call(void 0, ),
|
|
175
175
|
model_name: _env.getAIConfig.call(void 0, _env.MIDSCENE_MODEL_NAME) || "",
|
|
176
176
|
model_description: modelDescription,
|
|
177
177
|
logTime: Date.now(),
|
|
@@ -219,7 +219,7 @@ var _logger = require('@midscene/shared/logger');
|
|
|
219
219
|
|
|
220
220
|
function emitInsightDump(data, dumpSubscriber) {
|
|
221
221
|
const baseData = {
|
|
222
|
-
sdkVersion:
|
|
222
|
+
sdkVersion: _chunkL7JRT3WIjs.getVersion.call(void 0, ),
|
|
223
223
|
logTime: Date.now(),
|
|
224
224
|
model_name: _env.getAIConfig.call(void 0, _env.MIDSCENE_MODEL_NAME) || ""
|
|
225
225
|
};
|
|
@@ -531,6 +531,6 @@ var src_default = Insight;
|
|
|
531
531
|
|
|
532
532
|
|
|
533
533
|
|
|
534
|
-
exports.AiAssert = _chunkXBUGQGHZjs.AiAssert; exports.AiLocateElement = _chunkXBUGQGHZjs.AiLocateElement; exports.Executor = Executor; exports.Insight = Insight; exports.MIDSCENE_MODEL_NAME = _env.MIDSCENE_MODEL_NAME; exports.default = src_default; exports.describeUserPage = _chunkXBUGQGHZjs.describeUserPage; exports.getAIConfig = _env.getAIConfig; exports.getVersion =
|
|
534
|
+
exports.AiAssert = _chunkXBUGQGHZjs.AiAssert; exports.AiLocateElement = _chunkXBUGQGHZjs.AiLocateElement; exports.Executor = Executor; exports.Insight = Insight; exports.MIDSCENE_MODEL_NAME = _env.MIDSCENE_MODEL_NAME; exports.default = src_default; exports.describeUserPage = _chunkXBUGQGHZjs.describeUserPage; exports.getAIConfig = _env.getAIConfig; exports.getVersion = _chunkL7JRT3WIjs.getVersion; exports.plan = _chunkXBUGQGHZjs.plan;
|
|
535
535
|
|
|
536
536
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as AIUsageInfo, U as UIContext, ax as ReferenceImage, q as AIElementLocatorResponse, K as ElementById, g as InsightExtractOption, t as AIDataExtractionResponse, v as AIAssertionResponse, av as PageType, V as PlanningAIResponse } from './types-
|
|
1
|
+
import { l as AIUsageInfo, U as UIContext, ax as ReferenceImage, q as AIElementLocatorResponse, K as ElementById, g as InsightExtractOption, t as AIDataExtractionResponse, v as AIAssertionResponse, av as PageType, V as PlanningAIResponse } from './types-b0b4c68e.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -6,6 +6,7 @@ interface LocateOption {
|
|
|
6
6
|
prompt?: string;
|
|
7
7
|
deepThink?: boolean;
|
|
8
8
|
cacheable?: boolean;
|
|
9
|
+
xpath?: string;
|
|
9
10
|
}
|
|
10
11
|
interface InsightExtractOption {
|
|
11
12
|
domIncluded?: boolean | 'visible-only';
|
|
@@ -80,15 +81,19 @@ interface MidsceneYamlFlowItemAINumber extends InsightExtractOption {
|
|
|
80
81
|
aiNumber: string;
|
|
81
82
|
name?: string;
|
|
82
83
|
}
|
|
83
|
-
interface
|
|
84
|
+
interface MidsceneYamlFlowItemAIString extends InsightExtractOption {
|
|
84
85
|
aiString: string;
|
|
85
86
|
name?: string;
|
|
86
87
|
}
|
|
88
|
+
interface MidsceneYamlFlowItemAIAsk extends InsightExtractOption {
|
|
89
|
+
aiAsk: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
}
|
|
87
92
|
interface MidsceneYamlFlowItemAIBoolean extends InsightExtractOption {
|
|
88
93
|
aiBoolean: string;
|
|
89
94
|
name?: string;
|
|
90
95
|
}
|
|
91
|
-
interface MidsceneYamlFlowItemAILocate {
|
|
96
|
+
interface MidsceneYamlFlowItemAILocate extends LocateOption {
|
|
92
97
|
aiLocate: string;
|
|
93
98
|
name?: string;
|
|
94
99
|
}
|
|
@@ -388,9 +393,6 @@ interface ExecutorContext {
|
|
|
388
393
|
task: ExecutionTask;
|
|
389
394
|
element?: LocateResultElement | null;
|
|
390
395
|
}
|
|
391
|
-
interface TaskCacheInfo {
|
|
392
|
-
hit: boolean;
|
|
393
|
-
}
|
|
394
396
|
interface ExecutionTaskApply<Type extends ExecutionTaskType = any, TaskParam = any, TaskOutput = any, TaskLog = any> {
|
|
395
397
|
type: Type;
|
|
396
398
|
subType?: string;
|
|
@@ -400,11 +402,15 @@ interface ExecutionTaskApply<Type extends ExecutionTaskType = any, TaskParam = a
|
|
|
400
402
|
pageContext?: UIContext;
|
|
401
403
|
executor: (param: TaskParam, context: ExecutorContext) => Promise<ExecutionTaskReturn<TaskOutput, TaskLog> | undefined | void> | undefined | void;
|
|
402
404
|
}
|
|
405
|
+
interface ExecutionTaskHitBy {
|
|
406
|
+
from: string;
|
|
407
|
+
context: Record<string, any>;
|
|
408
|
+
}
|
|
403
409
|
interface ExecutionTaskReturn<TaskOutput = unknown, TaskLog = unknown> {
|
|
404
410
|
output?: TaskOutput;
|
|
405
411
|
log?: TaskLog;
|
|
406
412
|
recorder?: ExecutionRecorderItem[];
|
|
407
|
-
|
|
413
|
+
hitBy?: ExecutionTaskHitBy;
|
|
408
414
|
}
|
|
409
415
|
type ExecutionTask<E extends ExecutionTaskApply<any, any, any> = ExecutionTaskApply<any, any, any>> = E & ExecutionTaskReturn<E extends ExecutionTaskApply<any, any, infer TaskOutput, any> ? TaskOutput : unknown, E extends ExecutionTaskApply<any, any, any, infer TaskLog> ? TaskLog : unknown> & {
|
|
410
416
|
status: 'pending' | 'running' | 'finished' | 'failed' | 'cancelled';
|
|
@@ -462,4 +468,4 @@ interface GroupedActionDump {
|
|
|
462
468
|
}
|
|
463
469
|
type PageType = 'puppeteer' | 'playwright' | 'static' | 'chrome-extension-proxy' | 'android';
|
|
464
470
|
|
|
465
|
-
export { type PlanningActionParamAssert as $, type AIDescribeElementResponse as A, type InsightExtractParam as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type LocateResultElement as F, type DumpMeta as G, type InsightDump as H, type InsightAction as I, type LiteUISection as J, type ElementById as K, type LocateResult as L, type MidsceneYamlScript as M, type AgentWaitForOpt as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentAssertOpt as Q, type ReportDumpWithAttributes as R, type PlanningLocateParam as S, type PlanningAction as T, UIContext as U, type PlanningAIResponse as V, type PlanningActionParamTap as W, type PlanningActionParamHover as X, type PlanningActionParamRightClick as Y, type PlanningActionParamInputOrKeyPress as Z, type PlanningActionParamScroll as _, type ExecutionTaskProgressOptions as a, type PlanningActionParamSleep as a0, type PlanningActionParamError as a1, type PlanningActionParamWaitFor as a2, type Color as a3, type BaseAgentParserOpt as a4, type PuppeteerParserOpt as a5, type PlaywrightParserOpt as a6, type ExecutionRecorderItem as a7, type ExecutionTaskType as a8, type ExecutorContext as a9, type MidsceneYamlScriptWebEnv as aA, type MidsceneYamlScriptAndroidEnv as aB, type MidsceneYamlScriptEnv as aC, type MidsceneYamlFlowItemAIAction as aD, type MidsceneYamlFlowItemAIAssert as aE, type MidsceneYamlFlowItemAIQuery as aF, type MidsceneYamlFlowItemAINumber as aG, type
|
|
471
|
+
export { type PlanningActionParamAssert as $, type AIDescribeElementResponse as A, type InsightExtractParam as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type LocateResultElement as F, type DumpMeta as G, type InsightDump as H, type InsightAction as I, type LiteUISection as J, type ElementById as K, type LocateResult as L, type MidsceneYamlScript as M, type AgentWaitForOpt as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentAssertOpt as Q, type ReportDumpWithAttributes as R, type PlanningLocateParam as S, type PlanningAction as T, UIContext as U, type PlanningAIResponse as V, type PlanningActionParamTap as W, type PlanningActionParamHover as X, type PlanningActionParamRightClick as Y, type PlanningActionParamInputOrKeyPress as Z, type PlanningActionParamScroll as _, type ExecutionTaskProgressOptions as a, type PlanningActionParamSleep as a0, type PlanningActionParamError as a1, type PlanningActionParamWaitFor as a2, type Color as a3, type BaseAgentParserOpt as a4, type PuppeteerParserOpt as a5, type PlaywrightParserOpt as a6, type ExecutionRecorderItem as a7, type ExecutionTaskType as a8, type ExecutorContext as a9, type MidsceneYamlScriptWebEnv as aA, type MidsceneYamlScriptAndroidEnv as aB, type MidsceneYamlScriptEnv as aC, type MidsceneYamlFlowItemAIAction as aD, type MidsceneYamlFlowItemAIAssert as aE, type MidsceneYamlFlowItemAIQuery as aF, type MidsceneYamlFlowItemAINumber as aG, type MidsceneYamlFlowItemAIString as aH, type MidsceneYamlFlowItemAIAsk as aI, type MidsceneYamlFlowItemAIBoolean as aJ, type MidsceneYamlFlowItemAILocate as aK, type MidsceneYamlFlowItemAIWaitFor as aL, type MidsceneYamlFlowItemAITap as aM, type MidsceneYamlFlowItemAIHover as aN, type MidsceneYamlFlowItemAIInput as aO, type MidsceneYamlFlowItemAIKeyboardPress as aP, type MidsceneYamlFlowItemAIScroll as aQ, type MidsceneYamlFlowItemEvaluateJavaScript as aR, type MidsceneYamlFlowItemSleep as aS, type MidsceneYamlFlowItemLogScreenshot as aT, type FreeFn as aU, type ScriptPlayerTaskStatus as aV, type ScriptPlayerStatusValue as aW, type ExecutionTaskHitBy as aa, type ExecutionTaskReturn as ab, type ExecutionTaskInsightLocateParam as ac, type ExecutionTaskInsightLocateOutput as ad, type ExecutionTaskInsightDumpLog as ae, type ExecutionTaskInsightLocateApply as af, type ExecutionTaskInsightLocate as ag, type ExecutionTaskInsightQueryParam as ah, type ExecutionTaskInsightQueryOutput as ai, type ExecutionTaskInsightQueryApply as aj, type ExecutionTaskInsightQuery as ak, type ExecutionTaskInsightAssertionParam as al, type ExecutionTaskInsightAssertionApply as am, type ExecutionTaskInsightAssertion as an, type ExecutionTaskActionApply as ao, type ExecutionTaskAction as ap, type ExecutionTaskLogApply as aq, type ExecutionTaskLog as ar, type ExecutionTaskPlanningApply as as, type ExecutionTaskPlanning as at, type GroupedActionDump as au, type PageType as av, type LocateOption as aw, type ReferenceImage as ax, type scrollParam as ay, type MidsceneYamlScriptEnvBase as az, type ExecutionTaskApply as b, type ExecutionDump as c, type InsightTaskInfo as d, type InsightOptions as e, type DetailedLocateParam as f, type InsightExtractOption as g, type InsightAssertionResponse as h, type MidsceneYamlTask as i, type MidsceneYamlFlowItem as j, type MidsceneYamlFlowItemAIRightClick as k, type AIUsageInfo as l, AIResponseFormat as m, type AISingleElementResponseById as n, type AISingleElementResponseByPosition as o, type AISingleElementResponse as p, type AIElementLocatorResponse as q, type AIElementCoordinatesResponse as r, type AIElementResponse as s, type AIDataExtractionResponse as t, type AISectionLocatorResponse as u, type AIAssertionResponse as v, type LocatorValidatorOption as w, type LocateValidatorResult as x, type AgentDescribeElementAtPointResult as y, type EnsureObject as z };
|
package/dist/lib/utils.d.ts
CHANGED
package/dist/lib/utils.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkL7JRT3WIjs = require('./chunk-L7JRT3WI.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,4 +27,4 @@ var _chunkEK5ECFRXjs = require('./chunk-EK5ECFRX.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.getTmpDir =
|
|
30
|
+
exports.getTmpDir = _chunkL7JRT3WIjs.getTmpDir; exports.getTmpFile = _chunkL7JRT3WIjs.getTmpFile; exports.getVersion = _chunkL7JRT3WIjs.getVersion; exports.groupedActionDumpFileExt = _chunkL7JRT3WIjs.groupedActionDumpFileExt; exports.overlapped = _chunkL7JRT3WIjs.overlapped; exports.replaceStringWithFirstAppearance = _chunkL7JRT3WIjs.replaceStringWithFirstAppearance; exports.replacerForPageObject = _chunkL7JRT3WIjs.replacerForPageObject; exports.reportHTMLContent = _chunkL7JRT3WIjs.reportHTMLContent; exports.sleep = _chunkL7JRT3WIjs.sleep; exports.stringifyDumpData = _chunkL7JRT3WIjs.stringifyDumpData; exports.uploadTestInfoToServer = _chunkL7JRT3WIjs.uploadTestInfoToServer; exports.writeDumpReport = _chunkL7JRT3WIjs.writeDumpReport; exports.writeLogFile = _chunkL7JRT3WIjs.writeLogFile;
|
package/dist/types/ai-model.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as AIUsageInfo, T as PlanningAction, j as MidsceneYamlFlowItem } from './types-
|
|
1
|
+
import { l as AIUsageInfo, T as PlanningAction, j as MidsceneYamlFlowItem } from './types-b0b4c68e.js';
|
|
2
2
|
import OpenAI from 'openai';
|
|
3
3
|
import { ChatCompletionMessageParam } from 'openai/resources';
|
|
4
4
|
export { ChatCompletionMessageParam } from 'openai/resources';
|
|
5
|
-
import { b as AIActionType } from './llm-planning-
|
|
6
|
-
export { a as AiAssert, f as AiExtractElementInfo, A as AiLocateElement, g as AiLocateSection, h as adaptBboxToRect, c as callAiFn, d as describeUserPage, e as elementByPositionWithElementInfo, p as plan } from './llm-planning-
|
|
5
|
+
import { b as AIActionType } from './llm-planning-fe687364.js';
|
|
6
|
+
export { a as AiAssert, f as AiExtractElementInfo, A as AiLocateElement, g as AiLocateSection, h as adaptBboxToRect, c as callAiFn, d as describeUserPage, e as elementByPositionWithElementInfo, p as plan } from './llm-planning-fe687364.js';
|
|
7
7
|
import { vlLocateMode } from '@midscene/shared/env';
|
|
8
8
|
import { ChromeRecordedEvent as ChromeRecordedEvent$1 } from '@midscene/recorder';
|
|
9
9
|
import { actionParser } from '@ui-tars/action-parser';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-
|
|
2
|
-
export { v as AIAssertionResponse, t as AIDataExtractionResponse, r as AIElementCoordinatesResponse, q as AIElementLocatorResponse, s as AIElementResponse, m as AIResponseFormat, u as AISectionLocatorResponse, p as AISingleElementResponse, n as AISingleElementResponseById, o as AISingleElementResponseByPosition, l as AIUsageInfo, Q as AgentAssertOpt, y as AgentDescribeElementAtPointResult, N as AgentWaitForOpt, a4 as BaseAgentParserOpt, C as CallAIFn, a3 as Color, G as DumpMeta, K as ElementById, z as EnsureObject, a7 as ExecutionRecorderItem, ap as ExecutionTaskAction, ao as ExecutionTaskActionApply, an as ExecutionTaskInsightAssertion, am as ExecutionTaskInsightAssertionApply, al as ExecutionTaskInsightAssertionParam, ae as ExecutionTaskInsightDumpLog, ag as ExecutionTaskInsightLocate, af as ExecutionTaskInsightLocateApply, ad as ExecutionTaskInsightLocateOutput, ac as ExecutionTaskInsightLocateParam, ak as ExecutionTaskInsightQuery, aj as ExecutionTaskInsightQueryApply, ai as ExecutionTaskInsightQueryOutput, ah as ExecutionTaskInsightQueryParam, ar as ExecutionTaskLog, aq as ExecutionTaskLogApply, at as ExecutionTaskPlanning, as as ExecutionTaskPlanningApply, ab as ExecutionTaskReturn, a8 as ExecutionTaskType, a9 as ExecutorContext,
|
|
3
|
-
import { c as callAiFn } from './llm-planning-
|
|
4
|
-
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-
|
|
1
|
+
import { E as ExecutionTask, a as ExecutionTaskProgressOptions, b as ExecutionTaskApply, c as ExecutionDump, U as UIContext, I as InsightAction, D as DumpSubscriber, d as InsightTaskInfo, e as InsightOptions, f as DetailedLocateParam, L as LocateResult, g as InsightExtractOption, h as InsightAssertionResponse, A as AIDescribeElementResponse } from './types-b0b4c68e.js';
|
|
2
|
+
export { v as AIAssertionResponse, t as AIDataExtractionResponse, r as AIElementCoordinatesResponse, q as AIElementLocatorResponse, s as AIElementResponse, m as AIResponseFormat, u as AISectionLocatorResponse, p as AISingleElementResponse, n as AISingleElementResponseById, o as AISingleElementResponseByPosition, l as AIUsageInfo, Q as AgentAssertOpt, y as AgentDescribeElementAtPointResult, N as AgentWaitForOpt, a4 as BaseAgentParserOpt, C as CallAIFn, a3 as Color, G as DumpMeta, K as ElementById, z as EnsureObject, a7 as ExecutionRecorderItem, ap as ExecutionTaskAction, ao as ExecutionTaskActionApply, aa as ExecutionTaskHitBy, an as ExecutionTaskInsightAssertion, am as ExecutionTaskInsightAssertionApply, al as ExecutionTaskInsightAssertionParam, ae as ExecutionTaskInsightDumpLog, ag as ExecutionTaskInsightLocate, af as ExecutionTaskInsightLocateApply, ad as ExecutionTaskInsightLocateOutput, ac as ExecutionTaskInsightLocateParam, ak as ExecutionTaskInsightQuery, aj as ExecutionTaskInsightQueryApply, ai as ExecutionTaskInsightQueryOutput, ah as ExecutionTaskInsightQueryParam, ar as ExecutionTaskLog, aq as ExecutionTaskLogApply, at as ExecutionTaskPlanning, as as ExecutionTaskPlanningApply, ab as ExecutionTaskReturn, a8 as ExecutionTaskType, a9 as ExecutorContext, aU as FreeFn, au as GroupedActionDump, H as InsightDump, B as InsightExtractParam, J as LiteUISection, aw as LocateOption, F as LocateResultElement, x as LocateValidatorResult, w as LocatorValidatorOption, j as MidsceneYamlFlowItem, aD as MidsceneYamlFlowItemAIAction, aI as MidsceneYamlFlowItemAIAsk, aE as MidsceneYamlFlowItemAIAssert, aJ as MidsceneYamlFlowItemAIBoolean, aN as MidsceneYamlFlowItemAIHover, aO as MidsceneYamlFlowItemAIInput, aP as MidsceneYamlFlowItemAIKeyboardPress, aK as MidsceneYamlFlowItemAILocate, aG as MidsceneYamlFlowItemAINumber, aF as MidsceneYamlFlowItemAIQuery, k as MidsceneYamlFlowItemAIRightClick, aQ as MidsceneYamlFlowItemAIScroll, aH as MidsceneYamlFlowItemAIString, aM as MidsceneYamlFlowItemAITap, aL as MidsceneYamlFlowItemAIWaitFor, aR as MidsceneYamlFlowItemEvaluateJavaScript, aT as MidsceneYamlFlowItemLogScreenshot, aS as MidsceneYamlFlowItemSleep, M as MidsceneYamlScript, aB as MidsceneYamlScriptAndroidEnv, aC as MidsceneYamlScriptEnv, az as MidsceneYamlScriptEnvBase, aA as MidsceneYamlScriptWebEnv, i as MidsceneYamlTask, O as OnTaskStartTip, av as PageType, P as PartialInsightDumpFromSDK, V as PlanningAIResponse, T as PlanningAction, $ as PlanningActionParamAssert, a1 as PlanningActionParamError, X as PlanningActionParamHover, Z as PlanningActionParamInputOrKeyPress, Y as PlanningActionParamRightClick, _ as PlanningActionParamScroll, a0 as PlanningActionParamSleep, W as PlanningActionParamTap, a2 as PlanningActionParamWaitFor, S as PlanningLocateParam, a6 as PlaywrightParserOpt, a5 as PuppeteerParserOpt, ax as ReferenceImage, R as ReportDumpWithAttributes, aW as ScriptPlayerStatusValue, aV as ScriptPlayerTaskStatus, ay as scrollParam } from './types-b0b4c68e.js';
|
|
3
|
+
import { c as callAiFn } from './llm-planning-fe687364.js';
|
|
4
|
+
export { a as AiAssert, A as AiLocateElement, d as describeUserPage, p as plan } from './llm-planning-fe687364.js';
|
|
5
5
|
import { BaseElement, Rect } from '@midscene/shared/types';
|
|
6
6
|
export { BaseElement, ElementTreeNode, Point, Rect, Size } from '@midscene/shared/types';
|
|
7
7
|
export { getVersion } from './utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as AIUsageInfo, U as UIContext, ax as ReferenceImage, q as AIElementLocatorResponse, K as ElementById, g as InsightExtractOption, t as AIDataExtractionResponse, v as AIAssertionResponse, av as PageType, V as PlanningAIResponse } from './types-
|
|
1
|
+
import { l as AIUsageInfo, U as UIContext, ax as ReferenceImage, q as AIElementLocatorResponse, K as ElementById, g as InsightExtractOption, t as AIDataExtractionResponse, v as AIAssertionResponse, av as PageType, V as PlanningAIResponse } from './types-b0b4c68e.js';
|
|
2
2
|
import { Rect, ElementTreeNode, BaseElement } from '@midscene/shared/types';
|
|
3
3
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';
|
|
4
4
|
|
|
@@ -6,6 +6,7 @@ interface LocateOption {
|
|
|
6
6
|
prompt?: string;
|
|
7
7
|
deepThink?: boolean;
|
|
8
8
|
cacheable?: boolean;
|
|
9
|
+
xpath?: string;
|
|
9
10
|
}
|
|
10
11
|
interface InsightExtractOption {
|
|
11
12
|
domIncluded?: boolean | 'visible-only';
|
|
@@ -80,15 +81,19 @@ interface MidsceneYamlFlowItemAINumber extends InsightExtractOption {
|
|
|
80
81
|
aiNumber: string;
|
|
81
82
|
name?: string;
|
|
82
83
|
}
|
|
83
|
-
interface
|
|
84
|
+
interface MidsceneYamlFlowItemAIString extends InsightExtractOption {
|
|
84
85
|
aiString: string;
|
|
85
86
|
name?: string;
|
|
86
87
|
}
|
|
88
|
+
interface MidsceneYamlFlowItemAIAsk extends InsightExtractOption {
|
|
89
|
+
aiAsk: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
}
|
|
87
92
|
interface MidsceneYamlFlowItemAIBoolean extends InsightExtractOption {
|
|
88
93
|
aiBoolean: string;
|
|
89
94
|
name?: string;
|
|
90
95
|
}
|
|
91
|
-
interface MidsceneYamlFlowItemAILocate {
|
|
96
|
+
interface MidsceneYamlFlowItemAILocate extends LocateOption {
|
|
92
97
|
aiLocate: string;
|
|
93
98
|
name?: string;
|
|
94
99
|
}
|
|
@@ -388,9 +393,6 @@ interface ExecutorContext {
|
|
|
388
393
|
task: ExecutionTask;
|
|
389
394
|
element?: LocateResultElement | null;
|
|
390
395
|
}
|
|
391
|
-
interface TaskCacheInfo {
|
|
392
|
-
hit: boolean;
|
|
393
|
-
}
|
|
394
396
|
interface ExecutionTaskApply<Type extends ExecutionTaskType = any, TaskParam = any, TaskOutput = any, TaskLog = any> {
|
|
395
397
|
type: Type;
|
|
396
398
|
subType?: string;
|
|
@@ -400,11 +402,15 @@ interface ExecutionTaskApply<Type extends ExecutionTaskType = any, TaskParam = a
|
|
|
400
402
|
pageContext?: UIContext;
|
|
401
403
|
executor: (param: TaskParam, context: ExecutorContext) => Promise<ExecutionTaskReturn<TaskOutput, TaskLog> | undefined | void> | undefined | void;
|
|
402
404
|
}
|
|
405
|
+
interface ExecutionTaskHitBy {
|
|
406
|
+
from: string;
|
|
407
|
+
context: Record<string, any>;
|
|
408
|
+
}
|
|
403
409
|
interface ExecutionTaskReturn<TaskOutput = unknown, TaskLog = unknown> {
|
|
404
410
|
output?: TaskOutput;
|
|
405
411
|
log?: TaskLog;
|
|
406
412
|
recorder?: ExecutionRecorderItem[];
|
|
407
|
-
|
|
413
|
+
hitBy?: ExecutionTaskHitBy;
|
|
408
414
|
}
|
|
409
415
|
type ExecutionTask<E extends ExecutionTaskApply<any, any, any> = ExecutionTaskApply<any, any, any>> = E & ExecutionTaskReturn<E extends ExecutionTaskApply<any, any, infer TaskOutput, any> ? TaskOutput : unknown, E extends ExecutionTaskApply<any, any, any, infer TaskLog> ? TaskLog : unknown> & {
|
|
410
416
|
status: 'pending' | 'running' | 'finished' | 'failed' | 'cancelled';
|
|
@@ -462,4 +468,4 @@ interface GroupedActionDump {
|
|
|
462
468
|
}
|
|
463
469
|
type PageType = 'puppeteer' | 'playwright' | 'static' | 'chrome-extension-proxy' | 'android';
|
|
464
470
|
|
|
465
|
-
export { type PlanningActionParamAssert as $, type AIDescribeElementResponse as A, type InsightExtractParam as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type LocateResultElement as F, type DumpMeta as G, type InsightDump as H, type InsightAction as I, type LiteUISection as J, type ElementById as K, type LocateResult as L, type MidsceneYamlScript as M, type AgentWaitForOpt as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentAssertOpt as Q, type ReportDumpWithAttributes as R, type PlanningLocateParam as S, type PlanningAction as T, UIContext as U, type PlanningAIResponse as V, type PlanningActionParamTap as W, type PlanningActionParamHover as X, type PlanningActionParamRightClick as Y, type PlanningActionParamInputOrKeyPress as Z, type PlanningActionParamScroll as _, type ExecutionTaskProgressOptions as a, type PlanningActionParamSleep as a0, type PlanningActionParamError as a1, type PlanningActionParamWaitFor as a2, type Color as a3, type BaseAgentParserOpt as a4, type PuppeteerParserOpt as a5, type PlaywrightParserOpt as a6, type ExecutionRecorderItem as a7, type ExecutionTaskType as a8, type ExecutorContext as a9, type MidsceneYamlScriptWebEnv as aA, type MidsceneYamlScriptAndroidEnv as aB, type MidsceneYamlScriptEnv as aC, type MidsceneYamlFlowItemAIAction as aD, type MidsceneYamlFlowItemAIAssert as aE, type MidsceneYamlFlowItemAIQuery as aF, type MidsceneYamlFlowItemAINumber as aG, type
|
|
471
|
+
export { type PlanningActionParamAssert as $, type AIDescribeElementResponse as A, type InsightExtractParam as B, type CallAIFn as C, type DumpSubscriber as D, type ExecutionTask as E, type LocateResultElement as F, type DumpMeta as G, type InsightDump as H, type InsightAction as I, type LiteUISection as J, type ElementById as K, type LocateResult as L, type MidsceneYamlScript as M, type AgentWaitForOpt as N, type OnTaskStartTip as O, type PartialInsightDumpFromSDK as P, type AgentAssertOpt as Q, type ReportDumpWithAttributes as R, type PlanningLocateParam as S, type PlanningAction as T, UIContext as U, type PlanningAIResponse as V, type PlanningActionParamTap as W, type PlanningActionParamHover as X, type PlanningActionParamRightClick as Y, type PlanningActionParamInputOrKeyPress as Z, type PlanningActionParamScroll as _, type ExecutionTaskProgressOptions as a, type PlanningActionParamSleep as a0, type PlanningActionParamError as a1, type PlanningActionParamWaitFor as a2, type Color as a3, type BaseAgentParserOpt as a4, type PuppeteerParserOpt as a5, type PlaywrightParserOpt as a6, type ExecutionRecorderItem as a7, type ExecutionTaskType as a8, type ExecutorContext as a9, type MidsceneYamlScriptWebEnv as aA, type MidsceneYamlScriptAndroidEnv as aB, type MidsceneYamlScriptEnv as aC, type MidsceneYamlFlowItemAIAction as aD, type MidsceneYamlFlowItemAIAssert as aE, type MidsceneYamlFlowItemAIQuery as aF, type MidsceneYamlFlowItemAINumber as aG, type MidsceneYamlFlowItemAIString as aH, type MidsceneYamlFlowItemAIAsk as aI, type MidsceneYamlFlowItemAIBoolean as aJ, type MidsceneYamlFlowItemAILocate as aK, type MidsceneYamlFlowItemAIWaitFor as aL, type MidsceneYamlFlowItemAITap as aM, type MidsceneYamlFlowItemAIHover as aN, type MidsceneYamlFlowItemAIInput as aO, type MidsceneYamlFlowItemAIKeyboardPress as aP, type MidsceneYamlFlowItemAIScroll as aQ, type MidsceneYamlFlowItemEvaluateJavaScript as aR, type MidsceneYamlFlowItemSleep as aS, type MidsceneYamlFlowItemLogScreenshot as aT, type FreeFn as aU, type ScriptPlayerTaskStatus as aV, type ScriptPlayerStatusValue as aW, type ExecutionTaskHitBy as aa, type ExecutionTaskReturn as ab, type ExecutionTaskInsightLocateParam as ac, type ExecutionTaskInsightLocateOutput as ad, type ExecutionTaskInsightDumpLog as ae, type ExecutionTaskInsightLocateApply as af, type ExecutionTaskInsightLocate as ag, type ExecutionTaskInsightQueryParam as ah, type ExecutionTaskInsightQueryOutput as ai, type ExecutionTaskInsightQueryApply as aj, type ExecutionTaskInsightQuery as ak, type ExecutionTaskInsightAssertionParam as al, type ExecutionTaskInsightAssertionApply as am, type ExecutionTaskInsightAssertion as an, type ExecutionTaskActionApply as ao, type ExecutionTaskAction as ap, type ExecutionTaskLogApply as aq, type ExecutionTaskLog as ar, type ExecutionTaskPlanningApply as as, type ExecutionTaskPlanning as at, type GroupedActionDump as au, type PageType as av, type LocateOption as aw, type ReferenceImage as ax, type scrollParam as ay, type MidsceneYamlScriptEnvBase as az, type ExecutionTaskApply as b, type ExecutionDump as c, type InsightTaskInfo as d, type InsightOptions as e, type DetailedLocateParam as f, type InsightExtractOption as g, type InsightAssertionResponse as h, type MidsceneYamlTask as i, type MidsceneYamlFlowItem as j, type MidsceneYamlFlowItemAIRightClick as k, type AIUsageInfo as l, AIResponseFormat as m, type AISingleElementResponseById as n, type AISingleElementResponseByPosition as o, type AISingleElementResponse as p, type AIElementLocatorResponse as q, type AIElementCoordinatesResponse as r, type AIElementResponse as s, type AIDataExtractionResponse as t, type AISectionLocatorResponse as u, type AIAssertionResponse as v, type LocatorValidatorOption as w, type LocateValidatorResult as x, type AgentDescribeElementAtPointResult as y, type EnsureObject as z };
|
package/dist/types/utils.d.ts
CHANGED
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.
|
|
4
|
+
"version": "0.20.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"jsnext:source": "./src/index.ts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"langsmith": "0.3.7",
|
|
45
45
|
"openai": "4.81.0",
|
|
46
46
|
"socks-proxy-agent": "8.0.4",
|
|
47
|
-
"@midscene/shared": "0.
|
|
48
|
-
"@midscene/recorder": "0.
|
|
47
|
+
"@midscene/shared": "0.20.0",
|
|
48
|
+
"@midscene/recorder": "0.20.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@modern-js/module-tools": "2.60.6",
|
|
File without changes
|
|
File without changes
|