@copilotkit/react-core 1.10.6-next.2 → 1.10.6-next.4
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 +16 -0
- package/dist/{chunk-Q3MCVRO3.mjs → chunk-6ESSSQ7Q.mjs} +8 -21
- package/dist/chunk-6ESSSQ7Q.mjs.map +1 -0
- package/dist/{chunk-JMALWN4Z.mjs → chunk-BXXJQ2BL.mjs} +3 -3
- package/dist/{chunk-N3Q6EUTG.mjs → chunk-E3624YDU.mjs} +2 -2
- package/dist/{chunk-CQGHSMOM.mjs → chunk-EDBI5PCJ.mjs} +2 -2
- package/dist/{chunk-KPCLYTU3.mjs → chunk-GGLAHG3I.mjs} +10 -10
- package/dist/{chunk-Z6SYWW3S.mjs → chunk-MIXSWZSB.mjs} +2 -2
- package/dist/{chunk-774NTLIU.mjs → chunk-NSBAWITG.mjs} +3 -3
- package/dist/{chunk-CXXRFRCY.mjs → chunk-OAGAFMUM.mjs} +2 -2
- package/dist/{chunk-GFCDU2YP.mjs → chunk-OT5NHMEC.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit.js +7 -17
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +6 -6
- package/dist/components/copilot-provider/index.js +7 -17
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +6 -6
- package/dist/components/index.js +7 -17
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -6
- package/dist/hooks/index.js +7 -32
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +12 -12
- package/dist/hooks/use-chat.js +7 -32
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +2 -3
- package/dist/hooks/use-coagent.js +7 -32
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +9 -9
- package/dist/hooks/use-copilot-chat-headless_c.js +7 -32
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +9 -9
- package/dist/hooks/use-copilot-chat.js +7 -32
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +9 -9
- package/dist/hooks/use-copilot-chat_internal.js +7 -32
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +8 -8
- package/dist/hooks/use-copilot-runtime-client.js +7 -32
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +1 -2
- package/dist/hooks/use-langgraph-interrupt.js +7 -32
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +9 -9
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/lib/copilot-task.mjs +7 -7
- package/dist/lib/index.mjs +7 -7
- package/dist/utils/extract.mjs +6 -6
- package/dist/utils/index.mjs +9 -9
- package/dist/utils/suggestions.mjs +6 -6
- package/package.json +3 -3
- package/src/hooks/use-copilot-runtime-client.ts +10 -21
- package/dist/chunk-Q3MCVRO3.mjs.map +0 -1
- /package/dist/{chunk-JMALWN4Z.mjs.map → chunk-BXXJQ2BL.mjs.map} +0 -0
- /package/dist/{chunk-N3Q6EUTG.mjs.map → chunk-E3624YDU.mjs.map} +0 -0
- /package/dist/{chunk-CQGHSMOM.mjs.map → chunk-EDBI5PCJ.mjs.map} +0 -0
- /package/dist/{chunk-KPCLYTU3.mjs.map → chunk-GGLAHG3I.mjs.map} +0 -0
- /package/dist/{chunk-Z6SYWW3S.mjs.map → chunk-MIXSWZSB.mjs.map} +0 -0
- /package/dist/{chunk-774NTLIU.mjs.map → chunk-NSBAWITG.mjs.map} +0 -0
- /package/dist/{chunk-CXXRFRCY.mjs.map → chunk-OAGAFMUM.mjs.map} +0 -0
- /package/dist/{chunk-GFCDU2YP.mjs.map → chunk-OT5NHMEC.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.10.6-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8626c5a: - fix: surface errors also in production
|
|
8
|
+
- Updated dependencies [8626c5a]
|
|
9
|
+
- @copilotkit/runtime-client-gql@1.10.6-next.4
|
|
10
|
+
- @copilotkit/shared@1.10.6-next.4
|
|
11
|
+
|
|
12
|
+
## 1.10.6-next.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- @copilotkit/runtime-client-gql@1.10.6-next.3
|
|
17
|
+
- @copilotkit/shared@1.10.6-next.3
|
|
18
|
+
|
|
3
19
|
## 1.10.6-next.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
shouldShowDevConsole
|
|
3
|
-
} from "./chunk-ICIK2BSB.mjs";
|
|
4
1
|
import {
|
|
5
2
|
useToast
|
|
6
3
|
} from "./chunk-EFL5OBKN.mjs";
|
|
@@ -62,15 +59,10 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
62
59
|
const routeError = (gqlError) => {
|
|
63
60
|
const extensions = gqlError.extensions;
|
|
64
61
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
65
|
-
const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
|
|
66
62
|
if (visibility === ErrorVisibility.SILENT) {
|
|
67
63
|
console.error("CopilotKit Silent Error:", gqlError.message);
|
|
68
64
|
return;
|
|
69
65
|
}
|
|
70
|
-
if (!isDev) {
|
|
71
|
-
console.error("CopilotKit Error (hidden in production):", gqlError.message);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
66
|
const now = Date.now();
|
|
75
67
|
const errorMessage = gqlError.message;
|
|
76
68
|
if (lastStructuredErrorRef.current && lastStructuredErrorRef.current.message === errorMessage && now - lastStructuredErrorRef.current.timestamp < 150) {
|
|
@@ -92,17 +84,12 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
92
84
|
};
|
|
93
85
|
graphQLErrors.forEach(routeError);
|
|
94
86
|
} else {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
code: CopilotKitErrorCode.UNKNOWN
|
|
102
|
-
});
|
|
103
|
-
setBannerError(fallbackError);
|
|
104
|
-
traceUIError(fallbackError, error);
|
|
105
|
-
}
|
|
87
|
+
const fallbackError = new CopilotKitError({
|
|
88
|
+
message: (error == null ? void 0 : error.message) || String(error),
|
|
89
|
+
code: CopilotKitErrorCode.UNKNOWN
|
|
90
|
+
});
|
|
91
|
+
setBannerError(fallbackError);
|
|
92
|
+
traceUIError(fallbackError, error);
|
|
106
93
|
}
|
|
107
94
|
},
|
|
108
95
|
handleGQLWarning: (message) => {
|
|
@@ -114,7 +101,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
114
101
|
setBannerError(warningError);
|
|
115
102
|
}
|
|
116
103
|
}));
|
|
117
|
-
}, [runtimeOptions, setBannerError,
|
|
104
|
+
}, [runtimeOptions, setBannerError, onError]);
|
|
118
105
|
return runtimeClient;
|
|
119
106
|
};
|
|
120
107
|
function createStructuredError(gqlError) {
|
|
@@ -144,4 +131,4 @@ function createStructuredError(gqlError) {
|
|
|
144
131
|
export {
|
|
145
132
|
useCopilotRuntimeClient
|
|
146
133
|
};
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-6ESSSQ7Q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-runtime-client.ts"],"sourcesContent":["import {\n CopilotRuntimeClient,\n CopilotRuntimeClientOptions,\n GraphQLError,\n} from \"@copilotkit/runtime-client-gql\";\nimport { useToast } from \"../components/toast/toast-provider\";\nimport { useMemo, useRef } from \"react\";\nimport {\n ErrorVisibility,\n CopilotKitApiDiscoveryError,\n CopilotKitRemoteEndpointDiscoveryError,\n CopilotKitAgentDiscoveryError,\n CopilotKitError,\n CopilotKitErrorCode,\n CopilotErrorHandler,\n CopilotErrorEvent,\n} from \"@copilotkit/shared\";\nimport { shouldShowDevConsole } from \"../utils/dev-console\";\n\nexport interface CopilotRuntimeClientHookOptions extends CopilotRuntimeClientOptions {\n showDevConsole?: boolean;\n onError: CopilotErrorHandler;\n}\n\nexport const useCopilotRuntimeClient = (options: CopilotRuntimeClientHookOptions) => {\n const { setBannerError } = useToast();\n const { showDevConsole, onError, ...runtimeOptions } = options;\n\n // Deduplication state for structured errors\n const lastStructuredErrorRef = useRef<{ message: string; timestamp: number } | null>(null);\n\n // Helper function to trace UI errors\n const traceUIError = async (error: CopilotKitError, originalError?: any) => {\n try {\n const errorEvent: CopilotErrorEvent = {\n type: \"error\",\n timestamp: Date.now(),\n context: {\n source: \"ui\",\n request: {\n operation: \"runtimeClient\",\n url: runtimeOptions.url,\n startTime: Date.now(),\n },\n technical: {\n environment: \"browser\",\n userAgent: typeof navigator !== \"undefined\" ? navigator.userAgent : undefined,\n stackTrace: originalError instanceof Error ? originalError.stack : undefined,\n },\n },\n error,\n };\n await onError(errorEvent);\n } catch (error) {\n console.error(\"Error in onError handler:\", error);\n }\n };\n\n const runtimeClient = useMemo(() => {\n return new CopilotRuntimeClient({\n ...runtimeOptions,\n handleGQLErrors: (error) => {\n if ((error as any).graphQLErrors?.length) {\n const graphQLErrors = (error as any).graphQLErrors as GraphQLError[];\n\n // Route all errors to banners for consistent UI\n const routeError = (gqlError: GraphQLError) => {\n const extensions = gqlError.extensions;\n const visibility = extensions?.visibility as ErrorVisibility;\n\n // Silent errors - just log\n if (visibility === ErrorVisibility.SILENT) {\n console.error(\"CopilotKit Silent Error:\", gqlError.message);\n return;\n }\n\n // All errors (including DEV_ONLY) show as banners for consistency\n // Deduplicate to prevent spam\n const now = Date.now();\n const errorMessage = gqlError.message;\n if (\n lastStructuredErrorRef.current &&\n lastStructuredErrorRef.current.message === errorMessage &&\n now - lastStructuredErrorRef.current.timestamp < 150\n ) {\n return; // Skip duplicate\n }\n lastStructuredErrorRef.current = { message: errorMessage, timestamp: now };\n\n const ckError = createStructuredError(gqlError);\n if (ckError) {\n setBannerError(ckError);\n // Trace the error\n traceUIError(ckError, gqlError);\n // TODO: if onError & renderError should work without key, insert here\n } else {\n // Fallback for unstructured errors\n const fallbackError = new CopilotKitError({\n message: gqlError.message,\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(fallbackError);\n // Trace the fallback error\n traceUIError(fallbackError, gqlError);\n // TODO: if onError & renderError should work without key, insert here\n }\n };\n\n // Process all errors as banners\n graphQLErrors.forEach(routeError);\n } else {\n // Route non-GraphQL errors to banner as well\n const fallbackError = new CopilotKitError({\n message: error?.message || String(error),\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(fallbackError);\n // Trace the non-GraphQL error\n traceUIError(fallbackError, error);\n // TODO: if onError & renderError should work without key, insert here\n }\n },\n handleGQLWarning: (message: string) => {\n console.warn(message);\n // Show warnings as banners too for consistency\n const warningError = new CopilotKitError({\n message,\n code: CopilotKitErrorCode.UNKNOWN,\n });\n setBannerError(warningError);\n },\n });\n }, [runtimeOptions, setBannerError, onError]);\n\n return runtimeClient;\n};\n\n// Create appropriate structured error from GraphQL error\nfunction createStructuredError(gqlError: GraphQLError): CopilotKitError | null {\n const extensions = gqlError.extensions;\n const originalError = extensions?.originalError as any;\n const message = originalError?.message || gqlError.message;\n const code = extensions?.code as CopilotKitErrorCode;\n\n if (code) {\n return new CopilotKitError({ message, code });\n }\n\n // Legacy error detection by stack trace\n if (originalError?.stack?.includes(\"CopilotApiDiscoveryError\")) {\n return new CopilotKitApiDiscoveryError({ message });\n }\n if (originalError?.stack?.includes(\"CopilotKitRemoteEndpointDiscoveryError\")) {\n return new CopilotKitRemoteEndpointDiscoveryError({ message });\n }\n if (originalError?.stack?.includes(\"CopilotKitAgentDiscoveryError\")) {\n return new CopilotKitAgentDiscoveryError({\n agentName: \"\",\n availableAgents: [],\n });\n }\n\n return null;\n}\n"],"mappings":"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","names":["error","_a"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NSBAWITG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useMessagesTap
|
|
6
6
|
} from "./chunk-C6IANC2R.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useCopilotRuntimeClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6ESSSQ7Q.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useAsyncCallback
|
|
12
12
|
} from "./chunk-N4WEHORG.mjs";
|
|
@@ -236,4 +236,4 @@ export {
|
|
|
236
236
|
stopAgent,
|
|
237
237
|
runAgent
|
|
238
238
|
};
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
239
|
+
//# sourceMappingURL=chunk-BXXJQ2BL.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NSBAWITG.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-chat.ts
|
|
6
6
|
function useCopilotChat2(options = {}) {
|
|
@@ -31,4 +31,4 @@ function useCopilotChat2(options = {}) {
|
|
|
31
31
|
export {
|
|
32
32
|
useCopilotChat2 as useCopilotChat
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-E3624YDU.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4CEQJ2X6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultCopilotContextCategories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GGLAHG3I.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
@@ -117,4 +117,4 @@ ${instructions}
|
|
|
117
117
|
export {
|
|
118
118
|
CopilotTask
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-EDBI5PCJ.mjs.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-C6IANC2R.mjs";
|
|
2
|
+
ConsoleTrigger
|
|
3
|
+
} from "./chunk-DXEQPN43.mjs";
|
|
5
4
|
import {
|
|
6
5
|
CopilotErrorBoundary
|
|
7
6
|
} from "./chunk-N4VN2B5S.mjs";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
CopilotMessages,
|
|
9
|
+
MessagesTapProvider
|
|
10
|
+
} from "./chunk-C6IANC2R.mjs";
|
|
11
|
+
import {
|
|
12
|
+
shouldShowDevConsole
|
|
13
|
+
} from "./chunk-ICIK2BSB.mjs";
|
|
11
14
|
import {
|
|
12
15
|
use_tree_default
|
|
13
16
|
} from "./chunk-RKTVJRK7.mjs";
|
|
@@ -16,10 +19,7 @@ import {
|
|
|
16
19
|
} from "./chunk-5FHSUKQL.mjs";
|
|
17
20
|
import {
|
|
18
21
|
useCopilotRuntimeClient
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
shouldShowDevConsole
|
|
22
|
-
} from "./chunk-ICIK2BSB.mjs";
|
|
22
|
+
} from "./chunk-6ESSSQ7Q.mjs";
|
|
23
23
|
import {
|
|
24
24
|
ToastProvider
|
|
25
25
|
} from "./chunk-EFL5OBKN.mjs";
|
|
@@ -801,4 +801,4 @@ export {
|
|
|
801
801
|
CopilotKitInternal,
|
|
802
802
|
defaultCopilotContextCategories
|
|
803
803
|
};
|
|
804
|
-
//# sourceMappingURL=chunk-
|
|
804
|
+
//# sourceMappingURL=chunk-GGLAHG3I.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NSBAWITG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useToast
|
|
6
6
|
} from "./chunk-EFL5OBKN.mjs";
|
|
@@ -68,4 +68,4 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
68
68
|
export {
|
|
69
69
|
useLangGraphInterrupt
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-MIXSWZSB.mjs.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-ZVOLWJCY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useChat
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OT5NHMEC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
defaultCopilotContextCategories,
|
|
9
9
|
reloadSuggestions
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GGLAHG3I.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useAsyncCallback
|
|
13
13
|
} from "./chunk-N4WEHORG.mjs";
|
|
@@ -329,4 +329,4 @@ export {
|
|
|
329
329
|
useCopilotChat,
|
|
330
330
|
defaultSystemMessage
|
|
331
331
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-NSBAWITG.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NSBAWITG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-EUX2P2E7.mjs";
|
|
@@ -82,4 +82,4 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
82
82
|
export {
|
|
83
83
|
useCopilotChatHeadless_c
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-OAGAFMUM.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4CEQJ2X6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotRuntimeClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6ESSSQ7Q.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAsyncCallback,
|
|
9
9
|
useErrorToast
|
|
@@ -720,4 +720,4 @@ function getPairedFeAction(actions, message) {
|
|
|
720
720
|
export {
|
|
721
721
|
useChat
|
|
722
722
|
};
|
|
723
|
-
//# sourceMappingURL=chunk-
|
|
723
|
+
//# sourceMappingURL=chunk-OT5NHMEC.mjs.map
|
|
@@ -1153,15 +1153,10 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
1153
1153
|
const routeError = (gqlError) => {
|
|
1154
1154
|
const extensions = gqlError.extensions;
|
|
1155
1155
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
1156
|
-
const isDev = shouldShowDevConsole(showDevConsole != null ? showDevConsole : false);
|
|
1157
1156
|
if (visibility === import_shared6.ErrorVisibility.SILENT) {
|
|
1158
1157
|
console.error("CopilotKit Silent Error:", gqlError.message);
|
|
1159
1158
|
return;
|
|
1160
1159
|
}
|
|
1161
|
-
if (!isDev) {
|
|
1162
|
-
console.error("CopilotKit Error (hidden in production):", gqlError.message);
|
|
1163
|
-
return;
|
|
1164
|
-
}
|
|
1165
1160
|
const now = Date.now();
|
|
1166
1161
|
const errorMessage = gqlError.message;
|
|
1167
1162
|
if (lastStructuredErrorRef.current && lastStructuredErrorRef.current.message === errorMessage && now - lastStructuredErrorRef.current.timestamp < 150) {
|
|
@@ -1183,17 +1178,12 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
1183
1178
|
};
|
|
1184
1179
|
graphQLErrors.forEach(routeError);
|
|
1185
1180
|
} else {
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
code: import_shared6.CopilotKitErrorCode.UNKNOWN
|
|
1193
|
-
});
|
|
1194
|
-
setBannerError(fallbackError);
|
|
1195
|
-
traceUIError(fallbackError, error);
|
|
1196
|
-
}
|
|
1181
|
+
const fallbackError = new import_shared6.CopilotKitError({
|
|
1182
|
+
message: (error == null ? void 0 : error.message) || String(error),
|
|
1183
|
+
code: import_shared6.CopilotKitErrorCode.UNKNOWN
|
|
1184
|
+
});
|
|
1185
|
+
setBannerError(fallbackError);
|
|
1186
|
+
traceUIError(fallbackError, error);
|
|
1197
1187
|
}
|
|
1198
1188
|
},
|
|
1199
1189
|
handleGQLWarning: (message) => {
|
|
@@ -1205,7 +1195,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
1205
1195
|
setBannerError(warningError);
|
|
1206
1196
|
}
|
|
1207
1197
|
}));
|
|
1208
|
-
}, [runtimeOptions, setBannerError,
|
|
1198
|
+
}, [runtimeOptions, setBannerError, onError]);
|
|
1209
1199
|
return runtimeClient;
|
|
1210
1200
|
};
|
|
1211
1201
|
function createStructuredError(gqlError) {
|