@copilotkit/react-core 2.0.0-next.1 → 2.0.0-rc.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.
Files changed (538) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -12
  3. package/dist/MarkdownRendererContext-B4Us6mwL.d.cts +954 -0
  4. package/dist/MarkdownRendererContext-B4Us6mwL.d.cts.map +1 -0
  5. package/dist/MarkdownRendererContext-CRKFzsEB.d.mts +954 -0
  6. package/dist/MarkdownRendererContext-CRKFzsEB.d.mts.map +1 -0
  7. package/dist/MarkdownSurfaces-C2XZISKn.cjs +3964 -0
  8. package/dist/MarkdownSurfaces-C2XZISKn.cjs.map +1 -0
  9. package/dist/MarkdownSurfaces-ChSlVYOk.mjs +3655 -0
  10. package/dist/MarkdownSurfaces-ChSlVYOk.mjs.map +1 -0
  11. package/dist/context.cjs +144 -0
  12. package/dist/context.cjs.map +1 -0
  13. package/dist/context.d.cts +166 -0
  14. package/dist/context.d.cts.map +1 -0
  15. package/dist/context.d.mts +166 -0
  16. package/dist/context.d.mts.map +1 -0
  17. package/dist/context.mjs +136 -0
  18. package/dist/context.mjs.map +1 -0
  19. package/dist/generative-ui.cjs +8151 -0
  20. package/dist/generative-ui.cjs.map +1 -0
  21. package/dist/generative-ui.d.cts +4952 -0
  22. package/dist/generative-ui.d.cts.map +1 -0
  23. package/dist/generative-ui.d.mts +4952 -0
  24. package/dist/generative-ui.d.mts.map +1 -0
  25. package/dist/generative-ui.mjs +8137 -0
  26. package/dist/generative-ui.mjs.map +1 -0
  27. package/dist/headless.cjs +1927 -0
  28. package/dist/headless.cjs.map +1 -0
  29. package/dist/headless.d.cts +1117 -0
  30. package/dist/headless.d.cts.map +1 -0
  31. package/dist/headless.d.mts +1008 -0
  32. package/dist/headless.d.mts.map +1 -0
  33. package/dist/headless.mjs +1869 -0
  34. package/dist/headless.mjs.map +1 -0
  35. package/dist/index.cjs +15576 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.css +2 -0
  38. package/dist/index.d.cts +3450 -0
  39. package/dist/index.d.cts.map +1 -0
  40. package/dist/index.d.mts +3433 -0
  41. package/dist/index.d.mts.map +1 -0
  42. package/dist/index.mjs +13927 -146
  43. package/dist/index.mjs.map +1 -1
  44. package/dist/index.umd.js +18856 -0
  45. package/dist/index.umd.js.map +1 -0
  46. package/package.json +124 -52
  47. package/CHANGELOG.md +0 -4210
  48. package/dist/chunk-2IDV5OHF.mjs +0 -11
  49. package/dist/chunk-2IDV5OHF.mjs.map +0 -1
  50. package/dist/chunk-36KQV2NA.mjs +0 -1
  51. package/dist/chunk-36KQV2NA.mjs.map +0 -1
  52. package/dist/chunk-3V5TOYKW.mjs +0 -120
  53. package/dist/chunk-3V5TOYKW.mjs.map +0 -1
  54. package/dist/chunk-4CEQJ2X6.mjs +0 -31
  55. package/dist/chunk-4CEQJ2X6.mjs.map +0 -1
  56. package/dist/chunk-4RRMC7L2.mjs +0 -32
  57. package/dist/chunk-4RRMC7L2.mjs.map +0 -1
  58. package/dist/chunk-4YZA2BZC.mjs +0 -551
  59. package/dist/chunk-4YZA2BZC.mjs.map +0 -1
  60. package/dist/chunk-53K6WNJG.mjs +0 -36
  61. package/dist/chunk-53K6WNJG.mjs.map +0 -1
  62. package/dist/chunk-6ESSSQ7Q.mjs +0 -134
  63. package/dist/chunk-6ESSSQ7Q.mjs.map +0 -1
  64. package/dist/chunk-6PUNP7CD.mjs +0 -102
  65. package/dist/chunk-6PUNP7CD.mjs.map +0 -1
  66. package/dist/chunk-6YOKPWQ7.mjs +0 -1
  67. package/dist/chunk-6YOKPWQ7.mjs.map +0 -1
  68. package/dist/chunk-6ZLPNY7X.mjs +0 -225
  69. package/dist/chunk-6ZLPNY7X.mjs.map +0 -1
  70. package/dist/chunk-7DTB7S5V.mjs +0 -83
  71. package/dist/chunk-7DTB7S5V.mjs.map +0 -1
  72. package/dist/chunk-7IBF6RBW.mjs +0 -23
  73. package/dist/chunk-7IBF6RBW.mjs.map +0 -1
  74. package/dist/chunk-A6NKSGH3.mjs +0 -1
  75. package/dist/chunk-A6NKSGH3.mjs.map +0 -1
  76. package/dist/chunk-ABWT4DRT.mjs +0 -24
  77. package/dist/chunk-ABWT4DRT.mjs.map +0 -1
  78. package/dist/chunk-AFNWX62Q.mjs +0 -110
  79. package/dist/chunk-AFNWX62Q.mjs.map +0 -1
  80. package/dist/chunk-BUSWSDYO.mjs +0 -17
  81. package/dist/chunk-BUSWSDYO.mjs.map +0 -1
  82. package/dist/chunk-CDUIA2WM.mjs +0 -60
  83. package/dist/chunk-CDUIA2WM.mjs.map +0 -1
  84. package/dist/chunk-CYDWEPFL.mjs +0 -1
  85. package/dist/chunk-CYDWEPFL.mjs.map +0 -1
  86. package/dist/chunk-DMLQZG75.mjs +0 -25
  87. package/dist/chunk-DMLQZG75.mjs.map +0 -1
  88. package/dist/chunk-E7SE25ZU.mjs +0 -59
  89. package/dist/chunk-E7SE25ZU.mjs.map +0 -1
  90. package/dist/chunk-EFL5OBKN.mjs +0 -310
  91. package/dist/chunk-EFL5OBKN.mjs.map +0 -1
  92. package/dist/chunk-F555TVE4.mjs +0 -33
  93. package/dist/chunk-F555TVE4.mjs.map +0 -1
  94. package/dist/chunk-FD6FGKYY.mjs +0 -1
  95. package/dist/chunk-FD6FGKYY.mjs.map +0 -1
  96. package/dist/chunk-FDOMAPJY.mjs +0 -59
  97. package/dist/chunk-FDOMAPJY.mjs.map +0 -1
  98. package/dist/chunk-FQFXYAV7.mjs +0 -86
  99. package/dist/chunk-FQFXYAV7.mjs.map +0 -1
  100. package/dist/chunk-GPEJNVE5.mjs +0 -80
  101. package/dist/chunk-GPEJNVE5.mjs.map +0 -1
  102. package/dist/chunk-HE22TZMF.mjs +0 -186
  103. package/dist/chunk-HE22TZMF.mjs.map +0 -1
  104. package/dist/chunk-I76HKHPJ.mjs +0 -32
  105. package/dist/chunk-I76HKHPJ.mjs.map +0 -1
  106. package/dist/chunk-ICIK2BSB.mjs +0 -17
  107. package/dist/chunk-ICIK2BSB.mjs.map +0 -1
  108. package/dist/chunk-JD7BAH7U.mjs +0 -1
  109. package/dist/chunk-JD7BAH7U.mjs.map +0 -1
  110. package/dist/chunk-LHERIF3L.mjs +0 -83
  111. package/dist/chunk-LHERIF3L.mjs.map +0 -1
  112. package/dist/chunk-LSHFN2Y5.mjs +0 -349
  113. package/dist/chunk-LSHFN2Y5.mjs.map +0 -1
  114. package/dist/chunk-LUGEI4YQ.mjs +0 -1
  115. package/dist/chunk-LUGEI4YQ.mjs.map +0 -1
  116. package/dist/chunk-NB2FKV2V.mjs +0 -1
  117. package/dist/chunk-NB2FKV2V.mjs.map +0 -1
  118. package/dist/chunk-NBK4KBLX.mjs +0 -54
  119. package/dist/chunk-NBK4KBLX.mjs.map +0 -1
  120. package/dist/chunk-O7ARI5CV.mjs +0 -31
  121. package/dist/chunk-O7ARI5CV.mjs.map +0 -1
  122. package/dist/chunk-PIF5KJYI.mjs +0 -103
  123. package/dist/chunk-PIF5KJYI.mjs.map +0 -1
  124. package/dist/chunk-PMAFHQ7P.mjs +0 -65
  125. package/dist/chunk-PMAFHQ7P.mjs.map +0 -1
  126. package/dist/chunk-QNUAXSDP.mjs +0 -166
  127. package/dist/chunk-QNUAXSDP.mjs.map +0 -1
  128. package/dist/chunk-RKTVJRK7.mjs +0 -143
  129. package/dist/chunk-RKTVJRK7.mjs.map +0 -1
  130. package/dist/chunk-SKC7AJIV.mjs +0 -61
  131. package/dist/chunk-SKC7AJIV.mjs.map +0 -1
  132. package/dist/chunk-SPCZTZCY.mjs +0 -1
  133. package/dist/chunk-SPCZTZCY.mjs.map +0 -1
  134. package/dist/chunk-VV56AVPB.mjs +0 -125
  135. package/dist/chunk-VV56AVPB.mjs.map +0 -1
  136. package/dist/chunk-WF65O6HX.mjs +0 -66
  137. package/dist/chunk-WF65O6HX.mjs.map +0 -1
  138. package/dist/chunk-XDFVCQD3.mjs +0 -27
  139. package/dist/chunk-XDFVCQD3.mjs.map +0 -1
  140. package/dist/chunk-YCG6SNAU.mjs +0 -759
  141. package/dist/chunk-YCG6SNAU.mjs.map +0 -1
  142. package/dist/chunk-YTQHRJUA.mjs +0 -86
  143. package/dist/chunk-YTQHRJUA.mjs.map +0 -1
  144. package/dist/chunk-YYN33GSG.mjs +0 -73
  145. package/dist/chunk-YYN33GSG.mjs.map +0 -1
  146. package/dist/chunk-Z6JV2LRY.mjs +0 -37
  147. package/dist/chunk-Z6JV2LRY.mjs.map +0 -1
  148. package/dist/chunk-ZVF5Q6IH.mjs +0 -29
  149. package/dist/chunk-ZVF5Q6IH.mjs.map +0 -1
  150. package/dist/chunk-ZYTXB6HH.mjs +0 -151
  151. package/dist/chunk-ZYTXB6HH.mjs.map +0 -1
  152. package/dist/components/CopilotListeners.d.ts +0 -3
  153. package/dist/components/CopilotListeners.js +0 -101
  154. package/dist/components/CopilotListeners.js.map +0 -1
  155. package/dist/components/CopilotListeners.mjs +0 -9
  156. package/dist/components/CopilotListeners.mjs.map +0 -1
  157. package/dist/components/copilot-provider/copilot-messages.d.ts +0 -24
  158. package/dist/components/copilot-provider/copilot-messages.js +0 -351
  159. package/dist/components/copilot-provider/copilot-messages.js.map +0 -1
  160. package/dist/components/copilot-provider/copilot-messages.mjs +0 -16
  161. package/dist/components/copilot-provider/copilot-messages.mjs.map +0 -1
  162. package/dist/components/copilot-provider/copilotkit-props.d.ts +0 -160
  163. package/dist/components/copilot-provider/copilotkit-props.js +0 -19
  164. package/dist/components/copilot-provider/copilotkit-props.js.map +0 -1
  165. package/dist/components/copilot-provider/copilotkit-props.mjs +0 -1
  166. package/dist/components/copilot-provider/copilotkit-props.mjs.map +0 -1
  167. package/dist/components/copilot-provider/copilotkit.d.ts +0 -19
  168. package/dist/components/copilot-provider/copilotkit.js +0 -1960
  169. package/dist/components/copilot-provider/copilotkit.js.map +0 -1
  170. package/dist/components/copilot-provider/copilotkit.mjs +0 -31
  171. package/dist/components/copilot-provider/copilotkit.mjs.map +0 -1
  172. package/dist/components/copilot-provider/index.d.ts +0 -14
  173. package/dist/components/copilot-provider/index.js +0 -1960
  174. package/dist/components/copilot-provider/index.js.map +0 -1
  175. package/dist/components/copilot-provider/index.mjs +0 -30
  176. package/dist/components/copilot-provider/index.mjs.map +0 -1
  177. package/dist/components/dev-console/console-trigger.d.ts +0 -8
  178. package/dist/components/dev-console/console-trigger.js +0 -1202
  179. package/dist/components/dev-console/console-trigger.js.map +0 -1
  180. package/dist/components/dev-console/console-trigger.mjs +0 -233
  181. package/dist/components/dev-console/console-trigger.mjs.map +0 -1
  182. package/dist/components/dev-console/developer-console-modal.d.ts +0 -10
  183. package/dist/components/dev-console/developer-console-modal.js +0 -987
  184. package/dist/components/dev-console/developer-console-modal.js.map +0 -1
  185. package/dist/components/dev-console/developer-console-modal.mjs +0 -12
  186. package/dist/components/dev-console/developer-console-modal.mjs.map +0 -1
  187. package/dist/components/dev-console/icons.d.ts +0 -9
  188. package/dist/components/dev-console/icons.js +0 -131
  189. package/dist/components/dev-console/icons.js.map +0 -1
  190. package/dist/components/dev-console/icons.mjs +0 -16
  191. package/dist/components/dev-console/icons.mjs.map +0 -1
  192. package/dist/components/error-boundary/error-boundary.d.ts +0 -31
  193. package/dist/components/error-boundary/error-boundary.js +0 -500
  194. package/dist/components/error-boundary/error-boundary.js.map +0 -1
  195. package/dist/components/error-boundary/error-boundary.mjs +0 -15
  196. package/dist/components/error-boundary/error-boundary.mjs.map +0 -1
  197. package/dist/components/error-boundary/error-utils.d.ts +0 -11
  198. package/dist/components/error-boundary/error-utils.js +0 -190
  199. package/dist/components/error-boundary/error-utils.js.map +0 -1
  200. package/dist/components/error-boundary/error-utils.mjs +0 -14
  201. package/dist/components/error-boundary/error-utils.mjs.map +0 -1
  202. package/dist/components/index.d.ts +0 -14
  203. package/dist/components/index.js +0 -1960
  204. package/dist/components/index.js.map +0 -1
  205. package/dist/components/index.mjs +0 -31
  206. package/dist/components/index.mjs.map +0 -1
  207. package/dist/components/toast/exclamation-mark-icon.d.ts +0 -9
  208. package/dist/components/toast/exclamation-mark-icon.js +0 -55
  209. package/dist/components/toast/exclamation-mark-icon.js.map +0 -1
  210. package/dist/components/toast/exclamation-mark-icon.mjs +0 -8
  211. package/dist/components/toast/exclamation-mark-icon.mjs.map +0 -1
  212. package/dist/components/toast/toast-provider.d.ts +0 -27
  213. package/dist/components/toast/toast-provider.js +0 -347
  214. package/dist/components/toast/toast-provider.js.map +0 -1
  215. package/dist/components/toast/toast-provider.mjs +0 -10
  216. package/dist/components/toast/toast-provider.mjs.map +0 -1
  217. package/dist/components/usage-banner.d.ts +0 -29
  218. package/dist/components/usage-banner.js +0 -247
  219. package/dist/components/usage-banner.js.map +0 -1
  220. package/dist/components/usage-banner.mjs +0 -12
  221. package/dist/components/usage-banner.mjs.map +0 -1
  222. package/dist/context/coagent-state-renders-context.d.ts +0 -24
  223. package/dist/context/coagent-state-renders-context.js +0 -91
  224. package/dist/context/coagent-state-renders-context.js.map +0 -1
  225. package/dist/context/coagent-state-renders-context.mjs +0 -12
  226. package/dist/context/coagent-state-renders-context.mjs.map +0 -1
  227. package/dist/context/copilot-context.d.ts +0 -10
  228. package/dist/context/copilot-context.js +0 -161
  229. package/dist/context/copilot-context.js.map +0 -1
  230. package/dist/context/copilot-context.mjs +0 -10
  231. package/dist/context/copilot-context.mjs.map +0 -1
  232. package/dist/context/copilot-messages-context.d.ts +0 -18
  233. package/dist/context/copilot-messages-context.js +0 -60
  234. package/dist/context/copilot-messages-context.js.map +0 -1
  235. package/dist/context/copilot-messages-context.mjs +0 -10
  236. package/dist/context/copilot-messages-context.mjs.map +0 -1
  237. package/dist/context/index.d.ts +0 -15
  238. package/dist/context/index.js +0 -285
  239. package/dist/context/index.js.map +0 -1
  240. package/dist/context/index.mjs +0 -33
  241. package/dist/context/index.mjs.map +0 -1
  242. package/dist/context/threads-context.d.ts +0 -16
  243. package/dist/context/threads-context.js +0 -59
  244. package/dist/context/threads-context.js.map +0 -1
  245. package/dist/context/threads-context.mjs +0 -12
  246. package/dist/context/threads-context.mjs.map +0 -1
  247. package/dist/copilot-context-ec77e921.d.ts +0 -209
  248. package/dist/hooks/index.d.ts +0 -33
  249. package/dist/hooks/index.js +0 -1774
  250. package/dist/hooks/index.js.map +0 -1
  251. package/dist/hooks/index.mjs +0 -91
  252. package/dist/hooks/index.mjs.map +0 -1
  253. package/dist/hooks/use-agent-nodename.d.ts +0 -3
  254. package/dist/hooks/use-agent-nodename.js +0 -56
  255. package/dist/hooks/use-agent-nodename.js.map +0 -1
  256. package/dist/hooks/use-agent-nodename.mjs +0 -8
  257. package/dist/hooks/use-agent-nodename.mjs.map +0 -1
  258. package/dist/hooks/use-coagent-state-render-bridge.d.ts +0 -100
  259. package/dist/hooks/use-coagent-state-render-bridge.js +0 -214
  260. package/dist/hooks/use-coagent-state-render-bridge.js.map +0 -1
  261. package/dist/hooks/use-coagent-state-render-bridge.mjs +0 -15
  262. package/dist/hooks/use-coagent-state-render-bridge.mjs.map +0 -1
  263. package/dist/hooks/use-coagent-state-render.d.ts +0 -55
  264. package/dist/hooks/use-coagent-state-render.js +0 -255
  265. package/dist/hooks/use-coagent-state-render.js.map +0 -1
  266. package/dist/hooks/use-coagent-state-render.mjs +0 -11
  267. package/dist/hooks/use-coagent-state-render.mjs.map +0 -1
  268. package/dist/hooks/use-coagent.d.ts +0 -192
  269. package/dist/hooks/use-coagent.js +0 -233
  270. package/dist/hooks/use-coagent.js.map +0 -1
  271. package/dist/hooks/use-coagent.mjs +0 -9
  272. package/dist/hooks/use-coagent.mjs.map +0 -1
  273. package/dist/hooks/use-configure-chat-suggestions.d.ts +0 -36
  274. package/dist/hooks/use-configure-chat-suggestions.js +0 -79
  275. package/dist/hooks/use-configure-chat-suggestions.js.map +0 -1
  276. package/dist/hooks/use-configure-chat-suggestions.mjs +0 -47
  277. package/dist/hooks/use-configure-chat-suggestions.mjs.map +0 -1
  278. package/dist/hooks/use-copilot-action.d.ts +0 -103
  279. package/dist/hooks/use-copilot-action.js +0 -295
  280. package/dist/hooks/use-copilot-action.js.map +0 -1
  281. package/dist/hooks/use-copilot-action.mjs +0 -11
  282. package/dist/hooks/use-copilot-action.mjs.map +0 -1
  283. package/dist/hooks/use-copilot-additional-instructions.d.ts +0 -26
  284. package/dist/hooks/use-copilot-additional-instructions.js +0 -177
  285. package/dist/hooks/use-copilot-additional-instructions.js.map +0 -1
  286. package/dist/hooks/use-copilot-additional-instructions.mjs +0 -9
  287. package/dist/hooks/use-copilot-additional-instructions.mjs.map +0 -1
  288. package/dist/hooks/use-copilot-authenticated-action.d.ts +0 -18
  289. package/dist/hooks/use-copilot-authenticated-action.js +0 -462
  290. package/dist/hooks/use-copilot-authenticated-action.js.map +0 -1
  291. package/dist/hooks/use-copilot-authenticated-action.mjs +0 -13
  292. package/dist/hooks/use-copilot-authenticated-action.mjs.map +0 -1
  293. package/dist/hooks/use-copilot-chat-headless_c.d.ts +0 -25
  294. package/dist/hooks/use-copilot-chat-headless_c.js +0 -1044
  295. package/dist/hooks/use-copilot-chat-headless_c.js.map +0 -1
  296. package/dist/hooks/use-copilot-chat-headless_c.mjs +0 -24
  297. package/dist/hooks/use-copilot-chat-headless_c.mjs.map +0 -1
  298. package/dist/hooks/use-copilot-chat-suggestions.d.ts +0 -35
  299. package/dist/hooks/use-copilot-chat-suggestions.js +0 -60
  300. package/dist/hooks/use-copilot-chat-suggestions.js.map +0 -1
  301. package/dist/hooks/use-copilot-chat-suggestions.mjs +0 -8
  302. package/dist/hooks/use-copilot-chat-suggestions.mjs.map +0 -1
  303. package/dist/hooks/use-copilot-chat.d.ts +0 -92
  304. package/dist/hooks/use-copilot-chat.js +0 -978
  305. package/dist/hooks/use-copilot-chat.js.map +0 -1
  306. package/dist/hooks/use-copilot-chat.mjs +0 -21
  307. package/dist/hooks/use-copilot-chat.mjs.map +0 -1
  308. package/dist/hooks/use-copilot-chat_internal.d.ts +0 -244
  309. package/dist/hooks/use-copilot-chat_internal.js +0 -976
  310. package/dist/hooks/use-copilot-chat_internal.js.map +0 -1
  311. package/dist/hooks/use-copilot-chat_internal.mjs +0 -22
  312. package/dist/hooks/use-copilot-chat_internal.mjs.map +0 -1
  313. package/dist/hooks/use-copilot-readable.d.ts +0 -37
  314. package/dist/hooks/use-copilot-readable.js +0 -61
  315. package/dist/hooks/use-copilot-readable.js.map +0 -1
  316. package/dist/hooks/use-copilot-readable.mjs +0 -8
  317. package/dist/hooks/use-copilot-readable.mjs.map +0 -1
  318. package/dist/hooks/use-copilot-runtime-client.d.ts +0 -10
  319. package/dist/hooks/use-copilot-runtime-client.js +0 -203
  320. package/dist/hooks/use-copilot-runtime-client.js.map +0 -1
  321. package/dist/hooks/use-copilot-runtime-client.mjs +0 -9
  322. package/dist/hooks/use-copilot-runtime-client.mjs.map +0 -1
  323. package/dist/hooks/use-default-tool.d.ts +0 -8
  324. package/dist/hooks/use-default-tool.js +0 -302
  325. package/dist/hooks/use-default-tool.js.map +0 -1
  326. package/dist/hooks/use-default-tool.mjs +0 -12
  327. package/dist/hooks/use-default-tool.mjs.map +0 -1
  328. package/dist/hooks/use-flat-category-store.d.ts +0 -9
  329. package/dist/hooks/use-flat-category-store.js +0 -93
  330. package/dist/hooks/use-flat-category-store.js.map +0 -1
  331. package/dist/hooks/use-flat-category-store.mjs +0 -8
  332. package/dist/hooks/use-flat-category-store.mjs.map +0 -1
  333. package/dist/hooks/use-frontend-tool.d.ts +0 -11
  334. package/dist/hooks/use-frontend-tool.js +0 -104
  335. package/dist/hooks/use-frontend-tool.js.map +0 -1
  336. package/dist/hooks/use-frontend-tool.mjs +0 -8
  337. package/dist/hooks/use-frontend-tool.mjs.map +0 -1
  338. package/dist/hooks/use-human-in-the-loop.d.ts +0 -13
  339. package/dist/hooks/use-human-in-the-loop.js +0 -122
  340. package/dist/hooks/use-human-in-the-loop.js.map +0 -1
  341. package/dist/hooks/use-human-in-the-loop.mjs +0 -8
  342. package/dist/hooks/use-human-in-the-loop.mjs.map +0 -1
  343. package/dist/hooks/use-langgraph-interrupt-render.d.ts +0 -6
  344. package/dist/hooks/use-langgraph-interrupt-render.js +0 -318
  345. package/dist/hooks/use-langgraph-interrupt-render.js.map +0 -1
  346. package/dist/hooks/use-langgraph-interrupt-render.mjs +0 -14
  347. package/dist/hooks/use-langgraph-interrupt-render.mjs.map +0 -1
  348. package/dist/hooks/use-langgraph-interrupt.d.ts +0 -14
  349. package/dist/hooks/use-langgraph-interrupt.js +0 -201
  350. package/dist/hooks/use-langgraph-interrupt.js.map +0 -1
  351. package/dist/hooks/use-langgraph-interrupt.mjs +0 -10
  352. package/dist/hooks/use-langgraph-interrupt.mjs.map +0 -1
  353. package/dist/hooks/use-lazy-tool-renderer.d.ts +0 -6
  354. package/dist/hooks/use-lazy-tool-renderer.js +0 -53
  355. package/dist/hooks/use-lazy-tool-renderer.js.map +0 -1
  356. package/dist/hooks/use-lazy-tool-renderer.mjs +0 -8
  357. package/dist/hooks/use-lazy-tool-renderer.mjs.map +0 -1
  358. package/dist/hooks/use-make-copilot-document-readable.d.ts +0 -12
  359. package/dist/hooks/use-make-copilot-document-readable.js +0 -176
  360. package/dist/hooks/use-make-copilot-document-readable.js.map +0 -1
  361. package/dist/hooks/use-make-copilot-document-readable.mjs +0 -9
  362. package/dist/hooks/use-make-copilot-document-readable.mjs.map +0 -1
  363. package/dist/hooks/use-render-tool-call.d.ts +0 -12
  364. package/dist/hooks/use-render-tool-call.js +0 -90
  365. package/dist/hooks/use-render-tool-call.js.map +0 -1
  366. package/dist/hooks/use-render-tool-call.mjs +0 -8
  367. package/dist/hooks/use-render-tool-call.mjs.map +0 -1
  368. package/dist/hooks/use-tree.d.ts +0 -19
  369. package/dist/hooks/use-tree.js +0 -175
  370. package/dist/hooks/use-tree.js.map +0 -1
  371. package/dist/hooks/use-tree.mjs +0 -8
  372. package/dist/hooks/use-tree.mjs.map +0 -1
  373. package/dist/index.d.ts +0 -43
  374. package/dist/index.js +0 -3528
  375. package/dist/index.js.map +0 -1
  376. package/dist/lib/copilot-task.d.ts +0 -97
  377. package/dist/lib/copilot-task.js +0 -194
  378. package/dist/lib/copilot-task.js.map +0 -1
  379. package/dist/lib/copilot-task.mjs +0 -31
  380. package/dist/lib/copilot-task.mjs.map +0 -1
  381. package/dist/lib/index.d.ts +0 -11
  382. package/dist/lib/index.js +0 -196
  383. package/dist/lib/index.js.map +0 -1
  384. package/dist/lib/index.mjs +0 -32
  385. package/dist/lib/index.mjs.map +0 -1
  386. package/dist/lib/status-checker.d.ts +0 -17
  387. package/dist/lib/status-checker.js +0 -102
  388. package/dist/lib/status-checker.js.map +0 -1
  389. package/dist/lib/status-checker.mjs +0 -8
  390. package/dist/lib/status-checker.mjs.map +0 -1
  391. package/dist/setupTests.d.ts +0 -2
  392. package/dist/setupTests.js +0 -26
  393. package/dist/setupTests.js.map +0 -1
  394. package/dist/setupTests.mjs +0 -24
  395. package/dist/setupTests.mjs.map +0 -1
  396. package/dist/types/chat-suggestion-configuration.d.ts +0 -22
  397. package/dist/types/chat-suggestion-configuration.js +0 -19
  398. package/dist/types/chat-suggestion-configuration.js.map +0 -1
  399. package/dist/types/chat-suggestion-configuration.mjs +0 -1
  400. package/dist/types/chat-suggestion-configuration.mjs.map +0 -1
  401. package/dist/types/coagent-action.d.ts +0 -29
  402. package/dist/types/coagent-action.js +0 -19
  403. package/dist/types/coagent-action.js.map +0 -1
  404. package/dist/types/coagent-action.mjs +0 -1
  405. package/dist/types/coagent-action.mjs.map +0 -1
  406. package/dist/types/coagent-state.d.ts +0 -15
  407. package/dist/types/coagent-state.js +0 -19
  408. package/dist/types/coagent-state.js.map +0 -1
  409. package/dist/types/coagent-state.mjs +0 -1
  410. package/dist/types/coagent-state.mjs.map +0 -1
  411. package/dist/types/crew.d.ts +0 -79
  412. package/dist/types/crew.js +0 -19
  413. package/dist/types/crew.js.map +0 -1
  414. package/dist/types/crew.mjs +0 -2
  415. package/dist/types/crew.mjs.map +0 -1
  416. package/dist/types/document-pointer.d.ts +0 -9
  417. package/dist/types/document-pointer.js +0 -19
  418. package/dist/types/document-pointer.js.map +0 -1
  419. package/dist/types/document-pointer.mjs +0 -1
  420. package/dist/types/document-pointer.mjs.map +0 -1
  421. package/dist/types/frontend-action.d.ts +0 -127
  422. package/dist/types/frontend-action.js +0 -53
  423. package/dist/types/frontend-action.js.map +0 -1
  424. package/dist/types/frontend-action.mjs +0 -8
  425. package/dist/types/frontend-action.mjs.map +0 -1
  426. package/dist/types/index.d.ts +0 -12
  427. package/dist/types/index.js +0 -19
  428. package/dist/types/index.js.map +0 -1
  429. package/dist/types/index.mjs +0 -4
  430. package/dist/types/index.mjs.map +0 -1
  431. package/dist/types/interrupt-action.d.ts +0 -10
  432. package/dist/types/interrupt-action.js +0 -19
  433. package/dist/types/interrupt-action.js.map +0 -1
  434. package/dist/types/interrupt-action.mjs +0 -2
  435. package/dist/types/interrupt-action.mjs.map +0 -1
  436. package/dist/types/system-message.d.ts +0 -3
  437. package/dist/types/system-message.js +0 -19
  438. package/dist/types/system-message.js.map +0 -1
  439. package/dist/types/system-message.mjs +0 -1
  440. package/dist/types/system-message.mjs.map +0 -1
  441. package/dist/utils/dev-console.d.ts +0 -3
  442. package/dist/utils/dev-console.js +0 -41
  443. package/dist/utils/dev-console.js.map +0 -1
  444. package/dist/utils/dev-console.mjs +0 -8
  445. package/dist/utils/dev-console.mjs.map +0 -1
  446. package/dist/utils/index.d.ts +0 -2
  447. package/dist/utils/index.js +0 -52
  448. package/dist/utils/index.js.map +0 -1
  449. package/dist/utils/index.mjs +0 -13
  450. package/dist/utils/index.mjs.map +0 -1
  451. package/dist/utils/suggestions-constants.d.ts +0 -9
  452. package/dist/utils/suggestions-constants.js +0 -35
  453. package/dist/utils/suggestions-constants.js.map +0 -1
  454. package/dist/utils/suggestions-constants.mjs +0 -8
  455. package/dist/utils/suggestions-constants.mjs.map +0 -1
  456. package/dist/utils/utils.d.ts +0 -2
  457. package/dist/utils/utils.js +0 -19
  458. package/dist/utils/utils.js.map +0 -1
  459. package/dist/utils/utils.mjs +0 -1
  460. package/dist/utils/utils.mjs.map +0 -1
  461. package/dist/v2/index.css +0 -4
  462. package/dist/v2/index.css.map +0 -1
  463. package/dist/v2/index.d.ts +0 -2
  464. package/dist/v2/index.js +0 -27
  465. package/dist/v2/index.js.map +0 -1
  466. package/dist/v2/index.mjs +0 -6
  467. package/dist/v2/index.mjs.map +0 -1
  468. package/jest.config.js +0 -25
  469. package/src/components/CopilotListeners.tsx +0 -81
  470. package/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx +0 -75
  471. package/src/components/copilot-provider/copilot-messages.tsx +0 -274
  472. package/src/components/copilot-provider/copilotkit-props.tsx +0 -169
  473. package/src/components/copilot-provider/copilotkit.tsx +0 -671
  474. package/src/components/copilot-provider/index.ts +0 -3
  475. package/src/components/dev-console/console-trigger.tsx +0 -254
  476. package/src/components/dev-console/developer-console-modal.tsx +0 -866
  477. package/src/components/dev-console/icons.tsx +0 -101
  478. package/src/components/error-boundary/error-boundary.tsx +0 -91
  479. package/src/components/error-boundary/error-utils.tsx +0 -100
  480. package/src/components/index.ts +0 -1
  481. package/src/components/toast/exclamation-mark-icon.tsx +0 -27
  482. package/src/components/toast/toast-provider.tsx +0 -363
  483. package/src/components/usage-banner.tsx +0 -259
  484. package/src/context/coagent-state-renders-context.tsx +0 -76
  485. package/src/context/copilot-context.tsx +0 -332
  486. package/src/context/copilot-messages-context.tsx +0 -35
  487. package/src/context/index.ts +0 -16
  488. package/src/context/threads-context.tsx +0 -41
  489. package/src/hooks/__tests__/use-coagent-config.test.ts +0 -351
  490. package/src/hooks/index.ts +0 -34
  491. package/src/hooks/use-agent-nodename.ts +0 -30
  492. package/src/hooks/use-coagent-state-render-bridge.tsx +0 -293
  493. package/src/hooks/use-coagent-state-render.ts +0 -152
  494. package/src/hooks/use-coagent.ts +0 -366
  495. package/src/hooks/use-configure-chat-suggestions.tsx +0 -86
  496. package/src/hooks/use-copilot-action.ts +0 -236
  497. package/src/hooks/use-copilot-additional-instructions.ts +0 -85
  498. package/src/hooks/use-copilot-authenticated-action.ts +0 -70
  499. package/src/hooks/use-copilot-chat-headless_c.ts +0 -258
  500. package/src/hooks/use-copilot-chat-suggestions.tsx +0 -124
  501. package/src/hooks/use-copilot-chat.ts +0 -130
  502. package/src/hooks/use-copilot-chat_internal.ts +0 -696
  503. package/src/hooks/use-copilot-readable.ts +0 -135
  504. package/src/hooks/use-copilot-runtime-client.ts +0 -164
  505. package/src/hooks/use-default-tool.ts +0 -7
  506. package/src/hooks/use-flat-category-store.ts +0 -105
  507. package/src/hooks/use-frontend-tool.ts +0 -96
  508. package/src/hooks/use-human-in-the-loop.ts +0 -122
  509. package/src/hooks/use-langgraph-interrupt-render.ts +0 -136
  510. package/src/hooks/use-langgraph-interrupt.ts +0 -36
  511. package/src/hooks/use-lazy-tool-renderer.tsx +0 -30
  512. package/src/hooks/use-make-copilot-document-readable.ts +0 -30
  513. package/src/hooks/use-render-tool-call.ts +0 -80
  514. package/src/hooks/use-tree.ts +0 -207
  515. package/src/index.tsx +0 -7
  516. package/src/lib/copilot-task.ts +0 -201
  517. package/src/lib/index.ts +0 -1
  518. package/src/lib/status-checker.ts +0 -64
  519. package/src/setupTests.ts +0 -26
  520. package/src/types/chat-suggestion-configuration.ts +0 -23
  521. package/src/types/coagent-action.ts +0 -31
  522. package/src/types/coagent-state.ts +0 -13
  523. package/src/types/crew.ts +0 -89
  524. package/src/types/document-pointer.ts +0 -7
  525. package/src/types/frontend-action.ts +0 -202
  526. package/src/types/index.ts +0 -17
  527. package/src/types/interrupt-action.ts +0 -43
  528. package/src/types/system-message.ts +0 -4
  529. package/src/utils/dev-console.ts +0 -19
  530. package/src/utils/index.ts +0 -2
  531. package/src/utils/suggestions-constants.ts +0 -8
  532. package/src/utils/utils.test.ts +0 -7
  533. package/src/utils/utils.ts +0 -8
  534. package/src/v2/index.css +0 -1
  535. package/src/v2/index.ts +0 -4
  536. package/tsconfig.json +0 -8
  537. package/tsup.config.ts +0 -16
  538. package/typedoc.json +0 -4
