@langchain/langgraph 1.2.0 → 1.2.2

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.
Files changed (47) hide show
  1. package/dist/constants.cjs +6 -1
  2. package/dist/constants.cjs.map +1 -1
  3. package/dist/constants.d.cts +6 -2
  4. package/dist/constants.d.cts.map +1 -1
  5. package/dist/constants.d.ts +6 -2
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/constants.js +6 -2
  8. package/dist/constants.js.map +1 -1
  9. package/dist/graph/messages_annotation.d.ts +0 -1
  10. package/dist/graph/messages_annotation.d.ts.map +1 -1
  11. package/dist/graph/zod/index.d.cts +0 -1
  12. package/dist/graph/zod/index.d.ts +0 -1
  13. package/dist/index.cjs +2 -0
  14. package/dist/index.d.cts +2 -2
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js +2 -2
  17. package/dist/prebuilt/agent_executor.d.ts +0 -1
  18. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  19. package/dist/prebuilt/react_agent_executor.d.ts +0 -2
  20. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  21. package/dist/pregel/algo.d.ts +0 -5
  22. package/dist/pregel/algo.d.ts.map +1 -1
  23. package/dist/pregel/read.d.ts +0 -1
  24. package/dist/pregel/read.d.ts.map +1 -1
  25. package/dist/pregel/remote.d.ts +0 -2
  26. package/dist/pregel/remote.d.ts.map +1 -1
  27. package/dist/pregel/stream.d.ts +0 -1
  28. package/dist/state/index.d.ts +1 -2
  29. package/dist/state/schema.d.ts +0 -1
  30. package/dist/state/schema.d.ts.map +1 -1
  31. package/dist/state/values/reduced.cjs.map +1 -1
  32. package/dist/state/values/reduced.d.cts +2 -6
  33. package/dist/state/values/reduced.d.cts.map +1 -1
  34. package/dist/state/values/reduced.d.ts +2 -6
  35. package/dist/state/values/reduced.d.ts.map +1 -1
  36. package/dist/state/values/reduced.js.map +1 -1
  37. package/dist/state/values/untracked.cjs.map +1 -1
  38. package/dist/state/values/untracked.d.cts +2 -6
  39. package/dist/state/values/untracked.d.cts.map +1 -1
  40. package/dist/state/values/untracked.d.ts +2 -6
  41. package/dist/state/values/untracked.d.ts.map +1 -1
  42. package/dist/state/values/untracked.js.map +1 -1
  43. package/dist/web.cjs +2 -0
  44. package/dist/web.d.cts +2 -2
  45. package/dist/web.d.ts +2 -5
  46. package/dist/web.js +2 -2
  47. package/package.json +2 -2
@@ -69,7 +69,11 @@ const RESERVED = [
69
69
  ];
70
70
  const CHECKPOINT_NAMESPACE_SEPARATOR = "|";
71
71
  const CHECKPOINT_NAMESPACE_END = ":";
72
- /** @internal */
72
+ /**
73
+ * Symbol used internally to identify Command instances.
74
+ * Exported to support cross-version type compatibility.
75
+ * @internal
76
+ */
73
77
  const COMMAND_SYMBOL = Symbol.for("langgraph.command");
74
78
  /**
75
79
  * Instance of a {@link Command} class.
@@ -437,6 +441,7 @@ function _deserializeCommandSendObjectGraph(x, seen = /* @__PURE__ */ new Map())
437
441
  exports.CACHE_NS_WRITES = CACHE_NS_WRITES;
438
442
  exports.CHECKPOINT_NAMESPACE_END = CHECKPOINT_NAMESPACE_END;
439
443
  exports.CHECKPOINT_NAMESPACE_SEPARATOR = CHECKPOINT_NAMESPACE_SEPARATOR;
444
+ exports.COMMAND_SYMBOL = COMMAND_SYMBOL;
440
445
  exports.CONFIG_KEY_ABORT_SIGNALS = CONFIG_KEY_ABORT_SIGNALS;
441
446
  exports.CONFIG_KEY_CALL = CONFIG_KEY_CALL;
