@langchain/langgraph-api 1.2.0 → 1.2.2-rc.0
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/api/protocol.mjs +3 -3
- package/dist/experimental/embed/protocol.mjs +3 -3
- package/dist/experimental/embed.d.mts +1 -1
- package/dist/experimental/embed.mjs +1 -1
- package/dist/semver/index.mjs +1 -19
- package/dist/semver/satisfiesPeerRange.d.mts +1 -0
- package/dist/semver/satisfiesPeerRange.mjs +19 -0
- package/package.json +7 -7
package/dist/api/protocol.mjs
CHANGED
|
@@ -45,7 +45,7 @@ export default function createProtocolApi(upgradeWebSocket, ops) {
|
|
|
45
45
|
runs: ops.runs,
|
|
46
46
|
threads: ops.threads,
|
|
47
47
|
});
|
|
48
|
-
api.get("/
|
|
48
|
+
api.get("/threads/:thread_id/stream/events", zValidator("param", ThreadIdSchema), upgradeWebSocket((c) => {
|
|
49
49
|
const { thread_id } = c.req.valid("param");
|
|
50
50
|
const record = protocolService.ensureThread({
|
|
51
51
|
threadId: thread_id,
|
|
@@ -101,7 +101,7 @@ export default function createProtocolApi(upgradeWebSocket, ops) {
|
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
103
|
}));
|
|
104
|
-
api.post("/
|
|
104
|
+
api.post("/threads/:thread_id/commands", zValidator("param", ThreadIdSchema), zValidator("json", ProtocolCommandSchema), async (c) => {
|
|
105
105
|
const { thread_id } = c.req.valid("param");
|
|
106
106
|
protocolService.ensureThread({
|
|
107
107
|
threadId: thread_id,
|
|
@@ -111,7 +111,7 @@ export default function createProtocolApi(upgradeWebSocket, ops) {
|
|
|
111
111
|
const payload = c.req.valid("json");
|
|
112
112
|
return jsonExtra(c, await protocolService.handleCommand(thread_id, payload));
|
|
113
113
|
});
|
|
114
|
-
api.post("/
|
|
114
|
+
api.post("/threads/:thread_id/stream/events", zValidator("param", ThreadIdSchema), zValidator("json", EventsFilterSchema), async (c) => {
|
|
115
115
|
const { thread_id } = c.req.valid("param");
|
|
116
116
|
protocolService.ensureThread({
|
|
117
117
|
threadId: thread_id,
|
|
@@ -311,13 +311,13 @@ export function registerProtocolRoutes(api, context, upgradeWebSocket) {
|
|
|
311
311
|
headers: { "Content-Type": "application/json" },
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
api.post("/
|
|
314
|
+
api.post("/threads/:thread_id/commands", zValidator("param", ThreadIdSchema), zValidator("json", ProtocolCommandSchema), async (c) => {
|
|
315
315
|
const { thread_id } = c.req.valid("param");
|
|
316
316
|
const thread = ensureThread(thread_id);
|
|
317
317
|
const command = c.req.valid("json");
|
|
318
318
|
return await handleThreadCommand(thread, command);
|
|
319
319
|
});
|
|
320
|
-
api.post("/
|
|
320
|
+
api.post("/threads/:thread_id/stream/events", zValidator("param", ThreadIdSchema), zValidator("json", EventsFilterSchema), async (c) => {
|
|
321
321
|
const { thread_id } = c.req.valid("param");
|
|
322
322
|
const thread = ensureThread(thread_id);
|
|
323
323
|
const body = c.req.valid("json");
|
|
@@ -374,7 +374,7 @@ export function registerProtocolRoutes(api, context, upgradeWebSocket) {
|
|
|
374
374
|
});
|
|
375
375
|
});
|
|
376
376
|
if (upgradeWebSocket != null) {
|
|
377
|
-
api.get("/
|
|
377
|
+
api.get("/threads/:thread_id/stream/events", zValidator("param", ThreadIdSchema), upgradeWebSocket((c) => {
|
|
378
378
|
const { thread_id } = c.req.valid("param");
|
|
379
379
|
const thread = ensureThread(thread_id);
|
|
380
380
|
const sinkId = uuidv7();
|
|
@@ -7,7 +7,7 @@ export type { ThreadSaver } from "./embed/types.mjs";
|
|
|
7
7
|
* Create a Hono server with a subset of LangGraph Platform routes.
|
|
8
8
|
*
|
|
9
9
|
* Pass `upgradeWebSocket` to enable the WebSocket protocol transport
|
|
10
|
-
* on `GET /
|
|
10
|
+
* on `GET /threads/:thread_id/stream/events`. Create it with `@hono/node-ws`'s
|
|
11
11
|
* `createNodeWebSocket({ app })` and make sure to call `injectWebSocket`
|
|
12
12
|
* on the underlying HTTP server.
|
|
13
13
|
*
|
|
@@ -7,7 +7,7 @@ import { registerProtocolRoutes } from "./embed/protocol.mjs";
|
|
|
7
7
|
* Create a Hono server with a subset of LangGraph Platform routes.
|
|
8
8
|
*
|
|
9
9
|
* Pass `upgradeWebSocket` to enable the WebSocket protocol transport
|
|
10
|
-
* on `GET /
|
|
10
|
+
* on `GET /threads/:thread_id/stream/events`. Create it with `@hono/node-ws`'s
|
|
11
11
|
* `createNodeWebSocket({ app })` and make sure to call `injectWebSocket`
|
|
12
12
|
* on the underlying HTTP server.
|
|
13
13
|
*
|
package/dist/semver/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as url from "node:url";
|
|
2
2
|
import * as fs from "node:fs/promises";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import
|
|
4
|
+
import { satisfiesPeerRange } from "./satisfiesPeerRange.mjs";
|
|
5
5
|
const packageJsonPath = path.resolve(url.fileURLToPath(import.meta.url), "../../../package.json");
|
|
6
6
|
export async function checkSemver(packages) {
|
|
7
7
|
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
|
|
@@ -14,24 +14,6 @@ export async function checkSemver(packages) {
|
|
|
14
14
|
return { ...pkg, required, satisfies };
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function satisfiesPeerRange(version, required) {
|
|
18
|
-
if (semver.satisfies(version, required, { includePrerelease: true })) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
const parsed = semver.parse(version);
|
|
22
|
-
if (parsed == null || parsed.prerelease.length === 0) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
// CI often installs internal dev builds such as
|
|
26
|
-
// `1.1.44-dev-<timestamp>`. Semver orders those below the final
|
|
27
|
-
// `1.1.44`, so `^1.1.44` does not match directly even though the
|
|
28
|
-
// build targets that release line. Validate the release tuple as a
|
|
29
|
-
// compatibility check while still rejecting prereleases below range.
|
|
30
|
-
const releaseVersion = `${parsed.major}.${parsed.minor}.${parsed.patch}`;
|
|
31
|
-
return semver.satisfies(releaseVersion, required, {
|
|
32
|
-
includePrerelease: true,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
17
|
export async function checkLangGraphSemver() {
|
|
36
18
|
const resolveVersion = async (name) => {
|
|
37
19
|
let version = "0.0.0";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function satisfiesPeerRange(version: string, required: string): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as semver from "semver";
|
|
2
|
+
export function satisfiesPeerRange(version, required) {
|
|
3
|
+
if (semver.satisfies(version, required, { includePrerelease: true })) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
const parsed = semver.parse(version);
|
|
7
|
+
if (parsed == null || parsed.prerelease.length === 0) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
// CI often installs internal dev builds such as
|
|
11
|
+
// `1.1.44-dev-<timestamp>`. Semver orders those below the final
|
|
12
|
+
// `1.1.44`, so `^1.1.44` does not match directly even though the
|
|
13
|
+
// build targets that release line. Validate the release tuple as a
|
|
14
|
+
// compatibility check while still rejecting prereleases below range.
|
|
15
|
+
const releaseVersion = `${parsed.major}.${parsed.minor}.${parsed.patch}`;
|
|
16
|
+
return semver.satisfies(releaseVersion, required, {
|
|
17
|
+
includePrerelease: true,
|
|
18
|
+
});
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "1.2.0",
|
|
3
|
+
"version": "1.2.2-rc.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"dedent": "^1.5.3",
|
|
62
62
|
"dotenv": "^16.4.7",
|
|
63
63
|
"exit-hook": "^4.0.0",
|
|
64
|
-
"hono": "^4.12.
|
|
64
|
+
"hono": "^4.12.18",
|
|
65
65
|
"langsmith": ">=0.5.19 <1.0.0",
|
|
66
66
|
"open": "^10.1.0",
|
|
67
67
|
"semver": "^7.7.1",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"winston": "^3.17.0",
|
|
73
73
|
"winston-console-format": "^1.0.8",
|
|
74
74
|
"zod": "^3.25.76 || ^4",
|
|
75
|
-
"@langchain/langgraph-ui": "1.2.0"
|
|
75
|
+
"@langchain/langgraph-ui": "1.2.2-rc.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@langchain/core": "^1.1.44",
|
|
79
|
-
"@langchain/langgraph": "^0.2.57 || ^0.3.0 || ^0.4.0 || ^1.0.0-alpha || ^1.0.0",
|
|
79
|
+
"@langchain/langgraph": "^0.2.57 || ^0.3.0 || ^0.4.0 || ^1.0.0-alpha || ^1.0.0 || ^1.3.1-rc.0",
|
|
80
80
|
"@langchain/langgraph-checkpoint": "~0.0.16 || ^0.1.0 || ~1.0.0",
|
|
81
|
-
"@langchain/langgraph-sdk": "^1.
|
|
81
|
+
"@langchain/langgraph-sdk": "^1.9.3-rc.0",
|
|
82
82
|
"typescript": "^5.5.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
"typescript": "^4.9.5 || ^5.4.5",
|
|
102
102
|
"vitest": "^3.2.4",
|
|
103
103
|
"wait-port": "^1.1.0",
|
|
104
|
+
"@langchain/langgraph": "1.3.1-rc.0",
|
|
104
105
|
"@langchain/langgraph-checkpoint": "1.0.2",
|
|
105
|
-
"@langchain/langgraph-sdk": "1.9.0"
|
|
106
|
-
"@langchain/langgraph": "1.3.0"
|
|
106
|
+
"@langchain/langgraph-sdk": "1.9.3-rc.0"
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
109
|
"clean": "rm -rf dist/ .turbo/ ./tests/graphs/.langgraph_api/ ./tests/protocol-v2/graphs/.langgraph_api/",
|