@langchain/langgraph 1.1.4 → 1.2.0

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 (254) 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.cjs +13 -2
  8. package/dist/channels/binop.cjs.map +1 -1
  9. package/dist/channels/binop.d.cts +4 -2
  10. package/dist/channels/binop.d.cts.map +1 -1
  11. package/dist/channels/binop.d.ts +4 -2
  12. package/dist/channels/binop.d.ts.map +1 -1
  13. package/dist/channels/binop.js +14 -3
  14. package/dist/channels/binop.js.map +1 -1
  15. package/dist/channels/dynamic_barrier_value.d.cts +0 -10
  16. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
  17. package/dist/channels/dynamic_barrier_value.d.ts +0 -10
  18. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
  19. package/dist/channels/ephemeral_value.d.cts +0 -1
  20. package/dist/channels/ephemeral_value.d.cts.map +1 -1
  21. package/dist/channels/ephemeral_value.d.ts +0 -1
  22. package/dist/channels/ephemeral_value.d.ts.map +1 -1
  23. package/dist/channels/last_value.d.cts +0 -1
  24. package/dist/channels/last_value.d.cts.map +1 -1
  25. package/dist/channels/last_value.d.ts +0 -1
  26. package/dist/channels/last_value.d.ts.map +1 -1
  27. package/dist/channels/named_barrier_value.d.cts +0 -1
  28. package/dist/channels/named_barrier_value.d.cts.map +1 -1
  29. package/dist/channels/named_barrier_value.d.ts +0 -1
  30. package/dist/channels/named_barrier_value.d.ts.map +1 -1
  31. package/dist/channels/topic.d.cts +0 -1
  32. package/dist/channels/topic.d.cts.map +1 -1
  33. package/dist/channels/topic.d.ts +0 -1
  34. package/dist/channels/topic.d.ts.map +1 -1
  35. package/dist/channels/untracked_value.d.cts +0 -1
  36. package/dist/channels/untracked_value.d.cts.map +1 -1
  37. package/dist/channels/untracked_value.d.ts +0 -1
  38. package/dist/channels/untracked_value.d.ts.map +1 -1
  39. package/dist/constants.cjs +78 -0
  40. package/dist/constants.cjs.map +1 -1
  41. package/dist/constants.d.cts +49 -16
  42. package/dist/constants.d.cts.map +1 -1
  43. package/dist/constants.d.ts +49 -16
  44. package/dist/constants.d.ts.map +1 -1
  45. package/dist/constants.js +76 -1
  46. package/dist/constants.js.map +1 -1
  47. package/dist/errors.d.cts.map +1 -1
  48. package/dist/errors.d.ts.map +1 -1
  49. package/dist/func/index.cjs +1 -1
  50. package/dist/func/index.d.cts +1 -2
  51. package/dist/func/index.d.cts.map +1 -1
  52. package/dist/func/index.d.ts +1 -2
  53. package/dist/func/index.d.ts.map +1 -1
  54. package/dist/func/index.js +1 -1
  55. package/dist/func/types.d.cts +0 -11
  56. package/dist/func/types.d.cts.map +1 -1
  57. package/dist/func/types.d.ts +0 -11
  58. package/dist/func/types.d.ts.map +1 -1
  59. package/dist/graph/annotation.cjs.map +1 -1
  60. package/dist/graph/annotation.d.cts +3 -2
  61. package/dist/graph/annotation.d.cts.map +1 -1
  62. package/dist/graph/annotation.d.ts +3 -2
  63. package/dist/graph/annotation.d.ts.map +1 -1
  64. package/dist/graph/annotation.js.map +1 -1
  65. package/dist/graph/graph.cjs +3 -6
  66. package/dist/graph/graph.cjs.map +1 -1
  67. package/dist/graph/graph.d.cts +2 -2
  68. package/dist/graph/graph.d.cts.map +1 -1
  69. package/dist/graph/graph.d.ts +2 -2
  70. package/dist/graph/graph.d.ts.map +1 -1
  71. package/dist/graph/graph.js +3 -6
  72. package/dist/graph/graph.js.map +1 -1
  73. package/dist/graph/index.cjs +1 -1
  74. package/dist/graph/index.d.ts +7 -0
  75. package/dist/graph/index.js +1 -1
  76. package/dist/graph/message.d.cts +2 -2
  77. package/dist/graph/message.d.cts.map +1 -1
  78. package/dist/graph/message.d.ts +2 -2
  79. package/dist/graph/message.d.ts.map +1 -1
  80. package/dist/graph/messages_annotation.d.cts +3 -3
  81. package/dist/graph/messages_annotation.d.cts.map +1 -1
  82. package/dist/graph/messages_annotation.d.ts +4 -3
  83. package/dist/graph/messages_annotation.d.ts.map +1 -1
  84. package/dist/graph/messages_reducer.d.cts +0 -1
  85. package/dist/graph/messages_reducer.d.cts.map +1 -1
  86. package/dist/graph/messages_reducer.d.ts +0 -1
  87. package/dist/graph/messages_reducer.d.ts.map +1 -1
  88. package/dist/graph/state.cjs +1 -1
  89. package/dist/graph/state.d.cts +1 -1
  90. package/dist/graph/state.d.cts.map +1 -1
  91. package/dist/graph/state.d.ts +1 -1
  92. package/dist/graph/state.d.ts.map +1 -1
  93. package/dist/graph/state.js +1 -1
  94. package/dist/graph/types.cjs +1 -1
  95. package/dist/graph/types.d.cts +3 -19
  96. package/dist/graph/types.d.cts.map +1 -1
  97. package/dist/graph/types.d.ts +3 -19
  98. package/dist/graph/types.d.ts.map +1 -1
  99. package/dist/graph/types.js +1 -1
  100. package/dist/graph/zod/index.d.cts +1 -0
  101. package/dist/graph/zod/index.d.ts +1 -0
  102. package/dist/graph/zod/meta.cjs.map +1 -1
  103. package/dist/graph/zod/meta.d.cts +3 -2
  104. package/dist/graph/zod/meta.d.cts.map +1 -1
  105. package/dist/graph/zod/meta.d.ts +3 -2
  106. package/dist/graph/zod/meta.d.ts.map +1 -1
  107. package/dist/graph/zod/meta.js.map +1 -1
  108. package/dist/graph/zod/plugin.d.cts +30 -0
  109. package/dist/graph/zod/plugin.d.cts.map +1 -0
  110. package/dist/graph/zod/plugin.d.ts +30 -0
  111. package/dist/graph/zod/plugin.d.ts.map +1 -0
  112. package/dist/graph/zod/schema.d.cts +0 -1
  113. package/dist/graph/zod/schema.d.cts.map +1 -1
  114. package/dist/graph/zod/schema.d.ts +0 -1
  115. package/dist/graph/zod/schema.d.ts.map +1 -1
  116. package/dist/graph/zod/zod-registry.d.cts +0 -1
  117. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  118. package/dist/graph/zod/zod-registry.d.ts +0 -1
  119. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  120. package/dist/index.cjs +2 -1
  121. package/dist/index.d.cts +2 -2
  122. package/dist/index.d.ts +2 -2
  123. package/dist/index.js +2 -2
  124. package/dist/interrupt.cjs +1 -1
  125. package/dist/interrupt.d.cts.map +1 -1
  126. package/dist/interrupt.d.ts.map +1 -1
  127. package/dist/interrupt.js +1 -1
  128. package/dist/prebuilt/agentName.d.cts +0 -17
  129. package/dist/prebuilt/agentName.d.cts.map +1 -1
  130. package/dist/prebuilt/agentName.d.ts +0 -17
  131. package/dist/prebuilt/agentName.d.ts.map +1 -1
  132. package/dist/prebuilt/agent_executor.d.cts +5 -5
  133. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  134. package/dist/prebuilt/agent_executor.d.ts +6 -5
  135. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  136. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  137. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  138. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  139. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  140. package/dist/prebuilt/react_agent_executor.cjs +1 -1
  141. package/dist/prebuilt/react_agent_executor.d.cts +11 -17
  142. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  143. package/dist/prebuilt/react_agent_executor.d.ts +13 -17
  144. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  145. package/dist/prebuilt/react_agent_executor.js +1 -1
  146. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  147. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  148. package/dist/prebuilt/tool_node.cjs +1 -1
  149. package/dist/prebuilt/tool_node.d.cts +1 -1
  150. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  151. package/dist/prebuilt/tool_node.d.ts +1 -1
  152. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  153. package/dist/prebuilt/tool_node.js +1 -1
  154. package/dist/pregel/algo.cjs +1 -1
  155. package/dist/pregel/algo.d.cts +0 -1
  156. package/dist/pregel/algo.d.cts.map +1 -1
  157. package/dist/pregel/algo.d.ts +5 -1
  158. package/dist/pregel/algo.d.ts.map +1 -1
  159. package/dist/pregel/algo.js +1 -1
  160. package/dist/pregel/index.cjs +13 -1
  161. package/dist/pregel/index.cjs.map +1 -1
  162. package/dist/pregel/index.d.cts +2 -1
  163. package/dist/pregel/index.d.cts.map +1 -1
  164. package/dist/pregel/index.d.ts +2 -1
  165. package/dist/pregel/index.d.ts.map +1 -1
  166. package/dist/pregel/index.js +14 -2
  167. package/dist/pregel/index.js.map +1 -1
  168. package/dist/pregel/io.cjs +1 -1
  169. package/dist/pregel/io.js +1 -1
  170. package/dist/pregel/loop.cjs +1 -1
  171. package/dist/pregel/loop.js +1 -1
  172. package/dist/pregel/read.cjs +4 -1
  173. package/dist/pregel/read.cjs.map +1 -1
  174. package/dist/pregel/read.d.cts +0 -1
  175. package/dist/pregel/read.d.cts.map +1 -1
  176. package/dist/pregel/read.d.ts +1 -1
  177. package/dist/pregel/read.d.ts.map +1 -1
  178. package/dist/pregel/read.js +4 -1
  179. package/dist/pregel/read.js.map +1 -1
  180. package/dist/pregel/remote.cjs +1 -1
  181. package/dist/pregel/remote.d.cts.map +1 -1
  182. package/dist/pregel/remote.d.ts +2 -0
  183. package/dist/pregel/remote.d.ts.map +1 -1
  184. package/dist/pregel/remote.js +1 -1
  185. package/dist/pregel/retry.cjs +1 -1
  186. package/dist/pregel/retry.js +1 -1
  187. package/dist/pregel/runnable_types.d.cts.map +1 -1
  188. package/dist/pregel/runnable_types.d.ts.map +1 -1
  189. package/dist/pregel/runner.cjs +1 -1
  190. package/dist/pregel/runner.js +1 -1
  191. package/dist/pregel/stream.cjs +81 -0
  192. package/dist/pregel/stream.cjs.map +1 -1
  193. package/dist/pregel/stream.d.ts +3 -0
  194. package/dist/pregel/stream.js +81 -1
  195. package/dist/pregel/stream.js.map +1 -1
  196. package/dist/pregel/types.cjs.map +1 -1
  197. package/dist/pregel/types.d.cts +27 -9
  198. package/dist/pregel/types.d.cts.map +1 -1
  199. package/dist/pregel/types.d.ts +27 -9
  200. package/dist/pregel/types.d.ts.map +1 -1
  201. package/dist/pregel/types.js.map +1 -1
  202. package/dist/pregel/utils/config.d.cts +0 -1
  203. package/dist/pregel/utils/config.d.cts.map +1 -1
  204. package/dist/pregel/utils/config.d.ts +0 -1
  205. package/dist/pregel/utils/config.d.ts.map +1 -1
  206. package/dist/pregel/utils/index.d.cts +3 -7
  207. package/dist/pregel/utils/index.d.cts.map +1 -1
  208. package/dist/pregel/utils/index.d.ts +3 -7
  209. package/dist/pregel/utils/index.d.ts.map +1 -1
  210. package/dist/pregel/write.cjs +2 -1
  211. package/dist/pregel/write.cjs.map +1 -1
  212. package/dist/pregel/write.d.cts +1 -2
  213. package/dist/pregel/write.d.cts.map +1 -1
  214. package/dist/pregel/write.d.ts +1 -2
  215. package/dist/pregel/write.d.ts.map +1 -1
  216. package/dist/pregel/write.js +2 -1
  217. package/dist/pregel/write.js.map +1 -1
  218. package/dist/state/adapter.d.cts +0 -1
  219. package/dist/state/adapter.d.cts.map +1 -1
  220. package/dist/state/adapter.d.ts +0 -1
  221. package/dist/state/adapter.d.ts.map +1 -1
  222. package/dist/state/index.d.ts +7 -0
  223. package/dist/state/prebuilt/index.d.ts +1 -0
  224. package/dist/state/prebuilt/messages.d.cts +2 -2
  225. package/dist/state/prebuilt/messages.d.cts.map +1 -1
  226. package/dist/state/prebuilt/messages.d.ts +2 -2
  227. package/dist/state/prebuilt/messages.d.ts.map +1 -1
  228. package/dist/state/schema.cjs.map +1 -1
  229. package/dist/state/schema.d.cts +3 -2
  230. package/dist/state/schema.d.cts.map +1 -1
  231. package/dist/state/schema.d.ts +4 -2
  232. package/dist/state/schema.d.ts.map +1 -1
  233. package/dist/state/schema.js.map +1 -1
  234. package/dist/state/types.d.cts +0 -20
  235. package/dist/state/types.d.cts.map +1 -1
  236. package/dist/state/types.d.ts +0 -20
  237. package/dist/state/types.d.ts.map +1 -1
  238. package/dist/state/values/reduced.d.cts +0 -1
  239. package/dist/state/values/reduced.d.cts.map +1 -1
  240. package/dist/state/values/reduced.d.ts +0 -1
  241. package/dist/state/values/reduced.d.ts.map +1 -1
  242. package/dist/state/values/untracked.d.cts +0 -1
  243. package/dist/state/values/untracked.d.cts.map +1 -1
  244. package/dist/state/values/untracked.d.ts +0 -1
  245. package/dist/state/values/untracked.d.ts.map +1 -1
  246. package/dist/utils.d.cts.map +1 -1
  247. package/dist/utils.d.ts.map +1 -1
  248. package/dist/web.cjs +2 -1
  249. package/dist/web.d.cts +2 -2
  250. package/dist/web.d.ts +5 -2
  251. package/dist/web.js +2 -2
  252. package/dist/writer.d.cts.map +1 -1
  253. package/dist/writer.d.ts.map +1 -1
  254. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","names":[],"sources":["../../../src/graph/zod/meta.ts"],"sourcesContent":["import {\n InferInteropZodOutput,\n InteropZodObject,\n InteropZodType,\n getInteropZodObjectShape,\n extendInteropZodObject,\n getInteropZodDefaultGetter,\n interopZodObjectPartial,\n InteropZodObjectShape,\n isZodSchemaV3,\n getSchemaDescription,\n} from \"@langchain/core/utils/types\";\nimport { BaseChannel } from \"../../channels/base.js\";\nimport { BinaryOperatorAggregate } from \"../../channels/binop.js\";\nimport { LastValue } from \"../../channels/last_value.js\";\n\nexport const META_EXTRAS_DESCRIPTION_PREFIX = \"lg:\";\n\n/** @internal */\nexport type ReducedZodChannel<\n T extends InteropZodType,\n TReducerSchema extends InteropZodType\n> = T & {\n lg_reducer_schema: TReducerSchema;\n};\n\n/** @internal */\nexport type InteropZodToStateDefinition<\n T extends InteropZodObject,\n TShape = InteropZodObjectShape<T>\n> = {\n [key in keyof TShape]: TShape[key] extends ReducedZodChannel<\n infer Schema,\n infer ReducerSchema\n >\n ? Schema extends InteropZodType<infer V>\n ? ReducerSchema extends InteropZodType<infer U>\n ? BaseChannel<V, U>\n : never\n : never\n : TShape[key] extends InteropZodType<infer V, infer U>\n ? BaseChannel<V, U>\n : never;\n};\n\nexport type UpdateType<\n T extends InteropZodObject,\n TShape = InteropZodObjectShape<T>\n> = {\n [key in keyof TShape]?: TShape[key] extends ReducedZodChannel<\n infer Schema,\n infer ReducerSchema\n >\n ? Schema extends InteropZodType<unknown>\n ? ReducerSchema extends InteropZodType<infer U>\n ? U\n : never\n : never\n : TShape[key] extends InteropZodType<unknown, infer U>\n ? U\n : never;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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/**\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 class SchemaMetaRegistry {\n /**\n * Internal map storing schema metadata.\n * @internal\n */\n _map = new Map<InteropZodType, SchemaMeta>();\n\n /**\n * Cache for extended schemas.\n * @internal\n */\n _extensionCache = new Map<string, Map<InteropZodType, InteropZodType>>();\n\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>(\n schema: InteropZodType<TValue>\n ): SchemaMeta<TValue, TUpdate> | undefined {\n return this._map.get(schema);\n }\n\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>(\n schema: InteropZodType<TValue>,\n predicate: (\n meta: SchemaMeta<TValue, TUpdate> | undefined\n ) => SchemaMeta<TValue, TUpdate>\n ) {\n const existingMeta = this.get<TValue, TUpdate>(schema);\n this._map.set(schema, predicate(existingMeta));\n }\n\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 this._map.delete(schema);\n return this;\n }\n\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 return this._map.has(schema);\n }\n\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>(\n schema: T\n ): InteropZodToStateDefinition<T> {\n const channels = {} as Record<string, BaseChannel>;\n const shape = getInteropZodObjectShape(schema);\n for (const [key, channelSchema] of Object.entries(shape)) {\n const meta = this.get(channelSchema);\n if (meta?.reducer) {\n channels[key] = new BinaryOperatorAggregate<\n InferInteropZodOutput<typeof channelSchema>\n >(meta.reducer.fn, meta.default);\n } else {\n channels[key] = new LastValue(meta?.default);\n }\n }\n return channels as InteropZodToStateDefinition<T>;\n }\n\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>(\n schema: T,\n 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 }\n ): InteropZodObject {\n // If no effects are being applied, return the schema unchanged\n if (Object.keys(effects).length === 0) {\n return schema;\n }\n\n // Cache key is determined by looking at the effects that are being applied\n const cacheKey = Object.entries(effects)\n .filter(([, v]) => v === true)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([k, v]) => `${k}:${v}`)\n .join(\"|\");\n\n const cache = this._extensionCache.get(cacheKey) ?? new Map();\n if (cache.has(schema)) return cache.get(schema)! as T;\n\n let modifiedSchema: InteropZodObject = schema;\n\n if (\n effects.withReducerSchema ||\n effects.withJsonSchemaExtrasAsDescription\n ) {\n const newShapeEntries = Object.entries(\n getInteropZodObjectShape(schema)\n ).map(([key, schema]) => {\n const meta = this.get(schema);\n let outputSchema = effects.withReducerSchema\n ? meta?.reducer?.schema ?? schema\n : schema;\n if (\n effects.withJsonSchemaExtrasAsDescription &&\n meta?.jsonSchemaExtra\n ) {\n const description =\n getSchemaDescription(outputSchema) ?? getSchemaDescription(schema);\n const strExtras = JSON.stringify({\n ...meta.jsonSchemaExtra,\n description,\n });\n outputSchema = outputSchema.describe(\n `${META_EXTRAS_DESCRIPTION_PREFIX}${strExtras}`\n );\n }\n return [key, outputSchema];\n });\n modifiedSchema = extendInteropZodObject(\n schema,\n Object.fromEntries(newShapeEntries)\n );\n if (isZodSchemaV3(modifiedSchema)) {\n modifiedSchema._def.unknownKeys = \"strip\";\n }\n }\n if (effects.asPartial) {\n modifiedSchema = interopZodObjectPartial(modifiedSchema);\n }\n\n cache.set(schema, modifiedSchema);\n this._extensionCache.set(cacheKey, cache);\n return modifiedSchema;\n }\n}\n\nexport const schemaMetaRegistry = new SchemaMetaRegistry();\n\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate> & { reducer?: undefined }\n): TSchema;\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate>\n): ReducedZodChannel<TSchema, InteropZodType<TUpdate>>;\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate>\n): ReducedZodChannel<TSchema, InteropZodType<TUpdate>> | TSchema {\n if (meta.reducer && !meta.default) {\n const defaultValueGetter = getInteropZodDefaultGetter(schema);\n if (defaultValueGetter != null) {\n // eslint-disable-next-line no-param-reassign\n meta.default = defaultValueGetter;\n }\n }\n if (meta.reducer) {\n const schemaWithReducer = Object.assign(schema, {\n lg_reducer_schema: meta.reducer?.schema ?? schema,\n });\n schemaMetaRegistry.extend(schemaWithReducer, () => meta);\n return schemaWithReducer;\n } else {\n schemaMetaRegistry.extend(schema, () => meta);\n return schema;\n }\n}\n"],"mappings":";;;;;AAgBA,MAAa,iCAAiC;;;;;AAiE9C,IAAa,qBAAb,MAAgC;;;;;CAK9B,uBAAO,IAAI,KAAiC;;;;;CAM5C,kCAAkB,IAAI,KAAkD;;;;;;;;CASxE,IACE,QACyC;AACzC,SAAO,KAAK,KAAK,IAAI,OAAO;;;;;;;;;CAU9B,OACE,QACA,WAGA;EACA,MAAM,eAAe,KAAK,IAAqB,OAAO;AACtD,OAAK,KAAK,IAAI,QAAQ,UAAU,aAAa,CAAC;;;;;;;CAQhD,OAAO,QAA8B;AACnC,OAAK,KAAK,OAAO,OAAO;AACxB,SAAO;;;;;;;CAQT,IAAI,QAAiC;AACnC,SAAO,KAAK,KAAK,IAAI,OAAO;;;;;;;;;;;;CAa9B,qBACE,QACgC;EAChC,MAAM,WAAW,EAAE;EACnB,MAAM,QAAQ,yBAAyB,OAAO;AAC9C,OAAK,MAAM,CAAC,KAAK,kBAAkB,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UACV,kBAAiB,wBAAwB,eAAe;AAG1D,QAAM,IAAI,QAAQ,eAAe;AACjC,OAAK,gBAAgB,IAAI,UAAU,MAAM;AACzC,SAAO;;;AAIX,MAAa,qBAAqB,IAAI,oBAAoB;AAkB1D,SAAgB,cAKd,QACA,MAC+D;AAC/D,KAAI,KAAK,WAAW,CAAC,KAAK,SAAS;EACjC,MAAM,qBAAqB,2BAA2B,OAAO;AAC7D,MAAI,sBAAsB,KAExB,MAAK,UAAU;;AAGnB,KAAI,KAAK,SAAS;EAChB,MAAM,oBAAoB,OAAO,OAAO,QAAQ,EAC9C,mBAAmB,KAAK,SAAS,UAAU,QAC5C,CAAC;AACF,qBAAmB,OAAO,yBAAyB,KAAK;AACxD,SAAO;QACF;AACL,qBAAmB,OAAO,cAAc,KAAK;AAC7C,SAAO"}