442
447
  exports.CONFIG_KEY_CHECKPOINTER = CONFIG_KEY_CHECKPOINTER;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { PendingWrite } from \"@langchain/langgraph-checkpoint\";\n\n/** Special reserved node name denoting the start of a graph. */\nexport const START = \"__start__\";\n/** Special reserved node name denoting the end of a graph. */\nexport const END = \"__end__\";\nexport const INPUT = \"__input__\";\nexport const COPY = \"__copy__\";\nexport const ERROR = \"__error__\";\n\n/** Special reserved cache namespaces */\nexport const CACHE_NS_WRITES = \"__pregel_ns_writes\";\n\nexport const CONFIG_KEY_SEND = \"__pregel_send\";\n/** config key containing function used to call a node (push task) */\nexport const CONFIG_KEY_CALL = \"__pregel_call\";\nexport const CONFIG_KEY_READ = \"__pregel_read\";\nexport const CONFIG_KEY_CHECKPOINTER = \"__pregel_checkpointer\";\nexport const CONFIG_KEY_RESUMING = \"__pregel_resuming\";\nexport const CONFIG_KEY_TASK_ID = \"__pregel_task_id\";\nexport const CONFIG_KEY_STREAM = \"__pregel_stream\";\nexport const CONFIG_KEY_RESUME_VALUE = \"__pregel_resume_value\";\nexport const CONFIG_KEY_RESUME_MAP = \"__pregel_resume_map\";\nexport const CONFIG_KEY_SCRATCHPAD = \"__pregel_scratchpad\";\n/** config key containing state from previous invocation of graph for the given thread */\nexport const CONFIG_KEY_PREVIOUS_STATE = \"__pregel_previous\";\nexport const CONFIG_KEY_DURABILITY = \"__pregel_durability\";\nexport const CONFIG_KEY_CHECKPOINT_ID = \"checkpoint_id\";\nexport const CONFIG_KEY_CHECKPOINT_NS = \"checkpoint_ns\";\n\nexport const CONFIG_KEY_NODE_FINISHED = \"__pregel_node_finished\";\n\n// this one is part of public API\nexport const CONFIG_KEY_CHECKPOINT_MAP = \"checkpoint_map\";\n\nexport const CONFIG_KEY_ABORT_SIGNALS = \"__pregel_abort_signals\";\n\n/** Special channel reserved for graph interrupts */\nexport const INTERRUPT = \"__interrupt__\";\n/** Special channel reserved for graph resume */\nexport const RESUME = \"__resume__\";\n/** Special channel reserved for cases when a task exits without any writes */\nexport const NO_WRITES = \"__no_writes__\";\n/** Special channel reserved for graph return */\nexport const RETURN = \"__return__\";\n/** Special channel reserved for graph previous state */\nexport const PREVIOUS = \"__previous__\";\nexport const RUNTIME_PLACEHOLDER = \"__pregel_runtime_placeholder__\";\nexport const RECURSION_LIMIT_DEFAULT = 25;\n\nexport const TAG_HIDDEN = \"langsmith:hidden\";\nexport const TAG_NOSTREAM = \"langsmith:nostream\";\nexport const SELF = \"__self__\";\n\nexport const TASKS = \"__pregel_tasks\";\nexport const PUSH = \"__pregel_push\";\nexport const PULL = \"__pregel_pull\";\n\nexport const TASK_NAMESPACE = \"6ba7b831-9dad-11d1-80b4-00c04fd430c8\";\nexport const NULL_TASK_ID = \"00000000-0000-0000-0000-000000000000\";\n\nexport const RESERVED = [\n TAG_HIDDEN,\n INPUT,\n INTERRUPT,\n RESUME,\n ERROR,\n NO_WRITES,\n\n // reserved config.configurable keys\n CONFIG_KEY_SEND,\n CONFIG_KEY_READ,\n CONFIG_KEY_CHECKPOINTER,\n CONFIG_KEY_DURABILITY,\n CONFIG_KEY_STREAM,\n CONFIG_KEY_RESUMING,\n CONFIG_KEY_TASK_ID,\n CONFIG_KEY_CALL,\n CONFIG_KEY_RESUME_VALUE,\n CONFIG_KEY_SCRATCHPAD,\n CONFIG_KEY_PREVIOUS_STATE,\n CONFIG_KEY_CHECKPOINT_MAP,\n CONFIG_KEY_CHECKPOINT_NS,\n CONFIG_KEY_CHECKPOINT_ID,\n];\n\nexport const CHECKPOINT_NAMESPACE_SEPARATOR = \"|\";\nexport const CHECKPOINT_NAMESPACE_END = \":\";\n\n/** @internal */\nconst COMMAND_SYMBOL = Symbol.for(\"langgraph.command\");\n\n/**\n * Instance of a {@link Command} class.\n *\n * This is used to avoid IntelliSense suggesting public fields\n * of {@link Command} class when a plain object is expected.\n *\n * @see {@link Command}\n * @internal\n */\nexport class CommandInstance<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> {\n [COMMAND_SYMBOL]: CommandParams<Resume, Update, Nodes>;\n\n constructor(args: CommandParams<Resume, Update, Nodes>) {\n this[COMMAND_SYMBOL] = args;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SendInterface<Node extends string = string, Args = any> {\n node: Node;\n args: Args;\n}\n\nexport function _isSendInterface(x: unknown): x is SendInterface {\n const operation = x as SendInterface;\n return (\n operation !== null &&\n operation !== undefined &&\n typeof operation.node === \"string\" &&\n operation.args !== undefined\n );\n}\n\n/**\n *\n * A message or packet to send to a specific node in the graph.\n *\n * The `Send` class is used within a `StateGraph`'s conditional edges to\n * dynamically invoke a node with a custom state at the next step.\n *\n * Importantly, the sent state can differ from the core graph's state,\n * allowing for flexible and dynamic workflow management.\n *\n * One such example is a \"map-reduce\" workflow where your graph invokes\n * the same node multiple times in parallel with different states,\n * before aggregating the results back into the main graph's state.\n *\n * @example\n * ```typescript\n * import { Annotation, Send, StateGraph } from \"@langchain/langgraph\";\n *\n * const ChainState = Annotation.Root({\n * subjects: Annotation<string[]>,\n * jokes: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * }),\n * });\n *\n * const continueToJokes = async (state: typeof ChainState.State) => {\n * return state.subjects.map((subject) => {\n * return new Send(\"generate_joke\", { subjects: [subject] });\n * });\n * };\n *\n * const graph = new StateGraph(ChainState)\n * .addNode(\"generate_joke\", (state) => ({\n * jokes: [`Joke about ${state.subjects}`],\n * }))\n * .addConditionalEdges(\"__start__\", continueToJokes)\n * .addEdge(\"generate_joke\", \"__end__\")\n * .compile();\n *\n * const res = await graph.invoke({ subjects: [\"cats\", \"dogs\"] });\n * console.log(res);\n *\n * // Invoking with two subjects results in a generated joke for each\n * // { subjects: [\"cats\", \"dogs\"], jokes: [`Joke about cats`, `Joke about dogs`] }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Send<Node extends string = string, Args = any>\n implements SendInterface<Node, Args>\n{\n lg_name = \"Send\";\n\n public node: Node;\n\n public args: Args;\n\n constructor(node: Node, args: Args) {\n this.node = node;\n this.args = _deserializeCommandSendObjectGraph(args) as Args;\n }\n\n toJSON() {\n return { lg_name: this.lg_name, node: this.node, args: this.args };\n }\n}\n\nexport function _isSend(x: unknown): x is Send {\n // eslint-disable-next-line no-instanceof/no-instanceof\n return x instanceof Send;\n}\n\nexport const OVERWRITE = \"__overwrite__\";\n\n/**\n * An object representing a direct overwrite of a value for a channel.\n * Used to signal that the channel value should be replaced with the given value,\n * bypassing any reducer or binary operator logic.\n *\n * @template ValueType - The type of the value being overwritten.\n * @property {ValueType} [OVERWRITE] - The value to directly set.\n *\n * @example\n * const overwriteObj: OverwriteValue<number> = { __overwrite__: 123 };\n */\nexport interface OverwriteValue<ValueType> {\n [OVERWRITE]: ValueType;\n}\n\n/**\n * Bypass a reducer and write the wrapped value directly to a\n * {@link BinaryOperatorAggregate} channel.\n *\n * Receiving multiple `Overwrite` values for the same channel in a single\n * super-step will raise an {@link InvalidUpdateError}.\n *\n * @example\n * ```typescript\n * import { Annotation, StateGraph, Overwrite } from \"@langchain/langgraph\";\n *\n * const State = Annotation.Root({\n * messages: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * default: () => [],\n * }),\n * });\n *\n * const replaceMessages = (_state: typeof State.State) => {\n * return { messages: new Overwrite([\"replacement\"]) };\n * };\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Overwrite<ValueType = any> implements OverwriteValue<ValueType> {\n lg_name = \"Overwrite\";\n\n readonly [OVERWRITE]: ValueType;\n\n constructor(value: ValueType) {\n this[OVERWRITE] = value;\n }\n\n get value(): ValueType {\n return this[OVERWRITE];\n }\n\n toJSON() {\n return { [OVERWRITE]: this[OVERWRITE] };\n }\n\n static isInstance<ValueType>(value: unknown): value is Overwrite<ValueType> {\n if (!value || typeof value !== \"object\") return false;\n if (OVERWRITE in value) return true;\n if (\"lg_name\" in value && value.lg_name === \"Overwrite\") return true;\n return false;\n }\n}\n\n/**\n * Helper function to detect and extract the value from an Overwrite wrapper,\n * supporting both the Overwrite class instance and the serialized object format.\n *\n * Use to check if a provided value represents an Overwrite: returns the\n * unwrapped value if so, or undefined otherwise.\n *\n * - If the value is an Overwrite instance (preferred API), return its `.value`.\n * - If the value is a wire-format object ({ [OVERWRITE]: value }), extract it.\n * - Otherwise, returns undefined.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns The unwrapped value if value is an Overwrite, or undefined otherwise.\n * @internal\n */\nexport function _getOverwriteValue<ValueType>(\n value: unknown\n): [true, ValueType] | [false, undefined] {\n if (typeof value === \"object\" && value !== null && OVERWRITE in value) {\n return [true, (value as Record<string, ValueType>)[OVERWRITE]];\n }\n return [false, undefined];\n}\n\n/**\n * Type guard to check if a value is an Overwrite value -- either the class\n * instance or the wire format object.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns `true` if the value is an Overwrite value, `false` otherwise.\n * @internal\n */\nexport function _isOverwriteValue<ValueType>(\n value: unknown\n): value is OverwriteValue<ValueType> {\n return _getOverwriteValue<ValueType>(value)[0];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Interrupt<Value = any> = {\n id?: string;\n value?: Value;\n};\n\n/**\n * Checks if the given graph invoke / stream chunk contains interrupt.\n *\n * @example\n * ```ts\n * import { INTERRUPT, isInterrupted } from \"@langchain/langgraph\";\n *\n * const values = await graph.invoke({ foo: \"bar\" });\n * if (isInterrupted<string>(values)) {\n * const interrupt = values[INTERRUPT][0].value;\n * }\n * ```\n *\n * @param values - The values to check.\n * @returns `true` if the values contain an interrupt, `false` otherwise.\n */\nexport function isInterrupted<Value = unknown>(\n values: unknown\n): values is { [INTERRUPT]: Interrupt<Value>[] } {\n if (!values || typeof values !== \"object\") return false;\n if (!(INTERRUPT in values)) return false;\n return Array.isArray(values[INTERRUPT]);\n}\n\nexport type CommandParams<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> = {\n /**\n * A discriminator field used to identify the type of object. Must be populated when serializing.\n *\n * Optional because it's not required to specify this when directly constructing a {@link Command}\n * object.\n */\n lg_name?: \"Command\";\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - `Send` object (to execute a node with the input provided)\n * - sequence of `Send` objects\n */\n goto?:\n | Nodes\n | SendInterface<Nodes> // eslint-disable-line @typescript-eslint/no-explicit-any\n | (Nodes | SendInterface<Nodes>)[]; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/**\n * One or more commands to update the graph's state and send messages to nodes.\n * Can be used to combine routing logic with state updates in lieu of conditional edges\n *\n * @example\n * ```ts\n * import { Annotation, Command } from \"@langchain/langgraph\";\n *\n * // Define graph state\n * const StateAnnotation = Annotation.Root({\n * foo: Annotation<string>,\n * });\n *\n * // Define the nodes\n * const nodeA = async (_state: typeof StateAnnotation.State) => {\n * console.log(\"Called A\");\n * // this is a replacement for a real conditional edge function\n * const goto = Math.random() > .5 ? \"nodeB\" : \"nodeC\";\n * // note how Command allows you to BOTH update the graph state AND route to the next node\n * return new Command({\n * // this is the state update\n * update: {\n * foo: \"a\",\n * },\n * // this is a replacement for an edge\n * goto,\n * });\n * };\n *\n * // Nodes B and C are unchanged\n * const nodeB = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called B\");\n * return {\n * foo: state.foo + \"|b\",\n * };\n * }\n *\n * const nodeC = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called C\");\n * return {\n * foo: state.foo + \"|c\",\n * };\n * }\n * \n * import { StateGraph } from \"@langchain/langgraph\";\n\n * // NOTE: there are no edges between nodes A, B and C!\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(\"nodeA\", nodeA, {\n * ends: [\"nodeB\", \"nodeC\"],\n * })\n * .addNode(\"nodeB\", nodeB)\n * .addNode(\"nodeC\", nodeC)\n * .addEdge(\"__start__\", \"nodeA\")\n * .compile();\n * \n * await graph.invoke({ foo: \"\" });\n *\n * // Randomly oscillates between\n * // { foo: 'a|c' } and { foo: 'a|b' }\n * ```\n */\nexport class Command<\n Resume = unknown,\n Update extends Record<string, unknown> = Record<string, unknown>,\n Nodes extends string = string\n> extends CommandInstance<Resume, Update, Nodes> {\n readonly lg_name = \"Command\";\n\n lc_direct_tool_output = true;\n\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state as a result of executing the node that is returning the command.\n * Written to the state as if the node had simply returned this value instead of the Command object.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - {@link Send} object (to execute a node with the exact input provided in the {@link Send} object)\n * - sequence of {@link Send} objects\n */\n goto?: Nodes | Send<Nodes> | (Nodes | Send<Nodes>)[] = [];\n\n static PARENT = \"__parent__\";\n\n constructor(args: Omit<CommandParams<Resume, Update, Nodes>, \"lg_name\">) {\n super(args);\n this.resume = args.resume;\n this.graph = args.graph;\n this.update = args.update;\n if (args.goto) {\n type ValidArg = Nodes | Send<Nodes, Update>;\n\n this.goto = Array.isArray(args.goto)\n ? (_deserializeCommandSendObjectGraph(args.goto) as ValidArg[])\n : [_deserializeCommandSendObjectGraph(args.goto) as ValidArg];\n }\n }\n\n /**\n * Convert the update field to a list of {@link PendingWrite} tuples\n * @returns List of {@link PendingWrite} tuples of the form `[channelKey, value]`.\n * @internal\n */\n _updateAsTuples(): PendingWrite[] {\n if (\n this.update &&\n typeof this.update === \"object\" &&\n !Array.isArray(this.update)\n ) {\n return Object.entries(this.update);\n } else if (\n Array.isArray(this.update) &&\n this.update.every(\n (t): t is [string, unknown] =>\n Array.isArray(t) && t.length === 2 && typeof t[0] === \"string\"\n )\n ) {\n return this.update;\n } else {\n return [[\"__root__\", this.update]];\n }\n }\n\n toJSON() {\n let serializedGoto;\n if (typeof this.goto === \"string\") {\n serializedGoto = this.goto;\n } else if (_isSend(this.goto)) {\n serializedGoto = this.goto.toJSON();\n } else {\n serializedGoto = this.goto?.map((innerGoto) => {\n if (typeof innerGoto === \"string\") {\n return innerGoto;\n } else {\n return innerGoto.toJSON();\n }\n });\n }\n return {\n lg_name: this.lg_name,\n update: this.update,\n resume: this.resume,\n goto: serializedGoto,\n };\n }\n}\n\n/**\n * A type guard to check if the given value is a {@link Command}.\n *\n * Useful for type narrowing when working with the {@link Command} object.\n *\n * @param x - The value to check.\n * @returns `true` if the value is a {@link Command}, `false` otherwise.\n */\nexport function isCommand(x: unknown): x is Command {\n if (typeof x !== \"object\") {\n return false;\n }\n\n if (x === null || x === undefined) {\n return false;\n }\n\n if (\"lg_name\" in x && x.lg_name === \"Command\") {\n return true;\n }\n\n return false;\n}\n\n/**\n * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects\n * matching their interfaces.\n *\n * This is only exported for testing purposes. It is NOT intended to be used outside of\n * the Command and Send classes.\n *\n * @internal\n *\n * @param x - The command send tree to convert.\n * @param seen - A map of seen objects to avoid infinite loops.\n * @returns The converted command send tree.\n */\nexport function _deserializeCommandSendObjectGraph(\n x: unknown,\n seen: Map<object, unknown> = new Map()\n): unknown {\n if (x !== undefined && x !== null && typeof x === \"object\") {\n // If we've already processed this object, return the transformed version\n if (seen.has(x)) {\n return seen.get(x);\n }\n\n let result: unknown;\n\n if (Array.isArray(x)) {\n // Create the array first, then populate it\n result = [];\n // Add to seen map before processing elements to handle self-references\n seen.set(x, result);\n\n // Now populate the array\n x.forEach((item, index) => {\n (result as unknown[])[index] = _deserializeCommandSendObjectGraph(\n item,\n seen\n );\n });\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (isCommand(x) && !(x instanceof Command)) {\n result = new Command(x);\n seen.set(x, result);\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (_isSendInterface(x) && !(x instanceof Send)) {\n result = new Send(x.node, x.args);\n seen.set(x, result);\n } else if (isCommand(x) || _isSend(x)) {\n result = x;\n seen.set(x, result);\n } else if (\"lc_serializable\" in x && x.lc_serializable) {\n result = x;\n seen.set(x, result);\n } else {\n // Create empty object first\n result = {};\n // Add to seen map before processing properties to handle self-references\n seen.set(x, result);\n\n // Now populate the object\n for (const [key, value] of Object.entries(x)) {\n (result as Record<string, unknown>)[key] =\n _deserializeCommandSendObjectGraph(value, seen);\n }\n }\n\n return result;\n }\n return x;\n}\n"],"mappings":";;;AAGA,MAAa,QAAQ;;AAErB,MAAa,MAAM;AACnB,MAAa,QAAQ;AACrB,MAAa,OAAO;AACpB,MAAa,QAAQ;;AAGrB,MAAa,kBAAkB;AAE/B,MAAa,kBAAkB;;AAE/B,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;AAC/B,MAAa,0BAA0B;AACvC,MAAa,sBAAsB;AACnC,MAAa,qBAAqB;AAClC,MAAa,oBAAoB;AACjC,MAAa,0BAA0B;AACvC,MAAa,wBAAwB;AACrC,MAAa,wBAAwB;;AAErC,MAAa,4BAA4B;AACzC,MAAa,wBAAwB;AACrC,MAAa,2BAA2B;AACxC,MAAa,2BAA2B;AAExC,MAAa,2BAA2B;AAGxC,MAAa,4BAA4B;AAEzC,MAAa,2BAA2B;;AAGxC,MAAa,YAAY;;AAEzB,MAAa,SAAS;;AAEtB,MAAa,YAAY;;AAEzB,MAAa,SAAS;;AAEtB,MAAa,WAAW;AAIxB,MAAa,aAAa;AAC1B,MAAa,eAAe;AAC5B,MAAa,OAAO;AAEpB,MAAa,QAAQ;AACrB,MAAa,OAAO;AACpB,MAAa,OAAO;AAGpB,MAAa,eAAe;AAE5B,MAAa,WAAW;CACtB;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,iCAAiC;AAC9C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ingWrite } from \"@langchain/langgraph-checkpoint\";\n\n/** Special reserved node name denoting the start of a graph. */\nexport const START = \"__start__\";\n/** Special reserved node name denoting the end of a graph. */\nexport const END = \"__end__\";\nexport const INPUT = \"__input__\";\nexport const COPY = \"__copy__\";\nexport const ERROR = \"__error__\";\n\n/** Special reserved cache namespaces */\nexport const CACHE_NS_WRITES = \"__pregel_ns_writes\";\n\nexport const CONFIG_KEY_SEND = \"__pregel_send\";\n/** config key containing function used to call a node (push task) */\nexport const CONFIG_KEY_CALL = \"__pregel_call\";\nexport const CONFIG_KEY_READ = \"__pregel_read\";\nexport const CONFIG_KEY_CHECKPOINTER = \"__pregel_checkpointer\";\nexport const CONFIG_KEY_RESUMING = \"__pregel_resuming\";\nexport const CONFIG_KEY_TASK_ID = \"__pregel_task_id\";\nexport const CONFIG_KEY_STREAM = \"__pregel_stream\";\nexport const CONFIG_KEY_RESUME_VALUE = \"__pregel_resume_value\";\nexport const CONFIG_KEY_RESUME_MAP = \"__pregel_resume_map\";\nexport const CONFIG_KEY_SCRATCHPAD = \"__pregel_scratchpad\";\n/** config key containing state from previous invocation of graph for the given thread */\nexport const CONFIG_KEY_PREVIOUS_STATE = \"__pregel_previous\";\nexport const CONFIG_KEY_DURABILITY = \"__pregel_durability\";\nexport const CONFIG_KEY_CHECKPOINT_ID = \"checkpoint_id\";\nexport const CONFIG_KEY_CHECKPOINT_NS = \"checkpoint_ns\";\n\nexport const CONFIG_KEY_NODE_FINISHED = \"__pregel_node_finished\";\n\n// this one is part of public API\nexport const CONFIG_KEY_CHECKPOINT_MAP = \"checkpoint_map\";\n\nexport const CONFIG_KEY_ABORT_SIGNALS = \"__pregel_abort_signals\";\n\n/** Special channel reserved for graph interrupts */\nexport const INTERRUPT = \"__interrupt__\";\n/** Special channel reserved for graph resume */\nexport const RESUME = \"__resume__\";\n/** Special channel reserved for cases when a task exits without any writes */\nexport const NO_WRITES = \"__no_writes__\";\n/** Special channel reserved for graph return */\nexport const RETURN = \"__return__\";\n/** Special channel reserved for graph previous state */\nexport const PREVIOUS = \"__previous__\";\nexport const RUNTIME_PLACEHOLDER = \"__pregel_runtime_placeholder__\";\nexport const RECURSION_LIMIT_DEFAULT = 25;\n\nexport const TAG_HIDDEN = \"langsmith:hidden\";\nexport const TAG_NOSTREAM = \"langsmith:nostream\";\nexport const SELF = \"__self__\";\n\nexport const TASKS = \"__pregel_tasks\";\nexport const PUSH = \"__pregel_push\";\nexport const PULL = \"__pregel_pull\";\n\nexport const TASK_NAMESPACE = \"6ba7b831-9dad-11d1-80b4-00c04fd430c8\";\nexport const NULL_TASK_ID = \"00000000-0000-0000-0000-000000000000\";\n\nexport const RESERVED = [\n TAG_HIDDEN,\n INPUT,\n INTERRUPT,\n RESUME,\n ERROR,\n NO_WRITES,\n\n // reserved config.configurable keys\n CONFIG_KEY_SEND,\n CONFIG_KEY_READ,\n CONFIG_KEY_CHECKPOINTER,\n CONFIG_KEY_DURABILITY,\n CONFIG_KEY_STREAM,\n CONFIG_KEY_RESUMING,\n CONFIG_KEY_TASK_ID,\n CONFIG_KEY_CALL,\n CONFIG_KEY_RESUME_VALUE,\n CONFIG_KEY_SCRATCHPAD,\n CONFIG_KEY_PREVIOUS_STATE,\n CONFIG_KEY_CHECKPOINT_MAP,\n CONFIG_KEY_CHECKPOINT_NS,\n CONFIG_KEY_CHECKPOINT_ID,\n];\n\nexport const CHECKPOINT_NAMESPACE_SEPARATOR = \"|\";\nexport const CHECKPOINT_NAMESPACE_END = \":\";\n\n/**\n * Symbol used internally to identify Command instances.\n * Exported to support cross-version type compatibility.\n * @internal\n */\nexport const COMMAND_SYMBOL = Symbol.for(\"langgraph.command\");\n\n/**\n * Instance of a {@link Command} class.\n *\n * This is used to avoid IntelliSense suggesting public fields\n * of {@link Command} class when a plain object is expected.\n *\n * @see {@link Command}\n * @internal\n */\nexport class CommandInstance<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> {\n [COMMAND_SYMBOL]: CommandParams<Resume, Update, Nodes>;\n\n constructor(args: CommandParams<Resume, Update, Nodes>) {\n this[COMMAND_SYMBOL] = args;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SendInterface<Node extends string = string, Args = any> {\n node: Node;\n args: Args;\n}\n\nexport function _isSendInterface(x: unknown): x is SendInterface {\n const operation = x as SendInterface;\n return (\n operation !== null &&\n operation !== undefined &&\n typeof operation.node === \"string\" &&\n operation.args !== undefined\n );\n}\n\n/**\n *\n * A message or packet to send to a specific node in the graph.\n *\n * The `Send` class is used within a `StateGraph`'s conditional edges to\n * dynamically invoke a node with a custom state at the next step.\n *\n * Importantly, the sent state can differ from the core graph's state,\n * allowing for flexible and dynamic workflow management.\n *\n * One such example is a \"map-reduce\" workflow where your graph invokes\n * the same node multiple times in parallel with different states,\n * before aggregating the results back into the main graph's state.\n *\n * @example\n * ```typescript\n * import { Annotation, Send, StateGraph } from \"@langchain/langgraph\";\n *\n * const ChainState = Annotation.Root({\n * subjects: Annotation<string[]>,\n * jokes: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * }),\n * });\n *\n * const continueToJokes = async (state: typeof ChainState.State) => {\n * return state.subjects.map((subject) => {\n * return new Send(\"generate_joke\", { subjects: [subject] });\n * });\n * };\n *\n * const graph = new StateGraph(ChainState)\n * .addNode(\"generate_joke\", (state) => ({\n * jokes: [`Joke about ${state.subjects}`],\n * }))\n * .addConditionalEdges(\"__start__\", continueToJokes)\n * .addEdge(\"generate_joke\", \"__end__\")\n * .compile();\n *\n * const res = await graph.invoke({ subjects: [\"cats\", \"dogs\"] });\n * console.log(res);\n *\n * // Invoking with two subjects results in a generated joke for each\n * // { subjects: [\"cats\", \"dogs\"], jokes: [`Joke about cats`, `Joke about dogs`] }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Send<Node extends string = string, Args = any>\n implements SendInterface<Node, Args>\n{\n lg_name = \"Send\";\n\n public node: Node;\n\n public args: Args;\n\n constructor(node: Node, args: Args) {\n this.node = node;\n this.args = _deserializeCommandSendObjectGraph(args) as Args;\n }\n\n toJSON() {\n return { lg_name: this.lg_name, node: this.node, args: this.args };\n }\n}\n\nexport function _isSend(x: unknown): x is Send {\n // eslint-disable-next-line no-instanceof/no-instanceof\n return x instanceof Send;\n}\n\nexport const OVERWRITE = \"__overwrite__\";\n\n/**\n * An object representing a direct overwrite of a value for a channel.\n * Used to signal that the channel value should be replaced with the given value,\n * bypassing any reducer or binary operator logic.\n *\n * @template ValueType - The type of the value being overwritten.\n * @property {ValueType} [OVERWRITE] - The value to directly set.\n *\n * @example\n * const overwriteObj: OverwriteValue<number> = { __overwrite__: 123 };\n */\nexport interface OverwriteValue<ValueType> {\n [OVERWRITE]: ValueType;\n}\n\n/**\n * Bypass a reducer and write the wrapped value directly to a\n * {@link BinaryOperatorAggregate} channel.\n *\n * Receiving multiple `Overwrite` values for the same channel in a single\n * super-step will raise an {@link InvalidUpdateError}.\n *\n * @example\n * ```typescript\n * import { Annotation, StateGraph, Overwrite } from \"@langchain/langgraph\";\n *\n * const State = Annotation.Root({\n * messages: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * default: () => [],\n * }),\n * });\n *\n * const replaceMessages = (_state: typeof State.State) => {\n * return { messages: new Overwrite([\"replacement\"]) };\n * };\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Overwrite<ValueType = any> implements OverwriteValue<ValueType> {\n lg_name = \"Overwrite\";\n\n readonly [OVERWRITE]: ValueType;\n\n constructor(value: ValueType) {\n this[OVERWRITE] = value;\n }\n\n get value(): ValueType {\n return this[OVERWRITE];\n }\n\n toJSON() {\n return { [OVERWRITE]: this[OVERWRITE] };\n }\n\n static isInstance<ValueType>(value: unknown): value is Overwrite<ValueType> {\n if (!value || typeof value !== \"object\") return false;\n if (OVERWRITE in value) return true;\n if (\"lg_name\" in value && value.lg_name === \"Overwrite\") return true;\n return false;\n }\n}\n\n/**\n * Helper function to detect and extract the value from an Overwrite wrapper,\n * supporting both the Overwrite class instance and the serialized object format.\n *\n * Use to check if a provided value represents an Overwrite: returns the\n * unwrapped value if so, or undefined otherwise.\n *\n * - If the value is an Overwrite instance (preferred API), return its `.value`.\n * - If the value is a wire-format object ({ [OVERWRITE]: value }), extract it.\n * - Otherwise, returns undefined.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns The unwrapped value if value is an Overwrite, or undefined otherwise.\n * @internal\n */\nexport function _getOverwriteValue<ValueType>(\n value: unknown\n): [true, ValueType] | [false, undefined] {\n if (typeof value === \"object\" && value !== null && OVERWRITE in value) {\n return [true, (value as Record<string, ValueType>)[OVERWRITE]];\n }\n return [false, undefined];\n}\n\n/**\n * Type guard to check if a value is an Overwrite value -- either the class\n * instance or the wire format object.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns `true` if the value is an Overwrite value, `false` otherwise.\n * @internal\n */\nexport function _isOverwriteValue<ValueType>(\n value: unknown\n): value is OverwriteValue<ValueType> {\n return _getOverwriteValue<ValueType>(value)[0];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Interrupt<Value = any> = {\n id?: string;\n value?: Value;\n};\n\n/**\n * Checks if the given graph invoke / stream chunk contains interrupt.\n *\n * @example\n * ```ts\n * import { INTERRUPT, isInterrupted } from \"@langchain/langgraph\";\n *\n * const values = await graph.invoke({ foo: \"bar\" });\n * if (isInterrupted<string>(values)) {\n * const interrupt = values[INTERRUPT][0].value;\n * }\n * ```\n *\n * @param values - The values to check.\n * @returns `true` if the values contain an interrupt, `false` otherwise.\n */\nexport function isInterrupted<Value = unknown>(\n values: unknown\n): values is { [INTERRUPT]: Interrupt<Value>[] } {\n if (!values || typeof values !== \"object\") return false;\n if (!(INTERRUPT in values)) return false;\n return Array.isArray(values[INTERRUPT]);\n}\n\nexport type CommandParams<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> = {\n /**\n * A discriminator field used to identify the type of object. Must be populated when serializing.\n *\n * Optional because it's not required to specify this when directly constructing a {@link Command}\n * object.\n */\n lg_name?: \"Command\";\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - `Send` object (to execute a node with the input provided)\n * - sequence of `Send` objects\n */\n goto?:\n | Nodes\n | SendInterface<Nodes> // eslint-disable-line @typescript-eslint/no-explicit-any\n | (Nodes | SendInterface<Nodes>)[]; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/**\n * One or more commands to update the graph's state and send messages to nodes.\n * Can be used to combine routing logic with state updates in lieu of conditional edges\n *\n * @example\n * ```ts\n * import { Annotation, Command } from \"@langchain/langgraph\";\n *\n * // Define graph state\n * const StateAnnotation = Annotation.Root({\n * foo: Annotation<string>,\n * });\n *\n * // Define the nodes\n * const nodeA = async (_state: typeof StateAnnotation.State) => {\n * console.log(\"Called A\");\n * // this is a replacement for a real conditional edge function\n * const goto = Math.random() > .5 ? \"nodeB\" : \"nodeC\";\n * // note how Command allows you to BOTH update the graph state AND route to the next node\n * return new Command({\n * // this is the state update\n * update: {\n * foo: \"a\",\n * },\n * // this is a replacement for an edge\n * goto,\n * });\n * };\n *\n * // Nodes B and C are unchanged\n * const nodeB = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called B\");\n * return {\n * foo: state.foo + \"|b\",\n * };\n * }\n *\n * const nodeC = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called C\");\n * return {\n * foo: state.foo + \"|c\",\n * };\n * }\n * \n * import { StateGraph } from \"@langchain/langgraph\";\n\n * // NOTE: there are no edges between nodes A, B and C!\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(\"nodeA\", nodeA, {\n * ends: [\"nodeB\", \"nodeC\"],\n * })\n * .addNode(\"nodeB\", nodeB)\n * .addNode(\"nodeC\", nodeC)\n * .addEdge(\"__start__\", \"nodeA\")\n * .compile();\n * \n * await graph.invoke({ foo: \"\" });\n *\n * // Randomly oscillates between\n * // { foo: 'a|c' } and { foo: 'a|b' }\n * ```\n */\nexport class Command<\n Resume = unknown,\n Update extends Record<string, unknown> = Record<string, unknown>,\n Nodes extends string = string\n> extends CommandInstance<Resume, Update, Nodes> {\n readonly lg_name = \"Command\";\n\n lc_direct_tool_output = true;\n\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state as a result of executing the node that is returning the command.\n * Written to the state as if the node had simply returned this value instead of the Command object.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - {@link Send} object (to execute a node with the exact input provided in the {@link Send} object)\n * - sequence of {@link Send} objects\n */\n goto?: Nodes | Send<Nodes> | (Nodes | Send<Nodes>)[] = [];\n\n static PARENT = \"__parent__\";\n\n constructor(args: Omit<CommandParams<Resume, Update, Nodes>, \"lg_name\">) {\n super(args);\n this.resume = args.resume;\n this.graph = args.graph;\n this.update = args.update;\n if (args.goto) {\n type ValidArg = Nodes | Send<Nodes, Update>;\n\n this.goto = Array.isArray(args.goto)\n ? (_deserializeCommandSendObjectGraph(args.goto) as ValidArg[])\n : [_deserializeCommandSendObjectGraph(args.goto) as ValidArg];\n }\n }\n\n /**\n * Convert the update field to a list of {@link PendingWrite} tuples\n * @returns List of {@link PendingWrite} tuples of the form `[channelKey, value]`.\n * @internal\n */\n _updateAsTuples(): PendingWrite[] {\n if (\n this.update &&\n typeof this.update === \"object\" &&\n !Array.isArray(this.update)\n ) {\n return Object.entries(this.update);\n } else if (\n Array.isArray(this.update) &&\n this.update.every(\n (t): t is [string, unknown] =>\n Array.isArray(t) && t.length === 2 && typeof t[0] === \"string\"\n )\n ) {\n return this.update;\n } else {\n return [[\"__root__\", this.update]];\n }\n }\n\n toJSON() {\n let serializedGoto;\n if (typeof this.goto === \"string\") {\n serializedGoto = this.goto;\n } else if (_isSend(this.goto)) {\n serializedGoto = this.goto.toJSON();\n } else {\n serializedGoto = this.goto?.map((innerGoto) => {\n if (typeof innerGoto === \"string\") {\n return innerGoto;\n } else {\n return innerGoto.toJSON();\n }\n });\n }\n return {\n lg_name: this.lg_name,\n update: this.update,\n resume: this.resume,\n goto: serializedGoto,\n };\n }\n}\n\n/**\n * A type guard to check if the given value is a {@link Command}.\n *\n * Useful for type narrowing when working with the {@link Command} object.\n *\n * @param x - The value to check.\n * @returns `true` if the value is a {@link Command}, `false` otherwise.\n */\nexport function isCommand(x: unknown): x is Command {\n if (typeof x !== \"object\") {\n return false;\n }\n\n if (x === null || x === undefined) {\n return false;\n }\n\n if (\"lg_name\" in x && x.lg_name === \"Command\") {\n return true;\n }\n\n return false;\n}\n\n/**\n * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects\n * matching their interfaces.\n *\n * This is only exported for testing purposes. It is NOT intended to be used outside of\n * the Command and Send classes.\n *\n * @internal\n *\n * @param x - The command send tree to convert.\n * @param seen - A map of seen objects to avoid infinite loops.\n * @returns The converted command send tree.\n */\nexport function _deserializeCommandSendObjectGraph(\n x: unknown,\n seen: Map<object, unknown> = new Map()\n): unknown {\n if (x !== undefined && x !== null && typeof x === \"object\") {\n // If we've already processed this object, return the transformed version\n if (seen.has(x)) {\n return seen.get(x);\n }\n\n let result: unknown;\n\n if (Array.isArray(x)) {\n // Create the array first, then populate it\n result = [];\n // Add to seen map before processing elements to handle self-references\n seen.set(x, result);\n\n // Now populate the array\n x.forEach((item, index) => {\n (result as unknown[])[index] = _deserializeCommandSendObjectGraph(\n item,\n seen\n );\n });\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (isCommand(x) && !(x instanceof Command)) {\n result = new Command(x);\n seen.set(x, result);\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (_isSendInterface(x) && !(x instanceof Send)) {\n result = new Send(x.node, x.args);\n seen.set(x, result);\n } else if (isCommand(x) || _isSend(x)) {\n result = x;\n seen.set(x, result);\n } else if (\"lc_serializable\" in x && x.lc_serializable) {\n result = x;\n seen.set(x, result);\n } else {\n // Create empty object first\n result = {};\n // Add to seen map before processing properties to handle self-references\n seen.set(x, result);\n\n // Now populate the object\n for (const [key, value] of Object.entries(x)) {\n (result as Record<string, unknown>)[key] =\n _deserializeCommandSendObjectGraph(value, seen);\n }\n }\n\n return result;\n }\n return x;\n}\n"],"mappings":";;;AAGA,MAAa,QAAQ;;AAErB,MAAa,MAAM;AACnB,MAAa,QAAQ;AACrB,MAAa,OAAO;AACpB,MAAa,QAAQ;;AAGrB,MAAa,kBAAkB;AAE/B,MAAa,kBAAkB;;AAE/B,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;AAC/B,MAAa,0BAA0B;AACvC,MAAa,sBAAsB;AACnC,MAAa,qBAAqB;AAClC,MAAa,oBAAoB;AACjC,MAAa,0BAA0B;AACvC,MAAa,wBAAwB;AACrC,MAAa,wBAAwB;;AAErC,MAAa,4BAA4B;AACzC,MAAa,wBAAwB;AACrC,MAAa,2BAA2B;AACxC,MAAa,2BAA2B;AAExC,MAAa,2BAA2B;AAGxC,MAAa,4BAA4B;AAEzC,MAAa,2BAA2B;;AAGxC,MAAa,YAAY;;AAEzB,MAAa,SAAS;;AAEtB,MAAa,YAAY;;AAEzB,MAAa,SAAS;;AAEtB,MAAa,WAAW;AAIxB,MAAa,aAAa;AAC1B,MAAa,eAAe;AAC5B,MAAa,OAAO;AAEpB,M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QAAK,IAAI,GAAG,OAAO;AAGnB,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,EAAE,CAC1C,CAAC,OAAmC,OAClC,mCAAmC,OAAO,KAAK;;AAIrD,SAAO;;AAET,QAAO"}
