@godscene/playground-electron 1.7.11
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 +4 -0
- package/dist/es/DeviceInteractionLayer.mjs +383 -0
- package/dist/es/PlaygroundApp.css +207 -0
- package/dist/es/PlaygroundApp.mjs +776 -0
- package/dist/es/PlaygroundPreview.mjs +29 -0
- package/dist/es/PlaygroundThemeProvider.mjs +10 -0
- package/dist/es/PreviewRenderer.mjs +270 -0
- package/dist/es/ScrcpyPanel.mjs +390 -0
- package/dist/es/SessionSetupPanel.css +299 -0
- package/dist/es/SessionSetupPanel.mjs +169 -0
- package/dist/es/components/Header/index.css +19 -0
- package/dist/es/components/Header/index.mjs +37 -0
- package/dist/es/components/Nav/index.css +15 -0
- package/dist/es/components/Nav/index.mjs +93 -0
- package/dist/es/components/WinControlTool/index.css +5 -0
- package/dist/es/components/WinControlTool/index.mjs +76 -0
- package/dist/es/controller/ai-config.mjs +40 -0
- package/dist/es/controller/auto-create.mjs +19 -0
- package/dist/es/controller/selectors.mjs +78 -0
- package/dist/es/controller/single-flight.mjs +13 -0
- package/dist/es/controller/types.mjs +0 -0
- package/dist/es/controller/usePlaygroundController.mjs +400 -0
- package/dist/es/icons/dropdown-chevron.mjs +61 -0
- package/dist/es/icons/midscene-logo.mjs +247 -0
- package/dist/es/icons/server-offline-background.mjs +102 -0
- package/dist/es/icons/server-offline-foreground.mjs +200 -0
- package/dist/es/index.mjs +7 -0
- package/dist/es/manual-interaction.mjs +56 -0
- package/dist/es/panels/PlaygroundConversationPanel.css +20 -0
- package/dist/es/panels/PlaygroundConversationPanel.mjs +140 -0
- package/dist/es/runtime-info.mjs +128 -0
- package/dist/es/scrcpy-preview.mjs +30 -0
- package/dist/es/scrcpy-stream.mjs +53 -0
- package/dist/es/session-setup.mjs +13 -0
- package/dist/es/session-state.mjs +32 -0
- package/dist/es/useServerStatus.mjs +120 -0
- package/dist/lib/DeviceInteractionLayer.js +434 -0
- package/dist/lib/PlaygroundApp.css +207 -0
- package/dist/lib/PlaygroundApp.js +821 -0
- package/dist/lib/PlaygroundPreview.js +63 -0
- package/dist/lib/PlaygroundThemeProvider.js +44 -0
- package/dist/lib/PreviewRenderer.js +304 -0
- package/dist/lib/ScrcpyPanel.js +424 -0
- package/dist/lib/SessionSetupPanel.css +299 -0
- package/dist/lib/SessionSetupPanel.js +217 -0
- package/dist/lib/components/Header/index.css +19 -0
- package/dist/lib/components/Header/index.js +81 -0
- package/dist/lib/components/Nav/index.css +15 -0
- package/dist/lib/components/Nav/index.js +127 -0
- package/dist/lib/components/WinControlTool/index.css +5 -0
- package/dist/lib/components/WinControlTool/index.js +110 -0
- package/dist/lib/controller/ai-config.js +80 -0
- package/dist/lib/controller/auto-create.js +59 -0
- package/dist/lib/controller/selectors.js +115 -0
- package/dist/lib/controller/single-flight.js +47 -0
- package/dist/lib/controller/types.js +18 -0
- package/dist/lib/controller/usePlaygroundController.js +434 -0
- package/dist/lib/icons/dropdown-chevron.js +95 -0
- package/dist/lib/icons/midscene-logo.js +281 -0
- package/dist/lib/icons/server-offline-background.js +136 -0
- package/dist/lib/icons/server-offline-foreground.js +234 -0
- package/dist/lib/index.js +56 -0
- package/dist/lib/manual-interaction.js +90 -0
- package/dist/lib/panels/PlaygroundConversationPanel.css +20 -0
- package/dist/lib/panels/PlaygroundConversationPanel.js +174 -0
- package/dist/lib/runtime-info.js +174 -0
- package/dist/lib/scrcpy-preview.js +79 -0
- package/dist/lib/scrcpy-stream.js +87 -0
- package/dist/lib/session-setup.js +47 -0
- package/dist/lib/session-state.js +69 -0
- package/dist/lib/useServerStatus.js +154 -0
- package/dist/types/DeviceInteractionLayer.d.ts +50 -0
- package/dist/types/PlaygroundApp.d.ts +14 -0
- package/dist/types/PlaygroundPreview.d.ts +22 -0
- package/dist/types/PlaygroundThemeProvider.d.ts +2 -0
- package/dist/types/PreviewRenderer.d.ts +27 -0
- package/dist/types/ScrcpyPanel.d.ts +21 -0
- package/dist/types/SessionSetupPanel.d.ts +16 -0
- package/dist/types/components/Header/index.d.ts +3 -0
- package/dist/types/components/Nav/index.d.ts +3 -0
- package/dist/types/components/WinControlTool/index.d.ts +3 -0
- package/dist/types/controller/ai-config.d.ts +5 -0
- package/dist/types/controller/auto-create.d.ts +15 -0
- package/dist/types/controller/selectors.d.ts +5 -0
- package/dist/types/controller/single-flight.d.ts +3 -0
- package/dist/types/controller/types.d.ts +36 -0
- package/dist/types/controller/usePlaygroundController.d.ts +16 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/manual-interaction.d.ts +21 -0
- package/dist/types/panels/PlaygroundConversationPanel.d.ts +25 -0
- package/dist/types/runtime-info.d.ts +22 -0
- package/dist/types/scrcpy-preview.d.ts +11 -0
- package/dist/types/scrcpy-stream.d.ts +16 -0
- package/dist/types/session-setup.d.ts +2 -0
- package/dist/types/session-state.d.ts +9 -0
- package/dist/types/useServerStatus.d.ts +12 -0
- package/package.json +69 -0
|
@@ -0,0 +1,127 @@
|
|
|
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 ("u" > 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
|
+
Nav: ()=>Nav
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_antd_namespaceObject = require("antd");
|
|
32
|
+
const icons_namespaceObject = require("@ant-design/icons");
|
|
33
|
+
require("./index.css");
|
|
34
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
35
|
+
try {
|
|
36
|
+
var info = gen[key](arg);
|
|
37
|
+
var value = info.value;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
reject(error);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (info.done) resolve(value);
|
|
43
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
44
|
+
}
|
|
45
|
+
function _async_to_generator(fn) {
|
|
46
|
+
return function() {
|
|
47
|
+
var self = this, args = arguments;
|
|
48
|
+
return new Promise(function(resolve, reject) {
|
|
49
|
+
var gen = fn.apply(self, args);
|
|
50
|
+
function _next(value) {
|
|
51
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
52
|
+
}
|
|
53
|
+
function _throw(err) {
|
|
54
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
55
|
+
}
|
|
56
|
+
_next(void 0);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function Nav() {
|
|
61
|
+
const [form] = external_antd_namespaceObject.Form.useForm();
|
|
62
|
+
const onFinish = (values)=>_async_to_generator(function*() {
|
|
63
|
+
if (values.url) {
|
|
64
|
+
var _window_electron;
|
|
65
|
+
let url = values.url.startsWith('http') ? values.url : `https://${values.url}`;
|
|
66
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('view:navigate', url);
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
70
|
+
var _window_electron;
|
|
71
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.on('update-url', (event, url)=>{
|
|
72
|
+
form.setFieldsValue({
|
|
73
|
+
url
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}, []);
|
|
77
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Form, {
|
|
78
|
+
layout: "inline",
|
|
79
|
+
className: "assistant-form",
|
|
80
|
+
form: form,
|
|
81
|
+
autoComplete: "off",
|
|
82
|
+
onFinish: onFinish,
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
85
|
+
type: "text",
|
|
86
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowLeftOutlined, {}),
|
|
87
|
+
onClick: ()=>{
|
|
88
|
+
var _window_electron;
|
|
89
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('view:goBack');
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
93
|
+
type: "text",
|
|
94
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowRightOutlined, {}),
|
|
95
|
+
onClick: ()=>{
|
|
96
|
+
var _window_electron;
|
|
97
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('view:goForward');
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
101
|
+
type: "text",
|
|
102
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.RedoOutlined, {
|
|
103
|
+
rotate: 270
|
|
104
|
+
}),
|
|
105
|
+
onClick: ()=>{
|
|
106
|
+
var _window_electron;
|
|
107
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('view:reload');
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
|
|
111
|
+
label: "",
|
|
112
|
+
name: "url",
|
|
113
|
+
className: "form-item-url",
|
|
114
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
|
|
115
|
+
placeholder: "url"
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
exports.Nav = __webpack_exports__.Nav;
|
|
122
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
123
|
+
"Nav"
|
|
124
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
125
|
+
Object.defineProperty(exports, '__esModule', {
|
|
126
|
+
value: true
|
|
127
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
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 ("u" > 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
|
+
default: ()=>WinControlTool
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_antd_namespaceObject = require("antd");
|
|
32
|
+
const icons_namespaceObject = require("@ant-design/icons");
|
|
33
|
+
require("./index.css");
|
|
34
|
+
function WinControlTool({ token, parentToken, pageName }) {
|
|
35
|
+
const [isFullScreen, setIsFullScreen] = (0, external_react_namespaceObject.useState)(false);
|
|
36
|
+
const handleCloseWindow = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
37
|
+
window.__Window.closeWindow();
|
|
38
|
+
token && parentToken && window.__Window.sendMessage({
|
|
39
|
+
from: token,
|
|
40
|
+
to: parentToken,
|
|
41
|
+
token: `${Math.random()}`,
|
|
42
|
+
message: {
|
|
43
|
+
pageName: pageName,
|
|
44
|
+
actionName: 'closeDialog'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}, [
|
|
48
|
+
token,
|
|
49
|
+
parentToken,
|
|
50
|
+
pageName
|
|
51
|
+
]);
|
|
52
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
53
|
+
window.addEventListener('beforeunload', handleCloseWindow);
|
|
54
|
+
return ()=>{
|
|
55
|
+
window.removeEventListener('beforeunload', handleCloseWindow);
|
|
56
|
+
};
|
|
57
|
+
}, [
|
|
58
|
+
handleCloseWindow
|
|
59
|
+
]);
|
|
60
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
61
|
+
className: "control-tool",
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
64
|
+
className: "app-region-no-drag",
|
|
65
|
+
type: "text",
|
|
66
|
+
onClick: ()=>{
|
|
67
|
+
var _window_electron;
|
|
68
|
+
return null == (_window_electron = window.electron) ? void 0 : _window_electron.ipcRenderer.send('win:invoke', 'min');
|
|
69
|
+
},
|
|
70
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.MinusOutlined, {})
|
|
71
|
+
}),
|
|
72
|
+
isFullScreen ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
73
|
+
className: "app-region-no-drag",
|
|
74
|
+
type: "text",
|
|
75
|
+
onClick: ()=>{
|
|
76
|
+
var _window_electron;
|
|
77
|
+
setIsFullScreen(false);
|
|
78
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('win:invoke', 'max');
|
|
79
|
+
},
|
|
80
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.RotateRightOutlined, {
|
|
81
|
+
rotate: 90
|
|
82
|
+
})
|
|
83
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
84
|
+
className: "app-region-no-drag",
|
|
85
|
+
type: "text",
|
|
86
|
+
onClick: ()=>{
|
|
87
|
+
var _window_electron;
|
|
88
|
+
setIsFullScreen(true);
|
|
89
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.send('win:invoke', 'max');
|
|
90
|
+
},
|
|
91
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.BorderOutlined, {})
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
94
|
+
className: "app-region-no-drag",
|
|
95
|
+
type: "text",
|
|
96
|
+
onClick: ()=>{
|
|
97
|
+
handleCloseWindow();
|
|
98
|
+
},
|
|
99
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CloseOutlined, {})
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
exports["default"] = __webpack_exports__["default"];
|
|
105
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
106
|
+
"default"
|
|
107
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
108
|
+
Object.defineProperty(exports, '__esModule', {
|
|
109
|
+
value: true
|
|
110
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
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 ("u" > 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
|
+
applyPlaygroundAiConfig: ()=>applyPlaygroundAiConfig,
|
|
28
|
+
hasPlaygroundAiConfig: ()=>hasPlaygroundAiConfig,
|
|
29
|
+
serializePlaygroundAiConfig: ()=>serializePlaygroundAiConfig
|
|
30
|
+
});
|
|
31
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
32
|
+
try {
|
|
33
|
+
var info = gen[key](arg);
|
|
34
|
+
var value = info.value;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
reject(error);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (info.done) resolve(value);
|
|
40
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
41
|
+
}
|
|
42
|
+
function _async_to_generator(fn) {
|
|
43
|
+
return function() {
|
|
44
|
+
var self = this, args = arguments;
|
|
45
|
+
return new Promise(function(resolve, reject) {
|
|
46
|
+
var gen = fn.apply(self, args);
|
|
47
|
+
function _next(value) {
|
|
48
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
49
|
+
}
|
|
50
|
+
function _throw(err) {
|
|
51
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
52
|
+
}
|
|
53
|
+
_next(void 0);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function hasPlaygroundAiConfig(config) {
|
|
58
|
+
return Object.keys(config).length > 0;
|
|
59
|
+
}
|
|
60
|
+
function serializePlaygroundAiConfig(config) {
|
|
61
|
+
return JSON.stringify(Object.entries(config).sort(([leftKey], [rightKey])=>leftKey.localeCompare(rightKey)));
|
|
62
|
+
}
|
|
63
|
+
function applyPlaygroundAiConfig(playgroundSDK, config) {
|
|
64
|
+
return _async_to_generator(function*() {
|
|
65
|
+
if (!hasPlaygroundAiConfig(config)) return false;
|
|
66
|
+
yield playgroundSDK.overrideConfig(config);
|
|
67
|
+
return true;
|
|
68
|
+
})();
|
|
69
|
+
}
|
|
70
|
+
exports.applyPlaygroundAiConfig = __webpack_exports__.applyPlaygroundAiConfig;
|
|
71
|
+
exports.hasPlaygroundAiConfig = __webpack_exports__.hasPlaygroundAiConfig;
|
|
72
|
+
exports.serializePlaygroundAiConfig = __webpack_exports__.serializePlaygroundAiConfig;
|
|
73
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
74
|
+
"applyPlaygroundAiConfig",
|
|
75
|
+
"hasPlaygroundAiConfig",
|
|
76
|
+
"serializePlaygroundAiConfig"
|
|
77
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
78
|
+
Object.defineProperty(exports, '__esModule', {
|
|
79
|
+
value: true
|
|
80
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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 ("u" > 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
|
+
resolveAutoCreateDecision: ()=>resolveAutoCreateDecision,
|
|
28
|
+
serializeAutoCreateInput: ()=>serializeAutoCreateInput,
|
|
29
|
+
shouldResetAutoCreateBlock: ()=>shouldResetAutoCreateBlock
|
|
30
|
+
});
|
|
31
|
+
function serializeAutoCreateInput(autoCreateInput) {
|
|
32
|
+
if (!autoCreateInput) return null;
|
|
33
|
+
return JSON.stringify(autoCreateInput);
|
|
34
|
+
}
|
|
35
|
+
function resolveAutoCreateDecision({ autoCreateInput, lastAttemptedSignature, blockedSignature }) {
|
|
36
|
+
const signature = serializeAutoCreateInput(autoCreateInput);
|
|
37
|
+
if (!signature) return {
|
|
38
|
+
signature: null,
|
|
39
|
+
shouldCreate: false
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
signature,
|
|
43
|
+
shouldCreate: signature !== lastAttemptedSignature && signature !== blockedSignature
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function shouldResetAutoCreateBlock(options) {
|
|
47
|
+
return !(null == options ? void 0 : options.silent);
|
|
48
|
+
}
|
|
49
|
+
exports.resolveAutoCreateDecision = __webpack_exports__.resolveAutoCreateDecision;
|
|
50
|
+
exports.serializeAutoCreateInput = __webpack_exports__.serializeAutoCreateInput;
|
|
51
|
+
exports.shouldResetAutoCreateBlock = __webpack_exports__.shouldResetAutoCreateBlock;
|
|
52
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
53
|
+
"resolveAutoCreateDecision",
|
|
54
|
+
"serializeAutoCreateInput",
|
|
55
|
+
"shouldResetAutoCreateBlock"
|
|
56
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
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 ("u" > 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
|
+
buildConversationBranding: ()=>buildConversationBranding,
|
|
28
|
+
buildConversationConfig: ()=>buildConversationConfig
|
|
29
|
+
});
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
32
|
+
value: value,
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true
|
|
36
|
+
});
|
|
37
|
+
else obj[key] = value;
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
function _object_spread(target) {
|
|
41
|
+
for(var i = 1; i < arguments.length; i++){
|
|
42
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
43
|
+
var ownKeys = Object.keys(source);
|
|
44
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
46
|
+
}));
|
|
47
|
+
ownKeys.forEach(function(key) {
|
|
48
|
+
_define_property(target, key, source[key]);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function ownKeys(object, enumerableOnly) {
|
|
54
|
+
var keys = Object.keys(object);
|
|
55
|
+
if (Object.getOwnPropertySymbols) {
|
|
56
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
57
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
58
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
59
|
+
});
|
|
60
|
+
keys.push.apply(keys, symbols);
|
|
61
|
+
}
|
|
62
|
+
return keys;
|
|
63
|
+
}
|
|
64
|
+
function _object_spread_props(target, source) {
|
|
65
|
+
source = null != source ? source : {};
|
|
66
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67
|
+
else ownKeys(Object(source)).forEach(function(key) {
|
|
68
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
+
});
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
function buildConversationConfig(state, playgroundConfig) {
|
|
73
|
+
const defaultConfig = {
|
|
74
|
+
showContextPreview: false,
|
|
75
|
+
layout: 'vertical',
|
|
76
|
+
showVersionInfo: false,
|
|
77
|
+
enableScrollToBottom: false,
|
|
78
|
+
serverMode: true,
|
|
79
|
+
showEnvConfigReminder: false,
|
|
80
|
+
showClearButton: false,
|
|
81
|
+
showSystemMessageHeader: false,
|
|
82
|
+
promptInputChrome: {
|
|
83
|
+
variant: 'minimal'
|
|
84
|
+
},
|
|
85
|
+
executionFlow: {
|
|
86
|
+
collapsible: true
|
|
87
|
+
},
|
|
88
|
+
deviceType: state.deviceType,
|
|
89
|
+
executionUx: {
|
|
90
|
+
hints: state.executionUxHints,
|
|
91
|
+
countdownSeconds: state.countdownSeconds
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return _object_spread_props(_object_spread({}, defaultConfig, playgroundConfig), {
|
|
95
|
+
executionFlow: _object_spread({}, defaultConfig.executionFlow, null == playgroundConfig ? void 0 : playgroundConfig.executionFlow),
|
|
96
|
+
executionUx: _object_spread({}, defaultConfig.executionUx, null == playgroundConfig ? void 0 : playgroundConfig.executionUx)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function buildConversationBranding(runtimeInfo, title, appVersion, deviceType, branding) {
|
|
100
|
+
var _ref, _ref1, _ref2, _ref3;
|
|
101
|
+
return _object_spread_props(_object_spread({}, branding), {
|
|
102
|
+
title: null != (_ref = null == runtimeInfo ? void 0 : runtimeInfo.title) ? _ref : title,
|
|
103
|
+
version: appVersion,
|
|
104
|
+
targetName: null != (_ref1 = null != (_ref2 = null != (_ref3 = null == runtimeInfo ? void 0 : runtimeInfo.platformId) ? _ref3 : null == branding ? void 0 : branding.targetName) ? _ref2 : deviceType) ? _ref1 : 'screen'
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
exports.buildConversationBranding = __webpack_exports__.buildConversationBranding;
|
|
108
|
+
exports.buildConversationConfig = __webpack_exports__.buildConversationConfig;
|
|
109
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
110
|
+
"buildConversationBranding",
|
|
111
|
+
"buildConversationConfig"
|
|
112
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
113
|
+
Object.defineProperty(exports, '__esModule', {
|
|
114
|
+
value: true
|
|
115
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
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 ("u" > 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
|
+
runSingleFlight: ()=>runSingleFlight
|
|
28
|
+
});
|
|
29
|
+
function runSingleFlight(pendingRef, task) {
|
|
30
|
+
if (pendingRef.current) return pendingRef.current;
|
|
31
|
+
const taskPromise = task();
|
|
32
|
+
const pendingState = {
|
|
33
|
+
promise: null
|
|
34
|
+
};
|
|
35
|
+
pendingState.promise = taskPromise.finally(()=>{
|
|
36
|
+
if (pendingRef.current === pendingState.promise) pendingRef.current = null;
|
|
37
|
+
});
|
|
38
|
+
pendingRef.current = pendingState.promise;
|
|
39
|
+
return pendingState.promise;
|
|
40
|
+
}
|
|
41
|
+
exports.runSingleFlight = __webpack_exports__.runSingleFlight;
|
|
42
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
|
+
"runSingleFlight"
|
|
44
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
|
+
Object.defineProperty(exports, '__esModule', {
|
|
46
|
+
value: true
|
|
47
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|