@copilotkit/react-core 1.50.0-beta.9 → 1.50.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 (51) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/dist/{chunk-YJGPIN3R.mjs → chunk-5J7RRLRO.mjs} +2 -2
  3. package/dist/{chunk-FYMZKPOL.mjs → chunk-CO6V4G7P.mjs} +15 -7
  4. package/dist/chunk-CO6V4G7P.mjs.map +1 -0
  5. package/dist/{chunk-B5ELMVT7.mjs → chunk-HQTDDA6V.mjs} +2 -2
  6. package/dist/{chunk-3775VM7Y.mjs → chunk-LDEWO5XH.mjs} +5 -411
  7. package/dist/chunk-LDEWO5XH.mjs.map +1 -0
  8. package/dist/{chunk-7SHWECGN.mjs → chunk-ZE4JVTEP.mjs} +2 -2
  9. package/dist/components/copilot-provider/copilotkit-props.d.ts +6 -0
  10. package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
  11. package/dist/components/copilot-provider/copilotkit.js +127 -1150
  12. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  13. package/dist/components/copilot-provider/copilotkit.mjs +3 -6
  14. package/dist/components/copilot-provider/index.js +127 -1150
  15. package/dist/components/copilot-provider/index.js.map +1 -1
  16. package/dist/components/copilot-provider/index.mjs +3 -6
  17. package/dist/components/dev-console/console-trigger.mjs +225 -5
  18. package/dist/components/dev-console/console-trigger.mjs.map +1 -1
  19. package/dist/components/index.js +127 -1150
  20. package/dist/components/index.js.map +1 -1
  21. package/dist/components/index.mjs +3 -6
  22. package/dist/hooks/index.js +3 -405
  23. package/dist/hooks/index.js.map +1 -1
  24. package/dist/hooks/index.mjs +28 -28
  25. package/dist/hooks/use-copilot-chat-headless_c.js +3 -405
  26. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  27. package/dist/hooks/use-copilot-chat-headless_c.mjs +3 -3
  28. package/dist/hooks/use-copilot-chat.js +3 -405
  29. package/dist/hooks/use-copilot-chat.js.map +1 -1
  30. package/dist/hooks/use-copilot-chat.mjs +3 -3
  31. package/dist/hooks/use-copilot-chat_internal.js +3 -405
  32. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  33. package/dist/hooks/use-copilot-chat_internal.mjs +2 -2
  34. package/dist/index.js +276 -1694
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.mjs +34 -37
  37. package/dist/lib/copilot-task.js.map +1 -1
  38. package/dist/lib/copilot-task.mjs +4 -7
  39. package/dist/lib/index.js.map +1 -1
  40. package/dist/lib/index.mjs +4 -7
  41. package/dist/utils/index.mjs +3 -3
  42. package/package.json +6 -6
  43. package/src/components/copilot-provider/copilotkit-props.tsx +7 -0
  44. package/src/components/copilot-provider/copilotkit.tsx +13 -5
  45. package/dist/chunk-3775VM7Y.mjs.map +0 -1
  46. package/dist/chunk-FYMZKPOL.mjs.map +0 -1
  47. package/dist/chunk-PMWUKW3Z.mjs +0 -231
  48. package/dist/chunk-PMWUKW3Z.mjs.map +0 -1
  49. /package/dist/{chunk-YJGPIN3R.mjs.map → chunk-5J7RRLRO.mjs.map} +0 -0
  50. /package/dist/{chunk-B5ELMVT7.mjs.map → chunk-HQTDDA6V.mjs.map} +0 -0
  51. /package/dist/{chunk-7SHWECGN.mjs.map → chunk-ZE4JVTEP.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -119,8 +119,8 @@ __export(src_exports, {
119
119
  module.exports = __toCommonJS(src_exports);
120
120
 
121
121
  // src/components/copilot-provider/copilotkit.tsx
122
- var import_react17 = require("react");
123
- var import_react18 = require("@copilotkitnext/react");
122
+ var import_react15 = require("react");
123
+ var import_react16 = require("@copilotkitnext/react");
124
124
 
125
125
  // src/context/copilot-context.tsx
126
126
  var import_react = __toESM(require("react"));
@@ -359,7 +359,7 @@ function setsHaveIntersection(setA, setB) {
359
359
 
360
360
  // src/components/copilot-provider/copilotkit.tsx
361
361
  var import_react_dom = require("react-dom");
362
- var import_shared13 = require("@copilotkit/shared");
362
+ var import_shared12 = require("@copilotkit/shared");
363
363
 
364
364
  // src/hooks/use-flat-category-store.ts
365
365
  var import_react3 = require("react");
@@ -1349,1050 +1349,28 @@ var CopilotErrorBoundary = class extends import_react8.default.Component {
1349
1349
  }
1350
1350
  };
1351
1351
 
1352
- // src/components/dev-console/console-trigger.tsx
1353
- var import_react10 = require("react");
1354
-
1355
- // src/components/dev-console/icons.tsx
1356
- var import_jsx_runtime7 = require("react/jsx-runtime");
1357
- var ExclamationMarkTriangleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1358
- "svg",
1359
- {
1360
- width: "13.3967723px",
1361
- height: "12px",
1362
- viewBox: "0 0 13.3967723 12",
1363
- version: "1.1",
1364
- xmlns: "http://www.w3.org/2000/svg",
1365
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1366
- "path",
1367
- {
1368
- d: "M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z",
1369
- id: "Shape"
1370
- }
1371
- ) }) })
1372
- }
1373
- );
1374
- var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1375
- "svg",
1376
- {
1377
- width: "14px",
1378
- height: "14px",
1379
- viewBox: "0 0 14 14",
1380
- version: "1.1",
1381
- xmlns: "http://www.w3.org/2000/svg",
1382
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1383
- "path",
1384
- {
1385
- d: "M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z",
1386
- id: "Shape"
1387
- }
1388
- ) }) }) })
1389
- }
1390
- );
1391
- var CopilotKitIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1392
- "svg",
1393
- {
1394
- width: "33px",
1395
- height: "35px",
1396
- viewBox: "0 0 33 35",
1397
- version: "1.1",
1398
- xmlns: "http://www.w3.org/2000/svg",
1399
- children: [
1400
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
1401
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1402
- "image",
1403
- {
1404
- x: "0",
1405
- y: "0",
1406
- width: "33",
1407
- height: "35",
1408
- xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAjaADAAQAAAABAAAAlwAAAACI8Oz3AABAAElEQVR4Ae2dCYAlVXnvv6q79d7TMz37sIMgKKBCkLhkSKK4xJUMQVzAqJBgNDGJa2LsvJfERI0aiEbwRXnoQ2VYRASiQUFRUGQm7DAwzDBbT+/rvbfvXu/3P1V1+84CzEw3MNPD6a579nOqzvev73znO0t59rzZbQu88sXndp2w4gVLp5oG+6+47ivDu010kAb6B+lzP+Vjr1zZk0xV/ddMVIufap/34g+e+s9rX9351U1dT5npIIpMHkTPusePmto+tKhctVWPDW1/c27hIVNbCsFbCpa7/aR/f/SWFV2ZX974zsNG97iwOZjwedDshqiZlL3AD9JH9Y8PpTYMPJEuLj7+pclE5vBquXZ6MV/56Zu/ueGnmWpqzer3HzKym+xzPsib80+4lw/Y09Pjr7lm9GO+eR+eKI4tXdeRsomXv8a6Dj3eqn6iRoPl5qW83o60vyaT9O5IWPX2llrH+hsuXJbfy6oO2OTPg2Yn0p1/6ueWFK1wWTKReo1XDZoeqw7YxhcfYfNf9NtWSHTYVLVqxSAIqoFlU76NzEt6mzqSCQBkt3up1NrlHUdsXX22V92p2DnlfR40O5Az8N57+pfPgcv8YzLZdHjKS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Tj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+J7/zXkIt50IxO3oK1rgKgEaU5YYAJhaUOCLawjufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg=="
1409
- }
1410
- ) })
1411
- ]
1412
- }
1413
- );
1414
-
1415
- // src/components/dev-console/developer-console-modal.tsx
1416
- var import_shared8 = require("@copilotkit/shared");
1417
- var import_react9 = require("react");
1418
- var import_jsx_runtime8 = require("react/jsx-runtime");
1419
- function DeveloperConsoleModal({ isOpen, onClose, hasApiKey }) {
1420
- const context = useCopilotContext();
1421
- const messagesContext = useCopilotMessagesContext();
1422
- const [activeTab, setActiveTab] = (0, import_react9.useState)("actions");
1423
- (0, import_react9.useEffect)(() => {
1424
- const handleEscape = (e) => {
1425
- if (e.key === "Escape") {
1426
- onClose();
1427
- }
1428
- };
1429
- if (isOpen) {
1430
- document.addEventListener("keydown", handleEscape);
1431
- document.body.style.overflow = "hidden";
1432
- }
1433
- return () => {
1434
- document.removeEventListener("keydown", handleEscape);
1435
- document.body.style.overflow = "unset";
1436
- };
1437
- }, [isOpen, onClose]);
1438
- if (!isOpen)
1439
- return null;
1440
- const displayContext = hasApiKey ? context : {
1441
- actions: {
1442
- search_web: { name: "search_web", description: "Search the web for information" },
1443
- send_email: { name: "send_email", description: "Send an email to a contact" },
1444
- create_document: { name: "create_document", description: "Create a new document" },
1445
- analyze_code: {
1446
- name: "analyze_code",
1447
- description: "Analyze code for issues and improvements"
1448
- },
1449
- generate_tests: {
1450
- name: "generate_tests",
1451
- description: "Generate unit tests for functions"
1452
- }
1453
- },
1454
- getAllContext: () => [
1455
- {
1456
- content: "User preferences: dark mode enabled, TypeScript preferred",
1457
- metadata: { source: "settings" }
1458
- },
1459
- {
1460
- content: "Current project: Building a React application with CopilotKit",
1461
- metadata: { source: "project" }
1462
- },
1463
- {
1464
- content: "Recent activity: Implemented authentication system",
1465
- metadata: { source: "activity" }
1466
- },
1467
- {
1468
- content: "Development environment: VS Code, Node.js 18, React 18",
1469
- metadata: { source: "environment" }
1470
- }
1471
- ],
1472
- coagentStates: {
1473
- "main-agent": { status: "active", lastUpdate: Date.now() },
1474
- "code-assistant": { status: "active", lastUpdate: Date.now() - 15e3 },
1475
- "search-agent": { status: "idle", lastUpdate: Date.now() - 6e4 }
1476
- },
1477
- getDocumentsContext: () => [
1478
- {
1479
- content: "README.md: Project setup and installation instructions",
1480
- metadata: { type: "documentation" }
1481
- },
1482
- {
1483
- content: "API Documentation: CopilotKit integration guide",
1484
- metadata: { type: "documentation" }
1485
- },
1486
- {
1487
- content: "package.json: Project dependencies and scripts",
1488
- metadata: { type: "configuration" }
1489
- }
1490
- ]
1491
- };
1492
- const displayMessagesContext = hasApiKey ? messagesContext : {
1493
- messages: [
1494
- {
1495
- id: "1",
1496
- role: "user",
1497
- content: "Help me implement a todo list with drag and drop functionality"
1498
- },
1499
- {
1500
- id: "2",
1501
- role: "assistant",
1502
- 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."
1503
- },
1504
- { id: "3", role: "user", content: "Can you also add priority levels and due dates?" },
1505
- {
1506
- id: "4",
1507
- role: "assistant",
1508
- 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."
1509
- },
1510
- { id: "5", role: "user", content: "Perfect! How about adding categories or tags?" }
1511
- ]
1512
- };
1513
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1514
- "div",
1515
- {
1516
- style: {
1517
- position: "fixed",
1518
- top: 0,
1519
- left: 0,
1520
- right: 0,
1521
- bottom: 0,
1522
- zIndex: 9999,
1523
- backgroundColor: "rgba(0, 0, 0, 0.3)",
1524
- display: "flex",
1525
- alignItems: "center",
1526
- justifyContent: "center",
1527
- padding: "16px"
1528
- },
1529
- onClick: onClose,
1530
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1531
- "div",
1532
- {
1533
- style: {
1534
- width: "1152px",
1535
- maxWidth: "95vw",
1536
- height: "80vh",
1537
- backgroundColor: "white",
1538
- borderRadius: "12px",
1539
- boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
1540
- display: "flex",
1541
- flexDirection: "column",
1542
- overflow: "hidden",
1543
- position: "relative"
1544
- },
1545
- onClick: (e) => e.stopPropagation(),
1546
- children: [
1547
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1548
- "div",
1549
- {
1550
- style: {
1551
- display: "flex",
1552
- alignItems: "center",
1553
- justifyContent: "space-between",
1554
- padding: "24px",
1555
- borderBottom: "1px solid #e5e7eb",
1556
- minHeight: "73px",
1557
- flexShrink: 0,
1558
- filter: !hasApiKey ? "blur(0.3px)" : "none",
1559
- opacity: !hasApiKey ? 0.95 : 1
1560
- },
1561
- children: [
1562
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
1563
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotKitIcon, {}),
1564
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1565
- "h1",
1566
- {
1567
- style: {
1568
- fontWeight: "bold",
1569
- fontSize: "20px",
1570
- color: "#1f2937",
1571
- margin: 0
1572
- },
1573
- children: "Inspector"
1574
- }
1575
- ),
1576
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1577
- "span",
1578
- {
1579
- style: {
1580
- fontSize: "14px",
1581
- color: "#6b7280",
1582
- backgroundColor: "#f3f4f6",
1583
- padding: "4px 8px",
1584
- borderRadius: "4px"
1585
- },
1586
- children: [
1587
- "v",
1588
- import_shared8.COPILOTKIT_VERSION
1589
- ]
1590
- }
1591
- )
1592
- ] }),
1593
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1594
- "button",
1595
- {
1596
- onClick: onClose,
1597
- style: {
1598
- color: "#9ca3af",
1599
- fontSize: "24px",
1600
- fontWeight: "300",
1601
- border: "none",
1602
- background: "none",
1603
- cursor: "pointer",
1604
- padding: "4px"
1605
- },
1606
- onMouseEnter: (e) => e.currentTarget.style.color = "#4b5563",
1607
- onMouseLeave: (e) => e.currentTarget.style.color = "#9ca3af",
1608
- children: "\xD7"
1609
- }
1610
- )
1611
- ]
1612
- }
1613
- ),
1614
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1615
- "div",
1616
- {
1617
- style: {
1618
- display: "flex",
1619
- borderBottom: "1px solid #e5e7eb",
1620
- backgroundColor: "#f9fafb",
1621
- minHeight: "50px",
1622
- flexShrink: 0,
1623
- filter: !hasApiKey ? "blur(0.3px)" : "none",
1624
- opacity: !hasApiKey ? 0.9 : 1
1625
- },
1626
- children: [
1627
- { id: "actions", label: "Actions", count: Object.keys(displayContext.actions).length },
1628
- { id: "readables", label: "Readables", count: displayContext.getAllContext().length },
1629
- {
1630
- id: "agent",
1631
- label: "Agent Status",
1632
- count: Object.keys(displayContext.coagentStates).length
1633
- },
1634
- { id: "messages", label: "Messages", count: displayMessagesContext.messages.length },
1635
- {
1636
- id: "context",
1637
- label: "Context",
1638
- count: displayContext.getDocumentsContext([]).length
1639
- }
1640
- ].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1641
- "button",
1642
- {
1643
- onClick: () => setActiveTab(tab.id),
1644
- style: {
1645
- padding: "12px 24px",
1646
- fontSize: "14px",
1647
- fontWeight: "500",
1648
- border: "none",
1649
- cursor: "pointer",
1650
- backgroundColor: activeTab === tab.id ? "white" : "transparent",
1651
- color: activeTab === tab.id ? "#2563eb" : "#6b7280",
1652
- borderBottom: activeTab === tab.id ? "2px solid #2563eb" : "none",
1653
- transition: "all 0.2s"
1654
- },
1655
- onMouseEnter: (e) => {
1656
- if (activeTab !== tab.id) {
1657
- e.currentTarget.style.color = "#1f2937";
1658
- e.currentTarget.style.backgroundColor = "#f3f4f6";
1659
- }
1660
- },
1661
- onMouseLeave: (e) => {
1662
- if (activeTab !== tab.id) {
1663
- e.currentTarget.style.color = "#6b7280";
1664
- e.currentTarget.style.backgroundColor = "transparent";
1665
- }
1666
- },
1667
- children: [
1668
- tab.label,
1669
- tab.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1670
- "span",
1671
- {
1672
- style: {
1673
- marginLeft: "8px",
1674
- backgroundColor: "#e5e7eb",
1675
- color: "#374151",
1676
- padding: "2px 8px",
1677
- borderRadius: "9999px",
1678
- fontSize: "12px"
1679
- },
1680
- children: tab.count
1681
- }
1682
- )
1683
- ]
1684
- },
1685
- tab.id
1686
- ))
1687
- }
1688
- ),
1689
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1690
- "div",
1691
- {
1692
- style: {
1693
- height: "calc(100% - 142px)",
1694
- overflow: "auto",
1695
- padding: "24px",
1696
- backgroundColor: "#f9fafb",
1697
- filter: !hasApiKey ? "blur(0.3px)" : "none",
1698
- opacity: !hasApiKey ? 0.85 : 1
1699
- },
1700
- children: [
1701
- activeTab === "actions" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ActionsTab, { context: displayContext }),
1702
- activeTab === "readables" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ReadablesTab, { context: displayContext }),
1703
- activeTab === "agent" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AgentStatusTab, { context: displayContext }),
1704
- activeTab === "messages" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MessagesTab, { messagesContext: displayMessagesContext }),
1705
- activeTab === "context" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ContextTab, { context: displayContext })
1706
- ]
1707
- }
1708
- ),
1709
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1710
- "div",
1711
- {
1712
- style: {
1713
- padding: "16px 24px",
1714
- borderTop: "1px solid #e5e7eb",
1715
- backgroundColor: "white",
1716
- display: "flex",
1717
- justifyContent: "space-between",
1718
- alignItems: "center",
1719
- minHeight: "57px",
1720
- flexShrink: 0,
1721
- filter: !hasApiKey ? "blur(0.3px)" : "none",
1722
- opacity: !hasApiKey ? 0.9 : 1
1723
- },
1724
- children: [
1725
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1726
- "a",
1727
- {
1728
- href: "https://github.com/CopilotKit/CopilotKit/issues",
1729
- target: "_blank",
1730
- rel: "noopener noreferrer",
1731
- style: { color: "#2563eb", textDecoration: "none" },
1732
- onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1733
- onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1734
- children: "Report an issue"
1735
- }
1736
- ) }),
1737
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1738
- "a",
1739
- {
1740
- href: "https://mcp.copilotkit.ai/",
1741
- target: "_blank",
1742
- rel: "noopener noreferrer",
1743
- style: { color: "#2563eb", textDecoration: "none" },
1744
- onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1745
- onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1746
- children: "Add MCP Server \u2192"
1747
- }
1748
- ) })
1749
- ]
1750
- }
1751
- ),
1752
- !hasApiKey && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1753
- "div",
1754
- {
1755
- style: {
1756
- position: "absolute",
1757
- top: 0,
1758
- left: 0,
1759
- right: 0,
1760
- bottom: 0,
1761
- backgroundColor: "rgba(255, 255, 255, 0.2)",
1762
- backdropFilter: "blur(2px)",
1763
- WebkitBackdropFilter: "blur(2px)",
1764
- display: "flex",
1765
- alignItems: "center",
1766
- justifyContent: "center",
1767
- borderRadius: "12px",
1768
- zIndex: 10
1769
- },
1770
- onClick: (e) => e.stopPropagation(),
1771
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1772
- "button",
1773
- {
1774
- onClick: () => window.open("https://cloud.copilotkit.ai/sign-in", "_blank"),
1775
- style: {
1776
- // Following button system specifications
1777
- height: "48px",
1778
- padding: "12px 24px",
1779
- backgroundColor: "#030507",
1780
- // textPrimary token
1781
- color: "#FFFFFF",
1782
- borderRadius: "12px",
1783
- // Medium radius token
1784
- border: "none",
1785
- cursor: "pointer",
1786
- fontSize: "14px",
1787
- // Medium Semi Bold typography
1788
- fontWeight: "600",
1789
- fontFamily: "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif",
1790
- lineHeight: "22px",
1791
- boxShadow: "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)",
1792
- transition: "all 200ms ease",
1793
- // 200ms ease as per specs
1794
- display: "inline-flex",
1795
- alignItems: "center",
1796
- gap: "8px",
1797
- textTransform: "uppercase",
1798
- letterSpacing: "0.5px"
1799
- },
1800
- onMouseEnter: (e) => {
1801
- e.currentTarget.style.backgroundColor = "#575758";
1802
- e.currentTarget.style.transform = "translateY(-1px)";
1803
- e.currentTarget.style.boxShadow = "0 6px 20px rgba(3, 5, 7, 0.25), 0 2px 4px rgba(3, 5, 7, 0.15)";
1804
- },
1805
- onMouseLeave: (e) => {
1806
- e.currentTarget.style.backgroundColor = "#030507";
1807
- e.currentTarget.style.transform = "translateY(0)";
1808
- e.currentTarget.style.boxShadow = "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)";
1809
- },
1810
- onMouseDown: (e) => {
1811
- e.currentTarget.style.backgroundColor = "#858589";
1812
- e.currentTarget.style.transform = "translateY(0)";
1813
- },
1814
- onMouseUp: (e) => {
1815
- e.currentTarget.style.backgroundColor = "#575758";
1816
- e.currentTarget.style.transform = "translateY(-1px)";
1817
- },
1818
- onFocus: (e) => {
1819
- e.currentTarget.style.outline = "2px solid #BEC9FF";
1820
- e.currentTarget.style.outlineOffset = "2px";
1821
- },
1822
- onBlur: (e) => {
1823
- e.currentTarget.style.outline = "none";
1824
- },
1825
- children: [
1826
- "Get License Key",
1827
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: "16px", marginLeft: "-4px" }, children: "\u2192" })
1828
- ]
1829
- }
1830
- )
1831
- }
1832
- )
1833
- ]
1834
- }
1835
- )
1836
- }
1837
- );
1838
- }
1839
- function ActionsTab({ context }) {
1840
- const actions = Object.values(context.actions);
1841
- if (actions.length === 0) {
1842
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
1843
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No actions available" }),
1844
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Actions will appear here when registered" })
1845
- ] });
1846
- }
1847
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: actions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1848
- "div",
1849
- {
1850
- style: {
1851
- backgroundColor: "white",
1852
- padding: "16px",
1853
- borderRadius: "8px",
1854
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
1855
- border: "1px solid #e5e7eb"
1856
- },
1857
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1858
- "div",
1859
- {
1860
- style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
1861
- children: [
1862
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1 }, children: [
1863
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: action.name }),
1864
- action.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: action.description }),
1865
- action.parameters && action.parameters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginTop: "12px" }, children: [
1866
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1867
- "p",
1868
- {
1869
- style: {
1870
- fontSize: "12px",
1871
- fontWeight: "500",
1872
- color: "#6b7280",
1873
- textTransform: "uppercase",
1874
- margin: "0 0 4px 0"
1875
- },
1876
- children: "Parameters:"
1877
- }
1878
- ),
1879
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: action.parameters.map((param, pIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { fontSize: "14px" }, children: [
1880
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontFamily: "monospace", color: "#374151" }, children: param.name }),
1881
- param.required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { marginLeft: "4px", fontSize: "12px", color: "#ef4444" }, children: "*required" }),
1882
- param.type && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { style: { marginLeft: "8px", fontSize: "12px", color: "#6b7280" }, children: [
1883
- "(",
1884
- param.type,
1885
- ")"
1886
- ] })
1887
- ] }, pIndex)) })
1888
- ] })
1889
- ] }),
1890
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { marginLeft: "16px" }, children: action.status === "available" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExclamationMarkTriangleIcon, {}) })
1891
- ]
1892
- }
1893
- )
1894
- },
1895
- index
1896
- )) });
1897
- }
1898
- function ReadablesTab({ context }) {
1899
- const readables = context.getAllContext();
1900
- if (readables.length === 0) {
1901
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
1902
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No readable context available" }),
1903
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Readable context will appear here when provided" })
1904
- ] });
1905
- }
1906
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: readables.map((readable, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1907
- "div",
1908
- {
1909
- style: {
1910
- backgroundColor: "white",
1911
- padding: "16px",
1912
- borderRadius: "8px",
1913
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
1914
- border: "1px solid #e5e7eb"
1915
- },
1916
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1917
- "div",
1918
- {
1919
- style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
1920
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1 }, children: [
1921
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: readable.name || `Readable ${index + 1}` }),
1922
- readable.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: readable.description }),
1923
- readable.value && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1924
- "pre",
1925
- {
1926
- style: {
1927
- marginTop: "12px",
1928
- padding: "8px",
1929
- backgroundColor: "#f9fafb",
1930
- borderRadius: "4px",
1931
- fontSize: "12px",
1932
- overflowX: "auto",
1933
- margin: "12px 0 0 0"
1934
- },
1935
- children: JSON.stringify(readable.value, null, 2)
1936
- }
1937
- )
1938
- ] })
1939
- }
1940
- )
1941
- },
1942
- index
1943
- )) });
1944
- }
1945
- function AgentStatusTab({ context }) {
1946
- const agentStates = context.coagentStates || {};
1947
- const agentStateEntries = Object.entries(agentStates);
1948
- if (agentStateEntries.length === 0) {
1949
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
1950
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No agent states available" }),
1951
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Agent states will appear here when agents are active" })
1952
- ] });
1953
- }
1954
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: agentStateEntries.map(([agentName, state]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1955
- "div",
1956
- {
1957
- style: {
1958
- backgroundColor: "white",
1959
- padding: "24px",
1960
- borderRadius: "8px",
1961
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
1962
- border: "1px solid #e5e7eb"
1963
- },
1964
- children: [
1965
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1966
- "div",
1967
- {
1968
- style: {
1969
- display: "flex",
1970
- alignItems: "center",
1971
- justifyContent: "space-between",
1972
- marginBottom: "16px"
1973
- },
1974
- children: [
1975
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", fontSize: "18px", color: "#1f2937", margin: 0 }, children: agentName }),
1976
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1977
- "span",
1978
- {
1979
- style: {
1980
- padding: "4px 12px",
1981
- borderRadius: "9999px",
1982
- fontSize: "12px",
1983
- fontWeight: "500",
1984
- backgroundColor: state.status === "running" ? "#dcfce7" : state.status === "complete" ? "#dbeafe" : "#f3f4f6",
1985
- color: state.status === "running" ? "#166534" : state.status === "complete" ? "#1e40af" : "#1f2937"
1986
- },
1987
- children: state.status || "idle"
1988
- }
1989
- )
1990
- ]
1991
- }
1992
- ),
1993
- state.state && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginBottom: "12px" }, children: [
1994
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1995
- "p",
1996
- {
1997
- style: {
1998
- fontSize: "12px",
1999
- fontWeight: "500",
2000
- color: "#6b7280",
2001
- textTransform: "uppercase",
2002
- margin: "0 0 4px 0"
2003
- },
2004
- children: "Current State:"
2005
- }
2006
- ),
2007
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2008
- "pre",
2009
- {
2010
- style: {
2011
- padding: "12px",
2012
- backgroundColor: "#f9fafb",
2013
- borderRadius: "4px",
2014
- fontSize: "12px",
2015
- overflowX: "auto",
2016
- margin: 0
2017
- },
2018
- children: JSON.stringify(state.state, null, 2)
2019
- }
2020
- )
2021
- ] }),
2022
- state.running && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2023
- "div",
2024
- {
2025
- style: {
2026
- marginTop: "16px",
2027
- display: "flex",
2028
- alignItems: "center",
2029
- fontSize: "14px",
2030
- color: "#4b5563"
2031
- },
2032
- children: [
2033
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2034
- "svg",
2035
- {
2036
- width: "16",
2037
- height: "16",
2038
- viewBox: "0 0 16 16",
2039
- style: { animation: "spin 1s linear infinite" },
2040
- children: [
2041
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("style", { children: `@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` }),
2042
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2043
- "circle",
2044
- {
2045
- cx: "8",
2046
- cy: "8",
2047
- r: "6",
2048
- fill: "none",
2049
- stroke: "#4b5563",
2050
- strokeWidth: "2",
2051
- strokeDasharray: "9 3"
2052
- }
2053
- )
2054
- ]
2055
- }
2056
- ) }),
2057
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Agent is currently running..." })
2058
- ]
2059
- }
2060
- )
2061
- ]
2062
- },
2063
- agentName
2064
- )) });
2065
- }
2066
- function MessagesTab({ messagesContext }) {
2067
- const messages = messagesContext.messages || [];
2068
- if (messages.length === 0) {
2069
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
2070
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No messages yet" }),
2071
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Messages will appear here as the conversation progresses" })
2072
- ] });
2073
- }
2074
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2075
- "div",
2076
- {
2077
- style: {
2078
- padding: "16px",
2079
- borderRadius: "8px",
2080
- backgroundColor: message.role === "user" ? "#eff6ff" : message.role === "assistant" ? "#f9fafb" : "#fefce8",
2081
- border: `1px solid ${message.role === "user" ? "#c7d2fe" : message.role === "assistant" ? "#e5e7eb" : "#fde047"}`,
2082
- marginLeft: message.role === "user" ? "48px" : "0",
2083
- marginRight: message.role === "assistant" ? "48px" : "0"
2084
- },
2085
- children: [
2086
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2087
- "div",
2088
- {
2089
- style: {
2090
- display: "flex",
2091
- alignItems: "flex-start",
2092
- justifyContent: "space-between",
2093
- marginBottom: "8px"
2094
- },
2095
- children: [
2096
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2097
- "span",
2098
- {
2099
- style: {
2100
- fontWeight: "500",
2101
- fontSize: "14px",
2102
- color: "#374151",
2103
- textTransform: "capitalize"
2104
- },
2105
- children: message.role || "system"
2106
- }
2107
- ),
2108
- message.timestamp && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: "12px", color: "#6b7280" }, children: new Date(message.timestamp).toLocaleTimeString() })
2109
- ]
2110
- }
2111
- ),
2112
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#1f2937", whiteSpace: "pre-wrap" }, children: message.content || "" })
2113
- ]
2114
- },
2115
- index
2116
- )) });
2117
- }
2118
- function ContextTab({ context }) {
2119
- const documents = context.getDocumentsContext([]);
2120
- if (documents.length === 0) {
2121
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
2122
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No document context available" }),
2123
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Document context will appear here when provided" })
2124
- ] });
2125
- }
2126
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: documents.map((doc, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2127
- "div",
2128
- {
2129
- style: {
2130
- backgroundColor: "white",
2131
- padding: "16px",
2132
- borderRadius: "8px",
2133
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
2134
- border: "1px solid #e5e7eb"
2135
- },
2136
- children: [
2137
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 8px 0" }, children: doc.name || `Document ${index + 1}` }),
2138
- doc.content && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2139
- "pre",
2140
- {
2141
- style: {
2142
- padding: "12px",
2143
- backgroundColor: "#f9fafb",
2144
- borderRadius: "4px",
2145
- fontSize: "12px",
2146
- overflowX: "auto",
2147
- margin: 0
2148
- },
2149
- children: doc.content
2150
- }
2151
- )
2152
- ]
2153
- },
2154
- index
2155
- )) });
2156
- }
2157
-
2158
- // src/components/dev-console/console-trigger.tsx
2159
- var import_jsx_runtime9 = require("react/jsx-runtime");
2160
- var INSPECTOR_HIDE_KEY = "cpk:inspector:hidden";
2161
- function ConsoleTrigger({ position = "bottom-right" }) {
2162
- const context = useCopilotContext();
2163
- const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);
2164
- const [isModalOpen, setIsModalOpen] = (0, import_react10.useState)(false);
2165
- const [isHovered, setIsHovered] = (0, import_react10.useState)(false);
2166
- const [isDragging, setIsDragging] = (0, import_react10.useState)(false);
2167
- const [buttonPosition, setButtonPosition] = (0, import_react10.useState)(null);
2168
- const [mounted, setMounted] = (0, import_react10.useState)(false);
2169
- const [isHidden, setIsHidden] = (0, import_react10.useState)(false);
2170
- const dragRef = (0, import_react10.useRef)(null);
2171
- const buttonRef = (0, import_react10.useRef)(null);
2172
- (0, import_react10.useEffect)(() => {
2173
- setMounted(true);
2174
- try {
2175
- const hidden = typeof window !== "undefined" ? localStorage.getItem(INSPECTOR_HIDE_KEY) : null;
2176
- if (hidden === "1" || hidden === "true") {
2177
- setIsHidden(true);
2178
- }
2179
- } catch (e) {
2180
- }
2181
- if (typeof window !== "undefined" && !buttonPosition) {
2182
- const buttonSize = 60;
2183
- const margin = 24;
2184
- const initialPosition = {
2185
- x: margin,
2186
- y: window.innerHeight - buttonSize - margin
2187
- };
2188
- setButtonPosition(initialPosition);
2189
- }
2190
- }, [position]);
2191
- const handleMouseDown = (e) => {
2192
- e.preventDefault();
2193
- if (!buttonPosition)
2194
- return;
2195
- dragRef.current = {
2196
- startX: e.clientX,
2197
- startY: e.clientY,
2198
- buttonX: buttonPosition.x,
2199
- buttonY: buttonPosition.y
2200
- };
2201
- setIsDragging(true);
2202
- };
2203
- (0, import_react10.useEffect)(() => {
2204
- if (!isDragging)
2205
- return;
2206
- const handleMouseMove = (e) => {
2207
- e.preventDefault();
2208
- e.stopPropagation();
2209
- if (!dragRef.current)
2210
- return;
2211
- const deltaX = e.clientX - dragRef.current.startX;
2212
- const deltaY = e.clientY - dragRef.current.startY;
2213
- let newX = dragRef.current.buttonX + deltaX;
2214
- let newY = dragRef.current.buttonY + deltaY;
2215
- newX = Math.max(0, Math.min(newX, window.innerWidth - 60));
2216
- newY = Math.max(0, Math.min(newY, window.innerHeight - 60));
2217
- setButtonPosition({ x: newX, y: newY });
2218
- };
2219
- const handleMouseUp = (e) => {
2220
- e.preventDefault();
2221
- e.stopPropagation();
2222
- setIsDragging(false);
2223
- dragRef.current = null;
2224
- };
2225
- document.addEventListener("mousemove", handleMouseMove, { capture: true, passive: false });
2226
- document.addEventListener("mouseup", handleMouseUp, { capture: true, passive: false });
2227
- return () => {
2228
- document.removeEventListener("mousemove", handleMouseMove, { capture: true });
2229
- document.removeEventListener("mouseup", handleMouseUp, { capture: true });
2230
- };
2231
- }, [isDragging]);
2232
- if (!mounted || !buttonPosition || isHidden) {
2233
- return null;
2234
- }
2235
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2236
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2237
- "button",
2238
- {
2239
- ref: buttonRef,
2240
- onClick: (e) => {
2241
- if (!isDragging) {
2242
- if (e.metaKey || e.altKey) {
2243
- try {
2244
- localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
2245
- } catch (e2) {
2246
- }
2247
- setIsHidden(true);
2248
- return;
2249
- }
2250
- setIsModalOpen(true);
2251
- }
2252
- },
2253
- onContextMenu: (e) => {
2254
- e.preventDefault();
2255
- try {
2256
- localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
2257
- } catch (e2) {
2258
- }
2259
- setIsHidden(true);
2260
- },
2261
- onMouseDown: handleMouseDown,
2262
- onMouseEnter: () => setIsHovered(true),
2263
- onMouseLeave: () => setIsHovered(false),
2264
- style: {
2265
- position: "fixed",
2266
- left: `${buttonPosition.x}px`,
2267
- top: `${buttonPosition.y}px`,
2268
- zIndex: 2147483647,
2269
- width: "60px",
2270
- height: "60px",
2271
- background: isDragging ? "#000000" : isHovered ? "#111111" : "#000000",
2272
- color: "white",
2273
- borderRadius: "50%",
2274
- boxShadow: isDragging ? "0 8px 32px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4)" : isHovered ? "0 12px 40px rgba(0, 0, 0, 0.7), 0 6px 20px rgba(0, 0, 0, 0.5)" : "0 6px 20px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3)",
2275
- transition: isDragging ? "none" : "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
2276
- display: "flex",
2277
- alignItems: "center",
2278
- justifyContent: "center",
2279
- border: "none",
2280
- cursor: isDragging ? "grabbing" : "grab",
2281
- opacity: 1,
2282
- userSelect: "none",
2283
- transform: isDragging ? "scale(1.05)" : isHovered ? "scale(1.1)" : "scale(1)",
2284
- backdropFilter: "blur(10px)",
2285
- pointerEvents: "auto",
2286
- isolation: "isolate"
2287
- },
2288
- title: hasApiKey ? "Open Inspector (Drag to move)" : "Inspector (License Key Required, Drag to move)",
2289
- children: [
2290
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2291
- "div",
2292
- {
2293
- onClick: (e) => {
2294
- e.preventDefault();
2295
- e.stopPropagation();
2296
- try {
2297
- localStorage.setItem(INSPECTOR_HIDE_KEY, "1");
2298
- } catch (e2) {
2299
- }
2300
- setIsHidden(true);
2301
- },
2302
- style: {
2303
- position: "absolute",
2304
- bottom: "2px",
2305
- right: "2px",
2306
- width: "20px",
2307
- height: "20px",
2308
- borderRadius: "50%",
2309
- background: "#ffffff",
2310
- color: "#ef4444",
2311
- fontSize: "14px",
2312
- lineHeight: "18px",
2313
- textAlign: "center",
2314
- boxShadow: "0 2px 6px rgba(0,0,0,0.35)",
2315
- cursor: "pointer",
2316
- border: "1px solid #e5e7eb",
2317
- display: "flex",
2318
- alignItems: "center",
2319
- justifyContent: "center",
2320
- zIndex: 1
2321
- },
2322
- title: "Hide Inspector",
2323
- children: "\xD7"
2324
- }
2325
- ),
2326
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2327
- "div",
2328
- {
2329
- style: {
2330
- width: "28px",
2331
- height: "28px",
2332
- display: "flex",
2333
- alignItems: "center",
2334
- justifyContent: "center",
2335
- filter: "drop-shadow(0 2px 4px rgba(0,0,0,0.2))"
2336
- },
2337
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotKitIcon, {})
2338
- }
2339
- ),
2340
- !hasApiKey && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2341
- "div",
2342
- {
2343
- style: {
2344
- position: "absolute",
2345
- top: "-2px",
2346
- right: "-2px",
2347
- width: "18px",
2348
- height: "18px",
2349
- background: "linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%)",
2350
- borderRadius: "50%",
2351
- display: "flex",
2352
- alignItems: "center",
2353
- justifyContent: "center",
2354
- boxShadow: "0 2px 8px rgba(255, 107, 107, 0.4)",
2355
- border: "2px solid white"
2356
- },
2357
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: "10px", color: "white", fontWeight: "bold" }, children: "!" })
2358
- }
2359
- )
2360
- ]
2361
- }
2362
- ),
2363
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2364
- DeveloperConsoleModal,
2365
- {
2366
- isOpen: isModalOpen,
2367
- onClose: () => setIsModalOpen(false),
2368
- hasApiKey
2369
- }
2370
- )
2371
- ] });
2372
- }
2373
-
2374
1352
  // src/context/coagent-state-renders-context.tsx