@@ -9,7 +9,11 @@ declare const END = "__end__";
9
9
  declare const INTERRUPT = "__interrupt__";
10
10
  /** Special channel reserved for graph previous state */
11
11
  declare const PREVIOUS = "__previous__";
12
- /** @internal */
12
+ /**
13
+ * Symbol used internally to identify Command instances.
14
+ * Exported to support cross-version type compatibility.
15
+ * @internal
16
+ */
13
17
  declare const COMMAND_SYMBOL: unique symbol;
14
18
  /**
15
19
  * Instance of a {@link Command} class.
@@ -310,5 +314,5 @@ declare class Command<Resume = unknown, Update extends Record<string, unknown> =
310
314
  */
311
315
  declare function isCommand(x: unknown): x is Command;
312
316
  //#endregion
313
- export { Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, PREVIOUS, START, Send, isCommand, isInterrupted };
317
+ export { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, PREVIOUS, START, Send, isCommand, isInterrupted };
314
318
  //# sourceMappingURL=constants.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.cts","names":[],"sources":["../src/constants.ts"],"mappings":";;;;cAGa,KAAA;AAAb;AAAA,cAEa,GAAA;;cAiCA,SAAA;;cAQA,QAAA;;cA4CP,cAAA;;;;;;;AAwBN;;;cAba,eAAA,4BAEF,MAAA;EAAA,CAGR,cAAA,GAAiB,aAAA,CAAc,MAAA,EAAQ,MAAA,EAAQ,KAAA;EAEhD,WAAA,CAAY,IAAA,EAAM,aAAA,CAAc,MAAA,EAAQ,MAAA,EAAQ,KAAA;AAAA;AAAA,UAMjC,aAAA;EACf,IAAA,EAAM,IAAA;EACN,IAAA,EAAM,IAAA;AAAA;AA4DR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YAAa,CAAA,IAAK,OAAA"}
@@ -9,7 +9,11 @@ declare const END = "__end__";
9
9
  declare const INTERRUPT = "__interrupt__";
10
10
  /** Special channel reserved for graph previous state */
11
11
  declare const PREVIOUS = "__previous__";
12
- /** @internal */
12
+ /**
13
+ * Symbol used internally to identify Command instances.
14
+ * Exported to support cross-version type compatibility.
15
+ * @internal
16
+ */
13
17
  declare const COMMAND_SYMBOL: unique symbol;
14
18
  /**
15
19
  * Instance of a {@link Command} class.
@@ -310,5 +314,5 @@ declare class Command<Resume = unknown, Update extends Record<string, unknown> =
310
314
  */
311
315
  declare function isCommand(x: unknown): x is Command;
312
316
  //#endregion
313
- export { Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, PREVIOUS, START, Send, isCommand, isInterrupted };
317
+ export { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, PREVIOUS, START, Send, isCommand, isInterrupted };
314
318
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;;;cAGa,KAAA;AAAb;AAAA,cAEa,GAAA;;cAiCA,SAAA;;cAQA,QAAA;;cA4CP,cAAA;;;;;;;AAwBN;;;cAba,eAAA,4BAEF,MAAA;EAAA,CAGR,cAAA,GAAiB,aAAA,CAAc,MAAA,EAAQ,MAAA,EAAQ,KAAA;EAEhD,WAAA,CAAY,IAAA,EAAM,aAAA,CAAc,MAAA,EAAQ,MAAA,EAAQ,KAAA;AAAA;AAAA,UAMjC,aAAA;EACf,IAAA,EAAM,IAAA;EACN,IAAA,EAAM,IAAA;AAAA;AA4DR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;;AAaA;;;;AArCA,cAAa,IAAA,sDACA,aAAA,CAAc,IAAA,EAAM,IAAA;EAE/B,OAAA;EAEO,IAAA,EAAM,IAAA;EAEN,IAAA,EA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
  const CHECKPOINT_NAMESPACE_END = ":";
71
- /** @internal */
71
+ /**
72
+ * Symbol used internally to identify Command instances.
73
+ * Exported to support cross-version type compatibility.
74
+ * @internal
75
+ */
72
76
  const COMMAND_SYMBOL = Symbol.for("langgraph.command");
73
77
  /**
74
78
  * Instance of a {@link Command} class.
@@ -433,5 +437,5 @@ function _deserializeCommandSendObjectGraph(x, seen = /* @__PURE__ */ new Map())
433
437
  }
434
438
 
435
439
  //#endregion
