@copilotkitnext/react 1.52.0-next.8 → 1.52.1-next.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/index.umd.js +9 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/providers/CopilotKitProvider.cjs +9 -5
- package/dist/providers/CopilotKitProvider.cjs.map +1 -1
- package/dist/providers/CopilotKitProvider.d.cts +1 -0
- package/dist/providers/CopilotKitProvider.d.cts.map +1 -1
- package/dist/providers/CopilotKitProvider.d.mts +1 -0
- package/dist/providers/CopilotKitProvider.d.mts.map +1 -1
- package/dist/providers/CopilotKitProvider.mjs +9 -5
- package/dist/providers/CopilotKitProvider.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1865,7 +1865,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1865
1865
|
}, [value, warningMessage]);
|
|
1866
1866
|
return value;
|
|
1867
1867
|
}
|
|
1868
|
-
const CopilotKitProvider = ({ children, runtimeUrl, headers = {}, credentials, publicApiKey, publicLicenseKey, properties = {}, agents__unsafe_dev_only: agents = {}, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, showDevConsole = false, useSingleEndpoint = false }) => {
|
|
1868
|
+
const CopilotKitProvider = ({ children, runtimeUrl, headers = {}, credentials, publicApiKey, publicLicenseKey, properties = {}, agents__unsafe_dev_only: agents = {}, selfManagedAgents = {}, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, showDevConsole = false, useSingleEndpoint = false }) => {
|
|
1869
1869
|
const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
|
|
1870
1870
|
(0, react.useEffect)(() => {
|
|
1871
1871
|
if (typeof window === "undefined") return;
|
|
@@ -1897,7 +1897,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1897
1897
|
return [...renderActivityMessagesList, ...builtInActivityRenderers];
|
|
1898
1898
|
}, [renderActivityMessagesList, builtInActivityRenderers]);
|
|
1899
1899
|
const resolvedPublicKey = publicApiKey !== null && publicApiKey !== void 0 ? publicApiKey : publicLicenseKey;
|
|
1900
|
-
const
|
|
1900
|
+
const mergedAgents = (0, react.useMemo)(() => ({
|
|
1901
|
+
...agents,
|
|
1902
|
+
...selfManagedAgents
|
|
1903
|
+
}), [agents, selfManagedAgents]);
|
|
1904
|
+
const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
|
|
1901
1905
|
const mergedHeaders = (0, react.useMemo)(() => {
|
|
1902
1906
|
if (!resolvedPublicKey) return headers;
|
|
1903
1907
|
if (headers[HEADER_NAME]) return headers;
|
|
@@ -1976,7 +1980,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
1976
1980
|
headers: mergedHeaders,
|
|
1977
1981
|
credentials,
|
|
1978
1982
|
properties,
|
|
1979
|
-
agents__unsafe_dev_only:
|
|
1983
|
+
agents__unsafe_dev_only: mergedAgents,
|
|
1980
1984
|
tools: allTools,
|
|
1981
1985
|
renderToolCalls: allRenderToolCalls,
|
|
1982
1986
|
renderActivityMessages: allActivityRenderers,
|
|
@@ -2028,13 +2032,13 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2028
2032
|
copilotkit.setHeaders(mergedHeaders);
|
|
2029
2033
|
copilotkit.setCredentials(credentials);
|
|
2030
2034
|
copilotkit.setProperties(properties);
|
|
2031
|
-
copilotkit.setAgents__unsafe_dev_only(
|
|
2035
|
+
copilotkit.setAgents__unsafe_dev_only(mergedAgents);
|
|
2032
2036
|
}, [
|
|
2033
2037
|
chatApiEndpoint,
|
|
2034
2038
|
mergedHeaders,
|
|
2035
2039
|
credentials,
|
|
2036
2040
|
properties,
|
|
2037
|
-
|
|
2041
|
+
mergedAgents,
|
|
2038
2042
|
useSingleEndpoint
|
|
2039
2043
|
]);
|
|
2040
2044
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CopilotKitContext.Provider, {
|