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,190 +1,216 @@
1
- function strictParsePartialJson(s) {
2
- try {
3
- return JSON.parse(s);
4
- } catch {
5
- }
6
- const buffer = s.trim();
7
- if (buffer.length === 0) throw new Error("Unexpected end of JSON input");
8
- let pos = 0;
9
- function skipWhitespace() {
10
- while (pos < buffer.length && /\s/.test(buffer[pos])) pos += 1;
11
- }
12
- function parseString() {
13
- if (buffer[pos] !== '"') throw new Error(`Expected '"' at position ${pos}, got '${buffer[pos]}'`);
14
- pos += 1;
15
- let result = "";
16
- let escaped = false;
17
- while (pos < buffer.length) {
18
- const char = buffer[pos];
19
- if (escaped) {
20
- if (char === "n") result += "\n";
21
- else if (char === "t") result += " ";
22
- else if (char === "r") result += "\r";
23
- else if (char === "\\") result += "\\";
24
- else if (char === '"') result += '"';
25
- else if (char === "b") result += "\b";
26
- else if (char === "f") result += "\f";
27
- else if (char === "/") result += "/";
28
- else if (char === "u") {
29
- const hex = buffer.substring(pos + 1, pos + 5);
30
- if (/^[0-9A-Fa-f]{0,4}$/.test(hex)) {
31
- if (hex.length === 4) result += String.fromCharCode(Number.parseInt(hex, 16));
32
- else result += `u${hex}`;
33
- pos += hex.length;
34
- } else throw new Error(`Invalid unicode escape sequence '\\u${hex}' at position ${pos}`);
35
- } else throw new Error(`Invalid escape sequence '\\${char}' at position ${pos}`);
36
- escaped = false;
37
- } else if (char === "\\") escaped = true;
38
- else if (char === '"') {
39
- pos += 1;
40
- return result;
41
- } else result += char;
42
- pos += 1;
43
- }
44
- if (escaped) result += "\\";
45
- return result;
1
+ import { _isObject, _isArray, _isString, _isContentBlock, iife } from "./index.es78.js";
2
+ import { isOpenAIDataBlock, convertToV1FromOpenAIDataBlock } from "./index.es63.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
+ };
46
49
  }
47
- function parseNumber() {
48
- const start = pos;
49
- let numStr = "";
50
- if (buffer[pos] === "-") {
51
- numStr += "-";
52
- pos += 1;
53
- }
54
- if (pos < buffer.length && buffer[pos] === "0") {
55
- numStr += "0";
56
- pos += 1;
57
- if (buffer[pos] >= "0" && buffer[pos] <= "9") throw new Error(`Invalid number at position ${start}`);
58
- }
59
- if (pos < buffer.length && buffer[pos] >= "1" && buffer[pos] <= "9") while (pos < buffer.length && buffer[pos] >= "0" && buffer[pos] <= "9") {
60
- numStr += buffer[pos];
61
- pos += 1;
62
- }
63
- if (pos < buffer.length && buffer[pos] === ".") {
64
- numStr += ".";
65
- pos += 1;
66
- while (pos < buffer.length && buffer[pos] >= "0" && buffer[pos] <= "9") {
67
- numStr += buffer[pos];
68
- pos += 1;
69
- }
70
- }
71
- if (pos < buffer.length && (buffer[pos] === "e" || buffer[pos] === "E")) {
72
- numStr += buffer[pos];
73
- pos += 1;
74
- if (pos < buffer.length && (buffer[pos] === "+" || buffer[pos] === "-")) {
75
- numStr += buffer[pos];
76
- pos += 1;
77
- }
78
- while (pos < buffer.length && buffer[pos] >= "0" && buffer[pos] <= "9") {
79
- numStr += buffer[pos];
80
- pos += 1;
81
- }
82
- }
83
- if (numStr === "-") return -0;
84
- const num = Number.parseFloat(numStr);
85
- if (Number.isNaN(num)) {
86
- pos = start;
87
- throw new Error(`Invalid number '${numStr}' at position ${start}`);
88
- }
89
- return num;
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
+ };
90
59
  }
