@midscene/core 1.8.0 → 1.8.1
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 +2 -3
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/task-builder.mjs +2 -1
- package/dist/es/agent/task-builder.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +4 -3
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/usage-intent.mjs +18 -0
- package/dist/es/agent/usage-intent.mjs.map +1 -0
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/service-caller/codex-app-server.mjs +2 -1
- package/dist/es/ai-model/service-caller/codex-app-server.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +3 -2
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/device/index.mjs +169 -29
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/types.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +2 -3
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/task-builder.js +2 -1
- package/dist/lib/agent/task-builder.js.map +1 -1
- package/dist/lib/agent/tasks.js +4 -3
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/usage-intent.js +52 -0
- package/dist/lib/agent/usage-intent.js.map +1 -0
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/service-caller/codex-app-server.js +2 -1
- package/dist/lib/ai-model/service-caller/codex-app-server.js.map +1 -1
- package/dist/lib/ai-model/service-caller/index.js +3 -2
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/device/index.js +174 -28
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/types.js +2 -2
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/usage-intent.d.ts +3 -0
- package/dist/types/device/index.d.ts +157 -19
- package/dist/types/types.d.ts +8 -0
- package/package.json +2 -2
|
@@ -19,6 +19,97 @@ export interface MjpegStreamOptions {
|
|
|
19
19
|
onFrame(frame: MjpegStreamFrame): void;
|
|
20
20
|
onError?(error: unknown): void;
|
|
21
21
|
}
|
|
22
|
+
/** A point in device-pixel coordinates on the screen. */
|
|
23
|
+
export interface PointerPoint {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PointerInputPrimitives {
|
|
28
|
+
tap(p: PointerPoint, opts?: {
|
|
29
|
+
duration?: number;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
doubleClick?(p: PointerPoint): Promise<void>;
|
|
32
|
+
rightClick?(p: PointerPoint): Promise<void>;
|
|
33
|
+
hover?(p: PointerPoint): Promise<void>;
|
|
34
|
+
longPress?(p: PointerPoint, opts?: {
|
|
35
|
+
duration?: number;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
dragAndDrop?(from: PointerPoint, to: PointerPoint): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export interface TouchInputPrimitives {
|
|
40
|
+
swipe(start: PointerPoint, end: PointerPoint, opts?: {
|
|
41
|
+
duration?: number;
|
|
42
|
+
repeat?: number;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
pinch?(center: PointerPoint, opts: {
|
|
45
|
+
startDistance: number;
|
|
46
|
+
endDistance: number;
|
|
47
|
+
duration: number;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
export interface KeyboardInputPrimitives {
|
|
51
|
+
keyboardPress(keyName: string, opts?: {
|
|
52
|
+
target?: unknown;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
cursorMove?(direction: 'left' | 'right', times?: number): Promise<void>;
|
|
55
|
+
typeText(value: string, opts?: {
|
|
56
|
+
autoDismissKeyboard?: boolean;
|
|
57
|
+
target?: unknown;
|
|
58
|
+
replace?: boolean;
|
|
59
|
+
focusOnly?: boolean;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
clearInput(target?: unknown): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export interface ScrollInputPrimitives {
|
|
64
|
+
scroll(param: ActionScrollParam): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
export interface SystemInputPrimitives {
|
|
67
|
+
backButton?(): Promise<void>;
|
|
68
|
+
homeButton?(): Promise<void>;
|
|
69
|
+
recentAppsButton?(): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export interface InputPrimitives {
|
|
72
|
+
pointer?: PointerInputPrimitives;
|
|
73
|
+
keyboard?: KeyboardInputPrimitives;
|
|
74
|
+
touch?: TouchInputPrimitives;
|
|
75
|
+
scroll?: ScrollInputPrimitives;
|
|
76
|
+
system?: SystemInputPrimitives;
|
|
77
|
+
}
|
|
78
|
+
export interface MobileInputPrimitives extends InputPrimitives {
|
|
79
|
+
pointer: PointerInputPrimitives & {
|
|
80
|
+
doubleClick(p: PointerPoint): Promise<void>;
|
|
81
|
+
longPress(p: PointerPoint, opts?: {
|
|
82
|
+
duration?: number;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
dragAndDrop(from: PointerPoint, to: PointerPoint): Promise<void>;
|
|
85
|
+
};
|
|
86
|
+
keyboard: KeyboardInputPrimitives;
|
|
87
|
+
touch: TouchInputPrimitives;
|
|
88
|
+
}
|
|
89
|
+
export interface BrowserInputPrimitives extends InputPrimitives {
|
|
90
|
+
pointer: PointerInputPrimitives & {
|
|
91
|
+
doubleClick(p: PointerPoint): Promise<void>;
|
|
92
|
+
rightClick(p: PointerPoint): Promise<void>;
|
|
93
|
+
hover(p: PointerPoint): Promise<void>;
|
|
94
|
+
dragAndDrop(from: PointerPoint, to: PointerPoint): Promise<void>;
|
|
95
|
+
longPress(p: PointerPoint, opts?: {
|
|
96
|
+
duration?: number;
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
};
|
|
99
|
+
keyboard: KeyboardInputPrimitives;
|
|
100
|
+
scroll: ScrollInputPrimitives;
|
|
101
|
+
touch: TouchInputPrimitives;
|
|
102
|
+
}
|
|
103
|
+
export interface ComputerInputPrimitives extends InputPrimitives {
|
|
104
|
+
pointer: PointerInputPrimitives & {
|
|
105
|
+
doubleClick(p: PointerPoint): Promise<void>;
|
|
106
|
+
rightClick(p: PointerPoint): Promise<void>;
|
|
107
|
+
hover(p: PointerPoint): Promise<void>;
|
|
108
|
+
dragAndDrop(from: PointerPoint, to: PointerPoint): Promise<void>;
|
|
109
|
+
};
|
|
110
|
+
keyboard: KeyboardInputPrimitives;
|
|
111
|
+
scroll: ScrollInputPrimitives;
|
|
112
|
+
}
|
|
22
113
|
export declare abstract class AbstractInterface {
|
|
23
114
|
abstract interfaceType: string;
|
|
24
115
|
abstract screenshotBase64(): Promise<string>;
|
|
@@ -68,6 +159,12 @@ export declare abstract class AbstractInterface {
|
|
|
68
159
|
navigationState?(): Promise<{
|
|
69
160
|
isLoading: boolean;
|
|
70
161
|
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Low-level device input surface. Platform implementations expose transport
|
|
164
|
+
* primitives here; higher-level AI actions and manual pointer dispatch should
|
|
165
|
+
* adapt to this instead of duplicating platform gesture logic.
|
|
166
|
+
*/
|
|
167
|
+
inputPrimitives?: InputPrimitives;
|
|
71
168
|
}
|
|
72
169
|
export declare const defineAction: <TSchema extends z.ZodType | undefined = undefined, TRuntime = TSchema extends z.ZodType ? z.infer<TSchema> : undefined, TReturn = any>(config: {
|
|
73
170
|
name: string;
|
|
@@ -226,7 +323,7 @@ export declare const actionTapParamSchema: z.ZodObject<{
|
|
|
226
323
|
export type ActionTapParam = {
|
|
227
324
|
locate: LocateResultElement;
|
|
228
325
|
};
|
|
229
|
-
export declare const defineActionTap: (
|
|
326
|
+
export declare const defineActionTap: (tap: PointerInputPrimitives["tap"]) => DeviceAction<ActionTapParam>;
|
|
230
327
|
export declare const actionRightClickParamSchema: z.ZodObject<{
|
|
231
328
|
locate: z.ZodObject<{
|
|
232
329
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -377,7 +474,7 @@ export declare const actionRightClickParamSchema: z.ZodObject<{
|
|
|
377
474
|
export type ActionRightClickParam = {
|
|
378
475
|
locate: LocateResultElement;
|
|
379
476
|
};
|
|
380
|
-
export declare const defineActionRightClick: (
|
|
477
|
+
export declare const defineActionRightClick: (rightClick: NonNullable<PointerInputPrimitives["rightClick"]>) => DeviceAction<ActionRightClickParam>;
|
|
381
478
|
export declare const actionDoubleClickParamSchema: z.ZodObject<{
|
|
382
479
|
locate: z.ZodObject<{
|
|
383
480
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -528,7 +625,7 @@ export declare const actionDoubleClickParamSchema: z.ZodObject<{
|
|
|
528
625
|
export type ActionDoubleClickParam = {
|
|
529
626
|
locate: LocateResultElement;
|
|
530
627
|
};
|
|
531
|
-
export declare const defineActionDoubleClick: (
|
|
628
|
+
export declare const defineActionDoubleClick: (doubleClick: NonNullable<PointerInputPrimitives["doubleClick"]>) => DeviceAction<ActionDoubleClickParam>;
|
|
532
629
|
export declare const actionHoverParamSchema: z.ZodObject<{
|
|
533
630
|
locate: z.ZodObject<{
|
|
534
631
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -679,7 +776,7 @@ export declare const actionHoverParamSchema: z.ZodObject<{
|
|
|
679
776
|
export type ActionHoverParam = {
|
|
680
777
|
locate: LocateResultElement;
|
|
681
778
|
};
|
|
682
|
-
export declare const defineActionHover: (
|
|
779
|
+
export declare const defineActionHover: (hover: NonNullable<PointerInputPrimitives["hover"]>) => DeviceAction<ActionHoverParam>;
|
|
683
780
|
export declare const actionInputParamSchema: z.ZodObject<{
|
|
684
781
|
value: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>;
|
|
685
782
|
locate: z.ZodOptional<z.ZodObject<{
|
|
@@ -792,6 +889,7 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
792
889
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
793
890
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
794
891
|
mode: z.ZodDefault<z.ZodEnum<["replace", "clear", "typeOnly"]>>;
|
|
892
|
+
autoDismissKeyboard: z.ZodOptional<z.ZodBoolean>;
|
|
795
893
|
}, "strip", z.ZodTypeAny, {
|
|
796
894
|
value: string;
|
|
797
895
|
mode: "replace" | "clear" | "typeOnly";
|
|
@@ -832,6 +930,7 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
832
930
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
833
931
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
834
932
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
933
|
+
autoDismissKeyboard?: boolean | undefined;
|
|
835
934
|
}, {
|
|
836
935
|
value: string | number;
|
|
837
936
|
locate?: z.objectInputType<{
|
|
@@ -872,13 +971,15 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
872
971
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
873
972
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
874
973
|
mode?: "replace" | "clear" | "typeOnly" | undefined;
|
|
974
|
+
autoDismissKeyboard?: boolean | undefined;
|
|
875
975
|
}>;
|
|
876
976
|
export type ActionInputParam = {
|
|
877
977
|
value: string;
|
|
878
978
|
locate?: LocateResultElement;
|
|
879
979
|
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
980
|
+
autoDismissKeyboard?: boolean;
|
|
880
981
|
};
|
|
881
|
-
export declare const defineActionInput: (
|
|
982
|
+
export declare const defineActionInput: (keyboard: KeyboardInputPrimitives) => DeviceAction<ActionInputParam>;
|
|
882
983
|
export declare const actionKeyboardPressParamSchema: z.ZodObject<{
|
|
883
984
|
locate: z.ZodOptional<z.ZodObject<{
|
|
884
985
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -1073,7 +1174,7 @@ export type ActionKeyboardPressParam = {
|
|
|
1073
1174
|
locate?: LocateResultElement;
|
|
1074
1175
|
keyName: string;
|
|
1075
1176
|
};
|
|
1076
|
-
export declare const defineActionKeyboardPress: (
|
|
1177
|
+
export declare const defineActionKeyboardPress: (keyboardPress: KeyboardInputPrimitives["keyboardPress"]) => DeviceAction<ActionKeyboardPressParam>;
|
|
1077
1178
|
export declare const actionScrollParamSchema: z.ZodObject<{
|
|
1078
1179
|
scrollType: z.ZodDefault<z.ZodEnum<["singleAction", "scrollToBottom", "scrollToTop", "scrollToRight", "scrollToLeft"]>>;
|
|
1079
1180
|
direction: z.ZodDefault<z.ZodEnum<["down", "up", "right", "left"]>>;
|
|
@@ -1189,7 +1290,7 @@ export declare const actionScrollParamSchema: z.ZodObject<{
|
|
|
1189
1290
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1190
1291
|
}, "strip", z.ZodTypeAny, {
|
|
1191
1292
|
scrollType: "singleAction" | "scrollToBottom" | "scrollToTop" | "scrollToRight" | "scrollToLeft";
|
|
1192
|
-
direction: "
|
|
1293
|
+
direction: "left" | "right" | "down" | "up";
|
|
1193
1294
|
locate?: z.objectOutputType<{
|
|
1194
1295
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
1195
1296
|
prompt: z.ZodString;
|
|
@@ -1267,10 +1368,10 @@ export declare const actionScrollParamSchema: z.ZodObject<{
|
|
|
1267
1368
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
1268
1369
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1269
1370
|
scrollType?: "singleAction" | "scrollToBottom" | "scrollToTop" | "scrollToRight" | "scrollToLeft" | undefined;
|
|
1270
|
-
direction?: "
|
|
1371
|
+
direction?: "left" | "right" | "down" | "up" | undefined;
|
|
1271
1372
|
distance?: number | null | undefined;
|
|
1272
1373
|
}>;
|
|
1273
|
-
export declare const defineActionScroll: (
|
|
1374
|
+
export declare const defineActionScroll: (scroll: ScrollInputPrimitives["scroll"]) => DeviceAction<ActionScrollParam>;
|
|
1274
1375
|
export declare const actionDragAndDropParamSchema: z.ZodObject<{
|
|
1275
1376
|
from: z.ZodObject<{
|
|
1276
1377
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -1565,7 +1666,7 @@ export type ActionDragAndDropParam = {
|
|
|
1565
1666
|
from: LocateResultElement;
|
|
1566
1667
|
to: LocateResultElement;
|
|
1567
1668
|
};
|
|
1568
|
-
export declare const defineActionDragAndDrop: (
|
|
1669
|
+
export declare const defineActionDragAndDrop: (dragAndDrop: NonNullable<PointerInputPrimitives["dragAndDrop"]>) => DeviceAction<ActionDragAndDropParam>;
|
|
1569
1670
|
export declare const ActionLongPressParamSchema: z.ZodObject<{
|
|
1570
1671
|
locate: z.ZodObject<{
|
|
1571
1672
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -1720,7 +1821,7 @@ export type ActionLongPressParam = {
|
|
|
1720
1821
|
locate: LocateResultElement;
|
|
1721
1822
|
duration?: number;
|
|
1722
1823
|
};
|
|
1723
|
-
export declare const defineActionLongPress: (
|
|
1824
|
+
export declare const defineActionLongPress: (longPress: NonNullable<PointerInputPrimitives["longPress"]>) => DeviceAction<ActionLongPressParam>;
|
|
1724
1825
|
export declare const ActionSwipeParamSchema: z.ZodObject<{
|
|
1725
1826
|
start: z.ZodOptional<z.ZodObject<{
|
|
1726
1827
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -1946,7 +2047,7 @@ export declare const ActionSwipeParamSchema: z.ZodObject<{
|
|
|
1946
2047
|
repeat: z.ZodOptional<z.ZodNumber>;
|
|
1947
2048
|
}, "strip", z.ZodTypeAny, {
|
|
1948
2049
|
duration: number;
|
|
1949
|
-
direction?: "
|
|
2050
|
+
direction?: "left" | "right" | "down" | "up" | undefined;
|
|
1950
2051
|
distance?: number | undefined;
|
|
1951
2052
|
start?: z.objectOutputType<{
|
|
1952
2053
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -2024,7 +2125,7 @@ export declare const ActionSwipeParamSchema: z.ZodObject<{
|
|
|
2024
2125
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2025
2126
|
repeat?: number | undefined;
|
|
2026
2127
|
}, {
|
|
2027
|
-
direction?: "
|
|
2128
|
+
direction?: "left" | "right" | "down" | "up" | undefined;
|
|
2028
2129
|
distance?: number | undefined;
|
|
2029
2130
|
duration?: number | undefined;
|
|
2030
2131
|
start?: z.objectInputType<{
|
|
@@ -2126,7 +2227,10 @@ export declare function normalizeMobileSwipeParam(param: ActionSwipeParam, scree
|
|
|
2126
2227
|
duration: number;
|
|
2127
2228
|
repeatCount: number;
|
|
2128
2229
|
};
|
|
2129
|
-
export declare const defineActionSwipe: (
|
|
2230
|
+
export declare const defineActionSwipe: (config: {
|
|
2231
|
+
swipe: TouchInputPrimitives["swipe"];
|
|
2232
|
+
size(): Promise<Size>;
|
|
2233
|
+
}) => DeviceAction<ActionSwipeParam>;
|
|
2130
2234
|
export declare const actionClearInputParamSchema: z.ZodObject<{
|
|
2131
2235
|
locate: z.ZodOptional<z.ZodObject<{
|
|
2132
2236
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -2317,22 +2421,25 @@ export declare const actionClearInputParamSchema: z.ZodObject<{
|
|
|
2317
2421
|
export type ActionClearInputParam = {
|
|
2318
2422
|
locate?: LocateResultElement;
|
|
2319
2423
|
};
|
|
2320
|
-
export declare const defineActionClearInput: (
|
|
2424
|
+
export declare const defineActionClearInput: (clearInput: KeyboardInputPrimitives["clearInput"]) => DeviceAction<ActionClearInputParam>;
|
|
2321
2425
|
export declare const actionCursorMoveParamSchema: z.ZodObject<{
|
|
2322
2426
|
direction: z.ZodEnum<["left", "right"]>;
|
|
2323
2427
|
times: z.ZodDefault<z.ZodNumber>;
|
|
2324
2428
|
}, "strip", z.ZodTypeAny, {
|
|
2325
|
-
direction: "
|
|
2429
|
+
direction: "left" | "right";
|
|
2326
2430
|
times: number;
|
|
2327
2431
|
}, {
|
|
2328
|
-
direction: "
|
|
2432
|
+
direction: "left" | "right";
|
|
2329
2433
|
times?: number | undefined;
|
|
2330
2434
|
}>;
|
|
2331
2435
|
export type ActionCursorMoveParam = {
|
|
2332
2436
|
direction: 'left' | 'right';
|
|
2333
2437
|
times?: number;
|
|
2334
2438
|
};
|
|
2335
|
-
export declare const defineActionCursorMove: (
|
|
2439
|
+
export declare const defineActionCursorMove: (config: {
|
|
2440
|
+
keyboard: Pick<KeyboardInputPrimitives, "keyboardPress" | "cursorMove">;
|
|
2441
|
+
sleep?(timeMs: number): Promise<void>;
|
|
2442
|
+
}) => DeviceAction<ActionCursorMoveParam>;
|
|
2336
2443
|
export declare const ActionPinchParamSchema: z.ZodObject<{
|
|
2337
2444
|
locate: z.ZodOptional<z.ZodObject<{
|
|
2338
2445
|
prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
|
|
@@ -2535,7 +2642,10 @@ export type ActionPinchParam = {
|
|
|
2535
2642
|
distance?: number;
|
|
2536
2643
|
duration?: number;
|
|
2537
2644
|
};
|
|
2538
|
-
export declare const defineActionPinch: (
|
|
2645
|
+
export declare const defineActionPinch: (config: {
|
|
2646
|
+
pinch: TouchInputPrimitives["pinch"];
|
|
2647
|
+
size(): Promise<Size>;
|
|
2648
|
+
}) => DeviceAction<ActionPinchParam> | undefined;
|
|
2539
2649
|
export declare function normalizePinchParam(param: ActionPinchParam, screenSize: {
|
|
2540
2650
|
width: number;
|
|
2541
2651
|
height: number;
|
|
@@ -2546,6 +2656,34 @@ export declare function normalizePinchParam(param: ActionPinchParam, screenSize:
|
|
|
2546
2656
|
endDistance: number;
|
|
2547
2657
|
duration: number;
|
|
2548
2658
|
};
|
|
2659
|
+
export interface MobileInputActionContext {
|
|
2660
|
+
input: MobileInputPrimitives;
|
|
2661
|
+
size(): Promise<Size>;
|
|
2662
|
+
sleep?(timeMs: number): Promise<void>;
|
|
2663
|
+
getDefaultAutoDismissKeyboard?(): boolean | undefined;
|
|
2664
|
+
systemActions?: SystemInputActionOptions;
|
|
2665
|
+
}
|
|
2666
|
+
export interface SystemInputActionConfig {
|
|
2667
|
+
name: string;
|
|
2668
|
+
description: string;
|
|
2669
|
+
interfaceAlias?: string;
|
|
2670
|
+
delayBeforeRunner?: number;
|
|
2671
|
+
delayAfterRunner?: number;
|
|
2672
|
+
}
|
|
2673
|
+
export interface SystemInputActionOptions {
|
|
2674
|
+
backButton?: SystemInputActionConfig;
|
|
2675
|
+
homeButton?: SystemInputActionConfig;
|
|
2676
|
+
recentAppsButton?: SystemInputActionConfig;
|
|
2677
|
+
}
|
|
2678
|
+
export interface InputPrimitiveActionOptions {
|
|
2679
|
+
size?: () => Promise<Size>;
|
|
2680
|
+
sleep?: (timeMs: number) => Promise<void>;
|
|
2681
|
+
includeSwipe?: boolean;
|
|
2682
|
+
includePinch?: boolean;
|
|
2683
|
+
systemActions?: SystemInputActionOptions;
|
|
2684
|
+
}
|
|
2685
|
+
export declare function defineActionsFromInputPrimitives(input: InputPrimitives, options?: InputPrimitiveActionOptions): DeviceAction<any>[];
|
|
2686
|
+
export declare function createDefaultMobileActions(context: MobileInputActionContext): DeviceAction<any>[];
|
|
2549
2687
|
export declare const ActionSleepParamSchema: z.ZodObject<{
|
|
2550
2688
|
timeMs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2551
2689
|
}, "strip", z.ZodTypeAny, {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -15,7 +15,15 @@ export type AIUsageInfo = Record<string, any> & {
|
|
|
15
15
|
time_cost: number | undefined;
|
|
16
16
|
model_name: string | undefined;
|
|
17
17
|
model_description: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Semantic intent of the model call, such as default, planning, or insight.
|
|
20
|
+
*/
|
|
18
21
|
intent: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Config slot where the model config was resolved from. For example, a
|
|
24
|
+
* planning call may use the default slot when no planning model is configured.
|
|
25
|
+
*/
|
|
26
|
+
slot: string | undefined;
|
|
19
27
|
request_id: string | undefined;
|
|
20
28
|
};
|
|
21
29
|
export type { LocateResultElement };
|
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": "1.8.
|
|
4
|
+
"version": "1.8.1",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"semver": "7.5.2",
|
|
98
98
|
"undici": "^6.0.0",
|
|
99
99
|
"zod": "^3.25.1",
|
|
100
|
-
"@midscene/shared": "1.8.
|
|
100
|
+
"@midscene/shared": "1.8.1"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@rslib/core": "^0.18.3",
|