deepagents 1.12.4 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-BNyBUA4W.d.ts → agent-D50BBbJT.d.ts} +204 -73
- package/dist/{agent-DMJjn99p.d.cts → agent-HW8KptlB.d.cts} +204 -73
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{langsmith-BJ2PdYqB.cjs → langsmith-Ck9t7AGW.cjs} +2551 -2117
- package/dist/langsmith-Ck9t7AGW.cjs.map +1 -0
- package/dist/{langsmith-DRyafCNe.js → langsmith-zm0ILQsV.js} +2549 -2115
- package/dist/langsmith-zm0ILQsV.js.map +1 -0
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/{src-eTaw7gha.cjs → src-C97zNx7s.cjs} +40 -29
- package/dist/src-C97zNx7s.cjs.map +1 -0
- package/dist/{src-DMHrmLGK.js → src-C9o7b5C6.js} +40 -29
- package/dist/src-C9o7b5C6.js.map +1 -0
- package/package.json +10 -10
- package/dist/langsmith-BJ2PdYqB.cjs.map +0 -1
- package/dist/langsmith-DRyafCNe.js.map +0 -1
- package/dist/src-DMHrmLGK.js.map +0 -1
- package/dist/src-eTaw7gha.cjs.map +0 -1
|
@@ -94,10 +94,14 @@ interface BackendProtocolV1 {
|
|
|
94
94
|
*/
|
|
95
95
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): MaybePromise<EditResult>;
|
|
96
96
|
/**
|
|
97
|
-
* Delete a
|
|
97
|
+
* Delete a path, recursively removing anything nested under it.
|
|
98
98
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
99
|
+
* This method is optional. Backends that do not implement it should omit it;
|
|
100
|
+
* callers that need broad backend compatibility should check for support before
|
|
101
|
+
* calling.
|
|
102
|
+
*
|
|
103
|
+
* @param filePath - Absolute path to delete (a file, or a directory/prefix to remove recursively).
|
|
104
|
+
* @returns DeleteResult with path on success or error on failure.
|
|
101
105
|
*/
|
|
102
106
|
delete?(filePath: string): MaybePromise<DeleteResult>;
|
|
103
107
|
/**
|
|
@@ -210,7 +214,7 @@ interface BackendProtocolV2 extends Omit<BackendProtocolV1, "read" | "readRaw" |
|
|
|
210
214
|
*/
|
|
211
215
|
glob(pattern: string, path?: string): MaybePromise<GlobResult>;
|
|
212
216
|
/**
|
|
213
|
-
* Delete a
|
|
217
|
+
* Delete a file or directory recursively.
|
|
214
218
|
* Optional - backends that don't support file deletion can omit this.
|
|
215
219
|
*
|
|
216
220
|
* @param filePath - Absolute path to the file to delete
|
|
@@ -444,8 +448,23 @@ interface EditResult {
|
|
|
444
448
|
interface DeleteResult {
|
|
445
449
|
/** Error message on failure, undefined on success */
|
|
446
450
|
error?: string;
|
|
447
|
-
/** File path of deleted file, undefined on failure */
|
|
451
|
+
/** File path of deleted file or directory, undefined on failure */
|
|
448
452
|
path?: string;
|
|
453
|
+
/**
|
|
454
|
+
* State update dict for checkpoint backends, null for external storage.
|
|
455
|
+
* Deletions are represented as null values keyed by removed path.
|
|
456
|
+
*
|
|
457
|
+
* @deprecated Only the deprecated legacy (runtime-injected) `StateBackend`
|
|
458
|
+
* still populates this field. A modern zero-argument `StateBackend` publishes
|
|
459
|
+
* its own deletion markers through LangGraph's `__pregel_send` channel and
|
|
460
|
+
* returns only `path`, so callers no longer need to apply a `Command` from
|
|
461
|
+
* this value. The delete tool and `CompositeBackend` continue to honor it
|
|
462
|
+
* while the legacy `StateBackend` constructor remains supported; it will be
|
|
463
|
+
* removed alongside that constructor.
|
|
464
|
+
*/
|
|
465
|
+
filesUpdate?: Record<string, null> | null;
|
|
466
|
+
/** Metadata for the delete operation, attached to the ToolMessage */
|
|
467
|
+
metadata?: Record<string, unknown>;
|
|
449
468
|
}
|
|
450
469
|
/**
|
|
451
470
|
* Result of code execution.
|
|
@@ -799,7 +818,7 @@ interface FilesystemPermission {
|
|
|
799
818
|
* truncate the result of read_file, the agent may then attempt to re-read the
|
|
800
819
|
* truncated file using read_file again, which won't help.
|
|
801
820
|
*
|
|
802
|
-
* 3. Tools that never exceed limits (edit_file, write_file):
|
|
821
|
+
* 3. Tools that never exceed limits (edit_file, write_file, delete):
|
|
803
822
|
* These tools return minimal confirmation messages and are never expected to produce
|
|
804
823
|
* output large enough to exceed token limits, so checking them would be unnecessary.
|
|
805
824
|
*/
|
|
@@ -808,7 +827,7 @@ interface FilesystemPermission {
|
|
|
808
827
|
* This is the single source of truth — used by createDeepAgent to detect
|
|
809
828
|
* collisions with user-supplied tools at construction time.
|
|
810
829
|
*/
|
|
811
|
-
declare const FILESYSTEM_TOOL_NAMES: readonly ["ls", "read_file", "write_file", "edit_file", "glob", "grep", "execute"];
|
|
830
|
+
declare const FILESYSTEM_TOOL_NAMES: readonly ["ls", "read_file", "write_file", "edit_file", "delete", "glob", "grep", "execute"];
|
|
812
831
|
/**
|
|
813
832
|
* Built-in filesystem tool names accepted by
|
|
814
833
|
* {@link createFilesystemMiddleware}'s `tools` allowlist.
|
|
@@ -979,7 +998,7 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
979
998
|
data: string;
|
|
980
999
|
}[] | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "read_file"> | _langchain.DynamicStructuredTool<z.ZodPreprocess<z.ZodObject<{
|
|
981
1000
|
file_path: z.ZodString;
|
|
982
|
-
content: z.
|
|
1001
|
+
content: z.ZodString;
|
|
983
1002
|
}, z.core.$strip>>, {
|
|
984
1003
|
file_path: string;
|
|
985
1004
|
content: string;
|
|
@@ -999,7 +1018,14 @@ declare function createFilesystemMiddleware(options?: FilesystemMiddlewareOption
|
|
|
999
1018
|
}, unknown, string | Command<unknown, {
|
|
1000
1019
|
files: Record<string, FileData>;
|
|
1001
1020
|
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1002
|
-
}, string> | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "edit_file">
|
|
1021
|
+
}, string> | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "edit_file"> | _langchain.DynamicStructuredTool<z.ZodPreprocess<z.ZodObject<{
|
|
1022
|
+
file_path: z.ZodString;
|
|
1023
|
+
}, z.core.$strip>>, {
|
|
1024
|
+
file_path: string;
|
|
1025
|
+
}, unknown, Command<unknown, {
|
|
1026
|
+
files: Record<string, null>;
|
|
1027
|
+
messages: ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
1028
|
+
}, string> | ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "delete">)[], readonly []>;
|
|
1003
1029
|
//#endregion
|
|
1004
1030
|
//#region src/compat.d.ts
|
|
1005
1031
|
/**
|
|
@@ -1465,44 +1491,34 @@ interface CompiledSubAgent<TRunnable extends ReactAgent<any> | Runnable = ReactA
|
|
|
1465
1491
|
description: string;
|
|
1466
1492
|
/** The agent instance */
|
|
1467
1493
|
runnable: TRunnable;
|
|
1494
|
+
/**
|
|
1495
|
+
* Context mode. `"fork"` inherits the parent's conversation history
|
|
1496
|
+
* (but not its system prompt — that's baked into the runnable).
|
|
1497
|
+
* `"handoff"` (default) is fully isolated.
|
|
1498
|
+
*/
|
|
1499
|
+
mode?: "handoff" | "fork";
|
|
1468
1500
|
}
|
|
1469
1501
|
/**
|
|
1470
|
-
*
|
|
1502
|
+
* Fields shared by both {@link SubAgent} and {@link ForkedSubAgent}.
|
|
1471
1503
|
*
|
|
1472
|
-
*
|
|
1473
|
-
* stack (filesystemMiddleware, summarizationMiddleware, etc.) before any custom
|
|
1474
|
-
* `middleware` specified in this spec. Add `todoListMiddleware` explicitly to opt in.
|
|
1475
|
-
*
|
|
1476
|
-
* Required fields:
|
|
1477
|
-
* - `name`: Identifier used to select this subagent in the task tool
|
|
1478
|
-
* - `description`: Shown to the model for subagent selection
|
|
1479
|
-
* - `systemPrompt`: The system prompt for the subagent
|
|
1480
|
-
*
|
|
1481
|
-
* Optional fields:
|
|
1482
|
-
* - `model`: Override the default model for this subagent
|
|
1483
|
-
* - `tools`: Override the default tools for this subagent
|
|
1484
|
-
* - `middleware`: Additional middleware appended after defaults
|
|
1485
|
-
* - `interruptOn`: Human-in-the-loop configuration for specific tools
|
|
1486
|
-
* - `skills`: Skill source paths for SkillsMiddleware (e.g., `["/skills/user/", "/skills/project/"]`)
|
|
1487
|
-
*
|
|
1488
|
-
* @example
|
|
1489
|
-
* ```typescript
|
|
1490
|
-
* const researcher: SubAgent = {
|
|
1491
|
-
* name: "researcher",
|
|
1492
|
-
* description: "Research assistant for complex topics",
|
|
1493
|
-
* systemPrompt: "You are a research assistant.",
|
|
1494
|
-
* tools: [webSearchTool],
|
|
1495
|
-
* skills: ["/skills/research/"],
|
|
1496
|
-
* };
|
|
1497
|
-
* ```
|
|
1504
|
+
* @internal
|
|
1498
1505
|
*/
|
|
1499
|
-
interface
|
|
1506
|
+
interface SubAgentBase {
|
|
1500
1507
|
/** Identifier used to select this subagent in the task tool */
|
|
1501
1508
|
name: string;
|
|
1502
1509
|
/** Description shown to the model for subagent selection */
|
|
1503
1510
|
description: string;
|
|
1504
|
-
/**
|
|
1505
|
-
|
|
1511
|
+
/**
|
|
1512
|
+
* The system prompt for the agent. Optional on {@link SubAgent} (falls
|
|
1513
|
+
* back to an empty prompt if omitted); forbidden on {@link ForkedSubAgent},
|
|
1514
|
+
* which always inherits the parent's instead.
|
|
1515
|
+
*/
|
|
1516
|
+
systemPrompt?: string | SystemMessage;
|
|
1517
|
+
/**
|
|
1518
|
+
* Context mode. `"handoff"` (default) is fully isolated. `"fork"` inherits
|
|
1519
|
+
* the parent's conversation history and system prompt.
|
|
1520
|
+
*/
|
|
1521
|
+
mode?: "handoff" | "fork";
|
|
1506
1522
|
/** The tools to use for the agent (tool instances, not names). Defaults to defaultTools */
|
|
1507
1523
|
tools?: StructuredTool[];
|
|
1508
1524
|
/** The model for the agent. Defaults to defaultModel */
|
|
@@ -1580,6 +1596,70 @@ interface SubAgent {
|
|
|
1580
1596
|
*/
|
|
1581
1597
|
permissions?: FilesystemPermission[];
|
|
1582
1598
|
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Specification for a subagent that can be dynamically created.
|
|
1601
|
+
*
|
|
1602
|
+
* When using `createDeepAgent`, subagents automatically receive a default middleware
|
|
1603
|
+
* stack (filesystemMiddleware, summarizationMiddleware, etc.) before any custom
|
|
1604
|
+
* `middleware` specified in this spec. Add `todoListMiddleware` explicitly to opt in.
|
|
1605
|
+
*
|
|
1606
|
+
* Always fully isolated — this subagent only ever sees the task description,
|
|
1607
|
+
* never the parent's conversation. Use {@link ForkedSubAgent} to inherit the
|
|
1608
|
+
* parent's history and system prompt instead.
|
|
1609
|
+
*
|
|
1610
|
+
* @example
|
|
1611
|
+
* ```typescript
|
|
1612
|
+
* const researcher: SubAgent = {
|
|
1613
|
+
* name: "researcher",
|
|
1614
|
+
* description: "Research assistant for complex topics",
|
|
1615
|
+
* systemPrompt: "You are a research assistant.",
|
|
1616
|
+
* tools: [webSearchTool],
|
|
1617
|
+
* skills: ["/skills/research/"],
|
|
1618
|
+
* };
|
|
1619
|
+
* ```
|
|
1620
|
+
*/
|
|
1621
|
+
interface SubAgent extends SubAgentBase {
|
|
1622
|
+
/** The system prompt to use for the agent */
|
|
1623
|
+
systemPrompt?: string | SystemMessage;
|
|
1624
|
+
/**
|
|
1625
|
+
* Context mode. `"handoff"` (default) is fully isolated. `"fork"` inherits
|
|
1626
|
+
* the parent's conversation history and system prompt.
|
|
1627
|
+
*/
|
|
1628
|
+
mode?: "handoff";
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* Specification for a subagent that inherits the parent's conversation
|
|
1632
|
+
* instead of starting from just the task description.
|
|
1633
|
+
*
|
|
1634
|
+
* Always forks: it inherits the parent's full message history and its exact
|
|
1635
|
+
* system prompt (there's no own prompt to fall back to). Mirrored middleware
|
|
1636
|
+
* is only added when its model matches the parent's, since that's the only
|
|
1637
|
+
* case with a cache benefit to protect. Deliberately has no `systemPrompt`
|
|
1638
|
+
* of its own: since its system slot always carries the parent's prompt,
|
|
1639
|
+
* there's nothing of its own to put there. If you need a subagent with a
|
|
1640
|
+
* distinguishing system prompt, use {@link SubAgent} without forking instead.
|
|
1641
|
+
*
|
|
1642
|
+
* @example
|
|
1643
|
+
* ```typescript
|
|
1644
|
+
* const researcher: ForkedSubAgent = {
|
|
1645
|
+
* name: "researcher",
|
|
1646
|
+
* description: "Continues the current investigation with full context",
|
|
1647
|
+
* mode: "fork",
|
|
1648
|
+
* tools: [webSearchTool],
|
|
1649
|
+
* };
|
|
1650
|
+
* ```
|
|
1651
|
+
*
|
|
1652
|
+
* @experimental Forking subagents is experimental and subject to change
|
|
1653
|
+
*/
|
|
1654
|
+
interface ForkedSubAgent extends SubAgentBase {
|
|
1655
|
+
/** A ForkedSubAgent never has its own system prompt — always the parent's. */
|
|
1656
|
+
systemPrompt?: undefined;
|
|
1657
|
+
/**
|
|
1658
|
+
* Always `"fork"`. Required (not defaulted) so this can't structurally
|
|
1659
|
+
* collapse into a plain `SubAgent` — see `isForkedSubAgent` below.
|
|
1660
|
+
*/
|
|
1661
|
+
mode: "fork";
|
|
1662
|
+
}
|
|
1583
1663
|
/**
|
|
1584
1664
|
* Base specification for the general-purpose subagent.
|
|
1585
1665
|
*
|
|
@@ -1617,7 +1697,12 @@ interface SubAgent {
|
|
|
1617
1697
|
* });
|
|
1618
1698
|
* ```
|
|
1619
1699
|
*/
|
|
1620
|
-
declare const GENERAL_PURPOSE_SUBAGENT:
|
|
1700
|
+
declare const GENERAL_PURPOSE_SUBAGENT: {
|
|
1701
|
+
readonly name: "general-purpose";
|
|
1702
|
+
readonly 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.";
|
|
1703
|
+
readonly systemPrompt: "In order to complete the objective that the user asks of you, you have access to a number of standard tools.";
|
|
1704
|
+
readonly mode: "handoff";
|
|
1705
|
+
};
|
|
1621
1706
|
/**
|
|
1622
1707
|
* Create a runnable agent from a declarative `SubAgent` spec.
|
|
1623
1708
|
*
|
|
@@ -1652,13 +1737,15 @@ interface SubAgentMiddlewareOptions {
|
|
|
1652
1737
|
/** The tool configs for the default general-purpose subagent */
|
|
1653
1738
|
defaultInterruptOn?: Record<string, boolean | InterruptOnConfig> | null;
|
|
1654
1739
|
/** A list of additional subagents to provide to the agent */
|
|
1655
|
-
subagents?: (SubAgent | CompiledSubAgent)[];
|
|
1740
|
+
subagents?: (SubAgent | CompiledSubAgent | ForkedSubAgent)[];
|
|
1656
1741
|
/** Full system prompt override */
|
|
1657
1742
|
systemPrompt?: string | null;
|
|
1658
1743
|
/** Whether to include the general-purpose agent */
|
|
1659
1744
|
generalPurposeAgent?: boolean;
|
|
1660
1745
|
/** Custom description for the task tool */
|
|
1661
1746
|
taskDescription?: string | null;
|
|
1747
|
+
/** Inherited by `ForkedSubAgent`s and `mode: "fork"` compiled subagents */
|
|
1748
|
+
parentSystemPrompt?: string | SystemMessage | null;
|
|
1662
1749
|
}
|
|
1663
1750
|
/**
|
|
1664
1751
|
* Create subagent middleware with task tool
|
|
@@ -1790,15 +1877,17 @@ declare class StateBackend implements BackendProtocolV2 {
|
|
|
1790
1877
|
* Returns WriteResult with filesUpdate to update LangGraph state.
|
|
1791
1878
|
*/
|
|
1792
1879
|
write(filePath: string, content: string): WriteResult;
|
|
1880
|
+
/**
|
|
1881
|
+
* Delete a file or directory from state.
|
|
1882
|
+
*
|
|
1883
|
+
* Removes the exact file path plus every nested key under it.
|
|
1884
|
+
*/
|
|
1885
|
+
delete(filePath: string): DeleteResult;
|
|
1793
1886
|
/**
|
|
1794
1887
|
* Edit a file by replacing string occurrences.
|
|
1795
1888
|
* Returns EditResult with filesUpdate and occurrences.
|
|
1796
1889
|
*/
|
|
1797
1890
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): EditResult;
|
|
1798
|
-
/**
|
|
1799
|
-
* Delete a file from state by sending a null deletion marker through Pregel.
|
|
1800
|
-
*/
|
|
1801
|
-
delete(filePath: string): DeleteResult;
|
|
1802
1891
|
/**
|
|
1803
1892
|
* Search file contents for a literal text pattern.
|
|
1804
1893
|
* Binary files are skipped.
|
|
@@ -2402,8 +2491,8 @@ type BuiltinToolPlaceholder<N extends string> = {
|
|
|
2402
2491
|
*/
|
|
2403
2492
|
type DeepAgentBuiltinToolsTuple = { [K in DeepAgentBuiltinToolName]: BuiltinToolPlaceholder<K>; }[DeepAgentBuiltinToolName][];
|
|
2404
2493
|
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>;
|
|
2405
|
-
/** Any subagent specification — sync, compiled, or async. */
|
|
2406
|
-
type AnySubAgent = SubAgent | CompiledSubAgent | AsyncSubAgent;
|
|
2494
|
+
/** Any subagent specification — sync, compiled, forked, or async. */
|
|
2495
|
+
type AnySubAgent = SubAgent | CompiledSubAgent | ForkedSubAgent | AsyncSubAgent;
|
|
2407
2496
|
interface TypedToolStrategy<T = unknown> extends Array<ToolStrategy<any>> {
|
|
2408
2497
|
_schemaType?: T;
|
|
2409
2498
|
}
|
|
@@ -2664,7 +2753,7 @@ type InferSubagentByName<T, TName extends string> = InferDeepAgentSubagents<T> e
|
|
|
2664
2753
|
* type SubagentState = InferMiddlewareStates<SubagentMiddleware>;
|
|
2665
2754
|
* ```
|
|
2666
2755
|
*/
|
|
2667
|
-
type InferSubagentReactAgentType<TSubagent extends SubAgent | CompiledSubAgent> = TSubagent extends CompiledSubAgent ? TSubagent["runnable"] : TSubagent extends SubAgent ? ReactAgent<AgentTypeConfig<ResponseFormatUndefined, undefined, AnyAnnotationRoot, ExtractSubAgentMiddleware<TSubagent>, readonly []>> : never;
|
|
2756
|
+
type InferSubagentReactAgentType<TSubagent extends SubAgent | CompiledSubAgent | ForkedSubAgent> = TSubagent extends CompiledSubAgent ? TSubagent["runnable"] : TSubagent extends SubAgent | ForkedSubAgent ? ReactAgent<AgentTypeConfig<ResponseFormatUndefined, undefined, AnyAnnotationRoot, ExtractSubAgentMiddleware<TSubagent>, readonly []>> : never;
|
|
2668
2757
|
/**
|
|
2669
2758
|
* Configuration parameters for creating a Deep Agent
|
|
2670
2759
|
* Matches Python's create_deep_agent parameters
|
|
@@ -3251,18 +3340,17 @@ declare class StoreBackend implements BackendProtocolV2 {
|
|
|
3251
3340
|
* Returns WriteResult. External storage sets filesUpdate=null.
|
|
3252
3341
|
*/
|
|
3253
3342
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
3343
|
+
/**
|
|
3344
|
+
* Delete a file or directory from the store.
|
|
3345
|
+
*
|
|
3346
|
+
* Removes the exact key plus every nested key under it.
|
|
3347
|
+
*/
|
|
3348
|
+
delete(filePath: string): Promise<DeleteResult>;
|
|
3254
3349
|
/**
|
|
3255
3350
|
* Edit a file by replacing string occurrences.
|
|
3256
3351
|
* Returns EditResult. External storage sets filesUpdate=null.
|
|
3257
3352
|
*/
|
|
3258
3353
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<EditResult>;
|
|
3259
|
-
/**
|
|
3260
|
-
* Delete a file from the store.
|
|
3261
|
-
*
|
|
3262
|
-
* The file path is used as an exact store key. Wildcards are treated
|
|
3263
|
-
* literally and do not expand to multiple entries.
|
|
3264
|
-
*/
|
|
3265
|
-
delete(filePath: string): Promise<DeleteResult>;
|
|
3266
3354
|
/**
|
|
3267
3355
|
* Search file contents for a literal text pattern.
|
|
3268
3356
|
* Binary files are skipped.
|
|
@@ -3356,15 +3444,19 @@ declare class FilesystemBackend implements BackendProtocolV2 {
|
|
|
3356
3444
|
* Returns WriteResult. External storage sets filesUpdate=null.
|
|
3357
3445
|
*/
|
|
3358
3446
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
3447
|
+
/**
|
|
3448
|
+
* Delete a file or directory from the filesystem.
|
|
3449
|
+
*
|
|
3450
|
+
* Files are unlinked. Directories are removed recursively along with all of
|
|
3451
|
+
* their contents. Symlinks are removed as links and never followed into their
|
|
3452
|
+
* targets.
|
|
3453
|
+
*/
|
|
3454
|
+
delete(filePath: string): Promise<DeleteResult>;
|
|
3359
3455
|
/**
|
|
3360
3456
|
* Edit a file by replacing string occurrences.
|
|
3361
3457
|
* Returns EditResult. External storage sets filesUpdate=null.
|
|
3362
3458
|
*/
|
|
3363
3459
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<EditResult>;
|
|
3364
|
-
/**
|
|
3365
|
-
* Delete a file from the filesystem.
|
|
3366
|
-
*/
|
|
3367
|
-
delete(filePath: string): Promise<DeleteResult>;
|
|
3368
3460
|
/**
|
|
3369
3461
|
* Search for a literal text pattern in files.
|
|
3370
3462
|
*
|
|
@@ -3510,6 +3602,26 @@ declare class CompositeBackend implements BackendProtocolV2 {
|
|
|
3510
3602
|
* @returns WriteResult with path or error
|
|
3511
3603
|
*/
|
|
3512
3604
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
3605
|
+
/**
|
|
3606
|
+
* Add a route prefix back to state deletion updates.
|
|
3607
|
+
*/
|
|
3608
|
+
private prefixDeleteFilesUpdate;
|
|
3609
|
+
/**
|
|
3610
|
+
* Restore composite paths in a deletion result from a single backend.
|
|
3611
|
+
*/
|
|
3612
|
+
private restoreDeleteResult;
|
|
3613
|
+
/**
|
|
3614
|
+
* Delete a file or directory, routing to appropriate backend.
|
|
3615
|
+
*
|
|
3616
|
+
* Parent and root deletions run sequentially across the base backend and any
|
|
3617
|
+
* mounted routes below the requested path. A failure stops the fan-out so
|
|
3618
|
+
* later backends are left untouched, but earlier deletions cannot be rolled
|
|
3619
|
+
* back and are reported as potentially partial.
|
|
3620
|
+
*
|
|
3621
|
+
* @param filePath - Absolute file path
|
|
3622
|
+
* @returns DeleteResult with path or error
|
|
3623
|
+
*/
|
|
3624
|
+
delete(filePath: string): Promise<DeleteResult>;
|
|
3513
3625
|
/**
|
|
3514
3626
|
* Edit a file, routing to appropriate backend.
|
|
3515
3627
|
*
|
|
@@ -3520,10 +3632,6 @@ declare class CompositeBackend implements BackendProtocolV2 {
|
|
|
3520
3632
|
* @returns EditResult with path, occurrences, or error
|
|
3521
3633
|
*/
|
|
3522
3634
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<EditResult>;
|
|
3523
|
-
/**
|
|
3524
|
-
* Delete a file, routing to the appropriate backend.
|
|
3525
|
-
*/
|
|
3526
|
-
delete(filePath: string): Promise<DeleteResult>;
|
|
3527
3635
|
/**
|
|
3528
3636
|
* Execute a command via the default backend.
|
|
3529
3637
|
* Execution is not path-specific, so it always delegates to the default backend.
|
|
@@ -3609,6 +3717,13 @@ declare class ContextHubBackend implements BackendProtocolV2 {
|
|
|
3609
3717
|
private ensureCacheLoaded;
|
|
3610
3718
|
private ensureCache;
|
|
3611
3719
|
private static applyChanges;
|
|
3720
|
+
/**
|
|
3721
|
+
* Select the exact key at `base` plus every key nested under `base + "/"`
|
|
3722
|
+
* and map each to `null` (a deletion marker). Returns an empty object when
|
|
3723
|
+
* nothing is stored at or under `base`. Recomputing this against the current
|
|
3724
|
+
* cache is what makes a recursive delete correct under conflict replay.
|
|
3725
|
+
*/
|
|
3726
|
+
private static collectDeleteChanges;
|
|
3612
3727
|
/**
|
|
3613
3728
|
* Build the read-your-writes view without publishing speculative data as the
|
|
3614
3729
|
* durable cache. Later batches overlay earlier ones, matching worker order.
|
|
@@ -3939,6 +4054,21 @@ declare abstract class BaseSandbox implements SandboxBackendProtocolV2 {
|
|
|
3939
4054
|
* Uses uploadFiles() to write. No runtime needed on the sandbox host.
|
|
3940
4055
|
*/
|
|
3941
4056
|
write(filePath: string, content: string): Promise<WriteResult>;
|
|
4057
|
+
/**
|
|
4058
|
+
* Delete a file or directory from the sandbox via a server-side `rm`.
|
|
4059
|
+
*
|
|
4060
|
+
* Runs `test -e || test -L` first: a path that does not exist (and is not a
|
|
4061
|
+
* broken symlink) returns a not-found error, matching the contract of
|
|
4062
|
+
* `FilesystemBackend` and `StateBackend`. Because a shell `test` has no error
|
|
4063
|
+
* channel, a non-zero probe conflates "absent" with "unstattable" (e.g. an
|
|
4064
|
+
* unsearchable parent directory); an unknown exit code is not treated as
|
|
4065
|
+
* absent and falls through to the delete.
|
|
4066
|
+
*
|
|
4067
|
+
* Uses `rm -rf`, so directories are removed recursively along with their
|
|
4068
|
+
* contents. A non-zero `rm` exit (e.g. a permission error) is reported as a
|
|
4069
|
+
* failure.
|
|
4070
|
+
*/
|
|
4071
|
+
delete(filePath: string): Promise<DeleteResult>;
|
|
3942
4072
|
/**
|
|
3943
4073
|
* Edit a file by replacing string occurrences.
|
|
3944
4074
|
*
|
|
@@ -3949,12 +4079,6 @@ declare abstract class BaseSandbox implements SandboxBackendProtocolV2 {
|
|
|
3949
4079
|
* reclaim buffers before the next large allocation is made.
|
|
3950
4080
|
*/
|
|
3951
4081
|
edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<EditResult>;
|
|
3952
|
-
/**
|
|
3953
|
-
* Delete a file from the sandbox via a server-side rm.
|
|
3954
|
-
*
|
|
3955
|
-
* Uses rm -f, so deleting a path that does not exist succeeds silently.
|
|
3956
|
-
*/
|
|
3957
|
-
delete(filePath: string): Promise<DeleteResult>;
|
|
3958
4082
|
}
|
|
3959
4083
|
//#endregion
|
|
3960
4084
|
//#region src/backends/langsmith.d.ts
|
|
@@ -4211,7 +4335,7 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4211
4335
|
data: string;
|
|
4212
4336
|
}[] | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "read_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
4213
4337
|
file_path: import("zod").ZodString;
|
|
4214
|
-
content: import("zod").
|
|
4338
|
+
content: import("zod").ZodString;
|
|
4215
4339
|
}, import("zod/v4/core").$strip>>, {
|
|
4216
4340
|
file_path: string;
|
|
4217
4341
|
content: string;
|
|
@@ -4231,7 +4355,14 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4231
4355
|
}, unknown, string | _langgraph.Command<unknown, {
|
|
4232
4356
|
files: Record<string, FileData>;
|
|
4233
4357
|
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
4234
|
-
}, string> | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "edit_file">
|
|
4358
|
+
}, string> | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
4359
|
+
file_path: import("zod").ZodString;
|
|
4360
|
+
}, import("zod/v4/core").$strip>>, {
|
|
4361
|
+
file_path: string;
|
|
4362
|
+
}, unknown, _langgraph.Command<unknown, {
|
|
4363
|
+
files: Record<string, null>;
|
|
4364
|
+
messages: _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>[];
|
|
4365
|
+
}, string> | _messages.ToolMessage<_messages.MessageStructure<_messages.MessageToolSet>>, unknown, "delete">)[], readonly []>, AgentMiddleware<undefined, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
4235
4366
|
description: import("zod").ZodString;
|
|
4236
4367
|
subagent_type: import("zod").ZodString;
|
|
4237
4368
|
}, import("zod/v4/core").$strip>, {
|
|
@@ -4249,5 +4380,5 @@ declare function createDeepAgent<TResponse extends SupportedResponseFormat = Sup
|
|
|
4249
4380
|
}, import("zod/v4/core").$strip>>;
|
|
4250
4381
|
}, import("zod/v4/core").$strip>, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>, AgentMiddleware<undefined, undefined, unknown, readonly (ServerTool | ClientTool)[], readonly []>, ...TMiddleware, ...FlattenSubAgentMiddleware<TSubagents>], TTools, TSubagents, TStreamTransformers>>;
|
|
4251
4382
|
//#endregion
|
|
4252
|
-
export { createAsyncSubAgentMiddleware as $,
|
|
4253
|
-
//# sourceMappingURL=agent-
|
|
4383
|
+
export { createAsyncSubAgentMiddleware as $, BackendProtocol as $t, findProjectRoot as A, BackendProtocolV2 as An, parseHarnessProfileConfig as At, InferDeepAgentSubagents as B, ASYNC_TASK_SYSTEM_PROMPT as Bt, parseSkillMetadata as C, SandboxListResponse as Cn, createSubAgent as Ct, Settings as D, isSandboxBackend as Dn, HarnessProfileConfigData as Dt, filesValue as E, applyGrepMaxCount as En, registerHarnessProfile as Et, DeepAgent as F, HarnessProfile as Ft, InferSubagentReactAgentType as G, FilesystemMiddlewareOptions as Gt, InferStructuredResponse as H, EXECUTION_SYSTEM_PROMPT as Ht, DeepAgentTypeConfig as I, HarnessProfileOptions as It, SupportedResponseFormat as J, FilesystemOperation as Jt, MergedDeepAgentState as K, FsToolName as Kt, DefaultDeepAgentTypeConfig as L, REQUIRED_MIDDLEWARE_NAMES as Lt, SubagentRunStream$1 as M, BackendProtocolV1 as Mn, EMPTY_HARNESS_PROFILE as Mt, AnySubAgent as N, SandboxBackendProtocolV1 as Nn, createHarnessProfile as Nt, SettingsOptions as O, isSandboxProtocol as On, generalPurposeSubagentConfigSchema as Ot, CreateDeepAgentParams as P, GeneralPurposeSubagentConfig as Pt, AsyncTaskStatus as Q, BackendFactory as Qt, ExtractSubAgentMiddleware as R, ConfigurationError as Rt, listSkills as S, SandboxListOptions as Sn, SubAgentMiddlewareOptions as St, createAgentMemoryMiddleware as T, WriteResult as Tn, getHarnessProfile as Tt, InferSubAgentMiddlewareStates as U, SystemPromptConfig as Ut, InferDeepAgentType as V, BASE_AGENT_PROMPT as Vt, InferSubagentByName as W, TASK_SYSTEM_PROMPT as Wt, AsyncSubAgentMiddlewareOptions as X, PermissionMode as Xt, AsyncSubAgent as Y, FilesystemPermission as Yt, AsyncTask as Z, AnyBackendProtocol as Zt, StoreBackendContext as _, SandboxDeleteOptions as _n, DEFAULT_SUBAGENT_PROMPT as _t, adaptBackendProtocol as a, FileDownloadResponse as an, MAX_SKILL_DESCRIPTION_LENGTH as at, ListSkillsOptions as b, SandboxGetOrCreateOptions as bn, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY as bt, LangSmithSandboxCreateOptions as c, FileUploadResponse as cn, SkillMetadata$1 as ct, LocalShellBackend as d, GrepResult as dn, MemoryMiddlewareOptions as dt, BackendRuntime as en, isAsyncSubAgent as et, LocalShellBackendOptions as f, LsResult as fn, createMemoryMiddleware as ft, StoreBackend as g, SandboxBackendProtocol as gn, DEFAULT_GENERAL_PURPOSE_DESCRIPTION as gt, FilesystemBackend as h, ReadResult as hn, CompiledSubAgent as ht, LangSmithStartSandboxOptions as i, FileData as in, createCompletionCallbackMiddleware as it, DeepAgentRunStream as j, SandboxBackendProtocolV2 as jn, serializeProfile as jt, createSettings as k, resolveBackend as kn, harnessProfileConfigSchema as kt, LangSmithSandboxOptions as l, GlobResult as ln, SkillsMiddlewareOptions as lt, CompositeBackend as m, ReadRawResult as mn, createPatchToolCallsMiddleware as mt, LangSmithCaptureSnapshotOptions as n, EditResult as nn, createSummarizationMiddleware as nt, adaptSandboxProtocol as o, FileInfo as on, MAX_SKILL_FILE_SIZE as ot, ContextHubBackend as p, MaybePromise as pn, StateBackend as pt, ResolveDeepAgentTypeConfig as q, createFilesystemMiddleware as qt, LangSmithSnapshot as r, ExecuteResponse as rn, CompletionCallbackOptions as rt, LangSmithSandbox as s, FileOperationError as sn, MAX_SKILL_NAME_LENGTH as st, createDeepAgent as t, DeleteResult as tn, computeSummarizationDefaults as tt, BaseSandbox as u, GrepMatch as un, createSkillsMiddleware as ut, StoreBackendNamespaceFactory as v, SandboxError as vn, ForkedSubAgent as vt, AgentMemoryMiddlewareOptions as w, StateAndStore as wn, createSubAgentMiddleware as wt, SkillMetadata as x, SandboxInfo as xn, SubAgent as xt, StoreBackendOptions as y, SandboxErrorCode as yn, GENERAL_PURPOSE_SUBAGENT as yt, FlattenSubAgentMiddleware as z, ConfigurationErrorCode as zt };
|
|
4384
|
+
//# sourceMappingURL=agent-D50BBbJT.d.ts.map
|