@copilotkit/react-core 1.50.0-beta.2 → 1.50.0-beta.3

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.
Files changed (134) hide show
  1. package/dist/{chunk-BPJ6V4YX.mjs → chunk-4HRUQH6U.mjs} +2 -2
  2. package/dist/{chunk-LD3MGPZB.mjs → chunk-7HI6VLJJ.mjs} +5 -5
  3. package/dist/{chunk-D3QSYDJR.mjs → chunk-7IBF6RBW.mjs} +2 -2
  4. package/dist/{chunk-OVYFRPSN.mjs → chunk-ABWT4DRT.mjs} +2 -2
  5. package/dist/{chunk-WVLHXIFP.mjs → chunk-AFNWX62Q.mjs} +2 -2
  6. package/dist/{chunk-WVLHXIFP.mjs.map → chunk-AFNWX62Q.mjs.map} +1 -1
  7. package/dist/{chunk-OAEX7G5G.mjs → chunk-AMUONDZ2.mjs} +2 -2
  8. package/dist/{chunk-SD7TUPQM.mjs → chunk-B66SA6EH.mjs} +44 -49
  9. package/dist/chunk-B66SA6EH.mjs.map +1 -0
  10. package/dist/{chunk-7BYHZLPL.mjs → chunk-BTZ3TJVX.mjs} +6 -6
  11. package/dist/chunk-BTZ3TJVX.mjs.map +1 -0
  12. package/dist/{chunk-BR5YEYZJ.mjs → chunk-IUNU4CUG.mjs} +5 -5
  13. package/dist/{chunk-6F7Q6CPI.mjs → chunk-M7EVKKUZ.mjs} +7 -7
  14. package/dist/{chunk-LHKZJ2ND.mjs → chunk-PMWUKW3Z.mjs} +3 -3
  15. package/dist/{chunk-TGIWTM6S.mjs → chunk-QNUAXSDP.mjs} +2 -2
  16. package/dist/{chunk-TGIWTM6S.mjs.map → chunk-QNUAXSDP.mjs.map} +1 -1
  17. package/dist/{chunk-6SK26J65.mjs → chunk-SHHPDZUK.mjs} +2 -2
  18. package/dist/{chunk-LHERIF3L.mjs → chunk-SNON4QA6.mjs} +4 -4
  19. package/dist/{chunk-ISNVEPPQ.mjs → chunk-VV56AVPB.mjs} +17 -7
  20. package/dist/chunk-VV56AVPB.mjs.map +1 -0
  21. package/dist/{chunk-EHXVGFWN.mjs → chunk-XFXT2VNX.mjs} +3 -3
  22. package/dist/{chunk-WMJVBMUX.mjs → chunk-YCG6SNAU.mjs} +2 -2
  23. package/dist/components/copilot-provider/copilot-messages.js +1 -1
  24. package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
  25. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  26. package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
  27. package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
  28. package/dist/components/copilot-provider/copilotkit.js +26 -31
  29. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  30. package/dist/components/copilot-provider/copilotkit.mjs +13 -13
  31. package/dist/components/copilot-provider/index.d.ts +1 -1
  32. package/dist/components/copilot-provider/index.js +26 -31
  33. package/dist/components/copilot-provider/index.js.map +1 -1
  34. package/dist/components/copilot-provider/index.mjs +13 -13
  35. package/dist/components/dev-console/console-trigger.js +1 -1
  36. package/dist/components/dev-console/console-trigger.js.map +1 -1
  37. package/dist/components/dev-console/console-trigger.mjs +3 -3
  38. package/dist/components/dev-console/developer-console-modal.js +1 -1
  39. package/dist/components/dev-console/developer-console-modal.js.map +1 -1
  40. package/dist/components/dev-console/developer-console-modal.mjs +2 -2
  41. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  42. package/dist/components/index.d.ts +1 -1
  43. package/dist/components/index.js +26 -31
  44. package/dist/components/index.js.map +1 -1
  45. package/dist/components/index.mjs +13 -13
  46. package/dist/context/copilot-context.d.ts +1 -1
  47. package/dist/context/copilot-context.js +1 -1
  48. package/dist/context/copilot-context.js.map +1 -1
  49. package/dist/context/copilot-context.mjs +1 -1
  50. package/dist/context/index.d.ts +1 -1
  51. package/dist/context/index.js +1 -1
  52. package/dist/context/index.js.map +1 -1
  53. package/dist/context/index.mjs +6 -6
  54. package/dist/{copilot-context-81022020.d.ts → copilot-context-ec77e921.d.ts} +2 -2
  55. package/dist/hooks/index.d.ts +1 -1
  56. package/dist/hooks/index.js +19 -9
  57. package/dist/hooks/index.js.map +1 -1
  58. package/dist/hooks/index.mjs +15 -15
  59. package/dist/hooks/use-coagent-state-render-bridge.js +1 -1
  60. package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
  61. package/dist/hooks/use-coagent-state-render-bridge.mjs +3 -3
  62. package/dist/hooks/use-coagent-state-render.js +1 -1
  63. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  64. package/dist/hooks/use-coagent-state-render.mjs +3 -3
  65. package/dist/hooks/use-copilot-additional-instructions.js +1 -1
  66. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
  67. package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
  68. package/dist/hooks/use-copilot-authenticated-action.js +1 -1
  69. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  70. package/dist/hooks/use-copilot-authenticated-action.mjs +2 -2
  71. package/dist/hooks/use-copilot-chat-headless_c.js +17 -7
  72. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  73. package/dist/hooks/use-copilot-chat-headless_c.mjs +9 -9
  74. package/dist/hooks/use-copilot-chat.js +17 -7
  75. package/dist/hooks/use-copilot-chat.js.map +1 -1
  76. package/dist/hooks/use-copilot-chat.mjs +9 -9
  77. package/dist/hooks/use-copilot-chat_internal.js +17 -7
  78. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  79. package/dist/hooks/use-copilot-chat_internal.mjs +8 -8
  80. package/dist/hooks/use-langgraph-interrupt-render.js +16 -6
  81. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  82. package/dist/hooks/use-langgraph-interrupt-render.mjs +3 -3
  83. package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
  84. package/dist/hooks/use-langgraph-interrupt.js +3 -3
  85. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  86. package/dist/hooks/use-langgraph-interrupt.mjs +2 -2
  87. package/dist/hooks/use-make-copilot-document-readable.js +1 -1
  88. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  89. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.js +43 -38
  92. package/dist/index.js.map +1 -1
  93. package/dist/index.mjs +44 -44
  94. package/dist/lib/copilot-task.d.ts +1 -1
  95. package/dist/lib/copilot-task.js.map +1 -1
  96. package/dist/lib/copilot-task.mjs +14 -14
  97. package/dist/lib/index.d.ts +1 -1
  98. package/dist/lib/index.js.map +1 -1
  99. package/dist/lib/index.mjs +14 -14
  100. package/dist/types/index.d.ts +1 -1
  101. package/dist/types/index.mjs +1 -1
  102. package/dist/types/interrupt-action.d.ts +1 -1
  103. package/dist/types/interrupt-action.js.map +1 -1
  104. package/dist/utils/index.mjs +3 -3
  105. package/dist/v2/index.css +4 -0
  106. package/dist/v2/index.css.map +1 -0
  107. package/dist/v2/index.js.map +1 -1
  108. package/dist/v2/index.mjs +2 -0
  109. package/dist/v2/index.mjs.map +1 -1
  110. package/package.json +10 -8
  111. package/src/components/copilot-provider/copilotkit.tsx +30 -30
  112. package/src/context/copilot-context.tsx +2 -2
  113. package/src/hooks/use-coagent-state-render-bridge.tsx +2 -2
  114. package/src/hooks/use-langgraph-interrupt-render.ts +15 -5
  115. package/src/hooks/use-langgraph-interrupt.ts +2 -3
  116. package/src/types/interrupt-action.ts +1 -4
  117. package/src/v2/index.ts +2 -0
  118. package/tsup.config.ts +1 -1
  119. package/dist/chunk-7BYHZLPL.mjs.map +0 -1
  120. package/dist/chunk-ISNVEPPQ.mjs.map +0 -1
  121. package/dist/chunk-SD7TUPQM.mjs.map +0 -1
  122. /package/dist/{chunk-BPJ6V4YX.mjs.map → chunk-4HRUQH6U.mjs.map} +0 -0
  123. /package/dist/{chunk-LD3MGPZB.mjs.map → chunk-7HI6VLJJ.mjs.map} +0 -0
  124. /package/dist/{chunk-D3QSYDJR.mjs.map → chunk-7IBF6RBW.mjs.map} +0 -0
  125. /package/dist/{chunk-OVYFRPSN.mjs.map → chunk-ABWT4DRT.mjs.map} +0 -0
  126. /package/dist/{chunk-OAEX7G5G.mjs.map → chunk-AMUONDZ2.mjs.map} +0 -0
  127. /package/dist/{chunk-BR5YEYZJ.mjs.map → chunk-IUNU4CUG.mjs.map} +0 -0
  128. /package/dist/{chunk-6F7Q6CPI.mjs.map → chunk-M7EVKKUZ.mjs.map} +0 -0
  129. /package/dist/{chunk-LHKZJ2ND.mjs.map → chunk-PMWUKW3Z.mjs.map} +0 -0
  130. /package/dist/{chunk-6SK26J65.mjs.map → chunk-SHHPDZUK.mjs.map} +0 -0
  131. /package/dist/{chunk-LHERIF3L.mjs.map → chunk-SNON4QA6.mjs.map} +0 -0
  132. /package/dist/{chunk-EHXVGFWN.mjs.map → chunk-XFXT2VNX.mjs.map} +0 -0
  133. /package/dist/{chunk-WMJVBMUX.mjs.map → chunk-YCG6SNAU.mjs.map} +0 -0
  134. /package/src/v2/{styles.css → index.css} +0 -0
