@copilotkit/runtime 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 (673) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -1
  3. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  4. package/dist/_virtual/_rolldown/runtime.mjs +20 -0
  5. package/dist/agent/converters/aisdk.cjs +355 -0
  6. package/dist/agent/converters/aisdk.cjs.map +1 -0
  7. package/dist/agent/converters/aisdk.d.cts +22 -0
  8. package/dist/agent/converters/aisdk.d.cts.map +1 -0
  9. package/dist/agent/converters/aisdk.d.mts +22 -0
  10. package/dist/agent/converters/aisdk.d.mts.map +1 -0
  11. package/dist/agent/converters/aisdk.mjs +351 -0
  12. package/dist/agent/converters/aisdk.mjs.map +1 -0
  13. package/dist/agent/converters/index.d.mts +2 -0
  14. package/dist/agent/converters/tanstack.cjs +374 -0
  15. package/dist/agent/converters/tanstack.cjs.map +1 -0
  16. package/dist/agent/converters/tanstack.d.cts +83 -0
  17. package/dist/agent/converters/tanstack.d.cts.map +1 -0
  18. package/dist/agent/converters/tanstack.d.mts +83 -0
  19. package/dist/agent/converters/tanstack.d.mts.map +1 -0
  20. package/dist/agent/converters/tanstack.mjs +372 -0
  21. package/dist/agent/converters/tanstack.mjs.map +1 -0
  22. package/dist/agent/converters/usage.cjs +68 -0
  23. package/dist/agent/converters/usage.cjs.map +1 -0
  24. package/dist/agent/converters/usage.d.cts +19 -0
  25. package/dist/agent/converters/usage.d.cts.map +1 -0
  26. package/dist/agent/converters/usage.d.mts +19 -0
  27. package/dist/agent/converters/usage.d.mts.map +1 -0
  28. package/dist/agent/converters/usage.mjs +62 -0
  29. package/dist/agent/converters/usage.mjs.map +1 -0
  30. package/dist/agent/index.cjs +1328 -0
  31. package/dist/agent/index.cjs.map +1 -0
  32. package/dist/agent/index.d.cts +467 -0
  33. package/dist/agent/index.d.cts.map +1 -0
  34. package/dist/agent/index.d.mts +468 -0
  35. package/dist/agent/index.d.mts.map +1 -0
  36. package/dist/agent/index.mjs +1318 -0
  37. package/dist/agent/index.mjs.map +1 -0
  38. package/dist/agent/learned-skills.cjs +76 -0
  39. package/dist/agent/learned-skills.cjs.map +1 -0
  40. package/dist/agent/learned-skills.d.cts +15 -0
  41. package/dist/agent/learned-skills.d.cts.map +1 -0
  42. package/dist/agent/learned-skills.d.mts +15 -0
  43. package/dist/agent/learned-skills.d.mts.map +1 -0
  44. package/dist/agent/learned-skills.mjs +74 -0
  45. package/dist/agent/learned-skills.mjs.map +1 -0
  46. package/dist/agent/mcp-tool-names.cjs +82 -0
  47. package/dist/agent/mcp-tool-names.cjs.map +1 -0
  48. package/dist/agent/mcp-tool-names.mjs +80 -0
  49. package/dist/agent/mcp-tool-names.mjs.map +1 -0
  50. package/dist/agent/state-delta.cjs +321 -0
  51. package/dist/agent/state-delta.cjs.map +1 -0
  52. package/dist/agent/state-delta.mjs +320 -0
  53. package/dist/agent/state-delta.mjs.map +1 -0
  54. package/dist/agent/url-download.cjs +503 -0
  55. package/dist/agent/url-download.cjs.map +1 -0
  56. package/dist/agent/url-download.d.cts +79 -0
  57. package/dist/agent/url-download.d.cts.map +1 -0
  58. package/dist/agent/url-download.d.mts +79 -0
  59. package/dist/agent/url-download.d.mts.map +1 -0
  60. package/dist/agent/url-download.mjs +500 -0
  61. package/dist/agent/url-download.mjs.map +1 -0
  62. package/dist/express.cjs +7 -0
  63. package/dist/express.d.cts +4 -0
  64. package/dist/express.d.mts +4 -0
  65. package/dist/express.mjs +4 -0
  66. package/dist/hono.cjs +8 -0
  67. package/dist/hono.d.cts +4 -0
  68. package/dist/hono.d.mts +4 -0
  69. package/dist/hono.mjs +4 -0
  70. package/dist/index.cjs +86 -0
  71. package/dist/index.d.cts +28 -0
  72. package/dist/index.d.mts +28 -0
  73. package/dist/index.mjs +21 -5598
  74. package/dist/internal/learned-skills.cjs +21 -0
  75. package/dist/internal/learned-skills.d.cts +9 -0
  76. package/dist/internal/learned-skills.d.mts +9 -0
  77. package/dist/internal/learned-skills.mjs +9 -0
  78. package/dist/node.cjs +7 -0
  79. package/dist/node.d.cts +4 -0
  80. package/dist/node.d.mts +4 -0
  81. package/dist/node.mjs +4 -0
  82. package/dist/runtime/core/channel-activation-config.cjs +87 -0
  83. package/dist/runtime/core/channel-activation-config.cjs.map +1 -0
  84. package/dist/runtime/core/channel-activation-config.d.cts +39 -0
  85. package/dist/runtime/core/channel-activation-config.d.cts.map +1 -0
  86. package/dist/runtime/core/channel-activation-config.d.mts +39 -0
  87. package/dist/runtime/core/channel-activation-config.d.mts.map +1 -0
  88. package/dist/runtime/core/channel-activation-config.mjs +85 -0
  89. package/dist/runtime/core/channel-activation-config.mjs.map +1 -0
  90. package/dist/runtime/core/channel-manager.cjs +973 -0
  91. package/dist/runtime/core/channel-manager.cjs.map +1 -0
  92. package/dist/runtime/core/channel-manager.d.cts +166 -0
  93. package/dist/runtime/core/channel-manager.d.cts.map +1 -0
  94. package/dist/runtime/core/channel-manager.d.mts +167 -0
  95. package/dist/runtime/core/channel-manager.d.mts.map +1 -0
  96. package/dist/runtime/core/channel-manager.mjs +972 -0
  97. package/dist/runtime/core/channel-manager.mjs.map +1 -0
  98. package/dist/runtime/core/debug-event-bus.cjs +57 -0
  99. package/dist/runtime/core/debug-event-bus.cjs.map +1 -0
  100. package/dist/runtime/core/debug-event-bus.d.cts +18 -0
  101. package/dist/runtime/core/debug-event-bus.d.cts.map +1 -0
  102. package/dist/runtime/core/debug-event-bus.d.mts +18 -0
  103. package/dist/runtime/core/debug-event-bus.d.mts.map +1 -0
  104. package/dist/runtime/core/debug-event-bus.mjs +55 -0
  105. package/dist/runtime/core/debug-event-bus.mjs.map +1 -0
  106. package/dist/runtime/core/fetch-cors.cjs +71 -0
  107. package/dist/runtime/core/fetch-cors.cjs.map +1 -0
  108. package/dist/runtime/core/fetch-cors.d.cts +19 -0
  109. package/dist/runtime/core/fetch-cors.d.cts.map +1 -0
  110. package/dist/runtime/core/fetch-cors.d.mts +19 -0
  111. package/dist/runtime/core/fetch-cors.d.mts.map +1 -0
  112. package/dist/runtime/core/fetch-cors.mjs +69 -0
  113. package/dist/runtime/core/fetch-cors.mjs.map +1 -0
  114. package/dist/runtime/core/fetch-handler.cjs +539 -0
  115. package/dist/runtime/core/fetch-handler.cjs.map +1 -0
  116. package/dist/runtime/core/fetch-handler.d.cts +100 -0
  117. package/dist/runtime/core/fetch-handler.d.cts.map +1 -0
  118. package/dist/runtime/core/fetch-handler.d.mts +100 -0
  119. package/dist/runtime/core/fetch-handler.d.mts.map +1 -0
  120. package/dist/runtime/core/fetch-handler.mjs +538 -0
  121. package/dist/runtime/core/fetch-handler.mjs.map +1 -0
  122. package/dist/runtime/core/fetch-router.cjs +141 -0
  123. package/dist/runtime/core/fetch-router.cjs.map +1 -0
  124. package/dist/runtime/core/fetch-router.mjs +140 -0
  125. package/dist/runtime/core/fetch-router.mjs.map +1 -0
  126. package/dist/runtime/core/hooks.cjs +28 -0
  127. package/dist/runtime/core/hooks.cjs.map +1 -0
  128. package/dist/runtime/core/hooks.d.cts +121 -0
  129. package/dist/runtime/core/hooks.d.cts.map +1 -0
  130. package/dist/runtime/core/hooks.d.mts +121 -0
  131. package/dist/runtime/core/hooks.d.mts.map +1 -0
  132. package/dist/runtime/core/hooks.mjs +24 -0
  133. package/dist/runtime/core/hooks.mjs.map +1 -0
  134. package/dist/runtime/core/learning.cjs +61 -0
  135. package/dist/runtime/core/learning.cjs.map +1 -0
  136. package/dist/runtime/core/learning.d.cts +61 -0
  137. package/dist/runtime/core/learning.d.cts.map +1 -0
  138. package/dist/runtime/core/learning.d.mts +61 -0
  139. package/dist/runtime/core/learning.d.mts.map +1 -0
  140. package/dist/runtime/core/learning.mjs +56 -0
  141. package/dist/runtime/core/learning.mjs.map +1 -0
  142. package/dist/runtime/core/logger.cjs +21 -0
  143. package/dist/runtime/core/logger.cjs.map +1 -0
  144. package/dist/runtime/core/logger.d.cts +12 -0
  145. package/dist/runtime/core/logger.d.cts.map +1 -0
  146. package/dist/runtime/core/logger.d.mts +12 -0
  147. package/dist/runtime/core/logger.d.mts.map +1 -0
  148. package/dist/runtime/core/logger.mjs +18 -0
  149. package/dist/runtime/core/logger.mjs.map +1 -0
  150. package/dist/runtime/core/middleware-sse-parser.cjs +149 -0
  151. package/dist/runtime/core/middleware-sse-parser.cjs.map +1 -0
  152. package/dist/runtime/core/middleware-sse-parser.d.cts +21 -0
  153. package/dist/runtime/core/middleware-sse-parser.d.cts.map +1 -0
  154. package/dist/runtime/core/middleware-sse-parser.d.mts +21 -0
  155. package/dist/runtime/core/middleware-sse-parser.d.mts.map +1 -0
  156. package/dist/runtime/core/middleware-sse-parser.mjs +148 -0
  157. package/dist/runtime/core/middleware-sse-parser.mjs.map +1 -0
  158. package/dist/runtime/core/middleware.cjs +34 -0
  159. package/dist/runtime/core/middleware.cjs.map +1 -0
  160. package/dist/runtime/core/middleware.d.cts +31 -0
  161. package/dist/runtime/core/middleware.d.cts.map +1 -0
  162. package/dist/runtime/core/middleware.d.mts +31 -0
  163. package/dist/runtime/core/middleware.d.mts.map +1 -0
  164. package/dist/runtime/core/middleware.mjs +32 -0
  165. package/dist/runtime/core/middleware.mjs.map +1 -0
  166. package/dist/runtime/core/package-info.cjs +9 -0
  167. package/dist/runtime/core/package-info.cjs.map +1 -0
  168. package/dist/runtime/core/package-info.mjs +7 -0
  169. package/dist/runtime/core/package-info.mjs.map +1 -0
  170. package/dist/runtime/core/runtime-error-reporter.cjs +21 -0
  171. package/dist/runtime/core/runtime-error-reporter.cjs.map +1 -0
  172. package/dist/runtime/core/runtime-error-reporter.mjs +18 -0
  173. package/dist/runtime/core/runtime-error-reporter.mjs.map +1 -0
  174. package/dist/runtime/core/runtime.cjs +256 -0
  175. package/dist/runtime/core/runtime.cjs.map +1 -0
  176. package/dist/runtime/core/runtime.d.cts +481 -0
  177. package/dist/runtime/core/runtime.d.cts.map +1 -0
  178. package/dist/runtime/core/runtime.d.mts +481 -0
  179. package/dist/runtime/core/runtime.d.mts.map +1 -0
  180. package/dist/runtime/core/runtime.mjs +249 -0
  181. package/dist/runtime/core/runtime.mjs.map +1 -0
  182. package/dist/runtime/endpoints/auto-start-channels.cjs +46 -0
  183. package/dist/runtime/endpoints/auto-start-channels.cjs.map +1 -0
  184. package/dist/runtime/endpoints/auto-start-channels.mjs +45 -0
  185. package/dist/runtime/endpoints/auto-start-channels.mjs.map +1 -0
  186. package/dist/runtime/endpoints/express-single.cjs +43 -0
  187. package/dist/runtime/endpoints/express-single.cjs.map +1 -0
  188. package/dist/runtime/endpoints/express-single.d.cts +48 -0
  189. package/dist/runtime/endpoints/express-single.d.cts.map +1 -0
  190. package/dist/runtime/endpoints/express-single.d.mts +48 -0
  191. package/dist/runtime/endpoints/express-single.d.mts.map +1 -0
  192. package/dist/runtime/endpoints/express-single.mjs +43 -0
  193. package/dist/runtime/endpoints/express-single.mjs.map +1 -0
  194. package/dist/runtime/endpoints/express.cjs +68 -0
  195. package/dist/runtime/endpoints/express.cjs.map +1 -0
  196. package/dist/runtime/endpoints/express.d.cts +84 -0
  197. package/dist/runtime/endpoints/express.d.cts.map +1 -0
  198. package/dist/runtime/endpoints/express.d.mts +84 -0
  199. package/dist/runtime/endpoints/express.d.mts.map +1 -0
  200. package/dist/runtime/endpoints/express.mjs +66 -0
  201. package/dist/runtime/endpoints/express.mjs.map +1 -0
  202. package/dist/runtime/endpoints/hono-single.cjs +28 -0
  203. package/dist/runtime/endpoints/hono-single.cjs.map +1 -0
  204. package/dist/runtime/endpoints/hono-single.d.cts +43 -0
  205. package/dist/runtime/endpoints/hono-single.d.cts.map +1 -0
  206. package/dist/runtime/endpoints/hono-single.d.mts +43 -0
  207. package/dist/runtime/endpoints/hono-single.d.mts.map +1 -0
  208. package/dist/runtime/endpoints/hono-single.mjs +27 -0
  209. package/dist/runtime/endpoints/hono-single.mjs.map +1 -0
  210. package/dist/runtime/endpoints/hono.cjs +37 -0
  211. package/dist/runtime/endpoints/hono.cjs.map +1 -0
  212. package/dist/runtime/endpoints/hono.d.cts +96 -0
  213. package/dist/runtime/endpoints/hono.d.cts.map +1 -0
  214. package/dist/runtime/endpoints/hono.d.mts +96 -0
  215. package/dist/runtime/endpoints/hono.d.mts.map +1 -0
  216. package/dist/runtime/endpoints/hono.mjs +34 -0
  217. package/dist/runtime/endpoints/hono.mjs.map +1 -0
  218. package/dist/runtime/endpoints/index.d.cts +4 -0
  219. package/dist/runtime/endpoints/index.d.mts +4 -0
  220. package/dist/runtime/endpoints/load-express.cjs +35 -0
  221. package/dist/runtime/endpoints/load-express.cjs.map +1 -0
  222. package/dist/runtime/endpoints/load-express.mjs +34 -0
  223. package/dist/runtime/endpoints/load-express.mjs.map +1 -0
  224. package/dist/runtime/endpoints/node-fetch-handler.cjs +75 -0
  225. package/dist/runtime/endpoints/node-fetch-handler.cjs.map +1 -0
  226. package/dist/runtime/endpoints/node-fetch-handler.d.cts +11 -0
  227. package/dist/runtime/endpoints/node-fetch-handler.d.cts.map +1 -0
  228. package/dist/runtime/endpoints/node-fetch-handler.d.mts +11 -0
  229. package/dist/runtime/endpoints/node-fetch-handler.d.mts.map +1 -0
  230. package/dist/runtime/endpoints/node-fetch-handler.mjs +73 -0
  231. package/dist/runtime/endpoints/node-fetch-handler.mjs.map +1 -0
  232. package/dist/runtime/endpoints/node.cjs +16 -0
  233. package/dist/runtime/endpoints/node.cjs.map +1 -0
  234. package/dist/runtime/endpoints/node.d.cts +104 -0
  235. package/dist/runtime/endpoints/node.d.cts.map +1 -0
  236. package/dist/runtime/endpoints/node.d.mts +104 -0
  237. package/dist/runtime/endpoints/node.d.mts.map +1 -0
  238. package/dist/runtime/endpoints/node.mjs +16 -0
  239. package/dist/runtime/endpoints/node.mjs.map +1 -0
  240. package/dist/runtime/endpoints/single-route-helpers.cjs +130 -0
  241. package/dist/runtime/endpoints/single-route-helpers.cjs.map +1 -0
  242. package/dist/runtime/endpoints/single-route-helpers.mjs +125 -0
  243. package/dist/runtime/endpoints/single-route-helpers.mjs.map +1 -0
  244. package/dist/runtime/express.d.cts +2 -0
  245. package/dist/runtime/express.d.mts +2 -0
  246. package/dist/runtime/generative-ui/generative-ui-middleware.cjs +393 -0
  247. package/dist/runtime/generative-ui/generative-ui-middleware.cjs.map +1 -0
  248. package/dist/runtime/generative-ui/generative-ui-middleware.d.cts +20 -0
  249. package/dist/runtime/generative-ui/generative-ui-middleware.d.cts.map +1 -0
  250. package/dist/runtime/generative-ui/generative-ui-middleware.d.mts +20 -0
  251. package/dist/runtime/generative-ui/generative-ui-middleware.d.mts.map +1 -0
  252. package/dist/runtime/generative-ui/generative-ui-middleware.mjs +392 -0
  253. package/dist/runtime/generative-ui/generative-ui-middleware.mjs.map +1 -0
  254. package/dist/runtime/generative-ui/index.d.cts +2 -0
  255. package/dist/runtime/generative-ui/index.d.mts +2 -0
  256. package/dist/runtime/generative-ui/surface-writer.cjs +85 -0
  257. package/dist/runtime/generative-ui/surface-writer.cjs.map +1 -0
  258. package/dist/runtime/generative-ui/surface-writer.d.cts +32 -0
  259. package/dist/runtime/generative-ui/surface-writer.d.cts.map +1 -0
  260. package/dist/runtime/generative-ui/surface-writer.d.mts +32 -0
  261. package/dist/runtime/generative-ui/surface-writer.d.mts.map +1 -0
  262. package/dist/runtime/generative-ui/surface-writer.mjs +84 -0
  263. package/dist/runtime/generative-ui/surface-writer.mjs.map +1 -0
  264. package/dist/runtime/handlers/get-runtime-info.cjs +140 -0
  265. package/dist/runtime/handlers/get-runtime-info.cjs.map +1 -0
  266. package/dist/runtime/handlers/get-runtime-info.mjs +140 -0
  267. package/dist/runtime/handlers/get-runtime-info.mjs.map +1 -0
  268. package/dist/runtime/handlers/handle-connect.cjs +62 -0
  269. package/dist/runtime/handlers/handle-connect.cjs.map +1 -0
  270. package/dist/runtime/handlers/handle-connect.mjs +62 -0
  271. package/dist/runtime/handlers/handle-connect.mjs.map +1 -0
  272. package/dist/runtime/handlers/handle-debug-events.cjs +33 -0
  273. package/dist/runtime/handlers/handle-debug-events.cjs.map +1 -0
  274. package/dist/runtime/handlers/handle-debug-events.mjs +33 -0
  275. package/dist/runtime/handlers/handle-debug-events.mjs.map +1 -0
  276. package/dist/runtime/handlers/handle-inspector-learning.cjs +56 -0
  277. package/dist/runtime/handlers/handle-inspector-learning.cjs.map +1 -0
  278. package/dist/runtime/handlers/handle-inspector-learning.mjs +55 -0
  279. package/dist/runtime/handlers/handle-inspector-learning.mjs.map +1 -0
  280. package/dist/runtime/handlers/handle-inspector-metadata.cjs +36 -0
  281. package/dist/runtime/handlers/handle-inspector-metadata.cjs.map +1 -0
  282. package/dist/runtime/handlers/handle-inspector-metadata.mjs +35 -0
  283. package/dist/runtime/handlers/handle-inspector-metadata.mjs.map +1 -0
  284. package/dist/runtime/handlers/handle-run.cjs +111 -0
  285. package/dist/runtime/handlers/handle-run.cjs.map +1 -0
  286. package/dist/runtime/handlers/handle-run.mjs +110 -0
  287. package/dist/runtime/handlers/handle-run.mjs.map +1 -0
  288. package/dist/runtime/handlers/handle-stop.cjs +102 -0
  289. package/dist/runtime/handlers/handle-stop.cjs.map +1 -0
  290. package/dist/runtime/handlers/handle-stop.mjs +101 -0
  291. package/dist/runtime/handlers/handle-stop.mjs.map +1 -0
  292. package/dist/runtime/handlers/handle-suggest.cjs +83 -0
  293. package/dist/runtime/handlers/handle-suggest.cjs.map +1 -0
  294. package/dist/runtime/handlers/handle-suggest.mjs +82 -0
  295. package/dist/runtime/handlers/handle-suggest.mjs.map +1 -0
  296. package/dist/runtime/handlers/handle-trajectory-connect.cjs +40 -0
  297. package/dist/runtime/handlers/handle-trajectory-connect.cjs.map +1 -0
  298. package/dist/runtime/handlers/handle-trajectory-connect.mjs +39 -0
  299. package/dist/runtime/handlers/handle-trajectory-connect.mjs.map +1 -0
  300. package/dist/runtime/handlers/handle-transcribe.cjs +112 -0
  301. package/dist/runtime/handlers/handle-transcribe.cjs.map +1 -0
  302. package/dist/runtime/handlers/handle-transcribe.mjs +111 -0
  303. package/dist/runtime/handlers/handle-transcribe.mjs.map +1 -0
  304. package/dist/runtime/handlers/header-utils.cjs +185 -0
  305. package/dist/runtime/handlers/header-utils.cjs.map +1 -0
  306. package/dist/runtime/handlers/header-utils.d.cts +53 -0
  307. package/dist/runtime/handlers/header-utils.d.cts.map +1 -0
  308. package/dist/runtime/handlers/header-utils.d.mts +53 -0
  309. package/dist/runtime/handlers/header-utils.d.mts.map +1 -0
  310. package/dist/runtime/handlers/header-utils.mjs +183 -0
  311. package/dist/runtime/handlers/header-utils.mjs.map +1 -0
  312. package/dist/runtime/handlers/intelligence/annotate.cjs +83 -0
  313. package/dist/runtime/handlers/intelligence/annotate.cjs.map +1 -0
  314. package/dist/runtime/handlers/intelligence/annotate.mjs +82 -0
  315. package/dist/runtime/handlers/intelligence/annotate.mjs.map +1 -0
  316. package/dist/runtime/handlers/intelligence/connect.cjs +68 -0
  317. package/dist/runtime/handlers/intelligence/connect.cjs.map +1 -0
  318. package/dist/runtime/handlers/intelligence/connect.mjs +68 -0
  319. package/dist/runtime/handlers/intelligence/connect.mjs.map +1 -0
  320. package/dist/runtime/handlers/intelligence/memories.cjs +260 -0
  321. package/dist/runtime/handlers/intelligence/memories.cjs.map +1 -0
  322. package/dist/runtime/handlers/intelligence/memories.mjs +254 -0
  323. package/dist/runtime/handlers/intelligence/memories.mjs.map +1 -0
  324. package/dist/runtime/handlers/intelligence/run.cjs +283 -0
  325. package/dist/runtime/handlers/intelligence/run.cjs.map +1 -0
  326. package/dist/runtime/handlers/intelligence/run.mjs +282 -0
  327. package/dist/runtime/handlers/intelligence/run.mjs.map +1 -0
  328. package/dist/runtime/handlers/intelligence/thread-names.cjs +172 -0
  329. package/dist/runtime/handlers/intelligence/thread-names.cjs.map +1 -0
  330. package/dist/runtime/handlers/intelligence/thread-names.mjs +171 -0
  331. package/dist/runtime/handlers/intelligence/thread-names.mjs.map +1 -0
  332. package/dist/runtime/handlers/intelligence/threads.cjs +399 -0
  333. package/dist/runtime/handlers/intelligence/threads.cjs.map +1 -0
  334. package/dist/runtime/handlers/intelligence/threads.mjs +390 -0
  335. package/dist/runtime/handlers/intelligence/threads.mjs.map +1 -0
  336. package/dist/runtime/handlers/shared/agent-utils.cjs +267 -0
  337. package/dist/runtime/handlers/shared/agent-utils.cjs.map +1 -0
  338. package/dist/runtime/handlers/shared/agent-utils.mjs +262 -0
  339. package/dist/runtime/handlers/shared/agent-utils.mjs.map +1 -0
  340. package/dist/runtime/handlers/shared/cloud-telemetry.cjs +30 -0
  341. package/dist/runtime/handlers/shared/cloud-telemetry.cjs.map +1 -0
  342. package/dist/runtime/handlers/shared/cloud-telemetry.mjs +29 -0
  343. package/dist/runtime/handlers/shared/cloud-telemetry.mjs.map +1 -0
  344. package/dist/runtime/handlers/shared/describe-endpoint.cjs +25 -0
  345. package/dist/runtime/handlers/shared/describe-endpoint.cjs.map +1 -0
  346. package/dist/runtime/handlers/shared/describe-endpoint.mjs +24 -0
  347. package/dist/runtime/handlers/shared/describe-endpoint.mjs.map +1 -0
  348. package/dist/runtime/handlers/shared/intelligence-utils.cjs +24 -0
  349. package/dist/runtime/handlers/shared/intelligence-utils.cjs.map +1 -0
  350. package/dist/runtime/handlers/shared/intelligence-utils.mjs +23 -0
  351. package/dist/runtime/handlers/shared/intelligence-utils.mjs.map +1 -0
  352. package/dist/runtime/handlers/shared/json-response.cjs +14 -0
  353. package/dist/runtime/handlers/shared/json-response.cjs.map +1 -0
  354. package/dist/runtime/handlers/shared/json-response.mjs +12 -0
  355. package/dist/runtime/handlers/shared/json-response.mjs.map +1 -0
  356. package/dist/runtime/handlers/shared/mcp-apps-servers.cjs +22 -0
  357. package/dist/runtime/handlers/shared/mcp-apps-servers.cjs.map +1 -0
  358. package/dist/runtime/handlers/shared/mcp-apps-servers.mjs +22 -0
  359. package/dist/runtime/handlers/shared/mcp-apps-servers.mjs.map +1 -0
  360. package/dist/runtime/handlers/shared/memory-policy.cjs +78 -0
  361. package/dist/runtime/handlers/shared/memory-policy.cjs.map +1 -0
  362. package/dist/runtime/handlers/shared/memory-policy.mjs +77 -0
  363. package/dist/runtime/handlers/shared/memory-policy.mjs.map +1 -0
  364. package/dist/runtime/handlers/shared/platform-error.cjs +39 -0
  365. package/dist/runtime/handlers/shared/platform-error.cjs.map +1 -0
  366. package/dist/runtime/handlers/shared/platform-error.mjs +39 -0
  367. package/dist/runtime/handlers/shared/platform-error.mjs.map +1 -0
  368. package/dist/runtime/handlers/shared/resolve-intelligence-user.cjs +50 -0
  369. package/dist/runtime/handlers/shared/resolve-intelligence-user.cjs.map +1 -0
  370. package/dist/runtime/handlers/shared/resolve-intelligence-user.mjs +49 -0
  371. package/dist/runtime/handlers/shared/resolve-intelligence-user.mjs.map +1 -0
  372. package/dist/runtime/handlers/shared/sse-keep-alive.cjs +68 -0
  373. package/dist/runtime/handlers/shared/sse-keep-alive.cjs.map +1 -0
  374. package/dist/runtime/handlers/shared/sse-keep-alive.mjs +66 -0
  375. package/dist/runtime/handlers/shared/sse-keep-alive.mjs.map +1 -0
  376. package/dist/runtime/handlers/shared/sse-response.cjs +237 -0
  377. package/dist/runtime/handlers/shared/sse-response.cjs.map +1 -0
  378. package/dist/runtime/handlers/shared/sse-response.mjs +236 -0
  379. package/dist/runtime/handlers/shared/sse-response.mjs.map +1 -0
  380. package/dist/runtime/handlers/shared/thread-access.cjs +137 -0
  381. package/dist/runtime/handlers/shared/thread-access.cjs.map +1 -0
  382. package/dist/runtime/handlers/shared/thread-access.d.cts +28 -0
  383. package/dist/runtime/handlers/shared/thread-access.d.cts.map +1 -0
  384. package/dist/runtime/handlers/shared/thread-access.d.mts +28 -0
  385. package/dist/runtime/handlers/shared/thread-access.d.mts.map +1 -0
  386. package/dist/runtime/handlers/shared/thread-access.mjs +132 -0
  387. package/dist/runtime/handlers/shared/thread-access.mjs.map +1 -0
  388. package/dist/runtime/handlers/sse/connect.cjs +23 -0
  389. package/dist/runtime/handlers/sse/connect.cjs.map +1 -0
  390. package/dist/runtime/handlers/sse/connect.mjs +23 -0
  391. package/dist/runtime/handlers/sse/connect.mjs.map +1 -0
  392. package/dist/runtime/handlers/sse/run.cjs +44 -0
  393. package/dist/runtime/handlers/sse/run.cjs.map +1 -0
  394. package/dist/runtime/handlers/sse/run.mjs +44 -0
  395. package/dist/runtime/handlers/sse/run.mjs.map +1 -0
  396. package/dist/runtime/hono.d.cts +2 -0
  397. package/dist/runtime/hono.d.mts +2 -0
  398. package/dist/runtime/index.d.cts +34 -0
  399. package/dist/runtime/index.d.cts.map +1 -0
  400. package/dist/runtime/index.d.mts +34 -0
  401. package/dist/runtime/index.d.mts.map +1 -0
  402. package/dist/runtime/intelligence-platform/client.cjs +1338 -0
  403. package/dist/runtime/intelligence-platform/client.cjs.map +1 -0
  404. package/dist/runtime/intelligence-platform/client.d.cts +824 -0
  405. package/dist/runtime/intelligence-platform/client.d.cts.map +1 -0
  406. package/dist/runtime/intelligence-platform/client.d.mts +824 -0
  407. package/dist/runtime/intelligence-platform/client.d.mts.map +1 -0
  408. package/dist/runtime/intelligence-platform/client.mjs +1334 -0
  409. package/dist/runtime/intelligence-platform/client.mjs.map +1 -0
  410. package/dist/runtime/intelligence-platform/experimental.d.cts +26 -0
  411. package/dist/runtime/intelligence-platform/experimental.d.cts.map +1 -0
  412. package/dist/runtime/intelligence-platform/experimental.d.mts +26 -0
  413. package/dist/runtime/intelligence-platform/experimental.d.mts.map +1 -0
  414. package/dist/runtime/intelligence-platform/index.d.cts +3 -0
  415. package/dist/runtime/intelligence-platform/index.d.mts +3 -0
  416. package/dist/runtime/intelligence-platform/learned-skills.cjs +95 -0
  417. package/dist/runtime/intelligence-platform/learned-skills.cjs.map +1 -0
  418. package/dist/runtime/intelligence-platform/learned-skills.d.cts +43 -0
  419. package/dist/runtime/intelligence-platform/learned-skills.d.cts.map +1 -0
  420. package/dist/runtime/intelligence-platform/learned-skills.d.mts +43 -0
  421. package/dist/runtime/intelligence-platform/learned-skills.d.mts.map +1 -0
  422. package/dist/runtime/intelligence-platform/learned-skills.mjs +92 -0
  423. package/dist/runtime/intelligence-platform/learned-skills.mjs.map +1 -0
  424. package/dist/runtime/intelligence-platform/learning-management.cjs +203 -0
  425. package/dist/runtime/intelligence-platform/learning-management.cjs.map +1 -0
  426. package/dist/runtime/intelligence-platform/learning-management.d.cts +111 -0
  427. package/dist/runtime/intelligence-platform/learning-management.d.cts.map +1 -0
  428. package/dist/runtime/intelligence-platform/learning-management.d.mts +111 -0
  429. package/dist/runtime/intelligence-platform/learning-management.d.mts.map +1 -0
  430. package/dist/runtime/intelligence-platform/learning-management.mjs +193 -0
  431. package/dist/runtime/intelligence-platform/learning-management.mjs.map +1 -0
  432. package/dist/runtime/intelligence-platform/skill-registry/archive.cjs +131 -0
  433. package/dist/runtime/intelligence-platform/skill-registry/archive.cjs.map +1 -0
  434. package/dist/runtime/intelligence-platform/skill-registry/archive.d.cts +10 -0
  435. package/dist/runtime/intelligence-platform/skill-registry/archive.d.cts.map +1 -0
  436. package/dist/runtime/intelligence-platform/skill-registry/archive.d.mts +10 -0
  437. package/dist/runtime/intelligence-platform/skill-registry/archive.d.mts.map +1 -0
  438. package/dist/runtime/intelligence-platform/skill-registry/archive.mjs +127 -0
  439. package/dist/runtime/intelligence-platform/skill-registry/archive.mjs.map +1 -0
  440. package/dist/runtime/intelligence-platform/skill-registry/config.cjs +65 -0
  441. package/dist/runtime/intelligence-platform/skill-registry/config.cjs.map +1 -0
  442. package/dist/runtime/intelligence-platform/skill-registry/config.d.cts +47 -0
  443. package/dist/runtime/intelligence-platform/skill-registry/config.d.cts.map +1 -0
  444. package/dist/runtime/intelligence-platform/skill-registry/config.d.mts +47 -0
  445. package/dist/runtime/intelligence-platform/skill-registry/config.d.mts.map +1 -0
  446. package/dist/runtime/intelligence-platform/skill-registry/config.mjs +65 -0
  447. package/dist/runtime/intelligence-platform/skill-registry/config.mjs.map +1 -0
  448. package/dist/runtime/intelligence-platform/skill-registry/errors.cjs +10 -0
  449. package/dist/runtime/intelligence-platform/skill-registry/errors.cjs.map +1 -0
  450. package/dist/runtime/intelligence-platform/skill-registry/errors.d.cts +7 -0
  451. package/dist/runtime/intelligence-platform/skill-registry/errors.d.cts.map +1 -0
  452. package/dist/runtime/intelligence-platform/skill-registry/errors.d.mts +7 -0
  453. package/dist/runtime/intelligence-platform/skill-registry/errors.d.mts.map +1 -0
  454. package/dist/runtime/intelligence-platform/skill-registry/errors.mjs +10 -0
  455. package/dist/runtime/intelligence-platform/skill-registry/errors.mjs.map +1 -0
  456. package/dist/runtime/intelligence-platform/skill-registry/index.d.cts +7 -0
  457. package/dist/runtime/intelligence-platform/skill-registry/index.d.mts +7 -0
  458. package/dist/runtime/intelligence-platform/skill-registry/registry.cjs +247 -0
  459. package/dist/runtime/intelligence-platform/skill-registry/registry.cjs.map +1 -0
  460. package/dist/runtime/intelligence-platform/skill-registry/registry.d.cts +36 -0
  461. package/dist/runtime/intelligence-platform/skill-registry/registry.d.cts.map +1 -0
  462. package/dist/runtime/intelligence-platform/skill-registry/registry.d.mts +36 -0
  463. package/dist/runtime/intelligence-platform/skill-registry/registry.d.mts.map +1 -0
  464. package/dist/runtime/intelligence-platform/skill-registry/registry.mjs +246 -0
  465. package/dist/runtime/intelligence-platform/skill-registry/registry.mjs.map +1 -0
  466. package/dist/runtime/intelligence-platform/skill-registry/skill-content.cjs +41 -0
  467. package/dist/runtime/intelligence-platform/skill-registry/skill-content.cjs.map +1 -0
  468. package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.cts +12 -0
  469. package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.cts.map +1 -0
  470. package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.mts +12 -0
  471. package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.mts.map +1 -0
  472. package/dist/runtime/intelligence-platform/skill-registry/skill-content.mjs +38 -0
  473. package/dist/runtime/intelligence-platform/skill-registry/skill-content.mjs.map +1 -0
  474. package/dist/runtime/intelligence-platform/skill-registry/snapshot.cjs +92 -0
  475. package/dist/runtime/intelligence-platform/skill-registry/snapshot.cjs.map +1 -0
  476. package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.cts +27 -0
  477. package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.cts.map +1 -0
  478. package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.mts +27 -0
  479. package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.mts.map +1 -0
  480. package/dist/runtime/intelligence-platform/skill-registry/snapshot.mjs +91 -0
  481. package/dist/runtime/intelligence-platform/skill-registry/snapshot.mjs.map +1 -0
  482. package/dist/runtime/intelligence-platform/thread-lock-heartbeat.cjs +142 -0
  483. package/dist/runtime/intelligence-platform/thread-lock-heartbeat.cjs.map +1 -0
  484. package/dist/runtime/intelligence-platform/thread-lock-heartbeat.mjs +141 -0
  485. package/dist/runtime/intelligence-platform/thread-lock-heartbeat.mjs.map +1 -0
  486. package/dist/runtime/intelligence-platform/trajectories.cjs +95 -0
  487. package/dist/runtime/intelligence-platform/trajectories.cjs.map +1 -0
  488. package/dist/runtime/intelligence-platform/trajectories.d.cts +11 -0
  489. package/dist/runtime/intelligence-platform/trajectories.d.cts.map +1 -0
  490. package/dist/runtime/intelligence-platform/trajectories.d.mts +11 -0
  491. package/dist/runtime/intelligence-platform/trajectories.d.mts.map +1 -0
  492. package/dist/runtime/intelligence-platform/trajectories.mjs +91 -0
  493. package/dist/runtime/intelligence-platform/trajectories.mjs.map +1 -0
  494. package/dist/runtime/node.d.cts +2 -0
  495. package/dist/runtime/node.d.mts +2 -0
  496. package/dist/runtime/runner/agent-runner.cjs +82 -0
  497. package/dist/runtime/runner/agent-runner.cjs.map +1 -0
  498. package/dist/runtime/runner/agent-runner.d.cts +151 -0
  499. package/dist/runtime/runner/agent-runner.d.cts.map +1 -0
  500. package/dist/runtime/runner/agent-runner.d.mts +151 -0
  501. package/dist/runtime/runner/agent-runner.d.mts.map +1 -0
  502. package/dist/runtime/runner/agent-runner.mjs +73 -0
  503. package/dist/runtime/runner/agent-runner.mjs.map +1 -0
  504. package/dist/runtime/runner/in-memory.cjs +741 -0
  505. package/dist/runtime/runner/in-memory.cjs.map +1 -0
  506. package/dist/runtime/runner/in-memory.d.cts +427 -0
  507. package/dist/runtime/runner/in-memory.d.cts.map +1 -0
  508. package/dist/runtime/runner/in-memory.d.mts +427 -0
  509. package/dist/runtime/runner/in-memory.d.mts.map +1 -0
  510. package/dist/runtime/runner/in-memory.mjs +734 -0
  511. package/dist/runtime/runner/in-memory.mjs.map +1 -0
  512. package/dist/runtime/runner/index.d.cts +5 -0
  513. package/dist/runtime/runner/index.d.mts +5 -0
  514. package/dist/runtime/runner/index.mjs +6 -0
  515. package/dist/runtime/runner/intelligence.cjs +617 -0
  516. package/dist/runtime/runner/intelligence.cjs.map +1 -0
  517. package/dist/runtime/runner/intelligence.d.cts +104 -0
  518. package/dist/runtime/runner/intelligence.d.cts.map +1 -0
  519. package/dist/runtime/runner/intelligence.d.mts +104 -0
  520. package/dist/runtime/runner/intelligence.d.mts.map +1 -0
  521. package/dist/runtime/runner/intelligence.mjs +616 -0
  522. package/dist/runtime/runner/intelligence.mjs.map +1 -0
  523. package/dist/runtime/telemetry/disclosure.cjs +25 -0
  524. package/dist/runtime/telemetry/disclosure.cjs.map +1 -0
  525. package/dist/runtime/telemetry/disclosure.mjs +24 -0
  526. package/dist/runtime/telemetry/disclosure.mjs.map +1 -0
  527. package/dist/runtime/telemetry/events.d.cts +66 -0
  528. package/dist/runtime/telemetry/events.d.cts.map +1 -0
  529. package/dist/runtime/telemetry/events.d.mts +66 -0
  530. package/dist/runtime/telemetry/events.d.mts.map +1 -0
  531. package/dist/runtime/telemetry/instance-created.cjs +34 -0
  532. package/dist/runtime/telemetry/instance-created.cjs.map +1 -0
  533. package/dist/runtime/telemetry/instance-created.mjs +34 -0
  534. package/dist/runtime/telemetry/instance-created.mjs.map +1 -0
  535. package/dist/runtime/telemetry/telemetry-client.cjs +108 -0
  536. package/dist/runtime/telemetry/telemetry-client.cjs.map +1 -0
  537. package/dist/runtime/telemetry/telemetry-client.d.cts +10 -0
  538. package/dist/runtime/telemetry/telemetry-client.d.cts.map +1 -0
  539. package/dist/runtime/telemetry/telemetry-client.d.mts +10 -0
  540. package/dist/runtime/telemetry/telemetry-client.d.mts.map +1 -0
  541. package/dist/runtime/telemetry/telemetry-client.mjs +107 -0
  542. package/dist/runtime/telemetry/telemetry-client.mjs.map +1 -0
  543. package/dist/runtime/telemetry/telemetry-identity.cjs +12 -0
  544. package/dist/runtime/telemetry/telemetry-identity.cjs.map +1 -0
  545. package/dist/runtime/telemetry/telemetry-identity.mjs +11 -0
  546. package/dist/runtime/telemetry/telemetry-identity.mjs.map +1 -0
  547. package/dist/runtime/transcription-service/transcription-service.cjs +7 -0
  548. package/dist/runtime/transcription-service/transcription-service.cjs.map +1 -0
  549. package/dist/runtime/transcription-service/transcription-service.d.cts +14 -0
  550. package/dist/runtime/transcription-service/transcription-service.d.cts.map +1 -0
  551. package/dist/runtime/transcription-service/transcription-service.d.mts +14 -0
  552. package/dist/runtime/transcription-service/transcription-service.d.mts.map +1 -0
  553. package/dist/runtime/transcription-service/transcription-service.mjs +6 -0
  554. package/dist/runtime/transcription-service/transcription-service.mjs.map +1 -0
  555. package/package.json +119 -104
  556. package/.eslintrc.js +0 -7
  557. package/CHANGELOG.md +0 -2920
  558. package/__snapshots__/schema/schema.graphql +0 -371
  559. package/dist/index.d.ts +0 -1494
  560. package/dist/index.js +0 -5641
  561. package/dist/index.js.map +0 -1
  562. package/dist/index.mjs.map +0 -1
  563. package/dist/langgraph.d.ts +0 -284
  564. package/dist/langgraph.js +0 -211
  565. package/dist/langgraph.js.map +0 -1
  566. package/dist/langgraph.mjs +0 -206
  567. package/dist/langgraph.mjs.map +0 -1
  568. package/dist/v2/index.d.ts +0 -2
  569. package/dist/v2/index.js +0 -22
  570. package/dist/v2/index.js.map +0 -1
  571. package/dist/v2/index.mjs +0 -5
  572. package/dist/v2/index.mjs.map +0 -1
  573. package/jest.config.js +0 -10
  574. package/scripts/generate-gql-schema.ts +0 -13
  575. package/src/agents/langgraph/event-source.ts +0 -329
  576. package/src/agents/langgraph/events.ts +0 -377
  577. package/src/graphql/inputs/action.input.ts +0 -16
  578. package/src/graphql/inputs/agent-session.input.ts +0 -13
  579. package/src/graphql/inputs/agent-state.input.ts +0 -13
  580. package/src/graphql/inputs/cloud-guardrails.input.ts +0 -16
  581. package/src/graphql/inputs/cloud.input.ts +0 -8
  582. package/src/graphql/inputs/context-property.input.ts +0 -10
  583. package/src/graphql/inputs/copilot-context.input.ts +0 -10
  584. package/src/graphql/inputs/custom-property.input.ts +0 -15
  585. package/src/graphql/inputs/extensions.input.ts +0 -21
  586. package/src/graphql/inputs/forwarded-parameters.input.ts +0 -22
  587. package/src/graphql/inputs/frontend.input.ts +0 -14
  588. package/src/graphql/inputs/generate-copilot-response.input.ts +0 -59
  589. package/src/graphql/inputs/load-agent-state.input.ts +0 -10
  590. package/src/graphql/inputs/message.input.ts +0 -110
  591. package/src/graphql/inputs/meta-event.input.ts +0 -18
  592. package/src/graphql/message-conversion/agui-to-gql.test.ts +0 -1263
  593. package/src/graphql/message-conversion/agui-to-gql.ts +0 -333
  594. package/src/graphql/message-conversion/gql-to-agui.test.ts +0 -1580
  595. package/src/graphql/message-conversion/gql-to-agui.ts +0 -278
  596. package/src/graphql/message-conversion/index.ts +0 -2
  597. package/src/graphql/message-conversion/roundtrip-conversion.test.ts +0 -526
  598. package/src/graphql/resolvers/copilot.resolver.ts +0 -708
  599. package/src/graphql/resolvers/state.resolver.ts +0 -27
  600. package/src/graphql/types/agents-response.type.ts +0 -19
  601. package/src/graphql/types/base/index.ts +0 -10
  602. package/src/graphql/types/converted/index.ts +0 -176
  603. package/src/graphql/types/copilot-response.type.ts +0 -138
  604. package/src/graphql/types/enums.ts +0 -38
  605. package/src/graphql/types/extensions-response.type.ts +0 -23
  606. package/src/graphql/types/guardrails-result.type.ts +0 -20
  607. package/src/graphql/types/load-agent-state-response.type.ts +0 -17
  608. package/src/graphql/types/message-status.type.ts +0 -42
  609. package/src/graphql/types/meta-events.type.ts +0 -71
  610. package/src/graphql/types/response-status.type.ts +0 -66
  611. package/src/index.ts +0 -4
  612. package/src/langgraph.ts +0 -1
  613. package/src/lib/cloud/index.ts +0 -4
  614. package/src/lib/error-messages.ts +0 -200
  615. package/src/lib/index.ts +0 -52
  616. package/src/lib/integrations/index.ts +0 -6
  617. package/src/lib/integrations/nest/index.ts +0 -14
  618. package/src/lib/integrations/nextjs/app-router.ts +0 -38
  619. package/src/lib/integrations/nextjs/pages-router.ts +0 -39
  620. package/src/lib/integrations/node-express/index.ts +0 -14
  621. package/src/lib/integrations/node-http/index.ts +0 -143
  622. package/src/lib/integrations/node-http/request-handler.ts +0 -111
  623. package/src/lib/integrations/shared.ts +0 -161
  624. package/src/lib/logger.ts +0 -28
  625. package/src/lib/observability.ts +0 -160
  626. package/src/lib/runtime/__tests__/copilot-runtime-error.test.ts +0 -169
  627. package/src/lib/runtime/__tests__/mcp-tools-utils.test.ts +0 -464
  628. package/src/lib/runtime/agent-integrations/langgraph/agent.ts +0 -209
  629. package/src/lib/runtime/agent-integrations/langgraph/consts.ts +0 -34
  630. package/src/lib/runtime/agent-integrations/langgraph/index.ts +0 -2
  631. package/src/lib/runtime/copilot-runtime.ts +0 -710
  632. package/src/lib/runtime/mcp-tools-utils.ts +0 -254
  633. package/src/lib/runtime/retry-utils.ts +0 -96
  634. package/src/lib/runtime/telemetry-agent-runner.ts +0 -139
  635. package/src/lib/runtime/types.ts +0 -49
  636. package/src/lib/runtime/utils.ts +0 -87
  637. package/src/lib/streaming.ts +0 -202
  638. package/src/lib/telemetry-client.ts +0 -64
  639. package/src/service-adapters/anthropic/anthropic-adapter.ts +0 -452
  640. package/src/service-adapters/anthropic/utils.ts +0 -152
  641. package/src/service-adapters/bedrock/bedrock-adapter.ts +0 -73
  642. package/src/service-adapters/conversion.ts +0 -67
  643. package/src/service-adapters/empty/empty-adapter.ts +0 -38
  644. package/src/service-adapters/events.ts +0 -294
  645. package/src/service-adapters/experimental/ollama/ollama-adapter.ts +0 -84
  646. package/src/service-adapters/google/google-genai-adapter.test.ts +0 -104
  647. package/src/service-adapters/google/google-genai-adapter.ts +0 -88
  648. package/src/service-adapters/groq/groq-adapter.ts +0 -203
  649. package/src/service-adapters/index.ts +0 -18
  650. package/src/service-adapters/langchain/langchain-adapter.ts +0 -111
  651. package/src/service-adapters/langchain/langserve.ts +0 -88
  652. package/src/service-adapters/langchain/types.ts +0 -14
  653. package/src/service-adapters/langchain/utils.ts +0 -313
  654. package/src/service-adapters/openai/openai-adapter.ts +0 -283
  655. package/src/service-adapters/openai/openai-assistant-adapter.ts +0 -344
  656. package/src/service-adapters/openai/utils.ts +0 -199
  657. package/src/service-adapters/service-adapter.ts +0 -41
  658. package/src/service-adapters/shared/error-utils.ts +0 -61
  659. package/src/service-adapters/shared/index.ts +0 -1
  660. package/src/service-adapters/unify/unify-adapter.ts +0 -151
  661. package/src/utils/failed-response-status-reasons.ts +0 -70
  662. package/src/utils/index.ts +0 -1
  663. package/src/v2/index.ts +0 -3
  664. package/tests/global.d.ts +0 -13
  665. package/tests/service-adapters/anthropic/allowlist-approach.test.ts +0 -226
  666. package/tests/service-adapters/anthropic/anthropic-adapter.test.ts +0 -389
  667. package/tests/service-adapters/openai/allowlist-approach.test.ts +0 -238
  668. package/tests/service-adapters/openai/openai-adapter.test.ts +0 -301
  669. package/tests/setup.jest.ts +0 -21
  670. package/tests/tsconfig.json +0 -10
  671. package/tsconfig.json +0 -13
  672. package/tsup.config.ts +0 -20
  673. package/typedoc.json +0 -4
