Files
deepseek-harness/packages/ssh/fs-ssh/README.zh.md
T
sjw1231 2bd9913e2f refactor(apply-patch): drop unrelated changes and redundant prose
Restore files outside the patch feature to their merge-base state: the
invariant-check refactors across acp, session-controller, client,
compaction, agent-loop, agent, session-title, and subprocess, the cast
baseline edit, and the rescope-vendor skip list added during the merge.

Rename tool-fs.enableApplyPatch to applyPatch, matching the read, write,
and edit switches. Remove the unused collectMutationPaths export and the
unconsumed PatchHunk.contextLineIndices field, including its SSH schema
and fixtures. Report preflight refusals and syntax failures directly
instead of padding every phase with outcome, affectedPaths, and
cancelled fields. Add apply_patch to the shipped tool catalog test.

Fold the default-activation Agent Note into the apply_patch file-editing
note and delete it. Delete the guarded-filesystem-mutations upgrade
guide: every change is additive and all FileSystem subclasses live in
this repository. Trim defensive and reviewer-addressed sentences from
the package READMEs, subsystem docs, FileSystem JSDoc, and the Agent
Note, keeping the English and Chinese pairs aligned.
2026-10-20 20:25:24 +08:00

3.4 KiB

description, kind
description kind
面向与 SSH 子进程共享文件的消费方,说明远端文件系统语义。 package-reference

@deepseek-ai/dsh-fs-ssh

English | 中文

概述

dsh-fs-ssh 在 SSH 辅助进程的文件系统中提供 ctx.fs。文件工具读写的文件与远端 Bash、终端、语言服务器和 Node 程序看到的文件一致。远端路径规范化、版本保护及原子修改使用辅助程序旁安装的本地文件系统实现。

目录


使用本包

将本提供方与 dsh-ssh 及 sandboxPolicy 一同挂载,并使用配套 SSH 子进程与沙箱提供方执行程序。本提供方没有配置字段:连接身份和默认工作区属于 dsh-ssh,文件效果模式属于 sandboxPolicy。

resolve() 在远端主机上规范化路径。processPath() 与 fileUrl() 在同一个远端命名空间中标识文件,并不授予主机侧访问能力。文件 URL 对字面的百分号、反斜杠和换行进行编码,保留原文件名。processPathFromHostPath() 返回 undefined,因此需要已安装可执行文件或引导程序的消费方必须显式提供远端产物。

读取保留共享文件系统错误码。五个变更操作都会向辅助进程发送已解析的逐次调用策略;patchText、deleteFile 和 moveFile 使用 fs.patch、fs.delete 和 fs.move,防护和结果与本地提供方一致。传输丢失报告为 I/O 失败;变更可能已经提交,且不会自动重试。


理解实现

实现细节 — 点击展开

辅助程序复用 fs-local 与 fs-sandbox,保留符号链接身份、陈旧版本拒绝、差异基线及发布语义。UTF-8 流使用有界拉取请求,在消费方提前停止时关闭远端迭代器。


进一步探索


模型体验

间接通过现有文件系统消费方产生影响,由它们展示远端路径及文件内容,并负责每个工具与提示。

KV Cache 影响

本提供方不贡献请求前缀内容。面向模型的工具与结果由消费方负责。

已知限制与延后工作

  • 辅助程序将整段文本读取及单次字节窗口限制为 8 MiB。更大的读取需使用文本流或多个字节窗口;其他 JSON 传输也受连接消息大小上限约束。
  • 不支持文件系统监听:提供方不覆写 watch(),由基类以 FS_IO_ERROR 拒绝;不使用轮询,也不为远程路径建立本地监听。普通读取与消费方提供的手动刷新仍可用。
  • 远端文件 URL 是执行坐标,不是主机文件系统句柄或 Web 下载链接。

开发备注

维护者工作上下文 — 点击展开

无。