@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.
Files changed (170) hide show
  1. package/dist/channels/any_value.d.cts +0 -1
  2. package/dist/channels/any_value.d.cts.map +1 -1
  3. package/dist/channels/any_value.d.ts +0 -1
  4. package/dist/channels/any_value.d.ts.map +1 -1
  5. package/dist/channels/base.d.cts.map +1 -1
  6. package/dist/channels/base.d.ts.map +1 -1
  7. package/dist/channels/binop.d.cts.map +1 -1
  8. package/dist/channels/binop.d.ts.map +1 -1
  9. package/dist/channels/dynamic_barrier_value.d.cts +0 -10
  10. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
  11. package/dist/channels/dynamic_barrier_value.d.ts +0 -10
  12. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
  13. package/dist/channels/ephemeral_value.d.cts +0 -1
  14. package/dist/channels/ephemeral_value.d.cts.map +1 -1
  15. package/dist/channels/ephemeral_value.d.ts +0 -1
  16. package/dist/channels/ephemeral_value.d.ts.map +1 -1
  17. package/dist/channels/last_value.d.cts +0 -1
  18. package/dist/channels/last_value.d.cts.map +1 -1
  19. package/dist/channels/last_value.d.ts +0 -1
  20. package/dist/channels/last_value.d.ts.map +1 -1
  21. package/dist/channels/named_barrier_value.d.cts +0 -1
  22. package/dist/channels/named_barrier_value.d.cts.map +1 -1
  23. package/dist/channels/named_barrier_value.d.ts +0 -1
  24. package/dist/channels/named_barrier_value.d.ts.map +1 -1
  25. package/dist/channels/topic.d.cts +0 -1
  26. package/dist/channels/topic.d.cts.map +1 -1
  27. package/dist/channels/topic.d.ts +0 -1
  28. package/dist/channels/topic.d.ts.map +1 -1
  29. package/dist/channels/untracked_value.d.cts +0 -1
  30. package/dist/channels/untracked_value.d.cts.map +1 -1
  31. package/dist/channels/untracked_value.d.ts +0 -1
  32. package/dist/channels/untracked_value.d.ts.map +1 -1
  33. package/dist/constants.d.cts +0 -15
  34. package/dist/constants.d.cts.map +1 -1
  35. package/dist/constants.d.ts +0 -15
  36. package/dist/constants.d.ts.map +1 -1
  37. package/dist/errors.d.cts.map +1 -1
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/func/index.d.cts +0 -1
  40. package/dist/func/index.d.cts.map +1 -1
  41. package/dist/func/index.d.ts +0 -1
  42. package/dist/func/index.d.ts.map +1 -1
  43. package/dist/func/types.d.cts +0 -11
  44. package/dist/func/types.d.cts.map +1 -1
  45. package/dist/func/types.d.ts +0 -11
  46. package/dist/func/types.d.ts.map +1 -1
  47. package/dist/graph/annotation.d.cts.map +1 -1
  48. package/dist/graph/annotation.d.ts.map +1 -1
  49. package/dist/graph/graph.d.cts.map +1 -1
  50. package/dist/graph/graph.d.ts.map +1 -1
  51. package/dist/graph/index.d.ts +7 -0
  52. package/dist/graph/message.d.cts +2 -2
  53. package/dist/graph/message.d.cts.map +1 -1
  54. package/dist/graph/message.d.ts +2 -2
  55. package/dist/graph/message.d.ts.map +1 -1
  56. package/dist/graph/messages_annotation.d.cts +0 -1
  57. package/dist/graph/messages_annotation.d.cts.map +1 -1
  58. package/dist/graph/messages_annotation.d.ts +1 -1
  59. package/dist/graph/messages_annotation.d.ts.map +1 -1
  60. package/dist/graph/messages_reducer.d.cts +0 -1
  61. package/dist/graph/messages_reducer.d.cts.map +1 -1
  62. package/dist/graph/messages_reducer.d.ts +0 -1
  63. package/dist/graph/messages_reducer.d.ts.map +1 -1
  64. package/dist/graph/state.d.cts.map +1 -1
  65. package/dist/graph/state.d.ts.map +1 -1
  66. package/dist/graph/types.d.cts +2 -18
  67. package/dist/graph/types.d.cts.map +1 -1
  68. package/dist/graph/types.d.ts +2 -18
  69. package/dist/graph/types.d.ts.map +1 -1
  70. package/dist/graph/zod/index.d.cts +1 -0
  71. package/dist/graph/zod/index.d.ts +1 -0
  72. package/dist/graph/zod/meta.d.cts.map +1 -1
  73. package/dist/graph/zod/meta.d.ts.map +1 -1
  74. package/dist/graph/zod/plugin.d.cts +30 -0
  75. package/dist/graph/zod/plugin.d.cts.map +1 -0
  76. package/dist/graph/zod/plugin.d.ts +30 -0
  77. package/dist/graph/zod/plugin.d.ts.map +1 -0
  78. package/dist/graph/zod/schema.d.cts +0 -1
  79. package/dist/graph/zod/schema.d.cts.map +1 -1
  80. package/dist/graph/zod/schema.d.ts +0 -1
  81. package/dist/graph/zod/schema.d.ts.map +1 -1
  82. package/dist/graph/zod/zod-registry.d.cts +0 -1
  83. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  84. package/dist/graph/zod/zod-registry.d.ts +0 -1
  85. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  86. package/dist/interrupt.d.cts.map +1 -1
  87. package/dist/interrupt.d.ts.map +1 -1
  88. package/dist/prebuilt/agentName.d.cts +0 -17
  89. package/dist/prebuilt/agentName.d.cts.map +1 -1
  90. package/dist/prebuilt/agentName.d.ts +0 -17
  91. package/dist/prebuilt/agentName.d.ts.map +1 -1
  92. package/dist/prebuilt/agent_executor.d.cts +5 -5
  93. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  94. package/dist/prebuilt/agent_executor.d.ts +6 -5
  95. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  96. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  97. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  98. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  99. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  100. package/dist/prebuilt/react_agent_executor.d.cts +8 -14
  101. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  102. package/dist/prebuilt/react_agent_executor.d.ts +10 -14
  103. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  104. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  105. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  106. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  107. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  108. package/dist/pregel/algo.d.cts +0 -1
  109. package/dist/pregel/algo.d.cts.map +1 -1
  110. package/dist/pregel/algo.d.ts +5 -1
  111. package/dist/pregel/algo.d.ts.map +1 -1
  112. package/dist/pregel/index.d.cts.map +1 -1
  113. package/dist/pregel/index.d.ts.map +1 -1
  114. package/dist/pregel/read.d.cts +0 -1
  115. package/dist/pregel/read.d.cts.map +1 -1
  116. package/dist/pregel/read.d.ts +1 -1
  117. package/dist/pregel/read.d.ts.map +1 -1
  118. package/dist/pregel/remote.d.cts.map +1 -1
  119. package/dist/pregel/remote.d.ts +2 -0
  120. package/dist/pregel/remote.d.ts.map +1 -1
  121. package/dist/pregel/runnable_types.d.cts.map +1 -1
  122. package/dist/pregel/runnable_types.d.ts.map +1 -1
  123. package/dist/pregel/stream.d.ts +2 -0
  124. package/dist/pregel/types.d.cts +0 -7
  125. package/dist/pregel/types.d.cts.map +1 -1
  126. package/dist/pregel/types.d.ts +0 -7
  127. package/dist/pregel/types.d.ts.map +1 -1
  128. package/dist/pregel/utils/config.d.cts +0 -1
  129. package/dist/pregel/utils/config.d.cts.map +1 -1
  130. package/dist/pregel/utils/config.d.ts +0 -1
  131. package/dist/pregel/utils/config.d.ts.map +1 -1
  132. package/dist/pregel/utils/index.d.cts +3 -7
  133. package/dist/pregel/utils/index.d.cts.map +1 -1
  134. package/dist/pregel/utils/index.d.ts +3 -7
  135. package/dist/pregel/utils/index.d.ts.map +1 -1
  136. package/dist/pregel/write.d.cts +0 -1
  137. package/dist/pregel/write.d.cts.map +1 -1
  138. package/dist/pregel/write.d.ts +0 -1
  139. package/dist/pregel/write.d.ts.map +1 -1
  140. package/dist/state/adapter.d.cts +0 -1
  141. package/dist/state/adapter.d.cts.map +1 -1
  142. package/dist/state/adapter.d.ts +0 -1
  143. package/dist/state/adapter.d.ts.map +1 -1
  144. package/dist/state/index.d.ts +7 -0
  145. package/dist/state/prebuilt/index.d.ts +1 -0
  146. package/dist/state/prebuilt/messages.d.cts +2 -2
  147. package/dist/state/prebuilt/messages.d.cts.map +1 -1
  148. package/dist/state/prebuilt/messages.d.ts +2 -2
  149. package/dist/state/prebuilt/messages.d.ts.map +1 -1
  150. package/dist/state/schema.d.cts.map +1 -1
  151. package/dist/state/schema.d.ts +1 -0
  152. package/dist/state/schema.d.ts.map +1 -1
  153. package/dist/state/types.d.cts +0 -20
  154. package/dist/state/types.d.cts.map +1 -1
  155. package/dist/state/types.d.ts +0 -20
  156. package/dist/state/types.d.ts.map +1 -1
  157. package/dist/state/values/reduced.d.cts +0 -1
  158. package/dist/state/values/reduced.d.cts.map +1 -1
  159. package/dist/state/values/reduced.d.ts +0 -1
  160. package/dist/state/values/reduced.d.ts.map +1 -1
  161. package/dist/state/values/untracked.d.cts +0 -1
  162. package/dist/state/values/untracked.d.cts.map +1 -1
  163. package/dist/state/values/untracked.d.ts +0 -1
  164. package/dist/state/values/untracked.d.ts.map +1 -1
  165. package/dist/utils.d.cts.map +1 -1
  166. package/dist/utils.d.ts.map +1 -1
  167. package/dist/web.d.ts +3 -0
  168. package/dist/writer.d.cts.map +1 -1
  169. package/dist/writer.d.ts.map +1 -1
  170. 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<T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Like } from "../pregel/runnable_types.js";
