deepagents 1.9.1 → 1.10.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 +316 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +231 -10
- package/dist/index.d.ts +231 -10
- package/dist/index.js +307 -5
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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";
|
|
2
|
+
import { AgentMiddleware, AgentMiddleware as AgentMiddleware$1, AgentRunStream, AgentTypeConfig, CreateAgentParams, HumanMessage, InferMiddlewareStates, InterruptOnConfig, ProviderStrategy, ReactAgent, ResponseFormat, ResponseFormatUndefined, Runtime, StructuredTool, SystemMessage, ToolCallStreamUnion, ToolMessage, ToolRuntime, ToolStrategy } from "langchain";
|
|
3
3
|
import * as _langgraph from "@langchain/langgraph";
|
|
4
|
-
import { AnnotationRoot, Command, ReducedValue, StateSchema } from "@langchain/langgraph";
|
|
4
|
+
import { AnnotationRoot, ChatModelStream, Command, Namespace, NativeStreamTransformer, ReducedValue, StateSchema, StreamTransformer } from "@langchain/langgraph";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
import * as _messages from "@langchain/core/messages";
|
|
7
7
|
import * as z$2 from "zod";
|
|
@@ -711,6 +711,35 @@ interface FilesystemPermission {
|
|
|
711
711
|
}
|
|
712
712
|
//#endregion
|
|
713
713
|
//#region src/middleware/fs.d.ts
|
|
714
|
+
/**
|
|
715
|
+
* Tools that should be excluded from the large result eviction logic.
|
|
716
|
+
*
|
|
717
|
+
* This array contains tools that should NOT have their results evicted to the filesystem
|
|
718
|
+
* when they exceed token limits. Tools are excluded for different reasons:
|
|
719
|
+
*
|
|
720
|
+
* 1. Tools with built-in truncation (ls, glob, grep):
|
|
721
|
+
* These tools truncate their own output when it becomes too large. When these tools
|
|
722
|
+
* produce truncated output due to many matches, it typically indicates the query
|
|
723
|
+
* needs refinement rather than full result preservation. In such cases, the truncated
|
|
724
|
+
* matches are potentially more like noise and the LLM should be prompted to narrow
|
|
725
|
+
* its search criteria instead.
|
|
726
|
+
*
|
|
727
|
+
* 2. Tools with problematic truncation behavior (read_file):
|
|
728
|
+
* read_file is tricky to handle as the failure mode here is single long lines
|
|
729
|
+
* (e.g., imagine a jsonl file with very long payloads on each line). If we try to
|
|
730
|
+
* truncate the result of read_file, the agent may then attempt to re-read the
|
|
731
|
+
* truncated file using read_file again, which won't help.
|
|
732
|
+
*
|
|
733
|
+
* 3. Tools that never exceed limits (edit_file, write_file):
|
|
734
|
+
* These tools return minimal confirmation messages and are never expected to produce
|
|
735
|
+
* output large enough to exceed token limits, so checking them would be unnecessary.
|
|
736
|
+
*/
|
|
737
|
+
/**
|
|
738
|
+
* All tool names registered by FilesystemMiddleware.
|
|
739
|
+
* This is the single source of truth — used by createDeepAgent to detect
|
|
740
|
+
* collisions with user-supplied tools at construction time.
|
|
741
|
+
*/
|
|
742
|
+
declare const FILESYSTEM_TOOL_NAMES: readonly ["ls", "read_file", "write_file", "edit_file", "glob", "grep", "execute"];
|
|
714
743
|
/**
|
|
715
744
|
* Type for the files state record.
|
|
716
745
|
*/
|
|
@@ -2475,6 +2504,19 @@ interface AsyncTask {
|
|
|
2475
2504
|
/** ISO timestamp of the most recent status poll via the check tool. */
|
|
2476
2505
|
checkedAt?: string;
|
|
2477
2506
|
}
|
|
2507
|
+
/**
|
|
2508
|
+
* Task statuses that will never change.
|
|
2509
|
+
*
|
|
2510
|
+
* When listing tasks, live-status fetches are skipped for tasks whose
|
|
2511
|
+
* cached status is in this set, since they are guaranteed to be final.
|
|
2512
|
+
*/
|
|
2513
|
+
/**
|
|
2514
|
+
* Names of the tools added by the async subagent middleware.
|
|
2515
|
+
*
|
|
2516
|
+
* Exported so `agent.ts` can include them in `BUILTIN_TOOL_NAMES` and
|
|
2517
|
+
* surface a `ConfigurationError` if a user-provided tool collides.
|
|
2518
|
+
*/
|
|
2519
|
+
declare const ASYNC_TASK_TOOL_NAMES: readonly ["start_async_task", "check_async_task", "update_async_task", "cancel_async_task", "list_async_tasks"];
|
|
2478
2520
|
/**
|
|
2479
2521
|
* Options for creating async subagent middleware.
|
|
2480
2522
|
*/
|
|
@@ -2576,8 +2618,100 @@ declare function createAsyncSubAgentMiddleware(options: AsyncSubAgentMiddlewareO
|
|
|
2576
2618
|
statusFilter?: string | null | undefined;
|
|
2577
2619
|
}, string | Command<unknown, Record<string, unknown>, string>, unknown, "list_async_tasks">)[]>;
|
|
2578
2620
|
//#endregion
|
|
2621
|
+
//#region src/stream.d.ts
|
|
2622
|
+
/**
|
|
2623
|
+
* Represents a single subagent invocation observed during a deep agent run.
|
|
2624
|
+
*
|
|
2625
|
+
* @typeParam TOutput - The subagent's output state type. Defaults to
|
|
2626
|
+
* `unknown`; inferred to the subagent's `MergedAgentState` for
|
|
2627
|
+
* `CompiledSubAgent` via {@link SubagentRunStreamUnion}.
|
|
2628
|
+
*/
|
|
2629
|
+
interface SubagentRunStream<TOutput = unknown, TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[]> {
|
|
2630
|
+
readonly name: string;
|
|
2631
|
+
readonly taskInput: Promise<string>;
|
|
2632
|
+
readonly output: Promise<TOutput>;
|
|
2633
|
+
readonly messages: AsyncIterable<ChatModelStream>;
|
|
2634
|
+
readonly toolCalls: AsyncIterable<ToolCallStreamUnion<TTools>>;
|
|
2635
|
+
readonly subagents: AsyncIterable<SubagentRunStream>;
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* Extract the output state type from a subagent spec.
|
|
2639
|
+
* For `CompiledSubAgent<ReactAgent<Types>>`, resolves to the agent's
|
|
2640
|
+
* invoke return type. Falls back to `unknown` for `SubAgent` and
|
|
2641
|
+
* `AsyncSubAgent`.
|
|
2642
|
+
*/
|
|
2643
|
+
type SubagentOutputOf<T extends AnySubAgent> = T extends CompiledSubAgent<infer R> ? R extends ReactAgent<infer Types> ? Awaited<ReturnType<ReactAgent<Types>["invoke"]>> : unknown : unknown;
|
|
2644
|
+
/**
|
|
2645
|
+
* Extract the tools tuple from a subagent spec.
|
|
2646
|
+
* For `CompiledSubAgent<ReactAgent<Types>>`, resolves to `Types["Tools"]`.
|
|
2647
|
+
* Falls back to the default `(ClientTool | ServerTool)[]` for `SubAgent`
|
|
2648
|
+
* and `AsyncSubAgent`.
|
|
2649
|
+
*/
|
|
2650
|
+
type SubagentToolsOf<T extends AnySubAgent> = T extends CompiledSubAgent<infer R> ? R extends ReactAgent<infer Types> ? Types["Tools"] : readonly (ClientTool | ServerTool)[] : readonly (ClientTool | ServerTool)[];
|
|
2651
|
+
/**
|
|
2652
|
+
* A typed `SubagentRunStream` variant for a single subagent spec.
|
|
2653
|
+
* Narrows `.name` to the literal string type, `.output` to the
|
|
2654
|
+
* inferred state type, and `.toolCalls` to the subagent's tools
|
|
2655
|
+
* when available.
|
|
2656
|
+
*/
|
|
2657
|
+
type NamedSubagentRunStream<T extends AnySubAgent> = T extends {
|
|
2658
|
+
name: infer N extends string;
|
|
2659
|
+
} ? SubagentRunStream<SubagentOutputOf<T>, SubagentToolsOf<T>> & {
|
|
2660
|
+
readonly name: N;
|
|
2661
|
+
} : SubagentRunStream;
|
|
2662
|
+
/**
|
|
2663
|
+
* Discriminated union of {@link SubagentRunStream} variants, one per
|
|
2664
|
+
* subagent in `TSubagents`. Enables TypeScript to narrow `.output`
|
|
2665
|
+
* when the consumer checks `sub.name === "someSubagentName"`.
|
|
2666
|
+
*/
|
|
2667
|
+
type SubagentRunStreamUnion<TSubagents extends readonly AnySubAgent[]> = { [K in keyof TSubagents]: NamedSubagentRunStream<TSubagents[K]> }[number];
|
|
2668
|
+
/**
|
|
2669
|
+
* An {@link AgentRunStream} with native deep-agent projections assigned
|
|
2670
|
+
* directly on the instance by `createGraphRunStream` (via `__native`
|
|
2671
|
+
* transformers).
|
|
2672
|
+
*
|
|
2673
|
+
* This is a pure type overlay — no runtime class exists. The
|
|
2674
|
+
* `subagents` property is populated at runtime by the
|
|
2675
|
+
* `createSubagentTransformer` registered at compile time.
|
|
2676
|
+
*/
|
|
2677
|
+
type DeepAgentRunStream<TValues = Record<string, unknown>, TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[], TSubagents extends readonly AnySubAgent[] = readonly AnySubAgent[], TExtensions extends Record<string, unknown> = Record<string, unknown>> = AgentRunStream<TValues, TTools, TExtensions> & {
|
|
2678
|
+
/** Subagent invocation streams from the native SubagentTransformer. */subagents: AsyncIterable<SubagentRunStreamUnion<TSubagents>>;
|
|
2679
|
+
};
|
|
2680
|
+
interface SubagentProjection {
|
|
2681
|
+
subagents: AsyncIterable<SubagentRunStream>;
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* Native transformer that correlates `task` tool calls into
|
|
2685
|
+
* {@link SubagentRunStream} objects and routes child-namespace
|
|
2686
|
+
* `tools` and `messages` events into per-subagent channels.
|
|
2687
|
+
*
|
|
2688
|
+
* Marked `__native: true` — the `subagents` projection key lands
|
|
2689
|
+
* directly on the `GraphRunStream` instance as `run.subagents`.
|
|
2690
|
+
*/
|
|
2691
|
+
declare function createSubagentTransformer(path: Namespace): () => NativeStreamTransformer<SubagentProjection>;
|
|
2692
|
+
//#endregion
|
|
2579
2693
|
//#region src/types.d.ts
|
|
2580
2694
|
type AnyAnnotationRoot = AnnotationRoot<any>;
|
|
2695
|
+
/**
|
|
2696
|
+
* Literal union of all built-in deep agent tool names.
|
|
2697
|
+
* These are always present on the agent regardless of user-provided tools.
|
|
2698
|
+
*/
|
|
2699
|
+
type DeepAgentBuiltinToolName = (typeof FILESYSTEM_TOOL_NAMES)[number] | (typeof ASYNC_TASK_TOOL_NAMES)[number] | "task" | "write_todos";
|
|
2700
|
+
/**
|
|
2701
|
+
* A placeholder StructuredTool type with a literal `name` for each
|
|
2702
|
+
* built-in tool. Used to thread built-in tool names into the
|
|
2703
|
+
* `ToolCallStreamUnion` so they appear in `run.toolCalls` alongside
|
|
2704
|
+
* user-provided tools.
|
|
2705
|
+
*/
|
|
2706
|
+
type BuiltinToolPlaceholder<N extends string> = {
|
|
2707
|
+
name: N;
|
|
2708
|
+
} & StructuredTool$1;
|
|
2709
|
+
/**
|
|
2710
|
+
* Tuple of placeholder tool types for all built-in deep agent tools.
|
|
2711
|
+
* Combined with `TTypes["Tools"]` in the `DeepAgentRunStream` return type.
|
|
2712
|
+
*/
|
|
2713
|
+
type DeepAgentBuiltinToolsTuple = { [K in DeepAgentBuiltinToolName]: BuiltinToolPlaceholder<K> }[DeepAgentBuiltinToolName][];
|
|
2714
|
+
type InferDeepAgentStreamExtensions<T extends ReadonlyArray<() => StreamTransformer<any>>> = T extends readonly [] ? Record<string, never> : T extends readonly [() => StreamTransformer<infer P>, ...infer Rest extends ReadonlyArray<() => StreamTransformer<any>>] ? P & InferDeepAgentStreamExtensions<Rest> : Record<string, unknown>;
|
|
2581
2715
|
/** Any subagent specification — sync, compiled, or async. */
|
|
2582
2716
|
type AnySubAgent = SubAgent | CompiledSubAgent | AsyncSubAgent;
|
|
2583
2717
|
interface TypedToolStrategy<T = unknown> extends Array<ToolStrategy<any>> {
|
|
@@ -2658,7 +2792,7 @@ type InferStructuredResponse<T extends SupportedResponseFormat> = SupportedRespo
|
|
|
2658
2792
|
* type Types = InferDeepAgentType<typeof agent, "Subagents">;
|
|
2659
2793
|
* ```
|
|
2660
2794
|
*/
|
|
2661
|
-
interface DeepAgentTypeConfig<TResponse extends Record<string, any> | ResponseFormatUndefined = Record<string, any> | ResponseFormatUndefined, TState extends AnyAnnotationRoot | InteropZodObject | undefined = AnyAnnotationRoot | InteropZodObject | undefined, TContext extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot | InteropZodObject, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[], TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[], TSubagents extends readonly AnySubAgent[] = readonly AnySubAgent[]
|
|
2795
|
+
interface DeepAgentTypeConfig<TResponse extends Record<string, any> | ResponseFormatUndefined = Record<string, any> | ResponseFormatUndefined, TState extends AnyAnnotationRoot | InteropZodObject | undefined = AnyAnnotationRoot | InteropZodObject | undefined, TContext extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot | InteropZodObject, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[], TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[], TSubagents extends readonly AnySubAgent[] = readonly AnySubAgent[], TStreamTransformers extends ReadonlyArray<() => StreamTransformer<any>> = ReadonlyArray<() => StreamTransformer<any>>> extends AgentTypeConfig<TResponse, TState, TContext, TMiddleware, TTools, TStreamTransformers> {
|
|
2662
2796
|
/** The subagents array type for type-safe streaming */
|
|
2663
2797
|
Subagents: TSubagents;
|
|
2664
2798
|
}
|
|
@@ -2673,6 +2807,7 @@ interface DefaultDeepAgentTypeConfig extends DeepAgentTypeConfig {
|
|
|
2673
2807
|
Middleware: readonly AgentMiddleware[];
|
|
2674
2808
|
Tools: readonly (ClientTool | ServerTool)[];
|
|
2675
2809
|
Subagents: readonly AnySubAgent[];
|
|
2810
|
+
StreamTransformers: readonly [];
|
|
2676
2811
|
}
|
|
2677
2812
|
/**
|
|
2678
2813
|
* DeepAgent extends ReactAgent with additional subagent type information.
|
|
@@ -2690,9 +2825,86 @@ interface DefaultDeepAgentTypeConfig extends DeepAgentTypeConfig {
|
|
|
2690
2825
|
* type Subagents = InferDeepAgentSubagents<typeof agent>;
|
|
2691
2826
|
* ```
|
|
2692
2827
|
*/
|
|
2693
|
-
|
|
2694
|
-
/** Type brand for DeepAgent type inference */
|
|
2695
|
-
|
|
2828
|
+
interface DeepAgent<TTypes extends DeepAgentTypeConfig = DeepAgentTypeConfig> extends ReactAgent<TTypes> {
|
|
2829
|
+
/** Type brand for DeepAgent type inference */
|
|
2830
|
+
readonly "~deepAgentTypes": TTypes;
|
|
2831
|
+
/**
|
|
2832
|
+
* Executes the agent with the v3 streaming interface, returning an
|
|
2833
|
+
* {@link DeepAgentRunStream} that provides ergonomic, typed projections for
|
|
2834
|
+
* messages, tool calls, subagents, and middleware events.
|
|
2835
|
+
*
|
|
2836
|
+
* Pass `version: "v3"` to opt into this projection-oriented stream. Omitting
|
|
2837
|
+
* `version` preserves the legacy internal LangGraph event-stream behavior
|
|
2838
|
+
* for compatibility with LangGraph Platform integrations.
|
|
2839
|
+
*
|
|
2840
|
+
* This v3 stream is experimental and its API may change in future releases.
|
|
2841
|
+
* It will become the default in a future major release.
|
|
2842
|
+
*
|
|
2843
|
+
* @param state - The initial state for the agent execution. Can be:
|
|
2844
|
+
* - An object containing `messages` array and any middleware-specific state properties
|
|
2845
|
+
* - A Command object for more advanced control flow
|
|
2846
|
+
*
|
|
2847
|
+
* @param config - Runtime configuration including:
|
|
2848
|
+
* @param config.version - Must be `"v3"` to use the {@link DeepAgentRunStream}
|
|
2849
|
+
* interface. The default legacy event stream is maintained for internal
|
|
2850
|
+
* integrations and should not be used for new user-facing agent streaming.
|
|
2851
|
+
* @param config.context - The context for the agent execution.
|
|
2852
|
+
* @param config.configurable - LangGraph configuration options like `thread_id`, `run_id`, etc.
|
|
2853
|
+
* @param config.store - The store for the agent execution for persisting state.
|
|
2854
|
+
* @param config.signal - An optional AbortSignal for the agent execution.
|
|
2855
|
+
* @param config.recursionLimit - The recursion limit for the agent execution.
|
|
2856
|
+
*
|
|
2857
|
+
* @returns A Promise that resolves to an {@link DeepAgentRunStream} providing:
|
|
2858
|
+
* - `run.messages` — all AI message lifecycles with streaming `.text` and `.reasoning`
|
|
2859
|
+
* - `run.toolCalls` — individual tool call streams with `.input`, `.output`, `.status`
|
|
2860
|
+
* - `run.subagents` — subagent delegation streams
|
|
2861
|
+
* - `run.middleware` — middleware lifecycle events (before/after agent/model)
|
|
2862
|
+
* - `run.values` — state snapshots (async iterable + promise-like)
|
|
2863
|
+
* - `run.output` — final agent state when the run completes
|
|
2864
|
+
* - `run.subgraphs` — child subgraph run streams
|
|
2865
|
+
* - `run.extensions` — merged projections from user-supplied transformers
|
|
2866
|
+
*
|
|
2867
|
+
* @example
|
|
2868
|
+
* ```typescript
|
|
2869
|
+
* const run = await agent.streamEvents(
|
|
2870
|
+
* {
|
|
2871
|
+
* messages: [{ role: "user", content: "What's the weather in Paris?" }],
|
|
2872
|
+
* },
|
|
2873
|
+
* { version: "v3" }
|
|
2874
|
+
* );
|
|
2875
|
+
*
|
|
2876
|
+
* // Stream all messages
|
|
2877
|
+
* for await (const msg of run.messages) {
|
|
2878
|
+
* for await (const token of msg.text) {
|
|
2879
|
+
* process.stdout.write(token);
|
|
2880
|
+
* }
|
|
2881
|
+
* }
|
|
2882
|
+
*
|
|
2883
|
+
* // Observe tool calls
|
|
2884
|
+
* for await (const call of run.toolCalls) {
|
|
2885
|
+
* console.log(`Tool: ${call.name}`, call.input);
|
|
2886
|
+
* console.log(`Result:`, await call.output);
|
|
2887
|
+
* }
|
|
2888
|
+
*
|
|
2889
|
+
* // Observe subagent delegations
|
|
2890
|
+
* for await (const subagent of run.subagents) {
|
|
2891
|
+
* console.log(`Subagent: ${subagent.name}`);
|
|
2892
|
+
*
|
|
2893
|
+
* for await (const msg of subagent.messages) {
|
|
2894
|
+
* for await (const token of msg.text) {
|
|
2895
|
+
* process.stdout.write(token);
|
|
2896
|
+
* }
|
|
2897
|
+
* }
|
|
2898
|
+
* }
|
|
2899
|
+
*
|
|
2900
|
+
* // Get final state
|
|
2901
|
+
* const state = await run.output;
|
|
2902
|
+
* ```
|
|
2903
|
+
*/
|
|
2904
|
+
streamEvents: ((state: Parameters<ReactAgent<TTypes>["invoke"]>[0], config: NonNullable<Parameters<ReactAgent<TTypes>["invoke"]>[1]> & {
|
|
2905
|
+
version: "v3";
|
|
2906
|
+
}) => Promise<DeepAgentRunStream<Awaited<ReturnType<ReactAgent<TTypes>["invoke"]>>, readonly [...TTypes["Tools"], ...DeepAgentBuiltinToolsTuple], TTypes["Subagents"], InferDeepAgentStreamExtensions<TTypes["StreamTransformers"]>>>) & ReactAgent<TTypes>["streamEvents"];
|
|
2907
|
+
}
|
|
2696
2908
|
/**
|
|
2697
2909
|
* Helper type to resolve a DeepAgentTypeConfig from either:
|
|
2698
2910
|
* - A DeepAgentTypeConfig directly
|
|
@@ -2772,8 +2984,9 @@ type InferSubagentReactAgentType<TSubagent extends SubAgent | CompiledSubAgent>
|
|
|
2772
2984
|
* @typeParam TMiddleware - The middleware array type for proper type inference
|
|
2773
2985
|
* @typeParam TSubagents - The subagents array type for extracting subagent middleware states
|
|
2774
2986
|
* @typeParam TTools - The tools array type
|
|
2987
|
+
* @typeParam TStreamTransformers - Custom stream transformer factories
|
|
2775
2988
|
*/
|
|
2776
|
-
interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = SupportedResponseFormat, ContextSchema extends AnnotationRoot<any> | InteropZodObject = AnnotationRoot<any>, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[], TSubagents extends readonly AnySubAgent[] = readonly AnySubAgent[], TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[]> {
|
|
2989
|
+
interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = SupportedResponseFormat, ContextSchema extends AnnotationRoot<any> | InteropZodObject = AnnotationRoot<any>, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[], TSubagents extends readonly AnySubAgent[] = readonly AnySubAgent[], TTools extends readonly (ClientTool | ServerTool)[] = readonly (ClientTool | ServerTool)[], TStreamTransformers extends ReadonlyArray<() => StreamTransformer<any>> = readonly []> {
|
|
2777
2990
|
/** The model to use (model name string or LanguageModelLike instance). Defaults to claude-sonnet-4-5-20250929 */
|
|
2778
2991
|
model?: BaseLanguageModel | string;
|
|
2779
2992
|
/** Tools the agent should have access to */
|
|
@@ -2868,6 +3081,14 @@ interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = Supp
|
|
|
2868
3081
|
* ```
|
|
2869
3082
|
*/
|
|
2870
3083
|
permissions?: FilesystemPermission[];
|
|
3084
|
+
/**
|
|
3085
|
+
* Optional {@link StreamTransformer} factories to register with the underlying agent.
|
|
3086
|
+
*
|
|
3087
|
+
* Deepagents always registers its built-in subagent transformer; custom
|
|
3088
|
+
* transformers are appended after it and are exposed on `run.extensions`
|
|
3089
|
+
* when using `streamEvents(..., { version: "v3" })`.
|
|
3090
|
+
*/
|
|
3091
|
+
streamTransformers?: TStreamTransformers;
|
|
2871
3092
|
}
|
|
2872
3093
|
//#endregion
|
|
2873
3094
|
//#region src/agent.d.ts
|
|
@@ -2901,7 +3122,7 @@ interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = Supp
|
|
|
2901
3122
|
* // result.research is properly typed as string
|
|
2902
3123
|
* ```
|
|
2903
3124
|
*/
|
|
2904
|
-
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<{
|
|
3125
|
+
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 [], const TStreamTransformers extends ReadonlyArray<() => StreamTransformer<any>> = readonly []>(params?: CreateDeepAgentParams<TResponse, ContextSchema, TMiddleware, TSubagents, TTools, TStreamTransformers>): DeepAgent<DeepAgentTypeConfig<InferStructuredResponse<TResponse>, undefined, ContextSchema, readonly [AgentMiddleware<_$zod_v30.ZodObject<{
|
|
2905
3126
|
todos: _$zod_v30.ZodDefault<_$zod_v30.ZodArray<_$zod_v30.ZodObject<{
|
|
2906
3127
|
content: _$zod_v30.ZodString;
|
|
2907
3128
|
status: _$zod_v30.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
@@ -3059,7 +3280,7 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
3059
3280
|
summaryMessage: z$2.ZodCustom<_messages.HumanMessage<_messages.MessageStructure<_messages.MessageToolSet>>, _messages.HumanMessage<_messages.MessageStructure<_messages.MessageToolSet>>>;
|
|
3060
3281
|
filePath: z$2.ZodNullable<z$2.ZodString>;
|
|
3061
3282
|
}, _$zod_v4_core0.$strip>>;
|
|
3062
|
-
}, _$zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents>>;
|
|
3283
|
+
}, _$zod_v4_core0.$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[]>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[]>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents, TStreamTransformers>>;
|
|
3063
3284
|
//#endregion
|
|
3064
3285
|
//#region src/errors.d.ts
|
|
3065
3286
|
/**
|
|
@@ -3306,5 +3527,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
3306
3527
|
*/
|
|
3307
3528
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
3308
3529
|
//#endregion
|
|
3309
|
-
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 FilesystemOperation, type FilesystemPermission, 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 PermissionMode, 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 StoreBackendContext, type StoreBackendNamespaceFactory, 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 };
|
|
3530
|
+
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 DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, 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 PermissionMode, 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 StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3310
3531
|
//# sourceMappingURL=index.d.ts.map
|