1
+ {"version":3,"file":"meta.js","names":[],"sources":["../../../src/graph/zod/meta.ts"],"sourcesContent":["import {\n InferInteropZodOutput,\n InteropZodObject,\n InteropZodType,\n getInteropZodObjectShape,\n extendInteropZodObject,\n getInteropZodDefaultGetter,\n interopZodObjectPartial,\n InteropZodObjectShape,\n isZodSchemaV3,\n getSchemaDescription,\n} from \"@langchain/core/utils/types\";\nimport { BaseChannel } from \"../../channels/base.js\";\nimport { BinaryOperatorAggregate } from \"../../channels/binop.js\";\nimport { LastValue } from \"../../channels/last_value.js\";\nimport type { OverwriteValue } from \"../../constants.js\";\n\nexport const META_EXTRAS_DESCRIPTION_PREFIX = \"lg:\";\n\n/** @internal */\nexport type ReducedZodChannel<\n T extends InteropZodType,\n TReducerSchema extends InteropZodType\n> = T & {\n lg_reducer_schema: TReducerSchema;\n};\n\n/** @internal */\nexport type InteropZodToStateDefinition<\n T extends InteropZodObject,\n TShape = InteropZodObjectShape<T>\n> = {\n [key in keyof TShape]: TShape[key] extends ReducedZodChannel<\n infer Schema,\n infer ReducerSchema\n >\n ? Schema extends InteropZodType<infer V>\n ? ReducerSchema extends InteropZodType<infer U>\n ? BaseChannel<V, OverwriteValue<V> | U>\n : never\n : never\n : TShape[key] extends InteropZodType<infer V, infer U>\n ? BaseChannel<V, U>\n : never;\n};\n\nexport type UpdateType<\n T extends InteropZodObject,\n TShape = InteropZodObjectShape<T>\n> = {\n [key in keyof TShape]?: TShape[key] extends ReducedZodChannel<\n infer Schema,\n infer ReducerSchema\n >\n ? Schema extends InteropZodType<infer V>\n ? ReducerSchema extends InteropZodType<infer U>\n ? OverwriteValue<V> | U\n : never\n : never\n : TShape[key] extends InteropZodType<unknown, infer U>\n ? U\n : never;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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/**\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 class SchemaMetaRegistry {\n /**\n * Internal map storing schema metadata.\n * @internal\n */\n _map = new Map<InteropZodType, SchemaMeta>();\n\n /**\n * Cache for extended schemas.\n * @internal\n */\n _extensionCache = new Map<string, Map<InteropZodType, InteropZodType>>();\n\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>(\n schema: InteropZodType<TValue>\n ): SchemaMeta<TValue, TUpdate> | undefined {\n return this._map.get(schema);\n }\n\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>(\n schema: InteropZodType<TValue>,\n predicate: (\n meta: SchemaMeta<TValue, TUpdate> | undefined\n ) => SchemaMeta<TValue, TUpdate>\n ) {\n const existingMeta = this.get<TValue, TUpdate>(schema);\n this._map.set(schema, predicate(existingMeta));\n }\n\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 this._map.delete(schema);\n return this;\n }\n\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 return this._map.has(schema);\n }\n\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>(\n schema: T\n ): InteropZodToStateDefinition<T> {\n const channels = {} as Record<string, BaseChannel>;\n const shape = getInteropZodObjectShape(schema);\n for (const [key, channelSchema] of Object.entries(shape)) {\n const meta = this.get(channelSchema);\n if (meta?.reducer) {\n channels[key] = new BinaryOperatorAggregate<\n InferInteropZodOutput<typeof channelSchema>\n >(meta.reducer.fn, meta.default);\n } else {\n channels[key] = new LastValue(meta?.default);\n }\n }\n return channels as InteropZodToStateDefinition<T>;\n }\n\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>(\n schema: T,\n 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 }\n ): InteropZodObject {\n // If no effects are being applied, return the schema unchanged\n if (Object.keys(effects).length === 0) {\n return schema;\n }\n\n // Cache key is determined by looking at the effects that are being applied\n const cacheKey = Object.entries(effects)\n .filter(([, v]) => v === true)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([k, v]) => `${k}:${v}`)\n .join(\"|\");\n\n const cache = this._extensionCache.get(cacheKey) ?? new Map();\n if (cache.has(schema)) return cache.get(schema)! as T;\n\n let modifiedSchema: InteropZodObject = schema;\n\n if (\n effects.withReducerSchema ||\n effects.withJsonSchemaExtrasAsDescription\n ) {\n const newShapeEntries = Object.entries(\n getInteropZodObjectShape(schema)\n ).map(([key, schema]) => {\n const meta = this.get(schema);\n let outputSchema = effects.withReducerSchema\n ? meta?.reducer?.schema ?? schema\n : schema;\n if (\n effects.withJsonSchemaExtrasAsDescription &&\n meta?.jsonSchemaExtra\n ) {\n const description =\n getSchemaDescription(outputSchema) ?? getSchemaDescription(schema);\n const strExtras = JSON.stringify({\n ...meta.jsonSchemaExtra,\n description,\n });\n outputSchema = outputSchema.describe(\n `${META_EXTRAS_DESCRIPTION_PREFIX}${strExtras}`\n );\n }\n return [key, outputSchema];\n });\n modifiedSchema = extendInteropZodObject(\n schema,\n Object.fromEntries(newShapeEntries)\n );\n if (isZodSchemaV3(modifiedSchema)) {\n modifiedSchema._def.unknownKeys = \"strip\";\n }\n }\n if (effects.asPartial) {\n modifiedSchema = interopZodObjectPartial(modifiedSchema);\n }\n\n cache.set(schema, modifiedSchema);\n this._extensionCache.set(cacheKey, cache);\n return modifiedSchema;\n }\n}\n\nexport const schemaMetaRegistry = new SchemaMetaRegistry();\n\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate> & { reducer?: undefined }\n): TSchema;\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate>\n): ReducedZodChannel<TSchema, InteropZodType<TUpdate>>;\nexport function withLangGraph<\n TValue,\n TUpdate,\n TSchema extends InteropZodType<TValue>\n>(\n schema: TSchema,\n meta: SchemaMeta<TValue, TUpdate>\n): ReducedZodChannel<TSchema, InteropZodType<TUpdate>> | TSchema {\n if (meta.reducer && !meta.default) {\n const defaultValueGetter = getInteropZodDefaultGetter(schema);\n if (defaultValueGetter != null) {\n // eslint-disable-next-line no-param-reassign\n meta.default = defaultValueGetter;\n }\n }\n if (meta.reducer) {\n const schemaWithReducer = Object.assign(schema, {\n lg_reducer_schema: meta.reducer?.schema ?? schema,\n });\n schemaMetaRegistry.extend(schemaWithReducer, () => meta);\n return schemaWithReducer;\n } else {\n schemaMetaRegistry.extend(schema, () => meta);\n return schema;\n }\n}\n"],"mappings":";;;;;AAiBA,MAAa,iCAAiC;;;;;AAiE9C,IAAa,qBAAb,MAAgC;;;;;CAK9B,uBAAO,IAAI,KAAiC;;;;;CAM5C,kCAAkB,IAAI,KAAkD;;;;;;;;CASxE,IACE,QACyC;AACzC,SAAO,KAAK,KAAK,IAAI,OAAO;;;;;;;;;CAU9B,OACE,QACA,WAGA;EACA,MAAM,eAAe,KAAK,IAAqB,OAAO;AACtD,OAAK,KAAK,IAAI,QAAQ,UAAU,aAAa,CAAC;;;;;;;CAQhD,OAAO,QAA8B;AACnC,OAAK,KAAK,OAAO,OAAO;AACxB,SAAO;;;;;;;CAQT,IAAI,QAAiC;AACnC,SAAO,KAAK,KAAK,IAAI,OAAO;;;;;;;;;;;;CAa9B,qBACE,QACgC;EAChC,MAAM,WAAW,EAAE;EACnB,MAAM,QAAQ,yBAAyB,OAAO;AAC9C,OAAK,MAAM,CAAC,KAAK,kBAAkB,OAAO,QAAQ,MAAM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wB,eAAe;AAG1D,QAAM,IAAI,QAAQ,eAAe;AACjC,OAAK,gBAAgB,IAAI,UAAU,MAAM;AACzC,SAAO;;;AAIX,MAAa,qBAAqB,IAAI,oBAAoB;AAkB1D,SAAgB,cAKd,QACA,MAC+D;AAC/D,KAAI,KAAK,WAAW,CAAC,KAAK,SAAS;EACjC,MAAM,qBAAqB,2BAA2B,OAAO;AAC7D,MAAI,sBAAsB,KAExB,MAAK,UAAU;;AAGnB,KAAI,KAAK,SAAS;EAChB,MAAM,oBAAoB,OAAO,OAAO,QAAQ,EAC9C,mBAAmB,KAAK,SAAS,UAAU,QAC5C,CAAC;AACF,qBAAmB,OAAO,yBAAyB,KAAK;AACxD,SAAO;QACF;AACL,qBAAmB,OAAO,cAAc,KAAK;AAC7C,SAAO"}
@@ -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,MAAAA,EALSG,kBAKTH;KAdiHD,CAAAA,UAU9GO,MAV8GP,CAAAA,CAAAA,MAAAA,EAU9FQ,CAV8FR,EAAAA,GAAAA,KAAAA,EAAAA,SAAAA,SAU/DM,IAV+DN,GAAAA;IAAY,CAAA,GAAA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AAkB,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","_1","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","_2","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,C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AS,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"}
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_async_local_storage = require('./setup/async_local_storage.cjs');
3
+ const require_constants = require('./constants.cjs');
3
4
  const require_errors = require('./errors.cjs');
