@langchain/langgraph-api 1.1.2 → 1.1.8
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/package.json +9 -8
- package/CHANGELOG.md +0 -297
- package/dist/api/assistants.d.mts +0 -3
- package/dist/api/assistants.mjs +0 -193
- package/dist/api/meta.d.mts +0 -3
- package/dist/api/meta.mjs +0 -65
- package/dist/api/runs.d.mts +0 -3
- package/dist/api/runs.mjs +0 -324
- package/dist/api/store.d.mts +0 -3
- package/dist/api/store.mjs +0 -111
- package/dist/api/threads.d.mts +0 -3
- package/dist/api/threads.mjs +0 -143
- package/dist/auth/custom.d.mts +0 -9
- package/dist/auth/custom.mjs +0 -32
- package/dist/auth/index.d.mts +0 -43
- package/dist/auth/index.mjs +0 -163
- package/dist/cli/entrypoint.d.mts +0 -1
- package/dist/cli/entrypoint.mjs +0 -41
- package/dist/cli/spawn.d.mts +0 -42
- package/dist/cli/spawn.mjs +0 -47
- package/dist/cli/utils/ipc/client.d.mts +0 -5
- package/dist/cli/utils/ipc/client.mjs +0 -47
- package/dist/cli/utils/ipc/utils/get-pipe-path.d.mts +0 -1
- package/dist/cli/utils/ipc/utils/get-pipe-path.mjs +0 -29
- package/dist/cli/utils/ipc/utils/temporary-directory.d.mts +0 -5
- package/dist/cli/utils/ipc/utils/temporary-directory.mjs +0 -40
- package/dist/command.d.mts +0 -11
- package/dist/command.mjs +0 -15
- package/dist/experimental/embed.d.mts +0 -42
- package/dist/experimental/embed.mjs +0 -299
- package/dist/graph/api.d.mts +0 -1
- package/dist/graph/api.mjs +0 -2
- package/dist/graph/load.d.mts +0 -19
- package/dist/graph/load.hooks.d.mts +0 -2
- package/dist/graph/load.hooks.mjs +0 -52
- package/dist/graph/load.mjs +0 -96
- package/dist/graph/load.utils.d.mts +0 -22
- package/dist/graph/load.utils.mjs +0 -49
- package/dist/graph/parser/index.d.mts +0 -23
- package/dist/graph/parser/index.mjs +0 -58
- package/dist/graph/parser/parser.d.mts +0 -77
- package/dist/graph/parser/parser.mjs +0 -429
- package/dist/graph/parser/parser.worker.d.mts +0 -1
- package/dist/graph/parser/parser.worker.mjs +0 -7
- package/dist/graph/parser/schema/types.d.mts +0 -154
- package/dist/graph/parser/schema/types.mjs +0 -1496
- package/dist/graph/parser/schema/types.template.d.mts +0 -1
- package/dist/graph/parser/schema/types.template.mts +0 -92
- package/dist/http/custom.d.mts +0 -6
- package/dist/http/custom.mjs +0 -10
- package/dist/http/middleware.d.mts +0 -11
- package/dist/http/middleware.mjs +0 -57
- package/dist/logging.d.mts +0 -10
- package/dist/logging.mjs +0 -115
- package/dist/loopback.d.mts +0 -4
- package/dist/loopback.mjs +0 -10
- package/dist/preload.d.mts +0 -1
- package/dist/preload.mjs +0 -29
- package/dist/queue.d.mts +0 -2
- package/dist/queue.mjs +0 -119
- package/dist/schemas.d.mts +0 -1552
- package/dist/schemas.mjs +0 -492
- package/dist/semver/index.d.mts +0 -15
- package/dist/semver/index.mjs +0 -46
- package/dist/server.d.mts +0 -175
- package/dist/server.mjs +0 -181
- package/dist/state.d.mts +0 -3
- package/dist/state.mjs +0 -30
- package/dist/storage/checkpoint.d.mts +0 -19
- package/dist/storage/checkpoint.mjs +0 -127
- package/dist/storage/context.d.mts +0 -3
- package/dist/storage/context.mjs +0 -11
- package/dist/storage/importMap.d.mts +0 -55
- package/dist/storage/importMap.mjs +0 -55
- package/dist/storage/ops.d.mts +0 -169
- package/dist/storage/ops.mjs +0 -1262
- package/dist/storage/persist.d.mts +0 -18
- package/dist/storage/persist.mjs +0 -81
- package/dist/storage/store.d.mts +0 -17
- package/dist/storage/store.mjs +0 -41
- package/dist/storage/types.d.mts +0 -301
- package/dist/storage/types.mjs +0 -1
- package/dist/stream.d.mts +0 -43
- package/dist/stream.mjs +0 -235
- package/dist/ui/load.d.mts +0 -8
- package/dist/ui/load.mjs +0 -53
- package/dist/utils/abort.d.mts +0 -1
- package/dist/utils/abort.mjs +0 -8
- package/dist/utils/hono.d.mts +0 -5
- package/dist/utils/hono.mjs +0 -24
- package/dist/utils/importMap.d.mts +0 -55
- package/dist/utils/importMap.mjs +0 -55
- package/dist/utils/runnableConfig.d.mts +0 -3
- package/dist/utils/runnableConfig.mjs +0 -45
- package/dist/utils/serde.d.mts +0 -5
- package/dist/utils/serde.mjs +0 -20
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -12
- package/dist/webhook.d.mts +0 -11
- package/dist/webhook.mjs +0 -30
package/dist/schemas.mjs
DELETED
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
import { z } from "zod/v3";
|
|
2
|
-
export const AssistantConfigurable = z
|
|
3
|
-
.object({
|
|
4
|
-
thread_id: z.string().optional(),
|
|
5
|
-
thread_ts: z.string().optional(),
|
|
6
|
-
})
|
|
7
|
-
.catchall(z.unknown());
|
|
8
|
-
export const AssistantConfig = z
|
|
9
|
-
.object({
|
|
10
|
-
tags: z.array(z.string()).optional(),
|
|
11
|
-
recursion_limit: z.number().int().optional(),
|
|
12
|
-
configurable: AssistantConfigurable.optional(),
|
|
13
|
-
})
|
|
14
|
-
.catchall(z.unknown())
|
|
15
|
-
.describe("The configuration of an assistant.");
|
|
16
|
-
export const Assistant = z.object({
|
|
17
|
-
assistant_id: z.string().uuid(),
|
|
18
|
-
graph_id: z.string(),
|
|
19
|
-
config: AssistantConfig,
|
|
20
|
-
created_at: z.string(),
|
|
21
|
-
updated_at: z.string(),
|
|
22
|
-
metadata: z.object({}).catchall(z.any()),
|
|
23
|
-
});
|
|
24
|
-
export const AssistantCreate = z
|
|
25
|
-
.object({
|
|
26
|
-
assistant_id: z
|
|
27
|
-
.string()
|
|
28
|
-
.uuid()
|
|
29
|
-
.describe("The ID of the assistant. If not provided, an ID is generated.")
|
|
30
|
-
.optional(),
|
|
31
|
-
graph_id: z.string().describe("The graph to use."),
|
|
32
|
-
config: AssistantConfig.optional(),
|
|
33
|
-
context: z.unknown().optional(),
|
|
34
|
-
metadata: z
|
|
35
|
-
.object({})
|
|
36
|
-
.catchall(z.unknown())
|
|
37
|
-
.describe("Metadata for the assistant.")
|
|
38
|
-
.optional(),
|
|
39
|
-
if_exists: z
|
|
40
|
-
.union([z.literal("raise"), z.literal("do_nothing")])
|
|
41
|
-
.optional(),
|
|
42
|
-
name: z.string().optional(),
|
|
43
|
-
description: z.string().optional(),
|
|
44
|
-
})
|
|
45
|
-
.describe("Payload for creating an assistant.");
|
|
46
|
-
export const AssistantPatch = z
|
|
47
|
-
.object({
|
|
48
|
-
graph_id: z.string().describe("The graph to use.").optional(),
|
|
49
|
-
config: AssistantConfig.optional(),
|
|
50
|
-
context: z.unknown().optional(),
|
|
51
|
-
name: z.string().optional(),
|
|
52
|
-
description: z.string().optional(),
|
|
53
|
-
metadata: z
|
|
54
|
-
.object({})
|
|
55
|
-
.catchall(z.any())
|
|
56
|
-
.describe("Metadata to merge with existing assistant metadata.")
|
|
57
|
-
.optional(),
|
|
58
|
-
})
|
|
59
|
-
.describe("Payload for updating an assistant.");
|
|
60
|
-
export const Config = z.object({
|
|
61
|
-
tags: z.array(z.string()).optional(),
|
|
62
|
-
recursion_limit: z.number().int().optional(),
|
|
63
|
-
configurable: z.object({}).catchall(z.any()).optional(),
|
|
64
|
-
});
|
|
65
|
-
export const Cron = z.object({
|
|
66
|
-
cron_id: z.string().uuid(),
|
|
67
|
-
thread_id: z.string().uuid(),
|
|
68
|
-
end_time: z.string(),
|
|
69
|
-
schedule: z.string(),
|
|
70
|
-
created_at: z.string(),
|
|
71
|
-
updated_at: z.string(),
|
|
72
|
-
payload: z.object({}).catchall(z.any()),
|
|
73
|
-
});
|
|
74
|
-
export const CheckpointSchema = z.object({
|
|
75
|
-
checkpoint_id: z.string().uuid().optional(),
|
|
76
|
-
checkpoint_ns: z.string().nullish(),
|
|
77
|
-
checkpoint_map: z.record(z.unknown()).nullish(),
|
|
78
|
-
});
|
|
79
|
-
export const CronCreate = z
|
|
80
|
-
.object({
|
|
81
|
-
thread_id: z.string().uuid(),
|
|
82
|
-
assistant_id: z.string().uuid(),
|
|
83
|
-
checkpoint_id: z.string().optional(),
|
|
84
|
-
input: z
|
|
85
|
-
.union([
|
|
86
|
-
z.array(z.object({}).catchall(z.any())),
|
|
87
|
-
z.object({}).catchall(z.any()),
|
|
88
|
-
])
|
|
89
|
-
.optional(),
|
|
90
|
-
metadata: z
|
|
91
|
-
.object({})
|
|
92
|
-
.catchall(z.any())
|
|
93
|
-
.describe("Metadata for the run.")
|
|
94
|
-
.optional(),
|
|
95
|
-
config: AssistantConfig.optional(),
|
|
96
|
-
context: z.unknown().optional(),
|
|
97
|
-
webhook: z.string().optional(),
|
|
98
|
-
interrupt_before: z.union([z.enum(["*"]), z.array(z.string())]).optional(),
|
|
99
|
-
interrupt_after: z.union([z.enum(["*"]), z.array(z.string())]).optional(),
|
|
100
|
-
multitask_strategy: z
|
|
101
|
-
.enum(["reject", "rollback", "interrupt", "enqueue"])
|
|
102
|
-
.optional(),
|
|
103
|
-
})
|
|
104
|
-
.describe("Payload for creating a cron.");
|
|
105
|
-
export const CronSearch = z
|
|
106
|
-
.object({
|
|
107
|
-
assistant_id: z.string().uuid().optional(),
|
|
108
|
-
thread_id: z.string().uuid().optional(),
|
|
109
|
-
limit: z
|
|
110
|
-
.number()
|
|
111
|
-
.int()
|
|
112
|
-
.gte(1)
|
|
113
|
-
.lte(1000)
|
|
114
|
-
.describe("Maximum number to return.")
|
|
115
|
-
.optional(),
|
|
116
|
-
offset: z
|
|
117
|
-
.number()
|
|
118
|
-
.int()
|
|
119
|
-
.gte(0)
|
|
120
|
-
.describe("Offset to start from.")
|
|
121
|
-
.optional(),
|
|
122
|
-
})
|
|
123
|
-
.describe("Payload for listing crons");
|
|
124
|
-
export const GraphSchema = z.object({
|
|
125
|
-
graph_id: z.string(),
|
|
126
|
-
input_schema: z.object({}).catchall(z.any()).optional(),
|
|
127
|
-
output_schema: z.object({}).catchall(z.any()).optional(),
|
|
128
|
-
state_schema: z.object({}).catchall(z.any()),
|
|
129
|
-
config_schema: z.object({}).catchall(z.any()),
|
|
130
|
-
});
|
|
131
|
-
export const Run = z.object({
|
|
132
|
-
run_id: z.string().uuid(),
|
|
133
|
-
thread_id: z.string().uuid(),
|
|
134
|
-
assistant_id: z.string().uuid(),
|
|
135
|
-
created_at: z.string(),
|
|
136
|
-
updated_at: z.string(),
|
|
137
|
-
status: z.enum([
|
|
138
|
-
"pending",
|
|
139
|
-
"running",
|
|
140
|
-
"error",
|
|
141
|
-
"success",
|
|
142
|
-
"timeout",
|
|
143
|
-
"interrupted",
|
|
144
|
-
]),
|
|
145
|
-
metadata: z.object({}).catchall(z.any()),
|
|
146
|
-
kwargs: z.object({}).catchall(z.any()),
|
|
147
|
-
multitask_strategy: z.enum(["reject", "rollback", "interrupt", "enqueue"]),
|
|
148
|
-
});
|
|
149
|
-
export const CommandSchema = z.object({
|
|
150
|
-
goto: z
|
|
151
|
-
.union([
|
|
152
|
-
z.union([
|
|
153
|
-
z.string(),
|
|
154
|
-
z.object({ node: z.string(), input: z.unknown().optional() }),
|
|
155
|
-
]),
|
|
156
|
-
z.array(z.union([
|
|
157
|
-
z.string(),
|
|
158
|
-
z.object({ node: z.string(), input: z.unknown().optional() }),
|
|
159
|
-
])),
|
|
160
|
-
])
|
|
161
|
-
.optional(),
|
|
162
|
-
update: z
|
|
163
|
-
.union([z.record(z.unknown()), z.array(z.tuple([z.string(), z.unknown()]))])
|
|
164
|
-
.optional(),
|
|
165
|
-
resume: z.unknown().optional(),
|
|
166
|
-
});
|
|
167
|
-
export const LangsmithTracer = z.object({
|
|
168
|
-
project_name: z.string().optional(),
|
|
169
|
-
example_id: z.string().optional(),
|
|
170
|
-
});
|
|
171
|
-
export const RunCreate = z
|
|
172
|
-
.object({
|
|
173
|
-
assistant_id: z.union([z.string().uuid(), z.string()]),
|
|
174
|
-
checkpoint_id: z.string().optional(),
|
|
175
|
-
checkpoint: CheckpointSchema.optional(),
|
|
176
|
-
input: z.union([z.unknown(), z.null()]).optional(),
|
|
177
|
-
command: CommandSchema.optional(),
|
|
178
|
-
metadata: z
|
|
179
|
-
.object({})
|
|
180
|
-
.catchall(z.any())
|
|
181
|
-
.describe("Metadata for the run.")
|
|
182
|
-
.optional(),
|
|
183
|
-
context: z.unknown().optional(),
|
|
184
|
-
config: AssistantConfig.optional(),
|
|
185
|
-
webhook: z.string().optional(),
|
|
186
|
-
interrupt_before: z.union([z.enum(["*"]), z.array(z.string())]).optional(),
|
|
187
|
-
interrupt_after: z.union([z.enum(["*"]), z.array(z.string())]).optional(),
|
|
188
|
-
on_disconnect: z
|
|
189
|
-
.enum(["cancel", "continue"])
|
|
190
|
-
.optional()
|
|
191
|
-
.default("continue"),
|
|
192
|
-
multitask_strategy: z
|
|
193
|
-
.enum(["reject", "rollback", "interrupt", "enqueue"])
|
|
194
|
-
.optional(),
|
|
195
|
-
stream_mode: z
|
|
196
|
-
.union([
|
|
197
|
-
z.array(z.enum([
|
|
198
|
-
"values",
|
|
199
|
-
"messages",
|
|
200
|
-
"messages-tuple",
|
|
201
|
-
"updates",
|
|
202
|
-
"events",
|
|
203
|
-
"tasks",
|
|
204
|
-
"checkpoints",
|
|
205
|
-
"debug",
|
|
206
|
-
"custom",
|
|
207
|
-
])),
|
|
208
|
-
z.enum([
|
|
209
|
-
"values",
|
|
210
|
-
"messages",
|
|
211
|
-
"messages-tuple",
|
|
212
|
-
"updates",
|
|
213
|
-
"events",
|
|
214
|
-
"tasks",
|
|
215
|
-
"checkpoints",
|
|
216
|
-
"debug",
|
|
217
|
-
"custom",
|
|
218
|
-
]),
|
|
219
|
-
])
|
|
220
|
-
.optional(),
|
|
221
|
-
stream_subgraphs: z.boolean().optional(),
|
|
222
|
-
stream_resumable: z.boolean().optional(),
|
|
223
|
-
after_seconds: z.number().optional(),
|
|
224
|
-
if_not_exists: z.enum(["reject", "create"]).optional(),
|
|
225
|
-
on_completion: z.enum(["delete", "keep"]).optional(),
|
|
226
|
-
feedback_keys: z.array(z.string()).optional(),
|
|
227
|
-
langsmith_tracer: LangsmithTracer.optional(),
|
|
228
|
-
})
|
|
229
|
-
.describe("Payload for creating a stateful run.");
|
|
230
|
-
export const RunBatchCreate = z
|
|
231
|
-
.array(RunCreate)
|
|
232
|
-
.min(1)
|
|
233
|
-
.describe("Payload for creating a batch of runs.");
|
|
234
|
-
export const SearchResult = z
|
|
235
|
-
.object({
|
|
236
|
-
metadata: z
|
|
237
|
-
.object({})
|
|
238
|
-
.catchall(z.any())
|
|
239
|
-
.describe("Metadata to search for.")
|
|
240
|
-
.optional(),
|
|
241
|
-
limit: z
|
|
242
|
-
.number()
|
|
243
|
-
.int()
|
|
244
|
-
.gte(1)
|
|
245
|
-
.lte(1000)
|
|
246
|
-
.describe("Maximum number to return.")
|
|
247
|
-
.optional(),
|
|
248
|
-
offset: z
|
|
249
|
-
.number()
|
|
250
|
-
.int()
|
|
251
|
-
.gte(0)
|
|
252
|
-
.describe("Offset to start from.")
|
|
253
|
-
.optional(),
|
|
254
|
-
})
|
|
255
|
-
.describe("Payload for listing runs.");
|
|
256
|
-
export const AssistantSearchRequest = z
|
|
257
|
-
.object({
|
|
258
|
-
metadata: z
|
|
259
|
-
.object({})
|
|
260
|
-
.catchall(z.any())
|
|
261
|
-
.describe("Metadata to search for.")
|
|
262
|
-
.optional(),
|
|
263
|
-
graph_id: z.string().describe("Filter by graph ID.").optional(),
|
|
264
|
-
name: z
|
|
265
|
-
.string()
|
|
266
|
-
.describe("Filter by name. The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name.")
|
|
267
|
-
.optional(),
|
|
268
|
-
limit: z
|
|
269
|
-
.number()
|
|
270
|
-
.int()
|
|
271
|
-
.gte(1)
|
|
272
|
-
.lte(1000)
|
|
273
|
-
.describe("Maximum number to return.")
|
|
274
|
-
.optional(),
|
|
275
|
-
offset: z
|
|
276
|
-
.number()
|
|
277
|
-
.int()
|
|
278
|
-
.gte(0)
|
|
279
|
-
.describe("Offset to start from.")
|
|
280
|
-
.optional(),
|
|
281
|
-
sort_by: z
|
|
282
|
-
.enum(["assistant_id", "graph_id", "created_at", "updated_at", "name"])
|
|
283
|
-
.optional(),
|
|
284
|
-
sort_order: z.enum(["asc", "desc"]).optional(),
|
|
285
|
-
select: z.array(z.string()).optional(),
|
|
286
|
-
})
|
|
287
|
-
.describe("Payload for listing assistants.");
|
|
288
|
-
export const AssistantCountRequest = z
|
|
289
|
-
.object({
|
|
290
|
-
metadata: z
|
|
291
|
-
.record(z.unknown())
|
|
292
|
-
.describe("Metadata to search for.")
|
|
293
|
-
.optional(),
|
|
294
|
-
graph_id: z.string().describe("Filter by graph ID.").optional(),
|
|
295
|
-
name: z.string().describe("Filter by name.").optional(),
|
|
296
|
-
})
|
|
297
|
-
.describe("Payload for counting assistants.");
|
|
298
|
-
export const ThreadCountRequest = z
|
|
299
|
-
.object({
|
|
300
|
-
metadata: z
|
|
301
|
-
.record(z.unknown())
|
|
302
|
-
.describe("Metadata to search for.")
|
|
303
|
-
.optional(),
|
|
304
|
-
status: z
|
|
305
|
-
.enum(["idle", "busy", "interrupted", "error"])
|
|
306
|
-
.describe("Filter by thread status.")
|
|
307
|
-
.optional(),
|
|
308
|
-
values: z
|
|
309
|
-
.record(z.unknown())
|
|
310
|
-
.describe("Filter by thread values.")
|
|
311
|
-
.optional(),
|
|
312
|
-
})
|
|
313
|
-
.describe("Payload for counting threads.");
|
|
314
|
-
export const ThreadSearchRequest = z
|
|
315
|
-
.object({
|
|
316
|
-
metadata: z
|
|
317
|
-
.record(z.unknown())
|
|
318
|
-
.describe("Metadata to search for.")
|
|
319
|
-
.optional(),
|
|
320
|
-
ids: z
|
|
321
|
-
.array(z.string().uuid())
|
|
322
|
-
.describe("Filter by thread IDs.")
|
|
323
|
-
.optional(),
|
|
324
|
-
status: z
|
|
325
|
-
.enum(["idle", "busy", "interrupted", "error"])
|
|
326
|
-
.describe("Filter by thread status.")
|
|
327
|
-
.optional(),
|
|
328
|
-
values: z
|
|
329
|
-
.record(z.unknown())
|
|
330
|
-
.describe("Filter by thread values.")
|
|
331
|
-
.optional(),
|
|
332
|
-
limit: z
|
|
333
|
-
.number()
|
|
334
|
-
.int()
|
|
335
|
-
.gte(1)
|
|
336
|
-
.lte(1000)
|
|
337
|
-
.describe("Maximum number to return.")
|
|
338
|
-
.optional(),
|
|
339
|
-
offset: z
|
|
340
|
-
.number()
|
|
341
|
-
.int()
|
|
342
|
-
.gte(0)
|
|
343
|
-
.describe("Offset to start from.")
|
|
344
|
-
.optional(),
|
|
345
|
-
sort_by: z
|
|
346
|
-
.enum(["thread_id", "status", "created_at", "updated_at"])
|
|
347
|
-
.describe("Sort by field.")
|
|
348
|
-
.optional(),
|
|
349
|
-
sort_order: z.enum(["asc", "desc"]).describe("Sort order.").optional(),
|
|
350
|
-
select: z.array(z.string()).optional(),
|
|
351
|
-
})
|
|
352
|
-
.describe("Payload for listing threads.");
|
|
353
|
-
export const Thread = z.object({
|
|
354
|
-
thread_id: z.string().uuid(),
|
|
355
|
-
created_at: z.string(),
|
|
356
|
-
updated_at: z.string(),
|
|
357
|
-
metadata: z.record(z.unknown()).optional(),
|
|
358
|
-
status: z.enum(["idle", "busy", "interrupted", "error"]).optional(),
|
|
359
|
-
});
|
|
360
|
-
export const ThreadCreate = z
|
|
361
|
-
.object({
|
|
362
|
-
supersteps: z
|
|
363
|
-
.array(z.object({
|
|
364
|
-
updates: z.array(z.object({
|
|
365
|
-
values: z.unknown().nullish(),
|
|
366
|
-
command: CommandSchema.nullish(),
|
|
367
|
-
as_node: z.string(),
|
|
368
|
-
})),
|
|
369
|
-
}))
|
|
370
|
-
.describe("The supersteps to apply to the thread.")
|
|
371
|
-
.optional(),
|
|
372
|
-
thread_id: z
|
|
373
|
-
.string()
|
|
374
|
-
.uuid()
|
|
375
|
-
.describe("The ID of the thread. If not provided, an ID is generated.")
|
|
376
|
-
.optional(),
|
|
377
|
-
metadata: z
|
|
378
|
-
.object({})
|
|
379
|
-
.catchall(z.any())
|
|
380
|
-
.describe("Metadata for the thread.")
|
|
381
|
-
.optional(),
|
|
382
|
-
if_exists: z
|
|
383
|
-
.union([z.literal("raise"), z.literal("do_nothing")])
|
|
384
|
-
.optional(),
|
|
385
|
-
})
|
|
386
|
-
.describe("Payload for creating a thread.");
|
|
387
|
-
export const ThreadPatch = z
|
|
388
|
-
.object({
|
|
389
|
-
metadata: z
|
|
390
|
-
.object({})
|
|
391
|
-
.catchall(z.any())
|
|
392
|
-
.describe("Metadata to merge with existing thread metadata.")
|
|
393
|
-
.optional(),
|
|
394
|
-
})
|
|
395
|
-
.describe("Payload for patching a thread.");
|
|
396
|
-
export const ThreadState = z.object({
|
|
397
|
-
values: z.union([
|
|
398
|
-
z.array(z.object({}).catchall(z.any())),
|
|
399
|
-
z.object({}).catchall(z.any()),
|
|
400
|
-
]),
|
|
401
|
-
next: z.array(z.string()),
|
|
402
|
-
checkpoint_id: z.string(),
|
|
403
|
-
metadata: z.object({}).catchall(z.any()),
|
|
404
|
-
created_at: z.string(),
|
|
405
|
-
parent_checkpoint_id: z.string(),
|
|
406
|
-
});
|
|
407
|
-
export const ThreadStatePatch = z
|
|
408
|
-
.object({ metadata: z.object({}).catchall(z.any()) })
|
|
409
|
-
.describe("Payload for patching state of a thread.");
|
|
410
|
-
export const ThreadStateSearch = z.object({
|
|
411
|
-
limit: z
|
|
412
|
-
.number()
|
|
413
|
-
.int()
|
|
414
|
-
.gte(1)
|
|
415
|
-
.lte(1000)
|
|
416
|
-
.describe("The maximum number of states to return.")
|
|
417
|
-
.optional(),
|
|
418
|
-
before: z
|
|
419
|
-
.string()
|
|
420
|
-
.describe("Return states before this checkpoint ID.")
|
|
421
|
-
.optional(),
|
|
422
|
-
metadata: z
|
|
423
|
-
.object({})
|
|
424
|
-
.catchall(z.any())
|
|
425
|
-
.describe("Filter states by metadata key-value pairs.")
|
|
426
|
-
.optional(),
|
|
427
|
-
});
|
|
428
|
-
export const ThreadStateUpdate = z
|
|
429
|
-
.object({
|
|
430
|
-
values: z
|
|
431
|
-
.union([
|
|
432
|
-
z.record(z.string(), z.unknown()),
|
|
433
|
-
z.array(z.record(z.string(), z.unknown())),
|
|
434
|
-
])
|
|
435
|
-
.nullish(),
|
|
436
|
-
as_node: z.string().optional(),
|
|
437
|
-
checkpoint_id: z.string().optional(),
|
|
438
|
-
checkpoint: CheckpointSchema.nullish(),
|
|
439
|
-
})
|
|
440
|
-
.describe("Payload for adding state to a thread.");
|
|
441
|
-
export const ThreadHistoryRequest = z.object({
|
|
442
|
-
limit: z.number().optional().default(10),
|
|
443
|
-
before: z.string().optional(),
|
|
444
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
445
|
-
checkpoint: z
|
|
446
|
-
.object({
|
|
447
|
-
checkpoint_id: z.string().uuid().optional(),
|
|
448
|
-
checkpoint_ns: z.string().optional(),
|
|
449
|
-
checkpoint_map: z.record(z.string(), z.unknown()).optional(),
|
|
450
|
-
})
|
|
451
|
-
.optional(),
|
|
452
|
-
});
|
|
453
|
-
export const ThreadPatchRequest = z.object({
|
|
454
|
-
metadata: z.record(z.string(), z.unknown()),
|
|
455
|
-
});
|
|
456
|
-
export const AssistantLatestVersion = z.object({
|
|
457
|
-
version: z.number(),
|
|
458
|
-
});
|
|
459
|
-
export const StoreListNamespaces = z.object({
|
|
460
|
-
prefix: z.array(z.string()).optional(),
|
|
461
|
-
suffix: z.array(z.string()).optional(),
|
|
462
|
-
max_depth: z.number().optional(),
|
|
463
|
-
limit: z.number().default(100).optional(),
|
|
464
|
-
offset: z.number().default(0).optional(),
|
|
465
|
-
});
|
|
466
|
-
export const StoreSearchItems = z.object({
|
|
467
|
-
namespace_prefix: z.array(z.string()),
|
|
468
|
-
filter: z.record(z.unknown()).optional(),
|
|
469
|
-
limit: z.number().default(10).optional(),
|
|
470
|
-
offset: z.number().default(0).optional(),
|
|
471
|
-
query: z.string().optional(),
|
|
472
|
-
});
|
|
473
|
-
export const StorePutItem = z.object({
|
|
474
|
-
namespace: z.array(z.string()),
|
|
475
|
-
key: z.string(),
|
|
476
|
-
value: z.record(z.unknown()),
|
|
477
|
-
});
|
|
478
|
-
export const StoreDeleteItem = z.object({
|
|
479
|
-
namespace: z.array(z.string()).optional(),
|
|
480
|
-
key: z.string(),
|
|
481
|
-
});
|
|
482
|
-
export const StoreGetItem = z.object({
|
|
483
|
-
namespace: z
|
|
484
|
-
.string()
|
|
485
|
-
.optional()
|
|
486
|
-
.transform((value) => value?.split(".") ?? []),
|
|
487
|
-
key: z.string(),
|
|
488
|
-
});
|
|
489
|
-
export const coercedBoolean = z.string().transform((val) => {
|
|
490
|
-
const lower = val.toLowerCase();
|
|
491
|
-
return lower === "true" || lower === "1" || lower === "yes";
|
|
492
|
-
});
|
package/dist/semver/index.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare function checkSemver(packages: {
|
|
2
|
-
name: string;
|
|
3
|
-
version: string;
|
|
4
|
-
}[]): Promise<{
|
|
5
|
-
name: string;
|
|
6
|
-
version: string;
|
|
7
|
-
required: string;
|
|
8
|
-
satisfies: boolean;
|
|
9
|
-
}[]>;
|
|
10
|
-
export declare function checkLangGraphSemver(): Promise<{
|
|
11
|
-
name: string;
|
|
12
|
-
version: string;
|
|
13
|
-
required: string;
|
|
14
|
-
satisfies: boolean;
|
|
15
|
-
}[]>;
|
package/dist/semver/index.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as url from "node:url";
|
|
2
|
-
import * as fs from "node:fs/promises";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import * as semver from "semver";
|
|
5
|
-
const packageJsonPath = path.resolve(url.fileURLToPath(import.meta.url), "../../../package.json");
|
|
6
|
-
export async function checkSemver(packages) {
|
|
7
|
-
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
|
|
8
|
-
const peerDependencies = packageJson.peerDependencies ?? {};
|
|
9
|
-
return packages.flatMap((pkg) => {
|
|
10
|
-
const required = peerDependencies[pkg.name];
|
|
11
|
-
if (!required)
|
|
12
|
-
return [];
|
|
13
|
-
const satisfies = semver.satisfies(pkg.version, required);
|
|
14
|
-
return { ...pkg, required, satisfies };
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
export async function checkLangGraphSemver() {
|
|
18
|
-
const resolveVersion = async (name) => {
|
|
19
|
-
let version = "0.0.0";
|
|
20
|
-
try {
|
|
21
|
-
const pkgJson = await import(`${name}/package.json`);
|
|
22
|
-
if (pkgJson == null || typeof pkgJson !== "object") {
|
|
23
|
-
return { name, version };
|
|
24
|
-
}
|
|
25
|
-
if ("default" in pkgJson &&
|
|
26
|
-
typeof pkgJson.default === "object" &&
|
|
27
|
-
pkgJson.default != null) {
|
|
28
|
-
version = pkgJson.default.version || version;
|
|
29
|
-
}
|
|
30
|
-
else if ("version" in pkgJson) {
|
|
31
|
-
version = pkgJson.version || version;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
// pass
|
|
36
|
-
}
|
|
37
|
-
return { name, version };
|
|
38
|
-
};
|
|
39
|
-
const validate = [
|
|
40
|
-
"@langchain/core",
|
|
41
|
-
"@langchain/langgraph",
|
|
42
|
-
"@langchain/langgraph-checkpoint",
|
|
43
|
-
];
|
|
44
|
-
const resolved = await Promise.all(validate.map((name) => resolveVersion(name)));
|
|
45
|
-
return checkSemver(resolved);
|
|
46
|
-
}
|