@copilotkit/react-core 0.0.0-fix-mcp-parameters-extract-20250710161807 → 0.0.0-fix-surface-agui-stream-errors-20250730142248
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 +197 -3
- package/README.md +123 -30
- package/dist/chunk-2IDV5OHF.mjs +11 -0
- package/dist/chunk-2IDV5OHF.mjs.map +1 -0
- package/dist/{chunk-BVK7PLK6.mjs → chunk-3RHHNUVV.mjs} +2 -2
- package/dist/{chunk-5BSUSFHM.mjs → chunk-6EKLRL7B.mjs} +2 -2
- package/dist/chunk-AWFAFFO5.mjs +221 -0
- package/dist/chunk-AWFAFFO5.mjs.map +1 -0
- package/dist/{chunk-36MGCCPZ.mjs → chunk-CLMDRYEN.mjs} +2 -2
- package/dist/{chunk-YAF2LATQ.mjs → chunk-EFL5OBKN.mjs} +1 -1
- package/dist/chunk-EFL5OBKN.mjs.map +1 -0
- package/dist/{chunk-JWAXDYOW.mjs → chunk-FAUNHSQU.mjs} +3 -3
- package/dist/{chunk-NGQN3JRJ.mjs → chunk-FTP6FDYS.mjs} +4 -4
- package/dist/chunk-FTP6FDYS.mjs.map +1 -0
- package/dist/{chunk-KIXKBJUV.mjs → chunk-GEKWHETN.mjs} +3 -3
- package/dist/{chunk-GEE5AMYL.mjs → chunk-GRCHDHC4.mjs} +96 -26
- package/dist/chunk-GRCHDHC4.mjs.map +1 -0
- package/dist/chunk-ICIK2BSB.mjs +17 -0
- package/dist/chunk-ICIK2BSB.mjs.map +1 -0
- package/dist/{chunk-VDADWRS3.mjs → chunk-IN7GE4NO.mjs} +2 -2
- package/dist/{chunk-FN3UA2ZE.mjs → chunk-K4HXT453.mjs} +3 -3
- package/dist/chunk-KDAZGZ24.mjs +1 -0
- package/dist/{chunk-6ZLSC4KB.mjs → chunk-KH27ZS4Y.mjs} +8 -5
- package/dist/chunk-KH27ZS4Y.mjs.map +1 -0
- package/dist/{chunk-BSAVFYRQ.mjs → chunk-MUDXTKXE.mjs} +41 -7
- package/dist/chunk-MUDXTKXE.mjs.map +1 -0
- package/dist/chunk-MWHILKQH.mjs +18 -0
- package/dist/chunk-MWHILKQH.mjs.map +1 -0
- package/dist/{chunk-3OQM3NEK.mjs → chunk-N4WEHORG.mjs} +2 -2
- package/dist/{chunk-NJA5ZLAZ.mjs → chunk-OPRDTF4S.mjs} +4 -4
- package/dist/chunk-OPRDTF4S.mjs.map +1 -0
- package/dist/{chunk-GIMSRCVW.mjs → chunk-PHIMGB3K.mjs} +177 -25
- package/dist/chunk-PHIMGB3K.mjs.map +1 -0
- package/dist/{chunk-DKZTPL66.mjs → chunk-TEMLWRRT.mjs} +5 -2
- package/dist/chunk-TEMLWRRT.mjs.map +1 -0
- package/dist/{chunk-KLENTCQV.mjs → chunk-TTI4Z6GK.mjs} +16 -17
- package/dist/chunk-TTI4Z6GK.mjs.map +1 -0
- package/dist/{chunk-CUAFWKTQ.mjs → chunk-VH45SC6Z.mjs} +2 -2
- package/dist/chunk-VSH4JSN3.mjs +79 -0
- package/dist/chunk-VSH4JSN3.mjs.map +1 -0
- package/dist/{chunk-DCTJZ742.mjs → chunk-ZLQVRPDS.mjs} +5 -2
- package/dist/chunk-ZLQVRPDS.mjs.map +1 -0
- package/dist/{chunk-SGF6C7I6.mjs → chunk-ZTZJIDRJ.mjs} +9 -14
- package/dist/chunk-ZTZJIDRJ.mjs.map +1 -0
- package/dist/components/copilot-provider/copilot-messages.d.ts +17 -1
- package/dist/components/copilot-provider/copilot-messages.js +48 -6
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +11 -7
- package/dist/components/copilot-provider/copilotkit-props.d.ts +5 -2
- 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 +336 -552
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +11 -10
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +336 -552
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +11 -10
- package/dist/components/error-boundary/error-boundary.js +172 -323
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +4 -4
- package/dist/components/error-boundary/error-utils.js.map +1 -1
- package/dist/components/error-boundary/error-utils.mjs +2 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +336 -552
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -10
- package/dist/components/toast/toast-provider.js.map +1 -1
- package/dist/components/toast/toast-provider.mjs +1 -1
- package/dist/components/usage-banner.d.ts +8 -3
- package/dist/components/usage-banner.js +172 -302
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +3 -1
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +4 -1
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/copilot-messages-context.d.ts +11 -15
- package/dist/context/copilot-messages-context.js +4 -1
- package/dist/context/copilot-messages-context.js.map +1 -1
- package/dist/context/copilot-messages-context.mjs +1 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +8 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +2 -2
- package/dist/{copilot-context-3ab4fdf5.d.ts → copilot-context-256f9020.d.ts} +3 -1
- package/dist/hooks/index.d.ts +8 -6
- package/dist/hooks/index.js +607 -169
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +35 -26
- package/dist/hooks/use-chat.d.ts +5 -1
- package/dist/hooks/use-chat.js +16 -2
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +6 -6
- package/dist/hooks/use-coagent-state-render.js +4 -1
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +3 -3
- package/dist/hooks/use-coagent.d.ts +5 -6
- package/dist/hooks/use-coagent.js +464 -58
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +15 -13
- package/dist/hooks/use-copilot-action.d.ts +1 -1
- package/dist/hooks/use-copilot-action.js +4 -1
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +4 -4
- package/dist/hooks/use-copilot-additional-instructions.js +4 -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 +4 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +5 -5
- package/dist/hooks/use-copilot-chat-light.d.ts +211 -0
- package/dist/hooks/use-copilot-chat-light.js +1768 -0
- package/dist/hooks/use-copilot-chat-light.js.map +1 -0
- package/dist/hooks/use-copilot-chat-light.mjs +28 -0
- package/dist/hooks/use-copilot-chat-light.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat.d.ts +10 -45
- package/dist/hooks/use-copilot-chat.js +519 -68
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +17 -13
- package/dist/hooks/use-copilot-chat_internal.d.ts +91 -0
- package/dist/hooks/use-copilot-chat_internal.js +1758 -0
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -0
- package/dist/hooks/use-copilot-chat_internal.mjs +29 -0
- package/dist/hooks/use-copilot-chat_internal.mjs.map +1 -0
- package/dist/hooks/use-copilot-readable.js +4 -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.js +9 -1
- 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 +4 -1
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +467 -75
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +15 -13
- package/dist/hooks/use-make-copilot-document-readable.js +4 -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-08c43df1.d.ts +36 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +763 -586
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -29
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +12 -11
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +12 -11
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/utils/dev-console.d.ts +1 -1
- package/dist/utils/dev-console.js +9 -1
- package/dist/utils/dev-console.js.map +1 -1
- package/dist/utils/dev-console.mjs +1 -1
- package/dist/utils/extract.d.ts +2 -2
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +11 -10
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +153 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +17 -11
- package/dist/utils/suggestions-constants.d.ts +9 -0
- package/dist/utils/suggestions-constants.js +35 -0
- package/dist/utils/suggestions-constants.js.map +1 -0
- package/dist/utils/suggestions-constants.mjs +8 -0
- package/dist/utils/suggestions-constants.mjs.map +1 -0
- package/dist/utils/suggestions.d.ts +11 -0
- package/dist/utils/suggestions.js +343 -0
- package/dist/utils/suggestions.js.map +1 -0
- package/dist/utils/suggestions.mjs +22 -0
- package/dist/utils/suggestions.mjs.map +1 -0
- package/package.json +3 -3
- package/src/components/copilot-provider/copilot-messages.tsx +57 -1
- package/src/components/copilot-provider/copilotkit-props.tsx +4 -1
- package/src/components/copilot-provider/copilotkit.tsx +21 -7
- package/src/components/error-boundary/error-boundary.tsx +5 -15
- package/src/components/toast/toast-provider.tsx +1 -3
- package/src/components/usage-banner.tsx +187 -315
- package/src/context/copilot-context.tsx +13 -1
- package/src/context/copilot-messages-context.tsx +7 -1
- package/src/hooks/__tests__/use-coagent-config.test.ts +8 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-chat.ts +8 -0
- package/src/hooks/use-coagent.ts +14 -11
- package/src/hooks/use-copilot-action.ts +1 -1
- package/src/hooks/use-copilot-chat-light.ts +219 -0
- package/src/hooks/use-copilot-chat.ts +127 -292
- package/src/hooks/use-copilot-chat_internal.ts +436 -0
- package/src/hooks/use-langgraph-interrupt.ts +1 -1
- package/src/utils/dev-console.ts +18 -2
- package/src/utils/index.ts +3 -0
- package/src/utils/suggestions-constants.ts +8 -0
- package/src/utils/suggestions.ts +208 -0
- package/dist/chunk-57K2ZJ5F.mjs +0 -348
- package/dist/chunk-57K2ZJ5F.mjs.map +0 -1
- package/dist/chunk-6ZLSC4KB.mjs.map +0 -1
- package/dist/chunk-BSAVFYRQ.mjs.map +0 -1
- package/dist/chunk-CQPYJIBH.mjs +0 -1
- package/dist/chunk-DCTJZ742.mjs.map +0 -1
- package/dist/chunk-DKZTPL66.mjs.map +0 -1
- package/dist/chunk-GEE5AMYL.mjs.map +0 -1
- package/dist/chunk-GFJW4RIM.mjs +0 -9
- package/dist/chunk-GFJW4RIM.mjs.map +0 -1
- package/dist/chunk-GIMSRCVW.mjs.map +0 -1
- package/dist/chunk-KLENTCQV.mjs.map +0 -1
- package/dist/chunk-NGQN3JRJ.mjs.map +0 -1
- package/dist/chunk-NJA5ZLAZ.mjs.map +0 -1
- package/dist/chunk-SGF6C7I6.mjs.map +0 -1
- package/dist/chunk-YAF2LATQ.mjs.map +0 -1
- /package/dist/{chunk-BVK7PLK6.mjs.map → chunk-3RHHNUVV.mjs.map} +0 -0
- /package/dist/{chunk-5BSUSFHM.mjs.map → chunk-6EKLRL7B.mjs.map} +0 -0
- /package/dist/{chunk-36MGCCPZ.mjs.map → chunk-CLMDRYEN.mjs.map} +0 -0
- /package/dist/{chunk-JWAXDYOW.mjs.map → chunk-FAUNHSQU.mjs.map} +0 -0
- /package/dist/{chunk-KIXKBJUV.mjs.map → chunk-GEKWHETN.mjs.map} +0 -0
- /package/dist/{chunk-VDADWRS3.mjs.map → chunk-IN7GE4NO.mjs.map} +0 -0
- /package/dist/{chunk-FN3UA2ZE.mjs.map → chunk-K4HXT453.mjs.map} +0 -0
- /package/dist/{chunk-CQPYJIBH.mjs.map → chunk-KDAZGZ24.mjs.map} +0 -0
- /package/dist/{chunk-3OQM3NEK.mjs.map → chunk-N4WEHORG.mjs.map} +0 -0
- /package/dist/{chunk-CUAFWKTQ.mjs.map → chunk-VH45SC6Z.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,172 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-surface-agui-stream-errors-20250730142248
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8674da1: - refactor(headless): completely overhaul headless ui to better support agentic features
|
|
8
|
+
|
|
9
|
+
Headless UI has been in a bad state for a bit now. When we added support for different
|
|
10
|
+
agentic runtimes we acquired tech-debt that, with this PR, is being alleviated.
|
|
11
|
+
|
|
12
|
+
As such, the following features have been updated to be completely functional with Headless UI.
|
|
13
|
+
|
|
14
|
+
- Generative UI
|
|
15
|
+
- Suggestions
|
|
16
|
+
- Agentic Generative UI
|
|
17
|
+
- Interrupts
|
|
18
|
+
|
|
19
|
+
In addition, a variety of QOL changes have been made.
|
|
20
|
+
|
|
21
|
+
- New AG-UI based message types
|
|
22
|
+
- Inline code rendering is fixed
|
|
23
|
+
|
|
24
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 967d0ab: - refactor(chat): separate useCopilotChat into internal implementation and public API
|
|
29
|
+
- 6de24ce: - fix rerender issues by moving suggestions to the messages context
|
|
30
|
+
- Updated dependencies [a8c0263]
|
|
31
|
+
- Updated dependencies [8674da1]
|
|
32
|
+
- @copilotkit/shared@0.0.0-fix-surface-agui-stream-errors-20250730142248
|
|
33
|
+
- @copilotkit/runtime-client-gql@0.0.0-fix-surface-agui-stream-errors-20250730142248
|
|
34
|
+
|
|
35
|
+
## 1.10.0-next.8
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 6de24ce: - fix rerender issues by moving suggestions to the messages context
|
|
40
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.8
|
|
41
|
+
- @copilotkit/shared@1.10.0-next.8
|
|
42
|
+
|
|
43
|
+
## 1.10.0-next.7
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.7
|
|
48
|
+
- @copilotkit/shared@1.10.0-next.7
|
|
49
|
+
|
|
50
|
+
## 1.10.0-next.6
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.6
|
|
55
|
+
- @copilotkit/shared@1.10.0-next.6
|
|
56
|
+
|
|
57
|
+
## 1.10.0-next.5
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [a8c0263]
|
|
62
|
+
- @copilotkit/shared@1.10.0-next.5
|
|
63
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.5
|
|
64
|
+
|
|
65
|
+
## 1.10.0-next.4
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 967d0ab: - refactor(chat): separate useCopilotChat into internal implementation and public API
|
|
70
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.4
|
|
71
|
+
- @copilotkit/shared@1.10.0-next.4
|
|
72
|
+
|
|
73
|
+
## 1.10.0-next.3
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.3
|
|
78
|
+
- @copilotkit/shared@1.10.0-next.3
|
|
79
|
+
|
|
80
|
+
## 1.10.0-next.2
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.2
|
|
85
|
+
- @copilotkit/shared@1.10.0-next.2
|
|
86
|
+
|
|
87
|
+
## 1.10.0-next.1
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.1
|
|
92
|
+
- @copilotkit/shared@1.10.0-next.1
|
|
93
|
+
|
|
94
|
+
## 1.10.0-next.0
|
|
95
|
+
|
|
96
|
+
### Minor Changes
|
|
97
|
+
|
|
98
|
+
- 8674da1: - refactor(headless): completely overhaul headless ui to better support agentic features
|
|
99
|
+
|
|
100
|
+
Headless UI has been in a bad state for a bit now. When we added support for different
|
|
101
|
+
agentic runtimes we acquired tech-debt that, with this PR, is being alleviated.
|
|
102
|
+
|
|
103
|
+
As such, the following features have been updated to be completely functional with Headless UI.
|
|
104
|
+
|
|
105
|
+
- Generative UI
|
|
106
|
+
- Suggestions
|
|
107
|
+
- Agentic Generative UI
|
|
108
|
+
- Interrupts
|
|
109
|
+
|
|
110
|
+
In addition, a variety of QOL changes have been made.
|
|
111
|
+
|
|
112
|
+
- New AG-UI based message types
|
|
113
|
+
- Inline code rendering is fixed
|
|
114
|
+
|
|
115
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [8674da1]
|
|
120
|
+
- @copilotkit/shared@1.10.0-next.0
|
|
121
|
+
- @copilotkit/runtime-client-gql@1.10.0-next.0
|
|
122
|
+
|
|
123
|
+
## 1.9.3
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- f83bda0: Fix: remote actions should never be executed to avoid duplicate result messages
|
|
128
|
+
- Updated dependencies [1bda332]
|
|
129
|
+
- @copilotkit/shared@1.9.3
|
|
130
|
+
- @copilotkit/runtime-client-gql@1.9.3
|
|
131
|
+
|
|
132
|
+
## 1.9.3-next.4
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- f83bda0: Fix: remote actions should never be executed to avoid duplicate result messages
|
|
137
|
+
- @copilotkit/runtime-client-gql@1.9.3-next.4
|
|
138
|
+
- @copilotkit/shared@1.9.3-next.4
|
|
139
|
+
|
|
140
|
+
## 1.9.3-next.3
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- Updated dependencies [1bda332]
|
|
145
|
+
- @copilotkit/shared@1.9.3-next.3
|
|
146
|
+
- @copilotkit/runtime-client-gql@1.9.3-next.3
|
|
147
|
+
|
|
148
|
+
## 1.9.3-next.2
|
|
149
|
+
|
|
150
|
+
### Patch Changes
|
|
151
|
+
|
|
152
|
+
- @copilotkit/runtime-client-gql@1.9.3-next.2
|
|
153
|
+
- @copilotkit/shared@1.9.3-next.2
|
|
154
|
+
|
|
155
|
+
## 1.9.3-next.1
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- @copilotkit/runtime-client-gql@1.9.3-next.1
|
|
160
|
+
- @copilotkit/shared@1.9.3-next.1
|
|
161
|
+
|
|
162
|
+
## 1.9.3-next.0
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- @copilotkit/runtime-client-gql@1.9.3-next.0
|
|
167
|
+
- @copilotkit/shared@1.9.3-next.0
|
|
168
|
+
|
|
169
|
+
## 1.9.2
|
|
4
170
|
|
|
5
171
|
### Patch Changes
|
|
6
172
|
|
|
@@ -38,8 +204,36 @@
|
|
|
38
204
|
- Updated dependencies [1d1c51d]
|
|
39
205
|
- Updated dependencies [10345a5]
|
|
40
206
|
- Updated dependencies [9169ad7]
|
|
41
|
-
- @copilotkit/shared@
|
|
42
|
-
- @copilotkit/runtime-client-gql@
|
|
207
|
+
- @copilotkit/shared@1.9.2
|
|
208
|
+
- @copilotkit/runtime-client-gql@1.9.2
|
|
209
|
+
|
|
210
|
+
## 1.9.2-next.26
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- @copilotkit/runtime-client-gql@1.9.2-next.26
|
|
215
|
+
- @copilotkit/shared@1.9.2-next.26
|
|
216
|
+
|
|
217
|
+
## 1.9.2-next.25
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- @copilotkit/runtime-client-gql@1.9.2-next.25
|
|
222
|
+
- @copilotkit/shared@1.9.2-next.25
|
|
223
|
+
|
|
224
|
+
## 1.9.2-next.24
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- @copilotkit/runtime-client-gql@1.9.2-next.24
|
|
229
|
+
- @copilotkit/shared@1.9.2-next.24
|
|
230
|
+
|
|
231
|
+
## 1.9.2-next.23
|
|
232
|
+
|
|
233
|
+
### Patch Changes
|
|
234
|
+
|
|
235
|
+
- @copilotkit/runtime-client-gql@1.9.2-next.23
|
|
236
|
+
- @copilotkit/shared@1.9.2-next.23
|
|
43
237
|
|
|
44
238
|
## 1.9.2-next.22
|
|
45
239
|
|
package/README.md
CHANGED
|
@@ -1,48 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://copilotkit.ai" target="_blank">
|
|
3
|
-
<img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo">
|
|
4
|
-
</a>
|
|
1
|
+
# CopilotKit - React Core
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</strong>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<br/>
|
|
14
|
-
|
|
15
|
-
<!-- -->
|
|
16
|
-
|
|
17
|
-
<div align="center">
|
|
5
|
+
<br>
|
|
6
|
+
<div align="center" style="display:flex;justify-content:center;gap:16px;height:20px;margin: 0;">
|
|
18
7
|
<a href="https://www.npmjs.com/package/@copilotkit/react-core" target="_blank">
|
|
19
8
|
<img src="https://img.shields.io/npm/v/%40copilotkit%2Freact-core?logo=npm&logoColor=%23FFFFFF&label=Version&color=%236963ff" alt="NPM">
|
|
20
9
|
</a>
|
|
21
|
-
<
|
|
10
|
+
<a href="https://github.com/copilotkit/copilotkit/blob/main/LICENSE" target="_blank">
|
|
11
|
+
<img src="https://img.shields.io/github/license/copilotkit/copilotkit?color=%236963ff&label=License" alt="MIT">
|
|
12
|
+
</a>
|
|
22
13
|
<a href="https://discord.gg/6dffbvGU3D" target="_blank">
|
|
23
14
|
<img src="https://img.shields.io/discord/1122926057641742418?logo=discord&logoColor=%23FFFFFF&label=Discord&color=%236963ff" alt="Discord">
|
|
24
15
|
</a>
|
|
25
16
|
</div>
|
|
26
17
|
<br/>
|
|
27
|
-
|
|
28
18
|
<div align="center">
|
|
29
|
-
<a href="https://
|
|
30
|
-
<img src="https://
|
|
31
|
-
</a>
|
|
32
|
-
<a href="https://docs.copilotkit.ai?ref=github_readme" target="_blank">
|
|
33
|
-
<img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_docs.png" alt="CopilotKit GitHub" height="40px">
|
|
34
|
-
</a>
|
|
35
|
-
<a href="https://cloud.copilotkit.ai?ref=github_readme" target="_blank">
|
|
36
|
-
<img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_cloud.png" alt="CopilotKit GitHub" height="40px">
|
|
19
|
+
<a href="https://www.producthunt.com/posts/copilotkit" target="_blank">
|
|
20
|
+
<img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=428778&theme=light&period=daily">
|
|
37
21
|
</a>
|
|
38
22
|
</div>
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
## ✨ Why CopilotKit?
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
- Minutes to integrate - Get started quickly with our CLI
|
|
27
|
+
- Framework agnostic - Works with React, Next.js, AGUI and more
|
|
28
|
+
- Production-ready UI - Use customizable components or build with headless UI
|
|
29
|
+
- Built-in security - Prompt injection protection
|
|
30
|
+
- Open source - Full transparency and community-driven
|
|
31
|
+
|
|
32
|
+
<img src="https://github.com/user-attachments/assets/6cb425f8-ffcb-49d2-9bbb-87cab5995b78" alt="class-support-ecosystem" style="border-radius: 12px; border: 2px solid #d6d4fa;">
|
|
33
|
+
|
|
34
|
+
## 🧑💻 Real life use cases
|
|
35
|
+
|
|
36
|
+
<span>Deploy deeply-integrated AI assistants & agents that work alongside your users inside your applications.</span>
|
|
37
|
+
|
|
38
|
+
<img src="https://github.com/user-attachments/assets/3b810240-e9f8-43ae-acec-31a58095e223" alt="headless-ui" style="border-radius: 12px; border: 2px solid #d6d4fa;">
|
|
39
|
+
|
|
40
|
+
## 🖥️ Code Samples
|
|
41
|
+
|
|
42
|
+
<span>Drop in these building blocks and tailor them to your needs.</span>
|
|
43
|
+
|
|
44
|
+
<h3>Build with Headless APIs and Pre-Built Components</h3>
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// Headless UI with full control
|
|
48
|
+
const { visibleMessages, appendMessage, setMessages, ... } = useCopilotChat();
|
|
49
|
+
|
|
50
|
+
// Pre-built components with deep customization options (CSS + pass custom sub-components)
|
|
51
|
+
<CopilotPopup
|
|
52
|
+
instructions={"You are assisting the user as best as you can. Answer in the best way possible given the data you have."}
|
|
53
|
+
labels={{ title: "Popup Assistant", initial: "Need any help?" }}
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
// Frontend actions + generative UI, with full streaming support
|
|
59
|
+
useCopilotAction({
|
|
60
|
+
name: "appendToSpreadsheet",
|
|
61
|
+
description: "Append rows to the current spreadsheet",
|
|
62
|
+
parameters: [
|
|
63
|
+
{ name: "rows", type: "object[]", attributes: [{ name: "cells", type: "object[]", attributes: [{ name: "value", type: "string" }] }] }
|
|
64
|
+
],
|
|
65
|
+
render: ({ status, args }) => <Spreadsheet data={canonicalSpreadsheetData(args.rows)} />,
|
|
66
|
+
handler: ({ rows }) => setSpreadsheet({ ...spreadsheet, rows: [...spreadsheet.rows, ...canonicalSpreadsheetData(rows)] }),
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<h3>Integrate In-App CoAgents with LangGraph</h3>
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
// Share state between app and agent
|
|
74
|
+
const { agentState } = useCoAgent({
|
|
75
|
+
name: "basic_agent",
|
|
76
|
+
initialState: { input: "NYC" }
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// agentic generative UI
|
|
80
|
+
useCoAgentStateRender({
|
|
81
|
+
name: "basic_agent",
|
|
82
|
+
render: ({ state }) => <WeatherDisplay {...state.final_response} />,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Human in the Loop (Approval)
|
|
86
|
+
useCopilotAction({
|
|
87
|
+
name: "email_tool",
|
|
88
|
+
parameters: [
|
|
89
|
+
{
|
|
90
|
+
name: "email_draft",
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "The email content",
|
|
93
|
+
required: true,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
renderAndWaitForResponse: ({ args, status, respond }) => {
|
|
97
|
+
return (
|
|
98
|
+
<EmailConfirmation
|
|
99
|
+
emailContent={args.email_draft || ""}
|
|
100
|
+
isExecuting={status === "executing"}
|
|
101
|
+
onCancel={() => respond?.({ approved: false })}
|
|
102
|
+
onSend={() =>
|
|
103
|
+
respond?.({
|
|
104
|
+
approved: true,
|
|
105
|
+
metadata: { sentAt: new Date().toISOString() },
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
// intermediate agent state streaming (supports both LangGraph.js + LangGraph python)
|
|
116
|
+
const modifiedConfig = copilotKitCustomizeConfig(config, {
|
|
117
|
+
emitIntermediateState: [{
|
|
118
|
+
stateKey: "outline",
|
|
119
|
+
tool: "set_outline",
|
|
120
|
+
toolArgument: "outline"
|
|
121
|
+
}],
|
|
122
|
+
});
|
|
123
|
+
const response = await ChatOpenAI({ model: "gpt-4o" }).invoke(messages, modifiedConfig);
|
|
124
|
+
```
|
|
125
|
+
## 🏆 Featured Examples
|
|
126
|
+
|
|
127
|
+
<p align="center">
|
|
128
|
+
<a href="https://www.copilotkit.ai/examples/form-filling-copilot">
|
|
129
|
+
<img src="https://github.com/user-attachments/assets/874da84a-67ff-47fa-a6b4-cbc3c65eb704" width="300" style="border-radius: 16px;" />
|
|
130
|
+
</a>
|
|
131
|
+
<a href="https://www.copilotkit.ai/examples/state-machine-copilot">
|
|
132
|
+
<img src="https://github.com/user-attachments/assets/0b5e45b3-2704-4678-82dc-2f3e1c58e2dd" width="300" style="border-radius: 16px;" />
|
|
133
|
+
</a>
|
|
134
|
+
<a href="https://www.copilotkit.ai/examples/chat-with-your-data">
|
|
135
|
+
<img src="https://github.com/user-attachments/assets/0fed66be-a4c2-4093-8eab-75c0b27a62f6" width="300" style="border-radius: 16px;" />
|
|
136
|
+
</a>
|
|
137
|
+
</p>
|
|
45
138
|
|
|
46
|
-
|
|
139
|
+
## Documentation
|
|
47
140
|
|
|
48
141
|
To get started with CopilotKit, please check out the [documentation](https://docs.copilotkit.ai).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/suggestions-constants.ts"],"sourcesContent":["/**\n * Constants for suggestions retry logic\n */\n\nexport const SUGGESTION_RETRY_CONFIG = {\n MAX_RETRIES: 3,\n COOLDOWN_MS: 5000, // 5 seconds\n} as const;\n"],"mappings":";AAIO,IAAM,0BAA0B;AAAA,EACrC,aAAa;AAAA,EACb,aAAa;AAAA;AACf;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TEMLWRRT.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-3RHHNUVV.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TEMLWRRT.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-readable.ts
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
@@ -34,4 +34,4 @@ function useCopilotReadable({
|
|
|
34
34
|
export {
|
|
35
35
|
useCopilotReadable
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-6EKLRL7B.mjs.map
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// src/components/usage-banner.tsx
|
|
2
|
+
import {
|
|
3
|
+
Severity,
|
|
4
|
+
ErrorVisibility,
|
|
5
|
+
CopilotKitErrorCode
|
|
6
|
+
} from "@copilotkit/shared";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function UsageBanner({
|
|
9
|
+
severity = Severity.CRITICAL,
|
|
10
|
+
message = "",
|
|
11
|
+
onClose,
|
|
12
|
+
actions
|
|
13
|
+
}) {
|
|
14
|
+
if (!message || !severity) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const themes = {
|
|
18
|
+
[Severity.INFO]: {
|
|
19
|
+
bg: "#f8fafc",
|
|
20
|
+
border: "#e2e8f0",
|
|
21
|
+
text: "#475569",
|
|
22
|
+
accent: "#3b82f6"
|
|
23
|
+
},
|
|
24
|
+
[Severity.WARNING]: {
|
|
25
|
+
bg: "#fffbeb",
|
|
26
|
+
border: "#fbbf24",
|
|
27
|
+
text: "#92400e",
|
|
28
|
+
accent: "#f59e0b"
|
|
29
|
+
},
|
|
30
|
+
[Severity.CRITICAL]: {
|
|
31
|
+
bg: "#fef2f2",
|
|
32
|
+
border: "#fecaca",
|
|
33
|
+
text: "#dc2626",
|
|
34
|
+
accent: "#ef4444"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const theme = themes[severity];
|
|
38
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
40
|
+
@keyframes slideUp {
|
|
41
|
+
from { opacity: 0; transform: translateX(-50%) translateY(8px); }
|
|
42
|
+
to { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.usage-banner {
|
|
46
|
+
position: fixed;
|
|
47
|
+
bottom: 24px;
|
|
48
|
+
left: 50%;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
width: min(600px, calc(100vw - 32px));
|
|
51
|
+
z-index: 10000;
|
|
52
|
+
animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.banner-content {
|
|
56
|
+
background: linear-gradient(135deg, ${theme.bg} 0%, ${theme.bg}f5 100%);
|
|
57
|
+
border: 1px solid ${theme.border};
|
|
58
|
+
border-radius: 12px;
|
|
59
|
+
padding: 18px 20px;
|
|
60
|
+
box-shadow:
|
|
61
|
+
0 4px 24px rgba(0, 0, 0, 0.08),
|
|
62
|
+
0 2px 8px rgba(0, 0, 0, 0.04),
|
|
63
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.7);
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 16px;
|
|
67
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
68
|
+
backdrop-filter: blur(12px);
|
|
69
|
+
position: relative;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.banner-content::before {
|
|
74
|
+
content: '';
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
right: 0;
|
|
79
|
+
height: 1px;
|
|
80
|
+
background: linear-gradient(90deg, transparent, ${theme.accent}40, transparent);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.banner-message {
|
|
84
|
+
color: ${theme.text};
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
line-height: 1.5;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
flex: 1;
|
|
89
|
+
letter-spacing: -0.01em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.close-btn {
|
|
93
|
+
background: rgba(0, 0, 0, 0.05);
|
|
94
|
+
border: none;
|
|
95
|
+
color: ${theme.text};
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
padding: 0;
|
|
98
|
+
border-radius: 6px;
|
|
99
|
+
opacity: 0.6;
|
|
100
|
+
transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
line-height: 1;
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
width: 24px;
|
|
105
|
+
height: 24px;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.close-btn:hover {
|
|
112
|
+
opacity: 1;
|
|
113
|
+
background: rgba(0, 0, 0, 0.08);
|
|
114
|
+
transform: scale(1.05);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.btn-primary {
|
|
118
|
+
background: linear-gradient(135deg, ${theme.accent} 0%, ${theme.accent}e6 100%);
|
|
119
|
+
color: white;
|
|
120
|
+
border: none;
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
padding: 10px 18px;
|
|
123
|
+
font-size: 13px;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
|
|
127
|
+
font-family: inherit;
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
box-shadow:
|
|
130
|
+
0 2px 8px ${theme.accent}30,
|
|
131
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
|
132
|
+
letter-spacing: -0.01em;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.btn-primary:hover {
|
|
136
|
+
transform: translateY(-1px) scale(1.02);
|
|
137
|
+
box-shadow:
|
|
138
|
+
0 4px 12px ${theme.accent}40,
|
|
139
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.25);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.btn-primary:active {
|
|
143
|
+
transform: translateY(0) scale(0.98);
|
|
144
|
+
transition: all 0.08s cubic-bezier(0.16, 1, 0.3, 1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (max-width: 640px) {
|
|
148
|
+
.usage-banner {
|
|
149
|
+
width: calc(100vw - 24px);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.banner-content {
|
|
153
|
+
padding: 16px;
|
|
154
|
+
gap: 12px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.banner-message {
|
|
158
|
+
font-size: 13px;
|
|
159
|
+
line-height: 1.45;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.btn-primary {
|
|
163
|
+
padding: 8px 14px;
|
|
164
|
+
font-size: 12px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.close-btn {
|
|
168
|
+
width: 22px;
|
|
169
|
+
height: 22px;
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
` }),
|
|
174
|
+
/* @__PURE__ */ jsx("div", { className: "usage-banner", children: /* @__PURE__ */ jsxs("div", { className: "banner-content", children: [
|
|
175
|
+
/* @__PURE__ */ jsx("div", { className: "banner-message", children: message }),
|
|
176
|
+
(actions == null ? void 0 : actions.primary) && /* @__PURE__ */ jsx("button", { className: "btn-primary", onClick: actions.primary.onClick, children: actions.primary.label }),
|
|
177
|
+
onClose && /* @__PURE__ */ jsx("button", { className: "close-btn", onClick: onClose, title: "Close", children: "\xD7" })
|
|
178
|
+
] }) })
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
var getErrorActions = (error) => {
|
|
182
|
+
switch (error.code) {
|
|
183
|
+
case CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR:
|
|
184
|
+
return {
|
|
185
|
+
primary: {
|
|
186
|
+
label: "Get Free API Key",
|
|
187
|
+
onClick: () => window.open("https://cloud.copilotkit.ai", "_blank", "noopener,noreferrer")
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
case CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR:
|
|
191
|
+
return {
|
|
192
|
+
primary: {
|
|
193
|
+
label: "Upgrade",
|
|
194
|
+
onClick: () => window.open("https://cloud.copilotkit.ai", "_blank", "noopener,noreferrer")
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
default:
|
|
198
|
+
return void 0;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
function renderCopilotKitUsage(error, onClose) {
|
|
202
|
+
if (error.visibility !== ErrorVisibility.BANNER) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return /* @__PURE__ */ jsx(
|
|
206
|
+
UsageBanner,
|
|
207
|
+
{
|
|
208
|
+
severity: error.severity || Severity.CRITICAL,
|
|
209
|
+
message: error.message,
|
|
210
|
+
onClose,
|
|
211
|
+
actions: getErrorActions(error)
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export {
|
|
217
|
+
UsageBanner,
|
|
218
|
+
getErrorActions,
|
|
219
|
+
renderCopilotKitUsage
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=chunk-AWFAFFO5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/usage-banner.tsx"],"sourcesContent":["import {\n Severity,\n CopilotKitError,\n ErrorVisibility,\n CopilotKitErrorCode,\n} from \"@copilotkit/shared\";\n\ninterface UsageBannerProps {\n severity?: Severity;\n message?: string;\n onClose?: () => void;\n actions?: {\n primary?: {\n label: string;\n onClick: () => void;\n };\n secondary?: {\n label: string;\n onClick: () => void;\n };\n };\n}\n\nexport function UsageBanner({\n severity = Severity.CRITICAL,\n message = \"\",\n onClose,\n actions,\n}: UsageBannerProps) {\n if (!message || !severity) {\n return null;\n }\n\n const themes = {\n [Severity.INFO]: {\n bg: \"#f8fafc\",\n border: \"#e2e8f0\",\n text: \"#475569\",\n accent: \"#3b82f6\",\n },\n [Severity.WARNING]: {\n bg: \"#fffbeb\",\n border: \"#fbbf24\",\n text: \"#92400e\",\n accent: \"#f59e0b\",\n },\n [Severity.CRITICAL]: {\n bg: \"#fef2f2\",\n border: \"#fecaca\",\n text: \"#dc2626\",\n accent: \"#ef4444\",\n },\n };\n\n const theme = themes[severity];\n\n return (\n <>\n <style>\n {`\n @keyframes slideUp {\n from { opacity: 0; transform: translateX(-50%) translateY(8px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n \n .usage-banner {\n position: fixed;\n bottom: 24px;\n left: 50%;\n transform: translateX(-50%);\n width: min(600px, calc(100vw - 32px));\n z-index: 10000;\n animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);\n }\n \n .banner-content {\n background: linear-gradient(135deg, ${theme.bg} 0%, ${theme.bg}f5 100%);\n border: 1px solid ${theme.border};\n border-radius: 12px;\n padding: 18px 20px;\n box-shadow: \n 0 4px 24px rgba(0, 0, 0, 0.08),\n 0 2px 8px rgba(0, 0, 0, 0.04),\n inset 0 1px 0 rgba(255, 255, 255, 0.7);\n display: flex;\n align-items: center;\n gap: 16px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;\n backdrop-filter: blur(12px);\n position: relative;\n overflow: hidden;\n }\n \n .banner-content::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, transparent, ${theme.accent}40, transparent);\n }\n \n .banner-message {\n color: ${theme.text};\n font-size: 14px;\n line-height: 1.5;\n font-weight: 500;\n flex: 1;\n letter-spacing: -0.01em;\n }\n \n .close-btn {\n background: rgba(0, 0, 0, 0.05);\n border: none;\n color: ${theme.text};\n cursor: pointer;\n padding: 0;\n border-radius: 6px;\n opacity: 0.6;\n transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);\n font-size: 14px;\n line-height: 1;\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .close-btn:hover {\n opacity: 1;\n background: rgba(0, 0, 0, 0.08);\n transform: scale(1.05);\n }\n \n .btn-primary {\n background: linear-gradient(135deg, ${theme.accent} 0%, ${theme.accent}e6 100%);\n color: white;\n border: none;\n border-radius: 8px;\n padding: 10px 18px;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);\n font-family: inherit;\n flex-shrink: 0;\n box-shadow: \n 0 2px 8px ${theme.accent}30,\n inset 0 1px 0 rgba(255, 255, 255, 0.2);\n letter-spacing: -0.01em;\n }\n \n .btn-primary:hover {\n transform: translateY(-1px) scale(1.02);\n box-shadow: \n 0 4px 12px ${theme.accent}40,\n inset 0 1px 0 rgba(255, 255, 255, 0.25);\n }\n \n .btn-primary:active {\n transform: translateY(0) scale(0.98);\n transition: all 0.08s cubic-bezier(0.16, 1, 0.3, 1);\n }\n \n @media (max-width: 640px) {\n .usage-banner {\n width: calc(100vw - 24px);\n }\n \n .banner-content {\n padding: 16px;\n gap: 12px;\n }\n \n .banner-message {\n font-size: 13px;\n line-height: 1.45;\n }\n \n .btn-primary {\n padding: 8px 14px;\n font-size: 12px;\n }\n \n .close-btn {\n width: 22px;\n height: 22px;\n font-size: 12px;\n }\n }\n `}\n </style>\n\n <div className=\"usage-banner\">\n <div className=\"banner-content\">\n <div className=\"banner-message\">{message}</div>\n {actions?.primary && (\n <button className=\"btn-primary\" onClick={actions.primary.onClick}>\n {actions.primary.label}\n </button>\n )}\n {onClose && (\n <button className=\"close-btn\" onClick={onClose} title=\"Close\">\n ×\n </button>\n )}\n </div>\n </div>\n </>\n );\n}\n\n// Get action button based on error type\nexport const getErrorActions = (error: CopilotKitError) => {\n switch (error.code) {\n case CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR:\n return {\n primary: {\n label: \"Get Free API Key\",\n onClick: () =>\n window.open(\"https://cloud.copilotkit.ai\", \"_blank\", \"noopener,noreferrer\"),\n },\n };\n case CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR:\n return {\n primary: {\n label: \"Upgrade\",\n onClick: () =>\n window.open(\"https://cloud.copilotkit.ai\", \"_blank\", \"noopener,noreferrer\"),\n },\n };\n default:\n return undefined;\n }\n};\n\nexport function renderCopilotKitUsage(error: CopilotKitError, onClose?: () => void) {\n // Route based on error visibility level\n if (error.visibility !== ErrorVisibility.BANNER) {\n return null;\n }\n\n return (\n <UsageBanner\n severity={error.severity || Severity.CRITICAL}\n message={error.message}\n onClose={onClose}\n actions={getErrorActions(error)}\n />\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TEMLWRRT.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
6
6
|
import { 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-CLMDRYEN.mjs.map
|