@copilotkit/react-core 1.50.0-beta.1 → 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 (194) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-IUSKVYUI.mjs → chunk-2CYJN455.mjs} +2 -1
  3. package/dist/{chunk-IUSKVYUI.mjs.map → chunk-2CYJN455.mjs.map} +1 -1
  4. package/dist/{chunk-3GURHDG7.mjs → chunk-4HRUQH6U.mjs} +3 -3
  5. package/dist/{chunk-FBD24VEH.mjs → chunk-7HI6VLJJ.mjs} +5 -5
  6. package/dist/{chunk-FBD24VEH.mjs.map → chunk-7HI6VLJJ.mjs.map} +1 -1
  7. package/dist/{chunk-D3QSYDJR.mjs → chunk-7IBF6RBW.mjs} +2 -2
  8. package/dist/{chunk-OVYFRPSN.mjs → chunk-ABWT4DRT.mjs} +2 -2
  9. package/dist/{chunk-WVLHXIFP.mjs → chunk-AFNWX62Q.mjs} +2 -2
  10. package/dist/{chunk-WVLHXIFP.mjs.map → chunk-AFNWX62Q.mjs.map} +1 -1
  11. package/dist/{chunk-GMI4KO4X.mjs → chunk-AMUONDZ2.mjs} +2 -2
  12. package/dist/{chunk-DCHSCK62.mjs → chunk-B66SA6EH.mjs} +45 -51
  13. package/dist/chunk-B66SA6EH.mjs.map +1 -0
  14. package/dist/{chunk-7BYHZLPL.mjs → chunk-BTZ3TJVX.mjs} +6 -6
  15. package/dist/chunk-BTZ3TJVX.mjs.map +1 -0
  16. package/dist/{chunk-TXI72QHK.mjs → chunk-EG56H77V.mjs} +2 -2
  17. package/dist/{chunk-CB7CRBDG.mjs → chunk-FBVI3LQ6.mjs} +11 -11
  18. package/dist/chunk-FBVI3LQ6.mjs.map +1 -0
  19. package/dist/chunk-I76HKHPJ.mjs +32 -0
  20. package/dist/chunk-I76HKHPJ.mjs.map +1 -0
  21. package/dist/{chunk-BR5YEYZJ.mjs → chunk-IUNU4CUG.mjs} +5 -5
  22. package/dist/{chunk-UJBV5GAG.mjs → chunk-M7EVKKUZ.mjs} +20 -39
  23. package/dist/chunk-M7EVKKUZ.mjs.map +1 -0
  24. package/dist/{chunk-LHKZJ2ND.mjs → chunk-PMWUKW3Z.mjs} +3 -3
  25. package/dist/{chunk-NROJOTQP.mjs → chunk-QNUAXSDP.mjs} +9 -6
  26. package/dist/chunk-QNUAXSDP.mjs.map +1 -0
  27. package/dist/{chunk-JRT5BJF3.mjs → chunk-SHHPDZUK.mjs} +2 -2
  28. package/dist/{chunk-LHERIF3L.mjs → chunk-SNON4QA6.mjs} +4 -4
  29. package/dist/{chunk-NG26QEGF.mjs → chunk-T2VBHAAP.mjs} +9 -3
  30. package/dist/chunk-T2VBHAAP.mjs.map +1 -0
  31. package/dist/{chunk-QU6NONOD.mjs → chunk-U2ZRVVKT.mjs} +2 -2
  32. package/dist/{chunk-R4MR43UQ.mjs → chunk-VV56AVPB.mjs} +33 -9
  33. package/dist/chunk-VV56AVPB.mjs.map +1 -0
  34. package/dist/{chunk-5X5DJRQQ.mjs → chunk-WF65O6HX.mjs} +2 -7
  35. package/dist/chunk-WF65O6HX.mjs.map +1 -0
  36. package/dist/{chunk-3R423LZT.mjs → chunk-XFXT2VNX.mjs} +3 -3
  37. package/dist/{chunk-WMJVBMUX.mjs → chunk-YCG6SNAU.mjs} +2 -2
  38. package/dist/{chunk-24SCZAB4.mjs → chunk-ZYTXB6HH.mjs} +22 -14
  39. package/dist/chunk-ZYTXB6HH.mjs.map +1 -0
  40. package/dist/components/CopilotListeners.js +13 -146
  41. package/dist/components/CopilotListeners.js.map +1 -1
  42. package/dist/components/CopilotListeners.mjs +1 -6
  43. package/dist/components/copilot-provider/copilot-messages.js +1 -1
  44. package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
  45. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  46. package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
  47. package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
  48. package/dist/components/copilot-provider/copilotkit.js +35 -40
  49. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  50. package/dist/components/copilot-provider/copilotkit.mjs +14 -14
  51. package/dist/components/copilot-provider/index.d.ts +1 -1
  52. package/dist/components/copilot-provider/index.js +35 -40
  53. package/dist/components/copilot-provider/index.js.map +1 -1
  54. package/dist/components/copilot-provider/index.mjs +14 -14
  55. package/dist/components/dev-console/console-trigger.js +1 -1
  56. package/dist/components/dev-console/console-trigger.js.map +1 -1
  57. package/dist/components/dev-console/console-trigger.mjs +3 -3
  58. package/dist/components/dev-console/developer-console-modal.js +1 -1
  59. package/dist/components/dev-console/developer-console-modal.js.map +1 -1
  60. package/dist/components/dev-console/developer-console-modal.mjs +2 -2
  61. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  62. package/dist/components/index.d.ts +1 -1
  63. package/dist/components/index.js +35 -40
  64. package/dist/components/index.js.map +1 -1
  65. package/dist/components/index.mjs +14 -14
  66. package/dist/context/copilot-context.d.ts +1 -1
  67. package/dist/context/copilot-context.js +1 -1
  68. package/dist/context/copilot-context.js.map +1 -1
  69. package/dist/context/copilot-context.mjs +1 -1
  70. package/dist/context/index.d.ts +1 -1
  71. package/dist/context/index.js +1 -1
  72. package/dist/context/index.js.map +1 -1
  73. package/dist/context/index.mjs +6 -6
  74. package/dist/{copilot-context-1cd70a3f.d.ts → copilot-context-ec77e921.d.ts} +3 -3
  75. package/dist/hooks/index.d.ts +1 -1
  76. package/dist/hooks/index.js +206 -164
  77. package/dist/hooks/index.js.map +1 -1
  78. package/dist/hooks/index.mjs +32 -31
  79. package/dist/hooks/use-agent-nodename.d.ts +3 -0
  80. package/dist/hooks/use-agent-nodename.js +56 -0
  81. package/dist/hooks/use-agent-nodename.js.map +1 -0
  82. package/dist/hooks/use-agent-nodename.mjs +8 -0
  83. package/dist/hooks/use-agent-nodename.mjs.map +1 -0
  84. package/dist/hooks/use-coagent-state-render-bridge.js +8 -5
  85. package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
  86. package/dist/hooks/use-coagent-state-render-bridge.mjs +3 -3
  87. package/dist/hooks/use-coagent-state-render.js +1 -1
  88. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  89. package/dist/hooks/use-coagent-state-render.mjs +3 -3
  90. package/dist/hooks/use-coagent.js +58 -21
  91. package/dist/hooks/use-coagent.js.map +1 -1
  92. package/dist/hooks/use-coagent.mjs +2 -1
  93. package/dist/hooks/use-configure-chat-suggestions.js +13 -144
  94. package/dist/hooks/use-configure-chat-suggestions.js.map +1 -1
  95. package/dist/hooks/use-configure-chat-suggestions.mjs +1 -6
  96. package/dist/hooks/use-copilot-action.js +5 -1
  97. package/dist/hooks/use-copilot-action.js.map +1 -1
  98. package/dist/hooks/use-copilot-action.mjs +2 -2
  99. package/dist/hooks/use-copilot-additional-instructions.js +1 -1
  100. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
  101. package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
  102. package/dist/hooks/use-copilot-authenticated-action.js +6 -2
  103. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  104. package/dist/hooks/use-copilot-authenticated-action.mjs +4 -4
  105. package/dist/hooks/use-copilot-chat-headless_c.js +124 -91
  106. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  107. package/dist/hooks/use-copilot-chat-headless_c.mjs +9 -8
  108. package/dist/hooks/use-copilot-chat.js +122 -89
  109. package/dist/hooks/use-copilot-chat.js.map +1 -1
  110. package/dist/hooks/use-copilot-chat.mjs +9 -8
  111. package/dist/hooks/use-copilot-chat_internal.d.ts +1 -1
  112. package/dist/hooks/use-copilot-chat_internal.js +122 -89
  113. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  114. package/dist/hooks/use-copilot-chat_internal.mjs +8 -7
  115. package/dist/hooks/use-copilot-readable.d.ts +1 -1
  116. package/dist/hooks/use-copilot-readable.js +1 -0
  117. package/dist/hooks/use-copilot-readable.js.map +1 -1
  118. package/dist/hooks/use-copilot-readable.mjs +1 -1
  119. package/dist/hooks/use-default-tool.js +5 -1
  120. package/dist/hooks/use-default-tool.js.map +1 -1
  121. package/dist/hooks/use-default-tool.mjs +3 -3
  122. package/dist/hooks/use-frontend-tool.js +5 -1
  123. package/dist/hooks/use-frontend-tool.js.map +1 -1
  124. package/dist/hooks/use-frontend-tool.mjs +1 -1
  125. package/dist/hooks/use-langgraph-interrupt-render.js +77 -13
  126. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  127. package/dist/hooks/use-langgraph-interrupt-render.mjs +4 -3
  128. package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
  129. package/dist/hooks/use-langgraph-interrupt.js +3 -3
  130. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  131. package/dist/hooks/use-langgraph-interrupt.mjs +2 -2
  132. package/dist/hooks/use-make-copilot-document-readable.js +1 -1
  133. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  134. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  135. package/dist/index.d.ts +1 -1
  136. package/dist/index.js +225 -191
  137. package/dist/index.js.map +1 -1
  138. package/dist/index.mjs +56 -55
  139. package/dist/lib/copilot-task.d.ts +1 -1
  140. package/dist/lib/copilot-task.js.map +1 -1
  141. package/dist/lib/copilot-task.mjs +15 -15
  142. package/dist/lib/index.d.ts +1 -1
  143. package/dist/lib/index.js.map +1 -1
  144. package/dist/lib/index.mjs +15 -15
  145. package/dist/types/index.d.ts +1 -1
  146. package/dist/types/interrupt-action.d.ts +1 -1
  147. package/dist/types/interrupt-action.js.map +1 -1
  148. package/dist/utils/index.mjs +3 -3
  149. package/dist/v2/index.css +4 -0
  150. package/dist/v2/index.css.map +1 -0
  151. package/dist/v2/index.js.map +1 -1
  152. package/dist/v2/index.mjs +2 -0
  153. package/dist/v2/index.mjs.map +1 -1
  154. package/jest.config.js +12 -0
  155. package/package.json +12 -9
  156. package/src/components/CopilotListeners.tsx +1 -2
  157. package/src/components/copilot-provider/copilot-messages.tsx +0 -41
  158. package/src/components/copilot-provider/copilotkit.tsx +31 -31
  159. package/src/context/copilot-context.tsx +2 -2
  160. package/src/hooks/__tests__/use-coagent-config.test.ts +189 -129
  161. package/src/hooks/use-agent-nodename.ts +30 -0
  162. package/src/hooks/use-coagent-state-render-bridge.tsx +22 -22
  163. package/src/hooks/use-coagent.ts +22 -13
  164. package/src/hooks/use-configure-chat-suggestions.tsx +8 -7
  165. package/src/hooks/use-copilot-chat_internal.ts +44 -42
  166. package/src/hooks/use-copilot-readable.ts +2 -1
  167. package/src/hooks/use-frontend-tool.ts +10 -2
  168. package/src/hooks/use-langgraph-interrupt-render.ts +25 -7
  169. package/src/hooks/use-langgraph-interrupt.ts +2 -3
  170. package/src/types/interrupt-action.ts +2 -5
  171. package/src/v2/index.ts +2 -0
  172. package/tsup.config.ts +1 -1
  173. package/dist/chunk-24SCZAB4.mjs.map +0 -1
  174. package/dist/chunk-5X5DJRQQ.mjs.map +0 -1
  175. package/dist/chunk-7BYHZLPL.mjs.map +0 -1
  176. package/dist/chunk-CB7CRBDG.mjs.map +0 -1
  177. package/dist/chunk-DCHSCK62.mjs.map +0 -1
  178. package/dist/chunk-NG26QEGF.mjs.map +0 -1
  179. package/dist/chunk-NROJOTQP.mjs.map +0 -1
  180. package/dist/chunk-R4MR43UQ.mjs.map +0 -1
  181. package/dist/chunk-UJBV5GAG.mjs.map +0 -1
  182. /package/dist/{chunk-3GURHDG7.mjs.map → chunk-4HRUQH6U.mjs.map} +0 -0
  183. /package/dist/{chunk-D3QSYDJR.mjs.map → chunk-7IBF6RBW.mjs.map} +0 -0
  184. /package/dist/{chunk-OVYFRPSN.mjs.map → chunk-ABWT4DRT.mjs.map} +0 -0
  185. /package/dist/{chunk-GMI4KO4X.mjs.map → chunk-AMUONDZ2.mjs.map} +0 -0
  186. /package/dist/{chunk-TXI72QHK.mjs.map → chunk-EG56H77V.mjs.map} +0 -0
  187. /package/dist/{chunk-BR5YEYZJ.mjs.map → chunk-IUNU4CUG.mjs.map} +0 -0
  188. /package/dist/{chunk-LHKZJ2ND.mjs.map → chunk-PMWUKW3Z.mjs.map} +0 -0
  189. /package/dist/{chunk-JRT5BJF3.mjs.map → chunk-SHHPDZUK.mjs.map} +0 -0
  190. /package/dist/{chunk-LHERIF3L.mjs.map → chunk-SNON4QA6.mjs.map} +0 -0
  191. /package/dist/{chunk-QU6NONOD.mjs.map → chunk-U2ZRVVKT.mjs.map} +0 -0
  192. /package/dist/{chunk-3R423LZT.mjs.map → chunk-XFXT2VNX.mjs.map} +0 -0
  193. /package/dist/{chunk-WMJVBMUX.mjs.map → chunk-YCG6SNAU.mjs.map} +0 -0
  194. /package/src/v2/{styles.css → index.css} +0 -0
