@copilotkit/react-core 0.25.0-mme-cloud.1 → 0.25.0-mme-cloud.2
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/.turbo/turbo-build.log +53 -53
- package/CHANGELOG.md +11 -0
- package/dist/{chunk-YMX4OOEL.mjs → chunk-6ARSX7BW.mjs} +2 -2
- package/dist/{chunk-GUQTL3VG.mjs → chunk-DW3HRHJB.mjs} +3 -3
- package/dist/{chunk-WHODFSGA.mjs → chunk-IR5I4Q6R.mjs} +2 -2
- package/dist/{chunk-Q6YXCGNM.mjs → chunk-NQKBX6UJ.mjs} +2 -2
- package/dist/{chunk-XUCMY57N.mjs → chunk-O35YOIHC.mjs} +1 -1
- package/dist/chunk-O35YOIHC.mjs.map +1 -0
- package/dist/{chunk-R3D5GIQT.mjs → chunk-PC6FY3LD.mjs} +2 -2
- package/dist/{chunk-ICZAFR7J.mjs → chunk-SFV4PSJM.mjs} +3 -3
- package/dist/{chunk-MBLTLCOG.mjs → chunk-UNYZRMB2.mjs} +2 -2
- package/dist/{chunk-DFCYHW6B.mjs → chunk-VYD7RO32.mjs} +18 -3
- package/dist/chunk-VYD7RO32.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit-props.d.ts +0 -1
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +16 -1
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.js +16 -1
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/index.js +16 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/context/copilot-context.d.ts +2 -8
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.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-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +3 -3
- package/dist/hooks/use-make-copilot-actionable.js.map +1 -1
- package/dist/hooks/use-make-copilot-actionable.mjs +2 -2
- 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/hooks/use-make-copilot-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-readable.mjs +2 -2
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +3 -3
- package/dist/openai-assistants/hooks/index.js.map +1 -1
- package/dist/openai-assistants/hooks/index.mjs +3 -3
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.js.map +1 -1
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs +3 -3
- package/dist/openai-assistants/index.js.map +1 -1
- package/dist/openai-assistants/index.mjs +3 -3
- package/package.json +4 -4
- package/src/components/copilot-provider/copilotkit-props.tsx +0 -1
- package/src/components/copilot-provider/copilotkit.tsx +17 -1
- package/src/context/copilot-context.tsx +6 -8
- package/dist/chunk-DFCYHW6B.mjs.map +0 -1
- package/dist/chunk-XUCMY57N.mjs.map +0 -1
- /package/dist/{chunk-YMX4OOEL.mjs.map → chunk-6ARSX7BW.mjs.map} +0 -0
- /package/dist/{chunk-GUQTL3VG.mjs.map → chunk-DW3HRHJB.mjs.map} +0 -0
- /package/dist/{chunk-WHODFSGA.mjs.map → chunk-IR5I4Q6R.mjs.map} +0 -0
- /package/dist/{chunk-Q6YXCGNM.mjs.map → chunk-NQKBX6UJ.mjs.map} +0 -0
- /package/dist/{chunk-R3D5GIQT.mjs.map → chunk-PC6FY3LD.mjs.map} +0 -0
- /package/dist/{chunk-ICZAFR7J.mjs.map → chunk-SFV4PSJM.mjs.map} +0 -0
- /package/dist/{chunk-MBLTLCOG.mjs.map → chunk-UNYZRMB2.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @copilotkit/react-core@0.25.0-mme-cloud.
|
|
2
|
+
> @copilotkit/react-core@0.25.0-mme-cloud.2 build /home/runner/work/CopilotKit/CopilotKit/CopilotKit/packages/react-core
|
|
3
3
|
> tsup --clean
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx, src/components/index.ts, src/context/copilot-context.tsx, src/context/index.ts, src/hooks/index.ts, src/hooks/use-chat.ts, src/hooks/use-copilot-action.ts, src/hooks/use-copilot-chat.ts, src/hooks/use-flat-category-store.ts, src/hooks/use-make-copilot-actionable.ts, src/hooks/use-make-copilot-document-readable.ts, src/hooks/use-make-copilot-readable.ts, src/hooks/use-tree.ts, src/lib/copilot-task.ts, src/lib/index.ts, src/openai-assistants/index.ts, src/types/document-pointer.ts, src/types/frontend-action.ts, src/types/index.ts, src/types/system-message.ts, src/utils/fetch-chat-completion.ts, src/utils/utils.test.ts, src/utils/utils.ts, src/components/copilot-provider/copilotkit-props.tsx, src/components/copilot-provider/copilotkit.tsx, src/components/copilot-provider/index.ts, src/openai-assistants/hooks/index.ts, src/openai-assistants/hooks/use-assistants.ts, src/openai-assistants/hooks/use-copilot-chat-v2.ts, src/openai-assistants/utils/index.ts, src/openai-assistants/utils/process-message-stream.ts
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
13
|
[32mCJS[39m [1mdist/lib/copilot-task.js [22m[32m7.45 KB[39m
|
|
14
|
-
[32mCJS[39m [1mdist/openai-assistants/index.js [22m[32m9.41 KB[39m
|
|
15
14
|
[32mCJS[39m [1mdist/types/document-pointer.js [22m[32m841.00 B[39m
|
|
16
15
|
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js [22m[32m5.03 KB[39m
|
|
17
16
|
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js [22m[32m864.00 B[39m
|
|
18
17
|
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js [22m[32m9.31 KB[39m
|
|
19
18
|
[32mCJS[39m [1mdist/openai-assistants/utils/index.js [22m[32m2.30 KB[39m
|
|
20
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
21
|
-
[32mCJS[39m [1mdist/components/index.js [22m[32m15.
|
|
19
|
+
[32mCJS[39m [1mdist/index.js [22m[32m40.06 KB[39m
|
|
20
|
+
[32mCJS[39m [1mdist/components/index.js [22m[32m15.87 KB[39m
|
|
22
21
|
[32mCJS[39m [1mdist/context/copilot-context.js [22m[32m3.71 KB[39m
|
|
23
22
|
[32mCJS[39m [1mdist/context/index.js [22m[32m3.70 KB[39m
|
|
24
23
|
[32mCJS[39m [1mdist/hooks/index.js [22m[32m20.11 KB[39m
|
|
@@ -31,83 +30,84 @@
|
|
|
31
30
|
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js [22m[32m4.19 KB[39m
|
|
32
31
|
[32mCJS[39m [1mdist/hooks/use-tree.js [22m[32m5.53 KB[39m
|
|
33
32
|
[32mCJS[39m [1mdist/lib/index.js [22m[32m7.41 KB[39m
|
|
33
|
+
[32mCJS[39m [1mdist/openai-assistants/index.js [22m[32m9.41 KB[39m
|
|
34
34
|
[32mCJS[39m [1mdist/types/frontend-action.js [22m[32m837.00 B[39m
|
|
35
35
|
[32mCJS[39m [1mdist/types/index.js [22m[32m797.00 B[39m
|
|
36
36
|
[32mCJS[39m [1mdist/types/system-message.js [22m[32m833.00 B[39m
|
|
37
37
|
[32mCJS[39m [1mdist/utils/utils.test.js [22m[32m184.00 B[39m
|
|
38
38
|
[32mCJS[39m [1mdist/utils/utils.js [22m[32m797.00 B[39m
|
|
39
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js [22m[32m15.
|
|
40
|
-
[32mCJS[39m [1mdist/components/copilot-provider/index.js [22m[32m15.
|
|
39
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js [22m[32m15.85 KB[39m
|
|
40
|
+
[32mCJS[39m [1mdist/components/copilot-provider/index.js [22m[32m15.91 KB[39m
|
|
41
41
|
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js [22m[32m4.81 KB[39m
|
|
42
42
|
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js [22m[32m9.40 KB[39m
|
|
43
43
|
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js [22m[32m2.33 KB[39m
|
|
44
|
-
[32mCJS[39m [1mdist/lib/copilot-task.js.map [22m[
|
|
45
|
-
[32mCJS[39m [1mdist/openai-assistants/index.js.map [22m[32m21.35 KB[39m
|
|
44
|
+
[32mCJS[39m [1mdist/lib/copilot-task.js.map [22m[32m17.28 KB[39m
|
|
46
45
|
[32mCJS[39m [1mdist/types/document-pointer.js.map [22m[32m292.00 B[39m
|
|
47
46
|
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js.map [22m[32m4.90 KB[39m
|
|
48
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js.map [22m[32m1.
|
|
49
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js.map [22m[32m21.
|
|
47
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js.map [22m[32m1.34 KB[39m
|
|
48
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js.map [22m[32m21.94 KB[39m
|
|
50
49
|
[32mCJS[39m [1mdist/openai-assistants/utils/index.js.map [22m[32m1.44 KB[39m
|
|
51
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
52
|
-
[32mCJS[39m [1mdist/components/index.js.map [22m[
|
|
53
|
-
[32mCJS[39m [1mdist/context/copilot-context.js.map [22m[32m5.
|
|
54
|
-
[32mCJS[39m [1mdist/context/index.js.map [22m[32m5.
|
|
55
|
-
[32mCJS[39m [1mdist/hooks/index.js.map [22m[32m44.
|
|
50
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m75.09 KB[39m
|
|
51
|
+
[32mCJS[39m [1mdist/components/index.js.map [22m[32m28.00 KB[39m
|
|
52
|
+
[32mCJS[39m [1mdist/context/copilot-context.js.map [22m[32m5.39 KB[39m
|
|
53
|
+
[32mCJS[39m [1mdist/context/index.js.map [22m[32m5.62 KB[39m
|
|
54
|
+
[32mCJS[39m [1mdist/hooks/index.js.map [22m[32m44.93 KB[39m
|
|
56
55
|
[32mCJS[39m [1mdist/hooks/use-chat.js.map [22m[32m18.43 KB[39m
|
|
57
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-action.js.map [22m[32m9.
|
|
58
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js.map [22m[32m35.
|
|
56
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-action.js.map [22m[32m9.54 KB[39m
|
|
57
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js.map [22m[32m35.53 KB[39m
|
|
59
58
|
[32mCJS[39m [1mdist/hooks/use-flat-category-store.js.map [22m[32m4.25 KB[39m
|
|
60
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js.map [22m[32m7.
|
|
61
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js.map [22m[32m6.
|
|
62
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js.map [22m[32m6.
|
|
59
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js.map [22m[32m7.14 KB[39m
|
|
60
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js.map [22m[32m6.68 KB[39m
|
|
61
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js.map [22m[32m6.73 KB[39m
|
|
63
62
|
[32mCJS[39m [1mdist/hooks/use-tree.js.map [22m[32m8.32 KB[39m
|
|
64
|
-
[32mCJS[39m [1mdist/lib/index.js.map [22m[
|
|
63
|
+
[32mCJS[39m [1mdist/lib/index.js.map [22m[32m17.34 KB[39m
|
|
64
|
+
[32mCJS[39m [1mdist/openai-assistants/index.js.map [22m[32m21.64 KB[39m
|
|
65
65
|
[32mCJS[39m [1mdist/types/frontend-action.js.map [22m[32m1.77 KB[39m
|
|
66
66
|
[32mCJS[39m [1mdist/types/index.js.map [22m[32m338.00 B[39m
|
|
67
67
|
[32mCJS[39m [1mdist/types/system-message.js.map [22m[32m249.00 B[39m
|
|
68
68
|
[32mCJS[39m [1mdist/utils/utils.test.js.map [22m[32m354.00 B[39m
|
|
69
69
|
[32mCJS[39m [1mdist/utils/utils.js.map [22m[32m137.00 B[39m
|
|
70
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js.map [22m[32m27.
|
|
71
|
-
[32mCJS[39m [1mdist/components/copilot-provider/index.js.map [22m[
|
|
70
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js.map [22m[32m27.93 KB[39m
|
|
71
|
+
[32mCJS[39m [1mdist/components/copilot-provider/index.js.map [22m[32m28.13 KB[39m
|
|
72
72
|
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js.map [22m[32m5.90 KB[39m
|
|
73
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js.map [22m[32m21.
|
|
73
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js.map [22m[32m21.56 KB[39m
|
|
74
74
|
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js.map [22m[32m1.33 KB[39m
|
|
75
|
-
[32mCJS[39m ⚡️ Build success in
|
|
75
|
+
[32mCJS[39m ⚡️ Build success in 202ms
|
|
76
76
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.58 KB[39m
|
|
77
77
|
[32mESM[39m [1mdist/components/index.mjs [22m[32m375.00 B[39m
|
|
78
78
|
[32mESM[39m [1mdist/context/copilot-context.mjs [22m[32m205.00 B[39m
|
|
79
79
|
[32mESM[39m [1mdist/hooks/index.mjs [22m[32m817.00 B[39m
|
|
80
80
|
[32mESM[39m [1mdist/chunk-EFZPSZWO.mjs [22m[32m43.00 B[39m
|
|
81
81
|
[32mESM[39m [1mdist/chunk-LUGEI4YQ.mjs [22m[32m43.00 B[39m
|
|
82
|
-
[32mESM[39m [1mdist/chunk-
|
|
82
|
+
[32mESM[39m [1mdist/chunk-UNYZRMB2.mjs [22m[32m3.17 KB[39m
|
|
83
83
|
[32mESM[39m [1mdist/chunk-7GFKOIO7.mjs [22m[32m43.00 B[39m
|
|
84
84
|
[32mESM[39m [1mdist/chunk-BABVSMJR.mjs [22m[32m43.00 B[39m
|
|
85
|
-
[32mESM[39m [1mdist/chunk-
|
|
85
|
+
[32mESM[39m [1mdist/chunk-DW3HRHJB.mjs [22m[32m4.39 KB[39m
|
|
86
86
|
[32mESM[39m [1mdist/chunk-FRAKUJWH.mjs [22m[32m43.00 B[39m
|
|
87
87
|
[32mESM[39m [1mdist/chunk-MZ5UN3BY.mjs [22m[32m802.00 B[39m
|
|
88
88
|
[32mESM[39m [1mdist/context/index.mjs [22m[32m227.00 B[39m
|
|
89
89
|
[32mESM[39m [1mdist/chunk-VNRDQJXW.mjs [22m[32m43.00 B[39m
|
|
90
90
|
[32mESM[39m [1mdist/chunk-IOP6JX34.mjs [22m[32m43.00 B[39m
|
|
91
|
-
[32mESM[39m [1mdist/chunk-
|
|
92
|
-
[32mESM[39m [1mdist/chunk-
|
|
93
|
-
[32mESM[39m [1mdist/chunk-
|
|
91
|
+
[32mESM[39m [1mdist/chunk-6ARSX7BW.mjs [22m[32m1.06 KB[39m
|
|
92
|
+
[32mESM[39m [1mdist/chunk-PC6FY3LD.mjs [22m[32m700.00 B[39m
|
|
93
|
+
[32mESM[39m [1mdist/chunk-NQKBX6UJ.mjs [22m[32m640.00 B[39m
|
|
94
94
|
[32mESM[39m [1mdist/hooks/use-chat.mjs [22m[32m174.00 B[39m
|
|
95
95
|
[32mESM[39m [1mdist/hooks/use-copilot-action.mjs [22m[32m202.00 B[39m
|
|
96
|
+
[32mESM[39m [1mdist/chunk-IR5I4Q6R.mjs [22m[32m1.46 KB[39m
|
|
96
97
|
[32mESM[39m [1mdist/hooks/use-copilot-chat.mjs [22m[32m468.00 B[39m
|
|
97
|
-
[32mESM[39m [1mdist/chunk-
|
|
98
|
-
[32mESM[39m [1mdist/chunk-
|
|
98
|
+
[32mESM[39m [1mdist/chunk-SFV4PSJM.mjs [22m[32m3.00 KB[39m
|
|
99
|
+
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs [22m[32m43.00 B[39m
|
|
100
|
+
[32mESM[39m [1mdist/chunk-SPCZTZCY.mjs [22m[32m43.00 B[39m
|
|
101
|
+
[32mESM[39m [1mdist/chunk-VYD7RO32.mjs [22m[32m5.42 KB[39m
|
|
99
102
|
[32mESM[39m [1mdist/chunk-YULKJPY3.mjs [22m[32m1.84 KB[39m
|
|
100
103
|
[32mESM[39m [1mdist/chunk-VUY2K2DI.mjs [22m[32m3.89 KB[39m
|
|
101
104
|
[32mESM[39m [1mdist/chunk-MESZST5T.mjs [22m[32m6.49 KB[39m
|
|
102
105
|
[32mESM[39m [1mdist/chunk-CGT3AVYT.mjs [22m[32m2.77 KB[39m
|
|
103
|
-
[32mESM[39m [1mdist/chunk-
|
|
106
|
+
[32mESM[39m [1mdist/chunk-O35YOIHC.mjs [22m[32m1.52 KB[39m
|
|
104
107
|
[32mESM[39m [1mdist/chunk-MRXNTQOX.mjs [22m[32m1.89 KB[39m
|
|
105
|
-
[32mESM[39m [1mdist/
|
|
106
|
-
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs [22m[32m43.00 B[39m
|
|
107
|
-
[32mESM[39m [1mdist/chunk-SPCZTZCY.mjs [22m[32m43.00 B[39m
|
|
108
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs [22m[32m513.00 B[39m
|
|
108
109
|
[32mESM[39m [1mdist/components/copilot-provider/copilotkit.mjs [22m[32m331.00 B[39m
|
|
109
110
|
[32mESM[39m [1mdist/components/copilot-provider/index.mjs [22m[32m361.00 B[39m
|
|
110
|
-
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs [22m[32m513.00 B[39m
|
|
111
111
|
[32mESM[39m [1mdist/openai-assistants/hooks/use-assistants.mjs [22m[32m2.57 KB[39m
|
|
112
112
|
[32mESM[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.mjs [22m[32m540.00 B[39m
|
|
113
113
|
[32mESM[39m [1mdist/openai-assistants/utils/index.mjs [22m[32m206.00 B[39m
|
|
@@ -134,35 +134,35 @@
|
|
|
134
134
|
[32mESM[39m [1mdist/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
135
135
|
[32mESM[39m [1mdist/chunk-EFZPSZWO.mjs.map [22m[32m71.00 B[39m
|
|
136
136
|
[32mESM[39m [1mdist/chunk-LUGEI4YQ.mjs.map [22m[32m71.00 B[39m
|
|
137
|
-
[32mESM[39m [1mdist/chunk-
|
|
137
|
+
[32mESM[39m [1mdist/chunk-UNYZRMB2.mjs.map [22m[32m5.57 KB[39m
|
|
138
138
|
[32mESM[39m [1mdist/chunk-7GFKOIO7.mjs.map [22m[32m71.00 B[39m
|
|
139
139
|
[32mESM[39m [1mdist/chunk-BABVSMJR.mjs.map [22m[32m71.00 B[39m
|
|
140
|
-
[32mESM[39m [1mdist/chunk-
|
|
140
|
+
[32mESM[39m [1mdist/chunk-DW3HRHJB.mjs.map [22m[32m7.90 KB[39m
|
|
141
141
|
[32mESM[39m [1mdist/chunk-FRAKUJWH.mjs.map [22m[32m71.00 B[39m
|
|
142
142
|
[32mESM[39m [1mdist/chunk-MZ5UN3BY.mjs.map [22m[32m1.26 KB[39m
|
|
143
143
|
[32mESM[39m [1mdist/context/index.mjs.map [22m[32m71.00 B[39m
|
|
144
144
|
[32mESM[39m [1mdist/chunk-VNRDQJXW.mjs.map [22m[32m71.00 B[39m
|
|
145
145
|
[32mESM[39m [1mdist/chunk-IOP6JX34.mjs.map [22m[32m71.00 B[39m
|
|
146
|
-
[32mESM[39m [1mdist/chunk-
|
|
147
|
-
[32mESM[39m [1mdist/chunk-
|
|
148
|
-
[32mESM[39m [1mdist/chunk-
|
|
146
|
+
[32mESM[39m [1mdist/chunk-6ARSX7BW.mjs.map [22m[32m1.87 KB[39m
|
|
147
|
+
[32mESM[39m [1mdist/chunk-PC6FY3LD.mjs.map [22m[32m1.40 KB[39m
|
|
148
|
+
[32mESM[39m [1mdist/chunk-NQKBX6UJ.mjs.map [22m[32m1.45 KB[39m
|
|
149
149
|
[32mESM[39m [1mdist/hooks/use-chat.mjs.map [22m[32m71.00 B[39m
|
|
150
150
|
[32mESM[39m [1mdist/hooks/use-copilot-action.mjs.map [22m[32m71.00 B[39m
|
|
151
|
+
[32mESM[39m [1mdist/chunk-IR5I4Q6R.mjs.map [22m[32m4.27 KB[39m
|
|
151
152
|
[32mESM[39m [1mdist/hooks/use-copilot-chat.mjs.map [22m[32m71.00 B[39m
|
|
152
|
-
[32mESM[39m [1mdist/chunk-
|
|
153
|
-
[32mESM[39m [1mdist/chunk-
|
|
153
|
+
[32mESM[39m [1mdist/chunk-SFV4PSJM.mjs.map [22m[32m4.77 KB[39m
|
|
154
|
+
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs.map [22m[32m71.00 B[39m
|
|
155
|
+
[32mESM[39m [1mdist/chunk-SPCZTZCY.mjs.map [22m[32m71.00 B[39m
|
|
156
|
+
[32mESM[39m [1mdist/chunk-VYD7RO32.mjs.map [22m[32m10.23 KB[39m
|
|
154
157
|
[32mESM[39m [1mdist/chunk-YULKJPY3.mjs.map [22m[32m4.21 KB[39m
|
|
155
158
|
[32mESM[39m [1mdist/chunk-VUY2K2DI.mjs.map [22m[32m8.27 KB[39m
|
|
156
159
|
[32mESM[39m [1mdist/chunk-MESZST5T.mjs.map [22m[32m13.84 KB[39m
|
|
157
160
|
[32mESM[39m [1mdist/chunk-CGT3AVYT.mjs.map [22m[32m4.86 KB[39m
|
|
158
|
-
[32mESM[39m [1mdist/chunk-
|
|
161
|
+
[32mESM[39m [1mdist/chunk-O35YOIHC.mjs.map [22m[32m5.30 KB[39m
|
|
159
162
|
[32mESM[39m [1mdist/chunk-MRXNTQOX.mjs.map [22m[32m71.00 B[39m
|
|
160
|
-
[32mESM[39m [1mdist/
|
|
161
|
-
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs.map [22m[32m71.00 B[39m
|
|
162
|
-
[32mESM[39m [1mdist/chunk-SPCZTZCY.mjs.map [22m[32m71.00 B[39m
|
|
163
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
163
164
|
[32mESM[39m [1mdist/components/copilot-provider/copilotkit.mjs.map [22m[32m71.00 B[39m
|
|
164
165
|
[32mESM[39m [1mdist/components/copilot-provider/index.mjs.map [22m[32m71.00 B[39m
|
|
165
|
-
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
166
166
|
[32mESM[39m [1mdist/openai-assistants/hooks/use-assistants.mjs.map [22m[32m4.65 KB[39m
|
|
167
167
|
[32mESM[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map [22m[32m71.00 B[39m
|
|
168
168
|
[32mESM[39m [1mdist/openai-assistants/utils/index.mjs.map [22m[32m71.00 B[39m
|
|
@@ -183,13 +183,13 @@
|
|
|
183
183
|
[32mESM[39m [1mdist/lib/copilot-task.mjs.map [22m[32m71.00 B[39m
|
|
184
184
|
[32mESM[39m [1mdist/lib/index.mjs.map [22m[32m71.00 B[39m
|
|
185
185
|
[32mESM[39m [1mdist/openai-assistants/index.mjs.map [22m[32m71.00 B[39m
|
|
186
|
-
[32mESM[39m ⚡️ Build success in
|
|
186
|
+
[32mESM[39m ⚡️ Build success in 209ms
|
|
187
187
|
[34mDTS[39m Build start
|
|
188
|
-
[32mDTS[39m ⚡️ Build success in
|
|
188
|
+
[32mDTS[39m ⚡️ Build success in 6092ms
|
|
189
189
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.56 KB[39m
|
|
190
190
|
[32mDTS[39m [1mdist/components/copilot-provider/copilotkit.d.ts [22m[32m1017.00 B[39m
|
|
191
|
-
[32mDTS[39m [1mdist/components/copilot-provider/copilotkit-props.d.ts [22m[32m1.
|
|
192
|
-
[32mDTS[39m [1mdist/context/copilot-context.d.ts [22m[32m2.
|
|
191
|
+
[32mDTS[39m [1mdist/components/copilot-provider/copilotkit-props.d.ts [22m[32m1.24 KB[39m
|
|
192
|
+
[32mDTS[39m [1mdist/context/copilot-context.d.ts [22m[32m2.83 KB[39m
|
|
193
193
|
[32mDTS[39m [1mdist/hooks/use-copilot-chat.d.ts [22m[32m1.05 KB[39m
|
|
194
194
|
[32mDTS[39m [1mdist/hooks/use-make-copilot-actionable.d.ts [22m[32m309.00 B[39m
|
|
195
195
|
[32mDTS[39m [1mdist/hooks/use-copilot-action.d.ts [22m[32m286.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-actionable.ts
|
|
6
6
|
import { useRef, useContext, useEffect, useMemo } from "react";
|
|
@@ -30,4 +30,4 @@ function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
|
30
30
|
export {
|
|
31
31
|
useMakeCopilotActionable
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-6ARSX7BW.mjs.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-MZ5UN3BY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultCopilotContextCategories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VYD7RO32.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__spreadValues
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
useCopilotChatV2,
|
|
135
135
|
defaultSystemMessage
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-DW3HRHJB.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-action.ts
|
|
6
6
|
import { useRef, useContext, useEffect } from "react";
|
|
@@ -44,4 +44,4 @@ function useCopilotAction(action, dependencies) {
|
|
|
44
44
|
export {
|
|
45
45
|
useCopilotAction
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-IR5I4Q6R.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-readable.ts
|
|
6
6
|
import { useContext, useEffect, useRef } from "react";
|
|
@@ -20,4 +20,4 @@ function useMakeCopilotReadable(information, parentId, categories) {
|
|
|
20
20
|
export {
|
|
21
21
|
useMakeCopilotReadable
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-NQKBX6UJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context/copilot-context.tsx"],"sourcesContent":["import {\n CopilotCloudConfig,\n FunctionCallHandler,\n Message,\n ToolDefinition,\n} from \"@copilotkit/shared\";\nimport { ActionRenderProps, FrontendAction } from \"../types/frontend-action\";\nimport React, { Ref } from \"react\";\nimport { TreeNodeId } from \"../hooks/use-tree\";\nimport { DocumentPointer } from \"../types\";\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 chat API v2.\n */\n chatApiEndpointV2: 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 * Additional body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'message': 'Hello, world!'\n * }\n * ```\n */\n body: Record<string, any>;\n\n /**\n * Backend only props that will be combined to body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'user_id': 'user_id'\n * }\n * ```\n */\n backendOnlyProps?: Record<string, any>;\n}\n\nexport type InChatRenderFunction = (props: ActionRenderProps<any>) => string | JSX.Element;\n\nexport interface CopilotContextParams {\n // function-calling\n entryPoints: Record<string, FrontendAction<any>>;\n setEntryPoint: (id: string, entryPoint: FrontendAction<any>) => void;\n removeEntryPoint: (id: string) => void;\n chatComponentsCache: React.RefObject<Record<string, InChatRenderFunction | string>>;\n getChatCompletionFunctionDescriptions: (\n customEntryPoints?: Record<string, FrontendAction<any>>,\n ) => ToolDefinition[];\n getFunctionCallHandler: (\n customEntryPoints?: Record<string, FrontendAction<any>>,\n ) => FunctionCallHandler;\n\n messages: Message[];\n setMessages: React.Dispatch<React.SetStateAction<Message[]>>;\n\n // text context\n addContext: (context: string, parentId?: string, categories?: string[]) => TreeNodeId;\n removeContext: (id: TreeNodeId) => void;\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 // api endpoints\n copilotApiConfig: CopilotApiConfig;\n}\n\nconst emptyCopilotContext: CopilotContextParams = {\n entryPoints: {},\n setEntryPoint: () => {},\n removeEntryPoint: () => {},\n getChatCompletionFunctionDescriptions: () => returnAndThrowInDebug([]),\n getFunctionCallHandler: () => returnAndThrowInDebug(async () => {}),\n chatComponentsCache: { current: {} },\n getContextString: (documents: DocumentPointer[], categories: string[]) =>\n returnAndThrowInDebug(\"\"),\n addContext: () => \"\",\n removeContext: () => {},\n messages: [],\n setMessages: () => returnAndThrowInDebug([]),\n\n getDocumentsContext: (categories: string[]) => returnAndThrowInDebug([]),\n addDocumentContext: () => returnAndThrowInDebug(\"\"),\n removeDocumentContext: () => {},\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 get chatApiEndpointV2(): string {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n }\n get headers(): Record<string, string> {\n return {};\n }\n get body(): Record<string, any> {\n return {};\n }\n })(),\n};\n\nexport const CopilotContext = React.createContext<CopilotContextParams>(emptyCopilotContext);\n\nexport function useCopilotContext(): CopilotContextParams {\n return React.useContext(CopilotContext);\n}\n\nfunction returnAndThrowInDebug<T>(value: T): T {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n return value;\n}\n"],"mappings":";;;;;AAOA,OAAO,WAAoB;AAiG3B,IAAM,sBAA4C;AAAA,EAChD,aAAa,CAAC;AAAA,EACd,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,uCAAuC,MAAM,sBAAsB,CAAC,CAAC;AAAA,EACrE,wBAAwB,MAAM,sBAAsB,MAAY;AAAA,EAAC,EAAC;AAAA,EAClE,qBAAqB,EAAE,SAAS,CAAC,EAAE;AAAA,EACnC,kBAAkB,CAAC,WAA8B,eAC/C,sBAAsB,EAAE;AAAA,EAC1B,YAAY,MAAM;AAAA,EAClB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,aAAa,MAAM,sBAAsB,CAAC,CAAC;AAAA,EAE3C,qBAAqB,CAAC,eAAyB,sBAAsB,CAAC,CAAC;AAAA,EACvE,oBAAoB,MAAM,sBAAsB,EAAE;AAAA,EAClD,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAE9B,kBAAkB,IAAK,MAAkC;AAAA,IACvD,IAAI,kBAA0B;AAC5B,YAAM,IAAI,MAAM,uEAAuE;AAAA,IACzF;AAAA,IACA,IAAI,oBAA4B;AAC9B,YAAM,IAAI,MAAM,uEAAuE;AAAA,IACzF;AAAA,IACA,IAAI,UAAkC;AACpC,aAAO,CAAC;AAAA,IACV;AAAA,IACA,IAAI,OAA4B;AAC9B,aAAO,CAAC;AAAA,IACV;AAAA,EACF,EAAG;AACL;AAEO,IAAM,iBAAiB,MAAM,cAAoC,mBAAmB;AAEpF,SAAS,oBAA0C;AACxD,SAAO,MAAM,WAAW,cAAc;AACxC;AAEA,SAAS,sBAAyB,OAAa;AAC7C,QAAM,IAAI,MAAM,uEAAuE;AACvF,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
6
6
|
import { useContext, useEffect, useRef } from "react";
|
|
@@ -20,4 +20,4 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
|
|
|
20
20
|
export {
|
|
21
21
|
useMakeCopilotDocumentReadable
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-PC6FY3LD.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VYD7RO32.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useChat
|
|
6
6
|
} from "./chunk-MESZST5T.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -95,4 +95,4 @@ export {
|
|
|
95
95
|
useCopilotChat,
|
|
96
96
|
defaultSystemMessage
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
98
|
+
//# sourceMappingURL=chunk-SFV4PSJM.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VYD7RO32.mjs";
|
|
4
4
|
import {
|
|
5
5
|
fetchAndDecodeChatCompletion
|
|
6
6
|
} from "./chunk-CGT3AVYT.mjs";
|
|
@@ -99,4 +99,4 @@ ${instructions}
|
|
|
99
99
|
export {
|
|
100
100
|
CopilotTask
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-UNYZRMB2.mjs.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-VUY2K2DI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-O35YOIHC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__objRest,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import { jsx } from "react/jsx-runtime";
|
|
24
24
|
function CopilotKit(_a) {
|
|
25
25
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
26
|
+
var _a2, _b2;
|
|
26
27
|
if (!props.url && !props.publicApiKey) {
|
|
27
28
|
throw new Error("Please provide either a url or a publicApiKey to the CopilotKit component.");
|
|
28
29
|
}
|
|
@@ -112,9 +113,23 @@ ${nonDocumentStrings}`;
|
|
|
112
113
|
);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
116
|
+
let cloud = void 0;
|
|
117
|
+
if (props.publicApiKey) {
|
|
118
|
+
cloud = {
|
|
119
|
+
guardrails: {
|
|
120
|
+
input: {
|
|
121
|
+
restrictToTopic: {
|
|
122
|
+
enabled: props.cloudRestrictToTopic ? true : false,
|
|
123
|
+
validTopics: ((_a2 = props.cloudRestrictToTopic) == null ? void 0 : _a2.validTopics) || [],
|
|
124
|
+
invalidTopics: ((_b2 = props.cloudRestrictToTopic) == null ? void 0 : _b2.invalidTopics) || []
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
115
130
|
const copilotApiConfig = __spreadProps(__spreadValues({
|
|
116
131
|
publicApiKey: props.publicApiKey
|
|
117
|
-
},
|
|
132
|
+
}, cloud ? { cloud } : {}), {
|
|
118
133
|
chatApiEndpoint,
|
|
119
134
|
chatApiEndpointV2: `${props.url}/v2`,
|
|
120
135
|
headers: props.headers || {},
|
|
@@ -169,4 +184,4 @@ export {
|
|
|
169
184
|
CopilotKit,
|
|
170
185
|
defaultCopilotContextCategories
|
|
171
186
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-VYD7RO32.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/copilot-provider/copilotkit.tsx"],"sourcesContent":["import { Ref, useCallback, useRef, useState } from \"react\";\nimport {\n CopilotContext,\n CopilotApiConfig,\n InChatRenderFunction,\n} from \"../../context/copilot-context\";\nimport useTree from \"../../hooks/use-tree\";\nimport { DocumentPointer } from \"../../types\";\nimport {\n COPILOT_CLOUD_CHAT_URL,\n CopilotCloudConfig,\n FunctionCallHandler,\n Message,\n actionToChatCompletionFunction,\n} from \"@copilotkit/shared\";\nimport { FrontendAction } from \"../../types/frontend-action\";\nimport useFlatCategoryStore from \"../../hooks/use-flat-category-store\";\nimport { CopilotKitProps } from \"./copilotkit-props\";\nimport { ToolDefinition } from \"@copilotkit/shared\";\n\n/**\n * The CopilotKit component.\n * This component provides the Copilot context to its children.\n * It can be configured either with a chat API endpoint or a CopilotApiConfig.\n *\n * NOTE: The backend can use OpenAI, or you can bring your own LLM.\n * For examples of the backend api implementation, see `examples/next-openai` usage (under `src/api/copilotkit`),\n * or read the documentation at https://docs.copilotkit.ai\n * In particular, Getting-Started > Quickstart-Backend: https://docs.copilotkit.ai/getting-started/quickstart-backend\n *\n * Example usage:\n * ```\n * <CopilotKit url=\"https://your.copilotkit.api\">\n * <App />\n * </CopilotKit>\n * ```\n *\n * @param props - The props for the component.\n * @returns The CopilotKit component.\n */\nexport function CopilotKit({ children, ...props }: CopilotKitProps) {\n // Compute all the functions and properties that we need to pass\n // to the CopilotContext.\n\n if (!props.url && !props.publicApiKey) {\n throw new Error(\"Please provide either a url or a publicApiKey to the CopilotKit component.\");\n }\n\n const chatApiEndpoint = props.url || COPILOT_CLOUD_CHAT_URL;\n\n const [entryPoints, setEntryPoints] = useState<Record<string, FrontendAction<any>>>({});\n const chatComponentsCache = useRef<Record<string, InChatRenderFunction | string>>({});\n const { addElement, removeElement, printTree } = useTree();\n const [messages, setMessages] = useState<Message[]>([]);\n\n const {\n addElement: addDocument,\n removeElement: removeDocument,\n allElements: allDocuments,\n } = useFlatCategoryStore<DocumentPointer>();\n\n const setEntryPoint = useCallback((id: string, entryPoint: FrontendAction<any>) => {\n setEntryPoints((prevPoints) => {\n return {\n ...prevPoints,\n [id]: entryPoint,\n };\n });\n }, []);\n\n const removeEntryPoint = useCallback((id: string) => {\n setEntryPoints((prevPoints) => {\n const newPoints = { ...prevPoints };\n delete newPoints[id];\n return newPoints;\n });\n }, []);\n\n const getContextString = useCallback(\n (documents: DocumentPointer[], categories: string[]) => {\n const documentsString = documents\n .map((document) => {\n return `${document.name} (${document.sourceApplication}):\\n${document.getContents()}`;\n })\n .join(\"\\n\\n\");\n\n const nonDocumentStrings = printTree(categories);\n\n return `${documentsString}\\n\\n${nonDocumentStrings}`;\n },\n [printTree],\n );\n\n const addContext = useCallback(\n (\n context: string,\n parentId?: string,\n categories: string[] = defaultCopilotContextCategories,\n ) => {\n return addElement(context, categories, parentId);\n },\n [addElement],\n );\n\n const removeContext = useCallback(\n (id: string) => {\n removeElement(id);\n },\n [removeElement],\n );\n\n const getChatCompletionFunctionDescriptions = useCallback(\n (customEntryPoints?: Record<string, FrontendAction<any>>) => {\n return entryPointsToChatCompletionFunctions(Object.values(customEntryPoints || entryPoints));\n },\n [entryPoints],\n );\n\n const getFunctionCallHandler = useCallback(\n (customEntryPoints?: Record<string, FrontendAction<any>>) => {\n return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || entryPoints));\n },\n [entryPoints],\n );\n\n const getDocumentsContext = useCallback(\n (categories: string[]) => {\n return allDocuments(categories);\n },\n [allDocuments],\n );\n\n const addDocumentContext = useCallback(\n (documentPointer: DocumentPointer, categories: string[] = defaultCopilotContextCategories) => {\n return addDocument(documentPointer, categories);\n },\n [addDocument],\n );\n\n const removeDocumentContext = useCallback(\n (documentId: string) => {\n removeDocument(documentId);\n },\n [removeDocument],\n );\n\n if (!props.publicApiKey) {\n if (props.cloudRestrictToTopic) {\n throw new Error(\n \"To use the cloudRestrictToTopic feature, please sign up at https://copilotkit.ai and provide a publicApiKey.\",\n );\n }\n }\n\n let cloud: CopilotCloudConfig | undefined = undefined;\n if (props.publicApiKey) {\n cloud = {\n guardrails: {\n input: {\n restrictToTopic: {\n enabled: props.cloudRestrictToTopic ? true : false,\n validTopics: props.cloudRestrictToTopic?.validTopics || [],\n invalidTopics: props.cloudRestrictToTopic?.invalidTopics || [],\n },\n },\n },\n };\n }\n\n // get the appropriate CopilotApiConfig from the props\n const copilotApiConfig: CopilotApiConfig = {\n publicApiKey: props.publicApiKey,\n ...(cloud ? { cloud } : {}),\n chatApiEndpoint: chatApiEndpoint,\n chatApiEndpointV2: `${props.url}/v2`,\n headers: props.headers || {},\n body: {\n ...props.body,\n ...props.backendOnlyProps,\n },\n };\n\n return (\n <CopilotContext.Provider\n value={{\n entryPoints,\n chatComponentsCache,\n getChatCompletionFunctionDescriptions,\n getFunctionCallHandler,\n setEntryPoint,\n removeEntryPoint,\n getContextString,\n addContext,\n removeContext,\n getDocumentsContext,\n addDocumentContext,\n removeDocumentContext,\n copilotApiConfig: copilotApiConfig,\n messages,\n setMessages,\n }}\n >\n {children}\n </CopilotContext.Provider>\n );\n}\n\nexport const defaultCopilotContextCategories = [\"global\"];\n\nfunction entryPointsToChatCompletionFunctions(actions: FrontendAction<any>[]): ToolDefinition[] {\n return actions.map(actionToChatCompletionFunction);\n}\n\nfunction entryPointsToFunctionCallHandler(actions: FrontendAction<any>[]): FunctionCallHandler {\n return async (chatMessages, functionCall) => {\n let actionsByFunctionName: Record<string, FrontendAction<any>> = {};\n for (let action of actions) {\n actionsByFunctionName[action.name] = action;\n }\n\n const action = actionsByFunctionName[functionCall.name || \"\"];\n if (action) {\n let functionCallArguments: Record<string, any>[] = [];\n if (functionCall.arguments) {\n functionCallArguments = JSON.parse(functionCall.arguments);\n }\n return await action.handler(functionCallArguments);\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAc,aAAa,QAAQ,gBAAgB;AAQnD;AAAA,EACE;AAAA,EAIA;AAAA,OACK;AAyKH;AA/IG,SAAS,WAAW,IAAyC;AAAzC,eAAE,WAxC7B,IAwC2B,IAAe,kBAAf,IAAe,CAAb;AAxC7B,MAAAA,KAAAC;AA4CE,MAAI,CAAC,MAAM,OAAO,CAAC,MAAM,cAAc;AACrC,UAAM,IAAI,MAAM,4EAA4E;AAAA,EAC9F;AAEA,QAAM,kBAAkB,MAAM,OAAO;AAErC,QAAM,CAAC,aAAa,cAAc,IAAI,SAA8C,CAAC,CAAC;AACtF,QAAM,sBAAsB,OAAsD,CAAC,CAAC;AACpF,QAAM,EAAE,YAAY,eAAe,UAAU,IAAI,iBAAQ;AACzD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAoB,CAAC,CAAC;AAEtD,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA,EACf,IAAI,gCAAsC;AAE1C,QAAM,gBAAgB,YAAY,CAAC,IAAY,eAAoC;AACjF,mBAAe,CAAC,eAAe;AAC7B,aAAO,iCACF,aADE;AAAA,QAEL,CAAC,EAAE,GAAG;AAAA,MACR;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB,YAAY,CAAC,OAAe;AACnD,mBAAe,CAAC,eAAe;AAC7B,YAAM,YAAY,mBAAK;AACvB,aAAO,UAAU,EAAE;AACnB,aAAO;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB;AAAA,IACvB,CAAC,WAA8B,eAAyB;AACtD,YAAM,kBAAkB,UACrB,IAAI,CAAC,aAAa;AACjB,eAAO,GAAG,SAAS,SAAS,SAAS;AAAA,EAAwB,SAAS,YAAY;AAAA,MACpF,CAAC,EACA,KAAK,MAAM;AAEd,YAAM,qBAAqB,UAAU,UAAU;AAE/C,aAAO,GAAG;AAAA;AAAA,EAAsB;AAAA,IAClC;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,QAAM,aAAa;AAAA,IACjB,CACE,SACA,UACA,aAAuB,oCACpB;AACH,aAAO,WAAW,SAAS,YAAY,QAAQ;AAAA,IACjD;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,gBAAgB;AAAA,IACpB,CAAC,OAAe;AACd,oBAAc,EAAE;AAAA,IAClB;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,QAAM,wCAAwC;AAAA,IAC5C,CAAC,sBAA4D;AAC3D,aAAO,qCAAqC,OAAO,OAAO,qBAAqB,WAAW,CAAC;AAAA,IAC7F;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,QAAM,yBAAyB;AAAA,IAC7B,CAAC,sBAA4D;AAC3D,aAAO,iCAAiC,OAAO,OAAO,qBAAqB,WAAW,CAAC;AAAA,IACzF;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,QAAM,sBAAsB;AAAA,IAC1B,CAAC,eAAyB;AACxB,aAAO,aAAa,UAAU;AAAA,IAChC;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAEA,QAAM,qBAAqB;AAAA,IACzB,CAAC,iBAAkC,aAAuB,oCAAoC;AAC5F,aAAO,YAAY,iBAAiB,UAAU;AAAA,IAChD;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,QAAM,wBAAwB;AAAA,IAC5B,CAAC,eAAuB;AACtB,qBAAe,UAAU;AAAA,IAC3B;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,MAAI,CAAC,MAAM,cAAc;AACvB,QAAI,MAAM,sBAAsB;AAC9B,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,QAAwC;AAC5C,MAAI,MAAM,cAAc;AACtB,YAAQ;AAAA,MACN,YAAY;AAAA,QACV,OAAO;AAAA,UACL,iBAAiB;AAAA,YACf,SAAS,MAAM,uBAAuB,OAAO;AAAA,YAC7C,eAAaD,MAAA,MAAM,yBAAN,gBAAAA,IAA4B,gBAAe,CAAC;AAAA,YACzD,iBAAeC,MAAA,MAAM,yBAAN,gBAAAA,IAA4B,kBAAiB,CAAC;AAAA,UAC/D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,QAAM,mBAAqC;AAAA,IACzC,cAAc,MAAM;AAAA,KAChB,QAAQ,EAAE,MAAM,IAAI,CAAC,IAFgB;AAAA,IAGzC;AAAA,IACA,mBAAmB,GAAG,MAAM;AAAA,IAC5B,SAAS,MAAM,WAAW,CAAC;AAAA,IAC3B,MAAM,kCACD,MAAM,OACN,MAAM;AAAA,EAEb;AAEA,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,IAAM,kCAAkC,CAAC,QAAQ;AAExD,SAAS,qCAAqC,SAAkD;AAC9F,SAAO,QAAQ,IAAI,8BAA8B;AACnD;AAEA,SAAS,iCAAiC,SAAqD;AAC7F,SAAO,CAAO,cAAc,iBAAiB;AAC3C,QAAI,wBAA6D,CAAC;AAClE,aAASC,WAAU,SAAS;AAC1B,4BAAsBA,QAAO,IAAI,IAAIA;AAAA,IACvC;AAEA,UAAM,SAAS,sBAAsB,aAAa,QAAQ,EAAE;AAC5D,QAAI,QAAQ;AACV,UAAI,wBAA+C,CAAC;AACpD,UAAI,aAAa,WAAW;AAC1B,gCAAwB,KAAK,MAAM,aAAa,SAAS;AAAA,MAC3D;AACA,aAAO,MAAM,OAAO,QAAQ,qBAAqB;AAAA,IACnD;AAAA,EACF;AACF;","names":["_a","_b","action"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\n/**\n * Props for CopilotKit.\n */\n\nexport interface CopilotKitProps {\n /**\n * The public API key for Copilot Cloud.\n */\n publicApiKey?: string;\n\n /**\n * Cloud feature: Restrict to a specific topic.\n */\n cloudRestrictToTopic?: {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\n/**\n * Props for CopilotKit.\n */\n\nexport interface CopilotKitProps {\n /**\n * The public API key for Copilot Cloud.\n */\n publicApiKey?: string;\n\n /**\n * Cloud feature: Restrict to a specific topic.\n */\n cloudRestrictToTopic?: {\n validTopics: string[];\n invalidTopics?: string[];\n };\n\n /**\n * The endpoint for the chat API.\n */\n url?: 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 * Additional body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'message': 'Hello, world!'\n * }\n * ```\n */\n body?: Record<string, any>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n\n /**\n * Backend only props that will be combined to body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'user_id': 'users_id',\n * }\n * ```\n */\n backendOnlyProps?: Record<string, any>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -332,6 +332,7 @@ function setsHaveIntersection2(setA, setB) {
|
|
|
332
332
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
333
333
|
function CopilotKit(_a) {
|
|
334
334
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
335
|
+
var _a2, _b2;
|
|
335
336
|
if (!props.url && !props.publicApiKey) {
|
|
336
337
|
throw new Error("Please provide either a url or a publicApiKey to the CopilotKit component.");
|
|
337
338
|
}
|
|
@@ -421,9 +422,23 @@ ${nonDocumentStrings}`;
|
|
|
421
422
|
);
|
|
422
423
|
}
|
|
423
424
|
}
|
|
425
|
+
let cloud = void 0;
|
|
426
|
+
if (props.publicApiKey) {
|
|
427
|
+
cloud = {
|
|
428
|
+
guardrails: {
|
|
429
|
+
input: {
|
|
430
|
+
restrictToTopic: {
|
|
431
|
+
enabled: props.cloudRestrictToTopic ? true : false,
|
|
432
|
+
validTopics: ((_a2 = props.cloudRestrictToTopic) == null ? void 0 : _a2.validTopics) || [],
|
|
433
|
+
invalidTopics: ((_b2 = props.cloudRestrictToTopic) == null ? void 0 : _b2.invalidTopics) || []
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
424
439
|
const copilotApiConfig = __spreadProps(__spreadValues({
|
|
425
440
|
publicApiKey: props.publicApiKey
|
|
426
|
-
},
|
|
441
|
+
}, cloud ? { cloud } : {}), {
|
|
427
442
|
chatApiEndpoint,
|
|
428
443
|
chatApiEndpointV2: `${props.url}/v2`,
|
|
429
444
|
headers: props.headers || {},
|