@@ -2,29 +2,29 @@ import {
2
2
  CopilotKit,
3
3
  CopilotKitInternal,
4
4
  defaultCopilotContextCategories
5
- } from "../../chunk-SD7TUPQM.mjs";
6
- import "../../chunk-LHKZJ2ND.mjs";
7
- import "../../chunk-WMJVBMUX.mjs";
5
+ } from "../../chunk-B66SA6EH.mjs";
6
+ import "../../chunk-SNON4QA6.mjs";
7
+ import "../../chunk-7HI6VLJJ.mjs";
8
+ import "../../chunk-PMWUKW3Z.mjs";
9
+ import "../../chunk-YCG6SNAU.mjs";
8
10
  import "../../chunk-PIF5KJYI.mjs";
9
- import "../../chunk-CYDWEPFL.mjs";
10
- import "../../chunk-2IDV5OHF.mjs";
11
- import "../../chunk-LD3MGPZB.mjs";
12
- import "../../chunk-LHERIF3L.mjs";
13
- import "../../chunk-ICIK2BSB.mjs";
14
11
  import "../../chunk-RKTVJRK7.mjs";
15
12
  import "../../chunk-PMAFHQ7P.mjs";
13
+ import "../../chunk-CYDWEPFL.mjs";
14
+ import "../../chunk-ICIK2BSB.mjs";
15
+ import "../../chunk-2IDV5OHF.mjs";
16
16
  import "../../chunk-YYN33GSG.mjs";
