@qlzt/dsh-tool-fs 0.2.1-alpha.2 → 0.2.1-rc.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 +4 -4
- package/README.md +8 -2
- package/README.zh.md +8 -2
- package/lib/index.js +12 -6
- package/lib/types/index.d.ts +9 -1
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +38 -36
package/README.i18n.yaml
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
en: 29a1d47e9677f2a3
|
|
25
25
|
zh: 0ae3c794cc7c54db
|
|
26
26
|
/deepseek-ai-dsh-tool-fs/use-this-package/configuration:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
27
|
+
en: 6903a9ca39cb9a71
|
|
28
|
+
zh: a078377d02c3ab6f
|
|
29
29
|
/deepseek-ai-dsh-tool-fs/use-this-package/policy-and-sandbox-behavior:
|
|
30
30
|
en: 53d4ac2db089ef39
|
|
31
31
|
zh: 214ea051ed56f500
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
en: cf78b9dd5596495f
|
|
58
58
|
zh: bd44560f8c2435e8
|
|
59
59
|
/deepseek-ai-dsh-tool-fs/model-experience/system-prompt/what-the-model-sees:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
60
|
+
en: f715f25f411d50f5
|
|
61
|
+
zh: 4063a0499dc47466
|
|
62
62
|
/deepseek-ai-dsh-tool-fs/model-experience/system-prompt/what-the-model-sees/read-guidance:
|
|
63
63
|
en: f8961df3f3a6a671
|
|
64
64
|
zh: 85c7bd418b40b089
|
package/README.md
CHANGED
|
@@ -54,10 +54,14 @@ Field names are snake_case to match Claude Code and existing harness tool schema
|
|
|
54
54
|
|
|
55
55
|
### Configuration
|
|
56
56
|
|
|
57
|
-
All keys are optional
|
|
57
|
+
All keys are optional. The `read`, `readImage`, `write`, and `edit` switches default to `true`; set a switch to `false` to omit that tool and its guidance. All four may be disabled. Enabling `readImage` still requires an attachment store and an image-capable model. Read caps remain validated when `read` is disabled.
|
|
58
58
|
|
|
59
59
|
| Key | Default | Meaning |
|
|
60
60
|
|---|---|---|
|
|
61
|
+
| `read` | `true` | Register `read` and its guidance |
|
|
62
|
+
| `readImage` | `true` | Register `read_image` while an attachment store is mounted |
|
|
63
|
+
| `write` | `true` | Register `write` and its guidance |
|
|
64
|
+
| `edit` | `true` | Register `edit` and its guidance |
|
|
61
65
|
| `readLimit` | `2000` | Default and maximum lines returned by one `read` call |
|
|
62
66
|
| `readMaxLineLength` | `2000` | Characters kept per line before truncation |
|
|
63
67
|
| `readMaxBytes` | `51200` | Byte cap on one `read` call's selected lines; overflow ends the window with a capped footer |
|
|
@@ -65,6 +69,8 @@ All keys are optional; the defaults are the shipped read caps.
|
|
|
65
69
|
|
|
66
70
|
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-tool-fs) is the exhaustive source for every accepted field and its JSDoc.
|
|
67
71
|
|
|
72
|
+
With `fs-observation-policy` mounted and `read` disabled, `write` can still create files, and successful writes or edits record the versions needed for later mutations in that session. Existing unobserved files remain protected; disabling `read` does not relax the policy. Another filesystem reader must emit `fs/observed` for an existing file to become observed.
|
|
73
|
+
|
|
68
74
|
### Policy and sandbox behavior
|
|
69
75
|
|
|
70
76
|
Path authorization for `read` and `read_image` belongs entirely to `ctx.fs`; media-type declarations and file signatures only decide whether `read_image` accepts the bytes returned by that backend.
|
|
@@ -136,7 +142,7 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
136
142
|
|
|
137
143
|
#### What the model sees
|
|
138
144
|
|
|
139
|
-
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
|
|
145
|
+
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 historical subagent filters restored from descriptors, 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.
|
|
140
146
|
|
|
141
147
|
##### Read guidance
|
|
142
148
|
|
package/README.zh.md
CHANGED
|
@@ -54,10 +54,14 @@ kind: "package-reference"
|
|
|
54
54
|
|
|
55
55
|
### 配置
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
所有键均为可选。`read`、`readImage`、`write` 和 `edit` 开关默认为 `true`;将开关设为 `false` 可省略对应工具及其指导文本。允许关闭全部四个工具。启用 `readImage` 仍需要附件存储和支持图片输入的模型。关闭 `read` 时仍会校验读取上限。
|
|
58
58
|
|
|
59
59
|
| 键 | 默认值 | 含义 |
|
|
60
60
|
|---|---|---|
|
|
61
|
+
| `read` | `true` | 注册 `read` 及其指导文本 |
|
|
62
|
+
| `readImage` | `true` | 附件存储挂载时注册 `read_image` |
|
|
63
|
+
| `write` | `true` | 注册 `write` 及其指导文本 |
|
|
64
|
+
| `edit` | `true` | 注册 `edit` 及其指导文本 |
|
|
61
65
|
| `readLimit` | `2000` | 一次 `read` 调用返回的默认和最大行数 |
|
|
62
66
|
| `readMaxLineLength` | `2000` | 每行截断前保留的字符数 |
|
|
63
67
|
| `readMaxBytes` | `51200` | 一次 `read` 调用所选行的字节上限;溢出时以「已达上限」footer 结束窗口 |
|
|
@@ -65,6 +69,8 @@ kind: "package-reference"
|
|
|
65
69
|
|
|
66
70
|
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-tool-fs)是每个受支持字段及其 JSDoc 的穷尽式真源。
|
|
67
71
|
|
|
72
|
+
挂载 `fs-observation-policy` 且关闭 `read` 时,`write` 仍可创建文件,成功写入或编辑会记录本会话后续修改所需的版本。未观察过的已有文件仍受保护;关闭 `read` 不会放宽策略。其他文件系统读取方必须发出 `fs/observed`,已有文件才会成为已观察状态。
|
|
73
|
+
|
|
68
74
|
### 策略与沙箱行为
|
|
69
75
|
|
|
70
76
|
`read` 与 `read_image` 的路径授权完全由 `ctx.fs` 负责;媒体类型声明和文件签名只决定 `read_image` 是否接受该后端返回的字节。
|
|
@@ -136,7 +142,7 @@ kind: "package-reference"
|
|
|
136
142
|
|
|
137
143
|
#### 模型看到的内容
|
|
138
144
|
|
|
139
|
-
组装时,每个指导段落通过 `ctx.tools.get(name, scope)` 检查对应工具,仅在该 agent 可见时输出。write 段落仅在 edit 可见时推荐 edit。三个工具都可用时,下方原文保持不变;限制的施加、解除和工具注册变化在下次组装时生效。同一检查适用于直接限制 agent
|
|
145
|
+
组装时,每个指导段落通过 `ctx.tools.get(name, scope)` 检查对应工具,仅在该 agent 可见时输出。write 段落仅在 edit 可见时推荐 edit。三个工具都可用时,下方原文保持不变;限制的施加、解除和工具注册变化在下次组装时生效。同一检查适用于直接限制 agent 和从历史 descriptor 恢复的 subagent 过滤器,也适用于通过 `run_code` 暴露的 PTC 能力。 write/edit 中的先读后改句子描述观察策略,并非要求调用名为 `read` 的工具。隐藏 `read` 时仍保留这些句子:策略继续保护修改操作,其他产生观察记录的操作(例如 `str_replace_editor` 的 `command: view`)也能建立同一文件观察记录。工具可见性不会禁用该前置条件。
|
|
140
146
|
|
|
141
147
|
##### Read 指导
|
|
142
148
|
|
package/lib/index.js
CHANGED
|
@@ -1192,6 +1192,10 @@ const inject = [
|
|
|
1192
1192
|
"workingDirectory"
|
|
1193
1193
|
];
|
|
1194
1194
|
const Config = z.object({
|
|
1195
|
+
read: z.boolean().default(true),
|
|
1196
|
+
readImage: z.boolean().default(true),
|
|
1197
|
+
write: z.boolean().default(true),
|
|
1198
|
+
edit: z.boolean().default(true),
|
|
1195
1199
|
readLimit: z.number().default(READ_LIMIT),
|
|
1196
1200
|
readMaxLineLength: z.number().default(READ_MAX_LINE_LENGTH),
|
|
1197
1201
|
readMaxBytes: z.number().default(READ_MAX_BYTES),
|
|
@@ -1201,25 +1205,27 @@ const Config = z.object({
|
|
|
1201
1205
|
function assertPositiveInteger(name, value) {
|
|
1202
1206
|
if (!Number.isInteger(value) || value < 1) throw new Error(`tool-fs: ${name} must be a positive integer`);
|
|
1203
1207
|
}
|
|
1204
|
-
/** Register the
|
|
1208
|
+
/** Register the selected filesystem tools; `read_image` additionally requires a mounted attachment store. */
|
|
1205
1209
|
function apply(ctx, config) {
|
|
1206
1210
|
const resolved = config;
|
|
1207
1211
|
assertPositiveInteger("readLimit", resolved.readLimit);
|
|
1208
1212
|
assertPositiveInteger("readMaxLineLength", resolved.readMaxLineLength);
|
|
1209
1213
|
assertPositiveInteger("readMaxBytes", resolved.readMaxBytes);
|
|
1210
1214
|
assertPositiveInteger("readStreamMinSize", resolved.readStreamMinSize);
|
|
1211
|
-
applyReadTool(ctx, {
|
|
1215
|
+
if (resolved.read) applyReadTool(ctx, {
|
|
1212
1216
|
limit: resolved.readLimit,
|
|
1213
1217
|
maxLineLength: resolved.readMaxLineLength,
|
|
1214
1218
|
maxBytes: resolved.readMaxBytes,
|
|
1215
1219
|
streamMinSize: resolved.readStreamMinSize
|
|
1216
1220
|
});
|
|
1217
|
-
ctx.inject(["attachments"], (imageCtx) => {
|
|
1221
|
+
if (resolved.readImage) ctx.inject(["attachments"], (imageCtx) => {
|
|
1218
1222
|
applyReadImageTool(imageCtx);
|
|
1219
1223
|
});
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1224
|
+
if (resolved.write || resolved.edit) {
|
|
1225
|
+
const sandbox = new FsSandboxController(ctx);
|
|
1226
|
+
if (resolved.write) applyWriteTool(ctx, sandbox);
|
|
1227
|
+
if (resolved.edit) applyEditTool(ctx, sandbox);
|
|
1228
|
+
}
|
|
1223
1229
|
}
|
|
1224
1230
|
//#endregion
|
|
1225
1231
|
export { Config, apply, inject, name };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,6 +12,14 @@ export declare const name = "tool-fs";
|
|
|
12
12
|
export declare const inject: string[];
|
|
13
13
|
/** Plugin config (all optional — `Config` supplies the defaults). */
|
|
14
14
|
export interface Config {
|
|
15
|
+
/** Register `read` and its guidance. Defaults to true. */
|
|
16
|
+
read?: boolean;
|
|
17
|
+
/** Register `read_image` while an attachment store is mounted. Defaults to true. */
|
|
18
|
+
readImage?: boolean;
|
|
19
|
+
/** Register `write` and its guidance. Defaults to true. */
|
|
20
|
+
write?: boolean;
|
|
21
|
+
/** Register `edit` and its guidance. Defaults to true. */
|
|
22
|
+
edit?: boolean;
|
|
15
23
|
/** Default and maximum number of lines returned by one `read` call. */
|
|
16
24
|
readLimit?: number;
|
|
17
25
|
/** Maximum characters returned for a single line before truncation. */
|
|
@@ -22,6 +30,6 @@ export interface Config {
|
|
|
22
30
|
readStreamMinSize?: number;
|
|
23
31
|
}
|
|
24
32
|
export declare const Config: z<Config>;
|
|
25
|
-
/** Register the
|
|
33
|
+
/** Register the selected filesystem tools; `read_image` additionally requires a mounted attachment store. */
|
|
26
34
|
export declare function apply(ctx: Context, config: Config): void;
|
|
27
35
|
//# sourceMappingURL=index.d.ts.map
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlzt/dsh-tool-fs",
|
|
3
3
|
"description": "Model-facing filesystem tools (read, write, edit) over the DeepSeek Harness filesystem seam (ctx.fs)",
|
|
4
|
-
"version": "0.2.1-
|
|
4
|
+
"version": "0.2.1-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,53 +19,55 @@
|
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
26
|
+
"locale/*.json",
|
|
25
27
|
"lib/index.js",
|
|
26
28
|
"lib/types/**/*.d.ts"
|
|
27
29
|
],
|
|
28
30
|
"license": "MIT",
|
|
29
31
|
"dependencies": {
|
|
30
32
|
"diff": "^9.0.0",
|
|
31
|
-
"@deepseek-ai/schemastery": "~3.18.5
|
|
32
|
-
"@qlzt/dsh-util-code-language": "0.2.1-
|
|
33
|
+
"@deepseek-ai/schemastery": "~3.18.5",
|
|
34
|
+
"@qlzt/dsh-util-code-language": "0.2.1-rc.2"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
|
-
"@qlzt/dsh-attachment": "0.2.1-
|
|
36
|
-
"@qlzt/dsh-fs": "0.2.1-
|
|
37
|
-
"@qlzt/dsh-llm": "0.2.1-
|
|
38
|
-
"@qlzt/dsh-sandbox": "0.2.1-
|
|
39
|
-
"@qlzt/dsh-sandbox-policy": "0.2.1-
|
|
40
|
-
"@qlzt/dsh-session": "0.2.1-
|
|
41
|
-
"@qlzt/dsh-system-prompt": "0.2.1-
|
|
42
|
-
"@qlzt/dsh-tools": "0.2.1-
|
|
43
|
-
"@qlzt/dsh-user-approval": "0.2.1-
|
|
44
|
-
"@deepseek-ai/cordis": "~4.0.5
|
|
45
|
-
"@qlzt/dsh-working-directory": "0.2.1-
|
|
37
|
+
"@qlzt/dsh-attachment": "0.2.1-rc.2",
|
|
38
|
+
"@qlzt/dsh-fs": "0.2.1-rc.2",
|
|
39
|
+
"@qlzt/dsh-llm": "0.2.1-rc.2",
|
|
40
|
+
"@qlzt/dsh-sandbox": "0.2.1-rc.2",
|
|
41
|
+
"@qlzt/dsh-sandbox-policy": "0.2.1-rc.2",
|
|
42
|
+
"@qlzt/dsh-session": "0.2.1-rc.2",
|
|
43
|
+
"@qlzt/dsh-system-prompt": "0.2.1-rc.2",
|
|
44
|
+
"@qlzt/dsh-tools": "0.2.1-rc.2",
|
|
45
|
+
"@qlzt/dsh-user-approval": "0.2.1-rc.2",
|
|
46
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
47
|
+
"@qlzt/dsh-working-directory": "0.2.1-rc.2"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
|
-
"@deepseek-ai/dsh-agent": "0.2.1-
|
|
49
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.1-
|
|
50
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-
|
|
51
|
-
"@deepseek-ai/dsh-attachment": "0.2.1-
|
|
52
|
-
"@deepseek-ai/dsh-fs": "0.2.1-
|
|
53
|
-
"@deepseek-ai/dsh-fs-local": "0.2.1-
|
|
54
|
-
"@deepseek-ai/dsh-fs-observation-policy": "0.2.1-
|
|
55
|
-
"@deepseek-ai/dsh-llm": "0.2.1-
|
|
56
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-
|
|
57
|
-
"@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-
|
|
58
|
-
"@deepseek-ai/dsh-sandbox": "0.2.1-
|
|
59
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-
|
|
60
|
-
"@deepseek-ai/dsh-session": "0.2.1-
|
|
61
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.1-
|
|
62
|
-
"@deepseek-ai/dsh-tools": "0.2.1-
|
|
63
|
-
"@deepseek-ai/dsh-user-approval": "0.2.1-
|
|
64
|
-
"@deepseek-ai/cordis": "~4.0.5
|
|
65
|
-
"@deepseek-ai/dsh-session-projection": "0.2.1-
|
|
66
|
-
"@deepseek-ai/dsh-scope": "0.2.1-
|
|
67
|
-
"@deepseek-ai/dsh-ptc-runtime": "0.2.1-
|
|
68
|
-
"@deepseek-ai/dsh-working-directory": "0.2.1-
|
|
50
|
+
"@deepseek-ai/dsh-agent": "0.2.1-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.2",
|
|
53
|
+
"@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
|
|
54
|
+
"@deepseek-ai/dsh-fs": "0.2.1-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
|
|
56
|
+
"@deepseek-ai/dsh-fs-observation-policy": "0.2.1-rc.2",
|
|
57
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.2",
|
|
62
|
+
"@deepseek-ai/dsh-session": "0.2.1-rc.2",
|
|
63
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
|
|
64
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
65
|
+
"@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
|
|
66
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
67
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-scope": "0.2.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-ptc-runtime": "0.2.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.2"
|
|
69
71
|
},
|
|
70
72
|
"dsh": {}
|
|
71
73
|
}
|