@copilotkit/react-core 1.10.5-next.10 → 1.10.5-next.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.
Files changed (156) hide show
  1. package/CHANGELOG.md +0 -59
  2. package/dist/{chunk-M37URBJS.mjs → chunk-2MGJO3FY.mjs} +7 -7
  3. package/dist/{chunk-3WUDRJTT.mjs → chunk-2QZSAQTX.mjs} +4 -4
  4. package/dist/{chunk-HDOG2RTM.mjs → chunk-36FJAVOF.mjs} +2 -2
  5. package/dist/{chunk-BBUQMG45.mjs → chunk-CXDK6XA5.mjs} +2 -2
  6. package/dist/{chunk-TUTNHDM3.mjs → chunk-DSDAZA3B.mjs} +4 -4
  7. package/dist/{chunk-CUWOXXM5.mjs → chunk-FRXYSJGZ.mjs} +3 -3
  8. package/dist/{chunk-HI6SPUOX.mjs → chunk-JEMBA7PE.mjs} +4 -4
  9. package/dist/{chunk-GIGUZ2OK.mjs → chunk-KWS75AOU.mjs} +3 -3
  10. package/dist/{chunk-MGWRDFBE.mjs → chunk-MZ37BAAE.mjs} +2 -2
  11. package/dist/{chunk-L3I57GMV.mjs → chunk-N4VN2B5S.mjs} +4 -4
  12. package/dist/{chunk-7LTRT3IV.mjs → chunk-O73FZGSU.mjs} +8 -8
  13. package/dist/{chunk-HYJUBYMU.mjs → chunk-OLXYK6PP.mjs} +10 -10
  14. package/dist/{chunk-ZVOLWJCY.mjs → chunk-QF3Q5LUN.mjs} +5 -5
  15. package/dist/chunk-QF3Q5LUN.mjs.map +1 -0
  16. package/dist/{chunk-JCHRWCYH.mjs → chunk-RLT4KZR4.mjs} +3 -3
  17. package/dist/{chunk-IHV5PTID.mjs → chunk-UPQPBCUW.mjs} +4 -4
  18. package/dist/{chunk-3N4MVKFZ.mjs → chunk-WBBJMOZI.mjs} +18 -20
  19. package/dist/chunk-WBBJMOZI.mjs.map +1 -0
  20. package/dist/{chunk-L5MS4UDD.mjs → chunk-WRPXFDFL.mjs} +7 -13
  21. package/dist/chunk-WRPXFDFL.mjs.map +1 -0
  22. package/dist/{chunk-JBACWIFW.mjs → chunk-XFJNMZ6X.mjs} +2 -2
  23. package/dist/{chunk-EUX2P2E7.mjs → chunk-YHT6CWIY.mjs} +3 -5
  24. package/dist/{chunk-EUX2P2E7.mjs.map → chunk-YHT6CWIY.mjs.map} +1 -1
  25. package/dist/{chunk-ITDKIB5E.mjs → chunk-ZRDV3MVW.mjs} +30 -37
  26. package/dist/chunk-ZRDV3MVW.mjs.map +1 -0
  27. package/dist/components/copilot-provider/copilot-messages.js +2 -4
  28. package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
  29. package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
  30. package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
  31. package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
  32. package/dist/components/copilot-provider/copilotkit.js +21 -30
  33. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  34. package/dist/components/copilot-provider/copilotkit.mjs +10 -10
  35. package/dist/components/copilot-provider/index.d.ts +1 -1
  36. package/dist/components/copilot-provider/index.js +21 -30
  37. package/dist/components/copilot-provider/index.js.map +1 -1
  38. package/dist/components/copilot-provider/index.mjs +10 -10
  39. package/dist/components/dev-console/console-trigger.js +2 -4
  40. package/dist/components/dev-console/console-trigger.js.map +1 -1
  41. package/dist/components/dev-console/console-trigger.mjs +3 -3
  42. package/dist/components/dev-console/developer-console-modal.js +2 -4
  43. package/dist/components/dev-console/developer-console-modal.js.map +1 -1
  44. package/dist/components/dev-console/developer-console-modal.mjs +2 -2
  45. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  46. package/dist/components/index.d.ts +1 -1
  47. package/dist/components/index.js +21 -30
  48. package/dist/components/index.js.map +1 -1
  49. package/dist/components/index.mjs +10 -10
  50. package/dist/context/copilot-context.d.ts +1 -1
  51. package/dist/context/copilot-context.js +2 -4
  52. package/dist/context/copilot-context.js.map +1 -1
  53. package/dist/context/copilot-context.mjs +1 -1
  54. package/dist/context/copilot-messages-context.d.ts +2 -2
  55. package/dist/context/index.d.ts +2 -2
  56. package/dist/context/index.js +2 -4
  57. package/dist/context/index.js.map +1 -1
  58. package/dist/context/index.mjs +4 -4
  59. package/dist/{copilot-context-cf9de848.d.ts → copilot-context-59740e82.d.ts} +2 -2
  60. package/dist/hooks/index.d.ts +2 -2
  61. package/dist/hooks/index.js +18 -28
  62. package/dist/hooks/index.js.map +1 -1
  63. package/dist/hooks/index.mjs +34 -34
  64. package/dist/hooks/use-chat.d.ts +1 -1
  65. package/dist/hooks/use-chat.js +13 -17
  66. package/dist/hooks/use-chat.js.map +1 -1
  67. package/dist/hooks/use-chat.mjs +4 -4
  68. package/dist/hooks/use-coagent-state-render.js +2 -4
  69. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  70. package/dist/hooks/use-coagent-state-render.mjs +2 -2
  71. package/dist/hooks/use-coagent.d.ts +1 -1
  72. package/dist/hooks/use-coagent.js +16 -20
  73. package/dist/hooks/use-coagent.js.map +1 -1
  74. package/dist/hooks/use-coagent.mjs +16 -16
  75. package/dist/hooks/use-copilot-action.js +2 -4
  76. package/dist/hooks/use-copilot-action.js.map +1 -1
  77. package/dist/hooks/use-copilot-action.mjs +2 -2
  78. package/dist/hooks/use-copilot-additional-instructions.js +2 -4
  79. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
  80. package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
  81. package/dist/hooks/use-copilot-authenticated-action.js +2 -4
  82. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  83. package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
  84. package/dist/hooks/use-copilot-chat-headless_c.d.ts +2 -2
  85. package/dist/hooks/use-copilot-chat-headless_c.js +16 -20
  86. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  87. package/dist/hooks/use-copilot-chat-headless_c.mjs +16 -16
  88. package/dist/hooks/use-copilot-chat.d.ts +2 -2
  89. package/dist/hooks/use-copilot-chat.js +16 -20
  90. package/dist/hooks/use-copilot-chat.js.map +1 -1
  91. package/dist/hooks/use-copilot-chat.mjs +16 -16
  92. package/dist/hooks/use-copilot-chat_internal.d.ts +2 -2
  93. package/dist/hooks/use-copilot-chat_internal.js +16 -20
  94. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  95. package/dist/hooks/use-copilot-chat_internal.mjs +15 -15
  96. package/dist/hooks/use-copilot-readable.js +2 -4
  97. package/dist/hooks/use-copilot-readable.js.map +1 -1
  98. package/dist/hooks/use-copilot-readable.mjs +2 -2
  99. package/dist/hooks/use-langgraph-interrupt-render.js +5 -7
  100. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  101. package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
  102. package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
  103. package/dist/hooks/use-langgraph-interrupt.js +18 -28
  104. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  105. package/dist/hooks/use-langgraph-interrupt.mjs +16 -16
  106. package/dist/hooks/use-make-copilot-document-readable.js +2 -4
  107. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  108. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  109. package/dist/{index-1f5b66ac.d.ts → index-d1743abe.d.ts} +1 -1
  110. package/dist/index.d.ts +2 -2
  111. package/dist/index.js +37 -54
  112. package/dist/index.js.map +1 -1
  113. package/dist/index.mjs +39 -39
  114. package/dist/lib/copilot-task.d.ts +1 -1
  115. package/dist/lib/copilot-task.js.map +1 -1
  116. package/dist/lib/copilot-task.mjs +12 -12
  117. package/dist/lib/index.d.ts +1 -1
  118. package/dist/lib/index.js.map +1 -1
  119. package/dist/lib/index.mjs +12 -12
  120. package/dist/types/interrupt-action.d.ts +1 -1
  121. package/dist/types/interrupt-action.js.map +1 -1
  122. package/dist/utils/extract.d.ts +2 -2
  123. package/dist/utils/extract.js.map +1 -1
  124. package/dist/utils/extract.mjs +10 -10
  125. package/dist/utils/index.d.ts +2 -2
  126. package/dist/utils/index.js.map +1 -1
  127. package/dist/utils/index.mjs +10 -10
  128. package/dist/utils/suggestions.d.ts +2 -2
  129. package/dist/utils/suggestions.js.map +1 -1
  130. package/dist/utils/suggestions.mjs +10 -10
  131. package/package.json +3 -3
  132. package/src/components/copilot-provider/copilotkit.tsx +17 -27
  133. package/src/context/copilot-context.tsx +3 -3
  134. package/src/hooks/use-chat.ts +7 -9
  135. package/src/hooks/use-langgraph-interrupt-render.ts +3 -4
  136. package/src/hooks/use-langgraph-interrupt.ts +3 -8
  137. package/src/types/interrupt-action.ts +1 -4
  138. package/dist/chunk-3N4MVKFZ.mjs.map +0 -1
  139. package/dist/chunk-ITDKIB5E.mjs.map +0 -1
  140. package/dist/chunk-L5MS4UDD.mjs.map +0 -1
  141. package/dist/chunk-ZVOLWJCY.mjs.map +0 -1
  142. /package/dist/{chunk-M37URBJS.mjs.map → chunk-2MGJO3FY.mjs.map} +0 -0
  143. /package/dist/{chunk-3WUDRJTT.mjs.map → chunk-2QZSAQTX.mjs.map} +0 -0
  144. /package/dist/{chunk-HDOG2RTM.mjs.map → chunk-36FJAVOF.mjs.map} +0 -0
  145. /package/dist/{chunk-BBUQMG45.mjs.map → chunk-CXDK6XA5.mjs.map} +0 -0
  146. /package/dist/{chunk-TUTNHDM3.mjs.map → chunk-DSDAZA3B.mjs.map} +0 -0
  147. /package/dist/{chunk-CUWOXXM5.mjs.map → chunk-FRXYSJGZ.mjs.map} +0 -0
  148. /package/dist/{chunk-HI6SPUOX.mjs.map → chunk-JEMBA7PE.mjs.map} +0 -0
  149. /package/dist/{chunk-GIGUZ2OK.mjs.map → chunk-KWS75AOU.mjs.map} +0 -0
  150. /package/dist/{chunk-MGWRDFBE.mjs.map → chunk-MZ37BAAE.mjs.map} +0 -0
  151. /package/dist/{chunk-L3I57GMV.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
  152. /package/dist/{chunk-7LTRT3IV.mjs.map → chunk-O73FZGSU.mjs.map} +0 -0
  153. /package/dist/{chunk-HYJUBYMU.mjs.map → chunk-OLXYK6PP.mjs.map} +0 -0
  154. /package/dist/{chunk-JCHRWCYH.mjs.map → chunk-RLT4KZR4.mjs.map} +0 -0
  155. /package/dist/{chunk-IHV5PTID.mjs.map → chunk-UPQPBCUW.mjs.map} +0 -0
  156. /package/dist/{chunk-JBACWIFW.mjs.map → chunk-XFJNMZ6X.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,64 +1,5 @@
1
1
  # ui
2
2
 
3
- ## 1.10.5-next.10
4
-
5
- ### Patch Changes
6
-
7
- - b79ed5c: - fix: prevent double action calls on none render copilot actions
8
- - @copilotkit/runtime-client-gql@1.10.5-next.10
9
- - @copilotkit/shared@1.10.5-next.10
10
-
11
- ## 1.10.5-next.9
12
-
13
- ### Patch Changes
14
-
15
- - @copilotkit/runtime-client-gql@1.10.5-next.9
16
- - @copilotkit/shared@1.10.5-next.9
17
-
18
- ## 1.10.5-next.8
19
-
20
- ### Patch Changes
21
-
22
- - @copilotkit/runtime-client-gql@1.10.5-next.8
23
- - @copilotkit/shared@1.10.5-next.8
24
-
25
- ## 1.10.5-next.7
26
-
27
- ### Patch Changes
28
-
29
- - @copilotkit/runtime-client-gql@1.10.5-next.7
30
- - @copilotkit/shared@1.10.5-next.7
31
-
32
- ## 1.10.5-next.6
33
-
34
- ### Patch Changes
35
-
36
- - f3fdd7a: - fix: stop chat from contacting agent that has errored
37
- - @copilotkit/runtime-client-gql@1.10.5-next.6
38
- - @copilotkit/shared@1.10.5-next.6
39
-
40
- ## 1.10.5-next.5
41
-
42
- ### Patch Changes
43
-
44
- - 6112a67: - fix: consider edge cases when regenerate button is used
45
- - @copilotkit/runtime-client-gql@1.10.5-next.5
46
- - @copilotkit/shared@1.10.5-next.5
47
-
48
- ## 1.10.5-next.4
49
-
50
- ### Patch Changes
51
-
52
- - @copilotkit/runtime-client-gql@1.10.5-next.4
53
- - @copilotkit/shared@1.10.5-next.4
54
-
55
- ## 1.10.5-next.3
56
-
57
- ### Patch Changes
58
-
59
- - @copilotkit/runtime-client-gql@1.10.5-next.3
60
- - @copilotkit/shared@1.10.5-next.3
61
-
62
3
  ## 1.10.5-next.2
63
4
 
64
5
  ### Patch Changes
@@ -1,15 +1,15 @@
1
- import {
2
- CopilotMessagesContext
3
- } from "./chunk-ZLQVRPDS.mjs";
4
1
  import {
5
2
  shouldShowDevConsole
6
3
  } from "./chunk-ICIK2BSB.mjs";
7
- import {
8
- useCopilotContext
9
- } from "./chunk-EUX2P2E7.mjs";
10
4
  import {
11
5
  useToast
12
6
  } from "./chunk-EFL5OBKN.mjs";
7
+ import {
8
+ useCopilotContext
9
+ } from "./chunk-YHT6CWIY.mjs";
10
+ import {
11
+ CopilotMessagesContext
12
+ } from "./chunk-ZLQVRPDS.mjs";
13
13
  import {
14
14
  __async
15
15
  } from "./chunk-SKC7AJIV.mjs";
@@ -219,4 +219,4 @@ export {
219
219
  MessagesTapProvider,
220
220
  CopilotMessages
221
221
  };
222
- //# sourceMappingURL=chunk-M37URBJS.mjs.map
222
+ //# sourceMappingURL=chunk-2MGJO3FY.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- CopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
4
1
  import {
5
2
  useToast
6
3
  } from "./chunk-EFL5OBKN.mjs";
4
+ import {
5
+ CopilotContext
6
+ } from "./chunk-YHT6CWIY.mjs";
7
7
 
8
8
  // src/hooks/use-coagent-state-render.ts
9
9
  import { useRef, useContext, useEffect } from "react";
@@ -85,4 +85,4 @@ function useCoAgentStateRender(action, dependencies) {
85
85
  export {
86
86
  useCoAgentStateRender
87
87
  };
88
- //# sourceMappingURL=chunk-3WUDRJTT.mjs.map
88
+ //# sourceMappingURL=chunk-2QZSAQTX.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
3
+ } from "./chunk-YHT6CWIY.mjs";
4
4
 
5
5
  // src/hooks/use-copilot-readable.ts
6
6
  import { useEffect, useRef } from "react";
@@ -34,4 +34,4 @@ function useCopilotReadable({
34
34
  export {
35
35
  useCopilotReadable
36
36
  };
37
- //# sourceMappingURL=chunk-HDOG2RTM.mjs.map
37
+ //# sourceMappingURL=chunk-36FJAVOF.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
3
+ } from "./chunk-YHT6CWIY.mjs";
4
4
 
5
5
  // src/hooks/use-make-copilot-document-readable.ts
6
6
  import { useEffect, useRef } from "react";
@@ -20,4 +20,4 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
20
20
  export {
21
21
  useMakeCopilotDocumentReadable
22
22
  };
23
- //# sourceMappingURL=chunk-BBUQMG45.mjs.map
23
+ //# sourceMappingURL=chunk-CXDK6XA5.mjs.map
@@ -3,12 +3,12 @@ import {
3
3
  CopilotKitIcon,
4
4
  ExclamationMarkTriangleIcon
5
5
  } from "./chunk-PIF5KJYI.mjs";
6
+ import {
7
+ useCopilotContext
8
+ } from "./chunk-YHT6CWIY.mjs";
6
9
  import {
7
10
  useCopilotMessagesContext
8
11
  } from "./chunk-ZLQVRPDS.mjs";
9
- import {
10
- useCopilotContext
11
- } from "./chunk-EUX2P2E7.mjs";
12
12
 
13
13
  // src/components/dev-console/developer-console-modal.tsx
14
14
  import { COPILOTKIT_VERSION } from "@copilotkit/shared";
@@ -756,4 +756,4 @@ function ContextTab({ context }) {
756
756
  export {
757
757
  DeveloperConsoleModal
758
758
  };
759
- //# sourceMappingURL=chunk-TUTNHDM3.mjs.map
759
+ //# sourceMappingURL=chunk-DSDAZA3B.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DeveloperConsoleModal
3
- } from "./chunk-TUTNHDM3.mjs";
3
+ } from "./chunk-DSDAZA3B.mjs";
4
4
  import {
5
5
  CopilotKitIcon
6
6
  } from "./chunk-PIF5KJYI.mjs";
7
7
  import {
8
8
  useCopilotContext
9
- } from "./chunk-EUX2P2E7.mjs";
9
+ } from "./chunk-YHT6CWIY.mjs";
10
10
 
11
11
  // src/components/dev-console/console-trigger.tsx
12
12
  import { useState, useEffect, useRef } from "react";
@@ -228,4 +228,4 @@ function ConsoleTrigger({ position = "bottom-right" }) {
228
228
  export {
229
229
  ConsoleTrigger
230
230
  };
231
- //# sourceMappingURL=chunk-CUWOXXM5.mjs.map
231
+ //# sourceMappingURL=chunk-FRXYSJGZ.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAsyncCallback
3
3
  } from "./chunk-N4WEHORG.mjs";
4
- import {
5
- useCopilotContext
6
- } from "./chunk-EUX2P2E7.mjs";
7
4
  import {
8
5
  useToast
9
6
  } from "./chunk-EFL5OBKN.mjs";
7
+ import {
8
+ useCopilotContext
9
+ } from "./chunk-YHT6CWIY.mjs";
10
10
  import {
11
11
  __async,
12
12
  __spreadValues
@@ -139,4 +139,4 @@ function isFrontendAction(action) {
139
139
  export {
140
140
  useCopilotAction
141
141
  };
142
- //# sourceMappingURL=chunk-HI6SPUOX.mjs.map
142
+ //# sourceMappingURL=chunk-JEMBA7PE.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useCopilotAction
3
- } from "./chunk-HI6SPUOX.mjs";
3
+ } from "./chunk-JEMBA7PE.mjs";
4
4
  import {
5
5
  useCopilotContext
6
- } from "./chunk-EUX2P2E7.mjs";
6
+ } from "./chunk-YHT6CWIY.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues
@@ -56,4 +56,4 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
56
56
  export {
57
57
  useCopilotAuthenticatedAction_c
58
58
  };
