@copilotkit/react-core 1.10.0-next.9 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/dist/{chunk-VH45SC6Z.mjs → chunk-2GRWTU7W.mjs} +2 -2
  3. package/dist/chunk-3BASANUO.mjs +170 -0
  4. package/dist/chunk-3BASANUO.mjs.map +1 -0
  5. package/dist/{chunk-PHIMGB3K.mjs → chunk-5P46WS5M.mjs} +25 -19
  6. package/dist/chunk-5P46WS5M.mjs.map +1 -0
  7. package/dist/{chunk-AWFAFFO5.mjs → chunk-6ZLPNY7X.mjs} +7 -3
  8. package/dist/chunk-6ZLPNY7X.mjs.map +1 -0
  9. package/dist/{chunk-TTI4Z6GK.mjs → chunk-BEFEBKKI.mjs} +7 -7
  10. package/dist/chunk-BEFEBKKI.mjs.map +1 -0
  11. package/dist/{chunk-VSH4JSN3.mjs → chunk-F26O2HTO.mjs} +13 -7
  12. package/dist/chunk-F26O2HTO.mjs.map +1 -0
  13. package/dist/{chunk-GRCHDHC4.mjs → chunk-JY3STRON.mjs} +22 -4
  14. package/dist/chunk-JY3STRON.mjs.map +1 -0
  15. package/dist/{chunk-ZTZJIDRJ.mjs → chunk-N4VN2B5S.mjs} +2 -2
  16. package/dist/{chunk-FTP6FDYS.mjs → chunk-NTH42BY5.mjs} +2 -2
  17. package/dist/chunk-PIF5KJYI.mjs +103 -0
  18. package/dist/chunk-PIF5KJYI.mjs.map +1 -0
  19. package/dist/chunk-WSXTUD36.mjs +759 -0
  20. package/dist/chunk-WSXTUD36.mjs.map +1 -0
  21. package/dist/chunk-YIBUNEBN.mjs +34 -0
  22. package/dist/chunk-YIBUNEBN.mjs.map +1 -0
  23. package/dist/components/copilot-provider/copilotkit-props.d.ts +9 -1
  24. package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
  25. package/dist/components/copilot-provider/copilotkit.js +1052 -72
  26. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  27. package/dist/components/copilot-provider/copilotkit.mjs +6 -3
  28. package/dist/components/copilot-provider/index.js +1052 -72
  29. package/dist/components/copilot-provider/index.js.map +1 -1
  30. package/dist/components/copilot-provider/index.mjs +6 -3
  31. package/dist/components/dev-console/console-trigger.d.ts +8 -0
  32. package/dist/components/dev-console/console-trigger.js +1131 -0
  33. package/dist/components/dev-console/console-trigger.js.map +1 -0
  34. package/dist/components/dev-console/console-trigger.mjs +13 -0
  35. package/dist/components/dev-console/developer-console-modal.d.ts +10 -0
  36. package/dist/components/dev-console/developer-console-modal.js +977 -0
  37. package/dist/components/dev-console/developer-console-modal.js.map +1 -0
  38. package/dist/components/dev-console/developer-console-modal.mjs +12 -0
  39. package/dist/components/dev-console/developer-console-modal.mjs.map +1 -0
  40. package/dist/components/dev-console/icons.d.ts +9 -0
  41. package/dist/components/dev-console/icons.js +131 -0
  42. package/dist/components/dev-console/icons.js.map +1 -0
  43. package/dist/components/dev-console/icons.mjs +16 -0
  44. package/dist/components/dev-console/icons.mjs.map +1 -0
  45. package/dist/components/error-boundary/error-boundary.js +6 -2
  46. package/dist/components/error-boundary/error-boundary.js.map +1 -1
  47. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  48. package/dist/components/index.js +1052 -72
  49. package/dist/components/index.js.map +1 -1
  50. package/dist/components/index.mjs +6 -3
  51. package/dist/components/usage-banner.d.ts +2 -1
  52. package/dist/components/usage-banner.js +6 -2
  53. package/dist/components/usage-banner.js.map +1 -1
  54. package/dist/components/usage-banner.mjs +1 -1
  55. package/dist/hooks/index.d.ts +5 -5
  56. package/dist/hooks/index.js +58 -26
  57. package/dist/hooks/index.js.map +1 -1
  58. package/dist/hooks/index.mjs +13 -10
  59. package/dist/hooks/use-coagent.d.ts +1 -1
  60. package/dist/hooks/use-coagent.js +18 -6
  61. package/dist/hooks/use-coagent.js.map +1 -1
  62. package/dist/hooks/use-coagent.mjs +8 -5
  63. package/dist/hooks/use-copilot-chat-headless_c.d.ts +33 -0
  64. package/dist/hooks/{use-copilot-chat-light.js → use-copilot-chat-headless_c.js} +88 -19
  65. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -0
  66. package/dist/hooks/{use-copilot-chat-light.mjs → use-copilot-chat-headless_c.mjs} +14 -8
  67. package/dist/hooks/use-copilot-chat-headless_c.mjs.map +1 -0
  68. package/dist/hooks/use-copilot-chat.d.ts +85 -4
  69. package/dist/hooks/use-copilot-chat.js +38 -61
  70. package/dist/hooks/use-copilot-chat.js.map +1 -1
  71. package/dist/hooks/use-copilot-chat.mjs +8 -8
  72. package/dist/hooks/use-copilot-chat_internal.d.ts +98 -12
  73. package/dist/hooks/use-copilot-chat_internal.js +13 -1
  74. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  75. package/dist/hooks/use-copilot-chat_internal.mjs +7 -4
  76. package/dist/hooks/use-langgraph-interrupt.js +13 -1
  77. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  78. package/dist/hooks/use-langgraph-interrupt.mjs +8 -5
  79. package/dist/index.d.ts +3 -3
  80. package/dist/index.js +1203 -200
  81. package/dist/index.js.map +1 -1
  82. package/dist/index.mjs +14 -11
  83. package/dist/lib/copilot-task.js.map +1 -1
  84. package/dist/lib/copilot-task.mjs +7 -4
  85. package/dist/lib/index.js.map +1 -1
  86. package/dist/lib/index.mjs +7 -4
  87. package/dist/utils/extract.js.map +1 -1
  88. package/dist/utils/extract.mjs +6 -3
  89. package/dist/utils/index.js.map +1 -1
  90. package/dist/utils/index.mjs +6 -3
  91. package/dist/utils/suggestions.js.map +1 -1
  92. package/dist/utils/suggestions.mjs +6 -3
  93. package/package.json +3 -3
  94. package/src/components/copilot-provider/copilotkit-props.tsx +10 -1
  95. package/src/components/copilot-provider/copilotkit.tsx +25 -16
  96. package/src/components/dev-console/console-trigger.tsx +190 -0
  97. package/src/components/dev-console/developer-console-modal.tsx +866 -0
  98. package/src/components/dev-console/icons.tsx +101 -0
  99. package/src/components/usage-banner.tsx +8 -3
  100. package/src/hooks/index.ts +6 -7
  101. package/src/hooks/use-coagent.ts +6 -11
  102. package/src/hooks/use-copilot-chat-headless_c.ts +257 -0
  103. package/src/hooks/use-copilot-chat.ts +103 -154
  104. package/src/hooks/use-copilot-chat_internal.ts +122 -15
  105. package/dist/chunk-AWFAFFO5.mjs.map +0 -1
  106. package/dist/chunk-GRCHDHC4.mjs.map +0 -1
  107. package/dist/chunk-MWHILKQH.mjs +0 -18
  108. package/dist/chunk-MWHILKQH.mjs.map +0 -1
  109. package/dist/chunk-PHIMGB3K.mjs.map +0 -1
  110. package/dist/chunk-TTI4Z6GK.mjs.map +0 -1
  111. package/dist/chunk-VSH4JSN3.mjs.map +0 -1
  112. package/dist/hooks/use-copilot-chat-light.d.ts +0 -211
  113. package/dist/hooks/use-copilot-chat-light.js.map +0 -1
  114. package/src/hooks/use-copilot-chat-light.ts +0 -219
  115. /package/dist/{chunk-VH45SC6Z.mjs.map → chunk-2GRWTU7W.mjs.map} +0 -0
  116. /package/dist/{chunk-ZTZJIDRJ.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
  117. /package/dist/{chunk-FTP6FDYS.mjs.map → chunk-NTH42BY5.mjs.map} +0 -0
  118. /package/dist/{hooks/use-copilot-chat-light.mjs.map → components/dev-console/console-trigger.mjs.map} +0 -0
@@ -0,0 +1,759 @@
1
+ import {
2
+ CheckIcon,
3
+ CopilotKitIcon,
4
+ ExclamationMarkTriangleIcon
5
+ } from "./chunk-PIF5KJYI.mjs";
6
+ import {
7
+ useCopilotContext
8
+ } from "./chunk-TEMLWRRT.mjs";
9
+ import {
10
+ useCopilotMessagesContext
11
+ } from "./chunk-ZLQVRPDS.mjs";
12
+
13
+ // src/components/dev-console/developer-console-modal.tsx
14
+ import { COPILOTKIT_VERSION } from "@copilotkit/shared";
15
+ import { useEffect, useState } from "react";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ function DeveloperConsoleModal({ isOpen, onClose, hasApiKey }) {
18
+ const context = useCopilotContext();
19
+ const messagesContext = useCopilotMessagesContext();
20
+ const [activeTab, setActiveTab] = useState("actions");
21
+ useEffect(() => {
22
+ const handleEscape = (e) => {
23
+ if (e.key === "Escape") {
24
+ onClose();
25
+ }
26
+ };
27
+ if (isOpen) {
28
+ document.addEventListener("keydown", handleEscape);
29
+ document.body.style.overflow = "hidden";
30
+ }
31
+ return () => {
32
+ document.removeEventListener("keydown", handleEscape);
33
+ document.body.style.overflow = "unset";
34
+ };
35
+ }, [isOpen, onClose]);
36
+ if (!isOpen)
37
+ return null;
38
+ const displayContext = hasApiKey ? context : {
39
+ actions: {
40
+ search_web: { name: "search_web", description: "Search the web for information" },
41
+ send_email: { name: "send_email", description: "Send an email to a contact" },
42
+ create_document: { name: "create_document", description: "Create a new document" },
43
+ analyze_code: {
44
+ name: "analyze_code",
45
+ description: "Analyze code for issues and improvements"
46
+ },
47
+ generate_tests: {
48
+ name: "generate_tests",
49
+ description: "Generate unit tests for functions"
50
+ }
51
+ },
52
+ getAllContext: () => [
53
+ {
54
+ content: "User preferences: dark mode enabled, TypeScript preferred",
55
+ metadata: { source: "settings" }
56
+ },
57
+ {
58
+ content: "Current project: Building a React application with CopilotKit",
59
+ metadata: { source: "project" }
60
+ },
61
+ {
62
+ content: "Recent activity: Implemented authentication system",
63
+ metadata: { source: "activity" }
64
+ },
65
+ {
66
+ content: "Development environment: VS Code, Node.js 18, React 18",
67
+ metadata: { source: "environment" }
68
+ }
69
+ ],
70
+ coagentStates: {
71
+ "main-agent": { status: "active", lastUpdate: Date.now() },
72
+ "code-assistant": { status: "active", lastUpdate: Date.now() - 15e3 },
73
+ "search-agent": { status: "idle", lastUpdate: Date.now() - 6e4 }
74
+ },
75
+ getDocumentsContext: () => [
76
+ {
77
+ content: "README.md: Project setup and installation instructions",
78
+ metadata: { type: "documentation" }
79
+ },
80
+ {
81
+ content: "API Documentation: CopilotKit integration guide",
82
+ metadata: { type: "documentation" }
83
+ },
84
+ {
85
+ content: "package.json: Project dependencies and scripts",
86
+ metadata: { type: "configuration" }
87
+ }
88
+ ]
89
+ };
90
+ const displayMessagesContext = hasApiKey ? messagesContext : {
91
+ messages: [
92
+ {
93
+ id: "1",
94
+ role: "user",
95
+ content: "Help me implement a todo list with drag and drop functionality"
96
+ },
97
+ {
98
+ id: "2",
99
+ role: "assistant",
100
+ content: "I'll help you create a todo list with drag and drop. Let me start by setting up the basic components and then add the drag and drop functionality using React DnD."
101
+ },
102
+ { id: "3", role: "user", content: "Can you also add priority levels and due dates?" },
103
+ {
104
+ id: "4",
105
+ role: "assistant",
106
+ content: "Absolutely! I'll enhance the todo items with priority levels (high, medium, low) and due date functionality. This will make your todo list much more powerful for task management."
107
+ },
108
+ { id: "5", role: "user", content: "Perfect! How about adding categories or tags?" }
109
+ ]
110
+ };
111
+ return /* @__PURE__ */ jsx(
112
+ "div",
113
+ {
114
+ style: {
115
+ position: "fixed",
116
+ top: 0,
117
+ left: 0,
118
+ right: 0,
119
+ bottom: 0,
120
+ zIndex: 9999,
121
+ backgroundColor: "rgba(0, 0, 0, 0.3)",
122
+ display: "flex",
123
+ alignItems: "center",
124
+ justifyContent: "center",
125
+ padding: "16px"
126
+ },
127
+ onClick: onClose,
128
+ children: /* @__PURE__ */ jsxs(
129
+ "div",
130
+ {
131
+ style: {
132
+ width: "1152px",
133
+ maxWidth: "95vw",
134
+ height: "80vh",
135
+ backgroundColor: "white",
136
+ borderRadius: "12px",
137
+ boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
138
+ display: "flex",
139
+ flexDirection: "column",
140
+ overflow: "hidden",
141
+ position: "relative"
142
+ },
143
+ onClick: (e) => e.stopPropagation(),
144
+ children: [
145
+ /* @__PURE__ */ jsxs(
146
+ "div",
147
+ {
148
+ style: {
149
+ display: "flex",
150
+ alignItems: "center",
151
+ justifyContent: "space-between",
152
+ padding: "24px",
153
+ borderBottom: "1px solid #e5e7eb",
154
+ minHeight: "73px",
155
+ flexShrink: 0,
156
+ filter: !hasApiKey ? "blur(0.3px)" : "none",
157
+ opacity: !hasApiKey ? 0.95 : 1
158
+ },
159
+ children: [
160
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
161
+ /* @__PURE__ */ jsx(CopilotKitIcon, {}),
162
+ /* @__PURE__ */ jsx(
163
+ "h1",
164
+ {
165
+ style: {
166
+ fontWeight: "bold",
167
+ fontSize: "20px",
168
+ color: "#1f2937",
169
+ margin: 0
170
+ },
171
+ children: "Developer Console"
172
+ }
173
+ ),
174
+ /* @__PURE__ */ jsxs(
175
+ "span",
176
+ {
177
+ style: {
178
+ fontSize: "14px",
179
+ color: "#6b7280",
180
+ backgroundColor: "#f3f4f6",
181
+ padding: "4px 8px",
182
+ borderRadius: "4px"
183
+ },
184
+ children: [
185
+ "v",
186
+ COPILOTKIT_VERSION
187
+ ]
188
+ }
189
+ )
190
+ ] }),
191
+ /* @__PURE__ */ jsx(
192
+ "button",
193
+ {
194
+ onClick: onClose,
195
+ style: {
196
+ color: "#9ca3af",
197
+ fontSize: "24px",
198
+ fontWeight: "300",
199
+ border: "none",
200
+ background: "none",
201
+ cursor: "pointer",
202
+ padding: "4px"
203
+ },
204
+ onMouseEnter: (e) => e.currentTarget.style.color = "#4b5563",
205
+ onMouseLeave: (e) => e.currentTarget.style.color = "#9ca3af",
206
+ children: "\xD7"
207
+ }
208
+ )
209
+ ]
210
+ }
211
+ ),
212
+ /* @__PURE__ */ jsx(
213
+ "div",
214
+ {
215
+ style: {
216
+ display: "flex",
217
+ borderBottom: "1px solid #e5e7eb",
218
+ backgroundColor: "#f9fafb",
219
+ minHeight: "50px",
220
+ flexShrink: 0,
221
+ filter: !hasApiKey ? "blur(0.3px)" : "none",
222
+ opacity: !hasApiKey ? 0.9 : 1
223
+ },
224
+ children: [
225
+ { id: "actions", label: "Actions", count: Object.keys(displayContext.actions).length },
226
+ { id: "readables", label: "Readables", count: displayContext.getAllContext().length },
227
+ {
228
+ id: "agent",
229
+ label: "Agent Status",
230
+ count: Object.keys(displayContext.coagentStates).length
231
+ },
232
+ { id: "messages", label: "Messages", count: displayMessagesContext.messages.length },
233
+ {
234
+ id: "context",
235
+ label: "Context",
236
+ count: displayContext.getDocumentsContext([]).length
237
+ }
238
+ ].map((tab) => /* @__PURE__ */ jsxs(
239
+ "button",
240
+ {
241
+ onClick: () => setActiveTab(tab.id),
242
+ style: {
243
+ padding: "12px 24px",
244
+ fontSize: "14px",
245
+ fontWeight: "500",
246
+ border: "none",
247
+ cursor: "pointer",
248
+ backgroundColor: activeTab === tab.id ? "white" : "transparent",
249
+ color: activeTab === tab.id ? "#2563eb" : "#6b7280",
250
+ borderBottom: activeTab === tab.id ? "2px solid #2563eb" : "none",
251
+ transition: "all 0.2s"
252
+ },
253
+ onMouseEnter: (e) => {
254
+ if (activeTab !== tab.id) {
255
+ e.currentTarget.style.color = "#1f2937";
256
+ e.currentTarget.style.backgroundColor = "#f3f4f6";
257
+ }
258
+ },
259
+ onMouseLeave: (e) => {
260
+ if (activeTab !== tab.id) {
261
+ e.currentTarget.style.color = "#6b7280";
262
+ e.currentTarget.style.backgroundColor = "transparent";
263
+ }
264
+ },
265
+ children: [
266
+ tab.label,
267
+ tab.count > 0 && /* @__PURE__ */ jsx(
268
+ "span",
269
+ {
270
+ style: {
271
+ marginLeft: "8px",
272
+ backgroundColor: "#e5e7eb",
273
+ color: "#374151",
274
+ padding: "2px 8px",
275
+ borderRadius: "9999px",
276
+ fontSize: "12px"
277
+ },
278
+ children: tab.count
279
+ }
280
+ )
281
+ ]
282
+ },
283
+ tab.id
284
+ ))
285
+ }
286
+ ),
287
+ /* @__PURE__ */ jsxs(
288
+ "div",
289
+ {
290
+ style: {
291
+ height: "calc(100% - 142px)",
292
+ overflow: "auto",
293
+ padding: "24px",
294
+ backgroundColor: "#f9fafb",
295
+ filter: !hasApiKey ? "blur(0.3px)" : "none",
296
+ opacity: !hasApiKey ? 0.85 : 1
297
+ },
298
+ children: [
299
+ activeTab === "actions" && /* @__PURE__ */ jsx(ActionsTab, { context: displayContext }),
300
+ activeTab === "readables" && /* @__PURE__ */ jsx(ReadablesTab, { context: displayContext }),
301
+ activeTab === "agent" && /* @__PURE__ */ jsx(AgentStatusTab, { context: displayContext }),
302
+ activeTab === "messages" && /* @__PURE__ */ jsx(MessagesTab, { messagesContext: displayMessagesContext }),
303
+ activeTab === "context" && /* @__PURE__ */ jsx(ContextTab, { context: displayContext })
304
+ ]
305
+ }
306
+ ),
307
+ /* @__PURE__ */ jsxs(
308
+ "div",
309
+ {
310
+ style: {
311
+ padding: "16px 24px",
312
+ borderTop: "1px solid #e5e7eb",
313
+ backgroundColor: "white",
314
+ display: "flex",
315
+ justifyContent: "space-between",
316
+ alignItems: "center",
317
+ minHeight: "57px",
318
+ flexShrink: 0,
319
+ filter: !hasApiKey ? "blur(0.3px)" : "none",
320
+ opacity: !hasApiKey ? 0.9 : 1
321
+ },
322
+ children: [
323
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ jsx(
324
+ "a",
325
+ {
326
+ href: "https://github.com/CopilotKit/CopilotKit/issues",
327
+ target: "_blank",
328
+ rel: "noopener noreferrer",
329
+ style: { color: "#2563eb", textDecoration: "none" },
330
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
331
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
332
+ children: "Report an issue"
333
+ }
334
+ ) }),
335
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ jsx(
336
+ "a",
337
+ {
338
+ href: "https://mcp.copilotkit.ai/",
339
+ target: "_blank",
340
+ rel: "noopener noreferrer",
341
+ style: { color: "#2563eb", textDecoration: "none" },
342
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
343
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
344
+ children: "Add MCP Server \u2192"
345
+ }
346
+ ) })
347
+ ]
348
+ }
349
+ ),
350
+ !hasApiKey && /* @__PURE__ */ jsx(
351
+ "div",
352
+ {
353
+ style: {
354
+ position: "absolute",
355
+ top: 0,
356
+ left: 0,
357
+ right: 0,
358
+ bottom: 0,
359
+ backgroundColor: "rgba(255, 255, 255, 0.2)",
360
+ backdropFilter: "blur(2px)",
361
+ WebkitBackdropFilter: "blur(2px)",
362
+ display: "flex",
363
+ alignItems: "center",
364
+ justifyContent: "center",
365
+ borderRadius: "12px",
366
+ zIndex: 10
367
+ },
368
+ onClick: (e) => e.stopPropagation(),
369
+ children: /* @__PURE__ */ jsxs(
370
+ "button",
371
+ {
372
+ onClick: () => window.open("https://cloud.copilotkit.ai/sign-in", "_blank"),
373
+ style: {
374
+ // Following button system specifications
375
+ height: "48px",
376
+ padding: "12px 24px",
377
+ backgroundColor: "#030507",
378
+ // textPrimary token
379
+ color: "#FFFFFF",
380
+ borderRadius: "12px",
381
+ // Medium radius token
382
+ border: "none",
383
+ cursor: "pointer",
384
+ fontSize: "14px",
385
+ // Medium Semi Bold typography
386
+ fontWeight: "600",
387
+ fontFamily: "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif",
388
+ lineHeight: "22px",
389
+ boxShadow: "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)",
390
+ transition: "all 200ms ease",
391
+ // 200ms ease as per specs
392
+ display: "inline-flex",
393
+ alignItems: "center",
394
+ gap: "8px",
395
+ textTransform: "uppercase",
396
+ letterSpacing: "0.5px"
397
+ },
398
+ onMouseEnter: (e) => {
399
+ e.currentTarget.style.backgroundColor = "#575758";
400
+ e.currentTarget.style.transform = "translateY(-1px)";
401
+ e.currentTarget.style.boxShadow = "0 6px 20px rgba(3, 5, 7, 0.25), 0 2px 4px rgba(3, 5, 7, 0.15)";
402
+ },
403
+ onMouseLeave: (e) => {
404
+ e.currentTarget.style.backgroundColor = "#030507";
405
+ e.currentTarget.style.transform = "translateY(0)";
406
+ e.currentTarget.style.boxShadow = "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)";
407
+ },
408
+ onMouseDown: (e) => {
409
+ e.currentTarget.style.backgroundColor = "#858589";
410
+ e.currentTarget.style.transform = "translateY(0)";
411
+ },
412
+ onMouseUp: (e) => {
413
+ e.currentTarget.style.backgroundColor = "#575758";
414
+ e.currentTarget.style.transform = "translateY(-1px)";
415
+ },
416
+ onFocus: (e) => {
417
+ e.currentTarget.style.outline = "2px solid #BEC9FF";
418
+ e.currentTarget.style.outlineOffset = "2px";
419
+ },
420
+ onBlur: (e) => {
421
+ e.currentTarget.style.outline = "none";
422
+ },
423
+ children: [
424
+ "Get API Key",
425
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "16px", marginLeft: "-4px" }, children: "\u2192" })
426
+ ]
427
+ }
428
+ )
429
+ }
430
+ )
431
+ ]
432
+ }
433
+ )
434
+ }
435
+ );
436
+ }
437
+ function ActionsTab({ context }) {
438
+ const actions = Object.values(context.actions);
439
+ if (actions.length === 0) {
440
+ return /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
441
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No actions available" }),
442
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Actions will appear here when registered" })
443
+ ] });
444
+ }
445
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: actions.map((action, index) => /* @__PURE__ */ jsx(
446
+ "div",
447
+ {
448
+ style: {
449
+ backgroundColor: "white",
450
+ padding: "16px",
451
+ borderRadius: "8px",
452
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
453
+ border: "1px solid #e5e7eb"
454
+ },
455
+ children: /* @__PURE__ */ jsxs(
456
+ "div",
457
+ {
458
+ style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
459
+ children: [
460
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
461
+ /* @__PURE__ */ jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: action.name }),
462
+ action.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: action.description }),
463
+ action.parameters && action.parameters.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginTop: "12px" }, children: [
464
+ /* @__PURE__ */ jsx(
465
+ "p",
466
+ {
467
+ style: {
468
+ fontSize: "12px",
469
+ fontWeight: "500",
470
+ color: "#6b7280",
471
+ textTransform: "uppercase",
472
+ margin: "0 0 4px 0"
473
+ },
474
+ children: "Parameters:"
475
+ }
476
+ ),
477
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: action.parameters.map((param, pIndex) => /* @__PURE__ */ jsxs("div", { style: { fontSize: "14px" }, children: [
478
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: "monospace", color: "#374151" }, children: param.name }),
479
+ param.required && /* @__PURE__ */ jsx("span", { style: { marginLeft: "4px", fontSize: "12px", color: "#ef4444" }, children: "*required" }),
480
+ param.type && /* @__PURE__ */ jsxs("span", { style: { marginLeft: "8px", fontSize: "12px", color: "#6b7280" }, children: [
481
+ "(",
482
+ param.type,
483
+ ")"
484
+ ] })
485
+ ] }, pIndex)) })
486
+ ] })
487
+ ] }),
488
+ /* @__PURE__ */ jsx("div", { style: { marginLeft: "16px" }, children: action.status === "available" ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(ExclamationMarkTriangleIcon, {}) })
489
+ ]
490
+ }
491
+ )
492
+ },
493
+ index
494
+ )) });
495
+ }
496
+ function ReadablesTab({ context }) {
497
+ const readables = context.getAllContext();
498
+ if (readables.length === 0) {
499
+ return /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
500
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No readable context available" }),
501
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Readable context will appear here when provided" })
502
+ ] });
503
+ }
504
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: readables.map((readable, index) => /* @__PURE__ */ jsx(
505
+ "div",
506
+ {
507
+ style: {
508
+ backgroundColor: "white",
509
+ padding: "16px",
510
+ borderRadius: "8px",
511
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
512
+ border: "1px solid #e5e7eb"
513
+ },
514
+ children: /* @__PURE__ */ jsx(
515
+ "div",
516
+ {
517
+ style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
518
+ children: /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
519
+ /* @__PURE__ */ jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: readable.name || `Readable ${index + 1}` }),
520
+ readable.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: readable.description }),
521
+ readable.value && /* @__PURE__ */ jsx(
522
+ "pre",
523
+ {
524
+ style: {
525
+ marginTop: "12px",
526
+ padding: "8px",
527
+ backgroundColor: "#f9fafb",
528
+ borderRadius: "4px",
529
+ fontSize: "12px",
530
+ overflowX: "auto",
531
+ margin: "12px 0 0 0"
532
+ },
533
+ children: JSON.stringify(readable.value, null, 2)
534
+ }
535
+ )
536
+ ] })
537
+ }
538
+ )
539
+ },
540
+ index
541
+ )) });
542
+ }
543
+ function AgentStatusTab({ context }) {
544
+ const agentStates = context.coagentStates || {};
545
+ const agentStateEntries = Object.entries(agentStates);
546
+ if (agentStateEntries.length === 0) {
547
+ return /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
548
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No agent states available" }),
549
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Agent states will appear here when agents are active" })
550
+ ] });
551
+ }
552
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: agentStateEntries.map(([agentName, state]) => /* @__PURE__ */ jsxs(
553
+ "div",
554
+ {
555
+ style: {
556
+ backgroundColor: "white",
557
+ padding: "24px",
558
+ borderRadius: "8px",
559
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
560
+ border: "1px solid #e5e7eb"
561
+ },
562
+ children: [
563
+ /* @__PURE__ */ jsxs(
564
+ "div",
565
+ {
566
+ style: {
567
+ display: "flex",
568
+ alignItems: "center",
569
+ justifyContent: "space-between",
570
+ marginBottom: "16px"
571
+ },
572
+ children: [
573
+ /* @__PURE__ */ jsx("h3", { style: { fontWeight: "600", fontSize: "18px", color: "#1f2937", margin: 0 }, children: agentName }),
574
+ /* @__PURE__ */ jsx(
575
+ "span",
576
+ {
577
+ style: {
578
+ padding: "4px 12px",
579
+ borderRadius: "9999px",
580
+ fontSize: "12px",
581
+ fontWeight: "500",
582
+ backgroundColor: state.status === "running" ? "#dcfce7" : state.status === "complete" ? "#dbeafe" : "#f3f4f6",
583
+ color: state.status === "running" ? "#166534" : state.status === "complete" ? "#1e40af" : "#1f2937"
584
+ },
585
+ children: state.status || "idle"
586
+ }
587
+ )
588
+ ]
589
+ }
590
+ ),
591
+ state.state && /* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
592
+ /* @__PURE__ */ jsx(
593
+ "p",
594
+ {
595
+ style: {
596
+ fontSize: "12px",
597
+ fontWeight: "500",
598
+ color: "#6b7280",
599
+ textTransform: "uppercase",
600
+ margin: "0 0 4px 0"
601
+ },
602
+ children: "Current State:"
603
+ }
604
+ ),
605
+ /* @__PURE__ */ jsx(
606
+ "pre",
607
+ {
608
+ style: {
609
+ padding: "12px",
610
+ backgroundColor: "#f9fafb",
611
+ borderRadius: "4px",
612
+ fontSize: "12px",
613
+ overflowX: "auto",
614
+ margin: 0
615
+ },
616
+ children: JSON.stringify(state.state, null, 2)
617
+ }
618
+ )
619
+ ] }),
620
+ state.running && /* @__PURE__ */ jsxs(
621
+ "div",
622
+ {
623
+ style: {
624
+ marginTop: "16px",
625
+ display: "flex",
626
+ alignItems: "center",
627
+ fontSize: "14px",
628
+ color: "#4b5563"
629
+ },
630
+ children: [
631
+ /* @__PURE__ */ jsx("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ jsxs(
632
+ "svg",
633
+ {
634
+ width: "16",
635
+ height: "16",
636
+ viewBox: "0 0 16 16",
637
+ style: { animation: "spin 1s linear infinite" },
638
+ children: [
639
+ /* @__PURE__ */ jsx("style", { children: `@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` }),
640
+ /* @__PURE__ */ jsx(
641
+ "circle",
642
+ {
643
+ cx: "8",
644
+ cy: "8",
645
+ r: "6",
646
+ fill: "none",
647
+ stroke: "#4b5563",
648
+ strokeWidth: "2",
649
+ strokeDasharray: "9 3"
650
+ }
651
+ )
652
+ ]
653
+ }
654
+ ) }),
655
+ /* @__PURE__ */ jsx("span", { children: "Agent is currently running..." })
656
+ ]
657
+ }
658
+ )
659
+ ]
660
+ },
661
+ agentName
662
+ )) });
663
+ }
664
+ function MessagesTab({ messagesContext }) {
665
+ const messages = messagesContext.messages || [];
666
+ if (messages.length === 0) {
667
+ return /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
668
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No messages yet" }),
669
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Messages will appear here as the conversation progresses" })
670
+ ] });
671
+ }
672
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: messages.map((message, index) => /* @__PURE__ */ jsxs(
673
+ "div",
674
+ {
675
+ style: {
676
+ padding: "16px",
677
+ borderRadius: "8px",
678
+ backgroundColor: message.role === "user" ? "#eff6ff" : message.role === "assistant" ? "#f9fafb" : "#fefce8",
679
+ border: `1px solid ${message.role === "user" ? "#c7d2fe" : message.role === "assistant" ? "#e5e7eb" : "#fde047"}`,
680
+ marginLeft: message.role === "user" ? "48px" : "0",
681
+ marginRight: message.role === "assistant" ? "48px" : "0"
682
+ },
683
+ children: [
684
+ /* @__PURE__ */ jsxs(
685
+ "div",
686
+ {
687
+ style: {
688
+ display: "flex",
689
+ alignItems: "flex-start",
690
+ justifyContent: "space-between",
691
+ marginBottom: "8px"
692
+ },
693
+ children: [
694
+ /* @__PURE__ */ jsx(
695
+ "span",
696
+ {
697
+ style: {
698
+ fontWeight: "500",
699
+ fontSize: "14px",
700
+ color: "#374151",
701
+ textTransform: "capitalize"
702
+ },
703
+ children: message.role || "system"
704
+ }
705
+ ),
706
+ message.timestamp && /* @__PURE__ */ jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: new Date(message.timestamp).toLocaleTimeString() })
707
+ ]
708
+ }
709
+ ),
710
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", color: "#1f2937", whiteSpace: "pre-wrap" }, children: message.content || "" })
711
+ ]
712
+ },
713
+ index
714
+ )) });
715
+ }
716
+ function ContextTab({ context }) {
717
+ const documents = context.getDocumentsContext([]);
718
+ if (documents.length === 0) {
719
+ return /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
720
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No document context available" }),
721
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Document context will appear here when provided" })
722
+ ] });
723
+ }
724
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: documents.map((doc, index) => /* @__PURE__ */ jsxs(
725
+ "div",
726
+ {
727
+ style: {
728
+ backgroundColor: "white",
729
+ padding: "16px",
730
+ borderRadius: "8px",
731
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
732
+ border: "1px solid #e5e7eb"
733
+ },
734
+ children: [
735
+ /* @__PURE__ */ jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 8px 0" }, children: doc.name || `Document ${index + 1}` }),
736
+ doc.content && /* @__PURE__ */ jsx(
737
+ "pre",
738
+ {
739
+ style: {
740
+ padding: "12px",
741
+ backgroundColor: "#f9fafb",
742
+ borderRadius: "4px",
743
+ fontSize: "12px",
744
+ overflowX: "auto",
745
+ margin: 0
746
+ },
747
+ children: doc.content
748
+ }
749
+ )
750
+ ]
751
+ },
752
+ index
753
+ )) });
754
+ }
755
+
756
+ export {
757
+ DeveloperConsoleModal
758
+ };
759
+ //# sourceMappingURL=chunk-WSXTUD36.mjs.map