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