59
- //# sourceMappingURL=chunk-GIGUZ2OK.mjs.map
59
+ //# sourceMappingURL=chunk-KWS75AOU.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
3
+ } from "./chunk-YHT6CWIY.mjs";
4
4
 
5
5
  // src/hooks/use-copilot-additional-instructions.ts
6
6
  import { useEffect } from "react";
@@ -21,4 +21,4 @@ function useCopilotAdditionalInstructions({ instructions, available = "enabled"
21
21
  export {
22
22
  useCopilotAdditionalInstructions
23
23
  };
24
- //# sourceMappingURL=chunk-MGWRDFBE.mjs.map
24
+ //# sourceMappingURL=chunk-MZ37BAAE.mjs.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  StatusChecker
3
3
  } from "./chunk-PMAFHQ7P.mjs";
4
+ import {
5
+ useErrorToast
6
+ } from "./chunk-N4WEHORG.mjs";
4
7
  import {
5
8
  UsageBanner,
6
9
  getErrorActions
7
10
  } from "./chunk-6ZLPNY7X.mjs";
8
- import {
9
- useErrorToast
10
- } from "./chunk-N4WEHORG.mjs";
11
11
 
12
12
  // src/components/error-boundary/error-boundary.tsx
13
13
  import React, { useEffect } from "react";
@@ -80,4 +80,4 @@ export {
80
80
  CopilotErrorBoundary,
81
81
  ErrorToast
82
82
  };
83
- //# sourceMappingURL=chunk-L3I57GMV.mjs.map
83
+ //# sourceMappingURL=chunk-N4VN2B5S.mjs.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-HYJUBYMU.mjs";
3
+ } from "./chunk-OLXYK6PP.mjs";
4
4
  import {
5
5
  useMessagesTap
6
- } from "./chunk-M37URBJS.mjs";
7
- import {
8
- useAsyncCallback
9
- } from "./chunk-N4WEHORG.mjs";
6
+ } from "./chunk-2MGJO3FY.mjs";
10
7
  import {
11
8
  useCopilotRuntimeClient
12
9
  } from "./chunk-Q3MCVRO3.mjs";
