@copilotkit/react-core 0.0.0-fix-runtime-openai-api-key-passthrough-20260115015318 → 0.0.0-fix-thread-id-prop-20260123171313
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 +80 -5
- package/dist/{chunk-6PUNP7CD.mjs → chunk-BVBFFI7K.mjs} +3 -3
- package/dist/chunk-BVBFFI7K.mjs.map +1 -0
- package/dist/{chunk-LHERIF3L.mjs → chunk-FJEI7IBX.mjs} +2 -2
- package/dist/{chunk-F555TVE4.mjs → chunk-LMHB2D4J.mjs} +3 -3
- package/dist/chunk-LMHB2D4J.mjs.map +1 -0
- package/dist/{chunk-53K6WNJG.mjs → chunk-M7U7RZLU.mjs} +2 -2
- package/dist/{chunk-LSHFN2Y5.mjs → chunk-OBXQSB7S.mjs} +2 -2
- package/dist/{chunk-4YZA2BZC.mjs → chunk-PZ2SR7P3.mjs} +3 -3
- package/dist/{chunk-3V5TOYKW.mjs → chunk-U2ZHE3ND.mjs} +2 -2
- package/dist/{chunk-FQFXYAV7.mjs → chunk-W5BKJN46.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +20 -0
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -12
- 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 +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/context/threads-context.js +2 -2
- package/dist/context/threads-context.js.map +1 -1
- package/dist/context/threads-context.mjs +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/use-coagent-state-render-bridge.mjs +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.js +2 -2
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +4 -4
- package/dist/hooks/use-copilot-chat.js +2 -2
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +4 -4
- package/dist/hooks/use-copilot-chat_internal.js +2 -2
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/lib/copilot-task.mjs +5 -5
- package/dist/lib/index.mjs +5 -5
- package/dist/setupTests.js +2 -1
- package/dist/setupTests.js.map +1 -1
- package/dist/setupTests.mjs +2 -1
- package/dist/setupTests.mjs.map +1 -1
- package/jest.config.js +1 -1
- package/package.json +11 -15
- package/src/components/copilot-provider/copilotkit-props.tsx +20 -0
- package/src/components/error-boundary/error-utils.tsx +2 -2
- package/src/context/__tests__/threads-context.test.tsx +28 -0
- package/src/context/threads-context.tsx +2 -2
- package/src/setupTests.ts +1 -0
- package/dist/chunk-6PUNP7CD.mjs.map +0 -1
- package/dist/chunk-F555TVE4.mjs.map +0 -1
- /package/dist/{chunk-LHERIF3L.mjs.map → chunk-FJEI7IBX.mjs.map} +0 -0
- /package/dist/{chunk-53K6WNJG.mjs.map → chunk-M7U7RZLU.mjs.map} +0 -0
- /package/dist/{chunk-LSHFN2Y5.mjs.map → chunk-OBXQSB7S.mjs.map} +0 -0
- /package/dist/{chunk-4YZA2BZC.mjs.map → chunk-PZ2SR7P3.mjs.map} +0 -0
- /package/dist/{chunk-3V5TOYKW.mjs.map → chunk-U2ZHE3ND.mjs.map} +0 -0
- /package/dist/{chunk-FQFXYAV7.mjs.map → chunk-W5BKJN46.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,88 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-thread-id-prop-20260123171313
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- @
|
|
10
|
-
- @
|
|
7
|
+
- d655e75: fix: update ag-ui dependencies
|
|
8
|
+
- Updated dependencies [d655e75]
|
|
9
|
+
- @copilotkit/shared@0.0.0-fix-thread-id-prop-20260123171313
|
|
10
|
+
- @copilotkit/runtime-client-gql@0.0.0-fix-thread-id-prop-20260123171313
|
|
11
|
+
- @copilotkitnext/core@0.0.0-fix-thread-id-prop-20260123171313
|
|
12
|
+
- @copilotkitnext/react@0.0.0-fix-thread-id-prop-20260123171313
|
|
13
|
+
|
|
14
|
+
## 1.51.3-next.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- d655e75: fix: update ag-ui dependencies
|
|
19
|
+
- Updated dependencies [d655e75]
|
|
20
|
+
- @copilotkit/shared@1.51.3-next.3
|
|
21
|
+
- @copilotkit/runtime-client-gql@1.51.3-next.3
|
|
22
|
+
- @copilotkitnext/core@1.51.3-next.3
|
|
23
|
+
- @copilotkitnext/react@1.51.3-next.3
|
|
24
|
+
|
|
25
|
+
## 1.51.3-next.2
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- @copilotkit/runtime-client-gql@1.51.3-next.2
|
|
30
|
+
- @copilotkit/shared@1.51.3-next.2
|
|
31
|
+
- @copilotkitnext/core@1.51.3-next.2
|
|
32
|
+
- @copilotkitnext/react@1.51.3-next.2
|
|
33
|
+
|
|
34
|
+
## 1.51.3-next.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- @copilotkit/runtime-client-gql@1.51.3-next.1
|
|
39
|
+
- @copilotkit/shared@1.51.3-next.1
|
|
40
|
+
- @copilotkitnext/core@1.51.3-next.1
|
|
41
|
+
- @copilotkitnext/react@1.51.3-next.1
|
|
42
|
+
|
|
43
|
+
## 1.51.3-next.0
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- @copilotkit/runtime-client-gql@1.51.3-next.0
|
|
48
|
+
- @copilotkit/shared@1.51.3-next.0
|
|
49
|
+
- @copilotkitnext/core@1.51.3-next.0
|
|
50
|
+
- @copilotkitnext/react@1.51.3-next.0
|
|
51
|
+
|
|
52
|
+
## 1.51.2
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- e59d23f: Use deps instead of peerdeps
|
|
57
|
+
- e59d23f: Move in-repo deps from peerdeps to actual deps
|
|
58
|
+
- Updated dependencies [e59d23f]
|
|
59
|
+
- Updated dependencies [e59d23f]
|
|
60
|
+
- @copilotkit/runtime-client-gql@1.51.2
|
|
61
|
+
- @copilotkitnext/react@1.51.2
|
|
62
|
+
- @copilotkitnext/core@1.51.2
|
|
63
|
+
- @copilotkit/shared@1.51.2
|
|
64
|
+
|
|
65
|
+
## 1.51.2-next.1
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- e59d23f: Use deps instead of peerdeps
|
|
70
|
+
- e59d23f: Move in-repo deps from peerdeps to actual deps
|
|
71
|
+
- Updated dependencies [e59d23f]
|
|
72
|
+
- Updated dependencies [e59d23f]
|
|
73
|
+
- @copilotkit/runtime-client-gql@1.51.2-next.1
|
|
74
|
+
- @copilotkitnext/react@1.51.2-next.1
|
|
75
|
+
- @copilotkitnext/core@1.51.2-next.1
|
|
76
|
+
- @copilotkit/shared@1.51.2-next.1
|
|
77
|
+
|
|
78
|
+
## 1.51.2-next.0
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- @copilotkit/runtime-client-gql@1.51.2-next.0
|
|
83
|
+
- @copilotkit/shared@1.51.2-next.0
|
|
84
|
+
- @copilotkitnext/core@1.51.2-next.0
|
|
85
|
+
- @copilotkitnext/react@1.51.2-next.0
|
|
11
86
|
|
|
12
87
|
## 1.51.1
|
|
13
88
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
// src/components/error-boundary/error-utils.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
13
|
-
import
|
|
13
|
+
import { Streamdown } from "streamdown";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
function ErrorToast({ errors }) {
|
|
16
16
|
const errorsToRender = errors.map((error, idx) => {
|
|
@@ -41,7 +41,7 @@ function ErrorToast({ errors }) {
|
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
44
|
+
/* @__PURE__ */ jsx(Streamdown, { children: message })
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
idx
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
useErrorToast,
|
|
100
100
|
useAsyncCallback
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-BVBFFI7K.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 { Streamdown } from \"streamdown\";\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 <Streamdown>{message}</Streamdown>\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 (errors: (Error | GraphQLError)[]) => {\n const errorId = errors\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={errors} />,\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,SAAS,kBAAkB;AAsBnB,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,cAAY,mBAAQ;AAAA;AAAA;AAAA,MAnBhB;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,WAAqC;AACpC,YAAM,UAAU,OACb,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,QAAgB;AAAA,MACvC,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":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-PMAFHQ7P.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useErrorToast
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BVBFFI7K.mjs";
|
|
7
7
|
import {
|
|
8
8
|
UsageBanner,
|
|
9
9
|
getErrorActions
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
CopilotErrorBoundary,
|
|
81
81
|
ErrorToast
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-FJEI7IBX.mjs.map
|
|
@@ -4,8 +4,8 @@ import { randomUUID } from "@copilotkit/shared";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
var ThreadsContext = createContext(void 0);
|
|
6
6
|
function ThreadsProvider({ children, threadId: explicitThreadId }) {
|
|
7
|
-
const [internalThreadId, setThreadId] = useState(
|
|
8
|
-
const threadId = internalThreadId;
|
|
7
|
+
const [internalThreadId, setThreadId] = useState(() => randomUUID());
|
|
8
|
+
const threadId = explicitThreadId != null ? explicitThreadId : internalThreadId;
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
10
10
|
ThreadsContext.Provider,
|
|
11
11
|
{
|
|
@@ -30,4 +30,4 @@ export {
|
|
|
30
30
|
ThreadsProvider,
|
|
31
31
|
useThreads
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-LMHB2D4J.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context/threads-context.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, ReactNode, SetStateAction } from \"react\";\nimport { randomUUID } from \"@copilotkit/shared\";\n\nexport interface ThreadsContextValue {\n threadId: string;\n setThreadId: (value: SetStateAction<string>) => void;\n}\n\nconst ThreadsContext = createContext<ThreadsContextValue | undefined>(undefined);\n\nexport interface ThreadsProviderProps {\n children: ReactNode;\n threadId?: string;\n}\n\nexport function ThreadsProvider({ children, threadId: explicitThreadId }: ThreadsProviderProps) {\n const [internalThreadId, setThreadId] = useState<string>(() => randomUUID());\n\n const threadId = explicitThreadId ?? internalThreadId;\n\n return (\n <ThreadsContext.Provider\n value={{\n threadId,\n setThreadId,\n }}\n >\n {children}\n </ThreadsContext.Provider>\n );\n}\n\nexport function useThreads() {\n const context = useContext(ThreadsContext);\n if (!context) {\n throw new Error(\"useThreads must be used within ThreadsProvider\");\n }\n return context;\n}\n\nexport { ThreadsContext };\n"],"mappings":";AAAA,SAAgB,eAAe,YAAY,gBAA2C;AACtF,SAAS,kBAAkB;AAoBvB;AAbJ,IAAM,iBAAiB,cAA+C,MAAS;AAOxE,SAAS,gBAAgB,EAAE,UAAU,UAAU,iBAAiB,GAAyB;AAC9F,QAAM,CAAC,kBAAkB,WAAW,IAAI,SAAiB,MAAM,WAAW,CAAC;AAE3E,QAAM,WAAW,8CAAoB;AAErC,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,SAAS,aAAa;AAC3B,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatInternal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBXQSB7S.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-chat.ts
|
|
6
6
|
function useCopilotChat(options = {}) {
|
|
@@ -33,4 +33,4 @@ function useCopilotChat(options = {}) {
|
|
|
33
33
|
export {
|
|
34
34
|
useCopilotChat
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-M7U7RZLU.mjs.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-ZVF5Q6IH.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAsyncCallback
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BVBFFI7K.mjs";
|
|
10
10
|
import {
|
|
11
11
|
CoAgentStateRenderBridge
|
|
12
12
|
} from "./chunk-QNUAXSDP.mjs";
|
|
@@ -346,4 +346,4 @@ export {
|
|
|
346
346
|
useCopilotChatInternal,
|
|
347
347
|
defaultSystemMessage
|
|
348
348
|
};
|
|
349
|
-
//# sourceMappingURL=chunk-
|
|
349
|
+
//# sourceMappingURL=chunk-OBXQSB7S.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotErrorBoundary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FJEI7IBX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotMessages,
|
|
6
6
|
MessagesTapProvider
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
ThreadsProvider,
|
|
22
22
|
useThreads
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LMHB2D4J.mjs";
|
|
24
24
|
import {
|
|
25
25
|
CopilotListeners
|
|
26
26
|
} from "./chunk-WF65O6HX.mjs";
|
|
@@ -548,4 +548,4 @@ export {
|
|
|
548
548
|
CopilotKitInternal,
|
|
549
549
|
defaultCopilotContextCategories
|
|
550
550
|
};
|
|
551
|
-
//# sourceMappingURL=chunk-
|
|
551
|
+
//# sourceMappingURL=chunk-PZ2SR7P3.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-PZ2SR7P3.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-U2ZHE3ND.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatInternal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBXQSB7S.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-AFNWX62Q.mjs";
|
|
@@ -83,4 +83,4 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
83
83
|
export {
|
|
84
84
|
useCopilotChatHeadless_c
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-W5BKJN46.mjs.map
|
|
@@ -98,6 +98,26 @@ interface CopilotKitProps extends Omit<CopilotKitProviderProps, "children"> {
|
|
|
98
98
|
/**
|
|
99
99
|
* Indicates whether the user agent should send or receive cookies from the other domain
|
|
100
100
|
* in the case of cross-origin requests.
|
|
101
|
+
*
|
|
102
|
+
* To enable HTTP-only cookie authentication, set `credentials="include"` and configure
|
|
103
|
+
* CORS on your runtime endpoint:
|
|
104
|
+
*
|
|
105
|
+
* ```tsx
|
|
106
|
+
* // Frontend (https://myapp.com)
|
|
107
|
+
* <CopilotKit runtimeUrl="https://api.myapp.com/copilotkit" credentials="include">
|
|
108
|
+
* {children}
|
|
109
|
+
* </CopilotKit>
|
|
110
|
+
*
|
|
111
|
+
* // Backend (https://api.myapp.com)
|
|
112
|
+
* copilotRuntimeNextJSAppRouterEndpoint({
|
|
113
|
+
* runtime,
|
|
114
|
+
* endpoint: "/copilotkit",
|
|
115
|
+
* cors: {
|
|
116
|
+
* origin: "https://myapp.com",
|
|
117
|
+
* credentials: true,
|
|
118
|
+
* },
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
101
121
|
*/
|
|
102
122
|
credentials?: RequestCredentials;
|
|
103
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["import { ForwardedParametersInput } from \"@copilotkit/runtime-client-gql\";\nimport { ReactNode } from \"react\";\nimport { AuthState } from \"../../context/copilot-context\";\nimport { CopilotErrorHandler } from \"@copilotkit/shared\";\nimport { CopilotKitProviderProps } from \"@copilotkitnext/react\";\n/**\n * Props for CopilotKit.\n */\n\n/**\n * We shouldn't need this `Omit` here, but using it because `CopilotKitProps`\n * and `CopilotKitProviderProps` have non-identical `children` types\n *\n * TODO: Remove this `Omit` once this is resolved.\n */\nexport interface CopilotKitProps extends Omit<CopilotKitProviderProps, \"children\"> {\n /**\n * Your Copilot Cloud API key.\n *\n * Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.\n */\n publicApiKey?: string;\n\n /**\n * Your public license key for accessing premium CopilotKit features.\n *\n * Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.\n */\n publicLicenseKey?: string;\n\n /**\n * Restrict input to a specific topic.\n * @deprecated Use `guardrails_c` instead to control input restrictions\n */\n cloudRestrictToTopic?: {\n validTopics?: string[];\n invalidTopics?: string[];\n };\n\n /**\n * Restrict input to specific topics using guardrails.\n * @remarks\n *\n * This feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://cloud.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.\n */\n guardrails_c?: {\n validTopics?: string[];\n invalidTopics?: string[];\n };\n\n /**\n * The endpoint for the Copilot Runtime instance. [Click here for more information](/concepts/copilot-runtime).\n */\n runtimeUrl?: 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 *\n * For example:\n * ```json\n * {\n * \"Authorization\": \"Bearer X\"\n * }\n * ```\n */\n headers?: Record<string, string>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n\n /**\n * Custom properties to be sent with the request.\n * Can include threadMetadata for thread creation and authorization for LangGraph Platform authentication.\n * For example:\n * ```js\n * {\n * 'user_id': 'users_id',\n * 'authorization': 'your-auth-token', // For LangGraph Platform authentication\n * threadMetadata: {\n * 'account_id': '123',\n * 'user_type': 'premium'\n * }\n * }\n * ```\n *\n * **Note**: The `authorization` property is automatically forwarded to LangGraph agents. See the [LangGraph Agent Authentication Guide](/coagents/shared/guides/langgraph-platform-authentication) for details.\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 * Whether to show the dev console.\n *\n * Set to `true` to show error banners and toasts, `false` to hide all error UI.\n * Defaults to `false` for production safety.\n */\n showDevConsole?: boolean;\n\n /**\n * The name of the agent to use.\n */\n agent?: string;\n\n /**\n * The forwarded parameters to use for the task.\n */\n forwardedParameters?: Pick<ForwardedParametersInput, \"temperature\">;\n\n /**\n * The auth config to use for the CopilotKit.\n * @remarks\n *\n * This feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://cloud.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.\n */\n authConfig_c?: {\n SignInComponent: React.ComponentType<{\n onSignInComplete: (authState: AuthState) => void;\n }>;\n };\n\n /**\n * The thread id to use for the CopilotKit.\n */\n threadId?: string;\n\n /**\n * Optional error handler for comprehensive debugging and observability.\n *\n * **Requires publicApiKey**: Error handling only works when publicApiKey is provided.\n * This is a premium Copilot Cloud feature.\n *\n * @param errorEvent - Structured error event with rich debugging context\n *\n * @example\n * ```typescript\n * <CopilotKit\n * publicApiKey=\"ck_pub_your_key\"\n * onError={(errorEvent) => {\n * debugDashboard.capture(errorEvent);\n * }}\n * >\n * ```\n */\n onError?: CopilotErrorHandler;\n\n /**\n * Enable or disable the CopilotKit Inspector, letting you inspect AG-UI events,\n * view agent messages, check agent state, and visualize agent context. Defaults\n * to enabled.\n */\n enableInspector?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["import { ForwardedParametersInput } from \"@copilotkit/runtime-client-gql\";\nimport { ReactNode } from \"react\";\nimport { AuthState } from \"../../context/copilot-context\";\nimport { CopilotErrorHandler } from \"@copilotkit/shared\";\nimport { CopilotKitProviderProps } from \"@copilotkitnext/react\";\n/**\n * Props for CopilotKit.\n */\n\n/**\n * We shouldn't need this `Omit` here, but using it because `CopilotKitProps`\n * and `CopilotKitProviderProps` have non-identical `children` types\n *\n * TODO: Remove this `Omit` once this is resolved.\n */\nexport interface CopilotKitProps extends Omit<CopilotKitProviderProps, \"children\"> {\n /**\n * Your Copilot Cloud API key.\n *\n * Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.\n */\n publicApiKey?: string;\n\n /**\n * Your public license key for accessing premium CopilotKit features.\n *\n * Don't have it yet? Go to https://cloud.copilotkit.ai and get one for free.\n */\n publicLicenseKey?: string;\n\n /**\n * Restrict input to a specific topic.\n * @deprecated Use `guardrails_c` instead to control input restrictions\n */\n cloudRestrictToTopic?: {\n validTopics?: string[];\n invalidTopics?: string[];\n };\n\n /**\n * Restrict input to specific topics using guardrails.\n * @remarks\n *\n * This feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://cloud.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.\n */\n guardrails_c?: {\n validTopics?: string[];\n invalidTopics?: string[];\n };\n\n /**\n * The endpoint for the Copilot Runtime instance. [Click here for more information](/concepts/copilot-runtime).\n */\n runtimeUrl?: 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 *\n * For example:\n * ```json\n * {\n * \"Authorization\": \"Bearer X\"\n * }\n * ```\n */\n headers?: Record<string, string>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n\n /**\n * Custom properties to be sent with the request.\n * Can include threadMetadata for thread creation and authorization for LangGraph Platform authentication.\n * For example:\n * ```js\n * {\n * 'user_id': 'users_id',\n * 'authorization': 'your-auth-token', // For LangGraph Platform authentication\n * threadMetadata: {\n * 'account_id': '123',\n * 'user_type': 'premium'\n * }\n * }\n * ```\n *\n * **Note**: The `authorization` property is automatically forwarded to LangGraph agents. See the [LangGraph Agent Authentication Guide](/coagents/shared/guides/langgraph-platform-authentication) for details.\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 * To enable HTTP-only cookie authentication, set `credentials=\"include\"` and configure\n * CORS on your runtime endpoint:\n *\n * ```tsx\n * // Frontend (https://myapp.com)\n * <CopilotKit runtimeUrl=\"https://api.myapp.com/copilotkit\" credentials=\"include\">\n * {children}\n * </CopilotKit>\n *\n * // Backend (https://api.myapp.com)\n * copilotRuntimeNextJSAppRouterEndpoint({\n * runtime,\n * endpoint: \"/copilotkit\",\n * cors: {\n * origin: \"https://myapp.com\",\n * credentials: true,\n * },\n * });\n * ```\n */\n credentials?: RequestCredentials;\n\n /**\n * Whether to show the dev console.\n *\n * Set to `true` to show error banners and toasts, `false` to hide all error UI.\n * Defaults to `false` for production safety.\n */\n showDevConsole?: boolean;\n\n /**\n * The name of the agent to use.\n */\n agent?: string;\n\n /**\n * The forwarded parameters to use for the task.\n */\n forwardedParameters?: Pick<ForwardedParametersInput, \"temperature\">;\n\n /**\n * The auth config to use for the CopilotKit.\n * @remarks\n *\n * This feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://cloud.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.\n */\n authConfig_c?: {\n SignInComponent: React.ComponentType<{\n onSignInComplete: (authState: AuthState) => void;\n }>;\n };\n\n /**\n * The thread id to use for the CopilotKit.\n */\n threadId?: string;\n\n /**\n * Optional error handler for comprehensive debugging and observability.\n *\n * **Requires publicApiKey**: Error handling only works when publicApiKey is provided.\n * This is a premium Copilot Cloud feature.\n *\n * @param errorEvent - Structured error event with rich debugging context\n *\n * @example\n * ```typescript\n * <CopilotKit\n * publicApiKey=\"ck_pub_your_key\"\n * onError={(errorEvent) => {\n * debugDashboard.capture(errorEvent);\n * }}\n * >\n * ```\n */\n onError?: CopilotErrorHandler;\n\n /**\n * Enable or disable the CopilotKit Inspector, letting you inspect AG-UI events,\n * view agent messages, check agent state, and visualize agent context. Defaults\n * to enabled.\n */\n enableInspector?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1236,8 +1236,8 @@ var import_shared8 = require("@copilotkit/shared");
|
|
|
1236
1236
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1237
1237
|
var ThreadsContext = (0, import_react9.createContext)(void 0);
|
|
1238
1238
|
function ThreadsProvider({ children, threadId: explicitThreadId }) {
|
|
1239
|
-
const [internalThreadId, setThreadId] = (0, import_react9.useState)(
|
|
1240
|
-
const threadId = internalThreadId;
|
|
1239
|
+
const [internalThreadId, setThreadId] = (0, import_react9.useState)(() => (0, import_shared8.randomUUID)());
|
|
1240
|
+
const threadId = explicitThreadId != null ? explicitThreadId : internalThreadId;
|
|
1241
1241
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1242
1242
|
ThreadsContext.Provider,
|
|
1243
1243
|
{
|