langgraph-ui-components 0.0.1 → 0.0.2

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 (532) hide show
  1. package/dist/index.es.js +9 -27085
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.es10.js +21 -0
  4. package/dist/index.es10.js.map +1 -0
  5. package/dist/index.es100.js +43 -0
  6. package/dist/index.es100.js.map +1 -0
  7. package/dist/index.es101.js +94 -0
  8. package/dist/index.es101.js.map +1 -0
  9. package/dist/index.es102.js +5 -0
  10. package/dist/index.es102.js.map +1 -0
  11. package/dist/index.es103.js +5 -0
  12. package/dist/index.es103.js.map +1 -0
  13. package/dist/index.es104.js +25 -0
  14. package/dist/index.es104.js.map +1 -0
  15. package/dist/index.es105.js +5 -0
  16. package/dist/index.es105.js.map +1 -0
  17. package/dist/index.es106.js +28 -0
  18. package/dist/index.es106.js.map +1 -0
  19. package/dist/index.es107.js +8 -0
  20. package/dist/index.es107.js.map +1 -0
  21. package/dist/index.es108.js +3 -0
  22. package/dist/index.es108.js.map +1 -0
  23. package/dist/index.es109.js +14 -0
  24. package/dist/index.es109.js.map +1 -0
  25. package/dist/index.es11.js +125 -0
  26. package/dist/index.es11.js.map +1 -0
  27. package/dist/index.es110.js +504 -0
  28. package/dist/index.es110.js.map +1 -0
  29. package/dist/index.es111.js +3 -0
  30. package/dist/index.es111.js.map +1 -0
  31. package/dist/index.es112.js +149 -0
  32. package/dist/index.es112.js.map +1 -0
  33. package/dist/index.es113.js +889 -0
  34. package/dist/index.es113.js.map +1 -0
  35. package/dist/index.es114.js +283 -0
  36. package/dist/index.es114.js.map +1 -0
  37. package/dist/index.es115.js +5 -0
  38. package/dist/index.es115.js.map +1 -0
  39. package/dist/index.es116.js +447 -0
  40. package/dist/index.es116.js.map +1 -0
  41. package/dist/index.es117.js +49 -0
  42. package/dist/index.es117.js.map +1 -0
  43. package/dist/index.es118.js +25 -0
  44. package/dist/index.es118.js.map +1 -0
  45. package/dist/index.es119.js +82 -0
  46. package/dist/index.es119.js.map +1 -0
  47. package/dist/index.es12.js +104 -0
  48. package/dist/index.es12.js.map +1 -0
  49. package/dist/index.es120.js +132 -0
  50. package/dist/index.es120.js.map +1 -0
  51. package/dist/index.es121.js +52 -0
  52. package/dist/index.es121.js.map +1 -0
  53. package/dist/index.es122.js +13 -0
  54. package/dist/index.es122.js.map +1 -0
  55. package/dist/index.es123.js +48 -0
  56. package/dist/index.es123.js.map +1 -0
  57. package/dist/index.es124.js +102 -0
  58. package/dist/index.es124.js.map +1 -0
  59. package/dist/index.es125.js +56 -0
  60. package/dist/index.es125.js.map +1 -0
  61. package/dist/index.es126.js +5 -0
  62. package/dist/index.es126.js.map +1 -0
  63. package/dist/index.es127.js +140 -0
  64. package/dist/index.es127.js.map +1 -0
  65. package/dist/index.es128.js +5 -0
  66. package/dist/index.es128.js.map +1 -0
  67. package/dist/index.es129.js +18 -0
  68. package/dist/index.es129.js.map +1 -0
  69. package/dist/index.es13.js +37 -0
  70. package/dist/index.es13.js.map +1 -0
  71. package/dist/index.es130.js +92 -0
  72. package/dist/index.es130.js.map +1 -0
  73. package/dist/index.es131.js +5 -0
  74. package/dist/index.es131.js.map +1 -0
  75. package/dist/index.es132.js +59 -0
  76. package/dist/index.es132.js.map +1 -0
  77. package/dist/index.es133.js +103 -0
  78. package/dist/index.es133.js.map +1 -0
  79. package/dist/index.es134.js +194 -0
  80. package/dist/index.es134.js.map +1 -0
  81. package/dist/index.es135.js +113 -0
  82. package/dist/index.es135.js.map +1 -0
  83. package/dist/index.es136.js +38 -0
  84. package/dist/index.es136.js.map +1 -0
  85. package/dist/index.es137.js +13 -0
  86. package/dist/index.es137.js.map +1 -0
  87. package/dist/index.es138.js +14 -0
  88. package/dist/index.es138.js.map +1 -0
  89. package/dist/index.es139.js +15 -0
  90. package/dist/index.es139.js.map +1 -0
  91. package/dist/index.es14.js +148 -0
  92. package/dist/index.es14.js.map +1 -0
  93. package/dist/index.es140.js +94 -0
  94. package/dist/index.es140.js.map +1 -0
  95. package/dist/index.es141.js +38 -0
  96. package/dist/index.es141.js.map +1 -0
  97. package/dist/index.es142.js +43 -0
  98. package/dist/index.es142.js.map +1 -0
  99. package/dist/index.es143.js +27 -0
  100. package/dist/index.es143.js.map +1 -0
  101. package/dist/index.es144.js +594 -0
  102. package/dist/index.es144.js.map +1 -0
  103. package/dist/index.es145.js +128 -0
  104. package/dist/index.es145.js.map +1 -0
  105. package/dist/index.es146.js +7 -0
  106. package/dist/index.es146.js.map +1 -0
  107. package/dist/index.es147.js +8 -0
  108. package/dist/index.es147.js.map +1 -0
  109. package/dist/index.es148.js +16 -0
  110. package/dist/index.es148.js.map +1 -0
  111. package/dist/index.es149.js +9 -0
  112. package/dist/index.es149.js.map +1 -0
  113. package/dist/index.es15.js +15 -0
  114. package/dist/index.es15.js.map +1 -0
  115. package/dist/index.es150.js +11 -0
  116. package/dist/index.es150.js.map +1 -0
  117. package/dist/index.es151.js +28 -0
  118. package/dist/index.es151.js.map +1 -0
  119. package/dist/index.es152.js +15 -0
  120. package/dist/index.es152.js.map +1 -0
  121. package/dist/index.es153.js +57 -0
  122. package/dist/index.es153.js.map +1 -0
  123. package/dist/index.es154.js +67 -0
  124. package/dist/index.es154.js.map +1 -0
  125. package/dist/index.es155.js +25 -0
  126. package/dist/index.es155.js.map +1 -0
  127. package/dist/index.es156.js +9 -0
  128. package/dist/index.es156.js.map +1 -0
  129. package/dist/index.es157.js +352 -0
  130. package/dist/index.es157.js.map +1 -0
  131. package/dist/index.es158.js +10 -0
  132. package/dist/index.es158.js.map +1 -0
  133. package/dist/index.es159.js +106 -0
  134. package/dist/index.es159.js.map +1 -0
  135. package/dist/index.es16.js +8 -0
  136. package/dist/index.es16.js.map +1 -0
  137. package/dist/index.es160.js +122 -0
  138. package/dist/index.es160.js.map +1 -0
  139. package/dist/index.es161.js +139 -0
  140. package/dist/index.es161.js.map +1 -0
  141. package/dist/index.es162.js +118 -0
  142. package/dist/index.es162.js.map +1 -0
  143. package/dist/index.es163.js +9 -0
  144. package/dist/index.es163.js.map +1 -0
  145. package/dist/index.es164.js +145 -0
  146. package/dist/index.es164.js.map +1 -0
  147. package/dist/index.es165.js +5 -0
  148. package/dist/index.es165.js.map +1 -0
  149. package/dist/index.es166.js +3685 -0
  150. package/dist/index.es166.js.map +1 -0
  151. package/dist/index.es167.js +345 -0
  152. package/dist/index.es167.js.map +1 -0
  153. package/dist/index.es168.js +112 -0
  154. package/dist/index.es168.js.map +1 -0
  155. package/dist/index.es169.js +136 -0
  156. package/dist/index.es169.js.map +1 -0
  157. package/dist/index.es17.js +36 -0
  158. package/dist/index.es17.js.map +1 -0
  159. package/dist/index.es170.js +18 -0
  160. package/dist/index.es170.js.map +1 -0
  161. package/dist/index.es171.js +155 -0
  162. package/dist/index.es171.js.map +1 -0
  163. package/dist/index.es172.js +18 -0
  164. package/dist/index.es172.js.map +1 -0
  165. package/dist/index.es173.js +11 -0
  166. package/dist/index.es173.js.map +1 -0
  167. package/dist/index.es174.js +24 -0
  168. package/dist/index.es174.js.map +1 -0
  169. package/dist/index.es175.js +93 -0
  170. package/dist/index.es175.js.map +1 -0
  171. package/dist/index.es176.js +27 -0
  172. package/dist/index.es176.js.map +1 -0
  173. package/dist/index.es177.js +9 -0
  174. package/dist/index.es177.js.map +1 -0
  175. package/dist/index.es178.js +7 -0
  176. package/dist/index.es178.js.map +1 -0
  177. package/dist/index.es179.js +21 -0
  178. package/dist/index.es179.js.map +1 -0
  179. package/dist/index.es18.js +126 -0
  180. package/dist/index.es18.js.map +1 -0
  181. package/dist/index.es180.js +35 -0
  182. package/dist/index.es180.js.map +1 -0
  183. package/dist/index.es181.js +9 -0
  184. package/dist/index.es181.js.map +1 -0
  185. package/dist/index.es182.js +109 -0
  186. package/dist/index.es182.js.map +1 -0
  187. package/dist/index.es183.js +16 -0
  188. package/dist/index.es183.js.map +1 -0
  189. package/dist/index.es184.js +21 -0
  190. package/dist/index.es184.js.map +1 -0
  191. package/dist/index.es185.js +34 -0
  192. package/dist/index.es185.js.map +1 -0
  193. package/dist/index.es186.js +7 -0
  194. package/dist/index.es186.js.map +1 -0
  195. package/dist/index.es187.js +8 -0
  196. package/dist/index.es187.js.map +1 -0
  197. package/dist/index.es188.js +8 -0
  198. package/dist/index.es188.js.map +1 -0
  199. package/dist/index.es189.js +40 -0
  200. package/dist/index.es189.js.map +1 -0
  201. package/dist/index.es19.js +41 -0
  202. package/dist/index.es19.js.map +1 -0
  203. package/dist/index.es190.js +11 -0
  204. package/dist/index.es190.js.map +1 -0
  205. package/dist/index.es191.js +9 -0
  206. package/dist/index.es191.js.map +1 -0
  207. package/dist/index.es192.js +10 -0
  208. package/dist/index.es192.js.map +1 -0
  209. package/dist/index.es193.js +45 -0
  210. package/dist/index.es193.js.map +1 -0
  211. package/dist/index.es194.js +16 -0
  212. package/dist/index.es194.js.map +1 -0
  213. package/dist/index.es195.js +245 -0
  214. package/dist/index.es195.js.map +1 -0
  215. package/dist/index.es196.js +54 -0
  216. package/dist/index.es196.js.map +1 -0
  217. package/dist/index.es197.js +38 -0
  218. package/dist/index.es197.js.map +1 -0
  219. package/dist/index.es198.js +16 -0
  220. package/dist/index.es198.js.map +1 -0
  221. package/dist/index.es199.js +11 -0
  222. package/dist/index.es199.js.map +1 -0
  223. package/dist/index.es2.js +142 -0
  224. package/dist/index.es2.js.map +1 -0
  225. package/dist/index.es20.js +46 -0
  226. package/dist/index.es20.js.map +1 -0
  227. package/dist/index.es200.js +10 -0
  228. package/dist/index.es200.js.map +1 -0
  229. package/dist/index.es201.js +68 -0
  230. package/dist/index.es201.js.map +1 -0
  231. package/dist/index.es202.js +44 -0
  232. package/dist/index.es202.js.map +1 -0
  233. package/dist/index.es203.js +35 -0
  234. package/dist/index.es203.js.map +1 -0
  235. package/dist/index.es204.js +65 -0
  236. package/dist/index.es204.js.map +1 -0
  237. package/dist/index.es205.js +18 -0
  238. package/dist/index.es205.js.map +1 -0
  239. package/dist/index.es206.js +26 -0
  240. package/dist/index.es206.js.map +1 -0
  241. package/dist/index.es207.js +8 -0
  242. package/dist/index.es207.js.map +1 -0
  243. package/dist/index.es208.js +20 -0
  244. package/dist/index.es208.js.map +1 -0
  245. package/dist/index.es209.js +36 -0
  246. package/dist/index.es209.js.map +1 -0
  247. package/dist/index.es21.js +21 -0
  248. package/dist/index.es21.js.map +1 -0
  249. package/dist/index.es210.js +8 -0
  250. package/dist/index.es210.js.map +1 -0
  251. package/dist/index.es211.js +8 -0
  252. package/dist/index.es211.js.map +1 -0
  253. package/dist/index.es212.js +8 -0
  254. package/dist/index.es212.js.map +1 -0
  255. package/dist/index.es213.js +11 -0
  256. package/dist/index.es213.js.map +1 -0
  257. package/dist/index.es214.js +95 -0
  258. package/dist/index.es214.js.map +1 -0
  259. package/dist/index.es215.js +21 -0
  260. package/dist/index.es215.js.map +1 -0
  261. package/dist/index.es216.js +765 -0
  262. package/dist/index.es216.js.map +1 -0
  263. package/dist/index.es217.js +69 -0
  264. package/dist/index.es217.js.map +1 -0
  265. package/dist/index.es218.js +177 -0
  266. package/dist/index.es218.js.map +1 -0
  267. package/dist/index.es219.js +41 -0
  268. package/dist/index.es219.js.map +1 -0
  269. package/dist/index.es22.js +76 -0
  270. package/dist/index.es22.js.map +1 -0
  271. package/dist/index.es220.js +140 -0
  272. package/dist/index.es220.js.map +1 -0
  273. package/dist/index.es221.js +96 -0
  274. package/dist/index.es221.js.map +1 -0
  275. package/dist/index.es222.js +36 -0
  276. package/dist/index.es222.js.map +1 -0
  277. package/dist/index.es223.js +288 -0
  278. package/dist/index.es223.js.map +1 -0
  279. package/dist/index.es224.js +29 -0
  280. package/dist/index.es224.js.map +1 -0
  281. package/dist/index.es225.js +27 -0
  282. package/dist/index.es225.js.map +1 -0
  283. package/dist/index.es226.js +18 -0
  284. package/dist/index.es226.js.map +1 -0
  285. package/dist/index.es227.js +18 -0
  286. package/dist/index.es227.js.map +1 -0
  287. package/dist/index.es228.js +29 -0
  288. package/dist/index.es228.js.map +1 -0
  289. package/dist/index.es229.js +49 -0
  290. package/dist/index.es229.js.map +1 -0
  291. package/dist/index.es23.js +34 -0
  292. package/dist/index.es23.js.map +1 -0
  293. package/dist/index.es230.js +15 -0
  294. package/dist/index.es230.js.map +1 -0
  295. package/dist/index.es231.js +15 -0
  296. package/dist/index.es231.js.map +1 -0
  297. package/dist/index.es232.js +15 -0
  298. package/dist/index.es232.js.map +1 -0
  299. package/dist/index.es233.js +18 -0
  300. package/dist/index.es233.js.map +1 -0
  301. package/dist/index.es234.js +15 -0
  302. package/dist/index.es234.js.map +1 -0
  303. package/dist/index.es235.js +15 -0
  304. package/dist/index.es235.js.map +1 -0
  305. package/dist/index.es236.js +15 -0
  306. package/dist/index.es236.js.map +1 -0
  307. package/dist/index.es237.js +19 -0
  308. package/dist/index.es237.js.map +1 -0
  309. package/dist/index.es238.js +15 -0
  310. package/dist/index.es238.js.map +1 -0
  311. package/dist/index.es239.js +15 -0
  312. package/dist/index.es239.js.map +1 -0
  313. package/dist/index.es24.js +97 -0
  314. package/dist/index.es24.js.map +1 -0
  315. package/dist/index.es240.js +15 -0
  316. package/dist/index.es240.js.map +1 -0
  317. package/dist/index.es241.js +15 -0
  318. package/dist/index.es241.js.map +1 -0
  319. package/dist/index.es242.js +15 -0
  320. package/dist/index.es242.js.map +1 -0
  321. package/dist/index.es243.js +15 -0
  322. package/dist/index.es243.js.map +1 -0
  323. package/dist/index.es244.js +15 -0
  324. package/dist/index.es244.js.map +1 -0
  325. package/dist/index.es245.js +15 -0
  326. package/dist/index.es245.js.map +1 -0
  327. package/dist/index.es246.js +60 -0
  328. package/dist/index.es246.js.map +1 -0
  329. package/dist/index.es247.js +53 -0
  330. package/dist/index.es247.js.map +1 -0
  331. package/dist/index.es248.js +123 -0
  332. package/dist/index.es248.js.map +1 -0
  333. package/dist/index.es249.js +388 -0
  334. package/dist/index.es249.js.map +1 -0
  335. package/dist/index.es25.js +74 -0
  336. package/dist/index.es25.js.map +1 -0
  337. package/dist/index.es250.js +22 -0
  338. package/dist/index.es250.js.map +1 -0
  339. package/dist/index.es251.js +15 -0
  340. package/dist/index.es251.js.map +1 -0
  341. package/dist/index.es252.js +35 -0
  342. package/dist/index.es252.js.map +1 -0
  343. package/dist/index.es253.js +35 -0
  344. package/dist/index.es253.js.map +1 -0
  345. package/dist/index.es254.js +66 -0
  346. package/dist/index.es254.js.map +1 -0
  347. package/dist/index.es255.js +21 -0
  348. package/dist/index.es255.js.map +1 -0
  349. package/dist/index.es256.js +81 -0
  350. package/dist/index.es256.js.map +1 -0
  351. package/dist/index.es257.js +15 -0
  352. package/dist/index.es257.js.map +1 -0
  353. package/dist/index.es258.js +15 -0
  354. package/dist/index.es258.js.map +1 -0
  355. package/dist/index.es259.js +19 -0
  356. package/dist/index.es259.js.map +1 -0
  357. package/dist/index.es26.js +180 -0
  358. package/dist/index.es26.js.map +1 -0
  359. package/dist/index.es260.js +56 -0
  360. package/dist/index.es260.js.map +1 -0
  361. package/dist/index.es261.js +170 -0
  362. package/dist/index.es261.js.map +1 -0
  363. package/dist/index.es262.js +5 -0
  364. package/dist/index.es262.js.map +1 -0
  365. package/dist/index.es263.js +14 -0
  366. package/dist/index.es263.js.map +1 -0
  367. package/dist/index.es264.js +23 -0
  368. package/dist/index.es264.js.map +1 -0
  369. package/dist/index.es265.js +42 -0
  370. package/dist/index.es265.js.map +1 -0
  371. package/dist/index.es27.js +16 -0
  372. package/dist/index.es27.js.map +1 -0
  373. package/dist/index.es28.js +441 -0
  374. package/dist/index.es28.js.map +1 -0
  375. package/dist/index.es29.js +122 -0
  376. package/dist/index.es29.js.map +1 -0
  377. package/dist/index.es3.js +30 -0
  378. package/dist/index.es3.js.map +1 -0
  379. package/dist/index.es30.js +77 -0
  380. package/dist/index.es30.js.map +1 -0
  381. package/dist/index.es31.js +15 -0
  382. package/dist/index.es31.js.map +1 -0
  383. package/dist/index.es32.js +262 -0
  384. package/dist/index.es32.js.map +1 -0
  385. package/dist/index.es33.js +47 -0
  386. package/dist/index.es33.js.map +1 -0
  387. package/dist/index.es34.js +215 -0
  388. package/dist/index.es34.js.map +1 -0
  389. package/dist/index.es35.js +71 -0
  390. package/dist/index.es35.js.map +1 -0
  391. package/dist/index.es36.js +146 -0
  392. package/dist/index.es36.js.map +1 -0
  393. package/dist/index.es37.js +28 -0
  394. package/dist/index.es37.js.map +1 -0
  395. package/dist/index.es38.js +228 -0
  396. package/dist/index.es38.js.map +1 -0
  397. package/dist/index.es39.js +13 -0
  398. package/dist/index.es39.js.map +1 -0
  399. package/dist/index.es4.js +30 -0
  400. package/dist/index.es4.js.map +1 -0
  401. package/dist/index.es40.js +1203 -0
  402. package/dist/index.es40.js.map +1 -0
  403. package/dist/index.es41.js +12 -0
  404. package/dist/index.es41.js.map +1 -0
  405. package/dist/index.es42.js +151 -0
  406. package/dist/index.es42.js.map +1 -0
  407. package/dist/index.es43.js +18 -0
  408. package/dist/index.es43.js.map +1 -0
  409. package/dist/index.es44.js +11 -0
  410. package/dist/index.es44.js.map +1 -0
  411. package/dist/index.es45.js +97 -0
  412. package/dist/index.es45.js.map +1 -0
  413. package/dist/index.es46.js +7 -0
  414. package/dist/index.es46.js.map +1 -0
  415. package/dist/index.es47.js +39 -0
  416. package/dist/index.es47.js.map +1 -0
  417. package/dist/index.es48.js +75 -0
  418. package/dist/index.es48.js.map +1 -0
  419. package/dist/index.es49.js +41 -0
  420. package/dist/index.es49.js.map +1 -0
  421. package/dist/index.es5.js +26 -0
  422. package/dist/index.es5.js.map +1 -0
  423. package/dist/index.es50.js +309 -0
  424. package/dist/index.es50.js.map +1 -0
  425. package/dist/index.es51.js +12 -0
  426. package/dist/index.es51.js.map +1 -0
  427. package/dist/index.es52.js +88 -0
  428. package/dist/index.es52.js.map +1 -0
  429. package/dist/index.es53.js +11 -0
  430. package/dist/index.es53.js.map +1 -0
  431. package/dist/index.es54.js +18 -0
  432. package/dist/index.es54.js.map +1 -0
  433. package/dist/index.es55.js +144 -0
  434. package/dist/index.es55.js.map +1 -0
  435. package/dist/index.es56.js +303 -0
  436. package/dist/index.es56.js.map +1 -0
  437. package/dist/index.es57.js +69 -0
  438. package/dist/index.es57.js.map +1 -0
  439. package/dist/index.es58.js +216 -0
  440. package/dist/index.es58.js.map +1 -0
  441. package/dist/index.es59.js +37 -0
  442. package/dist/index.es59.js.map +1 -0
  443. package/dist/index.es6.js +122 -0
  444. package/dist/index.es6.js.map +1 -0
  445. package/dist/index.es60.js +12 -0
  446. package/dist/index.es60.js.map +1 -0
  447. package/dist/index.es61.js +15 -0
  448. package/dist/index.es61.js.map +1 -0
  449. package/dist/index.es62.js +190 -0
  450. package/dist/index.es62.js.map +1 -0
  451. package/dist/index.es63.js +19 -0
  452. package/dist/index.es63.js.map +1 -0
  453. package/dist/index.es64.js +1403 -0
  454. package/dist/index.es64.js.map +1 -0
  455. package/dist/index.es65.js +12 -0
  456. package/dist/index.es65.js.map +1 -0
  457. package/dist/index.es66.js +11 -0
  458. package/dist/index.es66.js.map +1 -0
  459. package/dist/index.es67.js +9 -0
  460. package/dist/index.es67.js.map +1 -0
  461. package/dist/index.es68.js +8 -0
  462. package/dist/index.es68.js.map +1 -0
  463. package/dist/index.es69.js +8 -0
  464. package/dist/index.es69.js.map +1 -0
  465. package/dist/index.es7.js +19 -0
  466. package/dist/index.es7.js.map +1 -0
  467. package/dist/index.es70.js +15 -0
  468. package/dist/index.es70.js.map +1 -0
  469. package/dist/index.es71.js +26 -0
  470. package/dist/index.es71.js.map +1 -0
  471. package/dist/index.es72.js +37 -0
  472. package/dist/index.es72.js.map +1 -0
  473. package/dist/index.es73.js +235 -0
  474. package/dist/index.es73.js.map +1 -0
  475. package/dist/index.es74.js +71 -0
  476. package/dist/index.es74.js.map +1 -0
  477. package/dist/index.es75.js +72 -0
  478. package/dist/index.es75.js.map +1 -0
  479. package/dist/index.es76.js +60 -0
  480. package/dist/index.es76.js.map +1 -0
  481. package/dist/index.es77.js +16 -0
  482. package/dist/index.es77.js.map +1 -0
  483. package/dist/index.es78.js +140 -0
  484. package/dist/index.es78.js.map +1 -0
  485. package/dist/index.es79.js +24 -0
  486. package/dist/index.es79.js.map +1 -0
  487. package/dist/index.es8.js +61 -0
  488. package/dist/index.es8.js.map +1 -0
  489. package/dist/index.es80.js +185 -0
  490. package/dist/index.es80.js.map +1 -0
  491. package/dist/index.es81.js +244 -0
  492. package/dist/index.es81.js.map +1 -0
  493. package/dist/index.es82.js +358 -0
  494. package/dist/index.es82.js.map +1 -0
  495. package/dist/index.es83.js +140 -0
  496. package/dist/index.es83.js.map +1 -0
  497. package/dist/index.es84.js +73 -0
  498. package/dist/index.es84.js.map +1 -0
  499. package/dist/index.es85.js +40 -0
  500. package/dist/index.es85.js.map +1 -0
  501. package/dist/index.es86.js +40 -0
  502. package/dist/index.es86.js.map +1 -0
  503. package/dist/index.es87.js +169 -0
  504. package/dist/index.es87.js.map +1 -0
  505. package/dist/index.es88.js +206 -0
  506. package/dist/index.es88.js.map +1 -0
  507. package/dist/index.es89.js +17 -0
  508. package/dist/index.es89.js.map +1 -0
  509. package/dist/index.es9.js +109 -0
  510. package/dist/index.es9.js.map +1 -0
  511. package/dist/index.es90.js +33 -0
  512. package/dist/index.es90.js.map +1 -0
  513. package/dist/index.es91.js +37 -0
  514. package/dist/index.es91.js.map +1 -0
  515. package/dist/index.es92.js +3160 -0
  516. package/dist/index.es92.js.map +1 -0
  517. package/dist/index.es93.js +84 -0
  518. package/dist/index.es93.js.map +1 -0
  519. package/dist/index.es94.js +5 -0
  520. package/dist/index.es94.js.map +1 -0
  521. package/dist/index.es95.js +13 -0
  522. package/dist/index.es95.js.map +1 -0
  523. package/dist/index.es96.js +278 -0
  524. package/dist/index.es96.js.map +1 -0
  525. package/dist/index.es97.js +5 -0
  526. package/dist/index.es97.js.map +1 -0
  527. package/dist/index.es98.js +167 -0
  528. package/dist/index.es98.js.map +1 -0
  529. package/dist/index.es99.js +54 -0
  530. package/dist/index.es99.js.map +1 -0
  531. package/dist/styles.css +1 -1
  532. package/package.json +12 -10
