@midscene/core 1.0.1-beta-20251208085324.0 → 1.0.1-beta-20251209024153.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 +12 -1
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/task-builder.mjs +4 -2
- package/dist/es/agent/task-builder.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +8 -3
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/prompt/llm-planning.mjs +6 -63
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -1
- package/dist/es/device/index.mjs +12 -6
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +14 -3
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/common.js +1 -1
- package/dist/lib/agent/execution-session.js +2 -2
- package/dist/lib/agent/index.js +2 -2
- package/dist/lib/agent/task-builder.js +6 -4
- package/dist/lib/agent/task-builder.js.map +1 -1
- package/dist/lib/agent/task-cache.js +2 -2
- package/dist/lib/agent/tasks.js +10 -5
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/ui-utils.js +2 -2
- package/dist/lib/agent/utils.js +3 -3
- package/dist/lib/ai-model/conversation-history.js +2 -2
- package/dist/lib/ai-model/index.js +2 -2
- package/dist/lib/ai-model/inspect.js +2 -2
- package/dist/lib/ai-model/llm-planning.js +2 -2
- package/dist/lib/ai-model/prompt/assertion.js +2 -2
- package/dist/lib/ai-model/prompt/common.js +2 -2
- package/dist/lib/ai-model/prompt/describe.js +2 -2
- package/dist/lib/ai-model/prompt/extraction.js +2 -2
- package/dist/lib/ai-model/prompt/llm-locator.js +2 -2
- package/dist/lib/ai-model/prompt/llm-planning.js +10 -67
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-section-locator.js +2 -2
- package/dist/lib/ai-model/prompt/order-sensitive-judge.js +2 -2
- package/dist/lib/ai-model/prompt/playwright-generator.js +2 -2
- package/dist/lib/ai-model/prompt/ui-tars-locator.js +2 -2
- package/dist/lib/ai-model/prompt/ui-tars-planning.js +2 -2
- package/dist/lib/ai-model/prompt/util.js +2 -2
- package/dist/lib/ai-model/prompt/yaml-generator.js +2 -2
- package/dist/lib/ai-model/service-caller/index.js +2 -2
- package/dist/lib/ai-model/ui-tars-planning.js +2 -2
- package/dist/lib/common.js +2 -2
- package/dist/lib/device/device-options.js +1 -1
- package/dist/lib/device/index.js +14 -8
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/image/index.js +2 -2
- package/dist/lib/index.js +2 -2
- package/dist/lib/report.js +2 -2
- package/dist/lib/service/index.js +2 -2
- package/dist/lib/service/utils.js +2 -2
- package/dist/lib/task-runner.js +2 -2
- package/dist/lib/tree.js +2 -2
- package/dist/lib/types.js +3 -3
- package/dist/lib/utils.js +4 -4
- package/dist/lib/yaml/builder.js +2 -2
- package/dist/lib/yaml/index.js +4 -4
- package/dist/lib/yaml/player.js +2 -2
- package/dist/lib/yaml/utils.js +2 -2
- package/dist/lib/yaml.js +1 -1
- package/dist/types/agent/task-builder.d.ts +4 -2
- package/dist/types/agent/tasks.d.ts +4 -1
- package/dist/types/device/index.d.ts +10 -2
- package/package.json +3 -3
|
@@ -68,10 +68,10 @@ If the description is "delete button on the second row with title 'Peter'", retu
|
|
|
68
68
|
const sectionLocatorInstruction = (sectionDescription)=>`Find section containing: ${sectionDescription}`;
|
|
69
69
|
exports.sectionLocatorInstruction = __webpack_exports__.sectionLocatorInstruction;
|
|
70
70
|
exports.systemPromptToLocateSection = __webpack_exports__.systemPromptToLocateSection;
|
|
71
|
-
for(var
|
|
71
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
72
72
|
"sectionLocatorInstruction",
|
|
73
73
|
"systemPromptToLocateSection"
|
|
74
|
-
].indexOf(
|
|
74
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
75
75
|
Object.defineProperty(exports, '__esModule', {
|
|
76
76
|
value: true
|
|
77
77
|
});
|
|
@@ -61,10 +61,10 @@ Return true if the description is order-sensitive, false otherwise.
|
|
|
61
61
|
const orderSensitiveJudgePrompt = (description)=>`Analyze this element description: "${description}"`;
|
|
62
62
|
exports.orderSensitiveJudgePrompt = __webpack_exports__.orderSensitiveJudgePrompt;
|
|
63
63
|
exports.systemPromptToJudgeOrderSensitive = __webpack_exports__.systemPromptToJudgeOrderSensitive;
|
|
64
|
-
for(var
|
|
64
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
65
65
|
"orderSensitiveJudgePrompt",
|
|
66
66
|
"systemPromptToJudgeOrderSensitive"
|
|
67
|
-
].indexOf(
|
|
67
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
68
68
|
Object.defineProperty(exports, '__esModule', {
|
|
69
69
|
value: true
|
|
70
70
|
});
|
|
@@ -159,7 +159,7 @@ exports.getScreenshotsForLLM = __webpack_exports__.getScreenshotsForLLM;
|
|
|
159
159
|
exports.prepareEventSummary = __webpack_exports__.prepareEventSummary;
|
|
160
160
|
exports.processEventsForLLM = __webpack_exports__.processEventsForLLM;
|
|
161
161
|
exports.validateEvents = __webpack_exports__.validateEvents;
|
|
162
|
-
for(var
|
|
162
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
163
163
|
"createEventCounts",
|
|
164
164
|
"createMessageContent",
|
|
165
165
|
"extractInputDescriptions",
|
|
@@ -170,7 +170,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
170
170
|
"prepareEventSummary",
|
|
171
171
|
"processEventsForLLM",
|
|
172
172
|
"validateEvents"
|
|
173
|
-
].indexOf(
|
|
173
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
174
174
|
Object.defineProperty(exports, '__esModule', {
|
|
175
175
|
value: true
|
|
176
176
|
});
|
|
@@ -58,9 +58,9 @@ call_user() # Submit the task and call the user when the task is unsolvable, or
|
|
|
58
58
|
`;
|
|
59
59
|
}
|
|
60
60
|
exports.systemPromptToLocateElementPosition = __webpack_exports__.systemPromptToLocateElementPosition;
|
|
61
|
-
for(var
|
|
61
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
62
62
|
"systemPromptToLocateElementPosition"
|
|
63
|
-
].indexOf(
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
64
|
Object.defineProperty(exports, '__esModule', {
|
|
65
65
|
value: true
|
|
66
66
|
});
|
|
@@ -62,10 +62,10 @@ finished(content='xxx') # Use escape characters \\', \\", and \\n in content par
|
|
|
62
62
|
const getSummary = (prediction)=>prediction.replace(/Reflection:[\s\S]*?(?=Action_Summary:|Action:|$)/g, '').trim();
|
|
63
63
|
exports.getSummary = __webpack_exports__.getSummary;
|
|
64
64
|
exports.getUiTarsPlanningPrompt = __webpack_exports__.getUiTarsPlanningPrompt;
|
|
65
|
-
for(var
|
|
65
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
66
66
|
"getSummary",
|
|
67
67
|
"getUiTarsPlanningPrompt"
|
|
68
|
-
].indexOf(
|
|
68
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
69
69
|
Object.defineProperty(exports, '__esModule', {
|
|
70
70
|
value: true
|
|
71
71
|
});
|
|
@@ -73,14 +73,14 @@ exports.describeUserPage = __webpack_exports__.describeUserPage;
|
|
|
73
73
|
exports.distance = __webpack_exports__.distance;
|
|
74
74
|
exports.distanceThreshold = __webpack_exports__.distanceThreshold;
|
|
75
75
|
exports.samplePageDescription = __webpack_exports__.samplePageDescription;
|
|
76
|
-
for(var
|
|
76
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
77
77
|
"describeElement",
|
|
78
78
|
"describeSize",
|
|
79
79
|
"describeUserPage",
|
|
80
80
|
"distance",
|
|
81
81
|
"distanceThreshold",
|
|
82
82
|
"samplePageDescription"
|
|
83
|
-
].indexOf(
|
|
83
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
84
84
|
Object.defineProperty(exports, '__esModule', {
|
|
85
85
|
value: true
|
|
86
86
|
});
|
|
@@ -261,7 +261,7 @@ exports.getScreenshotsForLLM = __webpack_exports__.getScreenshotsForLLM;
|
|
|
261
261
|
exports.prepareEventSummary = __webpack_exports__.prepareEventSummary;
|
|
262
262
|
exports.processEventsForLLM = __webpack_exports__.processEventsForLLM;
|
|
263
263
|
exports.validateEvents = __webpack_exports__.validateEvents;
|
|
264
|
-
for(var
|
|
264
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
265
265
|
"createEventCounts",
|
|
266
266
|
"createMessageContent",
|
|
267
267
|
"extractInputDescriptions",
|
|
@@ -272,7 +272,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
272
272
|
"prepareEventSummary",
|
|
273
273
|
"processEventsForLLM",
|
|
274
274
|
"validateEvents"
|
|
275
|
-
].indexOf(
|
|
275
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
276
276
|
Object.defineProperty(exports, '__esModule', {
|
|
277
277
|
value: true
|
|
278
278
|
});
|
|
@@ -340,14 +340,14 @@ exports.callAIWithStringResponse = __webpack_exports__.callAIWithStringResponse;
|
|
|
340
340
|
exports.extractJSONFromCodeBlock = __webpack_exports__.extractJSONFromCodeBlock;
|
|
341
341
|
exports.preprocessDoubaoBboxJson = __webpack_exports__.preprocessDoubaoBboxJson;
|
|
342
342
|
exports.safeParseJson = __webpack_exports__.safeParseJson;
|
|
343
|
-
for(var
|
|
343
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
344
344
|
"callAI",
|
|
345
345
|
"callAIWithObjectResponse",
|
|
346
346
|
"callAIWithStringResponse",
|
|
347
347
|
"extractJSONFromCodeBlock",
|
|
348
348
|
"preprocessDoubaoBboxJson",
|
|
349
349
|
"safeParseJson"
|
|
350
|
-
].indexOf(
|
|
350
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
351
351
|
Object.defineProperty(exports, '__esModule', {
|
|
352
352
|
value: true
|
|
353
353
|
});
|
|
@@ -288,10 +288,10 @@ async function resizeImageForUiTars(imageBase64, size, uiTarsVersion) {
|
|
|
288
288
|
}
|
|
289
289
|
exports.resizeImageForUiTars = __webpack_exports__.resizeImageForUiTars;
|
|
290
290
|
exports.uiTarsPlanning = __webpack_exports__.uiTarsPlanning;
|
|
291
|
-
for(var
|
|
291
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
292
292
|
"resizeImageForUiTars",
|
|
293
293
|
"uiTarsPlanning"
|
|
294
|
-
].indexOf(
|
|
294
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
295
295
|
Object.defineProperty(exports, '__esModule', {
|
|
296
296
|
value: true
|
|
297
297
|
});
|
package/dist/lib/common.js
CHANGED
|
@@ -413,7 +413,7 @@ exports.markupImageForLLM = __webpack_exports__.markupImageForLLM;
|
|
|
413
413
|
exports.mergeRects = __webpack_exports__.mergeRects;
|
|
414
414
|
exports.normalized01000 = __webpack_exports__.normalized01000;
|
|
415
415
|
exports.parseActionParam = __webpack_exports__.parseActionParam;
|
|
416
|
-
for(var
|
|
416
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
417
417
|
"AIActionType",
|
|
418
418
|
"PointSchema",
|
|
419
419
|
"RectSchema",
|
|
@@ -438,7 +438,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
438
438
|
"mergeRects",
|
|
439
439
|
"normalized01000",
|
|
440
440
|
"parseActionParam"
|
|
441
|
-
].indexOf(
|
|
441
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
442
442
|
Object.defineProperty(exports, '__esModule', {
|
|
443
443
|
value: true
|
|
444
444
|
});
|
|
@@ -12,7 +12,7 @@ var __webpack_require__ = {};
|
|
|
12
12
|
})();
|
|
13
13
|
var __webpack_exports__ = {};
|
|
14
14
|
__webpack_require__.r(__webpack_exports__);
|
|
15
|
-
for(var
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
16
|
Object.defineProperty(exports, '__esModule', {
|
|
17
17
|
value: true
|
|
18
18
|
});
|
package/dist/lib/device/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
52
52
|
defineActionAssert: ()=>defineActionAssert
|
|
53
53
|
});
|
|
54
54
|
const external_common_js_namespaceObject = require("../common.js");
|
|
55
|
+
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
55
56
|
const external_zod_namespaceObject = require("zod");
|
|
56
57
|
class AbstractInterface {
|
|
57
58
|
}
|
|
@@ -202,14 +203,19 @@ const defineActionClearInput = (call)=>defineAction({
|
|
|
202
203
|
call
|
|
203
204
|
});
|
|
204
205
|
const actionAssertParamSchema = external_zod_namespaceObject.z.object({
|
|
205
|
-
condition: external_zod_namespaceObject.z.string().describe('The condition of the assertion')
|
|
206
|
+
condition: external_zod_namespaceObject.z.string().describe('The condition of the assertion'),
|
|
207
|
+
thought: external_zod_namespaceObject.z.string().describe('The thought of the assertion, like "I can see there are A, B, C elements on the page, which means ... , so the assertion is true"'),
|
|
208
|
+
result: external_zod_namespaceObject.z.boolean().describe('The result of the assertion, true or false')
|
|
206
209
|
});
|
|
207
|
-
const defineActionAssert = (
|
|
208
|
-
name: '
|
|
209
|
-
description: '
|
|
210
|
-
interfaceAlias: 'aiAssert',
|
|
210
|
+
const defineActionAssert = ()=>defineAction({
|
|
211
|
+
name: 'Print_Assert_Result',
|
|
212
|
+
description: 'Print the result of the assertion',
|
|
211
213
|
paramSchema: actionAssertParamSchema,
|
|
212
|
-
call
|
|
214
|
+
call: async (param)=>{
|
|
215
|
+
if ('boolean' != typeof param?.result) throw new Error(`The result of the assertion must be a boolean, but got: ${typeof param?.result}. ${param.thought || '(no thought)'}`);
|
|
216
|
+
(0, logger_namespaceObject.getDebug)('device:common-action')(`Assert: ${param.condition}, Thought: ${param.thought}, Result: ${param.result}`);
|
|
217
|
+
if (!param.result) throw new Error(`Assertion failed: ${param.thought || '(no thought)'}. (Assertion = ${param.condition})`);
|
|
218
|
+
}
|
|
213
219
|
});
|
|
214
220
|
exports.AbstractInterface = __webpack_exports__.AbstractInterface;
|
|
215
221
|
exports.ActionLongPressParamSchema = __webpack_exports__.ActionLongPressParamSchema;
|
|
@@ -237,7 +243,7 @@ exports.defineActionRightClick = __webpack_exports__.defineActionRightClick;
|
|
|
237
243
|
exports.defineActionScroll = __webpack_exports__.defineActionScroll;
|
|
238
244
|
exports.defineActionSwipe = __webpack_exports__.defineActionSwipe;
|
|
239
245
|
exports.defineActionTap = __webpack_exports__.defineActionTap;
|
|
240
|
-
for(var
|
|
246
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
241
247
|
"AbstractInterface",
|
|
242
248
|
"ActionLongPressParamSchema",
|
|
243
249
|
"ActionSwipeParamSchema",
|
|
@@ -264,7 +270,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
264
270
|
"defineActionScroll",
|
|
265
271
|
"defineActionSwipe",
|
|
266
272
|
"defineActionTap"
|
|
267
|
-
].indexOf(
|
|
273
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
268
274
|
Object.defineProperty(exports, '__esModule', {
|
|
269
275
|
value: true
|
|
270
276
|
});
|
|
@@ -1 +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 abstract class AbstractInterface {\n abstract interfaceType: string;\n\n abstract screenshotBase64(): Promise<string>;\n abstract size(): Promise<Size>;\n abstract actionSpace(): DeviceAction[] | Promise<DeviceAction[]>;\n\n abstract cacheFeatureForRect?(\n rect: Rect,\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 // @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 // @deprecated do NOT extend this method\n abstract getContext?(): Promise<UIContext>;\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});\n// Override the inferred type to use LocateResultElement for the runtime locate field\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 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 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 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 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', 'append'])\n .default('replace')\n .optional()\n .describe(\n 'Input mode: \"replace\" (default) - clear the field and input the value; \"append\" - append the value to existing content; \"clear\" - clear the field without inputting new text.',\n ),\n});\nexport type ActionInputParam = {\n value: string;\n locate?: LocateResultElement;\n mode?: 'replace' | 'clear' | '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 call,\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 call,\n });\n};\n\n// Scroll\nexport const actionScrollParamSchema = z.object({\n direction: z\n .enum(['down', 'up', 'right', 'left'])\n .default('down')\n .describe('The direction to scroll'),\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 to the bottom, \"scrollToTop\" for scrolling to the top, \"scrollToRight\" for scrolling to the right, \"scrollToLeft\" for scrolling to the left',\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('The target element to be scrolled'),\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 an element. The direction to scroll, the scroll type, and the distance to scroll. The distance is the number of pixels to scroll. If not specified, use `down` direction, `once` scroll type, and `null` distance.',\n interfaceAlias: 'aiScroll',\n paramSchema: actionScrollParamSchema,\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 'Drag and drop (hold the mouse or finger down and move the mouse) ',\n interfaceAlias: 'aiDragAndDrop',\n paramSchema: actionDragAndDropParamSchema,\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 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 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 swipe gesture. You must specify either \"end\" (target location) or \"distance\" + \"direction\" - they are mutually exclusive. Use \"end\" for precise location-based swipes, or \"distance\" + \"direction\" for relative movement.',\n paramSchema: ActionSwipeParamSchema,\n call,\n });\n};\n\n// ClearInput\nexport const actionClearInputParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe('The input field to be cleared'),\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 call,\n });\n};\n\n// Assert\nexport const actionAssertParamSchema = z.object({\n condition: z.string().describe('The condition of the assertion'),\n});\nexport type ActionAssertParam = {\n condition: string;\n};\n\nexport const defineActionAssert = (\n call: (param: ActionAssertParam) => Promise<void>,\n): DeviceAction<ActionAssertParam> => {\n return defineAction<typeof actionAssertParamSchema, ActionAssertParam>({\n name: 'Assert',\n description:\n 'If the user explicitly requires making an assertion (like \"there should be a button with text \"Yes\" in the popup\"), this tool will think about it, and then provide a solid result',\n interfaceAlias: 'aiAssert',\n paramSchema: actionAssertParamSchema,\n call,\n });\n};\n\nexport type { DeviceAction } from '../types';\nexport type {\n AndroidDeviceOpt,\n AndroidDeviceInputOpt,\n IOSDeviceOpt,\n IOSDeviceInputOpt,\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","actionKeyboardPressParamSchema","defineActionKeyboardPress","actionScrollParamSchema","defineActionScroll","actionDragAndDropParamSchema","defineActionDragAndDrop","ActionLongPressParamSchema","defineActionLongPress","ActionSwipeParamSchema","defineActionSwipe","actionClearInputParamSchema","defineActionClearInput","actionAssertParamSchema","defineActionAssert"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACOO,MAAeI;AAmCtB;AAKO,MAAMC,eAAe,CAK1BC,SAaOA;AAIF,MAAMC,uBAAuBC,6BAAAA,CAAAA,CAAAA,MAAQ,CAAC;IAC3C,QAAQC,AAAAA,IAAAA,mCAAAA,yBAAAA,AAAAA,IAA4B,QAAQ,CAAC;AAC/C;AAMO,MAAMC,kBAAkB,CAC7BC,O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ACpCvB,OAEON,aAGL;QACA,MAAM;QACN,aAAaa;QACb,gBAAgB;QAChB,aAAae;QACbtB;IACF;AAIK,MAAMwB,0BAA0B3B,6BAAAA,CAAAA,CAAAA,MAAQ,CAAC;IAC9C,WAAWA,6BAAAA,CAAAA,CAAAA,MAAQ,GAAG,QAAQ,CAAC;AACjC;AAKO,MAAM4B,qBAAqB,CAChCzB,OAEON,aAAgE;QACrE,MAAM;QACN,aACE;QACF,gBAAgB;QAChB,aAAa8B;QACbxB;IACF"}
|
|
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 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 cacheFeatureForRect?(\n rect: Rect,\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 // @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 // @deprecated do NOT extend this method\n abstract getContext?(): Promise<UIContext>;\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});\n// Override the inferred type to use LocateResultElement for the runtime locate field\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 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 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 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 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', 'append'])\n .default('replace')\n .optional()\n .describe(\n 'Input mode: \"replace\" (default) - clear the field and input the value; \"append\" - append the value to existing content; \"clear\" - clear the field without inputting new text.',\n ),\n});\nexport type ActionInputParam = {\n value: string;\n locate?: LocateResultElement;\n mode?: 'replace' | 'clear' | '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 call,\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 call,\n });\n};\n\n// Scroll\nexport const actionScrollParamSchema = z.object({\n direction: z\n .enum(['down', 'up', 'right', 'left'])\n .default('down')\n .describe('The direction to scroll'),\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 to the bottom, \"scrollToTop\" for scrolling to the top, \"scrollToRight\" for scrolling to the right, \"scrollToLeft\" for scrolling to the left',\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('The target element to be scrolled'),\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 an element. The direction to scroll, the scroll type, and the distance to scroll. The distance is the number of pixels to scroll. If not specified, use `down` direction, `once` scroll type, and `null` distance.',\n interfaceAlias: 'aiScroll',\n paramSchema: actionScrollParamSchema,\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 'Drag and drop (hold the mouse or finger down and move the mouse) ',\n interfaceAlias: 'aiDragAndDrop',\n paramSchema: actionDragAndDropParamSchema,\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 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 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 swipe gesture. You must specify either \"end\" (target location) or \"distance\" + \"direction\" - they are mutually exclusive. Use \"end\" for precise location-based swipes, or \"distance\" + \"direction\" for relative movement.',\n paramSchema: ActionSwipeParamSchema,\n call,\n });\n};\n\n// ClearInput\nexport const actionClearInputParamSchema = z.object({\n locate: getMidsceneLocationSchema().describe('The input field to be cleared'),\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 call,\n });\n};\n\n// Assert\nexport const actionAssertParamSchema = z.object({\n condition: z.string().describe('The condition of the assertion'),\n thought: z\n .string()\n .describe(\n 'The thought of the assertion, like \"I can see there are A, B, C elements on the page, which means ... , so the assertion is true\"',\n ),\n result: z.boolean().describe('The result of the assertion, true or false'),\n});\nexport type ActionAssertParam = {\n condition: string;\n thought: string;\n result: boolean;\n};\n\nexport const defineActionAssert = (): DeviceAction<ActionAssertParam> => {\n return defineAction<typeof actionAssertParamSchema, ActionAssertParam>({\n name: 'Print_Assert_Result',\n description: 'Print the result of the assertion',\n paramSchema: actionAssertParamSchema,\n call: async (param) => {\n if (typeof param?.result !== 'boolean') {\n throw new Error(\n `The result of the assertion must be a boolean, but got: ${typeof param?.result}. ${param.thought || '(no thought)'}`,\n );\n }\n\n getDebug('device:common-action')(\n `Assert: ${param.condition}, Thought: ${param.thought}, Result: ${param.result}`,\n );\n\n if (!param.result) {\n throw new Error(\n `Assertion failed: ${param.thought || '(no thought)'}. (Assertion = ${param.condition})`,\n );\n }\n },\n });\n};\n\nexport type { DeviceAction } from '../types';\nexport type {\n AndroidDeviceOpt,\n AndroidDeviceInputOpt,\n IOSDeviceOpt,\n IOSDeviceInputOpt,\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","actionKeyboardPressParamSchema","defineActionKeyboardPress","actionScrollParamSchema","defineActionScroll","actionDragAndDropParamSchema","defineActionDragAndDrop","ActionLongPressParamSchema","defineActionLongPress","ActionSwipeParamSchema","defineActionSwipe","actionClearInputParamSchema","defineActionClearInput","actionAssertParamSchema","defineActionAssert","param","Error","getDebug"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB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AE,EAAEA,MAAM,OAAO,IAAI,gBAAgB;YAIzHE,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS,wBACP,CAAC,QAAQ,EAAEF,MAAM,SAAS,CAAC,WAAW,EAAEA,MAAM,OAAO,CAAC,UAAU,EAAEA,MAAM,MAAM,EAAE;YAGlF,IAAI,CAACA,MAAM,MAAM,EACf,MAAM,IAAIC,MACR,CAAC,kBAAkB,EAAED,MAAM,OAAO,IAAI,eAAe,eAAe,EAAEA,MAAM,SAAS,CAAC,CAAC,CAAC;QAG9F;IACF"}
|
package/dist/lib/image/index.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.localImg2Base64 = __webpack_exports__.localImg2Base64;
|
|
|
40
40
|
exports.resizeAndConvertImgBuffer = __webpack_exports__.resizeAndConvertImgBuffer;
|
|
41
41
|
exports.saveBase64Image = __webpack_exports__.saveBase64Image;
|
|
42
42
|
exports.zoomForGPT4o = __webpack_exports__.zoomForGPT4o;
|
|
43
|
-
for(var
|
|
43
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
44
44
|
"httpImg2Base64",
|
|
45
45
|
"imageInfo",
|
|
46
46
|
"imageInfoOfBase64",
|
|
@@ -48,7 +48,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
48
48
|
"resizeAndConvertImgBuffer",
|
|
49
49
|
"saveBase64Image",
|
|
50
50
|
"zoomForGPT4o"
|
|
51
|
-
].indexOf(
|
|
51
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
52
52
|
Object.defineProperty(exports, '__esModule', {
|
|
53
53
|
value: true
|
|
54
54
|
});
|
package/dist/lib/index.js
CHANGED
|
@@ -80,7 +80,7 @@ exports.getMidsceneLocationSchema = __webpack_exports__.getMidsceneLocationSchem
|
|
|
80
80
|
exports.getVersion = __webpack_exports__.getVersion;
|
|
81
81
|
exports.plan = __webpack_exports__.plan;
|
|
82
82
|
exports.z = __webpack_exports__.z;
|
|
83
|
-
for(var
|
|
83
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
84
84
|
"Agent",
|
|
85
85
|
"AiLocateElement",
|
|
86
86
|
"MIDSCENE_MODEL_NAME",
|
|
@@ -99,7 +99,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
99
99
|
"getVersion",
|
|
100
100
|
"plan",
|
|
101
101
|
"z"
|
|
102
|
-
].indexOf(
|
|
102
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
103
103
|
Object.defineProperty(exports, '__esModule', {
|
|
104
104
|
value: true
|
|
105
105
|
});
|
package/dist/lib/report.js
CHANGED
|
@@ -112,9 +112,9 @@ class ReportMergingTool {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
exports.ReportMergingTool = __webpack_exports__.ReportMergingTool;
|
|
115
|
-
for(var
|
|
115
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
116
116
|
"ReportMergingTool"
|
|
117
|
-
].indexOf(
|
|
117
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
118
118
|
Object.defineProperty(exports, '__esModule', {
|
|
119
119
|
value: true
|
|
120
120
|
});
|
|
@@ -242,9 +242,9 @@ class Service {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
exports["default"] = __webpack_exports__["default"];
|
|
245
|
-
for(var
|
|
245
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
246
246
|
"default"
|
|
247
|
-
].indexOf(
|
|
247
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
248
248
|
Object.defineProperty(exports, '__esModule', {
|
|
249
249
|
value: true
|
|
250
250
|
});
|
|
@@ -39,9 +39,9 @@ function createServiceDump(data) {
|
|
|
39
39
|
return finalData;
|
|
40
40
|
}
|
|
41
41
|
exports.createServiceDump = __webpack_exports__.createServiceDump;
|
|
42
|
-
for(var
|
|
42
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
43
|
"createServiceDump"
|
|
44
|
-
].indexOf(
|
|
44
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
45
|
Object.defineProperty(exports, '__esModule', {
|
|
46
46
|
value: true
|
|
47
47
|
});
|
package/dist/lib/task-runner.js
CHANGED
|
@@ -290,10 +290,10 @@ class TaskExecutionError extends Error {
|
|
|
290
290
|
}
|
|
291
291
|
exports.TaskExecutionError = __webpack_exports__.TaskExecutionError;
|
|
292
292
|
exports.TaskRunner = __webpack_exports__.TaskRunner;
|
|
293
|
-
for(var
|
|
293
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
294
294
|
"TaskExecutionError",
|
|
295
295
|
"TaskRunner"
|
|
296
|
-
].indexOf(
|
|
296
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
297
297
|
Object.defineProperty(exports, '__esModule', {
|
|
298
298
|
value: true
|
|
299
299
|
});
|
package/dist/lib/tree.js
CHANGED
|
@@ -41,11 +41,11 @@ function descriptionOfTree(tree, truncateTextLength, filterNonTextContent = fals
|
|
|
41
41
|
exports.descriptionOfTree = __webpack_exports__.descriptionOfTree;
|
|
42
42
|
exports.trimAttributes = __webpack_exports__.trimAttributes;
|
|
43
43
|
exports.truncateText = __webpack_exports__.truncateText;
|
|
44
|
-
for(var
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
45
|
"descriptionOfTree",
|
|
46
46
|
"trimAttributes",
|
|
47
47
|
"truncateText"
|
|
48
|
-
].indexOf(
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
49
|
Object.defineProperty(exports, '__esModule', {
|
|
50
50
|
value: true
|
|
51
51
|
});
|
package/dist/lib/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"./yaml"
|
|
3
|
+
"./yaml" (module) {
|
|
4
4
|
module.exports = require("./yaml.js");
|
|
5
5
|
}
|
|
6
6
|
};
|
|
@@ -89,11 +89,11 @@ var __webpack_exports__ = {};
|
|
|
89
89
|
exports.AIResponseFormat = __webpack_exports__.AIResponseFormat;
|
|
90
90
|
exports.ServiceError = __webpack_exports__.ServiceError;
|
|
91
91
|
exports.UIContext = __webpack_exports__.UIContext;
|
|
92
|
-
for(var
|
|
92
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
93
93
|
"AIResponseFormat",
|
|
94
94
|
"ServiceError",
|
|
95
95
|
"UIContext"
|
|
96
|
-
].indexOf(
|
|
96
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
97
97
|
Object.defineProperty(exports, '__esModule', {
|
|
98
98
|
value: true
|
|
99
99
|
});
|