3
4
  import { SerializableSchema } from "./types.js";
4
5
  import { ReducedValue } from "./values/reduced.js";
@@ -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,CA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AAA;EA/EzB;;;;EAqFJ,WAAA,CAAA,GAAe,MAAA,SAAe,WAAA;EApFW;;;;EA0HzC,aAAA,CAAA,GAAiB,UAAA;EA9HL;;;;EAmLZ,kBAAA,CAAA,GAAsB,UAAA;EAlLV;;;EAiNZ,cAAA,CAAA;EA/MI;;;EAsNJ,UAAA,CAAA;EArNuB;;;;;AAsCzB;;EA0LQ,aAAA,GAAA,CAAiB,IAAA,EAAM,CAAA,GAAI,OAAA,CAAQ,CAAA;EA1LF;;;;;;EAAA,OA+OhC,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"}
@@ -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":["StandardSchemaV1","StandardJSONSchemaV1","StandardTypedV1","CombinedProps","Input","Output","Props","SerializableSchema","T","InferInput","InferOutput","isStandardSchema","isStandardJSONSchema","isSerializableSchema"],"sources":["../../src/state/types.d.ts"],"sourcesContent":["import type { StandardSchemaV1, StandardJSONSchemaV1, StandardTypedV1 } from \"@standard-schema/spec\";\ninterface CombinedProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {\n}\n/**\n * SerializableSchema is the core interface for any schema used by LangGraph state.\n *\n * @template Input - The type of input data the schema can be used to validate.\n * @template Output - The type of output produced after validation, post-refinement/coercion.\n *\n * @remarks\n * - SerializableSchema provides a single property, `~standard`, which must conform to\n * both `StandardSchemaV1.Props` and `StandardJSONSchemaV1.Props`.\n * - This ensures all schemas are compatible with both runtime validation (e.g., type checks,\n * coercion, custom refinements) and structured schema export/generation (e.g., producing\n * a compatible JSON Schema).\n * - A value matching SerializableSchema can be passed directly to LangGraph state\n * definitions, reducers, or other schema-accepting APIs.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n *\n * // complies with SerializableSchema\n * const zodSchema = z.object({ x: z.string() });\n *\n * // Use in a StateObject definition:\n * const AgentState = new StateObject({\n * data: schema\n * });\n * ```\n */\nexport interface SerializableSchema<Input = unknown, Output = Input> {\n \"~standard\": CombinedProps<Input, Output>;\n}\nexport declare namespace SerializableSchema {\n /**\n * Infers the type of input expected by a SerializableSchema.\n *\n * @template T - A SerializableSchema instance.\n * @returns The type of data that may be passed to the schema for validation.\n *\n * @example\n * ```ts\n * type MyInput = SerializableSchema.InferInput<typeof schema>;\n * ```\n */\n type InferInput<T extends SerializableSchema> = StandardTypedV1.InferInput<T>;\n /**\n * Infers the output type yielded by a SerializableSchema, after parsing or coercion.\n *\n * @template T - A SerializableSchema instance.\n * @returns The type produced by successfully validating/coercing input data.\n *\n * @example\n * ```ts\n * type MyOutput = SerializableSchema.InferOutput<typeof schema>;\n * ```\n */\n type InferOutput<T extends SerializableSchema> = StandardTypedV1.InferOutput<T>;\n}\n/**\n * Type guard to check if a given value is a Standard Schema V1 object.\n *\n * @remarks\n * A Standard Schema object is expected to have a `~standard` property with a `validate` function.\n * This guard does NOT check for JSON schema support.\n *\n * @typeParam Input - The type of input validated by this schema.\n * @typeParam Output - The type of output produced after validation.\n * @param schema - The value to test.\n * @returns True if the schema conforms to the Standard Schema interface.\n *\n * @example\n * ```ts\n * if (isStandardSchema(mySchema)) {\n * const result = mySchema[\"~standard\"].validate(input);\n * }\n * ```\n */\nexport declare function isStandardSchema<Input = unknown, Output = Input>(schema: StandardSchemaV1<Input, Output>): schema is StandardSchemaV1<Input, Output>;\nexport declare function isStandardSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardSchemaV1<Input, Output>;\n/**\n * Type guard to check if a given value is a Standard JSON Schema V1 object.\n *\n * @remarks\n * A Standard JSON Schema object is expected to have a `~standard` property with a `jsonSchema` function.\n * This may be used to generate a JSON Schema (for UI/form tooling, documentation, etc).\n *\n * @typeParam Input - The type of input described by this JSON schema.\n * @typeParam Output - The type of output described by this JSON schema.\n * @param schema - The value to test.\n * @returns True if the schema exposes JSON schema generation.\n *\n * @example\n * ```ts\n * if (isStandardJSONSchema(mySchema)) {\n * const jschema = mySchema[\"~standard\"].jsonSchema();\n * }\n * ```\n */\nexport declare function isStandardJSONSchema<Input = unknown, Output = Input>(schema: StandardJSONSchemaV1<Input, Output>): schema is StandardJSONSchemaV1<Input, Output>;\nexport declare function isStandardJSONSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardJSONSchemaV1<Input, Output>;\n/**\n * Type guard to check if a given value is a `SerializableSchema`, i.e.\n * both a Standard Schema and a Standard JSON Schema object.\n *\n * @remarks\n * This checks for both the presence of a Standard Schema V1 interface\n * and the ability to generate a JSON schema.\n *\n * @typeParam Input - The type of input described by the schema.\n * @typeParam Output - The type of output described by the schema.\n * @param schema - The value to test.\n * @returns True if the schema is a valid `SerializableSchema`.\n *\n * @example\n * ```ts\n * if (isSerializableSchema(schema)) {\n * schema[\"~standard\"].validate(data);\n * const json = schema[\"~standard\"].jsonSchema();\n * }\n * ```\n */\nexport declare function isSerializableSchema<Input = unknown, Output = Input>(schema: SerializableSchema<Input, Output>): schema is SerializableSchema<Input, Output>;\nexport declare function isSerializableSchema<Input = unknown, Output = Input>(schema: unknown): schema is SerializableSchema<Input, Output>;\nexport {};\n"],"mappings":";;;UACUG,wCAAwCC,eAAeJ,gBAAAA,CAAiBM,MAAMF,OAAOC,SAASJ,oBAAAA,CAAqBK,MAAMF,OAAOC;AADrC;;;;;;;;;;AA+BrG;;;;;;;AAGA;;;;;;;;;AA6CA;;AAAmED,UAhDlDG,kBAgDkDH,CAAAA,QAAAA,OAAAA,EAAAA,SAhDLA,KAgDKA,CAAAA,CAAAA;aAAgCA,EA/ClFD,aA+CkFC,CA/CpEA,KA+CoEA,EA/C7DC,MA+C6DD,CAAAA;;AAAjBJ,kBA7CzDO,kBAAAA,CA6CyDP;;;;;AAClF;;;;;;;EA2CwBa,KAAAA,UAAAA,CAAAA,UA7EMN,kBA6Ec,CAAA,GA7EQL,eAAAA,CAAgBO,UA6ExB,CA7EmCD,CA6EnC,CAAA;EAAA;;;;;;;;;AAC5C;;OAAuEJ,WAAAA,CAAAA,UAlExCG,kBAkEwCH,CAAAA,GAlElBF,eAAAA,CAAgBQ,WAkEEN,CAlEUI,CAkEVJ,CAAAA;;;;;;;;;;;;;;;;;;;;;iBA7C/CO,2CAA2CP,eAAeJ,iBAAiBI,OAAOC,oBAAoBL,iBAAiBI,OAAOC;iBAC9HM,2CAA2CP,mCAAmCJ,iBAAiBI,OAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CtGQ,+CAA+CT,eAAeG,mBAAmBH,OAAOC,oBAAoBE,mBAAmBH,OAAOC;iBACtIQ,+CAA+CT,mCAAmCG,mBAAmBH,OAAOC"}
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"}
@@ -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":["StandardSchemaV1","StandardJSONSchemaV1","StandardTypedV1","CombinedProps","Input","Output","Props","SerializableSchema","T","InferInput","InferOutput","isStandardSchema","isStandardJSONSchema","isSerializableSchema"],"sources":["../../src/state/types.d.ts"],"sourcesContent":["import type { StandardSchemaV1, StandardJSONSchemaV1, StandardTypedV1 } from \"@standard-schema/spec\";\ninterface CombinedProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {\n}\n/**\n * SerializableSchema is the core interface for any schema used by LangGraph state.\n *\n * @template Input - The type of input data the schema can be used to validate.\n * @template Output - The type of output produced after validation, post-refinement/coercion.\n *\n * @remarks\n * - SerializableSchema provides a single property, `~standard`, which must conform to\n * both `StandardSchemaV1.Props` and `StandardJSONSchemaV1.Props`.\n * - This ensures all schemas are compatible with both runtime validation (e.g., type checks,\n * coercion, custom refinements) and structured schema export/generation (e.g., producing\n * a compatible JSON Schema).\n * - A value matching SerializableSchema can be passed directly to LangGraph state\n * definitions, reducers, or other schema-accepting APIs.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n *\n * // complies with SerializableSchema\n * const zodSchema = z.object({ x: z.string() });\n *\n * // Use in a StateObject definition:\n * const AgentState = new StateObject({\n * data: schema\n * });\n * ```\n */\nexport interface SerializableSchema<Input = unknown, Output = Input> {\n \"~standard\": CombinedProps<Input, Output>;\n}\nexport declare namespace SerializableSchema {\n /**\n * Infers the type of input expected by a SerializableSchema.\n *\n * @template T - A SerializableSchema instance.\n * @returns The type of data that may be passed to the schema for validation.\n *\n * @example\n * ```ts\n * type MyInput = SerializableSchema.InferInput<typeof schema>;\n * ```\n */\n type InferInput<T extends SerializableSchema> = StandardTypedV1.InferInput<T>;\n /**\n * Infers the output type yielded by a SerializableSchema, after parsing or coercion.\n *\n * @template T - A SerializableSchema instance.\n * @returns The type produced by successfully validating/coercing input data.\n *\n * @example\n * ```ts\n * type MyOutput = SerializableSchema.InferOutput<typeof schema>;\n * ```\n */\n type InferOutput<T extends SerializableSchema> = StandardTypedV1.InferOutput<T>;\n}\n/**\n * Type guard to check if a given value is a Standard Schema V1 object.\n *\n * @remarks\n * A Standard Schema object is expected to have a `~standard` property with a `validate` function.\n * This guard does NOT check for JSON schema support.\n *\n * @typeParam Input - The type of input validated by this schema.\n * @typeParam Output - The type of output produced after validation.\n * @param schema - The value to test.\n * @returns True if the schema conforms to the Standard Schema interface.\n *\n * @example\n * ```ts\n * if (isStandardSchema(mySchema)) {\n * const result = mySchema[\"~standard\"].validate(input);\n * }\n * ```\n */\nexport declare function isStandardSchema<Input = unknown, Output = Input>(schema: StandardSchemaV1<Input, Output>): schema is StandardSchemaV1<Input, Output>;\nexport declare function isStandardSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardSchemaV1<Input, Output>;\n/**\n * Type guard to check if a given value is a Standard JSON Schema V1 object.\n *\n * @remarks\n * A Standard JSON Schema object is expected to have a `~standard` property with a `jsonSchema` function.\n * This may be used to generate a JSON Schema (for UI/form tooling, documentation, etc).\n *\n * @typeParam Input - The type of input described by this JSON schema.\n * @typeParam Output - The type of output described by this JSON schema.\n * @param schema - The value to test.\n * @returns True if the schema exposes JSON schema generation.\n *\n * @example\n * ```ts\n * if (isStandardJSONSchema(mySchema)) {\n * const jschema = mySchema[\"~standard\"].jsonSchema();\n * }\n * ```\n */\nexport declare function isStandardJSONSchema<Input = unknown, Output = Input>(schema: StandardJSONSchemaV1<Input, Output>): schema is StandardJSONSchemaV1<Input, Output>;\nexport declare function isStandardJSONSchema<Input = unknown, Output = Input>(schema: unknown): schema is StandardJSONSchemaV1<Input, Output>;\n/**\n * Type guard to check if a given value is a `SerializableSchema`, i.e.\n * both a Standard Schema and a Standard JSON Schema object.\n *\n * @remarks\n * This checks for both the presence of a Standard Schema V1 interface\n * and the ability to generate a JSON schema.\n *\n * @typeParam Input - The type of input described by the schema.\n * @typeParam Output - The type of output described by the schema.\n * @param schema - The value to test.\n * @returns True if the schema is a valid `SerializableSchema`.\n *\n * @example\n * ```ts\n * if (isSerializableSchema(schema)) {\n * schema[\"~standard\"].validate(data);\n * const json = schema[\"~standard\"].jsonSchema();\n * }\n * ```\n */\nexport declare function isSerializableSchema<Input = unknown, Output = Input>(schema: SerializableSchema<Input, Output>): schema is SerializableSchema<Input, Output>;\nexport declare function isSerializableSchema<Input = unknown, Output = Input>(schema: unknown): schema is SerializableSchema<Input, Output>;\nexport {};\n"],"mappings":";;;UACUG,wCAAwCC,eAAeJ,gBAAAA,CAAiBM,MAAMF,OAAOC,SAASJ,oBAAAA,CAAqBK,MAAMF,OAAOC;AADrC;;;;;;;;;;AA+BrG;;;;;;;AAGA;;;;;;;;;AA6CA;;AAAmED,UAhDlDG,kBAgDkDH,CAAAA,QAAAA,OAAAA,EAAAA,SAhDLA,KAgDKA,CAAAA,CAAAA;aAAgCA,EA/ClFD,aA+CkFC,CA/CpEA,KA+CoEA,EA/C7DC,MA+C6DD,CAAAA;;AAAjBJ,kBA7CzDO,kBAAAA,CA6CyDP;;;;;AAClF;;;;;;;EA2CwBa,KAAAA,UAAAA,CAAAA,UA7EMN,kBA6Ec,CAAA,GA7EQL,eAAAA,CAAg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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"}
@@ -1,7 +1,6 @@
1
1
  import { SerializableSchema } from "../types.cjs";
