deepagents 1.9.0-alpha.0 → 1.9.0
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 +926 -695
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +237 -166
- package/dist/index.d.ts +238 -167
- package/dist/index.js +928 -698
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, CreateAgentParams, HumanMessage, InferMiddlewareStates, InterruptOnConfig, ProviderStrategy, ReactAgent, ResponseFormat, ResponseFormatUndefined, StructuredTool, SystemMessage, ToolMessage, ToolStrategy } from "langchain";
|
|
3
|
-
import
|
|
4
|
-
import * as _langchain_langgraph0 from "@langchain/langgraph";
|
|
1
|
+
import * as _langchain from "langchain";
|
|
2
|
+
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentTypeConfig, CreateAgentParams, HumanMessage, InferMiddlewareStates, InterruptOnConfig, ProviderStrategy, ReactAgent, ResponseFormat, ResponseFormatUndefined, Runtime, StructuredTool, SystemMessage, ToolMessage, ToolRuntime, ToolStrategy } from "langchain";
|
|
3
|
+
import * as _langgraph from "@langchain/langgraph";
|
|
5
4
|
import { AnnotationRoot, Command, ReducedValue, StateSchema } from "@langchain/langgraph";
|
|
6
5
|
import { z } from "zod/v4";
|
|
7
6
|
import * as _messages from "@langchain/core/messages";
|
|
8
|
-
import * as
|
|
7
|
+
import * as z$2 from "zod";
|
|
9
8
|
import { z as z$1 } from "zod";
|
|
10
9
|
import { Client } from "@langchain/langgraph-sdk";
|
|
11
|
-
import { Sandbox } from "langsmith/experimental/sandbox";
|
|
12
|
-
import * as zod_v30 from "zod/v3";
|
|
10
|
+
import { CreateSandboxOptions, Sandbox } from "langsmith/experimental/sandbox";
|
|
11
|
+
import * as _$zod_v30 from "zod/v3";
|
|
13
12
|
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
14
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
15
|
-
import * as _langchain_core_tools0 from "@langchain/core/tools";
|
|
13
|
+
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
14
|
+
import * as _$_langchain_core_tools0 from "@langchain/core/tools";
|
|
16
15
|
import { ClientTool, ServerTool, StructuredTool as StructuredTool$1 } from "@langchain/core/tools";
|
|
17
16
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
18
17
|
import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_models/base";
|
|
18
|
+
import { Runnable } from "@langchain/core/runnables";
|
|
19
19
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
20
20
|
|
|
21
21
|
//#region src/backends/v1/protocol.d.ts
|
|
@@ -355,6 +355,9 @@ interface WriteResult {
|
|
|
355
355
|
* State update dict for checkpoint backends, null for external storage.
|
|
356
356
|
* Checkpoint backends populate this with {file_path: file_data} for LangGraph state.
|
|
357
357
|
* External backends set null (already persisted to disk/S3/database/etc).
|
|
358
|
+
*
|
|
359
|
+
* @deprecated Zero-arg backends send state updates internally via
|
|
360
|
+
* `__pregel_send`. Check `if (result.filesUpdate)` before using.
|
|
358
361
|
*/
|
|
359
362
|
filesUpdate?: Record<string, FileData> | null;
|
|
360
363
|
/** Metadata for the write operation, attached to the ToolMessage */
|
|
@@ -375,6 +378,9 @@ interface EditResult {
|
|
|
375
378
|
* State update dict for checkpoint backends, null for external storage.
|
|
376
379
|
* Checkpoint backends populate this with {file_path: file_data} for LangGraph state.
|
|
377
380
|
* External backends set null (already persisted to disk/S3/database/etc).
|
|
381
|
+
*
|
|
382
|
+
* @deprecated Zero-arg backends send state updates internally via
|
|
383
|
+
* `__pregel_send`. Check `if (result.filesUpdate)` before using.
|
|
378
384
|
*/
|
|
379
385
|
filesUpdate?: Record<string, FileData> | null;
|
|
380
386
|
/** Number of replacements made, undefined on failure */
|
|
@@ -609,6 +615,8 @@ declare class SandboxError extends Error {
|
|
|
609
615
|
* Different contexts build this differently:
|
|
610
616
|
* - Tools: Extract state via getCurrentTaskInput(config)
|
|
611
617
|
* - Middleware: Use request.state directly
|
|
618
|
+
*
|
|
619
|
+
* @deprecated Use {@link BackendRuntime} instead.
|
|
612
620
|
*/
|
|
613
621
|
interface StateAndStore {
|
|
614
622
|
/** Current agent state with files, messages, etc. */
|
|
@@ -625,21 +633,44 @@ interface StateAndStore {
|
|
|
625
633
|
* {@link adaptBackendProtocol} to normalize to {@link BackendProtocolV2}.
|
|
626
634
|
*/
|
|
627
635
|
type AnyBackendProtocol = BackendProtocolV1 | BackendProtocolV2;
|
|
636
|
+
/**
|
|
637
|
+
* Agent {@link Runtime} with `state`
|
|
638
|
+
*
|
|
639
|
+
* @deprecated Backends now read state from the LangGraph execution context
|
|
640
|
+
* via `getCurrentTaskInput()`, `getConfig()`, and `getStore()`.
|
|
641
|
+
*/
|
|
642
|
+
interface BackendRuntime<StateT = unknown> extends Runtime {
|
|
643
|
+
/** Current agent state with files, messages, etc. */
|
|
644
|
+
state: StateT;
|
|
645
|
+
}
|
|
628
646
|
/**
|
|
629
647
|
* Factory function type for creating backend instances.
|
|
630
648
|
*
|
|
631
|
-
* Backends receive
|
|
632
|
-
* and
|
|
649
|
+
* Backends receive {@link BackendRuntime} which contains the current state
|
|
650
|
+
* and runtime information, extracted from the execution context.
|
|
651
|
+
*
|
|
652
|
+
* @deprecated Pass a pre-constructed backend instance instead of a factory.
|
|
653
|
+
* E.g., `backend: new StateBackend()` instead of `backend: (runtime) => new StateBackend(runtime)`.
|
|
633
654
|
*
|
|
634
655
|
* @example
|
|
635
656
|
* ```typescript
|
|
636
657
|
* // Using in middleware
|
|
637
658
|
* const middleware = createFilesystemMiddleware({
|
|
638
|
-
* backend: (
|
|
659
|
+
* backend: (runtime) => new StateBackend(runtime)
|
|
639
660
|
* });
|
|
640
661
|
* ```
|
|
641
662
|
*/
|
|
642
|
-
type BackendFactory = (
|
|
663
|
+
type BackendFactory = (runtime: BackendRuntime) => MaybePromise<AnyBackendProtocol>;
|
|
664
|
+
/**
|
|
665
|
+
* Resolve a backend instance or await a {@link BackendFactory}.
|
|
666
|
+
*
|
|
667
|
+
* Accepts {@link BackendRuntime} or {@link ToolRuntime} — store typing differs
|
|
668
|
+
* between LangGraph checkpoint stores and core `ToolRuntime`; factories receive
|
|
669
|
+
* a value that is structurally compatible at runtime.
|
|
670
|
+
*
|
|
671
|
+
* @internal
|
|
672
|
+
*/
|
|
673
|
+
declare function resolveBackend(backend: AnyBackendProtocol | BackendFactory, runtime: BackendRuntime | ToolRuntime): Promise<BackendProtocolV2>;
|
|
643
674
|
//#endregion
|
|
644
675
|
//#region src/middleware/fs.d.ts
|
|
645
676
|
/**
|
|
@@ -662,19 +693,21 @@ interface FilesystemMiddlewareOptions {
|
|
|
662
693
|
customToolDescriptions?: Record<string, string> | null;
|
|
663
694
|
/** Optional token limit before evicting a tool result to the filesystem (default: 20000 tokens, ~80KB) */
|
|
664
695
|
toolTokenLimitBeforeEvict?: number | null;
|
|
696
|
+
/** Optional token limit before evicting a HumanMessage to the filesystem (default: 50000 tokens, ~200KB) */
|
|
697
|
+
humanMessageTokenLimitBeforeEvict?: number | null;
|
|
665
698
|
}
|
|
666
699
|
/**
|
|
667
700
|
* Create filesystem middleware with all tools and features.
|
|
668
701
|
*/
|
|
669
702
|
declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOptions): AgentMiddleware<StateSchema<{
|
|
670
703
|
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
671
|
-
}>, undefined, unknown, (
|
|
704
|
+
}>, undefined, unknown, (_langchain.DynamicStructuredTool<z.ZodObject<{
|
|
672
705
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
673
706
|
}, z.core.$strip>, {
|
|
674
707
|
path: string;
|
|
675
708
|
}, {
|
|
676
709
|
path?: string | undefined;
|
|
677
|
-
}, string, unknown, "ls"> |
|
|
710
|
+
}, string, unknown, "ls"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
678
711
|
file_path: z.ZodString;
|
|
679
712
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
680
713
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -693,7 +726,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
693
726
|
type: string;
|
|
694
727
|
mimeType: string;
|
|
695
728
|
data: string;
|
|
696
|
-
}[], unknown, "read_file"> |
|
|
729
|
+
}[], unknown, "read_file"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
697
730
|
file_path: z.ZodString;
|
|
698
731
|
content: z.ZodDefault<z.ZodString>;
|
|
699
732
|
}, z.core.$strip>, {
|
|
@@ -705,7 +738,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
705
738
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
706
739
|
files: Record<string, FileData>;
|
|
707
740
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
708
|
-
}, string>, unknown, "write_file"> |
|
|
741
|
+
}, string>, unknown, "write_file"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
709
742
|
file_path: z.ZodString;
|
|
710
743
|
old_string: z.ZodString;
|
|
711
744
|
new_string: z.ZodString;
|
|
@@ -723,7 +756,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
723
756
|
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | Command<unknown, {
|
|
724
757
|
files: Record<string, FileData>;
|
|
725
758
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
726
|
-
}, string>, unknown, "edit_file"> |
|
|
759
|
+
}, string>, unknown, "edit_file"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
727
760
|
pattern: z.ZodString;
|
|
728
761
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
729
762
|
}, z.core.$strip>, {
|
|
@@ -732,19 +765,19 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
732
765
|
}, {
|
|
733
766
|
pattern: string;
|
|
734
767
|
path?: string | undefined;
|
|
735
|
-
}, string, unknown, "glob"> |
|
|
768
|
+
}, string, unknown, "glob"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
736
769
|
pattern: z.ZodString;
|
|
737
770
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
738
|
-
glob: z.ZodNullable<z.ZodOptional<z.ZodString
|
|
771
|
+
glob: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
739
772
|
}, z.core.$strip>, {
|
|
740
773
|
pattern: string;
|
|
741
774
|
path: string;
|
|
742
|
-
glob
|
|
775
|
+
glob: string | null;
|
|
743
776
|
}, {
|
|
744
777
|
pattern: string;
|
|
745
778
|
path?: string | undefined;
|
|
746
779
|
glob?: string | null | undefined;
|
|
747
|
-
}, string, unknown, "grep"> |
|
|
780
|
+
}, string, unknown, "grep"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
748
781
|
command: z.ZodString;
|
|
749
782
|
}, z.core.$strip>, {
|
|
750
783
|
command: string;
|
|
@@ -765,13 +798,40 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
765
798
|
* for the middleware to apply via Command.
|
|
766
799
|
*/
|
|
767
800
|
declare class StateBackend implements BackendProtocolV2 {
|
|
768
|
-
private
|
|
801
|
+
private runtime;
|
|
769
802
|
private fileFormat;
|
|
770
|
-
constructor(
|
|
803
|
+
constructor(options?: BackendOptions);
|
|
804
|
+
/**
|
|
805
|
+
* @deprecated Pass no `runtime` argument
|
|
806
|
+
*/
|
|
807
|
+
constructor(runtime: BackendRuntime, options?: BackendOptions);
|
|
808
|
+
/**
|
|
809
|
+
* Whether this instance was constructed with the legacy factory pattern.
|
|
810
|
+
*
|
|
811
|
+
* When true, state is read from the injected `runtime` and `filesUpdate`
|
|
812
|
+
* is returned to the caller. When false, state is read from LangGraph's
|
|
813
|
+
* execution context and updates are sent via `__pregel_send`.
|
|
814
|
+
*/
|
|
815
|
+
private get isLegacy();
|
|
771
816
|
/**
|
|
772
817
|
* Get files from current state.
|
|
818
|
+
*
|
|
819
|
+
* In legacy mode, reads from the injected {@link BackendRuntime}.
|
|
820
|
+
* In zero-arg mode, reads from the LangGraph execution context via
|
|
821
|
+
* {@link getCurrentTaskInput}.
|
|
773
822
|
*/
|
|
774
823
|
private getFiles;
|
|
824
|
+
/**
|
|
825
|
+
* Push a files state update through LangGraph's internal send channel.
|
|
826
|
+
*
|
|
827
|
+
* In zero-arg mode, sends the update via the `__pregel_send` function
|
|
828
|
+
* from {@link getConfig}, mirroring Python's `CONFIG_KEY_SEND`.
|
|
829
|
+
* In legacy mode, this is a no-op — the caller uses `filesUpdate`
|
|
830
|
+
* from the return value instead.
|
|
831
|
+
*
|
|
832
|
+
* @param update - Map of file paths to their updated {@link FileData}
|
|
833
|
+
*/
|
|
834
|
+
private sendFilesUpdate;
|
|
775
835
|
/**
|
|
776
836
|
* List files and directories in the specified directory (non-recursive).
|
|
777
837
|
*
|
|
@@ -850,17 +910,17 @@ interface StoreBackendOptions extends BackendOptions {
|
|
|
850
910
|
* Determines where files are stored in the LangGraph store, enabling
|
|
851
911
|
* user-scoped, org-scoped, or any custom isolation pattern.
|
|
852
912
|
*
|
|
853
|
-
* If not provided, falls back to legacy behavior using assistantId from
|
|
913
|
+
* If not provided, falls back to legacy behavior using assistantId from {@link BackendRuntime}.
|
|
854
914
|
*
|
|
855
915
|
* @example
|
|
856
916
|
* ```typescript
|
|
857
917
|
* // User-scoped storage
|
|
858
|
-
* new StoreBackend(
|
|
918
|
+
* new StoreBackend(runtime, {
|
|
859
919
|
* namespace: ["memories", orgId, userId, "filesystem"],
|
|
860
920
|
* });
|
|
861
921
|
*
|
|
862
922
|
* // Org-scoped storage
|
|
863
|
-
* new StoreBackend(
|
|
923
|
+
* new StoreBackend(runtime, {
|
|
864
924
|
* namespace: ["memories", orgId, "filesystem"],
|
|
865
925
|
* });
|
|
866
926
|
* ```
|
|
@@ -881,22 +941,31 @@ declare class StoreBackend implements BackendProtocolV2 {
|
|
|
881
941
|
private stateAndStore;
|
|
882
942
|
private _namespace;
|
|
883
943
|
private fileFormat;
|
|
944
|
+
constructor(options?: StoreBackendOptions);
|
|
945
|
+
/**
|
|
946
|
+
* @deprecated Pass no `stateAndStore` argument
|
|
947
|
+
*/
|
|
884
948
|
constructor(stateAndStore: StateAndStore, options?: StoreBackendOptions);
|
|
885
949
|
/**
|
|
886
|
-
* Get the
|
|
950
|
+
* Get the BaseStore instance for persistent storage operations.
|
|
951
|
+
*
|
|
952
|
+
* In legacy mode, reads from the injected {@link StateAndStore}.
|
|
953
|
+
* In zero-arg mode, retrieves the store from the LangGraph execution
|
|
954
|
+
* context via {@link getLangGraphStore}.
|
|
887
955
|
*
|
|
888
956
|
* @returns BaseStore instance
|
|
889
|
-
* @throws Error if no store is available
|
|
957
|
+
* @throws Error if no store is available in either mode
|
|
890
958
|
*/
|
|
891
959
|
private getStore;
|
|
892
960
|
/**
|
|
893
961
|
* Get the namespace for store operations.
|
|
894
962
|
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
* -
|
|
899
|
-
*
|
|
963
|
+
* Resolution order:
|
|
964
|
+
* 1. Explicit namespace from constructor options (both modes)
|
|
965
|
+
* 2. Legacy mode: `[assistantId, "filesystem"]` fallback from {@link StateAndStore}
|
|
966
|
+
* 3. Zero-arg mode without namespace: `["filesystem"]` with a deprecation warning
|
|
967
|
+
* nudging callers to pass an explicit namespace
|
|
968
|
+
* 4. Legacy mode without assistantId: `["filesystem"]`
|
|
900
969
|
*/
|
|
901
970
|
protected getNamespace(): string[];
|
|
902
971
|
/**
|
|
@@ -1486,7 +1555,7 @@ interface LangSmithSandboxOptions {
|
|
|
1486
1555
|
defaultTimeout?: number;
|
|
1487
1556
|
}
|
|
1488
1557
|
/** Options for the `LangSmithSandbox.create()` static factory. */
|
|
1489
|
-
interface LangSmithSandboxCreateOptions {
|
|
1558
|
+
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady"> {
|
|
1490
1559
|
/**
|
|
1491
1560
|
* Name of the LangSmith sandbox template to use.
|
|
1492
1561
|
* @default "deepagents"
|
|
@@ -1619,7 +1688,7 @@ declare const DEFAULT_GENERAL_PURPOSE_DESCRIPTION = "General-purpose agent for r
|
|
|
1619
1688
|
* You can provide a custom `systemPrompt` to `createSubAgentMiddleware` to override
|
|
1620
1689
|
* or extend this default.
|
|
1621
1690
|
*/
|
|
1622
|
-
declare const TASK_SYSTEM_PROMPT
|
|
1691
|
+
declare const TASK_SYSTEM_PROMPT: string;
|
|
1623
1692
|
/**
|
|
1624
1693
|
* Type definitions for pre-compiled agents.
|
|
1625
1694
|
*
|
|
@@ -1796,7 +1865,7 @@ interface SubAgentMiddlewareOptions {
|
|
|
1796
1865
|
/**
|
|
1797
1866
|
* Create subagent middleware with task tool
|
|
1798
1867
|
*/
|
|
1799
|
-
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [
|
|
1868
|
+
declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): AgentMiddleware$1<undefined, undefined, unknown, readonly [_langchain.DynamicStructuredTool<z.ZodObject<{
|
|
1800
1869
|
description: z.ZodString;
|
|
1801
1870
|
subagent_type: z.ZodString;
|
|
1802
1871
|
}, z.core.$strip>, {
|
|
@@ -1841,7 +1910,7 @@ declare function createSubAgentMiddleware(options: SubAgentMiddlewareOptions): A
|
|
|
1841
1910
|
* });
|
|
1842
1911
|
* ```
|
|
1843
1912
|
*/
|
|
1844
|
-
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (_langchain_core_tools0.ClientTool | _langchain_core_tools0.ServerTool)[]>;
|
|
1913
|
+
declare function createPatchToolCallsMiddleware(): AgentMiddleware<undefined, undefined, unknown, readonly (_$_langchain_core_tools0.ClientTool | _$_langchain_core_tools0.ServerTool)[]>;
|
|
1845
1914
|
//#endregion
|
|
1846
1915
|
//#region src/middleware/memory.d.ts
|
|
1847
1916
|
/**
|
|
@@ -1896,8 +1965,8 @@ declare function createMemoryMiddleware(options: MemoryMiddlewareOptions): Agent
|
|
|
1896
1965
|
* Marked as private so it's not included in the final agent state.
|
|
1897
1966
|
*/
|
|
1898
1967
|
memoryContents: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1899
|
-
files:
|
|
1900
|
-
}>, undefined, unknown, readonly (_langchain_core_tools0.ClientTool | _langchain_core_tools0.ServerTool)[]>;
|
|
1968
|
+
files: _langgraph.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
1969
|
+
}>, undefined, unknown, readonly (_$_langchain_core_tools0.ClientTool | _$_langchain_core_tools0.ServerTool)[]>;
|
|
1901
1970
|
//#endregion
|
|
1902
1971
|
//#region src/middleware/skills.d.ts
|
|
1903
1972
|
declare const MAX_SKILL_FILE_SIZE: number;
|
|
@@ -2019,48 +2088,42 @@ declare function createSkillsMiddleware(options: SkillsMiddlewareOptions): Agent
|
|
|
2019
2088
|
allowedTools?: string[] | undefined;
|
|
2020
2089
|
}[] | undefined>;
|
|
2021
2090
|
files: ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
2022
|
-
}>, undefined, unknown, readonly (_langchain_core_tools0.ClientTool | _langchain_core_tools0.ServerTool)[]>;
|
|
2091
|
+
}>, undefined, unknown, readonly (_$_langchain_core_tools0.ClientTool | _$_langchain_core_tools0.ServerTool)[]>;
|
|
2023
2092
|
//#endregion
|
|
2024
|
-
//#region src/middleware/
|
|
2093
|
+
//#region src/middleware/completion_callback.d.ts
|
|
2025
2094
|
/**
|
|
2026
|
-
* Options for creating the completion
|
|
2095
|
+
* Options for creating the completion callback middleware.
|
|
2027
2096
|
*/
|
|
2028
|
-
interface
|
|
2097
|
+
interface CompletionCallbackOptions {
|
|
2029
2098
|
/**
|
|
2030
|
-
*
|
|
2031
|
-
*
|
|
2032
|
-
* supervisor.
|
|
2099
|
+
* Callback graph or assistant identifier. Used as the `assistant_id`
|
|
2100
|
+
* argument in `runs.create()`.
|
|
2033
2101
|
*/
|
|
2034
|
-
|
|
2102
|
+
callbackGraphId: string;
|
|
2035
2103
|
/**
|
|
2036
|
-
* URL of the
|
|
2037
|
-
*
|
|
2038
|
-
*
|
|
2039
|
-
* Required — JS does not support in-process ASGI transport like Python.
|
|
2104
|
+
* URL of the callback LangGraph server. Omit to use same-deployment
|
|
2105
|
+
* ASGI transport.
|
|
2040
2106
|
*/
|
|
2041
|
-
url
|
|
2107
|
+
url?: string;
|
|
2042
2108
|
/**
|
|
2043
|
-
* Additional headers to include in requests to the
|
|
2109
|
+
* Additional headers to include in requests to the callback server.
|
|
2044
2110
|
*/
|
|
2045
2111
|
headers?: Record<string, string>;
|
|
2046
2112
|
}
|
|
2047
2113
|
/**
|
|
2048
|
-
* Create a completion
|
|
2114
|
+
* Create a completion callback middleware for async subagents.
|
|
2049
2115
|
*
|
|
2050
2116
|
* **Experimental** — this middleware is experimental and may change.
|
|
2051
2117
|
*
|
|
2052
|
-
* This middleware is added to
|
|
2053
|
-
*
|
|
2054
|
-
*
|
|
2055
|
-
* proactively relay results.
|
|
2118
|
+
* This middleware is added to a subagent's middleware stack. On success or
|
|
2119
|
+
* model-call error, it sends a notification to the configured callback
|
|
2120
|
+
* thread by calling `runs.create()`.
|
|
2056
2121
|
*
|
|
2057
|
-
* The
|
|
2058
|
-
*
|
|
2059
|
-
*
|
|
2060
|
-
* configuration known at deployment time.
|
|
2122
|
+
* The callback destination is configured with `callbackGraphId` and
|
|
2123
|
+
* optional `url` and `headers`. The target thread is read from
|
|
2124
|
+
* `callbackThreadId` in the subagent state.
|
|
2061
2125
|
*
|
|
2062
|
-
* If `
|
|
2063
|
-
* launched manually without a supervisor), the middleware silently does
|
|
2126
|
+
* If `callbackThreadId` is not present in state, the middleware does
|
|
2064
2127
|
* nothing.
|
|
2065
2128
|
*
|
|
2066
2129
|
* @param options - Configuration options.
|
|
@@ -2068,11 +2131,10 @@ interface CompletionNotifierOptions {
|
|
|
2068
2131
|
*
|
|
2069
2132
|
* @example
|
|
2070
2133
|
* ```typescript
|
|
2071
|
-
* import {
|
|
2134
|
+
* import { createCompletionCallbackMiddleware } from "deepagents";
|
|
2072
2135
|
*
|
|
2073
|
-
* const notifier =
|
|
2074
|
-
*
|
|
2075
|
-
* url: "https://my-deployment.langsmith.dev",
|
|
2136
|
+
* const notifier = createCompletionCallbackMiddleware({
|
|
2137
|
+
* callbackGraphId: "supervisor",
|
|
2076
2138
|
* });
|
|
2077
2139
|
*
|
|
2078
2140
|
* const agent = createDeepAgent({
|
|
@@ -2081,9 +2143,9 @@ interface CompletionNotifierOptions {
|
|
|
2081
2143
|
* });
|
|
2082
2144
|
* ```
|
|
2083
2145
|
*/
|
|
2084
|
-
declare function
|
|
2085
|
-
|
|
2086
|
-
}, z.core.$strip>, undefined, unknown, readonly (_langchain_core_tools0.ClientTool | _langchain_core_tools0.ServerTool)[]>;
|
|
2146
|
+
declare function createCompletionCallbackMiddleware(options: CompletionCallbackOptions): AgentMiddleware<z$2.ZodObject<{
|
|
2147
|
+
callbackThreadId: z$2.ZodOptional<z$2.ZodString>;
|
|
2148
|
+
}, z$2.core.$strip>, undefined, unknown, readonly (_$_langchain_core_tools0.ClientTool | _$_langchain_core_tools0.ServerTool)[]>;
|
|
2087
2149
|
//#endregion
|
|
2088
2150
|
//#region src/middleware/summarization.d.ts
|
|
2089
2151
|
/**
|
|
@@ -2203,38 +2265,41 @@ declare function createSummarizationMiddleware(options: SummarizationMiddlewareO
|
|
|
2203
2265
|
//#endregion
|
|
2204
2266
|
//#region src/middleware/async_subagents.d.ts
|
|
2205
2267
|
/**
|
|
2206
|
-
* Specification for an async subagent running on a remote
|
|
2268
|
+
* Specification for an async subagent running on a remote [Agent Protocol](https://github.com/langchain-ai/agent-protocol)
|
|
2269
|
+
* server.
|
|
2207
2270
|
*
|
|
2208
|
-
* Async subagents connect to
|
|
2209
|
-
* They run as background tasks that the main agent can
|
|
2271
|
+
* Async subagents connect to any Agent Protocol-compliant server via the
|
|
2272
|
+
* LangGraph SDK. They run as background tasks that the main agent can
|
|
2273
|
+
* monitor and update.
|
|
2210
2274
|
*
|
|
2211
|
-
*
|
|
2212
|
-
*
|
|
2213
|
-
*
|
|
2275
|
+
* Compatible with LangGraph Platform (managed) and self-hosted servers.
|
|
2276
|
+
* Authentication for LangGraph Platform is handled automatically by the SDK
|
|
2277
|
+
* via environment variables (`LANGGRAPH_API_KEY`, `LANGSMITH_API_KEY`, or
|
|
2278
|
+
* `LANGCHAIN_API_KEY`). For self-hosted servers, pass custom auth via `headers`.
|
|
2214
2279
|
*/
|
|
2215
2280
|
interface AsyncSubAgent {
|
|
2216
2281
|
/** Unique identifier for the async subagent. */
|
|
2217
2282
|
name: string;
|
|
2218
2283
|
/** What this subagent does. The main agent uses this to decide when to delegate. */
|
|
2219
2284
|
description: string;
|
|
2220
|
-
/** The graph name or assistant ID on the
|
|
2285
|
+
/** The graph name or assistant ID on the Agent Protocol server. */
|
|
2221
2286
|
graphId: string;
|
|
2222
|
-
/** URL of the
|
|
2287
|
+
/** URL of the Agent Protocol server. Defaults to the LangGraph SDK's default endpoint. */
|
|
2223
2288
|
url?: string;
|
|
2224
|
-
/** Additional headers to include in requests to the
|
|
2289
|
+
/** Additional headers to include in requests to the server (e.g. for custom auth). */
|
|
2225
2290
|
headers?: Record<string, string>;
|
|
2226
2291
|
}
|
|
2227
2292
|
/**
|
|
2228
2293
|
* Possible statuses for an async subagent task.
|
|
2229
2294
|
*
|
|
2230
2295
|
* Statuses set by the middleware tools: `"running"`, `"success"`, `"error"`, `"cancelled"`.
|
|
2231
|
-
* Statuses that may be returned by the
|
|
2296
|
+
* Statuses that may be returned by the remote server: `"pending"`, `"timeout"`, `"interrupted"`.
|
|
2232
2297
|
*/
|
|
2233
|
-
type AsyncTaskStatus = "running" | "success" | "error" | "cancelled" | "timeout" | "interrupted";
|
|
2298
|
+
type AsyncTaskStatus = "pending" | "running" | "success" | "error" | "cancelled" | "timeout" | "interrupted";
|
|
2234
2299
|
/**
|
|
2235
2300
|
* A tracked async subagent task persisted in agent state.
|
|
2236
2301
|
*
|
|
2237
|
-
* Each task maps to a single thread + run on a remote
|
|
2302
|
+
* Each task maps to a single thread + run on a remote Agent Protocol server.
|
|
2238
2303
|
* The `taskId` is the same as `threadId`, so it can be used to look up
|
|
2239
2304
|
* the thread directly via the SDK.
|
|
2240
2305
|
*/
|
|
@@ -2243,15 +2308,17 @@ interface AsyncTask {
|
|
|
2243
2308
|
taskId: string;
|
|
2244
2309
|
/** Name of the async subagent type that is running. */
|
|
2245
2310
|
agentName: string;
|
|
2246
|
-
/**
|
|
2311
|
+
/** Thread ID on the remote server. */
|
|
2247
2312
|
threadId: string;
|
|
2248
|
-
/**
|
|
2313
|
+
/** Run ID for the current execution on the thread. */
|
|
2249
2314
|
runId: string;
|
|
2250
2315
|
/** Current task status. */
|
|
2251
2316
|
status: AsyncTaskStatus;
|
|
2252
2317
|
/** ISO timestamp of when the task was launched. */
|
|
2253
2318
|
createdAt: string;
|
|
2254
|
-
/**
|
|
2319
|
+
/** The prompt/description passed to the subagent when the task was launched. */
|
|
2320
|
+
description?: string;
|
|
2321
|
+
/** ISO timestamp of the most recent task update — set when the task status changes or a follow-up message is sent via the update tool. */
|
|
2255
2322
|
updatedAt?: string;
|
|
2256
2323
|
/** ISO timestamp of the most recent status poll via the check tool. */
|
|
2257
2324
|
checkedAt?: string;
|
|
@@ -2269,10 +2336,13 @@ interface AsyncSubAgentMiddlewareOptions {
|
|
|
2269
2336
|
* Create middleware that adds async subagent tools to an agent.
|
|
2270
2337
|
*
|
|
2271
2338
|
* Provides five tools for launching, checking, updating, cancelling, and
|
|
2272
|
-
* listing background tasks on remote
|
|
2339
|
+
* listing background tasks on remote Agent Protocol servers. Task state is
|
|
2273
2340
|
* persisted in the `asyncTasks` state channel so it survives
|
|
2274
2341
|
* context compaction.
|
|
2275
2342
|
*
|
|
2343
|
+
* Works with any Agent Protocol-compliant server — LangGraph Platform (managed)
|
|
2344
|
+
* or self-hosted (e.g. a Hono/Express server implementing the Agent Protocol spec).
|
|
2345
|
+
*
|
|
2276
2346
|
* @throws {Error} If no async subagents are provided or names are duplicated.
|
|
2277
2347
|
*
|
|
2278
2348
|
* @example
|
|
@@ -2281,7 +2351,7 @@ interface AsyncSubAgentMiddlewareOptions {
|
|
|
2281
2351
|
* asyncSubAgents: [{
|
|
2282
2352
|
* name: "researcher",
|
|
2283
2353
|
* description: "Research agent for deep analysis",
|
|
2284
|
-
* url: "https://my-
|
|
2354
|
+
* url: "https://my-agent-protocol-server.example.com",
|
|
2285
2355
|
* graphId: "research_agent",
|
|
2286
2356
|
* }],
|
|
2287
2357
|
* });
|
|
@@ -2294,7 +2364,7 @@ interface AsyncSubAgentMiddlewareOptions {
|
|
|
2294
2364
|
* `AsyncSubAgent` requires it, while `SubAgent` and `CompiledSubAgent` do not have it.
|
|
2295
2365
|
*/
|
|
2296
2366
|
declare function isAsyncSubAgent(subAgent: AnySubAgent): subAgent is AsyncSubAgent;
|
|
2297
|
-
declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareOptions):
|
|
2367
|
+
declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareOptions): _langchain.AgentMiddleware<StateSchema<{
|
|
2298
2368
|
asyncTasks: ReducedValue<Record<string, {
|
|
2299
2369
|
taskId: string;
|
|
2300
2370
|
agentName: string;
|
|
@@ -2302,6 +2372,7 @@ declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareO
|
|
|
2302
2372
|
runId: string;
|
|
2303
2373
|
status: string;
|
|
2304
2374
|
createdAt: string;
|
|
2375
|
+
description?: string | undefined;
|
|
2305
2376
|
updatedAt?: string | undefined;
|
|
2306
2377
|
checkedAt?: string | undefined;
|
|
2307
2378
|
}> | undefined, Record<string, {
|
|
@@ -2311,10 +2382,11 @@ declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareO
|
|
|
2311
2382
|
runId: string;
|
|
2312
2383
|
status: string;
|
|
2313
2384
|
createdAt: string;
|
|
2385
|
+
description?: string | undefined;
|
|
2314
2386
|
updatedAt?: string | undefined;
|
|
2315
2387
|
checkedAt?: string | undefined;
|
|
2316
2388
|
}> | undefined>;
|
|
2317
|
-
}>, undefined, unknown, (
|
|
2389
|
+
}>, undefined, unknown, (_langchain.DynamicStructuredTool<z.ZodObject<{
|
|
2318
2390
|
description: z.ZodString;
|
|
2319
2391
|
agentName: z.ZodString;
|
|
2320
2392
|
}, z.core.$strip>, {
|
|
@@ -2323,13 +2395,13 @@ declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareO
|
|
|
2323
2395
|
}, {
|
|
2324
2396
|
description: string;
|
|
2325
2397
|
agentName: string;
|
|
2326
|
-
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "start_async_task"> |
|
|
2398
|
+
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "start_async_task"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
2327
2399
|
taskId: z.ZodString;
|
|
2328
2400
|
}, z.core.$strip>, {
|
|
2329
2401
|
taskId: string;
|
|
2330
2402
|
}, {
|
|
2331
2403
|
taskId: string;
|
|
2332
|
-
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "check_async_task"> |
|
|
2404
|
+
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "check_async_task"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
2333
2405
|
taskId: z.ZodString;
|
|
2334
2406
|
message: z.ZodString;
|
|
2335
2407
|
}, z.core.$strip>, {
|
|
@@ -2338,13 +2410,13 @@ declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareO
|
|
|
2338
2410
|
}, {
|
|
2339
2411
|
taskId: string;
|
|
2340
2412
|
message: string;
|
|
2341
|
-
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "update_async_task"> |
|
|
2413
|
+
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "update_async_task"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
2342
2414
|
taskId: z.ZodString;
|
|
2343
2415
|
}, z.core.$strip>, {
|
|
2344
2416
|
taskId: string;
|
|
2345
2417
|
}, {
|
|
2346
2418
|
taskId: string;
|
|
2347
|
-
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "cancel_async_task"> |
|
|
2419
|
+
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "cancel_async_task"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
2348
2420
|
statusFilter: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2349
2421
|
}, z.core.$strip>, {
|
|
2350
2422
|
statusFilter?: string | null | undefined;
|
|
@@ -2629,19 +2701,18 @@ interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = Supp
|
|
|
2629
2701
|
//#endregion
|
|
2630
2702
|
//#region src/agent.d.ts
|
|
2631
2703
|
/**
|
|
2632
|
-
* Create a Deep Agent
|
|
2704
|
+
* Create a Deep Agent.
|
|
2633
2705
|
*
|
|
2634
|
-
*
|
|
2635
|
-
*
|
|
2636
|
-
*
|
|
2637
|
-
* -
|
|
2638
|
-
*
|
|
2639
|
-
*
|
|
2640
|
-
*
|
|
2641
|
-
* - Human-in-the-loop (humanInTheLoopMiddleware) - optional
|
|
2706
|
+
* This is the main entry point for building a production-style agent with
|
|
2707
|
+
* deepagents. It gives you a strong default runtime (filesystem, tasks,
|
|
2708
|
+
* subagents, summarization) and lets you opt into skills, memory,
|
|
2709
|
+
* human-in-the-loop interrupts, async subagents, and custom middleware.
|
|
2710
|
+
*
|
|
2711
|
+
* The runtime is intentionally opinionated: defaults work out of the box, and
|
|
2712
|
+
* when you customize behavior, the middleware ordering stays deterministic.
|
|
2642
2713
|
*
|
|
2643
2714
|
* @param params Configuration parameters for the agent
|
|
2644
|
-
* @returns
|
|
2715
|
+
* @returns Deep Agent instance with inferred state/response types
|
|
2645
2716
|
*
|
|
2646
2717
|
* @example
|
|
2647
2718
|
* ```typescript
|
|
@@ -2659,18 +2730,18 @@ interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = Supp
|
|
|
2659
2730
|
* // result.research is properly typed as string
|
|
2660
2731
|
* ```
|
|
2661
2732
|
*/
|
|
2662
|
-
declare function createDeepAgent<TResponse extends SupportedResponseFormat = SupportedResponseFormat, ContextSchema extends InteropZodObject = InteropZodObject, const TMiddleware extends readonly AgentMiddleware[] = readonly [], const TSubagents extends readonly AnySubAgent[] = readonly [], const TTools extends readonly (ClientTool | ServerTool)[] = readonly []>(params?: CreateDeepAgentParams<TResponse, ContextSchema, TMiddleware, TSubagents, TTools>): DeepAgent<DeepAgentTypeConfig<InferStructuredResponse<TResponse>, undefined, ContextSchema, readonly [AgentMiddleware<zod_v30.ZodObject<{
|
|
2663
|
-
todos: zod_v30.ZodDefault<zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
2664
|
-
content: zod_v30.ZodString;
|
|
2665
|
-
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
2666
|
-
}, "strip", zod_v30.ZodTypeAny, {
|
|
2733
|
+
declare function createDeepAgent<TResponse extends SupportedResponseFormat = SupportedResponseFormat, ContextSchema extends InteropZodObject = InteropZodObject, const TMiddleware extends readonly AgentMiddleware[] = readonly [], const TSubagents extends readonly AnySubAgent[] = readonly [], const TTools extends readonly (ClientTool | ServerTool)[] = readonly []>(params?: CreateDeepAgentParams<TResponse, ContextSchema, TMiddleware, TSubagents, TTools>): DeepAgent<DeepAgentTypeConfig<InferStructuredResponse<TResponse>, undefined, ContextSchema, readonly [AgentMiddleware<_$zod_v30.ZodObject<{
|
|
2734
|
+
todos: _$zod_v30.ZodDefault<_$zod_v30.ZodArray<_$zod_v30.ZodObject<{
|
|
2735
|
+
content: _$zod_v30.ZodString;
|
|
2736
|
+
status: _$zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
2737
|
+
}, "strip", _$zod_v30.ZodTypeAny, {
|
|
2667
2738
|
content: string;
|
|
2668
2739
|
status: "completed" | "in_progress" | "pending";
|
|
2669
2740
|
}, {
|
|
2670
2741
|
content: string;
|
|
2671
2742
|
status: "completed" | "in_progress" | "pending";
|
|
2672
2743
|
}>, "many">>;
|
|
2673
|
-
}, "strip", zod_v30.ZodTypeAny, {
|
|
2744
|
+
}, "strip", _$zod_v30.ZodTypeAny, {
|
|
2674
2745
|
todos: {
|
|
2675
2746
|
content: string;
|
|
2676
2747
|
status: "completed" | "in_progress" | "pending";
|
|
@@ -2680,18 +2751,18 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
2680
2751
|
content: string;
|
|
2681
2752
|
status: "completed" | "in_progress" | "pending";
|
|
2682
2753
|
}[] | undefined;
|
|
2683
|
-
}>, undefined, unknown, readonly [
|
|
2684
|
-
todos: zod_v30.ZodArray<zod_v30.ZodObject<{
|
|
2685
|
-
content: zod_v30.ZodString;
|
|
2686
|
-
status: zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
2687
|
-
}, "strip", zod_v30.ZodTypeAny, {
|
|
2754
|
+
}>, undefined, unknown, readonly [_langchain.DynamicStructuredTool<_$zod_v30.ZodObject<{
|
|
2755
|
+
todos: _$zod_v30.ZodArray<_$zod_v30.ZodObject<{
|
|
2756
|
+
content: _$zod_v30.ZodString;
|
|
2757
|
+
status: _$zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
2758
|
+
}, "strip", _$zod_v30.ZodTypeAny, {
|
|
2688
2759
|
content: string;
|
|
2689
2760
|
status: "completed" | "in_progress" | "pending";
|
|
2690
2761
|
}, {
|
|
2691
2762
|
content: string;
|
|
2692
2763
|
status: "completed" | "in_progress" | "pending";
|
|
2693
2764
|
}>, "many">;
|
|
2694
|
-
}, "strip", zod_v30.ZodTypeAny, {
|
|
2765
|
+
}, "strip", _$zod_v30.ZodTypeAny, {
|
|
2695
2766
|
todos: {
|
|
2696
2767
|
content: string;
|
|
2697
2768
|
status: "completed" | "in_progress" | "pending";
|
|
@@ -2711,25 +2782,25 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
2711
2782
|
content: string;
|
|
2712
2783
|
status: "completed" | "in_progress" | "pending";
|
|
2713
2784
|
}[];
|
|
2714
|
-
},
|
|
2785
|
+
}, _langgraph.Command<unknown, {
|
|
2715
2786
|
todos: {
|
|
2716
2787
|
content: string;
|
|
2717
2788
|
status: "completed" | "in_progress" | "pending";
|
|
2718
2789
|
}[];
|
|
2719
2790
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
2720
|
-
}, string>, unknown, "write_todos">]>, AgentMiddleware<
|
|
2721
|
-
files:
|
|
2722
|
-
}>, undefined, unknown, (
|
|
2723
|
-
path:
|
|
2724
|
-
}, zod_v4_core0.$strip>, {
|
|
2791
|
+
}, string>, unknown, "write_todos">]>, AgentMiddleware<_langgraph.StateSchema<{
|
|
2792
|
+
files: _langgraph.ReducedValue<FilesRecord | undefined, FilesRecordUpdate | undefined>;
|
|
2793
|
+
}>, undefined, unknown, (_langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2794
|
+
path: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodString>>;
|
|
2795
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2725
2796
|
path: string;
|
|
2726
2797
|
}, {
|
|
2727
2798
|
path?: string | undefined;
|
|
2728
|
-
}, string, unknown, "ls"> |
|
|
2729
|
-
file_path:
|
|
2730
|
-
offset:
|
|
2731
|
-
limit:
|
|
2732
|
-
}, zod_v4_core0.$strip>, {
|
|
2799
|
+
}, string, unknown, "ls"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2800
|
+
file_path: z$2.ZodString;
|
|
2801
|
+
offset: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodCoercedNumber<unknown>>>;
|
|
2802
|
+
limit: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodCoercedNumber<unknown>>>;
|
|
2803
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2733
2804
|
file_path: string;
|
|
2734
2805
|
offset: number;
|
|
2735
2806
|
limit: number;
|
|
@@ -2744,24 +2815,24 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
2744
2815
|
type: string;
|
|
2745
2816
|
mimeType: string;
|
|
2746
2817
|
data: string;
|
|
2747
|
-
}[], unknown, "read_file"> |
|
|
2748
|
-
file_path:
|
|
2749
|
-
content:
|
|
2750
|
-
}, zod_v4_core0.$strip>, {
|
|
2818
|
+
}[], unknown, "read_file"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2819
|
+
file_path: z$2.ZodString;
|
|
2820
|
+
content: z$2.ZodDefault<z$2.ZodString>;
|
|
2821
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2751
2822
|
file_path: string;
|
|
2752
2823
|
content: string;
|
|
2753
2824
|
}, {
|
|
2754
2825
|
file_path: string;
|
|
2755
2826
|
content?: string | undefined;
|
|
2756
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
2827
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langgraph.Command<unknown, {
|
|
2757
2828
|
files: Record<string, FileData>;
|
|
2758
2829
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
2759
|
-
}, string>, unknown, "write_file"> |
|
|
2760
|
-
file_path:
|
|
2761
|
-
old_string:
|
|
2762
|
-
new_string:
|
|
2763
|
-
replace_all:
|
|
2764
|
-
}, zod_v4_core0.$strip>, {
|
|
2830
|
+
}, string>, unknown, "write_file"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2831
|
+
file_path: z$2.ZodString;
|
|
2832
|
+
old_string: z$2.ZodString;
|
|
2833
|
+
new_string: z$2.ZodString;
|
|
2834
|
+
replace_all: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodBoolean>>;
|
|
2835
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2765
2836
|
file_path: string;
|
|
2766
2837
|
old_string: string;
|
|
2767
2838
|
new_string: string;
|
|
@@ -2771,53 +2842,53 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
2771
2842
|
old_string: string;
|
|
2772
2843
|
new_string: string;
|
|
2773
2844
|
replace_all?: boolean | undefined;
|
|
2774
|
-
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> |
|
|
2845
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | _langgraph.Command<unknown, {
|
|
2775
2846
|
files: Record<string, FileData>;
|
|
2776
2847
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
2777
|
-
}, string>, unknown, "edit_file"> |
|
|
2778
|
-
pattern:
|
|
2779
|
-
path:
|
|
2780
|
-
}, zod_v4_core0.$strip>, {
|
|
2848
|
+
}, string>, unknown, "edit_file"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2849
|
+
pattern: z$2.ZodString;
|
|
2850
|
+
path: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodString>>;
|
|
2851
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2781
2852
|
pattern: string;
|
|
2782
2853
|
path: string;
|
|
2783
2854
|
}, {
|
|
2784
2855
|
pattern: string;
|
|
2785
2856
|
path?: string | undefined;
|
|
2786
|
-
}, string, unknown, "glob"> |
|
|
2787
|
-
pattern:
|
|
2788
|
-
path:
|
|
2789
|
-
glob:
|
|
2790
|
-
}, zod_v4_core0.$strip>, {
|
|
2857
|
+
}, string, unknown, "glob"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2858
|
+
pattern: z$2.ZodString;
|
|
2859
|
+
path: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodString>>;
|
|
2860
|
+
glob: z$2.ZodDefault<z$2.ZodNullable<z$2.ZodOptional<z$2.ZodString>>>;
|
|
2861
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2791
2862
|
pattern: string;
|
|
2792
2863
|
path: string;
|
|
2793
|
-
glob
|
|
2864
|
+
glob: string | null;
|
|
2794
2865
|
}, {
|
|
2795
2866
|
pattern: string;
|
|
2796
2867
|
path?: string | undefined;
|
|
2797
2868
|
glob?: string | null | undefined;
|
|
2798
|
-
}, string, unknown, "grep"> |
|
|
2799
|
-
command:
|
|
2800
|
-
}, zod_v4_core0.$strip>, {
|
|
2869
|
+
}, string, unknown, "grep"> | _langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2870
|
+
command: z$2.ZodString;
|
|
2871
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2801
2872
|
command: string;
|
|
2802
2873
|
}, {
|
|
2803
2874
|
command: string;
|
|
2804
|
-
}, string, unknown, "execute">)[]>, AgentMiddleware<undefined, undefined, unknown, readonly [
|
|
2805
|
-
description:
|
|
2806
|
-
subagent_type:
|
|
2807
|
-
}, zod_v4_core0.$strip>, {
|
|
2875
|
+
}, string, unknown, "execute">)[]>, AgentMiddleware<undefined, undefined, unknown, readonly [_langchain.DynamicStructuredTool<z$2.ZodObject<{
|
|
2876
|
+
description: z$2.ZodString;
|
|
2877
|
+
subagent_type: z$2.ZodString;
|
|
2878
|
+
}, _$zod_v4_core0.$strip>, {
|
|
2808
2879
|
description: string;
|
|
2809
2880
|
subagent_type: string;
|
|
2810
2881
|
}, {
|
|
2811
2882
|
description: string;
|
|
2812
2883
|
subagent_type: string;
|
|
2813
|
-
}, string |
|
|
2814
|
-
_summarizationSessionId:
|
|
2815
|
-
_summarizationEvent:
|
|
2816
|
-
cutoffIndex:
|
|
2817
|
-
summaryMessage:
|
|
2818
|
-
filePath:
|
|
2819
|
-
}, zod_v4_core0.$strip>>;
|
|
2820
|
-
}, zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
2884
|
+
}, string | _langgraph.Command<unknown, Record<string, unknown>, string>, unknown, "task">]>, AgentMiddleware<z$2.ZodObject<{
|
|
2885
|
+
_summarizationSessionId: z$2.ZodOptional<z$2.ZodString>;
|
|
2886
|
+
_summarizationEvent: z$2.ZodOptional<z$2.ZodObject<{
|
|
2887
|
+
cutoffIndex: z$2.ZodNumber;
|
|
2888
|
+
summaryMessage: z$2.ZodCustom<_messages.HumanMessage<_messages.MessageStructure<_messages.MessageToolSet>>, _messages.HumanMessage<_messages.MessageStructure<_messages.MessageToolSet>>>;
|
|
2889
|
+
filePath: z$2.ZodNullable<z$2.ZodString>;
|
|
2890
|
+
}, _$zod_v4_core0.$strip>>;
|
|
2891
|
+
}, _$zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
2821
2892
|
//#endregion
|
|
2822
2893
|
//#region src/errors.d.ts
|
|
2823
2894
|
/**
|
|
@@ -3010,7 +3081,7 @@ interface AgentMemoryMiddlewareOptions {
|
|
|
3010
3081
|
* @deprecated Use `createMemoryMiddleware` from `./memory.js` instead.
|
|
3011
3082
|
* This function uses direct filesystem access which limits portability.
|
|
3012
3083
|
*/
|
|
3013
|
-
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (_langchain_core_tools0.ClientTool | _langchain_core_tools0.ServerTool)[]>;
|
|
3084
|
+
declare function createAgentMemoryMiddleware(options: AgentMemoryMiddlewareOptions): AgentMiddleware<any, undefined, unknown, readonly (_$_langchain_core_tools0.ClientTool | _$_langchain_core_tools0.ServerTool)[]>;
|
|
3014
3085
|
//#endregion
|
|
3015
3086
|
//#region src/skills/loader.d.ts
|
|
3016
3087
|
/**
|
|
@@ -3064,5 +3135,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
3064
3135
|
*/
|
|
3065
3136
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
3066
3137
|
//#endregion
|
|
3067
|
-
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, BaseSandbox, type CompiledSubAgent, type
|
|
3138
|
+
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, 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, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, LangSmithSandbox, type LangSmithSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3068
3139
|
//# sourceMappingURL=index.d.ts.map
|