deepagents 1.10.6 → 1.10.7

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.
@@ -1248,6 +1248,22 @@ var CompositeBackend = class {
1248
1248
  */
1249
1249
  const INT_FORMATTER = new Intl.NumberFormat("en-US");
1250
1250
  /**
1251
+ * Normalizes tool input so that models sending `path` instead of `file_path`
1252
+ * still work. If the input has `path` but not `file_path`, copies `path` into
1253
+ * `file_path`. This makes the filesystem tools resilient to parameter-name
1254
+ * variations across models of different capability levels.
1255
+ */
1256
+ function normalizeFilePathInput(input) {
1257
+ if (typeof input === "object" && input !== null && "path" in input && !("file_path" in input)) {
1258
+ const { path, ...rest } = input;
1259
+ return {
1260
+ ...rest,
1261
+ file_path: path
1262
+ };
1263
+ }
1264
+ return input;
1265
+ }
1266
+ /**
1251
1267
  * Tools that should be excluded from the large result eviction logic.
1252
1268
  *
1253
1269
  * This array contains tools that should NOT have their results evicted to the filesystem
@@ -1524,10 +1540,10 @@ const READ_FILE_TOOL_DESCRIPTION = context`
1524
1540
  Usage:
1525
1541
  - By default, it reads up to ${100} lines starting from the beginning of the file
1526
1542
  - **IMPORTANT for large files and codebase exploration**: Use pagination with offset and limit parameters to avoid context overflow
1527
- - First scan: read_file(path, limit=${100}) to see file structure
1528
- - Read more sections: read_file(path, offset=${100}, limit=200) for next 200 lines
1543
+ - First scan: read_file(file_path, limit=${100}) to see file structure
1544
+ - Read more sections: read_file(file_path, offset=${100}, limit=200) for next 200 lines
1529
1545
  - Only omit limit (read full file) when necessary for editing
1530
- - Specify offset and limit: read_file(path, offset=0, limit=${100}) reads first ${100} lines
1546
+ - Specify offset and limit: read_file(file_path, offset=0, limit=${100}) reads first ${100} lines
1531
1547
  - Results are returned using cat -n format, with line numbers starting at 1
1532
1548
  - Lines longer than ${INT_FORMATTER.format(MAX_LINE_LENGTH)} characters will be split into multiple lines with continuation markers (e.g., 5.1, 5.2, etc.). When you specify a limit, these continuation lines count towards the limit.
1533
1549
  - You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.
@@ -1725,11 +1741,11 @@ function createReadFileTool(backend, options) {
1725
1741
  }, {
1726
1742
  name: "read_file",
1727
1743
  description: customDescription || READ_FILE_TOOL_DESCRIPTION,
1728
- schema: z.object({
1744
+ schema: z.preprocess(normalizeFilePathInput, z.object({
1729
1745
  file_path: z.string().describe("Absolute path to the file to read"),
1730
1746
  offset: z.coerce.number().optional().default(0).describe("Line offset to start reading from (0-indexed)"),
1731
1747
  limit: z.coerce.number().optional().default(100).describe("Maximum number of lines to read")
1732
- })
1748
+ }))
1733
1749
  });
1734
1750
  }
1735
1751
  /**
@@ -1757,10 +1773,10 @@ function createWriteFileTool(backend, options) {
1757
1773
  }, {
1758
1774
  name: "write_file",
1759
1775
  description: customDescription || WRITE_FILE_TOOL_DESCRIPTION,
1760
- schema: z.object({
1776
+ schema: z.preprocess(normalizeFilePathInput, z.object({
1761
1777
  file_path: z.string().describe("Absolute path to the file to write"),
1762
1778
  content: z.string().default("").describe("Content to write to the file")
1763
- })
1779
+ }))
1764
1780
  });
1765
1781
  }
1766
1782
  /**
@@ -1788,12 +1804,12 @@ function createEditFileTool(backend, options) {
1788
1804
  }, {
1789
1805
  name: "edit_file",
1790
1806
  description: customDescription || EDIT_FILE_TOOL_DESCRIPTION,
1791
- schema: z.object({
1807
+ schema: z.preprocess(normalizeFilePathInput, z.object({
1792
1808
  file_path: z.string().describe("Absolute path to the file to edit"),
1793
1809
  old_string: z.string().describe("String to be replaced (must match exactly)"),
1794
1810
  new_string: z.string().describe("String to replace with"),
1795
1811
  replace_all: z.boolean().optional().default(false).describe("Whether to replace all occurrences")
1796
- })
1812
+ }))
1797
1813
  });
1798
1814
  }
1799
1815
  /**
@@ -3098,7 +3114,7 @@ const SKILLS_SYSTEM_PROMPT = context`
3098
3114
  User: "Can you research the latest developments in quantum computing?"
3099
3115
 
3100
3116
  1. Check available skills above → See "web-research" skill with its full path
3101
- 2. Read the full skill file: \`read_file(path, limit=${DEFAULT_SKILL_READ_LINE_LIMIT})\`
3117
+ 2. Read the full skill file: \`read_file(file_path, limit=${DEFAULT_SKILL_READ_LINE_LIMIT})\`
3102
3118
  3. Follow the skill's research workflow (search → organize → synthesize)
3103
3119
  4. Use any helper scripts with absolute paths
3104
3120
 
@@ -7357,4 +7373,4 @@ var LangSmithSandbox = class LangSmithSandbox extends BaseSandbox {
7357
7373
  //#endregion
7358
7374
  export { GENERAL_PURPOSE_SUBAGENT as A, isSandboxProtocol as B, MAX_SKILL_NAME_LENGTH as C, createPatchToolCallsMiddleware as D, filesValue as E, createFilesystemMiddleware as F, getMimeType as G, adaptBackendProtocol as H, CompositeBackend as I, isTextMimeType as K, StateBackend as L, TASK_SYSTEM_PROMPT as M, createSubAgent as N, DEFAULT_GENERAL_PURPOSE_DESCRIPTION as O, createSubAgentMiddleware as P, SandboxError as R, MAX_SKILL_FILE_SIZE as S, createMemoryMiddleware as T, adaptSandboxProtocol as U, resolveBackend as V, checkEmptyContent as W, isAsyncSubAgent as _, createDeepAgent as a, createCompletionCallbackMiddleware as b, generalPurposeSubagentConfigSchema as c, serializeProfile as d, EMPTY_HARNESS_PROFILE as f, createAsyncSubAgentMiddleware as g, ConfigurationError as h, StoreBackend as i, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY as j, DEFAULT_SUBAGENT_PROMPT as k, harnessProfileConfigSchema as l, REQUIRED_MIDDLEWARE_NAMES as m, BaseSandbox as n, getHarnessProfile as o, createHarnessProfile as p, performStringReplacement as q, ContextHubBackend as r, registerHarnessProfile as s, LangSmithSandbox as t, parseHarnessProfileConfig as u, computeSummarizationDefaults as v, createSkillsMiddleware as w, MAX_SKILL_DESCRIPTION_LENGTH as x, createSummarizationMiddleware as y, isSandboxBackend as z };
7359
7375
 
7360
- //# sourceMappingURL=langsmith-CbVMIRaK.js.map
7376
+ //# sourceMappingURL=langsmith-DjCMSywL.js.map