langgraph-ui-components 0.0.10 → 0.0.11-testing

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 (393) hide show
  1. package/dist/index.es.js +3 -2
  2. package/dist/index.es10.js +25 -6
  3. package/dist/index.es10.js.map +1 -1
  4. package/dist/index.es100.js +131 -64
  5. package/dist/index.es100.js.map +1 -1
  6. package/dist/index.es101.js +65 -32
  7. package/dist/index.es101.js.map +1 -1
  8. package/dist/index.es102.js +34 -34
  9. package/dist/index.es102.js.map +1 -1
  10. package/dist/index.es103.js +35 -164
  11. package/dist/index.es103.js.map +1 -1
  12. package/dist/index.es104.js +156 -193
  13. package/dist/index.es104.js.map +1 -1
  14. package/dist/index.es105.js +202 -13
  15. package/dist/index.es105.js.map +1 -1
  16. package/dist/index.es106.js +13 -29
  17. package/dist/index.es106.js.map +1 -1
  18. package/dist/index.es107.js +25 -29
  19. package/dist/index.es107.js.map +1 -1
  20. package/dist/index.es108.js +24 -3147
  21. package/dist/index.es108.js.map +1 -1
  22. package/dist/index.es109.js +3151 -31
  23. package/dist/index.es109.js.map +1 -1
  24. package/dist/index.es110.js +21 -5
  25. package/dist/index.es110.js.map +1 -1
  26. package/dist/index.es111.js +64 -69
  27. package/dist/index.es111.js.map +1 -1
  28. package/dist/index.es112.js +3 -37
  29. package/dist/index.es112.js.map +1 -1
  30. package/dist/index.es113.js +16 -5
  31. package/dist/index.es113.js.map +1 -1
  32. package/dist/index.es114.js +7 -2
  33. package/dist/index.es114.js.map +1 -1
  34. package/dist/index.es115.js +2 -13
  35. package/dist/index.es115.js.map +1 -1
  36. package/dist/index.es116.js +9 -499
  37. package/dist/index.es116.js.map +1 -1
  38. package/dist/index.es117.js +501 -5
  39. package/dist/index.es117.js.map +1 -1
  40. package/dist/index.es118.js +7 -2
  41. package/dist/index.es118.js.map +1 -1
  42. package/dist/index.es119.js +2 -148
  43. package/dist/index.es119.js.map +1 -1
  44. package/dist/index.es120.js +118 -878
  45. package/dist/index.es120.js.map +1 -1
  46. package/dist/index.es121.js +877 -251
  47. package/dist/index.es121.js.map +1 -1
  48. package/dist/index.es122.js +281 -3
  49. package/dist/index.es122.js.map +1 -1
  50. package/dist/index.es123.js +3 -445
  51. package/dist/index.es123.js.map +1 -1
  52. package/dist/index.es124.js +437 -39
  53. package/dist/index.es124.js.map +1 -1
  54. package/dist/index.es125.js +46 -22
  55. package/dist/index.es125.js.map +1 -1
  56. package/dist/index.es126.js +21 -78
  57. package/dist/index.es126.js.map +1 -1
  58. package/dist/index.es127.js +76 -126
  59. package/dist/index.es127.js.map +1 -1
  60. package/dist/index.es128.js +125 -45
  61. package/dist/index.es128.js.map +1 -1
  62. package/dist/index.es129.js +48 -9
  63. package/dist/index.es129.js.map +1 -1
  64. package/dist/index.es130.js +10 -45
  65. package/dist/index.es130.js.map +1 -1
  66. package/dist/index.es131.js +43 -97
  67. package/dist/index.es131.js.map +1 -1
  68. package/dist/index.es132.js +94 -48
  69. package/dist/index.es132.js.map +1 -1
  70. package/dist/index.es133.js +51 -14
  71. package/dist/index.es133.js.map +1 -1
  72. package/dist/index.es134.js +1 -1
  73. package/dist/index.es135.js +1 -1
  74. package/dist/index.es138.js +1 -1
  75. package/dist/index.es139.js +1 -1
  76. package/dist/index.es140.js +1 -1
  77. package/dist/index.es141.js +1 -1
  78. package/dist/index.es142.js +1 -1
  79. package/dist/index.es143.js +1 -1
  80. package/dist/index.es144.js +1 -1
  81. package/dist/index.es145.js +1 -1
  82. package/dist/index.es146.js +1 -1
  83. package/dist/index.es147.js +1 -1
  84. package/dist/index.es148.js +1 -1
  85. package/dist/index.es149.js +1 -1
  86. package/dist/index.es150.js +1 -1
  87. package/dist/index.es151.js +1 -1
  88. package/dist/index.es152.js +1 -1
  89. package/dist/index.es153.js +1 -1
  90. package/dist/index.es154.js +1 -1
  91. package/dist/index.es155.js +1 -1
  92. package/dist/index.es156.js +1 -1
  93. package/dist/index.es157.js +1 -1
  94. package/dist/index.es158.js +1 -1
  95. package/dist/index.es159.js +1 -1
  96. package/dist/index.es16.js +3 -3
  97. package/dist/index.es16.js.map +1 -1
  98. package/dist/index.es160.js +1 -1
  99. package/dist/index.es161.js +1 -1
  100. package/dist/index.es162.js +1 -1
  101. package/dist/index.es163.js +1 -1
  102. package/dist/index.es164.js +1 -1
  103. package/dist/index.es165.js +1 -1
  104. package/dist/index.es166.js +1 -1
  105. package/dist/index.es167.js +1 -1
  106. package/dist/index.es168.js +1 -1
  107. package/dist/index.es169.js +1 -1
  108. package/dist/index.es170.js +1 -1
  109. package/dist/index.es171.js +1 -1
  110. package/dist/index.es172.js +1 -1
  111. package/dist/index.es173.js +1 -1
  112. package/dist/index.es174.js +1 -1
  113. package/dist/index.es175.js +1 -1
  114. package/dist/index.es176.js +1 -1
  115. package/dist/index.es177.js +1 -1
  116. package/dist/index.es178.js +1 -1
  117. package/dist/index.es179.js +1 -1
  118. package/dist/index.es18.js +15 -15
  119. package/dist/index.es180.js +1 -1
  120. package/dist/index.es181.js +1 -1
  121. package/dist/index.es182.js +1 -1
  122. package/dist/index.es183.js +162 -13
  123. package/dist/index.es183.js.map +1 -1
  124. package/dist/index.es184.js +2 -89
  125. package/dist/index.es184.js.map +1 -1
  126. package/dist/index.es185.js +15 -2
  127. package/dist/index.es185.js.map +1 -1
  128. package/dist/index.es186.js +89 -2
  129. package/dist/index.es186.js.map +1 -1
  130. package/dist/index.es187.js +2 -2
  131. package/dist/index.es188.js +56 -2
  132. package/dist/index.es188.js.map +1 -1
  133. package/dist/index.es189.js +100 -2
  134. package/dist/index.es189.js.map +1 -1
  135. package/dist/index.es190.js +191 -2
  136. package/dist/index.es190.js.map +1 -1
  137. package/dist/index.es191.js +110 -2
  138. package/dist/index.es191.js.map +1 -1
  139. package/dist/index.es192.js +35 -2
  140. package/dist/index.es192.js.map +1 -1
  141. package/dist/index.es193.js +10 -2
  142. package/dist/index.es193.js.map +1 -1
  143. package/dist/index.es194.js +11 -2
  144. package/dist/index.es194.js.map +1 -1
  145. package/dist/index.es195.js +12 -2
  146. package/dist/index.es195.js.map +1 -1
  147. package/dist/index.es196.js +91 -2
  148. package/dist/index.es196.js.map +1 -1
  149. package/dist/index.es197.js +275 -2
  150. package/dist/index.es197.js.map +1 -1
  151. package/dist/index.es198.js +2 -2
  152. package/dist/index.es199.js +164 -2
  153. package/dist/index.es199.js.map +1 -1
  154. package/dist/index.es200.js +51 -2
  155. package/dist/index.es200.js.map +1 -1
  156. package/dist/index.es201.js +40 -2
  157. package/dist/index.es201.js.map +1 -1
  158. package/dist/index.es202.js +35 -2
  159. package/dist/index.es202.js.map +1 -1
  160. package/dist/index.es203.js +40 -2
  161. package/dist/index.es203.js.map +1 -1
  162. package/dist/index.es204.js +24 -2
  163. package/dist/index.es204.js.map +1 -1
  164. package/dist/index.es205.js +591 -2
  165. package/dist/index.es205.js.map +1 -1
  166. package/dist/index.es206.js +125 -2
  167. package/dist/index.es206.js.map +1 -1
  168. package/dist/index.es207.js +2 -2
  169. package/dist/index.es208.js +2 -2
  170. package/dist/index.es209.js +2 -2
  171. package/dist/index.es210.js +2 -2
  172. package/dist/index.es211.js +2 -2
  173. package/dist/index.es212.js +2 -2
  174. package/dist/index.es213.js +2 -2
  175. package/dist/index.es214.js +2 -2
  176. package/dist/index.es215.js +2 -2
  177. package/dist/index.es216.js +2 -2
  178. package/dist/index.es217.js +2 -2
  179. package/dist/index.es218.js +2 -2
  180. package/dist/index.es219.js +2 -2
  181. package/dist/index.es220.js +2 -2
  182. package/dist/index.es221.js +2 -2
  183. package/dist/index.es222.js +2 -2
  184. package/dist/index.es223.js +2 -2
  185. package/dist/index.es224.js +2 -2
  186. package/dist/index.es225.js +2 -2
  187. package/dist/index.es226.js +2 -2
  188. package/dist/index.es227.js +2 -2
  189. package/dist/index.es228.js +2 -2
  190. package/dist/index.es229.js +2 -2
  191. package/dist/index.es230.js +2 -2
  192. package/dist/index.es231.js +2 -56
  193. package/dist/index.es231.js.map +1 -1
  194. package/dist/index.es232.js +2 -100
  195. package/dist/index.es232.js.map +1 -1
  196. package/dist/index.es233.js +2 -191
  197. package/dist/index.es233.js.map +1 -1
  198. package/dist/index.es234.js +2 -110
  199. package/dist/index.es234.js.map +1 -1
  200. package/dist/index.es235.js +2 -35
  201. package/dist/index.es235.js.map +1 -1
  202. package/dist/index.es236.js +2 -10
  203. package/dist/index.es236.js.map +1 -1
  204. package/dist/index.es237.js +2 -11
  205. package/dist/index.es237.js.map +1 -1
  206. package/dist/index.es238.js +2 -12
  207. package/dist/index.es238.js.map +1 -1
  208. package/dist/index.es239.js +2 -91
  209. package/dist/index.es239.js.map +1 -1
  210. package/dist/index.es24.js +1 -1
  211. package/dist/index.es240.js +2 -275
  212. package/dist/index.es240.js.map +1 -1
  213. package/dist/index.es241.js +2 -2
  214. package/dist/index.es242.js +2 -164
  215. package/dist/index.es242.js.map +1 -1
  216. package/dist/index.es243.js +2 -51
  217. package/dist/index.es243.js.map +1 -1
  218. package/dist/index.es244.js +2 -40
  219. package/dist/index.es244.js.map +1 -1
  220. package/dist/index.es245.js +2 -35
  221. package/dist/index.es245.js.map +1 -1
  222. package/dist/index.es246.js +2 -40
  223. package/dist/index.es246.js.map +1 -1
  224. package/dist/index.es247.js +2 -24
  225. package/dist/index.es247.js.map +1 -1
  226. package/dist/index.es248.js +2 -591
  227. package/dist/index.es248.js.map +1 -1
  228. package/dist/index.es249.js +2 -125
  229. package/dist/index.es249.js.map +1 -1
  230. package/dist/index.es25.js +3 -1
  231. package/dist/index.es25.js.map +1 -1
  232. package/dist/index.es250.js +2 -164
  233. package/dist/index.es250.js.map +1 -1
  234. package/dist/index.es251.js +2 -2
  235. package/dist/index.es252.js +2 -2
  236. package/dist/index.es253.js +1 -1
  237. package/dist/index.es258.js +1 -1
  238. package/dist/index.es260.js +2 -2
  239. package/dist/index.es262.js +2 -2
  240. package/dist/index.es265.js +1 -1
  241. package/dist/index.es267.js +1 -1
  242. package/dist/index.es277.js +2 -147
  243. package/dist/index.es277.js.map +1 -1
  244. package/dist/index.es278.js +126 -167
  245. package/dist/index.es278.js.map +1 -1
  246. package/dist/index.es279.js +188 -2
  247. package/dist/index.es279.js.map +1 -1
  248. package/dist/index.es280.js +1 -1
  249. package/dist/index.es283.js +1 -1
  250. package/dist/index.es288.js +1 -1
  251. package/dist/index.es29.js +1 -1
  252. package/dist/index.es3.js +24 -9
  253. package/dist/index.es3.js.map +1 -1
  254. package/dist/index.es300.js +1 -1
  255. package/dist/index.es302.js +1 -1
  256. package/dist/index.es31.js +7 -7
  257. package/dist/index.es314.js +1 -1
  258. package/dist/index.es32.js +1 -1
  259. package/dist/index.es334.js +2 -2
  260. package/dist/index.es35.js +4 -4
  261. package/dist/index.es36.js +1185 -111
  262. package/dist/index.es36.js.map +1 -1
  263. package/dist/index.es37.js +7 -71
  264. package/dist/index.es37.js.map +1 -1
  265. package/dist/index.es38.js +9 -18
  266. package/dist/index.es38.js.map +1 -1
  267. package/dist/index.es39.js +136 -250
  268. package/dist/index.es39.js.map +1 -1
  269. package/dist/index.es4.js +2 -1
  270. package/dist/index.es4.js.map +1 -1
  271. package/dist/index.es40.js +116 -41
  272. package/dist/index.es40.js.map +1 -1
  273. package/dist/index.es41.js +64 -208
  274. package/dist/index.es41.js.map +1 -1
  275. package/dist/index.es42.js +17 -66
  276. package/dist/index.es42.js.map +1 -1
  277. package/dist/index.es43.js +236 -117
  278. package/dist/index.es43.js.map +1 -1
  279. package/dist/index.es44.js +38 -19
  280. package/dist/index.es44.js.map +1 -1
  281. package/dist/index.es45.js +202 -217
  282. package/dist/index.es45.js.map +1 -1
  283. package/dist/index.es46.js +65 -7
  284. package/dist/index.es46.js.map +1 -1
  285. package/dist/index.es47.js +131 -1181
  286. package/dist/index.es47.js.map +1 -1
  287. package/dist/index.es48.js +25 -8
  288. package/dist/index.es48.js.map +1 -1
  289. package/dist/index.es49.js +218 -135
  290. package/dist/index.es49.js.map +1 -1
  291. package/dist/index.es5.js.map +1 -1
  292. package/dist/index.es50.js +5 -208
  293. package/dist/index.es50.js.map +1 -1
  294. package/dist/index.es51.js +208 -5
  295. package/dist/index.es51.js.map +1 -1
  296. package/dist/index.es52.js +90 -7
  297. package/dist/index.es52.js.map +1 -1
  298. package/dist/index.es53.js +6 -92
  299. package/dist/index.es53.js.map +1 -1
  300. package/dist/index.es54.js +14 -3
  301. package/dist/index.es54.js.map +1 -1
  302. package/dist/index.es55.js +8 -36
  303. package/dist/index.es55.js.map +1 -1
  304. package/dist/index.es56.js +83 -61
  305. package/dist/index.es56.js.map +1 -1
  306. package/dist/index.es57.js +3 -37
  307. package/dist/index.es57.js.map +1 -1
  308. package/dist/index.es58.js +34 -304
  309. package/dist/index.es58.js.map +1 -1
  310. package/dist/index.es59.js +72 -9
  311. package/dist/index.es59.js.map +1 -1
  312. package/dist/index.es60.js +32 -85
  313. package/dist/index.es60.js.map +1 -1
  314. package/dist/index.es61.js +304 -6
  315. package/dist/index.es61.js.map +1 -1
  316. package/dist/index.es62.js +9 -15
  317. package/dist/index.es62.js.map +1 -1
  318. package/dist/index.es63.js +3 -3
  319. package/dist/index.es64.js +5 -142
  320. package/dist/index.es64.js.map +1 -1
  321. package/dist/index.es65.js +148 -285
  322. package/dist/index.es65.js.map +1 -1
  323. package/dist/index.es66.js +668 -62
  324. package/dist/index.es66.js.map +1 -1
  325. package/dist/index.es67.js +131 -201
  326. package/dist/index.es67.js.map +1 -1
  327. package/dist/index.es68.js +295 -29
  328. package/dist/index.es68.js.map +1 -1
  329. package/dist/index.es69.js +65 -8
  330. package/dist/index.es69.js.map +1 -1
  331. package/dist/index.es7.js +2 -1
  332. package/dist/index.es7.js.map +1 -1
  333. package/dist/index.es70.js +210 -9
  334. package/dist/index.es70.js.map +1 -1
  335. package/dist/index.es71.js +28 -181
  336. package/dist/index.es71.js.map +1 -1
  337. package/dist/index.es72.js +8 -23
  338. package/dist/index.es72.js.map +1 -1
  339. package/dist/index.es73.js +9 -1397
  340. package/dist/index.es73.js.map +1 -1
  341. package/dist/index.es74.js +187 -9
  342. package/dist/index.es74.js.map +1 -1
  343. package/dist/index.es75.js +24 -8
  344. package/dist/index.es75.js.map +1 -1
  345. package/dist/index.es76.js +1399 -5
  346. package/dist/index.es76.js.map +1 -1
  347. package/dist/index.es77.js +9 -163
  348. package/dist/index.es77.js.map +1 -1
  349. package/dist/index.es78.js +8 -672
  350. package/dist/index.es78.js.map +1 -1
  351. package/dist/index.es79.js +36 -20
  352. package/dist/index.es79.js.map +1 -1
  353. package/dist/index.es80.js +5 -68
  354. package/dist/index.es80.js.map +1 -1
  355. package/dist/index.es81.js +73 -3
  356. package/dist/index.es81.js.map +1 -1
  357. package/dist/index.es82.js +36 -11
  358. package/dist/index.es82.js.map +1 -1
  359. package/dist/index.es83.js +10 -38
  360. package/dist/index.es83.js.map +1 -1
  361. package/dist/index.es84.js +34 -28
  362. package/dist/index.es84.js.map +1 -1
  363. package/dist/index.es85.js +28 -226
  364. package/dist/index.es85.js.map +1 -1
  365. package/dist/index.es86.js +228 -26
  366. package/dist/index.es86.js.map +1 -1
  367. package/dist/index.es87.js +26 -71
  368. package/dist/index.es87.js.map +1 -1
  369. package/dist/index.es88.js +41 -42
  370. package/dist/index.es88.js.map +1 -1
  371. package/dist/index.es89.js +71 -47
  372. package/dist/index.es89.js.map +1 -1
  373. package/dist/index.es90.js +37 -15
  374. package/dist/index.es90.js.map +1 -1
  375. package/dist/index.es91.js +6 -19
  376. package/dist/index.es91.js.map +1 -1
  377. package/dist/index.es92.js +40 -54
  378. package/dist/index.es92.js.map +1 -1
  379. package/dist/index.es93.js +56 -12
  380. package/dist/index.es93.js.map +1 -1
  381. package/dist/index.es94.js +13 -137
  382. package/dist/index.es94.js.map +1 -1
  383. package/dist/index.es95.js +135 -19
  384. package/dist/index.es95.js.map +1 -1
  385. package/dist/index.es96.js +18 -179
  386. package/dist/index.es96.js.map +1 -1
  387. package/dist/index.es97.js +163 -222
  388. package/dist/index.es97.js.map +1 -1
  389. package/dist/index.es98.js +187 -301
  390. package/dist/index.es98.js.map +1 -1
  391. package/dist/index.es99.js +348 -130
  392. package/dist/index.es99.js.map +1 -1
  393. package/package.json +1 -1
