deepagents 1.6.0 → 1.6.1
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/dist/index.cjs +155 -6687
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -88
- package/dist/index.d.ts +78 -63
- package/dist/index.js +156 -6682
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as zod_v30 from "zod/v3";
|
|
2
|
-
import * as
|
|
2
|
+
import * as langchain8 from "langchain";
|
|
3
3
|
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, InferMiddlewareStates, InterruptOnConfig, ReactAgent, ResponseFormat, ResponseFormatUndefined, StructuredTool, SystemMessage, ToolMessage } from "langchain";
|
|
4
|
+
import * as _Command from "@langchain/langgraph";
|
|
5
|
+
import { AnnotationRoot, Command, ReducedValue, StateSchema } from "@langchain/langgraph";
|
|
6
|
+
import { z } from "zod/v4";
|
|
7
|
+
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
8
|
+
import * as _messages from "@langchain/core/messages";
|
|
4
9
|
import * as zod0 from "zod";
|
|
5
|
-
import { z } from "zod";
|
|
10
|
+
import { z as z$1 } from "zod";
|
|
6
11
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
|
-
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
8
12
|
import * as _langchain_core_language_models_base0 from "@langchain/core/language_models/base";
|
|
9
13
|
import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_models/base";
|
|
10
14
|
import * as _langchain_core_tools3 from "@langchain/core/tools";
|
|
11
15
|
import { ClientTool, ServerTool, StructuredTool as StructuredTool$1 } from "@langchain/core/tools";
|
|
12
|
-
import * as _Command from "@langchain/langgraph";
|
|
13
|
-
import { AnnotationRoot, Command } from "@langchain/langgraph";
|
|
14
|
-
import { z as z$1 } from "zod/v4";
|
|
15
|
-
import * as _messages from "@langchain/core/messages";
|
|
16
16
|
import { Runnable } from "@langchain/core/runnables";
|
|
17
|
+
import "@langchain/core/language_models/chat_models";
|
|
17
18
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
18
19
|
|
|
19
20
|
//#region src/backends/protocol.d.ts
|
|
@@ -287,6 +288,14 @@ interface StateAndStore {
|
|
|
287
288
|
type BackendFactory = (stateAndStore: StateAndStore) => BackendProtocol;
|
|
288
289
|
//#endregion
|
|
289
290
|
//#region src/middleware/fs.d.ts
|
|
291
|
+
/**
|
|
292
|
+
* Type for the files state record.
|
|
293
|
+
*/
|
|
294
|
+
type FilesRecord = Record<string, FileData>;
|
|
295
|
+
/**
|
|
296
|
+
* Type for file updates, where null indicates deletion.
|
|
297
|
+
*/
|
|
298
|
+
type FilesRecordUpdate = Record<string, FileData | null>;
|
|
290
299
|
/**
|
|
291
300
|
* Options for creating filesystem middleware.
|
|
292
301
|
*/
|
|
@@ -303,23 +312,19 @@ interface FilesystemMiddlewareOptions {
|
|
|
303
312
|
/**
|
|
304
313
|
* Create filesystem middleware with all tools and features.
|
|
305
314
|
*/
|
|
306
|
-
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<
|
|
307
|
-
files:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}, z$1.core.$strip>>>;
|
|
312
|
-
}, z$1.core.$strip>, undefined, unknown, (langchain9.DynamicStructuredTool<z$1.ZodObject<{
|
|
313
|
-
path: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
|
|
314
|
-
}, z$1.core.$strip>, {
|
|
315
|
+
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
316
|
+
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
317
|
+
}>, undefined, unknown, (langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
318
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
319
|
+
}, z.core.$strip>, {
|
|
315
320
|
path: string;
|
|
316
321
|
}, {
|
|
317
322
|
path?: string | undefined;
|
|
318
|
-
}, string, "ls"> |
|
|
319
|
-
file_path: z
|
|
320
|
-
offset: z
|
|
321
|
-
limit: z
|
|
322
|
-
}, z
|
|
323
|
+
}, string, "ls"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
324
|
+
file_path: z.ZodString;
|
|
325
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
326
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
327
|
+
}, z.core.$strip>, {
|
|
323
328
|
file_path: string;
|
|
324
329
|
offset: number;
|
|
325
330
|
limit: number;
|
|
@@ -327,10 +332,10 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
327
332
|
file_path: string;
|
|
328
333
|
offset?: unknown;
|
|
329
334
|
limit?: unknown;
|
|
330
|
-
}, string, "read_file"> |
|
|
331
|
-
file_path: z
|
|
332
|
-
content: z
|
|
333
|
-
}, z
|
|
335
|
+
}, string, "read_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
336
|
+
file_path: z.ZodString;
|
|
337
|
+
content: z.ZodString;
|
|
338
|
+
}, z.core.$strip>, {
|
|
334
339
|
file_path: string;
|
|
335
340
|
content: string;
|
|
336
341
|
}, {
|
|
@@ -339,12 +344,12 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
339
344
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
340
345
|
files: Record<string, FileData>;
|
|
341
346
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
342
|
-
}, string>, "write_file"> |
|
|
343
|
-
file_path: z
|
|
344
|
-
old_string: z
|
|
345
|
-
new_string: z
|
|
346
|
-
replace_all: z
|
|
347
|
-
}, z
|
|
347
|
+
}, string>, "write_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
348
|
+
file_path: z.ZodString;
|
|
349
|
+
old_string: z.ZodString;
|
|
350
|
+
new_string: z.ZodString;
|
|
351
|
+
replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
352
|
+
}, z.core.$strip>, {
|
|
348
353
|
file_path: string;
|
|
349
354
|
old_string: string;
|
|
350
355
|
new_string: string;
|
|
@@ -357,20 +362,20 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
357
362
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
358
363
|
files: Record<string, FileData>;
|
|
359
364
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
360
|
-
}, string>, "edit_file"> |
|
|
361
|
-
pattern: z
|
|
362
|
-
path: z
|
|
363
|
-
}, z
|
|
365
|
+
}, string>, "edit_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
366
|
+
pattern: z.ZodString;
|
|
367
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
368
|
+
}, z.core.$strip>, {
|
|
364
369
|
pattern: string;
|
|
365
370
|
path: string;
|
|
366
371
|
}, {
|
|
367
372
|
pattern: string;
|
|
368
373
|
path?: string | undefined;
|
|
369
|
-
}, string, "glob"> |
|
|
370
|
-
pattern: z
|
|
371
|
-
path: z
|
|
372
|
-
glob: z
|
|
373
|
-
}, z
|
|
374
|
+
}, string, "glob"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
375
|
+
pattern: z.ZodString;
|
|
376
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
377
|
+
glob: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
378
|
+
}, z.core.$strip>, {
|
|
374
379
|
pattern: string;
|
|
375
380
|
path: string;
|
|
376
381
|
glob?: string | null | undefined;
|
|
@@ -378,9 +383,9 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
378
383
|
pattern: string;
|
|
379
384
|
path?: string | undefined;
|
|
380
385
|
glob?: string | null | undefined;
|
|
381
|
-
}, string, "grep"> |
|
|
382
|
-
command: z
|
|
383
|
-
}, z
|
|
386
|
+
}, string, "grep"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
387
|
+
command: z.ZodString;
|
|
388
|
+
}, z.core.$strip>, {
|
|
384
389
|
command: string;
|
|
385
390
|
}, {
|
|
386
391
|
command: string;
|
|
@@ -444,10 +449,10 @@ interface SubAgentMiddlewareOptions {
|
|
|
444
449
|
/**
|
|
445
450
|
* Create subagent middleware with task tool
|
|
446
451
|
*/
|
|
447
|
-
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [
|
|
448
|
-
description: z
|
|
449
|
-
subagent_type: z
|
|
450
|
-
}, z
|
|
452
|
+
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
453
|
+
description: z.ZodString;
|
|
454
|
+
subagent_type: z.ZodString;
|
|
455
|
+
}, z.core.$strip>, {
|
|
451
456
|
description: string;
|
|
452
457
|
subagent_type: string;
|
|
453
458
|
}, {
|
|
@@ -600,9 +605,9 @@ interface MemoryMiddlewareOptions {
|
|
|
600
605
|
* });
|
|
601
606
|
* ```
|
|
602
607
|
*/
|
|
603
|
-
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<z.ZodObject<{
|
|
604
|
-
memoryContents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
605
|
-
}, z.core.$strip>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
608
|
+
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<z$1.ZodObject<{
|
|
609
|
+
memoryContents: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
610
|
+
}, z$1.core.$strip>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
606
611
|
//#endregion
|
|
607
612
|
//#region src/middleware/skills.d.ts
|
|
608
613
|
declare const MAX_SKILL_FILE_SIZE: number;
|
|
@@ -665,17 +670,25 @@ interface SkillsMiddlewareOptions {
|
|
|
665
670
|
* });
|
|
666
671
|
* ```
|
|
667
672
|
*/
|
|
668
|
-
declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): AgentMiddleware<
|
|
669
|
-
skillsMetadata:
|
|
670
|
-
name:
|
|
671
|
-
description:
|
|
672
|
-
path:
|
|
673
|
-
license
|
|
674
|
-
compatibility
|
|
675
|
-
metadata
|
|
676
|
-
allowedTools
|
|
677
|
-
},
|
|
678
|
-
|
|
673
|
+
declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
674
|
+
skillsMetadata: ReducedValue<{
|
|
675
|
+
name: string;
|
|
676
|
+
description: string;
|
|
677
|
+
path: string;
|
|
678
|
+
license?: string | null | undefined;
|
|
679
|
+
compatibility?: string | null | undefined;
|
|
680
|
+
metadata?: Record<string, string> | undefined;
|
|
681
|
+
allowedTools?: string[] | undefined;
|
|
682
|
+
}[] | undefined, {
|
|
683
|
+
name: string;
|
|
684
|
+
description: string;
|
|
685
|
+
path: string;
|
|
686
|
+
license?: string | null | undefined;
|
|
687
|
+
compatibility?: string | null | undefined;
|
|
688
|
+
metadata?: Record<string, string> | undefined;
|
|
689
|
+
allowedTools?: string[] | undefined;
|
|
690
|
+
}[] | undefined>;
|
|
691
|
+
}>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
679
692
|
//#endregion
|
|
680
693
|
//#region src/backends/store.d.ts
|
|
681
694
|
/**
|
|
@@ -1130,8 +1143,7 @@ interface DefaultDeepAgentTypeConfig extends DeepAgentTypeConfig {
|
|
|
1130
1143
|
* ```
|
|
1131
1144
|
*/
|
|
1132
1145
|
type DeepAgent<TTypes extends DeepAgentTypeConfig = DeepAgentTypeConfig> = ReactAgent<TTypes> & {
|
|
1133
|
-
/** Type brand for DeepAgent type inference */
|
|
1134
|
-
readonly "~deepAgentTypes": TTypes;
|
|
1146
|
+
/** Type brand for DeepAgent type inference */readonly "~deepAgentTypes": TTypes;
|
|
1135
1147
|
};
|
|
1136
1148
|
/**
|
|
1137
1149
|
* Helper type to resolve a DeepAgentTypeConfig from either:
|
|
@@ -1338,7 +1350,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1338
1350
|
content: string;
|
|
1339
1351
|
status: "completed" | "in_progress" | "pending";
|
|
1340
1352
|
}[] | undefined;
|
|
1341
|
-
}>, undefined, unknown, readonly [
|
|
1353
|
+
}>, undefined, unknown, readonly [langchain8.DynamicStructuredTool<zod_v30.ZodObject<{
|
|
1342
1354
|
todos: zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
1343
1355
|
content: zod_v30.ZodString;
|
|
1344
1356
|
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -1375,29 +1387,33 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1375
1387
|
status: "completed" | "in_progress" | "pending";
|
|
1376
1388
|
}[];
|
|
1377
1389
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1378
|
-
}, string>, "write_todos">]>, ...(AgentMiddleware<
|
|
1379
|
-
skillsMetadata:
|
|
1380
|
-
name:
|
|
1381
|
-
description:
|
|
1382
|
-
path:
|
|
1383
|
-
license
|
|
1384
|
-
compatibility
|
|
1385
|
-
metadata
|
|
1386
|
-
allowedTools
|
|
1387
|
-
},
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1390
|
+
}, string>, "write_todos">]>, ...(AgentMiddleware<_Command.StateSchema<{
|
|
1391
|
+
skillsMetadata: _Command.ReducedValue<{
|
|
1392
|
+
name: string;
|
|
1393
|
+
description: string;
|
|
1394
|
+
path: string;
|
|
1395
|
+
license?: string | null | undefined;
|
|
1396
|
+
compatibility?: string | null | undefined;
|
|
1397
|
+
metadata?: Record<string, string> | undefined;
|
|
1398
|
+
allowedTools?: string[] | undefined;
|
|
1399
|
+
}[] | undefined, {
|
|
1400
|
+
name: string;
|
|
1401
|
+
description: string;
|
|
1402
|
+
path: string;
|
|
1403
|
+
license?: string | null | undefined;
|
|
1404
|
+
compatibility?: string | null | undefined;
|
|
1405
|
+
metadata?: Record<string, string> | undefined;
|
|
1406
|
+
allowedTools?: string[] | undefined;
|
|
1407
|
+
}[] | undefined>;
|
|
1408
|
+
}>, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<_Command.StateSchema<{
|
|
1409
|
+
files: _Command.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1410
|
+
}>, undefined, unknown, (langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1395
1411
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1396
1412
|
}, zod_v4_core0.$strip>, {
|
|
1397
1413
|
path: string;
|
|
1398
1414
|
}, {
|
|
1399
1415
|
path?: string | undefined;
|
|
1400
|
-
}, string, "ls"> |
|
|
1416
|
+
}, string, "ls"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1401
1417
|
file_path: zod0.ZodString;
|
|
1402
1418
|
offset: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
1403
1419
|
limit: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
@@ -1409,7 +1425,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1409
1425
|
file_path: string;
|
|
1410
1426
|
offset?: unknown;
|
|
1411
1427
|
limit?: unknown;
|
|
1412
|
-
}, string, "read_file"> |
|
|
1428
|
+
}, string, "read_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1413
1429
|
file_path: zod0.ZodString;
|
|
1414
1430
|
content: zod0.ZodString;
|
|
1415
1431
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1421,7 +1437,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1421
1437
|
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _Command.Command<unknown, {
|
|
1422
1438
|
files: Record<string, FileData>;
|
|
1423
1439
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1424
|
-
}, string>, "write_file"> |
|
|
1440
|
+
}, string>, "write_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1425
1441
|
file_path: zod0.ZodString;
|
|
1426
1442
|
old_string: zod0.ZodString;
|
|
1427
1443
|
new_string: zod0.ZodString;
|
|
@@ -1439,7 +1455,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1439
1455
|
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _Command.Command<unknown, {
|
|
1440
1456
|
files: Record<string, FileData>;
|
|
1441
1457
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1442
|
-
}, string>, "edit_file"> |
|
|
1458
|
+
}, string>, "edit_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1443
1459
|
pattern: zod0.ZodString;
|
|
1444
1460
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1445
1461
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1448,7 +1464,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1448
1464
|
}, {
|
|
1449
1465
|
pattern: string;
|
|
1450
1466
|
path?: string | undefined;
|
|
1451
|
-
}, string, "glob"> |
|
|
1467
|
+
}, string, "glob"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1452
1468
|
pattern: zod0.ZodString;
|
|
1453
1469
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1454
1470
|
glob: zod0.ZodNullable<zod0.ZodOptional<zod0.ZodString>>;
|
|
@@ -1460,7 +1476,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1460
1476
|
pattern: string;
|
|
1461
1477
|
path?: string | undefined;
|
|
1462
1478
|
glob?: string | null | undefined;
|
|
1463
|
-
}, string, "grep"> |
|
|
1479
|
+
}, string, "grep"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1464
1480
|
command: zod0.ZodString;
|
|
1465
1481
|
}, zod_v4_core0.$strip>, {
|
|
1466
1482
|
command: string;
|
|
@@ -1623,7 +1639,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1623
1639
|
ttl?: "1h" | "5m" | undefined;
|
|
1624
1640
|
minMessagesToCache?: number | undefined;
|
|
1625
1641
|
unsupportedModelBehavior?: "ignore" | "raise" | "warn" | undefined;
|
|
1626
|
-
}, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly [
|
|
1642
|
+
}, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly [langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1627
1643
|
description: zod0.ZodString;
|
|
1628
1644
|
subagent_type: zod0.ZodString;
|
|
1629
1645
|
}, zod_v4_core0.$strip>, {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as langchain8 from "langchain";
|
|
2
2
|
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, InferMiddlewareStates, InterruptOnConfig, ReactAgent, ResponseFormat, ResponseFormatUndefined, StructuredTool, SystemMessage, ToolMessage } from "langchain";
|
|
3
3
|
import * as _Command from "@langchain/langgraph";
|
|
4
|
-
import { AnnotationRoot, Command } from "@langchain/langgraph";
|
|
4
|
+
import { AnnotationRoot, Command, ReducedValue, StateSchema } from "@langchain/langgraph";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
import * as _messages from "@langchain/core/messages";
|
|
7
7
|
import * as zod0 from "zod";
|
|
8
8
|
import { z as z$1 } from "zod";
|
|
9
|
-
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
10
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
11
9
|
import * as zod_v30 from "zod/v3";
|
|
12
|
-
import "@langchain/
|
|
10
|
+
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
11
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
13
12
|
import * as _langchain_core_language_models_base0 from "@langchain/core/language_models/base";
|
|
14
13
|
import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_models/base";
|
|
15
|
-
import
|
|
16
|
-
import * as _langchain_core_tools5 from "@langchain/core/tools";
|
|
14
|
+
import * as _langchain_core_tools3 from "@langchain/core/tools";
|
|
17
15
|
import { ClientTool, ServerTool, StructuredTool as StructuredTool$1 } from "@langchain/core/tools";
|
|
18
|
-
import {
|
|
16
|
+
import { Runnable } from "@langchain/core/runnables";
|
|
17
|
+
import "@langchain/core/language_models/chat_models";
|
|
18
|
+
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
19
19
|
|
|
20
20
|
//#region src/backends/protocol.d.ts
|
|
21
21
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -288,6 +288,14 @@ interface StateAndStore {
|
|
|
288
288
|
type BackendFactory = (stateAndStore: StateAndStore) => BackendProtocol;
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/middleware/fs.d.ts
|
|
291
|
+
/**
|
|
292
|
+
* Type for the files state record.
|
|
293
|
+
*/
|
|
294
|
+
type FilesRecord = Record<string, FileData>;
|
|
295
|
+
/**
|
|
296
|
+
* Type for file updates, where null indicates deletion.
|
|
297
|
+
*/
|
|
298
|
+
type FilesRecordUpdate = Record<string, FileData | null>;
|
|
291
299
|
/**
|
|
292
300
|
* Options for creating filesystem middleware.
|
|
293
301
|
*/
|
|
@@ -304,19 +312,15 @@ interface FilesystemMiddlewareOptions {
|
|
|
304
312
|
/**
|
|
305
313
|
* Create filesystem middleware with all tools and features.
|
|
306
314
|
*/
|
|
307
|
-
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<
|
|
308
|
-
files:
|
|
309
|
-
|
|
310
|
-
created_at: z.ZodString;
|
|
311
|
-
modified_at: z.ZodString;
|
|
312
|
-
}, z.core.$strip>>>;
|
|
313
|
-
}, z.core.$strip>, undefined, unknown, (langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
315
|
+
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
316
|
+
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
317
|
+
}>, undefined, unknown, (langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
314
318
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
315
319
|
}, z.core.$strip>, {
|
|
316
320
|
path: string;
|
|
317
321
|
}, {
|
|
318
322
|
path?: string | undefined;
|
|
319
|
-
}, string, "ls"> |
|
|
323
|
+
}, string, "ls"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
320
324
|
file_path: z.ZodString;
|
|
321
325
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
322
326
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -328,7 +332,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
328
332
|
file_path: string;
|
|
329
333
|
offset?: unknown;
|
|
330
334
|
limit?: unknown;
|
|
331
|
-
}, string, "read_file"> |
|
|
335
|
+
}, string, "read_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
332
336
|
file_path: z.ZodString;
|
|
333
337
|
content: z.ZodString;
|
|
334
338
|
}, z.core.$strip>, {
|
|
@@ -340,7 +344,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
340
344
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
341
345
|
files: Record<string, FileData>;
|
|
342
346
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
343
|
-
}, string>, "write_file"> |
|
|
347
|
+
}, string>, "write_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
344
348
|
file_path: z.ZodString;
|
|
345
349
|
old_string: z.ZodString;
|
|
346
350
|
new_string: z.ZodString;
|
|
@@ -358,7 +362,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
358
362
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
359
363
|
files: Record<string, FileData>;
|
|
360
364
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
361
|
-
}, string>, "edit_file"> |
|
|
365
|
+
}, string>, "edit_file"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
362
366
|
pattern: z.ZodString;
|
|
363
367
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
364
368
|
}, z.core.$strip>, {
|
|
@@ -367,7 +371,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
367
371
|
}, {
|
|
368
372
|
pattern: string;
|
|
369
373
|
path?: string | undefined;
|
|
370
|
-
}, string, "glob"> |
|
|
374
|
+
}, string, "glob"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
371
375
|
pattern: z.ZodString;
|
|
372
376
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
373
377
|
glob: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -379,7 +383,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
379
383
|
pattern: string;
|
|
380
384
|
path?: string | undefined;
|
|
381
385
|
glob?: string | null | undefined;
|
|
382
|
-
}, string, "grep"> |
|
|
386
|
+
}, string, "grep"> | langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
383
387
|
command: z.ZodString;
|
|
384
388
|
}, z.core.$strip>, {
|
|
385
389
|
command: string;
|
|
@@ -445,7 +449,7 @@ interface SubAgentMiddlewareOptions {
|
|
|
445
449
|
/**
|
|
446
450
|
* Create subagent middleware with task tool
|
|
447
451
|
*/
|
|
448
|
-
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [
|
|
452
|
+
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [langchain8.DynamicStructuredTool<z.ZodObject<{
|
|
449
453
|
description: z.ZodString;
|
|
450
454
|
subagent_type: z.ZodString;
|
|
451
455
|
}, z.core.$strip>, {
|
|
@@ -477,7 +481,7 @@ declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): A
|
|
|
477
481
|
* });
|
|
478
482
|
* ```
|
|
479
483
|
*/
|
|
480
|
-
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (
|
|
484
|
+
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
481
485
|
//#endregion
|
|
482
486
|
//#region src/backends/state.d.ts
|
|
483
487
|
/**
|
|
@@ -603,7 +607,7 @@ interface MemoryMiddlewareOptions {
|
|
|
603
607
|
*/
|
|
604
608
|
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<z$1.ZodObject<{
|
|
605
609
|
memoryContents: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
606
|
-
}, z$1.core.$strip>, undefined, unknown, readonly (
|
|
610
|
+
}, z$1.core.$strip>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
607
611
|
//#endregion
|
|
608
612
|
//#region src/middleware/skills.d.ts
|
|
609
613
|
declare const MAX_SKILL_FILE_SIZE: number;
|
|
@@ -666,17 +670,25 @@ interface SkillsMiddlewareOptions {
|
|
|
666
670
|
* });
|
|
667
671
|
* ```
|
|
668
672
|
*/
|
|
669
|
-
declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): AgentMiddleware<
|
|
670
|
-
skillsMetadata:
|
|
671
|
-
name:
|
|
672
|
-
description:
|
|
673
|
-
path:
|
|
674
|
-
license
|
|
675
|
-
compatibility
|
|
676
|
-
metadata
|
|
677
|
-
allowedTools
|
|
678
|
-
},
|
|
679
|
-
|
|
673
|
+
declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
674
|
+
skillsMetadata: ReducedValue<{
|
|
675
|
+
name: string;
|
|
676
|
+
description: string;
|
|
677
|
+
path: string;
|
|
678
|
+
license?: string | null | undefined;
|
|
679
|
+
compatibility?: string | null | undefined;
|
|
680
|
+
metadata?: Record<string, string> | undefined;
|
|
681
|
+
allowedTools?: string[] | undefined;
|
|
682
|
+
}[] | undefined, {
|
|
683
|
+
name: string;
|
|
684
|
+
description: string;
|
|
685
|
+
path: string;
|
|
686
|
+
license?: string | null | undefined;
|
|
687
|
+
compatibility?: string | null | undefined;
|
|
688
|
+
metadata?: Record<string, string> | undefined;
|
|
689
|
+
allowedTools?: string[] | undefined;
|
|
690
|
+
}[] | undefined>;
|
|
691
|
+
}>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
680
692
|
//#endregion
|
|
681
693
|
//#region src/backends/store.d.ts
|
|
682
694
|
/**
|
|
@@ -1131,8 +1143,7 @@ interface DefaultDeepAgentTypeConfig extends DeepAgentTypeConfig {
|
|
|
1131
1143
|
* ```
|
|
1132
1144
|
*/
|
|
1133
1145
|
type DeepAgent<TTypes extends DeepAgentTypeConfig = DeepAgentTypeConfig> = ReactAgent<TTypes> & {
|
|
1134
|
-
/** Type brand for DeepAgent type inference */
|
|
1135
|
-
readonly "~deepAgentTypes": TTypes;
|
|
1146
|
+
/** Type brand for DeepAgent type inference */readonly "~deepAgentTypes": TTypes;
|
|
1136
1147
|
};
|
|
1137
1148
|
/**
|
|
1138
1149
|
* Helper type to resolve a DeepAgentTypeConfig from either:
|
|
@@ -1339,7 +1350,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1339
1350
|
content: string;
|
|
1340
1351
|
status: "completed" | "in_progress" | "pending";
|
|
1341
1352
|
}[] | undefined;
|
|
1342
|
-
}>, undefined, unknown, readonly [
|
|
1353
|
+
}>, undefined, unknown, readonly [langchain8.DynamicStructuredTool<zod_v30.ZodObject<{
|
|
1343
1354
|
todos: zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
1344
1355
|
content: zod_v30.ZodString;
|
|
1345
1356
|
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -1376,29 +1387,33 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1376
1387
|
status: "completed" | "in_progress" | "pending";
|
|
1377
1388
|
}[];
|
|
1378
1389
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1379
|
-
}, string>, "write_todos">]>, ...(AgentMiddleware<
|
|
1380
|
-
skillsMetadata:
|
|
1381
|
-
name:
|
|
1382
|
-
description:
|
|
1383
|
-
path:
|
|
1384
|
-
license
|
|
1385
|
-
compatibility
|
|
1386
|
-
metadata
|
|
1387
|
-
allowedTools
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1390
|
+
}, string>, "write_todos">]>, ...(AgentMiddleware<_Command.StateSchema<{
|
|
1391
|
+
skillsMetadata: _Command.ReducedValue<{
|
|
1392
|
+
name: string;
|
|
1393
|
+
description: string;
|
|
1394
|
+
path: string;
|
|
1395
|
+
license?: string | null | undefined;
|
|
1396
|
+
compatibility?: string | null | undefined;
|
|
1397
|
+
metadata?: Record<string, string> | undefined;
|
|
1398
|
+
allowedTools?: string[] | undefined;
|
|
1399
|
+
}[] | undefined, {
|
|
1400
|
+
name: string;
|
|
1401
|
+
description: string;
|
|
1402
|
+
path: string;
|
|
1403
|
+
license?: string | null | undefined;
|
|
1404
|
+
compatibility?: string | null | undefined;
|
|
1405
|
+
metadata?: Record<string, string> | undefined;
|
|
1406
|
+
allowedTools?: string[] | undefined;
|
|
1407
|
+
}[] | undefined>;
|
|
1408
|
+
}>, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<_Command.StateSchema<{
|
|
1409
|
+
files: _Command.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1410
|
+
}>, undefined, unknown, (langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1396
1411
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1397
1412
|
}, zod_v4_core0.$strip>, {
|
|
1398
1413
|
path: string;
|
|
1399
1414
|
}, {
|
|
1400
1415
|
path?: string | undefined;
|
|
1401
|
-
}, string, "ls"> |
|
|
1416
|
+
}, string, "ls"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1402
1417
|
file_path: zod0.ZodString;
|
|
1403
1418
|
offset: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
1404
1419
|
limit: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
@@ -1410,7 +1425,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1410
1425
|
file_path: string;
|
|
1411
1426
|
offset?: unknown;
|
|
1412
1427
|
limit?: unknown;
|
|
1413
|
-
}, string, "read_file"> |
|
|
1428
|
+
}, string, "read_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1414
1429
|
file_path: zod0.ZodString;
|
|
1415
1430
|
content: zod0.ZodString;
|
|
1416
1431
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1422,7 +1437,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1422
1437
|
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _Command.Command<unknown, {
|
|
1423
1438
|
files: Record<string, FileData>;
|
|
1424
1439
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1425
|
-
}, string>, "write_file"> |
|
|
1440
|
+
}, string>, "write_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1426
1441
|
file_path: zod0.ZodString;
|
|
1427
1442
|
old_string: zod0.ZodString;
|
|
1428
1443
|
new_string: zod0.ZodString;
|
|
@@ -1440,7 +1455,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1440
1455
|
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _Command.Command<unknown, {
|
|
1441
1456
|
files: Record<string, FileData>;
|
|
1442
1457
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1443
|
-
}, string>, "edit_file"> |
|
|
1458
|
+
}, string>, "edit_file"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1444
1459
|
pattern: zod0.ZodString;
|
|
1445
1460
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1446
1461
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1449,7 +1464,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1449
1464
|
}, {
|
|
1450
1465
|
pattern: string;
|
|
1451
1466
|
path?: string | undefined;
|
|
1452
|
-
}, string, "glob"> |
|
|
1467
|
+
}, string, "glob"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1453
1468
|
pattern: zod0.ZodString;
|
|
1454
1469
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1455
1470
|
glob: zod0.ZodNullable<zod0.ZodOptional<zod0.ZodString>>;
|
|
@@ -1461,7 +1476,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1461
1476
|
pattern: string;
|
|
1462
1477
|
path?: string | undefined;
|
|
1463
1478
|
glob?: string | null | undefined;
|
|
1464
|
-
}, string, "grep"> |
|
|
1479
|
+
}, string, "grep"> | langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1465
1480
|
command: zod0.ZodString;
|
|
1466
1481
|
}, zod_v4_core0.$strip>, {
|
|
1467
1482
|
command: string;
|
|
@@ -1624,7 +1639,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1624
1639
|
ttl?: "1h" | "5m" | undefined;
|
|
1625
1640
|
minMessagesToCache?: number | undefined;
|
|
1626
1641
|
unsupportedModelBehavior?: "ignore" | "raise" | "warn" | undefined;
|
|
1627
|
-
}, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly [
|
|
1642
|
+
}, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<undefined, undefined, unknown, readonly [langchain8.DynamicStructuredTool<zod0.ZodObject<{
|
|
1628
1643
|
description: zod0.ZodString;
|
|
1629
1644
|
subagent_type: zod0.ZodString;
|
|
1630
1645
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1763,7 +1778,7 @@ interface AgentMemoryMiddlewareOptions {
|
|
|
1763
1778
|
* @deprecated Use `createMemoryMiddleware` from `./memory.js` instead.
|
|
1764
1779
|
* This function uses direct filesystem access which limits portability.
|
|
1765
1780
|
*/
|
|
1766
|
-
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (
|
|
1781
|
+
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
1767
1782
|
//#endregion
|
|
1768
1783
|
//#region src/skills/loader.d.ts
|
|
1769
1784
|
/**
|