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.es62.js
CHANGED
|
@@ -1,12 +1,303 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { _isContentBlock, _isObject, _isString, _isArray, iife, safeParseJson, _isNumber } from "./index.es78.js";
|
|
2
|
+
function convertAnthropicAnnotation(citation) {
|
|
3
|
+
if (citation.type === "char_location" && _isString(citation.document_title) && _isNumber(citation.start_char_index) && _isNumber(citation.end_char_index) && _isString(citation.cited_text)) {
|
|
4
|
+
const { document_title, start_char_index, end_char_index, cited_text, ...rest } = citation;
|
|
5
|
+
return {
|
|
6
|
+
...rest,
|
|
7
|
+
type: "citation",
|
|
8
|
+
source: "char",
|
|
9
|
+
title: document_title ?? void 0,
|
|
10
|
+
startIndex: start_char_index,
|
|
11
|
+
endIndex: end_char_index,
|
|
12
|
+
citedText: cited_text
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (citation.type === "page_location" && _isString(citation.document_title) && _isNumber(citation.start_page_number) && _isNumber(citation.end_page_number) && _isString(citation.cited_text)) {
|
|
16
|
+
const { document_title, start_page_number, end_page_number, cited_text, ...rest } = citation;
|
|
17
|
+
return {
|
|
18
|
+
...rest,
|
|
19
|
+
type: "citation",
|
|
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;
|
|
66
|
+
}
|
|
67
|
+
function convertToV1FromAnthropicContentBlock(block) {
|
|
68
|
+
if (_isContentBlock(block, "document") && _isObject(block.source) && "type" in block.source) {
|
|
69
|
+
if (block.source.type === "base64" && _isString(block.source.media_type) && _isString(block.source.data)) return {
|
|
70
|
+
type: "file",
|
|
71
|
+
mimeType: block.source.media_type,
|
|
72
|
+
data: block.source.data
|
|
73
|
+
};
|
|
74
|
+
else if (block.source.type === "url" && _isString(block.source.url)) return {
|
|
75
|
+
type: "file",
|
|
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
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
function convertToV1FromAnthropicInput(content) {
|
|
105
|
+
function* iterateContent() {
|
|
106
|
+
for (const block of content) {
|
|
107
|
+
const stdBlock = convertToV1FromAnthropicContentBlock(block);
|
|
108
|
+
if (stdBlock) yield stdBlock;
|
|
109
|
+
else yield block;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return Array.from(iterateContent());
|
|
113
|
+
}
|
|
114
|
+
function convertToV1FromAnthropicMessage(message) {
|
|
115
|
+
function* iterateContent() {
|
|
116
|
+
const content = typeof message.content === "string" ? [{
|
|
117
|
+
type: "text",
|
|
118
|
+
text: message.content
|
|
119
|
+
}] : message.content;
|
|
120
|
+
for (const block of content) {
|
|
121
|
+
if (_isContentBlock(block, "text") && _isString(block.text)) {
|
|
122
|
+
const { text, citations, ...rest } = block;
|
|
123
|
+
if (_isArray(citations) && citations.length) {
|
|
124
|
+
const _citations = citations.reduce((acc, item) => {
|
|
125
|
+
const citation = convertAnthropicAnnotation(item);
|
|
126
|
+
if (citation) return [...acc, citation];
|
|
127
|
+
return acc;
|
|
128
|
+
}, []);
|
|
129
|
+
yield {
|
|
130
|
+
...rest,
|
|
131
|
+
type: "text",
|
|
132
|
+
text,
|
|
133
|
+
annotations: _citations
|
|
134
|
+
};
|
|
135
|
+
continue;
|
|
136
|
+
} else {
|
|
137
|
+
yield {
|
|
138
|
+
...rest,
|
|
139
|
+
type: "text",
|
|
140
|
+
text
|
|
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;
|
|
215
|
+
}
|
|
216
|
+
} else if (_isContentBlock(block, "web_search_tool_result") && _isString(block.tool_use_id) && _isArray(block.content)) {
|
|
217
|
+
const { content: content$1, tool_use_id } = block;
|
|
218
|
+
const urls = content$1.reduce((acc, content$2) => {
|
|
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;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
yield {
|
|
285
|
+
type: "non_standard",
|
|
286
|
+
value: block
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return Array.from(iterateContent());
|
|
291
|
+
}
|
|
292
|
+
const ChatAnthropicTranslator = {
|
|
293
|
+
translateContent: convertToV1FromAnthropicMessage,
|
|
294
|
+
translateContentChunk: convertToV1FromAnthropicMessage
|
|
295
|
+
};
|
|
296
|
+
function _isAIMessageChunk(message) {
|
|
297
|
+
return typeof message?._getType === "function" && typeof message.concat === "function" && message._getType() === "ai";
|
|
8
298
|
}
|
|
9
299
|
export {
|
|
10
|
-
|
|
300
|
+
ChatAnthropicTranslator,
|
|
301
|
+
convertToV1FromAnthropicInput
|
|
11
302
|
};
|
|
12
303
|
//# sourceMappingURL=index.es62.js.map
|
package/dist/index.es62.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es62.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/errors/index.js"],"sourcesContent":["//#region src/errors/index.ts\nfunction addLangChainErrorFields(error, lc_error_code) {\n\terror.lc_error_code = lc_error_code;\n\terror.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n\treturn error;\n}\n\n//#endregion\nexport { addLangChainErrorFields };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AACA,SAAS,wBAAwB,OAAO,eAAe;AACtD,QAAM,gBAAgB;AACtB,QAAM,UAAU,GAAG,MAAM,OAAO;AAAA;AAAA,kFAAuF,aAAa;AAAA;AACpI,SAAO;AACR;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es62.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,SAAS,gBAAgB,KAAK,UAAU,SAAS,cAAc,KAAK,UAAU,SAAS,UAAU,GAAG;AAC5L,UAAM,EAAE,gBAAgB,kBAAkB,gBAAgB,YAAW,GAAG,KAAI,IAAK;AACjF,WAAO;AAAA,MACN,GAAG;AAAA,MACH,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,kBAAkB;AAAA,MACzB,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,WAAW;AAAA,IACd;AAAA,EACC;AACA,MAAI,SAAS,SAAS,mBAAmB,UAAU,SAAS,cAAc,KAAK,UAAU,SAAS,iBAAiB,KAAK,UAAU,SAAS,eAAe,KAAK,UAAU,SAAS,UAAU,GAAG;AAC9L,UAAM,EAAE,gBAAgB,mBAAmB,iBAAiB,YAAW,GAAG,KAAI,IAAK;AACnF,WAAO;AAAA,MACN,GAAG;AAAA,MACH,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,kBAAkB;AAAA,MACzB,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,WAAW;AAAA,IACd;AAAA,EACC;AACA,MAAI,SAAS,SAAS,4BAA4B,UAAU,SAAS,cAAc,KAAK,UAAU,SAAS,iBAAiB,KAAK,UAAU,SAAS,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AA,UAClB,QAAQ;AAAA,UACR,QAAQ,MAAM;AAAA,QACnB;AACI;AAAA,MACD,WAAW,gBAAgB,OAAO,kBAAkB,GAAG;AACtD,cAAM;AAAA,UACL,MAAM;AAAA,UACN,MAAM;AAAA,UACN,MAAM,MAAM;AAAA,QACjB;AACI;AAAA,MACD,WAAW,gBAAgB,OAAO,eAAe,GAAG;AACnD,cAAM;AAAA,UACL,IAAI,MAAM;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,QACZ;AACI;AAAA,MACD,WAAW,gBAAgB,OAAO,aAAa,GAAG;AACjD,cAAM;AAAA,UACL,IAAI,MAAM;AAAA,UACV,MAAM;AAAA,UACN,OAAO;AAAA,QACZ;AACI;AAAA,MACD,OAAO;AACN,cAAM,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]}
|
package/dist/index.es63.js
CHANGED
|
@@ -1,15 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { isURLContentBlock, isBase64ContentBlock, isIDContentBlock, parseBase64DataUrl } from "./index.es51.js";
|
|
2
|
+
import { _isContentBlock, _isObject, _isString } from "./index.es78.js";
|
|
3
|
+
function convertToV1FromDataContentBlock(block) {
|
|
4
|
+
if (isURLContentBlock(block)) return {
|
|
5
|
+
type: block.type,
|
|
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
|
+
};
|
|
9
61
|
}
|
|
10
|
-
|
|
62
|
+
return block;
|
|
63
|
+
}
|
|
11
64
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
65
|
+
convertToV1FromDataContent,
|
|
66
|
+
convertToV1FromOpenAIDataBlock,
|
|
67
|
+
isOpenAIDataBlock
|
|
14
68
|
};
|
|
15
69
|
//# sourceMappingURL=index.es63.js.map
|
package/dist/index.es63.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es63.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/
|
|
1
|
+
{"version":3,"file":"index.es63.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/data.js"],"sourcesContent":["import { isBase64ContentBlock, isIDContentBlock, isURLContentBlock, parseBase64DataUrl } from \"../content/data.js\";\nimport { _isContentBlock, _isObject, _isString } from \"./utils.js\";\n\n//#region src/messages/block_translators/data.ts\nfunction convertToV1FromDataContentBlock(block) {\n\tif (isURLContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type,\n\t\turl: block.url,\n\t\tmetadata: block.metadata\n\t};\n\tif (isBase64ContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type ?? \"application/octet-stream\",\n\t\tdata: block.data,\n\t\tmetadata: block.metadata\n\t};\n\tif (isIDContentBlock(block)) return {\n\t\ttype: block.type,\n\t\tmimeType: block.mime_type,\n\t\tfileId: block.id,\n\t\tmetadata: block.metadata\n\t};\n\treturn block;\n}\nfunction convertToV1FromDataContent(content) {\n\treturn content.map(convertToV1FromDataContentBlock);\n}\nfunction isOpenAIDataBlock(block) {\n\tif (_isContentBlock(block, \"image_url\") && _isObject(block.image_url)) return true;\n\tif (_isContentBlock(block, \"input_audio\") && _isObject(block.input_audio)) return true;\n\tif (_isContentBlock(block, \"file\") && _isObject(block.file)) return true;\n\treturn false;\n}\nfunction convertToV1FromOpenAIDataBlock(block) {\n\tif (_isContentBlock(block, \"image_url\") && _isObject(block.image_url) && _isString(block.image_url.url)) {\n\t\tconst parsed = parseBase64DataUrl({ dataUrl: block.image_url.url });\n\t\tif (parsed) return {\n\t\t\ttype: \"image\",\n\t\t\tmimeType: parsed.mime_type,\n\t\t\tdata: parsed.data\n\t\t};\n\t\telse return {\n\t\t\ttype: \"image\",\n\t\t\turl: block.image_url.url\n\t\t};\n\t} else if (_isContentBlock(block, \"input_audio\") && _isObject(block.input_audio) && _isString(block.input_audio.data) && _isString(block.input_audio.format)) return {\n\t\ttype: \"audio\",\n\t\tdata: block.input_audio.data,\n\t\tmimeType: `audio/${block.input_audio.format}`\n\t};\n\telse if (_isContentBlock(block, \"file\") && _isObject(block.file) && _isString(block.file.data)) {\n\t\tconst parsed = parseBase64DataUrl({ dataUrl: block.file.data });\n\t\tif (parsed) return {\n\t\t\ttype: \"file\",\n\t\t\tdata: parsed.data,\n\t\t\tmimeType: parsed.mime_type\n\t\t};\n\t\telse if (_isString(block.file.file_id)) return {\n\t\t\ttype: \"file\",\n\t\t\tfileId: block.file.file_id\n\t\t};\n\t}\n\treturn block;\n}\n\n//#endregion\nexport { convertToV1FromDataContent, convertToV1FromOpenAIDataBlock, isOpenAIDataBlock };\n//# sourceMappingURL=data.js.map"],"names":[],"mappings":";;AAIA,SAAS,gCAAgC,OAAO;AAC/C,MAAI,kBAAkB,KAA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