dsh-local-files: Manage Local Files in DSH Web

Preface

The DeepSeek Harness (DSH) Web right-side preview can already display text, code, images, PDFs, and some Office formats. However, for files outside the session workspace, large binary files, and operations like “download to local machine,” “upload,” and “archive,” there is either no entry point in the default product, or they are constrained by /api/file inline and byte limits. When developing agents or working locally, it is often necessary to directly browse host machine directories, modify small configurations, and drag files in within the same logged-in Web interface, rather than setting up a separate FTP or remote desktop.

Below is an introduction to the community plugin dsh-local-files (maintained by DeveloperYe), which registers routes on the same origin and Web port through ctx.webServer, reuses the authentication model of dsh-access-gate, does not open additional ports or start independent services, and has zero third-party runtime dependencies.

What Is This

dsh-local-files is a client-side plugin for DSH: it enables browsing, previewing, downloading, uploading, copy-pasting, online editing (for text types), creating new, renaming, and deleting local files in the browser. Classified as “client-side”—besides the independent file management page /-/files, it also injects entries like “download” and “file manager” into DSH’s right-side document preview, workspace file tree, and other locations.

The plugin is published on the SkillHub catalog and GitHub repository; the repository code is MIT licensed, and the licenses of bundled browser libraries such as mammoth and SheetJS are documented in THIRD-PARTY-NOTICES.md and lib/vendor/NOTICE.md within the repository.

Which Gaps Are Filled Compared to Default DSH

The gaps and corresponding capabilities summarized in the materials are as follows:

  1. The product side lacks a general “download to local machine” feature; this plugin provides single file download, directory ZIP, and selected items archive download, with ZIPs generated in a streaming manner on the host side.
  2. The file tree and preview by default only recognize the session workspace (workspaceFiles.list is limited to the workspace root); this plugin supports browsing entire disks according to configured root directory whitelists (automatically enumerating drive letters when no root is configured).
  3. Types without preview renderers like zip previously only showed “preview not supported”; this plugin provides clear download entries for non-previewable types, and adds “download to local machine / file manager” to the empty state on the client side.
  4. There were no entries for upload, copy-paste, or archive download; this plugin supports drag-and-drop upload, toolbar upload, cross-directory copy-paste (Ctrl+C / Ctrl+V), and saving xlsx cell edits as copies.

Version 0.2.0 also fixed the issue where relative path links containing .. in chat messages could not be claimed by the right sidebar: paths are normalized before opening resources—if still within the workspace, the workspace relative path is used; otherwise, the absolute path is used—avoiding errors like sidebarRight: no registered tab type claims.

Core Features

File Management Page and Navigation

Access http://<your DSH endpoint>/-/files (must be within the dsh-access-gate password gate, or navigated from the right-side preview/file tree buttons). The default homepage takes the configuration item home; when not configured, it falls to the first drive letter; the interface provides homepage, drive letter switching, breadcrumbs, and absolute path navigation.

Preview (Right Panel)

Common type behaviors include: images inline; PDF embedded reader; audio/video via <video> / <audio> with Range support; text/code monospace preview (default 512 KiB limit, configurable via maxTextBytes); Markdown client-side secure rendering; JSON beautification; CSV/TSV tables; HTML rendered in a sandboxed iframe with scripts disabled and viewable as source code.

Office and spreadsheets:

  • docx: Client-side lazy-loads mammoth for quick preview, with optional Host officeToPdf for “LibreOffice precision layout” conversion to PDF; online editing of docx body text is not supported (layout would be lost).
  • xlsx / xls / xlsm / ods: Lazy-loads SheetJS with multi-worksheet and row/column limit protection; supports “edit cells” and saving as new xlsx (formulas/merged cells etc. partially retained, charts, pivot tables, conditional formatting, VBA etc. will be lost, with interface prompts).
  • doc / ppt / pptx: Convert to PDF preview via Host officeToPdf; when the host service is not mounted, returns 501 with a download prompt.

When exceeding the default 64 MiB inline preview limit (maxPreviewBytes), client-side parsing is not performed and a download prompt is shown. Other binaries (zip, 7z, exe, etc.) provide “download to local machine.”

Download, Upload, and Directory Operations

  • Download: Row-level “download”, directory row “Zip”, toolbar checked items or current directory “archive download”.
  • Upload: Toolbar selection or drag into the list, streaming to disk (.part then atomic rename), automatic name (2).ext for same-name files, default single file limit 4 GiB.
  • Copy/Paste: Select and copy, then paste to target directory; directory recursive copy, default no overwrite of same names, prohibits copying to own subdirectory.
  • Create / Rename / Delete: Single-segment filename, rejecting names containing \ /; deletion defaults to moving to trashDir (default ~/.dsh-local-files-trash/<timestamp>/), root directories cannot be deleted.

