@copilotkit/react-ui 1.3.5 → 1.3.6-pre-1-3-6.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 (38) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-U7CXOZEV.mjs → chunk-HIX4HRWU.mjs} +2 -2
  3. package/dist/{chunk-3CQ72Y7E.mjs → chunk-P47XGGRX.mjs} +2 -2
  4. package/dist/{chunk-N4JRGTUJ.mjs → chunk-RF3KLUPD.mjs} +2 -2
  5. package/dist/chunk-RF3KLUPD.mjs.map +1 -0
  6. package/dist/{chunk-P4N6EWUO.mjs → chunk-SPZEI5EN.mjs} +2 -2
  7. package/dist/{chunk-FRFXYFEH.mjs → chunk-TSQVQAAC.mjs} +2 -2
  8. package/dist/components/chat/Chat.js +1 -1
  9. package/dist/components/chat/Chat.js.map +1 -1
  10. package/dist/components/chat/Chat.mjs +2 -2
  11. package/dist/components/chat/Modal.js +1 -1
  12. package/dist/components/chat/Modal.js.map +1 -1
  13. package/dist/components/chat/Modal.mjs +3 -3
  14. package/dist/components/chat/Popup.js +1 -1
  15. package/dist/components/chat/Popup.js.map +1 -1
  16. package/dist/components/chat/Popup.mjs +4 -4
  17. package/dist/components/chat/Sidebar.js +1 -1
  18. package/dist/components/chat/Sidebar.js.map +1 -1
  19. package/dist/components/chat/Sidebar.mjs +4 -4
  20. package/dist/components/chat/index.js +1 -1
  21. package/dist/components/chat/index.js.map +1 -1
  22. package/dist/components/chat/index.mjs +5 -5
  23. package/dist/components/chat/messages/RenderAgentStateMessage.js +1 -1
  24. package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -1
  25. package/dist/components/chat/messages/RenderAgentStateMessage.mjs +1 -1
  26. package/dist/components/index.js +1 -1
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/index.mjs +5 -5
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +5 -5
  32. package/package.json +7 -7
  33. package/src/components/chat/messages/RenderAgentStateMessage.tsx +3 -2
  34. package/dist/chunk-N4JRGTUJ.mjs.map +0 -1
  35. /package/dist/{chunk-U7CXOZEV.mjs.map → chunk-HIX4HRWU.mjs.map} +0 -0
  36. /package/dist/{chunk-3CQ72Y7E.mjs.map → chunk-P47XGGRX.mjs.map} +0 -0
  37. /package/dist/{chunk-P4N6EWUO.mjs.map → chunk-SPZEI5EN.mjs.map} +0 -0
  38. /package/dist/{chunk-FRFXYFEH.mjs.map → chunk-TSQVQAAC.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # ui
2
2
 
3
+ ## 1.3.6-pre-1-3-6.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Rename useCoAgentStateRender
8
+ - Updated dependencies
9
+ - @copilotkit/react-core@1.3.6-pre-1-3-6.0
10
+ - @copilotkit/runtime-client-gql@1.3.6-pre-1-3-6.0
11
+ - @copilotkit/shared@1.3.6-pre-1-3-6.0
12
+
3
13
  ## 1.3.5
4
14
 
5
15
  ### Patch Changes
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YH2STM73.mjs";
4
4
  import {
5
5
  RenderAgentStateMessage
6
- } from "./chunk-N4JRGTUJ.mjs";
6
+ } from "./chunk-RF3KLUPD.mjs";
7
7
  import {
8
8
  RenderResultMessage
9
9
  } from "./chunk-GOTHQ665.mjs";
@@ -191,4 +191,4 @@ export {
191
191
  WrappedCopilotChat,
192
192
  useCopilotChatLogic
193
193
  };
194
- //# sourceMappingURL=chunk-U7CXOZEV.mjs.map
194
+ //# sourceMappingURL=chunk-HIX4HRWU.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "./chunk-P4N6EWUO.mjs";
3
+ } from "./chunk-SPZEI5EN.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -27,4 +27,4 @@ function CopilotSidebar(props) {
27
27
  export {
28
28
  CopilotSidebar
29
29
  };
