@langchain/langgraph-api 0.0.58 → 0.0.60

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @langchain/langgraph-api
2
2
 
3
+ ## 0.0.60
4
+
5
+ ### Patch Changes
6
+
7
+ - 9c57526: fix(api): serialization of "checkpoints" and "tasks" stream modes
8
+ - @langchain/langgraph-ui@0.0.60
9
+
10
+ ## 0.0.59
11
+
12
+ ### Patch Changes
13
+
14
+ - 3412f9f: fix(api): unintended schema inference to BaseMessage[] for all state keys when `strictFunctionTypes: true`
15
+ - @langchain/langgraph-ui@0.0.59
16
+
3
17
  ## 0.0.58
4
18
 
5
19
  ### Patch Changes
@@ -71,6 +71,7 @@ export declare class SubgraphExtractor {
71
71
  exportSymbol: string;
72
72
  }[], options?: {
73
73
  strict?: boolean;
74
+ tsConfigOptions?: Record<string, unknown>;
74
75
  }): Record<string, GraphSchema>[];
75
76
  }
76
77
  export {};
@@ -291,7 +291,11 @@ export class SubgraphExtractor {
291
291
  if (tsconfigPath != null) {
292
292
  const tsconfigFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
293
293
  const parsedTsconfig = ts.parseJsonConfigFileContent(tsconfigFile.config, ts.sys, path.dirname(tsconfigPath));
294
- compilerOptions = { ...parsedTsconfig.options, ...compilerOptions };
294
+ compilerOptions = {
295
+ ...parsedTsconfig.options,
296
+ ...compilerOptions,
297
+ ...(options?.tsConfigOptions ?? {}),
298
+ };
295
299
  }
296
300
  const vfsHost = vfs.createVirtualCompilerHost(system, compilerOptions, ts);
297
301
  const host = vfsHost.compilerHost;
@@ -1 +1 @@
1
- export {};
1
+ export type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
@@ -18,10 +18,15 @@ type AnyGraph = {
18
18
  compile: (...args: any[]) => any;
19
19
  };
20
20
 
21
- type Wrap<T> = (a: T) => void;
21
+ export type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <
22
+ T
23
+ >() => T extends Y ? 1 : 2
24
+ ? true
25
+ : false;
26
+
22
27
  type MatchBaseMessage<T> = T extends BaseMessage ? BaseMessage : never;
23
28
  type MatchBaseMessageArray<T> = T extends Array<infer C>
24
- ? Wrap<MatchBaseMessage<C>> extends Wrap<BaseMessage>
29
+ ? Equals<MatchBaseMessage<C>, BaseMessage> extends true
25
30
  ? BaseMessage[]
26
31
  : never
27
32
  : never;
@@ -37,9 +42,9 @@ type Inspect<T, TDepth extends Array<0> = []> = TDepth extends [0, 0, 0]
37
42
  ? {
38
43
  [K in keyof T]: 0 extends 1 & T[K]
39
44
  ? T[K]
40
- : Wrap<MatchBaseMessageArray<T[K]>> extends Wrap<BaseMessage[]>
45
+ : Equals<MatchBaseMessageArray<T[K]>, BaseMessage[]> extends true
41
46
  ? BaseMessage[]
42
- : Wrap<MatchBaseMessage<T[K]>> extends Wrap<BaseMessage>
47
+ : Equals<MatchBaseMessage<T[K]>, BaseMessage> extends true
43
48
  ? BaseMessage
44
49
  : Inspect<T[K], [0, ...TDepth]>;
45
50
  }
package/dist/stream.mjs CHANGED
@@ -140,6 +140,18 @@ export async function* streamState(run, options) {
140
140
  data = { ...debugChunk, payload: debugResult };
141
141
  }
142
142
  }
143
+ else if (mode === "checkpoints") {
144
+ const debugCheckpoint = preprocessDebugCheckpoint(chunk);
145
+ options?.onCheckpoint?.(debugCheckpoint);
146
+ data = debugCheckpoint;
147
+ }
148
+ else if (mode === "tasks") {
149
+ const debugTask = preprocessDebugCheckpointTask(chunk);
150
+ if ("result" in debugTask || "error" in debugTask) {
151
+ options?.onTaskResult?.(debugTask);
152
+ }
153
+ data = debugTask;
154
+ }
143
155
  if (mode === "messages") {
144
156
  if (userStreamMode.includes("messages-tuple")) {
145
157
  if (kwargs.subgraphs && ns?.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "^18.19.0 || >=20.16.0"
@@ -52,7 +52,7 @@
52
52
  "@babel/code-frame": "^7.26.2",
53
53
  "@hono/node-server": "^1.12.0",
54
54
  "@hono/zod-validator": "^0.2.2",
55
- "@langchain/langgraph-ui": "0.0.58",
55
+ "@langchain/langgraph-ui": "0.0.60",
56
56
  "@types/json-schema": "^7.0.15",
57
57
  "@typescript/vfs": "^1.6.0",
58
58
  "dedent": "^1.5.3",
@@ -84,9 +84,9 @@
84
84
  },
85
85
  "devDependencies": {
86
86
  "@langchain/core": "^0.3.59",
87
- "@langchain/langgraph": "0.4.4",
87
+ "@langchain/langgraph": "0.4.6",
88
88
  "@langchain/langgraph-checkpoint": "0.1.0",
89
- "@langchain/langgraph-sdk": "0.0.107",
89
+ "@langchain/langgraph-sdk": "0.0.109",
90
90
  "@types/babel__code-frame": "^7.0.6",
91
91
  "@types/node": "^18.15.11",
92
92
  "@types/react": "^19.0.8",