deepagents 1.11.0 → 1.12.0-rc.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/README.md +0 -17
- package/dist/{agent-D0AY-3B9.d.ts → agent-BHm2eFEE.d.ts} +90 -83
- package/dist/{agent-CBuaNmw7.d.cts → agent-a2Rs6dm8.d.cts} +91 -83
- package/dist/browser.cjs +4 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +2 -2
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/{langsmith-C7Ok9lF-.js → langsmith-COC2ZzbQ.js} +310 -427
- package/dist/langsmith-COC2ZzbQ.js.map +1 -0
- package/dist/{langsmith-DDhVumyX.cjs → langsmith-CyORon4P.cjs} +327 -426
- package/dist/langsmith-CyORon4P.cjs.map +1 -0
- package/dist/node.cjs +5 -2
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +3 -3
- package/dist/{src-CmBhLWZw.cjs → src-2FgDsCyk.cjs} +3 -4
- package/dist/src-2FgDsCyk.cjs.map +1 -0
- package/dist/{src-CokGewqt.js → src-sRjmLlgg.js} +3 -4
- package/dist/src-sRjmLlgg.js.map +1 -0
- package/package.json +2 -2
- package/dist/langsmith-C7Ok9lF-.js.map +0 -1
- package/dist/langsmith-DDhVumyX.cjs.map +0 -1
- package/dist/src-CmBhLWZw.cjs.map +0 -1
- package/dist/src-CokGewqt.js.map +0 -1
package/README.md
CHANGED
|
@@ -107,23 +107,6 @@ const agent = createDeepAgent({
|
|
|
107
107
|
});
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
A string is placed before the built-in Deep Agent prompt. For full control over
|
|
111
|
-
prompt assembly, provide a structured configuration:
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
const agent = createDeepAgent({
|
|
115
|
-
systemPrompt: {
|
|
116
|
-
prefix: "You are the support assistant for Acme.",
|
|
117
|
-
base: null, // Remove the built-in Deep Agent prompt.
|
|
118
|
-
suffix: "Follow Acme's escalation policy.",
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Structured prompts are assembled as `prefix` → `base` → `suffix`, followed by
|
|
124
|
-
any model-specific harness profile suffix. Omit `base` to retain the active
|
|
125
|
-
base prompt, or set it to `null` to remove the base entirely.
|
|
126
|
-
|
|
127
110
|
See the [JavaScript Deep Agents docs](https://docs.langchain.com/oss/javascript/deepagents/overview) for full configuration options.
|
|
128
111
|
|
|
129
112
|
## LangGraph Native
|
|
@@ -15,7 +15,6 @@ import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_m
|
|
|
15
15
|
import { Runnable } from "@langchain/core/runnables";
|
|
16
16
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
17
17
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
18
|
-
|
|
19
18
|
//#region src/backends/v1/protocol.d.ts
|
|
20
19
|
/**
|
|
21
20
|
* Protocol for pluggable memory backends (single, unified).
|
|
@@ -77,7 +76,7 @@ interface BackendProtocolV1 {
|
|
|
77
76
|
*/
|
|
78
77
|
globInfo(pattern: string, path?: string): MaybePromise<FileInfo[]>;
|
|
79
78
|
/**
|
|
80
|
-
*
|
|
79
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
81
80
|
*
|
|
82
81
|
* @param filePath - Absolute file path
|
|
83
82
|
* @param content - File content as string
|
|
@@ -181,6 +180,14 @@ interface BackendProtocolV2 extends Omit<BackendProtocolV1, "read" | "readRaw" |
|
|
|
181
180
|
* @returns ReadRawResult with raw file data on success or error on failure
|
|
182
181
|
*/
|
|
183
182
|
readRaw(filePath: string): MaybePromise<ReadRawResult>;
|
|
183
|
+
/**
|
|
184
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
185
|
+
*
|
|
186
|
+
* @param filePath - Absolute file path
|
|
187
|
+
* @param content - File content as string
|
|
188
|
+
* @returns WriteResult with error populated on failure
|
|
189
|
+
*/
|
|
190
|
+
write(filePath: string, content: string): MaybePromise<WriteResult>;
|
|
184
191
|
/**
|
|
185
192
|
* Search file contents for a literal text pattern.
|
|
186
193
|
*
|
|
@@ -582,7 +589,17 @@ interface SandboxDeleteOptions {
|
|
|
582
589
|
* type MySandboxErrorCode = SandboxErrorCode | "CUSTOM_ERROR";
|
|
583
590
|
* ```
|
|
584
591
|
*/
|
|
585
|
-
type SandboxErrorCode =
|
|
592
|
+
type SandboxErrorCode =
|
|
593
|
+
/** Sandbox has not been initialized - call initialize() first */
|
|
594
|
+
"NOT_INITIALIZED" |
|
|
595
|
+
/** Sandbox is already initialized - cannot initialize twice */
|
|
596
|
+
"ALREADY_INITIALIZED" |
|
|
597
|
+
/** Command execution timed out */
|
|
598
|
+
"COMMAND_TIMEOUT" |
|
|
599
|
+
/** Command execution failed */
|
|
600
|
+
"COMMAND_FAILED" |
|
|
601
|
+
/** File operation (read/write) failed */
|
|
602
|
+
"FILE_OPERATION_FAILED";
|
|
586
603
|
declare const SANDBOX_ERROR_SYMBOL: unique symbol;
|
|
587
604
|
/**
|
|
588
605
|
* Custom error class for sandbox operations.
|
|
@@ -781,13 +798,7 @@ type FilesRecordUpdate = Record<string, FileData | null>;
|
|
|
781
798
|
interface FilesystemMiddlewareOptions {
|
|
782
799
|
/** Backend instance or factory (default: StateBackend) */
|
|
783
800
|
backend?: AnyBackendProtocol | BackendFactory;
|
|
784
|
-
/**
|
|
785
|
-
* Optional filesystem-specific system prompt override.
|
|
786
|
-
*
|
|
787
|
-
* When omitted, the middleware generates a prompt that reflects the tools
|
|
788
|
-
* visible for the current model request. Supplying a custom prompt replaces
|
|
789
|
-
* that generated filesystem prompt entirely.
|
|
790
|
-
*/
|
|
801
|
+
/** Optional filesystem-specific usage guidance. Omitted by default because tool schemas provide it. */
|
|
791
802
|
systemPrompt?: string | null;
|
|
792
803
|
/**
|
|
793
804
|
* Optional descriptions for built-in filesystem tools.
|
|
@@ -810,8 +821,6 @@ interface FilesystemMiddlewareOptions {
|
|
|
810
821
|
* command execution, even if it appears in this allowlist.
|
|
811
822
|
* - User-provided non-filesystem tools are not affected by this allowlist.
|
|
812
823
|
*
|
|
813
|
-
* The generated filesystem system prompt is based on the tools that remain
|
|
814
|
-
* visible after this allowlist and backend capability filtering are applied.
|
|
815
824
|
*
|
|
816
825
|
* @example Read/search-only filesystem access
|
|
817
826
|
* ```ts
|
|
@@ -846,7 +855,7 @@ interface FilesystemMiddlewareOptions {
|
|
|
846
855
|
permissions?: FilesystemPermission[];
|
|
847
856
|
}
|
|
848
857
|
/**
|
|
849
|
-
* Create middleware that provides built-in filesystem tools and
|
|
858
|
+
* Create middleware that provides built-in filesystem tools and optional custom
|
|
850
859
|
* prompt guidance.
|
|
851
860
|
*
|
|
852
861
|
* By default, the middleware registers every built-in filesystem tool listed in
|
|
@@ -857,9 +866,7 @@ interface FilesystemMiddlewareOptions {
|
|
|
857
866
|
*
|
|
858
867
|
* The middleware also filters tools whose backend capabilities are unavailable
|
|
859
868
|
* at request time. In particular, `execute` is only visible when the resolved
|
|
860
|
-
* backend supports command execution.
|
|
861
|
-
* the final visible filesystem tools so the model is not instructed to call
|
|
862
|
-
* tools it cannot see.
|
|
869
|
+
* backend supports command execution.
|
|
863
870
|
*
|
|
864
871
|
* @param options Filesystem middleware configuration.
|
|
865
872
|
* @returns Agent middleware that contributes filesystem state, tools, prompt
|
|
@@ -880,7 +887,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
880
887
|
path: string;
|
|
881
888
|
}, {
|
|
882
889
|
path?: string | undefined;
|
|
883
|
-
}, string
|
|
890
|
+
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "ls"> | _langchain.DynamicStructuredTool<z.ZodPreprocess<z.ZodObject<{
|
|
884
891
|
file_path: z.ZodString;
|
|
885
892
|
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
886
893
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -888,7 +895,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
888
895
|
file_path: string;
|
|
889
896
|
offset: number;
|
|
890
897
|
limit: number;
|
|
891
|
-
}, unknown, {
|
|
898
|
+
}, unknown, ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | {
|
|
892
899
|
type: string;
|
|
893
900
|
text: string;
|
|
894
901
|
}[] | {
|
|
@@ -919,14 +926,14 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
919
926
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
920
927
|
}, string>, unknown, "edit_file"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
921
928
|
pattern: z.ZodString;
|
|
922
|
-
path: z.
|
|
929
|
+
path: z.ZodOptional<z.ZodString>;
|
|
923
930
|
}, z.core.$strip>, {
|
|
924
931
|
pattern: string;
|
|
925
|
-
path
|
|
932
|
+
path?: string | undefined;
|
|
926
933
|
}, {
|
|
927
934
|
pattern: string;
|
|
928
935
|
path?: string | undefined;
|
|
929
|
-
}, string
|
|
936
|
+
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "glob"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
930
937
|
pattern: z.ZodString;
|
|
931
938
|
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
932
939
|
glob: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
@@ -938,7 +945,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
938
945
|
pattern: string;
|
|
939
946
|
path?: string | undefined;
|
|
940
947
|
glob?: string | null | undefined;
|
|
941
|
-
}, string
|
|
948
|
+
}, string | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "grep"> | _langchain.DynamicStructuredTool<z.ZodObject<{
|
|
942
949
|
command: z.ZodString;
|
|
943
950
|
}, z.core.$strip>, {
|
|
944
951
|
command: string;
|
|
@@ -946,6 +953,42 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
946
953
|
command: string;
|
|
947
954
|
}, string, unknown, "execute">)[], readonly []>;
|
|
948
955
|
//#endregion
|
|
956
|
+
//#region src/compat.d.ts
|
|
957
|
+
/**
|
|
958
|
+
* @deprecated Compatibility type for the former structured `systemPrompt` API.
|
|
959
|
+
* Existing callers may continue using it, but new code should pass a string or
|
|
960
|
+
* `SystemMessage` directly. This type and its compatibility behavior will be
|
|
961
|
+
* removed in the next major release.
|
|
962
|
+
*/
|
|
963
|
+
interface SystemPromptConfig {
|
|
964
|
+
/** Content placed before the profile base prompt. */
|
|
965
|
+
prefix?: string | SystemMessage | null;
|
|
966
|
+
/** Replacement for the profile base prompt; `null` omits that base. */
|
|
967
|
+
base?: string | SystemMessage | null;
|
|
968
|
+
/** Content placed after the base prompt and before the profile suffix. */
|
|
969
|
+
suffix?: string | SystemMessage | null;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* @deprecated Retained for compatibility only. This prompt is not injected by
|
|
973
|
+
* default and will be removed in the next major release.
|
|
974
|
+
*/
|
|
975
|
+
declare const BASE_AGENT_PROMPT: string;
|
|
976
|
+
/**
|
|
977
|
+
* @deprecated Retained for compatibility only. Task-tool guidance now lives in
|
|
978
|
+
* the task tool schema and this export will be removed in the next major release.
|
|
979
|
+
*/
|
|
980
|
+
declare const TASK_SYSTEM_PROMPT: string;
|
|
981
|
+
/**
|
|
982
|
+
* @deprecated Retained for compatibility only. Async-subagent guidance now
|
|
983
|
+
* lives in tool schemas and this export will be removed in the next major release.
|
|
984
|
+
*/
|
|
985
|
+
declare const ASYNC_TASK_SYSTEM_PROMPT = "## Async subagents (remote servers)\n\nYou have access to async subagent tools that launch background tasks on remote servers.\n\n### Tools:\n- `start_async_task`: Start a new background task. Returns a task ID immediately.\n- `check_async_task`: Check the status of a running task. Returns status and result if complete.\n- `update_async_task`: Send an update or new instructions to a running task.\n- `cancel_async_task`: Cancel a running task that is no longer needed.\n- `list_async_tasks`: List all tracked tasks with live statuses. Use this to check all tasks at once.\n\n### Workflow:\n1. **Launch** — Use `start_async_task` to start a task. Report the task ID to the user and stop.\n Do NOT immediately check the status — the task runs in the background while you and the user continue other work.\n2. **Check (on request)** — Only use `check_async_task` when the user explicitly asks for a status update or\n result. If the status is \"running\", report that and stop — do not poll in a loop.\n3. **Update** (optional) — Use `update_async_task` to send new instructions to a running task. This interrupts\n the current run and starts a fresh one on the same thread. The task_id stays the same.\n4. **Cancel** (optional) — Use `cancel_async_task` to stop a task that is no longer needed.\n5. **Collect** — When `check_async_task` returns status \"success\", the result is included in the response.\n6. **List** — Use `list_async_tasks` to see live statuses for all tasks at once, or to recall task IDs after context compaction.\n\n### Critical rules:\n- After launching, ALWAYS return control to the user immediately. Never auto-check after launching.\n- Never poll `check_async_task` in a loop. Check once per user request, then stop.\n- If a check returns \"running\", tell the user and wait for them to ask again.\n- Task statuses in conversation history are ALWAYS stale — a task that was \"running\" may now be done.\n NEVER report a status from a previous tool result. ALWAYS call a tool to get the current status:\n use `list_async_tasks` when the user asks about multiple tasks or \"all tasks\",\n use `check_async_task` when the user asks about a specific task.\n- Always show the full task_id — never truncate or abbreviate it.\n\n### When to use async subagents:\n- Long-running tasks that would block the main agent\n- Tasks that benefit from running on specialized remote deployments\n- When you want to run multiple tasks concurrently and collect results later";
|
|
986
|
+
/**
|
|
987
|
+
* @deprecated Retained for compatibility only. Execute guidance now lives in
|
|
988
|
+
* the execute tool schema and this export will be removed in the next major release.
|
|
989
|
+
*/
|
|
990
|
+
declare const EXECUTION_SYSTEM_PROMPT: string;
|
|
991
|
+
//#endregion
|
|
949
992
|
//#region src/errors.d.ts
|
|
950
993
|
/**
|
|
951
994
|
* Error codes for {@link ConfigurationError}.
|
|
@@ -1040,13 +1083,13 @@ interface GeneralPurposeSubagentConfig {
|
|
|
1040
1083
|
*/
|
|
1041
1084
|
interface HarnessProfileOptions {
|
|
1042
1085
|
/**
|
|
1043
|
-
* Replaces the default
|
|
1086
|
+
* Replaces the default empty base prompt when set.
|
|
1044
1087
|
*
|
|
1045
1088
|
* Use this when a model requires a fundamentally different base
|
|
1046
1089
|
* prompt rather than an additive suffix. Most profiles should prefer
|
|
1047
1090
|
* `systemPromptSuffix` instead.
|
|
1048
1091
|
*
|
|
1049
|
-
* @default undefined (keeps the default base prompt)
|
|
1092
|
+
* @default undefined (keeps the default empty base prompt)
|
|
1050
1093
|
*/
|
|
1051
1094
|
baseSystemPrompt?: string;
|
|
1052
1095
|
/**
|
|
@@ -1124,7 +1167,7 @@ interface HarnessProfileOptions {
|
|
|
1124
1167
|
*/
|
|
1125
1168
|
interface HarnessProfile {
|
|
1126
1169
|
/**
|
|
1127
|
-
* Replaces the default
|
|
1170
|
+
* Replaces the default empty base prompt when set.
|
|
1128
1171
|
*
|
|
1129
1172
|
* Use this when a model requires a fundamentally different base
|
|
1130
1173
|
* prompt rather than an additive suffix. Most profiles should prefer
|
|
@@ -1359,20 +1402,6 @@ declare const DEFAULT_SUBAGENT_PROMPT = "In order to complete the objective that
|
|
|
1359
1402
|
* This description is shown to the model when selecting which subagent to use.
|
|
1360
1403
|
*/
|
|
1361
1404
|
declare const DEFAULT_GENERAL_PURPOSE_DESCRIPTION = "General-purpose agent for researching complex questions, searching for files and content, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. This agent has access to all tools as the main agent.";
|
|
1362
|
-
/**
|
|
1363
|
-
* System prompt section that explains how to use the task tool for spawning subagents.
|
|
1364
|
-
*
|
|
1365
|
-
* This prompt is automatically appended to the main agent's system prompt when
|
|
1366
|
-
* using `createSubAgentMiddleware`. It provides guidance on:
|
|
1367
|
-
* - When to use the task tool
|
|
1368
|
-
* - Subagent lifecycle (spawn → run → return → reconcile)
|
|
1369
|
-
* - When NOT to use the task tool
|
|
1370
|
-
* - Best practices for parallel task execution
|
|
1371
|
-
*
|
|
1372
|
-
* You can provide a custom `systemPrompt` to `createSubAgentMiddleware` to override
|
|
1373
|
-
* or extend this default.
|
|
1374
|
-
*/
|
|
1375
|
-
declare const TASK_SYSTEM_PROMPT: string;
|
|
1376
1405
|
/**
|
|
1377
1406
|
* Type definitions for pre-compiled agents.
|
|
1378
1407
|
*
|
|
@@ -1709,7 +1738,7 @@ declare class StateBackend implements BackendProtocolV2 {
|
|
|
1709
1738
|
*/
|
|
1710
1739
|
readRaw(filePath: string): ReadRawResult;
|
|
1711
1740
|
/**
|
|
1712
|
-
*
|
|
1741
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
1713
1742
|
* Returns WriteResult with filesUpdate to update LangGraph state.
|
|
1714
1743
|
*/
|
|
1715
1744
|
write(filePath: string, content: string): WriteResult;
|
|
@@ -2208,8 +2237,8 @@ declare const ASYNC_TASK_TOOL_NAMES: readonly ["start_async_task", "check_async_
|
|
|
2208
2237
|
interface AsyncSubAgentMiddlewareOptions {
|
|
2209
2238
|
/** List of async subagent specifications. Must have at least one. */
|
|
2210
2239
|
asyncSubAgents: AsyncSubAgent[];
|
|
2211
|
-
/**
|
|
2212
|
-
systemPrompt?: string;
|
|
2240
|
+
/** Optional system prompt override. Tool schemas provide the built-in guidance. */
|
|
2241
|
+
systemPrompt?: string | null;
|
|
2213
2242
|
}
|
|
2214
2243
|
/**
|
|
2215
2244
|
* Create middleware that adds async subagent tools to an agent.
|
|
@@ -2323,7 +2352,7 @@ type BuiltinToolPlaceholder<N extends string> = {
|
|
|
2323
2352
|
* Tuple of placeholder tool types for all built-in deep agent tools.
|
|
2324
2353
|
* Combined with `TTypes["Tools"]` in the `DeepAgentRunStream` return type.
|
|
2325
2354
|
*/
|
|
2326
|
-
type DeepAgentBuiltinToolsTuple = { [K in DeepAgentBuiltinToolName]: BuiltinToolPlaceholder<K
|
|
2355
|
+
type DeepAgentBuiltinToolsTuple = { [K in DeepAgentBuiltinToolName]: BuiltinToolPlaceholder<K>; }[DeepAgentBuiltinToolName][];
|
|
2327
2356
|
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>;
|
|
2328
2357
|
/** Any subagent specification — sync, compiled, or async. */
|
|
2329
2358
|
type AnySubAgent = SubAgent | CompiledSubAgent | AsyncSubAgent;
|
|
@@ -2588,25 +2617,6 @@ type InferSubagentByName<T, TName extends string> = InferDeepAgentSubagents<T> e
|
|
|
2588
2617
|
* ```
|
|
2589
2618
|
*/
|
|
2590
2619
|
type InferSubagentReactAgentType<TSubagent extends SubAgent | CompiledSubAgent> = TSubagent extends CompiledSubAgent ? TSubagent["runnable"] : TSubagent extends SubAgent ? ReactAgent<AgentTypeConfig<ResponseFormatUndefined, undefined, AnyAnnotationRoot, ExtractSubAgentMiddleware<TSubagent>, readonly []>> : never;
|
|
2591
|
-
/**
|
|
2592
|
-
* Structured system prompt configuration for {@link createDeepAgent}.
|
|
2593
|
-
*
|
|
2594
|
-
* Prompt parts are assembled in the order `prefix` → `base` → `suffix`,
|
|
2595
|
-
* followed by any model-specific harness profile suffix.
|
|
2596
|
-
*/
|
|
2597
|
-
interface SystemPromptConfig {
|
|
2598
|
-
/** Content placed before the base prompt. */
|
|
2599
|
-
prefix?: string | SystemMessage | null;
|
|
2600
|
-
/**
|
|
2601
|
-
* Replacement for the active base prompt.
|
|
2602
|
-
*
|
|
2603
|
-
* Omit this field to retain the harness profile base or built-in base prompt.
|
|
2604
|
-
* Set it to `null` to omit the base prompt entirely.
|
|
2605
|
-
*/
|
|
2606
|
-
base?: string | SystemMessage | null;
|
|
2607
|
-
/** Content placed after the base prompt and before any harness profile suffix. */
|
|
2608
|
-
suffix?: string | SystemMessage | null;
|
|
2609
|
-
}
|
|
2610
2620
|
/**
|
|
2611
2621
|
* Configuration parameters for creating a Deep Agent
|
|
2612
2622
|
* Matches Python's create_deep_agent parameters
|
|
@@ -2625,11 +2635,8 @@ interface CreateDeepAgentParams<TResponse extends SupportedResponseFormat = Supp
|
|
|
2625
2635
|
/** Tools the agent should have access to */
|
|
2626
2636
|
tools?: TTools | StructuredTool$1[];
|
|
2627
2637
|
/**
|
|
2628
|
-
* Custom system instructions
|
|
2629
|
-
*
|
|
2630
|
-
* A string or {@link SystemMessage} is placed before the active base prompt.
|
|
2631
|
-
* For more control, provide a {@link SystemPromptConfig} to replace or remove
|
|
2632
|
-
* the base prompt and add content after it.
|
|
2638
|
+
* Custom system instructions. Structured configuration is deprecated and
|
|
2639
|
+
* retained only for source compatibility.
|
|
2633
2640
|
*/
|
|
2634
2641
|
systemPrompt?: string | SystemMessage | SystemPromptConfig;
|
|
2635
2642
|
/**
|
|
@@ -2793,7 +2800,7 @@ type NamedSubagentRunStream<T extends AnySubAgent> = T extends {
|
|
|
2793
2800
|
* subagent in `TSubagents`. Enables TypeScript to narrow `.output`
|
|
2794
2801
|
* when the consumer checks `sub.name === "someSubagentName"`.
|
|
2795
2802
|
*/
|
|
2796
|
-
type SubagentRunStreamUnion<TSubagents extends readonly AnySubAgent[]> = { [K in keyof TSubagents]: NamedSubagentRunStream<TSubagents[K]
|
|
2803
|
+
type SubagentRunStreamUnion<TSubagents extends readonly AnySubAgent[]> = { [K in keyof TSubagents]: NamedSubagentRunStream<TSubagents[K]>; }[number];
|
|
2797
2804
|
/**
|
|
2798
2805
|
* An {@link AgentRunStream} whose `subagents` projection is narrowed to the
|
|
2799
2806
|
* deep agent's declared subagents.
|
|
@@ -2804,7 +2811,8 @@ type SubagentRunStreamUnion<TSubagents extends readonly AnySubAgent[]> = { [K in
|
|
|
2804
2811
|
* the generic `SubagentRunStream` to the typed {@link SubagentRunStreamUnion}.
|
|
2805
2812
|
*/
|
|
2806
2813
|
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>> = Omit<AgentRunStream<TValues, TTools, TExtensions>, "subagents"> & {
|
|
2807
|
-
/** Declared-subagent invocation streams from `createAgent`'s transformer. */
|
|
2814
|
+
/** Declared-subagent invocation streams from `createAgent`'s transformer. */
|
|
2815
|
+
subagents: AsyncIterable<SubagentRunStreamUnion<TSubagents>>;
|
|
2808
2816
|
};
|
|
2809
2817
|
//#endregion
|
|
2810
2818
|
//#region src/config.d.ts
|
|
@@ -3191,7 +3199,7 @@ declare class StoreBackend implements BackendProtocolV2 {
|
|
|
3191
3199
|
*/
|
|
3192
3200
|
readRaw(filePath: string): Promise<ReadRawResult>;
|
|
3193
3201
|
/**
|
|
3194
|
-
*
|
|
3202
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
3195
3203
|
* Returns WriteResult. External storage sets filesUpdate=null.
|
|
3196
3204
|
*/
|
|
3197
3205
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
@@ -3296,7 +3304,7 @@ declare class FilesystemBackend implements BackendProtocolV2 {
|
|
|
3296
3304
|
*/
|
|
3297
3305
|
readRaw(filePath: string): Promise<ReadRawResult>;
|
|
3298
3306
|
/**
|
|
3299
|
-
*
|
|
3307
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
3300
3308
|
* Returns WriteResult. External storage sets filesUpdate=null.
|
|
3301
3309
|
*/
|
|
3302
3310
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
@@ -3441,7 +3449,7 @@ declare class CompositeBackend implements BackendProtocolV2 {
|
|
|
3441
3449
|
*/
|
|
3442
3450
|
glob(pattern: string, path?: string): Promise<GlobResult>;
|
|
3443
3451
|
/**
|
|
3444
|
-
*
|
|
3452
|
+
* Write content to a file, routing to appropriate backend.
|
|
3445
3453
|
*
|
|
3446
3454
|
* @param filePath - Absolute file path
|
|
3447
3455
|
* @param content - File content as string
|
|
@@ -3785,10 +3793,9 @@ declare abstract class BaseSandbox implements SandboxBackendProtocolV2 {
|
|
|
3785
3793
|
*/
|
|
3786
3794
|
glob(pattern: string, path?: string): Promise<GlobResult>;
|
|
3787
3795
|
/**
|
|
3788
|
-
*
|
|
3796
|
+
* Write content to a file, creating it or overwriting it if it already exists.
|
|
3789
3797
|
*
|
|
3790
|
-
* Uses
|
|
3791
|
-
* No runtime needed on the sandbox host.
|
|
3798
|
+
* Uses uploadFiles() to write. No runtime needed on the sandbox host.
|
|
3792
3799
|
*/
|
|
3793
3800
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
3794
3801
|
/**
|
|
@@ -4067,7 +4074,7 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4067
4074
|
path: string;
|
|
4068
4075
|
}, {
|
|
4069
4076
|
path?: string | undefined;
|
|
4070
|
-
}, string
|
|
4077
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "ls"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
4071
4078
|
file_path: import("zod").ZodString;
|
|
4072
4079
|
offset: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
4073
4080
|
limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
@@ -4075,7 +4082,7 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4075
4082
|
file_path: string;
|
|
4076
4083
|
offset: number;
|
|
4077
4084
|
limit: number;
|
|
4078
|
-
}, unknown, {
|
|
4085
|
+
}, unknown, _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>> | {
|
|
4079
4086
|
type: string;
|
|
4080
4087
|
text: string;
|
|
4081
4088
|
}[] | {
|
|
@@ -4106,14 +4113,14 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4106
4113
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
4107
4114
|
}, string>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
4108
4115
|
pattern: import("zod").ZodString;
|
|
4109
|
-
path: import("zod").
|
|
4116
|
+
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4110
4117
|
}, import("zod/v4/core").$strip>, {
|
|
4111
4118
|
pattern: string;
|
|
4112
|
-
path
|
|
4119
|
+
path?: string | undefined;
|
|
4113
4120
|
}, {
|
|
4114
4121
|
pattern: string;
|
|
4115
4122
|
path?: string | undefined;
|
|
4116
|
-
}, string
|
|
4123
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "glob"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
4117
4124
|
pattern: import("zod").ZodString;
|
|
4118
4125
|
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
4119
4126
|
glob: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>>;
|
|
@@ -4125,7 +4132,7 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4125
4132
|
pattern: string;
|
|
4126
4133
|
path?: string | undefined;
|
|
4127
4134
|
glob?: string | null | undefined;
|
|
4128
|
-
}, string
|
|
4135
|
+
}, string | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "grep"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
4129
4136
|
command: import("zod").ZodString;
|
|
4130
4137
|
}, import("zod/v4/core").$strip>, {
|
|
4131
4138
|
command: string;
|
|
@@ -4149,5 +4156,5 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4149
4156
|
}, import("zod/v4/core").$strip>>;
|
|
4150
4157
|
}, import("zod/v4/core").$strip>, undefined, unknown, readonly (ClientTool | ServerTool)[], readonly []>, AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[], readonly []>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents, TStreamTransformers>>;
|
|
4151
4158
|
//#endregion
|
|
4152
|
-
export {
|
|
4153
|
-
//# sourceMappingURL=agent-
|
|
4159
|
+
export { createAsyncSubAgentMiddleware as $, BackendRuntime as $t, findProjectRoot as A, BackendProtocolV1 as An, serializeProfile as At, InferDeepAgentSubagents as B, BASE_AGENT_PROMPT as Bt, parseSkillMetadata as C, StateAndStore as Cn, createSubAgentMiddleware as Ct, Settings as D, resolveBackend as Dn, generalPurposeSubagentConfigSchema as Dt, filesValue as E, isSandboxProtocol as En, HarnessProfileConfigData as Et, DeepAgent as F, HarnessProfileOptions as Ft, InferSubagentReactAgentType as G, FsToolName as Gt, InferStructuredResponse as H, SystemPromptConfig as Ht, DeepAgentTypeConfig as I, REQUIRED_MIDDLEWARE_NAMES as It, SupportedResponseFormat as J, FilesystemPermission as Jt, MergedDeepAgentState as K, createFilesystemMiddleware as Kt, DefaultDeepAgentTypeConfig as L, ConfigurationError as Lt, SubagentRunStream$1 as M, createHarnessProfile as Mt, AnySubAgent as N, GeneralPurposeSubagentConfig as Nt, SettingsOptions as O, BackendProtocolV2 as On, harnessProfileConfigSchema as Ot, CreateDeepAgentParams as P, HarnessProfile as Pt, AsyncTaskStatus as Q, BackendProtocol as Qt, ExtractSubAgentMiddleware as R, ConfigurationErrorCode as Rt, listSkills as S, SandboxListResponse as Sn, createSubAgent as St, createAgentMemoryMiddleware as T, isSandboxBackend as Tn, registerHarnessProfile as Tt, InferSubAgentMiddlewareStates as U, TASK_SYSTEM_PROMPT as Ut, InferDeepAgentType as V, EXECUTION_SYSTEM_PROMPT as Vt, InferSubagentByName as W, FilesystemMiddlewareOptions as Wt, AsyncSubAgentMiddlewareOptions as X, AnyBackendProtocol as Xt, AsyncSubAgent as Y, PermissionMode as Yt, AsyncTask as Z, BackendFactory as Zt, StoreBackendContext as _, SandboxError as _n, DEFAULT_SUBAGENT_PROMPT as _t, adaptBackendProtocol as a, FileInfo as an, MAX_SKILL_DESCRIPTION_LENGTH as at, ListSkillsOptions as b, SandboxInfo as bn, SubAgent as bt, LangSmithSandboxCreateOptions as c, GlobResult as cn, SkillMetadata$1 as ct, LocalShellBackend as d, LsResult as dn, MemoryMiddlewareOptions as dt, DeleteResult as en, isAsyncSubAgent as et, LocalShellBackendOptions as f, MaybePromise as fn, createMemoryMiddleware as ft, StoreBackend as g, SandboxDeleteOptions as gn, DEFAULT_GENERAL_PURPOSE_DESCRIPTION as gt, FilesystemBackend as h, SandboxBackendProtocol as hn, CompiledSubAgent as ht, LangSmithStartSandboxOptions as i, FileDownloadResponse as in, createCompletionCallbackMiddleware as it, DeepAgentRunStream as j, SandboxBackendProtocolV1 as jn, EMPTY_HARNESS_PROFILE as jt, createSettings as k, SandboxBackendProtocolV2 as kn, parseHarnessProfileConfig as kt, LangSmithSandboxOptions as l, GrepMatch as ln, SkillsMiddlewareOptions as lt, CompositeBackend as m, ReadResult as mn, createPatchToolCallsMiddleware as mt, LangSmithCaptureSnapshotOptions as n, ExecuteResponse as nn, createSummarizationMiddleware as nt, adaptSandboxProtocol as o, FileOperationError as on, MAX_SKILL_FILE_SIZE as ot, ContextHubBackend as p, ReadRawResult as pn, StateBackend as pt, ResolveDeepAgentTypeConfig as q, FilesystemOperation as qt, LangSmithSnapshot as r, FileData as rn, CompletionCallbackOptions as rt, LangSmithSandbox as s, FileUploadResponse as sn, MAX_SKILL_NAME_LENGTH as st, createDeepAgent as t, EditResult as tn, computeSummarizationDefaults as tt, BaseSandbox as u, GrepResult as un, createSkillsMiddleware as ut, StoreBackendNamespaceFactory as v, SandboxErrorCode as vn, GENERAL_PURPOSE_SUBAGENT as vt, AgentMemoryMiddlewareOptions as w, WriteResult as wn, getHarnessProfile as wt, SkillMetadata as x, SandboxListOptions as xn, SubAgentMiddlewareOptions as xt, StoreBackendOptions as y, SandboxGetOrCreateOptions as yn, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY as yt, FlattenSubAgentMiddleware as z, ASYNC_TASK_SYSTEM_PROMPT as zt };
|
|
4160
|
+
//# sourceMappingURL=agent-BHm2eFEE.d.ts.map
|