@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.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as CoagentInChatRenderFunction, An as FrontendActionAvailability, Cn as ActionRenderProps, Dn as CatchAllActionRenderProps, En as ActionRenderPropsWait, M as useAgent, On as CatchAllFrontendAction, Sn as TreeNode, Tn as ActionRenderPropsNoArgsWait, Z as useRenderToolCall$1, _n as CrewsToolStateItem, an as LangGraphInterruptAction, bn as DocumentPointer, cn as LangGraphInterruptRender, dn as QueuedInterruptEvent, en as CopilotApiConfig, fn as CrewsAgentState, gn as CrewsTaskStateItem, hn as CrewsStateItem, in as CoAgentStateRender, jn as RenderFunctionStatus, kn as FrontendAction, ln as LangGraphInterruptRenderHandlerProps, mn as CrewsResponseStatus, n as defaultCopilotContextCategories, nn as CopilotContextParams, on as LangGraphInterruptActionSetter, pn as CrewsResponse, r as CopilotKitProps, rn as useCopilotContext, sn as LangGraphInterruptActionSetterArgs, t as CopilotKit, tn as CopilotContext, un as LangGraphInterruptRenderProps, vn as CopilotChatSuggestionConfiguration, wn as ActionRenderPropsNoArgs, xn as Tree, yn as SystemMessageFunction } from "./copilotkit-BDDjvB-p.cjs";
|
|
2
2
|
import "./v2/index.cjs";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { CopilotRuntimeClient, CopilotRuntimeClientOptions, ForwardedParametersInput, Message } from "@copilotkit/runtime-client-gql";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as CoagentInChatRenderFunction, An as FrontendActionAvailability, Cn as ActionRenderProps, Dn as CatchAllActionRenderProps, En as ActionRenderPropsWait, M as useAgent, On as CatchAllFrontendAction, Sn as TreeNode, Tn as ActionRenderPropsNoArgsWait, Z as useRenderToolCall$1, _n as CrewsToolStateItem, an as LangGraphInterruptAction, bn as DocumentPointer, cn as LangGraphInterruptRender, dn as QueuedInterruptEvent, en as CopilotApiConfig, fn as CrewsAgentState, gn as CrewsTaskStateItem, hn as CrewsStateItem, in as CoAgentStateRender, jn as RenderFunctionStatus, kn as FrontendAction, ln as LangGraphInterruptRenderHandlerProps, mn as CrewsResponseStatus, n as defaultCopilotContextCategories, nn as CopilotContextParams, on as LangGraphInterruptActionSetter, pn as CrewsResponse, r as CopilotKitProps, rn as useCopilotContext, sn as LangGraphInterruptActionSetterArgs, t as CopilotKit, tn as CopilotContext, un as LangGraphInterruptRenderProps, vn as CopilotChatSuggestionConfiguration, wn as ActionRenderPropsNoArgs, xn as Tree, yn as SystemMessageFunction } from "./copilotkit-3mXoM0Hd.mjs";
|
|
2
2
|
import "./v2/index.mjs";
|
|
3
3
|
import React, { ReactNode, RefObject, SetStateAction } from "react";
|
|
4
4
|
import { StaticSuggestionsConfig, Suggestion } from "@copilotkit/core";
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { B as useConfigureSuggestions,
|
|
3
|
+
import { $ as useCopilotKit, B as useConfigureSuggestions, J as useFrontendTool$1, U as useAgent, V as useSuggestions, W as useHumanInTheLoop$1, X as useRenderCustomMessages, Z as useRenderToolCall$1, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, f as useToast, g as useCopilotContext, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, m as useCopilotMessagesContext, mt as useCopilotChatConfiguration, n as defaultCopilotContextCategories, nt as defineToolCallRenderer, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, z as useInterrupt } from "./copilotkit-C7n8Umv9.mjs";
|
|
4
4
|
import React, { Fragment, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { CopilotKitCoreRuntimeConnectionStatus, ToolCallStatus } from "@copilotkit/core";
|
|
6
6
|
import { AGUIConnectNotImplementedError, HttpAgent } from "@ag-ui/client";
|
|
@@ -40,11 +40,7 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
|
|
|
40
40
|
const existingConfig = useCopilotChatConfiguration();
|
|
41
41
|
const [agentAvailable, setAgentAvailable] = useState(false);
|
|
42
42
|
const resolvedAgentId = existingConfig?.agentId ?? "default";
|
|
43
|
-
const { agent } = useAgent({
|
|
44
|
-
agentId: resolvedAgentId,
|
|
45
|
-
threadId: existingConfig?.threadId
|
|
46
|
-
});
|
|
47
|
-
const lastConnectedAgentRef = useRef(null);
|
|
43
|
+
const { agent } = useAgent({ agentId: resolvedAgentId });
|
|
48
44
|
useEffect(() => {
|
|
49
45
|
let detached = false;
|
|
50
46
|
const connectAbortController = new AbortController();
|
|
@@ -59,12 +55,11 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
|
|
|
59
55
|
if (error instanceof AGUIConnectNotImplementedError) {} else console.error("CopilotChat: connectAgent failed", error);
|
|
60
56
|
}
|
|
61
57
|
};
|
|
62
|
-
if (agent && agent !==
|
|
63
|
-
|
|
58
|
+
if (agent && existingConfig?.threadId && agent.threadId !== existingConfig.threadId && copilotkit.runtimeConnectionStatus === CopilotKitCoreRuntimeConnectionStatus.Connected) {
|
|
59
|
+
agent.threadId = existingConfig.threadId;
|
|
64
60
|
connect(agent);
|
|
65
61
|
}
|
|
66
62
|
return () => {
|
|
67
|
-
lastConnectedAgentRef.current = null;
|
|
68
63
|
detached = true;
|
|
69
64
|
connectAbortController.abort();
|
|
70
65
|
agent?.detachActiveRun();
|