DeepSeek Media Gallery: Translucent Sidebar for Local Browsing and Generated Images

Preface

When running image generation, MCP image tasks, or various plugin tasks in DSH (DeepSeek Harness), outputs typically land in fixed directories under $DSH_HOME/plugin-data, with records scattered across tasks.json and mcp-records.json. If you rely solely on a file manager to browse directories, it’s hard to align artifacts with task metadata (prompt, modelId, timestamps). If you make the gallery a persistent panel occupying the central chat area, it crowds the conversation. Below we introduce the community plugin deepseek-media-gallery (maintainer: yuanyiHY): open a semi-transparent popup via a footer button in the sidebar to list, preview, Range-play, download, and delete media locally, without occupying the main chat area.

What is this

DeepSeek Media Gallery is a client + host combo plugin in the DSH (cordis) ecosystem: the host side registers local HTTP routes and file I/O on the Node side; the browser side is injected via window.__ModuleLoader__.load, registering an entry in the sidebar and rendering a React popup in a frame-level overlay (not an iframe). It is classified as a client capability; all media reading and writing happens on the local file system—no network access, no uploads.

Architecture: two halves, each handling a segment

The plugin is deliberately split into two tracks to avoid confusion with the standalone debug pages under client/:

Half Files Role
Host (Node) lib/index.js cordis plugin: registers <prefix>/* routes, provides APIs and a static standalone page
Browser lib/client.js DSH client plugin: registers a button and popup via ctx.slots inside apply(ctx)

client/index.html + client/client.js are served by the host routes <prefix>/ and <prefix>/client.js, for opening the gallery directly in the browser for debugging; they are not the same scripts as lib/client.js.

Entry and interactions: without occupying the central area

Slot registration (as per the source documentation):

Slot kind Registered item Description
sidebar.footer.action list { id: 'media-gallery-panel', order: 60 } Entry in the sidebar footer (next to Settings), with props like wide
shell.overlay list { id: 'media-gallery-panel', order: 60 } Frame-level overlay, the popup itself

It does not register main / sidebar.panellist, to avoid turning the gallery into a persistent central panel. When the popup is closed, the component returns null, so it does not persist in the DOM.

Ways to close: the close button in the top-right corner, clicking the backdrop, or pressing Esc (first closes the preview large image, then the window).

Visually, the semi-transparent background uses the same tokens as dsh-rail-equalizer (visual pulse): the popup base color uses var(--dsw-specific-input-major, …), cards use var(--dsw-specific-bubble, …), blur uses blur(var(--we-blur,16px)) saturate(var(--we-saturate,1.8)); when no wallpaper-engine theme is present, it falls back to the official --dsw-alias-*.

Core features

Media list and fallback scanning

GET /api/tasks merges three sources and deduplicates by file name (for duplicates, the entry in tasks.json is kept):

  1. tasks.json under dataRoot: only items with status === "done" and files still present are shown.
  2. mcp-records.json: files registered by, for example, MCP image generation (ofapp-image-mcp).
  3. Directory scan fallback: media present in the image directory but not registered will also be listed (capped at 500, sorted by modification time descending, adapterId: "scan"). Thus you can point generatedDir to a plain image folder and use it directly.

Preview and Range playback

GET /api/media/:filename supports Range requests (e.g., bytes=0-9, bytes=-10, bytes=50-); out-of-range or malformed requests return 416, enabling segmented video loading.

Download (copy, does not delete originals)

Method Behavior
Card ⤓ / “Download” inside preview POST /api/download, server copies to the download directory; original file unchanged
Copy failure (e.g., no write permission) Falls back to browser download via GET <prefix>/api/file/<name> (Content-Disposition: attachment)

Same-name files are not overwritten: the second copy is saved as name (2).ext. Only deletion removes archived files; do not confuse it with “clear the download directory.”

Deletion (irreversible)

DELETE /api/tasks/:id with request body containing { "filename": "..." }: deletes both the record and the disk file, and cleans up the corresponding MCP record. filename accepts only bare file names within the media directory; path separators, .., :, and NUL are rejected.

Settings: three paths, effective immediately on save

Open settings via the gear icon in the popup’s top-right corner. All three can be changed, and saving takes effect immediately without restarting the host (each API call reads config live):

Key Meaning Default
generatedDir Directory scanned for images/videos $DSH_HOME/plugin-data/image-gen/generated
dataRoot Directory containing tasks.json / mcp-records.json $DSH_HOME/plugin-data/media-gallery
downloadDir Download target Auto-detected Desktop

“Choose…” prefers the host’s native directory dialog (ctx.uiWorkspace.pickDirectory()); on failure it falls back to the built-in directory browser (drive list, breadcrumb, new folder, “Go to” path input, supporting E:\ and UNC). On Linux, the native dialog depends on zenity/kdialog and DISPLAY; when native pick is unavailable on Windows/macOS, it uses the browse capability.

Config precedence: user-saved values in the panel > config in the profile’s cordis.patch.yml > environment variables > defaults. generatedDir / dataRoot can also be seeded via DEEPSEEK_MEDIA_GENERATED_DIR / DEEPSEEK_MEDIA_DATA_DIR (through the dsh-settings composition layer).

The host Config (schemastery schema) also includes these seed items:

Key Default Description
routePrefix /deepseek-media-gallery Route prefix
dshHome "" If empty, uses DSH_HOME
generatedDir / dataRoot / downloadDir "" Panel-saved values take precedence

The browser half composes request URLs using the PREFIX constant at the top of lib/client.js; if you change routePrefix, you must also update this constant.

Host API overview

The default prefix is /deepseek-media-gallery:

Method Path Description
GET / Standalone debug page
GET /client.js Script for the standalone page
GET /api/tasks Media list
GET /api/media/:filename Media streaming (Range)
GET /api/file/:filename Fallback attachment download
GET /api/drives Built-in browser roots (Windows drives / POSIX /)
GET /api/settings Current values, defaults, directory status
POST /api/settings Update paths (empty string reverts to default)
POST /api/download Copy to the download directory
DELETE /api/tasks/:id Delete record and file

Routes are mounted on the DSH local web server (default 127.0.0.1) with no additional authentication; do not expose routePrefix to the public internet.

Installation and enabling

The installation instructions in the documentation center on the npm package + cordis bundle patch approach; no single-line dsh plugin add … command is provided, so we will not speculate a CLI string here. Key package structure points:

  • package.json’s dsh.bundle.patch points to cordis.patch.yml, inserting the plugin into the profile layer stack.
  • dsh.client declares the browser half; exports["./client"] maps to lib/client.js.
  • Peer dependencies (e.g., @deepseek-ai/cordis, @deepseek-ai/dsh-host-webserver, various dsh-client-ui-*, react, etc.) resolve from the profile’s node_modules.
  • Node engine: >=18.

After installing or updating the bundle, you must restart the DSH host to reload the plugin; this is a different mechanism from changing paths in the settings page (which applies immediately).

For the concrete steps to install into the current profile from the SkillHub directory or npm, follow the documentation on the directory page and the repository README at the time: https://www.skillhub.cn/plugins/yuanyiHY/deepseek-media-gallery.

Typical usage

  1. After enabling the plugin and restarting the host, find the media gallery entry at the bottom of the DSH sidebar and open the semi-transparent popup.
  2. If no image generation plugin has written to tasks.json yet, confirm or change generatedDir in settings to point to an existing image/video directory; after saving, refresh the list to see scan results.
  3. Click an entry to preview; videos can leverage Range playback. For backup, use download (copies to downloadDir); delete only after confirming it’s unnecessary (irreversible).
  4. For development/debugging, you can run a local preview (per the repository README):
npm test
node test/preview.mjs --port 43199 \
  --generated "<image-dir>" --data "<records-dir>"

npm test runs 60 host-side tests plus 73 browser-side tests; the test script copies lib/ and client/ into a temporary directory under ~/.dsh/profiles/ before execution.

Use cases and cautions

Who it’s for: developers using DSH or MCP for local image generation who need to centrally view prompt/model metadata without taking over the main chat area.

Limitations and risks (from the README’s “Notes and Limitations”):

  • Purely local; indexing depends on JSON files under dataRoot; if unregistered, it relies on directory scanning.
  • The plugin reads and writes files with the current DSH process permissions; review the source and the MIT license before installing.
  • Platforms: Windows / macOS / Linux all supported; on non-Linux systems, directory pickers often use the built-in browser.
  • Deletion is irreversible; download is a copy, not a replacement for version control or cloud backup.

The DSH community plugin directory (SkillHub) is an independent site with no official affiliation with DeepSeek / High-Flyer; the ecosystem philosophy is “everything is a plugin,” and this plugin is a complement focused on client UI + local media management.

Conclusion

DeepSeek Media Gallery brings the management of image generation outputs into a sidebar popup: list, preview, Range, download, and delete are all done locally, and it shares the semi-transparent aesthetic with the equalizer theme. For details, issues, or to contribute code, see the GitHub repository: https://github.com/yuanyiHY/deepseek-media-gallery; plugin index on SkillHub: https://www.skillhub.cn/plugins/yuanyiHY/deepseek-media-gallery.

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

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

Xiaoye