Online Editing (Text Types)

Preview toolbar “Edit” → save goes through POST /-/files/api/write, with conflict detection using mtimeMs + size at read time (409 no overwrite), atomic writes via temporary file in same directory then rename; default single save limit 5 MiB (maxWriteBytes).

Integration with DSH Main Interface (Client Side)

  • Adds “Download” to the header of right-side document preview.
  • Adds “Download to Local Machine” and “File Manager” to non-previewable empty states.
  • Adds “File Manager” to the header of workspace file tree, opening /-/files?path=<current directory>.

The main route prefixes on the host side are /-/files and /-/files/api/* (list, text, raw, download, zip, office, upload, copy, write, create, rename, delete, etc.), see the repository README route table for details.

Installation and Activation

Requires Node.js ≥ 22, with peer dependency @deepseek-ai/cordis ^4.0.1. On a machine with DSH CLI installed, choose one of the following methods from the original materials:

# Install from npm (published artifact pre-bundled: dsh-local-files@0.1.0)
dsh plugin --profile web add dsh-local-files

# Install from GitHub (DSH ≥ 0.2.0-rc.2)
dsh plugin --profile web add github:DeveloperYe/dsh-local-files

# Install from local directory (for development)
dsh plugin --profile web add link:C:/path/to/dsh-local-files

Uninstall:

dsh plugin --profile web remove dsh-local-files

After installation, open /-/files in the browser, or enter from the right-side preview/file tree entries. The npm package and git installation contents are identical (including cordis.patch.yml and vendored renderers).

Configuration

In cordis.patch.yml, you can adjust the config of the plugin local-files, for example:

- id: local-files
  config:
    home: 'D:\workspace'      # Default directory when opening (empty = first drive letter)
    roots: []                 # Empty = automatically enumerate all drive letters; can also write ['C:\\', 'D:\\data']
    maxTextBytes: 524288      # Text preview limit (512 KiB)
    maxPreviewBytes: 67108864 # Inline preview limit (64 MiB)
    maxUploadBytes: 4294967296 # Single file upload limit (4 GiB)
    maxCopyEntries: 20000     # Maximum number of entries for one copy/move
    maxWriteBytes: 5242880    # Online save content limit (5 MiB)
    trashDir: 'C:\Users\<you>\.dsh-local-files-trash'  # Deletion recycle bin directory

Typical Usage

  1. Install the plugin and ensure the Web configuration has dsh-access-gate access password enabled.
  2. After logging into DSH Web, open /-/files, use drive letters and breadcrumbs to navigate to the target directory.
  3. To put local files into a directory: drag into the list or use the toolbar “Upload”.
  4. To modify json / md / code: select file preview → “Edit” → Ctrl+S to save; if others have modified the file, reload as prompted before writing.
  5. When clicking workspace relative paths or links slightly outside the workspace in chat, the client normalizes them so the preview or file manager can still be opened instead of tab registration failures.
  6. To view docx/xlsx in DSH’s built-in preview: use the plugin-enhanced preview; for large files or password-protected workbooks, follow interface prompts to download.

The repository provides smoke tests (need to be executed in the plugin directory):

node test\smoke.mjs         # Host routes
node test\client-smoke.mjs  # Client side

Applicable Scenarios and Notes

Suitable for: Developers already using DSH Web who want to manage local machine directories within the same authentication boundary; scenarios requiring supplementary download/upload/archiving, workspace-external path browsing, and Office and spreadsheet browser preview.

Security and Permissions (must read the README security section):

  • Plugin logic accesses the file system with the current dsh process permissions; review the source code and license yourself before installation.
  • The trust model is consistent with the official /api: relies on dsh-access-gate to rewrite Host to 127.0.0.1 after authentication passes; unauthenticated remote requests get 403. When the gate is not enabled, write operations are equivalent to exposing the entire disk to anyone who can access the port; when deploying, access password must be enabled simultaneously.
  • Paths are validated through realpath and whitelist root checks, .. traversal is invalid; write operations have conflict detection, recycle bin deletion, and single-segment filename restrictions.

Community catalogs like SkillHub are independent sites with no official affiliation with DeepSeek / High-Flyer; plugin star counts and popularity are based on data at the time on each site (catalog clues show 0 stars).

Conclusion

dsh-local-files supplements DSH Web into a “local file manager in a same-origin, authenticated environment”: no additional ports opened, using whitelist roots and gate models to constrain exposure, and integrates with the right-side preview and file tree. For further information and issue reporting, visit the SkillHub plugin page and GitHub: DeveloperYe/dsh-local-files.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye