@copilotkit/react-core 1.9.2-next.16 → 1.9.2-next.18
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 +19 -0
- package/dist/{chunk-T6CEBWGR.mjs → chunk-36MGCCPZ.mjs} +2 -2
- package/dist/{chunk-44XAHWIU.mjs → chunk-3SLA7Q2N.mjs} +2 -2
- package/dist/{chunk-ETFA6XAF.mjs → chunk-5BSUSFHM.mjs} +2 -2
- package/dist/{chunk-JUEBTQ7Q.mjs → chunk-5DODGOMM.mjs} +7 -7
- package/dist/{chunk-JUEBTQ7Q.mjs.map → chunk-5DODGOMM.mjs.map} +1 -1
- package/dist/{chunk-6V7FSJU5.mjs → chunk-5PE2XROA.mjs} +3 -3
- package/dist/{chunk-VUAQ2JRZ.mjs → chunk-7EJ4IWSA.mjs} +4 -4
- package/dist/{chunk-KPVFLQYE.mjs → chunk-BHGYBOR3.mjs} +4 -4
- package/dist/{chunk-BMHFKVRE.mjs → chunk-BVK7PLK6.mjs} +2 -2
- package/dist/{chunk-FIWNDD4G.mjs → chunk-DKZTPL66.mjs} +2 -2
- package/dist/{chunk-FIWNDD4G.mjs.map → chunk-DKZTPL66.mjs.map} +1 -1
- package/dist/{chunk-55QZ2SVJ.mjs → chunk-JWAXDYOW.mjs} +8 -8
- package/dist/chunk-JWAXDYOW.mjs.map +1 -0
- package/dist/{chunk-NBSSZHQO.mjs → chunk-KIXKBJUV.mjs} +2 -2
- package/dist/{chunk-R7XJ5MBN.mjs → chunk-KWQPQ4MM.mjs} +6 -6
- package/dist/{chunk-R7XJ5MBN.mjs.map → chunk-KWQPQ4MM.mjs.map} +1 -1
- package/dist/{chunk-SLNYMYUX.mjs → chunk-R2LNRHJP.mjs} +7 -7
- package/dist/{chunk-SLNYMYUX.mjs.map → chunk-R2LNRHJP.mjs.map} +1 -1
- package/dist/{chunk-LUZQL376.mjs → chunk-VDADWRS3.mjs} +2 -2
- package/dist/{chunk-654Z36FY.mjs → chunk-WR3XTNHJ.mjs} +2 -2
- package/dist/{chunk-SFADWQ4P.mjs → chunk-XJ34ATKP.mjs} +3 -3
- package/dist/components/copilot-provider/copilot-messages.js +6 -6
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +8 -8
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +15 -15
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +4 -4
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +15 -15
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +4 -4
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +15 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +1 -1
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/{copilot-context-5f835171.d.ts → copilot-context-3ab4fdf5.d.ts} +2 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +12 -12
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +15 -15
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +12 -12
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +3 -3
- package/dist/hooks/use-coagent-state-render.js +1 -1
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-coagent.d.ts +1 -1
- package/dist/hooks/use-coagent.js +12 -12
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +7 -7
- package/dist/hooks/use-copilot-action.js +1 -1
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-additional-instructions.js +1 -1
- package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
- package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +1 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat.d.ts +1 -1
- package/dist/hooks/use-copilot-chat.js +12 -12
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -6
- package/dist/hooks/use-copilot-readable.js +1 -1
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +2 -2
- package/dist/hooks/use-copilot-runtime-client.d.ts +2 -2
- package/dist/hooks/use-copilot-runtime-client.js +7 -7
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +12 -12
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +7 -7
- package/dist/hooks/use-make-copilot-document-readable.js +1 -1
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +5 -5
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/utils/extract.d.ts +1 -1
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +4 -4
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -4
- package/package.json +3 -3
- package/src/components/copilot-provider/__tests__/{copilotkit-trace.test.tsx → copilotkit-error.test.tsx} +17 -17
- package/src/components/copilot-provider/copilot-messages.tsx +6 -6
- package/src/components/copilot-provider/copilotkit-props.tsx +7 -7
- package/src/components/copilot-provider/copilotkit.tsx +2 -2
- package/src/context/copilot-context.tsx +3 -3
- package/src/hooks/use-chat.ts +6 -6
- package/src/hooks/use-copilot-runtime-client.ts +11 -12
- package/tsconfig.json +4 -1
- package/dist/chunk-55QZ2SVJ.mjs.map +0 -1
- /package/dist/{chunk-T6CEBWGR.mjs.map → chunk-36MGCCPZ.mjs.map} +0 -0
- /package/dist/{chunk-44XAHWIU.mjs.map → chunk-3SLA7Q2N.mjs.map} +0 -0
- /package/dist/{chunk-ETFA6XAF.mjs.map → chunk-5BSUSFHM.mjs.map} +0 -0
- /package/dist/{chunk-6V7FSJU5.mjs.map → chunk-5PE2XROA.mjs.map} +0 -0
- /package/dist/{chunk-VUAQ2JRZ.mjs.map → chunk-7EJ4IWSA.mjs.map} +0 -0
- /package/dist/{chunk-KPVFLQYE.mjs.map → chunk-BHGYBOR3.mjs.map} +0 -0
- /package/dist/{chunk-BMHFKVRE.mjs.map → chunk-BVK7PLK6.mjs.map} +0 -0
- /package/dist/{chunk-NBSSZHQO.mjs.map → chunk-KIXKBJUV.mjs.map} +0 -0
- /package/dist/{chunk-LUZQL376.mjs.map → chunk-VDADWRS3.mjs.map} +0 -0
- /package/dist/{chunk-654Z36FY.mjs.map → chunk-WR3XTNHJ.mjs.map} +0 -0
- /package/dist/{chunk-SFADWQ4P.mjs.map → chunk-XJ34ATKP.mjs.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotKit,
|
|
3
3
|
defaultCopilotContextCategories
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-KWQPQ4MM.mjs";
|
|
5
5
|
import "../../chunk-SJJNFYGQ.mjs";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-R2LNRHJP.mjs";
|
|
7
7
|
import "../../chunk-5FHSUKQL.mjs";
|
|
8
8
|
import "../../chunk-RKTVJRK7.mjs";
|
|
9
9
|
import "../../chunk-PMAFHQ7P.mjs";
|
|
@@ -11,10 +11,10 @@ import "../../chunk-57K2ZJ5F.mjs";
|
|
|
11
11
|
import "../../chunk-DCTJZ742.mjs";
|
|
12
12
|
import "../../chunk-3OQM3NEK.mjs";
|
|
13
13
|
import "../../chunk-O7ARI5CV.mjs";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-JWAXDYOW.mjs";
|
|
15
15
|
import "../../chunk-GFJW4RIM.mjs";
|
|
16
16
|
import "../../chunk-YAF2LATQ.mjs";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-DKZTPL66.mjs";
|
|
18
18
|
import "../../chunk-SKC7AJIV.mjs";
|
|
19
19
|
export {
|
|
20
20
|
CopilotKit,
|
|
@@ -3,7 +3,7 @@ export { CopilotKitProps } from './copilot-provider/copilotkit-props.js';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@copilotkit/runtime-client-gql';
|
|
5
5
|
import 'react';
|
|
6
|
-
import '../copilot-context-
|
|
6
|
+
import '../copilot-context-3ab4fdf5.js';
|
|
7
7
|
import '@copilotkit/shared';
|
|
8
8
|
import '../types/frontend-action.js';
|
|
9
9
|
import '../hooks/use-tree.js';
|
package/dist/components/index.js
CHANGED
|
@@ -162,7 +162,7 @@ var emptyCopilotContext = {
|
|
|
162
162
|
langGraphInterruptAction: null,
|
|
163
163
|
setLangGraphInterruptAction: () => null,
|
|
164
164
|
removeLangGraphInterruptAction: () => null,
|
|
165
|
-
|
|
165
|
+
onError: void 0
|
|
166
166
|
};
|
|
167
167
|
var CopilotContext = import_react.default.createContext(emptyCopilotContext);
|
|
168
168
|
function useCopilotContext() {
|
|
@@ -707,11 +707,11 @@ function CopilotMessages({ children }) {
|
|
|
707
707
|
const lastLoadedThreadId = (0, import_react6.useRef)();
|
|
708
708
|
const lastLoadedAgentName = (0, import_react6.useRef)();
|
|
709
709
|
const lastLoadedMessages = (0, import_react6.useRef)();
|
|
710
|
-
const { threadId, agentSession, runtimeClient, showDevConsole,
|
|
710
|
+
const { threadId, agentSession, runtimeClient, showDevConsole, onError, copilotApiConfig } = useCopilotContext();
|
|
711
711
|
const { setBannerError } = useToast();
|
|
712
712
|
const traceUIError = (0, import_react6.useCallback)(
|
|
713
713
|
(error, originalError) => __async(this, null, function* () {
|
|
714
|
-
if (!
|
|
714
|
+
if (!onError || !copilotApiConfig.publicApiKey)
|
|
715
715
|
return;
|
|
716
716
|
try {
|
|
717
717
|
const traceEvent = {
|
|
@@ -732,12 +732,12 @@ function CopilotMessages({ children }) {
|
|
|
732
732
|
},
|
|
733
733
|
error
|
|
734
734
|
};
|
|
735
|
-
yield
|
|
735
|
+
yield onError(traceEvent);
|
|
736
736
|
} catch (traceError) {
|
|
737
|
-
console.error("Error in CopilotMessages
|
|
737
|
+
console.error("Error in CopilotMessages onError handler:", traceError);
|
|
738
738
|
}
|
|
739
739
|
}),
|
|
740
|
-
[
|
|
740
|
+
[onError, copilotApiConfig.publicApiKey, copilotApiConfig.chatApiEndpoint]
|
|
741
741
|
);
|
|
742
742
|
const createStructuredError2 = (gqlError) => {
|
|
743
743
|
const extensions = gqlError.extensions;
|
|
@@ -862,13 +862,13 @@ var import_react7 = require("react");
|
|
|
862
862
|
var import_shared5 = require("@copilotkit/shared");
|
|
863
863
|
var useCopilotRuntimeClient = (options) => {
|
|
864
864
|
const { setBannerError } = useToast();
|
|
865
|
-
const _a = options, { showDevConsole,
|
|
865
|
+
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
866
866
|
const lastStructuredErrorRef = (0, import_react7.useRef)(null);
|
|
867
867
|
const traceUIError = (error, originalError) => __async(void 0, null, function* () {
|
|
868
|
-
if (!
|
|
868
|
+
if (!onError || !runtimeOptions.publicApiKey)
|
|
869
869
|
return;
|
|
870
870
|
try {
|
|
871
|
-
const
|
|
871
|
+
const errorEvent = {
|
|
872
872
|
type: "error",
|
|
873
873
|
timestamp: Date.now(),
|
|
874
874
|
context: {
|
|
@@ -886,9 +886,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
886
886
|
},
|
|
887
887
|
error
|
|
888
888
|
};
|
|
889
|
-
yield
|
|
890
|
-
} catch (
|
|
891
|
-
console.error("Error in
|
|
889
|
+
yield onError(errorEvent);
|
|
890
|
+
} catch (error2) {
|
|
891
|
+
console.error("Error in onError handler:", error2);
|
|
892
892
|
}
|
|
893
893
|
});
|
|
894
894
|
const runtimeClient = (0, import_react7.useMemo)(() => {
|
|
@@ -952,7 +952,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
952
952
|
setBannerError(warningError);
|
|
953
953
|
}
|
|
954
954
|
}));
|
|
955
|
-
}, [runtimeOptions, setBannerError, showDevConsole,
|
|
955
|
+
}, [runtimeOptions, setBannerError, showDevConsole, onError]);
|
|
956
956
|
return runtimeClient;
|
|
957
957
|
};
|
|
958
958
|
function createStructuredError(gqlError) {
|
|
@@ -1722,7 +1722,7 @@ ${nonDocumentStrings}`;
|
|
|
1722
1722
|
headers,
|
|
1723
1723
|
credentials: copilotApiConfig.credentials,
|
|
1724
1724
|
showDevConsole: (_b = props.showDevConsole) != null ? _b : false,
|
|
1725
|
-
|
|
1725
|
+
onError: props.onError
|
|
1726
1726
|
});
|
|
1727
1727
|
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react10.useState)({});
|
|
1728
1728
|
const addChatSuggestionConfiguration = (0, import_react10.useCallback)(
|
|
@@ -1907,7 +1907,7 @@ ${nonDocumentStrings}`;
|
|
|
1907
1907
|
langGraphInterruptAction,
|
|
1908
1908
|
setLangGraphInterruptAction,
|
|
1909
1909
|
removeLangGraphInterruptAction,
|
|
1910
|
-
|
|
1910
|
+
onError: props.onError
|
|
1911
1911
|
},
|
|
1912
1912
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopilotMessages, { children: memoizedChildren })
|
|
1913
1913
|
}
|