@sqaitech/visualizer 0.5.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/es/assets/sqai-logo.mjs +2 -0
- package/dist/es/component/blackboard/index.css +33 -0
- package/dist/es/component/blackboard/index.mjs +278 -0
- package/dist/es/component/config-selector/index.mjs +104 -0
- package/dist/es/component/context-preview/index.mjs +38 -0
- package/dist/es/component/env-config/index.mjs +112 -0
- package/dist/es/component/env-config-reminder/index.css +22 -0
- package/dist/es/component/env-config-reminder/index.mjs +28 -0
- package/dist/es/component/form-field/index.mjs +163 -0
- package/dist/es/component/history-selector/index.css +135 -0
- package/dist/es/component/history-selector/index.mjs +170 -0
- package/dist/es/component/index.mjs +1 -0
- package/dist/es/component/logo/index.css +13 -0
- package/dist/es/component/logo/index.mjs +21 -0
- package/dist/es/component/misc/index.mjs +94 -0
- package/dist/es/component/nav-actions/index.mjs +32 -0
- package/dist/es/component/nav-actions/style.css +35 -0
- package/dist/es/component/player/index.css +185 -0
- package/dist/es/component/player/index.mjs +856 -0
- package/dist/es/component/playground/index.css +431 -0
- package/dist/es/component/playground/index.mjs +8 -0
- package/dist/es/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/es/component/playground-result/index.css +34 -0
- package/dist/es/component/playground-result/index.mjs +62 -0
- package/dist/es/component/prompt-input/index.css +391 -0
- package/dist/es/component/prompt-input/index.mjs +730 -0
- package/dist/es/component/service-mode-control/index.mjs +105 -0
- package/dist/es/component/shiny-text/index.css +75 -0
- package/dist/es/component/shiny-text/index.mjs +15 -0
- package/dist/es/component/universal-playground/index.css +341 -0
- package/dist/es/component/universal-playground/index.mjs +302 -0
- package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +207 -0
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +210 -0
- package/dist/es/hooks/usePlaygroundExecution.mjs +180 -0
- package/dist/es/hooks/usePlaygroundState.mjs +203 -0
- package/dist/es/hooks/useSafeOverrideAIConfig.mjs +24 -0
- package/dist/es/hooks/useServerValid.mjs +30 -0
- package/dist/es/icons/avatar.mjs +28 -0
- package/dist/es/icons/close.mjs +19 -0
- package/dist/es/icons/global-perspective.mjs +16 -0
- package/dist/es/icons/history.mjs +30 -0
- package/dist/es/icons/magnifying-glass.mjs +39 -0
- package/dist/es/icons/player-setting.mjs +26 -0
- package/dist/es/icons/setting.mjs +20 -0
- package/dist/es/icons/show-marker.mjs +16 -0
- package/dist/es/index.mjs +25 -0
- package/dist/es/static/image/sqai-logo.png +0 -0
- package/dist/es/store/history.mjs +89 -0
- package/dist/es/store/store.mjs +186 -0
- package/dist/es/types.mjs +70 -0
- package/dist/es/utils/color.mjs +35 -0
- package/dist/es/utils/constants.mjs +99 -0
- package/dist/es/utils/index.mjs +10 -0
- package/dist/es/utils/pixi-loader.mjs +16 -0
- package/dist/es/utils/playground-utils.mjs +67 -0
- package/dist/es/utils/replay-scripts.mjs +312 -0
- package/dist/lib/assets/sqai-logo.js +24 -0
- package/dist/lib/component/blackboard/index.css +33 -0
- package/dist/lib/component/blackboard/index.js +321 -0
- package/dist/lib/component/config-selector/index.js +148 -0
- package/dist/lib/component/context-preview/index.js +83 -0
- package/dist/lib/component/env-config/index.js +146 -0
- package/dist/lib/component/env-config-reminder/index.css +22 -0
- package/dist/lib/component/env-config-reminder/index.js +62 -0
- package/dist/lib/component/form-field/index.js +209 -0
- package/dist/lib/component/history-selector/index.css +135 -0
- package/dist/lib/component/history-selector/index.js +216 -0
- package/dist/lib/component/index.js +60 -0
- package/dist/lib/component/logo/index.css +13 -0
- package/dist/lib/component/logo/index.js +68 -0
- package/dist/lib/component/misc/index.js +150 -0
- package/dist/lib/component/nav-actions/index.js +66 -0
- package/dist/lib/component/nav-actions/style.css +35 -0
- package/dist/lib/component/player/index.css +185 -0
- package/dist/lib/component/player/index.js +902 -0
- package/dist/lib/component/playground/index.css +431 -0
- package/dist/lib/component/playground/index.js +113 -0
- package/dist/lib/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/lib/component/playground-result/index.css +34 -0
- package/dist/lib/component/playground-result/index.js +106 -0
- package/dist/lib/component/prompt-input/index.css +391 -0
- package/dist/lib/component/prompt-input/index.js +774 -0
- package/dist/lib/component/service-mode-control/index.js +139 -0
- package/dist/lib/component/shiny-text/index.css +75 -0
- package/dist/lib/component/shiny-text/index.js +49 -0
- package/dist/lib/component/universal-playground/index.css +341 -0
- package/dist/lib/component/universal-playground/index.js +350 -0
- package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +247 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +268 -0
- package/dist/lib/hooks/usePlaygroundExecution.js +214 -0
- package/dist/lib/hooks/usePlaygroundState.js +237 -0
- package/dist/lib/hooks/useSafeOverrideAIConfig.js +61 -0
- package/dist/lib/hooks/useServerValid.js +64 -0
- package/dist/lib/icons/avatar.js +62 -0
- package/dist/lib/icons/close.js +53 -0
- package/dist/lib/icons/global-perspective.js +50 -0
- package/dist/lib/icons/history.js +64 -0
- package/dist/lib/icons/magnifying-glass.js +73 -0
- package/dist/lib/icons/player-setting.js +60 -0
- package/dist/lib/icons/setting.js +54 -0
- package/dist/lib/icons/show-marker.js +50 -0
- package/dist/lib/index.js +187 -0
- package/dist/lib/static/image/sqai-logo.png +0 -0
- package/dist/lib/store/history.js +96 -0
- package/dist/lib/store/store.js +196 -0
- package/dist/lib/types.js +116 -0
- package/dist/lib/utils/color.js +75 -0
- package/dist/lib/utils/constants.js +154 -0
- package/dist/lib/utils/index.js +63 -0
- package/dist/lib/utils/pixi-loader.js +56 -0
- package/dist/lib/utils/playground-utils.js +110 -0
- package/dist/lib/utils/replay-scripts.js +355 -0
- package/dist/types/component/blackboard/index.d.ts +15 -0
- package/dist/types/component/config-selector/index.d.ts +9 -0
- package/dist/types/component/context-preview/index.d.ts +9 -0
- package/dist/types/component/env-config/index.d.ts +6 -0
- package/dist/types/component/env-config-reminder/index.d.ts +6 -0
- package/dist/types/component/form-field/index.d.ts +17 -0
- package/dist/types/component/history-selector/index.d.ts +10 -0
- package/dist/types/component/index.d.ts +1 -0
- package/dist/types/component/logo/index.d.ts +5 -0
- package/dist/types/component/misc/index.d.ts +6 -0
- package/dist/types/component/nav-actions/index.d.ts +10 -0
- package/dist/types/component/player/index.d.ts +13 -0
- package/dist/types/component/playground/index.d.ts +7 -0
- package/dist/types/component/playground-result/index.d.ts +20 -0
- package/dist/types/component/prompt-input/index.d.ts +22 -0
- package/dist/types/component/service-mode-control/index.d.ts +6 -0
- package/dist/types/component/shiny-text/index.d.ts +12 -0
- package/dist/types/component/universal-playground/index.d.ts +4 -0
- package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
- package/dist/types/component/universal-playground/providers/indexeddb-storage-provider.d.ts +71 -0
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +58 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
- package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
- package/dist/types/hooks/useSafeOverrideAIConfig.d.ts +16 -0
- package/dist/types/hooks/useServerValid.d.ts +1 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/store/history.d.ts +16 -0
- package/dist/types/store/store.d.ts +36 -0
- package/dist/types/types.d.ts +161 -0
- package/dist/types/utils/color.d.ts +4 -0
- package/dist/types/utils/constants.d.ts +74 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/pixi-loader.d.ts +5 -0
- package/dist/types/utils/playground-utils.d.ts +6 -0
- package/dist/types/utils/replay-scripts.d.ts +34 -0
- package/package.json +85 -0
|
@@ -0,0 +1,350 @@
|
|
|
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_env_config_reminder_index_js_namespaceObject = require("../env-config-reminder/index.js");
|
|
49
|
+
const external_playground_result_index_js_namespaceObject = require("../playground-result/index.js");
|
|
50
|
+
require("./index.css");
|
|
51
|
+
const avatar_js_namespaceObject = require("../../icons/avatar.js");
|
|
52
|
+
var avatar_js_default = /*#__PURE__*/ __webpack_require__.n(avatar_js_namespaceObject);
|
|
53
|
+
const external_prompt_input_index_js_namespaceObject = require("../prompt-input/index.js");
|
|
54
|
+
const storage_provider_js_namespaceObject = require("./providers/storage-provider.js");
|
|
55
|
+
const { Text } = external_antd_namespaceObject.Typography;
|
|
56
|
+
function getSDKId(sdk) {
|
|
57
|
+
if (sdk.id && 'string' == typeof sdk.id) return `agent-${sdk.id}`;
|
|
58
|
+
return 'playground-default';
|
|
59
|
+
}
|
|
60
|
+
function ErrorMessage(param) {
|
|
61
|
+
let { error } = param;
|
|
62
|
+
if (!error) return null;
|
|
63
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Tooltip, {
|
|
64
|
+
title: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
65
|
+
style: {
|
|
66
|
+
whiteSpace: 'pre-wrap',
|
|
67
|
+
wordBreak: 'break-all'
|
|
68
|
+
},
|
|
69
|
+
children: error
|
|
70
|
+
}),
|
|
71
|
+
overlayStyle: {
|
|
72
|
+
maxWidth: '100vw'
|
|
73
|
+
},
|
|
74
|
+
children: [
|
|
75
|
+
"Error: ",
|
|
76
|
+
error.split('\n')[0]
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function UniversalPlayground(param) {
|
|
81
|
+
let { playgroundSDK, storage, contextProvider, config: componentConfig = {}, branding = {}, className = '', dryMode = false, showContextPreview = true } = param;
|
|
82
|
+
const [form] = external_antd_namespaceObject.Form.useForm();
|
|
83
|
+
const { config } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
84
|
+
const [sdkReady, setSdkReady] = (0, external_react_namespaceObject.useState)(false);
|
|
85
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
86
|
+
const initializeSDK = async ()=>{
|
|
87
|
+
if (playgroundSDK && 'function' == typeof playgroundSDK.checkStatus) try {
|
|
88
|
+
await playgroundSDK.checkStatus();
|
|
89
|
+
setSdkReady(true);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.warn('Failed to initialize SDK, using default namespace:', error);
|
|
92
|
+
setSdkReady(true);
|
|
93
|
+
}
|
|
94
|
+
else setSdkReady(true);
|
|
95
|
+
};
|
|
96
|
+
initializeSDK();
|
|
97
|
+
}, [
|
|
98
|
+
playgroundSDK
|
|
99
|
+
]);
|
|
100
|
+
const effectiveStorage = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
101
|
+
if (storage) return storage;
|
|
102
|
+
if (!sdkReady) return null;
|
|
103
|
+
const namespace = componentConfig.storageNamespace || getSDKId(playgroundSDK);
|
|
104
|
+
const bestStorageType = (0, storage_provider_js_namespaceObject.detectBestStorageType)();
|
|
105
|
+
console.log(`Using ${bestStorageType} storage for namespace: ${namespace}`);
|
|
106
|
+
return (0, storage_provider_js_namespaceObject.createStorageProvider)(bestStorageType, namespace);
|
|
107
|
+
}, [
|
|
108
|
+
storage,
|
|
109
|
+
sdkReady,
|
|
110
|
+
componentConfig.storageNamespace,
|
|
111
|
+
playgroundSDK
|
|
112
|
+
]);
|
|
113
|
+
const { loading, setLoading, infoList, setInfoList, actionSpace, actionSpaceLoading, uiContextPreview, setUiContextPreview, showScrollToBottomButton, verticalMode, replayCounter, setReplayCounter, infoListRef, currentRunningIdRef, interruptedFlagRef, clearInfoList, handleScrollToBottom } = (0, usePlaygroundState_js_namespaceObject.usePlaygroundState)(playgroundSDK, effectiveStorage, contextProvider);
|
|
114
|
+
const { handleRun: executeAction, handleStop, canStop } = (0, usePlaygroundExecution_js_namespaceObject.usePlaygroundExecution)(playgroundSDK, effectiveStorage, actionSpace, loading, setLoading, infoList, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef);
|
|
115
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
116
|
+
if ((null == playgroundSDK ? void 0 : playgroundSDK.overrideConfig) && config) playgroundSDK.overrideConfig(config).catch((error)=>{
|
|
117
|
+
console.error('Failed to override SDK config:', error);
|
|
118
|
+
});
|
|
119
|
+
}, [
|
|
120
|
+
playgroundSDK,
|
|
121
|
+
config
|
|
122
|
+
]);
|
|
123
|
+
const handleFormRun = (0, external_react_namespaceObject.useCallback)(async ()=>{
|
|
124
|
+
try {
|
|
125
|
+
const value = form.getFieldsValue();
|
|
126
|
+
await executeAction(value);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
external_antd_namespaceObject.message.error((null == error ? void 0 : error.message) || 'Execution failed');
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
form,
|
|
132
|
+
executeAction
|
|
133
|
+
]);
|
|
134
|
+
const configAlreadySet = Object.keys(config || {}).length >= 1;
|
|
135
|
+
const runButtonEnabled = componentConfig.serverMode || !dryMode && !actionSpaceLoading && configAlreadySet;
|
|
136
|
+
const selectedType = external_antd_namespaceObject.Form.useWatch('type', form);
|
|
137
|
+
const finalShowContextPreview = showContextPreview && false !== componentConfig.showContextPreview;
|
|
138
|
+
const layout = componentConfig.layout || 'vertical';
|
|
139
|
+
const showVersionInfo = false !== componentConfig.showVersionInfo;
|
|
140
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
141
|
+
className: `playground-container ${layout}-mode ${className}`.trim(),
|
|
142
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Form, {
|
|
143
|
+
form: form,
|
|
144
|
+
onFinish: handleFormRun,
|
|
145
|
+
className: "command-form",
|
|
146
|
+
children: [
|
|
147
|
+
finalShowContextPreview && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
148
|
+
className: "context-preview-section",
|
|
149
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ContextPreview, {
|
|
150
|
+
uiContextPreview: uiContextPreview,
|
|
151
|
+
setUiContextPreview: setUiContextPreview,
|
|
152
|
+
showContextPreview: finalShowContextPreview
|
|
153
|
+
})
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
156
|
+
className: "middle-dialog-area",
|
|
157
|
+
children: [
|
|
158
|
+
infoList.length > 1 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
159
|
+
className: "clear-button-container",
|
|
160
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
161
|
+
size: "small",
|
|
162
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ClearOutlined, {}),
|
|
163
|
+
onClick: clearInfoList,
|
|
164
|
+
type: "text",
|
|
165
|
+
className: "clear-button"
|
|
166
|
+
})
|
|
167
|
+
}),
|
|
168
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
169
|
+
ref: infoListRef,
|
|
170
|
+
className: "info-list-container",
|
|
171
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
|
|
172
|
+
itemLayout: "vertical",
|
|
173
|
+
dataSource: infoList,
|
|
174
|
+
renderItem: (item)=>{
|
|
175
|
+
var _item_result;
|
|
176
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List.Item, {
|
|
177
|
+
className: "list-item",
|
|
178
|
+
children: 'user' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
179
|
+
className: "user-message-container",
|
|
180
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
181
|
+
className: "user-message-bubble",
|
|
182
|
+
children: item.content
|
|
183
|
+
})
|
|
184
|
+
}) : 'progress' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
185
|
+
children: (()=>{
|
|
186
|
+
var _parts_, _item_result, _item_result1, _item_result2;
|
|
187
|
+
const parts = item.content.split(' - ');
|
|
188
|
+
const action = null == (_parts_ = parts[0]) ? void 0 : _parts_.trim();
|
|
189
|
+
const description = parts.slice(1).join(' - ').trim();
|
|
190
|
+
const currentIndex = infoList.findIndex((listItem)=>listItem.id === item.id);
|
|
191
|
+
const laterProgressExists = infoList.slice(currentIndex + 1).some((listItem)=>'progress' === listItem.type);
|
|
192
|
+
const isLatestProgress = !laterProgressExists;
|
|
193
|
+
const shouldShowLoading = loading && isLatestProgress;
|
|
194
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
195
|
+
children: [
|
|
196
|
+
action && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
197
|
+
className: "progress-action-item",
|
|
198
|
+
children: [
|
|
199
|
+
action,
|
|
200
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
201
|
+
className: `progress-status-icon ${shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed'}`,
|
|
202
|
+
children: shouldShowLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LoadingOutlined, {
|
|
203
|
+
spin: true
|
|
204
|
+
}) : (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) ? "\u2717" : "\u2713"
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
209
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
210
|
+
className: "progress-description",
|
|
211
|
+
children: description
|
|
212
|
+
})
|
|
213
|
+
}),
|
|
214
|
+
(null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
|
|
215
|
+
error: item.result.error
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
219
|
+
})()
|
|
220
|
+
}) : 'separator' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
221
|
+
className: "new-conversation-separator",
|
|
222
|
+
children: [
|
|
223
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
224
|
+
className: "separator-line"
|
|
225
|
+
}),
|
|
226
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
227
|
+
className: "separator-text-container",
|
|
228
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
|
|
229
|
+
type: "secondary",
|
|
230
|
+
className: "separator-text",
|
|
231
|
+
children: item.content
|
|
232
|
+
})
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
236
|
+
className: "system-message-container",
|
|
237
|
+
children: [
|
|
238
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
239
|
+
className: "system-message-header",
|
|
240
|
+
children: [
|
|
241
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_default(), {
|
|
242
|
+
component: branding.icon || avatar_js_default(),
|
|
243
|
+
style: {
|
|
244
|
+
fontSize: 20
|
|
245
|
+
}
|
|
246
|
+
}),
|
|
247
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
248
|
+
className: "system-message-title",
|
|
249
|
+
children: branding.title || 'Playground'
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
(item.content || item.result) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
254
|
+
className: "system-message-content",
|
|
255
|
+
children: [
|
|
256
|
+
'result' === item.type && (null == (_item_result = item.result) ? void 0 : _item_result.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
257
|
+
className: "error-message",
|
|
258
|
+
children: [
|
|
259
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
260
|
+
className: "divider"
|
|
261
|
+
}),
|
|
262
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
|
|
263
|
+
error: item.result.error
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
}),
|
|
267
|
+
'result' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_playground_result_index_js_namespaceObject.PlaygroundResultView, {
|
|
268
|
+
result: item.result || null,
|
|
269
|
+
loading: item.loading || false,
|
|
270
|
+
serverValid: true,
|
|
271
|
+
serviceMode: 'Server',
|
|
272
|
+
replayScriptsInfo: item.replayScriptsInfo || null,
|
|
273
|
+
replayCounter: item.replayCounter || 0,
|
|
274
|
+
loadingProgressText: item.loadingProgressText || '',
|
|
275
|
+
verticalMode: item.verticalMode || false,
|
|
276
|
+
fitMode: "width"
|
|
277
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
278
|
+
children: [
|
|
279
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
280
|
+
className: "system-message-text",
|
|
281
|
+
children: item.content
|
|
282
|
+
}),
|
|
283
|
+
item.loading && item.loadingProgressText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
284
|
+
className: "loading-progress-text",
|
|
285
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
286
|
+
children: item.loadingProgressText
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
})
|
|
295
|
+
}, item.id);
|
|
296
|
+
}
|
|
297
|
+
})
|
|
298
|
+
}),
|
|
299
|
+
showScrollToBottomButton && false !== componentConfig.enableScrollToBottom && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
300
|
+
className: "scroll-to-bottom-button",
|
|
301
|
+
type: "primary",
|
|
302
|
+
shape: "circle",
|
|
303
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowDownOutlined, {}),
|
|
304
|
+
onClick: handleScrollToBottom,
|
|
305
|
+
size: "large"
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
}),
|
|
309
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
310
|
+
className: "bottom-input-section",
|
|
311
|
+
children: [
|
|
312
|
+
componentConfig.showEnvConfigReminder ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_env_config_reminder_index_js_namespaceObject.EnvConfigReminder, {}) : null,
|
|
313
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_prompt_input_index_js_namespaceObject.PromptInput, {
|
|
314
|
+
runButtonEnabled: runButtonEnabled,
|
|
315
|
+
form: form,
|
|
316
|
+
serviceMode: 'Server',
|
|
317
|
+
selectedType: selectedType,
|
|
318
|
+
dryMode: dryMode,
|
|
319
|
+
stoppable: canStop,
|
|
320
|
+
loading: loading,
|
|
321
|
+
onRun: handleFormRun,
|
|
322
|
+
onStop: handleStop,
|
|
323
|
+
actionSpace: actionSpace
|
|
324
|
+
})
|
|
325
|
+
]
|
|
326
|
+
}),
|
|
327
|
+
showVersionInfo && branding.version && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
328
|
+
className: "version-info-section",
|
|
329
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
330
|
+
className: "version-text",
|
|
331
|
+
children: [
|
|
332
|
+
"Midscene.js version: ",
|
|
333
|
+
branding.version
|
|
334
|
+
]
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
})
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
const universal_playground = UniversalPlayground;
|
|
342
|
+
exports.UniversalPlayground = __webpack_exports__.UniversalPlayground;
|
|
343
|
+
exports["default"] = __webpack_exports__["default"];
|
|
344
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
345
|
+
"UniversalPlayground",
|
|
346
|
+
"default"
|
|
347
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
348
|
+
Object.defineProperty(exports, '__esModule', {
|
|
349
|
+
value: true
|
|
350
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
});
|