@copilotkit/react-core 1.55.1 → 1.55.2-canary.test-01
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 +34 -0
- package/dist/copilotkit-BuhSUZHb.d.mts.map +1 -1
- package/dist/{copilotkit-BY5S1-0P.mjs → copilotkit-Cd-NrDyp.mjs} +46 -16
- package/dist/copilotkit-Cd-NrDyp.mjs.map +1 -0
- package/dist/{copilotkit-Bz5-ImDl.cjs → copilotkit-Dgdpbqjt.cjs} +46 -16
- package/dist/copilotkit-Dgdpbqjt.cjs.map +1 -0
- package/dist/copilotkit-dwDWYpya.d.cts.map +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +28 -29
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +52 -28
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/components/copilot-provider/copilotkit.tsx +2 -2
- package/src/hooks/use-agent-nodename.ts +3 -0
- package/src/hooks/use-coagent-state-render-bridge.helpers.ts +2 -1
- package/src/hooks/use-coagent-state-render-registry.ts +6 -6
- package/src/hooks/use-copilot-chat_internal.ts +1 -1
- package/src/lib/copilot-task.ts +1 -1
- package/src/utils/utils.ts +0 -2
- package/src/v2/a2ui/A2UIMessageRenderer.tsx +1 -1
- package/src/v2/components/MCPAppsActivityRenderer.tsx +32 -2
- package/src/v2/components/chat/CopilotChatMessageView.tsx +41 -5
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.tsx +192 -82
- package/src/v2/components/chat/__tests__/MCPAppsProxy.e2e.test.tsx +589 -0
- package/src/v2/components/chat/__tests__/MCPAppsUiMessage.e2e.test.tsx +458 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.tsx +2 -2
- package/dist/copilotkit-BY5S1-0P.mjs.map +0 -1
- package/dist/copilotkit-Bz5-ImDl.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { $ as useCopilotKit, B as useConfigureSuggestions, H as useHumanInTheLoop$1, J as useRenderCustomMessages, K as useFrontendTool$1, V as useSuggestions, X as useAgent, 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-
|
|
3
|
+
import { $ as useCopilotKit, B as useConfigureSuggestions, H as useHumanInTheLoop$1, J as useRenderCustomMessages, K as useFrontendTool$1, V as useSuggestions, X as useAgent, 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-Cd-NrDyp.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";
|
|
@@ -115,7 +115,7 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
|
|
|
115
115
|
}
|
|
116
116
|
let historyCutoff = [messages[0]];
|
|
117
117
|
if (messages.length > 2 && reloadMessageIndex !== 0) {
|
|
118
|
-
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).
|
|
118
|
+
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).toReversed().find((msg) => msg.role === "user");
|
|
119
119
|
if (!lastUserMessageBeforeRegenerate) historyCutoff = [messages[0]];
|
|
120
120
|
else {
|
|
121
121
|
const indexOfLastUserMessageBeforeRegenerate = messages.findIndex((msg) => msg.id === lastUserMessageBeforeRegenerate.id);
|
|
@@ -1231,6 +1231,9 @@ function useAgentNodeName(agentName) {
|
|
|
1231
1231
|
},
|
|
1232
1232
|
onRunFinishedEvent: () => {
|
|
1233
1233
|
nodeNameRef.current = "end";
|
|
1234
|
+
},
|
|
1235
|
+
onRunErrorEvent: () => {
|
|
1236
|
+
nodeNameRef.current = "end";
|
|
1234
1237
|
}
|
|
1235
1238
|
});
|
|
1236
1239
|
return () => {
|
|
@@ -1897,7 +1900,7 @@ var CopilotTask = class {
|
|
|
1897
1900
|
metadata: { requestType: CopilotRequestType.Task },
|
|
1898
1901
|
forwardedParameters: {
|
|
1899
1902
|
toolChoice: "required",
|
|
1900
|
-
...this.forwardedParameters
|
|
1903
|
+
...this.forwardedParameters
|
|
1901
1904
|
}
|
|
1902
1905
|
},
|
|
1903
1906
|
properties: context.copilotApiConfig.properties
|