Preface

When building DSH agents, it is common to reference workspace files, logs, CSVs, or artifact outputs in conversations. The default approach is often to download them first and then open them with a local application; switching back and forth for images, PDFs, JSONs, source code, and large logs is inconvenient.

dsh-file-viewer provides a read-only preview layer within the web page: open and view files directly in DeepSeek Harness without requiring external applications. It emphasizes Preview ≠ Execute: preview does not equal execution.

What is This

dsh-file-viewer is maintained by liguobao under the MIT license.

It is positioned as a read-only file preview plugin for DeepSeek Harness, supporting preview of images, PDFs, CSVs, Markdown, JSON, YAML, source code, and large files. The package.json version in the documentation is 0.3.1, and it provides configuration for client.platform as web; clues in the documentation also classify it as a client plugin.

Core Features

The following introduces verified capabilities.

Supported File Types

  • Image preview
  • PDF preview
  • CSV / TSV table preview
  • Text / Log preview
  • Source code preview
  • Markdown preview
  • JSON / JSONL preview
  • YAML preview
  • Unknown type fallback

Large File Strategy

Large files are processed by size tiers:

  • < 5 MB: Full file preview
  • 5–50 MB: Chunked processing
  • > 50 MB: Header loading, with optional continued loading

Read-Only Boundaries

The plugin is strictly read-only:

  • Preview does not execute shell commands
  • No script execution
  • No macro execution
  • No HTML execution
  • SVG is rendered via <img>
  • Markdown is cleaned before display

Client API

The plugin provides the fileViewer.openFile client API.

It can be used for:

  • Opening local paths
  • Opening artifact:// locators
  • Specifying line numbers
  • Forcing a specific renderer

Example interface:

fileViewer.openFile(path, { line, renderer })

Content Providers

The plugin supports other host/client plugins registering content providers to read custom locators, for example:

  • artifact://
  • object storage
  • remote APIs

Remote preview relies on endpoint allowlists from trusted transport plugins. openExternal is not part of the remote surface.

Theme Adaptation

Preview styles automatically adapt to the Harness theme’s light/dark mode.

Version Compatibility

Compatible starting from v0.3.1:

  • DSH v0.1.1-rc.2
  • DSH v0.1.2-alpha.1 package graph

DSH v0.1.2 alpha packages are host-provided peer dependencies. Some packages may not yet be published to npm; when regenerating the lockfile, keep:

autoInstallPeers: false

Installation and Enablement

Verified documentation does not show an explicit DSH plugin installation command. This article does not concatenate installation commands based on the plugin name; specific installation methods should follow the instructions provided in the plugin repository or directory page.

# Verified documentation does not show an official installation command, unverified commands are not used here

Configuration Example

Documentation configuration examples include enabled and extraRoots; default values are not fully explained.

# cordis.patch.yml / settings
- id: dsh-file-viewer
  name: dsh-file-viewer
  config:
    enabled: true
    extraRoots:
      - /srv/data

Here, extraRoots is used to add directories that are allowed to be read, such as /srv/data.

Workspace Menu Patch

The “Browse files” entry in the workspace row is a compatibility patch. After updating Harness, you need to re-run the patch script:

DSH_HARNESS_SOURCE=/path/to/deepseek-harness node scripts/patch-workspace-menu.mjs

This patch script can be run repeatedly; if a version mismatch occurs, the script will exit with an error.

Typical Usage

Open Local Files

You can directly open files within the workspace:

const fileViewer = ctx.get('fileViewer')

fileViewer.openFile('/workspace/output/report.csv')

Open artifact locator

You can also open artifact:// type locators:

fileViewer.openFile('artifact://run-42/report.csv')

Specify Line Number

When opening source code or text files, you can specify a line number:

fileViewer.openFile('/workspace/src/main.ts', { line: 125 })

Force Renderer

If you want to force a specific renderer, you can pass in renderer:

fileViewer.openFile('/workspace/data.bin', { renderer: 'text' })

Open via Workspace Menu

After the configuration and patch steps above, you can open files via the “Browse files” menu in the workspace row.

Register Content Provider on the Browser Side

Browser plugins can directly register content providers like memory://preview.md and call:

viewer.openFile('memory://preview.md')

Applicable Scenarios and Considerations

Suitable for the following scenarios:

  • Quickly viewing agent output files in DeepSeek Harness
  • Previewing CSV, JSON, YAML, Markdown, text, or source code in the workspace
  • Viewing files pointed to by artifact://
  • Handling large logs, large CSVs, or large text files
  • Allowing other DSH plugins to access preview via content providers

Pre-use considerations:

  • DSH plugins usually run within the permission scope of the current Harness process; source code, dependencies, and licenses should be checked before installation
  • The license for dsh-file-viewer is MIT
  • extraRoots expands the range of directories allowed to be read and should be configured as needed
  • The workspace browsing entry relies on a compatibility patch; after updating Harness, you need to re-run scripts/patch-workspace-menu.mjs
  • DSH v0.1.2-alpha.1 related peer dependencies may not yet be published to npm; when regenerating the lockfile, keep autoInstallPeers: false
  • Remote preview relies on endpoint allowlists from trusted transport plugins

References

  • Community Directory Page: https://www.skillhub.cn/plugins/liguobao/dsh-file-viewer
  • GitHub: https://github.com/liguobao/dsh-file-viewer

The community directory page is an independent site and is not equivalent to the DeepSeek or HF (Huanfang) official app store.