@midscene/visualizer 0.27.4-beta-20250826061259.0 → 0.27.4-beta-20250826121712.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.
|
@@ -31,10 +31,29 @@ const PromptInput = (param)=>{
|
|
|
31
31
|
const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
|
|
32
32
|
return null == action ? void 0 : action.paramSchema;
|
|
33
33
|
}
|
|
34
|
+
}, [
|
|
35
|
+
selectedType,
|
|
36
|
+
actionSpace
|
|
37
|
+
]);
|
|
38
|
+
const showDeepThinkOption = useMemo(()=>{
|
|
39
|
+
if (actionSpace) {
|
|
40
|
+
const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
|
|
41
|
+
if ((null == action ? void 0 : action.paramSchema) && isZodObjectSchema(action.paramSchema)) {
|
|
42
|
+
const schema = action.paramSchema;
|
|
43
|
+
return Object.keys(schema.shape).some((key)=>{
|
|
44
|
+
const field = schema.shape[key];
|
|
45
|
+
const { actualField } = unwrapZodType(field);
|
|
46
|
+
return isLocateField(actualField);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
34
51
|
return [
|
|
52
|
+
'aiTap',
|
|
53
|
+
'aiHover',
|
|
35
54
|
'aiInput',
|
|
36
|
-
'
|
|
37
|
-
'
|
|
55
|
+
'aiRightClick',
|
|
56
|
+
'aiLocate'
|
|
38
57
|
].includes(selectedType);
|
|
39
58
|
}, [
|
|
40
59
|
selectedType,
|
|
@@ -219,7 +238,7 @@ const PromptInput = (param)=>{
|
|
|
219
238
|
if (1 === schemaKeys.length) {
|
|
220
239
|
const key = schemaKeys[0];
|
|
221
240
|
const field = schema.shape[key];
|
|
222
|
-
const { actualField
|
|
241
|
+
const { actualField } = unwrapZodType(field);
|
|
223
242
|
const isLocateFieldFlag = isLocateField(actualField);
|
|
224
243
|
let placeholderText = '';
|
|
225
244
|
if (isLocateFieldFlag) placeholderText = 'Describe the element you want to interact with';
|
|
@@ -263,16 +282,16 @@ const PromptInput = (param)=>{
|
|
|
263
282
|
};
|
|
264
283
|
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ jsx(LocateField, {
|
|
265
284
|
...fieldProps
|
|
266
|
-
}));
|
|
285
|
+
}, key));
|
|
267
286
|
else if ((null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName) === 'ZodEnum') fields.push(/*#__PURE__*/ jsx(EnumField, {
|
|
268
287
|
...fieldProps
|
|
269
|
-
}));
|
|
288
|
+
}, key));
|
|
270
289
|
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ jsx(NumberField, {
|
|
271
290
|
...fieldProps
|
|
272
|
-
}));
|
|
291
|
+
}, key));
|
|
273
292
|
else fields.push(/*#__PURE__*/ jsx(TextField, {
|
|
274
293
|
...fieldProps
|
|
275
|
-
}));
|
|
294
|
+
}, key));
|
|
276
295
|
});
|
|
277
296
|
if ('aiScroll' === selectedType) {
|
|
278
297
|
const directionField = fields.find((field)=>/*#__PURE__*/ react.isValidElement(field) && 'direction' === field.props.name);
|
|
@@ -464,7 +483,7 @@ const PromptInput = (param)=>{
|
|
|
464
483
|
onMouseLeave: handleMouseLeave,
|
|
465
484
|
children: /*#__PURE__*/ jsx(ConfigSelector, {
|
|
466
485
|
enableTracking: 'In-Browser-Extension' === serviceMode,
|
|
467
|
-
showDeepThinkOption:
|
|
486
|
+
showDeepThinkOption: showDeepThinkOption
|
|
468
487
|
})
|
|
469
488
|
})
|
|
470
489
|
]
|
|
@@ -69,10 +69,29 @@ const PromptInput = (param)=>{
|
|
|
69
69
|
const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
|
|
70
70
|
return null == action ? void 0 : action.paramSchema;
|
|
71
71
|
}
|
|
72
|
+
}, [
|
|
73
|
+
selectedType,
|
|
74
|
+
actionSpace
|
|
75
|
+
]);
|
|
76
|
+
const showDeepThinkOption = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
77
|
+
if (actionSpace) {
|
|
78
|
+
const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
|
|
79
|
+
if ((null == action ? void 0 : action.paramSchema) && (0, external_types_js_namespaceObject.isZodObjectSchema)(action.paramSchema)) {
|
|
80
|
+
const schema = action.paramSchema;
|
|
81
|
+
return Object.keys(schema.shape).some((key)=>{
|
|
82
|
+
const field = schema.shape[key];
|
|
83
|
+
const { actualField } = (0, external_types_js_namespaceObject.unwrapZodType)(field);
|
|
84
|
+
return (0, external_types_js_namespaceObject.isLocateField)(actualField);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
72
89
|
return [
|
|
90
|
+
'aiTap',
|
|
91
|
+
'aiHover',
|
|
73
92
|
'aiInput',
|
|
74
|
-
'
|
|
75
|
-
'
|
|
93
|
+
'aiRightClick',
|
|
94
|
+
'aiLocate'
|
|
76
95
|
].includes(selectedType);
|
|
77
96
|
}, [
|
|
78
97
|
selectedType,
|
|
@@ -257,7 +276,7 @@ const PromptInput = (param)=>{
|
|
|
257
276
|
if (1 === schemaKeys.length) {
|
|
258
277
|
const key = schemaKeys[0];
|
|
259
278
|
const field = schema.shape[key];
|
|
260
|
-
const { actualField
|
|
279
|
+
const { actualField } = (0, external_types_js_namespaceObject.unwrapZodType)(field);
|
|
261
280
|
const isLocateFieldFlag = (0, external_types_js_namespaceObject.isLocateField)(actualField);
|
|
262
281
|
let placeholderText = '';
|
|
263
282
|
if (isLocateFieldFlag) placeholderText = 'Describe the element you want to interact with';
|
|
@@ -301,16 +320,16 @@ const PromptInput = (param)=>{
|
|
|
301
320
|
};
|
|
302
321
|
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_FormField_js_namespaceObject.LocateField, {
|
|
303
322
|
...fieldProps
|
|
304
|
-
}));
|
|
323
|
+
}, key));
|
|
305
324
|
else if ((null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName) === 'ZodEnum') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_FormField_js_namespaceObject.EnumField, {
|
|
306
325
|
...fieldProps
|
|
307
|
-
}));
|
|
326
|
+
}, key));
|
|
308
327
|
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_FormField_js_namespaceObject.NumberField, {
|
|
309
328
|
...fieldProps
|
|
310
|
-
}));
|
|
329
|
+
}, key));
|
|
311
330
|
else fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_FormField_js_namespaceObject.TextField, {
|
|
312
331
|
...fieldProps
|
|
313
|
-
}));
|
|
332
|
+
}, key));
|
|
314
333
|
});
|
|
315
334
|
if ('aiScroll' === selectedType) {
|
|
316
335
|
const directionField = fields.find((field)=>/*#__PURE__*/ external_react_default().isValidElement(field) && 'direction' === field.props.name);
|
|
@@ -502,7 +521,7 @@ const PromptInput = (param)=>{
|
|
|
502
521
|
onMouseLeave: handleMouseLeave,
|
|
503
522
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ConfigSelector_js_namespaceObject.ConfigSelector, {
|
|
504
523
|
enableTracking: 'In-Browser-Extension' === serviceMode,
|
|
505
|
-
showDeepThinkOption:
|
|
524
|
+
showDeepThinkOption: showDeepThinkOption
|
|
506
525
|
})
|
|
507
526
|
})
|
|
508
527
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "0.27.4-beta-
|
|
3
|
+
"version": "0.27.4-beta-20250826121712.0",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"antd": "^5.21.6",
|
|
71
71
|
"buffer": "6.0.3",
|
|
72
72
|
"dayjs": "^1.11.11",
|
|
73
|
-
"@midscene/shared": "0.27.4-beta-
|
|
74
|
-
"@midscene/
|
|
75
|
-
"@midscene/
|
|
73
|
+
"@midscene/shared": "0.27.4-beta-20250826121712.0",
|
|
74
|
+
"@midscene/web": "0.27.4-beta-20250826121712.0",
|
|
75
|
+
"@midscene/core": "0.27.4-beta-20250826121712.0"
|
|
76
76
|
},
|
|
77
77
|
"license": "MIT",
|
|
78
78
|
"scripts": {
|