2
2
 
3
3
  //#region src/state/values/reduced.d.ts
4
-
5
4
  /**
6
5
  * Symbol for runtime identification of ReducedValue instances.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reduced.d.cts","names":["SerializableSchema","REDUCED_VALUE_SYMBOL","ReducedValueInitBase","Value","Record","ReducedValueInitWithSchema","Input","ReducedValueInit","ReducedValue"],"sources":["../../../src/state/values/reduced.d.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport declare const REDUCED_VALUE_SYMBOL: unique symbol;\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> = ReducedValueInitWithSchema<Value, Input> | ReducedValueInitBase<Value>;\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport declare class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL]: true;\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n /**\n * Represents the value stored after all reductions.\n */\n ValueType: Value;\n /**\n * Represents the type that may be provided as input on each update.\n */\n InputType: Input;\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(valueSchema: SerializableSchema<unknown, Value>, init: ReducedValueInitWithSchema<Value, Input>);\n constructor(valueSchema: SerializableSchema<Input, Value>, init: ReducedValueInitBase<Value>);\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(value: ReducedValue<Value, Input>): value is ReducedValue<Value, Input>;\n static isInstance(value: unknown): value is ReducedValue;\n}\nexport {};\n"],"mappings":";;;;;;AAIA;AACUE,cADWD,oBACS,EAAA,OAAA,MAAA;UAApBC,oBAAoB,CAAA,QAAA,OAAA,C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AAA"}
