DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

File Explorer Preview Code — DeepSeek Harness 插件(DSH Plugin)
← Plugins
F

@dsh-external/dsh-file-explorer-preview-code

File Explorer Preview Code

适用于 DSH Web 的 CodeMirror 6 代码预览和编辑器,通过按语言提供语法高亮,覆盖 dsh-file-explorer 的纯文本预览

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:wolfsonliu/dsh-file-explorer-preview-code#52c686b65b1460ea30d3b0fc8d3f3c825ed897e5
README兼容性版本
Code preview in dark themeCode preview in light theme

兼容性与来源证明

File Explorer Preview Code 以 @dsh-external/dsh-file-explorer-preview-code 发布,当前版本为 0.4.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/1

版本

0.4.0stable
2026/9/1
0.3.0stable
2026/8/23

相关插件

正在加载相关插件…

最新版
0.4.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/9/1
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Cc Safety Netcc-safety-net编码代理 CLI 钩子——阻止破坏性命令和访问机密文件Opsdsh-ops为 Windows DSH 提供 bash、PowerShell 7 以及一套使用 Rust 编写的高性能工具,以提升令牌效率Skills Manager@michengai/dsh-skills-managerDSH Skills Manager — 在 DeepSeek Harness 中统一加载并安全管理本机 Agent Skills · 在 DSH 中加载并安全管理本地 Agent SkillsDSCODE Desktop@toddzheng024/dscode-desktop为 Harness Desktop 提供编码协作、记忆、浏览器工作流和任务管理功能。

README

dsh-file-explorer-preview-code

中文 | English

A CodeMirror 6 code preview and editor for DSH Web, built on codemirror (basicSetup) + @codemirror/language-data (per-language highlighting) + @codemirror/theme-one-dark (dark theme). It registers a named Code Editor viewer and overrides dsh-file-explorer's built-in plain-text preview (priority 0) at priority 10, giving code files syntax highlighting plus in-place editing with autosave.

Screenshots

Dark themeLight theme
Code preview in dark themeCode preview in light theme

Features

  1. Syntax highlighting: resolves the language from the file name via @codemirror/language-data (~90 languages), so .ts/.tsx/.js/.jsx/.json/.css/.html/.py/.yaml/.yml/.toml/.sh/.go/.rs/.java/.c/.cpp/.h/.xml/.sql/.ini each get the right tokens.
  2. In-place editing: the preview is a real CodeMirror editor (line numbers, undo/redo, line wrapping), not a read-only <pre>.
  3. Autosave: edits save 500ms after the last keystroke, plus Ctrl/Cmd+S saves immediately.
  4. Save status bar: a slim footer shows the language, Ln/Col cursor position, and the save state (Unsaved / Saving… / Saved / Save failed) with a manual Save button.
  5. Theme-aware: highlighting follows DSH's dark/light toggle (data-ds-dark-theme) live.
  6. Selectable viewer: registered as one named "Code Editor" viewer via registerViewer, so it appears alongside the built-in "Text" viewer in the file row's Open with… menu and the preview-panel switcher.

Dependencies

This plugin requires @dsh-external/dsh-file-explorer — it injects the fileExplorer cordis service, which provides registerViewer (named viewers), registerPreview (legacy anonymous override), readRawFile, and writeFile (the save path). The named "Code Editor" viewer needs core v0.9.0+; older cores fall back to the anonymous per-extension override. Install and enable dsh-file-explorer before this plugin:

git clone https://github.com/wolfsonliu/dsh-file-explorer.git
cd dsh-file-explorer
npm install && npm run build
dsh plugin --profile web add .

@dsh-external/dsh-file-explorer is installed from git (github:wolfsonliu/dsh-file-explorer) so tsc resolves its ./client type definitions. To develop against an unpublished local checkout instead, point that dependency at your own path.

Install

From the git repository:

git clone https://github.com/wolfsonliu/dsh-file-explorer-preview-code.git
cd dsh-file-explorer-preview-code
npm install && npm run build
dsh plugin --profile web add .
dsh web

