@langchain/langgraph-api 0.0.65 → 0.0.66

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,13 @@
1
1
  # @langchain/langgraph-api
2
2
 
3
+ ## 0.0.66
4
+
5
+ ### Patch Changes
6
+
7
+ - 5176f1c: chore(api): add description field for assistants
8
+ - 68a1aa8: fix(api): call threads:create auth handler when copying a thread
9
+ - @langchain/langgraph-ui@0.0.66
10
+
3
11
  ## 0.0.65
4
12
 
5
13
  ### Patch Changes
@@ -40,6 +40,7 @@ api.post("/assistants", zValidator("json", schemas.AssistantCreate), async (c) =
40
40
  metadata: payload.metadata ?? {},
41
41
  if_exists: payload.if_exists ?? "raise",
42
42
  name: payload.name ?? "Untitled",
43
+ description: payload.description,
43
44
  }, c.var.auth);
44
45
  return c.json(assistant);
45
46
  });
@@ -179,6 +179,7 @@ export declare const AssistantCreate: z.ZodObject<{
179
179
  metadata: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodUnknown, z.objectOutputType<{}, z.ZodUnknown, "strip">, z.objectInputType<{}, z.ZodUnknown, "strip">>>;
180
180
  if_exists: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"raise">, z.ZodLiteral<"do_nothing">]>>;
181
181
  name: z.ZodOptional<z.ZodString>;
182
+ description: z.ZodOptional<z.ZodString>;
182
183
  }, "strip", z.ZodTypeAny, {
183
184
  graph_id: string;
184
185
  context?: unknown;
@@ -198,6 +199,7 @@ export declare const AssistantCreate: z.ZodObject<{
198
199
  }, z.ZodUnknown, "strip">>>;
199
200
  }, z.ZodUnknown, "strip"> | undefined;
200
201
  name?: string | undefined;
202
+ description?: string | undefined;
201
203
  assistant_id?: string | undefined;
202
204
  if_exists?: "raise" | "do_nothing" | undefined;
203
205
  }, {
@@ -219,6 +221,7 @@ export declare const AssistantCreate: z.ZodObject<{
219
221
  }, z.ZodUnknown, "strip">>>;
220
222
  }, z.ZodUnknown, "strip"> | undefined;
221
223
  name?: string | undefined;
224
+ description?: string | undefined;
222
225
  assistant_id?: string | undefined;
223
226
  if_exists?: "raise" | "do_nothing" | undefined;
224
227
  }>;
@@ -266,6 +269,7 @@ export declare const AssistantPatch: z.ZodObject<{
266
269
  }, z.ZodUnknown, "strip">>>;
267
270
  context: z.ZodOptional<z.ZodUnknown>;
268
271
  name: z.ZodOptional<z.ZodString>;
272
+ description: z.ZodOptional<z.ZodString>;
269
273
  metadata: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodAny, z.objectOutputType<{}, z.ZodAny, "strip">, z.objectInputType<{}, z.ZodAny, "strip">>>;
270
274
  }, "strip", z.ZodTypeAny, {
271
275
  context?: unknown;
@@ -286,6 +290,7 @@ export declare const AssistantPatch: z.ZodObject<{
286
290
  }, z.ZodUnknown, "strip"> | undefined;
287
291
  name?: string | undefined;
288
292
  graph_id?: string | undefined;
293
+ description?: string | undefined;
289
294
  }, {
290
295
  context?: unknown;
291
296
  metadata?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
@@ -305,6 +310,7 @@ export declare const AssistantPatch: z.ZodObject<{
305
310
  }, z.ZodUnknown, "strip"> | undefined;
306
311
  name?: string | undefined;
307
312
  graph_id?: string | undefined;
313
+ description?: string | undefined;
308
314
  }>;
309
315
  export declare const Config: z.ZodObject<{
310
316
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
package/dist/schemas.mjs CHANGED
@@ -40,6 +40,7 @@ export const AssistantCreate = z
40
40
  .union([z.literal("raise"), z.literal("do_nothing")])
41
41
  .optional(),
42
42
  name: z.string().optional(),
43
+ description: z.string().optional(),
43
44
  })
44
45
  .describe("Payload for creating an assistant.");
45
46
  export const AssistantPatch = z
@@ -48,6 +49,7 @@ export const AssistantPatch = z
48
49
  config: AssistantConfig.optional(),
49
50
  context: z.unknown().optional(),
50
51
  name: z.string().optional(),
52
+ description: z.string().optional(),
51
53
  metadata: z
52
54
  .object({})
53
55
  .catchall(z.any())
@@ -66,6 +66,7 @@ export declare class FileSystemAssistants implements AssistantsRepo {
66
66
  metadata?: Metadata;
67
67
  if_exists: OnConflictBehavior;
68
68
  name?: string;
69
+ description?: string;
69
70
  }, auth: AuthContext | undefined): Promise<Assistant>;
70
71
  patch(assistantId: string, options: {
71
72
  config?: RunnableConfig;
@@ -73,6 +74,7 @@ export declare class FileSystemAssistants implements AssistantsRepo {
73
74
  graph_id?: string;
74
75
  metadata?: Metadata;
75
76
  name?: string;
77
+ description?: string;
76
78
  }, auth: AuthContext | undefined): Promise<Assistant>;
77
79
  delete(assistant_id: string, auth: AuthContext | undefined): Promise<string[]>;
78
80
  setLatest(assistant_id: string, version: number, auth: AuthContext | undefined): Promise<Assistant>;
@@ -221,6 +221,7 @@ export class FileSystemAssistants {
221
221
  metadata: options.metadata,
222
222
  if_exists: options.if_exists,
223
223
  name: options.name,
224
+ description: options.description,
224
225
  });