436
- export { CACHE_NS_WRITES, CHECKPOINT_NAMESPACE_END, CHECKPOINT_NAMESPACE_SEPARATOR, CONFIG_KEY_ABORT_SIGNALS, CONFIG_KEY_CALL, CONFIG_KEY_CHECKPOINTER, CONFIG_KEY_CHECKPOINT_ID, CONFIG_KEY_CHECKPOINT_MAP, CONFIG_KEY_CHECKPOINT_NS, CONFIG_KEY_DURABILITY, CONFIG_KEY_NODE_FINISHED, CONFIG_KEY_PREVIOUS_STATE, CONFIG_KEY_READ, CONFIG_KEY_RESUME_MAP, CONFIG_KEY_RESUMING, CONFIG_KEY_SCRATCHPAD, CONFIG_KEY_SEND, CONFIG_KEY_STREAM, CONFIG_KEY_TASK_ID, COPY, Command, CommandInstance, END, ERROR, INPUT, INTERRUPT, NO_WRITES, NULL_TASK_ID, Overwrite, PREVIOUS, PULL, PUSH, RESERVED, RESUME, RETURN, SELF, START, Send, TAG_HIDDEN, TAG_NOSTREAM, TASKS, _getOverwriteValue, _isOverwriteValue, _isSend, _isSendInterface, isCommand, isInterrupted };
440
+ export { CACHE_NS_WRITES, CHECKPOINT_NAMESPACE_END, CHECKPOINT_NAMESPACE_SEPARATOR, COMMAND_SYMBOL, CONFIG_KEY_ABORT_SIGNALS, CONFIG_KEY_CALL, CONFIG_KEY_CHECKPOINTER, CONFIG_KEY_CHECKPOINT_ID, CONFIG_KEY_CHECKPOINT_MAP, CONFIG_KEY_CHECKPOINT_NS, CONFIG_KEY_DURABILITY, CONFIG_KEY_NODE_FINISHED, CONFIG_KEY_PREVIOUS_STATE, CONFIG_KEY_READ, CONFIG_KEY_RESUME_MAP, CONFIG_KEY_RESUMING, CONFIG_KEY_SCRATCHPAD, CONFIG_KEY_SEND, CONFIG_KEY_STREAM, CONFIG_KEY_TASK_ID, COPY, Command, CommandInstance, END, ERROR, INPUT, INTERRUPT, NO_WRITES, NULL_TASK_ID, Overwrite, PREVIOUS, PULL, PUSH, RESERVED, RESUME, RETURN, SELF, START, Send, TAG_HIDDEN, TAG_NOSTREAM, TASKS, _getOverwriteValue, _isOverwriteValue, _isSend, _isSendInterface, isCommand, isInterrupted };
437
441
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { PendingWrite } from \"@langchain/langgraph-checkpoint\";\n\n/** Special reserved node name denoting the start of a graph. */\nexport const START = \"__start__\";\n/** Special reserved node name denoting the end of a graph. */\nexport const END = \"__end__\";\nexport const INPUT = \"__input__\";\nexport const COPY = \"__copy__\";\nexport const ERROR = \"__error__\";\n\n/** Special reserved cache namespaces */\nexport const CACHE_NS_WRITES = \"__pregel_ns_writes\";\n\nexport const CONFIG_KEY_SEND = \"__pregel_send\";\n/** config key containing function used to call a node (push task) */\nexport const CONFIG_KEY_CALL = \"__pregel_call\";\nexport const CONFIG_KEY_READ = \"__pregel_read\";\nexport const CONFIG_KEY_CHECKPOINTER = \"__pregel_checkpointer\";\nexport const CONFIG_KEY_RESUMING = \"__pregel_resuming\";\nexport const CONFIG_KEY_TASK_ID = \"__pregel_task_id\";\nexport const CONFIG_KEY_STREAM = \"__pregel_stream\";\nexport const CONFIG_KEY_RESUME_VALUE = \"__pregel_resume_value\";\nexport const CONFIG_KEY_RESUME_MAP = \"__pregel_resume_map\";\nexport const CONFIG_KEY_SCRATCHPAD = \"__pregel_scratchpad\";\n/** config key containing state from previous invocation of graph for the given thread */\nexport const CONFIG_KEY_PREVIOUS_STATE = \"__pregel_previous\";\nexport const CONFIG_KEY_DURABILITY = \"__pregel_durability\";\nexport const CONFIG_KEY_CHECKPOINT_ID = \"checkpoint_id\";\nexport const CONFIG_KEY_CHECKPOINT_NS = \"checkpoint_ns\";\n\nexport const CONFIG_KEY_NODE_FINISHED = \"__pregel_node_finished\";\n\n// this one is part of public API\nexport const CONFIG_KEY_CHECKPOINT_MAP = \"checkpoint_map\";\n\nexport const CONFIG_KEY_ABORT_SIGNALS = \"__pregel_abort_signals\";\n\n/** Special channel reserved for graph interrupts */\nexport const INTERRUPT = \"__interrupt__\";\n/** Special channel reserved for graph resume */\nexport const RESUME = \"__resume__\";\n/** Special channel reserved for cases when a task exits without any writes */\nexport const NO_WRITES = \"__no_writes__\";\n/** Special channel reserved for graph return */\nexport const RETURN = \"__return__\";\n/** Special channel reserved for graph previous state */\nexport const PREVIOUS = \"__previous__\";\nexport const RUNTIME_PLACEHOLDER = \"__pregel_runtime_placeholder__\";\nexport const RECURSION_LIMIT_DEFAULT = 25;\n\nexport const TAG_HIDDEN = \"langsmith:hidden\";\nexport const TAG_NOSTREAM = \"langsmith:nostream\";\nexport const SELF = \"__self__\";\n\nexport const TASKS = \"__pregel_tasks\";\nexport const PUSH = \"__pregel_push\";\nexport const PULL = \"__pregel_pull\";\n\nexport const TASK_NAMESPACE = \"6ba7b831-9dad-11d1-80b4-00c04fd430c8\";\nexport const NULL_TASK_ID = \"00000000-0000-0000-0000-000000000000\";\n\nexport const RESERVED = [\n TAG_HIDDEN,\n INPUT,\n INTERRUPT,\n RESUME,\n ERROR,\n NO_WRITES,\n\n // reserved config.configurable keys\n CONFIG_KEY_SEND,\n CONFIG_KEY_READ,\n CONFIG_KEY_CHECKPOINTER,\n CONFIG_KEY_DURABILITY,\n CONFIG_KEY_STREAM,\n CONFIG_KEY_RESUMING,\n CONFIG_KEY_TASK_ID,\n CONFIG_KEY_CALL,\n CONFIG_KEY_RESUME_VALUE,\n CONFIG_KEY_SCRATCHPAD,\n CONFIG_KEY_PREVIOUS_STATE,\n CONFIG_KEY_CHECKPOINT_MAP,\n CONFIG_KEY_CHECKPOINT_NS,\n CONFIG_KEY_CHECKPOINT_ID,\n];\n\nexport const CHECKPOINT_NAMESPACE_SEPARATOR = \"|\";\nexport const CHECKPOINT_NAMESPACE_END = \":\";\n\n/** @internal */\nconst COMMAND_SYMBOL = Symbol.for(\"langgraph.command\");\n\n/**\n * Instance of a {@link Command} class.\n *\n * This is used to avoid IntelliSense suggesting public fields\n * of {@link Command} class when a plain object is expected.\n *\n * @see {@link Command}\n * @internal\n */\nexport class CommandInstance<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> {\n [COMMAND_SYMBOL]: CommandParams<Resume, Update, Nodes>;\n\n constructor(args: CommandParams<Resume, Update, Nodes>) {\n this[COMMAND_SYMBOL] = args;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SendInterface<Node extends string = string, Args = any> {\n node: Node;\n args: Args;\n}\n\nexport function _isSendInterface(x: unknown): x is SendInterface {\n const operation = x as SendInterface;\n return (\n operation !== null &&\n operation !== undefined &&\n typeof operation.node === \"string\" &&\n operation.args !== undefined\n );\n}\n\n/**\n *\n * A message or packet to send to a specific node in the graph.\n *\n * The `Send` class is used within a `StateGraph`'s conditional edges to\n * dynamically invoke a node with a custom state at the next step.\n *\n * Importantly, the sent state can differ from the core graph's state,\n * allowing for flexible and dynamic workflow management.\n *\n * One such example is a \"map-reduce\" workflow where your graph invokes\n * the same node multiple times in parallel with different states,\n * before aggregating the results back into the main graph's state.\n *\n * @example\n * ```typescript\n * import { Annotation, Send, StateGraph } from \"@langchain/langgraph\";\n *\n * const ChainState = Annotation.Root({\n * subjects: Annotation<string[]>,\n * jokes: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * }),\n * });\n *\n * const continueToJokes = async (state: typeof ChainState.State) => {\n * return state.subjects.map((subject) => {\n * return new Send(\"generate_joke\", { subjects: [subject] });\n * });\n * };\n *\n * const graph = new StateGraph(ChainState)\n * .addNode(\"generate_joke\", (state) => ({\n * jokes: [`Joke about ${state.subjects}`],\n * }))\n * .addConditionalEdges(\"__start__\", continueToJokes)\n * .addEdge(\"generate_joke\", \"__end__\")\n * .compile();\n *\n * const res = await graph.invoke({ subjects: [\"cats\", \"dogs\"] });\n * console.log(res);\n *\n * // Invoking with two subjects results in a generated joke for each\n * // { subjects: [\"cats\", \"dogs\"], jokes: [`Joke about cats`, `Joke about dogs`] }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Send<Node extends string = string, Args = any>\n implements SendInterface<Node, Args>\n{\n lg_name = \"Send\";\n\n public node: Node;\n\n public args: Args;\n\n constructor(node: Node, args: Args) {\n this.node = node;\n this.args = _deserializeCommandSendObjectGraph(args) as Args;\n }\n\n toJSON() {\n return { lg_name: this.lg_name, node: this.node, args: this.args };\n }\n}\n\nexport function _isSend(x: unknown): x is Send {\n // eslint-disable-next-line no-instanceof/no-instanceof\n return x instanceof Send;\n}\n\nexport const OVERWRITE = \"__overwrite__\";\n\n/**\n * An object representing a direct overwrite of a value for a channel.\n * Used to signal that the channel value should be replaced with the given value,\n * bypassing any reducer or binary operator logic.\n *\n * @template ValueType - The type of the value being overwritten.\n * @property {ValueType} [OVERWRITE] - The value to directly set.\n *\n * @example\n * const overwriteObj: OverwriteValue<number> = { __overwrite__: 123 };\n */\nexport interface OverwriteValue<ValueType> {\n [OVERWRITE]: ValueType;\n}\n\n/**\n * Bypass a reducer and write the wrapped value directly to a\n * {@link BinaryOperatorAggregate} channel.\n *\n * Receiving multiple `Overwrite` values for the same channel in a single\n * super-step will raise an {@link InvalidUpdateError}.\n *\n * @example\n * ```typescript\n * import { Annotation, StateGraph, Overwrite } from \"@langchain/langgraph\";\n *\n * const State = Annotation.Root({\n * messages: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * default: () => [],\n * }),\n * });\n *\n * const replaceMessages = (_state: typeof State.State) => {\n * return { messages: new Overwrite([\"replacement\"]) };\n * };\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Overwrite<ValueType = any> implements OverwriteValue<ValueType> {\n lg_name = \"Overwrite\";\n\n readonly [OVERWRITE]: ValueType;\n\n constructor(value: ValueType) {\n this[OVERWRITE] = value;\n }\n\n get value(): ValueType {\n return this[OVERWRITE];\n }\n\n toJSON() {\n return { [OVERWRITE]: this[OVERWRITE] };\n }\n\n static isInstance<ValueType>(value: unknown): value is Overwrite<ValueType> {\n if (!value || typeof value !== \"object\") return false;\n if (OVERWRITE in value) return true;\n if (\"lg_name\" in value && value.lg_name === \"Overwrite\") return true;\n return false;\n }\n}\n\n/**\n * Helper function to detect and extract the value from an Overwrite wrapper,\n * supporting both the Overwrite class instance and the serialized object format.\n *\n * Use to check if a provided value represents an Overwrite: returns the\n * unwrapped value if so, or undefined otherwise.\n *\n * - If the value is an Overwrite instance (preferred API), return its `.value`.\n * - If the value is a wire-format object ({ [OVERWRITE]: value }), extract it.\n * - Otherwise, returns undefined.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns The unwrapped value if value is an Overwrite, or undefined otherwise.\n * @internal\n */\nexport function _getOverwriteValue<ValueType>(\n value: unknown\n): [true, ValueType] | [false, undefined] {\n if (typeof value === \"object\" && value !== null && OVERWRITE in value) {\n return [true, (value as Record<string, ValueType>)[OVERWRITE]];\n }\n return [false, undefined];\n}\n\n/**\n * Type guard to check if a value is an Overwrite value -- either the class\n * instance or the wire format object.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns `true` if the value is an Overwrite value, `false` otherwise.\n * @internal\n */\nexport function _isOverwriteValue<ValueType>(\n value: unknown\n): value is OverwriteValue<ValueType> {\n return _getOverwriteValue<ValueType>(value)[0];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Interrupt<Value = any> = {\n id?: string;\n value?: Value;\n};\n\n/**\n * Checks if the given graph invoke / stream chunk contains interrupt.\n *\n * @example\n * ```ts\n * import { INTERRUPT, isInterrupted } from \"@langchain/langgraph\";\n *\n * const values = await graph.invoke({ foo: \"bar\" });\n * if (isInterrupted<string>(values)) {\n * const interrupt = values[INTERRUPT][0].value;\n * }\n * ```\n *\n * @param values - The values to check.\n * @returns `true` if the values contain an interrupt, `false` otherwise.\n */\nexport function isInterrupted<Value = unknown>(\n values: unknown\n): values is { [INTERRUPT]: Interrupt<Value>[] } {\n if (!values || typeof values !== \"object\") return false;\n if (!(INTERRUPT in values)) return false;\n return Array.isArray(values[INTERRUPT]);\n}\n\nexport type CommandParams<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> = {\n /**\n * A discriminator field used to identify the type of object. Must be populated when serializing.\n *\n * Optional because it's not required to specify this when directly constructing a {@link Command}\n * object.\n */\n lg_name?: \"Command\";\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - `Send` object (to execute a node with the input provided)\n * - sequence of `Send` objects\n */\n goto?:\n | Nodes\n | SendInterface<Nodes> // eslint-disable-line @typescript-eslint/no-explicit-any\n | (Nodes | SendInterface<Nodes>)[]; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/**\n * One or more commands to update the graph's state and send messages to nodes.\n * Can be used to combine routing logic with state updates in lieu of conditional edges\n *\n * @example\n * ```ts\n * import { Annotation, Command } from \"@langchain/langgraph\";\n *\n * // Define graph state\n * const StateAnnotation = Annotation.Root({\n * foo: Annotation<string>,\n * });\n *\n * // Define the nodes\n * const nodeA = async (_state: typeof StateAnnotation.State) => {\n * console.log(\"Called A\");\n * // this is a replacement for a real conditional edge function\n * const goto = Math.random() > .5 ? \"nodeB\" : \"nodeC\";\n * // note how Command allows you to BOTH update the graph state AND route to the next node\n * return new Command({\n * // this is the state update\n * update: {\n * foo: \"a\",\n * },\n * // this is a replacement for an edge\n * goto,\n * });\n * };\n *\n * // Nodes B and C are unchanged\n * const nodeB = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called B\");\n * return {\n * foo: state.foo + \"|b\",\n * };\n * }\n *\n * const nodeC = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called C\");\n * return {\n * foo: state.foo + \"|c\",\n * };\n * }\n * \n * import { StateGraph } from \"@langchain/langgraph\";\n\n * // NOTE: there are no edges between nodes A, B and C!\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(\"nodeA\", nodeA, {\n * ends: [\"nodeB\", \"nodeC\"],\n * })\n * .addNode(\"nodeB\", nodeB)\n * .addNode(\"nodeC\", nodeC)\n * .addEdge(\"__start__\", \"nodeA\")\n * .compile();\n * \n * await graph.invoke({ foo: \"\" });\n *\n * // Randomly oscillates between\n * // { foo: 'a|c' } and { foo: 'a|b' }\n * ```\n */\nexport class Command<\n Resume = unknown,\n Update extends Record<string, unknown> = Record<string, unknown>,\n Nodes extends string = string\n> extends CommandInstance<Resume, Update, Nodes> {\n readonly lg_name = \"Command\";\n\n lc_direct_tool_output = true;\n\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state as a result of executing the node that is returning the command.\n * Written to the state as if the node had simply returned this value instead of the Command object.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - {@link Send} object (to execute a node with the exact input provided in the {@link Send} object)\n * - sequence of {@link Send} objects\n */\n goto?: Nodes | Send<Nodes> | (Nodes | Send<Nodes>)[] = [];\n\n static PARENT = \"__parent__\";\n\n constructor(args: Omit<CommandParams<Resume, Update, Nodes>, \"lg_name\">) {\n super(args);\n this.resume = args.resume;\n this.graph = args.graph;\n this.update = args.update;\n if (args.goto) {\n type ValidArg = Nodes | Send<Nodes, Update>;\n\n this.goto = Array.isArray(args.goto)\n ? (_deserializeCommandSendObjectGraph(args.goto) as ValidArg[])\n : [_deserializeCommandSendObjectGraph(args.goto) as ValidArg];\n }\n }\n\n /**\n * Convert the update field to a list of {@link PendingWrite} tuples\n * @returns List of {@link PendingWrite} tuples of the form `[channelKey, value]`.\n * @internal\n */\n _updateAsTuples(): PendingWrite[] {\n if (\n this.update &&\n typeof this.update === \"object\" &&\n !Array.isArray(this.update)\n ) {\n return Object.entries(this.update);\n } else if (\n Array.isArray(this.update) &&\n this.update.every(\n (t): t is [string, unknown] =>\n Array.isArray(t) && t.length === 2 && typeof t[0] === \"string\"\n )\n ) {\n return this.update;\n } else {\n return [[\"__root__\", this.update]];\n }\n }\n\n toJSON() {\n let serializedGoto;\n if (typeof this.goto === \"string\") {\n serializedGoto = this.goto;\n } else if (_isSend(this.goto)) {\n serializedGoto = this.goto.toJSON();\n } else {\n serializedGoto = this.goto?.map((innerGoto) => {\n if (typeof innerGoto === \"string\") {\n return innerGoto;\n } else {\n return innerGoto.toJSON();\n }\n });\n }\n return {\n lg_name: this.lg_name,\n update: this.update,\n resume: this.resume,\n goto: serializedGoto,\n };\n }\n}\n\n/**\n * A type guard to check if the given value is a {@link Command}.\n *\n * Useful for type narrowing when working with the {@link Command} object.\n *\n * @param x - The value to check.\n * @returns `true` if the value is a {@link Command}, `false` otherwise.\n */\nexport function isCommand(x: unknown): x is Command {\n if (typeof x !== \"object\") {\n return false;\n }\n\n if (x === null || x === undefined) {\n return false;\n }\n\n if (\"lg_name\" in x && x.lg_name === \"Command\") {\n return true;\n }\n\n return false;\n}\n\n/**\n * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects\n * matching their interfaces.\n *\n * This is only exported for testing purposes. It is NOT intended to be used outside of\n * the Command and Send classes.\n *\n * @internal\n *\n * @param x - The command send tree to convert.\n * @param seen - A map of seen objects to avoid infinite loops.\n * @returns The converted command send tree.\n */\nexport function _deserializeCommandSendObjectGraph(\n x: unknown,\n seen: Map<object, unknown> = new Map()\n): unknown {\n if (x !== undefined && x !== null && typeof x === \"object\") {\n // If we've already processed this object, return the transformed version\n if (seen.has(x)) {\n return seen.get(x);\n }\n\n let result: unknown;\n\n if (Array.isArray(x)) {\n // Create the array first, then populate it\n result = [];\n // Add to seen map before processing elements to handle self-references\n seen.set(x, result);\n\n // Now populate the array\n x.forEach((item, index) => {\n (result as unknown[])[index] = _deserializeCommandSendObjectGraph(\n item,\n seen\n );\n });\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (isCommand(x) && !(x instanceof Command)) {\n result = new Command(x);\n seen.set(x, result);\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (_isSendInterface(x) && !(x instanceof Send)) {\n result = new Send(x.node, x.args);\n seen.set(x, result);\n } else if (isCommand(x) || _isSend(x)) {\n result = x;\n seen.set(x, result);\n } else if (\"lc_serializable\" in x && x.lc_serializable) {\n result = x;\n seen.set(x, result);\n } else {\n // Create empty object first\n result = {};\n // Add to seen map before processing properties to handle self-references\n seen.set(x, result);\n\n // Now populate the object\n for (const [key, value] of Object.entries(x)) {\n (result as Record<string, unknown>)[key] =\n _deserializeCommandSendObjectGraph(value, seen);\n }\n }\n\n return result;\n }\n return x;\n}\n"],"mappings":";;AAGA,MAAa,QAAQ;;AAErB,MAAa,MAAM;AACnB,MAAa,QAAQ;AACrB,MAAa,OAAO;AACpB,MAAa,QAAQ;;AAGrB,MAAa,kBAAkB;AAE/B,MAAa,kBAAkB;;AAE/B,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;AAC/B,MAAa,0BAA0B;AACvC,MAAa,sBAAsB;AACnC,MAA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U,EAAE,IAAI,EAAE,aAAa,UAAU;AAClD,YAAS,IAAI,QAAQ,EAAE;AACvB,QAAK,IAAI,GAAG,OAAO;aAEV,iBAAiB,EAAE,IAAI,EAAE,aAAa,OAAO;AACtD,YAAS,IAAI,KAAK,EAAE,MAAM,EAAE,KAAK;AACjC,QAAK,IAAI,GAAG,OAAO;aACV,UAAU,EAAE,IAAI,QAAQ,EAAE,EAAE;AACrC,YAAS;AACT,QAAK,IAAI,GAAG,OAAO;aACV,qBAAqB,KAAK,EAAE,iBAAiB;AACtD,YAAS;AACT,QAAK,IAAI,GAAG,OAAO;SACd;AAEL,YAAS,EAAE;AAEX,QAAK,IAAI,GAAG,OAAO;AAGnB,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,EAAE,CAC1C,CAAC,OAAmC,OAClC,mCAAmC,OAAO,KAAK;;AAIrD,SAAO;;AAET,QAAO"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { PendingWrite } from \"@langchain/langgraph-checkpoint\";\n\n/** Special reserved node name denoting the start of a graph. */\nexport const START = \"__start__\";\n/** Special reserved node name denoting the end of a graph. */\nexport const END = \"__end__\";\nexport const INPUT = \"__input__\";\nexport const COPY = \"__copy__\";\nexport const ERROR = \"__error__\";\n\n/** Special reserved cache namespaces */\nexport const CACHE_NS_WRITES = \"__pregel_ns_writes\";\n\nexport const CONFIG_KEY_SEND = \"__pregel_send\";\n/** config key containing function used to call a node (push task) */\nexport const CONFIG_KEY_CALL = \"__pregel_call\";\nexport const CONFIG_KEY_READ = \"__pregel_read\";\nexport const CONFIG_KEY_CHECKPOINTER = \"__pregel_checkpointer\";\nexport const CONFIG_KEY_RESUMING = \"__pregel_resuming\";\nexport const CONFIG_KEY_TASK_ID = \"__pregel_task_id\";\nexport const CONFIG_KEY_STREAM = \"__pregel_stream\";\nexport const CONFIG_KEY_RESUME_VALUE = \"__pregel_resume_value\";\nexport const CONFIG_KEY_RESUME_MAP = \"__pregel_resume_map\";\nexport const CONFIG_KEY_SCRATCHPAD = \"__pregel_scratchpad\";\n/** config key containing state from previous invocation of graph for the given thread */\nexport const CONFIG_KEY_PREVIOUS_STATE = \"__pregel_previous\";\nexport const CONFIG_KEY_DURABILITY = \"__pregel_durability\";\nexport const CONFIG_KEY_CHECKPOINT_ID = \"checkpoint_id\";\nexport const CONFIG_KEY_CHECKPOINT_NS = \"checkpoint_ns\";\n\nexport const CONFIG_KEY_NODE_FINISHED = \"__pregel_node_finished\";\n\n// this one is part of public API\nexport const CONFIG_KEY_CHECKPOINT_MAP = \"checkpoint_map\";\n\nexport const CONFIG_KEY_ABORT_SIGNALS = \"__pregel_abort_signals\";\n\n/** Special channel reserved for graph interrupts */\nexport const INTERRUPT = \"__interrupt__\";\n/** Special channel reserved for graph resume */\nexport const RESUME = \"__resume__\";\n/** Special channel reserved for cases when a task exits without any writes */\nexport const NO_WRITES = \"__no_writes__\";\n/** Special channel reserved for graph return */\nexport const RETURN = \"__return__\";\n/** Special channel reserved for graph previous state */\nexport const PREVIOUS = \"__previous__\";\nexport const RUNTIME_PLACEHOLDER = \"__pregel_runtime_placeholder__\";\nexport const RECURSION_LIMIT_DEFAULT = 25;\n\nexport const TAG_HIDDEN = \"langsmith:hidden\";\nexport const TAG_NOSTREAM = \"langsmith:nostream\";\nexport const SELF = \"__self__\";\n\nexport const TASKS = \"__pregel_tasks\";\nexport const PUSH = \"__pregel_push\";\nexport const PULL = \"__pregel_pull\";\n\nexport const TASK_NAMESPACE = \"6ba7b831-9dad-11d1-80b4-00c04fd430c8\";\nexport const NULL_TASK_ID = \"00000000-0000-0000-0000-000000000000\";\n\nexport const RESERVED = [\n TAG_HIDDEN,\n INPUT,\n INTERRUPT,\n RESUME,\n ERROR,\n NO_WRITES,\n\n // reserved config.configurable keys\n CONFIG_KEY_SEND,\n CONFIG_KEY_READ,\n CONFIG_KEY_CHECKPOINTER,\n CONFIG_KEY_DURABILITY,\n CONFIG_KEY_STREAM,\n CONFIG_KEY_RESUMING,\n CONFIG_KEY_TASK_ID,\n CONFIG_KEY_CALL,\n CONFIG_KEY_RESUME_VALUE,\n CONFIG_KEY_SCRATCHPAD,\n CONFIG_KEY_PREVIOUS_STATE,\n CONFIG_KEY_CHECKPOINT_MAP,\n CONFIG_KEY_CHECKPOINT_NS,\n CONFIG_KEY_CHECKPOINT_ID,\n];\n\nexport const CHECKPOINT_NAMESPACE_SEPARATOR = \"|\";\nexport const CHECKPOINT_NAMESPACE_END = \":\";\n\n/**\n * Symbol used internally to identify Command instances.\n * Exported to support cross-version type compatibility.\n * @internal\n */\nexport const COMMAND_SYMBOL = Symbol.for(\"langgraph.command\");\n\n/**\n * Instance of a {@link Command} class.\n *\n * This is used to avoid IntelliSense suggesting public fields\n * of {@link Command} class when a plain object is expected.\n *\n * @see {@link Command}\n * @internal\n */\nexport class CommandInstance<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> {\n [COMMAND_SYMBOL]: CommandParams<Resume, Update, Nodes>;\n\n constructor(args: CommandParams<Resume, Update, Nodes>) {\n this[COMMAND_SYMBOL] = args;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SendInterface<Node extends string = string, Args = any> {\n node: Node;\n args: Args;\n}\n\nexport function _isSendInterface(x: unknown): x is SendInterface {\n const operation = x as SendInterface;\n return (\n operation !== null &&\n operation !== undefined &&\n typeof operation.node === \"string\" &&\n operation.args !== undefined\n );\n}\n\n/**\n *\n * A message or packet to send to a specific node in the graph.\n *\n * The `Send` class is used within a `StateGraph`'s conditional edges to\n * dynamically invoke a node with a custom state at the next step.\n *\n * Importantly, the sent state can differ from the core graph's state,\n * allowing for flexible and dynamic workflow management.\n *\n * One such example is a \"map-reduce\" workflow where your graph invokes\n * the same node multiple times in parallel with different states,\n * before aggregating the results back into the main graph's state.\n *\n * @example\n * ```typescript\n * import { Annotation, Send, StateGraph } from \"@langchain/langgraph\";\n *\n * const ChainState = Annotation.Root({\n * subjects: Annotation<string[]>,\n * jokes: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * }),\n * });\n *\n * const continueToJokes = async (state: typeof ChainState.State) => {\n * return state.subjects.map((subject) => {\n * return new Send(\"generate_joke\", { subjects: [subject] });\n * });\n * };\n *\n * const graph = new StateGraph(ChainState)\n * .addNode(\"generate_joke\", (state) => ({\n * jokes: [`Joke about ${state.subjects}`],\n * }))\n * .addConditionalEdges(\"__start__\", continueToJokes)\n * .addEdge(\"generate_joke\", \"__end__\")\n * .compile();\n *\n * const res = await graph.invoke({ subjects: [\"cats\", \"dogs\"] });\n * console.log(res);\n *\n * // Invoking with two subjects results in a generated joke for each\n * // { subjects: [\"cats\", \"dogs\"], jokes: [`Joke about cats`, `Joke about dogs`] }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Send<Node extends string = string, Args = any>\n implements SendInterface<Node, Args>\n{\n lg_name = \"Send\";\n\n public node: Node;\n\n public args: Args;\n\n constructor(node: Node, args: Args) {\n this.node = node;\n this.args = _deserializeCommandSendObjectGraph(args) as Args;\n }\n\n toJSON() {\n return { lg_name: this.lg_name, node: this.node, args: this.args };\n }\n}\n\nexport function _isSend(x: unknown): x is Send {\n // eslint-disable-next-line no-instanceof/no-instanceof\n return x instanceof Send;\n}\n\nexport const OVERWRITE = \"__overwrite__\";\n\n/**\n * An object representing a direct overwrite of a value for a channel.\n * Used to signal that the channel value should be replaced with the given value,\n * bypassing any reducer or binary operator logic.\n *\n * @template ValueType - The type of the value being overwritten.\n * @property {ValueType} [OVERWRITE] - The value to directly set.\n *\n * @example\n * const overwriteObj: OverwriteValue<number> = { __overwrite__: 123 };\n */\nexport interface OverwriteValue<ValueType> {\n [OVERWRITE]: ValueType;\n}\n\n/**\n * Bypass a reducer and write the wrapped value directly to a\n * {@link BinaryOperatorAggregate} channel.\n *\n * Receiving multiple `Overwrite` values for the same channel in a single\n * super-step will raise an {@link InvalidUpdateError}.\n *\n * @example\n * ```typescript\n * import { Annotation, StateGraph, Overwrite } from \"@langchain/langgraph\";\n *\n * const State = Annotation.Root({\n * messages: Annotation<string[]>({\n * reducer: (a, b) => a.concat(b),\n * default: () => [],\n * }),\n * });\n *\n * const replaceMessages = (_state: typeof State.State) => {\n * return { messages: new Overwrite([\"replacement\"]) };\n * };\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class Overwrite<ValueType = any> implements OverwriteValue<ValueType> {\n lg_name = \"Overwrite\";\n\n readonly [OVERWRITE]: ValueType;\n\n constructor(value: ValueType) {\n this[OVERWRITE] = value;\n }\n\n get value(): ValueType {\n return this[OVERWRITE];\n }\n\n toJSON() {\n return { [OVERWRITE]: this[OVERWRITE] };\n }\n\n static isInstance<ValueType>(value: unknown): value is Overwrite<ValueType> {\n if (!value || typeof value !== \"object\") return false;\n if (OVERWRITE in value) return true;\n if (\"lg_name\" in value && value.lg_name === \"Overwrite\") return true;\n return false;\n }\n}\n\n/**\n * Helper function to detect and extract the value from an Overwrite wrapper,\n * supporting both the Overwrite class instance and the serialized object format.\n *\n * Use to check if a provided value represents an Overwrite: returns the\n * unwrapped value if so, or undefined otherwise.\n *\n * - If the value is an Overwrite instance (preferred API), return its `.value`.\n * - If the value is a wire-format object ({ [OVERWRITE]: value }), extract it.\n * - Otherwise, returns undefined.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns The unwrapped value if value is an Overwrite, or undefined otherwise.\n * @internal\n */\nexport function _getOverwriteValue<ValueType>(\n value: unknown\n): [true, ValueType] | [false, undefined] {\n if (typeof value === \"object\" && value !== null && OVERWRITE in value) {\n return [true, (value as Record<string, ValueType>)[OVERWRITE]];\n }\n return [false, undefined];\n}\n\n/**\n * Type guard to check if a value is an Overwrite value -- either the class\n * instance or the wire format object.\n *\n * @template ValueType - The expected type of the Overwrite value.\n * @param value - The value to check (may be anything).\n * @returns `true` if the value is an Overwrite value, `false` otherwise.\n * @internal\n */\nexport function _isOverwriteValue<ValueType>(\n value: unknown\n): value is OverwriteValue<ValueType> {\n return _getOverwriteValue<ValueType>(value)[0];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Interrupt<Value = any> = {\n id?: string;\n value?: Value;\n};\n\n/**\n * Checks if the given graph invoke / stream chunk contains interrupt.\n *\n * @example\n * ```ts\n * import { INTERRUPT, isInterrupted } from \"@langchain/langgraph\";\n *\n * const values = await graph.invoke({ foo: \"bar\" });\n * if (isInterrupted<string>(values)) {\n * const interrupt = values[INTERRUPT][0].value;\n * }\n * ```\n *\n * @param values - The values to check.\n * @returns `true` if the values contain an interrupt, `false` otherwise.\n */\nexport function isInterrupted<Value = unknown>(\n values: unknown\n): values is { [INTERRUPT]: Interrupt<Value>[] } {\n if (!values || typeof values !== \"object\") return false;\n if (!(INTERRUPT in values)) return false;\n return Array.isArray(values[INTERRUPT]);\n}\n\nexport type CommandParams<\n Resume = unknown,\n Update = Record<string, unknown>,\n Nodes extends string = string\n> = {\n /**\n * A discriminator field used to identify the type of object. Must be populated when serializing.\n *\n * Optional because it's not required to specify this when directly constructing a {@link Command}\n * object.\n */\n lg_name?: \"Command\";\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - `Send` object (to execute a node with the input provided)\n * - sequence of `Send` objects\n */\n goto?:\n | Nodes\n | SendInterface<Nodes> // eslint-disable-line @typescript-eslint/no-explicit-any\n | (Nodes | SendInterface<Nodes>)[]; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/**\n * One or more commands to update the graph's state and send messages to nodes.\n * Can be used to combine routing logic with state updates in lieu of conditional edges\n *\n * @example\n * ```ts\n * import { Annotation, Command } from \"@langchain/langgraph\";\n *\n * // Define graph state\n * const StateAnnotation = Annotation.Root({\n * foo: Annotation<string>,\n * });\n *\n * // Define the nodes\n * const nodeA = async (_state: typeof StateAnnotation.State) => {\n * console.log(\"Called A\");\n * // this is a replacement for a real conditional edge function\n * const goto = Math.random() > .5 ? \"nodeB\" : \"nodeC\";\n * // note how Command allows you to BOTH update the graph state AND route to the next node\n * return new Command({\n * // this is the state update\n * update: {\n * foo: \"a\",\n * },\n * // this is a replacement for an edge\n * goto,\n * });\n * };\n *\n * // Nodes B and C are unchanged\n * const nodeB = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called B\");\n * return {\n * foo: state.foo + \"|b\",\n * };\n * }\n *\n * const nodeC = async (state: typeof StateAnnotation.State) => {\n * console.log(\"Called C\");\n * return {\n * foo: state.foo + \"|c\",\n * };\n * }\n * \n * import { StateGraph } from \"@langchain/langgraph\";\n\n * // NOTE: there are no edges between nodes A, B and C!\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(\"nodeA\", nodeA, {\n * ends: [\"nodeB\", \"nodeC\"],\n * })\n * .addNode(\"nodeB\", nodeB)\n * .addNode(\"nodeC\", nodeC)\n * .addEdge(\"__start__\", \"nodeA\")\n * .compile();\n * \n * await graph.invoke({ foo: \"\" });\n *\n * // Randomly oscillates between\n * // { foo: 'a|c' } and { foo: 'a|b' }\n * ```\n */\nexport class Command<\n Resume = unknown,\n Update extends Record<string, unknown> = Record<string, unknown>,\n Nodes extends string = string\n> extends CommandInstance<Resume, Update, Nodes> {\n readonly lg_name = \"Command\";\n\n lc_direct_tool_output = true;\n\n /**\n * Graph to send the command to. Supported values are:\n * - None: the current graph (default)\n * - The specific name of the graph to send the command to\n * - {@link Command.PARENT}: closest parent graph (only supported when returned from a node in a subgraph)\n */\n graph?: string;\n\n /**\n * Update to apply to the graph's state as a result of executing the node that is returning the command.\n * Written to the state as if the node had simply returned this value instead of the Command object.\n */\n update?: Update | [string, unknown][];\n\n /**\n * Value to resume execution with. To be used together with {@link interrupt}.\n */\n resume?: Resume;\n\n /**\n * Can be one of the following:\n * - name of the node to navigate to next (any node that belongs to the specified `graph`)\n * - sequence of node names to navigate to next\n * - {@link Send} object (to execute a node with the exact input provided in the {@link Send} object)\n * - sequence of {@link Send} objects\n */\n goto?: Nodes | Send<Nodes> | (Nodes | Send<Nodes>)[] = [];\n\n static PARENT = \"__parent__\";\n\n constructor(args: Omit<CommandParams<Resume, Update, Nodes>, \"lg_name\">) {\n super(args);\n this.resume = args.resume;\n this.graph = args.graph;\n this.update = args.update;\n if (args.goto) {\n type ValidArg = Nodes | Send<Nodes, Update>;\n\n this.goto = Array.isArray(args.goto)\n ? (_deserializeCommandSendObjectGraph(args.goto) as ValidArg[])\n : [_deserializeCommandSendObjectGraph(args.goto) as ValidArg];\n }\n }\n\n /**\n * Convert the update field to a list of {@link PendingWrite} tuples\n * @returns List of {@link PendingWrite} tuples of the form `[channelKey, value]`.\n * @internal\n */\n _updateAsTuples(): PendingWrite[] {\n if (\n this.update &&\n typeof this.update === \"object\" &&\n !Array.isArray(this.update)\n ) {\n return Object.entries(this.update);\n } else if (\n Array.isArray(this.update) &&\n this.update.every(\n (t): t is [string, unknown] =>\n Array.isArray(t) && t.length === 2 && typeof t[0] === \"string\"\n )\n ) {\n return this.update;\n } else {\n return [[\"__root__\", this.update]];\n }\n }\n\n toJSON() {\n let serializedGoto;\n if (typeof this.goto === \"string\") {\n serializedGoto = this.goto;\n } else if (_isSend(this.goto)) {\n serializedGoto = this.goto.toJSON();\n } else {\n serializedGoto = this.goto?.map((innerGoto) => {\n if (typeof innerGoto === \"string\") {\n return innerGoto;\n } else {\n return innerGoto.toJSON();\n }\n });\n }\n return {\n lg_name: this.lg_name,\n update: this.update,\n resume: this.resume,\n goto: serializedGoto,\n };\n }\n}\n\n/**\n * A type guard to check if the given value is a {@link Command}.\n *\n * Useful for type narrowing when working with the {@link Command} object.\n *\n * @param x - The value to check.\n * @returns `true` if the value is a {@link Command}, `false` otherwise.\n */\nexport function isCommand(x: unknown): x is Command {\n if (typeof x !== \"object\") {\n return false;\n }\n\n if (x === null || x === undefined) {\n return false;\n }\n\n if (\"lg_name\" in x && x.lg_name === \"Command\") {\n return true;\n }\n\n return false;\n}\n\n/**\n * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects\n * matching their interfaces.\n *\n * This is only exported for testing purposes. It is NOT intended to be used outside of\n * the Command and Send classes.\n *\n * @internal\n *\n * @param x - The command send tree to convert.\n * @param seen - A map of seen objects to avoid infinite loops.\n * @returns The converted command send tree.\n */\nexport function _deserializeCommandSendObjectGraph(\n x: unknown,\n seen: Map<object, unknown> = new Map()\n): unknown {\n if (x !== undefined && x !== null && typeof x === \"object\") {\n // If we've already processed this object, return the transformed version\n if (seen.has(x)) {\n return seen.get(x);\n }\n\n let result: unknown;\n\n if (Array.isArray(x)) {\n // Create the array first, then populate it\n result = [];\n // Add to seen map before processing elements to handle self-references\n seen.set(x, result);\n\n // Now populate the array\n x.forEach((item, index) => {\n (result as unknown[])[index] = _deserializeCommandSendObjectGraph(\n item,\n seen\n );\n });\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (isCommand(x) && !(x instanceof Command)) {\n result = new Command(x);\n seen.set(x, result);\n // eslint-disable-next-line no-instanceof/no-instanceof\n } else if (_isSendInterface(x) && !(x instanceof Send)) {\n result = new Send(x.node, x.args);\n seen.set(x, result);\n } else if (isCommand(x) || _isSend(x)) {\n result = x;\n seen.set(x, result);\n } else if (\"lc_serializable\" in x && x.lc_serializable) {\n result = x;\n seen.set(x, result);\n } else {\n // Create empty object first\n result = {};\n // Add to seen map before processing properties to handle self-references\n seen.set(x, result);\n\n // Now populate the object\n for (const [key, value] of Object.entries(x)) {\n (result as Record<string, unknown>)[key] =\n _deserializeCommandSendObjectGraph(value, seen);\n }\n }\n\n return result;\n }\n return x;\n}\n"],"mappings":";;AAGA,MAAa,QAAQ;;AAEr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b,QAAO,KAAK,IAAI,EAAE;EAGpB,IAAI;AAEJ,MAAI,MAAM,QAAQ,EAAE,EAAE;AAEpB,YAAS,EAAE;AAEX,QAAK,IAAI,GAAG,OAAO;AAGnB,KAAE,SAAS,MAAM,UAAU;AACzB,IAAC,OAAqB,SAAS,mCAC7B,MACA,KACD;KACD;aAEO,UAAU,EAAE,IAAI,EAAE,aAAa,UAAU;AAClD,YAAS,IAAI,QAAQ,EAAE;AACvB,QAAK,IAAI,GAAG,OAAO;aAEV,iBAAiB,EAAE,IAAI,EAAE,aAAa,OAAO;AACtD,YAAS,IAAI,KAAK,EAAE,MAAM,EAAE,KAAK;AACjC,QAAK,IAAI,GAAG,OAAO;aACV,UAAU,EAAE,IAAI,QAAQ,EAAE,EAAE;AACrC,YAAS;AACT,QAAK,IAAI,GAAG,OAAO;aACV,qBAAqB,KAAK,EAAE,iBAAiB;AACtD,YAAS;AACT,QAAK,IAAI,GAAG,OAAO;SACd;AAEL,YAAS,EAAE;AAEX,QAAK,IAAI,GAAG,OAAO;AAGnB,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,EAAE,CAC1C,CAAC,OAAmC,OAClC,mCAAmC,OAAO,KAAK;;AAIrD,SAAO;;AAET,QAAO"}
@@ -3,7 +3,6 @@ import { OverwriteValue } from "../constants.js";
3
3
  import { ReducedZodChannel, SchemaMeta } from "./zod/meta.js";
