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,1203 @@
1
+ import { AsyncCaller } from "./index.es52.js";
2
+ import { getEnvironmentVariable } from "./index.es53.js";
3
+ import { mergeSignals } from "./index.es54.js";
4
+ import { BytesLineDecoder, SSEDecoder } from "./index.es29.js";
5
+ import { streamWithRetry } from "./index.es30.js";
6
+ function* iterateHeaders(headers) {
7
+ let iter;
8
+ let shouldClear = false;
9
+ if (headers instanceof Headers) {
10
+ const entries = [];
11
+ headers.forEach((value, name) => {
12
+ entries.push([name, value]);
13
+ });
14
+ iter = entries;
15
+ } else if (Array.isArray(headers)) iter = headers;
16
+ else {
17
+ shouldClear = true;
18
+ iter = Object.entries(headers ?? {});
19
+ }
20
+ for (const item of iter) {
21
+ const name = item[0];
22
+ if (typeof name !== "string") throw new TypeError(`Expected header name to be a string, got ${typeof name}`);
23
+ const values = Array.isArray(item[1]) ? item[1] : [item[1]];
24
+ let didClear = false;
25
+ for (const value of values) {
26
+ if (value === void 0) continue;
27
+ if (shouldClear && !didClear) {
28
+ didClear = true;
29
+ yield [name, null];
30
+ }
31
+ yield [name, value];
32
+ }
33
+ }
34
+ }
35
+ function mergeHeaders(...headerObjects) {
36
+ const outputHeaders = new Headers();
37
+ for (const headers of headerObjects) {
38
+ if (!headers) continue;
39
+ for (const [name, value] of iterateHeaders(headers)) if (value === null) outputHeaders.delete(name);
40
+ else outputHeaders.append(name, value);
41
+ }
42
+ const headerEntries = [];
43
+ outputHeaders.forEach((value, name) => {
44
+ headerEntries.push([name, value]);
45
+ });
46
+ return Object.fromEntries(headerEntries);
47
+ }
48
+ function getApiKey(apiKey) {
49
+ if (apiKey === null) return void 0;
50
+ if (apiKey) return apiKey;
51
+ const prefixes = [
52
+ "LANGGRAPH",
53
+ "LANGSMITH",
54
+ "LANGCHAIN"
55
+ ];
56
+ for (const prefix of prefixes) {
57
+ const envKey = getEnvironmentVariable(`${prefix}_API_KEY`);
58
+ if (envKey) return envKey.trim().replace(/^["']|["']$/g, "");
59
+ }
60
+ return void 0;
61
+ }
62
+ const REGEX_RUN_METADATA = /(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;
63
+ function getRunMetadataFromResponse(response) {
64
+ const contentLocation = response.headers.get("Content-Location");
65
+ if (!contentLocation) return void 0;
66
+ const match = REGEX_RUN_METADATA.exec(contentLocation);
67
+ if (!match?.groups?.run_id) return void 0;
68
+ return {
69
+ run_id: match.groups.run_id,
70
+ thread_id: match.groups.thread_id || void 0
71
+ };
72
+ }
73
+ var BaseClient = class {
74
+ asyncCaller;
75
+ timeoutMs;
76
+ apiUrl;
77
+ defaultHeaders;
78
+ onRequest;
79
+ constructor(config) {
80
+ const callerOptions = {
81
+ maxRetries: 4,
82
+ maxConcurrency: 4,
83
+ ...config?.callerOptions
84
+ };
85
+ let defaultApiUrl = "http://localhost:8123";
86
+ if (!config?.apiUrl && typeof globalThis === "object" && globalThis != null) {
87
+ const fetchSmb = /* @__PURE__ */ Symbol.for("langgraph_api:fetch");
88
+ const urlSmb = /* @__PURE__ */ Symbol.for("langgraph_api:url");
89
+ const global = globalThis;
90
+ if (global[fetchSmb]) callerOptions.fetch ??= global[fetchSmb];
91
+ if (global[urlSmb]) defaultApiUrl = global[urlSmb];
92
+ }
93
+ this.asyncCaller = new AsyncCaller(callerOptions);
94
+ this.timeoutMs = config?.timeoutMs;
95
+ this.apiUrl = config?.apiUrl?.replace(/\/$/, "") || defaultApiUrl;
96
+ this.defaultHeaders = config?.defaultHeaders || {};
97
+ this.onRequest = config?.onRequest;
98
+ const apiKey = getApiKey(config?.apiKey);
99
+ if (apiKey) this.defaultHeaders["x-api-key"] = apiKey;
100
+ }
101
+ prepareFetchOptions(path, options) {
102
+ const mutatedOptions = {
103
+ ...options,
104
+ headers: mergeHeaders(this.defaultHeaders, options?.headers)
105
+ };
106
+ if (mutatedOptions.json) {
107
+ mutatedOptions.body = JSON.stringify(mutatedOptions.json);
108
+ mutatedOptions.headers = mergeHeaders(mutatedOptions.headers, { "content-type": "application/json" });
109
+ delete mutatedOptions.json;
110
+ }
111
+ if (mutatedOptions.withResponse) delete mutatedOptions.withResponse;
112
+ let timeoutSignal = null;
113
+ if (typeof options?.timeoutMs !== "undefined") {
114
+ if (options.timeoutMs != null) timeoutSignal = AbortSignal.timeout(options.timeoutMs);
115
+ } else if (this.timeoutMs != null) timeoutSignal = AbortSignal.timeout(this.timeoutMs);
116
+ mutatedOptions.signal = mergeSignals(timeoutSignal, mutatedOptions.signal);
117
+ const targetUrl = new URL(`${this.apiUrl}${path}`);
118
+ if (mutatedOptions.params) {
119
+ for (const [key, value] of Object.entries(mutatedOptions.params)) {
120
+ if (value == null) continue;
121
+ const strValue = typeof value === "string" || typeof value === "number" ? value.toString() : JSON.stringify(value);
122
+ targetUrl.searchParams.append(key, strValue);
123
+ }
124
+ delete mutatedOptions.params;
125
+ }
126
+ return [targetUrl, mutatedOptions];
127
+ }
128
+ async fetch(path, options) {
129
+ const [url, init] = this.prepareFetchOptions(path, options);
130
+ let finalInit = init;
131
+ if (this.onRequest) finalInit = await this.onRequest(url, init);
132
+ const response = await this.asyncCaller.fetch(url, finalInit);
133
+ const body = (() => {
134
+ if (response.status === 202 || response.status === 204) return void 0;
135
+ return response.json();
136
+ })();
137
+ if (options?.withResponse) return [await body, response];
138
+ return body;
139
+ }
140
+ /**
141
+ * Protected helper for streaming with automatic retry logic.
142
+ * Handles both initial requests and reconnections with SSE.
143
+ */
144
+ async *streamWithRetry(config) {
145
+ const makeRequest = async (reconnectParams) => {
146
+ const requestEndpoint = reconnectParams?.reconnectPath || config.endpoint;
147
+ const isReconnect = !!reconnectParams?.lastEventId;
148
+ const method = isReconnect ? "GET" : config.method || "GET";
149
+ const requestHeaders = isReconnect && reconnectParams?.lastEventId ? {
150
+ ...config.headers,
151
+ "Last-Event-ID": reconnectParams.lastEventId
152
+ } : config.headers;
153
+ let [url, init] = this.prepareFetchOptions(requestEndpoint, {
154
+ method,
155
+ timeoutMs: null,
156
+ signal: config.signal,
157
+ headers: requestHeaders,
158
+ params: config.params,
159
+ json: isReconnect ? void 0 : config.json
160
+ });
161
+ if (this.onRequest != null) init = await this.onRequest(url, init);
162
+ const response = await this.asyncCaller.fetch(url, init);
163
+ if (!isReconnect && config.onInitialResponse) await config.onInitialResponse(response);
164
+ const stream = (response.body || new ReadableStream({ start: (ctrl) => ctrl.close() })).pipeThrough(BytesLineDecoder()).pipeThrough(SSEDecoder());
165
+ return {
166
+ response,
167
+ stream
168
+ };
169
+ };
170
+ yield* streamWithRetry(makeRequest, {
171
+ maxRetries: config.maxRetries ?? 5,
172
+ signal: config.signal,
173
+ onReconnect: config.onReconnect
174
+ });
175
+ }
176
+ };
177
+ var CronsClient = class extends BaseClient {
178
+ /**
179
+ *
180
+ * @param threadId The ID of the thread.
181
+ * @param assistantId Assistant ID to use for this cron job.
182
+ * @param payload Payload for creating a cron job.
183
+ * @returns The created background run.
184
+ */
185
+ async createForThread(threadId, assistantId, payload) {
186
+ const json = {
187
+ schedule: payload?.schedule,
188
+ input: payload?.input,
189
+ config: payload?.config,
190
+ context: payload?.context,
191
+ metadata: payload?.metadata,
192
+ assistant_id: assistantId,
193
+ interrupt_before: payload?.interruptBefore,
194
+ interrupt_after: payload?.interruptAfter,
195
+ webhook: payload?.webhook,
196
+ multitask_strategy: payload?.multitaskStrategy,
197
+ if_not_exists: payload?.ifNotExists,
198
+ checkpoint_during: payload?.checkpointDuring,
199
+ durability: payload?.durability
200
+ };
201
+ return this.fetch(`/threads/${threadId}/runs/crons`, {
202
+ method: "POST",
203
+ json,
204
+ signal: payload?.signal
205
+ });
206
+ }
207
+ /**
208
+ *
209
+ * @param assistantId Assistant ID to use for this cron job.
210
+ * @param payload Payload for creating a cron job.
211
+ * @returns
212
+ */
213
+ async create(assistantId, payload) {
214
+ const json = {
215
+ schedule: payload?.schedule,
216
+ input: payload?.input,
217
+ config: payload?.config,
218
+ context: payload?.context,
219
+ metadata: payload?.metadata,
220
+ assistant_id: assistantId,
221
+ interrupt_before: payload?.interruptBefore,
222
+ interrupt_after: payload?.interruptAfter,
223
+ webhook: payload?.webhook,
224
+ multitask_strategy: payload?.multitaskStrategy,
225
+ if_not_exists: payload?.ifNotExists,
226
+ checkpoint_during: payload?.checkpointDuring,
227
+ durability: payload?.durability
228
+ };
229
+ return this.fetch(`/runs/crons`, {
230
+ method: "POST",
231
+ json,
232
+ signal: payload?.signal
233
+ });
234
+ }
235
+ /**
236
+ *
237
+ * @param cronId Cron ID of Cron job to delete.
238
+ */
239
+ async delete(cronId, options) {
240
+ await this.fetch(`/runs/crons/${cronId}`, {
241
+ method: "DELETE",
242
+ signal: options?.signal
243
+ });
244
+ }
245
+ /**
246
+ *
247
+ * @param query Query options.
248
+ * @returns List of crons.
249
+ */
250
+ async search(query) {
251
+ return this.fetch("/runs/crons/search", {
252
+ method: "POST",
253
+ json: {
254
+ assistant_id: query?.assistantId ?? void 0,
255
+ thread_id: query?.threadId ?? void 0,
256
+ limit: query?.limit ?? 10,
257
+ offset: query?.offset ?? 0,
258
+ sort_by: query?.sortBy ?? void 0,
259
+ sort_order: query?.sortOrder ?? void 0,
260
+ select: query?.select ?? void 0
261
+ },
262
+ signal: query?.signal
263
+ });
264
+ }
265
+ /**
266
+ * Count cron jobs matching filters.
267
+ *
268
+ * @param query.assistantId Assistant ID to filter by.
269
+ * @param query.threadId Thread ID to filter by.
270
+ * @returns Number of cron jobs matching the criteria.
271
+ */
272
+ async count(query) {
273
+ return this.fetch(`/runs/crons/count`, {
274
+ method: "POST",
275
+ json: {
276
+ assistant_id: query?.assistantId ?? void 0,
277
+ thread_id: query?.threadId ?? void 0
278
+ },
279
+ signal: query?.signal
280
+ });
281
+ }
282
+ };
283
+ var AssistantsClient = class extends BaseClient {
284
+ /**
285
+ * Get an assistant by ID.
286
+ *
287
+ * @param assistantId The ID of the assistant.
288
+ * @returns Assistant
289
+ */
290
+ async get(assistantId, options) {
291
+ return this.fetch(`/assistants/${assistantId}`, { signal: options?.signal });
292
+ }
293
+ /**
294
+ * Get the JSON representation of the graph assigned to a runnable
295
+ * @param assistantId The ID of the assistant.
296
+ * @param options.xray Whether to include subgraphs in the serialized graph representation. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
297
+ * @returns Serialized graph
298
+ */
299
+ async getGraph(assistantId, options) {
300
+ return this.fetch(`/assistants/${assistantId}/graph`, {
301
+ params: { xray: options?.xray },
302
+ signal: options?.signal
303
+ });
304
+ }
305
+ /**
306
+ * Get the state and config schema of the graph assigned to a runnable
307
+ * @param assistantId The ID of the assistant.
308
+ * @returns Graph schema
309
+ */
310
+ async getSchemas(assistantId, options) {
311
+ return this.fetch(`/assistants/${assistantId}/schemas`, { signal: options?.signal });
312
+ }
313
+ /**
314
+ * Get the schemas of an assistant by ID.
315
+ *
316
+ * @param assistantId The ID of the assistant to get the schema of.
317
+ * @param options Additional options for getting subgraphs, such as namespace or recursion extraction.
318
+ * @returns The subgraphs of the assistant.
319
+ */
320
+ async getSubgraphs(assistantId, options) {
321
+ if (options?.namespace) return this.fetch(`/assistants/${assistantId}/subgraphs/${options.namespace}`, {
322
+ params: { recurse: options?.recurse },
323
+ signal: options?.signal
324
+ });
325
+ return this.fetch(`/assistants/${assistantId}/subgraphs`, {
326
+ params: { recurse: options?.recurse },
327
+ signal: options?.signal
328
+ });
329
+ }
330
+ /**
331
+ * Create a new assistant.
332
+ * @param payload Payload for creating an assistant.
333
+ * @returns The created assistant.
334
+ */
335
+ async create(payload) {
336
+ return this.fetch("/assistants", {
337
+ method: "POST",
338
+ json: {
339
+ graph_id: payload.graphId,
340
+ config: payload.config,
341
+ context: payload.context,
342
+ metadata: payload.metadata,
343
+ assistant_id: payload.assistantId,
344
+ if_exists: payload.ifExists,
345
+ name: payload.name,
346
+ description: payload.description
347
+ },
348
+ signal: payload.signal
349
+ });
350
+ }
351
+ /**
352
+ * Update an assistant.
353
+ * @param assistantId ID of the assistant.
354
+ * @param payload Payload for updating the assistant.
355
+ * @returns The updated assistant.
356
+ */
357
+ async update(assistantId, payload) {
358
+ return this.fetch(`/assistants/${assistantId}`, {
359
+ method: "PATCH",
360
+ json: {
361
+ graph_id: payload.graphId,
362
+ config: payload.config,
363
+ context: payload.context,
364
+ metadata: payload.metadata,
365
+ name: payload.name,
366
+ description: payload.description
367
+ },
368
+ signal: payload.signal
369
+ });
370
+ }
371
+ /**
372
+ * Delete an assistant.
373
+ *
374
+ * @param assistantId ID of the assistant.
375
+ */
376
+ async delete(assistantId, options) {
377
+ return this.fetch(`/assistants/${assistantId}`, {
378
+ method: "DELETE",
379
+ signal: options?.signal
380
+ });
381
+ }
382
+ async search(query) {
383
+ const json = {
384
+ graph_id: query?.graphId ?? void 0,
385
+ name: query?.name ?? void 0,
386
+ metadata: query?.metadata ?? void 0,
387
+ limit: query?.limit ?? 10,
388
+ offset: query?.offset ?? 0,
389
+ sort_by: query?.sortBy ?? void 0,
390
+ sort_order: query?.sortOrder ?? void 0,
391
+ select: query?.select ?? void 0
392
+ };
393
+ const [assistants, response] = await this.fetch("/assistants/search", {
394
+ method: "POST",
395
+ json,
396
+ withResponse: true,
397
+ signal: query?.signal
398
+ });
399
+ if (query?.includePagination) {
400
+ const next = response.headers.get("X-Pagination-Next");
401
+ return {
402
+ assistants,
403
+ next
404
+ };
405
+ }
406
+ return assistants;
407
+ }
408
+ /**
409
+ * Count assistants matching filters.
410
+ *
411
+ * @param query.metadata Metadata to filter by. Exact match for each key/value.
412
+ * @param query.graphId Optional graph id to filter by.
413
+ * @param query.name Optional name to filter by.
414
+ * @returns Number of assistants matching the criteria.
415
+ */
416
+ async count(query) {
417
+ return this.fetch(`/assistants/count`, {
418
+ method: "POST",
419
+ json: {
420
+ metadata: query?.metadata ?? void 0,
421
+ graph_id: query?.graphId ?? void 0,
422
+ name: query?.name ?? void 0
423
+ },
424
+ signal: query?.signal
425
+ });
426
+ }
427
+ /**
428
+ * List all versions of an assistant.
429
+ *
430
+ * @param assistantId ID of the assistant.
431
+ * @returns List of assistant versions.
432
+ */
433
+ async getVersions(assistantId, payload) {
434
+ return this.fetch(`/assistants/${assistantId}/versions`, {
435
+ method: "POST",
436
+ json: {
437
+ metadata: payload?.metadata ?? void 0,
438
+ limit: payload?.limit ?? 10,
439
+ offset: payload?.offset ?? 0
440
+ },
441
+ signal: payload?.signal
442
+ });
443
+ }
444
+ /**
445
+ * Change the version of an assistant.
446
+ *
447
+ * @param assistantId ID of the assistant.
448
+ * @param version The version to change to.
449
+ * @returns The updated assistant.
450
+ */
451
+ async setLatest(assistantId, version, options) {
452
+ return this.fetch(`/assistants/${assistantId}/latest`, {
453
+ method: "POST",
454
+ json: { version },
455
+ signal: options?.signal
456
+ });
457
+ }
458
+ };
459
+ var ThreadsClient = class extends BaseClient {
460
+ /**
461
+ * Get a thread by ID.
462
+ *
463
+ * @param threadId ID of the thread.
464
+ * @returns The thread.
465
+ */
466
+ async get(threadId, options) {
467
+ return this.fetch(`/threads/${threadId}`, { signal: options?.signal });
468
+ }
469
+ /**
470
+ * Create a new thread.
471
+ *
472
+ * @param payload Payload for creating a thread.
473
+ * @returns The created thread.
474
+ */
475
+ async create(payload) {
476
+ const ttlPayload = typeof payload?.ttl === "number" ? {
477
+ ttl: payload.ttl,
478
+ strategy: "delete"
479
+ } : payload?.ttl;
480
+ return this.fetch(`/threads`, {
481
+ method: "POST",
482
+ json: {
483
+ metadata: {
484
+ ...payload?.metadata,
485
+ graph_id: payload?.graphId
486
+ },
487
+ thread_id: payload?.threadId,
488
+ if_exists: payload?.ifExists,
489
+ supersteps: payload?.supersteps?.map((s) => ({ updates: s.updates.map((u) => ({
490
+ values: u.values,
491
+ command: u.command,
492
+ as_node: u.asNode
493
+ })) })),
494
+ ttl: ttlPayload
495
+ },
496
+ signal: payload?.signal
497
+ });
498
+ }
499
+ /**
500
+ * Copy an existing thread
501
+ * @param threadId ID of the thread to be copied
502
+ * @returns Newly copied thread
503
+ */
504
+ async copy(threadId, options) {
505
+ return this.fetch(`/threads/${threadId}/copy`, {
506
+ method: "POST",
507
+ signal: options?.signal
508
+ });
509
+ }
510
+ /**
511
+ * Update a thread.
512
+ *
513
+ * @param threadId ID of the thread.
514
+ * @param payload Payload for updating the thread.
515
+ * @returns The updated thread.
516
+ */
517
+ async update(threadId, payload) {
518
+ const ttlPayload = typeof payload?.ttl === "number" ? {
519
+ ttl: payload.ttl,
520
+ strategy: "delete"
521
+ } : payload?.ttl;
522
+ return this.fetch(`/threads/${threadId}`, {
523
+ method: "PATCH",
524
+ json: {
525
+ metadata: payload?.metadata,
526
+ ttl: ttlPayload
527
+ },
528
+ signal: payload?.signal
529
+ });
530
+ }
531
+ /**
532
+ * Delete a thread.
533
+ *
534
+ * @param threadId ID of the thread.
535
+ */
536
+ async delete(threadId, options) {
537
+ return this.fetch(`/threads/${threadId}`, {
538
+ method: "DELETE",
539
+ signal: options?.signal
540
+ });
541
+ }
542
+ /**
543
+ * List threads
544
+ *
545
+ * @param query Query options
546
+ * @returns List of threads
547
+ */
548
+ async search(query) {
549
+ return this.fetch("/threads/search", {
550
+ method: "POST",
551
+ json: {
552
+ metadata: query?.metadata ?? void 0,
553
+ ids: query?.ids ?? void 0,
554
+ limit: query?.limit ?? 10,
555
+ offset: query?.offset ?? 0,
556
+ status: query?.status,
557
+ sort_by: query?.sortBy,
558
+ sort_order: query?.sortOrder,
559
+ select: query?.select ?? void 0,
560
+ values: query?.values ?? void 0
561
+ },
562
+ signal: query?.signal
563
+ });
564
+ }
565
+ /**
566
+ * Count threads matching filters.
567
+ *
568
+ * @param query.metadata Thread metadata to filter on.
569
+ * @param query.values State values to filter on.
570
+ * @param query.status Thread status to filter on.
571
+ * @returns Number of threads matching the criteria.
572
+ */
573
+ async count(query) {
574
+ return this.fetch(`/threads/count`, {
575
+ method: "POST",
576
+ json: {
577
+ metadata: query?.metadata ?? void 0,
578
+ values: query?.values ?? void 0,
579
+ status: query?.status ?? void 0
580
+ },
581
+ signal: query?.signal
582
+ });
583
+ }
584
+ /**
585
+ * Get state for a thread.
586
+ *
587
+ * @param threadId ID of the thread.
588
+ * @returns Thread state.
589
+ */
590
+ async getState(threadId, checkpoint, options) {
591
+ if (checkpoint != null) {
592
+ if (typeof checkpoint !== "string") return this.fetch(`/threads/${threadId}/state/checkpoint`, {
593
+ method: "POST",
594
+ json: {
595
+ checkpoint,
596
+ subgraphs: options?.subgraphs
597
+ },
598
+ signal: options?.signal
599
+ });
600
+ return this.fetch(`/threads/${threadId}/state/${checkpoint}`, {
601
+ params: { subgraphs: options?.subgraphs },
602
+ signal: options?.signal
603
+ });
604
+ }
605
+ return this.fetch(`/threads/${threadId}/state`, {
606
+ params: { subgraphs: options?.subgraphs },
607
+ signal: options?.signal
608
+ });
609
+ }
610
+ /**
611
+ * Add state to a thread.
612
+ *
613
+ * @param threadId The ID of the thread.
614
+ * @returns
615
+ */
616
+ async updateState(threadId, options) {
617
+ return this.fetch(`/threads/${threadId}/state`, {
618
+ method: "POST",
619
+ json: {
620
+ values: options.values,
621
+ checkpoint_id: options.checkpointId,
622
+ checkpoint: options.checkpoint,
623
+ as_node: options?.asNode
624
+ },
625
+ signal: options?.signal
626
+ });
627
+ }
628
+ /**
629
+ * Patch the metadata of a thread.
630
+ *
631
+ * @param threadIdOrConfig Thread ID or config to patch the state of.
632
+ * @param metadata Metadata to patch the state with.
633
+ */
634
+ async patchState(threadIdOrConfig, metadata, options) {
635
+ let threadId;
636
+ if (typeof threadIdOrConfig !== "string") {
637
+ if (typeof threadIdOrConfig.configurable?.thread_id !== "string") throw new Error("Thread ID is required when updating state with a config.");
638
+ threadId = threadIdOrConfig.configurable.thread_id;
639
+ } else threadId = threadIdOrConfig;
640
+ return this.fetch(`/threads/${threadId}/state`, {
641
+ method: "PATCH",
642
+ json: { metadata },
643
+ signal: options?.signal
644
+ });
645
+ }
646
+ /**
647
+ * Get all past states for a thread.
648
+ *
649
+ * @param threadId ID of the thread.
650
+ * @param options Additional options.
651
+ * @returns List of thread states.
652
+ */
653
+ async getHistory(threadId, options) {
654
+ return this.fetch(`/threads/${threadId}/history`, {
655
+ method: "POST",
656
+ json: {
657
+ limit: options?.limit ?? 10,
658
+ before: options?.before,
659
+ metadata: options?.metadata,
660
+ checkpoint: options?.checkpoint
661
+ },
662
+ signal: options?.signal
663
+ });
664
+ }
665
+ async *joinStream(threadId, options) {
666
+ yield* this.streamWithRetry({
667
+ endpoint: `/threads/${threadId}/stream`,
668
+ method: "GET",
669
+ signal: options?.signal,
670
+ headers: options?.lastEventId ? { "Last-Event-ID": options.lastEventId } : void 0,
671
+ params: options?.streamMode ? { stream_mode: options.streamMode } : void 0
672
+ });
673
+ }
674
+ };
675
+ var RunsClient = class extends BaseClient {
676
+ /**
677
+ * Create a run and stream the results.
678
+ *
679
+ * @param threadId The ID of the thread.
680
+ * @param assistantId Assistant ID to use for this run.
681
+ * @param payload Payload for creating a run.
682
+ */
683
+ async *stream(threadId, assistantId, payload) {
684
+ const json = {
685
+ input: payload?.input,
686
+ command: payload?.command,
687
+ config: payload?.config,
688
+ context: payload?.context,
689
+ metadata: payload?.metadata,
690
+ stream_mode: payload?.streamMode,
691
+ stream_subgraphs: payload?.streamSubgraphs,
692
+ stream_resumable: payload?.streamResumable,
693
+ feedback_keys: payload?.feedbackKeys,
694
+ assistant_id: assistantId,
695
+ interrupt_before: payload?.interruptBefore,
696
+ interrupt_after: payload?.interruptAfter,
697
+ checkpoint: payload?.checkpoint,
698
+ checkpoint_id: payload?.checkpointId,
699
+ webhook: payload?.webhook,
700
+ multitask_strategy: payload?.multitaskStrategy,
701
+ on_completion: payload?.onCompletion,
702
+ on_disconnect: payload?.onDisconnect,
703
+ after_seconds: payload?.afterSeconds,
704
+ if_not_exists: payload?.ifNotExists,
705
+ checkpoint_during: payload?.checkpointDuring,
706
+ durability: payload?.durability
707
+ };
708
+ yield* this.streamWithRetry({
709
+ endpoint: threadId == null ? `/runs/stream` : `/threads/${threadId}/runs/stream`,
710
+ method: "POST",
711
+ json,
712
+ signal: payload?.signal,
713
+ onInitialResponse: (response) => {
714
+ const runMetadata = getRunMetadataFromResponse(response);
715
+ if (runMetadata) payload?.onRunCreated?.(runMetadata);
716
+ }
717
+ });
718
+ }
719
+ /**
720
+ * Create a run.
721
+ *
722
+ * @param threadId The ID of the thread.
723
+ * @param assistantId Assistant ID to use for this run.
724
+ * @param payload Payload for creating a run.
725
+ * @returns The created run.
726
+ */
727
+ async create(threadId, assistantId, payload) {
728
+ const json = {
729
+ input: payload?.input,
730
+ command: payload?.command,
731
+ config: payload?.config,
732
+ context: payload?.context,
733
+ metadata: payload?.metadata,
734
+ stream_mode: payload?.streamMode,
735
+ stream_subgraphs: payload?.streamSubgraphs,
736
+ stream_resumable: payload?.streamResumable,
737
+ assistant_id: assistantId,
738
+ interrupt_before: payload?.interruptBefore,
739
+ interrupt_after: payload?.interruptAfter,
740
+ webhook: payload?.webhook,
741
+ checkpoint: payload?.checkpoint,
742
+ checkpoint_id: payload?.checkpointId,
743
+ multitask_strategy: payload?.multitaskStrategy,
744
+ after_seconds: payload?.afterSeconds,
745
+ if_not_exists: payload?.ifNotExists,
746
+ checkpoint_during: payload?.checkpointDuring,
747
+ durability: payload?.durability,
748
+ langsmith_tracer: payload?._langsmithTracer ? {
749
+ project_name: payload?._langsmithTracer?.projectName,
750
+ example_id: payload?._langsmithTracer?.exampleId
751
+ } : void 0
752
+ };
753
+ const endpoint = threadId === null ? "/runs" : `/threads/${threadId}/runs`;
754
+ const [run, response] = await this.fetch(endpoint, {
755
+ method: "POST",
756
+ json,
757
+ signal: payload?.signal,
758
+ withResponse: true
759
+ });
760
+ const runMetadata = getRunMetadataFromResponse(response);
761
+ if (runMetadata) payload?.onRunCreated?.(runMetadata);
762
+ return run;
763
+ }
764
+ /**
765
+ * Create a batch of stateless background runs.
766
+ *
767
+ * @param payloads An array of payloads for creating runs.
768
+ * @returns An array of created runs.
769
+ */
770
+ async createBatch(payloads, options) {
771
+ const filteredPayloads = payloads.map((payload) => ({
772
+ ...payload,
773
+ assistant_id: payload.assistantId
774
+ })).map((payload) => {
775
+ return Object.fromEntries(Object.entries(payload).filter(([_, v]) => v !== void 0));
776
+ });
777
+ return this.fetch("/runs/batch", {
778
+ method: "POST",
779
+ json: filteredPayloads,
780
+ signal: options?.signal
781
+ });
782
+ }
783
+ /**
784
+ * Create a run and wait for it to complete.
785
+ *
786
+ * @param threadId The ID of the thread.
787
+ * @param assistantId Assistant ID to use for this run.
788
+ * @param payload Payload for creating a run.
789
+ * @returns The last values chunk of the thread.
790
+ */
791
+ async wait(threadId, assistantId, payload) {
792
+ const json = {
793
+ input: payload?.input,
794
+ command: payload?.command,
795
+ config: payload?.config,
796
+ context: payload?.context,
797
+ metadata: payload?.metadata,
798
+ assistant_id: assistantId,
799
+ interrupt_before: payload?.interruptBefore,
800
+ interrupt_after: payload?.interruptAfter,
801
+ checkpoint: payload?.checkpoint,
802
+ checkpoint_id: payload?.checkpointId,
803
+ webhook: payload?.webhook,
804
+ multitask_strategy: payload?.multitaskStrategy,
805
+ on_completion: payload?.onCompletion,
806
+ on_disconnect: payload?.onDisconnect,
807
+ after_seconds: payload?.afterSeconds,
808
+ if_not_exists: payload?.ifNotExists,
809
+ checkpoint_during: payload?.checkpointDuring,
810
+ durability: payload?.durability,
811
+ langsmith_tracer: payload?._langsmithTracer ? {
812
+ project_name: payload?._langsmithTracer?.projectName,
813
+ example_id: payload?._langsmithTracer?.exampleId
814
+ } : void 0
815
+ };
816
+ const endpoint = threadId == null ? `/runs/wait` : `/threads/${threadId}/runs/wait`;
817
+ const [run, response] = await this.fetch(endpoint, {
818
+ method: "POST",
819
+ json,
820
+ timeoutMs: null,
821
+ signal: payload?.signal,
822
+ withResponse: true
823
+ });
824
+ const runMetadata = getRunMetadataFromResponse(response);
825
+ if (runMetadata) payload?.onRunCreated?.(runMetadata);
826
+ const raiseError = payload?.raiseError !== void 0 ? payload.raiseError : true;
827
+ if (raiseError && "__error__" in run && typeof run.__error__ === "object" && run.__error__ && "error" in run.__error__ && "message" in run.__error__) throw new Error(`${run.__error__?.error}: ${run.__error__?.message}`);
828
+ return run;
829
+ }
830
+ /**
831
+ * List all runs for a thread.
832
+ *
833
+ * @param threadId The ID of the thread.
834
+ * @param options Filtering and pagination options.
835
+ * @returns List of runs.
836
+ */
837
+ async list(threadId, options) {
838
+ return this.fetch(`/threads/${threadId}/runs`, {
839
+ params: {
840
+ limit: options?.limit ?? 10,
841
+ offset: options?.offset ?? 0,
842
+ status: options?.status ?? void 0,
843
+ select: options?.select ?? void 0
844
+ },
845
+ signal: options?.signal
846
+ });
847
+ }
848
+ /**
849
+ * Get a run by ID.
850
+ *
851
+ * @param threadId The ID of the thread.
852
+ * @param runId The ID of the run.
853
+ * @returns The run.
854
+ */
855
+ async get(threadId, runId, options) {
856
+ return this.fetch(`/threads/${threadId}/runs/${runId}`, { signal: options?.signal });
857
+ }
858
+ /**
859
+ * Cancel a run.
860
+ *
861
+ * @param threadId The ID of the thread.
862
+ * @param runId The ID of the run.
863
+ * @param wait Whether to block when canceling
864
+ * @param action Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. Default is `interrupt`.
865
+ * @returns
866
+ */
867
+ async cancel(threadId, runId, wait = false, action = "interrupt", options = {}) {
868
+ return this.fetch(`/threads/${threadId}/runs/${runId}/cancel`, {
869
+ method: "POST",
870
+ params: {
871
+ wait: wait ? "1" : "0",
872
+ action
873
+ },
874
+ signal: options?.signal
875
+ });
876
+ }
877
+ /**
878
+ * Block until a run is done.
879
+ *
880
+ * @param threadId The ID of the thread.
881
+ * @param runId The ID of the run.
882
+ * @returns
883
+ */
884
+ async join(threadId, runId, options) {
885
+ return this.fetch(`/threads/${threadId}/runs/${runId}/join`, {
886
+ timeoutMs: null,
887
+ signal: options?.signal
888
+ });
889
+ }
890
+ /**
891
+ * Stream output from a run in real-time, until the run is done.
892
+ *
893
+ * @param threadId The ID of the thread. Can be set to `null` | `undefined` for stateless runs.
894
+ * @param runId The ID of the run.
895
+ * @param options Additional options for controlling the stream behavior:
896
+ * - signal: An AbortSignal that can be used to cancel the stream request
897
+ * - lastEventId: The ID of the last event received. Can be used to reconnect to a stream without losing events.
898
+ * - cancelOnDisconnect: When true, automatically cancels the run if the client disconnects from the stream
899
+ * - streamMode: Controls what types of events to receive from the stream (can be a single mode or array of modes)
900
+ * Must be a subset of the stream modes passed when creating the run. Background runs default to having the union of all
901
+ * stream modes enabled.
902
+ * @returns An async generator yielding stream parts.
903
+ */
904
+ async *joinStream(threadId, runId, options) {
905
+ const opts = typeof options === "object" && options != null && options instanceof AbortSignal ? { signal: options } : options;
906
+ yield* this.streamWithRetry({
907
+ endpoint: threadId != null ? `/threads/${threadId}/runs/${runId}/stream` : `/runs/${runId}/stream`,
908
+ method: "GET",
909
+ signal: opts?.signal,
910
+ headers: opts?.lastEventId ? { "Last-Event-ID": opts.lastEventId } : void 0,
911
+ params: {
912
+ cancel_on_disconnect: opts?.cancelOnDisconnect ? "1" : "0",
913
+ stream_mode: opts?.streamMode
914
+ }
915
+ });
916
+ }
917
+ /**
918
+ * Delete a run.
919
+ *
920
+ * @param threadId The ID of the thread.
921
+ * @param runId The ID of the run.
922
+ * @returns
923
+ */
924
+ async delete(threadId, runId, options) {
925
+ return this.fetch(`/threads/${threadId}/runs/${runId}`, {
926
+ method: "DELETE",
927
+ signal: options?.signal
928
+ });
929
+ }
930
+ };
931
+ var StoreClient = class extends BaseClient {
932
+ /**
933
+ * Store or update an item.
934
+ *
935
+ * @param namespace A list of strings representing the namespace path.
936
+ * @param key The unique identifier for the item within the namespace.
937
+ * @param value A dictionary containing the item's data.
938
+ * @param options.index Controls search indexing - null (use defaults), false (disable), or list of field paths to index.
939
+ * @param options.ttl Optional time-to-live in minutes for the item, or null for no expiration.
940
+ * @returns Promise<void>
941
+ *
942
+ * @example
943
+ * ```typescript
944
+ * await client.store.putItem(
945
+ * ["documents", "user123"],
946
+ * "item456",
947
+ * { title: "My Document", content: "Hello World" },
948
+ * { ttl: 60 } // expires in 60 minutes
949
+ * );
950
+ * ```
951
+ */
952
+ async putItem(namespace, key, value, options) {
953
+ namespace.forEach((label) => {
954
+ if (label.includes(".")) throw new Error(`Invalid namespace label '${label}'. Namespace labels cannot contain periods ('.')`);
955
+ });
956
+ const payload = {
957
+ namespace,
958
+ key,
959
+ value,
960
+ index: options?.index,
961
+ ttl: options?.ttl
962
+ };
963
+ return this.fetch("/store/items", {
964
+ method: "PUT",
965
+ json: payload,
966
+ signal: options?.signal
967
+ });
968
+ }
969
+ /**
970
+ * Retrieve a single item.
971
+ *
972
+ * @param namespace A list of strings representing the namespace path.
973
+ * @param key The unique identifier for the item.
974
+ * @param options.refreshTtl Whether to refresh the TTL on this read operation. If null, uses the store's default behavior.
975
+ * @returns Promise<Item>
976
+ *
977
+ * @example
978
+ * ```typescript
979
+ * const item = await client.store.getItem(
980
+ * ["documents", "user123"],
981
+ * "item456",
982
+ * { refreshTtl: true }
983
+ * );
984
+ * console.log(item);
985
+ * // {
986
+ * // namespace: ["documents", "user123"],
987
+ * // key: "item456",
988
+ * // value: { title: "My Document", content: "Hello World" },
989
+ * // createdAt: "2024-07-30T12:00:00Z",
990
+ * // updatedAt: "2024-07-30T12:00:00Z"
991
+ * // }
992
+ * ```
993
+ */
994
+ async getItem(namespace, key, options) {
995
+ namespace.forEach((label) => {
996
+ if (label.includes(".")) throw new Error(`Invalid namespace label '${label}'. Namespace labels cannot contain periods ('.')`);
997
+ });
998
+ const params = {
999
+ namespace: namespace.join("."),
1000
+ key
1001
+ };
1002
+ if (options?.refreshTtl !== void 0) params.refresh_ttl = options.refreshTtl;
1003
+ const response = await this.fetch("/store/items", {
1004
+ params,
1005
+ signal: options?.signal
1006
+ });
1007
+ return response ? {
1008
+ ...response,
1009
+ createdAt: response.created_at,
1010
+ updatedAt: response.updated_at
1011
+ } : null;
1012
+ }
1013
+ /**
1014
+ * Delete an item.
1015
+ *
1016
+ * @param namespace A list of strings representing the namespace path.
1017
+ * @param key The unique identifier for the item.
1018
+ * @returns Promise<void>
1019
+ */
1020
+ async deleteItem(namespace, key, options) {
1021
+ namespace.forEach((label) => {
1022
+ if (label.includes(".")) throw new Error(`Invalid namespace label '${label}'. Namespace labels cannot contain periods ('.')`);
1023
+ });
1024
+ return this.fetch("/store/items", {
1025
+ method: "DELETE",
1026
+ json: {
1027
+ namespace,
1028
+ key
1029
+ },
1030
+ signal: options?.signal
1031
+ });
1032
+ }
1033
+ /**
1034
+ * Search for items within a namespace prefix.
1035
+ *
1036
+ * @param namespacePrefix List of strings representing the namespace prefix.
1037
+ * @param options.filter Optional dictionary of key-value pairs to filter results.
1038
+ * @param options.limit Maximum number of items to return (default is 10).
1039
+ * @param options.offset Number of items to skip before returning results (default is 0).
1040
+ * @param options.query Optional search query.
1041
+ * @param options.refreshTtl Whether to refresh the TTL on items returned by this search. If null, uses the store's default behavior.
1042
+ * @returns Promise<SearchItemsResponse>
1043
+ *
1044
+ * @example
1045
+ * ```typescript
1046
+ * const results = await client.store.searchItems(
1047
+ * ["documents"],
1048
+ * {
1049
+ * filter: { author: "John Doe" },
1050
+ * limit: 5,
1051
+ * refreshTtl: true
1052
+ * }
1053
+ * );
1054
+ * console.log(results);
1055
+ * // {
1056
+ * // items: [
1057
+ * // {
1058
+ * // namespace: ["documents", "user123"],
1059
+ * // key: "item789",
1060
+ * // value: { title: "Another Document", author: "John Doe" },
1061
+ * // createdAt: "2024-07-30T12:00:00Z",
1062
+ * // updatedAt: "2024-07-30T12:00:00Z"
1063
+ * // },
1064
+ * // // ... additional items ...
1065
+ * // ]
1066
+ * // }
1067
+ * ```
1068
+ */
1069
+ async searchItems(namespacePrefix, options) {
1070
+ const payload = {
1071
+ namespace_prefix: namespacePrefix,
1072
+ filter: options?.filter,
1073
+ limit: options?.limit ?? 10,
1074
+ offset: options?.offset ?? 0,
1075
+ query: options?.query,
1076
+ refresh_ttl: options?.refreshTtl
1077
+ };
1078
+ const response = await this.fetch("/store/items/search", {
1079
+ method: "POST",
1080
+ json: payload,
1081
+ signal: options?.signal
1082
+ });
1083
+ return { items: response.items.map((item) => ({
1084
+ ...item,
1085
+ createdAt: item.created_at,
1086
+ updatedAt: item.updated_at
1087
+ })) };
1088
+ }
1089
+ /**
1090
+ * List namespaces with optional match conditions.
1091
+ *
1092
+ * @param options.prefix Optional list of strings representing the prefix to filter namespaces.
1093
+ * @param options.suffix Optional list of strings representing the suffix to filter namespaces.
1094
+ * @param options.maxDepth Optional integer specifying the maximum depth of namespaces to return.
1095
+ * @param options.limit Maximum number of namespaces to return (default is 100).
1096
+ * @param options.offset Number of namespaces to skip before returning results (default is 0).
1097
+ * @returns Promise<ListNamespaceResponse>
1098
+ */
1099
+ async listNamespaces(options) {
1100
+ const payload = {
1101
+ prefix: options?.prefix,
1102
+ suffix: options?.suffix,
1103
+ max_depth: options?.maxDepth,
1104
+ limit: options?.limit ?? 100,
1105
+ offset: options?.offset ?? 0
1106
+ };
1107
+ return this.fetch("/store/namespaces", {
1108
+ method: "POST",
1109
+ json: payload,
1110
+ signal: options?.signal
1111
+ });
1112
+ }
1113
+ };
1114
+ var UiClient = class UiClient2 extends BaseClient {
1115
+ static promiseCache = {};
1116
+ static getOrCached(key, fn) {
1117
+ if (UiClient2.promiseCache[key] != null) return UiClient2.promiseCache[key];
1118
+ const promise = fn();
1119
+ UiClient2.promiseCache[key] = promise;
1120
+ return promise;
1121
+ }
1122
+ async getComponent(assistantId, agentName) {
1123
+ return UiClient2.getOrCached(`${this.apiUrl}-${assistantId}-${agentName}`, async () => {
1124
+ let [url, init] = this.prepareFetchOptions(`/ui/${assistantId}`, {
1125
+ headers: {
1126
+ Accept: "text/html",
1127
+ "Content-Type": "application/json"
1128
+ },
1129
+ method: "POST",
1130
+ json: { name: agentName }
1131
+ });
1132
+ if (this.onRequest != null) init = await this.onRequest(url, init);
1133
+ const response = await this.asyncCaller.fetch(url, init);
1134
+ return response.text();
1135
+ });
1136
+ }
1137
+ };
1138
+ var Client = class {
1139
+ /**
1140
+ * The client for interacting with assistants.
1141
+ */
1142
+ assistants;
1143
+ /**
1144
+ * The client for interacting with threads.
1145
+ */
1146
+ threads;
1147
+ /**
1148
+ * The client for interacting with runs.
1149
+ */
1150
+ runs;
1151
+ /**
1152
+ * The client for interacting with cron runs.
1153
+ */
1154
+ crons;
1155
+ /**
1156
+ * The client for interacting with the KV store.
1157
+ */
1158
+ store;
1159
+ /**
1160
+ * The client for interacting with the UI.
1161
+ * @internal Used by LoadExternalComponent and the API might change in the future.
1162
+ */
1163
+ "~ui";
1164
+ /**
1165
+ * @internal Used to obtain a stable key representing the client.
1166
+ */
1167
+ "~configHash";
1168
+ constructor(config) {
1169
+ this["~configHash"] = (() => JSON.stringify({
1170
+ apiUrl: config?.apiUrl,
1171
+ apiKey: config?.apiKey,
1172
+ timeoutMs: config?.timeoutMs,
1173
+ defaultHeaders: config?.defaultHeaders,
1174
+ maxConcurrency: config?.callerOptions?.maxConcurrency,
1175
+ maxRetries: config?.callerOptions?.maxRetries,
1176
+ callbacks: {
1177
+ onFailedResponseHook: config?.callerOptions?.onFailedResponseHook != null,
1178
+ onRequest: config?.onRequest != null,
1179
+ fetch: config?.callerOptions?.fetch != null
1180
+ }
1181
+ }))();
1182
+ this.assistants = new AssistantsClient(config);
1183
+ this.threads = new ThreadsClient(config);
1184
+ this.runs = new RunsClient(config);
1185
+ this.crons = new CronsClient(config);
1186
+ this.store = new StoreClient(config);
1187
+ this["~ui"] = new UiClient(config);
1188
+ }
1189
+ };
1190
+ function getClientConfigHash(client) {
1191
+ return client["~configHash"];
1192
+ }
1193
+ export {
1194
+ AssistantsClient,
1195
+ Client,
1196
+ CronsClient,
1197
+ RunsClient,
1198
+ StoreClient,
1199
+ ThreadsClient,
1200
+ getApiKey,
1201
+ getClientConfigHash
1202
+ };
1203
+ //# sourceMappingURL=index.es40.js.map