225
226
  return this.conn.with((STORE) => {
226
227
  if (STORE.assistants[assistant_id] != null) {
@@ -244,6 +245,7 @@ export class FileSystemAssistants {
244
245
  graph_id: options.graph_id,
245
246
  metadata: mutable.metadata ?? {},
246
247
  name: options.name || options.graph_id,
248
+ description: options.description,
247
249
  };
248
250
  STORE.assistant_versions.push({
249
251
  assistant_id: assistant_id,
@@ -254,6 +256,7 @@ export class FileSystemAssistants {
254
256
  metadata: mutable.metadata ?? {},
255
257
  created_at: now,
256
258
  name: options.name || options.graph_id,
259
+ description: options.description,
257
260
  });
258
261
  return STORE.assistants[assistant_id];
259
262
  });
@@ -265,6 +268,7 @@ export class FileSystemAssistants {
265
268
  config: options?.config,
266
269
  metadata: options?.metadata,
267
270
  name: options?.name,
271
+ description: options?.description,
268
272
  });
269
273
  return this.conn.with((STORE) => {
270
274
  const assistant = STORE.assistants[assistantId];
@@ -293,6 +297,10 @@ export class FileSystemAssistants {
293
297
  if (options?.name != null) {
294
298
  assistant["name"] = options?.name ?? assistant["name"];
295
299
  }
300
+ if (options?.description != null) {
301
+ assistant["description"] =
302
+ options?.description ?? assistant["description"];
303
+ }
296
304
  if (metadata != null) {
297
305
  assistant["metadata"] = metadata ?? assistant["metadata"];
298
306
  }
@@ -308,6 +316,7 @@ export class FileSystemAssistants {
308
316
  config: options?.config ?? assistant["config"],
309
317
  context: options?.context ?? assistant["context"],
310
318
  name: options?.name ?? assistant["name"],
319
+ description: options?.description ?? assistant["description"],
311
320
  metadata: metadata ?? assistant["metadata"],
312
321
  created_at: now,
313
322
  };
@@ -615,20 +624,28 @@ export class FileSystemThreads {
615
624
  const [filters] = await handleAuthEvent(auth, "threads:read", {
616
625
  thread_id,
617
626
  });
618
- return this.conn.with((STORE) => {
627
+ const fromThread = await this.conn.with((STORE) => {
619
628
  const thread = STORE.threads[thread_id];
620
629
  if (!thread)
621
630
  throw new HTTPException(409, { message: "Thread not found" });
622
631
  if (!isAuthMatching(thread["metadata"], filters)) {
623
632
  throw new HTTPException(409, { message: "Thread not found" });
624
633
  }
625
- const newThreadId = uuid4();
626
- const now = new Date();
634
+ return thread;
635
+ });
636
+ const newThreadId = uuid4();
637
+ const now = new Date();
638
+ const newMetadata = { ...fromThread.metadata, thread_id: newThreadId };
639
+ await handleAuthEvent(auth, "threads:create", {
640
+ thread_id: newThreadId,
641
+ metadata: newMetadata,
642
+ });
643
+ return this.conn.with((STORE) => {
627
644
  STORE.threads[newThreadId] = {
628
645
  thread_id: newThreadId,
629
646
  created_at: now,
630
647
  updated_at: now,
631
- metadata: { ...thread.metadata, thread_id: newThreadId },
648
+ metadata: newMetadata,
632
649
  config: {},
633
650
  status: "idle",
634
651
  };
@@ -26,6 +26,7 @@ export interface RunnableConfig {
26
26
  }
27
27
  export interface Assistant {
28
28
  name: string | undefined;
29
+ description: string | undefined;
29
30
  assistant_id: string;
30
31
  graph_id: string;
31
32
  created_at: Date;
@@ -44,6 +45,7 @@ export interface AssistantVersion {
44
45
  metadata: Metadata;
45
46
  created_at: Date;
46
47
  name: string | undefined;
48
+ description: string | undefined;
47
49
  }
48
50
  export interface RunKwargs {
49
51
  input?: unknown;
@@ -255,6 +257,7 @@ export interface AssistantsRepo {
255
257
  metadata?: Metadata;
256
258
  if_exists: OnConflictBehavior;
257
259
  name?: string;
260
+ description?: string;
258
261
  }, auth: AuthContext | undefined): Promise<Assistant>;
259
262
  patch(assistantId: string, options: {
260
263
  config?: RunnableConfig;
@@ -262,6 +265,7 @@ export interface AssistantsRepo {
262
265
  graph_id?: string;
263
266
  metadata?: Metadata;
264
267
  name?: string;
268
+ description?: string;
265
269
  }, auth: AuthContext | undefined): Promise<Assistant>;
266
270
  delete(assistant_id: string, auth: AuthContext | undefined): Promise<string[]>;
267
271
  count(options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
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.65",
67
+ "@langchain/langgraph-ui": "0.0.66",
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.1",
101
+ "@langchain/langgraph-sdk": "0.1.2",
102
102
  "@types/babel__code-frame": "^7.0.6",
103
103
  "@types/node": "^18.15.11",
104
104
  "@types/react": "^19.0.8",