@deepseek-ai/dsh-tool-fs-search 0.2.1-alpha.1 → 0.2.1-alpha.2

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.i18n.yaml CHANGED
@@ -15,8 +15,8 @@
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
17
17
  /deepseek-ai-dsh-tool-fs-search/use-this-package:
18
- en: aebe9494cf6e8f3a
19
- zh: 8ae2ebd6be7c3484
18
+ en: 494119ddc7157140
19
+ zh: 2fb6e69531ccb2b8
20
20
  /deepseek-ai-dsh-tool-fs-search/use-this-package/minimal-composition:
21
21
  en: a5a01d14e0bec814
22
22
  zh: 409298cfafd91b05
package/README.md CHANGED
@@ -25,6 +25,8 @@ Use `dsh-tool-fs-search` to give models `glob` file discovery and `grep` content
25
25
  <a id="use-this-package"></a>
26
26
  ## Use this package
27
27
 
28
+ Searches use the Session's current working directory, including changes made with `working_directory`.
29
+
28
30
  Mount the tools after a `ctx.subprocess` backend; no host `rg` install is needed, and no filesystem provider is required. The model then gets modification-time-ordered file discovery and line-oriented content search, each bounded and timeout-guarded.
29
31
 
30
32
  ### Minimal composition
package/README.zh.md CHANGED
@@ -25,6 +25,8 @@ kind: "package-reference"
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
+ 搜索使用 Session 的当前工作目录,包括通过 `working_directory` 切换后的目录。
29
+
28
30
  在 `ctx.subprocess` 后端之后挂载工具;无需宿主 `rg` 安装,也无需文件系统提供方。模型随后获得按修改时间排序的文件发现与按行组织的内容搜索,两者都有界并受超时防护。
29
31
 
30
32
  ### 最小组合
package/lib/index.js CHANGED
@@ -130,7 +130,7 @@ function resolveRgPath() {
130
130
  /**
131
131
  * Run the packaged ripgrep binary with a plain argv vector and return its
132
132
  * complete raw stdout. The working directory is the calling agent's session
133
- * cwd (`exec.agent.session.header.cwd`) when available, else
133
+ * current directory when available, else
134
134
  * `process.cwd()`. `exec.signal` is forwarded so the cooperative tool timeout
135
135
  * (`@deepseek-ai/dsh-tool-call-timeout-policy`) and caller cancellation terminate the
136
136
  * process tree.
@@ -155,7 +155,7 @@ function resolveRgPath() {
155
155
  * creation time becomes `SEARCH_ABORTED` instead.
156
156
  *
157
157
  * @param ctx - the plugin context; execution uses its `subprocess` service.
158
- * @param exec - the tool-execution context; supplies the session cwd and the abort signal.
158
+ * @param exec - the tool-execution context; supplies the owning Agent and the abort signal.
159
159
  * @param toolName - `glob` or `grep`, used in error messages.
160
160
  * @param argv - the ripgrep arguments (every model value an unquoted argv element; no shell layer exists).
161
161
  * @param rawOutputMaxBytes - cap on the complete raw stdout the tool will parse.
@@ -165,7 +165,7 @@ function resolveRgPath() {
165
165
  */
166
166
  async function runRipgrep(ctx, exec, toolName, argv, rawOutputMaxBytes, graceMs, stderrMaxBytes) {
167
167
  if (exec.signal.aborted) throw new SearchError(`${toolName} was aborted before completion (tool timeout or caller cancellation)`, "SEARCH_ABORTED");
168
- const workdir = exec.agent?.session.header.cwd ?? process.cwd();
168
+ const workdir = exec.agent === void 0 ? process.cwd() : await ctx.workingDirectory.ensure(exec.agent, exec.signal);
169
169
  let handle;
170
170
  try {
171
171
  handle = ctx.subprocess.spawn({
@@ -1212,7 +1212,8 @@ const name = "tool-fs-search";
1212
1212
  const inject = [
1213
1213
  "tools",
1214
1214
  "systemPrompt",
1215
- "subprocess"
1215
+ "subprocess",
1216
+ "workingDirectory"
1216
1217
  ];
1217
1218
  const Config = z.object({
1218
1219
  sampleOverCapGlobResults: z.boolean().required(),
@@ -100,7 +100,7 @@ export declare function resolveRgPath(): Promise<string>;
100
100
  /**
101
101
  * Run the packaged ripgrep binary with a plain argv vector and return its
102
102
  * complete raw stdout. The working directory is the calling agent's session
103
- * cwd (`exec.agent.session.header.cwd`) when available, else
103
+ * current directory when available, else
104
104
  * `process.cwd()`. `exec.signal` is forwarded so the cooperative tool timeout
105
105
  * (`@deepseek-ai/dsh-tool-call-timeout-policy`) and caller cancellation terminate the
106
106
  * process tree.
@@ -125,7 +125,7 @@ export declare function resolveRgPath(): Promise<string>;
125
125
  * creation time becomes `SEARCH_ABORTED` instead.
126
126
  *
127
127
  * @param ctx - the plugin context; execution uses its `subprocess` service.
128
- * @param exec - the tool-execution context; supplies the session cwd and the abort signal.
128
+ * @param exec - the tool-execution context; supplies the owning Agent and the abort signal.
129
129
  * @param toolName - `glob` or `grep`, used in error messages.
130
130
  * @param argv - the ripgrep arguments (every model value an unquoted argv element; no shell layer exists).
131
131
  * @param rawOutputMaxBytes - cap on the complete raw stdout the tool will parse.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-fs-search",
3
3
  "description": "Model-facing filesystem discovery tools (glob, grep) backed by the packaged ripgrep binary (@vscode/ripgrep)",
4
- "version": "0.2.1-alpha.1",
4
+ "version": "0.2.1-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,28 +31,31 @@
31
31
  "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
35
- "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.1",
36
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
37
- "@deepseek-ai/dsh-spill": "0.2.1-alpha.1",
38
- "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.1",
39
- "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
40
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
34
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
35
+ "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.2",
36
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
37
+ "@deepseek-ai/dsh-spill": "0.2.1-alpha.2",
38
+ "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
39
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.2",
40
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
41
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
41
42
  "@deepseek-ai/cordis": "~4.0.5-alpha.1",
42
- "@deepseek-ai/dsh-timeout": "0.2.1-alpha.1"
43
+ "@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2"
43
44
  },
44
45
  "devDependencies": {
45
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
46
- "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.1",
47
- "@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.1",
48
- "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.1",
49
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
50
- "@deepseek-ai/dsh-spill": "0.2.1-alpha.1",
51
- "@deepseek-ai/dsh-timeout": "0.2.1-alpha.1",
52
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
46
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
47
+ "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
48
+ "@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.2",
49
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
50
+ "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.2",
51
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
52
+ "@deepseek-ai/dsh-spill": "0.2.1-alpha.2",
53
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.2",
54
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
55
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
53
56
  "@deepseek-ai/cordis": "~4.0.5-alpha.1",
54
- "@deepseek-ai/dsh-scope": "0.2.1-alpha.1",
55
- "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
56
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1"
57
+ "@deepseek-ai/dsh-scope": "0.2.1-alpha.2",
58
+ "@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2",
59
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2"
57
60
  }
58
61
  }