@@ -1,11 +1,94 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all) __defProp(target, name, {
4
- get: all[name],
5
- enumerable: true
6
- });
1
+ import { _getFetchImplementation } from "./index.es64.js";
2
+ import pRetry from "./index.es65.js";
3
+ import PQueue from "./index.es66.js";
4
+ const STATUS_NO_RETRY = [
5
+ 400,
6
+ 401,
7
+ 402,
8
+ 403,
9
+ 404,
10
+ 405,
11
+ 406,
12
+ 407,
13
+ 408,
14
+ 409,
15
+ 422
16
+ ];
17
+ function isResponse(x) {
18
+ if (x == null || typeof x !== "object") return false;
19
+ return "status" in x && "statusText" in x && "text" in x;
20
+ }
21
+ var HTTPError = class HTTPError2 extends Error {
22
+ status;
23
+ text;
24
+ response;
25
+ constructor(status, message, response) {
26
+ super(`HTTP ${status}: ${message}`);
27
+ this.status = status;
28
+ this.text = message;
29
+ this.response = response;
30
+ }
31
+ static async fromResponse(response, options) {
32
+ try {
33
+ return new HTTPError2(response.status, await response.text(), options?.includeResponse ? response : void 0);
34
+ } catch {
35
+ return new HTTPError2(response.status, response.statusText, options?.includeResponse ? response : void 0);
36
+ }
37
+ }
38
+ };
39
+ var AsyncCaller = class {
40
+ maxConcurrency;
41
+ maxRetries;
42
+ queue;
43
+ onFailedResponseHook;
44
+ customFetch;
45
+ constructor(params) {
46
+ this.maxConcurrency = params.maxConcurrency ?? Infinity;
47
+ this.maxRetries = params.maxRetries ?? 4;
48
+ if ("default" in PQueue) this.queue = new PQueue.default({ concurrency: this.maxConcurrency });
49
+ else this.queue = new PQueue({ concurrency: this.maxConcurrency });
50
+ this.onFailedResponseHook = params?.onFailedResponseHook;
51
+ this.customFetch = params.fetch;
52
+ }
53
+ call(callable, ...args) {
54
+ const { onFailedResponseHook } = this;
55
+ return this.queue.add(() => pRetry(() => callable(...args).catch(async (error) => {
56
+ if (error instanceof Error) throw error;
57
+ else if (isResponse(error)) throw await HTTPError.fromResponse(error, { includeResponse: !!onFailedResponseHook });
58
+ else throw new Error(error);
59
+ }), {
60
+ async onFailedAttempt({ error }) {
61
+ const errorMessage = error.message ?? "";
62
+ if (errorMessage.startsWith("Cancel") || errorMessage.startsWith("TimeoutError") || errorMessage.startsWith("AbortError")) throw error;
63
+ if (error?.code === "ECONNABORTED") throw error;
64
+ if (errorMessage.includes("ECONNREFUSED") || errorMessage.includes("fetch failed") || errorMessage.includes("Failed to fetch") || errorMessage.includes("NetworkError")) {
65
+ const connectionError = /* @__PURE__ */ new Error(`Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`);
66
+ connectionError.name = "ConnectionError";
67
+ throw connectionError;
68
+ }
69
+ if (error instanceof HTTPError) {
70
+ if (STATUS_NO_RETRY.includes(error.status)) throw error;
71
+ if (onFailedResponseHook && error.response) await onFailedResponseHook(error.response);
72
+ }
73
+ },
74
+ retries: this.maxRetries,
75
+ randomize: true
76
+ }), { throwOnTimeout: true });
77
+ }
78
+ callWithOptions(options, callable, ...args) {
79
+ if (options.signal) return Promise.race([this.call(callable, ...args), new Promise((_, reject) => {
80
+ options.signal?.addEventListener("abort", () => {
81
+ reject(/* @__PURE__ */ new Error("AbortError"));
82
+ });
83
+ })]);
84
+ return this.call(callable, ...args);
85
+ }
86
+ fetch(...args) {
87
+ const fetchFn = this.customFetch ?? _getFetchImplementation();
88
+ return this.call(() => fetchFn(...args).then((res) => res.ok ? res : Promise.reject(res)));
89
+ }
7
90
  };