4
4
  import { AnnotationRoot } from "./annotation.js";
5
5
  import { Messages } from "./messages_reducer.js";
6
- import "../web.js";
7
6
  import * as _langchain_core_messages0 from "@langchain/core/messages";
8
7
  import { BaseMessage } from "@langchain/core/messages";
9
8
  import * as _langchain_core_utils_types0 from "@langchain/core/utils/types";
@@ -1 +1 @@
1
- {"version":3,"file":"messages_annotation.d.ts","names":[],"sources":["../../src/graph/messages_annotation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,kBAAA;+EAKX,yBAAA,CAAA,cAAA;;;;AAeF;;;;;;;;;;;cAAa,eAAA,EAAiB,UAAA,CAAW,WAAA,IAAe,QAAA;;AA6CxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,gBAAA,EAAgB,CAAA,CAAA,SAAA;+FAE3B,yBAAA,CAAA,cAAA"}
1
+ {"version":3,"file":"messages_annotation.d.ts","names":[],"sources":["../../src/graph/messages_annotation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,kBAAA;+EAKX,yBAAA,CAAA,cAAA;;;;AAeF;;;;;;;;;;;cAAa,eAAA,EAAiB,UAAA,CAAW,WAAA,IAAe,QAAA;;AA6CxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,gBAAA,EAAgB,CAAA,CAAA,SAAA;+FAE3B,yBAAA,CAAA,cAAA"}
@@ -1,4 +1,3 @@
1
- import "./plugin.cjs";
2
1
  import { InteropZodToStateDefinition, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, schemaMetaRegistry, withLangGraph } from "./meta.cjs";
3
2
  import { LanggraphZodMetaRegistry, registry } from "./zod-registry.cjs";
4
3
  export { InteropZodToStateDefinition, LanggraphZodMetaRegistry, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, registry, schemaMetaRegistry, withLangGraph };
@@ -1,4 +1,3 @@
1
- import "./plugin.js";
2
1
  import { InteropZodToStateDefinition, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, schemaMetaRegistry, withLangGraph } from "./meta.js";
3
2
  import { LanggraphZodMetaRegistry, registry } from "./zod-registry.js";
4
3
  export { InteropZodToStateDefinition, LanggraphZodMetaRegistry, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, registry, schemaMetaRegistry, withLangGraph };
package/dist/index.cjs CHANGED
@@ -50,7 +50,9 @@ Object.defineProperty(exports, 'BaseStore', {
50
50
  }
51
51
  });
52
52
  exports.BinaryOperatorAggregate = require_binop.BinaryOperatorAggregate;
53
+ exports.COMMAND_SYMBOL = require_constants.COMMAND_SYMBOL;
53
54
  exports.Command = require_constants.Command;
55
+ exports.CommandInstance = require_constants.CommandInstance;
54
56
  exports.CompiledStateGraph = require_state.CompiledStateGraph;
55
57
  exports.END = require_constants.END;
56
58
  exports.EmptyChannelError = require_errors.EmptyChannelError;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.cjs";
2
- import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.cjs";
2
+ import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.cjs";
3
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.cjs";
4
4
  import { AnyValue } from "./channels/any_value.cjs";
5
5
  import { LastValue } from "./channels/last_value.cjs";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.cjs";
33
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
34
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.js";
2
- import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.js";
2
+ import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.js";
3
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.js";
4
4
  import { AnyValue } from "./channels/any_value.js";
5
5
  import { LastValue } from "./channels/last_value.js";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.js";
33
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
34
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, 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 };
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 };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { initializeAsyncLocalStorageSingleton } from "./setup/async_local_storage.js";
2
- import { Command, END, INTERRUPT, Overwrite, START, Send, isCommand, isInterrupted } from "./constants.js";
2
+ import { COMMAND_SYMBOL, Command, CommandInstance, END, INTERRUPT, Overwrite, START, Send, isCommand, isInterrupted } from "./constants.js";
3
3
  import { BaseLangGraphError, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
4
4
  import { BaseChannel } from "./channels/base.js";
5
5
  import { BinaryOperatorAggregate } from "./channels/binop.js";
@@ -26,5 +26,5 @@ import { writer } from "./writer.js";
26
26
  initializeAsyncLocalStorageSingleton();
27
27
 
28
28
  //#endregion
29
- export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, Command, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, 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 };
29
+ export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, COMMAND_SYMBOL, Command, CommandInstance, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, 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 };
30
30
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,6 @@
1
1
  import { BaseChannel } from "../channels/base.js";