@@ -1,33 +1,33 @@
1
1
  import "../chunk-LUGEI4YQ.mjs";
2
2
  import {
3
3
  CopilotTask
4
- } from "../chunk-JRT5BJF3.mjs";
4
+ } from "../chunk-SHHPDZUK.mjs";
5
5
  import "../chunk-4CEQJ2X6.mjs";
6
6
  import "../chunk-JD7BAH7U.mjs";
7
7
  import "../chunk-SPCZTZCY.mjs";
8
- import "../chunk-DCHSCK62.mjs";
9
- import "../chunk-LHERIF3L.mjs";
10
- import "../chunk-FBD24VEH.mjs";
11
- import "../chunk-LHKZJ2ND.mjs";
12
- import "../chunk-WMJVBMUX.mjs";
8
+ import "../chunk-B66SA6EH.mjs";
9
+ import "../chunk-SNON4QA6.mjs";
10
+ import "../chunk-7HI6VLJJ.mjs";
11
+ import "../chunk-PMWUKW3Z.mjs";
12
+ import "../chunk-YCG6SNAU.mjs";
13
13
  import "../chunk-PIF5KJYI.mjs";
14
+ import "../chunk-RKTVJRK7.mjs";
15
+ import "../chunk-PMAFHQ7P.mjs";
14
16
  import "../chunk-CYDWEPFL.mjs";
