@langchain/langgraph 0.2.12 → 0.2.13

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.
@@ -58,7 +58,7 @@ export declare class Graph<N extends string = typeof END, RunInput = any, RunOut
58
58
  }): CompiledGraph<N>;
59
59
  validate(interrupt?: string[]): void;
60
60
  }
61
- export declare class CompiledGraph<N extends string, RunInput = any, RunOutput = any> extends Pregel<Record<N | typeof START, PregelNode<RunInput, RunOutput>>, Record<N | typeof START | typeof END | string, BaseChannel>> {
61
+ export declare class CompiledGraph<N extends string, RunInput = any, RunOutput = any, ConfigurableFieldType extends Record<string, any> = Record<string, any>> extends Pregel<Record<N | typeof START, PregelNode<RunInput, RunOutput>>, Record<N | typeof START | typeof END | string, BaseChannel>, ConfigurableFieldType & Record<string, any>> {
62
62
  NodeType: N;
63
63
  RunInput: RunInput;
64
64
  RunOutput: RunOutput;
@@ -424,7 +424,7 @@ class CompiledStateGraph extends graph_js_1.CompiledGraph {
424
424
  return new write_js_1.ChannelWrite(writes, [constants_js_1.TAG_HIDDEN]);
425
425
  },
426
426
  // reader
427
- (config) => read_js_1.ChannelRead.doRead(config, this.outputChannels, true)));
427
+ (config) => read_js_1.ChannelRead.doRead(config, this.streamChannels ?? this.outputChannels, true)));
428
428
  // attach branch subscribers
429
429
  const ends = branch.ends
430
430
  ? Object.values(branch.ends)
@@ -122,7 +122,7 @@ export declare class StateGraph<SD extends StateDefinition | unknown, S = SD ext
122
122
  interruptAfter?: N[] | All;
123
123
  }): CompiledStateGraph<S, U, N, I, O, C>;
124
124
  }
125
- export declare class CompiledStateGraph<S, U, N extends string = typeof START, I extends StateDefinition = StateDefinition, O extends StateDefinition = StateDefinition, C extends StateDefinition = StateDefinition> extends CompiledGraph<N, S, U> {
125
+ export declare class CompiledStateGraph<S, U, N extends string = typeof START, I extends StateDefinition = StateDefinition, O extends StateDefinition = StateDefinition, C extends StateDefinition = StateDefinition> extends CompiledGraph<N, S, U, StateType<C>> {
126
126
  builder: StateGraph<unknown, S, U, N, I, O, C>;
127
127
  attachNode(key: typeof START, node?: never): void;
128
128
  attachNode(key: N, node: StateGraphNodeSpec<S, U>): void;
@@ -420,7 +420,7 @@ export class CompiledStateGraph extends CompiledGraph {
420
420
  return new ChannelWrite(writes, [TAG_HIDDEN]);
421
421
  },
422
422
  // reader
423
- (config) => ChannelRead.doRead(config, this.outputChannels, true)));
423
+ (config) => ChannelRead.doRead(config, this.streamChannels ?? this.outputChannels, true)));
424
424
  // attach branch subscribers
425
425
  const ends = branch.ends
426
426
  ? Object.values(branch.ends)
@@ -23,7 +23,7 @@ export declare class Channel {
23
23
  /**
24
24
  * Config for executing the graph.
25
25
  */
26
- export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>> extends RunnableConfig {
26
+ export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>, ConfigurableFieldType extends Record<string, any> = Record<string, any>> extends RunnableConfig<ConfigurableFieldType> {
27
27
  /** The stream mode for the graph run. Default is ["values"]. */
28
28
  streamMode?: StreamMode | StreamMode[];
29
29
  inputKeys?: keyof Cc | Array<keyof Cc>;
@@ -42,7 +42,7 @@ export interface PregelOptions<Nn extends StrRecord<string, PregelNode>, Cc exte
42
42
  }
43
43
  export type PregelInputType = any;
44
44
  export type PregelOutputType = any;
45
- export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>> extends Runnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc>> implements PregelInterface<Nn, Cc> {
45
+ export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends StrRecord<string, BaseChannel | ManagedValueSpec>, ConfigurableFieldType extends Record<string, any> = StrRecord<string, any>> extends Runnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc, ConfigurableFieldType>> implements PregelInterface<Nn, Cc> {
46
46
  static lc_name(): string;
47
47
  lc_namespace: string[];
48
48
  nodes: Nn;
@@ -118,7 +118,7 @@ export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends
118
118
  * @param options.interruptAfter Nodes to interrupt after.
119
119
  * @param options.debug Whether to print debug information during execution.
120
120
  */
121
- stream(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc>>): Promise<IterableReadableStream<PregelOutputType>>;
121
+ stream(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ConfigurableFieldType>>): Promise<IterableReadableStream<PregelOutputType>>;
122
122
  protected prepareSpecs(config: RunnableConfig, options?: {
123
123
  skipManaged?: boolean;
124
124
  }): Promise<{
@@ -141,6 +141,6 @@ export declare class Pregel<Nn extends StrRecord<string, PregelNode>, Cc extends
141
141
  * @param options.interruptAfter Nodes to interrupt after.
142
142
  * @param options.debug Whether to print debug information during execution.
143
143
  */
144
- invoke(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc>>): Promise<PregelOutputType>;
144
+ invoke(input: PregelInputType, options?: Partial<PregelOptions<Nn, Cc, ConfigurableFieldType>>): Promise<PregelOutputType>;
145
145
  }
146
146
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,13 +37,14 @@
37
37
  "zod": "^3.23.8"
38
38
  },
39
39
  "peerDependencies": {
40
- "@langchain/core": ">=0.2.31 <0.4.0"
40
+ "@langchain/core": ">=0.2.35 <0.3.0 || >=0.3.8 < 0.4.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "^29.5.0",
44
44
  "@langchain/anthropic": "^0.3.0",
45
45
  "@langchain/community": "^0.3.0",
46
46
  "@langchain/core": "^0.3.6",
47
+ "@langchain/langgraph-checkpoint-postgres": "workspace:*",
47
48
  "@langchain/langgraph-checkpoint-sqlite": "workspace:*",
48
49
  "@langchain/openai": "^0.3.0",
49
50
  "@langchain/scripts": ">=0.1.3 <0.2.0",
@@ -51,6 +52,7 @@
51
52
  "@swc/jest": "^0.2.29",
52
53
  "@tsconfig/recommended": "^1.0.3",
53
54
  "@types/double-ended-queue": "^2",
55
+ "@types/pg": "^8",
54
56
  "@types/uuid": "^10",
55
57
  "@typescript-eslint/eslint-plugin": "^6.12.0",
56
58
  "@typescript-eslint/parser": "^6.12.0",
@@ -68,6 +70,7 @@
68
70
  "jest": "^29.5.0",
69
71
  "jest-environment-node": "^29.6.4",
70
72
  "langchain": "^0.3.0",
73
+ "pg": "^8.13.0",
71
74
  "prettier": "^2.8.3",
72
75
  "release-it": "^17.6.0",
73
76
  "rollup": "^4.23.0",