8
91
  export {
9
- __export
92
+ AsyncCaller
10
93
  };
11
94
  //# sourceMappingURL=index.es52.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es52.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/rolldown_runtime.js"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\n\n//#endregion\nexport { __export };"],"names":[],"mappings":"AACA,IAAI,YAAY,OAAO;AACpB,IAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAS,QAAQ,IAAK,WAAU,QAAQ,MAAM;AAAA,IAC7C,KAAK,IAAI,IAAI;AAAA,IACb,YAAY;AAAA,EACd,CAAE;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es52.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/async_caller.js"],"sourcesContent":["import { _getFetchImplementation } from \"../singletons/fetch.js\";\nimport pRetry from \"p-retry\";\nimport PQueueMod from \"p-queue\";\n\n//#region src/utils/async_caller.ts\nconst STATUS_NO_RETRY = [\n\t400,\n\t401,\n\t402,\n\t403,\n\t404,\n\t405,\n\t406,\n\t407,\n\t408,\n\t409,\n\t422\n];\n/**\n* Do not rely on globalThis.Response, rather just\n* do duck typing\n*/\nfunction isResponse(x) {\n\tif (x == null || typeof x !== \"object\") return false;\n\treturn \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n/**\n* Utility error to properly handle failed requests\n*/\nvar HTTPError = class HTTPError extends Error {\n\tstatus;\n\ttext;\n\tresponse;\n\tconstructor(status, message, response) {\n\t\tsuper(`HTTP ${status}: ${message}`);\n\t\tthis.status = status;\n\t\tthis.text = message;\n\t\tthis.response = response;\n\t}\n\tstatic async fromResponse(response, options) {\n\t\ttry {\n\t\t\treturn new HTTPError(response.status, await response.text(), options?.includeResponse ? response : void 0);\n\t\t} catch {\n\t\t\treturn new HTTPError(response.status, response.statusText, options?.includeResponse ? response : void 0);\n\t\t}\n\t}\n};\n/**\n* A class that can be used to make async calls with concurrency and retry logic.\n*\n* This is useful for making calls to any kind of \"expensive\" external resource,\n* be it because it's rate-limited, subject to network issues, etc.\n*\n* Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n* to `Infinity`. This means that by default, all calls will be made in parallel.\n*\n* Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n* means that by default, each call will be retried up to 5 times, with an\n* exponential backoff between each attempt.\n*/\nvar AsyncCaller = class {\n\tmaxConcurrency;\n\tmaxRetries;\n\tqueue;\n\tonFailedResponseHook;\n\tcustomFetch;\n\tconstructor(params) {\n\t\tthis.maxConcurrency = params.maxConcurrency ?? Infinity;\n\t\tthis.maxRetries = params.maxRetries ?? 4;\n\t\tif (\"default\" in PQueueMod) this.queue = new PQueueMod.default({ concurrency: this.maxConcurrency });\n\t\telse this.queue = new PQueueMod({ concurrency: this.maxConcurrency });\n\t\tthis.onFailedResponseHook = params?.onFailedResponseHook;\n\t\tthis.customFetch = params.fetch;\n\t}\n\tcall(callable, ...args) {\n\t\tconst { onFailedResponseHook } = this;\n\t\treturn this.queue.add(() => pRetry(() => callable(...args).catch(async (error) => {\n\t\t\tif (error instanceof Error) throw error;\n\t\t\telse if (isResponse(error)) throw await HTTPError.fromResponse(error, { includeResponse: !!onFailedResponseHook });\n\t\t\telse throw new Error(error);\n\t\t}), {\n\t\t\tasync onFailedAttempt({ error }) {\n\t\t\t\tconst errorMessage = error.message ?? \"\";\n\t\t\t\tif (errorMessage.startsWith(\"Cancel\") || errorMessage.startsWith(\"TimeoutError\") || errorMessage.startsWith(\"AbortError\")) throw error;\n\t\t\t\tif (error?.code === \"ECONNABORTED\") throw error;\n\t\t\t\tif (errorMessage.includes(\"ECONNREFUSED\") || errorMessage.includes(\"fetch failed\") || errorMessage.includes(\"Failed to fetch\") || errorMessage.includes(\"NetworkError\")) {\n\t\t\t\t\tconst connectionError = /* @__PURE__ */ new Error(`Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`);\n\t\t\t\t\tconnectionError.name = \"ConnectionError\";\n\t\t\t\t\tthrow connectionError;\n\t\t\t\t}\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (STATUS_NO_RETRY.includes(error.status)) throw error;\n\t\t\t\t\tif (onFailedResponseHook && error.response) await onFailedResponseHook(error.response);\n\t\t\t\t}\n\t\t\t},\n\t\t\tretries: this.maxRetries,\n\t\t\trandomize: true\n\t\t}), { throwOnTimeout: true });\n\t}\n\tcallWithOptions(options, callable, ...args) {\n\t\tif (options.signal) return Promise.race([this.call(callable, ...args), new Promise((_, reject) => {\n\t\t\toptions.signal?.addEventListener(\"abort\", () => {\n\t\t\t\treject(/* @__PURE__ */ new Error(\"AbortError\"));\n\t\t\t});\n\t\t})]);\n\t\treturn this.call(callable, ...args);\n\t}\n\tfetch(...args) {\n\t\tconst fetchFn = this.customFetch ?? _getFetchImplementation();\n\t\treturn this.call(() => fetchFn(...args).then((res) => res.ok ? res : Promise.reject(res)));\n\t}\n};\n\n//#endregion\nexport { AsyncCaller };\n//# sourceMappingURL=async_caller.js.map"],"names":["HTTPError","PQueueMod"],"mappings":";;;AAKA,MAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAKA,SAAS,WAAW,GAAG;AACtB,MAAI,KAAK,QAAQ,OAAO,MAAM,SAAU,QAAO;AAC/C,SAAO,YAAY,KAAK,gBAAgB,KAAK,UAAU;AACxD;AAIA,IAAI,YAAY,MAAMA,mBAAkB,MAAM;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,QAAQ,SAAS,UAAU;AACtC,UAAM,QAAQ,MAAM,KAAK,OAAO,EAAE;AAClC,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,WAAW;AAAA,EACjB;AAAA,EACA,aAAa,aAAa,UAAU,SAAS;AAC5C,QAAI;AACH,aAAO,IAAIA,WAAU,SAAS,QAAQ,MAA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AAkC,oBAAI,MAAM,8GAA8G,YAAY,EAAE;AAC9K,0BAAgB,OAAO;AACvB,gBAAM;AAAA,QACP;AACA,YAAI,iBAAiB,WAAW;AAC/B,cAAI,gBAAgB,SAAS,MAAM,MAAM,EAAG,OAAM;AAClD,cAAI,wBAAwB,MAAM,SAAU,OAAM,qBAAqB,MAAM,QAAQ;AAAA,QACtF;AAAA,MACD;AAAA,MACA,SAAS,KAAK;AAAA,MACd,WAAW;AAAA,IACd,CAAG,GAAG,EAAE,gBAAgB,MAAM;AAAA,EAC7B;AAAA,EACA,gBAAgB,SAAS,aAAa,MAAM;AAC3C,QAAI,QAAQ,OAAQ,QAAO,QAAQ,KAAK,CAAC,KAAK,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,QAAQ,CAAC,GAAG,WAAW;AACjG,cAAQ,QAAQ,iBAAiB,SAAS,MAAM;AAC/C,eAAuB,oBAAI,MAAM,YAAY,CAAC;AAAA,MAC/C,CAAC;AAAA,IACF,CAAC,CAAC,CAAC;AACH,WAAO,KAAK,KAAK,UAAU,GAAG,IAAI;AAAA,EACnC;AAAA,EACA,SAAS,MAAM;AACd,UAAM,UAAU,KAAK,eAAe,wBAAuB;AAC3D,WAAO,KAAK,KAAK,MAAM,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,MAAM,QAAQ,OAAO,GAAG,CAAC,CAAC;AAAA,EAC1F;AACD;","x_google_ignoreList":[0]}
