@langchain/langgraph-cli 1.2.2 → 1.2.4
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/cli/dev.mjs +15 -10
- package/dist/cli/dev.python.mjs +1 -0
- package/package.json +2 -2
package/dist/cli/dev.mjs
CHANGED
|
@@ -18,6 +18,7 @@ builder
|
|
|
18
18
|
.option("-p, --port <number>", "port to run the server on", "2024")
|
|
19
19
|
.option("-h, --host <string>", "host to bind to", "localhost")
|
|
20
20
|
.option("--no-browser", "disable auto-opening the browser")
|
|
21
|
+
.option("--no-reload", "disable automatic reloading when code changes are detected")
|
|
21
22
|
.option("-n, --n-jobs-per-worker <number>", "number of workers to run", "10")
|
|
22
23
|
.option("-c, --config <path>", "path to configuration file", process.cwd())
|
|
23
24
|
.option("--tunnel", "use Cloudflare Tunnel to expose the server to the internet")
|
|
@@ -36,10 +37,12 @@ builder
|
|
|
36
37
|
const configPath = await getProjectPath(options.config);
|
|
37
38
|
const projectCwd = path.dirname(configPath);
|
|
38
39
|
const [pid, server] = await createIpcServer();
|
|
39
|
-
const watcher =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const watcher = options.reload
|
|
41
|
+
? watch([configPath], {
|
|
42
|
+
ignoreInitial: true,
|
|
43
|
+
cwd: projectCwd,
|
|
44
|
+
})
|
|
45
|
+
: undefined;
|
|
43
46
|
let hasOpenedFlag = false;
|
|
44
47
|
let child = undefined;
|
|
45
48
|
let tunnel = undefined;
|
|
@@ -94,10 +97,12 @@ builder
|
|
|
94
97
|
populate(env, configEnv);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
if (watcher) {
|
|
101
|
+
const oldWatch = Object.entries(watcher.getWatched()).flatMap(([dir, files]) => files.map((file) => path.resolve(projectCwd, dir, file)));
|
|
102
|
+
const addedTarget = newWatch.filter((target) => !oldWatch.includes(target));
|
|
103
|
+
const removedTarget = oldWatch.filter((target) => !newWatch.includes(target));
|
|
104
|
+
watcher.unwatch(removedTarget).add(addedTarget);
|
|
105
|
+
}
|
|
101
106
|
try {
|
|
102
107
|
const { Client } = await import("langsmith");
|
|
103
108
|
const apiUrl = env?.["LANGSMITH_ENDPOINT"] ||
|
|
@@ -129,7 +134,7 @@ builder
|
|
|
129
134
|
child = await spawnServer(options, { config, env, hostUrl }, { pid, projectCwd });
|
|
130
135
|
}
|
|
131
136
|
};
|
|
132
|
-
watcher
|
|
137
|
+
watcher?.on("all", async (_name, path) => {
|
|
133
138
|
logger.warn(`Detected changes in ${path}, restarting server`);
|
|
134
139
|
launchServer();
|
|
135
140
|
});
|
|
@@ -137,7 +142,7 @@ builder
|
|
|
137
142
|
// while gracefully exiting
|
|
138
143
|
launchServer();
|
|
139
144
|
process.on("exit", () => {
|
|
140
|
-
watcher
|
|
145
|
+
watcher?.close();
|
|
141
146
|
server.close();
|
|
142
147
|
child?.kill();
|
|
143
148
|
});
|
package/dist/cli/dev.python.mjs
CHANGED
|
@@ -120,6 +120,7 @@ export async function spawnPythonServer(args, context, options) {
|
|
|
120
120
|
"--config",
|
|
121
121
|
context.configPath,
|
|
122
122
|
...(args.browser ? [] : ["--no-browser"]),
|
|
123
|
+
...(args.reload ? [] : ["--no-reload"]),
|
|
123
124
|
...args.rest,
|
|
124
125
|
], {
|
|
125
126
|
stdio: ["inherit", "inherit", "inherit"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"winston-console-format": "^1.0.8",
|
|
39
39
|
"yaml": "^2.8.3",
|
|
40
40
|
"zod": "^3.25.76 || ^4",
|
|
41
|
-
"@langchain/langgraph-api": "1.2.
|
|
41
|
+
"@langchain/langgraph-api": "1.2.4",
|
|
42
42
|
"create-langgraph": "1.1.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|