langgraph-ui-components 0.0.7 → 0.0.8
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.es100.js +25 -157
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +3130 -176
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +36 -13
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +5 -30
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +69 -30
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +28 -3148
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +5 -16
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +2 -7
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +13 -2
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +499 -9
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es11.js +2 -2
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es110.js +5 -501
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +2 -7
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +148 -2
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +878 -118
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +251 -877
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +3 -281
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +445 -3
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +39 -437
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +22 -46
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +78 -21
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es120.js +126 -76
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +45 -125
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +9 -48
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +45 -10
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +97 -43
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +48 -94
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +14 -51
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +13 -162
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +89 -2
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +2 -15
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es130.js +54 -87
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +100 -2
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +186 -51
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +97 -87
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +31 -187
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +10 -110
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +11 -35
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +12 -10
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +90 -10
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +274 -11
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es140.js +2 -91
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +150 -261
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +51 -2
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +34 -158
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +34 -50
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +32 -32
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +23 -34
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +583 -32
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +121 -20
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +158 -585
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +15 -15
- package/dist/index.es150.js +2 -125
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es157.js +2 -2
- package/dist/index.es159.js +2 -2
- package/dist/index.es161.js +64 -25
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +22 -12
- package/dist/index.es162.js.map +1 -1
- package/dist/index.es163.js +5 -53
- package/dist/index.es163.js.map +1 -1
- package/dist/index.es164.js +337 -52
- package/dist/index.es164.js.map +1 -1
- package/dist/index.es165.js +24 -21
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +12 -6
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +49 -344
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es175.js +1 -1
- package/dist/index.es178.js +1 -1
- package/dist/index.es183.js +1 -1
- package/dist/index.es195.js +2 -2
- package/dist/index.es197.js +2 -2
- package/dist/index.es200.js +1 -1
- package/dist/index.es201.js +1 -1
- package/dist/index.es203.js +1 -1
- package/dist/index.es204.js +2 -2
- package/dist/index.es206.js +1 -1
- package/dist/index.es209.js +3 -3
- package/dist/index.es21.js +1 -1
- package/dist/index.es210.js +2 -2
- package/dist/index.es212.js +1 -1
- package/dist/index.es214.js +1 -1
- package/dist/index.es215.js +1 -1
- package/dist/index.es217.js +1 -1
- package/dist/index.es218.js +2 -2
- package/dist/index.es219.js +1 -1
- package/dist/index.es220.js +1 -1
- package/dist/index.es221.js +1 -1
- package/dist/index.es222.js +1 -1
- package/dist/index.es223.js +1 -1
- package/dist/index.es224.js +1 -1
- package/dist/index.es225.js +1 -1
- package/dist/index.es229.js +2 -2
- package/dist/index.es28.js +7 -7
- package/dist/index.es29.js +1 -1
- package/dist/index.es32.js +4 -4
- package/dist/index.es33.js +15 -1191
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +117 -6
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +70 -8
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +19 -148
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +255 -112
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +40 -68
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +214 -17
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +53 -247
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +123 -24
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +14 -205
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +221 -58
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +7 -140
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +1185 -17
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +6 -229
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +146 -15
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es49.js +7 -90
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es50.js +92 -6
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +3 -14
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +36 -8
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +61 -83
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +37 -3
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +304 -34
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +9 -72
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +85 -32
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +6 -304
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +15 -9
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +142 -5
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +285 -148
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +62 -668
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +201 -131
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +29 -295
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +8 -65
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +9 -210
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +181 -28
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +23 -8
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +1397 -9
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +9 -187
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +8 -24
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +5 -1399
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +163 -9
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +672 -8
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +11 -36
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +40 -5
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +32 -71
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +225 -30
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +29 -11
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +72 -37
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +74 -32
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +46 -226
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +6 -6
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +39 -71
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +54 -73
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +13 -52
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +135 -28
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +20 -42
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +175 -50
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +240 -12
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +348 -130
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +134 -18
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +62 -174
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +30 -234
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +26 -344
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +156 -127
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +196 -63
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +14 -37
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +27 -34
- package/dist/index.es99.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es89.js
CHANGED
|
@@ -1,60 +1,185 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import "./index.
|
|
5
|
-
import "./index.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { __export } from "./index.es49.js";
|
|
2
|
+
import { AsyncLocalStorageProviderSingleton } from "./index.es85.js";
|
|
3
|
+
import "./index.es86.js";
|
|
4
|
+
import { pickRunnableConfigKeys } from "./index.es87.js";
|
|
5
|
+
import { raceWithSignal } from "./index.es88.js";
|
|
6
|
+
var stream_exports = {};
|
|
7
|
+
__export(stream_exports, {
|
|
8
|
+
AsyncGeneratorWithSetup: () => AsyncGeneratorWithSetup,
|
|
9
|
+
IterableReadableStream: () => IterableReadableStream,
|
|
10
|
+
atee: () => atee,
|
|
11
|
+
concat: () => concat,
|
|
12
|
+
pipeGeneratorWithSetup: () => pipeGeneratorWithSetup
|
|
13
|
+
});
|
|
14
|
+
var IterableReadableStream = class IterableReadableStream2 extends ReadableStream {
|
|
15
|
+
reader;
|
|
16
|
+
ensureReader() {
|
|
17
|
+
if (!this.reader) this.reader = this.getReader();
|
|
18
|
+
}
|
|
19
|
+
async next() {
|
|
20
|
+
this.ensureReader();
|
|
21
|
+
try {
|
|
22
|
+
const result = await this.reader.read();
|
|
23
|
+
if (result.done) {
|
|
24
|
+
this.reader.releaseLock();
|
|
25
|
+
return {
|
|
26
|
+
done: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
};
|
|
29
|
+
} else return {
|
|
30
|
+
done: false,
|
|
31
|
+
value: result.value
|
|
32
|
+
};
|
|
33
|
+
} catch (e) {
|
|
34
|
+
this.reader.releaseLock();
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async return() {
|
|
39
|
+
this.ensureReader();
|
|
40
|
+
if (this.locked) {
|
|
41
|
+
const cancelPromise = this.reader.cancel();
|
|
42
|
+
this.reader.releaseLock();
|
|
43
|
+
await cancelPromise;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
done: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async throw(e) {
|
|
51
|
+
this.ensureReader();
|
|
52
|
+
if (this.locked) {
|
|
53
|
+
const cancelPromise = this.reader.cancel();
|
|
54
|
+
this.reader.releaseLock();
|
|
55
|
+
await cancelPromise;
|
|
56
|
+
}
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
[Symbol.asyncIterator]() {
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
async [Symbol.asyncDispose]() {
|
|
63
|
+
await this.return();
|
|
64
|
+
}
|
|
65
|
+
static fromReadableStream(stream) {
|
|
66
|
+
const reader = stream.getReader();
|
|
67
|
+
return new IterableReadableStream2({
|
|
68
|
+
start(controller) {
|
|
69
|
+
return pump();
|
|
70
|
+
function pump() {
|
|
71
|
+
return reader.read().then(({ done, value }) => {
|
|
72
|
+
if (done) {
|
|
73
|
+
controller.close();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
controller.enqueue(value);
|
|
77
|
+
return pump();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
cancel() {
|
|
82
|
+
reader.releaseLock();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static fromAsyncGenerator(generator) {
|
|
87
|
+
return new IterableReadableStream2({
|
|
88
|
+
async pull(controller) {
|
|
89
|
+
const { value, done } = await generator.next();
|
|
90
|
+
if (done) controller.close();
|
|
91
|
+
controller.enqueue(value);
|
|
92
|
+
},
|
|
93
|
+
async cancel(reason) {
|
|
94
|
+
await generator.return(reason);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
17
97
|
}
|
|
18
98
|
};
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
else
|
|
38
|
-
|
|
39
|
-
|
|
99
|
+
function atee(iter, length = 2) {
|
|
100
|
+
const buffers = Array.from({ length }, () => []);
|
|
101
|
+
return buffers.map(async function* makeIter(buffer) {
|
|
102
|
+
while (true) if (buffer.length === 0) {
|
|
103
|
+
const result = await iter.next();
|
|
104
|
+
for (const buffer$1 of buffers) buffer$1.push(result);
|
|
105
|
+
} else if (buffer[0].done) return;
|
|
106
|
+
else yield buffer.shift().value;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function concat(first, second) {
|
|
110
|
+
if (Array.isArray(first) && Array.isArray(second)) return first.concat(second);
|
|
111
|
+
else if (typeof first === "string" && typeof second === "string") return first + second;
|
|
112
|
+
else if (typeof first === "number" && typeof second === "number") return first + second;
|
|
113
|
+
else if ("concat" in first && typeof first.concat === "function") return first.concat(second);
|
|
114
|
+
else if (typeof first === "object" && typeof second === "object") {
|
|
115
|
+
const chunk = { ...first };
|
|
116
|
+
for (const [key, value] of Object.entries(second)) if (key in chunk && !Array.isArray(chunk[key])) chunk[key] = concat(chunk[key], value);
|
|
117
|
+
else chunk[key] = value;
|
|
118
|
+
return chunk;
|
|
119
|
+
} else throw new Error(`Cannot concat ${typeof first} and ${typeof second}`);
|
|
120
|
+
}
|
|
121
|
+
var AsyncGeneratorWithSetup = class {
|
|
122
|
+
generator;
|
|
123
|
+
setup;
|
|
124
|
+
config;
|
|
125
|
+
signal;
|
|
126
|
+
firstResult;
|
|
127
|
+
firstResultUsed = false;
|
|
128
|
+
constructor(params) {
|
|
129
|
+
this.generator = params.generator;
|
|
130
|
+
this.config = params.config;
|
|
131
|
+
this.signal = params.signal ?? this.config?.signal;
|
|
132
|
+
this.setup = new Promise((resolve, reject) => {
|
|
133
|
+
AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(params.config), async () => {
|
|
134
|
+
this.firstResult = params.generator.next();
|
|
135
|
+
if (params.startSetup) this.firstResult.then(params.startSetup).then(resolve, reject);
|
|
136
|
+
else this.firstResult.then((_result) => resolve(void 0), reject);
|
|
137
|
+
}, true);
|
|
40
138
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
runTree[_CONTEXT_VARIABLES_KEY] = previousValue[_CONTEXT_VARIABLES_KEY];
|
|
139
|
+
}
|
|
140
|
+
async next(...args) {
|
|
141
|
+
this.signal?.throwIfAborted();
|
|
142
|
+
if (!this.firstResultUsed) {
|
|
143
|
+
this.firstResultUsed = true;
|
|
144
|
+
return this.firstResult;
|
|
48
145
|
}
|
|
49
|
-
return
|
|
146
|
+
return AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(this.config), this.signal ? async () => {
|
|
147
|
+
return raceWithSignal(this.generator.next(...args), this.signal);
|
|
148
|
+
} : async () => {
|
|
149
|
+
return this.generator.next(...args);
|
|
150
|
+
}, true);
|
|
151
|
+
}
|
|
152
|
+
async return(value) {
|
|
153
|
+
return this.generator.return(value);
|
|
154
|
+
}
|
|
155
|
+
async throw(e) {
|
|
156
|
+
return this.generator.throw(e);
|
|
157
|
+
}
|
|
158
|
+
[Symbol.asyncIterator]() {
|
|
159
|
+
return this;
|
|
50
160
|
}
|
|
51
|
-
|
|
52
|
-
|
|
161
|
+
async [Symbol.asyncDispose]() {
|
|
162
|
+
await this.return();
|
|
53
163
|
}
|
|
54
164
|
};
|
|
55
|
-
|
|
165
|
+
async function pipeGeneratorWithSetup(to, generator, startSetup, signal, ...args) {
|
|
166
|
+
const gen = new AsyncGeneratorWithSetup({
|
|
167
|
+
generator,
|
|
168
|
+
startSetup,
|
|
169
|
+
signal
|
|
170
|
+
});
|
|
171
|
+
const setup = await gen.setup;
|
|
172
|
+
return {
|
|
173
|
+
output: to(gen, setup, ...args),
|
|
174
|
+
setup
|
|
175
|
+
};
|
|
176
|
+
}
|
|
56
177
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
178
|
+
AsyncGeneratorWithSetup,
|
|
179
|
+
IterableReadableStream,
|
|
180
|
+
atee,
|
|
181
|
+
concat,
|
|
182
|
+
pipeGeneratorWithSetup,
|
|
183
|
+
stream_exports
|
|
59
184
|
};
|
|
60
185
|
//# sourceMappingURL=index.es89.js.map
|
package/dist/index.es89.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es89.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.es89.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/stream.js"],"sourcesContent":["import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { AsyncLocalStorageProviderSingleton } from \"../singletons/async_local_storage/index.js\";\nimport \"../singletons/index.js\";\nimport { pickRunnableConfigKeys } from \"../runnables/config.js\";\nimport { raceWithSignal } from \"./signal.js\";\n\n//#region src/utils/stream.ts\nvar stream_exports = {};\n__export(stream_exports, {\n\tAsyncGeneratorWithSetup: () => AsyncGeneratorWithSetup,\n\tIterableReadableStream: () => IterableReadableStream,\n\tatee: () => atee,\n\tconcat: () => concat,\n\tpipeGeneratorWithSetup: () => pipeGeneratorWithSetup\n});\nvar IterableReadableStream = class IterableReadableStream extends ReadableStream {\n\treader;\n\tensureReader() {\n\t\tif (!this.reader) this.reader = this.getReader();\n\t}\n\tasync next() {\n\t\tthis.ensureReader();\n\t\ttry {\n\t\t\tconst result = await this.reader.read();\n\t\t\tif (result.done) {\n\t\t\t\tthis.reader.releaseLock();\n\t\t\t\treturn {\n\t\t\t\t\tdone: true,\n\t\t\t\t\tvalue: void 0\n\t\t\t\t};\n\t\t\t} else return {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: result.value\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tthis.reader.releaseLock();\n\t\t\tthrow e;\n\t\t}\n\t}\n\tasync return() {\n\t\tthis.ensureReader();\n\t\tif (this.locked) {\n\t\t\tconst cancelPromise = this.reader.cancel();\n\t\t\tthis.reader.releaseLock();\n\t\t\tawait cancelPromise;\n\t\t}\n\t\treturn {\n\t\t\tdone: true,\n\t\t\tvalue: void 0\n\t\t};\n\t}\n\tasync throw(e) {\n\t\tthis.ensureReader();\n\t\tif (this.locked) {\n\t\t\tconst cancelPromise = this.reader.cancel();\n\t\t\tthis.reader.releaseLock();\n\t\t\tawait cancelPromise;\n\t\t}\n\t\tthrow e;\n\t}\n\t[Symbol.asyncIterator]() {\n\t\treturn this;\n\t}\n\tasync [Symbol.asyncDispose]() {\n\t\tawait this.return();\n\t}\n\tstatic fromReadableStream(stream) {\n\t\tconst reader = stream.getReader();\n\t\treturn new IterableReadableStream({\n\t\t\tstart(controller) {\n\t\t\t\treturn pump();\n\t\t\t\tfunction pump() {\n\t\t\t\t\treturn reader.read().then(({ done, value }) => {\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue(value);\n\t\t\t\t\t\treturn pump();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tcancel() {\n\t\t\t\treader.releaseLock();\n\t\t\t}\n\t\t});\n\t}\n\tstatic fromAsyncGenerator(generator) {\n\t\treturn new IterableReadableStream({\n\t\t\tasync pull(controller) {\n\t\t\t\tconst { value, done } = await generator.next();\n\t\t\t\tif (done) controller.close();\n\t\t\t\tcontroller.enqueue(value);\n\t\t\t},\n\t\t\tasync cancel(reason) {\n\t\t\t\tawait generator.return(reason);\n\t\t\t}\n\t\t});\n\t}\n};\nfunction atee(iter, length = 2) {\n\tconst buffers = Array.from({ length }, () => []);\n\treturn buffers.map(async function* makeIter(buffer) {\n\t\twhile (true) if (buffer.length === 0) {\n\t\t\tconst result = await iter.next();\n\t\t\tfor (const buffer$1 of buffers) buffer$1.push(result);\n\t\t} else if (buffer[0].done) return;\n\t\telse yield buffer.shift().value;\n\t});\n}\nfunction concat(first, second) {\n\tif (Array.isArray(first) && Array.isArray(second)) return first.concat(second);\n\telse if (typeof first === \"string\" && typeof second === \"string\") return first + second;\n\telse if (typeof first === \"number\" && typeof second === \"number\") return first + second;\n\telse if (\"concat\" in first && typeof first.concat === \"function\") return first.concat(second);\n\telse if (typeof first === \"object\" && typeof second === \"object\") {\n\t\tconst chunk = { ...first };\n\t\tfor (const [key, value] of Object.entries(second)) if (key in chunk && !Array.isArray(chunk[key])) chunk[key] = concat(chunk[key], value);\n\t\telse chunk[key] = value;\n\t\treturn chunk;\n\t} else throw new Error(`Cannot concat ${typeof first} and ${typeof second}`);\n}\nvar AsyncGeneratorWithSetup = class {\n\tgenerator;\n\tsetup;\n\tconfig;\n\tsignal;\n\tfirstResult;\n\tfirstResultUsed = false;\n\tconstructor(params) {\n\t\tthis.generator = params.generator;\n\t\tthis.config = params.config;\n\t\tthis.signal = params.signal ?? this.config?.signal;\n\t\tthis.setup = new Promise((resolve, reject) => {\n\t\t\tAsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(params.config), async () => {\n\t\t\t\tthis.firstResult = params.generator.next();\n\t\t\t\tif (params.startSetup) this.firstResult.then(params.startSetup).then(resolve, reject);\n\t\t\t\telse this.firstResult.then((_result) => resolve(void 0), reject);\n\t\t\t}, true);\n\t\t});\n\t}\n\tasync next(...args) {\n\t\tthis.signal?.throwIfAborted();\n\t\tif (!this.firstResultUsed) {\n\t\t\tthis.firstResultUsed = true;\n\t\t\treturn this.firstResult;\n\t\t}\n\t\treturn AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(this.config), this.signal ? async () => {\n\t\t\treturn raceWithSignal(this.generator.next(...args), this.signal);\n\t\t} : async () => {\n\t\t\treturn this.generator.next(...args);\n\t\t}, true);\n\t}\n\tasync return(value) {\n\t\treturn this.generator.return(value);\n\t}\n\tasync throw(e) {\n\t\treturn this.generator.throw(e);\n\t}\n\t[Symbol.asyncIterator]() {\n\t\treturn this;\n\t}\n\tasync [Symbol.asyncDispose]() {\n\t\tawait this.return();\n\t}\n};\nasync function pipeGeneratorWithSetup(to, generator, startSetup, signal, ...args) {\n\tconst gen = new AsyncGeneratorWithSetup({\n\t\tgenerator,\n\t\tstartSetup,\n\t\tsignal\n\t});\n\tconst setup = await gen.setup;\n\treturn {\n\t\toutput: to(gen, setup, ...args),\n\t\tsetup\n\t};\n}\n\n//#endregion\nexport { AsyncGeneratorWithSetup, IterableReadableStream, atee, concat, pipeGeneratorWithSetup, stream_exports };\n//# sourceMappingURL=stream.js.map"],"names":["IterableReadableStream"],"mappings":";;;;;AAOG,IAAC,iBAAiB,CAAA;AACrB,SAAS,gBAAgB;AAAA,EACxB,yBAAyB,MAAM;AAAA,EAC/B,wBAAwB,MAAM;AAAA,EAC9B,MAAM,MAAM;AAAA,EACZ,QAAQ,MAAM;AAAA,EACd,wBAAwB,MAAM;AAC/B,CAAC;AACE,IAAC,yB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AAG,IAAI;AAAA,IACnC,GAAG,IAAI;AAAA,EACR;AAAA,EACA,MAAM,OAAO,OAAO;AACnB,WAAO,KAAK,UAAU,OAAO,KAAK;AAAA,EACnC;AAAA,EACA,MAAM,MAAM,GAAG;AACd,WAAO,KAAK,UAAU,MAAM,CAAC;AAAA,EAC9B;AAAA,EACA,CAAC,OAAO,aAAa,IAAI;AACxB,WAAO;AAAA,EACR;AAAA,EACA,OAAO,OAAO,YAAY,IAAI;AAC7B,UAAM,KAAK,OAAM;AAAA,EAClB;AACD;AACA,eAAe,uBAAuB,IAAI,WAAW,YAAY,WAAW,MAAM;AACjF,QAAM,MAAM,IAAI,wBAAwB;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAE;AACD,QAAM,QAAQ,MAAM,IAAI;AACxB,SAAO;AAAA,IACN,QAAQ,GAAG,KAAK,OAAO,GAAG,IAAI;AAAA,IAC9B;AAAA,EACF;AACA;","x_google_ignoreList":[0]}
|
package/dist/index.es90.js
CHANGED
|
@@ -1,16 +1,244 @@
|
|
|
1
|
-
import { __export } from "./index.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { __export } from "./index.es49.js";
|
|
2
|
+
import { AIMessageChunk } from "./index.es39.js";
|
|
3
|
+
import { applyPatch } from "./index.es114.js";
|
|
4
|
+
import "./index.es115.js";
|
|
5
|
+
import { BaseTracer } from "./index.es116.js";
|
|
6
|
+
import { IterableReadableStream } from "./index.es89.js";
|
|
7
|
+
var log_stream_exports = {};
|
|
8
|
+
__export(log_stream_exports, {
|
|
9
|
+
LogStreamCallbackHandler: () => LogStreamCallbackHandler,
|
|
10
|
+
RunLog: () => RunLog,
|
|
11
|
+
RunLogPatch: () => RunLogPatch,
|
|
12
|
+
isLogStreamHandler: () => isLogStreamHandler
|
|
9
13
|
});
|
|
14
|
+
var RunLogPatch = class {
|
|
15
|
+
ops;
|
|
16
|
+
constructor(fields) {
|
|
17
|
+
this.ops = fields.ops ?? [];
|
|
18
|
+
}
|
|
19
|
+
concat(other) {
|
|
20
|
+
const ops = this.ops.concat(other.ops);
|
|
21
|
+
const states = applyPatch({}, ops);
|
|
22
|
+
return new RunLog({
|
|
23
|
+
ops,
|
|
24
|
+
state: states[states.length - 1].newDocument
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var RunLog = class RunLog2 extends RunLogPatch {
|
|
29
|
+
state;
|
|
30
|
+
constructor(fields) {
|
|
31
|
+
super(fields);
|
|
32
|
+
this.state = fields.state;
|
|
33
|
+
}
|
|
34
|
+
concat(other) {
|
|
35
|
+
const ops = this.ops.concat(other.ops);
|
|
36
|
+
const states = applyPatch(this.state, other.ops);
|
|
37
|
+
return new RunLog2({
|
|
38
|
+
ops,
|
|
39
|
+
state: states[states.length - 1].newDocument
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
static fromRunLogPatch(patch) {
|
|
43
|
+
const states = applyPatch({}, patch.ops);
|
|
44
|
+
return new RunLog2({
|
|
45
|
+
ops: patch.ops,
|
|
46
|
+
state: states[states.length - 1].newDocument
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const isLogStreamHandler = (handler) => handler.name === "log_stream_tracer";
|
|
51
|
+
async function _getStandardizedInputs(run, schemaFormat) {
|
|
52
|
+
if (schemaFormat === "original") throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");
|
|
53
|
+
const { inputs } = run;
|
|
54
|
+
if ([
|
|
55
|
+
"retriever",
|
|
56
|
+
"llm",
|
|
57
|
+
"prompt"
|
|
58
|
+
].includes(run.run_type)) return inputs;
|
|
59
|
+
if (Object.keys(inputs).length === 1 && inputs?.input === "") return void 0;
|
|
60
|
+
return inputs.input;
|
|
61
|
+
}
|
|
62
|
+
async function _getStandardizedOutputs(run, schemaFormat) {
|
|
63
|
+
const { outputs } = run;
|
|
64
|
+
if (schemaFormat === "original") return outputs;
|
|
65
|
+
if ([
|
|
66
|
+
"retriever",
|
|
67
|
+
"llm",
|
|
68
|
+
"prompt"
|
|
69
|
+
].includes(run.run_type)) return outputs;
|
|
70
|
+
if (outputs !== void 0 && Object.keys(outputs).length === 1 && outputs?.output !== void 0) return outputs.output;
|
|
71
|
+
return outputs;
|
|
72
|
+
}
|
|
73
|
+
function isChatGenerationChunk(x) {
|
|
74
|
+
return x !== void 0 && x.message !== void 0;
|
|
75
|
+
}
|
|
76
|
+
var LogStreamCallbackHandler = class extends BaseTracer {
|
|
77
|
+
autoClose = true;
|
|
78
|
+
includeNames;
|
|
79
|
+
includeTypes;
|
|
80
|
+
includeTags;
|
|
81
|
+
excludeNames;
|
|
82
|
+
excludeTypes;
|
|
83
|
+
excludeTags;
|
|
84
|
+
_schemaFormat = "original";
|
|
85
|
+
rootId;
|
|
86
|
+
keyMapByRunId = {};
|
|
87
|
+
counterMapByRunName = {};
|
|
88
|
+
transformStream;
|
|
89
|
+
writer;
|
|
90
|
+
receiveStream;
|
|
91
|
+
name = "log_stream_tracer";
|
|
92
|
+
lc_prefer_streaming = true;
|
|
93
|
+
constructor(fields) {
|
|
94
|
+
super({
|
|
95
|
+
_awaitHandler: true,
|
|
96
|
+
...fields
|
|
97
|
+
});
|
|
98
|
+
this.autoClose = fields?.autoClose ?? true;
|
|
99
|
+
this.includeNames = fields?.includeNames;
|
|
100
|
+
this.includeTypes = fields?.includeTypes;
|
|
101
|
+
this.includeTags = fields?.includeTags;
|
|
102
|
+
this.excludeNames = fields?.excludeNames;
|
|
103
|
+
this.excludeTypes = fields?.excludeTypes;
|
|
104
|
+
this.excludeTags = fields?.excludeTags;
|
|
105
|
+
this._schemaFormat = fields?._schemaFormat ?? this._schemaFormat;
|
|
106
|
+
this.transformStream = new TransformStream();
|
|
107
|
+
this.writer = this.transformStream.writable.getWriter();
|
|
108
|
+
this.receiveStream = IterableReadableStream.fromReadableStream(this.transformStream.readable);
|
|
109
|
+
}
|
|
110
|
+
[Symbol.asyncIterator]() {
|
|
111
|
+
return this.receiveStream;
|
|
112
|
+
}
|
|
113
|
+
async persistRun(_run) {
|
|
114
|
+
}
|
|
115
|
+
_includeRun(run) {
|
|
116
|
+
if (run.id === this.rootId) return false;
|
|
117
|
+
const runTags = run.tags ?? [];
|
|
118
|
+
let include = this.includeNames === void 0 && this.includeTags === void 0 && this.includeTypes === void 0;
|
|
119
|
+
if (this.includeNames !== void 0) include = include || this.includeNames.includes(run.name);
|
|
120
|
+
if (this.includeTypes !== void 0) include = include || this.includeTypes.includes(run.run_type);
|
|
121
|
+
if (this.includeTags !== void 0) include = include || runTags.find((tag) => this.includeTags?.includes(tag)) !== void 0;
|
|
122
|
+
if (this.excludeNames !== void 0) include = include && !this.excludeNames.includes(run.name);
|
|
123
|
+
if (this.excludeTypes !== void 0) include = include && !this.excludeTypes.includes(run.run_type);
|
|
124
|
+
if (this.excludeTags !== void 0) include = include && runTags.every((tag) => !this.excludeTags?.includes(tag));
|
|
125
|
+
return include;
|
|
126
|
+
}
|
|
127
|
+
async *tapOutputIterable(runId, output) {
|
|
128
|
+
for await (const chunk of output) {
|
|
129
|
+
if (runId !== this.rootId) {
|
|
130
|
+
const key = this.keyMapByRunId[runId];
|
|
131
|
+
if (key) await this.writer.write(new RunLogPatch({ ops: [{
|
|
132
|
+
op: "add",
|
|
133
|
+
path: `/logs/${key}/streamed_output/-`,
|
|
134
|
+
value: chunk
|
|
135
|
+
}] }));
|
|
136
|
+
}
|
|
137
|
+
yield chunk;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async onRunCreate(run) {
|
|
141
|
+
if (this.rootId === void 0) {
|
|
142
|
+
this.rootId = run.id;
|
|
143
|
+
await this.writer.write(new RunLogPatch({ ops: [{
|
|
144
|
+
op: "replace",
|
|
145
|
+
path: "",
|
|
146
|
+
value: {
|
|
147
|
+
id: run.id,
|
|
148
|
+
name: run.name,
|
|
149
|
+
type: run.run_type,
|
|
150
|
+
streamed_output: [],
|
|
151
|
+
final_output: void 0,
|
|
152
|
+
logs: {}
|
|
153
|
+
}
|
|
154
|
+
}] }));
|
|
155
|
+
}
|
|
156
|
+
if (!this._includeRun(run)) return;
|
|
157
|
+
if (this.counterMapByRunName[run.name] === void 0) this.counterMapByRunName[run.name] = 0;
|
|
158
|
+
this.counterMapByRunName[run.name] += 1;
|
|
159
|
+
const count = this.counterMapByRunName[run.name];
|
|
160
|
+
this.keyMapByRunId[run.id] = count === 1 ? run.name : `${run.name}:${count}`;
|
|
161
|
+
const logEntry = {
|
|
162
|
+
id: run.id,
|
|
163
|
+
name: run.name,
|
|
164
|
+
type: run.run_type,
|
|
165
|
+
tags: run.tags ?? [],
|
|
166
|
+
metadata: run.extra?.metadata ?? {},
|
|
167
|
+
start_time: new Date(run.start_time).toISOString(),
|
|
168
|
+
streamed_output: [],
|
|
169
|
+
streamed_output_str: [],
|
|
170
|
+
final_output: void 0,
|
|
171
|
+
end_time: void 0
|
|
172
|
+
};
|
|
173
|
+
if (this._schemaFormat === "streaming_events") logEntry.inputs = await _getStandardizedInputs(run, this._schemaFormat);
|
|
174
|
+
await this.writer.write(new RunLogPatch({ ops: [{
|
|
175
|
+
op: "add",
|
|
176
|
+
path: `/logs/${this.keyMapByRunId[run.id]}`,
|
|
177
|
+
value: logEntry
|
|
178
|
+
}] }));
|
|
179
|
+
}
|
|
180
|
+
async onRunUpdate(run) {
|
|
181
|
+
try {
|
|
182
|
+
const runName = this.keyMapByRunId[run.id];
|
|
183
|
+
if (runName === void 0) return;
|
|
184
|
+
const ops = [];
|
|
185
|
+
if (this._schemaFormat === "streaming_events") ops.push({
|
|
186
|
+
op: "replace",
|
|
187
|
+
path: `/logs/${runName}/inputs`,
|
|
188
|
+
value: await _getStandardizedInputs(run, this._schemaFormat)
|
|
189
|
+
});
|
|
190
|
+
ops.push({
|
|
191
|
+
op: "add",
|
|
192
|
+
path: `/logs/${runName}/final_output`,
|
|
193
|
+
value: await _getStandardizedOutputs(run, this._schemaFormat)
|
|
194
|
+
});
|
|
195
|
+
if (run.end_time !== void 0) ops.push({
|
|
196
|
+
op: "add",
|
|
197
|
+
path: `/logs/${runName}/end_time`,
|
|
198
|
+
value: new Date(run.end_time).toISOString()
|
|
199
|
+
});
|
|
200
|
+
const patch = new RunLogPatch({ ops });
|
|
201
|
+
await this.writer.write(patch);
|
|
202
|
+
} finally {
|
|
203
|
+
if (run.id === this.rootId) {
|
|
204
|
+
const patch = new RunLogPatch({ ops: [{
|
|
205
|
+
op: "replace",
|
|
206
|
+
path: "/final_output",
|
|
207
|
+
value: await _getStandardizedOutputs(run, this._schemaFormat)
|
|
208
|
+
}] });
|
|
209
|
+
await this.writer.write(patch);
|
|
210
|
+
if (this.autoClose) await this.writer.close();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async onLLMNewToken(run, token, kwargs) {
|
|
215
|
+
const runName = this.keyMapByRunId[run.id];
|
|
216
|
+
if (runName === void 0) return;
|
|
217
|
+
const isChatModel = run.inputs.messages !== void 0;
|
|
218
|
+
let streamedOutputValue;
|
|
219
|
+
if (isChatModel) if (isChatGenerationChunk(kwargs?.chunk)) streamedOutputValue = kwargs?.chunk;
|
|
220
|
+
else streamedOutputValue = new AIMessageChunk({
|
|
221
|
+
id: `run-${run.id}`,
|
|
222
|
+
content: token
|
|
223
|
+
});
|
|
224
|
+
else streamedOutputValue = token;
|
|
225
|
+
const patch = new RunLogPatch({ ops: [{
|
|
226
|
+
op: "add",
|
|
227
|
+
path: `/logs/${runName}/streamed_output_str/-`,
|
|
228
|
+
value: token
|
|
229
|
+
}, {
|
|
230
|
+
op: "add",
|
|
231
|
+
path: `/logs/${runName}/streamed_output/-`,
|
|
232
|
+
value: streamedOutputValue
|
|
233
|
+
}] });
|
|
234
|
+
await this.writer.write(patch);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
10
237
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
238
|
+
LogStreamCallbackHandler,
|
|
239
|
+
RunLog,
|
|
240
|
+
RunLogPatch,
|
|
241
|
+
isLogStreamHandler,
|
|
242
|
+
log_stream_exports
|
|
15
243
|
};
|
|
16
244
|
//# sourceMappingURL=index.es90.js.map
|
package/dist/index.es90.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es90.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/singletons/index.js"],"sourcesContent":["import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { _CONTEXT_VARIABLES_KEY } from \"./async_local_storage/globals.js\";\nimport { AsyncLocalStorageProviderSingleton, MockAsyncLocalStorage } from \"./async_local_storage/index.js\";\n\n//#region src/singletons/index.ts\nvar singletons_exports = {};\n__export(singletons_exports, {\n\tAsyncLocalStorageProviderSingleton: () => AsyncLocalStorageProviderSingleton,\n\tMockAsyncLocalStorage: () => MockAsyncLocalStorage,\n\t_CONTEXT_VARIABLES_KEY: () => _CONTEXT_VARIABLES_KEY\n});\n\n//#endregion\nexport { AsyncLocalStorageProviderSingleton, MockAsyncLocalStorage, _CONTEXT_VARIABLES_KEY, singletons_exports };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;AAKG,IAAC,qBAAqB,CAAA;AACzB,SAAS,oBAAoB;AAAA,EAC5B,oCAAoC,MAAM;AAAA,EAC1C,uBAAuB,MAAM;AAAA,EAC7B,wBAAwB,MAAM;AAC/B,CAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es90.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/log_stream.js"],"sourcesContent":["import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { AIMessageChunk } from \"../messages/ai.js\";\nimport { applyPatch } from \"../utils/fast-json-patch/src/core.js\";\nimport \"../utils/fast-json-patch/index.js\";\nimport { BaseTracer } from \"./base.js\";\nimport { IterableReadableStream } from \"../utils/stream.js\";\n\n//#region src/tracers/log_stream.ts\nvar log_stream_exports = {};\n__export(log_stream_exports, {\n\tLogStreamCallbackHandler: () => LogStreamCallbackHandler,\n\tRunLog: () => RunLog,\n\tRunLogPatch: () => RunLogPatch,\n\tisLogStreamHandler: () => isLogStreamHandler\n});\n/**\n* List of jsonpatch JSONPatchOperations, which describe how to create the run state\n* from an empty dict. This is the minimal representation of the log, designed to\n* be serialized as JSON and sent over the wire to reconstruct the log on the other\n* side. Reconstruction of the state can be done with any jsonpatch-compliant library,\n* see https://jsonpatch.com for more information.\n*/\nvar RunLogPatch = class {\n\tops;\n\tconstructor(fields) {\n\t\tthis.ops = fields.ops ?? [];\n\t}\n\tconcat(other) {\n\t\tconst ops = this.ops.concat(other.ops);\n\t\tconst states = applyPatch({}, ops);\n\t\treturn new RunLog({\n\t\t\tops,\n\t\t\tstate: states[states.length - 1].newDocument\n\t\t});\n\t}\n};\nvar RunLog = class RunLog extends RunLogPatch {\n\tstate;\n\tconstructor(fields) {\n\t\tsuper(fields);\n\t\tthis.state = fields.state;\n\t}\n\tconcat(other) {\n\t\tconst ops = this.ops.concat(other.ops);\n\t\tconst states = applyPatch(this.state, other.ops);\n\t\treturn new RunLog({\n\t\t\tops,\n\t\t\tstate: states[states.length - 1].newDocument\n\t\t});\n\t}\n\tstatic fromRunLogPatch(patch) {\n\t\tconst states = applyPatch({}, patch.ops);\n\t\treturn new RunLog({\n\t\t\tops: patch.ops,\n\t\t\tstate: states[states.length - 1].newDocument\n\t\t});\n\t}\n};\nconst isLogStreamHandler = (handler) => handler.name === \"log_stream_tracer\";\n/**\n* Extract standardized inputs from a run.\n*\n* Standardizes the inputs based on the type of the runnable used.\n*\n* @param run - Run object\n* @param schemaFormat - The schema format to use.\n*\n* @returns Valid inputs are only dict. By conventions, inputs always represented\n* invocation using named arguments.\n* A null means that the input is not yet known!\n*/\nasync function _getStandardizedInputs(run, schemaFormat) {\n\tif (schemaFormat === \"original\") throw new Error(\"Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.\");\n\tconst { inputs } = run;\n\tif ([\n\t\t\"retriever\",\n\t\t\"llm\",\n\t\t\"prompt\"\n\t].includes(run.run_type)) return inputs;\n\tif (Object.keys(inputs).length === 1 && inputs?.input === \"\") return void 0;\n\treturn inputs.input;\n}\nasync function _getStandardizedOutputs(run, schemaFormat) {\n\tconst { outputs } = run;\n\tif (schemaFormat === \"original\") return outputs;\n\tif ([\n\t\t\"retriever\",\n\t\t\"llm\",\n\t\t\"prompt\"\n\t].includes(run.run_type)) return outputs;\n\tif (outputs !== void 0 && Object.keys(outputs).length === 1 && outputs?.output !== void 0) return outputs.output;\n\treturn outputs;\n}\nfunction isChatGenerationChunk(x) {\n\treturn x !== void 0 && x.message !== void 0;\n}\n/**\n* Class that extends the `BaseTracer` class from the\n* `langchain.callbacks.tracers.base` module. It represents a callback\n* handler that logs the execution of runs and emits `RunLog` instances to a\n* `RunLogStream`.\n*/\nvar LogStreamCallbackHandler = class extends BaseTracer {\n\tautoClose = true;\n\tincludeNames;\n\tincludeTypes;\n\tincludeTags;\n\texcludeNames;\n\texcludeTypes;\n\texcludeTags;\n\t_schemaFormat = \"original\";\n\trootId;\n\tkeyMapByRunId = {};\n\tcounterMapByRunName = {};\n\ttransformStream;\n\twriter;\n\treceiveStream;\n\tname = \"log_stream_tracer\";\n\tlc_prefer_streaming = true;\n\tconstructor(fields) {\n\t\tsuper({\n\t\t\t_awaitHandler: true,\n\t\t\t...fields\n\t\t});\n\t\tthis.autoClose = fields?.autoClose ?? true;\n\t\tthis.includeNames = fields?.includeNames;\n\t\tthis.includeTypes = fields?.includeTypes;\n\t\tthis.includeTags = fields?.includeTags;\n\t\tthis.excludeNames = fields?.excludeNames;\n\t\tthis.excludeTypes = fields?.excludeTypes;\n\t\tthis.excludeTags = fields?.excludeTags;\n\t\tthis._schemaFormat = fields?._schemaFormat ?? this._schemaFormat;\n\t\tthis.transformStream = new TransformStream();\n\t\tthis.writer = this.transformStream.writable.getWriter();\n\t\tthis.receiveStream = IterableReadableStream.fromReadableStream(this.transformStream.readable);\n\t}\n\t[Symbol.asyncIterator]() {\n\t\treturn this.receiveStream;\n\t}\n\tasync persistRun(_run) {}\n\t_includeRun(run) {\n\t\tif (run.id === this.rootId) return false;\n\t\tconst runTags = run.tags ?? [];\n\t\tlet include = this.includeNames === void 0 && this.includeTags === void 0 && this.includeTypes === void 0;\n\t\tif (this.includeNames !== void 0) include = include || this.includeNames.includes(run.name);\n\t\tif (this.includeTypes !== void 0) include = include || this.includeTypes.includes(run.run_type);\n\t\tif (this.includeTags !== void 0) include = include || runTags.find((tag) => this.includeTags?.includes(tag)) !== void 0;\n\t\tif (this.excludeNames !== void 0) include = include && !this.excludeNames.includes(run.name);\n\t\tif (this.excludeTypes !== void 0) include = include && !this.excludeTypes.includes(run.run_type);\n\t\tif (this.excludeTags !== void 0) include = include && runTags.every((tag) => !this.excludeTags?.includes(tag));\n\t\treturn include;\n\t}\n\tasync *tapOutputIterable(runId, output) {\n\t\tfor await (const chunk of output) {\n\t\t\tif (runId !== this.rootId) {\n\t\t\t\tconst key = this.keyMapByRunId[runId];\n\t\t\t\tif (key) await this.writer.write(new RunLogPatch({ ops: [{\n\t\t\t\t\top: \"add\",\n\t\t\t\t\tpath: `/logs/${key}/streamed_output/-`,\n\t\t\t\t\tvalue: chunk\n\t\t\t\t}] }));\n\t\t\t}\n\t\t\tyield chunk;\n\t\t}\n\t}\n\tasync onRunCreate(run) {\n\t\tif (this.rootId === void 0) {\n\t\t\tthis.rootId = run.id;\n\t\t\tawait this.writer.write(new RunLogPatch({ ops: [{\n\t\t\t\top: \"replace\",\n\t\t\t\tpath: \"\",\n\t\t\t\tvalue: {\n\t\t\t\t\tid: run.id,\n\t\t\t\t\tname: run.name,\n\t\t\t\t\ttype: run.run_type,\n\t\t\t\t\tstreamed_output: [],\n\t\t\t\t\tfinal_output: void 0,\n\t\t\t\t\tlogs: {}\n\t\t\t\t}\n\t\t\t}] }));\n\t\t}\n\t\tif (!this._includeRun(run)) return;\n\t\tif (this.counterMapByRunName[run.name] === void 0) this.counterMapByRunName[run.name] = 0;\n\t\tthis.counterMapByRunName[run.name] += 1;\n\t\tconst count = this.counterMapByRunName[run.name];\n\t\tthis.keyMapByRunId[run.id] = count === 1 ? run.name : `${run.name}:${count}`;\n\t\tconst logEntry = {\n\t\t\tid: run.id,\n\t\t\tname: run.name,\n\t\t\ttype: run.run_type,\n\t\t\ttags: run.tags ?? [],\n\t\t\tmetadata: run.extra?.metadata ?? {},\n\t\t\tstart_time: new Date(run.start_time).toISOString(),\n\t\t\tstreamed_output: [],\n\t\t\tstreamed_output_str: [],\n\t\t\tfinal_output: void 0,\n\t\t\tend_time: void 0\n\t\t};\n\t\tif (this._schemaFormat === \"streaming_events\") logEntry.inputs = await _getStandardizedInputs(run, this._schemaFormat);\n\t\tawait this.writer.write(new RunLogPatch({ ops: [{\n\t\t\top: \"add\",\n\t\t\tpath: `/logs/${this.keyMapByRunId[run.id]}`,\n\t\t\tvalue: logEntry\n\t\t}] }));\n\t}\n\tasync onRunUpdate(run) {\n\t\ttry {\n\t\t\tconst runName = this.keyMapByRunId[run.id];\n\t\t\tif (runName === void 0) return;\n\t\t\tconst ops = [];\n\t\t\tif (this._schemaFormat === \"streaming_events\") ops.push({\n\t\t\t\top: \"replace\",\n\t\t\t\tpath: `/logs/${runName}/inputs`,\n\t\t\t\tvalue: await _getStandardizedInputs(run, this._schemaFormat)\n\t\t\t});\n\t\t\tops.push({\n\t\t\t\top: \"add\",\n\t\t\t\tpath: `/logs/${runName}/final_output`,\n\t\t\t\tvalue: await _getStandardizedOutputs(run, this._schemaFormat)\n\t\t\t});\n\t\t\tif (run.end_time !== void 0) ops.push({\n\t\t\t\top: \"add\",\n\t\t\t\tpath: `/logs/${runName}/end_time`,\n\t\t\t\tvalue: new Date(run.end_time).toISOString()\n\t\t\t});\n\t\t\tconst patch = new RunLogPatch({ ops });\n\t\t\tawait this.writer.write(patch);\n\t\t} finally {\n\t\t\tif (run.id === this.rootId) {\n\t\t\t\tconst patch = new RunLogPatch({ ops: [{\n\t\t\t\t\top: \"replace\",\n\t\t\t\t\tpath: \"/final_output\",\n\t\t\t\t\tvalue: await _getStandardizedOutputs(run, this._schemaFormat)\n\t\t\t\t}] });\n\t\t\t\tawait this.writer.write(patch);\n\t\t\t\tif (this.autoClose) await this.writer.close();\n\t\t\t}\n\t\t}\n\t}\n\tasync onLLMNewToken(run, token, kwargs) {\n\t\tconst runName = this.keyMapByRunId[run.id];\n\t\tif (runName === void 0) return;\n\t\tconst isChatModel = run.inputs.messages !== void 0;\n\t\tlet streamedOutputValue;\n\t\tif (isChatModel) if (isChatGenerationChunk(kwargs?.chunk)) streamedOutputValue = kwargs?.chunk;\n\t\telse streamedOutputValue = new AIMessageChunk({\n\t\t\tid: `run-${run.id}`,\n\t\t\tcontent: token\n\t\t});\n\t\telse streamedOutputValue = token;\n\t\tconst patch = new RunLogPatch({ ops: [{\n\t\t\top: \"add\",\n\t\t\tpath: `/logs/${runName}/streamed_output_str/-`,\n\t\t\tvalue: token\n\t\t}, {\n\t\t\top: \"add\",\n\t\t\tpath: `/logs/${runName}/streamed_output/-`,\n\t\t\tvalue: streamedOutputValue\n\t\t}] });\n\t\tawait this.writer.write(patch);\n\t}\n};\n\n//#endregion\nexport { LogStreamCallbackHandler, RunLog, RunLogPatch, isLogStreamHandler, log_stream_exports };\n//# sourceMappingURL=log_stream.js.map"],"names":["RunLog"],"mappings":";;;;;;AAQG,IAAC,qBAAqB,CAAA;AACzB,SAAS,oBAAoB;AAAA,EAC5B,0BAA0B,MAAM;AAAA,EAChC,QAAQ,MAAM;AAAA,EACd,aAAa,MAAM;AAAA,EACnB,oBAAoB,MAAM;AAC3B,CAAC;AAQE,IAAC,cAAc,MAAM;AAAA,EACvB;AAAA,EACA,YAAY,QAAQ;AACnB,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