17
+ import "../../chunk-6ZLPNY7X.mjs";
17
18
  import "../../chunk-6PUNP7CD.mjs";
18
19
  import "../../chunk-O7ARI5CV.mjs";
19
- import "../../chunk-TGIWTM6S.mjs";
20
+ import "../../chunk-QNUAXSDP.mjs";
20
21
  import "../../chunk-NB2FKV2V.mjs";
22
+ import "../../chunk-FDOMAPJY.mjs";
23
+ import "../../chunk-AFNWX62Q.mjs";
24
+ import "../../chunk-DMLQZG75.mjs";
21
25
  import "../../chunk-F555TVE4.mjs";
22
26
  import "../../chunk-WF65O6HX.mjs";
23
27
  import "../../chunk-EFL5OBKN.mjs";
24
- import "../../chunk-6ZLPNY7X.mjs";
25
- import "../../chunk-FDOMAPJY.mjs";
26
- import "../../chunk-WVLHXIFP.mjs";
27
- import "../../chunk-DMLQZG75.mjs";
28
28
  import "../../chunk-SKC7AJIV.mjs";
29
29
  export {
30
30
  CopilotKit,
@@ -3,7 +3,7 @@ export { CopilotKitProps } from './copilotkit-props.js';
3
3
  import 'react/jsx-runtime';
4
4
  import '@copilotkit/runtime-client-gql';
5
5
  import 'react';
6
- import '../../copilot-context-81022020.js';
6
+ import '../../copilot-context-ec77e921.js';
7
7
  import '@copilotkit/shared';
8
8
  import '../../types/frontend-action.js';
9
9
  import '../../hooks/use-tree.js';
@@ -165,7 +165,7 @@ var emptyCopilotContext = {
165
165
  interruptEventQueue: {},
166
166
  addInterruptEvent: () => {
167
167
  },
168
- removeInterruptEvent: () => {
168
+ resolveInterruptEvent: () => {
169
169
  },
170
170
  onError: () => {
171
171
  },
@@ -2367,7 +2367,7 @@ function useCoagentStateRenderBridge(agentId, props) {
2367
2367
  return canRender;
2368
2368
  }
2369
2369
  const renderClaimedByOtherMessage = Object.values(claimsRef.current).find(
2370
- (c) => c.stateRenderId === stateRenderId && (0, import_shared10.dataToUUID)(JSON.stringify(getStateWithoutConstantKeys(c.stateSnapshot))) === (0, import_shared10.dataToUUID)(JSON.stringify(getStateWithoutConstantKeys(renderSnapshot)))
2370
+ (c) => c.stateRenderId === stateRenderId && (0, import_shared10.dataToUUID)(getStateWithoutConstantKeys(c.stateSnapshot)) === (0, import_shared10.dataToUUID)(getStateWithoutConstantKeys(renderSnapshot))
2371
2371
  );
2372
2372
  if (renderClaimedByOtherMessage) {
2373
2373
  if (renderSnapshot && renderClaimedByOtherMessage.stateSnapshot && !areStatesEquals(renderClaimedByOtherMessage.stateSnapshot, renderSnapshot)) {
@@ -2506,14 +2506,7 @@ function CopilotKit(_a) {
2506
2506
  const enabled = shouldShowDevConsole(props.showDevConsole);
2507
2507
  const publicApiKey = props.publicApiKey || props.publicLicenseKey;
2508
2508
  const renderArr = (0, import_react16.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
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)(
2510
- import_react17.CopilotKitProvider,
2511
- __spreadProps(__spreadValues({}, props), {
2512
- renderCustomMessages: renderArr,
2513
- useSingleEndpoint: true,
2514
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
2515
- })
2516
- ) }) }) });
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)(import_react17.CopilotKitProvider, __spreadProps(__spreadValues({}, props), { renderCustomMessages: renderArr, useSingleEndpoint: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) })) }) }) });
2517
2510
  }
