@langchain/langgraph 1.0.12 → 1.0.14
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/channels/any_value.cjs +46 -0
- package/dist/channels/any_value.cjs.map +1 -0
- package/dist/channels/any_value.d.cts +23 -0
- package/dist/channels/any_value.d.cts.map +1 -0
- package/dist/channels/any_value.d.ts +23 -0
- package/dist/channels/any_value.d.ts.map +1 -0
- package/dist/channels/any_value.js +46 -0
- package/dist/channels/any_value.js.map +1 -0
- package/dist/channels/base.cjs +101 -0
- package/dist/channels/base.cjs.map +1 -0
- package/dist/channels/base.d.cts +79 -0
- package/dist/channels/base.d.cts.map +1 -0
- package/dist/channels/base.d.ts +79 -0
- package/dist/channels/base.d.ts.map +1 -0
- package/dist/channels/base.js +97 -0
- package/dist/channels/base.js.map +1 -0
- package/dist/channels/binop.cjs +49 -0
- package/dist/channels/binop.cjs.map +1 -0
- package/dist/channels/binop.d.cts +22 -0
- package/dist/channels/binop.d.cts.map +1 -0
- package/dist/channels/binop.d.ts +22 -0
- package/dist/channels/binop.d.ts.map +1 -0
- package/dist/channels/binop.js +49 -0
- package/dist/channels/binop.js.map +1 -0
- package/dist/channels/dynamic_barrier_value.cjs +75 -0
- package/dist/channels/dynamic_barrier_value.cjs.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.cts +40 -0
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.ts +40 -0
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
- package/dist/channels/dynamic_barrier_value.js +75 -0
- package/dist/channels/dynamic_barrier_value.js.map +1 -0
- package/dist/channels/ephemeral_value.cjs +46 -0
- package/dist/channels/ephemeral_value.cjs.map +1 -0
- package/dist/channels/ephemeral_value.d.cts +21 -0
- package/dist/channels/ephemeral_value.d.cts.map +1 -0
- package/dist/channels/ephemeral_value.d.ts +21 -0
- package/dist/channels/ephemeral_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.js +46 -0
- package/dist/channels/ephemeral_value.js.map +1 -0
- package/dist/channels/index.cjs +21 -0
- package/dist/channels/index.d.cts +9 -0
- package/dist/channels/index.d.ts +9 -0
- package/dist/channels/index.js +10 -0
- package/dist/channels/last_value.cjs +98 -0
- package/dist/channels/last_value.cjs.map +1 -0
- package/dist/channels/last_value.d.cts +42 -0
- package/dist/channels/last_value.d.cts.map +1 -0
- package/dist/channels/last_value.d.ts +42 -0
- package/dist/channels/last_value.d.ts.map +1 -0
- package/dist/channels/last_value.js +97 -0
- package/dist/channels/last_value.js.map +1 -0
- package/dist/channels/named_barrier_value.cjs +116 -0
- package/dist/channels/named_barrier_value.cjs.map +1 -0
- package/dist/channels/named_barrier_value.d.cts +44 -0
- package/dist/channels/named_barrier_value.d.cts.map +1 -0
- package/dist/channels/named_barrier_value.d.ts +44 -0
- package/dist/channels/named_barrier_value.d.ts.map +1 -0
- package/dist/channels/named_barrier_value.js +114 -0
- package/dist/channels/named_barrier_value.js.map +1 -0
- package/dist/channels/topic.cjs +65 -0
- package/dist/channels/topic.cjs.map +1 -0
- package/dist/channels/topic.d.cts +32 -0
- package/dist/channels/topic.d.cts.map +1 -0
- package/dist/channels/topic.d.ts +32 -0
- package/dist/channels/topic.d.ts.map +1 -0
- package/dist/channels/topic.js +65 -0
- package/dist/channels/topic.js.map +1 -0
- package/dist/constants.cjs +406 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +281 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +281 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +362 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors.cjs +163 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +77 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +146 -0
- package/dist/errors.js.map +1 -0
- package/dist/func/index.cjs +299 -0
- package/dist/func/index.cjs.map +1 -0
- package/dist/func/index.d.cts +288 -0
- package/dist/func/index.d.cts.map +1 -0
- package/dist/func/index.d.ts +288 -0
- package/dist/func/index.d.ts.map +1 -0
- package/dist/func/index.js +297 -0
- package/dist/func/index.js.map +1 -0
- package/dist/func/types.d.cts +62 -0
- package/dist/func/types.d.cts.map +1 -0
- package/dist/func/types.d.ts +62 -0
- package/dist/func/types.d.ts.map +1 -0
- package/dist/graph/annotation.cjs +101 -0
- package/dist/graph/annotation.cjs.map +1 -0
- package/dist/graph/annotation.d.cts +116 -0
- package/dist/graph/annotation.d.cts.map +1 -0
- package/dist/graph/annotation.d.ts +116 -0
- package/dist/graph/annotation.d.ts.map +1 -0
- package/dist/graph/annotation.js +99 -0
- package/dist/graph/annotation.js.map +1 -0
- package/dist/graph/graph.cjs +420 -0
- package/dist/graph/graph.cjs.map +1 -0
- package/dist/graph/graph.d.cts +108 -0
- package/dist/graph/graph.d.cts.map +1 -0
- package/dist/graph/graph.d.ts +108 -0
- package/dist/graph/graph.d.ts.map +1 -0
- package/dist/graph/graph.js +418 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/index.cjs +5 -0
- package/dist/graph/index.js +7 -0
- package/dist/graph/message.cjs +97 -0
- package/dist/graph/message.cjs.map +1 -0
- package/dist/graph/message.d.cts +40 -0
- package/dist/graph/message.d.cts.map +1 -0
- package/dist/graph/message.d.ts +40 -0
- package/dist/graph/message.d.ts.map +1 -0
- package/dist/graph/message.js +94 -0
- package/dist/graph/message.js.map +1 -0
- package/dist/graph/messages_annotation.cjs +109 -0
- package/dist/graph/messages_annotation.cjs.map +1 -0
- package/dist/graph/messages_annotation.d.cts +112 -0
- package/dist/graph/messages_annotation.d.cts.map +1 -0
- package/dist/graph/messages_annotation.d.ts +112 -0
- package/dist/graph/messages_annotation.d.ts.map +1 -0
- package/dist/graph/messages_annotation.js +107 -0
- package/dist/graph/messages_annotation.js.map +1 -0
- package/dist/graph/state.cjs +494 -0
- package/dist/graph/state.cjs.map +1 -0
- package/dist/graph/state.d.cts +229 -0
- package/dist/graph/state.d.cts.map +1 -0
- package/dist/graph/state.d.ts +229 -0
- package/dist/graph/state.d.ts.map +1 -0
- package/dist/graph/state.js +493 -0
- package/dist/graph/state.js.map +1 -0
- package/dist/graph/zod/index.cjs +10 -0
- package/dist/graph/zod/index.d.cts +3 -0
- package/dist/graph/zod/index.d.ts +3 -0
- package/dist/graph/zod/index.js +5 -0
- package/dist/graph/zod/meta.cjs +144 -0
- package/dist/graph/zod/meta.cjs.map +1 -0
- package/dist/graph/zod/meta.d.cts +115 -0
- package/dist/graph/zod/meta.d.cts.map +1 -0
- package/dist/graph/zod/meta.d.ts +115 -0
- package/dist/graph/zod/meta.d.ts.map +1 -0
- package/dist/graph/zod/meta.js +141 -0
- package/dist/graph/zod/meta.js.map +1 -0
- package/dist/graph/zod/plugin.cjs +39 -0
- package/dist/graph/zod/plugin.cjs.map +1 -0
- package/dist/graph/zod/plugin.js +40 -0
- package/dist/graph/zod/plugin.js.map +1 -0
- package/dist/graph/zod/schema.cjs +98 -0
- package/dist/graph/zod/schema.cjs.map +1 -0
- package/dist/graph/zod/schema.d.cts +38 -0
- package/dist/graph/zod/schema.d.cts.map +1 -0
- package/dist/graph/zod/schema.d.ts +38 -0
- package/dist/graph/zod/schema.d.ts.map +1 -0
- package/dist/graph/zod/schema.js +94 -0
- package/dist/graph/zod/schema.js.map +1 -0
- package/dist/graph/zod/zod-registry.cjs +42 -0
- package/dist/graph/zod/zod-registry.cjs.map +1 -0
- package/dist/graph/zod/zod-registry.d.cts +49 -0
- package/dist/graph/zod/zod-registry.d.cts.map +1 -0
- package/dist/graph/zod/zod-registry.d.ts +49 -0
- package/dist/graph/zod/zod-registry.d.ts.map +1 -0
- package/dist/graph/zod/zod-registry.js +41 -0
- package/dist/graph/zod/zod-registry.js.map +1 -0
- package/dist/hash.cjs +265 -0
- package/dist/hash.cjs.map +1 -0
- package/dist/hash.js +263 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.cjs +111 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/interrupt.cjs +79 -0
- package/dist/interrupt.cjs.map +1 -0
- package/dist/interrupt.d.cts +55 -0
- package/dist/interrupt.d.cts.map +1 -0
- package/dist/interrupt.d.ts +55 -0
- package/dist/interrupt.d.ts.map +1 -0
- package/dist/interrupt.js +79 -0
- package/dist/interrupt.js.map +1 -0
- package/dist/prebuilt/agentName.cjs +148 -0
- package/dist/prebuilt/agentName.cjs.map +1 -0
- package/dist/prebuilt/agentName.d.cts +42 -0
- package/dist/prebuilt/agentName.d.cts.map +1 -0
- package/dist/prebuilt/agentName.d.ts +42 -0
- package/dist/prebuilt/agentName.d.ts.map +1 -0
- package/dist/prebuilt/agentName.js +148 -0
- package/dist/prebuilt/agentName.js.map +1 -0
- package/dist/prebuilt/agent_executor.cjs +41 -0
- package/dist/prebuilt/agent_executor.cjs.map +1 -0
- package/dist/prebuilt/agent_executor.d.cts +58 -0
- package/dist/prebuilt/agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/agent_executor.d.ts +58 -0
- package/dist/prebuilt/agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/agent_executor.js +41 -0
- package/dist/prebuilt/agent_executor.js.map +1 -0
- package/dist/prebuilt/chat_agent_executor.cjs +62 -0
- package/dist/prebuilt/chat_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.cts +23 -0
- package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.ts +23 -0
- package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.js +62 -0
- package/dist/prebuilt/chat_agent_executor.js.map +1 -0
- package/dist/prebuilt/index.cjs +15 -0
- package/dist/prebuilt/index.d.cts +8 -0
- package/dist/prebuilt/index.d.ts +8 -0
- package/dist/prebuilt/index.js +8 -0
- package/dist/prebuilt/interrupt.d.cts +60 -0
- package/dist/prebuilt/interrupt.d.cts.map +1 -0
- package/dist/prebuilt/interrupt.d.ts +60 -0
- package/dist/prebuilt/interrupt.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.cjs +339 -0
- package/dist/prebuilt/react_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.cts +211 -0
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.ts +211 -0
- package/dist/prebuilt/react_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.js +338 -0
- package/dist/prebuilt/react_agent_executor.js.map +1 -0
- package/dist/prebuilt/tool_executor.cjs +43 -0
- package/dist/prebuilt/tool_executor.cjs.map +1 -0
- package/dist/prebuilt/tool_executor.d.cts +40 -0
- package/dist/prebuilt/tool_executor.d.cts.map +1 -0
- package/dist/prebuilt/tool_executor.d.ts +40 -0
- package/dist/prebuilt/tool_executor.d.ts.map +1 -0
- package/dist/prebuilt/tool_executor.js +43 -0
- package/dist/prebuilt/tool_executor.js.map +1 -0
- package/dist/prebuilt/tool_node.cjs +247 -0
- package/dist/prebuilt/tool_node.cjs.map +1 -0
- package/dist/prebuilt/tool_node.d.cts +180 -0
- package/dist/prebuilt/tool_node.d.cts.map +1 -0
- package/dist/prebuilt/tool_node.d.ts +180 -0
- package/dist/prebuilt/tool_node.d.ts.map +1 -0
- package/dist/prebuilt/tool_node.js +246 -0
- package/dist/prebuilt/tool_node.js.map +1 -0
- package/dist/pregel/algo.cjs +565 -0
- package/dist/pregel/algo.cjs.map +1 -0
- package/dist/pregel/algo.d.cts +13 -0
- package/dist/pregel/algo.d.cts.map +1 -0
- package/dist/pregel/algo.d.ts +13 -0
- package/dist/pregel/algo.d.ts.map +1 -0
- package/dist/pregel/algo.js +560 -0
- package/dist/pregel/algo.js.map +1 -0
- package/dist/pregel/call.cjs +50 -0
- package/dist/pregel/call.cjs.map +1 -0
- package/dist/pregel/call.js +48 -0
- package/dist/pregel/call.js.map +1 -0
- package/dist/pregel/debug.cjs +172 -0
- package/dist/pregel/debug.cjs.map +1 -0
- package/dist/pregel/debug.js +166 -0
- package/dist/pregel/debug.js.map +1 -0
- package/dist/pregel/index.cjs +1163 -0
- package/dist/pregel/index.cjs.map +1 -0
- package/dist/pregel/index.d.cts +498 -0
- package/dist/pregel/index.d.cts.map +1 -0
- package/dist/pregel/index.d.ts +498 -0
- package/dist/pregel/index.d.ts.map +1 -0
- package/dist/pregel/index.js +1162 -0
- package/dist/pregel/index.js.map +1 -0
- package/dist/pregel/io.cjs +140 -0
- package/dist/pregel/io.cjs.map +1 -0
- package/dist/pregel/io.js +135 -0
- package/dist/pregel/io.js.map +1 -0
- package/dist/pregel/loop.cjs +545 -0
- package/dist/pregel/loop.cjs.map +1 -0
- package/dist/pregel/loop.js +545 -0
- package/dist/pregel/loop.js.map +1 -0
- package/dist/pregel/messages.cjs +107 -0
- package/dist/pregel/messages.cjs.map +1 -0
- package/dist/pregel/messages.js +107 -0
- package/dist/pregel/messages.js.map +1 -0
- package/dist/pregel/read.cjs +151 -0
- package/dist/pregel/read.cjs.map +1 -0
- package/dist/pregel/read.d.cts +45 -0
- package/dist/pregel/read.d.cts.map +1 -0
- package/dist/pregel/read.d.ts +45 -0
- package/dist/pregel/read.d.ts.map +1 -0
- package/dist/pregel/read.js +150 -0
- package/dist/pregel/read.js.map +1 -0
- package/dist/pregel/remote.cjs +341 -0
- package/dist/pregel/remote.cjs.map +1 -0
- package/dist/pregel/remote.d.cts +118 -0
- package/dist/pregel/remote.d.cts.map +1 -0
- package/dist/pregel/remote.d.ts +118 -0
- package/dist/pregel/remote.d.ts.map +1 -0
- package/dist/pregel/remote.js +341 -0
- package/dist/pregel/remote.js.map +1 -0
- package/dist/pregel/retry.cjs +91 -0
- package/dist/pregel/retry.cjs.map +1 -0
- package/dist/pregel/retry.js +91 -0
- package/dist/pregel/retry.js.map +1 -0
- package/dist/pregel/runnable_types.d.cts +43 -0
- package/dist/pregel/runnable_types.d.cts.map +1 -0
- package/dist/pregel/runnable_types.d.ts +43 -0
- package/dist/pregel/runnable_types.d.ts.map +1 -0
- package/dist/pregel/runner.cjs +228 -0
- package/dist/pregel/runner.cjs.map +1 -0
- package/dist/pregel/runner.js +228 -0
- package/dist/pregel/runner.js.map +1 -0
- package/dist/pregel/stream.cjs +197 -0
- package/dist/pregel/stream.cjs.map +1 -0
- package/dist/pregel/stream.js +195 -0
- package/dist/pregel/stream.js.map +1 -0
- package/dist/pregel/types.cjs +27 -0
- package/dist/pregel/types.cjs.map +1 -0
- package/dist/pregel/types.d.cts +440 -0
- package/dist/pregel/types.d.cts.map +1 -0
- package/dist/pregel/types.d.ts +440 -0
- package/dist/pregel/types.d.ts.map +1 -0
- package/dist/pregel/types.js +25 -0
- package/dist/pregel/types.js.map +1 -0
- package/dist/pregel/utils/config.cjs +121 -0
- package/dist/pregel/utils/config.cjs.map +1 -0
- package/dist/pregel/utils/config.d.cts +36 -0
- package/dist/pregel/utils/config.d.cts.map +1 -0
- package/dist/pregel/utils/config.d.ts +36 -0
- package/dist/pregel/utils/config.d.ts.map +1 -0
- package/dist/pregel/utils/config.js +115 -0
- package/dist/pregel/utils/config.js.map +1 -0
- package/dist/pregel/utils/index.cjs +102 -0
- package/dist/pregel/utils/index.cjs.map +1 -0
- package/dist/pregel/utils/index.d.cts +51 -0
- package/dist/pregel/utils/index.d.cts.map +1 -0
- package/dist/pregel/utils/index.d.ts +51 -0
- package/dist/pregel/utils/index.d.ts.map +1 -0
- package/dist/pregel/utils/index.js +96 -0
- package/dist/pregel/utils/index.js.map +1 -0
- package/dist/pregel/utils/subgraph.cjs +18 -0
- package/dist/pregel/utils/subgraph.cjs.map +1 -0
- package/dist/pregel/utils/subgraph.js +16 -0
- package/dist/pregel/utils/subgraph.js.map +1 -0
- package/dist/pregel/validate.cjs +45 -0
- package/dist/pregel/validate.cjs.map +1 -0
- package/dist/pregel/validate.js +44 -0
- package/dist/pregel/validate.js.map +1 -0
- package/dist/pregel/write.cjs +96 -0
- package/dist/pregel/write.cjs.map +1 -0
- package/dist/pregel/write.d.cts +31 -0
- package/dist/pregel/write.d.cts.map +1 -0
- package/dist/pregel/write.d.ts +31 -0
- package/dist/pregel/write.d.ts.map +1 -0
- package/dist/pregel/write.js +95 -0
- package/dist/pregel/write.js.map +1 -0
- package/dist/remote.cjs +3 -0
- package/dist/remote.d.cts +2 -0
- package/dist/remote.d.ts +2 -0
- package/dist/remote.js +3 -0
- package/dist/setup/async_local_storage.cjs +11 -0
- package/dist/setup/async_local_storage.cjs.map +1 -0
- package/dist/setup/async_local_storage.js +11 -0
- package/dist/setup/async_local_storage.js.map +1 -0
- package/dist/utils.cjs +86 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +25 -0
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.ts +25 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +80 -0
- package/dist/utils.js.map +1 -0
- package/dist/web.cjs +95 -0
- package/dist/web.d.cts +23 -0
- package/dist/web.d.ts +23 -0
- package/dist/web.js +15 -0
- package/dist/writer.cjs +14 -0
- package/dist/writer.cjs.map +1 -0
- package/dist/writer.d.cts +6 -0
- package/dist/writer.d.cts.map +1 -0
- package/dist/writer.d.ts +6 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +14 -0
- package/dist/writer.js.map +1 -0
- package/package.json +25 -27
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseChannel } from "./base.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/channels/binop.d.ts
|
|
4
|
+
type BinaryOperator<ValueType, UpdateType> = (a: ValueType, b: UpdateType) => ValueType;
|
|
5
|
+
/**
|
|
6
|
+
* Stores the result of applying a binary operator to the current value and each new value.
|
|
7
|
+
*/
|
|
8
|
+
declare class BinaryOperatorAggregate<ValueType, UpdateType = ValueType> extends BaseChannel<ValueType, UpdateType, ValueType> {
|
|
9
|
+
lc_graph_name: string;
|
|
10
|
+
value: ValueType | undefined;
|
|
11
|
+
operator: BinaryOperator<ValueType, UpdateType>;
|
|
12
|
+
initialValueFactory?: () => ValueType;
|
|
13
|
+
constructor(operator: BinaryOperator<ValueType, UpdateType>, initialValueFactory?: () => ValueType);
|
|
14
|
+
fromCheckpoint(checkpoint?: ValueType): this;
|
|
15
|
+
update(values: UpdateType[]): boolean;
|
|
16
|
+
get(): ValueType;
|
|
17
|
+
checkpoint(): ValueType;
|
|
18
|
+
isAvailable(): boolean;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BinaryOperator, BinaryOperatorAggregate };
|
|
22
|
+
//# sourceMappingURL=binop.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binop.d.cts","names":["BaseChannel","BinaryOperator","ValueType","UpdateType","BinaryOperatorAggregate"],"sources":["../../src/channels/binop.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\nexport type BinaryOperator<ValueType, UpdateType> = (a: ValueType, b: UpdateType) => ValueType;\n/**\n * Stores the result of applying a binary operator to the current value and each new value.\n */\nexport declare class BinaryOperatorAggregate<ValueType, UpdateType = ValueType> extends BaseChannel<ValueType, UpdateType, ValueType> {\n lc_graph_name: string;\n value: ValueType | undefined;\n operator: BinaryOperator<ValueType, UpdateType>;\n initialValueFactory?: () => ValueType;\n constructor(operator: BinaryOperator<ValueType, UpdateType>, initialValueFactory?: () => ValueType);\n fromCheckpoint(checkpoint?: ValueType): this;\n update(values: UpdateType[]): boolean;\n get(): ValueType;\n checkpoint(): ValueType;\n isAvailable(): boolean;\n}\n"],"mappings":";;;KACYC,4CAA4CC,cAAcC,eAAeD;;AAArF;;AAAwDA,cAInCE,uBAJmCF,CAAAA,SAAAA,EAAAA,aAIaA,SAJbA,CAAAA,SAIgCF,WAJhCE,CAI4CA,SAJ5CA,EAIuDC,UAJvDD,EAImEA,SAJnEA,CAAAA,CAAAA;eAAcC,EAAAA,MAAAA;OAAeD,EAM1EA,SAN0EA,GAAAA,SAAAA;EAAS,QAAA,EAOhFD,cAPgF,CAOjEC,SAPiE,EAOtDC,UAPsD,CAAA;EAIzEC,mBAAAA,CAAAA,EAAAA,GAAAA,GAIWF,SAJY;EAAA,WAAA,CAAA,QAAA,EAKlBD,cALkB,CAKHC,SALG,EAKQC,UALR,CAAA,EAAA,mBAAA,CAAA,EAAA,GAAA,GAKiDD,SALjD;gBAAyBA,CAAAA,UAAAA,CAAAA,EAMrCA,SANqCA,CAAAA,EAAAA,IAAAA;QAA+BA,CAAAA,MAAAA,EAOjFC,UAPiFD,EAAAA,CAAAA,EAAAA,OAAAA;KAAWC,CAAAA,CAAAA,EAQpGD,SARoGC;YAAYD,CAAAA,CAAAA,EASzGA,SATyGA;aAEhHA,CAAAA,CAAAA,EAAAA,OAAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseChannel } from "./base.js";
|
|
2
|
+
|
|
3
|
+
//#region src/channels/binop.d.ts
|
|
4
|
+
type BinaryOperator<ValueType, UpdateType> = (a: ValueType, b: UpdateType) => ValueType;
|
|
5
|
+
/**
|
|
6
|
+
* Stores the result of applying a binary operator to the current value and each new value.
|
|
7
|
+
*/
|
|
8
|
+
declare class BinaryOperatorAggregate<ValueType, UpdateType = ValueType> extends BaseChannel<ValueType, UpdateType, ValueType> {
|
|
9
|
+
lc_graph_name: string;
|
|
10
|
+
value: ValueType | undefined;
|
|
11
|
+
operator: BinaryOperator<ValueType, UpdateType>;
|
|
12
|
+
initialValueFactory?: () => ValueType;
|
|
13
|
+
constructor(operator: BinaryOperator<ValueType, UpdateType>, initialValueFactory?: () => ValueType);
|
|
14
|
+
fromCheckpoint(checkpoint?: ValueType): this;
|
|
15
|
+
update(values: UpdateType[]): boolean;
|
|
16
|
+
get(): ValueType;
|
|
17
|
+
checkpoint(): ValueType;
|
|
18
|
+
isAvailable(): boolean;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BinaryOperator, BinaryOperatorAggregate };
|
|
22
|
+
//# sourceMappingURL=binop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binop.d.ts","names":["BaseChannel","BinaryOperator","ValueType","UpdateType","BinaryOperatorAggregate"],"sources":["../../src/channels/binop.d.ts"],"sourcesContent":["import { BaseChannel } from \"./base.js\";\nexport type BinaryOperator<ValueType, UpdateType> = (a: ValueType, b: UpdateType) => ValueType;\n/**\n * Stores the result of applying a binary operator to the current value and each new value.\n */\nexport declare class BinaryOperatorAggregate<ValueType, UpdateType = ValueType> extends BaseChannel<ValueType, UpdateType, ValueType> {\n lc_graph_name: string;\n value: ValueType | undefined;\n operator: BinaryOperator<ValueType, UpdateType>;\n initialValueFactory?: () => ValueType;\n constructor(operator: BinaryOperator<ValueType, UpdateType>, initialValueFactory?: () => ValueType);\n fromCheckpoint(checkpoint?: ValueType): this;\n update(values: UpdateType[]): boolean;\n get(): ValueType;\n checkpoint(): ValueType;\n isAvailable(): boolean;\n}\n"],"mappings":";;;KACYC,4CAA4CC,cAAcC,eAAeD;;AAArF;;AAAwDA,cAInCE,uBAJmCF,CAAAA,SAAAA,EAAAA,aAIaA,SAJbA,CAAAA,SAIgCF,WAJhCE,CAI4CA,SAJ5CA,EAIuDC,UAJvDD,EAImEA,SAJnEA,CAAAA,CAAAA;eAAcC,EAAAA,MAAAA;OAAeD,EAM1EA,SAN0EA,GAAAA,SAAAA;EAAS,QAAA,EAOhFD,cAPgF,CAOjEC,SAPiE,EAOtDC,UAPsD,CAAA;EAIzEC,mBAAAA,CAAAA,EAAAA,GAAAA,GAIWF,SAJY;EAAA,WAAA,CAAA,QAAA,EAKlBD,cALkB,CAKHC,SALG,EAKQC,UALR,CAAA,EAAA,mBAAA,CAAA,EAAA,GAAA,GAKiDD,SALjD;gBAAyBA,CAAAA,UAAAA,CAAAA,EAMrCA,SANqCA,CAAAA,EAAAA,IAAAA;QAA+BA,CAAAA,MAAAA,EAOjFC,UAPiFD,EAAAA,CAAAA,EAAAA,OAAAA;KAAWC,CAAAA,CAAAA,EAQpGD,SARoGC;YAAYD,CAAAA,CAAAA,EASzGA,SATyGA;aAEhHA,CAAAA,CAAAA,EAAAA,OAAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EmptyChannelError } from "../errors.js";
|
|
2
|
+
import { BaseChannel } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region src/channels/binop.ts
|
|
5
|
+
/**
|
|
6
|
+
* Stores the result of applying a binary operator to the current value and each new value.
|
|
7
|
+
*/
|
|
8
|
+
var BinaryOperatorAggregate = class BinaryOperatorAggregate extends BaseChannel {
|
|
9
|
+
lc_graph_name = "BinaryOperatorAggregate";
|
|
10
|
+
value;
|
|
11
|
+
operator;
|
|
12
|
+
initialValueFactory;
|
|
13
|
+
constructor(operator, initialValueFactory) {
|
|
14
|
+
super();
|
|
15
|
+
this.operator = operator;
|
|
16
|
+
this.initialValueFactory = initialValueFactory;
|
|
17
|
+
this.value = initialValueFactory?.();
|
|
18
|
+
}
|
|
19
|
+
fromCheckpoint(checkpoint) {
|
|
20
|
+
const empty = new BinaryOperatorAggregate(this.operator, this.initialValueFactory);
|
|
21
|
+
if (typeof checkpoint !== "undefined") empty.value = checkpoint;
|
|
22
|
+
return empty;
|
|
23
|
+
}
|
|
24
|
+
update(values) {
|
|
25
|
+
let newValues = values;
|
|
26
|
+
if (!newValues.length) return false;
|
|
27
|
+
if (this.value === void 0) {
|
|
28
|
+
[this.value] = newValues;
|
|
29
|
+
newValues = newValues.slice(1);
|
|
30
|
+
}
|
|
31
|
+
for (const value of newValues) if (this.value !== void 0) this.value = this.operator(this.value, value);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
get() {
|
|
35
|
+
if (this.value === void 0) throw new EmptyChannelError();
|
|
36
|
+
return this.value;
|
|
37
|
+
}
|
|
38
|
+
checkpoint() {
|
|
39
|
+
if (this.value === void 0) throw new EmptyChannelError();
|
|
40
|
+
return this.value;
|
|
41
|
+
}
|
|
42
|
+
isAvailable() {
|
|
43
|
+
return this.value !== void 0;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { BinaryOperatorAggregate };
|
|
49
|
+
//# sourceMappingURL=binop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binop.js","names":[],"sources":["../../src/channels/binop.ts"],"sourcesContent":["import { EmptyChannelError } from \"../errors.js\";\nimport { BaseChannel } from \"./base.js\";\n\nexport type BinaryOperator<ValueType, UpdateType> = (\n a: ValueType,\n b: UpdateType\n) => ValueType;\n\n/**\n * Stores the result of applying a binary operator to the current value and each new value.\n */\nexport class BinaryOperatorAggregate<\n ValueType,\n UpdateType = ValueType\n> extends BaseChannel<ValueType, UpdateType, ValueType> {\n lc_graph_name = \"BinaryOperatorAggregate\";\n\n value: ValueType | undefined;\n\n operator: BinaryOperator<ValueType, UpdateType>;\n\n initialValueFactory?: () => ValueType;\n\n constructor(\n operator: BinaryOperator<ValueType, UpdateType>,\n initialValueFactory?: () => ValueType\n ) {\n super();\n\n this.operator = operator;\n this.initialValueFactory = initialValueFactory;\n this.value = initialValueFactory?.();\n }\n\n public fromCheckpoint(checkpoint?: ValueType) {\n const empty = new BinaryOperatorAggregate(\n this.operator,\n this.initialValueFactory\n );\n if (typeof checkpoint !== \"undefined\") {\n empty.value = checkpoint;\n }\n return empty as this;\n }\n\n public update(values: UpdateType[]): boolean {\n let newValues = values;\n if (!newValues.length) return false;\n\n if (this.value === undefined) {\n [this.value as UpdateType] = newValues;\n newValues = newValues.slice(1);\n }\n\n for (const value of newValues) {\n if (this.value !== undefined) {\n this.value = this.operator(this.value, value);\n }\n }\n return true;\n }\n\n public get(): ValueType {\n if (this.value === undefined) {\n throw new EmptyChannelError();\n }\n return this.value;\n }\n\n public checkpoint(): ValueType {\n if (this.value === undefined) {\n throw new EmptyChannelError();\n }\n return this.value;\n }\n\n isAvailable(): boolean {\n return this.value !== undefined;\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,0BAAb,MAAa,gCAGH,YAA8C;CACtD,gBAAgB;CAEhB;CAEA;CAEA;CAEA,YACE,UACA,qBACA;AACA,SAAO;AAEP,OAAK,WAAW;AAChB,OAAK,sBAAsB;AAC3B,OAAK,QAAQ,uBAAuB;;CAGtC,AAAO,eAAe,YAAwB;EAC5C,MAAM,QAAQ,IAAI,wBAChB,KAAK,UACL,KAAK,oBACN;AACD,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ;AAEhB,SAAO;;CAGT,AAAO,OAAO,QAA+B;EAC3C,IAAI,YAAY;AAChB,MAAI,CAAC,UAAU,OAAQ,QAAO;AAE9B,MAAI,KAAK,UAAU,QAAW;AAC5B,IAAC,KAAK,SAAuB;AAC7B,eAAY,UAAU,MAAM,EAAE;;AAGhC,OAAK,MAAM,SAAS,UAClB,KAAI,KAAK,UAAU,OACjB,MAAK,QAAQ,KAAK,SAAS,KAAK,OAAO,MAAM;AAGjD,SAAO;;CAGT,AAAO,MAAiB;AACtB,MAAI,KAAK,UAAU,OACjB,OAAM,IAAI,mBAAmB;AAE/B,SAAO,KAAK;;CAGd,AAAO,aAAwB;AAC7B,MAAI,KAAK,UAAU,OACjB,OAAM,IAAI,mBAAmB;AAE/B,SAAO,KAAK;;CAGd,cAAuB;AACrB,SAAO,KAAK,UAAU"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const require_errors = require('../errors.cjs');
|
|
2
|
+
const require_base = require('./base.cjs');
|
|
3
|
+
const require_named_barrier_value = require('./named_barrier_value.cjs');
|
|
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 require_base.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 require_errors.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 && require_named_barrier_value.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 || !require_named_barrier_value.areSetsEqual(this.names, this.seen)) throw new require_errors.EmptyChannelError();
|
|
64
|
+
}
|
|
65
|
+
checkpoint() {
|
|
66
|
+
return [this.names ? [...this.names] : void 0, [...this.seen]];
|
|
67
|
+
}
|
|
68
|
+
isAvailable() {
|
|
69
|
+
return !!this.names && require_named_barrier_value.areSetsEqual(this.names, this.seen);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
exports.DynamicBarrierValue = DynamicBarrierValue;
|
|
75
|
+
//# sourceMappingURL=dynamic_barrier_value.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic_barrier_value.cjs","names":["BaseChannel","InvalidUpdateError","areSetsEqual","EmptyChannelError"],"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,4BAAmCA,yBAI9C;CACA,gBAAgB;CAEhB;CAEA;CAEA,cAAc;AACZ,SAAO;AACP,OAAK,QAAQ;AACb,OAAK,uBAAO,IAAI,KAAY;;CAG9B,eAAe,YAA6C;EAC1D,MAAM,QAAQ,IAAI,qBAA4B;AAC9C,MAAI,OAAO,eAAe,aAAa;AACrC,SAAM,QAAQ,IAAI,IAAI,WAAW,GAAG;AACpC,SAAM,OAAO,IAAI,IAAI,WAAW,GAAG;;AAErC,SAAO;;CAGT,OAAO,QAAkD;EACvD,MAAM,eAAe,OAAO,OAAO,eAAe;AAClD,MAAI,aAAa,SAAS,GAAG;AAC3B,OAAI,aAAa,SAAS,EACxB,OAAM,IAAIC,kCACR,2DACD;AAEH,QAAK,QAAQ,IAAI,IAAI,aAAa,GAAG,QAAQ;AAC7C,UAAO;aACE,KAAK,UAAU,QAAW;GACnC,IAAI,UAAU;AACd,QAAK,MAAM,SAAS,QAAQ;AAC1B,QAAI,eAAe,MAAM,CACvB,OAAM,IAAI,MACR,8DACD;AAEH,QAAI,KAAK,MAAM,IAAI,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,MAAM,EAAE;AAClD,UAAK,KAAK,IAAI,MAAM;AACpB,eAAU;;;AAGd,UAAO;;AAET,SAAO;;CAGT,UAAmB;AACjB,MAAI,KAAK,QAAQ,KAAK,SAASC,yCAAa,KAAK,MAAM,KAAK,MAAM,EAAE;AAClE,QAAK,uBAAO,IAAI,KAAY;AAC5B,QAAK,QAAQ;AACb,UAAO;;AAET,SAAO;;CAKT,MAAY;AACV,MAAI,CAAC,KAAK,SAAS,CAACA,yCAAa,KAAK,OAAO,KAAK,KAAK,CACrD,OAAM,IAAIC,kCAAmB;;CAKjC,aAA6C;AAC3C,SAAO,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,MAAM,GAAG,QAAW,CAAC,GAAG,KAAK,KAAK,CAAC;;CAGnE,cAAuB;AACrB,SAAO,CAAC,CAAC,KAAK,SAASD,yCAAa,KAAK,OAAO,KAAK,KAAK"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseChannel } from "./base.cjs";
|
|
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>;
|
|
19
|
+
seen: Set<Value>;
|
|
20
|
+
constructor();
|
|
21
|
+
fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;
|
|
22
|
+
update(values: (Value | WaitForNames<Value>)[]): boolean;
|
|
23
|
+
consume(): boolean;
|
|
24
|
+
get(): void;
|
|
25
|
+
checkpoint(): [Value[] | undefined, Value[]];
|
|
26
|
+
isAvailable(): boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A channel that switches between two states with an additional finished flag
|
|
30
|
+
*
|
|
31
|
+
* - in the "priming" state it can't be read from.
|
|
32
|
+
* - if it receives a WaitForNames update, it switches to the "waiting" state.
|
|
33
|
+
* - in the "waiting" state it collects named values until all are received.
|
|
34
|
+
* - once all named values are received, and the finished flag is set, it can be read once, and it switches
|
|
35
|
+
* back to the "priming" state.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DynamicBarrierValue, WaitForNames };
|
|
40
|
+
//# sourceMappingURL=dynamic_barrier_value.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic_barrier_value.d.cts","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>;\n seen: Set<Value>;\n constructor();\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;\n update(values: (Value | WaitForNames<Value>)[]): boolean;\n consume(): boolean;\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>;\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;MAAbD,EAHlBG,GAGkBH,CAHdC,KAGcD,CAAAA;aAGTC,CAAAA;gBAAqBA,CAAAA,UAAAA,CAAAA,EAAAA,CAJPA,KAIOA,EAAAA,GAAAA,SAAAA,EAJcA,KAIdA,EAAAA,CAAAA,CAAAA,EAAAA,IAAAA;QAZgBF,CAAAA,MAAAA,EAAAA,CASpCE,KAToCF,GAS5BC,YAT4BD,CASfE,KATeF,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,OAAAA;EAAW,OAAA,CAAA,CAAA,EAAA,OAAA;;iBAYhDE,qBAAqBA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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>;
|
|
19
|
+
seen: Set<Value>;
|
|
20
|
+
constructor();
|
|
21
|
+
fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;
|
|
22
|
+
update(values: (Value | WaitForNames<Value>)[]): boolean;
|
|
23
|
+
consume(): boolean;
|
|
24
|
+
get(): void;
|
|
25
|
+
checkpoint(): [Value[] | undefined, Value[]];
|
|
26
|
+
isAvailable(): boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A channel that switches between two states with an additional finished flag
|
|
30
|
+
*
|
|
31
|
+
* - in the "priming" state it can't be read from.
|
|
32
|
+
* - if it receives a WaitForNames update, it switches to the "waiting" state.
|
|
33
|
+
* - in the "waiting" state it collects named values until all are received.
|
|
34
|
+
* - once all named values are received, and the finished flag is set, it can be read once, and it switches
|
|
35
|
+
* back to the "priming" state.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DynamicBarrierValue, WaitForNames };
|
|
40
|
+
//# sourceMappingURL=dynamic_barrier_value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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>;\n seen: Set<Value>;\n constructor();\n fromCheckpoint(checkpoint?: [Value[] | undefined, Value[]]): this;\n update(values: (Value | WaitForNames<Value>)[]): boolean;\n consume(): boolean;\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>;\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;MAAbD,EAHlBG,GAGkBH,CAHdC,KAGcD,CAAAA;aAGTC,CAAAA;gBAAqBA,CAAAA,UAAAA,CAAAA,EAAAA,CAJPA,KAIOA,EAAAA,GAAAA,SAAAA,EAJcA,KAIdA,EAAAA,CAAAA,CAAAA,EAAAA,IAAAA;QAZgBF,CAAAA,MAAAA,EAAAA,CASpCE,KAToCF,GAS5BC,YAT4BD,CASfE,KATeF,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,OAAAA;EAAW,OAAA,CAAA,CAAA,EAAA,OAAA;;iBAYhDE,qBAAqBA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
}
|
|
65
|
+
checkpoint() {
|
|
66
|
+
return [this.names ? [...this.names] : void 0, [...this.seen]];
|
|
67
|
+
}
|
|
68
|
+
isAvailable() {
|
|
69
|
+
return !!this.names && areSetsEqual(this.names, this.seen);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { DynamicBarrierValue };
|
|
75
|
+
//# sourceMappingURL=dynamic_barrier_value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,SAAO;AACP,OAAK,QAAQ;AACb,OAAK,uBAAO,IAAI,KAAY;;CAG9B,eAAe,YAA6C;EAC1D,MAAM,QAAQ,IAAI,qBAA4B;AAC9C,MAAI,OAAO,eAAe,aAAa;AACrC,SAAM,QAAQ,IAAI,IAAI,WAAW,GAAG;AACpC,SAAM,OAAO,IAAI,IAAI,WAAW,GAAG;;AAErC,SAAO;;CAGT,OAAO,QAAkD;EACvD,MAAM,eAAe,OAAO,OAAO,eAAe;AAClD,MAAI,aAAa,SAAS,GAAG;AAC3B,OAAI,aAAa,SAAS,EACxB,OAAM,IAAI,mBACR,2DACD;AAEH,QAAK,QAAQ,IAAI,IAAI,aAAa,GAAG,QAAQ;AAC7C,UAAO;aACE,KAAK,UAAU,QAAW;GACnC,IAAI,UAAU;AACd,QAAK,MAAM,SAAS,QAAQ;AAC1B,QAAI,eAAe,MAAM,CACvB,OAAM,IAAI,MACR,8DACD;AAEH,QAAI,KAAK,MAAM,IAAI,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,MAAM,EAAE;AAClD,UAAK,KAAK,IAAI,MAAM;AACpB,eAAU;;;AAGd,UAAO;;AAET,SAAO;;CAGT,UAAmB;AACjB,MAAI,KAAK,QAAQ,KAAK,SAAS,aAAa,KAAK,MAAM,KAAK,MAAM,EAAE;AAClE,QAAK,uBAAO,IAAI,KAAY;AAC5B,QAAK,QAAQ;AACb,UAAO;;AAET,SAAO;;CAKT,MAAY;AACV,MAAI,CAAC,KAAK,SAAS,CAAC,aAAa,KAAK,OAAO,KAAK,KAAK,CACrD,OAAM,IAAI,mBAAmB;;CAKjC,aAA6C;AAC3C,SAAO,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,MAAM,GAAG,QAAW,CAAC,GAAG,KAAK,KAAK,CAAC;;CAGnE,cAAuB;AACrB,SAAO,CAAC,CAAC,KAAK,SAAS,aAAa,KAAK,OAAO,KAAK,KAAK"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE;CAExB,YAAY,QAAiB,MAAM;AACjC,SAAO;AACP,OAAK,QAAQ;;CAGf,eAAe,YAAoB;EACjC,MAAM,QAAQ,IAAI,eAAsB,KAAK,MAAM;AACnD,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ,CAAC,WAAW;AAE5B,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,GAAG;GACvB,MAAM,UAAU,KAAK,MAAM,SAAS;AAEpC,QAAK,QAAQ,EAAE;AACf,UAAO;;AAET,MAAI,OAAO,WAAW,KAAK,KAAK,MAC9B,OAAM,IAAIC,kCACR,sDACD;AAIH,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS,GAAG;AACxC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIC,kCAAmB;AAE/B,SAAO,KAAK,MAAM;;CAGpB,aAAoB;AAClB,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAIA,kCAAmB;AAE/B,SAAO,KAAK,MAAM;;CAGpB,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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: [Value] | [];
|
|
12
|
+
constructor(guard?: boolean);
|
|
13
|
+
fromCheckpoint(checkpoint?: Value): this;
|
|
14
|
+
update(values: Value[]): boolean;
|
|
15
|
+
get(): Value;
|
|
16
|
+
checkpoint(): Value;
|
|
17
|
+
isAvailable(): boolean;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { EphemeralValue };
|
|
21
|
+
//# sourceMappingURL=ephemeral_value.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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: [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;OAAOA,EAAAA,CAGjEA,KAHiEA,CAAAA,GAAAA,EAAAA;aAGjEA,CAAAA,KAAAA,CAAAA,EAAAA,OAAAA;gBAEoBA,CAAAA,UAAAA,CAAAA,EAAAA,KAAAA,CAAAA,EAAAA,IAAAA;QACbA,CAAAA,MAAAA,EAAAA,KAAAA,EAAAA,CAAAA,EAAAA,OAAAA;KACRA,CAAAA,CAAAA,EAAAA,KAAAA;YACOA,CAAAA,CAAAA,EAAAA,KAAAA;aARiCF,CAAAA,CAAAA,EAAAA,OAAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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: [Value] | [];
|
|
12
|
+
constructor(guard?: boolean);
|
|
13
|
+
fromCheckpoint(checkpoint?: Value): this;
|
|
14
|
+
update(values: Value[]): boolean;
|
|
15
|
+
get(): Value;
|
|
16
|
+
checkpoint(): Value;
|
|
17
|
+
isAvailable(): boolean;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { EphemeralValue };
|
|
21
|
+
//# sourceMappingURL=ephemeral_value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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: [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;OAAOA,EAAAA,CAGjEA,KAHiEA,CAAAA,GAAAA,EAAAA;aAGjEA,CAAAA,KAAAA,CAAAA,EAAAA,OAAAA;gBAEoBA,CAAAA,UAAAA,CAAAA,EAAAA,KAAAA,CAAAA,EAAAA,IAAAA;QACbA,CAAAA,MAAAA,EAAAA,KAAAA,EAAAA,CAAAA,EAAAA,OAAAA;KACRA,CAAAA,CAAAA,EAAAA,KAAAA;YACOA,CAAAA,CAAAA,EAAAA,KAAAA;aARiCF,CAAAA,CAAAA,EAAAA,OAAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE;CAExB,YAAY,QAAiB,MAAM;AACjC,SAAO;AACP,OAAK,QAAQ;;CAGf,eAAe,YAAoB;EACjC,MAAM,QAAQ,IAAI,eAAsB,KAAK,MAAM;AACnD,MAAI,OAAO,eAAe,YACxB,OAAM,QAAQ,CAAC,WAAW;AAE5B,SAAO;;CAGT,OAAO,QAA0B;AAC/B,MAAI,OAAO,WAAW,GAAG;GACvB,MAAM,UAAU,KAAK,MAAM,SAAS;AAEpC,QAAK,QAAQ,EAAE;AACf,UAAO;;AAET,MAAI,OAAO,WAAW,KAAK,KAAK,MAC9B,OAAM,IAAI,mBACR,sDACD;AAIH,OAAK,QAAQ,CAAC,OAAO,OAAO,SAAS,GAAG;AACxC,SAAO;;CAGT,MAAa;AACX,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAI,mBAAmB;AAE/B,SAAO,KAAK,MAAM;;CAGpB,aAAoB;AAClB,MAAI,KAAK,MAAM,WAAW,EACxB,OAAM,IAAI,mBAAmB;AAE/B,SAAO,KAAK,MAAM;;CAGpB,cAAuB;AACrB,SAAO,KAAK,MAAM,WAAW"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 };
|