@langchain/langgraph-api 0.0.56 → 0.0.57
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 +7 -0
- package/dist/cli/spawn.d.mts +4 -1
- package/dist/preload.mjs +12 -3
- package/dist/server.d.mts +18 -3
- package/dist/server.mjs +18 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cli/spawn.d.mts
CHANGED
|
@@ -4,7 +4,10 @@ export declare function spawnServer(args: {
|
|
|
4
4
|
nJobsPerWorker: string;
|
|
5
5
|
}, context: {
|
|
6
6
|
config: {
|
|
7
|
-
graphs: Record<string, string
|
|
7
|
+
graphs: Record<string, string | {
|
|
8
|
+
path: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}>;
|
|
8
11
|
ui?: Record<string, string>;
|
|
9
12
|
ui_config?: {
|
|
10
13
|
shared?: string[];
|
package/dist/preload.mjs
CHANGED
|
@@ -8,9 +8,18 @@ const options = JSON.parse(lastArg || "{}");
|
|
|
8
8
|
// find the first file, as `parentURL` needs to be a valid file URL
|
|
9
9
|
// if no graph found, just assume a dummy default file, which should
|
|
10
10
|
// be working fine as well.
|
|
11
|
-
const
|
|
12
|
-
.
|
|
13
|
-
|
|
11
|
+
const graphFiles = Object.values(options.graphs)
|
|
12
|
+
.map((i) => {
|
|
13
|
+
if (typeof i === "string") {
|
|
14
|
+
return i.split(":").at(0);
|
|
15
|
+
}
|
|
16
|
+
else if (i && typeof i === "object" && i.path) {
|
|
17
|
+
return i.path.split(":").at(0);
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
})
|
|
21
|
+
.filter(Boolean);
|
|
22
|
+
const firstGraphFile = graphFiles.at(0) || "index.mts";
|
|
14
23
|
// enforce API @langchain/langgraph resolution
|
|
15
24
|
register("./graph/load.hooks.mjs", import.meta.url, {
|
|
16
25
|
parentURL: "data:",
|
package/dist/server.d.mts
CHANGED
|
@@ -4,7 +4,16 @@ export declare const StartServerSchema: z.ZodObject<{
|
|
|
4
4
|
nWorkers: z.ZodNumber;
|
|
5
5
|
host: z.ZodString;
|
|
6
6
|
cwd: z.ZodString;
|
|
7
|
-
graphs: z.ZodRecord<z.ZodString, z.ZodString
|
|
7
|
+
graphs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
path: string;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
path: string;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
}>]>>;
|
|
8
17
|
auth: z.ZodOptional<z.ZodObject<{
|
|
9
18
|
path: z.ZodOptional<z.ZodString>;
|
|
10
19
|
disable_studio_auth: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -93,7 +102,10 @@ export declare const StartServerSchema: z.ZodObject<{
|
|
|
93
102
|
host: string;
|
|
94
103
|
port: number;
|
|
95
104
|
nWorkers: number;
|
|
96
|
-
graphs: Record<string, string
|
|
105
|
+
graphs: Record<string, string | {
|
|
106
|
+
path: string;
|
|
107
|
+
description?: string | undefined;
|
|
108
|
+
}>;
|
|
97
109
|
auth?: {
|
|
98
110
|
disable_studio_auth: boolean;
|
|
99
111
|
path?: string | undefined;
|
|
@@ -124,7 +136,10 @@ export declare const StartServerSchema: z.ZodObject<{
|
|
|
124
136
|
host: string;
|
|
125
137
|
port: number;
|
|
126
138
|
nWorkers: number;
|
|
127
|
-
graphs: Record<string, string
|
|
139
|
+
graphs: Record<string, string | {
|
|
140
|
+
path: string;
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
}>;
|
|
128
143
|
auth?: {
|
|
129
144
|
path?: string | undefined;
|
|
130
145
|
disable_studio_auth?: boolean | undefined;
|
package/dist/server.mjs
CHANGED
|
@@ -25,7 +25,10 @@ export const StartServerSchema = z.object({
|
|
|
25
25
|
nWorkers: z.number(),
|
|
26
26
|
host: z.string(),
|
|
27
27
|
cwd: z.string(),
|
|
28
|
-
graphs: z.record(z.
|
|
28
|
+
graphs: z.record(z.union([
|
|
29
|
+
z.string(),
|
|
30
|
+
z.object({ path: z.string(), description: z.string().optional() }),
|
|
31
|
+
])),
|
|
29
32
|
auth: z
|
|
30
33
|
.object({
|
|
31
34
|
path: z.string().optional(),
|
|
@@ -79,7 +82,20 @@ export async function startServer(options) {
|
|
|
79
82
|
// We need to do this before we load the graphs in-case the logger is obtained at top-level.
|
|
80
83
|
registerSdkLogger();
|
|
81
84
|
logger.info(`Registering graphs from ${options.cwd}`);
|
|
82
|
-
|
|
85
|
+
let hasGraphDescriptions = false;
|
|
86
|
+
const graphPaths = Object.fromEntries(Object.entries(options.graphs).map(([graphId, rawSpec]) => {
|
|
87
|
+
if (typeof rawSpec === "string") {
|
|
88
|
+
return [graphId, rawSpec];
|
|
89
|
+
}
|
|
90
|
+
if (rawSpec.description) {
|
|
91
|
+
hasGraphDescriptions = true;
|
|
92
|
+
}
|
|
93
|
+
return [graphId, rawSpec.path];
|
|
94
|
+
}));
|
|
95
|
+
if (hasGraphDescriptions) {
|
|
96
|
+
logger.warn("A graph definition in `langgraph.json` has a `description` property. Local MCP features are not yet supported with the JS CLI and will be ignored.");
|
|
97
|
+
}
|
|
98
|
+
await registerFromEnv(graphPaths, { cwd: options.cwd });
|
|
83
99
|
registerRuntimeLogFormatter((info) => {
|
|
84
100
|
const config = getConfig();
|
|
85
101
|
if (config == null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
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.
|
|
55
|
+
"@langchain/langgraph-ui": "0.0.57",
|
|
56
56
|
"@types/json-schema": "^7.0.15",
|
|
57
57
|
"@typescript/vfs": "^1.6.0",
|
|
58
58
|
"dedent": "^1.5.3",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@langchain/core": "^0.3.59",
|
|
87
|
-
"@langchain/langgraph": "0.4.
|
|
87
|
+
"@langchain/langgraph": "0.4.3",
|
|
88
88
|
"@langchain/langgraph-checkpoint": "0.1.0",
|
|
89
89
|
"@langchain/langgraph-sdk": "0.0.105",
|
|
90
90
|
"@types/babel__code-frame": "^7.0.6",
|