4
5
  const require_base = require('./channels/base.cjs');
5
6
  const require_binop = require('./channels/binop.cjs');
6
7
  const require_annotation = require('./graph/annotation.cjs');
7
- const require_constants = require('./constants.cjs');
8
8
  const require_config = require('./pregel/utils/config.cjs');
9
9
  const require_interrupt = require('./interrupt.cjs');
10
10
  const require_graph = require('./graph/graph.cjs');
@@ -81,6 +81,7 @@ exports.MessagesZodMeta = require_messages_annotation.MessagesZodMeta;
81
81
  exports.MessagesZodState = require_messages_annotation.MessagesZodState;
82
82
  exports.MultipleSubgraphsError = require_errors.MultipleSubgraphsError;
83
83
  exports.NodeInterrupt = require_errors.NodeInterrupt;
84
+ exports.Overwrite = require_constants.Overwrite;
84
85
  exports.ParentCommand = require_errors.ParentCommand;
85
86
  exports.REMOVE_ALL_MESSAGES = require_messages_reducer.REMOVE_ALL_MESSAGES;
86
87
  exports.ReducedValue = require_reduced.ReducedValue;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.cjs";
2
+ import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.cjs";
2
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.cjs";
3
4
  import { AnyValue } from "./channels/any_value.cjs";
