@langchain/core 0.3.21 → 0.3.22
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/runnables/base.cjs +2 -2
- package/dist/runnables/base.d.ts +1 -2
- package/dist/runnables/base.js +3 -3
- package/dist/runnables/config.cjs +17 -1
- package/dist/runnables/config.d.ts +1 -0
- package/dist/runnables/config.js +15 -0
- package/dist/runnables/index.cjs +2 -1
- package/dist/runnables/index.d.ts +1 -1
- package/dist/runnables/index.js +1 -1
- package/dist/runnables/iter.cjs +3 -2
- package/dist/runnables/iter.d.ts +1 -1
- package/dist/runnables/iter.js +3 -2
- package/dist/runnables/types.d.ts +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.js +3 -3
- package/dist/types/stream.cjs +2 -0
- package/dist/types/stream.d.ts +1 -0
- package/dist/types/stream.js +1 -0
- package/dist/utils/stream.cjs +3 -2
- package/dist/utils/stream.d.ts +2 -1
- package/dist/utils/stream.js +3 -2
- package/package.json +1 -1
package/dist/runnables/base.cjs
CHANGED
|
@@ -1657,7 +1657,7 @@ class RunnableLambda extends Runnable {
|
|
|
1657
1657
|
callbacks: runManager?.getChild(),
|
|
1658
1658
|
recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
|
|
1659
1659
|
});
|
|
1660
|
-
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
1660
|
+
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(childConfig), async () => {
|
|
1661
1661
|
try {
|
|
1662
1662
|
let output = await this.func(input, {
|
|
1663
1663
|
...childConfig,
|
|
@@ -1744,7 +1744,7 @@ class RunnableLambda extends Runnable {
|
|
|
1744
1744
|
recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
|
|
1745
1745
|
});
|
|
1746
1746
|
const output = await new Promise((resolve, reject) => {
|
|
1747
|
-
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
1747
|
+
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(childConfig), async () => {
|
|
1748
1748
|
try {
|
|
1749
1749
|
const res = await this.func(finalChunk, {
|
|
1750
1750
|
...childConfig,
|
package/dist/runnables/base.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type TraceableFunction } from "langsmith/singletons/traceable";
|
|
3
|
-
import type { RunnableInterface, RunnableBatchOptions } from "./types.js";
|
|
3
|
+
import type { RunnableInterface, RunnableBatchOptions, RunnableConfig } from "./types.js";
|
|
4
4
|
import { CallbackManagerForChainRun } from "../callbacks/manager.js";
|
|
5
5
|
import { LogStreamCallbackHandler, LogStreamCallbackHandlerInput, RunLogPatch } from "../tracers/log_stream.js";
|
|
6
6
|
import { EventStreamCallbackHandlerInput, StreamEvent } from "../tracers/event_stream.js";
|
|
7
7
|
import { Serializable } from "../load/serializable.js";
|
|
8
8
|
import { IterableReadableStream } from "../utils/stream.js";
|
|
9
|
-
import { RunnableConfig } from "./config.js";
|
|
10
9
|
import { Run } from "../tracers/base.js";
|
|
11
10
|
import { Graph } from "./graph.js";
|
|
12
11
|
import { ToolCall } from "../messages/tool.js";
|
package/dist/runnables/base.js
CHANGED
|
@@ -7,7 +7,7 @@ import { EventStreamCallbackHandler, isStreamEventsHandler, } from "../tracers/e
|
|
|
7
7
|
import { Serializable } from "../load/serializable.js";
|
|
8
8
|
import { IterableReadableStream, concat, atee, pipeGeneratorWithSetup, AsyncGeneratorWithSetup, } from "../utils/stream.js";
|
|
9
9
|
import { raceWithSignal } from "../utils/signal.js";
|
|
10
|
-
import { DEFAULT_RECURSION_LIMIT, ensureConfig, getCallbackManagerForConfig, mergeConfigs, patchConfig, } from "./config.js";
|
|
10
|
+
import { DEFAULT_RECURSION_LIMIT, ensureConfig, getCallbackManagerForConfig, mergeConfigs, patchConfig, pickRunnableConfigKeys, } from "./config.js";
|
|
11
11
|
import { AsyncCaller } from "../utils/async_caller.js";
|
|
12
12
|
import { RootListenersTracer } from "../tracers/root_listener.js";
|
|
13
13
|
import { _RootEventFilter, isRunnableInterface } from "./utils.js";
|
|
@@ -1643,7 +1643,7 @@ export class RunnableLambda extends Runnable {
|
|
|
1643
1643
|
callbacks: runManager?.getChild(),
|
|
1644
1644
|
recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
|
|
1645
1645
|
});
|
|
1646
|
-
void AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
1646
|
+
void AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(childConfig), async () => {
|
|
1647
1647
|
try {
|
|
1648
1648
|
let output = await this.func(input, {
|
|
1649
1649
|
...childConfig,
|
|
@@ -1730,7 +1730,7 @@ export class RunnableLambda extends Runnable {
|
|
|
1730
1730
|
recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
|
|
1731
1731
|
});
|
|
1732
1732
|
const output = await new Promise((resolve, reject) => {
|
|
1733
|
-
void AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
1733
|
+
void AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(childConfig), async () => {
|
|
1734
1734
|
try {
|
|
1735
1735
|
const res = await this.func(finalChunk, {
|
|
1736
1736
|
...childConfig,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchConfig = exports.ensureConfig = exports.mergeConfigs = exports.getCallbackManagerForConfig = exports.DEFAULT_RECURSION_LIMIT = void 0;
|
|
3
|
+
exports.pickRunnableConfigKeys = exports.patchConfig = exports.ensureConfig = exports.mergeConfigs = exports.getCallbackManagerForConfig = exports.DEFAULT_RECURSION_LIMIT = void 0;
|
|
4
4
|
const manager_js_1 = require("../callbacks/manager.cjs");
|
|
5
5
|
const index_js_1 = require("../singletons/index.cjs");
|
|
6
6
|
exports.DEFAULT_RECURSION_LIMIT = 25;
|
|
@@ -205,3 +205,19 @@ function patchConfig(config = {}, { callbacks, maxConcurrency, recursionLimit, r
|
|
|
205
205
|
return newConfig;
|
|
206
206
|
}
|
|
207
207
|
exports.patchConfig = patchConfig;
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
|
+
function pickRunnableConfigKeys(config) {
|
|
210
|
+
return config
|
|
211
|
+
? {
|
|
212
|
+
configurable: config.configurable,
|
|
213
|
+
recursionLimit: config.recursionLimit,
|
|
214
|
+
callbacks: config.callbacks,
|
|
215
|
+
tags: config.tags,
|
|
216
|
+
metadata: config.metadata,
|
|
217
|
+
maxConcurrency: config.maxConcurrency,
|
|
218
|
+
timeout: config.timeout,
|
|
219
|
+
signal: config.signal,
|
|
220
|
+
}
|
|
221
|
+
: undefined;
|
|
222
|
+
}
|
|
223
|
+
exports.pickRunnableConfigKeys = pickRunnableConfigKeys;
|
|
@@ -12,3 +12,4 @@ export declare function ensureConfig<CallOptions extends RunnableConfig>(config?
|
|
|
12
12
|
* Helper function that patches runnable configs with updated properties.
|
|
13
13
|
*/
|
|
14
14
|
export declare function patchConfig<CallOptions extends RunnableConfig>(config?: Partial<CallOptions>, { callbacks, maxConcurrency, recursionLimit, runName, configurable, runId, }?: RunnableConfig): Partial<CallOptions>;
|
|
15
|
+
export declare function pickRunnableConfigKeys<CallOptions extends Record<string, any>>(config?: CallOptions): Partial<RunnableConfig> | undefined;
|
package/dist/runnables/config.js
CHANGED
|
@@ -198,3 +198,18 @@ export function patchConfig(config = {}, { callbacks, maxConcurrency, recursionL
|
|
|
198
198
|
}
|
|
199
199
|
return newConfig;
|
|
200
200
|
}
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
202
|
+
export function pickRunnableConfigKeys(config) {
|
|
203
|
+
return config
|
|
204
|
+
? {
|
|
205
|
+
configurable: config.configurable,
|
|
206
|
+
recursionLimit: config.recursionLimit,
|
|
207
|
+
callbacks: config.callbacks,
|
|
208
|
+
tags: config.tags,
|
|
209
|
+
metadata: config.metadata,
|
|
210
|
+
maxConcurrency: config.maxConcurrency,
|
|
211
|
+
timeout: config.timeout,
|
|
212
|
+
signal: config.signal,
|
|
213
|
+
}
|
|
214
|
+
: undefined;
|
|
215
|
+
}
|
package/dist/runnables/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RunnableWithMessageHistory = exports.RunnableBranch = exports.RouterRunnable = exports.RunnablePassthrough = exports.mergeConfigs = exports.ensureConfig = exports.patchConfig = exports.getCallbackManagerForConfig = exports.RunnableToolLike = exports._coerceToRunnable = exports.RunnablePick = exports.RunnableAssign = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableParallel = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
3
|
+
exports.RunnableWithMessageHistory = exports.RunnableBranch = exports.RouterRunnable = exports.RunnablePassthrough = exports.pickRunnableConfigKeys = exports.mergeConfigs = exports.ensureConfig = exports.patchConfig = exports.getCallbackManagerForConfig = exports.RunnableToolLike = exports._coerceToRunnable = exports.RunnablePick = exports.RunnableAssign = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableParallel = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
4
4
|
var base_js_1 = require("./base.cjs");
|
|
5
5
|
Object.defineProperty(exports, "Runnable", { enumerable: true, get: function () { return base_js_1.Runnable; } });
|
|
6
6
|
Object.defineProperty(exports, "RunnableBinding", { enumerable: true, get: function () { return base_js_1.RunnableBinding; } });
|
|
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "getCallbackManagerForConfig", { enumerable: true
|
|
|
20
20
|
Object.defineProperty(exports, "patchConfig", { enumerable: true, get: function () { return config_js_1.patchConfig; } });
|
|
21
21
|
Object.defineProperty(exports, "ensureConfig", { enumerable: true, get: function () { return config_js_1.ensureConfig; } });
|
|
22
22
|
Object.defineProperty(exports, "mergeConfigs", { enumerable: true, get: function () { return config_js_1.mergeConfigs; } });
|
|
23
|
+
Object.defineProperty(exports, "pickRunnableConfigKeys", { enumerable: true, get: function () { return config_js_1.pickRunnableConfigKeys; } });
|
|
23
24
|
var passthrough_js_1 = require("./passthrough.cjs");
|
|
24
25
|
Object.defineProperty(exports, "RunnablePassthrough", { enumerable: true, get: function () { return passthrough_js_1.RunnablePassthrough; } });
|
|
25
26
|
var router_js_1 = require("./router.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type RunnableFunc, type RunnableLike, type RunnableRetryFailedAttemptHandler, Runnable, type RunnableBindingArgs, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, RunnableAssign, RunnablePick, _coerceToRunnable, RunnableToolLike, type RunnableToolLikeArgs, } from "./base.js";
|
|
2
2
|
export { type RunnableBatchOptions, type RunnableInterface, type RunnableIOSchema, } from "./types.js";
|
|
3
|
-
export { type RunnableConfig, getCallbackManagerForConfig, patchConfig, ensureConfig, mergeConfigs, } from "./config.js";
|
|
3
|
+
export { type RunnableConfig, getCallbackManagerForConfig, patchConfig, ensureConfig, mergeConfigs, pickRunnableConfigKeys, } from "./config.js";
|
|
4
4
|
export { RunnablePassthrough } from "./passthrough.js";
|
|
5
5
|
export { type RouterInput, RouterRunnable } from "./router.js";
|
|
6
6
|
export { RunnableBranch, type Branch, type BranchLike } from "./branch.js";
|
package/dist/runnables/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Runnable, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, RunnableAssign, RunnablePick, _coerceToRunnable, RunnableToolLike, } from "./base.js";
|
|
2
|
-
export { getCallbackManagerForConfig, patchConfig, ensureConfig, mergeConfigs, } from "./config.js";
|
|
2
|
+
export { getCallbackManagerForConfig, patchConfig, ensureConfig, mergeConfigs, pickRunnableConfigKeys, } from "./config.js";
|
|
3
3
|
export { RunnablePassthrough } from "./passthrough.js";
|
|
4
4
|
export { RouterRunnable } from "./router.js";
|
|
5
5
|
export { RunnableBranch } from "./branch.js";
|
package/dist/runnables/iter.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.consumeAsyncIterableInContext = exports.consumeIteratorInContext = exports.isAsyncIterable = exports.isIterator = exports.isIterableIterator = void 0;
|
|
4
4
|
const index_js_1 = require("../singletons/index.cjs");
|
|
5
|
+
const config_js_1 = require("./config.cjs");
|
|
5
6
|
function isIterableIterator(thing) {
|
|
6
7
|
return (typeof thing === "object" &&
|
|
7
8
|
thing !== null &&
|
|
@@ -24,7 +25,7 @@ function isAsyncIterable(thing) {
|
|
|
24
25
|
exports.isAsyncIterable = isAsyncIterable;
|
|
25
26
|
function* consumeIteratorInContext(context, iter) {
|
|
26
27
|
while (true) {
|
|
27
|
-
const { value, done } = index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(context, iter.next.bind(iter), true);
|
|
28
|
+
const { value, done } = index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(context), iter.next.bind(iter), true);
|
|
28
29
|
if (done) {
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
@@ -37,7 +38,7 @@ exports.consumeIteratorInContext = consumeIteratorInContext;
|
|
|
37
38
|
async function* consumeAsyncIterableInContext(context, iter) {
|
|
38
39
|
const iterator = iter[Symbol.asyncIterator]();
|
|
39
40
|
while (true) {
|
|
40
|
-
const { value, done } = await index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(context, iterator.next.bind(iter), true);
|
|
41
|
+
const { value, done } = await index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(context), iterator.next.bind(iter), true);
|
|
41
42
|
if (done) {
|
|
42
43
|
break;
|
|
43
44
|
}
|
package/dist/runnables/iter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RunnableConfig } from "
|
|
1
|
+
import type { RunnableConfig } from "../runnables/types.js";
|
|
2
2
|
export declare function isIterableIterator(thing: unknown): thing is IterableIterator<unknown>;
|
|
3
3
|
export declare const isIterator: (x: unknown) => x is Iterator<unknown, any, undefined>;
|
|
4
4
|
export declare function isAsyncIterable(thing: unknown): thing is AsyncIterable<unknown>;
|
package/dist/runnables/iter.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorageProviderSingleton } from "../singletons/index.js";
|
|
2
|
+
import { pickRunnableConfigKeys } from "./config.js";
|
|
2
3
|
export function isIterableIterator(thing) {
|
|
3
4
|
return (typeof thing === "object" &&
|
|
4
5
|
thing !== null &&
|
|
@@ -18,7 +19,7 @@ export function isAsyncIterable(thing) {
|
|
|
18
19
|
}
|
|
19
20
|
export function* consumeIteratorInContext(context, iter) {
|
|
20
21
|
while (true) {
|
|
21
|
-
const { value, done } = AsyncLocalStorageProviderSingleton.runWithConfig(context, iter.next.bind(iter), true);
|
|
22
|
+
const { value, done } = AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(context), iter.next.bind(iter), true);
|
|
22
23
|
if (done) {
|
|
23
24
|
break;
|
|
24
25
|
}
|
|
@@ -30,7 +31,7 @@ export function* consumeIteratorInContext(context, iter) {
|
|
|
30
31
|
export async function* consumeAsyncIterableInContext(context, iter) {
|
|
31
32
|
const iterator = iter[Symbol.asyncIterator]();
|
|
32
33
|
while (true) {
|
|
33
|
-
const { value, done } = await AsyncLocalStorageProviderSingleton.runWithConfig(context, iterator.next.bind(iter), true);
|
|
34
|
+
const { value, done } = await AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(context), iterator.next.bind(iter), true);
|
|
34
35
|
if (done) {
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
import type { IterableReadableStreamInterface } from "../utils/stream.js";
|
|
3
2
|
import type { SerializableInterface } from "../load/serializable.js";
|
|
4
3
|
import type { BaseCallbackConfig } from "../callbacks/manager.js";
|
|
4
|
+
import type { IterableReadableStreamInterface } from "../types/stream.js";
|
|
5
5
|
export type RunnableBatchOptions = {
|
|
6
6
|
/** @deprecated Pass in via the standard runnable config object instead */
|
|
7
7
|
maxConcurrency?: number;
|
package/dist/tools/index.cjs
CHANGED
|
@@ -310,7 +310,7 @@ function tool(func, fields) {
|
|
|
310
310
|
const childConfig = (0, config_js_1.patchConfig)(config, {
|
|
311
311
|
callbacks: runManager?.getChild(),
|
|
312
312
|
});
|
|
313
|
-
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
313
|
+
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(childConfig), async () => {
|
|
314
314
|
try {
|
|
315
315
|
// TS doesn't restrict the type here based on the guard above
|
|
316
316
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -336,7 +336,7 @@ function tool(func, fields) {
|
|
|
336
336
|
const childConfig = (0, config_js_1.patchConfig)(config, {
|
|
337
337
|
callbacks: runManager?.getChild(),
|
|
338
338
|
});
|
|
339
|
-
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
339
|
+
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(childConfig), async () => {
|
|
340
340
|
try {
|
|
341
341
|
// TS doesn't restrict the type here based on the guard above
|
|
342
342
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/dist/tools/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CallbackManager, parseCallbackConfigArg, } from "../callbacks/manager.js";
|
|
3
3
|
import { BaseLangChain, } from "../language_models/base.js";
|
|
4
|
-
import { ensureConfig, patchConfig, } from "../runnables/config.js";
|
|
4
|
+
import { ensureConfig, patchConfig, pickRunnableConfigKeys, } from "../runnables/config.js";
|
|
5
5
|
import { ToolMessage } from "../messages/tool.js";
|
|
6
6
|
import { AsyncLocalStorageProviderSingleton } from "../singletons/index.js";
|
|
7
7
|
import { _isToolCall, ToolInputParsingException } from "./utils.js";
|
|
@@ -302,7 +302,7 @@ export function tool(func, fields) {
|
|
|
302
302
|
const childConfig = patchConfig(config, {
|
|
303
303
|
callbacks: runManager?.getChild(),
|
|
304
304
|
});
|
|
305
|
-
void AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
305
|
+
void AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(childConfig), async () => {
|
|
306
306
|
try {
|
|
307
307
|
// TS doesn't restrict the type here based on the guard above
|
|
308
308
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -328,7 +328,7 @@ export function tool(func, fields) {
|
|
|
328
328
|
const childConfig = patchConfig(config, {
|
|
329
329
|
callbacks: runManager?.getChild(),
|
|
330
330
|
});
|
|
331
|
-
void AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => {
|
|
331
|
+
void AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(childConfig), async () => {
|
|
332
332
|
try {
|
|
333
333
|
// TS doesn't restrict the type here based on the guard above
|
|
334
334
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IterableReadableStreamInterface<T> = ReadableStream<T> & AsyncIterable<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/stream.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pipeGeneratorWithSetup = exports.AsyncGeneratorWithSetup = exports.concat = exports.atee = exports.IterableReadableStream = void 0;
|
|
4
|
+
const config_js_1 = require("../runnables/config.cjs");
|
|
4
5
|
const index_js_1 = require("../singletons/index.cjs");
|
|
5
6
|
const signal_js_1 = require("./signal.cjs");
|
|
6
7
|
/*
|
|
@@ -220,7 +221,7 @@ class AsyncGeneratorWithSetup {
|
|
|
220
221
|
// needs to happen in logical order, ie. in the order in which input to
|
|
221
222
|
// to each generator is available.
|
|
222
223
|
this.setup = new Promise((resolve, reject) => {
|
|
223
|
-
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(params.config, async () => {
|
|
224
|
+
void index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(params.config), async () => {
|
|
224
225
|
this.firstResult = params.generator.next();
|
|
225
226
|
if (params.startSetup) {
|
|
226
227
|
this.firstResult.then(params.startSetup).then(resolve, reject);
|
|
@@ -237,7 +238,7 @@ class AsyncGeneratorWithSetup {
|
|
|
237
238
|
this.firstResultUsed = true;
|
|
238
239
|
return this.firstResult;
|
|
239
240
|
}
|
|
240
|
-
return index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig(this.config, this.signal
|
|
241
|
+
return index_js_1.AsyncLocalStorageProviderSingleton.runWithConfig((0, config_js_1.pickRunnableConfigKeys)(this.config), this.signal
|
|
241
242
|
? async () => {
|
|
242
243
|
return (0, signal_js_1.raceWithSignal)(this.generator.next(...args), this.signal);
|
|
243
244
|
}
|
package/dist/utils/stream.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IterableReadableStreamInterface } from "../types/stream.js";
|
|
2
|
+
export type { IterableReadableStreamInterface };
|
|
2
3
|
export declare class IterableReadableStream<T> extends ReadableStream<T> implements IterableReadableStreamInterface<T> {
|
|
3
4
|
reader: ReadableStreamDefaultReader<T>;
|
|
4
5
|
ensureReader(): void;
|
package/dist/utils/stream.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pickRunnableConfigKeys } from "../runnables/config.js";
|
|
1
2
|
import { AsyncLocalStorageProviderSingleton } from "../singletons/index.js";
|
|
2
3
|
import { raceWithSignal } from "./signal.js";
|
|
3
4
|
/*
|
|
@@ -214,7 +215,7 @@ export class AsyncGeneratorWithSetup {
|
|
|
214
215
|
// needs to happen in logical order, ie. in the order in which input to
|
|
215
216
|
// to each generator is available.
|
|
216
217
|
this.setup = new Promise((resolve, reject) => {
|
|
217
|
-
void AsyncLocalStorageProviderSingleton.runWithConfig(params.config, async () => {
|
|
218
|
+
void AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(params.config), async () => {
|
|
218
219
|
this.firstResult = params.generator.next();
|
|
219
220
|
if (params.startSetup) {
|
|
220
221
|
this.firstResult.then(params.startSetup).then(resolve, reject);
|
|
@@ -231,7 +232,7 @@ export class AsyncGeneratorWithSetup {
|
|
|
231
232
|
this.firstResultUsed = true;
|
|
232
233
|
return this.firstResult;
|
|
233
234
|
}
|
|
234
|
-
return AsyncLocalStorageProviderSingleton.runWithConfig(this.config, this.signal
|
|
235
|
+
return AsyncLocalStorageProviderSingleton.runWithConfig(pickRunnableConfigKeys(this.config), this.signal
|
|
235
236
|
? async () => {
|
|
236
237
|
return raceWithSignal(this.generator.next(...args), this.signal);
|
|
237
238
|
}
|