eeyzs1/dsh-plugins--packages-attach-files0

@eeyzs1/dsh-attach-files

Add files/directories to the conversation as @file:/@dir: references or expanded content.

包名
@eeyzs1/dsh-attach-files
版本
1.0.0
许可证
MIT
最近更新
2026年8月17日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:eeyzs1/dsh-plugins#ab0060811a40f2c801d0f920327323f296af9dec&path:packages/attach-files

@eeyzs1/dsh-attach-files — 添加文件/目录到对话(真实包,开机自启)

attach-files 从动态插件转换为真实包,可通过 dsh plugin 安装到 profile,开机自启、升级不覆盖

能力

在 DSH 输入框工具行加「📁 添加文件」按钮,弹出文件/目录选择器:

  • 添加路径(默认):插入 @file: (大小) / @dir: 轻量引用,不展开内容。
  • 展开内容:把选中文件的内容直接展开进草稿(单文件 100KB 截断;目录仍走 @dir:)。

与动态插件版的区别

动态版本真实包
Client→Host RPCharness.handle(动态专属)ctx.connection.rpc.handle('/attach', …)(真实机制)
Client→Host 调用host.callctx.connection.rpc.call('/attach', …)
CSSstyles 闭包document 注入 ``(随 fiber 清理)
开机自启dsh.bundle

安装

pnpm dsh plugin --profile web add "G:\dsh-plugins\packages\attach-files"

装好后 pnpm dsh web 自动加载。源码改动经 link: 即时生效(改完只需重启 web)。

Host RPC 端点

/attach 连接 RPC 通道:

  • root { sessionId }{ root: string }(会话 cwd;兜底 workspaceRoot)
  • list { path }{ ok, path?, dirs[], files[] }
  • read { paths: string[] }{ ok: true, files: [{ path, content|null, truncated, note? }] }

依赖

  • Hostconnection 服务(dsh-web-app 已挂);fssessions / sessionPersistence(按会话查 cwd);sandboxPolicy(workspaceRoot 兜底)
  • Clientslotsconnection 服务;conversation.input.left 槽位