langgraph-ui-components 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/index.es10.js +31 -16
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +37 -5
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +160 -67
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +196 -30
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +14 -5
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +32 -2
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +33 -10
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +3110 -454
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +5 -5
- package/dist/index.es108.js +2 -2
- package/dist/index.es109.js +12 -142
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es11.js +146 -120
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es110.js +11 -906
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +483 -262
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +7 -4
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +2 -446
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +141 -41
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +904 -20
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +267 -66
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +3 -130
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +437 -42
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +46 -10
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es12.js +13 -103
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es120.js +22 -45
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +72 -92
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +126 -50
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +46 -13
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +9 -14
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +45 -89
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +99 -2
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +48 -51
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +14 -99
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +88 -190
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es13.js +126 -33
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es130.js +2 -110
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +163 -34
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +2 -10
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +55 -10
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +99 -11
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +181 -81
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +105 -270
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +35 -2
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +10 -164
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +11 -51
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es140.js +11 -39
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +89 -33
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +264 -29
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +2 -24
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +158 -585
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +44 -118
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +34 -158
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +35 -2
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +40 -2
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +24 -2
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +15 -15
- package/dist/index.es150.js +589 -20
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es151.js +125 -2
- package/dist/index.es151.js.map +1 -1
- package/dist/index.es152.js +3 -24
- package/dist/index.es152.js.map +1 -1
- package/dist/index.es153.js +2 -4
- package/dist/index.es153.js.map +1 -1
- package/dist/index.es154.js +2 -5
- package/dist/index.es154.js.map +1 -1
- package/dist/index.es155.js +22 -13
- package/dist/index.es155.js.map +1 -1
- package/dist/index.es156.js +2 -6
- package/dist/index.es156.js.map +1 -1
- package/dist/index.es157.js +25 -8
- package/dist/index.es157.js.map +1 -1
- package/dist/index.es158.js +5 -64
- package/dist/index.es158.js.map +1 -1
- package/dist/index.es159.js +12 -21
- package/dist/index.es159.js.map +1 -1
- package/dist/index.es16.js +2 -2
- package/dist/index.es160.js +5 -5
- package/dist/index.es160.js.map +1 -1
- package/dist/index.es161.js +8 -349
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +1 -1
- package/dist/index.es163.js +1 -1
- package/dist/index.es164.js +3 -3
- package/dist/index.es165.js +63 -6
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +21 -102
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +5 -118
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es168.js +330 -117
- package/dist/index.es168.js.map +1 -1
- package/dist/index.es169.js +6 -114
- package/dist/index.es169.js.map +1 -1
- package/dist/index.es17.js +2 -2
- package/dist/index.es170.js +103 -6
- package/dist/index.es170.js.map +1 -1
- package/dist/index.es171.js +119 -2
- package/dist/index.es171.js.map +1 -1
- package/dist/index.es172.js +134 -140
- package/dist/index.es172.js.map +1 -1
- package/dist/index.es173.js +115 -2
- package/dist/index.es173.js.map +1 -1
- package/dist/index.es174.js +6 -3737
- package/dist/index.es174.js.map +1 -1
- package/dist/index.es175.js +2 -342
- package/dist/index.es175.js.map +1 -1
- package/dist/index.es176.js +138 -105
- package/dist/index.es176.js.map +1 -1
- package/dist/index.es177.js +2 -133
- package/dist/index.es177.js.map +1 -1
- package/dist/index.es178.js +3734 -12
- package/dist/index.es178.js.map +1 -1
- package/dist/index.es179.js +326 -136
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es180.js +107 -13
- package/dist/index.es180.js.map +1 -1
- package/dist/index.es181.js +131 -6
- package/dist/index.es181.js.map +1 -1
- package/dist/index.es182.js +13 -19
- package/dist/index.es182.js.map +1 -1
- package/dist/index.es183.js +139 -77
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +13 -241
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +8 -24
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +21 -6
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +90 -4
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +240 -15
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +24 -8
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es19.js +15 -119
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es190.js +5 -31
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +4 -6
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +17 -105
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +6 -11
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +32 -18
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +6 -31
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +106 -4
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +12 -4
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +17 -4
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +21 -27
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es2.js +25 -16
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +37 -17
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es200.js +3 -7
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +3 -4
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +5 -7
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +36 -41
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +5 -10
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +5 -241
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +5 -49
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +29 -22
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +10 -10
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +241 -7
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +27 -67
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es210.js +50 -6
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +30 -60
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +11 -39
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +7 -31
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +6 -61
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +58 -8
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +34 -16
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +31 -4
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +58 -13
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +14 -32
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es22.js +140 -30
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es220.js +23 -5
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +4 -4
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +16 -4
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +32 -7
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +4 -91
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +4 -17
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +5 -762
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +8 -66
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +83 -165
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +16 -36
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es23.js +17 -32
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es230.js +761 -136
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +66 -93
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +172 -31
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +129 -277
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +92 -25
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +31 -22
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +284 -14
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +24 -13
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +17 -19
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +12 -43
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +57 -136
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es240.js +14 -11
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +24 -10
- package/dist/index.es241.js.map +1 -1
- package/dist/index.es242.js +45 -11
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +11 -14
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +10 -10
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +11 -11
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +14 -11
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +10 -14
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +11 -11
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +11 -11
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +298 -94
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +15 -11
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +11 -11
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +11 -11
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +10 -10
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +10 -10
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +10 -10
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +11 -56
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +11 -49
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +11 -119
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +56 -384
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +116 -65
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es260.js +47 -16
- package/dist/index.es260.js.map +1 -1
- package/dist/index.es261.js +118 -10
- package/dist/index.es261.js.map +1 -1
- package/dist/index.es262.js +379 -26
- package/dist/index.es262.js.map +1 -1
- package/dist/index.es263.js +13 -26
- package/dist/index.es263.js.map +1 -1
- package/dist/index.es264.js +10 -61
- package/dist/index.es264.js.map +1 -1
- package/dist/index.es265.js +25 -11
- package/dist/index.es265.js.map +1 -1
- package/dist/index.es266.js +25 -71
- package/dist/index.es266.js.map +1 -1
- package/dist/index.es267.js +62 -11
- package/dist/index.es267.js.map +1 -1
- package/dist/index.es268.js +17 -11
- package/dist/index.es268.js.map +1 -1
- package/dist/index.es269.js +75 -13
- package/dist/index.es269.js.map +1 -1
- package/dist/index.es27.js +91 -168
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es270.js +11 -52
- package/dist/index.es270.js.map +1 -1
- package/dist/index.es271.js +11 -166
- package/dist/index.es271.js.map +1 -1
- package/dist/index.es272.js +16 -2
- package/dist/index.es272.js.map +1 -1
- package/dist/index.es273.js +51 -9
- package/dist/index.es273.js.map +1 -1
- package/dist/index.es274.js +165 -18
- package/dist/index.es274.js.map +1 -1
- package/dist/index.es275.js +36 -37
- package/dist/index.es275.js.map +1 -1
- package/dist/index.es276.js +5 -0
- package/dist/index.es276.js.map +1 -0
- package/dist/index.es277.js +14 -0
- package/dist/index.es277.js.map +1 -0
- package/dist/index.es278.js +23 -0
- package/dist/index.es278.js.map +1 -0
- package/dist/index.es279.js +42 -0
- package/dist/index.es279.js.map +1 -0
- package/dist/index.es28.js +68 -24
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +178 -12
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es30.js +23 -437
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +13 -15
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +429 -107
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +112 -65
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +71 -18
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +17 -260
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +249 -31
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +27 -199
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +198 -50
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +45 -120
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +132 -14
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +19 -225
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +229 -8
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +7 -1190
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +1191 -6
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +6 -146
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +147 -7
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +15 -92
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es49.js +5 -35
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es50.js +7 -71
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +89 -33
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +3 -305
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +36 -9
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +64 -83
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +36 -6
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +303 -12
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +9 -143
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +83 -292
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +6 -64
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es6.js +21 -5
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es60.js +12 -210
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +138 -29
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +299 -8
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +65 -11
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +201 -175
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +33 -23
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +8 -1399
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +12 -9
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +187 -8
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +24 -6
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +1384 -147
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +9 -672
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +8 -12
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +6 -40
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +155 -26
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +657 -217
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +11 -29
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +37 -72
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +32 -74
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +226 -46
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +6 -6
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +71 -39
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +73 -54
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +52 -13
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +28 -135
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +42 -20
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +36 -181
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +5 -241
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +65 -347
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +31 -131
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +49 -62
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +13 -37
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +134 -34
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +20 -165
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +162 -183
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +240 -13
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +352 -27
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +130 -27
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +64 -3151
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +34 -34
- package/dist/index.es99.js.map +1 -1
- package/dist/langgraph-ui-components.css +107 -0
- package/dist/styles.css +1 -1
- package/package.json +8 -7
- package/dist/index.es48.js +0 -7
- package/dist/index.es48.js.map +0 -1
package/dist/index.es58.js
CHANGED
|
@@ -1,303 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
source: "page",
|
|
21
|
-
title: document_title ?? void 0,
|
|
22
|
-
startIndex: start_page_number,
|
|
23
|
-
endIndex: end_page_number,
|
|
24
|
-
citedText: cited_text
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (citation.type === "content_block_location" && _isString(citation.document_title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {
|
|
28
|
-
const { document_title, start_block_index, end_block_index, cited_text, ...rest } = citation;
|
|
29
|
-
return {
|
|
30
|
-
...rest,
|
|
31
|
-
type: "citation",
|
|
32
|
-
source: "block",
|
|
33
|
-
title: document_title ?? void 0,
|
|
34
|
-
startIndex: start_block_index,
|
|
35
|
-
endIndex: end_block_index,
|
|
36
|
-
citedText: cited_text
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (citation.type === "web_search_result_location" && _isString(citation.url) && _isString(citation.title) && _isString(citation.encrypted_index) && _isString(citation.cited_text)) {
|
|
40
|
-
const { url, title, encrypted_index, cited_text, ...rest } = citation;
|
|
41
|
-
return {
|
|
42
|
-
...rest,
|
|
43
|
-
type: "citation",
|
|
44
|
-
source: "url",
|
|
45
|
-
url,
|
|
46
|
-
title,
|
|
47
|
-
startIndex: Number(encrypted_index),
|
|
48
|
-
endIndex: Number(encrypted_index),
|
|
49
|
-
citedText: cited_text
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (citation.type === "search_result_location" && _isString(citation.source) && _isString(citation.title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {
|
|
53
|
-
const { source, title, start_block_index, end_block_index, cited_text, ...rest } = citation;
|
|
54
|
-
return {
|
|
55
|
-
...rest,
|
|
56
|
-
type: "citation",
|
|
57
|
-
source: "search",
|
|
58
|
-
url: source,
|
|
59
|
-
title: title ?? void 0,
|
|
60
|
-
startIndex: start_block_index,
|
|
61
|
-
endIndex: end_block_index,
|
|
62
|
-
citedText: cited_text
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return void 0;
|
|
1
|
+
import { _getFetchImplementation } from "./index.es73.js";
|
|
2
|
+
import pRetry from "./index.es74.js";
|
|
3
|
+
import PQueue from "./index.es75.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;
|
|
66
20
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
url: block.source.url
|
|
77
|
-
};
|
|
78
|
-
else if (block.source.type === "file" && _isString(block.source.file_id)) return {
|
|
79
|
-
type: "file",
|
|
80
|
-
fileId: block.source.file_id
|
|
81
|
-
};
|
|
82
|
-
else if (block.source.type === "text" && _isString(block.source.data)) return {
|
|
83
|
-
type: "file",
|
|
84
|
-
mimeType: String(block.source.media_type ?? "text/plain"),
|
|
85
|
-
data: block.source.data
|
|
86
|
-
};
|
|
87
|
-
} else if (_isContentBlock(block, "image") && _isObject(block.source) && "type" in block.source) {
|
|
88
|
-
if (block.source.type === "base64" && _isString(block.source.media_type) && _isString(block.source.data)) return {
|
|
89
|
-
type: "image",
|
|
90
|
-
mimeType: block.source.media_type,
|
|
91
|
-
data: block.source.data
|
|
92
|
-
};
|
|
93
|
-
else if (block.source.type === "url" && _isString(block.source.url)) return {
|
|
94
|
-
type: "image",
|
|
95
|
-
url: block.source.url
|
|
96
|
-
};
|
|
97
|
-
else if (block.source.type === "file" && _isString(block.source.file_id)) return {
|
|
98
|
-
type: "image",
|
|
99
|
-
fileId: block.source.file_id
|
|
100
|
-
};
|
|
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;
|
|
101
30
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const stdBlock = convertToV1FromAnthropicContentBlock(block);
|
|
108
|
-
if (stdBlock) yield stdBlock;
|
|
109
|
-
else yield block;
|
|
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);
|
|
110
36
|
}
|
|
111
37
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
} else if (_isContentBlock(block, "thinking") && _isString(block.thinking)) {
|
|
145
|
-
const { thinking, signature, ...rest } = block;
|
|
146
|
-
yield {
|
|
147
|
-
...rest,
|
|
148
|
-
type: "reasoning",
|
|
149
|
-
reasoning: thinking,
|
|
150
|
-
signature
|
|
151
|
-
};
|
|
152
|
-
continue;
|
|
153
|
-
} else if (_isContentBlock(block, "redacted_thinking")) {
|
|
154
|
-
yield {
|
|
155
|
-
type: "non_standard",
|
|
156
|
-
value: block
|
|
157
|
-
};
|
|
158
|
-
continue;
|
|
159
|
-
} else if (_isContentBlock(block, "tool_use") && _isString(block.name) && _isString(block.id)) {
|
|
160
|
-
yield {
|
|
161
|
-
type: "tool_call",
|
|
162
|
-
id: block.id,
|
|
163
|
-
name: block.name,
|
|
164
|
-
args: block.input
|
|
165
|
-
};
|
|
166
|
-
continue;
|
|
167
|
-
} else if (_isContentBlock(block, "input_json_delta")) {
|
|
168
|
-
if (_isAIMessageChunk(message) && message.tool_call_chunks?.length) {
|
|
169
|
-
const tool_call_chunk = message.tool_call_chunks[0];
|
|
170
|
-
yield {
|
|
171
|
-
type: "tool_call_chunk",
|
|
172
|
-
id: tool_call_chunk.id,
|
|
173
|
-
name: tool_call_chunk.name,
|
|
174
|
-
args: tool_call_chunk.args,
|
|
175
|
-
index: tool_call_chunk.index
|
|
176
|
-
};
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
} else if (_isContentBlock(block, "server_tool_use") && _isString(block.name) && _isString(block.id)) {
|
|
180
|
-
const { name, id } = block;
|
|
181
|
-
if (name === "web_search") {
|
|
182
|
-
const query = iife(() => {
|
|
183
|
-
if (typeof block.input === "string") return block.input;
|
|
184
|
-
else if (_isObject(block.input) && _isString(block.input.query)) return block.input.query;
|
|
185
|
-
else if (_isString(block.partial_json)) {
|
|
186
|
-
const json = safeParseJson(block.partial_json);
|
|
187
|
-
if (json?.query) return json.query;
|
|
188
|
-
}
|
|
189
|
-
return "";
|
|
190
|
-
});
|
|
191
|
-
yield {
|
|
192
|
-
id,
|
|
193
|
-
type: "server_tool_call",
|
|
194
|
-
name: "web_search",
|
|
195
|
-
args: { query }
|
|
196
|
-
};
|
|
197
|
-
continue;
|
|
198
|
-
} else if (block.name === "code_execution") {
|
|
199
|
-
const code = iife(() => {
|
|
200
|
-
if (typeof block.input === "string") return block.input;
|
|
201
|
-
else if (_isObject(block.input) && _isString(block.input.code)) return block.input.code;
|
|
202
|
-
else if (_isString(block.partial_json)) {
|
|
203
|
-
const json = safeParseJson(block.partial_json);
|
|
204
|
-
if (json?.code) return json.code;
|
|
205
|
-
}
|
|
206
|
-
return "";
|
|
207
|
-
});
|
|
208
|
-
yield {
|
|
209
|
-
id,
|
|
210
|
-
type: "server_tool_call",
|
|
211
|
-
name: "code_execution",
|
|
212
|
-
args: { code }
|
|
213
|
-
};
|
|
214
|
-
continue;
|
|
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;
|
|
215
68
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (_isContentBlock(content$2, "web_search_result")) return [...acc, content$2.url];
|
|
220
|
-
return acc;
|
|
221
|
-
}, []);
|
|
222
|
-
yield {
|
|
223
|
-
type: "server_tool_call_result",
|
|
224
|
-
name: "web_search",
|
|
225
|
-
toolCallId: tool_use_id,
|
|
226
|
-
status: "success",
|
|
227
|
-
output: { urls }
|
|
228
|
-
};
|
|
229
|
-
continue;
|
|
230
|
-
} else if (_isContentBlock(block, "code_execution_tool_result") && _isString(block.tool_use_id) && _isObject(block.content)) {
|
|
231
|
-
yield {
|
|
232
|
-
type: "server_tool_call_result",
|
|
233
|
-
name: "code_execution",
|
|
234
|
-
toolCallId: block.tool_use_id,
|
|
235
|
-
status: "success",
|
|
236
|
-
output: block.content
|
|
237
|
-
};
|
|
238
|
-
continue;
|
|
239
|
-
} else if (_isContentBlock(block, "mcp_tool_use")) {
|
|
240
|
-
yield {
|
|
241
|
-
id: block.id,
|
|
242
|
-
type: "server_tool_call",
|
|
243
|
-
name: "mcp_tool_use",
|
|
244
|
-
args: block.input
|
|
245
|
-
};
|
|
246
|
-
continue;
|
|
247
|
-
} else if (_isContentBlock(block, "mcp_tool_result") && _isString(block.tool_use_id) && _isObject(block.content)) {
|
|
248
|
-
yield {
|
|
249
|
-
type: "server_tool_call_result",
|
|
250
|
-
name: "mcp_tool_use",
|
|
251
|
-
toolCallId: block.tool_use_id,
|
|
252
|
-
status: "success",
|
|
253
|
-
output: block.content
|
|
254
|
-
};
|
|
255
|
-
continue;
|
|
256
|
-
} else if (_isContentBlock(block, "container_upload")) {
|
|
257
|
-
yield {
|
|
258
|
-
type: "server_tool_call",
|
|
259
|
-
name: "container_upload",
|
|
260
|
-
args: block.input
|
|
261
|
-
};
|
|
262
|
-
continue;
|
|
263
|
-
} else if (_isContentBlock(block, "search_result")) {
|
|
264
|
-
yield {
|
|
265
|
-
id: block.id,
|
|
266
|
-
type: "non_standard",
|
|
267
|
-
value: block
|
|
268
|
-
};
|
|
269
|
-
continue;
|
|
270
|
-
} else if (_isContentBlock(block, "tool_result")) {
|
|
271
|
-
yield {
|
|
272
|
-
id: block.id,
|
|
273
|
-
type: "non_standard",
|
|
274
|
-
value: block
|
|
275
|
-
};
|
|
276
|
-
continue;
|
|
277
|
-
} else {
|
|
278
|
-
const stdBlock = convertToV1FromAnthropicContentBlock(block);
|
|
279
|
-
if (stdBlock) {
|
|
280
|
-
yield stdBlock;
|
|
281
|
-
continue;
|
|
69
|
+
if (error instanceof HTTPError) {
|
|
70
|
+
if (STATUS_NO_RETRY.includes(error.status)) throw error;
|
|
71
|
+
if (onFailedResponseHook && error.response) await onFailedResponseHook(error.response);
|
|
282
72
|
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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)));
|
|
289
89
|
}
|
|
290
|
-
return Array.from(iterateContent());
|
|
291
|
-
}
|
|
292
|
-
const ChatAnthropicTranslator = {
|
|
293
|
-
translateContent: convertToV1FromAnthropicMessage,
|
|
294
|
-
translateContentChunk: convertToV1FromAnthropicMessage
|
|
295
90
|
};
|
|
296
|
-
function _isAIMessageChunk(message) {
|
|
297
|
-
return typeof message?._getType === "function" && typeof message.concat === "function" && message._getType() === "ai";
|
|
298
|
-
}
|
|
299
91
|
export {
|
|
300
|
-
|
|
301
|
-
convertToV1FromAnthropicInput
|
|
92
|
+
AsyncCaller
|
|
302
93
|
};
|
|
303
94
|
//# sourceMappingURL=index.es58.js.map
|
package/dist/index.es58.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es58.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/anthropic.js"],"sourcesContent":["import { _isArray, _isContentBlock, _isNumber, _isObject, _isString, iife, safeParseJson } from \"./utils.js\";\n\n//#region src/messages/block_translators/anthropic.ts\nfunction convertAnthropicAnnotation(citation) {\n\tif (citation.type === \"char_location\" && _isString(citation.document_title) && _isNumber(citation.start_char_index) && _isNumber(citation.end_char_index) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_char_index, end_char_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"char\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_char_index,\n\t\t\tendIndex: end_char_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"page_location\" && _isString(citation.document_title) && _isNumber(citation.start_page_number) && _isNumber(citation.end_page_number) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_page_number, end_page_number, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"page\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_page_number,\n\t\t\tendIndex: end_page_number,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"content_block_location\" && _isString(citation.document_title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {\n\t\tconst { document_title, start_block_index, end_block_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"block\",\n\t\t\ttitle: document_title ?? void 0,\n\t\t\tstartIndex: start_block_index,\n\t\t\tendIndex: end_block_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"web_search_result_location\" && _isString(citation.url) && _isString(citation.title) && _isString(citation.encrypted_index) && _isString(citation.cited_text)) {\n\t\tconst { url, title, encrypted_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"url\",\n\t\t\turl,\n\t\t\ttitle,\n\t\t\tstartIndex: Number(encrypted_index),\n\t\t\tendIndex: Number(encrypted_index),\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\tif (citation.type === \"search_result_location\" && _isString(citation.source) && _isString(citation.title) && _isNumber(citation.start_block_index) && _isNumber(citation.end_block_index) && _isString(citation.cited_text)) {\n\t\tconst { source, title, start_block_index, end_block_index, cited_text,...rest } = citation;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: \"citation\",\n\t\t\tsource: \"search\",\n\t\t\turl: source,\n\t\t\ttitle: title ?? void 0,\n\t\t\tstartIndex: start_block_index,\n\t\t\tendIndex: end_block_index,\n\t\t\tcitedText: cited_text\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Converts an Anthropic content block to a standard V1 content block.\n*\n* This function handles the conversion of Anthropic-specific content blocks\n* (document and image blocks) to the standardized V1 format. It supports\n* various source types including base64 data, URLs, file IDs, and text data.\n*\n* @param block - The Anthropic content block to convert\n* @returns A standard V1 content block if conversion is successful, undefined otherwise\n*\n* @example\n* ```typescript\n* const anthropicBlock = {\n* type: \"image\",\n* source: {\n* type: \"base64\",\n* media_type: \"image/png\",\n* data: \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==\"\n* }\n* };\n*\n* const standardBlock = convertToV1FromAnthropicContentBlock(anthropicBlock);\n* // Returns: { type: \"image\", mimeType: \"image/png\", data: \"...\" }\n* ```\n*/\nfunction convertToV1FromAnthropicContentBlock(block) {\n\tif (_isContentBlock(block, \"document\") && _isObject(block.source) && \"type\" in block.source) {\n\t\tif (block.source.type === \"base64\" && _isString(block.source.media_type) && _isString(block.source.data)) return {\n\t\t\ttype: \"file\",\n\t\t\tmimeType: block.source.media_type,\n\t\t\tdata: block.source.data\n\t\t};\n\t\telse if (block.source.type === \"url\" && _isString(block.source.url)) return {\n\t\t\ttype: \"file\",\n\t\t\turl: block.source.url\n\t\t};\n\t\telse if (block.source.type === \"file\" && _isString(block.source.file_id)) return {\n\t\t\ttype: \"file\",\n\t\t\tfileId: block.source.file_id\n\t\t};\n\t\telse if (block.source.type === \"text\" && _isString(block.source.data)) return {\n\t\t\ttype: \"file\",\n\t\t\tmimeType: String(block.source.media_type ?? \"text/plain\"),\n\t\t\tdata: block.source.data\n\t\t};\n\t} else if (_isContentBlock(block, \"image\") && _isObject(block.source) && \"type\" in block.source) {\n\t\tif (block.source.type === \"base64\" && _isString(block.source.media_type) && _isString(block.source.data)) return {\n\t\t\ttype: \"image\",\n\t\t\tmimeType: block.source.media_type,\n\t\t\tdata: block.source.data\n\t\t};\n\t\telse if (block.source.type === \"url\" && _isString(block.source.url)) return {\n\t\t\ttype: \"image\",\n\t\t\turl: block.source.url\n\t\t};\n\t\telse if (block.source.type === \"file\" && _isString(block.source.file_id)) return {\n\t\t\ttype: \"image\",\n\t\t\tfileId: block.source.file_id\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Converts an array of content blocks from Anthropic format to v1 standard format.\n*\n* This function processes each content block in the input array, attempting to convert\n* Anthropic-specific block formats (like image blocks with source objects, document blocks, etc.)\n* to the standardized v1 content block format. If a block cannot be converted, it is\n* passed through as-is with a type assertion to ContentBlock.Standard.\n*\n* @param content - Array of content blocks in Anthropic format to be converted\n* @returns Array of content blocks in v1 standard format\n*/\nfunction convertToV1FromAnthropicInput(content) {\n\tfunction* iterateContent() {\n\t\tfor (const block of content) {\n\t\t\tconst stdBlock = convertToV1FromAnthropicContentBlock(block);\n\t\t\tif (stdBlock) yield stdBlock;\n\t\t\telse yield block;\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\n/**\n* Converts an Anthropic AI message to an array of v1 standard content blocks.\n*\n* This function processes an AI message containing Anthropic-specific content blocks\n* and converts them to the standardized v1 content block format.\n*\n* @param message - The AI message containing Anthropic-formatted content blocks\n* @returns Array of content blocks in v1 standard format\n*\n* @example\n* ```typescript\n* const message = new AIMessage([\n* { type: \"text\", text: \"Hello world\" },\n* { type: \"thinking\", text: \"Let me think about this...\" },\n* { type: \"tool_use\", id: \"123\", name: \"calculator\", input: { a: 1, b: 2 } }\n* ]);\n*\n* const standardBlocks = convertToV1FromAnthropicMessage(message);\n* // Returns:\n* // [\n* // { type: \"text\", text: \"Hello world\" },\n* // { type: \"reasoning\", reasoning: \"Let me think about this...\" },\n* // { type: \"tool_call\", id: \"123\", name: \"calculator\", args: { a: 1, b: 2 } }\n* // ]\n* ```\n*/\nfunction convertToV1FromAnthropicMessage(message) {\n\tfunction* iterateContent() {\n\t\tconst content = typeof message.content === \"string\" ? [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message.content\n\t\t}] : message.content;\n\t\tfor (const block of content) {\n\t\t\tif (_isContentBlock(block, \"text\") && _isString(block.text)) {\n\t\t\t\tconst { text, citations,...rest } = block;\n\t\t\t\tif (_isArray(citations) && citations.length) {\n\t\t\t\t\tconst _citations = citations.reduce((acc, item) => {\n\t\t\t\t\t\tconst citation = convertAnthropicAnnotation(item);\n\t\t\t\t\t\tif (citation) return [...acc, citation];\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}, []);\n\t\t\t\t\tyield {\n\t\t\t\t\t\t...rest,\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\tannotations: _citations\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tyield {\n\t\t\t\t\t\t...rest,\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"thinking\") && _isString(block.thinking)) {\n\t\t\t\tconst { thinking, signature,...rest } = block;\n\t\t\t\tyield {\n\t\t\t\t\t...rest,\n\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\treasoning: thinking,\n\t\t\t\t\tsignature\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"redacted_thinking\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"tool_use\") && _isString(block.name) && _isString(block.id)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"tool_call\",\n\t\t\t\t\tid: block.id,\n\t\t\t\t\tname: block.name,\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"input_json_delta\")) {\n\t\t\t\tif (_isAIMessageChunk(message) && message.tool_call_chunks?.length) {\n\t\t\t\t\tconst tool_call_chunk = message.tool_call_chunks[0];\n\t\t\t\t\tyield {\n\t\t\t\t\t\ttype: \"tool_call_chunk\",\n\t\t\t\t\t\tid: tool_call_chunk.id,\n\t\t\t\t\t\tname: tool_call_chunk.name,\n\t\t\t\t\t\targs: tool_call_chunk.args,\n\t\t\t\t\t\tindex: tool_call_chunk.index\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"server_tool_use\") && _isString(block.name) && _isString(block.id)) {\n\t\t\t\tconst { name, id } = block;\n\t\t\t\tif (name === \"web_search\") {\n\t\t\t\t\tconst query = iife(() => {\n\t\t\t\t\t\tif (typeof block.input === \"string\") return block.input;\n\t\t\t\t\t\telse if (_isObject(block.input) && _isString(block.input.query)) return block.input.query;\n\t\t\t\t\t\telse if (_isString(block.partial_json)) {\n\t\t\t\t\t\t\tconst json = safeParseJson(block.partial_json);\n\t\t\t\t\t\t\tif (json?.query) return json.query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t});\n\t\t\t\t\tyield {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\t\targs: { query }\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (block.name === \"code_execution\") {\n\t\t\t\t\tconst code = iife(() => {\n\t\t\t\t\t\tif (typeof block.input === \"string\") return block.input;\n\t\t\t\t\t\telse if (_isObject(block.input) && _isString(block.input.code)) return block.input.code;\n\t\t\t\t\t\telse if (_isString(block.partial_json)) {\n\t\t\t\t\t\t\tconst json = safeParseJson(block.partial_json);\n\t\t\t\t\t\t\tif (json?.code) return json.code;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t});\n\t\t\t\t\tyield {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\t\tname: \"code_execution\",\n\t\t\t\t\t\targs: { code }\n\t\t\t\t\t};\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (_isContentBlock(block, \"web_search_tool_result\") && _isString(block.tool_use_id) && _isArray(block.content)) {\n\t\t\t\tconst { content: content$1, tool_use_id } = block;\n\t\t\t\tconst urls = content$1.reduce((acc, content$2) => {\n\t\t\t\t\tif (_isContentBlock(content$2, \"web_search_result\")) return [...acc, content$2.url];\n\t\t\t\t\treturn acc;\n\t\t\t\t}, []);\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"web_search\",\n\t\t\t\t\ttoolCallId: tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: { urls }\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"code_execution_tool_result\") && _isString(block.tool_use_id) && _isObject(block.content)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"code_execution\",\n\t\t\t\t\ttoolCallId: block.tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: block.content\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"mcp_tool_use\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"mcp_tool_use\",\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"mcp_tool_result\") && _isString(block.tool_use_id) && _isObject(block.content)) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call_result\",\n\t\t\t\t\tname: \"mcp_tool_use\",\n\t\t\t\t\ttoolCallId: block.tool_use_id,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\toutput: block.content\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"container_upload\")) {\n\t\t\t\tyield {\n\t\t\t\t\ttype: \"server_tool_call\",\n\t\t\t\t\tname: \"container_upload\",\n\t\t\t\t\targs: block.input\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"search_result\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else if (_isContentBlock(block, \"tool_result\")) {\n\t\t\t\tyield {\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"non_standard\",\n\t\t\t\t\tvalue: block\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tconst stdBlock = convertToV1FromAnthropicContentBlock(block);\n\t\t\t\tif (stdBlock) {\n\t\t\t\t\tyield stdBlock;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield {\n\t\t\t\ttype: \"non_standard\",\n\t\t\t\tvalue: block\n\t\t\t};\n\t\t}\n\t}\n\treturn Array.from(iterateContent());\n}\nconst ChatAnthropicTranslator = {\n\ttranslateContent: convertToV1FromAnthropicMessage,\n\ttranslateContentChunk: convertToV1FromAnthropicMessage\n};\nfunction _isAIMessageChunk(message) {\n\treturn typeof message?._getType === \"function\" && typeof message.concat === \"function\" && message._getType() === \"ai\";\n}\n\n//#endregion\nexport { ChatAnthropicTranslator, convertToV1FromAnthropicInput };\n//# sourceMappingURL=anthropic.js.map"],"names":[],"mappings":";AAGA,SAAS,2BAA2B,UAAU;AAC7C,MAAI,SAAS,SAAS,mBAAmB,UAAU,SAAS,cAAc,KAAK,UAAU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WAAW,qCAAqC,KAAK;AAC3D,YAAI,UAAU;AACb,gBAAM;AACN;AAAA,QACD;AAAA,MACD;AACA,YAAM;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,MACX;AAAA,IACE;AAAA,EACD;AACA,SAAO,MAAM,KAAK,gBAAgB;AACnC;AACK,MAAC,0BAA0B;AAAA,EAC/B,kBAAkB;AAAA,EAClB,uBAAuB;AACxB;AACA,SAAS,kBAAkB,SAAS;AACnC,SAAO,OAAO,SAAS,aAAa,cAAc,OAAO,QAAQ,WAAW,cAAc,QAAQ,SAAQ,MAAO;AAClH;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es58.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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KAAK,aAAa,SAAS,cAAc,KAAK,aAAa,SAAS,iBAAiB,KAAK,aAAa,SAAS,cAAc,GAAG;AACxK,gBAAM,kBAAkC,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]}
|
package/dist/index.es59.js
CHANGED
|
@@ -1,69 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
mimeType: block.mime_type,
|
|
7
|
-
url: block.url,
|
|
8
|
-
metadata: block.metadata
|
|
9
|
-
};
|
|
10
|
-
if (isBase64ContentBlock(block)) return {
|
|
11
|
-
type: block.type,
|
|
12
|
-
mimeType: block.mime_type ?? "application/octet-stream",
|
|
13
|
-
data: block.data,
|
|
14
|
-
metadata: block.metadata
|
|
15
|
-
};
|
|
16
|
-
if (isIDContentBlock(block)) return {
|
|
17
|
-
type: block.type,
|
|
18
|
-
mimeType: block.mime_type,
|
|
19
|
-
fileId: block.id,
|
|
20
|
-
metadata: block.metadata
|
|
21
|
-
};
|
|
22
|
-
return block;
|
|
23
|
-
}
|
|
24
|
-
function convertToV1FromDataContent(content) {
|
|
25
|
-
return content.map(convertToV1FromDataContentBlock);
|
|
26
|
-
}
|
|
27
|
-
function isOpenAIDataBlock(block) {
|
|
28
|
-
if (_isContentBlock(block, "image_url") && _isObject(block.image_url)) return true;
|
|
29
|
-
if (_isContentBlock(block, "input_audio") && _isObject(block.input_audio)) return true;
|
|
30
|
-
if (_isContentBlock(block, "file") && _isObject(block.file)) return true;
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
function convertToV1FromOpenAIDataBlock(block) {
|
|
34
|
-
if (_isContentBlock(block, "image_url") && _isObject(block.image_url) && _isString(block.image_url.url)) {
|
|
35
|
-
const parsed = parseBase64DataUrl({ dataUrl: block.image_url.url });
|
|
36
|
-
if (parsed) return {
|
|
37
|
-
type: "image",
|
|
38
|
-
mimeType: parsed.mime_type,
|
|
39
|
-
data: parsed.data
|
|
40
|
-
};
|
|
41
|
-
else return {
|
|
42
|
-
type: "image",
|
|
43
|
-
url: block.image_url.url
|
|
44
|
-
};
|
|
45
|
-
} else if (_isContentBlock(block, "input_audio") && _isObject(block.input_audio) && _isString(block.input_audio.data) && _isString(block.input_audio.format)) return {
|
|
46
|
-
type: "audio",
|
|
47
|
-
data: block.input_audio.data,
|
|
48
|
-
mimeType: `audio/${block.input_audio.format}`
|
|
49
|
-
};
|
|
50
|
-
else if (_isContentBlock(block, "file") && _isObject(block.file) && _isString(block.file.data)) {
|
|
51
|
-
const parsed = parseBase64DataUrl({ dataUrl: block.file.data });
|
|
52
|
-
if (parsed) return {
|
|
53
|
-
type: "file",
|
|
54
|
-
data: parsed.data,
|
|
55
|
-
mimeType: parsed.mime_type
|
|
56
|
-
};
|
|
57
|
-
else if (_isString(block.file.file_id)) return {
|
|
58
|
-
type: "file",
|
|
59
|
-
fileId: block.file.file_id
|
|
60
|
-
};
|
|
1
|
+
function getEnvironmentVariable(name) {
|
|
2
|
+
try {
|
|
3
|
+
return typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
4
|
+
} catch (e) {
|
|
5
|
+
return;
|
|
61
6
|
}
|
|
62
|
-
return block;
|
|
63
7
|
}
|
|
64
8
|
export {
|
|
65
|
-
|
|
66
|
-
convertToV1FromOpenAIDataBlock,
|
|
67
|
-
isOpenAIDataBlock
|
|
9
|
+
getEnvironmentVariable
|
|
68
10
|
};
|
|
69
11
|
//# sourceMappingURL=index.es59.js.map
|
package/dist/index.es59.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es59.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.
|
|
1
|
+
{"version":3,"file":"index.es59.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]}
|
package/dist/index.es6.js
CHANGED
|
@@ -83,10 +83,12 @@ const StreamSession = ({ children }) => {
|
|
|
83
83
|
if (options?.type === "ai") {
|
|
84
84
|
setLocalMessages((prev) => [...prev, messageObj]);
|
|
85
85
|
if (options.ui && options.ui.length > 0) {
|
|
86
|
-
const uiWithMessageId = options.ui.map((ui) => ({
|
|
86
|
+
const uiWithMessageId = options.ui.map((ui, index) => ({
|
|
87
87
|
...ui,
|
|
88
|
-
id: messageId
|
|
89
|
-
//
|
|
88
|
+
id: messageId,
|
|
89
|
+
// Link to the message ID so CustomComponentRender can find it
|
|
90
|
+
// Ensure each UI component has a unique identifier for React keys
|
|
91
|
+
_key: ui._key || `${messageId}-ui-${index}`
|
|
90
92
|
}));
|
|
91
93
|
setLocalUI((prev) => [...prev, ...uiWithMessageId]);
|
|
92
94
|
}
|
|
@@ -111,10 +113,24 @@ const StreamSession = ({ children }) => {
|
|
|
111
113
|
[streamValue, identity, configuration, setLocalMessages, setLocalUI]
|
|
112
114
|
);
|
|
113
115
|
const combinedMessages = useMemo(() => {
|
|
114
|
-
|
|
116
|
+
const allMessages = [...localMessages, ...streamValue.messages || []];
|
|
117
|
+
const seen = /* @__PURE__ */ new Set();
|
|
118
|
+
return allMessages.filter((msg) => {
|
|
119
|
+
if (!msg.id) return true;
|
|
120
|
+
if (seen.has(msg.id)) return false;
|
|
121
|
+
seen.add(msg.id);
|
|
122
|
+
return true;
|
|
123
|
+
});
|
|
115
124
|
}, [localMessages, streamValue.messages]);
|
|
116
125
|
const combinedUI = useMemo(() => {
|
|
117
|
-
|
|
126
|
+
const allUI = [...localUI, ...streamValue.values?.ui || []];
|
|
127
|
+
const seen = /* @__PURE__ */ new Set();
|
|
128
|
+
return allUI.filter((ui) => {
|
|
129
|
+
const key = ui._key || `${ui.id}-${ui.name}`;
|
|
130
|
+
if (seen.has(key)) return false;
|
|
131
|
+
seen.add(key);
|
|
132
|
+
return true;
|
|
133
|
+
});
|
|
118
134
|
}, [localUI, streamValue.values?.ui]);
|
|
119
135
|
const submitMessage = useCallback(
|
|
120
136
|
async (message, options) => {
|