When processing files in DeepSeek Harness (DSH), directly feeding the full content (such as Excel or PDF) into the model consumes a large number of tokens. dsh-plugin-office-markdown converts files to Markdown format before the model reads them, thereby reducing the context input volume.
What is This¶
This is a Bundle plugin maintained by Z8906. It solves the problem of high token consumption when reading large Office or PDF files in DSH. By converting files to Markdown locally, the plugin replaces the full document text with a file path, which saves tokens and avoids uploading sensitive content to the cloud.
Core Features¶
- File Conversion: Convert Office / PDF files to Markdown.
- Path Substitution: Replace the full text with a file path to save tokens.
- Local Execution: Local conversion, no API quota consumption.
- Lightweight: 0 npm dependencies.
- Ownership: Artifacts belong to the user.
- Auto-Cleanup: Automatically clean up Python environments upon uninstallation.
- Batch Support: Supports batch conversion and structural indexing.
- Configuration Interface: Built-in settings page for configuring the MarkItDown environment.
Installation and Activation¶
- Ensure your Node version is ≥ 18.
- In the DSH Settings → Plugins → Install interface, enter the plugin name and press Enter.
- Enter the following content to install:
dsh-plugin-office-markdown
A DSH restart is required after installation.
Typical Usage¶
After installation, you can use the conversion feature via tool calls or natural language instructions. Below are examples of available parameters:
- Single File Conversion:
read_office_as_markdown({ path: "报表.xlsx" })
- Batch Conversion:
read_office_as_markdown({ paths: [...] })
- Get Structural Index Only (does not trigger conversion):
read_office_as_markdown({ action: "outline" })
- Clean Up Old Artifacts:
read_office_as_markdown({ action: "clean" })
- View Converter Status:
read_office_as_markdown({ action: "status" })
Upon invocation, the plugin returns the path, size, and line count of the converted .md file, as well as a structural index (headings and line numbers for chapters/worksheets/slides), and provides reading suggestions.
Use Cases and Notes¶
- Use Cases: Scenarios where Office documents (.docx, .docm, .xlsx, .xlsm, .pptx, .pptm) or PDF files in the workspace need to be processed and token consumption needs to be reduced.
- Dependency Requirements: Requires Node ≥ 18; the plugin itself has 0 npm dependencies.
- File Support: Supports new Office formats. .pdf and legacy binary formats (.doc, .xls, .ppt) require MarkItDown or Python environment support.
- Uninstallation Behavior: Uninstalling the plugin cleans up Python environments it has registered, which is different from disabling or turning off the plugin.
- Permission Notes: The plugin runs with the permissions of the current DSH process; please ensure you review the source code and license before installation.
Summary¶
dsh-plugin-office-markdown helps DSH users significantly reduce token consumption when processing documents through local conversion and path reference mechanisms. It supports multiple file formats and batch operations, and provides a built-in settings page to manage the MarkItDown environment.