@@ -0,0 +1,481 @@
1
+ import { AgentRunner } from "../runner/agent-runner.cjs";
2
+ import { ThreadAccessMode, ThreadsConfig } from "../handlers/shared/thread-access.cjs";
3
+ import { ForwardHeadersConfig, ResolvedForwardHeadersPolicy } from "../handlers/header-utils.cjs";
4
+ import { AfterRequestMiddleware, BeforeRequestMiddleware } from "./middleware.cjs";
5
+ import { CopilotRuntimeLogger } from "./logger.cjs";
6
+ import { TranscriptionService } from "../transcription-service/transcription-service.cjs";
7
+ import { DebugEventBus } from "./debug-event-bus.cjs";
8
+ import { CopilotRuntimeLearningConfig, CopilotRuntimeLearningContext, CopilotRuntimeUser, GetLearningContainerId, GetTrajectoryLearningContainerIds, LearningContainerSelectorInput, TrajectoryLearningContainerSelectorInput } from "./learning.cjs";
9
+ import { CopilotKitIntelligence } from "../intelligence-platform/client.cjs";
10
+ import "../intelligence-platform/index.cjs";
11
+ import { TelemetryCapture } from "../telemetry/telemetry-client.cjs";
12
+ import { DebugConfig, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ResolvedDebugConfig, RuntimeMode } from "@copilotkit/shared";
13
+ import { LicenseChecker } from "@copilotkit/license-verifier";
14
+ import { AbstractAgent } from "@ag-ui/client";
15
+ import { MCPClientConfig } from "@ag-ui/mcp-apps-middleware";
16
+ import { A2UIMiddlewareConfig } from "@ag-ui/a2ui-middleware";
17
+ import { Channel } from "@copilotkit/channels-core";
18
+
19
+ //#region src/runtime/core/runtime.d.ts
20
+ declare const VERSION: string;
21
+ interface BaseCopilotRuntimeMiddlewareOptions {
22
+ /** If set, middleware only applies to these named agents. Applies to all agents if omitted. */
23
+ agents?: string[];
24
+ }
25
+ /** Per-server tool policy belongs to the external middleware, and the release the runtime depends on does not support it. */
26
+ type McpAppsServerConfig = MCPClientConfig & {
27
+ /** Intelligence-only HTTP/SSE credentials from trusted server config, never iframe input. */headers?: Record<string, string>; /** Agent to bind this server to. If omitted, the server is available to all agents. */
28
+ agentId?: string;
29
+ };
30
+ interface McpAppsConfig {
31
+ /** List of MCP server configurations. */
32
+ servers: McpAppsServerConfig[];
33
+ }
34
+ interface OpenGenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {}
35
+ type OpenGenerativeUIConfig = boolean | OpenGenerativeUIOptions;
36
+ interface CopilotRuntimeMiddlewares {
37
+ /**
38
+ * Auto-apply A2UIMiddleware to agents at run time.
39
+ * Pass an object to enable and customise behaviour, or omit to disable.
40
+ */
41
+ a2ui?: BaseCopilotRuntimeMiddlewareOptions & A2UIMiddlewareConfig & {
42
+ /**
43
+ * Explicit on/off switch. Omit (or set `true`) to enable; set `false`
44
+ * to disable A2UI for this runtime while keeping the rest of the config
45
+ * (e.g. a `schema`/`catalog`) in place. A bare `a2ui: {}` stays enabled
46
+ * for backwards compatibility.
47
+ */
48
+ enabled?: boolean;
49
+ };
50
+ /** Auto-apply MCPAppsMiddleware to agents at run time. */
51
+ mcpApps?: McpAppsConfig;
52
+ /** Auto-apply OpenGenerativeUIMiddleware to agents at run time. */
53
+ openGenerativeUI?: OpenGenerativeUIConfig;
54
+ /**
55
+ * Experimental: CopilotKit generative UI surfaces (`render_ui`).
56
+ *
57
+ * - Omitted: applied to a run when the React provider sends a
58
+ * tool-transport envelope (`forwardedProps.copilotkit.ui`).
59
+ * - `true`: applied to every run.
60
+ * - `{ agents }`: applied to every run of the named agents.
61
+ * - `false`: never applied.
62
+ *
63
+ * A run with a markdown-transport envelope never gets it: the model writes
64
+ * the UI in a2ui code fences, and the client renders them.
65
+ */
66
+ generativeUI?: boolean | BaseCopilotRuntimeMiddlewareOptions;
67
+ }
68
+ /**
69
+ * Context passed to agent factory functions for per-request agent resolution.
70
+ */
71
+ interface AgentFactoryContext {
72
+ /** The incoming HTTP request. */
73
+ request: Request;
74
+ }
75
+ /**
76
+ * A function that dynamically creates agents on a per-request basis.
77
+ * Useful for multi-tenant scenarios or request-scoped agent configuration.
78
+ */
79
+ type AgentsFactory = (ctx: AgentFactoryContext) => MaybePromise<NonEmptyRecord<Record<string, AbstractAgent>>>;
80
+ /**
81
+ * Agents can be provided as:
82
+ * - A static record of agents
83
+ * - A Promise that resolves to a record of agents
84
+ * - A factory function that receives request context and returns agents (or a Promise of agents)
85
+ */
86
+ type AgentsConfig = MaybePromise<NonEmptyRecord<Record<string, AbstractAgent>>> | AgentsFactory;
87
+ /**
88
+ * Resolve an AgentsConfig value to a concrete record of agents.
89
+ * If the config is a factory function, it is called with the given request context.
90
+ * Otherwise it is awaited directly (static record or Promise).
91
+ */
92
+ declare function resolveAgents(agents: AgentsConfig, request?: Request): Promise<Record<string, AbstractAgent>>;
93
+ interface BaseCopilotRuntimeOptions extends CopilotRuntimeMiddlewares {
94
+ /**
95
+ * Map of available agents, or a factory function for per-request agent resolution.
96
+ *
97
+ * Static record:
98
+ * ```ts
99
+ * agents: { support: new SupportAgent(), technical: new TechnicalAgent() }
100
+ * ```
101
+ *
102
+ * Factory function (called per-request):
103
+ * ```ts
104
+ * agents: ({ request }) => {
105
+ * const tenantId = request.headers.get("x-tenant-id");
106
+ * return { default: createAgentForTenant(tenantId) };
107
+ * }
108
+ * ```
109
+ */
110
+ agents: AgentsConfig;
111
+ /** Optional transcription service for audio processing. */
112
+ transcriptionService?: TranscriptionService;
113
+ /** Optional *before* middleware – callback function or webhook URL. */
114
+ beforeRequestMiddleware?: BeforeRequestMiddleware;
115
+ /** Optional *after* middleware – callback function or webhook URL. */
116
+ afterRequestMiddleware?: AfterRequestMiddleware;
117
+ /** Signed license token for server-side feature verification. Falls back to COPILOTKIT_LICENSE_TOKEN env var. */
118
+ licenseToken?: string;
119
+ /** Standalone telemetry identity. Falls back to CPK_TELEMETRY_ID before legacy license identity. */
120
+ telemetryId?: string;
121
+ /**
122
+ * Properties added to every telemetry event this runtime sends.
123
+ *
124
+ * For what is true of the whole process rather than of one event. A product
125
+ * built on this runtime can name itself here and then be told apart in the
126
+ * events that already go, rather than sending events of its own.
127
+ *
128
+ * No effect when telemetry is off: nothing is sent, so nothing carries this.
129
+ */
130
+ telemetryProperties?: Record<string, unknown>;
131
+ /**
132
+ * A capture scope to emit this runtime's telemetry through, instead of one
133
+ * built from the identity options above.
134
+ *
135
+ * @internal Set by the deprecated v1 entrypoint, which delegates every
136
+ * request to this runtime. Handing its own scope down is what collapses
137
+ * the duplicate: the v1 entrypoint no longer emits the same events itself,
138
+ * and the events this runtime sends still reach Segment and still report
139
+ * the v1 surface. There is no reason for an application to pass this.
140
+ */
141
+ ɵtelemetry?: TelemetryCapture;
142
+ /** Enable debug logging for the event pipeline. */
143
+ debug?: DebugConfig;
144
+ /**
145
+ * Policy controlling which inbound HTTP headers are forwarded onto the
146
+ * outgoing agent call. By default a built-in denylist strips known
147
+ * infrastructure/proxy/platform headers (`x-forwarded-*`, `x-real-ip`,
148
+ * `x-vercel-*`, `x-copilotcloud-*`, etc.) while `authorization` and custom
149
+ * `x-*` application headers continue to forward (#5712). Set
150
+ * `{ useDefaultDenylist: false }` to restore the previous wide-open behavior.
151
+ */
152
+ forwardHeaders?: ForwardHeadersConfig;
153
+ /**
154
+ * Seconds of silence on an SSE response before the runtime writes a
155
+ * `: keep-alive` comment, so proxies and browsers with idle timeouts keep
156
+ * the connection open through long reasoning or tool phases. Comments are
157
+ * transport frames and never become AG-UI events. `0` disables it.
158
+ * @default 15
159
+ */
160
+ sseKeepAliveIntervalSeconds?: number;
161
+ /**
162
+ * Opt-in flag exposing the client-facing memory proxy routes
163
+ * (`/memories`, `/memories/recall`, `/memories/subscribe`, `/memories/:id`).
164
+ *
165
+ * Defaults to `false` — a **secure default**. When off, every `/memories/*`
166
+ * request 404s as if the route did not exist, so an un-opted-in deployment
167
+ * reveals nothing about memory even when Intelligence is configured. This does
168
+ * NOT affect the agent's own server-side memory tooling (`recall_memory` runs
169
+ * via the Intelligence MCP path, separate from this client REST proxy).
170
+ *
171
+ * Flip to `true` to power a client memory inspector (e.g. the dev console's
172
+ * Memory tab). Existing Intelligence deployments relying on the previously
173
+ * always-on Learning tab must set this to restore it.
174
+ *
175
+ * @deprecated Configure `memory.access` on an Intelligence Runtime. That one
176
+ * policy enables and limits both agent and browser Memory.
177
+ */
178
+ exposeMemoryRoutes?: boolean;
179
+ /**
180
+ * How local Threads are shared among callers that `identifyUser` does not
181
+ * identify, when no Intelligence is configured. Has no effect on an
182
+ * Intelligence runtime, where the platform scopes Threads per user.
183
+ *
184
+ * With `identifyUser`, every Thread operation (list, read, connect, run,
185
+ * stop, clear) reaches only the caller's own Threads, whatever this says.
186
+ * Without it, by default (`access: "owner"`), a Thread id works as a
187
+ * capability: whoever holds it may read, connect to, continue and stop that
188
+ * Thread, but listing and clearing Threads are refused with HTTP 403.
189
+ * `access: "open"` also lets every caller list and clear the Threads created
190
+ * without identity, as in earlier releases. That is insecure for any
191
+ * deployment that more than one person can reach. A Thread created by an
192
+ * identified user is never reachable without that identity.
193
+ */
194
+ threads?: ThreadsConfig;
195
+ }
196
+ type IdentifyUserCallback = (request: Request) => MaybePromise<CopilotRuntimeUser>;
197
+ type MemoryAccess = "none" | "read" | "read-write";
198
+ interface MemoryGrant {
199
+ readonly user: MemoryAccess;
200
+ readonly project: MemoryAccess;
201
+ }
202
+ type MemoryConsumer = "agent" | "client";
203
+ interface CopilotRuntimeMemoryConfig {
204
+ /** Resolves immutable Memory access for one authenticated web request. */
205
+ access(input: {
206
+ readonly request: Request;
207
+ readonly user: CopilotRuntimeUser;
208
+ readonly consumer: MemoryConsumer;
209
+ }): MaybePromise<MemoryGrant | null>;
210
+ }
211
+ interface CopilotSseRuntimeOptions extends BaseCopilotRuntimeOptions {
212
+ /** The runner to use for running agents in SSE mode. */
213
+ runner?: AgentRunner;
214
+ /**
215
+ * Resolves the authenticated user for a request. When set, each Thread
216
+ * belongs to the user whose request created it, and only that user can list,
217
+ * read, replay, clear, continue or stop it. The runner must enforce owners
218
+ * (InMemoryAgentRunner and SqliteAgentRunner do); with a runner that does
219
+ * not, those requests are refused. See `threads`.
220
+ *
221
+ * Threads that SqliteAgentRunner stored before it recorded owners belong to
222
+ * nobody: as before the upgrade, whoever holds such a Thread's id can reach
223
+ * it, and continuing it does not claim it. The runner logs how many it holds
224
+ * when it opens the database. Every new Thread is owned. InMemoryAgentRunner
225
+ * keeps no Threads across a restart, so it holds no such Threads.
226
+ */
227
+ identifyUser?: IdentifyUserCallback;
228
+ intelligence?: undefined;
229
+ generateThreadNames?: undefined;
230
+ /** Intelligence Channels require the Intelligence runtime; not available in SSE mode. */
231
+ channels?: undefined;
232
+ }
233
+ interface CopilotIntelligenceRuntimeBaseOptions extends BaseCopilotRuntimeOptions {
234
+ /** Configures Intelligence mode for durable threads and realtime events. */
235
+ intelligence: CopilotKitIntelligence;
236
+ /**
237
+ * Chooses one stable Learning Container ID for each web or Channel run.
238
+ * @deprecated Configure `getLearningContainerId` on `CopilotKitIntelligence`.
239
+ */
240
+ ɵlearning?: CopilotRuntimeLearningConfig;
241
+ /** Auto-generate short names for newly created threads. */
242
+ generateThreadNames?: boolean;
243
+ /** Max delay (ms) for WebSocket reconnect backoff. @default 10_000 */
244
+ maxReconnectMs?: number;
245
+ /** Max delay (ms) for channel rejoin backoff. @default 30_000 */
246
+ maxRejoinMs?: number;
247
+ /**
248
+ * Interval (ms) between Phoenix heartbeats on the runner WebSocket. Keep it
249
+ * below the idle timeout of any proxy between the runtime and Intelligence.
250
+ * @default 15_000
251
+ */
252
+ heartbeatIntervalMs?: number;
253
+ /** Lock TTL in seconds. Clamped to a maximum of 3600 (1 hour). @default 20 */
254
+ lockTtlSeconds?: number;
255
+ /** Custom Redis key prefix for the thread lock. */
256
+ lockKeyPrefix?: string;
257
+ /** Interval in seconds at which the runtime renews the thread lock. Clamped to a maximum of 3000 (50 minutes). @default 15 */
258
+ lockHeartbeatIntervalSeconds?: number;
259
+ }
260
+ type NonEmptyChannels = readonly [Channel, ...Channel[]];
261
+ /** Intelligence runtime options with web identity, Channels, or both. */
262
+ type CopilotIntelligenceRuntimeOptions = CopilotIntelligenceRuntimeBaseOptions & ({
263
+ /** Resolves the authenticated user for web requests. */identifyUser: IdentifyUserCallback; /** Enables agent and browser Memory under one request policy. */
264
+ memory?: CopilotRuntimeMemoryConfig;
265
+ channels?: readonly Channel[];
266
+ } | {
267
+ /** Channels-only runtimes expose no functional web surface. */identifyUser?: undefined;
268
+ memory?: undefined;
269
+ channels: NonEmptyChannels;
270
+ });
271
+ type CopilotRuntimeOptions = CopilotSseRuntimeOptions | CopilotIntelligenceRuntimeOptions;
272
+ interface CopilotRuntimeLike {
273
+ agents: CopilotRuntimeOptions["agents"];
274
+ transcriptionService: CopilotRuntimeOptions["transcriptionService"];
275
+ beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
276
+ afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
277
+ runner: AgentRunner;
278
+ a2ui: CopilotRuntimeOptions["a2ui"];
279
+ mcpApps: CopilotRuntimeOptions["mcpApps"];
280
+ openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
281
+ generativeUI?: CopilotRuntimeOptions["generativeUI"];
282
+ intelligence?: CopilotKitIntelligence;
283
+ identifyUser?: IdentifyUserCallback;
284
+ mode: RuntimeMode;
285
+ licenseChecker?: LicenseChecker;
286
+ debugEventBus?: DebugEventBus;
287
+ debug: ResolvedDebugConfig;
288
+ debugLogger?: CopilotRuntimeLogger;
289
+ /**
290
+ * Runtime-bound telemetry capture. Optional so external implementations of
291
+ * this published interface remain source-compatible.
292
+ */
293
+ telemetry?: TelemetryCapture;
294
+ /**
295
+ * Resolved inbound-header forwarding policy read by the /run and /connect call
296
+ * sites. Optional on the published interface so an external `CopilotRuntimeLike`
297
+ * implementor predating this field stays source-compatible (non-breaking minor
298
+ * release). Concrete runtimes (`BaseCopilotRuntime`) always resolve and set it;
299
+ * the call sites coalesce a missing value to the default resolved policy
300
+ * (`resolveForwardHeadersPolicy(undefined)` — default-on denylist).
301
+ */
302
+ forwardHeadersPolicy?: ResolvedForwardHeadersPolicy;
303
+ /**
304
+ * Resolved SSE keep-alive interval in seconds; `0` disables it. Optional on
305
+ * the published interface for the same source-compatibility reason as
306
+ * `forwardHeadersPolicy`; the SSE call sites fall back to the default.
307
+ */
308
+ sseKeepAliveIntervalSeconds?: number;
309
+ /**
310
+ * Resolved opt-in flag for the client-facing memory proxy routes. Optional on
311
+ * the published interface so an external `CopilotRuntimeLike` implementor
312
+ * predating this field stays source-compatible; the dispatcher coalesces a
313
+ * missing value to `false` (secure default — routes hidden). Concrete runtimes
314
+ * (`BaseCopilotRuntime`) always resolve and set it.
315
+ */
316
+ exposeMemoryRoutes?: boolean;
317
+ /**
318
+ * Resolved local Thread access mode. Optional on the published interface so
319
+ * an external implementor stays source-compatible; a missing value means
320
+ * the default (`DEFAULT_THREAD_ACCESS`).
321
+ */
322
+ threadAccess?: ThreadAccessMode;
323
+ memory?: CopilotRuntimeMemoryConfig;
324
+ learning?: CopilotRuntimeLearningConfig;
325
+ }
326
+ interface CopilotSseRuntimeLike extends CopilotRuntimeLike {
327
+ intelligence?: undefined;
328
+ mode: typeof RUNTIME_MODE_SSE;
329
+ }
330
+ interface CopilotIntelligenceRuntimeLike extends CopilotRuntimeLike {
331
+ intelligence: CopilotKitIntelligence;
332
+ identifyUser?: IdentifyUserCallback;
333
+ generateThreadNames: boolean;
334
+ lockTtlSeconds: number;
335
+ lockKeyPrefix?: string;
336
+ lockHeartbeatIntervalSeconds: number;
337
+ channels: Channel[];
338
+ learning?: CopilotRuntimeLearningConfig;
339
+ mode: typeof RUNTIME_MODE_INTELLIGENCE;
340
+ }
341
+ declare abstract class BaseCopilotRuntime implements CopilotRuntimeLike {
342
+ agents: CopilotRuntimeOptions["agents"];
343
+ transcriptionService: CopilotRuntimeOptions["transcriptionService"];
344
+ beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
345
+ afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
346
+ runner: AgentRunner;
347
+ a2ui: CopilotRuntimeOptions["a2ui"];
348
+ mcpApps: CopilotRuntimeOptions["mcpApps"];
349
+ openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
350
+ generativeUI: CopilotRuntimeOptions["generativeUI"];
351
+ licenseChecker?: LicenseChecker;
352
+ readonly debugEventBus?: DebugEventBus;
353
+ debug: ResolvedDebugConfig;
354
+ debugLogger?: CopilotRuntimeLogger;
355
+ readonly telemetry: TelemetryCapture;
356
+ readonly forwardHeadersPolicy: ResolvedForwardHeadersPolicy;
357
+ readonly sseKeepAliveIntervalSeconds: number;
358
+ readonly exposeMemoryRoutes: boolean;
359
+ readonly threadAccess: ThreadAccessMode;
360
+ readonly memory?: CopilotRuntimeMemoryConfig;
361
+ /**
362
+ * License token resolved once with the env fallback, so telemetry
363
+ * attribution (below) and subclass feature gating
364
+ * (CopilotIntelligenceRuntime's licenseChecker) read the exact same value
365
+ * instead of each re-applying `?? COPILOTKIT_LICENSE_TOKEN`.
366
+ */
367
+ protected readonly resolvedLicenseToken?: string;
368
+ abstract readonly intelligence?: CopilotKitIntelligence;
369
+ abstract readonly mode: RuntimeMode;
370
+ constructor(options: BaseCopilotRuntimeOptions, runner: AgentRunner);
371
+ }
372
+ declare class CopilotSseRuntime extends BaseCopilotRuntime implements CopilotSseRuntimeLike {
373
+ readonly intelligence: any;
374
+ readonly mode: "sse";
375
+ readonly identifyUser?: IdentifyUserCallback;
376
+ constructor(options: CopilotSseRuntimeOptions);
377
+ }
378
+ declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements CopilotIntelligenceRuntimeLike {
379
+ readonly intelligence: CopilotKitIntelligence;
380
+ readonly identifyUser?: IdentifyUserCallback;
381
+ readonly generateThreadNames: boolean;
382
+ readonly lockTtlSeconds: number;
383
+ readonly lockKeyPrefix?: string;
384
+ readonly lockHeartbeatIntervalSeconds: number;
385
+ readonly channels: Channel[];
386
+ readonly learning?: CopilotRuntimeLearningConfig;
387
+ readonly mode: "intelligence";
388
+ /** Maximum allowed lock TTL in seconds (1 hour). */
389
+ static readonly MAX_LOCK_TTL_SECONDS = 3600;
390
+ /** Maximum allowed heartbeat interval in seconds (50 minutes). */
391
+ static readonly MAX_HEARTBEAT_INTERVAL_SECONDS = 3000;
392
+ constructor(options: CopilotIntelligenceRuntimeOptions);
393
+ }
394
+ declare function isIntelligenceRuntime(runtime: CopilotRuntimeLike): runtime is CopilotIntelligenceRuntimeLike;
395
+ /**
396
+ * Single source of truth for "is A2UI on for this runtime?". Both the run path
397
+ * (which applies `A2UIMiddleware`) and the `/info` response (which tells the
398
+ * client whether to mount the A2UI renderer + catalog context) MUST go through
399
+ * this, so they can never disagree — the divergence between them was the root
400
+ * of CopilotKit/CopilotKit#5369.
401
+ *
402
+ * Backwards compatible: any config object is enabled (matching the historical
403
+ * `!!runtime.a2ui`); only an explicit `enabled: false` turns it off.
404
+ */
405
+ declare function isA2UIEnabled(a2ui: CopilotRuntimeOptions["a2ui"]): a2ui is NonNullable<CopilotRuntimeOptions["a2ui"]>;
406
+ /**
407
+ * Compile-time phantom brand marking a {@link CopilotRuntime} that was
408
+ * constructed with at least one declared Intelligence Channel. It has no runtime
409
+ * representation — the shim never sets this property; it exists purely so
410
+ * `createCopilotRuntimeHandler` can tell, at the type level, that the resulting
411
+ * handler will carry a non-optional `.channels` control surface.
412
+ */
413
+ interface RuntimeWithDeclaredChannels {
414
+ /**
415
+ * @internal Phantom brand key. Never present at runtime; do not read or set.
416
+ */
417
+ readonly __copilotkitChannelsDeclared: true;
418
+ }
419
+ /**
420
+ * Instance shape of the {@link CopilotRuntime} compatibility shim. Extends
421
+ * {@link CopilotRuntimeLike} with the Intelligence-only accessors the shim
422
+ * surfaces (all `undefined` in SSE mode). Declared explicitly so the exported
423
+ * `CopilotRuntime` name resolves as a type as well as a value.
424
+ */
425
+ interface CopilotRuntime extends CopilotRuntimeLike {
426
+ /** Telemetry capture bound to this runtime's construction-time identity. */
427
+ telemetry: TelemetryCapture;
428
+ /** Auto-generate short thread names; `undefined` in SSE mode. */
429
+ generateThreadNames?: boolean;
430
+ /** Thread lock TTL in seconds; `undefined` in SSE mode. */
431
+ lockTtlSeconds?: number;
432
+ /** Custom Redis key prefix for the thread lock; `undefined` in SSE mode. */
433
+ lockKeyPrefix?: string;
434
+ /** Thread lock heartbeat interval in seconds; `undefined` in SSE mode. */
435
+ lockHeartbeatIntervalSeconds?: number;
436
+ /** Declared Intelligence Channels; `undefined` in SSE mode. */
437
+ channels?: Channel[];
438
+ /** Learning Container selector; `undefined` in SSE mode. */
439
+ learning?: CopilotRuntimeLearningConfig;
440
+ }
441
+ /**
442
+ * Constructor type for the {@link CopilotRuntime} compatibility shim.
443
+ *
444
+ * The first overload fires when the caller passes `intelligence` together with a
445
+ * non-empty `channels` tuple: it returns a {@link RuntimeWithDeclaredChannels}-
446
+ * branded runtime, which `createCopilotRuntimeHandler` maps to a handler whose
447
+ * `.channels` is non-optional. Every other configuration (SSE, or Intelligence
448
+ * without channels, or an empty `channels: []`) falls through to the second
449
+ * overload and stays unbranded, so its handler keeps `.channels` optional.
450
+ *
451
+ * A class constructor cannot vary its return type across overloads (it is pinned
452
+ * to the instance type), so the branding lives on this construct-signature
453
+ * interface instead of on the class itself.
454
+ */
455
+ interface CopilotRuntimeConstructor {
456
+ new (options: CopilotIntelligenceRuntimeBaseOptions & ({
457
+ identifyUser: IdentifyUserCallback;
458
+ memory?: CopilotRuntimeMemoryConfig;
459
+ channels: NonEmptyChannels;
460
+ } | {
461
+ identifyUser?: undefined;
462
+ memory?: undefined;
463
+ channels: NonEmptyChannels;
464
+ })): CopilotRuntime & RuntimeWithDeclaredChannels;
465
+ new (options: CopilotRuntimeOptions): CopilotRuntime;
466
+ }
467
+ /**
468
+ * The public `CopilotRuntime` constructor. Backed by {@link CopilotRuntimeShim}
469
+ * but typed as {@link CopilotRuntimeConstructor} so that constructing with a
470
+ * non-empty `channels` array yields a {@link RuntimeWithDeclaredChannels}-branded
471
+ * runtime type.
472
+ *
473
+ * The `as unknown as` cast is required (not dishonest widening): the brand is a
474
+ * phantom, compile-time-only marker with no runtime representation, so the shim
475
+ * instances legitimately do not carry the brand property. Behavior is identical
476
+ * to the former `class CopilotRuntime` — this only refines the static type.
477
+ */
478
+ declare const CopilotRuntime: CopilotRuntimeConstructor;
479
+ //#endregion
480
+ export { AgentFactoryContext, AgentsConfig, AgentsFactory, CopilotIntelligenceRuntime, CopilotIntelligenceRuntimeLike, CopilotIntelligenceRuntimeOptions, CopilotRuntime, CopilotRuntimeConstructor, CopilotRuntimeLike, CopilotRuntimeMemoryConfig, CopilotRuntimeOptions, CopilotSseRuntime, CopilotSseRuntimeLike, CopilotSseRuntimeOptions, IdentifyUserCallback, McpAppsConfig, McpAppsServerConfig, MemoryAccess, MemoryConsumer, MemoryGrant, OpenGenerativeUIConfig, OpenGenerativeUIOptions, RuntimeWithDeclaredChannels, VERSION, isA2UIEnabled, isIntelligenceRuntime, resolveAgents };
481
+ //# sourceMappingURL=runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.cts","names":[],"sources":["../../../src/runtime/core/runtime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAiFa,OAAA;AAAA,UAEH,mCAAA;EAFoC;EAI5C,MAAA;AAAA;;KAIU,mBAAA,GAAsB,eAAA;EAJhC,6FAMA,OAAA,GAAU,MAAA,kBAFA;EAIV,OAAA;AAAA;AAAA,UAGe,aAAA;EAPiB;EAShC,OAAA,EAAS,mBAAA;AAAA;AAAA,UAGM,uBAAA,SAAgC,mCAAA;AAAA,KAErC,sBAAA,aAAmC,uBAAA;AAAA,UAErC,yBAAA;EAToB;;;;EAc5B,IAAA,GAAO,mCAAA,GACL,oBAAA;IAVqC;;;;AAEzC;;IAeM,OAAA;EAAA;EAfgE;EAkBpE,OAAA,GAAU,aAAA;EAhBuB;EAkBjC,gBAAA,GAAmB,sBAAA;EAbZ;;;;;;;;;;;;EA0BP,YAAA,aAAyB,mCAAA;AAAA;;;;UAMV,mBAAA;EAN6C;EAQ5D,OAAA,EAAS,OAAA;AAAA;;;;AAOX;KAAY,aAAA,IACV,GAAA,EAAK,mBAAA,KACF,YAAA,CAAa,cAAA,CAAe,MAAA,SAAe,aAAA;;;;;;;KAQpC,YAAA,GACR,YAAA,CAAa,cAAA,CAAe,MAAA,SAAe,aAAA,MAC3C,aAAA;;;;;;iBAOkB,aAAA,CACpB,MAAA,EAAQ,YAAA,EACR,OAAA,GAAU,OAA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