@langchain/langgraph 1.1.3 → 1.1.5

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 (179) hide show
  1. package/dist/channels/any_value.d.cts +0 -1
  2. package/dist/channels/any_value.d.cts.map +1 -1
  3. package/dist/channels/any_value.d.ts +0 -1
  4. package/dist/channels/any_value.d.ts.map +1 -1
  5. package/dist/channels/base.d.cts.map +1 -1
  6. package/dist/channels/base.d.ts.map +1 -1
  7. package/dist/channels/binop.d.cts.map +1 -1
  8. package/dist/channels/binop.d.ts.map +1 -1
  9. package/dist/channels/dynamic_barrier_value.d.cts +0 -10
  10. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
  11. package/dist/channels/dynamic_barrier_value.d.ts +0 -10
  12. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
  13. package/dist/channels/ephemeral_value.d.cts +0 -1
  14. package/dist/channels/ephemeral_value.d.cts.map +1 -1
  15. package/dist/channels/ephemeral_value.d.ts +0 -1
  16. package/dist/channels/ephemeral_value.d.ts.map +1 -1
  17. package/dist/channels/last_value.d.cts +0 -1
  18. package/dist/channels/last_value.d.cts.map +1 -1
  19. package/dist/channels/last_value.d.ts +0 -1
  20. package/dist/channels/last_value.d.ts.map +1 -1
  21. package/dist/channels/named_barrier_value.d.cts +0 -1
  22. package/dist/channels/named_barrier_value.d.cts.map +1 -1
  23. package/dist/channels/named_barrier_value.d.ts +0 -1
  24. package/dist/channels/named_barrier_value.d.ts.map +1 -1
  25. package/dist/channels/topic.d.cts +0 -1
  26. package/dist/channels/topic.d.cts.map +1 -1
  27. package/dist/channels/topic.d.ts +0 -1
  28. package/dist/channels/topic.d.ts.map +1 -1
  29. package/dist/channels/untracked_value.d.cts +0 -1
  30. package/dist/channels/untracked_value.d.cts.map +1 -1
  31. package/dist/channels/untracked_value.d.ts +0 -1
  32. package/dist/channels/untracked_value.d.ts.map +1 -1
  33. package/dist/constants.d.cts +0 -15
  34. package/dist/constants.d.cts.map +1 -1
  35. package/dist/constants.d.ts +0 -15
  36. package/dist/constants.d.ts.map +1 -1
  37. package/dist/errors.d.cts.map +1 -1
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/func/index.d.cts +0 -1
  40. package/dist/func/index.d.cts.map +1 -1
  41. package/dist/func/index.d.ts +0 -1
  42. package/dist/func/index.d.ts.map +1 -1
  43. package/dist/func/types.d.cts +0 -11
  44. package/dist/func/types.d.cts.map +1 -1
  45. package/dist/func/types.d.ts +0 -11
  46. package/dist/func/types.d.ts.map +1 -1
  47. package/dist/graph/annotation.d.cts.map +1 -1
  48. package/dist/graph/annotation.d.ts.map +1 -1
  49. package/dist/graph/graph.d.cts.map +1 -1
  50. package/dist/graph/graph.d.ts.map +1 -1
  51. package/dist/graph/index.d.ts +7 -0
  52. package/dist/graph/message.d.cts.map +1 -1
  53. package/dist/graph/message.d.ts +2 -2
  54. package/dist/graph/message.d.ts.map +1 -1
  55. package/dist/graph/messages_annotation.d.cts +5 -6
  56. package/dist/graph/messages_annotation.d.cts.map +1 -1
  57. package/dist/graph/messages_annotation.d.ts +1 -1
  58. package/dist/graph/messages_annotation.d.ts.map +1 -1
  59. package/dist/graph/messages_reducer.d.cts +0 -1
  60. package/dist/graph/messages_reducer.d.cts.map +1 -1
  61. package/dist/graph/messages_reducer.d.ts +0 -1
  62. package/dist/graph/messages_reducer.d.ts.map +1 -1
  63. package/dist/graph/state.cjs +59 -0
  64. package/dist/graph/state.cjs.map +1 -1
  65. package/dist/graph/state.d.cts +59 -0
  66. package/dist/graph/state.d.cts.map +1 -1
  67. package/dist/graph/state.d.ts +59 -0
  68. package/dist/graph/state.d.ts.map +1 -1
  69. package/dist/graph/state.js +59 -0
  70. package/dist/graph/state.js.map +1 -1
  71. package/dist/graph/types.d.cts +2 -18
  72. package/dist/graph/types.d.cts.map +1 -1
  73. package/dist/graph/types.d.ts +2 -18
  74. package/dist/graph/types.d.ts.map +1 -1
  75. package/dist/graph/zod/index.d.cts +1 -0
  76. package/dist/graph/zod/index.d.ts +1 -0
  77. package/dist/graph/zod/meta.d.cts.map +1 -1
  78. package/dist/graph/zod/meta.d.ts.map +1 -1
  79. package/dist/graph/zod/plugin.d.cts +30 -0
  80. package/dist/graph/zod/plugin.d.cts.map +1 -0
  81. package/dist/graph/zod/plugin.d.ts +30 -0
  82. package/dist/graph/zod/plugin.d.ts.map +1 -0
  83. package/dist/graph/zod/schema.d.cts +0 -1
  84. package/dist/graph/zod/schema.d.cts.map +1 -1
  85. package/dist/graph/zod/schema.d.ts +0 -1
  86. package/dist/graph/zod/schema.d.ts.map +1 -1
  87. package/dist/graph/zod/zod-registry.d.cts +0 -1
  88. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  89. package/dist/graph/zod/zod-registry.d.ts +0 -1
  90. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  91. package/dist/interrupt.d.cts.map +1 -1
  92. package/dist/interrupt.d.ts.map +1 -1
  93. package/dist/prebuilt/agentName.d.cts +0 -17
  94. package/dist/prebuilt/agentName.d.cts.map +1 -1
  95. package/dist/prebuilt/agentName.d.ts +0 -17
  96. package/dist/prebuilt/agentName.d.ts.map +1 -1
  97. package/dist/prebuilt/agent_executor.d.cts +5 -5
  98. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  99. package/dist/prebuilt/agent_executor.d.ts +6 -5
  100. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  101. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  102. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  103. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  104. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  105. package/dist/prebuilt/react_agent_executor.d.cts +8 -14
  106. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  107. package/dist/prebuilt/react_agent_executor.d.ts +10 -14
  108. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  109. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  110. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  111. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  112. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  113. package/dist/pregel/algo.d.cts +0 -1
  114. package/dist/pregel/algo.d.cts.map +1 -1
  115. package/dist/pregel/algo.d.ts +5 -1
  116. package/dist/pregel/algo.d.ts.map +1 -1
  117. package/dist/pregel/index.d.cts.map +1 -1
  118. package/dist/pregel/index.d.ts.map +1 -1
  119. package/dist/pregel/read.d.cts +0 -1
  120. package/dist/pregel/read.d.cts.map +1 -1
  121. package/dist/pregel/read.d.ts +1 -1
  122. package/dist/pregel/read.d.ts.map +1 -1
  123. package/dist/pregel/remote.cjs +1 -1
  124. package/dist/pregel/remote.cjs.map +1 -1
  125. package/dist/pregel/remote.d.cts.map +1 -1
  126. package/dist/pregel/remote.d.ts +2 -0
  127. package/dist/pregel/remote.d.ts.map +1 -1
  128. package/dist/pregel/remote.js +2 -2
  129. package/dist/pregel/remote.js.map +1 -1
  130. package/dist/pregel/runnable_types.d.cts.map +1 -1
  131. package/dist/pregel/runnable_types.d.ts.map +1 -1
  132. package/dist/pregel/stream.d.ts +2 -0
  133. package/dist/pregel/types.d.cts +0 -7
  134. package/dist/pregel/types.d.cts.map +1 -1
  135. package/dist/pregel/types.d.ts +0 -7
  136. package/dist/pregel/types.d.ts.map +1 -1
  137. package/dist/pregel/utils/config.d.cts +0 -1
  138. package/dist/pregel/utils/config.d.cts.map +1 -1
  139. package/dist/pregel/utils/config.d.ts +0 -1
  140. package/dist/pregel/utils/config.d.ts.map +1 -1
  141. package/dist/pregel/utils/index.d.cts +3 -7
  142. package/dist/pregel/utils/index.d.cts.map +1 -1
  143. package/dist/pregel/utils/index.d.ts +3 -7
  144. package/dist/pregel/utils/index.d.ts.map +1 -1
  145. package/dist/pregel/write.d.cts +0 -1
  146. package/dist/pregel/write.d.cts.map +1 -1
  147. package/dist/pregel/write.d.ts +0 -1
  148. package/dist/pregel/write.d.ts.map +1 -1
  149. package/dist/state/adapter.d.cts +0 -1
  150. package/dist/state/adapter.d.cts.map +1 -1
  151. package/dist/state/adapter.d.ts +0 -1
  152. package/dist/state/adapter.d.ts.map +1 -1
  153. package/dist/state/index.d.ts +7 -0
  154. package/dist/state/prebuilt/index.d.ts +1 -0
  155. package/dist/state/prebuilt/messages.d.cts +2 -2
  156. package/dist/state/prebuilt/messages.d.cts.map +1 -1
  157. package/dist/state/prebuilt/messages.d.ts +2 -2
  158. package/dist/state/prebuilt/messages.d.ts.map +1 -1
  159. package/dist/state/schema.d.cts.map +1 -1
  160. package/dist/state/schema.d.ts +1 -0
  161. package/dist/state/schema.d.ts.map +1 -1
  162. package/dist/state/types.d.cts +0 -20
  163. package/dist/state/types.d.cts.map +1 -1
  164. package/dist/state/types.d.ts +0 -20
  165. package/dist/state/types.d.ts.map +1 -1
  166. package/dist/state/values/reduced.d.cts +0 -1
  167. package/dist/state/values/reduced.d.cts.map +1 -1
  168. package/dist/state/values/reduced.d.ts +0 -1
  169. package/dist/state/values/reduced.d.ts.map +1 -1
  170. package/dist/state/values/untracked.d.cts +0 -1
  171. package/dist/state/values/untracked.d.cts.map +1 -1
  172. package/dist/state/values/untracked.d.ts +0 -1
  173. package/dist/state/values/untracked.d.ts.map +1 -1
  174. package/dist/utils.d.cts.map +1 -1
  175. package/dist/utils.d.ts.map +1 -1
  176. package/dist/web.d.ts +3 -0
  177. package/dist/writer.d.cts.map +1 -1
  178. package/dist/writer.d.ts.map +1 -1
  179. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":["InteropZodObject","StandardSchemaV1","LangGraphRunnableConfig","CommandInstance","Send","END","AnnotationRoot","StateDefinition","StateType","UpdateType","AnnotationUpdateType","AnyStateSchema","StateSchema","StateSchemaFieldsToStateDefinition","InteropZodToStateDefinition","ToStateDefinition","T","TInit","SD","StateDefinitionInit","isStateDefinitionInit","ContextSchemaInit","StateGraphInit","I","O","C","InterruptType","WriterType","N","StateGraphOptions","Omit","isStateGraphInit","ExtractStateType","Schema","S","Fallback","ExtractUpdateType","U","FallbackBase","Partial","ExtractBagInput","Bag","Default","ExtractBagOutput","ExtractBagContext","Record","Ctx","ExtractBagNodes","GraphNodeTypes","InputSchema","OutputSchema","ContextSchema","Nodes","IsGraphNodeTypeBag","GraphNodeReturnValue","Update","Promise","GraphNode","Context","ConditionalEdgeRouterTypes","IsConditionalEdgeRouterTypeBag","ConditionalEdgeRouterReturnValue","State","Array","ConditionalEdgeRouter"],"sources":["../../src/graph/types.d.ts"],"sourcesContent":["import { type InteropZodObject } from \"@langchain/core/utils/types\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { LangGraphRunnableConfig } from \"../pregel/runnable_types.js\";\nimport type { CommandInstance, Send } from \"../constants.js\";\nimport { END } from \"../constants.js\";\nimport type { AnnotationRoot, StateDefinition, StateType, UpdateType as AnnotationUpdateType } from \"./annotation.js\";\nimport { AnyStateSchema, StateSchema, StateSchemaFieldsToStateDefinition } from \"../state/schema.js\";\nimport type { InteropZodToStateDefinition } from \"./zod/meta.js\";\nexport { END };\n/**\n * Convert any supported schema type to a StateDefinition.\n *\n * @internal\n */\nexport type ToStateDefinition<T> = T extends StateSchema<infer TInit> ? StateSchemaFieldsToStateDefinition<TInit> : T extends AnnotationRoot<infer SD> ? SD : T extends InteropZodObject ? InteropZodToStateDefinition<T> : T extends StateDefinition ? T : never;\n/**\n * Type for schema types that can be used to initialize state.\n * Supports all valid schema types: StateDefinition, Zod objects, StateSchema, and AnnotationRoot.\n *\n * @internal\n */\nexport type StateDefinitionInit = StateDefinition | InteropZodObject | AnyStateSchema | AnnotationRoot<any>;\n/**\n * Check if a value is a valid StateDefinitionInit type.\n * Supports: StateSchema, InteropZodObject (Zod), AnnotationRoot, StateDefinition\n *\n * @internal\n */\nexport declare function isStateDefinitionInit(value: unknown): value is StateDefinitionInit;\n/**\n * Valid types for context schema.\n * Context doesn't have channels/reducers, so StateSchema is NOT supported.\n * Supports StandardSchemaV1 (Zod, Valibot, etc.) and AnnotationRoot (backward compat).\n *\n * @internal\n */\nexport type ContextSchemaInit = StandardSchemaV1 | AnnotationRoot<StateDefinition>;\n/**\n * Initialization options for StateGraph.\n * Accepts any combination of schema types for state/input/output.\n *\n * Supports both `state` and `stateSchema` as aliases for backward compatibility.\n * If only `input` is provided (no state/stateSchema), `input` is used as the state schema.\n *\n * @template SD - State definition type\n * @template I - Input definition type (defaults to undefined)\n * @template O - Output definition type (defaults to undefined)\n * @template C - Context schema type (defaults to undefined)\n * @template N - Node name union type (defaults to string)\n * @template InterruptType - Interrupt type (defaults to unknown)\n * @template WriterType - Writer type (defaults to unknown)\n */\nexport type StateGraphInit<SD extends StateDefinitionInit = StateDefinitionInit, I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = {\n /** Primary key for state schema */\n state?: SD;\n /**\n * @deprecated Use `state` instead. Will be removed in a future version.\n */\n stateSchema?: SD;\n input?: I;\n output?: O;\n /** Context schema for runtime configuration validation. Does not support StateSchema. */\n context?: C;\n interrupt?: InterruptType;\n writer?: WriterType;\n nodes?: N[];\n};\n/**\n * Options for the second argument when passing a direct schema.\n * Excludes `state` and `stateSchema` since those come from the first arg.\n *\n * @internal\n */\nexport type StateGraphOptions<I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = Omit<StateGraphInit<StateDefinitionInit, I, O, C, N, InterruptType, WriterType>, \"state\" | \"stateSchema\">;\n/**\n * Check if a value is a StateGraphInit object (has state, stateSchema, or input with valid schema).\n *\n * @internal\n */\nexport declare function isStateGraphInit(value: unknown): value is StateGraphInit<StateDefinitionInit>;\n/**\n * Extract the State type from any supported schema type.\n *\n * Supports:\n * - StateSchema\n * - AnnotationRoot\n * - StateDefinition (internal channel definitions)\n * - InteropZodObject (Zod v3/v4 object schemas)\n *\n * @template Schema - The schema type to extract state from\n * @template Fallback - Type to return if schema doesn't match (default: never)\n */\nexport type ExtractStateType<Schema, Fallback = Schema> = Schema extends AnnotationRoot<infer SD> ? StateType<SD> : StateType<ToStateDefinition<Schema>> extends infer S ? [S] extends [never] ? Fallback : S : Fallback;\n/**\n * Extract the Update type from any supported schema type.\n *\n * The Update type represents what a node can return to update the state.\n * All fields are optional since nodes only need to return the fields they modify.\n *\n * Supports:\n * - StateSchema\n * - AnnotationRoot\n * - StateDefinition (internal channel definitions)\n * - InteropZodObject (Zod v3/v4 object schemas)\n *\n * @template Schema - The schema type to extract update type from\n * @template FallbackBase - Base type for fallback (will be partialized), defaults to Schema\n */\nexport type ExtractUpdateType<Schema, FallbackBase = Schema> = Schema extends AnnotationRoot<infer SD> ? AnnotationUpdateType<SD> : AnnotationUpdateType<ToStateDefinition<Schema>> extends infer U ? [U] extends [never] ? Partial<FallbackBase> : U : Partial<FallbackBase>;\n/**\n * Extract the input type from a type bag, using ExtractStateType on the InputSchema.\n * Falls back to Default if InputSchema is not provided.\n * @internal\n */\ntype ExtractBagInput<Bag, Default> = Bag extends {\n InputSchema: infer I;\n} ? ExtractStateType<I> : Default;\n/**\n * Extract the output type from a type bag, using ExtractUpdateType on the OutputSchema.\n * Falls back to Default if OutputSchema is not provided.\n * @internal\n */\ntype ExtractBagOutput<Bag, Default> = Bag extends {\n OutputSchema: infer O;\n} ? ExtractUpdateType<O> : Default;\n/**\n * Extract the context type from a type bag, using ExtractStateType on the ContextSchema.\n * Falls back to Default if ContextSchema is not provided.\n * Ensures result extends Record<string, unknown> for LangGraphRunnableConfig compatibility.\n * @internal\n */\ntype ExtractBagContext<Bag, Default extends Record<string, unknown>> = Bag extends {\n ContextSchema: infer C;\n} ? ExtractStateType<C> extends infer Ctx ? Ctx extends Record<string, unknown> ? Ctx : Default : Default : Default;\n/**\n * Extract the Nodes type from a type bag.\n * Falls back to Default if Nodes is not provided.\n * @internal\n */\ntype ExtractBagNodes<Bag, Default extends string> = Bag extends {\n Nodes: infer N extends string;\n} ? N : Default;\n/**\n * Type bag for GraphNode that accepts schema types.\n * All fields are optional - unspecified fields use defaults.\n *\n * This enables separate input/output schemas for nodes, which is useful when\n * a node receives a subset of state fields and returns different fields.\n *\n * @example\n * ```typescript\n * const node: GraphNode<{\n * InputSchema: typeof NodeInputSchema;\n * OutputSchema: typeof NodeOutputSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, runtime) => {\n * return { answer: `Response to: ${state.query}` };\n * };\n * ```\n */\nexport interface GraphNodeTypes<InputSchema = unknown, OutputSchema = unknown, ContextSchema = unknown, Nodes extends string = string> {\n /** Schema for node input state (uses ExtractStateType) */\n InputSchema?: InputSchema;\n /** Schema for node output/update (uses ExtractUpdateType) */\n OutputSchema?: OutputSchema;\n /** Schema for runtime context (uses ExtractStateType) */\n ContextSchema?: ContextSchema;\n /** Union of valid node names for Command.goto */\n Nodes?: Nodes;\n}\n/**\n * Detect if T is a type bag (has InputSchema or OutputSchema) or a direct schema.\n * @internal\n */\ntype IsGraphNodeTypeBag<T> = T extends {\n InputSchema: unknown;\n} ? true : T extends {\n OutputSchema: unknown;\n} ? true : false;\n/**\n * Return value type for GraphNode functions.\n * Nodes can return an update object, a Command, or a Promise of either.\n *\n * @template Update - The update type (what fields can be returned)\n * @template Nodes - Union of valid node names for Command.goto\n */\nexport type GraphNodeReturnValue<Update, Nodes extends string = string> = Update | CommandInstance<unknown, Update, Nodes> | Promise<Update | CommandInstance<unknown, Update, Nodes>>;\n/**\n * Strongly-typed utility for authoring graph nodes outside of the StateGraph builder,\n * supporting inference for both state (from Schema) and config context (from Context type).\n *\n * This type enables you to define graph node functions with full type safety—both\n * for the evolving state and for additional context that may be passed in at runtime.\n * Typing the context parameter allows for better code organization and precise editor support.\n *\n * Works with StateSchema, AnnotationRoot, and Zod object schemas for state, and\n * with a user-defined object shape for context.\n *\n * **Supports two patterns:**\n *\n * 1. **Single schema usage** - Single schema for both input and output:\n * `GraphNode<Schema, Context, Nodes>`\n *\n * 2. **Type bag pattern** - Separate schemas for input, output, context:\n * `GraphNode<{ InputSchema; OutputSchema; ContextSchema; Nodes }>`\n *\n * @template Schema - The state schema type (StateSchema, AnnotationRoot, InteropZodObject) OR a type bag\n * @template Context - The type of the context passed into this node (default: Record<string, unknown>)\n * @template Nodes - An optional union of valid node names for Command.goto, used for type-safe routing (default: string)\n *\n * @example Single schema usage\n * ```typescript\n * import { StateSchema, GraphNode } from \"@langchain/langgraph\";\n * import { z } from \"zod/v4\";\n *\n * const AgentState = new StateSchema({\n * messages: MessagesValue,\n * step: z.number().default(0),\n * });\n *\n * // Context shape for custom node logic (optional)\n * type MyContext = { userId: string };\n *\n * // Node receiving state and config\n * const processNode: GraphNode<typeof AgentState, MyContext> = (state, config) => {\n * const userId = config.configurable?.userId; // type-safe context access\n * return { step: state.step + 1 };\n * };\n *\n * // Node with type-safe graph routing\n * const routerNode: GraphNode<typeof AgentState, MyContext, \"agent\" | \"tool\"> = (state, config) => {\n * if (state.needsTool) {\n * return new Command({ goto: \"tool\", update: { step: state.step + 1 } });\n * }\n * return new Command({ goto: \"agent\" });\n * };\n *\n * // Use in graph\n * const graph = new StateGraph(AgentState)\n * .addNode(\"process\", processNode)\n * .addNode(\"router\", routerNode)\n * .compile();\n * ```\n *\n * @example Type bag pattern - separate input/output schemas\n * ```typescript\n * const InputSchema = new StateSchema({\n * messages: z.array(z.string()),\n * query: z.string(),\n * });\n *\n * const OutputSchema = new StateSchema({\n * answer: z.string(),\n * });\n *\n * const ContextSchema = z.object({ userId: z.string() });\n *\n * const node: GraphNode<{\n * InputSchema: typeof InputSchema;\n * OutputSchema: typeof OutputSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * // state is { messages: string[]; query: string }\n * // config.configurable is { userId: string } | undefined\n * return { answer: `Response to: ${state.query}` };\n * };\n * ```\n */\nexport type GraphNode<Schema, Context extends Record<string, any> = Record<string, any>, Nodes extends string = string> = IsGraphNodeTypeBag<Schema> extends true ? (state: ExtractBagInput<Schema, unknown>, config: LangGraphRunnableConfig<ExtractBagContext<Schema, Record<string, unknown>>>) => GraphNodeReturnValue<ExtractBagOutput<Schema, Partial<ExtractBagInput<Schema, unknown>>>, ExtractBagNodes<Schema, string>> : (state: ExtractStateType<Schema>, config: LangGraphRunnableConfig<Context>) => GraphNodeReturnValue<ExtractUpdateType<Schema>, Nodes>;\n/**\n * Type bag for ConditionalEdgeRouter that accepts schema types.\n * Unlike GraphNodeTypes, conditional edges don't have separate input/output -\n * they just read state and return routing decisions.\n *\n * @example\n * ```typescript\n * const router: ConditionalEdgeRouter<{\n * Schema: typeof StateSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * return state.done ? END : \"agent\";\n * };\n * ```\n */\nexport interface ConditionalEdgeRouterTypes<InputSchema = unknown, ContextSchema = unknown, Nodes extends string = string> {\n /** Schema for router state (uses ExtractStateType) */\n InputSchema?: InputSchema;\n /** Schema for runtime context (uses ExtractStateType) */\n ContextSchema?: ContextSchema;\n /** Union of valid node names that can be routed to */\n Nodes?: Nodes;\n}\n/**\n * Detect if T is a ConditionalEdgeRouterTypes bag.\n * @internal\n */\ntype IsConditionalEdgeRouterTypeBag<T> = T extends {\n InputSchema: unknown;\n} ? true : T extends {\n ContextSchema: unknown;\n} ? true : false;\n/**\n * Return type for conditional edge routing functions.\n */\ntype ConditionalEdgeRouterReturnValue<Nodes extends string, State> = Nodes | typeof END | Send<Nodes, State> | Array<Nodes | Send<Nodes, State>>;\n/**\n * Type for conditional edge routing functions.\n *\n * Use this to type functions passed to `addConditionalEdges` for\n * full type safety on state, runtime context, and return values.\n *\n * **Supports two patterns:**\n *\n * 1. **Single schema pattern** - Single schema:\n * `ConditionalEdgeRouter<Schema, Context, Nodes>`\n *\n * 2. **Type bag pattern** - Separate schemas for state, context:\n * `ConditionalEdgeRouter<{ Schema; ContextSchema; Nodes }>`\n *\n * @template Schema - The state schema type OR a type bag\n * @template Context - The runtime context type available to node logic\n * @template Nodes - Union of valid node names that can be routed to\n *\n * @example Single schema pattern\n * ```typescript\n * type MyContext = { userId: string };\n * const router: ConditionalEdgeRouter<typeof AgentState, MyContext, \"agent\" | \"tool\"> =\n * (state, config) => {\n * const userId = config.context?.userId;\n * if (state.done) return END;\n * return state.needsTool ? \"tool\" : \"agent\";\n * };\n *\n * graph.addConditionalEdges(\"router\", router, [\"agent\", \"tool\"]);\n * ```\n *\n * @example Type bag pattern\n * ```typescript\n * const router: ConditionalEdgeRouter<{\n * Schema: typeof StateSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * if (state.done) return END;\n * return \"agent\";\n * };\n * ```\n */\nexport type ConditionalEdgeRouter<Schema, Context extends Record<string, any> = Record<string, any>, Nodes extends string = string> = IsConditionalEdgeRouterTypeBag<Schema> extends true ? (state: ExtractBagInput<Schema, unknown>, config: LangGraphRunnableConfig<ExtractBagContext<Schema, Record<string, unknown>>>) => ConditionalEdgeRouterReturnValue<ExtractBagNodes<Schema, string>, ExtractBagInput<Schema, unknown>> | Promise<ConditionalEdgeRouterReturnValue<ExtractBagNodes<Schema, string>, ExtractBagInput<Schema, unknown>>> : (state: ExtractStateType<Schema>, config: LangGraphRunnableConfig<Context>) => ConditionalEdgeRouterReturnValue<Nodes, ExtractStateType<Schema>> | Promise<ConditionalEdgeRouterReturnValue<Nodes, ExtractStateType<Schema>>>;\n"],"mappings":";;;;;;;;;;AAcA;;;;;AAAwEa,KAA5DE,iBAA4DF,CAAAA,CAAAA,CAAAA,GAArCG,CAAqCH,SAA3BD,WAA2BC,CAAAA,KAAAA,MAAAA,CAAAA,GAAAA,kCAAAA,CAAmCI,KAAnCJ,CAAAA,GAA4CG,CAA5CH,SAAsDP,cAAtDO,CAAAA,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,MAAA"}
