@copilotkit/react-core 1.50.0-beta.8 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +192 -0
- package/dist/{chunk-KYY2WZSR.mjs → chunk-5J7RRLRO.mjs} +2 -2
- package/dist/{chunk-ZU6ZBX4E.mjs → chunk-CO6V4G7P.mjs} +17 -9
- package/dist/chunk-CO6V4G7P.mjs.map +1 -0
- package/dist/{chunk-Y2L7KDVW.mjs → chunk-HQTDDA6V.mjs} +2 -2
- package/dist/chunk-LDEWO5XH.mjs +328 -0
- package/dist/chunk-LDEWO5XH.mjs.map +1 -0
- package/dist/chunk-XDFVCQD3.mjs +27 -0
- package/dist/chunk-XDFVCQD3.mjs.map +1 -0
- package/dist/{chunk-RQ6LWR6S.mjs → chunk-Z6JV2LRY.mjs} +1 -1
- package/dist/chunk-Z6JV2LRY.mjs.map +1 -0
- package/dist/{chunk-BLDHD6Q2.mjs → chunk-ZE4JVTEP.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +6 -0
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +127 -1150
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +3 -6
- package/dist/components/copilot-provider/index.js +127 -1150
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +3 -6
- package/dist/components/dev-console/console-trigger.mjs +225 -5
- package/dist/components/dev-console/console-trigger.mjs.map +1 -1
- package/dist/components/index.js +127 -1150
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -6
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +124 -554
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +19 -19
- package/dist/hooks/use-copilot-chat-headless_c.js +42 -487
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +2 -3
- package/dist/hooks/{use-configure-chat-suggestions.d.ts → use-copilot-chat-suggestions.d.ts} +2 -3
- package/dist/hooks/{use-configure-chat-suggestions.js → use-copilot-chat-suggestions.js} +10 -29
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat.js +40 -485
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +2 -3
- package/dist/hooks/use-copilot-chat_internal.d.ts +17 -0
- package/dist/hooks/use-copilot-chat_internal.js +40 -485
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +1 -2
- package/dist/hooks/use-copilot-readable.d.ts +2 -3
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +300 -1746
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -27
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +4 -7
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -7
- package/dist/types/index.mjs +1 -1
- package/package.json +8 -8
- package/src/components/copilot-provider/copilotkit-props.tsx +7 -0
- package/src/components/copilot-provider/copilotkit.tsx +13 -5
- package/src/hooks/index.ts +2 -2
- package/src/hooks/use-copilot-chat-suggestions.tsx +124 -0
- package/src/hooks/use-copilot-chat_internal.ts +29 -29
- package/src/hooks/use-copilot-readable.ts +2 -4
- package/dist/chunk-EKDPRKZT.mjs +0 -746
- package/dist/chunk-EKDPRKZT.mjs.map +0 -1
- package/dist/chunk-FBVI3LQ6.mjs +0 -48
- package/dist/chunk-FBVI3LQ6.mjs.map +0 -1
- package/dist/chunk-PMWUKW3Z.mjs +0 -231
- package/dist/chunk-PMWUKW3Z.mjs.map +0 -1
- package/dist/chunk-RQ6LWR6S.mjs.map +0 -1
- package/dist/chunk-ZU6ZBX4E.mjs.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.js.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.mjs +0 -8
- package/src/hooks/use-configure-chat-suggestions.tsx +0 -86
- /package/dist/{chunk-KYY2WZSR.mjs.map → chunk-5J7RRLRO.mjs.map} +0 -0
- /package/dist/{chunk-Y2L7KDVW.mjs.map → chunk-HQTDDA6V.mjs.map} +0 -0
- /package/dist/{chunk-BLDHD6Q2.mjs.map → chunk-ZE4JVTEP.mjs.map} +0 -0
- /package/dist/hooks/{use-configure-chat-suggestions.mjs.map → use-copilot-chat-suggestions.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -95,13 +95,13 @@ __export(src_exports, {
|
|
|
95
95
|
useCoAgent: () => useCoAgent,
|
|
96
96
|
useCoAgentStateRender: () => useCoAgentStateRender,
|
|
97
97
|
useCoAgentStateRenders: () => useCoAgentStateRenders,
|
|
98
|
-
useConfigureChatSuggestions: () => useConfigureChatSuggestions,
|
|
99
98
|
useCopilotAction: () => useCopilotAction,
|
|
100
99
|
useCopilotAdditionalInstructions: () => useCopilotAdditionalInstructions,
|
|
101
100
|
useCopilotAuthenticatedAction_c: () => useCopilotAuthenticatedAction_c,
|
|
102
101
|
useCopilotChat: () => useCopilotChat,
|
|
103
102
|
useCopilotChatHeadless_c: () => useCopilotChatHeadless_c,
|
|
104
103
|
useCopilotChatInternal: () => useCopilotChatInternal,
|
|
104
|
+
useCopilotChatSuggestions: () => useCopilotChatSuggestions,
|
|
105
105
|
useCopilotContext: () => useCopilotContext,
|
|
106
106
|
useCopilotMessagesContext: () => useCopilotMessagesContext,
|
|
107
107
|
useCopilotReadable: () => useCopilotReadable,
|
|
@@ -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,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAY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PyKC6WGOmy82MX9L4GrMAXCbLXnw4+10L06yJqu7XbaSPbZmPB1oIm6pPl0Q1oUrp0EnAjpfxXAXApgJp6Zlmgotae3xUa2vQau8nc0AtsumIPZnfGC/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,56 +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);
|
|
1640
|
+
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
2662
1641
|
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
2663
|
-
const renderArr = (0,
|
|
2664
|
-
return /* @__PURE__ */ (0,
|
|
1642
|
+
const renderArr = (0, import_react15.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
|
|
1643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1644
|
+
import_react16.CopilotKitProvider,
|
|
1645
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1646
|
+
showDevConsole: showInspector,
|
|
1647
|
+
renderCustomMessages: renderArr,
|
|
1648
|
+
useSingleEndpoint: true,
|
|
1649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
|
|
1650
|
+
})
|
|
1651
|
+
) }) }) });
|
|
2665
1652
|
}
|
|
2666
1653
|
function CopilotKitInternal(cpkProps) {
|
|
2667
1654
|
var _b;
|
|
2668
1655
|
const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
|
|
2669
1656
|
validateProps(cpkProps);
|
|
2670
1657
|
const publicApiKey = props.publicLicenseKey || props.publicApiKey;
|
|
2671
|
-
const chatApiEndpoint = props.runtimeUrl ||
|
|
2672
|
-
const [actions, setActions] = (0,
|
|
2673
|
-
const [registeredActionConfigs, setRegisteredActionConfigs] = (0,
|
|
2674
|
-
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)({
|
|
2675
1662
|
actions: {},
|
|
2676
1663
|
coAgentStateRenders: {}
|
|
2677
1664
|
});
|
|
2678
1665
|
const { addElement, removeElement, printTree, getAllElements } = use_tree_default();
|
|
2679
|
-
const [isLoading, setIsLoading] = (0,
|
|
2680
|
-
const [chatInstructions, setChatInstructions] = (0,
|
|
2681
|
-
const [authStates, setAuthStates] = (0,
|
|
2682
|
-
const [extensions, setExtensions] = (0,
|
|
2683
|
-
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)([]);
|
|
2684
1671
|
const {
|
|
2685
1672
|
addElement: addDocument,
|
|
2686
1673
|
removeElement: removeDocument,
|
|
2687
1674
|
allElements: allDocuments
|
|
2688
1675
|
} = use_flat_category_store_default();
|
|
2689
|
-
const setAction = (0,
|
|
1676
|
+
const setAction = (0, import_react15.useCallback)((id, action) => {
|
|
2690
1677
|
setActions((prevPoints) => {
|
|
2691
1678
|
return __spreadProps(__spreadValues({}, prevPoints), {
|
|
2692
1679
|
[id]: action
|
|
2693
1680
|
});
|
|
2694
1681
|
});
|
|
2695
1682
|
}, []);
|
|
2696
|
-
const removeAction = (0,
|
|
1683
|
+
const removeAction = (0, import_react15.useCallback)((id) => {
|
|
2697
1684
|
setActions((prevPoints) => {
|
|
2698
1685
|
const newPoints = __spreadValues({}, prevPoints);
|
|
2699
1686
|
delete newPoints[id];
|
|
2700
1687
|
return newPoints;
|
|
2701
1688
|
});
|
|
2702
1689
|
}, []);
|
|
2703
|
-
const getContextString = (0,
|
|
1690
|
+
const getContextString = (0, import_react15.useCallback)(
|
|
2704
1691
|
(documents, categories) => {
|
|
2705
|
-
const documentsString = documents.map((
|
|
2706
|
-
return `${
|
|
2707
|
-
${
|
|
1692
|
+
const documentsString = documents.map((document) => {
|
|
1693
|
+
return `${document.name} (${document.sourceApplication}):
|
|
1694
|
+
${document.getContents()}`;
|
|
2708
1695
|
}).join("\n\n");
|
|
2709
1696
|
const nonDocumentStrings = printTree(categories);
|
|
2710
1697
|
return `${documentsString}
|
|
@@ -2713,46 +1700,46 @@ ${nonDocumentStrings}`;
|
|
|
2713
1700
|
},
|
|
2714
1701
|
[printTree]
|
|
2715
1702
|
);
|
|
2716
|
-
const addContext = (0,
|
|
1703
|
+
const addContext = (0, import_react15.useCallback)(
|
|
2717
1704
|
(context, parentId, categories = defaultCopilotContextCategories) => {
|
|
2718
1705
|
return addElement(context, categories, parentId);
|
|
2719
1706
|
},
|
|
2720
1707
|
[addElement]
|
|
2721
1708
|
);
|
|
2722
|
-
const removeContext = (0,
|
|
1709
|
+
const removeContext = (0, import_react15.useCallback)(
|
|
2723
1710
|
(id) => {
|
|
2724
1711
|
removeElement(id);
|
|
2725
1712
|
},
|
|
2726
1713
|
[removeElement]
|
|
2727
1714
|
);
|
|
2728
|
-
const getAllContext = (0,
|
|
1715
|
+
const getAllContext = (0, import_react15.useCallback)(() => {
|
|
2729
1716
|
return getAllElements();
|
|
2730
1717
|
}, [getAllElements]);
|
|
2731
|
-
const getFunctionCallHandler = (0,
|
|
1718
|
+
const getFunctionCallHandler = (0, import_react15.useCallback)(
|
|
2732
1719
|
(customEntryPoints) => {
|
|
2733
1720
|
return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || actions));
|
|
2734
1721
|
},
|
|
2735
1722
|
[actions]
|
|
2736
1723
|
);
|
|
2737
|
-
const getDocumentsContext = (0,
|
|
1724
|
+
const getDocumentsContext = (0, import_react15.useCallback)(
|
|
2738
1725
|
(categories) => {
|
|
2739
1726
|
return allDocuments(categories);
|
|
2740
1727
|
},
|
|
2741
1728
|
[allDocuments]
|
|
2742
1729
|
);
|
|
2743
|
-
const addDocumentContext = (0,
|
|
1730
|
+
const addDocumentContext = (0, import_react15.useCallback)(
|
|
2744
1731
|
(documentPointer, categories = defaultCopilotContextCategories) => {
|
|
2745
1732
|
return addDocument(documentPointer, categories);
|
|
2746
1733
|
},
|
|
2747
1734
|
[addDocument]
|
|
2748
1735
|
);
|
|
2749
|
-
const removeDocumentContext = (0,
|
|
1736
|
+
const removeDocumentContext = (0, import_react15.useCallback)(
|
|
2750
1737
|
(documentId) => {
|
|
2751
1738
|
removeDocument(documentId);
|
|
2752
1739
|
},
|
|
2753
1740
|
[removeDocument]
|
|
2754
1741
|
);
|
|
2755
|
-
const copilotApiConfig = (0,
|
|
1742
|
+
const copilotApiConfig = (0, import_react15.useMemo)(() => {
|
|
2756
1743
|
var _a2, _b2;
|
|
2757
1744
|
let cloud = void 0;
|
|
2758
1745
|
if (publicApiKey) {
|
|
@@ -2788,7 +1775,7 @@ ${nonDocumentStrings}`;
|
|
|
2788
1775
|
props.cloudRestrictToTopic,
|
|
2789
1776
|
props.guardrails_c
|
|
2790
1777
|
]);
|
|
2791
|
-
const headers = (0,
|
|
1778
|
+
const headers = (0, import_react15.useMemo)(() => {
|
|
2792
1779
|
const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
|
|
2793
1780
|
if (state.status === "authenticated" && state.authHeaders) {
|
|
2794
1781
|
return __spreadValues(__spreadValues({}, acc), Object.entries(state.authHeaders).reduce(
|
|
@@ -2800,27 +1787,27 @@ ${nonDocumentStrings}`;
|
|
|
2800
1787
|
}
|
|
2801
1788
|
return acc;
|
|
2802
1789
|
}, {});
|
|
2803
|
-
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [
|
|
1790
|
+
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [import_shared12.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {}), authHeaders);
|
|
2804
1791
|
}, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
|
|
2805
|
-
const [internalErrorHandlers, _setInternalErrorHandler] = (0,
|
|
2806
|
-
const setInternalErrorHandler = (0,
|
|
1792
|
+
const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react15.useState)({});
|
|
1793
|
+
const setInternalErrorHandler = (0, import_react15.useCallback)((handler) => {
|
|
2807
1794
|
_setInternalErrorHandler((prev) => __spreadValues(__spreadValues({}, prev), handler));
|
|
2808
1795
|
}, []);
|
|
2809
|
-
const removeInternalErrorHandler = (0,
|
|
1796
|
+
const removeInternalErrorHandler = (0, import_react15.useCallback)((key) => {
|
|
2810
1797
|
_setInternalErrorHandler((prev) => {
|
|
2811
1798
|
const _a2 = prev, { [key]: _removed } = _a2, rest = __objRest(_a2, [__restKey(key)]);
|
|
2812
1799
|
return rest;
|
|
2813
1800
|
});
|
|
2814
1801
|
}, []);
|
|
2815
|
-
const onErrorRef = (0,
|
|
2816
|
-
(0,
|
|
1802
|
+
const onErrorRef = (0, import_react15.useRef)(props.onError);
|
|
1803
|
+
(0, import_react15.useEffect)(() => {
|
|
2817
1804
|
onErrorRef.current = props.onError;
|
|
2818
1805
|
}, [props.onError]);
|
|
2819
|
-
const internalHandlersRef = (0,
|
|
2820
|
-
(0,
|
|
1806
|
+
const internalHandlersRef = (0, import_react15.useRef)({});
|
|
1807
|
+
(0, import_react15.useEffect)(() => {
|
|
2821
1808
|
internalHandlersRef.current = internalErrorHandlers;
|
|
2822
1809
|
}, [internalErrorHandlers]);
|
|
2823
|
-
const handleErrors = (0,
|
|
1810
|
+
const handleErrors = (0, import_react15.useCallback)(
|
|
2824
1811
|
(error) => __async(this, null, function* () {
|
|
2825
1812
|
if (copilotApiConfig.publicApiKey && onErrorRef.current) {
|
|
2826
1813
|
try {
|
|
@@ -2840,14 +1827,14 @@ ${nonDocumentStrings}`;
|
|
|
2840
1827
|
}),
|
|
2841
1828
|
[copilotApiConfig.publicApiKey]
|
|
2842
1829
|
);
|
|
2843
|
-
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0,
|
|
2844
|
-
const addChatSuggestionConfiguration = (0,
|
|
1830
|
+
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react15.useState)({});
|
|
1831
|
+
const addChatSuggestionConfiguration = (0, import_react15.useCallback)(
|
|
2845
1832
|
(id, suggestion) => {
|
|
2846
1833
|
setChatSuggestionConfiguration((prev) => __spreadProps(__spreadValues({}, prev), { [id]: suggestion }));
|
|
2847
1834
|
},
|
|
2848
1835
|
[setChatSuggestionConfiguration]
|
|
2849
1836
|
);
|
|
2850
|
-
const removeChatSuggestionConfiguration = (0,
|
|
1837
|
+
const removeChatSuggestionConfiguration = (0, import_react15.useCallback)(
|
|
2851
1838
|
(id) => {
|
|
2852
1839
|
setChatSuggestionConfiguration((prev) => {
|
|
2853
1840
|
const _a2 = prev, { [id]: _ } = _a2, rest = __objRest(_a2, [__restKey(id)]);
|
|
@@ -2856,10 +1843,10 @@ ${nonDocumentStrings}`;
|
|
|
2856
1843
|
},
|
|
2857
1844
|
[setChatSuggestionConfiguration]
|
|
2858
1845
|
);
|
|
2859
|
-
const [availableAgents, setAvailableAgents] = (0,
|
|
2860
|
-
const [coagentStates, setCoagentStates] = (0,
|
|
2861
|
-
const coagentStatesRef = (0,
|
|
2862
|
-
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)(
|
|
2863
1850
|
(value) => {
|
|
2864
1851
|
const newValue = typeof value === "function" ? value(coagentStatesRef.current) : value;
|
|
2865
1852
|
coagentStatesRef.current = newValue;
|
|
@@ -2875,8 +1862,8 @@ ${nonDocumentStrings}`;
|
|
|
2875
1862
|
agentName: props.agent
|
|
2876
1863
|
};
|
|
2877
1864
|
}
|
|
2878
|
-
const [agentSession, setAgentSession] = (0,
|
|
2879
|
-
(0,
|
|
1865
|
+
const [agentSession, setAgentSession] = (0, import_react15.useState)(initialAgentSession);
|
|
1866
|
+
(0, import_react15.useEffect)(() => {
|
|
2880
1867
|
if (props.agent) {
|
|
2881
1868
|
setAgentSession({
|
|
2882
1869
|
agentName: props.agent
|
|
@@ -2886,7 +1873,7 @@ ${nonDocumentStrings}`;
|
|
|
2886
1873
|
}
|
|
2887
1874
|
}, [props.agent]);
|
|
2888
1875
|
const { threadId, setThreadId: setInternalThreadId } = useThreads();
|
|
2889
|
-
const setThreadId = (0,
|
|
1876
|
+
const setThreadId = (0, import_react15.useCallback)(
|
|
2890
1877
|
(value) => {
|
|
2891
1878
|
if (props.threadId) {
|
|
2892
1879
|
throw new Error("Cannot call setThreadId() when threadId is provided via props.");
|
|
@@ -2895,11 +1882,11 @@ ${nonDocumentStrings}`;
|
|
|
2895
1882
|
},
|
|
2896
1883
|
[props.threadId]
|
|
2897
1884
|
);
|
|
2898
|
-
const [runId, setRunId] = (0,
|
|
2899
|
-
const chatAbortControllerRef = (0,
|
|
1885
|
+
const [runId, setRunId] = (0, import_react15.useState)(null);
|
|
1886
|
+
const chatAbortControllerRef = (0, import_react15.useRef)(null);
|
|
2900
1887
|
const showDevConsole = shouldShowDevConsole(props.showDevConsole);
|
|
2901
|
-
const [interruptActions, _setInterruptActions] = (0,
|
|
2902
|
-
const setInterruptAction = (0,
|
|
1888
|
+
const [interruptActions, _setInterruptActions] = (0, import_react15.useState)({});
|
|
1889
|
+
const setInterruptAction = (0, import_react15.useCallback)((action) => {
|
|
2903
1890
|
_setInterruptActions((prev) => {
|
|
2904
1891
|
var _a2;
|
|
2905
1892
|
if (action == null || !action.id) {
|
|
@@ -2910,14 +1897,14 @@ ${nonDocumentStrings}`;
|
|
|
2910
1897
|
});
|
|
2911
1898
|
});
|
|
2912
1899
|
}, []);
|
|
2913
|
-
const removeInterruptAction = (0,
|
|
1900
|
+
const removeInterruptAction = (0, import_react15.useCallback)((actionId) => {
|
|
2914
1901
|
_setInterruptActions((prev) => {
|
|
2915
1902
|
const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
|
|
2916
1903
|
return rest;
|
|
2917
1904
|
});
|
|
2918
1905
|
}, []);
|
|
2919
|
-
const [interruptEventQueue, setInterruptEventQueue] = (0,
|
|
2920
|
-
const addInterruptEvent = (0,
|
|
1906
|
+
const [interruptEventQueue, setInterruptEventQueue] = (0, import_react15.useState)({});
|
|
1907
|
+
const addInterruptEvent = (0, import_react15.useCallback)((queuedEvent) => {
|
|
2921
1908
|
setInterruptEventQueue((prev) => {
|
|
2922
1909
|
const threadQueue = prev[queuedEvent.threadId] || [];
|
|
2923
1910
|
return __spreadProps(__spreadValues({}, prev), {
|
|
@@ -2925,7 +1912,7 @@ ${nonDocumentStrings}`;
|
|
|
2925
1912
|
});
|
|
2926
1913
|
});
|
|
2927
1914
|
}, []);
|
|
2928
|
-
const resolveInterruptEvent = (0,
|
|
1915
|
+
const resolveInterruptEvent = (0, import_react15.useCallback)(
|
|
2929
1916
|
(threadId2, eventId, response) => {
|
|
2930
1917
|
setInterruptEventQueue((prev) => {
|
|
2931
1918
|
const threadQueue = prev[threadId2] || [];
|
|
@@ -2938,20 +1925,20 @@ ${nonDocumentStrings}`;
|
|
|
2938
1925
|
},
|
|
2939
1926
|
[]
|
|
2940
1927
|
);
|
|
2941
|
-
const memoizedChildren = (0,
|
|
2942
|
-
const [bannerError, setBannerError] = (0,
|
|
2943
|
-
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)(() => {
|
|
2944
1931
|
var _a2;
|
|
2945
1932
|
return (_a2 = props.agent) != null ? _a2 : null;
|
|
2946
1933
|
}, [props.agent]);
|
|
2947
|
-
const forwardedParameters = (0,
|
|
1934
|
+
const forwardedParameters = (0, import_react15.useMemo)(
|
|
2948
1935
|
() => {
|
|
2949
1936
|
var _a2;
|
|
2950
1937
|
return (_a2 = props.forwardedParameters) != null ? _a2 : {};
|
|
2951
1938
|
},
|
|
2952
1939
|
[props.forwardedParameters]
|
|
2953
1940
|
);
|
|
2954
|
-
const updateExtensions = (0,
|
|
1941
|
+
const updateExtensions = (0, import_react15.useCallback)(
|
|
2955
1942
|
(newExtensions) => {
|
|
2956
1943
|
setExtensions((prev) => {
|
|
2957
1944
|
const resolved = typeof newExtensions === "function" ? newExtensions(prev) : newExtensions;
|
|
@@ -2963,7 +1950,7 @@ ${nonDocumentStrings}`;
|
|
|
2963
1950
|
},
|
|
2964
1951
|
[setExtensions]
|
|
2965
1952
|
);
|
|
2966
|
-
const updateAuthStates = (0,
|
|
1953
|
+
const updateAuthStates = (0, import_react15.useCallback)(
|
|
2967
1954
|
(newAuthStates) => {
|
|
2968
1955
|
setAuthStates((prev) => {
|
|
2969
1956
|
const resolved = typeof newAuthStates === "function" ? newAuthStates(prev) : newAuthStates;
|
|
@@ -2975,8 +1962,8 @@ ${nonDocumentStrings}`;
|
|
|
2975
1962
|
},
|
|
2976
1963
|
[setAuthStates]
|
|
2977
1964
|
);
|
|
2978
|
-
const handleSetRegisteredActions = (0,
|
|
2979
|
-
const key = actionConfig.action.name || (0,
|
|
1965
|
+
const handleSetRegisteredActions = (0, import_react15.useCallback)((actionConfig) => {
|
|
1966
|
+
const key = actionConfig.action.name || (0, import_shared12.randomUUID)();
|
|
2980
1967
|
setRegisteredActionConfigs((prev) => {
|
|
2981
1968
|
const newMap = new Map(prev);
|
|
2982
1969
|
newMap.set(key, actionConfig);
|
|
@@ -2984,25 +1971,25 @@ ${nonDocumentStrings}`;
|
|
|
2984
1971
|
});
|
|
2985
1972
|
return key;
|
|
2986
1973
|
}, []);
|
|
2987
|
-
const handleRemoveRegisteredAction = (0,
|
|
1974
|
+
const handleRemoveRegisteredAction = (0, import_react15.useCallback)((actionKey) => {
|
|
2988
1975
|
setRegisteredActionConfigs((prev) => {
|
|
2989
1976
|
const newMap = new Map(prev);
|
|
2990
1977
|
newMap.delete(actionKey);
|
|
2991
1978
|
return newMap;
|
|
2992
1979
|
});
|
|
2993
1980
|
}, []);
|
|
2994
|
-
const RegisteredActionsRenderer = (0,
|
|
2995
|
-
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]) => {
|
|
2996
1983
|
const Component = config.component;
|
|
2997
|
-
return /* @__PURE__ */ (0,
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Component, { action: config.action }, key);
|
|
2998
1985
|
}) });
|
|
2999
1986
|
}, [registeredActionConfigs]);
|
|
3000
|
-
return /* @__PURE__ */ (0,
|
|
3001
|
-
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1988
|
+
import_react16.CopilotChatConfigurationProvider,
|
|
3002
1989
|
{
|
|
3003
1990
|
agentId: (_b = props.agent) != null ? _b : "default",
|
|
3004
1991
|
threadId,
|
|
3005
|
-
children: /* @__PURE__ */ (0,
|
|
1992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3006
1993
|
CopilotContext.Provider,
|
|
3007
1994
|
{
|
|
3008
1995
|
value: {
|
|
@@ -3064,14 +2051,13 @@ ${nonDocumentStrings}`;
|
|
|
3064
2051
|
removeInternalErrorHandler
|
|
3065
2052
|
},
|
|
3066
2053
|
children: [
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3068
|
-
/* @__PURE__ */ (0,
|
|
3069
|
-
/* @__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: [
|
|
3070
2057
|
memoizedChildren,
|
|
3071
|
-
|
|
3072
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RegisteredActionsRenderer, {})
|
|
2058
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RegisteredActionsRenderer, {})
|
|
3073
2059
|
] }) }),
|
|
3074
|
-
bannerError && showDevConsole && /* @__PURE__ */ (0,
|
|
2060
|
+
bannerError && showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3075
2061
|
UsageBanner,
|
|
3076
2062
|
{
|
|
3077
2063
|
severity: bannerError.severity,
|
|
@@ -3120,33 +2106,33 @@ function validateProps(props) {
|
|
|
3120
2106
|
const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
|
|
3121
2107
|
const hasApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
3122
2108
|
if (!props.runtimeUrl && !hasApiKey) {
|
|
3123
|
-
throw new
|
|
2109
|
+
throw new import_shared12.ConfigurationError(
|
|
3124
2110
|
"Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
|
|
3125
2111
|
);
|
|
3126
2112
|
}
|
|
3127
2113
|
if (cloudFeatures.length > 0 && !hasApiKey) {
|
|
3128
|
-
throw new
|
|
2114
|
+
throw new import_shared12.MissingPublicApiKeyError(
|
|
3129
2115
|
`Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
|
|
3130
2116
|
);
|
|
3131
2117
|
}
|
|
3132
2118
|
}
|
|
3133
2119
|
|
|
3134
2120
|
// src/hooks/use-copilot-chat_internal.ts
|
|
3135
|
-
var
|
|
2121
|
+
var import_react23 = require("react");
|
|
3136
2122
|
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
3137
2123
|
|
|
3138
2124
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
3139
|
-
var
|
|
2125
|
+
var import_react19 = __toESM(require("react"));
|
|
3140
2126
|
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
3141
|
-
var
|
|
2127
|
+
var import_shared13 = require("@copilotkit/shared");
|
|
3142
2128
|
|
|
3143
2129
|
// src/hooks/use-agent-nodename.ts
|
|
3144
|
-
var
|
|
3145
|
-
var
|
|
2130
|
+
var import_react17 = require("react");
|
|
2131
|
+
var import_react18 = require("@copilotkitnext/react");
|
|
3146
2132
|
function useAgentNodeName(agentName) {
|
|
3147
|
-
const { agent } = (0,
|
|
3148
|
-
const nodeNameRef = (0,
|
|
3149
|
-
(0,
|
|
2133
|
+
const { agent } = (0, import_react18.useAgent)({ agentId: agentName });
|
|
2134
|
+
const nodeNameRef = (0, import_react17.useRef)("start");
|
|
2135
|
+
(0, import_react17.useEffect)(() => {
|
|
3150
2136
|
if (!agent)
|
|
3151
2137
|
return;
|
|
3152
2138
|
const subscriber = {
|
|
@@ -3169,7 +2155,7 @@ function useAgentNodeName(agentName) {
|
|
|
3169
2155
|
}
|
|
3170
2156
|
|
|
3171
2157
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
3172
|
-
var
|
|
2158
|
+
var import_react20 = require("@copilotkitnext/react");
|
|
3173
2159
|
var InterruptRenderer = ({ event, result, render, resolve }) => {
|
|
3174
2160
|
return render({ event, result, resolve });
|
|
3175
2161
|
};
|
|
@@ -3183,10 +2169,10 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3183
2169
|
addInterruptEvent,
|
|
3184
2170
|
resolveInterruptEvent
|
|
3185
2171
|
} = useCopilotContext();
|
|
3186
|
-
const existingConfig = (0,
|
|
2172
|
+
const existingConfig = (0, import_react20.useCopilotChatConfiguration)();
|
|
3187
2173
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3188
2174
|
const nodeName = useAgentNodeName(resolvedAgentId);
|
|
3189
|
-
(0,
|
|
2175
|
+
(0, import_react19.useEffect)(() => {
|
|
3190
2176
|
if (!agent)
|
|
3191
2177
|
return;
|
|
3192
2178
|
let localInterrupt = null;
|
|
@@ -3196,9 +2182,9 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3196
2182
|
const eventData = {
|
|
3197
2183
|
name: import_runtime_client_gql.MetaEventName.LangGraphInterruptEvent,
|
|
3198
2184
|
type: event.type,
|
|
3199
|
-
value: (0,
|
|
2185
|
+
value: (0, import_shared13.parseJson)(event.value, event.value)
|
|
3200
2186
|
};
|
|
3201
|
-
const eventId = (0,
|
|
2187
|
+
const eventId = (0, import_shared13.dataToUUID)(eventData, "interruptEvents");
|
|
3202
2188
|
localInterrupt = {
|
|
3203
2189
|
eventId,
|
|
3204
2190
|
threadId,
|
|
@@ -3221,7 +2207,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3221
2207
|
unsubscribe();
|
|
3222
2208
|
};
|
|
3223
2209
|
}, [agent, threadId]);
|
|
3224
|
-
const handleResolve = (0,
|
|
2210
|
+
const handleResolve = (0, import_react19.useCallback)(
|
|
3225
2211
|
(eventId, response) => {
|
|
3226
2212
|
agent == null ? void 0 : agent.runAgent({
|
|
3227
2213
|
forwardedProps: {
|
|
@@ -3235,7 +2221,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3235
2221
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3236
2222
|
[agent, threadId]
|
|
3237
2223
|
);
|
|
3238
|
-
return (0,
|
|
2224
|
+
return (0, import_react19.useMemo)(() => {
|
|
3239
2225
|
const eventQueue = interruptEventQueue[threadId] || [];
|
|
3240
2226
|
const currentQueuedEvent = eventQueue.find((qe) => !qe.event.response);
|
|
3241
2227
|
if (!currentQueuedEvent || !agentSession)
|
|
@@ -3266,7 +2252,7 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3266
2252
|
}
|
|
3267
2253
|
if (!render)
|
|
3268
2254
|
return null;
|
|
3269
|
-
return
|
|
2255
|
+
return import_react19.default.createElement(InterruptRenderer, {
|
|
3270
2256
|
event: currentQueuedEvent.event,
|
|
3271
2257
|
result,
|
|
3272
2258
|
render,
|
|
@@ -3276,14 +2262,14 @@ function useLangGraphInterruptRender(agent) {
|
|
|
3276
2262
|
}
|
|
3277
2263
|
|
|
3278
2264
|
// src/hooks/use-copilot-chat_internal.ts
|
|
3279
|
-
var
|
|
2265
|
+
var import_react24 = require("@copilotkitnext/react");
|
|
3280
2266
|
|
|
3281
2267
|
// src/hooks/use-lazy-tool-renderer.tsx
|
|
3282
|
-
var
|
|
3283
|
-
var
|
|
2268
|
+
var import_react21 = require("@copilotkitnext/react");
|
|
2269
|
+
var import_react22 = require("react");
|
|
3284
2270
|
function useLazyToolRenderer() {
|
|
3285
|
-
const renderToolCall = (0,
|
|
3286
|
-
return (0,
|
|
2271
|
+
const renderToolCall = (0, import_react21.useRenderToolCall)();
|
|
2272
|
+
return (0, import_react22.useCallback)(
|
|
3287
2273
|
(message, messages) => {
|
|
3288
2274
|
var _a;
|
|
3289
2275
|
if (!((_a = message == null ? void 0 : message.toolCalls) == null ? void 0 : _a.length))
|
|
@@ -3303,482 +2289,26 @@ function useLazyToolRenderer() {
|
|
|
3303
2289
|
);
|
|
3304
2290
|
}
|
|
3305
2291
|
|
|
3306
|
-
// src/hooks/use-configure-chat-suggestions.tsx
|
|
3307
|
-
var import_react25 = require("@copilotkitnext/react");
|
|
3308
|
-
var import_react26 = require("react");
|
|
3309
|
-
function useConfigureChatSuggestions(config, dependencies = []) {
|
|
3310
|
-
var _a;
|
|
3311
|
-
const existingConfig = (0, import_react25.useCopilotChatConfiguration)();
|
|
3312
|
-
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3313
|
-
const { copilotkit } = (0, import_react25.useCopilotKit)();
|
|
3314
|
-
const available = config.available === "enabled" ? "always" : config.available;
|
|
3315
|
-
const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
|
|
3316
|
-
available,
|
|
3317
|
-
consumerAgentId: resolvedAgentId
|
|
3318
|
-
// Use chatConfig.agentId here
|
|
3319
|
-
});
|
|
3320
|
-
(0, import_react25.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
|
|
3321
|
-
const result = (0, import_react25.useSuggestions)({ agentId: resolvedAgentId });
|
|
3322
|
-
(0, import_react26.useEffect)(() => {
|
|
3323
|
-
if (finalSuggestionConfig.available === "disabled")
|
|
3324
|
-
return;
|
|
3325
|
-
const subscription = copilotkit.subscribe({
|
|
3326
|
-
onAgentsChanged: () => {
|
|
3327
|
-
const agent = copilotkit.getAgent(resolvedAgentId);
|
|
3328
|
-
if (agent && !agent.isRunning && !result.suggestions.length) {
|
|
3329
|
-
copilotkit.reloadSuggestions(resolvedAgentId);
|
|
3330
|
-
}
|
|
3331
|
-
}
|
|
3332
|
-
});
|
|
3333
|
-
return () => {
|
|
3334
|
-
subscription.unsubscribe();
|
|
3335
|
-
};
|
|
3336
|
-
}, [resolvedAgentId]);
|
|
3337
|
-
return result;
|
|
3338
|
-
}
|
|
3339
|
-
|
|
3340
|
-
// ../../node_modules/.pnpm/@ag-ui+core@0.0.42/node_modules/@ag-ui/core/dist/index.mjs
|
|
3341
|
-
var import_zod = require("zod");
|
|
3342
|
-
var import_zod2 = require("zod");
|
|
3343
|
-
var FunctionCallSchema = import_zod.z.object({
|
|
3344
|
-
name: import_zod.z.string(),
|
|
3345
|
-
arguments: import_zod.z.string()
|
|
3346
|
-
});
|
|
3347
|
-
var ToolCallSchema = import_zod.z.object({
|
|
3348
|
-
id: import_zod.z.string(),
|
|
3349
|
-
type: import_zod.z.literal("function"),
|
|
3350
|
-
function: FunctionCallSchema
|
|
3351
|
-
});
|
|
3352
|
-
var BaseMessageSchema = import_zod.z.object({
|
|
3353
|
-
id: import_zod.z.string(),
|
|
3354
|
-
role: import_zod.z.string(),
|
|
3355
|
-
content: import_zod.z.string().optional(),
|
|
3356
|
-
name: import_zod.z.string().optional()
|
|
3357
|
-
});
|
|
3358
|
-
var TextInputContentSchema = import_zod.z.object({
|
|
3359
|
-
type: import_zod.z.literal("text"),
|
|
3360
|
-
text: import_zod.z.string()
|
|
3361
|
-
});
|
|
3362
|
-
var BinaryInputContentObjectSchema = import_zod.z.object({
|
|
3363
|
-
type: import_zod.z.literal("binary"),
|
|
3364
|
-
mimeType: import_zod.z.string(),
|
|
3365
|
-
id: import_zod.z.string().optional(),
|
|
3366
|
-
url: import_zod.z.string().optional(),
|
|
3367
|
-
data: import_zod.z.string().optional(),
|
|
3368
|
-
filename: import_zod.z.string().optional()
|
|
3369
|
-
});
|
|
3370
|
-
var ensureBinaryPayload = (value, ctx) => {
|
|
3371
|
-
if (!value.id && !value.url && !value.data) {
|
|
3372
|
-
ctx.addIssue({
|
|
3373
|
-
code: import_zod.z.ZodIssueCode.custom,
|
|
3374
|
-
message: "BinaryInputContent requires at least one of id, url, or data.",
|
|
3375
|
-
path: ["id"]
|
|
3376
|
-
});
|
|
3377
|
-
}
|
|
3378
|
-
};
|
|
3379
|
-
var BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {
|
|
3380
|
-
ensureBinaryPayload(value, ctx);
|
|
3381
|
-
});
|
|
3382
|
-
var InputContentBaseSchema = import_zod.z.discriminatedUnion("type", [
|
|
3383
|
-
TextInputContentSchema,
|
|
3384
|
-
BinaryInputContentObjectSchema
|
|
3385
|
-
]);
|
|
3386
|
-
var InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {
|
|
3387
|
-
if (value.type === "binary") {
|
|
3388
|
-
ensureBinaryPayload(value, ctx);
|
|
3389
|
-
}
|
|
3390
|
-
});
|
|
3391
|
-
var DeveloperMessageSchema = BaseMessageSchema.extend({
|
|
3392
|
-
role: import_zod.z.literal("developer"),
|
|
3393
|
-
content: import_zod.z.string()
|
|
3394
|
-
});
|
|
3395
|
-
var SystemMessageSchema = BaseMessageSchema.extend({
|
|
3396
|
-
role: import_zod.z.literal("system"),
|
|
3397
|
-
content: import_zod.z.string()
|
|
3398
|
-
});
|
|
3399
|
-
var AssistantMessageSchema = BaseMessageSchema.extend({
|
|
3400
|
-
role: import_zod.z.literal("assistant"),
|
|
3401
|
-
content: import_zod.z.string().optional(),
|
|
3402
|
-
toolCalls: import_zod.z.array(ToolCallSchema).optional()
|
|
3403
|
-
});
|
|
3404
|
-
var UserMessageSchema = BaseMessageSchema.extend({
|
|
3405
|
-
role: import_zod.z.literal("user"),
|
|
3406
|
-
content: import_zod.z.union([import_zod.z.string(), import_zod.z.array(InputContentSchema)])
|
|
3407
|
-
});
|
|
3408
|
-
var ToolMessageSchema = import_zod.z.object({
|
|
3409
|
-
id: import_zod.z.string(),
|
|
3410
|
-
content: import_zod.z.string(),
|
|
3411
|
-
role: import_zod.z.literal("tool"),
|
|
3412
|
-
toolCallId: import_zod.z.string(),
|
|
3413
|
-
error: import_zod.z.string().optional()
|
|
3414
|
-
});
|
|
3415
|
-
var ActivityMessageSchema = import_zod.z.object({
|
|
3416
|
-
id: import_zod.z.string(),
|
|
3417
|
-
role: import_zod.z.literal("activity"),
|
|
3418
|
-
activityType: import_zod.z.string(),
|
|
3419
|
-
content: import_zod.z.record(import_zod.z.any())
|
|
3420
|
-
});
|
|
3421
|
-
var MessageSchema = import_zod.z.discriminatedUnion("role", [
|
|
3422
|
-
DeveloperMessageSchema,
|
|
3423
|
-
SystemMessageSchema,
|
|
3424
|
-
AssistantMessageSchema,
|
|
3425
|
-
UserMessageSchema,
|
|
3426
|
-
ToolMessageSchema,
|
|
3427
|
-
ActivityMessageSchema
|
|
3428
|
-
]);
|
|
3429
|
-
var RoleSchema = import_zod.z.union([
|
|
3430
|
-
import_zod.z.literal("developer"),
|
|
3431
|
-
import_zod.z.literal("system"),
|
|
3432
|
-
import_zod.z.literal("assistant"),
|
|
3433
|
-
import_zod.z.literal("user"),
|
|
3434
|
-
import_zod.z.literal("tool"),
|
|
3435
|
-
import_zod.z.literal("activity")
|
|
3436
|
-
]);
|
|
3437
|
-
var ContextSchema = import_zod.z.object({
|
|
3438
|
-
description: import_zod.z.string(),
|
|
3439
|
-
value: import_zod.z.string()
|
|
3440
|
-
});
|
|
3441
|
-
var ToolSchema = import_zod.z.object({
|
|
3442
|
-
name: import_zod.z.string(),
|
|
3443
|
-
description: import_zod.z.string(),
|
|
3444
|
-
parameters: import_zod.z.any()
|
|
3445
|
-
// JSON Schema for the tool parameters
|
|
3446
|
-
});
|
|
3447
|
-
var RunAgentInputSchema = import_zod.z.object({
|
|
3448
|
-
threadId: import_zod.z.string(),
|
|
3449
|
-
runId: import_zod.z.string(),
|
|
3450
|
-
parentRunId: import_zod.z.string().optional(),
|
|
3451
|
-
state: import_zod.z.any(),
|
|
3452
|
-
messages: import_zod.z.array(MessageSchema),
|
|
3453
|
-
tools: import_zod.z.array(ToolSchema),
|
|
3454
|
-
context: import_zod.z.array(ContextSchema),
|
|
3455
|
-
forwardedProps: import_zod.z.any()
|
|
3456
|
-
});
|
|
3457
|
-
var StateSchema = import_zod.z.any();
|
|
3458
|
-
var AGUIError = class extends Error {
|
|
3459
|
-
constructor(message) {
|
|
3460
|
-
super(message);
|
|
3461
|
-
}
|
|
3462
|
-
};
|
|
3463
|
-
var AGUIConnectNotImplementedError = class extends AGUIError {
|
|
3464
|
-
constructor() {
|
|
3465
|
-
super("Connect not implemented. This method is not supported by the current agent.");
|
|
3466
|
-
}
|
|
3467
|
-
};
|
|
3468
|
-
var TextMessageRoleSchema = import_zod2.z.union([
|
|
3469
|
-
import_zod2.z.literal("developer"),
|
|
3470
|
-
import_zod2.z.literal("system"),
|
|
3471
|
-
import_zod2.z.literal("assistant"),
|
|
3472
|
-
import_zod2.z.literal("user")
|
|
3473
|
-
]);
|
|
3474
|
-
var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
3475
|
-
EventType2["TEXT_MESSAGE_START"] = "TEXT_MESSAGE_START";
|
|
3476
|
-
EventType2["TEXT_MESSAGE_CONTENT"] = "TEXT_MESSAGE_CONTENT";
|
|
3477
|
-
EventType2["TEXT_MESSAGE_END"] = "TEXT_MESSAGE_END";
|
|
3478
|
-
EventType2["TEXT_MESSAGE_CHUNK"] = "TEXT_MESSAGE_CHUNK";
|
|
3479
|
-
EventType2["THINKING_TEXT_MESSAGE_START"] = "THINKING_TEXT_MESSAGE_START";
|
|
3480
|
-
EventType2["THINKING_TEXT_MESSAGE_CONTENT"] = "THINKING_TEXT_MESSAGE_CONTENT";
|
|
3481
|
-
EventType2["THINKING_TEXT_MESSAGE_END"] = "THINKING_TEXT_MESSAGE_END";
|
|
3482
|
-
EventType2["TOOL_CALL_START"] = "TOOL_CALL_START";
|
|
3483
|
-
EventType2["TOOL_CALL_ARGS"] = "TOOL_CALL_ARGS";
|
|
3484
|
-
EventType2["TOOL_CALL_END"] = "TOOL_CALL_END";
|
|
3485
|
-
EventType2["TOOL_CALL_CHUNK"] = "TOOL_CALL_CHUNK";
|
|
3486
|
-
EventType2["TOOL_CALL_RESULT"] = "TOOL_CALL_RESULT";
|
|
3487
|
-
EventType2["THINKING_START"] = "THINKING_START";
|
|
3488
|
-
EventType2["THINKING_END"] = "THINKING_END";
|
|
3489
|
-
EventType2["STATE_SNAPSHOT"] = "STATE_SNAPSHOT";
|
|
3490
|
-
EventType2["STATE_DELTA"] = "STATE_DELTA";
|
|
3491
|
-
EventType2["MESSAGES_SNAPSHOT"] = "MESSAGES_SNAPSHOT";
|
|
3492
|
-
EventType2["ACTIVITY_SNAPSHOT"] = "ACTIVITY_SNAPSHOT";
|
|
3493
|
-
EventType2["ACTIVITY_DELTA"] = "ACTIVITY_DELTA";
|
|
3494
|
-
EventType2["RAW"] = "RAW";
|
|
3495
|
-
EventType2["CUSTOM"] = "CUSTOM";
|
|
3496
|
-
EventType2["RUN_STARTED"] = "RUN_STARTED";
|
|
3497
|
-
EventType2["RUN_FINISHED"] = "RUN_FINISHED";
|
|
3498
|
-
EventType2["RUN_ERROR"] = "RUN_ERROR";
|
|
3499
|
-
EventType2["STEP_STARTED"] = "STEP_STARTED";
|
|
3500
|
-
EventType2["STEP_FINISHED"] = "STEP_FINISHED";
|
|
3501
|
-
return EventType2;
|
|
3502
|
-
})(EventType || {});
|
|
3503
|
-
var BaseEventSchema = import_zod2.z.object({
|
|
3504
|
-
type: import_zod2.z.nativeEnum(EventType),
|
|
3505
|
-
timestamp: import_zod2.z.number().optional(),
|
|
3506
|
-
rawEvent: import_zod2.z.any().optional()
|
|
3507
|
-
});
|
|
3508
|
-
var TextMessageStartEventSchema = BaseEventSchema.extend({
|
|
3509
|
-
type: import_zod2.z.literal(
|
|
3510
|
-
"TEXT_MESSAGE_START"
|
|
3511
|
-
/* TEXT_MESSAGE_START */
|
|
3512
|
-
),
|
|
3513
|
-
messageId: import_zod2.z.string(),
|
|
3514
|
-
role: TextMessageRoleSchema.default("assistant")
|
|
3515
|
-
});
|
|
3516
|
-
var TextMessageContentEventSchema = BaseEventSchema.extend({
|
|
3517
|
-
type: import_zod2.z.literal(
|
|
3518
|
-
"TEXT_MESSAGE_CONTENT"
|
|
3519
|
-
/* TEXT_MESSAGE_CONTENT */
|
|
3520
|
-
),
|
|
3521
|
-
messageId: import_zod2.z.string(),
|
|
3522
|
-
delta: import_zod2.z.string().refine((s) => s.length > 0, "Delta must not be an empty string")
|
|
3523
|
-
});
|
|
3524
|
-
var TextMessageEndEventSchema = BaseEventSchema.extend({
|
|
3525
|
-
type: import_zod2.z.literal(
|
|
3526
|
-
"TEXT_MESSAGE_END"
|
|
3527
|
-
/* TEXT_MESSAGE_END */
|
|
3528
|
-
),
|
|
3529
|
-
messageId: import_zod2.z.string()
|
|
3530
|
-
});
|
|
3531
|
-
var TextMessageChunkEventSchema = BaseEventSchema.extend({
|
|
3532
|
-
type: import_zod2.z.literal(
|
|
3533
|
-
"TEXT_MESSAGE_CHUNK"
|
|
3534
|
-
/* TEXT_MESSAGE_CHUNK */
|
|
3535
|
-
),
|
|
3536
|
-
messageId: import_zod2.z.string().optional(),
|
|
3537
|
-
role: TextMessageRoleSchema.optional(),
|
|
3538
|
-
delta: import_zod2.z.string().optional()
|
|
3539
|
-
});
|
|
3540
|
-
var ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({
|
|
3541
|
-
type: import_zod2.z.literal(
|
|
3542
|
-
"THINKING_TEXT_MESSAGE_START"
|
|
3543
|
-
/* THINKING_TEXT_MESSAGE_START */
|
|
3544
|
-
)
|
|
3545
|
-
});
|
|
3546
|
-
var ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({
|
|
3547
|
-
messageId: true,
|
|
3548
|
-
type: true
|
|
3549
|
-
}).extend({
|
|
3550
|
-
type: import_zod2.z.literal(
|
|
3551
|
-
"THINKING_TEXT_MESSAGE_CONTENT"
|
|
3552
|
-
/* THINKING_TEXT_MESSAGE_CONTENT */
|
|
3553
|
-
)
|
|
3554
|
-
});
|
|
3555
|
-
var ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({
|
|
3556
|
-
type: import_zod2.z.literal(
|
|
3557
|
-
"THINKING_TEXT_MESSAGE_END"
|
|
3558
|
-
/* THINKING_TEXT_MESSAGE_END */
|
|
3559
|
-
)
|
|
3560
|
-
});
|
|
3561
|
-
var ToolCallStartEventSchema = BaseEventSchema.extend({
|
|
3562
|
-
type: import_zod2.z.literal(
|
|
3563
|
-
"TOOL_CALL_START"
|
|
3564
|
-
/* TOOL_CALL_START */
|
|
3565
|
-
),
|
|
3566
|
-
toolCallId: import_zod2.z.string(),
|
|
3567
|
-
toolCallName: import_zod2.z.string(),
|
|
3568
|
-
parentMessageId: import_zod2.z.string().optional()
|
|
3569
|
-
});
|
|
3570
|
-
var ToolCallArgsEventSchema = BaseEventSchema.extend({
|
|
3571
|
-
type: import_zod2.z.literal(
|
|
3572
|
-
"TOOL_CALL_ARGS"
|
|
3573
|
-
/* TOOL_CALL_ARGS */
|
|
3574
|
-
),
|
|
3575
|
-
toolCallId: import_zod2.z.string(),
|
|
3576
|
-
delta: import_zod2.z.string()
|
|
3577
|
-
});
|
|
3578
|
-
var ToolCallEndEventSchema = BaseEventSchema.extend({
|
|
3579
|
-
type: import_zod2.z.literal(
|
|
3580
|
-
"TOOL_CALL_END"
|
|
3581
|
-
/* TOOL_CALL_END */
|
|
3582
|
-
),
|
|
3583
|
-
toolCallId: import_zod2.z.string()
|
|
3584
|
-
});
|
|
3585
|
-
var ToolCallResultEventSchema = BaseEventSchema.extend({
|
|
3586
|
-
messageId: import_zod2.z.string(),
|
|
3587
|
-
type: import_zod2.z.literal(
|
|
3588
|
-
"TOOL_CALL_RESULT"
|
|
3589
|
-
/* TOOL_CALL_RESULT */
|
|
3590
|
-
),
|
|
3591
|
-
toolCallId: import_zod2.z.string(),
|
|
3592
|
-
content: import_zod2.z.string(),
|
|
3593
|
-
role: import_zod2.z.literal("tool").optional()
|
|
3594
|
-
});
|
|
3595
|
-
var ToolCallChunkEventSchema = BaseEventSchema.extend({
|
|
3596
|
-
type: import_zod2.z.literal(
|
|
3597
|
-
"TOOL_CALL_CHUNK"
|
|
3598
|
-
/* TOOL_CALL_CHUNK */
|
|
3599
|
-
),
|
|
3600
|
-
toolCallId: import_zod2.z.string().optional(),
|
|
3601
|
-
toolCallName: import_zod2.z.string().optional(),
|
|
3602
|
-
parentMessageId: import_zod2.z.string().optional(),
|
|
3603
|
-
delta: import_zod2.z.string().optional()
|
|
3604
|
-
});
|
|
3605
|
-
var ThinkingStartEventSchema = BaseEventSchema.extend({
|
|
3606
|
-
type: import_zod2.z.literal(
|
|
3607
|
-
"THINKING_START"
|
|
3608
|
-
/* THINKING_START */
|
|
3609
|
-
),
|
|
3610
|
-
title: import_zod2.z.string().optional()
|
|
3611
|
-
});
|
|
3612
|
-
var ThinkingEndEventSchema = BaseEventSchema.extend({
|
|
3613
|
-
type: import_zod2.z.literal(
|
|
3614
|
-
"THINKING_END"
|
|
3615
|
-
/* THINKING_END */
|
|
3616
|
-
)
|
|
3617
|
-
});
|
|
3618
|
-
var StateSnapshotEventSchema = BaseEventSchema.extend({
|
|
3619
|
-
type: import_zod2.z.literal(
|
|
3620
|
-
"STATE_SNAPSHOT"
|
|
3621
|
-
/* STATE_SNAPSHOT */
|
|
3622
|
-
),
|
|
3623
|
-
snapshot: StateSchema
|
|
3624
|
-
});
|
|
3625
|
-
var StateDeltaEventSchema = BaseEventSchema.extend({
|
|
3626
|
-
type: import_zod2.z.literal(
|
|
3627
|
-
"STATE_DELTA"
|
|
3628
|
-
/* STATE_DELTA */
|
|
3629
|
-
),
|
|
3630
|
-
delta: import_zod2.z.array(import_zod2.z.any())
|
|
3631
|
-
// JSON Patch (RFC 6902)
|
|
3632
|
-
});
|
|
3633
|
-
var MessagesSnapshotEventSchema = BaseEventSchema.extend({
|
|
3634
|
-
type: import_zod2.z.literal(
|
|
3635
|
-
"MESSAGES_SNAPSHOT"
|
|
3636
|
-
/* MESSAGES_SNAPSHOT */
|
|
3637
|
-
),
|
|
3638
|
-
messages: import_zod2.z.array(MessageSchema)
|
|
3639
|
-
});
|
|
3640
|
-
var ActivitySnapshotEventSchema = BaseEventSchema.extend({
|
|
3641
|
-
type: import_zod2.z.literal(
|
|
3642
|
-
"ACTIVITY_SNAPSHOT"
|
|
3643
|
-
/* ACTIVITY_SNAPSHOT */
|
|
3644
|
-
),
|
|
3645
|
-
messageId: import_zod2.z.string(),
|
|
3646
|
-
activityType: import_zod2.z.string(),
|
|
3647
|
-
content: import_zod2.z.record(import_zod2.z.any()),
|
|
3648
|
-
replace: import_zod2.z.boolean().optional().default(true)
|
|
3649
|
-
});
|
|
3650
|
-
var ActivityDeltaEventSchema = BaseEventSchema.extend({
|
|
3651
|
-
type: import_zod2.z.literal(
|
|
3652
|
-
"ACTIVITY_DELTA"
|
|
3653
|
-
/* ACTIVITY_DELTA */
|
|
3654
|
-
),
|
|
3655
|
-
messageId: import_zod2.z.string(),
|
|
3656
|
-
activityType: import_zod2.z.string(),
|
|
3657
|
-
patch: import_zod2.z.array(import_zod2.z.any())
|
|
3658
|
-
});
|
|
3659
|
-
var RawEventSchema = BaseEventSchema.extend({
|
|
3660
|
-
type: import_zod2.z.literal(
|
|
3661
|
-
"RAW"
|
|
3662
|
-
/* RAW */
|
|
3663
|
-
),
|
|
3664
|
-
event: import_zod2.z.any(),
|
|
3665
|
-
source: import_zod2.z.string().optional()
|
|
3666
|
-
});
|
|
3667
|
-
var CustomEventSchema = BaseEventSchema.extend({
|
|
3668
|
-
type: import_zod2.z.literal(
|
|
3669
|
-
"CUSTOM"
|
|
3670
|
-
/* CUSTOM */
|
|
3671
|
-
),
|
|
3672
|
-
name: import_zod2.z.string(),
|
|
3673
|
-
value: import_zod2.z.any()
|
|
3674
|
-
});
|
|
3675
|
-
var RunStartedEventSchema = BaseEventSchema.extend({
|
|
3676
|
-
type: import_zod2.z.literal(
|
|
3677
|
-
"RUN_STARTED"
|
|
3678
|
-
/* RUN_STARTED */
|
|
3679
|
-
),
|
|
3680
|
-
threadId: import_zod2.z.string(),
|
|
3681
|
-
runId: import_zod2.z.string(),
|
|
3682
|
-
parentRunId: import_zod2.z.string().optional(),
|
|
3683
|
-
input: RunAgentInputSchema.optional()
|
|
3684
|
-
});
|
|
3685
|
-
var RunFinishedEventSchema = BaseEventSchema.extend({
|
|
3686
|
-
type: import_zod2.z.literal(
|
|
3687
|
-
"RUN_FINISHED"
|
|
3688
|
-
/* RUN_FINISHED */
|
|
3689
|
-
),
|
|
3690
|
-
threadId: import_zod2.z.string(),
|
|
3691
|
-
runId: import_zod2.z.string(),
|
|
3692
|
-
result: import_zod2.z.any().optional()
|
|
3693
|
-
});
|
|
3694
|
-
var RunErrorEventSchema = BaseEventSchema.extend({
|
|
3695
|
-
type: import_zod2.z.literal(
|
|
3696
|
-
"RUN_ERROR"
|
|
3697
|
-
/* RUN_ERROR */
|
|
3698
|
-
),
|
|
3699
|
-
message: import_zod2.z.string(),
|
|
3700
|
-
code: import_zod2.z.string().optional()
|
|
3701
|
-
});
|
|
3702
|
-
var StepStartedEventSchema = BaseEventSchema.extend({
|
|
3703
|
-
type: import_zod2.z.literal(
|
|
3704
|
-
"STEP_STARTED"
|
|
3705
|
-
/* STEP_STARTED */
|
|
3706
|
-
),
|
|
3707
|
-
stepName: import_zod2.z.string()
|
|
3708
|
-
});
|
|
3709
|
-
var StepFinishedEventSchema = BaseEventSchema.extend({
|
|
3710
|
-
type: import_zod2.z.literal(
|
|
3711
|
-
"STEP_FINISHED"
|
|
3712
|
-
/* STEP_FINISHED */
|
|
3713
|
-
),
|
|
3714
|
-
stepName: import_zod2.z.string()
|
|
3715
|
-
});
|
|
3716
|
-
var EventSchemas = import_zod2.z.discriminatedUnion("type", [
|
|
3717
|
-
TextMessageStartEventSchema,
|
|
3718
|
-
TextMessageContentEventSchema,
|
|
3719
|
-
TextMessageEndEventSchema,
|
|
3720
|
-
TextMessageChunkEventSchema,
|
|
3721
|
-
ThinkingStartEventSchema,
|
|
3722
|
-
ThinkingEndEventSchema,
|
|
3723
|
-
ThinkingTextMessageStartEventSchema,
|
|
3724
|
-
ThinkingTextMessageContentEventSchema,
|
|
3725
|
-
ThinkingTextMessageEndEventSchema,
|
|
3726
|
-
ToolCallStartEventSchema,
|
|
3727
|
-
ToolCallArgsEventSchema,
|
|
3728
|
-
ToolCallEndEventSchema,
|
|
3729
|
-
ToolCallChunkEventSchema,
|
|
3730
|
-
ToolCallResultEventSchema,
|
|
3731
|
-
StateSnapshotEventSchema,
|
|
3732
|
-
StateDeltaEventSchema,
|
|
3733
|
-
MessagesSnapshotEventSchema,
|
|
3734
|
-
ActivitySnapshotEventSchema,
|
|
3735
|
-
ActivityDeltaEventSchema,
|
|
3736
|
-
RawEventSchema,
|
|
3737
|
-
CustomEventSchema,
|
|
3738
|
-
RunStartedEventSchema,
|
|
3739
|
-
RunFinishedEventSchema,
|
|
3740
|
-
RunErrorEventSchema,
|
|
3741
|
-
StepStartedEventSchema,
|
|
3742
|
-
StepFinishedEventSchema
|
|
3743
|
-
]);
|
|
3744
|
-
|
|
3745
2292
|
// src/hooks/use-copilot-chat_internal.ts
|
|
3746
|
-
|
|
3747
|
-
let suggestionsConfig;
|
|
3748
|
-
if (Array.isArray(suggestions)) {
|
|
3749
|
-
suggestionsConfig = {
|
|
3750
|
-
suggestions,
|
|
3751
|
-
available: "always"
|
|
3752
|
-
};
|
|
3753
|
-
} else if (suggestions === "auto") {
|
|
3754
|
-
suggestionsConfig = {
|
|
3755
|
-
available: suggestions === "auto" ? "always" : "disabled",
|
|
3756
|
-
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls."
|
|
3757
|
-
};
|
|
3758
|
-
} else {
|
|
3759
|
-
suggestionsConfig = { available: "disabled" };
|
|
3760
|
-
}
|
|
3761
|
-
useConfigureChatSuggestions(suggestionsConfig);
|
|
3762
|
-
}
|
|
2293
|
+
var import_client = require("@ag-ui/client");
|
|
3763
2294
|
function useCopilotChatInternal({
|
|
3764
2295
|
suggestions
|
|
3765
2296
|
} = {}) {
|
|
3766
2297
|
var _a, _b, _c;
|
|
3767
|
-
const { copilotkit } = (0,
|
|
2298
|
+
const { copilotkit } = (0, import_react24.useCopilotKit)();
|
|
3768
2299
|
const { threadId, agentSession } = useCopilotContext();
|
|
3769
|
-
const existingConfig = (0,
|
|
3770
|
-
const [agentAvailable, setAgentAvailable] = (0,
|
|
3771
|
-
useConfigureSuggestions2(suggestions);
|
|
2300
|
+
const existingConfig = (0, import_react24.useCopilotChatConfiguration)();
|
|
2301
|
+
const [agentAvailable, setAgentAvailable] = (0, import_react23.useState)(false);
|
|
3772
2302
|
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3773
|
-
const { agent } = (0,
|
|
3774
|
-
(0,
|
|
2303
|
+
const { agent } = (0, import_react24.useAgent)({ agentId: resolvedAgentId });
|
|
2304
|
+
(0, import_react23.useEffect)(() => {
|
|
3775
2305
|
const connect = (agent2) => __async(this, null, function* () {
|
|
3776
2306
|
setAgentAvailable(false);
|
|
3777
2307
|
try {
|
|
3778
2308
|
yield copilotkit.connectAgent({ agent: agent2 });
|
|
3779
2309
|
setAgentAvailable(true);
|
|
3780
2310
|
} catch (error) {
|
|
3781
|
-
if (error instanceof AGUIConnectNotImplementedError) {
|
|
2311
|
+
if (error instanceof import_client.AGUIConnectNotImplementedError) {
|
|
3782
2312
|
} else {
|
|
3783
2313
|
throw error;
|
|
3784
2314
|
}
|
|
@@ -3796,7 +2326,7 @@ function useCopilotChatInternal({
|
|
|
3796
2326
|
agent == null ? void 0 : agent.setMessages([]);
|
|
3797
2327
|
agent == null ? void 0 : agent.setState(null);
|
|
3798
2328
|
};
|
|
3799
|
-
const deleteMessage = (0,
|
|
2329
|
+
const deleteMessage = (0, import_react23.useCallback)(
|
|
3800
2330
|
(messageId) => {
|
|
3801
2331
|
var _a2;
|
|
3802
2332
|
const filteredMessages = ((_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []).filter(
|
|
@@ -3807,13 +2337,13 @@ function useCopilotChatInternal({
|
|
|
3807
2337
|
[agent == null ? void 0 : agent.setMessages, agent == null ? void 0 : agent.messages]
|
|
3808
2338
|
);
|
|
3809
2339
|
const latestDelete = useUpdatedRef(deleteMessage);
|
|
3810
|
-
const latestDeleteFunc = (0,
|
|
2340
|
+
const latestDeleteFunc = (0, import_react23.useCallback)(
|
|
3811
2341
|
(messageId) => {
|
|
3812
2342
|
return latestDelete.current(messageId);
|
|
3813
2343
|
},
|
|
3814
2344
|
[latestDelete]
|
|
3815
2345
|
);
|
|
3816
|
-
const currentSuggestions = (0,
|
|
2346
|
+
const currentSuggestions = (0, import_react24.useSuggestions)({ agentId: resolvedAgentId });
|
|
3817
2347
|
const reload = useAsyncCallback(
|
|
3818
2348
|
(reloadMessageId) => __async(this, null, function* () {
|
|
3819
2349
|
var _a2;
|
|
@@ -3880,7 +2410,7 @@ function useCopilotChatInternal({
|
|
|
3880
2410
|
}),
|
|
3881
2411
|
[latestSendMessageFunc]
|
|
3882
2412
|
);
|
|
3883
|
-
const latestSetMessagesFunc = (0,
|
|
2413
|
+
const latestSetMessagesFunc = (0, import_react23.useCallback)(
|
|
3884
2414
|
(messages) => {
|
|
3885
2415
|
var _a2, _b2;
|
|
3886
2416
|
if (messages.every((message) => message instanceof import_runtime_client_gql2.Message)) {
|
|
@@ -3897,16 +2427,16 @@ function useCopilotChatInternal({
|
|
|
3897
2427
|
}),
|
|
3898
2428
|
[latestReload]
|
|
3899
2429
|
);
|
|
3900
|
-
const latestStopFunc = (0,
|
|
2430
|
+
const latestStopFunc = (0, import_react23.useCallback)(() => {
|
|
3901
2431
|
var _a2;
|
|
3902
2432
|
return (_a2 = agent == null ? void 0 : agent.abortRun) == null ? void 0 : _a2.call(agent);
|
|
3903
2433
|
}, [agent == null ? void 0 : agent.abortRun]);
|
|
3904
2434
|
const latestReset = useUpdatedRef(reset);
|
|
3905
|
-
const latestResetFunc = (0,
|
|
2435
|
+
const latestResetFunc = (0, import_react23.useCallback)(() => {
|
|
3906
2436
|
return latestReset.current();
|
|
3907
2437
|
}, [latestReset]);
|
|
3908
2438
|
const lazyToolRendered = useLazyToolRenderer();
|
|
3909
|
-
const renderCustomMessage = (0,
|
|
2439
|
+
const renderCustomMessage = (0, import_react24.useRenderCustomMessages)();
|
|
3910
2440
|
const legacyCustomMessageRenderer = useLegacyCoagentRenderer({
|
|
3911
2441
|
copilotkit,
|
|
3912
2442
|
agent,
|
|
@@ -3914,7 +2444,7 @@ function useCopilotChatInternal({
|
|
|
3914
2444
|
threadId: (_b = existingConfig == null ? void 0 : existingConfig.threadId) != null ? _b : threadId
|
|
3915
2445
|
});
|
|
3916
2446
|
const allMessages = (_c = agent == null ? void 0 : agent.messages) != null ? _c : [];
|
|
3917
|
-
const resolvedMessages = (0,
|
|
2447
|
+
const resolvedMessages = (0, import_react23.useMemo)(() => {
|
|
3918
2448
|
let processedMessages = allMessages.map((message) => {
|
|
3919
2449
|
if (message.role !== "assistant") {
|
|
3920
2450
|
return message;
|
|
@@ -3951,6 +2481,15 @@ function useCopilotChatInternal({
|
|
|
3951
2481
|
// legacyCustomMessageRenderer,
|
|
3952
2482
|
resolvedAgentId
|
|
3953
2483
|
]);
|
|
2484
|
+
const renderedSuggestions = (0, import_react23.useMemo)(() => {
|
|
2485
|
+
if (Array.isArray(suggestions)) {
|
|
2486
|
+
return {
|
|
2487
|
+
suggestions: suggestions.map((s) => __spreadProps(__spreadValues({}, s), { isLoading: false })),
|
|
2488
|
+
isLoading: false
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
return currentSuggestions;
|
|
2492
|
+
}, [suggestions, currentSuggestions]);
|
|
3954
2493
|
return {
|
|
3955
2494
|
messages: resolvedMessages,
|
|
3956
2495
|
sendMessage: latestSendMessageFunc,
|
|
@@ -3964,21 +2503,21 @@ function useCopilotChatInternal({
|
|
|
3964
2503
|
isLoading: Boolean(agent == null ? void 0 : agent.isRunning),
|
|
3965
2504
|
// mcpServers,
|
|
3966
2505
|
// setMcpServers,
|
|
3967
|
-
suggestions:
|
|
2506
|
+
suggestions: renderedSuggestions.suggestions,
|
|
3968
2507
|
setSuggestions: (suggestions2) => copilotkit.addSuggestionsConfig({ suggestions: suggestions2 }),
|
|
3969
2508
|
generateSuggestions: () => __async(this, null, function* () {
|
|
3970
2509
|
return copilotkit.reloadSuggestions(resolvedAgentId);
|
|
3971
2510
|
}),
|
|
3972
2511
|
resetSuggestions: () => copilotkit.clearSuggestions(resolvedAgentId),
|
|
3973
|
-
isLoadingSuggestions:
|
|
2512
|
+
isLoadingSuggestions: renderedSuggestions.isLoading,
|
|
3974
2513
|
interrupt,
|
|
3975
2514
|
agent,
|
|
3976
2515
|
threadId
|
|
3977
2516
|
};
|
|
3978
2517
|
}
|
|
3979
2518
|
function useUpdatedRef(value) {
|
|
3980
|
-
const ref = (0,
|
|
3981
|
-
(0,
|
|
2519
|
+
const ref = (0, import_react23.useRef)(value);
|
|
2520
|
+
(0, import_react23.useEffect)(() => {
|
|
3982
2521
|
ref.current = value;
|
|
3983
2522
|
}, [value]);
|
|
3984
2523
|
return ref;
|
|
@@ -3989,7 +2528,7 @@ function useLegacyCoagentRenderer({
|
|
|
3989
2528
|
agentId,
|
|
3990
2529
|
threadId
|
|
3991
2530
|
}) {
|
|
3992
|
-
return (0,
|
|
2531
|
+
return (0, import_react23.useMemo)(() => {
|
|
3993
2532
|
if (!copilotkit || !agent) {
|
|
3994
2533
|
return null;
|
|
3995
2534
|
}
|
|
@@ -4012,7 +2551,7 @@ function useLegacyCoagentRenderer({
|
|
|
4012
2551
|
agentId,
|
|
4013
2552
|
stateSnapshot: message.state
|
|
4014
2553
|
};
|
|
4015
|
-
return (0,
|
|
2554
|
+
return (0, import_react23.createElement)(CoAgentStateRenderBridge, bridgeProps);
|
|
4016
2555
|
};
|
|
4017
2556
|
}, [agent, agentId, copilotkit, threadId]);
|
|
4018
2557
|
}
|
|
@@ -4046,8 +2585,8 @@ function useCopilotChat(options = {}) {
|
|
|
4046
2585
|
}
|
|
4047
2586
|
|
|
4048
2587
|
// src/hooks/use-copilot-chat-headless_c.ts
|
|
4049
|
-
var
|
|
4050
|
-
var
|
|
2588
|
+
var import_react25 = require("react");
|
|
2589
|
+
var import_shared14 = require("@copilotkit/shared");
|
|
4051
2590
|
var createNonFunctionalReturn = () => ({
|
|
4052
2591
|
visibleMessages: [],
|
|
4053
2592
|
messages: [],
|
|
@@ -4087,20 +2626,20 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
4087
2626
|
const { copilotApiConfig, setBannerError } = useCopilotContext();
|
|
4088
2627
|
const hasPublicApiKey = Boolean(copilotApiConfig.publicApiKey);
|
|
4089
2628
|
const internalResult = useCopilotChatInternal(options);
|
|
4090
|
-
(0,
|
|
2629
|
+
(0, import_react25.useEffect)(() => {
|
|
4091
2630
|
if (!hasPublicApiKey) {
|
|
4092
2631
|
setBannerError(
|
|
4093
|
-
new
|
|
2632
|
+
new import_shared14.CopilotKitError({
|
|
4094
2633
|
message: (
|
|
4095
2634
|
// add link to documentation here
|
|
4096
2635
|
"You're using useCopilotChatHeadless_c, a premium-only feature, which offers extensive headless chat capabilities. To continue, you'll need to provide a free public license key."
|
|
4097
2636
|
),
|
|
4098
|
-
code:
|
|
4099
|
-
severity:
|
|
4100
|
-
visibility:
|
|
2637
|
+
code: import_shared14.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
|
|
2638
|
+
severity: import_shared14.Severity.WARNING,
|
|
2639
|
+
visibility: import_shared14.ErrorVisibility.BANNER
|
|
4101
2640
|
})
|
|
4102
2641
|
);
|
|
4103
|
-
|
|
2642
|
+
import_shared14.styledConsole.logCopilotKitPlatformMessage();
|
|
4104
2643
|
} else {
|
|
4105
2644
|
setBannerError(null);
|
|
4106
2645
|
}
|
|
@@ -4112,40 +2651,40 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
4112
2651
|
}
|
|
4113
2652
|
|
|
4114
2653
|
// src/hooks/use-copilot-action.ts
|
|
4115
|
-
var
|
|
2654
|
+
var import_react32 = require("react");
|
|
4116
2655
|
|
|
4117
2656
|
// src/hooks/use-frontend-tool.ts
|
|
4118
|
-
var
|
|
2657
|
+
var import_react26 = __toESM(require("react"));
|
|
2658
|
+
var import_shared15 = require("@copilotkit/shared");
|
|
4119
2659
|
var import_shared16 = require("@copilotkit/shared");
|
|
4120
|
-
var
|
|
4121
|
-
var import_react31 = require("@copilotkitnext/react");
|
|
2660
|
+
var import_react27 = require("@copilotkitnext/react");
|
|
4122
2661
|
function useFrontendTool(tool, dependencies) {
|
|
4123
2662
|
const { name, description, parameters, render, followUp } = tool;
|
|
4124
|
-
const zodParameters = (0,
|
|
2663
|
+
const zodParameters = (0, import_shared15.getZodParameters)(parameters);
|
|
4125
2664
|
const normalizedRender = (() => {
|
|
4126
2665
|
if (typeof render === "undefined") {
|
|
4127
2666
|
return void 0;
|
|
4128
2667
|
}
|
|
4129
2668
|
if (typeof render === "string") {
|
|
4130
2669
|
const staticRender = render;
|
|
4131
|
-
return () =>
|
|
4132
|
-
|
|
2670
|
+
return () => import_react26.default.createElement(
|
|
2671
|
+
import_react26.default.Fragment,
|
|
4133
2672
|
null,
|
|
4134
2673
|
staticRender
|
|
4135
2674
|
);
|
|
4136
2675
|
}
|
|
4137
2676
|
return (args) => {
|
|
4138
2677
|
const renderArgs = __spreadProps(__spreadValues({}, args), {
|
|
4139
|
-
result: typeof args.result === "string" ? (0,
|
|
2678
|
+
result: typeof args.result === "string" ? (0, import_shared16.parseJson)(args.result, args.result) : args.result
|
|
4140
2679
|
});
|
|
4141
2680
|
const rendered = render(renderArgs);
|
|
4142
2681
|
if (typeof rendered === "string") {
|
|
4143
|
-
return
|
|
2682
|
+
return import_react26.default.createElement(import_react26.default.Fragment, null, rendered);
|
|
4144
2683
|
}
|
|
4145
2684
|
return rendered != null ? rendered : null;
|
|
4146
2685
|
};
|
|
4147
2686
|
})();
|
|
4148
|
-
(0,
|
|
2687
|
+
(0, import_react27.useFrontendTool)({
|
|
4149
2688
|
name,
|
|
4150
2689
|
description,
|
|
4151
2690
|
parameters: zodParameters,
|
|
@@ -4156,29 +2695,29 @@ function useFrontendTool(tool, dependencies) {
|
|
|
4156
2695
|
}
|
|
4157
2696
|
|
|
4158
2697
|
// src/hooks/use-render-tool-call.ts
|
|
2698
|
+
var import_shared17 = require("@copilotkit/shared");
|
|
2699
|
+
var import_react28 = require("react");
|
|
2700
|
+
var import_react29 = require("@copilotkitnext/react");
|
|
4159
2701
|
var import_shared18 = require("@copilotkit/shared");
|
|
4160
|
-
var import_react32 = require("react");
|
|
4161
|
-
var import_react33 = require("@copilotkitnext/react");
|
|
4162
|
-
var import_shared19 = require("@copilotkit/shared");
|
|
4163
2702
|
function useRenderToolCall2(tool, dependencies) {
|
|
4164
|
-
const { copilotkit } = (0,
|
|
4165
|
-
const hasAddedRef = (0,
|
|
4166
|
-
(0,
|
|
2703
|
+
const { copilotkit } = (0, import_react29.useCopilotKit)();
|
|
2704
|
+
const hasAddedRef = (0, import_react28.useRef)(false);
|
|
2705
|
+
(0, import_react28.useEffect)(() => {
|
|
4167
2706
|
const { name, parameters, render } = tool;
|
|
4168
|
-
const zodParameters = (0,
|
|
4169
|
-
const renderToolCall = name === "*" ? (0,
|
|
2707
|
+
const zodParameters = (0, import_shared17.getZodParameters)(parameters);
|
|
2708
|
+
const renderToolCall = name === "*" ? (0, import_react29.defineToolCallRenderer)({
|
|
4170
2709
|
name: "*",
|
|
4171
2710
|
render: (args) => {
|
|
4172
2711
|
return render(__spreadProps(__spreadValues({}, args), {
|
|
4173
|
-
result: args.result ? (0,
|
|
2712
|
+
result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
|
|
4174
2713
|
}));
|
|
4175
2714
|
}
|
|
4176
|
-
}) : (0,
|
|
2715
|
+
}) : (0, import_react29.defineToolCallRenderer)({
|
|
4177
2716
|
name,
|
|
4178
2717
|
args: zodParameters,
|
|
4179
2718
|
render: (args) => {
|
|
4180
2719
|
return render(__spreadProps(__spreadValues({}, args), {
|
|
4181
|
-
result: args.result ? (0,
|
|
2720
|
+
result: args.result ? (0, import_shared18.parseJson)(args.result, args.result) : args.result
|
|
4182
2721
|
}));
|
|
4183
2722
|
}
|
|
4184
2723
|
});
|
|
@@ -4201,19 +2740,19 @@ function useRenderToolCall2(tool, dependencies) {
|
|
|
4201
2740
|
}
|
|
4202
2741
|
|
|
4203
2742
|
// src/hooks/use-human-in-the-loop.ts
|
|
4204
|
-
var
|
|
4205
|
-
var
|
|
2743
|
+
var import_shared19 = require("@copilotkit/shared");
|
|
2744
|
+
var import_react30 = require("@copilotkitnext/react");
|
|
4206
2745
|
var import_core = require("@copilotkitnext/core");
|
|
4207
|
-
var
|
|
2746
|
+
var import_react31 = __toESM(require("react"));
|
|
4208
2747
|
function useHumanInTheLoop(tool, dependencies) {
|
|
4209
2748
|
const _a = tool, { render } = _a, toolRest = __objRest(_a, ["render"]);
|
|
4210
2749
|
const { name, description, parameters, followUp } = toolRest;
|
|
4211
|
-
const zodParameters = (0,
|
|
4212
|
-
const renderRef = (0,
|
|
4213
|
-
(0,
|
|
2750
|
+
const zodParameters = (0, import_shared19.getZodParameters)(parameters);
|
|
2751
|
+
const renderRef = (0, import_react31.useRef)(null);
|
|
2752
|
+
(0, import_react31.useEffect)(() => {
|
|
4214
2753
|
renderRef.current = (args) => {
|
|
4215
2754
|
if (typeof render === "string") {
|
|
4216
|
-
return
|
|
2755
|
+
return import_react31.default.createElement(import_react31.default.Fragment, null, render);
|
|
4217
2756
|
}
|
|
4218
2757
|
if (!render) {
|
|
4219
2758
|
return null;
|
|
@@ -4241,24 +2780,24 @@ function useHumanInTheLoop(tool, dependencies) {
|
|
|
4241
2780
|
args: mappedArgs,
|
|
4242
2781
|
respond: args.respond,
|
|
4243
2782
|
status: args.status,
|
|
4244
|
-
result: args.result ? (0,
|
|
2783
|
+
result: args.result ? (0, import_shared19.parseJson)(args.result, args.result) : args.result,
|
|
4245
2784
|
handler: void 0
|
|
4246
2785
|
};
|
|
4247
2786
|
default:
|
|
4248
|
-
throw new
|
|
4249
|
-
code:
|
|
2787
|
+
throw new import_shared19.CopilotKitError({
|
|
2788
|
+
code: import_shared19.CopilotKitErrorCode.UNKNOWN,
|
|
4250
2789
|
message: `Invalid tool call status: ${args.status}`
|
|
4251
2790
|
});
|
|
4252
2791
|
}
|
|
4253
2792
|
})();
|
|
4254
2793
|
const rendered = render(renderProps);
|
|
4255
2794
|
if (typeof rendered === "string") {
|
|
4256
|
-
return
|
|
2795
|
+
return import_react31.default.createElement(import_react31.default.Fragment, null, rendered);
|
|
4257
2796
|
}
|
|
4258
2797
|
return rendered != null ? rendered : null;
|
|
4259
2798
|
};
|
|
4260
2799
|
}, [render, ...dependencies != null ? dependencies : []]);
|
|
4261
|
-
(0,
|
|
2800
|
+
(0, import_react30.useHumanInTheLoop)({
|
|
4262
2801
|
name,
|
|
4263
2802
|
description,
|
|
4264
2803
|
followUp,
|
|
@@ -4314,7 +2853,7 @@ function getActionConfig(action) {
|
|
|
4314
2853
|
throw new Error("Invalid action configuration");
|
|
4315
2854
|
}
|
|
4316
2855
|
function useCopilotAction(action, dependencies) {
|
|
4317
|
-
const [initialActionConfig] = (0,
|
|
2856
|
+
const [initialActionConfig] = (0, import_react32.useState)(getActionConfig(action));
|
|
4318
2857
|
const currentActionConfig = getActionConfig(action);
|
|
4319
2858
|
if (initialActionConfig.type !== currentActionConfig.type) {
|
|
4320
2859
|
throw new Error("Action configuration changed between renders");
|
|
@@ -4332,17 +2871,17 @@ function useCopilotAction(action, dependencies) {
|
|
|
4332
2871
|
}
|
|
4333
2872
|
|
|
4334
2873
|
// src/hooks/use-coagent-state-render.ts
|
|
4335
|
-
var
|
|
4336
|
-
var
|
|
2874
|
+
var import_react33 = require("react");
|
|
2875
|
+
var import_shared20 = require("@copilotkit/shared");
|
|
4337
2876
|
function useCoAgentStateRender(action, dependencies) {
|
|
4338
|
-
const { chatComponentsCache, availableAgents } = (0,
|
|
2877
|
+
const { chatComponentsCache, availableAgents } = (0, import_react33.useContext)(CopilotContext);
|
|
4339
2878
|
const { setCoAgentStateRender, removeCoAgentStateRender, coAgentStateRenders } = useCoAgentStateRenders();
|
|
4340
|
-
const idRef = (0,
|
|
2879
|
+
const idRef = (0, import_react33.useRef)((0, import_shared20.randomId)());
|
|
4341
2880
|
const { setBannerError, addToast } = useToast();
|
|
4342
|
-
(0,
|
|
2881
|
+
(0, import_react33.useEffect)(() => {
|
|
4343
2882
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
|
|
4344
2883
|
const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
|
|
4345
|
-
const agentError = new
|
|
2884
|
+
const agentError = new import_shared20.CopilotKitAgentDiscoveryError({
|
|
4346
2885
|
agentName: action.name,
|
|
4347
2886
|
availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
|
|
4348
2887
|
});
|
|
@@ -4360,7 +2899,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4360
2899
|
}
|
|
4361
2900
|
}
|
|
4362
2901
|
}
|
|
4363
|
-
(0,
|
|
2902
|
+
(0, import_react33.useEffect)(() => {
|
|
4364
2903
|
const currentId = idRef.current;
|
|
4365
2904
|
const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {
|
|
4366
2905
|
if (id === currentId)
|
|
@@ -4384,7 +2923,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4384
2923
|
});
|
|
4385
2924
|
}
|
|
4386
2925
|
}, [coAgentStateRenders]);
|
|
4387
|
-
(0,
|
|
2926
|
+
(0, import_react33.useEffect)(() => {
|
|
4388
2927
|
setCoAgentStateRender(idRef.current, action);
|
|
4389
2928
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
4390
2929
|
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
@@ -4404,12 +2943,12 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
4404
2943
|
}
|
|
4405
2944
|
|
|
4406
2945
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
4407
|
-
var
|
|
4408
|
-
function useMakeCopilotDocumentReadable(
|
|
2946
|
+
var import_react34 = require("react");
|
|
2947
|
+
function useMakeCopilotDocumentReadable(document, categories, dependencies = []) {
|
|
4409
2948
|
const { addDocumentContext, removeDocumentContext } = useCopilotContext();
|
|
4410
|
-
const idRef = (0,
|
|
4411
|
-
(0,
|
|
4412
|
-
const id = addDocumentContext(
|
|
2949
|
+
const idRef = (0, import_react34.useRef)(void 0);
|
|
2950
|
+
(0, import_react34.useEffect)(() => {
|
|
2951
|
+
const id = addDocumentContext(document, categories);
|
|
4413
2952
|
idRef.current = id;
|
|
4414
2953
|
return () => {
|
|
4415
2954
|
removeDocumentContext(id);
|
|
@@ -4419,12 +2958,12 @@ function useMakeCopilotDocumentReadable(document2, categories, dependencies = []
|
|
|
4419
2958
|
}
|
|
4420
2959
|
|
|
4421
2960
|
// src/hooks/use-copilot-readable.ts
|
|
4422
|
-
var
|
|
4423
|
-
var
|
|
2961
|
+
var import_react35 = require("@copilotkitnext/react");
|
|
2962
|
+
var import_react36 = require("react");
|
|
4424
2963
|
function useCopilotReadable({ description, value, convert, available }, dependencies) {
|
|
4425
|
-
const { copilotkit } = (0,
|
|
4426
|
-
const ctxIdRef = (0,
|
|
4427
|
-
(0,
|
|
2964
|
+
const { copilotkit } = (0, import_react35.useCopilotKit)();
|
|
2965
|
+
const ctxIdRef = (0, import_react36.useRef)(void 0);
|
|
2966
|
+
(0, import_react36.useEffect)(() => {
|
|
4428
2967
|
if (!copilotkit)
|
|
4429
2968
|
return;
|
|
4430
2969
|
const found = Object.entries(copilotkit.context).find(([id, ctxItem]) => {
|
|
@@ -4452,13 +2991,13 @@ function useCopilotReadable({ description, value, convert, available }, dependen
|
|
|
4452
2991
|
}
|
|
4453
2992
|
|
|
4454
2993
|
// src/hooks/use-coagent.ts
|
|
4455
|
-
var
|
|
4456
|
-
var
|
|
2994
|
+
var import_react37 = require("react");
|
|
2995
|
+
var import_react38 = require("@copilotkitnext/react");
|
|
4457
2996
|
function useCoAgent(options) {
|
|
4458
|
-
const { agent } = (0,
|
|
4459
|
-
const { copilotkit } = (0,
|
|
2997
|
+
const { agent } = (0, import_react38.useAgent)({ agentId: options.name });
|
|
2998
|
+
const { copilotkit } = (0, import_react38.useCopilotKit)();
|
|
4460
2999
|
const nodeName = useAgentNodeName(options.name);
|
|
4461
|
-
const handleStateUpdate = (0,
|
|
3000
|
+
const handleStateUpdate = (0, import_react37.useCallback)(
|
|
4462
3001
|
(newState) => {
|
|
4463
3002
|
if (!agent)
|
|
4464
3003
|
return;
|
|
@@ -4471,7 +3010,7 @@ function useCoAgent(options) {
|
|
|
4471
3010
|
},
|
|
4472
3011
|
[agent == null ? void 0 : agent.state, agent == null ? void 0 : agent.setState]
|
|
4473
3012
|
);
|
|
4474
|
-
(0,
|
|
3013
|
+
(0, import_react37.useEffect)(() => {
|
|
4475
3014
|
var _a;
|
|
4476
3015
|
if (!options.config && !options.configurable)
|
|
4477
3016
|
return;
|
|
@@ -4483,22 +3022,22 @@ function useCoAgent(options) {
|
|
|
4483
3022
|
}
|
|
4484
3023
|
copilotkit.setProperties(config);
|
|
4485
3024
|
}, [options.config, options.configurable]);
|
|
4486
|
-
const externalStateStr = (0,
|
|
3025
|
+
const externalStateStr = (0, import_react37.useMemo)(
|
|
4487
3026
|
() => isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0,
|
|
4488
3027
|
[isExternalStateManagement(options) ? JSON.stringify(options.state) : void 0]
|
|
4489
3028
|
);
|
|
4490
|
-
(0,
|
|
3029
|
+
(0, import_react37.useEffect)(() => {
|
|
4491
3030
|
if ((agent == null ? void 0 : agent.state) && isExternalStateManagement(options) && JSON.stringify(options.state) !== JSON.stringify(agent.state)) {
|
|
4492
3031
|
handleStateUpdate(options.state);
|
|
4493
3032
|
}
|
|
4494
3033
|
}, [agent, externalStateStr, handleStateUpdate]);
|
|
4495
|
-
const hasStateValues = (0,
|
|
3034
|
+
const hasStateValues = (0, import_react37.useCallback)((value) => {
|
|
4496
3035
|
return Boolean(value && Object.keys(value).length);
|
|
4497
3036
|
}, []);
|
|
4498
|
-
const initialStateRef = (0,
|
|
3037
|
+
const initialStateRef = (0, import_react37.useRef)(
|
|
4499
3038
|
isExternalStateManagement(options) ? options.state : "initialState" in options ? options.initialState : void 0
|
|
4500
3039
|
);
|
|
4501
|
-
(0,
|
|
3040
|
+
(0, import_react37.useEffect)(() => {
|
|
4502
3041
|
if (isExternalStateManagement(options)) {
|
|
4503
3042
|
initialStateRef.current = options.state;
|
|
4504
3043
|
} else if ("initialState" in options) {
|
|
@@ -4507,7 +3046,7 @@ function useCoAgent(options) {
|
|
|
4507
3046
|
}, [
|
|
4508
3047
|
isExternalStateManagement(options) ? JSON.stringify(options.state) : "initialState" in options ? JSON.stringify(options.initialState) : void 0
|
|
4509
3048
|
]);
|
|
4510
|
-
(0,
|
|
3049
|
+
(0, import_react37.useEffect)(() => {
|
|
4511
3050
|
if (!agent)
|
|
4512
3051
|
return;
|
|
4513
3052
|
const subscriber = {
|
|
@@ -4535,7 +3074,7 @@ function useCoAgent(options) {
|
|
|
4535
3074
|
subscription.unsubscribe();
|
|
4536
3075
|
};
|
|
4537
3076
|
}, [agent, handleStateUpdate, hasStateValues]);
|
|
4538
|
-
return (0,
|
|
3077
|
+
return (0, import_react37.useMemo)(() => {
|
|
4539
3078
|
var _a, _b, _c;
|
|
4540
3079
|
if (!agent) {
|
|
4541
3080
|
const noop = () => {
|
|
@@ -4591,12 +3130,12 @@ var isExternalStateManagement = (options) => {
|
|
|
4591
3130
|
|
|
4592
3131
|
// src/hooks/use-copilot-runtime-client.ts
|
|
4593
3132
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
4594
|
-
var
|
|
4595
|
-
var
|
|
3133
|
+
var import_react39 = require("react");
|
|
3134
|
+
var import_shared21 = require("@copilotkit/shared");
|
|
4596
3135
|
var useCopilotRuntimeClient = (options) => {
|
|
4597
3136
|
const { setBannerError } = useToast();
|
|
4598
3137
|
const _a = options, { showDevConsole, onError } = _a, runtimeOptions = __objRest(_a, ["showDevConsole", "onError"]);
|
|
4599
|
-
const lastStructuredErrorRef = (0,
|
|
3138
|
+
const lastStructuredErrorRef = (0, import_react39.useRef)(null);
|
|
4600
3139
|
const traceUIError = (error, originalError) => __async(void 0, null, function* () {
|
|
4601
3140
|
try {
|
|
4602
3141
|
const errorEvent = {
|
|
@@ -4622,7 +3161,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4622
3161
|
console.error("Error in onError handler:", error2);
|
|
4623
3162
|
}
|
|
4624
3163
|
});
|
|
4625
|
-
const runtimeClient = (0,
|
|
3164
|
+
const runtimeClient = (0, import_react39.useMemo)(() => {
|
|
4626
3165
|
return new import_runtime_client_gql3.CopilotRuntimeClient(__spreadProps(__spreadValues({}, runtimeOptions), {
|
|
4627
3166
|
handleGQLErrors: (error) => {
|
|
4628
3167
|
var _a2;
|
|
@@ -4631,7 +3170,7 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4631
3170
|
const routeError = (gqlError) => {
|
|
4632
3171
|
const extensions = gqlError.extensions;
|
|
4633
3172
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
4634
|
-
if (visibility ===
|
|
3173
|
+
if (visibility === import_shared21.ErrorVisibility.SILENT) {
|
|
4635
3174
|
console.error("CopilotKit Silent Error:", gqlError.message);
|
|
4636
3175
|
return;
|
|
4637
3176
|
}
|
|
@@ -4646,9 +3185,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4646
3185
|
setBannerError(ckError);
|
|
4647
3186
|
traceUIError(ckError, gqlError);
|
|
4648
3187
|
} else {
|
|
4649
|
-
const fallbackError = new
|
|
3188
|
+
const fallbackError = new import_shared21.CopilotKitError({
|
|
4650
3189
|
message: gqlError.message,
|
|
4651
|
-
code:
|
|
3190
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4652
3191
|
});
|
|
4653
3192
|
setBannerError(fallbackError);
|
|
4654
3193
|
traceUIError(fallbackError, gqlError);
|
|
@@ -4656,9 +3195,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4656
3195
|
};
|
|
4657
3196
|
graphQLErrors.forEach(routeError);
|
|
4658
3197
|
} else {
|
|
4659
|
-
const fallbackError = new
|
|
3198
|
+
const fallbackError = new import_shared21.CopilotKitError({
|
|
4660
3199
|
message: (error == null ? void 0 : error.message) || String(error),
|
|
4661
|
-
code:
|
|
3200
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4662
3201
|
});
|
|
4663
3202
|
setBannerError(fallbackError);
|
|
4664
3203
|
traceUIError(fallbackError, error);
|
|
@@ -4666,9 +3205,9 @@ var useCopilotRuntimeClient = (options) => {
|
|
|
4666
3205
|
},
|
|
4667
3206
|
handleGQLWarning: (message) => {
|
|
4668
3207
|
console.warn(message);
|
|
4669
|
-
const warningError = new
|
|
3208
|
+
const warningError = new import_shared21.CopilotKitError({
|
|
4670
3209
|
message,
|
|
4671
|
-
code:
|
|
3210
|
+
code: import_shared21.CopilotKitErrorCode.UNKNOWN
|
|
4672
3211
|
});
|
|
4673
3212
|
setBannerError(warningError);
|
|
4674
3213
|
}
|
|
@@ -4683,16 +3222,16 @@ function createStructuredError(gqlError) {
|
|
|
4683
3222
|
const message = (originalError == null ? void 0 : originalError.message) || gqlError.message;
|
|
4684
3223
|
const code = extensions == null ? void 0 : extensions.code;
|
|
4685
3224
|
if (code) {
|
|
4686
|
-
return new
|
|
3225
|
+
return new import_shared21.CopilotKitError({ message, code });
|
|
4687
3226
|
}
|
|
4688
3227
|
if ((_a = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _a.includes("CopilotApiDiscoveryError")) {
|
|
4689
|
-
return new
|
|
3228
|
+
return new import_shared21.CopilotKitApiDiscoveryError({ message });
|
|
4690
3229
|
}
|
|
4691
3230
|
if ((_b = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _b.includes("CopilotKitRemoteEndpointDiscoveryError")) {
|
|
4692
|
-
return new
|
|
3231
|
+
return new import_shared21.CopilotKitRemoteEndpointDiscoveryError({ message });
|
|
4693
3232
|
}
|
|
4694
3233
|
if ((_c = originalError == null ? void 0 : originalError.stack) == null ? void 0 : _c.includes("CopilotKitAgentDiscoveryError")) {
|
|
4695
|
-
return new
|
|
3234
|
+
return new import_shared21.CopilotKitAgentDiscoveryError({
|
|
4696
3235
|
agentName: "",
|
|
4697
3236
|
availableAgents: []
|
|
4698
3237
|
});
|
|
@@ -4701,28 +3240,28 @@ function createStructuredError(gqlError) {
|
|
|
4701
3240
|
}
|
|
4702
3241
|
|
|
4703
3242
|
// src/hooks/use-copilot-authenticated-action.ts
|
|
4704
|
-
var
|
|
4705
|
-
var
|
|
3243
|
+
var import_react40 = require("react");
|
|
3244
|
+
var import_react41 = __toESM(require("react"));
|
|
4706
3245
|
function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
4707
3246
|
const { authConfig_c, authStates_c, setAuthStates_c } = useCopilotContext();
|
|
4708
|
-
const pendingActionRef = (0,
|
|
4709
|
-
const executeAction = (0,
|
|
3247
|
+
const pendingActionRef = (0, import_react40.useRef)(null);
|
|
3248
|
+
const executeAction = (0, import_react40.useCallback)(
|
|
4710
3249
|
(props) => {
|
|
4711
3250
|
if (typeof action.render === "function") {
|
|
4712
3251
|
return action.render(props);
|
|
4713
3252
|
}
|
|
4714
|
-
return action.render ||
|
|
3253
|
+
return action.render || import_react41.default.createElement(import_react40.Fragment);
|
|
4715
3254
|
},
|
|
4716
3255
|
[action]
|
|
4717
3256
|
);
|
|
4718
|
-
const wrappedRender = (0,
|
|
3257
|
+
const wrappedRender = (0, import_react40.useCallback)(
|
|
4719
3258
|
(props) => {
|
|
4720
3259
|
const isAuthenticated = Object.values(authStates_c || {}).some(
|
|
4721
3260
|
(state) => state.status === "authenticated"
|
|
4722
3261
|
);
|
|
4723
3262
|
if (!isAuthenticated) {
|
|
4724
3263
|
pendingActionRef.current = props;
|
|
4725
|
-
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ?
|
|
3264
|
+
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react41.default.createElement(authConfig_c.SignInComponent, {
|
|
4726
3265
|
onSignInComplete: (authState) => {
|
|
4727
3266
|
setAuthStates_c == null ? void 0 : setAuthStates_c((prev) => __spreadProps(__spreadValues({}, prev), { [action.name]: authState }));
|
|
4728
3267
|
if (pendingActionRef.current) {
|
|
@@ -4730,7 +3269,7 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
4730
3269
|
pendingActionRef.current = null;
|
|
4731
3270
|
}
|
|
4732
3271
|
}
|
|
4733
|
-
}) :
|
|
3272
|
+
}) : import_react41.default.createElement(import_react40.Fragment);
|
|
4734
3273
|
}
|
|
4735
3274
|
return executeAction(props);
|
|
4736
3275
|
},
|
|
@@ -4745,13 +3284,13 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
4745
3284
|
}
|
|
4746
3285
|
|
|
4747
3286
|
// src/hooks/use-langgraph-interrupt.ts
|
|
4748
|
-
var
|
|
4749
|
-
var
|
|
3287
|
+
var import_react42 = require("react");
|
|
3288
|
+
var import_shared22 = require("@copilotkit/shared");
|
|
4750
3289
|
function useLangGraphInterrupt(action, dependencies) {
|
|
4751
|
-
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0,
|
|
3290
|
+
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = (0, import_react42.useContext)(CopilotContext);
|
|
4752
3291
|
const { addToast } = useToast();
|
|
4753
|
-
const actionId = (0,
|
|
4754
|
-
(0,
|
|
3292
|
+
const actionId = (0, import_shared22.dataToUUID)(action, "lgAction");
|
|
3293
|
+
(0, import_react42.useEffect)(() => {
|
|
4755
3294
|
if (!action)
|
|
4756
3295
|
return;
|
|
4757
3296
|
setInterruptAction(__spreadProps(__spreadValues({}, action), { id: actionId }));
|
|
@@ -4762,10 +3301,10 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
4762
3301
|
}
|
|
4763
3302
|
|
|
4764
3303
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
4765
|
-
var
|
|
3304
|
+
var import_react43 = require("react");
|
|
4766
3305
|
function useCopilotAdditionalInstructions({ instructions, available = "enabled" }, dependencies) {
|
|
4767
3306
|
const { setAdditionalInstructions } = useCopilotContext();
|
|
4768
|
-
(0,
|
|
3307
|
+
(0, import_react43.useEffect)(() => {
|
|
4769
3308
|
if (available === "disabled")
|
|
4770
3309
|
return;
|
|
4771
3310
|
setAdditionalInstructions((prevInstructions) => [...prevInstructions || [], instructions]);
|
|
@@ -4782,12 +3321,27 @@ function useDefaultTool(tool, dependencies) {
|
|
|
4782
3321
|
useCopilotAction(__spreadProps(__spreadValues({}, tool), { name: "*" }), dependencies);
|
|
4783
3322
|
}
|
|
4784
3323
|
|
|
3324
|
+
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
3325
|
+
var import_react44 = require("@copilotkitnext/react");
|
|
3326
|
+
function useCopilotChatSuggestions(config, dependencies = []) {
|
|
3327
|
+
var _a, _b;
|
|
3328
|
+
const existingConfig = (0, import_react44.useCopilotChatConfiguration)();
|
|
3329
|
+
const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default";
|
|
3330
|
+
const available = (_b = config.available === "enabled" ? "always" : config.available) != null ? _b : "before-first-message";
|
|
3331
|
+
const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), {
|
|
3332
|
+
available,
|
|
3333
|
+
consumerAgentId: resolvedAgentId
|
|
3334
|
+
// Use chatConfig.agentId here
|
|
3335
|
+
});
|
|
3336
|
+
(0, import_react44.useConfigureSuggestions)(finalSuggestionConfig, dependencies);
|
|
3337
|
+
}
|
|
3338
|
+
|
|
4785
3339
|
// src/lib/copilot-task.ts
|
|
4786
3340
|
var import_runtime_client_gql5 = require("@copilotkit/runtime-client-gql");
|
|
4787
3341
|
|
|
4788
3342
|
// src/types/frontend-action.ts
|
|
4789
3343
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
4790
|
-
var
|
|
3344
|
+
var import_shared23 = require("@copilotkit/shared");
|
|
4791
3345
|
function processActionsForRuntimeRequest(actions) {
|
|
4792
3346
|
const filteredActions = actions.filter(
|
|
4793
3347
|
(action) => action.available !== import_runtime_client_gql4.ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction
|
|
@@ -4803,7 +3357,7 @@ function processActionsForRuntimeRequest(actions) {
|
|
|
4803
3357
|
return {
|
|
4804
3358
|
name: action.name,
|
|
4805
3359
|
description: action.description || "",
|
|
4806
|
-
jsonSchema: JSON.stringify((0,
|
|
3360
|
+
jsonSchema: JSON.stringify((0, import_shared23.actionParametersToJsonSchema)(action.parameters || [])),
|
|
4807
3361
|
available
|
|
4808
3362
|
};
|
|
4809
3363
|
});
|
|
@@ -4921,13 +3475,13 @@ ${instructions}
|
|
|
4921
3475
|
useCoAgent,
|
|
4922
3476
|
useCoAgentStateRender,
|
|
4923
3477
|
useCoAgentStateRenders,
|
|
4924
|
-
useConfigureChatSuggestions,
|
|
4925
3478
|
useCopilotAction,
|
|
4926
3479
|
useCopilotAdditionalInstructions,
|
|
4927
3480
|
useCopilotAuthenticatedAction_c,
|
|
4928
3481
|
useCopilotChat,
|
|
4929
3482
|
useCopilotChatHeadless_c,
|
|
4930
3483
|
useCopilotChatInternal,
|
|
3484
|
+
useCopilotChatSuggestions,
|
|
4931
3485
|
useCopilotContext,
|
|
4932
3486
|
useCopilotMessagesContext,
|
|
4933
3487
|
useCopilotReadable,
|