@donggui/core 1.5.4-donggui.3
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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/es/agent/agent.mjs +709 -0
- package/dist/es/agent/agent.mjs.map +1 -0
- package/dist/es/agent/common.mjs +0 -0
- package/dist/es/agent/execution-session.mjs +41 -0
- package/dist/es/agent/execution-session.mjs.map +1 -0
- package/dist/es/agent/index.mjs +6 -0
- package/dist/es/agent/task-builder.mjs +330 -0
- package/dist/es/agent/task-builder.mjs.map +1 -0
- package/dist/es/agent/task-cache.mjs +186 -0
- package/dist/es/agent/task-cache.mjs.map +1 -0
- package/dist/es/agent/tasks.mjs +422 -0
- package/dist/es/agent/tasks.mjs.map +1 -0
- package/dist/es/agent/ui-utils.mjs +91 -0
- package/dist/es/agent/ui-utils.mjs.map +1 -0
- package/dist/es/agent/utils.mjs +198 -0
- package/dist/es/agent/utils.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/actions.mjs +224 -0
- package/dist/es/ai-model/auto-glm/actions.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/index.mjs +6 -0
- package/dist/es/ai-model/auto-glm/parser.mjs +239 -0
- package/dist/es/ai-model/auto-glm/parser.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/planning.mjs +71 -0
- package/dist/es/ai-model/auto-glm/planning.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/prompt.mjs +222 -0
- package/dist/es/ai-model/auto-glm/prompt.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/util.mjs +9 -0
- package/dist/es/ai-model/auto-glm/util.mjs.map +1 -0
- package/dist/es/ai-model/conversation-history.mjs +195 -0
- package/dist/es/ai-model/conversation-history.mjs.map +1 -0
- package/dist/es/ai-model/index.mjs +11 -0
- package/dist/es/ai-model/inspect.mjs +386 -0
- package/dist/es/ai-model/inspect.mjs.map +1 -0
- package/dist/es/ai-model/llm-planning.mjs +233 -0
- package/dist/es/ai-model/llm-planning.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 +66 -0
- package/dist/es/ai-model/prompt/describe.mjs.map +1 -0
- package/dist/es/ai-model/prompt/extraction.mjs +129 -0
- package/dist/es/ai-model/prompt/extraction.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs +51 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs +364 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs +44 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/order-sensitive-judge.mjs +35 -0
- package/dist/es/ai-model/prompt/order-sensitive-judge.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-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 +59 -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 +466 -0
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -0
- package/dist/es/ai-model/ui-tars-planning.mjs +249 -0
- package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -0
- package/dist/es/common.mjs +371 -0
- package/dist/es/common.mjs.map +1 -0
- package/dist/es/device/device-options.mjs +0 -0
- package/dist/es/device/index.mjs +300 -0
- package/dist/es/device/index.mjs.map +1 -0
- package/dist/es/dump/html-utils.mjs +211 -0
- package/dist/es/dump/html-utils.mjs.map +1 -0
- package/dist/es/dump/image-restoration.mjs +43 -0
- package/dist/es/dump/image-restoration.mjs.map +1 -0
- package/dist/es/dump/index.mjs +3 -0
- package/dist/es/index.mjs +15 -0
- package/dist/es/index.mjs.map +1 -0
- package/dist/es/report-generator.mjs +134 -0
- package/dist/es/report-generator.mjs.map +1 -0
- package/dist/es/report.mjs +111 -0
- package/dist/es/report.mjs.map +1 -0
- package/dist/es/screenshot-item.mjs +105 -0
- package/dist/es/screenshot-item.mjs.map +1 -0
- package/dist/es/service/index.mjs +256 -0
- package/dist/es/service/index.mjs.map +1 -0
- package/dist/es/service/utils.mjs +15 -0
- package/dist/es/service/utils.mjs.map +1 -0
- package/dist/es/skill/index.mjs +38 -0
- package/dist/es/skill/index.mjs.map +1 -0
- package/dist/es/task-runner.mjs +258 -0
- package/dist/es/task-runner.mjs.map +1 -0
- package/dist/es/task-timing.mjs +12 -0
- package/dist/es/task-timing.mjs.map +1 -0
- package/dist/es/tree.mjs +13 -0
- package/dist/es/tree.mjs.map +1 -0
- package/dist/es/types.mjs +196 -0
- package/dist/es/types.mjs.map +1 -0
- package/dist/es/utils.mjs +218 -0
- package/dist/es/utils.mjs.map +1 -0
- package/dist/es/yaml/builder.mjs +13 -0
- package/dist/es/yaml/builder.mjs.map +1 -0
- package/dist/es/yaml/index.mjs +4 -0
- package/dist/es/yaml/player.mjs +418 -0
- package/dist/es/yaml/player.mjs.map +1 -0
- package/dist/es/yaml/utils.mjs +73 -0
- package/dist/es/yaml/utils.mjs.map +1 -0
- package/dist/es/yaml.mjs +0 -0
- package/dist/lib/agent/agent.js +757 -0
- package/dist/lib/agent/agent.js.map +1 -0
- package/dist/lib/agent/common.js +5 -0
- package/dist/lib/agent/execution-session.js +75 -0
- package/dist/lib/agent/execution-session.js.map +1 -0
- package/dist/lib/agent/index.js +81 -0
- package/dist/lib/agent/index.js.map +1 -0
- package/dist/lib/agent/task-builder.js +367 -0
- package/dist/lib/agent/task-builder.js.map +1 -0
- package/dist/lib/agent/task-cache.js +238 -0
- package/dist/lib/agent/task-cache.js.map +1 -0
- package/dist/lib/agent/tasks.js +465 -0
- package/dist/lib/agent/tasks.js.map +1 -0
- package/dist/lib/agent/ui-utils.js +143 -0
- package/dist/lib/agent/ui-utils.js.map +1 -0
- package/dist/lib/agent/utils.js +275 -0
- package/dist/lib/agent/utils.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/actions.js +258 -0
- package/dist/lib/ai-model/auto-glm/actions.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/index.js +66 -0
- package/dist/lib/ai-model/auto-glm/index.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/parser.js +282 -0
- package/dist/lib/ai-model/auto-glm/parser.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/planning.js +105 -0
- package/dist/lib/ai-model/auto-glm/planning.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/prompt.js +259 -0
- package/dist/lib/ai-model/auto-glm/prompt.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/util.js +46 -0
- package/dist/lib/ai-model/auto-glm/util.js.map +1 -0
- package/dist/lib/ai-model/conversation-history.js +229 -0
- package/dist/lib/ai-model/conversation-history.js.map +1 -0
- package/dist/lib/ai-model/index.js +125 -0
- package/dist/lib/ai-model/index.js.map +1 -0
- package/dist/lib/ai-model/inspect.js +429 -0
- package/dist/lib/ai-model/inspect.js.map +1 -0
- package/dist/lib/ai-model/llm-planning.js +270 -0
- package/dist/lib/ai-model/llm-planning.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 +100 -0
- package/dist/lib/ai-model/prompt/describe.js.map +1 -0
- package/dist/lib/ai-model/prompt/extraction.js +169 -0
- package/dist/lib/ai-model/prompt/extraction.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-locator.js +88 -0
- package/dist/lib/ai-model/prompt/llm-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-planning.js +401 -0
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js +81 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/order-sensitive-judge.js +72 -0
- package/dist/lib/ai-model/prompt/order-sensitive-judge.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-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 +105 -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 +531 -0
- package/dist/lib/ai-model/service-caller/index.js.map +1 -0
- package/dist/lib/ai-model/ui-tars-planning.js +283 -0
- package/dist/lib/ai-model/ui-tars-planning.js.map +1 -0
- package/dist/lib/common.js +480 -0
- package/dist/lib/common.js.map +1 -0
- package/dist/lib/device/device-options.js +20 -0
- package/dist/lib/device/device-options.js.map +1 -0
- package/dist/lib/device/index.js +418 -0
- package/dist/lib/device/index.js.map +1 -0
- package/dist/lib/dump/html-utils.js +281 -0
- package/dist/lib/dump/html-utils.js.map +1 -0
- package/dist/lib/dump/image-restoration.js +77 -0
- package/dist/lib/dump/image-restoration.js.map +1 -0
- package/dist/lib/dump/index.js +60 -0
- package/dist/lib/dump/index.js.map +1 -0
- package/dist/lib/index.js +146 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/report-generator.js +172 -0
- package/dist/lib/report-generator.js.map +1 -0
- package/dist/lib/report.js +145 -0
- package/dist/lib/report.js.map +1 -0
- package/dist/lib/screenshot-item.js +139 -0
- package/dist/lib/screenshot-item.js.map +1 -0
- package/dist/lib/service/index.js +290 -0
- package/dist/lib/service/index.js.map +1 -0
- package/dist/lib/service/utils.js +49 -0
- package/dist/lib/service/utils.js.map +1 -0
- package/dist/lib/skill/index.js +72 -0
- package/dist/lib/skill/index.js.map +1 -0
- package/dist/lib/task-runner.js +295 -0
- package/dist/lib/task-runner.js.map +1 -0
- package/dist/lib/task-timing.js +46 -0
- package/dist/lib/task-timing.js.map +1 -0
- package/dist/lib/tree.js +53 -0
- package/dist/lib/tree.js.map +1 -0
- package/dist/lib/types.js +285 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.js +297 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/yaml/builder.js +57 -0
- package/dist/lib/yaml/builder.js.map +1 -0
- package/dist/lib/yaml/index.js +81 -0
- package/dist/lib/yaml/index.js.map +1 -0
- package/dist/lib/yaml/player.js +452 -0
- package/dist/lib/yaml/player.js.map +1 -0
- package/dist/lib/yaml/utils.js +126 -0
- package/dist/lib/yaml/utils.js.map +1 -0
- package/dist/lib/yaml.js +20 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/types/agent/agent.d.ts +190 -0
- package/dist/types/agent/common.d.ts +0 -0
- package/dist/types/agent/execution-session.d.ts +36 -0
- package/dist/types/agent/index.d.ts +10 -0
- package/dist/types/agent/task-builder.d.ts +34 -0
- package/dist/types/agent/task-cache.d.ts +48 -0
- package/dist/types/agent/tasks.d.ts +70 -0
- package/dist/types/agent/ui-utils.d.ts +14 -0
- package/dist/types/agent/utils.d.ts +29 -0
- package/dist/types/ai-model/auto-glm/actions.d.ts +77 -0
- package/dist/types/ai-model/auto-glm/index.d.ts +6 -0
- package/dist/types/ai-model/auto-glm/parser.d.ts +18 -0
- package/dist/types/ai-model/auto-glm/planning.d.ts +10 -0
- package/dist/types/ai-model/auto-glm/prompt.d.ts +27 -0
- package/dist/types/ai-model/auto-glm/util.d.ts +13 -0
- package/dist/types/ai-model/conversation-history.d.ts +105 -0
- package/dist/types/ai-model/index.d.ts +14 -0
- package/dist/types/ai-model/inspect.d.ts +58 -0
- package/dist/types/ai-model/llm-planning.d.ts +19 -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 +7 -0
- package/dist/types/ai-model/prompt/llm-locator.d.ts +3 -0
- package/dist/types/ai-model/prompt/llm-planning.d.ts +10 -0
- package/dist/types/ai-model/prompt/llm-section-locator.d.ts +3 -0
- package/dist/types/ai-model/prompt/order-sensitive-judge.d.ts +2 -0
- package/dist/types/ai-model/prompt/playwright-generator.d.ts +26 -0
- package/dist/types/ai-model/prompt/ui-tars-planning.d.ts +2 -0
- package/dist/types/ai-model/prompt/util.d.ts +33 -0
- package/dist/types/ai-model/prompt/yaml-generator.d.ts +100 -0
- package/dist/types/ai-model/service-caller/index.d.ts +49 -0
- package/dist/types/ai-model/ui-tars-planning.d.ts +72 -0
- package/dist/types/common.d.ts +288 -0
- package/dist/types/device/device-options.d.ts +142 -0
- package/dist/types/device/index.d.ts +2315 -0
- package/dist/types/dump/html-utils.d.ts +52 -0
- package/dist/types/dump/image-restoration.d.ts +6 -0
- package/dist/types/dump/index.d.ts +5 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/report-generator.d.ts +48 -0
- package/dist/types/report.d.ts +15 -0
- package/dist/types/screenshot-item.d.ts +66 -0
- package/dist/types/service/index.d.ts +23 -0
- package/dist/types/service/utils.d.ts +2 -0
- package/dist/types/skill/index.d.ts +25 -0
- package/dist/types/task-runner.d.ts +48 -0
- package/dist/types/task-timing.d.ts +8 -0
- package/dist/types/tree.d.ts +4 -0
- package/dist/types/types.d.ts +645 -0
- package/dist/types/utils.d.ts +40 -0
- package/dist/types/yaml/builder.d.ts +2 -0
- package/dist/types/yaml/index.d.ts +4 -0
- package/dist/types/yaml/player.d.ts +34 -0
- package/dist/types/yaml/utils.d.ts +9 -0
- package/dist/types/yaml.d.ts +203 -0
- package/package.json +111 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
normalizeMobileSwipeParam: ()=>normalizeMobileSwipeParam,
|
|
28
|
+
ActionLongPressParamSchema: ()=>ActionLongPressParamSchema,
|
|
29
|
+
ActionSleepParamSchema: ()=>ActionSleepParamSchema,
|
|
30
|
+
actionScrollParamSchema: ()=>actionScrollParamSchema,
|
|
31
|
+
defineActionDragAndDrop: ()=>defineActionDragAndDrop,
|
|
32
|
+
actionRightClickParamSchema: ()=>actionRightClickParamSchema,
|
|
33
|
+
defineActionDoubleClick: ()=>defineActionDoubleClick,
|
|
34
|
+
actionInputParamSchema: ()=>actionInputParamSchema,
|
|
35
|
+
actionKeyboardPressParamSchema: ()=>actionKeyboardPressParamSchema,
|
|
36
|
+
AbstractInterface: ()=>AbstractInterface,
|
|
37
|
+
actionClearInputParamSchema: ()=>actionClearInputParamSchema,
|
|
38
|
+
actionHoverParamSchema: ()=>actionHoverParamSchema,
|
|
39
|
+
ActionSwipeParamSchema: ()=>ActionSwipeParamSchema,
|
|
40
|
+
defineActionScroll: ()=>defineActionScroll,
|
|
41
|
+
defineActionClearInput: ()=>defineActionClearInput,
|
|
42
|
+
defineActionTap: ()=>defineActionTap,
|
|
43
|
+
actionCursorMoveParamSchema: ()=>actionCursorMoveParamSchema,
|
|
44
|
+
defineActionLongPress: ()=>defineActionLongPress,
|
|
45
|
+
defineActionSleep: ()=>defineActionSleep,
|
|
46
|
+
defineActionSwipe: ()=>defineActionSwipe,
|
|
47
|
+
actionDoubleClickParamSchema: ()=>actionDoubleClickParamSchema,
|
|
48
|
+
actionTapParamSchema: ()=>actionTapParamSchema,
|
|
49
|
+
defineActionHover: ()=>defineActionHover,
|
|
50
|
+
defineActionInput: ()=>defineActionInput,
|
|
51
|
+
defineAction: ()=>defineAction,
|
|
52
|
+
actionDragAndDropParamSchema: ()=>actionDragAndDropParamSchema,
|
|
53
|
+
defineActionRightClick: ()=>defineActionRightClick,
|
|
54
|
+
defineActionCursorMove: ()=>defineActionCursorMove,
|
|
55
|
+
defineActionKeyboardPress: ()=>defineActionKeyboardPress
|
|
56
|
+
});
|
|
57
|
+
const external_common_js_namespaceObject = require("../common.js");
|
|
58
|
+
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
59
|
+
const external_zod_namespaceObject = require("zod");
|
|
60
|
+
function _define_property(obj, key, value) {
|
|
61
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
62
|
+
value: value,
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true
|
|
66
|
+
});
|
|
67
|
+
else obj[key] = value;
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
class AbstractInterface {
|
|
71
|
+
constructor(){
|
|
72
|
+
_define_property(this, "mjpegStreamUrl", void 0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const defineAction = (config)=>config;
|
|
76
|
+
const actionTapParamSchema = external_zod_namespaceObject.z.object({
|
|
77
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be tapped')
|
|
78
|
+
});
|
|
79
|
+
const defineActionTap = (call)=>defineAction({
|
|
80
|
+
name: 'Tap',
|
|
81
|
+
description: 'Tap the element',
|
|
82
|
+
interfaceAlias: 'aiTap',
|
|
83
|
+
paramSchema: actionTapParamSchema,
|
|
84
|
+
sample: {
|
|
85
|
+
locate: {
|
|
86
|
+
prompt: 'the "Submit" button'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
call
|
|
90
|
+
});
|
|
91
|
+
const actionRightClickParamSchema = external_zod_namespaceObject.z.object({
|
|
92
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be right clicked')
|
|
93
|
+
});
|
|
94
|
+
const defineActionRightClick = (call)=>defineAction({
|
|
95
|
+
name: 'RightClick',
|
|
96
|
+
description: 'Right click the element',
|
|
97
|
+
interfaceAlias: 'aiRightClick',
|
|
98
|
+
paramSchema: actionRightClickParamSchema,
|
|
99
|
+
sample: {
|
|
100
|
+
locate: {
|
|
101
|
+
prompt: 'the file icon on the desktop'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
call
|
|
105
|
+
});
|
|
106
|
+
const actionDoubleClickParamSchema = external_zod_namespaceObject.z.object({
|
|
107
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be double clicked')
|
|
108
|
+
});
|
|
109
|
+
const defineActionDoubleClick = (call)=>defineAction({
|
|
110
|
+
name: 'DoubleClick',
|
|
111
|
+
description: 'Double click the element',
|
|
112
|
+
interfaceAlias: 'aiDoubleClick',
|
|
113
|
+
paramSchema: actionDoubleClickParamSchema,
|
|
114
|
+
sample: {
|
|
115
|
+
locate: {
|
|
116
|
+
prompt: 'the folder icon'
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
call
|
|
120
|
+
});
|
|
121
|
+
const actionHoverParamSchema = external_zod_namespaceObject.z.object({
|
|
122
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be hovered')
|
|
123
|
+
});
|
|
124
|
+
const defineActionHover = (call)=>defineAction({
|
|
125
|
+
name: 'Hover',
|
|
126
|
+
description: 'Move the mouse to the element',
|
|
127
|
+
interfaceAlias: 'aiHover',
|
|
128
|
+
paramSchema: actionHoverParamSchema,
|
|
129
|
+
sample: {
|
|
130
|
+
locate: {
|
|
131
|
+
prompt: 'the navigation menu item "Products"'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
call
|
|
135
|
+
});
|
|
136
|
+
const inputLocateDescription = 'the position of the placeholder or text content in the target input field. If there is no content, locate the center of the input field.';
|
|
137
|
+
const actionInputParamSchema = external_zod_namespaceObject.z.object({
|
|
138
|
+
value: external_zod_namespaceObject.z.union([
|
|
139
|
+
external_zod_namespaceObject.z.string(),
|
|
140
|
+
external_zod_namespaceObject.z.number()
|
|
141
|
+
]).transform((val)=>String(val)).describe('The text to input. Provide the final content for replace/append modes, or an empty string when using clear mode to remove existing text.'),
|
|
142
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe(inputLocateDescription).optional(),
|
|
143
|
+
mode: external_zod_namespaceObject.z["enum"]([
|
|
144
|
+
'replace',
|
|
145
|
+
'clear',
|
|
146
|
+
'typeOnly'
|
|
147
|
+
]).default('replace').describe('Input mode: "replace" (default) - clear the field and input the value; "typeOnly" - type the value directly without clearing the field first; "clear" - clear the field without inputting new text.')
|
|
148
|
+
});
|
|
149
|
+
const defineActionInput = (call)=>defineAction({
|
|
150
|
+
name: 'Input',
|
|
151
|
+
description: 'Input the value into the element',
|
|
152
|
+
interfaceAlias: 'aiInput',
|
|
153
|
+
paramSchema: actionInputParamSchema,
|
|
154
|
+
sample: {
|
|
155
|
+
value: 'test@example.com',
|
|
156
|
+
locate: {
|
|
157
|
+
prompt: 'the email input field'
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
call: (param)=>{
|
|
161
|
+
if ('append' === param.mode) param.mode = 'typeOnly';
|
|
162
|
+
return call(param);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const actionKeyboardPressParamSchema = external_zod_namespaceObject.z.object({
|
|
166
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be clicked before pressing the key').optional(),
|
|
167
|
+
keyName: external_zod_namespaceObject.z.string().describe("The key to be pressed. Use '+' for key combinations, e.g., 'Control+A', 'Shift+Enter'")
|
|
168
|
+
});
|
|
169
|
+
const defineActionKeyboardPress = (call)=>defineAction({
|
|
170
|
+
name: 'KeyboardPress',
|
|
171
|
+
description: 'Press a key or key combination, like "Enter", "Tab", "Escape", or "Control+A", "Shift+Enter". Do not use this to type text.',
|
|
172
|
+
interfaceAlias: 'aiKeyboardPress',
|
|
173
|
+
paramSchema: actionKeyboardPressParamSchema,
|
|
174
|
+
sample: {
|
|
175
|
+
keyName: 'Enter'
|
|
176
|
+
},
|
|
177
|
+
call
|
|
178
|
+
});
|
|
179
|
+
const actionScrollParamSchema = external_zod_namespaceObject.z.object({
|
|
180
|
+
scrollType: external_zod_namespaceObject.z["enum"]([
|
|
181
|
+
'singleAction',
|
|
182
|
+
'scrollToBottom',
|
|
183
|
+
'scrollToTop',
|
|
184
|
+
'scrollToRight',
|
|
185
|
+
'scrollToLeft'
|
|
186
|
+
]).default('singleAction').describe('The scroll behavior: "singleAction" for a single scroll action, "scrollToBottom" for scrolling all the way to the bottom by rapidly scrolling 5-10 times (skipping intermediate content until reaching the bottom), "scrollToTop" for scrolling all the way to the top by rapidly scrolling 5-10 times (skipping intermediate content until reaching the top), "scrollToRight" for scrolling all the way to the right by rapidly scrolling multiple times, "scrollToLeft" for scrolling all the way to the left by rapidly scrolling multiple times'),
|
|
187
|
+
direction: external_zod_namespaceObject.z["enum"]([
|
|
188
|
+
'down',
|
|
189
|
+
'up',
|
|
190
|
+
'right',
|
|
191
|
+
'left'
|
|
192
|
+
]).default('down').describe('The direction to scroll. Only effective when scrollType is "singleAction".'),
|
|
193
|
+
distance: external_zod_namespaceObject.z.number().nullable().optional().describe('The distance in pixels to scroll'),
|
|
194
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().optional().describe('Describe the target element to be scrolled on, like "the table" or "the list" or "the content area" or "the scrollable area". Do NOT provide a general intent like "scroll to find some element"')
|
|
195
|
+
});
|
|
196
|
+
const defineActionScroll = (call)=>defineAction({
|
|
197
|
+
name: 'Scroll',
|
|
198
|
+
description: 'Scroll the page or a scrollable element to browse content. This is the preferred way to scroll on all platforms, including mobile. Supports scrollToBottom/scrollToTop for boundary navigation. Default: direction `down`, scrollType `singleAction`, distance `null`.',
|
|
199
|
+
interfaceAlias: 'aiScroll',
|
|
200
|
+
paramSchema: actionScrollParamSchema,
|
|
201
|
+
sample: {
|
|
202
|
+
direction: 'down',
|
|
203
|
+
scrollType: 'singleAction',
|
|
204
|
+
locate: {
|
|
205
|
+
prompt: 'the center of the product list area'
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
call
|
|
209
|
+
});
|
|
210
|
+
const actionDragAndDropParamSchema = external_zod_namespaceObject.z.object({
|
|
211
|
+
from: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The position to be dragged'),
|
|
212
|
+
to: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The position to be dropped')
|
|
213
|
+
});
|
|
214
|
+
const defineActionDragAndDrop = (call)=>defineAction({
|
|
215
|
+
name: 'DragAndDrop',
|
|
216
|
+
description: 'Pick up a specific UI element and move it to a new position (e.g., reorder a card, move a file into a folder, sort list items). The element itself moves with your finger/mouse.',
|
|
217
|
+
interfaceAlias: 'aiDragAndDrop',
|
|
218
|
+
paramSchema: actionDragAndDropParamSchema,
|
|
219
|
+
sample: {
|
|
220
|
+
from: {
|
|
221
|
+
prompt: 'the "report.pdf" file icon'
|
|
222
|
+
},
|
|
223
|
+
to: {
|
|
224
|
+
prompt: 'the upload drop zone'
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
call
|
|
228
|
+
});
|
|
229
|
+
const ActionLongPressParamSchema = external_zod_namespaceObject.z.object({
|
|
230
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The element to be long pressed'),
|
|
231
|
+
duration: external_zod_namespaceObject.z.number().default(500).optional().describe('Long press duration in milliseconds')
|
|
232
|
+
});
|
|
233
|
+
const defineActionLongPress = (call)=>defineAction({
|
|
234
|
+
name: 'LongPress',
|
|
235
|
+
description: 'Long press the element',
|
|
236
|
+
paramSchema: ActionLongPressParamSchema,
|
|
237
|
+
sample: {
|
|
238
|
+
locate: {
|
|
239
|
+
prompt: 'the message bubble'
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
call
|
|
243
|
+
});
|
|
244
|
+
const ActionSwipeParamSchema = external_zod_namespaceObject.z.object({
|
|
245
|
+
start: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().optional().describe('Starting point of the swipe gesture, if not specified, the center of the page will be used'),
|
|
246
|
+
direction: external_zod_namespaceObject.z["enum"]([
|
|
247
|
+
'up',
|
|
248
|
+
'down',
|
|
249
|
+
'left',
|
|
250
|
+
'right'
|
|
251
|
+
]).optional().describe('The direction to swipe (required when using distance). The direction means the direction of the finger swipe.'),
|
|
252
|
+
distance: external_zod_namespaceObject.z.number().optional().describe('The distance in pixels to swipe (mutually exclusive with end)'),
|
|
253
|
+
end: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().optional().describe('Ending point of the swipe gesture (mutually exclusive with distance)'),
|
|
254
|
+
duration: external_zod_namespaceObject.z.number().default(300).describe('Duration of the swipe gesture in milliseconds'),
|
|
255
|
+
repeat: external_zod_namespaceObject.z.number().optional().describe('The number of times to repeat the swipe gesture. 1 for default, 0 for infinite (e.g. endless swipe until the end of the page)')
|
|
256
|
+
});
|
|
257
|
+
function normalizeMobileSwipeParam(param, screenSize) {
|
|
258
|
+
const { width, height } = screenSize;
|
|
259
|
+
const { start, end } = param;
|
|
260
|
+
const startPoint = start ? {
|
|
261
|
+
x: start.center[0],
|
|
262
|
+
y: start.center[1]
|
|
263
|
+
} : {
|
|
264
|
+
x: width / 2,
|
|
265
|
+
y: height / 2
|
|
266
|
+
};
|
|
267
|
+
let endPoint;
|
|
268
|
+
if (end) endPoint = {
|
|
269
|
+
x: end.center[0],
|
|
270
|
+
y: end.center[1]
|
|
271
|
+
};
|
|
272
|
+
else if (param.distance) {
|
|
273
|
+
const direction = param.direction;
|
|
274
|
+
if (!direction) throw new Error('direction is required for swipe gesture');
|
|
275
|
+
endPoint = {
|
|
276
|
+
x: startPoint.x + ('right' === direction ? param.distance : 'left' === direction ? -param.distance : 0),
|
|
277
|
+
y: startPoint.y + ('down' === direction ? param.distance : 'up' === direction ? -param.distance : 0)
|
|
278
|
+
};
|
|
279
|
+
} else throw new Error('Either end or distance must be specified for swipe gesture');
|
|
280
|
+
endPoint.x = Math.max(0, Math.min(endPoint.x, width));
|
|
281
|
+
endPoint.y = Math.max(0, Math.min(endPoint.y, height));
|
|
282
|
+
const duration = param.duration ?? 300;
|
|
283
|
+
let repeatCount = 'number' == typeof param.repeat ? param.repeat : 1;
|
|
284
|
+
if (0 === repeatCount) repeatCount = 10;
|
|
285
|
+
return {
|
|
286
|
+
startPoint,
|
|
287
|
+
endPoint,
|
|
288
|
+
duration,
|
|
289
|
+
repeatCount
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const defineActionSwipe = (call)=>defineAction({
|
|
293
|
+
name: 'Swipe',
|
|
294
|
+
description: 'Perform a touch gesture for interactions beyond regular scrolling (e.g., flip pages in a carousel, dismiss a notification, swipe-to-delete a list item). For regular content scrolling, use Scroll instead. Use "distance" + "direction" for relative movement, or "end" for precise endpoint.',
|
|
295
|
+
paramSchema: ActionSwipeParamSchema,
|
|
296
|
+
sample: {
|
|
297
|
+
start: {
|
|
298
|
+
prompt: 'center of the notification'
|
|
299
|
+
},
|
|
300
|
+
end: {
|
|
301
|
+
prompt: 'upper edge of the screen'
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
call
|
|
305
|
+
});
|
|
306
|
+
const actionClearInputParamSchema = external_zod_namespaceObject.z.object({
|
|
307
|
+
locate: (0, external_common_js_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be cleared').optional()
|
|
308
|
+
});
|
|
309
|
+
const defineActionClearInput = (call)=>defineAction({
|
|
310
|
+
name: 'ClearInput',
|
|
311
|
+
description: inputLocateDescription,
|
|
312
|
+
interfaceAlias: 'aiClearInput',
|
|
313
|
+
paramSchema: actionClearInputParamSchema,
|
|
314
|
+
sample: {
|
|
315
|
+
locate: {
|
|
316
|
+
prompt: 'the search input field'
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
call
|
|
320
|
+
});
|
|
321
|
+
const actionCursorMoveParamSchema = external_zod_namespaceObject.z.object({
|
|
322
|
+
direction: external_zod_namespaceObject.z["enum"]([
|
|
323
|
+
'left',
|
|
324
|
+
'right'
|
|
325
|
+
]).describe('The direction to move the cursor'),
|
|
326
|
+
times: external_zod_namespaceObject.z.number().int().min(1).default(1).describe('The number of times to move the cursor in the specified direction')
|
|
327
|
+
});
|
|
328
|
+
const defineActionCursorMove = (call)=>defineAction({
|
|
329
|
+
name: 'CursorMove',
|
|
330
|
+
description: 'Move the text cursor (caret) left or right within an input field or text area. Use this to reposition the cursor without selecting text.',
|
|
331
|
+
paramSchema: actionCursorMoveParamSchema,
|
|
332
|
+
sample: {
|
|
333
|
+
direction: 'left',
|
|
334
|
+
times: 3
|
|
335
|
+
},
|
|
336
|
+
call
|
|
337
|
+
});
|
|
338
|
+
const ActionSleepParamSchema = external_zod_namespaceObject.z.object({
|
|
339
|
+
timeMs: external_zod_namespaceObject.z.number().default(1000).optional().describe('Sleep duration in milliseconds, defaults to 1000ms (1 second)')
|
|
340
|
+
});
|
|
341
|
+
const defineActionSleep = ()=>defineAction({
|
|
342
|
+
name: 'Sleep',
|
|
343
|
+
description: 'Wait for a specified duration before continuing. Defaults to 1 second (1000ms) if not specified.',
|
|
344
|
+
paramSchema: ActionSleepParamSchema,
|
|
345
|
+
sample: {
|
|
346
|
+
timeMs: 2000
|
|
347
|
+
},
|
|
348
|
+
call: async (param)=>{
|
|
349
|
+
const duration = param?.timeMs ?? 1000;
|
|
350
|
+
(0, logger_namespaceObject.getDebug)('device:common-action')(`Sleeping for ${duration}ms`);
|
|
351
|
+
await new Promise((resolve)=>setTimeout(resolve, duration));
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
exports.AbstractInterface = __webpack_exports__.AbstractInterface;
|
|
355
|
+
exports.ActionLongPressParamSchema = __webpack_exports__.ActionLongPressParamSchema;
|
|
356
|
+
exports.ActionSleepParamSchema = __webpack_exports__.ActionSleepParamSchema;
|
|
357
|
+
exports.ActionSwipeParamSchema = __webpack_exports__.ActionSwipeParamSchema;
|
|
358
|
+
exports.actionClearInputParamSchema = __webpack_exports__.actionClearInputParamSchema;
|
|
359
|
+
exports.actionCursorMoveParamSchema = __webpack_exports__.actionCursorMoveParamSchema;
|
|
360
|
+
exports.actionDoubleClickParamSchema = __webpack_exports__.actionDoubleClickParamSchema;
|
|
361
|
+
exports.actionDragAndDropParamSchema = __webpack_exports__.actionDragAndDropParamSchema;
|
|
362
|
+
exports.actionHoverParamSchema = __webpack_exports__.actionHoverParamSchema;
|
|
363
|
+
exports.actionInputParamSchema = __webpack_exports__.actionInputParamSchema;
|
|
364
|
+
exports.actionKeyboardPressParamSchema = __webpack_exports__.actionKeyboardPressParamSchema;
|
|
365
|
+
exports.actionRightClickParamSchema = __webpack_exports__.actionRightClickParamSchema;
|
|
366
|
+
exports.actionScrollParamSchema = __webpack_exports__.actionScrollParamSchema;
|
|
367
|
+
exports.actionTapParamSchema = __webpack_exports__.actionTapParamSchema;
|
|
368
|
+
exports.defineAction = __webpack_exports__.defineAction;
|
|
369
|
+
exports.defineActionClearInput = __webpack_exports__.defineActionClearInput;
|
|
370
|
+
exports.defineActionCursorMove = __webpack_exports__.defineActionCursorMove;
|
|
371
|
+
exports.defineActionDoubleClick = __webpack_exports__.defineActionDoubleClick;
|
|
372
|
+
exports.defineActionDragAndDrop = __webpack_exports__.defineActionDragAndDrop;
|
|
373
|
+
exports.defineActionHover = __webpack_exports__.defineActionHover;
|
|
374
|
+
exports.defineActionInput = __webpack_exports__.defineActionInput;
|
|
375
|
+
exports.defineActionKeyboardPress = __webpack_exports__.defineActionKeyboardPress;
|
|
376
|
+
exports.defineActionLongPress = __webpack_exports__.defineActionLongPress;
|
|
377
|
+
exports.defineActionRightClick = __webpack_exports__.defineActionRightClick;
|
|
378
|
+
exports.defineActionScroll = __webpack_exports__.defineActionScroll;
|
|
379
|
+
exports.defineActionSleep = __webpack_exports__.defineActionSleep;
|
|
380
|
+
exports.defineActionSwipe = __webpack_exports__.defineActionSwipe;
|
|
381
|
+
exports.defineActionTap = __webpack_exports__.defineActionTap;
|
|
382
|
+
exports.normalizeMobileSwipeParam = __webpack_exports__.normalizeMobileSwipeParam;
|
|
383
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
384
|
+
"AbstractInterface",
|
|
385
|
+
"ActionLongPressParamSchema",
|
|
386
|
+
"ActionSleepParamSchema",
|
|
387
|
+
"ActionSwipeParamSchema",
|
|
388
|
+
"actionClearInputParamSchema",
|
|
389
|
+
"actionCursorMoveParamSchema",
|
|
390
|
+
"actionDoubleClickParamSchema",
|
|
391
|
+
"actionDragAndDropParamSchema",
|
|
392
|
+
"actionHoverParamSchema",
|
|
393
|
+
"actionInputParamSchema",
|
|
394
|
+
"actionKeyboardPressParamSchema",
|
|
395
|
+
"actionRightClickParamSchema",
|
|
396
|
+
"actionScrollParamSchema",
|
|
397
|
+
"actionTapParamSchema",
|
|
398
|
+
"defineAction",
|
|
399
|
+
"defineActionClearInput",
|
|
400
|
+
"defineActionCursorMove",
|
|
401
|
+
"defineActionDoubleClick",
|
|
402
|
+
"defineActionDragAndDrop",
|
|
403
|
+
"defineActionHover",
|
|
404
|
+
"defineActionInput",
|
|
405
|
+
"defineActionKeyboardPress",
|
|
406
|
+
"defineActionLongPress",
|
|
407
|
+
"defineActionRightClick",
|
|
408
|
+
"defineActionScroll",
|
|
409
|
+
"defineActionSleep",
|
|
410
|
+
"defineActionSwipe",
|
|
411
|
+
"defineActionTap",
|
|
412
|
+
"normalizeMobileSwipeParam"
|
|
413
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
414
|
+
Object.defineProperty(exports, '__esModule', {
|
|
415
|
+
value: true
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/device/index.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { getMidsceneLocationSchema } from '@/common';\nimport type {\n ActionScrollParam,\n DeviceAction,\n LocateResultElement,\n} from '@/types';\nimport type { IModelConfig } from '@midscene/shared/env';\nimport type { ElementNode } from '@midscene/shared/extractor';\nimport { getDebug } from '@midscene/shared/logger';\nimport { _keyDefinitions } from '@midscene/shared/us-keyboard-layout';\nimport { z } from 'zod';\nimport type { ElementCacheFeature, Rect, Size, UIContext } from '../types';\n\nexport interface FileChooserHandler {\n accept(files: string[]): Promise<void>;\n}\n\nexport abstract class AbstractInterface {\n abstract interfaceType: string;\n\n abstract screenshotBase64(): Promise<string>;\n abstract size(): Promise<Size>;\n abstract actionSpace(): DeviceAction[];\n\n abstract cacheFeatureForPoint?(\n center: [number, number],\n options?: {\n targetDescription?: string;\n modelConfig?: IModelConfig;\n },\n ): Promise<ElementCacheFeature>;\n abstract rectMatchesCacheFeature?(\n feature: ElementCacheFeature,\n ): Promise<Rect>;\n\n abstract destroy?(): Promise<void>;\n\n abstract describe?(): string;\n abstract beforeInvokeAction?(actionName: string, param: any): Promise<void>;\n abstract afterInvokeAction?(actionName: string, param: any): Promise<void>;\n\n // for web only\n registerFileChooserListener?(\n handler: (chooser: FileChooserHandler) => Promise<void>,\n ): Promise<{ dispose: () => void; getError: () => Error | undefined }>;\n\n // @deprecated do NOT extend this method\n abstract getElementsNodeTree?: () => Promise<ElementNode>;\n\n // @deprecated do NOT extend this method\n abstract url?: () => string | Promise<string>;\n\n // @deprecated do NOT extend this method\n abstract evaluateJavaScript?<T = any>(script: string): Promise<T>;\n\n /**\n * Get the current time from the device.\n * Returns the device's current timestamp in milliseconds.\n * This is useful when the system time and device time are not synchronized.\n */\n getTimestamp?(): Promise<number>;\n\n /** URL of native MJPEG stream for real-time screen preview (e.g. WDA MJPEG server) */\n mjpegStreamUrl?: string;\n}\n\n// Generic function to define actions with proper type inference\n// TRuntime allows specifying a different type for the runtime parameter (after location resolution)\n// TReturn allows specifying the return type of the action\nexport const defineAction = <\n TSchema extends z.ZodType | undefined = undefined,\n TRuntime = TSchema extends z.ZodType ? z.infer<TSchema> : undefined,\n TReturn = any,\n>(\n config: {\n name: string;\n description: string;\n interfaceAlias?: string;\n paramSchema?: TSchema;\n call: (param: TRuntime) => Promise<TReturn> | TReturn;\n } & Partial<\n Omit<\n DeviceAction<TRuntime, TReturn>,\n 'name' | 'description' | 'interfaceAlias' | 'paramSchema' | 'call'\n >\n >,\n): DeviceAction<TRuntime, TReturn> => {\n return config as any; // Type assertion needed because schema validation type differs from runtime type\n};\n\n// Tap\nexport const actionTapParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe('The element to be tapped'),\n});\nexport type ActionTapParam = {\n locate: LocateResultElement;\n};\n\nexport const defineActionTap = (\n call: (param: ActionTapParam) => Promise<void>,\n): DeviceAction<ActionTapParam> => {\n return defineAction<typeof actionTapParamSchema, ActionTapParam>({\n name: 'Tap',\n description: 'Tap the element',\n interfaceAlias: 'aiTap',\n paramSchema: actionTapParamSchema,\n sample: {\n locate: { prompt: 'the \"Submit\" button' },\n },\n call,\n });\n};\n\n// RightClick\nexport const actionRightClickParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe(\n 'The element to be right clicked',\n ),\n});\nexport type ActionRightClickParam = {\n locate: LocateResultElement;\n};\n\nexport const defineActionRightClick = (\n call: (param: ActionRightClickParam) => Promise<void>,\n): DeviceAction<ActionRightClickParam> => {\n return defineAction<\n typeof actionRightClickParamSchema,\n ActionRightClickParam\n >({\n name: 'RightClick',\n description: 'Right click the element',\n interfaceAlias: 'aiRightClick',\n paramSchema: actionRightClickParamSchema,\n sample: {\n locate: { prompt: 'the file icon on the desktop' },\n },\n call,\n });\n};\n\n// DoubleClick\nexport const actionDoubleClickParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe(\n 'The element to be double clicked',\n ),\n});\nexport type ActionDoubleClickParam = {\n locate: LocateResultElement;\n};\n\nexport const defineActionDoubleClick = (\n call: (param: ActionDoubleClickParam) => Promise<void>,\n): DeviceAction<ActionDoubleClickParam> => {\n return defineAction<\n typeof actionDoubleClickParamSchema,\n ActionDoubleClickParam\n >({\n name: 'DoubleClick',\n description: 'Double click the element',\n interfaceAlias: 'aiDoubleClick',\n paramSchema: actionDoubleClickParamSchema,\n sample: {\n locate: { prompt: 'the folder icon' },\n },\n call,\n });\n};\n\n// Hover\nexport const actionHoverParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe('The element to be hovered'),\n});\nexport type ActionHoverParam = {\n locate: LocateResultElement;\n};\n\nexport const defineActionHover = (\n call: (param: ActionHoverParam) => Promise<void>,\n): DeviceAction<ActionHoverParam> => {\n return defineAction<typeof actionHoverParamSchema, ActionHoverParam>({\n name: 'Hover',\n description: 'Move the mouse to the element',\n interfaceAlias: 'aiHover',\n paramSchema: actionHoverParamSchema,\n sample: {\n locate: { prompt: 'the navigation menu item \"Products\"' },\n },\n call,\n });\n};\n\n// Input\nconst inputLocateDescription =\n 'the position of the placeholder or text content in the target input field. If there is no content, locate the center of the input field.';\nexport const actionInputParamSchema = z.object({\n value: z\n .union([z.string(), z.number()])\n .transform((val) => String(val))\n .describe(\n 'The text to input. Provide the final content for replace/append modes, or an empty string when using clear mode to remove existing text.',\n ),\n locate: getMidsceneLocationSchema()\n .describe(inputLocateDescription)\n .optional(),\n mode: z\n .enum(['replace', 'clear', 'typeOnly'])\n .default('replace')\n .describe(\n 'Input mode: \"replace\" (default) - clear the field and input the value; \"typeOnly\" - type the value directly without clearing the field first; \"clear\" - clear the field without inputting new text.',\n ),\n});\nexport type ActionInputParam = {\n value: string;\n locate?: LocateResultElement;\n mode?: 'replace' | 'clear' | 'typeOnly' | 'append';\n};\n\nexport const defineActionInput = (\n call: (param: ActionInputParam) => Promise<void>,\n): DeviceAction<ActionInputParam> => {\n return defineAction<typeof actionInputParamSchema, ActionInputParam>({\n name: 'Input',\n description: 'Input the value into the element',\n interfaceAlias: 'aiInput',\n paramSchema: actionInputParamSchema,\n sample: {\n value: 'test@example.com',\n locate: { prompt: 'the email input field' },\n },\n call: (param) => {\n // backward compat: convert deprecated 'append' to 'typeOnly'\n if ((param.mode as string) === 'append') {\n param.mode = 'typeOnly';\n }\n return call(param);\n },\n });\n};\n\n// KeyboardPress\nexport const actionKeyboardPressParamSchema = z.object({\n locate: getMidsceneLocationSchema()\n .describe('The element to be clicked before pressing the key')\n .optional(),\n keyName: z\n .string()\n .describe(\n \"The key to be pressed. Use '+' for key combinations, e.g., 'Control+A', 'Shift+Enter'\",\n ),\n});\nexport type ActionKeyboardPressParam = {\n locate?: LocateResultElement;\n keyName: string;\n};\n\nexport const defineActionKeyboardPress = (\n call: (param: ActionKeyboardPressParam) => Promise<void>,\n): DeviceAction<ActionKeyboardPressParam> => {\n return defineAction<\n typeof actionKeyboardPressParamSchema,\n ActionKeyboardPressParam\n >({\n name: 'KeyboardPress',\n description:\n 'Press a key or key combination, like \"Enter\", \"Tab\", \"Escape\", or \"Control+A\", \"Shift+Enter\". Do not use this to type text.',\n interfaceAlias: 'aiKeyboardPress',\n paramSchema: actionKeyboardPressParamSchema,\n sample: {\n keyName: 'Enter',\n },\n call,\n });\n};\n\n// Scroll\nexport const actionScrollParamSchema = z.object({\n scrollType: z\n .enum([\n 'singleAction',\n 'scrollToBottom',\n 'scrollToTop',\n 'scrollToRight',\n 'scrollToLeft',\n ])\n .default('singleAction')\n .describe(\n 'The scroll behavior: \"singleAction\" for a single scroll action, \"scrollToBottom\" for scrolling all the way to the bottom by rapidly scrolling 5-10 times (skipping intermediate content until reaching the bottom), \"scrollToTop\" for scrolling all the way to the top by rapidly scrolling 5-10 times (skipping intermediate content until reaching the top), \"scrollToRight\" for scrolling all the way to the right by rapidly scrolling multiple times, \"scrollToLeft\" for scrolling all the way to the left by rapidly scrolling multiple times',\n ),\n direction: z\n .enum(['down', 'up', 'right', 'left'])\n .default('down')\n .describe(\n 'The direction to scroll. Only effective when scrollType is \"singleAction\".',\n ),\n distance: z\n .number()\n .nullable()\n .optional()\n .describe('The distance in pixels to scroll'),\n locate: getMidsceneLocationSchema()\n .optional()\n .describe(\n 'Describe the target element to be scrolled on, like \"the table\" or \"the list\" or \"the content area\" or \"the scrollable area\". Do NOT provide a general intent like \"scroll to find some element\"',\n ),\n});\n\nexport const defineActionScroll = (\n call: (param: ActionScrollParam) => Promise<void>,\n): DeviceAction<ActionScrollParam> => {\n return defineAction<typeof actionScrollParamSchema, ActionScrollParam>({\n name: 'Scroll',\n description:\n 'Scroll the page or a scrollable element to browse content. This is the preferred way to scroll on all platforms, including mobile. Supports scrollToBottom/scrollToTop for boundary navigation. Default: direction `down`, scrollType `singleAction`, distance `null`.',\n interfaceAlias: 'aiScroll',\n paramSchema: actionScrollParamSchema,\n sample: {\n direction: 'down',\n scrollType: 'singleAction',\n locate: { prompt: 'the center of the product list area' },\n },\n call,\n });\n};\n\n// DragAndDrop\nexport const actionDragAndDropParamSchema = z.object({\n from: getMidsceneLocationSchema().describe('The position to be dragged'),\n to: getMidsceneLocationSchema().describe('The position to be dropped'),\n});\nexport type ActionDragAndDropParam = {\n from: LocateResultElement;\n to: LocateResultElement;\n};\n\nexport const defineActionDragAndDrop = (\n call: (param: ActionDragAndDropParam) => Promise<void>,\n): DeviceAction<ActionDragAndDropParam> => {\n return defineAction<\n typeof actionDragAndDropParamSchema,\n ActionDragAndDropParam\n >({\n name: 'DragAndDrop',\n description:\n 'Pick up a specific UI element and move it to a new position (e.g., reorder a card, move a file into a folder, sort list items). The element itself moves with your finger/mouse.',\n interfaceAlias: 'aiDragAndDrop',\n paramSchema: actionDragAndDropParamSchema,\n sample: {\n from: { prompt: 'the \"report.pdf\" file icon' },\n to: { prompt: 'the upload drop zone' },\n },\n call,\n });\n};\n\nexport const ActionLongPressParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe(\n 'The element to be long pressed',\n ),\n duration: z\n .number()\n .default(500)\n .optional()\n .describe('Long press duration in milliseconds'),\n});\n\nexport type ActionLongPressParam = {\n locate: LocateResultElement;\n duration?: number;\n};\nexport const defineActionLongPress = (\n call: (param: ActionLongPressParam) => Promise<void>,\n): DeviceAction<ActionLongPressParam> => {\n return defineAction<typeof ActionLongPressParamSchema, ActionLongPressParam>({\n name: 'LongPress',\n description: 'Long press the element',\n paramSchema: ActionLongPressParamSchema,\n sample: {\n locate: { prompt: 'the message bubble' },\n },\n call,\n });\n};\n\nexport const ActionSwipeParamSchema = z.object({\n start: getMidsceneLocationSchema()\n .optional()\n .describe(\n 'Starting point of the swipe gesture, if not specified, the center of the page will be used',\n ),\n direction: z\n .enum(['up', 'down', 'left', 'right'])\n .optional()\n .describe(\n 'The direction to swipe (required when using distance). The direction means the direction of the finger swipe.',\n ),\n distance: z\n .number()\n .optional()\n .describe('The distance in pixels to swipe (mutually exclusive with end)'),\n end: getMidsceneLocationSchema()\n .optional()\n .describe(\n 'Ending point of the swipe gesture (mutually exclusive with distance)',\n ),\n duration: z\n .number()\n .default(300)\n .describe('Duration of the swipe gesture in milliseconds'),\n repeat: z\n .number()\n .optional()\n .describe(\n 'The number of times to repeat the swipe gesture. 1 for default, 0 for infinite (e.g. endless swipe until the end of the page)',\n ),\n});\n\nexport type ActionSwipeParam = {\n start?: LocateResultElement;\n direction?: 'up' | 'down' | 'left' | 'right';\n distance?: number;\n end?: LocateResultElement;\n duration?: number;\n repeat?: number;\n};\n\nexport function normalizeMobileSwipeParam(\n param: ActionSwipeParam,\n screenSize: { width: number; height: number },\n): {\n startPoint: { x: number; y: number };\n endPoint: { x: number; y: number };\n duration: number;\n repeatCount: number;\n} {\n const { width, height } = screenSize;\n const { start, end } = param;\n\n const startPoint = start\n ? { x: start.center[0], y: start.center[1] }\n : { x: width / 2, y: height / 2 };\n\n let endPoint: { x: number; y: number };\n\n if (end) {\n endPoint = { x: end.center[0], y: end.center[1] };\n } else if (param.distance) {\n const direction = param.direction;\n if (!direction) {\n throw new Error('direction is required for swipe gesture');\n }\n endPoint = {\n x:\n startPoint.x +\n (direction === 'right'\n ? param.distance\n : direction === 'left'\n ? -param.distance\n : 0),\n y:\n startPoint.y +\n (direction === 'down'\n ? param.distance\n : direction === 'up'\n ? -param.distance\n : 0),\n };\n } else {\n throw new Error(\n 'Either end or distance must be specified for swipe gesture',\n );\n }\n\n endPoint.x = Math.max(0, Math.min(endPoint.x, width));\n endPoint.y = Math.max(0, Math.min(endPoint.y, height));\n\n const duration = param.duration ?? 300;\n\n let repeatCount = typeof param.repeat === 'number' ? param.repeat : 1;\n if (repeatCount === 0) {\n repeatCount = 10;\n }\n\n return { startPoint, endPoint, duration, repeatCount };\n}\n\nexport const defineActionSwipe = (\n call: (param: ActionSwipeParam) => Promise<void>,\n): DeviceAction<ActionSwipeParam> => {\n return defineAction<typeof ActionSwipeParamSchema, ActionSwipeParam>({\n name: 'Swipe',\n description:\n 'Perform a touch gesture for interactions beyond regular scrolling (e.g., flip pages in a carousel, dismiss a notification, swipe-to-delete a list item). For regular content scrolling, use Scroll instead. Use \"distance\" + \"direction\" for relative movement, or \"end\" for precise endpoint.',\n paramSchema: ActionSwipeParamSchema,\n sample: {\n start: { prompt: 'center of the notification' },\n end: { prompt: 'upper edge of the screen' },\n },\n call,\n });\n};\n\n// ClearInput\nexport const actionClearInputParamSchema = z.object({\n locate: getMidsceneLocationSchema()\n .describe('The input field to be cleared')\n .optional(),\n});\nexport type ActionClearInputParam = {\n locate?: LocateResultElement;\n};\n\nexport const defineActionClearInput = (\n call: (param: ActionClearInputParam) => Promise<void>,\n): DeviceAction<ActionClearInputParam> => {\n return defineAction<\n typeof actionClearInputParamSchema,\n ActionClearInputParam\n >({\n name: 'ClearInput',\n description: inputLocateDescription,\n interfaceAlias: 'aiClearInput',\n paramSchema: actionClearInputParamSchema,\n sample: {\n locate: { prompt: 'the search input field' },\n },\n call,\n });\n};\n\n// CursorMove\nexport const actionCursorMoveParamSchema = z.object({\n direction: z\n .enum(['left', 'right'])\n .describe('The direction to move the cursor'),\n times: z\n .number()\n .int()\n .min(1)\n .default(1)\n .describe(\n 'The number of times to move the cursor in the specified direction',\n ),\n});\nexport type ActionCursorMoveParam = {\n direction: 'left' | 'right';\n times?: number;\n};\n\nexport const defineActionCursorMove = (\n call: (param: ActionCursorMoveParam) => Promise<void>,\n): DeviceAction<ActionCursorMoveParam> => {\n return defineAction<\n typeof actionCursorMoveParamSchema,\n ActionCursorMoveParam\n >({\n name: 'CursorMove',\n description:\n 'Move the text cursor (caret) left or right within an input field or text area. Use this to reposition the cursor without selecting text.',\n paramSchema: actionCursorMoveParamSchema,\n sample: {\n direction: 'left',\n times: 3,\n },\n call,\n });\n};\n// Sleep\nexport const ActionSleepParamSchema = z.object({\n timeMs: z\n .number()\n .default(1000)\n .optional()\n .describe('Sleep duration in milliseconds, defaults to 1000ms (1 second)'),\n});\n\nexport type ActionSleepParam = {\n timeMs?: number;\n};\n\nexport const defineActionSleep = (): DeviceAction<ActionSleepParam> => {\n return defineAction<typeof ActionSleepParamSchema, ActionSleepParam>({\n name: 'Sleep',\n description:\n 'Wait for a specified duration before continuing. Defaults to 1 second (1000ms) if not specified.',\n paramSchema: ActionSleepParamSchema,\n sample: {\n timeMs: 2000,\n },\n call: async (param) => {\n const duration = param?.timeMs ?? 1000;\n getDebug('device:common-action')(`Sleeping for ${duration}ms`);\n await new Promise((resolve) => setTimeout(resolve, duration));\n },\n });\n};\n\nexport type { DeviceAction } from '../types';\nexport type {\n AndroidDeviceOpt,\n AndroidDeviceInputOpt,\n IOSDeviceOpt,\n IOSDeviceInputOpt,\n HarmonyDeviceOpt,\n HarmonyDeviceInputOpt,\n} from './device-options';\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","AbstractInterface","defineAction","config","actionTapParamSchema","z","getMidsceneLocationSchema","defineActionTap","call","actionRightClickParamSchema","defineActionRightClick","actionDoubleClickParamSchema","defineActionDoubleClick","actionHoverParamSchema","defineActionHover","inputLocateDescription","actionInputParamSchema","val","String","defineActionInput","param","actionKeyboardPressParamSchema","defineActionKeyboardPress","actionScrollParamSchema","defineActionScroll","actionDragAndDropParamSchema","defineActionDragAndDrop","ActionLongPressParamSchema","defineActionLongPress","ActionSwipeParamSchema","normalizeMobileSwipeParam","screenSize","width","height","start","end","startPoint","endPoint","direction","Error","Math","duration","repeatCount","defineActionSwipe","actionClearInputParamSchema","defineActionClearInput","actionCursorMoveParamSchema","defineActionCursorMove","ActionSleepParamSchema","defineActionSleep","getDebug","Promise","resolve","setTimeout"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACj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