@langchain/langgraph-api 1.1.9 → 1.1.11
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/README.md +3 -3
- package/dist/api/assistants.mjs +2 -1
- package/dist/storage/ops.d.mts +1 -1
- package/dist/storage/ops.mjs +9 -2
- package/dist/storage/types.d.mts +1 -1
- package/dist/vitest.config.d.ts +1 -1
- package/dist/vitest.config.js +1 -2
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -4,6 +4,6 @@ In-memory implementation of the LangGraph.js API.
|
|
|
4
4
|
|
|
5
5
|
## Tests
|
|
6
6
|
|
|
7
|
-
1. Build the latest code changes to test: `
|
|
8
|
-
1. Start a local server: `
|
|
9
|
-
1. Run the tests: `
|
|
7
|
+
1. Build the latest code changes to test: `pnpm build`
|
|
8
|
+
1. Start a local server: `pnpm dev`
|
|
9
|
+
1. Run the tests: `pnpm test`
|
package/dist/api/assistants.mjs
CHANGED
|
@@ -86,7 +86,8 @@ api.get("/assistants/:assistant_id", async (c) => {
|
|
|
86
86
|
api.delete("/assistants/:assistant_id", async (c) => {
|
|
87
87
|
// Delete Assistant
|
|
88
88
|
const assistantId = getAssistantId(c.req.param("assistant_id"));
|
|
89
|
-
|
|
89
|
+
const deleteThreads = c.req.query("delete_threads") === "true";
|
|
90
|
+
return c.json(await assistants().delete(assistantId, deleteThreads, c.var.auth));
|
|
90
91
|
});
|
|
91
92
|
api.patch("/assistants/:assistant_id", zValidator("json", schemas.AssistantPatch), async (c) => {
|
|
92
93
|
// Patch Assistant
|
package/dist/storage/ops.d.mts
CHANGED
|
@@ -77,7 +77,7 @@ export declare class FileSystemAssistants implements AssistantsRepo {
|
|
|
77
77
|
name?: string;
|
|
78
78
|
description?: string;
|
|
79
79
|
}, auth: AuthContext | undefined): Promise<Assistant>;
|
|
80
|
-
delete(assistant_id: string, auth: AuthContext | undefined): Promise<string[]>;
|
|
80
|
+
delete(assistant_id: string, delete_threads: boolean, auth: AuthContext | undefined): Promise<string[]>;
|
|
81
81
|
setLatest(assistant_id: string, version: number, auth: AuthContext | undefined): Promise<Assistant>;
|
|
82
82
|
getVersions(assistant_id: string, options: {
|
|
83
83
|
limit: number;
|
package/dist/storage/ops.mjs
CHANGED
|
@@ -330,7 +330,7 @@ export class FileSystemAssistants {
|
|
|
330
330
|
return assistant;
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
async delete(assistant_id, auth) {
|
|
333
|
+
async delete(assistant_id, delete_threads, auth) {
|
|
334
334
|
const [filters] = await handleAuthEvent(auth, "assistants:delete", {
|
|
335
335
|
assistant_id,
|
|
336
336
|
});
|
|
@@ -343,13 +343,20 @@ export class FileSystemAssistants {
|
|
|
343
343
|
throw new HTTPException(404, { message: "Assistant not found" });
|
|
344
344
|
}
|
|
345
345
|
delete STORE.assistants[assistant_id];
|
|
346
|
-
// Cascade delete for assistant versions and crons
|
|
346
|
+
// Cascade delete for assistant versions and crons and threads
|
|
347
347
|
STORE.assistant_versions = STORE.assistant_versions.filter((v) => v["assistant_id"] !== assistant_id);
|
|
348
348
|
for (const run of Object.values(STORE.runs)) {
|
|
349
349
|
if (run["assistant_id"] === assistant_id) {
|
|
350
350
|
delete STORE.runs[run["run_id"]];
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
+
if (delete_threads === true) {
|
|
354
|
+
for (const thread of Object.values(STORE.threads)) {
|
|
355
|
+
if (thread["metadata"]?.["assistant_id"] === assistant_id) {
|
|
356
|
+
delete STORE.threads[thread["thread_id"]];
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
353
360
|
return [assistant.assistant_id];
|
|
354
361
|
});
|
|
355
362
|
}
|
package/dist/storage/types.d.mts
CHANGED
|
@@ -274,7 +274,7 @@ export interface AssistantsRepo {
|
|
|
274
274
|
name?: string;
|
|
275
275
|
description?: string;
|
|
276
276
|
}, auth: AuthContext | undefined): Promise<Assistant>;
|
|
277
|
-
delete(assistant_id: string, auth: AuthContext | undefined): Promise<string[]>;
|
|
277
|
+
delete(assistant_id: string, delete_threads: boolean, auth: AuthContext | undefined): Promise<string[]>;
|
|
278
278
|
count(options: {
|
|
279
279
|
graph_id?: string;
|
|
280
280
|
name?: string;
|
package/dist/vitest.config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vitest/config").UserConfigFnObject;
|
|
1
|
+
declare const _default: import("vitest/config.js").UserConfigFnObject;
|
|
2
2
|
export default _default;
|
package/dist/vitest.config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
3
2
|
export default defineConfig(() => {
|
|
4
3
|
/** @type {import("vitest/config").UserConfigExport} */
|
|
5
4
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -50,22 +50,10 @@
|
|
|
50
50
|
"url": "git+ssh://git@github.com/langchain-ai/langgraphjs.git",
|
|
51
51
|
"directory": "libs/langgraph-api"
|
|
52
52
|
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"clean": "rm -rf dist/ .turbo/ ./tests/graphs/.langgraph_api/",
|
|
55
|
-
"build": "yarn turbo:command build:internal --filter=@langchain/langgraph-api",
|
|
56
|
-
"build:internal": "yarn clean && node scripts/build.mjs",
|
|
57
|
-
"dev": "tsx ./tests/utils.server.mts --dev",
|
|
58
|
-
"prepublish": "yarn build",
|
|
59
|
-
"typecheck": "tsc --noEmit",
|
|
60
|
-
"test": "vitest run",
|
|
61
|
-
"format": "prettier --write .",
|
|
62
|
-
"format:check": "prettier --check ."
|
|
63
|
-
},
|
|
64
53
|
"dependencies": {
|
|
65
54
|
"@babel/code-frame": "^7.26.2",
|
|
66
55
|
"@hono/node-server": "^1.12.0",
|
|
67
56
|
"@hono/zod-validator": "^0.7.6",
|
|
68
|
-
"@langchain/langgraph-ui": "workspace:*",
|
|
69
57
|
"@types/json-schema": "^7.0.15",
|
|
70
58
|
"@typescript/vfs": "^1.6.0",
|
|
71
59
|
"dedent": "^1.5.3",
|
|
@@ -81,7 +69,8 @@
|
|
|
81
69
|
"uuid": "^10.0.0",
|
|
82
70
|
"winston": "^3.17.0",
|
|
83
71
|
"winston-console-format": "^1.0.8",
|
|
84
|
-
"zod": "^3.25.76 || ^4"
|
|
72
|
+
"zod": "^3.25.76 || ^4",
|
|
73
|
+
"@langchain/langgraph-ui": "1.1.11"
|
|
85
74
|
},
|
|
86
75
|
"peerDependencies": {
|
|
87
76
|
"@langchain/core": "^0.3.59 || ^1.0.1",
|
|
@@ -97,9 +86,6 @@
|
|
|
97
86
|
},
|
|
98
87
|
"devDependencies": {
|
|
99
88
|
"@langchain/core": "^1.0.0",
|
|
100
|
-
"@langchain/langgraph": "workspace:*",
|
|
101
|
-
"@langchain/langgraph-checkpoint": "workspace:*",
|
|
102
|
-
"@langchain/langgraph-sdk": "workspace:*",
|
|
103
89
|
"@types/babel__code-frame": "^7.0.6",
|
|
104
90
|
"@types/node": "^18.15.11",
|
|
105
91
|
"@types/react": "^19.0.8",
|
|
@@ -111,6 +97,20 @@
|
|
|
111
97
|
"prettier": "^2.8.3",
|
|
112
98
|
"typescript": "^4.9.5 || ^5.4.5",
|
|
113
99
|
"vitest": "^3.2.4",
|
|
114
|
-
"wait-port": "^1.1.0"
|
|
100
|
+
"wait-port": "^1.1.0",
|
|
101
|
+
"@langchain/langgraph": "1.0.15",
|
|
102
|
+
"@langchain/langgraph-checkpoint": "1.0.0",
|
|
103
|
+
"@langchain/langgraph-sdk": "1.5.0"
|
|
104
|
+
},
|
|
105
|
+
"scripts": {
|
|
106
|
+
"clean": "rm -rf dist/ .turbo/ ./tests/graphs/.langgraph_api/",
|
|
107
|
+
"build": "pnpm turbo build:internal --filter=@langchain/langgraph-api",
|
|
108
|
+
"build:internal": "pnpm clean && node scripts/build.mjs",
|
|
109
|
+
"dev": "tsx ./tests/utils.server.mts --dev",
|
|
110
|
+
"prepublish": "pnpm build",
|
|
111
|
+
"typecheck": "tsc --noEmit",
|
|
112
|
+
"test": "vitest run",
|
|
113
|
+
"format": "prettier --write .",
|
|
114
|
+
"format:check": "prettier --check ."
|
|
115
115
|
}
|
|
116
|
-
}
|
|
116
|
+
}
|