@langchain/langgraph 1.1.0 → 1.1.1

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 (34) hide show
  1. package/dist/errors.d.cts.map +1 -1
  2. package/dist/graph/message.d.cts +2 -2
  3. package/dist/graph/message.d.cts.map +1 -1
  4. package/dist/graph/messages_annotation.d.cts +5 -5
  5. package/dist/graph/messages_annotation.d.cts.map +1 -1
  6. package/dist/index.d.cts +2 -2
  7. package/dist/index.d.ts +2 -2
  8. package/dist/prebuilt/agent_executor.d.cts +5 -5
  9. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  10. package/dist/prebuilt/react_agent_executor.d.cts +3 -3
  11. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  12. package/dist/state/schema.cjs +8 -9
  13. package/dist/state/schema.cjs.map +1 -1
  14. package/dist/state/schema.d.cts +18 -22
  15. package/dist/state/schema.d.cts.map +1 -1
  16. package/dist/state/schema.d.ts +18 -22
  17. package/dist/state/schema.d.ts.map +1 -1
  18. package/dist/state/schema.js +8 -9
  19. package/dist/state/schema.js.map +1 -1
  20. package/dist/state/values/reduced.cjs.map +1 -1
  21. package/dist/state/values/reduced.d.cts +1 -1
  22. package/dist/state/values/reduced.d.cts.map +1 -1
  23. package/dist/state/values/reduced.d.ts +1 -1
  24. package/dist/state/values/reduced.d.ts.map +1 -1
  25. package/dist/state/values/reduced.js.map +1 -1
  26. package/dist/state/values/untracked.cjs.map +1 -1
  27. package/dist/state/values/untracked.d.cts +4 -0
  28. package/dist/state/values/untracked.d.cts.map +1 -1
  29. package/dist/state/values/untracked.d.ts +4 -0
  30. package/dist/state/values/untracked.d.ts.map +1 -1
  31. package/dist/state/values/untracked.js.map +1 -1
  32. package/dist/web.d.cts +2 -2
  33. package/dist/web.d.ts +2 -2
  34. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.cts","names":["Command","Interrupt","BaseLangGraphErrorFields","BaseLangGraphError","Error","GraphBubbleUp","GraphRecursionError","GraphValueError","GraphInterrupt","NodeInterrupt","ParentCommand","isParentCommand","isGraphBubbleUp","isGraphInterrupt","EmptyInputError","EmptyChannelError","InvalidUpdateError","MultipleSubgraphsError","UnreachableNodeError","RemoteException","StateGraphInputError","getSubgraphsSeenSet"],"sources":["../src/errors.d.ts"],"sourcesContent":["import { Command, Interrupt } from \"./constants.js\";\nexport type BaseLangGraphErrorFields = {\n lc_error_code?: \"GRAPH_RECURSION_LIMIT\" | \"INVALID_CONCURRENT_GRAPH_UPDATE\" | \"INVALID_GRAPH_NODE_RETURN_VALUE\" | \"MISSING_CHECKPOINTER\" | \"MULTIPLE_SUBGRAPHS\" | \"UNREACHABLE_NODE\";\n};\n/** @category Errors */\nexport declare class BaseLangGraphError extends Error {\n lc_error_code?: string;\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n}\nexport declare class GraphBubbleUp extends BaseLangGraphError {\n get is_bubble_up(): boolean;\n}\nexport declare class GraphRecursionError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class GraphValueError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class GraphInterrupt extends GraphBubbleUp {\n interrupts: Interrupt[];\n constructor(interrupts?: Interrupt[], fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/** Raised by a node to interrupt execution. */\nexport declare class NodeInterrupt extends GraphInterrupt {\n constructor(message: any, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class ParentCommand extends GraphBubbleUp {\n command: Command;\n constructor(command: Command);\n static get unminifiable_name(): string;\n}\nexport declare function isParentCommand(e?: unknown): e is ParentCommand;\nexport declare function isGraphBubbleUp(e?: unknown): e is GraphBubbleUp;\nexport declare function isGraphInterrupt(e?: unknown): e is GraphInterrupt;\nexport declare class EmptyInputError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class EmptyChannelError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class InvalidUpdateError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * @deprecated This exception type is no longer thrown.\n */\nexport declare class MultipleSubgraphsError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class UnreachableNodeError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * Exception raised when an error occurs in the remote graph.\n */\nexport declare class RemoteException extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * Error thrown when invalid input is provided to a StateGraph.\n *\n * This typically means that the input to the StateGraph constructor or builder\n * did not match the required types. A valid input should be a\n * StateDefinition, an Annotation.Root, or a Zod schema.\n *\n * @example\n * // Example of incorrect usage:\n * try {\n * new StateGraph({ foo: \"bar\" }); // Not a valid input\n * } catch (err) {\n * if (err instanceof StateGraphInputError) {\n * console.error(err.message);\n * }\n * }\n */\nexport declare class StateGraphInputError extends BaseLangGraphError {\n /**\n * Create a new StateGraphInputError.\n * @param message - Optional custom error message.\n * @param fields - Optional additional error fields.\n */\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n /**\n * The unminifiable (static, human-readable) error name for this error class.\n */\n static get unminifiable_name(): string;\n}\n/**\n * Used for subgraph detection.\n */\nexport declare const getSubgraphsSeenSet: () => any;\n"],"mappings":";;;KACYE,wBAAAA;;AAAZ,CAAA;AAIA;AAAuC,cAAlBC,kBAAAA,SAA2BC,KAAAA,CAAT;eAEIF,CAAAA,EAAAA,MAAAA;aAFKE,CAAAA,OAAAA,CAAAA,EAAAA,MAAAA,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 {"version":3,"file":"errors.d.cts","names":["Command","Interrupt","BaseLangGraphErrorFields","BaseLangGraphError","Error","GraphBubbleUp","GraphRecursionError","GraphValueError","GraphInterrupt","NodeInterrupt","ParentCommand","isParentCommand","isGraphBubbleUp","isGraphInterrupt","EmptyInputError","EmptyChannelError","InvalidUpdateError","MultipleSubgraphsError","UnreachableNodeError","RemoteException","StateGraphInputError","getSubgraphsSeenSet"],"sources":["../src/errors.d.ts"],"sourcesContent":["import { Command, Interrupt } from \"./constants.js\";\nexport type BaseLangGraphErrorFields = {\n lc_error_code?: \"GRAPH_RECURSION_LIMIT\" | \"INVALID_CONCURRENT_GRAPH_UPDATE\" | \"INVALID_GRAPH_NODE_RETURN_VALUE\" | \"MISSING_CHECKPOINTER\" | \"MULTIPLE_SUBGRAPHS\" | \"UNREACHABLE_NODE\";\n};\n/** @category Errors */\nexport declare class BaseLangGraphError extends Error {\n lc_error_code?: string;\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n}\nexport declare class GraphBubbleUp extends BaseLangGraphError {\n get is_bubble_up(): boolean;\n}\nexport declare class GraphRecursionError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class GraphValueError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class GraphInterrupt extends GraphBubbleUp {\n interrupts: Interrupt[];\n constructor(interrupts?: Interrupt[], fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/** Raised by a node to interrupt execution. */\nexport declare class NodeInterrupt extends GraphInterrupt {\n constructor(message: any, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class ParentCommand extends GraphBubbleUp {\n command: Command;\n constructor(command: Command);\n static get unminifiable_name(): string;\n}\nexport declare function isParentCommand(e?: unknown): e is ParentCommand;\nexport declare function isGraphBubbleUp(e?: unknown): e is GraphBubbleUp;\nexport declare function isGraphInterrupt(e?: unknown): e is GraphInterrupt;\nexport declare class EmptyInputError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class EmptyChannelError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class InvalidUpdateError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * @deprecated This exception type is no longer thrown.\n */\nexport declare class MultipleSubgraphsError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\nexport declare class UnreachableNodeError extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * Exception raised when an error occurs in the remote graph.\n */\nexport declare class RemoteException extends BaseLangGraphError {\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n static get unminifiable_name(): string;\n}\n/**\n * Error thrown when invalid input is provided to a StateGraph.\n *\n * This typically means that the input to the StateGraph constructor or builder\n * did not match the required types. A valid input should be a\n * StateDefinition, an Annotation.Root, or a Zod schema.\n *\n * @example\n * // Example of incorrect usage:\n * try {\n * new StateGraph({ foo: \"bar\" }); // Not a valid input\n * } catch (err) {\n * if (err instanceof StateGraphInputError) {\n * console.error(err.message);\n * }\n * }\n */\nexport declare class StateGraphInputError extends BaseLangGraphError {\n /**\n * Create a new StateGraphInputError.\n * @param message - Optional custom error message.\n * @param fields - Optional additional error fields.\n */\n constructor(message?: string, fields?: BaseLangGraphErrorFields);\n /**\n * The unminifiable (static, human-readable) error name for this error class.\n */\n static get unminifiable_name(): string;\n}\n/**\n * Used for subgraph detection.\n */\nexport declare const getSubgraphsSeenSet: () => any;\n"],"mappings":";;;KACYE,wBAAAA;;AAAZ,CAAA;AAIA;AAAuC,cAAlBC,kBAAAA,SAA2BC,KAAAA,CAAT;eAEIF,CAA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AAAA,SAA6BjB,kBAAAA;;;;;;yCAMPD;;;;;;;;;cAStBmB"}
@@ -1,7 +1,7 @@
1
1
  import { StateGraph } from "./state.cjs";
