DeepSeek Harness plugin

dsh-chem-render

Deterministic chemical-structure rendering for DeepSeek Harness: one chem_render tool turns a SMILES string into SVG, PNG, standalone HTML, Markdown and LaTeX (includegraphics + optional native.

Jump to install

Source facts

Repository
EQmarks/dsh-chem-render
Latest update
Aug 15, 2026
Category
Tools & Capabilities
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/EQmarks/dsh-chem-render
Plugin: dsh-chem-render
Author: EQmarks

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

English · 中文

dsh-chem-render

Deterministic chemical-structure rendering for DeepSeek Harness: one chem_render tool turns a SMILES string into SVG, PNG, standalone HTML, Markdown and LaTeX.

The model supplies only the SMILES string. Parsing, validation, 2D layout and rendering all run in code (openchemlib-extended + resvg-js), so an invalid SMILES fails with a readable error instead of a wrong picture. Optional native chemfig source for LaTeX comes from the mol2chemfigPy3 converter (kekulized first, so the output uses only standard chemfig macros).

Preview

A molecule (caffeine, default clean monochrome rendering):

![Caffeine](assets/caffeine.png)

Stereochemistry with strict wedge bonds (glucose):

![Glucose](assets/glucose.png)

Install

pnpm dsh plugin --profile web add 'github:<owner>/dsh-chem-render#<commit>'

Local development checkout:

pnpm dsh plugin --profile web add link:D:/path/to/dsh-chem-render

The package declares dsh.bundle.patch, so the CLI mounts its patch layer automatically.

Optional: native chemfig source in LaTeX

latex / chemfig / all formats additionally emit native \chemfig{...} source when this machine has:

pip install mol2chemfigPy3

Override the interpreter or its search path with DSH_CHEMFIG_PYTHON / DSH_CHEMFIG_PYTHONPATH. Without it, the LaTeX output still works through the raster route (\includegraphics with a sibling PNG) and the result notes what was skipped.

Usage

Ask the model for a structure; it calls the tool:

chem_render { smiles: "CN1C=NC2=C1C(=O)N(C(=O)N2C)C", format: "all", name: "caffeine" }
formatwritesnotes
svg<name>.svgvector, policy-safe text write
png<name>.pngrasterized from the SVG; confined-backend installs keep binary writes inside the session workspace
html<name>.htmlself-contained page (inline SVG + PNG data URI), no network
markdown<name>.md + sibling .svg/.pngrelative PNG reference (works in VS Code preview and elsewhere); data-URI only when the PNG file cannot be written
latex<name>.tex + sibling .png\includegraphics route always; \chemfig{} route when the converter is installed
chemfig<name>-chemfig.texconverter source only
alleverything above

Parameters: smiles (required), format (required), name (base filename, sanitized), save_dir (default .), width (200–1200, default 500).

Style options (defaults = clean black rendering, no annotations):

parameterdefaulteffect
palette"monochrome""monochrome" draws everything in pure black; "element" colors heteroatoms (N blue, O red, …)
stereo_labelsfalsetrue shows R/S, abs and enantiomer annotations on chiral centers
stereo_position"below"where that annotation text sits when stereo_labels is on: below / above / frame-top / frame-bottom
rotate0rotate the 2D structure by this angle in degrees (counterclockwise); applies to every format including chemfig

These options also live in the harness settings page (the plugin's config form): values set there act as defaults, and per-call tool arguments override them.

Stereo wedges (up/down bonds) are post-processed into strict geometry: solid wedges become single straight-edged triangles and hash wedges become evenly spaced, linearly tapering dashes perpendicular to the bond axis.

Files are written through the harness filesystem service, so they obey the session's sandbox policy like every other tool write.

The compiled .tex needs graphicx (and chemfig for route 2) — both are standard in TeX Live / MiKTeX. Verified with pdflatex: caffeine and glucose compile clean through both routes.

Development

npm install
npm test                                # pure rendering-core tests
DSH_NODE_MODULES=~/.dsh/profiles/web/node_modules node tests/boot.test.mjs
                                        # boots a real harness Context and executes the tool

Notes & limitations

  • Polymer repeat-unit notation is not supported in this release. The bracket notation (delimiters + subscript n

around a repeat unit) was experimental and has been removed from the tool surface; rendering a polymer fragment as a plain molecule (a finite chain) works, but the textbook bracket form does not.

  • The chemfig source is best-effort: quality depends on mol2chemfigPy3/Indigo. Fused bicyclic rings (caffeine) render

correctly; very complex molecules can look imperfect — the raster route is always available.

  • Works with any harness surface that has a tools registry and an fs service (web profile, headless runs).

License

MIT — see [LICENSE](LICENSE). Rendering depends on npm packages under their own licenses; the optional chemfig route uses the user-installed mol2chemfigPy3 (MIT).