@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,91 @@
1
+ import { LearnedSkillsError } from "../learned-skills.mjs";
2
+ import { invalidSnapshot } from "./errors.mjs";
3
+ import { MAX_SNAPSHOT_BYTES, readArchive, safeRelativePath } from "./archive.mjs";
4
+ import { createHash } from "node:crypto";
5
+
6
+ //#region src/runtime/intelligence-platform/skill-registry/snapshot.ts
7
+ function object(value) {
8
+ return value !== null && typeof value === "object" && !Array.isArray(value);
9
+ }
10
+ function sha256(bytes) {
11
+ return createHash("sha256").update(bytes).digest("hex");
12
+ }
13
+ function utf8(bytes) {
14
+ try {
15
+ return new TextDecoder("utf-8", {
16
+ fatal: true,
17
+ ignoreBOM: true
18
+ }).decode(bytes);
19
+ } catch {
20
+ return;
21
+ }
22
+ }
23
+ /** Validate a replacement fully before it can become an invocation snapshot. */
24
+ async function validateSnapshot(response, signal) {
25
+ try {
26
+ if (!object(response) || !(response.bytes instanceof Uint8Array) || typeof response.revision !== "string" || typeof response.etag !== "string" || typeof response.contentType !== "string") throw invalidSnapshot();
27
+ const { revision, etag, contentType } = response;
28
+ if (response.status !== "snapshot" || response.bytes.byteLength > MAX_SNAPSHOT_BYTES || contentType.split(";", 1)[0]?.trim().toLowerCase() !== "application/zip" || !revision || !/^"[a-f0-9]{64}"$/.test(etag)) throw invalidSnapshot();
29
+ const bytes = Buffer.from(response.bytes);
30
+ if (`"${sha256(bytes)}"` !== etag) throw invalidSnapshot();
31
+ const archive = await readArchive(bytes, signal);
32
+ const manifestBytes = archive.get("manifest.json");
33
+ if (!manifestBytes) throw invalidSnapshot();
34
+ const decoded = utf8(manifestBytes);
35
+ if (decoded === void 0) throw invalidSnapshot();
36
+ const manifest = JSON.parse(decoded);
37
+ if (!object(manifest)) throw invalidSnapshot();
38
+ if (typeof manifest.schemaVersion === "number" && manifest.schemaVersion !== 1) throw new LearnedSkillsError("UNSUPPORTED_SERVER", false);
39
+ if (manifest.schemaVersion !== 1 || manifest.revision !== revision || !Array.isArray(manifest.skills)) throw invalidSnapshot();
40
+ const expected = new Set(["manifest.json"]);
41
+ let previousName;
42
+ const skills = [];
43
+ for (const skill of manifest.skills) {
44
+ if (!object(skill) || typeof skill.name !== "string" || !safeRelativePath(skill.name) || skill.name.includes("/") || previousName !== void 0 && Buffer.compare(Buffer.from(previousName), Buffer.from(skill.name)) >= 0 || typeof skill.description !== "string" || !Array.isArray(skill.files)) throw invalidSnapshot();
45
+ previousName = skill.name;
46
+ let previousPath;
47
+ let hasSkill = false;
48
+ const files = [];
49
+ for (const file of skill.files) {
50
+ if (!object(file) || typeof file.path !== "string" || !safeRelativePath(file.path) || previousPath !== void 0 && Buffer.compare(Buffer.from(previousPath), Buffer.from(file.path)) >= 0 || typeof file.size !== "number" || !Number.isSafeInteger(file.size) || file.size < 0 || typeof file.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(file.sha256)) throw invalidSnapshot();
51
+ previousPath = file.path;
52
+ const path = `${skill.name}/${file.path}`;
53
+ if (expected.has(path)) throw invalidSnapshot();
54
+ expected.add(path);
55
+ const content = archive.get(path);
56
+ if (!content || content.length !== file.size || sha256(content) !== file.sha256) throw invalidSnapshot();
57
+ const text = utf8(content);
58
+ if (file.path === "SKILL.md") {
59
+ if (text === void 0) throw invalidSnapshot();
60
+ hasSkill = true;
61
+ }
62
+ files.push(Object.freeze({
63
+ path: file.path,
64
+ size: file.size,
65
+ sha256: file.sha256,
66
+ ...text !== void 0 ? { text } : {}
67
+ }));
68
+ }
69
+ if (!hasSkill) throw invalidSnapshot();
70
+ skills.push(Object.freeze({
71
+ name: skill.name,
72
+ description: skill.description,
73
+ files: Object.freeze(files)
74
+ }));
75
+ }
76
+ if (expected.size !== archive.size || [...archive.keys()].some((path) => !expected.has(path))) throw invalidSnapshot();
77
+ return Object.freeze({
78
+ revision,
79
+ etag,
80
+ skills: Object.freeze(skills)
81
+ });
82
+ } catch (error) {
83
+ if (signal?.aborted) throw signal.reason;
84
+ if (error instanceof LearnedSkillsError) throw error;
85
+ throw invalidSnapshot(error);
86
+ }
87
+ }
88
+
89
+ //#endregion
90
+ export { validateSnapshot };
91
+ //# sourceMappingURL=snapshot.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.mjs","names":["SkillDeliveryError"],"sources":["../../../../src/runtime/intelligence-platform/skill-registry/snapshot.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport type { LearnedSkillsSnapshotResult } from \"../learned-skills\";\nimport { SkillDeliveryError, invalidSnapshot } from \"./errors\";\nimport { MAX_SNAPSHOT_BYTES, readArchive, safeRelativePath } from \"./archive\";\n\nexport interface SnapshotFile {\n readonly path: string;\n readonly size: number;\n readonly sha256: string;\n /** Absent for supporting resources that cannot be decoded as UTF-8 text. */\n readonly text?: string;\n}\nexport interface SnapshotSkill {\n readonly name: string;\n readonly description: string;\n readonly files: readonly SnapshotFile[];\n}\nexport interface VerifiedSnapshot {\n readonly revision: string;\n readonly etag: string;\n readonly skills: readonly SnapshotSkill[];\n}\n\nfunction object(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction sha256(bytes: Uint8Array): string {\n return createHash(\"sha256\").update(bytes).digest(\"hex\");\n}\nfunction utf8(bytes: Uint8Array): string | undefined {\n try {\n return new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true }).decode(\n bytes,\n );\n } catch {\n return undefined;\n }\n}\n\n/** Validate a replacement fully before it can become an invocation snapshot. */\nexport async function validateSnapshot(\n response: Extract<LearnedSkillsSnapshotResult, { status: \"snapshot\" }>,\n signal?: AbortSignal,\n): Promise<VerifiedSnapshot> {\n try {\n if (\n !object(response) ||\n !(response.bytes instanceof Uint8Array) ||\n typeof response.revision !== \"string\" ||\n typeof response.etag !== \"string\" ||\n typeof response.contentType !== \"string\"\n )\n throw invalidSnapshot();\n const { revision, etag, contentType } = response;\n if (\n response.status !== \"snapshot\" ||\n response.bytes.byteLength > MAX_SNAPSHOT_BYTES ||\n contentType.split(\";\", 1)[0]?.trim().toLowerCase() !==\n \"application/zip\" ||\n !revision ||\n !/^\"[a-f0-9]{64}\"$/.test(etag)\n )\n throw invalidSnapshot();\n // Own the bytes before asynchronous decompression so an injected client\n // cannot mutate an in-flight replacement after its digest is checked.\n const bytes = Buffer.from(response.bytes);\n if (`\"${sha256(bytes)}\"` !== etag) throw invalidSnapshot();\n const archive = await readArchive(bytes, signal);\n const manifestBytes = archive.get(\"manifest.json\");\n if (!manifestBytes) throw invalidSnapshot();\n const decoded = utf8(manifestBytes);\n if (decoded === undefined) throw invalidSnapshot();\n const manifest: unknown = JSON.parse(decoded);\n if (!object(manifest)) throw invalidSnapshot();\n if (\n typeof manifest.schemaVersion === \"number\" &&\n manifest.schemaVersion !== 1\n )\n throw new SkillDeliveryError(\"UNSUPPORTED_SERVER\", false);\n if (\n manifest.schemaVersion !== 1 ||\n manifest.revision !== revision ||\n !Array.isArray(manifest.skills)\n )\n throw invalidSnapshot();\n const expected = new Set([\"manifest.json\"]);\n let previousName: string | undefined;\n const skills: SnapshotSkill[] = [];\n for (const skill of manifest.skills) {\n if (\n !object(skill) ||\n typeof skill.name !== \"string\" ||\n !safeRelativePath(skill.name) ||\n skill.name.includes(\"/\") ||\n (previousName !== undefined &&\n Buffer.compare(Buffer.from(previousName), Buffer.from(skill.name)) >=\n 0) ||\n typeof skill.description !== \"string\" ||\n !Array.isArray(skill.files)\n )\n throw invalidSnapshot();\n previousName = skill.name;\n let previousPath: string | undefined;\n let hasSkill = false;\n const files: SnapshotFile[] = [];\n for (const file of skill.files) {\n if (\n !object(file) ||\n typeof file.path !== \"string\" ||\n !safeRelativePath(file.path) ||\n (previousPath !== undefined &&\n Buffer.compare(Buffer.from(previousPath), Buffer.from(file.path)) >=\n 0) ||\n typeof file.size !== \"number\" ||\n !Number.isSafeInteger(file.size) ||\n file.size < 0 ||\n typeof file.sha256 !== \"string\" ||\n !/^[a-f0-9]{64}$/.test(file.sha256)\n )\n throw invalidSnapshot();\n previousPath = file.path;\n const path = `${skill.name}/${file.path}`;\n if (expected.has(path)) throw invalidSnapshot();\n expected.add(path);\n const content = archive.get(path);\n if (\n !content ||\n content.length !== file.size ||\n sha256(content) !== file.sha256\n )\n throw invalidSnapshot();\n const text = utf8(content);\n if (file.path === \"SKILL.md\") {\n if (text === undefined) throw invalidSnapshot();\n hasSkill = true;\n }\n files.push(\n Object.freeze({\n path: file.path,\n size: file.size,\n sha256: file.sha256,\n ...(text !== undefined ? { text } : {}),\n }),\n );\n }\n if (!hasSkill) throw invalidSnapshot();\n skills.push(\n Object.freeze({\n name: skill.name,\n description: skill.description,\n files: Object.freeze(files),\n }),\n );\n }\n if (\n expected.size !== archive.size ||\n [...archive.keys()].some((path) => !expected.has(path))\n )\n throw invalidSnapshot();\n return Object.freeze({\n revision: revision,\n etag: etag,\n skills: Object.freeze(skills),\n });\n } catch (error) {\n if (signal?.aborted) throw signal.reason;\n if (error instanceof SkillDeliveryError) throw error;\n throw invalidSnapshot(error);\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,142 @@
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
+ const require_client = require('./client.cjs');
3
+ let _copilotkit_shared = require("@copilotkit/shared");
4
+
5
+ //#region src/runtime/intelligence-platform/thread-lock-heartbeat.ts
6
+ /** Delay before the first retry of a failed renewal; doubles per attempt. */
7
+ const INITIAL_RETRY_DELAY_MS = 1e3;
8
+ /** Upper bound for the delay between renewal retries. */
9
+ const MAX_RETRY_DELAY_MS = 8e3;
10
+ /** Longest a single renewal may stay in flight before it counts as failed. */
11
+ const ATTEMPT_TIMEOUT_MS = 1e4;
12
+ /** Stop retrying this long before the lock would expire. */
13
+ const DEADLINE_SAFETY_MARGIN_MS = 1e3;
14
+ var RenewalTimeoutError = class extends Error {
15
+ constructor(timeoutMs) {
16
+ super(`Thread lock renewal did not settle within ${timeoutMs}ms`);
17
+ this.name = "RenewalTimeoutError";
18
+ }
19
+ };
20
+ /**
21
+ * Whether a failed renewal may succeed if retried. A lost lock is a 409 the
22
+ * platform marks `retryable: false`; server failures (5xx), timeouts and
23
+ * network errors are worth retrying while the lock is still valid.
24
+ */
25
+ function isRetryableLockRenewalError(error) {
26
+ if (error instanceof require_client.PlatformRequestError) {
27
+ if (error.retryable !== void 0) return error.retryable;
28
+ return error.status >= 500 || error.status === 408 || error.status === 429;
29
+ }
30
+ return true;
31
+ }
32
+ /**
33
+ * Keep a thread lock alive for a running agent.
34
+ *
35
+ * Renews every `intervalMs` (sooner if that would run past the lock's
36
+ * lifetime), with at most one renewal in flight. A failed renewal is retried
37
+ * with exponential backoff while the lock is still valid: the deadline is when
38
+ * the last successful renewal was *sent* plus the `ttlSeconds` it returned,
39
+ * because the platform starts the TTL when it handles the request (initially
40
+ * start plus `initialTtlSeconds`, or `fallbackTtlSeconds` when the platform
41
+ * reported no lifetime at acquisition). A non-retryable failure, or running
42
+ * out of time before the deadline, calls `onLost`.
43
+ * A `"completed"` response means the run already ended on the platform, so
44
+ * the heartbeat stops without calling `onLost`.
45
+ */
46
+ function startThreadLockHeartbeat(options) {
47
+ const { renew, intervalMs, fallbackTtlSeconds, onLost } = options;
48
+ let stopped = false;
49
+ let timer;
50
+ const initialTtlSeconds = typeof options.initialTtlSeconds === "number" && Number.isFinite(options.initialTtlSeconds) ? options.initialTtlSeconds : fallbackTtlSeconds;
51
+ let deadline = Date.now() + initialTtlSeconds * 1e3;
52
+ let failedAttempts = 0;
53
+ const schedule = (delayMs) => {
54
+ timer = setTimeout(() => {
55
+ timer = void 0;
56
+ attempt();
57
+ }, delayMs);
58
+ if (options.unref) timer.unref?.();
59
+ };
60
+ /** Time left before the safety cutoff ahead of the lock's expiry. */
61
+ const remainingMs = () => deadline - DEADLINE_SAFETY_MARGIN_MS - Date.now();
62
+ const scheduleRenewal = () => {
63
+ schedule(intervalMs < remainingMs() ? intervalMs : 0);
64
+ };
65
+ const stop = () => {
66
+ stopped = true;
67
+ if (timer !== void 0) {
68
+ clearTimeout(timer);
69
+ timer = void 0;
70
+ }
71
+ };
72
+ const lose = (error) => {
73
+ stop();
74
+ onLost(error);
75
+ };
76
+ const attempt = async () => {
77
+ const timeoutMs = Math.min(ATTEMPT_TIMEOUT_MS, remainingMs());
78
+ if (timeoutMs <= 0) {
79
+ lose(/* @__PURE__ */ new Error("Thread lock expired before it could be renewed"));
80
+ return;
81
+ }
82
+ const sentAt = Date.now();
83
+ const controller = new AbortController();
84
+ let response;
85
+ try {
86
+ response = await withTimeout(renew(controller.signal), timeoutMs, options.unref, () => controller.abort());
87
+ } catch (error) {
88
+ if (!stopped) handleFailure(error);
89
+ return;
90
+ }
91
+ if (stopped) return;
92
+ failedAttempts = 0;
93
+ if (response?.status === "completed") {
94
+ stop();
95
+ return;
96
+ }
97
+ deadline = sentAt + (typeof response?.ttlSeconds === "number" && response.ttlSeconds > 0 ? response.ttlSeconds : fallbackTtlSeconds) * 1e3;
98
+ scheduleRenewal();
99
+ };
100
+ const handleFailure = (error) => {
101
+ if (!isRetryableLockRenewalError(error)) {
102
+ lose(error);
103
+ return;
104
+ }
105
+ const delayMs = Math.min(INITIAL_RETRY_DELAY_MS * 2 ** failedAttempts, MAX_RETRY_DELAY_MS);
106
+ failedAttempts += 1;
107
+ const remaining = remainingMs();
108
+ if (delayMs >= remaining) {
109
+ lose(error);
110
+ return;
111
+ }
112
+ _copilotkit_shared.logger.warn({
113
+ err: error,
114
+ attempt: failedAttempts,
115
+ retryInMs: delayMs,
116
+ remainingMs: remaining
117
+ }, "Thread lock renewal failed; retrying before the lock expires");
118
+ schedule(delayMs);
119
+ };
120
+ scheduleRenewal();
121
+ return { stop };
122
+ }
123
+ function withTimeout(promise, timeoutMs, unref, onTimeout) {
124
+ return new Promise((resolve, reject) => {
125
+ const timeout = setTimeout(() => {
126
+ onTimeout();
127
+ reject(new RenewalTimeoutError(timeoutMs));
128
+ }, timeoutMs);
129
+ if (unref) timeout.unref?.();
130
+ promise.then((value) => {
131
+ clearTimeout(timeout);
132
+ resolve(value);
133
+ }, (error) => {
134
+ clearTimeout(timeout);
135
+ reject(error);
136
+ });
137
+ });
138
+ }
139
+
140
+ //#endregion
141
+ exports.startThreadLockHeartbeat = startThreadLockHeartbeat;
142
+ //# sourceMappingURL=thread-lock-heartbeat.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-lock-heartbeat.cjs","names":["PlatformRequestError"],"sources":["../../../src/runtime/intelligence-platform/thread-lock-heartbeat.ts"],"sourcesContent":["import { logger } from \"@copilotkit/shared\";\nimport { PlatformRequestError } from \"./client\";\nimport type { RenewThreadLockResponse } from \"./client\";\n\n/** Delay before the first retry of a failed renewal; doubles per attempt. */\nconst INITIAL_RETRY_DELAY_MS = 1_000;\n/** Upper bound for the delay between renewal retries. */\nconst MAX_RETRY_DELAY_MS = 8_000;\n/** Longest a single renewal may stay in flight before it counts as failed. */\nconst ATTEMPT_TIMEOUT_MS = 10_000;\n/** Stop retrying this long before the lock would expire. */\nconst DEADLINE_SAFETY_MARGIN_MS = 1_000;\n\nexport interface ThreadLockHeartbeatOptions {\n /**\n * Sends one renewal request. The signal aborts when the attempt times out,\n * so an abandoned request never overlaps its retry.\n */\n renew: (signal: AbortSignal) => Promise<RenewThreadLockResponse>;\n /** Delay between successful renewals. */\n intervalMs: number;\n /**\n * Lock lifetime assumed when the platform has not reported one: until the\n * first successful renewal when {@link initialTtlSeconds} is absent, and\n * for renewal responses that omit `ttlSeconds`.\n */\n fallbackTtlSeconds: number;\n /**\n * Remaining lock lifetime when the heartbeat starts, as reported by the\n * platform at acquisition, measured from when the acquire request was sent.\n * Used until the first successful renewal; when absent,\n * {@link fallbackTtlSeconds} applies instead. A value of zero or less means\n * the lock has already expired.\n */\n initialTtlSeconds?: number;\n /**\n * Called once when the lock can no longer be kept: a non-retryable failure,\n * or retryable failures that ran out the lock's remaining lifetime. Never\n * called after {@link ThreadLockHeartbeat.stop}.\n */\n onLost: (error: unknown) => void;\n /** Unref timers so a pending heartbeat never keeps the process alive. */\n unref?: boolean;\n}\n\nexport interface ThreadLockHeartbeat {\n /** Cancel the next renewal and any pending retry. Idempotent. */\n stop(): void;\n}\n\nclass RenewalTimeoutError extends Error {\n constructor(timeoutMs: number) {\n super(`Thread lock renewal did not settle within ${timeoutMs}ms`);\n this.name = \"RenewalTimeoutError\";\n }\n}\n\n/**\n * Whether a failed renewal may succeed if retried. A lost lock is a 409 the\n * platform marks `retryable: false`; server failures (5xx), timeouts and\n * network errors are worth retrying while the lock is still valid.\n */\nexport function isRetryableLockRenewalError(error: unknown): boolean {\n if (error instanceof PlatformRequestError) {\n if (error.retryable !== undefined) return error.retryable;\n return error.status >= 500 || error.status === 408 || error.status === 429;\n }\n // Timeouts, fetch network failures and malformed responses.\n return true;\n}\n\n/**\n * Keep a thread lock alive for a running agent.\n *\n * Renews every `intervalMs` (sooner if that would run past the lock's\n * lifetime), with at most one renewal in flight. A failed renewal is retried\n * with exponential backoff while the lock is still valid: the deadline is when\n * the last successful renewal was *sent* plus the `ttlSeconds` it returned,\n * because the platform starts the TTL when it handles the request (initially\n * start plus `initialTtlSeconds`, or `fallbackTtlSeconds` when the platform\n * reported no lifetime at acquisition). A non-retryable failure, or running\n * out of time before the deadline, calls `onLost`.\n * A `\"completed\"` response means the run already ended on the platform, so\n * the heartbeat stops without calling `onLost`.\n */\nexport function startThreadLockHeartbeat(\n options: ThreadLockHeartbeatOptions,\n): ThreadLockHeartbeat {\n const { renew, intervalMs, fallbackTtlSeconds, onLost } = options;\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const initialTtlSeconds =\n typeof options.initialTtlSeconds === \"number\" &&\n Number.isFinite(options.initialTtlSeconds)\n ? options.initialTtlSeconds\n : fallbackTtlSeconds;\n let deadline = Date.now() + initialTtlSeconds * 1_000;\n let failedAttempts = 0;\n\n const schedule = (delayMs: number): void => {\n timer = setTimeout(() => {\n timer = undefined;\n void attempt();\n }, delayMs);\n if (options.unref) timer.unref?.();\n };\n\n /** Time left before the safety cutoff ahead of the lock's expiry. */\n const remainingMs = (): number =>\n deadline - DEADLINE_SAFETY_MARGIN_MS - Date.now();\n\n // Renew on the interval, or right away when waiting that long would run\n // past the cutoff and leave the lock to lapse.\n const scheduleRenewal = (): void => {\n schedule(intervalMs < remainingMs() ? intervalMs : 0);\n };\n\n const stop = (): void => {\n stopped = true;\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const lose = (error: unknown): void => {\n stop();\n onLost(error);\n };\n\n const attempt = async (): Promise<void> => {\n // Bound each attempt by the lock's remaining lifetime so a hung request\n // cannot silently outlive the lock; past the cutoff, renewing is too late.\n const timeoutMs = Math.min(ATTEMPT_TIMEOUT_MS, remainingMs());\n if (timeoutMs <= 0) {\n lose(new Error(\"Thread lock expired before it could be renewed\"));\n return;\n }\n const sentAt = Date.now();\n const controller = new AbortController();\n let response: RenewThreadLockResponse;\n try {\n response = await withTimeout(\n renew(controller.signal),\n timeoutMs,\n options.unref,\n () => controller.abort(),\n );\n } catch (error) {\n if (!stopped) handleFailure(error);\n return;\n }\n if (stopped) return;\n\n failedAttempts = 0;\n if (response?.status === \"completed\") {\n stop();\n return;\n }\n const ttlSeconds =\n typeof response?.ttlSeconds === \"number\" && response.ttlSeconds > 0\n ? response.ttlSeconds\n : fallbackTtlSeconds;\n deadline = sentAt + ttlSeconds * 1_000;\n scheduleRenewal();\n };\n\n const handleFailure = (error: unknown): void => {\n if (!isRetryableLockRenewalError(error)) {\n lose(error);\n return;\n }\n const delayMs = Math.min(\n INITIAL_RETRY_DELAY_MS * 2 ** failedAttempts,\n MAX_RETRY_DELAY_MS,\n );\n failedAttempts += 1;\n const remaining = remainingMs();\n if (delayMs >= remaining) {\n lose(error);\n return;\n }\n logger.warn(\n {\n err: error,\n attempt: failedAttempts,\n retryInMs: delayMs,\n remainingMs: remaining,\n },\n \"Thread lock renewal failed; retrying before the lock expires\",\n );\n schedule(delayMs);\n };\n\n scheduleRenewal();\n return { stop };\n}\n\nfunction withTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n unref: boolean | undefined,\n onTimeout: () => void,\n): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timeout = setTimeout(() => {\n onTimeout();\n reject(new RenewalTimeoutError(timeoutMs));\n }, timeoutMs);\n if (unref) timeout.unref?.();\n promise.then(\n (value) => {\n clearTimeout(timeout);\n resolve(value);\n },\n (error: unknown) => {\n clearTimeout(timeout);\n reject(error);\n },\n );\n });\n}\n"],"mappings":";;;;;;AAKA,MAAM,yBAAyB;;AAE/B,MAAM,qBAAqB;;AAE3B,MAAM,qBAAqB;;AAE3B,MAAM,4BAA4B;AAuClC,IAAM,sBAAN,cAAkC,MAAM;CACtC,YAAY,WAAmB;AAC7B,QAAM,6CAA6C,UAAU,IAAI;AACjE,OAAK,OAAO;;;;;;;;AAShB,SAAgB,4BAA4B,OAAyB;AACnE,KAAI,iBAAiBA,qCAAsB;AACzC,MAAI,MAAM,cAAc,OAAW,QAAO,MAAM;AAChD,SAAO,MAAM,UAAU,OAAO,MAAM,WAAW,OAAO,MAAM,WAAW;;AAGzE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,yBACd,SACqB;CACrB,MAAM,EAAE,OAAO,YAAY,oBAAoB,WAAW;CAC1D,IAAI,UAAU;CACd,IAAI;CACJ,MAAM,oBACJ,OAAO,QAAQ,sBAAsB,YACrC,OAAO,SAAS,QAAQ,kBAAkB,GACtC,QAAQ,oBACR;CACN,IAAI,WAAW,KAAK,KAAK,GAAG,oBAAoB;CAChD,IAAI,iBAAiB;CAErB,MAAM,YAAY,YAA0B;AAC1C,UAAQ,iBAAiB;AACvB,WAAQ;AACR,GAAK,SAAS;KACb,QAAQ;AACX,MAAI,QAAQ,MAAO,OAAM,SAAS;;;CAIpC,MAAM,oBACJ,WAAW,4BAA4B,KAAK,KAAK;CAInD,MAAM,wBAA8B;AAClC,WAAS,aAAa,aAAa,GAAG,aAAa,EAAE;;CAGvD,MAAM,aAAmB;AACvB,YAAU;AACV,MAAI,UAAU,QAAW;AACvB,gBAAa,MAAM;AACnB,WAAQ;;;CAIZ,MAAM,QAAQ,UAAyB;AACrC,QAAM;AACN,SAAO,MAAM;;CAGf,MAAM,UAAU,YAA2B;EAGzC,MAAM,YAAY,KAAK,IAAI,oBAAoB,aAAa,CAAC;AAC7D,MAAI,aAAa,GAAG;AAClB,wBAAK,IAAI,MAAM,iDAAiD,CAAC;AACjE;;EAEF,MAAM,SAAS,KAAK,KAAK;EACzB,MAAM,aAAa,IAAI,iBAAiB;EACxC,IAAI;AACJ,MAAI;AACF,cAAW,MAAM,YACf,MAAM,WAAW,OAAO,EACxB,WACA,QAAQ,aACF,WAAW,OAAO,CACzB;WACM,OAAO;AACd,OAAI,CAAC,QAAS,eAAc,MAAM;AAClC;;AAEF,MAAI,QAAS;AAEb,mBAAiB;AACjB,MAAI,UAAU,WAAW,aAAa;AACpC,SAAM;AACN;;AAMF,aAAW,UAHT,OAAO,UAAU,eAAe,YAAY,SAAS,aAAa,IAC9D,SAAS,aACT,sBAC2B;AACjC,mBAAiB;;CAGnB,MAAM,iBAAiB,UAAyB;AAC9C,MAAI,CAAC,4BAA4B,MAAM,EAAE;AACvC,QAAK,MAAM;AACX;;EAEF,MAAM,UAAU,KAAK,IACnB,yBAAyB,KAAK,gBAC9B,mBACD;AACD,oBAAkB;EAClB,MAAM,YAAY,aAAa;AAC/B,MAAI,WAAW,WAAW;AACxB,QAAK,MAAM;AACX;;AAEF,4BAAO,KACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,aAAa;GACd,EACD,+DACD;AACD,WAAS,QAAQ;;AAGnB,kBAAiB;AACjB,QAAO,EAAE,MAAM;;AAGjB,SAAS,YACP,SACA,WACA,OACA,WACY;AACZ,QAAO,IAAI,SAAY,SAAS,WAAW;EACzC,MAAM,UAAU,iBAAiB;AAC/B,cAAW;AACX,UAAO,IAAI,oBAAoB,UAAU,CAAC;KACzC,UAAU;AACb,MAAI,MAAO,SAAQ,SAAS;AAC5B,UAAQ,MACL,UAAU;AACT,gBAAa,QAAQ;AACrB,WAAQ,MAAM;MAEf,UAAmB;AAClB,gBAAa,QAAQ;AACrB,UAAO,MAAM;IAEhB;GACD"}
@@ -0,0 +1,141 @@
1
+ import { PlatformRequestError } from "./client.mjs";
2
+ import { logger } from "@copilotkit/shared";
3
+
4
+ //#region src/runtime/intelligence-platform/thread-lock-heartbeat.ts
5
+ /** Delay before the first retry of a failed renewal; doubles per attempt. */
6
+ const INITIAL_RETRY_DELAY_MS = 1e3;
7
+ /** Upper bound for the delay between renewal retries. */
8
+ const MAX_RETRY_DELAY_MS = 8e3;
9
+ /** Longest a single renewal may stay in flight before it counts as failed. */
10
+ const ATTEMPT_TIMEOUT_MS = 1e4;
11
+ /** Stop retrying this long before the lock would expire. */
12
+ const DEADLINE_SAFETY_MARGIN_MS = 1e3;
13
+ var RenewalTimeoutError = class extends Error {
14
+ constructor(timeoutMs) {
15
+ super(`Thread lock renewal did not settle within ${timeoutMs}ms`);
16
+ this.name = "RenewalTimeoutError";
17
+ }
18
+ };
19
+ /**
20
+ * Whether a failed renewal may succeed if retried. A lost lock is a 409 the
21
+ * platform marks `retryable: false`; server failures (5xx), timeouts and
22
+ * network errors are worth retrying while the lock is still valid.
23
+ */
24
+ function isRetryableLockRenewalError(error) {
25
+ if (error instanceof PlatformRequestError) {
26
+ if (error.retryable !== void 0) return error.retryable;
27
+ return error.status >= 500 || error.status === 408 || error.status === 429;
28
+ }
29
+ return true;
30
+ }
31
+ /**
32
+ * Keep a thread lock alive for a running agent.
33
+ *
34
+ * Renews every `intervalMs` (sooner if that would run past the lock's
35
+ * lifetime), with at most one renewal in flight. A failed renewal is retried
36
+ * with exponential backoff while the lock is still valid: the deadline is when
37
+ * the last successful renewal was *sent* plus the `ttlSeconds` it returned,
38
+ * because the platform starts the TTL when it handles the request (initially
39
+ * start plus `initialTtlSeconds`, or `fallbackTtlSeconds` when the platform
40
+ * reported no lifetime at acquisition). A non-retryable failure, or running
41
+ * out of time before the deadline, calls `onLost`.
42
+ * A `"completed"` response means the run already ended on the platform, so
43
+ * the heartbeat stops without calling `onLost`.
44
+ */
45
+ function startThreadLockHeartbeat(options) {
46
+ const { renew, intervalMs, fallbackTtlSeconds, onLost } = options;
47
+ let stopped = false;
48
+ let timer;
49
+ const initialTtlSeconds = typeof options.initialTtlSeconds === "number" && Number.isFinite(options.initialTtlSeconds) ? options.initialTtlSeconds : fallbackTtlSeconds;
50
+ let deadline = Date.now() + initialTtlSeconds * 1e3;
51
+ let failedAttempts = 0;
52
+ const schedule = (delayMs) => {
53
+ timer = setTimeout(() => {
54
+ timer = void 0;
55
+ attempt();
56
+ }, delayMs);
57
+ if (options.unref) timer.unref?.();
58
+ };
59
+ /** Time left before the safety cutoff ahead of the lock's expiry. */
60
+ const remainingMs = () => deadline - DEADLINE_SAFETY_MARGIN_MS - Date.now();
61
+ const scheduleRenewal = () => {
62
+ schedule(intervalMs < remainingMs() ? intervalMs : 0);
63
+ };
64
+ const stop = () => {
65
+ stopped = true;
66
+ if (timer !== void 0) {
67
+ clearTimeout(timer);
68
+ timer = void 0;
69
+ }
70
+ };
71
+ const lose = (error) => {
72
+ stop();
73
+ onLost(error);
74
+ };
75
+ const attempt = async () => {
76
+ const timeoutMs = Math.min(ATTEMPT_TIMEOUT_MS, remainingMs());
77
+ if (timeoutMs <= 0) {
78
+ lose(/* @__PURE__ */ new Error("Thread lock expired before it could be renewed"));
79
+ return;
80
+ }
81
+ const sentAt = Date.now();
82
+ const controller = new AbortController();
83
+ let response;
84
+ try {
85
+ response = await withTimeout(renew(controller.signal), timeoutMs, options.unref, () => controller.abort());
86
+ } catch (error) {
87
+ if (!stopped) handleFailure(error);
88
+ return;
89
+ }
90
+ if (stopped) return;
91
+ failedAttempts = 0;
92
+ if (response?.status === "completed") {
93
+ stop();
94
+ return;
95
+ }
96
+ deadline = sentAt + (typeof response?.ttlSeconds === "number" && response.ttlSeconds > 0 ? response.ttlSeconds : fallbackTtlSeconds) * 1e3;
97
+ scheduleRenewal();
98
+ };
99
+ const handleFailure = (error) => {
100
+ if (!isRetryableLockRenewalError(error)) {
101
+ lose(error);
102
+ return;
103
+ }
104
+ const delayMs = Math.min(INITIAL_RETRY_DELAY_MS * 2 ** failedAttempts, MAX_RETRY_DELAY_MS);
105
+ failedAttempts += 1;
106
+ const remaining = remainingMs();
107
+ if (delayMs >= remaining) {
108
+ lose(error);
109
+ return;
110
+ }
111
+ logger.warn({
112
+ err: error,
113
+ attempt: failedAttempts,
114
+ retryInMs: delayMs,
115
+ remainingMs: remaining
116
+ }, "Thread lock renewal failed; retrying before the lock expires");
117
+ schedule(delayMs);
118
+ };
119
+ scheduleRenewal();
120
+ return { stop };
121
+ }
122
+ function withTimeout(promise, timeoutMs, unref, onTimeout) {
123
+ return new Promise((resolve, reject) => {
124
+ const timeout = setTimeout(() => {
125
+ onTimeout();
126
+ reject(new RenewalTimeoutError(timeoutMs));
127
+ }, timeoutMs);
128
+ if (unref) timeout.unref?.();
129
+ promise.then((value) => {
130
+ clearTimeout(timeout);
131
+ resolve(value);
132
+ }, (error) => {
133
+ clearTimeout(timeout);
134
+ reject(error);
135
+ });
136
+ });
137
+ }
138
+
139
+ //#endregion
140
+ export { startThreadLockHeartbeat };
141
+ //# sourceMappingURL=thread-lock-heartbeat.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-lock-heartbeat.mjs","names":[],"sources":["../../../src/runtime/intelligence-platform/thread-lock-heartbeat.ts"],"sourcesContent":["import { logger } from \"@copilotkit/shared\";\nimport { PlatformRequestError } from \"./client\";\nimport type { RenewThreadLockResponse } from \"./client\";\n\n/** Delay before the first retry of a failed renewal; doubles per attempt. */\nconst INITIAL_RETRY_DELAY_MS = 1_000;\n/** Upper bound for the delay between renewal retries. */\nconst MAX_RETRY_DELAY_MS = 8_000;\n/** Longest a single renewal may stay in flight before it counts as failed. */\nconst ATTEMPT_TIMEOUT_MS = 10_000;\n/** Stop retrying this long before the lock would expire. */\nconst DEADLINE_SAFETY_MARGIN_MS = 1_000;\n\nexport interface ThreadLockHeartbeatOptions {\n /**\n * Sends one renewal request. The signal aborts when the attempt times out,\n * so an abandoned request never overlaps its retry.\n */\n renew: (signal: AbortSignal) => Promise<RenewThreadLockResponse>;\n /** Delay between successful renewals. */\n intervalMs: number;\n /**\n * Lock lifetime assumed when the platform has not reported one: until the\n * first successful renewal when {@link initialTtlSeconds} is absent, and\n * for renewal responses that omit `ttlSeconds`.\n */\n fallbackTtlSeconds: number;\n /**\n * Remaining lock lifetime when the heartbeat starts, as reported by the\n * platform at acquisition, measured from when the acquire request was sent.\n * Used until the first successful renewal; when absent,\n * {@link fallbackTtlSeconds} applies instead. A value of zero or less means\n * the lock has already expired.\n */\n initialTtlSeconds?: number;\n /**\n * Called once when the lock can no longer be kept: a non-retryable failure,\n * or retryable failures that ran out the lock's remaining lifetime. Never\n * called after {@link ThreadLockHeartbeat.stop}.\n */\n onLost: (error: unknown) => void;\n /** Unref timers so a pending heartbeat never keeps the process alive. */\n unref?: boolean;\n}\n\nexport interface ThreadLockHeartbeat {\n /** Cancel the next renewal and any pending retry. Idempotent. */\n stop(): void;\n}\n\nclass RenewalTimeoutError extends Error {\n constructor(timeoutMs: number) {\n super(`Thread lock renewal did not settle within ${timeoutMs}ms`);\n this.name = \"RenewalTimeoutError\";\n }\n}\n\n/**\n * Whether a failed renewal may succeed if retried. A lost lock is a 409 the\n * platform marks `retryable: false`; server failures (5xx), timeouts and\n * network errors are worth retrying while the lock is still valid.\n */\nexport function isRetryableLockRenewalError(error: unknown): boolean {\n if (error instanceof PlatformRequestError) {\n if (error.retryable !== undefined) return error.retryable;\n return error.status >= 500 || error.status === 408 || error.status === 429;\n }\n // Timeouts, fetch network failures and malformed responses.\n return true;\n}\n\n/**\n * Keep a thread lock alive for a running agent.\n *\n * Renews every `intervalMs` (sooner if that would run past the lock's\n * lifetime), with at most one renewal in flight. A failed renewal is retried\n * with exponential backoff while the lock is still valid: the deadline is when\n * the last successful renewal was *sent* plus the `ttlSeconds` it returned,\n * because the platform starts the TTL when it handles the request (initially\n * start plus `initialTtlSeconds`, or `fallbackTtlSeconds` when the platform\n * reported no lifetime at acquisition). A non-retryable failure, or running\n * out of time before the deadline, calls `onLost`.\n * A `\"completed\"` response means the run already ended on the platform, so\n * the heartbeat stops without calling `onLost`.\n */\nexport function startThreadLockHeartbeat(\n options: ThreadLockHeartbeatOptions,\n): ThreadLockHeartbeat {\n const { renew, intervalMs, fallbackTtlSeconds, onLost } = options;\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const initialTtlSeconds =\n typeof options.initialTtlSeconds === \"number\" &&\n Number.isFinite(options.initialTtlSeconds)\n ? options.initialTtlSeconds\n : fallbackTtlSeconds;\n let deadline = Date.now() + initialTtlSeconds * 1_000;\n let failedAttempts = 0;\n\n const schedule = (delayMs: number): void => {\n timer = setTimeout(() => {\n timer = undefined;\n void attempt();\n }, delayMs);\n if (options.unref) timer.unref?.();\n };\n\n /** Time left before the safety cutoff ahead of the lock's expiry. */\n const remainingMs = (): number =>\n deadline - DEADLINE_SAFETY_MARGIN_MS - Date.now();\n\n // Renew on the interval, or right away when waiting that long would run\n // past the cutoff and leave the lock to lapse.\n const scheduleRenewal = (): void => {\n schedule(intervalMs < remainingMs() ? intervalMs : 0);\n };\n\n const stop = (): void => {\n stopped = true;\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n const lose = (error: unknown): void => {\n stop();\n onLost(error);\n };\n\n const attempt = async (): Promise<void> => {\n // Bound each attempt by the lock's remaining lifetime so a hung request\n // cannot silently outlive the lock; past the cutoff, renewing is too late.\n const timeoutMs = Math.min(ATTEMPT_TIMEOUT_MS, remainingMs());\n if (timeoutMs <= 0) {\n lose(new Error(\"Thread lock expired before it could be renewed\"));\n return;\n }\n const sentAt = Date.now();\n const controller = new AbortController();\n let response: RenewThreadLockResponse;\n try {\n response = await withTimeout(\n renew(controller.signal),\n timeoutMs,\n options.unref,\n () => controller.abort(),\n );\n } catch (error) {\n if (!stopped) handleFailure(error);\n return;\n }\n if (stopped) return;\n\n failedAttempts = 0;\n if (response?.status === \"completed\") {\n stop();\n return;\n }\n const ttlSeconds =\n typeof response?.ttlSeconds === \"number\" && response.ttlSeconds > 0\n ? response.ttlSeconds\n : fallbackTtlSeconds;\n deadline = sentAt + ttlSeconds * 1_000;\n scheduleRenewal();\n };\n\n const handleFailure = (error: unknown): void => {\n if (!isRetryableLockRenewalError(error)) {\n lose(error);\n return;\n }\n const delayMs = Math.min(\n INITIAL_RETRY_DELAY_MS * 2 ** failedAttempts,\n MAX_RETRY_DELAY_MS,\n );\n failedAttempts += 1;\n const remaining = remainingMs();\n if (delayMs >= remaining) {\n lose(error);\n return;\n }\n logger.warn(\n {\n err: error,\n attempt: failedAttempts,\n retryInMs: delayMs,\n remainingMs: remaining,\n },\n \"Thread lock renewal failed; retrying before the lock expires\",\n );\n schedule(delayMs);\n };\n\n scheduleRenewal();\n return { stop };\n}\n\nfunction withTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n unref: boolean | undefined,\n onTimeout: () => void,\n): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timeout = setTimeout(() => {\n onTimeout();\n reject(new RenewalTimeoutError(timeoutMs));\n }, timeoutMs);\n if (unref) timeout.unref?.();\n promise.then(\n (value) => {\n clearTimeout(timeout);\n resolve(value);\n },\n (error: unknown) => {\n clearTimeout(timeout);\n reject(error);\n },\n );\n });\n}\n"],"mappings":";;;;;AAKA,MAAM,yBAAyB;;AAE/B,MAAM,qBAAqB;;AAE3B,MAAM,qBAAqB;;AAE3B,MAAM,4BAA4B;AAuClC,IAAM,sBAAN,cAAkC,MAAM;CACtC,YAAY,WAAmB;AAC7B,QAAM,6CAA6C,UAAU,IAAI;AACjE,OAAK,OAAO;;;;;;;;AAShB,SAAgB,4BAA4B,OAAyB;AACnE,KAAI,iBAAiB,sBAAsB;AACzC,MAAI,MAAM,cAAc,OAAW,QAAO,MAAM;AAChD,SAAO,MAAM,UAAU,OAAO,MAAM,WAAW,OAAO,MAAM,WAAW;;AAGzE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,yBACd,SACqB;CACrB,MAAM,EAAE,OAAO,YAAY,oBAAoB,WAAW;CAC1D,IAAI,UAAU;CACd,IAAI;CACJ,MAAM,oBACJ,OAAO,QAAQ,sBAAsB,YACrC,OAAO,SAAS,QAAQ,kBAAkB,GACtC,QAAQ,oBACR;CACN,IAAI,WAAW,KAAK,KAAK,GAAG,oBAAoB;CAChD,IAAI,iBAAiB;CAErB,MAAM,YAAY,YAA0B;AAC1C,UAAQ,iBAAiB;AACvB,WAAQ;AACR,GAAK,SAAS;KACb,QAAQ;AACX,MAAI,QAAQ,MAAO,OAAM,SAAS;;;CAIpC,MAAM,oBACJ,WAAW,4BAA4B,KAAK,KAAK;CAInD,MAAM,wBAA8B;AAClC,WAAS,aAAa,aAAa,GAAG,aAAa,EAAE;;CAGvD,MAAM,aAAmB;AACvB,YAAU;AACV,MAAI,UAAU,QAAW;AACvB,gBAAa,MAAM;AACnB,WAAQ;;;CAIZ,MAAM,QAAQ,UAAyB;AACrC,QAAM;AACN,SAAO,MAAM;;CAGf,MAAM,UAAU,YAA2B;EAGzC,MAAM,YAAY,KAAK,IAAI,oBAAoB,aAAa,CAAC;AAC7D,MAAI,aAAa,GAAG;AAClB,wBAAK,IAAI,MAAM,iDAAiD,CAAC;AACjE;;EAEF,MAAM,SAAS,KAAK,KAAK;EACzB,MAAM,aAAa,IAAI,iBAAiB;EACxC,IAAI;AACJ,MAAI;AACF,cAAW,MAAM,YACf,MAAM,WAAW,OAAO,EACxB,WACA,QAAQ,aACF,WAAW,OAAO,CACzB;WACM,OAAO;AACd,OAAI,CAAC,QAAS,eAAc,MAAM;AAClC;;AAEF,MAAI,QAAS;AAEb,mBAAiB;AACjB,MAAI,UAAU,WAAW,aAAa;AACpC,SAAM;AACN;;AAMF,aAAW,UAHT,OAAO,UAAU,eAAe,YAAY,SAAS,aAAa,IAC9D,SAAS,aACT,sBAC2B;AACjC,mBAAiB;;CAGnB,MAAM,iBAAiB,UAAyB;AAC9C,MAAI,CAAC,4BAA4B,MAAM,EAAE;AACvC,QAAK,MAAM;AACX;;EAEF,MAAM,UAAU,KAAK,IACnB,yBAAyB,KAAK,gBAC9B,mBACD;AACD,oBAAkB;EAClB,MAAM,YAAY,aAAa;AAC/B,MAAI,WAAW,WAAW;AACxB,QAAK,MAAM;AACX;;AAEF,SAAO,KACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,aAAa;GACd,EACD,+DACD;AACD,WAAS,QAAQ;;AAGnB,kBAAiB;AACjB,QAAO,EAAE,MAAM;;AAGjB,SAAS,YACP,SACA,WACA,OACA,WACY;AACZ,QAAO,IAAI,SAAY,SAAS,WAAW;EACzC,MAAM,UAAU,iBAAiB;AAC/B,cAAW;AACX,UAAO,IAAI,oBAAoB,UAAU,CAAC;KACzC,UAAU;AACb,MAAI,MAAO,SAAQ,SAAS;AAC5B,UAAQ,MACL,UAAU;AACT,gBAAa,QAAQ;AACrB,WAAQ,MAAM;MAEf,UAAmB;AAClB,gBAAa,QAAQ;AACrB,UAAO,MAAM;IAEhB;GACD"}
@@ -0,0 +1,95 @@
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
+ let _copilotkit_shared = require("@copilotkit/shared");
3
+ let zod = require("zod");
4
+
5
+ //#region src/runtime/intelligence-platform/trajectories.ts
6
+ const trajectoryIdSchema = zod.z.string().uuid();
7
+ function isValidTrajectoryId(value) {
8
+ return trajectoryIdSchema.safeParse(value).success;
9
+ }
10
+ const joinResponseSchema = zod.z.object({
11
+ joinToken: zod.z.string().refine((value) => value.trim().length > 0),
12
+ trajectoryId: trajectoryIdSchema
13
+ });
14
+ const grantSchema = zod.z.object({
15
+ joinToken: zod.z.string().refine((value) => value.trim().length > 0),
16
+ realtime: zod.z.object({
17
+ clientUrl: zod.z.string().url().refine((value) => {
18
+ const url = new URL(value);
19
+ return (url.protocol === "wss:" || url.protocol === "ws:") && !url.username && !url.password;
20
+ }),
21
+ topic: zod.z.string().refine((value) => value.trim().length > 0 && !/\p{Cc}/u.test(value))
22
+ })
23
+ });
24
+ const runtimeConfigurationErrorSchema = zod.z.object({ error: zod.z.object({ code: zod.z.enum([
25
+ "AUTH_UNAUTHENTICATED",
26
+ "API_KEY_NOT_FOUND",
27
+ "ORG_NOT_FOUND",
28
+ "PROJECT_NOT_FOUND"
29
+ ]) }) });
30
+ const contractErrorSchema = zod.z.object({ error: zod.z.object({
31
+ code: zod.z.enum([
32
+ "VALIDATION_ERROR",
33
+ "TRAJECTORY_APP_USER_CONFLICT",
34
+ "LEARNING_CONTAINER_NOT_FOUND",
35
+ "RATE_LIMIT_EXCEEDED",
36
+ "INTERNAL_SERVER_ERROR",
37
+ "MARKETPLACE_LICENSE_REQUIRED",
38
+ "TRAJECTORIES_NOT_ENABLED"
39
+ ]),
40
+ message: zod.z.string().trim().min(1).max(512)
41
+ }) });
42
+ var TrajectoryConnectionError = class extends Error {
43
+ constructor(code, message, status) {
44
+ super(message);
45
+ this.code = code;
46
+ this.status = status;
47
+ this.name = "TrajectoryConnectionError";
48
+ }
49
+ };
50
+ function parseTrajectoryConnectionGrant(value, trajectoryId, clientUrl) {
51
+ const join = joinResponseSchema.safeParse(value);
52
+ const result = grantSchema.safeParse(join.success && join.data.trajectoryId === trajectoryId ? {
53
+ joinToken: join.data.joinToken,
54
+ realtime: {
55
+ clientUrl,
56
+ topic: `trajectory:${trajectoryId}`
57
+ }
58
+ } : void 0);
59
+ if (!result.success) {
60
+ const joinValid = join.success && join.data.trajectoryId === trajectoryId;
61
+ _copilotkit_shared.logger.warn({ trajectoryIdMatches: joinValid }, joinValid ? "Intelligence returned a Trajectory join token, but the Gateway URL is invalid; check the Intelligence wsUrl" : "Intelligence returned an invalid Trajectory join response");
62
+ throw new TrajectoryConnectionError("CONNECTION_FAILED", "Intelligence returned an invalid trajectory connection grant", 502);
63
+ }
64
+ return {
65
+ joinToken: result.data.joinToken,
66
+ realtime: {
67
+ clientUrl: result.data.realtime.clientUrl,
68
+ topic: result.data.realtime.topic
69
+ }
70
+ };
71
+ }
72
+ const routeNotFoundSchema = zod.z.object({ error: zod.z.object({ code: zod.z.literal("ROUTE_NOT_FOUND") }) });
73
+ const upstreamCodeSchema = zod.z.object({ error: zod.z.object({ code: zod.z.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/) }) });
74
+ /** Forward only the public contract, never raw platform errors or credentials. */
75
+ function trajectoryResponseError(value, status, apiKey) {
76
+ const result = contractErrorSchema.safeParse(value);
77
+ if (result.success && !result.data.error.message.includes(apiKey)) return new TrajectoryConnectionError(result.data.error.code, result.data.error.message, status);
78
+ if (status === 404 && routeNotFoundSchema.safeParse(value).success) {
79
+ _copilotkit_shared.logger.warn({ status }, "Intelligence does not serve Trajectory capture; enable Trajectories for this deployment");
80
+ return new TrajectoryConnectionError("TRAJECTORIES_UNAVAILABLE", "This Intelligence deployment does not serve Trajectory capture", 404);
81
+ }
82
+ _copilotkit_shared.logger.warn({
83
+ status,
84
+ upstreamCode: upstreamCodeSchema.safeParse(value).data?.error.code
85
+ }, "Intelligence rejected the Trajectory connection request; the browser receives CONNECTION_FAILED");
86
+ if (runtimeConfigurationErrorSchema.safeParse(value).success) return new TrajectoryConnectionError("CONNECTION_FAILED", "Could not connect to Intelligence", 502);
87
+ return new TrajectoryConnectionError("CONNECTION_FAILED", "Intelligence rejected the trajectory connection request", status);
88
+ }
89
+
90
+ //#endregion
91
+ exports.TrajectoryConnectionError = TrajectoryConnectionError;
92
+ exports.isValidTrajectoryId = isValidTrajectoryId;
93
+ exports.parseTrajectoryConnectionGrant = parseTrajectoryConnectionGrant;
94
+ exports.trajectoryResponseError = trajectoryResponseError;
95
+ //# sourceMappingURL=trajectories.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectories.cjs","names":["z"],"sources":["../../../src/runtime/intelligence-platform/trajectories.ts"],"sourcesContent":["import { logger } from \"@copilotkit/shared\";\nimport { z } from \"zod\";\n\nexport interface TrajectoryConnectionGrant {\n joinToken: string;\n realtime: { clientUrl: string; topic: string };\n}\n\nconst trajectoryIdSchema = z.string().uuid();\n\nexport function isValidTrajectoryId(value: unknown): value is string {\n return trajectoryIdSchema.safeParse(value).success;\n}\n\nconst joinResponseSchema = z.object({\n joinToken: z.string().refine((value) => value.trim().length > 0),\n trajectoryId: trajectoryIdSchema,\n});\n\nconst grantSchema = z.object({\n joinToken: z.string().refine((value) => value.trim().length > 0),\n realtime: z.object({\n clientUrl: z\n .string()\n .url()\n .refine((value) => {\n const url = new URL(value);\n return (\n (url.protocol === \"wss:\" || url.protocol === \"ws:\") &&\n !url.username &&\n !url.password\n );\n }),\n topic: z\n .string()\n .refine((value) => value.trim().length > 0 && !/\\p{Cc}/u.test(value)),\n }),\n});\n\nconst runtimeConfigurationErrorSchema = z.object({\n error: z.object({\n code: z.enum([\n \"AUTH_UNAUTHENTICATED\",\n \"API_KEY_NOT_FOUND\",\n \"ORG_NOT_FOUND\",\n \"PROJECT_NOT_FOUND\",\n ]),\n }),\n});\n\nconst contractErrorSchema = z.object({\n error: z.object({\n code: z.enum([\n \"VALIDATION_ERROR\",\n \"TRAJECTORY_APP_USER_CONFLICT\",\n \"LEARNING_CONTAINER_NOT_FOUND\",\n \"RATE_LIMIT_EXCEEDED\",\n \"INTERNAL_SERVER_ERROR\",\n \"MARKETPLACE_LICENSE_REQUIRED\",\n \"TRAJECTORIES_NOT_ENABLED\",\n ]),\n message: z.string().trim().min(1).max(512),\n }),\n});\n\nexport class TrajectoryConnectionError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status: number,\n ) {\n super(message);\n this.name = \"TrajectoryConnectionError\";\n }\n}\n\nexport function parseTrajectoryConnectionGrant(\n value: unknown,\n trajectoryId: string,\n clientUrl: string,\n): TrajectoryConnectionGrant {\n const join = joinResponseSchema.safeParse(value);\n const result = grantSchema.safeParse(\n join.success && join.data.trajectoryId === trajectoryId\n ? {\n joinToken: join.data.joinToken,\n realtime: { clientUrl, topic: `trajectory:${trajectoryId}` },\n }\n : undefined,\n );\n if (!result.success) {\n const joinValid = join.success && join.data.trajectoryId === trajectoryId;\n logger.warn(\n { trajectoryIdMatches: joinValid },\n joinValid\n ? \"Intelligence returned a Trajectory join token, but the Gateway URL is invalid; check the Intelligence wsUrl\"\n : \"Intelligence returned an invalid Trajectory join response\",\n );\n throw new TrajectoryConnectionError(\n \"CONNECTION_FAILED\",\n \"Intelligence returned an invalid trajectory connection grant\",\n 502,\n );\n }\n return {\n joinToken: result.data.joinToken,\n realtime: {\n clientUrl: result.data.realtime.clientUrl,\n topic: result.data.realtime.topic,\n },\n };\n}\n\n// Intelligence answers with this code when Trajectory capture is switched off\n// for the deployment, because the join route is then not registered.\nconst routeNotFoundSchema = z.object({\n error: z.object({ code: z.literal(\"ROUTE_NOT_FOUND\") }),\n});\n\nconst upstreamCodeSchema = z.object({\n error: z.object({ code: z.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/) }),\n});\n\n/** Forward only the public contract, never raw platform errors or credentials. */\nexport function trajectoryResponseError(\n value: unknown,\n status: number,\n apiKey: string,\n): TrajectoryConnectionError {\n const result = contractErrorSchema.safeParse(value);\n if (result.success && !result.data.error.message.includes(apiKey)) {\n return new TrajectoryConnectionError(\n result.data.error.code,\n result.data.error.message,\n status,\n );\n }\n if (status === 404 && routeNotFoundSchema.safeParse(value).success) {\n logger.warn(\n { status },\n \"Intelligence does not serve Trajectory capture; enable Trajectories for this deployment\",\n );\n return new TrajectoryConnectionError(\n \"TRAJECTORIES_UNAVAILABLE\",\n \"This Intelligence deployment does not serve Trajectory capture\",\n 404,\n );\n }\n // The browser only learns that the connection failed. Log the upstream code,\n // never the message, so the cause is visible to the Runtime's operator.\n logger.warn(\n {\n status,\n upstreamCode: upstreamCodeSchema.safeParse(value).data?.error.code,\n },\n \"Intelligence rejected the Trajectory connection request; the browser receives CONNECTION_FAILED\",\n );\n // These failures describe the Runtime's server credentials or tenant setup,\n // not the browser user's identity. Do not expose them as a client auth error.\n if (runtimeConfigurationErrorSchema.safeParse(value).success) {\n return new TrajectoryConnectionError(\n \"CONNECTION_FAILED\",\n \"Could not connect to Intelligence\",\n 502,\n );\n }\n return new TrajectoryConnectionError(\n \"CONNECTION_FAILED\",\n \"Intelligence rejected the trajectory connection request\",\n status,\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ //#region src/runtime/intelligence-platform/trajectories.d.ts
2
+ interface TrajectoryConnectionGrant {
3
+ joinToken: string;
4
+ realtime: {
5
+ clientUrl: string;
6
+ topic: string;
7
+ };
8
+ }
9
+ //#endregion
10
+ export { TrajectoryConnectionGrant };
11
+ //# sourceMappingURL=trajectories.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectories.d.cts","names":[],"sources":["../../../src/runtime/intelligence-platform/trajectories.ts"],"mappings":";UAGiB,yBAAA;EACf,SAAA;EACA,QAAA;IAAY,SAAA;IAAmB,KAAA;EAAA;AAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/runtime/intelligence-platform/trajectories.d.ts
2
+ interface TrajectoryConnectionGrant {
3
+ joinToken: string;
4
+ realtime: {
5
+ clientUrl: string;
6
+ topic: string;
7
+ };
8
+ }
9
+ //#endregion
10
+ export { TrajectoryConnectionGrant };
11
+ //# sourceMappingURL=trajectories.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectories.d.mts","names":[],"sources":["../../../src/runtime/intelligence-platform/trajectories.ts"],"mappings":";UAGiB,yBAAA;EACf,SAAA;EACA,QAAA;IAAY,SAAA;IAAmB,KAAA;EAAA;AAAA"}