@copilotkit/react-core 1.60.1 → 1.61.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/dist/{copilotkit-CV519nFv.mjs → copilotkit-BCxdKlMw.mjs} +60 -153
- package/dist/copilotkit-BCxdKlMw.mjs.map +1 -0
- package/dist/{copilotkit-C9ptuh-b.d.cts → copilotkit-CEdu_aie.d.cts} +29 -7
- package/dist/{copilotkit-DvbI8G0d.d.mts.map → copilotkit-CEdu_aie.d.cts.map} +1 -1
- package/dist/{copilotkit-BTHcCAVQ.cjs → copilotkit-DtPCrXXd.cjs} +60 -153
- package/dist/copilotkit-DtPCrXXd.cjs.map +1 -0
- package/dist/{copilotkit-DvbI8G0d.d.mts → copilotkit-M1FiciGd.d.mts} +29 -7
- package/dist/{copilotkit-C9ptuh-b.d.cts.map → copilotkit-M1FiciGd.d.mts.map} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +61 -149
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/context.cjs +8 -3
- package/dist/v2/context.cjs.map +1 -1
- package/dist/v2/context.d.cts.map +1 -1
- package/dist/v2/context.d.mts.map +1 -1
- package/dist/v2/context.mjs +8 -3
- package/dist/v2/context.mjs.map +1 -1
- package/dist/v2/headless.cjs +23 -12
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +25 -3
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +25 -3
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +24 -13
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.css +1 -1
- package/dist/v2/index.d.cts +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +59 -152
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/dist/copilotkit-BTHcCAVQ.cjs.map +0 -1
- package/dist/copilotkit-CV519nFv.mjs.map +0 -1
|
@@ -1398,9 +1398,14 @@ const useCopilotKit = () => {
|
|
|
1398
1398
|
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
1399
1399
|
if (!context) throw new Error("useCopilotKit must be used within CopilotKitProvider");
|
|
1400
1400
|
useEffect(() => {
|
|
1401
|
-
const subscription = context.copilotkit.subscribe({
|
|
1402
|
-
|
|
1403
|
-
|
|
1401
|
+
const subscription = context.copilotkit.subscribe({
|
|
1402
|
+
onRuntimeConnectionStatusChanged: () => {
|
|
1403
|
+
forceUpdate();
|
|
1404
|
+
},
|
|
1405
|
+
onHeadersChanged: () => {
|
|
1406
|
+
forceUpdate();
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1404
1409
|
return () => {
|
|
1405
1410
|
subscription.unsubscribe();
|
|
1406
1411
|
};
|
|
@@ -1607,9 +1612,8 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
|
|
|
1607
1612
|
const isActive = status === "inProgress" || status === "executing";
|
|
1608
1613
|
const isComplete = status === "complete";
|
|
1609
1614
|
const statusLabel = isActive ? "Running" : isComplete ? "Done" : status;
|
|
1610
|
-
const
|
|
1611
|
-
const
|
|
1612
|
-
const badgeColor = isActive ? "#92400e" : isComplete ? "#065f46" : "#3f3f46";
|
|
1615
|
+
const dotClassName = isActive ? "cpk:bg-amber-500" : isComplete ? "cpk:bg-emerald-500" : "cpk:bg-zinc-400";
|
|
1616
|
+
const badgeClassName = isActive ? "cpk:bg-amber-100 cpk:text-amber-800 cpk:dark:bg-amber-500/15 cpk:dark:text-amber-400" : isComplete ? "cpk:bg-emerald-100 cpk:text-emerald-800 cpk:dark:bg-emerald-500/15 cpk:dark:text-emerald-400" : "cpk:bg-zinc-100 cpk:text-zinc-800 cpk:dark:bg-zinc-700/40 cpk:dark:text-zinc-300";
|
|
1613
1617
|
return /* @__PURE__ */ jsx("div", {
|
|
1614
1618
|
"data-testid": "copilot-tool-render",
|
|
1615
1619
|
"data-tool-name": name,
|
|
@@ -1617,54 +1621,20 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
|
|
|
1617
1621
|
"data-status": status,
|
|
1618
1622
|
"data-args": safeStringifyForAttr(parameters),
|
|
1619
1623
|
"data-result": safeStringifyForAttr(result),
|
|
1620
|
-
|
|
1621
|
-
marginTop: "8px",
|
|
1622
|
-
paddingBottom: "8px"
|
|
1623
|
-
},
|
|
1624
|
+
className: "cpk:mt-2 cpk:pb-2",
|
|
1624
1625
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1625
|
-
|
|
1626
|
-
borderRadius: "12px",
|
|
1627
|
-
border: "1px solid #e4e4e7",
|
|
1628
|
-
backgroundColor: "#fafafa",
|
|
1629
|
-
padding: "14px 16px"
|
|
1630
|
-
},
|
|
1626
|
+
className: "cpk:rounded-xl cpk:border cpk:border-zinc-200/60 cpk:bg-white/70 cpk:p-4 cpk:shadow-sm cpk:backdrop-blur cpk:dark:border-zinc-800/60 cpk:dark:bg-zinc-900/50",
|
|
1631
1627
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
1632
1628
|
type: "button",
|
|
1633
1629
|
"aria-expanded": isExpanded,
|
|
1634
1630
|
onClick: () => setIsExpanded(!isExpanded),
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
alignItems: "center",
|
|
1638
|
-
justifyContent: "space-between",
|
|
1639
|
-
gap: "10px",
|
|
1640
|
-
cursor: "pointer",
|
|
1641
|
-
userSelect: "none",
|
|
1642
|
-
width: "100%",
|
|
1643
|
-
border: "none",
|
|
1644
|
-
padding: 0,
|
|
1645
|
-
margin: 0,
|
|
1646
|
-
background: "transparent",
|
|
1647
|
-
textAlign: "left",
|
|
1648
|
-
font: "inherit",
|
|
1649
|
-
color: "inherit"
|
|
1650
|
-
},
|
|
1631
|
+
className: "cpk:flex cpk:w-full cpk:cursor-pointer cpk:select-none cpk:items-center cpk:justify-between cpk:gap-2.5 cpk:border-none cpk:bg-transparent cpk:p-0 cpk:m-0 cpk:text-left cpk:text-inherit",
|
|
1632
|
+
style: { font: "inherit" },
|
|
1651
1633
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1652
|
-
|
|
1653
|
-
display: "flex",
|
|
1654
|
-
alignItems: "center",
|
|
1655
|
-
gap: "8px",
|
|
1656
|
-
minWidth: 0
|
|
1657
|
-
},
|
|
1634
|
+
className: "cpk:flex cpk:min-w-0 cpk:items-center cpk:gap-2",
|
|
1658
1635
|
children: [
|
|
1659
1636
|
/* @__PURE__ */ jsx("svg", {
|
|
1660
|
-
|
|
1661
|
-
height: "14px",
|
|
1662
|
-
width: "14px",
|
|
1663
|
-
color: "#71717a",
|
|
1664
|
-
transition: "transform 0.15s",
|
|
1665
|
-
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
|
|
1666
|
-
flexShrink: 0
|
|
1667
|
-
},
|
|
1637
|
+
className: `cpk:h-3.5 cpk:w-3.5 cpk:flex-shrink-0 cpk:text-zinc-500 cpk:transition-transform cpk:dark:text-zinc-400 ${isExpanded ? "cpk:rotate-90" : ""}`,
|
|
1668
1638
|
fill: "none",
|
|
1669
1639
|
viewBox: "0 0 24 24",
|
|
1670
1640
|
strokeWidth: 2,
|
|
@@ -1675,93 +1645,31 @@ function DefaultToolCallRenderer({ name, toolCallId, parameters, status, result
|
|
|
1675
1645
|
d: "M8.25 4.5l7.5 7.5-7.5 7.5"
|
|
1676
1646
|
})
|
|
1677
1647
|
}),
|
|
1678
|
-
/* @__PURE__ */ jsx("span", {
|
|
1679
|
-
display: "inline-block",
|
|
1680
|
-
height: "8px",
|
|
1681
|
-
width: "8px",
|
|
1682
|
-
borderRadius: "50%",
|
|
1683
|
-
backgroundColor: dotColor,
|
|
1684
|
-
flexShrink: 0
|
|
1685
|
-
} }),
|
|
1648
|
+
/* @__PURE__ */ jsx("span", { className: `cpk:inline-block cpk:h-2 cpk:w-2 cpk:flex-shrink-0 cpk:rounded-full ${dotClassName}` }),
|
|
1686
1649
|
/* @__PURE__ */ jsx("span", {
|
|
1687
1650
|
"data-testid": "copilot-tool-render-name",
|
|
1688
|
-
|
|
1689
|
-
fontSize: "13px",
|
|
1690
|
-
fontWeight: 600,
|
|
1691
|
-
color: "#18181b",
|
|
1692
|
-
overflow: "hidden",
|
|
1693
|
-
textOverflow: "ellipsis",
|
|
1694
|
-
whiteSpace: "nowrap"
|
|
1695
|
-
},
|
|
1651
|
+
className: "cpk:truncate cpk:text-[13px] cpk:font-semibold cpk:text-zinc-900 cpk:dark:text-zinc-100",
|
|
1696
1652
|
children: name
|
|
1697
1653
|
})
|
|
1698
1654
|
]
|
|
1699
1655
|
}), /* @__PURE__ */ jsx("span", {
|
|
1700
1656
|
"data-testid": "copilot-tool-render-status",
|
|
1701
|
-
|
|
1702
|
-
display: "inline-flex",
|
|
1703
|
-
alignItems: "center",
|
|
1704
|
-
borderRadius: "9999px",
|
|
1705
|
-
padding: "2px 8px",
|
|
1706
|
-
fontSize: "11px",
|
|
1707
|
-
fontWeight: 500,
|
|
1708
|
-
backgroundColor: badgeBg,
|
|
1709
|
-
color: badgeColor,
|
|
1710
|
-
flexShrink: 0
|
|
1711
|
-
},
|
|
1657
|
+
className: `cpk:inline-flex cpk:flex-shrink-0 cpk:items-center cpk:rounded-full cpk:px-2 cpk:py-0.5 cpk:text-[11px] cpk:font-medium ${badgeClassName}`,
|
|
1712
1658
|
children: statusLabel
|
|
1713
1659
|
})]
|
|
1714
1660
|
}), isExpanded && /* @__PURE__ */ jsxs("div", {
|
|
1715
|
-
|
|
1716
|
-
marginTop: "12px",
|
|
1717
|
-
display: "grid",
|
|
1718
|
-
gap: "12px"
|
|
1719
|
-
},
|
|
1661
|
+
className: "cpk:mt-3 cpk:grid cpk:gap-3",
|
|
1720
1662
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
1721
|
-
|
|
1722
|
-
fontSize: "10px",
|
|
1723
|
-
textTransform: "uppercase",
|
|
1724
|
-
letterSpacing: "0.05em",
|
|
1725
|
-
color: "#71717a"
|
|
1726
|
-
},
|
|
1663
|
+
className: "cpk:text-[10px] cpk:uppercase cpk:text-zinc-500 cpk:dark:text-zinc-400",
|
|
1727
1664
|
children: "Arguments"
|
|
1728
1665
|
}), /* @__PURE__ */ jsx("pre", {
|
|
1729
|
-
|
|
1730
|
-
marginTop: "6px",
|
|
1731
|
-
maxHeight: "200px",
|
|
1732
|
-
overflow: "auto",
|
|
1733
|
-
borderRadius: "6px",
|
|
1734
|
-
backgroundColor: "#f4f4f5",
|
|
1735
|
-
padding: "10px",
|
|
1736
|
-
fontSize: "11px",
|
|
1737
|
-
lineHeight: 1.6,
|
|
1738
|
-
color: "#27272a",
|
|
1739
|
-
whiteSpace: "pre-wrap",
|
|
1740
|
-
wordBreak: "break-word"
|
|
1741
|
-
},
|
|
1666
|
+
className: "cpk:mt-1.5 cpk:max-h-[200px] cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-100 cpk:p-2.5 cpk:text-[11px] cpk:leading-relaxed cpk:text-zinc-800 cpk:whitespace-pre-wrap cpk:break-words cpk:dark:bg-zinc-800/60 cpk:dark:text-zinc-200",
|
|
1742
1667
|
children: safeStringifyForPre(parameters ?? {})
|
|
1743
1668
|
})] }), result !== void 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
1744
|
-
|
|
1745
|
-
fontSize: "10px",
|
|
1746
|
-
textTransform: "uppercase",
|
|
1747
|
-
letterSpacing: "0.05em",
|
|
1748
|
-
color: "#71717a"
|
|
1749
|
-
},
|
|
1669
|
+
className: "cpk:text-[10px] cpk:uppercase cpk:text-zinc-500 cpk:dark:text-zinc-400",
|
|
1750
1670
|
children: "Result"
|
|
1751
1671
|
}), /* @__PURE__ */ jsx("pre", {
|
|
1752
|
-
|
|
1753
|
-
marginTop: "6px",
|
|
1754
|
-
maxHeight: "200px",
|
|
1755
|
-
overflow: "auto",
|
|
1756
|
-
borderRadius: "6px",
|
|
1757
|
-
backgroundColor: "#f4f4f5",
|
|
1758
|
-
padding: "10px",
|
|
1759
|
-
fontSize: "11px",
|
|
1760
|
-
lineHeight: 1.6,
|
|
1761
|
-
color: "#27272a",
|
|
1762
|
-
whiteSpace: "pre-wrap",
|
|
1763
|
-
wordBreak: "break-word"
|
|
1764
|
-
},
|
|
1672
|
+
className: "cpk:mt-1.5 cpk:max-h-[200px] cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-100 cpk:p-2.5 cpk:text-[11px] cpk:leading-relaxed cpk:text-zinc-800 cpk:whitespace-pre-wrap cpk:break-words cpk:dark:bg-zinc-800/60 cpk:dark:text-zinc-200",
|
|
1765
1673
|
children: typeof result === "string" ? result : safeStringifyForPre(result)
|
|
1766
1674
|
})] })]
|
|
1767
1675
|
})]
|
|
@@ -3704,6 +3612,10 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3704
3612
|
...selfManagedAgents
|
|
3705
3613
|
}), [agents, selfManagedAgents]);
|
|
3706
3614
|
const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
|
|
3615
|
+
const hasSelfManagedAgents = Object.keys(selfManagedAgents).length > 0;
|
|
3616
|
+
useEffect(() => {
|
|
3617
|
+
if (hasSelfManagedAgents && !resolvedPublicKey) console.warn("[CopilotKit] `selfManagedAgents` is part of CopilotKit's Enterprise Intelligence offering. Provide a `publicLicenseKey` for production use — contact the CopilotKit team about licensing.");
|
|
3618
|
+
}, [hasSelfManagedAgents, resolvedPublicKey]);
|
|
3707
3619
|
const headers = typeof headersProp === "function" ? headersProp() : headersProp;
|
|
3708
3620
|
const mergedHeaders = useMemo(() => {
|
|
3709
3621
|
if (!resolvedPublicKey) return headers;
|
|
@@ -4181,36 +4093,40 @@ function useHumanInTheLoop(tool, deps) {
|
|
|
4181
4093
|
}, []);
|
|
4182
4094
|
const RenderComponent = useCallback((props) => {
|
|
4183
4095
|
const ToolComponent = tool.render;
|
|
4184
|
-
if (props.status ===
|
|
4096
|
+
if (props.status === ToolCallStatus.InProgress) {
|
|
4185
4097
|
const enhancedProps = {
|
|
4186
4098
|
...props,
|
|
4187
4099
|
name: tool.name,
|
|
4188
4100
|
description: tool.description || "",
|
|
4101
|
+
agentId: tool.agentId,
|
|
4189
4102
|
respond: void 0
|
|
4190
4103
|
};
|
|
4191
4104
|
return React.createElement(ToolComponent, enhancedProps);
|
|
4192
|
-
} else if (props.status ===
|
|
4105
|
+
} else if (props.status === ToolCallStatus.Executing) {
|
|
4193
4106
|
const enhancedProps = {
|
|
4194
4107
|
...props,
|
|
4195
4108
|
name: tool.name,
|
|
4196
4109
|
description: tool.description || "",
|
|
4110
|
+
agentId: tool.agentId,
|
|
4197
4111
|
respond
|
|
4198
4112
|
};
|
|
4199
4113
|
return React.createElement(ToolComponent, enhancedProps);
|
|
4200
|
-
} else if (props.status ===
|
|
4114
|
+
} else if (props.status === ToolCallStatus.Complete) {
|
|
4201
4115
|
const enhancedProps = {
|
|
4202
4116
|
...props,
|
|
4203
4117
|
name: tool.name,
|
|
4204
4118
|
description: tool.description || "",
|
|
4119
|
+
agentId: tool.agentId,
|
|
4205
4120
|
respond: void 0
|
|
4206
4121
|
};
|
|
4207
4122
|
return React.createElement(ToolComponent, enhancedProps);
|
|
4208
4123
|
}
|
|
4209
|
-
return
|
|
4124
|
+
return props;
|
|
4210
4125
|
}, [
|
|
4211
4126
|
tool.render,
|
|
4212
4127
|
tool.name,
|
|
4213
4128
|
tool.description,
|
|
4129
|
+
tool.agentId,
|
|
4214
4130
|
respond
|
|
4215
4131
|
]);
|
|
4216
4132
|
useFrontendTool({
|
|
@@ -4701,18 +4617,25 @@ function useInterrupt(config) {
|
|
|
4701
4617
|
},
|
|
4702
4618
|
onRunFailed: () => {
|
|
4703
4619
|
localInterrupt = null;
|
|
4620
|
+
setPendingEvent(null);
|
|
4704
4621
|
}
|
|
4705
4622
|
});
|
|
4706
4623
|
return () => subscription.unsubscribe();
|
|
4707
4624
|
}, [agent]);
|
|
4708
|
-
const resolve = useCallback((response) => {
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4625
|
+
const resolve = useCallback(async (response) => {
|
|
4626
|
+
try {
|
|
4627
|
+
return await copilotkit.runAgent({
|
|
4628
|
+
agent,
|
|
4629
|
+
forwardedProps: { command: {
|
|
4630
|
+
resume: response,
|
|
4631
|
+
interruptEvent: pendingEventRef.current?.value
|
|
4632
|
+
} }
|
|
4633
|
+
});
|
|
4634
|
+
} catch (err) {
|
|
4635
|
+
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
4636
|
+
setPendingEvent(null);
|
|
4637
|
+
throw err;
|
|
4638
|
+
}
|
|
4716
4639
|
}, [agent, copilotkit]);
|
|
4717
4640
|
const renderRef = useRef(config.render);
|
|
4718
4641
|
renderRef.current = config.render;
|
|
@@ -7081,7 +7004,6 @@ const LastUserMessageContext = React.createContext({
|
|
|
7081
7004
|
function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
|
|
7082
7005
|
const { id, sendNonce } = useContext(LastUserMessageContext);
|
|
7083
7006
|
const lastNonceRef = useRef(-1);
|
|
7084
|
-
const currentSpacerHeightRef = useRef(0);
|
|
7085
7007
|
useEffect(() => {
|
|
7086
7008
|
if (sendNonce === lastNonceRef.current) return;
|
|
7087
7009
|
lastNonceRef.current = sendNonce;
|
|
@@ -7099,7 +7021,6 @@ function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
|
|
|
7099
7021
|
const bubbleHeight = Math.max(0, userMessageHeight - paddingTop);
|
|
7100
7022
|
const spacerHeight = Math.max(0, viewportHeight - bubbleHeight - topOffset);
|
|
7101
7023
|
spacerEl.style.height = `${spacerHeight}px`;
|
|
7102
|
-
currentSpacerHeightRef.current = spacerHeight;
|
|
7103
7024
|
const raf = requestAnimationFrame(() => {
|
|
7104
7025
|
const targetTop = computeOffsetTop(targetEl, scrollEl) + paddingTop - topOffset;
|
|
7105
7026
|
scrollEl.scrollTo({
|
|
@@ -7111,10 +7032,7 @@ function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
|
|
|
7111
7032
|
if (!contentEl || !spacerEl || !scrollEl) return;
|
|
7112
7033
|
const consumedBelow = contentEl.getBoundingClientRect().height - computeOffsetTop(targetEl, contentEl) - userMessageHeight;
|
|
7113
7034
|
const remaining = Math.max(0, spacerHeight - consumedBelow);
|
|
7114
|
-
|
|
7115
|
-
spacerEl.style.height = `${remaining}px`;
|
|
7116
|
-
currentSpacerHeightRef.current = remaining;
|
|
7117
|
-
}
|
|
7035
|
+
spacerEl.style.height = `${remaining}px`;
|
|
7118
7036
|
});
|
|
7119
7037
|
ro.observe(contentEl);
|
|
7120
7038
|
return () => {
|
|
@@ -7408,7 +7326,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
|
|
|
7408
7326
|
}, []);
|
|
7409
7327
|
useEffect(() => {
|
|
7410
7328
|
if (mode === "pin-to-bottom") return;
|
|
7411
|
-
const scrollElement =
|
|
7329
|
+
const scrollElement = nonAutoScrollEl;
|
|
7412
7330
|
if (!scrollElement) return;
|
|
7413
7331
|
const checkScroll = () => {
|
|
7414
7332
|
setShowScrollButton(!(scrollElement.scrollHeight - scrollElement.scrollTop - scrollElement.clientHeight < 10));
|
|
@@ -7421,7 +7339,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
|
|
|
7421
7339
|
scrollElement.removeEventListener("scroll", checkScroll);
|
|
7422
7340
|
resizeObserver.disconnect();
|
|
7423
7341
|
};
|
|
7424
|
-
}, [
|
|
7342
|
+
}, [nonAutoScrollEl, mode]);
|
|
7425
7343
|
if (!hasMounted) return /* @__PURE__ */ jsx("div", {
|
|
7426
7344
|
className: "cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:overflow-y-auto cpk:overflow-x-hidden",
|
|
7427
7345
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -10170,21 +10088,6 @@ function CopilotListeners() {
|
|
|
10170
10088
|
|
|
10171
10089
|
//#endregion
|
|
10172
10090
|
//#region src/components/copilot-provider/copilotkit.tsx
|
|
10173
|
-
/**
|
|
10174
|
-
* This component will typically wrap your entire application (or a sub-tree of your application where you want to have a copilot). It provides the copilot context to all other components and hooks.
|
|
10175
|
-
*
|
|
10176
|
-
* ## Example
|
|
10177
|
-
*
|
|
10178
|
-
* You can find more information about self-hosting CopilotKit [here](/guides/self-hosting).
|
|
10179
|
-
*
|
|
10180
|
-
* ```tsx
|
|
10181
|
-
* import { CopilotKit } from "@copilotkit/react-core";
|
|
10182
|
-
*
|
|
10183
|
-
* <CopilotKit runtimeUrl="<your-runtime-url>">
|
|
10184
|
-
* // ... your app ...
|
|
10185
|
-
* </CopilotKit>
|
|
10186
|
-
* ```
|
|
10187
|
-
*/
|
|
10188
10091
|
function CopilotKit({ children, ...props }) {
|
|
10189
10092
|
const enabled = shouldShowDevConsole(props.showDevConsole);
|
|
10190
10093
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
@@ -10673,10 +10576,14 @@ function formatFeatureName(featureName) {
|
|
|
10673
10576
|
function validateProps(props) {
|
|
10674
10577
|
const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
|
|
10675
10578
|
const hasApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
10676
|
-
|
|
10579
|
+
const hasLocalAgents = Object.keys({
|
|
10580
|
+
...props.agents__unsafe_dev_only,
|
|
10581
|
+
...props.selfManagedAgents
|
|
10582
|
+
}).length > 0;
|
|
10583
|
+
if (!props.runtimeUrl && !hasApiKey && !hasLocalAgents) throw new ConfigurationError("Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'");
|
|
10677
10584
|
if (cloudFeatures.length > 0 && !hasApiKey) throw new MissingPublicApiKeyError(`Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`);
|
|
10678
10585
|
}
|
|
10679
10586
|
|
|
10680
10587
|
//#endregion
|
|
10681
10588
|
export { useAgent as $, INTELLIGENCE_TURN_HEAD as A, CopilotChatToolCallsView as B, CopilotChatToggleButton as C, useCopilotChatConfiguration as Ct, CopilotChatView_default as D, CopilotChat as E, CopilotChatSuggestionPill as F, useLearnFromUserAction as G, useLearningContainers as H, CopilotChatReasoningMessage_default as I, useConfigureSuggestions as J, useThreads$1 as K, CopilotChatUserMessage_default as L, getIntelligenceTurnAnchors as M, IntelligenceIndicatorView as N, CopilotChatAttachmentQueue as O, CopilotChatSuggestionView as P, UseAgentUpdate as Q, CopilotChatAttachmentRenderer as R, CopilotModalHeader as S, CopilotChatConfigurationProvider as St, DefaultOpenIcon as T, useAttachments as U, useLearningContainersInCurrentThread as V, useLearnFromUserActionInCurrentThread as W, useAgentContext as X, useSuggestions as Y, useCapabilities as Z, WildcardToolCallRender as _, useCopilotKit as _t, ThreadsProvider as a, CopilotKitProvider as at, CopilotPopupView as b, AudioRecorderError as bt, CoAgentStateRendersProvider as c, useSandboxFunctions as ct, shouldShowDevConsole as d, MCPAppsActivityType as dt, useHumanInTheLoop as et, useToast as f, CopilotKitInspector as ft, useCopilotContext as g, defineToolCallRenderer as gt, CopilotContext as h, useRenderTool as ht, ThreadsContext as i, useRenderCustomMessages as it, IntelligenceIndicator as j, CopilotChatMessageView as k, useCoAgentStateRenders as l, MCPAppsActivityContentSchema as lt, useCopilotMessagesContext as m, useDefaultRenderTool as mt, defaultCopilotContextCategories as n, useFrontendTool as nt, useThreads as o, createA2UIMessageRenderer as ot, CopilotMessagesContext as p, useRenderToolCall as pt, useInterrupt as q, CoAgentStateRenderBridge as r, useRenderActivityMessage as rt, CoAgentStateRendersContext as s, SandboxFunctionsContext as st, CopilotKit as t, useComponent as tt, useAsyncCallback as u, MCPAppsActivityRenderer as ut, CopilotPopup as v, CopilotKitCoreReact as vt, DefaultCloseIcon as w, CopilotSidebarView as x, CopilotChatAudioRecorder as xt, CopilotSidebar as y, CopilotChatInput_default as yt, CopilotChatAssistantMessage_default as z };
|
|
10682
|
-
//# sourceMappingURL=copilotkit-
|
|
10589
|
+
//# sourceMappingURL=copilotkit-BCxdKlMw.mjs.map
|