@@ -0,0 +1,889 @@
1
+ import { Client } from "./index.es166.js";
2
+ import { isTracingEnabled } from "./index.es177.js";
3
+ import { isConflictingEndpointsError, ConflictingEndpointsError } from "./index.es175.js";
4
+ import { _LC_CONTEXT_VARIABLES_KEY, _REPLICA_TRACE_ROOTS_KEY } from "./index.es178.js";
5
+ import { getContextVar, setContextVar } from "./index.es179.js";
6
+ import { getEnvironmentVariable, getRuntimeEnvironment, getLangSmithEnvironmentVariable } from "./index.es171.js";
7
+ import { getDefaultProjectName } from "./index.es149.js";
8
+ import { warnOnce } from "./index.es173.js";
9
+ import { uuid7FromTime } from "./index.es172.js";
10
+ import { v5 } from "uuid";
11
+ const UUID_NAMESPACE_DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
12
+ function getReplicaKey(replica) {
13
+ const sortedKeys = Object.keys(replica).sort();
14
+ const keyData = sortedKeys.map((key) => `${key}:${replica[key] ?? ""}`).join("|");
15
+ return v5(keyData, UUID_NAMESPACE_DNS);
16
+ }
17
+ function stripNonAlphanumeric(input) {
18
+ return input.replace(/[-:.]/g, "");
19
+ }
20
+ function getMicrosecondPrecisionDatestring(epoch, executionOrder = 1) {
21
+ const paddedOrder = executionOrder.toFixed(0).slice(0, 3).padStart(3, "0");
22
+ return `${new Date(epoch).toISOString().slice(0, -1)}${paddedOrder}Z`;
23
+ }
24
+ function convertToDottedOrderFormat(epoch, runId, executionOrder = 1) {
25
+ const microsecondPrecisionDatestring = getMicrosecondPrecisionDatestring(epoch, executionOrder);
26
+ return {
27
+ dottedOrder: stripNonAlphanumeric(microsecondPrecisionDatestring) + runId,
28
+ microsecondPrecisionDatestring
29
+ };
30
+ }
31
+ class Baggage {
32
+ constructor(metadata, tags, project_name, replicas) {
33
+ Object.defineProperty(this, "metadata", {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value: void 0
38
+ });
39
+ Object.defineProperty(this, "tags", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: void 0
44
+ });
45
+ Object.defineProperty(this, "project_name", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: void 0
50
+ });
51
+ Object.defineProperty(this, "replicas", {
52
+ enumerable: true,
53
+ configurable: true,
54
+ writable: true,
55
+ value: void 0
56
+ });
57
+ this.metadata = metadata;
58
+ this.tags = tags;
59
+ this.project_name = project_name;
60
+ this.replicas = replicas;
61
+ }
62
+ static fromHeader(value) {
63
+ const items = value.split(",");
64
+ let metadata = {};
65
+ let tags = [];
66
+ let project_name;
67
+ let replicas;
68
+ for (const item of items) {
69
+ const [key, uriValue] = item.split("=");
70
+ const value2 = decodeURIComponent(uriValue);
71
+ if (key === "langsmith-metadata") {
72
+ metadata = JSON.parse(value2);
73
+ } else if (key === "langsmith-tags") {
74
+ tags = value2.split(",");
75
+ } else if (key === "langsmith-project") {
76
+ project_name = value2;
77
+ } else if (key === "langsmith-replicas") {
78
+ replicas = JSON.parse(value2);
79
+ }
80
+ }
81
+ return new Baggage(metadata, tags, project_name, replicas);
82
+ }
83
+ toHeader() {
84
+ const items = [];
85
+ if (this.metadata && Object.keys(this.metadata).length > 0) {
86
+ items.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`);
87
+ }
88
+ if (this.tags && this.tags.length > 0) {
89
+ items.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`);
90
+ }
91
+ if (this.project_name) {
92
+ items.push(`langsmith-project=${encodeURIComponent(this.project_name)}`);
93
+ }
94
+ return items.join(",");
95
+ }
96
+ }
97
+ class RunTree {
98
+ constructor(originalConfig) {
99
+ Object.defineProperty(this, "id", {
100
+ enumerable: true,
101
+ configurable: true,
102
+ writable: true,
103
+ value: void 0
104
+ });
105
+ Object.defineProperty(this, "name", {
106
+ enumerable: true,
107
+ configurable: true,
108
+ writable: true,
109
+ value: void 0
110
+ });
111
+ Object.defineProperty(this, "run_type", {
112
+ enumerable: true,
113
+ configurable: true,
114
+ writable: true,
115
+ value: void 0
116
+ });
117
+ Object.defineProperty(this, "project_name", {
118
+ enumerable: true,
119
+ configurable: true,
120
+ writable: true,
121
+ value: void 0
122
+ });
123
+ Object.defineProperty(this, "parent_run", {
124
+ enumerable: true,
125
+ configurable: true,
126
+ writable: true,
127
+ value: void 0
128
+ });
129
+ Object.defineProperty(this, "parent_run_id", {
130
+ enumerable: true,
131
+ configurable: true,
132
+ writable: true,
133
+ value: void 0
134
+ });
135
+ Object.defineProperty(this, "child_runs", {
136
+ enumerable: true,
137
+ configurable: true,
138
+ writable: true,
139
+ value: void 0
140
+ });
141
+ Object.defineProperty(this, "start_time", {
142
+ enumerable: true,
143
+ configurable: true,
144
+ writable: true,
145
+ value: void 0
146
+ });
147
+ Object.defineProperty(this, "end_time", {
148
+ enumerable: true,
149
+ configurable: true,
150
+ writable: true,
151
+ value: void 0
152
+ });
153
+ Object.defineProperty(this, "extra", {
154
+ enumerable: true,
155
+ configurable: true,
156
+ writable: true,
157
+ value: void 0
158
+ });
159
+ Object.defineProperty(this, "tags", {
160
+ enumerable: true,
161
+ configurable: true,
162
+ writable: true,
163
+ value: void 0
164
+ });
165
+ Object.defineProperty(this, "error", {
166
+ enumerable: true,
167
+ configurable: true,
168
+ writable: true,
169
+ value: void 0
170
+ });
171
+ Object.defineProperty(this, "serialized", {
172
+ enumerable: true,
173
+ configurable: true,
174
+ writable: true,
175
+ value: void 0
176
+ });
177
+ Object.defineProperty(this, "inputs", {
178
+ enumerable: true,
179
+ configurable: true,
180
+ writable: true,
181
+ value: void 0
182
+ });
183
+ Object.defineProperty(this, "outputs", {
184
+ enumerable: true,
185
+ configurable: true,
186
+ writable: true,
187
+ value: void 0
188
+ });
189
+ Object.defineProperty(this, "reference_example_id", {
190
+ enumerable: true,
191
+ configurable: true,
192
+ writable: true,
193
+ value: void 0
194
+ });
195
+ Object.defineProperty(this, "client", {
196
+ enumerable: true,
197
+ configurable: true,
198
+ writable: true,
199
+ value: void 0
200
+ });
201
+ Object.defineProperty(this, "events", {
202
+ enumerable: true,
203
+ configurable: true,
204
+ writable: true,
205
+ value: void 0
206
+ });
207
+ Object.defineProperty(this, "trace_id", {
208
+ enumerable: true,
209
+ configurable: true,
210
+ writable: true,
211
+ value: void 0
212
+ });
213
+ Object.defineProperty(this, "dotted_order", {
214
+ enumerable: true,
215
+ configurable: true,
216
+ writable: true,
217
+ value: void 0
218
+ });
219
+ Object.defineProperty(this, "tracingEnabled", {
220
+ enumerable: true,
221
+ configurable: true,
222
+ writable: true,
223
+ value: void 0
224
+ });
225
+ Object.defineProperty(this, "execution_order", {
226
+ enumerable: true,
227
+ configurable: true,
228
+ writable: true,
229
+ value: void 0
230
+ });
231
+ Object.defineProperty(this, "child_execution_order", {
232
+ enumerable: true,
233
+ configurable: true,
234
+ writable: true,
235
+ value: void 0
236
+ });
237
+ Object.defineProperty(this, "attachments", {
238
+ enumerable: true,
239
+ configurable: true,
240
+ writable: true,
241
+ value: void 0
242
+ });
243
+ Object.defineProperty(this, "replicas", {
244
+ enumerable: true,
245
+ configurable: true,
246
+ writable: true,
247
+ value: void 0
248
+ });
249
+ Object.defineProperty(this, "distributedParentId", {
250
+ enumerable: true,
251
+ configurable: true,
252
+ writable: true,
253
+ value: void 0
254
+ });
255
+ Object.defineProperty(this, "_serialized_start_time", {
256
+ enumerable: true,
257
+ configurable: true,
258
+ writable: true,
259
+ value: void 0
260
+ });
261
+ Object.defineProperty(this, "_awaitInputsOnPost", {
262
+ enumerable: true,
263
+ configurable: true,
264
+ writable: true,
265
+ value: void 0
266
+ });
267
+ if (isRunTree(originalConfig)) {
268
+ Object.assign(this, { ...originalConfig });
269
+ return;
270
+ }
271
+ const defaultConfig = RunTree.getDefaultConfig();
272
+ const { metadata, ...config } = originalConfig;
273
+ const client = config.client ?? RunTree.getSharedClient();
274
+ const dedupedMetadata = {
275
+ ...metadata,
276
+ ...config?.extra?.metadata
277
+ };
278
+ config.extra = { ...config.extra, metadata: dedupedMetadata };
279
+ if ("id" in config && config.id == null) {
280
+ delete config.id;
281
+ }
282
+ Object.assign(this, { ...defaultConfig, ...config, client });
283
+ this.execution_order ??= 1;
284
+ this.child_execution_order ??= 1;
285
+ if (!this.dotted_order) {
286
+ this._serialized_start_time = getMicrosecondPrecisionDatestring(this.start_time, this.execution_order);
287
+ }
288
+ if (!this.id) {
289
+ this.id = uuid7FromTime(this._serialized_start_time ?? this.start_time);
290
+ }
291
+ if (!this.trace_id) {
292
+ if (this.parent_run) {
293
+ this.trace_id = this.parent_run.trace_id ?? this.id;
294
+ } else {
295
+ this.trace_id = this.id;
296
+ }
297
+ }
298
+ this.replicas = _ensureWriteReplicas(this.replicas);
299
+ if (!this.dotted_order) {
300
+ const { dottedOrder } = convertToDottedOrderFormat(this.start_time, this.id, this.execution_order);
301
+ if (this.parent_run) {
302
+ this.dotted_order = this.parent_run.dotted_order + "." + dottedOrder;
303
+ } else {
304
+ this.dotted_order = dottedOrder;
305
+ }
306
+ }
307
+ }
308
+ set metadata(metadata) {
309
+ this.extra = {
310
+ ...this.extra,
311
+ metadata: {
312
+ ...this.extra?.metadata,
313
+ ...metadata
314
+ }
315
+ };
316
+ }
317
+ get metadata() {
318
+ return this.extra?.metadata;
319
+ }
320
+ static getDefaultConfig() {
321
+ const start_time = Date.now();
322
+ return {
323
+ run_type: "chain",
324
+ project_name: getDefaultProjectName(),
325
+ child_runs: [],
326
+ api_url: getEnvironmentVariable("LANGCHAIN_ENDPOINT") ?? "http://localhost:1984",
327
+ api_key: getEnvironmentVariable("LANGCHAIN_API_KEY"),
328
+ caller_options: {},
329
+ start_time,
330
+ serialized: {},
331
+ inputs: {},
332
+ extra: {}
333
+ };
334
+ }
335
+ static getSharedClient() {
336
+ if (!RunTree.sharedClient) {
337
+ RunTree.sharedClient = new Client();
338
+ }
339
+ return RunTree.sharedClient;
340
+ }
341
+ createChild(config) {
342
+ const child_execution_order = this.child_execution_order + 1;
343
+ const inheritedReplicas = this.replicas?.map((replica) => {
344
+ const { reroot, ...rest } = replica;
345
+ return rest;
346
+ });
347
+ const childReplicas = config.replicas ?? inheritedReplicas;
348
+ const child = new RunTree({
349
+ ...config,
350
+ parent_run: this,
351
+ project_name: this.project_name,
352
+ replicas: childReplicas,
353
+ client: this.client,
354
+ tracingEnabled: this.tracingEnabled,
355
+ execution_order: child_execution_order,
356
+ child_execution_order
357
+ });
358
+ if (_LC_CONTEXT_VARIABLES_KEY in this) {
359
+ child[_LC_CONTEXT_VARIABLES_KEY] = this[_LC_CONTEXT_VARIABLES_KEY];
360
+ }
361
+ const LC_CHILD = /* @__PURE__ */ Symbol.for("lc:child_config");
362
+ const presentConfig = config.extra?.[LC_CHILD] ?? this.extra[LC_CHILD];
363
+ if (isRunnableConfigLike(presentConfig)) {
364
+ const newConfig = { ...presentConfig };
365
+ const callbacks = isCallbackManagerLike(newConfig.callbacks) ? newConfig.callbacks.copy?.() : void 0;
366
+ if (callbacks) {
367
+ Object.assign(callbacks, { _parentRunId: child.id });
368
+ callbacks.handlers?.find(isLangChainTracerLike)?.updateFromRunTree?.(child);
369
+ newConfig.callbacks = callbacks;
370
+ }
371
+ child.extra[LC_CHILD] = newConfig;
372
+ }
373
+ const visited = /* @__PURE__ */ new Set();
374
+ let current = this;
375
+ while (current != null && !visited.has(current.id)) {
376
+ visited.add(current.id);
377
+ current.child_execution_order = Math.max(current.child_execution_order, child_execution_order);
378
+ current = current.parent_run;
379
+ }
380
+ this.child_runs.push(child);
381
+ return child;
382
+ }
383
+ async end(outputs, error, endTime = Date.now(), metadata) {
384
+ this.outputs = this.outputs ?? outputs;
385
+ this.error = this.error ?? error;
386
+ this.end_time = this.end_time ?? endTime;
387
+ if (metadata && Object.keys(metadata).length > 0) {
388
+ this.extra = this.extra ? { ...this.extra, metadata: { ...this.extra.metadata, ...metadata } } : { metadata };
389
+ }
390
+ }
391
+ _convertToCreate(run, runtimeEnv, excludeChildRuns = true) {
392
+ const runExtra = run.extra ?? {};
393
+ if (runExtra?.runtime?.library === void 0) {
394
+ if (!runExtra.runtime) {
395
+ runExtra.runtime = {};
396
+ }
397
+ if (runtimeEnv) {
398
+ for (const [k, v] of Object.entries(runtimeEnv)) {
399
+ if (!runExtra.runtime[k]) {
400
+ runExtra.runtime[k] = v;
401
+ }
402
+ }
403
+ }
404
+ }
405
+ let child_runs;
406
+ let parent_run_id;
407
+ if (!excludeChildRuns) {
408
+ child_runs = run.child_runs.map((child_run) => this._convertToCreate(child_run, runtimeEnv, excludeChildRuns));
409
+ parent_run_id = void 0;
410
+ } else {
411
+ parent_run_id = run.parent_run?.id ?? run.parent_run_id;
412
+ child_runs = [];
413
+ }
414
+ return {
415
+ id: run.id,
416
+ name: run.name,
417
+ start_time: run._serialized_start_time ?? run.start_time,
418
+ end_time: run.end_time,
419
+ run_type: run.run_type,
420
+ reference_example_id: run.reference_example_id,
421
+ extra: runExtra,
422
+ serialized: run.serialized,
423
+ error: run.error,
424
+ inputs: run.inputs,
425
+ outputs: run.outputs,
426
+ session_name: run.project_name,
427
+ child_runs,
428
+ parent_run_id,
429
+ trace_id: run.trace_id,
430
+ dotted_order: run.dotted_order,
431
+ tags: run.tags,
432
+ attachments: run.attachments,
433
+ events: run.events
434
+ };
435
+ }
436
+ _sliceParentId(parentId, run) {
437
+ if (run.dotted_order) {
438
+ const segs = run.dotted_order.split(".");
439
+ let startIdx = null;
440
+ for (let idx = 0; idx < segs.length; idx++) {
441
+ const segId = segs[idx].slice(-36);
442
+ if (segId === parentId) {
443
+ startIdx = idx;
444
+ break;
445
+ }
446
+ }
447
+ if (startIdx !== null) {
448
+ const trimmedSegs = segs.slice(startIdx + 1);
449
+ run.dotted_order = trimmedSegs.join(".");
450
+ if (trimmedSegs.length > 0) {
451
+ run.trace_id = trimmedSegs[0].slice(-36);
452
+ } else {
453
+ run.trace_id = run.id;
454
+ }
455
+ }
456
+ }
457
+ if (run.parent_run_id === parentId) {
458
+ run.parent_run_id = void 0;
459
+ }
460
+ }
461
+ _setReplicaTraceRoot(replicaKey, traceRootId) {
462
+ const replicaTraceRoots = getContextVar(this, _REPLICA_TRACE_ROOTS_KEY) ?? {};
463
+ replicaTraceRoots[replicaKey] = traceRootId;
464
+ setContextVar(this, _REPLICA_TRACE_ROOTS_KEY, replicaTraceRoots);
465
+ for (const child of this.child_runs) {
466
+ child._setReplicaTraceRoot(replicaKey, traceRootId);
467
+ }
468
+ }
469
+ _remapForProject(params) {
470
+ const { projectName, runtimeEnv, excludeChildRuns = true, reroot = false, distributedParentId, apiUrl, apiKey, workspaceId } = params;
471
+ const baseRun = this._convertToCreate(this, runtimeEnv, excludeChildRuns);
472
+ if (projectName === this.project_name) {
473
+ return {
474
+ ...baseRun,
475
+ session_name: projectName
476
+ };
477
+ }
478
+ if (reroot) {
479
+ if (distributedParentId) {
480
+ this._sliceParentId(distributedParentId, baseRun);
481
+ } else {
482
+ baseRun.parent_run_id = void 0;
483
+ if (baseRun.dotted_order) {
484
+ const segs = baseRun.dotted_order.split(".");
485
+ if (segs.length > 0) {
486
+ baseRun.dotted_order = segs[segs.length - 1];
487
+ baseRun.trace_id = baseRun.id;
488
+ }
489
+ }
490
+ }
491
+ const replicaKey = getReplicaKey({
492
+ projectName,
493
+ apiUrl,
494
+ apiKey,
495
+ workspaceId
496
+ });
497
+ this._setReplicaTraceRoot(replicaKey, baseRun.id);
498
+ }
499
+ let ancestorRerootedTraceId;
500
+ if (!reroot) {
501
+ const replicaTraceRoots = getContextVar(this, _REPLICA_TRACE_ROOTS_KEY) ?? {};
502
+ const replicaKey = getReplicaKey({
503
+ projectName,
504
+ apiUrl,
505
+ apiKey,
506
+ workspaceId
507
+ });
508
+ ancestorRerootedTraceId = replicaTraceRoots[replicaKey];
509
+ if (ancestorRerootedTraceId) {
510
+ baseRun.trace_id = ancestorRerootedTraceId;
511
+ if (baseRun.dotted_order) {
512
+ const segs = baseRun.dotted_order.split(".");
513
+ let rootIdx = null;
514
+ for (let idx = 0; idx < segs.length; idx++) {
515
+ const segId = segs[idx].slice(-36);
516
+ if (segId === ancestorRerootedTraceId) {
517
+ rootIdx = idx;
518
+ break;
519
+ }
520
+ }
521
+ if (rootIdx !== null) {
522
+ const trimmedSegs = segs.slice(rootIdx);
523
+ baseRun.dotted_order = trimmedSegs.join(".");
524
+ }
525
+ }
526
+ }
527
+ }
528
+ const oldId = baseRun.id;
529
+ const newId = v5(`${oldId}:${projectName}`, UUID_NAMESPACE_DNS);
530
+ let newTraceId;
531
+ if (baseRun.trace_id) {
532
+ newTraceId = v5(`${baseRun.trace_id}:${projectName}`, UUID_NAMESPACE_DNS);
533
+ } else {
534
+ newTraceId = newId;
535
+ }
536
+ let newParentId;
537
+ if (baseRun.parent_run_id) {
538
+ newParentId = v5(`${baseRun.parent_run_id}:${projectName}`, UUID_NAMESPACE_DNS);
539
+ }
540
+ let newDottedOrder;
541
+ if (baseRun.dotted_order) {
542
+ const segs = baseRun.dotted_order.split(".");
543
+ const remappedSegs = segs.map((seg) => {
544
+ const segId = seg.slice(-36);
545
+ const remappedId = v5(`${segId}:${projectName}`, UUID_NAMESPACE_DNS);
546
+ return seg.slice(0, -36) + remappedId;
547
+ });
548
+ newDottedOrder = remappedSegs.join(".");
549
+ }
550
+ return {
551
+ ...baseRun,
552
+ id: newId,
553
+ trace_id: newTraceId,
554
+ parent_run_id: newParentId,
555
+ dotted_order: newDottedOrder,
556
+ session_name: projectName
557
+ };
558
+ }
559
+ async postRun(excludeChildRuns = true) {
560
+ if (this._awaitInputsOnPost) {
561
+ this.inputs = await this.inputs;
562
+ }
563
+ try {
564
+ const runtimeEnv = getRuntimeEnvironment();
565
+ if (this.replicas && this.replicas.length > 0) {
566
+ for (const { projectName, apiKey, apiUrl, workspaceId, reroot } of this.replicas) {
567
+ const runCreate = this._remapForProject({
568
+ projectName: projectName ?? this.project_name,
569
+ runtimeEnv,
570
+ excludeChildRuns: true,
571
+ reroot,
572
+ distributedParentId: this.distributedParentId,
573
+ apiUrl,
574
+ apiKey,
575
+ workspaceId
576
+ });
577
+ await this.client.createRun(runCreate, {
578
+ apiKey,
579
+ apiUrl,
580
+ workspaceId
581
+ });
582
+ }
583
+ } else {
584
+ const runCreate = this._convertToCreate(this, runtimeEnv, excludeChildRuns);
585
+ await this.client.createRun(runCreate);
586
+ }
587
+ if (!excludeChildRuns) {
588
+ warnOnce("Posting with excludeChildRuns=false is deprecated and will be removed in a future version.");
589
+ for (const childRun of this.child_runs) {
590
+ await childRun.postRun(false);
591
+ }
592
+ }
593
+ this.child_runs = [];
594
+ } catch (error) {
595
+ console.error(`Error in postRun for run ${this.id}:`, error);
596
+ }
597
+ }
598
+ async patchRun(options) {
599
+ if (this.replicas && this.replicas.length > 0) {
600
+ for (const { projectName, apiKey, apiUrl, workspaceId, updates, reroot } of this.replicas) {
601
+ const runData = this._remapForProject({
602
+ projectName: projectName ?? this.project_name,
603
+ runtimeEnv: void 0,
604
+ excludeChildRuns: true,
605
+ reroot,
606
+ distributedParentId: this.distributedParentId,
607
+ apiUrl,
608
+ apiKey,
609
+ workspaceId
610
+ });
611
+ const updatePayload = {
612
+ id: runData.id,
613
+ name: runData.name,
614
+ run_type: runData.run_type,
615
+ start_time: runData.start_time,
616
+ outputs: runData.outputs,
617
+ error: runData.error,
618
+ parent_run_id: runData.parent_run_id,
619
+ session_name: runData.session_name,
620
+ reference_example_id: runData.reference_example_id,
621
+ end_time: runData.end_time,
622
+ dotted_order: runData.dotted_order,
623
+ trace_id: runData.trace_id,
624
+ events: runData.events,
625
+ tags: runData.tags,
626
+ extra: runData.extra,
627
+ attachments: this.attachments,
628
+ ...updates
629
+ };
630
+ if (!options?.excludeInputs) {
631
+ updatePayload.inputs = runData.inputs;
632
+ }
633
+ await this.client.updateRun(runData.id, updatePayload, {
634
+ apiKey,
635
+ apiUrl,
636
+ workspaceId
637
+ });
638
+ }
639
+ } else {
640
+ try {
641
+ const runUpdate = {
642
+ name: this.name,
643
+ run_type: this.run_type,
644
+ start_time: this._serialized_start_time ?? this.start_time,
645
+ end_time: this.end_time,
646
+ error: this.error,
647
+ outputs: this.outputs,
648
+ parent_run_id: this.parent_run?.id ?? this.parent_run_id,
649
+ reference_example_id: this.reference_example_id,
650
+ extra: this.extra,
651
+ events: this.events,
652
+ dotted_order: this.dotted_order,
653
+ trace_id: this.trace_id,
654
+ tags: this.tags,
655
+ attachments: this.attachments,
656
+ session_name: this.project_name
657
+ };
658
+ if (!options?.excludeInputs) {
659
+ runUpdate.inputs = this.inputs;
660
+ }
661
+ await this.client.updateRun(this.id, runUpdate);
662
+ } catch (error) {
663
+ console.error(`Error in patchRun for run ${this.id}`, error);
664
+ }
665
+ }
666
+ this.child_runs = [];
667
+ }
668
+ toJSON() {
669
+ return this._convertToCreate(this, void 0, false);
670
+ }
671
+ /**
672
+ * Add an event to the run tree.
673
+ * @param event - A single event or string to add
674
+ */
675
+ addEvent(event) {
676
+ if (!this.events) {
677
+ this.events = [];
678
+ }
679
+ if (typeof event === "string") {
680
+ this.events.push({
681
+ name: "event",
682
+ time: (/* @__PURE__ */ new Date()).toISOString(),
683
+ message: event
684
+ });
685
+ } else {
686
+ this.events.push({
687
+ ...event,
688
+ time: event.time ?? (/* @__PURE__ */ new Date()).toISOString()
689
+ });
690
+ }
691
+ }
692
+ static fromRunnableConfig(parentConfig, props) {
693
+ const callbackManager = parentConfig?.callbacks;
694
+ let parentRun;
695
+ let projectName;
696
+ let client;
697
+ let tracingEnabled = isTracingEnabled();
698
+ if (callbackManager) {
699
+ const parentRunId = callbackManager?.getParentRunId?.() ?? "";
700
+ const langChainTracer = callbackManager?.handlers?.find((handler) => handler?.name == "langchain_tracer");
701
+ parentRun = langChainTracer?.getRun?.(parentRunId);
702
+ projectName = langChainTracer?.projectName;
703
+ client = langChainTracer?.client;
704
+ tracingEnabled = tracingEnabled || !!langChainTracer;
705
+ }
706
+ if (!parentRun) {
707
+ return new RunTree({
708
+ ...props,
709
+ client,
710
+ tracingEnabled,
711
+ project_name: projectName
712
+ });
713
+ }
714
+ const parentRunTree = new RunTree({
715
+ name: parentRun.name,
716
+ id: parentRun.id,
717
+ trace_id: parentRun.trace_id,
718
+ dotted_order: parentRun.dotted_order,
719
+ client,
720
+ tracingEnabled,
721
+ project_name: projectName,
722
+ tags: [
723
+ ...new Set((parentRun?.tags ?? []).concat(parentConfig?.tags ?? []))
724
+ ],
725
+ extra: {
726
+ metadata: {
727
+ ...parentRun?.extra?.metadata,
728
+ ...parentConfig?.metadata
729
+ }
730
+ }
731
+ });
732
+ return parentRunTree.createChild(props);
733
+ }
734
+ static fromDottedOrder(dottedOrder) {
735
+ return this.fromHeaders({ "langsmith-trace": dottedOrder });
736
+ }
737
+ static fromHeaders(headers, inheritArgs) {
738
+ const rawHeaders = "get" in headers && typeof headers.get === "function" ? {
739
+ "langsmith-trace": headers.get("langsmith-trace"),
740
+ baggage: headers.get("baggage")
741
+ } : headers;
742
+ const headerTrace = rawHeaders["langsmith-trace"];
743
+ if (!headerTrace || typeof headerTrace !== "string")
744
+ return void 0;
745
+ const parentDottedOrder = headerTrace.trim();
746
+ const parsedDottedOrder = parentDottedOrder.split(".").map((part) => {
747
+ const [strTime, uuid] = part.split("Z");
748
+ return { strTime, time: Date.parse(strTime + "Z"), uuid };
749
+ });
750
+ const traceId = parsedDottedOrder[0].uuid;
751
+ const config = {
752
+ ...inheritArgs,
753
+ name: inheritArgs?.["name"] ?? "parent",
754
+ run_type: inheritArgs?.["run_type"] ?? "chain",
755
+ start_time: inheritArgs?.["start_time"] ?? Date.now(),
756
+ id: parsedDottedOrder.at(-1)?.uuid,
757
+ trace_id: traceId,
758
+ dotted_order: parentDottedOrder
759
+ };
760
+ if (rawHeaders["baggage"] && typeof rawHeaders["baggage"] === "string") {
761
+ const baggage = Baggage.fromHeader(rawHeaders["baggage"]);
762
+ config.metadata = baggage.metadata;
763
+ config.tags = baggage.tags;
764
+ config.project_name = baggage.project_name;
765
+ config.replicas = baggage.replicas;
766
+ }
767
+ const runTree = new RunTree(config);
768
+ runTree.distributedParentId = runTree.id;
769
+ return runTree;
770
+ }
771
+ toHeaders(headers) {
772
+ const result = {
773
+ "langsmith-trace": this.dotted_order,
774
+ baggage: new Baggage(this.extra?.metadata, this.tags, this.project_name, this.replicas).toHeader()
775
+ };
776
+ if (headers) {
777
+ for (const [key, value] of Object.entries(result)) {
778
+ headers.set(key, value);
779
+ }
780
+ }
781
+ return result;
782
+ }
783
+ }
784
+ Object.defineProperty(RunTree, "sharedClient", {
785
+ enumerable: true,
786
+ configurable: true,
787
+ writable: true,
788
+ value: null
789
+ });
790
+ function isRunTree(x) {
791
+ return x != null && typeof x.createChild === "function" && typeof x.postRun === "function";
792
+ }
793
+ function isLangChainTracerLike(x) {
794
+ return typeof x === "object" && x != null && typeof x.name === "string" && x.name === "langchain_tracer";
795
+ }
796
+ function containsLangChainTracerLike(x) {
797
+ return Array.isArray(x) && x.some((callback) => isLangChainTracerLike(callback));
798
+ }
799
+ function isCallbackManagerLike(x) {
800
+ return typeof x === "object" && x != null && Array.isArray(x.handlers);
801
+ }
802
+ function isRunnableConfigLike(x) {
803
+ const callbacks = x?.callbacks;
804
+ return x != null && typeof callbacks === "object" && // Callback manager with a langchain tracer
805
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
806
+ (containsLangChainTracerLike(callbacks?.handlers) || // Or it's an array with a LangChainTracerLike object within it
807
+ containsLangChainTracerLike(callbacks));
808
+ }
809
+ function _getWriteReplicasFromEnv() {
810
+ const envVar = getEnvironmentVariable("LANGSMITH_RUNS_ENDPOINTS");
811
+ if (!envVar)
812
+ return [];
813
+ try {
814
+ const parsed = JSON.parse(envVar);
815
+ if (Array.isArray(parsed)) {
816
+ const replicas = [];
817
+ for (const item of parsed) {
818
+ if (typeof item !== "object" || item === null) {
819
+ console.warn(`Invalid item type in LANGSMITH_RUNS_ENDPOINTS: expected object, got ${typeof item}`);
820
+ continue;
821
+ }
822
+ if (typeof item.api_url !== "string") {
823
+ console.warn(`Invalid api_url type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof item.api_url}`);
824
+ continue;
825
+ }
826
+ if (typeof item.api_key !== "string") {
827
+ console.warn(`Invalid api_key type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof item.api_key}`);
828
+ continue;
829
+ }
830
+ replicas.push({
831
+ apiUrl: item.api_url.replace(/\/$/, ""),
832
+ apiKey: item.api_key
833
+ });
834
+ }
835
+ return replicas;
836
+ } else if (typeof parsed === "object" && parsed !== null) {
837
+ _checkEndpointEnvUnset(parsed);
838
+ const replicas = [];
839
+ for (const [url, key] of Object.entries(parsed)) {
840
+ const cleanUrl = url.replace(/\/$/, "");
841
+ if (typeof key === "string") {
842
+ replicas.push({
843
+ apiUrl: cleanUrl,
844
+ apiKey: key
845
+ });
846
+ } else {
847
+ console.warn(`Invalid value type in LANGSMITH_RUNS_ENDPOINTS for URL ${url}: expected string, got ${typeof key}`);
848
+ continue;
849
+ }
850
+ }
851
+ return replicas;
852
+ } else {
853
+ console.warn(`Invalid LANGSMITH_RUNS_ENDPOINTS – must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey, got ${typeof parsed}`);
854
+ return [];
855
+ }
856
+ } catch (e) {
857
+ if (isConflictingEndpointsError(e)) {
858
+ throw e;
859
+ }
860
+ console.warn("Invalid LANGSMITH_RUNS_ENDPOINTS – must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey");
861
+ return [];
862
+ }
863
+ }
864
+ function _ensureWriteReplicas(replicas) {
865
+ if (replicas) {
866
+ return replicas.map((replica) => {
867
+ if (Array.isArray(replica)) {
868
+ return {
869
+ projectName: replica[0],
870
+ updates: replica[1]
871
+ };
872
+ }
873
+ return replica;
874
+ });
875
+ }
876
+ return _getWriteReplicasFromEnv();
877
+ }
878
+ function _checkEndpointEnvUnset(parsed) {
879
+ if (Object.keys(parsed).length > 0 && getLangSmithEnvironmentVariable("ENDPOINT")) {
880
+ throw new ConflictingEndpointsError();
881
+ }
882
+ }
883
+ export {
884
+ RunTree,
885
+ convertToDottedOrderFormat,
886
+ isRunTree,
887
+ isRunnableConfigLike
888
+ };
889
+ //# sourceMappingURL=index.es113.js.map