4
5
  import { LastValue } from "./channels/last_value.cjs";
@@ -11,7 +12,6 @@ import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.cjs";
11
12
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.cjs";
12
13
  import { RetryPolicy } from "./pregel/utils/index.cjs";
13
14
  import { PregelNode } from "./pregel/read.cjs";
14
- import { Command, CommandParams, END, INTERRUPT, Interrupt, START, Send, isCommand, isInterrupted } from "./constants.cjs";
15
15
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.cjs";
16
16
  import { Pregel } from "./pregel/index.cjs";
17
17
  import { CompiledGraph, Graph } from "./graph/graph.cjs";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.cjs";
33
33
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.cjs";
34
34
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
35
+ export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BaseChannel } from "./channels/base.js";
2
+ import { Command, CommandParams, END, INTERRUPT, Interrupt, Overwrite, OverwriteValue, START, Send, isCommand, isInterrupted } from "./constants.js";
2
3
  import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.js";
3
4
  import { AnyValue } from "./channels/any_value.js";
4
5
  import { LastValue } from "./channels/last_value.js";
@@ -11,7 +12,6 @@ import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.js";
11
12
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
12
13
  import { RetryPolicy } from "./pregel/utils/index.js";
13
14
  import { PregelNode } from "./pregel/read.js";