2
2
  import { Messages } from "./messages_reducer.cjs";
3
3
  import { RunnableConfig } from "@langchain/core/runnables";
4
- import * as _langchain_core_messages26 from "@langchain/core/messages";
4
+ import * as _langchain_core_messages14 from "@langchain/core/messages";
5
5
  import { BaseMessage, BaseMessageLike } from "@langchain/core/messages";
6
6
 
7
7
  //#region src/graph/message.d.ts
@@ -27,7 +27,7 @@ declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: R
27
27
  * @default "messages"
28
28
  */
29
29
  stateKey?: string | null;
30
- }): BaseMessage<_langchain_core_messages26.MessageStructure<_langchain_core_messages26.MessageToolSet>, _langchain_core_messages26.MessageType>;
30
+ }): BaseMessage<_langchain_core_messages14.MessageStructure<_langchain_core_messages14.MessageToolSet>, _langchain_core_messages14.MessageType>;
31
31
  //#endregion
32
32
  export { MessageGraph, pushMessage };
33
33
  //# sourceMappingURL=message.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.cts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","Messages","MessageGraph","pushMessage","_langchain_core_messages26","MessageToolSet","MessageStructure","MessageType"],"sources":["../../src/graph/message.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nimport type { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph } from \"./state.js\";\nimport { type Messages } from \"./messages_reducer.js\";\n/** @ignore */\nexport declare class MessageGraph extends StateGraph<BaseMessage[], BaseMessage[], Messages> {\n constructor();\n}\n/**\n * Manually push a message to a message stream.\n *\n * This is useful when you need to push a manually created message before the node\n * has finished executing.\n *\n * When a message is pushed, it will be automatically persisted to the state after the node has finished executing.\n * To disable persisting, set `options.stateKey` to `null`.\n *\n * @param message The message to push. The message must have an ID set, otherwise an error will be thrown.\n * @param options RunnableConfig / Runtime coming from node context.\n */\nexport declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: RunnableConfig & {\n /**\n * The key of the state to push the message to. Set to `null` to avoid persisting.\n * @default \"messages\"\n */\n stateKey?: string | null;\n}): BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>;\n"],"mappings":";;;;;;;;cAKqBK,YAAAA,SAAqBF,WAAWH,eAAeA,eAAeI;;AAAnF;;;;;;;AAeA;;;;;;AAMqHG,iBAN7FD,WAAAA,CAM2BG,OAAAA,EANNT,WAMMS,GANQR,eAMRQ,EAAAA,QAAAA,EANmCP,cAMnCO,GAAAA;;;;;;IAA/CT,YAAiHO,0BAAAA,CAAlEE,iBANiDF,0BAAAA,CAMGC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA"}
1
+ {"version":3,"file":"message.d.cts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","Messages","MessageGraph","pushMessage","_langchain_core_messages14","MessageToolSet","MessageStructure","MessageType"],"sources":["../../src/graph/message.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nimport type { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph } from \"./state.js\";\nimport { type Messages } from \"./messages_reducer.js\";\n/** @ignore */\nexport declare class MessageGraph extends StateGraph<BaseMessage[], BaseMessage[], Messages> {\n constructor();\n}\n/**\n * Manually push a message to a message stream.\n *\n * This is useful when you need to push a manually created message before the node\n * has finished executing.\n *\n * When a message is pushed, it will be automatically persisted to the state after the node has finished executing.\n * To disable persisting, set `options.stateKey` to `null`.\n *\n * @param message The message to push. The message must have an ID set, otherwise an error will be thrown.\n * @param options RunnableConfig / Runtime coming from node context.\n */\nexport declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: RunnableConfig & {\n /**\n * The key of the state to push the message to. Set to `null` to avoid persisting.\n * @default \"messages\"\n */\n stateKey?: string | null;\n}): BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>;\n"],"mappings":";;;;;;;;cAKqBK,YAAAA,SAAqBF,WAAWH,eAAeA,eAAeI;;AAAnF;;;;;;;AAeA;;;;;;AAMqHG,iBAN7FD,WAAAA,CAM2BG,OAAAA,EANNT,WAMMS,GANQR,eAMRQ,EAAAA,QAAAA,EANmCP,cAMnCO,GAAAA;;;;;;IAA/CT,YAAiHO,0BAAAA,CAAlEE,iBANiDF,0BAAAA,CAMGC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA"}
@@ -4,7 +4,7 @@ import { AnnotationRoot } from "./annotation.cjs";
4
4
  import { Messages } from "./messages_reducer.cjs";
5
5
  import { z } from "zod/v3";
6
6
  import * as _langchain_core_utils_types0 from "@langchain/core/utils/types";
7
- import * as _langchain_core_messages29 from "@langchain/core/messages";
7
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
8
8
  import { BaseMessage } from "@langchain/core/messages";
9
9
 
10
10
  //#region src/graph/messages_annotation.d.ts
@@ -45,7 +45,7 @@ import { BaseMessage } from "@langchain/core/messages";
45
45
  * ```
46
46
  */
47
47
  declare const MessagesAnnotation: AnnotationRoot<{
48
- messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages29.MessageStructure<_langchain_core_messages29.MessageToolSet>, _langchain_core_messages29.MessageType>[], Messages>;
48
+ messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
49
49
  }>;
50
50
  /**
51
51
  * Prebuilt schema meta for Zod state definition.
@@ -101,11 +101,11 @@ declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;
101
101
  * ```
102
102
  */
103
103
  declare const MessagesZodState: z.ZodObject<{
104
- messages: ReducedZodChannel<z.ZodType<BaseMessage<_langchain_core_messages29.MessageStructure<_langchain_core_messages29.MessageToolSet>, _langchain_core_messages29.MessageType>[], z.ZodTypeDef, BaseMessage<_langchain_core_messages29.MessageStructure<_langchain_core_messages29.MessageToolSet>, _langchain_core_messages29.MessageType>[]>, _langchain_core_utils_types0.InteropZodType<Messages>>;
104
+ messages: ReducedZodChannel<z.ZodType<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], z.ZodTypeDef, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[]>, _langchain_core_utils_types0.InteropZodType<Messages>>;
105
105
  }, "strip", z.ZodTypeAny, {
106
- messages: BaseMessage<_langchain_core_messages29.MessageStructure<_langchain_core_messages29.MessageToolSet>, _langchain_core_messages29.MessageType>[];
106
+ messages: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[];
107
107
  }, {
108
- messages: BaseMessage<_langchain_core_messages29.MessageStructure<_langchain_core_messages29.MessageToolSet>, _langchain_core_messages29.MessageType>[];
108
+ messages: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[];
109
109
  }>;
110
110
  //#endregion
111
111
  export { MessagesAnnotation, MessagesZodMeta, MessagesZodState };
