@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/es/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/es/index.js
CHANGED
|
@@ -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/es/utils.d.ts
CHANGED
package/dist/es/utils.js
CHANGED
package/dist/lib/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';
|