@@ -1,97 +1,11 @@
1
- function isDataContentBlock(content_block) {
2
- return typeof content_block === "object" && content_block !== null && "type" in content_block && typeof content_block.type === "string" && "source_type" in content_block && (content_block.source_type === "url" || content_block.source_type === "base64" || content_block.source_type === "text" || content_block.source_type === "id");
3
- }
4
- function isURLContentBlock(content_block) {
5
- return isDataContentBlock(content_block) && content_block.source_type === "url" && "url" in content_block && typeof content_block.url === "string";
6
- }
7
- function isBase64ContentBlock(content_block) {
8
- return isDataContentBlock(content_block) && content_block.source_type === "base64" && "data" in content_block && typeof content_block.data === "string";
9
- }
10
- function isPlainTextContentBlock(content_block) {
11
- return isDataContentBlock(content_block) && content_block.source_type === "text" && "text" in content_block && typeof content_block.text === "string";
12
- }
13
- function isIDContentBlock(content_block) {
14
- return isDataContentBlock(content_block) && content_block.source_type === "id" && "id" in content_block && typeof content_block.id === "string";
15
- }
16
- function convertToOpenAIImageBlock(content_block) {
17
- if (isDataContentBlock(content_block)) {
18
- if (content_block.source_type === "url") return {
19
- type: "image_url",
20
- image_url: { url: content_block.url }
21
- };
22
- if (content_block.source_type === "base64") {
23
- if (!content_block.mime_type) throw new Error("mime_type key is required for base64 data.");
24
- const mime_type = content_block.mime_type;
25
- return {
26
- type: "image_url",
27
- image_url: { url: `data:${mime_type};base64,${content_block.data}` }
28
- };
29
- }
30
- }
31
- throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.");
32
- }
33
- function parseMimeType(mime_type) {
34
- const parts = mime_type.split(";")[0].split("/");
35
- if (parts.length !== 2) throw new Error(`Invalid mime type: "${mime_type}" - does not match type/subtype format.`);
36
- const type = parts[0].trim();
37
- const subtype = parts[1].trim();
38
- if (type === "" || subtype === "") throw new Error(`Invalid mime type: "${mime_type}" - type or subtype is empty.`);
39
- const parameters = {};
40
- for (const parameterKvp of mime_type.split(";").slice(1)) {
41
- const parameterParts = parameterKvp.split("=");
42
- if (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
43
- const key = parameterParts[0].trim();
44
- const value = parameterParts[1].trim();
45
- if (key === "") throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
46
- parameters[key] = value;
47
- }
48
- return {
49
- type,
50
- subtype,
51
- parameters
52
- };
53
- }
54
- function parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {
55
- const formatMatch = data_url.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);
56
- let mime_type;
57
- if (formatMatch) {
58
- mime_type = formatMatch[1].toLowerCase();
59
- const data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];
60
- return {
61
- mime_type,
62
- data
63
- };
64
- }
65
- return void 0;
66
- }
67
- function convertToProviderContentBlock(block, converter) {
68
- if (block.type === "text") {
69
- if (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardTextBlock\` method.`);
70
- return converter.fromStandardTextBlock(block);
71
- }
72
- if (block.type === "image") {
73
- if (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardImageBlock\` method.`);
74
- return converter.fromStandardImageBlock(block);
75
- }
76
- if (block.type === "audio") {
77
- if (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardAudioBlock\` method.`);
78
- return converter.fromStandardAudioBlock(block);
79
- }
80
- if (block.type === "file") {
81
- if (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardFileBlock\` method.`);
82
- return converter.fromStandardFileBlock(block);
1
+ function getEnvironmentVariable(name) {
2
+ try {
3
+ return typeof process !== "undefined" ? process.env?.[name] : void 0;
4
+ } catch (e) {
5
+ return;
83
6
  }
84
- throw new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);
85
7
  }
86
8
  export {
87
- convertToOpenAIImageBlock,
88
- convertToProviderContentBlock,
89
- isBase64ContentBlock,
90
- isDataContentBlock,
91
- isIDContentBlock,
92
- isPlainTextContentBlock,
93
- isURLContentBlock,
94
- parseBase64DataUrl,
95
- parseMimeType
9
+ getEnvironmentVariable
96
10
  };
97
11
  //# sourceMappingURL=index.es53.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es53.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.js"],"sourcesContent":["//#region src/messages/content/data.ts\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isDataContentBlock(content_block) {\n\treturn typeof content_block === \"object\" && content_block !== null && \"type\" in content_block && typeof content_block.type === \"string\" && \"source_type\" in content_block && (content_block.source_type === \"url\" || content_block.source_type === \"base64\" || content_block.source_type === \"text\" || content_block.source_type === \"id\");\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isURLContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"url\" && \"url\" in content_block && typeof content_block.url === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isBase64ContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"base64\" && \"data\" in content_block && typeof content_block.data === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isPlainTextContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"text\" && \"text\" in content_block && typeof content_block.text === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isIDContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"id\" && \"id\" in content_block && typeof content_block.id === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToOpenAIImageBlock(content_block) {\n\tif (isDataContentBlock(content_block)) {\n\t\tif (content_block.source_type === \"url\") return {\n\t\t\ttype: \"image_url\",\n\t\t\timage_url: { url: content_block.url }\n\t\t};\n\t\tif (content_block.source_type === \"base64\") {\n\t\t\tif (!content_block.mime_type) throw new Error(\"mime_type key is required for base64 data.\");\n\t\t\tconst mime_type = content_block.mime_type;\n\t\t\treturn {\n\t\t\t\ttype: \"image_url\",\n\t\t\t\timage_url: { url: `data:${mime_type};base64,${content_block.data}` }\n\t\t\t};\n\t\t}\n\t}\n\tthrow new Error(\"Unsupported source type. Only 'url' and 'base64' are supported.\");\n}\n/**\n* Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n*\n* @param mime_type - The mime type to parse.\n* @returns An object containing the type, subtype, and parameters.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseMimeType(mime_type) {\n\tconst parts = mime_type.split(\";\")[0].split(\"/\");\n\tif (parts.length !== 2) throw new Error(`Invalid mime type: \"${mime_type}\" - does not match type/subtype format.`);\n\tconst type = parts[0].trim();\n\tconst subtype = parts[1].trim();\n\tif (type === \"\" || subtype === \"\") throw new Error(`Invalid mime type: \"${mime_type}\" - type or subtype is empty.`);\n\tconst parameters = {};\n\tfor (const parameterKvp of mime_type.split(\";\").slice(1)) {\n\t\tconst parameterParts = parameterKvp.split(\"=\");\n\t\tif (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tconst key = parameterParts[0].trim();\n\t\tconst value = parameterParts[1].trim();\n\t\tif (key === \"\") throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tparameters[key] = value;\n\t}\n\treturn {\n\t\ttype,\n\t\tsubtype,\n\t\tparameters\n\t};\n}\n/**\n* Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n*\n* @param dataUrl - The base64 data URL to parse.\n* @param asTypedArray - Whether to return the data as a typed array.\n* @returns The parsed data and mime type, or undefined if the data URL is invalid.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {\n\tconst formatMatch = data_url.match(/^data:(\\w+\\/\\w+);base64,([A-Za-z0-9+/]+=*)$/);\n\tlet mime_type;\n\tif (formatMatch) {\n\t\tmime_type = formatMatch[1].toLowerCase();\n\t\tconst data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];\n\t\treturn {\n\t\t\tmime_type,\n\t\t\tdata\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Convert from a standard data content block to a provider's proprietary data content block format.\n*\n* Don't override this method. Instead, override the more specific conversion methods and use this\n* method unmodified.\n*\n* @param block - The standard data content block to convert.\n* @returns The provider data content block.\n* @throws An error if the standard data content block type is not supported.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToProviderContentBlock(block, converter) {\n\tif (block.type === \"text\") {\n\t\tif (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardTextBlock\\` method.`);\n\t\treturn converter.fromStandardTextBlock(block);\n\t}\n\tif (block.type === \"image\") {\n\t\tif (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardImageBlock\\` method.`);\n\t\treturn converter.fromStandardImageBlock(block);\n\t}\n\tif (block.type === \"audio\") {\n\t\tif (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardAudioBlock\\` method.`);\n\t\treturn converter.fromStandardAudioBlock(block);\n\t}\n\tif (block.type === \"file\") {\n\t\tif (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardFileBlock\\` method.`);\n\t\treturn converter.fromStandardFileBlock(block);\n\t}\n\tthrow new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);\n}\n\n//#endregion\nexport { convertToOpenAIImageBlock, convertToProviderContentBlock, isBase64ContentBlock, isDataContentBlock, isIDContentBlock, isPlainTextContentBlock, isURLContentBlock, parseBase64DataUrl, parseMimeType };\n//# sourceMappingURL=data.js.map"],"names":[],"mappings":"AAIA,SAAS,mBAAmB,eAAe;AAC1C,SAAO,OAAO,kBAAkB,YAAY,kBAAkB,QAAQ,UAAU,iBAAiB,OAAO,cAAc,SAAS,YAAY,iBAAiB,kBAAkB,cAAc,gBAAgB,SAAS,cAAc,gBAAgB,YAAY,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AS;AAC3B,QAAI,CAAC,UAAU,uBAAwB,OAAM,IAAI,MAAM,iBAAiB,UAAU,YAAY,wDAAwD;AACtJ,WAAO,UAAU,uBAAuB,KAAK;AAAA,EAC9C;AACA,MAAI,MAAM,SAAS,QAAQ;AAC1B,QAAI,CAAC,UAAU,sBAAuB,OAAM,IAAI,MAAM,iBAAiB,UAAU,YAAY,uDAAuD;AACpJ,WAAO,UAAU,sBAAsB,KAAK;AAAA,EAC7C;AACA,QAAM,IAAI,MAAM,yCAAyC,MAAM,IAAI,gDAAgD;AACpH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es53.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/env.js"],"sourcesContent":["//#region src/utils/env.ts\nfunction getEnvironmentVariable(name) {\n\ttry {\n\t\treturn typeof process !== \"undefined\" ? process.env?.[name] : void 0;\n\t} catch (e) {\n\t\treturn;\n\t}\n}\n\n//#endregion\nexport { getEnvironmentVariable };\n//# sourceMappingURL=env.js.map"],"names":[],"mappings":"AACA,SAAS,uBAAuB,MAAM;AACrC,MAAI;AACH,WAAO,OAAO,YAAY,cAAc,QAAQ,MAAM,IAAI,IAAI;AAAA,EAC/D,SAAS,GAAG;AACX;AAAA,EACD;AACD;","x_google_ignoreList":[0]}
@@ -1,7 +1,18 @@
1
- function isMessage(message) {
2
- return typeof message === "object" && message !== null && "type" in message && "content" in message && (typeof message.content === "string" || Array.isArray(message.content));
1
+ function mergeSignals(...signals) {
2
+ const nonZeroSignals = signals.filter((signal) => signal != null);
3
+ if (nonZeroSignals.length === 0) return void 0;
4
+ if (nonZeroSignals.length === 1) return nonZeroSignals[0];
5
+ const controller = new AbortController();
6
+ for (const signal of signals) {
7
+ if (signal?.aborted) {
8
+ controller.abort(signal.reason);
9
+ return controller.signal;
10
+ }
11
+ signal?.addEventListener("abort", () => controller.abort(signal.reason), { once: true });
12
+ }
13
+ return controller.signal;
3
14
  }
4
15
  export {
5
- isMessage
16
+ mergeSignals
6
17
  };
7
18
  //# sourceMappingURL=index.es54.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es54.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/message.js"],"sourcesContent":["//#region src/messages/message.ts\n/**\n* Type guard to check if a value is a valid Message object.\n*\n* @param message - The value to check\n* @returns true if the value is a valid Message object, false otherwise\n*/\nfunction isMessage(message) {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message && (typeof message.content === \"string\" || Array.isArray(message.content));\n}\n\n//#endregion\nexport { isMessage };\n//# sourceMappingURL=message.js.map"],"names":[],"mappings":"AAOA,SAAS,UAAU,SAAS;AAC3B,SAAO,OAAO,YAAY,YAAY,YAAY,QAAQ,UAAU,WAAW,aAAa,YAAY,OAAO,QAAQ,YAAY,YAAY,MAAM,QAAQ,QAAQ,OAAO;AAC7K;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es54.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/signals.js"],"sourcesContent":["//#region src/utils/signals.ts\nfunction mergeSignals(...signals) {\n\tconst nonZeroSignals = signals.filter((signal) => signal != null);\n\tif (nonZeroSignals.length === 0) return void 0;\n\tif (nonZeroSignals.length === 1) return nonZeroSignals[0];\n\tconst controller = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal?.aborted) {\n\t\t\tcontroller.abort(signal.reason);\n\t\t\treturn controller.signal;\n\t\t}\n\t\tsignal?.addEventListener(\"abort\", () => controller.abort(signal.reason), { once: true });\n\t}\n\treturn controller.signal;\n}\n\n//#endregion\nexport { mergeSignals };\n//# sourceMappingURL=signals.js.map"],"names":[],"mappings":"AACA,SAAS,gBAAgB,SAAS;AACjC,QAAM,iBAAiB,QAAQ,OAAO,CAAC,WAAW,UAAU,IAAI;AAChE,MAAI,eAAe,WAAW,EAAG,QAAO;AACxC,MAAI,eAAe,WAAW,EAAG,QAAO,eAAe,CAAC;AACxD,QAAM,aAAa,IAAI,gBAAe;AACtC,aAAW,UAAU,SAAS;AAC7B,QAAI,QAAQ,SAAS;AACpB,iBAAW,MAAM,OAAO,MAAM;AAC9B,aAAO,WAAW;AAAA,IACnB;AACA,YAAQ,iBAAiB,SAAS,MAAM,WAAW,MAAM,OAAO,MAAM,GAAG,EAAE,MAAM,KAAI,CAAE;AAAA,EACxF;AACA,SAAO,WAAW;AACnB;","x_google_ignoreList":[0]}
@@ -1,39 +1,11 @@
1
- import { _mergeDicts } from "./index.es39.js";
2
- function mergeResponseMetadata(a, b) {
3
- const output = _mergeDicts(a, b) ?? {};
4
- return output;
5
- }
6
- function mergeModalitiesTokenDetails(a, b) {
7
- const output = {};
8
- if (a?.audio !== void 0 || b?.audio !== void 0) output.audio = (a?.audio ?? 0) + (b?.audio ?? 0);
9
- if (a?.image !== void 0 || b?.image !== void 0) output.image = (a?.image ?? 0) + (b?.image ?? 0);
10
- if (a?.video !== void 0 || b?.video !== void 0) output.video = (a?.video ?? 0) + (b?.video ?? 0);
11
- if (a?.document !== void 0 || b?.document !== void 0) output.document = (a?.document ?? 0) + (b?.document ?? 0);
12
- if (a?.text !== void 0 || b?.text !== void 0) output.text = (a?.text ?? 0) + (b?.text ?? 0);
13
- return output;
14
- }
15
- function mergeInputTokenDetails(a, b) {
16
- const output = { ...mergeModalitiesTokenDetails(a, b) };
17
- if (a?.cache_read !== void 0 || b?.cache_read !== void 0) output.cache_read = (a?.cache_read ?? 0) + (b?.cache_read ?? 0);
18
- if (a?.cache_creation !== void 0 || b?.cache_creation !== void 0) output.cache_creation = (a?.cache_creation ?? 0) + (b?.cache_creation ?? 0);
19
- return output;
20
- }
21
- function mergeOutputTokenDetails(a, b) {
22
- const output = { ...mergeModalitiesTokenDetails(a, b) };
23
- if (a?.reasoning !== void 0 || b?.reasoning !== void 0) output.reasoning = (a?.reasoning ?? 0) + (b?.reasoning ?? 0);
24
- return output;
25
- }
26
- function mergeUsageMetadata(a, b) {
27
- return {
28
- input_tokens: (a?.input_tokens ?? 0) + (b?.input_tokens ?? 0),
29
- output_tokens: (a?.output_tokens ?? 0) + (b?.output_tokens ?? 0),
30
- total_tokens: (a?.total_tokens ?? 0) + (b?.total_tokens ?? 0),
31
- input_token_details: mergeInputTokenDetails(a?.input_token_details, b?.input_token_details),
32
- output_token_details: mergeOutputTokenDetails(a?.output_token_details, b?.output_token_details)
33
- };
34
- }
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all) __defProp(target, name, {
4
+ get: all[name],
5
+ enumerable: true
6
+ });
7
+ };
35
8
  export {
36
- mergeResponseMetadata,
37
- mergeUsageMetadata
9
+ __export
38
10
  };
