@langchain/langgraph 0.3.1 → 0.3.3
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/graph/messages_annotation.cjs +2 -2
- package/dist/graph/messages_annotation.d.ts +2 -2
- package/dist/graph/messages_annotation.js +1 -1
- package/dist/graph/messages_annotation.js.map +1 -1
- package/dist/graph/state.cjs +46 -21
- package/dist/graph/state.d.ts +17 -12
- package/dist/graph/state.js +46 -21
- package/dist/graph/state.js.map +1 -1
- package/dist/graph/zod/index.cjs +16 -3
- package/dist/graph/zod/index.d.ts +2 -1
- package/dist/graph/zod/index.js +2 -1
- package/dist/graph/zod/index.js.map +1 -1
- package/dist/graph/zod/meta.cjs +180 -0
- package/dist/graph/zod/meta.d.ts +110 -0
- package/dist/graph/zod/meta.js +175 -0
- package/dist/graph/zod/meta.js.map +1 -0
- package/dist/graph/zod/plugin.cjs +30 -27
- package/dist/graph/zod/plugin.d.ts +16 -3
- package/dist/graph/zod/plugin.js +31 -28
- package/dist/graph/zod/plugin.js.map +1 -1
- package/dist/graph/zod/schema.cjs +45 -19
- package/dist/graph/zod/schema.d.ts +7 -8
- package/dist/graph/zod/schema.js +45 -19
- package/dist/graph/zod/schema.js.map +1 -1
- package/dist/graph/zod/zod-registry.cjs +49 -0
- package/dist/graph/zod/zod-registry.d.ts +24 -0
- package/dist/graph/zod/zod-registry.js +45 -0
- package/dist/graph/zod/zod-registry.js.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.ts +3 -3
- package/package.json +7 -7
- package/dist/graph/zod/state.cjs +0 -135
- package/dist/graph/zod/state.d.ts +0 -39
- package/dist/graph/zod/state.js +0 -125
- package/dist/graph/zod/state.js.map +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schemaMetaRegistry = exports.SchemaMetaRegistry = exports.META_EXTRAS_DESCRIPTION_PREFIX = void 0;
|
|
4
|
+
exports.withLangGraph = withLangGraph;
|
|
5
|
+
const types_1 = require("@langchain/core/utils/types");
|
|
6
|
+
const binop_js_1 = require("../../channels/binop.cjs");
|
|
7
|
+
const last_value_js_1 = require("../../channels/last_value.cjs");
|
|
8
|
+
exports.META_EXTRAS_DESCRIPTION_PREFIX = "lg:";
|
|
9
|
+
/**
|
|
10
|
+
* A registry for storing and managing metadata associated with schemas.
|
|
11
|
+
* This class provides methods to get, extend, remove, and check metadata for a given schema.
|
|
12
|
+
*/
|
|
13
|
+
class SchemaMetaRegistry {
|
|
14
|
+
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* Internal map storing schema metadata.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(this, "_map", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: new WeakMap()
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Cache for extended schfemas.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(this, "_extensionCache", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: new Map()
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the metadata associated with a given schema.
|
|
38
|
+
* @template TValue The value type of the schema.
|
|
39
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
40
|
+
* @param schema The schema to retrieve metadata for.
|
|
41
|
+
* @returns The associated SchemaMeta, or undefined if not present.
|
|
42
|
+
*/
|
|
43
|
+
get(schema) {
|
|
44
|
+
return this._map.get(schema);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Extends or sets the metadata for a given schema.
|
|
48
|
+
* @template TValue The value type of the schema.
|
|
49
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
50
|
+
* @param schema The schema to extend metadata for.
|
|
51
|
+
* @param predicate A function that receives the existing metadata (or undefined) and returns the new metadata.
|
|
52
|
+
*/
|
|
53
|
+
extend(schema, predicate) {
|
|
54
|
+
const existingMeta = this.get(schema);
|
|
55
|
+
this._map.set(schema, predicate(existingMeta));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Removes the metadata associated with a given schema.
|
|
59
|
+
* @param schema The schema to remove metadata for.
|
|
60
|
+
* @returns The SchemaMetaRegistry instance (for chaining).
|
|
61
|
+
*/
|
|
62
|
+
remove(schema) {
|
|
63
|
+
this._map.delete(schema);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Checks if metadata exists for a given schema.
|
|
68
|
+
* @param schema The schema to check.
|
|
69
|
+
* @returns True if metadata exists, false otherwise.
|
|
70
|
+
*/
|
|
71
|
+
has(schema) {
|
|
72
|
+
return this._map.has(schema);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns a mapping of channel instances for each property in the schema
|
|
76
|
+
* using the associated metadata in the registry.
|
|
77
|
+
*
|
|
78
|
+
* This is used to create the `channels` object that's passed to the `Graph` constructor.
|
|
79
|
+
*
|
|
80
|
+
* @template T The shape of the schema.
|
|
81
|
+
* @param schema The schema to extract channels from.
|
|
82
|
+
* @returns A mapping from property names to channel instances.
|
|
83
|
+
*/
|
|
84
|
+
getChannelsForSchema(schema) {
|
|
85
|
+
const channels = {};
|
|
86
|
+
const shape = (0, types_1.getInteropZodObjectShape)(schema);
|
|
87
|
+
for (const [key, channelSchema] of Object.entries(shape)) {
|
|
88
|
+
const meta = this.get(channelSchema);
|
|
89
|
+
if (meta?.reducer) {
|
|
90
|
+
channels[key] = new binop_js_1.BinaryOperatorAggregate(meta.reducer.fn, meta.default);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
channels[key] = new last_value_js_1.LastValue();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return channels;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns a modified schema that introspectively looks at all keys of the provided
|
|
100
|
+
* object schema, and applies the augmentations based on meta provided with those keys
|
|
101
|
+
* in the registry and the selectors provided in the `effects` parameter.
|
|
102
|
+
*
|
|
103
|
+
* This assumes that the passed in schema is the "root" schema object for a graph where
|
|
104
|
+
* the keys of the schema are the channels of the graph. Because we need to represent
|
|
105
|
+
* the input of a graph in a couple of different ways, the `effects` parameter allows
|
|
106
|
+
* us to apply those augmentations based on pre determined conditions.
|
|
107
|
+
*
|
|
108
|
+
* @param schema The root schema object to extend.
|
|
109
|
+
* @param effects The effects that are being applied.
|
|
110
|
+
* @returns The extended schema.
|
|
111
|
+
*/
|
|
112
|
+
getExtendedChannelSchemas(schema, effects) {
|
|
113
|
+
// If no effects are being applied, return the schema unchanged
|
|
114
|
+
if (Object.keys(effects).length === 0) {
|
|
115
|
+
return schema;
|
|
116
|
+
}
|
|
117
|
+
// Cache key is determined by looking at the effects that are being applied
|
|
118
|
+
const cacheKey = Object.entries(effects)
|
|
119
|
+
.filter(([, v]) => v === true)
|
|
120
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
121
|
+
.map(([k, v]) => `${k}:${v}`)
|
|
122
|
+
.join("|");
|
|
123
|
+
const cache = this._extensionCache.get(cacheKey) ?? new WeakMap();
|
|
124
|
+
if (cache.has(schema))
|
|
125
|
+
return cache.get(schema);
|
|
126
|
+
let modifiedSchema = schema;
|
|
127
|
+
if (effects.withReducerSchema ||
|
|
128
|
+
effects.withJsonSchemaExtrasAsDescription) {
|
|
129
|
+
const newShapeEntries = Object.entries((0, types_1.getInteropZodObjectShape)(schema)).map(([key, schema]) => {
|
|
130
|
+
const meta = this.get(schema);
|
|
131
|
+
let outputSchema = effects.withReducerSchema
|
|
132
|
+
? meta?.reducer?.schema ?? schema
|
|
133
|
+
: schema;
|
|
134
|
+
if (effects.withJsonSchemaExtrasAsDescription &&
|
|
135
|
+
meta?.jsonSchemaExtra) {
|
|
136
|
+
const description = (0, types_1.getSchemaDescription)(outputSchema) ?? (0, types_1.getSchemaDescription)(schema);
|
|
137
|
+
const strExtras = JSON.stringify({
|
|
138
|
+
...meta.jsonSchemaExtra,
|
|
139
|
+
description,
|
|
140
|
+
});
|
|
141
|
+
outputSchema = outputSchema.describe(`${exports.META_EXTRAS_DESCRIPTION_PREFIX}${strExtras}`);
|
|
142
|
+
}
|
|
143
|
+
return [key, outputSchema];
|
|
144
|
+
});
|
|
145
|
+
modifiedSchema = (0, types_1.extendInteropZodObject)(schema, Object.fromEntries(newShapeEntries));
|
|
146
|
+
if ((0, types_1.isZodSchemaV3)(modifiedSchema)) {
|
|
147
|
+
modifiedSchema._def.unknownKeys = "strip";
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (effects.asPartial) {
|
|
151
|
+
modifiedSchema = (0, types_1.interopZodObjectPartial)(modifiedSchema);
|
|
152
|
+
}
|
|
153
|
+
cache.set(schema, modifiedSchema);
|
|
154
|
+
this._extensionCache.set(cacheKey, cache);
|
|
155
|
+
return modifiedSchema;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.SchemaMetaRegistry = SchemaMetaRegistry;
|
|
159
|
+
exports.schemaMetaRegistry = new SchemaMetaRegistry();
|
|
160
|
+
function withLangGraph(schema, meta) {
|
|
161
|
+
if (meta.reducer && !meta.default) {
|
|
162
|
+
const defaultValueGetter = (0, types_1.getInteropZodDefaultGetter)(schema);
|
|
163
|
+
if (defaultValueGetter != null) {
|
|
164
|
+
// eslint-disable-next-line no-param-reassign
|
|
165
|
+
meta.default = defaultValueGetter;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (meta.reducer) {
|
|
169
|
+
const schemaWithReducer = Object.assign(schema, {
|
|
170
|
+
lg_reducer_schema: meta.reducer?.schema ?? schema,
|
|
171
|
+
});
|
|
172
|
+
exports.schemaMetaRegistry.extend(schemaWithReducer, () => meta);
|
|
173
|
+
return schemaWithReducer;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
exports.schemaMetaRegistry.extend(schema, () => meta);
|
|
177
|
+
return schema;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { InteropZodObject, InteropZodType, InteropZodObjectShape } from "@langchain/core/utils/types";
|
|
2
|
+
import { BaseChannel } from "../../channels/base.js";
|
|
3
|
+
export declare const META_EXTRAS_DESCRIPTION_PREFIX = "lg:";
|
|
4
|
+
export type ReducedZodChannel<T extends InteropZodType, TReducerSchema extends InteropZodType> = T & {
|
|
5
|
+
lg_reducer_schema: TReducerSchema;
|
|
6
|
+
};
|
|
7
|
+
export type InteropZodToStateDefinition<T extends InteropZodObject, TShape = InteropZodObjectShape<T>> = {
|
|
8
|
+
[key in keyof TShape]: TShape[key] extends ReducedZodChannel<infer Schema, infer ReducerSchema> ? Schema extends InteropZodType<infer V> ? ReducerSchema extends InteropZodType<infer U> ? BaseChannel<V, U> : never : never : TShape[key] extends InteropZodType<infer V, infer U> ? BaseChannel<V, U> : never;
|
|
9
|
+
};
|
|
10
|
+
export interface SchemaMeta<TValue = any, TUpdate = TValue> {
|
|
11
|
+
jsonSchemaExtra?: {
|
|
12
|
+
langgraph_nodes?: string[];
|
|
13
|
+
langgraph_type?: "prompt" | "messages";
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
reducer?: {
|
|
17
|
+
schema?: InteropZodType<TUpdate>;
|
|
18
|
+
fn: (a: TValue, b: TUpdate) => TValue;
|
|
19
|
+
};
|
|
20
|
+
default?: () => TValue;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A registry for storing and managing metadata associated with schemas.
|
|
25
|
+
* This class provides methods to get, extend, remove, and check metadata for a given schema.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SchemaMetaRegistry {
|
|
28
|
+
/**
|
|
29
|
+
* Internal map storing schema metadata.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
_map: WeakMap<InteropZodType, SchemaMeta<any, any>>;
|
|
33
|
+
/**
|
|
34
|
+
* Cache for extended schfemas.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
_extensionCache: Map<string, WeakMap<InteropZodType, InteropZodType>>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the metadata associated with a given schema.
|
|
40
|
+
* @template TValue The value type of the schema.
|
|
41
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
42
|
+
* @param schema The schema to retrieve metadata for.
|
|
43
|
+
* @returns The associated SchemaMeta, or undefined if not present.
|
|
44
|
+
*/
|
|
45
|
+
get<TValue, TUpdate = TValue>(schema: InteropZodType<TValue>): SchemaMeta<TValue, TUpdate> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Extends or sets the metadata for a given schema.
|
|
48
|
+
* @template TValue The value type of the schema.
|
|
49
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
50
|
+
* @param schema The schema to extend metadata for.
|
|
51
|
+
* @param predicate A function that receives the existing metadata (or undefined) and returns the new metadata.
|
|
52
|
+
*/
|
|
53
|
+
extend<TValue, TUpdate>(schema: InteropZodType<TValue>, predicate: (meta: SchemaMeta<TValue, TUpdate> | undefined) => SchemaMeta<TValue, TUpdate>): void;
|
|
54
|
+
/**
|
|
55
|
+
* Removes the metadata associated with a given schema.
|
|
56
|
+
* @param schema The schema to remove metadata for.
|
|
57
|
+
* @returns The SchemaMetaRegistry instance (for chaining).
|
|
58
|
+
*/
|
|
59
|
+
remove(schema: InteropZodType): this;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if metadata exists for a given schema.
|
|
62
|
+
* @param schema The schema to check.
|
|
63
|
+
* @returns True if metadata exists, false otherwise.
|
|
64
|
+
*/
|
|
65
|
+
has(schema: InteropZodType): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Returns a mapping of channel instances for each property in the schema
|
|
68
|
+
* using the associated metadata in the registry.
|
|
69
|
+
*
|
|
70
|
+
* This is used to create the `channels` object that's passed to the `Graph` constructor.
|
|
71
|
+
*
|
|
72
|
+
* @template T The shape of the schema.
|
|
73
|
+
* @param schema The schema to extract channels from.
|
|
74
|
+
* @returns A mapping from property names to channel instances.
|
|
75
|
+
*/
|
|
76
|
+
getChannelsForSchema<T extends InteropZodObject>(schema: T): InteropZodToStateDefinition<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Returns a modified schema that introspectively looks at all keys of the provided
|
|
79
|
+
* object schema, and applies the augmentations based on meta provided with those keys
|
|
80
|
+
* in the registry and the selectors provided in the `effects` parameter.
|
|
81
|
+
*
|
|
82
|
+
* This assumes that the passed in schema is the "root" schema object for a graph where
|
|
83
|
+
* the keys of the schema are the channels of the graph. Because we need to represent
|
|
84
|
+
* the input of a graph in a couple of different ways, the `effects` parameter allows
|
|
85
|
+
* us to apply those augmentations based on pre determined conditions.
|
|
86
|
+
*
|
|
87
|
+
* @param schema The root schema object to extend.
|
|
88
|
+
* @param effects The effects that are being applied.
|
|
89
|
+
* @returns The extended schema.
|
|
90
|
+
*/
|
|
91
|
+
getExtendedChannelSchemas<T extends InteropZodObject>(schema: T, effects: {
|
|
92
|
+
/**
|
|
93
|
+
* Augments the shape by using the reducer's schema if it exists
|
|
94
|
+
*/
|
|
95
|
+
withReducerSchema?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Applies the stringified jsonSchemaExtra as a description to the schema.
|
|
98
|
+
*/
|
|
99
|
+
withJsonSchemaExtrasAsDescription?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Applies the `.partial()` modifier to the schema.
|
|
102
|
+
*/
|
|
103
|
+
asPartial?: boolean;
|
|
104
|
+
}): InteropZodObject;
|
|
105
|
+
}
|
|
106
|
+
export declare const schemaMetaRegistry: SchemaMetaRegistry;
|
|
107
|
+
export declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate> & {
|
|
108
|
+
reducer?: undefined;
|
|
109
|
+
}): TSchema;
|
|
110
|
+
export declare function withLangGraph<TValue, TUpdate, TSchema extends InteropZodType<TValue>>(schema: TSchema, meta: SchemaMeta<TValue, TUpdate>): ReducedZodChannel<TSchema, InteropZodType<TUpdate>>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { getInteropZodObjectShape, extendInteropZodObject, getInteropZodDefaultGetter, interopZodObjectPartial, isZodSchemaV3, getSchemaDescription, } from "@langchain/core/utils/types";
|
|
2
|
+
import { BinaryOperatorAggregate } from "../../channels/binop.js";
|
|
3
|
+
import { LastValue } from "../../channels/last_value.js";
|
|
4
|
+
export const META_EXTRAS_DESCRIPTION_PREFIX = "lg:";
|
|
5
|
+
/**
|
|
6
|
+
* A registry for storing and managing metadata associated with schemas.
|
|
7
|
+
* This class provides methods to get, extend, remove, and check metadata for a given schema.
|
|
8
|
+
*/
|
|
9
|
+
export class SchemaMetaRegistry {
|
|
10
|
+
constructor() {
|
|
11
|
+
/**
|
|
12
|
+
* Internal map storing schema metadata.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(this, "_map", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: new WeakMap()
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Cache for extended schfemas.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(this, "_extensionCache", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: new Map()
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the metadata associated with a given schema.
|
|
34
|
+
* @template TValue The value type of the schema.
|
|
35
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
36
|
+
* @param schema The schema to retrieve metadata for.
|
|
37
|
+
* @returns The associated SchemaMeta, or undefined if not present.
|
|
38
|
+
*/
|
|
39
|
+
get(schema) {
|
|
40
|
+
return this._map.get(schema);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extends or sets the metadata for a given schema.
|
|
44
|
+
* @template TValue The value type of the schema.
|
|
45
|
+
* @template TUpdate The update type of the schema (defaults to TValue).
|
|
46
|
+
* @param schema The schema to extend metadata for.
|
|
47
|
+
* @param predicate A function that receives the existing metadata (or undefined) and returns the new metadata.
|
|
48
|
+
*/
|
|
49
|
+
extend(schema, predicate) {
|
|
50
|
+
const existingMeta = this.get(schema);
|
|
51
|
+
this._map.set(schema, predicate(existingMeta));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Removes the metadata associated with a given schema.
|
|
55
|
+
* @param schema The schema to remove metadata for.
|
|
56
|
+
* @returns The SchemaMetaRegistry instance (for chaining).
|
|
57
|
+
*/
|
|
58
|
+
remove(schema) {
|
|
59
|
+
this._map.delete(schema);
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Checks if metadata exists for a given schema.
|
|
64
|
+
* @param schema The schema to check.
|
|
65
|
+
* @returns True if metadata exists, false otherwise.
|
|
66
|
+
*/
|
|
67
|
+
has(schema) {
|
|
68
|
+
return this._map.has(schema);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns a mapping of channel instances for each property in the schema
|
|
72
|
+
* using the associated metadata in the registry.
|
|
73
|
+
*
|
|
74
|
+
* This is used to create the `channels` object that's passed to the `Graph` constructor.
|
|
75
|
+
*
|
|
76
|
+
* @template T The shape of the schema.
|
|
77
|
+
* @param schema The schema to extract channels from.
|
|
78
|
+
* @returns A mapping from property names to channel instances.
|
|
79
|
+
*/
|
|
80
|
+
getChannelsForSchema(schema) {
|
|
81
|
+
const channels = {};
|
|
82
|
+
const shape = getInteropZodObjectShape(schema);
|
|
83
|
+
for (const [key, channelSchema] of Object.entries(shape)) {
|
|
84
|
+
const meta = this.get(channelSchema);
|
|
85
|
+
if (meta?.reducer) {
|
|
86
|
+
channels[key] = new BinaryOperatorAggregate(meta.reducer.fn, meta.default);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
channels[key] = new LastValue();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return channels;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Returns a modified schema that introspectively looks at all keys of the provided
|
|
96
|
+
* object schema, and applies the augmentations based on meta provided with those keys
|
|
97
|
+
* in the registry and the selectors provided in the `effects` parameter.
|
|
98
|
+
*
|
|
99
|
+
* This assumes that the passed in schema is the "root" schema object for a graph where
|
|
100
|
+
* the keys of the schema are the channels of the graph. Because we need to represent
|
|
101
|
+
* the input of a graph in a couple of different ways, the `effects` parameter allows
|
|
102
|
+
* us to apply those augmentations based on pre determined conditions.
|
|
103
|
+
*
|
|
104
|
+
* @param schema The root schema object to extend.
|
|
105
|
+
* @param effects The effects that are being applied.
|
|
106
|
+
* @returns The extended schema.
|
|
107
|
+
*/
|
|
108
|
+
getExtendedChannelSchemas(schema, effects) {
|
|
109
|
+
// If no effects are being applied, return the schema unchanged
|
|
110
|
+
if (Object.keys(effects).length === 0) {
|
|
111
|
+
return schema;
|
|
112
|
+
}
|
|
113
|
+
// Cache key is determined by looking at the effects that are being applied
|
|
114
|
+
const cacheKey = Object.entries(effects)
|
|
115
|
+
.filter(([, v]) => v === true)
|
|
116
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
117
|
+
.map(([k, v]) => `${k}:${v}`)
|
|
118
|
+
.join("|");
|
|
119
|
+
const cache = this._extensionCache.get(cacheKey) ?? new WeakMap();
|
|
120
|
+
if (cache.has(schema))
|
|
121
|
+
return cache.get(schema);
|
|
122
|
+
let modifiedSchema = schema;
|
|
123
|
+
if (effects.withReducerSchema ||
|
|
124
|
+
effects.withJsonSchemaExtrasAsDescription) {
|
|
125
|
+
const newShapeEntries = Object.entries(getInteropZodObjectShape(schema)).map(([key, schema]) => {
|
|
126
|
+
const meta = this.get(schema);
|
|
127
|
+
let outputSchema = effects.withReducerSchema
|
|
128
|
+
? meta?.reducer?.schema ?? schema
|
|
129
|
+
: schema;
|
|
130
|
+
if (effects.withJsonSchemaExtrasAsDescription &&
|
|
131
|
+
meta?.jsonSchemaExtra) {
|
|
132
|
+
const description = getSchemaDescription(outputSchema) ?? getSchemaDescription(schema);
|
|
133
|
+
const strExtras = JSON.stringify({
|
|
134
|
+
...meta.jsonSchemaExtra,
|
|
135
|
+
description,
|
|
136
|
+
});
|
|
137
|
+
outputSchema = outputSchema.describe(`${META_EXTRAS_DESCRIPTION_PREFIX}${strExtras}`);
|
|
138
|
+
}
|
|
139
|
+
return [key, outputSchema];
|
|
140
|
+
});
|
|
141
|
+
modifiedSchema = extendInteropZodObject(schema, Object.fromEntries(newShapeEntries));
|
|
142
|
+
if (isZodSchemaV3(modifiedSchema)) {
|
|
143
|
+
modifiedSchema._def.unknownKeys = "strip";
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (effects.asPartial) {
|
|
147
|
+
modifiedSchema = interopZodObjectPartial(modifiedSchema);
|
|
148
|
+
}
|
|
149
|
+
cache.set(schema, modifiedSchema);
|
|
150
|
+
this._extensionCache.set(cacheKey, cache);
|
|
151
|
+
return modifiedSchema;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export const schemaMetaRegistry = new SchemaMetaRegistry();
|
|
155
|
+
export function withLangGraph(schema, meta) {
|
|
156
|
+
if (meta.reducer && !meta.default) {
|
|
157
|
+
const defaultValueGetter = getInteropZodDefaultGetter(schema);
|
|
158
|
+
if (defaultValueGetter != null) {
|
|
159
|
+
// eslint-disable-next-line no-param-reassign
|
|
160
|
+
meta.default = defaultValueGetter;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (meta.reducer) {
|
|
164
|
+
const schemaWithReducer = Object.assign(schema, {
|
|
165
|
+
lg_reducer_schema: meta.reducer?.schema ?? schema,
|
|
166
|
+
});
|
|
167
|
+
schemaMetaRegistry.extend(schemaWithReducer, () => meta);
|
|
168
|
+
return schemaWithReducer;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
schemaMetaRegistry.extend(schema, () => meta);
|
|
172
|
+
return schema;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/graph/zod/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EAEvB,aAAa,EACb,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAyCpD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACE;;;WAGG;QACH;;;;mBAAO,IAAI,OAAO,EAA8B;WAAC;QAEjD;;;WAGG;QACH;;;;mBAAkB,IAAI,GAAG,EAAmD;WAAC;IA0K/E,CAAC;IAxKC;;;;;;OAMG;IACH,GAAG,CACD,MAA8B;QAE9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,MAA8B,EAC9B,SAEgC;QAEhC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAkB,MAAM,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAsB;QAC3B,IA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C,IAAI,CAAC,CAAC;QACzD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const zod_1 = require("zod");
|
|
4
|
-
const
|
|
4
|
+
const v3_1 = require("zod/v3");
|
|
5
|
+
const types_1 = require("@langchain/core/utils/types");
|
|
6
|
+
const meta_js_1 = require("./meta.cjs");
|
|
5
7
|
const metaSymbol = Symbol.for("langgraph-zod");
|
|
6
8
|
if (!(metaSymbol in globalThis)) {
|
|
7
9
|
globalThis[metaSymbol] = new WeakSet();
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
function applyPluginPrototype(prototype) {
|
|
10
12
|
const cache = globalThis[metaSymbol];
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
get() {
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
const zodThis = this;
|
|
16
|
-
return {
|
|
17
|
-
metadata(jsonSchemaExtra) {
|
|
18
|
-
(0, state_js_1.extendMeta)(zodThis, (meta) => ({ ...meta, jsonSchemaExtra }));
|
|
19
|
-
return zodThis;
|
|
20
|
-
},
|
|
21
|
-
reducer(fn, schema) {
|
|
22
|
-
const defaultFn = (0, state_js_1.isZodDefault)(zodThis)
|
|
23
|
-
? // @ts-expect-error Due to `_def` being `any`
|
|
24
|
-
zodThis._def.defaultValue
|
|
25
|
-
: undefined;
|
|
26
|
-
(0, state_js_1.extendMeta)(zodThis, (meta) => ({
|
|
27
|
-
...meta,
|
|
28
|
-
default: defaultFn ?? meta?.default,
|
|
29
|
-
reducer: { schema, fn },
|
|
30
|
-
}));
|
|
31
|
-
return zodThis;
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
});
|
|
13
|
+
if (cache.has(prototype)) {
|
|
14
|
+
return; // Already applied
|
|
36
15
|
}
|
|
16
|
+
Object.defineProperty(prototype, "langgraph", {
|
|
17
|
+
get() {
|
|
18
|
+
// Return type is any, actual type provided by module augmentation
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
const zodThis = this;
|
|
21
|
+
return {
|
|
22
|
+
metadata(jsonSchemaExtra) {
|
|
23
|
+
return (0, meta_js_1.withLangGraph)(zodThis, { jsonSchemaExtra });
|
|
24
|
+
},
|
|
25
|
+
reducer(fn, schema) {
|
|
26
|
+
const defaultFn = (0, types_1.getInteropZodDefaultGetter)(zodThis);
|
|
27
|
+
return (0, meta_js_1.withLangGraph)(zodThis, {
|
|
28
|
+
default: defaultFn,
|
|
29
|
+
reducer: { schema, fn },
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
cache.add(prototype);
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
applyPluginPrototype(v3_1.z.ZodType.prototype);
|
|
39
|
+
applyPluginPrototype(zod_1.z.ZodType.prototype);
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
39
42
|
throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.", { cause: error });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
interface ZodLangGraphTypes<T extends
|
|
3
|
-
reducer<Input =
|
|
1
|
+
import { z as zd } from "zod";
|
|
2
|
+
interface ZodLangGraphTypes<T extends zd.ZodTypeAny, Output> {
|
|
3
|
+
reducer<Input = zd.output<T>>(transform: (a: Output, arg: Input) => Output, options?: zd.ZodType<Input>): zd.ZodType<Output, zd.ZodEffectsDef<T>, Input>;
|
|
4
4
|
metadata(payload: {
|
|
5
5
|
langgraph_nodes?: string[];
|
|
6
6
|
langgraph_type?: "prompt";
|
|
@@ -9,6 +9,19 @@ interface ZodLangGraphTypes<T extends z.ZodTypeAny, Output> {
|
|
|
9
9
|
}
|
|
10
10
|
declare module "zod" {
|
|
11
11
|
interface ZodType<Output> {
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
|
|
14
|
+
* Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
|
|
15
|
+
*/
|
|
16
|
+
langgraph: ZodLangGraphTypes<this, Output>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare module "zod/v3" {
|
|
20
|
+
interface ZodType<Output> {
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions
|
|
23
|
+
* Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}
|
|
24
|
+
*/
|
|
12
25
|
langgraph: ZodLangGraphTypes<this, Output>;
|
|
13
26
|
}
|
|
14
27
|
}
|
package/dist/graph/zod/plugin.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
1
|
+
import { z as zd } from "zod";
|
|
2
|
+
import { z as z3 } from "zod/v3";
|
|
3
|
+
import { getInteropZodDefaultGetter } from "@langchain/core/utils/types";
|
|
4
|
+
import { withLangGraph } from "./meta.js";
|
|
3
5
|
const metaSymbol = Symbol.for("langgraph-zod");
|
|
4
6
|
if (!(metaSymbol in globalThis)) {
|
|
5
7
|
globalThis[metaSymbol] = new WeakSet();
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
function applyPluginPrototype(prototype) {
|
|
8
10
|
const cache = globalThis[metaSymbol];
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
get() {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
-
const zodThis = this;
|
|
14
|
-
return {
|
|
15
|
-
metadata(jsonSchemaExtra) {
|
|
16
|
-
extendMeta(zodThis, (meta) => ({ ...meta, jsonSchemaExtra }));
|
|
17
|
-
return zodThis;
|
|
18
|
-
},
|
|
19
|
-
reducer(fn, schema) {
|
|
20
|
-
const defaultFn = isZodDefault(zodThis)
|
|
21
|
-
? // @ts-expect-error Due to `_def` being `any`
|
|
22
|
-
zodThis._def.defaultValue
|
|
23
|
-
: undefined;
|
|
24
|
-
extendMeta(zodThis, (meta) => ({
|
|
25
|
-
...meta,
|
|
26
|
-
default: defaultFn ?? meta?.default,
|
|
27
|
-
reducer: { schema, fn },
|
|
28
|
-
}));
|
|
29
|
-
return zodThis;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
});
|
|
11
|
+
if (cache.has(prototype)) {
|
|
12
|
+
return; // Already applied
|
|
34
13
|
}
|
|
14
|
+
Object.defineProperty(prototype, "langgraph", {
|
|
15
|
+
get() {
|
|
16
|
+
// Return type is any, actual type provided by module augmentation
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
const zodThis = this;
|
|
19
|
+
return {
|
|
20
|
+
metadata(jsonSchemaExtra) {
|
|
21
|
+
return withLangGraph(zodThis, { jsonSchemaExtra });
|
|
22
|
+
},
|
|
23
|
+
reducer(fn, schema) {
|
|
24
|
+
const defaultFn = getInteropZodDefaultGetter(zodThis);
|
|
25
|
+
return withLangGraph(zodThis, {
|
|
26
|
+
default: defaultFn,
|
|
27
|
+
reducer: { schema, fn },
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
cache.add(prototype);
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
applyPluginPrototype(z3.ZodType.prototype);
|
|
37
|
+
applyPluginPrototype(zd.ZodType.prototype);
|
|
35
38
|
}
|
|
36
39
|
catch (error) {
|
|
37
40
|
throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.", { cause: error });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/graph/zod/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/graph/zod/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAc,aAAa,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAwC/C,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;IAC/B,UAA+B,CAAC,UAAU,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,oBAAoB,CAI3B,SAA4B;IAC5B,MAAM,KAAK,GAAI,UAA+B,CAAC,UAAU,CAAE,CAAC;IAC5D,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,kBAAkB;IAC5B,CAAC;IAED,MAAM,CAAC,cAAc,CACnB,SAAS,EACT,WAA6C,EAC7C;QACE,GAAG;YACD,kEAAkE;YAClE,8DAA8D;YAC9D,MAAM,OAAO,GAAG,IAAqB,CAAC;YAGtC,OAAO;gBACL,QAAQ,CACN,eAA8D;oBAE9D,OAAO,aAAa,CAAC,OAAO,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,CACL,EAAqC,EACrC,MAA0B;oBAE1B,MAA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