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.d.cts CHANGED
@@ -1,19 +1,20 @@
1
1
  import * as zod_v30 from "zod/v3";
2
- import * as langchain9 from "langchain";
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<z$1.ZodObject<{
307
- files: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
308
- content: z$1.ZodArray<z$1.ZodString>;
309
- created_at: z$1.ZodString;
310
- modified_at: z$1.ZodString;
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
319
- file_path: z$1.ZodString;
320
- offset: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>>;
321
- limit: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>>;
322
- }, z$1.core.$strip>, {
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
331
- file_path: z$1.ZodString;
332
- content: z$1.ZodString;
333
- }, z$1.core.$strip>, {
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
343
- file_path: z$1.ZodString;
344
- old_string: z$1.ZodString;
345
- new_string: z$1.ZodString;
346
- replace_all: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
347
- }, z$1.core.$strip>, {
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
361
- pattern: z$1.ZodString;
362
- path: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
363
- }, z$1.core.$strip>, {
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
370
- pattern: z$1.ZodString;
371
- path: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
372
- glob: z$1.ZodNullable<z$1.ZodOptional<z$1.ZodString>>;
373
- }, z$1.core.$strip>, {
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"> | langchain9.DynamicStructuredTool<z$1.ZodObject<{
382
- command: z$1.ZodString;
383
- }, z$1.core.$strip>, {
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 [langchain9.DynamicStructuredTool<z$1.ZodObject<{
448
- description: z$1.ZodString;
449
- subagent_type: z$1.ZodString;
450
- }, z$1.core.$strip>, {
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<z.ZodObject<{
669
- skillsMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
670
- name: z.ZodString;
671
- description: z.ZodString;
672
- path: z.ZodString;
673
- license: z.ZodOptional<z.ZodNullable<z.ZodString>>;
674
- compatibility: z.ZodOptional<z.ZodNullable<z.ZodString>>;
675
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
676
- allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
677
- }, z.core.$strip>>>;
678
- }, z.core.$strip>, undefined, unknown, readonly (_langchain_core_tools3.ClientTool | _langchain_core_tools3.ServerTool)[]>;
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 [langchain9.DynamicStructuredTool<zod_v30.ZodObject<{
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<zod0.ZodObject<{
1379
- skillsMetadata: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1380
- name: zod0.ZodString;
1381
- description: zod0.ZodString;
1382
- path: zod0.ZodString;
1383
- license: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
1384
- compatibility: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
1385
- metadata: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
1386
- allowedTools: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
1387
- }, zod_v4_core0.$strip>>>;
1388
- }, zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<zod0.ZodObject<{
1389
- files: zod0.ZodDefault<zod0.ZodRecord<zod0.ZodString, zod0.ZodObject<{
1390
- content: zod0.ZodArray<zod0.ZodString>;
1391
- created_at: zod0.ZodString;
1392
- modified_at: zod0.ZodString;
1393
- }, zod_v4_core0.$strip>>>;
1394
- }, zod_v4_core0.$strip>, undefined, unknown, (langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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 [langchain9.DynamicStructuredTool<zod0.ZodObject<{
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 langchain9 from "langchain";
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/core/language_models/chat_models";
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 { Runnable } from "@langchain/core/runnables";
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 { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
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<z.ZodObject<{
308
- files: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
309
- content: z.ZodArray<z.ZodString>;
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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"> | langchain9.DynamicStructuredTool<z.ZodObject<{
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 [langchain9.DynamicStructuredTool<z.ZodObject<{
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 (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
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 (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
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<z$1.ZodObject<{
670
- skillsMetadata: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
671
- name: z$1.ZodString;
672
- description: z$1.ZodString;
673
- path: z$1.ZodString;
674
- license: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
675
- compatibility: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
676
- metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
677
- allowedTools: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
678
- }, z$1.core.$strip>>>;
679
- }, z$1.core.$strip>, undefined, unknown, readonly (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
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 [langchain9.DynamicStructuredTool<zod_v30.ZodObject<{
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<zod0.ZodObject<{
1380
- skillsMetadata: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1381
- name: zod0.ZodString;
1382
- description: zod0.ZodString;
1383
- path: zod0.ZodString;
1384
- license: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
1385
- compatibility: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
1386
- metadata: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
1387
- allowedTools: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
1388
- }, zod_v4_core0.$strip>>>;
1389
- }, zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]> | AgentMiddleware<zod0.ZodObject<{
1390
- files: zod0.ZodDefault<zod0.ZodRecord<zod0.ZodString, zod0.ZodObject<{
1391
- content: zod0.ZodArray<zod0.ZodString>;
1392
- created_at: zod0.ZodString;
1393
- modified_at: zod0.ZodString;
1394
- }, zod_v4_core0.$strip>>>;
1395
- }, zod_v4_core0.$strip>, undefined, unknown, (langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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"> | langchain9.DynamicStructuredTool<zod0.ZodObject<{
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 [langchain9.DynamicStructuredTool<zod0.ZodObject<{
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 (_langchain_core_tools5.ClientTool | _langchain_core_tools5.ServerTool)[]>;
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
  /**