2375
- var import_react11 = require("react");
2376
- var import_jsx_runtime10 = require("react/jsx-runtime");
2377
- var CoAgentStateRendersContext = (0, import_react11.createContext)(
1353
+ var import_react9 = require("react");
1354
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1355
+ var CoAgentStateRendersContext = (0, import_react9.createContext)(
2378
1356
  void 0
2379
1357
  );
2380
1358
  function CoAgentStateRendersProvider({ children }) {
2381
- const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react11.useState)({});
2382
- const setCoAgentStateRender = (0, import_react11.useCallback)((id, stateRender) => {
1359
+ const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react9.useState)({});
1360
+ const setCoAgentStateRender = (0, import_react9.useCallback)((id, stateRender) => {
2383
1361
  setCoAgentStateRenders((prevPoints) => __spreadProps(__spreadValues({}, prevPoints), {
2384
1362
  [id]: stateRender
2385
1363
  }));
2386
1364
  }, []);
2387
- const removeCoAgentStateRender = (0, import_react11.useCallback)((id) => {
1365
+ const removeCoAgentStateRender = (0, import_react9.useCallback)((id) => {
2388
1366
  setCoAgentStateRenders((prevPoints) => {
2389
1367
  const newPoints = __spreadValues({}, prevPoints);
2390
1368
  delete newPoints[id];
2391
1369
  return newPoints;
2392
1370
  });
2393
1371
  }, []);
2394
- const claimsRef = (0, import_react11.useRef)({});
2395
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1372
+ const claimsRef = (0, import_react9.useRef)({});
1373
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2396
1374
  CoAgentStateRendersContext.Provider,
2397
1375
  {
2398
1376
  value: {
@@ -2406,7 +1384,7 @@ function CoAgentStateRendersProvider({ children }) {
2406
1384
  );
2407
1385
  }
2408
1386
  function useCoAgentStateRenders() {
2409
- const context = (0, import_react11.useContext)(CoAgentStateRendersContext);
1387
+ const context = (0, import_react9.useContext)(CoAgentStateRendersContext);
2410
1388
  if (!context) {
2411
1389
  throw new Error("useCoAgentStateRenders must be used within CoAgentStateRendersProvider");
2412
1390
  }
@@ -2414,18 +1392,18 @@ function useCoAgentStateRenders() {
2414
1392
  }
2415
1393
 
2416
1394
  // src/hooks/use-coagent-state-render-bridge.tsx
2417
- var import_react13 = require("@copilotkitnext/react");
2418
- var import_react14 = require("react");
1395
+ var import_react11 = require("@copilotkitnext/react");
1396
+ var import_react12 = require("react");
2419
1397
 
2420
1398
  // src/context/threads-context.tsx
2421
- var import_react12 = require("react");
2422
- var import_shared9 = require("@copilotkit/shared");
2423
- var import_jsx_runtime11 = require("react/jsx-runtime");
2424
- var ThreadsContext = (0, import_react12.createContext)(void 0);
1399
+ var import_react10 = require("react");
1400
+ var import_shared8 = require("@copilotkit/shared");
1401
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1402
+ var ThreadsContext = (0, import_react10.createContext)(void 0);
2425
1403
  function ThreadsProvider({ children, threadId: explicitThreadId }) {
2426
- const [internalThreadId, setThreadId] = (0, import_react12.useState)(explicitThreadId != null ? explicitThreadId : (0, import_shared9.randomUUID)());
1404
+ const [internalThreadId, setThreadId] = (0, import_react10.useState)(explicitThreadId != null ? explicitThreadId : (0, import_shared8.randomUUID)());
2427
1405
  const threadId = internalThreadId;
2428
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1406
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2429
1407
  ThreadsContext.Provider,
2430
1408
  {
2431
1409
  value: {
@@ -2437,7 +1415,7 @@ function ThreadsProvider({ children, threadId: explicitThreadId }) {
2437
1415
  );
2438
1416
  }
2439
1417
  function useThreads() {
2440
- const context = (0, import_react12.useContext)(ThreadsContext);
1418
+ const context = (0, import_react10.useContext)(ThreadsContext);
2441
1419
  if (!context) {
2442
1420
  throw new Error("useThreads must be used within ThreadsProvider");
2443
1421
  }
@@ -2445,7 +1423,7 @@ function useThreads() {
2445
1423
  }
2446
1424
 
2447
1425
  // src/hooks/use-coagent-state-render-bridge.tsx
2448
- var import_shared10 = require("@copilotkit/shared");
1426
+ var import_shared9 = require("@copilotkit/shared");
2449
1427
  function getStateWithoutConstantKeys(state) {
2450
1428
  if (!state)
2451
1429
  return {};
@@ -2471,11 +1449,11 @@ function useCoagentStateRenderBridge(agentId, props) {
2471
1449
  var _a;
2472
1450
  const { stateSnapshot, messageIndexInRun, message } = props;
2473
1451
  const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
2474
- const { agent } = (0, import_react13.useAgent)({ agentId });
2475
- const [nodeName, setNodeName] = (0, import_react14.useState)(void 0);
1452
+ const { agent } = (0, import_react11.useAgent)({ agentId });
1453
+ const [nodeName, setNodeName] = (0, import_react12.useState)(void 0);
2476
1454
  const runId = (_a = props.runId) != null ? _a : message.runId;
2477
1455
  const effectiveRunId = runId || "pending";
2478
- (0, import_react14.useEffect)(() => {
1456
+ (0, import_react12.useEffect)(() => {
2479
1457
  if (!agent)
2480
1458
  return;
2481
1459
  const subscriber = {
@@ -2495,7 +1473,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2495
1473
  unsubscribe();
2496
1474
  };
2497
1475
  }, [agentId, nodeName]);
2498
- const getStateRender = (0, import_react14.useCallback)(
1476
+ const getStateRender = (0, import_react12.useCallback)(
2499
1477
  (messageId) => {
2500
1478
  return Object.entries(coAgentStateRenders).find(([stateRenderId, stateRender]) => {
2501
1479
  if (claimsRef.current[messageId]) {
@@ -2522,7 +1500,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2522
1500
  return canRender;
2523
1501
  }
2524
1502
  const renderClaimedByOtherMessage = Object.values(claimsRef.current).find(
2525
- (c) => c.stateRenderId === stateRenderId && (0, import_shared10.dataToUUID)(getStateWithoutConstantKeys(c.stateSnapshot)) === (0, import_shared10.dataToUUID)(getStateWithoutConstantKeys(renderSnapshot))
1503
+ (c) => c.stateRenderId === stateRenderId && (0, import_shared9.dataToUUID)(getStateWithoutConstantKeys(c.stateSnapshot)) === (0, import_shared9.dataToUUID)(getStateWithoutConstantKeys(renderSnapshot))
2526
1504
  );
2527
1505
  if (renderClaimedByOtherMessage) {
2528
1506
  if (renderSnapshot && renderClaimedByOtherMessage.stateSnapshot && !areStatesEquals(renderClaimedByOtherMessage.stateSnapshot, renderSnapshot)) {
@@ -2537,7 +1515,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2537
1515
  claimsRef.current[messageId] = { stateRenderId, runId: runId2 };
2538
1516
  return true;
2539
1517
  };
2540
- return (0, import_react14.useMemo)(() => {
1518
+ return (0, import_react12.useMemo)(() => {
2541
1519
  var _a2, _b, _c;
2542
1520
  if (messageIndexInRun !== 0) {
2543
1521
  return null;
@@ -2546,7 +1524,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2546
1524
  if (!stateRender || !stateRenderId) {
2547
1525
  return null;
2548
1526
  }
2549
- const snapshot = stateSnapshot ? (0, import_shared10.parseJson)(stateSnapshot, stateSnapshot) : agent == null ? void 0 : agent.state;
1527
+ const snapshot = stateSnapshot ? (0, import_shared9.parseJson)(stateSnapshot, stateSnapshot) : agent == null ? void 0 : agent.state;
2550
1528
  const canRender = handleRenderRequest({
2551
1529
  stateRenderId,
2552
1530
  messageId: message.id,
@@ -2566,7 +1544,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2566
1544
  }
2567
1545
  if (stateRender.handler) {
2568
1546
  stateRender.handler({
2569
- state: stateSnapshot ? (0, import_shared10.parseJson)(stateSnapshot, stateSnapshot) : (_b = agent == null ? void 0 : agent.state) != null ? _b : {},
1547
+ state: stateSnapshot ? (0, import_shared9.parseJson)(stateSnapshot, stateSnapshot) : (_b = agent == null ? void 0 : agent.state) != null ? _b : {},
2570
1548
  nodeName: nodeName != null ? nodeName : ""
2571
1549
  });
2572
1550
  }
@@ -2597,13 +1575,13 @@ function CoAgentStateRenderBridge(props) {
2597
1575
  }
2598
1576
 
2599
1577
  // src/components/CopilotListeners.tsx
2600
- var import_react15 = require("react");
2601
- var import_react16 = require("@copilotkitnext/react");
1578
+ var import_react13 = require("react");
1579
+ var import_react14 = require("@copilotkitnext/react");
1580
+ var import_shared10 = require("@copilotkit/shared");
2602
1581
  var import_shared11 = require("@copilotkit/shared");
2603
- var import_shared12 = require("@copilotkit/shared");
2604
1582
  var usePredictStateSubscription = (agent) => {
2605
- const predictStateToolsRef = (0, import_react15.useRef)([]);
2606
- const getSubscriber = (0, import_react15.useCallback)(
1583
+ const predictStateToolsRef = (0, import_react13.useRef)([]);
1584
+ const getSubscriber = (0, import_react13.useCallback)(
2607
1585
  (agent2) => ({
2608
1586
  onCustomEvent: ({ event }) => {
2609
1587
  if (event.name === "PredictState") {
@@ -2614,7 +1592,7 @@ var usePredictStateSubscription = (agent) => {
2614
1592
  predictStateToolsRef.current.forEach((t) => {
2615
1593
  if ((t == null ? void 0 : t.tool) !== toolCallName)
2616
1594
  return;
2617
- const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared11.parseJson)(partialToolCallArgs, partialToolCallArgs) : partialToolCallArgs;
1595
+ const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared10.parseJson)(partialToolCallArgs, partialToolCallArgs) : partialToolCallArgs;
2618
1596
  agent2.setState({
2619
1597
  [t.state_key]: emittedState[t.state_key]
2620
1598
  });
@@ -2623,7 +1601,7 @@ var usePredictStateSubscription = (agent) => {
2623
1601
  }),
2624
1602
  []
2625
1603
  );
2626
- (0, import_react15.useEffect)(() => {
1604
+ (0, import_react13.useEffect)(() => {
2627
1605
  if (!agent)
2628
1606
  return;
2629
1607
  const subscriber = getSubscriber(agent);
@@ -2634,16 +1612,16 @@ var usePredictStateSubscription = (agent) => {
2634
1612
  }, [agent, getSubscriber]);
2635
1613
  };
2636
1614
  function CopilotListeners() {
2637
- const { copilotkit } = (0, import_react16.useCopilotKit)();
2638
- const existingConfig = (0, import_react16.useCopilotChatConfiguration)();
1615
+ const { copilotkit } = (0, import_react14.useCopilotKit)();
1616
+ const existingConfig = (0, import_react14.useCopilotChatConfiguration)();
2639
1617
  const resolvedAgentId = existingConfig == null ? void 0 : existingConfig.agentId;
2640
1618
  const { setBannerError } = useToast();
2641
- const { agent } = (0, import_react16.useAgent)({ agentId: resolvedAgentId });
1619
+ const { agent } = (0, import_react14.useAgent)({ agentId: resolvedAgentId });
2642
1620
  usePredictStateSubscription(agent);
2643
- (0, import_react15.useEffect)(() => {
1621
+ (0, import_react13.useEffect)(() => {
2644
1622
  const subscriber = {
2645
1623
  onError: ({ error }) => {
2646
- setBannerError(new import_shared12.CopilotKitLowLevelError({ error, message: error.message }));
1624
+ setBannerError(new import_shared11.CopilotKitLowLevelError({ error, message: error.message }));
2647
1625
  }
2648
1626
  };
2649
1627
  const subscription = copilotkit.subscribe(subscriber);
@@ -2655,56 +1633,65 @@ function CopilotListeners() {
2655
1633
  }
2656
1634
 
2657
1635
  // src/components/copilot-provider/copilotkit.tsx
2658
- var import_jsx_runtime12 = require("react/jsx-runtime");
1636
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2659
1637
  function CopilotKit(_a) {
2660
1638
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
2661
1639
  const enabled = shouldShowDevConsole(props.showDevConsole);
1640
+ const showInspector = shouldShowDevConsole(props.enableInspector);
2662
1641
  const publicApiKey = props.publicApiKey || props.publicLicenseKey;
2663
- const renderArr = (0, import_react17.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
2664
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react18.CopilotKitProvider, __spreadProps(__spreadValues({}, props), { renderCustomMessages: renderArr, useSingleEndpoint: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) })) }) }) });
1642
+ const renderArr = (0, import_react15.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
1643
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1644
+ import_react16.CopilotKitProvider,
1645
+ __spreadProps(__spreadValues({}, props), {
1646
+ showDevConsole: showInspector,
1647
+ renderCustomMessages: renderArr,
1648
+ useSingleEndpoint: true,
1649
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
1650
+ })
1651
+ ) }) }) });
2665
1652
  }
2666
1653
  function CopilotKitInternal(cpkProps) {
2667
1654
  var _b;
2668
1655
  const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
2669
1656
  validateProps(cpkProps);
2670
1657
  const publicApiKey = props.publicLicenseKey || props.publicApiKey;
2671
- const chatApiEndpoint = props.runtimeUrl || import_shared13.COPILOT_CLOUD_CHAT_URL;
2672
- const [actions, setActions] = (0, import_react17.useState)({});
2673
- const [registeredActionConfigs, setRegisteredActionConfigs] = (0, import_react17.useState)(/* @__PURE__ */ new Map());
2674
- const chatComponentsCache = (0, import_react17.useRef)({
1658
+ const chatApiEndpoint = props.runtimeUrl || import_shared12.COPILOT_CLOUD_CHAT_URL;
1659
+ const [actions, setActions] = (0, import_react15.useState)({});
1660
+ const [registeredActionConfigs, setRegisteredActionConfigs] = (0, import_react15.useState)(/* @__PURE__ */ new Map());
1661
+ const chatComponentsCache = (0, import_react15.useRef)({
2675
1662
  actions: {},
2676
1663
  coAgentStateRenders: {}
2677
1664
  });
2678
1665
  const { addElement, removeElement, printTree, getAllElements } = use_tree_default();
2679
- const [isLoading, setIsLoading] = (0, import_react17.useState)(false);
2680
- const [chatInstructions, setChatInstructions] = (0, import_react17.useState)("");
2681
- const [authStates, setAuthStates] = (0, import_react17.useState)({});
2682
- const [extensions, setExtensions] = (0, import_react17.useState)({});
2683
- const [additionalInstructions, setAdditionalInstructions] = (0, import_react17.useState)([]);
1666
+ const [isLoading, setIsLoading] = (0, import_react15.useState)(false);
1667
+ const [chatInstructions, setChatInstructions] = (0, import_react15.useState)("");
1668
+ const [authStates, setAuthStates] = (0, import_react15.useState)({});
1669
+ const [extensions, setExtensions] = (0, import_react15.useState)({});
1670
+ const [additionalInstructions, setAdditionalInstructions] = (0, import_react15.useState)([]);
2684
1671
  const {
2685
1672
  addElement: addDocument,
2686
1673
  removeElement: removeDocument,
2687
1674
  allElements: allDocuments
2688
1675
  } = use_flat_category_store_default();
2689
- const setAction = (0, import_react17.useCallback)((id, action) => {
1676
+ const setAction = (0, import_react15.useCallback)((id, action) => {
2690
1677
  setActions((prevPoints) => {
2691
1678
  return __spreadProps(__spreadValues({}, prevPoints), {
2692
1679
  [id]: action
2693
1680
  });
2694
1681
  });
2695
1682
  }, []);
2696
- const removeAction = (0, import_react17.useCallback)((id) => {
1683
+ const removeAction = (0, import_react15.useCallback)((id) => {
2697
1684
  setActions((prevPoints) => {
2698
1685
  const newPoints = __spreadValues({}, prevPoints);
2699
1686
  delete newPoints[id];
2700
1687
  return newPoints;
2701
1688
  });
2702
1689
  }, []);
2703
- const getContextString = (0, import_react17.useCallback)(
1690
+ const getContextString = (0, import_react15.useCallback)(
2704
1691
  (documents, categories) => {
2705
- const documentsString = documents.map((document2) => {
2706
- return `${document2.name} (${document2.sourceApplication}):
2707
- ${document2.getContents()}`;
1692
+ const documentsString = documents.map((document) => {
1693
+ return `${document.name} (${document.sourceApplication}):
1694
+ ${document.getContents()}`;
2708
1695
  }).join("\n\n");
2709
1696
  const nonDocumentStrings = printTree(categories);
2710
1697
  return `${documentsString}
@@ -2713,46 +1700,46 @@ ${nonDocumentStrings}`;
2713
1700
  },
2714
1701
  [printTree]
2715
1702
  );
2716
- const addContext = (0, import_react17.useCallback)(
1703
+ const addContext = (0, import_react15.useCallback)(
2717
1704
  (context, parentId, categories = defaultCopilotContextCategories) => {
2718
1705
  return addElement(context, categories, parentId);
2719
1706
  },
2720
1707
  [addElement]
2721
1708
  );
2722
- const removeContext = (0, import_react17.useCallback)(
1709
+ const removeContext = (0, import_react15.useCallback)(
2723
1710
  (id) => {
2724
1711
  removeElement(id);
2725
1712
  },
2726
1713
  [removeElement]
2727
1714
  );
2728
- const getAllContext = (0, import_react17.useCallback)(() => {
1715
+ const getAllContext = (0, import_react15.useCallback)(() => {
2729
1716
  return getAllElements();
2730
1717
  }, [getAllElements]);
2731
- const getFunctionCallHandler = (0, import_react17.useCallback)(
1718
+ const getFunctionCallHandler = (0, import_react15.useCallback)(
2732
1719
  (customEntryPoints) => {
2733
1720
  return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || actions));
2734
1721
  },
2735
1722
  [actions]
2736
1723
  );
2737
- const getDocumentsContext = (0, import_react17.useCallback)(
1724
+ const getDocumentsContext = (0, import_react15.useCallback)(
2738
1725
  (categories) => {
2739
1726
  return allDocuments(categories);
2740
1727
  },
2741
1728
  [allDocuments]
2742
1729
  );
2743
- const addDocumentContext = (0, import_react17.useCallback)(
1730
+ const addDocumentContext = (0, import_react15.useCallback)(
2744
1731
  (documentPointer, categories = defaultCopilotContextCategories) => {
2745
1732
  return addDocument(documentPointer, categories);
2746
1733
  },
2747
1734
  [addDocument]
2748
1735
  );
2749
- const removeDocumentContext = (0, import_react17.useCallback)(
1736
+ const removeDocumentContext = (0, import_react15.useCallback)(
2750
1737
  (documentId) => {
2751
1738
  removeDocument(documentId);
2752
1739
  },
2753
1740
  [removeDocument]
2754
1741
  );
2755
- const copilotApiConfig = (0, import_react17.useMemo)(() => {
1742
+ const copilotApiConfig = (0, import_react15.useMemo)(() => {
2756
1743
  var _a2, _b2;
2757
1744
  let cloud = void 0;
2758
1745
  if (publicApiKey) {
@@ -2788,7 +1775,7 @@ ${nonDocumentStrings}`;
2788
1775
  props.cloudRestrictToTopic,
2789
1776
  props.guardrails_c
2790
1777
  ]);
2791
- const headers = (0, import_react17.useMemo)(() => {
1778
+ const headers = (0, import_react15.useMemo)(() => {
2792
1779
  const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
2793
1780
  if (state.status === "authenticated" && state.authHeaders) {
2794
1781
  return __spreadValues(__spreadValues({}, acc), Object.entries(state.authHeaders).reduce(
@@ -2800,27 +1787,27 @@ ${nonDocumentStrings}`;
2800
1787
  }
2801
1788
  return acc;
2802
1789
  }, {});
2803
- return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [import_shared13.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {}), authHeaders);
1790
+ return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [import_shared12.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {}), authHeaders);
2804
1791
  }, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
2805
- const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react17.useState)({});
2806
- const setInternalErrorHandler = (0, import_react17.useCallback)((handler) => {
1792
+ const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react15.useState)({});
1793
+ const setInternalErrorHandler = (0, import_react15.useCallback)((handler) => {
2807
1794
  _setInternalErrorHandler((prev) => __spreadValues(__spreadValues({}, prev), handler));
2808
1795
  }, []);
2809
- const removeInternalErrorHandler = (0, import_react17.useCallback)((key) => {
1796
+ const removeInternalErrorHandler = (0, import_react15.useCallback)((key) => {
2810
1797
  _setInternalErrorHandler((prev) => {
2811
1798
  const _a2 = prev, { [key]: _removed } = _a2, rest = __objRest(_a2, [__restKey(key)]);
2812
1799
  return rest;
2813
1800
  });
2814
1801
  }, []);
2815
- const onErrorRef = (0, import_react17.useRef)(props.onError);
2816
- (0, import_react17.useEffect)(() => {
1802
+ const onErrorRef = (0, import_react15.useRef)(props.onError);
1803
+ (0, import_react15.useEffect)(() => {
2817
1804
  onErrorRef.current = props.onError;
2818
1805
  }, [props.onError]);
2819
- const internalHandlersRef = (0, import_react17.useRef)({});
2820
- (0, import_react17.useEffect)(() => {
1806
+ const internalHandlersRef = (0, import_react15.useRef)({});
1807
+ (0, import_react15.useEffect)(() => {
2821
1808
  internalHandlersRef.current = internalErrorHandlers;
2822
1809
  }, [internalErrorHandlers]);
2823
- const handleErrors = (0, import_react17.useCallback)(
1810
+ const handleErrors = (0, import_react15.useCallback)(
2824
1811
  (error) => __async(this, null, function* () {
2825
1812
  if (copilotApiConfig.publicApiKey && onErrorRef.current) {
2826
1813
  try {
@@ -2840,14 +1827,14 @@ ${nonDocumentStrings}`;
2840
1827
  }),
2841
1828
  [copilotApiConfig.publicApiKey]
2842
1829
  );
2843
- const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react17.useState)({});
2844
- const addChatSuggestionConfiguration = (0, import_react17.useCallback)(
1830
+ const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react15.useState)({});
1831
+ const addChatSuggestionConfiguration = (0, import_react15.useCallback)(
2845
1832
  (id, suggestion) => {
2846
1833
  setChatSuggestionConfiguration((prev) => __spreadProps(__spreadValues({}, prev), { [id]: suggestion }));
2847
1834
  },
2848
1835
  [setChatSuggestionConfiguration]
2849
1836
  );
2850
- const removeChatSuggestionConfiguration = (0, import_react17.useCallback)(
1837
+ const removeChatSuggestionConfiguration = (0, import_react15.useCallback)(
2851
1838
  (id) => {
2852
1839
  setChatSuggestionConfiguration((prev) => {
2853
1840
  const _a2 = prev, { [id]: _ } = _a2, rest = __objRest(_a2, [__restKey(id)]);
@@ -2856,10 +1843,10 @@ ${nonDocumentStrings}`;
2856
1843
  },
2857
1844
  [setChatSuggestionConfiguration]
2858
1845
  );
2859
- const [availableAgents, setAvailableAgents] = (0, import_react17.useState)([]);
2860
- const [coagentStates, setCoagentStates] = (0, import_react17.useState)({});
2861
- const coagentStatesRef = (0, import_react17.useRef)({});
2862
- const setCoagentStatesWithRef = (0, import_react17.useCallback)(
1846
+ const [availableAgents, setAvailableAgents] = (0, import_react15.useState)([]);
1847
+ const [coagentStates, setCoagentStates] = (0, import_react15.useState)({});
1848
+ const coagentStatesRef = (0, import_react15.useRef)({});
1849
+ const setCoagentStatesWithRef = (0, import_react15.useCallback)(
2863
1850
  (value) => {
2864
1851
  const newValue = typeof value === "function" ? value(coagentStatesRef.current) : value;
2865
1852
  coagentStatesRef.current = newValue;
@@ -2875,8 +1862,8 @@ ${nonDocumentStrings}`;
2875
1862
  agentName: props.agent
2876
1863
  };
2877
1864
  }
2878
- const [agentSession, setAgentSession] = (0, import_react17.useState)(initialAgentSession);
2879
- (0, import_react17.useEffect)(() => {
1865
+ const [agentSession, setAgentSession] = (0, import_react15.useState)(initialAgentSession);
1866
+ (0, import_react15.useEffect)(() => {
2880
1867
  if (props.agent) {
2881
1868
  setAgentSession({
2882
1869
  agentName: props.agent
@@ -2886,7 +1873,7 @@ ${nonDocumentStrings}`;
2886
1873
  }
2887
1874
  }, [props.agent]);
2888
1875
  const { threadId, setThreadId: setInternalThreadId } = useThreads();
2889
- const setThreadId = (0, import_react17.useCallback)(
1876
+ const setThreadId = (0, import_react15.useCallback)(
2890
1877
  (value) => {
2891
1878
  if (props.threadId) {
2892
1879
  throw new Error("Cannot call setThreadId() when threadId is provided via props.");
@@ -2895,11 +1882,11 @@ ${nonDocumentStrings}`;
2895
1882
  },
2896
1883
  [props.threadId]
2897
1884
  );
2898
- const [runId, setRunId] = (0, import_react17.useState)(null);
2899
- const chatAbortControllerRef = (0, import_react17.useRef)(null);
1885
+ const [runId, setRunId] = (0, import_react15.useState)(null);
1886
+ const chatAbortControllerRef = (0, import_react15.useRef)(null);
2900
1887
  const showDevConsole = shouldShowDevConsole(props.showDevConsole);
2901
- const [interruptActions, _setInterruptActions] = (0, import_react17.useState)({});
2902
- const setInterruptAction = (0, import_react17.useCallback)((action) => {
1888
+ const [interruptActions, _setInterruptActions] = (0, import_react15.useState)({});
1889
+ const setInterruptAction = (0, import_react15.useCallback)((action) => {
2903
1890
  _setInterruptActions((prev) => {
2904
1891
  var _a2;
2905
1892
  if (action == null || !action.id) {
@@ -2910,14 +1897,14 @@ ${nonDocumentStrings}`;
2910
1897
  });
2911
1898
  });
2912
1899
  }, []);
2913
- const removeInterruptAction = (0, import_react17.useCallback)((actionId) => {
1900
+ const removeInterruptAction = (0, import_react15.useCallback)((actionId) => {
2914
1901
  _setInterruptActions((prev) => {
2915
1902
  const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
2916
1903
  return rest;
2917
1904
  });
2918
1905
  }, []);
2919
- const [interruptEventQueue, setInterruptEventQueue] = (0, import_react17.useState)({});
2920
- const addInterruptEvent = (0, import_react17.useCallback)((queuedEvent) => {
1906
+ const [interruptEventQueue, setInterruptEventQueue] = (0, import_react15.useState)({});
1907
+ const addInterruptEvent = (0, import_react15.useCallback)((queuedEvent) => {
2921
1908
  setInterruptEventQueue((prev) => {
2922
1909
  const threadQueue = prev[queuedEvent.threadId] || [];
2923
1910
  return __spreadProps(__spreadValues({}, prev), {
@@ -2925,7 +1912,7 @@ ${nonDocumentStrings}`;
2925
1912
  });
2926
1913
  });
2927
1914
  }, []);
2928
- const resolveInterruptEvent = (0, import_react17.useCallback)(
1915
+ const resolveInterruptEvent = (0, import_react15.useCallback)(
2929
1916
  (threadId2, eventId, response) => {
2930
1917
  setInterruptEventQueue((prev) => {
2931
1918
  const threadQueue = prev[threadId2] || [];
@@ -2938,20 +1925,20 @@ ${nonDocumentStrings}`;
2938
1925
  },
2939
1926
  []
2940
1927
  );
2941
- const memoizedChildren = (0, import_react17.useMemo)(() => children, [children]);
2942
- const [bannerError, setBannerError] = (0, import_react17.useState)(null);
2943
- const agentLock = (0, import_react17.useMemo)(() => {
1928
+ const memoizedChildren = (0, import_react15.useMemo)(() => children, [children]);
1929
+ const [bannerError, setBannerError] = (0, import_react15.useState)(null);
1930
+ const agentLock = (0, import_react15.useMemo)(() => {
2944
1931
  var _a2;
2945
1932
  return (_a2 = props.agent) != null ? _a2 : null;
2946
1933
  }, [props.agent]);
2947
- const forwardedParameters = (0, import_react17.useMemo)(
1934
+ const forwardedParameters = (0, import_react15.useMemo)(
2948
1935
  () => {
2949
1936
  var _a2;
2950
1937
  return (_a2 = props.forwardedParameters) != null ? _a2 : {};
2951
1938
  },
2952
1939
  [props.forwardedParameters]
2953
1940
  );
2954
- const updateExtensions = (0, import_react17.useCallback)(
1941
+ const updateExtensions = (0, import_react15.useCallback)(
2955
1942
  (newExtensions) => {
2956
1943
  setExtensions((prev) => {
2957
1944
  const resolved = typeof newExtensions === "function" ? newExtensions(prev) : newExtensions;
@@ -2963,7 +1950,7 @@ ${nonDocumentStrings}`;
2963
1950
  },
2964
1951
  [setExtensions]
2965
1952
  );
2966
- const updateAuthStates = (0, import_react17.useCallback)(
1953
+ const updateAuthStates = (0, import_react15.useCallback)(
2967
1954
  (newAuthStates) => {
2968
1955
  setAuthStates((prev) => {
2969
1956
  const resolved = typeof newAuthStates === "function" ? newAuthStates(prev) : newAuthStates;
@@ -2975,8 +1962,8 @@ ${nonDocumentStrings}`;
2975
1962
  },
2976
1963
  [setAuthStates]
2977
1964
  );
2978
- const handleSetRegisteredActions = (0, import_react17.useCallback)((actionConfig) => {
2979
- const key = actionConfig.action.name || (0, import_shared13.randomUUID)();
1965
+ const handleSetRegisteredActions = (0, import_react15.useCallback)((actionConfig) => {
1966
+ const key = actionConfig.action.name || (0, import_shared12.randomUUID)();
2980
1967
  setRegisteredActionConfigs((prev) => {
2981
1968
  const newMap = new Map(prev);
2982
1969
  newMap.set(key, actionConfig);
@@ -2984,25 +1971,25 @@ ${nonDocumentStrings}`;
2984
1971
  });
2985
1972
  return key;
2986
1973
  }, []);
2987
- const handleRemoveRegisteredAction = (0, import_react17.useCallback)((actionKey) => {
1974
+ const handleRemoveRegisteredAction = (0, import_react15.useCallback)((actionKey) => {
2988
1975
  setRegisteredActionConfigs((prev) => {
2989
1976
  const newMap = new Map(prev);
2990
1977
  newMap.delete(actionKey);
2991
1978
  return newMap;
2992
1979
  });
2993
1980
  }, []);
2994
- const RegisteredActionsRenderer = (0, import_react17.useMemo)(() => {
2995
- return () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: Array.from(registeredActionConfigs.entries()).map(([key, config]) => {
1981
+ const RegisteredActionsRenderer = (0, import_react15.useMemo)(() => {
1982
+ return () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: Array.from(registeredActionConfigs.entries()).map(([key, config]) => {
2996
1983
  const Component = config.component;
2997
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Component, { action: config.action }, key);
1984
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Component, { action: config.action }, key);
2998
1985
  }) });
2999
1986
  }, [registeredActionConfigs]);
3000
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3001
- import_react18.CopilotChatConfigurationProvider,
1987
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1988
+ import_react16.CopilotChatConfigurationProvider,
3002
1989
  {
3003
1990
  agentId: (_b = props.agent) != null ? _b : "default",
3004
1991
  threadId,
3005
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1992
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3006
1993
  CopilotContext.Provider,
3007
1994
  {
3008
1995
  value: {
@@ -3064,14 +2051,13 @@ ${nonDocumentStrings}`;
3064
2051
  removeInternalErrorHandler
3065
2052
  },
3066
2053
  children: [
3067
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopilotListeners, {}),
3068
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CoAgentStateRendersProvider, { children: [
3069
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MessagesTapProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CopilotMessages, { children: [
2054
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotListeners, {}),
2055
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CoAgentStateRendersProvider, { children: [
2056
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MessagesTapProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CopilotMessages, { children: [
3070
2057
  memoizedChildren,
3071
- showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ConsoleTrigger, {}),
3072
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RegisteredActionsRenderer, {})
2058
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RegisteredActionsRenderer, {})
3073
2059
  ] }) }),
3074
- bannerError && showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2060
+ bannerError && showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3075
2061
  UsageBanner,
3076
2062
  {
3077
2063
  severity: bannerError.severity,
@@ -3120,33 +2106,33 @@ function validateProps(props) {
3120
2106
  const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
3121
2107
  const hasApiKey = props.publicApiKey || props.publicLicenseKey;
3122
2108
  if (!props.runtimeUrl && !hasApiKey) {
3123
- throw new import_shared13.ConfigurationError(
2109
+ throw new import_shared12.ConfigurationError(
3124
2110
  "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
3125
2111
  );
3126
2112
  }
3127
2113
  if (cloudFeatures.length > 0 && !hasApiKey) {
3128
- throw new import_shared13.MissingPublicApiKeyError(
2114
+ throw new import_shared12.MissingPublicApiKeyError(
3129
2115
  `Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
3130
2116
  );
3131
2117
  }
3132
2118
  }
3133
2119
 
3134
2120
  // src/hooks/use-copilot-chat_internal.ts
3135
- var import_react25 = require("react");
2121
+ var import_react23 = require("react");
3136
2122
  var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
3137
2123
 
3138
2124
  // src/hooks/use-langgraph-interrupt-render.ts
3139
- var import_react21 = __toESM(require("react"));
2125
+ var import_react19 = __toESM(require("react"));
3140
2126
  var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
3141
- var import_shared14 = require("@copilotkit/shared");
2127
+ var import_shared13 = require("@copilotkit/shared");
3142
2128
 
3143
2129
  // src/hooks/use-agent-nodename.ts
3144
- var import_react19 = require("react");
3145
- var import_react20 = require("@copilotkitnext/react");
2130
+ var import_react17 = require("react");
2131
+ var import_react18 = require("@copilotkitnext/react");
3146
2132
  function useAgentNodeName(agentName) {
3147
- const { agent } = (0, import_react20.useAgent)({ agentId: agentName });
3148
- const nodeNameRef = (0, import_react19.useRef)("start");
3149
- (0, import_react19.useEffect)(() => {
2133
+ const { agent } = (0, import_react18.useAgent)({ agentId: agentName });
2134
+ const nodeNameRef = (0, import_react17.useRef)("start");
2135
+ (0, import_react17.useEffect)(() => {
3150
2136
  if (!agent)
3151
2137
  return;
3152
2138
  const subscriber = {
@@ -3169,7 +2155,7 @@ function useAgentNodeName(agentName) {
3169
2155
  }
3170
2156
 
3171
2157
  // src/hooks/use-langgraph-interrupt-render.ts
3172
- var import_react22 = require("@copilotkitnext/react");
2158
+ var import_react20 = require("@copilotkitnext/react");
3173
2159
  var InterruptRenderer = ({ event, result, render, resolve }) => {
3174
2160
  return render({ event, result, resolve });
3175
2161
  };
@@ -3183,10 +2169,10 @@ function useLangGraphInterruptRender(agent) {
3183
2169
  addInterruptEvent,
3184
2170
  resolveInterruptEvent
3185
2171
  } = useCopilotContext();
3186
- const existingConfig = (0, import_react22.useCopilotChatConfiguration)();
2172
+ const existingConfig = (0, import_react20.useCopilotChatConfiguration)();
3187
2173
  const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
3188
2174
  const nodeName = useAgentNodeName(resolvedAgentId);
3189
- (0, import_react21.useEffect)(() => {
2175
+ (0, import_react19.useEffect)(() => {
3190
2176
  if (!agent)
3191
2177
  return;
3192
2178
  let localInterrupt = null;
@@ -3196,9 +2182,9 @@ function useLangGraphInterruptRender(agent) {
3196
2182
  const eventData = {
3197
2183
  name: import_runtime_client_gql.MetaEventName.LangGraphInterruptEvent,
3198
2184
  type: event.type,
3199
- value: (0, import_shared14.parseJson)(event.value, event.value)
2185
+ value: (0, import_shared13.parseJson)(event.value, event.value)
3200
2186
  };
3201
- const eventId = (0, import_shared14.dataToUUID)(eventData, "interruptEvents");
2187
+ const eventId = (0, import_shared13.dataToUUID)(eventData, "interruptEvents");
3202
2188
  localInterrupt = {
3203
2189
  eventId,
3204
2190
  threadId,
@@ -3221,7 +2207,7 @@ function useLangGraphInterruptRender(agent) {
3221
2207
  unsubscribe();
3222
2208
  };
3223
2209
  }, [agent, threadId]);
3224
- const handleResolve = (0, import_react21.useCallback)(
2210
+ const handleResolve = (0, import_react19.useCallback)(
3225
2211
  (eventId, response) => {
3226
2212
  agent == null ? void 0 : agent.runAgent({
3227
2213
  forwardedProps: {
@@ -3235,7 +2221,7 @@ function useLangGraphInterruptRender(agent) {
3235
2221
  // eslint-disable-next-line react-hooks/exhaustive-deps
3236
2222
  [agent, threadId]
3237
2223
  );
3238
- return (0, import_react21.useMemo)(() => {
2224
+ return (0, import_react19.useMemo)(() => {
3239
2225
  const eventQueue = interruptEventQueue[threadId] || [];
3240
2226
  const currentQueuedEvent = eventQueue.find((qe) => !qe.event.response);
3241
2227
  if (!currentQueuedEvent || !agentSession)
@@ -3266,7 +2252,7 @@ function useLangGraphInterruptRender(agent) {
3266
2252
  }
3267
2253
  if (!render)
3268
2254
  return null;
3269
- return import_react21.default.createElement(InterruptRenderer, {
2255
+ return import_react19.default.createElement(InterruptRenderer, {
3270
2256
  event: currentQueuedEvent.event,
3271
2257
  result,
3272
2258
  render,
@@ -3276,14 +2262,14 @@ function useLangGraphInterruptRender(agent) {
3276
2262
  }
3277
2263
 
3278
2264
  // src/hooks/use-copilot-chat_internal.ts
3279
- var import_react26 = require("@copilotkitnext/react");
2265
+ var import_react24 = require("@copilotkitnext/react");
3280
2266
 
3281
2267
  // src/hooks/use-lazy-tool-renderer.tsx
3282
- var import_react23 = require("@copilotkitnext/react");
3283
- var import_react24 = require("react");
2268
+ var import_react21 = require("@copilotkitnext/react");
2269
+ var import_react22 = require("react");
3284
2270
  function useLazyToolRenderer() {
3285
- const renderToolCall = (0, import_react23.useRenderToolCall)();
3286
- return (0, import_react24.useCallback)(
2271
+ const renderToolCall = (0, import_react21.useRenderToolCall)();
2272
+ return (0, import_react22.useCallback)(
3287
2273
  (message, messages) => {
3288
2274
  var _a;
3289
2275
  if (!((_a = message == null ? void 0 : message.toolCalls) == null ? void 0 : _a.length))
@@ -3303,430 +2289,26 @@ function useLazyToolRenderer() {
3303
2289
  );
3304
2290
  }
3305
2291
 
3306
- // ../../node_modules/.pnpm/@ag-ui+core@0.0.42/node_modules/@ag-ui/core/dist/index.mjs
3307
- var import_zod = require("zod");
3308
- var import_zod2 = require("zod");
3309
- var FunctionCallSchema = import_zod.z.object({
3310
- name: import_zod.z.string(),
3311
- arguments: import_zod.z.string()
3312
- });
3313
- var ToolCallSchema = import_zod.z.object({
3314
- id: import_zod.z.string(),
3315
- type: import_zod.z.literal("function"),
3316
- function: FunctionCallSchema
3317
- });
3318
- var BaseMessageSchema = import_zod.z.object({
3319
- id: import_zod.z.string(),
3320
- role: import_zod.z.string(),
3321
- content: import_zod.z.string().optional(),
3322
- name: import_zod.z.string().optional()
3323
- });
3324
- var TextInputContentSchema = import_zod.z.object({
3325
- type: import_zod.z.literal("text"),
3326
- text: import_zod.z.string()
3327
- });
3328
- var BinaryInputContentObjectSchema = import_zod.z.object({
3329
- type: import_zod.z.literal("binary"),
3330
- mimeType: import_zod.z.string(),
3331
- id: import_zod.z.string().optional(),
3332
- url: import_zod.z.string().optional(),
3333
- data: import_zod.z.string().optional(),
3334
- filename: import_zod.z.string().optional()
3335
- });
3336
- var ensureBinaryPayload = (value, ctx) => {
3337
- if (!value.id && !value.url && !value.data) {
3338
- ctx.addIssue({
3339
- code: import_zod.z.ZodIssueCode.custom,
3340
- message: "BinaryInputContent requires at least one of id, url, or data.",
3341
- path: ["id"]
3342
- });
3343
- }
3344
- };
3345
- var BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {
3346
- ensureBinaryPayload(value, ctx);
3347
- });
3348
- var InputContentBaseSchema = import_zod.z.discriminatedUnion("type", [
3349
- TextInputContentSchema,
3350
- BinaryInputContentObjectSchema
3351
- ]);
3352
- var InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {
3353
- if (value.type === "binary") {
3354
- ensureBinaryPayload(value, ctx);
3355
- }
3356
- });
3357
- var DeveloperMessageSchema = BaseMessageSchema.extend({
3358
- role: import_zod.z.literal("developer"),
3359
- content: import_zod.z.string()
3360
- });
3361
- var SystemMessageSchema = BaseMessageSchema.extend({
3362
- role: import_zod.z.literal("system"),
3363
- content: import_zod.z.string()
3364
- });
3365
- var AssistantMessageSchema = BaseMessageSchema.extend({
3366
- role: import_zod.z.literal("assistant"),
3367
- content: import_zod.z.string().optional(),
3368
- toolCalls: import_zod.z.array(ToolCallSchema).optional()
3369
- });
3370
- var UserMessageSchema = BaseMessageSchema.extend({
3371
- role: import_zod.z.literal("user"),
3372
- content: import_zod.z.union([import_zod.z.string(), import_zod.z.array(InputContentSchema)])
3373
- });
3374
- var ToolMessageSchema = import_zod.z.object({
3375
- id: import_zod.z.string(),
3376
- content: import_zod.z.string(),
3377
- role: import_zod.z.literal("tool"),
3378
- toolCallId: import_zod.z.string(),
3379
- error: import_zod.z.string().optional()
3380
- });
3381
- var ActivityMessageSchema = import_zod.z.object({
3382
- id: import_zod.z.string(),
3383
- role: import_zod.z.literal("activity"),
3384
- activityType: import_zod.z.string(),
3385
- content: import_zod.z.record(import_zod.z.any())
3386
- });
3387
- var MessageSchema = import_zod.z.discriminatedUnion("role", [
3388
- DeveloperMessageSchema,
3389
- SystemMessageSchema,
3390
- AssistantMessageSchema,
3391
- UserMessageSchema,
3392
- ToolMessageSchema,
3393
- ActivityMessageSchema
3394
- ]);
3395
- var RoleSchema = import_zod.z.union([
3396
- import_zod.z.literal("developer"),
3397
- import_zod.z.literal("system"),
3398
- import_zod.z.literal("assistant"),
3399
- import_zod.z.literal("user"),
3400
- import_zod.z.literal("tool"),
3401
- import_zod.z.literal("activity")
3402
- ]);
3403
- var ContextSchema = import_zod.z.object({
3404
- description: import_zod.z.string(),
3405
- value: import_zod.z.string()
3406
- });
3407
- var ToolSchema = import_zod.z.object({
3408
- name: import_zod.z.string(),
3409
- description: import_zod.z.string(),
3410
- parameters: import_zod.z.any()
3411
- // JSON Schema for the tool parameters
3412
- });
3413
- var RunAgentInputSchema = import_zod.z.object({
3414
- threadId: import_zod.z.string(),
3415
- runId: import_zod.z.string(),
3416
- parentRunId: import_zod.z.string().optional(),
3417
- state: import_zod.z.any(),
3418
- messages: import_zod.z.array(MessageSchema),
3419
- tools: import_zod.z.array(ToolSchema),
3420
- context: import_zod.z.array(ContextSchema),
3421
- forwardedProps: import_zod.z.any()
3422
- });
3423
- var StateSchema = import_zod.z.any();
3424
- var AGUIError = class extends Error {
3425
- constructor(message) {
3426
- super(message);
3427
- }
3428
- };
3429
- var AGUIConnectNotImplementedError = class extends AGUIError {
3430
- constructor() {
3431
- super("Connect not implemented. This method is not supported by the current agent.");
3432
- }
3433
- };
3434
- var TextMessageRoleSchema = import_zod2.z.union([
3435
- import_zod2.z.literal("developer"),
3436
- import_zod2.z.literal("system"),
3437
- import_zod2.z.literal("assistant"),
3438
- import_zod2.z.literal("user")
3439
- ]);
3440
- var EventType = /* @__PURE__ */ ((EventType2) => {
3441
- EventType2["TEXT_MESSAGE_START"] = "TEXT_MESSAGE_START";
3442
- EventType2["TEXT_MESSAGE_CONTENT"] = "TEXT_MESSAGE_CONTENT";
3443
- EventType2["TEXT_MESSAGE_END"] = "TEXT_MESSAGE_END";
3444
- EventType2["TEXT_MESSAGE_CHUNK"] = "TEXT_MESSAGE_CHUNK";
3445
- EventType2["THINKING_TEXT_MESSAGE_START"] = "THINKING_TEXT_MESSAGE_START";
3446
- EventType2["THINKING_TEXT_MESSAGE_CONTENT"] = "THINKING_TEXT_MESSAGE_CONTENT";
3447
- EventType2["THINKING_TEXT_MESSAGE_END"] = "THINKING_TEXT_MESSAGE_END";
3448
- EventType2["TOOL_CALL_START"] = "TOOL_CALL_START";
3449
- EventType2["TOOL_CALL_ARGS"] = "TOOL_CALL_ARGS";
3450
- EventType2["TOOL_CALL_END"] = "TOOL_CALL_END";
3451
- EventType2["TOOL_CALL_CHUNK"] = "TOOL_CALL_CHUNK";
3452
- EventType2["TOOL_CALL_RESULT"] = "TOOL_CALL_RESULT";
3453
- EventType2["THINKING_START"] = "THINKING_START";
3454
- EventType2["THINKING_END"] = "THINKING_END";
3455
- EventType2["STATE_SNAPSHOT"] = "STATE_SNAPSHOT";
3456
- EventType2["STATE_DELTA"] = "STATE_DELTA";
3457
- EventType2["MESSAGES_SNAPSHOT"] = "MESSAGES_SNAPSHOT";
3458
- EventType2["ACTIVITY_SNAPSHOT"] = "ACTIVITY_SNAPSHOT";
3459
- EventType2["ACTIVITY_DELTA"] = "ACTIVITY_DELTA";
3460
- EventType2["RAW"] = "RAW";
3461
- EventType2["CUSTOM"] = "CUSTOM";
3462
- EventType2["RUN_STARTED"] = "RUN_STARTED";
3463
- EventType2["RUN_FINISHED"] = "RUN_FINISHED";
3464
- EventType2["RUN_ERROR"] = "RUN_ERROR";
3465
- EventType2["STEP_STARTED"] = "STEP_STARTED";
3466
- EventType2["STEP_FINISHED"] = "STEP_FINISHED";
3467
- return EventType2;
3468
- })(EventType || {});
3469
- var BaseEventSchema = import_zod2.z.object({
3470
- type: import_zod2.z.nativeEnum(EventType),
3471
- timestamp: import_zod2.z.number().optional(),
3472
- rawEvent: import_zod2.z.any().optional()
3473
- });
3474
- var TextMessageStartEventSchema = BaseEventSchema.extend({
3475
- type: import_zod2.z.literal(
3476
- "TEXT_MESSAGE_START"
3477
- /* TEXT_MESSAGE_START */
3478
- ),
3479
- messageId: import_zod2.z.string(),
3480
- role: TextMessageRoleSchema.default("assistant")
3481
- });
3482
- var TextMessageContentEventSchema = BaseEventSchema.extend({
3483
- type: import_zod2.z.literal(
3484
- "TEXT_MESSAGE_CONTENT"
3485
- /* TEXT_MESSAGE_CONTENT */
3486
- ),
3487
- messageId: import_zod2.z.string(),
3488
- delta: import_zod2.z.string().refine((s) => s.length > 0, "Delta must not be an empty string")
3489
- });
3490
- var TextMessageEndEventSchema = BaseEventSchema.extend({
3491
- type: import_zod2.z.literal(
3492
- "TEXT_MESSAGE_END"
3493
- /* TEXT_MESSAGE_END */
3494
- ),
3495
- messageId: import_zod2.z.string()
3496
- });
3497
- var TextMessageChunkEventSchema = BaseEventSchema.extend({
3498
- type: import_zod2.z.literal(
3499
- "TEXT_MESSAGE_CHUNK"
3500
- /* TEXT_MESSAGE_CHUNK */
3501
- ),
3502
- messageId: import_zod2.z.string().optional(),
3503
- role: TextMessageRoleSchema.optional(),
3504
- delta: import_zod2.z.string().optional()
3505
- });
3506
- var ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({
3507
- type: import_zod2.z.literal(
3508
- "THINKING_TEXT_MESSAGE_START"
3509
- /* THINKING_TEXT_MESSAGE_START */
3510
- )
3511
- });
3512
- var ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({
3513
- messageId: true,
3514
- type: true
3515
- }).extend({
3516
- type: import_zod2.z.literal(
3517
- "THINKING_TEXT_MESSAGE_CONTENT"
3518
- /* THINKING_TEXT_MESSAGE_CONTENT */
3519
- )
3520
- });
3521
- var ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({
3522
- type: import_zod2.z.literal(
3523
- "THINKING_TEXT_MESSAGE_END"
3524
- /* THINKING_TEXT_MESSAGE_END */
3525
- )
3526
- });
3527
- var ToolCallStartEventSchema = BaseEventSchema.extend({
3528
- type: import_zod2.z.literal(
3529
- "TOOL_CALL_START"
3530
- /* TOOL_CALL_START */
3531
- ),
3532
- toolCallId: import_zod2.z.string(),
3533
- toolCallName: import_zod2.z.string(),
3534
- parentMessageId: import_zod2.z.string().optional()
3535
- });
3536
- var ToolCallArgsEventSchema = BaseEventSchema.extend({
3537
- type: import_zod2.z.literal(
3538
- "TOOL_CALL_ARGS"
3539
- /* TOOL_CALL_ARGS */
3540
- ),
3541
- toolCallId: import_zod2.z.string(),
3542
- delta: import_zod2.z.string()
3543
- });
3544
- var ToolCallEndEventSchema = BaseEventSchema.extend({
3545
- type: import_zod2.z.literal(
3546
- "TOOL_CALL_END"
3547
- /* TOOL_CALL_END */
3548
- ),
3549
- toolCallId: import_zod2.z.string()
3550
- });
3551
- var ToolCallResultEventSchema = BaseEventSchema.extend({
3552
- messageId: import_zod2.z.string(),
3553
- type: import_zod2.z.literal(
3554
- "TOOL_CALL_RESULT"
3555
- /* TOOL_CALL_RESULT */
3556
- ),
3557
- toolCallId: import_zod2.z.string(),
3558
- content: import_zod2.z.string(),
3559
- role: import_zod2.z.literal("tool").optional()
3560
- });
3561
- var ToolCallChunkEventSchema = BaseEventSchema.extend({
3562
- type: import_zod2.z.literal(
3563
- "TOOL_CALL_CHUNK"
3564
- /* TOOL_CALL_CHUNK */
3565
- ),
3566
- toolCallId: import_zod2.z.string().optional(),
3567
- toolCallName: import_zod2.z.string().optional(),
3568
- parentMessageId: import_zod2.z.string().optional(),
3569
- delta: import_zod2.z.string().optional()
3570
- });
3571
- var ThinkingStartEventSchema = BaseEventSchema.extend({
3572
- type: import_zod2.z.literal(
3573
- "THINKING_START"
3574
- /* THINKING_START */
3575
- ),
3576
- title: import_zod2.z.string().optional()
3577
- });
3578
- var ThinkingEndEventSchema = BaseEventSchema.extend({
3579
- type: import_zod2.z.literal(
3580
- "THINKING_END"
3581
- /* THINKING_END */
3582
- )
3583
- });
3584
- var StateSnapshotEventSchema = BaseEventSchema.extend({
3585
- type: import_zod2.z.literal(
3586
- "STATE_SNAPSHOT"
3587
- /* STATE_SNAPSHOT */
3588
- ),
3589
- snapshot: StateSchema
3590
- });
3591
- var StateDeltaEventSchema = BaseEventSchema.extend({
3592
- type: import_zod2.z.literal(
3593
- "STATE_DELTA"
3594
- /* STATE_DELTA */
3595
- ),
3596
- delta: import_zod2.z.array(import_zod2.z.any())
3597
- // JSON Patch (RFC 6902)
3598
- });
3599
- var MessagesSnapshotEventSchema = BaseEventSchema.extend({
3600
- type: import_zod2.z.literal(
3601
- "MESSAGES_SNAPSHOT"
3602
- /* MESSAGES_SNAPSHOT */
3603
- ),
3604
- messages: import_zod2.z.array(MessageSchema)
3605
- });
3606
- var ActivitySnapshotEventSchema = BaseEventSchema.extend({
3607
- type: import_zod2.z.literal(
3608
- "ACTIVITY_SNAPSHOT"
3609
- /* ACTIVITY_SNAPSHOT */
3610
- ),
3611
- messageId: import_zod2.z.string(),
3612
- activityType: import_zod2.z.string(),
3613
- content: import_zod2.z.record(import_zod2.z.any()),
3614
- replace: import_zod2.z.boolean().optional().default(true)
3615
- });
3616
- var ActivityDeltaEventSchema = BaseEventSchema.extend({
3617
- type: import_zod2.z.literal(
3618
- "ACTIVITY_DELTA"
3619
- /* ACTIVITY_DELTA */
3620
- ),
3621
- messageId: import_zod2.z.string(),
3622
- activityType: import_zod2.z.string(),
3623
- patch: import_zod2.z.array(import_zod2.z.any())
3624
- });
3625
- var RawEventSchema = BaseEventSchema.extend({
3626
- type: import_zod2.z.literal(
3627
- "RAW"
3628
- /* RAW */
3629
- ),
3630
- event: import_zod2.z.any(),
3631
- source: import_zod2.z.string().optional()
3632
- });
3633
- var CustomEventSchema = BaseEventSchema.extend({
3634
- type: import_zod2.z.literal(
3635
- "CUSTOM"
3636
- /* CUSTOM */
3637
- ),
3638
- name: import_zod2.z.string(),
3639
- value: import_zod2.z.any()
3640
- });
3641
- var RunStartedEventSchema = BaseEventSchema.extend({
3642
- type: import_zod2.z.literal(
3643
- "RUN_STARTED"
3644
- /* RUN_STARTED */
3645
- ),
3646
- threadId: import_zod2.z.string(),
3647
- runId: import_zod2.z.string(),
3648
- parentRunId: import_zod2.z.string().optional(),
3649
- input: RunAgentInputSchema.optional()
3650
- });
3651
- var RunFinishedEventSchema = BaseEventSchema.extend({
3652
- type: import_zod2.z.literal(
3653
- "RUN_FINISHED"
3654
- /* RUN_FINISHED */
3655
- ),
3656
- threadId: import_zod2.z.string(),
3657
- runId: import_zod2.z.string(),
3658
- result: import_zod2.z.any().optional()
3659
- });
3660
- var RunErrorEventSchema = BaseEventSchema.extend({
3661
- type: import_zod2.z.literal(
3662
- "RUN_ERROR"
3663
- /* RUN_ERROR */
3664
- ),
3665
- message: import_zod2.z.string(),
3666
- code: import_zod2.z.string().optional()
3667
- });
3668
- var StepStartedEventSchema = BaseEventSchema.extend({
3669
- type: import_zod2.z.literal(
3670
- "STEP_STARTED"
3671
- /* STEP_STARTED */
3672
- ),
3673
- stepName: import_zod2.z.string()
3674
- });
3675
- var StepFinishedEventSchema = BaseEventSchema.extend({
3676
- type: import_zod2.z.literal(
3677
- "STEP_FINISHED"
3678
- /* STEP_FINISHED */
3679
- ),
3680
- stepName: import_zod2.z.string()
3681
- });
3682
- var EventSchemas = import_zod2.z.discriminatedUnion("type", [
3683
- TextMessageStartEventSchema,
3684
- TextMessageContentEventSchema,
3685
- TextMessageEndEventSchema,
3686
- TextMessageChunkEventSchema,
3687
- ThinkingStartEventSchema,
3688
- ThinkingEndEventSchema,
3689
- ThinkingTextMessageStartEventSchema,
3690
- ThinkingTextMessageContentEventSchema,
3691
- ThinkingTextMessageEndEventSchema,
3692
- ToolCallStartEventSchema,
3693
- ToolCallArgsEventSchema,
3694
- ToolCallEndEventSchema,
3695
- ToolCallChunkEventSchema,
3696
- ToolCallResultEventSchema,
3697
- StateSnapshotEventSchema,
3698
- StateDeltaEventSchema,
3699
- MessagesSnapshotEventSchema,
3700
- ActivitySnapshotEventSchema,
3701
- ActivityDeltaEventSchema,
3702
- RawEventSchema,
3703
- CustomEventSchema,
3704
- RunStartedEventSchema,
3705
- RunFinishedEventSchema,
3706
- RunErrorEventSchema,
3707
- StepStartedEventSchema,
3708
- StepFinishedEventSchema
3709
- ]);
3710
-
3711
2292
  // src/hooks/use-copilot-chat_internal.ts
2293
+ var import_client = require("@ag-ui/client");
3712
2294
  function useCopilotChatInternal({
3713
2295
  suggestions
3714
2296
  } = {}) {
3715
2297
  var _a, _b, _c;
3716
- const { copilotkit } = (0, import_react26.useCopilotKit)();
2298
+ const { copilotkit } = (0, import_react24.useCopilotKit)();
3717
2299
  const { threadId, agentSession } = useCopilotContext();
3718
- const existingConfig = (0, import_react26.useCopilotChatConfiguration)();
3719
- const [agentAvailable, setAgentAvailable] = (0, import_react25.useState)(false);
2300
+ const existingConfig = (0, import_react24.useCopilotChatConfiguration)();
2301
+ const [agentAvailable, setAgentAvailable] = (0, import_react23.useState)(false);
3720
2302
  const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
3721
- const { agent } = (0, import_react26.useAgent)({ agentId: resolvedAgentId });
3722
- (0, import_react25.useEffect)(() => {
2303
+ const { agent } = (0, import_react24.useAgent)({ agentId: resolvedAgentId });
2304
+ (0, import_react23.useEffect)(() => {
3723
2305
  const connect = (agent2) => __async(this, null, function* () {
3724
2306
  setAgentAvailable(false);
3725
2307
  try {
3726
2308
  yield copilotkit.connectAgent({ agent: agent2 });
3727
2309
  setAgentAvailable(true);
3728
2310
  } catch (error) {
3729
- if (error instanceof AGUIConnectNotImplementedError) {
2311
+ if (error instanceof import_client.AGUIConnectNotImplementedError) {
3730
2312
  } else {
3731
2313
  throw error;
3732
2314
  }
@@ -3744,7 +2326,7 @@ function useCopilotChatInternal({
3744
2326
  agent == null ? void 0 : agent.setMessages([]);
3745
2327
  agent == null ? void 0 : agent.setState(null);
3746
2328
  };
3747
- const deleteMessage = (0, import_react25.useCallback)(
2329
+ const deleteMessage = (0, import_react23.useCallback)(
3748
2330
  (messageId) => {
3749
2331
  var _a2;
3750
2332
  const filteredMessages = ((_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []).filter(
@@ -3755,13 +2337,13 @@ function useCopilotChatInternal({
3755
2337
  [agent == null ? void 0 : agent.setMessages, agent == null ? void 0 : agent.messages]
3756
2338
  );
3757
2339
  const latestDelete = useUpdatedRef(deleteMessage);
3758
- const latestDeleteFunc = (0, import_react25.useCallback)(
2340
+ const latestDeleteFunc = (0, import_react23.useCallback)(
3759
2341
  (messageId) => {
3760
2342
  return latestDelete.current(messageId);
3761
2343
  },
3762
2344
  [latestDelete]
3763
2345
  );
3764
- const currentSuggestions = (0, import_react26.useSuggestions)({ agentId: resolvedAgentId });
2346
+ const currentSuggestions = (0, import_react24.useSuggestions)({ agentId: resolvedAgentId });
3765
2347
  const reload = useAsyncCallback(
3766
2348
  (reloadMessageId) => __async(this, null, function* () {
3767
2349
  var _a2;
@@ -3828,7 +2410,7 @@ function useCopilotChatInternal({
3828
2410
  }),
3829
2411
  [latestSendMessageFunc]
3830
2412
  );
3831
- const latestSetMessagesFunc = (0, import_react25.useCallback)(
2413
+ const latestSetMessagesFunc = (0, import_react23.useCallback)(
3832
2414
  (messages) => {
3833
2415
  var _a2, _b2;
3834
2416
  if (messages.every((message) => message instanceof import_runtime_client_gql2.Message)) {
@@ -3845,16 +2427,16 @@ function useCopilotChatInternal({
3845
2427
  }),
3846
2428
  [latestReload]
3847
2429
  );
3848
- const latestStopFunc = (0, import_react25.useCallback)(() => {
2430
+ const latestStopFunc = (0, import_react23.useCallback)(() => {
3849
2431
  var _a2;
3850
2432
  return (_a2 = agent == null ? void 0 : agent.abortRun) == null ? void 0 : _a2.call(agent);
3851
2433
  }, [agent == null ? void 0 : agent.abortRun]);
3852
2434
  const latestReset = useUpdatedRef(reset);
3853
- const latestResetFunc = (0, import_react25.useCallback)(() => {
2435
+ const latestResetFunc = (0, import_react23.useCallback)(() => {
3854
2436
  return latestReset.current();
3855
2437
  }, [latestReset]);
3856
2438
  const lazyToolRendered = useLazyToolRenderer();
3857
- const renderCustomMessage = (0, import_react26.useRenderCustomMessages)();
2439
+ const renderCustomMessage = (0, import_react24.useRenderCustomMessages)();
3858
2440
  const legacyCustomMessageRenderer = useLegacyCoagentRenderer({
3859
2441
  copilotkit,
3860
2442
  agent,
@@ -3862,7 +2444,7 @@ function useCopilotChatInternal({
3862
2444
  threadId: (_b = existingConfig == null ? void 0 : existingConfig.threadId) != null ? _b : threadId
3863
2445
  });
3864
2446
  const allMessages = (_c = agent == null ? void 0 : agent.messages) != null ? _c : [];
3865
- const resolvedMessages = (0, import_react25.useMemo)(() => {
2447
+ const resolvedMessages = (0, import_react23.useMemo)(() => {
3866
2448
  let processedMessages = allMessages.map((message) => {
3867
2449
  if (message.role !== "assistant") {
3868
2450
  return message;
@@ -3899,7 +2481,7 @@ function useCopilotChatInternal({
3899
2481
  // legacyCustomMessageRenderer,
3900
2482
  resolvedAgentId
3901
2483
  ]);
3902
- const renderedSuggestions = (0, import_react25.useMemo)(() => {
2484
+ const renderedSuggestions = (0, import_react23.useMemo)(() => {
3903
2485
  if (Array.isArray(suggestions)) {
3904
2486
  return {
3905
2487
  suggestions: suggestions.map((s) => __spreadProps(__spreadValues({}, s), { isLoading: false })),
@@ -3934,8 +2516,8 @@ function useCopilotChatInternal({
3934
2516
  };
3935
2517
  }
3936
2518
  function useUpdatedRef(value) {
3937
- const ref = (0, import_react25.useRef)(value);
3938
- (0, import_react25.useEffect)(() => {
2519
+ const ref = (0, import_react23.useRef)(value);
2520
+ (0, import_react23.useEffect)(() => {
3939
2521
  ref.current = value;
3940
2522
  }, [value]);
3941
2523
  return ref;
@@ -3946,7 +2528,7 @@ function useLegacyCoagentRenderer({
3946
2528
  agentId,
3947
2529
  threadId
3948
2530
  }) {
3949
- return (0, import_react25.useMemo)(() => {
2531
+ return (0, import_react23.useMemo)(() => {
3950
2532
  if (!copilotkit || !agent) {
3951
2533
  return null;
3952
2534
  }
@@ -3969,7 +2551,7 @@ function useLegacyCoagentRenderer({
3969
2551
  agentId,
3970
2552
  stateSnapshot: message.state
3971
2553
  };
3972
- return (0, import_react25.createElement)(CoAgentStateRenderBridge, bridgeProps);
2554
+ return (0, import_react23.createElement)(CoAgentStateRenderBridge, bridgeProps);
3973
2555
  };
3974
2556
  }, [agent, agentId, copilotkit, threadId]);
3975
2557
  }
@@ -4003,8 +2585,8 @@ function useCopilotChat(options = {}) {
4003
2585
  }
4004
2586
 
4005
2587
  // src/hooks/use-copilot-chat-headless_c.ts
4006
- var import_react27 = require("react");
4007
- var import_shared15 = require("@copilotkit/shared");
2588
+ var import_react25 = require("react");
2589
+ var import_shared14 = require("@copilotkit/shared");
4008
2590
  var createNonFunctionalReturn = () => ({
4009
2591
  visibleMessages: [],
4010
2592
  messages: [],
@@ -4044,20 +2626,20 @@ function useCopilotChatHeadless_c(options = {}) {
4044
2626
  const { copilotApiConfig, setBannerError } = useCopilotContext();
4045
2627
  const hasPublicApiKey = Boolean(copilotApiConfig.publicApiKey);
4046
2628
  const internalResult = useCopilotChatInternal(options);
4047
- (0, import_react27.useEffect)(() => {
2629
+ (0, import_react25.useEffect)(() => {
4048
2630
  if (!hasPublicApiKey) {
4049
2631
  setBannerError(
4050
- new import_shared15.CopilotKitError({
2632
+ new import_shared14.CopilotKitError({
4051
2633
  message: (
4052
2634
  // add link to documentation here
4053
2635
  "You're using useCopilotChatHeadless_c, a premium-only feature, which offers extensive headless chat capabilities. To continue, you'll need to provide a free public license key."
4054
2636
  ),
4055
- code: import_shared15.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
4056
- severity: import_shared15.Severity.WARNING,
4057
- visibility: import_shared15.ErrorVisibility.BANNER
2637
+ code: import_shared14.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
2638
+ severity: import_shared14.Severity.WARNING,
2639
+ visibility: import_shared14.ErrorVisibility.BANNER
4058
2640
  })
4059
2641
  );
4060
- import_shared15.styledConsole.logCopilotKitPlatformMessage();
2642
+ import_shared14.styledConsole.logCopilotKitPlatformMessage();
4061
2643
  } else {
4062
2644
  setBannerError(null);
4063
2645
  }
@@ -4069,40 +2651,40 @@ function useCopilotChatHeadless_c(options = {}) {
4069
2651
  }
4070
2652
 
4071
2653
  // src/hooks/use-copilot-action.ts
4072
- var import_react34 = require("react");
2654
+ var import_react32 = require("react");
4073
2655
 
4074
2656
  // src/hooks/use-frontend-tool.ts
4075
- var import_react28 = __toESM(require("react"));
2657
+ var import_react26 = __toESM(require("react"));
2658
+ var import_shared15 = require("@copilotkit/shared");
4076
2659
  var import_shared16 = require("@copilotkit/shared");
4077
- var import_shared17 = require("@copilotkit/shared");
4078
- var import_react29 = require("@copilotkitnext/react");
2660
+ var import_react27 = require("@copilotkitnext/react");
4079
2661
  function useFrontendTool(tool, dependencies) {
4080
2662
  const { name, description, parameters, render, followUp } = tool;
4081
- const zodParameters = (0, import_shared16.getZodParameters)(parameters);
2663
+ const zodParameters = (0, import_shared15.getZodParameters)(parameters);
4082
2664
  const normalizedRender = (() => {
4083
2665
  if (typeof render === "undefined") {
4084
2666
  return void 0;
4085
2667
  }
4086
2668
  if (typeof render === "string") {
4087
2669
  const staticRender = render;
4088
- return () => import_react28.default.createElement(
4089
- import_react28.default.Fragment,
2670
+ return () => import_react26.default.createElement(
2671
+ import_react26.default.Fragment,
4090
2672
  null,
4091
2673
  staticRender
4092
2674
  );
4093
2675
  }
4094
2676
  return (args) => {
4095
2677
  const renderArgs = __spreadProps(__spreadValues({}, args), {
4096
- result: typeof args.result === "string" ? (0, import_shared17.parseJson)(args.result, args.result) : args.result
2678
+ result: typeof args.result === "string" ? (0, import_shared16.parseJson)(args.result, args.result) : args.result
4097
2679
  });
4098
2680
  const rendered = render(renderArgs);
4099
2681
  if (typeof rendered === "string") {
4100
- return import_react28.default.createElement(import_react28.default.Fragment, null, rendered);
2682
+ return import_react26.default.createElement(import_react26.default.Fragment, null, rendered);
4101
2683
  }
4102
2684
  return rendered != null ? rendered : null;
4103
2685
  };
4104
2686
  })();
4105
- (0, import_react29.useFrontendTool)({
2687
+ (0, import_react27.useFrontendTool)({
4106
2688
  name,
4107
2689
  description,
4108
2690
  parameters: zodParameters,
@@ -4113,29 +2695,29 @@ function useFrontendTool(tool, dependencies) {
4113
2695
  }
4114
2696
 
4115
2697
  // src/hooks/use-render-tool-call.ts
2698
+ var import_shared17 = require("@copilotkit/shared");
2699
+ var import_react28 = require("react");
2700
+ var import_react29 = require("@copilotkitnext/react");
4116
2701
  var import_shared18 = require("@copilotkit/shared");
4117
- var import_react30 = require("react");
4118
- var import_react31 = require("@copilotkitnext/react");
4119
- var import_shared19 = require("@copilotkit/shared");
4120
2702
  function useRenderToolCall2(tool, dependencies) {
4121
- const { copilotkit } = (0, import_react31.useCopilotKit)();
4122
- const hasAddedRef = (0, import_react30.useRef)(false);
4123
- (0, import_react30.useEffect)(() => {
2703
+ const { copilotkit } = (0, import_react29.useCopilotKit)();
2704
+ const hasAddedRef = (0, import_react28.useRef)(false);
2705
+ (0, import_react28.useEffect)(() => {
4124
2706
  const { name, parameters, render } = tool;
4125
- const zodParameters = (0, import_shared18.getZodParameters)(parameters);
4126
- const renderToolCall = name === "*" ? (0, import_react31.defineToolCallRenderer)({
2707
+ const zodParameters = (0, import_shared17.getZodParameters)(parameters);
2708
+ const renderToolCall = name === "*" ? (0, import_react29.defineToolCallRenderer)({
4127
2709
  name: "*",
4128
2710
  render: (args) => {
4129
2711
  return render(__spreadProps(__spreadValues({}, args), {
4130
- result: args.result ? (0, import_shared19.parseJson)(args.result, args.result) : args.result
2712
+ result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
4131
2713
  }));
4132
2714
  }
4133
- }) : (0, import_react31.defineToolCallRenderer)({
2715
+ }) : (0, import_react29.defineToolCallRenderer)({
4134
2716
  name,
4135
2717
  args: zodParameters,
4136
2718
  render: (args) => {
4137
2719
  return render(__spreadProps(__spreadValues({}, args), {
4138
- result: args.result ? (0, import_shared19.parseJson)(args.result, args.result) : args.result
2720
+ result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
4139
2721
  }));
4140
2722
  }
4141
2723
  });
@@ -4158,19 +2740,19 @@ function useRenderToolCall2(tool, dependencies) {
4158
2740
  }
4159
2741
 
4160
2742
  // src/hooks/use-human-in-the-loop.ts
4161
- var import_shared20 = require("@copilotkit/shared");
4162
- var import_react32 = require("@copilotkitnext/react");
2743
+ var import_shared19 = require("@copilotkit/shared");
2744
+ var import_react30 = require("@copilotkitnext/react");
4163
2745
  var import_core = require("@copilotkitnext/core");
4164
- var import_react33 = __toESM(require("react"));
2746
+ var import_react31 = __toESM(require("react"));
4165
2747
  function useHumanInTheLoop(tool, dependencies) {
4166
2748
  const _a = tool, { render } = _a, toolRest = __objRest(_a, ["render"]);
4167
2749
  const { name, description, parameters, followUp } = toolRest;
4168
- const zodParameters = (0, import_shared20.getZodParameters)(parameters);
4169
- const renderRef = (0, import_react33.useRef)(null);
4170
- (0, import_react33.useEffect)(() => {
2750
+ const zodParameters = (0, import_shared19.getZodParameters)(parameters);
2751
+ const renderRef = (0, import_react31.useRef)(null);
2752
+ (0, import_react31.useEffect)(() => {
4171
2753
  renderRef.current = (args) => {
4172
2754
  if (typeof render === "string") {
4173
- return import_react33.default.createElement(import_react33.default.Fragment, null, render);
2755
+ return import_react31.default.createElement(import_react31.default.Fragment, null, render);
4174
2756
  }
4175
2757
  if (!render) {
4176
2758
  return null;
@@ -4198,24 +2780,24 @@ function useHumanInTheLoop(tool, dependencies) {
4198
2780
  args: mappedArgs,
4199
2781
  respond: args.respond,
4200
2782
  status: args.status,
4201
- result: args.result ? (0, import_shared20.parseJson)(args.result, args.result) : args.result,
2783
+ result: args.result ? (0, import_shared19.parseJson)(args.result, args.result) : args.result,
4202
2784
  handler: void 0
4203
2785
  };
4204
2786
  default:
4205
- throw new import_shared20.CopilotKitError({
4206
- code: import_shared20.CopilotKitErrorCode.UNKNOWN,
2787
+ throw new import_shared19.CopilotKitError({
2788
+ code: import_shared19.CopilotKitErrorCode.UNKNOWN,
4207
2789
  message: `Invalid tool call status: ${args.status}`
4208
2790
  });
4209
2791
  }
4210
2792
  })();
4211
2793
  const rendered = render(renderProps);
4212
2794
  if (typeof rendered === "string") {
4213
- return import_react33.default.createElement(import_react33.default.Fragment, null, rendered);
2795
+ return import_react31.default.createElement(import_react31.default.Fragment, null, rendered);
4214
2796
  }
4215
2797
  return rendered != null ? rendered : null;
4216
2798
  };
4217
2799
  }, [render, ...dependencies != null ? dependencies : []]);
4218
- (0, import_react32.useHumanInTheLoop)({
2800
+ (0, import_react30.useHumanInTheLoop)({
4219
2801
  name,
4220
2802
  description,
4221
2803
  followUp,
@@ -4271,7 +2853,7 @@ function getActionConfig(action) {
4271
2853
  throw new Error("Invalid action configuration");
4272
2854
  }
4273
2855
  function useCopilotAction(action, dependencies) {
4274
- const [initialActionConfig] = (0, import_react34.useState)(getActionConfig(action));
2856
+ const [initialActionConfig] = (0, import_react32.useState)(getActionConfig(action));
4275
2857
  const currentActionConfig = getActionConfig(action);
4276
2858
  if (initialActionConfig.type !== currentActionConfig.type) {
4277
2859
  throw new Error("Action configuration changed between renders");
@@ -4289,17 +2871,17 @@ function useCopilotAction(action, dependencies) {
4289
2871
  }
4290
2872
 
4291
2873
  // src/hooks/use-coagent-state-render.ts
4292
- var import_react35 = require("react");
4293
- var import_shared21 = require("@copilotkit/shared");
2874
+ var import_react33 = require("react");
2875
+ var import_shared20 = require("@copilotkit/shared");
4294
2876
  function useCoAgentStateRender(action, dependencies) {
4295
- const { chatComponentsCache, availableAgents } = (0, import_react35.useContext)(CopilotContext);
2877
+ const { chatComponentsCache, availableAgents } = (0, import_react33.useContext)(CopilotContext);
4296
2878
  const { setCoAgentStateRender, removeCoAgentStateRender, coAgentStateRenders } = useCoAgentStateRenders();
4297
- const idRef = (0, import_react35.useRef)((0, import_shared21.randomId)());
2879
+ const idRef = (0, import_react33.useRef)((0, import_shared20.randomId)());
4298
2880
  const { setBannerError, addToast } = useToast();
4299
- (0, import_react35.useEffect)(() => {
2881
+ (0, import_react33.useEffect)(() => {
4300
2882
  if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
4301
2883
  const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
4302
- const agentError = new import_shared21.CopilotKitAgentDiscoveryError({
2884
+ const agentError = new import_shared20.CopilotKitAgentDiscoveryError({
4303
2885
  agentName: action.name,
4304
2886
  availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
4305
2887
  });
@@ -4317,7 +2899,7 @@ function useCoAgentStateRender(action, dependencies) {
4317
2899
  }
4318
2900
  }
4319
2901
  }
4320
- (0, import_react35.useEffect)(() => {
2902
+ (0, import_react33.useEffect)(() => {
4321
2903
  const currentId = idRef.current;
4322
2904
  const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {
4323
2905
  if (id === currentId)
@@ -4341,7 +2923,7 @@ function useCoAgentStateRender(action, dependencies) {
4341
2923
  });
4342
2924
  }
4343
2925
  }, [coAgentStateRenders]);
4344
- (0, import_react35.useEffect)(() => {
2926
+ (0, import_react33.useEffect)(() => {
4345
2927
  setCoAgentStateRender(idRef.current, action);
4346
2928
  if (chatComponentsCache.current !== null && action.render !== void 0) {
4347
2929
  chatComponentsCache.current.coAgentStateRenders[key] = action.render;
@@ -4361,12 +2943,12 @@ function useCoAgentStateRender(action, dependencies) {
4361
2943
  }
4362
2944
 
4363
2945
  // src/hooks/use-make-copilot-document-readable.ts
4364
- var import_react36 = require("react");
4365
- function useMakeCopilotDocumentReadable(document2, categories, dependencies = []) {
2946
+ var import_react34 = require("react");
2947
+ function useMakeCopilotDocumentReadable(document, categories, dependencies = []) {
4366
2948
  const { addDocumentContext, removeDocumentContext } = useCopilotContext();
4367
- const idRef = (0, import_react36.useRef)(void 0);
4368
- (0, import_react36.useEffect)(() => {
4369
- const id = addDocumentContext(document2, categories);
2949
+ const idRef = (0, import_react34.useRef)(void 0);
2950
+ (0, import_react34.useEffect)(() => {
2951
+ const id = addDocumentContext(document, categories);
4370
2952
  idRef.current = id;
4371
2953
  return () => {
4372
2954
  removeDocumentContext(id);
@@ -4376,12 +2958,12 @@ function useMakeCopilotDocumentReadable(document2, categories, dependencies = []
4376
2958
  }
4377
2959
 
4378
2960
  // src/hooks/use-copilot-readable.ts
4379
- var import_react37 = require("@copilotkitnext/react");
4380
- var import_react38 = require("react");
2961
+ var import_react35 = require("@copilotkitnext/react");
2962
+ var import_react36 = require("react");
4381
2963
  function useCopilotReadable({ description, value, convert, available }, dependencies) {
4382
- const { copilotkit } = (0, import_react37.useCopilotKit)();
4383
- const ctxIdRef = (0, import_react38.useRef)(void 0);
4384
- (0, import_react38.useEffect)(() => {
2964
+ const { copilotkit } = (0, import_react35.useCopilotKit)();
2965
+ const ctxIdRef = (0, import_react36.useRef)(void 0);
2966
+ (0, import_react36.useEffect)(() => {
4385
2967
  if (!copilotkit)
4386
2968
  return;
4387
2969
  const found = Object.entries(copilotkit.context).find(([id, ctxItem]) => {
@@ -4409,13 +2991,13 @@ function useCopilotReadable({ description, value, convert, available }, dependen
4409
2991
  }
4410
2992
 
4411
2993
  // src/hooks/use-coagent.ts
4412
- var import_react39 = require("react");
4413
- var import_react40 = require("@copilotkitnext/react");
2994
+ var import_react37 = require("react");
2995
+ var import_react38 = require("@copilotkitnext/react");
4414
2996
  function useCoAgent(options) {
4415
- const { agent } = (0, import_react40.useAgent)({ agentId: options.name });
4416
- const { copilotkit } = (0, import_react40.useCopilotKit)();
2997
+ const { agent } = (0, import_react38.useAgent)({ agentId: options.name });
2998
+ const { copilotkit } = (0, import_react38.useCopilotKit)();
4417
2999
  const nodeName = useAgentNodeName(options.name);
4418
- const handleStateUpdate = (0, import_react39.useCallback)(
3000
+ const handleStateUpdate = (0, import_react37.useCallback)(
4419
3001
  (newState) => {
4420
3002
  if (!agent)
4421
3003
  return;
@@ -4428,7 +3010,7 @@ function useCoAgent(options) {
4428
3010
  },
4429
3011
  [agent == null ? void 0 : agent.state, agent == null ? void 0 : agent.setState]
4430
3012
  );
4431
- (0, import_react39.useEffect)(() => {
3013
+ (0, import_react37.useEffect)(() => {
4432
3014
  var _a;
4433
3015
  if (!options.config && !options.configurable)
4434
3016
  return;
@@ -4440,22 +3022,22 @@ function useCoAgent(options) {
4440
3022
  }
4441
3023
  copilotkit.setProperties(config);
4442
3024
  }, [options.config, options.configurable]);
4443
- const externalStateStr = (0, import_react39.useMemo)(
3025
+ const externalStateStr = (0, import_react37.useMemo)(
4444
3026
  () => isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0,
4445
3027
  [isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0]
4446
3028
  );
4447
- (0, import_react39.useEffect)(() => {
3029
+ (0, import_react37.useEffect)(() => {
4448
3030
  if ((agent == null ? void 0 : agent.state) && isExternalStateManagement(options) && JSON.stringify(options.state) !== JSON.stringify(agent.state)) {
4449
3031
  handleStateUpdate(options.state);
4450
3032
  }
4451
3033
  }, [agent, externalStateStr, handleStateUpdate]);
4452
- const hasStateValues = (0, import_react39.useCallback)((value) => {
3034
+ const hasStateValues = (0, import_react37.useCallback)((value) => {
4453
3035
  return Boolean(value && Object.keys(value).length);
4454
3036
  }, []);
4455
- const initialStateRef = (0, import_react39.useRef)(
3037
+ const initialStateRef = (0, import_react37.useRef)(
4456
3038
  isExternalStateManagement(options) ? options.state : "initialState" in options ? options.initialState : void 0
4457
3039
  );
4458
- (0, import_react39.useEffect)(() => {
3040
+ (0, import_react37.useEffect)(() => {
4459
3041
  if (isExternalStateManagement(options)) {
4460
3042
  initialStateRef.current = options.state;
4461
3043
  } else if ("initialState" in options) {
@@ -4464,7 +3046,7 @@ function useCoAgent(options) {
4464
3046
  }, [
4465
3047
  isExternalStateManagement(options) ? JSON.stringify(options.state) : "initialState" in options ? JSON.stringify(options.initialState) : void 0
4466
3048
  ]);
4467
- (0, import_react39.useEffect)(() => {
3049
+ (0, import_react37.useEffect)(() => {
4468
3050
  if (!agent)
4469
3051
  return;
4470
3052
  const subscriber = {
@@ -4492,7 +3074,7 @@ function useCoAgent(options) {
4492
3074
  subscription.unsubscribe();
4493
3075
  };
4494
3076
  }, [agent, handleStateUpdate, hasStateValues]);
4495
- return (0, import_react39.useMemo)(() => {
3077
+ return (0, import_react37.useMemo)(() => {
4496
3078
  var _a, _b, _c;
4497
3079
  if (!agent) {
4498
3080
  const noop = () => {
@@ -4548,12 +3130,12 @@ var isExternalStateManagement = (options) => {
4548
3130
 
4549
3131
  // src/hooks/use-copilot-runtime-client.ts
4550
3132
  var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
4551
- var import_react41 = require("react");
4552
- var import_shared22 = require("@copilotkit/shared");
3133
+ var import_react39 = require("react");
3134
+ var import_shared21 = require("@copilotkit/shared");
4553
3135
  var useCopilotRuntimeClient = (options) => {
4554
3136
  const { setBannerError } = useToast();
4555
3137
  const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
4556
- const lastStructuredErrorRef = (0, import_react41.useRef)(null);
3138
+ const lastStructuredErrorRef = (0, import_react39.useRef)(null);
4557
3139
  const traceUIError = (error, originalError) => __async(void 0, null, function* () {
4558
3140
  try {
4559
3141
  const errorEvent = {
@@ -4579,7 +3161,7 @@ var useCopilotRuntimeClient = (options) => {
4579
3161
  console.error("Error in onError handler:", error2);
4580
3162
  }
4581
3163
  });
4582
- const runtimeClient = (0, import_react41.useMemo)(() => {
3164
+ const runtimeClient = (0, import_react39.useMemo)(() => {
4583
3165
  return new import_runtime_client_gql3.CopilotRuntimeClient(__spreadProps(__spreadValues({}, runtimeOptions), {
4584
3166
  handleGQLErrors: (error) => {
4585
3167
  var _a2;
@@ -4588,7 +3170,7 @@ var useCopilotRuntimeClient = (options) => {
4588
3170
  const routeError = (gqlError) => {
4589
3171
  const extensions = gqlError.extensions;
4590
3172
  const visibility = extensions == null ? void 0 : extensions.visibility;
4591
- if (visibility === import_shared22.ErrorVisibility.SILENT) {
3173
+ if (visibility === import_shared21.ErrorVisibility.SILENT) {
4592
3174
  console.error("CopilotKit Silent Error:", gqlError.message);
4593
3175
  return;
4594
3176
  }
@@ -4603,9 +3185,9 @@ var useCopilotRuntimeClient = (options) => {
4603
3185
  setBannerError(ckError);
4604
3186
  traceUIError(ckError, gqlError);
4605
3187
  } else {
4606
- const fallbackError = new import_shared22.CopilotKitError({
3188
+ const fallbackError = new import_shared21.CopilotKitError({
4607
3189
  message: gqlError.message,
4608
- code: import_shared22.CopilotKitErrorCode.UNKNOWN
3190
+ code: import_shared21.CopilotKitErrorCode.UNKNOWN
4609
3191
  });
4610
3192
  setBannerError(fallbackError);
4611
3193
  traceUIError(fallbackError, gqlError);
@@ -4613,9 +3195,9 @@ var useCopilotRuntimeClient = (options) => {
4613
3195
  };
4614
3196
  graphQLErrors.forEach(routeError);
4615
3197
  } else {
4616
- const fallbackError = new import_shared22.CopilotKitError({
3198
+ const fallbackError = new import_shared21.CopilotKitError({
4617
3199
  message: (error == null ? void 0 : error.message) || String(error),
4618
- code: import_shared22.CopilotKitErrorCode.UNKNOWN
3200
+ code: import_shared21.CopilotKitErrorCode.UNKNOWN
4619
3201
  });
4620
3202
  setBannerError(fallbackError);
4621
3203
  traceUIError(fallbackError, error);
@@ -4623,9 +3205,9 @@ var useCopilotRuntimeClient = (options) => {
4623
3205
  },
4624
3206
  handleGQLWarning: (message) => {
4625
3207
  console.warn(message);
4626
- const warningError = new import_shared22.CopilotKitError({
3208
+ const warningError = new import_shared21.CopilotKitError({
4627
3209
  message,
4628
- code: import_shared22.CopilotKitErrorCode.UNKNOWN
3210
+ code: import_shared21.CopilotKitErrorCode.UNKNOWN
4629
3211
  });
4630
3212
  setBannerError(warningError);
4631
3213
  }
@@ -4640,16 +3222,16 @@ function createStructuredError(gqlError) {
4640
3222
  const message = (originalError == null ? void 0 : originalError.message) || gqlError.message;
4641
3223
  const code = extensions == null ? void 0 : extensions.code;
4642
3224
  if (code) {
4643
- return new import_shared22.CopilotKitError({ message, code });
3225
+ return new import_shared21.CopilotKitError({ message, code });
4644
3226
  }
4645
3227
  if ((_a = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _a.includes("CopilotApiDiscoveryError")) {
4646
- return new import_shared22.CopilotKitApiDiscoveryError({ message });
3228
+ return new import_shared21.CopilotKitApiDiscoveryError({ message });
4647
3229
  }
4648
3230
  if ((_b = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _b.includes("CopilotKitRemoteEndpointDiscoveryError")) {
4649
- return new import_shared22.CopilotKitRemoteEndpointDiscoveryError({ message });
3231
+ return new import_shared21.CopilotKitRemoteEndpointDiscoveryError({ message });
4650
3232
  }
4651
3233
  if ((_c = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _c.includes("CopilotKitAgentDiscoveryError")) {
4652
- return new import_shared22.CopilotKitAgentDiscoveryError({
3234
+ return new import_shared21.CopilotKitAgentDiscoveryError({
4653
3235
  agentName: "",
4654
3236
  availableAgents: []
4655
3237
  });
@@ -4658,28 +3240,28 @@ function createStructuredError(gqlError) {
4658
3240
  }
4659
3241
 
4660
3242
  // src/hooks/use-copilot-authenticated-action.ts
4661
- var import_react42 = require("react");
4662
- var import_react43 = __toESM(require("react"));
3243
+ var import_react40 = require("react");
3244
+ var import_react41 = __toESM(require("react"));
4663
3245
  function useCopilotAuthenticatedAction_c(action, dependencies) {
4664
3246
  const { authConfig_c, authStates_c, setAuthStates_c } = useCopilotContext();
4665
- const pendingActionRef = (0, import_react42.useRef)(null);
4666
- const executeAction = (0, import_react42.useCallback)(
3247
+ const pendingActionRef = (0, import_react40.useRef)(null);
3248
+ const executeAction = (0, import_react40.useCallback)(
4667
3249
  (props) => {
4668
3250
  if (typeof action.render === "function") {
4669
3251
  return action.render(props);
4670
3252
  }
4671
- return action.render || import_react43.default.createElement(import_react42.Fragment);
3253
+ return action.render || import_react41.default.createElement(import_react40.Fragment);
4672
3254
  },
4673
3255
  [action]
4674
3256
  );
4675
- const wrappedRender = (0, import_react42.useCallback)(
3257
+ const wrappedRender = (0, import_react40.useCallback)(
4676
3258
  (props) => {
4677
3259
  const isAuthenticated = Object.values(authStates_c || {}).some(
4678
3260
  (state) => state.status === "authenticated"
4679
3261
  );
4680
3262
  if (!isAuthenticated) {
4681
3263
  pendingActionRef.current = props;
4682
- return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react43.default.createElement(authConfig_c.SignInComponent, {
3264
+ return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react41.default.createElement(authConfig_c.SignInComponent, {
4683
3265
  onSignInComplete: (authState) => {
4684
3266
  setAuthStates_c == null ? void 0 : setAuthStates_c((prev) => __spreadProps(__spreadValues({}, prev), { [action.name]: authState }));
4685
3267
  if (pendingActionRef.current) {
@@ -4687,7 +3269,7 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
4687
3269
  pendingActionRef.current = null;
4688
3270
  }
4689
3271
  }
4690
- }) : import_react43.default.createElement(import_react42.Fragment);
3272
+ }) : import_react41.default.createElement(import_react40.Fragment);
4691
3273
  }
4692
3274
  return executeAction(props);
4693
3275
  },
@@ -4702,13 +3284,13 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
4702
3284
  }
4703
3285
 
4704
3286
  // src/hooks/use-langgraph-interrupt.ts
4705
- var import_react44 = require("react");
4706
- var import_shared23 = require("@copilotkit/shared");
3287
+ var import_react42 = require("react");
3288
+ var import_shared22 = require("@copilotkit/shared");
4707
3289
  function useLangGraphInterrupt(action, dependencies) {
4708
- const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0, import_react44.useContext)(CopilotContext);
3290
+ const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0, import_react42.useContext)(CopilotContext);
4709
3291
  const { addToast } = useToast();
4710
- const actionId = (0, import_shared23.dataToUUID)(action, "lgAction");
4711
- (0, import_react44.useEffect)(() => {
3292
+ const actionId = (0, import_shared22.dataToUUID)(action, "lgAction");
3293
+ (0, import_react42.useEffect)(() => {
4712
3294
  if (!action)
4713
3295
  return;
4714
3296
  setInterruptAction(__spreadProps(__spreadValues({}, action), { id: actionId }));
@@ -4719,10 +3301,10 @@ function useLangGraphInterrupt(action, dependencies) {
4719
3301
  }
4720
3302
 
4721
3303
  // src/hooks/use-copilot-additional-instructions.ts
4722
- var import_react45 = require("react");
3304
+ var import_react43 = require("react");
4723
3305
  function useCopilotAdditionalInstructions({ instructions, available = "enabled" }, dependencies) {
4724
3306
  const { setAdditionalInstructions } = useCopilotContext();
4725
- (0, import_react45.useEffect)(() => {
3307
+ (0, import_react43.useEffect)(() => {
4726
3308
  if (available === "disabled")
4727
3309
  return;
4728
3310
  setAdditionalInstructions((prevInstructions) => [...prevInstructions || [], instructions]);
@@ -4740,10 +3322,10 @@ function useDefaultTool(tool, dependencies) {
4740
3322
  }
4741
3323
 
4742
3324
  // src/hooks/use-copilot-chat-suggestions.tsx
4743
- var import_react46 = require("@copilotkitnext/react");
3325
+ var import_react44 = require("@copilotkitnext/react");
4744
3326
  function useCopilotChatSuggestions(config, dependencies = []) {
4745
3327
  var _a, _b;
4746
- const existingConfig = (0, import_react46.useCopilotChatConfiguration)();
3328
+ const existingConfig = (0, import_react44.useCopilotChatConfiguration)();
4747
3329
  const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
4748
3330
  const available = (_b = config.available === "enabled" ? "always" : config.available) != null ? _b : "before-first-message";
4749
3331
  const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
@@ -4751,7 +3333,7 @@ function useCopilotChatSuggestions(config, dependencies = []) {
4751
3333
  consumerAgentId: resolvedAgentId
4752
3334
  // Use chatConfig.agentId here
4753
3335
  });
4754
- (0, import_react46.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
3336
+ (0, import_react44.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
4755
3337
  }
4756
3338
 
4757
3339
  // src/lib/copilot-task.ts
@@ -4759,7 +3341,7 @@ var import_runtime_client_gql5 = require("@copilotkit/runtime-client-gql");
4759
3341
 
4760
3342
  // src/types/frontend-action.ts
4761
3343
  var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
4762
- var import_shared24 = require("@copilotkit/shared");
3344
+ var import_shared23 = require("@copilotkit/shared");
4763
3345
  function processActionsForRuntimeRequest(actions) {
4764
3346
  const filteredActions = actions.filter(
4765
3347
  (action) => action.available !== import_runtime_client_gql4.ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction
@@ -4775,7 +3357,7 @@ function processActionsForRuntimeRequest(actions) {
4775
3357
  return {
4776
3358
  name: action.name,
4777
3359
  description: action.description || "",
4778
- jsonSchema: JSON.stringify((0, import_shared24.actionParametersToJsonSchema)(action.parameters || [])),
3360
+ jsonSchema: JSON.stringify((0, import_shared23.actionParametersToJsonSchema)(action.parameters || [])),
4779
3361
  available
4780
3362
  };
4781
3363
  });