@copilotkit/react-core 1.10.0-next.9 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/dist/{chunk-VH45SC6Z.mjs → chunk-2GRWTU7W.mjs} +2 -2
- package/dist/chunk-3BASANUO.mjs +170 -0
- package/dist/chunk-3BASANUO.mjs.map +1 -0
- package/dist/{chunk-PHIMGB3K.mjs → chunk-5P46WS5M.mjs} +25 -19
- package/dist/chunk-5P46WS5M.mjs.map +1 -0
- package/dist/{chunk-AWFAFFO5.mjs → chunk-6ZLPNY7X.mjs} +7 -3
- package/dist/chunk-6ZLPNY7X.mjs.map +1 -0
- package/dist/{chunk-TTI4Z6GK.mjs → chunk-BEFEBKKI.mjs} +7 -7
- package/dist/chunk-BEFEBKKI.mjs.map +1 -0
- package/dist/{chunk-VSH4JSN3.mjs → chunk-F26O2HTO.mjs} +13 -7
- package/dist/chunk-F26O2HTO.mjs.map +1 -0
- package/dist/{chunk-GRCHDHC4.mjs → chunk-JY3STRON.mjs} +22 -4
- package/dist/chunk-JY3STRON.mjs.map +1 -0
- package/dist/{chunk-ZTZJIDRJ.mjs → chunk-N4VN2B5S.mjs} +2 -2
- package/dist/{chunk-FTP6FDYS.mjs → chunk-NTH42BY5.mjs} +2 -2
- package/dist/chunk-PIF5KJYI.mjs +103 -0
- package/dist/chunk-PIF5KJYI.mjs.map +1 -0
- package/dist/chunk-WSXTUD36.mjs +759 -0
- package/dist/chunk-WSXTUD36.mjs.map +1 -0
- package/dist/chunk-YIBUNEBN.mjs +34 -0
- package/dist/chunk-YIBUNEBN.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit-props.d.ts +9 -1
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +1052 -72
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +6 -3
- package/dist/components/copilot-provider/index.js +1052 -72
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +6 -3
- package/dist/components/dev-console/console-trigger.d.ts +8 -0
- package/dist/components/dev-console/console-trigger.js +1131 -0
- package/dist/components/dev-console/console-trigger.js.map +1 -0
- package/dist/components/dev-console/console-trigger.mjs +13 -0
- package/dist/components/dev-console/developer-console-modal.d.ts +10 -0
- package/dist/components/dev-console/developer-console-modal.js +977 -0
- package/dist/components/dev-console/developer-console-modal.js.map +1 -0
- package/dist/components/dev-console/developer-console-modal.mjs +12 -0
- package/dist/components/dev-console/developer-console-modal.mjs.map +1 -0
- package/dist/components/dev-console/icons.d.ts +9 -0
- package/dist/components/dev-console/icons.js +131 -0
- package/dist/components/dev-console/icons.js.map +1 -0
- package/dist/components/dev-console/icons.mjs +16 -0
- package/dist/components/dev-console/icons.mjs.map +1 -0
- package/dist/components/error-boundary/error-boundary.js +6 -2
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.js +1052 -72
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -3
- package/dist/components/usage-banner.d.ts +2 -1
- package/dist/components/usage-banner.js +6 -2
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +1 -1
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/index.js +58 -26
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +13 -10
- package/dist/hooks/use-coagent.d.ts +1 -1
- package/dist/hooks/use-coagent.js +18 -6
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +8 -5
- package/dist/hooks/use-copilot-chat-headless_c.d.ts +33 -0
- package/dist/hooks/{use-copilot-chat-light.js → use-copilot-chat-headless_c.js} +88 -19
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -0
- package/dist/hooks/{use-copilot-chat-light.mjs → use-copilot-chat-headless_c.mjs} +14 -8
- package/dist/hooks/use-copilot-chat-headless_c.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat.d.ts +85 -4
- package/dist/hooks/use-copilot-chat.js +38 -61
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +8 -8
- package/dist/hooks/use-copilot-chat_internal.d.ts +98 -12
- package/dist/hooks/use-copilot-chat_internal.js +13 -1
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +7 -4
- package/dist/hooks/use-langgraph-interrupt.js +13 -1
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +8 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1203 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -11
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +7 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -4
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +6 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +6 -3
- package/dist/utils/suggestions.js.map +1 -1
- package/dist/utils/suggestions.mjs +6 -3
- package/package.json +3 -3
- package/src/components/copilot-provider/copilotkit-props.tsx +10 -1
- package/src/components/copilot-provider/copilotkit.tsx +25 -16
- package/src/components/dev-console/console-trigger.tsx +190 -0
- package/src/components/dev-console/developer-console-modal.tsx +866 -0
- package/src/components/dev-console/icons.tsx +101 -0
- package/src/components/usage-banner.tsx +8 -3
- package/src/hooks/index.ts +6 -7
- package/src/hooks/use-coagent.ts +6 -11
- package/src/hooks/use-copilot-chat-headless_c.ts +257 -0
- package/src/hooks/use-copilot-chat.ts +103 -154
- package/src/hooks/use-copilot-chat_internal.ts +122 -15
- package/dist/chunk-AWFAFFO5.mjs.map +0 -1
- package/dist/chunk-GRCHDHC4.mjs.map +0 -1
- package/dist/chunk-MWHILKQH.mjs +0 -18
- package/dist/chunk-MWHILKQH.mjs.map +0 -1
- package/dist/chunk-PHIMGB3K.mjs.map +0 -1
- package/dist/chunk-TTI4Z6GK.mjs.map +0 -1
- package/dist/chunk-VSH4JSN3.mjs.map +0 -1
- package/dist/hooks/use-copilot-chat-light.d.ts +0 -211
- package/dist/hooks/use-copilot-chat-light.js.map +0 -1
- package/src/hooks/use-copilot-chat-light.ts +0 -219
- /package/dist/{chunk-VH45SC6Z.mjs.map → chunk-2GRWTU7W.mjs.map} +0 -0
- /package/dist/{chunk-ZTZJIDRJ.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
- /package/dist/{chunk-FTP6FDYS.mjs.map → chunk-NTH42BY5.mjs.map} +0 -0
- /package/dist/{hooks/use-copilot-chat-light.mjs.map → components/dev-console/console-trigger.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -99,8 +99,8 @@ __export(src_exports, {
|
|
|
99
99
|
useCopilotAdditionalInstructions: () => useCopilotAdditionalInstructions,
|
|
100
100
|
useCopilotAuthenticatedAction_c: () => useCopilotAuthenticatedAction_c,
|
|
101
101
|
useCopilotChat: () => useCopilotChat2,
|
|
102
|
+
useCopilotChatHeadless_c: () => useCopilotChatHeadless_c,
|
|
102
103
|
useCopilotChatInternal: () => useCopilotChat,
|
|
103
|
-
useCopilotChatLight: () => useCopilotChatLight,
|
|
104
104
|
useCopilotContext: () => useCopilotContext,
|
|
105
105
|
useCopilotMessagesContext: () => useCopilotMessagesContext,
|
|
106
106
|
useCopilotReadable: () => useCopilotReadable,
|
|
@@ -112,7 +112,7 @@ __export(src_exports, {
|
|
|
112
112
|
module.exports = __toCommonJS(src_exports);
|
|
113
113
|
|
|
114
114
|
// src/components/copilot-provider/copilotkit.tsx
|
|
115
|
-
var
|
|
115
|
+
var import_react12 = require("react");
|
|
116
116
|
|
|
117
117
|
// src/context/copilot-context.tsx
|
|
118
118
|
var import_react = __toESM(require("react"));
|
|
@@ -341,7 +341,7 @@ function setsHaveIntersection(setA, setB) {
|
|
|
341
341
|
|
|
342
342
|
// src/components/copilot-provider/copilotkit.tsx
|
|
343
343
|
var import_react_dom = require("react-dom");
|
|
344
|
-
var
|
|
344
|
+
var import_shared12 = require("@copilotkit/shared");
|
|
345
345
|
|
|
346
346
|
// src/hooks/use-flat-category-store.ts
|
|
347
347
|
var import_react3 = require("react");
|
|
@@ -1110,8 +1110,12 @@ var getErrorActions = (error) => {
|
|
|
1110
1110
|
case import_shared5.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR:
|
|
1111
1111
|
return {
|
|
1112
1112
|
primary: {
|
|
1113
|
-
label: "
|
|
1114
|
-
onClick: () => window.open(
|
|
1113
|
+
label: "Show me how",
|
|
1114
|
+
onClick: () => window.open(
|
|
1115
|
+
"https://docs.copilotkit.ai/premium#how-do-i-get-access-to-premium-features",
|
|
1116
|
+
"_blank",
|
|
1117
|
+
"noopener,noreferrer"
|
|
1118
|
+
)
|
|
1115
1119
|
}
|
|
1116
1120
|
};
|
|
1117
1121
|
case import_shared5.CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR:
|
|
@@ -1750,69 +1754,1030 @@ var CopilotErrorBoundary = class extends import_react9.default.Component {
|
|
|
1750
1754
|
}
|
|
1751
1755
|
};
|
|
1752
1756
|
|
|
1753
|
-
// src/components/
|
|
1757
|
+
// src/components/dev-console/console-trigger.tsx
|
|
1758
|
+
var import_react11 = require("react");
|
|
1759
|
+
|
|
1760
|
+
// src/components/dev-console/icons.tsx
|
|
1754
1761
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1762
|
+
var ExclamationMarkTriangleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1763
|
+
"svg",
|
|
1764
|
+
{
|
|
1765
|
+
width: "13.3967723px",
|
|
1766
|
+
height: "12px",
|
|
1767
|
+
viewBox: "0 0 13.3967723 12",
|
|
1768
|
+
version: "1.1",
|
|
1769
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1770
|
+
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)(
|
|
1771
|
+
"path",
|
|
1772
|
+
{
|
|
1773
|
+
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",
|
|
1774
|
+
id: "Shape"
|
|
1775
|
+
}
|
|
1776
|
+
) }) })
|
|
1777
|
+
}
|
|
1778
|
+
);
|
|
1779
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1780
|
+
"svg",
|
|
1781
|
+
{
|
|
1782
|
+
width: "14px",
|
|
1783
|
+
height: "14px",
|
|
1784
|
+
viewBox: "0 0 14 14",
|
|
1785
|
+
version: "1.1",
|
|
1786
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1787
|
+
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)(
|
|
1788
|
+
"path",
|
|
1789
|
+
{
|
|
1790
|
+
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",
|
|
1791
|
+
id: "Shape"
|
|
1792
|
+
}
|
|
1793
|
+
) }) }) })
|
|
1794
|
+
}
|
|
1795
|
+
);
|
|
1796
|
+
var CopilotKitIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1797
|
+
"svg",
|
|
1798
|
+
{
|
|
1799
|
+
width: "33px",
|
|
1800
|
+
height: "35px",
|
|
1801
|
+
viewBox: "0 0 33 35",
|
|
1802
|
+
version: "1.1",
|
|
1803
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1804
|
+
children: [
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
1806
|
+
/* @__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)(
|
|
1807
|
+
"image",
|
|
1808
|
+
{
|
|
1809
|
+
x: "0",
|
|
1810
|
+
y: "0",
|
|
1811
|
+
width: "33",
|
|
1812
|
+
height: "35",
|
|
1813
|
+
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAjaADAAQAAAABAAAAlwAAAACI8Oz3AABAAElEQVR4Ae2dCYAlVXnvv6q79d7TMz37sIMgKKBCkLhkSKK4xJUMQVzAqJBgNDGJa2LsvJfERI0aiEbwRXnoQ2VYRASiQUFRUGQm7DAwzDBbT+/rvbfvXu/3P1V1+84CzEw3MNPD6a579nOqzvev73znO0t59rzZbQu88sXndp2w4gVLp5oG+6+47ivDu010kAb6B+lzP+Vjr1zZk0xV/ddMVIufap/34g+e+s9rX9351U1dT5npIIpMHkTPusePmto+tKhctVWPDW1/c27hIVNbCsFbCpa7/aR/f/SWFV2ZX974zsNG97iwOZjwedDshqiZlL3AD9JH9Y8PpTYMPJEuLj7+pclE5vBquXZ6MV/56Zu/ueGnmWpqzer3HzKym+xzPsib80+4lw/Y09Pjr7lm9GO+eR+eKI4tXdeRsomXv8a6Dj3eqn6iRoPl5qW83o60vyaT9O5IWPX2llrH+hsuXJbfy6oO2OTPg2Yn0p1/6ueWFK1wWTKReo1XDZoeqw7YxhcfYfNf9NtWSHTYVLVqxSAIqoFlU76NzEt6mzqSCQBkt3up1NrlHUdsXX22V92p2DnlfR40O5Az8N57+pfPgcv8YzLZdHjKS3i9uS1254Kitf3271qq81ATGkq1wPJCDVexEtS8oFZKpBLZeWl/w7yE98uUZ3cnLPhNefSFmx7s8Uo7VDE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jufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg=="
|
|
1814
|
+
}
|
|
1815
|
+
) })
|
|
1816
|
+
]
|
|
1817
|
+
}
|
|
1818
|
+
);
|
|
1819
|
+
|
|
1820
|
+
// src/components/dev-console/developer-console-modal.tsx
|
|
1821
|
+
var import_shared11 = require("@copilotkit/shared");
|
|
1822
|
+
var import_react10 = require("react");
|
|
1823
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1824
|
+
function DeveloperConsoleModal({ isOpen, onClose, hasApiKey }) {
|
|
1825
|
+
const context = useCopilotContext();
|
|
1826
|
+
const messagesContext = useCopilotMessagesContext();
|
|
1827
|
+
const [activeTab, setActiveTab] = (0, import_react10.useState)("actions");
|
|
1828
|
+
(0, import_react10.useEffect)(() => {
|
|
1829
|
+
const handleEscape = (e) => {
|
|
1830
|
+
if (e.key === "Escape") {
|
|
1831
|
+
onClose();
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
if (isOpen) {
|
|
1835
|
+
document.addEventListener("keydown", handleEscape);
|
|
1836
|
+
document.body.style.overflow = "hidden";
|
|
1837
|
+
}
|
|
1838
|
+
return () => {
|
|
1839
|
+
document.removeEventListener("keydown", handleEscape);
|
|
1840
|
+
document.body.style.overflow = "unset";
|
|
1841
|
+
};
|
|
1842
|
+
}, [isOpen, onClose]);
|
|
1843
|
+
if (!isOpen)
|
|
1844
|
+
return null;
|
|
1845
|
+
const displayContext = hasApiKey ? context : {
|
|
1846
|
+
actions: {
|
|
1847
|
+
search_web: { name: "search_web", description: "Search the web for information" },
|
|
1848
|
+
send_email: { name: "send_email", description: "Send an email to a contact" },
|
|
1849
|
+
create_document: { name: "create_document", description: "Create a new document" },
|
|
1850
|
+
analyze_code: {
|
|
1851
|
+
name: "analyze_code",
|
|
1852
|
+
description: "Analyze code for issues and improvements"
|
|
1853
|
+
},
|
|
1854
|
+
generate_tests: {
|
|
1855
|
+
name: "generate_tests",
|
|
1856
|
+
description: "Generate unit tests for functions"
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
getAllContext: () => [
|
|
1860
|
+
{
|
|
1861
|
+
content: "User preferences: dark mode enabled, TypeScript preferred",
|
|
1862
|
+
metadata: { source: "settings" }
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
content: "Current project: Building a React application with CopilotKit",
|
|
1866
|
+
metadata: { source: "project" }
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
content: "Recent activity: Implemented authentication system",
|
|
1870
|
+
metadata: { source: "activity" }
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
content: "Development environment: VS Code, Node.js 18, React 18",
|
|
1874
|
+
metadata: { source: "environment" }
|
|
1875
|
+
}
|
|
1876
|
+
],
|
|
1877
|
+
coagentStates: {
|
|
1878
|
+
"main-agent": { status: "active", lastUpdate: Date.now() },
|
|
1879
|
+
"code-assistant": { status: "active", lastUpdate: Date.now() - 15e3 },
|
|
1880
|
+
"search-agent": { status: "idle", lastUpdate: Date.now() - 6e4 }
|
|
1881
|
+
},
|
|
1882
|
+
getDocumentsContext: () => [
|
|
1883
|
+
{
|
|
1884
|
+
content: "README.md: Project setup and installation instructions",
|
|
1885
|
+
metadata: { type: "documentation" }
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
content: "API Documentation: CopilotKit integration guide",
|
|
1889
|
+
metadata: { type: "documentation" }
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
content: "package.json: Project dependencies and scripts",
|
|
1893
|
+
metadata: { type: "configuration" }
|
|
1894
|
+
}
|
|
1895
|
+
]
|
|
1896
|
+
};
|
|
1897
|
+
const displayMessagesContext = hasApiKey ? messagesContext : {
|
|
1898
|
+
messages: [
|
|
1899
|
+
{
|
|
1900
|
+
id: "1",
|
|
1901
|
+
role: "user",
|
|
1902
|
+
content: "Help me implement a todo list with drag and drop functionality"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
id: "2",
|
|
1906
|
+
role: "assistant",
|
|
1907
|
+
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."
|
|
1908
|
+
},
|
|
1909
|
+
{ id: "3", role: "user", content: "Can you also add priority levels and due dates?" },
|
|
1910
|
+
{
|
|
1911
|
+
id: "4",
|
|
1912
|
+
role: "assistant",
|
|
1913
|
+
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."
|
|
1914
|
+
},
|
|
1915
|
+
{ id: "5", role: "user", content: "Perfect! How about adding categories or tags?" }
|
|
1916
|
+
]
|
|
1917
|
+
};
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1919
|
+
"div",
|
|
1920
|
+
{
|
|
1921
|
+
style: {
|
|
1922
|
+
position: "fixed",
|
|
1923
|
+
top: 0,
|
|
1924
|
+
left: 0,
|
|
1925
|
+
right: 0,
|
|
1926
|
+
bottom: 0,
|
|
1927
|
+
zIndex: 9999,
|
|
1928
|
+
backgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
1929
|
+
display: "flex",
|
|
1930
|
+
alignItems: "center",
|
|
1931
|
+
justifyContent: "center",
|
|
1932
|
+
padding: "16px"
|
|
1933
|
+
},
|
|
1934
|
+
onClick: onClose,
|
|
1935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1936
|
+
"div",
|
|
1937
|
+
{
|
|
1938
|
+
style: {
|
|
1939
|
+
width: "1152px",
|
|
1940
|
+
maxWidth: "95vw",
|
|
1941
|
+
height: "80vh",
|
|
1942
|
+
backgroundColor: "white",
|
|
1943
|
+
borderRadius: "12px",
|
|
1944
|
+
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
1945
|
+
display: "flex",
|
|
1946
|
+
flexDirection: "column",
|
|
1947
|
+
overflow: "hidden",
|
|
1948
|
+
position: "relative"
|
|
1949
|
+
},
|
|
1950
|
+
onClick: (e) => e.stopPropagation(),
|
|
1951
|
+
children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1953
|
+
"div",
|
|
1954
|
+
{
|
|
1955
|
+
style: {
|
|
1956
|
+
display: "flex",
|
|
1957
|
+
alignItems: "center",
|
|
1958
|
+
justifyContent: "space-between",
|
|
1959
|
+
padding: "24px",
|
|
1960
|
+
borderBottom: "1px solid #e5e7eb",
|
|
1961
|
+
minHeight: "73px",
|
|
1962
|
+
flexShrink: 0,
|
|
1963
|
+
filter: !hasApiKey ? "blur(0.3px)" : "none",
|
|
1964
|
+
opacity: !hasApiKey ? 0.95 : 1
|
|
1965
|
+
},
|
|
1966
|
+
children: [
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotKitIcon, {}),
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1970
|
+
"h1",
|
|
1971
|
+
{
|
|
1972
|
+
style: {
|
|
1973
|
+
fontWeight: "bold",
|
|
1974
|
+
fontSize: "20px",
|
|
1975
|
+
color: "#1f2937",
|
|
1976
|
+
margin: 0
|
|
1977
|
+
},
|
|
1978
|
+
children: "Developer Console"
|
|
1979
|
+
}
|
|
1980
|
+
),
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1982
|
+
"span",
|
|
1983
|
+
{
|
|
1984
|
+
style: {
|
|
1985
|
+
fontSize: "14px",
|
|
1986
|
+
color: "#6b7280",
|
|
1987
|
+
backgroundColor: "#f3f4f6",
|
|
1988
|
+
padding: "4px 8px",
|
|
1989
|
+
borderRadius: "4px"
|
|
1990
|
+
},
|
|
1991
|
+
children: [
|
|
1992
|
+
"v",
|
|
1993
|
+
import_shared11.COPILOTKIT_VERSION
|
|
1994
|
+
]
|
|
1995
|
+
}
|
|
1996
|
+
)
|
|
1997
|
+
] }),
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1999
|
+
"button",
|
|
2000
|
+
{
|
|
2001
|
+
onClick: onClose,
|
|
2002
|
+
style: {
|
|
2003
|
+
color: "#9ca3af",
|
|
2004
|
+
fontSize: "24px",
|
|
2005
|
+
fontWeight: "300",
|
|
2006
|
+
border: "none",
|
|
2007
|
+
background: "none",
|
|
2008
|
+
cursor: "pointer",
|
|
2009
|
+
padding: "4px"
|
|
2010
|
+
},
|
|
2011
|
+
onMouseEnter: (e) => e.currentTarget.style.color = "#4b5563",
|
|
2012
|
+
onMouseLeave: (e) => e.currentTarget.style.color = "#9ca3af",
|
|
2013
|
+
children: "\xD7"
|
|
2014
|
+
}
|
|
2015
|
+
)
|
|
2016
|
+
]
|
|
2017
|
+
}
|
|
2018
|
+
),
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2020
|
+
"div",
|
|
2021
|
+
{
|
|
2022
|
+
style: {
|
|
2023
|
+
display: "flex",
|
|
2024
|
+
borderBottom: "1px solid #e5e7eb",
|
|
2025
|
+
backgroundColor: "#f9fafb",
|
|
2026
|
+
minHeight: "50px",
|
|
2027
|
+
flexShrink: 0,
|
|
2028
|
+
filter: !hasApiKey ? "blur(0.3px)" : "none",
|
|
2029
|
+
opacity: !hasApiKey ? 0.9 : 1
|
|
2030
|
+
},
|
|
2031
|
+
children: [
|
|
2032
|
+
{ id: "actions", label: "Actions", count: Object.keys(displayContext.actions).length },
|
|
2033
|
+
{ id: "readables", label: "Readables", count: displayContext.getAllContext().length },
|
|
2034
|
+
{
|
|
2035
|
+
id: "agent",
|
|
2036
|
+
label: "Agent Status",
|
|
2037
|
+
count: Object.keys(displayContext.coagentStates).length
|
|
2038
|
+
},
|
|
2039
|
+
{ id: "messages", label: "Messages", count: displayMessagesContext.messages.length },
|
|
2040
|
+
{
|
|
2041
|
+
id: "context",
|
|
2042
|
+
label: "Context",
|
|
2043
|
+
count: displayContext.getDocumentsContext([]).length
|
|
2044
|
+
}
|
|
2045
|
+
].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2046
|
+
"button",
|
|
2047
|
+
{
|
|
2048
|
+
onClick: () => setActiveTab(tab.id),
|
|
2049
|
+
style: {
|
|
2050
|
+
padding: "12px 24px",
|
|
2051
|
+
fontSize: "14px",
|
|
2052
|
+
fontWeight: "500",
|
|
2053
|
+
border: "none",
|
|
2054
|
+
cursor: "pointer",
|
|
2055
|
+
backgroundColor: activeTab === tab.id ? "white" : "transparent",
|
|
2056
|
+
color: activeTab === tab.id ? "#2563eb" : "#6b7280",
|
|
2057
|
+
borderBottom: activeTab === tab.id ? "2px solid #2563eb" : "none",
|
|
2058
|
+
transition: "all 0.2s"
|
|
2059
|
+
},
|
|
2060
|
+
onMouseEnter: (e) => {
|
|
2061
|
+
if (activeTab !== tab.id) {
|
|
2062
|
+
e.currentTarget.style.color = "#1f2937";
|
|
2063
|
+
e.currentTarget.style.backgroundColor = "#f3f4f6";
|
|
2064
|
+
}
|
|
2065
|
+
},
|
|
2066
|
+
onMouseLeave: (e) => {
|
|
2067
|
+
if (activeTab !== tab.id) {
|
|
2068
|
+
e.currentTarget.style.color = "#6b7280";
|
|
2069
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
children: [
|
|
2073
|
+
tab.label,
|
|
2074
|
+
tab.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2075
|
+
"span",
|
|
2076
|
+
{
|
|
2077
|
+
style: {
|
|
2078
|
+
marginLeft: "8px",
|
|
2079
|
+
backgroundColor: "#e5e7eb",
|
|
2080
|
+
color: "#374151",
|
|
2081
|
+
padding: "2px 8px",
|
|
2082
|
+
borderRadius: "9999px",
|
|
2083
|
+
fontSize: "12px"
|
|
2084
|
+
},
|
|
2085
|
+
children: tab.count
|
|
2086
|
+
}
|
|
2087
|
+
)
|
|
2088
|
+
]
|
|
2089
|
+
},
|
|
2090
|
+
tab.id
|
|
2091
|
+
))
|
|
2092
|
+
}
|
|
2093
|
+
),
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2095
|
+
"div",
|
|
2096
|
+
{
|
|
2097
|
+
style: {
|
|
2098
|
+
height: "calc(100% - 142px)",
|
|
2099
|
+
overflow: "auto",
|
|
2100
|
+
padding: "24px",
|
|
2101
|
+
backgroundColor: "#f9fafb",
|
|
2102
|
+
filter: !hasApiKey ? "blur(0.3px)" : "none",
|
|
2103
|
+
opacity: !hasApiKey ? 0.85 : 1
|
|
2104
|
+
},
|
|
2105
|
+
children: [
|
|
2106
|
+
activeTab === "actions" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ActionsTab, { context: displayContext }),
|
|
2107
|
+
activeTab === "readables" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ReadablesTab, { context: displayContext }),
|
|
2108
|
+
activeTab === "agent" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AgentStatusTab, { context: displayContext }),
|
|
2109
|
+
activeTab === "messages" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MessagesTab, { messagesContext: displayMessagesContext }),
|
|
2110
|
+
activeTab === "context" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ContextTab, { context: displayContext })
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
),
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2115
|
+
"div",
|
|
2116
|
+
{
|
|
2117
|
+
style: {
|
|
2118
|
+
padding: "16px 24px",
|
|
2119
|
+
borderTop: "1px solid #e5e7eb",
|
|
2120
|
+
backgroundColor: "white",
|
|
2121
|
+
display: "flex",
|
|
2122
|
+
justifyContent: "space-between",
|
|
2123
|
+
alignItems: "center",
|
|
2124
|
+
minHeight: "57px",
|
|
2125
|
+
flexShrink: 0,
|
|
2126
|
+
filter: !hasApiKey ? "blur(0.3px)" : "none",
|
|
2127
|
+
opacity: !hasApiKey ? 0.9 : 1
|
|
2128
|
+
},
|
|
2129
|
+
children: [
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2131
|
+
"a",
|
|
2132
|
+
{
|
|
2133
|
+
href: "https://github.com/CopilotKit/CopilotKit/issues",
|
|
2134
|
+
target: "_blank",
|
|
2135
|
+
rel: "noopener noreferrer",
|
|
2136
|
+
style: { color: "#2563eb", textDecoration: "none" },
|
|
2137
|
+
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
2138
|
+
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
2139
|
+
children: "Report an issue"
|
|
2140
|
+
}
|
|
2141
|
+
) }),
|
|
2142
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2143
|
+
"a",
|
|
2144
|
+
{
|
|
2145
|
+
href: "https://mcp.copilotkit.ai/",
|
|
2146
|
+
target: "_blank",
|
|
2147
|
+
rel: "noopener noreferrer",
|
|
2148
|
+
style: { color: "#2563eb", textDecoration: "none" },
|
|
2149
|
+
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
2150
|
+
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
2151
|
+
children: "Add MCP Server \u2192"
|
|
2152
|
+
}
|
|
2153
|
+
) })
|
|
2154
|
+
]
|
|
2155
|
+
}
|
|
2156
|
+
),
|
|
2157
|
+
!hasApiKey && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2158
|
+
"div",
|
|
2159
|
+
{
|
|
2160
|
+
style: {
|
|
2161
|
+
position: "absolute",
|
|
2162
|
+
top: 0,
|
|
2163
|
+
left: 0,
|
|
2164
|
+
right: 0,
|
|
2165
|
+
bottom: 0,
|
|
2166
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
2167
|
+
backdropFilter: "blur(2px)",
|
|
2168
|
+
WebkitBackdropFilter: "blur(2px)",
|
|
2169
|
+
display: "flex",
|
|
2170
|
+
alignItems: "center",
|
|
2171
|
+
justifyContent: "center",
|
|
2172
|
+
borderRadius: "12px",
|
|
2173
|
+
zIndex: 10
|
|
2174
|
+
},
|
|
2175
|
+
onClick: (e) => e.stopPropagation(),
|
|
2176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2177
|
+
"button",
|
|
2178
|
+
{
|
|
2179
|
+
onClick: () => window.open("https://cloud.copilotkit.ai/sign-in", "_blank"),
|
|
2180
|
+
style: {
|
|
2181
|
+
// Following button system specifications
|
|
2182
|
+
height: "48px",
|
|
2183
|
+
padding: "12px 24px",
|
|
2184
|
+
backgroundColor: "#030507",
|
|
2185
|
+
// textPrimary token
|
|
2186
|
+
color: "#FFFFFF",
|
|
2187
|
+
borderRadius: "12px",
|
|
2188
|
+
// Medium radius token
|
|
2189
|
+
border: "none",
|
|
2190
|
+
cursor: "pointer",
|
|
2191
|
+
fontSize: "14px",
|
|
2192
|
+
// Medium Semi Bold typography
|
|
2193
|
+
fontWeight: "600",
|
|
2194
|
+
fontFamily: "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
2195
|
+
lineHeight: "22px",
|
|
2196
|
+
boxShadow: "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)",
|
|
2197
|
+
transition: "all 200ms ease",
|
|
2198
|
+
// 200ms ease as per specs
|
|
2199
|
+
display: "inline-flex",
|
|
2200
|
+
alignItems: "center",
|
|
2201
|
+
gap: "8px",
|
|
2202
|
+
textTransform: "uppercase",
|
|
2203
|
+
letterSpacing: "0.5px"
|
|
2204
|
+
},
|
|
2205
|
+
onMouseEnter: (e) => {
|
|
2206
|
+
e.currentTarget.style.backgroundColor = "#575758";
|
|
2207
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
2208
|
+
e.currentTarget.style.boxShadow = "0 6px 20px rgba(3, 5, 7, 0.25), 0 2px 4px rgba(3, 5, 7, 0.15)";
|
|
2209
|
+
},
|
|
2210
|
+
onMouseLeave: (e) => {
|
|
2211
|
+
e.currentTarget.style.backgroundColor = "#030507";
|
|
2212
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
2213
|
+
e.currentTarget.style.boxShadow = "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)";
|
|
2214
|
+
},
|
|
2215
|
+
onMouseDown: (e) => {
|
|
2216
|
+
e.currentTarget.style.backgroundColor = "#858589";
|
|
2217
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
2218
|
+
},
|
|
2219
|
+
onMouseUp: (e) => {
|
|
2220
|
+
e.currentTarget.style.backgroundColor = "#575758";
|
|
2221
|
+
e.currentTarget.style.transform = "translateY(-1px)";
|
|
2222
|
+
},
|
|
2223
|
+
onFocus: (e) => {
|
|
2224
|
+
e.currentTarget.style.outline = "2px solid #BEC9FF";
|
|
2225
|
+
e.currentTarget.style.outlineOffset = "2px";
|
|
2226
|
+
},
|
|
2227
|
+
onBlur: (e) => {
|
|
2228
|
+
e.currentTarget.style.outline = "none";
|
|
2229
|
+
},
|
|
2230
|
+
children: [
|
|
2231
|
+
"Get API Key",
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: "16px", marginLeft: "-4px" }, children: "\u2192" })
|
|
2233
|
+
]
|
|
2234
|
+
}
|
|
2235
|
+
)
|
|
2236
|
+
}
|
|
2237
|
+
)
|
|
2238
|
+
]
|
|
2239
|
+
}
|
|
2240
|
+
)
|
|
2241
|
+
}
|
|
2242
|
+
);
|
|
2243
|
+
}
|
|
2244
|
+
function ActionsTab({ context }) {
|
|
2245
|
+
const actions = Object.values(context.actions);
|
|
2246
|
+
if (actions.length === 0) {
|
|
2247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No actions available" }),
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Actions will appear here when registered" })
|
|
2250
|
+
] });
|
|
2251
|
+
}
|
|
2252
|
+
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)(
|
|
2253
|
+
"div",
|
|
2254
|
+
{
|
|
2255
|
+
style: {
|
|
2256
|
+
backgroundColor: "white",
|
|
2257
|
+
padding: "16px",
|
|
2258
|
+
borderRadius: "8px",
|
|
2259
|
+
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
|
|
2260
|
+
border: "1px solid #e5e7eb"
|
|
2261
|
+
},
|
|
2262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2263
|
+
"div",
|
|
2264
|
+
{
|
|
2265
|
+
style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
|
|
2266
|
+
children: [
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1 }, children: [
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: action.name }),
|
|
2269
|
+
action.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: action.description }),
|
|
2270
|
+
action.parameters && action.parameters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginTop: "12px" }, children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2272
|
+
"p",
|
|
2273
|
+
{
|
|
2274
|
+
style: {
|
|
2275
|
+
fontSize: "12px",
|
|
2276
|
+
fontWeight: "500",
|
|
2277
|
+
color: "#6b7280",
|
|
2278
|
+
textTransform: "uppercase",
|
|
2279
|
+
margin: "0 0 4px 0"
|
|
2280
|
+
},
|
|
2281
|
+
children: "Parameters:"
|
|
2282
|
+
}
|
|
2283
|
+
),
|
|
2284
|
+
/* @__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: [
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontFamily: "monospace", color: "#374151" }, children: param.name }),
|
|
2286
|
+
param.required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { marginLeft: "4px", fontSize: "12px", color: "#ef4444" }, children: "*required" }),
|
|
2287
|
+
param.type && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { style: { marginLeft: "8px", fontSize: "12px", color: "#6b7280" }, children: [
|
|
2288
|
+
"(",
|
|
2289
|
+
param.type,
|
|
2290
|
+
")"
|
|
2291
|
+
] })
|
|
2292
|
+
] }, pIndex)) })
|
|
2293
|
+
] })
|
|
2294
|
+
] }),
|
|
2295
|
+
/* @__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, {}) })
|
|
2296
|
+
]
|
|
2297
|
+
}
|
|
2298
|
+
)
|
|
2299
|
+
},
|
|
2300
|
+
index
|
|
2301
|
+
)) });
|
|
2302
|
+
}
|
|
2303
|
+
function ReadablesTab({ context }) {
|
|
2304
|
+
const readables = context.getAllContext();
|
|
2305
|
+
if (readables.length === 0) {
|
|
2306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No readable context available" }),
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Readable context will appear here when provided" })
|
|
2309
|
+
] });
|
|
2310
|
+
}
|
|
2311
|
+
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)(
|
|
2312
|
+
"div",
|
|
2313
|
+
{
|
|
2314
|
+
style: {
|
|
2315
|
+
backgroundColor: "white",
|
|
2316
|
+
padding: "16px",
|
|
2317
|
+
borderRadius: "8px",
|
|
2318
|
+
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
|
|
2319
|
+
border: "1px solid #e5e7eb"
|
|
2320
|
+
},
|
|
2321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2322
|
+
"div",
|
|
2323
|
+
{
|
|
2324
|
+
style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
|
|
2325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1 }, children: [
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: readable.name || `Readable ${index + 1}` }),
|
|
2327
|
+
readable.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: readable.description }),
|
|
2328
|
+
readable.value && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2329
|
+
"pre",
|
|
2330
|
+
{
|
|
2331
|
+
style: {
|
|
2332
|
+
marginTop: "12px",
|
|
2333
|
+
padding: "8px",
|
|
2334
|
+
backgroundColor: "#f9fafb",
|
|
2335
|
+
borderRadius: "4px",
|
|
2336
|
+
fontSize: "12px",
|
|
2337
|
+
overflowX: "auto",
|
|
2338
|
+
margin: "12px 0 0 0"
|
|
2339
|
+
},
|
|
2340
|
+
children: JSON.stringify(readable.value, null, 2)
|
|
2341
|
+
}
|
|
2342
|
+
)
|
|
2343
|
+
] })
|
|
2344
|
+
}
|
|
2345
|
+
)
|
|
2346
|
+
},
|
|
2347
|
+
index
|
|
2348
|
+
)) });
|
|
2349
|
+
}
|
|
2350
|
+
function AgentStatusTab({ context }) {
|
|
2351
|
+
const agentStates = context.coagentStates || {};
|
|
2352
|
+
const agentStateEntries = Object.entries(agentStates);
|
|
2353
|
+
if (agentStateEntries.length === 0) {
|
|
2354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No agent states available" }),
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Agent states will appear here when agents are active" })
|
|
2357
|
+
] });
|
|
2358
|
+
}
|
|
2359
|
+
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)(
|
|
2360
|
+
"div",
|
|
2361
|
+
{
|
|
2362
|
+
style: {
|
|
2363
|
+
backgroundColor: "white",
|
|
2364
|
+
padding: "24px",
|
|
2365
|
+
borderRadius: "8px",
|
|
2366
|
+
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
|
|
2367
|
+
border: "1px solid #e5e7eb"
|
|
2368
|
+
},
|
|
2369
|
+
children: [
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2371
|
+
"div",
|
|
2372
|
+
{
|
|
2373
|
+
style: {
|
|
2374
|
+
display: "flex",
|
|
2375
|
+
alignItems: "center",
|
|
2376
|
+
justifyContent: "space-between",
|
|
2377
|
+
marginBottom: "16px"
|
|
2378
|
+
},
|
|
2379
|
+
children: [
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", fontSize: "18px", color: "#1f2937", margin: 0 }, children: agentName }),
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2382
|
+
"span",
|
|
2383
|
+
{
|
|
2384
|
+
style: {
|
|
2385
|
+
padding: "4px 12px",
|
|
2386
|
+
borderRadius: "9999px",
|
|
2387
|
+
fontSize: "12px",
|
|
2388
|
+
fontWeight: "500",
|
|
2389
|
+
backgroundColor: state.status === "running" ? "#dcfce7" : state.status === "complete" ? "#dbeafe" : "#f3f4f6",
|
|
2390
|
+
color: state.status === "running" ? "#166534" : state.status === "complete" ? "#1e40af" : "#1f2937"
|
|
2391
|
+
},
|
|
2392
|
+
children: state.status || "idle"
|
|
2393
|
+
}
|
|
2394
|
+
)
|
|
2395
|
+
]
|
|
2396
|
+
}
|
|
2397
|
+
),
|
|
2398
|
+
state.state && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginBottom: "12px" }, children: [
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2400
|
+
"p",
|
|
2401
|
+
{
|
|
2402
|
+
style: {
|
|
2403
|
+
fontSize: "12px",
|
|
2404
|
+
fontWeight: "500",
|
|
2405
|
+
color: "#6b7280",
|
|
2406
|
+
textTransform: "uppercase",
|
|
2407
|
+
margin: "0 0 4px 0"
|
|
2408
|
+
},
|
|
2409
|
+
children: "Current State:"
|
|
2410
|
+
}
|
|
2411
|
+
),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2413
|
+
"pre",
|
|
2414
|
+
{
|
|
2415
|
+
style: {
|
|
2416
|
+
padding: "12px",
|
|
2417
|
+
backgroundColor: "#f9fafb",
|
|
2418
|
+
borderRadius: "4px",
|
|
2419
|
+
fontSize: "12px",
|
|
2420
|
+
overflowX: "auto",
|
|
2421
|
+
margin: 0
|
|
2422
|
+
},
|
|
2423
|
+
children: JSON.stringify(state.state, null, 2)
|
|
2424
|
+
}
|
|
2425
|
+
)
|
|
2426
|
+
] }),
|
|
2427
|
+
state.running && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2428
|
+
"div",
|
|
2429
|
+
{
|
|
2430
|
+
style: {
|
|
2431
|
+
marginTop: "16px",
|
|
2432
|
+
display: "flex",
|
|
2433
|
+
alignItems: "center",
|
|
2434
|
+
fontSize: "14px",
|
|
2435
|
+
color: "#4b5563"
|
|
2436
|
+
},
|
|
2437
|
+
children: [
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2439
|
+
"svg",
|
|
2440
|
+
{
|
|
2441
|
+
width: "16",
|
|
2442
|
+
height: "16",
|
|
2443
|
+
viewBox: "0 0 16 16",
|
|
2444
|
+
style: { animation: "spin 1s linear infinite" },
|
|
2445
|
+
children: [
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("style", { children: `@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` }),
|
|
2447
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2448
|
+
"circle",
|
|
2449
|
+
{
|
|
2450
|
+
cx: "8",
|
|
2451
|
+
cy: "8",
|
|
2452
|
+
r: "6",
|
|
2453
|
+
fill: "none",
|
|
2454
|
+
stroke: "#4b5563",
|
|
2455
|
+
strokeWidth: "2",
|
|
2456
|
+
strokeDasharray: "9 3"
|
|
2457
|
+
}
|
|
2458
|
+
)
|
|
2459
|
+
]
|
|
2460
|
+
}
|
|
2461
|
+
) }),
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Agent is currently running..." })
|
|
2463
|
+
]
|
|
2464
|
+
}
|
|
2465
|
+
)
|
|
2466
|
+
]
|
|
2467
|
+
},
|
|
2468
|
+
agentName
|
|
2469
|
+
)) });
|
|
2470
|
+
}
|
|
2471
|
+
function MessagesTab({ messagesContext }) {
|
|
2472
|
+
const messages = messagesContext.messages || [];
|
|
2473
|
+
if (messages.length === 0) {
|
|
2474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No messages yet" }),
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Messages will appear here as the conversation progresses" })
|
|
2477
|
+
] });
|
|
2478
|
+
}
|
|
2479
|
+
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)(
|
|
2480
|
+
"div",
|
|
2481
|
+
{
|
|
2482
|
+
style: {
|
|
2483
|
+
padding: "16px",
|
|
2484
|
+
borderRadius: "8px",
|
|
2485
|
+
backgroundColor: message.role === "user" ? "#eff6ff" : message.role === "assistant" ? "#f9fafb" : "#fefce8",
|
|
2486
|
+
border: `1px solid ${message.role === "user" ? "#c7d2fe" : message.role === "assistant" ? "#e5e7eb" : "#fde047"}`,
|
|
2487
|
+
marginLeft: message.role === "user" ? "48px" : "0",
|
|
2488
|
+
marginRight: message.role === "assistant" ? "48px" : "0"
|
|
2489
|
+
},
|
|
2490
|
+
children: [
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2492
|
+
"div",
|
|
2493
|
+
{
|
|
2494
|
+
style: {
|
|
2495
|
+
display: "flex",
|
|
2496
|
+
alignItems: "flex-start",
|
|
2497
|
+
justifyContent: "space-between",
|
|
2498
|
+
marginBottom: "8px"
|
|
2499
|
+
},
|
|
2500
|
+
children: [
|
|
2501
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2502
|
+
"span",
|
|
2503
|
+
{
|
|
2504
|
+
style: {
|
|
2505
|
+
fontWeight: "500",
|
|
2506
|
+
fontSize: "14px",
|
|
2507
|
+
color: "#374151",
|
|
2508
|
+
textTransform: "capitalize"
|
|
2509
|
+
},
|
|
2510
|
+
children: message.role || "system"
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
message.timestamp && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: "12px", color: "#6b7280" }, children: new Date(message.timestamp).toLocaleTimeString() })
|
|
2514
|
+
]
|
|
2515
|
+
}
|
|
2516
|
+
),
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: "14px", color: "#1f2937", whiteSpace: "pre-wrap" }, children: message.content || "" })
|
|
2518
|
+
]
|
|
2519
|
+
},
|
|
2520
|
+
index
|
|
2521
|
+
)) });
|
|
2522
|
+
}
|
|
2523
|
+
function ContextTab({ context }) {
|
|
2524
|
+
const documents = context.getDocumentsContext([]);
|
|
2525
|
+
if (documents.length === 0) {
|
|
2526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No document context available" }),
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { style: { fontSize: "14px", margin: 0 }, children: "Document context will appear here when provided" })
|
|
2529
|
+
] });
|
|
2530
|
+
}
|
|
2531
|
+
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)(
|
|
2532
|
+
"div",
|
|
2533
|
+
{
|
|
2534
|
+
style: {
|
|
2535
|
+
backgroundColor: "white",
|
|
2536
|
+
padding: "16px",
|
|
2537
|
+
borderRadius: "8px",
|
|
2538
|
+
boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
|
|
2539
|
+
border: "1px solid #e5e7eb"
|
|
2540
|
+
},
|
|
2541
|
+
children: [
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 8px 0" }, children: doc.name || `Document ${index + 1}` }),
|
|
2543
|
+
doc.content && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2544
|
+
"pre",
|
|
2545
|
+
{
|
|
2546
|
+
style: {
|
|
2547
|
+
padding: "12px",
|
|
2548
|
+
backgroundColor: "#f9fafb",
|
|
2549
|
+
borderRadius: "4px",
|
|
2550
|
+
fontSize: "12px",
|
|
2551
|
+
overflowX: "auto",
|
|
2552
|
+
margin: 0
|
|
2553
|
+
},
|
|
2554
|
+
children: doc.content
|
|
2555
|
+
}
|
|
2556
|
+
)
|
|
2557
|
+
]
|
|
2558
|
+
},
|
|
2559
|
+
index
|
|
2560
|
+
)) });
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
// src/components/dev-console/console-trigger.tsx
|
|
2564
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2565
|
+
function ConsoleTrigger({ position = "bottom-right" }) {
|
|
2566
|
+
const context = useCopilotContext();
|
|
2567
|
+
const hasApiKey = Boolean(context.copilotApiConfig.publicApiKey);
|
|
2568
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react11.useState)(false);
|
|
2569
|
+
const [isHovered, setIsHovered] = (0, import_react11.useState)(false);
|
|
2570
|
+
const [isDragging, setIsDragging] = (0, import_react11.useState)(false);
|
|
2571
|
+
const [buttonPosition, setButtonPosition] = (0, import_react11.useState)(null);
|
|
2572
|
+
const [mounted, setMounted] = (0, import_react11.useState)(false);
|
|
2573
|
+
const dragRef = (0, import_react11.useRef)(null);
|
|
2574
|
+
const buttonRef = (0, import_react11.useRef)(null);
|
|
2575
|
+
(0, import_react11.useEffect)(() => {
|
|
2576
|
+
setMounted(true);
|
|
2577
|
+
if (typeof window !== "undefined" && !buttonPosition) {
|
|
2578
|
+
const buttonSize = 60;
|
|
2579
|
+
const margin = 24;
|
|
2580
|
+
const initialPosition = {
|
|
2581
|
+
x: margin,
|
|
2582
|
+
y: window.innerHeight - buttonSize - margin
|
|
2583
|
+
};
|
|
2584
|
+
setButtonPosition(initialPosition);
|
|
2585
|
+
}
|
|
2586
|
+
}, [position]);
|
|
2587
|
+
const handleMouseDown = (e) => {
|
|
2588
|
+
e.preventDefault();
|
|
2589
|
+
if (!buttonPosition)
|
|
2590
|
+
return;
|
|
2591
|
+
dragRef.current = {
|
|
2592
|
+
startX: e.clientX,
|
|
2593
|
+
startY: e.clientY,
|
|
2594
|
+
buttonX: buttonPosition.x,
|
|
2595
|
+
buttonY: buttonPosition.y
|
|
2596
|
+
};
|
|
2597
|
+
setIsDragging(true);
|
|
2598
|
+
};
|
|
2599
|
+
(0, import_react11.useEffect)(() => {
|
|
2600
|
+
if (!isDragging)
|
|
2601
|
+
return;
|
|
2602
|
+
const handleMouseMove = (e) => {
|
|
2603
|
+
e.preventDefault();
|
|
2604
|
+
e.stopPropagation();
|
|
2605
|
+
if (!dragRef.current)
|
|
2606
|
+
return;
|
|
2607
|
+
const deltaX = e.clientX - dragRef.current.startX;
|
|
2608
|
+
const deltaY = e.clientY - dragRef.current.startY;
|
|
2609
|
+
let newX = dragRef.current.buttonX + deltaX;
|
|
2610
|
+
let newY = dragRef.current.buttonY + deltaY;
|
|
2611
|
+
newX = Math.max(0, Math.min(newX, window.innerWidth - 60));
|
|
2612
|
+
newY = Math.max(0, Math.min(newY, window.innerHeight - 60));
|
|
2613
|
+
setButtonPosition({ x: newX, y: newY });
|
|
2614
|
+
};
|
|
2615
|
+
const handleMouseUp = (e) => {
|
|
2616
|
+
e.preventDefault();
|
|
2617
|
+
e.stopPropagation();
|
|
2618
|
+
setIsDragging(false);
|
|
2619
|
+
dragRef.current = null;
|
|
2620
|
+
};
|
|
2621
|
+
document.addEventListener("mousemove", handleMouseMove, { capture: true, passive: false });
|
|
2622
|
+
document.addEventListener("mouseup", handleMouseUp, { capture: true, passive: false });
|
|
2623
|
+
return () => {
|
|
2624
|
+
document.removeEventListener("mousemove", handleMouseMove, { capture: true });
|
|
2625
|
+
document.removeEventListener("mouseup", handleMouseUp, { capture: true });
|
|
2626
|
+
};
|
|
2627
|
+
}, [isDragging]);
|
|
2628
|
+
if (!mounted || !buttonPosition) {
|
|
2629
|
+
return null;
|
|
2630
|
+
}
|
|
2631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2633
|
+
"button",
|
|
2634
|
+
{
|
|
2635
|
+
ref: buttonRef,
|
|
2636
|
+
onClick: () => {
|
|
2637
|
+
if (!isDragging) {
|
|
2638
|
+
setIsModalOpen(true);
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
onMouseDown: handleMouseDown,
|
|
2642
|
+
onMouseEnter: () => setIsHovered(true),
|
|
2643
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2644
|
+
style: {
|
|
2645
|
+
position: "fixed",
|
|
2646
|
+
left: `${buttonPosition.x}px`,
|
|
2647
|
+
top: `${buttonPosition.y}px`,
|
|
2648
|
+
zIndex: 2147483647,
|
|
2649
|
+
width: "60px",
|
|
2650
|
+
height: "60px",
|
|
2651
|
+
background: isDragging ? "#000000" : isHovered ? "#111111" : "#000000",
|
|
2652
|
+
color: "white",
|
|
2653
|
+
borderRadius: "50%",
|
|
2654
|
+
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)",
|
|
2655
|
+
transition: isDragging ? "none" : "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
2656
|
+
display: "flex",
|
|
2657
|
+
alignItems: "center",
|
|
2658
|
+
justifyContent: "center",
|
|
2659
|
+
border: "none",
|
|
2660
|
+
cursor: isDragging ? "grabbing" : "grab",
|
|
2661
|
+
opacity: 1,
|
|
2662
|
+
userSelect: "none",
|
|
2663
|
+
transform: isDragging ? "scale(1.05)" : isHovered ? "scale(1.1)" : "scale(1)",
|
|
2664
|
+
backdropFilter: "blur(10px)",
|
|
2665
|
+
pointerEvents: "auto",
|
|
2666
|
+
isolation: "isolate"
|
|
2667
|
+
},
|
|
2668
|
+
title: hasApiKey ? "Open Developer Console (Drag to move)" : "Developer Console (API Key Required, Drag to move)",
|
|
2669
|
+
children: [
|
|
2670
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2671
|
+
"div",
|
|
2672
|
+
{
|
|
2673
|
+
style: {
|
|
2674
|
+
width: "28px",
|
|
2675
|
+
height: "28px",
|
|
2676
|
+
display: "flex",
|
|
2677
|
+
alignItems: "center",
|
|
2678
|
+
justifyContent: "center",
|
|
2679
|
+
filter: "drop-shadow(0 2px 4px rgba(0,0,0,0.2))"
|
|
2680
|
+
},
|
|
2681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CopilotKitIcon, {})
|
|
2682
|
+
}
|
|
2683
|
+
),
|
|
2684
|
+
!hasApiKey && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2685
|
+
"div",
|
|
2686
|
+
{
|
|
2687
|
+
style: {
|
|
2688
|
+
position: "absolute",
|
|
2689
|
+
top: "-2px",
|
|
2690
|
+
right: "-2px",
|
|
2691
|
+
width: "18px",
|
|
2692
|
+
height: "18px",
|
|
2693
|
+
background: "linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%)",
|
|
2694
|
+
borderRadius: "50%",
|
|
2695
|
+
display: "flex",
|
|
2696
|
+
alignItems: "center",
|
|
2697
|
+
justifyContent: "center",
|
|
2698
|
+
boxShadow: "0 2px 8px rgba(255, 107, 107, 0.4)",
|
|
2699
|
+
border: "2px solid white"
|
|
2700
|
+
},
|
|
2701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: "10px", color: "white", fontWeight: "bold" }, children: "!" })
|
|
2702
|
+
}
|
|
2703
|
+
)
|
|
2704
|
+
]
|
|
2705
|
+
}
|
|
2706
|
+
),
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2708
|
+
DeveloperConsoleModal,
|
|
2709
|
+
{
|
|
2710
|
+
isOpen: isModalOpen,
|
|
2711
|
+
onClose: () => setIsModalOpen(false),
|
|
2712
|
+
hasApiKey
|
|
2713
|
+
}
|
|
2714
|
+
)
|
|
2715
|
+
] });
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
// src/components/copilot-provider/copilotkit.tsx
|
|
2719
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1755
2720
|
function CopilotKit(_a) {
|
|
1756
2721
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1757
2722
|
const enabled = shouldShowDevConsole(props.showDevConsole);
|
|
1758
|
-
|
|
2723
|
+
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
2724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) }) });
|
|
1759
2725
|
}
|
|
1760
2726
|
function CopilotKitInternal(cpkProps) {
|
|
1761
2727
|
const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
|
|
1762
2728
|
validateProps(cpkProps);
|
|
1763
|
-
const
|
|
1764
|
-
const
|
|
1765
|
-
const [
|
|
1766
|
-
const
|
|
2729
|
+
const publicApiKey = props.publicLicenseKey || props.publicApiKey;
|
|
2730
|
+
const chatApiEndpoint = props.runtimeUrl || import_shared12.COPILOT_CLOUD_CHAT_URL;
|
|
2731
|
+
const [actions, setActions] = (0, import_react12.useState)({});
|
|
2732
|
+
const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react12.useState)({});
|
|
2733
|
+
const chatComponentsCache = (0, import_react12.useRef)({
|
|
1767
2734
|
actions: {},
|
|
1768
2735
|
coAgentStateRenders: {}
|
|
1769
2736
|
});
|
|
1770
2737
|
const { addElement, removeElement, printTree, getAllElements } = use_tree_default();
|
|
1771
|
-
const [isLoading, setIsLoading] = (0,
|
|
1772
|
-
const [chatInstructions, setChatInstructions] = (0,
|
|
1773
|
-
const [authStates, setAuthStates] = (0,
|
|
1774
|
-
const [extensions, setExtensions] = (0,
|
|
1775
|
-
const [additionalInstructions, setAdditionalInstructions] = (0,
|
|
2738
|
+
const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
|
|
2739
|
+
const [chatInstructions, setChatInstructions] = (0, import_react12.useState)("");
|
|
2740
|
+
const [authStates, setAuthStates] = (0, import_react12.useState)({});
|
|
2741
|
+
const [extensions, setExtensions] = (0, import_react12.useState)({});
|
|
2742
|
+
const [additionalInstructions, setAdditionalInstructions] = (0, import_react12.useState)([]);
|
|
1776
2743
|
const {
|
|
1777
2744
|
addElement: addDocument,
|
|
1778
2745
|
removeElement: removeDocument,
|
|
1779
2746
|
allElements: allDocuments
|
|
1780
2747
|
} = use_flat_category_store_default();
|
|
1781
|
-
const
|
|
1782
|
-
const [usageBannerStatus, setUsageBannerStatus] = (0, import_react10.useState)(null);
|
|
1783
|
-
const setAction = (0, import_react10.useCallback)((id, action) => {
|
|
2748
|
+
const setAction = (0, import_react12.useCallback)((id, action) => {
|
|
1784
2749
|
setActions((prevPoints) => {
|
|
1785
2750
|
return __spreadProps(__spreadValues({}, prevPoints), {
|
|
1786
2751
|
[id]: action
|
|
1787
2752
|
});
|
|
1788
2753
|
});
|
|
1789
2754
|
}, []);
|
|
1790
|
-
const removeAction = (0,
|
|
2755
|
+
const removeAction = (0, import_react12.useCallback)((id) => {
|
|
1791
2756
|
setActions((prevPoints) => {
|
|
1792
2757
|
const newPoints = __spreadValues({}, prevPoints);
|
|
1793
2758
|
delete newPoints[id];
|
|
1794
2759
|
return newPoints;
|
|
1795
2760
|
});
|
|
1796
2761
|
}, []);
|
|
1797
|
-
const setCoAgentStateRender = (0,
|
|
2762
|
+
const setCoAgentStateRender = (0, import_react12.useCallback)((id, stateRender) => {
|
|
1798
2763
|
setCoAgentStateRenders((prevPoints) => {
|
|
1799
2764
|
return __spreadProps(__spreadValues({}, prevPoints), {
|
|
1800
2765
|
[id]: stateRender
|
|
1801
2766
|
});
|
|
1802
2767
|
});
|
|
1803
2768
|
}, []);
|
|
1804
|
-
const removeCoAgentStateRender = (0,
|
|
2769
|
+
const removeCoAgentStateRender = (0, import_react12.useCallback)((id) => {
|
|
1805
2770
|
setCoAgentStateRenders((prevPoints) => {
|
|
1806
2771
|
const newPoints = __spreadValues({}, prevPoints);
|
|
1807
2772
|
delete newPoints[id];
|
|
1808
2773
|
return newPoints;
|
|
1809
2774
|
});
|
|
1810
2775
|
}, []);
|
|
1811
|
-
const getContextString = (0,
|
|
2776
|
+
const getContextString = (0, import_react12.useCallback)(
|
|
1812
2777
|
(documents, categories) => {
|
|
1813
|
-
const documentsString = documents.map((
|
|
1814
|
-
return `${
|
|
1815
|
-
${
|
|
2778
|
+
const documentsString = documents.map((document2) => {
|
|
2779
|
+
return `${document2.name} (${document2.sourceApplication}):
|
|
2780
|
+
${document2.getContents()}`;
|
|
1816
2781
|
}).join("\n\n");
|
|
1817
2782
|
const nonDocumentStrings = printTree(categories);
|
|
1818
2783
|
return `${documentsString}
|
|
@@ -1821,49 +2786,49 @@ ${nonDocumentStrings}`;
|
|
|
1821
2786
|
},
|
|
1822
2787
|
[printTree]
|
|
1823
2788
|
);
|
|
1824
|
-
const addContext = (0,
|
|
2789
|
+
const addContext = (0, import_react12.useCallback)(
|
|
1825
2790
|
(context, parentId, categories = defaultCopilotContextCategories) => {
|
|
1826
2791
|
return addElement(context, categories, parentId);
|
|
1827
2792
|
},
|
|
1828
2793
|
[addElement]
|
|
1829
2794
|
);
|
|
1830
|
-
const removeContext = (0,
|
|
2795
|
+
const removeContext = (0, import_react12.useCallback)(
|
|
1831
2796
|
(id) => {
|
|
1832
2797
|
removeElement(id);
|
|
1833
2798
|
},
|
|
1834
2799
|
[removeElement]
|
|
1835
2800
|
);
|
|
1836
|
-
const getAllContext = (0,
|
|
2801
|
+
const getAllContext = (0, import_react12.useCallback)(() => {
|
|
1837
2802
|
return getAllElements();
|
|
1838
2803
|
}, [getAllElements]);
|
|
1839
|
-
const getFunctionCallHandler = (0,
|
|
2804
|
+
const getFunctionCallHandler = (0, import_react12.useCallback)(
|
|
1840
2805
|
(customEntryPoints) => {
|
|
1841
2806
|
return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || actions));
|
|
1842
2807
|
},
|
|
1843
2808
|
[actions]
|
|
1844
2809
|
);
|
|
1845
|
-
const getDocumentsContext = (0,
|
|
2810
|
+
const getDocumentsContext = (0, import_react12.useCallback)(
|
|
1846
2811
|
(categories) => {
|
|
1847
2812
|
return allDocuments(categories);
|
|
1848
2813
|
},
|
|
1849
2814
|
[allDocuments]
|
|
1850
2815
|
);
|
|
1851
|
-
const addDocumentContext = (0,
|
|
2816
|
+
const addDocumentContext = (0, import_react12.useCallback)(
|
|
1852
2817
|
(documentPointer, categories = defaultCopilotContextCategories) => {
|
|
1853
2818
|
return addDocument(documentPointer, categories);
|
|
1854
2819
|
},
|
|
1855
2820
|
[addDocument]
|
|
1856
2821
|
);
|
|
1857
|
-
const removeDocumentContext = (0,
|
|
2822
|
+
const removeDocumentContext = (0, import_react12.useCallback)(
|
|
1858
2823
|
(documentId) => {
|
|
1859
2824
|
removeDocument(documentId);
|
|
1860
2825
|
},
|
|
1861
2826
|
[removeDocument]
|
|
1862
2827
|
);
|
|
1863
|
-
const copilotApiConfig = (0,
|
|
2828
|
+
const copilotApiConfig = (0, import_react12.useMemo)(() => {
|
|
1864
2829
|
var _a2, _b;
|
|
1865
2830
|
let cloud = void 0;
|
|
1866
|
-
if (
|
|
2831
|
+
if (publicApiKey) {
|
|
1867
2832
|
cloud = {
|
|
1868
2833
|
guardrails: {
|
|
1869
2834
|
input: {
|
|
@@ -1877,7 +2842,7 @@ ${nonDocumentStrings}`;
|
|
|
1877
2842
|
};
|
|
1878
2843
|
}
|
|
1879
2844
|
return __spreadProps(__spreadValues({
|
|
1880
|
-
publicApiKey
|
|
2845
|
+
publicApiKey
|
|
1881
2846
|
}, cloud ? { cloud } : {}), {
|
|
1882
2847
|
chatApiEndpoint,
|
|
1883
2848
|
headers: props.headers || {},
|
|
@@ -1887,7 +2852,7 @@ ${nonDocumentStrings}`;
|
|
|
1887
2852
|
credentials: props.credentials
|
|
1888
2853
|
});
|
|
1889
2854
|
}, [
|
|
1890
|
-
|
|
2855
|
+
publicApiKey,
|
|
1891
2856
|
props.headers,
|
|
1892
2857
|
props.properties,
|
|
1893
2858
|
props.transcribeAudioUrl,
|
|
@@ -1896,7 +2861,7 @@ ${nonDocumentStrings}`;
|
|
|
1896
2861
|
props.cloudRestrictToTopic,
|
|
1897
2862
|
props.guardrails_c
|
|
1898
2863
|
]);
|
|
1899
|
-
const headers = (0,
|
|
2864
|
+
const headers = (0, import_react12.useMemo)(() => {
|
|
1900
2865
|
const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
|
|
1901
2866
|
if (state.status === "authenticated" && state.authHeaders) {
|
|
1902
2867
|
return __spreadValues(__spreadValues({}, acc), Object.entries(state.authHeaders).reduce(
|
|
@@ -1908,24 +2873,24 @@ ${nonDocumentStrings}`;
|
|
|
1908
2873
|
}
|
|
1909
2874
|
return acc;
|
|
1910
2875
|
}, {});
|
|
1911
|
-
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [
|
|
2876
|
+
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? { [import_shared12.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {}), authHeaders);
|
|
1912
2877
|
}, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
|
|
1913
2878
|
const runtimeClient = useCopilotRuntimeClient({
|
|
1914
2879
|
url: copilotApiConfig.chatApiEndpoint,
|
|
1915
|
-
publicApiKey
|
|
2880
|
+
publicApiKey,
|
|
1916
2881
|
headers,
|
|
1917
2882
|
credentials: copilotApiConfig.credentials,
|
|
1918
2883
|
showDevConsole: shouldShowDevConsole(props.showDevConsole),
|
|
1919
2884
|
onError: props.onError
|
|
1920
2885
|
});
|
|
1921
|
-
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0,
|
|
1922
|
-
const addChatSuggestionConfiguration = (0,
|
|
2886
|
+
const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = (0, import_react12.useState)({});
|
|
2887
|
+
const addChatSuggestionConfiguration = (0, import_react12.useCallback)(
|
|
1923
2888
|
(id, suggestion) => {
|
|
1924
2889
|
setChatSuggestionConfiguration((prev) => __spreadProps(__spreadValues({}, prev), { [id]: suggestion }));
|
|
1925
2890
|
},
|
|
1926
2891
|
[setChatSuggestionConfiguration]
|
|
1927
2892
|
);
|
|
1928
|
-
const removeChatSuggestionConfiguration = (0,
|
|
2893
|
+
const removeChatSuggestionConfiguration = (0, import_react12.useCallback)(
|
|
1929
2894
|
(id) => {
|
|
1930
2895
|
setChatSuggestionConfiguration((prev) => {
|
|
1931
2896
|
const _a2 = prev, { [id]: _ } = _a2, rest = __objRest(_a2, [__restKey(id)]);
|
|
@@ -1934,10 +2899,10 @@ ${nonDocumentStrings}`;
|
|
|
1934
2899
|
},
|
|
1935
2900
|
[setChatSuggestionConfiguration]
|
|
1936
2901
|
);
|
|
1937
|
-
const [availableAgents, setAvailableAgents] = (0,
|
|
1938
|
-
const [coagentStates, setCoagentStates] = (0,
|
|
1939
|
-
const coagentStatesRef = (0,
|
|
1940
|
-
const setCoagentStatesWithRef = (0,
|
|
2902
|
+
const [availableAgents, setAvailableAgents] = (0, import_react12.useState)([]);
|
|
2903
|
+
const [coagentStates, setCoagentStates] = (0, import_react12.useState)({});
|
|
2904
|
+
const coagentStatesRef = (0, import_react12.useRef)({});
|
|
2905
|
+
const setCoagentStatesWithRef = (0, import_react12.useCallback)(
|
|
1941
2906
|
(value) => {
|
|
1942
2907
|
const newValue = typeof value === "function" ? value(coagentStatesRef.current) : value;
|
|
1943
2908
|
coagentStatesRef.current = newValue;
|
|
@@ -1947,8 +2912,8 @@ ${nonDocumentStrings}`;
|
|
|
1947
2912
|
},
|
|
1948
2913
|
[]
|
|
1949
2914
|
);
|
|
1950
|
-
const hasLoadedAgents = (0,
|
|
1951
|
-
(0,
|
|
2915
|
+
const hasLoadedAgents = (0, import_react12.useRef)(false);
|
|
2916
|
+
(0, import_react12.useEffect)(() => {
|
|
1952
2917
|
if (hasLoadedAgents.current)
|
|
1953
2918
|
return;
|
|
1954
2919
|
const fetchData = () => __async(this, null, function* () {
|
|
@@ -1967,8 +2932,8 @@ ${nonDocumentStrings}`;
|
|
|
1967
2932
|
agentName: props.agent
|
|
1968
2933
|
};
|
|
1969
2934
|
}
|
|
1970
|
-
const [agentSession, setAgentSession] = (0,
|
|
1971
|
-
(0,
|
|
2935
|
+
const [agentSession, setAgentSession] = (0, import_react12.useState)(initialAgentSession);
|
|
2936
|
+
(0, import_react12.useEffect)(() => {
|
|
1972
2937
|
if (props.agent) {
|
|
1973
2938
|
setAgentSession({
|
|
1974
2939
|
agentName: props.agent
|
|
@@ -1977,8 +2942,8 @@ ${nonDocumentStrings}`;
|
|
|
1977
2942
|
setAgentSession(null);
|
|
1978
2943
|
}
|
|
1979
2944
|
}, [props.agent]);
|
|
1980
|
-
const [internalThreadId, setInternalThreadId] = (0,
|
|
1981
|
-
const setThreadId = (0,
|
|
2945
|
+
const [internalThreadId, setInternalThreadId] = (0, import_react12.useState)(props.threadId || (0, import_shared12.randomUUID)());
|
|
2946
|
+
const setThreadId = (0, import_react12.useCallback)(
|
|
1982
2947
|
(value) => {
|
|
1983
2948
|
if (props.threadId) {
|
|
1984
2949
|
throw new Error("Cannot call setThreadId() when threadId is provided via props.");
|
|
@@ -1987,16 +2952,16 @@ ${nonDocumentStrings}`;
|
|
|
1987
2952
|
},
|
|
1988
2953
|
[props.threadId]
|
|
1989
2954
|
);
|
|
1990
|
-
(0,
|
|
2955
|
+
(0, import_react12.useEffect)(() => {
|
|
1991
2956
|
if (props.threadId !== void 0) {
|
|
1992
2957
|
setInternalThreadId(props.threadId);
|
|
1993
2958
|
}
|
|
1994
2959
|
}, [props.threadId]);
|
|
1995
|
-
const [runId, setRunId] = (0,
|
|
1996
|
-
const chatAbortControllerRef = (0,
|
|
2960
|
+
const [runId, setRunId] = (0, import_react12.useState)(null);
|
|
2961
|
+
const chatAbortControllerRef = (0, import_react12.useRef)(null);
|
|
1997
2962
|
const showDevConsole = shouldShowDevConsole(props.showDevConsole);
|
|
1998
|
-
const [langGraphInterruptAction, _setLangGraphInterruptAction] = (0,
|
|
1999
|
-
const setLangGraphInterruptAction = (0,
|
|
2963
|
+
const [langGraphInterruptAction, _setLangGraphInterruptAction] = (0, import_react12.useState)(null);
|
|
2964
|
+
const setLangGraphInterruptAction = (0, import_react12.useCallback)((action) => {
|
|
2000
2965
|
_setLangGraphInterruptAction((prev) => {
|
|
2001
2966
|
if (prev == null)
|
|
2002
2967
|
return action;
|
|
@@ -2009,23 +2974,23 @@ ${nonDocumentStrings}`;
|
|
|
2009
2974
|
return __spreadProps(__spreadValues(__spreadValues({}, prev), action), { event });
|
|
2010
2975
|
});
|
|
2011
2976
|
}, []);
|
|
2012
|
-
const removeLangGraphInterruptAction = (0,
|
|
2977
|
+
const removeLangGraphInterruptAction = (0, import_react12.useCallback)(() => {
|
|
2013
2978
|
setLangGraphInterruptAction(null);
|
|
2014
2979
|
}, []);
|
|
2015
|
-
const memoizedChildren = (0,
|
|
2016
|
-
const [bannerError, setBannerError] = (0,
|
|
2017
|
-
const agentLock = (0,
|
|
2980
|
+
const memoizedChildren = (0, import_react12.useMemo)(() => children, [children]);
|
|
2981
|
+
const [bannerError, setBannerError] = (0, import_react12.useState)(null);
|
|
2982
|
+
const agentLock = (0, import_react12.useMemo)(() => {
|
|
2018
2983
|
var _a2;
|
|
2019
2984
|
return (_a2 = props.agent) != null ? _a2 : null;
|
|
2020
2985
|
}, [props.agent]);
|
|
2021
|
-
const forwardedParameters = (0,
|
|
2986
|
+
const forwardedParameters = (0, import_react12.useMemo)(
|
|
2022
2987
|
() => {
|
|
2023
2988
|
var _a2;
|
|
2024
2989
|
return (_a2 = props.forwardedParameters) != null ? _a2 : {};
|
|
2025
2990
|
},
|
|
2026
2991
|
[props.forwardedParameters]
|
|
2027
2992
|
);
|
|
2028
|
-
const updateExtensions = (0,
|
|
2993
|
+
const updateExtensions = (0, import_react12.useCallback)(
|
|
2029
2994
|
(newExtensions) => {
|
|
2030
2995
|
setExtensions((prev) => {
|
|
2031
2996
|
const resolved = typeof newExtensions === "function" ? newExtensions(prev) : newExtensions;
|
|
@@ -2037,7 +3002,7 @@ ${nonDocumentStrings}`;
|
|
|
2037
3002
|
},
|
|
2038
3003
|
[setExtensions]
|
|
2039
3004
|
);
|
|
2040
|
-
const updateAuthStates = (0,
|
|
3005
|
+
const updateAuthStates = (0, import_react12.useCallback)(
|
|
2041
3006
|
(newAuthStates) => {
|
|
2042
3007
|
setAuthStates((prev) => {
|
|
2043
3008
|
const resolved = typeof newAuthStates === "function" ? newAuthStates(prev) : newAuthStates;
|
|
@@ -2049,7 +3014,7 @@ ${nonDocumentStrings}`;
|
|
|
2049
3014
|
},
|
|
2050
3015
|
[setAuthStates]
|
|
2051
3016
|
);
|
|
2052
|
-
return /* @__PURE__ */ (0,
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2053
3018
|
CopilotContext.Provider,
|
|
2054
3019
|
{
|
|
2055
3020
|
value: {
|
|
@@ -2107,8 +3072,11 @@ ${nonDocumentStrings}`;
|
|
|
2107
3072
|
setBannerError
|
|
2108
3073
|
},
|
|
2109
3074
|
children: [
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2111
|
-
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MessagesTapProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(CopilotMessages, { children: [
|
|
3076
|
+
memoizedChildren,
|
|
3077
|
+
showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ConsoleTrigger, {})
|
|
3078
|
+
] }) }),
|
|
3079
|
+
bannerError && showDevConsole && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2112
3080
|
UsageBanner,
|
|
2113
3081
|
{
|
|
2114
3082
|
severity: bannerError.severity,
|
|
@@ -2152,31 +3120,31 @@ function formatFeatureName(featureName) {
|
|
|
2152
3120
|
}
|
|
2153
3121
|
function validateProps(props) {
|
|
2154
3122
|
const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
|
|
2155
|
-
|
|
2156
|
-
|
|
3123
|
+
const hasApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
3124
|
+
if (!props.runtimeUrl && !hasApiKey) {
|
|
3125
|
+
throw new import_shared12.ConfigurationError(
|
|
3126
|
+
"Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
|
|
3127
|
+
);
|
|
2157
3128
|
}
|
|
2158
|
-
if (cloudFeatures.length > 0 && !
|
|
2159
|
-
throw new
|
|
2160
|
-
`Missing required prop: 'publicApiKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
|
|
3129
|
+
if (cloudFeatures.length > 0 && !hasApiKey) {
|
|
3130
|
+
throw new import_shared12.MissingPublicApiKeyError(
|
|
3131
|
+
`Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
|
|
2161
3132
|
);
|
|
2162
3133
|
}
|
|
2163
3134
|
}
|
|
2164
3135
|
|
|
2165
|
-
// src/hooks/use-copilot-chat.ts
|
|
2166
|
-
var import_react14 = require("react");
|
|
2167
|
-
|
|
2168
3136
|
// src/hooks/use-copilot-chat_internal.ts
|
|
2169
|
-
var
|
|
3137
|
+
var import_react15 = require("react");
|
|
2170
3138
|
|
|
2171
3139
|
// src/hooks/use-chat.ts
|
|
2172
|
-
var
|
|
3140
|
+
var import_react13 = require("react");
|
|
2173
3141
|
var import_react_dom2 = require("react-dom");
|
|
2174
|
-
var
|
|
3142
|
+
var import_shared14 = require("@copilotkit/shared");
|
|
2175
3143
|
var import_runtime_client_gql7 = require("@copilotkit/runtime-client-gql");
|
|
2176
3144
|
|
|
2177
3145
|
// src/types/frontend-action.ts
|
|
2178
3146
|
var import_runtime_client_gql6 = require("@copilotkit/runtime-client-gql");
|
|
2179
|
-
var
|
|
3147
|
+
var import_shared13 = require("@copilotkit/shared");
|
|
2180
3148
|
function processActionsForRuntimeRequest(actions) {
|
|
2181
3149
|
const filteredActions = actions.filter(
|
|
2182
3150
|
(action) => action.available !== import_runtime_client_gql6.ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction
|
|
@@ -2192,7 +3160,7 @@ function processActionsForRuntimeRequest(actions) {
|
|
|
2192
3160
|
return {
|
|
2193
3161
|
name: action.name,
|
|
2194
3162
|
description: action.description || "",
|
|
2195
|
-
jsonSchema: JSON.stringify((0,
|
|
3163
|
+
jsonSchema: JSON.stringify((0, import_shared13.actionParametersToJsonSchema)(action.parameters || [])),
|
|
2196
3164
|
available
|
|
2197
3165
|
};
|
|
2198
3166
|
});
|
|
@@ -2227,7 +3195,7 @@ function useChat(options) {
|
|
|
2227
3195
|
langGraphInterruptAction,
|
|
2228
3196
|
setLangGraphInterruptAction
|
|
2229
3197
|
} = options;
|
|
2230
|
-
const runChatCompletionRef = (0,
|
|
3198
|
+
const runChatCompletionRef = (0, import_react13.useRef)();
|
|
2231
3199
|
const addErrorToast = useErrorToast();
|
|
2232
3200
|
const { setBannerError } = useToast();
|
|
2233
3201
|
const { onError } = useCopilotContext();
|
|
@@ -2258,14 +3226,14 @@ function useChat(options) {
|
|
|
2258
3226
|
console.error("Error in use-chat onError handler:", traceError);
|
|
2259
3227
|
}
|
|
2260
3228
|
});
|
|
2261
|
-
const agentSessionRef = (0,
|
|
3229
|
+
const agentSessionRef = (0, import_react13.useRef)(agentSession);
|
|
2262
3230
|
agentSessionRef.current = agentSession;
|
|
2263
|
-
const runIdRef = (0,
|
|
3231
|
+
const runIdRef = (0, import_react13.useRef)(runId);
|
|
2264
3232
|
runIdRef.current = runId;
|
|
2265
|
-
const extensionsRef = (0,
|
|
3233
|
+
const extensionsRef = (0, import_react13.useRef)(extensions);
|
|
2266
3234
|
extensionsRef.current = extensions;
|
|
2267
3235
|
const publicApiKey = copilotConfig.publicApiKey;
|
|
2268
|
-
const headers = __spreadValues(__spreadValues({}, copilotConfig.headers || {}), publicApiKey ? { [
|
|
3236
|
+
const headers = __spreadValues(__spreadValues({}, copilotConfig.headers || {}), publicApiKey ? { [import_shared14.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: publicApiKey } : {});
|
|
2269
3237
|
const { showDevConsole } = useCopilotContext();
|
|
2270
3238
|
const runtimeClient = useCopilotRuntimeClient({
|
|
2271
3239
|
url: copilotConfig.chatApiEndpoint,
|
|
@@ -2274,7 +3242,7 @@ function useChat(options) {
|
|
|
2274
3242
|
credentials: copilotConfig.credentials,
|
|
2275
3243
|
showDevConsole
|
|
2276
3244
|
});
|
|
2277
|
-
const pendingAppendsRef = (0,
|
|
3245
|
+
const pendingAppendsRef = (0, import_react13.useRef)([]);
|
|
2278
3246
|
const runChatCompletion = useAsyncCallback(
|
|
2279
3247
|
(previousMessages) => __async(this, null, function* () {
|
|
2280
3248
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
@@ -2390,7 +3358,7 @@ function useChat(options) {
|
|
|
2390
3358
|
(metaEvents != null ? metaEvents : []).forEach((ev) => {
|
|
2391
3359
|
if (ev.name === import_runtime_client_gql7.MetaEventName.LangGraphInterruptEvent) {
|
|
2392
3360
|
let eventValue = (0, import_runtime_client_gql7.langGraphInterruptEvent)(ev).value;
|
|
2393
|
-
eventValue = (0,
|
|
3361
|
+
eventValue = (0, import_shared14.parseJson)(eventValue, eventValue);
|
|
2394
3362
|
setLangGraphInterruptAction({
|
|
2395
3363
|
event: __spreadProps(__spreadValues({}, (0, import_runtime_client_gql7.langGraphInterruptEvent)(ev)), {
|
|
2396
3364
|
value: eventValue
|
|
@@ -2418,9 +3386,9 @@ function useChat(options) {
|
|
|
2418
3386
|
content: guardrailsReason
|
|
2419
3387
|
})
|
|
2420
3388
|
];
|
|
2421
|
-
const guardrailsError = new
|
|
3389
|
+
const guardrailsError = new import_shared14.CopilotKitError({
|
|
2422
3390
|
message: `Guardrails validation failed: ${guardrailsReason}`,
|
|
2423
|
-
code:
|
|
3391
|
+
code: import_shared14.CopilotKitErrorCode.MISUSE
|
|
2424
3392
|
});
|
|
2425
3393
|
yield traceUIError(guardrailsError, {
|
|
2426
3394
|
statusReason: value.generateCopilotResponse.status.reason,
|
|
@@ -2436,11 +3404,11 @@ function useChat(options) {
|
|
|
2436
3404
|
const originalCode = (originalError == null ? void 0 : originalError.code) || ((_o = originalError == null ? void 0 : originalError.extensions) == null ? void 0 : _o.code);
|
|
2437
3405
|
const originalSeverity = (originalError == null ? void 0 : originalError.severity) || ((_p = originalError == null ? void 0 : originalError.extensions) == null ? void 0 : _p.severity);
|
|
2438
3406
|
const originalVisibility = (originalError == null ? void 0 : originalError.visibility) || ((_q = originalError == null ? void 0 : originalError.extensions) == null ? void 0 : _q.visibility);
|
|
2439
|
-
let errorCode =
|
|
2440
|
-
if (originalCode && Object.values(
|
|
3407
|
+
let errorCode = import_shared14.CopilotKitErrorCode.NETWORK_ERROR;
|
|
3408
|
+
if (originalCode && Object.values(import_shared14.CopilotKitErrorCode).includes(originalCode)) {
|
|
2441
3409
|
errorCode = originalCode;
|
|
2442
3410
|
}
|
|
2443
|
-
const structuredError = new
|
|
3411
|
+
const structuredError = new import_shared14.CopilotKitError({
|
|
2444
3412
|
message: errorMessage,
|
|
2445
3413
|
code: errorCode,
|
|
2446
3414
|
severity: originalSeverity,
|
|
@@ -2502,7 +3470,7 @@ function useChat(options) {
|
|
|
2502
3470
|
} else {
|
|
2503
3471
|
if (agentLock) {
|
|
2504
3472
|
setAgentSession({
|
|
2505
|
-
threadId: (0,
|
|
3473
|
+
threadId: (0, import_shared14.randomId)(),
|
|
2506
3474
|
agentName: agentLock,
|
|
2507
3475
|
nodeName: void 0
|
|
2508
3476
|
});
|
|
@@ -2589,7 +3557,7 @@ function useChat(options) {
|
|
|
2589
3557
|
if (pairedFeAction) {
|
|
2590
3558
|
const newExecutionMessage = new import_runtime_client_gql7.ActionExecutionMessage({
|
|
2591
3559
|
name: pairedFeAction.name,
|
|
2592
|
-
arguments: (0,
|
|
3560
|
+
arguments: (0, import_shared14.parseJson)(resultMessage.result, resultMessage.result),
|
|
2593
3561
|
status: message.status,
|
|
2594
3562
|
createdAt: message.createdAt,
|
|
2595
3563
|
parentMessageId: message.parentMessageId
|
|
@@ -2600,7 +3568,7 @@ function useChat(options) {
|
|
|
2600
3568
|
} else if (message.isResultMessage() && currentResultMessagePairedFeAction) {
|
|
2601
3569
|
const newExecutionMessage = new import_runtime_client_gql7.ActionExecutionMessage({
|
|
2602
3570
|
name: currentResultMessagePairedFeAction.name,
|
|
2603
|
-
arguments: (0,
|
|
3571
|
+
arguments: (0, import_shared14.parseJson)(message.result, message.result),
|
|
2604
3572
|
status: message.status,
|
|
2605
3573
|
createdAt: message.createdAt
|
|
2606
3574
|
});
|
|
@@ -2668,7 +3636,7 @@ function useChat(options) {
|
|
|
2668
3636
|
}),
|
|
2669
3637
|
[messages]
|
|
2670
3638
|
);
|
|
2671
|
-
(0,
|
|
3639
|
+
(0, import_react13.useEffect)(() => {
|
|
2672
3640
|
if (!isLoading && pendingAppendsRef.current.length > 0) {
|
|
2673
3641
|
const pending = pendingAppendsRef.current.splice(0);
|
|
2674
3642
|
const followUp = pending.some((p) => p.followUp);
|
|
@@ -2679,7 +3647,7 @@ function useChat(options) {
|
|
|
2679
3647
|
}
|
|
2680
3648
|
}
|
|
2681
3649
|
}, [isLoading, messages, setMessages, runChatCompletionAndHandleFunctionCall]);
|
|
2682
|
-
const composeAndFlushMetaEventsInput = (0,
|
|
3650
|
+
const composeAndFlushMetaEventsInput = (0, import_react13.useCallback)(
|
|
2683
3651
|
(metaEvents) => {
|
|
2684
3652
|
return metaEvents.reduce((acc, event) => {
|
|
2685
3653
|
if (!event)
|
|
@@ -2860,14 +3828,14 @@ function getPairedFeAction(actions, message) {
|
|
|
2860
3828
|
var import_runtime_client_gql8 = require("@copilotkit/runtime-client-gql");
|
|
2861
3829
|
|
|
2862
3830
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
2863
|
-
var
|
|
3831
|
+
var import_react14 = __toESM(require("react"));
|
|
2864
3832
|
var InterruptRenderer = ({ event, result, render, resolve }) => {
|
|
2865
3833
|
return render({ event, result, resolve });
|
|
2866
3834
|
};
|
|
2867
3835
|
function useLangGraphInterruptRender() {
|
|
2868
3836
|
const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession } = useCopilotContext();
|
|
2869
|
-
const responseRef =
|
|
2870
|
-
const resolveInterrupt = (0,
|
|
3837
|
+
const responseRef = import_react14.default.useRef();
|
|
3838
|
+
const resolveInterrupt = (0, import_react14.useCallback)(
|
|
2871
3839
|
(response) => {
|
|
2872
3840
|
responseRef.current = response;
|
|
2873
3841
|
setTimeout(() => {
|
|
@@ -2890,7 +3858,7 @@ function useLangGraphInterruptRender() {
|
|
|
2890
3858
|
resolve: resolveInterrupt
|
|
2891
3859
|
});
|
|
2892
3860
|
}
|
|
2893
|
-
return
|
|
3861
|
+
return import_react14.default.createElement(InterruptRenderer, {
|
|
2894
3862
|
event,
|
|
2895
3863
|
result,
|
|
2896
3864
|
render,
|
|
@@ -2931,10 +3899,10 @@ function useCopilotChat(options = {}) {
|
|
|
2931
3899
|
runtimeClient
|
|
2932
3900
|
} = useCopilotContext();
|
|
2933
3901
|
const { messages, setMessages, suggestions, setSuggestions } = useCopilotMessagesContext();
|
|
2934
|
-
const [mcpServers, setLocalMcpServers] = (0,
|
|
2935
|
-
const suggestionsAbortControllerRef = (0,
|
|
2936
|
-
const isLoadingSuggestionsRef = (0,
|
|
2937
|
-
const abortSuggestions = (0,
|
|
3902
|
+
const [mcpServers, setLocalMcpServers] = (0, import_react15.useState)([]);
|
|
3903
|
+
const suggestionsAbortControllerRef = (0, import_react15.useRef)(null);
|
|
3904
|
+
const isLoadingSuggestionsRef = (0, import_react15.useRef)(false);
|
|
3905
|
+
const abortSuggestions = (0, import_react15.useCallback)(
|
|
2938
3906
|
(clear = true) => {
|
|
2939
3907
|
var _a2;
|
|
2940
3908
|
(_a2 = suggestionsAbortControllerRef.current) == null ? void 0 : _a2.abort("suggestions aborted by user");
|
|
@@ -2945,7 +3913,7 @@ function useCopilotChat(options = {}) {
|
|
|
2945
3913
|
},
|
|
2946
3914
|
[setSuggestions]
|
|
2947
3915
|
);
|
|
2948
|
-
const stableContext = (0,
|
|
3916
|
+
const stableContext = (0, import_react15.useMemo)(() => {
|
|
2949
3917
|
return {
|
|
2950
3918
|
actions,
|
|
2951
3919
|
copilotApiConfig,
|
|
@@ -2961,7 +3929,7 @@ function useCopilotChat(options = {}) {
|
|
|
2961
3929
|
messages.length,
|
|
2962
3930
|
Object.keys(chatSuggestionConfiguration).length
|
|
2963
3931
|
]);
|
|
2964
|
-
const generateSuggestionsFunc = (0,
|
|
3932
|
+
const generateSuggestionsFunc = (0, import_react15.useCallback)(() => __async(this, null, function* () {
|
|
2965
3933
|
if (globalSuggestionPromise) {
|
|
2966
3934
|
return globalSuggestionPromise;
|
|
2967
3935
|
}
|
|
@@ -2986,10 +3954,10 @@ function useCopilotChat(options = {}) {
|
|
|
2986
3954
|
}))();
|
|
2987
3955
|
return globalSuggestionPromise;
|
|
2988
3956
|
}), [stableContext, chatSuggestionConfiguration, setSuggestions, abortSuggestions]);
|
|
2989
|
-
const resetSuggestions = (0,
|
|
3957
|
+
const resetSuggestions = (0, import_react15.useCallback)(() => {
|
|
2990
3958
|
setSuggestions([]);
|
|
2991
3959
|
}, [setSuggestions]);
|
|
2992
|
-
(0,
|
|
3960
|
+
(0, import_react15.useEffect)(() => {
|
|
2993
3961
|
if (mcpServers.length > 0) {
|
|
2994
3962
|
const serversCopy = [...mcpServers];
|
|
2995
3963
|
copilotApiConfig.mcpServers = serversCopy;
|
|
@@ -2999,7 +3967,7 @@ function useCopilotChat(options = {}) {
|
|
|
2999
3967
|
copilotApiConfig.properties.mcpServers = serversCopy;
|
|
3000
3968
|
}
|
|
3001
3969
|
}, [mcpServers, copilotApiConfig]);
|
|
3002
|
-
const setMcpServers = (0,
|
|
3970
|
+
const setMcpServers = (0, import_react15.useCallback)((servers) => {
|
|
3003
3971
|
setLocalMcpServers(servers);
|
|
3004
3972
|
}, []);
|
|
3005
3973
|
const onCoAgentStateRender = useAsyncCallback(
|
|
@@ -3020,7 +3988,7 @@ function useCopilotChat(options = {}) {
|
|
|
3020
3988
|
}),
|
|
3021
3989
|
[coAgentStateRenders]
|
|
3022
3990
|
);
|
|
3023
|
-
const makeSystemMessageCallback = (0,
|
|
3991
|
+
const makeSystemMessageCallback = (0, import_react15.useCallback)(() => {
|
|
3024
3992
|
const systemMessageMaker = makeSystemMessage2 || defaultSystemMessage;
|
|
3025
3993
|
const contextString = getContextString([], defaultCopilotContextCategories);
|
|
3026
3994
|
return new import_runtime_client_gql8.TextMessage({
|
|
@@ -3028,7 +3996,7 @@ function useCopilotChat(options = {}) {
|
|
|
3028
3996
|
role: import_runtime_client_gql8.Role.System
|
|
3029
3997
|
});
|
|
3030
3998
|
}, [getContextString, makeSystemMessage2, chatInstructions]);
|
|
3031
|
-
const deleteMessage = (0,
|
|
3999
|
+
const deleteMessage = (0, import_react15.useCallback)(
|
|
3032
4000
|
(messageId) => {
|
|
3033
4001
|
setMessages((prev) => prev.filter((message) => message.id !== messageId));
|
|
3034
4002
|
},
|
|
@@ -3063,6 +4031,13 @@ function useCopilotChat(options = {}) {
|
|
|
3063
4031
|
}));
|
|
3064
4032
|
const latestAppend = useUpdatedRef(append);
|
|
3065
4033
|
const latestAppendFunc = useAsyncCallback(
|
|
4034
|
+
(message, options2) => __async(this, null, function* () {
|
|
4035
|
+
abortSuggestions(options2 == null ? void 0 : options2.clearSuggestions);
|
|
4036
|
+
return yield latestAppend.current(message, options2);
|
|
4037
|
+
}),
|
|
4038
|
+
[latestAppend]
|
|
4039
|
+
);
|
|
4040
|
+
const latestSendMessageFunc = useAsyncCallback(
|
|
3066
4041
|
(message, options2) => __async(this, null, function* () {
|
|
3067
4042
|
abortSuggestions(options2 == null ? void 0 : options2.clearSuggestions);
|
|
3068
4043
|
return yield latestAppend.current((0, import_runtime_client_gql8.aguiToGQL)([message])[0], options2);
|
|
@@ -3077,19 +4052,22 @@ function useCopilotChat(options = {}) {
|
|
|
3077
4052
|
[latestReload]
|
|
3078
4053
|
);
|
|
3079
4054
|
const latestStop = useUpdatedRef(stop);
|
|
3080
|
-
const latestStopFunc = (0,
|
|
4055
|
+
const latestStopFunc = (0, import_react15.useCallback)(() => {
|
|
3081
4056
|
return latestStop.current();
|
|
3082
4057
|
}, [latestStop]);
|
|
3083
4058
|
const latestDelete = useUpdatedRef(deleteMessage);
|
|
3084
|
-
const latestDeleteFunc = (0,
|
|
4059
|
+
const latestDeleteFunc = (0, import_react15.useCallback)(
|
|
3085
4060
|
(messageId) => {
|
|
3086
4061
|
return latestDelete.current(messageId);
|
|
3087
4062
|
},
|
|
3088
4063
|
[latestDelete]
|
|
3089
4064
|
);
|
|
3090
4065
|
const latestSetMessages = useUpdatedRef(setMessages);
|
|
3091
|
-
const latestSetMessagesFunc = (0,
|
|
4066
|
+
const latestSetMessagesFunc = (0, import_react15.useCallback)(
|
|
3092
4067
|
(messages2) => {
|
|
4068
|
+
if (messages2.every((message) => message instanceof import_runtime_client_gql8.Message)) {
|
|
4069
|
+
return latestSetMessages.current(messages2);
|
|
4070
|
+
}
|
|
3093
4071
|
return latestSetMessages.current((0, import_runtime_client_gql8.aguiToGQL)(messages2));
|
|
3094
4072
|
},
|
|
3095
4073
|
[latestSetMessages]
|
|
@@ -3098,7 +4076,7 @@ function useCopilotChat(options = {}) {
|
|
|
3098
4076
|
const latestRunChatCompletionFunc = useAsyncCallback(() => __async(this, null, function* () {
|
|
3099
4077
|
return yield latestRunChatCompletion.current();
|
|
3100
4078
|
}), [latestRunChatCompletion]);
|
|
3101
|
-
const reset = (0,
|
|
4079
|
+
const reset = (0, import_react15.useCallback)(() => {
|
|
3102
4080
|
latestStopFunc();
|
|
3103
4081
|
setMessages([]);
|
|
3104
4082
|
setRunId(null);
|
|
@@ -3121,12 +4099,14 @@ function useCopilotChat(options = {}) {
|
|
|
3121
4099
|
resetSuggestions
|
|
3122
4100
|
]);
|
|
3123
4101
|
const latestReset = useUpdatedRef(reset);
|
|
3124
|
-
const latestResetFunc = (0,
|
|
4102
|
+
const latestResetFunc = (0, import_react15.useCallback)(() => {
|
|
3125
4103
|
return latestReset.current();
|
|
3126
4104
|
}, [latestReset]);
|
|
3127
4105
|
const interrupt = useLangGraphInterruptRender();
|
|
3128
4106
|
return {
|
|
3129
|
-
visibleMessages:
|
|
4107
|
+
visibleMessages: messages,
|
|
4108
|
+
messages: (0, import_runtime_client_gql8.gqlToAGUI)(messages, actions, coAgentStateRenders),
|
|
4109
|
+
sendMessage: latestSendMessageFunc,
|
|
3130
4110
|
appendMessage: latestAppendFunc,
|
|
3131
4111
|
setMessages: latestSetMessagesFunc,
|
|
3132
4112
|
reloadMessages: latestReloadFunc,
|
|
@@ -3146,8 +4126,8 @@ function useCopilotChat(options = {}) {
|
|
|
3146
4126
|
};
|
|
3147
4127
|
}
|
|
3148
4128
|
function useUpdatedRef(value) {
|
|
3149
|
-
const ref = (0,
|
|
3150
|
-
(0,
|
|
4129
|
+
const ref = (0, import_react15.useRef)(value);
|
|
4130
|
+
(0, import_react15.useEffect)(() => {
|
|
3151
4131
|
ref.current = value;
|
|
3152
4132
|
}, [value]);
|
|
3153
4133
|
return ref;
|
|
@@ -3180,9 +4160,39 @@ ${additionalInstructions}` : "");
|
|
|
3180
4160
|
}
|
|
3181
4161
|
|
|
3182
4162
|
// src/hooks/use-copilot-chat.ts
|
|
3183
|
-
|
|
4163
|
+
function useCopilotChat2(options = {}) {
|
|
4164
|
+
const {
|
|
4165
|
+
visibleMessages,
|
|
4166
|
+
appendMessage,
|
|
4167
|
+
reloadMessages,
|
|
4168
|
+
stopGeneration,
|
|
4169
|
+
reset,
|
|
4170
|
+
isLoading,
|
|
4171
|
+
runChatCompletion,
|
|
4172
|
+
mcpServers,
|
|
4173
|
+
setMcpServers
|
|
4174
|
+
} = useCopilotChat(options);
|
|
4175
|
+
return {
|
|
4176
|
+
visibleMessages,
|
|
4177
|
+
appendMessage,
|
|
4178
|
+
reloadMessages,
|
|
4179
|
+
stopGeneration,
|
|
4180
|
+
reset,
|
|
4181
|
+
isLoading,
|
|
4182
|
+
runChatCompletion,
|
|
4183
|
+
mcpServers,
|
|
4184
|
+
setMcpServers
|
|
4185
|
+
};
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
// src/hooks/use-copilot-chat-headless_c.ts
|
|
4189
|
+
var import_react16 = require("react");
|
|
4190
|
+
var import_shared15 = require("@copilotkit/shared");
|
|
3184
4191
|
var createNonFunctionalReturn = () => ({
|
|
3185
4192
|
visibleMessages: [],
|
|
4193
|
+
messages: [],
|
|
4194
|
+
sendMessage: () => __async(void 0, null, function* () {
|
|
4195
|
+
}),
|
|
3186
4196
|
appendMessage: () => __async(void 0, null, function* () {
|
|
3187
4197
|
}),
|
|
3188
4198
|
setMessages: () => {
|
|
@@ -3212,21 +4222,24 @@ var createNonFunctionalReturn = () => ({
|
|
|
3212
4222
|
isLoadingSuggestions: false,
|
|
3213
4223
|
interrupt: null
|
|
3214
4224
|
});
|
|
3215
|
-
function
|
|
4225
|
+
function useCopilotChatHeadless_c(options = {}) {
|
|
3216
4226
|
const { copilotApiConfig, setBannerError } = useCopilotContext();
|
|
3217
4227
|
const hasPublicApiKey = Boolean(copilotApiConfig.publicApiKey);
|
|
3218
4228
|
const internalResult = useCopilotChat(options);
|
|
3219
|
-
(0,
|
|
4229
|
+
(0, import_react16.useEffect)(() => {
|
|
3220
4230
|
if (!hasPublicApiKey) {
|
|
3221
4231
|
setBannerError(
|
|
3222
|
-
new
|
|
3223
|
-
message:
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
4232
|
+
new import_shared15.CopilotKitError({
|
|
4233
|
+
message: (
|
|
4234
|
+
// add link to documentation here
|
|
4235
|
+
"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."
|
|
4236
|
+
),
|
|
4237
|
+
code: import_shared15.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
|
|
4238
|
+
severity: import_shared15.Severity.WARNING,
|
|
4239
|
+
visibility: import_shared15.ErrorVisibility.BANNER
|
|
3227
4240
|
})
|
|
3228
4241
|
);
|
|
3229
|
-
|
|
4242
|
+
import_shared15.styledConsole.logCopilotKitPlatformMessage();
|
|
3230
4243
|
} else {
|
|
3231
4244
|
setBannerError(null);
|
|
3232
4245
|
}
|
|
@@ -3237,24 +4250,14 @@ function useCopilotChat2(options = {}) {
|
|
|
3237
4250
|
return createNonFunctionalReturn();
|
|
3238
4251
|
}
|
|
3239
4252
|
|
|
3240
|
-
// src/hooks/use-copilot-chat-light.ts
|
|
3241
|
-
function useCopilotChatLight(options = {}) {
|
|
3242
|
-
const { appendMessage, setSuggestions, generateSuggestions } = useCopilotChat(options);
|
|
3243
|
-
return {
|
|
3244
|
-
appendMessage,
|
|
3245
|
-
setSuggestions,
|
|
3246
|
-
generateSuggestions
|
|
3247
|
-
};
|
|
3248
|
-
}
|
|
3249
|
-
|
|
3250
4253
|
// src/hooks/use-copilot-action.ts
|
|
3251
|
-
var
|
|
3252
|
-
var
|
|
4254
|
+
var import_shared16 = require("@copilotkit/shared");
|
|
4255
|
+
var import_react17 = require("react");
|
|
3253
4256
|
function useCopilotAction(action, dependencies) {
|
|
3254
4257
|
const { setAction, removeAction, actions, chatComponentsCache } = useCopilotContext();
|
|
3255
|
-
const idRef = (0,
|
|
3256
|
-
const renderAndWaitRef = (0,
|
|
3257
|
-
const activatingMessageIdRef = (0,
|
|
4258
|
+
const idRef = (0, import_react17.useRef)((0, import_shared16.randomId)());
|
|
4259
|
+
const renderAndWaitRef = (0, import_react17.useRef)(null);
|
|
4260
|
+
const activatingMessageIdRef = (0, import_react17.useRef)(null);
|
|
3258
4261
|
const { addToast } = useToast();
|
|
3259
4262
|
action = __spreadValues({}, action);
|
|
3260
4263
|
if (
|
|
@@ -3316,7 +4319,7 @@ function useCopilotAction(action, dependencies) {
|
|
|
3316
4319
|
return renderAndWait(waitProps);
|
|
3317
4320
|
}
|
|
3318
4321
|
}
|
|
3319
|
-
return (0,
|
|
4322
|
+
return (0, import_react17.createElement)(import_react17.Fragment);
|
|
3320
4323
|
};
|
|
3321
4324
|
}
|
|
3322
4325
|
if (dependencies === void 0) {
|
|
@@ -3331,7 +4334,7 @@ function useCopilotAction(action, dependencies) {
|
|
|
3331
4334
|
}
|
|
3332
4335
|
}
|
|
3333
4336
|
}
|
|
3334
|
-
(0,
|
|
4337
|
+
(0, import_react17.useEffect)(() => {
|
|
3335
4338
|
const hasDuplicate = Object.values(actions).some(
|
|
3336
4339
|
(otherAction) => otherAction.name === action.name && otherAction !== actions[idRef.current]
|
|
3337
4340
|
);
|
|
@@ -3343,7 +4346,7 @@ function useCopilotAction(action, dependencies) {
|
|
|
3343
4346
|
});
|
|
3344
4347
|
}
|
|
3345
4348
|
}, [actions]);
|
|
3346
|
-
(0,
|
|
4349
|
+
(0, import_react17.useEffect)(() => {
|
|
3347
4350
|
setAction(idRef.current, action);
|
|
3348
4351
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
3349
4352
|
chatComponentsCache.current.actions[action.name] = action.render;
|
|
@@ -3372,8 +4375,8 @@ function isFrontendAction(action) {
|
|
|
3372
4375
|
}
|
|
3373
4376
|
|
|
3374
4377
|
// src/hooks/use-coagent-state-render.ts
|
|
3375
|
-
var
|
|
3376
|
-
var
|
|
4378
|
+
var import_react18 = require("react");
|
|
4379
|
+
var import_shared17 = require("@copilotkit/shared");
|
|
3377
4380
|
function useCoAgentStateRender(action, dependencies) {
|
|
3378
4381
|
const {
|
|
3379
4382
|
setCoAgentStateRender,
|
|
@@ -3381,13 +4384,13 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
3381
4384
|
coAgentStateRenders,
|
|
3382
4385
|
chatComponentsCache,
|
|
3383
4386
|
availableAgents
|
|
3384
|
-
} = (0,
|
|
3385
|
-
const idRef = (0,
|
|
4387
|
+
} = (0, import_react18.useContext)(CopilotContext);
|
|
4388
|
+
const idRef = (0, import_react18.useRef)((0, import_shared17.randomId)());
|
|
3386
4389
|
const { setBannerError, addToast } = useToast();
|
|
3387
|
-
(0,
|
|
4390
|
+
(0, import_react18.useEffect)(() => {
|
|
3388
4391
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === action.name)) {
|
|
3389
4392
|
const message = `(useCoAgentStateRender): Agent "${action.name}" not found. Make sure the agent exists and is properly configured.`;
|
|
3390
|
-
const agentError = new
|
|
4393
|
+
const agentError = new import_shared17.CopilotKitAgentDiscoveryError({
|
|
3391
4394
|
agentName: action.name,
|
|
3392
4395
|
availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
|
|
3393
4396
|
});
|
|
@@ -3405,7 +4408,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
3405
4408
|
}
|
|
3406
4409
|
}
|
|
3407
4410
|
}
|
|
3408
|
-
(0,
|
|
4411
|
+
(0, import_react18.useEffect)(() => {
|
|
3409
4412
|
const currentId = idRef.current;
|
|
3410
4413
|
const hasDuplicate = Object.entries(coAgentStateRenders).some(([id, otherAction]) => {
|
|
3411
4414
|
if (id === currentId)
|
|
@@ -3429,7 +4432,7 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
3429
4432
|
});
|
|
3430
4433
|
}
|
|
3431
4434
|
}, [coAgentStateRenders]);
|
|
3432
|
-
(0,
|
|
4435
|
+
(0, import_react18.useEffect)(() => {
|
|
3433
4436
|
setCoAgentStateRender(idRef.current, action);
|
|
3434
4437
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
3435
4438
|
chatComponentsCache.current.coAgentStateRenders[key] = action.render;
|
|
@@ -3449,12 +4452,12 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
3449
4452
|
}
|
|
3450
4453
|
|
|
3451
4454
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
3452
|
-
var
|
|
3453
|
-
function useMakeCopilotDocumentReadable(
|
|
4455
|
+
var import_react19 = require("react");
|
|
4456
|
+
function useMakeCopilotDocumentReadable(document2, categories, dependencies = []) {
|
|
3454
4457
|
const { addDocumentContext, removeDocumentContext } = useCopilotContext();
|
|
3455
|
-
const idRef = (0,
|
|
3456
|
-
(0,
|
|
3457
|
-
const id = addDocumentContext(
|
|
4458
|
+
const idRef = (0, import_react19.useRef)();
|
|
4459
|
+
(0, import_react19.useEffect)(() => {
|
|
4460
|
+
const id = addDocumentContext(document2, categories);
|
|
3458
4461
|
idRef.current = id;
|
|
3459
4462
|
return () => {
|
|
3460
4463
|
removeDocumentContext(id);
|
|
@@ -3464,7 +4467,7 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
|
|
|
3464
4467
|
}
|
|
3465
4468
|
|
|
3466
4469
|
// src/hooks/use-copilot-readable.ts
|
|
3467
|
-
var
|
|
4470
|
+
var import_react20 = require("react");
|
|
3468
4471
|
function convertToJSON(description, value) {
|
|
3469
4472
|
return `${description}: ${typeof value === "string" ? value : JSON.stringify(value)}`;
|
|
3470
4473
|
}
|
|
@@ -3477,10 +4480,10 @@ function useCopilotReadable({
|
|
|
3477
4480
|
available = "enabled"
|
|
3478
4481
|
}, dependencies) {
|
|
3479
4482
|
const { addContext, removeContext } = useCopilotContext();
|
|
3480
|
-
const idRef = (0,
|
|
4483
|
+
const idRef = (0, import_react20.useRef)();
|
|
3481
4484
|
convert = convert || convertToJSON;
|
|
3482
4485
|
const information = convert(description, value);
|
|
3483
|
-
(0,
|
|
4486
|
+
(0, import_react20.useEffect)(() => {
|
|
3484
4487
|
if (available === "disabled")
|
|
3485
4488
|
return;
|
|
3486
4489
|
const id = addContext(information, parentId, categories);
|
|
@@ -3493,20 +4496,20 @@ function useCopilotReadable({
|
|
|
3493
4496
|
}
|
|
3494
4497
|
|
|
3495
4498
|
// src/hooks/use-coagent.ts
|
|
3496
|
-
var
|
|
3497
|
-
var
|
|
4499
|
+
var import_react21 = require("react");
|
|
4500
|
+
var import_shared18 = require("@copilotkit/shared");
|
|
3498
4501
|
function useCoAgent(options) {
|
|
3499
4502
|
const context = useCopilotContext();
|
|
3500
4503
|
const { availableAgents } = context;
|
|
3501
4504
|
const { setBannerError } = useToast();
|
|
3502
|
-
const lastLoadedThreadId = (0,
|
|
3503
|
-
const lastLoadedState = (0,
|
|
4505
|
+
const lastLoadedThreadId = (0, import_react21.useRef)();
|
|
4506
|
+
const lastLoadedState = (0, import_react21.useRef)();
|
|
3504
4507
|
const { name } = options;
|
|
3505
|
-
(0,
|
|
4508
|
+
(0, import_react21.useEffect)(() => {
|
|
3506
4509
|
if ((availableAgents == null ? void 0 : availableAgents.length) && !availableAgents.some((a) => a.name === name)) {
|
|
3507
4510
|
const message = `(useCoAgent): Agent "${name}" not found. Make sure the agent exists and is properly configured.`;
|
|
3508
4511
|
console.warn(message);
|
|
3509
|
-
const agentError = new
|
|
4512
|
+
const agentError = new import_shared18.CopilotKitAgentDiscoveryError({
|
|
3510
4513
|
agentName: name,
|
|
3511
4514
|
availableAgents: availableAgents.map((a) => ({ name: a.name, id: a.id }))
|
|
3512
4515
|
});
|
|
@@ -3515,7 +4518,7 @@ function useCoAgent(options) {
|
|
|
3515
4518
|
}, [availableAgents]);
|
|
3516
4519
|
const { getMessagesFromTap } = useMessagesTap();
|
|
3517
4520
|
const { coagentStates, coagentStatesRef, setCoagentStatesWithRef, threadId, copilotApiConfig } = context;
|
|
3518
|
-
const {
|
|
4521
|
+
const { sendMessage, runChatCompletion } = useCopilotChat();
|
|
3519
4522
|
const headers = __spreadValues({}, copilotApiConfig.headers || {});
|
|
3520
4523
|
const runtimeClient = useCopilotRuntimeClient({
|
|
3521
4524
|
url: copilotApiConfig.chatApiEndpoint,
|
|
@@ -3524,7 +4527,7 @@ function useCoAgent(options) {
|
|
|
3524
4527
|
credentials: copilotApiConfig.credentials,
|
|
3525
4528
|
showDevConsole: context.showDevConsole
|
|
3526
4529
|
});
|
|
3527
|
-
const setState = (0,
|
|
4530
|
+
const setState = (0, import_react21.useCallback)(
|
|
3528
4531
|
(newState) => {
|
|
3529
4532
|
let coagentState = getCoagentState({ coagentStates, name, options });
|
|
3530
4533
|
const updatedState = typeof newState === "function" ? newState(coagentState.state) : newState;
|
|
@@ -3536,7 +4539,7 @@ function useCoAgent(options) {
|
|
|
3536
4539
|
},
|
|
3537
4540
|
[coagentStates, name]
|
|
3538
4541
|
);
|
|
3539
|
-
(0,
|
|
4542
|
+
(0, import_react21.useEffect)(() => {
|
|
3540
4543
|
const fetchAgentState = () => __async(this, null, function* () {
|
|
3541
4544
|
var _a, _b, _c, _d;
|
|
3542
4545
|
if (!threadId || threadId === lastLoadedThreadId.current)
|
|
@@ -3554,13 +4557,13 @@ function useCoAgent(options) {
|
|
|
3554
4557
|
if (((_d = (_c = result.data) == null ? void 0 : _c.loadAgentState) == null ? void 0 : _d.threadExists) && newState && newState != "{}") {
|
|
3555
4558
|
lastLoadedState.current = newState;
|
|
3556
4559
|
lastLoadedThreadId.current = threadId;
|
|
3557
|
-
const fetchedState = (0,
|
|
4560
|
+
const fetchedState = (0, import_shared18.parseJson)(newState, {});
|
|
3558
4561
|
isExternalStateManagement(options) ? options.setState(fetchedState) : setState(fetchedState);
|
|
3559
4562
|
}
|
|
3560
4563
|
});
|
|
3561
4564
|
void fetchAgentState();
|
|
3562
4565
|
}, [threadId]);
|
|
3563
|
-
(0,
|
|
4566
|
+
(0, import_react21.useEffect)(() => {
|
|
3564
4567
|
if (isExternalStateManagement(options)) {
|
|
3565
4568
|
setState(options.state);
|
|
3566
4569
|
} else if (coagentStates[name] === void 0) {
|
|
@@ -3571,7 +4574,7 @@ function useCoAgent(options) {
|
|
|
3571
4574
|
// reset initialstate on reset
|
|
3572
4575
|
coagentStates[name] === void 0
|
|
3573
4576
|
]);
|
|
3574
|
-
(0,
|
|
4577
|
+
(0, import_react21.useEffect)(() => {
|
|
3575
4578
|
const newConfig = options.config ? options.config : options.configurable ? { configurable: options.configurable } : void 0;
|
|
3576
4579
|
if (newConfig === void 0)
|
|
3577
4580
|
return;
|
|
@@ -3599,11 +4602,11 @@ function useCoAgent(options) {
|
|
|
3599
4602
|
}, [JSON.stringify(options.config), JSON.stringify(options.configurable)]);
|
|
3600
4603
|
const runAgentCallback = useAsyncCallback(
|
|
3601
4604
|
(hint) => __async(this, null, function* () {
|
|
3602
|
-
yield runAgent(name, context, getMessagesFromTap(),
|
|
4605
|
+
yield runAgent(name, context, getMessagesFromTap(), sendMessage, runChatCompletion, hint);
|
|
3603
4606
|
}),
|
|
3604
|
-
[name, context,
|
|
4607
|
+
[name, context, sendMessage, runChatCompletion]
|
|
3605
4608
|
);
|
|
3606
|
-
return (0,
|
|
4609
|
+
return (0, import_react21.useMemo)(() => {
|
|
3607
4610
|
const coagentState = getCoagentState({ coagentStates, name, options });
|
|
3608
4611
|
return {
|
|
3609
4612
|
name,
|
|
@@ -3643,7 +4646,7 @@ function stopAgent(name, context) {
|
|
|
3643
4646
|
console.warn(`No agent session found for ${name}`);
|
|
3644
4647
|
}
|
|
3645
4648
|
}
|
|
3646
|
-
function runAgent(name, context, messages,
|
|
4649
|
+
function runAgent(name, context, messages, sendMessage, runChatCompletion, hint) {
|
|
3647
4650
|
return __async(this, null, function* () {
|
|
3648
4651
|
var _a, _b;
|
|
3649
4652
|
const { agentSession, setAgentSession } = context;
|
|
@@ -3663,7 +4666,7 @@ function runAgent(name, context, messages, appendMessage, runChatCompletion, hin
|
|
|
3663
4666
|
if (hint) {
|
|
3664
4667
|
const hintMessage = hint({ previousState, currentState: state });
|
|
3665
4668
|
if (hintMessage) {
|
|
3666
|
-
yield
|
|
4669
|
+
yield sendMessage(hintMessage);
|
|
3667
4670
|
} else {
|
|
3668
4671
|
yield runChatCompletion();
|
|
3669
4672
|
}
|
|
@@ -3700,28 +4703,28 @@ var getCoagentState = ({
|
|
|
3700
4703
|
};
|
|
3701
4704
|
|
|
3702
4705
|
// src/hooks/use-copilot-authenticated-action.ts
|
|
3703
|
-
var
|
|
3704
|
-
var
|
|
4706
|
+
var import_react22 = require("react");
|
|
4707
|
+
var import_react23 = __toESM(require("react"));
|
|
3705
4708
|
function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
3706
4709
|
const { authConfig_c, authStates_c, setAuthStates_c } = useCopilotContext();
|
|
3707
|
-
const pendingActionRef = (0,
|
|
3708
|
-
const executeAction2 = (0,
|
|
4710
|
+
const pendingActionRef = (0, import_react22.useRef)(null);
|
|
4711
|
+
const executeAction2 = (0, import_react22.useCallback)(
|
|
3709
4712
|
(props) => {
|
|
3710
4713
|
if (typeof action.render === "function") {
|
|
3711
4714
|
return action.render(props);
|
|
3712
4715
|
}
|
|
3713
|
-
return action.render ||
|
|
4716
|
+
return action.render || import_react23.default.createElement(import_react22.Fragment);
|
|
3714
4717
|
},
|
|
3715
4718
|
[action]
|
|
3716
4719
|
);
|
|
3717
|
-
const wrappedRender = (0,
|
|
4720
|
+
const wrappedRender = (0, import_react22.useCallback)(
|
|
3718
4721
|
(props) => {
|
|
3719
4722
|
const isAuthenticated = Object.values(authStates_c || {}).some(
|
|
3720
4723
|
(state) => state.status === "authenticated"
|
|
3721
4724
|
);
|
|
3722
4725
|
if (!isAuthenticated) {
|
|
3723
4726
|
pendingActionRef.current = props;
|
|
3724
|
-
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ?
|
|
4727
|
+
return (authConfig_c == null ? void 0 : authConfig_c.SignInComponent) ? import_react23.default.createElement(authConfig_c.SignInComponent, {
|
|
3725
4728
|
onSignInComplete: (authState) => {
|
|
3726
4729
|
setAuthStates_c == null ? void 0 : setAuthStates_c((prev) => __spreadProps(__spreadValues({}, prev), { [action.name]: authState }));
|
|
3727
4730
|
if (pendingActionRef.current) {
|
|
@@ -3729,7 +4732,7 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
3729
4732
|
pendingActionRef.current = null;
|
|
3730
4733
|
}
|
|
3731
4734
|
}
|
|
3732
|
-
}) :
|
|
4735
|
+
}) : import_react23.default.createElement(import_react22.Fragment);
|
|
3733
4736
|
}
|
|
3734
4737
|
return executeAction2(props);
|
|
3735
4738
|
},
|
|
@@ -3744,29 +4747,29 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
3744
4747
|
}
|
|
3745
4748
|
|
|
3746
4749
|
// src/hooks/use-langgraph-interrupt.ts
|
|
3747
|
-
var
|
|
3748
|
-
var
|
|
4750
|
+
var import_react24 = require("react");
|
|
4751
|
+
var import_shared19 = require("@copilotkit/shared");
|
|
3749
4752
|
function useLangGraphInterrupt(action, dependencies) {
|
|
3750
4753
|
var _a;
|
|
3751
|
-
const { setLangGraphInterruptAction, removeLangGraphInterruptAction, langGraphInterruptAction } = (0,
|
|
4754
|
+
const { setLangGraphInterruptAction, removeLangGraphInterruptAction, langGraphInterruptAction } = (0, import_react24.useContext)(CopilotContext);
|
|
3752
4755
|
const { runChatCompletion } = useCopilotChat();
|
|
3753
4756
|
const { addToast } = useToast();
|
|
3754
|
-
const actionId = (0,
|
|
3755
|
-
const hasAction = (0,
|
|
4757
|
+
const actionId = (0, import_shared19.dataToUUID)(JSON.stringify(action), "lgAction");
|
|
4758
|
+
const hasAction = (0, import_react24.useMemo)(
|
|
3756
4759
|
() => Boolean(langGraphInterruptAction == null ? void 0 : langGraphInterruptAction.id),
|
|
3757
4760
|
[langGraphInterruptAction]
|
|
3758
4761
|
);
|
|
3759
|
-
const isCurrentAction = (0,
|
|
4762
|
+
const isCurrentAction = (0, import_react24.useMemo)(
|
|
3760
4763
|
() => (langGraphInterruptAction == null ? void 0 : langGraphInterruptAction.id) && (langGraphInterruptAction == null ? void 0 : langGraphInterruptAction.id) === actionId,
|
|
3761
4764
|
[langGraphInterruptAction]
|
|
3762
4765
|
);
|
|
3763
|
-
(0,
|
|
4766
|
+
(0, import_react24.useEffect)(() => {
|
|
3764
4767
|
var _a2;
|
|
3765
4768
|
if (hasAction && isCurrentAction && ((_a2 = langGraphInterruptAction == null ? void 0 : langGraphInterruptAction.event) == null ? void 0 : _a2.response)) {
|
|
3766
4769
|
runChatCompletion();
|
|
3767
4770
|
}
|
|
3768
4771
|
}, [(_a = langGraphInterruptAction == null ? void 0 : langGraphInterruptAction.event) == null ? void 0 : _a.response, runChatCompletion, hasAction, isCurrentAction]);
|
|
3769
|
-
(0,
|
|
4772
|
+
(0, import_react24.useEffect)(() => {
|
|
3770
4773
|
if (!action)
|
|
3771
4774
|
return;
|
|
3772
4775
|
if (hasAction && !isCurrentAction && !action.enabled) {
|
|
@@ -3791,10 +4794,10 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
3791
4794
|
}
|
|
3792
4795
|
|
|
3793
4796
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
3794
|
-
var
|
|
4797
|
+
var import_react25 = require("react");
|
|
3795
4798
|
function useCopilotAdditionalInstructions({ instructions, available = "enabled" }, dependencies) {
|
|
3796
4799
|
const { setAdditionalInstructions } = useCopilotContext();
|
|
3797
|
-
(0,
|
|
4800
|
+
(0, import_react25.useEffect)(() => {
|
|
3798
4801
|
if (available === "disabled")
|
|
3799
4802
|
return;
|
|
3800
4803
|
setAdditionalInstructions((prevInstructions) => [...prevInstructions || [], instructions]);
|
|
@@ -3922,8 +4925,8 @@ ${instructions}
|
|
|
3922
4925
|
useCopilotAdditionalInstructions,
|
|
3923
4926
|
useCopilotAuthenticatedAction_c,
|
|
3924
4927
|
useCopilotChat,
|
|
4928
|
+
useCopilotChatHeadless_c,
|
|
3925
4929
|
useCopilotChatInternal,
|
|
3926
|
-
useCopilotChatLight,
|
|
3927
4930
|
useCopilotContext,
|
|
3928
4931
|
useCopilotMessagesContext,
|
|
3929
4932
|
useCopilotReadable,
|