@midscene/visualizer 1.7.10-beta-20260507123827.0 → 1.7.10
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/component/screenshot-viewer/index.mjs +18 -2
- package/dist/es/component/universal-playground/index.css +19 -16
- package/dist/es/component/universal-playground/index.mjs +10 -5
- package/dist/es/utils/action-label.mjs +1 -0
- package/dist/es/utils/progress-action-icon.mjs +19 -38
- package/dist/es/utils/prompt-input-utils.mjs +1 -5
- package/dist/lib/component/screenshot-viewer/index.js +18 -2
- package/dist/lib/component/universal-playground/index.css +19 -16
- package/dist/lib/component/universal-playground/index.js +10 -5
- package/dist/lib/utils/action-label.js +1 -0
- package/dist/lib/utils/progress-action-icon.js +19 -38
- package/dist/lib/utils/prompt-input-utils.js +1 -5
- package/dist/types/utils/progress-action-icon.d.ts +4 -8
- package/dist/types/utils/prompt-input-utils.d.ts +3 -4
- package/package.json +5 -5
|
@@ -36,6 +36,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
36
36
|
const [lastUpdateTime, setLastUpdateTime] = useState(0);
|
|
37
37
|
const [interfaceInfo, setInterfaceInfo] = useState(null);
|
|
38
38
|
const [mjpegRetryToken, setMjpegRetryToken] = useState('');
|
|
39
|
+
const mjpegImageRef = useRef(null);
|
|
39
40
|
const isMjpeg = Boolean(mjpegUrl && serverOnline);
|
|
40
41
|
const showChrome = 'screen-only' !== mode;
|
|
41
42
|
const rootClassName = [
|
|
@@ -44,6 +45,19 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
44
45
|
].filter(Boolean).join(' ');
|
|
45
46
|
const pollingIntervalRef = useRef(null);
|
|
46
47
|
const isPollingPausedRef = useRef(false);
|
|
48
|
+
useEffect(()=>{
|
|
49
|
+
if (!isMjpeg) return;
|
|
50
|
+
const timer = window.setTimeout(()=>{
|
|
51
|
+
const image = mjpegImageRef.current;
|
|
52
|
+
if (!image || image.naturalWidth > 0 || image.naturalHeight > 0) return;
|
|
53
|
+
setMjpegRetryToken(String(Date.now()));
|
|
54
|
+
}, 2500);
|
|
55
|
+
return ()=>window.clearTimeout(timer);
|
|
56
|
+
}, [
|
|
57
|
+
isMjpeg,
|
|
58
|
+
mjpegRetryToken,
|
|
59
|
+
mjpegUrl
|
|
60
|
+
]);
|
|
47
61
|
const fetchScreenshot = useCallback((isManual = false)=>_async_to_generator(function*() {
|
|
48
62
|
if (!serverOnline) return;
|
|
49
63
|
setLoading(true);
|
|
@@ -135,7 +149,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
135
149
|
fetchInterfaceInfo
|
|
136
150
|
]);
|
|
137
151
|
useEffect(()=>{
|
|
138
|
-
if (!serverOnline) return;
|
|
152
|
+
if (!serverOnline || isMjpeg) return;
|
|
139
153
|
if (isUserOperating) pausePolling();
|
|
140
154
|
else {
|
|
141
155
|
resumePolling();
|
|
@@ -146,7 +160,8 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
146
160
|
pausePolling,
|
|
147
161
|
resumePolling,
|
|
148
162
|
fetchScreenshot,
|
|
149
|
-
serverOnline
|
|
163
|
+
serverOnline,
|
|
164
|
+
isMjpeg
|
|
150
165
|
]);
|
|
151
166
|
useEffect(()=>()=>{
|
|
152
167
|
stopPolling();
|
|
@@ -204,6 +219,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
204
219
|
const screenshotContent = /*#__PURE__*/ jsx("div", {
|
|
205
220
|
className: "screenshot-content",
|
|
206
221
|
children: isMjpeg ? /*#__PURE__*/ jsx("img", {
|
|
222
|
+
ref: mjpegImageRef,
|
|
207
223
|
src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
|
|
208
224
|
alt: "Device Live Stream",
|
|
209
225
|
className: "screenshot-image",
|
|
@@ -405,7 +405,6 @@
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
.playground-container.playground-conversation-skin .bottom-input-section {
|
|
408
|
-
border-top: 1px solid var(--midscene-border-subtle);
|
|
409
408
|
background: var(--midscene-surface);
|
|
410
409
|
flex-shrink: 0;
|
|
411
410
|
padding: 12px;
|
|
@@ -417,27 +416,27 @@
|
|
|
417
416
|
}
|
|
418
417
|
|
|
419
418
|
.playground-container.playground-conversation-skin .list-item > div:has( > .progress-action-item) {
|
|
420
|
-
|
|
421
|
-
align-items: flex-start;
|
|
422
|
-
gap: 8px;
|
|
423
|
-
display: flex;
|
|
419
|
+
display: block;
|
|
424
420
|
}
|
|
425
421
|
|
|
426
422
|
.playground-container.playground-conversation-skin .progress-action-item {
|
|
427
423
|
color: rgba(0, 0, 0, .7);
|
|
424
|
+
letter-spacing: 0;
|
|
428
425
|
background: rgba(0, 0, 0, .08);
|
|
429
426
|
border-radius: 38px;
|
|
430
427
|
flex-direction: row-reverse;
|
|
431
428
|
justify-content: flex-end;
|
|
432
429
|
align-items: center;
|
|
433
|
-
gap:
|
|
430
|
+
gap: 4px;
|
|
434
431
|
width: -moz-fit-content;
|
|
435
432
|
width: fit-content;
|
|
436
433
|
max-width: 100%;
|
|
437
434
|
height: 28px;
|
|
438
435
|
margin: 0 0 0 24px;
|
|
439
436
|
padding: 2px 12px 2px 4px;
|
|
437
|
+
font-family: Inter, sans-serif;
|
|
440
438
|
font-size: 14px;
|
|
439
|
+
font-weight: 400;
|
|
441
440
|
line-height: 22px;
|
|
442
441
|
display: flex;
|
|
443
442
|
}
|
|
@@ -445,16 +444,16 @@
|
|
|
445
444
|
.playground-container.playground-conversation-skin .progress-action-item .progress-status-icon {
|
|
446
445
|
justify-content: center;
|
|
447
446
|
align-items: center;
|
|
448
|
-
width:
|
|
449
|
-
height:
|
|
447
|
+
width: 16px;
|
|
448
|
+
height: 28px;
|
|
450
449
|
margin-left: 0;
|
|
451
|
-
font-size:
|
|
450
|
+
font-size: 16px;
|
|
452
451
|
display: inline-flex;
|
|
453
452
|
}
|
|
454
453
|
|
|
455
454
|
.playground-container.playground-conversation-skin .progress-action-item + div {
|
|
456
455
|
width: 100%;
|
|
457
|
-
margin: 0;
|
|
456
|
+
margin: 8px 0 0;
|
|
458
457
|
padding-left: 20px;
|
|
459
458
|
}
|
|
460
459
|
|
|
@@ -474,19 +473,23 @@
|
|
|
474
473
|
margin-top: -8px;
|
|
475
474
|
}
|
|
476
475
|
|
|
477
|
-
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):
|
|
476
|
+
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):after {
|
|
478
477
|
content: "";
|
|
479
478
|
pointer-events: none;
|
|
480
479
|
background: rgba(0, 0, 0, .08);
|
|
481
480
|
width: 1px;
|
|
482
481
|
position: absolute;
|
|
483
|
-
top:
|
|
482
|
+
top: 0;
|
|
484
483
|
bottom: -16px;
|
|
485
|
-
left:
|
|
484
|
+
left: 8px;
|
|
486
485
|
}
|
|
487
486
|
|
|
488
|
-
.playground-container.playground-conversation-skin .list-item:
|
|
489
|
-
top:
|
|
487
|
+
.playground-container.playground-conversation-skin .list-item:not(.list-item:has(.progress-action-item) + .list-item):has(.progress-action-item):after {
|
|
488
|
+
top: 23px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):not(:has( + .list-item .progress-action-item)):after {
|
|
492
|
+
bottom: 0;
|
|
490
493
|
}
|
|
491
494
|
|
|
492
495
|
.playground-container.playground-conversation-skin .progress-group-toggle {
|
|
@@ -499,7 +502,7 @@
|
|
|
499
502
|
background: rgba(255, 255, 255, .08);
|
|
500
503
|
}
|
|
501
504
|
|
|
502
|
-
[data-theme="dark"] .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):
|
|
505
|
+
[data-theme="dark"] .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):after {
|
|
503
506
|
background: rgba(255, 255, 255, .12);
|
|
504
507
|
}
|
|
505
508
|
|
|
@@ -171,7 +171,8 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
171
171
|
const firstIds = new Set();
|
|
172
172
|
const visible = [];
|
|
173
173
|
let currentGroupFirstId = null;
|
|
174
|
-
|
|
174
|
+
const hideWelcome = infoList.length > 1;
|
|
175
|
+
for (const item of infoList)if (!hideWelcome || 'welcome' !== item.id) if ('progress' === item.type) {
|
|
175
176
|
if (null === currentGroupFirstId) {
|
|
176
177
|
currentGroupFirstId = item.id;
|
|
177
178
|
firstIds.add(item.id);
|
|
@@ -281,10 +282,13 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
281
282
|
}) : /*#__PURE__*/ jsx(List, {
|
|
282
283
|
itemLayout: "vertical",
|
|
283
284
|
dataSource: visibleInfoList,
|
|
284
|
-
renderItem: (item)
|
|
285
|
+
renderItem: (item)=>{
|
|
286
|
+
const isFirstInProgressGroup = collapsibleProgressGroup && firstInProgressGroup.has(item.id);
|
|
287
|
+
const isCollapsedHeader = isFirstInProgressGroup && collapsedProgressGroups.has(item.id);
|
|
288
|
+
return /*#__PURE__*/ jsxs(List.Item, {
|
|
285
289
|
className: "list-item",
|
|
286
290
|
children: [
|
|
287
|
-
|
|
291
|
+
isFirstInProgressGroup ? /*#__PURE__*/ jsxs("button", {
|
|
288
292
|
type: "button",
|
|
289
293
|
className: `progress-group-toggle ${collapsedProgressGroups.has(item.id) ? 'is-collapsed' : 'is-expanded'}`,
|
|
290
294
|
"aria-expanded": !collapsedProgressGroups.has(item.id),
|
|
@@ -299,7 +303,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
299
303
|
})
|
|
300
304
|
]
|
|
301
305
|
}) : null,
|
|
302
|
-
'user' === item.type ? /*#__PURE__*/ jsx("div", {
|
|
306
|
+
isCollapsedHeader ? null : 'user' === item.type ? /*#__PURE__*/ jsx("div", {
|
|
303
307
|
className: "user-message-container",
|
|
304
308
|
children: /*#__PURE__*/ jsx("div", {
|
|
305
309
|
className: "user-message-bubble",
|
|
@@ -407,7 +411,8 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
407
411
|
]
|
|
408
412
|
})
|
|
409
413
|
]
|
|
410
|
-
}, item.id)
|
|
414
|
+
}, item.id);
|
|
415
|
+
}
|
|
411
416
|
})
|
|
412
417
|
}),
|
|
413
418
|
showScrollToBottomButton && false !== componentConfig.enableScrollToBottom && /*#__PURE__*/ jsx(Button, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const actionNameForType = (type)=>{
|
|
2
2
|
if (!type) return '';
|
|
3
|
+
if ('aiAct' === type) return 'Action';
|
|
3
4
|
const typeWithoutAi = type.startsWith('ai') ? type.slice(2) : type;
|
|
4
5
|
if (typeWithoutAi.startsWith('IOS')) return typeWithoutAi.substring(3).replace(/([A-Z])/g, ' $1').replace(/^/, 'IOS').trim();
|
|
5
6
|
const fullName = typeWithoutAi.replace(/([A-Z])/g, ' $1').trim();
|
|
@@ -1,42 +1,23 @@
|
|
|
1
|
-
import { AimOutlined, CheckCircleOutlined, EditOutlined, ExperimentOutlined, FileSearchOutlined, HourglassOutlined, PlayCircleOutlined, QuestionCircleOutlined, SearchOutlined, SelectOutlined, SwapOutlined, ThunderboltOutlined } from "@ant-design/icons";
|
|
2
1
|
import { createElement } from "react";
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
case 'PullGesture':
|
|
23
|
-
return /*#__PURE__*/ createElement(SwapOutlined);
|
|
24
|
-
case 'WaitFor':
|
|
25
|
-
return /*#__PURE__*/ createElement(HourglassOutlined);
|
|
26
|
-
case 'Assert':
|
|
27
|
-
case 'Boolean':
|
|
28
|
-
return /*#__PURE__*/ createElement(CheckCircleOutlined);
|
|
29
|
-
case 'Query':
|
|
30
|
-
case 'Number':
|
|
31
|
-
case 'String':
|
|
32
|
-
return /*#__PURE__*/ createElement(FileSearchOutlined);
|
|
33
|
-
case 'Ask':
|
|
34
|
-
return /*#__PURE__*/ createElement(QuestionCircleOutlined);
|
|
35
|
-
case 'Act':
|
|
36
|
-
return /*#__PURE__*/ createElement(PlayCircleOutlined);
|
|
37
|
-
default:
|
|
38
|
-
return /*#__PURE__*/ createElement(ThunderboltOutlined);
|
|
39
|
-
}
|
|
2
|
+
function CompletedActionIcon() {
|
|
3
|
+
return /*#__PURE__*/ createElement('svg', {
|
|
4
|
+
width: 16,
|
|
5
|
+
height: 16,
|
|
6
|
+
viewBox: '0 0 24 24',
|
|
7
|
+
fill: 'none',
|
|
8
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
9
|
+
'aria-hidden': true,
|
|
10
|
+
focusable: false
|
|
11
|
+
}, /*#__PURE__*/ createElement('path', {
|
|
12
|
+
d: 'M7.3335 12L10.6668 15.3334L17.3335 8.66669',
|
|
13
|
+
stroke: '#188F4D',
|
|
14
|
+
strokeWidth: '1.33333',
|
|
15
|
+
strokeLinecap: 'round',
|
|
16
|
+
strokeLinejoin: 'round'
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
function defaultProgressActionIcon(_kind) {
|
|
20
|
+
return /*#__PURE__*/ createElement(CompletedActionIcon);
|
|
40
21
|
}
|
|
41
22
|
function resolveProgressActionIcon(kind, override) {
|
|
42
23
|
if (!kind) return null;
|
|
@@ -4,14 +4,10 @@ const getAvailablePromptActionTypes = (actionSpace)=>{
|
|
|
4
4
|
const metadataMethods = Object.keys(apiMetadata);
|
|
5
5
|
if (!(null == actionSpace ? void 0 : actionSpace.length)) return metadataMethods;
|
|
6
6
|
const availableMethods = actionSpace.map((action)=>action.interfaceAlias || action.name);
|
|
7
|
-
const supportsAiAct = availableMethods.includes('aiAct');
|
|
8
7
|
const finalMethods = new Set();
|
|
9
8
|
metadataMethods.forEach((method)=>{
|
|
10
9
|
const methodInfo = apiMetadata[method];
|
|
11
|
-
if ('aiAct' === method)
|
|
12
|
-
if (supportsAiAct) finalMethods.add(method);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
10
|
+
if ('aiAct' === method) return void finalMethods.add(method);
|
|
15
11
|
if ((null == methodInfo ? void 0 : methodInfo.group) === 'extraction' || (null == methodInfo ? void 0 : methodInfo.group) === 'validation') return void finalMethods.add(method);
|
|
16
12
|
if (availableMethods.includes(method)) finalMethods.add(method);
|
|
17
13
|
});
|
|
@@ -64,6 +64,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
64
64
|
const [lastUpdateTime, setLastUpdateTime] = (0, external_react_namespaceObject.useState)(0);
|
|
65
65
|
const [interfaceInfo, setInterfaceInfo] = (0, external_react_namespaceObject.useState)(null);
|
|
66
66
|
const [mjpegRetryToken, setMjpegRetryToken] = (0, external_react_namespaceObject.useState)('');
|
|
67
|
+
const mjpegImageRef = (0, external_react_namespaceObject.useRef)(null);
|
|
67
68
|
const isMjpeg = Boolean(mjpegUrl && serverOnline);
|
|
68
69
|
const showChrome = 'screen-only' !== mode;
|
|
69
70
|
const rootClassName = [
|
|
@@ -72,6 +73,19 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
72
73
|
].filter(Boolean).join(' ');
|
|
73
74
|
const pollingIntervalRef = (0, external_react_namespaceObject.useRef)(null);
|
|
74
75
|
const isPollingPausedRef = (0, external_react_namespaceObject.useRef)(false);
|
|
76
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
77
|
+
if (!isMjpeg) return;
|
|
78
|
+
const timer = window.setTimeout(()=>{
|
|
79
|
+
const image = mjpegImageRef.current;
|
|
80
|
+
if (!image || image.naturalWidth > 0 || image.naturalHeight > 0) return;
|
|
81
|
+
setMjpegRetryToken(String(Date.now()));
|
|
82
|
+
}, 2500);
|
|
83
|
+
return ()=>window.clearTimeout(timer);
|
|
84
|
+
}, [
|
|
85
|
+
isMjpeg,
|
|
86
|
+
mjpegRetryToken,
|
|
87
|
+
mjpegUrl
|
|
88
|
+
]);
|
|
75
89
|
const fetchScreenshot = (0, external_react_namespaceObject.useCallback)((isManual = false)=>_async_to_generator(function*() {
|
|
76
90
|
if (!serverOnline) return;
|
|
77
91
|
setLoading(true);
|
|
@@ -163,7 +177,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
163
177
|
fetchInterfaceInfo
|
|
164
178
|
]);
|
|
165
179
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
166
|
-
if (!serverOnline) return;
|
|
180
|
+
if (!serverOnline || isMjpeg) return;
|
|
167
181
|
if (isUserOperating) pausePolling();
|
|
168
182
|
else {
|
|
169
183
|
resumePolling();
|
|
@@ -174,7 +188,8 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
174
188
|
pausePolling,
|
|
175
189
|
resumePolling,
|
|
176
190
|
fetchScreenshot,
|
|
177
|
-
serverOnline
|
|
191
|
+
serverOnline,
|
|
192
|
+
isMjpeg
|
|
178
193
|
]);
|
|
179
194
|
(0, external_react_namespaceObject.useEffect)(()=>()=>{
|
|
180
195
|
stopPolling();
|
|
@@ -232,6 +247,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
232
247
|
const screenshotContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
233
248
|
className: "screenshot-content",
|
|
234
249
|
children: isMjpeg ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
250
|
+
ref: mjpegImageRef,
|
|
235
251
|
src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
|
|
236
252
|
alt: "Device Live Stream",
|
|
237
253
|
className: "screenshot-image",
|
|
@@ -405,7 +405,6 @@
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
.playground-container.playground-conversation-skin .bottom-input-section {
|
|
408
|
-
border-top: 1px solid var(--midscene-border-subtle);
|
|
409
408
|
background: var(--midscene-surface);
|
|
410
409
|
flex-shrink: 0;
|
|
411
410
|
padding: 12px;
|
|
@@ -417,27 +416,27 @@
|
|
|
417
416
|
}
|
|
418
417
|
|
|
419
418
|
.playground-container.playground-conversation-skin .list-item > div:has( > .progress-action-item) {
|
|
420
|
-
|
|
421
|
-
align-items: flex-start;
|
|
422
|
-
gap: 8px;
|
|
423
|
-
display: flex;
|
|
419
|
+
display: block;
|
|
424
420
|
}
|
|
425
421
|
|
|
426
422
|
.playground-container.playground-conversation-skin .progress-action-item {
|
|
427
423
|
color: rgba(0, 0, 0, .7);
|
|
424
|
+
letter-spacing: 0;
|
|
428
425
|
background: rgba(0, 0, 0, .08);
|
|
429
426
|
border-radius: 38px;
|
|
430
427
|
flex-direction: row-reverse;
|
|
431
428
|
justify-content: flex-end;
|
|
432
429
|
align-items: center;
|
|
433
|
-
gap:
|
|
430
|
+
gap: 4px;
|
|
434
431
|
width: -moz-fit-content;
|
|
435
432
|
width: fit-content;
|
|
436
433
|
max-width: 100%;
|
|
437
434
|
height: 28px;
|
|
438
435
|
margin: 0 0 0 24px;
|
|
439
436
|
padding: 2px 12px 2px 4px;
|
|
437
|
+
font-family: Inter, sans-serif;
|
|
440
438
|
font-size: 14px;
|
|
439
|
+
font-weight: 400;
|
|
441
440
|
line-height: 22px;
|
|
442
441
|
display: flex;
|
|
443
442
|
}
|
|
@@ -445,16 +444,16 @@
|
|
|
445
444
|
.playground-container.playground-conversation-skin .progress-action-item .progress-status-icon {
|
|
446
445
|
justify-content: center;
|
|
447
446
|
align-items: center;
|
|
448
|
-
width:
|
|
449
|
-
height:
|
|
447
|
+
width: 16px;
|
|
448
|
+
height: 28px;
|
|
450
449
|
margin-left: 0;
|
|
451
|
-
font-size:
|
|
450
|
+
font-size: 16px;
|
|
452
451
|
display: inline-flex;
|
|
453
452
|
}
|
|
454
453
|
|
|
455
454
|
.playground-container.playground-conversation-skin .progress-action-item + div {
|
|
456
455
|
width: 100%;
|
|
457
|
-
margin: 0;
|
|
456
|
+
margin: 8px 0 0;
|
|
458
457
|
padding-left: 20px;
|
|
459
458
|
}
|
|
460
459
|
|
|
@@ -474,19 +473,23 @@
|
|
|
474
473
|
margin-top: -8px;
|
|
475
474
|
}
|
|
476
475
|
|
|
477
|
-
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):
|
|
476
|
+
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):after {
|
|
478
477
|
content: "";
|
|
479
478
|
pointer-events: none;
|
|
480
479
|
background: rgba(0, 0, 0, .08);
|
|
481
480
|
width: 1px;
|
|
482
481
|
position: absolute;
|
|
483
|
-
top:
|
|
482
|
+
top: 0;
|
|
484
483
|
bottom: -16px;
|
|
485
|
-
left:
|
|
484
|
+
left: 8px;
|
|
486
485
|
}
|
|
487
486
|
|
|
488
|
-
.playground-container.playground-conversation-skin .list-item:
|
|
489
|
-
top:
|
|
487
|
+
.playground-container.playground-conversation-skin .list-item:not(.list-item:has(.progress-action-item) + .list-item):has(.progress-action-item):after {
|
|
488
|
+
top: 23px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.playground-container.playground-conversation-skin .list-item:has(.progress-action-item):not(:has( + .list-item .progress-action-item)):after {
|
|
492
|
+
bottom: 0;
|
|
490
493
|
}
|
|
491
494
|
|
|
492
495
|
.playground-container.playground-conversation-skin .progress-group-toggle {
|
|
@@ -499,7 +502,7 @@
|
|
|
499
502
|
background: rgba(255, 255, 255, .08);
|
|
500
503
|
}
|
|
501
504
|
|
|
502
|
-
[data-theme="dark"] .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):
|
|
505
|
+
[data-theme="dark"] .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):after {
|
|
503
506
|
background: rgba(255, 255, 255, .12);
|
|
504
507
|
}
|
|
505
508
|
|
|
@@ -212,7 +212,8 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
212
212
|
const firstIds = new Set();
|
|
213
213
|
const visible = [];
|
|
214
214
|
let currentGroupFirstId = null;
|
|
215
|
-
|
|
215
|
+
const hideWelcome = infoList.length > 1;
|
|
216
|
+
for (const item of infoList)if (!hideWelcome || 'welcome' !== item.id) if ('progress' === item.type) {
|
|
216
217
|
if (null === currentGroupFirstId) {
|
|
217
218
|
currentGroupFirstId = item.id;
|
|
218
219
|
firstIds.add(item.id);
|
|
@@ -322,10 +323,13 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
322
323
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
|
|
323
324
|
itemLayout: "vertical",
|
|
324
325
|
dataSource: visibleInfoList,
|
|
325
|
-
renderItem: (item)
|
|
326
|
+
renderItem: (item)=>{
|
|
327
|
+
const isFirstInProgressGroup = collapsibleProgressGroup && firstInProgressGroup.has(item.id);
|
|
328
|
+
const isCollapsedHeader = isFirstInProgressGroup && collapsedProgressGroups.has(item.id);
|
|
329
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.List.Item, {
|
|
326
330
|
className: "list-item",
|
|
327
331
|
children: [
|
|
328
|
-
|
|
332
|
+
isFirstInProgressGroup ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
329
333
|
type: "button",
|
|
330
334
|
className: `progress-group-toggle ${collapsedProgressGroups.has(item.id) ? 'is-collapsed' : 'is-expanded'}`,
|
|
331
335
|
"aria-expanded": !collapsedProgressGroups.has(item.id),
|
|
@@ -340,7 +344,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
340
344
|
})
|
|
341
345
|
]
|
|
342
346
|
}) : null,
|
|
343
|
-
'user' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
347
|
+
isCollapsedHeader ? null : 'user' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
344
348
|
className: "user-message-container",
|
|
345
349
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
346
350
|
className: "user-message-bubble",
|
|
@@ -448,7 +452,8 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
448
452
|
]
|
|
449
453
|
})
|
|
450
454
|
]
|
|
451
|
-
}, item.id)
|
|
455
|
+
}, item.id);
|
|
456
|
+
}
|
|
452
457
|
})
|
|
453
458
|
}),
|
|
454
459
|
showScrollToBottomButton && false !== componentConfig.enableScrollToBottom && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
});
|
|
30
30
|
const actionNameForType = (type)=>{
|
|
31
31
|
if (!type) return '';
|
|
32
|
+
if ('aiAct' === type) return 'Action';
|
|
32
33
|
const typeWithoutAi = type.startsWith('ai') ? type.slice(2) : type;
|
|
33
34
|
if (typeWithoutAi.startsWith('IOS')) return typeWithoutAi.substring(3).replace(/([A-Z])/g, ' $1').replace(/^/, 'IOS').trim();
|
|
34
35
|
const fullName = typeWithoutAi.replace(/([A-Z])/g, ' $1').trim();
|
|
@@ -27,45 +27,26 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
defaultProgressActionIcon: ()=>defaultProgressActionIcon,
|
|
28
28
|
resolveProgressActionIcon: ()=>resolveProgressActionIcon
|
|
29
29
|
});
|
|
30
|
-
const icons_namespaceObject = require("@ant-design/icons");
|
|
31
30
|
const external_react_namespaceObject = require("react");
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
case 'PullGesture':
|
|
52
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.SwapOutlined);
|
|
53
|
-
case 'WaitFor':
|
|
54
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.HourglassOutlined);
|
|
55
|
-
case 'Assert':
|
|
56
|
-
case 'Boolean':
|
|
57
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.CheckCircleOutlined);
|
|
58
|
-
case 'Query':
|
|
59
|
-
case 'Number':
|
|
60
|
-
case 'String':
|
|
61
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.FileSearchOutlined);
|
|
62
|
-
case 'Ask':
|
|
63
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.QuestionCircleOutlined);
|
|
64
|
-
case 'Act':
|
|
65
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.PlayCircleOutlined);
|
|
66
|
-
default:
|
|
67
|
-
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(icons_namespaceObject.ThunderboltOutlined);
|
|
68
|
-
}
|
|
31
|
+
function CompletedActionIcon() {
|
|
32
|
+
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)('svg', {
|
|
33
|
+
width: 16,
|
|
34
|
+
height: 16,
|
|
35
|
+
viewBox: '0 0 24 24',
|
|
36
|
+
fill: 'none',
|
|
37
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
38
|
+
'aria-hidden': true,
|
|
39
|
+
focusable: false
|
|
40
|
+
}, /*#__PURE__*/ (0, external_react_namespaceObject.createElement)('path', {
|
|
41
|
+
d: 'M7.3335 12L10.6668 15.3334L17.3335 8.66669',
|
|
42
|
+
stroke: '#188F4D',
|
|
43
|
+
strokeWidth: '1.33333',
|
|
44
|
+
strokeLinecap: 'round',
|
|
45
|
+
strokeLinejoin: 'round'
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
function defaultProgressActionIcon(_kind) {
|
|
49
|
+
return /*#__PURE__*/ (0, external_react_namespaceObject.createElement)(CompletedActionIcon);
|
|
69
50
|
}
|
|
70
51
|
function resolveProgressActionIcon(kind, override) {
|
|
71
52
|
if (!kind) return null;
|
|
@@ -34,14 +34,10 @@ const getAvailablePromptActionTypes = (actionSpace)=>{
|
|
|
34
34
|
const metadataMethods = Object.keys(external_constants_js_namespaceObject.apiMetadata);
|
|
35
35
|
if (!(null == actionSpace ? void 0 : actionSpace.length)) return metadataMethods;
|
|
36
36
|
const availableMethods = actionSpace.map((action)=>action.interfaceAlias || action.name);
|
|
37
|
-
const supportsAiAct = availableMethods.includes('aiAct');
|
|
38
37
|
const finalMethods = new Set();
|
|
39
38
|
metadataMethods.forEach((method)=>{
|
|
40
39
|
const methodInfo = external_constants_js_namespaceObject.apiMetadata[method];
|
|
41
|
-
if ('aiAct' === method)
|
|
42
|
-
if (supportsAiAct) finalMethods.add(method);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
40
|
+
if ('aiAct' === method) return void finalMethods.add(method);
|
|
45
41
|
if ((null == methodInfo ? void 0 : methodInfo.group) === 'extraction' || (null == methodInfo ? void 0 : methodInfo.group) === 'validation') return void finalMethods.add(method);
|
|
46
42
|
if (availableMethods.includes(method)) finalMethods.add(method);
|
|
47
43
|
});
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Default icon
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* "no icon for this kind"; callers should render the status glyph only.
|
|
7
|
-
*
|
|
8
|
-
* Hosts can override this entirely via
|
|
9
|
-
* `ExecutionFlowConfig.resolveActionIcon`.
|
|
3
|
+
* Default icon for a completed `InfoListItem.actionKind`. All action types
|
|
4
|
+
* resolve to the same green checkmark glyph; callers can opt out by passing
|
|
5
|
+
* an override via `ExecutionFlowConfig.resolveActionIcon`.
|
|
10
6
|
*/
|
|
11
|
-
export declare function defaultProgressActionIcon(
|
|
7
|
+
export declare function defaultProgressActionIcon(_kind: string): ReactNode | null;
|
|
12
8
|
/**
|
|
13
9
|
* Resolve the icon for a progress action, applying the host's override
|
|
14
10
|
* (if any) before falling back to the default mapping.
|
|
@@ -10,10 +10,9 @@ export interface InlineStructuredFieldConfig {
|
|
|
10
10
|
* Inclusion rules:
|
|
11
11
|
* - If `actionSpace` is empty/undefined, fall back to the full metadata set
|
|
12
12
|
* so dry-mode / offline renderers still show something to pick from.
|
|
13
|
-
* - `aiAct` is included
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* devices that truly cannot run `aiAct` should not see a broken entry.
|
|
13
|
+
* - `aiAct` is always included. It is an Agent-level API and is executed via
|
|
14
|
+
* Playground's fallback path, so it does not need to appear in the device
|
|
15
|
+
* interface's low-level `actionSpace`.
|
|
17
16
|
* - `extraction` and `validation` APIs are kept even when not in the device's
|
|
18
17
|
* `actionSpace`: they are executed against the captured UI context rather
|
|
19
18
|
* than being dispatched to the device, so they apply universally.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.7.10
|
|
3
|
+
"version": "1.7.10",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"antd": "^5.21.6",
|
|
66
66
|
"buffer": "6.0.3",
|
|
67
67
|
"dayjs": "^1.11.11",
|
|
68
|
-
"@midscene/
|
|
69
|
-
"@midscene/
|
|
70
|
-
"@midscene/web": "1.7.10
|
|
71
|
-
"@midscene/
|
|
68
|
+
"@midscene/core": "1.7.10",
|
|
69
|
+
"@midscene/playground": "1.7.10",
|
|
70
|
+
"@midscene/web": "1.7.10",
|
|
71
|
+
"@midscene/shared": "1.7.10"
|
|
72
72
|
},
|
|
73
73
|
"license": "MIT",
|
|
74
74
|
"scripts": {
|