@@ -1,7 +1,6 @@
1
1
  import { SerializableSchema } from "../types.js";
2
2
 
3
3
  //#region src/state/values/reduced.d.ts
4
-
5
4
  /**
6
5
  * Symbol for runtime identification of ReducedValue instances.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reduced.d.ts","names":["SerializableSchema","REDUCED_VALUE_SYMBOL","ReducedValueInitBase","Value","Record","ReducedValueInitWithSchema","Input","ReducedValueInit","ReducedValue"],"sources":["../../../src/state/values/reduced.d.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n/**\n * Symbol for runtime identification of ReducedValue instances.\n */\nexport declare const REDUCED_VALUE_SYMBOL: unique symbol;\ninterface ReducedValueInitBase<Value = unknown> {\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value, and must return the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new input value to apply to the reducer.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Value) => Value;\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\ninterface ReducedValueInitWithSchema<Value = unknown, Input = Value> {\n /**\n * Schema describing the type and validation logic for reducer input values.\n *\n * @remarks\n * - If provided, new values passed to the reducer will be validated using this schema before reduction.\n * - This allows the reducer to accept inputs distinct from the type stored in the state (output type).\n */\n inputSchema: SerializableSchema<unknown, Input>;\n /**\n * The reducer function that determines how new input values are combined with the current state.\n * Receives the current output value and a new input value (validated using `inputSchema`), and returns the updated output.\n *\n * @param current - The current value held in state.\n * @param next - The new validated input value to be applied.\n * @returns The next value to be stored in state.\n *\n * @remarks\n * - The logic for updating state in response to new inputs lives in this function.\n */\n reducer: (current: Value, next: Input) => Value;\n /**\n * Optional extra fields to be added to the exported JSON Schema for documentation or additional constraints.\n *\n * @remarks\n * - Use this property to attach metadata or documentation to the generated JSON Schema representation\n * of this value.\n * - These fields are merged into the generated schema, which can assist with code generation, UI hints,\n * or external documentation.\n */\n jsonSchemaExtra?: Record<string, unknown>;\n}\n/**\n * Initialization options for {@link ReducedValue}.\n *\n * Two forms are supported:\n * 1. Provide only a reducer (and optionally `jsonSchemaExtra`)—in this case, the reducer's inputs are validated using the output value schema.\n * 2. Provide an explicit `inputSchema` field to distinguish the reducer's input type from the stored/output type.\n *\n * @template Value - The type of value stored and produced after reduction.\n * @template Input - The type of inputs accepted by the reducer.\n *\n * @property inputSchema - The schema describing reducer inputs. If omitted, will use the value schema.\n * @property reducer - A function that receives the current output value and a new input, and returns the new output.\n * @property jsonSchemaExtra - (Optional) Extra fields to merge into the exported JSON Schema for documentation or additional constraints.\n */\nexport type ReducedValueInit<Value = unknown, Input = Value> = ReducedValueInitWithSchema<Value, Input> | ReducedValueInitBase<Value>;\n/**\n * Represents a state field whose value is computed and updated using a reducer function.\n *\n * {@link ReducedValue} allows you to define accumulators, counters, aggregators, or other fields\n * whose value is determined incrementally by applying a reducer to incoming updates.\n *\n * Each time a new input is provided, the reducer function is called with the current output\n * and the new input, producing an updated value. Input validation can be controlled separately\n * from output validation by providing an explicit input schema.\n *\n * @template Value - The type of the value stored in state and produced by reduction.\n * @template Input - The type of updates accepted by the reducer.\n *\n * @example\n * // Accumulator with distinct input validation\n * const Sum = new ReducedValue(z.number(), {\n * inputSchema: z.number().min(1),\n * reducer: (total, toAdd) => total + toAdd\n * });\n *\n * @example\n * // Simple running max, using only the value schema\n * const Max = new ReducedValue(z.number(), {\n * reducer: (current, next) => Math.max(current, next)\n * });\n */\nexport declare class ReducedValue<Value = unknown, Input = Value> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [REDUCED_VALUE_SYMBOL]: true;\n /**\n * The schema that describes the type of value stored in state (i.e., after reduction).\n * Note: We use `unknown` for the input type to allow schemas with `.default()` wrappers,\n * where the input type includes `undefined`.\n */\n readonly valueSchema: SerializableSchema<unknown, Value>;\n /**\n * The schema used to validate reducer inputs.\n * If not specified explicitly, this defaults to `valueSchema`.\n */\n readonly inputSchema: SerializableSchema<unknown, Input | Value>;\n /**\n * The reducer function that combines a current output value and an incoming input.\n */\n readonly reducer: (current: Value, next: Input) => Value;\n /**\n * Optional extra fields to merge into the generated JSON Schema (e.g., for documentation or constraints).\n */\n readonly jsonSchemaExtra?: Record<string, unknown>;\n /**\n * Represents the value stored after all reductions.\n */\n ValueType: Value;\n /**\n * Represents the type that may be provided as input on each update.\n */\n InputType: Input;\n /**\n * Constructs a ReducedValue instance, which combines a value schema and a reducer function (plus optional input schema).\n *\n * @param valueSchema - The schema that describes the type of value stored in state (the \"running total\").\n * @param init - An object specifying the reducer function (required), inputSchema (optional), and jsonSchemaExtra (optional).\n */\n constructor(valueSchema: SerializableSchema<unknown, Value>, init: ReducedValueInitWithSchema<Value, Input>);\n constructor(valueSchema: SerializableSchema<Input, Value>, init: ReducedValueInitBase<Value>);\n /**\n * Type guard to check if a value is a ReducedValue instance.\n */\n static isInstance<Value = unknown, Input = Value>(value: ReducedValue<Value, Input>): value is ReducedValue<Value, Input>;\n static isInstance(value: unknown): value is ReducedValue;\n}\nexport {};\n"],"mappings":";;;;;;AAIA;AACUE,cADWD,oBACS,EAAA,OAAA,MAAA;UAApBC,oBAAoB,CAAA,QAAA,OAAA,CAAA,CAAA;;;;;;AAsBF;;;;;;SAsBQI,EAAAA,CAAAA,OAAAA,EAhCbH,KAgCaG,EAAAA,IAAAA,EAhCAH,KAgCAG,EAAAA,GAhCUH,KAgCVG;;;;AA0BpC;;;;;;iBAA+HH,CAAAA,EAhDzGC,MAgDyGD,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;;UA9CrHE,0BA8CoH,CAAA,QAAA,OAAA,EAAA,QA9ChEF,KA8CgE,CAAA,CAAA;EA2BzGK;;;;;;;aAgByCL,EAjF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,IAClD,0BAAA,CAA2B,KAAA,EAAO,KAAA,IAClC,oBAAA,CAAqB,KAAA;;AA4BzB;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,YAAA,0BAAsC,KAAA;EAsEN;;;;EAAA,oBAjEvB,oBAAA;EAmEY;;;;;EAAA,SA5DvB,WAAA,EAAa,kBAAA,UAA4B,KAAA;EAZT;;;;EAAA,SAkBhC,WAAA,EAAa,kBAAA,UAA4B,KAAA,GAAQ,KAAA;EANR;;;EAAA,SAWzC,OAAA,GAAU,OAAA,EAAS,KAAA,EAAO,IAAA,EAAM,KAAA,KAAU,KAAA;EALO;;;EAAA,SAUjD,eAAA,GAAkB,MAAA;EALc;;;EAUjC,SAAA,EAAW,KAAA;EALQ;;;EAUnB,SAAA,EAAW,KAAA;EAAA;;;;;;EAQnB,WAAA,CACE,WAAA,EAAa,kBAAA,UAA4B,KAAA,GACzC,IAAA,EAAM,0BAAA,CAA2B,KAAA,EAAO,KAAA;EAG1C,WAAA,CACE,WAAA,EAAa,kBAAA,CAAmB,KAAA,EAAO,KAAA,GACvC,IAAA,EAAM,oBAAA,CAAqB,KAAA;EAL3B;;;EAAA,OAsBK,UAAA,0BAAoC,KAAA,CAAA,CACzC,KAAA,EAAO,YAAA,CAAa,KAAA,EAAO,KAAA,IAC1B,KAAA,IAAS,YAAA,CAAa,KAAA,EAAO,KAAA;EAAA,OAEzB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,YAAA;AAAA"}
