@langchain/langgraph-api 0.0.53 → 0.0.55
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 +16 -0
- package/dist/api/meta.mjs +12 -0
- package/dist/auth/custom.mjs +3 -0
- package/dist/cli/entrypoint.mjs +2 -2
- package/dist/graph/parser/parser.d.mts +1 -1
- package/dist/graph/parser/parser.mjs +12 -6
- package/dist/schemas.d.mts +4 -4
- package/dist/server.mjs +1 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @langchain/langgraph-api
|
|
2
2
|
|
|
3
|
+
## 0.0.55
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ef84039: fix(api): place the schema inference template next to the graph code, use whole path for symbol name
|
|
8
|
+
- 7edf347: exlcude meta routes from auth
|
|
9
|
+
- 77b21d5: add installed langgraph version to info endpoint for js server
|
|
10
|
+
- @langchain/langgraph-ui@0.0.55
|
|
11
|
+
|
|
12
|
+
## 0.0.54
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 1777878: fix(cli): only warn the user if an invalid LangSmith API key is passed while tracing is enabled
|
|
17
|
+
- @langchain/langgraph-ui@0.0.54
|
|
18
|
+
|
|
3
19
|
## 0.0.53
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/api/meta.mjs
CHANGED
|
@@ -6,6 +6,7 @@ const api = new Hono();
|
|
|
6
6
|
// Get the version using the same pattern as semver/index.mts
|
|
7
7
|
const packageJsonPath = path.resolve(url.fileURLToPath(import.meta.url), "../../../package.json");
|
|
8
8
|
let version;
|
|
9
|
+
let langgraph_js_version;
|
|
9
10
|
try {
|
|
10
11
|
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
|
|
11
12
|
version = packageJson.version;
|
|
@@ -13,6 +14,16 @@ try {
|
|
|
13
14
|
catch {
|
|
14
15
|
console.warn("Could not determine version of langgraph-api");
|
|
15
16
|
}
|
|
17
|
+
// Get the installed version of @langchain/langgraph
|
|
18
|
+
try {
|
|
19
|
+
const langgraphPkg = await import("@langchain/langgraph/package.json");
|
|
20
|
+
if (langgraphPkg?.default?.version) {
|
|
21
|
+
langgraph_js_version = langgraphPkg.default.version;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
console.warn("Could not determine version of @langchain/langgraph");
|
|
26
|
+
}
|
|
16
27
|
// read env variable
|
|
17
28
|
const env = process.env;
|
|
18
29
|
api.get("/info", (c) => {
|
|
@@ -33,6 +44,7 @@ api.get("/info", (c) => {
|
|
|
33
44
|
})();
|
|
34
45
|
return c.json({
|
|
35
46
|
version,
|
|
47
|
+
langgraph_js_version,
|
|
36
48
|
context: "js",
|
|
37
49
|
flags: {
|
|
38
50
|
assistants: true,
|
package/dist/auth/custom.mjs
CHANGED
|
@@ -43,6 +43,9 @@ export const auth = () => {
|
|
|
43
43
|
return async (c, next) => {
|
|
44
44
|
if (!isAuthRegistered())
|
|
45
45
|
return next();
|
|
46
|
+
// skip for /info
|
|
47
|
+
if (c.req.path === "/info")
|
|
48
|
+
return next();
|
|
46
49
|
if (!isStudioAuthDisabled() &&
|
|
47
50
|
c.req.header("x-auth-scheme") === "langsmith") {
|
|
48
51
|
c.set("auth", {
|
package/dist/cli/entrypoint.mjs
CHANGED
|
@@ -24,10 +24,10 @@ const [{ host, cleanup }, organizationId] = await Promise.all([
|
|
|
24
24
|
if (isTracingEnabled()) {
|
|
25
25
|
try {
|
|
26
26
|
// @ts-expect-error Private method
|
|
27
|
-
return new LangSmithClient()._getTenantId();
|
|
27
|
+
return await new LangSmithClient()._getTenantId();
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
|
-
logger.warn("Failed to get organization ID", { error });
|
|
30
|
+
logger.warn("Failed to get organization ID. Tracing to LangSmith will not work.", { error });
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
@@ -62,7 +62,7 @@ export declare class SubgraphExtractor {
|
|
|
62
62
|
protected reduceChildren<Acc>(node: ts.Node, fn: (acc: Acc, node: ts.Node) => Acc, initial: Acc): Acc;
|
|
63
63
|
static extractSchemas(target: {
|
|
64
64
|
sourceFile: string | {
|
|
65
|
-
|
|
65
|
+
path: string;
|
|
66
66
|
contents: string;
|
|
67
67
|
main?: boolean;
|
|
68
68
|
}[];
|
|
@@ -276,12 +276,13 @@ export class SubgraphExtractor {
|
|
|
276
276
|
targetPaths.push({ ...item, sourceFile: item.sourceFile });
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
279
|
-
for (const {
|
|
280
|
-
|
|
279
|
+
for (const { path: sourcePath, contents, main } of item.sourceFile ??
|
|
280
|
+
[]) {
|
|
281
|
+
fsMap.set(vfsPath(path.resolve(projectDirname, sourcePath)), contents);
|
|
281
282
|
if (main) {
|
|
282
283
|
targetPaths.push({
|
|
283
284
|
...item,
|
|
284
|
-
sourceFile: path.resolve(projectDirname,
|
|
285
|
+
sourceFile: path.resolve(projectDirname, sourcePath),
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
288
|
}
|
|
@@ -312,12 +313,17 @@ export class SubgraphExtractor {
|
|
|
312
313
|
const researchTargets = [];
|
|
313
314
|
for (const targetPath of targetPaths) {
|
|
314
315
|
const extractor = new SubgraphExtractor(research, research.getSourceFile(targetPath.sourceFile), research.getSourceFile(INFER_TEMPLATE_PATH), options);
|
|
315
|
-
const
|
|
316
|
+
const suffix = path
|
|
317
|
+
.relative(projectDirname, targetPath.sourceFile)
|
|
318
|
+
.split(path.sep)
|
|
319
|
+
.join("__");
|
|
320
|
+
const graphDirname = path.dirname(targetPath.sourceFile);
|
|
321
|
+
const { sourceFile, inferFile, exports } = extractor.getAugmentedSourceFile(suffix, targetPath.exportSymbol);
|
|
316
322
|
for (const { fileName, contents } of [sourceFile, inferFile]) {
|
|
317
|
-
system.writeFile(vfsPath(path.resolve(
|
|
323
|
+
system.writeFile(vfsPath(path.resolve(graphDirname, fileName)), contents);
|
|
318
324
|
}
|
|
319
325
|
researchTargets.push({
|
|
320
|
-
rootName: path.resolve(
|
|
326
|
+
rootName: path.resolve(graphDirname, inferFile.fileName),
|
|
321
327
|
exports,
|
|
322
328
|
});
|
|
323
329
|
}
|
package/dist/schemas.d.mts
CHANGED
|
@@ -183,7 +183,6 @@ export declare const AssistantCreate: z.ZodObject<{
|
|
|
183
183
|
graph_id: string;
|
|
184
184
|
context?: unknown;
|
|
185
185
|
metadata?: z.objectOutputType<{}, z.ZodUnknown, "strip"> | undefined;
|
|
186
|
-
name?: string | undefined;
|
|
187
186
|
config?: z.objectOutputType<{
|
|
188
187
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
189
188
|
recursion_limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -198,13 +197,13 @@ export declare const AssistantCreate: z.ZodObject<{
|
|
|
198
197
|
thread_ts: z.ZodOptional<z.ZodString>;
|
|
199
198
|
}, z.ZodUnknown, "strip">>>;
|
|
200
199
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
200
|
+
name?: string | undefined;
|
|
201
201
|
if_exists?: "do_nothing" | "raise" | undefined;
|
|
202
202
|
assistant_id?: string | undefined;
|
|
203
203
|
}, {
|
|
204
204
|
graph_id: string;
|
|
205
205
|
context?: unknown;
|
|
206
206
|
metadata?: z.objectInputType<{}, z.ZodUnknown, "strip"> | undefined;
|
|
207
|
-
name?: string | undefined;
|
|
208
207
|
config?: z.objectInputType<{
|
|
209
208
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
210
209
|
recursion_limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -219,6 +218,7 @@ export declare const AssistantCreate: z.ZodObject<{
|
|
|
219
218
|
thread_ts: z.ZodOptional<z.ZodString>;
|
|
220
219
|
}, z.ZodUnknown, "strip">>>;
|
|
221
220
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
221
|
+
name?: string | undefined;
|
|
222
222
|
if_exists?: "do_nothing" | "raise" | undefined;
|
|
223
223
|
assistant_id?: string | undefined;
|
|
224
224
|
}>;
|
|
@@ -270,7 +270,6 @@ export declare const AssistantPatch: z.ZodObject<{
|
|
|
270
270
|
}, "strip", z.ZodTypeAny, {
|
|
271
271
|
context?: unknown;
|
|
272
272
|
metadata?: z.objectOutputType<{}, z.ZodAny, "strip"> | undefined;
|
|
273
|
-
name?: string | undefined;
|
|
274
273
|
config?: z.objectOutputType<{
|
|
275
274
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
276
275
|
recursion_limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -285,11 +284,11 @@ export declare const AssistantPatch: z.ZodObject<{
|
|
|
285
284
|
thread_ts: z.ZodOptional<z.ZodString>;
|
|
286
285
|
}, z.ZodUnknown, "strip">>>;
|
|
287
286
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
287
|
+
name?: string | undefined;
|
|
288
288
|
graph_id?: string | undefined;
|
|
289
289
|
}, {
|
|
290
290
|
context?: unknown;
|
|
291
291
|
metadata?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
|
|
292
|
-
name?: string | undefined;
|
|
293
292
|
config?: z.objectInputType<{
|
|
294
293
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
295
294
|
recursion_limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -304,6 +303,7 @@ export declare const AssistantPatch: z.ZodObject<{
|
|
|
304
303
|
thread_ts: z.ZodOptional<z.ZodString>;
|
|
305
304
|
}, z.ZodUnknown, "strip">>>;
|
|
306
305
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
306
|
+
name?: string | undefined;
|
|
307
307
|
graph_id?: string | undefined;
|
|
308
308
|
}>;
|
|
309
309
|
export declare const Config: z.ZodObject<{
|
package/dist/server.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import { registerHttp } from "./http/custom.mjs";
|
|
|
19
19
|
import { cors, ensureContentType } from "./http/middleware.mjs";
|
|
20
20
|
import { bindLoopbackFetch } from "./loopback.mjs";
|
|
21
21
|
import { checkLangGraphSemver } from "./semver/index.mjs";
|
|
22
|
+
import { getConfig } from "@langchain/langgraph";
|
|
22
23
|
export const StartServerSchema = z.object({
|
|
23
24
|
port: z.number(),
|
|
24
25
|
nWorkers: z.number(),
|
|
@@ -79,9 +80,6 @@ export async function startServer(options) {
|
|
|
79
80
|
registerSdkLogger();
|
|
80
81
|
logger.info(`Registering graphs from ${options.cwd}`);
|
|
81
82
|
await registerFromEnv(options.graphs, { cwd: options.cwd });
|
|
82
|
-
// Make sure to register the runtime formatter after we've loaded the graphs
|
|
83
|
-
// to ensure that we're not loading `@langchain/langgraph` from different path.
|
|
84
|
-
const { getConfig } = await import("@langchain/langgraph");
|
|
85
83
|
registerRuntimeLogFormatter((info) => {
|
|
86
84
|
const config = getConfig();
|
|
87
85
|
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.55",
|
|
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.55",
|
|
56
56
|
"@types/json-schema": "^7.0.15",
|
|
57
57
|
"@typescript/vfs": "^1.6.0",
|
|
58
58
|
"dedent": "^1.5.3",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@langchain/core": "^0.3.59",
|
|
87
|
-
"@langchain/langgraph": "0.4.
|
|
87
|
+
"@langchain/langgraph": "0.4.1",
|
|
88
88
|
"@langchain/langgraph-checkpoint": "0.1.0",
|
|
89
|
-
"@langchain/langgraph-sdk": "0.0.
|
|
89
|
+
"@langchain/langgraph-sdk": "0.0.105",
|
|
90
90
|
"@types/babel__code-frame": "^7.0.6",
|
|
91
91
|
"@types/node": "^18.15.11",
|
|
92
92
|
"@types/react": "^19.0.8",
|