13
10
  import {
14
- useCopilotContext
15
- } from "./chunk-EUX2P2E7.mjs";
11
+ useAsyncCallback
12
+ } from "./chunk-N4WEHORG.mjs";
16
13
  import {
17
14
  useToast
18
15
  } from "./chunk-EFL5OBKN.mjs";
16
+ import {
17
+ useCopilotContext
18
+ } from "./chunk-YHT6CWIY.mjs";
19
19
  import {
20
20
  __async,
21
21
  __spreadProps,
@@ -236,4 +236,4 @@ export {
236
236
  stopAgent,
237
237
  runAgent
238
238
  };
239
- //# sourceMappingURL=chunk-7LTRT3IV.mjs.map
239
+ //# sourceMappingURL=chunk-O73FZGSU.mjs.map
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  useLangGraphInterruptRender
3
- } from "./chunk-ZVOLWJCY.mjs";
3
+ } from "./chunk-QF3Q5LUN.mjs";
4
+ import {
5
+ useChat
6
+ } from "./chunk-WBBJMOZI.mjs";
4
7
  import {
5
8
  defaultCopilotContextCategories,
6
9
  reloadSuggestions
7
- } from "./chunk-ITDKIB5E.mjs";
8
- import {
9
- useCopilotMessagesContext
10
- } from "./chunk-ZLQVRPDS.mjs";
11
- import {
12
- useChat
13
- } from "./chunk-3N4MVKFZ.mjs";
10
+ } from "./chunk-ZRDV3MVW.mjs";
14
11
  import {
15
12
  useAsyncCallback
16
13
  } from "./chunk-N4WEHORG.mjs";