@@ -1,7 +1,6 @@
1
1
  import { SerializableSchema } from "../types.cjs";
2
2
 
3
3
  //#region src/state/values/untracked.d.ts
4
-
5
4
  /**
6
5
  * Symbol for runtime identification of UntrackedValue instances.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.d.cts","names":["SerializableSchema","UNTRACKED_VALUE_SYMBOL","UntrackedValueInit","UntrackedValue","Value"],"sources":["../../../src/state/values/untracked.d.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport declare const UNTRACKED_VALUE_SYMBOL: unique symbol;\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport declare class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL]: true;\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n /**\n * Represents the type of value stored in this untracked state field.\n */\n ValueType: Value;\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit);\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(value: UntrackedValue<Value>): value is UntrackedValue<Value>;\n static isInstance(value: unknown): value is UntrackedValue;\n}\n"],"mappings":";;;;;;AAIA;AAIiBE,cAJID,sBAIc,EAAA,OAAA,MAAA;AA0BnC;;;AAWyCG,UArCxBF,kBAAAA,CAqCwBE;;;;;OAoBkBF,CAAAA,EAAAA,OAAAA;;;;;;;;;;;;;;;;;;;;;cA/BtCC;;;;;sBAKGF,sBAAAA;;;;;;oBAMFD,mBAAmBI;;;;;;;;;;;;;aAa1BA;;;;;;;uBAOUJ,mBAAmBI,eAAeF;;;;4CAIbC,eAAeC,kBAAkBD,eAAeC;8CAC9CD"}
