langgraph-ui-components 0.0.3 → 0.0.6

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 (536) hide show
  1. package/README.md +32 -0
  2. package/dist/index.es10.js +31 -16
  3. package/dist/index.es10.js.map +1 -1
  4. package/dist/index.es100.js +37 -5
  5. package/dist/index.es100.js.map +1 -1
  6. package/dist/index.es101.js +160 -67
  7. package/dist/index.es101.js.map +1 -1
  8. package/dist/index.es102.js +196 -30
  9. package/dist/index.es102.js.map +1 -1
  10. package/dist/index.es103.js +14 -5
  11. package/dist/index.es103.js.map +1 -1
  12. package/dist/index.es104.js +32 -2
  13. package/dist/index.es104.js.map +1 -1
  14. package/dist/index.es105.js +33 -10
  15. package/dist/index.es105.js.map +1 -1
  16. package/dist/index.es106.js +3110 -454
  17. package/dist/index.es106.js.map +1 -1
  18. package/dist/index.es107.js +5 -5
  19. package/dist/index.es108.js +2 -2
  20. package/dist/index.es109.js +12 -142
  21. package/dist/index.es109.js.map +1 -1
  22. package/dist/index.es11.js +146 -120
  23. package/dist/index.es11.js.map +1 -1
  24. package/dist/index.es110.js +11 -906
  25. package/dist/index.es110.js.map +1 -1
  26. package/dist/index.es111.js +483 -262
  27. package/dist/index.es111.js.map +1 -1
  28. package/dist/index.es112.js +7 -4
  29. package/dist/index.es112.js.map +1 -1
  30. package/dist/index.es113.js +2 -446
  31. package/dist/index.es113.js.map +1 -1
  32. package/dist/index.es114.js +141 -41
  33. package/dist/index.es114.js.map +1 -1
  34. package/dist/index.es115.js +904 -20
  35. package/dist/index.es115.js.map +1 -1
  36. package/dist/index.es116.js +267 -66
  37. package/dist/index.es116.js.map +1 -1
  38. package/dist/index.es117.js +3 -130
  39. package/dist/index.es117.js.map +1 -1
  40. package/dist/index.es118.js +437 -42
  41. package/dist/index.es118.js.map +1 -1
  42. package/dist/index.es119.js +46 -10
  43. package/dist/index.es119.js.map +1 -1
  44. package/dist/index.es12.js +13 -103
  45. package/dist/index.es12.js.map +1 -1
  46. package/dist/index.es120.js +22 -45
  47. package/dist/index.es120.js.map +1 -1
  48. package/dist/index.es121.js +72 -92
  49. package/dist/index.es121.js.map +1 -1
  50. package/dist/index.es122.js +126 -50
  51. package/dist/index.es122.js.map +1 -1
  52. package/dist/index.es123.js +46 -13
  53. package/dist/index.es123.js.map +1 -1
  54. package/dist/index.es124.js +9 -14
  55. package/dist/index.es124.js.map +1 -1
  56. package/dist/index.es125.js +45 -89
  57. package/dist/index.es125.js.map +1 -1
  58. package/dist/index.es126.js +99 -2
  59. package/dist/index.es126.js.map +1 -1
  60. package/dist/index.es127.js +48 -51
  61. package/dist/index.es127.js.map +1 -1
  62. package/dist/index.es128.js +14 -99
  63. package/dist/index.es128.js.map +1 -1
  64. package/dist/index.es129.js +88 -190
  65. package/dist/index.es129.js.map +1 -1
  66. package/dist/index.es13.js +126 -33
  67. package/dist/index.es13.js.map +1 -1
  68. package/dist/index.es130.js +2 -110
  69. package/dist/index.es130.js.map +1 -1
  70. package/dist/index.es131.js +163 -34
  71. package/dist/index.es131.js.map +1 -1
  72. package/dist/index.es132.js +2 -10
  73. package/dist/index.es132.js.map +1 -1
  74. package/dist/index.es133.js +55 -10
  75. package/dist/index.es133.js.map +1 -1
  76. package/dist/index.es134.js +99 -11
  77. package/dist/index.es134.js.map +1 -1
  78. package/dist/index.es135.js +181 -81
  79. package/dist/index.es135.js.map +1 -1
  80. package/dist/index.es136.js +105 -270
  81. package/dist/index.es136.js.map +1 -1
  82. package/dist/index.es137.js +35 -2
  83. package/dist/index.es137.js.map +1 -1
  84. package/dist/index.es138.js +10 -164
  85. package/dist/index.es138.js.map +1 -1
  86. package/dist/index.es139.js +11 -51
  87. package/dist/index.es139.js.map +1 -1
  88. package/dist/index.es140.js +11 -39
  89. package/dist/index.es140.js.map +1 -1
  90. package/dist/index.es141.js +89 -33
  91. package/dist/index.es141.js.map +1 -1
  92. package/dist/index.es142.js +264 -29
  93. package/dist/index.es142.js.map +1 -1
  94. package/dist/index.es143.js +2 -24
  95. package/dist/index.es143.js.map +1 -1
  96. package/dist/index.es144.js +158 -585
  97. package/dist/index.es144.js.map +1 -1
  98. package/dist/index.es145.js +44 -118
  99. package/dist/index.es145.js.map +1 -1
  100. package/dist/index.es146.js +34 -158
  101. package/dist/index.es146.js.map +1 -1
  102. package/dist/index.es147.js +35 -2
  103. package/dist/index.es147.js.map +1 -1
  104. package/dist/index.es148.js +40 -2
  105. package/dist/index.es148.js.map +1 -1
  106. package/dist/index.es149.js +24 -2
  107. package/dist/index.es149.js.map +1 -1
  108. package/dist/index.es15.js +15 -15
  109. package/dist/index.es150.js +589 -20
  110. package/dist/index.es150.js.map +1 -1
  111. package/dist/index.es151.js +125 -2
  112. package/dist/index.es151.js.map +1 -1
  113. package/dist/index.es152.js +3 -24
  114. package/dist/index.es152.js.map +1 -1
  115. package/dist/index.es153.js +2 -4
  116. package/dist/index.es153.js.map +1 -1
  117. package/dist/index.es154.js +2 -5
  118. package/dist/index.es154.js.map +1 -1
  119. package/dist/index.es155.js +22 -13
  120. package/dist/index.es155.js.map +1 -1
  121. package/dist/index.es156.js +2 -6
  122. package/dist/index.es156.js.map +1 -1
  123. package/dist/index.es157.js +25 -8
  124. package/dist/index.es157.js.map +1 -1
  125. package/dist/index.es158.js +5 -64
  126. package/dist/index.es158.js.map +1 -1
  127. package/dist/index.es159.js +12 -21
  128. package/dist/index.es159.js.map +1 -1
  129. package/dist/index.es16.js +2 -2
  130. package/dist/index.es160.js +5 -5
  131. package/dist/index.es160.js.map +1 -1
  132. package/dist/index.es161.js +8 -349
  133. package/dist/index.es161.js.map +1 -1
  134. package/dist/index.es162.js +1 -1
  135. package/dist/index.es163.js +1 -1
  136. package/dist/index.es164.js +3 -3
  137. package/dist/index.es165.js +63 -6
  138. package/dist/index.es165.js.map +1 -1
  139. package/dist/index.es166.js +21 -102
  140. package/dist/index.es166.js.map +1 -1
  141. package/dist/index.es167.js +5 -118
  142. package/dist/index.es167.js.map +1 -1
  143. package/dist/index.es168.js +330 -117
  144. package/dist/index.es168.js.map +1 -1
  145. package/dist/index.es169.js +6 -114
  146. package/dist/index.es169.js.map +1 -1
  147. package/dist/index.es17.js +2 -2
  148. package/dist/index.es170.js +103 -6
  149. package/dist/index.es170.js.map +1 -1
  150. package/dist/index.es171.js +119 -2
  151. package/dist/index.es171.js.map +1 -1
  152. package/dist/index.es172.js +134 -140
  153. package/dist/index.es172.js.map +1 -1
  154. package/dist/index.es173.js +115 -2
  155. package/dist/index.es173.js.map +1 -1
  156. package/dist/index.es174.js +6 -3737
  157. package/dist/index.es174.js.map +1 -1
  158. package/dist/index.es175.js +2 -342
  159. package/dist/index.es175.js.map +1 -1
  160. package/dist/index.es176.js +138 -105
  161. package/dist/index.es176.js.map +1 -1
  162. package/dist/index.es177.js +2 -133
  163. package/dist/index.es177.js.map +1 -1
  164. package/dist/index.es178.js +3734 -12
  165. package/dist/index.es178.js.map +1 -1
  166. package/dist/index.es179.js +326 -136
  167. package/dist/index.es179.js.map +1 -1
  168. package/dist/index.es180.js +107 -13
  169. package/dist/index.es180.js.map +1 -1
  170. package/dist/index.es181.js +131 -6
  171. package/dist/index.es181.js.map +1 -1
  172. package/dist/index.es182.js +13 -19
  173. package/dist/index.es182.js.map +1 -1
  174. package/dist/index.es183.js +139 -77
  175. package/dist/index.es183.js.map +1 -1
  176. package/dist/index.es184.js +13 -241
  177. package/dist/index.es184.js.map +1 -1
  178. package/dist/index.es185.js +8 -24
  179. package/dist/index.es185.js.map +1 -1
  180. package/dist/index.es186.js +21 -6
  181. package/dist/index.es186.js.map +1 -1
  182. package/dist/index.es187.js +90 -4
  183. package/dist/index.es187.js.map +1 -1
  184. package/dist/index.es188.js +240 -15
  185. package/dist/index.es188.js.map +1 -1
  186. package/dist/index.es189.js +24 -8
  187. package/dist/index.es189.js.map +1 -1
  188. package/dist/index.es19.js +15 -119
  189. package/dist/index.es19.js.map +1 -1
  190. package/dist/index.es190.js +5 -31
  191. package/dist/index.es190.js.map +1 -1
  192. package/dist/index.es191.js +4 -6
  193. package/dist/index.es191.js.map +1 -1
  194. package/dist/index.es192.js +17 -105
  195. package/dist/index.es192.js.map +1 -1
  196. package/dist/index.es193.js +6 -11
  197. package/dist/index.es193.js.map +1 -1
  198. package/dist/index.es194.js +32 -18
  199. package/dist/index.es194.js.map +1 -1
  200. package/dist/index.es195.js +6 -31
  201. package/dist/index.es195.js.map +1 -1
  202. package/dist/index.es196.js +106 -4
  203. package/dist/index.es196.js.map +1 -1
  204. package/dist/index.es197.js +12 -4
  205. package/dist/index.es197.js.map +1 -1
  206. package/dist/index.es198.js +17 -4
  207. package/dist/index.es198.js.map +1 -1
  208. package/dist/index.es199.js +21 -27
  209. package/dist/index.es199.js.map +1 -1
  210. package/dist/index.es2.js +25 -16
  211. package/dist/index.es2.js.map +1 -1
  212. package/dist/index.es20.js +37 -17
  213. package/dist/index.es20.js.map +1 -1
  214. package/dist/index.es200.js +3 -7
  215. package/dist/index.es200.js.map +1 -1
  216. package/dist/index.es201.js +3 -4
  217. package/dist/index.es201.js.map +1 -1
  218. package/dist/index.es202.js +5 -7
  219. package/dist/index.es202.js.map +1 -1
  220. package/dist/index.es203.js +36 -41
  221. package/dist/index.es203.js.map +1 -1
  222. package/dist/index.es204.js +5 -10
  223. package/dist/index.es204.js.map +1 -1
  224. package/dist/index.es205.js +5 -241
  225. package/dist/index.es205.js.map +1 -1
  226. package/dist/index.es206.js +5 -49
  227. package/dist/index.es206.js.map +1 -1
  228. package/dist/index.es207.js +29 -22
  229. package/dist/index.es207.js.map +1 -1
  230. package/dist/index.es208.js +10 -10
  231. package/dist/index.es208.js.map +1 -1
  232. package/dist/index.es209.js +241 -7
  233. package/dist/index.es209.js.map +1 -1
  234. package/dist/index.es21.js +27 -67
  235. package/dist/index.es21.js.map +1 -1
  236. package/dist/index.es210.js +50 -6
  237. package/dist/index.es210.js.map +1 -1
  238. package/dist/index.es211.js +30 -60
  239. package/dist/index.es211.js.map +1 -1
  240. package/dist/index.es212.js +11 -39
  241. package/dist/index.es212.js.map +1 -1
  242. package/dist/index.es213.js +7 -31
  243. package/dist/index.es213.js.map +1 -1
  244. package/dist/index.es214.js +6 -61
  245. package/dist/index.es214.js.map +1 -1
  246. package/dist/index.es215.js +58 -8
  247. package/dist/index.es215.js.map +1 -1
  248. package/dist/index.es216.js +34 -16
  249. package/dist/index.es216.js.map +1 -1
  250. package/dist/index.es217.js +31 -4
  251. package/dist/index.es217.js.map +1 -1
  252. package/dist/index.es218.js +58 -13
  253. package/dist/index.es218.js.map +1 -1
  254. package/dist/index.es219.js +14 -32
  255. package/dist/index.es219.js.map +1 -1
  256. package/dist/index.es22.js +140 -30
  257. package/dist/index.es22.js.map +1 -1
  258. package/dist/index.es220.js +23 -5
  259. package/dist/index.es220.js.map +1 -1
  260. package/dist/index.es221.js +4 -4
  261. package/dist/index.es221.js.map +1 -1
  262. package/dist/index.es222.js +16 -4
  263. package/dist/index.es222.js.map +1 -1
  264. package/dist/index.es223.js +32 -7
  265. package/dist/index.es223.js.map +1 -1
  266. package/dist/index.es224.js +4 -91
  267. package/dist/index.es224.js.map +1 -1
  268. package/dist/index.es225.js +4 -17
  269. package/dist/index.es225.js.map +1 -1
  270. package/dist/index.es226.js +5 -762
  271. package/dist/index.es226.js.map +1 -1
  272. package/dist/index.es227.js +8 -66
  273. package/dist/index.es227.js.map +1 -1
  274. package/dist/index.es228.js +83 -165
  275. package/dist/index.es228.js.map +1 -1
  276. package/dist/index.es229.js +16 -36
  277. package/dist/index.es229.js.map +1 -1
  278. package/dist/index.es23.js +17 -32
  279. package/dist/index.es23.js.map +1 -1
  280. package/dist/index.es230.js +761 -136
  281. package/dist/index.es230.js.map +1 -1
  282. package/dist/index.es231.js +66 -93
  283. package/dist/index.es231.js.map +1 -1
  284. package/dist/index.es232.js +172 -31
  285. package/dist/index.es232.js.map +1 -1
  286. package/dist/index.es233.js +129 -277
  287. package/dist/index.es233.js.map +1 -1
  288. package/dist/index.es234.js +92 -25
  289. package/dist/index.es234.js.map +1 -1
  290. package/dist/index.es235.js +31 -22
  291. package/dist/index.es235.js.map +1 -1
  292. package/dist/index.es236.js +284 -14
  293. package/dist/index.es236.js.map +1 -1
  294. package/dist/index.es237.js +24 -13
  295. package/dist/index.es237.js.map +1 -1
  296. package/dist/index.es238.js +17 -19
  297. package/dist/index.es238.js.map +1 -1
  298. package/dist/index.es239.js +12 -43
  299. package/dist/index.es239.js.map +1 -1
  300. package/dist/index.es24.js +57 -136
  301. package/dist/index.es24.js.map +1 -1
  302. package/dist/index.es240.js +14 -11
  303. package/dist/index.es240.js.map +1 -1
  304. package/dist/index.es241.js +24 -10
  305. package/dist/index.es241.js.map +1 -1
  306. package/dist/index.es242.js +45 -11
  307. package/dist/index.es242.js.map +1 -1
  308. package/dist/index.es243.js +11 -14
  309. package/dist/index.es243.js.map +1 -1
  310. package/dist/index.es244.js +10 -10
  311. package/dist/index.es244.js.map +1 -1
  312. package/dist/index.es245.js +11 -11
  313. package/dist/index.es245.js.map +1 -1
  314. package/dist/index.es246.js +14 -11
  315. package/dist/index.es246.js.map +1 -1
  316. package/dist/index.es247.js +10 -14
  317. package/dist/index.es247.js.map +1 -1
  318. package/dist/index.es248.js +11 -11
  319. package/dist/index.es248.js.map +1 -1
  320. package/dist/index.es249.js +11 -11
  321. package/dist/index.es249.js.map +1 -1
  322. package/dist/index.es25.js +298 -94
  323. package/dist/index.es25.js.map +1 -1
  324. package/dist/index.es250.js +15 -11
  325. package/dist/index.es250.js.map +1 -1
  326. package/dist/index.es251.js +11 -11
  327. package/dist/index.es251.js.map +1 -1
  328. package/dist/index.es252.js +11 -11
  329. package/dist/index.es252.js.map +1 -1
  330. package/dist/index.es253.js +10 -10
  331. package/dist/index.es253.js.map +1 -1
  332. package/dist/index.es254.js +10 -10
  333. package/dist/index.es254.js.map +1 -1
  334. package/dist/index.es255.js +10 -10
  335. package/dist/index.es255.js.map +1 -1
  336. package/dist/index.es256.js +11 -56
  337. package/dist/index.es256.js.map +1 -1
  338. package/dist/index.es257.js +11 -49
  339. package/dist/index.es257.js.map +1 -1
  340. package/dist/index.es258.js +11 -119
  341. package/dist/index.es258.js.map +1 -1
  342. package/dist/index.es259.js +56 -384
  343. package/dist/index.es259.js.map +1 -1
  344. package/dist/index.es26.js +116 -65
  345. package/dist/index.es26.js.map +1 -1
  346. package/dist/index.es260.js +47 -16
  347. package/dist/index.es260.js.map +1 -1
  348. package/dist/index.es261.js +118 -10
  349. package/dist/index.es261.js.map +1 -1
  350. package/dist/index.es262.js +379 -26
  351. package/dist/index.es262.js.map +1 -1
  352. package/dist/index.es263.js +13 -26
  353. package/dist/index.es263.js.map +1 -1
  354. package/dist/index.es264.js +10 -61
  355. package/dist/index.es264.js.map +1 -1
  356. package/dist/index.es265.js +25 -11
  357. package/dist/index.es265.js.map +1 -1
  358. package/dist/index.es266.js +25 -71
  359. package/dist/index.es266.js.map +1 -1
  360. package/dist/index.es267.js +62 -11
  361. package/dist/index.es267.js.map +1 -1
  362. package/dist/index.es268.js +17 -11
  363. package/dist/index.es268.js.map +1 -1
  364. package/dist/index.es269.js +75 -13
  365. package/dist/index.es269.js.map +1 -1
  366. package/dist/index.es27.js +91 -168
  367. package/dist/index.es27.js.map +1 -1
  368. package/dist/index.es270.js +11 -52
  369. package/dist/index.es270.js.map +1 -1
  370. package/dist/index.es271.js +11 -166
  371. package/dist/index.es271.js.map +1 -1
  372. package/dist/index.es272.js +16 -2
  373. package/dist/index.es272.js.map +1 -1
  374. package/dist/index.es273.js +51 -9
  375. package/dist/index.es273.js.map +1 -1
  376. package/dist/index.es274.js +165 -18
  377. package/dist/index.es274.js.map +1 -1
  378. package/dist/index.es275.js +36 -37
  379. package/dist/index.es275.js.map +1 -1
  380. package/dist/index.es276.js +5 -0
  381. package/dist/index.es276.js.map +1 -0
  382. package/dist/index.es277.js +14 -0
  383. package/dist/index.es277.js.map +1 -0
  384. package/dist/index.es278.js +23 -0
  385. package/dist/index.es278.js.map +1 -0
  386. package/dist/index.es279.js +42 -0
  387. package/dist/index.es279.js.map +1 -0
  388. package/dist/index.es28.js +68 -24
  389. package/dist/index.es28.js.map +1 -1
  390. package/dist/index.es29.js +178 -12
  391. package/dist/index.es29.js.map +1 -1
  392. package/dist/index.es30.js +23 -437
  393. package/dist/index.es30.js.map +1 -1
  394. package/dist/index.es31.js +13 -15
  395. package/dist/index.es31.js.map +1 -1
  396. package/dist/index.es32.js +429 -107
  397. package/dist/index.es32.js.map +1 -1
  398. package/dist/index.es33.js +112 -65
  399. package/dist/index.es33.js.map +1 -1
  400. package/dist/index.es34.js +71 -18
  401. package/dist/index.es34.js.map +1 -1
  402. package/dist/index.es35.js +17 -260
  403. package/dist/index.es35.js.map +1 -1
  404. package/dist/index.es36.js +249 -31
  405. package/dist/index.es36.js.map +1 -1
  406. package/dist/index.es37.js +27 -199
  407. package/dist/index.es37.js.map +1 -1
  408. package/dist/index.es38.js +198 -50
  409. package/dist/index.es38.js.map +1 -1
  410. package/dist/index.es39.js +45 -120
  411. package/dist/index.es39.js.map +1 -1
  412. package/dist/index.es40.js +132 -14
  413. package/dist/index.es40.js.map +1 -1
  414. package/dist/index.es41.js +19 -225
  415. package/dist/index.es41.js.map +1 -1
  416. package/dist/index.es42.js +229 -8
  417. package/dist/index.es42.js.map +1 -1
  418. package/dist/index.es43.js +7 -1190
  419. package/dist/index.es43.js.map +1 -1
  420. package/dist/index.es44.js +1191 -6
  421. package/dist/index.es44.js.map +1 -1
  422. package/dist/index.es45.js +6 -146
  423. package/dist/index.es45.js.map +1 -1
  424. package/dist/index.es46.js +147 -7
  425. package/dist/index.es46.js.map +1 -1
  426. package/dist/index.es47.js +15 -92
  427. package/dist/index.es47.js.map +1 -1
  428. package/dist/index.es49.js +5 -35
  429. package/dist/index.es49.js.map +1 -1
  430. package/dist/index.es50.js +7 -71
  431. package/dist/index.es50.js.map +1 -1
  432. package/dist/index.es51.js +89 -33
  433. package/dist/index.es51.js.map +1 -1
  434. package/dist/index.es52.js +3 -305
  435. package/dist/index.es52.js.map +1 -1
  436. package/dist/index.es53.js +36 -9
  437. package/dist/index.es53.js.map +1 -1
  438. package/dist/index.es54.js +64 -83
  439. package/dist/index.es54.js.map +1 -1
  440. package/dist/index.es55.js +36 -6
  441. package/dist/index.es55.js.map +1 -1
  442. package/dist/index.es56.js +303 -12
  443. package/dist/index.es56.js.map +1 -1
  444. package/dist/index.es57.js +9 -143
  445. package/dist/index.es57.js.map +1 -1
  446. package/dist/index.es58.js +83 -292
  447. package/dist/index.es58.js.map +1 -1
  448. package/dist/index.es59.js +6 -64
  449. package/dist/index.es59.js.map +1 -1
  450. package/dist/index.es6.js +21 -5
  451. package/dist/index.es6.js.map +1 -1
  452. package/dist/index.es60.js +12 -210
  453. package/dist/index.es60.js.map +1 -1
  454. package/dist/index.es61.js +138 -29
  455. package/dist/index.es61.js.map +1 -1
  456. package/dist/index.es62.js +299 -8
  457. package/dist/index.es62.js.map +1 -1
  458. package/dist/index.es63.js +65 -11
  459. package/dist/index.es63.js.map +1 -1
  460. package/dist/index.es64.js +201 -175
  461. package/dist/index.es64.js.map +1 -1
  462. package/dist/index.es65.js +33 -23
  463. package/dist/index.es65.js.map +1 -1
  464. package/dist/index.es66.js +8 -1399
  465. package/dist/index.es66.js.map +1 -1
  466. package/dist/index.es67.js +12 -9
  467. package/dist/index.es67.js.map +1 -1
  468. package/dist/index.es68.js +187 -8
  469. package/dist/index.es68.js.map +1 -1
  470. package/dist/index.es69.js +24 -6
  471. package/dist/index.es69.js.map +1 -1
  472. package/dist/index.es70.js +1384 -147
  473. package/dist/index.es70.js.map +1 -1
  474. package/dist/index.es71.js +9 -672
  475. package/dist/index.es71.js.map +1 -1
  476. package/dist/index.es72.js +8 -12
  477. package/dist/index.es72.js.map +1 -1
  478. package/dist/index.es73.js +6 -40
  479. package/dist/index.es73.js.map +1 -1
  480. package/dist/index.es74.js +155 -26
  481. package/dist/index.es74.js.map +1 -1
  482. package/dist/index.es75.js +657 -217
  483. package/dist/index.es75.js.map +1 -1
  484. package/dist/index.es76.js +11 -29
  485. package/dist/index.es76.js.map +1 -1
  486. package/dist/index.es77.js +37 -72
  487. package/dist/index.es77.js.map +1 -1
  488. package/dist/index.es78.js +32 -74
  489. package/dist/index.es78.js.map +1 -1
  490. package/dist/index.es79.js +226 -46
  491. package/dist/index.es79.js.map +1 -1
  492. package/dist/index.es80.js +6 -6
  493. package/dist/index.es80.js.map +1 -1
  494. package/dist/index.es81.js +71 -39
  495. package/dist/index.es81.js.map +1 -1
  496. package/dist/index.es82.js +73 -54
  497. package/dist/index.es82.js.map +1 -1
  498. package/dist/index.es83.js +52 -13
  499. package/dist/index.es83.js.map +1 -1
  500. package/dist/index.es84.js +28 -135
  501. package/dist/index.es84.js.map +1 -1
  502. package/dist/index.es85.js +42 -20
  503. package/dist/index.es85.js.map +1 -1
  504. package/dist/index.es86.js +36 -181
  505. package/dist/index.es86.js.map +1 -1
  506. package/dist/index.es87.js +5 -241
  507. package/dist/index.es87.js.map +1 -1
  508. package/dist/index.es88.js +65 -347
  509. package/dist/index.es88.js.map +1 -1
  510. package/dist/index.es89.js +31 -131
  511. package/dist/index.es89.js.map +1 -1
  512. package/dist/index.es90.js +49 -62
  513. package/dist/index.es90.js.map +1 -1
  514. package/dist/index.es91.js +13 -37
  515. package/dist/index.es91.js.map +1 -1
  516. package/dist/index.es92.js +134 -34
  517. package/dist/index.es92.js.map +1 -1
  518. package/dist/index.es93.js +20 -165
  519. package/dist/index.es93.js.map +1 -1
  520. package/dist/index.es94.js +162 -183
  521. package/dist/index.es94.js.map +1 -1
  522. package/dist/index.es95.js +240 -13
  523. package/dist/index.es95.js.map +1 -1
  524. package/dist/index.es96.js +352 -27
  525. package/dist/index.es96.js.map +1 -1
  526. package/dist/index.es97.js +130 -27
  527. package/dist/index.es97.js.map +1 -1
  528. package/dist/index.es98.js +64 -3151
  529. package/dist/index.es98.js.map +1 -1
  530. package/dist/index.es99.js +34 -34
  531. package/dist/index.es99.js.map +1 -1
  532. package/dist/langgraph-ui-components.css +107 -0
  533. package/dist/styles.css +1 -1
  534. package/package.json +8 -7
  535. package/dist/index.es48.js +0 -7
  536. package/dist/index.es48.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.es6.js","sources":["../src/providers/Stream.tsx"],"sourcesContent":["/* @refresh reset */\nimport { useChatRuntime } from \"@/providers/ChatRuntime\";\nimport { type Message } from \"@langchain/langgraph-sdk\";\nimport { useStream, type UseStream } from \"@langchain/langgraph-sdk/react\";\nimport {\n isRemoveUIMessage,\n isUIMessage,\n type RemoveUIMessage,\n type UIMessage,\n uiMessageReducer,\n} from \"@langchain/langgraph-sdk/react-ui\";\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { toast } from \"sonner\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { useThread } from \"./Thread\";\n\nexport type StateType = {\n messages: Message[];\n ui?: UIMessage[];\n suggestions?: string[];\n};\n\nconst useTypedStream = useStream<\n StateType,\n {\n UpdateType: {\n messages?: Message[] | Message | string;\n ui?: (UIMessage | RemoveUIMessage)[] | UIMessage | RemoveUIMessage;\n };\n CustomEventType: UIMessage | RemoveUIMessage;\n }\n>;\n\ntype StreamContextType = UseStream<StateType, {\n UpdateType: {\n messages?: Message[] | Message | string;\n ui?: (UIMessage | RemoveUIMessage)[] | UIMessage | RemoveUIMessage;\n };\n CustomEventType: UIMessage | RemoveUIMessage;\n}> & {\n sendMessage: (\n message: Message | string,\n options?: {\n /** If true, message is meant for agent only (not user-visible) */\n type?: Message[\"type\"];\n /** Additional config to pass to the agent */\n config?: any;\n /** Name field required for function/tool messages */\n name?: string;\n /** If true, message is hidden from user UI */\n hidden?: boolean;\n /** Tool calls associated with this message */\n tool_calls?: any[];\n /** Invalid tool calls associated with this message */\n invalid_tool_calls?: any[];\n /** If provided, use this ID for the message instead of generating one */\n tool_call_id?: string;\n /** Additional kwargs to attach to the message */\n additional_kwargs?: Record<string, unknown>;\n /** UI components to display alongside the message */\n ui?: UIMessage[];\n /** Custom ID for the message (will also be used for UI components) */\n id?: string;\n }\n ) => Promise<void>;\n submitMessage: (\n message: Message,\n options?: {\n streamMode?: (\"values\" | \"updates\" | \"messages\" | \"custom\" | \"debug\")[];\n streamSubgraphs?: boolean;\n streamResumable?: boolean;\n config?: any;\n }\n ) => Promise<void>;\n};\n\nconst StreamContext = createContext<StreamContextType | undefined>(undefined);\n\nasync function checkGraphStatus(apiUrl: string, authToken: string | null | undefined) {\n try {\n const res = await fetch(`${apiUrl}/info`, {\n headers: authToken ? { Authorization: `Bearer ${authToken}` } : undefined,\n });\n return res.ok;\n } catch {\n console.error(\"Failed to intialize LangGraph Agent\");\n }\n}\n\nconst StreamSession = ({ children }: { children: ReactNode }) => {\n const { apiUrl, assistantId, identity } = useChatRuntime();\n const { mode, threadId, setThreadId, configuration } = useThread();\n\n // Store local-only AI messages that shouldn't trigger backend calls\n const [localMessages, setLocalMessages] = useState<Message[]>([]);\n // Store local-only UI components\n const [localUI, setLocalUI] = useState<UIMessage[]>([]);\n\n const streamValue = useTypedStream({\n apiUrl,\n assistantId,\n threadId: mode === \"multi\" ? threadId : null,\n defaultHeaders: identity?.authToken\n ? { Authorization: `Bearer ${identity?.authToken}` }\n : undefined,\n fetchStateHistory: true,\n onCustomEvent: (event, options) => {\n if (isUIMessage(event) || isRemoveUIMessage(event)) {\n options.mutate((prev) => {\n // console.log(\"UI Event received in StreamProvider:\", event);\n const ui = uiMessageReducer(prev.ui ?? [], event);\n return { ...prev, ui };\n });\n }\n },\n\n onThreadId: (id) => {\n if (!id) return;\n if (mode === \"single\") {\n // lock once\n if (!threadId) setThreadId(id);\n } else {\n // switch freely\n setThreadId(id);\n }\n },\n });\n\n /**\n * Send a message to the agent programmatically\n * Useful for triggering agent actions without user-visible messages\n * e.g., \"login completed\", \"card clicked: {id}\"\n */\n const sendMessage = useCallback(\n async (\n message: Message | string,\n options?: {\n type?: Message[\"type\"];\n config?: any;\n name?: string;\n hidden?: boolean;\n tool_calls?: any[];\n invalid_tool_calls?: any[];\n tool_call_id?: string;\n additional_kwargs?: Record<string, unknown>;\n ui?: UIMessage[];\n id?: string; // Allow passing custom ID\n }\n ) => {\n // Use provided ID or generate new one\n const messageId = options?.id || uuidv4();\n\n const messageObj: Message =\n typeof message === \"string\"\n ? ({\n id: messageId, // Use the determined ID\n type: options?.type ?? \"human\",\n content: message,\n ...(options?.name && { name: options.name }),\n ...(options?.tool_calls && { tool_calls: options.tool_calls }),\n ...(options?.invalid_tool_calls && { invalid_tool_calls: options.invalid_tool_calls }),\n ...(options?.tool_call_id && { tool_call_id: options.tool_call_id }),\n ...((options?.additional_kwargs || options?.hidden) && {\n additional_kwargs: {\n ...(options?.hidden && { hidden: true }),\n ...(options?.additional_kwargs ?? {}),\n }\n }),\n } as Message)\n : {\n ...message,\n id: messageId, // Override with determined ID\n // Allow overriding message fields with options\n ...(options?.tool_calls && { tool_calls: options.tool_calls }),\n ...(options?.additional_kwargs && {\n additional_kwargs: {\n ...message.additional_kwargs,\n ...options.additional_kwargs,\n }\n }),\n };\n\n // console.log(\"Sending message via sendMessage:\", messageObj);\n\n // If message type is \"ai\", just append to local state without submitting to agent\n // This is useful for injecting initial messages or system messages that don't need agent processing\n if (options?.type === \"ai\") {\n setLocalMessages((prev) => [...prev, messageObj]);\n // console.log(\"Appended AI message to localMessages:\", options?.ui)\n // Also store any UI components, linking them to the message id\n if (options.ui && options.ui.length > 0) {\n const uiWithMessageId = options.ui.map(ui => ({\n ...ui,\n id: messageId, // Use the same message ID so CustomComponentRender can find it\n })) as UIMessage[];\n setLocalUI((prev) => [...prev, ...uiWithMessageId]);\n }\n return;\n }\n\n // For non-AI messages, submit to the agent\n const currentMessages = streamValue.messages || [];\n await streamValue.submit(\n { messages: [...currentMessages, messageObj] }, // Append to existing messages\n {\n config: {\n ...options?.config,\n configurable: {\n ...identity,\n ...configuration,\n ...(options?.config?.configurable ?? {}),\n },\n },\n }\n );\n },\n [streamValue, identity, configuration, setLocalMessages, setLocalUI]\n );\n\n // Combine stream messages with local AI messages, maintaining chronological order\n const combinedMessages = useMemo(() => {\n return [...localMessages, ...(streamValue.messages || [])];\n }, [localMessages, streamValue.messages]);\n\n // Combine local UI with stream UI\n const combinedUI = useMemo(() => {\n // console.log(\"Combining local UI with stream UI:\", localUI, streamValue.values?.ui);\n return [...localUI, ...(streamValue.values?.ui || [])];\n }, [localUI, streamValue.values?.ui]);\n\n const submitMessage = useCallback(\n async (\n message: Message,\n options?: {\n streamMode?: (\"values\" | \"updates\" | \"messages\" | \"custom\" | \"debug\")[];\n streamSubgraphs?: boolean;\n streamResumable?: boolean;\n config?: any;\n }\n ) => {\n // Get ALL current messages (including local AI messages)\n const allCurrentMessages = combinedMessages || [];\n\n await streamValue.submit(\n { messages: [...allCurrentMessages, message] },\n {\n streamMode: options?.streamMode || [\"values\"],\n streamSubgraphs: options?.streamSubgraphs ?? true,\n streamResumable: options?.streamResumable ?? true,\n optimisticValues: (prev) => ({\n ...prev,\n messages: [...allCurrentMessages, message],\n }),\n config: {\n ...options?.config,\n configurable: {\n ...identity,\n ...configuration,\n ...(options?.config?.configurable ?? {}),\n },\n },\n }\n );\n },\n [streamValue, identity, configuration, combinedMessages]\n);\n\n useEffect(() => {\n checkGraphStatus(apiUrl, identity?.authToken).then((ok) => {\n if (!ok) {\n toast.error(\"Failed to connect to LangGraph server\", {\n description: `Unable to reach ${apiUrl}`,\n duration: 10000,\n });\n }\n });\n }, [apiUrl, identity?.authToken]);\n\n const value = useMemo(\n () => ({\n ...streamValue,\n messages: combinedMessages, // Override with combined messages\n values: {\n ...streamValue.values,\n ui: combinedUI, // Override with combined UI\n },\n sendMessage,\n submitMessage,\n }),\n [streamValue, combinedMessages, combinedUI, sendMessage, submitMessage]\n );\n\n return (\n <StreamContext.Provider value={value}>{children}</StreamContext.Provider>\n );\n};\n\n/**\n * Provides streaming message functionality for real-time AI responses.\n * Manages message state, handles streaming updates, and provides submit/sendMessage functions.\n * \n * @example\n * ```tsx\n * <StreamProvider>\n * <ChatInterface />\n * </StreamProvider>\n * ```\n */\nexport function StreamProvider({ children }: { children: ReactNode }) {\n return <StreamSession>{children}</StreamSession>;\n}\n\n/**\n * Hook to access the streaming context.\n * Provides access to messages, loading state, and functions to submit messages.\n * \n * @throws {Error} If used outside of StreamProvider\n * \n * @example\n * ```tsx\n * const { messages, isLoading, submit, sendMessage } = useStreamContext();\n * ```\n */\nexport function useStreamContext(): StreamContextType {\n const ctx = useContext(StreamContext);\n if (!ctx) {\n throw new Error(\"useStreamContext must be used within StreamProvider\");\n }\n return ctx;\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;AA8BA,MAAM,iBAAiB;AAsDvB,MAAM,gBAAgB,cAA6C,MAAS;AAE5E,eAAe,iBAAiB,QAAgB,WAAsC;AACpF,MAAI;AACF,UAAM,MAAM,MAAM,MAAM,GAAG,MAAM,SAAS;AAAA,MACxC,SAAS,YAAY,EAAE,eAAe,UAAU,SAAS,OAAO;AAAA,IAAA,CACjE;AACD,WAAO,IAAI;AAAA,EACb,QAAQ;AACN,YAAQ,MAAM,qCAAqC;AAAA,EACrD;AACF;AAEA,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AAC/D,QAAM,EAAE,QAAQ,aAAa,SAAA,IAAa,eAAA;AAC1C,QAAM,EAAE,MAAM,UAAU,aAAa,cAAA,IAAkB,UAAA;AAGvD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAoB,CAAA,CAAE;AAEhE,QAAM,CAAC,SAAS,UAAU,IAAI,SAAsB,CAAA,CAAE;AAEtD,QAAM,cAAc,eAAe;AAAA,IACjC;AAAA,IACA;AAAA,IACA,UAAU,SAAS,UAAU,WAAW;AAAA,IACxC,gBAAgB,UAAU,YACtB,EAAE,eAAe,UAAU,UAAU,SAAS,GAAA,IAC9C;AAAA,IACJ,mBAAmB;AAAA,IACnB,eAAe,CAAC,OAAO,YAAY;AACjC,UAAI,YAAY,KAAK,KAAK,kBAAkB,KA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"version":3,"file":"index.es6.js","sources":["../src/providers/Stream.tsx"],"sourcesContent":["/* @refresh reset */\nimport { useChatRuntime } from \"@/providers/ChatRuntime\";\nimport { type Message } from \"@langchain/langgraph-sdk\";\nimport { useStream, type UseStream } from \"@langchain/langgraph-sdk/react\";\nimport {\n isRemoveUIMessage,\n isUIMessage,\n type RemoveUIMessage,\n type UIMessage,\n uiMessageReducer,\n} from \"@langchain/langgraph-sdk/react-ui\";\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { toast } from \"sonner\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { useThread } from \"./Thread\";\n\nexport type StateType = {\n messages: Message[];\n ui?: UIMessage[];\n suggestions?: string[];\n};\n\nconst useTypedStream = useStream<\n StateType,\n {\n UpdateType: {\n messages?: Message[] | Message | string;\n ui?: (UIMessage | RemoveUIMessage)[] | UIMessage | RemoveUIMessage;\n };\n CustomEventType: UIMessage | RemoveUIMessage;\n }\n>;\n\ntype StreamContextType = UseStream<StateType, {\n UpdateType: {\n messages?: Message[] | Message | string;\n ui?: (UIMessage | RemoveUIMessage)[] | UIMessage | RemoveUIMessage;\n };\n CustomEventType: UIMessage | RemoveUIMessage;\n}> & {\n sendMessage: (\n message: Message | string,\n options?: {\n /** If true, message is meant for agent only (not user-visible) */\n type?: Message[\"type\"];\n /** Additional config to pass to the agent */\n config?: any;\n /** Name field required for function/tool messages */\n name?: string;\n /** If true, message is hidden from user UI */\n hidden?: boolean;\n /** Tool calls associated with this message */\n tool_calls?: any[];\n /** Invalid tool calls associated with this message */\n invalid_tool_calls?: any[];\n /** If provided, use this ID for the message instead of generating one */\n tool_call_id?: string;\n /** Additional kwargs to attach to the message */\n additional_kwargs?: Record<string, unknown>;\n /** UI components to display alongside the message */\n ui?: UIMessage[];\n /** Custom ID for the message (will also be used for UI components) */\n id?: string;\n }\n ) => Promise<void>;\n submitMessage: (\n message: Message,\n options?: {\n streamMode?: (\"values\" | \"updates\" | \"messages\" | \"custom\" | \"debug\")[];\n streamSubgraphs?: boolean;\n streamResumable?: boolean;\n config?: any;\n }\n ) => Promise<void>;\n};\n\nconst StreamContext = createContext<StreamContextType | undefined>(undefined);\n\nasync function checkGraphStatus(apiUrl: string, authToken: string | null | undefined) {\n try {\n const res = await fetch(`${apiUrl}/info`, {\n headers: authToken ? { Authorization: `Bearer ${authToken}` } : undefined,\n });\n return res.ok;\n } catch {\n console.error(\"Failed to intialize LangGraph Agent\");\n }\n}\n\nconst StreamSession = ({ children }: { children: ReactNode }) => {\n const { apiUrl, assistantId, identity } = useChatRuntime();\n const { mode, threadId, setThreadId, configuration } = useThread();\n\n // Store local-only AI messages that shouldn't trigger backend calls\n const [localMessages, setLocalMessages] = useState<Message[]>([]);\n // Store local-only UI components\n const [localUI, setLocalUI] = useState<UIMessage[]>([]);\n\n const streamValue = useTypedStream({\n apiUrl,\n assistantId,\n threadId: mode === \"multi\" ? threadId : null,\n defaultHeaders: identity?.authToken\n ? { Authorization: `Bearer ${identity?.authToken}` }\n : undefined,\n fetchStateHistory: true,\n onCustomEvent: (event, options) => {\n if (isUIMessage(event) || isRemoveUIMessage(event)) {\n options.mutate((prev) => {\n // console.log(\"UI Event received in StreamProvider:\", event);\n const ui = uiMessageReducer(prev.ui ?? [], event);\n return { ...prev, ui };\n });\n }\n },\n\n onThreadId: (id) => {\n if (!id) return;\n if (mode === \"single\") {\n // lock once\n if (!threadId) setThreadId(id);\n } else {\n // switch freely\n setThreadId(id);\n }\n },\n });\n\n /**\n * Send a message to the agent programmatically\n * Useful for triggering agent actions without user-visible messages\n * e.g., \"login completed\", \"card clicked: {id}\"\n */\n const sendMessage = useCallback(\n async (\n message: Message | string,\n options?: {\n type?: Message[\"type\"];\n config?: any;\n name?: string;\n hidden?: boolean;\n tool_calls?: any[];\n invalid_tool_calls?: any[];\n tool_call_id?: string;\n additional_kwargs?: Record<string, unknown>;\n ui?: UIMessage[];\n id?: string; // Allow passing custom ID\n }\n ) => {\n // Use provided ID or generate new one\n const messageId = options?.id || uuidv4();\n\n const messageObj: Message =\n typeof message === \"string\"\n ? ({\n id: messageId, // Use the determined ID\n type: options?.type ?? \"human\",\n content: message,\n ...(options?.name && { name: options.name }),\n ...(options?.tool_calls && { tool_calls: options.tool_calls }),\n ...(options?.invalid_tool_calls && { invalid_tool_calls: options.invalid_tool_calls }),\n ...(options?.tool_call_id && { tool_call_id: options.tool_call_id }),\n ...((options?.additional_kwargs || options?.hidden) && {\n additional_kwargs: {\n ...(options?.hidden && { hidden: true }),\n ...(options?.additional_kwargs ?? {}),\n }\n }),\n } as Message)\n : {\n ...message,\n id: messageId, // Override with determined ID\n // Allow overriding message fields with options\n ...(options?.tool_calls && { tool_calls: options.tool_calls }),\n ...(options?.additional_kwargs && {\n additional_kwargs: {\n ...message.additional_kwargs,\n ...options.additional_kwargs,\n }\n }),\n };\n\n // console.log(\"Sending message via sendMessage:\", messageObj);\n\n // If message type is \"ai\", just append to local state without submitting to agent\n // This is useful for injecting initial messages or system messages that don't need agent processing\n if (options?.type === \"ai\") {\n setLocalMessages((prev) => [...prev, messageObj]);\n // console.log(\"Appended AI message to localMessages:\", options?.ui)\n // Also store any UI components, linking them to the message id\n if (options.ui && options.ui.length > 0) {\n const uiWithMessageId = options.ui.map((ui, index) => ({\n ...ui,\n id: messageId, // Link to the message ID so CustomComponentRender can find it\n // Ensure each UI component has a unique identifier for React keys\n _key: (ui as any)._key || `${messageId}-ui-${index}`,\n })) as UIMessage[];\n setLocalUI((prev) => [...prev, ...uiWithMessageId]);\n }\n return;\n }\n\n // For non-AI messages, submit to the agent\n const currentMessages = streamValue.messages || [];\n await streamValue.submit(\n { messages: [...currentMessages, messageObj] }, // Append to existing messages\n {\n config: {\n ...options?.config,\n configurable: {\n ...identity,\n ...configuration,\n ...(options?.config?.configurable ?? {}),\n },\n },\n }\n );\n },\n [streamValue, identity, configuration, setLocalMessages, setLocalUI]\n );\n\n // Combine stream messages with local AI messages, deduplicating by ID\n const combinedMessages = useMemo(() => {\n const allMessages = [...localMessages, ...(streamValue.messages || [])];\n // Deduplicate by message ID, keeping the first occurrence\n const seen = new Set<string>();\n return allMessages.filter(msg => {\n if (!msg.id) return true; // Keep messages without IDs\n if (seen.has(msg.id)) return false;\n seen.add(msg.id);\n return true;\n });\n }, [localMessages, streamValue.messages]);\n\n // Combine local UI with stream UI, deduplicating by unique key\n const combinedUI = useMemo(() => {\n // console.log(\"Combining local UI with stream UI:\", localUI, streamValue.values?.ui);\n const allUI = [...localUI, ...(streamValue.values?.ui || [])];\n // Deduplicate by _key or id+name combination\n const seen = new Set<string>();\n return allUI.filter(ui => {\n const key = (ui as any)._key || `${ui.id}-${ui.name}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n }, [localUI, streamValue.values?.ui]);\n\n const submitMessage = useCallback(\n async (\n message: Message,\n options?: {\n streamMode?: (\"values\" | \"updates\" | \"messages\" | \"custom\" | \"debug\")[];\n streamSubgraphs?: boolean;\n streamResumable?: boolean;\n config?: any;\n }\n ) => {\n // Get ALL current messages (including local AI messages)\n const allCurrentMessages = combinedMessages || [];\n\n await streamValue.submit(\n { messages: [...allCurrentMessages, message] },\n {\n streamMode: options?.streamMode || [\"values\"],\n streamSubgraphs: options?.streamSubgraphs ?? true,\n streamResumable: options?.streamResumable ?? true,\n optimisticValues: (prev) => ({\n ...prev,\n messages: [...allCurrentMessages, message],\n }),\n config: {\n ...options?.config,\n configurable: {\n ...identity,\n ...configuration,\n ...(options?.config?.configurable ?? {}),\n },\n },\n }\n );\n },\n [streamValue, identity, configuration, combinedMessages]\n);\n\n useEffect(() => {\n checkGraphStatus(apiUrl, identity?.authToken).then((ok) => {\n if (!ok) {\n toast.error(\"Failed to connect to LangGraph server\", {\n description: `Unable to reach ${apiUrl}`,\n duration: 10000,\n });\n }\n });\n }, [apiUrl, identity?.authToken]);\n\n const value = useMemo(\n () => ({\n ...streamValue,\n messages: combinedMessages, // Override with combined messages\n values: {\n ...streamValue.values,\n ui: combinedUI, // Override with combined UI\n },\n sendMessage,\n submitMessage,\n }),\n [streamValue, combinedMessages, combinedUI, sendMessage, submitMessage]\n );\n\n return (\n <StreamContext.Provider value={value}>{children}</StreamContext.Provider>\n );\n};\n\n/**\n * Provides streaming message functionality for real-time AI responses.\n * Manages message state, handles streaming updates, and provides submit/sendMessage functions.\n * \n * @example\n * ```tsx\n * <StreamProvider>\n * <ChatInterface />\n * </StreamProvider>\n * ```\n */\nexport function StreamProvider({ children }: { children: ReactNode }) {\n return <StreamSession>{children}</StreamSession>;\n}\n\n/**\n * Hook to access the streaming context.\n * Provides access to messages, loading state, and functions to submit messages.\n * \n * @throws {Error} If used outside of StreamProvider\n * \n * @example\n * ```tsx\n * const { messages, isLoading, submit, sendMessage } = useStreamContext();\n * ```\n */\nexport function useStreamContext(): StreamContextType {\n const ctx = useContext(StreamContext);\n if (!ctx) {\n throw new Error(\"useStreamContext must be used within StreamProvider\");\n }\n return ctx;\n}\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;AA8BA,MAAM,iBAAiB;AAsDvB,MAAM,gBAAgB,cAA6C,MAAS;AAE5E,eAAe,iBAAiB,QAAgB,WAAsC;AACpF,MAAI;AACF,UAAM,MAAM,MAAM,MAAM,GAAG,MAAM,SAAS;AAAA,MACxC,SAAS,YAAY,EAAE,eAAe,UAAU,SAAS,OAAO;AAAA,IAAA,CACjE;AACD,WAAO,IAAI;AAAA,EACb,QAAQ;AACN,YAAQ,MAAM,qCAAqC;AAAA,EACrD;AACF;AAEA,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AAC/D,QAAM,EAAE,QAAQ,aAAa,SAAA,IAAa,eAAA;AAC1C,QAAM,EAAE,MAAM,UAAU,aAAa,cAAA,IAAkB,UAAA;AAGvD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAoB,CAAA,CAAE;AAEhE,QAAM,CAAC,SAAS,UAAU,IAAI,SAAsB,CAAA,CAAE;AAEtD,QAAM,cAAc,eAAe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AK,CAAC,OAAO;AACzD,UAAI,CAAC,IAAI;AACP,cAAM,MAAM,yCAAyC;AAAA,UACnD,aAAa,mBAAmB,MAAM;AAAA,UACtC,UAAU;AAAA,QAAA,CACX;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,QAAQ,UAAU,SAAS,CAAC;AAEhC,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,GAAG;AAAA,MACH,UAAU;AAAA;AAAA,MACV,QAAQ;AAAA,QACN,GAAG,YAAY;AAAA,QACf,IAAI;AAAA;AAAA,MAAA;AAAA,MAEN;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,CAAC,aAAa,kBAAkB,YAAY,aAAa,aAAa;AAAA,EAAA;AAGxE,SACE,oBAAC,cAAc,UAAd,EAAuB,OAAe,SAAA,CAAS;AAEpD;AAaO,SAAS,eAAe,EAAE,YAAqC;AACpE,SAAO,oBAAC,iBAAe,UAAS;AAClC;AAaO,SAAS,mBAAsC;AACpD,QAAM,MAAM,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,SAAO;AACT;"}