@@ -7,7 +7,6 @@ import { InteropZodObject } from "@langchain/core/utils/types";
7
7
  import { StandardSchemaV1 } from "@standard-schema/spec";
8
8
 
9
9
  //#region src/graph/types.d.ts
10
-
11
10
  /**
12
11
  * Convert any supported schema type to a StateDefinition.
13
12
  *
@@ -21,13 +20,6 @@ type ToStateDefinition<T> = T extends StateSchema<infer TInit> ? StateSchemaFiel
21
20
  * @internal
22
21
  */
23
22
  type StateDefinitionInit = StateDefinition | InteropZodObject | AnyStateSchema | AnnotationRoot<any>;
24
- /**
25
- * Check if a value is a valid StateDefinitionInit type.
26
- * Supports: StateSchema, InteropZodObject (Zod), AnnotationRoot, StateDefinition
27
- *
28
- * @internal
29
- */
30
-
31
23
  /**
32
24
  * Valid types for context schema.
33
25
  * Context doesn't have channels/reducers, so StateSchema is NOT supported.
@@ -52,15 +44,13 @@ type ContextSchemaInit = StandardSchemaV1 | AnnotationRoot<StateDefinition>;
52
44
  * @template WriterType - Writer type (defaults to unknown)
53
45
  */
54
46
  type StateGraphInit<SD extends StateDefinitionInit = StateDefinitionInit, I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = {
55
- /** Primary key for state schema */
56
- state?: SD;
47
+ /** Primary key for state schema */state?: SD;
57
48
  /**
58
49
  * @deprecated Use `state` instead. Will be removed in a future version.
59
50
  */
60
51
  stateSchema?: SD;
61
52
  input?: I;
62
- output?: O;
63
- /** Context schema for runtime configuration validation. Does not support StateSchema. */
53
+ output?: O; /** Context schema for runtime configuration validation. Does not support StateSchema. */
64
54
  context?: C;
65
55
  interrupt?: InterruptType;
66
56
  writer?: WriterType;
@@ -73,12 +63,6 @@ type StateGraphInit<SD extends StateDefinitionInit = StateDefinitionInit, I exte
73
63
  * @internal
74
64
  */
75
65
  type StateGraphOptions<I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = Omit<StateGraphInit<StateDefinitionInit, I, O, C, N, InterruptType, WriterType>, "state" | "stateSchema">;
76
- /**
77
- * Check if a value is a StateGraphInit object (has state, stateSchema, or input with valid schema).
78
- *
79
- * @internal
80
- */
81
-
82
66
  /**
83
67
  * Extract the State type from any supported schema type.
84
68
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":["InteropZodObject","StandardSchemaV1","LangGraphRunnableConfig","CommandInstance","Send","END","AnnotationRoot","StateDefinition","StateType","UpdateType","AnnotationUpdateType","AnyStateSchema","StateSchema","StateSchemaFieldsToStateDefinition","InteropZodToStateDefinition","ToStateDefinition","T","TInit","SD","StateDefinitionInit","isStateDefinitionInit","ContextSchemaInit","StateGraphInit","I","O","C","InterruptType","WriterType","N","StateGraphOptions","Omit","isStateGraphInit","ExtractStateType","Schema","S","Fallback","ExtractUpdateType","U","FallbackBase","Partial","ExtractBagInput","Bag","Default","ExtractBagOutput","ExtractBagContext","Record","Ctx","ExtractBagNodes","GraphNodeTypes","InputSchema","OutputSchema","ContextSchema","Nodes","IsGraphNodeTypeBag","GraphNodeReturnValue","Update","Promise","GraphNode","Context","ConditionalEdgeRouterTypes","IsConditionalEdgeRouterTypeBag","ConditionalEdgeRouterReturnValue","State","Array","ConditionalEdgeRouter"],"sources":["../../src/graph/types.d.ts"],"sourcesContent":["import { type InteropZodObject } from \"@langchain/core/utils/types\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { LangGraphRunnableConfig } from \"../pregel/runnable_types.js\";\nimport type { CommandInstance, Send } from \"../constants.js\";\nimport { END } from \"../constants.js\";\nimport type { AnnotationRoot, StateDefinition, StateType, UpdateType as AnnotationUpdateType } from \"./annotation.js\";\nimport { AnyStateSchema, StateSchema, StateSchemaFieldsToStateDefinition } from \"../state/schema.js\";\nimport type { InteropZodToStateDefinition } from \"./zod/meta.js\";\nexport { END };\n/**\n * Convert any supported schema type to a StateDefinition.\n *\n * @internal\n */\nexport type ToStateDefinition<T> = T extends StateSchema<infer TInit> ? StateSchemaFieldsToStateDefinition<TInit> : T extends AnnotationRoot<infer SD> ? SD : T extends InteropZodObject ? InteropZodToStateDefinition<T> : T extends StateDefinition ? T : never;\n/**\n * Type for schema types that can be used to initialize state.\n * Supports all valid schema types: StateDefinition, Zod objects, StateSchema, and AnnotationRoot.\n *\n * @internal\n */\nexport type StateDefinitionInit = StateDefinition | InteropZodObject | AnyStateSchema | AnnotationRoot<any>;\n/**\n * Check if a value is a valid StateDefinitionInit type.\n * Supports: StateSchema, InteropZodObject (Zod), AnnotationRoot, StateDefinition\n *\n * @internal\n */\nexport declare function isStateDefinitionInit(value: unknown): value is StateDefinitionInit;\n/**\n * Valid types for context schema.\n * Context doesn't have channels/reducers, so StateSchema is NOT supported.\n * Supports StandardSchemaV1 (Zod, Valibot, etc.) and AnnotationRoot (backward compat).\n *\n * @internal\n */\nexport type ContextSchemaInit = StandardSchemaV1 | AnnotationRoot<StateDefinition>;\n/**\n * Initialization options for StateGraph.\n * Accepts any combination of schema types for state/input/output.\n *\n * Supports both `state` and `stateSchema` as aliases for backward compatibility.\n * If only `input` is provided (no state/stateSchema), `input` is used as the state schema.\n *\n * @template SD - State definition type\n * @template I - Input definition type (defaults to undefined)\n * @template O - Output definition type (defaults to undefined)\n * @template C - Context schema type (defaults to undefined)\n * @template N - Node name union type (defaults to string)\n * @template InterruptType - Interrupt type (defaults to unknown)\n * @template WriterType - Writer type (defaults to unknown)\n */\nexport type StateGraphInit<SD extends StateDefinitionInit = StateDefinitionInit, I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = {\n /** Primary key for state schema */\n state?: SD;\n /**\n * @deprecated Use `state` instead. Will be removed in a future version.\n */\n stateSchema?: SD;\n input?: I;\n output?: O;\n /** Context schema for runtime configuration validation. Does not support StateSchema. */\n context?: C;\n interrupt?: InterruptType;\n writer?: WriterType;\n nodes?: N[];\n};\n/**\n * Options for the second argument when passing a direct schema.\n * Excludes `state` and `stateSchema` since those come from the first arg.\n *\n * @internal\n */\nexport type StateGraphOptions<I extends StateDefinitionInit | undefined = undefined, O extends StateDefinitionInit | undefined = undefined, C extends StateDefinitionInit | undefined = undefined, N extends string = string, InterruptType = unknown, WriterType = unknown> = Omit<StateGraphInit<StateDefinitionInit, I, O, C, N, InterruptType, WriterType>, \"state\" | \"stateSchema\">;\n/**\n * Check if a value is a StateGraphInit object (has state, stateSchema, or input with valid schema).\n *\n * @internal\n */\nexport declare function isStateGraphInit(value: unknown): value is StateGraphInit<StateDefinitionInit>;\n/**\n * Extract the State type from any supported schema type.\n *\n * Supports:\n * - StateSchema\n * - AnnotationRoot\n * - StateDefinition (internal channel definitions)\n * - InteropZodObject (Zod v3/v4 object schemas)\n *\n * @template Schema - The schema type to extract state from\n * @template Fallback - Type to return if schema doesn't match (default: never)\n */\nexport type ExtractStateType<Schema, Fallback = Schema> = Schema extends AnnotationRoot<infer SD> ? StateType<SD> : StateType<ToStateDefinition<Schema>> extends infer S ? [S] extends [never] ? Fallback : S : Fallback;\n/**\n * Extract the Update type from any supported schema type.\n *\n * The Update type represents what a node can return to update the state.\n * All fields are optional since nodes only need to return the fields they modify.\n *\n * Supports:\n * - StateSchema\n * - AnnotationRoot\n * - StateDefinition (internal channel definitions)\n * - InteropZodObject (Zod v3/v4 object schemas)\n *\n * @template Schema - The schema type to extract update type from\n * @template FallbackBase - Base type for fallback (will be partialized), defaults to Schema\n */\nexport type ExtractUpdateType<Schema, FallbackBase = Schema> = Schema extends AnnotationRoot<infer SD> ? AnnotationUpdateType<SD> : AnnotationUpdateType<ToStateDefinition<Schema>> extends infer U ? [U] extends [never] ? Partial<FallbackBase> : U : Partial<FallbackBase>;\n/**\n * Extract the input type from a type bag, using ExtractStateType on the InputSchema.\n * Falls back to Default if InputSchema is not provided.\n * @internal\n */\ntype ExtractBagInput<Bag, Default> = Bag extends {\n InputSchema: infer I;\n} ? ExtractStateType<I> : Default;\n/**\n * Extract the output type from a type bag, using ExtractUpdateType on the OutputSchema.\n * Falls back to Default if OutputSchema is not provided.\n * @internal\n */\ntype ExtractBagOutput<Bag, Default> = Bag extends {\n OutputSchema: infer O;\n} ? ExtractUpdateType<O> : Default;\n/**\n * Extract the context type from a type bag, using ExtractStateType on the ContextSchema.\n * Falls back to Default if ContextSchema is not provided.\n * Ensures result extends Record<string, unknown> for LangGraphRunnableConfig compatibility.\n * @internal\n */\ntype ExtractBagContext<Bag, Default extends Record<string, unknown>> = Bag extends {\n ContextSchema: infer C;\n} ? ExtractStateType<C> extends infer Ctx ? Ctx extends Record<string, unknown> ? Ctx : Default : Default : Default;\n/**\n * Extract the Nodes type from a type bag.\n * Falls back to Default if Nodes is not provided.\n * @internal\n */\ntype ExtractBagNodes<Bag, Default extends string> = Bag extends {\n Nodes: infer N extends string;\n} ? N : Default;\n/**\n * Type bag for GraphNode that accepts schema types.\n * All fields are optional - unspecified fields use defaults.\n *\n * This enables separate input/output schemas for nodes, which is useful when\n * a node receives a subset of state fields and returns different fields.\n *\n * @example\n * ```typescript\n * const node: GraphNode<{\n * InputSchema: typeof NodeInputSchema;\n * OutputSchema: typeof NodeOutputSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, runtime) => {\n * return { answer: `Response to: ${state.query}` };\n * };\n * ```\n */\nexport interface GraphNodeTypes<InputSchema = unknown, OutputSchema = unknown, ContextSchema = unknown, Nodes extends string = string> {\n /** Schema for node input state (uses ExtractStateType) */\n InputSchema?: InputSchema;\n /** Schema for node output/update (uses ExtractUpdateType) */\n OutputSchema?: OutputSchema;\n /** Schema for runtime context (uses ExtractStateType) */\n ContextSchema?: ContextSchema;\n /** Union of valid node names for Command.goto */\n Nodes?: Nodes;\n}\n/**\n * Detect if T is a type bag (has InputSchema or OutputSchema) or a direct schema.\n * @internal\n */\ntype IsGraphNodeTypeBag<T> = T extends {\n InputSchema: unknown;\n} ? true : T extends {\n OutputSchema: unknown;\n} ? true : false;\n/**\n * Return value type for GraphNode functions.\n * Nodes can return an update object, a Command, or a Promise of either.\n *\n * @template Update - The update type (what fields can be returned)\n * @template Nodes - Union of valid node names for Command.goto\n */\nexport type GraphNodeReturnValue<Update, Nodes extends string = string> = Update | CommandInstance<unknown, Update, Nodes> | Promise<Update | CommandInstance<unknown, Update, Nodes>>;\n/**\n * Strongly-typed utility for authoring graph nodes outside of the StateGraph builder,\n * supporting inference for both state (from Schema) and config context (from Context type).\n *\n * This type enables you to define graph node functions with full type safety—both\n * for the evolving state and for additional context that may be passed in at runtime.\n * Typing the context parameter allows for better code organization and precise editor support.\n *\n * Works with StateSchema, AnnotationRoot, and Zod object schemas for state, and\n * with a user-defined object shape for context.\n *\n * **Supports two patterns:**\n *\n * 1. **Single schema usage** - Single schema for both input and output:\n * `GraphNode<Schema, Context, Nodes>`\n *\n * 2. **Type bag pattern** - Separate schemas for input, output, context:\n * `GraphNode<{ InputSchema; OutputSchema; ContextSchema; Nodes }>`\n *\n * @template Schema - The state schema type (StateSchema, AnnotationRoot, InteropZodObject) OR a type bag\n * @template Context - The type of the context passed into this node (default: Record<string, unknown>)\n * @template Nodes - An optional union of valid node names for Command.goto, used for type-safe routing (default: string)\n *\n * @example Single schema usage\n * ```typescript\n * import { StateSchema, GraphNode } from \"@langchain/langgraph\";\n * import { z } from \"zod/v4\";\n *\n * const AgentState = new StateSchema({\n * messages: MessagesValue,\n * step: z.number().default(0),\n * });\n *\n * // Context shape for custom node logic (optional)\n * type MyContext = { userId: string };\n *\n * // Node receiving state and config\n * const processNode: GraphNode<typeof AgentState, MyContext> = (state, config) => {\n * const userId = config.configurable?.userId; // type-safe context access\n * return { step: state.step + 1 };\n * };\n *\n * // Node with type-safe graph routing\n * const routerNode: GraphNode<typeof AgentState, MyContext, \"agent\" | \"tool\"> = (state, config) => {\n * if (state.needsTool) {\n * return new Command({ goto: \"tool\", update: { step: state.step + 1 } });\n * }\n * return new Command({ goto: \"agent\" });\n * };\n *\n * // Use in graph\n * const graph = new StateGraph(AgentState)\n * .addNode(\"process\", processNode)\n * .addNode(\"router\", routerNode)\n * .compile();\n * ```\n *\n * @example Type bag pattern - separate input/output schemas\n * ```typescript\n * const InputSchema = new StateSchema({\n * messages: z.array(z.string()),\n * query: z.string(),\n * });\n *\n * const OutputSchema = new StateSchema({\n * answer: z.string(),\n * });\n *\n * const ContextSchema = z.object({ userId: z.string() });\n *\n * const node: GraphNode<{\n * InputSchema: typeof InputSchema;\n * OutputSchema: typeof OutputSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * // state is { messages: string[]; query: string }\n * // config.configurable is { userId: string } | undefined\n * return { answer: `Response to: ${state.query}` };\n * };\n * ```\n */\nexport type GraphNode<Schema, Context extends Record<string, any> = Record<string, any>, Nodes extends string = string> = IsGraphNodeTypeBag<Schema> extends true ? (state: ExtractBagInput<Schema, unknown>, config: LangGraphRunnableConfig<ExtractBagContext<Schema, Record<string, unknown>>>) => GraphNodeReturnValue<ExtractBagOutput<Schema, Partial<ExtractBagInput<Schema, unknown>>>, ExtractBagNodes<Schema, string>> : (state: ExtractStateType<Schema>, config: LangGraphRunnableConfig<Context>) => GraphNodeReturnValue<ExtractUpdateType<Schema>, Nodes>;\n/**\n * Type bag for ConditionalEdgeRouter that accepts schema types.\n * Unlike GraphNodeTypes, conditional edges don't have separate input/output -\n * they just read state and return routing decisions.\n *\n * @example\n * ```typescript\n * const router: ConditionalEdgeRouter<{\n * Schema: typeof StateSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * return state.done ? END : \"agent\";\n * };\n * ```\n */\nexport interface ConditionalEdgeRouterTypes<InputSchema = unknown, ContextSchema = unknown, Nodes extends string = string> {\n /** Schema for router state (uses ExtractStateType) */\n InputSchema?: InputSchema;\n /** Schema for runtime context (uses ExtractStateType) */\n ContextSchema?: ContextSchema;\n /** Union of valid node names that can be routed to */\n Nodes?: Nodes;\n}\n/**\n * Detect if T is a ConditionalEdgeRouterTypes bag.\n * @internal\n */\ntype IsConditionalEdgeRouterTypeBag<T> = T extends {\n InputSchema: unknown;\n} ? true : T extends {\n ContextSchema: unknown;\n} ? true : false;\n/**\n * Return type for conditional edge routing functions.\n */\ntype ConditionalEdgeRouterReturnValue<Nodes extends string, State> = Nodes | typeof END | Send<Nodes, State> | Array<Nodes | Send<Nodes, State>>;\n/**\n * Type for conditional edge routing functions.\n *\n * Use this to type functions passed to `addConditionalEdges` for\n * full type safety on state, runtime context, and return values.\n *\n * **Supports two patterns:**\n *\n * 1. **Single schema pattern** - Single schema:\n * `ConditionalEdgeRouter<Schema, Context, Nodes>`\n *\n * 2. **Type bag pattern** - Separate schemas for state, context:\n * `ConditionalEdgeRouter<{ Schema; ContextSchema; Nodes }>`\n *\n * @template Schema - The state schema type OR a type bag\n * @template Context - The runtime context type available to node logic\n * @template Nodes - Union of valid node names that can be routed to\n *\n * @example Single schema pattern\n * ```typescript\n * type MyContext = { userId: string };\n * const router: ConditionalEdgeRouter<typeof AgentState, MyContext, \"agent\" | \"tool\"> =\n * (state, config) => {\n * const userId = config.context?.userId;\n * if (state.done) return END;\n * return state.needsTool ? \"tool\" : \"agent\";\n * };\n *\n * graph.addConditionalEdges(\"router\", router, [\"agent\", \"tool\"]);\n * ```\n *\n * @example Type bag pattern\n * ```typescript\n * const router: ConditionalEdgeRouter<{\n * Schema: typeof StateSchema;\n * ContextSchema: typeof ContextSchema;\n * Nodes: \"agent\" | \"tool\";\n * }> = (state, config) => {\n * if (state.done) return END;\n * return \"agent\";\n * };\n * ```\n */\nexport type ConditionalEdgeRouter<Schema, Context extends Record<string, any> = Record<string, any>, Nodes extends string = string> = IsConditionalEdgeRouterTypeBag<Schema> extends true ? (state: ExtractBagInput<Schema, unknown>, config: LangGraphRunnableConfig<ExtractBagContext<Schema, Record<string, unknown>>>) => ConditionalEdgeRouterReturnValue<ExtractBagNodes<Schema, string>, ExtractBagInput<Schema, unknown>> | Promise<ConditionalEdgeRouterReturnValue<ExtractBagNodes<Schema, string>, ExtractBagInput<Schema, unknown>>> : (state: ExtractStateType<Schema>, config: LangGraphRunnableConfig<Context>) => ConditionalEdgeRouterReturnValue<Nodes, ExtractStateType<Schema>> | Promise<ConditionalEdgeRouterReturnValue<Nodes, ExtractStateType<Schema>>>;\n"],"mappings":";;;;;;;;;;AAcA;;;;;AAAwEa,KAA5DE,iBAA4DF,CAAAA,CAAAA,CAAAA,GAArCG,CAAqCH,SAA3BD,WAA2BC,CAAAA,KAAAA,MAAAA,CAAAA,GAAAA,kCAAAA,CAAmCI,KAAnCJ,CAAAA,GAA4CG,CAA5CH,SAAsDP,cAAtDO,CAAAA,KAAAA,GAAAA,CAAAA,GAAiFK,EAAjFL,GAAsFG,CAAtFH,SAAgGb,gBAAhGa,GAAmHC,2BAAnHD,CAA+IG,CAA/IH,CAAAA,GAAoJG,CAApJH,SAA8JN,eAA9JM,GAAgLG,CAAhLH,GAAAA,KAAAA;;;;;;;AAAmHC,KAO/KK,mBAAAA,GAAsBZ,eAPyJO,GAOvId,gBAPuIc,GAOpHH,cAPoHG,GAOnGR,cAPmGQ,CAAAA,GAAAA,CAAAA;;;;;AAO3L;;;;;;;AAeA;;;AAAkEP,KAAtDc,iBAAAA,GAAoBpB,gBAAkCM,GAAfD,cAAeC,CAAAA,eAAAA,CAAAA;;;AAgBlE;;;;;;;;;;;;;AAYaoB,KAZDL,cAYCK,CAAAA,WAZyBR,mBAYzBQ,GAZ+CR,mBAY/CQ,EAAAA,UAZ8ER,mBAY9EQ,GAAAA,SAAAA,GAAAA,SAAAA,EAAAA,UAZqIR,mBAYrIQ,GAAAA,SAAAA,GAAAA,SAAAA,EAAAA,UAZ4LR,mBAY5LQ,GAAAA,SAAAA,GAAAA,SAAAA,EAAAA,UAAAA,MAAAA,GAAAA,MAAAA,EAAAA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mBD;;;;;KAuMY,qBAAA,yBAEM,MAAA,gBAAsB,MAAA,gDAEpC,8BAAA,CAA+B,MAAA,kBAG7B,KAAA,EAAO,eAAA,CAAgB,MAAA,YACvB,MAAA,EAAQ,uBAAA,CACN,iBAAA,CAAkB,MAAA,EAAQ,MAAA,wBAG1B,gCAAA,CACE,eAAA,CAAgB,MAAA,WAChB,eAAA,CAAgB,MAAA,cAElB,OAAA,CACE,gCAAA,CACE,eAAA,CAAgB,MAAA,WAChB,eAAA,CAAgB,MAAA,gBAKtB,KAAA,EAAO,gBAAA,CAAiB,MAAA,GACxB,MAAA,EAAQ,uBAAA,CAAwB,OAAA,MAE9B,gCAAA,CAAiC,KAAA,EAAO,gBAAA,CAAiB,MAAA,KACzD,OAAA,CACE,gCAAA,CAAiC,KAAA,EAAO,gBAAA,CAAiB,MAAA"}
@@ -1,3 +1,4 @@
1
+ import "./plugin.cjs";
1
2
  import { InteropZodToStateDefinition, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, schemaMetaRegistry, withLangGraph } from "./meta.cjs";