15
- import "../chunk-2IDV5OHF.mjs";
16
17
  import "../chunk-ICIK2BSB.mjs";
17
- import "../chunk-RKTVJRK7.mjs";
18
+ import "../chunk-2IDV5OHF.mjs";
18
19
  import "../chunk-YYN33GSG.mjs";
19
- import "../chunk-PMAFHQ7P.mjs";
20
+ import "../chunk-6ZLPNY7X.mjs";
20
21
  import "../chunk-6PUNP7CD.mjs";
21
22
  import "../chunk-O7ARI5CV.mjs";
22
- import "../chunk-NROJOTQP.mjs";
23
- import "../chunk-5X5DJRQQ.mjs";
23
+ import "../chunk-QNUAXSDP.mjs";
24
24
  import "../chunk-NB2FKV2V.mjs";
25
- import "../chunk-F555TVE4.mjs";
26
- import "../chunk-EFL5OBKN.mjs";
27
- import "../chunk-6ZLPNY7X.mjs";
28
25
  import "../chunk-FDOMAPJY.mjs";
29
- import "../chunk-WVLHXIFP.mjs";
26
+ import "../chunk-AFNWX62Q.mjs";
30
27
  import "../chunk-DMLQZG75.mjs";
28
+ import "../chunk-F555TVE4.mjs";
29
+ import "../chunk-WF65O6HX.mjs";
30
+ import "../chunk-EFL5OBKN.mjs";
31
31
  import "../chunk-SKC7AJIV.mjs";
