@langchain/langgraph-api 1.0.0 → 1.0.2

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
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - ebe5ae7: Add back support for older versions of LangChain / LangGraph
8
+ - @langchain/langgraph-ui@1.0.2
9
+
10
+ ## 1.0.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 610e1e1: Hotfix graph resolution for createAgent
15
+ - @langchain/langgraph-ui@1.0.1
16
+
3
17
  ## 1.0.0
4
18
 
5
19
  ### Major Changes
@@ -17,6 +17,13 @@ export async function resolveGraph(spec, options) {
17
17
  return false;
18
18
  return "compile" in graph && typeof graph.compile === "function";
19
19
  };
20
+ const isCompiledGraph = (graph) => {
21
+ if (typeof graph !== "object" || graph == null)
22
+ return false;
23
+ return ("builder" in graph &&
24
+ typeof graph.builder === "object" &&
25
+ graph.builder != null);
26
+ };
20
27
  const graph = await import(pathToFileURL(sourceFile).toString()).then((module) => module[exportSymbol || "default"]);
21
28
  // obtain the graph, and if not compiled, compile it
22
29
  const resolved = await (async () => {
@@ -24,6 +31,10 @@ export async function resolveGraph(spec, options) {
24
31
  throw new Error("Failed to load graph: graph is nullush");
25
32
  const afterResolve = (graphLike) => {
26
33
  const graph = isGraph(graphLike) ? graphLike.compile() : graphLike;
34
+ // TODO: hack, remove once LangChain 1.x createAgent is fixed
35
+ if (!isCompiledGraph(graph) && "graph" in graph) {
36
+ return graph.graph;
37
+ }
27
38
  return graph;
28
39
  };
29
40
  if (typeof graph === "function") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "^18.19.0 || >=20.16.0"
@@ -64,7 +64,7 @@
64
64
  "@babel/code-frame": "^7.26.2",
65
65
  "@hono/node-server": "^1.12.0",
66
66
  "@hono/zod-validator": "^0.2.2",
67
- "@langchain/langgraph-ui": "1.0.0",
67
+ "@langchain/langgraph-ui": "1.0.2",
68
68
  "@types/json-schema": "^7.0.15",
69
69
  "@typescript/vfs": "^1.6.0",
70
70
  "dedent": "^1.5.3",
@@ -83,10 +83,10 @@
83
83
  "zod": "^3.23.8"
84
84
  },
85
85
  "peerDependencies": {
86
- "@langchain/core": "^1.0.1",
86
+ "@langchain/core": "^0.3.59 || ^1.0.1",
87
87
  "@langchain/langgraph": "^0.2.57 || ^0.3.0 || ^0.4.0 || ^1.0.0-alpha || ^1.0.0",
88
- "@langchain/langgraph-checkpoint": "~1.0.0",
89
- "@langchain/langgraph-sdk": "~1.0.0",
88
+ "@langchain/langgraph-checkpoint": "~0.0.16 || ^0.1.0 || ~1.0.0",
89
+ "@langchain/langgraph-sdk": "~0.0.16 || ^0.1.0 || ~1.0.0",
90
90
  "typescript": "^5.5.4"
91
91
  },
92
92
  "peerDependenciesMeta": {
@@ -96,7 +96,7 @@
96
96
  },
97
97
  "devDependencies": {
98
98
  "@langchain/core": "^1.0.0",
99
- "@langchain/langgraph": "1.0.0",
99
+ "@langchain/langgraph": "1.0.1",
100
100
  "@langchain/langgraph-checkpoint": "1.0.0",
101
101
  "@langchain/langgraph-sdk": "1.0.0",
102
102
  "@types/babel__code-frame": "^7.0.6",