39
11
  //# sourceMappingURL=index.es55.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es55.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/metadata.js"],"sourcesContent":["import { _mergeDicts } from \"./base.js\";\n\n//#region src/messages/metadata.ts\nfunction mergeResponseMetadata(a, b) {\n\tconst output = _mergeDicts(a, b) ?? {};\n\treturn output;\n}\nfunction mergeModalitiesTokenDetails(a, b) {\n\tconst output = {};\n\tif (a?.audio !== void 0 || b?.audio !== void 0) output.audio = (a?.audio ?? 0) + (b?.audio ?? 0);\n\tif (a?.image !== void 0 || b?.image !== void 0) output.image = (a?.image ?? 0) + (b?.image ?? 0);\n\tif (a?.video !== void 0 || b?.video !== void 0) output.video = (a?.video ?? 0) + (b?.video ?? 0);\n\tif (a?.document !== void 0 || b?.document !== void 0) output.document = (a?.document ?? 0) + (b?.document ?? 0);\n\tif (a?.text !== void 0 || b?.text !== void 0) output.text = (a?.text ?? 0) + (b?.text ?? 0);\n\treturn output;\n}\nfunction mergeInputTokenDetails(a, b) {\n\tconst output = { ...mergeModalitiesTokenDetails(a, b) };\n\tif (a?.cache_read !== void 0 || b?.cache_read !== void 0) output.cache_read = (a?.cache_read ?? 0) + (b?.cache_read ?? 0);\n\tif (a?.cache_creation !== void 0 || b?.cache_creation !== void 0) output.cache_creation = (a?.cache_creation ?? 0) + (b?.cache_creation ?? 0);\n\treturn output;\n}\nfunction mergeOutputTokenDetails(a, b) {\n\tconst output = { ...mergeModalitiesTokenDetails(a, b) };\n\tif (a?.reasoning !== void 0 || b?.reasoning !== void 0) output.reasoning = (a?.reasoning ?? 0) + (b?.reasoning ?? 0);\n\treturn output;\n}\nfunction mergeUsageMetadata(a, b) {\n\treturn {\n\t\tinput_tokens: (a?.input_tokens ?? 0) + (b?.input_tokens ?? 0),\n\t\toutput_tokens: (a?.output_tokens ?? 0) + (b?.output_tokens ?? 0),\n\t\ttotal_tokens: (a?.total_tokens ?? 0) + (b?.total_tokens ?? 0),\n\t\tinput_token_details: mergeInputTokenDetails(a?.input_token_details, b?.input_token_details),\n\t\toutput_token_details: mergeOutputTokenDetails(a?.output_token_details, b?.output_token_details)\n\t};\n}\n\n//#endregion\nexport { mergeResponseMetadata, mergeUsageMetadata };\n//# sourceMappingURL=metadata.js.map"],"names":[],"mappings":";AAGA,SAAS,sBAAsB,GAAG,GAAG;AACpC,QAAM,SAAS,YAAY,GAAG,CAAC,KAAK,CAAA;AACpC,SAAO;AACR;AACA,SAAS,4BAA4B,GAAG,GAAG;AAC1C,QAAM,SAAS,CAAA;AACf,MAAI,GAAG,UAAU,UAAU,GAAG,UAAU,OAAQ,QAAO,SAAS,GAAG,SAAS,MAAM,GAAG,SAAS;AAC9F,MAAI,GAAG,UAAU,UAAU,GAAG,UAAU,OAAQ,QAAO,SAAS,GAAG,SAAS,MAAM,GAAG,SAAS;AAC9F,MAAI,GAAG,UAAU,UAA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/rolldown_runtime.js"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\n\n//#endregion\nexport { __export };"],"names":[],"mappings":"AACA,IAAI,YAAY,OAAO;AACpB,IAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAS,QAAQ,IAAK,WAAU,QAAQ,MAAM;AAAA,IAC7C,KAAK,IAAI,IAAI;AAAA,IACb,YAAY;AAAA,EACd,CAAE;AACF;","x_google_ignoreList":[0]}
