@copilotkit/react-ui 1.6.0-next.9 → 1.7.0-next.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/{chunk-FUFTTTA3.mjs → chunk-2C3ANQCY.mjs} +14 -4
  3. package/dist/chunk-2C3ANQCY.mjs.map +1 -0
  4. package/dist/{chunk-CU525PBJ.mjs → chunk-3PJA5MFR.mjs} +2 -2
  5. package/dist/{chunk-UGTFROVP.mjs → chunk-ADTTDBLB.mjs} +2 -2
  6. package/dist/{chunk-UY34ERRQ.mjs → chunk-AZU4QOV5.mjs} +2 -2
  7. package/dist/components/chat/Chat.js +13 -3
  8. package/dist/components/chat/Chat.js.map +1 -1
  9. package/dist/components/chat/Chat.mjs +1 -1
  10. package/dist/components/chat/Modal.js +13 -3
  11. package/dist/components/chat/Modal.js.map +1 -1
  12. package/dist/components/chat/Modal.mjs +2 -2
  13. package/dist/components/chat/Popup.js +13 -3
  14. package/dist/components/chat/Popup.js.map +1 -1
  15. package/dist/components/chat/Popup.mjs +3 -3
  16. package/dist/components/chat/Sidebar.js +13 -3
  17. package/dist/components/chat/Sidebar.js.map +1 -1
  18. package/dist/components/chat/Sidebar.mjs +3 -3
  19. package/dist/components/chat/index.js +13 -3
  20. package/dist/components/chat/index.js.map +1 -1
  21. package/dist/components/chat/index.mjs +4 -4
  22. package/dist/components/index.js +13 -3
  23. package/dist/components/index.js.map +1 -1
  24. package/dist/components/index.mjs +4 -4
  25. package/dist/index.js +13 -3
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +4 -4
  28. package/package.json +4 -4
  29. package/src/components/chat/Chat.tsx +24 -4
  30. package/dist/chunk-FUFTTTA3.mjs.map +0 -1
  31. /package/dist/{chunk-CU525PBJ.mjs.map → chunk-3PJA5MFR.mjs.map} +0 -0
  32. /package/dist/{chunk-UGTFROVP.mjs.map → chunk-ADTTDBLB.mjs.map} +0 -0
  33. /package/dist/{chunk-UY34ERRQ.mjs.map → chunk-AZU4QOV5.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "../../chunk-UY34ERRQ.mjs";
3
+ } from "../../chunk-AZU4QOV5.mjs";
4
4
  import "../../chunk-YAGE7RCE.mjs";
5
5
  import "../../chunk-VEC45H6Q.mjs";
6
6
  import "../../chunk-RQNJNK2W.mjs";
7
- import "../../chunk-FUFTTTA3.mjs";
7
+ import "../../chunk-2C3ANQCY.mjs";
8
8
  import "../../chunk-UWWMAJ7R.mjs";
9
9
  import "../../chunk-WEYDZBT7.mjs";
10
10
  import "../../chunk-OFYI4UU4.mjs";
@@ -2448,10 +2448,20 @@ function CopilotChat({
2448
2448
  AssistantMessage: AssistantMessage2 = AssistantMessage,
2449
2449
  UserMessage: UserMessage2 = UserMessage
2450
2450
  }) {
2451
- const context = (0, import_react_core9.useCopilotContext)();
2451
+ const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
2452
2452
  (0, import_react12.useEffect)(() => {
2453
- context.setChatInstructions(instructions || "");
2454
- }, [instructions]);
2453
+ if (!(additionalInstructions == null ? void 0 : additionalInstructions.length)) {
2454
+ setChatInstructions(instructions || "");
2455
+ return;
2456
+ }
2457
+ const combinedAdditionalInstructions = [
2458
+ instructions,
2459
+ "Additionally, follow these instructions:",
2460
+ ...additionalInstructions.map((instruction) => `- ${instruction}`)
2461
+ ];
2462
+ console.log("combinedAdditionalInstructions", combinedAdditionalInstructions);
2463
+ setChatInstructions(combinedAdditionalInstructions.join("\n") || "");
2464
+ }, [instructions, additionalInstructions]);
2455
2465
  const {
2456
2466
  visibleMessages,
2457
2467
  isLoading,