@copilotkit/react-core 1.5.15 → 1.5.16-next.0
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 +8 -0
- package/dist/{chunk-HZCROITJ.mjs → chunk-22ENANUU.mjs} +21 -15
- package/dist/chunk-22ENANUU.mjs.map +1 -0
- package/dist/{chunk-UMQQA6HK.mjs → chunk-5K2FUI34.mjs} +2 -2
- package/dist/{chunk-E64HFWRV.mjs → chunk-6ZFOXYPW.mjs} +2 -2
- package/dist/{chunk-AL3MOOKF.mjs → chunk-CUSSPNG5.mjs} +2 -2
- package/dist/{chunk-CQWEXISS.mjs → chunk-F7CT7ISL.mjs} +2 -2
- package/dist/{chunk-VQFN2PUH.mjs → chunk-I26H7OZO.mjs} +3 -3
- package/dist/{chunk-YG5MITQX.mjs → chunk-J3VBYQS4.mjs} +3 -3
- package/dist/{chunk-GANI4ZZM.mjs → chunk-MIUILUVX.mjs} +2 -2
- package/dist/{chunk-NXHL6AOE.mjs → chunk-MOWA6EG3.mjs} +4 -4
- package/dist/{chunk-WU53OU3E.mjs → chunk-NMLBRBNK.mjs} +2 -2
- package/dist/{chunk-KBCZA4FC.mjs → chunk-V3UIPF2O.mjs} +4 -4
- package/dist/{chunk-MUO7UFSI.mjs → chunk-YZS4JKYF.mjs} +4 -4
- package/dist/components/copilot-provider/copilotkit.js +20 -14
- 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.js +20 -14
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +4 -4
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/error-boundary/error-utils.js.map +1 -1
- package/dist/components/error-boundary/error-utils.mjs +1 -1
- package/dist/components/index.js +20 -14
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/components/toast/toast-provider.js +20 -14
- package/dist/components/toast/toast-provider.js.map +1 -1
- package/dist/components/toast/toast-provider.mjs +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +11 -11
- 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.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +7 -7
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- 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.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -6
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +7 -7
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/lib/copilot-task.mjs +5 -5
- package/dist/lib/index.mjs +5 -5
- package/dist/utils/extract.mjs +4 -4
- package/dist/utils/index.mjs +4 -4
- package/package.json +3 -3
- package/src/components/toast/toast-provider.tsx +20 -17
- package/dist/chunk-HZCROITJ.mjs.map +0 -1
- /package/dist/{chunk-UMQQA6HK.mjs.map → chunk-5K2FUI34.mjs.map} +0 -0
- /package/dist/{chunk-E64HFWRV.mjs.map → chunk-6ZFOXYPW.mjs.map} +0 -0
- /package/dist/{chunk-AL3MOOKF.mjs.map → chunk-CUSSPNG5.mjs.map} +0 -0
- /package/dist/{chunk-CQWEXISS.mjs.map → chunk-F7CT7ISL.mjs.map} +0 -0
- /package/dist/{chunk-VQFN2PUH.mjs.map → chunk-I26H7OZO.mjs.map} +0 -0
- /package/dist/{chunk-YG5MITQX.mjs.map → chunk-J3VBYQS4.mjs.map} +0 -0
- /package/dist/{chunk-GANI4ZZM.mjs.map → chunk-MIUILUVX.mjs.map} +0 -0
- /package/dist/{chunk-NXHL6AOE.mjs.map → chunk-MOWA6EG3.mjs.map} +0 -0
- /package/dist/{chunk-WU53OU3E.mjs.map → chunk-NMLBRBNK.mjs.map} +0 -0
- /package/dist/{chunk-KBCZA4FC.mjs.map → chunk-V3UIPF2O.mjs.map} +0 -0
- /package/dist/{chunk-MUO7UFSI.mjs.map → chunk-YZS4JKYF.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -26,20 +26,26 @@ function ToastProvider({
|
|
|
26
26
|
children
|
|
27
27
|
}) {
|
|
28
28
|
const [toasts, setToasts] = useState([]);
|
|
29
|
-
const addToast = useCallback(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
const addToast = useCallback(
|
|
30
|
+
(toast) => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (!enabled) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const id = (_a = toast.id) != null ? _a : Math.random().toString(36).substring(2, 9);
|
|
36
|
+
setToasts((currentToasts) => {
|
|
37
|
+
if (currentToasts.find((toast2) => toast2.id === id))
|
|
38
|
+
return currentToasts;
|
|
39
|
+
return [...currentToasts, __spreadProps(__spreadValues({}, toast), { id })];
|
|
40
|
+
});
|
|
41
|
+
if (toast.duration) {
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
removeToast(id);
|
|
44
|
+
}, toast.duration);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
[enabled]
|
|
48
|
+
);
|
|
43
49
|
const addGraphQLErrorsToast = useCallback((errors) => {
|
|
44
50
|
addToast({
|
|
45
51
|
type: "error",
|
|
@@ -241,4 +247,4 @@ export {
|
|
|
241
247
|
useToast,
|
|
242
248
|
ToastProvider
|
|
243
249
|
};
|
|
244
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
//# sourceMappingURL=chunk-22ENANUU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/error-boundary/error-utils.tsx","../src/components/toast/toast-provider.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { GraphQLError } from \"@copilotkit/runtime-client-gql\";\nimport { useToast } from \"../toast/toast-provider\";\nimport { ExclamationMarkIcon } from \"../toast/exclamation-mark-icon\";\nimport ReactMarkdown from \"react-markdown\";\n\ninterface OriginalError {\n message?: string;\n stack?: string;\n}\n\nexport function ErrorToast({ errors }: { errors: (Error | GraphQLError)[] }) {\n const errorsToRender = errors.map((error, idx) => {\n const originalError =\n \"extensions\" in error ? (error.extensions?.originalError as undefined | OriginalError) : {};\n const message = originalError?.message ?? error.message;\n const code = \"extensions\" in error ? (error.extensions?.code as string) : null;\n\n return (\n <div\n key={idx}\n style={{\n marginTop: idx === 0 ? 0 : 10,\n marginBottom: 14,\n }}\n >\n <ExclamationMarkIcon style={{ marginBottom: 4 }} />\n\n {code && (\n <div\n style={{\n fontWeight: \"600\",\n marginBottom: 4,\n }}\n >\n Copilot Cloud Error:{\" \"}\n <span style={{ fontFamily: \"monospace\", fontWeight: \"normal\" }}>{code}</span>\n </div>\n )}\n <ReactMarkdown>{message}</ReactMarkdown>\n </div>\n );\n });\n return (\n <div\n style={{\n fontSize: \"13px\",\n maxWidth: \"600px\",\n }}\n >\n {errorsToRender}\n <div style={{ fontSize: \"11px\", opacity: 0.75 }}>\n NOTE: This error only displays during local development.\n </div>\n </div>\n );\n}\n\nexport function useErrorToast() {\n const { addToast } = useToast();\n\n return useCallback(\n (error: (Error | GraphQLError)[]) => {\n const errorId = error\n .map((err) => {\n const message =\n \"extensions\" in err\n ? (err.extensions?.originalError as any)?.message || err.message\n : err.message;\n const stack = err.stack || \"\";\n return btoa(message + stack).slice(0, 32); // Create hash from message + stack\n })\n .join(\"|\");\n\n addToast({\n type: \"error\",\n id: errorId, // Toast libraries typically dedupe by id\n message: <ErrorToast errors={error} />,\n });\n },\n [addToast],\n );\n}\n\nexport function useAsyncCallback<T extends (...args: any[]) => Promise<any>>(\n callback: T,\n deps: Parameters<typeof useCallback>[1],\n) {\n const addErrorToast = useErrorToast();\n return useCallback(async (...args: Parameters<T>) => {\n try {\n return await callback(...args);\n } catch (error) {\n console.error(\"Error in async callback:\", error);\n // @ts-ignore\n addErrorToast([error]);\n throw error;\n }\n }, deps);\n}\n","import { GraphQLError } from \"@copilotkit/runtime-client-gql\";\nimport React, { createContext, useContext, useState, useCallback } from \"react\";\nimport { ErrorToast } from \"../error-boundary/error-utils\";\nimport { PartialBy } from \"@copilotkit/shared\";\n\ninterface Toast {\n id: string;\n message: string | React.ReactNode;\n type: \"info\" | \"success\" | \"warning\" | \"error\";\n duration?: number;\n}\n\ninterface ToastContextValue {\n toasts: Toast[];\n addToast: (toast: PartialBy<Toast, \"id\">) => void;\n addGraphQLErrorsToast: (errors: GraphQLError[]) => void;\n removeToast: (id: string) => void;\n enabled: boolean;\n}\n\nconst ToastContext = createContext<ToastContextValue | undefined>(undefined);\n\nexport function useToast() {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"useToast must be used within a ToastProvider\");\n }\n return context;\n}\n\nexport function ToastProvider({\n enabled,\n children,\n}: {\n enabled: boolean;\n children: React.ReactNode;\n}) {\n const [toasts, setToasts] = useState<Toast[]>([]);\n const addToast = useCallback(\n (toast: PartialBy<Toast, \"id\">) => {\n // We do not display these errors unless we are in dev mode.\n if (!enabled) {\n return;\n }\n\n const id = toast.id ?? Math.random().toString(36).substring(2, 9);\n\n setToasts((currentToasts) => {\n if (currentToasts.find((toast) => toast.id === id)) return currentToasts;\n return [...currentToasts, { ...toast, id }];\n });\n\n if (toast.duration) {\n setTimeout(() => {\n removeToast(id);\n }, toast.duration);\n }\n },\n [enabled],\n );\n\n const addGraphQLErrorsToast = useCallback((errors: GraphQLError[]) => {\n addToast({\n type: \"error\",\n message: <ErrorToast errors={errors} />,\n });\n }, []);\n\n const removeToast = useCallback((id: string) => {\n setToasts((currentToasts) => currentToasts.filter((toast) => toast.id !== id));\n }, []);\n\n const value = {\n toasts,\n addToast,\n addGraphQLErrorsToast,\n removeToast,\n enabled,\n };\n\n return (\n <ToastContext.Provider value={value}>\n <div\n style={{\n position: \"fixed\",\n bottom: \"1rem\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 50,\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"0.5rem\",\n }}\n >\n {toasts.length > 1 && (\n <div style={{ textAlign: \"right\" }}>\n <button\n onClick={() => setToasts([])}\n style={{\n padding: \"4px 8px\",\n fontSize: \"12px\",\n cursor: \"pointer\",\n background: \"white\",\n border: \"1px solid rgba(0,0,0,0.2)\",\n borderRadius: \"4px\",\n }}\n >\n Close All\n </button>\n </div>\n )}\n {toasts.map((toast) => (\n <Toast\n key={toast.id}\n message={toast.message}\n type={toast.type}\n onClose={() => removeToast(toast.id)}\n />\n ))}\n </div>\n {children}\n </ToastContext.Provider>\n );\n}\n\nfunction Toast({\n message,\n type = \"info\",\n onClose,\n}: {\n message: string | React.ReactNode;\n type: \"info\" | \"success\" | \"warning\" | \"error\";\n onClose: () => void;\n}) {\n const bgColors = {\n info: \"#3b82f6\",\n success: \"#22c55e\",\n warning: \"#eab308\",\n error: \"#ef4444\",\n };\n\n return (\n <div\n style={{\n backgroundColor: bgColors[type],\n color: \"white\",\n padding: \"0.5rem 1.5rem\",\n borderRadius: \"0.25rem\",\n boxShadow: \"0 2px 4px rgba(0,0,0,0.1)\",\n position: \"relative\",\n minWidth: \"200px\",\n }}\n >\n <div>{message}</div>\n <button\n onClick={onClose}\n style={{\n position: \"absolute\",\n top: \"0\",\n right: \"0\",\n background: \"none\",\n border: \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|
10
|
+
} from "./chunk-22ENANUU.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/error-boundary/error-boundary.tsx
|
|
13
13
|
import React, { useEffect } from "react";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
CopilotErrorBoundary,
|
|
78
78
|
ErrorToast
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-5K2FUI34.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MOWA6EG3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
processActionsForRuntimeRequest
|
|
6
6
|
} from "./chunk-XERJQUHA.mjs";
|
|
@@ -117,4 +117,4 @@ ${instructions}
|
|
|
117
117
|
export {
|
|
118
118
|
CopilotTask
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-6ZFOXYPW.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useAsyncCallback
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-22ENANUU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
@@ -104,4 +104,4 @@ function isFrontendAction(action) {
|
|
|
104
104
|
export {
|
|
105
105
|
useCopilotAction
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-CUSSPNG5.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useErrorToast,
|
|
3
3
|
useToast
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-22ENANUU.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__spreadProps,
|
|
7
7
|
__spreadValues
|
|
@@ -32,4 +32,4 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
32
32
|
export {
|
|
33
33
|
useCopilotRuntimeClient
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-F7CT7ISL.mjs.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-XERJQUHA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotRuntimeClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F7CT7ISL.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAsyncCallback,
|
|
9
9
|
useErrorToast
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-22ENANUU.mjs";
|
|
11
11
|
import {
|
|
12
12
|
__async,
|
|
13
13
|
__spreadProps,
|
|
@@ -472,4 +472,4 @@ function constructFinalMessages(syncedMessages, previousMessages, newMessages) {
|
|
|
472
472
|
export {
|
|
473
473
|
useChat
|
|
474
474
|
};
|
|
475
|
-
//# sourceMappingURL=chunk-
|
|
475
|
+
//# sourceMappingURL=chunk-I26H7OZO.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V3UIPF2O.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotContext
|
|
6
6
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useToast
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-22ENANUU.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__spreadProps,
|
|
12
12
|
__spreadValues
|
|
@@ -63,4 +63,4 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
63
63
|
export {
|
|
64
64
|
useLangGraphInterrupt
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-J3VBYQS4.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CUSSPNG5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
@@ -56,4 +56,4 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
56
56
|
export {
|
|
57
57
|
useCopilotAuthenticatedAction_c
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-MIUILUVX.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotErrorBoundary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5K2FUI34.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotMessages
|
|
6
6
|
} from "./chunk-5M47BILE.mjs";
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
19
19
|
import {
|
|
20
20
|
useCopilotRuntimeClient
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-F7CT7ISL.mjs";
|
|
22
22
|
import {
|
|
23
23
|
ToastProvider
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-22ENANUU.mjs";
|
|
25
25
|
import {
|
|
26
26
|
__async,
|
|
27
27
|
__objRest,
|
|
@@ -527,4 +527,4 @@ export {
|
|
|
527
527
|
CopilotKitInternal,
|
|
528
528
|
defaultCopilotContextCategories
|
|
529
529
|
};
|
|
530
|
-
//# sourceMappingURL=chunk-
|
|
530
|
+
//# sourceMappingURL=chunk-MOWA6EG3.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useToast
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-22ENANUU.mjs";
|
|
7
7
|
|
|
8
8
|
// src/hooks/use-coagent-state-render.ts
|
|
9
9
|
import { useRef, useContext, useEffect } from "react";
|
|
@@ -58,4 +58,4 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
58
58
|
export {
|
|
59
59
|
useCoAgentStateRender
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-NMLBRBNK.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MOWA6EG3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-DCTJZ742.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useChat
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I26H7OZO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAsyncCallback
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-22ENANUU.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__async,
|
|
18
18
|
__objRest,
|
|
@@ -222,4 +222,4 @@ export {
|
|
|
222
222
|
useCopilotChat,
|
|
223
223
|
defaultSystemMessage
|
|
224
224
|
};
|
|
225
|
-
//# sourceMappingURL=chunk-
|
|
225
|
+
//# sourceMappingURL=chunk-V3UIPF2O.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V3UIPF2O.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-ZM56S3LJ.mjs";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-DCTJZ742.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useCopilotRuntimeClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F7CT7ISL.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAsyncCallback,
|
|
15
15
|
useToast
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-22ENANUU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__async,
|
|
19
19
|
__spreadProps,
|
|
@@ -187,4 +187,4 @@ export {
|
|
|
187
187
|
stopAgent,
|
|
188
188
|
runAgent
|
|
189
189
|
};
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
190
|
+
//# sourceMappingURL=chunk-YZS4JKYF.mjs.map
|
|
@@ -552,20 +552,26 @@ function ToastProvider({
|
|
|
552
552
|
children
|
|
553
553
|
}) {
|
|
554
554
|
const [toasts, setToasts] = (0, import_react7.useState)([]);
|
|
555
|
-
const addToast = (0, import_react7.useCallback)(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
|
|
555
|
+
const addToast = (0, import_react7.useCallback)(
|
|
556
|
+
(toast) => {
|
|
557
|
+
var _a;
|
|
558
|
+
if (!enabled) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const id = (_a = toast.id) != null ? _a : Math.random().toString(36).substring(2, 9);
|
|
562
|
+
setToasts((currentToasts) => {
|
|
563
|
+
if (currentToasts.find((toast2) => toast2.id === id))
|
|
564
|
+
return currentToasts;
|
|
565
|
+
return [...currentToasts, __spreadProps(__spreadValues({}, toast), { id })];
|
|
566
|
+
});
|
|
567
|
+
if (toast.duration) {
|
|
568
|
+
setTimeout(() => {
|
|
569
|
+
removeToast(id);
|
|
570
|
+
}, toast.duration);
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
[enabled]
|
|
574
|
+
);
|
|
569
575
|
const addGraphQLErrorsToast = (0, import_react7.useCallback)((errors) => {
|
|
570
576
|
addToast({
|
|
571
577
|
type: "error",
|