2
3
  import { LanggraphZodMetaRegistry, registry } from "./zod-registry.cjs";
3
4
  export { InteropZodToStateDefinition, LanggraphZodMetaRegistry, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, registry, schemaMetaRegistry, withLangGraph };
@@ -1,3 +1,4 @@
1
+ import "./plugin.js";
1
2
  import { InteropZodToStateDefinition, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, schemaMetaRegistry, withLangGraph } from "./meta.js";
2
3
  import { LanggraphZodMetaRegistry, registry } from "./zod-registry.js";
3
4
  export { InteropZodToStateDefinition, LanggraphZodMetaRegistry, META_EXTRAS_DESCRIPTION_PREFIX, ReducedZodChannel, SchemaMeta, SchemaMetaRegistry, UpdateType, registry, schemaMetaRegistry, withLangGraph };
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.cts","names":["InteropZodObject","InteropZodType","InteropZodObjectShape","BaseChannel","META_EXTRAS_DESCRIPTION_PREFIX","ReducedZodChannel","T","TReducerSchema","InteropZodToStateDefinition","TShape","key","Schema","ReducerSchema","V","U","UpdateType","SchemaMeta","TValue","TUpdate","SchemaMetaRegistry","Map","schemaMetaRegistry","withLangGraph","TSchema"],"sources":["../../../src/graph/zod/meta.d.ts"],"sourcesContent":["import { InteropZodObject, InteropZodType, InteropZodObjectShape } from \"@langchain/core/utils/types\";\nimport { BaseChannel } from \"../../channels/base.js\";\nexport declare const META_EXTRAS_DESCRIPTION_PREFIX = \"lg:\";\n/** @internal */\nexport type ReducedZodChannel<T extends InteropZodType, TReducerSchema extends InteropZodType> = T & {\n lg_reducer_schema: TReducerSchema;\n};\n/** @internal */\nexport type InteropZodToStateDefinition<T extends InteropZodObject, TShape = InteropZodObjectShape<T>> = {\n [key in keyof TShape]: TShape[key] extends ReducedZodChannel<infer Schema, infer ReducerSchema> ? Schema extends InteropZodType<infer V> ? ReducerSchema extends InteropZodType<infer U> ? BaseChannel<V, U> : never : never : TShape[key] extends InteropZodType<infer V, infer U> ? BaseChannel<V, U> : never;\n};\nexport type UpdateType<T extends InteropZodObject, TShape = InteropZodObjectShape<T>> = {\n [key in keyof TShape]?: TShape[key] extends ReducedZodChannel<infer Schema, infer ReducerSchema> ? Schema extends InteropZodType<unknown> ? ReducerSchema extends InteropZodType<infer U> ? U : never : never : TShape[key] extends InteropZodType<unknown, infer U> ? U : never;\n};\nexport interface SchemaMeta<TValue = any, TUpdate = TValue> {\n jsonSchemaExtra?: {\n langgraph_nodes?: string[];\n langgraph_type?: \"prompt\" | \"messages\";\n [key: string]: unknown;\n };\n reducer?: {\n schema?: InteropZodType<TUpdate>;\n fn: (a: TValue, b: TUpdate) => TValue;\n };\n default?: () => TValue;\n}\n/**\n * A registry for storing and managing metadata associated with schemas.\n * This class provides methods to get, extend, remove, and check metadata for a given schema.\n */\nexport declare class SchemaMetaRegistry {\n /**\n * Internal map storing schema metadata.\n * @internal\n */\n _map: Map<InteropZodType, SchemaMeta<any, any>>;\n /**\n * Cache for extended schemas.\n * @internal\n */\n _extensionCache: Map<string, Map<InteropZodType, InteropZodType>>;\n /**\n * Retrieves the metadata associated with a given schema.\n * @template TValue The value type of the schema.\n * @template TUpdate The update type of the schema (defaults to TValue).\n * @param schema The schema to retrieve metadata for.\n * @returns The associated SchemaMeta, or undefined if not present.\n */\n get<TValue, TUpdate = TValue>(schema: InteropZodType<TValue>): SchemaMeta<TValue, TUpdate> | undefined;\n /**\n * Extends or sets the metadata for a given schema.\n * @template TValue The value type of the schema.\n * @template TUpdate The update type of the schema (defaults to TValue).\n * @param schema The schema to extend metadata for.\n * @param predicate A function that receives the existing metadata (or undefined) and returns the new metadata.\n */\n extend<TValue, TUpdate>(schema: InteropZodType<TValue>, predicate: (meta: SchemaMeta<TValue, TUpdate> | undefined) => SchemaMeta<TValue, TUpdate>): void;\n /**\n * Removes the metadata associated with a given schema.\n * @param schema The schema to remove metadata for.\n * @returns The SchemaMetaRegistry instance (for chaining).\n */\n remove(schema: InteropZodType): this;\n /**\n * Checks if metadata exists for a given schema.\n * @param schema The schema to check.\n * @returns True if metadata exists, false otherwise.\n */\n has(schema: InteropZodType): boolean;\n /**\n * Returns a mapping of channel instances for each property in the schema\n * using the associated metadata in the registry.\n *\n * This is used to create the `channels` object that's passed to the `Graph` constructor.\n *\n * @template T The shape of the schema.\n * @param schema The schema to extract channels from.\n * @returns A mapping from property names to channel instances.\n */\n getChannelsForSchema<T extends InteropZodObject>(schema: T): InteropZodToStateDefinition<T>;\n /**\n * Returns a modified schema that introspectively looks at all keys of the provided\n * object schema, and applies the augmentations based on meta provided with those keys\n * in the registry and the selectors provided in the `effects` parameter.\n *\n * This assumes that the passed in schema is the \"root\" schema object for a graph where\n * the keys of the schema are the channels of the graph. Because we need to represent\n * the input of a graph in a couple of different ways, the `effects` parameter allows\n * us to apply those augmentations based on pre determined conditions.\n *\n * @param schema The root schema object to extend.\n * @param effects The effects that are being applied.\n * @returns The extended schema.\n */\n getExtendedChannelSchemas<T extends InteropZodObject>(schema: T, effects: {\n /**\n * Augments the shape by using the reducer's schema if it exists\n */\n withReducerSchema?: boolean;\n /**\n * Applies the stringified jsonSchemaExtra as a description to the schema.\n */\n withJsonSchemaExtrasAsDescription?: boolean;\n /**\n * Applies the `.partial()` modifier to the schema.\n */\n asPartial?: boolean;\n }): InteropZodObject;\n}\nexport declare const schemaMetaRegistry: SchemaMetaRegistry;\nexport declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate> & {\n reducer?: undefined;\n}): TSchema;\nexport declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate>): ReducedZodChannel<TSchema, InteropZodType<TUpdate>>;\n"],"mappings":";;;;cAEqBI,8BAAAA;;AAAAA,KAETC,iBAFSD,CAAAA,UAEmBH,cAFW,EAAA,uBAE4BA,cAF5B,CAAA,GAE8CK,CAF9C,GAAA;EAEvCD,iBAAAA,EACWE,cADM;CAAA;;AAAkDN,KAInEO,2BAJmEP,CAAAA,UAI7BD,gBAJ6BC,EAAAA,SAIFC,qBAJED,CAIoBK,CAJpBL,CAAAA,CAAAA,GAAAA,UAAkBK,MAK/EG,MAL+EH,GAKtEG,MALsEH,CAK/DI,GAL+DJ,CAAAA,SAKlDD,iBALkDC,CAAAA,KAAAA,OAAAA,EAAAA,KAAAA,cAAAA,CAAAA,GAKKK,MALLL,SAKoBL,cALpBK,CAAAA,KAAAA,EAAAA,CAAAA,GAK8CM,aAL9CN,SAKoEL,cALpEK,CAAAA,KAAAA,EAAAA,CAAAA,GAK8FH,WAL9FG,CAK0GO,CAL1GP,EAK6GQ,CAL7GR,CAAAA,GAAAA,KAAAA,GAAAA,KAAAA,GAKkIG,MALlIH,CAKyII,GALzIJ,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AA,iBAEf,aAAA,kCAGE,cAAA,CAAe,MAAA,EAAA,CAE/B,MAAA,EAAQ,OAAA,EACR,IAAA,EAAM,UAAA,CAAW,MAAA,EAAQ,OAAA;EAAa,OAAA;AAAA,IACrC,OAAA;AAAA,iBACa,aAAA,kCAGE,cAAA,CAAe,MAAA,EAAA,CAE/B,MAAA,EAAQ,OAAA,EACR,IAAA,EAAM,UAAA,CAAW,MAAA,EAAQ,OAAA,IACxB,iBAAA,CAAkB,OAAA,EAAS,cAAA,CAAe,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","names":["InteropZodObject","InteropZodType","InteropZodObjectShape","BaseChannel","META_EXTRAS_DESCRIPTION_PREFIX","ReducedZodChannel","T","TReducerSchema","InteropZodToStateDefinition","TShape","key","Schema","ReducerSchema","V","U","UpdateType","SchemaMeta","TValue","TUpdate","SchemaMetaRegistry","Map","schemaMetaRegistry","withLangGraph","TSchema"],"sources":["../../../src/graph/zod/meta.d.ts"],"sourcesContent":["import { InteropZodObject, InteropZodType, InteropZodObjectShape } from \"@langchain/core/utils/types\";\nimport { BaseChannel } from \"../../channels/base.js\";\nexport declare const META_EXTRAS_DESCRIPTION_PREFIX = \"lg:\";\n/** @internal */\nexport type ReducedZodChannel<T extends InteropZodType, TReducerSchema extends InteropZodType> = T & {\n lg_reducer_schema: TReducerSchema;\n};\n/** @internal */\nexport type InteropZodToStateDefinition<T extends InteropZodObject, TShape = InteropZodObjectShape<T>> = {\n [key in keyof TShape]: TShape[key] extends ReducedZodChannel<infer Schema, infer ReducerSchema> ? Schema extends InteropZodType<infer V> ? ReducerSchema extends InteropZodType<infer U> ? BaseChannel<V, U> : never : never : TShape[key] extends InteropZodType<infer V, infer U> ? BaseChannel<V, U> : never;\n};\nexport type UpdateType<T extends InteropZodObject, TShape = InteropZodObjectShape<T>> = {\n [key in keyof TShape]?: TShape[key] extends ReducedZodChannel<infer Schema, infer ReducerSchema> ? Schema extends InteropZodType<unknown> ? ReducerSchema extends InteropZodType<infer U> ? U : never : never : TShape[key] extends InteropZodType<unknown, infer U> ? U : never;\n};\nexport interface SchemaMeta<TValue = any, TUpdate = TValue> {\n jsonSchemaExtra?: {\n langgraph_nodes?: string[];\n langgraph_type?: \"prompt\" | \"messages\";\n [key: string]: unknown;\n };\n reducer?: {\n schema?: InteropZodType<TUpdate>;\n fn: (a: TValue, b: TUpdate) => TValue;\n };\n default?: () => TValue;\n}\n/**\n * A registry for storing and managing metadata associated with schemas.\n * This class provides methods to get, extend, remove, and check metadata for a given schema.\n */\nexport declare class SchemaMetaRegistry {\n /**\n * Internal map storing schema metadata.\n * @internal\n */\n _map: Map<InteropZodType, SchemaMeta<any, any>>;\n /**\n * Cache for extended schemas.\n * @internal\n */\n _extensionCache: Map<string, Map<InteropZodType, InteropZodType>>;\n /**\n * Retrieves the metadata associated with a given schema.\n * @template TValue The value type of the schema.\n * @template TUpdate The update type of the schema (defaults to TValue).\n * @param schema The schema to retrieve metadata for.\n * @returns The associated SchemaMeta, or undefined if not present.\n */\n get<TValue, TUpdate = TValue>(schema: InteropZodType<TValue>): SchemaMeta<TValue, TUpdate> | undefined;\n /**\n * Extends or sets the metadata for a given schema.\n * @template TValue The value type of the schema.\n * @template TUpdate The update type of the schema (defaults to TValue).\n * @param schema The schema to extend metadata for.\n * @param predicate A function that receives the existing metadata (or undefined) and returns the new metadata.\n */\n extend<TValue, TUpdate>(schema: InteropZodType<TValue>, predicate: (meta: SchemaMeta<TValue, TUpdate> | undefined) => SchemaMeta<TValue, TUpdate>): void;\n /**\n * Removes the metadata associated with a given schema.\n * @param schema The schema to remove metadata for.\n * @returns The SchemaMetaRegistry instance (for chaining).\n */\n remove(schema: InteropZodType): this;\n /**\n * Checks if metadata exists for a given schema.\n * @param schema The schema to check.\n * @returns True if metadata exists, false otherwise.\n */\n has(schema: InteropZodType): boolean;\n /**\n * Returns a mapping of channel instances for each property in the schema\n * using the associated metadata in the registry.\n *\n * This is used to create the `channels` object that's passed to the `Graph` constructor.\n *\n * @template T The shape of the schema.\n * @param schema The schema to extract channels from.\n * @returns A mapping from property names to channel instances.\n */\n getChannelsForSchema<T extends InteropZodObject>(schema: T): InteropZodToStateDefinition<T>;\n /**\n * Returns a modified schema that introspectively looks at all keys of the provided\n * object schema, and applies the augmentations based on meta provided with those keys\n * in the registry and the selectors provided in the `effects` parameter.\n *\n * This assumes that the passed in schema is the \"root\" schema object for a graph where\n * the keys of the schema are the channels of the graph. Because we need to represent\n * the input of a graph in a couple of different ways, the `effects` parameter allows\n * us to apply those augmentations based on pre determined conditions.\n *\n * @param schema The root schema object to extend.\n * @param effects The effects that are being applied.\n * @returns The extended schema.\n */\n getExtendedChannelSchemas<T extends InteropZodObject>(schema: T, effects: {\n /**\n * Augments the shape by using the reducer's schema if it exists\n */\n withReducerSchema?: boolean;\n /**\n * Applies the stringified jsonSchemaExtra as a description to the schema.\n */\n withJsonSchemaExtrasAsDescription?: boolean;\n /**\n * Applies the `.partial()` modifier to the schema.\n */\n asPartial?: boolean;\n }): InteropZodObject;\n}\nexport declare const schemaMetaRegistry: SchemaMetaRegistry;\nexport declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate> & {\n reducer?: undefined;\n}): TSchema;\nexport declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate>): ReducedZodChannel<TSchema, InteropZodType<TUpdate>>;\n"],"mappings":";;;;cAEqBI,8BAAAA;;AAAAA,KAETC,iBAFSD,CAAAA,UAEmBH,cAFW,EAAA,uBAE4BA,cAF5B,CAAA,GAE8CK,CAF9C,GAAA;EAEvCD,iBAAAA,EACWE,cADM;CAAA;;AAAkDN,KAInEO,2BAJmEP,CAAAA,UAI7BD,gBAJ6BC,EAAAA,SAIFC,qBAJED,CAIoBK,CAJpBL,CAAAA,CAAAA,GAAAA,UAAkBK,MAK/EG,MAL+EH,GAKtEG,MALsEH,C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;;;;;;EAoHpB,oBAAA,WAA+B,gBAAA,CAAA,CAC7B,MAAA,EAAQ,CAAA,GACP,2BAAA,CAA4B,CAAA;EAlHX;AAItB;;;;;;;;;;;;;EA4IE,yBAAA,WAAoC,gBAAA,CAAA,CAClC,MAAA,EAAQ,CAAA,EACR,OAAA;IAjIsB;;;IAqIpB,iBAAA;IAjJM;;;IAqJN,iCAAA;IAlJH;;;IAsJG,SAAA;EAAA,IAED,gBAAA;AAAA;AAAA,cA+DQ,kBAAA,EAAkB,kBAAA;AAAA,iBAEf,aAAA,kCAGE,cAAA,CAAe,MAAA,EAAA,CAE/B,MAAA,EAAQ,OAAA,EACR,IAAA,EAAM,UAAA,CAAW,MAAA,EAAQ,OAAA;EAAa,OAAA;AAAA,IACrC,OAAA;AAAA,iBACa,aAAA,kCAGE,cAAA,CAAe,MAAA,EAAA,CAE/B,MAAA,EAAQ,OAAA,EACR,IAAA,EAAM,UAAA,CAAW,MAAA,EAAQ,OAAA,IACxB,iBAAA,CAAkB,OAAA,EAAS,cAAA,CAAe,OAAA"}
@@ -0,0 +1,30 @@
1
+ import { z } from "zod/v3";
2
+
3
+ //#region src/graph/zod/plugin.d.ts
4
+ interface ZodLangGraphTypesV3<T extends z.ZodTypeAny, Output> {
5
+ reducer<Input = z.output<T>>(transform: (a: Output, arg: Input) => Output, options?: z.ZodType<Input>): z.ZodType<Output, z.ZodEffectsDef<T>, Input>;
6
+ metadata(payload: {
7
+ langgraph_nodes?: string[];
8
+ langgraph_type?: "prompt";
9
+ [key: string]: unknown;
10
+ }): T;
11
+ }
12
+ declare module "zod" {
13
+ interface ZodType<Output> {
14
+ /**
15
+ * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
16
+ * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
17
+ */
18
+ langgraph: ZodLangGraphTypesV3<any, Output>;
19
+ }
20
+ }
21
+ declare module "zod/v3" {
22
+ interface ZodType<Output> {
23
+ /**
24
+ * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
25
+ * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
26
+ */
27
+ langgraph: ZodLangGraphTypesV3<this, Output>;
28
+ }
29
+ }
30
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/graph/zod/plugin.ts"],"mappings":";;;UAUU,mBAAA,WAA8B,CAAA,CAAG,UAAA;EACzC,OAAA,SAAgB,CAAA,CAAG,MAAA,CAAO,CAAA,GACxB,SAAA,GAAY,CAAA,EAAG,MAAA,EAAQ,GAAA,EAAK,KAAA,KAAU,MAAA,EACtC,OAAA,GAAU,CAAA,CAAG,OAAA,CAAQ,KAAA,IACpB,CAAA,CAAG,OAAA,CAAQ,MAAA,EAAQ,CAAA,CAAG,aAAA,CAAc,CAAA,GAAI,KAAA;EAE3C,QAAA,CAAS,OAAA;IACP,eAAA;IACA,cAAA;IAAA,CAEC,GAAA;EAAA,IACC,CAAA;AAAA;AAAA;EAAA,UAIM,OAAA;IAb8B;;;;IAmBtC,SAAA,EAAW,mBAAA,MAAyB,MAAA;EAAA;AAAA;AAAA;EAAA,UAI5B,OAAA;IAdL;;;;IAmBH,SAAA,EAAW,mBAAA,OAA0B,MAAA;EAAA;AAAA"}
@@ -0,0 +1,30 @@
1
+ import { z } from "zod/v3";
2
+
3
+ //#region src/graph/zod/plugin.d.ts
4
+ interface ZodLangGraphTypesV3<T extends z.ZodTypeAny, Output> {
5
+ reducer<Input = z.output<T>>(transform: (a: Output, arg: Input) => Output, options?: z.ZodType<Input>): z.ZodType<Output, z.ZodEffectsDef<T>, Input>;
6
+ metadata(payload: {
7
+ langgraph_nodes?: string[];
8
+ langgraph_type?: "prompt";
9
+ [key: string]: unknown;
10
+ }): T;
11
+ }
12
+ declare module "zod" {
13
+ interface ZodType<Output> {
14
+ /**
15
+ * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
16
+ * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
17
+ */
18
+ langgraph: ZodLangGraphTypesV3<any, Output>;
19
+ }
20
+ }
21
+ declare module "zod/v3" {
22
+ interface ZodType<Output> {
23
+ /**
24
+ * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
25
+ * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
26
+ */
27
+ langgraph: ZodLangGraphTypesV3<this, Output>;
28
+ }
29
+ }
30
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../src/graph/zod/plugin.ts"],"mappings":";;;UAUU,mBAAA,WAA8B,CAAA,CAAG,UAAA;EACzC,OAAA,SAAgB,CAAA,CAAG,MAAA,CAAO,CAAA,GACxB,SAAA,GAAY,CAAA,EAAG,MAAA,EAAQ,GAAA,EAAK,KAAA,KAAU,MAAA,EACtC,OAAA,GAAU,CAAA,CAAG,OAAA,CAAQ,KAAA,IACpB,CAAA,CAAG,OAAA,CAAQ,MAAA,EAAQ,CAAA,CAAG,aAAA,CAAc,CAAA,GAAI,KAAA;EAE3C,QAAA,CAAS,OAAA;IACP,eAAA;IACA,cAAA;IAAA,CAEC,GAAA;EAAA,IACC,CAAA;AAAA;AAAA;EAAA,UAIM,OAAA;IAb8B;;;;IAmBtC,SAAA,EAAW,mBAAA,MAAyB,MAAA;EAAA;AAAA;AAAA;EAAA,UAI5B,OAAA;IAdL;;;;IAmBH,SAAA,EAAW,mBAAA,OAA0B,MAAA;EAAA;AAAA"}
@@ -2,7 +2,6 @@ import { SchemaMetaRegistry } from "./meta.cjs";
2
2
  import { JSONSchema } from "@langchain/core/utils/json_schema";
