@midscene/visualizer 1.0.1-beta-20251209024153.0 → 1.0.1-beta-20251211095502.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/component/player/index.mjs +2 -2
- package/dist/es/component/playground/index.css +0 -9
- package/dist/es/component/playground-result/index.css +0 -9
- package/dist/es/component/playground-result/index.mjs +12 -5
- package/dist/es/component/shiny-text/index.css +20 -3
- package/dist/es/component/shiny-text/index.mjs +3 -2
- package/dist/es/component/universal-playground/index.css +0 -1
- package/dist/es/component/universal-playground/index.mjs +46 -59
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +13 -18
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +2 -2
- package/dist/es/hooks/usePlaygroundExecution.mjs +108 -34
- package/dist/es/index.mjs +2 -2
- package/dist/es/store/store.mjs +23 -2
- package/dist/lib/component/player/index.js +1 -1
- package/dist/lib/component/playground/index.css +0 -9
- package/dist/lib/component/playground-result/index.css +0 -9
- package/dist/lib/component/playground-result/index.js +12 -5
- package/dist/lib/component/shiny-text/index.css +20 -3
- package/dist/lib/component/shiny-text/index.js +3 -2
- package/dist/lib/component/universal-playground/index.css +0 -1
- package/dist/lib/component/universal-playground/index.js +46 -58
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +13 -18
- package/dist/lib/component/universal-playground/providers/storage-provider.js +2 -2
- package/dist/lib/hooks/usePlaygroundExecution.js +108 -34
- package/dist/lib/index.js +3 -0
- package/dist/lib/store/store.js +26 -5
- package/dist/types/hooks/usePlaygroundExecution.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/store.d.ts +5 -1
- package/dist/types/types.d.ts +8 -2
- package/package.json +5 -5
|
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
usePlaygroundExecution: ()=>usePlaygroundExecution
|
|
28
28
|
});
|
|
29
|
+
const agent_namespaceObject = require("@midscene/core/agent");
|
|
29
30
|
const external_react_namespaceObject = require("react");
|
|
30
31
|
const store_js_namespaceObject = require("../store/store.js");
|
|
31
32
|
const playground_namespaceObject = require("@midscene/playground");
|
|
@@ -99,8 +100,34 @@ function _object_spread_props(target, source) {
|
|
|
99
100
|
});
|
|
100
101
|
return target;
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
103
|
+
function buildProgressContent(task) {
|
|
104
|
+
const action = (0, agent_namespaceObject.typeStr)(task);
|
|
105
|
+
const description = (0, agent_namespaceObject.paramStr)(task);
|
|
106
|
+
return description ? `${action} - ${description}` : action;
|
|
107
|
+
}
|
|
108
|
+
function wrapExecutionDumpForReplay(dump) {
|
|
109
|
+
const modelBriefsSet = new Set();
|
|
110
|
+
if ((null == dump ? void 0 : dump.tasks) && Array.isArray(dump.tasks)) dump.tasks.forEach((task)=>{
|
|
111
|
+
if (task.usage) {
|
|
112
|
+
const { model_name, model_description, intent } = task.usage;
|
|
113
|
+
if (intent && model_name) modelBriefsSet.add(model_description ? `${intent}/${model_name}(${model_description})` : `${intent}/${model_name}`);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
else console.warn('[wrapExecutionDumpForReplay] Invalid dump structure:', dump);
|
|
117
|
+
const modelBriefs = [
|
|
118
|
+
...modelBriefsSet
|
|
119
|
+
];
|
|
120
|
+
return {
|
|
121
|
+
sdkVersion: '',
|
|
122
|
+
groupName: 'Playground Execution',
|
|
123
|
+
modelBriefs,
|
|
124
|
+
executions: [
|
|
125
|
+
dump
|
|
126
|
+
]
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, setLoading, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef) {
|
|
130
|
+
const { deepThink, screenshotIncluded, domIncluded } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
104
131
|
const handleRun = (0, external_react_namespaceObject.useCallback)((value)=>_async_to_generator(function*() {
|
|
105
132
|
if (!playgroundSDK) return void console.warn('PlaygroundSDK is not available');
|
|
106
133
|
const thisRunningId = Date.now();
|
|
@@ -133,36 +160,38 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
133
160
|
try {
|
|
134
161
|
currentRunningIdRef.current = thisRunningId;
|
|
135
162
|
interruptedFlagRef.current[thisRunningId] = false;
|
|
136
|
-
if (playgroundSDK.
|
|
137
|
-
|
|
138
|
-
if (interruptedFlagRef.current[thisRunningId]) return;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
id: `progress-${thisRunningId}-${Date.now()}`,
|
|
163
|
+
if (playgroundSDK.onDumpUpdate) playgroundSDK.onDumpUpdate((_, executionDump)=>{
|
|
164
|
+
var _executionDump_tasks;
|
|
165
|
+
if (interruptedFlagRef.current[thisRunningId] || !(null == executionDump ? void 0 : null == (_executionDump_tasks = executionDump.tasks) ? void 0 : _executionDump_tasks.length)) return;
|
|
166
|
+
const progressItems = executionDump.tasks.map((task, index)=>{
|
|
167
|
+
var _task_timing;
|
|
168
|
+
return {
|
|
169
|
+
id: `progress-${thisRunningId}-task-${index}`,
|
|
144
170
|
type: 'progress',
|
|
145
|
-
content:
|
|
146
|
-
timestamp: new Date()
|
|
171
|
+
content: buildProgressContent(task),
|
|
172
|
+
timestamp: new Date((null == (_task_timing = task.timing) ? void 0 : _task_timing.start) || Date.now()),
|
|
173
|
+
result: task.error ? {
|
|
174
|
+
error: String(task.error),
|
|
175
|
+
result: null
|
|
176
|
+
} : void 0
|
|
147
177
|
};
|
|
178
|
+
});
|
|
179
|
+
setInfoList((prev)=>{
|
|
180
|
+
const systemItemIndex = prev.findIndex((item)=>item.id === `system-${thisRunningId}`);
|
|
181
|
+
if (-1 === systemItemIndex) return prev;
|
|
182
|
+
const listWithoutCurrentProgress = prev.filter((item)=>!('progress' === item.type && item.id.startsWith(`progress-${thisRunningId}-`)));
|
|
148
183
|
return [
|
|
149
|
-
...
|
|
150
|
-
|
|
184
|
+
...listWithoutCurrentProgress.slice(0, systemItemIndex + 1),
|
|
185
|
+
...progressItems,
|
|
186
|
+
...listWithoutCurrentProgress.slice(systemItemIndex + 1)
|
|
151
187
|
];
|
|
152
188
|
});
|
|
153
189
|
});
|
|
154
|
-
const deviceOptionsToSend = {
|
|
155
|
-
imeStrategy,
|
|
156
|
-
autoDismissKeyboard,
|
|
157
|
-
keyboardDismissStrategy,
|
|
158
|
-
alwaysRefreshScreenInfo
|
|
159
|
-
};
|
|
160
190
|
result.result = yield playgroundSDK.executeAction(actionType, value, {
|
|
161
191
|
requestId: thisRunningId.toString(),
|
|
162
192
|
deepThink,
|
|
163
193
|
screenshotIncluded,
|
|
164
|
-
domIncluded
|
|
165
|
-
deviceOptions: deviceOptionsToSend
|
|
194
|
+
domIncluded
|
|
166
195
|
});
|
|
167
196
|
if ('object' == typeof result.result && null !== result.result) {
|
|
168
197
|
const resultObj = result.result;
|
|
@@ -174,6 +203,10 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
174
203
|
} catch (e) {
|
|
175
204
|
result.error = (null == e ? void 0 : e.message) || String(e);
|
|
176
205
|
console.error('Playground execution error:', e);
|
|
206
|
+
if ('object' == typeof e && null !== e) {
|
|
207
|
+
if (e.dump) result.dump = e.dump;
|
|
208
|
+
if (e.reportHTML) result.reportHTML = e.reportHTML;
|
|
209
|
+
}
|
|
177
210
|
}
|
|
178
211
|
if (interruptedFlagRef.current[thisRunningId]) return;
|
|
179
212
|
setLoading(false);
|
|
@@ -181,10 +214,13 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
181
214
|
let replayInfo = null;
|
|
182
215
|
let counter = replayCounter;
|
|
183
216
|
if ((null == result ? void 0 : result.dump) && !playground_namespaceObject.noReplayAPIs.includes(actionType)) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
if (result.dump.tasks && Array.isArray(result.dump.tasks)) {
|
|
218
|
+
const groupedDump = wrapExecutionDumpForReplay(result.dump);
|
|
219
|
+
const info = (0, replay_scripts_js_namespaceObject.allScriptsFromDump)(groupedDump);
|
|
220
|
+
setReplayCounter((c)=>c + 1);
|
|
221
|
+
replayInfo = info;
|
|
222
|
+
counter = replayCounter + 1;
|
|
223
|
+
}
|
|
188
224
|
}
|
|
189
225
|
setInfoList((prev)=>prev.map((item)=>item.id === `system-${thisRunningId}` ? _object_spread_props(_object_spread({}, item), {
|
|
190
226
|
content: '',
|
|
@@ -235,24 +271,60 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
235
271
|
interruptedFlagRef,
|
|
236
272
|
deepThink,
|
|
237
273
|
screenshotIncluded,
|
|
238
|
-
domIncluded
|
|
239
|
-
imeStrategy,
|
|
240
|
-
autoDismissKeyboard,
|
|
241
|
-
keyboardDismissStrategy,
|
|
242
|
-
alwaysRefreshScreenInfo
|
|
274
|
+
domIncluded
|
|
243
275
|
]);
|
|
244
276
|
const handleStop = (0, external_react_namespaceObject.useCallback)(()=>_async_to_generator(function*() {
|
|
245
277
|
const thisRunningId = currentRunningIdRef.current;
|
|
246
278
|
if (thisRunningId && playgroundSDK && playgroundSDK.cancelExecution) try {
|
|
279
|
+
let executionData = null;
|
|
280
|
+
if (playgroundSDK.getCurrentExecutionData) try {
|
|
281
|
+
executionData = yield playgroundSDK.getCurrentExecutionData();
|
|
282
|
+
} catch (error) {
|
|
283
|
+
console.error('Failed to get execution data before stop:', error);
|
|
284
|
+
}
|
|
247
285
|
yield playgroundSDK.cancelExecution(thisRunningId.toString());
|
|
248
286
|
interruptedFlagRef.current[thisRunningId] = true;
|
|
249
287
|
setLoading(false);
|
|
250
288
|
if (playgroundSDK.onProgressUpdate) playgroundSDK.onProgressUpdate(()=>{});
|
|
251
|
-
|
|
252
|
-
|
|
289
|
+
if (playgroundSDK.onDumpUpdate) playgroundSDK.onDumpUpdate(()=>{});
|
|
290
|
+
setInfoList((prev)=>prev.map((item)=>item.id === `system-${thisRunningId}` ? _object_spread_props(_object_spread({}, item), {
|
|
291
|
+
content: '',
|
|
253
292
|
loading: false,
|
|
254
293
|
loadingProgressText: ''
|
|
255
294
|
}) : item));
|
|
295
|
+
if (executionData && (executionData.dump || executionData.reportHTML)) {
|
|
296
|
+
const resultItem = {
|
|
297
|
+
id: `stop-result-${thisRunningId}`,
|
|
298
|
+
type: 'result',
|
|
299
|
+
content: 'Execution stopped by user',
|
|
300
|
+
timestamp: new Date(),
|
|
301
|
+
result: {
|
|
302
|
+
result: null,
|
|
303
|
+
dump: executionData.dump,
|
|
304
|
+
reportHTML: executionData.reportHTML,
|
|
305
|
+
error: null
|
|
306
|
+
},
|
|
307
|
+
loading: false,
|
|
308
|
+
verticalMode,
|
|
309
|
+
replayCounter
|
|
310
|
+
};
|
|
311
|
+
setInfoList((prev)=>[
|
|
312
|
+
...prev,
|
|
313
|
+
resultItem
|
|
314
|
+
]);
|
|
315
|
+
} else {
|
|
316
|
+
const stopItem = {
|
|
317
|
+
id: `stop-${thisRunningId}`,
|
|
318
|
+
type: 'system',
|
|
319
|
+
content: 'Operation stopped',
|
|
320
|
+
timestamp: new Date(),
|
|
321
|
+
loading: false
|
|
322
|
+
};
|
|
323
|
+
setInfoList((prev)=>[
|
|
324
|
+
...prev,
|
|
325
|
+
stopItem
|
|
326
|
+
]);
|
|
327
|
+
}
|
|
256
328
|
const separatorItem = {
|
|
257
329
|
id: `separator-${thisRunningId}`,
|
|
258
330
|
type: 'separator',
|
|
@@ -271,7 +343,9 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
271
343
|
currentRunningIdRef,
|
|
272
344
|
interruptedFlagRef,
|
|
273
345
|
setLoading,
|
|
274
|
-
setInfoList
|
|
346
|
+
setInfoList,
|
|
347
|
+
verticalMode,
|
|
348
|
+
replayCounter
|
|
275
349
|
]);
|
|
276
350
|
const canStop = loading && !!currentRunningIdRef.current && !!playgroundSDK && !!playgroundSDK.cancelExecution;
|
|
277
351
|
return {
|
package/dist/lib/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
47
47
|
PlaygroundResultView: ()=>playground_result_index_js_namespaceObject.PlaygroundResultView,
|
|
48
48
|
safeOverrideAIConfig: ()=>useSafeOverrideAIConfig_js_namespaceObject.safeOverrideAIConfig,
|
|
49
49
|
highlightColorForType: ()=>color_js_namespaceObject.highlightColorForType,
|
|
50
|
+
useGlobalPreference: ()=>store_js_namespaceObject.useGlobalPreference,
|
|
50
51
|
AgentContextProvider: ()=>context_provider_js_namespaceObject.AgentContextProvider,
|
|
51
52
|
UniversalPlaygroundDefault: ()=>universal_playground_index_js_default(),
|
|
52
53
|
actionNameForType: ()=>playground_utils_js_namespaceObject.actionNameForType,
|
|
@@ -142,6 +143,7 @@ exports.staticAgentFromContext = __webpack_exports__.staticAgentFromContext;
|
|
|
142
143
|
exports.timeCostStrElement = __webpack_exports__.timeCostStrElement;
|
|
143
144
|
exports.timeStr = __webpack_exports__.timeStr;
|
|
144
145
|
exports.useEnvConfig = __webpack_exports__.useEnvConfig;
|
|
146
|
+
exports.useGlobalPreference = __webpack_exports__.useGlobalPreference;
|
|
145
147
|
exports.useSafeOverrideAIConfig = __webpack_exports__.useSafeOverrideAIConfig;
|
|
146
148
|
exports.useServerValid = __webpack_exports__.useServerValid;
|
|
147
149
|
exports.useTheme = __webpack_exports__.useTheme;
|
|
@@ -185,6 +187,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
185
187
|
"timeCostStrElement",
|
|
186
188
|
"timeStr",
|
|
187
189
|
"useEnvConfig",
|
|
190
|
+
"useGlobalPreference",
|
|
188
191
|
"useSafeOverrideAIConfig",
|
|
189
192
|
"useServerValid",
|
|
190
193
|
"useTheme"
|
package/dist/lib/store/store.js
CHANGED
|
@@ -25,13 +25,15 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
useEnvConfig: ()=>useEnvConfig,
|
|
28
|
-
|
|
28
|
+
useGlobalPreference: ()=>useGlobalPreference
|
|
29
29
|
});
|
|
30
30
|
const external_zustand_namespaceObject = require("zustand");
|
|
31
31
|
const { create } = external_zustand_namespaceObject;
|
|
32
32
|
const AUTO_ZOOM_KEY = 'midscene-auto-zoom';
|
|
33
33
|
const BACKGROUND_VISIBLE_KEY = 'midscene-background-visible';
|
|
34
34
|
const ELEMENTS_VISIBLE_KEY = 'midscene-elements-visible';
|
|
35
|
+
const MODEL_CALL_DETAILS_KEY = 'midscene-model-call-details';
|
|
36
|
+
const DARK_MODE_KEY = 'midscene-dark-mode';
|
|
35
37
|
const parseBooleanParam = (value)=>{
|
|
36
38
|
if (null === value) return;
|
|
37
39
|
const normalized = value.trim().toLowerCase();
|
|
@@ -53,16 +55,23 @@ const getQueryPreference = (paramName)=>{
|
|
|
53
55
|
const searchParams = new URLSearchParams(window.location.search);
|
|
54
56
|
return parseBooleanParam(searchParams.get(paramName));
|
|
55
57
|
};
|
|
56
|
-
const
|
|
58
|
+
const useGlobalPreference = create((set)=>{
|
|
57
59
|
const savedAutoZoom = 'false' !== localStorage.getItem(AUTO_ZOOM_KEY);
|
|
58
60
|
const savedBackgroundVisible = 'false' !== localStorage.getItem(BACKGROUND_VISIBLE_KEY);
|
|
59
61
|
const savedElementsVisible = 'false' !== localStorage.getItem(ELEMENTS_VISIBLE_KEY);
|
|
62
|
+
const savedModelCallDetails = 'true' === localStorage.getItem(MODEL_CALL_DETAILS_KEY);
|
|
63
|
+
const savedDarkMode = 'true' === localStorage.getItem(DARK_MODE_KEY);
|
|
60
64
|
const autoZoomFromQuery = getQueryPreference('focusOnCursor');
|
|
61
65
|
const elementsVisibleFromQuery = getQueryPreference('showElementMarkers');
|
|
66
|
+
const darkModeFromQuery = getQueryPreference('darkMode');
|
|
67
|
+
const initialDarkMode = void 0 === darkModeFromQuery ? savedDarkMode : darkModeFromQuery;
|
|
68
|
+
if (void 0 !== darkModeFromQuery) localStorage.setItem(DARK_MODE_KEY, initialDarkMode.toString());
|
|
62
69
|
return {
|
|
63
70
|
backgroundVisible: savedBackgroundVisible,
|
|
64
71
|
elementsVisible: void 0 === elementsVisibleFromQuery ? savedElementsVisible : elementsVisibleFromQuery,
|
|
65
72
|
autoZoom: void 0 === autoZoomFromQuery ? savedAutoZoom : autoZoomFromQuery,
|
|
73
|
+
modelCallDetailsEnabled: savedModelCallDetails,
|
|
74
|
+
darkModeEnabled: initialDarkMode,
|
|
66
75
|
setBackgroundVisible: (visible)=>{
|
|
67
76
|
set({
|
|
68
77
|
backgroundVisible: visible
|
|
@@ -80,6 +89,18 @@ const useBlackboardPreference = create((set)=>{
|
|
|
80
89
|
autoZoom: enabled
|
|
81
90
|
});
|
|
82
91
|
localStorage.setItem(AUTO_ZOOM_KEY, enabled.toString());
|
|
92
|
+
},
|
|
93
|
+
setModelCallDetailsEnabled: (enabled)=>{
|
|
94
|
+
set({
|
|
95
|
+
modelCallDetailsEnabled: enabled
|
|
96
|
+
});
|
|
97
|
+
localStorage.setItem(MODEL_CALL_DETAILS_KEY, enabled.toString());
|
|
98
|
+
},
|
|
99
|
+
setDarkModeEnabled: (enabled)=>{
|
|
100
|
+
set({
|
|
101
|
+
darkModeEnabled: enabled
|
|
102
|
+
});
|
|
103
|
+
localStorage.setItem(DARK_MODE_KEY, enabled.toString());
|
|
83
104
|
}
|
|
84
105
|
};
|
|
85
106
|
});
|
|
@@ -221,11 +242,11 @@ const useEnvConfig = create((set, get)=>{
|
|
|
221
242
|
}
|
|
222
243
|
};
|
|
223
244
|
});
|
|
224
|
-
exports.useBlackboardPreference = __webpack_exports__.useBlackboardPreference;
|
|
225
245
|
exports.useEnvConfig = __webpack_exports__.useEnvConfig;
|
|
246
|
+
exports.useGlobalPreference = __webpack_exports__.useGlobalPreference;
|
|
226
247
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
227
|
-
"
|
|
228
|
-
"
|
|
248
|
+
"useEnvConfig",
|
|
249
|
+
"useGlobalPreference"
|
|
229
250
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
230
251
|
Object.defineProperty(exports, '__esModule', {
|
|
231
252
|
value: true
|
|
@@ -3,7 +3,7 @@ import type { FormValue, InfoListItem, PlaygroundSDKLike, StorageProvider } from
|
|
|
3
3
|
/**
|
|
4
4
|
* Hook for handling playground execution logic
|
|
5
5
|
*/
|
|
6
|
-
export declare function usePlaygroundExecution(playgroundSDK: PlaygroundSDKLike | null, storage: StorageProvider | undefined | null, actionSpace: DeviceAction<unknown>[], loading: boolean, setLoading: (loading: boolean) => void,
|
|
6
|
+
export declare function usePlaygroundExecution(playgroundSDK: PlaygroundSDKLike | null, storage: StorageProvider | undefined | null, actionSpace: DeviceAction<unknown>[], loading: boolean, setLoading: (loading: boolean) => void, setInfoList: React.Dispatch<React.SetStateAction<InfoListItem[]>>, replayCounter: number, setReplayCounter: React.Dispatch<React.SetStateAction<number>>, verticalMode: boolean, currentRunningIdRef: React.MutableRefObject<number | null>, interruptedFlagRef: React.MutableRefObject<Record<number, boolean>>): {
|
|
7
7
|
handleRun: (value: FormValue) => Promise<void>;
|
|
8
8
|
handleStop: () => Promise<void>;
|
|
9
9
|
canStop: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type AnimationScript, type ReplayScriptsInfo, allScriptsFromDump, generateAnimationScripts, } from './utils/replay-scripts';
|
|
2
|
-
export { useEnvConfig } from './store/store';
|
|
2
|
+
export { useEnvConfig, useGlobalPreference } from './store/store';
|
|
3
3
|
export { colorForName, highlightColorForType, globalThemeConfig, } from './utils/color';
|
|
4
4
|
export { EnvConfig } from './component/env-config';
|
|
5
5
|
export { EnvConfigReminder } from './component/env-config-reminder';
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as Z from 'zustand';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useGlobalPreference: Z.UseBoundStore<Z.StoreApi<{
|
|
3
3
|
backgroundVisible: boolean;
|
|
4
4
|
elementsVisible: boolean;
|
|
5
5
|
autoZoom: boolean;
|
|
6
|
+
modelCallDetailsEnabled: boolean;
|
|
7
|
+
darkModeEnabled: boolean;
|
|
6
8
|
setBackgroundVisible: (visible: boolean) => void;
|
|
7
9
|
setElementsVisible: (visible: boolean) => void;
|
|
8
10
|
setAutoZoom: (enabled: boolean) => void;
|
|
11
|
+
setModelCallDetailsEnabled: (enabled: boolean) => void;
|
|
12
|
+
setDarkModeEnabled: (enabled: boolean) => void;
|
|
9
13
|
}>>;
|
|
10
14
|
/**
|
|
11
15
|
* Service Mode
|
package/dist/types/types.d.ts
CHANGED
|
@@ -71,11 +71,11 @@ export declare const unwrapZodType: (field: ZodType) => {
|
|
|
71
71
|
hasDefault: boolean;
|
|
72
72
|
};
|
|
73
73
|
export declare const extractDefaultValue: (field: ZodType) => unknown;
|
|
74
|
-
import type {
|
|
74
|
+
import type { ExecutionDump, WebUIContext } from '@midscene/core';
|
|
75
75
|
import type { ExecutionOptions, PlaygroundAgent } from '@midscene/playground';
|
|
76
76
|
export interface PlaygroundResult {
|
|
77
77
|
result: any;
|
|
78
|
-
dump?:
|
|
78
|
+
dump?: ExecutionDump | null;
|
|
79
79
|
reportHTML?: string | null;
|
|
80
80
|
error: string | null;
|
|
81
81
|
}
|
|
@@ -109,9 +109,15 @@ export interface PlaygroundSDKLike {
|
|
|
109
109
|
executeAction(actionType: string, value: FormValue, options: ExecutionOptions): Promise<unknown>;
|
|
110
110
|
getActionSpace(context?: any): Promise<DeviceAction<unknown>[]>;
|
|
111
111
|
onProgressUpdate?: (callback: ProgressCallback) => void;
|
|
112
|
+
onDumpUpdate?: (callback: (dump: string, executionDump?: ExecutionDump) => void) => void;
|
|
112
113
|
cancelExecution?(requestId: string): Promise<void>;
|
|
114
|
+
getCurrentExecutionData?(): Promise<{
|
|
115
|
+
dump: ExecutionDump | null;
|
|
116
|
+
reportHTML: string | null;
|
|
117
|
+
}>;
|
|
113
118
|
overrideConfig?(config: any): Promise<void>;
|
|
114
119
|
checkStatus?(): Promise<boolean>;
|
|
120
|
+
getServiceMode?(): 'In-Browser-Extension' | 'Server';
|
|
115
121
|
id?: string;
|
|
116
122
|
}
|
|
117
123
|
export interface StorageProvider {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.0.1-beta-
|
|
3
|
+
"version": "1.0.1-beta-20251211095502.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",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"antd": "^5.21.6",
|
|
61
61
|
"buffer": "6.0.3",
|
|
62
62
|
"dayjs": "^1.11.11",
|
|
63
|
-
"@midscene/core": "1.0.1-beta-
|
|
64
|
-
"@midscene/
|
|
65
|
-
"@midscene/web": "1.0.1-beta-
|
|
66
|
-
"@midscene/
|
|
63
|
+
"@midscene/core": "1.0.1-beta-20251211095502.0",
|
|
64
|
+
"@midscene/playground": "1.0.1-beta-20251211095502.0",
|
|
65
|
+
"@midscene/web": "1.0.1-beta-20251211095502.0",
|
|
66
|
+
"@midscene/shared": "1.0.1-beta-20251211095502.0"
|
|
67
67
|
},
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"scripts": {
|