deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
中文 | English
A file explorer for DSH Web. A floating "Files" button opens a left drawer (workspace file tree); clicking a file floats a draggable/resizable preview box on the right. Clicking a "generated files" chip or a tool-row file link opens that file in the preview box instead of the OS default app.
| Light | Dark |
|---|---|
![]() |
![]() |
fileExplorer service; unregistered extensions fall back to the binary preview. Add protein-structure (.cif/.pdb → Mol*), CSV, etc. previewers without touching the core..pdf file opens it in a new browser tab with the browser's native PDF viewer (no PDF previewer needed).Ctrl/Cmd+Shift+E toggles the file drawer.From the git repository (recommended):
dsh plugin --profile web add github:wolfsonliu/dsh-file-explorer
dsh web
Or from a local checkout:
git clone https://github.com/wolfsonliu/dsh-file-explorer
cd dsh-file-explorer
npm install
npm run build
dsh plugin --profile web add .
dsh web
Install additional previewers for richer file previews:
# CodeMirror 6 code preview with syntax highlighting and editing
dsh plugin --profile web add github:wolfsonliu/dsh-file-explorer-preview-code
# Mol* molecular-structure preview (.cif / .pdb)
dsh plugin --profile web add github:wolfsonliu/dsh-file-explorer-preview-molstar
# SeqViz sequence viewer (FASTA / GenBank / JBEI / SnapGene / SBOL)
dsh plugin --profile web add github:wolfsonliu/dsh-file-explorer-preview-sequence
The bundle enables the following defaults:
- insert:
- id: file-explorer
name: '@dsh-external/dsh-file-explorer'
config:
maxTextBytes: 2097152
maxImageBytes: 10485760
maxBinaryBytes: 65536
| Config | Default | Description |
|---|---|---|
maxTextBytes |
2 MiB | Max size of a single text file to preview |
maxImageBytes |
10 MiB | Max size of a single image file to preview |
maxBinaryBytes |
64 KiB | Max bytes of a binary file to read for its hexdump |
The host half registers a /file-explorer/api exact route via ctx.webServer.register(). Actions (action query param):
list: lists one directory level (directories first, by name), returning BrowserEntry[].preview: reads one file, returning a discriminated FilePreview (text / image / empty / binary / too-large).pdf: streams a .pdf file inline (Content-Type: application/pdf) so the browser's native viewer renders it in a new tab.resolve-path: resolves a workspace-relative path to an absolute path and parent path.write: writes UTF-8 text to a workspace file (POST body { path, content }), returning the saved relative path.All paths pass a workspace-containment check (inside(root, input), including realpath symlink resolution); out-of-workspace paths are rejected. Text/binary is detected by a NUL-byte scan; images map extensions to MIME and return a data URL. Binary previews return the first maxBinaryBytes as base64 (plus a truncated flag) for a hexdump -C-style hex dump.
This plugin is a pure UI surface — it emits no session events and does not modify session logs, so it is invisible to the model. The host half only reads file content for browser preview, independent of agent tool execution.
_fileLink, data-produced-files-row); update the selectors if the upstream UI changes.maxTextBytes/maxImageBytes, and binary hexdumps read only the first maxBinaryBytes; streaming is not implemented.pdf action streams the whole file without Range/206 support, so very large PDFs download fully before the native viewer renders; byte-range seeking is deferred.dsh-file-explorer exposes the fileExplorer cordis service: registerPreview, registerFileAction, writeFile, and readRawFile. Domain experts can ship extensions as separate plugins (named @dsh-external/dsh-file-explorer-preview-<domain>) without touching the core.
See Developing a dsh-file-explorer extension (中文) for the full guide — contracts, routing, handling large/binary files with readRawFile, editing with writeFile, bundling, i18n, and reference implementations.
Quick skeleton:
import type { PreviewProps } from '@dsh-external/dsh-file-explorer/client'
export const inject = ['fileExplorer']
export function apply(ctx: {
fileExplorer: { registerPreview(ext: string, comp: React.ComponentType<PreviewProps>, priority?: number): () => void }
effect(cb: () => (() => void), label?: string): void
}): void {
ctx.effect(() => ctx.fileExplorer.registerPreview('cif', CifPreview, 10))
}
dsh-file-explorer is designed for extension through the fileExplorer service. Known extensions:
| Extension | Description | Repository |
|---|---|---|
dsh-file-explorer-preview-code |
CodeMirror 6 code preview with editing | wolfsonliu/dsh-file-explorer-preview-code |
dsh-file-explorer-preview-molstar |
Mol* molecular-structure preview (.cif / .pdb) |
wolfsonliu/dsh-file-explorer-preview-molstar |
dsh-file-explorer-preview-sequence |
SeqViz sequence viewer preview (FASTA / GenBank / JBEI / SnapGene / SBOL) | wolfsonliu/dsh-file-explorer-preview-sequence |
More extensions are welcome — build your own by following Developing a dsh-file-explorer extension.
npm install
npm run check # tsc type check
npm test # vitest unit tests
npm run build # tsc + tsdown (host ESM + client CJS bundle)
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。