2
2
  import { StateDefinition } from "../graph/annotation.js";
3
3
  import { CompiledStateGraph } from "../graph/state.js";
4
- import "../web.js";
5
4
  import { ToolExecutor } from "./tool_executor.js";
6
5
  import { Runnable } from "@langchain/core/runnables";
7
6
  import * as _langchain_core_messages0 from "@langchain/core/messages";
@@ -1 +1 @@
1
- {"version":3,"file":"agent_executor.d.ts","names":[],"sources":["../../src/prebuilt/agent_executor.ts"],"mappings":";;;;;;;;;;;;UASU,IAAA;EACR,MAAA,EAAQ,WAAA,GAAc,WAAA;EACtB,WAAA;AAAA;;UAIe,kBAAA;EACf,YAAA,GAAe,WAAA,GAAc,WAAA;EAC7B,KAAA,EAAO,KAAA,CAAM,IAAA;EACb,KAAA;EACA,WAAA,GAAc,WAAA;AAAA;;iBAIA,mBAAA,CAAA;EACd,aAAA;EACA;AAAA;EAEA,aAAA,EAAe,QAAA;EACf,KAAA,EAAO,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA"}
1
+ {"version":3,"file":"agent_executor.d.ts","names":[],"sources":["../../src/prebuilt/agent_executor.ts"],"mappings":";;;;;;;;;;;UASU,IAAA;EACR,MAAA,EAAQ,WAAA,GAAc,WAAA;EACtB,WAAA;AAAA;;UAIe,kBAAA;EACf,YAAA,GAAe,WAAA,GAAc,WAAA;EAC7B,KAAA,EAAO,KAAA,CAAM,IAAA;EACb,KAAA;EACA,WAAA,GAAc,WAAA;AAAA;;iBAIA,mBAAA,CAAA;EACd,aAAA;EACA;AAAA;EAEA,aAAA,EAAe,QAAA;EACf,KAAA,EAAO,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA"}
@@ -6,9 +6,7 @@ import { LangGraphRunnableConfig, Runtime } from "../pregel/runnable_types.js";
6
6
  import { AnnotationRoot, SingleReducer, StateDefinition } from "../graph/annotation.js";
7
7
  import { CompiledStateGraph } from "../graph/state.js";
8
8
  import { Messages } from "../graph/messages_reducer.js";
9
- import "../graph/index.js";
10
9
  import { MessagesAnnotation } from "../graph/messages_annotation.js";
11
- import "../web.js";
12
10
  import { ToolNode } from "./tool_node.js";