17
14
  import {
18
15
  useCopilotContext
19
- } from "./chunk-EUX2P2E7.mjs";
16
+ } from "./chunk-YHT6CWIY.mjs";
17
+ import {
18
+ useCopilotMessagesContext
19
+ } from "./chunk-ZLQVRPDS.mjs";
20
20
  import {
21
21
  __async,
22
22
  __spreadProps,
@@ -329,4 +329,4 @@ export {
329
329
  useCopilotChat,
330
330
  defaultSystemMessage
331
331
  };
332
- //# sourceMappingURL=chunk-HYJUBYMU.mjs.map
332
+ //# sourceMappingURL=chunk-OLXYK6PP.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotContext
3
- } from "./chunk-EUX2P2E7.mjs";
3
+ } from "./chunk-YHT6CWIY.mjs";
4
4
 
5
5
  // src/hooks/use-langgraph-interrupt-render.ts
6
6
  import React, { useCallback } from "react";
@@ -8,16 +8,16 @@ var InterruptRenderer = ({ event, result, render, resolve }) => {
8
8
  return render({ event, result, resolve });
9
9
  };
10
10
  function useLangGraphInterruptRender() {
11
- const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession, threadId } = useCopilotContext();
11
+ const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession } = useCopilotContext();
12
12
  const responseRef = React.useRef();
