@copilotkit/runtime 1.55.0-next.8 → 1.55.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 (345) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/agent/index.cjs +101 -12
  3. package/dist/agent/index.cjs.map +1 -1
  4. package/dist/agent/index.d.cts.map +1 -1
  5. package/dist/agent/index.d.mts.map +1 -1
  6. package/dist/agent/index.mjs +102 -13
  7. package/dist/agent/index.mjs.map +1 -1
  8. package/dist/lib/runtime/agent-integrations/langgraph/agent.cjs.map +1 -1
  9. package/dist/lib/runtime/agent-integrations/langgraph/agent.d.cts +4 -841
  10. package/dist/lib/runtime/agent-integrations/langgraph/agent.d.cts.map +1 -1
  11. package/dist/lib/runtime/agent-integrations/langgraph/agent.d.mts +4 -841
  12. package/dist/lib/runtime/agent-integrations/langgraph/agent.d.mts.map +1 -1
  13. package/dist/lib/runtime/agent-integrations/langgraph/agent.mjs.map +1 -1
  14. package/dist/lib/runtime/copilot-runtime.cjs +3 -2
  15. package/dist/lib/runtime/copilot-runtime.cjs.map +1 -1
  16. package/dist/lib/runtime/copilot-runtime.d.cts +1 -1
  17. package/dist/lib/runtime/copilot-runtime.d.cts.map +1 -1
  18. package/dist/lib/runtime/copilot-runtime.d.mts +3 -3
  19. package/dist/lib/runtime/copilot-runtime.d.mts.map +1 -1
  20. package/dist/lib/runtime/copilot-runtime.mjs +3 -2
  21. package/dist/lib/runtime/copilot-runtime.mjs.map +1 -1
  22. package/dist/package.cjs +70 -47
  23. package/dist/package.mjs +70 -47
  24. package/dist/v2/express.cjs +8 -0
  25. package/dist/v2/express.d.cts +5 -0
  26. package/dist/v2/express.d.mts +5 -0
  27. package/dist/v2/express.mjs +5 -0
  28. package/dist/v2/hono.cjs +9 -0
  29. package/dist/v2/hono.d.cts +5 -0
  30. package/dist/v2/hono.d.mts +5 -0
  31. package/dist/v2/hono.mjs +5 -0
  32. package/dist/v2/index.cjs +8 -3
  33. package/dist/v2/index.d.cts +8 -5
  34. package/dist/v2/index.d.mts +8 -5
  35. package/dist/v2/index.mjs +5 -4
  36. package/dist/v2/node.cjs +8 -0
  37. package/dist/v2/node.d.cts +5 -0
  38. package/dist/v2/node.d.mts +5 -0
  39. package/dist/v2/node.mjs +5 -0
  40. package/dist/v2/runtime/core/fetch-cors.cjs +72 -0
  41. package/dist/v2/runtime/core/fetch-cors.cjs.map +1 -0
  42. package/dist/v2/runtime/core/fetch-cors.d.cts +20 -0
  43. package/dist/v2/runtime/core/fetch-cors.d.cts.map +1 -0
  44. package/dist/v2/runtime/core/fetch-cors.d.mts +20 -0
  45. package/dist/v2/runtime/core/fetch-cors.d.mts.map +1 -0
  46. package/dist/v2/runtime/core/fetch-cors.mjs +70 -0
  47. package/dist/v2/runtime/core/fetch-cors.mjs.map +1 -0
  48. package/dist/v2/runtime/core/fetch-handler.cjs +232 -0
  49. package/dist/v2/runtime/core/fetch-handler.cjs.map +1 -0
  50. package/dist/v2/runtime/core/fetch-handler.d.cts +40 -0
  51. package/dist/v2/runtime/core/fetch-handler.d.cts.map +1 -0
  52. package/dist/v2/runtime/core/fetch-handler.d.mts +40 -0
  53. package/dist/v2/runtime/core/fetch-handler.d.mts.map +1 -0
  54. package/dist/v2/runtime/core/fetch-handler.mjs +231 -0
  55. package/dist/v2/runtime/core/fetch-handler.mjs.map +1 -0
  56. package/dist/v2/runtime/core/fetch-router.cjs +68 -0
  57. package/dist/v2/runtime/core/fetch-router.cjs.map +1 -0
  58. package/dist/v2/runtime/core/fetch-router.mjs +67 -0
  59. package/dist/v2/runtime/core/fetch-router.mjs.map +1 -0
  60. package/dist/v2/runtime/core/hooks.cjs +29 -0
  61. package/dist/v2/runtime/core/hooks.cjs.map +1 -0
  62. package/dist/v2/runtime/core/hooks.d.cts +78 -0
  63. package/dist/v2/runtime/core/hooks.d.cts.map +1 -0
  64. package/dist/v2/runtime/core/hooks.d.mts +78 -0
  65. package/dist/v2/runtime/core/hooks.d.mts.map +1 -0
  66. package/dist/v2/runtime/core/hooks.mjs +25 -0
  67. package/dist/v2/runtime/core/hooks.mjs.map +1 -0
  68. package/dist/v2/runtime/{middleware-sse-parser.cjs → core/middleware-sse-parser.cjs} +2 -2
  69. package/dist/v2/runtime/core/middleware-sse-parser.cjs.map +1 -0
  70. package/dist/v2/runtime/{middleware-sse-parser.d.cts → core/middleware-sse-parser.d.cts} +1 -1
  71. package/dist/v2/runtime/core/middleware-sse-parser.d.cts.map +1 -0
  72. package/dist/v2/runtime/{middleware-sse-parser.d.mts → core/middleware-sse-parser.d.mts} +1 -1
  73. package/dist/v2/runtime/core/middleware-sse-parser.d.mts.map +1 -0
  74. package/dist/v2/runtime/{middleware-sse-parser.mjs → core/middleware-sse-parser.mjs} +1 -1
  75. package/dist/v2/runtime/core/middleware-sse-parser.mjs.map +1 -0
  76. package/dist/v2/runtime/{middleware.cjs → core/middleware.cjs} +2 -2
  77. package/dist/v2/runtime/core/middleware.cjs.map +1 -0
  78. package/dist/v2/runtime/{middleware.d.cts → core/middleware.d.cts} +1 -1
  79. package/dist/v2/runtime/core/middleware.d.cts.map +1 -0
  80. package/dist/v2/runtime/{middleware.d.mts → core/middleware.d.mts} +1 -1
  81. package/dist/v2/runtime/core/middleware.d.mts.map +1 -0
  82. package/dist/v2/runtime/{middleware.mjs → core/middleware.mjs} +1 -1
  83. package/dist/v2/runtime/core/middleware.mjs.map +1 -0
  84. package/dist/v2/runtime/{runtime.cjs → core/runtime.cjs} +35 -10
  85. package/dist/v2/runtime/core/runtime.cjs.map +1 -0
  86. package/dist/v2/runtime/{runtime.d.cts → core/runtime.d.cts} +41 -7
  87. package/dist/v2/runtime/core/runtime.d.cts.map +1 -0
  88. package/dist/v2/runtime/{runtime.d.mts → core/runtime.d.mts} +42 -8
  89. package/dist/v2/runtime/core/runtime.d.mts.map +1 -0
  90. package/dist/v2/runtime/{runtime.mjs → core/runtime.mjs} +36 -11
  91. package/dist/v2/runtime/core/runtime.mjs.map +1 -0
  92. package/dist/v2/runtime/endpoints/express-fetch-bridge.cjs +83 -0
  93. package/dist/v2/runtime/endpoints/express-fetch-bridge.cjs.map +1 -0
  94. package/dist/v2/runtime/endpoints/express-fetch-bridge.mjs +82 -0
  95. package/dist/v2/runtime/endpoints/express-fetch-bridge.mjs.map +1 -0
  96. package/dist/v2/runtime/endpoints/express-single.cjs +35 -181
  97. package/dist/v2/runtime/endpoints/express-single.cjs.map +1 -1
  98. package/dist/v2/runtime/endpoints/express-single.d.cts +35 -2
  99. package/dist/v2/runtime/endpoints/express-single.d.cts.map +1 -1
  100. package/dist/v2/runtime/endpoints/express-single.d.mts +35 -2
  101. package/dist/v2/runtime/endpoints/express-single.d.mts.map +1 -1
  102. package/dist/v2/runtime/endpoints/express-single.mjs +35 -178
  103. package/dist/v2/runtime/endpoints/express-single.mjs.map +1 -1
  104. package/dist/v2/runtime/endpoints/express.cjs +41 -195
  105. package/dist/v2/runtime/endpoints/express.cjs.map +1 -1
  106. package/dist/v2/runtime/endpoints/express.d.cts +26 -4
  107. package/dist/v2/runtime/endpoints/express.d.cts.map +1 -1
  108. package/dist/v2/runtime/endpoints/express.d.mts +26 -4
  109. package/dist/v2/runtime/endpoints/express.d.mts.map +1 -1
  110. package/dist/v2/runtime/endpoints/express.mjs +41 -195
  111. package/dist/v2/runtime/endpoints/express.mjs.map +1 -1
  112. package/dist/v2/runtime/endpoints/hono-single.cjs +11 -123
  113. package/dist/v2/runtime/endpoints/hono-single.cjs.map +1 -1
  114. package/dist/v2/runtime/endpoints/hono-single.d.cts +14 -11
  115. package/dist/v2/runtime/endpoints/hono-single.d.cts.map +1 -1
  116. package/dist/v2/runtime/endpoints/hono-single.d.mts +14 -11
  117. package/dist/v2/runtime/endpoints/hono-single.d.mts.map +1 -1
  118. package/dist/v2/runtime/endpoints/hono-single.mjs +11 -123
  119. package/dist/v2/runtime/endpoints/hono-single.mjs.map +1 -1
  120. package/dist/v2/runtime/endpoints/hono.cjs +23 -237
  121. package/dist/v2/runtime/endpoints/hono.cjs.map +1 -1
  122. package/dist/v2/runtime/endpoints/hono.d.cts +29 -120
  123. package/dist/v2/runtime/endpoints/hono.d.cts.map +1 -1
  124. package/dist/v2/runtime/endpoints/hono.d.mts +29 -120
  125. package/dist/v2/runtime/endpoints/hono.d.mts.map +1 -1
  126. package/dist/v2/runtime/endpoints/hono.mjs +22 -238
  127. package/dist/v2/runtime/endpoints/hono.mjs.map +1 -1
  128. package/dist/v2/runtime/endpoints/index.d.cts +2 -2
  129. package/dist/v2/runtime/endpoints/index.d.mts +2 -2
  130. package/dist/v2/runtime/endpoints/node-fetch-handler.cjs +26 -0
  131. package/dist/v2/runtime/endpoints/node-fetch-handler.cjs.map +1 -0
  132. package/dist/v2/runtime/endpoints/node-fetch-handler.d.cts +12 -0
  133. package/dist/v2/runtime/endpoints/node-fetch-handler.d.cts.map +1 -0
  134. package/dist/v2/runtime/endpoints/node-fetch-handler.d.mts +12 -0
  135. package/dist/v2/runtime/endpoints/node-fetch-handler.d.mts.map +1 -0
  136. package/dist/v2/runtime/endpoints/node-fetch-handler.mjs +24 -0
  137. package/dist/v2/runtime/endpoints/node-fetch-handler.mjs.map +1 -0
  138. package/dist/v2/runtime/endpoints/node.cjs +30 -0
  139. package/dist/v2/runtime/endpoints/node.cjs.map +1 -0
  140. package/dist/v2/runtime/endpoints/node.d.cts +27 -0
  141. package/dist/v2/runtime/endpoints/node.d.cts.map +1 -0
  142. package/dist/v2/runtime/endpoints/node.d.mts +27 -0
  143. package/dist/v2/runtime/endpoints/node.d.mts.map +1 -0
  144. package/dist/v2/runtime/endpoints/node.mjs +30 -0
  145. package/dist/v2/runtime/endpoints/node.mjs.map +1 -0
  146. package/dist/v2/runtime/express.d.cts +3 -0
  147. package/dist/v2/runtime/express.d.mts +3 -0
  148. package/dist/v2/runtime/handlers/get-runtime-info.cjs +2 -1
  149. package/dist/v2/runtime/handlers/get-runtime-info.cjs.map +1 -1
  150. package/dist/v2/runtime/handlers/get-runtime-info.mjs +2 -1
  151. package/dist/v2/runtime/handlers/get-runtime-info.mjs.map +1 -1
  152. package/dist/v2/runtime/handlers/handle-connect.cjs +6 -3
  153. package/dist/v2/runtime/handlers/handle-connect.cjs.map +1 -1
  154. package/dist/v2/runtime/handlers/handle-connect.mjs +6 -3
  155. package/dist/v2/runtime/handlers/handle-connect.mjs.map +1 -1
  156. package/dist/v2/runtime/handlers/handle-run.cjs +6 -3
  157. package/dist/v2/runtime/handlers/handle-run.cjs.map +1 -1
  158. package/dist/v2/runtime/handlers/handle-run.mjs +6 -3
  159. package/dist/v2/runtime/handlers/handle-run.mjs.map +1 -1
  160. package/dist/v2/runtime/handlers/handle-stop.cjs.map +1 -1
  161. package/dist/v2/runtime/handlers/handle-stop.mjs.map +1 -1
  162. package/dist/v2/runtime/handlers/handle-transcribe.cjs.map +1 -1
  163. package/dist/v2/runtime/handlers/handle-transcribe.mjs.map +1 -1
  164. package/dist/v2/runtime/handlers/intelligence/connect.cjs.map +1 -1
  165. package/dist/v2/runtime/handlers/intelligence/connect.mjs.map +1 -1
  166. package/dist/v2/runtime/handlers/intelligence/run.cjs +22 -1
  167. package/dist/v2/runtime/handlers/intelligence/run.cjs.map +1 -1
  168. package/dist/v2/runtime/handlers/intelligence/run.mjs +22 -1
  169. package/dist/v2/runtime/handlers/intelligence/run.mjs.map +1 -1
  170. package/dist/v2/runtime/handlers/intelligence/thread-names.cjs +1 -1
  171. package/dist/v2/runtime/handlers/intelligence/thread-names.cjs.map +1 -1
  172. package/dist/v2/runtime/handlers/intelligence/thread-names.mjs +1 -1
  173. package/dist/v2/runtime/handlers/intelligence/thread-names.mjs.map +1 -1
  174. package/dist/v2/runtime/handlers/shared/agent-utils.cjs +21 -6
  175. package/dist/v2/runtime/handlers/shared/agent-utils.cjs.map +1 -1
  176. package/dist/v2/runtime/handlers/shared/agent-utils.mjs +21 -6
  177. package/dist/v2/runtime/handlers/shared/agent-utils.mjs.map +1 -1
  178. package/dist/v2/runtime/handlers/shared/json-response.cjs +4 -1
  179. package/dist/v2/runtime/handlers/shared/json-response.cjs.map +1 -1
  180. package/dist/v2/runtime/handlers/shared/json-response.mjs +4 -1
  181. package/dist/v2/runtime/handlers/shared/json-response.mjs.map +1 -1
  182. package/dist/v2/runtime/handlers/shared/resolve-intelligence-user.cjs.map +1 -1
  183. package/dist/v2/runtime/handlers/shared/resolve-intelligence-user.mjs.map +1 -1
  184. package/dist/v2/runtime/handlers/sse/connect.cjs.map +1 -1
  185. package/dist/v2/runtime/handlers/sse/connect.mjs.map +1 -1
  186. package/dist/v2/runtime/handlers/sse/run.cjs.map +1 -1
  187. package/dist/v2/runtime/handlers/sse/run.mjs.map +1 -1
  188. package/dist/v2/runtime/hono.d.cts +3 -0
  189. package/dist/v2/runtime/hono.d.mts +3 -0
  190. package/dist/v2/runtime/index.d.cts +16 -4
  191. package/dist/v2/runtime/index.d.cts.map +1 -0
  192. package/dist/v2/runtime/index.d.mts +16 -4
  193. package/dist/v2/runtime/index.d.mts.map +1 -0
  194. package/dist/v2/runtime/intelligence-platform/client.cjs +10 -1
  195. package/dist/v2/runtime/intelligence-platform/client.cjs.map +1 -1
  196. package/dist/v2/runtime/intelligence-platform/client.d.cts +22 -0
  197. package/dist/v2/runtime/intelligence-platform/client.d.cts.map +1 -1
  198. package/dist/v2/runtime/intelligence-platform/client.d.mts +22 -0
  199. package/dist/v2/runtime/intelligence-platform/client.d.mts.map +1 -1
  200. package/dist/v2/runtime/intelligence-platform/client.mjs +10 -1
  201. package/dist/v2/runtime/intelligence-platform/client.mjs.map +1 -1
  202. package/dist/v2/runtime/node.d.cts +3 -0
  203. package/dist/v2/runtime/node.d.mts +3 -0
  204. package/dist/v2/runtime/open-generative-ui-middleware.cjs +282 -0
  205. package/dist/v2/runtime/open-generative-ui-middleware.cjs.map +1 -0
  206. package/dist/v2/runtime/open-generative-ui-middleware.mjs +280 -0
  207. package/dist/v2/runtime/open-generative-ui-middleware.mjs.map +1 -0
  208. package/dist/v2/runtime/runner/intelligence.cjs +4 -4
  209. package/dist/v2/runtime/runner/intelligence.cjs.map +1 -1
  210. package/dist/v2/runtime/runner/intelligence.d.cts +6 -2
  211. package/dist/v2/runtime/runner/intelligence.d.cts.map +1 -1
  212. package/dist/v2/runtime/runner/intelligence.d.mts +6 -2
  213. package/dist/v2/runtime/runner/intelligence.d.mts.map +1 -1
  214. package/dist/v2/runtime/runner/intelligence.mjs +4 -4
  215. package/dist/v2/runtime/runner/intelligence.mjs.map +1 -1
  216. package/dist/v2/runtime/telemetry/telemetry-client.cjs +37 -0
  217. package/dist/v2/runtime/telemetry/telemetry-client.cjs.map +1 -1
  218. package/dist/v2/runtime/telemetry/telemetry-client.mjs +36 -0
  219. package/dist/v2/runtime/telemetry/telemetry-client.mjs.map +1 -1
  220. package/dist/v2/runtime/telemetry/utils.cjs +15 -0
  221. package/dist/v2/runtime/telemetry/utils.cjs.map +1 -0
  222. package/dist/v2/runtime/telemetry/utils.mjs +14 -0
  223. package/dist/v2/runtime/telemetry/utils.mjs.map +1 -0
  224. package/package.json +81 -48
  225. package/src/agent/__tests__/multimodal.test.ts +176 -0
  226. package/src/agent/index.ts +130 -19
  227. package/src/lib/runtime/agent-integrations/langgraph/agent.ts +3 -3
  228. package/src/lib/runtime/copilot-runtime.ts +1 -0
  229. package/src/v2/express.ts +1 -0
  230. package/src/v2/hono.ts +1 -0
  231. package/src/v2/node.ts +1 -0
  232. package/src/v2/runtime/__tests__/backward-compat.test.ts +261 -0
  233. package/src/v2/runtime/__tests__/code-review-fixes.test.ts +500 -0
  234. package/src/v2/runtime/__tests__/cors-credentials.test.ts +2 -2
  235. package/src/v2/runtime/__tests__/express-adapter.test.ts +188 -0
  236. package/src/v2/runtime/__tests__/express-body-order.test.ts +1 -1
  237. package/src/v2/runtime/__tests__/express-fetch-bridge.test.ts +344 -0
  238. package/src/v2/runtime/__tests__/express-single-sse.test.ts +1 -1
  239. package/src/v2/runtime/__tests__/fetch-cors.test.ts +205 -0
  240. package/src/v2/runtime/__tests__/fetch-handler-validation.test.ts +372 -0
  241. package/src/v2/runtime/__tests__/fetch-handler.test.ts +456 -0
  242. package/src/v2/runtime/__tests__/fetch-router.test.ts +132 -0
  243. package/src/v2/runtime/__tests__/get-runtime-info.test.ts +4 -1
  244. package/src/v2/runtime/__tests__/handle-connect.test.ts +15 -13
  245. package/src/v2/runtime/__tests__/handle-run.test.ts +21 -17
  246. package/src/v2/runtime/__tests__/handle-threads.test.ts +1 -1
  247. package/src/v2/runtime/__tests__/handle-transcribe.test.ts +1 -1
  248. package/src/v2/runtime/__tests__/hono-adapter.test.ts +150 -0
  249. package/src/v2/runtime/__tests__/hooks-edge-cases.test.ts +457 -0
  250. package/src/v2/runtime/__tests__/hooks.test.ts +557 -0
  251. package/src/v2/runtime/__tests__/integration/bun/bun-servers.integration.test.ts +27 -0
  252. package/src/v2/runtime/__tests__/integration/bun/elysia-multi.ts +32 -0
  253. package/src/v2/runtime/__tests__/integration/bun/elysia-single.ts +33 -0
  254. package/src/v2/runtime/__tests__/integration/bun/hono-bun-multi.ts +25 -0
  255. package/src/v2/runtime/__tests__/integration/bun/hono-bun-single.ts +32 -0
  256. package/src/v2/runtime/__tests__/integration/helpers/create-test-runtime.ts +15 -0
  257. package/src/v2/runtime/__tests__/integration/helpers/sse-reader.ts +45 -0
  258. package/src/v2/runtime/__tests__/integration/helpers/test-agent.ts +58 -0
  259. package/src/v2/runtime/__tests__/integration/node-servers.integration.test.ts +39 -0
  260. package/src/v2/runtime/__tests__/integration/servers/express-multi.ts +35 -0
  261. package/src/v2/runtime/__tests__/integration/servers/express-single.ts +36 -0
  262. package/src/v2/runtime/__tests__/integration/servers/fetch-direct.ts +39 -0
  263. package/src/v2/runtime/__tests__/integration/servers/hono-multi.ts +30 -0
  264. package/src/v2/runtime/__tests__/integration/servers/hono-single.ts +37 -0
  265. package/src/v2/runtime/__tests__/integration/servers/node-multi.ts +45 -0
  266. package/src/v2/runtime/__tests__/integration/servers/node-single.ts +46 -0
  267. package/src/v2/runtime/__tests__/integration/servers/types.ts +18 -0
  268. package/src/v2/runtime/__tests__/integration/suites/multi-endpoint.suite.ts +358 -0
  269. package/src/v2/runtime/__tests__/integration/suites/single-endpoint.suite.ts +363 -0
  270. package/src/v2/runtime/__tests__/middleware-express.test.ts +25 -23
  271. package/src/v2/runtime/__tests__/middleware-single-express.test.ts +25 -23
  272. package/src/v2/runtime/__tests__/middleware-single.test.ts +1 -1
  273. package/src/v2/runtime/__tests__/middleware-sse-parser.test.ts +1 -1
  274. package/src/v2/runtime/__tests__/middleware.test.ts +1 -2
  275. package/src/v2/runtime/__tests__/node-fetch-handler.test.ts +157 -0
  276. package/src/v2/runtime/__tests__/open-generative-ui-middleware.e2e.test.ts +728 -0
  277. package/src/v2/runtime/__tests__/router-edge-cases.test.ts +217 -0
  278. package/src/v2/runtime/__tests__/routing-express.test.ts +1 -1
  279. package/src/v2/runtime/__tests__/routing-single-express.test.ts +1 -1
  280. package/src/v2/runtime/__tests__/routing-single.test.ts +1 -1
  281. package/src/v2/runtime/__tests__/routing.test.ts +1 -1
  282. package/src/v2/runtime/__tests__/runtime.test.ts +110 -1
  283. package/src/v2/runtime/__tests__/telemetry.test.ts +62 -1
  284. package/src/v2/runtime/core/fetch-cors.ts +136 -0
  285. package/src/v2/runtime/core/fetch-handler.ts +415 -0
  286. package/src/v2/runtime/core/fetch-router.ts +112 -0
  287. package/src/v2/runtime/core/hooks.ts +151 -0
  288. package/src/v2/runtime/{runtime.ts → core/runtime.ts} +79 -10
  289. package/src/v2/runtime/endpoints/express-fetch-bridge.ts +137 -0
  290. package/src/v2/runtime/endpoints/express-single.ts +42 -219
  291. package/src/v2/runtime/endpoints/express.ts +128 -230
  292. package/src/v2/runtime/endpoints/hono-single.ts +19 -171
  293. package/src/v2/runtime/endpoints/hono.ts +45 -270
  294. package/src/v2/runtime/endpoints/node-fetch-handler.ts +48 -0
  295. package/src/v2/runtime/endpoints/node.ts +28 -0
  296. package/src/v2/runtime/handlers/get-runtime-info.ts +3 -2
  297. package/src/v2/runtime/handlers/handle-connect.ts +7 -4
  298. package/src/v2/runtime/handlers/handle-run.ts +7 -4
  299. package/src/v2/runtime/handlers/handle-stop.ts +1 -1
  300. package/src/v2/runtime/handlers/handle-transcribe.ts +1 -1
  301. package/src/v2/runtime/handlers/intelligence/connect.ts +1 -1
  302. package/src/v2/runtime/handlers/intelligence/run.ts +31 -1
  303. package/src/v2/runtime/handlers/intelligence/thread-names.ts +2 -2
  304. package/src/v2/runtime/handlers/intelligence/threads.ts +1 -1
  305. package/src/v2/runtime/handlers/shared/agent-utils.ts +29 -10
  306. package/src/v2/runtime/handlers/shared/json-response.ts +4 -1
  307. package/src/v2/runtime/handlers/shared/resolve-intelligence-user.ts +1 -1
  308. package/src/v2/runtime/handlers/sse/connect.ts +1 -1
  309. package/src/v2/runtime/handlers/sse/run.ts +1 -1
  310. package/src/v2/runtime/hono.ts +2 -0
  311. package/src/v2/runtime/index.ts +27 -1
  312. package/src/v2/runtime/intelligence-platform/client.ts +50 -1
  313. package/src/v2/runtime/node.ts +6 -0
  314. package/src/v2/runtime/open-generative-ui-middleware.ts +373 -0
  315. package/src/v2/runtime/runner/intelligence.ts +14 -4
  316. package/src/v2/runtime/telemetry/telemetry-client.ts +56 -0
  317. package/src/v2/runtime/telemetry/utils.ts +15 -0
  318. package/tsdown.config.ts +8 -1
  319. package/vitest.config.mjs +2 -5
  320. package/.eslintrc.js +0 -7
  321. package/dist/v2/runtime/endpoints/express-utils.cjs +0 -119
  322. package/dist/v2/runtime/endpoints/express-utils.cjs.map +0 -1
  323. package/dist/v2/runtime/endpoints/express-utils.mjs +0 -117
  324. package/dist/v2/runtime/endpoints/express-utils.mjs.map +0 -1
  325. package/dist/v2/runtime/handlers/intelligence/threads.cjs +0 -159
  326. package/dist/v2/runtime/handlers/intelligence/threads.cjs.map +0 -1
  327. package/dist/v2/runtime/handlers/intelligence/threads.mjs +0 -154
  328. package/dist/v2/runtime/handlers/intelligence/threads.mjs.map +0 -1
  329. package/dist/v2/runtime/middleware-sse-parser.cjs.map +0 -1
  330. package/dist/v2/runtime/middleware-sse-parser.d.cts.map +0 -1
  331. package/dist/v2/runtime/middleware-sse-parser.d.mts.map +0 -1
  332. package/dist/v2/runtime/middleware-sse-parser.mjs.map +0 -1
  333. package/dist/v2/runtime/middleware.cjs.map +0 -1
  334. package/dist/v2/runtime/middleware.d.cts.map +0 -1
  335. package/dist/v2/runtime/middleware.d.mts.map +0 -1
  336. package/dist/v2/runtime/middleware.mjs.map +0 -1
  337. package/dist/v2/runtime/runtime.cjs.map +0 -1
  338. package/dist/v2/runtime/runtime.d.cts.map +0 -1
  339. package/dist/v2/runtime/runtime.d.mts.map +0 -1
  340. package/dist/v2/runtime/runtime.mjs.map +0 -1
  341. package/src/v2/runtime/__tests__/express-abort-signal.test.ts +0 -25
  342. package/src/v2/runtime/endpoints/express-utils.ts +0 -182
  343. package/src/v2/runtime/handler.ts +0 -3
  344. /package/src/v2/runtime/{middleware-sse-parser.ts → core/middleware-sse-parser.ts} +0 -0
  345. /package/src/v2/runtime/{middleware.ts → core/middleware.ts} +0 -0
