@copilotkit/react-core 1.9.2-next.10 → 1.9.2-next.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.
Files changed (168) hide show
  1. package/CHANGELOG.md +0 -64
  2. package/dist/{chunk-3YHYWAHK.mjs → chunk-2FW7HH6W.mjs} +3 -3
  3. package/dist/{chunk-EXU7GWLC.mjs → chunk-4I7PLQF7.mjs} +5 -5
  4. package/dist/{chunk-XFOTNHYA.mjs → chunk-6KGEF242.mjs} +2 -3
  5. package/dist/chunk-6KGEF242.mjs.map +1 -0
  6. package/dist/{chunk-JPMIAGI6.mjs → chunk-C6F6EQNA.mjs} +2 -2
  7. package/dist/{chunk-3OQM3NEK.mjs → chunk-CCESTGAM.mjs} +2 -2
  8. package/dist/{chunk-ADIITPD2.mjs → chunk-CMKIDDQL.mjs} +8 -11
  9. package/dist/{chunk-ADIITPD2.mjs.map → chunk-CMKIDDQL.mjs.map} +1 -1
  10. package/dist/{chunk-FXK6RQIN.mjs → chunk-FRZZPPIV.mjs} +2 -2
  11. package/dist/chunk-HD2GE3DK.mjs +359 -0
  12. package/dist/chunk-HD2GE3DK.mjs.map +1 -0
  13. package/dist/{chunk-WOGURSAL.mjs → chunk-L6QAOAE4.mjs} +12 -15
  14. package/dist/chunk-L6QAOAE4.mjs.map +1 -0
  15. package/dist/{chunk-EF5BNM34.mjs → chunk-LDACFA2B.mjs} +3 -3
  16. package/dist/{chunk-UBNRUXEK.mjs → chunk-LZDDYZEY.mjs} +2 -2
  17. package/dist/{chunk-G7LYGERN.mjs → chunk-MGIXEJWG.mjs} +16 -83
  18. package/dist/chunk-MGIXEJWG.mjs.map +1 -0
  19. package/dist/{chunk-JDEWNLNP.mjs → chunk-NNSXCFQO.mjs} +7 -41
  20. package/dist/chunk-NNSXCFQO.mjs.map +1 -0
  21. package/dist/{chunk-OF4SZTLL.mjs → chunk-OUSWPVDT.mjs} +4 -4
  22. package/dist/{chunk-CMQV4XNY.mjs → chunk-Q5D5XQFA.mjs} +2 -2
  23. package/dist/{chunk-SJJNFYGQ.mjs → chunk-QQZLIEXK.mjs} +3 -3
  24. package/dist/{chunk-55QZ2SVJ.mjs → chunk-RUY6MLHA.mjs} +6 -36
  25. package/dist/chunk-RUY6MLHA.mjs.map +1 -0
  26. package/dist/{chunk-NQVCZQ5T.mjs → chunk-T42PN5VN.mjs} +4 -4
  27. package/dist/{chunk-ERXWDCY6.mjs → chunk-UHQMV2CE.mjs} +2 -2
  28. package/dist/chunk-VRXANACV.mjs +277 -0
  29. package/dist/chunk-VRXANACV.mjs.map +1 -0
  30. package/dist/components/copilot-provider/copilot-messages.js +4 -39
  31. package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
  32. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  33. package/dist/components/copilot-provider/copilotkit-props.d.ts +2 -21
  34. package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
  35. package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
  36. package/dist/components/copilot-provider/copilotkit.js +240 -330
  37. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  38. package/dist/components/copilot-provider/copilotkit.mjs +10 -10
  39. package/dist/components/copilot-provider/index.d.ts +1 -1
  40. package/dist/components/copilot-provider/index.js +240 -330
  41. package/dist/components/copilot-provider/index.js.map +1 -1
  42. package/dist/components/copilot-provider/index.mjs +10 -10
  43. package/dist/components/error-boundary/error-boundary.js +146 -135
  44. package/dist/components/error-boundary/error-boundary.js.map +1 -1
  45. package/dist/components/error-boundary/error-boundary.mjs +4 -4
  46. package/dist/components/error-boundary/error-utils.js.map +1 -1
  47. package/dist/components/error-boundary/error-utils.mjs +2 -2
  48. package/dist/components/index.d.ts +1 -1
  49. package/dist/components/index.js +240 -330
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/index.mjs +10 -10
  52. package/dist/components/toast/toast-provider.js +85 -118
  53. package/dist/components/toast/toast-provider.js.map +1 -1
  54. package/dist/components/toast/toast-provider.mjs +1 -1
  55. package/dist/components/usage-banner.js +146 -135
  56. package/dist/components/usage-banner.js.map +1 -1
  57. package/dist/components/usage-banner.mjs +1 -1
  58. package/dist/context/copilot-context.d.ts +1 -1
  59. package/dist/context/copilot-context.js +1 -2
  60. package/dist/context/copilot-context.js.map +1 -1
  61. package/dist/context/copilot-context.mjs +1 -1
  62. package/dist/context/index.d.ts +1 -1
  63. package/dist/context/index.js +1 -2
  64. package/dist/context/index.js.map +1 -1
  65. package/dist/context/index.mjs +1 -1
  66. package/dist/{copilot-context-3da805ab.d.ts → copilot-context-f9b2b4c3.d.ts} +1 -5
  67. package/dist/hooks/index.d.ts +1 -1
  68. package/dist/hooks/index.js +12 -108
  69. package/dist/hooks/index.js.map +1 -1
  70. package/dist/hooks/index.mjs +32 -32
  71. package/dist/hooks/use-chat.d.ts +1 -1
  72. package/dist/hooks/use-chat.js +12 -105
  73. package/dist/hooks/use-chat.js.map +1 -1
  74. package/dist/hooks/use-chat.mjs +6 -6
  75. package/dist/hooks/use-coagent-state-render.js +1 -2
  76. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  77. package/dist/hooks/use-coagent-state-render.mjs +3 -3
  78. package/dist/hooks/use-coagent.d.ts +1 -1
  79. package/dist/hooks/use-coagent.js +12 -108
  80. package/dist/hooks/use-coagent.js.map +1 -1
  81. package/dist/hooks/use-coagent.mjs +14 -14
  82. package/dist/hooks/use-copilot-action.js +1 -2
  83. package/dist/hooks/use-copilot-action.js.map +1 -1
  84. package/dist/hooks/use-copilot-action.mjs +4 -4
  85. package/dist/hooks/use-copilot-additional-instructions.js +1 -2
  86. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
  87. package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
  88. package/dist/hooks/use-copilot-authenticated-action.js +1 -2
  89. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  90. package/dist/hooks/use-copilot-authenticated-action.mjs +5 -5
  91. package/dist/hooks/use-copilot-chat.d.ts +1 -1
  92. package/dist/hooks/use-copilot-chat.js +12 -105
  93. package/dist/hooks/use-copilot-chat.js.map +1 -1
  94. package/dist/hooks/use-copilot-chat.mjs +13 -13
  95. package/dist/hooks/use-copilot-readable.js +1 -2
  96. package/dist/hooks/use-copilot-readable.js.map +1 -1
  97. package/dist/hooks/use-copilot-readable.mjs +2 -2
  98. package/dist/hooks/use-copilot-runtime-client.d.ts +0 -2
  99. package/dist/hooks/use-copilot-runtime-client.js +2 -52
  100. package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
  101. package/dist/hooks/use-copilot-runtime-client.mjs +2 -2
  102. package/dist/hooks/use-langgraph-interrupt-render.js +1 -2
  103. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  104. package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
  105. package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
  106. package/dist/hooks/use-langgraph-interrupt.js +12 -105
  107. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  108. package/dist/hooks/use-langgraph-interrupt.mjs +14 -14
  109. package/dist/hooks/use-make-copilot-document-readable.js +1 -2
  110. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  111. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  112. package/dist/index.d.ts +1 -1
  113. package/dist/index.js +249 -404
  114. package/dist/index.js.map +1 -1
  115. package/dist/index.mjs +33 -33
  116. package/dist/lib/copilot-task.d.ts +1 -1
  117. package/dist/lib/copilot-task.js.map +1 -1
  118. package/dist/lib/copilot-task.mjs +11 -11
  119. package/dist/lib/index.d.ts +1 -1
  120. package/dist/lib/index.js.map +1 -1
  121. package/dist/lib/index.mjs +11 -11
  122. package/dist/types/interrupt-action.d.ts +1 -1
  123. package/dist/utils/extract.d.ts +1 -1
  124. package/dist/utils/extract.js.map +1 -1
  125. package/dist/utils/extract.mjs +10 -10
  126. package/dist/utils/index.d.ts +1 -1
  127. package/dist/utils/index.js.map +1 -1
  128. package/dist/utils/index.mjs +10 -10
  129. package/dist/utils/utils.test.d.ts +2 -0
  130. package/dist/utils/utils.test.js +9 -0
  131. package/dist/utils/utils.test.js.map +1 -0
  132. package/dist/utils/utils.test.mjs +7 -0
  133. package/dist/utils/utils.test.mjs.map +1 -0
  134. package/jest.config.js +3 -7
  135. package/package.json +3 -4
  136. package/src/components/copilot-provider/copilot-messages.tsx +5 -46
  137. package/src/components/copilot-provider/copilotkit-props.tsx +0 -21
  138. package/src/components/copilot-provider/copilotkit.tsx +1 -5
  139. package/src/components/toast/toast-provider.tsx +24 -49
  140. package/src/components/usage-banner.tsx +147 -144
  141. package/src/context/copilot-context.tsx +1 -7
  142. package/src/hooks/use-chat.ts +6 -106
  143. package/src/hooks/use-coagent.ts +0 -5
  144. package/src/hooks/use-copilot-runtime-client.ts +39 -41
  145. package/tsconfig.json +8 -1
  146. package/tsup.config.ts +6 -6
  147. package/dist/chunk-55QZ2SVJ.mjs.map +0 -1
  148. package/dist/chunk-57K2ZJ5F.mjs +0 -348
  149. package/dist/chunk-57K2ZJ5F.mjs.map +0 -1
  150. package/dist/chunk-G7LYGERN.mjs.map +0 -1
  151. package/dist/chunk-JDEWNLNP.mjs.map +0 -1
  152. package/dist/chunk-WOGURSAL.mjs.map +0 -1
  153. package/dist/chunk-XFOTNHYA.mjs.map +0 -1
  154. package/dist/chunk-YAF2LATQ.mjs +0 -310
  155. package/dist/chunk-YAF2LATQ.mjs.map +0 -1
  156. package/src/components/copilot-provider/__tests__/copilotkit-trace.test.tsx +0 -75
  157. /package/dist/{chunk-3YHYWAHK.mjs.map → chunk-2FW7HH6W.mjs.map} +0 -0
  158. /package/dist/{chunk-EXU7GWLC.mjs.map → chunk-4I7PLQF7.mjs.map} +0 -0
  159. /package/dist/{chunk-JPMIAGI6.mjs.map → chunk-C6F6EQNA.mjs.map} +0 -0
  160. /package/dist/{chunk-3OQM3NEK.mjs.map → chunk-CCESTGAM.mjs.map} +0 -0
  161. /package/dist/{chunk-FXK6RQIN.mjs.map → chunk-FRZZPPIV.mjs.map} +0 -0
  162. /package/dist/{chunk-EF5BNM34.mjs.map → chunk-LDACFA2B.mjs.map} +0 -0
  163. /package/dist/{chunk-UBNRUXEK.mjs.map → chunk-LZDDYZEY.mjs.map} +0 -0
  164. /package/dist/{chunk-OF4SZTLL.mjs.map → chunk-OUSWPVDT.mjs.map} +0 -0
  165. /package/dist/{chunk-CMQV4XNY.mjs.map → chunk-Q5D5XQFA.mjs.map} +0 -0
  166. /package/dist/{chunk-SJJNFYGQ.mjs.map → chunk-QQZLIEXK.mjs.map} +0 -0
  167. /package/dist/{chunk-NQVCZQ5T.mjs.map → chunk-T42PN5VN.mjs.map} +0 -0
  168. /package/dist/{chunk-ERXWDCY6.mjs.map → chunk-UHQMV2CE.mjs.map} +0 -0
