@langchain/langgraph-api 0.0.66 → 0.0.68

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,18 @@
1
1
  # @langchain/langgraph-api
2
2
 
3
+ ## 0.0.68
4
+
5
+ ### Patch Changes
6
+
7
+ - @langchain/langgraph-ui@0.0.68
8
+
9
+ ## 0.0.67
10
+
11
+ ### Patch Changes
12
+
13
+ - e23fa7f: Add support for `sort_by`, `sort_order` and `select` when searching for assistants and add support for pagination headers.
14
+ - @langchain/langgraph-ui@0.0.67
15
+
3
16
  ## 0.0.66
4
17
 
5
18
  ### Patch Changes
@@ -54,13 +54,22 @@ api.post("/assistants/search", zValidator("json", schemas.AssistantSearchRequest
54
54
  metadata: payload.metadata,
55
55
  limit: payload.limit ?? 10,
56
56
  offset: payload.offset ?? 0,
57
+ sort_by: payload.sort_by,
58
+ sort_order: payload.sort_order,
59
+ select: payload.select,
57
60
  }, c.var.auth)) {
58
- result.push(item.assistant);
61
+ result.push(Object.fromEntries(Object.entries(item.assistant).filter(([k]) => !payload.select || payload.select.includes(k))));
59
62
  if (total === 0) {
60
63
  total = item.total;
61
64
  }
62
65
  }
63
- c.res.headers.set("X-Pagination-Total", total.toString());
66
+ if (total === payload.limit) {
67
+ c.res.headers.set("X-Pagination-Next", ((payload.offset ?? 0) + total).toString());
68
+ c.res.headers.set("X-Pagination-Total", ((payload.offset ?? 0) + total + 1).toString());
69
+ }
70
+ else {
71
+ c.res.headers.set("X-Pagination-Total", ((payload.offset ?? 0) + total).toString());
72
+ }
64
73
  return c.json(result);
65
74
  });
66
75
  api.post("/assistants/count", zValidator("json", schemas.AssistantCountRequest), async (c) => {
@@ -111,8 +111,8 @@ export declare const Assistant: z.ZodObject<{
111
111
  };
112
112
  created_at: string;
113
113
  updated_at: string;
114
- graph_id: string;
115
114
  assistant_id: string;
115
+ graph_id: string;
116
116
  }, {
117
117
  metadata: {} & {
118
118
  [k: string]: any;
@@ -129,8 +129,8 @@ export declare const Assistant: z.ZodObject<{
129
129
  };
130
130
  created_at: string;
131
131
  updated_at: string;
132
- graph_id: string;
133
132
  assistant_id: string;
133
+ graph_id: string;
134
134
  }>;
135
135
  export declare const AssistantCreate: z.ZodObject<{
136
136
  assistant_id: z.ZodOptional<z.ZodString>;
@@ -198,9 +198,9 @@ export declare const AssistantCreate: z.ZodObject<{
198
198
  thread_ts: z.ZodOptional<z.ZodString>;
199
199
  }, z.ZodUnknown, "strip">>>;
200
200
  }, z.ZodUnknown, "strip"> | undefined;
201
+ assistant_id?: string | undefined;
201
202
  name?: string | undefined;
202
203
  description?: string | undefined;
203
- assistant_id?: string | undefined;
204
204
  if_exists?: "raise" | "do_nothing" | undefined;
205
205
  }, {
206
206
  graph_id: string;
@@ -220,9 +220,9 @@ export declare const AssistantCreate: z.ZodObject<{
220
220
  thread_ts: z.ZodOptional<z.ZodString>;
221
221
  }, z.ZodUnknown, "strip">>>;
222
222
  }, z.ZodUnknown, "strip"> | undefined;
223
+ assistant_id?: string | undefined;
223
224
  name?: string | undefined;
224
225
  description?: string | undefined;
225
- assistant_id?: string | undefined;
226
226
  if_exists?: "raise" | "do_nothing" | undefined;
227
227
  }>;
