@copilotkit/react-ui 1.3.13 → 1.3.14
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/CHANGELOG.md +10 -0
- package/dist/{chunk-47OPG5FM.mjs → chunk-3EYL2DRG.mjs} +3 -3
- package/dist/{chunk-KCAVDFB6.mjs → chunk-3JNDMHS4.mjs} +2 -2
- package/dist/{chunk-JTINVYPK.mjs → chunk-4LUMV4YO.mjs} +11 -2
- package/dist/{chunk-JTINVYPK.mjs.map → chunk-4LUMV4YO.mjs.map} +1 -1
- package/dist/{chunk-SWADR6EH.mjs → chunk-AX7CAT7V.mjs} +2 -2
- package/dist/{chunk-3KBQXU44.mjs → chunk-NLIDKNNS.mjs} +5 -5
- package/dist/{chunk-6BL5C56L.mjs → chunk-OMTPWC7T.mjs} +10 -2
- package/dist/chunk-OMTPWC7T.mjs.map +1 -0
- package/dist/{chunk-KFQYJ5R5.mjs → chunk-RJCZRKTV.mjs} +3 -3
- package/dist/chunk-RJCZRKTV.mjs.map +1 -0
- package/dist/chunk-RU73BEZM.mjs +41 -0
- package/dist/chunk-RU73BEZM.mjs.map +1 -0
- package/dist/components/chat/Chat.js +39 -6
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +5 -5
- package/dist/components/chat/Input.js +10 -1
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Modal.js +39 -6
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +6 -6
- package/dist/components/chat/Popup.js +39 -6
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +7 -7
- package/dist/components/chat/Sidebar.js +39 -6
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +7 -7
- package/dist/components/chat/Suggestion.js +2 -2
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +1 -1
- package/dist/components/chat/index.js +39 -6
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +8 -8
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +9 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
- package/dist/components/chat/messages/RenderTextMessage.js +18 -2
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +1 -1
- package/dist/components/index.js +39 -6
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +8 -8
- package/dist/index.js +39 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/package.json +7 -7
- package/src/components/chat/Input.tsx +6 -1
- package/src/components/chat/Suggestion.tsx +7 -3
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +5 -1
- package/src/components/chat/messages/RenderTextMessage.tsx +10 -2
- package/dist/chunk-6BL5C56L.mjs.map +0 -1
- package/dist/chunk-KFQYJ5R5.mjs.map +0 -1
- package/dist/chunk-WYMTXCQU.mjs +0 -25
- package/dist/chunk-WYMTXCQU.mjs.map +0 -1
- /package/dist/{chunk-47OPG5FM.mjs.map → chunk-3EYL2DRG.mjs.map} +0 -0
- /package/dist/{chunk-KCAVDFB6.mjs.map → chunk-3JNDMHS4.mjs.map} +0 -0
- /package/dist/{chunk-SWADR6EH.mjs.map → chunk-AX7CAT7V.mjs.map} +0 -0
- /package/dist/{chunk-3KBQXU44.mjs.map → chunk-NLIDKNNS.mjs.map} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-3EYL2DRG.mjs";
|
|
4
4
|
import "../../chunk-YAGE7RCE.mjs";
|
|
5
5
|
import "../../chunk-VEC45H6Q.mjs";
|
|
6
6
|
import "../../chunk-RQNJNK2W.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-NLIDKNNS.mjs";
|
|
8
8
|
import "../../chunk-V7W6IM2V.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-OMTPWC7T.mjs";
|
|
10
10
|
import "../../chunk-ZABXREBH.mjs";
|
|
11
11
|
import "../../chunk-6INMITFA.mjs";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-RU73BEZM.mjs";
|
|
13
|
+
import "../../chunk-RJCZRKTV.mjs";
|
|
14
14
|
import "../../chunk-RS6UPR5N.mjs";
|
|
15
15
|
import "../../chunk-4FIGRRFS.mjs";
|
|
16
16
|
import "../../chunk-OTPAZXVR.mjs";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-4LUMV4YO.mjs";
|
|
18
18
|
import "../../chunk-YQFVRDNC.mjs";
|
|
19
19
|
import "../../chunk-YQ3D5IQV.mjs";
|
|
20
20
|
import "../../chunk-CPMIEVKK.mjs";
|
|
@@ -856,7 +856,16 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
856
856
|
children: context.icons.pushToTalkIcon
|
|
857
857
|
}
|
|
858
858
|
),
|
|
859
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
860
|
+
"button",
|
|
861
|
+
{
|
|
862
|
+
disabled: sendDisabled,
|
|
863
|
+
onClick: send,
|
|
864
|
+
"data-copilotkit-in-progress": !!inProgress,
|
|
865
|
+
"data-testid": inProgress ? "copilot-chat-request-in-progress" : void 0,
|
|
866
|
+
children: sendIcon
|
|
867
|
+
}
|
|
868
|
+
)
|
|
860
869
|
] })
|
|
861
870
|
] });
|
|
862
871
|
};
|
|
@@ -1346,9 +1355,25 @@ function RenderTextMessage(props) {
|
|
|
1346
1355
|
const { icons } = useChatContext();
|
|
1347
1356
|
if (message.isTextMessage()) {
|
|
1348
1357
|
if (message.role === "user") {
|
|
1349
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1359
|
+
"div",
|
|
1360
|
+
{
|
|
1361
|
+
"data-message-role": "user",
|
|
1362
|
+
className: "copilotKitMessage copilotKitUserMessage",
|
|
1363
|
+
children: message.content
|
|
1364
|
+
},
|
|
1365
|
+
index
|
|
1366
|
+
);
|
|
1350
1367
|
} else if (message.role == "assistant") {
|
|
1351
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1369
|
+
"div",
|
|
1370
|
+
{
|
|
1371
|
+
"data-message-role": "assistant",
|
|
1372
|
+
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1373
|
+
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Markdown, { content: message.content })
|
|
1374
|
+
},
|
|
1375
|
+
index
|
|
1376
|
+
);
|
|
1352
1377
|
}
|
|
1353
1378
|
}
|
|
1354
1379
|
}
|
|
@@ -1398,7 +1423,15 @@ function RenderActionExecutionMessage(props) {
|
|
|
1398
1423
|
toRender
|
|
1399
1424
|
] }, index);
|
|
1400
1425
|
} else {
|
|
1401
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1427
|
+
"div",
|
|
1428
|
+
{
|
|
1429
|
+
"data-message-type": "action-render",
|
|
1430
|
+
className: "copilotKitCustomAssistantMessage",
|
|
1431
|
+
children: toRender
|
|
1432
|
+
},
|
|
1433
|
+
index
|
|
1434
|
+
);
|
|
1402
1435
|
}
|
|
1403
1436
|
} catch (e) {
|
|
1404
1437
|
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
@@ -1525,8 +1558,8 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
1525
1558
|
const numOfSuggestionsInstructions = config.minSuggestions === 0 ? `Produce up to ${config.maxSuggestions} suggestions. If there are no highly relevant suggestions you can think of, provide an empty array.` : `Produce between ${config.minSuggestions} and ${config.maxSuggestions} suggestions.`;
|
|
1526
1559
|
const result = yield (0, import_react_core5.extract)({
|
|
1527
1560
|
context,
|
|
1528
|
-
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls. "
|
|
1529
|
-
data: "
|
|
1561
|
+
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls. ",
|
|
1562
|
+
data: config.instructions + "\n\n" + numOfSuggestionsInstructions + "\n\nAvailable tools: " + tools + "\n\n",
|
|
1530
1563
|
requestType: import_runtime_client_gql3.CopilotRequestType.Task,
|
|
1531
1564
|
parameters: [
|
|
1532
1565
|
{
|