14
- import { Command, CommandParams, END, INTERRUPT, Interrupt, START, Send, isCommand, isInterrupted } from "./constants.js";
15
15
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.js";
16
16
  import { Pregel } from "./pregel/index.js";
17
17
  import { CompiledGraph, Graph } from "./graph/graph.js";
@@ -32,4 +32,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
32
32
  import { MessagesValue } from "./state/prebuilt/messages.js";
33
33
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.js";
34
34
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
35
- export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
35
+ export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, ExtractStateType, ExtractUpdateType, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphNode, GraphNodeReturnValue, GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, Overwrite, OverwriteValue, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateDefinitionInit, StateGraph, StateGraphArgs, StateGraphInit, StateGraphInputError, StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { initializeAsyncLocalStorageSingleton } from "./setup/async_local_storage.js";
2
+ import { Command, END, INTERRUPT, Overwrite, START, Send, isCommand, isInterrupted } from "./constants.js";
2
3
  import { BaseLangGraphError, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
3
4
  import { BaseChannel } from "./channels/base.js";
4
5
  import { BinaryOperatorAggregate } from "./channels/binop.js";
5
6
  import { Annotation } from "./graph/annotation.js";
6
- import { Command, END, INTERRUPT, START, Send, isCommand, isInterrupted } from "./constants.js";
7
7
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
8
8
  import { interrupt } from "./interrupt.js";
9
9
  import { Graph } from "./graph/graph.js";
@@ -26,5 +26,5 @@ import { writer } from "./writer.js";
26
26
  initializeAsyncLocalStorageSingleton();
27
27
 
28
28
  //#endregion
29
- export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, Command, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
29
+ export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, Command, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, START, Send, StateGraph, StateGraphInputError, StateSchema, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, pushMessage, task, writer };
30
30
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- const require_errors = require('./errors.cjs');
2
1
  const require_constants = require('./constants.cjs');
