langgraph-ui-components 0.0.10 → 0.0.11-testing
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3 -2
- package/dist/index.es10.js +25 -6
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +131 -64
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +65 -32
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +34 -34
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +35 -164
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +156 -193
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +202 -13
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +13 -29
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +25 -29
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +24 -3147
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +3151 -31
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es110.js +21 -5
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +64 -69
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +3 -37
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +16 -5
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +7 -2
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +2 -13
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +9 -499
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +501 -5
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +7 -2
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +2 -148
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es120.js +118 -878
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +877 -251
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +281 -3
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +3 -445
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +437 -39
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +46 -22
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +21 -78
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +76 -126
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +125 -45
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +48 -9
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es130.js +10 -45
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +43 -97
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +94 -48
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +51 -14
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +1 -1
- package/dist/index.es135.js +1 -1
- package/dist/index.es138.js +1 -1
- package/dist/index.es139.js +1 -1
- package/dist/index.es140.js +1 -1
- package/dist/index.es141.js +1 -1
- package/dist/index.es142.js +1 -1
- package/dist/index.es143.js +1 -1
- package/dist/index.es144.js +1 -1
- package/dist/index.es145.js +1 -1
- package/dist/index.es146.js +1 -1
- package/dist/index.es147.js +1 -1
- package/dist/index.es148.js +1 -1
- package/dist/index.es149.js +1 -1
- package/dist/index.es150.js +1 -1
- package/dist/index.es151.js +1 -1
- package/dist/index.es152.js +1 -1
- package/dist/index.es153.js +1 -1
- package/dist/index.es154.js +1 -1
- package/dist/index.es155.js +1 -1
- package/dist/index.es156.js +1 -1
- package/dist/index.es157.js +1 -1
- package/dist/index.es158.js +1 -1
- package/dist/index.es159.js +1 -1
- package/dist/index.es16.js +3 -3
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es160.js +1 -1
- package/dist/index.es161.js +1 -1
- package/dist/index.es162.js +1 -1
- package/dist/index.es163.js +1 -1
- package/dist/index.es164.js +1 -1
- package/dist/index.es165.js +1 -1
- package/dist/index.es166.js +1 -1
- package/dist/index.es167.js +1 -1
- package/dist/index.es168.js +1 -1
- package/dist/index.es169.js +1 -1
- package/dist/index.es170.js +1 -1
- package/dist/index.es171.js +1 -1
- package/dist/index.es172.js +1 -1
- package/dist/index.es173.js +1 -1
- package/dist/index.es174.js +1 -1
- package/dist/index.es175.js +1 -1
- package/dist/index.es176.js +1 -1
- package/dist/index.es177.js +1 -1
- package/dist/index.es178.js +1 -1
- package/dist/index.es179.js +1 -1
- package/dist/index.es18.js +15 -15
- package/dist/index.es180.js +1 -1
- package/dist/index.es181.js +1 -1
- package/dist/index.es182.js +1 -1
- package/dist/index.es183.js +162 -13
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +2 -89
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +15 -2
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +89 -2
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +2 -2
- package/dist/index.es188.js +56 -2
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +100 -2
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +191 -2
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +110 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +35 -2
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +10 -2
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +11 -2
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +12 -2
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +91 -2
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +275 -2
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +2 -2
- package/dist/index.es199.js +164 -2
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es200.js +51 -2
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +40 -2
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +35 -2
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +40 -2
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +24 -2
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +591 -2
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +125 -2
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +2 -2
- package/dist/index.es208.js +2 -2
- package/dist/index.es209.js +2 -2
- package/dist/index.es210.js +2 -2
- package/dist/index.es211.js +2 -2
- package/dist/index.es212.js +2 -2
- package/dist/index.es213.js +2 -2
- package/dist/index.es214.js +2 -2
- package/dist/index.es215.js +2 -2
- package/dist/index.es216.js +2 -2
- package/dist/index.es217.js +2 -2
- package/dist/index.es218.js +2 -2
- package/dist/index.es219.js +2 -2
- package/dist/index.es220.js +2 -2
- package/dist/index.es221.js +2 -2
- package/dist/index.es222.js +2 -2
- package/dist/index.es223.js +2 -2
- package/dist/index.es224.js +2 -2
- package/dist/index.es225.js +2 -2
- package/dist/index.es226.js +2 -2
- package/dist/index.es227.js +2 -2
- package/dist/index.es228.js +2 -2
- package/dist/index.es229.js +2 -2
- package/dist/index.es230.js +2 -2
- package/dist/index.es231.js +2 -56
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +2 -100
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +2 -191
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +2 -110
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +2 -35
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +2 -10
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +2 -11
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +2 -12
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +2 -91
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +1 -1
- package/dist/index.es240.js +2 -275
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +2 -2
- package/dist/index.es242.js +2 -164
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +2 -51
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +2 -40
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +2 -35
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +2 -40
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +2 -24
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +2 -591
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +2 -125
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +3 -1
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +2 -164
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +2 -2
- package/dist/index.es252.js +2 -2
- package/dist/index.es253.js +1 -1
- package/dist/index.es258.js +1 -1
- package/dist/index.es260.js +2 -2
- package/dist/index.es262.js +2 -2
- package/dist/index.es265.js +1 -1
- package/dist/index.es267.js +1 -1
- package/dist/index.es277.js +2 -147
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +126 -167
- package/dist/index.es278.js.map +1 -1
- package/dist/index.es279.js +188 -2
- package/dist/index.es279.js.map +1 -1
- package/dist/index.es280.js +1 -1
- package/dist/index.es283.js +1 -1
- package/dist/index.es288.js +1 -1
- package/dist/index.es29.js +1 -1
- package/dist/index.es3.js +24 -9
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es300.js +1 -1
- package/dist/index.es302.js +1 -1
- package/dist/index.es31.js +7 -7
- package/dist/index.es314.js +1 -1
- package/dist/index.es32.js +1 -1
- package/dist/index.es334.js +2 -2
- package/dist/index.es35.js +4 -4
- package/dist/index.es36.js +1185 -111
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +7 -71
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +9 -18
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +136 -250
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +2 -1
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +116 -41
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +64 -208
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +17 -66
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +236 -117
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +38 -19
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +202 -217
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +65 -7
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +131 -1181
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +25 -8
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +218 -135
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es50.js +5 -208
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +208 -5
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +90 -7
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +6 -92
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +14 -3
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +8 -36
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +83 -61
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +3 -37
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +34 -304
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +72 -9
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +32 -85
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +304 -6
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +9 -15
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +3 -3
- package/dist/index.es64.js +5 -142
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +148 -285
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +668 -62
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +131 -201
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +295 -29
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +65 -8
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es7.js +2 -1
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es70.js +210 -9
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +28 -181
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +8 -23
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +9 -1397
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +187 -9
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +24 -8
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +1399 -5
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +9 -163
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +8 -672
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +36 -20
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +5 -68
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +73 -3
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +36 -11
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +10 -38
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +34 -28
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +28 -226
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +228 -26
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +26 -71
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +41 -42
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +71 -47
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +37 -15
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +6 -19
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +40 -54
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +56 -12
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +13 -137
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +135 -19
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +18 -179
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +163 -222
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +187 -301
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +348 -130
- package/dist/index.es99.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es52.js
CHANGED
|
@@ -1,11 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { _getFetchImplementation } from "./index.es64.js";
|
|
2
|
+
import pRetry from "./index.es65.js";
|
|
3
|
+
import PQueue from "./index.es66.js";
|
|
4
|
+
const STATUS_NO_RETRY = [
|
|
5
|
+
400,
|
|
6
|
+
401,
|
|
7
|
+
402,
|
|
8
|
+
403,
|
|
9
|
+
404,
|
|
10
|
+
405,
|
|
11
|
+
406,
|
|
12
|
+
407,
|
|
13
|
+
408,
|
|
14
|
+
409,
|
|
15
|
+
422
|
|
16
|
+
];
|
|
17
|
+
function isResponse(x) {
|
|
18
|
+
if (x == null || typeof x !== "object") return false;
|
|
19
|
+
return "status" in x && "statusText" in x && "text" in x;
|
|
20
|
+
}
|
|
21
|
+
var HTTPError = class HTTPError2 extends Error {
|
|
22
|
+
status;
|
|
23
|
+
text;
|
|
24
|
+
response;
|
|
25
|
+
constructor(status, message, response) {
|
|
26
|
+
super(`HTTP ${status}: ${message}`);
|
|
27
|
+
this.status = status;
|
|
28
|
+
this.text = message;
|
|
29
|
+
this.response = response;
|
|
30
|
+
}
|
|
31
|
+
static async fromResponse(response, options) {
|
|
32
|
+
try {
|
|
33
|
+
return new HTTPError2(response.status, await response.text(), options?.includeResponse ? response : void 0);
|
|
34
|
+
} catch {
|
|
35
|
+
return new HTTPError2(response.status, response.statusText, options?.includeResponse ? response : void 0);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var AsyncCaller = class {
|
|
40
|
+
maxConcurrency;
|
|
41
|
+
maxRetries;
|
|
42
|
+
queue;
|
|
43
|
+
onFailedResponseHook;
|
|
44
|
+
customFetch;
|
|
45
|
+
constructor(params) {
|
|
46
|
+
this.maxConcurrency = params.maxConcurrency ?? Infinity;
|
|
47
|
+
this.maxRetries = params.maxRetries ?? 4;
|
|
48
|
+
if ("default" in PQueue) this.queue = new PQueue.default({ concurrency: this.maxConcurrency });
|
|
49
|
+
else this.queue = new PQueue({ concurrency: this.maxConcurrency });
|
|
50
|
+
this.onFailedResponseHook = params?.onFailedResponseHook;
|
|
51
|
+
this.customFetch = params.fetch;
|
|
52
|
+
}
|
|
53
|
+
call(callable, ...args) {
|
|
54
|
+
const { onFailedResponseHook } = this;
|
|
55
|
+
return this.queue.add(() => pRetry(() => callable(...args).catch(async (error) => {
|
|
56
|
+
if (error instanceof Error) throw error;
|
|
57
|
+
else if (isResponse(error)) throw await HTTPError.fromResponse(error, { includeResponse: !!onFailedResponseHook });
|
|
58
|
+
else throw new Error(error);
|
|
59
|
+
}), {
|
|
60
|
+
async onFailedAttempt({ error }) {
|
|
61
|
+
const errorMessage = error.message ?? "";
|
|
62
|
+
if (errorMessage.startsWith("Cancel") || errorMessage.startsWith("TimeoutError") || errorMessage.startsWith("AbortError")) throw error;
|
|
63
|
+
if (error?.code === "ECONNABORTED") throw error;
|
|
64
|
+
if (errorMessage.includes("ECONNREFUSED") || errorMessage.includes("fetch failed") || errorMessage.includes("Failed to fetch") || errorMessage.includes("NetworkError")) {
|
|
65
|
+
const connectionError = /* @__PURE__ */ new Error(`Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`);
|
|
66
|
+
connectionError.name = "ConnectionError";
|
|
67
|
+
throw connectionError;
|
|
68
|
+
}
|
|
69
|
+
if (error instanceof HTTPError) {
|
|
70
|
+
if (STATUS_NO_RETRY.includes(error.status)) throw error;
|
|
71
|
+
if (onFailedResponseHook && error.response) await onFailedResponseHook(error.response);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
retries: this.maxRetries,
|
|
75
|
+
randomize: true
|
|
76
|
+
}), { throwOnTimeout: true });
|
|
77
|
+
}
|
|
78
|
+
callWithOptions(options, callable, ...args) {
|
|
79
|
+
if (options.signal) return Promise.race([this.call(callable, ...args), new Promise((_, reject) => {
|
|
80
|
+
options.signal?.addEventListener("abort", () => {
|
|
81
|
+
reject(/* @__PURE__ */ new Error("AbortError"));
|
|
82
|
+
});
|
|
83
|
+
})]);
|
|
84
|
+
return this.call(callable, ...args);
|
|
85
|
+
}
|
|
86
|
+
fetch(...args) {
|
|
87
|
+
const fetchFn = this.customFetch ?? _getFetchImplementation();
|
|
88
|
+
return this.call(() => fetchFn(...args).then((res) => res.ok ? res : Promise.reject(res)));
|
|
89
|
+
}
|
|
7
90
|
};
|
|
8
91
|
export {
|
|
9
|
-
|
|
92
|
+
AsyncCaller
|
|
10
93
|
};
|
|
11
94
|
//# sourceMappingURL=index.es52.js.map
|
package/dist/index.es52.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es52.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.
|
|
1
|
+
{"version":3,"file":"index.es52.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/async_caller.js"],"sourcesContent":["import { _getFetchImplementation } from \"../singletons/fetch.js\";\nimport pRetry from \"p-retry\";\nimport PQueueMod from \"p-queue\";\n\n//#region src/utils/async_caller.ts\nconst STATUS_NO_RETRY = [\n\t400,\n\t401,\n\t402,\n\t403,\n\t404,\n\t405,\n\t406,\n\t407,\n\t408,\n\t409,\n\t422\n];\n/**\n* Do not rely on globalThis.Response, rather just\n* do duck typing\n*/\nfunction isResponse(x) {\n\tif (x == null || typeof x !== \"object\") return false;\n\treturn \"status\" in x && \"statusText\" in x && \"text\" in x;\n}\n/**\n* Utility error to properly handle failed requests\n*/\nvar HTTPError = class HTTPError extends Error {\n\tstatus;\n\ttext;\n\tresponse;\n\tconstructor(status, message, response) {\n\t\tsuper(`HTTP ${status}: ${message}`);\n\t\tthis.status = status;\n\t\tthis.text = message;\n\t\tthis.response = response;\n\t}\n\tstatic async fromResponse(response, options) {\n\t\ttry {\n\t\t\treturn new HTTPError(response.status, await response.text(), options?.includeResponse ? response : void 0);\n\t\t} catch {\n\t\t\treturn new HTTPError(response.status, response.statusText, options?.includeResponse ? response : void 0);\n\t\t}\n\t}\n};\n/**\n* A class that can be used to make async calls with concurrency and retry logic.\n*\n* This is useful for making calls to any kind of \"expensive\" external resource,\n* be it because it's rate-limited, subject to network issues, etc.\n*\n* Concurrent calls are limited by the `maxConcurrency` parameter, which defaults\n* to `Infinity`. This means that by default, all calls will be made in parallel.\n*\n* Retries are limited by the `maxRetries` parameter, which defaults to 5. This\n* means that by default, each call will be retried up to 5 times, with an\n* exponential backoff between each attempt.\n*/\nvar AsyncCaller = class {\n\tmaxConcurrency;\n\tmaxRetries;\n\tqueue;\n\tonFailedResponseHook;\n\tcustomFetch;\n\tconstructor(params) {\n\t\tthis.maxConcurrency = params.maxConcurrency ?? Infinity;\n\t\tthis.maxRetries = params.maxRetries ?? 4;\n\t\tif (\"default\" in PQueueMod) this.queue = new PQueueMod.default({ concurrency: this.maxConcurrency });\n\t\telse this.queue = new PQueueMod({ concurrency: this.maxConcurrency });\n\t\tthis.onFailedResponseHook = params?.onFailedResponseHook;\n\t\tthis.customFetch = params.fetch;\n\t}\n\tcall(callable, ...args) {\n\t\tconst { onFailedResponseHook } = this;\n\t\treturn this.queue.add(() => pRetry(() => callable(...args).catch(async (error) => {\n\t\t\tif (error instanceof Error) throw error;\n\t\t\telse if (isResponse(error)) throw await HTTPError.fromResponse(error, { includeResponse: !!onFailedResponseHook });\n\t\t\telse throw new Error(error);\n\t\t}), {\n\t\t\tasync onFailedAttempt({ error }) {\n\t\t\t\tconst errorMessage = error.message ?? \"\";\n\t\t\t\tif (errorMessage.startsWith(\"Cancel\") || errorMessage.startsWith(\"TimeoutError\") || errorMessage.startsWith(\"AbortError\")) throw error;\n\t\t\t\tif (error?.code === \"ECONNABORTED\") throw error;\n\t\t\t\tif (errorMessage.includes(\"ECONNREFUSED\") || errorMessage.includes(\"fetch failed\") || errorMessage.includes(\"Failed to fetch\") || errorMessage.includes(\"NetworkError\")) {\n\t\t\t\t\tconst connectionError = /* @__PURE__ */ new Error(`Unable to connect to LangGraph server. Please ensure the server is running and accessible. Original error: ${errorMessage}`);\n\t\t\t\t\tconnectionError.name = \"ConnectionError\";\n\t\t\t\t\tthrow connectionError;\n\t\t\t\t}\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (STATUS_NO_RETRY.includes(error.status)) throw error;\n\t\t\t\t\tif (onFailedResponseHook && error.response) await onFailedResponseHook(error.response);\n\t\t\t\t}\n\t\t\t},\n\t\t\tretries: this.maxRetries,\n\t\t\trandomize: true\n\t\t}), { throwOnTimeout: true });\n\t}\n\tcallWithOptions(options, callable, ...args) {\n\t\tif (options.signal) return Promise.race([this.call(callable, ...args), new Promise((_, reject) => {\n\t\t\toptions.signal?.addEventListener(\"abort\", () => {\n\t\t\t\treject(/* @__PURE__ */ new Error(\"AbortError\"));\n\t\t\t});\n\t\t})]);\n\t\treturn this.call(callable, ...args);\n\t}\n\tfetch(...args) {\n\t\tconst fetchFn = this.customFetch ?? _getFetchImplementation();\n\t\treturn this.call(() => fetchFn(...args).then((res) => res.ok ? res : Promise.reject(res)));\n\t}\n};\n\n//#endregion\nexport { AsyncCaller };\n//# sourceMappingURL=async_caller.js.map"],"names":["HTTPError","PQueueMod"],"mappings":"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","x_google_ignoreList":[0]}
|
package/dist/index.es53.js
CHANGED
|
@@ -1,97 +1,11 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
function isBase64ContentBlock(content_block) {
|
|
8
|
-
return isDataContentBlock(content_block) && content_block.source_type === "base64" && "data" in content_block && typeof content_block.data === "string";
|
|
9
|
-
}
|
|
10
|
-
function isPlainTextContentBlock(content_block) {
|
|
11
|
-
return isDataContentBlock(content_block) && content_block.source_type === "text" && "text" in content_block && typeof content_block.text === "string";
|
|
12
|
-
}
|
|
13
|
-
function isIDContentBlock(content_block) {
|
|
14
|
-
return isDataContentBlock(content_block) && content_block.source_type === "id" && "id" in content_block && typeof content_block.id === "string";
|
|
15
|
-
}
|
|
16
|
-
function convertToOpenAIImageBlock(content_block) {
|
|
17
|
-
if (isDataContentBlock(content_block)) {
|
|
18
|
-
if (content_block.source_type === "url") return {
|
|
19
|
-
type: "image_url",
|
|
20
|
-
image_url: { url: content_block.url }
|
|
21
|
-
};
|
|
22
|
-
if (content_block.source_type === "base64") {
|
|
23
|
-
if (!content_block.mime_type) throw new Error("mime_type key is required for base64 data.");
|
|
24
|
-
const mime_type = content_block.mime_type;
|
|
25
|
-
return {
|
|
26
|
-
type: "image_url",
|
|
27
|
-
image_url: { url: `data:${mime_type};base64,${content_block.data}` }
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.");
|
|
32
|
-
}
|
|
33
|
-
function parseMimeType(mime_type) {
|
|
34
|
-
const parts = mime_type.split(";")[0].split("/");
|
|
35
|
-
if (parts.length !== 2) throw new Error(`Invalid mime type: "${mime_type}" - does not match type/subtype format.`);
|
|
36
|
-
const type = parts[0].trim();
|
|
37
|
-
const subtype = parts[1].trim();
|
|
38
|
-
if (type === "" || subtype === "") throw new Error(`Invalid mime type: "${mime_type}" - type or subtype is empty.`);
|
|
39
|
-
const parameters = {};
|
|
40
|
-
for (const parameterKvp of mime_type.split(";").slice(1)) {
|
|
41
|
-
const parameterParts = parameterKvp.split("=");
|
|
42
|
-
if (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
|
|
43
|
-
const key = parameterParts[0].trim();
|
|
44
|
-
const value = parameterParts[1].trim();
|
|
45
|
-
if (key === "") throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
|
|
46
|
-
parameters[key] = value;
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
type,
|
|
50
|
-
subtype,
|
|
51
|
-
parameters
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {
|
|
55
|
-
const formatMatch = data_url.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);
|
|
56
|
-
let mime_type;
|
|
57
|
-
if (formatMatch) {
|
|
58
|
-
mime_type = formatMatch[1].toLowerCase();
|
|
59
|
-
const data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];
|
|
60
|
-
return {
|
|
61
|
-
mime_type,
|
|
62
|
-
data
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return void 0;
|
|
66
|
-
}
|
|
67
|
-
function convertToProviderContentBlock(block, converter) {
|
|
68
|
-
if (block.type === "text") {
|
|
69
|
-
if (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardTextBlock\` method.`);
|
|
70
|
-
return converter.fromStandardTextBlock(block);
|
|
71
|
-
}
|
|
72
|
-
if (block.type === "image") {
|
|
73
|
-
if (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardImageBlock\` method.`);
|
|
74
|
-
return converter.fromStandardImageBlock(block);
|
|
75
|
-
}
|
|
76
|
-
if (block.type === "audio") {
|
|
77
|
-
if (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardAudioBlock\` method.`);
|
|
78
|
-
return converter.fromStandardAudioBlock(block);
|
|
79
|
-
}
|
|
80
|
-
if (block.type === "file") {
|
|
81
|
-
if (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardFileBlock\` method.`);
|
|
82
|
-
return converter.fromStandardFileBlock(block);
|
|
1
|
+
function getEnvironmentVariable(name) {
|
|
2
|
+
try {
|
|
3
|
+
return typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
4
|
+
} catch (e) {
|
|
5
|
+
return;
|
|
83
6
|
}
|
|
84
|
-
throw new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);
|
|
85
7
|
}
|
|
86
8
|
export {
|
|
87
|
-
|
|
88
|
-
convertToProviderContentBlock,
|
|
89
|
-
isBase64ContentBlock,
|
|
90
|
-
isDataContentBlock,
|
|
91
|
-
isIDContentBlock,
|
|
92
|
-
isPlainTextContentBlock,
|
|
93
|
-
isURLContentBlock,
|
|
94
|
-
parseBase64DataUrl,
|
|
95
|
-
parseMimeType
|
|
9
|
+
getEnvironmentVariable
|
|
96
10
|
};
|
|
97
11
|
//# sourceMappingURL=index.es53.js.map
|
package/dist/index.es53.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es53.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.
|
|
1
|
+
{"version":3,"file":"index.es53.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/env.js"],"sourcesContent":["//#region src/utils/env.ts\nfunction getEnvironmentVariable(name) {\n\ttry {\n\t\treturn typeof process !== \"undefined\" ? process.env?.[name] : void 0;\n\t} catch (e) {\n\t\treturn;\n\t}\n}\n\n//#endregion\nexport { getEnvironmentVariable };\n//# sourceMappingURL=env.js.map"],"names":[],"mappings":"AACA,SAAS,uBAAuB,MAAM;AACrC,MAAI;AACH,WAAO,OAAO,YAAY,cAAc,QAAQ,MAAM,IAAI,IAAI;AAAA,EAC/D,SAAS,GAAG;AACX;AAAA,EACD;AACD;","x_google_ignoreList":[0]}
|
package/dist/index.es54.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function mergeSignals(...signals) {
|
|
2
|
+
const nonZeroSignals = signals.filter((signal) => signal != null);
|
|
3
|
+
if (nonZeroSignals.length === 0) return void 0;
|
|
4
|
+
if (nonZeroSignals.length === 1) return nonZeroSignals[0];
|
|
5
|
+
const controller = new AbortController();
|
|
6
|
+
for (const signal of signals) {
|
|
7
|
+
if (signal?.aborted) {
|
|
8
|
+
controller.abort(signal.reason);
|
|
9
|
+
return controller.signal;
|
|
10
|
+
}
|
|
11
|
+
signal?.addEventListener("abort", () => controller.abort(signal.reason), { once: true });
|
|
12
|
+
}
|
|
13
|
+
return controller.signal;
|
|
3
14
|
}
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
mergeSignals
|
|
6
17
|
};
|
|
7
18
|
//# sourceMappingURL=index.es54.js.map
|
package/dist/index.es54.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es54.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.
|
|
1
|
+
{"version":3,"file":"index.es54.js","sources":["../node_modules/.pnpm/@langchain+langgraph-sdk@1.5.3_@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5___react-d_6e8116ad15c37793c6138fe0d58aa04e/node_modules/@langchain/langgraph-sdk/dist/utils/signals.js"],"sourcesContent":["//#region src/utils/signals.ts\nfunction mergeSignals(...signals) {\n\tconst nonZeroSignals = signals.filter((signal) => signal != null);\n\tif (nonZeroSignals.length === 0) return void 0;\n\tif (nonZeroSignals.length === 1) return nonZeroSignals[0];\n\tconst controller = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal?.aborted) {\n\t\t\tcontroller.abort(signal.reason);\n\t\t\treturn controller.signal;\n\t\t}\n\t\tsignal?.addEventListener(\"abort\", () => controller.abort(signal.reason), { once: true });\n\t}\n\treturn controller.signal;\n}\n\n//#endregion\nexport { mergeSignals };\n//# sourceMappingURL=signals.js.map"],"names":[],"mappings":"AACA,SAAS,gBAAgB,SAAS;AACjC,QAAM,iBAAiB,QAAQ,OAAO,CAAC,WAAW,UAAU,IAAI;AAChE,MAAI,eAAe,WAAW,EAAG,QAAO;AACxC,MAAI,eAAe,WAAW,EAAG,QAAO,eAAe,CAAC;AACxD,QAAM,aAAa,IAAI,gBAAe;AACtC,aAAW,UAAU,SAAS;AAC7B,QAAI,QAAQ,SAAS;AACpB,iBAAW,MAAM,OAAO,MAAM;AAC9B,aAAO,WAAW;AAAA,IACnB;AACA,YAAQ,iBAAiB,SAAS,MAAM,WAAW,MAAM,OAAO,MAAM,GAAG,EAAE,MAAM,KAAI,CAAE;AAAA,EACxF;AACA,SAAO,WAAW;AACnB;","x_google_ignoreList":[0]}
|
package/dist/index.es55.js
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (a?.audio !== void 0 || b?.audio !== void 0) output.audio = (a?.audio ?? 0) + (b?.audio ?? 0);
|
|
9
|
-
if (a?.image !== void 0 || b?.image !== void 0) output.image = (a?.image ?? 0) + (b?.image ?? 0);
|
|
10
|
-
if (a?.video !== void 0 || b?.video !== void 0) output.video = (a?.video ?? 0) + (b?.video ?? 0);
|
|
11
|
-
if (a?.document !== void 0 || b?.document !== void 0) output.document = (a?.document ?? 0) + (b?.document ?? 0);
|
|
12
|
-
if (a?.text !== void 0 || b?.text !== void 0) output.text = (a?.text ?? 0) + (b?.text ?? 0);
|
|
13
|
-
return output;
|
|
14
|
-
}
|
|
15
|
-
function mergeInputTokenDetails(a, b) {
|
|
16
|
-
const output = { ...mergeModalitiesTokenDetails(a, b) };
|
|
17
|
-
if (a?.cache_read !== void 0 || b?.cache_read !== void 0) output.cache_read = (a?.cache_read ?? 0) + (b?.cache_read ?? 0);
|
|
18
|
-
if (a?.cache_creation !== void 0 || b?.cache_creation !== void 0) output.cache_creation = (a?.cache_creation ?? 0) + (b?.cache_creation ?? 0);
|
|
19
|
-
return output;
|
|
20
|
-
}
|
|
21
|
-
function mergeOutputTokenDetails(a, b) {
|
|
22
|
-
const output = { ...mergeModalitiesTokenDetails(a, b) };
|
|
23
|
-
if (a?.reasoning !== void 0 || b?.reasoning !== void 0) output.reasoning = (a?.reasoning ?? 0) + (b?.reasoning ?? 0);
|
|
24
|
-
return output;
|
|
25
|
-
}
|
|
26
|
-
function mergeUsageMetadata(a, b) {
|
|
27
|
-
return {
|
|
28
|
-
input_tokens: (a?.input_tokens ?? 0) + (b?.input_tokens ?? 0),
|
|
29
|
-
output_tokens: (a?.output_tokens ?? 0) + (b?.output_tokens ?? 0),
|
|
30
|
-
total_tokens: (a?.total_tokens ?? 0) + (b?.total_tokens ?? 0),
|
|
31
|
-
input_token_details: mergeInputTokenDetails(a?.input_token_details, b?.input_token_details),
|
|
32
|
-
output_token_details: mergeOutputTokenDetails(a?.output_token_details, b?.output_token_details)
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all) __defProp(target, name, {
|
|
4
|
+
get: all[name],
|
|
5
|
+
enumerable: true
|
|
6
|
+
});
|
|
7
|
+
};
|
|
35
8
|
export {
|
|
36
|
-
|
|
37
|
-
mergeUsageMetadata
|
|
9
|
+
__export
|
|
38
10
|
};
|
|
39
11
|
//# sourceMappingURL=index.es55.js.map
|
package/dist/index.es55.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es55.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/
|
|
1
|
+
{"version":3,"file":"index.es55.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/rolldown_runtime.js"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\n\n//#endregion\nexport { __export };"],"names":[],"mappings":"AACA,IAAI,YAAY,OAAO;AACpB,IAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAS,QAAQ,IAAK,WAAU,QAAQ,MAAM;AAAA,IAC7C,KAAK,IAAI,IAAI;AAAA,IACb,YAAY;AAAA,EACd,CAAE;AACF;","x_google_ignoreList":[0]}
|
package/dist/index.es56.js
CHANGED
|
@@ -1,75 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
function isDataContentBlock(content_block) {
|
|
2
|
+
return typeof content_block === "object" && content_block !== null && "type" in content_block && typeof content_block.type === "string" && "source_type" in content_block && (content_block.source_type === "url" || content_block.source_type === "base64" || content_block.source_type === "text" || content_block.source_type === "id");
|
|
3
|
+
}
|
|
4
|
+
function isURLContentBlock(content_block) {
|
|
5
|
+
return isDataContentBlock(content_block) && content_block.source_type === "url" && "url" in content_block && typeof content_block.url === "string";
|
|
6
|
+
}
|
|
7
|
+
function isBase64ContentBlock(content_block) {
|
|
8
|
+
return isDataContentBlock(content_block) && content_block.source_type === "base64" && "data" in content_block && typeof content_block.data === "string";
|
|
9
|
+
}
|
|
10
|
+
function isPlainTextContentBlock(content_block) {
|
|
11
|
+
return isDataContentBlock(content_block) && content_block.source_type === "text" && "text" in content_block && typeof content_block.text === "string";
|
|
12
|
+
}
|
|
13
|
+
function isIDContentBlock(content_block) {
|
|
14
|
+
return isDataContentBlock(content_block) && content_block.source_type === "id" && "id" in content_block && typeof content_block.id === "string";
|
|
15
|
+
}
|
|
16
|
+
function convertToOpenAIImageBlock(content_block) {
|
|
17
|
+
if (isDataContentBlock(content_block)) {
|
|
18
|
+
if (content_block.source_type === "url") return {
|
|
19
|
+
type: "image_url",
|
|
20
|
+
image_url: { url: content_block.url }
|
|
15
21
|
};
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
if (content_block.source_type === "base64") {
|
|
23
|
+
if (!content_block.mime_type) throw new Error("mime_type key is required for base64 data.");
|
|
24
|
+
const mime_type = content_block.mime_type;
|
|
25
|
+
return {
|
|
26
|
+
type: "image_url",
|
|
27
|
+
image_url: { url: `data:${mime_type};base64,${content_block.data}` }
|
|
28
|
+
};
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.");
|
|
32
|
+
}
|
|
33
|
+
function parseMimeType(mime_type) {
|
|
34
|
+
const parts = mime_type.split(";")[0].split("/");
|
|
35
|
+
if (parts.length !== 2) throw new Error(`Invalid mime type: "${mime_type}" - does not match type/subtype format.`);
|
|
36
|
+
const type = parts[0].trim();
|
|
37
|
+
const subtype = parts[1].trim();
|
|
38
|
+
if (type === "" || subtype === "") throw new Error(`Invalid mime type: "${mime_type}" - type or subtype is empty.`);
|
|
39
|
+
const parameters = {};
|
|
40
|
+
for (const parameterKvp of mime_type.split(";").slice(1)) {
|
|
41
|
+
const parameterParts = parameterKvp.split("=");
|
|
42
|
+
if (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
|
|
43
|
+
const key = parameterParts[0].trim();
|
|
44
|
+
const value = parameterParts[1].trim();
|
|
45
|
+
if (key === "") throw new Error(`Invalid parameter syntax in mime type: "${mime_type}".`);
|
|
46
|
+
parameters[key] = value;
|
|
21
47
|
}
|
|
22
|
-
|
|
48
|
+
return {
|
|
49
|
+
type,
|
|
50
|
+
subtype,
|
|
51
|
+
parameters
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {
|
|
55
|
+
const formatMatch = data_url.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);
|
|
56
|
+
let mime_type;
|
|
57
|
+
if (formatMatch) {
|
|
58
|
+
mime_type = formatMatch[1].toLowerCase();
|
|
59
|
+
const data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];
|
|
23
60
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
61
|
+
mime_type,
|
|
62
|
+
data
|
|
26
63
|
};
|
|
27
64
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
role;
|
|
35
|
-
constructor(fields, role) {
|
|
36
|
-
if (typeof fields === "string" || Array.isArray(fields)) fields = {
|
|
37
|
-
content: fields,
|
|
38
|
-
role
|
|
39
|
-
};
|
|
40
|
-
super(fields);
|
|
41
|
-
this.role = fields.role;
|
|
65
|
+
return void 0;
|
|
66
|
+
}
|
|
67
|
+
function convertToProviderContentBlock(block, converter) {
|
|
68
|
+
if (block.type === "text") {
|
|
69
|
+
if (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardTextBlock\` method.`);
|
|
70
|
+
return converter.fromStandardTextBlock(block);
|
|
42
71
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
content: mergeContent(this.content, chunk.content),
|
|
47
|
-
additional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),
|
|
48
|
-
response_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),
|
|
49
|
-
role: this.role,
|
|
50
|
-
id: this.id ?? chunk.id
|
|
51
|
-
});
|
|
72
|
+
if (block.type === "image") {
|
|
73
|
+
if (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardImageBlock\` method.`);
|
|
74
|
+
return converter.fromStandardImageBlock(block);
|
|
52
75
|
}
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
if (block.type === "audio") {
|
|
77
|
+
if (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardAudioBlock\` method.`);
|
|
78
|
+
return converter.fromStandardAudioBlock(block);
|
|
55
79
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
role: this.role
|
|
60
|
-
};
|
|
80
|
+
if (block.type === "file") {
|
|
81
|
+
if (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \`fromStandardFileBlock\` method.`);
|
|
82
|
+
return converter.fromStandardFileBlock(block);
|
|
61
83
|
}
|
|
62
|
-
};
|
|
63
|
-
function isChatMessage(x) {
|
|
64
|
-
return x._getType() === "generic";
|
|
65
|
-
}
|
|
66
|
-
function isChatMessageChunk(x) {
|
|
67
|
-
return x._getType() === "generic";
|
|
84
|
+
throw new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);
|
|
68
85
|
}
|
|
69
86
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
convertToOpenAIImageBlock,
|
|
88
|
+
convertToProviderContentBlock,
|
|
89
|
+
isBase64ContentBlock,
|
|
90
|
+
isDataContentBlock,
|
|
91
|
+
isIDContentBlock,
|
|
92
|
+
isPlainTextContentBlock,
|
|
93
|
+
isURLContentBlock,
|
|
94
|
+
parseBase64DataUrl,
|
|
95
|
+
parseMimeType
|
|
74
96
|
};
|
|
75
97
|
//# sourceMappingURL=index.es56.js.map
|
package/dist/index.es56.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es56.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/
|
|
1
|
+
{"version":3,"file":"index.es56.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.js"],"sourcesContent":["//#region src/messages/content/data.ts\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isDataContentBlock(content_block) {\n\treturn typeof content_block === \"object\" && content_block !== null && \"type\" in content_block && typeof content_block.type === \"string\" && \"source_type\" in content_block && (content_block.source_type === \"url\" || content_block.source_type === \"base64\" || content_block.source_type === \"text\" || content_block.source_type === \"id\");\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isURLContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"url\" && \"url\" in content_block && typeof content_block.url === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isBase64ContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"base64\" && \"data\" in content_block && typeof content_block.data === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isPlainTextContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"text\" && \"text\" in content_block && typeof content_block.text === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction isIDContentBlock(content_block) {\n\treturn isDataContentBlock(content_block) && content_block.source_type === \"id\" && \"id\" in content_block && typeof content_block.id === \"string\";\n}\n/**\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToOpenAIImageBlock(content_block) {\n\tif (isDataContentBlock(content_block)) {\n\t\tif (content_block.source_type === \"url\") return {\n\t\t\ttype: \"image_url\",\n\t\t\timage_url: { url: content_block.url }\n\t\t};\n\t\tif (content_block.source_type === \"base64\") {\n\t\t\tif (!content_block.mime_type) throw new Error(\"mime_type key is required for base64 data.\");\n\t\t\tconst mime_type = content_block.mime_type;\n\t\t\treturn {\n\t\t\t\ttype: \"image_url\",\n\t\t\t\timage_url: { url: `data:${mime_type};base64,${content_block.data}` }\n\t\t\t};\n\t\t}\n\t}\n\tthrow new Error(\"Unsupported source type. Only 'url' and 'base64' are supported.\");\n}\n/**\n* Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n*\n* @param mime_type - The mime type to parse.\n* @returns An object containing the type, subtype, and parameters.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseMimeType(mime_type) {\n\tconst parts = mime_type.split(\";\")[0].split(\"/\");\n\tif (parts.length !== 2) throw new Error(`Invalid mime type: \"${mime_type}\" - does not match type/subtype format.`);\n\tconst type = parts[0].trim();\n\tconst subtype = parts[1].trim();\n\tif (type === \"\" || subtype === \"\") throw new Error(`Invalid mime type: \"${mime_type}\" - type or subtype is empty.`);\n\tconst parameters = {};\n\tfor (const parameterKvp of mime_type.split(\";\").slice(1)) {\n\t\tconst parameterParts = parameterKvp.split(\"=\");\n\t\tif (parameterParts.length !== 2) throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tconst key = parameterParts[0].trim();\n\t\tconst value = parameterParts[1].trim();\n\t\tif (key === \"\") throw new Error(`Invalid parameter syntax in mime type: \"${mime_type}\".`);\n\t\tparameters[key] = value;\n\t}\n\treturn {\n\t\ttype,\n\t\tsubtype,\n\t\tparameters\n\t};\n}\n/**\n* Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n*\n* @param dataUrl - The base64 data URL to parse.\n* @param asTypedArray - Whether to return the data as a typed array.\n* @returns The parsed data and mime type, or undefined if the data URL is invalid.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction parseBase64DataUrl({ dataUrl: data_url, asTypedArray = false }) {\n\tconst formatMatch = data_url.match(/^data:(\\w+\\/\\w+);base64,([A-Za-z0-9+/]+=*)$/);\n\tlet mime_type;\n\tif (formatMatch) {\n\t\tmime_type = formatMatch[1].toLowerCase();\n\t\tconst data = asTypedArray ? Uint8Array.from(atob(formatMatch[2]), (c) => c.charCodeAt(0)) : formatMatch[2];\n\t\treturn {\n\t\t\tmime_type,\n\t\t\tdata\n\t\t};\n\t}\n\treturn void 0;\n}\n/**\n* Convert from a standard data content block to a provider's proprietary data content block format.\n*\n* Don't override this method. Instead, override the more specific conversion methods and use this\n* method unmodified.\n*\n* @param block - The standard data content block to convert.\n* @returns The provider data content block.\n* @throws An error if the standard data content block type is not supported.\n*\n* @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n*/\nfunction convertToProviderContentBlock(block, converter) {\n\tif (block.type === \"text\") {\n\t\tif (!converter.fromStandardTextBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardTextBlock\\` method.`);\n\t\treturn converter.fromStandardTextBlock(block);\n\t}\n\tif (block.type === \"image\") {\n\t\tif (!converter.fromStandardImageBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardImageBlock\\` method.`);\n\t\treturn converter.fromStandardImageBlock(block);\n\t}\n\tif (block.type === \"audio\") {\n\t\tif (!converter.fromStandardAudioBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardAudioBlock\\` method.`);\n\t\treturn converter.fromStandardAudioBlock(block);\n\t}\n\tif (block.type === \"file\") {\n\t\tif (!converter.fromStandardFileBlock) throw new Error(`Converter for ${converter.providerName} does not implement \\`fromStandardFileBlock\\` method.`);\n\t\treturn converter.fromStandardFileBlock(block);\n\t}\n\tthrow new Error(`Unable to convert content block type '${block.type}' to provider-specific format: not recognized.`);\n}\n\n//#endregion\nexport { convertToOpenAIImageBlock, convertToProviderContentBlock, isBase64ContentBlock, isDataContentBlock, isIDContentBlock, isPlainTextContentBlock, isURLContentBlock, parseBase64DataUrl, parseMimeType };\n//# sourceMappingURL=data.js.map"],"names":[],"mappings":"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","x_google_ignoreList":[0]}
|
package/dist/index.es57.js
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
static lc_name() {
|
|
4
|
-
return "FunctionMessage";
|
|
5
|
-
}
|
|
6
|
-
type = "function";
|
|
7
|
-
name;
|
|
8
|
-
constructor(fields) {
|
|
9
|
-
super(fields);
|
|
10
|
-
this.name = fields.name;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
var FunctionMessageChunk = class extends BaseMessageChunk {
|
|
14
|
-
static lc_name() {
|
|
15
|
-
return "FunctionMessageChunk";
|
|
16
|
-
}
|
|
17
|
-
type = "function";
|
|
18
|
-
concat(chunk) {
|
|
19
|
-
const Cls = this.constructor;
|
|
20
|
-
return new Cls({
|
|
21
|
-
content: mergeContent(this.content, chunk.content),
|
|
22
|
-
additional_kwargs: _mergeDicts(this.additional_kwargs, chunk.additional_kwargs),
|
|
23
|
-
response_metadata: _mergeDicts(this.response_metadata, chunk.response_metadata),
|
|
24
|
-
name: this.name ?? "",
|
|
25
|
-
id: this.id ?? chunk.id
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
function isFunctionMessage(x) {
|
|
30
|
-
return x._getType() === "function";
|
|
31
|
-
}
|
|
32
|
-
function isFunctionMessageChunk(x) {
|
|
33
|
-
return x._getType() === "function";
|
|
1
|
+
function isMessage(message) {
|
|
2
|
+
return typeof message === "object" && message !== null && "type" in message && "content" in message && (typeof message.content === "string" || Array.isArray(message.content));
|
|
34
3
|
}
|
|
35
4
|
export {
|
|
36
|
-
|
|
37
|
-
FunctionMessageChunk,
|
|
38
|
-
isFunctionMessage,
|
|
39
|
-
isFunctionMessageChunk
|
|
5
|
+
isMessage
|
|
40
6
|
};
|
|
41
7
|
//# sourceMappingURL=index.es57.js.map
|
package/dist/index.es57.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es57.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/
|
|
1
|
+
{"version":3,"file":"index.es57.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/message.js"],"sourcesContent":["//#region src/messages/message.ts\n/**\n* Type guard to check if a value is a valid Message object.\n*\n* @param message - The value to check\n* @returns true if the value is a valid Message object, false otherwise\n*/\nfunction isMessage(message) {\n\treturn typeof message === \"object\" && message !== null && \"type\" in message && \"content\" in message && (typeof message.content === \"string\" || Array.isArray(message.content));\n}\n\n//#endregion\nexport { isMessage };\n//# sourceMappingURL=message.js.map"],"names":[],"mappings":"AAOA,SAAS,UAAU,SAAS;AAC3B,SAAO,OAAO,YAAY,YAAY,YAAY,QAAQ,UAAU,WAAW,aAAa,YAAY,OAAO,QAAQ,YAAY,YAAY,MAAM,QAAQ,QAAQ,OAAO;AAC7K;","x_google_ignoreList":[0]}
|