kw78/dsh-office-tools

Model-facing Office tools for DeepSeek Harness: Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) create/read/update with workspace-safe paths and PPT image embedding.

Bundle 已验证 MIT TypeScript 未知
Bundle 已验证

已收录

2

Docs

Bundle 已验证

版本未知
语言TypeScript
许可证MIT
在 GitHub 查看

预览

功能介绍

面向 agent 的工作区安全 Office 工具集:创建/读取 Word、创建/读取/更新 Excel、创建/读取 PowerPoint,并支持 PNG/JPG/GIF 图片排版。

适合

  • 需要在当前会话工作区内创建 Word 文档或提取其中纯文本的 Agent。
  • 需要通过工作表、标量网格和 A1 单元格地址创建、读取或更新 Excel 工作簿的流程。
  • 需要生成或检查含文本、备注及工作区内 PNG、JPG 或 GIF 图片的 16:9 PowerPoint 演示文稿的团队。

不适合

  • Office 文件或图片位于调用 Agent 会话工作区之外的场景。
  • 需要超出标题、段落、项目符号和单个表格的复杂 Word 编辑,或修改现有 PowerPoint 的流程。
  • 大型或不受限文档;读取上限为 50 MiB,单张图片上限为 20 MiB,文本或单元格结果可能截断。

README

dsh-office-tools

Seven model-facing Office file tools for DeepSeek Harness, running entirely in the plugin host half.

npm version ci License: MIT Listed on awesome-dsh-plugin

Install: dsh plugin --profile web add github:kw78/dsh-office-tools

Tool Purpose Library
word_create Create .docx (title, paragraphs, bullets, one table) docx
word_read Extract plain text from .docx mammoth
excel_create Create a multi-sheet .xlsx from scalar cell grids SheetJS (xlsx)
excel_read Read one or all sheets as scalar rows SheetJS
excel_update Replace/create whole sheets, or write cells by A1 address SheetJS
ppt_create Create a 16:9 .pptx (title slide, titles, paragraphs, bullets, notes, PNG/JPG/GIF images) pptxgenjs
ppt_read Extract per-slide paragraph text, speaker notes, and image counts jszip

Harness integration

The plugin follows the standard DSH host-plugin contract:

  • It exports name / inject / apply; inject = ['tools'] is its only runtime service dependency (@deepseek-ai/dsh-tools).
  • apply(ctx) wraps every ctx.tools.register(defineTool({...})) in ctx.effect(...) so Cordis disposes the registrations with the plugin fiber.
  • defineTool declares model-visible parameters, a validated canonical output.schema, and a pure output.render text projection.
  • execute(args, exec) resolves every path against exec.agent.session.header.cwd; relative paths stay in the session workspace and absolute paths are accepted only when still inside it. A realpath check on the nearest existing ancestor closes the symlink escape hatch.
  • Image files must live inside the session workspace (.png/.jpg/.jpeg/.gif, 20 MiB each); explicit inch coordinates x/y/w/h are supported, or omit them for automatic placement below the text.
  • Writes go through a same-directory temp file + rename; overwrite defaults to false.

Build

pnpm install
pnpm run check   # typecheck + tests + build

Artifacts: lib/index.js (ESM host bundle with Office libraries inlined; @deepseek-ai/* and cordis stay external) and lib/types/**/*.d.ts.

Install

# npm (recommended)
dsh plugin --profile web add dsh-office-tools

# GitHub source
dsh plugin --profile web add github:kw78/dsh-office-tools

# local checkout
dsh plugin --profile web add /path/to/dsh-office-tools

Restart the DSH server after installation. The seven tools appear in the next prompt assembly.

Community indexes

  • Registration blocks for awesome-dsh-plugin / dsh-market are in docs/hub-registration.md.
  • Recommended repository topics: dsh, dsh-plugin, deepseek-harness, office.

Safety

  • All file access is confined to the calling agent’s session workspace.
  • Reads are capped at 50 MiB; text/cell results are bounded and mark truncated.
  • Creates/updates are bounded by row and cell limits and refuse overwrites by default.
  • No LibreOffice/PowerPoint/Word subprocess is spawned; formats are generated and parsed with pure-JS libraries.

常见问题常见问题

在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:kw78/dsh-office-tools。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。