91
- function parseValue() {
92
- skipWhitespace();
93
- if (pos >= buffer.length) throw new Error(`Unexpected end of input at position ${pos}`);
94
- const char = buffer[pos];
95
- if (char === "{") return parseObject();
96
- if (char === "[") return parseArray();
97
- if (char === '"') return parseString();
98
- if ("null".startsWith(buffer.substring(pos, pos + 4))) {
99
- pos += Math.min(4, buffer.length - pos);
100
- return null;
101
- }
102
- if ("true".startsWith(buffer.substring(pos, pos + 4))) {
103
- pos += Math.min(4, buffer.length - pos);
104
- return true;
105
- }
106
- if ("false".startsWith(buffer.substring(pos, pos + 5))) {
107
- pos += Math.min(5, buffer.length - pos);
108
- return false;
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
+ };
109
73
  }
110
- if (char === "-" || char >= "0" && char <= "9") return parseNumber();
111
- throw new Error(`Unexpected character '${char}' at position ${pos}`);
112
- }
113
- function parseArray() {
114
- if (buffer[pos] !== "[") throw new Error(`Expected '[' at position ${pos}, got '${buffer[pos]}'`);
115
- const arr = [];
116
- pos += 1;
117
- skipWhitespace();
118
- if (pos >= buffer.length) return arr;
119
- if (buffer[pos] === "]") {
120
- pos += 1;
121
- return arr;
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
+ };
122
91
  }
123
- while (pos < buffer.length) {
124
- skipWhitespace();
125
- if (pos >= buffer.length) return arr;
126
- arr.push(parseValue());
127
- skipWhitespace();
128
- if (pos >= buffer.length) return arr;
129
- if (buffer[pos] === "]") {
130
- pos += 1;
131
- return arr;
132
- } else if (buffer[pos] === ",") {
133
- pos += 1;
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
+ };
134
106
  continue;
135
- }
136
- throw new Error(`Expected ',' or ']' at position ${pos}, got '${buffer[pos]}'`);
137
- }
138
- return arr;
139
- }
140
- function parseObject() {
141
- if (buffer[pos] !== "{") throw new Error(`Expected '{' at position ${pos}, got '${buffer[pos]}'`);
142
- const obj = {};
143
- pos += 1;
144
- skipWhitespace();
145
- if (pos >= buffer.length) return obj;
146
- if (buffer[pos] === "}") {
147
- pos += 1;
148
- return obj;
149
- }
150
- while (pos < buffer.length) {
151
- skipWhitespace();
152
- if (pos >= buffer.length) return obj;
153
- const key = parseString();
154
- skipWhitespace();
155
- if (pos >= buffer.length) return obj;
156
- if (buffer[pos] !== ":") throw new Error(`Expected ':' at position ${pos}, got '${buffer[pos]}'`);
157
- pos += 1;
158
- skipWhitespace();
159
- if (pos >= buffer.length) return obj;
160
- obj[key] = parseValue();
161
- skipWhitespace();
162
- if (pos >= buffer.length) return obj;
163
- if (buffer[pos] === "}") {
164
- pos += 1;
165
- return obj;
166
- } else if (buffer[pos] === ",") {
167
- pos += 1;
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
+ };
168
180
  continue;
169
181
  }
170
- throw new Error(`Expected ',' or '}' at position ${pos}, got '${buffer[pos]}'`);
182
+ if (_isObject(toolOutput)) yield {
183
+ type: "non_standard",
184
+ value: toolOutput
185
+ };
171
186
  }
172
- return obj;
173
187
  }
174
- const value = parseValue();
175
- skipWhitespace();
176
- if (pos < buffer.length) throw new Error(`Unexpected character '${buffer[pos]}' at position ${pos}`);
177
- return value;
188
+ return Array.from(iterateContent());
178
189
  }
179
- function parsePartialJson(s) {
180
- try {
181
- if (typeof s === "undefined") return null;
182
- return strictParsePartialJson(s);
183
- } catch {
184
- return null;
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
+ };
185
199
  }
200
+ return Array.from(iterateContent());
186
201
  }
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
+ };
187
212
  export {
188
- parsePartialJson
213
+ ChatOpenAITranslator,
214
+ convertToV1FromChatCompletionsInput
189
215
  };