@@ -0,0 +1,1117 @@
1
+ import React$1, { ComponentType, ReactNode } from "react";
2
+ import { InferSchemaOutput, StandardSchemaV1 } from "@copilotkit/shared";
3
+ import { CopilotKitCore, CopilotKitCoreConfig, CopilotKitCoreSubscriber, CopilotKitCoreSubscription, DynamicSuggestionsConfig, FrontendTool, StaticSuggestionsConfig, Suggestion, ToolCallStatus } from "@copilotkit/core";
4
+ import { ActivityMessage, AgentCapabilities, Message, ToolCall, ToolMessage } from "@ag-ui/core";
5
+ import { AbstractAgent, Interrupt, ResumeEntry, ResumeStatus, RunAgentResult } from "@ag-ui/client";
6
+
7
+ //#region src/types/react-tool-call-renderer.d.ts
8
+ interface ReactToolCallRenderer<T = unknown> {
9
+ name: string;
10
+ /**
11
+ * Schema describing the tool arguments. Optional — renderers registered for
12
+ * tools without parameters (e.g. HITL confirm dialogs) have no schema.
13
+ */
14
+ args?: StandardSchemaV1<any, T>;
15
+ /**
16
+ * Optional agent ID to constrain this tool renderer to a specific agent.
17
+ * If specified, this renderer will only be used for the specified agent.
18
+ */
19
+ agentId?: string;
20
+ /**
21
+ * Whether calls this renderer draws join the chat's tool-call groups (see
22
+ * `toolCallDisplay` on `CopilotChatMessageView`). CopilotKit's built-in card
23
+ * sets it; a renderer that leaves it unset always shows its calls on their
24
+ * own, since the chat can't tell what it draws (it may even draw nothing).
25
+ */
26
+ group?: boolean;
27
+ render: React.ComponentType<{
28
+ name: string;
29
+ toolCallId: string;
30
+ args: Partial<T>;
31
+ status: ToolCallStatus.InProgress;
32
+ result: undefined;
33
+ } | {
34
+ name: string;
35
+ toolCallId: string;
36
+ args: T;
37
+ status: ToolCallStatus.Executing;
38
+ result: undefined;
39
+ } | {
40
+ name: string;
41
+ toolCallId: string;
42
+ args: T;
43
+ status: ToolCallStatus.Complete;
44
+ result: string;
45
+ }>;
46
+ }
47
+ //#endregion
48
+ //#region src/types/react-activity-message-renderer.d.ts
49
+ interface ReactActivityMessageRenderer<TActivityContent> {
50
+ /**
51
+ * Activity type to match when rendering. Use "*" as a wildcard renderer.
52
+ */
53
+ activityType: string;
54
+ /**
55
+ * Optional agent ID to scope the renderer to a particular agent.
56
+ */
57
+ agentId?: string;
58
+ /**
59
+ * Schema describing the activity content payload.
60
+ */
61
+ content: StandardSchemaV1<any, TActivityContent>;
62
+ /**
63
+ * React component invoked to render the activity message.
64
+ */
65
+ render: React.ComponentType<{
66
+ activityType: string;
67
+ content: TActivityContent;
68
+ message: ActivityMessage;
69
+ agent: AbstractAgent | undefined;
70
+ }>;
71
+ }
72
+ //#endregion
73
+ //#region src/types/react-custom-message-renderer.d.ts
74
+ type ReactCustomMessageRendererPosition = "before" | "after";
75
+ interface ReactCustomMessageRenderer {
76
+ agentId?: string;
77
+ render: React.ComponentType<{
78
+ message: Message;
79
+ position: ReactCustomMessageRendererPosition;
80
+ runId: string;
81
+ messageIndex: number;
82
+ messageIndexInRun: number;
83
+ numberOfMessagesInRun: number;
84
+ agentId: string;
85
+ stateSnapshot: any;
86
+ }> | null;
87
+ }
88
+ //#endregion
89
+ //#region src/types/frontend-tool.d.ts
90
+ type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = FrontendTool<T> & {
91
+ render?: ReactToolCallRenderer<T>["render"];
92
+ };
93
+ //#endregion
94
+ //#region src/types/human-in-the-loop.d.ts
95
+ type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>> = Omit<FrontendTool<T>, "handler"> & {
96
+ /**
97
+ * Render the human-in-the-loop UI for this tool call.
98
+ *
99
+ * Beyond the tool call's `args`/`status`/`result`, the render props carry
100
+ * attribution:
101
+ * - `toolCallId` — the AG-UI tool call id, unique per interrupt. It is the
102
+ * stable key for correlating this interrupt with runtime (sub)agent
103
+ * attribution — e.g. the `agentId` reported by `onToolExecutionStart`, or
104
+ * per-run attribution stamped on the event stream — so the UI can label
105
+ * the interrupt with the agent that actually raised it.
106
+ * - `agentId` — the agent this tool was *registered* to (the tool's own
107
+ * `agentId`), or `undefined` for an unscoped tool. This is the static
108
+ * registration scope; it is NOT necessarily the runtime (sub)agent that
109
+ * raised the interrupt. For runtime attribution, correlate `toolCallId`
110
+ * with the event-stream/`onToolExecutionStart` agent id.
111
+ */
112
+ render: React$1.ComponentType<{
113
+ name: string;
114
+ description: string;
115
+ toolCallId: string;
116
+ agentId?: string;
117
+ args: Partial<T>;
118
+ status: ToolCallStatus.InProgress;
119
+ result: undefined;
120
+ respond: undefined;
121
+ } | {
122
+ name: string;
123
+ description: string;
124
+ toolCallId: string;
125
+ agentId?: string;
126
+ args: T;
127
+ status: ToolCallStatus.Executing;
128
+ result: undefined;
129
+ respond: (result: unknown) => Promise<void>;
130
+ } | {
131
+ name: string;
132
+ description: string;
133
+ toolCallId: string;
134
+ agentId?: string;
135
+ args: T;
136
+ status: ToolCallStatus.Complete;
137
+ result: string;
138
+ respond: undefined;
139
+ }>;
140
+ };
141
+ //#endregion
142
+ //#region src/types/defineToolCallRenderer.d.ts
143
+ /**
144
+ * Helper to define a type-safe tool call renderer entry.
145
+ * - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }.
146
+ * - Derives `args` type from the provided schema (any Standard Schema V1 compatible library).
147
+ * - Ensures the render function param type exactly matches ReactToolCallRenderer<T>["render"]'s param.
148
+ * - For wildcard tools (name: "*"), args is optional and defaults to z.any()
149
+ */
150
+ type RenderProps<T> = {
151
+ name: string;
152
+ toolCallId: string;
153
+ args: Partial<T>;
154
+ status: ToolCallStatus.InProgress;
155
+ result: undefined;
156
+ } | {
157
+ name: string;
158
+ toolCallId: string;
159
+ args: T;
160
+ status: ToolCallStatus.Executing;
161
+ result: undefined;
162
+ } | {
163
+ name: string;
164
+ toolCallId: string;
165
+ args: T;
166
+ status: ToolCallStatus.Complete;
167
+ result: string;
168
+ };
169
+ declare function defineToolCallRenderer(def: {
170
+ name: "*";
171
+ render: (props: RenderProps<any>) => React$1.ReactElement | null;
172
+ agentId?: string;
173
+ group?: boolean;
174
+ }): ReactToolCallRenderer<any>;
175
+ declare function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
176
+ name: string;
177
+ args: S;
178
+ render: (props: RenderProps<InferSchemaOutput<S>>) => React$1.ReactElement | null;
179
+ agentId?: string;
180
+ group?: boolean;
181
+ }): ReactToolCallRenderer<InferSchemaOutput<S>>;
182
+ //#endregion
183
+ //#region src/types/interrupt.d.ts
184
+ /** Legacy custom-event interrupt payload (agent emits a custom `on_interrupt` event). */
185
+ interface InterruptEvent<TValue = unknown> {
186
+ name: string;
187
+ value: TValue;
188
+ }
189
+ /**
190
+ * Resolve the agent with user input for an interrupt.
191
+ *
192
+ * - Standard interrupts: records `{ status: "resolved", payload }` for the target
193
+ * interrupt (defaults to the primary one). Resumes once every open interrupt is
194
+ * addressed; returns the resume run result, or `void` while still awaiting others.
195
+ * - Legacy interrupts: resumes immediately via `command.resume = payload`.
196
+ */
197
+ type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise<RunAgentResult | void>;
198
+ /**
199
+ * Cancel an interrupt.
200
+ *
201
+ * - Standard interrupts: records `{ status: "cancelled" }` for the target interrupt
202
+ * (defaults to the primary one), then resumes once all are addressed.
203
+ * - Legacy interrupts: dismisses the pending interrupt without resuming.
204
+ */
205
+ type InterruptCancelFn = (interruptId?: string) => Promise<RunAgentResult | void>;
206
+ interface InterruptHandlerProps<TValue = unknown> {
207
+ /**
208
+ * Legacy event shape (`{ name, value }`). Always present for back-compat: for
209
+ * standard interrupts, `value` is the primary `Interrupt` and `name` is `"on_interrupt"`.
210
+ * Prefer `interrupt` / `interrupts` for standard interrupts.
211
+ */
212
+ event: InterruptEvent<TValue>;
213
+ /** Primary standard interrupt (`interrupts[0]`), or `null` for legacy interrupts. */
214
+ interrupt: Interrupt | null;
215
+ /** All open standard interrupts (empty array for legacy interrupts). */
216
+ interrupts: Interrupt[];
217
+ resolve: InterruptResolveFn;
218
+ cancel: InterruptCancelFn;
219
+ }
220
+ interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
221
+ event: InterruptEvent<TValue>;
222
+ interrupt: Interrupt | null;
223
+ interrupts: Interrupt[];
224
+ result: TResult;
225
+ resolve: InterruptResolveFn;
226
+ cancel: InterruptCancelFn;
227
+ }
228
+ //#endregion
229
+ //#region src/lib/react-core.d.ts
230
+ interface CopilotKitCoreReactConfig extends CopilotKitCoreConfig {
231
+ renderToolCalls?: ReactToolCallRenderer<any>[];
232
+ renderActivityMessages?: ReactActivityMessageRenderer<any>[];
233
+ renderCustomMessages?: ReactCustomMessageRenderer[];
234
+ }
235
+ interface CopilotKitCoreReactSubscriber extends CopilotKitCoreSubscriber {
236
+ onRenderToolCallsChanged?: (event: {
237
+ copilotkit: CopilotKitCore;
238
+ renderToolCalls: ReactToolCallRenderer<any>[];
239
+ }) => void | Promise<void>;
240
+ onInterruptElementChanged?: (event: {
241
+ copilotkit: CopilotKitCore;
242
+ interruptElement: React$1.ReactElement | null;
243
+ }) => void | Promise<void>;
244
+ }
245
+ declare class CopilotKitCoreReact extends CopilotKitCore {
246
+ private _renderToolCalls;
247
+ private _hookRenderToolCalls;
248
+ private _cachedMergedRenderToolCalls;
249
+ private _renderCustomMessages;
250
+ private _renderActivityMessages;
251
+ private _interruptElement;
252
+ constructor(config: CopilotKitCoreReactConfig);
253
+ get renderCustomMessages(): Readonly<ReactCustomMessageRenderer[]>;
254
+ get renderActivityMessages(): Readonly<ReactActivityMessageRenderer<any>>[];
255
+ get renderToolCalls(): Readonly<ReactToolCallRenderer<any>>[];
256
+ setRenderActivityMessages(renderers: ReactActivityMessageRenderer<any>[]): void;
257
+ setRenderCustomMessages(renderers: ReactCustomMessageRenderer[]): void;
258
+ setRenderToolCalls(renderToolCalls: ReactToolCallRenderer<any>[]): void;
259
+ addHookRenderToolCall(entry: ReactToolCallRenderer<any>): void;
260
+ removeHookRenderToolCall(name: string, agentId?: string): void;
261
+ private _notifyRenderToolCallsChanged;
262
+ get interruptElement(): React$1.ReactElement | null;
263
+ setInterruptElement(element: React$1.ReactElement | null): void;
264
+ subscribe(subscriber: CopilotKitCoreReactSubscriber): CopilotKitCoreSubscription;
265
+ /**
266
+ * Wait for pending React state updates before the follow-up agent run.
267
+ *
268
+ * When a frontend tool handler calls setState(), React 18 batches the update
269
+ * and schedules a commit via its internal scheduler (MessageChannel). The
270
+ * useAgentContext hook registers context via useLayoutEffect, which runs
271
+ * synchronously after React commits that batch.
272
+ *
273
+ * Awaiting a zero-delay timeout yields to the macrotask queue. React's
274
+ * MessageChannel task runs first, committing the pending state and running
275
+ * useLayoutEffect (which updates the context store). The follow-up runAgent
276
+ * call then reads fresh context.
277
+ */
278
+ waitForPendingFrameworkUpdates(): Promise<void>;
279
+ }
280
+ //#endregion
281
+ //#region src/context.d.ts
282
+ interface CopilotKitContextValue {
283
+ copilotkit: CopilotKitCoreReact;
284
+ /**
285
+ * Whether CopilotKit should automatically mount Intelligence indicators.
286
+ * Defaults to true when omitted for compatibility with custom providers.
287
+ */
288
+ showIntelligenceIndicator?: boolean;
289
+ /**
290
+ * Set of tool call IDs currently being executed.
291
+ * This is tracked at the provider level to ensure tool execution events
292
+ * are captured even before child components mount.
293
+ */
294
+ executingToolCallIds: ReadonlySet<string>;
295
+ }
296
+ declare const useCopilotKit: () => CopilotKitContextValue;
297
+ //#endregion
298
+ //#region src/providers/CopilotChatConfigurationProvider.d.ts
299
+ declare const CopilotChatDefaultLabels: {
300
+ chatInputPlaceholder: string;
301
+ chatInputToolbarStartTranscribeButtonLabel: string;
302
+ chatInputToolbarCancelTranscribeButtonLabel: string;
303
+ chatInputToolbarFinishTranscribeButtonLabel: string;
304
+ chatInputToolbarAddButtonLabel: string;
305
+ chatInputToolbarToolsButtonLabel: string;
306
+ chatInputToolbarSendButtonLabel: string;
307
+ chatInputToolbarStopButtonLabel: string;
308
+ assistantMessageToolbarCopyCodeLabel: string;
309
+ assistantMessageToolbarCopyCodeCopiedLabel: string;
310
+ assistantMessageToolbarCopyMessageLabel: string;
311
+ assistantMessageToolbarInspectorLabel: string;
312
+ assistantMessageToolbarInspectorDescription: string;
313
+ assistantMessageToolbarInspectorLocalOnlyLabel: string;
314
+ assistantMessageToolbarInspectorLocalOnlyDescription: string;
315
+ assistantMessageToolbarInspectorTitle: string;
316
+ assistantMessageToolbarInspectorHideLabel: string;
317
+ assistantMessageToolbarInspectorHideDescription: string;
318
+ assistantMessageToolbarThumbsUpLabel: string;
319
+ assistantMessageToolbarThumbsDownLabel: string;
320
+ assistantMessageFeedbackCommentPlaceholder: string;
321
+ assistantMessageFeedbackCommentSubmitLabel: string;
322
+ assistantMessageToolbarReadAloudLabel: string;
323
+ assistantMessageToolbarRegenerateLabel: string;
324
+ userMessageToolbarCopyMessageLabel: string;
325
+ userMessageToolbarEditMessageLabel: string;
326
+ userMessageToolbarPreviousBranchLabel: string;
327
+ userMessageToolbarNextBranchLabel: string;
328
+ chatDisclaimerText: string;
329
+ chatToggleOpenLabel: string;
330
+ chatToggleCloseLabel: string;
331
+ chatScrollToBottomLabel: string;
332
+ modalHeaderTitle: string;
333
+ welcomeMessageText: string;
334
+ reasoningMessageThinkingLabel: string;
335
+ chatInputSlashMenuLabel: string;
336
+ chatInputSlashMenuEmptyText: string;
337
+ attachmentRemoveButtonLabel: string;
338
+ attachmentPlayVideoButtonLabel: string;
339
+ attachmentPreviewCloseButtonLabel: string;
340
+ modalHeaderCloseButtonLabel: string;
341
+ modalHeaderThreadsButtonLabel: string;
342
+ sidebarLabel: string;
343
+ };
344
+ type CopilotChatLabels = typeof CopilotChatDefaultLabels;
345
+ interface CopilotChatConfigurationValue {
346
+ labels: CopilotChatLabels;
347
+ agentId: string;
348
+ threadId: string;
349
+ isModalOpen: boolean;
350
+ setModalOpen: (open: boolean) => void;
351
+ /**
352
+ * Whether the thread-list drawer is open. A sibling boolean to `isModalOpen`
353
+ * (deliberately NOT folded into a tri-state enum): on desktop the chat modal
354
+ * and the drawer coexist, so two independent booleans are required.
355
+ */
356
+ drawerOpen: boolean;
357
+ /**
358
+ * Toggles the drawer open state. On mobile viewports (`<768px`) opening the
359
+ * drawer closes the chat modal (mutual exclusion); on desktop there is no
360
+ * constraint.
361
+ */
362
+ setDrawerOpen: (open: boolean) => void;
363
+ /**
364
+ * True once a `<CopilotThreadsDrawer>` wrapper has registered itself with this chat
365
+ * configuration. The header thread-list launcher renders ONLY when this is
366
+ * set, so chats with no drawer stay byte-for-byte unchanged.
367
+ */
368
+ drawerRegistered: boolean;
369
+ /**
370
+ * Called by the drawer wrapper on mount to announce its presence (and flip
371
+ * `drawerRegistered`). Returns a cleanup function that de-registers the
372
+ * drawer on unmount.
373
+ *
374
+ * @returns A cleanup callback that reverses the registration.
375
+ */
376
+ registerDrawer: () => () => void;
377
+ /**
378
+ * Internal: registers the modal-close setter of the provider that actually
379
+ * owns the rendered modal (a descendant that supplied `isModalDefaultOpen`),
380
+ * so the drawer's mobile mutual-exclusion — owned by the top-most provider —
381
+ * closes the modal that is genuinely on screen rather than the top-most
382
+ * provider's own (possibly unrendered) modal state.
383
+ *
384
+ * @param closeModal - A setter the drawer may call to close the rendered modal.
385
+ * @returns A cleanup callback that de-registers the closer.
386
+ */
387
+ ɵregisterModalCloser: (closeModal: (open: boolean) => void) => () => void;
388
+ hasExplicitThreadId: boolean;
389
+ /**
390
+ * Imperatively sets the active thread for this chat configuration.
391
+ *
392
+ * Use this to drive the rendered thread without a host callback — e.g. a
393
+ * `<CopilotThreadsDrawer>` selecting a thread row sets it explicitly so the chat
394
+ * connects to that backend thread.
395
+ *
396
+ * Guarded like the top-level `<CopilotKit>` provider's `setThreadId`: when
397
+ * the consumer controls the threadId via the `threadId` prop on this
398
+ * provider, this is a no-op (a warning is logged) so a prop-controlled
399
+ * threadId is never silently overridden.
400
+ *
401
+ * @param threadId - The thread id to make active.
402
+ * @param options.explicit - Whether the thread is a caller choice. Defaults
403
+ * to `true` (a picked thread). Pass `false` to set a non-explicit thread
404
+ * so the welcome screen shows (see {@link startNewThread}).
405
+ */
406
+ setActiveThreadId: (threadId: string, options?: {
407
+ explicit?: boolean;
408
+ }) => void;
409
+ /**
410
+ * Resets the active thread to a fresh, non-explicit client-side thread: a
411
+ * newly minted UUID with `hasExplicitThreadId=false`, so the welcome screen
412
+ * shows. Pairs with the core `startNewThread()` to clear the conversation
413
+ * with no host wiring.
414
+ *
415
+ * Guarded identically to {@link setActiveThreadId}: a no-op when the
416
+ * threadId is prop-controlled.
417
+ */
418
+ startNewThread: () => void;
419
+ }
420
+ interface CopilotChatConfigurationProviderProps {
421
+ children: ReactNode;
422
+ labels?: Partial<CopilotChatLabels>;
423
+ agentId?: string;
424
+ threadId?: string;
425
+ hasExplicitThreadId?: boolean;
426
+ isModalDefaultOpen?: boolean;
427
+ }
428
+ declare const CopilotChatConfigurationProvider: React$1.FC<CopilotChatConfigurationProviderProps>;
429
+ declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue | null;
430
+ //#endregion
431
+ //#region src/hooks/use-agent.d.ts
432
+ declare enum UseAgentUpdate {
433
+ OnMessagesChanged = "OnMessagesChanged",
434
+ OnStateChanged = "OnStateChanged",
435
+ OnRunStatusChanged = "OnRunStatusChanged"
436
+ }
437
+ interface UseAgentPropsBase {
438
+ updates?: UseAgentUpdate[];
439
+ /**
440
+ * Throttle interval (in milliseconds) for re-renders triggered by
441
+ * `onMessagesChanged` and `onStateChanged` notifications. Useful to reduce
442
+ * re-render frequency during high-frequency streaming updates.
443
+ *
444
+ * Uses a leading+trailing pattern with a shared window — first update
445
+ * fires immediately, subsequent updates within the window are coalesced,
446
+ * and a trailing timer ensures the most recent update fires after the
447
+ * window expires. See `CopilotKitCore.subscribeToAgentWithOptions` in `@copilotkit/core`
448
+ * for details.
449
+ *
450
+ * Resolved as: `throttleMs ?? provider defaultThrottleMs ?? 0`.
451
+ * Passing `throttleMs={0}` explicitly disables throttling even when the
452
+ * provider specifies a non-zero `defaultThrottleMs`.
453
+ *
454
+ * Run lifecycle callbacks (`onRunInitialized`, `onRunFinalized`,
455
+ * `onRunFailed`, `onRunErrorEvent`) always fire immediately.
456
+ *
457
+ * @default undefined
458
+ * When unset, inherits from the provider's `defaultThrottleMs`;
459
+ * if that is also unset, the effective value is `0` (no throttle).
460
+ */
461
+ throttleMs?: number;
462
+ }
463
+ /**
464
+ * Thread-scoped variant. `agentId`, `runtimeAgentId`, and `threadId` are a
465
+ * matched set: together they give this hook a *private* agent — registered
466
+ * under the local `agentId`, routing outbound to `runtimeAgentId` — that is
467
+ * safe to pin a thread onto. None of the three is meaningful without the other
468
+ * two, so all are required here.
469
+ */
470
+ interface UseAgentThreadScopedProps {
471
+ /**
472
+ * The name to register this hook's proxied agent under.
473
+ *
474
+ * Required, and must not already be taken. The usual fallbacks (the chat
475
+ * configuration's agentId, then `DEFAULT_AGENT_ID`) name agents that already
476
+ * exist, and registering over one either throws `already registered` or
477
+ * silently shadows it, depending on whether runtime discovery has landed — so
478
+ * the caller has to name it.
479
+ */
480
+ agentId: string;
481
+ /**
482
+ * Thread to scope the agent's run to. Written onto the underlying agent, so
483
+ * `/agent/run`, `/agent/connect`, and `/agent/stop` address this thread.
484
+ *
485
+ * REQUIRES `runtimeAgentId`. A runtime agent registered under a given id is a
486
+ * singleton, so writing a per-hook threadId directly onto it would let two
487
+ * `useAgent` calls that share an `agentId` clobber each other's thread.
488
+ * Passing a distinct local `agentId` plus the `runtimeAgentId` it routes to
489
+ * gives this hook a private proxied agent to pin the thread onto instead of a
490
+ * shared one.
491
+ */
492
+ threadId: string;
493
+ /**
494
+ * The id of the runtime agent to route outbound requests to, while this hook
495
+ * exposes a distinct local `agentId`. Registers a proxied agent via
496
+ * `CopilotKitCore.registerProxiedAgent`, letting several frontend agents
497
+ * (e.g. one per open thread) mount against a single runtime agent without a
498
+ * shared-singleton collision.
499
+ *
500
+ * When set, `agentId` is the *local* registry id (must not collide with an
501
+ * existing local or runtime-discovered agent) and `runtimeAgentId` is the
502
+ * runtime agent the proxy addresses on `/agent/run` etc.
503
+ *
504
+ * REQUIRES `threadId`. Registering a private agent is only worth doing to
505
+ * scope a thread to it; without a `threadId` the private agent would take its
506
+ * thread from the chat configuration, which is what binding to the shared
507
+ * agent via `agentId` alone already does — just with an extra registration
508
+ * and a local id to keep unique.
509
+ */
510
+ runtimeAgentId: string;
511
+ }
512
+ /**
513
+ * Default variant: neither `threadId` nor `runtimeAgentId`. The hook binds to
514
+ * the shared agent registered under `agentId` and leaves its threadId to the
515
+ * chat configuration (or to the agent's own auto-minted UUID).
516
+ *
517
+ * Both props are typed `undefined` here rather than omitted so that supplying
518
+ * either one on its own fails to match *both* branches — that is the
519
+ * type-level enforcement of the all-or-nothing rule.
520
+ */
521
+ interface UseAgentUnscopedProps {
522
+ /**
523
+ * Agent to bind to. Resolution precedence: this property, then the surrounding
524
+ * chat configuration's agentId, then the global default.
525
+ */
526
+ agentId?: string;
527
+ /** Requires `runtimeAgentId`. See {@link UseAgentThreadScopedProps.threadId}. */
528
+ threadId?: undefined;
529
+ /** Requires `threadId`. See {@link UseAgentThreadScopedProps.runtimeAgentId}. */
530
+ runtimeAgentId?: undefined;
531
+ }
532
+ /**
533
+ * Props for {@link useAgent}.
534
+ *
535
+ * There are exactly two valid shapes, and the type admits nothing in between:
536
+ *
537
+ * - **Bind to an agent** — `useAgent()`, `useAgent({ agentId })`. The shared
538
+ * instance from the registry; the thread comes from the chat configuration.
539
+ * - **Bind a private agent to a thread** —
540
+ * `useAgent({ agentId, runtimeAgentId, threadId })`. All three required.
541
+ *
542
+ * So `useAgent({ agentId, threadId })`, `useAgent({ agentId, runtimeAgentId })`,
543
+ * and `useAgent({ runtimeAgentId, threadId })` are all compile errors. Each
544
+ * partial combination is either unsafe (a thread scoped onto a shared singleton)
545
+ * or pointless (a private agent with no thread, or one registered over an id
546
+ * that already belongs to a real agent).
547
+ */
548
+ type UseAgentProps = UseAgentPropsBase & (UseAgentThreadScopedProps | UseAgentUnscopedProps);
549
+ declare function useAgent({
550
+ agentId,
551
+ threadId,
552
+ runtimeAgentId,
553
+ updates,
554
+ throttleMs
555
+ }?: UseAgentProps): {
556
+ agent: AbstractAgent;
557
+ /**
558
+ * Whether `agent` is the real, runtime-synced (or locally-registered) agent
559
+ * rather than a provisional stand-in returned while the runtime is still
560
+ * connecting (or in an error state).
561
+ *
562
+ * `agent` is always a fully-constructed `AbstractAgent`, so calling
563
+ * `agent.subscribe(...)`, `agent.setState(...)`, etc. is always safe. But
564
+ * while `isReady` is `false` the instance is a placeholder that will be
565
+ * swapped for the real agent once the runtime `/info` sync resolves, at
566
+ * which point `agent` changes reference and dependent effects re-run.
567
+ * Guard on `isReady` when you only want to act against the real agent —
568
+ * e.g. subscribing to run-lifecycle events you don't want to miss during
569
+ * the provisional window (#5000).
570
+ */
571
+ isReady: boolean;
572
+ };
573
+ //#endregion
574
+ //#region src/hooks/use-frontend-tool.d.ts
575
+ declare function useFrontendTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactFrontendTool<T>, deps?: ReadonlyArray<unknown>): void;
576
+ //#endregion
577
+ //#region src/hooks/use-frontend-tools.d.ts
578
+ /**
579
+ * Register a list of frontend tools whose length can change between renders.
580
+ *
581
+ * `useFrontendTool` registers exactly one tool per call, so it cannot be called
582
+ * in a loop over a runtime-length list without breaking the rules of hooks.
583
+ * This hook runs a single effect over the whole array instead, which makes it
584
+ * safe to build the list from state, props, or a server response.
585
+ *
586
+ * Tools are keyed by `name` plus `agentId`, the same as `useFrontendTool`. A
587
+ * tool that disappears from the array is unregistered on the next render, and
588
+ * every tool is unregistered on unmount. Renderers stay registered after
589
+ * unmount so past tool calls still render in the chat history.
590
+ *
591
+ * @param tools - The tools to register. May be empty and may change length.
592
+ * @param deps - Extra dependencies that force re-registration, compared by
593
+ * identity like the second argument of `useEffect`. Use this when a handler
594
+ * closes over a value that is not part of the tool definition. Keep the array
595
+ * a constant length across renders.
596
+ *
597
+ * @example
598
+ * Register one tool per item in application state:
599
+ * ```tsx
600
+ * const [reports, setReports] = useState<Report[]>([]);
601
+ *
602
+ * useFrontendTools(
603
+ * reports.map((report) => ({
604
+ * name: `open_${report.id}`,
605
+ * description: `Open the ${report.title} report`,
606
+ * handler: async () => navigate(`/reports/${report.id}`),
607
+ * })),
608
+ * [navigate],
609
+ * );
610
+ * ```
611
+ *
612
+ * @example
613
+ * Register tools described by the backend:
614
+ * ```tsx
615
+ * const { data } = useQuery(fetchToolDescriptors);
616
+ *
617
+ * useFrontendTools(
618
+ * (data ?? []).map((descriptor) => ({
619
+ * name: descriptor.name,
620
+ * description: descriptor.description,
621
+ * parameters: z.object({ query: z.string() }),
622
+ * handler: async ({ query }) => runDescriptor(descriptor.id, query),
623
+ * })),
624
+ * );
625
+ * ```
626
+ */
627
+ declare function useFrontendTools(tools: ReadonlyArray<ReactFrontendTool<any>> | undefined, deps?: ReadonlyArray<unknown>): void;
628
+ //#endregion
629
+ //#region src/hooks/use-component.d.ts
630
+ type InferRenderProps<T> = T extends StandardSchemaV1 ? InferSchemaOutput<T> : any;
631
+ /**
632
+ * Registers a React component as a frontend tool renderer in chat.
633
+ *
634
+ * This hook is a convenience wrapper around `useFrontendTool` that:
635
+ * - builds a model-facing tool description,
636
+ * - forwards optional schema parameters (any Standard Schema V1 compatible library),
637
+ * - renders your component with tool call parameters.
638
+ *
639
+ * Use this when you want to display a typed visual component for a tool call
640
+ * without manually wiring a full frontend tool object.
641
+ *
642
+ * When `parameters` is provided, render props are inferred from the schema.
643
+ * When omitted, the render component may accept any props.
644
+ *
645
+ * @typeParam TSchema - Schema describing tool parameters, or `undefined` when no schema is given.
646
+ * @param config - Tool registration config.
647
+ * @param deps - Optional dependencies to refresh registration (same semantics as `useEffect`).
648
+ *
649
+ * @example
650
+ * ```tsx
651
+ * // Without parameters — render accepts any props
652
+ * useComponent({
653
+ * name: "showGreeting",
654
+ * render: ({ message }: { message: string }) => <div>{message}</div>,
655
+ * });
656
+ * ```
657
+ *
658
+ * @example
659
+ * ```tsx
660
+ * // With parameters — render props inferred from schema
661
+ * useComponent({
662
+ * name: "showWeatherCard",
663
+ * parameters: z.object({ city: z.string() }),
664
+ * render: ({ city }) => <div>{city}</div>,
665
+ * });
666
+ * ```
667
+ *
668
+ * @example
669
+ * ```tsx
670
+ * useComponent(
671
+ * {
672
+ * name: "renderProfile",
673
+ * parameters: z.object({ userId: z.string() }),
674
+ * render: ProfileCard,
675
+ * agentId: "support-agent",
676
+ * },
677
+ * [selectedAgentId],
678
+ * );
679
+ * ```
680
+ */
681
+ declare function useComponent<TSchema extends StandardSchemaV1<any, Record<string, unknown>> | undefined = undefined>(config: {
682
+ name: string;
683
+ description?: string;
684
+ parameters?: TSchema;
685
+ render: ComponentType<NoInfer<InferRenderProps<TSchema>>>;
686
+ agentId?: string;
687
+ followUp?: boolean;
688
+ }, deps?: ReadonlyArray<unknown>): void;
689
+ //#endregion
690
+ //#region src/hooks/use-human-in-the-loop.d.ts
691
+ declare function useHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>, deps?: ReadonlyArray<unknown>): void;
692
+ //#endregion
693
+ //#region src/hooks/use-interrupt.d.ts
694
+ type InterruptHandlerFn<TValue, TResult> = (props: InterruptHandlerProps<TValue>) => TResult | PromiseLike<TResult>;
695
+ type InterruptResultFromHandler<THandler> = THandler extends ((...args: never[]) => infer TResult) ? TResult extends PromiseLike<infer TResolved> ? TResolved | null : TResult | null : null;
696
+ type InterruptResult<TValue, TResult> = InterruptResultFromHandler<InterruptHandlerFn<TValue, TResult>>;
697
+ type InterruptRenderInChat = boolean | undefined;
698
+ type UseInterruptReturn<TRenderInChat extends InterruptRenderInChat> = TRenderInChat extends false ? React$1.ReactElement | null : TRenderInChat extends true | undefined ? void : React$1.ReactElement | null | void;
699
+ /** Recognize thenables returned by interrupt preprocessing handlers. */
700
+ /**
701
+ * Configuration options for `useInterrupt`.
702
+ */
703
+ interface UseInterruptConfigBase<TValue = unknown, TResult = never> {
704
+ /**
705
+ * Render function for the interrupt UI.
706
+ *
707
+ * Receives both the standard `interrupt`/`interrupts` and the legacy `event`.
708
+ * Call `resolve(payload)` to resume with user input, or `cancel()` to cancel.
709
+ */
710
+ render: (props: InterruptRenderProps<TValue, InterruptResult<TValue, TResult>>) => React$1.ReactElement;
711
+ /**
712
+ * Optional pre-render handler invoked when an interrupt is received.
713
+ * Return a sync or async value to expose as `result` in `render`.
714
+ * Rejecting/throwing falls back to `result = null`.
715
+ */
716
+ handler?: InterruptHandlerFn<TValue, TResult>;
717
+ /**
718
+ * Optional predicate to filter which interrupts this hook handles.
719
+ * Receives the legacy-compatible event (for standard interrupts, `value` is
720
+ * the primary `Interrupt`). Return `false` to ignore.
721
+ */
722
+ enabled?: (event: InterruptEvent<TValue>) => boolean;
723
+ /** Optional agent id. Defaults to the current configured chat agent. */
724
+ agentId?: string;
725
+ }
726
+ type UseInterruptConfig<TValue = unknown, TResult = never, TRenderInChat extends InterruptRenderInChat = undefined> = UseInterruptConfigBase<TValue, TResult> & {
727
+ /** When true (default), the interrupt UI renders inside `<CopilotChat>` automatically. */renderInChat?: TRenderInChat;
728
+ };
729
+ /**
730
+ * Handles agent interrupts with optional filtering, preprocessing, and resume behavior.
731
+ *
732
+ * Supports both the AG-UI standard interrupt flow (`RUN_FINISHED` with
733
+ * `outcome.type === "interrupt"`) and the legacy custom-event flow
734
+ * (`on_interrupt`). For standard interrupts, `render` receives `interrupt`
735
+ * (the primary one) and `interrupts` (the full open set); call `resolve(payload)`
736
+ * to resume or `cancel()` to cancel. Resuming addresses the targeted interrupt
737
+ * and, once every open interrupt is addressed, submits a single spec `resume`
738
+ * array via `copilotkit.runAgent`.
739
+ *
740
+ * - `renderInChat: true` (default): the element is published into `<CopilotChat>`; returns `void`.
741
+ * - `renderInChat: false`: the hook returns the interrupt element for manual placement.
742
+ *
743
+ * @example
744
+ * ```tsx
745
+ * useInterrupt({
746
+ * render: ({ interrupt, resolve, cancel }) => (
747
+ * <div>
748
+ * <p>{interrupt?.message}</p>
749
+ * <button onClick={() => resolve({ approved: true })}>Approve</button>
750
+ * <button onClick={() => cancel()}>Cancel</button>
751
+ * </div>
752
+ * ),
753
+ * });
754
+ * ```
755
+ */
756
+ declare function useInterrupt<TResult = never, TRenderInChat extends InterruptRenderInChat = undefined>(config: UseInterruptConfig<any, TResult, TRenderInChat>): UseInterruptReturn<TRenderInChat>;
757
+ //#endregion
758
+ //#region src/hooks/use-suggestions.d.ts
759
+ interface UseSuggestionsOptions {
760
+ agentId?: string;
761
+ }
762
+ interface UseSuggestionsResult {
763
+ suggestions: Suggestion[];
764
+ reloadSuggestions: () => void;
765
+ clearSuggestions: () => void;
766
+ isLoading: boolean;
767
+ }
768
+ declare function useSuggestions({
769
+ agentId
770
+ }?: UseSuggestionsOptions): UseSuggestionsResult;
771
+ //#endregion
772
+ //#region src/hooks/use-configure-suggestions.d.ts
773
+ type StaticSuggestionInput = Omit<Suggestion, "isLoading"> & Partial<Pick<Suggestion, "isLoading">>;
774
+ type StaticSuggestionsConfigInput = Omit<StaticSuggestionsConfig, "suggestions"> & {
775
+ suggestions: StaticSuggestionInput[];
776
+ };
777
+ type SuggestionsConfigInput = DynamicSuggestionsConfig | StaticSuggestionsConfigInput;
778
+ declare function useConfigureSuggestions(config: SuggestionsConfigInput | null | undefined, deps?: ReadonlyArray<unknown>): void;
779
+ //#endregion
780
+ //#region src/hooks/use-agent-context.d.ts
781
+ /**
782
+ * Represents any value that can be serialized to JSON.
783
+ */
784
+ type JsonSerializable = string | number | boolean | null | JsonSerializable[] | {
785
+ [key: string]: JsonSerializable;
786
+ };
787
+ /**
788
+ * Context configuration for useAgentContext.
789
+ * Accepts any JSON-serializable value which will be converted to a string.
790
+ */
791
+ interface AgentContextInput {
792
+ /** A human-readable description of what this context represents */
793
+ description: string;
794
+ /** The context value - will be converted to a JSON string if not already a string */
795
+ value: JsonSerializable;
796
+ }
797
+ declare function useAgentContext(context: AgentContextInput): void;
798
+ //#endregion
799
+ //#region src/hooks/use-threads.d.ts
800
+ /**
801
+ * A conversation thread managed by CopilotKit Intelligence.
802
+ *
803
+ * Each thread has a unique `id`, an optional human-readable `name`, and
804
+ * timestamp fields tracking creation and update times.
805
+ */
806
+ interface Thread {
807
+ id: string;
808
+ agentId: string;
809
+ name: string | null;
810
+ archived: boolean;
811
+ createdAt: string;
812
+ updatedAt: string;
813
+ /**
814
+ * ISO-8601 timestamp of the most recent agent run on this thread. Absent
815
+ * when the thread has never been run. Prefer this over `updatedAt` for
816
+ * user-facing "last activity" displays — it is not bumped by metadata-only
817
+ * actions like rename or archive.
818
+ */
819
+ lastRunAt?: string;
820
+ }
821
+ /**
822
+ * Configuration for the {@link useThreads} hook.
823
+ *
824
+ * Thread operations are scoped to the runtime-authenticated user and the
825
+ * provided agent on CopilotKit Intelligence.
826
+ */
827
+ interface UseThreadsInput {
828
+ /** The ID of the agent whose threads to list and manage. */
829
+ agentId: string;
830
+ /** When `true`, archived threads are included in the list. Defaults to `false`. */
831
+ includeArchived?: boolean;
832
+ /** Maximum number of threads to fetch per page. When set, enables cursor-based pagination. */
833
+ limit?: number;
834
+ /**
835
+ * When `false`, the hook stays inert: no runtime context is dispatched, so
836
+ * NO thread-list fetch or realtime subscription is issued. Used by gated
837
+ * surfaces (e.g. an unlicensed `<CopilotThreadsDrawer>`) that must not touch the
838
+ * network until the gate opens. Defaults to `true`.
839
+ *
840
+ * Flipping `enabled` back to `true` resumes normal fetching on the next
841
+ * effect run; mutations are likewise short-circuited while disabled.
842
+ */
843
+ enabled?: boolean;
844
+ }
845
+ /**
846
+ * Return value of the {@link useThreads} hook.
847
+ *
848
+ * The `threads` array is kept in sync with the platform via a realtime
849
+ * WebSocket subscription (when available) and is sorted most-recently-updated
850
+ * first. Mutations reject with an `Error` if the platform request fails.
851
+ */
852
+ interface UseThreadsResult {
853
+ /**
854
+ * Threads for the current user/agent pair, sorted by most recently
855
+ * updated first. Updated in realtime when the platform pushes metadata
856
+ * events. Includes archived threads only when `includeArchived` is set.
857
+ */
858
+ threads: Thread[];
859
+ /**
860
+ * `true` while the initial thread list is being fetched from the platform.
861
+ * Subsequent realtime updates do not re-enter the loading state.
862
+ */
863
+ isLoading: boolean;
864
+ /**
865
+ * The most recent error from fetching threads or executing a mutation,
866
+ * or `null` when there is no error. Reset to `null` on the next
867
+ * successful fetch.
868
+ *
869
+ * This channel folds together developer/config errors (missing runtime URL,
870
+ * runtime without thread endpoints) and genuine list-load/mutation failures.
871
+ * End-user surfaces that must not leak config errors should prefer
872
+ * {@link listError}, which excludes the config/runtime-setup errors.
873
+ */
874
+ error: Error | null;
875
+ /**
876
+ * The most recent genuine list-load or mutation error from the platform, or
877
+ * `null`. Unlike {@link error}, this EXCLUDES developer/config errors (a
878
+ * missing runtime URL, or a runtime that does not advertise thread
879
+ * endpoints), so an end-user surface can render it directly without leaking
880
+ * a developer-facing configuration message into the UI.
881
+ */
882
+ listError: Error | null;
883
+ /**
884
+ * The error from the most recent FAILED next-page (fetch-more) load, or
885
+ * `null`. Tracked separately from {@link listError} so a paginated-load
886
+ * failure surfaces an inline "couldn't load more" affordance while the
887
+ * already-loaded list stays visible. Cleared when a fetch-more is retried or
888
+ * succeeds.
889
+ */
890
+ fetchMoreError: Error | null;
891
+ /**
892
+ * `true` when there are more threads available to fetch via
893
+ * {@link fetchMoreThreads}. Only meaningful when `limit` is set.
894
+ */
895
+ hasMoreThreads: boolean;
896
+ /**
897
+ * `true` while a subsequent page of threads is being fetched.
898
+ */
899
+ isFetchingMoreThreads: boolean;
900
+ /**
901
+ * `true` while at least one thread mutation (rename, archive, unarchive,
902
+ * delete) is awaiting a server response. Mutations apply optimistically, so
903
+ * this is primarily useful for disabling controls or showing a subtle
904
+ * in-flight indicator.
905
+ */
906
+ isMutating: boolean;
907
+ /**
908
+ * Fetch the next page of threads. No-op when {@link hasMoreThreads} is
909
+ * `false` or a fetch is already in progress.
910
+ */
911
+ fetchMoreThreads: () => void;
912
+ /**
913
+ * Re-fetch the thread list from the platform without clearing the current
914
+ * list. Backs the drawer's error-state Retry and the Active/All filter
915
+ * refetch. No-op until the runtime is connected.
916
+ */
917
+ refetchThreads: () => void;
918
+ /**
919
+ * Reset to a fresh, non-explicit client-side thread so the welcome screen
920
+ * shows. Lazy creation: no row appears in {@link threads} until the new
921
+ * thread's first run persists server-side.
922
+ */
923
+ startNewThread: () => void;
924
+ /**
925
+ * Rename a thread on the platform.
926
+ * Resolves when the server confirms the update; rejects on failure.
927
+ */
928
+ renameThread: (threadId: string, name: string) => Promise<void>;
929
+ /**
930
+ * Archive a thread on the platform.
931
+ * Archived threads are excluded from subsequent list results.
932
+ * Resolves when the server confirms the update; rejects on failure.
933
+ */
934
+ archiveThread: (threadId: string) => Promise<void>;
935
+ /**
936
+ * Restore a previously archived thread on the platform.
937
+ * The thread re-appears in default (non-archived) list results.
938
+ * Resolves when the server confirms the update; rejects on failure.
939
+ */
940
+ unarchiveThread: (threadId: string) => Promise<void>;
941
+ /**
942
+ * Permanently delete a thread from the platform.
943
+ * This is irreversible. Resolves when the server confirms deletion;
944
+ * rejects on failure.
945
+ */
946
+ deleteThread: (threadId: string) => Promise<void>;
947
+ }
948
+ /**
949
+ * React hook for listing and managing CopilotKit Intelligence threads.
950
+ *
951
+ * On mount the hook fetches the thread list for the runtime-authenticated user
952
+ * and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket
953
+ * URL, it also opens a realtime subscription so the `threads` array stays
954
+ * current without polling — thread creates, renames, archives, and deletes
955
+ * from any client are reflected immediately.
956
+ *
957
+ * Mutation methods (`renameThread`, `archiveThread`, `unarchiveThread`,
958
+ * `deleteThread`) return promises that resolve once the platform confirms the
959
+ * operation and reject with an `Error` on failure.
960
+ *
961
+ * @param input - Agent identifier and optional list controls.
962
+ * @returns Thread list state and stable mutation callbacks.
963
+ *
964
+ * @example
965
+ * ```tsx
966
+ * import { useThreads } from "@copilotkit/react-core";
967
+ *
968
+ * function ThreadList() {
969
+ * const { threads, isLoading, renameThread, deleteThread } = useThreads({
970
+ * agentId: "agent-1",
971
+ * });
972
+ *
973
+ * if (isLoading) return <p>Loading…</p>;
974
+ *
975
+ * return (
976
+ * <ul>
977
+ * {threads.map((t) => (
978
+ * <li key={t.id}>
979
+ * {t.name ?? "Untitled"}
980
+ * <button onClick={() => renameThread(t.id, "New name")}>Rename</button>
981
+ * <button onClick={() => deleteThread(t.id)}>Delete</button>
982
+ * </li>
983
+ * ))}
984
+ * </ul>
985
+ * );
986
+ * }
987
+ * ```
988
+ */
989
+ declare function useThreads({
990
+ agentId,
991
+ includeArchived,
992
+ limit,
993
+ enabled
994
+ }: UseThreadsInput): UseThreadsResult;
995
+ //#endregion
996
+ //#region src/hooks/use-render-tool.d.ts
997
+ interface RenderToolInProgressProps<S extends StandardSchemaV1> {
998
+ name: string;
999
+ toolCallId: string;
1000
+ parameters: Partial<InferSchemaOutput<S>>;
1001
+ status: "inProgress";
1002
+ result: undefined;
1003
+ }
1004
+ interface RenderToolExecutingProps<S extends StandardSchemaV1> {
1005
+ name: string;
1006
+ toolCallId: string;
1007
+ parameters: InferSchemaOutput<S>;
1008
+ status: "executing";
1009
+ result: undefined;
1010
+ }
1011
+ interface RenderToolCompleteProps<S extends StandardSchemaV1> {
1012
+ name: string;
1013
+ toolCallId: string;
1014
+ parameters: InferSchemaOutput<S>;
1015
+ status: "complete";
1016
+ result: string;
1017
+ }
1018
+ type RenderToolProps<S extends StandardSchemaV1> = RenderToolInProgressProps<S> | RenderToolExecutingProps<S> | RenderToolCompleteProps<S>;
1019
+ /**
1020
+ * Registers a wildcard (`"*"`) renderer for tool calls.
1021
+ *
1022
+ * The wildcard renderer is used as a fallback when no exact name-matched
1023
+ * renderer is registered for a tool call.
1024
+ *
1025
+ * @param config - Wildcard renderer configuration.
1026
+ * @param deps - Optional dependencies to refresh registration.
1027
+ *
1028
+ * @example
1029
+ * ```tsx
1030
+ * useRenderTool(
1031
+ * {
1032
+ * name: "*",
1033
+ * render: ({ name, status }) => (
1034
+ * <div>
1035
+ * {status === "complete" ? "✓" : "⏳"} {name}
1036
+ * </div>
1037
+ * ),
1038
+ * },
1039
+ * [],
1040
+ * );
1041
+ * ```
1042
+ */
1043
+ declare function useRenderTool(config: {
1044
+ name: "*";
1045
+ render: (props: any) => React.ReactElement | null;
1046
+ agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
1047
+ group?: boolean;
1048
+ }, deps?: ReadonlyArray<unknown>): void;
1049
+ /**
1050
+ * Registers a name-scoped renderer for tool calls.
1051
+ *
1052
+ * The provided `parameters` schema defines the typed shape of `props.parameters`
1053
+ * in `render` for `executing` and `complete` states. Accepts any Standard Schema V1
1054
+ * compatible library (Zod, Valibot, ArkType, etc.).
1055
+ *
1056
+ * @typeParam S - Schema type describing tool call parameters.
1057
+ * @param config - Named renderer configuration.
1058
+ * @param deps - Optional dependencies to refresh registration.
1059
+ *
1060
+ * @example
1061
+ * ```tsx
1062
+ * useRenderTool(
1063
+ * {
1064
+ * name: "searchDocs",
1065
+ * parameters: z.object({ query: z.string() }),
1066
+ * render: ({ status, parameters, result }) => {
1067
+ * if (status === "inProgress") return <div>Preparing...</div>;
1068
+ * if (status === "executing") return <div>Searching {parameters.query}</div>;
1069
+ * return <div>{result}</div>;
1070
+ * },
1071
+ * },
1072
+ * [],
1073
+ * );
1074
+ * ```
1075
+ */
1076
+ declare function useRenderTool<S extends StandardSchemaV1>(config: {
1077
+ name: string;
1078
+ parameters: S;
1079
+ render: (props: RenderToolProps<S>) => React.ReactElement | null;
1080
+ agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
1081
+ group?: boolean;
1082
+ }, deps?: ReadonlyArray<unknown>): void;
1083
+ //#endregion
1084
+ //#region src/hooks/use-render-tool-call.d.ts
1085
+ interface UseRenderToolCallProps {
1086
+ toolCall: ToolCall;
1087
+ toolMessage?: ToolMessage;
1088
+ }
1089
+ /**
1090
+ * Hook that returns a function to render tool calls based on the render functions
1091
+ * defined in CopilotKitProvider.
1092
+ *
1093
+ * @returns A function that takes a tool call and optional tool message and returns the rendered component
1094
+ */
1095
+ declare function useRenderToolCall(): ({
1096
+ toolCall,
1097
+ toolMessage
1098
+ }: UseRenderToolCallProps) => React$1.ReactElement | null;
1099
+ //#endregion
1100
+ //#region src/hooks/use-capabilities.d.ts
1101
+ /**
1102
+ * Returns the capabilities declared by the given agent (or the agent resolved
1103
+ * from the surrounding chat configuration, falling back to the default agent).
1104
+ * Capabilities are populated from the runtime `/info` response at connection
1105
+ * time. The hook reads them synchronously from the agent instance — there is
1106
+ * no separate loading state, but the value will be `undefined` until the
1107
+ * runtime handshake completes.
1108
+ *
1109
+ * @param agentId - Optional agent ID. If omitted, inherits the surrounding
1110
+ * chat configuration's agent, falling back to the default agent.
1111
+ * @returns The agent's capabilities, or `undefined` if the agent doesn't
1112
+ * declare capabilities.
1113
+ */
1114
+ declare function useCapabilities(agentId?: string): AgentCapabilities | undefined;
1115
+ //#endregion
1116
+ export { type AgentContextInput, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatDefaultLabels, type CopilotChatLabels, CopilotKitCoreReact, type CopilotKitCoreReactConfig, type Interrupt, type InterruptEvent, type InterruptHandlerProps, type InterruptRenderProps, type JsonSerializable, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type RenderToolCompleteProps, type RenderToolExecutingProps, type RenderToolInProgressProps, type RenderToolProps, type ResumeEntry, type ResumeStatus, type Thread, UseAgentUpdate, type UseInterruptConfig, type UseThreadsInput, type UseThreadsResult, defineToolCallRenderer, useAgent, useAgentContext, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useFrontendTools, useHumanInTheLoop, useInterrupt, useRenderTool, useRenderToolCall, useSuggestions, useThreads };
1117
+ //# sourceMappingURL=headless.d.cts.map