@deepseek-ai/dsh-tool-fs 0.1.5-alpha.1 → 0.1.5-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 +2 -2
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/lib/index.js +6 -6
- package/lib/types/edit.d.ts +1 -1
- package/lib/types/read.d.ts +1 -1
- package/lib/types/write.d.ts +1 -1
- package/package.json +29 -27
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/fs/tool-fs/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 9d338a6227b7f02ef43fcbe97900b166cb722817
|
|
6
|
+
README.zh.md: 0c34f840ad449847a649df8abdadec01f772f37b
|
package/README.md
CHANGED
|
@@ -133,7 +133,7 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
133
133
|
|
|
134
134
|
#### What the model sees
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
At assembly time, each guidance section checks `ctx.tools.get(name, scope)` and renders only while its tool is visible to that agent. The write paragraph recommends edit only while edit is visible. The text below is unchanged when all three tools are available; restrictions, their removal, and tool registration changes take effect on the next assembly. The same check works for direct agent restrictions and subagent `toolFilter`, including PTC capabilities behind `run_code`. The read-before-mutation sentences in write/edit describe the observation policy, not a requirement to invoke the tool named `read`. They remain when `read` is hidden: the policy still guards mutations, and another observing operation, such as `str_replace_editor` with `command: view`, can establish the same file observation. Tool visibility does not disable that precondition.
|
|
137
137
|
|
|
138
138
|
##### Read guidance
|
|
139
139
|
|
|
@@ -155,11 +155,11 @@ Use the edit tool for targeted changes to existing UTF-8 text files. It replaces
|
|
|
155
155
|
|
|
156
156
|
#### Token effect
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
Guidance cost follows the visible tools and their applicable cross-tool recommendations.
|
|
159
159
|
|
|
160
160
|
#### KV Cache effect
|
|
161
161
|
|
|
162
|
-
Prefix-stable while the plugin scope and guidance text are unchanged.
|
|
162
|
+
Prefix-stable while the visible tool set, plugin scope, and guidance text are unchanged. Restrictions or plugin lifecycle changes may invalidate reuse from the first changed section.
|
|
163
163
|
|
|
164
164
|
### Tool schemas
|
|
165
165
|
|
package/README.zh.md
CHANGED
|
@@ -133,7 +133,7 @@ kind: "package-reference"
|
|
|
133
133
|
|
|
134
134
|
#### 模型看到的内容
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
组装时,每个指导段落通过 `ctx.tools.get(name, scope)` 检查对应工具,仅在该 agent 可见时输出。write 段落仅在 edit 可见时推荐 edit。三个工具都可用时,下方原文保持不变;限制的施加、解除和工具注册变化在下次组装时生效。同一检查适用于直接限制 agent 和 subagent 的 `toolFilter`,也适用于通过 `run_code` 暴露的 PTC 能力。 write/edit 中的先读后改句子描述观察策略,并非要求调用名为 `read` 的工具。隐藏 `read` 时仍保留这些句子:策略继续保护修改操作,其他产生观察记录的操作(例如 `str_replace_editor` 的 `command: view`)也能建立同一文件观察记录。工具可见性不会禁用该前置条件。
|
|
137
137
|
|
|
138
138
|
##### Read 指导
|
|
139
139
|
|
|
@@ -155,11 +155,11 @@ Use the edit tool for targeted changes to existing UTF-8 text files. It replaces
|
|
|
155
155
|
|
|
156
156
|
#### Token 影响
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
指导成本取决于可见工具及其适用的跨工具推荐。
|
|
159
159
|
|
|
160
160
|
#### KV Cache 影响
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
可见工具集合、插件作用域和指导文本不变时,前缀保持稳定。限制或插件生命周期变化可能从首个变化的段落开始使复用失效。
|
|
163
163
|
|
|
164
164
|
### 工具 schema
|
|
165
165
|
|
package/lib/index.js
CHANGED
|
@@ -318,7 +318,7 @@ function parseReadArgs(args, maxLimit) {
|
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
|
-
* Register the `read` tool and its system-prompt guidance.
|
|
321
|
+
* Register the `read` tool and its scope-aware system-prompt guidance.
|
|
322
322
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
323
323
|
* @param caps - the deployment's resolved read caps (plugin config after defaulting).
|
|
324
324
|
*/
|
|
@@ -326,7 +326,7 @@ function applyReadTool(ctx, caps) {
|
|
|
326
326
|
ctx.systemPrompt.section({
|
|
327
327
|
name: "tool:read",
|
|
328
328
|
order: ctx.systemPrompt.getSectionOrder("TOOL_READ"),
|
|
329
|
-
text: "Use the read tool — not shell commands like cat — to inspect text files. Results include line numbers. Use offset and limit to continue reading large files."
|
|
329
|
+
text: ({ scope }) => ctx.tools.get("read", scope) === void 0 ? "" : "Use the read tool — not shell commands like cat — to inspect text files. Results include line numbers. Use offset and limit to continue reading large files."
|
|
330
330
|
});
|
|
331
331
|
ctx.tools.register(defineTool({
|
|
332
332
|
name: "read",
|
|
@@ -583,7 +583,7 @@ ${outcome.operation === "create" ? "Created" : "Updated"} file
|
|
|
583
583
|
</content>`;
|
|
584
584
|
}
|
|
585
585
|
/**
|
|
586
|
-
* Register the `write` tool and its system-prompt guidance.
|
|
586
|
+
* Register the `write` tool and its scope-aware system-prompt guidance.
|
|
587
587
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
588
588
|
* @param sandbox - the shared sandbox-escalation API (advertisement, mode stamping, denial mapping).
|
|
589
589
|
*/
|
|
@@ -591,7 +591,7 @@ function applyWriteTool(ctx, sandbox) {
|
|
|
591
591
|
ctx.systemPrompt.section({
|
|
592
592
|
name: "tool:write",
|
|
593
593
|
order: ctx.systemPrompt.getSectionOrder("TOOL_WRITE"),
|
|
594
|
-
text: "Use the write tool to create files or completely replace file contents. Existing files are overwritten, so read an existing file first (the default fs-observation-policy requires it) and prefer edit for targeted changes."
|
|
594
|
+
text: ({ scope }) => ctx.tools.get("write", scope) === void 0 ? "" : "Use the write tool to create files or completely replace file contents. Existing files are overwritten, so read an existing file first (the default fs-observation-policy requires it)" + (ctx.tools.get("edit", scope) === void 0 ? "" : " and prefer edit for targeted changes") + "."
|
|
595
595
|
});
|
|
596
596
|
ctx.tools.register(defineTool({
|
|
597
597
|
name: "write",
|
|
@@ -728,7 +728,7 @@ function formatEditOutput(displayPath, replaceAll) {
|
|
|
728
728
|
return replaceAll ? `The file ${displayPath} has been updated. All occurrences were successfully replaced.` : `The file ${displayPath} has been updated successfully.`;
|
|
729
729
|
}
|
|
730
730
|
/**
|
|
731
|
-
* Register the `edit` tool and its system-prompt guidance.
|
|
731
|
+
* Register the `edit` tool and its scope-aware system-prompt guidance.
|
|
732
732
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
733
733
|
* @param sandbox - the shared sandbox-escalation API (advertisement, mode stamping, denial mapping).
|
|
734
734
|
*/
|
|
@@ -736,7 +736,7 @@ function applyEditTool(ctx, sandbox) {
|
|
|
736
736
|
ctx.systemPrompt.section({
|
|
737
737
|
name: "tool:edit",
|
|
738
738
|
order: ctx.systemPrompt.getSectionOrder("TOOL_EDIT"),
|
|
739
|
-
text: "Use the edit tool for targeted changes to existing UTF-8 text files. It replaces literal old_string with new_string; by default old_string must appear exactly once. If old_string appears multiple times, provide a more specific old_string or set replace_all to true. Read the file first (the default fs-observation-policy requires it), unless you just created or edited it in this session."
|
|
739
|
+
text: ({ scope }) => ctx.tools.get("edit", scope) === void 0 ? "" : "Use the edit tool for targeted changes to existing UTF-8 text files. It replaces literal old_string with new_string; by default old_string must appear exactly once. If old_string appears multiple times, provide a more specific old_string or set replace_all to true. Read the file first (the default fs-observation-policy requires it), unless you just created or edited it in this session."
|
|
740
740
|
});
|
|
741
741
|
ctx.tools.register(defineTool({
|
|
742
742
|
name: "edit",
|
package/lib/types/edit.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare function parseEditArgs(args: {
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function formatEditOutput(displayPath: string, replaceAll: boolean): string;
|
|
36
36
|
/**
|
|
37
|
-
* Register the `edit` tool and its system-prompt guidance.
|
|
37
|
+
* Register the `edit` tool and its scope-aware system-prompt guidance.
|
|
38
38
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
39
39
|
* @param sandbox - the shared sandbox-escalation API (advertisement, mode stamping, denial mapping).
|
|
40
40
|
*/
|
package/lib/types/read.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare function parseReadArgs(args: {
|
|
|
40
40
|
limit?: number;
|
|
41
41
|
}, maxLimit: number): ReadInput;
|
|
42
42
|
/**
|
|
43
|
-
* Register the `read` tool and its system-prompt guidance.
|
|
43
|
+
* Register the `read` tool and its scope-aware system-prompt guidance.
|
|
44
44
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
45
45
|
* @param caps - the deployment's resolved read caps (plugin config after defaulting).
|
|
46
46
|
*/
|
package/lib/types/write.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function parseWriteArgs(args: {
|
|
|
28
28
|
*/
|
|
29
29
|
export declare function formatWriteOutput(displayPath: string, outcome: Pick<FsWriteOutcome, 'operation'>): string;
|
|
30
30
|
/**
|
|
31
|
-
* Register the `write` tool and its system-prompt guidance.
|
|
31
|
+
* Register the `write` tool and its scope-aware system-prompt guidance.
|
|
32
32
|
* @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.
|
|
33
33
|
* @param sandbox - the shared sandbox-escalation API (advertisement, mode stamping, denial mapping).
|
|
34
34
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-fs",
|
|
3
3
|
"description": "Model-facing filesystem tools (read, write, edit) over the DeepSeek Harness filesystem seam (ctx.fs)",
|
|
4
|
-
"version": "0.1.5-alpha.
|
|
4
|
+
"version": "0.1.5-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -31,34 +31,36 @@
|
|
|
31
31
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@deepseek-ai/dsh-attachment": "^0.1.5-alpha.
|
|
35
|
-
"@deepseek-ai/dsh-fs": "^0.1.5-alpha.
|
|
36
|
-
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.
|
|
37
|
-
"@deepseek-ai/dsh-sandbox": "^0.1.5-alpha.
|
|
38
|
-
"@deepseek-ai/dsh-sandbox-policy": "^0.1.5-alpha.
|
|
39
|
-
"@deepseek-ai/dsh-
|
|
40
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/
|
|
43
|
-
"@deepseek-ai/
|
|
34
|
+
"@deepseek-ai/dsh-attachment": "^0.1.5-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-fs": "^0.1.5-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
|
|
37
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.5-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.5-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.5-alpha.2",
|
|
43
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@deepseek-ai/dsh-agent": "^0.1.5-alpha.
|
|
47
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.5-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-alpha.
|
|
49
|
-
"@deepseek-ai/dsh-attachment": "^0.1.5-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-fs": "^0.1.5-alpha.
|
|
51
|
-
"@deepseek-ai/dsh-fs-observation-policy": "^0.1.5-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.1",
|
|
58
|
-
"@deepseek-ai/dsh-tools": "^0.1.5-alpha.1",
|
|
59
|
-
"@deepseek-ai/dsh-user-approval": "^0.1.5-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.5-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-attachment": "^0.1.5-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-fs": "^0.1.5-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-fs-observation-policy": "^0.1.5-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.5-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.5-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.5-alpha.2",
|
|
60
57
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
61
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
58
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-scope": "^0.1.5-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-llm-deepseek": "^0.1.5-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-fs-local": "^0.1.5-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-code-runtime": "^0.1.5-alpha.2"
|
|
63
65
|
}
|
|
64
66
|
}
|