@langchain/langgraph 1.0.6 → 1.0.12
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/package.json +7 -7
- package/CHANGELOG.md +0 -280
- package/dist/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/channels/any_value.cjs +0 -46
- package/dist/channels/any_value.cjs.map +0 -1
- package/dist/channels/any_value.d.cts +0 -24
- package/dist/channels/any_value.d.cts.map +0 -1
- package/dist/channels/any_value.d.ts +0 -24
- package/dist/channels/any_value.d.ts.map +0 -1
- package/dist/channels/any_value.js +0 -46
- package/dist/channels/any_value.js.map +0 -1
- package/dist/channels/base.cjs +0 -102
- package/dist/channels/base.cjs.map +0 -1
- package/dist/channels/base.d.cts +0 -79
- package/dist/channels/base.d.cts.map +0 -1
- package/dist/channels/base.d.ts +0 -79
- package/dist/channels/base.d.ts.map +0 -1
- package/dist/channels/base.js +0 -97
- package/dist/channels/base.js.map +0 -1
- package/dist/channels/binop.cjs +0 -49
- package/dist/channels/binop.cjs.map +0 -1
- package/dist/channels/binop.d.cts +0 -22
- package/dist/channels/binop.d.cts.map +0 -1
- package/dist/channels/binop.d.ts +0 -22
- package/dist/channels/binop.d.ts.map +0 -1
- package/dist/channels/binop.js +0 -49
- package/dist/channels/binop.js.map +0 -1
- package/dist/channels/dynamic_barrier_value.cjs +0 -76
- package/dist/channels/dynamic_barrier_value.cjs.map +0 -1
- package/dist/channels/dynamic_barrier_value.d.cts +0 -42
- package/dist/channels/dynamic_barrier_value.d.cts.map +0 -1
- package/dist/channels/dynamic_barrier_value.d.ts +0 -42
- package/dist/channels/dynamic_barrier_value.d.ts.map +0 -1
- package/dist/channels/dynamic_barrier_value.js +0 -76
- package/dist/channels/dynamic_barrier_value.js.map +0 -1
- package/dist/channels/ephemeral_value.cjs +0 -46
- package/dist/channels/ephemeral_value.cjs.map +0 -1
- package/dist/channels/ephemeral_value.d.cts +0 -22
- package/dist/channels/ephemeral_value.d.cts.map +0 -1
- package/dist/channels/ephemeral_value.d.ts +0 -22
- package/dist/channels/ephemeral_value.d.ts.map +0 -1
- package/dist/channels/ephemeral_value.js +0 -46
- package/dist/channels/ephemeral_value.js.map +0 -1
- package/dist/channels/index.cjs +0 -21
- package/dist/channels/index.d.cts +0 -9
- package/dist/channels/index.d.ts +0 -9
- package/dist/channels/index.js +0 -10
- package/dist/channels/last_value.cjs +0 -98
- package/dist/channels/last_value.cjs.map +0 -1
- package/dist/channels/last_value.d.cts +0 -44
- package/dist/channels/last_value.d.cts.map +0 -1
- package/dist/channels/last_value.d.ts +0 -44
- package/dist/channels/last_value.d.ts.map +0 -1
- package/dist/channels/last_value.js +0 -97
- package/dist/channels/last_value.js.map +0 -1
- package/dist/channels/named_barrier_value.cjs +0 -118
- package/dist/channels/named_barrier_value.cjs.map +0 -1
- package/dist/channels/named_barrier_value.d.cts +0 -46
- package/dist/channels/named_barrier_value.d.cts.map +0 -1
- package/dist/channels/named_barrier_value.d.ts +0 -46
- package/dist/channels/named_barrier_value.d.ts.map +0 -1
- package/dist/channels/named_barrier_value.js +0 -116
- package/dist/channels/named_barrier_value.js.map +0 -1
- package/dist/channels/topic.cjs +0 -65
- package/dist/channels/topic.cjs.map +0 -1
- package/dist/channels/topic.d.cts +0 -32
- package/dist/channels/topic.d.cts.map +0 -1
- package/dist/channels/topic.d.ts +0 -32
- package/dist/channels/topic.d.ts.map +0 -1
- package/dist/channels/topic.js +0 -65
- package/dist/channels/topic.js.map +0 -1
- package/dist/constants.cjs +0 -406
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.d.cts +0 -285
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.ts +0 -285
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -362
- package/dist/constants.js.map +0 -1
- package/dist/errors.cjs +0 -163
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.d.cts +0 -81
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.ts +0 -81
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -146
- package/dist/errors.js.map +0 -1
- package/dist/func/index.cjs +0 -301
- package/dist/func/index.cjs.map +0 -1
- package/dist/func/index.d.cts +0 -293
- package/dist/func/index.d.cts.map +0 -1
- package/dist/func/index.d.ts +0 -293
- package/dist/func/index.d.ts.map +0 -1
- package/dist/func/index.js +0 -298
- package/dist/func/index.js.map +0 -1
- package/dist/func/types.d.cts +0 -64
- package/dist/func/types.d.cts.map +0 -1
- package/dist/func/types.d.ts +0 -64
- package/dist/func/types.d.ts.map +0 -1
- package/dist/graph/annotation.cjs +0 -101
- package/dist/graph/annotation.cjs.map +0 -1
- package/dist/graph/annotation.d.cts +0 -116
- package/dist/graph/annotation.d.cts.map +0 -1
- package/dist/graph/annotation.d.ts +0 -116
- package/dist/graph/annotation.d.ts.map +0 -1
- package/dist/graph/annotation.js +0 -99
- package/dist/graph/annotation.js.map +0 -1
- package/dist/graph/graph.cjs +0 -423
- package/dist/graph/graph.cjs.map +0 -1
- package/dist/graph/graph.d.cts +0 -132
- package/dist/graph/graph.d.cts.map +0 -1
- package/dist/graph/graph.d.ts +0 -132
- package/dist/graph/graph.d.ts.map +0 -1
- package/dist/graph/graph.js +0 -420
- package/dist/graph/graph.js.map +0 -1
- package/dist/graph/index.cjs +0 -5
- package/dist/graph/index.js +0 -7
- package/dist/graph/message.cjs +0 -99
- package/dist/graph/message.cjs.map +0 -1
- package/dist/graph/message.d.cts +0 -40
- package/dist/graph/message.d.cts.map +0 -1
- package/dist/graph/message.d.ts +0 -40
- package/dist/graph/message.d.ts.map +0 -1
- package/dist/graph/message.js +0 -95
- package/dist/graph/message.js.map +0 -1
- package/dist/graph/messages_annotation.cjs +0 -110
- package/dist/graph/messages_annotation.cjs.map +0 -1
- package/dist/graph/messages_annotation.d.cts +0 -112
- package/dist/graph/messages_annotation.d.cts.map +0 -1
- package/dist/graph/messages_annotation.d.ts +0 -112
- package/dist/graph/messages_annotation.d.ts.map +0 -1
- package/dist/graph/messages_annotation.js +0 -107
- package/dist/graph/messages_annotation.js.map +0 -1
- package/dist/graph/state.cjs +0 -501
- package/dist/graph/state.cjs.map +0 -1
- package/dist/graph/state.d.cts +0 -236
- package/dist/graph/state.d.cts.map +0 -1
- package/dist/graph/state.d.ts +0 -236
- package/dist/graph/state.d.ts.map +0 -1
- package/dist/graph/state.js +0 -499
- package/dist/graph/state.js.map +0 -1
- package/dist/graph/zod/index.cjs +0 -10
- package/dist/graph/zod/index.d.cts +0 -3
- package/dist/graph/zod/index.d.ts +0 -3
- package/dist/graph/zod/index.js +0 -5
- package/dist/graph/zod/meta.cjs +0 -145
- package/dist/graph/zod/meta.cjs.map +0 -1
- package/dist/graph/zod/meta.d.cts +0 -116
- package/dist/graph/zod/meta.d.cts.map +0 -1
- package/dist/graph/zod/meta.d.ts +0 -116
- package/dist/graph/zod/meta.d.ts.map +0 -1
- package/dist/graph/zod/meta.js +0 -141
- package/dist/graph/zod/meta.js.map +0 -1
- package/dist/graph/zod/plugin.cjs +0 -41
- package/dist/graph/zod/plugin.cjs.map +0 -1
- package/dist/graph/zod/plugin.js +0 -41
- package/dist/graph/zod/plugin.js.map +0 -1
- package/dist/graph/zod/schema.cjs +0 -99
- package/dist/graph/zod/schema.cjs.map +0 -1
- package/dist/graph/zod/schema.d.cts +0 -38
- package/dist/graph/zod/schema.d.cts.map +0 -1
- package/dist/graph/zod/schema.d.ts +0 -38
- package/dist/graph/zod/schema.d.ts.map +0 -1
- package/dist/graph/zod/schema.js +0 -94
- package/dist/graph/zod/schema.js.map +0 -1
- package/dist/graph/zod/zod-registry.cjs +0 -43
- package/dist/graph/zod/zod-registry.cjs.map +0 -1
- package/dist/graph/zod/zod-registry.d.cts +0 -51
- package/dist/graph/zod/zod-registry.d.cts.map +0 -1
- package/dist/graph/zod/zod-registry.d.ts +0 -51
- package/dist/graph/zod/zod-registry.d.ts.map +0 -1
- package/dist/graph/zod/zod-registry.js +0 -41
- package/dist/graph/zod/zod-registry.js.map +0 -1
- package/dist/hash.cjs +0 -271
- package/dist/hash.cjs.map +0 -1
- package/dist/hash.js +0 -269
- package/dist/hash.js.map +0 -1
- package/dist/index.cjs +0 -112
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -26
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/interrupt.cjs +0 -82
- package/dist/interrupt.cjs.map +0 -1
- package/dist/interrupt.d.cts +0 -58
- package/dist/interrupt.d.cts.map +0 -1
- package/dist/interrupt.d.ts +0 -58
- package/dist/interrupt.d.ts.map +0 -1
- package/dist/interrupt.js +0 -81
- package/dist/interrupt.js.map +0 -1
- package/dist/prebuilt/agentName.cjs +0 -153
- package/dist/prebuilt/agentName.cjs.map +0 -1
- package/dist/prebuilt/agentName.d.cts +0 -42
- package/dist/prebuilt/agentName.d.cts.map +0 -1
- package/dist/prebuilt/agentName.d.ts +0 -42
- package/dist/prebuilt/agentName.d.ts.map +0 -1
- package/dist/prebuilt/agentName.js +0 -152
- package/dist/prebuilt/agentName.js.map +0 -1
- package/dist/prebuilt/agent_executor.cjs +0 -44
- package/dist/prebuilt/agent_executor.cjs.map +0 -1
- package/dist/prebuilt/agent_executor.d.cts +0 -58
- package/dist/prebuilt/agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/agent_executor.d.ts +0 -58
- package/dist/prebuilt/agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/agent_executor.js +0 -44
- package/dist/prebuilt/agent_executor.js.map +0 -1
- package/dist/prebuilt/chat_agent_executor.cjs +0 -68
- package/dist/prebuilt/chat_agent_executor.cjs.map +0 -1
- package/dist/prebuilt/chat_agent_executor.d.cts +0 -23
- package/dist/prebuilt/chat_agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/chat_agent_executor.d.ts +0 -23
- package/dist/prebuilt/chat_agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/chat_agent_executor.js +0 -67
- package/dist/prebuilt/chat_agent_executor.js.map +0 -1
- package/dist/prebuilt/index.cjs +0 -15
- package/dist/prebuilt/index.d.cts +0 -8
- package/dist/prebuilt/index.d.ts +0 -8
- package/dist/prebuilt/index.js +0 -8
- package/dist/prebuilt/interrupt.d.cts +0 -61
- package/dist/prebuilt/interrupt.d.cts.map +0 -1
- package/dist/prebuilt/interrupt.d.ts +0 -61
- package/dist/prebuilt/interrupt.d.ts.map +0 -1
- package/dist/prebuilt/react_agent_executor.cjs +0 -344
- package/dist/prebuilt/react_agent_executor.cjs.map +0 -1
- package/dist/prebuilt/react_agent_executor.d.cts +0 -230
- package/dist/prebuilt/react_agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/react_agent_executor.d.ts +0 -230
- package/dist/prebuilt/react_agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/react_agent_executor.js +0 -342
- package/dist/prebuilt/react_agent_executor.js.map +0 -1
- package/dist/prebuilt/tool_executor.cjs +0 -48
- package/dist/prebuilt/tool_executor.cjs.map +0 -1
- package/dist/prebuilt/tool_executor.d.cts +0 -42
- package/dist/prebuilt/tool_executor.d.cts.map +0 -1
- package/dist/prebuilt/tool_executor.d.ts +0 -42
- package/dist/prebuilt/tool_executor.d.ts.map +0 -1
- package/dist/prebuilt/tool_executor.js +0 -47
- package/dist/prebuilt/tool_executor.js.map +0 -1
- package/dist/prebuilt/tool_node.cjs +0 -248
- package/dist/prebuilt/tool_node.cjs.map +0 -1
- package/dist/prebuilt/tool_node.d.cts +0 -182
- package/dist/prebuilt/tool_node.d.cts.map +0 -1
- package/dist/prebuilt/tool_node.d.ts +0 -182
- package/dist/prebuilt/tool_node.d.ts.map +0 -1
- package/dist/prebuilt/tool_node.js +0 -246
- package/dist/prebuilt/tool_node.js.map +0 -1
- package/dist/pregel/algo.cjs +0 -573
- package/dist/pregel/algo.cjs.map +0 -1
- package/dist/pregel/algo.d.cts +0 -13
- package/dist/pregel/algo.d.cts.map +0 -1
- package/dist/pregel/algo.d.ts +0 -13
- package/dist/pregel/algo.d.ts.map +0 -1
- package/dist/pregel/algo.js +0 -567
- package/dist/pregel/algo.js.map +0 -1
- package/dist/pregel/call.cjs +0 -53
- package/dist/pregel/call.cjs.map +0 -1
- package/dist/pregel/call.js +0 -50
- package/dist/pregel/call.js.map +0 -1
- package/dist/pregel/debug.cjs +0 -175
- package/dist/pregel/debug.cjs.map +0 -1
- package/dist/pregel/debug.js +0 -169
- package/dist/pregel/debug.js.map +0 -1
- package/dist/pregel/index.cjs +0 -1170
- package/dist/pregel/index.cjs.map +0 -1
- package/dist/pregel/index.d.cts +0 -546
- package/dist/pregel/index.d.cts.map +0 -1
- package/dist/pregel/index.d.ts +0 -546
- package/dist/pregel/index.d.ts.map +0 -1
- package/dist/pregel/index.js +0 -1168
- package/dist/pregel/index.js.map +0 -1
- package/dist/pregel/io.cjs +0 -140
- package/dist/pregel/io.cjs.map +0 -1
- package/dist/pregel/io.js +0 -135
- package/dist/pregel/io.js.map +0 -1
- package/dist/pregel/loop.cjs +0 -548
- package/dist/pregel/loop.cjs.map +0 -1
- package/dist/pregel/loop.js +0 -547
- package/dist/pregel/loop.js.map +0 -1
- package/dist/pregel/messages.cjs +0 -108
- package/dist/pregel/messages.cjs.map +0 -1
- package/dist/pregel/messages.js +0 -107
- package/dist/pregel/messages.js.map +0 -1
- package/dist/pregel/read.cjs +0 -152
- package/dist/pregel/read.cjs.map +0 -1
- package/dist/pregel/read.d.cts +0 -51
- package/dist/pregel/read.d.cts.map +0 -1
- package/dist/pregel/read.d.ts +0 -51
- package/dist/pregel/read.d.ts.map +0 -1
- package/dist/pregel/read.js +0 -150
- package/dist/pregel/read.js.map +0 -1
- package/dist/pregel/remote.cjs +0 -346
- package/dist/pregel/remote.cjs.map +0 -1
- package/dist/pregel/remote.d.cts +0 -121
- package/dist/pregel/remote.d.cts.map +0 -1
- package/dist/pregel/remote.d.ts +0 -121
- package/dist/pregel/remote.d.ts.map +0 -1
- package/dist/pregel/remote.js +0 -345
- package/dist/pregel/remote.js.map +0 -1
- package/dist/pregel/retry.cjs +0 -92
- package/dist/pregel/retry.cjs.map +0 -1
- package/dist/pregel/retry.js +0 -92
- package/dist/pregel/retry.js.map +0 -1
- package/dist/pregel/runnable_types.d.cts +0 -49
- package/dist/pregel/runnable_types.d.cts.map +0 -1
- package/dist/pregel/runnable_types.d.ts +0 -49
- package/dist/pregel/runnable_types.d.ts.map +0 -1
- package/dist/pregel/runner.cjs +0 -228
- package/dist/pregel/runner.cjs.map +0 -1
- package/dist/pregel/runner.js +0 -228
- package/dist/pregel/runner.js.map +0 -1
- package/dist/pregel/stream.cjs +0 -199
- package/dist/pregel/stream.cjs.map +0 -1
- package/dist/pregel/stream.js +0 -196
- package/dist/pregel/stream.js.map +0 -1
- package/dist/pregel/types.cjs +0 -27
- package/dist/pregel/types.cjs.map +0 -1
- package/dist/pregel/types.d.cts +0 -453
- package/dist/pregel/types.d.cts.map +0 -1
- package/dist/pregel/types.d.ts +0 -453
- package/dist/pregel/types.d.ts.map +0 -1
- package/dist/pregel/types.js +0 -25
- package/dist/pregel/types.js.map +0 -1
- package/dist/pregel/utils/config.cjs +0 -122
- package/dist/pregel/utils/config.cjs.map +0 -1
- package/dist/pregel/utils/config.d.cts +0 -36
- package/dist/pregel/utils/config.d.cts.map +0 -1
- package/dist/pregel/utils/config.d.ts +0 -36
- package/dist/pregel/utils/config.d.ts.map +0 -1
- package/dist/pregel/utils/config.js +0 -115
- package/dist/pregel/utils/config.js.map +0 -1
- package/dist/pregel/utils/index.cjs +0 -103
- package/dist/pregel/utils/index.cjs.map +0 -1
- package/dist/pregel/utils/index.d.cts +0 -51
- package/dist/pregel/utils/index.d.cts.map +0 -1
- package/dist/pregel/utils/index.d.ts +0 -51
- package/dist/pregel/utils/index.d.ts.map +0 -1
- package/dist/pregel/utils/index.js +0 -97
- package/dist/pregel/utils/index.js.map +0 -1
- package/dist/pregel/utils/subgraph.cjs +0 -19
- package/dist/pregel/utils/subgraph.cjs.map +0 -1
- package/dist/pregel/utils/subgraph.js +0 -17
- package/dist/pregel/utils/subgraph.js.map +0 -1
- package/dist/pregel/validate.cjs +0 -45
- package/dist/pregel/validate.cjs.map +0 -1
- package/dist/pregel/validate.js +0 -44
- package/dist/pregel/validate.js.map +0 -1
- package/dist/pregel/write.cjs +0 -97
- package/dist/pregel/write.cjs.map +0 -1
- package/dist/pregel/write.d.cts +0 -35
- package/dist/pregel/write.d.cts.map +0 -1
- package/dist/pregel/write.d.ts +0 -35
- package/dist/pregel/write.d.ts.map +0 -1
- package/dist/pregel/write.js +0 -95
- package/dist/pregel/write.js.map +0 -1
- package/dist/remote.cjs +0 -3
- package/dist/remote.d.cts +0 -2
- package/dist/remote.d.ts +0 -2
- package/dist/remote.js +0 -3
- package/dist/setup/async_local_storage.cjs +0 -12
- package/dist/setup/async_local_storage.cjs.map +0 -1
- package/dist/setup/async_local_storage.js +0 -11
- package/dist/setup/async_local_storage.js.map +0 -1
- package/dist/utils.cjs +0 -88
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -32
- package/dist/utils.d.cts.map +0 -1
- package/dist/utils.d.ts +0 -32
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -81
- package/dist/utils.js.map +0 -1
- package/dist/web.cjs +0 -96
- package/dist/web.d.cts +0 -23
- package/dist/web.d.ts +0 -23
- package/dist/web.js +0 -15
- package/dist/writer.cjs +0 -15
- package/dist/writer.cjs.map +0 -1
- package/dist/writer.d.cts +0 -7
- package/dist/writer.d.cts.map +0 -1
- package/dist/writer.d.ts +0 -7
- package/dist/writer.d.ts.map +0 -1
- package/dist/writer.js +0 -14
- package/dist/writer.js.map +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from "./base.js";
|
|
2
|
-
|
|
3
|
-
//#region src/channels/dynamic_barrier_value.d.ts
|
|
4
|
-
interface WaitForNames<Value> {
|
|
5
|
-
__names: Value[];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* A channel that switches between two states
|
|
9
|
-
*
|
|
10
|
-
* - in the "priming" state it can't be read from.
|
|
11
|
-
* - if it receives a WaitForNames update, it switches to the "waiting" state.
|
|
12
|
-
* - in the "waiting" state it collects named values until all are received.
|
|
13
|
-
* - once all named values are received, it can be read once, and it switches
|
|
14
|
-
* back to the "priming" state.
|
|
15
|
-
*/
|
|
16
|
-
declare class DynamicBarrierValue<Value> extends BaseChannel<void, Value | WaitForNames<Value>, [Value[] | undefined, Value[]]> {
|
|
17
|
-
lc_graph_name: string;
|
|
18
|
-
names?: Set<Value>; // Names of nodes that we want to wait for.
|
|
19
|
-
seen: Set<Value>;
|
|
20
|
-
constructor();
|
|
21
|
-
fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;
|
|
22
|
-
update(values: (Value | WaitForNames<Value>)[]): boolean;
|
|
23
|
-
consume(): boolean;
|
|
24
|
-
// If we have not yet seen all the node names we want to wait for,
|
|
25
|
-
// throw an error to prevent continuing.
|
|
26
|
-
get(): void;
|
|
27
|
-
checkpoint(): [Value[] | undefined, Value[]];
|
|
28
|
-
isAvailable(): boolean;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A channel that switches between two states with an additional finished flag
|
|
32
|
-
*
|
|
33
|
-
* - in the "priming" state it can't be read from.
|
|
34
|
-
* - if it receives a WaitForNames update, it switches to the "waiting" state.
|
|
35
|
-
* - in the "waiting" state it collects named values until all are received.
|
|
36
|
-
* - once all named values are received, and the finished flag is set, it can be read once, and it switches
|
|
37
|
-
* back to the "priming" state.
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
//#endregion
|
|
41
|
-
export { DynamicBarrierValue, WaitForNames };
|
|
42
|
-
//# sourceMappingURL=dynamic_barrier_value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic_barrier_value.d.ts","names":["BaseChannel","WaitForNames","Value","DynamicBarrierValue","Set","DynamicBarrierValueAfterFinish"],"sources":["../../src/channels/dynamic_barrier_value.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\nexport interface WaitForNames<Value> {\n __names: Value[];\n}\n/**\n * A channel that switches between two states\n *\n * - in the \"priming\" state it can't be read from.\n * - if it receives a WaitForNames update, it switches to the \"waiting\" state.\n * - in the \"waiting\" state it collects named values until all are received.\n * - once all named values are received, it can be read once, and it switches\n * back to the \"priming\" state.\n */\nexport declare class DynamicBarrierValue<Value> extends BaseChannel<void, Value | WaitForNames<Value>, [\n Value[] | undefined,\n Value[]\n]> {\n lc_graph_name: string;\n names?: Set<Value>; // Names of nodes that we want to wait for.\n seen: Set<Value>;\n constructor();\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;\n update(values: (Value | WaitForNames<Value>)[]): boolean;\n consume(): boolean;\n // If we have not yet seen all the node names we want to wait for,\n // throw an error to prevent continuing.\n get(): void;\n checkpoint(): [Value[] | undefined, Value[]];\n isAvailable(): boolean;\n}\n/**\n * A channel that switches between two states with an additional finished flag\n *\n * - in the \"priming\" state it can't be read from.\n * - if it receives a WaitForNames update, it switches to the \"waiting\" state.\n * - in the \"waiting\" state it collects named values until all are received.\n * - once all named values are received, and the finished flag is set, it can be read once, and it switches\n * back to the \"priming\" state.\n * @internal\n */\nexport declare class DynamicBarrierValueAfterFinish<Value> extends BaseChannel<void, Value | WaitForNames<Value>, [\n Value[] | undefined,\n Value[],\n boolean\n]> {\n lc_graph_name: string;\n names?: Set<Value>; // Names of nodes that we want to wait for.\n seen: Set<Value>;\n finished: boolean;\n constructor();\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[], boolean]): this;\n update(values: (Value | WaitForNames<Value>)[]): boolean;\n consume(): boolean;\n finish(): boolean;\n get(): void;\n checkpoint(): [Value[] | undefined, Value[], boolean];\n isAvailable(): boolean;\n}\n"],"mappings":";;;UACiBC;WACJC;AADb;AAYA;;;;;;;;;AAMcA,cANOC,mBAMPD,CAAAA,KAAAA,CAAAA,SAN0CF,WAM1CE,CAAAA,IAAAA,EAN4DA,KAM5DA,GANoED,YAMpEC,CANiFA,KAMjFA,CAAAA,EAAAA,CALVA,KAKME,EAAAA,GAAAA,SAAAA,EAJNF,KAM6BA,EAAAA;eACbA,EAAAA,MAAAA;OAAqBA,CAAAA,EAJ7BE,GAI6BF,CAJzBA,KAIyBA,CAAAA,CAAAA,CAAAA;MAAbD,EAHlBG,GAGkBH,CAHdC,KAGcD,CAAAA;aAKTC,CAAAA;gBAAqBA,CAAAA,UAAAA,CAAAA,EAAAA,CANPA,KAMOA,EAAAA,GAAAA,SAAAA,EANcA,KAMdA,EAAAA,CAAAA,CAAAA,EAAAA,IAAAA;QAdgBF,CAAAA,MAAAA,EAAAA,CASpCE,KAToCF,GAS5BC,YAT4BD,CASfE,KATeF,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,OAAAA;;;;;iBAcrCE,qBAAqBA"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
|
|
2
|
-
import { BaseChannel } from "./base.js";
|
|
3
|
-
import { areSetsEqual } from "./named_barrier_value.js";
|
|
4
|
-
|
|
5
|
-
//#region src/channels/dynamic_barrier_value.ts
|
|
6
|
-
function isWaitForNames(v) {
|
|
7
|
-
return v.__names !== void 0;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A channel that switches between two states
|
|
11
|
-
*
|
|
12
|
-
* - in the "priming" state it can't be read from.
|
|
13
|
-
* - if it receives a WaitForNames update, it switches to the "waiting" state.
|
|
14
|
-
* - in the "waiting" state it collects named values until all are received.
|
|
15
|
-
* - once all named values are received, it can be read once, and it switches
|
|
16
|
-
* back to the "priming" state.
|
|
17
|
-
*/
|
|
18
|
-
var DynamicBarrierValue = class DynamicBarrierValue extends BaseChannel {
|
|
19
|
-
lc_graph_name = "DynamicBarrierValue";
|
|
20
|
-
names;
|
|
21
|
-
seen;
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.names = void 0;
|
|
25
|
-
this.seen = /* @__PURE__ */ new Set();
|
|
26
|
-
}
|
|
27
|
-
fromCheckpoint(checkpoint) {
|
|
28
|
-
const empty = new DynamicBarrierValue();
|
|
29
|
-
if (typeof checkpoint !== "undefined") {
|
|
30
|
-
empty.names = new Set(checkpoint[0]);
|
|
31
|
-
empty.seen = new Set(checkpoint[1]);
|
|
32
|
-
}
|
|
33
|
-
return empty;
|
|
34
|
-
}
|
|
35
|
-
update(values) {
|
|
36
|
-
const waitForNames = values.filter(isWaitForNames);
|
|
37
|
-
if (waitForNames.length > 0) {
|
|
38
|
-
if (waitForNames.length > 1) throw new InvalidUpdateError("Received multiple WaitForNames updates in the same step.");
|
|
39
|
-
this.names = new Set(waitForNames[0].__names);
|
|
40
|
-
return true;
|
|
41
|
-
} else if (this.names !== void 0) {
|
|
42
|
-
let updated = false;
|
|
43
|
-
for (const value of values) {
|
|
44
|
-
if (isWaitForNames(value)) throw new Error("Assertion Error: Received unexpected WaitForNames instance.");
|
|
45
|
-
if (this.names.has(value) && !this.seen.has(value)) {
|
|
46
|
-
this.seen.add(value);
|
|
47
|
-
updated = true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return updated;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
consume() {
|
|
55
|
-
if (this.seen && this.names && areSetsEqual(this.seen, this.names)) {
|
|
56
|
-
this.seen = /* @__PURE__ */ new Set();
|
|
57
|
-
this.names = void 0;
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
get() {
|
|
63
|
-
if (!this.names || !areSetsEqual(this.names, this.seen)) throw new EmptyChannelError();
|
|
64
|
-
return void 0;
|
|
65
|
-
}
|
|
66
|
-
checkpoint() {
|
|
67
|
-
return [this.names ? [...this.names] : void 0, [...this.seen]];
|
|
68
|
-
}
|
|
69
|
-
isAvailable() {
|
|
70
|
-
return !!this.names && areSetsEqual(this.names, this.seen);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
export { DynamicBarrierValue };
|
|
76
|
-
//# sourceMappingURL=dynamic_barrier_value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic_barrier_value.js","names":[],"sources":["../../src/channels/dynamic_barrier_value.ts"],"sourcesContent":["import { EmptyChannelError, InvalidUpdateError } from \"../errors.js\";\nimport { BaseChannel } from \"./base.js\";\nimport { areSetsEqual } from \"./named_barrier_value.js\";\n\nexport interface WaitForNames<Value> {\n __names: Value[];\n}\n\nfunction isWaitForNames<Value>(\n v: WaitForNames<Value> | Value\n): v is WaitForNames<Value> {\n return (v as WaitForNames<Value>).__names !== undefined;\n}\n\n/**\n * A channel that switches between two states\n *\n * - in the \"priming\" state it can't be read from.\n * - if it receives a WaitForNames update, it switches to the \"waiting\" state.\n * - in the \"waiting\" state it collects named values until all are received.\n * - once all named values are received, it can be read once, and it switches\n * back to the \"priming\" state.\n */\nexport class DynamicBarrierValue<Value> extends BaseChannel<\n void,\n Value | WaitForNames<Value>,\n [Value[] | undefined, Value[]]\n> {\n lc_graph_name = \"DynamicBarrierValue\";\n\n names?: Set<Value>; // Names of nodes that we want to wait for.\n\n seen: Set<Value>;\n\n constructor() {\n super();\n this.names = undefined;\n this.seen = new Set<Value>();\n }\n\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]) {\n const empty = new DynamicBarrierValue<Value>();\n if (typeof checkpoint !== \"undefined\") {\n empty.names = new Set(checkpoint[0]);\n empty.seen = new Set(checkpoint[1]);\n }\n return empty as this;\n }\n\n update(values: (Value | WaitForNames<Value>)[]): boolean {\n const waitForNames = values.filter(isWaitForNames);\n if (waitForNames.length > 0) {\n if (waitForNames.length > 1) {\n throw new InvalidUpdateError(\n \"Received multiple WaitForNames updates in the same step.\"\n );\n }\n this.names = new Set(waitForNames[0].__names);\n return true;\n } else if (this.names !== undefined) {\n let updated = false;\n for (const value of values) {\n if (isWaitForNames(value)) {\n throw new Error(\n \"Assertion Error: Received unexpected WaitForNames instance.\"\n );\n }\n if (this.names.has(value) && !this.seen.has(value)) {\n this.seen.add(value);\n updated = true;\n }\n }\n return updated;\n }\n return false;\n }\n\n consume(): boolean {\n if (this.seen && this.names && areSetsEqual(this.seen, this.names)) {\n this.seen = new Set<Value>();\n this.names = undefined;\n return true;\n }\n return false;\n }\n\n // If we have not yet seen all the node names we want to wait for,\n // throw an error to prevent continuing.\n get(): void {\n if (!this.names || !areSetsEqual(this.names, this.seen)) {\n throw new EmptyChannelError();\n }\n return undefined;\n }\n\n checkpoint(): [Value[] | undefined, Value[]] {\n return [this.names ? [...this.names] : undefined, [...this.seen]];\n }\n\n isAvailable(): boolean {\n return !!this.names && areSetsEqual(this.names, this.seen);\n }\n}\n\n/**\n * A channel that switches between two states with an additional finished flag\n *\n * - in the \"priming\" state it can't be read from.\n * - if it receives a WaitForNames update, it switches to the \"waiting\" state.\n * - in the \"waiting\" state it collects named values until all are received.\n * - once all named values are received, and the finished flag is set, it can be read once, and it switches\n * back to the \"priming\" state.\n * @internal\n */\nexport class DynamicBarrierValueAfterFinish<Value> extends BaseChannel<\n void,\n Value | WaitForNames<Value>,\n [Value[] | undefined, Value[], boolean]\n> {\n lc_graph_name = \"DynamicBarrierValueAfterFinish\";\n\n names?: Set<Value>; // Names of nodes that we want to wait for.\n\n seen: Set<Value>;\n\n finished: boolean;\n\n constructor() {\n super();\n this.names = undefined;\n this.seen = new Set<Value>();\n this.finished = false;\n }\n\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[], boolean]) {\n const empty = new DynamicBarrierValueAfterFinish<Value>();\n if (typeof checkpoint !== \"undefined\") {\n const [names, seen, finished] = checkpoint;\n empty.names = names ? new Set(names) : undefined;\n empty.seen = new Set(seen);\n empty.finished = finished;\n }\n return empty as this;\n }\n\n update(values: (Value | WaitForNames<Value>)[]): boolean {\n const waitForNames = values.filter(isWaitForNames);\n if (waitForNames.length > 0) {\n if (waitForNames.length > 1) {\n throw new InvalidUpdateError(\n \"Received multiple WaitForNames updates in the same step.\"\n );\n }\n this.names = new Set(waitForNames[0].__names);\n return true;\n } else if (this.names !== undefined) {\n let updated = false;\n for (const value of values) {\n if (isWaitForNames(value)) {\n throw new Error(\n \"Assertion Error: Received unexpected WaitForNames instance.\"\n );\n }\n if (this.names.has(value) && !this.seen.has(value)) {\n this.seen.add(value);\n updated = true;\n }\n }\n return updated;\n }\n return false;\n }\n\n consume(): boolean {\n if (\n this.finished &&\n this.seen &&\n this.names &&\n areSetsEqual(this.seen, this.names)\n ) {\n this.seen = new Set<Value>();\n this.names = undefined;\n this.finished = false;\n return true;\n }\n return false;\n }\n\n finish(): boolean {\n if (!this.finished && this.names && areSetsEqual(this.names, this.seen)) {\n this.finished = true;\n return true;\n }\n return false;\n }\n\n get(): void {\n if (!this.finished || !this.names || !areSetsEqual(this.names, this.seen)) {\n throw new EmptyChannelError();\n }\n return undefined;\n }\n\n checkpoint(): [Value[] | undefined, Value[], boolean] {\n return [\n this.names ? [...this.names] : undefined,\n [...this.seen],\n this.finished,\n ];\n }\n\n isAvailable(): boolean {\n return this.finished && !!this.names && areSetsEqual(this.names, this.seen);\n }\n}\n"],"mappings":";;;;;AAQA,SAAS,eACP,GAC0B;AAC1B,QAAQ,EAA0B,YAAY;;;;;;;;;;;AAYhD,IAAa,sBAAb,MAAa,4BAAmC,YAI9C;CACA,gBAAgB;CAEhB;CAEA;CAEA,cAAc;AACZ;AACA,OAAK,QAAQ;AACb,OAAK,uBAAO,IAAI;;CAGlB,eAAe,YAA6C;EAC1D,MAAM,QAAQ,IAAI;AAClB,MAAI,OAAO,eAAe,aAAa;AACrC,SAAM,QAAQ,IAAI,IAAI,WAAW;AACjC,SAAM,OAAO,IAAI,IAAI,WAAW;;AAElC,SAAO;;CAGT,OAAO,QAAkD;EACvD,MAAM,eAAe,OAAO,OAAO;AACnC,MAAI,aAAa,SAAS,GAAG;AAC3B,OAAI,aAAa,SAAS,EACxB,OAAM,IAAI,mBACR;AAGJ,QAAK,QAAQ,IAAI,IAAI,aAAa,GAAG;AACrC,UAAO;aACE,KAAK,UAAU,QAAW;GACnC,IAAI,UAAU;AACd,QAAK,MAAM,SAAS,QAAQ;AAC1B,QAAI,eAAe,OACjB,OAAM,IAAI,MACR;AAGJ,QAAI,KAAK,MAAM,IAAI,UAAU,CAAC,KAAK,KAAK,IAAI,QAAQ;AAClD,UAAK,KAAK,IAAI;AACd,eAAU;;;AAGd,UAAO;;AAET,SAAO;;CAGT,UAAmB;AACjB,MAAI,KAAK,QAAQ,KAAK,SAAS,aAAa,KAAK,MAAM,KAAK,QAAQ;AAClE,QAAK,uBAAO,IAAI;AAChB,QAAK,QAAQ;AACb,UAAO;;AAET,SAAO;;CAKT,MAAY;AACV,MAAI,CAAC,KAAK,SAAS,CAAC,aAAa,KAAK,OAAO,KAAK,MAChD,OAAM,IAAI;AAEZ,SAAO;;CAGT,aAA6C;AAC3C,SAAO,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,SAAS,QAAW,CAAC,GAAG,KAAK;;CAG7D,cAAuB;AACrB,SAAO,CAAC,CAAC,KAAK,SAAS,aAAa,KAAK,OAAO,KAAK"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const require_errors = require('../errors.cjs');
|
|
2
|
-
const require_base = require('./base.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/channels/ephemeral_value.ts
|
|
5
|
-
/**
|
|
6
|
-
* Stores the value received in the step immediately preceding, clears after.
|
|
7
|
-
*/
|
|
8
|
-
var EphemeralValue = class EphemeralValue extends require_base.BaseChannel {
|
|
9
|
-
lc_graph_name = "EphemeralValue";
|
|
10
|
-
guard;
|
|
11
|
-
value = [];
|
|
12
|
-
constructor(guard = true) {
|
|
13
|
-
super();
|
|
14
|
-
this.guard = guard;
|
|
15
|
-
}
|
|
16
|
-
fromCheckpoint(checkpoint) {
|
|
17
|
-
const empty = new EphemeralValue(this.guard);
|
|
18
|
-
if (typeof checkpoint !== "undefined") empty.value = [checkpoint];
|
|
19
|
-
return empty;
|
|
20
|
-
}
|
|
21
|
-
update(values) {
|
|
22
|
-
if (values.length === 0) {
|
|
23
|
-
const updated = this.value.length > 0;
|
|
24
|
-
this.value = [];
|
|
25
|
-
return updated;
|
|
26
|
-
}
|
|
27
|
-
if (values.length !== 1 && this.guard) throw new require_errors.InvalidUpdateError("EphemeralValue can only receive one value per step.");
|
|
28
|
-
this.value = [values[values.length - 1]];
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
get() {
|
|
32
|
-
if (this.value.length === 0) throw new require_errors.EmptyChannelError();
|
|
33
|
-
return this.value[0];
|
|
34
|
-
}
|
|
35
|
-
checkpoint() {
|
|
36
|
-
if (this.value.length === 0) throw new require_errors.EmptyChannelError();
|
|
37
|
-
return this.value[0];
|
|
38
|
-
}
|
|
39
|
-
isAvailable() {
|
|
40
|
-
return this.value.length !== 0;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
exports.EphemeralValue = EphemeralValue;
|
|
46
|
-
//# sourceMappingURL=ephemeral_value.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ephemeral_value.cjs","names":["BaseChannel","InvalidUpdateError","EmptyChannelError"],"sources":["../../src/channels/ephemeral_value.ts"],"sourcesContent":["import { EmptyChannelError, InvalidUpdateError } from \"../errors.js\";\nimport { BaseChannel } from \"./base.js\";\n\n/**\n * Stores the value received in the step immediately preceding, clears after.\n */\nexport class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {\n lc_graph_name = \"EphemeralValue\";\n\n guard: boolean;\n\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [] = [];\n\n constructor(guard: boolean = true) {\n super();\n this.guard = guard;\n }\n\n fromCheckpoint(checkpoint?: Value) {\n const empty = new EphemeralValue<Value>(this.guard);\n if (typeof checkpoint !== \"undefined\") {\n empty.value = [checkpoint];\n }\n return empty as this;\n }\n\n update(values: Value[]): boolean {\n if (values.length === 0) {\n const updated = this.value.length > 0;\n // If there are no updates for this specific channel at the end of the step, wipe it.\n this.value = [];\n return updated;\n }\n if (values.length !== 1 && this.guard) {\n throw new InvalidUpdateError(\n \"EphemeralValue can only receive one value per step.\"\n );\n }\n\n // eslint-disable-next-line prefer-destructuring\n this.value = [values[values.length - 1]];\n return true;\n }\n\n get(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n checkpoint(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n isAvailable(): boolean {\n return this.value.length !== 0;\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAa,iBAAb,MAAa,uBAA8BA,yBAAiC;CAC1E,gBAAgB;CAEhB;CAGA,QAAsB;CAEtB,YAAY,QAAiB,MAAM;AACjC;AACA,OAAK,QAAQ;;CAGf,eAAe,YAAoB;EACjC,MAAM,QAAQ,IAAI,eAAsB,KAAK;AAC7C,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ,CAAC;AAEjB,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,GAAG;GACvB,MAAM,UAAU,KAAK,MAAM,SAAS;AAEpC,QAAK,QAAQ;AACb,UAAO;;AAET,MAAI,OAAO,WAAW,KAAK,KAAK,MAC9B,OAAM,IAAIC,kCACR;AAKJ,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS;AACrC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIC;AAEZ,SAAO,KAAK,MAAM;;CAGpB,aAAoB;AAClB,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIA;AAEZ,SAAO,KAAK,MAAM;;CAGpB,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from "./base.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/channels/ephemeral_value.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stores the value received in the step immediately preceding, clears after.
|
|
7
|
-
*/
|
|
8
|
-
declare class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {
|
|
9
|
-
lc_graph_name: string;
|
|
10
|
-
guard: boolean;
|
|
11
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
12
|
-
value: [Value] | [];
|
|
13
|
-
constructor(guard?: boolean);
|
|
14
|
-
fromCheckpoint(checkpoint?: Value): this;
|
|
15
|
-
update(values: Value[]): boolean;
|
|
16
|
-
get(): Value;
|
|
17
|
-
checkpoint(): Value;
|
|
18
|
-
isAvailable(): boolean;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { EphemeralValue };
|
|
22
|
-
//# sourceMappingURL=ephemeral_value.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ephemeral_value.d.cts","names":["BaseChannel","EphemeralValue","Value"],"sources":["../../src/channels/ephemeral_value.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\n/**\n * Stores the value received in the step immediately preceding, clears after.\n */\nexport declare class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {\n lc_graph_name: string;\n guard: boolean;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n constructor(guard?: boolean);\n fromCheckpoint(checkpoint?: Value): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): Value;\n isAvailable(): boolean;\n}\n"],"mappings":";;;;;;AAIA;AAAmC,cAAdC,cAAc,CAAA,KAAA,CAAA,SAAgBD,WAAhB,CAA4BE,KAA5B,EAAmCA,KAAnC,EAA0CA,KAA1C,CAAA,CAAA;eAA4BA,EAAAA,MAAAA;OAAOA,EAAAA,OAAAA;;OAI1DA,EAAAA,CAAAA,KAAAA,CAAAA,GAAAA,EAAAA;aAEoBA,CAAAA,KAAAA,CAAAA,EAAAA,OAAAA;gBACbA,CAAAA,UAAAA,CAAAA,EADaA,KACbA,CAAAA,EAAAA,IAAAA;QACRA,CAAAA,MAAAA,EADQA,KACRA,EAAAA,CAAAA,EAAAA,OAAAA;KACOA,CAAAA,CAAAA,EADPA,KACOA;YATiCF,CAAAA,CAAAA,EASjCE,KATiCF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from "./base.js";
|
|
2
|
-
|
|
3
|
-
//#region src/channels/ephemeral_value.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stores the value received in the step immediately preceding, clears after.
|
|
7
|
-
*/
|
|
8
|
-
declare class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {
|
|
9
|
-
lc_graph_name: string;
|
|
10
|
-
guard: boolean;
|
|
11
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
12
|
-
value: [Value] | [];
|
|
13
|
-
constructor(guard?: boolean);
|
|
14
|
-
fromCheckpoint(checkpoint?: Value): this;
|
|
15
|
-
update(values: Value[]): boolean;
|
|
16
|
-
get(): Value;
|
|
17
|
-
checkpoint(): Value;
|
|
18
|
-
isAvailable(): boolean;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { EphemeralValue };
|
|
22
|
-
//# sourceMappingURL=ephemeral_value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ephemeral_value.d.ts","names":["BaseChannel","EphemeralValue","Value"],"sources":["../../src/channels/ephemeral_value.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\n/**\n * Stores the value received in the step immediately preceding, clears after.\n */\nexport declare class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {\n lc_graph_name: string;\n guard: boolean;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n constructor(guard?: boolean);\n fromCheckpoint(checkpoint?: Value): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): Value;\n isAvailable(): boolean;\n}\n"],"mappings":";;;;;;AAIA;AAAmC,cAAdC,cAAc,CAAA,KAAA,CAAA,SAAgBD,WAAhB,CAA4BE,KAA5B,EAAmCA,KAAnC,EAA0CA,KAA1C,CAAA,CAAA;eAA4BA,EAAAA,MAAAA;OAAOA,EAAAA,OAAAA;;OAI1DA,EAAAA,CAAAA,KAAAA,CAAAA,GAAAA,EAAAA;aAEoBA,CAAAA,KAAAA,CAAAA,EAAAA,OAAAA;gBACbA,CAAAA,UAAAA,CAAAA,EADaA,KACbA,CAAAA,EAAAA,IAAAA;QACRA,CAAAA,MAAAA,EADQA,KACRA,EAAAA,CAAAA,EAAAA,OAAAA;KACOA,CAAAA,CAAAA,EADPA,KACOA;YATiCF,CAAAA,CAAAA,EASjCE,KATiCF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
|
|
2
|
-
import { BaseChannel } from "./base.js";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/ephemeral_value.ts
|
|
5
|
-
/**
|
|
6
|
-
* Stores the value received in the step immediately preceding, clears after.
|
|
7
|
-
*/
|
|
8
|
-
var EphemeralValue = class EphemeralValue extends BaseChannel {
|
|
9
|
-
lc_graph_name = "EphemeralValue";
|
|
10
|
-
guard;
|
|
11
|
-
value = [];
|
|
12
|
-
constructor(guard = true) {
|
|
13
|
-
super();
|
|
14
|
-
this.guard = guard;
|
|
15
|
-
}
|
|
16
|
-
fromCheckpoint(checkpoint) {
|
|
17
|
-
const empty = new EphemeralValue(this.guard);
|
|
18
|
-
if (typeof checkpoint !== "undefined") empty.value = [checkpoint];
|
|
19
|
-
return empty;
|
|
20
|
-
}
|
|
21
|
-
update(values) {
|
|
22
|
-
if (values.length === 0) {
|
|
23
|
-
const updated = this.value.length > 0;
|
|
24
|
-
this.value = [];
|
|
25
|
-
return updated;
|
|
26
|
-
}
|
|
27
|
-
if (values.length !== 1 && this.guard) throw new InvalidUpdateError("EphemeralValue can only receive one value per step.");
|
|
28
|
-
this.value = [values[values.length - 1]];
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
get() {
|
|
32
|
-
if (this.value.length === 0) throw new EmptyChannelError();
|
|
33
|
-
return this.value[0];
|
|
34
|
-
}
|
|
35
|
-
checkpoint() {
|
|
36
|
-
if (this.value.length === 0) throw new EmptyChannelError();
|
|
37
|
-
return this.value[0];
|
|
38
|
-
}
|
|
39
|
-
isAvailable() {
|
|
40
|
-
return this.value.length !== 0;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
export { EphemeralValue };
|
|
46
|
-
//# sourceMappingURL=ephemeral_value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ephemeral_value.js","names":[],"sources":["../../src/channels/ephemeral_value.ts"],"sourcesContent":["import { EmptyChannelError, InvalidUpdateError } from \"../errors.js\";\nimport { BaseChannel } from \"./base.js\";\n\n/**\n * Stores the value received in the step immediately preceding, clears after.\n */\nexport class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {\n lc_graph_name = \"EphemeralValue\";\n\n guard: boolean;\n\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [] = [];\n\n constructor(guard: boolean = true) {\n super();\n this.guard = guard;\n }\n\n fromCheckpoint(checkpoint?: Value) {\n const empty = new EphemeralValue<Value>(this.guard);\n if (typeof checkpoint !== \"undefined\") {\n empty.value = [checkpoint];\n }\n return empty as this;\n }\n\n update(values: Value[]): boolean {\n if (values.length === 0) {\n const updated = this.value.length > 0;\n // If there are no updates for this specific channel at the end of the step, wipe it.\n this.value = [];\n return updated;\n }\n if (values.length !== 1 && this.guard) {\n throw new InvalidUpdateError(\n \"EphemeralValue can only receive one value per step.\"\n );\n }\n\n // eslint-disable-next-line prefer-destructuring\n this.value = [values[values.length - 1]];\n return true;\n }\n\n get(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n checkpoint(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n isAvailable(): boolean {\n return this.value.length !== 0;\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAa,iBAAb,MAAa,uBAA8B,YAAiC;CAC1E,gBAAgB;CAEhB;CAGA,QAAsB;CAEtB,YAAY,QAAiB,MAAM;AACjC;AACA,OAAK,QAAQ;;CAGf,eAAe,YAAoB;EACjC,MAAM,QAAQ,IAAI,eAAsB,KAAK;AAC7C,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ,CAAC;AAEjB,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,GAAG;GACvB,MAAM,UAAU,KAAK,MAAM,SAAS;AAEpC,QAAK,QAAQ;AACb,UAAO;;AAET,MAAI,OAAO,WAAW,KAAK,KAAK,MAC9B,OAAM,IAAI,mBACR;AAKJ,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS;AACrC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAI;AAEZ,SAAO,KAAK,MAAM;;CAGpB,aAAoB;AAClB,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAI;AAEZ,SAAO,KAAK,MAAM;;CAGpB,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW"}
|
package/dist/channels/index.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const require_base = require('./base.cjs');
|
|
2
|
-
const require_binop = require('./binop.cjs');
|
|
3
|
-
const require_last_value = require('./last_value.cjs');
|
|
4
|
-
const require_topic = require('./topic.cjs');
|
|
5
|
-
const require_ephemeral_value = require('./ephemeral_value.cjs');
|
|
6
|
-
const require_named_barrier_value = require('./named_barrier_value.cjs');
|
|
7
|
-
const require_any_value = require('./any_value.cjs');
|
|
8
|
-
const require_dynamic_barrier_value = require('./dynamic_barrier_value.cjs');
|
|
9
|
-
|
|
10
|
-
exports.AnyValue = require_any_value.AnyValue;
|
|
11
|
-
exports.BaseChannel = require_base.BaseChannel;
|
|
12
|
-
exports.BinaryOperatorAggregate = require_binop.BinaryOperatorAggregate;
|
|
13
|
-
exports.DynamicBarrierValue = require_dynamic_barrier_value.DynamicBarrierValue;
|
|
14
|
-
exports.EphemeralValue = require_ephemeral_value.EphemeralValue;
|
|
15
|
-
exports.LastValue = require_last_value.LastValue;
|
|
16
|
-
exports.LastValueAfterFinish = require_last_value.LastValueAfterFinish;
|
|
17
|
-
exports.NamedBarrierValue = require_named_barrier_value.NamedBarrierValue;
|
|
18
|
-
exports.NamedBarrierValueAfterFinish = require_named_barrier_value.NamedBarrierValueAfterFinish;
|
|
19
|
-
exports.Topic = require_topic.Topic;
|
|
20
|
-
exports.createCheckpoint = require_base.createCheckpoint;
|
|
21
|
-
exports.empty = require_base.emptyChannels;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseChannel, createCheckpoint, emptyChannels } from "./base.cjs";
|
|
2
|
-
import { BinaryOperator, BinaryOperatorAggregate } from "./binop.cjs";
|
|
3
|
-
import { AnyValue } from "./any_value.cjs";
|
|
4
|
-
import { LastValue, LastValueAfterFinish } from "./last_value.cjs";
|
|
5
|
-
import { DynamicBarrierValue, WaitForNames } from "./dynamic_barrier_value.cjs";
|
|
6
|
-
import { EphemeralValue } from "./ephemeral_value.cjs";
|
|
7
|
-
import { NamedBarrierValue, NamedBarrierValueAfterFinish } from "./named_barrier_value.cjs";
|
|
8
|
-
import { Topic } from "./topic.cjs";
|
|
9
|
-
export { AnyValue, BaseChannel, type BinaryOperator, BinaryOperatorAggregate, DynamicBarrierValue, EphemeralValue, LastValue, LastValueAfterFinish, NamedBarrierValue, NamedBarrierValueAfterFinish, Topic, type WaitForNames, createCheckpoint, emptyChannels as empty };
|
package/dist/channels/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseChannel, createCheckpoint, emptyChannels } from "./base.js";
|
|
2
|
-
import { BinaryOperator, BinaryOperatorAggregate } from "./binop.js";
|
|
3
|
-
import { AnyValue } from "./any_value.js";
|
|
4
|
-
import { LastValue, LastValueAfterFinish } from "./last_value.js";
|
|
5
|
-
import { DynamicBarrierValue, WaitForNames } from "./dynamic_barrier_value.js";
|
|
6
|
-
import { EphemeralValue } from "./ephemeral_value.js";
|
|
7
|
-
import { NamedBarrierValue, NamedBarrierValueAfterFinish } from "./named_barrier_value.js";
|
|
8
|
-
import { Topic } from "./topic.js";
|
|
9
|
-
export { AnyValue, BaseChannel, type BinaryOperator, BinaryOperatorAggregate, DynamicBarrierValue, EphemeralValue, LastValue, LastValueAfterFinish, NamedBarrierValue, NamedBarrierValueAfterFinish, Topic, type WaitForNames, createCheckpoint, emptyChannels as empty };
|
package/dist/channels/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseChannel, createCheckpoint, emptyChannels } from "./base.js";
|
|
2
|
-
import { BinaryOperatorAggregate } from "./binop.js";
|
|
3
|
-
import { LastValue, LastValueAfterFinish } from "./last_value.js";
|
|
4
|
-
import { Topic } from "./topic.js";
|
|
5
|
-
import { EphemeralValue } from "./ephemeral_value.js";
|
|
6
|
-
import { NamedBarrierValue, NamedBarrierValueAfterFinish } from "./named_barrier_value.js";
|
|
7
|
-
import { AnyValue } from "./any_value.js";
|
|
8
|
-
import { DynamicBarrierValue } from "./dynamic_barrier_value.js";
|
|
9
|
-
|
|
10
|
-
export { AnyValue, BaseChannel, BinaryOperatorAggregate, DynamicBarrierValue, EphemeralValue, LastValue, LastValueAfterFinish, NamedBarrierValue, NamedBarrierValueAfterFinish, Topic, createCheckpoint, emptyChannels as empty };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
const require_errors = require('../errors.cjs');
|
|
2
|
-
const require_base = require('./base.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/channels/last_value.ts
|
|
5
|
-
/**
|
|
6
|
-
* Stores the last value received, can receive at most one value per step.
|
|
7
|
-
*
|
|
8
|
-
* Since `update` is only called once per step and value can only be of length 1,
|
|
9
|
-
* LastValue always stores the last value of a single node. If multiple nodes attempt to
|
|
10
|
-
* write to this channel in a single step, an error will be thrown.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
var LastValue = class LastValue extends require_base.BaseChannel {
|
|
14
|
-
lc_graph_name = "LastValue";
|
|
15
|
-
value = [];
|
|
16
|
-
constructor(initialValueFactory) {
|
|
17
|
-
super();
|
|
18
|
-
this.initialValueFactory = initialValueFactory;
|
|
19
|
-
if (initialValueFactory) this.value = [initialValueFactory()];
|
|
20
|
-
}
|
|
21
|
-
fromCheckpoint(checkpoint) {
|
|
22
|
-
const empty = new LastValue(this.initialValueFactory);
|
|
23
|
-
if (typeof checkpoint !== "undefined") empty.value = [checkpoint];
|
|
24
|
-
return empty;
|
|
25
|
-
}
|
|
26
|
-
update(values) {
|
|
27
|
-
if (values.length === 0) return false;
|
|
28
|
-
if (values.length !== 1) throw new require_errors.InvalidUpdateError("LastValue can only receive one value per step.", { lc_error_code: "INVALID_CONCURRENT_GRAPH_UPDATE" });
|
|
29
|
-
this.value = [values[values.length - 1]];
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
get() {
|
|
33
|
-
if (this.value.length === 0) throw new require_errors.EmptyChannelError();
|
|
34
|
-
return this.value[0];
|
|
35
|
-
}
|
|
36
|
-
checkpoint() {
|
|
37
|
-
if (this.value.length === 0) throw new require_errors.EmptyChannelError();
|
|
38
|
-
return this.value[0];
|
|
39
|
-
}
|
|
40
|
-
isAvailable() {
|
|
41
|
-
return this.value.length !== 0;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Stores the last value received, but only made available after finish().
|
|
46
|
-
* Once made available, clears the value.
|
|
47
|
-
*/
|
|
48
|
-
var LastValueAfterFinish = class LastValueAfterFinish extends require_base.BaseChannel {
|
|
49
|
-
lc_graph_name = "LastValueAfterFinish";
|
|
50
|
-
value = [];
|
|
51
|
-
finished = false;
|
|
52
|
-
fromCheckpoint(checkpoint) {
|
|
53
|
-
const empty = new LastValueAfterFinish();
|
|
54
|
-
if (typeof checkpoint !== "undefined") {
|
|
55
|
-
const [value, finished] = checkpoint;
|
|
56
|
-
empty.value = [value];
|
|
57
|
-
empty.finished = finished;
|
|
58
|
-
}
|
|
59
|
-
return empty;
|
|
60
|
-
}
|
|
61
|
-
update(values) {
|
|
62
|
-
if (values.length === 0) return false;
|
|
63
|
-
this.finished = false;
|
|
64
|
-
this.value = [values[values.length - 1]];
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
get() {
|
|
68
|
-
if (this.value.length === 0 || !this.finished) throw new require_errors.EmptyChannelError();
|
|
69
|
-
return this.value[0];
|
|
70
|
-
}
|
|
71
|
-
checkpoint() {
|
|
72
|
-
if (this.value.length === 0) return void 0;
|
|
73
|
-
return [this.value[0], this.finished];
|
|
74
|
-
}
|
|
75
|
-
consume() {
|
|
76
|
-
if (this.finished) {
|
|
77
|
-
this.finished = false;
|
|
78
|
-
this.value = [];
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
finish() {
|
|
84
|
-
if (!this.finished && this.value.length > 0) {
|
|
85
|
-
this.finished = true;
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
isAvailable() {
|
|
91
|
-
return this.value.length !== 0 && this.finished;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
exports.LastValue = LastValue;
|
|
97
|
-
exports.LastValueAfterFinish = LastValueAfterFinish;
|
|
98
|
-
//# sourceMappingURL=last_value.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"last_value.cjs","names":["BaseChannel","initialValueFactory?: () => Value","InvalidUpdateError","EmptyChannelError"],"sources":["../../src/channels/last_value.ts"],"sourcesContent":["import { EmptyChannelError, InvalidUpdateError } from \"../errors.js\";\nimport { BaseChannel } from \"./base.js\";\n\n/**\n * Stores the last value received, can receive at most one value per step.\n *\n * Since `update` is only called once per step and value can only be of length 1,\n * LastValue always stores the last value of a single node. If multiple nodes attempt to\n * write to this channel in a single step, an error will be thrown.\n * @internal\n */\nexport class LastValue<Value> extends BaseChannel<Value, Value, Value> {\n lc_graph_name = \"LastValue\";\n\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [] = [];\n\n constructor(protected initialValueFactory?: () => Value) {\n super();\n if (initialValueFactory) {\n this.value = [initialValueFactory()];\n }\n }\n\n fromCheckpoint(checkpoint?: Value) {\n const empty = new LastValue<Value>(this.initialValueFactory);\n if (typeof checkpoint !== \"undefined\") {\n empty.value = [checkpoint];\n }\n\n return empty as this;\n }\n\n update(values: Value[]): boolean {\n if (values.length === 0) {\n return false;\n }\n if (values.length !== 1) {\n throw new InvalidUpdateError(\n \"LastValue can only receive one value per step.\",\n { lc_error_code: \"INVALID_CONCURRENT_GRAPH_UPDATE\" }\n );\n }\n\n // eslint-disable-next-line prefer-destructuring\n this.value = [values[values.length - 1]];\n return true;\n }\n\n get(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n checkpoint(): Value {\n if (this.value.length === 0) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n isAvailable(): boolean {\n return this.value.length !== 0;\n }\n}\n\n/**\n * Stores the last value received, but only made available after finish().\n * Once made available, clears the value.\n */\nexport class LastValueAfterFinish<Value> extends BaseChannel<\n Value,\n Value,\n [Value, boolean]\n> {\n lc_graph_name = \"LastValueAfterFinish\";\n\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [] = [];\n\n finished: boolean = false;\n\n fromCheckpoint(checkpoint?: [Value, boolean]) {\n const empty = new LastValueAfterFinish<Value>();\n if (typeof checkpoint !== \"undefined\") {\n const [value, finished] = checkpoint;\n empty.value = [value];\n empty.finished = finished;\n }\n return empty as this;\n }\n\n update(values: Value[]): boolean {\n if (values.length === 0) {\n return false;\n }\n\n this.finished = false;\n // eslint-disable-next-line prefer-destructuring\n this.value = [values[values.length - 1]];\n return true;\n }\n\n get(): Value {\n if (this.value.length === 0 || !this.finished) {\n throw new EmptyChannelError();\n }\n return this.value[0];\n }\n\n checkpoint(): [Value, boolean] | undefined {\n if (this.value.length === 0) return undefined;\n return [this.value[0], this.finished];\n }\n\n consume(): boolean {\n if (this.finished) {\n this.finished = false;\n this.value = [];\n return true;\n }\n return false;\n }\n\n finish(): boolean {\n if (!this.finished && this.value.length > 0) {\n this.finished = true;\n return true;\n }\n return false;\n }\n\n isAvailable(): boolean {\n return this.value.length !== 0 && this.finished;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAWA,IAAa,YAAb,MAAa,kBAAyBA,yBAAiC;CACrE,gBAAgB;CAGhB,QAAsB;CAEtB,YAAY,AAAUC,qBAAmC;AACvD;EADoB;AAEpB,MAAI,oBACF,MAAK,QAAQ,CAAC;;CAIlB,eAAe,YAAoB;EACjC,MAAM,QAAQ,IAAI,UAAiB,KAAK;AACxC,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ,CAAC;AAGjB,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,EACpB,QAAO;AAET,MAAI,OAAO,WAAW,EACpB,OAAM,IAAIC,kCACR,kDACA,EAAE,eAAe;AAKrB,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS;AACrC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIC;AAEZ,SAAO,KAAK,MAAM;;CAGpB,aAAoB;AAClB,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIA;AAEZ,SAAO,KAAK,MAAM;;CAGpB,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW;;;;;;;AAQjC,IAAa,uBAAb,MAAa,6BAAoCH,yBAI/C;CACA,gBAAgB;CAGhB,QAAsB;CAEtB,WAAoB;CAEpB,eAAe,YAA+B;EAC5C,MAAM,QAAQ,IAAI;AAClB,MAAI,OAAO,eAAe,aAAa;GACrC,MAAM,CAAC,OAAO,YAAY;AAC1B,SAAM,QAAQ,CAAC;AACf,SAAM,WAAW;;AAEnB,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,EACpB,QAAO;AAGT,OAAK,WAAW;AAEhB,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS;AACrC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,KAAK,CAAC,KAAK,SACnC,OAAM,IAAIG;AAEZ,SAAO,KAAK,MAAM;;CAGpB,aAA2C;AACzC,MAAI,KAAK,MAAM,WAAW,EAAG,QAAO;AACpC,SAAO,CAAC,KAAK,MAAM,IAAI,KAAK;;CAG9B,UAAmB;AACjB,MAAI,KAAK,UAAU;AACjB,QAAK,WAAW;AAChB,QAAK,QAAQ;AACb,UAAO;;AAET,SAAO;;CAGT,SAAkB;AAChB,MAAI,CAAC,KAAK,YAAY,KAAK,MAAM,SAAS,GAAG;AAC3C,QAAK,WAAW;AAChB,UAAO;;AAET,SAAO;;CAGT,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW,KAAK,KAAK"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from "./base.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/channels/last_value.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stores the last value received, can receive at most one value per step.
|
|
7
|
-
*
|
|
8
|
-
* Since `update` is only called once per step and value can only be of length 1,
|
|
9
|
-
* LastValue always stores the last value of a single node. If multiple nodes attempt to
|
|
10
|
-
* write to this channel in a single step, an error will be thrown.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
declare class LastValue<Value> extends BaseChannel<Value, Value, Value> {
|
|
14
|
-
protected initialValueFactory?: (() => Value) | undefined;
|
|
15
|
-
lc_graph_name: string;
|
|
16
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
17
|
-
value: [Value] | [];
|
|
18
|
-
constructor(initialValueFactory?: (() => Value) | undefined);
|
|
19
|
-
fromCheckpoint(checkpoint?: Value): this;
|
|
20
|
-
update(values: Value[]): boolean;
|
|
21
|
-
get(): Value;
|
|
22
|
-
checkpoint(): Value;
|
|
23
|
-
isAvailable(): boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Stores the last value received, but only made available after finish().
|
|
27
|
-
* Once made available, clears the value.
|
|
28
|
-
*/
|
|
29
|
-
declare class LastValueAfterFinish<Value> extends BaseChannel<Value, Value, [Value, boolean]> {
|
|
30
|
-
lc_graph_name: string;
|
|
31
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
32
|
-
value: [Value] | [];
|
|
33
|
-
finished: boolean;
|
|
34
|
-
fromCheckpoint(checkpoint?: [Value, boolean]): this;
|
|
35
|
-
update(values: Value[]): boolean;
|
|
36
|
-
get(): Value;
|
|
37
|
-
checkpoint(): [Value, boolean] | undefined;
|
|
38
|
-
consume(): boolean;
|
|
39
|
-
finish(): boolean;
|
|
40
|
-
isAvailable(): boolean;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { LastValue, LastValueAfterFinish };
|
|
44
|
-
//# sourceMappingURL=last_value.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"last_value.d.cts","names":["BaseChannel","LastValue","Value","LastValueAfterFinish"],"sources":["../../src/channels/last_value.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\n/**\n * Stores the last value received, can receive at most one value per step.\n *\n * Since `update` is only called once per step and value can only be of length 1,\n * LastValue always stores the last value of a single node. If multiple nodes attempt to\n * write to this channel in a single step, an error will be thrown.\n * @internal\n */\nexport declare class LastValue<Value> extends BaseChannel<Value, Value, Value> {\n protected initialValueFactory?: (() => Value) | undefined;\n lc_graph_name: string;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n constructor(initialValueFactory?: (() => Value) | undefined);\n fromCheckpoint(checkpoint?: Value): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): Value;\n isAvailable(): boolean;\n}\n/**\n * Stores the last value received, but only made available after finish().\n * Once made available, clears the value.\n */\nexport declare class LastValueAfterFinish<Value> extends BaseChannel<Value, Value, [\n Value,\n boolean\n]> {\n lc_graph_name: string;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n finished: boolean;\n fromCheckpoint(checkpoint?: [Value, boolean]): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): [Value, boolean] | undefined;\n consume(): boolean;\n finish(): boolean;\n isAvailable(): boolean;\n}\n"],"mappings":";;;;;;AASA;;;;;;AAIYE,cAJSD,SAITC,CAAAA,KAAAA,CAAAA,SAJkCF,WAIlCE,CAJ8CA,KAI9CA,EAJqDA,KAIrDA,EAJ4DA,KAI5DA,CAAAA,CAAAA;YACiCA,mBAAAA,CAAAA,EAAAA,CAAAA,GAAAA,GAJFA,KAIEA,CAAAA,GAAAA,SAAAA;eACbA,EAAAA,MAAAA;;OAErBA,EAAAA,CAJCA,KAIDA,CAAAA,GAAAA,EAAAA;aACOA,CAAAA,mBAAAA,CAAAA,EAAAA,CAAAA,GAAAA,GAJ2BA,KAI3BA,CAAAA,GAAAA,SAAAA;gBAT4BF,CAAAA,UAAAA,CAAAA,EAMdE,KANcF,CAAAA,EAAAA,IAAAA;iBAO3BE;EASEC,GAAAA,CAAAA,CAAAA,EARVD,KAQUC;EAAoB,UAAA,CAAA,CAAA,EAPvBD,KAOuB;aAA4BA,CAAAA,CAAAA,EAAAA,OAAAA;;;;;;AAU1DA,cAVUC,oBAUVD,CAAAA,KAAAA,CAAAA,SAV8CF,WAU9CE,CAV0DA,KAU1DA,EAViEA,KAUjEA,EAAAA,CATPA,KAUeA,SAXsCF;;;UAM7CE;;+BAEqBA;iBACdA;SACRA;iBACQA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from "./base.js";
|
|
2
|
-
|
|
3
|
-
//#region src/channels/last_value.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stores the last value received, can receive at most one value per step.
|
|
7
|
-
*
|
|
8
|
-
* Since `update` is only called once per step and value can only be of length 1,
|
|
9
|
-
* LastValue always stores the last value of a single node. If multiple nodes attempt to
|
|
10
|
-
* write to this channel in a single step, an error will be thrown.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
declare class LastValue<Value> extends BaseChannel<Value, Value, Value> {
|
|
14
|
-
protected initialValueFactory?: (() => Value) | undefined;
|
|
15
|
-
lc_graph_name: string;
|
|
16
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
17
|
-
value: [Value] | [];
|
|
18
|
-
constructor(initialValueFactory?: (() => Value) | undefined);
|
|
19
|
-
fromCheckpoint(checkpoint?: Value): this;
|
|
20
|
-
update(values: Value[]): boolean;
|
|
21
|
-
get(): Value;
|
|
22
|
-
checkpoint(): Value;
|
|
23
|
-
isAvailable(): boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Stores the last value received, but only made available after finish().
|
|
27
|
-
* Once made available, clears the value.
|
|
28
|
-
*/
|
|
29
|
-
declare class LastValueAfterFinish<Value> extends BaseChannel<Value, Value, [Value, boolean]> {
|
|
30
|
-
lc_graph_name: string;
|
|
31
|
-
// value is an array so we don't misinterpret an update to undefined as no write
|
|
32
|
-
value: [Value] | [];
|
|
33
|
-
finished: boolean;
|
|
34
|
-
fromCheckpoint(checkpoint?: [Value, boolean]): this;
|
|
35
|
-
update(values: Value[]): boolean;
|
|
36
|
-
get(): Value;
|
|
37
|
-
checkpoint(): [Value, boolean] | undefined;
|
|
38
|
-
consume(): boolean;
|
|
39
|
-
finish(): boolean;
|
|
40
|
-
isAvailable(): boolean;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { LastValue, LastValueAfterFinish };
|
|
44
|
-
//# sourceMappingURL=last_value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"last_value.d.ts","names":["BaseChannel","LastValue","Value","LastValueAfterFinish"],"sources":["../../src/channels/last_value.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\n/**\n * Stores the last value received, can receive at most one value per step.\n *\n * Since `update` is only called once per step and value can only be of length 1,\n * LastValue always stores the last value of a single node. If multiple nodes attempt to\n * write to this channel in a single step, an error will be thrown.\n * @internal\n */\nexport declare class LastValue<Value> extends BaseChannel<Value, Value, Value> {\n protected initialValueFactory?: (() => Value) | undefined;\n lc_graph_name: string;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n constructor(initialValueFactory?: (() => Value) | undefined);\n fromCheckpoint(checkpoint?: Value): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): Value;\n isAvailable(): boolean;\n}\n/**\n * Stores the last value received, but only made available after finish().\n * Once made available, clears the value.\n */\nexport declare class LastValueAfterFinish<Value> extends BaseChannel<Value, Value, [\n Value,\n boolean\n]> {\n lc_graph_name: string;\n // value is an array so we don't misinterpret an update to undefined as no write\n value: [Value] | [];\n finished: boolean;\n fromCheckpoint(checkpoint?: [Value, boolean]): this;\n update(values: Value[]): boolean;\n get(): Value;\n checkpoint(): [Value, boolean] | undefined;\n consume(): boolean;\n finish(): boolean;\n isAvailable(): boolean;\n}\n"],"mappings":";;;;;;AASA;;;;;;AAIYE,cAJSD,SAITC,CAAAA,KAAAA,CAAAA,SAJkCF,WAIlCE,CAJ8CA,KAI9CA,EAJqDA,KAIrDA,EAJ4DA,KAI5DA,CAAAA,CAAAA;YACiCA,mBAAAA,CAAAA,EAAAA,CAAAA,GAAAA,GAJFA,KAIEA,CAAAA,GAAAA,SAAAA;eACbA,EAAAA,MAAAA;;OAErBA,EAAAA,CAJCA,KAIDA,CAAAA,GAAAA,EAAAA;aACOA,CAAAA,mBAAAA,CAAAA,EAAAA,CAAAA,GAAAA,GAJ2BA,KAI3BA,CAAAA,GAAAA,SAAAA;gBAT4BF,CAAAA,UAAAA,CAAAA,EAMdE,KANcF,CAAAA,EAAAA,IAAAA;iBAO3BE;EASEC,GAAAA,CAAAA,CAAAA,EARVD,KAQUC;EAAoB,UAAA,CAAA,CAAA,EAPvBD,KAOuB;aAA4BA,CAAAA,CAAAA,EAAAA,OAAAA;;;;;;AAU1DA,cAVUC,oBAUVD,CAAAA,KAAAA,CAAAA,SAV8CF,WAU9CE,CAV0DA,KAU1DA,EAViEA,KAUjEA,EAAAA,CATPA,KAUeA,SAXsCF;;;UAM7CE;;+BAEqBA;iBACdA;SACRA;iBACQA"}
|