dsh-office-tools
DSH model-facing Office tools: create, read, and update Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files inside the session workspace.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kw78/dsh-office-tools说明文档
阅读完整 README ↗dsh-office-tools
为 DeepSeek Harness 提供 7 个模型可调用的 Office 文件工具,全部运行在 host 半。
安装:
dsh plugin --profile web add github:kw78/dsh-office-tools
| 工具 | 作用 | 依赖 |
|---|---|---|
word_create | 创建 .docx(标题、段落、项目符号、一个表格) | docx |
word_read | 提取 .docx 纯文本 | mammoth |
excel_create | 创建多 sheet 的 .xlsx(标量单元格网格) | SheetJS (xlsx) |
excel_read | 读取一个或全部 sheet,返回标量行 | SheetJS |
excel_update | 就地替换/新建整张 sheet,或按 A1 地址写单元格 | SheetJS |
ppt_create | 创建 16:9 .pptx(标题页、标题、段落、项目符号、备注、PNG/JPG/GIF 图片) | pptxgenjs |
ppt_read | 按页提取 .pptx 段落文本、演讲者备注与图片数量 | jszip |
框架接入方式
插件遵循 DSH 标准 host 插件契约:
- 模块导出
name/inject/apply;本插件inject = ['tools'],唯一运行时依赖是ctx.tools(@deepseek-ai/dsh-tools)。 apply(ctx)中用ctx.effect(() => ...)包裹ctx.tools.register(defineTool({...})),Cordis fiber 卸载时自动 dispose。defineTool统一声明parameters(模型可见 JSON Schema)、output.schema(强制校验的规范 JSON 值)与output.render(模型看到的文本投影)。- 每个
execute(args, exec)从exec.agent.session.header.cwd取会话工作目录;相对路径按该目录解析,绝对路径只接受仍位于工作目录内的路径,并对最近存在的祖先做realpath校验防止符号链接逃逸。