@langchain/langgraph 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.d.cts.map +1 -1
- package/dist/channels/binop.d.ts.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.d.cts +0 -15
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +0 -15
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/func/index.d.cts +0 -1
- package/dist/func/index.d.cts.map +1 -1
- package/dist/func/index.d.ts +0 -1
- package/dist/func/index.d.ts.map +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.d.cts.map +1 -1
- package/dist/graph/annotation.d.ts.map +1 -1
- package/dist/graph/graph.d.cts.map +1 -1
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/index.d.ts +7 -0
- 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 +0 -1
- package/dist/graph/messages_annotation.d.cts.map +1 -1
- package/dist/graph/messages_annotation.d.ts +1 -1
- 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.d.cts.map +1 -1
- package/dist/graph/state.d.ts.map +1 -1
- package/dist/graph/types.d.cts +2 -18
- package/dist/graph/types.d.cts.map +1 -1
- package/dist/graph/types.d.ts +2 -18
- package/dist/graph/types.d.ts.map +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.d.cts.map +1 -1
- package/dist/graph/zod/meta.d.ts.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/interrupt.d.cts.map +1 -1
- package/dist/interrupt.d.ts.map +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.d.cts +8 -14
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.ts +10 -14
- package/dist/prebuilt/react_agent_executor.d.ts.map +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.d.cts.map +1 -1
- package/dist/prebuilt/tool_node.d.ts.map +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/index.d.cts.map +1 -1
- package/dist/pregel/index.d.ts.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/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/runnable_types.d.cts.map +1 -1
- package/dist/pregel/runnable_types.d.ts.map +1 -1
- package/dist/pregel/stream.d.ts +2 -0
- package/dist/pregel/types.d.cts +0 -7
- package/dist/pregel/types.d.cts.map +1 -1
- package/dist/pregel/types.d.ts +0 -7
- package/dist/pregel/types.d.ts.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.d.cts +0 -1
- package/dist/pregel/write.d.cts.map +1 -1
- package/dist/pregel/write.d.ts +0 -1
- package/dist/pregel/write.d.ts.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.d.cts.map +1 -1
- package/dist/state/schema.d.ts +1 -0
- package/dist/state/schema.d.ts.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.d.ts +3 -0
- package/dist/writer.d.cts.map +1 -1
- package/dist/writer.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.cts","names":["JSONSchema","RunnableLike","BaseChannel","SerializableSchema","ReducedValue","UntrackedValue","STATE_SCHEMA_SYMBOL","StateSchemaFieldToChannel","F","V","I","O","StateSchemaFieldsToStateDefinition","StateSchemaFields","TFields","K","StateSchemaField","Input","Output","InferStateSchemaValue","TOutput","InferStateSchemaUpdate","TInput","StateSchema","Record","T","Promise","AnyStateSchema"],"sources":["../../src/state/schema.d.ts"],"sourcesContent":["import type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport type { SerializableSchema } from \"./types.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\ndeclare const STATE_SCHEMA_SYMBOL: unique symbol;\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> = F extends ReducedValue<infer V, infer I> ? BaseChannel<V, I> : F extends UntrackedValue<infer V> ? BaseChannel<V, V> : F extends SerializableSchema<infer I, infer O> ? BaseChannel<O, I> : BaseChannel<unknown, unknown>;\n/**\n * Converts StateSchema fields into a strongly-typed\n * State Definition object, where each field is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TFields - The mapping of field names to StateSchema field types.\n * @returns An object type mapping field names to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: StateSchemaFieldToChannel<TFields[K]>;\n};\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> = ReducedValue<Input, Output> | UntrackedValue<Output> | SerializableSchema<Input, Output>;\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaFields = {\n [key: string]: StateSchemaField<any, any>;\n};\n/**\n * Infer the State type from a StateSchemaFields.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: TFields[K] extends ReducedValue<any, any> ? TFields[K][\"ValueType\"] : TFields[K] extends UntrackedValue<any> ? TFields[K][\"ValueType\"] : TFields[K] extends SerializableSchema<any, infer TOutput> ? TOutput : never;\n};\n/**\n * Infer the Update type from a StateSchemaFields.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TFields extends StateSchemaFields> = {\n [K in keyof TFields]?: TFields[K] extends ReducedValue<any, any> ? TFields[K][\"InputType\"] : TFields[K] extends UntrackedValue<any> ? TFields[K][\"ValueType\"] : TFields[K] extends SerializableSchema<infer TInput, any> ? TInput : never;\n};\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport declare class StateSchema<TFields extends StateSchemaFields> {\n readonly fields: TFields;\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n private readonly [STATE_SCHEMA_SYMBOL];\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n State: InferStateSchemaValue<TFields>;\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n Update: InferStateSchemaUpdate<TFields>;\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n Node: RunnableLike<InferStateSchemaValue<TFields>, InferStateSchemaUpdate<TFields>>;\n constructor(fields: TFields);\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel>;\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema;\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema;\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[];\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[];\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n validateInput<T>(data: T): Promise<T>;\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TFields extends StateSchemaFields>(value: StateSchema<TFields>): value is StateSchema<TFields>;\n static isInstance(value: unknown): value is StateSchema<any>;\n}\nexport type AnyStateSchema = StateSchema<any>;\nexport {};\n"],"mappings":";;;;;;;;cAMcM;;AADyC;AAyBvD;;;;;;;;;;;;;;;;;;;AA8BA;;AAA+DO,KA9BnDN,yBA8BmDM,CAAAA,CAAAA,CAAAA,GA9BpBL,CA8BoBK,SA9BVT,YA8BUS,CAAAA,KAAAA,EAAAA,EAAAA,KAAAA,EAAAA,CAAAA,GA9BuBX,WA8BvBW,CA9BmCJ,CA8BnCI,EA9BsCH,CA8BtCG,CAAAA,GA9B2CL,CA8B3CK,SA9BqDR,cA8BrDQ,CAA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AAO,qBAAA,CAAsB,OAAA;EArEzB;;;;EA2EJ,MAAA,EAAQ,sBAAA,CAAuB,OAAA;EAzEnC;;;AAYN;;;;;;;;;;;;EA8EU,IAAA,EAAM,YAAA,CACZ,qBAAA,CAAsB,OAAA,GACtB,sBAAA,CAAuB,OAAA;EAGzB,WAAA,CAAqB,MAAA,EAAQ,OAAA;EA/EjB;;;;EAqFZ,WAAA,CAAA,GAAe,MAAA,SAAe,WAAA;EApFW;;;;EA0HzC,aAAA,CAAA,GAAiB,UAAA;EA9HM;;;;EAmLvB,kBAAA,CAAA,GAAsB,UAAA;EAjLlB;;;EAgNJ,cAAA,CAAA;EA/MY;;;EAsNZ,UAAA,CAAA;EArNgD;;;;AAsClD;;;EA0LQ,aAAA,GAAA,CAAiB,IAAA,EAAM,CAAA,GAAI,OAAA,CAAQ,CAAA;EAlJZ;;;;;;EAAA,OAuMtB,UAAA,iBAA2B,iBAAA,CAAA,CAChC,KAAA,EAAO,WAAA,CAAY,OAAA,IAClB,KAAA,IAAS,WAAA,CAAY,OAAA;EAAA,OAEjB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,WAAA;AAAA;AAAA,KAclC,cAAA,GAAiB,WAAA"}
|
package/dist/state/schema.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":["JSONSchema","RunnableLike","BaseChannel","SerializableSchema","ReducedValue","UntrackedValue","STATE_SCHEMA_SYMBOL","StateSchemaFieldToChannel","F","V","I","O","StateSchemaFieldsToStateDefinition","StateSchemaFields","TFields","K","StateSchemaField","Input","Output","InferStateSchemaValue","TOutput","InferStateSchemaUpdate","TInput","StateSchema","Record","T","Promise","AnyStateSchema"],"sources":["../../src/state/schema.d.ts"],"sourcesContent":["import type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport type { SerializableSchema } from \"./types.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\ndeclare const STATE_SCHEMA_SYMBOL: unique symbol;\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> = F extends ReducedValue<infer V, infer I> ? BaseChannel<V, I> : F extends UntrackedValue<infer V> ? BaseChannel<V, V> : F extends SerializableSchema<infer I, infer O> ? BaseChannel<O, I> : BaseChannel<unknown, unknown>;\n/**\n * Converts StateSchema fields into a strongly-typed\n * State Definition object, where each field is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TFields - The mapping of field names to StateSchema field types.\n * @returns An object type mapping field names to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: StateSchemaFieldToChannel<TFields[K]>;\n};\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> = ReducedValue<Input, Output> | UntrackedValue<Output> | SerializableSchema<Input, Output>;\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaFields = {\n [key: string]: StateSchemaField<any, any>;\n};\n/**\n * Infer the State type from a StateSchemaFields.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: TFields[K] extends ReducedValue<any, any> ? TFields[K][\"ValueType\"] : TFields[K] extends UntrackedValue<any> ? TFields[K][\"ValueType\"] : TFields[K] extends SerializableSchema<any, infer TOutput> ? TOutput : never;\n};\n/**\n * Infer the Update type from a StateSchemaFields.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TFields extends StateSchemaFields> = {\n [K in keyof TFields]?: TFields[K] extends ReducedValue<any, any> ? TFields[K][\"InputType\"] : TFields[K] extends UntrackedValue<any> ? TFields[K][\"ValueType\"] : TFields[K] extends SerializableSchema<infer TInput, any> ? TInput : never;\n};\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport declare class StateSchema<TFields extends StateSchemaFields> {\n readonly fields: TFields;\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n private readonly [STATE_SCHEMA_SYMBOL];\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n State: InferStateSchemaValue<TFields>;\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n Update: InferStateSchemaUpdate<TFields>;\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n Node: RunnableLike<InferStateSchemaValue<TFields>, InferStateSchemaUpdate<TFields>>;\n constructor(fields: TFields);\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel>;\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema;\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema;\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[];\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[];\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n validateInput<T>(data: T): Promise<T>;\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TFields extends StateSchemaFields>(value: StateSchema<TFields>): value is StateSchema<TFields>;\n static isInstance(value: unknown): value is StateSchema<any>;\n}\nexport type AnyStateSchema = StateSchema<any>;\nexport {};\n"],"mappings":";;;;;;;;cAMcM;;AADyC;AAyBvD;;;;;;;;;;;;;;;;;;;AA8BA;;AAA+DO,KA9BnDN,yBA8BmDM,CAAAA,CAAAA,CAAAA,GA9BpBL,CA8BoBK,SA9BVT,YA8BUS,CAAAA,KAAAA,EAAAA,EAAAA,KAAAA,EAAAA,CAAAA,GA9BuBX,WA8BvBW,CA9BmCJ,CA8BnCI,EA9BsCH,CA8BtCG,CAAAA,GA9B2CL,CA8B3CK,SA9BqDR,cA8BrDQ,CAAAA,KAAAA,EAAAA,CAAAA,GA9B+EX,WA8B/EW,CA9B2FJ,CA8B3FI,EA9B8FJ,CA8B9FI,CAAAA,GA9BmGL,CA8BnGK,SA9B6GV,kBA8B7GU,CAAAA,KAAAA,EAAAA,EAAAA,KAAAA,EAAAA,CAAAA,GA9BoJX,WA8BpJW,CA9BgKF,CA8BhKE,EA9BmKH,CA8BnKG,CAAAA,GA9BwKX,WA8BxKW,CAAAA,OAAAA,EAAAA,OAAAA,CAAAA;;;;;;AAO/D;;;;;;;;;;;;AAKA;AAWA;;;;;;;;;;;AACmHR,KAxBvGO,kCAwBuGP,CAAAA,gBAxBpDQ,iBAwBoDR,CAAAA,GAAAA,QAAsBS,MAvBzHA,OAuByHA,GAvB/GP,yBAuB+GO,CAvBrFA,OAuBqFA,CAvB7EC,CAuB6ED,CAAAA,CAAAA;;;;;AAA6F,KAjB1NE,gBAiB0N,CAAA,QAAA,OAAA,EAAA,SAjB/KC,KAiB+K,CAAA,GAjBtKb,YAiBsK,CAjBzJa,KAiByJ,EAjBlJC,MAiBkJ,CAAA,GAjBxIb,cAiBwI,CAjBzHa,MAiByH,CAAA,GAjB/Gf,kBAiB+G,CAjB5Fc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B,WAAA"}
|
package/dist/state/types.d.cts
CHANGED
|
@@ -80,26 +80,6 @@ declare namespace SerializableSchema {
|
|
|
80
80
|
*/
|
|
81
81
|
declare function isStandardSchema<Input = unknown, Output = Input>(schema: StandardSchemaV1<Input, Output>): schema is StandardSchemaV1<Input, Output>;
|
|
82
82
|
declare function isStandardSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardSchemaV1<Input, Output>;
|
|
83
|
-
/**
|
|
84
|
-
* Type guard to check if a given value is a Standard JSON Schema V1 object.
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* A Standard JSON Schema object is expected to have a `~standard` property with a `jsonSchema` function.
|
|
88
|
-
* This may be used to generate a JSON Schema (for UI/form tooling, documentation, etc).
|
|
89
|
-
*
|
|
90
|
-
* @typeParam Input - The type of input described by this JSON schema.
|
|
91
|
-
* @typeParam Output - The type of output described by this JSON schema.
|
|
92
|
-
* @param schema - The value to test.
|
|
93
|
-
* @returns True if the schema exposes JSON schema generation.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* if (isStandardJSONSchema(mySchema)) {
|
|
98
|
-
* const jschema = mySchema["~standard"].jsonSchema();
|
|
99
|
-
* }
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
83
|
/**
|
|
104
84
|
* Type guard to check if a given value is a `SerializableSchema`, i.e.
|
|
105
85
|
* both a Standard Schema and a Standard JSON Schema object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/state/types.ts"],"mappings":";;;UAMU,aAAA,2BAAwC,KAAA,UACxC,gBAAA,CAAiB,KAAA,CAAM,KAAA,EAAO,MAAA,GACpC,oBAAA,CAAqB,KAAA,CAAM,KAAA,EAAO,MAAA;AAJP;;;;;;;;;;;;;;;;;;;;;;;;;AAkC/B;;;AAlC+B,UAkCd,kBAAA,2BAA6C,KAAA;EAC5D,WAAA,EAAa,aAAA,CAAc,KAAA,EAAO,MAAA;AAAA;AAAA,kBAIX,kBAAA;EAJG;;;;;;;;;;;EAAA,KAgBd,UAAA,WAAqB,kBAAA,IAC/B,eAAA,CAAgB,UAAA,CAAW,CAAA;EAbY;;;;;;;;;;;EAAA,KA0B7B,WAAA,WAAsB,kBAAA,IAChC,eAAA,CAAgB,WAAA,CAAY,CAAA;AAAA;;;;;;;;;;;;AAsBhC;;;;;;;;iBAAgB,gBAAA,2BAA2C,KAAA,CAAA,CACzD,MAAA,EAAQ,gBAAA,CAAiB,KAAA,EAAO,MAAA,IAC/B,MAAA,IAAU,gBAAA,CAAiB,KAAA,EAAO,MAAA;AAAA,iBACrB,gBAAA,2BAA2C,KAAA,CAAA,CACzD,MAAA,YACC,MAAA,IAAU,gBAAA,CAAiB,KAAA,EAAO,MAAA;;;;;;;;;;;;;;AAyErC;;;;;;;;iBAAgB,oBAAA,2BAA+C,KAAA,CAAA,CAC7D,MAAA,EAAQ,kBAAA,CAAmB,KAAA,EAAO,MAAA,IACjC,MAAA,IAAU,kBAAA,CAAmB,KAAA,EAAO,MAAA;AAAA,iBACvB,oBAAA,2BAA+C,KAAA,CAAA,CAC7D,MAAA,YACC,MAAA,IAAU,kBAAA,CAAmB,KAAA,EAAO,MAAA"}
|
package/dist/state/types.d.ts
CHANGED
|
@@ -80,26 +80,6 @@ declare namespace SerializableSchema {
|
|
|
80
80
|
*/
|
|
81
81
|
declare function isStandardSchema<Input = unknown, Output = Input>(schema: StandardSchemaV1<Input, Output>): schema is StandardSchemaV1<Input, Output>;
|
|
82
82
|
declare function isStandardSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardSchemaV1<Input, Output>;
|
|
83
|
-
/**
|
|
84
|
-
* Type guard to check if a given value is a Standard JSON Schema V1 object.
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* A Standard JSON Schema object is expected to have a `~standard` property with a `jsonSchema` function.
|
|
88
|
-
* This may be used to generate a JSON Schema (for UI/form tooling, documentation, etc).
|
|
89
|
-
*
|
|
90
|
-
* @typeParam Input - The type of input described by this JSON schema.
|
|
91
|
-
* @typeParam Output - The type of output described by this JSON schema.
|
|
92
|
-
* @param schema - The value to test.
|
|
93
|
-
* @returns True if the schema exposes JSON schema generation.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* if (isStandardJSONSchema(mySchema)) {
|
|
98
|
-
* const jschema = mySchema["~standard"].jsonSchema();
|
|
99
|
-
* }
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
83
|
/**
|
|
104
84
|
* Type guard to check if a given value is a `SerializableSchema`, i.e.
|
|
105
85
|
* both a Standard Schema and a Standard JSON Schema object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/state/types.ts"],"mappings":";;;UAMU,aAAA,2BAAwC,KAAA,UACxC,gBAAA,CAAiB,KAAA,CAAM,KAAA,EAAO,MAAA,GACpC,oBAAA,CAAqB,KAAA,CAAM,KAAA,EAAO,MAAA;AAJP;;;;;;;;;;;;;;;;;;;;;;;;;AAkC/B;;;AAlC+B,UAkCd,kBAAA,2BAA6C,KAAA;EAC5D,WAAA,EAAa,aAAA,CAAc,KAAA,EAAO,MAAA;AAAA;AAAA,kBAIX,kBAAA;EAJG;;;;;;;;;;;EAAA,KAgBd,UAAA,WAAqB,kBAAA,IAC/B,eAAA,CAAgB,UAAA,CAAW,CAAA;EAbY;;;;;;;;;;;EAAA,KA0B7B,WAAA,WAAsB,kBAAA,IAChC,eAAA,CAAgB,WAAA,CAAY,CAAA;AAAA;;;;;;;;;;;;AAsBhC;;;;;;;;iBAAgB,gBAAA,2BAA2C,KAAA,CAAA,CACzD,MAAA,EAAQ,gBAAA,CAAiB,KAAA,EAAO,MAAA,IAC/B,MAAA,IA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sBF;;;;EAAA,oBAjBW,sBAAA;EA8BoB;;;;;EAAA,SAvB/B,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAgC5B;;;;;;;;EAAA,SAtBA,KAAA;EAyBmC;;;EApBpC,SAAA,EAAW,KAAA;;;;;;;EAQnB,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"untracked.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"untracked.d.ts","names":[],"sources":["../../../src/state/values/untracked.ts"],"mappings":";;;;;AAKA;cAAa,sBAAA;;;;UAOI,kBAAA;EAAkB;;;;EAKjC,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;cAsBW,cAAA;EAsBF;;;;EAAA,oBAjBW,sBAAA;EA8BoB;;;;;EAAA,SAvB/B,MAAA,GAAS,kBAAA,CAAmB,KAAA;EAgC5B;;;;;;;;EAAA,SAtBA,KAAA;EAyBmC;;;EApBpC,SAAA,EAAW,KAAA;;;;;;;EAQnB,WAAA,CAAY,MAAA,GAAS,kBAAA,CAAmB,KAAA,GAAQ,IAAA,GAAO,kBAAA;;;;SAQhD,UAAA,iBAAA,CACL,KAAA,EAAO,cAAA,CAAe,KAAA,IACrB,KAAA,IAAS,cAAA,CAAe,KAAA;EAAA,OAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,cAAA;AAAA"}
|
package/dist/utils.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;UAWiB,oBAAA,SAA6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@ -7,6 +7,7 @@ import { EphemeralValue } from "./channels/ephemeral_value.js";
|
|
|
7
7
|
import { NamedBarrierValue } from "./channels/named_barrier_value.js";
|
|
8
8
|
import { Topic } from "./channels/topic.js";
|
|
9
9
|
import { UntrackedValueChannel } from "./channels/untracked_value.js";
|
|
10
|
+
import "./channels/index.js";
|
|
10
11
|
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";
|
|
@@ -23,10 +24,12 @@ import { ConditionalEdgeRouter, ConditionalEdgeRouterTypes, ContextSchemaInit, E
|
|
|
23
24
|
import { CompiledStateGraph, StateGraph, StateGraphArgs } from "./graph/state.js";
|
|
24
25
|
import { Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/messages_reducer.js";
|
|
25
26
|
import { MessageGraph } from "./graph/message.js";
|
|
27
|
+
import "./graph/index.js";
|
|
26
28
|
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, StateGraphInputError, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
|
|
27
29
|
import { EntrypointOptions, TaskOptions, entrypoint, task } from "./func/index.js";
|
|
28
30
|
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
|
|
29
31
|
import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter.js";
|
|
30
32
|
import { MessagesValue } from "./state/prebuilt/messages.js";
|
|
33
|
+
import "./state/index.js";
|
|
31
34
|
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
|
|
32
35
|
export { Annotation, type AnnotationRoot, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, type CommandParams, type CompiledGraph, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InferStateSchemaUpdate, InferStateSchemaValue, type Interrupt, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type NamespaceMatchType, NodeInterrupt, type NodeType, type Operation, type OperationResults, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, type Runtime, START, type SearchOperation, Send, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphArgs, type StateGraphInit, StateGraphInputError, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFields, type StateSnapshot, type StateType, type StreamMode, type StreamOutputMap, type TaskOptions, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getJsonSchemaFromSchema, getSchemaDefaultGetter, getSubgraphsSeenSet, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, isSerializableSchema, isStandardSchema, messagesStateReducer, task };
|
package/dist/writer.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"writer.d.cts","names":[],"sources":["../src/writer.ts"],"mappings":";iBAGgB,MAAA,GAAA,CAAU,KAAA,EAAO,CAAA;AAAA,KAerB,eAAA,MAAqB,CAAA,gBAAiB,MAAA,YAAkB,CAAA"}
|
package/dist/writer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"writer.d.ts","names":[],"sources":["../src/writer.ts"],"mappings":";iBAGgB,MAAA,GAAA,CAAU,KAAA,EAAO,CAAA;AAAA,KAerB,eAAA,MAAqB,CAAA,gBAAiB,MAAA,YAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@standard-schema/spec": "1.1.0",
|
|
20
20
|
"uuid": "^10.0.0",
|
|
21
21
|
"@langchain/langgraph-checkpoint": "^1.0.0",
|
|
22
|
-
"@langchain/langgraph-sdk": "~
|
|
22
|
+
"@langchain/langgraph-sdk": "~2.0.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@langchain/core": "^1.1.16",
|