DSH-Moyu Reader: Reading Local TXT Novels in the Right Sidebar of DSH Web

Introduction

When running long sessions, viewing logs, or debugging plugins in DSH Web, the common practice to browse local .txt files without leaving the interface is to open a separate editor or browser tab. With multiple windows, it is easy to lose context between reading and conversation; furthermore, quickly collapsing the interface often requires switching the entire page or manually closing panels.

Here, we introduce the community plugin dsh-moyu-reader (Maintainer: XIAOZHAOXSXH; Category: Client). It opens a reader in the right sidebar of the DSH Web UI as a tab, supporting local .txt files, chapter splitting, encoding detection, and one-click hiding (Boss key). The plugin follows the DSH “Everything is a plugin” extension approach; installation and configuration are handled via the official CLI and Settings → Plugins. It is not officially affiliated with DeepSeek or Highflyer. See the SkillHub directory page for details and GitHub for the source code.

What is this

dsh-moyu-reader is a client plugin designed for the DSH Web profile: The Host reads local text via fs, and the Client renders the reading interface in the right sidebar. The two communicate exclusively via a JSON bridge at POST /dsh-moyu-reader/api. It does not modify your files; it performs a read-only display. Reading progress, bookmarks, and other states are saved within the current DSH process and will be lost after restarting DSH (Configuration settings are written to settings.yaml and persist).

Core Features

Reading in the Right Sidebar, Not Pop-ups

The reader opens as a tab in the right sidebar alongside the conversation (labeled “小说阅读器” in the interface). When switching conversations, you do not need to track separate window states to find “where you left off.”

Boss Key and Entry Points

  • Default Boss Key: Ctrl+\`` (Windows/Linux) or⌘+`on macOS. This can be changed via thehotkeysetting, and you can choose to collapse only the reader or the entire right sidebar (hotkeyHidesSidebar`).
  • Three entry points can be toggled independently: Button at the bottom of the left sidebar (launcherFooter), button at the conversation header (launcherHeader), and a floating ball at the bottom right (floatingBall, disabled by default).

Shelf and Chapters

  • Shelf: Browse local directories, filter out non-text files, and remember recently opened books.
  • Auto Chapter Splitting: Recognizes titles like 第一章 (Chapter 1), 第 1 章, Chapter 1. If no chapter titles are found, it splits by fixed character count (default fallbackChunkChars is 6000).
  • Chinese Encoding: Supports UTF-8, UTF-8 with BOM, UTF-16 LE/BE, GB18030/GBK, and Big5, including edge cases like “GBK text consisting almost entirely of ASCII characters being misidentified as UTF-8.”

Reading Experience

Full-text search (with snippets), bookmarks, progress memory (returning to the last position when reopened within the same process). Adjustable font size (12–30 px), line height, font family (serif / sans / kai), theme (Follow DSH / sepia / dark / light), first-line indentation, and text alignment (justified).

Integration with DSH Settings

Options are centralized in the plugin’s card under Settings → Plugins. Changes take effect immediately and are written to settings.yaml. Disabling the plugin (enabled: false) hides all entry points and the boss key but will not delete saved reading states (as long as the process is still running).

Installation and Enabling

The plugin declares a bundled patch. After installation, do not manually add insert lines to the profile’s cordis.patch.yml, as this will result in duplicate mounting.

  1. Add the plugin under the web profile:
dsh plugin --profile web add dsh-moyu-reader
  1. Restart the profile to load the plugin.

The environment requires Node.js >= 20 (see the engines field in the repository’s package.json). The current repository version is 1.0.0, licensed under MIT.

Typical Usage

  1. Open the reader from the bottom of the left sidebar, the conversation header, or (if enabled) the floating ball at the bottom right; alternatively, select the 小说阅读器 (Novel Reader) tab in the right sidebar.

  2. Navigate directories under defaultDir (default: current working directory) in the Shelf and select a .txt file. Single file size is limited by maxBookBytes (default 100663296 bytes, i.e., 96 MiB).

  3. Use the Boss Key to quickly hide the interface while reading; adjust themes, fonts, and Boss Key behavior in the plugin settings as needed.

The Host side performs exact matching for the bridge route, validates Origin, and limits the request body to 1 MiB. The Client is a lazy-loaded CJS module registered on window.__ModuleLoader__, with no additional bundlers involved in runtime loading.

Use Cases and Notes

Who is it for: Users who primarily develop or operate agents within DSH Web, wish to read local .txt files for reference or leisure on the same screen, and require quick hiding capabilities.

Permissions & Security: The plugin reads files in configured directories via fs using the permissions of the current DSH process. You should review the source code and MIT license at the GitHub repository before installation to ensure that defaultDir and the readable scope comply with your security policy.

Known Limitations (From the original README):

  • Reading state (recent books, progress, bookmarks) is in-process state; it persists if the reader is closed but is lost if DSH is restarted. Only configuration items are persisted.
  • Read-only; does not write to files.
  • Chapter recognition is heuristic; unconventional titles may degrade to fixed-length chunking.

Configuration Reference

The following default values and meanings are derived from the official README. All can be modified in Settings → Plugins:

Key Default Description
enabled true Master switch
hotkey mod+\`` | Boss Key;mod` is Ctrl on Windows/Linux, ⌘ on macOS
hotkeyHidesSidebar true Whether the Boss Key collapses the entire right sidebar
launcherFooter true Entry point at the bottom of the left sidebar
launcherHeader true Entry point at the conversation header
floatingBall false Floating ball at the bottom right corner
defaultDir (Working Dir) Initial directory for the Shelf
theme auto auto / sepia / dark / light
fontSize 17 Font size (px)
lineHeight 1.95 Line height
family serif serif / sans / kai
indent true First-line paragraph indentation
justify true Text alignment (justified)
maxBookBytes 100663296 Max bytes per file
fallbackChunkChars 6000 Chunk character count when no chapter titles exist

Conclusion

Following the steps above, you can read, search, and remember progress for local .txt files within the DSH Web right sidebar, and hide the interface on demand with the Boss Key. Community Directory: https://www.skillhub.cn/plugins/XIAOZHAOXSXH/dsh-moyu-reader; Source Code & Issue Reporting: https://github.com/XIAOZHAOXSXH/dsh-moyu-reader.

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

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

Xiaoye