@copilotkit/react-core 1.50.0-beta.12 → 1.50.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-66TKKRF4.mjs → chunk-6MMP5LPV.mjs} +2 -2
- package/dist/{chunk-U2ZRVVKT.mjs → chunk-7VKOBXCY.mjs} +2 -2
- package/dist/{chunk-LHERIF3L.mjs → chunk-7X3E6GHT.mjs} +5 -5
- package/dist/{chunk-4TKK4322.mjs → chunk-EV2FIZFH.mjs} +2 -2
- package/dist/{chunk-4HRUQH6U.mjs → chunk-NX57QKMK.mjs} +2 -2
- package/dist/{chunk-2YI623SR.mjs → chunk-OJVWPLC4.mjs} +2 -2
- package/dist/{chunk-EG56H77V.mjs → chunk-PLXQ2PM6.mjs} +4 -4
- package/dist/{chunk-VSQWPEYV.mjs → chunk-QHAYENR3.mjs} +4 -4
- package/dist/{chunk-WEKQV2OD.mjs → chunk-UUMLIYAK.mjs} +23 -23
- package/dist/chunk-UUMLIYAK.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit.js +126 -1153
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +7 -10
- package/dist/components/copilot-provider/index.js +126 -1153
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +7 -10
- package/dist/components/dev-console/console-trigger.mjs +225 -5
- package/dist/components/dev-console/console-trigger.mjs.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.js +126 -1153
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +7 -10
- package/dist/context/index.mjs +5 -5
- package/dist/hooks/index.mjs +28 -28
- package/dist/hooks/use-coagent-state-render-bridge.mjs +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat-headless_c.mjs +7 -7
- package/dist/hooks/use-copilot-chat.mjs +7 -7
- package/dist/hooks/use-copilot-chat_internal.mjs +6 -6
- package/dist/hooks/use-default-tool.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/index.js +273 -1291
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -55
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +8 -11
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +8 -11
- package/package.json +5 -5
- package/src/components/copilot-provider/copilotkit.tsx +9 -9
- package/dist/chunk-PMWUKW3Z.mjs +0 -231
- package/dist/chunk-PMWUKW3Z.mjs.map +0 -1
- package/dist/chunk-WEKQV2OD.mjs.map +0 -1
- /package/dist/{chunk-66TKKRF4.mjs.map → chunk-6MMP5LPV.mjs.map} +0 -0
- /package/dist/{chunk-U2ZRVVKT.mjs.map → chunk-7VKOBXCY.mjs.map} +0 -0
- /package/dist/{chunk-LHERIF3L.mjs.map → chunk-7X3E6GHT.mjs.map} +0 -0
- /package/dist/{chunk-4TKK4322.mjs.map → chunk-EV2FIZFH.mjs.map} +0 -0
- /package/dist/{chunk-4HRUQH6U.mjs.map → chunk-NX57QKMK.mjs.map} +0 -0
- /package/dist/{chunk-2YI623SR.mjs.map → chunk-OJVWPLC4.mjs.map} +0 -0
- /package/dist/{chunk-EG56H77V.mjs.map → chunk-PLXQ2PM6.mjs.map} +0 -0
- /package/dist/{chunk-VSQWPEYV.mjs.map → chunk-QHAYENR3.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
|
|
123
|
-
var
|
|
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
|
|
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,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAAB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8nc0AtsumIPZnfGC/7IqK+iK5TtQyo3YpS/TScsRW9opg5YYlO5fYKX0ByjzgwBEanUSOTEui2MDjf0vlrLr7VvvmRUBcac7mLNeBxqNlADJmTzlPwMYzXlcgv8yttBufdaeXBynhsIt8OEK3qupVyOcpnr9Dhruh1EOKnjztT2Ds1ja+q0yPm5fOp2uCwD1MKzesLnTyv6plHUuwDiH8FAu0CIoC6SFvZH837ar3ill4+5BV6/4ecfOLeBAw/HyryLiMwDmFdg3Min5aTS+Tz9zvXNps+H/s18fwQ7FcwDOayDosXAHWLIH54l0Nlrn4oRkLR1g9BX4t8I81iAbPW5VvgE5NbyMyf8zzKsySnL5NXMspd0w9v3cIvM+CMSr39s3G7d7MJbhwWUWIrt8hYeXAu9ndFGfZ2j9C8Lizv/Zb5ce5qEm7j2cibbT6cN/i+7qOMAxDzejA38hdiu6CKYDYBLVWolRQh9bMzZYOcdHtQqHErYEQHEmqgMWk3TeFgDzU5jKf9v3znv02X+guVVjEsFXH+A6kcdaD1Aub29v//VzChi1b49X4vdRhLr11vsHN1pz7Qj8bDKrLULpdyJzKocw1OwCKBm2zYKPCh1PiQ87sujILdnw1gKQrQiMDNmTj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+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
|
|
2376
|
-
var
|
|
2377
|
-
var CoAgentStateRendersContext = (0,
|
|
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,
|
|
2382
|
-
const setCoAgentStateRender = (0,
|
|
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,
|
|
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,
|
|
2395
|
-
return /* @__PURE__ */ (0,
|
|
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,
|
|
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
|
|
2418
|
-
var
|
|
1395
|
+
var import_react11 = require("@copilotkitnext/react");
|
|
1396
|
+
var import_react12 = require("react");
|
|
2419
1397
|
|
|
2420
1398
|
// src/context/threads-context.tsx
|
|
2421
|
-
var
|
|
2422
|
-
var
|
|
2423
|
-
var
|
|
2424
|
-
var ThreadsContext = (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,
|
|
1404
|
+
const [internalThreadId, setThreadId] = (0, import_react10.useState)(explicitThreadId != null ? explicitThreadId : (0, import_shared8.randomUUID)());
|
|
2427
1405
|
const threadId = internalThreadId;
|
|
2428
|
-
return /* @__PURE__ */ (0,
|
|
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,
|
|
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
|
|
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,
|
|
2475
|
-
const [nodeName, setNodeName] = (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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
2601
|
-
var
|
|
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,
|
|
2606
|
-
const getSubscriber = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
2638
|
-
const existingConfig = (0,
|
|
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,
|
|
1619
|
+
const { agent } = (0, import_react14.useAgent)({ agentId: resolvedAgentId });
|
|
2642
1620
|
usePredictStateSubscription(agent);
|
|
2643
|
-
(0,
|
|
1621
|
+
(0, import_react13.useEffect)(() => {
|
|
2644
1622
|
const subscriber = {
|
|
2645
1623
|
onError: ({ error }) => {
|
|
2646
|
-
setBannerError(new
|
|
1624
|
+
setBannerError(new import_shared11.CopilotKitLowLevelError({ error, message: error.message }));
|
|
2647
1625
|
}
|
|
2648
1626
|
};
|
|
2649
1627
|
const subscription = copilotkit.subscribe(subscriber);
|
|
@@ -2655,60 +1633,65 @@ function CopilotListeners() {
|
|
|
2655
1633
|
}
|
|
2656
1634
|
|
|
2657
1635
|
// src/components/copilot-provider/copilotkit.tsx
|
|
2658
|
-
var
|
|
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);
|
|
2662
1640
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
2663
1641
|
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
2664
|
-
const renderArr = (0,
|
|
2665
|
-
return /* @__PURE__ */ (0,
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
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
|
+
) }) }) });
|
|
2669
1652
|
}
|
|
2670
1653
|
function CopilotKitInternal(cpkProps) {
|
|
2671
1654
|
var _b;
|
|
2672
1655
|
const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
|
|
2673
1656
|
validateProps(cpkProps);
|
|
2674
1657
|
const publicApiKey = props.publicLicenseKey || props.publicApiKey;
|
|
2675
|
-
const chatApiEndpoint = props.runtimeUrl ||
|
|
2676
|
-
const [actions, setActions] = (0,
|
|
2677
|
-
const [registeredActionConfigs, setRegisteredActionConfigs] = (0,
|
|
2678
|
-
const chatComponentsCache = (0,
|
|
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)({
|
|
2679
1662
|
actions: {},
|
|
2680
1663
|
coAgentStateRenders: {}
|
|
2681
1664
|
});
|
|
2682
1665
|
const { addElement, removeElement, printTree, getAllElements } = use_tree_default();
|
|
2683
|
-
const [isLoading, setIsLoading] = (0,
|
|
2684
|
-
const [chatInstructions, setChatInstructions] = (0,
|
|
2685
|
-
const [authStates, setAuthStates] = (0,
|
|
2686
|
-
const [extensions, setExtensions] = (0,
|
|
2687
|
-
const [additionalInstructions, setAdditionalInstructions] = (0,
|
|
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)([]);
|
|
2688
1671
|
const {
|
|
2689
1672
|
addElement: addDocument,
|
|
2690
1673
|
removeElement: removeDocument,
|
|
2691
1674
|
allElements: allDocuments
|
|
2692
1675
|
} = use_flat_category_store_default();
|
|
2693
|
-
const setAction = (0,
|
|
1676
|
+
const setAction = (0, import_react15.useCallback)((id, action) => {
|
|
2694
1677
|
setActions((prevPoints) => {
|
|
2695
1678
|
return __spreadProps(__spreadValues({}, prevPoints), {
|
|
2696
1679
|
[id]: action
|
|
2697
1680
|
});
|
|
2698
1681
|
});
|
|
2699
1682
|
}, []);
|
|
2700
|
-
const removeAction = (0,
|
|
1683
|
+
const removeAction = (0, import_react15.useCallback)((id) => {
|
|
2701
1684
|
setActions((prevPoints) => {
|
|
2702
1685
|
const newPoints = __spreadValues({}, prevPoints);
|
|
2703
1686
|
delete newPoints[id];
|
|
2704
1687
|
return newPoints;
|
|
2705
1688
|
});
|
|
2706
1689
|
}, []);
|
|
2707
|
-
const getContextString = (0,
|
|
1690
|
+
const getContextString = (0, import_react15.useCallback)(
|
|
2708
1691
|
(documents, categories) => {
|
|
2709
|
-
const documentsString = documents.map((
|
|
2710
|
-
return `${
|
|
2711
|
-
${
|
|
1692
|
+
const documentsString = documents.map((document) => {
|
|
1693
|
+
return `${document.name} (${document.sourceApplication}):
|
|
1694
|
+
${document.getContents()}`;
|
|
2712
1695
|
}).join("\n\n");
|
|
2713
1696
|
const nonDocumentStrings = printTree(categories);
|
|
2714
1697
|
return `${documentsString}
|
|
@@ -2717,46 +1700,46 @@ ${nonDocumentStrings}`;
|
|
|
2717
1700
|
},
|
|
2718
1701
|
[printTree]
|
|
2719
1702
|
);
|
|
2720
|
-
const addContext = (0,
|
|
1703
|
+
const addContext = (0, import_react15.useCallback)(
|
|
2721
1704
|
(context, parentId, categories = defaultCopilotContextCategories) => {
|
|
2722
1705
|
return addElement(context, categories, parentId);
|
|
2723
1706
|
},
|
|
2724
1707
|
[addElement]
|
|
2725
1708
|
);
|
|
2726
|
-
const removeContext = (0,
|
|
1709
|
+
const removeContext = (0, import_react15.useCallback)(
|
|
2727
1710
|
(id) => {
|
|
2728
1711
|
removeElement(id);
|
|
2729
1712
|
},
|
|
2730
1713
|
[removeElement]
|
|
2731
1714
|
);
|
|
2732
|
-
const getAllContext = (0,
|
|
1715
|
+
const getAllContext = (0, import_react15.useCallback)(() => {
|
|
2733
1716
|
return getAllElements();
|
|
2734
1717
|
}, [getAllElements]);
|
|
2735
|
-
const getFunctionCallHandler = (0,
|
|
1718
|
+
const getFunctionCallHandler = (0, import_react15.useCallback)(
|
|
2736
1719
|
(customEntryPoints) => {
|
|
2737
1720
|
return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || actions));
|
|
2738
1721
|
},
|
|
2739
1722
|
[actions]
|
|
2740
1723
|
);
|
|
2741
|
-
const getDocumentsContext = (0,
|
|
1724
|
+
const getDocumentsContext = (0, import_react15.useCallback)(
|
|
2742
1725
|
(categories) => {
|
|
2743
1726
|
return allDocuments(categories);
|
|
2744
1727
|
},
|
|
2745
1728
|
[allDocuments]
|
|
2746
1729
|
);
|
|
2747
|
-
const addDocumentContext = (0,
|
|
1730
|
+
const addDocumentContext = (0, import_react15.useCallback)(
|
|
2748
1731
|
(documentPointer, categories = defaultCopilotContextCategories) => {
|
|
2749
1732
|
return addDocument(documentPointer, categories);
|
|
2750
1733
|
},
|
|
2751
1734
|
[addDocument]
|
|
2752
1735
|
);
|
|
2753
|
-
const removeDocumentContext = (0,
|
|
1736
|
+
const removeDocumentContext = (0, import_react15.useCallback)(
|
|
2754
1737
|
(documentId) => {
|
|
2755
1738
|
removeDocument(documentId);
|
|
2756
1739
|
},
|
|
2757
1740
|
[removeDocument]
|
|
2758
1741
|
);
|
|
2759
|
-
const copilotApiConfig = (0,
|
|
1742
|
+
const copilotApiConfig = (0, import_react15.useMemo)(() => {
|
|
2760
1743
|
var _a2, _b2;
|
|
2761
1744
|
let cloud = void 0;
|
|
2762
1745
|
if (publicApiKey) {
|
|
@@ -2792,7 +1775,7 @@ ${nonDocumentStrings}`;
|
|
|
2792
1775
|
props.cloudRestrictToTopic,
|
|
2793
1776
|
props.guardrails_c
|
|
2794
1777
|
]);
|
|
2795
|
-
const headers = (0,
|
|
1778
|
+
const headers = (0, import_react15.useMemo)(() => {
|
|
2796
1779
|
const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
|
|
2797
1780
|
if (state.status === "authenticated" && state.authHeaders) {
|
|
2798
1781
|
return __spreadValues(__spreadValues({}, acc), Object.entries(state.authHeaders).reduce(
|
|
@@ -2804,27 +1787,27 @@ ${nonDocumentStrings}`;
|
|
|
2804
1787
|
}
|
|
2805
1788
|
return acc;
|
|
2806
1789
|
}, {});
|
|
2807
|
-
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [
|
|
1790
|
+
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [import_shared12.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {}), authHeaders);
|
|
2808
1791
|
}, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
|
|
2809
|
-
const [internalErrorHandlers, _setInternalErrorHandler] = (0,
|
|
2810
|
-
const setInternalErrorHandler = (0,
|
|
1792
|
+
const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react15.useState)({});
|
|
1793
|
+
const setInternalErrorHandler = (0, import_react15.useCallback)((handler) => {
|
|
2811
1794
|
_setInternalErrorHandler((prev) => __spreadValues(__spreadValues({}, prev), handler));
|
|
2812
1795
|
}, []);
|
|
2813
|
-
const removeInternalErrorHandler = (0,
|
|
1796
|
+
const removeInternalErrorHandler = (0, import_react15.useCallback)((key) => {
|
|
2814
1797
|
_setInternalErrorHandler((prev) => {
|
|
2815
1798
|
const _a2 = prev, { [key]: _removed } = _a2, rest = __objRest(_a2, [__restKey(key)]);
|
|
2816
1799
|
return rest;
|
|
2817
1800
|
});
|
|
2818
1801
|
}, []);
|
|
2819
|
-
const onErrorRef = (0,
|
|
2820
|
-
(0,
|
|
1802
|
+
const onErrorRef = (0, import_react15.useRef)(props.onError);
|
|
1803
|
+
(0, import_react15.useEffect)(() => {
|
|
2821
1804
|
onErrorRef.current = props.onError;
|
|
2822
1805
|
}, [props.onError]);
|
|
2823
|
-
const internalHandlersRef = (0,
|
|
2824
|
-
(0,
|
|
1806
|
+
const internalHandlersRef = (0, import_react15.useRef)({});
|
|
1807
|
+
(0, import_react15.useEffect)(() => {
|
|
2825
1808
|
internalHandlersRef.current = internalErrorHandlers;
|
|
2826
1809
|
}, [internalErrorHandlers]);
|
|
2827
|
-
const handleErrors = (0,
|
|
1810
|
+
const handleErrors = (0, import_react15.useCallback)(
|
|
2828
1811
|
(error) => __async(this, null, function* () {
|
|
2829
1812
|
if (copilotApiConfig.publicApiKey && onErrorRef.current) {
|
|
2830
1813
|
try {
|
|
@@ -2844,14 +1827,14 @@ ${nonDocumentStrings}`;
|
|
|
2844
1827
|
}),
|
|
2845
1828
|
[copilotApiConfig.publicApiKey]
|
|
2846
1829
|
);
|
|
2847
|
-
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0,
|
|
2848
|
-
const addChatSuggestionConfiguration = (0,
|
|
1830
|
+
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react15.useState)({});
|
|
1831
|
+
const addChatSuggestionConfiguration = (0, import_react15.useCallback)(
|
|
2849
1832
|
(id, suggestion) => {
|
|
2850
1833
|
setChatSuggestionConfiguration((prev) => __spreadProps(__spreadValues({}, prev), { [id]: suggestion }));
|
|
2851
1834
|
},
|
|
2852
1835
|
[setChatSuggestionConfiguration]
|
|
2853
1836
|
);
|
|
2854
|
-
const removeChatSuggestionConfiguration = (0,
|
|
1837
|
+
const removeChatSuggestionConfiguration = (0, import_react15.useCallback)(
|
|
2855
1838
|
(id) => {
|
|
2856
1839
|
setChatSuggestionConfiguration((prev) => {
|
|
2857
1840
|
const _a2 = prev, { [id]: _ } = _a2, rest = __objRest(_a2, [__restKey(id)]);
|
|
@@ -2860,10 +1843,10 @@ ${nonDocumentStrings}`;
|
|
|
2860
1843
|
},
|
|
2861
1844
|
[setChatSuggestionConfiguration]
|
|
2862
1845
|
);
|
|
2863
|
-
const [availableAgents, setAvailableAgents] = (0,
|
|
2864
|
-
const [coagentStates, setCoagentStates] = (0,
|
|
2865
|
-
const coagentStatesRef = (0,
|
|
2866
|
-
const setCoagentStatesWithRef = (0,
|
|
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)(
|
|
2867
1850
|
(value) => {
|
|
2868
1851
|
const newValue = typeof value === "function" ? value(coagentStatesRef.current) : value;
|
|
2869
1852
|
coagentStatesRef.current = newValue;
|
|
@@ -2879,8 +1862,8 @@ ${nonDocumentStrings}`;
|
|
|
2879
1862
|
agentName: props.agent
|
|
2880
1863
|
};
|
|
2881
1864
|
}
|
|
2882
|
-
const [agentSession, setAgentSession] = (0,
|
|
2883
|
-
(0,
|
|
1865
|
+
const [agentSession, setAgentSession] = (0, import_react15.useState)(initialAgentSession);
|
|
1866
|
+
(0, import_react15.useEffect)(() => {
|
|
2884
1867
|
if (props.agent) {
|
|
2885
1868
|
setAgentSession({
|
|
2886
1869
|
agentName: props.agent
|
|
@@ -2890,7 +1873,7 @@ ${nonDocumentStrings}`;
|
|
|
2890
1873
|
}
|
|
2891
1874
|
}, [props.agent]);
|
|
2892
1875
|
const { threadId, setThreadId: setInternalThreadId } = useThreads();
|
|
2893
|
-
const setThreadId = (0,
|
|
1876
|
+
const setThreadId = (0, import_react15.useCallback)(
|
|
2894
1877
|
(value) => {
|
|
2895
1878
|
if (props.threadId) {
|
|
2896
1879
|
throw new Error("Cannot call setThreadId() when threadId is provided via props.");
|
|
@@ -2899,11 +1882,11 @@ ${nonDocumentStrings}`;
|
|
|
2899
1882
|
},
|
|
2900
1883
|
[props.threadId]
|
|
2901
1884
|
);
|
|
2902
|
-
const [runId, setRunId] = (0,
|
|
2903
|
-
const chatAbortControllerRef = (0,
|
|
1885
|
+
const [runId, setRunId] = (0, import_react15.useState)(null);
|
|
1886
|
+
const chatAbortControllerRef = (0, import_react15.useRef)(null);
|
|
2904
1887
|
const showDevConsole = shouldShowDevConsole(props.showDevConsole);
|
|
2905
|
-
const [interruptActions, _setInterruptActions] = (0,
|
|
2906
|
-
const setInterruptAction = (0,
|
|
1888
|
+
const [interruptActions, _setInterruptActions] = (0, import_react15.useState)({});
|
|
1889
|
+
const setInterruptAction = (0, import_react15.useCallback)((action) => {
|
|
2907
1890
|
_setInterruptActions((prev) => {
|
|
2908
1891
|
var _a2;
|
|
2909
1892
|
if (action == null || !action.id) {
|
|
@@ -2914,14 +1897,14 @@ ${nonDocumentStrings}`;
|
|
|
2914
1897
|
});
|
|
2915
1898
|
});
|
|
2916
1899
|
}, []);
|
|
2917
|
-
const removeInterruptAction = (0,
|
|
1900
|
+
const removeInterruptAction = (0, import_react15.useCallback)((actionId) => {
|
|
2918
1901
|
_setInterruptActions((prev) => {
|
|
2919
1902
|
const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
|
|
2920
1903
|
return rest;
|
|
2921
1904
|
});
|
|
2922
1905
|
}, []);
|
|
2923
|
-
const [interruptEventQueue, setInterruptEventQueue] = (0,
|
|
2924
|
-
const addInterruptEvent = (0,
|
|
1906
|
+
const [interruptEventQueue, setInterruptEventQueue] = (0, import_react15.useState)({});
|
|
1907
|
+
const addInterruptEvent = (0, import_react15.useCallback)((queuedEvent) => {
|
|
2925
1908
|
setInterruptEventQueue((prev) => {
|
|
2926
1909
|
const threadQueue = prev[queuedEvent.threadId] || [];
|
|
2927
1910
|
return __spreadProps(__spreadValues({}, prev), {
|
|
@@ -2929,7 +1912,7 @@ ${nonDocumentStrings}`;
|
|
|
2929
1912
|
});
|
|
2930
1913
|
});
|
|
2931
1914
|
}, []);
|
|
2932
|
-
const resolveInterruptEvent = (0,
|
|
1915
|
+
const resolveInterruptEvent = (0, import_react15.useCallback)(
|
|
2933
1916
|
(threadId2, eventId, response) => {
|
|
2934
1917
|
setInterruptEventQueue((prev) => {
|
|
2935
1918
|
const threadQueue = prev[threadId2] || [];
|
|
@@ -2942,20 +1925,20 @@ ${nonDocumentStrings}`;
|
|
|
2942
1925
|
},
|
|
2943
1926
|
[]
|
|
2944
1927
|
);
|
|
2945
|
-
const memoizedChildren = (0,
|
|
2946
|
-
const [bannerError, setBannerError] = (0,
|
|
2947
|
-
const agentLock = (0,
|
|
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)(() => {
|
|
2948
1931
|
var _a2;
|
|
2949
1932
|
return (_a2 = props.agent) != null ? _a2 : null;
|
|
2950
1933
|
}, [props.agent]);
|
|
2951
|
-
const forwardedParameters = (0,
|
|
1934
|
+
const forwardedParameters = (0, import_react15.useMemo)(
|
|
2952
1935
|
() => {
|
|
2953
1936
|
var _a2;
|
|
2954
1937
|
return (_a2 = props.forwardedParameters) != null ? _a2 : {};
|
|
2955
1938
|
},
|
|
2956
1939
|
[props.forwardedParameters]
|
|
2957
1940
|
);
|
|
2958
|
-
const updateExtensions = (0,
|
|
1941
|
+
const updateExtensions = (0, import_react15.useCallback)(
|
|
2959
1942
|
(newExtensions) => {
|
|
2960
1943
|
setExtensions((prev) => {
|
|
2961
1944
|
const resolved = typeof newExtensions === "function" ? newExtensions(prev) : newExtensions;
|
|
@@ -2967,7 +1950,7 @@ ${nonDocumentStrings}`;
|
|
|
2967
1950
|
},
|
|
2968
1951
|
[setExtensions]
|
|
2969
1952
|
);
|
|
2970
|
-
const updateAuthStates = (0,
|
|
1953
|
+
const updateAuthStates = (0, import_react15.useCallback)(
|
|
2971
1954
|
(newAuthStates) => {
|
|
2972
1955
|
setAuthStates((prev) => {
|
|
2973
1956
|
const resolved = typeof newAuthStates === "function" ? newAuthStates(prev) : newAuthStates;
|
|
@@ -2979,8 +1962,8 @@ ${nonDocumentStrings}`;
|
|
|
2979
1962
|
},
|
|
2980
1963
|
[setAuthStates]
|
|
2981
1964
|
);
|
|
2982
|
-
const handleSetRegisteredActions = (0,
|
|
2983
|
-
const key = actionConfig.action.name || (0,
|
|
1965
|
+
const handleSetRegisteredActions = (0, import_react15.useCallback)((actionConfig) => {
|
|
1966
|
+
const key = actionConfig.action.name || (0, import_shared12.randomUUID)();
|
|
2984
1967
|
setRegisteredActionConfigs((prev) => {
|
|
2985
1968
|
const newMap = new Map(prev);
|
|
2986
1969
|
newMap.set(key, actionConfig);
|
|
@@ -2988,25 +1971,25 @@ ${nonDocumentStrings}`;
|
|
|
2988
1971
|
});
|
|
2989
1972
|
return key;
|
|
2990
1973
|
}, []);
|
|
2991
|
-
const handleRemoveRegisteredAction = (0,
|
|
1974
|
+
const handleRemoveRegisteredAction = (0, import_react15.useCallback)((actionKey) => {
|
|
2992
1975
|
setRegisteredActionConfigs((prev) => {
|
|
2993
1976
|
const newMap = new Map(prev);
|
|
2994
1977
|
newMap.delete(actionKey);
|
|
2995
1978
|
return newMap;
|
|
2996
1979
|
});
|
|
2997
1980
|
}, []);
|
|
2998
|
-
const RegisteredActionsRenderer = (0,
|
|
2999
|
-
return () => /* @__PURE__ */ (0,
|
|
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]) => {
|
|
3000
1983
|
const Component = config.component;
|
|
3001
|
-
return /* @__PURE__ */ (0,
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Component, { action: config.action }, key);
|
|
3002
1985
|
}) });
|
|
3003
1986
|
}, [registeredActionConfigs]);
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3005
|
-
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1988
|
+
import_react16.CopilotChatConfigurationProvider,
|
|
3006
1989
|
{
|
|
3007
1990
|
agentId: (_b = props.agent) != null ? _b : "default",
|
|
3008
1991
|
threadId,
|
|
3009
|
-
children: /* @__PURE__ */ (0,
|
|
1992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3010
1993
|
CopilotContext.Provider,
|
|
3011
1994
|
{
|
|
3012
1995
|
value: {
|
|
@@ -3068,14 +2051,13 @@ ${nonDocumentStrings}`;
|
|
|
3068
2051
|
removeInternalErrorHandler
|
|
3069
2052
|
},
|
|
3070
2053
|
children: [
|
|
3071
|
-
/* @__PURE__ */ (0,
|
|
3072
|
-
/* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
3074
2057
|
memoizedChildren,
|
|
3075
|
-
|
|
3076
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RegisteredActionsRenderer, {})
|
|
2058
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RegisteredActionsRenderer, {})
|
|
3077
2059
|
] }) }),
|
|
3078
|
-
bannerError && showDevConsole && /* @__PURE__ */ (0,
|
|
2060
|
+
bannerError && showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3079
2061
|
UsageBanner,
|
|
3080
2062
|
{
|
|
3081
2063
|
severity: bannerError.severity,
|
|
@@ -3124,33 +2106,33 @@ function validateProps(props) {
|
|
|
3124
2106
|
const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
|
|
3125
2107
|
const hasApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
3126
2108
|
if (!props.runtimeUrl && !hasApiKey) {
|
|
3127
|
-
throw new
|
|
2109
|
+
throw new import_shared12.ConfigurationError(
|
|
3128
2110
|
"Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
|
|
3129
2111
|
);
|
|
3130
2112
|
}
|
|
3131
2113
|
if (cloudFeatures.length > 0 && !hasApiKey) {
|
|
3132
|
-
throw new
|
|
2114
|
+
throw new import_shared12.MissingPublicApiKeyError(
|
|
3133
2115
|
`Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
|
|
3134
2116
|
);
|
|
3135
2117
|
}
|
|
3136
2118
|
}
|
|
3137
2119
|
|
|
3138
2120
|
// src/hooks/use-copilot-chat_internal.ts
|
|
3139
|
-
var
|
|
2121
|
+
var import_react23 = require("react");
|
|
3140
2122
|
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
3141
2123
|
|
|
3142
2124
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
3143
|
-
var
|
|
2125
|
+
var import_react19 = __toESM(require("react"));
|
|
3144
2126
|
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
3145
|
-
var
|
|
2127
|
+
var import_shared13 = require("@copilotkit/shared");
|
|
3146
2128
|
|
|
3147
2129
|
// src/hooks/use-agent-nodename.ts
|
|
3148
|
-
var
|
|
3149
|
-
var
|
|
2130
|
+
var import_react17 = require("react");
|
|
2131
|
+
var import_react18 = require("@copilotkitnext/react");
|
|
3150
2132
|
function useAgentNodeName(agentName) {
|
|
3151
|
-
const { agent } = (0,
|
|
3152
|
-
const nodeNameRef = (0,
|
|
3153
|
-
(0,
|
|
2133
|
+
const { agent } = (0, import_react18.useAgent)({ agentId: agentName });
|
|
2134
|
+
const nodeNameRef = (0, import_react17.useRef)("start");
|
|
2135
|
+
(0, import_react17.useEffect)(() => {
|
|
3154
2136
|
if (!agent)
|
|
3155
2137
|
return;
|
|
3156
2138
|
const subscriber = {
|
|
@@ -3173,7 +2155,7 @@ function useAgentNodeName(agentName) {
|
|
|
3173
2155
|
}
|
|
3174
2156
|
|
|
3175
2157
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
3176
|
-
var
|
|
2158
|
+
var import_react20 = require("@copilotkitnext/react");
|
|
3177
2159
|
var InterruptRenderer = ({ event, result, render, resolve }) => {
|
|
3178
2160
|
return render({ event, result, resolve });
|
|
3179
2161
|
};
|
|
@@ -3187,10 +2169,10 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3187
2169
|
addInterruptEvent,
|
|
3188
2170
|
resolveInterruptEvent
|
|
3189
2171
|
} = useCopilotContext();
|
|
3190
|
-
const existingConfig = (0,
|
|
2172
|
+
const existingConfig = (0, import_react20.useCopilotChatConfiguration)();
|
|
3191
2173
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3192
2174
|
const nodeName = useAgentNodeName(resolvedAgentId);
|
|
3193
|
-
(0,
|
|
2175
|
+
(0, import_react19.useEffect)(() => {
|
|
3194
2176
|
if (!agent)
|
|
3195
2177
|
return;
|
|
3196
2178
|
let localInterrupt = null;
|
|
@@ -3200,9 +2182,9 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3200
2182
|
const eventData = {
|
|
3201
2183
|
name: import_runtime_client_gql.MetaEventName.LangGraphInterruptEvent,
|
|
3202
2184
|
type: event.type,
|
|
3203
|
-
value: (0,
|
|
2185
|
+
value: (0, import_shared13.parseJson)(event.value, event.value)
|
|
3204
2186
|
};
|
|
3205
|
-
const eventId = (0,
|
|
2187
|
+
const eventId = (0, import_shared13.dataToUUID)(eventData, "interruptEvents");
|
|
3206
2188
|
localInterrupt = {
|
|
3207
2189
|
eventId,
|
|
3208
2190
|
threadId,
|
|
@@ -3225,7 +2207,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3225
2207
|
unsubscribe();
|
|
3226
2208
|
};
|
|
3227
2209
|
}, [agent, threadId]);
|
|
3228
|
-
const handleResolve = (0,
|
|
2210
|
+
const handleResolve = (0, import_react19.useCallback)(
|
|
3229
2211
|
(eventId, response) => {
|
|
3230
2212
|
agent == null ? void 0 : agent.runAgent({
|
|
3231
2213
|
forwardedProps: {
|
|
@@ -3239,7 +2221,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3239
2221
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3240
2222
|
[agent, threadId]
|
|
3241
2223
|
);
|
|
3242
|
-
return (0,
|
|
2224
|
+
return (0, import_react19.useMemo)(() => {
|
|
3243
2225
|
const eventQueue = interruptEventQueue[threadId] || [];
|
|
3244
2226
|
const currentQueuedEvent = eventQueue.find((qe) => !qe.event.response);
|
|
3245
2227
|
if (!currentQueuedEvent || !agentSession)
|
|
@@ -3270,7 +2252,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3270
2252
|
}
|
|
3271
2253
|
if (!render)
|
|
3272
2254
|
return null;
|
|
3273
|
-
return
|
|
2255
|
+
return import_react19.default.createElement(InterruptRenderer, {
|
|
3274
2256
|
event: currentQueuedEvent.event,
|
|
3275
2257
|
result,
|
|
3276
2258
|
render,
|
|
@@ -3280,14 +2262,14 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3280
2262
|
}
|
|
3281
2263
|
|
|
3282
2264
|
// src/hooks/use-copilot-chat_internal.ts
|
|
3283
|
-
var
|
|
2265
|
+
var import_react24 = require("@copilotkitnext/react");
|
|
3284
2266
|
|
|
3285
2267
|
// src/hooks/use-lazy-tool-renderer.tsx
|
|
3286
|
-
var
|
|
3287
|
-
var
|
|
2268
|
+
var import_react21 = require("@copilotkitnext/react");
|
|
2269
|
+
var import_react22 = require("react");
|
|
3288
2270
|
function useLazyToolRenderer() {
|
|
3289
|
-
const renderToolCall = (0,
|
|
3290
|
-
return (0,
|
|
2271
|
+
const renderToolCall = (0, import_react21.useRenderToolCall)();
|
|
2272
|
+
return (0, import_react22.useCallback)(
|
|
3291
2273
|
(message, messages) => {
|
|
3292
2274
|
var _a;
|
|
3293
2275
|
if (!((_a = message == null ? void 0 : message.toolCalls) == null ? void 0 : _a.length))
|
|
@@ -3717,13 +2699,13 @@ function useCopilotChatInternal({
|
|
|
3717
2699
|
suggestions
|
|
3718
2700
|
} = {}) {
|
|
3719
2701
|
var _a, _b, _c;
|
|
3720
|
-
const { copilotkit } = (0,
|
|
2702
|
+
const { copilotkit } = (0, import_react24.useCopilotKit)();
|
|
3721
2703
|
const { threadId, agentSession } = useCopilotContext();
|
|
3722
|
-
const existingConfig = (0,
|
|
3723
|
-
const [agentAvailable, setAgentAvailable] = (0,
|
|
2704
|
+
const existingConfig = (0, import_react24.useCopilotChatConfiguration)();
|
|
2705
|
+
const [agentAvailable, setAgentAvailable] = (0, import_react23.useState)(false);
|
|
3724
2706
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3725
|
-
const { agent } = (0,
|
|
3726
|
-
(0,
|
|
2707
|
+
const { agent } = (0, import_react24.useAgent)({ agentId: resolvedAgentId });
|
|
2708
|
+
(0, import_react23.useEffect)(() => {
|
|
3727
2709
|
const connect = (agent2) => __async(this, null, function* () {
|
|
3728
2710
|
setAgentAvailable(false);
|
|
3729
2711
|
try {
|
|
@@ -3748,7 +2730,7 @@ function useCopilotChatInternal({
|
|
|
3748
2730
|
agent == null ? void 0 : agent.setMessages([]);
|
|
3749
2731
|
agent == null ? void 0 : agent.setState(null);
|
|
3750
2732
|
};
|
|
3751
|
-
const deleteMessage = (0,
|
|
2733
|
+
const deleteMessage = (0, import_react23.useCallback)(
|
|
3752
2734
|
(messageId) => {
|
|
3753
2735
|
var _a2;
|
|
3754
2736
|
const filteredMessages = ((_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []).filter(
|
|
@@ -3759,13 +2741,13 @@ function useCopilotChatInternal({
|
|
|
3759
2741
|
[agent == null ? void 0 : agent.setMessages, agent == null ? void 0 : agent.messages]
|
|
3760
2742
|
);
|
|
3761
2743
|
const latestDelete = useUpdatedRef(deleteMessage);
|
|
3762
|
-
const latestDeleteFunc = (0,
|
|
2744
|
+
const latestDeleteFunc = (0, import_react23.useCallback)(
|
|
3763
2745
|
(messageId) => {
|
|
3764
2746
|
return latestDelete.current(messageId);
|
|
3765
2747
|
},
|
|
3766
2748
|
[latestDelete]
|
|
3767
2749
|
);
|
|
3768
|
-
const currentSuggestions = (0,
|
|
2750
|
+
const currentSuggestions = (0, import_react24.useSuggestions)({ agentId: resolvedAgentId });
|
|
3769
2751
|
const reload = useAsyncCallback(
|
|
3770
2752
|
(reloadMessageId) => __async(this, null, function* () {
|
|
3771
2753
|
var _a2;
|
|
@@ -3832,7 +2814,7 @@ function useCopilotChatInternal({
|
|
|
3832
2814
|
}),
|
|
3833
2815
|
[latestSendMessageFunc]
|
|
3834
2816
|
);
|
|
3835
|
-
const latestSetMessagesFunc = (0,
|
|
2817
|
+
const latestSetMessagesFunc = (0, import_react23.useCallback)(
|
|
3836
2818
|
(messages) => {
|
|
3837
2819
|
var _a2, _b2;
|
|
3838
2820
|
if (messages.every((message) => message instanceof import_runtime_client_gql2.Message)) {
|
|
@@ -3849,16 +2831,16 @@ function useCopilotChatInternal({
|
|
|
3849
2831
|
}),
|
|
3850
2832
|
[latestReload]
|
|
3851
2833
|
);
|
|
3852
|
-
const latestStopFunc = (0,
|
|
2834
|
+
const latestStopFunc = (0, import_react23.useCallback)(() => {
|
|
3853
2835
|
var _a2;
|
|
3854
2836
|
return (_a2 = agent == null ? void 0 : agent.abortRun) == null ? void 0 : _a2.call(agent);
|
|
3855
2837
|
}, [agent == null ? void 0 : agent.abortRun]);
|
|
3856
2838
|
const latestReset = useUpdatedRef(reset);
|
|
3857
|
-
const latestResetFunc = (0,
|
|
2839
|
+
const latestResetFunc = (0, import_react23.useCallback)(() => {
|
|
3858
2840
|
return latestReset.current();
|
|
3859
2841
|
}, [latestReset]);
|
|
3860
2842
|
const lazyToolRendered = useLazyToolRenderer();
|
|
3861
|
-
const renderCustomMessage = (0,
|
|
2843
|
+
const renderCustomMessage = (0, import_react24.useRenderCustomMessages)();
|
|
3862
2844
|
const legacyCustomMessageRenderer = useLegacyCoagentRenderer({
|
|
3863
2845
|
copilotkit,
|
|
3864
2846
|
agent,
|
|
@@ -3866,7 +2848,7 @@ function useCopilotChatInternal({
|
|
|
3866
2848
|
threadId: (_b = existingConfig == null ? void 0 : existingConfig.threadId) != null ? _b : threadId
|
|
3867
2849
|
});
|
|
3868
2850
|
const allMessages = (_c = agent == null ? void 0 : agent.messages) != null ? _c : [];
|
|
3869
|
-
const resolvedMessages = (0,
|
|
2851
|
+
const resolvedMessages = (0, import_react23.useMemo)(() => {
|
|
3870
2852
|
let processedMessages = allMessages.map((message) => {
|
|
3871
2853
|
if (message.role !== "assistant") {
|
|
3872
2854
|
return message;
|
|
@@ -3903,7 +2885,7 @@ function useCopilotChatInternal({
|
|
|
3903
2885
|
// legacyCustomMessageRenderer,
|
|
3904
2886
|
resolvedAgentId
|
|
3905
2887
|
]);
|
|
3906
|
-
const renderedSuggestions = (0,
|
|
2888
|
+
const renderedSuggestions = (0, import_react23.useMemo)(() => {
|
|
3907
2889
|
if (Array.isArray(suggestions)) {
|
|
3908
2890
|
return {
|
|
3909
2891
|
suggestions: suggestions.map((s) => __spreadProps(__spreadValues({}, s), { isLoading: false })),
|
|
@@ -3938,8 +2920,8 @@ function useCopilotChatInternal({
|
|
|
3938
2920
|
};
|
|
3939
2921
|
}
|
|
3940
2922
|
function useUpdatedRef(value) {
|
|
3941
|
-
const ref = (0,
|
|
3942
|
-
(0,
|
|
2923
|
+
const ref = (0, import_react23.useRef)(value);
|
|
2924
|
+
(0, import_react23.useEffect)(() => {
|
|
3943
2925
|
ref.current = value;
|
|
3944
2926
|
}, [value]);
|
|
3945
2927
|
return ref;
|
|
@@ -3950,7 +2932,7 @@ function useLegacyCoagentRenderer({
|
|
|
3950
2932
|
agentId,
|
|
3951
2933
|
threadId
|
|
3952
2934
|
}) {
|
|
3953
|
-
return (0,
|
|
2935
|
+
return (0, import_react23.useMemo)(() => {
|
|
3954
2936
|
if (!copilotkit || !agent) {
|
|
3955
2937
|
return null;
|
|
3956
2938
|
}
|
|
@@ -3973,7 +2955,7 @@ function useLegacyCoagentRenderer({
|
|
|
3973
2955
|
agentId,
|
|
3974
2956
|
stateSnapshot: message.state
|
|
3975
2957
|
};
|
|
3976
|
-
return (0,
|
|
2958
|
+
return (0, import_react23.createElement)(CoAgentStateRenderBridge, bridgeProps);
|
|
3977
2959
|
};
|
|
3978
2960
|
}, [agent, agentId, copilotkit, threadId]);
|
|
3979
2961
|
}
|
|
@@ -4007,8 +2989,8 @@ function useCopilotChat(options = {}) {
|
|
|
4007
2989
|
}
|
|
4008
2990
|
|
|
4009
2991
|
// src/hooks/use-copilot-chat-headless_c.ts
|
|
4010
|
-
var
|
|
4011
|
-
var
|
|
2992
|
+
var import_react25 = require("react");
|
|
2993
|
+
var import_shared14 = require("@copilotkit/shared");
|
|
4012
2994
|
var createNonFunctionalReturn = () => ({
|
|
4013
2995
|
visibleMessages: [],
|
|
4014
2996
|
messages: [],
|
|
@@ -4048,20 +3030,20 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
4048
3030
|
const { copilotApiConfig, setBannerError } = useCopilotContext();
|
|
4049
3031
|
const hasPublicApiKey = Boolean(copilotApiConfig.publicApiKey);
|
|
4050
3032
|
const internalResult = useCopilotChatInternal(options);
|
|
4051
|
-
(0,
|
|
3033
|
+
(0, import_react25.useEffect)(() => {
|
|
4052
3034
|
if (!hasPublicApiKey) {
|
|
4053
3035
|
setBannerError(
|
|
4054
|
-
new
|
|
3036
|
+
new import_shared14.CopilotKitError({
|
|
4055
3037
|
message: (
|
|
4056
3038
|
// add link to documentation here
|
|
4057
3039
|
"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."
|
|
4058
3040
|
),
|
|
4059
|
-
code:
|
|
4060
|
-
severity:
|
|
4061
|
-
visibility:
|
|
3041
|
+
code: import_shared14.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
|
|
3042
|
+
severity: import_shared14.Severity.WARNING,
|
|
3043
|
+
visibility: import_shared14.ErrorVisibility.BANNER
|
|
4062
3044
|
})
|
|
4063
3045
|
);
|
|
4064
|
-
|
|
3046
|
+
import_shared14.styledConsole.logCopilotKitPlatformMessage();
|
|
4065
3047
|
} else {
|
|
4066
3048
|
setBannerError(null);
|
|
4067
3049
|
}
|
|
@@ -4073,40 +3055,40 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
4073
3055
|
}
|
|
4074
3056
|
|
|
4075
3057
|
// src/hooks/use-copilot-action.ts
|
|
4076
|
-
var
|
|
3058
|
+
var import_react32 = require("react");
|
|
4077
3059
|
|
|
4078
3060
|
// src/hooks/use-frontend-tool.ts
|
|
4079
|
-
var
|
|
3061
|
+
var import_react26 = __toESM(require("react"));
|
|
3062
|
+
var import_shared15 = require("@copilotkit/shared");
|
|
4080
3063
|
var import_shared16 = require("@copilotkit/shared");
|
|
4081
|
-
var
|
|
4082
|
-
var import_react29 = require("@copilotkitnext/react");
|
|
3064
|
+
var import_react27 = require("@copilotkitnext/react");
|
|
4083
3065
|
function useFrontendTool(tool, dependencies) {
|
|
4084
3066
|
const { name, description, parameters, render, followUp } = tool;
|
|
4085
|
-
const zodParameters = (0,
|
|
3067
|
+
const zodParameters = (0, import_shared15.getZodParameters)(parameters);
|
|
4086
3068
|
const normalizedRender = (() => {
|
|
4087
3069
|
if (typeof render === "undefined") {
|
|
4088
3070
|
return void 0;
|
|
4089
3071
|
}
|
|
4090
3072
|
if (typeof render === "string") {
|
|
4091
3073
|
const staticRender = render;
|
|
4092
|
-
return () =>
|
|
4093
|
-
|
|
3074
|
+
return () => import_react26.default.createElement(
|
|
3075
|
+
import_react26.default.Fragment,
|
|
4094
3076
|
null,
|
|
4095
3077
|
staticRender
|
|
4096
3078
|
);
|
|
4097
3079
|
}
|
|
4098
3080
|
return (args) => {
|
|
4099
3081
|
const renderArgs = __spreadProps(__spreadValues({}, args), {
|
|
4100
|
-
result: typeof args.result === "string" ? (0,
|
|
3082
|
+
result: typeof args.result === "string" ? (0, import_shared16.parseJson)(args.result, args.result) : args.result
|
|
4101
3083
|
});
|
|
4102
3084
|
const rendered = render(renderArgs);
|
|
4103
3085
|
if (typeof rendered === "string") {
|
|
4104
|
-
return
|
|
3086
|
+
return import_react26.default.createElement(import_react26.default.Fragment, null, rendered);
|
|
4105
3087
|
}
|
|
4106
3088
|
return rendered != null ? rendered : null;
|
|
4107
3089
|
};
|
|
4108
3090
|
})();
|
|
4109
|
-
(0,
|
|
3091
|
+
(0, import_react27.useFrontendTool)({
|
|
4110
3092
|
name,
|
|
4111
3093
|
description,
|
|
4112
3094
|
parameters: zodParameters,
|
|
@@ -4117,29 +3099,29 @@ function useFrontendTool(tool, dependencies) {
|
|
|
4117
3099
|
}
|
|
4118
3100
|
|
|
4119
3101
|
// src/hooks/use-render-tool-call.ts
|
|
3102
|
+
var import_shared17 = require("@copilotkit/shared");
|
|
3103
|
+
var import_react28 = require("react");
|
|
3104
|
+
var import_react29 = require("@copilotkitnext/react");
|
|
4120
3105
|
var import_shared18 = require("@copilotkit/shared");
|
|
4121
|
-
var import_react30 = require("react");
|
|
4122
|
-
var import_react31 = require("@copilotkitnext/react");
|
|
4123
|
-
var import_shared19 = require("@copilotkit/shared");
|
|
4124
3106
|
function useRenderToolCall2(tool, dependencies) {
|
|
4125
|
-
const { copilotkit } = (0,
|
|
4126
|
-
const hasAddedRef = (0,
|
|
4127
|
-
(0,
|
|
3107
|
+
const { copilotkit } = (0, import_react29.useCopilotKit)();
|
|
3108
|
+
const hasAddedRef = (0, import_react28.useRef)(false);
|
|
3109
|
+
(0, import_react28.useEffect)(() => {
|
|
4128
3110
|
const { name, parameters, render } = tool;
|
|
4129
|
-
const zodParameters = (0,
|
|
4130
|
-
const renderToolCall = name === "*" ? (0,
|
|
3111
|
+
const zodParameters = (0, import_shared17.getZodParameters)(parameters);
|
|
3112
|
+
const renderToolCall = name === "*" ? (0, import_react29.defineToolCallRenderer)({
|
|
4131
3113
|
name: "*",
|
|
4132
3114
|
render: (args) => {
|
|
4133
3115
|
return render(__spreadProps(__spreadValues({}, args), {
|
|
4134
|
-
result: args.result ? (0,
|
|
3116
|
+
result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
|
|
4135
3117
|
}));
|
|
4136
3118
|
}
|
|
4137
|
-
}) : (0,
|
|
3119
|
+
}) : (0, import_react29.defineToolCallRenderer)({
|
|
4138
3120
|
name,
|
|
4139
3121
|
args: zodParameters,
|
|
4140
3122
|
render: (args) => {
|
|
4141
3123
|
return render(__spreadProps(__spreadValues({}, args), {
|
|
4142
|
-
result: args.result ? (0,
|
|
3124
|
+
result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
|
|
4143
3125
|
}));
|
|
4144
3126
|
}
|
|
4145
3127
|
});
|
|
@@ -4162,19 +3144,19 @@ function useRenderToolCall2(tool, dependencies) {
|
|
|
4162
3144
|
}
|
|
4163
3145
|
|
|
4164
3146
|
// src/hooks/use-human-in-the-loop.ts
|
|
4165
|
-
var
|
|
4166
|
-
var
|
|
3147
|
+
var import_shared19 = require("@copilotkit/shared");
|
|
3148
|
+
var import_react30 = require("@copilotkitnext/react");
|
|
4167
3149
|
var import_core = require("@copilotkitnext/core");
|
|
4168
|
-
var
|
|
3150
|
+
var import_react31 = __toESM(require("react"));
|
|
4169
3151
|
function useHumanInTheLoop(tool, dependencies) {
|
|
4170
3152
|
const _a = tool, { render } = _a, toolRest = __objRest(_a, ["render"]);
|
|
4171
3153
|
const { name, description, parameters, followUp } = toolRest;
|
|
4172
|
-
const zodParameters = (0,
|
|
4173
|
-
const renderRef = (0,
|
|
4174
|
-
(0,
|
|
3154
|
+
const zodParameters = (0, import_shared19.getZodParameters)(parameters);
|
|
3155
|
+
const renderRef = (0, import_react31.useRef)(null);
|
|
3156
|
+
(0, import_react31.useEffect)(() => {
|
|
4175
3157
|
renderRef.current = (args) => {
|
|
4176
3158
|
if (typeof render === "string") {
|
|
4177
|
-
return
|
|
3159
|
+
return import_react31.default.createElement(import_react31.default.Fragment, null, render);
|
|
4178
3160
|
}
|
|
4179
3161
|
if (!render) {
|
|
4180
3162
|
return null;
|
|
@@ -4202,24 +3184,24 @@ function useHumanInTheLoop(tool, dependencies) {
|
|
|
4202
3184
|
args: mappedArgs,
|
|
4203
3185
|
respond: args.respond,
|
|
4204
3186
|
status: args.status,
|
|
4205
|
-
result: args.result ? (0,
|
|
3187
|
+
result: args.result ? (0, import_shared19.parseJson)(args.result, args.result) : args.result,
|
|
4206
3188
|
handler: void 0
|
|
4207
3189
|
};
|
|
4208
3190
|
default:
|
|
4209
|
-
throw new
|
|
4210
|
-
code:
|
|
3191
|
+
throw new import_shared19.CopilotKitError({
|
|
3192
|
+
code: import_shared19.CopilotKitErrorCode.UNKNOWN,
|
|
4211
3193
|
message: `Invalid tool call status: ${args.status}`
|
|
4212
3194
|
});
|
|
4213
3195
|
}
|
|
4214
3196
|
})();
|
|
4215
3197
|
const rendered = render(renderProps);
|
|
4216
3198
|
if (typeof rendered === "string") {
|
|
4217
|
-
return
|
|
3199
|
+
return import_react31.default.createElement(import_react31.default.Fragment, null, rendered);
|
|
4218
3200
|
}
|
|
4219
3201
|
return rendered != null ? rendered : null;
|
|
4220
3202
|
};
|
|
4221
3203
|
}, [render, ...dependencies != null ? dependencies : []]);
|
|
4222
|
-
(0,
|
|
3204
|
+
(0, import_react30.useHumanInTheLoop)({
|
|
4223
3205
|
name,
|
|
4224
3206
|
description,
|
|
4225
3207
|
followUp,
|
|
@@ -4275,7 +3257,7 @@ function getActionConfig(action) {
|
|
|
4275
3257
|
throw new Error("Invalid action configuration");
|
|
4276
3258
|
}
|
|
4277
3259
|
function useCopilotAction(action, dependencies) {
|
|
4278
|
-
const [initialActionConfig] = (0,
|
|
3260
|
+
const [initialActionConfig] = (0, import_react32.useState)(getActionConfig(action));
|
|
4279
3261
|
const currentActionConfig = getActionConfig(action);
|
|
4280
3262
|
if (initialActionConfig.type !== currentActionConfig.type) {
|
|
4281
3263
|
throw new Error("Action configuration changed between renders");
|
|
@@ -4293,17 +3275,17 @@ function useCopilotAction(action, dependencies) {
|
|
|
4293
3275
|
}
|
|
4294
3276
|
|
|
4295
3277
|
// src/hooks/use-coagent-state-render.ts
|
|
4296
|
-
var
|
|
4297
|
-
var
|
|
3278
|
+
var import_react33 = require("react");
|
|
3279
|
+
var import_shared20 = require("@copilotkit/shared");
|
|
4298
3280
|
function useCoAgentStateRender(action, dependencies) {
|
|
4299
|
-
const { chatComponentsCache, availableAgents } = (0,
|
|
3281
|
+
const { chatComponentsCache, availableAgents } = (0, import_react33.useContext)(CopilotContext);
|
|
4300
3282
|
const { setCoAgentStateRender, removeCoAgentStateRender, coAgentStateRenders } = useCoAgentStateRenders();
|
|
4301
|
-
const idRef = (0,
|
|
3283
|
+
const idRef = (0, import_react33.useRef)((0, import_shared20.randomId)());
|
|
4302
3284
|
const { setBannerError, addToast } = useToast();
|
|
4303
|
-
(0,
|
|
3285
|
+
(0, import_react33.useEffect)(() => {
|
|
4304
3286
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
|
|
4305
3287
|
const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
|
|
4306
|
-
const agentError = new
|
|
3288
|
+
const agentError = new import_shared20.CopilotKitAgentDiscoveryError({
|
|
4307
3289
|
agentName: action.name,
|
|
4308
3290
|
availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
|
|
4309
3291
|
});
|
|
@@ -4321,7 +3303,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4321
3303
|
}
|
|
4322
3304
|
}
|
|
4323
3305
|
}
|
|
4324
|
-
(0,
|
|
3306
|
+
(0, import_react33.useEffect)(() => {
|
|
4325
3307
|
const currentId = idRef.current;
|
|
4326
3308
|
const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {
|
|
4327
3309
|
if (id === currentId)
|
|
@@ -4345,7 +3327,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4345
3327
|
});
|
|
4346
3328
|
}
|
|
4347
3329
|
}, [coAgentStateRenders]);
|
|
4348
|
-
(0,
|
|
3330
|
+
(0, import_react33.useEffect)(() => {
|
|
4349
3331
|
setCoAgentStateRender(idRef.current, action);
|
|
4350
3332
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
4351
3333
|
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
@@ -4365,12 +3347,12 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4365
3347
|
}
|
|
4366
3348
|
|
|
4367
3349
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
4368
|
-
var
|
|
4369
|
-
function useMakeCopilotDocumentReadable(
|
|
3350
|
+
var import_react34 = require("react");
|
|
3351
|
+
function useMakeCopilotDocumentReadable(document, categories, dependencies = []) {
|
|
4370
3352
|
const { addDocumentContext, removeDocumentContext } = useCopilotContext();
|
|
4371
|
-
const idRef = (0,
|
|
4372
|
-
(0,
|
|
4373
|
-
const id = addDocumentContext(
|
|
3353
|
+
const idRef = (0, import_react34.useRef)(void 0);
|
|
3354
|
+
(0, import_react34.useEffect)(() => {
|
|
3355
|
+
const id = addDocumentContext(document, categories);
|
|
4374
3356
|
idRef.current = id;
|
|
4375
3357
|
return () => {
|
|
4376
3358
|
removeDocumentContext(id);
|
|
@@ -4380,12 +3362,12 @@ function useMakeCopilotDocumentReadable(document2, categories, dependencies = []
|
|
|
4380
3362
|
}
|
|
4381
3363
|
|
|
4382
3364
|
// src/hooks/use-copilot-readable.ts
|
|
4383
|
-
var
|
|
4384
|
-
var
|
|
3365
|
+
var import_react35 = require("@copilotkitnext/react");
|
|
3366
|
+
var import_react36 = require("react");
|
|
4385
3367
|
function useCopilotReadable({ description, value, convert, available }, dependencies) {
|
|
4386
|
-
const { copilotkit } = (0,
|
|
4387
|
-
const ctxIdRef = (0,
|
|
4388
|
-
(0,
|
|
3368
|
+
const { copilotkit } = (0, import_react35.useCopilotKit)();
|
|
3369
|
+
const ctxIdRef = (0, import_react36.useRef)(void 0);
|
|
3370
|
+
(0, import_react36.useEffect)(() => {
|
|
4389
3371
|
if (!copilotkit)
|
|
4390
3372
|
return;
|
|
4391
3373
|
const found = Object.entries(copilotkit.context).find(([id, ctxItem]) => {
|
|
@@ -4413,13 +3395,13 @@ function useCopilotReadable({ description, value, convert, available }, dependen
|
|
|
4413
3395
|
}
|
|
4414
3396
|
|
|
4415
3397
|
// src/hooks/use-coagent.ts
|
|
4416
|
-
var
|
|
4417
|
-
var
|
|
3398
|
+
var import_react37 = require("react");
|
|
3399
|
+
var import_react38 = require("@copilotkitnext/react");
|
|
4418
3400
|
function useCoAgent(options) {
|
|
4419
|
-
const { agent } = (0,
|
|
4420
|
-
const { copilotkit } = (0,
|
|
3401
|
+
const { agent } = (0, import_react38.useAgent)({ agentId: options.name });
|
|
3402
|
+
const { copilotkit } = (0, import_react38.useCopilotKit)();
|
|
4421
3403
|
const nodeName = useAgentNodeName(options.name);
|
|
4422
|
-
const handleStateUpdate = (0,
|
|
3404
|
+
const handleStateUpdate = (0, import_react37.useCallback)(
|
|
4423
3405
|
(newState) => {
|
|
4424
3406
|
if (!agent)
|
|
4425
3407
|
return;
|
|
@@ -4432,7 +3414,7 @@ function useCoAgent(options) {
|
|
|
4432
3414
|
},
|
|
4433
3415
|
[agent == null ? void 0 : agent.state, agent == null ? void 0 : agent.setState]
|
|
4434
3416
|
);
|
|
4435
|
-
(0,
|
|
3417
|
+
(0, import_react37.useEffect)(() => {
|
|
4436
3418
|
var _a;
|
|
4437
3419
|
if (!options.config && !options.configurable)
|
|
4438
3420
|
return;
|
|
@@ -4444,22 +3426,22 @@ function useCoAgent(options) {
|
|
|
4444
3426
|
}
|
|
4445
3427
|
copilotkit.setProperties(config);
|
|
4446
3428
|
}, [options.config, options.configurable]);
|
|
4447
|
-
const externalStateStr = (0,
|
|
3429
|
+
const externalStateStr = (0, import_react37.useMemo)(
|
|
4448
3430
|
() => isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0,
|
|
4449
3431
|
[isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0]
|
|
4450
3432
|
);
|
|
4451
|
-
(0,
|
|
3433
|
+
(0, import_react37.useEffect)(() => {
|
|
4452
3434
|
if ((agent == null ? void 0 : agent.state) && isExternalStateManagement(options) && JSON.stringify(options.state) !== JSON.stringify(agent.state)) {
|
|
4453
3435
|
handleStateUpdate(options.state);
|
|
4454
3436
|
}
|
|
4455
3437
|
}, [agent, externalStateStr, handleStateUpdate]);
|
|
4456
|
-
const hasStateValues = (0,
|
|
3438
|
+
const hasStateValues = (0, import_react37.useCallback)((value) => {
|
|
4457
3439
|
return Boolean(value && Object.keys(value).length);
|
|
4458
3440
|
}, []);
|
|
4459
|
-
const initialStateRef = (0,
|
|
3441
|
+
const initialStateRef = (0, import_react37.useRef)(
|
|
4460
3442
|
isExternalStateManagement(options) ? options.state : "initialState" in options ? options.initialState : void 0
|
|
4461
3443
|
);
|
|
4462
|
-
(0,
|
|
3444
|
+
(0, import_react37.useEffect)(() => {
|
|
4463
3445
|
if (isExternalStateManagement(options)) {
|
|
4464
3446
|
initialStateRef.current = options.state;
|
|
4465
3447
|
} else if ("initialState" in options) {
|
|
@@ -4468,7 +3450,7 @@ function useCoAgent(options) {
|
|
|
4468
3450
|
}, [
|
|
4469
3451
|
isExternalStateManagement(options) ? JSON.stringify(options.state) : "initialState" in options ? JSON.stringify(options.initialState) : void 0
|
|
4470
3452
|
]);
|
|
4471
|
-
(0,
|
|
3453
|
+
(0, import_react37.useEffect)(() => {
|
|
4472
3454
|
if (!agent)
|
|
4473
3455
|
return;
|
|
4474
3456
|
const subscriber = {
|
|
@@ -4496,7 +3478,7 @@ function useCoAgent(options) {
|
|
|
4496
3478
|
subscription.unsubscribe();
|
|
4497
3479
|
};
|
|
4498
3480
|
}, [agent, handleStateUpdate, hasStateValues]);
|
|
4499
|
-
return (0,
|
|
3481
|
+
return (0, import_react37.useMemo)(() => {
|
|
4500
3482
|
var _a, _b, _c;
|
|
4501
3483
|
if (!agent) {
|
|
4502
3484
|
const noop = () => {
|
|
@@ -4552,12 +3534,12 @@ var isExternalStateManagement = (options) => {
|
|
|
4552
3534
|
|
|
4553
3535
|
// src/hooks/use-copilot-runtime-client.ts
|
|
4554
3536
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
4555
|
-
var
|
|
4556
|
-
var
|
|
3537
|
+
var import_react39 = require("react");
|
|
3538
|
+
var import_shared21 = require("@copilotkit/shared");
|
|
4557
3539
|
var useCopilotRuntimeClient = (options) => {
|
|
4558
3540
|
const { setBannerError } = useToast();
|
|
4559
3541
|
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
4560
|
-
const lastStructuredErrorRef = (0,
|
|
3542
|
+
const lastStructuredErrorRef = (0, import_react39.useRef)(null);
|
|
4561
3543
|
const traceUIError = (error, originalError) => __async(void 0, null, function* () {
|
|
4562
3544
|
try {
|
|
4563
3545
|
const errorEvent = {
|
|
@@ -4583,7 +3565,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4583
3565
|
console.error("Error in onError handler:", error2);
|
|
4584
3566
|
}
|
|
4585
3567
|
});
|
|
4586
|
-
const runtimeClient = (0,
|
|
3568
|
+
const runtimeClient = (0, import_react39.useMemo)(() => {
|
|
4587
3569
|
return new import_runtime_client_gql3.CopilotRuntimeClient(__spreadProps(__spreadValues({}, runtimeOptions), {
|
|
4588
3570
|
handleGQLErrors: (error) => {
|
|
4589
3571
|
var _a2;
|
|
@@ -4592,7 +3574,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4592
3574
|
const routeError = (gqlError) => {
|
|
4593
3575
|
const extensions = gqlError.extensions;
|
|
4594
3576
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
4595
|
-
if (visibility ===
|
|
3577
|
+
if (visibility === import_shared21.ErrorVisibility.SILENT) {
|
|
4596
3578
|
console.error("CopilotKit Silent Error:", gqlError.message);
|
|
4597
3579
|
return;
|
|
4598
3580
|
}
|
|
@@ -4607,9 +3589,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4607
3589
|
setBannerError(ckError);
|
|
4608
3590
|
traceUIError(ckError, gqlError);
|
|
4609
3591
|
} else {
|
|
4610
|
-
const fallbackError = new
|
|
3592
|
+
const fallbackError = new import_shared21.CopilotKitError({
|
|
4611
3593
|
message: gqlError.message,
|
|
4612
|
-
code:
|
|
3594
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4613
3595
|
});
|
|
4614
3596
|
setBannerError(fallbackError);
|
|
4615
3597
|
traceUIError(fallbackError, gqlError);
|
|
@@ -4617,9 +3599,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4617
3599
|
};
|
|
4618
3600
|
graphQLErrors.forEach(routeError);
|
|
4619
3601
|
} else {
|
|
4620
|
-
const fallbackError = new
|
|
3602
|
+
const fallbackError = new import_shared21.CopilotKitError({
|
|
4621
3603
|
message: (error == null ? void 0 : error.message) || String(error),
|
|
4622
|
-
code:
|
|
3604
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4623
3605
|
});
|
|
4624
3606
|
setBannerError(fallbackError);
|
|
4625
3607
|
traceUIError(fallbackError, error);
|
|
@@ -4627,9 +3609,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4627
3609
|
},
|
|
4628
3610
|
handleGQLWarning: (message) => {
|
|
4629
3611
|
console.warn(message);
|
|
4630
|
-
const warningError = new
|
|
3612
|
+
const warningError = new import_shared21.CopilotKitError({
|
|
4631
3613
|
message,
|
|
4632
|
-
code:
|
|
3614
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4633
3615
|
});
|
|
4634
3616
|
setBannerError(warningError);
|
|
4635
3617
|
}
|
|
@@ -4644,16 +3626,16 @@ function createStructuredError(gqlError) {
|
|
|
4644
3626
|
const message = (originalError == null ? void 0 : originalError.message) || gqlError.message;
|
|
4645
3627
|
const code = extensions == null ? void 0 : extensions.code;
|
|
4646
3628
|
if (code) {
|
|
4647
|
-
return new
|
|
3629
|
+
return new import_shared21.CopilotKitError({ message, code });
|
|
4648
3630
|
}
|
|
4649
3631
|
if ((_a = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _a.includes("CopilotApiDiscoveryError")) {
|
|
4650
|
-
return new
|
|
3632
|
+
return new import_shared21.CopilotKitApiDiscoveryError({ message });
|
|
4651
3633
|
}
|
|
4652
3634
|
if ((_b = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _b.includes("CopilotKitRemoteEndpointDiscoveryError")) {
|
|
4653
|
-
return new
|
|
3635
|
+
return new import_shared21.CopilotKitRemoteEndpointDiscoveryError({ message });
|
|
4654
3636
|
}
|
|
4655
3637
|
if ((_c = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _c.includes("CopilotKitAgentDiscoveryError")) {
|
|
4656
|
-
return new
|
|
3638
|
+
return new import_shared21.CopilotKitAgentDiscoveryError({
|
|
4657
3639
|
agentName: "",
|
|
4658
3640
|
availableAgents: []
|
|
4659
3641
|
});
|
|
@@ -4662,28 +3644,28 @@ function createStructuredError(gqlError) {
|
|
|
4662
3644
|
}
|
|
4663
3645
|
|
|
4664
3646
|
// src/hooks/use-copilot-authenticated-action.ts
|
|
4665
|
-
var
|
|
4666
|
-
var
|
|
3647
|
+
var import_react40 = require("react");
|
|
3648
|
+
var import_react41 = __toESM(require("react"));
|
|
4667
3649
|
function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
4668
3650
|
const { authConfig_c, authStates_c, setAuthStates_c } = useCopilotContext();
|
|
4669
|
-
const pendingActionRef = (0,
|
|
4670
|
-
const executeAction = (0,
|
|
3651
|
+
const pendingActionRef = (0, import_react40.useRef)(null);
|
|
3652
|
+
const executeAction = (0, import_react40.useCallback)(
|
|
4671
3653
|
(props) => {
|
|
4672
3654
|
if (typeof action.render === "function") {
|
|
4673
3655
|
return action.render(props);
|
|
4674
3656
|
}
|
|
4675
|
-
return action.render ||
|
|
3657
|
+
return action.render || import_react41.default.createElement(import_react40.Fragment);
|
|
4676
3658
|
},
|
|
4677
3659
|
[action]
|
|
4678
3660
|
);
|
|
4679
|
-
const wrappedRender = (0,
|
|
3661
|
+
const wrappedRender = (0, import_react40.useCallback)(
|
|
4680
3662
|
(props) => {
|
|
4681
3663
|
const isAuthenticated = Object.values(authStates_c || {}).some(
|
|
4682
3664
|
(state) => state.status === "authenticated"
|
|
4683
3665
|
);
|
|
4684
3666
|
if (!isAuthenticated) {
|
|
4685
3667
|
pendingActionRef.current = props;
|
|
4686
|
-
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ?
|
|
3668
|
+
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react41.default.createElement(authConfig_c.SignInComponent, {
|
|
4687
3669
|
onSignInComplete: (authState) => {
|
|
4688
3670
|
setAuthStates_c == null ? void 0 : setAuthStates_c((prev) => __spreadProps(__spreadValues({}, prev), { [action.name]: authState }));
|
|
4689
3671
|
if (pendingActionRef.current) {
|
|
@@ -4691,7 +3673,7 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
4691
3673
|
pendingActionRef.current = null;
|
|
4692
3674
|
}
|
|
4693
3675
|
}
|
|
4694
|
-
}) :
|
|
3676
|
+
}) : import_react41.default.createElement(import_react40.Fragment);
|
|
4695
3677
|
}
|
|
4696
3678
|
return executeAction(props);
|
|
4697
3679
|
},
|
|
@@ -4706,13 +3688,13 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
4706
3688
|
}
|
|
4707
3689
|
|
|
4708
3690
|
// src/hooks/use-langgraph-interrupt.ts
|
|
4709
|
-
var
|
|
4710
|
-
var
|
|
3691
|
+
var import_react42 = require("react");
|
|
3692
|
+
var import_shared22 = require("@copilotkit/shared");
|
|
4711
3693
|
function useLangGraphInterrupt(action, dependencies) {
|
|
4712
|
-
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0,
|
|
3694
|
+
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0, import_react42.useContext)(CopilotContext);
|
|
4713
3695
|
const { addToast } = useToast();
|
|
4714
|
-
const actionId = (0,
|
|
4715
|
-
(0,
|
|
3696
|
+
const actionId = (0, import_shared22.dataToUUID)(action, "lgAction");
|
|
3697
|
+
(0, import_react42.useEffect)(() => {
|
|
4716
3698
|
if (!action)
|
|
4717
3699
|
return;
|
|
4718
3700
|
setInterruptAction(__spreadProps(__spreadValues({}, action), { id: actionId }));
|
|
@@ -4723,10 +3705,10 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
4723
3705
|
}
|
|
4724
3706
|
|
|
4725
3707
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
4726
|
-
var
|
|
3708
|
+
var import_react43 = require("react");
|
|
4727
3709
|
function useCopilotAdditionalInstructions({ instructions, available = "enabled" }, dependencies) {
|
|
4728
3710
|
const { setAdditionalInstructions } = useCopilotContext();
|
|
4729
|
-
(0,
|
|
3711
|
+
(0, import_react43.useEffect)(() => {
|
|
4730
3712
|
if (available === "disabled")
|
|
4731
3713
|
return;
|
|
4732
3714
|
setAdditionalInstructions((prevInstructions) => [...prevInstructions || [], instructions]);
|
|
@@ -4744,10 +3726,10 @@ function useDefaultTool(tool, dependencies) {
|
|
|
4744
3726
|
}
|
|
4745
3727
|
|
|
4746
3728
|
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
4747
|
-
var
|
|
3729
|
+
var import_react44 = require("@copilotkitnext/react");
|
|
4748
3730
|
function useCopilotChatSuggestions(config, dependencies = []) {
|
|
4749
3731
|
var _a, _b;
|
|
4750
|
-
const existingConfig = (0,
|
|
3732
|
+
const existingConfig = (0, import_react44.useCopilotChatConfiguration)();
|
|
4751
3733
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
4752
3734
|
const available = (_b = config.available === "enabled" ? "always" : config.available) != null ? _b : "before-first-message";
|
|
4753
3735
|
const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
|
|
@@ -4755,7 +3737,7 @@ function useCopilotChatSuggestions(config, dependencies = []) {
|
|
|
4755
3737
|
consumerAgentId: resolvedAgentId
|
|
4756
3738
|
// Use chatConfig.agentId here
|
|
4757
3739
|
});
|
|
4758
|
-
(0,
|
|
3740
|
+
(0, import_react44.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
|
|
4759
3741
|
}
|
|
4760
3742
|
|
|
4761
3743
|
// src/lib/copilot-task.ts
|
|
@@ -4763,7 +3745,7 @@ var import_runtime_client_gql5 = require("@copilotkit/runtime-client-gql");
|
|
|
4763
3745
|
|
|
4764
3746
|
// src/types/frontend-action.ts
|
|
4765
3747
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
4766
|
-
var
|
|
3748
|
+
var import_shared23 = require("@copilotkit/shared");
|
|
4767
3749
|
function processActionsForRuntimeRequest(actions) {
|
|
4768
3750
|
const filteredActions = actions.filter(
|
|
4769
3751
|
(action) => action.available !== import_runtime_client_gql4.ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction
|
|
@@ -4779,7 +3761,7 @@ function processActionsForRuntimeRequest(actions) {
|
|
|
4779
3761
|
return {
|
|
4780
3762
|
name: action.name,
|
|
4781
3763
|
description: action.description || "",
|
|
4782
|
-
jsonSchema: JSON.stringify((0,
|
|
3764
|
+
jsonSchema: JSON.stringify((0, import_shared23.actionParametersToJsonSchema)(action.parameters || [])),
|
|
4783
3765
|
available
|
|
4784
3766
|
};
|
|
4785
3767
|
});
|