@langchain/langgraph-api 0.0.62 → 0.0.64

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @langchain/langgraph-api
2
2
 
3
+ ## 0.0.64
4
+
5
+ ### Patch Changes
6
+
7
+ - 30bcfcd: Assume `http` protocol only when accessing UI components from frontend served from `localhost` or `127.0.0.1` (#1596, #1573)
8
+ - 572de43: feat(threads): add `ids` filter to Threads.search
9
+
10
+ - SDK: `ThreadsClient.search` now accepts `ids?: string[]` and forwards it to `/threads/search`.
11
+ - API: `/threads/search` schema accepts `ids` and storage filters by provided thread IDs.
12
+
13
+ This enables fetching a specific set of threads directly via the search endpoint, while remaining backward compatible.
14
+
15
+ - @langchain/langgraph-ui@0.0.64
16
+
17
+ ## 0.0.63
18
+
19
+ ### Patch Changes
20
+
21
+ - c9d4dfd: Add support for @langchain/core 1.0.0-alpha and @langchain/langgraph 1.0.0-alpha
22
+ - @langchain/langgraph-ui@0.0.63
23
+
3
24
  ## 0.0.62
4
25
 
5
26
  ### Patch Changes
@@ -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",
@@ -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.")
@@ -92,6 +92,7 @@ export declare class FileSystemThreads implements ThreadsRepo {
92
92
  constructor(conn: FileSystemPersistence<Store>);
93
93
  search(options: {
94
94
  metadata?: Metadata;
95
+ ids?: string[];
95
96
  status?: ThreadStatus;
96
97
  values?: Record<string, unknown>;
97
98
  limit: number;
@@ -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;
@@ -183,6 +183,7 @@ export interface RunsStreamRepo {
183
183
  export interface ThreadsRepo {
184
184
  search(options: {
185
185
  metadata?: Metadata;
186
+ ids?: string[];
186
187
  status?: ThreadStatus;
187
188
  values?: Record<string, unknown>;
188
189
  limit: number;
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="http://${host}/ui/${agent}/${css.basename}" />`);
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="http://${host}/ui/${agent}/${js.basename}" onload='__LGUI_${stableName}.render(${messageName}, "{{shadowRootId}}")'></script>`);
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
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.62",
67
+ "@langchain/langgraph-ui": "0.0.64",
68
68
  "@types/json-schema": "^7.0.15",
69
69
  "@typescript/vfs": "^1.6.0",
70
70
  "dedent": "^1.5.3",
@@ -83,8 +83,8 @@
83
83
  "zod": "^3.23.8"
84
84
  },
85
85
  "peerDependencies": {
86
- "@langchain/core": "^0.3.59",
87
- "@langchain/langgraph": "^0.2.57 || ^0.3.0 || ^0.4.0",
86
+ "@langchain/core": "^0.3.59 || ^1.0.0-alpha",
87
+ "@langchain/langgraph": "^0.2.57 || ^0.3.0 || ^0.4.0 || ^1.0.0-alpha",
88
88
  "@langchain/langgraph-checkpoint": "~0.0.16 || ^0.1.0",
89
89
  "@langchain/langgraph-sdk": "~0.0.70 || ^0.1.0",
90
90
  "typescript": "^5.5.4"
@@ -96,9 +96,9 @@
96
96
  },
97
97
  "devDependencies": {
98
98
  "@langchain/core": "^0.3.59",
99
- "@langchain/langgraph": "0.4.7",
100
- "@langchain/langgraph-checkpoint": "0.1.0",
101
- "@langchain/langgraph-sdk": "0.0.112",
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",