@midscene/visualizer 0.28.2-beta-20250909133629.0 → 0.28.2-beta-20250910021445.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/{blackboard/index.mjs → blackboard.mjs} +3 -3
- package/dist/es/component/describer.css +25 -0
- package/dist/es/component/{env-config/index.mjs → env-config.mjs} +1 -1
- package/dist/es/component/{github-star/index.mjs → github-star.mjs} +1 -1
- package/dist/es/component/{logo/index.mjs → logo.mjs} +1 -1
- package/dist/es/component/{misc/index.mjs → misc.mjs} +2 -42
- package/dist/es/component/{player/index.mjs → player.mjs} +8 -8
- package/dist/es/component/{config-selector/index.mjs → playground/ConfigSelector.mjs} +3 -2
- package/dist/es/component/{context-preview/index.mjs → playground/ContextPreview.mjs} +4 -3
- package/dist/es/component/{history-selector/index.mjs → playground/HistorySelector.mjs} +1 -1
- package/dist/es/component/{playground-result/index.mjs → playground/PlaygroundResult.mjs} +4 -3
- package/dist/es/component/{prompt-input/index.mjs → playground/PromptInput.mjs} +9 -9
- package/dist/es/component/{service-mode-control/index.mjs → playground/ServiceModeControl.mjs} +5 -4
- package/dist/es/component/playground/index.css +161 -29
- package/dist/es/{utils/constants.mjs → component/playground/playground-constants.mjs} +2 -1
- package/dist/es/component/playground/playground-types.mjs +0 -0
- package/dist/es/{utils → component/playground}/playground-utils.mjs +1 -1
- package/dist/es/{types.mjs → component/playground/types.mjs} +1 -23
- package/dist/es/{utils → component}/replay-scripts.mjs +2 -1
- package/dist/es/component/{shiny-text/index.mjs → shiny-text.mjs} +1 -1
- package/dist/es/index.mjs +18 -22
- package/dist/es/init.mjs +10 -0
- package/dist/lib/component/{blackboard/index.js → blackboard.js} +5 -5
- package/dist/lib/component/describer.css +25 -0
- package/dist/lib/component/{env-config/index.js → env-config.js} +1 -1
- package/dist/lib/component/{github-star/index.js → github-star.js} +1 -1
- package/dist/lib/component/{logo/index.js → logo.js} +1 -1
- package/dist/lib/component/{misc/index.js → misc.js} +1 -60
- package/dist/lib/component/{player/index.js → player.js} +23 -23
- package/dist/lib/component/{config-selector/index.js → playground/ConfigSelector.js} +7 -6
- package/dist/lib/component/{context-preview/index.js → playground/ContextPreview.js} +9 -8
- package/dist/lib/component/{history-selector/index.js → playground/HistorySelector.js} +1 -1
- package/dist/lib/component/{playground-result/index.js → playground/PlaygroundResult.js} +9 -8
- package/dist/lib/component/{prompt-input/index.js → playground/PromptInput.js} +37 -37
- package/dist/lib/component/{service-mode-control/index.js → playground/ServiceModeControl.js} +9 -8
- package/dist/lib/component/playground/index.css +161 -29
- package/dist/lib/{utils/constants.js → component/playground/playground-constants.js} +4 -3
- package/dist/lib/component/playground/playground-types.js +18 -0
- package/dist/lib/{utils → component/playground}/playground-utils.js +1 -1
- package/dist/lib/{types.js → component/playground/types.js} +0 -28
- package/dist/lib/{utils → component}/replay-scripts.js +4 -3
- package/dist/lib/component/{shiny-text/index.js → shiny-text.js} +1 -1
- package/dist/lib/index.js +34 -66
- package/dist/lib/{icons/avatar.js → init.js} +12 -16
- package/dist/types/component/{blackboard/index.d.ts → blackboard.d.ts} +2 -2
- package/dist/types/component/{github-star/index.d.ts → github-star.d.ts} +1 -1
- package/dist/types/component/{logo/index.d.ts → logo.d.ts} +1 -1
- package/dist/types/component/misc.d.ts +2 -0
- package/dist/types/component/{player/index.d.ts → player.d.ts} +2 -2
- package/dist/types/component/{config-selector/index.d.ts → playground/ConfigSelector.d.ts} +1 -0
- package/dist/types/component/{context-preview/index.d.ts → playground/ContextPreview.d.ts} +1 -0
- package/dist/types/component/{history-selector/index.d.ts → playground/HistorySelector.d.ts} +1 -1
- package/dist/types/component/{playground-result/index.d.ts → playground/PlaygroundResult.d.ts} +4 -3
- package/dist/types/component/{prompt-input/index.d.ts → playground/PromptInput.d.ts} +2 -3
- package/dist/types/component/{service-mode-control/index.d.ts → playground/ServiceModeControl.d.ts} +1 -0
- package/dist/types/{utils/constants.d.ts → component/playground/playground-constants.d.ts} +1 -0
- package/dist/types/component/playground/playground-types.d.ts +19 -0
- package/dist/types/component/playground/types.d.ts +72 -0
- package/dist/types/{utils → component}/replay-scripts.d.ts +1 -0
- package/dist/types/component/{shiny-text/index.d.ts → shiny-text.d.ts} +1 -1
- package/dist/types/index.d.ts +10 -15
- package/dist/types/init.d.ts +1 -0
- package/package.json +5 -10
- package/dist/es/browser.mjs +0 -18
- package/dist/es/component/history-selector/index.css +0 -132
- package/dist/es/component/index.mjs +0 -1
- package/dist/es/component/playground/index.mjs +0 -8
- package/dist/es/component/playground-result/index.css +0 -29
- package/dist/es/component/prompt-input/index.css +0 -330
- package/dist/es/component/universal-playground/index.css +0 -341
- package/dist/es/component/universal-playground/index.mjs +0 -273
- package/dist/es/component/universal-playground/providers/context-provider.mjs +0 -52
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +0 -107
- package/dist/es/hooks/usePlaygroundExecution.mjs +0 -170
- package/dist/es/hooks/usePlaygroundState.mjs +0 -173
- package/dist/es/icons/avatar.mjs +0 -14
- package/dist/lib/browser.js +0 -132
- package/dist/lib/component/history-selector/index.css +0 -132
- package/dist/lib/component/index.js +0 -60
- package/dist/lib/component/playground/index.js +0 -113
- package/dist/lib/component/playground-result/index.css +0 -29
- package/dist/lib/component/prompt-input/index.css +0 -330
- package/dist/lib/component/universal-playground/index.css +0 -341
- package/dist/lib/component/universal-playground/index.js +0 -321
- package/dist/lib/component/universal-playground/providers/context-provider.js +0 -95
- package/dist/lib/component/universal-playground/providers/storage-provider.js +0 -147
- package/dist/lib/hooks/usePlaygroundExecution.js +0 -204
- package/dist/lib/hooks/usePlaygroundState.js +0 -207
- package/dist/types/browser.d.ts +0 -19
- package/dist/types/component/index.d.ts +0 -1
- package/dist/types/component/misc/index.d.ts +0 -6
- package/dist/types/component/playground/index.d.ts +0 -7
- package/dist/types/component/universal-playground/index.d.ts +0 -4
- package/dist/types/component/universal-playground/providers/context-provider.d.ts +0 -37
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +0 -33
- package/dist/types/hooks/usePlaygroundExecution.d.ts +0 -10
- package/dist/types/hooks/usePlaygroundState.d.ts +0 -26
- package/dist/types/types.d.ts +0 -166
- /package/dist/es/component/{blackboard/index.css → blackboard.css} +0 -0
- /package/dist/es/{utils → component}/color.mjs +0 -0
- /package/dist/es/component/{github-star/index.css → github-star.css} +0 -0
- /package/dist/es/component/{logo/index.css → logo.css} +0 -0
- /package/dist/es/{utils → component}/pixi-loader.mjs +0 -0
- /package/dist/es/component/{player/index.css → player.css} +0 -0
- /package/dist/es/component/{form-field/index.mjs → playground/FormField.mjs} +0 -0
- /package/dist/es/{hooks → component/playground}/useServerValid.mjs +0 -0
- /package/dist/es/component/{playground/playground-demo-ui-context.json → playground-demo-ui-context.json} +0 -0
- /package/dist/es/component/{shiny-text/index.css → shiny-text.css} +0 -0
- /package/dist/es/{store → component/store}/history.mjs +0 -0
- /package/dist/es/{store → component/store}/store.mjs +0 -0
- /package/dist/es/{utils/index.mjs → utils.mjs} +0 -0
- /package/dist/lib/component/{blackboard/index.css → blackboard.css} +0 -0
- /package/dist/lib/{utils → component}/color.js +0 -0
- /package/dist/lib/component/{github-star/index.css → github-star.css} +0 -0
- /package/dist/lib/component/{logo/index.css → logo.css} +0 -0
- /package/dist/lib/{utils → component}/pixi-loader.js +0 -0
- /package/dist/lib/component/{player/index.css → player.css} +0 -0
- /package/dist/lib/component/{form-field/index.js → playground/FormField.js} +0 -0
- /package/dist/lib/{hooks → component/playground}/useServerValid.js +0 -0
- /package/dist/lib/component/{playground/playground-demo-ui-context.json → playground-demo-ui-context.json} +0 -0
- /package/dist/lib/component/{shiny-text/index.css → shiny-text.css} +0 -0
- /package/dist/lib/{store → component/store}/history.js +0 -0
- /package/dist/lib/{store → component/store}/store.js +0 -0
- /package/dist/lib/{utils/index.js → utils.js} +0 -0
- /package/dist/types/{utils → component}/color.d.ts +0 -0
- /package/dist/types/component/{env-config/index.d.ts → env-config.d.ts} +0 -0
- /package/dist/types/{utils → component}/pixi-loader.d.ts +0 -0
- /package/dist/types/component/{form-field/index.d.ts → playground/FormField.d.ts} +0 -0
- /package/dist/types/{utils → component/playground}/playground-utils.d.ts +0 -0
- /package/dist/types/{hooks → component/playground}/useServerValid.d.ts +0 -0
- /package/dist/types/{store → component/store}/history.d.ts +0 -0
- /package/dist/types/{store → component/store}/store.d.ts +0 -0
- /package/dist/types/{utils/index.d.ts → utils.d.ts} +0 -0
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
UniversalPlayground: ()=>UniversalPlayground,
|
|
37
|
-
default: ()=>universal_playground
|
|
38
|
-
});
|
|
39
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
|
-
const icons_namespaceObject = require("@ant-design/icons");
|
|
41
|
-
var icons_default = /*#__PURE__*/ __webpack_require__.n(icons_namespaceObject);
|
|
42
|
-
const external_antd_namespaceObject = require("antd");
|
|
43
|
-
const external_react_namespaceObject = require("react");
|
|
44
|
-
const usePlaygroundExecution_js_namespaceObject = require("../../hooks/usePlaygroundExecution.js");
|
|
45
|
-
const usePlaygroundState_js_namespaceObject = require("../../hooks/usePlaygroundState.js");
|
|
46
|
-
const store_js_namespaceObject = require("../../store/store.js");
|
|
47
|
-
const index_js_namespaceObject = require("../context-preview/index.js");
|
|
48
|
-
const external_playground_result_index_js_namespaceObject = require("../playground-result/index.js");
|
|
49
|
-
require("./index.css");
|
|
50
|
-
const avatar_js_namespaceObject = require("../../icons/avatar.js");
|
|
51
|
-
var avatar_js_default = /*#__PURE__*/ __webpack_require__.n(avatar_js_namespaceObject);
|
|
52
|
-
const external_prompt_input_index_js_namespaceObject = require("../prompt-input/index.js");
|
|
53
|
-
const { Text } = external_antd_namespaceObject.Typography;
|
|
54
|
-
function ErrorMessage(param) {
|
|
55
|
-
let { error } = param;
|
|
56
|
-
if (!error) return null;
|
|
57
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Tooltip, {
|
|
58
|
-
title: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
59
|
-
style: {
|
|
60
|
-
whiteSpace: 'pre-wrap',
|
|
61
|
-
wordBreak: 'break-all'
|
|
62
|
-
},
|
|
63
|
-
children: error
|
|
64
|
-
}),
|
|
65
|
-
overlayStyle: {
|
|
66
|
-
maxWidth: '100vw'
|
|
67
|
-
},
|
|
68
|
-
children: [
|
|
69
|
-
"Error: ",
|
|
70
|
-
error.split('\n')[0]
|
|
71
|
-
]
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function UniversalPlayground(param) {
|
|
75
|
-
let { playgroundSDK, storage, contextProvider, config: componentConfig = {}, branding = {}, className = '', dryMode = false, showContextPreview = true } = param;
|
|
76
|
-
const [form] = external_antd_namespaceObject.Form.useForm();
|
|
77
|
-
const { deepThink, screenshotIncluded, domIncluded, config } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
78
|
-
const { loading, setLoading, infoList, setInfoList, actionSpace, actionSpaceLoading, uiContextPreview, setUiContextPreview, showScrollToBottomButton, verticalMode, replayCounter, setReplayCounter, infoListRef, currentRunningIdRef, interruptedFlagRef, clearInfoList, refreshContext, handleScrollToBottom } = (0, usePlaygroundState_js_namespaceObject.usePlaygroundState)(playgroundSDK, storage, contextProvider);
|
|
79
|
-
const { handleRun: executeAction, handleStop, canStop } = (0, usePlaygroundExecution_js_namespaceObject.usePlaygroundExecution)(playgroundSDK, storage, actionSpace, loading, setLoading, infoList, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef);
|
|
80
|
-
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
81
|
-
const completeConfig = {
|
|
82
|
-
...config,
|
|
83
|
-
deepThink,
|
|
84
|
-
screenshotIncluded,
|
|
85
|
-
domIncluded
|
|
86
|
-
};
|
|
87
|
-
if (playgroundSDK.overrideConfig) playgroundSDK.overrideConfig(completeConfig).catch((error)=>{
|
|
88
|
-
console.error('Failed to override SDK config:', error);
|
|
89
|
-
});
|
|
90
|
-
}, [
|
|
91
|
-
playgroundSDK,
|
|
92
|
-
config,
|
|
93
|
-
deepThink,
|
|
94
|
-
screenshotIncluded,
|
|
95
|
-
domIncluded
|
|
96
|
-
]);
|
|
97
|
-
const handleFormRun = (0, external_react_namespaceObject.useCallback)(async ()=>{
|
|
98
|
-
try {
|
|
99
|
-
const value = form.getFieldsValue();
|
|
100
|
-
await executeAction(value);
|
|
101
|
-
} catch (error) {
|
|
102
|
-
external_antd_namespaceObject.message.error((null == error ? void 0 : error.message) || 'Execution failed');
|
|
103
|
-
}
|
|
104
|
-
}, [
|
|
105
|
-
form,
|
|
106
|
-
executeAction
|
|
107
|
-
]);
|
|
108
|
-
const runButtonEnabled = !dryMode && !actionSpaceLoading;
|
|
109
|
-
const selectedType = external_antd_namespaceObject.Form.useWatch('type', form);
|
|
110
|
-
const finalShowContextPreview = showContextPreview && false !== componentConfig.showContextPreview;
|
|
111
|
-
const enablePersistence = false !== componentConfig.enablePersistence;
|
|
112
|
-
const layout = componentConfig.layout || 'vertical';
|
|
113
|
-
const showVersionInfo = false !== componentConfig.showVersionInfo;
|
|
114
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
115
|
-
className: `playground-container ${layout}-mode ${className}`.trim(),
|
|
116
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Form, {
|
|
117
|
-
form: form,
|
|
118
|
-
onFinish: handleFormRun,
|
|
119
|
-
className: "command-form",
|
|
120
|
-
children: [
|
|
121
|
-
finalShowContextPreview && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
122
|
-
className: "context-preview-section",
|
|
123
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ContextPreview, {
|
|
124
|
-
uiContextPreview: uiContextPreview,
|
|
125
|
-
setUiContextPreview: setUiContextPreview,
|
|
126
|
-
showContextPreview: finalShowContextPreview
|
|
127
|
-
})
|
|
128
|
-
}),
|
|
129
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
130
|
-
className: "middle-dialog-area",
|
|
131
|
-
children: [
|
|
132
|
-
infoList.length > 1 && enablePersistence && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
133
|
-
className: "clear-button-container",
|
|
134
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
135
|
-
size: "small",
|
|
136
|
-
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ClearOutlined, {}),
|
|
137
|
-
onClick: clearInfoList,
|
|
138
|
-
type: "text",
|
|
139
|
-
className: "clear-button"
|
|
140
|
-
})
|
|
141
|
-
}),
|
|
142
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
143
|
-
ref: infoListRef,
|
|
144
|
-
className: "info-list-container",
|
|
145
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
|
|
146
|
-
itemLayout: "vertical",
|
|
147
|
-
dataSource: infoList,
|
|
148
|
-
renderItem: (item)=>{
|
|
149
|
-
var _item_result;
|
|
150
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List.Item, {
|
|
151
|
-
className: "list-item",
|
|
152
|
-
children: 'user' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
153
|
-
className: "user-message-container",
|
|
154
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
155
|
-
className: "user-message-bubble",
|
|
156
|
-
children: item.content
|
|
157
|
-
})
|
|
158
|
-
}) : 'progress' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
159
|
-
children: (()=>{
|
|
160
|
-
var _parts_, _item_result, _item_result1, _item_result2;
|
|
161
|
-
const parts = item.content.split(' - ');
|
|
162
|
-
const action = null == (_parts_ = parts[0]) ? void 0 : _parts_.trim();
|
|
163
|
-
const description = parts.slice(1).join(' - ').trim();
|
|
164
|
-
const currentIndex = infoList.findIndex((listItem)=>listItem.id === item.id);
|
|
165
|
-
const laterProgressExists = infoList.slice(currentIndex + 1).some((listItem)=>'progress' === listItem.type);
|
|
166
|
-
const isLatestProgress = !laterProgressExists;
|
|
167
|
-
const shouldShowLoading = loading && isLatestProgress;
|
|
168
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
169
|
-
children: [
|
|
170
|
-
action && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
171
|
-
className: "progress-action-item",
|
|
172
|
-
children: [
|
|
173
|
-
action,
|
|
174
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
175
|
-
className: `progress-status-icon ${shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed'}`,
|
|
176
|
-
children: shouldShowLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LoadingOutlined, {
|
|
177
|
-
spin: true
|
|
178
|
-
}) : (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) ? "\u2717" : "\u2713"
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
}),
|
|
182
|
-
description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
183
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
184
|
-
className: "progress-description",
|
|
185
|
-
children: description
|
|
186
|
-
})
|
|
187
|
-
}),
|
|
188
|
-
(null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
|
|
189
|
-
error: item.result.error
|
|
190
|
-
})
|
|
191
|
-
]
|
|
192
|
-
});
|
|
193
|
-
})()
|
|
194
|
-
}) : 'separator' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
195
|
-
className: "new-conversation-separator",
|
|
196
|
-
children: [
|
|
197
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
198
|
-
className: "separator-line"
|
|
199
|
-
}),
|
|
200
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
201
|
-
className: "separator-text-container",
|
|
202
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
|
|
203
|
-
type: "secondary",
|
|
204
|
-
className: "separator-text",
|
|
205
|
-
children: item.content
|
|
206
|
-
})
|
|
207
|
-
})
|
|
208
|
-
]
|
|
209
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
210
|
-
className: "system-message-container",
|
|
211
|
-
children: [
|
|
212
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
213
|
-
className: "system-message-header",
|
|
214
|
-
children: [
|
|
215
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_default(), {
|
|
216
|
-
component: branding.icon || avatar_js_default(),
|
|
217
|
-
style: {
|
|
218
|
-
fontSize: 20
|
|
219
|
-
}
|
|
220
|
-
}),
|
|
221
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
222
|
-
className: "system-message-title",
|
|
223
|
-
children: branding.title || 'Playground'
|
|
224
|
-
})
|
|
225
|
-
]
|
|
226
|
-
}),
|
|
227
|
-
(item.content || item.result) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
228
|
-
className: "system-message-content",
|
|
229
|
-
children: [
|
|
230
|
-
'result' === item.type && (null == (_item_result = item.result) ? void 0 : _item_result.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
231
|
-
className: "error-message",
|
|
232
|
-
children: [
|
|
233
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
234
|
-
className: "divider"
|
|
235
|
-
}),
|
|
236
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
|
|
237
|
-
error: item.result.error
|
|
238
|
-
})
|
|
239
|
-
]
|
|
240
|
-
}),
|
|
241
|
-
'result' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_playground_result_index_js_namespaceObject.PlaygroundResultView, {
|
|
242
|
-
result: item.result || null,
|
|
243
|
-
loading: item.loading || false,
|
|
244
|
-
serverValid: true,
|
|
245
|
-
serviceMode: 'Server',
|
|
246
|
-
replayScriptsInfo: item.replayScriptsInfo || null,
|
|
247
|
-
replayCounter: item.replayCounter || 0,
|
|
248
|
-
loadingProgressText: item.loadingProgressText || '',
|
|
249
|
-
verticalMode: item.verticalMode || false,
|
|
250
|
-
fitMode: "width"
|
|
251
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
252
|
-
children: [
|
|
253
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
254
|
-
className: "system-message-text",
|
|
255
|
-
children: item.content
|
|
256
|
-
}),
|
|
257
|
-
item.loading && item.loadingProgressText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
258
|
-
className: "loading-progress-text",
|
|
259
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
260
|
-
children: item.loadingProgressText
|
|
261
|
-
})
|
|
262
|
-
})
|
|
263
|
-
]
|
|
264
|
-
})
|
|
265
|
-
]
|
|
266
|
-
})
|
|
267
|
-
]
|
|
268
|
-
})
|
|
269
|
-
}, item.id);
|
|
270
|
-
}
|
|
271
|
-
})
|
|
272
|
-
}),
|
|
273
|
-
showScrollToBottomButton && false !== componentConfig.enableScrollToBottom && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
274
|
-
className: "scroll-to-bottom-button",
|
|
275
|
-
type: "primary",
|
|
276
|
-
shape: "circle",
|
|
277
|
-
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowDownOutlined, {}),
|
|
278
|
-
onClick: handleScrollToBottom,
|
|
279
|
-
size: "large"
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
}),
|
|
283
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
284
|
-
className: "bottom-input-section",
|
|
285
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_prompt_input_index_js_namespaceObject.PromptInput, {
|
|
286
|
-
runButtonEnabled: runButtonEnabled,
|
|
287
|
-
form: form,
|
|
288
|
-
serviceMode: 'Server',
|
|
289
|
-
selectedType: selectedType,
|
|
290
|
-
dryMode: dryMode,
|
|
291
|
-
stoppable: canStop,
|
|
292
|
-
loading: loading,
|
|
293
|
-
onRun: handleFormRun,
|
|
294
|
-
onStop: handleStop,
|
|
295
|
-
actionSpace: actionSpace
|
|
296
|
-
})
|
|
297
|
-
}),
|
|
298
|
-
showVersionInfo && branding.version && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
299
|
-
className: "version-info-section",
|
|
300
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
301
|
-
className: "version-text",
|
|
302
|
-
children: [
|
|
303
|
-
"Midscene.js version: ",
|
|
304
|
-
branding.version
|
|
305
|
-
]
|
|
306
|
-
})
|
|
307
|
-
})
|
|
308
|
-
]
|
|
309
|
-
})
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
const universal_playground = UniversalPlayground;
|
|
313
|
-
exports.UniversalPlayground = __webpack_exports__.UniversalPlayground;
|
|
314
|
-
exports["default"] = __webpack_exports__["default"];
|
|
315
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
316
|
-
"UniversalPlayground",
|
|
317
|
-
"default"
|
|
318
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
319
|
-
Object.defineProperty(exports, '__esModule', {
|
|
320
|
-
value: true
|
|
321
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
AgentContextProvider: ()=>AgentContextProvider,
|
|
28
|
-
BaseContextProvider: ()=>BaseContextProvider,
|
|
29
|
-
NoOpContextProvider: ()=>NoOpContextProvider,
|
|
30
|
-
StaticContextProvider: ()=>StaticContextProvider
|
|
31
|
-
});
|
|
32
|
-
function _define_property(obj, key, value) {
|
|
33
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
34
|
-
value: value,
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true
|
|
38
|
-
});
|
|
39
|
-
else obj[key] = value;
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
class BaseContextProvider {
|
|
43
|
-
async refreshContext() {
|
|
44
|
-
this.cachedContext = void 0;
|
|
45
|
-
return await this.getUIContext();
|
|
46
|
-
}
|
|
47
|
-
constructor(){
|
|
48
|
-
_define_property(this, "cachedContext", void 0);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
class AgentContextProvider extends BaseContextProvider {
|
|
52
|
-
async getUIContext() {
|
|
53
|
-
if (this.cachedContext) return this.cachedContext;
|
|
54
|
-
const agent = this.getAgent();
|
|
55
|
-
if (!(null == agent ? void 0 : agent.getUIContext)) throw new Error('Agent does not support getUIContext');
|
|
56
|
-
const context = await agent.getUIContext();
|
|
57
|
-
this.cachedContext = context;
|
|
58
|
-
return context;
|
|
59
|
-
}
|
|
60
|
-
constructor(getAgent, options){
|
|
61
|
-
super(), _define_property(this, "getAgent", void 0), _define_property(this, "options", void 0), this.getAgent = getAgent, this.options = options;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
class StaticContextProvider extends BaseContextProvider {
|
|
65
|
-
async getUIContext() {
|
|
66
|
-
return this.context;
|
|
67
|
-
}
|
|
68
|
-
async refreshContext() {
|
|
69
|
-
return this.context;
|
|
70
|
-
}
|
|
71
|
-
constructor(context){
|
|
72
|
-
super(), _define_property(this, "context", void 0), this.context = context;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
class NoOpContextProvider {
|
|
76
|
-
async getUIContext() {
|
|
77
|
-
throw new Error('Context preview is disabled');
|
|
78
|
-
}
|
|
79
|
-
async refreshContext() {
|
|
80
|
-
throw new Error('Context preview is disabled');
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.AgentContextProvider = __webpack_exports__.AgentContextProvider;
|
|
84
|
-
exports.BaseContextProvider = __webpack_exports__.BaseContextProvider;
|
|
85
|
-
exports.NoOpContextProvider = __webpack_exports__.NoOpContextProvider;
|
|
86
|
-
exports.StaticContextProvider = __webpack_exports__.StaticContextProvider;
|
|
87
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
88
|
-
"AgentContextProvider",
|
|
89
|
-
"BaseContextProvider",
|
|
90
|
-
"NoOpContextProvider",
|
|
91
|
-
"StaticContextProvider"
|
|
92
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
93
|
-
Object.defineProperty(exports, '__esModule', {
|
|
94
|
-
value: true
|
|
95
|
-
});
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
LocalStorageProvider: ()=>LocalStorageProvider,
|
|
28
|
-
MemoryStorageProvider: ()=>MemoryStorageProvider,
|
|
29
|
-
NoOpStorageProvider: ()=>NoOpStorageProvider
|
|
30
|
-
});
|
|
31
|
-
function _define_property(obj, key, value) {
|
|
32
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true
|
|
37
|
-
});
|
|
38
|
-
else obj[key] = value;
|
|
39
|
-
return obj;
|
|
40
|
-
}
|
|
41
|
-
class LocalStorageProvider {
|
|
42
|
-
async saveMessages(messages) {
|
|
43
|
-
try {
|
|
44
|
-
const lightMessages = messages.map((msg)=>({
|
|
45
|
-
...msg,
|
|
46
|
-
result: void 0
|
|
47
|
-
}));
|
|
48
|
-
localStorage.setItem(this.messagesKey, JSON.stringify(lightMessages));
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error('Failed to save messages to localStorage:', error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async loadMessages() {
|
|
54
|
-
try {
|
|
55
|
-
const stored = localStorage.getItem(this.messagesKey);
|
|
56
|
-
if (!stored) return [];
|
|
57
|
-
const messages = JSON.parse(stored);
|
|
58
|
-
const restoredMessages = await Promise.all(messages.map(async (msg)=>{
|
|
59
|
-
if ('result' === msg.type && msg.id) {
|
|
60
|
-
const resultKey = `${this.resultsKey}-${msg.id}`;
|
|
61
|
-
const storedResult = localStorage.getItem(resultKey);
|
|
62
|
-
if (storedResult) try {
|
|
63
|
-
const resultItem = JSON.parse(storedResult);
|
|
64
|
-
return {
|
|
65
|
-
...msg,
|
|
66
|
-
...resultItem
|
|
67
|
-
};
|
|
68
|
-
} catch (e) {
|
|
69
|
-
console.warn('Failed to parse stored result:', e);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return msg;
|
|
73
|
-
}));
|
|
74
|
-
return restoredMessages;
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error('Failed to load messages from localStorage:', error);
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
async clearMessages() {
|
|
81
|
-
try {
|
|
82
|
-
localStorage.removeItem(this.messagesKey);
|
|
83
|
-
const keys = Object.keys(localStorage);
|
|
84
|
-
keys.forEach((key)=>{
|
|
85
|
-
if (key.startsWith(this.resultsKey)) localStorage.removeItem(key);
|
|
86
|
-
});
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.error('Failed to clear messages from localStorage:', error);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async saveResult(id, result) {
|
|
92
|
-
try {
|
|
93
|
-
const resultKey = `${this.resultsKey}-${id}`;
|
|
94
|
-
localStorage.setItem(resultKey, JSON.stringify(result));
|
|
95
|
-
} catch (error) {
|
|
96
|
-
console.error('Failed to save result to localStorage:', error);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
constructor(namespace = 'playground'){
|
|
100
|
-
_define_property(this, "messagesKey", void 0);
|
|
101
|
-
_define_property(this, "resultsKey", void 0);
|
|
102
|
-
this.messagesKey = `${namespace}-messages`;
|
|
103
|
-
this.resultsKey = `${namespace}-results`;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
class MemoryStorageProvider {
|
|
107
|
-
async saveMessages(messages) {
|
|
108
|
-
this.messages = [
|
|
109
|
-
...messages
|
|
110
|
-
];
|
|
111
|
-
}
|
|
112
|
-
async loadMessages() {
|
|
113
|
-
return [
|
|
114
|
-
...this.messages
|
|
115
|
-
];
|
|
116
|
-
}
|
|
117
|
-
async clearMessages() {
|
|
118
|
-
this.messages = [];
|
|
119
|
-
this.results.clear();
|
|
120
|
-
}
|
|
121
|
-
async saveResult(id, result) {
|
|
122
|
-
this.results.set(id, result);
|
|
123
|
-
}
|
|
124
|
-
constructor(){
|
|
125
|
-
_define_property(this, "messages", []);
|
|
126
|
-
_define_property(this, "results", new Map());
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
class NoOpStorageProvider {
|
|
130
|
-
async saveMessages(_messages) {}
|
|
131
|
-
async loadMessages() {
|
|
132
|
-
return [];
|
|
133
|
-
}
|
|
134
|
-
async clearMessages() {}
|
|
135
|
-
async saveResult(_id, _result) {}
|
|
136
|
-
}
|
|
137
|
-
exports.LocalStorageProvider = __webpack_exports__.LocalStorageProvider;
|
|
138
|
-
exports.MemoryStorageProvider = __webpack_exports__.MemoryStorageProvider;
|
|
139
|
-
exports.NoOpStorageProvider = __webpack_exports__.NoOpStorageProvider;
|
|
140
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
141
|
-
"LocalStorageProvider",
|
|
142
|
-
"MemoryStorageProvider",
|
|
143
|
-
"NoOpStorageProvider"
|
|
144
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
145
|
-
Object.defineProperty(exports, '__esModule', {
|
|
146
|
-
value: true
|
|
147
|
-
});
|