DeepSHPlugins
dsh-office-tools 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-office-tools

工具與整合TypeScriptMIT

面向 agent 的工作區安全 Office 工具集:建立/讀取 Word、建立/讀取/更新 Excel、建立/讀取 PowerPoint,並支援 PNG/JPG/GIF 圖片排版。

14 Starskw78 更新時間 2026-09-04
訪問 GitHub 倉庫
dsh-office-tools 專案預覽

專案介紹

中文

面向 agent 的工作區安全 Office 工具集:建立/讀取 Word、建立/讀取/更新 Excel、建立/讀取 PowerPoint,並支援 PNG/JPG/GIF 圖片排版。

English

Workspace-safe Office tools for agents: create/read Word, create/read/update Excel, and create/read PowerPoint decks with PNG/JPG/GIF image placement.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
kw78
倉庫
kw78/dsh-office-tools
GitHub Stars
14
Forks
4
開發語言
TypeScript
許可證
MIT
最近推送
2026-09-04
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

82/ 100
維護活躍
96
文件與實用資訊
85
生態關注度
48
安裝便捷訊號
100
專案宣告訊號
100

近 7 天仍在更新;README 含完整安裝與使用說明;標準命令一鍵安裝。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add dsh-office-tools

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-office-tools

Eight 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
DSH Store lists a fixed Commit; verify the installed source against it: ae1ddd40f98debf4b1430748d287951f35faaf36 (tag v1.0.0). Later commits on main carry test/doc additions only unless the version bumps.

Eight model-facing Office file tools for DeepSeek Harness, running entirely in the plugin host half — dependency-free since 1.0.0: every package is generated and parsed by this plugin's own OOXML engine, and every byte crosses the official DSH filesystem service (ctx.fs), never the raw file system.

ToolPurpose
word_createCreate .docx (title, paragraphs, bullets, one table)
word_readExtract text from any .docx; format: "markdown" renders headings, lists, and tables structurally
word_updateAppend paragraphs, bullets, and/or a table to an existing .docx
excel_createCreate a multi-sheet .xlsx from scalar cell grids
excel_readRead one or all sheets as scalar rows; formulas return cached values or '=…' strings
excel_updateReplace/create whole sheets, or write cells by A1 address
ppt_createCreate a 16:9 .pptx (title slide, titles, paragraphs, bullets, notes, linked PNG/JPG/GIF images) and echo every element's landing position
ppt_readExtract per-slide paragraphs, tables, speaker notes, image counts, alt texts — plus every shape's bounding box in inches and a text wireframe sketch

String cells starting with = are written as real Excel formulas (Excel computes them on open).

Demo

One prompt, a quarterly-report trio — Word with a metrics table, Excel with =SUM/variance formulas, PowerPoint with speaker notes:

One prompt generating report.docx, budget.xlsx, and deck.pptx

The prompt behind that session:

Generate the Q3 quarterly-report trio: report.docx (title, two summary paragraphs, three highlights, a metrics table), budget.xlsx (a Budget sheet with =SUM totals and plan-vs-actual variance formulas, plus a Summary sheet), and deck.pptx (title slide + three content slides with speaker notes).

The model turns it into word_create → excel_create → ppt_create (reads come back through word_read / excel_read / ppt_read; freshly written formulas read back as '=…' strings until Excel caches values). The whole flow is pinned by tests/demo-trio.spec.ts, so the demo cannot drift from the tools. The file sizes in the image come from a real run of that test scenario.

Harness integration

The plugin follows the standard DSH host-plugin contract:

  • It exports name / inject / apply / Config; inject = ['tools', 'fs'] — the official tool registry and the official filesystem service (@deepseek-ai/dsh-tools, @deepseek-ai/dsh-fs) are its only runtime service dependencies.
  • 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. Containment and symlink resolution are enforced by the ctx.fs backend (plus a lexical pre-check here).
  • All reads arrive as raw bytes via ctx.fs.readBytes; all writes leave as UTF-8 text via ctx.fs.writeText — published atomically by the backend; overwrite defaults to false.
  • Generated packages are pure ASCII by construction (an ASCII-safe STORE zip planner pads each XML part and aligns offsets so every CRC/size/offset field stays byte-safe), which is exactly what lets real .docx/.xlsx/.pptx files travel through the text channel byte-identically. Non-ASCII text encodes as XML character references; every Office suite opens the result.
  • Reads accept any real-world package (STORE and DEFLATE entries, bounded by the zip-bomb guard).
  • word_update / excel_update re-publish through the text channel, so they work on packages whose every part is text (always true for files these tools write, and for OOXML packages without binary media); packages carrying binary media are refused with a clear error instead of being corrupted.
  • Images are LINKED, not embedded: the model controls placement fully (x/y/w/h inches, contain/cover cropping, alt text; PNG/JPG/GIF headers are sniffed so omitted dimensions default to natural size), and the deck references the workspace image file. Keep the image files next to the deck when moving it — that is the trade-off of a dependency-free, binary-free package.
  • ppt_create echoes the full layout (every element's box in inches + the canvas size + a text wireframe sketch per slide); ppt_read returns the same geometry for any deck, so the model can see and re-author compositions.

Build

pnpm install
pnpm run check   # typecheck + tests + build

Artifacts: lib/index.js (ESM host bundle of this plugin's own code only — ~116 kB, zero runtime dependencies) and lib/types/**/*.d.ts. Every @deepseek-ai/* package (cordis, the dsh services, schemastery) stays external and is provided by the profile's node_modules.

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 eight tools appear in the next prompt assembly. Since 1.0.0 the plugin has zero runtime dependencies — no npm fetch, no CDN, no postinstall scripts; installation is the committed source, nothing else. The host must provide the fs service (every DSH profile that ships the built-in read/write tools does).

Configuration

The plugin declares a schemastery Config the Loader validates at load time. One option exists today:

OptionTypeDefaultEffect
enablePptToolsbooleantrueRegister ppt_create / ppt_read. Set to false to load this plugin for Word/Excel only.

enablePptTools: false exists for coexistence: dedicated presentation plugins such as dsh-ppt also register a ppt_create, and DSH refuses duplicate tool names at startup (tool "ppt_create" is already registered). Disable the PPT pair here and let the dedicated plugin own presentations:

# profile cordis.patch.yml
- insert:
    - id: dsh-office-tools
      config:
        enablePptTools: false

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 compressed; before anything is inflated, the archive's own declared sizes are checked against budgets (256 MiB per entry, 512 MiB per archive, 100 000 entries), so zip bombs are refused rather than decompressed. XML parts carrying DOCTYPE/ENTITY declarations are refused outright.
  • 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 and no third-party library is shipped: formats are generated and parsed by this plugin's own ASCII-safe OOXML engine over node:zlib.
  • The plugin's own code never touches the file system directly — there is no node:fs import anywhere in src/; every byte flows through the official, user-visible ctx.fs service. This is what lets third-party store automation verify the whole runtime source deterministically (DSH Store issue #334: 1.0.0 passes the complete automatic low-risk policy — zero runtime dependencies, zero file/network/commands/credentials signals, bounded source, exact per-release compatibility declarations).
  • Roadmap: docs/ROADMAP.md.

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案