@@ -1,75 +1,97 @@
1
- import { BaseMessageChunk, _mergeDicts, mergeContent, BaseMessage } from "./index.es39.js";
2
- var ChatMessage = class ChatMessage2 extends BaseMessage {
3
- static lc_name() {
4
- return "ChatMessage";
5
- }
6
- type = "generic";
7
- role;
8
- static _chatMessageClass() {
9
- return ChatMessage2;
10
- }
11
- constructor(fields, role) {
12
- if (typeof fields === "string" || Array.isArray(fields)) fields = {
13
- content: fields,
14
- role
1
+ function isDataContentBlock(content_block) {
2
+ return typeof content_block === "object" && content_block !== null && "type" in content_block && typeof content_block.type === "string" && "source_type" in content_block && (content_block.source_type === "url" || content_block.source_type === "base64" || content_block.source_type === "text" || content_block.source_type === "id");
3
+ }
4
+ function isURLContentBlock(content_block) {
5
+ return isDataContentBlock(content_block) && content_block.source_type === "url" && "url" in content_block && typeof content_block.url === "string";
6
+ }
7
+ function isBase64ContentBlock(content_block) {
8
+ return isDataContentBlock(content_block) && content_block.source_type === "base64" && "data" in content_block && typeof content_block.data === "string";
9
+ }
10
+ function isPlainTextContentBlock(content_block) {
11
+ return isDataContentBlock(content_block) && content_block.source_type === "text" && "text" in content_block && typeof content_block.text === "string";
12
+ }
13
+ function isIDContentBlock(content_block) {
14
+ return isDataContentBlock(content_block) && content_block.source_type === "id" && "id" in content_block && typeof content_block.id === "string";
15
+ }
16
+ function convertToOpenAIImageBlock(content_block) {
17
+ if (isDataContentBlock(content_block)) {
18
+ if (content_block.source_type === "url") return {
19
+ type: "image_url",
20
+ image_url: { url: content_block.url }
15
21
  };
16
- super(fields);
17
- this.role = fields.role;
22
+ if (content_block.source_type === "base64") {
23
+ if (!content_block.mime_type) throw new Error("mime_type key is required for base64 data.");
24
+ const mime_type = content_block.mime_type;
25
+ return {
26
+ type: "image_url",
27
+ image_url: { url: `data:${mime_type};base64,${content_block.data}` }
28
+ };
29
+ }
18
30
  }
19
- static isInstance(obj) {
20
- return super.isInstance(obj) && obj.type === "generic";
31
+ throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.");
32
+ }
33
+ function parseMimeType(mime_type) {
34
+ const parts = mime_type.split(";")[0].split("/");
35
+ if (parts.length !== 2) throw new Error(`Invalid mime type: "${mime_type}" - does not match type/subtype format.`);
36
+ const type = parts[0].trim();
37
+ const subtype = parts[1].trim();
38
+ if (type === "" || subtype === "") throw new Error(`Invalid mime type: "${mime_type}" - type or subtype is empty.`);
39
+ const parameters = {};
40
+ for (const parameterKvp of mime_type.split(";").slice(1)) {
41
+ const parameterParts = parameterKvp.split("=");
42
+ if (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
43
+ const key = parameterParts[0].trim();
44
+ const value = parameterParts[1].trim();
45
+ if (key === "") throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
46
+ parameters[key] = value;
21
47
  }
22
- get _printableFields() {
48
+ return {
49
+ type,
50
+ subtype,
51
+ parameters
52
+ };
53
+ }
54
+ function parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {
55
+ const formatMatch = data_url.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);
56
+ let mime_type;
57
+ if (formatMatch) {
58
+ mime_type = formatMatch[1].toLowerCase();
59
+ const data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];
23
60
  return {
24
- ...super._printableFields,
25
- role: this.role
61
+ mime_type,
62
+ data
26
63
  };
27
64
  }
28
- };
29
- var ChatMessageChunk = class extends BaseMessageChunk {
30
- static lc_name() {
31
- return "ChatMessageChunk";
32
- }
33
- type = "generic";
34
- role;
35
- constructor(fields, role) {
36
- if (typeof fields === "string" || Array.isArray(fields)) fields = {
37
- content: fields,
38
- role
39
- };
40
- super(fields);
41
- this.role = fields.role;
65
+ return void 0;
66
+ }
67
+ function convertToProviderContentBlock(block, converter) {
68
+ if (block.type === "text") {
69
+ if (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardTextBlock\` method.`);
70
+ return converter.fromStandardTextBlock(block);
42
71
  }
43
- concat(chunk) {
44
- const Cls = this.constructor;
45
- return new Cls({
46
- content: mergeContent(this.content, chunk.content),
47
- additional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),
48
- response_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),
49
- role: this.role,
50
- id: this.id ?? chunk.id
51
- });
72
+ if (block.type === "image") {
73
+ if (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardImageBlock\` method.`);
74
+ return converter.fromStandardImageBlock(block);
52
75
  }
53
- static isInstance(obj) {
54
- return super.isInstance(obj) && obj.type === "generic";
76
+ if (block.type === "audio") {
77
+ if (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardAudioBlock\` method.`);
78
+ return converter.fromStandardAudioBlock(block);
55
79
  }
56
- get _printableFields() {
57
- return {
58
- ...super._printableFields,
59
- role: this.role
60
- };
80
+ if (block.type === "file") {
81
+ if (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardFileBlock\` method.`);
82
+ return converter.fromStandardFileBlock(block);
61
83
  }
62
- };
63
- function isChatMessage(x) {
64
- return x._getType() === "generic";
65
- }
66
- function isChatMessageChunk(x) {
67
- return x._getType() === "generic";
84
+ throw new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);
68
85
  }
69
86
  export {
70
- ChatMessage,
71
- ChatMessageChunk,
72
- isChatMessage,
73
- isChatMessageChunk
87
+ convertToOpenAIImageBlock,
88
+ convertToProviderContentBlock,
89
+ isBase64ContentBlock,
90
+ isDataContentBlock,
91
+ isIDContentBlock,
92
+ isPlainTextContentBlock,
93
+ isURLContentBlock,
94
+ parseBase64DataUrl,
95
+ parseMimeType
74
96
  };
75
97
  //# sourceMappingURL=index.es56.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es56.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/chat.js"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, _mergeDicts, mergeContent } from \"./base.js\";\n\n//#region src/messages/chat.ts\n/**\n* Represents a chat message in a conversation.\n*/\nvar ChatMessage = class ChatMessage extends BaseMessage {\n\tstatic lc_name() {\n\t\treturn \"ChatMessage\";\n\t}\n\ttype = \"generic\";\n\trole;\n\tstatic _chatMessageClass() {\n\t\treturn ChatMessage;\n\t}\n\tconstructor(fields, role) {\n\t\tif (typeof fields === \"string\" || Array.isArray(fields)) fields = {\n\t\t\tcontent: fields,\n\t\t\trole\n\t\t};\n\t\tsuper(fields);\n\t\tthis.role = fields.role;\n\t}\n\tstatic isInstance(obj) {\n\t\treturn super.isInstance(obj) && obj.type === \"generic\";\n\t}\n\tget _printableFields() {\n\t\treturn {\n\t\t\t...super._printableFields,\n\t\t\trole: this.role\n\t\t};\n\t}\n};\n/**\n* Represents a chunk of a chat message, which can be concatenated with\n* other chat message chunks.\n*/\nvar ChatMessageChunk = class extends BaseMessageChunk {\n\tstatic lc_name() {\n\t\treturn \"ChatMessageChunk\";\n\t}\n\ttype = \"generic\";\n\trole;\n\tconstructor(fields, role) {\n\t\tif (typeof fields === \"string\" || Array.isArray(fields)) fields = {\n\t\t\tcontent: fields,\n\t\t\trole\n\t\t};\n\t\tsuper(fields);\n\t\tthis.role = fields.role;\n\t}\n\tconcat(chunk) {\n\t\tconst Cls = this.constructor;\n\t\treturn new Cls({\n\t\t\tcontent: mergeContent(this.content, chunk.content),\n\t\t\tadditional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),\n\t\t\tresponse_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),\n\t\t\trole: this.role,\n\t\t\tid: this.id ?? chunk.id\n\t\t});\n\t}\n\tstatic isInstance(obj) {\n\t\treturn super.isInstance(obj) && obj.type === \"generic\";\n\t}\n\tget _printableFields() {\n\t\treturn {\n\t\t\t...super._printableFields,\n\t\t\trole: this.role\n\t\t};\n\t}\n};\n/**\n* @deprecated Use {@link ChatMessage.isInstance} instead\n*/\nfunction isChatMessage(x) {\n\treturn x._getType() === \"generic\";\n}\n/**\n* @deprecated Use {@link ChatMessageChunk.isInstance} instead\n*/\nfunction isChatMessageChunk(x) {\n\treturn x._getType() === \"generic\";\n}\n\n//#endregion\nexport { ChatMessage, ChatMessageChunk, isChatMessage, isChatMessageChunk };\n//# sourceMappingURL=chat.js.map"],"names":["ChatMessage"],"mappings":";AAMG,IAAC,cAAc,MAAMA,qBAAoB,YAAY;AAAA,EACvD,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,OAAO,oBAAoB;AAC1B,WAAOA;AAAA,EACR;AAAA,EACA,YAAY,QAAQ,MAAM;AACzB,QAAI,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,EAAG,UAAS;AAAA,MACjE,SAAS;AAAA,MACT;AAAA,IACH;AACE,UAAM,MAAM;AACZ,SAAK,OAAO,OAAO;AAAA,EACpB;AAAA,EACA,OAAO,WAAW,KAAK;AACtB,WAAO,MAAM,WAAW,GAAG,KAAK,IAAI,SAAS;AAAA,EAC9C;AAAA,EACA,IAAI,mBAAmB;AACtB,WAAO;AAAA,MACN,GAAG,MAAM;AAAA,MACT,MAAM,KAAK;AAAA,IACd;AAAA,EACC;AACD;AAKG,IAAC,mBAAmB,cAAc,iBAAiB;AAAA,EACrD,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,YAAY,QAAQ,MAAM;AACzB,QAAI,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,EAAG,UAAS;AAAA,MACjE,SAAS;AAAA,MACT;AAAA,IACH;AACE,UAAM,MAAM;AACZ,SAAK,OAAO,OAAO;AAAA,EACpB;AAAA,EACA,OAAO,OAAO;AACb,UAAM,MAAM,KAAK;AACjB,WAAO,IAAI,IAAI;AAAA,MACd,SAAS,aAAa,KAAK,SAAS,MAAM,OAAO;AAAA,MACjD,mBAAmB,YAAY,KAAK,mBAAmB,MAAM,iBAAiB;AAAA,MAC9E,mBAAmB,YAAY,KAAK,mBAAmB,MAAM,iBAAiB;AAAA,MAC9E,MAAM,KAAK;AAAA,MACX,IAAI,KAAK,MAAM,MAAM;AAAA,IACxB,CAAG;AAAA,EACF;AAAA,EACA,OAAO,WAAW,KAAK;AACtB,WAAO,MAAM,WAAW,GAAG,KAAK,IAAI,SAAS;AAAA,EAC9C;AAAA,EACA,IAAI,mBAAmB;AACtB,WAAO;AAAA,MACN,GAAG,MAAM;AAAA,MACT,MAAM,KAAK;AAAA,IACd;AAAA,EACC;AACD;AAIA,SAAS,cAAc,GAAG;AACzB,SAAO,EAAE,SAAQ,MAAO;AACzB;AAIA,SAAS,mBAAmB,GAAG;AAC9B,SAAO,EAAE,SAAQ,MAAO;AACzB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es56.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.js"],"sourcesContent":["//#region src/messages/content/data.ts\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isDataContentBlock(content_block) {\n\treturn typeof content_block === \"object\" && content_block !== null && \"type\" in content_block && typeof content_block.type === \"string\" && \"source_type\" in content_block && (content_block.source_type === \"url\" || content_block.source_type === \"base64\" || content_block.source_type === \"text\" || content_block.source_type === \"id\");\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isURLContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"url\" && \"url\" in content_block && typeof content_block.url === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isBase64ContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"base64\" && \"data\" in content_block && typeof content_block.data === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isPlainTextContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"text\" && \"text\" in content_block && typeof content_block.text === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isIDContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"id\" && \"id\" in content_block && typeof content_block.id === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToOpenAIImageBlock(content_block) {\n\tif (isDataContentBlock(content_block)) {\n\t\tif (content_block.source_type === \"url\") return {\n\t\t\ttype: \"image_url\",\n\t\t\timage_url: { url: content_block.url }\n\t\t};\n\t\tif (content_block.source_type === \"base64\") {\n\t\t\tif (!content_block.mime_type) throw new Error(\"mime_type key is required for base64 data.\");\n\t\t\tconst mime_type = content_block.mime_type;\n\t\t\treturn {\n\t\t\t\ttype: \"image_url\",\n\t\t\t\timage_url: { url: `data:${mime_type};base64,${content_block.data}` }\n\t\t\t};\n\t\t}\n\t}\n\tthrow new Error(\"Unsupported source type. Only 'url' and 'base64' are supported.\");\n}\n/**\n* Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n*\n* @param mime_type - The mime type to parse.\n* @returns An object containing the type, subtype, and parameters.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseMimeType(mime_type) {\n\tconst parts = mime_type.split(\";\")[0].split(\"/\");\n\tif (parts.length !== 2) throw new Error(`Invalid mime type: \"${mime_type}\" - does not match type/subtype format.`);\n\tconst type = parts[0].trim();\n\tconst subtype = parts[1].trim();\n\tif (type === \"\" || subtype === \"\") throw new Error(`Invalid mime type: \"${mime_type}\" - type or subtype is empty.`);\n\tconst parameters = {};\n\tfor (const parameterKvp of mime_type.split(\";\").slice(1)) {\n\t\tconst parameterParts = parameterKvp.split(\"=\");\n\t\tif (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tconst key = parameterParts[0].trim();\n\t\tconst value = parameterParts[1].trim();\n\t\tif (key === \"\") throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tparameters[key] = value;\n\t}\n\treturn {\n\t\ttype,\n\t\tsubtype,\n\t\tparameters\n\t};\n}\n/**\n* Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n*\n* @param dataUrl - The base64 data URL to parse.\n* @param asTypedArray - Whether to return the data as a typed array.\n* @returns The parsed data and mime type, or undefined if the data URL is invalid.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {\n\tconst formatMatch = data_url.match(/^data:(\\w+\\/\\w+);base64,([A-Za-z0-9+/]+=*)$/);\n\tlet mime_type;\n\tif (formatMatch) {\n\t\tmime_type = formatMatch[1].toLowerCase();\n\t\tconst data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];\n\t\treturn {\n\t\t\tmime_type,\n\t\t\tdata\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Convert from a standard data content block to a provider's proprietary data content block format.\n*\n* Don't override this method. Instead, override the more specific conversion methods and use this\n* method unmodified.\n*\n* @param block - The standard data content block to convert.\n* @returns The provider data content block.\n* @throws An error if the standard data content block type is not supported.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToProviderContentBlock(block, converter) {\n\tif (block.type === \"text\") {\n\t\tif (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardTextBlock\\` method.`);\n\t\treturn converter.fromStandardTextBlock(block);\n\t}\n\tif (block.type === \"image\") {\n\t\tif (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardImageBlock\\` method.`);\n\t\treturn converter.fromStandardImageBlock(block);\n\t}\n\tif (block.type === \"audio\") {\n\t\tif (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardAudioBlock\\` method.`);\n\t\treturn converter.fromStandardAudioBlock(block);\n\t}\n\tif (block.type === \"file\") {\n\t\tif (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardFileBlock\\` method.`);\n\t\treturn converter.fromStandardFileBlock(block);\n\t}\n\tthrow new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);\n}\n\n//#endregion\nexport { convertToOpenAIImageBlock, convertToProviderContentBlock, isBase64ContentBlock, isDataContentBlock, isIDContentBlock, isPlainTextContentBlock, isURLContentBlock, parseBase64DataUrl, parseMimeType };\n//# sourceMappingURL=data.js.map"],"names":[],"mappings":"AAIA,SAAS,mBAAmB,eAAe;AAC1C,SAAO,OAAO,kBAAkB,YAAY,kBAAkB,QAAQ,UAAU,iBAAiB,OAAO,cAAc,SAAS,YAAY,iBAAiB,kBAAkB,cAAc,gBAAgB,SAAS,cAAc,gBAAgB,YAAY,cAAc,gBAAgB,UAAU,cAAc,gBAAgB;AACtU;AAIA,SAAS,kBAAkB,eAAe;AACzC,SAA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DAAwD;AACtJ,WAAO,UAAU,uBAAuB,KAAK;AAAA,EAC9C;AACA,MAAI,MAAM,SAAS,QAAQ;AAC1B,QAAI,CAAC,UAAU,sBAAuB,OAAM,IAAI,MAAM,iBAAiB,UAAU,YAAY,uDAAuD;AACpJ,WAAO,UAAU,sBAAsB,KAAK;AAAA,EAC7C;AACA,QAAM,IAAI,MAAM,yCAAyC,MAAM,IAAI,gDAAgD;AACpH;","x_google_ignoreList":[0]}
@@ -1,41 +1,7 @@
1
- import { BaseMessageChunk, _mergeDicts, mergeContent, BaseMessage } from "./index.es39.js";
2
- var FunctionMessage = class extends BaseMessage {
3
- static lc_name() {
4
- return "FunctionMessage";
5
- }
6
- type = "function";
7
- name;
8
- constructor(fields) {
9
- super(fields);
10
- this.name = fields.name;
11
- }
12
- };
13
- var FunctionMessageChunk = class extends BaseMessageChunk {
14
- static lc_name() {
15
- return "FunctionMessageChunk";
16
- }
17
- type = "function";
18
- concat(chunk) {
19
- const Cls = this.constructor;
20
- return new Cls({
21
- content: mergeContent(this.content, chunk.content),
22
- additional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),
23
- response_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),
24
- name: this.name ?? "",
25
- id: this.id ?? chunk.id
26
- });
27
- }
28
- };
29
- function isFunctionMessage(x) {
30
- return x._getType() === "function";
31
- }
32
- function isFunctionMessageChunk(x) {
33
- return x._getType() === "function";
1
+ function isMessage(message) {
2
+ return typeof message === "object" && message !== null && "type" in message && "content" in message && (typeof message.content === "string" || Array.isArray(message.content));
34
3
  }
35
4
  export {
36
- FunctionMessage,
37
- FunctionMessageChunk,
38
- isFunctionMessage,
39
- isFunctionMessageChunk
5
+ isMessage
40
6
  };
41
7
  //# sourceMappingURL=index.es57.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es57.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/function.js"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, _mergeDicts, mergeContent } from \"./base.js\";\n\n//#region src/messages/function.ts\n/**\n* Represents a function message in a conversation.\n*/\nvar FunctionMessage = class extends BaseMessage {\n\tstatic lc_name() {\n\t\treturn \"FunctionMessage\";\n\t}\n\ttype = \"function\";\n\tname;\n\tconstructor(fields) {\n\t\tsuper(fields);\n\t\tthis.name = fields.name;\n\t}\n};\n/**\n* Represents a chunk of a function message, which can be concatenated\n* with other function message chunks.\n*/\nvar FunctionMessageChunk = class extends BaseMessageChunk {\n\tstatic lc_name() {\n\t\treturn \"FunctionMessageChunk\";\n\t}\n\ttype = \"function\";\n\tconcat(chunk) {\n\t\tconst Cls = this.constructor;\n\t\treturn new Cls({\n\t\t\tcontent: mergeContent(this.content, chunk.content),\n\t\t\tadditional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),\n\t\t\tresponse_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),\n\t\t\tname: this.name ?? \"\",\n\t\t\tid: this.id ?? chunk.id\n\t\t});\n\t}\n};\nfunction isFunctionMessage(x) {\n\treturn x._getType() === \"function\";\n}\nfunction isFunctionMessageChunk(x) {\n\treturn x._getType() === \"function\";\n}\n\n//#endregion\nexport { FunctionMessage, FunctionMessageChunk, isFunctionMessage, isFunctionMessageChunk };\n//# sourceMappingURL=function.js.map"],"names":[],"mappings":";AAMG,IAAC,kBAAkB,cAAc,YAAY;AAAA,EAC/C,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,YAAY,QAAQ;AACnB,UAAM,MAAM;AACZ,SAAK,OAAO,OAAO;AAAA,EACpB;AACD;AAKG,IAAC,uBAAuB,cAAc,iBAAiB;AAAA,EACzD,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EACA,OAAO;AAAA,EACP,OAAO,OAAO;AACb,UAAM,MAAM,KAAK;AACjB,WAAO,IAAI,IAAI;AAAA,MACd,SAAS,aAAa,KAAK,SAAS,MAAM,OAAO;AAAA,MACjD,mBAAmB,YAAY,KAAK,mBAAmB,MAAM,iBAAiB;AAAA,MAC9E,mBAAmB,YAAY,KAAK,mBAAmB,MAAM,iBAAiB;AAAA,MAC9E,MAAM,KAAK,QAAQ;AAAA,MACnB,IAAI,KAAK,MAAM,MAAM;AAAA,IACxB,CAAG;AAAA,EACF;AACD;AACA,SAAS,kBAAkB,GAAG;AAC7B,SAAO,EAAE,SAAQ,MAAO;AACzB;AACA,SAAS,uBAAuB,GAAG;AAClC,SAAO,EAAE,SAAQ,MAAO;AACzB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es57.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/message.js"],"sourcesContent":["//#region src/messages/message.ts\n/**\n* Type guard to check if a value is a valid Message object.\n*\n* @param message - The value to check\n* @returns true if the value is a valid Message object, false otherwise\n*/\nfunction isMessage(message) {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message && (typeof message.content === \"string\" || Array.isArray(message.content));\n}\n\n//#endregion\nexport { isMessage };\n//# sourceMappingURL=message.js.map"],"names":[],"mappings":"AAOA,SAAS,UAAU,SAAS;AAC3B,SAAO,OAAO,YAAY,YAAY,YAAY,QAAQ,UAAU,WAAW,aAAa,YAAY,OAAO,QAAQ,YAAY,YAAY,MAAM,QAAQ,QAAQ,OAAO;AAC7K;","x_google_ignoreList":[0]}