@midscene/core 0.30.2-beta-20251010092125.0 → 0.30.3-beta-20251011064436.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/agent/agent.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +8 -1
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/common.mjs +15 -4
- package/dist/es/ai-model/common.mjs.map +1 -1
- package/dist/es/ai-model/index.mjs +2 -2
- package/dist/es/device/index.mjs +2 -1
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/tasks.js +7 -0
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/common.js +19 -5
- package/dist/lib/ai-model/common.js.map +1 -1
- package/dist/lib/ai-model/index.js +13 -10
- package/dist/lib/device/index.js +2 -1
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/agent.d.ts +4 -0
- package/dist/types/ai-model/common.d.ts +115 -88
- package/dist/types/ai-model/index.d.ts +1 -1
- package/dist/types/device/index.d.ts +110 -1622
- package/package.json +3 -3
|
@@ -68,12 +68,16 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
68
68
|
value: string;
|
|
69
69
|
} & {
|
|
70
70
|
autoDismissKeyboard?: boolean;
|
|
71
|
+
} & {
|
|
72
|
+
append?: boolean;
|
|
71
73
|
}): Promise<any>;
|
|
72
74
|
/**
|
|
73
75
|
* @deprecated Use aiInput(locatePrompt, opt) instead where opt contains the value
|
|
74
76
|
*/
|
|
75
77
|
aiInput(value: string, locatePrompt: TUserPrompt, opt?: LocateOption & {
|
|
76
78
|
autoDismissKeyboard?: boolean;
|
|
79
|
+
} & {
|
|
80
|
+
append?: boolean;
|
|
77
81
|
}): Promise<any>;
|
|
78
82
|
aiKeyboardPress(locatePrompt: TUserPrompt, opt: LocateOption & {
|
|
79
83
|
keyName: string;
|
|
@@ -138,8 +138,7 @@ export declare const TUserPromptSchema: z.ZodUnion<[z.ZodString, z.ZodIntersecti
|
|
|
138
138
|
}>>]>;
|
|
139
139
|
export type TMultimodalPrompt = z.infer<typeof TMultimodalPromptSchema>;
|
|
140
140
|
export type TUserPrompt = z.infer<typeof TUserPromptSchema>;
|
|
141
|
-
declare const
|
|
142
|
-
midscene_location_field_flag: z.ZodLiteral<true>;
|
|
141
|
+
declare const MidsceneLocationInput: z.ZodObject<{
|
|
143
142
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
144
143
|
prompt: z.ZodString;
|
|
145
144
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -173,38 +172,8 @@ declare const MidsceneLocationResult: z.ZodObject<{
|
|
|
173
172
|
}>>]>;
|
|
174
173
|
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
175
174
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
xpath: z.ZodOptional<z.ZodBoolean
|
|
177
|
-
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
178
|
-
rect: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
179
|
-
left: z.ZodNumber;
|
|
180
|
-
top: z.ZodNumber;
|
|
181
|
-
}, "strip", z.ZodTypeAny, {
|
|
182
|
-
left: number;
|
|
183
|
-
top: number;
|
|
184
|
-
}, {
|
|
185
|
-
left: number;
|
|
186
|
-
top: number;
|
|
187
|
-
}>, z.ZodObject<{
|
|
188
|
-
width: z.ZodNumber;
|
|
189
|
-
height: z.ZodNumber;
|
|
190
|
-
dpr: z.ZodOptional<z.ZodNumber>;
|
|
191
|
-
}, "strip", z.ZodTypeAny, {
|
|
192
|
-
width: number;
|
|
193
|
-
height: number;
|
|
194
|
-
dpr?: number | undefined;
|
|
195
|
-
}, {
|
|
196
|
-
width: number;
|
|
197
|
-
height: number;
|
|
198
|
-
dpr?: number | undefined;
|
|
199
|
-
}>>, z.ZodObject<{
|
|
200
|
-
zoom: z.ZodOptional<z.ZodNumber>;
|
|
201
|
-
}, "strip", z.ZodTypeAny, {
|
|
202
|
-
zoom?: number | undefined;
|
|
203
|
-
}, {
|
|
204
|
-
zoom?: number | undefined;
|
|
205
|
-
}>>;
|
|
175
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
206
176
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
207
|
-
midscene_location_field_flag: z.ZodLiteral<true>;
|
|
208
177
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
209
178
|
prompt: z.ZodString;
|
|
210
179
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -238,37 +207,44 @@ declare const MidsceneLocationResult: z.ZodObject<{
|
|
|
238
207
|
}>>]>;
|
|
239
208
|
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
240
209
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
-
xpath: z.ZodOptional<z.ZodBoolean
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
top: z.ZodNumber;
|
|
210
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
211
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
212
|
+
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
213
|
+
prompt: z.ZodString;
|
|
246
214
|
}, "strip", z.ZodTypeAny, {
|
|
247
|
-
|
|
248
|
-
top: number;
|
|
215
|
+
prompt: string;
|
|
249
216
|
}, {
|
|
250
|
-
|
|
251
|
-
top: number;
|
|
217
|
+
prompt: string;
|
|
252
218
|
}>, z.ZodObject<{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}>>, z.ZodObject<{
|
|
265
|
-
zoom: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
url: z.ZodString;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
name: string;
|
|
224
|
+
url: string;
|
|
225
|
+
}, {
|
|
226
|
+
name: string;
|
|
227
|
+
url: string;
|
|
228
|
+
}>, "many">>>;
|
|
229
|
+
convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
266
230
|
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
|
|
231
|
+
images?: {
|
|
232
|
+
name: string;
|
|
233
|
+
url: string;
|
|
234
|
+
}[] | undefined;
|
|
235
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
268
236
|
}, {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
237
|
+
images?: {
|
|
238
|
+
name: string;
|
|
239
|
+
url: string;
|
|
240
|
+
}[] | undefined;
|
|
241
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
242
|
+
}>>]>;
|
|
243
|
+
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
244
|
+
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
246
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
247
|
+
declare const MidsceneLocationResult: z.ZodObject<{
|
|
272
248
|
midscene_location_field_flag: z.ZodLiteral<true>;
|
|
273
249
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
274
250
|
prompt: z.ZodString;
|
|
@@ -333,9 +309,7 @@ declare const MidsceneLocationResult: z.ZodObject<{
|
|
|
333
309
|
}, {
|
|
334
310
|
zoom?: number | undefined;
|
|
335
311
|
}>>;
|
|
336
|
-
}, z.ZodTypeAny,
|
|
337
|
-
export type MidsceneLocationResultType = z.infer<typeof MidsceneLocationResult>;
|
|
338
|
-
export declare const getMidsceneLocationSchema: () => z.ZodObject<{
|
|
312
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
339
313
|
midscene_location_field_flag: z.ZodLiteral<true>;
|
|
340
314
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
341
315
|
prompt: z.ZodString;
|
|
@@ -400,7 +374,7 @@ export declare const getMidsceneLocationSchema: () => z.ZodObject<{
|
|
|
400
374
|
}, {
|
|
401
375
|
zoom?: number | undefined;
|
|
402
376
|
}>>;
|
|
403
|
-
},
|
|
377
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
404
378
|
midscene_location_field_flag: z.ZodLiteral<true>;
|
|
405
379
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
406
380
|
prompt: z.ZodString;
|
|
@@ -465,8 +439,14 @@ export declare const getMidsceneLocationSchema: () => z.ZodObject<{
|
|
|
465
439
|
}, {
|
|
466
440
|
zoom?: number | undefined;
|
|
467
441
|
}>>;
|
|
468
|
-
}, z.ZodTypeAny, "passthrough"
|
|
469
|
-
|
|
442
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
443
|
+
export type MidsceneLocationResultType = z.infer<typeof MidsceneLocationResult>;
|
|
444
|
+
export type MidsceneLocationInputType = z.infer<typeof MidsceneLocationInput>;
|
|
445
|
+
/**
|
|
446
|
+
* Returns the schema for locator fields.
|
|
447
|
+
* This now returns the input schema which is more permissive and suitable for validation.
|
|
448
|
+
*/
|
|
449
|
+
export declare const getMidsceneLocationSchema: () => z.ZodObject<{
|
|
470
450
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
471
451
|
prompt: z.ZodString;
|
|
472
452
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -500,40 +480,87 @@ export declare const getMidsceneLocationSchema: () => z.ZodObject<{
|
|
|
500
480
|
}>>]>;
|
|
501
481
|
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
502
482
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
503
|
-
xpath: z.ZodOptional<z.ZodBoolean
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
top: z.ZodNumber;
|
|
483
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
484
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
485
|
+
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
486
|
+
prompt: z.ZodString;
|
|
508
487
|
}, "strip", z.ZodTypeAny, {
|
|
509
|
-
|
|
510
|
-
top: number;
|
|
488
|
+
prompt: string;
|
|
511
489
|
}, {
|
|
512
|
-
|
|
513
|
-
top: number;
|
|
490
|
+
prompt: string;
|
|
514
491
|
}>, z.ZodObject<{
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
492
|
+
images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
493
|
+
name: z.ZodString;
|
|
494
|
+
url: z.ZodString;
|
|
495
|
+
}, "strip", z.ZodTypeAny, {
|
|
496
|
+
name: string;
|
|
497
|
+
url: string;
|
|
498
|
+
}, {
|
|
499
|
+
name: string;
|
|
500
|
+
url: string;
|
|
501
|
+
}>, "many">>>;
|
|
502
|
+
convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
518
503
|
}, "strip", z.ZodTypeAny, {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
504
|
+
images?: {
|
|
505
|
+
name: string;
|
|
506
|
+
url: string;
|
|
507
|
+
}[] | undefined;
|
|
508
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
522
509
|
}, {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
510
|
+
images?: {
|
|
511
|
+
name: string;
|
|
512
|
+
url: string;
|
|
513
|
+
}[] | undefined;
|
|
514
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
515
|
+
}>>]>;
|
|
516
|
+
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
517
|
+
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
518
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
519
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
520
|
+
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
521
|
+
prompt: z.ZodString;
|
|
528
522
|
}, "strip", z.ZodTypeAny, {
|
|
529
|
-
|
|
523
|
+
prompt: string;
|
|
530
524
|
}, {
|
|
531
|
-
|
|
532
|
-
}
|
|
525
|
+
prompt: string;
|
|
526
|
+
}>, z.ZodObject<{
|
|
527
|
+
images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
528
|
+
name: z.ZodString;
|
|
529
|
+
url: z.ZodString;
|
|
530
|
+
}, "strip", z.ZodTypeAny, {
|
|
531
|
+
name: string;
|
|
532
|
+
url: string;
|
|
533
|
+
}, {
|
|
534
|
+
name: string;
|
|
535
|
+
url: string;
|
|
536
|
+
}>, "many">>>;
|
|
537
|
+
convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
538
|
+
}, "strip", z.ZodTypeAny, {
|
|
539
|
+
images?: {
|
|
540
|
+
name: string;
|
|
541
|
+
url: string;
|
|
542
|
+
}[] | undefined;
|
|
543
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
544
|
+
}, {
|
|
545
|
+
images?: {
|
|
546
|
+
name: string;
|
|
547
|
+
url: string;
|
|
548
|
+
}[] | undefined;
|
|
549
|
+
convertHttpImage2Base64?: boolean | undefined;
|
|
550
|
+
}>>]>;
|
|
551
|
+
deepThink: z.ZodOptional<z.ZodBoolean>;
|
|
552
|
+
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
553
|
+
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
533
554
|
}, z.ZodTypeAny, "passthrough">>;
|
|
534
555
|
export declare const ifMidsceneLocatorField: (field: any) => boolean;
|
|
535
556
|
export declare const dumpMidsceneLocatorField: (field: any) => string;
|
|
536
557
|
export declare const findAllMidsceneLocatorField: (zodType?: z.ZodType<any>, requiredOnly?: boolean) => string[];
|
|
537
558
|
export declare const dumpActionParam: (jsonObject: Record<string, any>, zodSchema: z.ZodType<any>) => Record<string, any>;
|
|
538
559
|
export declare const loadActionParam: (jsonObject: Record<string, any>, zodSchema: z.ZodType<any>) => Record<string, any>;
|
|
560
|
+
/**
|
|
561
|
+
* Parse and validate action parameters using Zod schema.
|
|
562
|
+
* All fields are validated through Zod, including locator fields which have their own schema.
|
|
563
|
+
* Default values defined in the schema are automatically applied.
|
|
564
|
+
*/
|
|
565
|
+
export declare const parseActionParam: (rawParam: Record<string, any>, zodSchema: z.ZodType<any>) => Record<string, any>;
|
|
539
566
|
export {};
|
|
@@ -10,4 +10,4 @@ export { adaptBboxToRect } from './common';
|
|
|
10
10
|
export { uiTarsPlanning, resizeImageForUiTars } from './ui-tars-planning';
|
|
11
11
|
export { ConversationHistory, type ConversationHistoryOptions, } from './conversation-history';
|
|
12
12
|
export { AIActionType, type AIArgs } from './common';
|
|
13
|
-
export { getMidsceneLocationSchema, type MidsceneLocationResultType, PointSchema, SizeSchema, RectSchema, TMultimodalPromptSchema, TUserPromptSchema, type TMultimodalPrompt, type TUserPrompt, findAllMidsceneLocatorField, dumpActionParam, loadActionParam, } from './common';
|
|
13
|
+
export { getMidsceneLocationSchema, type MidsceneLocationResultType, PointSchema, SizeSchema, RectSchema, TMultimodalPromptSchema, TUserPromptSchema, type TMultimodalPrompt, type TUserPrompt, findAllMidsceneLocatorField, dumpActionParam, loadActionParam, parseActionParam, } from './common';
|