@copilotkit/react-core 1.9.1-next.0 → 1.9.2-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 +17 -0
- package/dist/{chunk-B5UA5G3E.mjs → chunk-2FW7HH6W.mjs} +12 -8
- package/dist/chunk-2FW7HH6W.mjs.map +1 -0
- package/dist/{chunk-ERFA53MG.mjs → chunk-6KGEF242.mjs} +2 -2
- package/dist/chunk-6KGEF242.mjs.map +1 -0
- package/dist/{chunk-2J3SMMGW.mjs → chunk-C6F6EQNA.mjs} +2 -2
- package/dist/chunk-CCESTGAM.mjs +102 -0
- package/dist/chunk-CCESTGAM.mjs.map +1 -0
- package/dist/chunk-GFJW4RIM.mjs +9 -0
- package/dist/chunk-GFJW4RIM.mjs.map +1 -0
- package/dist/chunk-HD2GE3DK.mjs +359 -0
- package/dist/chunk-HD2GE3DK.mjs.map +1 -0
- package/dist/{chunk-74AJEJTV.mjs → chunk-HJP2RX5R.mjs} +11 -6
- package/dist/chunk-HJP2RX5R.mjs.map +1 -0
- package/dist/{chunk-EQ4XLLT4.mjs → chunk-LDACFA2B.mjs} +3 -3
- package/dist/{chunk-FGBRHBRR.mjs → chunk-LZDDYZEY.mjs} +2 -2
- package/dist/chunk-NNSXCFQO.mjs +154 -0
- package/dist/chunk-NNSXCFQO.mjs.map +1 -0
- package/dist/{chunk-WZAEVHLK.mjs → chunk-Q5D5XQFA.mjs} +2 -2
- package/dist/{chunk-534J55RX.mjs → chunk-QQZLIEXK.mjs} +9 -7
- package/dist/chunk-QQZLIEXK.mjs.map +1 -0
- package/dist/chunk-RUY6MLHA.mjs +119 -0
- package/dist/chunk-RUY6MLHA.mjs.map +1 -0
- package/dist/{chunk-MDIIRGJD.mjs → chunk-SGLWMQ2J.mjs} +25 -17
- package/dist/chunk-SGLWMQ2J.mjs.map +1 -0
- package/dist/{chunk-G27C5EFO.mjs → chunk-T42PN5VN.mjs} +7 -5
- package/dist/{chunk-G27C5EFO.mjs.map → chunk-T42PN5VN.mjs.map} +1 -1
- package/dist/{chunk-VQ3VTO26.mjs → chunk-UHQMV2CE.mjs} +2 -2
- package/dist/{chunk-4DVPRMVH.mjs → chunk-UIT6QMUJ.mjs} +7 -7
- package/dist/chunk-VRXANACV.mjs +277 -0
- package/dist/chunk-VRXANACV.mjs.map +1 -0
- package/dist/{chunk-2FLZLANO.mjs → chunk-XY5BN4HZ.mjs} +19 -12
- package/dist/chunk-XY5BN4HZ.mjs.map +1 -0
- package/dist/{chunk-7HDYPEWS.mjs → chunk-YDENFEKA.mjs} +2 -2
- package/dist/{chunk-4VWM6JNK.mjs → chunk-YZDRMIOM.mjs} +6 -6
- package/dist/components/copilot-provider/copilot-messages.js +105 -11
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +4 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +4 -3
- 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 +863 -441
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +10 -9
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +863 -441
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +10 -9
- package/dist/components/error-boundary/error-boundary.js +320 -159
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +4 -3
- package/dist/components/error-boundary/error-utils.js +2 -1
- package/dist/components/error-boundary/error-utils.js.map +1 -1
- package/dist/components/error-boundary/error-utils.mjs +2 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +863 -441
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -9
- package/dist/components/toast/toast-provider.d.ts +9 -12
- package/dist/components/toast/toast-provider.js +218 -191
- package/dist/components/toast/toast-provider.js.map +1 -1
- package/dist/components/toast/toast-provider.mjs +1 -2
- package/dist/components/usage-banner.d.ts +3 -2
- package/dist/components/usage-banner.js +311 -153
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +1 -1
- 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-309906bb.d.ts → copilot-context-f9b2b4c3.d.ts} +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +160 -75
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +33 -32
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +243 -68
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +6 -3
- package/dist/hooks/use-coagent-state-render.js +10 -5
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +3 -4
- package/dist/hooks/use-coagent.d.ts +1 -1
- package/dist/hooks/use-coagent.js +148 -67
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +14 -13
- package/dist/hooks/use-copilot-action.js +5 -4
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +4 -3
- 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 +5 -4
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +5 -4
- package/dist/hooks/use-copilot-chat.d.ts +1 -1
- package/dist/hooks/use-copilot-chat.js +138 -62
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +13 -12
- 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 +5 -2
- package/dist/hooks/use-copilot-runtime-client.js +101 -128
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +3 -3
- 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 +140 -64
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +14 -13
- 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 +913 -480
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -34
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +11 -10
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +11 -10
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/utils/dev-console.d.ts +1 -1
- package/dist/utils/dev-console.js +1 -10
- package/dist/utils/dev-console.js.map +1 -1
- package/dist/utils/dev-console.mjs +1 -1
- package/dist/utils/extract.d.ts +1 -1
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +10 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +7 -14
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +12 -11
- package/package.json +3 -3
- package/src/components/copilot-provider/copilot-messages.tsx +163 -4
- package/src/components/copilot-provider/copilotkit-props.tsx +3 -2
- package/src/components/copilot-provider/copilotkit.tsx +8 -2
- package/src/components/error-boundary/error-boundary.tsx +6 -5
- package/src/components/error-boundary/error-utils.tsx +1 -1
- package/src/components/toast/toast-provider.tsx +260 -93
- package/src/components/usage-banner.tsx +311 -131
- package/src/context/copilot-context.tsx +2 -2
- package/src/hooks/use-chat.ts +4 -0
- package/src/hooks/use-coagent-state-render.ts +9 -3
- package/src/hooks/use-coagent.ts +10 -3
- package/src/hooks/use-copilot-runtime-client.ts +153 -12
- package/src/utils/dev-console.ts +2 -17
- package/dist/chunk-22ENANUU.mjs +0 -250
- package/dist/chunk-22ENANUU.mjs.map +0 -1
- package/dist/chunk-2FLZLANO.mjs.map +0 -1
- package/dist/chunk-534J55RX.mjs.map +0 -1
- package/dist/chunk-6PK72HMH.mjs +0 -63
- package/dist/chunk-6PK72HMH.mjs.map +0 -1
- package/dist/chunk-74AJEJTV.mjs.map +0 -1
- package/dist/chunk-B5UA5G3E.mjs.map +0 -1
- package/dist/chunk-BKTARDXX.mjs +0 -40
- package/dist/chunk-BKTARDXX.mjs.map +0 -1
- package/dist/chunk-D34OH4VN.mjs +0 -201
- package/dist/chunk-D34OH4VN.mjs.map +0 -1
- package/dist/chunk-ERFA53MG.mjs.map +0 -1
- package/dist/chunk-MDIIRGJD.mjs.map +0 -1
- package/dist/chunk-MLAS4QUR.mjs +0 -18
- package/dist/chunk-MLAS4QUR.mjs.map +0 -1
- /package/dist/{chunk-2J3SMMGW.mjs.map → chunk-C6F6EQNA.mjs.map} +0 -0
- /package/dist/{chunk-EQ4XLLT4.mjs.map → chunk-LDACFA2B.mjs.map} +0 -0
- /package/dist/{chunk-FGBRHBRR.mjs.map → chunk-LZDDYZEY.mjs.map} +0 -0
- /package/dist/{chunk-WZAEVHLK.mjs.map → chunk-Q5D5XQFA.mjs.map} +0 -0
- /package/dist/{chunk-VQ3VTO26.mjs.map → chunk-UHQMV2CE.mjs.map} +0 -0
- /package/dist/{chunk-4DVPRMVH.mjs.map → chunk-UIT6QMUJ.mjs.map} +0 -0
- /package/dist/{chunk-7HDYPEWS.mjs.map → chunk-YDENFEKA.mjs.map} +0 -0
- /package/dist/{chunk-4VWM6JNK.mjs.map → chunk-YZDRMIOM.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.9.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 10345a5: - feat: structured error visibility system for streaming errors
|
|
8
|
+
- Updated dependencies [10345a5]
|
|
9
|
+
- @copilotkit/runtime-client-gql@1.9.2-next.0
|
|
10
|
+
- @copilotkit/shared@1.9.2-next.0
|
|
11
|
+
|
|
12
|
+
## 1.9.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [deaeca0]
|
|
17
|
+
- @copilotkit/shared@1.9.1
|
|
18
|
+
- @copilotkit/runtime-client-gql@1.9.1
|
|
19
|
+
|
|
3
20
|
## 1.9.1-next.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotContext
|
|
3
|
-
} from "./chunk-ERFA53MG.mjs";
|
|
4
1
|
import {
|
|
5
2
|
useToast
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VRXANACV.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CopilotContext
|
|
6
|
+
} from "./chunk-6KGEF242.mjs";
|
|
7
7
|
|
|
8
8
|
// src/hooks/use-coagent-state-render.ts
|
|
9
9
|
import { useRef, useContext, useEffect } from "react";
|
|
10
|
-
import { randomId } from "@copilotkit/shared";
|
|
10
|
+
import { randomId, CopilotKitAgentDiscoveryError } from "@copilotkit/shared";
|
|
11
11
|
function useCoAgentStateRender(action, dependencies) {
|
|
12
12
|
const {
|
|
13
13
|
setCoAgentStateRender,
|
|
@@ -17,11 +17,15 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
17
17
|
availableAgents
|
|
18
18
|
} = useContext(CopilotContext);
|
|
19
19
|
const idRef = useRef(randomId());
|
|
20
|
-
const { addToast } = useToast();
|
|
20
|
+
const { setBannerError, addToast } = useToast();
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
|
|
23
23
|
const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
|
|
24
|
-
|
|
24
|
+
const agentError = new CopilotKitAgentDiscoveryError({
|
|
25
|
+
agentName: action.name,
|
|
26
|
+
availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
|
|
27
|
+
});
|
|
28
|
+
setBannerError(agentError);
|
|
25
29
|
}
|
|
26
30
|
}, [availableAgents]);
|
|
27
31
|
const key = `${action.name}-${action.nodeName || "global"}`;
|
|
@@ -81,4 +85,4 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
81
85
|
export {
|
|
82
86
|
useCoAgentStateRender
|
|
83
87
|
};
|
|
84
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-2FW7HH6W.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-coagent-state-render.ts"],"sourcesContent":["/**\n * The useCoAgentStateRender hook allows you to render UI or text based components on a Agentic Copilot's state in the chat.\n * This is particularly useful for showing intermediate state or progress during Agentic Copilot operations.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCoAgentStateRender } from \"@copilotkit/react-core\";\n *\n * type YourAgentState = {\n * agent_state_property: string;\n * }\n *\n * useCoAgentStateRender<YourAgentState>({\n * name: \"basic_agent\",\n * nodeName: \"optionally_specify_a_specific_node\",\n * render: ({ status, state, nodeName }) => {\n * return (\n * <YourComponent\n * agentStateProperty={state.agent_state_property}\n * status={status}\n * nodeName={nodeName}\n * />\n * );\n * },\n * });\n * ```\n *\n * This allows for you to render UI components or text based on what is happening within the agent.\n *\n * ### Example\n * A great example of this is in our Perplexity Clone where we render the progress of an agent's internet search as it is happening.\n * You can play around with it below or learn how to build it with its [demo](/coagents/videos/perplexity-clone).\n *\n * <Callout type=\"info\">\n * This example is hosted on Vercel and may take a few seconds to load.\n * </Callout>\n *\n * <iframe src=\"https://examples-coagents-ai-researcher-ui.vercel.app/\" className=\"w-full rounded-lg border h-[700px] my-4\" />\n */\n\nimport { useRef, useContext, useEffect } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\nimport { randomId, CopilotKitAgentDiscoveryError } from \"@copilotkit/shared\";\nimport { CoAgentStateRender } from \"../types/coagent-action\";\nimport { useToast } from \"../components/toast/toast-provider\";\n\n/**\n * This hook is used to render agent state with custom UI components or text. This is particularly\n * useful for showing intermediate state or progress during Agentic Copilot operations.\n * To get started using rendering intermediate state through this hook, checkout the documentation.\n *\n * https://docs.copilotkit.ai/coagents/shared-state/predictive-state-updates\n */\n\n// We implement useCoAgentStateRender dependency handling so that\n// the developer has the option to not provide any dependencies.\n// see useCopilotAction for more details about this approach.\nexport function useCoAgentStateRender<T = any>(\n action: CoAgentStateRender<T>,\n dependencies?: any[],\n): void {\n const {\n setCoAgentStateRender,\n removeCoAgentStateRender,\n coAgentStateRenders,\n chatComponentsCache,\n availableAgents,\n } = useContext(CopilotContext);\n const idRef = useRef<string>(randomId());\n const { setBannerError, addToast } = useToast();\n\n useEffect(() => {\n if (availableAgents?.length && !availableAgents.some((a) => a.name === action.name)) {\n const message = `(useCoAgentStateRender): Agent \"${action.name}\" not found. Make sure the agent exists and is properly configured.`;\n\n // Route to banner instead of toast for consistency\n const agentError = new CopilotKitAgentDiscoveryError({\n agentName: action.name,\n availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id })),\n });\n setBannerError(agentError);\n }\n }, [availableAgents]);\n\n const key = `${action.name}-${action.nodeName || \"global\"}`;\n\n if (dependencies === undefined) {\n if (coAgentStateRenders[idRef.current]) {\n coAgentStateRenders[idRef.current].handler = action.handler as any;\n if (typeof action.render === \"function\") {\n if (chatComponentsCache.current !== null) {\n chatComponentsCache.current.coAgentStateRenders[key] = action.render;\n }\n }\n }\n }\n\n useEffect(() => {\n // Check for duplicates by comparing against all other actions\n const currentId = idRef.current;\n const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {\n // Skip comparing with self\n if (id === currentId) return false;\n\n // Different agent names are never duplicates\n if (otherAction.name !== action.name) return false;\n\n // Same agent names:\n const hasNodeName = !!action.nodeName;\n const hasOtherNodeName = !!otherAction.nodeName;\n\n // If neither has nodeName, they're duplicates\n if (!hasNodeName && !hasOtherNodeName) return true;\n\n // If one has nodeName and other doesn't, they're not duplicates\n if (hasNodeName !== hasOtherNodeName) return false;\n\n // If both have nodeName, they're duplicates only if the names match\n return action.nodeName === otherAction.nodeName;\n });\n\n if (hasDuplicate) {\n const message = action.nodeName\n ? `Found multiple state renders for agent ${action.name} and node ${action.nodeName}. State renders might get overridden`\n : `Found multiple state renders for agent ${action.name}. State renders might get overridden`;\n\n addToast({\n type: \"warning\",\n message,\n id: `dup-action-${action.name}`,\n });\n }\n }, [coAgentStateRenders]);\n\n useEffect(() => {\n setCoAgentStateRender(idRef.current, action as any);\n if (chatComponentsCache.current !== null && action.render !== undefined) {\n chatComponentsCache.current.coAgentStateRenders[key] = action.render;\n }\n return () => {\n removeCoAgentStateRender(idRef.current);\n };\n }, [\n setCoAgentStateRender,\n removeCoAgentStateRender,\n action.name,\n // include render only if it's a string\n typeof action.render === \"string\" ? action.render : undefined,\n // dependencies set by the developer\n ...(dependencies || []),\n ]);\n}\n"],"mappings":";;;;;;;;AA2CA,SAAS,QAAQ,YAAY,iBAAiB;AAE9C,SAAS,UAAU,qCAAqC;AAejD,SAAS,sBACd,QACA,cACM;AACN,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,cAAc;AAC7B,QAAM,QAAQ,OAAe,SAAS,CAAC;AACvC,QAAM,EAAE,gBAAgB,SAAS,IAAI,SAAS;AAE9C,YAAU,MAAM;AACd,SAAI,mDAAiB,WAAU,CAAC,gBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,IAAI,GAAG;AACnF,YAAM,UAAU,mCAAmC,OAAO;AAG1D,YAAM,aAAa,IAAI,8BAA8B;AAAA,QACnD,WAAW,OAAO;AAAA,QAClB,iBAAiB,gBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,GAAG,EAAE;AAAA,MAC1E,CAAC;AACD,qBAAe,UAAU;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,eAAe,CAAC;AAEpB,QAAM,MAAM,GAAG,OAAO,QAAQ,OAAO,YAAY;AAEjD,MAAI,iBAAiB,QAAW;AAC9B,QAAI,oBAAoB,MAAM,OAAO,GAAG;AACtC,0BAAoB,MAAM,OAAO,EAAE,UAAU,OAAO;AACpD,UAAI,OAAO,OAAO,WAAW,YAAY;AACvC,YAAI,oBAAoB,YAAY,MAAM;AACxC,8BAAoB,QAAQ,oBAAoB,GAAG,IAAI,OAAO;AAAA,QAChE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,YAAU,MAAM;AAEd,UAAM,YAAY,MAAM;AACxB,UAAM,eAAe,OAAO,QAAQ,mBAAmB,EAAE,KAAK,CAAC,CAAC,IAAI,WAAW,MAAM;AAEnF,UAAI,OAAO;AAAW,eAAO;AAG7B,UAAI,YAAY,SAAS,OAAO;AAAM,eAAO;AAG7C,YAAM,cAAc,CAAC,CAAC,OAAO;AAC7B,YAAM,mBAAmB,CAAC,CAAC,YAAY;AAGvC,UAAI,CAAC,eAAe,CAAC;AAAkB,eAAO;AAG9C,UAAI,gBAAgB;AAAkB,eAAO;AAG7C,aAAO,OAAO,aAAa,YAAY;AAAA,IACzC,CAAC;AAED,QAAI,cAAc;AAChB,YAAM,UAAU,OAAO,WACnB,0CAA0C,OAAO,iBAAiB,OAAO,iDACzE,0CAA0C,OAAO;AAErD,eAAS;AAAA,QACP,MAAM;AAAA,QACN;AAAA,QACA,IAAI,cAAc,OAAO;AAAA,MAC3B,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,mBAAmB,CAAC;AAExB,YAAU,MAAM;AACd,0BAAsB,MAAM,SAAS,MAAa;AAClD,QAAI,oBAAoB,YAAY,QAAQ,OAAO,WAAW,QAAW;AACvE,0BAAoB,QAAQ,oBAAoB,GAAG,IAAI,OAAO;AAAA,IAChE;AACA,WAAO,MAAM;AACX,+BAAyB,MAAM,OAAO;AAAA,IACxC;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA;AAAA,IAEP,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS;AAAA;AAAA,IAEpD,GAAI,gBAAgB,CAAC;AAAA,EACvB,CAAC;AACH;","names":[]}
|
|
@@ -50,7 +50,7 @@ var emptyCopilotContext = {
|
|
|
50
50
|
},
|
|
51
51
|
removeChatSuggestionConfiguration: () => {
|
|
52
52
|
},
|
|
53
|
-
showDevConsole:
|
|
53
|
+
showDevConsole: false,
|
|
54
54
|
coagentStates: {},
|
|
55
55
|
setCoagentStates: () => {
|
|
56
56
|
},
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
CopilotContext,
|
|
94
94
|
useCopilotContext
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-6KGEF242.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context/copilot-context.tsx"],"sourcesContent":["import { CopilotCloudConfig, FunctionCallHandler } from \"@copilotkit/shared\";\nimport {\n ActionRenderProps,\n CatchAllActionRenderProps,\n FrontendAction,\n} from \"../types/frontend-action\";\nimport React from \"react\";\nimport { TreeNodeId, Tree } from \"../hooks/use-tree\";\nimport { DocumentPointer } from \"../types\";\nimport { CopilotChatSuggestionConfiguration } from \"../types/chat-suggestion-configuration\";\nimport { CoAgentStateRender, CoAgentStateRenderProps } from \"../types/coagent-action\";\nimport { CoagentState } from \"../types/coagent-state\";\nimport {\n CopilotRuntimeClient,\n ExtensionsInput,\n ForwardedParametersInput,\n} from \"@copilotkit/runtime-client-gql\";\nimport { Agent } from \"@copilotkit/runtime-client-gql\";\nimport {\n LangGraphInterruptAction,\n LangGraphInterruptActionSetter,\n} from \"../types/interrupt-action\";\n\n/**\n * Interface for the configuration of the Copilot API.\n */\nexport interface CopilotApiConfig {\n /**\n * The public API key for Copilot Cloud.\n */\n publicApiKey?: string;\n\n /**\n * The configuration for Copilot Cloud.\n */\n cloud?: CopilotCloudConfig;\n\n /**\n * The endpoint for the chat API.\n */\n chatApiEndpoint: string;\n\n /**\n * The endpoint for the Copilot transcribe audio service.\n */\n transcribeAudioUrl?: string;\n\n /**\n * The endpoint for the Copilot text to speech service.\n */\n textToSpeechUrl?: string;\n\n /**\n * additional headers to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'Authorization': 'Bearer your_token_here'\n * }\n * ```\n */\n headers: Record<string, string>;\n\n /**\n * Custom properties to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'user_id': 'user_id'\n * }\n * ```\n */\n properties?: Record<string, any>;\n\n /**\n * Indicates whether the user agent should send or receive cookies from the other domain\n * in the case of cross-origin requests.\n */\n credentials?: RequestCredentials;\n\n /**\n * Optional configuration for connecting to Model Context Protocol (MCP) servers.\n * This is typically derived from the CopilotKitProps and used internally.\n * @experimental\n */\n mcpServers?: Array<{ endpoint: string; apiKey?: string }>;\n}\n\nexport type InChatRenderFunction<TProps = ActionRenderProps<any> | CatchAllActionRenderProps<any>> =\n (props: TProps) => string | JSX.Element;\nexport type CoagentInChatRenderFunction = (\n props: CoAgentStateRenderProps<any>,\n) => string | JSX.Element | undefined | null;\n\nexport interface ChatComponentsCache {\n actions: Record<string, InChatRenderFunction | string>;\n coAgentStateRenders: Record<string, CoagentInChatRenderFunction | string>;\n}\n\nexport interface AgentSession {\n agentName: string;\n threadId?: string;\n nodeName?: string;\n}\n\nexport interface AuthState {\n status: \"authenticated\" | \"unauthenticated\";\n authHeaders: Record<string, string>;\n userId?: string;\n metadata?: Record<string, any>;\n}\n\nexport type ActionName = string;\nexport type ContextTree = Tree;\n\nexport interface CopilotContextParams {\n // function-calling\n actions: Record<string, FrontendAction<any>>;\n setAction: (id: string, action: FrontendAction<any>) => void;\n removeAction: (id: string) => void;\n\n // coagent actions\n coAgentStateRenders: Record<string, CoAgentStateRender<any>>;\n setCoAgentStateRender: (id: string, stateRender: CoAgentStateRender<any>) => void;\n removeCoAgentStateRender: (id: string) => void;\n\n chatComponentsCache: React.RefObject<ChatComponentsCache>;\n\n getFunctionCallHandler: (\n customEntryPoints?: Record<string, FrontendAction<any>>,\n ) => FunctionCallHandler;\n\n // text context\n addContext: (context: string, parentId?: string, categories?: string[]) => TreeNodeId;\n removeContext: (id: TreeNodeId) => void;\n getAllContext: () => Tree;\n getContextString: (documents: DocumentPointer[], categories: string[]) => string;\n\n // document context\n addDocumentContext: (documentPointer: DocumentPointer, categories?: string[]) => TreeNodeId;\n removeDocumentContext: (documentId: string) => void;\n getDocumentsContext: (categories: string[]) => DocumentPointer[];\n\n isLoading: boolean;\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\n chatSuggestionConfiguration: { [key: string]: CopilotChatSuggestionConfiguration };\n addChatSuggestionConfiguration: (\n id: string,\n suggestion: CopilotChatSuggestionConfiguration,\n ) => void;\n removeChatSuggestionConfiguration: (id: string) => void;\n\n chatInstructions: string;\n setChatInstructions: React.Dispatch<React.SetStateAction<string>>;\n\n additionalInstructions?: string[];\n setAdditionalInstructions: React.Dispatch<React.SetStateAction<string[]>>;\n\n // api endpoints\n copilotApiConfig: CopilotApiConfig;\n\n showDevConsole: boolean;\n\n // agents\n coagentStates: Record<string, CoagentState>;\n setCoagentStates: React.Dispatch<React.SetStateAction<Record<string, CoagentState>>>;\n coagentStatesRef: React.RefObject<Record<string, CoagentState>>;\n setCoagentStatesWithRef: (\n value:\n | Record<string, CoagentState>\n | ((prev: Record<string, CoagentState>) => Record<string, CoagentState>),\n ) => void;\n\n agentSession: AgentSession | null;\n setAgentSession: React.Dispatch<React.SetStateAction<AgentSession | null>>;\n\n agentLock: string | null;\n\n threadId: string;\n setThreadId: React.Dispatch<React.SetStateAction<string>>;\n\n runId: string | null;\n setRunId: React.Dispatch<React.SetStateAction<string | null>>;\n\n // The chat abort controller can be used to stop generation globally,\n // i.e. when using `stop()` from `useChat`\n chatAbortControllerRef: React.MutableRefObject<AbortController | null>;\n\n // runtime\n runtimeClient: CopilotRuntimeClient;\n\n /**\n * The forwarded parameters to use for the task.\n */\n forwardedParameters?: Pick<ForwardedParametersInput, \"temperature\">;\n availableAgents: Agent[];\n\n /**\n * The auth states for the CopilotKit.\n */\n authStates_c?: Record<ActionName, AuthState>;\n setAuthStates_c?: React.Dispatch<React.SetStateAction<Record<ActionName, AuthState>>>;\n\n /**\n * The auth config for the CopilotKit.\n */\n authConfig_c?: {\n SignInComponent: React.ComponentType<{\n onSignInComplete: (authState: AuthState) => void;\n }>;\n };\n\n extensions: ExtensionsInput;\n setExtensions: React.Dispatch<React.SetStateAction<ExtensionsInput>>;\n langGraphInterruptAction: LangGraphInterruptAction | null;\n setLangGraphInterruptAction: LangGraphInterruptActionSetter;\n removeLangGraphInterruptAction: () => void;\n}\n\nconst emptyCopilotContext: CopilotContextParams = {\n actions: {},\n setAction: () => {},\n removeAction: () => {},\n\n coAgentStateRenders: {},\n setCoAgentStateRender: () => {},\n removeCoAgentStateRender: () => {},\n\n chatComponentsCache: { current: { actions: {}, coAgentStateRenders: {} } },\n getContextString: (documents: DocumentPointer[], categories: string[]) =>\n returnAndThrowInDebug(\"\"),\n addContext: () => \"\",\n removeContext: () => {},\n getAllContext: () => [],\n\n getFunctionCallHandler: () => returnAndThrowInDebug(async () => {}),\n\n isLoading: false,\n setIsLoading: () => returnAndThrowInDebug(false),\n\n chatInstructions: \"\",\n setChatInstructions: () => returnAndThrowInDebug(\"\"),\n\n additionalInstructions: [],\n setAdditionalInstructions: () => returnAndThrowInDebug([]),\n\n getDocumentsContext: (categories: string[]) => returnAndThrowInDebug([]),\n addDocumentContext: () => returnAndThrowInDebug(\"\"),\n removeDocumentContext: () => {},\n runtimeClient: {} as any,\n\n copilotApiConfig: new (class implements CopilotApiConfig {\n get chatApiEndpoint(): string {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n }\n\n get headers(): Record<string, string> {\n return {};\n }\n get body(): Record<string, any> {\n return {};\n }\n })(),\n\n chatSuggestionConfiguration: {},\n addChatSuggestionConfiguration: () => {},\n removeChatSuggestionConfiguration: () => {},\n showDevConsole: false,\n coagentStates: {},\n setCoagentStates: () => {},\n coagentStatesRef: { current: {} },\n setCoagentStatesWithRef: () => {},\n agentSession: null,\n setAgentSession: () => {},\n forwardedParameters: {},\n agentLock: null,\n threadId: \"\",\n setThreadId: () => {},\n runId: null,\n setRunId: () => {},\n chatAbortControllerRef: { current: null },\n availableAgents: [],\n extensions: {},\n setExtensions: () => {},\n langGraphInterruptAction: null,\n setLangGraphInterruptAction: () => null,\n removeLangGraphInterruptAction: () => null,\n};\n\nexport const CopilotContext = React.createContext<CopilotContextParams>(emptyCopilotContext);\n\nexport function useCopilotContext(): CopilotContextParams {\n const context = React.useContext(CopilotContext);\n if (context === emptyCopilotContext) {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n }\n return context;\n}\n\nfunction returnAndThrowInDebug<T>(_value: T): T {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n}\n"],"mappings":";;;;;AAMA,OAAO,WAAW;AAwNlB,IAAM,sBAA4C;AAAA,EAChD,SAAS,CAAC;AAAA,EACV,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB,cAAc,MAAM;AAAA,EAAC;AAAA,EAErB,qBAAqB,CAAC;AAAA,EACtB,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAC9B,0BAA0B,MAAM;AAAA,EAAC;AAAA,EAEjC,qBAAqB,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAAA,EACzE,kBAAkB,CAAC,WAA8B,eAC/C,sBAAsB,EAAE;AAAA,EAC1B,YAAY,MAAM;AAAA,EAClB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe,MAAM,CAAC;AAAA,EAEtB,wBAAwB,MAAM,sBAAsB,MAAY;AAAA,EAAC,EAAC;AAAA,EAElE,WAAW;AAAA,EACX,cAAc,MAAM,sBAAsB,KAAK;AAAA,EAE/C,kBAAkB;AAAA,EAClB,qBAAqB,MAAM,sBAAsB,EAAE;AAAA,EAEnD,wBAAwB,CAAC;AAAA,EACzB,2BAA2B,MAAM,sBAAsB,CAAC,CAAC;AAAA,EAEzD,qBAAqB,CAAC,eAAyB,sBAAsB,CAAC,CAAC;AAAA,EACvE,oBAAoB,MAAM,sBAAsB,EAAE;AAAA,EAClD,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAC9B,eAAe,CAAC;AAAA,EAEhB,kBAAkB,IAAK,MAAkC;AAAA,IACvD,IAAI,kBAA0B;AAC5B,YAAM,IAAI,MAAM,uEAAuE;AAAA,IACzF;AAAA,IAEA,IAAI,UAAkC;AACpC,aAAO,CAAC;AAAA,IACV;AAAA,IACA,IAAI,OAA4B;AAC9B,aAAO,CAAC;AAAA,IACV;AAAA,EACF,EAAG;AAAA,EAEH,6BAA6B,CAAC;AAAA,EAC9B,gCAAgC,MAAM;AAAA,EAAC;AAAA,EACvC,mCAAmC,MAAM;AAAA,EAAC;AAAA,EAC1C,gBAAgB;AAAA,EAChB,eAAe,CAAC;AAAA,EAChB,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,kBAAkB,EAAE,SAAS,CAAC,EAAE;AAAA,EAChC,yBAAyB,MAAM;AAAA,EAAC;AAAA,EAChC,cAAc;AAAA,EACd,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,qBAAqB,CAAC;AAAA,EACtB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,wBAAwB,EAAE,SAAS,KAAK;AAAA,EACxC,iBAAiB,CAAC;AAAA,EAClB,YAAY,CAAC;AAAA,EACb,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,0BAA0B;AAAA,EAC1B,6BAA6B,MAAM;AAAA,EACnC,gCAAgC,MAAM;AACxC;AAEO,IAAM,iBAAiB,MAAM,cAAoC,mBAAmB;AAEpF,SAAS,oBAA0C;AACxD,QAAM,UAAU,MAAM,WAAW,cAAc;AAC/C,MAAI,YAAY,qBAAqB;AACnC,UAAM,IAAI,MAAM,uEAAuE;AAAA,EACzF;AACA,SAAO;AACT;AAEA,SAAS,sBAAyB,QAAc;AAC9C,QAAM,IAAI,MAAM,uEAAuE;AACzF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6KGEF242.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
6
6
|
import { useEffect } from "react";
|
|
@@ -21,4 +21,4 @@ function useCopilotAdditionalInstructions({ instructions, available = "enabled"
|
|
|
21
21
|
export {
|
|
22
22
|
useCopilotAdditionalInstructions
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-C6F6EQNA.mjs.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExclamationMarkIcon
|
|
3
|
+
} from "./chunk-O7ARI5CV.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useToast
|
|
6
|
+
} from "./chunk-VRXANACV.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__async
|
|
9
|
+
} from "./chunk-SKC7AJIV.mjs";
|
|
10
|
+
|
|
11
|
+
// src/components/error-boundary/error-utils.tsx
|
|
12
|
+
import { useCallback } from "react";
|
|
13
|
+
import ReactMarkdown from "react-markdown";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
function ErrorToast({ errors }) {
|
|
16
|
+
const errorsToRender = errors.map((error, idx) => {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
const originalError = "extensions" in error ? (_a = error.extensions) == null ? void 0 : _a.originalError : {};
|
|
19
|
+
const message = (_b = originalError == null ? void 0 : originalError.message) != null ? _b : error.message;
|
|
20
|
+
const code = "extensions" in error ? (_c = error.extensions) == null ? void 0 : _c.code : null;
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
style: {
|
|
25
|
+
marginTop: idx === 0 ? 0 : 10,
|
|
26
|
+
marginBottom: 14
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx(ExclamationMarkIcon, { style: { marginBottom: 4 } }),
|
|
30
|
+
code && /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
style: {
|
|
34
|
+
fontWeight: "600",
|
|
35
|
+
marginBottom: 4
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
"Copilot Runtime Error:",
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ jsx("span", { style: { fontFamily: "monospace", fontWeight: "normal" }, children: code })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(ReactMarkdown, { children: message })
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
idx
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
style: {
|
|
54
|
+
fontSize: "13px",
|
|
55
|
+
maxWidth: "600px"
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
errorsToRender,
|
|
59
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "11px", opacity: 0.75 }, children: "NOTE: This error only displays during local development." })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function useErrorToast() {
|
|
65
|
+
const { addToast } = useToast();
|
|
66
|
+
return useCallback(
|
|
67
|
+
(error) => {
|
|
68
|
+
const errorId = error.map((err) => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
const message = "extensions" in err ? ((_b = (_a = err.extensions) == null ? void 0 : _a.originalError) == null ? void 0 : _b.message) || err.message : err.message;
|
|
71
|
+
const stack = err.stack || "";
|
|
72
|
+
return btoa(message + stack).slice(0, 32);
|
|
73
|
+
}).join("|");
|
|
74
|
+
addToast({
|
|
75
|
+
type: "error",
|
|
76
|
+
id: errorId,
|
|
77
|
+
// Toast libraries typically dedupe by id
|
|
78
|
+
message: /* @__PURE__ */ jsx(ErrorToast, { errors: error })
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
[addToast]
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function useAsyncCallback(callback, deps) {
|
|
85
|
+
const addErrorToast = useErrorToast();
|
|
86
|
+
return useCallback((...args) => __async(this, null, function* () {
|
|
87
|
+
try {
|
|
88
|
+
return yield callback(...args);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error("Error in async callback:", error);
|
|
91
|
+
addErrorToast([error]);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}), deps);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
ErrorToast,
|
|
99
|
+
useErrorToast,
|
|
100
|
+
useAsyncCallback
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=chunk-CCESTGAM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/error-boundary/error-utils.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 Runtime 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"],"mappings":";;;;;;;;;;;AAAA,SAAgB,mBAAmB;AAInC,OAAO,mBAAmB;AAsBlB,cAGE,YAHF;AAfD,SAAS,WAAW,EAAE,OAAO,GAAyC;AAC3E,QAAM,iBAAiB,OAAO,IAAI,CAAC,OAAO,QAAQ;AAZpD;AAaI,UAAM,gBACJ,gBAAgB,SAAS,WAAM,eAAN,mBAAkB,gBAA8C,CAAC;AAC5F,UAAM,WAAU,oDAAe,YAAf,YAA0B,MAAM;AAChD,UAAM,OAAO,gBAAgB,SAAS,WAAM,eAAN,mBAAkB,OAAkB;AAE1E,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,OAAO;AAAA,UACL,WAAW,QAAQ,IAAI,IAAI;AAAA,UAC3B,cAAc;AAAA,QAChB;AAAA,QAEA;AAAA,8BAAC,uBAAoB,OAAO,EAAE,cAAc,EAAE,GAAG;AAAA,UAEhD,QACC;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,YAAY;AAAA,gBACZ,cAAc;AAAA,cAChB;AAAA,cACD;AAAA;AAAA,gBACwB;AAAA,gBACvB,oBAAC,UAAK,OAAO,EAAE,YAAY,aAAa,YAAY,SAAS,GAAI,gBAAK;AAAA;AAAA;AAAA,UACxE;AAAA,UAEF,oBAAC,iBAAe,mBAAQ;AAAA;AAAA;AAAA,MAnBnB;AAAA,IAoBP;AAAA,EAEJ,CAAC;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,MAEC;AAAA;AAAA,QACD,oBAAC,SAAI,OAAO,EAAE,UAAU,QAAQ,SAAS,KAAK,GAAG,sEAEjD;AAAA;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,gBAAgB;AAC9B,QAAM,EAAE,SAAS,IAAI,SAAS;AAE9B,SAAO;AAAA,IACL,CAAC,UAAoC;AACnC,YAAM,UAAU,MACb,IAAI,CAAC,QAAQ;AAhEtB;AAiEU,cAAM,UACJ,gBAAgB,QACX,eAAI,eAAJ,mBAAgB,kBAAhB,mBAAuC,YAAW,IAAI,UACvD,IAAI;AACV,cAAM,QAAQ,IAAI,SAAS;AAC3B,eAAO,KAAK,UAAU,KAAK,EAAE,MAAM,GAAG,EAAE;AAAA,MAC1C,CAAC,EACA,KAAK,GAAG;AAEX,eAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA;AAAA,QACJ,SAAS,oBAAC,cAAW,QAAQ,OAAO;AAAA,MACtC,CAAC;AAAA,IACH;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACF;AAEO,SAAS,iBACd,UACA,MACA;AACA,QAAM,gBAAgB,cAAc;AACpC,SAAO,YAAY,IAAU,SAAwB;AACnD,QAAI;AACF,aAAO,MAAM,SAAS,GAAG,IAAI;AAAA,IAC/B,SAAS,OAAP;AACA,cAAQ,MAAM,4BAA4B,KAAK;AAE/C,oBAAc,CAAC,KAAK,CAAC;AACrB,YAAM;AAAA,IACR;AAAA,EACF,IAAG,IAAI;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/dev-console.ts"],"sourcesContent":["export function shouldShowDevConsole(showDevConsole: boolean): boolean {\n return showDevConsole;\n}\n"],"mappings":";AAAO,SAAS,qBAAqB,gBAAkC;AACrE,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// src/components/usage-banner.tsx
|
|
2
|
+
import { Severity, ERROR_NAMES, ErrorVisibility } from "@copilotkit/shared";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var defaultIcons = {
|
|
5
|
+
[Severity.CRITICAL]: /* @__PURE__ */ jsxs(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
width: "18",
|
|
10
|
+
height: "18",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "2.5",
|
|
13
|
+
fill: "none",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
18
|
+
/* @__PURE__ */ jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
19
|
+
/* @__PURE__ */ jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
[Severity.WARNING]: /* @__PURE__ */ jsxs(
|
|
24
|
+
"svg",
|
|
25
|
+
{
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
width: "18",
|
|
28
|
+
height: "18",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "2.5",
|
|
31
|
+
fill: "none",
|
|
32
|
+
strokeLinecap: "round",
|
|
33
|
+
strokeLinejoin: "round",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
36
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
37
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
[Severity.INFO]: /* @__PURE__ */ jsxs(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
viewBox: "0 0 24 24",
|
|
45
|
+
width: "18",
|
|
46
|
+
height: "18",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: "2.5",
|
|
49
|
+
fill: "none",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
54
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
55
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
};
|
|
60
|
+
function UsageBanner({
|
|
61
|
+
severity = Severity.CRITICAL,
|
|
62
|
+
message = "",
|
|
63
|
+
icon,
|
|
64
|
+
onClose,
|
|
65
|
+
actions
|
|
66
|
+
}) {
|
|
67
|
+
if (!message || !severity) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const parseMessage = (rawMessage) => {
|
|
71
|
+
const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
72
|
+
const matches = Array.from(rawMessage.matchAll(linkRegex));
|
|
73
|
+
if (matches.length > 0) {
|
|
74
|
+
let cleanMessage2 = rawMessage.replace(/\.\s*See more:\s*\[([^\]]+)\]\(([^)]+)\)/g, ".").replace(/See more:\s*\[([^\]]+)\]\(([^)]+)\)/g, "").trim();
|
|
75
|
+
return cleanMessage2;
|
|
76
|
+
}
|
|
77
|
+
return rawMessage;
|
|
78
|
+
};
|
|
79
|
+
const cleanMessage = parseMessage(message);
|
|
80
|
+
const Icon = icon || defaultIcons[severity];
|
|
81
|
+
const themeConfigs = {
|
|
82
|
+
[Severity.INFO]: {
|
|
83
|
+
bg: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
|
|
84
|
+
border: "#93c5fd",
|
|
85
|
+
text: "#1e40af",
|
|
86
|
+
icon: "#3b82f6",
|
|
87
|
+
primaryBtn: "#3b82f6",
|
|
88
|
+
primaryBtnHover: "#2563eb"
|
|
89
|
+
},
|
|
90
|
+
[Severity.WARNING]: {
|
|
91
|
+
bg: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
|
|
92
|
+
border: "#fbbf24",
|
|
93
|
+
text: "#92400e",
|
|
94
|
+
icon: "#f59e0b",
|
|
95
|
+
primaryBtn: "#f59e0b",
|
|
96
|
+
primaryBtnHover: "#d97706"
|
|
97
|
+
},
|
|
98
|
+
[Severity.CRITICAL]: {
|
|
99
|
+
bg: "linear-gradient(135deg, #fef2f2 0%, #fecaca 100%)",
|
|
100
|
+
border: "#f87171",
|
|
101
|
+
text: "#991b1b",
|
|
102
|
+
icon: "#ef4444",
|
|
103
|
+
primaryBtn: "#ef4444",
|
|
104
|
+
primaryBtnHover: "#dc2626"
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const themeConfig = themeConfigs[severity] || themeConfigs[Severity.CRITICAL];
|
|
108
|
+
return /* @__PURE__ */ jsxs(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
style: {
|
|
112
|
+
position: "fixed",
|
|
113
|
+
bottom: "20px",
|
|
114
|
+
left: "50%",
|
|
115
|
+
transform: "translateX(-50%)",
|
|
116
|
+
maxWidth: "min(95vw, 680px)",
|
|
117
|
+
width: "100%",
|
|
118
|
+
zIndex: 1e4,
|
|
119
|
+
animation: "bannerSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
120
|
+
},
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
123
|
+
@keyframes bannerSlideIn {
|
|
124
|
+
from {
|
|
125
|
+
opacity: 0;
|
|
126
|
+
transform: translateX(-50%) translateY(10px);
|
|
127
|
+
}
|
|
128
|
+
to {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
transform: translateX(-50%) translateY(0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
` }),
|
|
134
|
+
/* @__PURE__ */ jsxs(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
style: {
|
|
138
|
+
display: "flex",
|
|
139
|
+
alignItems: "flex-start",
|
|
140
|
+
gap: "14px",
|
|
141
|
+
borderRadius: "16px",
|
|
142
|
+
border: `1px solid ${themeConfig.border}`,
|
|
143
|
+
background: themeConfig.bg,
|
|
144
|
+
padding: "18px 20px",
|
|
145
|
+
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
|
|
146
|
+
position: "relative",
|
|
147
|
+
backdropFilter: "blur(10px)",
|
|
148
|
+
WebkitBackdropFilter: "blur(10px)"
|
|
149
|
+
},
|
|
150
|
+
children: [
|
|
151
|
+
onClose && /* @__PURE__ */ jsx(
|
|
152
|
+
"button",
|
|
153
|
+
{
|
|
154
|
+
onClick: onClose,
|
|
155
|
+
style: {
|
|
156
|
+
position: "absolute",
|
|
157
|
+
top: "12px",
|
|
158
|
+
right: "12px",
|
|
159
|
+
background: "rgba(255, 255, 255, 0.8)",
|
|
160
|
+
border: "none",
|
|
161
|
+
color: themeConfig.text,
|
|
162
|
+
cursor: "pointer",
|
|
163
|
+
fontSize: "18px",
|
|
164
|
+
lineHeight: "1",
|
|
165
|
+
padding: "6px",
|
|
166
|
+
borderRadius: "8px",
|
|
167
|
+
opacity: 0.7,
|
|
168
|
+
transition: "all 0.2s ease",
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
justifyContent: "center",
|
|
172
|
+
width: "28px",
|
|
173
|
+
height: "28px"
|
|
174
|
+
},
|
|
175
|
+
title: "Close",
|
|
176
|
+
onMouseOver: (e) => {
|
|
177
|
+
e.currentTarget.style.opacity = "1";
|
|
178
|
+
e.currentTarget.style.background = "rgba(255, 255, 255, 1)";
|
|
179
|
+
e.currentTarget.style.transform = "scale(1.05)";
|
|
180
|
+
},
|
|
181
|
+
onMouseOut: (e) => {
|
|
182
|
+
e.currentTarget.style.opacity = "0.7";
|
|
183
|
+
e.currentTarget.style.background = "rgba(255, 255, 255, 0.8)";
|
|
184
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
185
|
+
},
|
|
186
|
+
children: "\xD7"
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
style: {
|
|
193
|
+
color: themeConfig.icon,
|
|
194
|
+
flexShrink: 0,
|
|
195
|
+
marginTop: "1px",
|
|
196
|
+
padding: "6px",
|
|
197
|
+
borderRadius: "10px",
|
|
198
|
+
background: "rgba(255, 255, 255, 0.7)",
|
|
199
|
+
display: "flex",
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
justifyContent: "center"
|
|
202
|
+
},
|
|
203
|
+
children: Icon
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, paddingRight: onClose ? "40px" : "0" }, children: [
|
|
207
|
+
/* @__PURE__ */ jsx(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
style: {
|
|
211
|
+
fontSize: "15px",
|
|
212
|
+
fontWeight: 600,
|
|
213
|
+
color: themeConfig.text,
|
|
214
|
+
lineHeight: "1.5",
|
|
215
|
+
marginBottom: actions ? "12px" : "0",
|
|
216
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
217
|
+
},
|
|
218
|
+
children: cleanMessage
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
actions && /* @__PURE__ */ jsxs(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
style: {
|
|
225
|
+
display: "flex",
|
|
226
|
+
gap: "10px",
|
|
227
|
+
flexWrap: "wrap"
|
|
228
|
+
},
|
|
229
|
+
children: [
|
|
230
|
+
actions.secondary && /* @__PURE__ */ jsx(
|
|
231
|
+
"button",
|
|
232
|
+
{
|
|
233
|
+
onClick: actions.secondary.onClick,
|
|
234
|
+
style: {
|
|
235
|
+
borderRadius: "10px",
|
|
236
|
+
padding: "8px 16px",
|
|
237
|
+
fontSize: "14px",
|
|
238
|
+
fontWeight: 500,
|
|
239
|
+
color: themeConfig.text,
|
|
240
|
+
backgroundColor: "rgba(255, 255, 255, 0.8)",
|
|
241
|
+
border: `1.5px solid ${themeConfig.border}`,
|
|
242
|
+
cursor: "pointer",
|
|
243
|
+
transition: "all 0.2s ease",
|
|
244
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
245
|
+
},
|
|
246
|
+
onMouseOver: (e) => {
|
|
247
|
+
e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 1)";
|
|
248
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
249
|
+
e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)";
|
|
250
|
+
},
|
|
251
|
+
onMouseOut: (e) => {
|
|
252
|
+
e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
|
253
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
254
|
+
e.currentTarget.style.boxShadow = "none";
|
|
255
|
+
},
|
|
256
|
+
children: actions.secondary.label
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
actions.primary && /* @__PURE__ */ jsx(
|
|
260
|
+
"button",
|
|
261
|
+
{
|
|
262
|
+
onClick: actions.primary.onClick,
|
|
263
|
+
style: {
|
|
264
|
+
borderRadius: "10px",
|
|
265
|
+
padding: "8px 16px",
|
|
266
|
+
fontSize: "14px",
|
|
267
|
+
fontWeight: 600,
|
|
268
|
+
color: "#fff",
|
|
269
|
+
backgroundColor: themeConfig.primaryBtn,
|
|
270
|
+
border: "none",
|
|
271
|
+
cursor: "pointer",
|
|
272
|
+
transition: "all 0.2s ease",
|
|
273
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
274
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
275
|
+
},
|
|
276
|
+
onMouseOver: (e) => {
|
|
277
|
+
e.currentTarget.style.backgroundColor = themeConfig.primaryBtnHover;
|
|
278
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
279
|
+
e.currentTarget.style.boxShadow = "0 6px 16px rgba(0, 0, 0, 0.2)";
|
|
280
|
+
},
|
|
281
|
+
onMouseOut: (e) => {
|
|
282
|
+
e.currentTarget.style.backgroundColor = themeConfig.primaryBtn;
|
|
283
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
284
|
+
e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)";
|
|
285
|
+
},
|
|
286
|
+
children: actions.primary.label
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] })
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
function renderCopilotKitUsage(error, onClose) {
|
|
301
|
+
if (error.visibility !== ErrorVisibility.BANNER) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
const extractUrlFromMessage = (message) => {
|
|
305
|
+
const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
306
|
+
const match = linkRegex.exec(message);
|
|
307
|
+
return match ? match[2] : null;
|
|
308
|
+
};
|
|
309
|
+
const getErrorActions = (error2) => {
|
|
310
|
+
switch (error2.name) {
|
|
311
|
+
case ERROR_NAMES.MISSING_PUBLIC_API_KEY_ERROR:
|
|
312
|
+
return {
|
|
313
|
+
primary: {
|
|
314
|
+
label: "Sign In",
|
|
315
|
+
onClick: () => window.location.href = "https://cloud.copilotkit.ai"
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
case ERROR_NAMES.UPGRADE_REQUIRED_ERROR:
|
|
319
|
+
return {
|
|
320
|
+
primary: {
|
|
321
|
+
label: "Upgrade",
|
|
322
|
+
onClick: () => window.location.href = "https://copilotkit.ai/"
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
case ERROR_NAMES.COPILOT_API_DISCOVERY_ERROR:
|
|
326
|
+
case ERROR_NAMES.COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR:
|
|
327
|
+
case ERROR_NAMES.COPILOT_KIT_AGENT_DISCOVERY_ERROR:
|
|
328
|
+
return {
|
|
329
|
+
primary: {
|
|
330
|
+
label: "View Docs",
|
|
331
|
+
onClick: () => {
|
|
332
|
+
var _a;
|
|
333
|
+
const urlFromMessage = extractUrlFromMessage(error2.message);
|
|
334
|
+
const urlFromExtensions = (_a = error2.extensions) == null ? void 0 : _a.troubleshootingUrl;
|
|
335
|
+
const url = urlFromMessage || urlFromExtensions || "https://docs.copilotkit.ai/troubleshooting/common-issues";
|
|
336
|
+
window.open(url, "_blank");
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
default:
|
|
341
|
+
return void 0;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
return /* @__PURE__ */ jsx(
|
|
345
|
+
UsageBanner,
|
|
346
|
+
{
|
|
347
|
+
severity: error.severity || Severity.CRITICAL,
|
|
348
|
+
message: error.message,
|
|
349
|
+
onClose,
|
|
350
|
+
actions: getErrorActions(error)
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export {
|
|
356
|
+
UsageBanner,
|
|
357
|
+
renderCopilotKitUsage
|
|
358
|
+
};
|
|
359
|
+
//# sourceMappingURL=chunk-HD2GE3DK.mjs.map
|