30
- //# sourceMappingURL=chunk-3CQ72Y7E.mjs.map
30
+ //# sourceMappingURL=chunk-P47XGGRX.mjs.map
@@ -13,7 +13,7 @@ function RenderAgentStateMessage(props) {
13
13
  if (message instanceof AgentStateMessage) {
14
14
  let render;
15
15
  if (chatComponentsCache.current !== null) {
16
- render = chatComponentsCache.current.coagentActions[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coagentActions[`${message.agentName}-global`];
16
+ render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
17
17
  }
18
18
  if (render) {
19
19
  if (typeof render === "string") {
@@ -63,4 +63,4 @@ function RenderAgentStateMessage(props) {
63
63
  export {
64
64
  RenderAgentStateMessage
65
65
  };
66
- //# sourceMappingURL=chunk-N4JRGTUJ.mjs.map
66
+ //# sourceMappingURL=chunk-RF3KLUPD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/chat/messages/RenderAgentStateMessage.tsx"],"sourcesContent":["import { AgentStateMessage } from \"@copilotkit/runtime-client-gql\";\nimport { RenderMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { CoagentInChatRenderFunction, useCopilotContext } from \"@copilotkit/react-core\";\n\nexport function RenderAgentStateMessage(props: RenderMessageProps) {\n const { message, inProgress, index, isCurrentMessage } = props;\n const { chatComponentsCache } = useCopilotContext();\n const { icons } = useChatContext();\n\n if (message instanceof AgentStateMessage) {\n let render: string | CoagentInChatRenderFunction | undefined;\n\n if (chatComponentsCache.current !== null) {\n render =\n chatComponentsCache.current.coAgentStateRenders[\n `${message.agentName}-${message.nodeName}`\n ] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];\n }\n\n if (render) {\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon} <span className=\"inProgressLabel\">{render}</span>\n </div>\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const state = message.state;\n\n let status = message.active ? \"inProgress\" : \"complete\";\n\n const toRender = render({\n status: status as any,\n state,\n nodeName: message.nodeName,\n });\n\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n\n if (!toRender && isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon}\n </div>\n );\n } else if (!toRender) {\n return null;\n }\n\n if (typeof toRender === \"string\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && icons.spinnerIcon} {toRender}\n </div>\n );\n } else {\n return (\n <div key={index} className=\"copilotKitCustomAssistantMessage\">\n {toRender}\n </div>\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon}\n </div>\n );\n }\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,yBAAyB;AAGlC,SAAsC,yBAAyB;AAuBnD,SACsB,KADtB;AArBL,SAAS,wBAAwB,OAA2B;AACjE,QAAM,EAAE,SAAS,YAAY,OAAO,iBAAiB,IAAI;AACzD,QAAM,EAAE,oBAAoB,IAAI,kBAAkB;AAClD,QAAM,EAAE,MAAM,IAAI,eAAe;AAEjC,MAAI,mBAAmB,mBAAmB;AACxC,QAAI;AAEJ,QAAI,oBAAoB,YAAY,MAAM;AACxC,eACE,oBAAoB,QAAQ,oBAC1B,GAAG,QAAQ,aAAa,QAAQ,UAClC,KAAK,oBAAoB,QAAQ,oBAAoB,GAAG,QAAQ,kBAAkB;AAAA,IACtF;AAEA,QAAI,QAAQ;AAEV,UAAI,OAAO,WAAW,UAAU;AAE9B,YAAI,oBAAoB,YAAY;AAClC,iBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,kBAAM;AAAA,YAAY;AAAA,YAAC,oBAAC,UAAK,WAAU,mBAAmB,kBAAO;AAAA,eADtD,KAEV;AAAA,QAEJ,OAEK;AACH,iBAAO;AAAA,QACT;AAAA,MACF,OAEK;AACH,cAAM,QAAQ,QAAQ;AAEtB,YAAI,SAAS,QAAQ,SAAS,eAAe;AAE7C,cAAM,WAAW,OAAO;AAAA,UACtB;AAAA,UACA;AAAA,UACA,UAAU,QAAQ;AAAA,QACpB,CAAC;AAGD,YAAI,CAAC,YAAY,WAAW,YAAY;AACtC,iBAAO;AAAA,QACT;AAEA,YAAI,CAAC,YAAY,oBAAoB,YAAY;AAC/C,iBACE,oBAAC,SAAgB,WAAW,gDACzB,gBAAM,eADC,KAEV;AAAA,QAEJ,WAAW,CAAC,UAAU;AACpB,iBAAO;AAAA,QACT;AAEA,YAAI,OAAO,aAAa,UAAU;AAChC,iBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,gCAAoB,cAAc,MAAM;AAAA,YAAY;AAAA,YAAE;AAAA,eAD/C,KAEV;AAAA,QAEJ,OAAO;AACL,iBACE,oBAAC,SAAgB,WAAU,oCACxB,sBADO,KAEV;AAAA,QAEJ;AAAA,MACF;AAAA,IACF,WAES,CAAC,cAAc,CAAC,kBAAkB;AAEzC,aAAO;AAAA,IACT,OAAO;AAEL,aACE,oBAAC,SAAgB,WAAW,gDACzB,gBAAM,eADC,KAEV;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-YOH25I6N.mjs";
10
10
  import {
11
11
  CopilotChat
12
- } from "./chunk-U7CXOZEV.mjs";
12
+ } from "./chunk-HIX4HRWU.mjs";
13
13
  import {
14
14
  Input
15
15
  } from "./chunk-U6J5DGOE.mjs";
@@ -88,4 +88,4 @@ var CopilotModal = ({
88
88
  export {
89
89
  CopilotModal
90
90
  };
91
- //# sourceMappingURL=chunk-P4N6EWUO.mjs.map
91
+ //# sourceMappingURL=chunk-SPZEI5EN.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "./chunk-P4N6EWUO.mjs";
3
+ } from "./chunk-SPZEI5EN.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -18,4 +18,4 @@ function CopilotPopup(props) {
18
18
  export {
19
19
  CopilotPopup
20
20
  };
21
- //# sourceMappingURL=chunk-FRFXYFEH.mjs.map
21
+ //# sourceMappingURL=chunk-TSQVQAAC.mjs.map
@@ -1296,7 +1296,7 @@ function RenderAgentStateMessage(props) {
1296
1296
  if (message instanceof import_runtime_client_gql6.AgentStateMessage) {
1297
1297
  let render;
1298
1298
  if (chatComponentsCache.current !== null) {
1299
- render = chatComponentsCache.current.coagentActions[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coagentActions[`${message.agentName}-global`];
1299
+ render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
1300
1300
  }
1301
1301
  if (render) {
1302
1302
  if (typeof render === "string") {