langgraph-ui-components 0.0.4 → 0.0.7

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