@langchain/langgraph 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -20,8 +20,8 @@ const require_state = require("./graph/state.cjs");
20
20
  const require_message = require("./graph/message.cjs");
21
21
  const require_index = require("./func/index.cjs");
22
22
  const require_messages_annotation = require("./graph/messages_annotation.cjs");
23
- require("./web.cjs");
24
23
  const require_writer = require("./writer.cjs");
24
+ require("./web.cjs");
25
25
  let _langchain_langgraph_checkpoint = require("@langchain/langgraph-checkpoint");
26
26
  //#region src/index.ts
27
27
  require_async_local_storage.initializeAsyncLocalStorageSingleton();
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["initializeAsyncLocalStorageSingleton"],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n\nexport { interrupt } from \"./interrupt.js\";\nexport { writer } from \"./writer.js\";\nexport { pushMessage } from \"./graph/message.js\";\nexport { getStore, getWriter, getConfig } from \"./pregel/utils/config.js\";\nexport { getPreviousState } from \"./func/index.js\";\nexport { getCurrentTaskInput } from \"./pregel/utils/config.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,4BAAAA,sCAAsC"}
1
+ {"version":3,"file":"index.cjs","names":["initializeAsyncLocalStorageSingleton"],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,4BAAAA,sCAAsC"}
package/dist/index.d.cts CHANGED
@@ -15,8 +15,8 @@ import { PregelNode } from "./pregel/read.cjs";
15
15
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.cjs";
16
16
  import { Pregel } from "./pregel/index.cjs";
17
17
  import { CompiledGraph, Graph } from "./graph/graph.cjs";
18
- import { interrupt } from "./interrupt.cjs";
19
- import { writer } from "./writer.cjs";
18
+ import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.cjs";
19
+ import { InferWriterType, writer } from "./writer.cjs";
20
20
  import { isSerializableSchema, isStandardSchema } from "./state/types.cjs";
21
21
  import { ReducedValue, ReducedValueInit } from "./state/values/reduced.cjs";
22
22
  import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.cjs";
@@ -30,6 +30,6 @@ import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } fr
30
30
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.cjs";
31
31
  import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.cjs";
32
32
  import { MessagesValue } from "./state/prebuilt/messages.cjs";
33
- import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.cjs";
34
33
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandInstance, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
34
+ import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.cjs";
35
+ export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandInstance, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferInterruptInputType, InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, InferWriterType, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/dist/index.d.ts CHANGED
@@ -15,8 +15,8 @@ import { PregelNode } from "./pregel/read.js";
15
15
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.js";
16
16
  import { Pregel } from "./pregel/index.js";
17
17
  import { CompiledGraph, Graph } from "./graph/graph.js";
18
- import { interrupt } from "./interrupt.js";
19
- import { writer } from "./writer.js";
18
+ import { InferInterruptInputType, InferInterruptResumeType, interrupt } from "./interrupt.js";
19
+ import { InferWriterType, writer } from "./writer.js";
20
20
  import { isSerializableSchema, isStandardSchema } from "./state/types.js";
21
21
  import { ReducedValue, ReducedValueInit } from "./state/values/reduced.js";
22
22
  import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.js";
@@ -30,6 +30,6 @@ import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } fr
30
30
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
31
31
  import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.js";
32
32
  import { MessagesValue } from "./state/prebuilt/messages.js";
33
- import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.js";
34
33
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandInstance, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
34
+ import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.js";
35
+ export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandInstance, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferInterruptInputType, InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, InferWriterType, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/dist/index.js CHANGED
@@ -19,8 +19,8 @@ import { CompiledStateGraph, StateGraph } from "./graph/state.js";
19
19
  import { MessageGraph, pushMessage } from "./graph/message.js";
20
20
  import { entrypoint, getPreviousState, task } from "./func/index.js";
21
21
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
22
- import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, InMemoryStore, MemorySaver, copyCheckpoint, emptyCheckpoint } from "./web.js";
23
22
  import { writer } from "./writer.js";
23
+ import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, InMemoryStore, MemorySaver, copyCheckpoint, emptyCheckpoint } from "./web.js";
24
24
  //#region src/index.ts
25
25
  initializeAsyncLocalStorageSingleton();
26
26
  //#endregion
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n\nexport { interrupt } from \"./interrupt.js\";\nexport { writer } from \"./writer.js\";\nexport { pushMessage } from \"./graph/message.js\";\nexport { getStore, getWriter, getConfig } from \"./pregel/utils/config.js\";\nexport { getPreviousState } from \"./func/index.js\";\nexport { getCurrentTaskInput } from \"./pregel/utils/config.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,sCAAsC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,sCAAsC"}
@@ -905,25 +905,23 @@ var Pregel = class extends PartialRunnable {
905
905
  */
906
906
  async stream(input, options) {
907
907
  const abortController = new AbortController();
908
- const { signal: combinedSignal, dispose: disposeCombinedSignal } = require_index.combineAbortSignals(options?.signal, abortController.signal);
909
908
  const config = {
910
909
  recursionLimit: this.config?.recursionLimit,
911
910
  ...options,
912
- signal: combinedSignal
911
+ signal: require_index.combineAbortSignals(options?.signal, abortController.signal).signal
913
912
  };
914
913
  const stream = await super.stream(input, config);
915
- return new require_stream.IterableReadableStreamWithAbortSignal(options?.encoding === "text/event-stream" ? require_stream.toEventStream(stream) : stream, abortController, disposeCombinedSignal);
914
+ return new require_stream.IterableReadableStreamWithAbortSignal(options?.encoding === "text/event-stream" ? require_stream.toEventStream(stream) : stream, abortController);
916
915
  }
917
916
  streamEvents(input, options, streamOptions) {
918
917
  const abortController = new AbortController();
919
- const { signal: combinedSignal, dispose: disposeCombinedSignal } = require_index.combineAbortSignals(options?.signal, abortController.signal);
920
918
  const config = {
921
919
  recursionLimit: this.config?.recursionLimit,
922
920
  ...options,
923
921
  callbacks: require_index.combineCallbacks(this.config?.callbacks, options?.callbacks),
924
- signal: combinedSignal
922
+ signal: require_index.combineAbortSignals(options?.signal, abortController.signal).signal
925
923
  };
926
- return new require_stream.IterableReadableStreamWithAbortSignal(super.streamEvents(input, config, streamOptions), abortController, disposeCombinedSignal);
924
+ return new require_stream.IterableReadableStreamWithAbortSignal(super.streamEvents(input, config, streamOptions), abortController);
927
925
  }
928
926
  /**
929
927
  * Validates the input for the graph.
@@ -961,6 +959,10 @@ var Pregel = class extends PartialRunnable {
961
959
  const validInput = await this._validateInput(input);
962
960
  const { runId, ...restConfig } = inputConfig;
963
961
  const [debug, streamMode, , outputKeys, config, interruptBefore, interruptAfter, checkpointer, store, streamModeSingle, cache, durability] = this._defaults(restConfig);
962
+ config.metadata = {
963
+ ls_integration: "langgraph",
964
+ ...config.metadata
965
+ };
964
966
  if (typeof config.context !== "undefined") config.context = await this._validateContext(config.context);
965
967
  else config.configurable = await this._validateContext(config.configurable);
966
968
  const stream = new require_stream.IterableReadableWritableStream({ modes: new Set(streamMode) });