@copilotkit/react-ui 1.3.3 → 1.3.5-pre-1-3-4.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.
- package/CHANGELOG.md +20 -0
- package/dist/{chunk-UUHCZZZV.mjs → chunk-3CQ72Y7E.mjs} +2 -2
- package/dist/{chunk-GHMYWL42.mjs → chunk-FRFXYFEH.mjs} +2 -2
- package/dist/{chunk-I4QG2ZZU.mjs → chunk-LT5YTQ4F.mjs} +2 -2
- package/dist/{chunk-I4QG2ZZU.mjs.map → chunk-LT5YTQ4F.mjs.map} +1 -1
- package/dist/{chunk-U42OB2S3.mjs → chunk-N4JRGTUJ.mjs} +6 -1
- package/dist/chunk-N4JRGTUJ.mjs.map +1 -0
- package/dist/{chunk-3YESXHJH.mjs → chunk-P4N6EWUO.mjs} +2 -2
- package/dist/{chunk-BTOVRBBW.mjs → chunk-U7CXOZEV.mjs} +4 -4
- package/dist/{chunk-BTOVRBBW.mjs.map → chunk-U7CXOZEV.mjs.map} +1 -1
- package/dist/components/chat/Chat.js +7 -2
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +3 -3
- package/dist/components/chat/Modal.js +7 -2
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +4 -4
- package/dist/components/chat/Popup.js +7 -2
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +5 -5
- package/dist/components/chat/Sidebar.js +7 -2
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +5 -5
- package/dist/components/chat/index.js +7 -2
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +6 -6
- package/dist/components/chat/messages/RenderAgentStateMessage.js +5 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +1 -1
- package/dist/components/dev-console/console.js +1 -1
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +1 -1
- package/dist/components/dev-console/index.js +1 -1
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +1 -1
- package/dist/components/index.js +7 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -6
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +7 -7
- package/src/components/chat/Chat.tsx +4 -3
- package/src/components/chat/messages/RenderAgentStateMessage.tsx +10 -0
- package/src/components/dev-console/console.tsx +1 -1
- package/dist/chunk-U42OB2S3.mjs.map +0 -1
- /package/dist/{chunk-UUHCZZZV.mjs.map → chunk-3CQ72Y7E.mjs.map} +0 -0
- /package/dist/{chunk-GHMYWL42.mjs.map → chunk-FRFXYFEH.mjs.map} +0 -0
- /package/dist/{chunk-3YESXHJH.mjs.map → chunk-P4N6EWUO.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -4,25 +4,25 @@ import "./chunk-JD7BAH7U.mjs";
|
|
|
4
4
|
import "./chunk-MRFF7GSQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CopilotSidebar
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3CQ72Y7E.mjs";
|
|
8
8
|
import "./chunk-WB3YULQ4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CopilotPopup
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-FRFXYFEH.mjs";
|
|
12
|
+
import "./chunk-P4N6EWUO.mjs";
|
|
13
13
|
import "./chunk-FO7Z5LAL.mjs";
|
|
14
14
|
import "./chunk-FLV3J3VX.mjs";
|
|
15
15
|
import "./chunk-YOH25I6N.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotChat
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-U7CXOZEV.mjs";
|
|
19
19
|
import "./chunk-V7W6IM2V.mjs";
|
|
20
20
|
import "./chunk-YH2STM73.mjs";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-N4JRGTUJ.mjs";
|
|
22
22
|
import "./chunk-GOTHQ665.mjs";
|
|
23
23
|
import "./chunk-MA5B5ELM.mjs";
|
|
24
24
|
import "./chunk-WCPLXRZX.mjs";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-LT5YTQ4F.mjs";
|
|
26
26
|
import "./chunk-H7TM5JE6.mjs";
|
|
27
27
|
import "./chunk-OTPAZXVR.mjs";
|
|
28
28
|
import "./chunk-U6J5DGOE.mjs";
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.3.3",
|
|
12
|
+
"version": "1.3.5-pre-1-3-4.0",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"ts-jest": "^29.1.1",
|
|
41
41
|
"tsup": "^6.7.0",
|
|
42
42
|
"typescript": "^5.2.3",
|
|
43
|
-
"eslint-config-custom": "1.3.3",
|
|
44
|
-
"tailwind-config": "1.3.3",
|
|
45
|
-
"tsconfig": "1.3.3"
|
|
43
|
+
"eslint-config-custom": "1.3.5-pre-1-3-4.0",
|
|
44
|
+
"tailwind-config": "1.3.5-pre-1-3-4.0",
|
|
45
|
+
"tsconfig": "1.3.5-pre-1-3-4.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@headlessui/react": "^2.1.3",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/react-core": "1.3.3",
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.3.3",
|
|
55
|
-
"@copilotkit/shared": "1.3.3"
|
|
53
|
+
"@copilotkit/react-core": "1.3.5-pre-1-3-4.0",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.3.5-pre-1-3-4.0",
|
|
55
|
+
"@copilotkit/shared": "1.3.5-pre-1-3-4.0"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -318,9 +318,6 @@ export const useCopilotChatLogic = (
|
|
|
318
318
|
role: Role.User,
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
-
// Append the message immediately to make it visible
|
|
322
|
-
appendMessage(message);
|
|
323
|
-
|
|
324
321
|
if (onSubmitMessage) {
|
|
325
322
|
try {
|
|
326
323
|
await onSubmitMessage(messageContent);
|
|
@@ -328,6 +325,10 @@ export const useCopilotChatLogic = (
|
|
|
328
325
|
console.error("Error in onSubmitMessage:", error);
|
|
329
326
|
}
|
|
330
327
|
}
|
|
328
|
+
// this needs to happen after onSubmitMessage, because it will trigger submission
|
|
329
|
+
// of the message to the endpoint. Some users depend on performing some actions
|
|
330
|
+
// before the message is submitted.
|
|
331
|
+
appendMessage(message);
|
|
331
332
|
|
|
332
333
|
return message;
|
|
333
334
|
};
|
|
@@ -50,6 +50,16 @@ export function RenderAgentStateMessage(props: RenderMessageProps) {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
54
|
+
return (
|
|
55
|
+
<div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>
|
|
56
|
+
{icons.spinnerIcon}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
} else if (!toRender) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
53
63
|
if (typeof toRender === "string") {
|
|
54
64
|
return (
|
|
55
65
|
<div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>
|
|
@@ -229,7 +229,7 @@ export default function DebugMenuButton({
|
|
|
229
229
|
const context = useCopilotContext();
|
|
230
230
|
|
|
231
231
|
return (
|
|
232
|
-
<div className="bg-black
|
|
232
|
+
<div className="bg-black top-24 w-52 text-right">
|
|
233
233
|
<Menu>
|
|
234
234
|
<MenuButton className={`copilotKitDebugMenuButton ${mode === "compact" ? "compact" : ""}`}>
|
|
235
235
|
{mode == "compact" ? "Debug" : <>Debug {ChevronDownIcon}</>}
|
|
@@ -1 +0,0 @@
|
|
|
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.coagentActions[`${message.agentName}-${message.nodeName}`] ||\n chatComponentsCache.current.coagentActions[`${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 (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;AAsBnD,SACsB,KADtB;AApBL,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,eAAe,GAAG,QAAQ,aAAa,QAAQ,UAAU,KACrF,oBAAoB,QAAQ,eAAe,GAAG,QAAQ,kBAAkB;AAAA,IAC5E;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,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":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|