@@ -183,14 +183,12 @@ export function ToastProvider({
183
183
  border: `1px solid ${colors.border}`,
184
184
  borderLeft: `4px solid ${colors.border}`,
185
185
  borderRadius: "8px",
186
- padding: "12px 16px",
186
+ padding: "10px 14px",
187
187
  fontSize: "13px",
188
188
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
189
189
  backdropFilter: "blur(8px)",
190
- maxWidth: "min(90vw, 700px)",
191
- width: "100%",
192
- boxSizing: "border-box",
193
- overflow: "hidden",
190
+ maxWidth: "500px",
191
+ minWidth: "350px",
194
192
  }}
195
193
  >
196
194
  <div
@@ -201,15 +199,7 @@ export function ToastProvider({
201
199
  gap: "10px",
202
200
  }}
203
201
  >
204
- <div
205
- style={{
206
- display: "flex",
207
- alignItems: "center",
208
- gap: "8px",
209
- flex: 1,
210
- minWidth: 0,
211
- }}
212
- >
202
+ <div style={{ display: "flex", alignItems: "center", gap: "8px", flex: 1 }}>
213
203
  <div
214
204
  style={{
215
205
  width: "12px",
@@ -219,15 +209,7 @@ export function ToastProvider({
219
209
  flexShrink: 0,
220
210
  }}
221
211
  />
222
- <div
223
- style={{
224
- display: "flex",
225
- alignItems: "center",
226
- gap: "10px",
227
- flex: 1,
228
- minWidth: 0,
229
- }}
230
- >
212
+ <div style={{ display: "flex", alignItems: "center", gap: "10px", flex: 1 }}>
231
213
  <div
232
214
  style={{
233
215
  color: colors.text,
@@ -235,37 +217,30 @@ export function ToastProvider({
235
217
  fontWeight: "400",
236
218
  fontSize: "13px",
237
219
  flex: 1,
238
- wordBreak: "break-all",
220
+ wordWrap: "break-word",
239
221
  overflowWrap: "break-word",
240
- maxWidth: "550px",
241
- overflow: "hidden",
242
- display: "-webkit-box",
243
- WebkitLineClamp: 10,
244
- WebkitBoxOrient: "vertical",
222
+ hyphens: "auto",
245
223
  }}
246
224
  >
247
225
  {(() => {
248
- let message = bannerError.message;
249
-
250
- // Try to extract the useful message from JSON first
251
- const jsonMatch = message.match(/'message':\s*'([^']+)'/);
252
- if (jsonMatch) {
253
- return jsonMatch[1]; // Return the actual error message
226
+ const message = bannerError.message;
227
+ const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
228
+ const plainUrlRegex = /(https?:\/\/[^\s)]+)/g;
229
+
230
+ // Remove URLs and markdown links from the message, keep just the text
231
+ let cleanMessage = message
232
+ .replace(markdownLinkRegex, "") // Remove [text](url)
233
+ .replace(plainUrlRegex, "") // Remove plain URLs
234
+ .replace(/See more:\s*/g, "") // Remove "See more:" text
235
+ .replace(/\s+/g, " ") // Clean up extra spaces
236
+ .trim();
237
+
238
+ // Truncate very long messages for better display
239
+ if (cleanMessage.length > 120) {
240
+ cleanMessage = cleanMessage.substring(0, 117) + "...";
254
241
  }
255
242
 
256
- // Strip technical garbage but keep the meaningful message
257
- message = message.split(" - ")[0]; // Remove everything after " - {"
258
- message = message.split(": Error code")[0]; // Remove ": Error code: 401"
259
- message = message.replace(/:\s*\d{3}$/, ""); // Remove trailing ": 401"
260
- message = message.replace(/See more:.*$/g, ""); // Remove "See more" links
261
- message = message.trim();
262
-
263
- // If it's still garbage (contains { or '), use fallback
264
- // if (message.includes("{") || message.includes("'")) {
265
- // return "Configuration error.... Please check your setup.";
266
- // }
267
-
268
- return message || "Configuration error occurred.";
243
+ return cleanMessage;
269
244
  })()}
270
245
  </div>
271
246
 
@@ -287,7 +262,7 @@ export function ToastProvider({
287
262
  // Check for plain URLs
288
263
  const urlMatch = plainUrlRegex.exec(message);
289
264
  if (urlMatch) {
290
- url = urlMatch[0].replace(/[.,;:'"]*$/, ""); // Remove trailing punctuation
265
+ url = urlMatch[0];
291
266
  buttonText = "See More";
292
267
  }
293
268
  }
@@ -21,8 +21,8 @@ const defaultIcons: Record<Severity, JSX.Element> = {
21
21
  [Severity.CRITICAL]: (
22
22
  <svg
23
23
  viewBox="0 0 24 24"
24
- width="16"
25
- height="16"
24
+ width="18"
25
+ height="18"
26
26
  stroke="currentColor"
27
27
  strokeWidth="2.5"
28
28
  fill="none"
@@ -37,8 +37,8 @@ const defaultIcons: Record<Severity, JSX.Element> = {
37
37
  [Severity.WARNING]: (
38
38
  <svg
39
39
  viewBox="0 0 24 24"
40
- width="16"
41
- height="16"
40
+ width="18"
41
+ height="18"
42
42
  stroke="currentColor"
43
43
  strokeWidth="2.5"
44
44
  fill="none"
@@ -53,8 +53,8 @@ const defaultIcons: Record<Severity, JSX.Element> = {
53
53
  [Severity.INFO]: (
54
54
  <svg
55
55
  viewBox="0 0 24 24"
56
- width="16"
57
- height="16"
56
+ width="18"
57
+ height="18"
58
58
  stroke="currentColor"
59
59
  strokeWidth="2.5"
60
60
  fill="none"
@@ -79,46 +79,23 @@ export function UsageBanner({
79
79
  return null;
80
80
  }
81
81
 
82
- // Enhanced message parsing to clean up technical details
82
+ // Parse markdown links from message and clean it up
83
83
  const parseMessage = (rawMessage: string) => {
84
- // console.log("Raw message:", rawMessage); // Debug
85
-
86
- // Super aggressive cleaning - handle common error patterns first
87
- if (
88
- rawMessage.toLowerCase().includes("authentication") ||
89
- rawMessage.toLowerCase().includes("api key")
90
- ) {
91
- return "Authentication failed. Please check your API key.";
92
- }
93
-
94
- if (rawMessage.toLowerCase().includes("rate limit")) {
95
- return "Rate limit exceeded. Please try again later.";
96
- }
97
-
98
- if (rawMessage.toLowerCase().includes("checkpointer")) {
99
- return "Agent configuration error. Please check your setup.";
100
- }
101
-
102
- // For any other error, extract just the main error type
103
- let cleanMessage = rawMessage;
104
-
105
- // Remove everything after the first " - " or ":" followed by technical details
106
- cleanMessage = cleanMessage.split(" - ")[0];
107
- cleanMessage = cleanMessage.split(": Error code")[0];
108
- cleanMessage = cleanMessage.split(": 401")[0];
109
- cleanMessage = cleanMessage.split(": 403")[0];
110
- cleanMessage = cleanMessage.split(": 404")[0];
111
- cleanMessage = cleanMessage.split(": 500")[0];
84
+ // Extract markdown links: [text](url)
85
+ const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
86
+ const matches = Array.from(rawMessage.matchAll(linkRegex));
112
87
 
113
- // Remove "See more" links
114
- cleanMessage = cleanMessage.replace(/See more:.*$/g, "").trim();
88
+ if (matches.length > 0) {
89
+ // Remove "See more:" and markdown links from the main message
90
+ let cleanMessage = rawMessage
91
+ .replace(/\.\s*See more:\s*\[([^\]]+)\]\(([^)]+)\)/g, ".")
92
+ .replace(/See more:\s*\[([^\]]+)\]\(([^)]+)\)/g, "")
93
+ .trim();
115
94
 
116
- // If still too technical, just show a generic message
117
- if (cleanMessage.includes("{") || cleanMessage.includes("'") || cleanMessage.length > 60) {
118
- return "Configuration error. Please check your setup.";
95
+ return cleanMessage;
119
96
  }
120
97
 
121
- return cleanMessage || "An error occurred. Please check your configuration.";
98
+ return rawMessage;
122
99
  };
123
100
 
124
101
  const cleanMessage = parseMessage(message);
@@ -126,7 +103,7 @@ export function UsageBanner({
126
103
 
127
104
  const themeConfigs = {
128
105
  [Severity.INFO]: {
129
- bg: "rgba(239, 246, 255, 0.95)",
106
+ bg: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
130
107
  border: "#93c5fd",
131
108
  text: "#1e40af",
132
109
  icon: "#3b82f6",
@@ -134,7 +111,7 @@ export function UsageBanner({
134
111
  primaryBtnHover: "#2563eb",
135
112
  },
136
113
  [Severity.WARNING]: {
137
- bg: "rgba(255, 251, 235, 0.95)",
114
+ bg: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
138
115
  border: "#fbbf24",
139
116
  text: "#92400e",
140
117
  icon: "#f59e0b",
@@ -142,7 +119,7 @@ export function UsageBanner({
142
119
  primaryBtnHover: "#d97706",
143
120
  },
144
121
  [Severity.CRITICAL]: {
145
- bg: "rgba(254, 242, 242, 0.95)",
122
+ bg: "linear-gradient(135deg, #fef2f2 0%, #fecaca 100%)",
146
123
  border: "#f87171",
147
124
  text: "#991b1b",
148
125
  icon: "#ef4444",
@@ -157,13 +134,13 @@ export function UsageBanner({
157
134
  <div
158
135
  style={{
159
136
  position: "fixed",
160
- bottom: "24px",
137
+ bottom: "20px",
161
138
  left: "50%",
162
139
  transform: "translateX(-50%)",
163
- width: "400px",
164
- maxWidth: "90vw",
140
+ maxWidth: "min(95vw, 680px)",
141
+ width: "100%",
165
142
  zIndex: 10000,
166
- animation: "bannerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1)",
143
+ animation: "bannerSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
167
144
  }}
168
145
  >
169
146
  <style>
@@ -171,29 +148,28 @@ export function UsageBanner({
171
148
  @keyframes bannerSlideIn {
172
149
  from {
173
150
  opacity: 0;
174
- transform: translateX(-50%) translateY(20px);
175
- scale: 0.95;
151
+ transform: translateX(-50%) translateY(10px);
176
152
  }
177
153
  to {
178
154
  opacity: 1;
179
155
  transform: translateX(-50%) translateY(0);
180
- scale: 1;
181
156
  }
182
157
  }
183
158
  `}
184
159
  </style>
185
160
  <div
186
161
  style={{
187
- borderRadius: "12px",
162
+ display: "flex",
163
+ alignItems: "flex-start",
164
+ gap: "14px",
165
+ borderRadius: "16px",
188
166
  border: `1px solid ${themeConfig.border}`,
189
167
  background: themeConfig.bg,
190
- padding: "14px",
191
- boxShadow: "0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08)",
168
+ padding: "18px 20px",
169
+ boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
192
170
  position: "relative",
193
- backdropFilter: "blur(12px)",
194
- WebkitBackdropFilter: "blur(12px)",
195
- boxSizing: "border-box",
196
- overflow: "hidden",
171
+ backdropFilter: "blur(10px)",
172
+ WebkitBackdropFilter: "blur(10px)",
197
173
  }}
198
174
  >
199
175
  {/* Close button */}
@@ -202,117 +178,144 @@ export function UsageBanner({
202
178
  onClick={onClose}
203
179
  style={{
204
180
  position: "absolute",
205
- top: "8px",
206
- right: "8px",
207
- background: "rgba(255, 255, 255, 0.9)",
181
+ top: "12px",
182
+ right: "12px",
183
+ background: "rgba(255, 255, 255, 0.8)",
208
184
  border: "none",
209
185
  color: themeConfig.text,
210
186
  cursor: "pointer",
211
- fontSize: "16px",
187
+ fontSize: "18px",
212
188
  lineHeight: "1",
213
- padding: "4px",
214
- borderRadius: "4px",
215
- width: "20px",
216
- height: "20px",
189
+ padding: "6px",
190
+ borderRadius: "8px",
191
+ opacity: 0.7,
192
+ transition: "all 0.2s ease",
217
193
  display: "flex",
218
194
  alignItems: "center",
219
195
  justifyContent: "center",
196
+ width: "28px",
197
+ height: "28px",
220
198
  }}
221
199
  title="Close"
200
+ onMouseOver={(e) => {
201
+ e.currentTarget.style.opacity = "1";
202
+ e.currentTarget.style.background = "rgba(255, 255, 255, 1)";
203
+ e.currentTarget.style.transform = "scale(1.05)";
204
+ }}
205
+ onMouseOut={(e) => {
206
+ e.currentTarget.style.opacity = "0.7";
207
+ e.currentTarget.style.background = "rgba(255, 255, 255, 0.8)";
208
+ e.currentTarget.style.transform = "scale(1)";
209
+ }}
222
210
  >
223
211
  ×
224
212
  </button>
225
213
  )}
226
214
 
227
- {/* Message */}
215
+ {/* Icon */}
228
216
  <div
229
217
  style={{
230
- fontSize: "14px",
231
- fontWeight: 500,
232
- color: themeConfig.text,
233
- lineHeight: "1.4",
234
- fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
235
- paddingRight: onClose ? "30px" : "0",
236
- marginBottom: actions ? "12px" : "0",
237
- wordBreak: "break-word",
238
- overflow: "hidden",
239
- textOverflow: "ellipsis",
240
- display: "-webkit-box",
241
- WebkitLineClamp: 2,
242
- WebkitBoxOrient: "vertical",
218
+ color: themeConfig.icon,
219
+ flexShrink: 0,
220
+ marginTop: "1px",
221
+ padding: "6px",
222
+ borderRadius: "10px",
223
+ background: "rgba(255, 255, 255, 0.7)",
224
+ display: "flex",
225
+ alignItems: "center",
226
+ justifyContent: "center",
243
227
  }}
244
228
  >
245
- {cleanMessage}
229
+ {Icon}
246
230
  </div>
247
231
 
248
- {/* Actions */}
249
- {actions && (
232
+ {/* Content */}
233
+ <div style={{ flex: 1, paddingRight: onClose ? "40px" : "0" }}>
234
+ {/* Message */}
250
235
  <div
251
236
  style={{
252
- display: "flex",
253
- gap: "8px",
254
- flexWrap: "wrap",
237
+ fontSize: "15px",
238
+ fontWeight: 600,
239
+ color: themeConfig.text,
240
+ lineHeight: "1.5",
241
+ marginBottom: actions ? "12px" : "0",
242
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
255
243
  }}
256
244
  >
257
- {actions.secondary && (
258
- <button
259
- onClick={actions.secondary.onClick}
260
- style={{
261
- borderRadius: "8px",
262
- padding: "6px 12px",
263
- fontSize: "13px",
264
- fontWeight: 500,
265
- color: themeConfig.text,
266
- backgroundColor: "rgba(255, 255, 255, 0.9)",
267
- border: `1px solid ${themeConfig.border}`,
268
- cursor: "pointer",
269
- transition: "all 0.2s ease",
270
- fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
271
- }}
272
- onMouseOver={(e) => {
273
- e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 1)";
274
- e.currentTarget.style.transform = "translateY(-1px)";
275
- }}
276
- onMouseOut={(e) => {
277
- e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 0.9)";
278
- e.currentTarget.style.transform = "translateY(0)";
279
- }}
280
- >
281
- {actions.secondary.label}
282
- </button>
283
- )}
284
- {actions.primary && (
285
- <button
286
- onClick={actions.primary.onClick}
287
- style={{
288
- borderRadius: "8px",
289
- padding: "6px 12px",
290
- fontSize: "13px",
291
- fontWeight: 600,
292
- color: "#fff",
293
- backgroundColor: themeConfig.primaryBtn,
294
- border: "none",
295
- cursor: "pointer",
296
- transition: "all 0.2s ease",
297
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
298
- fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
299
- }}
300
- onMouseOver={(e) => {
301
- e.currentTarget.style.backgroundColor = themeConfig.primaryBtnHover;
302
- e.currentTarget.style.transform = "translateY(-1px)";
303
- e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.2)";
304
- }}
305
- onMouseOut={(e) => {
306
- e.currentTarget.style.backgroundColor = themeConfig.primaryBtn;
307
- e.currentTarget.style.transform = "translateY(0)";
308
- e.currentTarget.style.boxShadow = "0 2px 8px rgba(0, 0, 0, 0.15)";
309
- }}
310
- >
311
- {actions.primary.label}
312
- </button>
313
- )}
245
+ {cleanMessage}
314
246
  </div>
315
- )}
247
+
248
+ {/* Actions */}
249
+ {actions && (
250
+ <div
251
+ style={{
252
+ display: "flex",
253
+ gap: "10px",
254
+ flexWrap: "wrap",
255
+ }}
256
+ >
257
+ {actions.secondary && (
258
+ <button
259
+ onClick={actions.secondary.onClick}
260
+ style={{
261
+ borderRadius: "10px",
262
+ padding: "8px 16px",
263
+ fontSize: "14px",
264
+ fontWeight: 500,
265
+ color: themeConfig.text,
266
+ backgroundColor: "rgba(255, 255, 255, 0.8)",
267
+ border: `1.5px solid ${themeConfig.border}`,
268
+ cursor: "pointer",
269
+ transition: "all 0.2s ease",
270
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
271
+ }}
272
+ onMouseOver={(e) => {
273
+ e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 1)";
274
+ e.currentTarget.style.transform = "translateY(-1px)";
275
+ e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)";
276
+ }}
277
+ onMouseOut={(e) => {
278
+ e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
279
+ e.currentTarget.style.transform = "translateY(0)";
280
+ e.currentTarget.style.boxShadow = "none";
281
+ }}
282
+ >
283
+ {actions.secondary.label}
284
+ </button>
285
+ )}
286
+ {actions.primary && (
287
+ <button
288
+ onClick={actions.primary.onClick}
289
+ style={{
290
+ borderRadius: "10px",
291
+ padding: "8px 16px",
292
+ fontSize: "14px",
293
+ fontWeight: 600,
294
+ color: "#fff",
295
+ backgroundColor: themeConfig.primaryBtn,
296
+ border: "none",
297
+ cursor: "pointer",
298
+ transition: "all 0.2s ease",
299
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
300
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
301
+ }}
302
+ onMouseOver={(e) => {
303
+ e.currentTarget.style.backgroundColor = themeConfig.primaryBtnHover;
304
+ e.currentTarget.style.transform = "translateY(-1px)";
305
+ e.currentTarget.style.boxShadow = "0 6px 16px rgba(0, 0, 0, 0.2)";
306
+ }}
307
+ onMouseOut={(e) => {
308
+ e.currentTarget.style.backgroundColor = themeConfig.primaryBtn;
309
+ e.currentTarget.style.transform = "translateY(0)";
310
+ e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)";
311
+ }}
312
+ >
313
+ {actions.primary.label}
314
+ </button>
315
+ )}
316
+ </div>
317
+ )}
318
+ </div>
316
319
  </div>
317
320
  </div>
318
321
  );
@@ -1,4 +1,4 @@
1
- import { CopilotCloudConfig, FunctionCallHandler, CopilotTraceHandler } from "@copilotkit/shared";
1
+ import { CopilotCloudConfig, FunctionCallHandler } from "@copilotkit/shared";
2
2
  import {
3
3
  ActionRenderProps,
4
4
  CatchAllActionRenderProps,
@@ -218,11 +218,6 @@ export interface CopilotContextParams {
218
218
  langGraphInterruptAction: LangGraphInterruptAction | null;
219
219
  setLangGraphInterruptAction: LangGraphInterruptActionSetter;
220
220
  removeLangGraphInterruptAction: () => void;
221
-
222
- /**
223
- * Optional trace handler for comprehensive debugging and observability.
224
- */
225
- onTrace?: CopilotTraceHandler;
226
221
  }
227
222
 
228
223
  const emptyCopilotContext: CopilotContextParams = {
@@ -293,7 +288,6 @@ const emptyCopilotContext: CopilotContextParams = {
293
288
  langGraphInterruptAction: null,
294
289
  setLangGraphInterruptAction: () => null,
295
290
  removeLangGraphInterruptAction: () => null,
296
- onTrace: undefined,
297
291
  };
298
292
 
299
293
  export const CopilotContext = React.createContext<CopilotContextParams>(emptyCopilotContext);