2
+ const require_errors = require('./errors.cjs');
3
3
  const require_hash = require('./hash.cjs');
4
4
  let _langchain_core_singletons = require("@langchain/core/singletons");
5
5
 
@@ -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"}
package/dist/interrupt.js CHANGED
@@ -1,5 +1,5 @@
1
- import { GraphInterrupt, GraphValueError } from "./errors.js";
2
1
  import { CHECKPOINT_NAMESPACE_SEPARATOR, CONFIG_KEY_CHECKPOINTER, CONFIG_KEY_CHECKPOINT_NS, CONFIG_KEY_SCRATCHPAD, CONFIG_KEY_SEND, RESUME } from "./constants.js";
2
+ import { GraphInterrupt, GraphValueError } from "./errors.js";
3
3
  import { XXH3 } from "./hash.js";
4
4
  import { AsyncLocalStorageProviderSingleton } from "@langchain/core/singletons";
5
5
 
@@ -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"}
@@ -3,7 +3,7 @@ import { StateDefinition } from "../graph/annotation.cjs";
3
3
  import { CompiledStateGraph } from "../graph/state.cjs";
4
4
  import { ToolExecutor } from "./tool_executor.cjs";
5
5
  import { Runnable } from "@langchain/core/runnables";
6
- import * as _langchain_core_messages23 from "@langchain/core/messages";
6
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
7
7
  import { BaseMessage } from "@langchain/core/messages";