228
228
  export declare const AssistantPatch: z.ZodObject<{
@@ -530,8 +530,8 @@ export declare const Run: z.ZodObject<{
530
530
  };
531
531
  created_at: string;
532
532
  updated_at: string;
533
- run_id: string;
534
533
  assistant_id: string;
534
+ run_id: string;
535
535
  multitask_strategy: "reject" | "rollback" | "interrupt" | "enqueue";
536
536
  kwargs: {} & {
537
537
  [k: string]: any;
@@ -544,8 +544,8 @@ export declare const Run: z.ZodObject<{
544
544
  };
545
545
  created_at: string;
546
546
  updated_at: string;
547
- run_id: string;
548
547
  assistant_id: string;
548
+ run_id: string;
549
549
  multitask_strategy: "reject" | "rollback" | "interrupt" | "enqueue";
550
550
  kwargs: {} & {
551
551
  [k: string]: any;
@@ -1080,16 +1080,25 @@ export declare const AssistantSearchRequest: z.ZodObject<{
1080
1080
  graph_id: z.ZodOptional<z.ZodString>;
1081
1081
  limit: z.ZodOptional<z.ZodNumber>;
1082
1082
  offset: z.ZodOptional<z.ZodNumber>;
1083
+ sort_by: z.ZodOptional<z.ZodEnum<["assistant_id", "graph_id", "created_at", "updated_at", "name"]>>;
1084
+ sort_order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
1085
+ select: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1083
1086
  }, "strip", z.ZodTypeAny, {
1084
1087
  metadata?: z.objectOutputType<{}, z.ZodAny, "strip"> | undefined;
1085
1088
  graph_id?: string | undefined;
1086
1089
  limit?: number | undefined;
1087
1090
  offset?: number | undefined;
1091
+ sort_by?: "created_at" | "updated_at" | "assistant_id" | "name" | "graph_id" | undefined;
1092
+ sort_order?: "asc" | "desc" | undefined;
1093
+ select?: string[] | undefined;
1088
1094
  }, {
1089
1095
  metadata?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
1090
1096
  graph_id?: string | undefined;
1091
1097
  limit?: number | undefined;
1092
1098
  offset?: number | undefined;
1099
+ sort_by?: "created_at" | "updated_at" | "assistant_id" | "name" | "graph_id" | undefined;
1100
+ sort_order?: "asc" | "desc" | undefined;
1101
+ select?: string[] | undefined;
1093
1102
  }>;
1094
1103
  export declare const AssistantCountRequest: z.ZodObject<{
1095
1104
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1129,18 +1138,18 @@ export declare const ThreadSearchRequest: z.ZodObject<{
1129
1138
  metadata?: Record<string, unknown> | undefined;
1130
1139
  limit?: number | undefined;
1131
1140
  offset?: number | undefined;
1132
- ids?: string[] | undefined;
1133
1141
  sort_by?: "status" | "thread_id" | "created_at" | "updated_at" | undefined;
1134
1142
  sort_order?: "asc" | "desc" | undefined;
1143
+ ids?: string[] | undefined;
1135
1144
  }, {
1136
1145
  values?: Record<string, unknown> | undefined;
1137
1146
  status?: "error" | "idle" | "busy" | "interrupted" | undefined;
1138
1147
  metadata?: Record<string, unknown> | undefined;
1139
1148
  limit?: number | undefined;
1140
1149
  offset?: number | undefined;
1141
- ids?: string[] | undefined;
1142
1150
  sort_by?: "status" | "thread_id" | "created_at" | "updated_at" | undefined;
1143
1151
  sort_order?: "asc" | "desc" | undefined;
1152
+ ids?: string[] | undefined;
1144
1153
  }>;
1145
1154
  export declare const Thread: z.ZodObject<{
1146
1155
  thread_id: z.ZodString;
package/dist/schemas.mjs CHANGED
@@ -274,6 +274,11 @@ export const AssistantSearchRequest = z
274
274
  .gte(0)
275
275
  .describe("Offset to start from.")
276
276
  .optional(),
277
+ sort_by: z
278
+ .enum(["assistant_id", "graph_id", "created_at", "updated_at", "name"])
279
+ .optional(),
280
+ sort_order: z.enum(["asc", "desc"]).optional(),
281
+ select: z.array(z.string()).optional(),
277
282
  })
278
283
  .describe("Payload for listing assistants.");
279
284
  export const AssistantCountRequest = z
@@ -245,6 +245,9 @@ export interface AssistantsRepo {
245
245
  metadata?: Metadata;
246
246
  limit: number;
247
247
  offset: number;
248
+ sort_by?: "assistant_id" | "created_at" | "updated_at" | "name" | "graph_id";
249
+ sort_order?: "asc" | "desc";
250
+ select?: string[];
248
251
  }, auth: AuthContext | undefined): AsyncGenerator<{
249
252
  assistant: Assistant;
250
253
  total: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
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.66",
67
+ "@langchain/langgraph-ui": "0.0.68",
68
68
  "@types/json-schema": "^7.0.15",
69
69
  "@typescript/vfs": "^1.6.0",
70
70
  "dedent": "^1.5.3",
@@ -98,7 +98,7 @@
98
98
  "@langchain/core": "^0.3.59",
99
99
  "@langchain/langgraph": "0.4.9",
100
100
  "@langchain/langgraph-checkpoint": "0.1.1",
101
- "@langchain/langgraph-sdk": "0.1.2",
101
+ "@langchain/langgraph-sdk": "0.1.6",
102
102
  "@types/babel__code-frame": "^7.0.6",
103
103
  "@types/node": "^18.15.11",
104
104
  "@types/react": "^19.0.8",