2518
2511
  function CopilotKitInternal(cpkProps) {
2519
2512
  var _b;
@@ -2751,20 +2744,17 @@ ${nonDocumentStrings}`;
2751
2744
  const chatAbortControllerRef = (0, import_react16.useRef)(null);
2752
2745
  const showDevConsole = shouldShowDevConsole(props.showDevConsole);
2753
2746
  const [interruptActions, _setInterruptActions] = (0, import_react16.useState)({});
2754
- const setInterruptAction = (0, import_react16.useCallback)(
2755
- (threadId2, action) => {
2756
- _setInterruptActions((prev) => {
2757
- var _a2;
2758
- if (action == null || !action.id) {
2759
- return prev;
2760
- }
2761
- return __spreadProps(__spreadValues({}, prev), {
2762
- [action.id]: __spreadValues(__spreadValues({}, (_a2 = prev[action.id]) != null ? _a2 : {}), action)
2763
- });
2747
+ const setInterruptAction = (0, import_react16.useCallback)((action) => {
2748
+ _setInterruptActions((prev) => {
2749
+ var _a2;
2750
+ if (action == null || !action.id) {
2751
+ return prev;
2752
+ }
2753
+ return __spreadProps(__spreadValues({}, prev), {
2754
+ [action.id]: __spreadValues(__spreadValues({}, (_a2 = prev[action.id]) != null ? _a2 : {}), action)
2764
2755
  });
2765
- },
2766
- []
2767
- );
2756
+ });
2757
+ }, []);
2768
2758
  const removeInterruptAction = (0, import_react16.useCallback)((actionId) => {
2769
2759
  _setInterruptActions((prev) => {
2770
2760
  const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
@@ -2780,14 +2770,19 @@ ${nonDocumentStrings}`;
2780
2770
  });
2781
2771
  });
2782
2772
  }, []);
2783
- const removeInterruptEvent = (0, import_react16.useCallback)((threadId2, eventId) => {
2784
- setInterruptEventQueue((prev) => {
2785
- const threadQueue = prev[threadId2] || [];
2786
- return __spreadProps(__spreadValues({}, prev), {
2787
- [threadId2]: threadQueue.filter((event) => event.eventId !== eventId)
2773
+ const resolveInterruptEvent = (0, import_react16.useCallback)(
2774
+ (threadId2, eventId, response) => {
2775
+ setInterruptEventQueue((prev) => {
2776
+ const threadQueue = prev[threadId2] || [];
2777
+ return __spreadProps(__spreadValues({}, prev), {
2778
+ [threadId2]: threadQueue.map(
2779
+ (queuedEvent) => queuedEvent.eventId === eventId ? __spreadProps(__spreadValues({}, queuedEvent), { event: __spreadProps(__spreadValues({}, queuedEvent.event), { response }) }) : queuedEvent
2780
+ )
2781
+ });
2788
2782
  });
2789
- });
2790
- }, []);
2783
+ },
2784
+ []
2785
+ );
2791
2786
  const memoizedChildren = (0, import_react16.useMemo)(() => children, [children]);
2792
2787
  const [bannerError, setBannerError] = (0, import_react16.useState)(null);
2793
2788
  const agentLock = (0, import_react16.useMemo)(() => {
@@ -2905,7 +2900,7 @@ ${nonDocumentStrings}`;
2905
2900
  removeInterruptAction,
2906
2901
  interruptEventQueue,
2907
2902
  addInterruptEvent,
2908
- removeInterruptEvent,
2903
+ resolveInterruptEvent,
2909
2904
  bannerError,
2910
2905
  setBannerError,
2911
2906
  onError: handleErrors,