13
13
  const resolveInterrupt = useCallback(
14
14
  (response) => {
15
15
  responseRef.current = response;
16
16
  setTimeout(() => {
17
- setLangGraphInterruptAction(threadId, { event: { response } });
17
+ setLangGraphInterruptAction({ event: { response } });
18
18
  }, 0);
19
19
  },
20
- [setLangGraphInterruptAction, threadId]
20
+ [setLangGraphInterruptAction]
21
21
  );
22
22
  if (!langGraphInterruptAction || !langGraphInterruptAction.event || !langGraphInterruptAction.render)
23
23
  return null;
@@ -44,4 +44,4 @@ function useLangGraphInterruptRender() {
44
44
  export {
45
45
  useLangGraphInterruptRender
46
46
  };
47
- //# sourceMappingURL=chunk-ZVOLWJCY.mjs.map
47
+ //# sourceMappingURL=chunk-QF3Q5LUN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/use-langgraph-interrupt-render.ts"],"sourcesContent":["import { useCopilotContext } from \"../context\";\nimport React, { useCallback } from \"react\";\nimport { executeConditions } from \"@copilotkit/shared\";\n\ntype InterruptProps = {\n event: any;\n result: any;\n render: (props: {\n event: any;\n result: any;\n resolve: (response: string) => void;\n }) => string | React.ReactElement;\n resolve: (response: string) => void;\n};\n\nconst InterruptRenderer: React.FC<InterruptProps> = ({ event, result, render, resolve }) => {\n return render({ event, result, resolve });\n};\n\nexport function useLangGraphInterruptRender(): string | React.ReactElement | null {\n const { langGraphInterruptAction, setLangGraphInterruptAction, agentSession } =\n useCopilotContext();\n\n const responseRef = React.useRef<string>();\n const resolveInterrupt = useCallback(\n (response: string) => {\n responseRef.current = response;\n // Use setTimeout to defer the state update to next tick\n setTimeout(() => {\n setLangGraphInterruptAction({ event: { response } });\n }, 0);\n },\n [setLangGraphInterruptAction],\n );\n\n if (\n !langGraphInterruptAction ||\n !langGraphInterruptAction.event ||\n !langGraphInterruptAction.render\n )\n return null;\n\n const { render, handler, event, enabled } = langGraphInterruptAction;\n\n const conditionsMet =\n !agentSession || !enabled\n ? true\n : enabled({ eventValue: event.value, agentMetadata: agentSession });\n if (!conditionsMet) {\n return null;\n }\n\n let result = null;\n if (handler) {\n result = handler({\n event,\n resolve: resolveInterrupt,\n });\n }\n\n return React.createElement(InterruptRenderer, {\n event,\n result,\n render,\n resolve: resolveInterrupt,\n });\n}\n"],"mappings":";;;;;AACA,OAAO,SAAS,mBAAmB;AAcnC,IAAM,oBAA8C,CAAC,EAAE,OAAO,QAAQ,QAAQ,QAAQ,MAAM;AAC1F,SAAO,OAAO,EAAE,OAAO,QAAQ,QAAQ,CAAC;AAC1C;AAEO,SAAS,8BAAkE;AAChF,QAAM,EAAE,0BAA0B,6BAA6B,aAAa,IAC1E,kBAAkB;AAEpB,QAAM,cAAc,MAAM,OAAe;AACzC,QAAM,mBAAmB;AAAA,IACvB,CAAC,aAAqB;AACpB,kBAAY,UAAU;AAEtB,iBAAW,MAAM;AACf,oCAA4B,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,MACrD,GAAG,CAAC;AAAA,IACN;AAAA,IACA,CAAC,2BAA2B;AAAA,EAC9B;AAEA,MACE,CAAC,4BACD,CAAC,yBAAyB,SAC1B,CAAC,yBAAyB;AAE1B,WAAO;AAET,QAAM,EAAE,QAAQ,SAAS,OAAO,QAAQ,IAAI;AAE5C,QAAM,gBACJ,CAAC,gBAAgB,CAAC,UACd,OACA,QAAQ,EAAE,YAAY,MAAM,OAAO,eAAe,aAAa,CAAC;AACtE,MAAI,CAAC,eAAe;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS;AACb,MAAI,SAAS;AACX,aAAS,QAAQ;AAAA,MACf;AAAA,MACA,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAEA,SAAO,MAAM,cAAc,mBAAmB;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AACH;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useCopilotChat
3
- } from "./chunk-HYJUBYMU.mjs";
3
+ } from "./chunk-OLXYK6PP.mjs";
4
4
  import {
5
5
  useCopilotContext
6
- } from "./chunk-EUX2P2E7.mjs";
6
+ } from "./chunk-YHT6CWIY.mjs";
7
7
  import {
8
8
  __async
9
9
  } from "./chunk-SKC7AJIV.mjs";
