deepagents 1.6.1 → 1.6.3
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 +199 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -62
- package/dist/index.d.ts +75 -58
- package/dist/index.js +199 -66
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as zod_v30 from "zod/v3";
|
|
2
|
-
import * as
|
|
2
|
+
import * as langchain9 from "langchain";
|
|
3
3
|
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, InferMiddlewareStates, InterruptOnConfig, ReactAgent, ResponseFormat, ResponseFormatUndefined, StructuredTool, SystemMessage, ToolMessage } from "langchain";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _langchain_langgraph0 from "@langchain/langgraph";
|
|
5
5
|
import { AnnotationRoot, Command, ReducedValue, StateSchema } from "@langchain/langgraph";
|
|
6
6
|
import { z } from "zod/v4";
|
|
7
7
|
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
@@ -11,7 +11,7 @@ import { z as z$1 } from "zod";
|
|
|
11
11
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
12
12
|
import * as _langchain_core_language_models_base0 from "@langchain/core/language_models/base";
|
|
13
13
|
import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_models/base";
|
|
14
|
-
import * as
|
|
14
|
+
import * as _langchain_core_tools5 from "@langchain/core/tools";
|
|
15
15
|
import { ClientTool, ServerTool, StructuredTool as StructuredTool$1 } from "@langchain/core/tools";
|
|
16
16
|
import { Runnable } from "@langchain/core/runnables";
|
|
17
17
|
import "@langchain/core/language_models/chat_models";
|
|
@@ -314,13 +314,13 @@ interface FilesystemMiddlewareOptions {
|
|
|
314
314
|
*/
|
|
315
315
|
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
316
316
|
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
317
|
-
}>, undefined, unknown, (
|
|
317
|
+
}>, undefined, unknown, (langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
318
318
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
319
319
|
}, z.core.$strip>, {
|
|
320
320
|
path: string;
|
|
321
321
|
}, {
|
|
322
322
|
path?: string | undefined;
|
|
323
|
-
}, string, "ls"> |
|
|
323
|
+
}, string, "ls"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
324
324
|
file_path: z.ZodString;
|
|
325
325
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
326
326
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -332,7 +332,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
332
332
|
file_path: string;
|
|
333
333
|
offset?: unknown;
|
|
334
334
|
limit?: unknown;
|
|
335
|
-
}, string, "read_file"> |
|
|
335
|
+
}, string, "read_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
336
336
|
file_path: z.ZodString;
|
|
337
337
|
content: z.ZodString;
|
|
338
338
|
}, z.core.$strip>, {
|
|
@@ -344,7 +344,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
344
344
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
345
345
|
files: Record<string, FileData>;
|
|
346
346
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
347
|
-
}, string>, "write_file"> |
|
|
347
|
+
}, string>, "write_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
348
348
|
file_path: z.ZodString;
|
|
349
349
|
old_string: z.ZodString;
|
|
350
350
|
new_string: z.ZodString;
|
|
@@ -362,7 +362,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
362
362
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
363
363
|
files: Record<string, FileData>;
|
|
364
364
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
365
|
-
}, string>, "edit_file"> |
|
|
365
|
+
}, string>, "edit_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
366
366
|
pattern: z.ZodString;
|
|
367
367
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
368
368
|
}, z.core.$strip>, {
|
|
@@ -371,7 +371,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
371
371
|
}, {
|
|
372
372
|
pattern: string;
|
|
373
373
|
path?: string | undefined;
|
|
374
|
-
}, string, "glob"> |
|
|
374
|
+
}, string, "glob"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
375
375
|
pattern: z.ZodString;
|
|
376
376
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
377
377
|
glob: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -383,7 +383,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
383
383
|
pattern: string;
|
|
384
384
|
path?: string | undefined;
|
|
385
385
|
glob?: string | null | undefined;
|
|
386
|
-
}, string, "grep"> |
|
|
386
|
+
}, string, "grep"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
387
387
|
command: z.ZodString;
|
|
388
388
|
}, z.core.$strip>, {
|
|
389
389
|
command: string;
|
|
@@ -449,7 +449,7 @@ interface SubAgentMiddlewareOptions {
|
|
|
449
449
|
/**
|
|
450
450
|
* Create subagent middleware with task tool
|
|
451
451
|
*/
|
|
452
|
-
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [
|
|
452
|
+
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
453
453
|
description: z.ZodString;
|
|
454
454
|
subagent_type: z.ZodString;
|
|
455
455
|
}, z.core.$strip>, {
|
|
@@ -468,6 +468,12 @@ declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): A
|
|
|
468
468
|
* the corresponding ToolMessage responses, this middleware adds synthetic
|
|
469
469
|
* ToolMessages saying the tool call was cancelled.
|
|
470
470
|
*
|
|
471
|
+
* This middleware patches in two places:
|
|
472
|
+
* 1. `beforeAgent`: Patches state at the start of the agent loop (handles most cases)
|
|
473
|
+
* 2. `wrapModelCall`: Patches the request right before model invocation (handles
|
|
474
|
+
* edge cases like HITL rejection during graph resume where state updates from
|
|
475
|
+
* beforeAgent may not be applied in time)
|
|
476
|
+
*
|
|
471
477
|
* @returns AgentMiddleware that patches dangling tool calls
|
|
472
478
|
*
|
|
473
479
|
* @example
|
|
@@ -481,7 +487,7 @@ declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): A
|
|
|
481
487
|
* });
|
|
482
488
|
* ```
|
|
483
489
|
*/
|
|
484
|
-
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (
|
|
490
|
+
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
|
|
485
491
|
//#endregion
|
|
486
492
|
//#region src/backends/state.d.ts
|
|
487
493
|
/**
|
|
@@ -605,9 +611,14 @@ interface MemoryMiddlewareOptions {
|
|
|
605
611
|
* });
|
|
606
612
|
* ```
|
|
607
613
|
*/
|
|
608
|
-
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<
|
|
614
|
+
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
615
|
+
/**
|
|
616
|
+
* Dict mapping source paths to their loaded content.
|
|
617
|
+
* Marked as private so it's not included in the final agent state.
|
|
618
|
+
*/
|
|
609
619
|
memoryContents: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
610
|
-
|
|
620
|
+
files: _langchain_langgraph0.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
621
|
+
}>, undefined, unknown, readonly (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
|
|
611
622
|
//#endregion
|
|
612
623
|
//#region src/middleware/skills.d.ts
|
|
613
624
|
declare const MAX_SKILL_FILE_SIZE: number;
|
|
@@ -688,7 +699,8 @@ declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): Agent
|
|
|
688
699
|
metadata?: Record<string, string> | undefined;
|
|
689
700
|
allowedTools?: string[] | undefined;
|
|
690
701
|
}[] | undefined>;
|
|
691
|
-
|
|
702
|
+
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
703
|
+
}>, undefined, unknown, readonly (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
|
|
692
704
|
//#endregion
|
|
693
705
|
//#region src/backends/store.d.ts
|
|
694
706
|
/**
|
|
@@ -1350,7 +1362,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1350
1362
|
content: string;
|
|
1351
1363
|
status: "completed" | "in_progress" | "pending";
|
|
1352
1364
|
}[] | undefined;
|
|
1353
|
-
}>, undefined, unknown, readonly [
|
|
1365
|
+
}>, undefined, unknown, readonly [langchain9.DynamicStructuredTool<zod_v30.ZodObject<{
|
|
1354
1366
|
todos: zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
1355
1367
|
content: zod_v30.ZodString;
|
|
1356
1368
|
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -1381,39 +1393,21 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1381
1393
|
content: string;
|
|
1382
1394
|
status: "completed" | "in_progress" | "pending";
|
|
1383
1395
|
}[];
|
|
1384
|
-
},
|
|
1396
|
+
}, _langchain_langgraph0.Command<unknown, {
|
|
1385
1397
|
todos: {
|
|
1386
1398
|
content: string;
|
|
1387
1399
|
status: "completed" | "in_progress" | "pending";
|
|
1388
1400
|
}[];
|
|
1389
1401
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1390
|
-
}, string>, "write_todos">]>,
|
|
1391
|
-
|
|
1392
|
-
|
|
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<{
|
|
1402
|
+
}, string>, "write_todos">]>, AgentMiddleware<_langchain_langgraph0.StateSchema<{
|
|
1403
|
+
files: _langchain_langgraph0.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1404
|
+
}>, undefined, unknown, (langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1411
1405
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1412
1406
|
}, zod_v4_core0.$strip>, {
|
|
1413
1407
|
path: string;
|
|
1414
1408
|
}, {
|
|
1415
1409
|
path?: string | undefined;
|
|
1416
|
-
}, string, "ls"> |
|
|
1410
|
+
}, string, "ls"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1417
1411
|
file_path: zod0.ZodString;
|
|
1418
1412
|
offset: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
1419
1413
|
limit: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
@@ -1425,7 +1419,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1425
1419
|
file_path: string;
|
|
1426
1420
|
offset?: unknown;
|
|
1427
1421
|
limit?: unknown;
|
|
1428
|
-
}, string, "read_file"> |
|
|
1422
|
+
}, string, "read_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1429
1423
|
file_path: zod0.ZodString;
|
|
1430
1424
|
content: zod0.ZodString;
|
|
1431
1425
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1434,10 +1428,10 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1434
1428
|
}, {
|
|
1435
1429
|
file_path: string;
|
|
1436
1430
|
content: string;
|
|
1437
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
1431
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langchain_langgraph0.Command<unknown, {
|
|
1438
1432
|
files: Record<string, FileData>;
|
|
1439
1433
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1440
|
-
}, string>, "write_file"> |
|
|
1434
|
+
}, string>, "write_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1441
1435
|
file_path: zod0.ZodString;
|
|
1442
1436
|
old_string: zod0.ZodString;
|
|
1443
1437
|
new_string: zod0.ZodString;
|
|
@@ -1452,10 +1446,10 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1452
1446
|
old_string: string;
|
|
1453
1447
|
new_string: string;
|
|
1454
1448
|
replace_all?: boolean | undefined;
|
|
1455
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
1449
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langchain_langgraph0.Command<unknown, {
|
|
1456
1450
|
files: Record<string, FileData>;
|
|
1457
1451
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1458
|
-
}, string>, "edit_file"> |
|
|
1452
|
+
}, string>, "edit_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1459
1453
|
pattern: zod0.ZodString;
|
|
1460
1454
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1461
1455
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1464,7 +1458,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1464
1458
|
}, {
|
|
1465
1459
|
pattern: string;
|
|
1466
1460
|
path?: string | undefined;
|
|
1467
|
-
}, string, "glob"> |
|
|
1461
|
+
}, string, "glob"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1468
1462
|
pattern: zod0.ZodString;
|
|
1469
1463
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1470
1464
|
glob: zod0.ZodNullable<zod0.ZodOptional<zod0.ZodString>>;
|
|
@@ -1476,13 +1470,22 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1476
1470
|
pattern: string;
|
|
1477
1471
|
path?: string | undefined;
|
|
1478
1472
|
glob?: string | null | undefined;
|
|
1479
|
-
}, string, "grep"> |
|
|
1473
|
+
}, string, "grep"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1480
1474
|
command: zod0.ZodString;
|
|
1481
1475
|
}, zod_v4_core0.$strip>, {
|
|
1482
1476
|
command: string;
|
|
1483
1477
|
}, {
|
|
1484
1478
|
command: string;
|
|
1485
|
-
}, string, "execute">)[]
|
|
1479
|
+
}, string, "execute">)[]>, AgentMiddleware<undefined, undefined, unknown, readonly [langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1480
|
+
description: zod0.ZodString;
|
|
1481
|
+
subagent_type: zod0.ZodString;
|
|
1482
|
+
}, zod_v4_core0.$strip>, {
|
|
1483
|
+
description: string;
|
|
1484
|
+
subagent_type: string;
|
|
1485
|
+
}, {
|
|
1486
|
+
description: string;
|
|
1487
|
+
subagent_type: string;
|
|
1488
|
+
}, string | _langchain_langgraph0.Command<unknown, Record<string, unknown>, string>, "task">]>, AgentMiddleware<undefined, zod_v30.ZodObject<{
|
|
1486
1489
|
trigger: zod_v30.ZodOptional<zod_v30.ZodUnion<[zod_v30.ZodEffects<zod_v30.ZodObject<{
|
|
1487
1490
|
fraction: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
1488
1491
|
tokens: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
@@ -1619,7 +1622,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1619
1622
|
maxTokensBeforeSummary?: number | undefined;
|
|
1620
1623
|
messagesToKeep?: number | undefined;
|
|
1621
1624
|
model?: _langchain_core_language_models_base0.BaseLanguageModel<any, _langchain_core_language_models_base0.BaseLanguageModelCallOptions> | undefined;
|
|
1622
|
-
}, readonly (ClientTool | ServerTool)[]
|
|
1625
|
+
}, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, zod_v30.ZodObject<{
|
|
1623
1626
|
enableCaching: zod_v30.ZodOptional<zod_v30.ZodBoolean>;
|
|
1624
1627
|
ttl: zod_v30.ZodOptional<zod_v30.ZodEnum<["5m", "1h"]>>;
|
|
1625
1628
|
minMessagesToCache: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
@@ -1639,18 +1642,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1639
1642
|
ttl?: "1h" | "5m" | undefined;
|
|
1640
1643
|
minMessagesToCache?: number | undefined;
|
|
1641
1644
|
unsupportedModelBehavior?: "ignore" | "raise" | "warn" | undefined;
|
|
1642
|
-
}, readonly (ClientTool | ServerTool)[]
|
|
1643
|
-
description: zod0.ZodString;
|
|
1644
|
-
subagent_type: zod0.ZodString;
|
|
1645
|
-
}, zod_v4_core0.$strip>, {
|
|
1646
|
-
description: string;
|
|
1647
|
-
subagent_type: string;
|
|
1648
|
-
}, {
|
|
1649
|
-
description: string;
|
|
1650
|
-
subagent_type: string;
|
|
1651
|
-
}, string | _Command.Command<unknown, Record<string, unknown>, string>, "task">]> | AgentMiddleware<zod0.ZodObject<{
|
|
1652
|
-
memoryContents: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
|
|
1653
|
-
}, zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>)[], ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
1645
|
+
}, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
1654
1646
|
//#endregion
|
|
1655
1647
|
//#region src/config.d.ts
|
|
1656
1648
|
/**
|
|
@@ -1753,6 +1745,31 @@ declare function findProjectRoot(startPath?: string): string | null;
|
|
|
1753
1745
|
*/
|
|
1754
1746
|
declare function createSettings(options?: SettingsOptions): Settings;
|
|
1755
1747
|
//#endregion
|
|
1748
|
+
//#region src/values.d.ts
|
|
1749
|
+
/**
|
|
1750
|
+
* Shared ReducedValue for file data state management.
|
|
1751
|
+
*
|
|
1752
|
+
* This provides a reusable pattern for managing file state with automatic
|
|
1753
|
+
* merging of concurrent updates from parallel subagents. Files can be updated
|
|
1754
|
+
* or deleted (using null values) and the reducer handles the merge logic.
|
|
1755
|
+
*
|
|
1756
|
+
* Similar to LangGraph's messagesValue, this encapsulates the common pattern
|
|
1757
|
+
* of managing files in agent state so you don't have to manually configure
|
|
1758
|
+
* the ReducedValue each time.
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```typescript
|
|
1762
|
+
* import { filesValue } from "@anthropic/deepagents";
|
|
1763
|
+
* import { StateSchema } from "@langchain/langgraph";
|
|
1764
|
+
*
|
|
1765
|
+
* const MyStateSchema = new StateSchema({
|
|
1766
|
+
* files: filesValue,
|
|
1767
|
+
* // ... other state fields
|
|
1768
|
+
* });
|
|
1769
|
+
* ```
|
|
1770
|
+
*/
|
|
1771
|
+
declare const filesValue: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1772
|
+
//#endregion
|
|
1756
1773
|
//#region src/middleware/agent-memory.d.ts
|
|
1757
1774
|
/**
|
|
1758
1775
|
* Options for the agent memory middleware.
|
|
@@ -1778,7 +1795,7 @@ interface AgentMemoryMiddlewareOptions {
|
|
|
1778
1795
|
* @deprecated Use `createMemoryMiddleware` from `./memory.js` instead.
|
|
1779
1796
|
* This function uses direct filesystem access which limits portability.
|
|
1780
1797
|
*/
|
|
1781
|
-
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (
|
|
1798
|
+
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
|
|
1782
1799
|
//#endregion
|
|
1783
1800
|
//#region src/skills/loader.d.ts
|
|
1784
1801
|
/**
|
|
@@ -1832,5 +1849,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
1832
1849
|
*/
|
|
1833
1850
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
1834
1851
|
//#endregion
|
|
1835
|
-
export { type AgentMemoryMiddlewareOptions, type BackendFactory, type BackendProtocol, BaseSandbox, type CompiledSubAgent, CompositeBackend, type CreateDeepAgentParams, type DeepAgent, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FlattenSubAgentMiddleware, type GrepMatch, type InferDeepAgentSubagents, type InferDeepAgentType, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, StateBackend, StoreBackend, type SubAgent, type SubAgentMiddlewareOptions, type WriteResult, createAgentMemoryMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, findProjectRoot, isSandboxBackend, listSkills, parseSkillMetadata };
|
|
1852
|
+
export { type AgentMemoryMiddlewareOptions, type BackendFactory, type BackendProtocol, BaseSandbox, type CompiledSubAgent, CompositeBackend, type CreateDeepAgentParams, type DeepAgent, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FlattenSubAgentMiddleware, type GrepMatch, type InferDeepAgentSubagents, type InferDeepAgentType, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, StateBackend, StoreBackend, type SubAgent, type SubAgentMiddlewareOptions, type WriteResult, createAgentMemoryMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, filesValue, findProjectRoot, isSandboxBackend, listSkills, parseSkillMetadata };
|
|
1836
1853
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as langchain9 from "langchain";
|
|
2
2
|
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, InferMiddlewareStates, InterruptOnConfig, ReactAgent, ResponseFormat, ResponseFormatUndefined, StructuredTool, SystemMessage, ToolMessage } from "langchain";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _langchain_langgraph0 from "@langchain/langgraph";
|
|
4
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";
|
|
@@ -314,13 +314,13 @@ interface FilesystemMiddlewareOptions {
|
|
|
314
314
|
*/
|
|
315
315
|
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
316
316
|
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
317
|
-
}>, undefined, unknown, (
|
|
317
|
+
}>, undefined, unknown, (langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
318
318
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
319
319
|
}, z.core.$strip>, {
|
|
320
320
|
path: string;
|
|
321
321
|
}, {
|
|
322
322
|
path?: string | undefined;
|
|
323
|
-
}, string, "ls"> |
|
|
323
|
+
}, string, "ls"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
324
324
|
file_path: z.ZodString;
|
|
325
325
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
326
326
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -332,7 +332,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
332
332
|
file_path: string;
|
|
333
333
|
offset?: unknown;
|
|
334
334
|
limit?: unknown;
|
|
335
|
-
}, string, "read_file"> |
|
|
335
|
+
}, string, "read_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
336
336
|
file_path: z.ZodString;
|
|
337
337
|
content: z.ZodString;
|
|
338
338
|
}, z.core.$strip>, {
|
|
@@ -344,7 +344,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
344
344
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
345
345
|
files: Record<string, FileData>;
|
|
346
346
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
347
|
-
}, string>, "write_file"> |
|
|
347
|
+
}, string>, "write_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
348
348
|
file_path: z.ZodString;
|
|
349
349
|
old_string: z.ZodString;
|
|
350
350
|
new_string: z.ZodString;
|
|
@@ -362,7 +362,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
362
362
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
363
363
|
files: Record<string, FileData>;
|
|
364
364
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
365
|
-
}, string>, "edit_file"> |
|
|
365
|
+
}, string>, "edit_file"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
366
366
|
pattern: z.ZodString;
|
|
367
367
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
368
368
|
}, z.core.$strip>, {
|
|
@@ -371,7 +371,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
371
371
|
}, {
|
|
372
372
|
pattern: string;
|
|
373
373
|
path?: string | undefined;
|
|
374
|
-
}, string, "glob"> |
|
|
374
|
+
}, string, "glob"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
375
375
|
pattern: z.ZodString;
|
|
376
376
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
377
377
|
glob: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -383,7 +383,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
383
383
|
pattern: string;
|
|
384
384
|
path?: string | undefined;
|
|
385
385
|
glob?: string | null | undefined;
|
|
386
|
-
}, string, "grep"> |
|
|
386
|
+
}, string, "grep"> | langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
387
387
|
command: z.ZodString;
|
|
388
388
|
}, z.core.$strip>, {
|
|
389
389
|
command: string;
|
|
@@ -449,7 +449,7 @@ interface SubAgentMiddlewareOptions {
|
|
|
449
449
|
/**
|
|
450
450
|
* Create subagent middleware with task tool
|
|
451
451
|
*/
|
|
452
|
-
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [
|
|
452
|
+
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [langchain9.DynamicStructuredTool<z.ZodObject<{
|
|
453
453
|
description: z.ZodString;
|
|
454
454
|
subagent_type: z.ZodString;
|
|
455
455
|
}, z.core.$strip>, {
|
|
@@ -468,6 +468,12 @@ declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): A
|
|
|
468
468
|
* the corresponding ToolMessage responses, this middleware adds synthetic
|
|
469
469
|
* ToolMessages saying the tool call was cancelled.
|
|
470
470
|
*
|
|
471
|
+
* This middleware patches in two places:
|
|
472
|
+
* 1. `beforeAgent`: Patches state at the start of the agent loop (handles most cases)
|
|
473
|
+
* 2. `wrapModelCall`: Patches the request right before model invocation (handles
|
|
474
|
+
* edge cases like HITL rejection during graph resume where state updates from
|
|
475
|
+
* beforeAgent may not be applied in time)
|
|
476
|
+
*
|
|
471
477
|
* @returns AgentMiddleware that patches dangling tool calls
|
|
472
478
|
*
|
|
473
479
|
* @example
|
|
@@ -605,9 +611,14 @@ interface MemoryMiddlewareOptions {
|
|
|
605
611
|
* });
|
|
606
612
|
* ```
|
|
607
613
|
*/
|
|
608
|
-
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<
|
|
614
|
+
declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
615
|
+
/**
|
|
616
|
+
* Dict mapping source paths to their loaded content.
|
|
617
|
+
* Marked as private so it's not included in the final agent state.
|
|
618
|
+
*/
|
|
609
619
|
memoryContents: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
610
|
-
|
|
620
|
+
files: _langchain_langgraph0.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
621
|
+
}>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
611
622
|
//#endregion
|
|
612
623
|
//#region src/middleware/skills.d.ts
|
|
613
624
|
declare const MAX_SKILL_FILE_SIZE: number;
|
|
@@ -688,6 +699,7 @@ declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): Agent
|
|
|
688
699
|
metadata?: Record<string, string> | undefined;
|
|
689
700
|
allowedTools?: string[] | undefined;
|
|
690
701
|
}[] | undefined>;
|
|
702
|
+
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
691
703
|
}>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
|
|
692
704
|
//#endregion
|
|
693
705
|
//#region src/backends/store.d.ts
|
|
@@ -1350,7 +1362,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1350
1362
|
content: string;
|
|
1351
1363
|
status: "completed" | "in_progress" | "pending";
|
|
1352
1364
|
}[] | undefined;
|
|
1353
|
-
}>, undefined, unknown, readonly [
|
|
1365
|
+
}>, undefined, unknown, readonly [langchain9.DynamicStructuredTool<zod_v30.ZodObject<{
|
|
1354
1366
|
todos: zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
1355
1367
|
content: zod_v30.ZodString;
|
|
1356
1368
|
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -1381,39 +1393,21 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1381
1393
|
content: string;
|
|
1382
1394
|
status: "completed" | "in_progress" | "pending";
|
|
1383
1395
|
}[];
|
|
1384
|
-
},
|
|
1396
|
+
}, _langchain_langgraph0.Command<unknown, {
|
|
1385
1397
|
todos: {
|
|
1386
1398
|
content: string;
|
|
1387
1399
|
status: "completed" | "in_progress" | "pending";
|
|
1388
1400
|
}[];
|
|
1389
1401
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1390
|
-
}, string>, "write_todos">]>,
|
|
1391
|
-
|
|
1392
|
-
|
|
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<{
|
|
1402
|
+
}, string>, "write_todos">]>, AgentMiddleware<_langchain_langgraph0.StateSchema<{
|
|
1403
|
+
files: _langchain_langgraph0.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1404
|
+
}>, undefined, unknown, (langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1411
1405
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1412
1406
|
}, zod_v4_core0.$strip>, {
|
|
1413
1407
|
path: string;
|
|
1414
1408
|
}, {
|
|
1415
1409
|
path?: string | undefined;
|
|
1416
|
-
}, string, "ls"> |
|
|
1410
|
+
}, string, "ls"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1417
1411
|
file_path: zod0.ZodString;
|
|
1418
1412
|
offset: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
1419
1413
|
limit: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodCoercedNumber<unknown>>>;
|
|
@@ -1425,7 +1419,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1425
1419
|
file_path: string;
|
|
1426
1420
|
offset?: unknown;
|
|
1427
1421
|
limit?: unknown;
|
|
1428
|
-
}, string, "read_file"> |
|
|
1422
|
+
}, string, "read_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1429
1423
|
file_path: zod0.ZodString;
|
|
1430
1424
|
content: zod0.ZodString;
|
|
1431
1425
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1434,10 +1428,10 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1434
1428
|
}, {
|
|
1435
1429
|
file_path: string;
|
|
1436
1430
|
content: string;
|
|
1437
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
1431
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langchain_langgraph0.Command<unknown, {
|
|
1438
1432
|
files: Record<string, FileData>;
|
|
1439
1433
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1440
|
-
}, string>, "write_file"> |
|
|
1434
|
+
}, string>, "write_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1441
1435
|
file_path: zod0.ZodString;
|
|
1442
1436
|
old_string: zod0.ZodString;
|
|
1443
1437
|
new_string: zod0.ZodString;
|
|
@@ -1452,10 +1446,10 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1452
1446
|
old_string: string;
|
|
1453
1447
|
new_string: string;
|
|
1454
1448
|
replace_all?: boolean | undefined;
|
|
1455
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
1449
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langchain_langgraph0.Command<unknown, {
|
|
1456
1450
|
files: Record<string, FileData>;
|
|
1457
1451
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1458
|
-
}, string>, "edit_file"> |
|
|
1452
|
+
}, string>, "edit_file"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1459
1453
|
pattern: zod0.ZodString;
|
|
1460
1454
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1461
1455
|
}, zod_v4_core0.$strip>, {
|
|
@@ -1464,7 +1458,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1464
1458
|
}, {
|
|
1465
1459
|
pattern: string;
|
|
1466
1460
|
path?: string | undefined;
|
|
1467
|
-
}, string, "glob"> |
|
|
1461
|
+
}, string, "glob"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1468
1462
|
pattern: zod0.ZodString;
|
|
1469
1463
|
path: zod0.ZodDefault<zod0.ZodOptional<zod0.ZodString>>;
|
|
1470
1464
|
glob: zod0.ZodNullable<zod0.ZodOptional<zod0.ZodString>>;
|
|
@@ -1476,13 +1470,22 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1476
1470
|
pattern: string;
|
|
1477
1471
|
path?: string | undefined;
|
|
1478
1472
|
glob?: string | null | undefined;
|
|
1479
|
-
}, string, "grep"> |
|
|
1473
|
+
}, string, "grep"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1480
1474
|
command: zod0.ZodString;
|
|
1481
1475
|
}, zod_v4_core0.$strip>, {
|
|
1482
1476
|
command: string;
|
|
1483
1477
|
}, {
|
|
1484
1478
|
command: string;
|
|
1485
|
-
}, string, "execute">)[]
|
|
1479
|
+
}, string, "execute">)[]>, AgentMiddleware<undefined, undefined, unknown, readonly [langchain9.DynamicStructuredTool<zod0.ZodObject<{
|
|
1480
|
+
description: zod0.ZodString;
|
|
1481
|
+
subagent_type: zod0.ZodString;
|
|
1482
|
+
}, zod_v4_core0.$strip>, {
|
|
1483
|
+
description: string;
|
|
1484
|
+
subagent_type: string;
|
|
1485
|
+
}, {
|
|
1486
|
+
description: string;
|
|
1487
|
+
subagent_type: string;
|
|
1488
|
+
}, string | _langchain_langgraph0.Command<unknown, Record<string, unknown>, string>, "task">]>, AgentMiddleware<undefined, zod_v30.ZodObject<{
|
|
1486
1489
|
trigger: zod_v30.ZodOptional<zod_v30.ZodUnion<[zod_v30.ZodEffects<zod_v30.ZodObject<{
|
|
1487
1490
|
fraction: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
1488
1491
|
tokens: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
@@ -1619,7 +1622,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1619
1622
|
maxTokensBeforeSummary?: number | undefined;
|
|
1620
1623
|
messagesToKeep?: number | undefined;
|
|
1621
1624
|
model?: _langchain_core_language_models_base0.BaseLanguageModel<any, _langchain_core_language_models_base0.BaseLanguageModelCallOptions> | undefined;
|
|
1622
|
-
}, readonly (ClientTool | ServerTool)[]
|
|
1625
|
+
}, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, zod_v30.ZodObject<{
|
|
1623
1626
|
enableCaching: zod_v30.ZodOptional<zod_v30.ZodBoolean>;
|
|
1624
1627
|
ttl: zod_v30.ZodOptional<zod_v30.ZodEnum<["5m", "1h"]>>;
|
|
1625
1628
|
minMessagesToCache: zod_v30.ZodOptional<zod_v30.ZodNumber>;
|
|
@@ -1639,18 +1642,7 @@ declare function createDeepAgent<TResponse extends ResponseFormat = ResponseForm
|
|
|
1639
1642
|
ttl?: "1h" | "5m" | undefined;
|
|
1640
1643
|
minMessagesToCache?: number | undefined;
|
|
1641
1644
|
unsupportedModelBehavior?: "ignore" | "raise" | "warn" | undefined;
|
|
1642
|
-
}, readonly (ClientTool | ServerTool)[]
|
|
1643
|
-
description: zod0.ZodString;
|
|
1644
|
-
subagent_type: zod0.ZodString;
|
|
1645
|
-
}, zod_v4_core0.$strip>, {
|
|
1646
|
-
description: string;
|
|
1647
|
-
subagent_type: string;
|
|
1648
|
-
}, {
|
|
1649
|
-
description: string;
|
|
1650
|
-
subagent_type: string;
|
|
1651
|
-
}, string | _Command.Command<unknown, Record<string, unknown>, string>, "task">]> | AgentMiddleware<zod0.ZodObject<{
|
|
1652
|
-
memoryContents: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
|
|
1653
|
-
}, zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>)[], ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
1645
|
+
}, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
1654
1646
|
//#endregion
|
|
1655
1647
|
//#region src/config.d.ts
|
|
1656
1648
|
/**
|
|
@@ -1753,6 +1745,31 @@ declare function findProjectRoot(startPath?: string): string | null;
|
|
|
1753
1745
|
*/
|
|
1754
1746
|
declare function createSettings(options?: SettingsOptions): Settings;
|
|
1755
1747
|
//#endregion
|
|
1748
|
+
//#region src/values.d.ts
|
|
1749
|
+
/**
|
|
1750
|
+
* Shared ReducedValue for file data state management.
|
|
1751
|
+
*
|
|
1752
|
+
* This provides a reusable pattern for managing file state with automatic
|
|
1753
|
+
* merging of concurrent updates from parallel subagents. Files can be updated
|
|
1754
|
+
* or deleted (using null values) and the reducer handles the merge logic.
|
|
1755
|
+
*
|
|
1756
|
+
* Similar to LangGraph's messagesValue, this encapsulates the common pattern
|
|
1757
|
+
* of managing files in agent state so you don't have to manually configure
|
|
1758
|
+
* the ReducedValue each time.
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```typescript
|
|
1762
|
+
* import { filesValue } from "@anthropic/deepagents";
|
|
1763
|
+
* import { StateSchema } from "@langchain/langgraph";
|
|
1764
|
+
*
|
|
1765
|
+
* const MyStateSchema = new StateSchema({
|
|
1766
|
+
* files: filesValue,
|
|
1767
|
+
* // ... other state fields
|
|
1768
|
+
* });
|
|
1769
|
+
* ```
|
|
1770
|
+
*/
|
|
1771
|
+
declare const filesValue: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1772
|
+
//#endregion
|
|
1756
1773
|
//#region src/middleware/agent-memory.d.ts
|
|
1757
1774
|
/**
|
|
1758
1775
|
* Options for the agent memory middleware.
|
|
@@ -1832,5 +1849,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
1832
1849
|
*/
|
|
1833
1850
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
1834
1851
|
//#endregion
|
|
1835
|
-
export { type AgentMemoryMiddlewareOptions, type BackendFactory, type BackendProtocol, BaseSandbox, type CompiledSubAgent, CompositeBackend, type CreateDeepAgentParams, type DeepAgent, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FlattenSubAgentMiddleware, type GrepMatch, type InferDeepAgentSubagents, type InferDeepAgentType, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, StateBackend, StoreBackend, type SubAgent, type SubAgentMiddlewareOptions, type WriteResult, createAgentMemoryMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, findProjectRoot, isSandboxBackend, listSkills, parseSkillMetadata };
|
|
1852
|
+
export { type AgentMemoryMiddlewareOptions, type BackendFactory, type BackendProtocol, BaseSandbox, type CompiledSubAgent, CompositeBackend, type CreateDeepAgentParams, type DeepAgent, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FlattenSubAgentMiddleware, type GrepMatch, type InferDeepAgentSubagents, type InferDeepAgentType, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, StateBackend, StoreBackend, type SubAgent, type SubAgentMiddlewareOptions, type WriteResult, createAgentMemoryMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, filesValue, findProjectRoot, isSandboxBackend, listSkills, parseSkillMetadata };
|
|
1836
1853
|
//# sourceMappingURL=index.d.ts.map
|