@blocklet/pages-kit 0.2.316 → 0.2.317
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/lib/cjs/builtin/async/ai-runtime/components/MarkdownRenderer.js +26 -2
- package/lib/cjs/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +22 -0
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/constants.js +34 -4
- package/lib/cjs/builtin/async/ai-runtime/contexts/ActiveAgent.js +28 -0
- package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +27 -0
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentMessage.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +10 -5
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +39 -0
- package/lib/cjs/builtin/async/ai-runtime/index.js +17 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +3 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +4 -6
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +60 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +50 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +30 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +13 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +46 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +2 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +26 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ShareView/index.js +16 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +25 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +73 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +58 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +33 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +23 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.js +20 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +26 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +28 -134
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +35 -9
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +54 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +1 -6
- package/lib/cjs/builtin/mui/material.js +4 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer.js +3 -2
- package/lib/esm/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +19 -0
- package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/constants.js +32 -3
- package/lib/esm/builtin/async/ai-runtime/contexts/ActiveAgent.js +23 -0
- package/lib/esm/builtin/async/ai-runtime/contexts/ComponentPreferences.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentMessage.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/hooks/use-appearances.js +10 -5
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +32 -0
- package/lib/esm/builtin/async/ai-runtime/index.js +8 -1
- package/lib/esm/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +3 -2
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +4 -6
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +54 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +44 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +24 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +7 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +40 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +1 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +20 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ShareView/index.js +10 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +44 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +30 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +27 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +18 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.js +14 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +20 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +25 -108
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +36 -10
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +48 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/state/runtime.js +1 -6
- package/lib/esm/builtin/mui/material.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/types/builtin/async/ai-runtime/components/OutputFieldContainer/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +14 -0
- package/lib/types/builtin/async/ai-runtime/contexts/ActiveAgent.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/contexts/ComponentPreferences.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/contexts/CurrentMessage.d.ts +6 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +4 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-header-menu.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/index.d.ts +8 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ImagesView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/MarkdownView/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ShareView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +13 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +0 -1
- package/lib/types/builtin/mui/material.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.js +0 -193
- package/lib/esm/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.js +0 -164
- package/lib/types/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.d.ts +0 -11
|
@@ -21,13 +21,13 @@ const react_wrap_balancer_1 = __importDefault(require("react-wrap-balancer"));
|
|
|
21
21
|
const CustomComponentRenderer_1 = __importDefault(require("../../../../../components/CustomComponentRenderer"));
|
|
22
22
|
const SimpleHeader_1 = __importDefault(require("../../components/Header/SimpleHeader"));
|
|
23
23
|
const SimpleLayout_1 = __importDefault(require("../../components/Layout/SimpleLayout"));
|
|
24
|
+
const ActiveAgent_1 = require("../../contexts/ActiveAgent");
|
|
24
25
|
const CurrentAgent_1 = __importDefault(require("../../contexts/CurrentAgent"));
|
|
25
26
|
const CurrentMessage_1 = __importDefault(require("../../contexts/CurrentMessage"));
|
|
26
27
|
const use_appearances_1 = __importDefault(require("../../hooks/use-appearances"));
|
|
27
|
-
const runtime_1 = require("../../state/runtime");
|
|
28
28
|
const session_1 = require("../../state/session");
|
|
29
29
|
function SimplePage({ resultTitle, primaryColor }) {
|
|
30
|
-
const {
|
|
30
|
+
const { activeAgentId } = (0, ActiveAgent_1.useActiveAgent)();
|
|
31
31
|
(0, session_1.useAutoLoadSessionState)();
|
|
32
32
|
const inheritedTheme = (0, material_1.useTheme)();
|
|
33
33
|
const theme = (0, react_1.useMemo)(() => {
|
|
@@ -47,7 +47,7 @@ function SimplePage({ resultTitle, primaryColor }) {
|
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
49
|
}, [inheritedTheme, primaryColor]);
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsxs)(SimpleLayout_1.default, { pb: 4, children: [(0, jsx_runtime_1.jsx)(SimpleHeader_1.default, {}), (0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId:
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsxs)(SimpleLayout_1.default, { pb: 4, children: [(0, jsx_runtime_1.jsx)(SimpleHeader_1.default, {}), (0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: activeAgentId, children: (0, jsx_runtime_1.jsx)(AgentInputRender, { className: "aigne-inputs aigne-simple-page-inputs" }) }), (0, jsx_runtime_1.jsx)(OutputView, { className: "aigne-outputs aigne-simple-page-outputs", resultTitle: resultTitle })] }) }));
|
|
51
51
|
}
|
|
52
52
|
exports.default = SimplePage;
|
|
53
53
|
function AgentInputRender(_a) {
|
|
@@ -55,7 +55,7 @@ function AgentInputRender(_a) {
|
|
|
55
55
|
const { appearanceInput } = (0, use_appearances_1.default)();
|
|
56
56
|
if (!(appearanceInput === null || appearanceInput === void 0 ? void 0 : appearanceInput.componentId))
|
|
57
57
|
return null;
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: appearanceInput.componentId, properties: appearanceInput.
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: appearanceInput.componentId, properties: appearanceInput.componentProperties }) })));
|
|
59
59
|
}
|
|
60
60
|
function OutputView(_a) {
|
|
61
61
|
var { resultTitle } = _a, props = __rest(_a, ["resultTitle"]);
|
|
@@ -66,5 +66,5 @@ const OutputItemView = (0, react_1.memo)(({ message }) => {
|
|
|
66
66
|
const { appearanceOutput } = (0, use_appearances_1.default)({ agentId: message.assistantId });
|
|
67
67
|
if (!(appearanceOutput === null || appearanceOutput === void 0 ? void 0 : appearanceOutput.componentId))
|
|
68
68
|
return null;
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: message.assistantId, children: (0, jsx_runtime_1.jsx)(CurrentMessage_1.default, { message: message, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: appearanceOutput.componentId, properties: appearanceOutput.
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: message.assistantId, children: (0, jsx_runtime_1.jsx)(CurrentMessage_1.default, { message: message, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: appearanceOutput.componentId, properties: appearanceOutput.componentProperties }) }) }) }));
|
|
70
70
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const material_1 = require("@mui/material");
|
|
19
|
+
const joi_1 = __importDefault(require("joi"));
|
|
20
|
+
const react_1 = require("react");
|
|
21
|
+
const OutputFieldContainer_1 = __importDefault(require("../../components/OutputFieldContainer"));
|
|
22
|
+
const CurrentAgent_1 = require("../../contexts/CurrentAgent");
|
|
23
|
+
const CurrentMessage_1 = require("../../contexts/CurrentMessage");
|
|
24
|
+
const runtime_1 = require("../../state/runtime");
|
|
25
|
+
const session_1 = require("../../state/session");
|
|
26
|
+
const suggestedQuestionsSchema = joi_1.default.array().items(joi_1.default.object({
|
|
27
|
+
question: joi_1.default.string().required(),
|
|
28
|
+
}));
|
|
29
|
+
function SuggestedQuestionsView({ output, outputValue, onlyLastMessage, }) {
|
|
30
|
+
var _a;
|
|
31
|
+
const { message } = (_a = (0, CurrentMessage_1.useCurrentMessage)({ optional: true })) !== null && _a !== void 0 ? _a : {};
|
|
32
|
+
const lastMessage = (0, session_1.useCurrentSessionState)((s) => { var _a; return (_a = s === null || s === void 0 ? void 0 : s.messages) === null || _a === void 0 ? void 0 : _a.at(-1); });
|
|
33
|
+
const isLastMessage = !!message && message.taskId === (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.taskId);
|
|
34
|
+
const questions = (0, react_1.useMemo)(() => {
|
|
35
|
+
const result = suggestedQuestionsSchema.validate(outputValue, { allowUnknown: true });
|
|
36
|
+
if (result.error)
|
|
37
|
+
return undefined;
|
|
38
|
+
return result.value;
|
|
39
|
+
}, [outputValue]);
|
|
40
|
+
const { aid } = (0, CurrentAgent_1.useCurrentAgent)();
|
|
41
|
+
const { execute } = (0, runtime_1.useRuntimeState)();
|
|
42
|
+
if (!message || (!isLastMessage && onlyLastMessage) || !(questions === null || questions === void 0 ? void 0 : questions.length))
|
|
43
|
+
return null;
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(OutputFieldContainer_1.default, { output: output, children: (0, jsx_runtime_1.jsx)(material_1.Stack, { gap: 1, children: questions.map((item) => ((0, jsx_runtime_1.jsx)(MessageSuggestedQuestion, { onClick: () => {
|
|
45
|
+
execute({ aid, parameters: Object.assign(Object.assign({}, message.parameters), { question: item.question }) });
|
|
46
|
+
}, children: item.question }, item.question))) }) }));
|
|
47
|
+
}
|
|
48
|
+
exports.default = SuggestedQuestionsView;
|
|
49
|
+
function MessageSuggestedQuestion(_a) {
|
|
50
|
+
var props = __rest(_a, []);
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, props, { sx: Object.assign({ display: 'inline-block', border: 1, borderColor: 'rgba(229, 231, 235, 1)', borderRadius: 1, py: 1, px: 2, cursor: 'pointer', '&:hover': {
|
|
52
|
+
backgroundColor: 'rgba(239, 246, 255, 1)',
|
|
53
|
+
} }, props.sx) })));
|
|
54
|
+
}
|
|
@@ -21,10 +21,10 @@ const dayjs_1 = __importDefault(require("dayjs"));
|
|
|
21
21
|
// import { Icon } from 'iconify/react';
|
|
22
22
|
const react_1 = require("react");
|
|
23
23
|
const CustomComponentRenderer_1 = __importDefault(require("../../../../../components/CustomComponentRenderer"));
|
|
24
|
+
const ActiveAgent_1 = require("../../contexts/ActiveAgent");
|
|
24
25
|
const CurrentAgent_1 = __importDefault(require("../../contexts/CurrentAgent"));
|
|
25
26
|
const CurrentMessage_1 = __importDefault(require("../../contexts/CurrentMessage"));
|
|
26
27
|
const use_appearances_1 = __importDefault(require("../../hooks/use-appearances"));
|
|
27
|
-
const runtime_1 = require("../../state/runtime");
|
|
28
28
|
const session_1 = require("../../state/session");
|
|
29
29
|
const getLineClamp = (count) => {
|
|
30
30
|
return {
|
|
@@ -57,7 +57,7 @@ function V0Page({ textColor = '#333', primaryColor }) {
|
|
|
57
57
|
}, [inheritedTheme, primaryColor, textColor]);
|
|
58
58
|
const [sessionId] = (0, react_1.useState)('1');
|
|
59
59
|
const [message, setMessage] = (0, react_1.useState)();
|
|
60
|
-
const {
|
|
60
|
+
const { activeAgentId } = (0, ActiveAgent_1.useActiveAgent)();
|
|
61
61
|
(0, session_1.useAutoLoadSessionState)();
|
|
62
62
|
const messagesList = (0, session_1.useCurrentSessionState)((s) => s === null || s === void 0 ? void 0 : s.messages);
|
|
63
63
|
(0, react_1.useEffect)(() => {
|
|
@@ -111,7 +111,7 @@ function V0Page({ textColor = '#333', primaryColor }) {
|
|
|
111
111
|
}
|
|
112
112
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, spacing: 2, justifyContent: "center", children: [...Array(3)].map((_, i) => ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, sm: 6, md: 4, children: (0, jsx_runtime_1.jsx)(material_1.Card, { sx: { backgroundColor: 'rgba(0, 0, 0, 0.5)', color: '#fff' }, children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: { mb: 1 }, children: `Code Snippet ${i + 1}` }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", display: "block", sx: { color: 'rgba(255, 255, 255, 0.7)' }, children: `This is history requirement ${i + 1}` })] }) }) }, i))) }) }));
|
|
113
113
|
}, [JSON.stringify(message)]);
|
|
114
|
-
return ((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId:
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: activeAgentId, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
115
115
|
display: 'flex',
|
|
116
116
|
// background: 'linear-gradient(135deg, #1a237e 0%, #3c3f41 100%)',
|
|
117
117
|
}, children: [(0, jsx_runtime_1.jsx)(SliderRender, { message: message }), (0, jsx_runtime_1.jsxs)(material_1.Container, { sx: {
|
|
@@ -135,12 +135,12 @@ function AgentInputRender(_a) {
|
|
|
135
135
|
const { appearanceInput } = (0, use_appearances_1.default)();
|
|
136
136
|
if (!(appearanceInput === null || appearanceInput === void 0 ? void 0 : appearanceInput.componentId))
|
|
137
137
|
return null;
|
|
138
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, Object.assign({ componentId: appearanceInput.componentId, properties: appearanceInput.
|
|
138
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, Object.assign({ componentId: appearanceInput.componentId, properties: appearanceInput.componentProperties }, props)) }));
|
|
139
139
|
}
|
|
140
140
|
function AgentOutputRender(_a) {
|
|
141
141
|
var { message } = _a, props = __rest(_a, ["message"]);
|
|
142
142
|
const { appearanceOutput } = (0, use_appearances_1.default)();
|
|
143
143
|
if (!(appearanceOutput === null || appearanceOutput === void 0 ? void 0 : appearanceOutput.componentId) || !message)
|
|
144
144
|
return null;
|
|
145
|
-
return ((0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: message.assistantId, children: (0, jsx_runtime_1.jsx)(CurrentMessage_1.default, { message: message, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, Object.assign({ componentId: appearanceOutput.componentId, properties: appearanceOutput.
|
|
145
|
+
return ((0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: message.assistantId, children: (0, jsx_runtime_1.jsx)(CurrentMessage_1.default, { message: message, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, Object.assign({ componentId: appearanceOutput.componentId, properties: appearanceOutput.componentProperties }, props)) }) }) }));
|
|
146
146
|
}
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.useRuntimeState = void 0;
|
|
13
|
-
const types_1 = require("@blocklet/ai-runtime/types");
|
|
14
13
|
const react_1 = require("react");
|
|
15
14
|
const session_1 = require("../../../session");
|
|
16
15
|
const Runtime_1 = require("../contexts/Runtime");
|
|
@@ -42,10 +41,6 @@ function useRuntimeState() {
|
|
|
42
41
|
}
|
|
43
42
|
return exec(Object.assign(Object.assign({}, args), { working }));
|
|
44
43
|
}), [authSession.user, exec, working, login]);
|
|
45
|
-
|
|
46
|
-
var _a, _b, _c, _d, _e, _f;
|
|
47
|
-
return ((_f = (_e = (_d = (_c = (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.children)) === null || _b === void 0 ? void 0 : _b.initialValue) === null || _c === void 0 ? void 0 : _c.agents) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : agent.id);
|
|
48
|
-
}, [agent]);
|
|
49
|
-
return { aid, working, agent, childAgentId, execute };
|
|
44
|
+
return { aid, working, agent, execute };
|
|
50
45
|
}
|
|
51
46
|
exports.useRuntimeState = useRuntimeState;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.useTheme = exports.useMediaQuery = exports.styled = exports.createTheme = void 0;
|
|
3
|
+
exports.Typography = exports.Tooltip = exports.ThemeProvider = exports.TextField = exports.Switch = exports.Stack = exports.Slide = exports.Popper = exports.Paper = exports.MenuList = exports.MenuItem = exports.Menu = exports.ListSubheader = exports.ListItemSecondaryAction = exports.ListItemIcon = exports.ListItemButton = exports.ListItemAvatar = exports.ListItem = exports.List = exports.Link = exports.LinearProgress = exports.Grow = exports.Grid = exports.GlobalStyles = exports.Fade = exports.Divider = exports.DialogTitle = exports.DialogContent = exports.DialogActions = exports.Dialog = exports.Container = exports.Collapse = exports.ClickAwayListener = exports.CircularProgress = exports.CardMedia = exports.CardHeader = exports.CardContent = exports.CardActions = exports.CardActionArea = exports.Card = exports.ButtonGroup = exports.IconButton = exports.Button = exports.Box = exports.Avatar = exports.Autocomplete = exports.AlertTitle = exports.Alert = exports.ListItemText = exports.Checkbox = void 0;
|
|
4
|
+
exports.useTheme = exports.useMediaQuery = exports.styled = exports.createTheme = exports.alpha = exports.Zoom = void 0;
|
|
5
5
|
var material_1 = require("@mui/material");
|
|
6
|
+
Object.defineProperty(exports, "Checkbox", { enumerable: true, get: function () { return material_1.Checkbox; } });
|
|
7
|
+
Object.defineProperty(exports, "ListItemText", { enumerable: true, get: function () { return material_1.ListItemText; } });
|
|
6
8
|
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return material_1.Alert; } });
|
|
7
9
|
Object.defineProperty(exports, "AlertTitle", { enumerable: true, get: function () { return material_1.AlertTitle; } });
|
|
8
10
|
Object.defineProperty(exports, "Autocomplete", { enumerable: true, get: function () { return material_1.Autocomplete; } });
|