DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-math-copy

Y

dsh-math-copy

Manifest valid

Copy rendered math in the DSH Web UI as its LaTeX source instead of KaTeX's glyph text.

UI (client)hasBundlePatch

dsh-math-copy

English | 中文

Copying rendered math from the DSH Web UI puts the formula's LaTeX source on the clipboard, instead of KaTeX's visual glyph text (x2 for x^2).

What it does

The Web UI renders math with KaTeX, and KaTeX keeps the original TeX source in the formula's accessibility subtree:

<span class="katex">
  <span class="katex-mathml"><math>…<annotation encoding="application/x-tex">\frac{a}{b}</annotation>…</math></span>
  <span class="katex-html" aria-hidden="true">…glyphs…</span>
</span>

The browser's own selection copy walks the visible layout (and the clipped MathML arm), so it produces glyph text. This plugin listens for copy on the document; when the selection intersects at least one formula it marks those formulas, clones the selection, swaps each formula for its TeX wrapped in math delimiters, writes text/plain (and text/html) and cancels the default action. A copy whose selection holds no math is left completely alone.

Selecting half a formula still yields the whole formula's TeX.

Configuration

Three fields, editable in the Plugins page:

fielddefaultmeaning
Inline formula delimiter"$"wrapped around inline math (empty → bare TeX)
Display formula delimiter"$$"wrapped around display math (empty → bare TeX)
Also replace the rich-text flavortruesubstitute math in the text/html flavor too; off keeps the untouched selection markup for rich paste targets

How the form is wired

  • index.js declares the fields on export const Config and marks each one .volatile(). Only volatile fields are projected into a form: the settings service serves them under this entry's profile row id, math-copy.
  • client.js subscribes to that form through ctx.configForms.get("math-copy") (the same way the shipped ui-chat reads its preferences) and folds it over its own defaults, so the copy handler always reads the current values.
  • The panel is registered into the plugins.row.config slot with the key <package name>#<row id> (dsh-math-copy#math-copy). No shipped client renders settings forms automatically, so the plugin renders its own.

Find it at 插件 (Plugins) → dsh-math-copy → the math-copy row → its configuration block. Writes go through the settings transport and are persisted into the active profile's Cordis patch, so they survive restarts.

Changing the host half (index.js) needs a DSH restart: the host module generation is cached for the process lifetime, and the profile's HMR entry runs with root: [] (no source watching). Client-only edits (client.js) reach the page on a reload.

Install

# from a session with Full access:
# plugin_manager action=install_bundle target=<this directory>

Reload the Web UI page afterwards so the new client bundle enters the boot graph.

Restarting DSH after a host-half change is required — the host module generation is cached for the process lifetime.

Status

Developed and verified against dsh core 0.2.0-rc.2 (DSH Desktop 2.0.15-beta.1). No engines.dsh range is declared yet: the plugin uses long-standing client services (slots, locale, configForms, ctx.inject), but only this version has actually been run, and a range that admits prerelease builds has to name each major.minor.patch tuple explicitly. Declare one once another version has been tested.

Development

tools/asar-extract.mjs reads Electron's app.asar (list or extract by path substring) — used to read the shipped client code that renders markdown and math:

node tools/asar-extract.mjs "/Applications/DeepSeek Harness.app/Contents/Resources/app.asar" list katex
node tools/asar-extract.mjs "/Applications/DeepSeek Harness.app/Contents/Resources/app.asar" extract dsh-client-ui-primitives /tmp/dshx

index.js resolves @deepseek-ai/schemastery through the active profile when the direct specifier misses (a directory-installed bundle is linked into the profile, so Node resolves its imports from the workspace instead). Without the schema the plugin still copies with its built-in defaults; only the form is missing. A normally installed copy (npm or GitHub, which is what dshmarket performs) resolves the direct specifier and never reaches the fallback.

submission/ holds the one-file catalog entry for awesome-dsh-plugin; see the notes inside it.

Comments

Loading…

Similar plugins

dsh-latex-tools

by liuup

♾️ Copy and export the LaTeX in DeepSeek Harness 悬停任意 LaTeX 公式即可复制 TeX 源码或导出为独立的 SVG 文件

UI & ExperienceManifest valid

★ 8

↓ 131/wk

MIT

TypeScript

Aug 14, 2026

dsh plugin --profile web add dsh-latex-tools

by s11phere

DSH plugin: fix Pandoc-style $$ display-math blocks that DSH mis-parses into a red KaTeX parse error.

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Sep 27, 2026

dsh plugin --profile web add dsh-tex-block-normalizer

by huanglianqi

LaTeX snippet expansion in the DSH web composer: Tab expands a trigger into a formula template with the caret in the first hole, then walks the rest. // expands with no Tab at all.

Manifest valid

★ 1

MIT

JavaScript

Sep 30, 2026

dsh plugin --profile web add dsh-math-snippets

by zysftd

DSH web 插件:划选/整条/粘贴大文本引用 AI 内容到输入框,发送时自动附带 > 引用块(原生风格 UI 卡片)

Manifest valid

★ 0

MIT

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-quote

by Asianfleet

Copy dsh assistant output as Markdown, preserving links, LaTeX sources and code fences.

Sessions & MessagesManifest valid

★ 4

↓ 180/wk

MIT

TypeScript

Aug 19, 2026

dsh plugin --profile web add dsh-message-copy-enhance

by copylee711

让 DeepSeek Harness Web 的回答图文并茂,并为联网搜索内容加上 GPT 式引用角标。

Manifest valid

★ 0

MIT

TypeScript

Oct 7, 2026

dsh plugin --profile web add @copylee/dsh-better-display