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,283 +1,504 @@
1
- import { __export } from "./index.es46.js";
2
- import { _deepClone, PatchError, unescapePathComponent, isInteger, hasUndefined } from "./index.es135.js";
3
- var core_exports = {};
4
- __export(core_exports, {
5
- JsonPatchError: () => JsonPatchError,
6
- _areEquals: () => _areEquals,
7
- applyOperation: () => applyOperation,
8
- applyPatch: () => applyPatch,
9
- applyReducer: () => applyReducer,
10
- deepClone: () => deepClone,
11
- getValueByPointer: () => getValueByPointer,
12
- validate: () => validate,
13
- validator: () => validator
1
+ import { __export } from "./index.es50.js";
2
+ import { getBufferString } from "./index.es42.js";
3
+ import { getEnvironmentVariable } from "./index.es133.js";
4
+ import { isBaseCallbackHandler, BaseCallbackHandler } from "./index.es134.js";
5
+ import { isBaseTracer } from "./index.es118.js";
6
+ import { ConsoleCallbackHandler } from "./index.es135.js";
7
+ import { LangChainTracer } from "./index.es136.js";
8
+ import { consumeCallback } from "./index.es137.js";
9
+ import "./index.es138.js";
10
+ import { isTracingEnabled } from "./index.es139.js";
11
+ import { _getConfigureHooks, getContextVariable } from "./index.es140.js";
12
+ import { v7 } from "uuid";
13
+ var manager_exports = {};
14
+ __export(manager_exports, {
15
+ BaseCallbackManager: () => BaseCallbackManager,
16
+ BaseRunManager: () => BaseRunManager,
17
+ CallbackManager: () => CallbackManager,
18
+ CallbackManagerForChainRun: () => CallbackManagerForChainRun,
19
+ CallbackManagerForLLMRun: () => CallbackManagerForLLMRun,
20
+ CallbackManagerForRetrieverRun: () => CallbackManagerForRetrieverRun,
21
+ CallbackManagerForToolRun: () => CallbackManagerForToolRun,
22
+ ensureHandler: () => ensureHandler,
23
+ parseCallbackConfigArg: () => parseCallbackConfigArg
14
24
  });
15
- const JsonPatchError = PatchError;
16
- const deepClone = _deepClone;
17
- function isDangerousKey(key) {
18
- return Object.getOwnPropertyNames(Object.prototype).includes(key);
25
+ function parseCallbackConfigArg(arg) {
26
+ if (!arg) return {};
27
+ else if (Array.isArray(arg) || "name" in arg) return { callbacks: arg };
28
+ else return arg;
19
29
  }
20
- const objOps = {
21
- add: function(obj, key, document) {
22
- if (isDangerousKey(key)) throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
23
- obj[key] = this.value;
24
- return { newDocument: document };
25
- },
26
- remove: function(obj, key, document) {
27
- if (isDangerousKey(key)) throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
28
- var removed = obj[key];
29
- delete obj[key];
30
- return {
31
- newDocument: document,
32
- removed
33
- };
34
- },
35
- replace: function(obj, key, document) {
36
- if (isDangerousKey(key)) throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
37
- var removed = obj[key];
38
- obj[key] = this.value;
39
- return {
40
- newDocument: document,
41
- removed
42
- };
43
- },
44
- move: function(obj, key, document) {
45
- let removed = getValueByPointer(document, this.path);
46
- if (removed) removed = _deepClone(removed);
47
- const originalValue = applyOperation(document, {
48
- op: "remove",
49
- path: this.from
50
- }).removed;
51
- applyOperation(document, {
52
- op: "add",
53
- path: this.path,
54
- value: originalValue
55
- });
56
- return {
57
- newDocument: document,
58
- removed
59
- };
60
- },
61
- copy: function(obj, key, document) {
62
- const valueToCopy = getValueByPointer(document, this.from);
63
- applyOperation(document, {
64
- op: "add",
65
- path: this.path,
66
- value: _deepClone(valueToCopy)
67
- });
68
- return { newDocument: document };
69
- },
70
- test: function(obj, key, document) {
71
- return {
72
- newDocument: document,
73
- test: _areEquals(obj[key], this.value)
74
- };
75
- },
76
- _get: function(obj, key, document) {
77
- this.value = obj[key];
78
- return { newDocument: document };
30
+ var BaseCallbackManager = class {
31
+ setHandler(handler) {
32
+ return this.setHandlers([handler]);
79
33
  }
80
34
  };
81
- var arrOps = {
82
- add: function(arr, i, document) {
83
- if (isInteger(i)) arr.splice(i, 0, this.value);
84
- else arr[i] = this.value;
85
- return {
86
- newDocument: document,
87
- index: i
88
- };
89
- },
90
- remove: function(arr, i, document) {
91
- var removedList = arr.splice(i, 1);
92
- return {
93
- newDocument: document,
94
- removed: removedList[0]
95
- };
96
- },
97
- replace: function(arr, i, document) {
98
- var removed = arr[i];
99
- arr[i] = this.value;
100
- return {
101
- newDocument: document,
102
- removed
103
- };
104
- },
105
- move: objOps.move,
106
- copy: objOps.copy,
107
- test: objOps.test,
108
- _get: objOps._get
35
+ var BaseRunManager = class {
36
+ constructor(runId, handlers, inheritableHandlers, tags, inheritableTags, metadata, inheritableMetadata, _parentRunId) {
37
+ this.runId = runId;
38
+ this.handlers = handlers;
39
+ this.inheritableHandlers = inheritableHandlers;
40
+ this.tags = tags;
41
+ this.inheritableTags = inheritableTags;
42
+ this.metadata = metadata;
43
+ this.inheritableMetadata = inheritableMetadata;
44
+ this._parentRunId = _parentRunId;
45
+ }
46
+ get parentRunId() {
47
+ return this._parentRunId;
48
+ }
49
+ async handleText(text) {
50
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
51
+ try {
52
+ await handler.handleText?.(text, this.runId, this._parentRunId, this.tags);
53
+ } catch (err) {
54
+ const logFunction = handler.raiseError ? console.error : console.warn;
55
+ logFunction(`Error in handler ${handler.constructor.name}, handleText: ${err}`);
56
+ if (handler.raiseError) throw err;
57
+ }
58
+ }, handler.awaitHandlers)));
59
+ }
60
+ async handleCustomEvent(eventName, data, _runId, _tags, _metadata) {
61
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
62
+ try {
63
+ await handler.handleCustomEvent?.(eventName, data, this.runId, this.tags, this.metadata);
64
+ } catch (err) {
65
+ const logFunction = handler.raiseError ? console.error : console.warn;
66
+ logFunction(`Error in handler ${handler.constructor.name}, handleCustomEvent: ${err}`);
67
+ if (handler.raiseError) throw err;
68
+ }
69
+ }, handler.awaitHandlers)));
70
+ }
109
71
  };