3
3
 
4
4
  //#region src/graph/zod/schema.d.ts
5
-
6
5
  /**
7
6
  * Get the state schema for a graph.
8
7
  * @param graph - The graph to get the state schema for.
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.cts","names":["JSONSchema","SchemaMetaRegistry","getStateTypeSchema","getUpdateTypeSchema","getInputTypeSchema","getOutputTypeSchema","getConfigTypeSchema"],"sources":["../../../src/graph/zod/schema.d.ts"],"sourcesContent":["import { type JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport { SchemaMetaRegistry } from \"./meta.js\";\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n"],"mappings":";;;;;;;AAOA;;;AAA2FA,iBAAnEE,kBAAAA,CAAmEF,KAAAA,EAAAA,OAAAA,EAAAA,QAAAA,CAAAA,EAArBC,kBAAqBD,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA;;AAM3F;;;;AAAsG,iBAA9EG,mBAAAA,CAA8E,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAA/BF,kBAA+B,CAAA,EAAVD,UAAU,GAAA,SAAA;AAMtG;;;;;AAMwBK,iBANAD,kBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN2BH,kBAM3B,CAAA,EANgDD,UAMhD,GAAA,SAAA;;;;;AAM3C;AAA2C,iBANnBK,mBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN4BJ,kBAM5B,CAAA,EANiDD,UAMjD,GAAA,SAAA;;;;;;iBAAnBM,mBAAAA,4BAA+CL,qBAAqBD"}
1
+ {"version":3,"file":"schema.d.cts","names":[],"sources":["../../../src/graph/zod/schema.ts"],"mappings":";;;;;;AA2EA;;;iBAAgB,kBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;;iBAiBa,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;AAHH;;;;;AAAA,iBAsBgB,kBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;AAHH;iBA0BgB,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;;iBAiBa,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA"}
@@ -2,7 +2,6 @@ import { SchemaMetaRegistry } from "./meta.js";
2
2
  import { JSONSchema } from "@langchain/core/utils/json_schema";
3
3
 
4
4
  //#region src/graph/zod/schema.d.ts
5
-
6
5
  /**
7
6
  * Get the state schema for a graph.
8
7
  * @param graph - The graph to get the state schema for.
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","names":["JSONSchema","SchemaMetaRegistry","getStateTypeSchema","getUpdateTypeSchema","getInputTypeSchema","getOutputTypeSchema","getConfigTypeSchema"],"sources":["../../../src/graph/zod/schema.d.ts"],"sourcesContent":["import { type JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport { SchemaMetaRegistry } from \"./meta.js\";\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n"],"mappings":";;;;;;;AAOA;;;AAA2FA,iBAAnEE,kBAAAA,CAAmEF,KAAAA,EAAAA,OAAAA,EAAAA,QAAAA,CAAAA,EAArBC,kBAAqBD,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA;;AAM3F;;;;AAAsG,iBAA9EG,mBAAAA,CAA8E,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAA/BF,kBAA+B,CAAA,EAAVD,UAAU,GAAA,SAAA;AAMtG;;;;;AAMwBK,iBANAD,kBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN2BH,kBAM3B,CAAA,EANgDD,UAMhD,GAAA,SAAA;;;;;AAM3C;AAA2C,iBANnBK,mBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN4BJ,kBAM5B,CAAA,EANiDD,UAMjD,GAAA,SAAA;;;;;;iBAAnBM,mBAAAA,4BAA+CL,qBAAqBD"}
1
+ {"version":3,"file":"schema.d.ts","names":[],"sources":["../../../src/graph/zod/schema.ts"],"mappings":";;;;;;AA2EA;;;iBAAgB,kBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;;iBAiBa,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;AAHH;;;;;AAAA,iBAsBgB,kBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;AAHH;iBA0BgB,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA;;;;;;iBAiBa,mBAAA,CACd,KAAA,WACA,QAAA,GAAU,kBAAA,GACT,UAAA"}
@@ -3,7 +3,6 @@ import * as core from "zod/v4/core";
3
3
  import { $ZodRegistry, $ZodType, $replace } from "zod/v4/core";
4
4
 
5
5
  //#region src/graph/zod/zod-registry.d.ts
6
-
7
6
  /**
8
7
  * A Zod v4-compatible meta registry that extends the base registry.
9
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"zod-registry.d.cts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_0","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\nexport declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;\n"],"mappings":";;;;;;;;AAcA;;;;;;;;;AASwBM,cATHC,wBASGD,CAAAA,aATmCD,UASnCC,GATgDD,UAShDC,EAAAA,eAT2EL,QAS3EK,GATsFL,QAStFK,CAAAA,SATwGJ,YASxGI,CATqHE,IASrHF,GAAAA;MACNG,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;GARfA,MAQ+BC,CAAAA,CAAAA;YAA+BF,MAAAA,EAP3CF,kBAO2CE;;;;;;aAIlDL,CAAAA,MAA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AQ,KAAA,EAAO,SAAA;IACrC,QAAA,WACY,wBAAA,YACA,IAAA,CAAK,MAAA,iBACN,IAAA,CAAK,KAAA,2BACK,IAAA,CAAK,iBAAA,CACtB,OAAA,EACA,MAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,OAAA,EAAS,MAAA,GAEpC,QAAA,EAAU,CAAA,EACV,IAAA,EAAM,UAAA,CAAW,OAAA,EAAS,MAAA,IACzB,iBAAA,OAAwB,WAAA,CAAY,OAAA,EAAS,MAAA,EAAQ,UAAA;EAAA;AAAA;AAAA,cAI/C,QAAA,EAAQ,wBAAA,CAAA,UAAA,YAAA,QAAA,mBAAA,IAAA,CAAA,iBAAA"}
@@ -3,7 +3,6 @@ import * as core from "zod/v4/core";
3
3
  import { $ZodRegistry, $ZodType, $replace } from "zod/v4/core";
4
4
 
5
5
  //#region src/graph/zod/zod-registry.d.ts
6
-
7
6
  /**
8
7
  * A Zod v4-compatible meta registry that extends the base registry.
9
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"zod-registry.d.ts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_0","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\nexport declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;\n"],"mappings":";;;;;;;;AAcA;;;;;;;;;AASwBM,cATHC,wBASGD,CAAAA,aATmCD,UASnCC,GATgDD,UAShDC,EAAAA,eAT2EL,QAS3EK,GATsFL,QAStFK,CA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A;AAAA;AAAA;EAAA,UAKrC,WAAA,kEAGO,IAAA,CAAK,iBAAA,CACzB,MAAA,EACA,KAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,MAAA,EAAQ,KAAA,WAC3B,IAAA,CAAK,QAAA,CAAS,MAAA,EAAQ,KAAA,EAAO,SAAA;IACrC,QAAA,WACY,wBAAA,YACA,IAAA,CAAK,MAAA,iBACN,IAAA,CAAK,KAAA,2BACK,IAAA,CAAK,iBAAA,CACtB,OAAA,EACA,MAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,OAAA,EAAS,MAAA,GAEpC,QAAA,EAAU,CAAA,EACV,IAAA,EAAM,UAAA,CAAW,OAAA,EAAS,MAAA,IACzB,iBAAA,OAAwB,WAAA,CAAY,OAAA,EAAS,MAAA,EAAQ,UAAA;EAAA;AAAA;AAAA,cAI/C,QAAA,EAAQ,wBAAA,CAAA,UAAA,YAAA,QAAA,mBAAA,IAAA,CAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"interrupt.d.cts","names":["interrupt","I","R","FilterAny","T","X","InferInterruptInputType","K","InferInterruptResumeType","TInner"],"sources":["../src/interrupt.d.ts"],"sourcesContent":["/**\n * Interrupts the execution of a graph node.\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt. This will be available in task.interrupts[].value\n * @returns The `resume` value provided when the graph is re-invoked with a Command\n *\n * @example\n * ```typescript\n * // Define a node that uses multiple interrupts\n * const nodeWithInterrupts = () => {\n * // First interrupt - will pause execution and include {value: 1} in task values\n * const answer1 = interrupt({ value: 1 });\n *\n * // Second interrupt - only called after first interrupt is resumed\n * const answer2 = interrupt({ value: 2 });\n *\n * // Use the resume values\n * return { myKey: answer1 + \" \" + answer2 };\n * };\n *\n * // Resume the graph after first interrupt\n * await graph.stream(new Command({ resume: \"answer 1\" }));\n *\n * // Resume the graph after second interrupt\n * await graph.stream(new Command({ resume: \"answer 2\" }));\n * // Final result: { myKey: \"answer 1 answer 2\" }\n * ```\n *\n * @throws {Error} If called outside the context of a graph\n * @throws {GraphInterrupt} When no resume value is available\n */\nexport declare function interrupt<I = unknown, R = any>(value: I): R;\ntype FilterAny<X> = (<T>() => T extends X ? 1 : 2) extends <T>() => (T extends any ? 1 : 2) ? never : X;\nexport type InferInterruptInputType<T> = T extends typeof interrupt<infer I, unknown> ? I : T extends {\n [key: string]: typeof interrupt<any, any>;\n} ? {\n [K in keyof T]: InferInterruptInputType<T[K]>;\n}[keyof T] : unknown;\nexport type InferInterruptResumeType<T, TInner = false> = T extends typeof interrupt<never, infer R> ? TInner extends true ? FilterAny<R> : R : T extends {\n [key: string]: typeof interrupt<any, any>;\n} ? {\n [K in keyof T]: InferInterruptResumeType<T[K], true>;\n}[keyof T] : unknown;\nexport {};\n"],"mappings":";;AA2CA;;;;;AAAqE;;;;;;;AAErE;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;iBAPwBA,uCAAuCC,IAAIC;KAC9DC,yBAAyBC,UAAUC,8BAA6BD,kCAAiCC;KAC1FC,6BAA6BF,iBAAiBJ,8BAA8BC,IAAIG;wBAClEJ;kBAEVI,IAAIE,wBAAwBF,EAAEG,YACtCH;KACII,8CAA8CJ,iBAAiBJ,4BAA4BS,sBAAsBN,UAAUD,KAAKA,IAAIE;wBACtHJ;kBAEVI,IAAII,yBAAyBJ,EAAEG,kBACvCH"}
1
+ {"version":3,"file":"interrupt.d.cts","names":[],"sources":["../src/interrupt.ts"],"mappings":";;AA8DA;;;;;;;;;;;AAkDC;;;;;;;;;;;;;;;;;;AASD;;;;;;;;;;;;;iBA3DgB,SAAA,sBAAA,CAAgC,KAAA,EAAO,CAAA,GAAI,CAAA;AAAA,KAoDtD,SAAA,gBAAyB,CAAA,SAAU,CAAA,6BAGjC,CAAA,iCAEH,CAAA;AAAA,KAEQ,uBAAA,MAA6B,CAAA,gBAAiB,SAAA,qBAItD,CAAA,GAEF,CAAA;EAAA,CAAa,GAAA,kBAAqB,SAAA;AAAA,kBAClB,CAAA,GAAI,uBAAA,CAAwB,CAAA,CAAE,CAAA,WAAY,CAAA;AAAA,KAGhD,wBAAA,sBAGR,CAAA,gBAAiB,SAAA,mBACjB,MAAA,gBACE,SAAA,CAAU,CAAA,IACV,CAAA,GAEJ,CAAA;EAAA,CAAa,GAAA,kBAAqB,SAAA;AAAA,kBAClB,CAAA,GAAI,wBAAA,CAAyB,CAAA,CAAE,CAAA,iBAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"interrupt.d.ts","names":["interrupt","I","R","FilterAny","T","X","InferInterruptInputType","K","InferInterruptResumeType","TInner"],"sources":["../src/interrupt.d.ts"],"sourcesContent":["/**\n * Interrupts the execution of a graph node.\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt. This will be available in task.interrupts[].value\n * @returns The `resume` value provided when the graph is re-invoked with a Command\n *\n * @example\n * ```typescript\n * // Define a node that uses multiple interrupts\n * const nodeWithInterrupts = () => {\n * // First interrupt - will pause execution and include {value: 1} in task values\n * const answer1 = interrupt({ value: 1 });\n *\n * // Second interrupt - only called after first interrupt is resumed\n * const answer2 = interrupt({ value: 2 });\n *\n * // Use the resume values\n * return { myKey: answer1 + \" \" + answer2 };\n * };\n *\n * // Resume the graph after first interrupt\n * await graph.stream(new Command({ resume: \"answer 1\" }));\n *\n * // Resume the graph after second interrupt\n * await graph.stream(new Command({ resume: \"answer 2\" }));\n * // Final result: { myKey: \"answer 1 answer 2\" }\n * ```\n *\n * @throws {Error} If called outside the context of a graph\n * @throws {GraphInterrupt} When no resume value is available\n */\nexport declare function interrupt<I = unknown, R = any>(value: I): R;\ntype FilterAny<X> = (<T>() => T extends X ? 1 : 2) extends <T>() => (T extends any ? 1 : 2) ? never : X;\nexport type InferInterruptInputType<T> = T extends typeof interrupt<infer I, unknown> ? I : T extends {\n [key: string]: typeof interrupt<any, any>;\n} ? {\n [K in keyof T]: InferInterruptInputType<T[K]>;\n}[keyof T] : unknown;\nexport type InferInterruptResumeType<T, TInner = false> = T extends typeof interrupt<never, infer R> ? TInner extends true ? FilterAny<R> : R : T extends {\n [key: string]: typeof interrupt<any, any>;\n} ? {\n [K in keyof T]: InferInterruptResumeType<T[K], true>;\n}[keyof T] : unknown;\nexport {};\n"],"mappings":";;AA2CA;;;;;AAAqE;;;;;;;AAErE;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;iBAPwBA,uCAAuCC,IAAIC;KAC9DC,yBAAyBC,UAAUC,8BAA6BD,kCAAiCC;KAC1FC,6BAA6BF,iBAAiBJ,8BAA8BC,IAAIG;wBAClEJ;kBAEVI,IAAIE,wBAAwBF,EAAEG,YACtCH;KACII,8CAA8CJ,iBAAiBJ,4BAA4BS,sBAAsBN,UAAUD,KAAKA,IAAIE;wBACtHJ;kBAEVI,IAAII,yBAAyBJ,EAAEG,kBACvCH"}
1
+ {"version":3,"file":"interrupt.d.ts","names":[],"sources":["../src/interrupt.ts"],"mappings":";;AA8DA;;;;;;;;;;;AAkDC;;;;;;;;;;;;;;;;;;AASD;;;;;;;;;;;;;iBA3DgB,SAAA,sBAAA,CAAgC,KAAA,EAAO,CAAA,GAAI,CAAA;AAAA,KAoDtD,SAAA,gBAAyB,CAAA,SAAU,CAAA,6BAGjC,CAAA,iCAEH,CAAA;AAAA,KAEQ,uBAAA,MAA6B,CAAA,gBAAiB,SAAA,qBAItD,CAAA,GAEF,CAAA;EAAA,CAAa,GAAA,kBAAqB,SAAA;AAAA,kBAClB,CAAA,GAAI,uBAAA,CAAwB,CAAA,CAAE,CAAA,WAAY,CAAA;AAAA,KAGhD,wBAAA,sBAGR,CAAA,gBAAiB,SAAA,mBACjB,MAAA,gBACE,SAAA,CAAU,CAAA,IACV,CAAA,GAEJ,CAAA;EAAA,CAAa,GAAA,kBAAqB,SAAA;AAAA,kBAClB,CAAA,GAAI,wBAAA,CAAyB,CAAA,CAAE,CAAA,iBAAkB,CAAA"}
@@ -3,23 +3,6 @@ import { LanguageModelLike } from "@langchain/core/language_models/base";
3
3
 
4
4
  //#region src/prebuilt/agentName.d.ts
5
5
  type AgentNameMode = "inline";
6
- /**
7
- * Attach formatted agent names to the messages passed to and from a language model.
8
- *
9
- * This is useful for making a message history with multiple agents more coherent.
10
- *
11
- * NOTE: agent name is consumed from the message.name field.
12
- * If you're using an agent built with createReactAgent, name is automatically set.
13
- * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.
14
- *
15
- * @deprecated migrated to `langchain` package.
16
- *
17
- * @param message - Message to add agent name formatting to
18
- * @returns Message with agent name formatting
19
- *
20
- * @internal
21
- */
22
-
23
6
  /**
24
7
  * Attach formatted agent names to the messages passed to and from a language model.
25
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agentName.d.cts","names":["LanguageModelLike","AIMessage","BaseMessage","BaseMessageLike","AgentNameMode","_addInlineAgentName","T","_removeInlineAgentName","withAgentName"],"sources":["../../src/prebuilt/agentName.d.ts"],"sourcesContent":["import { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { AIMessage, BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nexport type AgentNameMode = \"inline\";\n/**\n * Attach formatted agent names to the messages passed to and from a language model.\n *\n * This is useful for making a message history with multiple agents more coherent.\n *\n * NOTE: agent name is consumed from the message.name field.\n * If you're using an agent built with createReactAgent, name is automatically set.\n * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.\n *\n * @deprecated migrated to `langchain` package.\n *\n * @param message - Message to add agent name formatting to\n * @returns Message with agent name formatting\n *\n * @internal\n */\nexport declare function _addInlineAgentName<T extends BaseMessageLike>(message: T): T | AIMessage;\n/**\n * Remove explicit name and content XML tags from the AI message content.\n *\n * @deprecated migrated to `langchain` package.\n *\n * Examples:\n *\n * @example\n * ```typescript\n * removeInlineAgentName(new AIMessage({ content: \"<name>assistant</name><content>Hello</content>\", name: \"assistant\" }))\n * // AIMessage with content: \"Hello\"\n *\n * removeInlineAgentName(new AIMessage({ content: [{type: \"text\", text: \"<name>assistant</name><content>Hello</content>\"}], name: \"assistant\" }))\n * // AIMessage with content: [{type: \"text\", text: \"Hello\"}]\n * ```\n *\n * @internal\n */\nexport declare function _removeInlineAgentName<T extends BaseMessage>(message: T): T;\n/**\n * Attach formatted agent names to the messages passed to and from a language model.\n *\n * This is useful for making a message history with multiple agents more coherent.\n *\n * * @deprecated migrated to `langchain` package.\n *\n * NOTE: agent name is consumed from the message.name field.\n * If you're using an agent built with createReactAgent, name is automatically set.\n * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.\n *\n * @param model - Language model to add agent name formatting to\n * @param agentNameMode - How to expose the agent name to the LLM\n * - \"inline\": Add the agent name directly into the content field of the AI message using XML-style tags.\n * Example: \"How can I help you\" -> \"<name>agent_name</name><content>How can I help you?</content>\".\n */\nexport declare function withAgentName(model: LanguageModelLike, agentNameMode: AgentNameMode): LanguageModelLike;\n"],"mappings":";;;;KAEYI,aAAAA;;AAAZ;AAqDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwBI,aAAAA,QAAqBR,kCAAkCI,gBAAgBJ"}
1
+ {"version":3,"file":"agentName.d.cts","names":[],"sources":["../../src/prebuilt/agentName.ts"],"mappings":";;;;KAiBY,aAAA;;;;;;;;;;;;;;;;;iBA0LI,aAAA,CACd,KAAA,EAAO,iBAAA,EACP,aAAA,EAAe,aAAA,GACd,iBAAA"}
@@ -3,23 +3,6 @@ import { LanguageModelLike } from "@langchain/core/language_models/base";
3
3
 
4
4
  //#region src/prebuilt/agentName.d.ts
5
5
  type AgentNameMode = "inline";
6
- /**
7
- * Attach formatted agent names to the messages passed to and from a language model.
8
- *
9
- * This is useful for making a message history with multiple agents more coherent.
10
- *
11
- * NOTE: agent name is consumed from the message.name field.
12
- * If you're using an agent built with createReactAgent, name is automatically set.
13
- * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.
14
- *
15
- * @deprecated migrated to `langchain` package.
16
- *
17
- * @param message - Message to add agent name formatting to
18
- * @returns Message with agent name formatting
19
- *
20
- * @internal
21
- */
22
-
23
6
  /**
24
7
  * Attach formatted agent names to the messages passed to and from a language model.
25
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agentName.d.ts","names":["LanguageModelLike","AIMessage","BaseMessage","BaseMessageLike","AgentNameMode","_addInlineAgentName","T","_removeInlineAgentName","withAgentName"],"sources":["../../src/prebuilt/agentName.d.ts"],"sourcesContent":["import { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { AIMessage, BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nexport type AgentNameMode = \"inline\";\n/**\n * Attach formatted agent names to the messages passed to and from a language model.\n *\n * This is useful for making a message history with multiple agents more coherent.\n *\n * NOTE: agent name is consumed from the message.name field.\n * If you're using an agent built with createReactAgent, name is automatically set.\n * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.\n *\n * @deprecated migrated to `langchain` package.\n *\n * @param message - Message to add agent name formatting to\n * @returns Message with agent name formatting\n *\n * @internal\n */\nexport declare function _addInlineAgentName<T extends BaseMessageLike>(message: T): T | AIMessage;\n/**\n * Remove explicit name and content XML tags from the AI message content.\n *\n * @deprecated migrated to `langchain` package.\n *\n * Examples:\n *\n * @example\n * ```typescript\n * removeInlineAgentName(new AIMessage({ content: \"<name>assistant</name><content>Hello</content>\", name: \"assistant\" }))\n * // AIMessage with content: \"Hello\"\n *\n * removeInlineAgentName(new AIMessage({ content: [{type: \"text\", text: \"<name>assistant</name><content>Hello</content>\"}], name: \"assistant\" }))\n * // AIMessage with content: [{type: \"text\", text: \"Hello\"}]\n * ```\n *\n * @internal\n */\nexport declare function _removeInlineAgentName<T extends BaseMessage>(message: T): T;\n/**\n * Attach formatted agent names to the messages passed to and from a language model.\n *\n * This is useful for making a message history with multiple agents more coherent.\n *\n * * @deprecated migrated to `langchain` package.\n *\n * NOTE: agent name is consumed from the message.name field.\n * If you're using an agent built with createReactAgent, name is automatically set.\n * If you're building a custom agent, make sure to set the name on the AI message returned by the LLM.\n *\n * @param model - Language model to add agent name formatting to\n * @param agentNameMode - How to expose the agent name to the LLM\n * - \"inline\": Add the agent name directly into the content field of the AI message using XML-style tags.\n * Example: \"How can I help you\" -> \"<name>agent_name</name><content>How can I help you?</content>\".\n */\nexport declare function withAgentName(model: LanguageModelLike, agentNameMode: AgentNameMode): LanguageModelLike;\n"],"mappings":";;;;KAEYI,aAAAA;;AAAZ;AAqDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwBI,aAAAA,QAAqBR,kCAAkCI,gBAAgBJ"}
1
+ {"version":3,"file":"agentName.d.ts","names":[],"sources":["../../src/prebuilt/agentName.ts"],"mappings":";;;;KAiBY,aAAA;;;;;;;;;;;;;;;;;iBA0LI,aAAA,CACd,KAAA,EAAO,iBAAA,EACP,aAAA,EAAe,aAAA,GACd,iBAAA"}