@langchain/langgraph-api 0.0.63 → 0.0.65
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 +21 -0
- package/dist/api/threads.mjs +1 -0
- package/dist/auth/custom.mjs +3 -0
- package/dist/schemas.d.mts +3 -0
- package/dist/schemas.mjs +4 -0
- package/dist/storage/ops.d.mts +1 -0
- package/dist/storage/ops.mjs +5 -0
- package/dist/storage/types.d.mts +1 -0
- package/dist/ui/load.mjs +8 -2
- package/dist/utils/hono.d.mts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @langchain/langgraph-api
|
|
2
2
|
|
|
3
|
+
## 0.0.65
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0aefafe: Skip auth middleware when requesting JS/CSS assets for built-in generative UI
|
|
8
|
+
- @langchain/langgraph-ui@0.0.65
|
|
9
|
+
|
|
10
|
+
## 0.0.64
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 30bcfcd: Assume `http` protocol only when accessing UI components from frontend served from `localhost` or `127.0.0.1` (#1596, #1573)
|
|
15
|
+
- 572de43: feat(threads): add `ids` filter to Threads.search
|
|
16
|
+
|
|
17
|
+
- SDK: `ThreadsClient.search` now accepts `ids?: string[]` and forwards it to `/threads/search`.
|
|
18
|
+
- API: `/threads/search` schema accepts `ids` and storage filters by provided thread IDs.
|
|
19
|
+
|
|
20
|
+
This enables fetching a specific set of threads directly via the search endpoint, while remaining backward compatible.
|
|
21
|
+
|
|
22
|
+
- @langchain/langgraph-ui@0.0.64
|
|
23
|
+
|
|
3
24
|
## 0.0.63
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/api/threads.mjs
CHANGED
|
@@ -26,6 +26,7 @@ api.post("/threads/search", zValidator("json", schemas.ThreadSearchRequest), asy
|
|
|
26
26
|
status: payload.status,
|
|
27
27
|
values: payload.values,
|
|
28
28
|
metadata: payload.metadata,
|
|
29
|
+
ids: payload.ids,
|
|
29
30
|
limit: payload.limit ?? 10,
|
|
30
31
|
offset: payload.offset ?? 0,
|
|
31
32
|
sort_by: payload.sort_by ?? "created_at",
|
package/dist/auth/custom.mjs
CHANGED
|
@@ -13,6 +13,9 @@ export const auth = () => {
|
|
|
13
13
|
// skip for /info
|
|
14
14
|
if (c.req.path === "/info")
|
|
15
15
|
return next();
|
|
16
|
+
// skip for UI asset requests
|
|
17
|
+
if (c.req.path.startsWith("/ui") && c.req.method === "GET")
|
|
18
|
+
return next();
|
|
16
19
|
if (!isStudioAuthDisabled() &&
|
|
17
20
|
c.req.header("x-auth-scheme") === "langsmith") {
|
|
18
21
|
c.set("auth", {
|
package/dist/schemas.d.mts
CHANGED
|
@@ -1110,6 +1110,7 @@ export declare const ThreadCountRequest: z.ZodObject<{
|
|
|
1110
1110
|
}>;
|
|
1111
1111
|
export declare const ThreadSearchRequest: z.ZodObject<{
|
|
1112
1112
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1113
|
+
ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1113
1114
|
status: z.ZodOptional<z.ZodEnum<["idle", "busy", "interrupted", "error"]>>;
|
|
1114
1115
|
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1115
1116
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1122,6 +1123,7 @@ export declare const ThreadSearchRequest: z.ZodObject<{
|
|
|
1122
1123
|
metadata?: Record<string, unknown> | undefined;
|
|
1123
1124
|
limit?: number | undefined;
|
|
1124
1125
|
offset?: number | undefined;
|
|
1126
|
+
ids?: string[] | undefined;
|
|
1125
1127
|
sort_by?: "status" | "thread_id" | "created_at" | "updated_at" | undefined;
|
|
1126
1128
|
sort_order?: "asc" | "desc" | undefined;
|
|
1127
1129
|
}, {
|
|
@@ -1130,6 +1132,7 @@ export declare const ThreadSearchRequest: z.ZodObject<{
|
|
|
1130
1132
|
metadata?: Record<string, unknown> | undefined;
|
|
1131
1133
|
limit?: number | undefined;
|
|
1132
1134
|
offset?: number | undefined;
|
|
1135
|
+
ids?: string[] | undefined;
|
|
1133
1136
|
sort_by?: "status" | "thread_id" | "created_at" | "updated_at" | undefined;
|
|
1134
1137
|
sort_order?: "asc" | "desc" | undefined;
|
|
1135
1138
|
}>;
|
package/dist/schemas.mjs
CHANGED
|
@@ -305,6 +305,10 @@ export const ThreadSearchRequest = z
|
|
|
305
305
|
.record(z.unknown())
|
|
306
306
|
.describe("Metadata to search for.")
|
|
307
307
|
.optional(),
|
|
308
|
+
ids: z
|
|
309
|
+
.array(z.string().uuid())
|
|
310
|
+
.describe("Filter by thread IDs.")
|
|
311
|
+
.optional(),
|
|
308
312
|
status: z
|
|
309
313
|
.enum(["idle", "busy", "interrupted", "error"])
|
|
310
314
|
.describe("Filter by thread status.")
|
package/dist/storage/ops.d.mts
CHANGED
package/dist/storage/ops.mjs
CHANGED
|
@@ -425,6 +425,7 @@ export class FileSystemThreads {
|
|
|
425
425
|
async *search(options, auth) {
|
|
426
426
|
const [filters] = await handleAuthEvent(auth, "threads:search", {
|
|
427
427
|
metadata: options.metadata,
|
|
428
|
+
ids: options.ids,
|
|
428
429
|
status: options.status,
|
|
429
430
|
values: options.values,
|
|
430
431
|
limit: options.limit,
|
|
@@ -433,6 +434,10 @@ export class FileSystemThreads {
|
|
|
433
434
|
yield* this.conn.withGenerator(async function* (STORE) {
|
|
434
435
|
const filtered = Object.values(STORE.threads)
|
|
435
436
|
.filter((thread) => {
|
|
437
|
+
if (options.ids != null && options.ids.length > 0) {
|
|
438
|
+
if (!options.ids.includes(thread["thread_id"]))
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
436
441
|
if (options.metadata != null &&
|
|
437
442
|
!isJsonbContained(thread["metadata"], options.metadata))
|
|
438
443
|
return false;
|
package/dist/storage/types.d.mts
CHANGED
package/dist/ui/load.mjs
CHANGED
|
@@ -18,18 +18,24 @@ api.post("/ui/:agent", zValidator("json", z.object({ name: z.string() })), async
|
|
|
18
18
|
const agent = c.req.param("agent");
|
|
19
19
|
const host = c.req.header("host");
|
|
20
20
|
const message = await c.req.valid("json");
|
|
21
|
+
const isHost = (needle) => {
|
|
22
|
+
if (!host)
|
|
23
|
+
return false;
|
|
24
|
+
return host.startsWith(needle + ":") || host === needle;
|
|
25
|
+
};
|
|
26
|
+
const protocol = isHost("localhost") || isHost("127.0.0.1") ? "http:" : "";
|
|
21
27
|
const files = GRAPH_UI[agent];
|
|
22
28
|
if (!files?.length)
|
|
23
29
|
return c.text(`UI not found for agent "${agent}"`, 404);
|
|
24
30
|
const messageName = JSON.stringify(message.name);
|
|
25
31
|
const result = [];
|
|
26
32
|
for (const css of files.filter((i) => path.extname(i.basename) === ".css")) {
|
|
27
|
-
result.push(`<link rel="stylesheet" href="
|
|
33
|
+
result.push(`<link rel="stylesheet" href="${protocol}//${host}/ui/${agent}/${css.basename}" />`);
|
|
28
34
|
}
|
|
29
35
|
const stableName = agent.replace(/[^a-zA-Z0-9]/g, "_");
|
|
30
36
|
const js = files.find((i) => path.extname(i.basename) === ".js");
|
|
31
37
|
if (js) {
|
|
32
|
-
result.push(`<script src="
|
|
38
|
+
result.push(`<script src="${protocol}//${host}/ui/${agent}/${js.basename}" onload='__LGUI_${stableName}.render(${messageName}, "{{shadowRootId}}")'></script>`);
|
|
33
39
|
}
|
|
34
40
|
return c.text(result.join("\n"), {
|
|
35
41
|
headers: { "Content-Type": "text/html" },
|
package/dist/utils/hono.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "hono";
|
|
2
2
|
import { StreamingApi } from "hono/utils/stream";
|
|
3
|
-
export declare function jsonExtra<T>(c: Context, object: T): Response & import("hono").TypedResponse<
|
|
3
|
+
export declare function jsonExtra<T>(c: Context, object: T): Response & import("hono").TypedResponse<string, import("hono/utils/http-status").ContentfulStatusCode, "body">;
|
|
4
4
|
export declare function waitKeepAlive(c: Context, promise: Promise<unknown>): Response;
|
|
5
5
|
export declare const getDisconnectAbortSignal: (c: Context, stream: StreamingApi) => AbortSignal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^18.19.0 || >=20.16.0"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@babel/code-frame": "^7.26.2",
|
|
65
65
|
"@hono/node-server": "^1.12.0",
|
|
66
66
|
"@hono/zod-validator": "^0.2.2",
|
|
67
|
-
"@langchain/langgraph-ui": "0.0.
|
|
67
|
+
"@langchain/langgraph-ui": "0.0.65",
|
|
68
68
|
"@types/json-schema": "^7.0.15",
|
|
69
69
|
"@typescript/vfs": "^1.6.0",
|
|
70
70
|
"dedent": "^1.5.3",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@langchain/core": "^0.3.59",
|
|
99
|
-
"@langchain/langgraph": "0.4.
|
|
100
|
-
"@langchain/langgraph-checkpoint": "0.1.
|
|
101
|
-
"@langchain/langgraph-sdk": "0.
|
|
99
|
+
"@langchain/langgraph": "0.4.9",
|
|
100
|
+
"@langchain/langgraph-checkpoint": "0.1.1",
|
|
101
|
+
"@langchain/langgraph-sdk": "0.1.1",
|
|
102
102
|
"@types/babel__code-frame": "^7.0.6",
|
|
103
103
|
"@types/node": "^18.15.11",
|
|
104
104
|
"@types/react": "^19.0.8",
|