@@ -82,4 +82,4 @@ function useCopilotChatHeadless_c(options = {}) {
82
82
  export {
83
83
  useCopilotChatHeadless_c
84
84
  };
85
- //# sourceMappingURL=chunk-JCHRWCYH.mjs.map
85
+ //# sourceMappingURL=chunk-RLT4KZR4.mjs.map
@@ -1,9 +1,9 @@
1
- import {
2
- defaultCopilotContextCategories
3
- } from "./chunk-ITDKIB5E.mjs";
4
1
  import {
5
2
  processActionsForRuntimeRequest
6
3
  } from "./chunk-4CEQJ2X6.mjs";
4
+ import {
5
+ defaultCopilotContextCategories
6
+ } from "./chunk-ZRDV3MVW.mjs";
7
7
  import {
8
8
  __async,
9
9
  __spreadValues
@@ -117,4 +117,4 @@ ${instructions}
117
117
  export {
118
118
  CopilotTask
119
119
  };
120
- //# sourceMappingURL=chunk-IHV5PTID.mjs.map
120
+ //# sourceMappingURL=chunk-UPQPBCUW.mjs.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  processActionsForRuntimeRequest
3
3
  } from "./chunk-4CEQJ2X6.mjs";
4
- import {
5
- useAsyncCallback,
6
- useErrorToast
7
- } from "./chunk-N4WEHORG.mjs";
8
4
  import {
9
5
  useCopilotRuntimeClient
10
6
  } from "./chunk-Q3MCVRO3.mjs";
11
7
  import {
12
- useCopilotContext
13
- } from "./chunk-EUX2P2E7.mjs";
8
+ useAsyncCallback,
9
+ useErrorToast
10
+ } from "./chunk-N4WEHORG.mjs";
14
11
  import {
15
12
  useToast
16
13
  } from "./chunk-EFL5OBKN.mjs";
