@copilotkit/react-core 1.55.3-canary.1776243725 → 1.55.3-canary.1776979102
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/dist/{copilotkit-opur-20s.d.mts → copilotkit-3mXoM0Hd.d.mts} +9 -29
- package/dist/copilotkit-3mXoM0Hd.d.mts.map +1 -0
- package/dist/{copilotkit-EfopO2gn.d.cts → copilotkit-BDDjvB-p.d.cts} +9 -29
- package/dist/copilotkit-BDDjvB-p.d.cts.map +1 -0
- package/dist/{copilotkit-BoOnQHlE.cjs → copilotkit-BkcqmpWt.cjs} +162 -280
- package/dist/copilotkit-BkcqmpWt.cjs.map +1 -0
- package/dist/{copilotkit-Bm4ox8G0.mjs → copilotkit-C7n8Umv9.mjs} +164 -276
- package/dist/copilotkit-C7n8Umv9.mjs.map +1 -0
- package/dist/index.cjs +4 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +4 -9
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +143 -230
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.cjs +1 -2
- package/dist/v2/index.d.cts +2 -2
- package/dist/v2/index.d.mts +2 -2
- package/dist/v2/index.mjs +2 -2
- package/dist/v2/index.umd.js +165 -279
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/components/copilot-provider/copilot-messages.tsx +24 -39
- package/src/components/copilot-provider/copilotkit-props.tsx +5 -9
- package/src/components/copilot-provider/copilotkit.tsx +1 -4
- package/src/hooks/__tests__/use-copilot-chat-internal-connect.test.tsx +16 -27
- package/src/hooks/use-copilot-chat_internal.ts +4 -15
- package/src/v2/__tests__/utils/test-helpers.tsx +7 -40
- package/src/v2/components/chat/CopilotChat.tsx +1 -1
- package/src/v2/components/chat/CopilotChatAssistantMessage.tsx +15 -18
- package/src/v2/components/chat/CopilotChatMessageView.tsx +2 -7
- package/src/v2/components/chat/CopilotChatReasoningMessage.tsx +4 -17
- package/src/v2/components/chat/CopilotChatUserMessage.tsx +10 -13
- package/src/v2/components/chat/__tests__/CopilotChat.e2e.test.tsx +5 -131
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.tsx +0 -60
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.tsx +1 -1
- package/src/v2/components/chat/__tests__/CopilotChatToolRendering.e2e.test.tsx +2 -5
- package/src/v2/components/chat/__tests__/CopilotChatToolRerenders.e2e.test.tsx +2 -5
- package/src/v2/components/chat/__tests__/MCPAppsActivityRenderer.e2e.test.tsx +1 -55
- package/src/v2/hooks/__tests__/use-agent-context-timing.e2e.test.tsx +0 -8
- package/src/v2/hooks/__tests__/use-agent-throttle.test.tsx +10 -10
- package/src/v2/hooks/__tests__/use-agent.e2e.test.tsx +2 -13
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.tsx +4 -23
- package/src/v2/hooks/index.ts +0 -1
- package/src/v2/hooks/use-agent.tsx +10 -157
- package/src/v2/hooks/use-render-activity-message.tsx +3 -9
- package/src/v2/hooks/use-render-custom-messages.tsx +1 -6
- package/src/v2/providers/CopilotKitProvider.tsx +2 -6
- package/dist/copilotkit-Bm4ox8G0.mjs.map +0 -1
- package/dist/copilotkit-BoOnQHlE.cjs.map +0 -1
- package/dist/copilotkit-EfopO2gn.d.cts.map +0 -1
- package/dist/copilotkit-opur-20s.d.mts.map +0 -1
- package/src/components/copilot-provider/__tests__/error-visibility-prod.test.tsx +0 -70
- package/src/v2/components/chat/__tests__/CopilotChatCopyButton.clipboard.test.tsx +0 -241
- package/src/v2/hooks/__tests__/use-agent-thread-isolation.test.tsx +0 -327
- package/src/v2/hooks/__tests__/use-capabilities.test.tsx +0 -76
- package/src/v2/hooks/use-capabilities.tsx +0 -25
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_copilotkit = require('./copilotkit-
|
|
4
|
+
const require_copilotkit = require('./copilotkit-BkcqmpWt.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_copilotkit.__toESM(react);
|
|
7
7
|
let _copilotkit_core = require("@copilotkit/core");
|
|
@@ -42,11 +42,7 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
|
|
|
42
42
|
const existingConfig = require_copilotkit.useCopilotChatConfiguration();
|
|
43
43
|
const [agentAvailable, setAgentAvailable] = (0, react.useState)(false);
|
|
44
44
|
const resolvedAgentId = existingConfig?.agentId ?? "default";
|
|
45
|
-
const { agent } = require_copilotkit.useAgent({
|
|
46
|
-
agentId: resolvedAgentId,
|
|
47
|
-
threadId: existingConfig?.threadId
|
|
48
|
-
});
|
|
49
|
-
const lastConnectedAgentRef = (0, react.useRef)(null);
|
|
45
|
+
const { agent } = require_copilotkit.useAgent({ agentId: resolvedAgentId });
|
|
50
46
|
(0, react.useEffect)(() => {
|
|
51
47
|
let detached = false;
|
|
52
48
|
const connectAbortController = new AbortController();
|
|
@@ -61,12 +57,11 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
|
|
|
61
57
|
if (error instanceof _ag_ui_client.AGUIConnectNotImplementedError) {} else console.error("CopilotChat: connectAgent failed", error);
|
|
62
58
|
}
|
|
63
59
|
};
|
|
64
|
-
if (agent && agent !==
|
|
65
|
-
|
|
60
|
+
if (agent && existingConfig?.threadId && agent.threadId !== existingConfig.threadId && copilotkit.runtimeConnectionStatus === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected) {
|
|
61
|
+
agent.threadId = existingConfig.threadId;
|
|
66
62
|
connect(agent);
|
|
67
63
|
}
|
|
68
64
|
return () => {
|
|
69
|
-
lastConnectedAgentRef.current = null;
|
|
70
65
|
detached = true;
|
|
71
66
|
connectAbortController.abort();
|
|
72
67
|
agent?.detachActiveRun();
|