190
216
  //# sourceMappingURL=index.es64.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es64.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/json.js"],"sourcesContent":["//#region src/utils/json.ts\nfunction parseJsonMarkdown(s, parser = parsePartialJson) {\n\ts = s.trim();\n\tconst firstFenceIndex = s.indexOf(\"```\");\n\tif (firstFenceIndex === -1) return parser(s);\n\tlet contentAfterFence = s.substring(firstFenceIndex + 3);\n\tif (contentAfterFence.startsWith(\"json\\n\")) contentAfterFence = contentAfterFence.substring(5);\n\telse if (contentAfterFence.startsWith(\"json\")) contentAfterFence = contentAfterFence.substring(4);\n\telse if (contentAfterFence.startsWith(\"\\n\")) contentAfterFence = contentAfterFence.substring(1);\n\tconst closingFenceIndex = contentAfterFence.indexOf(\"```\");\n\tlet finalContent = contentAfterFence;\n\tif (closingFenceIndex !== -1) finalContent = contentAfterFence.substring(0, closingFenceIndex);\n\treturn parser(finalContent.trim());\n}\n/**\n* Recursive descent partial JSON parser.\n* @param s - The string to parse.\n* @returns The parsed value.\n* @throws Error if the input is a malformed JSON string.\n*/\nfunction strictParsePartialJson(s) {\n\ttry {\n\t\treturn JSON.parse(s);\n\t} catch {}\n\tconst buffer = s.trim();\n\tif (buffer.length === 0) throw new Error(\"Unexpected end of JSON input\");\n\tlet pos = 0;\n\tfunction skipWhitespace() {\n\t\twhile (pos < buffer.length && /\\s/.test(buffer[pos])) pos += 1;\n\t}\n\tfunction parseString() {\n\t\tif (buffer[pos] !== \"\\\"\") throw new Error(`Expected '\"' at position ${pos}, got '${buffer[pos]}'`);\n\t\tpos += 1;\n\t\tlet result = \"\";\n\t\tlet escaped = false;\n\t\twhile (pos < buffer.length) {\n\t\t\tconst char = buffer[pos];\n\t\t\tif (escaped) {\n\t\t\t\tif (char === \"n\") result += \"\\n\";\n\t\t\t\telse if (char === \"t\") result += \"\t\";\n\t\t\t\telse if (char === \"r\") result += \"\\r\";\n\t\t\t\telse if (char === \"\\\\\") result += \"\\\\\";\n\t\t\t\telse if (char === \"\\\"\") result += \"\\\"\";\n\t\t\t\telse if (char === \"b\") result += \"\\b\";\n\t\t\t\telse if (char === \"f\") result += \"\\f\";\n\t\t\t\telse if (char === \"/\") result += \"/\";\n\t\t\t\telse if (char === \"u\") {\n\t\t\t\t\tconst hex = buffer.substring(pos + 1, pos + 5);\n\t\t\t\t\tif (/^[0-9A-Fa-f]{0,4}$/.test(hex)) {\n\t\t\t\t\t\tif (hex.length === 4) result += String.fromCharCode(Number.parseInt(hex, 16));\n\t\t\t\t\t\telse result += `u${hex}`;\n\t\t\t\t\t\tpos += hex.length;\n\t\t\t\t\t} else throw new Error(`Invalid unicode escape sequence '\\\\u${hex}' at position ${pos}`);\n\t\t\t\t} else throw new Error(`Invalid escape sequence '\\\\${char}' at position ${pos}`);\n\t\t\t\tescaped = false;\n\t\t\t} else if (char === \"\\\\\") escaped = true;\n\t\t\telse if (char === \"\\\"\") {\n\t\t\t\tpos += 1;\n\t\t\t\treturn result;\n\t\t\t} else result += char;\n\t\t\tpos += 1;\n\t\t}\n\t\tif (escaped) result += \"\\\\\";\n\t\treturn result;\n\t}\n\tfunction parseNumber() {\n\t\tconst start = pos;\n\t\tlet numStr = \"\";\n\t\tif (buffer[pos] === \"-\") {\n\t\t\tnumStr += \"-\";\n\t\t\tpos += 1;\n\t\t}\n\t\tif (pos < buffer.length && buffer[pos] === \"0\") {\n\t\t\tnumStr += \"0\";\n\t\t\tpos += 1;\n\t\t\tif (buffer[pos] >= \"0\" && buffer[pos] <= \"9\") throw new Error(`Invalid number at position ${start}`);\n\t\t}\n\t\tif (pos < buffer.length && buffer[pos] >= \"1\" && buffer[pos] <= \"9\") while (pos < buffer.length && buffer[pos] >= \"0\" && buffer[pos] <= \"9\") {\n\t\t\tnumStr += buffer[pos];\n\t\t\tpos += 1;\n\t\t}\n\t\tif (pos < buffer.length && buffer[pos] === \".\") {\n\t\t\tnumStr += \".\";\n\t\t\tpos += 1;\n\t\t\twhile (pos < buffer.length && buffer[pos] >= \"0\" && buffer[pos] <= \"9\") {\n\t\t\t\tnumStr += buffer[pos];\n\t\t\t\tpos += 1;\n\t\t\t}\n\t\t}\n\t\tif (pos < buffer.length && (buffer[pos] === \"e\" || buffer[pos] === \"E\")) {\n\t\t\tnumStr += buffer[pos];\n\t\t\tpos += 1;\n\t\t\tif (pos < buffer.length && (buffer[pos] === \"+\" || buffer[pos] === \"-\")) {\n\t\t\t\tnumStr += buffer[pos];\n\t\t\t\tpos += 1;\n\t\t\t}\n\t\t\twhile (pos < buffer.length && buffer[pos] >= \"0\" && buffer[pos] <= \"9\") {\n\t\t\t\tnumStr += buffer[pos];\n\t\t\t\tpos += 1;\n\t\t\t}\n\t\t}\n\t\tif (numStr === \"-\") return -0;\n\t\tconst num = Number.parseFloat(numStr);\n\t\tif (Number.isNaN(num)) {\n\t\t\tpos = start;\n\t\t\tthrow new Error(`Invalid number '${numStr}' at position ${start}`);\n\t\t}\n\t\treturn num;\n\t}\n\tfunction parseValue() {\n\t\tskipWhitespace();\n\t\tif (pos >= buffer.length) throw new Error(`Unexpected end of input at position ${pos}`);\n\t\tconst char = buffer[pos];\n\t\tif (char === \"{\") return parseObject();\n\t\tif (char === \"[\") return parseArray();\n\t\tif (char === \"\\\"\") return parseString();\n\t\tif (\"null\".startsWith(buffer.substring(pos, pos + 4))) {\n\t\t\tpos += Math.min(4, buffer.length - pos);\n\t\t\treturn null;\n\t\t}\n\t\tif (\"true\".startsWith(buffer.substring(pos, pos + 4))) {\n\t\t\tpos += Math.min(4, buffer.length - pos);\n\t\t\treturn true;\n\t\t}\n\t\tif (\"false\".startsWith(buffer.substring(pos, pos + 5))) {\n\t\t\tpos += Math.min(5, buffer.length - pos);\n\t\t\treturn false;\n\t\t}\n\t\tif (char === \"-\" || char >= \"0\" && char <= \"9\") return parseNumber();\n\t\tthrow new Error(`Unexpected character '${char}' at position ${pos}`);\n\t}\n\tfunction parseArray() {\n\t\tif (buffer[pos] !== \"[\") throw new Error(`Expected '[' at position ${pos}, got '${buffer[pos]}'`);\n\t\tconst arr = [];\n\t\tpos += 1;\n\t\tskipWhitespace();\n\t\tif (pos >= buffer.length) return arr;\n\t\tif (buffer[pos] === \"]\") {\n\t\t\tpos += 1;\n\t\t\treturn arr;\n\t\t}\n\t\twhile (pos < buffer.length) {\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return arr;\n\t\t\tarr.push(parseValue());\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return arr;\n\t\t\tif (buffer[pos] === \"]\") {\n\t\t\t\tpos += 1;\n\t\t\t\treturn arr;\n\t\t\t} else if (buffer[pos] === \",\") {\n\t\t\t\tpos += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow new Error(`Expected ',' or ']' at position ${pos}, got '${buffer[pos]}'`);\n\t\t}\n\t\treturn arr;\n\t}\n\tfunction parseObject() {\n\t\tif (buffer[pos] !== \"{\") throw new Error(`Expected '{' at position ${pos}, got '${buffer[pos]}'`);\n\t\tconst obj = {};\n\t\tpos += 1;\n\t\tskipWhitespace();\n\t\tif (pos >= buffer.length) return obj;\n\t\tif (buffer[pos] === \"}\") {\n\t\t\tpos += 1;\n\t\t\treturn obj;\n\t\t}\n\t\twhile (pos < buffer.length) {\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return obj;\n\t\t\tconst key = parseString();\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return obj;\n\t\t\tif (buffer[pos] !== \":\") throw new Error(`Expected ':' at position ${pos}, got '${buffer[pos]}'`);\n\t\t\tpos += 1;\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return obj;\n\t\t\tobj[key] = parseValue();\n\t\t\tskipWhitespace();\n\t\t\tif (pos >= buffer.length) return obj;\n\t\t\tif (buffer[pos] === \"}\") {\n\t\t\t\tpos += 1;\n\t\t\t\treturn obj;\n\t\t\t} else if (buffer[pos] === \",\") {\n\t\t\t\tpos += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow new Error(`Expected ',' or '}' at position ${pos}, got '${buffer[pos]}'`);\n\t\t}\n\t\treturn obj;\n\t}\n\tconst value = parseValue();\n\tskipWhitespace();\n\tif (pos < buffer.length) throw new Error(`Unexpected character '${buffer[pos]}' at position ${pos}`);\n\treturn value;\n}\nfunction parsePartialJson(s) {\n\ttry {\n\t\tif (typeof s === \"undefined\") return null;\n\t\treturn strictParsePartialJson(s);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n//#endregion\nexport { parseJsonMarkdown, parsePartialJson };\n//# sourceMappingURL=json.js.map"],"names":[],"mappings":"AAoBA,SAAS,uBAAuB,GAAG;AAClC,MAAI;AACH,WAAO,KAAK,MAAM,CAAC;AAAA,EACpB,QAAQ;AAAA,EAAC;AACT,QAAM,SAAS,EAAE,KAAI;AACrB,MAAI,OAAO,WAAW,EAAG,OAAM,IAAI,MAAM,8BAA8B;AACvE,MAAI,MAAM;AACV,WAAS,iBAAiB;AACzB,WAAO,MAAM,OAAO,UAAU,KAAK,KAAK,OAAO,GAAG,CAAC,EAAG,QAAO;AAAA,EAC9D;AACA,WAAS,cAAc;AACtB,QAAI,OAAO,GAAG,MAAM,IAAM,OAAM,IAAI,MAAM,4BAA4B,GAAG,UAAU,OAAO,GAAG,CAAC,GAAG;AACjG,WAAO;AACP,QAAI,SAAS;AACb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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,cAAc,CAAA,EAAI,QAAO,K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{ ChatAnthropicTranslator } from "./index.es58.js";