How it works

The client entry injects fileExplorer and locale, then registers one CodePreview component for every code extension at priority 10. On core v0.9.0+ it uses registerViewer, exposing a single named Code Editor viewer in Open with…; on older cores it falls back to the anonymous per-extension registerPreview loop:

export const inject = ['fileExplorer', 'locale']

export function apply(ctx) {
  ctx.effect(() => {
    const readRaw = typeof ctx.fileExplorer.readRawFile === 'function'
      ? ctx.fileExplorer.readRawFile.bind(ctx.fileExplorer)
      : undefined
    const component = makeCodePreview(ctx.fileExplorer.writeFile, readRaw, ctx.locale.bind(CODE_NS))
    const dispose = registerCodeViewer(ctx.fileExplorer, component)
    return () => dispose()
  })
}

function registerCodeViewer(fileExplorer, component) {
  if (typeof fileExplorer.registerViewer === 'function') {
    return fileExplorer.registerViewer({
      id: 'code-editor', label: 'Code Editor', exts: CODE_EXTS, component, priority: 10,
    })
  }
  const disposers = CODE_EXTS.map(ext => fileExplorer.registerPreview(ext, component, 10))
  return () => { for (const d of disposers) d() }
}

Registered extensions (CODE_EXTS): ts tsx js jsx json css html py yaml yml toml env sh go rs java c cpp h xml sql graphql cfg ini.

The editor component handles four preview kinds:

KindBehavior
textUses preview.content directly (files ≤ 2 MiB)
text-largeCalls readRawFile(filePath), decodes the ArrayBuffer as UTF-8, and opens the editor (text files over 2 MiB)
binarySame as text-large — readRawFile + decode
too-largeSame as text-large — readRawFile + decode (images over their cap; not delivered to this plugin's registered code extensions)

When readRawFile is unavailable (older dsh-file-explorer core), text-large and binary files show an upgrade prompt. Edits always flow back through fileExplorer.writeFile(filePath, content).

Configuration

The bundle inserts a single roster row (no host-side configuration):

- insert:
    - id: file-explorer-preview-code
      name: '@dsh-external/dsh-file-explorer-preview-code'

Language coverage

@codemirror/language-data matches 21 of the 24 extensions to a language. env and graphql have no language support and open as a plain (un-highlighted) editable buffer; cfg matches language-data's legacy TTCN_CFG (a matching artifact, not a semantic ini match). All still open in the editor.

Known Limitations

  • Bundle size: all @codemirror/* language packages are inlined into a single lib/client.js (~2.7 MB raw, loaded lazily on demand).
  • No Markdown: .md/.mdx stay with dsh-file-explorer's built-in markdown preview.
  • Write-through: editing writes directly back to the workspace file; there is no diff/preview-before-save or multi-tab.
  • Large files: files above dsh-file-explorer's maxTextBytes (2 MiB) arrive as preview.kind === 'text-large' and are fetched via readRawFile then loaded into the editor. Very large files (hundreds of MiB) may cause browser performance issues due to the single-buffer CodeMirror model. readRawFile is part of the stable service contract (added in v0.1.0).

Developing preview plugins

This repo is the reference implementation for building a preview plugin. See docs/developing-preview-plugins.md (中文) for the contract, a minimal skeleton, bundling notes, and i18n.

Related

  • dsh-file-explorer — the core file explorer this plugin extends.
  • dsh-file-explorer-preview-code — this repository.
  • dsh-file-explorer-preview-molstar — a Mol* structure preview for .cif/.pdb, built on the same fileExplorer contract.

Development

npm install
npm run check     # tsc type check
npm test          # vitest unit tests
npm run build     # tsc + tsdown (host ESM stub + client CJS bundle)

After npm run build, hard-refresh the browser (Ctrl/Cmd+Shift+R): dsh web may keep serving a cached plugin bundle, so a soft reload can leave your latest build unused.

License

MIT