@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.
- package/dist/channels/any_value.d.cts +0 -1
- package/dist/channels/any_value.d.cts.map +1 -1
- package/dist/channels/any_value.d.ts +0 -1
- package/dist/channels/any_value.d.ts.map +1 -1
- package/dist/channels/base.d.cts.map +1 -1
- package/dist/channels/base.d.ts.map +1 -1
- package/dist/channels/binop.cjs +13 -2
- package/dist/channels/binop.cjs.map +1 -1
- package/dist/channels/binop.d.cts +4 -2
- package/dist/channels/binop.d.cts.map +1 -1
- package/dist/channels/binop.d.ts +4 -2
- package/dist/channels/binop.d.ts.map +1 -1
- package/dist/channels/binop.js +14 -3
- package/dist/channels/binop.js.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.cts +0 -10
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.ts +0 -10
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
- package/dist/channels/ephemeral_value.d.cts +0 -1
- package/dist/channels/ephemeral_value.d.cts.map +1 -1
- package/dist/channels/ephemeral_value.d.ts +0 -1
- package/dist/channels/ephemeral_value.d.ts.map +1 -1
- package/dist/channels/last_value.d.cts +0 -1
- package/dist/channels/last_value.d.cts.map +1 -1
- package/dist/channels/last_value.d.ts +0 -1
- package/dist/channels/last_value.d.ts.map +1 -1
- package/dist/channels/named_barrier_value.d.cts +0 -1
- package/dist/channels/named_barrier_value.d.cts.map +1 -1
- package/dist/channels/named_barrier_value.d.ts +0 -1
- package/dist/channels/named_barrier_value.d.ts.map +1 -1
- package/dist/channels/topic.d.cts +0 -1
- package/dist/channels/topic.d.cts.map +1 -1
- package/dist/channels/topic.d.ts +0 -1
- package/dist/channels/topic.d.ts.map +1 -1
- package/dist/channels/untracked_value.d.cts +0 -1
- package/dist/channels/untracked_value.d.cts.map +1 -1
- package/dist/channels/untracked_value.d.ts +0 -1
- package/dist/channels/untracked_value.d.ts.map +1 -1
- package/dist/constants.cjs +78 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +49 -16
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +49 -16
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +76 -1
- package/dist/constants.js.map +1 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/func/index.cjs +1 -1
- package/dist/func/index.d.cts +1 -2
- package/dist/func/index.d.cts.map +1 -1
- package/dist/func/index.d.ts +1 -2
- package/dist/func/index.d.ts.map +1 -1
- package/dist/func/index.js +1 -1
- package/dist/func/types.d.cts +0 -11
- package/dist/func/types.d.cts.map +1 -1
- package/dist/func/types.d.ts +0 -11
- package/dist/func/types.d.ts.map +1 -1
- package/dist/graph/annotation.cjs.map +1 -1
- package/dist/graph/annotation.d.cts +3 -2
- package/dist/graph/annotation.d.cts.map +1 -1
- package/dist/graph/annotation.d.ts +3 -2
- package/dist/graph/annotation.d.ts.map +1 -1
- package/dist/graph/annotation.js.map +1 -1
- package/dist/graph/graph.cjs +3 -6
- package/dist/graph/graph.cjs.map +1 -1
- package/dist/graph/graph.d.cts +2 -2
- package/dist/graph/graph.d.cts.map +1 -1
- package/dist/graph/graph.d.ts +2 -2
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +3 -6
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/index.cjs +1 -1
- package/dist/graph/index.d.ts +7 -0
- package/dist/graph/index.js +1 -1
- package/dist/graph/message.d.cts +2 -2
- package/dist/graph/message.d.cts.map +1 -1
- package/dist/graph/message.d.ts +2 -2
- package/dist/graph/message.d.ts.map +1 -1
- package/dist/graph/messages_annotation.d.cts +3 -3
- package/dist/graph/messages_annotation.d.cts.map +1 -1
- package/dist/graph/messages_annotation.d.ts +4 -3
- package/dist/graph/messages_annotation.d.ts.map +1 -1
- package/dist/graph/messages_reducer.d.cts +0 -1
- package/dist/graph/messages_reducer.d.cts.map +1 -1
- package/dist/graph/messages_reducer.d.ts +0 -1
- package/dist/graph/messages_reducer.d.ts.map +1 -1
- package/dist/graph/state.cjs +1 -1
- package/dist/graph/state.d.cts +1 -1
- package/dist/graph/state.d.cts.map +1 -1
- package/dist/graph/state.d.ts +1 -1
- package/dist/graph/state.d.ts.map +1 -1
- package/dist/graph/state.js +1 -1
- package/dist/graph/types.cjs +1 -1
- package/dist/graph/types.d.cts +3 -19
- package/dist/graph/types.d.cts.map +1 -1
- package/dist/graph/types.d.ts +3 -19
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/types.js +1 -1
- package/dist/graph/zod/index.d.cts +1 -0
- package/dist/graph/zod/index.d.ts +1 -0
- package/dist/graph/zod/meta.cjs.map +1 -1
- package/dist/graph/zod/meta.d.cts +3 -2
- package/dist/graph/zod/meta.d.cts.map +1 -1
- package/dist/graph/zod/meta.d.ts +3 -2
- package/dist/graph/zod/meta.d.ts.map +1 -1
- package/dist/graph/zod/meta.js.map +1 -1
- package/dist/graph/zod/plugin.d.cts +30 -0
- package/dist/graph/zod/plugin.d.cts.map +1 -0
- package/dist/graph/zod/plugin.d.ts +30 -0
- package/dist/graph/zod/plugin.d.ts.map +1 -0
- package/dist/graph/zod/schema.d.cts +0 -1
- package/dist/graph/zod/schema.d.cts.map +1 -1
- package/dist/graph/zod/schema.d.ts +0 -1
- package/dist/graph/zod/schema.d.ts.map +1 -1
- package/dist/graph/zod/zod-registry.d.cts +0 -1
- package/dist/graph/zod/zod-registry.d.cts.map +1 -1
- package/dist/graph/zod/zod-registry.d.ts +0 -1
- package/dist/graph/zod/zod-registry.d.ts.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/interrupt.cjs +1 -1
- package/dist/interrupt.d.cts.map +1 -1
- package/dist/interrupt.d.ts.map +1 -1
- package/dist/interrupt.js +1 -1
- package/dist/prebuilt/agentName.d.cts +0 -17
- package/dist/prebuilt/agentName.d.cts.map +1 -1
- package/dist/prebuilt/agentName.d.ts +0 -17
- package/dist/prebuilt/agentName.d.ts.map +1 -1
- package/dist/prebuilt/agent_executor.d.cts +5 -5
- package/dist/prebuilt/agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/agent_executor.d.ts +6 -5
- package/dist/prebuilt/agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/interrupt.d.cts.map +1 -1
- package/dist/prebuilt/interrupt.d.ts.map +1 -1
- package/dist/prebuilt/react_agent_executor.cjs +1 -1
- package/dist/prebuilt/react_agent_executor.d.cts +11 -17
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.ts +13 -17
- package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/react_agent_executor.js +1 -1
- package/dist/prebuilt/tool_executor.d.cts.map +1 -1
- package/dist/prebuilt/tool_executor.d.ts.map +1 -1
- package/dist/prebuilt/tool_node.cjs +1 -1
- package/dist/prebuilt/tool_node.d.cts +1 -1
- package/dist/prebuilt/tool_node.d.cts.map +1 -1
- package/dist/prebuilt/tool_node.d.ts +1 -1
- package/dist/prebuilt/tool_node.d.ts.map +1 -1
- package/dist/prebuilt/tool_node.js +1 -1
- package/dist/pregel/algo.cjs +1 -1
- package/dist/pregel/algo.d.cts +0 -1
- package/dist/pregel/algo.d.cts.map +1 -1
- package/dist/pregel/algo.d.ts +5 -1
- package/dist/pregel/algo.d.ts.map +1 -1
- package/dist/pregel/algo.js +1 -1
- package/dist/pregel/index.cjs +13 -1
- package/dist/pregel/index.cjs.map +1 -1
- package/dist/pregel/index.d.cts +2 -1
- package/dist/pregel/index.d.cts.map +1 -1
- package/dist/pregel/index.d.ts +2 -1
- package/dist/pregel/index.d.ts.map +1 -1
- package/dist/pregel/index.js +14 -2
- package/dist/pregel/index.js.map +1 -1
- package/dist/pregel/io.cjs +1 -1
- package/dist/pregel/io.js +1 -1
- package/dist/pregel/loop.cjs +1 -1
- package/dist/pregel/loop.js +1 -1
- package/dist/pregel/read.cjs +4 -1
- package/dist/pregel/read.cjs.map +1 -1
- package/dist/pregel/read.d.cts +0 -1
- package/dist/pregel/read.d.cts.map +1 -1
- package/dist/pregel/read.d.ts +1 -1
- package/dist/pregel/read.d.ts.map +1 -1
- package/dist/pregel/read.js +4 -1
- package/dist/pregel/read.js.map +1 -1
- package/dist/pregel/remote.cjs +1 -1
- package/dist/pregel/remote.d.cts.map +1 -1
- package/dist/pregel/remote.d.ts +2 -0
- package/dist/pregel/remote.d.ts.map +1 -1
- package/dist/pregel/remote.js +1 -1
- package/dist/pregel/retry.cjs +1 -1
- package/dist/pregel/retry.js +1 -1
- package/dist/pregel/runnable_types.d.cts.map +1 -1
- package/dist/pregel/runnable_types.d.ts.map +1 -1
- package/dist/pregel/runner.cjs +1 -1
- package/dist/pregel/runner.js +1 -1
- package/dist/pregel/stream.cjs +81 -0
- package/dist/pregel/stream.cjs.map +1 -1
- package/dist/pregel/stream.d.ts +3 -0
- package/dist/pregel/stream.js +81 -1
- package/dist/pregel/stream.js.map +1 -1
- package/dist/pregel/types.cjs.map +1 -1
- package/dist/pregel/types.d.cts +27 -9
- package/dist/pregel/types.d.cts.map +1 -1
- package/dist/pregel/types.d.ts +27 -9
- package/dist/pregel/types.d.ts.map +1 -1
- package/dist/pregel/types.js.map +1 -1
- package/dist/pregel/utils/config.d.cts +0 -1
- package/dist/pregel/utils/config.d.cts.map +1 -1
- package/dist/pregel/utils/config.d.ts +0 -1
- package/dist/pregel/utils/config.d.ts.map +1 -1
- package/dist/pregel/utils/index.d.cts +3 -7
- package/dist/pregel/utils/index.d.cts.map +1 -1
- package/dist/pregel/utils/index.d.ts +3 -7
- package/dist/pregel/utils/index.d.ts.map +1 -1
- package/dist/pregel/write.cjs +2 -1
- package/dist/pregel/write.cjs.map +1 -1
- package/dist/pregel/write.d.cts +1 -2
- package/dist/pregel/write.d.cts.map +1 -1
- package/dist/pregel/write.d.ts +1 -2
- package/dist/pregel/write.d.ts.map +1 -1
- package/dist/pregel/write.js +2 -1
- package/dist/pregel/write.js.map +1 -1
- package/dist/state/adapter.d.cts +0 -1
- package/dist/state/adapter.d.cts.map +1 -1
- package/dist/state/adapter.d.ts +0 -1
- package/dist/state/adapter.d.ts.map +1 -1
- package/dist/state/index.d.ts +7 -0
- package/dist/state/prebuilt/index.d.ts +1 -0
- package/dist/state/prebuilt/messages.d.cts +2 -2
- package/dist/state/prebuilt/messages.d.cts.map +1 -1
- package/dist/state/prebuilt/messages.d.ts +2 -2
- package/dist/state/prebuilt/messages.d.ts.map +1 -1
- package/dist/state/schema.cjs.map +1 -1
- package/dist/state/schema.d.cts +3 -2
- package/dist/state/schema.d.cts.map +1 -1
- package/dist/state/schema.d.ts +4 -2
- package/dist/state/schema.d.ts.map +1 -1
- package/dist/state/schema.js.map +1 -1
- package/dist/state/types.d.cts +0 -20
- package/dist/state/types.d.cts.map +1 -1
- package/dist/state/types.d.ts +0 -20
- package/dist/state/types.d.ts.map +1 -1
- package/dist/state/values/reduced.d.cts +0 -1
- package/dist/state/values/reduced.d.cts.map +1 -1
- package/dist/state/values/reduced.d.ts +0 -1
- package/dist/state/values/reduced.d.ts.map +1 -1
- package/dist/state/values/untracked.d.cts +0 -1
- package/dist/state/values/untracked.d.cts.map +1 -1
- package/dist/state/values/untracked.d.ts +0 -1
- package/dist/state/values/untracked.d.ts.map +1 -1
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/web.cjs +2 -1
- package/dist/web.d.cts +2 -2
- package/dist/web.d.ts +5 -2
- package/dist/web.js +2 -2
- package/dist/writer.d.cts.map +1 -1
- package/dist/writer.d.ts.map +1 -1
- 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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,QAAO,MAAM,IAAI,OAAO;EAE/C,IAAI,iBAAmC;AAEvC,MACE,QAAQ,qBACR,QAAQ,mCACR;GACA,MAAM,kBAAkB,OAAO,QAC7B,yBAAyB,OAAO,CACjC,CAAC,KAAK,CAAC,KAAK,YAAY;IACvB,MAAM,OAAO,KAAK,IAAI,OAAO;IAC7B,IAAI,eAAe,QAAQ,oBACvB,MAAM,SAAS,UAAU,SACzB;AACJ,QACE,QAAQ,qCACR,MAAM,iBACN;KACA,MAAM,cACJ,qBAAqB,aAAa,IAAI,qBAAqB,OAAO;KACpE,MAAM,YAAY,KAAK,UAAU;MAC/B,GAAG,KAAK;MACR;MACD,CAAC;AACF,oBAAe,aAAa,SAC1B,GAAG,iCAAiC,YACrC;;AAEH,WAAO,CAAC,KAAK,aAAa;KAC1B;AACF,oBAAiB,uBACf,QACA,OAAO,YAAY,gBAAgB,CACpC;AACD,OAAI,cAAc,eAAe,CAC/B,gBAAe,KAAK,cAAc;;AAGtC,MAAI,QAAQ,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 schemaMetaRegist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+
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.cts","names":[
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":[
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"zod-registry.d.cts","names":[],"sources":["../../../src/graph/zod/zod-registry.ts"],"mappings":";;;;;;;AA2BA;;;;;;;;;cAAa,wBAAA,cACE,UAAA,GAAa,UAAA,iBACX,QAAA,GAAW,QAAA,UAClB,YAAA,CAAa,IAAA;EAAA,CAAU,GAAA;AAAA,GAAyB,MAAA;EAAA,UAMlC,MAAA,EAAQ,kBAAA;EAWA;;;;;EAX9B,WAAA,CAAsB,MAAA,EAAQ,kBAAA;EAS9B,GAAA,WAAc,MAAA,CAAA,CACZ,MAAA,EAAQ,CAAA,KACL,KAAA,oBAAyB,IAAA;IAAA,CAAU,GAAA;EAAA,KACjC,QAAA,CAAS,IAAA;IAAA,CAAU,GAAA;EAAA,GAAyB,CAAA,OAC5C,QAAA,CAAS,IAAA;IAAA,CAAU,GAAA;EAAA,GAAyB,CAAA;AAAA;AAAA;EAAA,UAiBlC,OAAA,kEAGO,IAAA,CAAK,iBAAA,CACzB,MAAA,EACA,KAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,MAAA,EAAQ,KAAA,WAC3B,IAAA,CAAK,QAAA,CAAS,MAAA,EAAQ,KAAA,EAAO,SAAA;IACrC,QAAA,WACY,wBAAA,YACA,IAAA,CAAK,MAAA,iBACN,IAAA,CAAK,KAAA,2BACK,IAAA,CAAK,iBAAA,CACtB,OAAA,EACA,MAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,OAAA,EAAS,MAAA,GAEpC,QAAA,EAAU,CAAA,EACV,IAAA,EAAM,UAAA,CAAW,OAAA,EAAS,MAAA,IACzB,iBAAA,OAAwB,OAAA,CAAQ,OAAA,EAAS,MAAA,EAAQ,UAAA;EAAA;AAAA;AAAA;EAAA,UAKrC,WAAA,kEAGO,IAAA,CAAK,iBAAA,CACzB,MAAA,EACA,KAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,MAAA,EAAQ,KAAA,WAC3B,IAAA,CAAK,QAAA,CAAS,MAAA,EAAQ,KAAA,EAAO,SAAA;IACrC,QAAA,WACY,wBAAA,YACA,IAAA,CAAK,MAAA,iBACN,IAAA,CAAK,KAAA,2BACK,IAAA,CAAK,iBAAA,CACtB,OAAA,EACA,MAAA,IACE,IAAA,CAAK,iBAAA,CAAkB,OAAA,EAAS,MAAA,GAEpC,QAAA,EAAU,CAAA,EACV,IAAA,EAAM,UAAA,CAAW,OAAA,EAAS,MAAA,IACzB,iBAAA,OAAwB,WAAA,CAAY,OAAA,EAAS,MAAA,EAAQ,UAAA;EAAA;AAAA;AAAA,cAI/C,QAAA,EAAQ,wBAAA,CAAA,UAAA,YAAA,QAAA,mBAAA,IAAA,CAAA,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"zod-registry.d.ts","names":[],"sources":["../../../src/graph/zod/zod-registry.ts"],"mappings":";;;;;;;AA2BA;;;;;;;;;cAAa,wBAAA,cACE,UAAA,GAAa,UAAA,iBACX,QAAA,GAAW,QAAA,UAClB,YAAA,CAAa,IAAA;EAAA,CAAU,GAAA;AAAA,GAAyB,M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AAA,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
|
package/dist/interrupt.cjs
CHANGED
|
@@ -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
|
|
package/dist/interrupt.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interrupt.d.cts","names":[
|
|
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"}
|
package/dist/interrupt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interrupt.d.ts","names":[
|
|
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":[
|
|
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":[
|
|
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
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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":[
|
|
1
|
+
{"version":3,"file":"agent_executor.d.cts","names":[],"sources":["../../src/prebuilt/agent_executor.ts"],"mappings":";;;;;;;;;;;UASU,IAAA;EACR,MAAA,EAAQ,WAAA,GAAc,WAAA;EACtB,WAAA;AAAA;;UAIe,kBAAA;EACf,YAAA,GAAe,WAAA,GAAc,WAAA;EAC7B,KAAA,EAAO,KAAA,CAAM,IAAA;EACb,KAAA;EACA,WAAA,GAAc,WAAA;AAAA;;iBAIA,mBAAA,CAAA;EACd,aAAA;EACA;AAAA;EAEA,aAAA,EAAe,QAAA;EACf,KAAA,EAAO,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA"}
|
|
@@ -1,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
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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: {
|