13
11
  import { All, BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
14
12
  import { Runnable, RunnableBinding, RunnableLike, RunnableSequence, RunnableToolLike } from "@langchain/core/runnables";
@@ -1 +1 @@
1
- {"version":3,"file":"react_agent_executor.d.ts","names":[],"sources":["../../src/prebuilt/react_agent_executor.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;UAmDiB,UAAA,gCAEgB,MAAA,gBAAsB,MAAA;EAErD,QAAA,EAAU,WAAA;EAMV,kBAAA,EAAoB,sBAAA;AAAA;AAAA,KAGV,CAAA,UAAW,KAAA;AAAA,KAElB,+BAAA;EAEH,MAAA,EAAQ,cAAA,CAAe,sBAAA,IAA0B,MAAA;EACjD,MAAA;EAEA,MAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAiEE,UAAA,GAAa,MAAA;AAAA,KACb,UAAA,GAAa,uBAAA,GAA0B,WAAA,GAAc,gBAAA;AAAA,KAkR9C,MAAA,GACR,aAAA,cAGE,KAAA,SAAc,kBAAA,CAAmB,KAAA,EACjC,MAAA,EAAQ,uBAAA,KACL,eAAA,QAEH,KAAA,SAAc,kBAAA,CAAmB,KAAA,EACjC,MAAA,EAA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B,gBAAA,CAAiB,CAAA,yBAGV,kBAAA,CAAmB,IAAA,GAAO,gBAAA,CAAiB,CAAA,WAClD,UAAA,QACS,0BAAA,CAA2B,wBAAA,aAElC,gBAAA,CAAiB,CAAA"}
@@ -1,8 +1,3 @@
1
- import "../channels/base.js";
2
- import "../constants.js";
3
- import "./read.js";
4
- import "./types.js";
5
- import "./stream.js";
6
1
  import { All, BaseCheckpointSaver, BaseStore, Checkpoint, PendingWrite, ReadonlyCheckpoint } from "@langchain/langgraph-checkpoint";
7
2
  import { RunnableConfig } from "@langchain/core/runnables";
8
3
  import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager";
@@ -1 +1 @@
1
- {"version":3,"file":"algo.d.ts","names":[],"sources":["../../src/pregel/algo.ts"],"mappings":";;;;;;;;;;;;AA+EA;KAAY,SAAA,gCACJ,CAAA,GAAI,CAAA"}
1
+ {"version":3,"file":"algo.d.ts","names":[],"sources":["../../src/pregel/algo.ts"],"mappings":";;;;;;;AA+EA;KAAY,SAAA,gCACJ,CAAA,GAAI,CAAA"}
@@ -1,4 +1,3 @@
1
- import "../utils.js";
2
1
  import { CachePolicy, RetryPolicy } from "./utils/index.js";
3
2
  import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, RunnableLike } from "@langchain/core/runnables";
4
3
 
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","names":[],"sources":["../../src/pregel/read.ts"],"mappings":";;;;;UAwEU,cAAA,8BACA,OAAA,CAAQ,mBAAA,CAAoB,QAAA,EAAU,SAAA;EAC9C,QAAA,EAAU,MAAA;EACV,QAAA,EAAU,KAAA;EAEV,MAAA,IAAU,IAAA;EACV,OAAA,GAAU,QAAA,CAAS,SAAA;EACnB,IAAA;EACA,KAAA,GAAQ,QAAA,CAAS,QAAA,EAAU,SAAA;EAE3B,MAAA,GAAS,MAAA;EACT,MAAA,GAAS,cAAA;EACT,QAAA,GAAW,MAAA;EACX,WAAA,GAAc,WAAA;EACd,WAAA,GAAc,W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d,SAAA,GAAY,QAAA;EACZ,IAAA;AAAA;AAAA,KAIU,mBAAA;AAAA,KAGA,oBAAA;AAAA,cAEC,UAAA,YACA,mBAAA,cACC,oBAAA,UACJ,eAAA,CAAgB,QAAA,EAAU,SAAA,EAAW,cAAA;EAC7C,aAAA;EAEA,QAAA,EAAU,MAAA;EAEV,QAAA;EAGA,MAAA,IAAU,IAAA;EAEV,OAAA,EAAS,QAAA;EAET,KAAA,EAAO,QAAA,CAAS,QAAA,EAAU,SAAA;EAG1B,MAAA,EAAQ,MAAA;EAER,QAAA,EAAU,MAAA;EAEV,IAAA;EAEA,WAAA,GAAc,WAAA;EAEd,WAAA,GAAc,WAAA;EAEd,SAAA,GAAY,QAAA;EAEZ,IAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,cAAA,CAAe,QAAA,EAAU,SAAA;EA6C7C,UAAA,CAAA,GAAc,KAAA,CAAM,QAAA;EAsBpB,OAAA,CAAA,GAAW,QAAA,CAAS,QAAA,EAAU,SAAA;EAyB9B,IAAA,CAAK,QAAA,EAAU,KAAA,WAAgB,UAAA,CAAW,QAAA,EAAU,SAAA;EAwBpD,IAAA,cAAA,CACE,UAAA,EAAY,YAAA,GACX,UAAA,CAAW,QAAA,EAAU,OAAA,CAAQ,YAAA,EAAc,KAAA;AAAA"}
@@ -3,8 +3,6 @@ import { LangGraphRunnableConfig } from "./runnable_types.js";
3
3
  import { PregelNode } from "./read.js";
4
4
  import { PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, StateSnapshot } from "./types.js";
5
5
  import { StrRecord } from "./algo.js";
6
- import "./index.js";
7
- import "../web.js";
8
6
  import { All, CheckpointListOptions } from "@langchain/langgraph-checkpoint";
9
7
  import { Runnable, RunnableConfig } from "@langchain/core/runnables";
10
8
  import { Graph, Node } from "@langchain/core/runnables/graph";
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","names":[],"sources":["../../src/pregel/remote.ts"],"mappings":";;;;;;;;;;;;;;;KA8CY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@langchain/core/utils/stream";
3
2
  import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
@@ -3,5 +3,4 @@ import { ReducedValue, ReducedValueInit } from "./values/reduced.js";
3
3
  import { UntrackedValue, UntrackedValueInit } from "./values/untracked.js";
4
4
  import { InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaFields } from "./schema.js";
5
5
  import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./adapter.js";
6
- import { MessagesValue } from "./prebuilt/messages.js";
7
- import "./prebuilt/index.js";
6
+ import { MessagesValue } from "./prebuilt/messages.js";
@@ -1,6 +1,5 @@
1
1
  import { BaseChannel } from "../channels/base.js";
2
2
  import { OverwriteValue } from "../constants.js";
3
- import "../channels/index.js";
4
3
  import { RunnableLike } from "../pregel/runnable_types.js";
5
4
  import { SerializableSchema } from "./types.js";
6
5
  import { ReducedValue } from "./values/reduced.js";
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","names":[],"sources":["../../src/state/schema.ts"],"mappings":";;;;;;;;;;cAmBM,mBAAA;;;AAFiD;;;;;AA2BvD;;;;;;;;;;;;;;;;KAAY,yBAAA,MAA+B,CAAA,SAAU,YAAA,qBAIjD,WAAA,CAAY,CAAA,EAAG,cAAA,CAAe,CAAA,IAAK,CAAA,IACnC,CAAA,SAAU,cAAA,YACV,WAAA,CAAY,CAAA,EAAG,CAAA,IACf,CAAA,SAAU,kBAAA,qBACV,WAAA,CAAY,CAAA,EAAG,CAAA,IACf,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BQ,kCAAA,iBACM,iBAAA,kBAEJ,OAAA,GAAU,yBAAA,CAA0B,OAAA,CAAQ,CAAA;AAH1D;;;;AAAA,KAUY,gBAAA,2BAA2C,KAAA,IACnD,YAAA,CAAa,KAAA,EAAO,MAAA,IACpB,cAAA,CAAe,MAAA,IACf,kBAAA,CAAmB,KAAA,EAAO,MAAA;;;;;KAMlB,iBAAA;EAAA,CACT,GAAA,W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AAA,CAAQ,CAAA,UAAW,cAAA,QACnB,OAAA,CAAQ,CAAA,iBACR,OAAA,CAAQ,CAAA,UAAW,kBAAA,sBACnB,MAAA;;;;;;;;;;;;;AApCN;;;;;AAYA;;;;;;;;;;;;;;;;cA6Da,WAAA,iBAA4B,iBAAA;EAAA,SAwClB,MAAA,EAAQ,OAAA;EAhGY;;;;EAAA,kBA8DvB,mBAAA;EAlEN;;;;EAwEJ,KAAA,EAAO,qBAAA,CAAsB,OAAA;EAvEzB;;;;EA6EJ,MAAA,EAAQ,sBAAA,CAAuB,OAAA;EA3E3B;;;;;;;;AAcd;;;;;;;EA8EU,IAAA,EAAM,YAAA,CACZ,qBAAA,CAAsB,OAAA,GACtB,sBAAA,CAAuB,OAAA;EAGzB,WAAA,CAAqB,MAAA,EAAQ,OAAA;EAjFzB;;;;EAuFJ,WAAA,CAAA,GAAe,MAAA,SAAe,WAAA;EArF1B;;;;EA2HJ,aAAA,CAAA,GAAiB,UAAA;EA1HwB;;;;EA+KzC,kBAAA,CAAA,GAAsB,UAAA;EAnLV;;;EAkNZ,cAAA,CAAA;EAlN6D;;;EAyN7D,UAAA,CAAA;EAxNwB;;;;;;;EAmOlB,aAAA,GAAA,CAAiB,IAAA,EAAM,CAAA,GAAI,OAAA,CAAQ,CAAA;EAhOlB;;;;;AAsCzB;EAtCyB,OAqRhB,UAAA,iBAA2B,iBAAA,CAAA,CAChC,KAAA,EAAO,WAAA,CAAY,OAAA,IAClB,KAAA,IAAS,WAAA,CAAY,OAAA;EAAA,OAEjB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,WAAA;AAAA;AAAA,KAclC,cAAA,GAAiB,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"reduced.cjs","names":[],"sources":["../../../src/state/values/reduced.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport const REDUCED_VALUE_SYMBOL = Symbol.for(\"langgraph.state.reduced_value\");\n\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> =\n | ReducedValueInitWithSchema<Value, Input>\n | ReducedValueInitBase<Value>;\n\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL] = true as const;\n\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n\n /**\n * Represents the value stored after all reductions.\n */\n declare ValueType: Value;\n\n /**\n * Represents the type that may be provided as input on each update.\n */\n declare InputType: Input;\n\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInitWithSchema<Value, Input>\n );\n\n constructor(\n valueSchema: SerializableSchema<Input, Value>,\n init: ReducedValueInitBase<Value>\n );\n\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInit<Value, Input>\n ) {\n this.reducer = init.reducer as (current: Value, next: Input) => Value;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n this.valueSchema = valueSchema;\n this.inputSchema = \"inputSchema\" in init ? init.inputSchema : valueSchema;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n }\n\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input>\n ): value is ReducedValue<Value, Input>;\n\n static isInstance(value: unknown): value is ReducedValue;\n\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input> | unknown\n ): value is ReducedValue<Value, Input> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n REDUCED_VALUE_SYMBOL in value &&\n value[REDUCED_VALUE_SYMBOL] === true\n );\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,uBAAuB,OAAO,IAAI,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2G/E,IAAa,eAAb,MAA0D;;;;;CAKxD,CAAoB,wBAAwB;;;;;;CAO5C,AAAS;;;;;CAMT,AAAS;;;;CAKT,AAAS;;;;CAKT,AAAS;CA4BT,YACE,aACA,MACA;AACA,OAAK,UAAU,KAAK;AACpB,OAAK,kBAAkB,KAAK;AAC5B,OAAK,cAAc;AACnB,OAAK,cAAc,iBAAiB,OAAO,KAAK,cAAc;AAC9D,OAAK,kBAAkB,KAAK;;CAY9B,OAAO,WACL,OACqC;AACrC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,wBAAwB,SACxB,MAAM,0BAA0B"}
1
+ {"version":3,"file":"reduced.cjs","names":[],"sources":["../../../src/state/values/reduced.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport const REDUCED_VALUE_SYMBOL: symbol = Symbol.for(\n \"langgraph.state.reduced_value\"\n);\n\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> =\n | ReducedValueInitWithSchema<Value, Input>\n | ReducedValueInitBase<Value>;\n\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL] = true as const;\n\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n\n /**\n * Represents the value stored after all reductions.\n */\n declare ValueType: Value;\n\n /**\n * Represents the type that may be provided as input on each update.\n */\n declare InputType: Input;\n\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInitWithSchema<Value, Input>\n );\n\n constructor(\n valueSchema: SerializableSchema<Input, Value>,\n init: ReducedValueInitBase<Value>\n );\n\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInit<Value, Input>\n ) {\n this.reducer = init.reducer as (current: Value, next: Input) => Value;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n this.valueSchema = valueSchema;\n this.inputSchema = \"inputSchema\" in init ? init.inputSchema : valueSchema;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n }\n\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input>\n ): value is ReducedValue<Value, Input>;\n\n static isInstance(value: unknown): value is ReducedValue;\n\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input> | unknown\n ): value is ReducedValue<Value, Input> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n REDUCED_VALUE_SYMBOL in value &&\n (value as Record<symbol, unknown>)[REDUCED_VALUE_SYMBOL] === true\n );\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,uBAA+B,OAAO,IACjD,gCACD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GD,IAAa,eAAb,MAA0D;;;;;CAKxD,CAAoB,wBAAwB;;;;;;CAO5C,AAAS;;;;;CAMT,AAAS;;;;CAKT,AAAS;;;;CAKT,AAAS;CA4BT,YACE,aACA,MACA;AACA,OAAK,UAAU,KAAK;AACpB,OAAK,kBAAkB,KAAK;AAC5B,OAAK,cAAc;AACnB,OAAK,cAAc,iBAAiB,OAAO,KAAK,cAAc;AAC9D,OAAK,kBAAkB,KAAK;;CAY9B,OAAO,WACL,OACqC;AACrC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,wBAAwB,SACvB,MAAkC,0BAA0B"}
@@ -4,7 +4,7 @@ import { SerializableSchema } from "../types.cjs";
4
4
  /**
5
5
  * Symbol for runtime identification of ReducedValue instances.
6
6
  */
7
- declare const REDUCED_VALUE_SYMBOL: unique symbol;
7
+ declare const REDUCED_VALUE_SYMBOL: symbol;
8
8
  interface ReducedValueInitBase<Value = unknown> {
9
9
  /**
10
10
  * The reducer function that determines how new input values are combined with the current state.
@@ -103,11 +103,7 @@ type ReducedValueInit<Value = unknown, Input = Value> = ReducedValueInitWithSche
103
103
  * });
104
104
  */
105
105
  declare class ReducedValue<Value = unknown, Input = Value> {
106
- /**
107
- * Instance marker for runtime identification.
108
- * @internal
109
- */
110
- protected readonly [REDUCED_VALUE_SYMBOL]: true;
106
+ readonly [REDUCED_VALUE_SYMBOL]: true;
111
107
  /**
112
108
  * The schema that describes the type of value stored in state (i.e., after reduction).
113
109
  * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,
@@ -1 +1 @@
1
- {"version":3,"file":"reduced.d.cts","names":[],"sources":["../../../src/state/values/reduced.ts"],"mappings":";;;;;AAKA;cAAa,oBAAA;AAAA,UAEH,oBAAA;EAFqE;;AAAC;;;;;;;;;EAc9E,OAAA,GAAU,OAAA,EAAS,KAAA,EAAO,IAAA,EAAM,KAAA,KAAU,KAAA;EAA1C;;;;;;;;;E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;;EAAA,OAuBK,UAAA,0BAAoC,KAAA,CAAA,CACzC,KAAA,EAAO,YAAA,CAAa,KAAA,EAAO,KAAA,IAC1B,KAAA,IAAS,YAAA,CAAa,KAAA,EAAO,KAAA;EAAA,OAEzB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,YAAA;AAAA"}
@@ -4,7 +4,7 @@ import { SerializableSchema } from "../types.js";
4
4
  /**
5
5
  * Symbol for runtime identification of ReducedValue instances.
6
6
  */
7
- declare const REDUCED_VALUE_SYMBOL: unique symbol;
7
+ declare const REDUCED_VALUE_SYMBOL: symbol;
8
8
  interface ReducedValueInitBase<Value = unknown> {
9
9
  /**
10
10
  * The reducer function that determines how new input values are combined with the current state.
@@ -103,11 +103,7 @@ type ReducedValueInit<Value = unknown, Input = Value> = ReducedValueInitWithSche
103
103
  * });
104
104
  */
105
105
  declare class ReducedValue<Value = unknown, Input = Value> {
106
- /**
107
- * Instance marker for runtime identification.
108
- * @internal
109
- */
110
- protected readonly [REDUCED_VALUE_SYMBOL]: true;
106
+ readonly [REDUCED_VALUE_SYMBOL]: true;
111
107
  /**
112
108
  * The schema that describes the type of value stored in state (i.e., after reduction).
113
109
  * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,
@@ -1 +1 @@
1
- {"version":3,"file":"reduced.d.ts","names":[],"sources":["../../../src/state/values/reduced.ts"],"mappings":";;;;;AAKA;cAAa,oBAAA;AAAA,UAEH,oBAAA;EAFqE;;AAAC;;;;;;;;;EAc9E,OAAA,GAAU,OAAA,EAAS,KAAA,EAAO,IAAA,EAAM,KAAA,KAAU,KAAA;EAA1C;;;;;;;;;EAWA,eAAA,GAAkB,MAAA;AAAA;AAAA,UAGV,0BAAA,0BAAoD,KAAA;EAA1B;;;;;;;EAQlC,WAAA,EAAa,kBAAA,UAA4B,KAAA;EAwBjB;;;;;;;;;;;EAXxB,OAAA,GAAU,OAAA,EAAS,KAAA,EAAO,IAAA,EAAM,KAAA,KAAU,KAAA;EAAhB;;;;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{"version":3,"file":"reduced.js","names":[],"sources":["../../../src/state/values/reduced.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport const REDUCED_VALUE_SYMBOL = Symbol.for(\"langgraph.state.reduced_value\");\n\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> =\n | ReducedValueInitWithSchema<Value, Input>\n | ReducedValueInitBase<Value>;\n\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL] = true as const;\n\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n\n /**\n * Represents the value stored after all reductions.\n */\n declare ValueType: Value;\n\n /**\n * Represents the type that may be provided as input on each update.\n */\n declare InputType: Input;\n\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInitWithSchema<Value, Input>\n );\n\n constructor(\n valueSchema: SerializableSchema<Input, Value>,\n init: ReducedValueInitBase<Value>\n );\n\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInit<Value, Input>\n ) {\n this.reducer = init.reducer as (current: Value, next: Input) => Value;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n this.valueSchema = valueSchema;\n this.inputSchema = \"inputSchema\" in init ? init.inputSchema : valueSchema;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n }\n\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input>\n ): value is ReducedValue<Value, Input>;\n\n static isInstance(value: unknown): value is ReducedValue;\n\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input> | unknown\n ): value is ReducedValue<Value, Input> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n REDUCED_VALUE_SYMBOL in value &&\n value[REDUCED_VALUE_SYMBOL] === true\n );\n }\n}\n"],"mappings":";;;;AAKA,MAAa,uBAAuB,OAAO,IAAI,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2G/E,IAAa,eAAb,MAA0D;;;;;CAKxD,CAAoB,wBAAwB;;;;;;CAO5C,AAAS;;;;;CAMT,AAAS;;;;CAKT,AAAS;;;;CAKT,AAAS;CA4BT,YACE,aACA,MACA;AACA,OAAK,UAAU,KAAK;AACpB,OAAK,kBAAkB,KAAK;AAC5B,OAAK,cAAc;AACnB,OAAK,cAAc,iBAAiB,OAAO,KAAK,cAAc;AAC9D,OAAK,kBAAkB,KAAK;;CAY9B,OAAO,WACL,OACqC;AACrC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,wBAAwB,SACxB,MAAM,0BAA0B"}
1
+ {"version":3,"file":"reduced.js","names":[],"sources":["../../../src/state/values/reduced.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport const REDUCED_VALUE_SYMBOL: symbol = Symbol.for(\n \"langgraph.state.reduced_value\"\n);\n\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> =\n | ReducedValueInitWithSchema<Value, Input>\n | ReducedValueInitBase<Value>;\n\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL] = true as const;\n\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n\n /**\n * Represents the value stored after all reductions.\n */\n declare ValueType: Value;\n\n /**\n * Represents the type that may be provided as input on each update.\n */\n declare InputType: Input;\n\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInitWithSchema<Value, Input>\n );\n\n constructor(\n valueSchema: SerializableSchema<Input, Value>,\n init: ReducedValueInitBase<Value>\n );\n\n constructor(\n valueSchema: SerializableSchema<unknown, Value>,\n init: ReducedValueInit<Value, Input>\n ) {\n this.reducer = init.reducer as (current: Value, next: Input) => Value;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n this.valueSchema = valueSchema;\n this.inputSchema = \"inputSchema\" in init ? init.inputSchema : valueSchema;\n this.jsonSchemaExtra = init.jsonSchemaExtra;\n }\n\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input>\n ): value is ReducedValue<Value, Input>;\n\n static isInstance(value: unknown): value is ReducedValue;\n\n static isInstance<Value = unknown, Input = Value>(\n value: ReducedValue<Value, Input> | unknown\n ): value is ReducedValue<Value, Input> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n REDUCED_VALUE_SYMBOL in value &&\n (value as Record<symbol, unknown>)[REDUCED_VALUE_SYMBOL] === true\n );\n }\n}\n"],"mappings":";;;;AAKA,MAAa,uBAA+B,OAAO,IACjD,gCACD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GD,IAAa,eAAb,MAA0D;;;;;CAKxD,CAAoB,wBAAwB;;;;;;CAO5C,AAAS;;;;;CAMT,AAAS;;;;CAKT,AAAS;;;;CAKT,AAAS;CA4BT,YACE,aACA,MACA;AACA,OAAK,UAAU,KAAK;AACpB,OAAK,kBAAkB,KAAK;AAC5B,OAAK,cAAc;AACnB,OAAK,cAAc,iBAAiB,OAAO,KAAK,cAAc;AAC9D,OAAK,kBAAkB,KAAK;;CAY9B,OAAO,WACL,OACqC;AACrC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,wBAAwB,SACvB,MAAkC,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.cjs","names":[],"sources":["../../../src/state/values/untracked.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport const UNTRACKED_VALUE_SYMBOL = Symbol.for(\n \"langgraph.state.untracked_value\"\n);\n\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL] = true as const;\n\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n\n /**\n * Represents the type of value stored in this untracked state field.\n */\n declare ValueType: Value;\n\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit) {\n this.schema = schema;\n this.guard = init?.guard ?? true;\n }\n\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value>\n ): value is UntrackedValue<Value>;\n\n static isInstance(value: unknown): value is UntrackedValue;\n\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value> | unknown\n ): value is UntrackedValue<Value> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n UNTRACKED_VALUE_SYMBOL in value\n );\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,yBAAyB,OAAO,IAC3C,kCACD;;;;;;;;;;;;;;;;;;;;AAgCD,IAAa,iBAAb,MAA6C;;;;;CAK3C,CAAoB,0BAA0B;;;;;;CAO9C,AAAS;;;;;;;;;CAUT,AAAS;;;;;;;CAaT,YAAY,QAAoC,MAA2B;AACzE,OAAK,SAAS;AACd,OAAK,QAAQ,MAAM,SAAS;;CAY9B,OAAO,WACL,OACgC;AAChC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,0BAA0B"}
1
+ {"version":3,"file":"untracked.cjs","names":[],"sources":["../../../src/state/values/untracked.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport const UNTRACKED_VALUE_SYMBOL: symbol = Symbol.for(\n \"langgraph.state.untracked_value\"\n);\n\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL] = true as const;\n\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n\n /**\n * Represents the type of value stored in this untracked state field.\n */\n declare ValueType: Value;\n\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit) {\n this.schema = schema;\n this.guard = init?.guard ?? true;\n }\n\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value>\n ): value is UntrackedValue<Value>;\n\n static isInstance(value: unknown): value is UntrackedValue;\n\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value> | unknown\n ): value is UntrackedValue<Value> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n UNTRACKED_VALUE_SYMBOL in value\n );\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,yBAAiC,OAAO,IACnD,kCACD;;;;;;;;;;;;;;;;;;;;AAgCD,IAAa,iBAAb,MAA6C;;;;;CAK3C,CAAoB,0BAA0B;;;;;;CAO9C,AAAS;;;;;;;;;CAUT,AAAS;;;;;;;CAaT,YAAY,QAAoC,MAA2B;AACzE,OAAK,SAAS;AACd,OAAK,QAAQ,MAAM,SAAS;;CAY9B,OAAO,WACL,OACgC;AAChC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,0BAA0B"}
@@ -4,7 +4,7 @@ import { SerializableSchema } from "../types.cjs";
4
4
  /**
5
5
  * Symbol for runtime identification of UntrackedValue instances.
6
6
  */
7
- declare const UNTRACKED_VALUE_SYMBOL: unique symbol;
7
+ declare const UNTRACKED_VALUE_SYMBOL: symbol;
8
8
  /**
9
9
  * Initialization options for {@link UntrackedValue}.
10
10
  */
@@ -35,11 +35,7 @@ interface UntrackedValueInit {
35
35
  * const session = new UntrackedValue(undefined, { guard: false });
36
36
  */
37
37
  declare class UntrackedValue<Value = unknown> {
38
- /**
39
- * Instance marker for runtime identification.
40
- * @internal
41
- */
42
- protected readonly [UNTRACKED_VALUE_SYMBOL]: true;
38
+ readonly [UNTRACKED_VALUE_SYMBOL]: true;
43
39
  /**
44
40
  * Optional schema describing the type and shape of the value stored in this field.
45
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.d.cts","names":[],"sources":["../../../src/state/values/untracked.ts"],"mappings":";;;;;AAKA;cAAa,sBAAA;;;;UAOI,kBAAA;EAAkB;;;;EAKjC,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;cAsBW,cAAA;EAsBF;;;;EAAA,oBAjBW,sBAAA;EA8BoB;;;;;EAAA,SAvB/B,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAgC5B;;;;;;;;EAAA,SAtBA,KAAA;EAyBmC;;;EApBpC,SAAA,EAAW,KAAA;;;;;;;EAQnB,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
1
+ {"version":3,"file":"untracked.d.cts","names":[],"sources":["../../../src/state/values/untracked.ts"],"mappings":";;;;;AAKA;cAAa,sBAAA;;;;UAOI,kBAAA;EAAkB;;;;EAKjC,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;cAsBW,cAAA;EAAA,UAKS,sBAAA;EAsBZ;;;;;EAAA,SAfC,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAuBkB;;;;;;;;EAAA,SAb9C,KAAA;EAuBkB;;;EAlBnB,SAAA,EAAW,KAAA;EAoByB;;;;;;EAZ5C,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
@@ -4,7 +4,7 @@ import { SerializableSchema } from "../types.js";
4
4
  /**
5
5
  * Symbol for runtime identification of UntrackedValue instances.
6
6
  */
7
- declare const UNTRACKED_VALUE_SYMBOL: unique symbol;
7
+ declare const UNTRACKED_VALUE_SYMBOL: symbol;
8
8
  /**
9
9
  * Initialization options for {@link UntrackedValue}.
10
10
  */
@@ -35,11 +35,7 @@ interface UntrackedValueInit {
35
35
  * const session = new UntrackedValue(undefined, { guard: false });
36
36
  */
37
37
  declare class UntrackedValue<Value = unknown> {
38
- /**
39
- * Instance marker for runtime identification.
40
- * @internal
41
- */
42
- protected readonly [UNTRACKED_VALUE_SYMBOL]: true;
38
+ readonly [UNTRACKED_VALUE_SYMBOL]: true;
43
39
  /**
44
40
  * Optional schema describing the type and shape of the value stored in this field.
45
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.d.ts","names":[],"sources":["../../../src/state/values/untracked.ts"],"mappings":";;;;;AAKA;cAAa,sBAAA;;;;UAOI,kBAAA;EAAkB;;;;EAKjC,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;cAsBW,cAAA;EAsBF;;;;EAAA,oBAjBW,sBAAA;EA8BoB;;;;;EAAA,SAvB/B,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAgC5B;;;;;;;;EAAA,SAtBA,KAAA;EAyBmC;;;EApBpC,SAAA,EAAW,KAAA;;;;;;;EAQnB,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
1
+ {"version":3,"file":"untracked.d.ts","names":[],"sources":["../../../src/state/values/untracked.ts"],"mappings":";;;;;AAKA;cAAa,sBAAA;;;;UAOI,kBAAA;EAAkB;;;;EAKjC,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;cAsBW,cAAA;EAAA,UAKS,sBAAA;EAsBZ;;;;;EAAA,SAfC,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAuBkB;;;;;;;;EAAA,SAb9C,KAAA;EAuBkB;;;EAlBnB,SAAA,EAAW,KAAA;EAoByB;;;;;;EAZ5C,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.js","names":[],"sources":["../../../src/state/values/untracked.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport const UNTRACKED_VALUE_SYMBOL = Symbol.for(\n \"langgraph.state.untracked_value\"\n);\n\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL] = true as const;\n\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n\n /**\n * Represents the type of value stored in this untracked state field.\n */\n declare ValueType: Value;\n\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit) {\n this.schema = schema;\n this.guard = init?.guard ?? true;\n }\n\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value>\n ): value is UntrackedValue<Value>;\n\n static isInstance(value: unknown): value is UntrackedValue;\n\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value> | unknown\n ): value is UntrackedValue<Value> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n UNTRACKED_VALUE_SYMBOL in value\n );\n }\n}\n"],"mappings":";;;;AAKA,MAAa,yBAAyB,OAAO,IAC3C,kCACD;;;;;;;;;;;;;;;;;;;;AAgCD,IAAa,iBAAb,MAA6C;;;;;CAK3C,CAAoB,0BAA0B;;;;;;CAO9C,AAAS;;;;;;;;;CAUT,AAAS;;;;;;;CAaT,YAAY,QAAoC,MAA2B;AACzE,OAAK,SAAS;AACd,OAAK,QAAQ,MAAM,SAAS;;CAY9B,OAAO,WACL,OACgC;AAChC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,0BAA0B"}
1
+ {"version":3,"file":"untracked.js","names":[],"sources":["../../../src/state/values/untracked.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport const UNTRACKED_VALUE_SYMBOL: symbol = Symbol.for(\n \"langgraph.state.untracked_value\"\n);\n\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL] = true as const;\n\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n\n /**\n * Represents the type of value stored in this untracked state field.\n */\n declare ValueType: Value;\n\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit) {\n this.schema = schema;\n this.guard = init?.guard ?? true;\n }\n\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value>\n ): value is UntrackedValue<Value>;\n\n static isInstance(value: unknown): value is UntrackedValue;\n\n static isInstance<Value = unknown>(\n value: UntrackedValue<Value> | unknown\n ): value is UntrackedValue<Value> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n UNTRACKED_VALUE_SYMBOL in value\n );\n }\n}\n"],"mappings":";;;;AAKA,MAAa,yBAAiC,OAAO,IACnD,kCACD;;;;;;;;;;;;;;;;;;;;AAgCD,IAAa,iBAAb,MAA6C;;;;;CAK3C,CAAoB,0BAA0B;;;;;;CAO9C,AAAS;;;;;;;;;CAUT,AAAS;;;;;;;CAaT,YAAY,QAAoC,MAA2B;AACzE,OAAK,SAAS;AACd,OAAK,QAAQ,MAAM,SAAS;;CAY9B,OAAO,WACL,OACgC;AAChC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,0BAA0B"}
package/dist/web.cjs CHANGED
@@ -44,7 +44,9 @@ Object.defineProperty(exports, 'BaseStore', {
44
44
  }
45
45
  });
46
46
  exports.BinaryOperatorAggregate = require_binop.BinaryOperatorAggregate;
47
+ exports.COMMAND_SYMBOL = require_constants.COMMAND_SYMBOL;
47
48
  exports.Command = require_constants.Command;
49
+ exports.CommandInstance = require_constants.CommandInstance;
48
50
  exports.CompiledStateGraph = require_state.CompiledStateGraph;
49
51
  exports.END = require_constants.END;
50
52
  exports.EmptyChannelError = require_errors.EmptyChannelError;
package/dist/web.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.cjs";
2
- import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.cjs";
2
+ import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.cjs";
3
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.cjs";
4
4
  import { AnyValue } from "./channels/any_value.cjs";
5
5
  import { LastValue } from "./channels/last_value.cjs";
@@ -29,4 +29,4 @@ import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/m
29
29
  import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.cjs";
30
30
  import { MessagesValue } from "./state/prebuilt/messages.cjs";
31
31
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
32
- export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
32
+ export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
package/dist/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.js";
2
- import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.js";
2
+ import { COMMAND_SYMBOL, Command, CommandInstance, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.js";
3
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.js";
4
4
  import { AnyValue } from "./channels/any_value.js";
5
5
  import { LastValue } from "./channels/last_value.js";
@@ -8,7 +8,6 @@ import { EphemeralValue } from "./channels/ephemeral_value.js";
8
8
  import { NamedBarrierValue } from "./channels/named_barrier_value.js";
9
9
  import { Topic } from "./channels/topic.js";
10
10
  import { UntrackedValueChannel } from "./channels/untracked_value.js";
11
- import "./channels/index.js";
12
11
  import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.js";
13
12
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
14
13
  import { RetryPolicy } from "./pregel/utils/index.js";
@@ -24,12 +23,10 @@ import { ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, E
24
23
  import { CompiledStateGraph, StateGraph, StateGraphArgs } from "./graph/state.js";
25
24
  import { Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/messages_reducer.js";
26
25
  import { MessageGraph } from "./graph/message.js";
27
- import "./graph/index.js";
28
26
  import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
29
27
  import { EntrypointOptions, TaskOptions, entrypoint, task } from "./func/index.js";
30
28
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
31
29
  import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.js";
32
30
  import { MessagesValue } from "./state/prebuilt/messages.js";
33
- import "./state/index.js";
34
31
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
35
- export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
32
+ export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
package/dist/web.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Command, END, INTERRUPT, Overwrite, START, Send, isCommand, isInterrupted } from "./constants.js";
1
+ import { COMMAND_SYMBOL, Command, CommandInstance, END, INTERRUPT, Overwrite, START, Send, isCommand, isInterrupted } from "./constants.js";
2
2
  import { BaseLangGraphError, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
3
3
  import { BaseChannel } from "./channels/base.js";
4
4
  import { BinaryOperatorAggregate } from "./channels/binop.js";
@@ -21,4 +21,4 @@ import { entrypoint, task } from "./func/index.js";
21
21
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
22
22
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, InMemoryStore, MemorySaver, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
23
23
 
24
- export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, Command, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
24
+ export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, COMMAND_SYMBOL, Command, CommandInstance, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,7 +19,7 @@
19
19
  "@standard-schema/spec": "1.1.0",
20
20
  "uuid": "^10.0.0",
21
21
  "@langchain/langgraph-checkpoint": "^1.0.0",
22
- "@langchain/langgraph-sdk": "~1.6.5"
22
+ "@langchain/langgraph-sdk": "~1.7.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@langchain/core": "^1.1.16",