@@ -1,9 +1,9 @@
1
1
  import "reflect-metadata";
2
2
  import { CustomEventNames } from "./consts.mjs";
3
- import * as rxjs from "rxjs";
4
- import { EventType, RunAgentInput } from "@ag-ui/client";
5
- import * as zod from "zod";
3
+ import { Observable } from "rxjs";
4
+ import { RunAgentInput } from "@ag-ui/client";
6
5
  import { LangGraphAgent, LangGraphAgentConfig, LangGraphHttpAgent, ProcessedEvents, SchemaKeys, State, StateEnrichment } from "@ag-ui/langgraph";
6
+ import { BaseEvent as BaseEvent$1 } from "@ag-ui/core";
7
7
  import { Message as Message$1 } from "@langchain/langgraph-sdk/dist/types.messages";
8
8
 
9
9
  //#region src/lib/runtime/agent-integrations/langgraph/agent.d.ts
@@ -16,844 +16,7 @@ interface CopilotKitStateEnrichment {
16
16
  declare class LangGraphAgent$1 extends LangGraphAgent {
17
17
  constructor(config: LangGraphAgentConfig);
18
18
  dispatchEvent(event: ProcessedEvents): boolean;
19
- run(input: RunAgentInput): rxjs.Observable<zod.objectOutputType<{
20
- timestamp: zod.ZodOptional<zod.ZodNumber>;
21
- rawEvent: zod.ZodOptional<zod.ZodAny>;
22
- } & {
23
- type: zod.ZodLiteral<EventType.TEXT_MESSAGE_START>;
24
- messageId: zod.ZodString;
25
- role: zod.ZodDefault<zod.ZodUnion<[zod.ZodLiteral<"developer">, zod.ZodLiteral<"system">, zod.ZodLiteral<"assistant">, zod.ZodLiteral<"user">]>>;
26
- name: zod.ZodOptional<zod.ZodString>;
27
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
28
- timestamp: zod.ZodOptional<zod.ZodNumber>;
29
- rawEvent: zod.ZodOptional<zod.ZodAny>;
30
- } & {
31
- type: zod.ZodLiteral<EventType.TEXT_MESSAGE_CONTENT>;
32
- messageId: zod.ZodString;
33
- delta: zod.ZodEffects<zod.ZodString, string, string>;
34
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
35
- timestamp: zod.ZodOptional<zod.ZodNumber>;
36
- rawEvent: zod.ZodOptional<zod.ZodAny>;
37
- } & {
38
- type: zod.ZodLiteral<EventType.TEXT_MESSAGE_END>;
39
- messageId: zod.ZodString;
40
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
41
- timestamp: zod.ZodOptional<zod.ZodNumber>;
42
- rawEvent: zod.ZodOptional<zod.ZodAny>;
43
- } & {
44
- type: zod.ZodLiteral<EventType.REASONING_START>;
45
- messageId: zod.ZodString;
46
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
47
- timestamp: zod.ZodOptional<zod.ZodNumber>;
48
- rawEvent: zod.ZodOptional<zod.ZodAny>;
49
- } & {
50
- type: zod.ZodLiteral<EventType.REASONING_MESSAGE_START>;
51
- messageId: zod.ZodString;
52
- role: zod.ZodLiteral<"reasoning">;
53
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
54
- timestamp: zod.ZodOptional<zod.ZodNumber>;
55
- rawEvent: zod.ZodOptional<zod.ZodAny>;
56
- } & {
57
- type: zod.ZodLiteral<EventType.REASONING_MESSAGE_CONTENT>;
58
- messageId: zod.ZodString;
59
- delta: zod.ZodEffects<zod.ZodString, string, string>;
60
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
61
- timestamp: zod.ZodOptional<zod.ZodNumber>;
62
- rawEvent: zod.ZodOptional<zod.ZodAny>;
63
- } & {
64
- type: zod.ZodLiteral<EventType.REASONING_MESSAGE_END>;
65
- messageId: zod.ZodString;
66
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
67
- timestamp: zod.ZodOptional<zod.ZodNumber>;
68
- rawEvent: zod.ZodOptional<zod.ZodAny>;
69
- } & {
70
- type: zod.ZodLiteral<EventType.REASONING_END>;
71
- messageId: zod.ZodString;
72
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
73
- timestamp: zod.ZodOptional<zod.ZodNumber>;
74
- rawEvent: zod.ZodOptional<zod.ZodAny>;
75
- } & {
76
- type: zod.ZodLiteral<EventType.REASONING_ENCRYPTED_VALUE>;
77
- subtype: zod.ZodUnion<[zod.ZodLiteral<"tool-call">, zod.ZodLiteral<"message">]>;
78
- entityId: zod.ZodString;
79
- encryptedValue: zod.ZodString;
80
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
81
- timestamp: zod.ZodOptional<zod.ZodNumber>;
82
- rawEvent: zod.ZodOptional<zod.ZodAny>;
83
- } & {
84
- type: zod.ZodLiteral<EventType.TOOL_CALL_START>;
85
- toolCallId: zod.ZodString;
86
- toolCallName: zod.ZodString;
87
- parentMessageId: zod.ZodOptional<zod.ZodString>;
88
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
89
- timestamp: zod.ZodOptional<zod.ZodNumber>;
90
- rawEvent: zod.ZodOptional<zod.ZodAny>;
91
- } & {
92
- type: zod.ZodLiteral<EventType.TOOL_CALL_ARGS>;
93
- toolCallId: zod.ZodString;
94
- delta: zod.ZodString;
95
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
96
- timestamp: zod.ZodOptional<zod.ZodNumber>;
97
- rawEvent: zod.ZodOptional<zod.ZodAny>;
98
- } & {
99
- type: zod.ZodLiteral<EventType.TOOL_CALL_END>;
100
- toolCallId: zod.ZodString;
101
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
102
- timestamp: zod.ZodOptional<zod.ZodNumber>;
103
- rawEvent: zod.ZodOptional<zod.ZodAny>;
104
- } & {
105
- messageId: zod.ZodString;
106
- type: zod.ZodLiteral<EventType.TOOL_CALL_RESULT>;
107
- toolCallId: zod.ZodString;
108
- content: zod.ZodString;
109
- role: zod.ZodOptional<zod.ZodLiteral<"tool">>;
110
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
111
- timestamp: zod.ZodOptional<zod.ZodNumber>;
112
- rawEvent: zod.ZodOptional<zod.ZodAny>;
113
- } & {
114
- type: zod.ZodLiteral<EventType.STATE_SNAPSHOT>;
115
- snapshot: zod.ZodAny;
116
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
117
- timestamp: zod.ZodOptional<zod.ZodNumber>;
118
- rawEvent: zod.ZodOptional<zod.ZodAny>;
119
- } & {
120
- type: zod.ZodLiteral<EventType.STATE_DELTA>;
121
- delta: zod.ZodArray<zod.ZodAny, "many">;
122
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
123
- timestamp: zod.ZodOptional<zod.ZodNumber>;
124
- rawEvent: zod.ZodOptional<zod.ZodAny>;
125
- } & {
126
- type: zod.ZodLiteral<EventType.MESSAGES_SNAPSHOT>;
127
- messages: zod.ZodArray<zod.ZodDiscriminatedUnion<"role", [zod.ZodObject<{
128
- id: zod.ZodString;
129
- name: zod.ZodOptional<zod.ZodString>;
130
- encryptedValue: zod.ZodOptional<zod.ZodString>;
131
- } & {
132
- role: zod.ZodLiteral<"developer">;
133
- content: zod.ZodString;
134
- }, "strip", zod.ZodTypeAny, {
135
- role: "developer";
136
- content: string;
137
- id: string;
138
- name?: string | undefined;
139
- encryptedValue?: string | undefined;
140
- }, {
141
- role: "developer";
142
- content: string;
143
- id: string;
144
- name?: string | undefined;
145
- encryptedValue?: string | undefined;
146
- }>, zod.ZodObject<{
147
- id: zod.ZodString;
148
- name: zod.ZodOptional<zod.ZodString>;
149
- encryptedValue: zod.ZodOptional<zod.ZodString>;
150
- } & {
151
- role: zod.ZodLiteral<"system">;
152
- content: zod.ZodString;
153
- }, "strip", zod.ZodTypeAny, {
154
- role: "system";
155
- content: string;
156
- id: string;
157
- name?: string | undefined;
158
- encryptedValue?: string | undefined;
159
- }, {
160
- role: "system";
161
- content: string;
162
- id: string;
163
- name?: string | undefined;
164
- encryptedValue?: string | undefined;
165
- }>, zod.ZodObject<{
166
- id: zod.ZodString;
167
- name: zod.ZodOptional<zod.ZodString>;
168
- encryptedValue: zod.ZodOptional<zod.ZodString>;
169
- } & {
170
- role: zod.ZodLiteral<"assistant">;
171
- content: zod.ZodOptional<zod.ZodString>;
172
- toolCalls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
173
- id: zod.ZodString;
174
- type: zod.ZodLiteral<"function">;
175
- function: zod.ZodObject<{
176
- name: zod.ZodString;
177
- arguments: zod.ZodString;
178
- }, "strip", zod.ZodTypeAny, {
179
- name: string;
180
- arguments: string;
181
- }, {
182
- name: string;
183
- arguments: string;
184
- }>;
185
- encryptedValue: zod.ZodOptional<zod.ZodString>;
186
- }, "strip", zod.ZodTypeAny, {
187
- function: {
188
- name: string;
189
- arguments: string;
190
- };
191
- type: "function";
192
- id: string;
193
- encryptedValue?: string | undefined;
194
- }, {
195
- function: {
196
- name: string;
197
- arguments: string;
198
- };
199
- type: "function";
200
- id: string;
201
- encryptedValue?: string | undefined;
202
- }>, "many">>;
203
- }, "strip", zod.ZodTypeAny, {
204
- role: "assistant";
205
- id: string;
206
- name?: string | undefined;
207
- content?: string | undefined;
208
- encryptedValue?: string | undefined;
209
- toolCalls?: {
210
- function: {
211
- name: string;
212
- arguments: string;
213
- };
214
- type: "function";
215
- id: string;
216
- encryptedValue?: string | undefined;
217
- }[] | undefined;
218
- }, {
219
- role: "assistant";
220
- id: string;
221
- name?: string | undefined;
222
- content?: string | undefined;
223
- encryptedValue?: string | undefined;
224
- toolCalls?: {
225
- function: {
226
- name: string;
227
- arguments: string;
228
- };
229
- type: "function";
230
- id: string;
231
- encryptedValue?: string | undefined;
232
- }[] | undefined;
233
- }>, zod.ZodObject<{
234
- id: zod.ZodString;
235
- name: zod.ZodOptional<zod.ZodString>;
236
- encryptedValue: zod.ZodOptional<zod.ZodString>;
237
- } & {
238
- role: zod.ZodLiteral<"user">;
239
- content: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodEffects<zod.ZodDiscriminatedUnion<"type", [zod.ZodObject<{
240
- type: zod.ZodLiteral<"text">;
241
- text: zod.ZodString;
242
- }, "strip", zod.ZodTypeAny, {
243
- type: "text";
244
- text: string;
245
- }, {
246
- type: "text";
247
- text: string;
248
- }>, zod.ZodObject<{
249
- type: zod.ZodLiteral<"binary">;
250
- mimeType: zod.ZodString;
251
- id: zod.ZodOptional<zod.ZodString>;
252
- url: zod.ZodOptional<zod.ZodString>;
253
- data: zod.ZodOptional<zod.ZodString>;
254
- filename: zod.ZodOptional<zod.ZodString>;
255
- }, "strip", zod.ZodTypeAny, {
256
- type: "binary";
257
- mimeType: string;
258
- id?: string | undefined;
259
- url?: string | undefined;
260
- data?: string | undefined;
261
- filename?: string | undefined;
262
- }, {
263
- type: "binary";
264
- mimeType: string;
265
- id?: string | undefined;
266
- url?: string | undefined;
267
- data?: string | undefined;
268
- filename?: string | undefined;
269
- }>]>, {
270
- type: "text";
271
- text: string;
272
- } | {
273
- type: "binary";
274
- mimeType: string;
275
- id?: string | undefined;
276
- url?: string | undefined;
277
- data?: string | undefined;
278
- filename?: string | undefined;
279
- }, {
280
- type: "text";
281
- text: string;
282
- } | {
283
- type: "binary";
284
- mimeType: string;
285
- id?: string | undefined;
286
- url?: string | undefined;
287
- data?: string | undefined;
288
- filename?: string | undefined;
289
- }>, "many">]>;
290
- }, "strip", zod.ZodTypeAny, {
291
- role: "user";
292
- content: string | ({
293
- type: "text";
294
- text: string;
295
- } | {
296
- type: "binary";
297
- mimeType: string;
298
- id?: string | undefined;
299
- url?: string | undefined;
300
- data?: string | undefined;
301
- filename?: string | undefined;
302
- })[];
303
- id: string;
304
- name?: string | undefined;
305
- encryptedValue?: string | undefined;
306
- }, {
307
- role: "user";
308
- content: string | ({
309
- type: "text";
310
- text: string;
311
- } | {
312
- type: "binary";
313
- mimeType: string;
314
- id?: string | undefined;
315
- url?: string | undefined;
316
- data?: string | undefined;
317
- filename?: string | undefined;
318
- })[];
319
- id: string;
320
- name?: string | undefined;
321
- encryptedValue?: string | undefined;
322
- }>, zod.ZodObject<{
323
- id: zod.ZodString;
324
- content: zod.ZodString;
325
- role: zod.ZodLiteral<"tool">;
326
- toolCallId: zod.ZodString;
327
- error: zod.ZodOptional<zod.ZodString>;
328
- encryptedValue: zod.ZodOptional<zod.ZodString>;
329
- }, "strip", zod.ZodTypeAny, {
330
- role: "tool";
331
- toolCallId: string;
332
- content: string;
333
- id: string;
334
- encryptedValue?: string | undefined;
335
- error?: string | undefined;
336
- }, {
337
- role: "tool";
338
- toolCallId: string;
339
- content: string;
340
- id: string;
341
- encryptedValue?: string | undefined;
342
- error?: string | undefined;
343
- }>, zod.ZodObject<{
344
- id: zod.ZodString;
345
- role: zod.ZodLiteral<"activity">;
346
- activityType: zod.ZodString;
347
- content: zod.ZodRecord<zod.ZodString, zod.ZodAny>;
348
- }, "strip", zod.ZodTypeAny, {
349
- role: "activity";
350
- content: Record<string, any>;
351
- id: string;
352
- activityType: string;
353
- }, {
354
- role: "activity";
355
- content: Record<string, any>;
356
- id: string;
357
- activityType: string;
358
- }>, zod.ZodObject<{
359
- id: zod.ZodString;
360
- role: zod.ZodLiteral<"reasoning">;
361
- content: zod.ZodString;
362
- encryptedValue: zod.ZodOptional<zod.ZodString>;
363
- }, "strip", zod.ZodTypeAny, {
364
- role: "reasoning";
365
- content: string;
366
- id: string;
367
- encryptedValue?: string | undefined;
368
- }, {
369
- role: "reasoning";
370
- content: string;
371
- id: string;
372
- encryptedValue?: string | undefined;
373
- }>]>, "many">;
374
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
375
- timestamp: zod.ZodOptional<zod.ZodNumber>;
376
- rawEvent: zod.ZodOptional<zod.ZodAny>;
377
- } & {
378
- type: zod.ZodLiteral<EventType.RAW>;
379
- event: zod.ZodAny;
380
- source: zod.ZodOptional<zod.ZodString>;
381
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
382
- timestamp: zod.ZodOptional<zod.ZodNumber>;
383
- rawEvent: zod.ZodOptional<zod.ZodAny>;
384
- } & {
385
- type: zod.ZodLiteral<EventType.CUSTOM>;
386
- name: zod.ZodString;
387
- value: zod.ZodAny;
388
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
389
- timestamp: zod.ZodOptional<zod.ZodNumber>;
390
- rawEvent: zod.ZodOptional<zod.ZodAny>;
391
- } & {
392
- type: zod.ZodLiteral<EventType.RUN_STARTED>;
393
- threadId: zod.ZodString;
394
- runId: zod.ZodString;
395
- parentRunId: zod.ZodOptional<zod.ZodString>;
396
- input: zod.ZodOptional<zod.ZodObject<{
397
- threadId: zod.ZodString;
398
- runId: zod.ZodString;
399
- parentRunId: zod.ZodOptional<zod.ZodString>;
400
- state: zod.ZodAny;
401
- messages: zod.ZodArray<zod.ZodDiscriminatedUnion<"role", [zod.ZodObject<{
402
- id: zod.ZodString;
403
- name: zod.ZodOptional<zod.ZodString>;
404
- encryptedValue: zod.ZodOptional<zod.ZodString>;
405
- } & {
406
- role: zod.ZodLiteral<"developer">;
407
- content: zod.ZodString;
408
- }, "strip", zod.ZodTypeAny, {
409
- role: "developer";
410
- content: string;
411
- id: string;
412
- name?: string | undefined;
413
- encryptedValue?: string | undefined;
414
- }, {
415
- role: "developer";
416
- content: string;
417
- id: string;
418
- name?: string | undefined;
419
- encryptedValue?: string | undefined;
420
- }>, zod.ZodObject<{
421
- id: zod.ZodString;
422
- name: zod.ZodOptional<zod.ZodString>;
423
- encryptedValue: zod.ZodOptional<zod.ZodString>;
424
- } & {
425
- role: zod.ZodLiteral<"system">;
426
- content: zod.ZodString;
427
- }, "strip", zod.ZodTypeAny, {
428
- role: "system";
429
- content: string;
430
- id: string;
431
- name?: string | undefined;
432
- encryptedValue?: string | undefined;
433
- }, {
434
- role: "system";
435
- content: string;
436
- id: string;
437
- name?: string | undefined;
438
- encryptedValue?: string | undefined;
439
- }>, zod.ZodObject<{
440
- id: zod.ZodString;
441
- name: zod.ZodOptional<zod.ZodString>;
442
- encryptedValue: zod.ZodOptional<zod.ZodString>;
443
- } & {
444
- role: zod.ZodLiteral<"assistant">;
445
- content: zod.ZodOptional<zod.ZodString>;
446
- toolCalls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
447
- id: zod.ZodString;
448
- type: zod.ZodLiteral<"function">;
449
- function: zod.ZodObject<{
450
- name: zod.ZodString;
451
- arguments: zod.ZodString;
452
- }, "strip", zod.ZodTypeAny, {
453
- name: string;
454
- arguments: string;
455
- }, {
456
- name: string;
457
- arguments: string;
458
- }>;
459
- encryptedValue: zod.ZodOptional<zod.ZodString>;
460
- }, "strip", zod.ZodTypeAny, {
461
- function: {
462
- name: string;
463
- arguments: string;
464
- };
465
- type: "function";
466
- id: string;
467
- encryptedValue?: string | undefined;
468
- }, {
469
- function: {
470
- name: string;
471
- arguments: string;
472
- };
473
- type: "function";
474
- id: string;
475
- encryptedValue?: string | undefined;
476
- }>, "many">>;
477
- }, "strip", zod.ZodTypeAny, {
478
- role: "assistant";
479
- id: string;
480
- name?: string | undefined;
481
- content?: string | undefined;
482
- encryptedValue?: string | undefined;
483
- toolCalls?: {
484
- function: {
485
- name: string;
486
- arguments: string;
487
- };
488
- type: "function";
489
- id: string;
490
- encryptedValue?: string | undefined;
491
- }[] | undefined;
492
- }, {
493
- role: "assistant";
494
- id: string;
495
- name?: string | undefined;
496
- content?: string | undefined;
497
- encryptedValue?: string | undefined;
498
- toolCalls?: {
499
- function: {
500
- name: string;
501
- arguments: string;
502
- };
503
- type: "function";
504
- id: string;
505
- encryptedValue?: string | undefined;
506
- }[] | undefined;
507
- }>, zod.ZodObject<{
508
- id: zod.ZodString;
509
- name: zod.ZodOptional<zod.ZodString>;
510
- encryptedValue: zod.ZodOptional<zod.ZodString>;
511
- } & {
512
- role: zod.ZodLiteral<"user">;
513
- content: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodEffects<zod.ZodDiscriminatedUnion<"type", [zod.ZodObject<{
514
- type: zod.ZodLiteral<"text">;
515
- text: zod.ZodString;
516
- }, "strip", zod.ZodTypeAny, {
517
- type: "text";
518
- text: string;
519
- }, {
520
- type: "text";
521
- text: string;
522
- }>, zod.ZodObject<{
523
- type: zod.ZodLiteral<"binary">;
524
- mimeType: zod.ZodString;
525
- id: zod.ZodOptional<zod.ZodString>;
526
- url: zod.ZodOptional<zod.ZodString>;
527
- data: zod.ZodOptional<zod.ZodString>;
528
- filename: zod.ZodOptional<zod.ZodString>;
529
- }, "strip", zod.ZodTypeAny, {
530
- type: "binary";
531
- mimeType: string;
532
- id?: string | undefined;
533
- url?: string | undefined;
534
- data?: string | undefined;
535
- filename?: string | undefined;
536
- }, {
537
- type: "binary";
538
- mimeType: string;
539
- id?: string | undefined;
540
- url?: string | undefined;
541
- data?: string | undefined;
542
- filename?: string | undefined;
543
- }>]>, {
544
- type: "text";
545
- text: string;
546
- } | {
547
- type: "binary";
548
- mimeType: string;
549
- id?: string | undefined;
550
- url?: string | undefined;
551
- data?: string | undefined;
552
- filename?: string | undefined;
553
- }, {
554
- type: "text";
555
- text: string;
556
- } | {
557
- type: "binary";
558
- mimeType: string;
559
- id?: string | undefined;
560
- url?: string | undefined;
561
- data?: string | undefined;
562
- filename?: string | undefined;
563
- }>, "many">]>;
564
- }, "strip", zod.ZodTypeAny, {
565
- role: "user";
566
- content: string | ({
567
- type: "text";
568
- text: string;
569
- } | {
570
- type: "binary";
571
- mimeType: string;
572
- id?: string | undefined;
573
- url?: string | undefined;
574
- data?: string | undefined;
575
- filename?: string | undefined;
576
- })[];
577
- id: string;
578
- name?: string | undefined;
579
- encryptedValue?: string | undefined;
580
- }, {
581
- role: "user";
582
- content: string | ({
583
- type: "text";
584
- text: string;
585
- } | {
586
- type: "binary";
587
- mimeType: string;
588
- id?: string | undefined;
589
- url?: string | undefined;
590
- data?: string | undefined;
591
- filename?: string | undefined;
592
- })[];
593
- id: string;
594
- name?: string | undefined;
595
- encryptedValue?: string | undefined;
596
- }>, zod.ZodObject<{
597
- id: zod.ZodString;
598
- content: zod.ZodString;
599
- role: zod.ZodLiteral<"tool">;
600
- toolCallId: zod.ZodString;
601
- error: zod.ZodOptional<zod.ZodString>;
602
- encryptedValue: zod.ZodOptional<zod.ZodString>;
603
- }, "strip", zod.ZodTypeAny, {
604
- role: "tool";
605
- toolCallId: string;
606
- content: string;
607
- id: string;
608
- encryptedValue?: string | undefined;
609
- error?: string | undefined;
610
- }, {
611
- role: "tool";
612
- toolCallId: string;
613
- content: string;
614
- id: string;
615
- encryptedValue?: string | undefined;
616
- error?: string | undefined;
617
- }>, zod.ZodObject<{
618
- id: zod.ZodString;
619
- role: zod.ZodLiteral<"activity">;
620
- activityType: zod.ZodString;
621
- content: zod.ZodRecord<zod.ZodString, zod.ZodAny>;
622
- }, "strip", zod.ZodTypeAny, {
623
- role: "activity";
624
- content: Record<string, any>;
625
- id: string;
626
- activityType: string;
627
- }, {
628
- role: "activity";
629
- content: Record<string, any>;
630
- id: string;
631
- activityType: string;
632
- }>, zod.ZodObject<{
633
- id: zod.ZodString;
634
- role: zod.ZodLiteral<"reasoning">;
635
- content: zod.ZodString;
636
- encryptedValue: zod.ZodOptional<zod.ZodString>;
637
- }, "strip", zod.ZodTypeAny, {
638
- role: "reasoning";
639
- content: string;
640
- id: string;
641
- encryptedValue?: string | undefined;
642
- }, {
643
- role: "reasoning";
644
- content: string;
645
- id: string;
646
- encryptedValue?: string | undefined;
647
- }>]>, "many">;
648
- tools: zod.ZodArray<zod.ZodObject<{
649
- name: zod.ZodString;
650
- description: zod.ZodString;
651
- parameters: zod.ZodAny;
652
- }, "strip", zod.ZodTypeAny, {
653
- name: string;
654
- description: string;
655
- parameters?: any;
656
- }, {
657
- name: string;
658
- description: string;
659
- parameters?: any;
660
- }>, "many">;
661
- context: zod.ZodArray<zod.ZodObject<{
662
- description: zod.ZodString;
663
- value: zod.ZodString;
664
- }, "strip", zod.ZodTypeAny, {
665
- value: string;
666
- description: string;
667
- }, {
668
- value: string;
669
- description: string;
670
- }>, "many">;
671
- forwardedProps: zod.ZodAny;
672
- }, "strip", zod.ZodTypeAny, {
673
- messages: ({
674
- role: "developer";
675
- content: string;
676
- id: string;
677
- name?: string | undefined;
678
- encryptedValue?: string | undefined;
679
- } | {
680
- role: "system";
681
- content: string;
682
- id: string;
683
- name?: string | undefined;
684
- encryptedValue?: string | undefined;
685
- } | {
686
- role: "assistant";
687
- id: string;
688
- name?: string | undefined;
689
- content?: string | undefined;
690
- encryptedValue?: string | undefined;
691
- toolCalls?: {
692
- function: {
693
- name: string;
694
- arguments: string;
695
- };
696
- type: "function";
697
- id: string;
698
- encryptedValue?: string | undefined;
699
- }[] | undefined;
700
- } | {
701
- role: "user";
702
- content: string | ({
703
- type: "text";
704
- text: string;
705
- } | {
706
- type: "binary";
707
- mimeType: string;
708
- id?: string | undefined;
709
- url?: string | undefined;
710
- data?: string | undefined;
711
- filename?: string | undefined;
712
- })[];
713
- id: string;
714
- name?: string | undefined;
715
- encryptedValue?: string | undefined;
716
- } | {
717
- role: "tool";
718
- toolCallId: string;
719
- content: string;
720
- id: string;
721
- encryptedValue?: string | undefined;
722
- error?: string | undefined;
723
- } | {
724
- role: "activity";
725
- content: Record<string, any>;
726
- id: string;
727
- activityType: string;
728
- } | {
729
- role: "reasoning";
730
- content: string;
731
- id: string;
732
- encryptedValue?: string | undefined;
733
- })[];
734
- threadId: string;
735
- runId: string;
736
- tools: {
737
- name: string;
738
- description: string;
739
- parameters?: any;
740
- }[];
741
- context: {
742
- value: string;
743
- description: string;
744
- }[];
745
- parentRunId?: string | undefined;
746
- state?: any;
747
- forwardedProps?: any;
748
- }, {
749
- messages: ({
750
- role: "developer";
751
- content: string;
752
- id: string;
753
- name?: string | undefined;
754
- encryptedValue?: string | undefined;
755
- } | {
756
- role: "system";
757
- content: string;
758
- id: string;
759
- name?: string | undefined;
760
- encryptedValue?: string | undefined;
761
- } | {
762
- role: "assistant";
763
- id: string;
764
- name?: string | undefined;
765
- content?: string | undefined;
766
- encryptedValue?: string | undefined;
767
- toolCalls?: {
768
- function: {
769
- name: string;
770
- arguments: string;
771
- };
772
- type: "function";
773
- id: string;
774
- encryptedValue?: string | undefined;
775
- }[] | undefined;
776
- } | {
777
- role: "user";
778
- content: string | ({
779
- type: "text";
780
- text: string;
781
- } | {
782
- type: "binary";
783
- mimeType: string;
784
- id?: string | undefined;
785
- url?: string | undefined;
786
- data?: string | undefined;
787
- filename?: string | undefined;
788
- })[];
789
- id: string;
790
- name?: string | undefined;
791
- encryptedValue?: string | undefined;
792
- } | {
793
- role: "tool";
794
- toolCallId: string;
795
- content: string;
796
- id: string;
797
- encryptedValue?: string | undefined;
798
- error?: string | undefined;
799
- } | {
800
- role: "activity";
801
- content: Record<string, any>;
802
- id: string;
803
- activityType: string;
804
- } | {
805
- role: "reasoning";
806
- content: string;
807
- id: string;
808
- encryptedValue?: string | undefined;
809
- })[];
810
- threadId: string;
811
- runId: string;
812
- tools: {
813
- name: string;
814
- description: string;
815
- parameters?: any;
816
- }[];
817
- context: {
818
- value: string;
819
- description: string;
820
- }[];
821
- parentRunId?: string | undefined;
822
- state?: any;
823
- forwardedProps?: any;
824
- }>>;
825
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
826
- timestamp: zod.ZodOptional<zod.ZodNumber>;
827
- rawEvent: zod.ZodOptional<zod.ZodAny>;
828
- } & {
829
- type: zod.ZodLiteral<EventType.RUN_FINISHED>;
830
- threadId: zod.ZodString;
831
- runId: zod.ZodString;
832
- result: zod.ZodOptional<zod.ZodAny>;
833
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
834
- timestamp: zod.ZodOptional<zod.ZodNumber>;
835
- rawEvent: zod.ZodOptional<zod.ZodAny>;
836
- } & {
837
- type: zod.ZodLiteral<EventType.RUN_ERROR>;
838
- message: zod.ZodString;
839
- code: zod.ZodOptional<zod.ZodString>;
840
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
841
- timestamp: zod.ZodOptional<zod.ZodNumber>;
842
- rawEvent: zod.ZodOptional<zod.ZodAny>;
843
- } & {
844
- type: zod.ZodLiteral<EventType.STEP_STARTED>;
845
- stepName: zod.ZodString;
846
- }, zod.ZodTypeAny, "passthrough"> | zod.objectOutputType<{
847
- timestamp: zod.ZodOptional<zod.ZodNumber>;
848
- rawEvent: zod.ZodOptional<zod.ZodAny>;
849
- } & {
850
- type: zod.ZodLiteral<EventType.STEP_FINISHED>;
851
- stepName: zod.ZodString;
852
- }, zod.ZodTypeAny, "passthrough"> | {
853
- type: EventType;
854
- name: string;
855
- value: any;
856
- }>;
19
+ run(input: RunAgentInput): Observable<BaseEvent$1>;
857
20
  langGraphDefaultMergeState(state: State, messages: Message$1[], input: RunAgentInput): State<StateEnrichment & CopilotKitStateEnrichment>;
858
21
  getSchemaKeys(): Promise<SchemaKeys>;
859
22
  }