1
+ {"version":3,"file":"untracked.d.cts","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"}
@@ -1,7 +1,6 @@
1
1
  import { SerializableSchema } from "../types.js";
2
2
 
3
3
  //#region src/state/values/untracked.d.ts
4
-
5
4
  /**
6
5
  * Symbol for runtime identification of UntrackedValue instances.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"untracked.d.ts","names":["SerializableSchema","UNTRACKED_VALUE_SYMBOL","UntrackedValueInit","UntrackedValue","Value"],"sources":["../../../src/state/values/untracked.d.ts"],"sourcesContent":["import type { SerializableSchema } from \"../types.js\";\n/**\n * Symbol for runtime identification of UntrackedValue instances.\n */\nexport declare const UNTRACKED_VALUE_SYMBOL: unique symbol;\n/**\n * Initialization options for {@link UntrackedValue}.\n */\nexport interface UntrackedValueInit {\n /**\n * If true (default), throws an error if multiple updates are made in a single step.\n * If false, only the last value is kept per step.\n */\n guard?: boolean;\n}\n/**\n * Represents a state field whose value is transient and never checkpointed.\n *\n * Use {@link UntrackedValue} for state fields that should be tracked for the lifetime\n * of the process, but should not participate in durable checkpoints or recovery.\n *\n * @typeParam Value - The type of value stored in this field.\n *\n * @example\n * // Create an untracked in-memory cache\n * const cache = new UntrackedValue<Record<string, number>>();\n *\n * // Use with a type schema for basic runtime validation\n * import { z } from \"zod\";\n * const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });\n *\n * // You can customize whether to throw on multiple updates per step:\n * const session = new UntrackedValue(undefined, { guard: false });\n */\nexport declare class UntrackedValue<Value = unknown> {\n /**\n * Instance marker for runtime identification.\n * @internal\n */\n protected readonly [UNTRACKED_VALUE_SYMBOL]: true;\n /**\n * Optional schema describing the type and shape of the value stored in this field.\n *\n * If provided, this can be used for runtime validation or code generation.\n */\n readonly schema?: SerializableSchema<Value>;\n /**\n * Whether to guard against multiple updates to this untracked value in a single step.\n *\n * - If `true` (default), throws an error if multiple updates are received in one step.\n * - If `false`, only the last value from that step is kept, others are ignored.\n *\n * This helps prevent accidental state replacement within a step.\n */\n readonly guard: boolean;\n /**\n * Represents the type of value stored in this untracked state field.\n */\n ValueType: Value;\n /**\n * Create a new untracked value state field.\n *\n * @param schema - Optional type schema describing the value (e.g. a Zod schema).\n * @param init - Optional options for tracking updates or enabling multiple-writes-per-step.\n */\n constructor(schema?: SerializableSchema<Value>, init?: UntrackedValueInit);\n /**\n * Type guard to check if a value is an UntrackedValue instance.\n */\n static isInstance<Value = unknown>(value: UntrackedValue<Value>): value is UntrackedValue<Value>;\n static isInstance(value: unknown): value is UntrackedValue;\n}\n"],"mappings":";;;;;;AAIA;AAIiBE,cAJID,sBAIc,EAAA,OAAA,MAAA;AA0BnC;;;AAWyCG,UArCxBF,kBAAAA,CAqCwBE;;;;;OAoBkBF,CAAAA,EAAAA,OAAAA;;;;;;;;;;;;;;;;;;;;;cA/BtCC;;;;;sBAKGF,sBAAAA;;;;;;oBAMFD,mBAAmBI;;;;;;;;;;;;;aAa1BA;;;;;;;uBAOUJ,mBAAmBI,eAAeF;;;;4CAIbC,eAAeC,kBAAkBD,eAAeC;8CAC9CD"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.cts","names":["CallbackManagerForChainRun","Runnable","RunnableConfig","RunnableCallableArgs","Partial","RunnableCallable","I","O","Promise","prefixGenerator","T","Generator","Prefix","gatherIterator","AsyncIterable","Iterable","Array","gatherIteratorSync","patchConfigurable","Record","isAsyncGeneratorFunction","AsyncGeneratorFunction","isGeneratorFunction","GeneratorFunction"],"sources":["../src/utils.d.ts"],"sourcesContent":["import { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nexport interface RunnableCallableArgs extends Partial<any> {\n name?: string;\n func: (...args: any[]) => any;\n tags?: string[];\n trace?: boolean;\n recurse?: boolean;\n}\nexport declare class RunnableCallable<I = unknown, O = unknown> extends Runnable<I, O> {\n lc_namespace: string[];\n func: (...args: any[]) => any;\n tags?: string[];\n config?: RunnableConfig;\n trace: boolean;\n recurse: boolean;\n constructor(fields: RunnableCallableArgs);\n protected _tracedInvoke(input: I, config?: Partial<RunnableConfig>, runManager?: CallbackManagerForChainRun): Promise<O>;\n invoke(input: I, options?: Partial<RunnableConfig> | undefined): Promise<O>;\n}\nexport declare function prefixGenerator<T, Prefix extends string>(generator: Generator<T>, prefix: Prefix): Generator<[Prefix, T]>;\nexport declare function prefixGenerator<T>(generator: Generator<T>, prefix?: undefined): Generator<T>;\nexport declare function prefixGenerator<T, Prefix extends string | undefined = undefined>(generator: Generator<T>, prefix?: Prefix | undefined): Generator<Prefix extends string ? [Prefix, T] : T>;\nexport declare function gatherIterator<T>(i: AsyncIterable<T> | Promise<AsyncIterable<T>> | Iterable<T> | Promise<Iterable<T>>): Promise<Array<T>>;\nexport declare function gatherIteratorSync<T>(i: Iterable<T>): Array<T>;\nexport declare function patchConfigurable(config: RunnableConfig | undefined, patch: Record<string, any>): RunnableConfig;\nexport declare function isAsyncGeneratorFunction(val: unknown): val is AsyncGeneratorFunction;\nexport declare function isGeneratorFunction(val: unknown): val is GeneratorFunction;\n"],"mappings":";;;;UAEiBG,oBAAAA,SAA6BC;;EAA7BD,IAAAA,EAAAA,CAAAA,GAAAA,IAAAA,EAAAA,GAAAA,EAAAA,EAAoB,GAAA,GAAA;EAOhBE,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAgB,KAAA,CAAA,EAAA,OAAA;SAA4CC,CAAAA,EAAAA,OAAAA;;AAIpEJ,cAJQG,gBAIRH,CAAAA,IAAAA,OAAAA,EAAAA,IAAAA,OAAAA,CAAAA,SAJ2DD,QAI3DC,CAJoEI,CAIpEJ,EAJuEK,CAIvEL,CAAAA,CAAAA;cAGWC,EAAAA,MAAAA,EAA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ChainRun","Runnable","RunnableConfig","RunnableCallableArgs","Partial","RunnableCallable","I","O","Promise","prefixGenerator","T","Generator","Prefix","gatherIterator","AsyncIterable","Iterable","Array","gatherIteratorSync","patchConfigurable","Record","isAsyncGeneratorFunction","AsyncGeneratorFunction","isGeneratorFunction","GeneratorFunction"],"sources":["../src/utils.d.ts"],"sourcesContent":["import { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nexport interface RunnableCallableArgs extends Partial<any> {\n name?: string;\n func: (...args: any[]) => any;\n tags?: string[];\n trace?: boolean;\n recurse?: boolean;\n}\nexport declare class RunnableCallable<I = unknown, O = unknown> extends Runnable<I, O> {\n lc_namespace: string[];\n func: (...args: any[]) => any;\n tags?: string[];\n config?: RunnableConfig;\n trace: boolean;\n recurse: boolean;\n constructor(fields: RunnableCallableArgs);\n protected _tracedInvoke(input: I, config?: Partial<RunnableConfig>, runManager?: CallbackManagerForChainRun): Promise<O>;\n invoke(input: I, options?: Partial<RunnableConfig> | undefined): Promise<O>;\n}\nexport declare function prefixGenerator<T, Prefix extends string>(generator: Generator<T>, prefix: Prefix): Generator<[Prefix, T]>;\nexport declare function prefixGenerator<T>(generator: Generator<T>, prefix?: undefined): Generator<T>;\nexport declare function prefixGenerator<T, Prefix extends string | undefined = undefined>(generator: Generator<T>, prefix?: Prefix | undefined): Generator<Prefix extends string ? [Prefix, T] : T>;\nexport declare function gatherIterator<T>(i: AsyncIterable<T> | Promise<AsyncIterable<T>> | Iterable<T> | Promise<Iterable<T>>): Promise<Array<T>>;\nexport declare function gatherIteratorSync<T>(i: Iterable<T>): Array<T>;\nexport declare function patchConfigurable(config: RunnableConfig | undefined, patch: Record<string, any>): RunnableConfig;\nexport declare function isAsyncGeneratorFunction(val: unknown): val is AsyncGeneratorFunction;\nexport declare function isGeneratorFunction(val: unknown): val is GeneratorFunction;\n"],"mappings":";;;;UAEiBG,oBAAAA,SAA6BC;;EAA7BD,I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ET,KAAA;EAEA,OAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,oBAAA;EAAA,UASJ,aAAA,CACd,KAAA,EAAO,CAAA,EACP,MAAA,GAAS,OAAA,CAAQ,cAAA,GACjB,UAAA,GAAa,0BAAA,GAA0B,OAAA,CAAA,CAAA;EAoBnC,MAAA,CAEJ,KAAA,EAAO,CAAA,EACP,OAAA,GAAU,OAAA,CAAQ,cAAA,gBAEjB,OAAA,CAAQ,CAAA;AAAA"}
