@copilotkit/react-core 1.50.0-beta.1 → 1.50.0-beta.2
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 +7 -0
- package/dist/{chunk-IUSKVYUI.mjs → chunk-2CYJN455.mjs} +2 -1
- package/dist/{chunk-IUSKVYUI.mjs.map → chunk-2CYJN455.mjs.map} +1 -1
- package/dist/{chunk-UJBV5GAG.mjs → chunk-6F7Q6CPI.mjs} +17 -36
- package/dist/chunk-6F7Q6CPI.mjs.map +1 -0
- package/dist/{chunk-JRT5BJF3.mjs → chunk-6SK26J65.mjs} +2 -2
- package/dist/{chunk-3GURHDG7.mjs → chunk-BPJ6V4YX.mjs} +2 -2
- package/dist/{chunk-TXI72QHK.mjs → chunk-EG56H77V.mjs} +2 -2
- package/dist/{chunk-3R423LZT.mjs → chunk-EHXVGFWN.mjs} +2 -2
- package/dist/{chunk-CB7CRBDG.mjs → chunk-FBVI3LQ6.mjs} +11 -11
- package/dist/chunk-FBVI3LQ6.mjs.map +1 -0
- package/dist/chunk-I76HKHPJ.mjs +32 -0
- package/dist/chunk-I76HKHPJ.mjs.map +1 -0
- package/dist/{chunk-R4MR43UQ.mjs → chunk-ISNVEPPQ.mjs} +17 -3
- package/dist/chunk-ISNVEPPQ.mjs.map +1 -0
- package/dist/{chunk-FBD24VEH.mjs → chunk-LD3MGPZB.mjs} +1 -1
- package/dist/{chunk-FBD24VEH.mjs.map → chunk-LD3MGPZB.mjs.map} +1 -1
- package/dist/{chunk-GMI4KO4X.mjs → chunk-OAEX7G5G.mjs} +2 -2
- package/dist/{chunk-DCHSCK62.mjs → chunk-SD7TUPQM.mjs} +13 -14
- package/dist/chunk-SD7TUPQM.mjs.map +1 -0
- package/dist/{chunk-NG26QEGF.mjs → chunk-T2VBHAAP.mjs} +9 -3
- package/dist/chunk-T2VBHAAP.mjs.map +1 -0
- package/dist/{chunk-NROJOTQP.mjs → chunk-TGIWTM6S.mjs} +8 -5
- package/dist/chunk-TGIWTM6S.mjs.map +1 -0
- package/dist/{chunk-QU6NONOD.mjs → chunk-U2ZRVVKT.mjs} +2 -2
- package/dist/{chunk-5X5DJRQQ.mjs → chunk-WF65O6HX.mjs} +2 -7
- package/dist/chunk-WF65O6HX.mjs.map +1 -0
- package/dist/{chunk-24SCZAB4.mjs → chunk-ZYTXB6HH.mjs} +22 -14
- package/dist/chunk-ZYTXB6HH.mjs.map +1 -0
- package/dist/components/CopilotListeners.js +13 -146
- package/dist/components/CopilotListeners.js.map +1 -1
- package/dist/components/CopilotListeners.mjs +1 -6
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +1 -1
- package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +11 -11
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +6 -6
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +11 -11
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +11 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -6
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/{copilot-context-1cd70a3f.d.ts → copilot-context-81022020.d.ts} +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +187 -155
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +24 -23
- package/dist/hooks/use-agent-nodename.d.ts +3 -0
- package/dist/hooks/use-agent-nodename.js +56 -0
- package/dist/hooks/use-agent-nodename.js.map +1 -0
- package/dist/hooks/use-agent-nodename.mjs +8 -0
- package/dist/hooks/use-agent-nodename.mjs.map +1 -0
- package/dist/hooks/use-coagent-state-render-bridge.js +7 -4
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.mjs +1 -1
- package/dist/hooks/use-coagent.js +58 -21
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +2 -1
- package/dist/hooks/use-configure-chat-suggestions.js +13 -144
- package/dist/hooks/use-configure-chat-suggestions.js.map +1 -1
- package/dist/hooks/use-configure-chat-suggestions.mjs +1 -6
- package/dist/hooks/use-copilot-action.js +5 -1
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +5 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat-headless_c.js +107 -84
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +6 -5
- package/dist/hooks/use-copilot-chat.js +105 -82
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -5
- package/dist/hooks/use-copilot-chat_internal.d.ts +1 -1
- package/dist/hooks/use-copilot-chat_internal.js +105 -82
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +5 -4
- package/dist/hooks/use-copilot-readable.d.ts +1 -1
- package/dist/hooks/use-copilot-readable.js +1 -0
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +1 -1
- package/dist/hooks/use-default-tool.js +5 -1
- package/dist/hooks/use-default-tool.js.map +1 -1
- package/dist/hooks/use-default-tool.mjs +3 -3
- package/dist/hooks/use-frontend-tool.js +5 -1
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js +61 -7
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -1
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +184 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -30
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +7 -7
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/types/interrupt-action.js.map +1 -1
- package/jest.config.js +12 -0
- package/package.json +7 -6
- package/src/components/CopilotListeners.tsx +1 -2
- package/src/components/copilot-provider/copilot-messages.tsx +0 -41
- package/src/components/copilot-provider/copilotkit.tsx +2 -2
- package/src/hooks/__tests__/use-coagent-config.test.ts +189 -129
- package/src/hooks/use-agent-nodename.ts +30 -0
- package/src/hooks/use-coagent-state-render-bridge.tsx +20 -20
- package/src/hooks/use-coagent.ts +22 -13
- package/src/hooks/use-configure-chat-suggestions.tsx +8 -7
- package/src/hooks/use-copilot-chat_internal.ts +44 -42
- package/src/hooks/use-copilot-readable.ts +2 -1
- package/src/hooks/use-frontend-tool.ts +10 -2
- package/src/hooks/use-langgraph-interrupt-render.ts +10 -2
- package/src/types/interrupt-action.ts +1 -1
- package/dist/chunk-24SCZAB4.mjs.map +0 -1
- package/dist/chunk-5X5DJRQQ.mjs.map +0 -1
- package/dist/chunk-CB7CRBDG.mjs.map +0 -1
- package/dist/chunk-DCHSCK62.mjs.map +0 -1
- package/dist/chunk-NG26QEGF.mjs.map +0 -1
- package/dist/chunk-NROJOTQP.mjs.map +0 -1
- package/dist/chunk-R4MR43UQ.mjs.map +0 -1
- package/dist/chunk-UJBV5GAG.mjs.map +0 -1
- /package/dist/{chunk-JRT5BJF3.mjs.map → chunk-6SK26J65.mjs.map} +0 -0
- /package/dist/{chunk-3GURHDG7.mjs.map → chunk-BPJ6V4YX.mjs.map} +0 -0
- /package/dist/{chunk-TXI72QHK.mjs.map → chunk-EG56H77V.mjs.map} +0 -0
- /package/dist/{chunk-3R423LZT.mjs.map → chunk-EHXVGFWN.mjs.map} +0 -0
- /package/dist/{chunk-GMI4KO4X.mjs.map → chunk-OAEX7G5G.mjs.map} +0 -0
- /package/dist/{chunk-QU6NONOD.mjs.map → chunk-U2ZRVVKT.mjs.map} +0 -0
|
@@ -2,24 +2,24 @@ import "../../chunk-SPCZTZCY.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
CopilotKit,
|
|
4
4
|
defaultCopilotContextCategories
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-LHERIF3L.mjs";
|
|
7
|
-
import "../../chunk-FBD24VEH.mjs";
|
|
5
|
+
} from "../../chunk-SD7TUPQM.mjs";
|
|
8
6
|
import "../../chunk-LHKZJ2ND.mjs";
|
|
9
7
|
import "../../chunk-WMJVBMUX.mjs";
|
|
10
8
|
import "../../chunk-PIF5KJYI.mjs";
|
|
11
9
|
import "../../chunk-CYDWEPFL.mjs";
|
|
12
10
|
import "../../chunk-2IDV5OHF.mjs";
|
|
11
|
+
import "../../chunk-LD3MGPZB.mjs";
|
|
12
|
+
import "../../chunk-LHERIF3L.mjs";
|
|
13
13
|
import "../../chunk-ICIK2BSB.mjs";
|
|
14
14
|
import "../../chunk-RKTVJRK7.mjs";
|
|
15
|
-
import "../../chunk-YYN33GSG.mjs";
|
|
16
15
|
import "../../chunk-PMAFHQ7P.mjs";
|
|
16
|
+
import "../../chunk-YYN33GSG.mjs";
|
|
17
17
|
import "../../chunk-6PUNP7CD.mjs";
|
|
18
18
|
import "../../chunk-O7ARI5CV.mjs";
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-5X5DJRQQ.mjs";
|
|
19
|
+
import "../../chunk-TGIWTM6S.mjs";
|
|
21
20
|
import "../../chunk-NB2FKV2V.mjs";
|
|
22
21
|
import "../../chunk-F555TVE4.mjs";
|
|
22
|
+
import "../../chunk-WF65O6HX.mjs";
|
|
23
23
|
import "../../chunk-EFL5OBKN.mjs";
|
|
24
24
|
import "../../chunk-6ZLPNY7X.mjs";
|
|
25
25
|
import "../../chunk-FDOMAPJY.mjs";
|
|
@@ -3,7 +3,7 @@ export { CopilotKitProps } from './copilot-provider/copilotkit-props.js';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@copilotkit/runtime-client-gql';
|
|
5
5
|
import 'react';
|
|
6
|
-
import '../copilot-context-
|
|
6
|
+
import '../copilot-context-81022020.js';
|
|
7
7
|
import '@copilotkit/shared';
|
|
8
8
|
import '../types/frontend-action.js';
|
|
9
9
|
import '../hooks/use-tree.js';
|
package/dist/components/index.js
CHANGED
|
@@ -2292,6 +2292,8 @@ function useThreads() {
|
|
|
2292
2292
|
// src/hooks/use-coagent-state-render-bridge.tsx
|
|
2293
2293
|
var import_shared10 = require("@copilotkit/shared");
|
|
2294
2294
|
function getStateWithoutConstantKeys(state) {
|
|
2295
|
+
if (!state)
|
|
2296
|
+
return {};
|
|
2295
2297
|
const _a = state, { messages, tools, copilotkit } = _a, stateWithoutConstantKeys = __objRest(_a, ["messages", "tools", "copilotkit"]);
|
|
2296
2298
|
return stateWithoutConstantKeys;
|
|
2297
2299
|
}
|
|
@@ -2338,9 +2340,6 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
2338
2340
|
unsubscribe();
|
|
2339
2341
|
};
|
|
2340
2342
|
}, [agentId, nodeName]);
|
|
2341
|
-
if (messageIndexInRun !== 0) {
|
|
2342
|
-
return null;
|
|
2343
|
-
}
|
|
2344
2343
|
const getStateRender = (0, import_react13.useCallback)(
|
|
2345
2344
|
(messageId) => {
|
|
2346
2345
|
return Object.entries(coAgentStateRenders).find(([stateRenderId, stateRender]) => {
|
|
@@ -2385,6 +2384,9 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
2385
2384
|
};
|
|
2386
2385
|
return (0, import_react13.useMemo)(() => {
|
|
2387
2386
|
var _a2, _b, _c;
|
|
2387
|
+
if (messageIndexInRun !== 0) {
|
|
2388
|
+
return null;
|
|
2389
|
+
}
|
|
2388
2390
|
const [stateRenderId, stateRender] = (_a2 = getStateRender(message.id)) != null ? _a2 : [];
|
|
2389
2391
|
if (!stateRender || !stateRenderId) {
|
|
2390
2392
|
return null;
|
|
@@ -2431,7 +2433,8 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
2431
2433
|
agent == null ? void 0 : agent.isRunning,
|
|
2432
2434
|
nodeName,
|
|
2433
2435
|
effectiveRunId,
|
|
2434
|
-
message.id
|
|
2436
|
+
message.id,
|
|
2437
|
+
messageIndexInRun
|
|
2435
2438
|
]);
|
|
2436
2439
|
}
|
|
2437
2440
|
function CoAgentStateRenderBridge(props) {
|
|
@@ -2476,11 +2479,9 @@ var usePredictStateSubscription = (agent) => {
|
|
|
2476
2479
|
}, [agent, getSubscriber]);
|
|
2477
2480
|
};
|
|
2478
2481
|
function CopilotListeners() {
|
|
2479
|
-
var _a, _b;
|
|
2480
2482
|
const { copilotkit } = (0, import_react15.useCopilotKit)();
|
|
2481
|
-
const { agentSession } = useCopilotContext();
|
|
2482
2483
|
const existingConfig = (0, import_react15.useCopilotChatConfiguration)();
|
|
2483
|
-
const resolvedAgentId =
|
|
2484
|
+
const resolvedAgentId = existingConfig == null ? void 0 : existingConfig.agentId;
|
|
2484
2485
|
const { setBannerError } = useToast();
|
|
2485
2486
|
const { agent } = (0, import_react15.useAgent)({ agentId: resolvedAgentId });
|
|
2486
2487
|
usePredictStateSubscription(agent);
|
|
@@ -2507,12 +2508,11 @@ function CopilotKit(_a) {
|
|
|
2507
2508
|
const renderArr = (0, import_react16.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
|
|
2508
2509
|
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)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2509
2510
|
import_react17.CopilotKitProvider,
|
|
2510
|
-
{
|
|
2511
|
-
runtimeUrl: props.runtimeUrl,
|
|
2511
|
+
__spreadProps(__spreadValues({}, props), {
|
|
2512
2512
|
renderCustomMessages: renderArr,
|
|
2513
2513
|
useSingleEndpoint: true,
|
|
2514
2514
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
|
|
2515
|
-
}
|
|
2515
|
+
})
|
|
2516
2516
|
) }) }) });
|
|
2517
2517
|
}
|
|
2518
2518
|
function CopilotKitInternal(cpkProps) {
|
|
@@ -2850,7 +2850,7 @@ ${nonDocumentStrings}`;
|
|
|
2850
2850
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2851
2851
|
import_react17.CopilotChatConfigurationProvider,
|
|
2852
2852
|
{
|
|
2853
|
-
agentId: (_b =
|
|
2853
|
+
agentId: (_b = props.agent) != null ? _b : "default",
|
|
2854
2854
|
threadId,
|
|
2855
2855
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2856
2856
|
CopilotContext.Provider,
|