Preface¶
The document panel on the right sidebar of DeepSeek Harness (DSH) defaults to previewing common text-based files. If a .docx or .xlsx file is opened in the workspace, it falls back to a plain text renderer, displaying the message “Non-text file, preview is temporarily unavailable.” To draft prompts based on document content or verify spreadsheet data, users have to switch to system-installed Office/WPS or upload the file in a separate browser window—a workflow that breaks the path of “completing context work within Harness.”
dsh-office-preview is a client-side plugin released by the maintainer JohnGD. It parses OOXML within the browser to provide a read-only display of Word and Excel files without requiring Office installation or accessing external services. The following section outlines its capabilities, boundaries, installation methods, and usage notes.
What is this¶
dsh-office-preview targets the document panel on the DeepSeek Harness right sidebar, taking over the preview rendering for Word (.docx, etc.) and Excel (.xlsx, etc.) files.
- Maintainer: JohnGD
- Category: Client-side (all behavior occurs within the browser bundle)
- License: MIT (package.json version 1.0.0)
- Source & Docs: GitHub - JohnGD/dsh-office-preview
- Community Directory: SkillHub - dsh-office-preview (Independent community site, not officially affiliated with DeepSeek or High-Flyer)
Without this plugin installed, the aforementioned Office Open XML files continue to use the official plain text fallback. Once installed and enabled in Harness, clicking on the corresponding file in the sidebar will display a structured preview.
Core Functions¶
Supported Extensions and Rendered Content¶
| Extension | Rendered Content |
|---|---|
.docx .docm .dotx .dotm |
Heading levels; paragraphs (indentation and bullets); bold / italic / underline; tables (including nested tables) |
.xlsx .xlsm .xltx .xltm |
Worksheet tabs; row/column headers; merged cells; column widths; number and date formats; cached formula values |
Legacy binary formats (.doc, .xls) are not declared by this plugin and still use the plain text fallback; .pptx is currently out of scope.
Implementation Highlights (Client-side, Zero External Dependencies)¶
The plugin registers two renderers on the official extension points ctx.documentPreviews and the slot sidebar.right.tab.document. It does not patch Harness source code or call external services; aside from react, there are no additional runtime dependencies.
OOXML is processed within the browser: lib/client.js includes a built-in ZIP central directory reader (decompressing raw-DEFLATE via DecompressionStream) and a lightweight XML reader, without importing JSZip, SheetJS, or mammoth. lib/index.js is solely used to allow the Cordis loader to load the client entry point; all visible logic resides in the client half.
Harness compatibility is declared in package.json as dsh >= 0.1.1-rc.2, listing several marked compatible releases; the runtime environment requires Node >= 20.
Installation and Enablement¶
The plugin runs with the permissions of the current DSH process; it is recommended to review the repository source code and MIT license before installation to ensure compliance with your security policy.
Install from Plugin Market (Recommended)¶
In Harness: Settings → Plugin Market → Discover, search for dsh-office-preview, and restart Harness as prompted after installation.
Install via Pre-built Package (No Market, No npm required)¶
This package is not published to npm; the command provided in the official README is as follows:
dsh plugin --profile web add https://github.com/JohnGD/dsh-office-preview/releases/latest/download/dsh-office-preview.tgz
Offline Manual Installation¶
Windows uses install.ps1, while macOS and Linux use install.sh. Taking Windows as an example:
powershell -ExecutionPolicy Bypass -File install.ps1
The script performs three actions:
- Copies the package to
<home>\plugins\dsh-office-preview; - Creates a junction at
<home>\profiles\node_modules\dsh-office-previewpointing to that directory (the fallback root for the Cordis loader to resolve plugin entry names); - Appends an
insertline to the profile patch layer<home>\profiles\web\cordis.patch.yml, automatically backing up the file before modification.
The patch layer enables patchReload: live monitoring, so changes usually take effect upon refreshing the page (Ctrl+R); if no change occurs, restart DSH Desktop.
Do not enable both installation forms simultaneously: if the profile dependency (dsh plugin add or link:) and the install.ps1 / install.sh path mount the same plugin ID redundantly, conflicts will occur.
After installation, dsh-office-preview can be seen alongside built-in plugins in Harness → Settings → Plugin Manifest. It will only be listed in Plugin Market → Installed (marked as “Local Development”) if installed as a profile dependency.
Typical Usage¶
No separate command-line “open preview” is needed: select or open a supported file in the DSH workspace, and the right sidebar document panel will automatically use the renderer registered by this plugin.
The maintainer provides self-check scripts in the repository (requires Node >= 20). After cloning or downloading the source code, you can execute them in the plugin directory to verify parsing, rendering, and the client registration contract (The README example paths target the node bundled with Windows DSH Desktop):
$node = "$env:APPDATA\dsh-desktop\harness\.desktop-bin\node.cmd"
& $node test\parse.mjs samples\sample.xlsx samples\sample.docx
& $node test\render.mjs samples\sample.xlsx samples\sample.docx
& $node test\plugin.mjs
Upon success, each script outputs ALL CHECKS PASSED; the samples/ directory contains example workbooks and documents, so no external files are required.
Applicable Scenarios and Limitations¶
Suitable for: Read-only viewing of .docx / .xlsx body text and table structures within Harness; offline environments or those where installing Office is inconvenient; scenarios requiring preview data to remain local and not pass through third-party SaaS.
Boundaries and Limitations (from the official README):
- Read-only: The preview does not write back to the document.
- Images, comments, revision marks, charts, and macros are not rendered; however, related text content will still be displayed.
- The single file read limit is subject to the Harness
workspaceFiles.readAllconstraint, defaulting to 32 MiB. - Large tables are rendered up to a maximum of 4000 rows × 160 columns; exceeding this limit will trigger a prompt.
Uninstallation: If installed via install.ps1, run uninstall.ps1 (add -RemoveFiles to delete copied files); if installed as a profile dependency, remove it via Market → Installed → Uninstall.
Conclusion¶
dsh-office-preview integrates Word / Excel OOXML preview into the DSH right sidebar document panel: parsed within the browser, no Office required, and no network connection, aligning with DSH’s “Everything is a Plugin” extension approach. For capability details or to audit the implementation yourself, please refer to the GitHub repository README.
- Community Directory: https://www.skillhub.cn/plugins/JohnGD/dsh-office-preview
- Source & Installation Guide: https://github.com/JohnGD/dsh-office-preview