@langchain/langgraph-api 0.0.23 → 0.0.25
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/server.mjs +11 -11
- package/dist/utils/hono.mjs +2 -4
- package/package.json +2 -2
package/dist/server.mjs
CHANGED
|
@@ -70,6 +70,17 @@ export async function startServer(options) {
|
|
|
70
70
|
const app = new Hono();
|
|
71
71
|
// Loopback fetch used by webhooks and custom routes
|
|
72
72
|
bindLoopbackFetch(app);
|
|
73
|
+
app.post("/internal/truncate", zValidator("json", z.object({
|
|
74
|
+
runs: z.boolean().optional(),
|
|
75
|
+
threads: z.boolean().optional(),
|
|
76
|
+
assistants: z.boolean().optional(),
|
|
77
|
+
checkpointer: z.boolean().optional(),
|
|
78
|
+
store: z.boolean().optional(),
|
|
79
|
+
})), (c) => {
|
|
80
|
+
const { runs, threads, assistants, checkpointer, store } = c.req.valid("json");
|
|
81
|
+
truncate({ runs, threads, assistants, checkpointer, store });
|
|
82
|
+
return c.json({ ok: true });
|
|
83
|
+
});
|
|
73
84
|
if (options.auth?.path) {
|
|
74
85
|
logger.info(`Loading auth from ${options.auth.path}`);
|
|
75
86
|
await registerAuth(options.auth, { cwd: options.cwd });
|
|
@@ -83,17 +94,6 @@ export async function startServer(options) {
|
|
|
83
94
|
app.use(cors(options.http?.cors));
|
|
84
95
|
app.use(requestLogger());
|
|
85
96
|
app.use(ensureContentType());
|
|
86
|
-
app.post("/internal/truncate", zValidator("json", z.object({
|
|
87
|
-
runs: z.boolean().optional(),
|
|
88
|
-
threads: z.boolean().optional(),
|
|
89
|
-
assistants: z.boolean().optional(),
|
|
90
|
-
checkpointer: z.boolean().optional(),
|
|
91
|
-
store: z.boolean().optional(),
|
|
92
|
-
})), (c) => {
|
|
93
|
-
const { runs, threads, assistants, checkpointer, store } = c.req.valid("json");
|
|
94
|
-
truncate({ runs, threads, assistants, checkpointer, store });
|
|
95
|
-
return c.json({ ok: true });
|
|
96
|
-
});
|
|
97
97
|
if (!options.http?.disable_meta)
|
|
98
98
|
app.route("/", meta);
|
|
99
99
|
if (!options.http?.disable_assistants)
|
package/dist/utils/hono.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { serialiseAsDict } from "./serde.mjs";
|
|
2
2
|
import { stream } from "hono/streaming";
|
|
3
3
|
export function jsonExtra(c, object) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
headers: { ...c.res.headers, "Content-Type": "application/json" },
|
|
7
|
-
});
|
|
4
|
+
c.header("Content-Type", "application/json");
|
|
5
|
+
return c.body(serialiseAsDict(object));
|
|
8
6
|
}
|
|
9
7
|
export function waitKeepAlive(c, promise) {
|
|
10
8
|
return stream(c, async (stream) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"winston": "^3.17.0",
|
|
44
44
|
"winston-console-format": "^1.0.8",
|
|
45
45
|
"zod": "^3.23.8",
|
|
46
|
-
"@langchain/langgraph-ui": "0.0.
|
|
46
|
+
"@langchain/langgraph-ui": "0.0.25"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@langchain/core": "^0.3.42",
|