14
+ import {
15
+ useCopilotContext
16
+ } from "./chunk-YHT6CWIY.mjs";
17
17
  import {
18
18
  __async,
19
19
  __spreadProps,
@@ -248,7 +248,7 @@ function useChat(options) {
248
248
  if (ev.name === MetaEventName.LangGraphInterruptEvent) {
249
249
  let eventValue = langGraphInterruptEvent(ev).value;
250
250
  eventValue = parseJson(eventValue, eventValue);
251
- setLangGraphInterruptAction(threadId, {
251
+ setLangGraphInterruptAction({
252
252
  event: __spreadProps(__spreadValues({}, langGraphInterruptEvent(ev)), {
253
253
  value: eventValue
254
254
  })
@@ -311,7 +311,7 @@ function useChat(options) {
311
311
  preservedStructure: !!originalCode
312
312
  });
313
313
  setIsLoading(false);
314
- throw new Error(structuredError.message);
314
+ break;
315
315
  } else if (messages2.length > 0) {
316
316
  newMessages = [...messages2];
317
317
  for (const message of messages2) {
@@ -432,8 +432,8 @@ function useChat(options) {
432
432
  }
433
433
  const currentResultMessagePairedFeAction = message.isResultMessage() ? getPairedFeAction(actions, message) : null;
434
434
  if (action && message.isActionExecutionMessage()) {
435
- const pairedFeAction = getPairedFeAction(actions, message);
436
- const alreadyProcessed = !pairedFeAction && finalMessages.some(
435
+ const isRenderAndWaitAction = (action == null ? void 0 : action._isRenderAndWait) || false;
436
+ const alreadyProcessed = isRenderAndWaitAction && finalMessages.some(
437
437
  (fm) => fm.isResultMessage() && fm.actionExecutionId === message.id
438
438
  );
439
439
  if (alreadyProcessed) {
@@ -442,16 +442,16 @@ function useChat(options) {
442
442
  action,
443
443
  message
444
444
  );
445
- const pairedFeAction2 = getPairedFeAction(actions, resultMessage);
446
- if (pairedFeAction2) {
445
+ const pairedFeAction = getPairedFeAction(actions, resultMessage);
446
+ if (pairedFeAction) {
447
447
  const newExecutionMessage = new ActionExecutionMessage({
448
- name: pairedFeAction2.name,
448
+ name: pairedFeAction.name,
449
449
  arguments: parseJson(resultMessage.result, resultMessage.result),
450
450
  status: message.status,
451
451
  createdAt: message.createdAt,
452
452
  parentMessageId: message.parentMessageId
453
453
  });
454
- yield executeActionFromMessage(pairedFeAction2, newExecutionMessage);
454
+ yield executeActionFromMessage(pairedFeAction, newExecutionMessage);
455
455
  }
456
456
  }
457
457
  } else if (message.isResultMessage() && currentResultMessagePairedFeAction) {
@@ -546,7 +546,7 @@ function useChat(options) {
546
546
  switch (event.name) {
547
547
  case MetaEventName.LangGraphInterruptEvent:
548
548
  if (event.response) {
549
- setLangGraphInterruptAction(threadId, null);
549
+ setLangGraphInterruptAction(null);
550
550
  const value = event.value;
551
551
  return [
552
552
  ...acc,
@@ -596,8 +596,8 @@ function useChat(options) {
596
596
  console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
597
597
  return;
598
598
  }
599
- let historyCutoff = [messages[0]];
600
- if (messages.length > 2 && reloadMessageIndex !== 0) {
599
+ let historyCutoff = [];
600
+ if (messages.length > 2) {
601
601
  const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
602
602
  (msg) => (
603
603
  // @ts-expect-error -- message has role
@@ -608,8 +608,6 @@ function useChat(options) {
608
608
  (msg) => msg.id === lastUserMessageBeforeRegenerate.id
609
609
  );
610
610
  historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
611
- } else if (messages.length > 2 && reloadMessageIndex === 0) {
612
- historyCutoff = [messages[0], messages[1]];
613
611
  }
614
612
  setMessages(historyCutoff);
615
613
  return runChatCompletionAndHandleFunctionCall(historyCutoff);
@@ -720,4 +718,4 @@ function getPairedFeAction(actions, message) {
720
718
  export {
721
719
  useChat
722
720
  };
723
- //# sourceMappingURL=chunk-3N4MVKFZ.mjs.map
721
+ //# sourceMappingURL=chunk-WBBJMOZI.mjs.map