2
- import { ChatOpenAITranslator } from "./index.es60.js";
3
- import { ChatBedrockConverseTranslator } from "./index.es75.js";
4
- import { ChatDeepSeekTranslator } from "./index.es76.js";
5
- import { ChatGoogleGenAITranslator } from "./index.es77.js";
6
- import { ChatVertexTranslator } from "./index.es78.js";
7
- import { ChatGroqTranslator } from "./index.es79.js";
8
- import { ChatOllamaTranslator } from "./index.es80.js";
9
- import { ChatXAITranslator } from "./index.es81.js";
10
- globalThis.lc_block_translators_registry ??= /* @__PURE__ */ new Map([
11
- ["anthropic", ChatAnthropicTranslator],
12
- ["bedrock-converse", ChatBedrockConverseTranslator],
13
- ["deepseek", ChatDeepSeekTranslator],
14
- ["google-genai", ChatGoogleGenAITranslator],
15
- ["google-vertexai", ChatVertexTranslator],
16
- ["groq", ChatGroqTranslator],
17
- ["ollama", ChatOllamaTranslator],
18
- ["openai", ChatOpenAITranslator],
19
- ["xai", ChatXAITranslator]
20
- ]);
21
- function getTranslator(modelProvider) {
22
- return globalThis.lc_block_translators_registry.get(modelProvider);
1
+ function convertToFormattedString(message, format = "pretty") {
2
+ if (format === "pretty") return convertToPrettyString(message);
3
+ return JSON.stringify(message);
4
+ }
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
+ }
22
+ }
23
+ }
24
+ if (message.type === "tool") {
25
+ const toolMessage = message;
26
+ if (toolMessage.name) lines.push(`Name: ${toolMessage.name}`);
27
+ }
28
+ if (typeof message.content === "string" && message.content.trim()) {
29
+ if (lines.length > 1) lines.push("");
30
+ lines.push(message.content);
31
+ }
32
+ return lines.join("\n");
23
33
  }