32
32
  export {
33
33
  CopilotTask
@@ -3,7 +3,7 @@ export { SystemMessageFunction } from './system-message.js';
3
3
  export { ActionRenderProps, ActionRenderPropsNoArgs, ActionRenderPropsNoArgsWait, ActionRenderPropsWait, CatchAllActionRenderProps, CatchAllFrontendAction, FrontendAction, FrontendActionAvailability, RenderFunctionStatus } from './frontend-action.js';
4
4
  export { CopilotChatSuggestionConfiguration } from './chat-suggestion-configuration.js';
5
5
  export { CrewsAgentState, CrewsResponse, CrewsResponseStatus, CrewsStateItem, CrewsTaskStateItem, CrewsToolStateItem } from './crew.js';
6
- export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-1cd70a3f.js';
6
+ export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-ec77e921.js';
7
7
  import '@copilotkit/runtime-client-gql';
8
8
  import '@copilotkit/shared';
9
9
  import 'react';
@@ -1,5 +1,5 @@
1
1
  import '@copilotkit/runtime-client-gql';
2
- export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-1cd70a3f.js';
2
+ export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-ec77e921.js';
3
3
  import '@copilotkit/shared';
4
4
  import './frontend-action.js';
5
5
  import 'react';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/interrupt-action.ts"],"sourcesContent":["import { LangGraphInterruptEvent } from \"@copilotkit/runtime-client-gql\";\nimport { AgentSession } from \"../context/copilot-context\";\n\nexport interface LangGraphInterruptRenderHandlerProps<TEventValue = any> {\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRenderProps<TEventValue = any> {\n result: unknown;\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRender<TEventValue = any> {\n id: string;\n /**\n * The handler function to handle the event.\n */\n handler?: (props: LangGraphInterruptRenderHandlerProps<TEventValue>) => any | Promise<any>;\n /**\n * The render function to handle the event.\n */\n render?: (props: LangGraphInterruptRenderProps<TEventValue>) => string | React.ReactElement;\n /**\n * Method that returns a boolean, indicating if the interrupt action should run\n * Useful when using multiple interrupts\n */\n enabled?: (args: { eventValue: TEventValue; agentMetadata: AgentSession | null }) => boolean;\n}\n\nexport type LangGraphInterruptAction = LangGraphInterruptRender & {\n event?: LangGraphInterruptEvent;\n};\n\nexport type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null;\nexport type LangGraphInterruptActionSetter = (\n threadId: string,\n action: LangGraphInterruptActionSetterArgs,\n) => void;\n\nexport interface QueuedInterruptEvent {\n eventId: string; // Generated unique ID for tracking\n threadId: string;\n event: LangGraphInterruptEvent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/interrupt-action.ts"],"sourcesContent":["import { LangGraphInterruptEvent } from \"@copilotkit/runtime-client-gql\";\nimport { AgentSession } from \"../context/copilot-context\";\n\nexport interface LangGraphInterruptRenderHandlerProps<TEventValue = any> {\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRenderProps<TEventValue = any> {\n result: unknown;\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRender<TEventValue = any> {\n id: string;\n /**\n * The handler function to handle the event.\n */\n handler?: (props: LangGraphInterruptRenderHandlerProps<TEventValue>) => any | Promise<any>;\n /**\n * The render function to handle the event.\n */\n render?: (props: LangGraphInterruptRenderProps<TEventValue>) => string | React.ReactElement;\n /**\n * Method that returns a boolean, indicating if the interrupt action should run\n * Useful when using multiple interrupts\n */\n enabled?: (args: { eventValue: TEventValue; agentMetadata: AgentSession }) => boolean;\n}\n\nexport type LangGraphInterruptAction = LangGraphInterruptRender & {\n event?: LangGraphInterruptEvent;\n};\n\nexport type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null;\nexport type LangGraphInterruptActionSetter = (action: LangGraphInterruptActionSetterArgs) => void;\n\nexport interface QueuedInterruptEvent {\n eventId: string; // Generated unique ID for tracking\n threadId: string;\n event: LangGraphInterruptEvent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import "../chunk-CYDWEPFL.mjs";
2
- import {
3
- SUGGESTION_RETRY_CONFIG
4
- } from "../chunk-2IDV5OHF.mjs";
5
2
  import {
6
3
  shouldShowDevConsole
7
4
  } from "../chunk-ICIK2BSB.mjs";
5
+ import {
6
+ SUGGESTION_RETRY_CONFIG
7
+ } from "../chunk-2IDV5OHF.mjs";
8
8
  import "../chunk-SKC7AJIV.mjs";
9
9
  export {
10
10
  SUGGESTION_RETRY_CONFIG,
@@ -0,0 +1,4 @@
1
+ @import "@copilotkitnext/react/styles.css";
2
+
3
+ /* src/v2/index.css */
4
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["export * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAc,iCAAd;AACA,uBAAc,kCADd;","names":[]}
1
+ {"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["import \"./index.css\";\n\nexport * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,uBAAc,iCAFd;AAGA,uBAAc,kCAHd;","names":[]}
package/dist/v2/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import "../chunk-SKC7AJIV.mjs";
2
+
1
3
  // src/v2/index.ts
2
4
  export * from "@copilotkitnext/core";
3
5
  export * from "@copilotkitnext/react";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["export * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";AAAA,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["import \"./index.css\";\n\nexport * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";;;AAEA,cAAc;AACd,cAAc;","names":[]}
package/jest.config.js CHANGED
@@ -9,5 +9,17 @@ module.exports = {
9
9
  setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
10
10
  moduleNameMapper: {
11
11
  "^@/(.*)$": "<rootDir>/src/$1",
12
+ "\\.(css|less|scss|sass)$": "identity-obj-proxy",
13
+ },
14
+ transformIgnorePatterns: [
15
+ "node_modules/(?!(react-markdown|streamdown|@copilotkitnext)/)",
16
+ ],
17
+ transform: {
18
+ "^.+\\.(ts|tsx)$": "ts-jest",
19
+ "^.+\\.(js|jsx|mjs)$": ["ts-jest", {
20
+ tsconfig: {
21
+ allowJs: true,
22
+ },
23
+ }],
12
24
  },
13
25
  };
package/package.json CHANGED
@@ -9,8 +9,10 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.50.0-beta.1",
13
- "sideEffects": false,
12
+ "version": "1.50.0-beta.3",
13
+ "sideEffects": [
14
+ "**/*.css"
15
+ ],
14
16
  "main": "./dist/index.js",
15
17
  "module": "./dist/index.mjs",
16
18
  "exports": {
@@ -24,29 +26,28 @@
24
26
  "require": "./dist/v2/index.js",
25
27
  "types": "./dist/v2/index.d.ts"
26
28
  },
27
- "./v2/styles.css": "./dist/index.css"
29
+ "./v2/styles.css": "./dist/v2/index.css"
28
30
  },
29
31
  "types": "./dist/index.d.ts",
30
32
  "license": "MIT",
31
33
  "peerDependencies": {
32
- "@copilotkitnext/core": "0.0.22",
33
- "@copilotkitnext/react": "0.0.22",
34
34
  "react": "^18 || ^19 || ^19.0.0-rc",
35
35
  "react-dom": "^18 || ^19 || ^19.0.0-rc",
36
36
  "zod": ">=3.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@ag-ui/client": "^0.0.40",
39
+ "@ag-ui/client": "^0.0.41",
40
40
  "@testing-library/react": "^16.3.0",
41
41
  "@testing-library/react-hooks": "^8.0.1",
42
42
  "@types/jest": "^29.5.4",
43
43
  "@types/react": "^19.1.0",
44
44
  "@types/react-dom": "^19.0.2",
45
45
  "eslint": "^8.56.0",
46
+ "identity-obj-proxy": "^3.0.0",
46
47
  "jest": "^29.6.4",
47
48
  "jest-environment-jsdom": "^30.0.2",
48
49
  "react": "^19.1.0",
49
- "react-dom": "^19.0.2",
50
+ "react-dom": "^19.2.0",
50
51
  "ts-jest": "^29.1.1",
51
52
  "tsup": "^6.7.0",
52
53
  "typescript": "^5.2.3",
@@ -55,11 +56,13 @@
55
56
  "tsconfig": "1.4.6"
56
57
  },
57
58
  "dependencies": {
59
+ "@copilotkitnext/core": "0.0.23",
60
+ "@copilotkitnext/react": "0.0.23",
58
61
  "@scarf/scarf": "^1.3.0",
59
62
  "react-markdown": "^8.0.7",
60
63
  "untruncate-json": "^0.0.1",
61
- "@copilotkit/shared": "1.50.0-beta.1",
62
- "@copilotkit/runtime-client-gql": "1.50.0-beta.1"
64
+ "@copilotkit/runtime-client-gql": "1.50.0-beta.3",
65
+ "@copilotkit/shared": "1.50.0-beta.3"
63
66
  },
64
67
  "keywords": [
65
68
  "copilotkit",
@@ -55,9 +55,8 @@ const usePredictStateSubscription = (agent?: AbstractAgent) => {
55
55
 
56
56
  export function CopilotListeners() {
57
57
  const { copilotkit } = useCopilotKit();
58
- const { agentSession } = useCopilotContext();
59
58
  const existingConfig = useCopilotChatConfiguration();
60
- const resolvedAgentId = agentSession?.agentName ?? existingConfig?.agentId ?? "default";
59
+ const resolvedAgentId = existingConfig?.agentId;
61
60
  const { setBannerError } = useToast();
62
61
 
63
62
  const { agent } = useAgent({ agentId: resolvedAgentId });
@@ -252,47 +252,6 @@ export function CopilotMessages({ children }: { children: ReactNode }) {
252
252
  [setBannerError, showDevConsole, traceUIError],
253
253
  );
254
254
 
255
- // useEffect(() => {
256
- // if (!threadId || threadId === lastLoadedThreadId.current) return;
257
- // if (
258
- // threadId === lastLoadedThreadId.current &&
259
- // agentSession?.agentName === lastLoadedAgentName.current
260
- // ) {
261
- // return;
262
- // }
263
- //
264
- // const fetchMessages = async () => {
265
- // if (!agentSession?.agentName) return;
266
- //
267
- // const result = await runtimeClient.loadAgentState({
268
- // threadId,
269
- // agentName: agentSession?.agentName,
270
- // });
271
- //
272
- // // Check for GraphQL errors and manually trigger error handling
273
- // if (result.error) {
274
- // // Update refs to prevent infinite retries of the same failed request
275
- // lastLoadedThreadId.current = threadId;
276
- // lastLoadedAgentName.current = agentSession?.agentName;
277
- // handleGraphQLErrors(result.error);
278
- // return; // Don't try to process the data if there's an error
279
- // }
280
- //
281
- // const newMessages = result.data?.loadAgentState?.messages;
282
- // if (newMessages === lastLoadedMessages.current) return;
283
- //
284
- // if (result.data?.loadAgentState) {
285
- // lastLoadedMessages.current = newMessages;
286
- // lastLoadedThreadId.current = threadId;
287
- // lastLoadedAgentName.current = agentSession?.agentName;
288
- //
289
- // const messages = loadMessagesFromJsonRepresentation(JSON.parse(newMessages || "[]"));
290
- // setMessages(messages);
291
- // }
292
- // };
293
- // void fetchMessages();
294
- // }, [threadId, agentSession?.agentName]);
295
-
296
255
  useEffect(() => {
297
256
  updateTapMessages(messages);
298
257
  }, [messages, updateTapMessages]);
@@ -71,11 +71,7 @@ export function CopilotKit({ children, ...props }: CopilotKitProps) {
71
71
  <ToastProvider enabled={enabled}>
72
72
  <CopilotErrorBoundary publicApiKey={publicApiKey} showUsageBanner={enabled}>
73
73
  <ThreadsProvider threadId={props.threadId}>
74
- <CopilotKitProvider
75
- runtimeUrl={props.runtimeUrl}
76
- renderCustomMessages={renderArr}
77
- useSingleEndpoint={true}
78
- >
74
+ <CopilotKitProvider {...props} renderCustomMessages={renderArr} useSingleEndpoint={true}>
79
75
  <CopilotKitInternal {...props}>{children}</CopilotKitInternal>
80
76
  </CopilotKitProvider>
81
77
  </ThreadsProvider>
@@ -397,21 +393,18 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
397
393
  const [interruptActions, _setInterruptActions] = useState<
398
394
  Record<string, LangGraphInterruptRender>
399
395
  >({});
400
- const setInterruptAction = useCallback(
401
- (threadId: string, action: LangGraphInterruptActionSetterArgs) => {
402
- _setInterruptActions((prev) => {
403
- if (action == null || !action.id) {
404
- // Cannot set action without id
405
- return prev;
406
- }
407
- return {
408
- ...prev,
409
- [action.id]: { ...(prev[action.id] ?? {}), ...action } as LangGraphInterruptRender,
410
- };
411
- });
412
- },
413
- [],
414
- );
396
+ const setInterruptAction = useCallback((action: LangGraphInterruptActionSetterArgs) => {
397
+ _setInterruptActions((prev) => {
398
+ if (action == null || !action.id) {
399
+ // Cannot set action without id
400
+ return prev;
401
+ }
402
+ return {
403
+ ...prev,
404
+ [action.id]: { ...(prev[action.id] ?? {}), ...action } as LangGraphInterruptRender,
405
+ };
406
+ });
407
+ }, []);
415
408
  const removeInterruptAction = useCallback((actionId: string): void => {
416
409
  _setInterruptActions((prev) => {
417
410
  const { [actionId]: _, ...rest } = prev;
@@ -433,15 +426,22 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
433
426
  });
434
427
  }, []);
435
428
 
436
- const removeInterruptEvent = useCallback((threadId: string, eventId: string) => {
437
- setInterruptEventQueue((prev) => {
438
- const threadQueue = prev[threadId] || [];
439
- return {
440
- ...prev,
441
- [threadId]: threadQueue.filter((event) => event.eventId !== eventId),
442
- };
443
- });
444
- }, []);
429
+ const resolveInterruptEvent = useCallback(
430
+ (threadId: string, eventId: string, response: string) => {
431
+ setInterruptEventQueue((prev) => {
432
+ const threadQueue = prev[threadId] || [];
433
+ return {
434
+ ...prev,
435
+ [threadId]: threadQueue.map((queuedEvent) =>
436
+ queuedEvent.eventId === eventId
437
+ ? { ...queuedEvent, event: { ...queuedEvent.event, response } }
438
+ : queuedEvent,
439
+ ),
440
+ };
441
+ });
442
+ },
443
+ [],
444
+ );
445
445
 
446
446
  const memoizedChildren = useMemo(() => children, [children]);
447
447
  const [bannerError, setBannerError] = useState<CopilotKitError | null>(null);
@@ -519,7 +519,7 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
519
519
  <CopilotChatConfigurationProvider
520
520
  // labels={labels}
521
521
  // isModalDefaultOpen={isModalDefaultOpen}
522
- agentId={agentSession?.agentName ?? "default"}
522
+ agentId={props.agent ?? "default"}
523
523
  threadId={threadId}
524
524
  >
525
525
  <CopilotContext.Provider
@@ -573,7 +573,7 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
573
573
  removeInterruptAction,
574
574
  interruptEventQueue,
575
575
  addInterruptEvent,
576
- removeInterruptEvent,
576
+ resolveInterruptEvent,
577
577
  bannerError,
578
578
  setBannerError,
579
579
  onError: handleErrors,
@@ -222,7 +222,7 @@ export interface CopilotContextParams {
222
222
  removeInterruptAction: (actionId: string) => void;
223
223
  interruptEventQueue: Record<string, QueuedInterruptEvent[]>;
224
224
  addInterruptEvent: (queuedEvent: QueuedInterruptEvent) => void;
225
- removeInterruptEvent: (threadId: string, eventId: string) => void;
225
+ resolveInterruptEvent: (threadId: string, eventId: string, response: string) => void;
226
226
 
227
227
  /**
228
228
  * Optional trace handler for comprehensive debugging and observability.
@@ -308,7 +308,7 @@ const emptyCopilotContext: CopilotContextParams = {
308
308
  removeInterruptAction: () => {},
309
309
  interruptEventQueue: {},
310
310
  addInterruptEvent: () => {},
311
- removeInterruptEvent: () => {},
311
+ resolveInterruptEvent: () => {},
312
312
  onError: () => {},
313
313
  bannerError: null,
314
314
  setBannerError: () => {},