package/dist/web.d.ts CHANGED
@@ -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 };
@@ -1 +1 @@
1
- {"version":3,"file":"writer.d.cts","names":["writer","T","InferWriterType","C"],"sources":["../src/writer.d.ts"],"sourcesContent":["export declare function writer<T>(chunk: T): void;\nexport type InferWriterType<T> = T extends typeof writer<infer C> ? C : any;\n"],"mappings":";iBAAwBA,iBAAiBC;AAAjBD,KACZE,eAD8B,CAAA,CAAA,CAAA,GACTD,CADS,SAAA,OACQD,MADR,CAAA,KAAA,EAAA,CAAA,GAC0BG,CAD1B,GAAA,GAAA"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"writer.d.ts","names":["writer","T","InferWriterType","C"],"sources":["../src/writer.d.ts"],"sourcesContent":["export declare function writer<T>(chunk: T): void;\nexport type InferWriterType<T> = T extends typeof writer<infer C> ? C : any;\n"],"mappings":";iBAAwBA,iBAAiBC;AAAjBD,KACZE,eAD8B,CAAA,CAAA,CAAA,GACTD,CADS,SAAA,OACQD,MADR,CAAA,KAAA,EAAA,CAAA,GAC0BG,CAD1B,GAAA,GAAA"}
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.4",
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": "~1.6.0"
22
+ "@langchain/langgraph-sdk": "~2.0.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@langchain/core": "^1.1.16",