24
34
  export {
25
- getTranslator
35
+ convertToFormattedString
26
36
  };
27
37
  //# sourceMappingURL=index.es65.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es65.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/index.js"],"sourcesContent":["import { ChatAnthropicTranslator } from \"./anthropic.js\";\nimport { ChatOpenAITranslator } from \"./openai.js\";\nimport { ChatBedrockConverseTranslator } from \"./bedrock_converse.js\";\nimport { ChatDeepSeekTranslator } from \"./deepseek.js\";\nimport { ChatGoogleGenAITranslator } from \"./google_genai.js\";\nimport { ChatVertexTranslator } from \"./google_vertexai.js\";\nimport { ChatGroqTranslator } from \"./groq.js\";\nimport { ChatOllamaTranslator } from \"./ollama.js\";\nimport { ChatXAITranslator } from \"./xai.js\";\n\n//#region src/messages/block_translators/index.ts\nglobalThis.lc_block_translators_registry ??= new Map([\n\t[\"anthropic\", ChatAnthropicTranslator],\n\t[\"bedrock-converse\", ChatBedrockConverseTranslator],\n\t[\"deepseek\", ChatDeepSeekTranslator],\n\t[\"google-genai\", ChatGoogleGenAITranslator],\n\t[\"google-vertexai\", ChatVertexTranslator],\n\t[\"groq\", ChatGroqTranslator],\n\t[\"ollama\", ChatOllamaTranslator],\n\t[\"openai\", ChatOpenAITranslator],\n\t[\"xai\", ChatXAITranslator]\n]);\nfunction getTranslator(modelProvider) {\n\treturn globalThis.lc_block_translators_registry.get(modelProvider);\n}\n\n//#endregion\nexport { getTranslator };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;;;;;AAWA,WAAW,kCAAkC,oBAAI,IAAI;AAAA,EACpD,CAAC,aAAa,uBAAuB;AAAA,EACrC,CAAC,oBAAoB,6BAA6B;AAAA,EAClD,CAAC,YAAY,sBAAsB;AAAA,EACnC,CAAC,gBAAgB,yBAAyB;AAAA,EAC1C,CAAC,mBAAmB,oBAAoB;AAAA,EACxC,CAAC,QAAQ,kBAAkB;AAAA,EAC3B,CAAC,UAAU,oBAAoB;AAAA,EAC/B,CAAC,UAAU,oBAAoB;AAAA,EAC/B,CAAC,OAAO,iBAAiB;AAC1B,CAAC;AACD,SAAS,cAAc,eAAe;AACrC,SAAO,WAAW,8BAA8B,IAAI,aAAa;AAClE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es65.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,SAAO,KAAK,UAAU,OAAO;AAC9B;AACA,SAAS,sBAAsB,SAAS;AACvC,QAAM,QAAQ,CAAA;AACd,QAAM,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,EAAE,YAAW,IAAK,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC9E,QAAM,SAAS,KAAK,OAAO,KAAK,MAAM,UAAU,CAAC;AACjD,QAAM,MAAM,IAAI,OAAO,MAAM;AAC7B,QAAM,YAAY,MAAM,SAAS,MAAM,IAAI,MAAM,GAAG,GAAG;AACvD,QAAM,KAAK,GAAG,GAAG,GAAG,KAAK,GAAG,SAAS,EAAE;AACvC,MAAI,QAAQ,SAAS,MAAM;AAC1B,UAAM,YAAY;AAClB,QAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;AAC5D,YAAM,KAAK,aAAa;AACxB,iBAAW,MAAM,UAAU,YAAY;AACtC,cAAM,KAAK,KAAK,GAAG,IAAI,KAAK,GAAG,EAAE,GAAG;AACpC,cAAM,KAAK,aAAa,GAAG,EAAE,EAAE;AAC/B,cAAM,KAAK,SAAS;AACpB,mBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,IAAI,EAAG,OAAM,KAAK,OAAO,GAAG,KAAK,OAAO,UAAU,WAAW,KAAK,UAAU,KAAK,IAAI,KAAK,EAAE;AAAA,MAC1I;AAAA,IACD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