@@ -1,216 +1,18 @@
1
- import { _isObject, _isArray, _isString, _isContentBlock, iife } from "./index.es74.js";
2
- import { isOpenAIDataBlock, convertToV1FromOpenAIDataBlock } from "./index.es59.js";
3
- function convertToV1FromChatCompletions(message) {
4
- const blocks = [];
5
- if (typeof message.content === "string") blocks.push({
6
- type: "text",
7
- text: message.content
8
- });
9
- else blocks.push(...convertToV1FromChatCompletionsInput(message.content));
10
- for (const toolCall of message.tool_calls ?? []) blocks.push({
11
- type: "tool_call",
12
- id: toolCall.id,
13
- name: toolCall.name,
14
- args: toolCall.args
15
- });
16
- return blocks;
17
- }
18
- function convertToV1FromChatCompletionsChunk(message) {
19
- const blocks = [];
20
- if (typeof message.content === "string") blocks.push({
21
- type: "text",
22
- text: message.content
23
- });
24
- else blocks.push(...convertToV1FromChatCompletionsInput(message.content));
25
- for (const toolCall of message.tool_calls ?? []) blocks.push({
26
- type: "tool_call",
27
- id: toolCall.id,
28
- name: toolCall.name,
29
- args: toolCall.args
30
- });
31
- return blocks;
32
- }
33
- function convertToV1FromChatCompletionsInput(blocks) {
34
- const convertedBlocks = [];
35
- for (const block of blocks) if (isOpenAIDataBlock(block)) convertedBlocks.push(convertToV1FromOpenAIDataBlock(block));
36
- else convertedBlocks.push(block);
37
- return convertedBlocks;
38
- }
39
- function convertResponsesAnnotation(annotation) {
40
- if (annotation.type === "url_citation") {
41
- const { url, title, start_index, end_index } = annotation;
42
- return {
43
- type: "citation",
44
- url,
45
- title,
46
- startIndex: start_index,
47
- endIndex: end_index
48
- };
49
- }
50
- if (annotation.type === "file_citation") {
51
- const { file_id, filename, index } = annotation;
52
- return {
53
- type: "citation",
54
- title: filename,
55
- startIndex: index,
56
- endIndex: index,
57
- fileId: file_id
58
- };
59
- }
60
- return annotation;
61
- }
62
- function convertToV1FromResponses(message) {
63
- function* iterateContent() {
64
- if (_isObject(message.additional_kwargs?.reasoning) && _isArray(message.additional_kwargs.reasoning.summary)) {
65
- const summary = message.additional_kwargs.reasoning.summary.reduce((acc, item) => {
66
- if (_isObject(item) && _isString(item.text)) return `${acc}${item.text}`;
67
- return acc;
68
- }, "");
69
- yield {
70
- type: "reasoning",
71
- reasoning: summary
72
- };
1
+ function mergeSignals(...signals) {
2
+ const nonZeroSignals = signals.filter((signal) => signal != null);
3
+ if (nonZeroSignals.length === 0) return void 0;
4
+ if (nonZeroSignals.length === 1) return nonZeroSignals[0];
5
+ const controller = new AbortController();
6
+ for (const signal of signals) {
7
+ if (signal?.aborted) {
8
+ controller.abort(signal.reason);
9
+ return controller.signal;
73
10
  }
74
- const content = typeof message.content === "string" ? [{
75
- type: "text",
76
- text: message.content
77
- }] : message.content;
78
- for (const block of content) if (_isContentBlock(block, "text")) {
79
- const { text, annotations, ...rest } = block;
80
- if (Array.isArray(annotations)) yield {
81
- ...rest,
82
- type: "text",
83
- text: String(text),
84
- annotations: annotations.map(convertResponsesAnnotation)
85
- };
86
- else yield {
87
- ...rest,
88
- type: "text",
89
- text: String(text)
90
- };
91
- }
92
- for (const toolCall of message.tool_calls ?? []) yield {
93
- type: "tool_call",
94
- id: toolCall.id,
95
- name: toolCall.name,
96
- args: toolCall.args
97
- };
98
- if (_isObject(message.additional_kwargs) && _isArray(message.additional_kwargs.tool_outputs)) for (const toolOutput of message.additional_kwargs.tool_outputs) {
99
- if (_isContentBlock(toolOutput, "web_search_call")) {
100
- yield {
101
- id: toolOutput.id,
102
- type: "server_tool_call",
103
- name: "web_search",
104
- args: { query: toolOutput.query }
105
- };
106
- continue;
107
- } else if (_isContentBlock(toolOutput, "file_search_call")) {
108
- yield {
109
- id: toolOutput.id,
110
- type: "server_tool_call",
111
- name: "file_search",
112
- args: { query: toolOutput.query }
113
- };
114
- continue;
115
- } else if (_isContentBlock(toolOutput, "computer_call")) {
116
- yield {
117
- type: "non_standard",
118
- value: toolOutput
119
- };
120
- continue;
121
- } else if (_isContentBlock(toolOutput, "code_interpreter_call")) {
122
- if (_isString(toolOutput.code)) yield {
123
- id: toolOutput.id,
124
- type: "server_tool_call",
125
- name: "code_interpreter",
126
- args: { code: toolOutput.code }
127
- };
128
- if (_isArray(toolOutput.outputs)) {
129
- const returnCode = iife(() => {
130
- if (toolOutput.status === "in_progress") return void 0;
131
- if (toolOutput.status === "completed") return 0;
132
- if (toolOutput.status === "incomplete") return 127;
133
- if (toolOutput.status === "interpreting") return void 0;
134
- if (toolOutput.status === "failed") return 1;
135
- return void 0;
136
- });
137
- for (const output of toolOutput.outputs) if (_isContentBlock(output, "logs")) {
138
- yield {
139
- type: "server_tool_call_result",
140
- toolCallId: toolOutput.id ?? "",
141
- status: "success",
142
- output: {
143
- type: "code_interpreter_output",
144
- returnCode: returnCode ?? 0,
145
- stderr: [0, void 0].includes(returnCode) ? void 0 : String(output.logs),
146
- stdout: [0, void 0].includes(returnCode) ? String(output.logs) : void 0
147
- }
148
- };
149
- continue;
150
- }
151
- }
152
- continue;
153
- } else if (_isContentBlock(toolOutput, "mcp_call")) {
154
- yield {
155
- id: toolOutput.id,
156
- type: "server_tool_call",
157
- name: "mcp_call",
158
- args: toolOutput.input
159
- };
160
- continue;
161
- } else if (_isContentBlock(toolOutput, "mcp_list_tools")) {
162
- yield {
163
- id: toolOutput.id,
164
- type: "server_tool_call",
165
- name: "mcp_list_tools",
166
- args: toolOutput.input
167
- };
168
- continue;
169
- } else if (_isContentBlock(toolOutput, "mcp_approval_request")) {
170
- yield {
171
- type: "non_standard",
172
- value: toolOutput
173
- };
174
- continue;
175
- } else if (_isContentBlock(toolOutput, "image_generation_call")) {
176
- yield {
177
- type: "non_standard",
178
- value: toolOutput
179
- };
180
- continue;
181
- }
182
- if (_isObject(toolOutput)) yield {
183
- type: "non_standard",
184
- value: toolOutput
185
- };
186
- }
187
- }
188
- return Array.from(iterateContent());
189
- }
190
- function convertToV1FromResponsesChunk(message) {
191
- function* iterateContent() {
192
- yield* convertToV1FromResponses(message);
193
- for (const toolCallChunk of message.tool_call_chunks ?? []) yield {
194
- type: "tool_call_chunk",
195
- id: toolCallChunk.id,
196
- name: toolCallChunk.name,
197
- args: toolCallChunk.args
198
- };
11
+ signal?.addEventListener("abort", () => controller.abort(signal.reason), { once: true });
199
12
  }
200
- return Array.from(iterateContent());
13
+ return controller.signal;
201
14
  }
202
- const ChatOpenAITranslator = {
203
- translateContent: (message) => {
204
- if (typeof message.content === "string") return convertToV1FromChatCompletions(message);
205
- return convertToV1FromResponses(message);
206
- },
207
- translateContentChunk: (message) => {
208
- if (typeof message.content === "string") return convertToV1FromChatCompletionsChunk(message);
209
- return convertToV1FromResponsesChunk(message);
210
- }
211
- };
212
15
  export {
213
- ChatOpenAITranslator,
214
- convertToV1FromChatCompletionsInput
16
+ mergeSignals
215
17
  };
216
18
  //# sourceMappingURL=index.es60.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es60.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/openai.js"],"sourcesContent":["import { _isArray, _isContentBlock, _isObject, _isString, iife } from \"./utils.js\";\nimport { convertToV1FromOpenAIDataBlock, isOpenAIDataBlock } from \"./data.js\";\n\n//#region src/messages/block_translators/openai.ts\n/**\n* Converts a ChatOpenAICompletions message to an array of v1 standard content blocks.\n*\n* This function processes an AI message from ChatOpenAICompletions API format\n* and converts it to the standardized v1 content block format. It handles both\n* string content and structured content blocks, as well as tool calls.\n*\n* @param message - The AI message containing ChatOpenAICompletions formatted content\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage(\"Hello world\");\n* const standardBlocks = convertToV1FromChatCompletions(message);\n* // Returns: [{ type: \"text\", text: \"Hello world\" }]\n* ```\n*\n* @example\n* ```typescript\n* const message = new AIMessage([\n* { type: \"text\", text: \"Hello\" },\n* { type: \"image_url\", image_url: { url: \"https://example.com/image.png\" } }\n* ]);\n* message.tool_calls = [\n* { id: \"call_123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletions(message);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello\" },\n* // { type: \"image\", url: \"https://example.com/image.png\" },\n* // { type: \"tool_call\", id: \"call_123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletions(message) {\n\tconst blocks = [];\n\tif (typeof message.content === \"string\") blocks.push({\n\t\ttype: \"text\",\n\t\ttext: message.content\n\t});\n\telse blocks.push(...convertToV1FromChatCompletionsInput(message.content));\n\tfor (const toolCall of message.tool_calls ?? []) blocks.push({\n\t\ttype: \"tool_call\",\n\t\tid: toolCall.id,\n\t\tname: toolCall.name,\n\t\targs: toolCall.args\n\t});\n\treturn blocks;\n}\n/**\n* Converts a ChatOpenAICompletions message chunk to an array of v1 standard content blocks.\n*\n* This function processes an AI message chunk from OpenAI's chat completions API and converts\n* it to the standardized v1 content block format. It handles both string and array content,\n* as well as tool calls that may be present in the chunk.\n*\n* @param message - The AI message chunk containing OpenAI-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const chunk = new AIMessage(\"Hello\");\n* const standardBlocks = convertToV1FromChatCompletionsChunk(chunk);\n* // Returns: [{ type: \"text\", text: \"Hello\" }]\n* ```\n*\n* @example\n* ```typescript\n* const chunk = new AIMessage([\n* { type: \"text\", text: \"Processing...\" }\n* ]);\n* chunk.tool_calls = [\n* { id: \"call_456\", name: \"search\", args: { query: \"test\" } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletionsChunk(chunk);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Processing...\" },\n* // { type: \"tool_call\", id: \"call_456\", name: \"search\", args: { query: \"test\" } }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletionsChunk(message) {\n\tconst blocks = [];\n\tif (typeof message.content === \"string\") blocks.push({\n\t\ttype: \"text\",\n\t\ttext: message.content\n\t});\n\telse blocks.push(...convertToV1FromChatCompletionsInput(message.content));\n\tfor (const toolCall of message.tool_calls ?? []) blocks.push({\n\t\ttype: \"tool_call\",\n\t\tid: toolCall.id,\n\t\tname: toolCall.name,\n\t\targs: toolCall.args\n\t});\n\treturn blocks;\n}\n/**\n* Converts an array of ChatOpenAICompletions content blocks to v1 standard content blocks.\n*\n* This function processes content blocks from OpenAI's Chat Completions API format\n* and converts them to the standardized v1 content block format. It handles both\n* OpenAI-specific data blocks (which require conversion) and standard blocks\n* (which are passed through with type assertion).\n*\n* @param blocks - Array of content blocks in ChatOpenAICompletions format\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const openaiBlocks = [\n* { type: \"text\", text: \"Hello world\" },\n* { type: \"image_url\", image_url: { url: \"https://example.com/image.png\" } }\n* ];\n*\n* const standardBlocks = convertToV1FromChatCompletionsInput(openaiBlocks);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello world\" },\n* // { type: \"image\", url: \"https://example.com/image.png\" }\n* // ]\n* ```\n*/\nfunction convertToV1FromChatCompletionsInput(blocks) {\n\tconst convertedBlocks = [];\n\tfor (const block of blocks) if (isOpenAIDataBlock(block)) convertedBlocks.push(convertToV1FromOpenAIDataBlock(block));\n\telse convertedBlocks.push(block);\n\treturn convertedBlocks;\n}\nfunction convertResponsesAnnotation(annotation) {\n\tif (annotation.type === \"url_citation\") {\n\t\tconst { url, title, start_index, end_index } = annotation;\n\t\treturn {\n\t\t\ttype: \"citation\",\n\t\t\turl,\n\t\t\ttitle,\n\t\t\tstartIndex: start_index,\n\t\t\tendIndex: end_index\n\t\t};\n\t}\n\tif (annotation.type === \"file_citation\") {\n\t\tconst { file_id, filename, index } = annotation;\n\t\treturn {\n\t\t\ttype: \"citation\",\n\t\t\ttitle: filename,\n\t\t\tstartIndex: index,\n\t\t\tendIndex: index,\n\t\t\tfileId: file_id\n\t\t};\n\t}\n\treturn annotation;\n}\n/**\n* Converts a ChatOpenAIResponses message to an array of v1 standard content blocks.\n*\n* This function processes an AI message containing OpenAI Responses-specific content blocks\n* and converts them to the standardized v1 content block format. It handles reasoning summaries,\n* text content with annotations, tool calls, and various tool outputs including code interpreter,\n* web search, file search, computer calls, and MCP-related blocks.\n*\n* @param message - The AI message containing OpenAI Responses-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage({\n* content: [{ type: \"text\", text: \"Hello world\", annotations: [] }],\n* tool_calls: [{ id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } }],\n* additional_kwargs: {\n* reasoning: { summary: [{ text: \"Let me calculate this...\" }] },\n* tool_outputs: [\n* {\n* type: \"code_interpreter_call\",\n* code: \"print('hello')\",\n* outputs: [{ type: \"logs\", logs: \"hello\" }]\n* }\n* ]\n* }\n* });\n*\n* const standardBlocks = convertToV1FromResponses(message);\n* // Returns:\n* // [\n* // { type: \"reasoning\", reasoning: \"Let me calculate this...\" },\n* // { type: \"text\", text: \"Hello world\", annotations: [] },\n* // { type: \"tool_call\", id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } },\n* // { type: \"code_interpreter_call\", code: \"print('hello')\" },\n* // { type: \"code_interpreter_result\", output: [{ type: \"code_interpreter_output\", returnCode: 0, stdout: \"hello\" }] }\n* // ]\n* ```\n*/\nfunction convertToV1FromResponses(message) {\n\tfunction* iterateContent() {\n\t\tif (_isObject(message.additional_kwargs?.reasoning) && _isArray(message.additional_kwargs.reasoning.summary)) {\n\t\t\tconst summary = message.additional_kwargs.reasoning.summary.reduce((acc, item) => {\n\t\t\t\tif (_isObject(item) && _isString(item.text)) return `${acc}${item.text}`;\n\t\t\t\treturn acc;\n\t\t\t}, \"\");\n\t\t\tyield {\n\t\t\t\ttype: \"reasoning\",\n\t\t\t\treasoning: summary\n\t\t\t};\n\t\t}\n\t\tconst content = typeof message.content === \"string\" ? [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message.content\n\t\t}] : message.content;\n\t\tfor (const block of content) if (_isContentBlock(block, \"text\")) {\n\t\t\tconst { text, annotations,...rest } = block;\n\t\t\tif (Array.isArray(annotations)) yield {\n\t\t\t\t...rest,\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: String(text),\n\t\t\t\tannotations: annotations.map(convertResponsesAnnotation)\n\t\t\t};\n\t\t\telse yield {\n\t\t\t\t...rest,\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: String(text)\n\t\t\t};\n\t\t}\n\t\tfor (const toolCall of message.tool_calls ?? []) yield {\n\t\t\ttype: \"tool_call\",\n\t\t\tid: toolCall.id,\n\t\t\tname: toolCall.name,\n\t\t\targs: toolCall.args\n\t\t};\n\t\tif (_isObject(message.additional_kwargs) && _isArray(message.additional_kwargs.tool_outputs)) for (const toolOutput of message.additional_kwargs.tool_outputs) {\n\t\t\tif (_isContentBlock(toolOutput, \"web_search_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\targs: { query: toolOutput.query }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"file_search_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"file_search\",\n\t\t\t\t\targs: { query: toolOutput.query }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"computer_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"code_interpreter_call\")) {\n\t\t\t\tif (_isString(toolOutput.code)) yield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"code_interpreter\",\n\t\t\t\t\targs: { code: toolOutput.code }\n\t\t\t\t};\n\t\t\t\tif (_isArray(toolOutput.outputs)) {\n\t\t\t\t\tconst returnCode = iife(() => {\n\t\t\t\t\t\tif (toolOutput.status === \"in_progress\") return void 0;\n\t\t\t\t\t\tif (toolOutput.status === \"completed\") return 0;\n\t\t\t\t\t\tif (toolOutput.status === \"incomplete\") return 127;\n\t\t\t\t\t\tif (toolOutput.status === \"interpreting\") return void 0;\n\t\t\t\t\t\tif (toolOutput.status === \"failed\") return 1;\n\t\t\t\t\t\treturn void 0;\n\t\t\t\t\t});\n\t\t\t\t\tfor (const output of toolOutput.outputs) if (_isContentBlock(output, \"logs\")) {\n\t\t\t\t\t\tyield {\n\t\t\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\t\t\ttoolCallId: toolOutput.id ?? \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\t\ttype: \"code_interpreter_output\",\n\t\t\t\t\t\t\t\treturnCode: returnCode ?? 0,\n\t\t\t\t\t\t\t\tstderr: [0, void 0].includes(returnCode) ? void 0 : String(output.logs),\n\t\t\t\t\t\t\t\tstdout: [0, void 0].includes(returnCode) ? String(output.logs) : void 0\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_call\",\n\t\t\t\t\targs: toolOutput.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_list_tools\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: toolOutput.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_list_tools\",\n\t\t\t\t\targs: toolOutput.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"mcp_approval_request\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(toolOutput, \"image_generation_call\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: toolOutput\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (_isObject(toolOutput)) yield {\n\t\t\t\ttype: \"non_standard\",\n\t\t\t\tvalue: toolOutput\n\t\t\t};\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\n/**\n* Converts a ChatOpenAIResponses message chunk to an array of v1 standard content blocks.\n*\n* This function processes an AI message chunk containing OpenAI-specific content blocks\n* and converts them to the standardized v1 content block format. It handles both the\n* regular message content and tool call chunks that are specific to streaming responses.\n*\n* @param message - The AI message chunk containing OpenAI-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const messageChunk = new AIMessageChunk({\n* content: [{ type: \"text\", text: \"Hello\" }],\n* tool_call_chunks: [\n* { id: \"call_123\", name: \"calculator\", args: '{\"a\": 1' }\n* ]\n* });\n*\n* const standardBlocks = convertToV1FromResponsesChunk(messageChunk);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello\" },\n* // { type: \"tool_call_chunk\", id: \"call_123\", name: \"calculator\", args: '{\"a\": 1' }\n* // ]\n* ```\n*/\nfunction convertToV1FromResponsesChunk(message) {\n\tfunction* iterateContent() {\n\t\tyield* convertToV1FromResponses(message);\n\t\tfor (const toolCallChunk of message.tool_call_chunks ?? []) yield {\n\t\t\ttype: \"tool_call_chunk\",\n\t\t\tid: toolCallChunk.id,\n\t\t\tname: toolCallChunk.name,\n\t\t\targs: toolCallChunk.args\n\t\t};\n\t}\n\treturn Array.from(iterateContent());\n}\nconst ChatOpenAITranslator = {\n\ttranslateContent: (message) => {\n\t\tif (typeof message.content === \"string\") return convertToV1FromChatCompletions(message);\n\t\treturn convertToV1FromResponses(message);\n\t},\n\ttranslateContentChunk: (message) => {\n\t\tif (typeof message.content === \"string\") return convertToV1FromChatCompletionsChunk(message);\n\t\treturn convertToV1FromResponsesChunk(message);\n\t}\n};\n\n//#endregion\nexport { ChatOpenAITranslator, convertToV1FromChatCompletionsInput };\n//# sourceMappingURL=openai.js.map"],"names":[],"mappings":";;AAwCA,SAAS,+BAA+B,SAAS;AAChD,QAAM,SAAS,CAAA;AACf,MAAI,OAAO,QAAQ,YAAY,SAAU,QAAO,KAAK;AAAA,IACpD,MAAM;AAAA,IACN,MAAM,QAAQ;AAAA,EAChB,CAAE;AAAA,MACI,QAAO,KAAK,GAAG,oCAAoC,QAAQ,OAAO,CAAC;AACxE,aAAW,YAAY,QAAQ,cA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
+ {"version":3,"file":"index.es60.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/signals.js"],"sourcesContent":["//#region src/utils/signals.ts\nfunction mergeSignals(...signals) {\n\tconst nonZeroSignals = signals.filter((signal) => signal != null);\n\tif (nonZeroSignals.length === 0) return void 0;\n\tif (nonZeroSignals.length === 1) return nonZeroSignals[0];\n\tconst controller = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal?.aborted) {\n\t\t\tcontroller.abort(signal.reason);\n\t\t\treturn controller.signal;\n\t\t}\n\t\tsignal?.addEventListener(\"abort\", () => controller.abort(signal.reason), { once: true });\n\t}\n\treturn controller.signal;\n}\n\n//#endregion\nexport { mergeSignals };\n//# sourceMappingURL=signals.js.map"],"names":[],"mappings":"AACA,SAAS,gBAAgB,SAAS;AACjC,QAAM,iBAAiB,QAAQ,OAAO,CAAC,WAAW,UAAU,IAAI;AAChE,MAAI,eAAe,WAAW,EAAG,QAAO;AACxC,MAAI,eAAe,WAAW,EAAG,QAAO,eAAe,CAAC;AACxD,QAAM,aAAa,IAAI,gBAAe;AACtC,aAAW,UAAU,SAAS;AAC7B,QAAI,QAAQ,SAAS;AACpB,iBAAW,MAAM,OAAO,MAAM;AAC9B,aAAO,WAAW;AAAA,IACnB;AACA,YAAQ,iBAAiB,SAAS,MAAM,WAAW,MAAM,OAAO,MAAM,GAAG,EAAE,MAAM,KAAI,CAAE;AAAA,EACxF;AACA,SAAO,WAAW;AACnB;","x_google_ignoreList":[0]}
@@ -1,37 +1,146 @@
1
- function convertToFormattedString(message, format = "pretty") {
2
- if (format === "pretty") return convertToPrettyString(message);
3
- return JSON.stringify(message);
1
+ import { __export } from "./index.es50.js";
2
+ import { mapKeys, keyToJson } from "./index.es76.js";
3
+ import { escapeIfNeeded } from "./index.es77.js";
4
+ var serializable_exports = {};
5
+ __export(serializable_exports, {
6
+ Serializable: () => Serializable,
7
+ get_lc_unique_name: () => get_lc_unique_name
8
+ });
9
+ function shallowCopy(obj) {
10
+ return Array.isArray(obj) ? [...obj] : { ...obj };
4
11
  }
5
- function convertToPrettyString(message) {
6
- const lines = [];
7
- const title = ` ${message.type.charAt(0).toUpperCase() + message.type.slice(1)} Message `;
8
- const sepLen = Math.floor((80 - title.length) / 2);
9
- const sep = "=".repeat(sepLen);
10
- const secondSep = title.length % 2 === 0 ? sep : `${sep}=`;
11
- lines.push(`${sep}${title}${secondSep}`);
12
- if (message.type === "ai") {
13
- const aiMessage = message;
14
- if (aiMessage.tool_calls && aiMessage.tool_calls.length > 0) {
15
- lines.push("Tool Calls:");
16
- for (const tc of aiMessage.tool_calls) {
17
- lines.push(` ${tc.name} (${tc.id})`);
18
- lines.push(` Call ID: ${tc.id}`);
19
- lines.push(" Args:");
20
- for (const [key, value] of Object.entries(tc.args)) lines.push(` ${key}: ${typeof value === "object" ? JSON.stringify(value) : value}`);
21
- }
12
+ function replaceSecrets(root, secretsMap) {
13
+ const result = shallowCopy(root);
14
+ for (const [path, secretId] of Object.entries(secretsMap)) {
15
+ const [last, ...partsReverse] = path.split(".").reverse();
16
+ let current = result;
17
+ for (const part of partsReverse.reverse()) {
18
+ if (current[part] === void 0) break;
19
+ current[part] = shallowCopy(current[part]);
20
+ current = current[part];
22
21
  }
22
+ if (current[last] !== void 0) current[last] = {
23
+ lc: 1,
24
+ type: "secret",
25
+ id: [secretId]
26
+ };
23
27
  }
24
- if (message.type === "tool") {
25
- const toolMessage = message;
26
- if (toolMessage.name) lines.push(`Name: ${toolMessage.name}`);
28
+ return result;
29
+ }
30
+ function get_lc_unique_name(serializableClass) {
31
+ const parentClass = Object.getPrototypeOf(serializableClass);
32
+ const lcNameIsSubclassed = typeof serializableClass.lc_name === "function" && (typeof parentClass.lc_name !== "function" || serializableClass.lc_name() !== parentClass.lc_name());
33
+ if (lcNameIsSubclassed) return serializableClass.lc_name();
34
+ else return serializableClass.name;
35
+ }
36
+ var Serializable = class Serializable2 {
37
+ lc_serializable = false;
38
+ lc_kwargs;
39
+ /**
40
+ * The name of the serializable. Override to provide an alias or
41
+ * to preserve the serialized module name in minified environments.
42
+ *
43
+ * Implemented as a static method to support loading logic.
44
+ */
45
+ static lc_name() {
46
+ return this.name;
27
47
  }
28
- if (typeof message.content === "string" && message.content.trim()) {
29
- if (lines.length > 1) lines.push("");
30
- lines.push(message.content);
48
+ /**
49
+ * The final serialized identifier for the module.
50
+ */
51
+ get lc_id() {
52
+ return [...this.lc_namespace, get_lc_unique_name(this.constructor)];
31
53
  }
32
- return lines.join("\n");
33
- }
54
+ /**
55
+ * A map of secrets, which will be omitted from serialization.
56
+ * Keys are paths to the secret in constructor args, e.g. "foo.bar.baz".
57
+ * Values are the secret ids, which will be used when deserializing.
58
+ */
59
+ get lc_secrets() {
60
+ return void 0;
61
+ }
62
+ /**
63
+ * A map of additional attributes to merge with constructor args.
64
+ * Keys are the attribute names, e.g. "foo".
65
+ * Values are the attribute values, which will be serialized.
66
+ * These attributes need to be accepted by the constructor as arguments.
67
+ */
68
+ get lc_attributes() {
69
+ return void 0;
70
+ }
71
+ /**
72
+ * A map of aliases for constructor args.
73
+ * Keys are the attribute names, e.g. "foo".
74
+ * Values are the alias that will replace the key in serialization.
75
+ * This is used to eg. make argument names match Python.
76
+ */
77
+ get lc_aliases() {
78
+ return void 0;
79
+ }
80
+ /**
81
+ * A manual list of keys that should be serialized.
82
+ * If not overridden, all fields passed into the constructor will be serialized.
83
+ */
84
+ get lc_serializable_keys() {
85
+ return void 0;
86
+ }
87
+ constructor(kwargs, ..._args) {
88
+ if (this.lc_serializable_keys !== void 0) this.lc_kwargs = Object.fromEntries(Object.entries(kwargs || {}).filter(([key]) => this.lc_serializable_keys?.includes(key)));
89
+ else this.lc_kwargs = kwargs ?? {};
90
+ }
91
+ toJSON() {
92
+ if (!this.lc_serializable) return this.toJSONNotImplemented();
93
+ if (this.lc_kwargs instanceof Serializable2 || typeof this.lc_kwargs !== "object" || Array.isArray(this.lc_kwargs)) return this.toJSONNotImplemented();
94
+ const aliases = {};
95
+ const secrets = {};
96
+ const kwargs = Object.keys(this.lc_kwargs).reduce((acc, key) => {
97
+ acc[key] = key in this ? this[key] : this.lc_kwargs[key];
98
+ return acc;
99
+ }, {});
100
+ for (let current = Object.getPrototypeOf(this); current; current = Object.getPrototypeOf(current)) {
101
+ Object.assign(aliases, Reflect.get(current, "lc_aliases", this));
102
+ Object.assign(secrets, Reflect.get(current, "lc_secrets", this));
103
+ Object.assign(kwargs, Reflect.get(current, "lc_attributes", this));
104
+ }
105
+ Object.keys(secrets).forEach((keyPath) => {
106
+ let read = this;
107
+ let write = kwargs;
108
+ const [last, ...partsReverse] = keyPath.split(".").reverse();
109
+ for (const key of partsReverse.reverse()) {
110
+ if (!(key in read) || read[key] === void 0) return;
111
+ if (!(key in write) || write[key] === void 0) {
112
+ if (typeof read[key] === "object" && read[key] != null) write[key] = {};
113
+ else if (Array.isArray(read[key])) write[key] = [];
114
+ }
115
+ read = read[key];
116
+ write = write[key];
117
+ }
118
+ if (last in read && read[last] !== void 0) write[last] = write[last] || read[last];
119
+ });
120
+ const escapedKwargs = {};
121
+ const pathSet = /* @__PURE__ */ new WeakSet();
122
+ pathSet.add(this);
123
+ for (const [key, value] of Object.entries(kwargs)) escapedKwargs[key] = escapeIfNeeded(value, pathSet);
124
+ const kwargsWithSecrets = Object.keys(secrets).length ? replaceSecrets(escapedKwargs, secrets) : escapedKwargs;
125
+ const processedKwargs = mapKeys(kwargsWithSecrets, keyToJson, aliases);
126
+ return {
127
+ lc: 1,
128
+ type: "constructor",
129
+ id: this.lc_id,
130
+ kwargs: processedKwargs
131
+ };
132
+ }
133
+ toJSONNotImplemented() {
134
+ return {
135
+ lc: 1,
136
+ type: "not_implemented",
137
+ id: this.lc_id
138
+ };
139
+ }
140
+ };
34
141
  export {
35
- convertToFormattedString
142
+ Serializable,
143
+ get_lc_unique_name,
144
+ serializable_exports
36
145
  };
37
146
  //# sourceMappingURL=index.es61.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es61.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/format.js"],"sourcesContent":["//#region src/messages/format.ts\nfunction convertToFormattedString(message, format = \"pretty\") {\n\tif (format === \"pretty\") return convertToPrettyString(message);\n\treturn JSON.stringify(message);\n}\nfunction convertToPrettyString(message) {\n\tconst lines = [];\n\tconst title = ` ${message.type.charAt(0).toUpperCase() + message.type.slice(1)} Message `;\n\tconst sepLen = Math.floor((80 - title.length) / 2);\n\tconst sep = \"=\".repeat(sepLen);\n\tconst secondSep = title.length % 2 === 0 ? sep : `${sep}=`;\n\tlines.push(`${sep}${title}${secondSep}`);\n\tif (message.type === \"ai\") {\n\t\tconst aiMessage = message;\n\t\tif (aiMessage.tool_calls && aiMessage.tool_calls.length > 0) {\n\t\t\tlines.push(\"Tool Calls:\");\n\t\t\tfor (const tc of aiMessage.tool_calls) {\n\t\t\t\tlines.push(` ${tc.name} (${tc.id})`);\n\t\t\t\tlines.push(` Call ID: ${tc.id}`);\n\t\t\t\tlines.push(\" Args:\");\n\t\t\t\tfor (const [key, value] of Object.entries(tc.args)) lines.push(` ${key}: ${typeof value === \"object\" ? JSON.stringify(value) : value}`);\n\t\t\t}\n\t\t}\n\t}\n\tif (message.type === \"tool\") {\n\t\tconst toolMessage = message;\n\t\tif (toolMessage.name) lines.push(`Name: ${toolMessage.name}`);\n\t}\n\tif (typeof message.content === \"string\" && message.content.trim()) {\n\t\tif (lines.length > 1) lines.push(\"\");\n\t\tlines.push(message.content);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n//#endregion\nexport { convertToFormattedString };\n//# sourceMappingURL=format.js.map"],"names":[],"mappings":"AACA,SAAS,yBAAyB,SAAS,SAAS,UAAU;AAC7D,MAAI,WAAW,SAAU,QAAO,sBAAsB,OAAO;AAC7D,SA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m/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/load/serializable.js"],"sourcesContent":["import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { keyToJson, mapKeys } from \"./map_keys.js\";\nimport { escapeIfNeeded } from \"./validation.js\";\n\n//#region src/load/serializable.ts\nvar serializable_exports = {};\n__export(serializable_exports, {\n\tSerializable: () => Serializable,\n\tget_lc_unique_name: () => get_lc_unique_name\n});\nfunction shallowCopy(obj) {\n\treturn Array.isArray(obj) ? [...obj] : { ...obj };\n}\nfunction replaceSecrets(root, secretsMap) {\n\tconst result = shallowCopy(root);\n\tfor (const [path, secretId] of Object.entries(secretsMap)) {\n\t\tconst [last, ...partsReverse] = path.split(\".\").reverse();\n\t\tlet current = result;\n\t\tfor (const part of partsReverse.reverse()) {\n\t\t\tif (current[part] === void 0) break;\n\t\t\tcurrent[part] = shallowCopy(current[part]);\n\t\t\tcurrent = current[part];\n\t\t}\n\t\tif (current[last] !== void 0) current[last] = {\n\t\t\tlc: 1,\n\t\t\ttype: \"secret\",\n\t\t\tid: [secretId]\n\t\t};\n\t}\n\treturn result;\n}\n/**\n* Get a unique name for the module, rather than parent class implementations.\n* Should not be subclassed, subclass lc_name above instead.\n*/\nfunction get_lc_unique_name(serializableClass) {\n\tconst parentClass = Object.getPrototypeOf(serializableClass);\n\tconst lcNameIsSubclassed = typeof serializableClass.lc_name === \"function\" && (typeof parentClass.lc_name !== \"function\" || serializableClass.lc_name() !== parentClass.lc_name());\n\tif (lcNameIsSubclassed) return serializableClass.lc_name();\n\telse return serializableClass.name;\n}\nvar Serializable = class Serializable {\n\tlc_serializable = false;\n\tlc_kwargs;\n\t/**\n\t* The name of the serializable. Override to provide an alias or\n\t* to preserve the serialized module name in minified environments.\n\t*\n\t* Implemented as a static method to support loading logic.\n\t*/\n\tstatic lc_name() {\n\t\treturn this.name;\n\t}\n\t/**\n\t* The final serialized identifier for the module.\n\t*/\n\tget lc_id() {\n\t\treturn [...this.lc_namespace, get_lc_unique_name(this.constructor)];\n\t}\n\t/**\n\t* A map of secrets, which will be omitted from serialization.\n\t* Keys are paths to the secret in constructor args, e.g. \"foo.bar.baz\".\n\t* Values are the secret ids, which will be used when deserializing.\n\t*/\n\tget lc_secrets() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A map of additional attributes to merge with constructor args.\n\t* Keys are the attribute names, e.g. \"foo\".\n\t* Values are the attribute values, which will be serialized.\n\t* These attributes need to be accepted by the constructor as arguments.\n\t*/\n\tget lc_attributes() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A map of aliases for constructor args.\n\t* Keys are the attribute names, e.g. \"foo\".\n\t* Values are the alias that will replace the key in serialization.\n\t* This is used to eg. make argument names match Python.\n\t*/\n\tget lc_aliases() {\n\t\treturn void 0;\n\t}\n\t/**\n\t* A manual list of keys that should be serialized.\n\t* If not overridden, all fields passed into the constructor will be serialized.\n\t*/\n\tget lc_serializable_keys() {\n\t\treturn void 0;\n\t}\n\tconstructor(kwargs, ..._args) {\n\t\tif (this.lc_serializable_keys !== void 0) this.lc_kwargs = Object.fromEntries(Object.entries(kwargs || {}).filter(([key]) => this.lc_serializable_keys?.includes(key)));\n\t\telse this.lc_kwargs = kwargs ?? {};\n\t}\n\ttoJSON() {\n\t\tif (!this.lc_serializable) return this.toJSONNotImplemented();\n\t\tif (this.lc_kwargs instanceof Serializable || typeof this.lc_kwargs !== \"object\" || Array.isArray(this.lc_kwargs)) return this.toJSONNotImplemented();\n\t\tconst aliases = {};\n\t\tconst secrets = {};\n\t\tconst kwargs = Object.keys(this.lc_kwargs).reduce((acc, key) => {\n\t\t\tacc[key] = key in this ? this[key] : this.lc_kwargs[key];\n\t\t\treturn acc;\n\t\t}, {});\n\t\tfor (let current = Object.getPrototypeOf(this); current; current = Object.getPrototypeOf(current)) {\n\t\t\tObject.assign(aliases, Reflect.get(current, \"lc_aliases\", this));\n\t\t\tObject.assign(secrets, Reflect.get(current, \"lc_secrets\", this));\n\t\t\tObject.assign(kwargs, Reflect.get(current, \"lc_attributes\", this));\n\t\t}\n\t\tObject.keys(secrets).forEach((keyPath) => {\n\t\t\tlet read = this;\n\t\t\tlet write = kwargs;\n\t\t\tconst [last, ...partsReverse] = keyPath.split(\".\").reverse();\n\t\t\tfor (const key of partsReverse.reverse()) {\n\t\t\t\tif (!(key in read) || read[key] === void 0) return;\n\t\t\t\tif (!(key in write) || write[key] === void 0) {\n\t\t\t\t\tif (typeof read[key] === \"object\" && read[key] != null) write[key] = {};\n\t\t\t\t\telse if (Array.isArray(read[key])) write[key] = [];\n\t\t\t\t}\n\t\t\t\tread = read[key];\n\t\t\t\twrite = write[key];\n\t\t\t}\n\t\t\tif (last in read && read[last] !== void 0) write[last] = write[last] || read[last];\n\t\t});\n\t\tconst escapedKwargs = {};\n\t\tconst pathSet = /* @__PURE__ */ new WeakSet();\n\t\tpathSet.add(this);\n\t\tfor (const [key, value] of Object.entries(kwargs)) escapedKwargs[key] = escapeIfNeeded(value, pathSet);\n\t\tconst kwargsWithSecrets = Object.keys(secrets).length ? replaceSecrets(escapedKwargs, secrets) : escapedKwargs;\n\t\tconst processedKwargs = mapKeys(kwargsWithSecrets, keyToJson, aliases);\n\t\treturn {\n\t\t\tlc: 1,\n\t\t\ttype: \"constructor\",\n\t\t\tid: this.lc_id,\n\t\t\tkwargs: processedKwargs\n\t\t};\n\t}\n\ttoJSONNotImplemented() {\n\t\treturn {\n\t\t\tlc: 1,\n\t\t\ttype: \"not_implemented\",\n\t\t\tid: this.lc_id\n\t\t};\n\t}\n};\n\n//#endregion\nexport { Serializable, get_lc_unique_name, serializable_exports };\n//# sourceMappingURL=serializable.js.map"],"names":["Serializable"],"mappings":";;;AAKG,IAAC,uBAAuB,CAAA;AAC3B,SAAS,sBAAsB;AAAA,EAC9B,cAAc,MAAM;AAAA,EACpB,oBAAoB,MAAM;AAC3B,CAAC;AACD,SAAS,YAAY,KAAK;AACzB,SAAO,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,G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