110
- function getValueByPointer(document, pointer) {
111
- if (pointer == "") return document;
112
- var getOriginalDestination = {
113
- op: "_get",
114
- path: pointer
115
- };
116
- applyOperation(document, getOriginalDestination);
117
- return getOriginalDestination.value;
118
- }
119
- function applyOperation(document, operation, validateOperation = false, mutateDocument = true, banPrototypeModifications = true, index = 0) {
120
- if (validateOperation) if (typeof validateOperation == "function") validateOperation(operation, 0, document, operation.path);
121
- else validator(operation, 0);
122
- if (operation.path === "") {
123
- let returnValue = { newDocument: document };
124
- if (operation.op === "add") {
125
- returnValue.newDocument = operation.value;
126
- return returnValue;
127
- } else if (operation.op === "replace") {
128
- returnValue.newDocument = operation.value;
129
- returnValue.removed = document;
130
- return returnValue;
131
- } else if (operation.op === "move" || operation.op === "copy") {
132
- returnValue.newDocument = getValueByPointer(document, operation.from);
133
- if (operation.op === "move") returnValue.removed = document;
134
- return returnValue;
135
- } else if (operation.op === "test") {
136
- returnValue.test = _areEquals(document, operation.value);
137
- if (returnValue.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index, operation, document);
138
- returnValue.newDocument = document;
139
- return returnValue;
140
- } else if (operation.op === "remove") {
141
- returnValue.removed = document;
142
- returnValue.newDocument = null;
143
- return returnValue;
144
- } else if (operation.op === "_get") {
145
- operation.value = document;
146
- return returnValue;
147
- } else if (validateOperation) throw new JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", index, operation, document);
148
- else return returnValue;
149
- } else {
150
- if (!mutateDocument) document = _deepClone(document);
151
- const path = operation.path || "";
152
- const keys = path.split("/");
153
- let obj = document;
154
- let t = 1;
155
- let len = keys.length;
156
- let existingPathFragment = void 0;
157
- let key;
158
- let validateFunction;
159
- if (typeof validateOperation == "function") validateFunction = validateOperation;
160
- else validateFunction = validator;
161
- while (true) {
162
- key = keys[t];
163
- if (key && key.indexOf("~") != -1) key = unescapePathComponent(key);
164
- if (banPrototypeModifications && (key == "__proto__" || key == "prototype" && t > 0 && keys[t - 1] == "constructor")) throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");
165
- if (validateOperation) {
166
- if (existingPathFragment === void 0) {
167
- if (obj[key] === void 0) existingPathFragment = keys.slice(0, t).join("/");
168
- else if (t == len - 1) existingPathFragment = operation.path;
169
- if (existingPathFragment !== void 0) validateFunction(operation, 0, document, existingPathFragment);
170
- }
72
+ var CallbackManagerForRetrieverRun = class extends BaseRunManager {
73
+ getChild(tag) {
74
+ const manager = new CallbackManager(this.runId);
75
+ manager.setHandlers(this.inheritableHandlers);
76
+ manager.addTags(this.inheritableTags);
77
+ manager.addMetadata(this.inheritableMetadata);
78
+ if (tag) manager.addTags([tag], false);
79
+ return manager;
80
+ }
81
+ async handleRetrieverEnd(documents) {
82
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
83
+ if (!handler.ignoreRetriever) try {
84
+ await handler.handleRetrieverEnd?.(documents, this.runId, this._parentRunId, this.tags);
85
+ } catch (err) {
86
+ const logFunction = handler.raiseError ? console.error : console.warn;
87
+ logFunction(`Error in handler ${handler.constructor.name}, handleRetriever`);
88
+ if (handler.raiseError) throw err;
89
+ }
90
+ }, handler.awaitHandlers)));
91
+ }
92
+ async handleRetrieverError(err) {
93
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
94
+ if (!handler.ignoreRetriever) try {
95
+ await handler.handleRetrieverError?.(err, this.runId, this._parentRunId, this.tags);
96
+ } catch (error) {
97
+ const logFunction = handler.raiseError ? console.error : console.warn;
98
+ logFunction(`Error in handler ${handler.constructor.name}, handleRetrieverError: ${error}`);
99
+ if (handler.raiseError) throw err;
100
+ }
101
+ }, handler.awaitHandlers)));
102
+ }
103
+ };
104
+ var CallbackManagerForLLMRun = class extends BaseRunManager {
105
+ async handleLLMNewToken(token, idx, _runId, _parentRunId, _tags, fields) {
106
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
107
+ if (!handler.ignoreLLM) try {
108
+ await handler.handleLLMNewToken?.(token, idx ?? {
109
+ prompt: 0,
110
+ completion: 0
111
+ }, this.runId, this._parentRunId, this.tags, fields);
112
+ } catch (err) {
113
+ const logFunction = handler.raiseError ? console.error : console.warn;
114
+ logFunction(`Error in handler ${handler.constructor.name}, handleLLMNewToken: ${err}`);
115
+ if (handler.raiseError) throw err;
171
116
  }
172
- t++;
173
- if (Array.isArray(obj)) {
174
- if (key === "-") key = obj.length;
175
- else if (validateOperation && !isInteger(key)) throw new JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document);
176
- else if (isInteger(key)) key = ~~key;
177
- if (t >= len) {
178
- if (validateOperation && operation.op === "add" && key > obj.length) throw new JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index, operation, document);
179
- const returnValue = arrOps[operation.op].call(operation, obj, key, document);
180
- if (returnValue.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index, operation, document);
181
- return returnValue;
117
+ }, handler.awaitHandlers)));
118
+ }
119
+ async handleLLMError(err, _runId, _parentRunId, _tags, extraParams) {
120
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
121
+ if (!handler.ignoreLLM) try {
122
+ await handler.handleLLMError?.(err, this.runId, this._parentRunId, this.tags, extraParams);
123
+ } catch (err$1) {
124
+ const logFunction = handler.raiseError ? console.error : console.warn;
125
+ logFunction(`Error in handler ${handler.constructor.name}, handleLLMError: ${err$1}`);
126
+ if (handler.raiseError) throw err$1;
127
+ }
128
+ }, handler.awaitHandlers)));
129
+ }
130
+ async handleLLMEnd(output, _runId, _parentRunId, _tags, extraParams) {
131
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
132
+ if (!handler.ignoreLLM) try {
133
+ await handler.handleLLMEnd?.(output, this.runId, this._parentRunId, this.tags, extraParams);
134
+ } catch (err) {
135
+ const logFunction = handler.raiseError ? console.error : console.warn;
136
+ logFunction(`Error in handler ${handler.constructor.name}, handleLLMEnd: ${err}`);
137
+ if (handler.raiseError) throw err;
138
+ }
139
+ }, handler.awaitHandlers)));
140
+ }
141
+ };
142
+ var CallbackManagerForChainRun = class extends BaseRunManager {
143
+ getChild(tag) {
144
+ const manager = new CallbackManager(this.runId);
145
+ manager.setHandlers(this.inheritableHandlers);
146
+ manager.addTags(this.inheritableTags);
147
+ manager.addMetadata(this.inheritableMetadata);
148
+ if (tag) manager.addTags([tag], false);
149
+ return manager;
150
+ }
151
+ async handleChainError(err, _runId, _parentRunId, _tags, kwargs) {
152
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
153
+ if (!handler.ignoreChain) try {
154
+ await handler.handleChainError?.(err, this.runId, this._parentRunId, this.tags, kwargs);
155
+ } catch (err$1) {
156
+ const logFunction = handler.raiseError ? console.error : console.warn;
157
+ logFunction(`Error in handler ${handler.constructor.name}, handleChainError: ${err$1}`);
158
+ if (handler.raiseError) throw err$1;
159
+ }
160
+ }, handler.awaitHandlers)));
161
+ }
162
+ async handleChainEnd(output, _runId, _parentRunId, _tags, kwargs) {
163
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
164
+ if (!handler.ignoreChain) try {
165
+ await handler.handleChainEnd?.(output, this.runId, this._parentRunId, this.tags, kwargs);
166
+ } catch (err) {
167
+ const logFunction = handler.raiseError ? console.error : console.warn;
168
+ logFunction(`Error in handler ${handler.constructor.name}, handleChainEnd: ${err}`);
169
+ if (handler.raiseError) throw err;
170
+ }
171
+ }, handler.awaitHandlers)));
172
+ }
173
+ async handleAgentAction(action) {
174
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
175
+ if (!handler.ignoreAgent) try {
176
+ await handler.handleAgentAction?.(action, this.runId, this._parentRunId, this.tags);
177
+ } catch (err) {
178
+ const logFunction = handler.raiseError ? console.error : console.warn;
179
+ logFunction(`Error in handler ${handler.constructor.name}, handleAgentAction: ${err}`);
180
+ if (handler.raiseError) throw err;
181
+ }
182
+ }, handler.awaitHandlers)));
183
+ }
184
+ async handleAgentEnd(action) {
185
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
186
+ if (!handler.ignoreAgent) try {
187
+ await handler.handleAgentEnd?.(action, this.runId, this._parentRunId, this.tags);
188
+ } catch (err) {
189
+ const logFunction = handler.raiseError ? console.error : console.warn;
190
+ logFunction(`Error in handler ${handler.constructor.name}, handleAgentEnd: ${err}`);
191
+ if (handler.raiseError) throw err;
192
+ }
193
+ }, handler.awaitHandlers)));
194
+ }
195
+ };
196
+ var CallbackManagerForToolRun = class extends BaseRunManager {
197
+ getChild(tag) {
198
+ const manager = new CallbackManager(this.runId);
199
+ manager.setHandlers(this.inheritableHandlers);
200
+ manager.addTags(this.inheritableTags);
201
+ manager.addMetadata(this.inheritableMetadata);
202
+ if (tag) manager.addTags([tag], false);
203
+ return manager;
204
+ }
205
+ async handleToolError(err) {
206
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
207
+ if (!handler.ignoreAgent) try {
208
+ await handler.handleToolError?.(err, this.runId, this._parentRunId, this.tags);
209
+ } catch (err$1) {
210
+ const logFunction = handler.raiseError ? console.error : console.warn;
211
+ logFunction(`Error in handler ${handler.constructor.name}, handleToolError: ${err$1}`);
212
+ if (handler.raiseError) throw err$1;
213
+ }
214
+ }, handler.awaitHandlers)));
215
+ }
216
+ async handleToolEnd(output) {
217
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
218
+ if (!handler.ignoreAgent) try {
219
+ await handler.handleToolEnd?.(output, this.runId, this._parentRunId, this.tags);
220
+ } catch (err) {
221
+ const logFunction = handler.raiseError ? console.error : console.warn;
222
+ logFunction(`Error in handler ${handler.constructor.name}, handleToolEnd: ${err}`);
223
+ if (handler.raiseError) throw err;
224
+ }
225
+ }, handler.awaitHandlers)));
226
+ }
227
+ };
228
+ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
229
+ handlers = [];
230
+ inheritableHandlers = [];
231
+ tags = [];
232
+ inheritableTags = [];
233
+ metadata = {};
234
+ inheritableMetadata = {};
235
+ name = "callback_manager";
236
+ _parentRunId;
237
+ constructor(parentRunId, options) {
238
+ super();
239
+ this.handlers = options?.handlers ?? this.handlers;
240
+ this.inheritableHandlers = options?.inheritableHandlers ?? this.inheritableHandlers;
241
+ this.tags = options?.tags ?? this.tags;
242
+ this.inheritableTags = options?.inheritableTags ?? this.inheritableTags;
243
+ this.metadata = options?.metadata ?? this.metadata;
244
+ this.inheritableMetadata = options?.inheritableMetadata ?? this.inheritableMetadata;
245
+ this._parentRunId = parentRunId;
246
+ }
247
+ /**
248
+ * Gets the parent run ID, if any.
249
+ *
250
+ * @returns The parent run ID.
251
+ */
252
+ getParentRunId() {
253
+ return this._parentRunId;
254
+ }
255
+ async handleLLMStart(llm, prompts, runId = void 0, _parentRunId = void 0, extraParams = void 0, _tags = void 0, _metadata = void 0, runName = void 0) {
256
+ return Promise.all(prompts.map(async (prompt, idx) => {
257
+ const runId_ = idx === 0 && runId ? runId : v7();
258
+ await Promise.all(this.handlers.map((handler) => {
259
+ if (handler.ignoreLLM) return;
260
+ if (isBaseTracer(handler)) handler._createRunForLLMStart(llm, [prompt], runId_, this._parentRunId, extraParams, this.tags, this.metadata, runName);
261
+ return consumeCallback(async () => {
262
+ try {
263
+ await handler.handleLLMStart?.(llm, [prompt], runId_, this._parentRunId, extraParams, this.tags, this.metadata, runName);
264
+ } catch (err) {
265
+ const logFunction = handler.raiseError ? console.error : console.warn;
266
+ logFunction(`Error in handler ${handler.constructor.name}, handleLLMStart: ${err}`);
267
+ if (handler.raiseError) throw err;
268
+ }
269
+ }, handler.awaitHandlers);
270
+ }));
271
+ return new CallbackManagerForLLMRun(runId_, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
272
+ }));
273
+ }
274
+ async handleChatModelStart(llm, messages, runId = void 0, _parentRunId = void 0, extraParams = void 0, _tags = void 0, _metadata = void 0, runName = void 0) {
275
+ return Promise.all(messages.map(async (messageGroup, idx) => {
276
+ const runId_ = idx === 0 && runId ? runId : v7();
277
+ await Promise.all(this.handlers.map((handler) => {
278
+ if (handler.ignoreLLM) return;
279
+ if (isBaseTracer(handler)) handler._createRunForChatModelStart(llm, [messageGroup], runId_, this._parentRunId, extraParams, this.tags, this.metadata, runName);
280
+ return consumeCallback(async () => {
281
+ try {
282
+ if (handler.handleChatModelStart) await handler.handleChatModelStart?.(llm, [messageGroup], runId_, this._parentRunId, extraParams, this.tags, this.metadata, runName);
283
+ else if (handler.handleLLMStart) {
284
+ const messageString = getBufferString(messageGroup);
285
+ await handler.handleLLMStart?.(llm, [messageString], runId_, this._parentRunId, extraParams, this.tags, this.metadata, runName);
286
+ }
287
+ } catch (err) {
288
+ const logFunction = handler.raiseError ? console.error : console.warn;
289
+ logFunction(`Error in handler ${handler.constructor.name}, handleLLMStart: ${err}`);
290
+ if (handler.raiseError) throw err;
291
+ }
292
+ }, handler.awaitHandlers);
293
+ }));
294
+ return new CallbackManagerForLLMRun(runId_, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
295
+ }));
296
+ }
297
+ async handleChainStart(chain, inputs, runId = v7(), runType = void 0, _tags = void 0, _metadata = void 0, runName = void 0, _parentRunId = void 0, extra = void 0) {
298
+ await Promise.all(this.handlers.map((handler) => {
299
+ if (handler.ignoreChain) return;
300
+ if (isBaseTracer(handler)) handler._createRunForChainStart(chain, inputs, runId, this._parentRunId, this.tags, this.metadata, runType, runName, extra);
301
+ return consumeCallback(async () => {
302
+ try {
303
+ await handler.handleChainStart?.(chain, inputs, runId, this._parentRunId, this.tags, this.metadata, runType, runName, extra);
304
+ } catch (err) {
305
+ const logFunction = handler.raiseError ? console.error : console.warn;
306
+ logFunction(`Error in handler ${handler.constructor.name}, handleChainStart: ${err}`);
307
+ if (handler.raiseError) throw err;
182
308
  }
183
- } else if (t >= len) {
184
- const returnValue = objOps[operation.op].call(operation, obj, key, document);
185
- if (returnValue.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index, operation, document);
186
- return returnValue;
309
+ }, handler.awaitHandlers);
310
+ }));
311
+ return new CallbackManagerForChainRun(runId, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
312
+ }
313
+ async handleToolStart(tool, input, runId = v7(), _parentRunId = void 0, _tags = void 0, _metadata = void 0, runName = void 0) {
314
+ await Promise.all(this.handlers.map((handler) => {
315
+ if (handler.ignoreAgent) return;
316
+ if (isBaseTracer(handler)) handler._createRunForToolStart(tool, input, runId, this._parentRunId, this.tags, this.metadata, runName);
317
+ return consumeCallback(async () => {
318
+ try {
319
+ await handler.handleToolStart?.(tool, input, runId, this._parentRunId, this.tags, this.metadata, runName);
320
+ } catch (err) {
321
+ const logFunction = handler.raiseError ? console.error : console.warn;
322
+ logFunction(`Error in handler ${handler.constructor.name}, handleToolStart: ${err}`);
323
+ if (handler.raiseError) throw err;
324
+ }
325
+ }, handler.awaitHandlers);
326
+ }));
327
+ return new CallbackManagerForToolRun(runId, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
328
+ }
329
+ async handleRetrieverStart(retriever, query, runId = v7(), _parentRunId = void 0, _tags = void 0, _metadata = void 0, runName = void 0) {
330
+ await Promise.all(this.handlers.map((handler) => {
331
+ if (handler.ignoreRetriever) return;
332
+ if (isBaseTracer(handler)) handler._createRunForRetrieverStart(retriever, query, runId, this._parentRunId, this.tags, this.metadata, runName);
333
+ return consumeCallback(async () => {
334
+ try {
335
+ await handler.handleRetrieverStart?.(retriever, query, runId, this._parentRunId, this.tags, this.metadata, runName);
336
+ } catch (err) {
337
+ const logFunction = handler.raiseError ? console.error : console.warn;
338
+ logFunction(`Error in handler ${handler.constructor.name}, handleRetrieverStart: ${err}`);
339
+ if (handler.raiseError) throw err;
340
+ }
341
+ }, handler.awaitHandlers);
342
+ }));
343
+ return new CallbackManagerForRetrieverRun(runId, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
344
+ }
345
+ async handleCustomEvent(eventName, data, runId, _tags, _metadata) {
346
+ await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
347
+ if (!handler.ignoreCustomEvent) try {
348
+ await handler.handleCustomEvent?.(eventName, data, runId, this.tags, this.metadata);
349
+ } catch (err) {
350
+ const logFunction = handler.raiseError ? console.error : console.warn;
351
+ logFunction(`Error in handler ${handler.constructor.name}, handleCustomEvent: ${err}`);
352
+ if (handler.raiseError) throw err;
187
353
  }
188
- obj = obj[key];
189
- if (validateOperation && t < len && (!obj || typeof obj !== "object")) throw new JsonPatchError("Cannot perform operation at the desired path", "OPERATION_PATH_UNRESOLVABLE", index, operation, document);
354
+ }, handler.awaitHandlers)));
355
+ }
356
+ addHandler(handler, inherit = true) {
357
+ this.handlers.push(handler);
358
+ if (inherit) this.inheritableHandlers.push(handler);
359
+ }
360
+ removeHandler(handler) {
361
+ this.handlers = this.handlers.filter((_handler) => _handler !== handler);
362
+ this.inheritableHandlers = this.inheritableHandlers.filter((_handler) => _handler !== handler);
363
+ }
364
+ setHandlers(handlers, inherit = true) {
365
+ this.handlers = [];
366
+ this.inheritableHandlers = [];
367
+ for (const handler of handlers) this.addHandler(handler, inherit);
368
+ }
369
+ addTags(tags, inherit = true) {
370
+ this.removeTags(tags);
371
+ this.tags.push(...tags);
372
+ if (inherit) this.inheritableTags.push(...tags);
373
+ }
374
+ removeTags(tags) {
375
+ this.tags = this.tags.filter((tag) => !tags.includes(tag));
376
+ this.inheritableTags = this.inheritableTags.filter((tag) => !tags.includes(tag));
377
+ }
378
+ addMetadata(metadata, inherit = true) {
379
+ this.metadata = {
380
+ ...this.metadata,
381
+ ...metadata
382
+ };
383
+ if (inherit) this.inheritableMetadata = {
384
+ ...this.inheritableMetadata,
385
+ ...metadata
386
+ };
387
+ }
388
+ removeMetadata(metadata) {
389
+ for (const key of Object.keys(metadata)) {
390
+ delete this.metadata[key];
391
+ delete this.inheritableMetadata[key];
190
392
  }
191
393
  }
192
- }
193
- function applyPatch(document, patch, validateOperation, mutateDocument = true, banPrototypeModifications = true) {
194
- if (validateOperation) {
195
- if (!Array.isArray(patch)) throw new JsonPatchError("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
196
- }
197
- if (!mutateDocument) document = _deepClone(document);
198
- const results = new Array(patch.length);
199
- for (let i = 0, length = patch.length; i < length; i++) {
200
- results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);
201
- document = results[i].newDocument;
202
- }
203
- results.newDocument = document;
204
- return results;
205
- }
206
- function applyReducer(document, operation, index) {
207
- const operationResult = applyOperation(document, operation);
208
- if (operationResult.test === false) throw new JsonPatchError("Test operation failed", "TEST_OPERATION_FAILED", index, operation, document);
209
- return operationResult.newDocument;
210
- }
211
- function validator(operation, index, document, existingPathFragment) {
212
- if (typeof operation !== "object" || operation === null || Array.isArray(operation)) throw new JsonPatchError("Operation is not an object", "OPERATION_NOT_AN_OBJECT", index, operation, document);
213
- else if (!objOps[operation.op]) throw new JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902", "OPERATION_OP_INVALID", index, operation, document);
214
- else if (typeof operation.path !== "string") throw new JsonPatchError("Operation `path` property is not a string", "OPERATION_PATH_INVALID", index, operation, document);
215
- else if (operation.path.indexOf("/") !== 0 && operation.path.length > 0) throw new JsonPatchError('Operation `path` property must start with "/"', "OPERATION_PATH_INVALID", index, operation, document);
216
- else if ((operation.op === "move" || operation.op === "copy") && typeof operation.from !== "string") throw new JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)", "OPERATION_FROM_REQUIRED", index, operation, document);
217
- else if ((operation.op === "add" || operation.op === "replace" || operation.op === "test") && operation.value === void 0) throw new JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_REQUIRED", index, operation, document);
218
- else if ((operation.op === "add" || operation.op === "replace" || operation.op === "test") && hasUndefined(operation.value)) throw new JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)", "OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED", index, operation, document);
219
- else if (document) {
220
- if (operation.op == "add") {
221
- var pathLen = operation.path.split("/").length;
222
- var existingPathLen = existingPathFragment.split("/").length;
223
- if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) throw new JsonPatchError("Cannot perform an `add` operation at the desired path", "OPERATION_PATH_CANNOT_ADD", index, operation, document);
224
- } else if (operation.op === "replace" || operation.op === "remove" || operation.op === "_get") {
225
- if (operation.path !== existingPathFragment) throw new JsonPatchError("Cannot perform the operation at a path that does not exist", "OPERATION_PATH_UNRESOLVABLE", index, operation, document);
226
- } else if (operation.op === "move" || operation.op === "copy") {
227
- var existingValue = {
228
- op: "_get",
229
- path: operation.from,
230
- value: void 0
231
- };
232
- var error = validate([existingValue], document);
233
- if (error && error.name === "OPERATION_PATH_UNRESOLVABLE") throw new JsonPatchError("Cannot perform the operation from a path that does not exist", "OPERATION_FROM_UNRESOLVABLE", index, operation, document);
394
+ copy(additionalHandlers = [], inherit = true) {
395
+ const manager = new CallbackManager2(this._parentRunId);
396
+ for (const handler of this.handlers) {
397
+ const inheritable = this.inheritableHandlers.includes(handler);
398
+ manager.addHandler(handler, inheritable);
399
+ }
400
+ for (const tag of this.tags) {
401
+ const inheritable = this.inheritableTags.includes(tag);
402
+ manager.addTags([tag], inheritable);
403
+ }
404
+ for (const key of Object.keys(this.metadata)) {
405
+ const inheritable = Object.keys(this.inheritableMetadata).includes(key);
406
+ manager.addMetadata({ [key]: this.metadata[key] }, inheritable);
234
407
  }
408
+ for (const handler of additionalHandlers) {
409
+ if (manager.handlers.filter((h) => h.name === "console_callback_handler").some((h) => h.name === handler.name)) continue;
410
+ manager.addHandler(handler, inherit);
411
+ }
412
+ return manager;
235
413
  }
236
- }
237
- function validate(sequence, document, externalValidator) {
238
- try {
239
- if (!Array.isArray(sequence)) throw new JsonPatchError("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
240
- if (document) applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);
241
- else {
242
- externalValidator = externalValidator || validator;
243
- for (var i = 0; i < sequence.length; i++) externalValidator(sequence[i], i, document, void 0);
414
+ static fromHandlers(handlers) {
415
+ class Handler extends BaseCallbackHandler {
416
+ name = v7();
417
+ constructor() {
418
+ super();
419
+ Object.assign(this, handlers);
420
+ }
244
421
  }
245
- } catch (e) {
246
- if (e instanceof JsonPatchError) return e;
247
- else throw e;
422
+ const manager = new this();
423
+ manager.addHandler(new Handler());
424
+ return manager;
248
425
  }
249
- }
250
- function _areEquals(a, b) {
251
- if (a === b) return true;
252
- if (a && b && typeof a == "object" && typeof b == "object") {
253
- var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;
254
- if (arrA && arrB) {
255
- length = a.length;
256
- if (length != b.length) return false;
257
- for (i = length; i-- !== 0; ) if (!_areEquals(a[i], b[i])) return false;
258
- return true;
426
+ static configure(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
427
+ return this._configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options);
428
+ }
429
+ static _configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
430
+ let callbackManager;
431
+ if (inheritableHandlers || localHandlers) {
432
+ if (Array.isArray(inheritableHandlers) || !inheritableHandlers) {
433
+ callbackManager = new CallbackManager2();
434
+ callbackManager.setHandlers(inheritableHandlers?.map(ensureHandler) ?? [], true);
435
+ } else callbackManager = inheritableHandlers;
436
+ callbackManager = callbackManager.copy(Array.isArray(localHandlers) ? localHandlers.map(ensureHandler) : localHandlers?.handlers, false);
437
+ }
438
+ const verboseEnabled = getEnvironmentVariable("LANGCHAIN_VERBOSE") === "true" || options?.verbose;
439
+ const tracingV2Enabled = LangChainTracer.getTraceableRunTree()?.tracingEnabled || isTracingEnabled();
440
+ const tracingEnabled = tracingV2Enabled || (getEnvironmentVariable("LANGCHAIN_TRACING") ?? false);
441
+ if (verboseEnabled || tracingEnabled) {
442
+ if (!callbackManager) callbackManager = new CallbackManager2();
443
+ if (verboseEnabled && !callbackManager.handlers.some((handler) => handler.name === ConsoleCallbackHandler.prototype.name)) {
444
+ const consoleHandler = new ConsoleCallbackHandler();
445
+ callbackManager.addHandler(consoleHandler, true);
446
+ }
447
+ if (tracingEnabled && !callbackManager.handlers.some((handler) => handler.name === "langchain_tracer")) {
448
+ if (tracingV2Enabled) {
449
+ const tracerV2 = new LangChainTracer();
450
+ callbackManager.addHandler(tracerV2, true);
451
+ }
452
+ }
453
+ if (tracingV2Enabled) {
454
+ const implicitRunTree = LangChainTracer.getTraceableRunTree();
455
+ if (implicitRunTree && callbackManager._parentRunId === void 0) {
456
+ callbackManager._parentRunId = implicitRunTree.id;
457
+ const tracerV2 = callbackManager.handlers.find((handler) => handler.name === "langchain_tracer");
458
+ tracerV2?.updateFromRunTree(implicitRunTree);
459
+ }
460
+ }
461
+ }
462
+ for (const { contextVar, inheritable = true, handlerClass, envVar } of _getConfigureHooks()) {
463
+ const createIfNotInContext = envVar && getEnvironmentVariable(envVar) === "true" && handlerClass;
464
+ let handler;
465
+ const contextVarValue = contextVar !== void 0 ? getContextVariable(contextVar) : void 0;
466
+ if (contextVarValue && isBaseCallbackHandler(contextVarValue)) handler = contextVarValue;
467
+ else if (createIfNotInContext) handler = new handlerClass({});
468
+ if (handler !== void 0) {
469
+ if (!callbackManager) callbackManager = new CallbackManager2();
470
+ if (!callbackManager.handlers.some((h) => h.name === handler.name)) callbackManager.addHandler(handler, inheritable);
471
+ }
259
472
  }
260
- if (arrA != arrB) return false;
261
- var keys = Object.keys(a);
262
- length = keys.length;
263
- if (length !== Object.keys(b).length) return false;
264
- for (i = length; i-- !== 0; ) if (!b.hasOwnProperty(keys[i])) return false;
265
- for (i = length; i-- !== 0; ) {
266
- key = keys[i];
267
- if (!_areEquals(a[key], b[key])) return false;
473
+ if (inheritableTags || localTags) {
474
+ if (callbackManager) {
475
+ callbackManager.addTags(inheritableTags ?? []);
476
+ callbackManager.addTags(localTags ?? [], false);
477
+ }
268
478
  }
269
- return true;
479
+ if (inheritableMetadata || localMetadata) {
480
+ if (callbackManager) {
481
+ callbackManager.addMetadata(inheritableMetadata ?? {});
482
+ callbackManager.addMetadata(localMetadata ?? {}, false);
483
+ }
484
+ }
485
+ return callbackManager;
270
486
  }
271
- return a !== a && b !== b;
487
+ };
488
+ function ensureHandler(handler) {
489
+ if ("name" in handler) return handler;
490
+ return BaseCallbackHandler.fromMethods(handler);
272
491
  }
273
492
  export {
274
- _areEquals,
275
- applyOperation,
276
- applyPatch,
277
- applyReducer,
278
- core_exports,
279
- getValueByPointer,
280
- validate,
281
- validator
493
+ BaseCallbackManager,
494
+ BaseRunManager,
495
+ CallbackManager,
496
+ CallbackManagerForChainRun,
497
+ CallbackManagerForLLMRun,
498
+ CallbackManagerForRetrieverRun,
499
+ CallbackManagerForToolRun,
500
+ ensureHandler,
501
+ manager_exports,
502
+ parseCallbackConfigArg
282
503
  };
283
504
  //# sourceMappingURL=index.es111.js.map