8
8
  import { AgentAction, AgentFinish } from "@langchain/core/agents";
9
9
  import { Tool } from "@langchain/core/tools";
@@ -31,22 +31,22 @@ declare function createAgentExecutor({
31
31
  agentOutcome?: AgentAction | AgentFinish | undefined;
32
32
  steps: Step[];
33
33
  input: string;
34
- chatHistory?: BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined;
34
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
35
35
  }, {
36
36
  agentOutcome?: AgentAction | AgentFinish | undefined;
37
37
  steps?: Step[] | undefined;
38
38
  input?: string | undefined;
39
- chatHistory?: BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined;
39
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
40
40
  }, "__start__" | "action" | "agent", {
41
41
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
42
42
  steps: BaseChannel<Step[], Step[], unknown>;
43
43
  input: BaseChannel<string, string, unknown>;
44
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined, BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined, unknown> | undefined;
44
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
45
45
  }, {
46
46
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
47
47
  steps: BaseChannel<Step[], Step[], unknown>;
48
48
  input: BaseChannel<string, string, unknown>;
49
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined, BaseMessage<_langchain_core_messages23.MessageStructure<_langchain_core_messages23.MessageToolSet>, _langchain_core_messages23.MessageType>[] | undefined, unknown> | undefined;
49
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
50
50
  }, StateDefinition, {
51
51
  action: Partial<AgentExecutorState>;
52
52
  agent: {
@@ -1 +1 @@
1
- {"version":3,"file":"agent_executor.d.cts","names":["___web_js6","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages23","MessageToolSet","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;EAAW,WAAA,CAAA,EAQnBC,WARmB,EAAA;AAIrC;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAAcC,EAOdE,QAPcF;OAChBM,EAONE,KAPMF,CAOAH,IAPAG,CAAAA,GAOQF,YAPRE;IA6BER,kBA7BRU,CAAAA;cAEOP,CAAAA,EAOCF,WAPDE,GAOeD,WAPfC,GAAAA,SAAAA;EAAW,KAAA,EAQlBK,IARkB,EAAA;EAGLG,KAAAA,EAAAA,MAAAA;EAAmB,WA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}
@@ -1,9 +1,10 @@
1
1
  import { BaseChannel } from "../channels/base.js";
2
2
  import { StateDefinition } from "../graph/annotation.js";
3
3
  import { CompiledStateGraph } from "../graph/state.js";
4
+ import "../web.js";
4
5
  import { ToolExecutor } from "./tool_executor.js";
5
6
  import { Runnable } from "@langchain/core/runnables";
6
- import * as _langchain_core_messages17 from "@langchain/core/messages";
7
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
7
8
  import { BaseMessage } from "@langchain/core/messages";
8
9
  import { AgentAction, AgentFinish } from "@langchain/core/agents";
9
10
  import { Tool } from "@langchain/core/tools";
@@ -31,22 +32,22 @@ declare function createAgentExecutor({
31
32
  agentOutcome?: AgentAction | AgentFinish | undefined;
32
33
  steps: Step[];
33
34
  input: string;
34
- chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
35
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
35
36
  }, {
36
37
  agentOutcome?: AgentAction | AgentFinish | undefined;
37
38
  steps?: Step[] | undefined;
38
39
  input?: string | undefined;
39
- chatHistory?: BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined;
40
+ chatHistory?: BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined;
40
41
  }, "__start__" | "action" | "agent", {
41
42
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
42
43
  steps: BaseChannel<Step[], Step[], unknown>;
43
44
  input: BaseChannel<string, string, unknown>;
44
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
45
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
45
46
  }, {
46
47
  agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
47
48
  steps: BaseChannel<Step[], Step[], unknown>;
48
49
  input: BaseChannel<string, string, unknown>;
49
- chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, BaseMessage<_langchain_core_messages17.MessageStructure<_langchain_core_messages17.MessageToolSet>, _langchain_core_messages17.MessageType>[] | undefined, unknown> | undefined;
50
+ chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[] | undefined, unknown> | undefined;
50
51
  }, StateDefinition, {
51
52
  action: Partial<AgentExecutorState>;
52
53
  agent: {