@midscene/core 0.26.5-beta-20250814095614.0 → 0.26.5-beta-20250814125155.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/action-executor.mjs +139 -0
- package/dist/es/ai-model/action-executor.mjs.map +1 -0
- package/dist/es/ai-model/common.mjs +219 -0
- package/dist/es/ai-model/common.mjs.map +1 -0
- package/dist/es/ai-model/index.mjs +10 -0
- package/dist/es/ai-model/inspect.mjs +317 -0
- package/dist/es/ai-model/inspect.mjs.map +1 -0
- package/dist/es/ai-model/llm-planning.mjs +85 -0
- package/dist/es/ai-model/llm-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/assertion.mjs +55 -0
- package/dist/es/ai-model/prompt/assertion.mjs.map +1 -0
- package/dist/es/ai-model/prompt/common.mjs +7 -0
- package/dist/es/ai-model/prompt/common.mjs.map +1 -0
- package/dist/es/ai-model/prompt/describe.mjs +44 -0
- package/dist/es/ai-model/prompt/describe.mjs.map +1 -0
- package/dist/es/ai-model/prompt/extraction.mjs +137 -0
- package/dist/es/ai-model/prompt/extraction.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs +275 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs +359 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs +47 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/playwright-generator.mjs +117 -0
- package/dist/es/ai-model/prompt/playwright-generator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/ui-tars-locator.mjs +34 -0
- package/dist/es/ai-model/prompt/ui-tars-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/ui-tars-planning.mjs +36 -0
- package/dist/es/ai-model/prompt/ui-tars-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/util.mjs +123 -0
- package/dist/es/ai-model/prompt/util.mjs.map +1 -0
- package/dist/es/ai-model/prompt/yaml-generator.mjs +219 -0
- package/dist/es/ai-model/prompt/yaml-generator.mjs.map +1 -0
- package/dist/es/ai-model/service-caller/index.mjs +413 -0
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -0
- package/dist/es/ai-model/ui-tars-planning.mjs +235 -0
- package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -0
- package/dist/es/image/index.mjs +2 -0
- package/dist/es/index.mjs +7 -2360
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/insight/index.mjs +261 -0
- package/dist/es/insight/index.mjs.map +1 -0
- package/dist/es/insight/utils.mjs +19 -0
- package/dist/es/insight/utils.mjs.map +1 -0
- package/dist/es/types.mjs +11 -0
- package/dist/es/types.mjs.map +1 -0
- package/dist/es/utils.mjs +2 -2
- package/dist/es/yaml.mjs +0 -0
- package/dist/lib/ai-model/action-executor.js +173 -0
- package/dist/lib/ai-model/action-executor.js.map +1 -0
- package/dist/lib/ai-model/common.js +289 -0
- package/dist/lib/ai-model/common.js.map +1 -0
- package/dist/lib/ai-model/index.js +103 -0
- package/dist/lib/ai-model/index.js.map +1 -0
- package/dist/lib/ai-model/inspect.js +360 -0
- package/dist/lib/ai-model/inspect.js.map +1 -0
- package/dist/lib/ai-model/llm-planning.js +119 -0
- package/dist/lib/ai-model/llm-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/assertion.js +92 -0
- package/dist/lib/ai-model/prompt/assertion.js.map +1 -0
- package/dist/lib/ai-model/prompt/common.js +41 -0
- package/dist/lib/ai-model/prompt/common.js.map +1 -0
- package/dist/lib/ai-model/prompt/describe.js +78 -0
- package/dist/lib/ai-model/prompt/describe.js.map +1 -0
- package/dist/lib/ai-model/prompt/extraction.js +177 -0
- package/dist/lib/ai-model/prompt/extraction.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-locator.js +315 -0
- package/dist/lib/ai-model/prompt/llm-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-planning.js +415 -0
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js +84 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/playwright-generator.js +178 -0
- package/dist/lib/ai-model/prompt/playwright-generator.js.map +1 -0
- package/dist/lib/ai-model/prompt/ui-tars-locator.js +68 -0
- package/dist/lib/ai-model/prompt/ui-tars-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/ui-tars-planning.js +73 -0
- package/dist/lib/ai-model/prompt/ui-tars-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/util.js +175 -0
- package/dist/lib/ai-model/prompt/util.js.map +1 -0
- package/dist/lib/ai-model/prompt/yaml-generator.js +280 -0
- package/dist/lib/ai-model/prompt/yaml-generator.js.map +1 -0
- package/dist/lib/ai-model/service-caller/index.js +496 -0
- package/dist/lib/ai-model/service-caller/index.js.map +1 -0
- package/dist/lib/ai-model/ui-tars-planning.js +272 -0
- package/dist/lib/ai-model/ui-tars-planning.js.map +1 -0
- package/dist/lib/image/index.js +56 -0
- package/dist/lib/image/index.js.map +1 -0
- package/dist/lib/index.js +21 -2393
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/insight/index.js +295 -0
- package/dist/lib/insight/index.js.map +1 -0
- package/dist/lib/insight/utils.js +53 -0
- package/dist/lib/insight/utils.js.map +1 -0
- package/dist/lib/types.js +82 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.js +2 -2
- package/dist/lib/yaml.js +20 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/types/ai-model/action-executor.d.ts +19 -0
- package/dist/types/ai-model/common.d.ts +34 -0
- package/dist/types/ai-model/index.d.ts +11 -0
- package/dist/types/ai-model/inspect.d.ts +49 -0
- package/dist/types/ai-model/llm-planning.d.ts +10 -0
- package/dist/types/ai-model/prompt/assertion.d.ts +5 -0
- package/dist/types/ai-model/prompt/common.d.ts +2 -0
- package/dist/types/ai-model/prompt/describe.d.ts +1 -0
- package/dist/types/ai-model/prompt/extraction.d.ts +4 -0
- package/dist/types/ai-model/prompt/llm-locator.d.ts +9 -0
- package/dist/types/ai-model/prompt/llm-planning.d.ts +15 -0
- package/dist/types/ai-model/prompt/llm-section-locator.d.ts +6 -0
- package/dist/types/ai-model/prompt/playwright-generator.d.ts +25 -0
- package/dist/types/ai-model/prompt/ui-tars-locator.d.ts +1 -0
- package/dist/types/ai-model/prompt/ui-tars-planning.d.ts +2 -0
- package/dist/types/ai-model/prompt/util.d.ts +45 -0
- package/dist/types/ai-model/prompt/yaml-generator.d.ts +99 -0
- package/dist/types/ai-model/service-caller/index.d.ts +26 -0
- package/dist/types/ai-model/ui-tars-planning.d.ts +76 -0
- package/dist/types/image/index.d.ts +1 -0
- package/dist/types/index.d.ts +9 -1289
- package/dist/types/insight/index.d.ts +26 -0
- package/dist/types/insight/utils.d.ts +2 -0
- package/dist/types/tree.d.ts +1 -11
- package/dist/types/types.d.ts +399 -0
- package/dist/types/utils.d.ts +27 -47
- package/dist/types/yaml.d.ts +172 -0
- package/package.json +6 -6
- package/dist/es/ai-model.mjs +0 -2502
- package/dist/es/ai-model.mjs.map +0 -1
- package/dist/lib/ai-model.js +0 -2622
- package/dist/lib/ai-model.js.map +0 -1
- package/dist/types/ai-model.d.ts +0 -596
package/dist/types/index.d.ts
CHANGED
|
@@ -1,1289 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { Rect } from '@midscene/shared/types';
|
|
11
|
-
import { Size } from '@midscene/shared/types';
|
|
12
|
-
|
|
13
|
-
export declare interface AgentAssertOpt {
|
|
14
|
-
keepRawResponse?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export declare interface AgentDescribeElementAtPointResult {
|
|
18
|
-
prompt: string;
|
|
19
|
-
deepThink: boolean;
|
|
20
|
-
verifyResult?: LocateValidatorResult;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export declare interface AgentWaitForOpt {
|
|
24
|
-
checkIntervalMs?: number;
|
|
25
|
-
timeoutMs?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare enum AIActionType {
|
|
29
|
-
ASSERT = 0,
|
|
30
|
-
INSPECT_ELEMENT = 1,
|
|
31
|
-
EXTRACT_DATA = 2,
|
|
32
|
-
PLAN = 3,
|
|
33
|
-
DESCRIBE_ELEMENT = 4
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
declare enum AIActionType_2 {
|
|
37
|
-
ASSERT = 0,
|
|
38
|
-
INSPECT_ELEMENT = 1,
|
|
39
|
-
EXTRACT_DATA = 2,
|
|
40
|
-
PLAN = 3,
|
|
41
|
-
DESCRIBE_ELEMENT = 4,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare type AIArgs = [
|
|
45
|
-
ChatCompletionSystemMessageParam,
|
|
46
|
-
...ChatCompletionUserMessageParam[]
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
declare type AIArgs_2 = [
|
|
50
|
-
ChatCompletionSystemMessageParam,
|
|
51
|
-
...ChatCompletionUserMessageParam[],
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export declare function AiAssert<ElementType extends BaseElement = BaseElement>(options: {
|
|
55
|
-
assertion: TUserPrompt_2;
|
|
56
|
-
context: UIContext_2<ElementType>;
|
|
57
|
-
}): Promise<{
|
|
58
|
-
content: AIAssertionResponse_2;
|
|
59
|
-
usage: AIUsageInfo_2 | undefined;
|
|
60
|
-
}>;
|
|
61
|
-
|
|
62
|
-
export declare interface AIAssertionResponse {
|
|
63
|
-
pass: boolean;
|
|
64
|
-
thought: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
declare interface AIAssertionResponse_2 {
|
|
68
|
-
pass: boolean;
|
|
69
|
-
thought: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export declare interface AIDataExtractionResponse<DataDemand> {
|
|
73
|
-
data: DataDemand;
|
|
74
|
-
errors?: string[];
|
|
75
|
-
thought?: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export declare interface AIDescribeElementResponse {
|
|
79
|
-
description: string;
|
|
80
|
-
error?: string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
declare interface AIDescribeElementResponse_2 {
|
|
84
|
-
description: string;
|
|
85
|
-
error?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export declare interface AIElementCoordinatesResponse {
|
|
89
|
-
bbox: [number, number, number, number];
|
|
90
|
-
isOrderSensitive?: boolean;
|
|
91
|
-
errors?: string[];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
declare interface AIElementCoordinatesResponse_2 {
|
|
95
|
-
bbox: [number, number, number, number];
|
|
96
|
-
isOrderSensitive?: boolean;
|
|
97
|
-
errors?: string[];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export declare interface AIElementLocatorResponse {
|
|
101
|
-
elements: {
|
|
102
|
-
id: string;
|
|
103
|
-
reason?: string;
|
|
104
|
-
text?: string;
|
|
105
|
-
xpaths?: string[];
|
|
106
|
-
}[];
|
|
107
|
-
bbox?: [number, number, number, number];
|
|
108
|
-
isOrderSensitive?: boolean;
|
|
109
|
-
errors?: string[];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
declare interface AIElementLocatorResponse_2 {
|
|
113
|
-
elements: {
|
|
114
|
-
id: string;
|
|
115
|
-
reason?: string;
|
|
116
|
-
text?: string;
|
|
117
|
-
xpaths?: string[];
|
|
118
|
-
}[];
|
|
119
|
-
bbox?: [number, number, number, number];
|
|
120
|
-
isOrderSensitive?: boolean;
|
|
121
|
-
errors?: string[];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export declare type AIElementResponse = AIElementLocatorResponse | AIElementCoordinatesResponse;
|
|
125
|
-
|
|
126
|
-
declare type AIElementResponse_2 =
|
|
127
|
-
| AIElementLocatorResponse_2
|
|
128
|
-
| AIElementCoordinatesResponse_2;
|
|
129
|
-
|
|
130
|
-
export declare function AiLocateElement<ElementType extends BaseElement = BaseElement>(options: {
|
|
131
|
-
context: UIContext_2<ElementType>;
|
|
132
|
-
targetElementDescription: TUserPrompt_2;
|
|
133
|
-
referenceImage?: ReferenceImage_2;
|
|
134
|
-
callAI?: typeof callAiFn<AIElementResponse_2 | [number, number]>;
|
|
135
|
-
searchConfig?: Awaited<ReturnType<typeof AiLocateSection>>;
|
|
136
|
-
}): Promise<{
|
|
137
|
-
parseResult: AIElementLocatorResponse_2;
|
|
138
|
-
rect?: Rect;
|
|
139
|
-
rawResponse: string;
|
|
140
|
-
elementById: ElementById_2;
|
|
141
|
-
usage?: AIUsageInfo_2;
|
|
142
|
-
isOrderSensitive?: boolean;
|
|
143
|
-
}>;
|
|
144
|
-
|
|
145
|
-
declare function AiLocateSection(options: {
|
|
146
|
-
context: UIContext_2<BaseElement>;
|
|
147
|
-
sectionDescription: TUserPrompt_2;
|
|
148
|
-
callAI?: typeof callAiFn<AISectionLocatorResponse_2>;
|
|
149
|
-
}): Promise<{
|
|
150
|
-
rect?: Rect;
|
|
151
|
-
imageBase64?: string;
|
|
152
|
-
error?: string;
|
|
153
|
-
rawResponse: string;
|
|
154
|
-
usage?: AIUsageInfo_2;
|
|
155
|
-
}>;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* openai
|
|
159
|
-
*
|
|
160
|
-
*/
|
|
161
|
-
export declare enum AIResponseFormat {
|
|
162
|
-
JSON = "json_object",
|
|
163
|
-
TEXT = "text"
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export declare interface AISectionLocatorResponse {
|
|
167
|
-
bbox: [number, number, number, number];
|
|
168
|
-
references_bbox?: [number, number, number, number][];
|
|
169
|
-
error?: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
declare interface AISectionLocatorResponse_2 {
|
|
173
|
-
bbox: [number, number, number, number];
|
|
174
|
-
references_bbox?: [number, number, number, number][];
|
|
175
|
-
error?: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export declare type AISingleElementResponse = AISingleElementResponseById;
|
|
179
|
-
|
|
180
|
-
export declare type AISingleElementResponseById = {
|
|
181
|
-
id: string;
|
|
182
|
-
reason?: string;
|
|
183
|
-
text?: string;
|
|
184
|
-
xpaths?: string[];
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export declare type AISingleElementResponseByPosition = {
|
|
188
|
-
position?: {
|
|
189
|
-
x: number;
|
|
190
|
-
y: number;
|
|
191
|
-
};
|
|
192
|
-
bbox?: [number, number, number, number];
|
|
193
|
-
reason: string;
|
|
194
|
-
text: string;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export declare type AIUsageInfo = Record<string, any> & {
|
|
198
|
-
prompt_tokens: number | undefined;
|
|
199
|
-
completion_tokens: number | undefined;
|
|
200
|
-
total_tokens: number | undefined;
|
|
201
|
-
time_cost: number | undefined;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
declare type AIUsageInfo_2 = Record<string, any> & {
|
|
205
|
-
prompt_tokens: number | undefined;
|
|
206
|
-
completion_tokens: number | undefined;
|
|
207
|
-
total_tokens: number | undefined;
|
|
208
|
-
time_cost: number | undefined;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
export declare interface AndroidLongPressParam {
|
|
212
|
-
duration?: number;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export declare interface AndroidPullParam {
|
|
216
|
-
direction: 'up' | 'down';
|
|
217
|
-
distance?: number;
|
|
218
|
-
duration?: number;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export declare interface BaseAgentParserOpt {
|
|
222
|
-
selector?: string;
|
|
223
|
-
ignoreMarker?: boolean;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export { BaseElement }
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* insight
|
|
230
|
-
*/
|
|
231
|
-
export declare type CallAIFn = <T>(messages: ChatCompletionMessageParam[]) => Promise<T>;
|
|
232
|
-
|
|
233
|
-
declare function callAiFn<T>(msgs: AIArgs, AIActionTypeValue: AIActionType): Promise<{
|
|
234
|
-
content: T;
|
|
235
|
-
usage?: AIUsageInfo_2;
|
|
236
|
-
}>;
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* insight
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
declare type CallAIFn_2 = <T>(
|
|
243
|
-
messages: ChatCompletionMessageParam[],
|
|
244
|
-
) => Promise<T>;
|
|
245
|
-
|
|
246
|
-
declare async function callAiFn_2<T>(
|
|
247
|
-
msgs: AIArgs_2,
|
|
248
|
-
AIActionTypeValue: AIActionType_2,
|
|
249
|
-
): Promise<{ content: T; usage?: AIUsageInfo_2 }> {
|
|
250
|
-
const jsonObject = await callToGetJSONObject<T>(msgs, AIActionTypeValue);
|
|
251
|
-
|
|
252
|
-
return {
|
|
253
|
-
content: jsonObject.content,
|
|
254
|
-
usage: jsonObject.usage,
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export declare interface CodeGenerationChunk {
|
|
259
|
-
/** The incremental content chunk */
|
|
260
|
-
content: string;
|
|
261
|
-
/** The reasoning content */
|
|
262
|
-
reasoning_content: string;
|
|
263
|
-
/** The accumulated content so far */
|
|
264
|
-
accumulated: string;
|
|
265
|
-
/** Whether this is the final chunk */
|
|
266
|
-
isComplete: boolean;
|
|
267
|
-
/** Token usage information if available */
|
|
268
|
-
usage?: AIUsageInfo;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* misc
|
|
273
|
-
*/
|
|
274
|
-
export declare interface Color {
|
|
275
|
-
name: string;
|
|
276
|
-
hex: string;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export declare function describeUserPage<ElementType extends BaseElement = BaseElement>(context: Omit<UIContext_2<ElementType>, 'describer'>, opt?: {
|
|
280
|
-
truncateTextLength?: number;
|
|
281
|
-
filterNonTextContent?: boolean;
|
|
282
|
-
domIncluded?: boolean | 'visible-only';
|
|
283
|
-
visibleOnly?: boolean;
|
|
284
|
-
}): Promise<{
|
|
285
|
-
description: string;
|
|
286
|
-
elementById(idOrIndexId: string): ElementType;
|
|
287
|
-
elementByPosition(position: {
|
|
288
|
-
x: number;
|
|
289
|
-
y: number;
|
|
290
|
-
}, size: {
|
|
291
|
-
width: number;
|
|
292
|
-
height: number;
|
|
293
|
-
}): BaseElement | undefined;
|
|
294
|
-
insertElementByPosition(position: {
|
|
295
|
-
x: number;
|
|
296
|
-
y: number;
|
|
297
|
-
}): ElementType;
|
|
298
|
-
size: {
|
|
299
|
-
width: number;
|
|
300
|
-
height: number;
|
|
301
|
-
};
|
|
302
|
-
}>;
|
|
303
|
-
|
|
304
|
-
export declare interface DetailedLocateParam extends LocateOption {
|
|
305
|
-
prompt: TUserPrompt;
|
|
306
|
-
referenceImage?: ReferenceImage;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
declare interface DetailedLocateParam_2 extends LocateOption_2 {
|
|
310
|
-
prompt: TUserPrompt_2;
|
|
311
|
-
referenceImage?: ReferenceImage_2;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export declare interface DeviceAction<ParamType = any> {
|
|
315
|
-
name: string;
|
|
316
|
-
description?: string;
|
|
317
|
-
paramSchema?: string;
|
|
318
|
-
paramDescription?: string;
|
|
319
|
-
location?: 'required' | 'optional' | false;
|
|
320
|
-
whatToLocate?: string;
|
|
321
|
-
call: (context: ExecutorContext, param: ParamType) => Promise<void> | void;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
declare interface DeviceAction_2<ParamType = any> {
|
|
325
|
-
name: string;
|
|
326
|
-
description?: string;
|
|
327
|
-
paramSchema?: string;
|
|
328
|
-
paramDescription?: string;
|
|
329
|
-
location?: 'required' | 'optional' | false;
|
|
330
|
-
whatToLocate?: string; // what to locate if location is required or optional
|
|
331
|
-
call: (context: ExecutorContext_2, param: ParamType) => Promise<void> | void;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export declare interface DumpMeta {
|
|
335
|
-
sdkVersion: string;
|
|
336
|
-
logTime: number;
|
|
337
|
-
model_name: string;
|
|
338
|
-
model_description?: string;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
declare interface DumpMeta_2 {
|
|
342
|
-
sdkVersion: string;
|
|
343
|
-
logTime: number;
|
|
344
|
-
model_name: string;
|
|
345
|
-
model_description?: string;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
export declare type DumpSubscriber = (dump: InsightDump) => Promise<void> | void;
|
|
349
|
-
|
|
350
|
-
declare type DumpSubscriber_2 = (dump: InsightDump_2) => Promise<void> | void;
|
|
351
|
-
|
|
352
|
-
export declare type ElementById = (id: string) => BaseElement | null;
|
|
353
|
-
|
|
354
|
-
declare type ElementById_2 = (id: string) => BaseElement | null;
|
|
355
|
-
|
|
356
|
-
export { ElementTreeNode }
|
|
357
|
-
|
|
358
|
-
export declare type EnsureObject<T> = {
|
|
359
|
-
[K in keyof T]: any;
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
export declare interface ExecutionDump extends DumpMeta {
|
|
363
|
-
name: string;
|
|
364
|
-
description?: string;
|
|
365
|
-
tasks: ExecutionTask[];
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
declare interface ExecutionDump_2 extends DumpMeta_2 {
|
|
369
|
-
name: string;
|
|
370
|
-
description?: string;
|
|
371
|
-
tasks: ExecutionTask_2[];
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export declare interface ExecutionRecorderItem {
|
|
375
|
-
type: 'screenshot';
|
|
376
|
-
ts: number;
|
|
377
|
-
screenshot?: string;
|
|
378
|
-
timing?: string;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
declare interface ExecutionRecorderItem_2 {
|
|
382
|
-
type: 'screenshot';
|
|
383
|
-
ts: number;
|
|
384
|
-
screenshot?: string;
|
|
385
|
-
timing?: string;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export declare 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> & {
|
|
389
|
-
status: 'pending' | 'running' | 'finished' | 'failed' | 'cancelled';
|
|
390
|
-
error?: Error;
|
|
391
|
-
errorMessage?: string;
|
|
392
|
-
errorStack?: string;
|
|
393
|
-
timing?: {
|
|
394
|
-
start: number;
|
|
395
|
-
end?: number;
|
|
396
|
-
cost?: number;
|
|
397
|
-
};
|
|
398
|
-
usage?: AIUsageInfo;
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
declare type ExecutionTask_2<
|
|
402
|
-
E extends ExecutionTaskApply_2<any, any, any> = ExecutionTaskApply_2<
|
|
403
|
-
any,
|
|
404
|
-
any,
|
|
405
|
-
any
|
|
406
|
-
>,
|
|
407
|
-
> = E &
|
|
408
|
-
ExecutionTaskReturn_2<
|
|
409
|
-
E extends ExecutionTaskApply_2<any, any, infer TaskOutput, any>
|
|
410
|
-
? TaskOutput
|
|
411
|
-
: unknown,
|
|
412
|
-
E extends ExecutionTaskApply_2<any, any, any, infer TaskLog>
|
|
413
|
-
? TaskLog
|
|
414
|
-
: unknown
|
|
415
|
-
> & {
|
|
416
|
-
status: 'pending' | 'running' | 'finished' | 'failed' | 'cancelled';
|
|
417
|
-
error?: Error;
|
|
418
|
-
errorMessage?: string;
|
|
419
|
-
errorStack?: string;
|
|
420
|
-
timing?: {
|
|
421
|
-
start: number;
|
|
422
|
-
end?: number;
|
|
423
|
-
cost?: number;
|
|
424
|
-
};
|
|
425
|
-
usage?: AIUsageInfo_2;
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
export declare type ExecutionTaskAction = ExecutionTask<ExecutionTaskActionApply>;
|
|
429
|
-
|
|
430
|
-
export declare type ExecutionTaskActionApply<ActionParam = any> = ExecutionTaskApply<'Action', ActionParam, void, void>;
|
|
431
|
-
|
|
432
|
-
export declare interface ExecutionTaskApply<Type extends ExecutionTaskType = any, TaskParam = any, TaskOutput = any, TaskLog = any> {
|
|
433
|
-
type: Type;
|
|
434
|
-
subType?: string;
|
|
435
|
-
param?: TaskParam;
|
|
436
|
-
thought?: string;
|
|
437
|
-
locate?: PlanningLocateParam | null;
|
|
438
|
-
pageContext?: UIContext;
|
|
439
|
-
executor: (param: TaskParam, context: ExecutorContext) => Promise<ExecutionTaskReturn<TaskOutput, TaskLog> | undefined | void> | undefined | void;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
declare interface ExecutionTaskApply_2<
|
|
443
|
-
Type extends ExecutionTaskType_2 = any,
|
|
444
|
-
TaskParam = any,
|
|
445
|
-
TaskOutput = any,
|
|
446
|
-
TaskLog = any,
|
|
447
|
-
> {
|
|
448
|
-
type: Type;
|
|
449
|
-
subType?: string;
|
|
450
|
-
param?: TaskParam;
|
|
451
|
-
thought?: string;
|
|
452
|
-
locate?: PlanningLocateParam_2 | null;
|
|
453
|
-
pageContext?: UIContext_2;
|
|
454
|
-
executor: (
|
|
455
|
-
param: TaskParam,
|
|
456
|
-
context: ExecutorContext_2,
|
|
457
|
-
) => // biome-ignore lint/suspicious/noConfusingVoidType: <explanation>
|
|
458
|
-
| Promise<ExecutionTaskReturn_2<TaskOutput, TaskLog> | undefined | void>
|
|
459
|
-
| undefined
|
|
460
|
-
| void;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
export declare interface ExecutionTaskHitBy {
|
|
464
|
-
from: string;
|
|
465
|
-
context: Record<string, any>;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
declare interface ExecutionTaskHitBy_2 {
|
|
469
|
-
from: string;
|
|
470
|
-
context: Record<string, any>;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export declare type ExecutionTaskInsightAssertion = ExecutionTask<ExecutionTaskInsightAssertionApply>;
|
|
474
|
-
|
|
475
|
-
export declare type ExecutionTaskInsightAssertionApply = ExecutionTaskApply<'Insight', ExecutionTaskInsightAssertionParam, InsightAssertionResponse, ExecutionTaskInsightDumpLog>;
|
|
476
|
-
|
|
477
|
-
export declare interface ExecutionTaskInsightAssertionParam {
|
|
478
|
-
assertion: string;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export declare interface ExecutionTaskInsightDumpLog {
|
|
482
|
-
dump?: InsightDump;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
export declare type ExecutionTaskInsightLocate = ExecutionTask<ExecutionTaskInsightLocateApply>;
|
|
486
|
-
|
|
487
|
-
export declare type ExecutionTaskInsightLocateApply = ExecutionTaskApply<'Insight', ExecutionTaskInsightLocateParam, ExecutionTaskInsightLocateOutput, ExecutionTaskInsightDumpLog>;
|
|
488
|
-
|
|
489
|
-
export declare interface ExecutionTaskInsightLocateOutput {
|
|
490
|
-
element: LocateResultElement | null;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
export declare type ExecutionTaskInsightLocateParam = PlanningLocateParam;
|
|
494
|
-
|
|
495
|
-
export declare type ExecutionTaskInsightQuery = ExecutionTask<ExecutionTaskInsightQueryApply>;
|
|
496
|
-
|
|
497
|
-
export declare type ExecutionTaskInsightQueryApply = ExecutionTaskApply<'Insight', ExecutionTaskInsightQueryParam, any, ExecutionTaskInsightDumpLog>;
|
|
498
|
-
|
|
499
|
-
export declare interface ExecutionTaskInsightQueryOutput {
|
|
500
|
-
data: any;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
export declare interface ExecutionTaskInsightQueryParam {
|
|
504
|
-
dataDemand: InsightExtractParam;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export declare type ExecutionTaskLog = ExecutionTask<ExecutionTaskLogApply>;
|
|
508
|
-
|
|
509
|
-
export declare type ExecutionTaskLogApply<LogParam = {
|
|
510
|
-
content: string;
|
|
511
|
-
}> = ExecutionTaskApply<'Log', LogParam, void, void>;
|
|
512
|
-
|
|
513
|
-
export declare type ExecutionTaskPlanning = ExecutionTask<ExecutionTaskPlanningApply>;
|
|
514
|
-
|
|
515
|
-
export declare type ExecutionTaskPlanningApply = ExecutionTaskApply<'Planning', {
|
|
516
|
-
userInstruction: string;
|
|
517
|
-
log?: string;
|
|
518
|
-
}, PlanningAIResponse>;
|
|
519
|
-
|
|
520
|
-
export declare interface ExecutionTaskProgressOptions {
|
|
521
|
-
onTaskStart?: (task: ExecutionTask) => Promise<void> | void;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
declare interface ExecutionTaskProgressOptions_2 {
|
|
525
|
-
onTaskStart?: (task: ExecutionTask_2) => Promise<void> | void;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
export declare interface ExecutionTaskReturn<TaskOutput = unknown, TaskLog = unknown> {
|
|
529
|
-
output?: TaskOutput;
|
|
530
|
-
log?: TaskLog;
|
|
531
|
-
recorder?: ExecutionRecorderItem[];
|
|
532
|
-
hitBy?: ExecutionTaskHitBy;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
declare interface ExecutionTaskReturn_2<TaskOutput = unknown, TaskLog = unknown> {
|
|
536
|
-
output?: TaskOutput;
|
|
537
|
-
log?: TaskLog;
|
|
538
|
-
recorder?: ExecutionRecorderItem_2[];
|
|
539
|
-
hitBy?: ExecutionTaskHitBy_2;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
export declare type ExecutionTaskType = 'Planning' | 'Insight' | 'Action' | 'Assertion' | 'Log';
|
|
543
|
-
|
|
544
|
-
declare type ExecutionTaskType_2 =
|
|
545
|
-
| 'Planning'
|
|
546
|
-
| 'Insight'
|
|
547
|
-
| 'Action'
|
|
548
|
-
| 'Assertion'
|
|
549
|
-
| 'Log';
|
|
550
|
-
|
|
551
|
-
export declare class Executor {
|
|
552
|
-
name: string;
|
|
553
|
-
tasks: ExecutionTask_2[];
|
|
554
|
-
status: 'init' | 'pending' | 'running' | 'completed' | 'error';
|
|
555
|
-
onTaskStart?: ExecutionTaskProgressOptions_2['onTaskStart'];
|
|
556
|
-
constructor(name: string, options?: ExecutionTaskProgressOptions_2 & {
|
|
557
|
-
tasks?: ExecutionTaskApply_2[];
|
|
558
|
-
});
|
|
559
|
-
private markTaskAsPending;
|
|
560
|
-
append(task: ExecutionTaskApply_2[] | ExecutionTaskApply_2): Promise<void>;
|
|
561
|
-
flush(): Promise<{
|
|
562
|
-
output: any;
|
|
563
|
-
thought?: string;
|
|
564
|
-
} | undefined>;
|
|
565
|
-
isInErrorState(): boolean;
|
|
566
|
-
latestErrorTask(): ExecutionTask_2 | null;
|
|
567
|
-
dump(): ExecutionDump_2;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
export declare interface ExecutorContext {
|
|
571
|
-
task: ExecutionTask;
|
|
572
|
-
element?: LocateResultElement | null;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
declare interface ExecutorContext_2 {
|
|
576
|
-
task: ExecutionTask_2;
|
|
577
|
-
element?: LocateResultElement_2 | null;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
export declare interface FreeFn {
|
|
581
|
-
name: string;
|
|
582
|
-
fn: () => void;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
export { getAIConfig }
|
|
586
|
-
|
|
587
|
-
export declare function getVersion(): string;
|
|
588
|
-
|
|
589
|
-
export declare interface GroupedActionDump {
|
|
590
|
-
groupName: string;
|
|
591
|
-
groupDescription?: string;
|
|
592
|
-
executions: ExecutionDump[];
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
declare class Insight<ElementType extends BaseElement = BaseElement, ContextType extends UIContext_2<ElementType> = UIContext_2<ElementType>> {
|
|
596
|
-
contextRetrieverFn: (action: InsightAction_2) => Promise<ContextType> | ContextType;
|
|
597
|
-
aiVendorFn: (...args: Array<any>) => Promise<any>;
|
|
598
|
-
onceDumpUpdatedFn?: DumpSubscriber_2;
|
|
599
|
-
taskInfo?: Omit<InsightTaskInfo_2, 'durationMs'>;
|
|
600
|
-
constructor(context: ContextType | ((action: InsightAction_2) => Promise<ContextType> | ContextType), opt?: InsightOptions_2);
|
|
601
|
-
locate(query: DetailedLocateParam_2, opt?: LocateOpts): Promise<LocateResult_2>;
|
|
602
|
-
extract<T>(dataDemand: InsightExtractParam_2, opt?: InsightExtractOption_2, multimodalPrompt?: TMultimodalPrompt_2): Promise<{
|
|
603
|
-
data: T;
|
|
604
|
-
thought?: string;
|
|
605
|
-
usage?: AIUsageInfo_2;
|
|
606
|
-
}>;
|
|
607
|
-
assert(assertion: TUserPrompt_2): Promise<InsightAssertionResponse_2>;
|
|
608
|
-
describe(target: Rect | [number, number], opt?: {
|
|
609
|
-
deepThink?: boolean;
|
|
610
|
-
}): Promise<Pick<AIDescribeElementResponse_2, 'description'>>;
|
|
611
|
-
}
|
|
612
|
-
export { Insight }
|
|
613
|
-
export default Insight;
|
|
614
|
-
|
|
615
|
-
export declare type InsightAction = 'locate' | 'extract' | 'assert' | 'describe';
|
|
616
|
-
|
|
617
|
-
declare type InsightAction_2 = 'locate' | 'extract' | 'assert' | 'describe';
|
|
618
|
-
|
|
619
|
-
export declare type InsightAssertionResponse = AIAssertionResponse & {
|
|
620
|
-
usage?: AIUsageInfo;
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
declare type InsightAssertionResponse_2 = AIAssertionResponse_2 & {
|
|
624
|
-
usage?: AIUsageInfo_2;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
export declare interface InsightDump extends DumpMeta {
|
|
628
|
-
type: 'locate' | 'extract' | 'assert';
|
|
629
|
-
logId: string;
|
|
630
|
-
userQuery: {
|
|
631
|
-
element?: TUserPrompt;
|
|
632
|
-
dataDemand?: InsightExtractParam;
|
|
633
|
-
assertion?: TUserPrompt;
|
|
634
|
-
};
|
|
635
|
-
matchedElement: BaseElement[];
|
|
636
|
-
matchedRect?: Rect;
|
|
637
|
-
deepThink?: boolean;
|
|
638
|
-
data: any;
|
|
639
|
-
assertionPass?: boolean;
|
|
640
|
-
assertionThought?: string;
|
|
641
|
-
taskInfo: InsightTaskInfo;
|
|
642
|
-
error?: string;
|
|
643
|
-
output?: any;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
declare interface InsightDump_2 extends DumpMeta_2 {
|
|
647
|
-
type: 'locate' | 'extract' | 'assert';
|
|
648
|
-
logId: string;
|
|
649
|
-
userQuery: {
|
|
650
|
-
element?: TUserPrompt_2;
|
|
651
|
-
dataDemand?: InsightExtractParam_2;
|
|
652
|
-
assertion?: TUserPrompt_2;
|
|
653
|
-
};
|
|
654
|
-
matchedElement: BaseElement[];
|
|
655
|
-
matchedRect?: Rect;
|
|
656
|
-
deepThink?: boolean;
|
|
657
|
-
data: any;
|
|
658
|
-
assertionPass?: boolean;
|
|
659
|
-
assertionThought?: string;
|
|
660
|
-
taskInfo: InsightTaskInfo_2;
|
|
661
|
-
error?: string;
|
|
662
|
-
output?: any;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
export declare interface InsightExtractOption {
|
|
666
|
-
domIncluded?: boolean | 'visible-only';
|
|
667
|
-
screenshotIncluded?: boolean;
|
|
668
|
-
returnThought?: boolean;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
declare interface InsightExtractOption_2 {
|
|
672
|
-
domIncluded?: boolean | 'visible-only';
|
|
673
|
-
screenshotIncluded?: boolean;
|
|
674
|
-
returnThought?: boolean;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
export declare type InsightExtractParam = string | Record<string, string>;
|
|
678
|
-
|
|
679
|
-
declare type InsightExtractParam_2 = string | Record<string, string>;
|
|
680
|
-
|
|
681
|
-
export declare interface InsightOptions {
|
|
682
|
-
taskInfo?: Omit<InsightTaskInfo, 'durationMs'>;
|
|
683
|
-
aiVendorFn?: CallAIFn;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
declare interface InsightOptions_2 {
|
|
687
|
-
taskInfo?: Omit<InsightTaskInfo_2, 'durationMs'>;
|
|
688
|
-
aiVendorFn?: CallAIFn_2;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
export declare interface InsightTaskInfo {
|
|
692
|
-
durationMs: number;
|
|
693
|
-
formatResponse?: string;
|
|
694
|
-
rawResponse?: string;
|
|
695
|
-
usage?: AIUsageInfo;
|
|
696
|
-
searchArea?: Rect;
|
|
697
|
-
searchAreaRawResponse?: string;
|
|
698
|
-
searchAreaUsage?: AIUsageInfo;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
declare interface InsightTaskInfo_2 {
|
|
702
|
-
durationMs: number;
|
|
703
|
-
formatResponse?: string;
|
|
704
|
-
rawResponse?: string;
|
|
705
|
-
usage?: AIUsageInfo_2;
|
|
706
|
-
searchArea?: Rect;
|
|
707
|
-
searchAreaRawResponse?: string;
|
|
708
|
-
searchAreaUsage?: AIUsageInfo_2;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
export declare interface LiteUISection {
|
|
712
|
-
name: string;
|
|
713
|
-
description: string;
|
|
714
|
-
sectionCharacteristics: string;
|
|
715
|
-
textIds: string[];
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
export declare interface LocateOption {
|
|
719
|
-
deepThink?: boolean;
|
|
720
|
-
cacheable?: boolean;
|
|
721
|
-
xpath?: string;
|
|
722
|
-
pageContext?: UIContext<BaseElement>;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
declare interface LocateOption_2 {
|
|
726
|
-
deepThink?: boolean; // only available in vl model
|
|
727
|
-
cacheable?: boolean; // user can set this param to false to disable the cache for a single agent api
|
|
728
|
-
xpath?: string; // only available in web
|
|
729
|
-
pageContext?: UIContext_2<BaseElement>;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
declare interface LocateOpts {
|
|
733
|
-
context?: UIContext_2<BaseElement>;
|
|
734
|
-
callAI?: typeof callAiFn_2<AIElementResponse_2>;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
export declare interface LocateResult {
|
|
738
|
-
element: LocateResultElement | null;
|
|
739
|
-
rect?: Rect;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
declare interface LocateResult_2 {
|
|
743
|
-
element: LocateResultElement_2 | null;
|
|
744
|
-
rect?: Rect;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
export declare type LocateResultElement = {
|
|
748
|
-
id: string;
|
|
749
|
-
indexId?: number;
|
|
750
|
-
center: [number, number];
|
|
751
|
-
rect: Rect;
|
|
752
|
-
xpaths: string[];
|
|
753
|
-
attributes: {
|
|
754
|
-
nodeType: NodeType;
|
|
755
|
-
[key: string]: string;
|
|
756
|
-
};
|
|
757
|
-
isOrderSensitive?: boolean;
|
|
758
|
-
};
|
|
759
|
-
|
|
760
|
-
declare type LocateResultElement_2 = {
|
|
761
|
-
id: string;
|
|
762
|
-
indexId?: number;
|
|
763
|
-
center: [number, number];
|
|
764
|
-
rect: Rect;
|
|
765
|
-
xpaths: string[];
|
|
766
|
-
attributes: {
|
|
767
|
-
nodeType: NodeType;
|
|
768
|
-
[key: string]: string;
|
|
769
|
-
};
|
|
770
|
-
isOrderSensitive?: boolean;
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
export declare interface LocateValidatorResult {
|
|
774
|
-
pass: boolean;
|
|
775
|
-
rect: Rect;
|
|
776
|
-
center: [number, number];
|
|
777
|
-
centerDistance?: number;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
export declare interface LocatorValidatorOption {
|
|
781
|
-
centerDistanceThreshold?: number;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
export { MIDSCENE_MODEL_NAME }
|
|
785
|
-
|
|
786
|
-
export declare interface MidsceneYamlConfig {
|
|
787
|
-
concurrent?: number;
|
|
788
|
-
continueOnError?: boolean;
|
|
789
|
-
summary?: string;
|
|
790
|
-
shareBrowserContext?: boolean;
|
|
791
|
-
web?: MidsceneYamlScriptWebEnv;
|
|
792
|
-
android?: MidsceneYamlScriptAndroidEnv;
|
|
793
|
-
files: string[];
|
|
794
|
-
headed?: boolean;
|
|
795
|
-
keepWindow?: boolean;
|
|
796
|
-
dotenvOverride?: boolean;
|
|
797
|
-
dotenvDebug?: boolean;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
export declare interface MidsceneYamlConfigOutput {
|
|
801
|
-
format?: 'json';
|
|
802
|
-
path?: string;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
export declare interface MidsceneYamlConfigResult {
|
|
806
|
-
file: string;
|
|
807
|
-
success: boolean;
|
|
808
|
-
executed: boolean;
|
|
809
|
-
output?: string | null;
|
|
810
|
-
report?: string | null;
|
|
811
|
-
error?: string;
|
|
812
|
-
duration?: number;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
export declare type MidsceneYamlFlowItem = MidsceneYamlFlowItemAIAction | MidsceneYamlFlowItemAIAssert | MidsceneYamlFlowItemAIQuery | MidsceneYamlFlowItemAIWaitFor | MidsceneYamlFlowItemAITap | MidsceneYamlFlowItemAIRightClick | MidsceneYamlFlowItemAIHover | MidsceneYamlFlowItemAIInput | MidsceneYamlFlowItemAIKeyboardPress | MidsceneYamlFlowItemAIScroll | MidsceneYamlFlowItemSleep | MidsceneYamlFlowItemLogScreenshot;
|
|
816
|
-
|
|
817
|
-
declare type MidsceneYamlFlowItem_2 =
|
|
818
|
-
| MidsceneYamlFlowItemAIAction_2
|
|
819
|
-
| MidsceneYamlFlowItemAIAssert_2
|
|
820
|
-
| MidsceneYamlFlowItemAIQuery_2
|
|
821
|
-
| MidsceneYamlFlowItemAIWaitFor_2
|
|
822
|
-
| MidsceneYamlFlowItemAITap_2
|
|
823
|
-
| MidsceneYamlFlowItemAIRightClick_2
|
|
824
|
-
| MidsceneYamlFlowItemAIHover_2
|
|
825
|
-
| MidsceneYamlFlowItemAIInput_2
|
|
826
|
-
| MidsceneYamlFlowItemAIKeyboardPress_2
|
|
827
|
-
| MidsceneYamlFlowItemAIScroll_2
|
|
828
|
-
| MidsceneYamlFlowItemSleep_2
|
|
829
|
-
| MidsceneYamlFlowItemLogScreenshot_2;
|
|
830
|
-
|
|
831
|
-
export declare interface MidsceneYamlFlowItemAIAction {
|
|
832
|
-
ai?: string;
|
|
833
|
-
aiAction?: string;
|
|
834
|
-
aiActionProgressTips?: string[];
|
|
835
|
-
cacheable?: boolean;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
declare interface MidsceneYamlFlowItemAIAction_2 {
|
|
839
|
-
ai?: string; // this is the shortcut for aiAction
|
|
840
|
-
aiAction?: string;
|
|
841
|
-
aiActionProgressTips?: string[];
|
|
842
|
-
cacheable?: boolean;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
export declare interface MidsceneYamlFlowItemAIAsk extends InsightExtractOption {
|
|
846
|
-
aiAsk: string;
|
|
847
|
-
name?: string;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
export declare interface MidsceneYamlFlowItemAIAssert {
|
|
851
|
-
aiAssert: string;
|
|
852
|
-
errorMessage?: string;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
declare interface MidsceneYamlFlowItemAIAssert_2 {
|
|
856
|
-
aiAssert: string;
|
|
857
|
-
errorMessage?: string;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
export declare interface MidsceneYamlFlowItemAIBoolean extends InsightExtractOption {
|
|
861
|
-
aiBoolean: string;
|
|
862
|
-
name?: string;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
export declare interface MidsceneYamlFlowItemAIHover extends LocateOption {
|
|
866
|
-
aiHover: TUserPrompt;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
declare interface MidsceneYamlFlowItemAIHover_2 extends LocateOption_2 {
|
|
870
|
-
aiHover: TUserPrompt_2;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
export declare interface MidsceneYamlFlowItemAIInput extends LocateOption {
|
|
874
|
-
aiInput: string;
|
|
875
|
-
locate: TUserPrompt;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
declare interface MidsceneYamlFlowItemAIInput_2 extends LocateOption_2 {
|
|
879
|
-
aiInput: string; // value to input
|
|
880
|
-
locate: TUserPrompt_2; // where to input
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
export declare interface MidsceneYamlFlowItemAIKeyboardPress extends LocateOption {
|
|
884
|
-
aiKeyboardPress: string;
|
|
885
|
-
locate?: TUserPrompt;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
declare interface MidsceneYamlFlowItemAIKeyboardPress_2 extends LocateOption_2 {
|
|
889
|
-
aiKeyboardPress: string;
|
|
890
|
-
locate?: TUserPrompt_2; // where to press, optional
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
export declare interface MidsceneYamlFlowItemAILocate extends LocateOption {
|
|
894
|
-
aiLocate: string;
|
|
895
|
-
name?: string;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
export declare interface MidsceneYamlFlowItemAINumber extends InsightExtractOption {
|
|
899
|
-
aiNumber: string;
|
|
900
|
-
name?: string;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
export declare interface MidsceneYamlFlowItemAIQuery extends InsightExtractOption {
|
|
904
|
-
aiQuery: string;
|
|
905
|
-
name?: string;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
declare interface MidsceneYamlFlowItemAIQuery_2 extends InsightExtractOption_2 {
|
|
909
|
-
aiQuery: string;
|
|
910
|
-
name?: string;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
export declare interface MidsceneYamlFlowItemAIRightClick extends LocateOption {
|
|
914
|
-
aiRightClick: TUserPrompt;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
declare interface MidsceneYamlFlowItemAIRightClick_2 extends LocateOption_2 {
|
|
918
|
-
aiRightClick: TUserPrompt_2;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
export declare interface MidsceneYamlFlowItemAIScroll extends LocateOption, ScrollParam {
|
|
922
|
-
aiScroll: null;
|
|
923
|
-
locate?: TUserPrompt;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
declare interface MidsceneYamlFlowItemAIScroll_2
|
|
927
|
-
extends LocateOption_2,
|
|
928
|
-
ScrollParam_2 {
|
|
929
|
-
aiScroll: null;
|
|
930
|
-
locate?: TUserPrompt_2; // which area to scroll, optional
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
export declare interface MidsceneYamlFlowItemAIString extends InsightExtractOption {
|
|
934
|
-
aiString: string;
|
|
935
|
-
name?: string;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
export declare interface MidsceneYamlFlowItemAITap extends LocateOption {
|
|
939
|
-
aiTap: TUserPrompt;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
declare interface MidsceneYamlFlowItemAITap_2 extends LocateOption_2 {
|
|
943
|
-
aiTap: TUserPrompt_2;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
export declare interface MidsceneYamlFlowItemAIWaitFor {
|
|
947
|
-
aiWaitFor: string;
|
|
948
|
-
timeout?: number;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
declare interface MidsceneYamlFlowItemAIWaitFor_2 {
|
|
952
|
-
aiWaitFor: string;
|
|
953
|
-
timeout?: number;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
export declare interface MidsceneYamlFlowItemEvaluateJavaScript {
|
|
957
|
-
javascript: string;
|
|
958
|
-
name?: string;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
export declare interface MidsceneYamlFlowItemLogScreenshot {
|
|
962
|
-
logScreenshot?: string;
|
|
963
|
-
content?: string;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
declare interface MidsceneYamlFlowItemLogScreenshot_2 {
|
|
967
|
-
logScreenshot?: string; // optional, the title of the screenshot
|
|
968
|
-
content?: string;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
export declare interface MidsceneYamlFlowItemSleep {
|
|
972
|
-
sleep: number;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
declare interface MidsceneYamlFlowItemSleep_2 {
|
|
976
|
-
sleep: number;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
export declare interface MidsceneYamlScript {
|
|
980
|
-
target?: MidsceneYamlScriptWebEnv;
|
|
981
|
-
web?: MidsceneYamlScriptWebEnv;
|
|
982
|
-
android?: MidsceneYamlScriptAndroidEnv;
|
|
983
|
-
tasks: MidsceneYamlTask[];
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
export declare interface MidsceneYamlScriptAndroidEnv extends MidsceneYamlScriptEnvBase {
|
|
987
|
-
deviceId?: string;
|
|
988
|
-
launch?: string;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
export declare type MidsceneYamlScriptEnv = MidsceneYamlScriptWebEnv | MidsceneYamlScriptAndroidEnv;
|
|
992
|
-
|
|
993
|
-
export declare interface MidsceneYamlScriptEnvBase {
|
|
994
|
-
output?: string;
|
|
995
|
-
unstableLogContent?: boolean | string;
|
|
996
|
-
aiActionContext?: string;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
export declare interface MidsceneYamlScriptWebEnv extends MidsceneYamlScriptEnvBase {
|
|
1000
|
-
serve?: string;
|
|
1001
|
-
url: string;
|
|
1002
|
-
userAgent?: string;
|
|
1003
|
-
acceptInsecureCerts?: boolean;
|
|
1004
|
-
viewportWidth?: number;
|
|
1005
|
-
viewportHeight?: number;
|
|
1006
|
-
viewportScale?: number;
|
|
1007
|
-
waitForNetworkIdle?: {
|
|
1008
|
-
timeout?: number;
|
|
1009
|
-
continueOnNetworkIdleError?: boolean;
|
|
1010
|
-
};
|
|
1011
|
-
cookie?: string;
|
|
1012
|
-
forceSameTabNavigation?: boolean;
|
|
1013
|
-
bridgeMode?: false | 'newTabWithUrl' | 'currentTab';
|
|
1014
|
-
closeNewTabsAfterDisconnect?: boolean;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
export declare interface MidsceneYamlTask {
|
|
1018
|
-
name: string;
|
|
1019
|
-
flow: MidsceneYamlFlowItem[];
|
|
1020
|
-
continueOnError?: boolean;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
/**
|
|
1024
|
-
* agent
|
|
1025
|
-
*/
|
|
1026
|
-
export declare type OnTaskStartTip = (tip: string) => Promise<void> | void;
|
|
1027
|
-
|
|
1028
|
-
export declare type PageType = 'puppeteer' | 'playwright' | 'static' | 'chrome-extension-proxy' | 'android';
|
|
1029
|
-
|
|
1030
|
-
declare type PageType_2 =
|
|
1031
|
-
| 'puppeteer'
|
|
1032
|
-
| 'playwright'
|
|
1033
|
-
| 'static'
|
|
1034
|
-
| 'chrome-extension-proxy'
|
|
1035
|
-
| 'android';
|
|
1036
|
-
|
|
1037
|
-
export declare type PartialInsightDumpFromSDK = Omit<InsightDump, 'sdkVersion' | 'logTime' | 'logId' | 'model_name'>;
|
|
1038
|
-
|
|
1039
|
-
export declare function plan(userInstruction: string, opts: {
|
|
1040
|
-
context: UIContext_2;
|
|
1041
|
-
pageType: PageType_2;
|
|
1042
|
-
actionSpace: DeviceAction_2[];
|
|
1043
|
-
callAI?: typeof callAiFn<PlanningAIResponse_2>;
|
|
1044
|
-
log?: string;
|
|
1045
|
-
actionContext?: string;
|
|
1046
|
-
}): Promise<PlanningAIResponse_2>;
|
|
1047
|
-
|
|
1048
|
-
export declare interface PlanningAction<ParamType = any> {
|
|
1049
|
-
thought?: string;
|
|
1050
|
-
type: 'Locate' | 'Tap' | 'RightClick' | 'Hover' | 'Drag' | 'Input' | 'KeyboardPress' | 'Scroll' | 'Error' | 'Assert' | 'AssertWithoutThrow' | 'Sleep' | 'Finished' | 'AndroidBackButton' | 'AndroidHomeButton' | 'AndroidRecentAppsButton' | 'AndroidLongPress' | 'AndroidPull';
|
|
1051
|
-
param: ParamType;
|
|
1052
|
-
locate?: PlanningLocateParam | null;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
declare interface PlanningAction_2<ParamType = any> {
|
|
1056
|
-
thought?: string;
|
|
1057
|
-
type:
|
|
1058
|
-
| 'Locate'
|
|
1059
|
-
| 'Tap'
|
|
1060
|
-
| 'RightClick'
|
|
1061
|
-
| 'Hover'
|
|
1062
|
-
| 'Drag'
|
|
1063
|
-
| 'Input'
|
|
1064
|
-
| 'KeyboardPress'
|
|
1065
|
-
| 'Scroll'
|
|
1066
|
-
| 'Error'
|
|
1067
|
-
| 'Assert'
|
|
1068
|
-
| 'AssertWithoutThrow'
|
|
1069
|
-
| 'Sleep'
|
|
1070
|
-
| 'Finished'
|
|
1071
|
-
| 'AndroidBackButton'
|
|
1072
|
-
| 'AndroidHomeButton'
|
|
1073
|
-
| 'AndroidRecentAppsButton'
|
|
1074
|
-
| 'AndroidLongPress'
|
|
1075
|
-
| 'AndroidPull';
|
|
1076
|
-
param: ParamType;
|
|
1077
|
-
locate?: PlanningLocateParam_2 | null;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
export declare interface PlanningActionParamAssert {
|
|
1081
|
-
assertion: TUserPrompt;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
export declare interface PlanningActionParamError {
|
|
1085
|
-
thought: string;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
export declare type PlanningActionParamHover = null;
|
|
1089
|
-
|
|
1090
|
-
export declare interface PlanningActionParamInputOrKeyPress {
|
|
1091
|
-
value: string;
|
|
1092
|
-
autoDismissKeyboard?: boolean;
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
export declare type PlanningActionParamRightClick = null;
|
|
1096
|
-
|
|
1097
|
-
export declare interface PlanningActionParamSleep {
|
|
1098
|
-
timeMs: number;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
export declare type PlanningActionParamTap = null;
|
|
1102
|
-
|
|
1103
|
-
export declare type PlanningActionParamWaitFor = AgentWaitForOpt & {
|
|
1104
|
-
assertion: string;
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
|
-
export declare interface PlanningAIResponse {
|
|
1108
|
-
action?: PlanningAction;
|
|
1109
|
-
actions?: PlanningAction[];
|
|
1110
|
-
more_actions_needed_by_instruction: boolean;
|
|
1111
|
-
log: string;
|
|
1112
|
-
sleep?: number;
|
|
1113
|
-
error?: string;
|
|
1114
|
-
usage?: AIUsageInfo;
|
|
1115
|
-
rawResponse?: string;
|
|
1116
|
-
yamlFlow?: MidsceneYamlFlowItem[];
|
|
1117
|
-
yamlString?: string;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
declare interface PlanningAIResponse_2 {
|
|
1121
|
-
action?: PlanningAction_2; // this is the qwen mode
|
|
1122
|
-
actions?: PlanningAction_2[];
|
|
1123
|
-
more_actions_needed_by_instruction: boolean;
|
|
1124
|
-
log: string;
|
|
1125
|
-
sleep?: number;
|
|
1126
|
-
error?: string;
|
|
1127
|
-
usage?: AIUsageInfo_2;
|
|
1128
|
-
rawResponse?: string;
|
|
1129
|
-
yamlFlow?: MidsceneYamlFlowItem_2[];
|
|
1130
|
-
yamlString?: string;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
/**
|
|
1134
|
-
* planning
|
|
1135
|
-
*
|
|
1136
|
-
*/
|
|
1137
|
-
export declare interface PlanningLocateParam extends DetailedLocateParam {
|
|
1138
|
-
id?: string;
|
|
1139
|
-
bbox?: [number, number, number, number];
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
/**
|
|
1143
|
-
* planning
|
|
1144
|
-
*
|
|
1145
|
-
*/
|
|
1146
|
-
|
|
1147
|
-
declare interface PlanningLocateParam_2 extends DetailedLocateParam_2 {
|
|
1148
|
-
id?: string;
|
|
1149
|
-
bbox?: [number, number, number, number];
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
export declare interface PlaywrightParserOpt extends BaseAgentParserOpt {
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
export { Point }
|
|
1156
|
-
|
|
1157
|
-
export declare interface PuppeteerParserOpt extends BaseAgentParserOpt {
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
export { Rect }
|
|
1161
|
-
|
|
1162
|
-
export declare interface ReferenceImage {
|
|
1163
|
-
base64: string;
|
|
1164
|
-
rect?: Rect;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
declare interface ReferenceImage_2 {
|
|
1168
|
-
base64: string;
|
|
1169
|
-
rect?: Rect;
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
export declare interface ReportDumpWithAttributes {
|
|
1173
|
-
dumpString: string;
|
|
1174
|
-
attributes?: Record<string, any>;
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
export declare type ScriptPlayerStatusValue = 'init' | 'running' | 'done' | 'error';
|
|
1178
|
-
|
|
1179
|
-
export declare interface ScriptPlayerTaskStatus extends MidsceneYamlTask {
|
|
1180
|
-
status: ScriptPlayerStatusValue;
|
|
1181
|
-
currentStep?: number;
|
|
1182
|
-
totalSteps: number;
|
|
1183
|
-
error?: Error;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
export declare interface ScrollParam {
|
|
1187
|
-
direction: 'down' | 'up' | 'right' | 'left';
|
|
1188
|
-
scrollType: 'once' | 'untilBottom' | 'untilTop' | 'untilRight' | 'untilLeft';
|
|
1189
|
-
distance?: null | number;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
declare interface ScrollParam_2 {
|
|
1193
|
-
direction: 'down' | 'up' | 'right' | 'left';
|
|
1194
|
-
scrollType: 'once' | 'untilBottom' | 'untilTop' | 'untilRight' | 'untilLeft';
|
|
1195
|
-
distance?: null | number; // distance in px
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
export { Size }
|
|
1199
|
-
|
|
1200
|
-
export declare interface StreamingAIResponse {
|
|
1201
|
-
/** The final accumulated content */
|
|
1202
|
-
content: string;
|
|
1203
|
-
/** Token usage information */
|
|
1204
|
-
usage?: AIUsageInfo;
|
|
1205
|
-
/** Whether the response was streamed */
|
|
1206
|
-
isStreamed: boolean;
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
export declare type StreamingCallback = (chunk: CodeGenerationChunk) => void;
|
|
1210
|
-
|
|
1211
|
-
export declare interface StreamingCodeGenerationOptions {
|
|
1212
|
-
/** Whether to enable streaming output */
|
|
1213
|
-
stream?: boolean;
|
|
1214
|
-
/** Callback function to handle streaming chunks */
|
|
1215
|
-
onChunk?: StreamingCallback;
|
|
1216
|
-
/** Callback function to handle streaming completion */
|
|
1217
|
-
onComplete?: (finalCode: string) => void;
|
|
1218
|
-
/** Callback function to handle streaming errors */
|
|
1219
|
-
onError?: (error: Error) => void;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
export declare type TMultimodalPrompt = {
|
|
1223
|
-
/**
|
|
1224
|
-
* Support use image to inspect elements.
|
|
1225
|
-
* The "images" field is an object that uses image name as key and image url as value.
|
|
1226
|
-
* The image url can be a local path, a http link , or a base64 string.
|
|
1227
|
-
*/
|
|
1228
|
-
images?: {
|
|
1229
|
-
name: string;
|
|
1230
|
-
url: string;
|
|
1231
|
-
}[];
|
|
1232
|
-
/**
|
|
1233
|
-
* By default, the image url in the "images" filed starts with `https://` or `http://` will be directly sent to the LLM.
|
|
1234
|
-
* In case the images are not accessible to the LLM (One common case is that image url is internal network only.), you can enable this option.
|
|
1235
|
-
* Then image will be download and convert to base64 format.
|
|
1236
|
-
*/
|
|
1237
|
-
convertHttpImage2Base64?: boolean;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
declare type TMultimodalPrompt_2 = {
|
|
1241
|
-
/**
|
|
1242
|
-
* Support use image to inspect elements.
|
|
1243
|
-
* The "images" field is an object that uses image name as key and image url as value.
|
|
1244
|
-
* The image url can be a local path, a http link , or a base64 string.
|
|
1245
|
-
*/
|
|
1246
|
-
images?: {
|
|
1247
|
-
name: string;
|
|
1248
|
-
url: string;
|
|
1249
|
-
}[];
|
|
1250
|
-
/**
|
|
1251
|
-
* By default, the image url in the "images" filed starts with `https://` or `http://` will be directly sent to the LLM.
|
|
1252
|
-
* In case the images are not accessible to the LLM (One common case is that image url is internal network only.), you can enable this option.
|
|
1253
|
-
* Then image will be download and convert to base64 format.
|
|
1254
|
-
*/
|
|
1255
|
-
convertHttpImage2Base64?: boolean;
|
|
1256
|
-
};
|
|
1257
|
-
|
|
1258
|
-
export declare type TUserPrompt = string | ({
|
|
1259
|
-
prompt: string;
|
|
1260
|
-
} & Partial<TMultimodalPrompt>);
|
|
1261
|
-
|
|
1262
|
-
declare type TUserPrompt_2 =
|
|
1263
|
-
| string
|
|
1264
|
-
| ({
|
|
1265
|
-
prompt: string;
|
|
1266
|
-
} & Partial<TMultimodalPrompt_2>);
|
|
1267
|
-
|
|
1268
|
-
/**
|
|
1269
|
-
* context
|
|
1270
|
-
*/
|
|
1271
|
-
export declare abstract class UIContext<ElementType extends BaseElement = BaseElement> {
|
|
1272
|
-
abstract screenshotBase64: string;
|
|
1273
|
-
abstract tree: ElementTreeNode<ElementType>;
|
|
1274
|
-
abstract size: Size;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
/**
|
|
1278
|
-
* context
|
|
1279
|
-
*/
|
|
1280
|
-
|
|
1281
|
-
declare abstract class UIContext_2<ElementType extends BaseElement = BaseElement> {
|
|
1282
|
-
abstract screenshotBase64: string;
|
|
1283
|
-
|
|
1284
|
-
abstract tree: ElementTreeNode<ElementType>;
|
|
1285
|
-
|
|
1286
|
-
abstract size: Size;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
export { }
|
|
1
|
+
import { Executor } from './ai-model/action-executor';
|
|
2
|
+
import Insight from './insight/index';
|
|
3
|
+
import { getVersion } from './utils';
|
|
4
|
+
export { plan, describeUserPage, AiLocateElement, AiAssert, } from './ai-model/index';
|
|
5
|
+
export { getAIConfig, MIDSCENE_MODEL_NAME } from '@midscene/shared/env';
|
|
6
|
+
export type * from './types';
|
|
7
|
+
export default Insight;
|
|
8
|
+
export { Executor, Insight, getVersion };
|
|
9
|
+
export type { MidsceneYamlScript, MidsceneYamlTask, MidsceneYamlFlowItem, MidsceneYamlFlowItemAIRightClick, MidsceneYamlConfigResult, LocateOption, DetailedLocateParam, } from './yaml';
|