@@ -1 +1 @@
1
- {"version":3,"file":"messages_annotation.d.cts","names":["___web_js7","__annotation_js0","_langchain_core_utils_types0","__zod_meta_js0","BaseMessage","z","Messages","SchemaMeta","MessagesAnnotation","_langchain_core_messages29","MessageToolSet","MessageStructure","MessageType","BinaryOperatorAggregate","AnnotationRoot","MessagesZodMeta","MessagesZodState","ZodTypeDef","ZodType","InteropZodType","ReducedZodChannel","ZodTypeAny","ZodObject"],"sources":["../../src/graph/messages_annotation.d.ts"],"sourcesContent":["import { BaseMessage } from \"@langchain/core/messages\";\nimport { z } from \"zod/v3\";\nimport { Messages } from \"./messages_reducer.js\";\nimport { SchemaMeta } from \"./zod/meta.js\";\n/**\n * Prebuilt state annotation that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n *\n * Specifically, importing and using the prebuilt MessagesAnnotation like this:\n *\n * @example\n * ```ts\n * import { MessagesAnnotation, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(...)\n * ...\n * ```\n *\n * Is equivalent to initializing your state manually like this:\n *\n * @example\n * ```ts\n * import { BaseMessage } from \"@langchain/core/messages\";\n * import { Annotation, StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n *\n * export const StateAnnotation = Annotation.Root({\n * messages: Annotation<BaseMessage[]>({\n * reducer: messagesStateReducer,\n * default: () => [],\n * }),\n * });\n *\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesAnnotation: import(\"./annotation.js\").AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\n/**\n * Prebuilt schema meta for Zod state definition.\n *\n * @example\n * ```ts\n * import { z } from \"zod/v4-mini\";\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const AgentState = z.object({\n * messages: z.custom<BaseMessage[]>().register(registry, MessagesZodMeta),\n * });\n * ```\n */\nexport declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;\n/**\n * Prebuilt state object that uses Zod to combine returned messages.\n * This utility is synonymous with the `MessagesAnnotation` annotation,\n * but uses Zod as the way to express messages state.\n *\n * You can use import and use this prebuilt schema like this:\n *\n * @example\n * ```ts\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesZodState)\n * .addNode(...)\n * ...\n * ```\n *\n * Which is equivalent to initializing the schema object manually like this:\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import type { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\n * import { StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n * import \"@langchain/langgraph/zod\";\n *\n * const AgentState = z.object({\n * messages: z\n * .custom<BaseMessage[]>()\n * .default(() => [])\n * .langgraph.reducer(\n * messagesStateReducer,\n * z.custom<BaseMessageLike | BaseMessageLike[]>()\n * ),\n * });\n * const graph = new StateGraph(AgentState)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesZodState: z.ZodObject<{\n messages: import(\"./zod/meta.js\").ReducedZodChannel<z.ZodType<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], z.ZodTypeDef, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>, import(\"@langchain/core/utils/types\").InteropZodType<Messages>>;\n}, \"strip\", z.ZodTypeAny, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[];\n}, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[];\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;AAuCA;;;;;;;;;;AAgBA;;;;;;AAwCA;;;;;;;;;;;;;AAC4dE,cAzDvcM,kBAyDgbW,EAxD5YlB,cAwD4YkB,CAAAA;UAAchB,EAxD1OH,uBAwD0OG,CAxDzZC,WAwDyZD,CAxDxSM,0BAAAA,CAAlEE,gBAwD0WR,CAvDjdM,0BAAAA,CAD2JC,cAAAA,CAwDsTP,EAxD1VM,0BAAAA,CAAwFG,WAAAA,CAwDkQT,EAAAA,EAxDlPG,QAwDkPH,CAAAA;;;;;;;;;;;;;;;cAzC9bY,iBAAiBR,WAAWH,eAAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwC3CU,kBAAkBX,CAAAA,CAAEiB;YAC0anB,kBAA3ZE,CAAAA,CAAEa,QAAQd,YAAiHK,0BAAAA,CAAlEE,iBAK/GF,0BAAAA,CALmKC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA,KAAgBP,CAAAA,CAAEY,YAAYb,YAAiHK,0BAAAA,CAAlEE,iBAAjDF,0BAAAA,CAAqGC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA,MAA8EV,4BAAAA,CAAvBiB,eAAeb;YACxcD,CAAAA,CAAEgB;YACAjB,YAAiHK,0BAAAA,CAAlEE,iBADrCF,0BAAAA,CACyFC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA;;YAEvJR,YAAiHK,0BAAAA,CAAlEE,iBAFpCF,0BAAAA,CAEwFC,cAAAA,GAApCD,0BAAAA,CAAwFG,WAAAA"}
1
+ {"version":3,"file":"messages_annotation.d.cts","names":["___web_js0","__annotation_js0","_langchain_core_utils_types0","__zod_meta_js0","BaseMessage","z","Messages","SchemaMeta","MessagesAnnotation","_langchain_core_messages0","MessageToolSet","MessageStructure","MessageType","BinaryOperatorAggregate","AnnotationRoot","MessagesZodMeta","MessagesZodState","ZodTypeDef","ZodType","InteropZodType","ReducedZodChannel","ZodTypeAny","ZodObject"],"sources":["../../src/graph/messages_annotation.d.ts"],"sourcesContent":["import { BaseMessage } from \"@langchain/core/messages\";\nimport { z } from \"zod/v3\";\nimport { Messages } from \"./messages_reducer.js\";\nimport { SchemaMeta } from \"./zod/meta.js\";\n/**\n * Prebuilt state annotation that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n *\n * Specifically, importing and using the prebuilt MessagesAnnotation like this:\n *\n * @example\n * ```ts\n * import { MessagesAnnotation, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(...)\n * ...\n * ```\n *\n * Is equivalent to initializing your state manually like this:\n *\n * @example\n * ```ts\n * import { BaseMessage } from \"@langchain/core/messages\";\n * import { Annotation, StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n *\n * export const StateAnnotation = Annotation.Root({\n * messages: Annotation<BaseMessage[]>({\n * reducer: messagesStateReducer,\n * default: () => [],\n * }),\n * });\n *\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesAnnotation: import(\"./annotation.js\").AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\n/**\n * Prebuilt schema meta for Zod state definition.\n *\n * @example\n * ```ts\n * import { z } from \"zod/v4-mini\";\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const AgentState = z.object({\n * messages: z.custom<BaseMessage[]>().register(registry, MessagesZodMeta),\n * });\n * ```\n */\nexport declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;\n/**\n * Prebuilt state object that uses Zod to combine returned messages.\n * This utility is synonymous with the `MessagesAnnotation` annotation,\n * but uses Zod as the way to express messages state.\n *\n * You can use import and use this prebuilt schema like this:\n *\n * @example\n * ```ts\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesZodState)\n * .addNode(...)\n * ...\n * ```\n *\n * Which is equivalent to initializing the schema object manually like this:\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import type { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\n * import { StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n * import \"@langchain/langgraph/zod\";\n *\n * const AgentState = z.object({\n * messages: z\n * .custom<BaseMessage[]>()\n * .default(() => [])\n * .langgraph.reducer(\n * messagesStateReducer,\n * z.custom<BaseMessageLike | BaseMessageLike[]>()\n * ),\n * });\n * const graph = new StateGraph(AgentState)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesZodState: z.ZodObject<{\n messages: import(\"./zod/meta.js\").ReducedZodChannel<z.ZodType<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], z.ZodTypeDef, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>, import(\"@langchain/core/utils/types\").InteropZodType<Messages>>;\n}, \"strip\", z.ZodTypeAny, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[];\n}, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[];\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;AAuCA;;;;;;;;;;AAgBA;;;;;;AAwCA;;;;;;;;;;;;;AAC4dE,cAzDvcM,kBAyDgbW,EAxD5YlB,cAwD4YkB,CAAAA;UAAchB,EAxD1OH,uBAwD0OG,CAxDzZC,WAwDyZD,CAxDxSM,yBAAAA,CAAlEE,gBAwD0WR,CAvDjdM,yBAAAA,CAD2JC,cAAAA,CAwDsTP,EAxD1VM,yBAAAA,CAAwFG,WAAAA,CAwDkQT,EAAAA,EAxDlPG,QAwDkPH,CAAAA;;;;;;;;;;;;;;;cAzC9bY,iBAAiBR,WAAWH,eAAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwC3CU,kBAAkBX,CAAAA,CAAEiB;YAC0anB,kBAA3ZE,CAAAA,CAAEa,QAAQd,YAAiHK,yBAAAA,CAAlEE,iBAK/GF,yBAAAA,CALmKC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA,KAAgBP,CAAAA,CAAEY,YAAYb,YAAiHK,yBAAAA,CAAlEE,iBAAjDF,yBAAAA,CAAqGC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA,MAA8EV,4BAAAA,CAAvBiB,eAAeb;YACxcD,CAAAA,CAAEgB;YACAjB,YAAiHK,yBAAAA,CAAlEE,iBADrCF,yBAAAA,CACyFC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA;;YAEvJR,YAAiHK,yBAAAA,CAAlEE,iBAFpCF,yBAAAA,CAEwFC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA"}
package/dist/index.d.cts CHANGED
@@ -20,7 +20,7 @@ import { writer } from "./writer.cjs";
20
20
  import { isSerializableSchema, isStandardSchema } from "./state/types.cjs";
21
21
  import { ReducedValue, ReducedValueInit } from "./state/values/reduced.cjs";
22
22
  import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.cjs";
23
- import { InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaInit } from "./state/schema.cjs";
23
+ import { InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaFields } from "./state/schema.cjs";
24
24
  import { ConditionalEdgeRouter, ExtractStateType, ExtractUpdateType, GraphNode } from "./graph/types.cjs";
25
25
  import { CompiledStateGraph, StateGraph, StateGraphArgs } from "./graph/state.cjs";
26
26
  import { Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/messages_reducer.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, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, 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, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateGraphInputError, StateSchema, StateSchemaField, StateSchemaInit, 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, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, 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, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateGraphInputError, 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
@@ -20,7 +20,7 @@ import { writer } from "./writer.js";
20
20
  import { isSerializableSchema, isStandardSchema } from "./state/types.js";
21
21
  import { ReducedValue, ReducedValueInit } from "./state/values/reduced.js";
22
22
  import { UntrackedValue, UntrackedValueInit } from "./state/values/untracked.js";
23
- import { InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaInit } from "./state/schema.js";
23
+ import { InferStateSchemaUpdate, InferStateSchemaValue, StateSchema, StateSchemaField, StateSchemaFields } from "./state/schema.js";
24
24
  import { ConditionalEdgeRouter, ExtractStateType, ExtractUpdateType, GraphNode } from "./graph/types.js";
25
25
  import { CompiledStateGraph, StateGraph, StateGraphArgs } from "./graph/state.js";
26
26
  import { Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/messages_reducer.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, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, 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, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateGraphInputError, StateSchema, StateSchemaField, StateSchemaInit, 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, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, 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, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateGraphInputError, 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 };
@@ -3,7 +3,7 @@ import { StateDefinition } from "../graph/annotation.cjs";
3
3
  import { CompiledStateGraph } from "../graph/state.cjs";
4
4
  import { ToolExecutor } from "./tool_executor.cjs";
5
5
  import { Runnable } from "@langchain/core/runnables";
6
- import * as _langchain_core_messages8 from "@langchain/core/messages";
6
+ import * as _langchain_core_messages17 from "@langchain/core/messages";
7
7
  import { BaseMessage } from "@langchain/core/messages";
8
8
  import { AgentAction, AgentFinish } from "@langchain/core/agents";
9
9
  import { Tool } from "@langchain/core/tools";
@@ -31,22 +31,22 @@ declare function createAgentExecutor({
31
31
  agentOutcome?: AgentAction | AgentFinish | undefined;
32
32
  steps: Step[];
33
33
  input: string;
34
- chatHistory?: BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined;
34
+ chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
35
35
  }, {
36
36
  agentOutcome?: AgentAction | AgentFinish | undefined;
37
37
  steps?: Step[] | undefined;
38
38
  input?: string | undefined;
39
- chatHistory?: BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined;
39
+ chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
40
40
  }, "__start__" | "action" | "agent", {
41
41
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
42
42
  steps: BaseChannel<Step[], Step[], unknown>;
43
43
  input: BaseChannel<string, string, unknown>;
44
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined, BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined, unknown> | undefined;
44
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
45
45
  }, {
46
46
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
47
47
  steps: BaseChannel<Step[], Step[], unknown>;
48
48
  input: BaseChannel<string, string, unknown>;
49
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined, BaseMessage<_langchain_core_messages8.MessageStructure<_langchain_core_messages8.MessageToolSet>, _langchain_core_messages8.MessageType>[] | undefined, unknown> | undefined;
49
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
50
50
  }, StateDefinition, {
51
51
  action: Partial<AgentExecutorState>;
52
52
  agent: {
@@ -1 +1 @@
1
- {"version":3,"file":"agent_executor.d.cts","names":["___web_js5","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages8","MessageToolSet","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;EAAW,WAAA,CAAA,EAQnBC,WARmB,EAAA;AAIrC;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,E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CAVhEF,EAAAA,GAAAA,SAAAA,EAU4FZ,WAV5FY,CAU6MD,yBAAAA,CAAlEE,gBAV3ID,CAU5ED,yBAAAA,CAA2QC,cAAAA,CAV/LA,EAU2JD,yBAAAA,CAAwFG,WAAAA,CAVnPF,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;;cAApCD,CAAAA,EAY9DP,WAZ8DO,CAYlDb,WAZ0IgB,GAY5Hf,WAZ4He,GAAAA,SAAAA,EAYnGhB,WAZmGgB,GAYrFf,WAZqFe,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OAAvJd,EAaPI,WAbOJ,CAaKK,IAbLL,EAAAA,EAaaK,IAbbL,EAAAA,EAAAA,OAAAA,CAAAA;OAECF,EAYRM,WAZQN,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAAcC,CAAAA,EAafK,WAbeL,CAaHC,WAbGD,CAa8GY,yBAAAA,CAAlEE,gBAb5Cd,CAYXY,yBAAAA,CAC2GC,cAAAA,CAbhGb,EAa4DY,yBAAAA,CAAwFG,WAAAA,CAbpJf,EAAAA,GAAAA,SAAAA,EAagLC,WAbhLD,CAaiSY,yBAAAA,CAAlEE,gBAb/Nd,CAaQY,yBAAAA,CAA2QC,cAAAA,CAbnRb,EAa+OY,yBAAAA,CAAwFG,WAAAA,CAbvUf,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;GAaJF,eAAAA,EAZjBQ;QAAIM,EAcJK,OAdIL,CAcIL,kBAZiGM,CAAAA;OAAcD,EAAAA;IAAlDA,YAAAA,EAAAA,GAAAA;;UAElDb,EAAAA,OAAAA,CAAAA"}
1
+ {"version":3,"file":"agent_executor.d.cts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages17","MessageToolSet","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;EAAW,WAAA,CAAA,EAQnBC,WARmB,EAAA;AAIrC;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAAcC,EAOdE,QAPcF;OAChBM,EAONE,KAPMF,CAOAH,IAPAG,CAAAA,GAOQF,YAPRE;IA6BER,kBA7BRU,CAAAA;cAEOP,CAAAA,EAOCF,WAPDE,GAOeD,WAPfC,GAAAA,SAAAA;EAAW,KAAA,EAQlBK,IARkB,EAAA;EAGLG,KAAAA,EAAAA,MAAAA;EAAmB,WAAA,CAAA,EAOzBR,WAPyB,CAOwFW,0BAAAA,CAAlEE,gBAPtB,CAK5BF,0BAAAA,CAEsGC,cAAAA,CAP1E,EAOsCD,0BAAAA,CAAwFG,WAAAA,CAP9H,EAAA,GAAA,SAAA;;cAAkBJ,CAAAA,EAS1CZ,WAT0CY,GAS5BX,WAT4BW,GAAAA,SAAAA;OAC1CT,CA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AAA,CAAAA;OAECF,EAYRM,WAZQN,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAAcC,CAAAA,EAafK,WAbeL,CAaHC,WAbGD,CAa8GY,0BAAAA,CAAlEE,gBAb5Cd,CAYXY,0BAAAA,CAC2GC,cAAAA,CAbhGb,EAa4DY,0BAAAA,CAAwFG,WAAAA,CAbpJf,EAAAA,GAAAA,SAAAA,EAagLC,WAbhLD,CAaiSY,0BAAAA,CAAlEE,gBAb/Nd,CAaQY,0BAAAA,CAA2QC,cAAAA,CAbnRb,EAa+OY,0BAAAA,CAAwFG,WAAAA,CAbvUf,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;GAaJF,eAAAA,EAZjBQ;QAAIM,EAcJK,OAdIL,CAcIL,kBAZiGM,CAAAA;OAAcD,EAAAA;IAAlDA,YAAAA,EAAAA,GAAAA;;UAElDb,EAAAA,OAAAA,CAAAA"}
@@ -11,7 +11,7 @@ import { ToolNode } from "./tool_node.cjs";
11
11
  import { All, BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
12
12
  import { InteropZodObject, InteropZodType } from "@langchain/core/utils/types";
13
13
  import { Runnable, RunnableBinding, RunnableLike, RunnableToolLike } from "@langchain/core/runnables";
14
- import * as _langchain_core_messages0 from "@langchain/core/messages";
14
+ import * as _langchain_core_messages35 from "@langchain/core/messages";
15
15
  import { BaseMessage, BaseMessageLike, SystemMessage } from "@langchain/core/messages";
16
16
  import { DynamicTool, StructuredToolInterface } from "@langchain/core/tools";
17
17
  import { LanguageModelLike } from "@langchain/core/language_models/base";
@@ -40,7 +40,7 @@ type StateModifier = Prompt;
40
40
  /** @deprecated Use Prompt instead. */
41
41
  type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;
42
42
  declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{
43
- messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
43
+ messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages35.MessageStructure<_langchain_core_messages35.MessageToolSet>, _langchain_core_messages35.MessageType>[], Messages>;
44
44
  structuredResponse: {
45
45
  (): LastValue<T>;
46
46
  (annotation: SingleReducer<T, T>): BinaryOperatorAggregate<T, T>;
@@ -48,7 +48,7 @@ declare const createReactAgentAnnotation: <T extends Record<string, any> = Recor
48
48
  };
49
49
  }>;
50
50
  declare const PreHookAnnotation: AnnotationRoot<{
51
- llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], Messages>;
51
+ llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages35.MessageStructure<_langchain_core_messages35.MessageToolSet>, _langchain_core_messages35.MessageType>[], Messages>;
52
52
  }>;
53
53
  type PreHookAnnotation = typeof PreHookAnnotation;
54
54
  type AnyAnnotationRoot = AnnotationRoot<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"react_agent_executor.d.cts","names":["_langchain_core_messages0","_langchain_core_language_models_chat_models0","___web_js0","BaseChatModel","LanguageModelLike","BaseMessage","BaseMessageLike","SystemMessage","Runnable","RunnableToolLike","RunnableSequence","RunnableBinding","RunnableLike","DynamicTool","StructuredToolInterface","InteropZodObject","InteropZodType","All","BaseCheckpointSaver","BaseStore","CompiledStateGraph","AnnotationRoot","MessagesAnnotation","ToolNode","LangGraphRunnableConfig","Runtime","Messages","START","InteropZodToStateDefinition","AgentState","Record","StructuredResponseType","N","StructuredResponseSchemaOptions","ServerTool","ClientTool","ConfigurableModelInterface","Promise","_shouldBindTools","_bindTools","_langchain_core_language_models_base0","BaseLanguageModelInput","MessageToolSet","MessageStructure","AIMessageChunk","BaseChatModelCallOptions","_getModel","Prompt","State","StateModifier","MessageModifier","createReactAgentAnnotation","MessageType","BinaryOperatorAggregate","T","LastValue","SingleReducer","StateDefinition","S","PreHookAnnotation","AnyAnnotationRoot","ToAnnotationRoot","A","CreateReactAgentParams","C","createReactAgent","StructuredResponseFormat","spec","ReturnType"],"sources":["../../src/prebuilt/react_agent_executor.d.ts"],"sourcesContent":["import { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { BaseMessage, BaseMessageLike, SystemMessage } from \"@langchain/core/messages\";\nimport { Runnable, RunnableToolLike, RunnableSequence, RunnableBinding, type RunnableLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { All, BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { type CompiledStateGraph, AnnotationRoot } from \"../graph/index.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { ToolNode } from \"./tool_node.js\";\nimport { LangGraphRunnableConfig, Runtime } from \"../pregel/runnable_types.js\";\nimport { Messages } from \"../graph/messages_reducer.js\";\nimport { START } from \"../constants.js\";\nimport type { InteropZodToStateDefinition } from \"../graph/zod/meta.js\";\n/**\n * @deprecated `AgentState` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { AgentState } from \"langchain\";`\n */\nexport interface AgentState<StructuredResponseType extends Record<string, any> = Record<string, any>> {\n messages: BaseMessage[];\n structuredResponse: StructuredResponseType;\n}\nexport type N = typeof START | \"agent\" | \"tools\";\ntype StructuredResponseSchemaOptions<StructuredResponseType> = {\n schema: InteropZodType<StructuredResponseType> | Record<string, any>;\n prompt?: string;\n strict?: boolean;\n [key: string]: unknown;\n};\ntype ServerTool = Record<string, unknown>;\ntype ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;\ninterface ConfigurableModelInterface {\n _queuedMethodOperations: Record<string, any>;\n _model: () => Promise<BaseChatModel>;\n}\nexport declare function _shouldBindTools(llm: LanguageModelLike, tools: (ClientTool | ServerTool)[]): Promise<boolean>;\nexport declare function _bindTools(llm: LanguageModelLike, toolClasses: (ClientTool | ServerTool)[]): Promise<Runnable<import(\"@langchain/core/language_models/base\").BaseLanguageModelInput, import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>>, import(\"@langchain/core/language_models/chat_models\").BaseChatModelCallOptions> | RunnableBinding<any, any, any> | RunnableSequence<any, any>>;\nexport declare function _getModel(llm: LanguageModelLike | ConfigurableModelInterface): Promise<LanguageModelLike>;\nexport type Prompt = SystemMessage | string | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => BaseMessageLike[]) | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => Promise<BaseMessageLike[]>) | Runnable;\n/** @deprecated Use Prompt instead. */\nexport type StateModifier = Prompt;\n/** @deprecated Use Prompt instead. */\nexport type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;\nexport declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n structuredResponse: {\n (): import(\"../web.js\").LastValue<T>;\n (annotation: import(\"../web.js\").SingleReducer<T, T>): import(\"../web.js\").BinaryOperatorAggregate<T, T>;\n Root: <S extends import(\"../web.js\").StateDefinition>(sd: S) => AnnotationRoot<S>;\n };\n}>;\ndeclare const PreHookAnnotation: AnnotationRoot<{\n llmInputMessages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\ntype PreHookAnnotation = typeof PreHookAnnotation;\ntype AnyAnnotationRoot = AnnotationRoot<any>;\ntype ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extends AnyAnnotationRoot ? A : A extends InteropZodObject ? AnnotationRoot<InteropZodToStateDefinition<A>> : never;\n/**\n * @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { CreateAgentParams } from \"langchain\";`\n */\nexport type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, StructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {\n /** The chat model that can utilize OpenAI-style tool calling. */\n llm: LanguageModelLike | ((state: ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], runtime: Runtime<ToAnnotationRoot<C>[\"State\"]>) => Promise<LanguageModelLike> | LanguageModelLike);\n /** A list of tools or a ToolNode. */\n tools: ToolNode | (ServerTool | ClientTool)[];\n /**\n * @deprecated Use prompt instead.\n */\n messageModifier?: MessageModifier;\n /**\n * @deprecated Use prompt instead.\n */\n stateModifier?: StateModifier;\n /**\n * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.\n *\n * Can take a few different forms:\n *\n * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state[\"messages\"].\n * - SystemMessage: this is added to the beginning of the list of messages in state[\"messages\"].\n * - Function: This function should take in full graph state and the output is then passed to the language model.\n * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.\n *\n * Note:\n * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.\n * This is now deprecated and will be removed in a future release.\n */\n prompt?: Prompt;\n /**\n * Additional state schema for the agent.\n */\n stateSchema?: A;\n /**\n * An optional schema for the context.\n */\n contextSchema?: C;\n /** An optional checkpoint saver to persist the agent's state. */\n checkpointSaver?: BaseCheckpointSaver | boolean;\n /** An optional checkpoint saver to persist the agent's state. Alias of \"checkpointSaver\". */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** An optional list of node names to interrupt before running. */\n interruptBefore?: N[] | All;\n /** An optional list of node names to interrupt after running. */\n interruptAfter?: N[] | All;\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * - JSON schema\n * - { prompt, schema }, where schema is one of the above.\n * The prompt will be used together with the model that is being used to generate the structured response.\n *\n * @remarks\n * **Important**: `responseFormat` requires the model to support `.withStructuredOutput()`.\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: InteropZodType<StructuredResponseType> | StructuredResponseSchemaOptions<StructuredResponseType> | Record<string, any>;\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string | undefined;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n \n - undefined: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional node to add before the `agent` node (i.e., the node that calls the LLM).\n * Useful for managing long message histories (e.g., message trimming, summarization, etc.).\n */\n preModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], ToAnnotationRoot<A>[\"Update\"] & PreHookAnnotation[\"Update\"], LangGraphRunnableConfig>;\n /**\n * An optional node to add after the `agent` node (i.e., the node that calls the LLM).\n * Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.\n */\n postModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], LangGraphRunnableConfig>;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v1\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { createAgent } from \"langchain\";`\n *\n * Creates a StateGraph agent that relies on a chat model utilizing tool calling.\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { createReactAgent } from \"@langchain/langgraph/prebuilt\";\n *\n * const model = new ChatOpenAI({\n * model: \"gpt-4o\",\n * });\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * })\n * })\n *\n * const agent = createReactAgent({ llm: model, tools: [getWeather] });\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await agent.stream(inputs, { streamMode: \"values\" });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare function createReactAgent<A extends AnyAnnotationRoot | InteropZodObject = typeof MessagesAnnotation, StructuredResponseFormat extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot>(params: CreateReactAgentParams<A, StructuredResponseFormat, C>): CompiledStateGraph<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], any, typeof MessagesAnnotation.spec & ToAnnotationRoot<A>[\"spec\"], ReturnType<typeof createReactAgentAnnotation<StructuredResponseFormat>>[\"spec\"] & ToAnnotationRoot<A>[\"spec\"]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAkBiB6B,0CAA0CC,sBAAsBA;EAAhED,QAAAA,EACHxB,WADa,EAAA;EAAA,kBAAA,EAEH0B,sBAFG;;AAAsDD,KAIrEE,CAAAA,GAJqEF,OAI1DH,KAJ0DG,GAAAA,OAAAA,GAAAA,OAAAA;KAK5EG,+BAJS5B,CAAAA,sBAAAA,CAAAA,GAAAA;QACU0B,EAIZf,cAJYe,CAIGA,sBAJHA,CAAAA,GAI6BD,MAJ7BC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAsB,MAAA,CAAA,EAAA,MAAA;EAElCC,MAAC,CAAA,EAAA,OAAUL;EAClBM,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;CAA+B;KAM/BC,UAAAA,GAAaJ,MALSC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;KAMtBI,UAAAA,GAAarB,uBANNE,GAMgCH,WANhCG,GAM8CP,gBAN9CO;AAM8CP,KAQ9CsC,MAAAA,GAASxC,aARqCE,GAAAA,MAAAA,GAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAQIa,kBAAAA,CAAmB0B,KARvBvC,EAAAA,MAAAA,EAQsCe,uBARtCf,EAAAA,GAQkEH,eARlEG,EAAAA,CAAAA,GAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAQuGa,kBAAAA,CAAmB0B,KAR1HvC,EAAAA,MAAAA,EAQyIe,uBARzIf,EAAAA,GAQqK4B,OARrK5B,CAQ6KH,eAR7KG,EAAAA,CAAAA,CAAAA,GAQmMD,QARnMC;;AAQ9CsC,KA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,CA3BwChC,CAAAA,CAAAA,QAAAA,CAAAA,EA2B1BN,uBA3B0BM,CAAAA;;;;;;;;;;;;SA2BzD+B,CAAAA,EAAAA,IAAAA,GAAAA,IAAAA;;;;AA2D/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwBI,2BAA2BL,oBAAoB7C,0BAA0BO,qDAAqDQ,sBAAsBA,+BAA+B8B,oBAAoB7C,mBAAmB6C,2BAA2BG,uBAAuBD,GAAGI,0BAA0BF,KAAK5C,mBAAmByC,iBAAiBC,aAAaD,iBAAiBC,0BAA0BxC,kBAAAA,CAAmB6C,OAAON,iBAAiBC,YAAYM,kBAAkBjB,2BAA2Be,qCAAqCL,iBAAiBC"}
1
+ {"version":3,"file":"react_agent_executor.d.cts","names":["_langchain_core_messages35","_langchain_core_language_models_chat_models0","___web_js2","BaseChatModel","LanguageModelLike","BaseMessage","BaseMessageLike","SystemMessage","Runnable","RunnableToolLike","RunnableSequence","RunnableBinding","RunnableLike","DynamicTool","StructuredToolInterface","InteropZodObject","InteropZodType","All","BaseCheckpointSaver","BaseStore","CompiledStateGraph","AnnotationRoot","MessagesAnnotation","ToolNode","LangGraphRunnableConfig","Runtime","Messages","START","InteropZodToStateDefinition","AgentState","Record","StructuredResponseType","N","StructuredResponseSchemaOptions","ServerTool","ClientTool","ConfigurableModelInterface","Promise","_shouldBindTools","_bindTools","_langchain_core_language_models_base0","BaseLanguageModelInput","MessageToolSet","MessageStructure","AIMessageChunk","BaseChatModelCallOptions","_getModel","Prompt","State","StateModifier","MessageModifier","createReactAgentAnnotation","MessageType","BinaryOperatorAggregate","T","LastValue","SingleReducer","StateDefinition","S","PreHookAnnotation","AnyAnnotationRoot","ToAnnotationRoot","A","CreateReactAgentParams","C","createReactAgent","StructuredResponseFormat","spec","ReturnType"],"sources":["../../src/prebuilt/react_agent_executor.d.ts"],"sourcesContent":["import { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { BaseMessage, BaseMessageLike, SystemMessage } from \"@langchain/core/messages\";\nimport { Runnable, RunnableToolLike, RunnableSequence, RunnableBinding, type RunnableLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { All, BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { type CompiledStateGraph, AnnotationRoot } from \"../graph/index.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { ToolNode } from \"./tool_node.js\";\nimport { LangGraphRunnableConfig, Runtime } from \"../pregel/runnable_types.js\";\nimport { Messages } from \"../graph/messages_reducer.js\";\nimport { START } from \"../constants.js\";\nimport type { InteropZodToStateDefinition } from \"../graph/zod/meta.js\";\n/**\n * @deprecated `AgentState` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { AgentState } from \"langchain\";`\n */\nexport interface AgentState<StructuredResponseType extends Record<string, any> = Record<string, any>> {\n messages: BaseMessage[];\n structuredResponse: StructuredResponseType;\n}\nexport type N = typeof START | \"agent\" | \"tools\";\ntype StructuredResponseSchemaOptions<StructuredResponseType> = {\n schema: InteropZodType<StructuredResponseType> | Record<string, any>;\n prompt?: string;\n strict?: boolean;\n [key: string]: unknown;\n};\ntype ServerTool = Record<string, unknown>;\ntype ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;\ninterface ConfigurableModelInterface {\n _queuedMethodOperations: Record<string, any>;\n _model: () => Promise<BaseChatModel>;\n}\nexport declare function _shouldBindTools(llm: LanguageModelLike, tools: (ClientTool | ServerTool)[]): Promise<boolean>;\nexport declare function _bindTools(llm: LanguageModelLike, toolClasses: (ClientTool | ServerTool)[]): Promise<Runnable<import(\"@langchain/core/language_models/base\").BaseLanguageModelInput, import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>>, import(\"@langchain/core/language_models/chat_models\").BaseChatModelCallOptions> | RunnableBinding<any, any, any> | RunnableSequence<any, any>>;\nexport declare function _getModel(llm: LanguageModelLike | ConfigurableModelInterface): Promise<LanguageModelLike>;\nexport type Prompt = SystemMessage | string | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => BaseMessageLike[]) | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => Promise<BaseMessageLike[]>) | Runnable;\n/** @deprecated Use Prompt instead. */\nexport type StateModifier = Prompt;\n/** @deprecated Use Prompt instead. */\nexport type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;\nexport declare const createReactAgentAnnotation: <T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n structuredResponse: {\n (): import(\"../web.js\").LastValue<T>;\n (annotation: import(\"../web.js\").SingleReducer<T, T>): import(\"../web.js\").BinaryOperatorAggregate<T, T>;\n Root: <S extends import(\"../web.js\").StateDefinition>(sd: S) => AnnotationRoot<S>;\n };\n}>;\ndeclare const PreHookAnnotation: AnnotationRoot<{\n llmInputMessages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\ntype PreHookAnnotation = typeof PreHookAnnotation;\ntype AnyAnnotationRoot = AnnotationRoot<any>;\ntype ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extends AnyAnnotationRoot ? A : A extends InteropZodObject ? AnnotationRoot<InteropZodToStateDefinition<A>> : never;\n/**\n * @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { CreateAgentParams } from \"langchain\";`\n */\nexport type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, StructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {\n /** The chat model that can utilize OpenAI-style tool calling. */\n llm: LanguageModelLike | ((state: ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], runtime: Runtime<ToAnnotationRoot<C>[\"State\"]>) => Promise<LanguageModelLike> | LanguageModelLike);\n /** A list of tools or a ToolNode. */\n tools: ToolNode | (ServerTool | ClientTool)[];\n /**\n * @deprecated Use prompt instead.\n */\n messageModifier?: MessageModifier;\n /**\n * @deprecated Use prompt instead.\n */\n stateModifier?: StateModifier;\n /**\n * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.\n *\n * Can take a few different forms:\n *\n * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state[\"messages\"].\n * - SystemMessage: this is added to the beginning of the list of messages in state[\"messages\"].\n * - Function: This function should take in full graph state and the output is then passed to the language model.\n * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.\n *\n * Note:\n * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.\n * This is now deprecated and will be removed in a future release.\n */\n prompt?: Prompt;\n /**\n * Additional state schema for the agent.\n */\n stateSchema?: A;\n /**\n * An optional schema for the context.\n */\n contextSchema?: C;\n /** An optional checkpoint saver to persist the agent's state. */\n checkpointSaver?: BaseCheckpointSaver | boolean;\n /** An optional checkpoint saver to persist the agent's state. Alias of \"checkpointSaver\". */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** An optional list of node names to interrupt before running. */\n interruptBefore?: N[] | All;\n /** An optional list of node names to interrupt after running. */\n interruptAfter?: N[] | All;\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * - JSON schema\n * - { prompt, schema }, where schema is one of the above.\n * The prompt will be used together with the model that is being used to generate the structured response.\n *\n * @remarks\n * **Important**: `responseFormat` requires the model to support `.withStructuredOutput()`.\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: InteropZodType<StructuredResponseType> | StructuredResponseSchemaOptions<StructuredResponseType> | Record<string, any>;\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string | undefined;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n \n - undefined: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional node to add before the `agent` node (i.e., the node that calls the LLM).\n * Useful for managing long message histories (e.g., message trimming, summarization, etc.).\n */\n preModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], ToAnnotationRoot<A>[\"Update\"] & PreHookAnnotation[\"Update\"], LangGraphRunnableConfig>;\n /**\n * An optional node to add after the `agent` node (i.e., the node that calls the LLM).\n * Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.\n */\n postModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], LangGraphRunnableConfig>;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v1\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { createAgent } from \"langchain\";`\n *\n * Creates a StateGraph agent that relies on a chat model utilizing tool calling.\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { createReactAgent } from \"@langchain/langgraph/prebuilt\";\n *\n * const model = new ChatOpenAI({\n * model: \"gpt-4o\",\n * });\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * })\n * })\n *\n * const agent = createReactAgent({ llm: model, tools: [getWeather] });\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await agent.stream(inputs, { streamMode: \"values\" });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare function createReactAgent<A extends AnyAnnotationRoot | InteropZodObject = typeof MessagesAnnotation, StructuredResponseFormat extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot>(params: CreateReactAgentParams<A, StructuredResponseFormat, C>): CompiledStateGraph<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], any, typeof MessagesAnnotation.spec & ToAnnotationRoot<A>[\"spec\"], ReturnType<typeof createReactAgentAnnotation<StructuredResponseFormat>>[\"spec\"] & ToAnnotationRoot<A>[\"spec\"]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAkBiB6B,0CAA0CC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,2BAA2BG,uBAAuBD,GAAGI,0BAA0BF,KAAK5C,mBAAmByC,iBAAiBC,aAAaD,iBAAiBC,0BAA0BxC,kBAAAA,CAAmB6C,OAAON,iBAAiBC,YAAYM,kBAAkBjB,2BAA2Be,qCAAqCL,iBAAiBC"}
@@ -48,9 +48,8 @@ var StateSchema = class {
48
48
  * @internal Used by isInstance for runtime type checking
49
49
  */
50
50
  [STATE_SCHEMA_SYMBOL] = true;
51
- constructor(init) {
52
- this.init = init;
53
- this.init = init;
51
+ constructor(fields) {
52
+ this.fields = fields;
54
53
  }
55
54
  /**
56
55
  * Get the channel definitions for use with StateGraph.
@@ -58,7 +57,7 @@ var StateSchema = class {
58
57
  */
59
58
  getChannels() {
60
59
  const channels = {};
61
- for (const [key, value] of Object.entries(this.init)) if (require_reduced.ReducedValue.isInstance(value)) {
60
+ for (const [key, value] of Object.entries(this.fields)) if (require_reduced.ReducedValue.isInstance(value)) {
62
61
  const defaultGetter = require_adapter.getSchemaDefaultGetter(value.valueSchema);
63
62
  channels[key] = new require_binop.BinaryOperatorAggregate(value.reducer, defaultGetter);
64
63
  } else if (require_untracked.UntrackedValue.isInstance(value)) {
@@ -78,7 +77,7 @@ var StateSchema = class {
78
77
  getJsonSchema() {
79
78
  const properties = {};
80
79
  const required = [];
81
- for (const [key, value] of Object.entries(this.init)) {
80
+ for (const [key, value] of Object.entries(this.fields)) {
82
81
  let fieldSchema;
83
82
  if (require_reduced.ReducedValue.isInstance(value)) {
84
83
  fieldSchema = require_adapter.getJsonSchemaFromSchema(value.valueSchema);
@@ -109,7 +108,7 @@ var StateSchema = class {
109
108
  */
110
109
  getInputJsonSchema() {
111
110
  const properties = {};
112
- for (const [key, value] of Object.entries(this.init)) {
111
+ for (const [key, value] of Object.entries(this.fields)) {
113
112
  let fieldSchema;
114
113
  if (require_reduced.ReducedValue.isInstance(value)) fieldSchema = require_adapter.getJsonSchemaFromSchema(value.inputSchema);
115
114
  else if (require_untracked.UntrackedValue.isInstance(value)) fieldSchema = value.schema ? require_adapter.getJsonSchemaFromSchema(value.schema) : void 0;
@@ -125,13 +124,13 @@ var StateSchema = class {
125
124
  * Get the list of channel keys (excluding managed values).
126
125
  */
127
126
  getChannelKeys() {
128
- return Object.entries(this.init).map(([key]) => key);
127
+ return Object.entries(this.fields).map(([key]) => key);
129
128
  }
130
129
  /**
131
130
  * Get all keys (channels + managed values).
132
131
  */
133
132
  getAllKeys() {
134
- return Object.keys(this.init);
133
+ return Object.keys(this.fields);
135
134
  }
136
135
  /**
137
136
  * Validate input data against the schema.
@@ -144,7 +143,7 @@ var StateSchema = class {
144
143
  if (data == null || typeof data !== "object") return data;
145
144
  const result = {};
146
145
  for (const [key, value] of Object.entries(data)) {
147
- const fieldDef = this.init[key];
146
+ const fieldDef = this.fields[key];
148
147
  if (fieldDef === void 0) {
149
148
  result[key] = value;
150
149
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.cjs","names":["ReducedValue","getSchemaDefaultGetter","BinaryOperatorAggregate","UntrackedValue","UntrackedValueChannel","isStandardSchema","LastValue","getJsonSchemaFromSchema"],"sources":["../../src/state/schema.ts"],"sourcesContent":["import type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport {\n BaseChannel,\n LastValue,\n BinaryOperatorAggregate,\n} from \"../channels/index.js\";\nimport { UntrackedValueChannel } from \"../channels/untracked_value.js\";\n\nimport type { SerializableSchema } from \"./types.js\";\nimport { isStandardSchema } from \"./types.js\";\nimport { getJsonSchemaFromSchema, getSchemaDefaultGetter } from \"./adapter.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\n\nconst STATE_SCHEMA_SYMBOL = Symbol.for(\"langgraph.state.state_schema\");\n\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> = F extends ReducedValue<\n infer V,\n infer I\n>\n ? BaseChannel<V, I>\n : F extends UntrackedValue<infer V>\n ? BaseChannel<V, V>\n : F extends SerializableSchema<infer I, infer O>\n ? BaseChannel<O, I>\n : BaseChannel<unknown, unknown>;\n\n/**\n * Converts a StateSchema \"init\" object (field map) into a strongly-typed\n * State Definition object, where each key is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TInit - The mapping of field names to StateSchema field types.\n * @returns An object type mapping keys to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<TInit extends StateSchemaInit> =\n {\n [K in keyof TInit]: StateSchemaFieldToChannel<TInit[K]>;\n };\n\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> =\n | ReducedValue<Input, Output>\n | UntrackedValue<Output>\n | SerializableSchema<Input, Output>;\n\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaInit = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: StateSchemaField<any, any>;\n};\n\n/**\n * Infer the State type from a StateSchemaInit.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TInit extends StateSchemaInit> = {\n [K in keyof TInit]: TInit[K] extends { ValueType: infer TValue }\n ? TValue\n : TInit[K] extends UntrackedValue<infer TValue>\n ? TValue\n : TInit[K] extends SerializableSchema<unknown, infer TOutput>\n ? TOutput\n : never;\n};\n\n/**\n * Infer the Update type from a StateSchemaInit.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TInit extends StateSchemaInit> = {\n [K in keyof TInit]?: TInit[K] extends { InputType: infer TInput }\n ? TInput\n : TInit[K] extends UntrackedValue<infer TValue>\n ? TValue\n : TInit[K] extends SerializableSchema<infer TInput, unknown>\n ? TInput\n : never;\n};\n\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport class StateSchema<TInit extends StateSchemaInit> {\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n // @ts-expect-error - Symbol is read via `in` operator in isInstance\n private readonly [STATE_SCHEMA_SYMBOL] = true;\n\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n declare State: InferStateSchemaValue<TInit>;\n\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n declare Update: InferStateSchemaUpdate<TInit>;\n\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n declare Node: RunnableLike<\n InferStateSchemaValue<TInit>,\n InferStateSchemaUpdate<TInit>\n >;\n\n constructor(readonly init: TInit) {\n this.init = init;\n }\n\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel> {\n const channels: Record<string, BaseChannel> = {};\n\n for (const [key, value] of Object.entries(this.init)) {\n if (ReducedValue.isInstance(value)) {\n // ReducedValue -> BinaryOperatorAggregate\n const defaultGetter = getSchemaDefaultGetter(value.valueSchema);\n channels[key] = new BinaryOperatorAggregate(\n value.reducer,\n defaultGetter\n );\n } else if (UntrackedValue.isInstance(value)) {\n // UntrackedValue -> UntrackedValueChannel\n const defaultGetter = value.schema\n ? getSchemaDefaultGetter(value.schema)\n : undefined;\n channels[key] = new UntrackedValueChannel({\n guard: value.guard,\n initialValueFactory: defaultGetter,\n });\n } else if (isStandardSchema(value)) {\n // Plain schema -> LastValue channel\n const defaultGetter = getSchemaDefaultGetter(value);\n channels[key] = new LastValue(defaultGetter);\n } else {\n throw new Error(\n `Invalid state field \"${key}\": must be a schema, ReducedValue, UntrackedValue, or ManagedValue`\n );\n }\n }\n\n return channels;\n }\n\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n for (const [key, value] of Object.entries(this.init)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n fieldSchema = getJsonSchemaFromSchema(value.valueSchema) as JSONSchema;\n if (fieldSchema && value.jsonSchemaExtra) {\n fieldSchema = { ...fieldSchema, ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n\n // Field is required if it doesn't have a default\n let hasDefault = false;\n if (ReducedValue.isInstance(value)) {\n hasDefault = getSchemaDefaultGetter(value.valueSchema) !== undefined;\n } else if (UntrackedValue.isInstance(value)) {\n hasDefault = value.schema\n ? getSchemaDefaultGetter(value.schema) !== undefined\n : false;\n } else {\n hasDefault = getSchemaDefaultGetter(value) !== undefined;\n }\n\n if (!hasDefault) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n };\n }\n\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n\n for (const [key, value] of Object.entries(this.init)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n // Use input schema for updates\n fieldSchema = getJsonSchemaFromSchema(value.inputSchema) as JSONSchema;\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n }\n\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[] {\n return Object.entries(this.init).map(([key]) => key);\n }\n\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[] {\n return Object.keys(this.init);\n }\n\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n async validateInput<T>(data: T): Promise<T> {\n if (data == null || typeof data !== \"object\") {\n return data;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const fieldDef = this.init[key];\n\n if (fieldDef === undefined) {\n // Unknown field, pass through\n result[key] = value;\n continue;\n }\n\n // Get the schema to use for validation\n let schema: StandardSchemaV1 | undefined;\n\n if (ReducedValue.isInstance(fieldDef)) {\n schema = fieldDef.inputSchema;\n } else if (UntrackedValue.isInstance(fieldDef)) {\n schema = fieldDef.schema;\n } else if (isStandardSchema(fieldDef)) {\n schema = fieldDef;\n }\n\n if (schema) {\n // Validate using standard schema\n const validationResult = await schema[\"~standard\"].validate(value);\n if (validationResult.issues) {\n throw new Error(\n `Validation failed for field \"${key}\": ${JSON.stringify(\n validationResult.issues\n )}`\n );\n }\n result[key] = validationResult.value;\n } else {\n // No schema or not a standard schema, pass through\n result[key] = value;\n }\n }\n\n return result as T;\n }\n\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TInit extends StateSchemaInit>(\n value: StateSchema<TInit>\n ): value is StateSchema<TInit>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static isInstance(value: unknown): value is StateSchema<any>;\n\n static isInstance<TInit extends StateSchemaInit>(\n value: unknown\n ): value is StateSchema<TInit> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n STATE_SCHEMA_SYMBOL in value &&\n value[STATE_SCHEMA_SYMBOL] === true\n );\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyStateSchema = StateSchema<any>;\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,sBAAsB,OAAO,IAAI,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JtE,IAAa,cAAb,MAAwD;;;;;CAMtD,CAAkB,uBAAuB;CAkCzC,YAAY,AAAS,MAAa;EAAb;AACnB,OAAK,OAAO;;;;;;CAOd,cAA2C;EACzC,MAAM,WAAwC,EAAE;AAEhD,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,KAAK,CAClD,KAAIA,6BAAa,WAAW,MAAM,EAAE;GAElC,MAAM,gBAAgBC,uCAAuB,MAAM,YAAY;AAC/D,YAAS,OAAO,IAAIC,sCAClB,MAAM,SACN,cACD;aACQC,iCAAe,WAAW,MAAM,EAAE;GAE3C,MAAM,gBAAgB,MAAM,SACxBF,uCAAuB,MAAM,OAAO,GACpC;AACJ,YAAS,OAAO,IAAIG,8CAAsB;IACxC,OAAO,MAAM;IACb,qBAAqB;IACtB,CAAC;aACOC,+BAAiB,MAAM,CAGhC,UAAS,OAAO,IAAIC,6BADEL,uCAAuB,MAAM,CACP;MAE5C,OAAM,IAAI,MACR,wBAAwB,IAAI,oEAC7B;AAIL,SAAO;;;;;;CAOT,gBAA4B;EAC1B,MAAM,aAAyC,EAAE;EACjD,MAAM,WAAqB,EAAE;AAE7B,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,KAAK,EAAE;GACpD,IAAI;AAEJ,OAAID,6BAAa,WAAW,MAAM,EAAE;AAClC,kBAAcO,wCAAwB,MAAM,YAAY;AACxD,QAAI,eAAe,MAAM,gB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AK,EAAE;GAC/C,MAAM,WAAW,KAAK,KAAK;AAE3B,OAAI,aAAa,QAAW;AAE1B,WAAO,OAAO;AACd;;GAIF,IAAI;AAEJ,OAAIP,6BAAa,WAAW,SAAS,CACnC,UAAS,SAAS;YACTG,iCAAe,WAAW,SAAS,CAC5C,UAAS,SAAS;YACTE,+BAAiB,SAAS,CACnC,UAAS;AAGX,OAAI,QAAQ;IAEV,MAAM,mBAAmB,MAAM,OAAO,aAAa,SAAS,MAAM;AAClE,QAAI,iBAAiB,OACnB,OAAM,IAAI,MACR,gCAAgC,IAAI,KAAK,KAAK,UAC5C,iBAAiB,OAClB,GACF;AAEH,WAAO,OAAO,iBAAiB;SAG/B,QAAO,OAAO;;AAIlB,SAAO;;CAgBT,OAAO,WACL,OAC6B;AAC7B,SACE,OAAO,UAAU,YACjB,UAAU,QACV,uBAAuB,SACvB,MAAM,yBAAyB"}
1
+ {"version":3,"file":"schema.cjs","names":["ReducedValue","getSchemaDefaultGetter","BinaryOperatorAggregate","UntrackedValue","UntrackedValueChannel","isStandardSchema","LastValue","getJsonSchemaFromSchema"],"sources":["../../src/state/schema.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport {\n BaseChannel,\n LastValue,\n BinaryOperatorAggregate,\n} from \"../channels/index.js\";\nimport { UntrackedValueChannel } from \"../channels/untracked_value.js\";\n\nimport type { SerializableSchema } from \"./types.js\";\nimport { isStandardSchema } from \"./types.js\";\nimport { getJsonSchemaFromSchema, getSchemaDefaultGetter } from \"./adapter.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\n\nconst STATE_SCHEMA_SYMBOL = Symbol.for(\"langgraph.state.state_schema\");\n\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> = F extends ReducedValue<\n infer V,\n infer I\n>\n ? BaseChannel<V, I>\n : F extends UntrackedValue<infer V>\n ? BaseChannel<V, V>\n : F extends SerializableSchema<infer I, infer O>\n ? BaseChannel<O, I>\n : BaseChannel<unknown, unknown>;\n\n/**\n * Converts StateSchema fields into a strongly-typed\n * State Definition object, where each field is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TFields - The mapping of field names to StateSchema field types.\n * @returns An object type mapping field names to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<\n TFields extends StateSchemaFields\n> = {\n [K in keyof TFields]: StateSchemaFieldToChannel<TFields[K]>;\n};\n\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> =\n | ReducedValue<Input, Output>\n | UntrackedValue<Output>\n | SerializableSchema<Input, Output>;\n\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaFields = {\n [key: string]: StateSchemaField<any, any>;\n};\n\n/**\n * Infer the State type from a StateSchemaFields.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: TFields[K] extends ReducedValue<any, any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<any, infer TOutput>\n ? TOutput\n : never;\n};\n\n/**\n * Infer the Update type from a StateSchemaFields.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TFields extends StateSchemaFields> = {\n [K in keyof TFields]?: TFields[K] extends ReducedValue<any, any>\n ? TFields[K][\"InputType\"]\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<infer TInput, any>\n ? TInput\n : never;\n};\n\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport class StateSchema<TFields extends StateSchemaFields> {\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n // @ts-expect-error - Symbol is read via `in` operator in isInstance\n private readonly [STATE_SCHEMA_SYMBOL] = true;\n\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n declare State: InferStateSchemaValue<TFields>;\n\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n declare Update: InferStateSchemaUpdate<TFields>;\n\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n declare Node: RunnableLike<\n InferStateSchemaValue<TFields>,\n InferStateSchemaUpdate<TFields>\n >;\n\n constructor(readonly fields: TFields) {}\n\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel> {\n const channels: Record<string, BaseChannel> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n if (ReducedValue.isInstance(value)) {\n // ReducedValue -> BinaryOperatorAggregate\n const defaultGetter = getSchemaDefaultGetter(value.valueSchema);\n channels[key] = new BinaryOperatorAggregate(\n value.reducer,\n defaultGetter\n );\n } else if (UntrackedValue.isInstance(value)) {\n // UntrackedValue -> UntrackedValueChannel\n const defaultGetter = value.schema\n ? getSchemaDefaultGetter(value.schema)\n : undefined;\n channels[key] = new UntrackedValueChannel({\n guard: value.guard,\n initialValueFactory: defaultGetter,\n });\n } else if (isStandardSchema(value)) {\n // Plain schema -> LastValue channel\n const defaultGetter = getSchemaDefaultGetter(value);\n channels[key] = new LastValue(defaultGetter);\n } else {\n throw new Error(\n `Invalid state field \"${key}\": must be a schema, ReducedValue, UntrackedValue, or ManagedValue`\n );\n }\n }\n\n return channels;\n }\n\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n fieldSchema = getJsonSchemaFromSchema(value.valueSchema) as JSONSchema;\n if (fieldSchema && value.jsonSchemaExtra) {\n fieldSchema = { ...fieldSchema, ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n\n // Field is required if it doesn't have a default\n let hasDefault = false;\n if (ReducedValue.isInstance(value)) {\n hasDefault = getSchemaDefaultGetter(value.valueSchema) !== undefined;\n } else if (UntrackedValue.isInstance(value)) {\n hasDefault = value.schema\n ? getSchemaDefaultGetter(value.schema) !== undefined\n : false;\n } else {\n hasDefault = getSchemaDefaultGetter(value) !== undefined;\n }\n\n if (!hasDefault) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n };\n }\n\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n // Use input schema for updates\n fieldSchema = getJsonSchemaFromSchema(value.inputSchema) as JSONSchema;\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n }\n\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[] {\n return Object.entries(this.fields).map(([key]) => key);\n }\n\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[] {\n return Object.keys(this.fields);\n }\n\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n async validateInput<T>(data: T): Promise<T> {\n if (data == null || typeof data !== \"object\") {\n return data;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const fieldDef = this.fields[key];\n\n if (fieldDef === undefined) {\n // Unknown field, pass through\n result[key] = value;\n continue;\n }\n\n // Get the schema to use for validation\n let schema: StandardSchemaV1 | undefined;\n\n if (ReducedValue.isInstance(fieldDef)) {\n schema = fieldDef.inputSchema;\n } else if (UntrackedValue.isInstance(fieldDef)) {\n schema = fieldDef.schema;\n } else if (isStandardSchema(fieldDef)) {\n schema = fieldDef;\n }\n\n if (schema) {\n // Validate using standard schema\n const validationResult = await schema[\"~standard\"].validate(value);\n if (validationResult.issues) {\n throw new Error(\n `Validation failed for field \"${key}\": ${JSON.stringify(\n validationResult.issues\n )}`\n );\n }\n result[key] = validationResult.value;\n } else {\n // No schema or not a standard schema, pass through\n result[key] = value;\n }\n }\n\n return result as T;\n }\n\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TFields extends StateSchemaFields>(\n value: StateSchema<TFields>\n ): value is StateSchema<TFields>;\n\n static isInstance(value: unknown): value is StateSchema<any>;\n\n static isInstance<TFields extends StateSchemaFields>(\n value: unknown\n ): value is StateSchema<TFields> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n STATE_SCHEMA_SYMBOL in value &&\n value[STATE_SCHEMA_SYMBOL] === true\n );\n }\n}\n\nexport type AnyStateSchema = StateSchema<any>;\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,sBAAsB,OAAO,IAAI,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JtE,IAAa,cAAb,MAA4D;;;;;CAM1D,CAAkB,uBAAuB;CAkCzC,YAAY,AAAS,QAAiB;EAAjB;;;;;;CAMrB,cAA2C;EACzC,MAAM,WAAwC,EAAE;AAEhD,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,OAAO,CACpD,KAAIA,6BAAa,WAAW,MAAM,EAAE;GAElC,MAAM,gBAAgBC,uCAAuB,MAAM,YAAY;AAC/D,YAAS,OAAO,IAAIC,sCAClB,MAAM,SACN,cACD;aACQC,iCAAe,WAAW,MAAM,EAAE;GAE3C,MAAM,gBAAgB,MAAM,SACxBF,uCAAuB,MAAM,OAAO,GACpC;AACJ,YAAS,OAAO,IAAIG,8CAAsB;IACxC,OAAO,MAAM;IACb,qBAAqB;IACtB,CAAC;aACOC,+BAAiB,MAAM,CAGhC,UAAS,OAAO,IAAIC,6BADEL,uCAAuB,MAAM,CACP;MAE5C,OAAM,IAAI,MACR,wBAAwB,IAAI,oEAC7B;AAIL,SAAO;;;;;;CAOT,gBAA4B;EAC1B,MAAM,aAAyC,EAAE;EACjD,MAAM,WAAqB,EAAE;AAE7B,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,OAAO,EAAE;GACtD,IAAI;AAEJ,OAAID,6BAAa,WAAW,MAAM,EAAE;AAClC,kBAAcO,wCAAwB,MAAM,YAAY;AACxD,QAAI,eAAe,MAAM,gBACvB,eAAc;KAAE,GAAG;KAAa,GAAG,MAAM;KAAiB;cAE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