dsh-mol-structure: Directly view molecular structures in DSH conversations

Preface

For those doing structural biology analysis, the common workflow is: let the agent provide an analysis in the conversation, then load the structure into PyMOL / Mol* to view the results. The result is that images and conclusions are in separate windows, and annotations and measurements require manual back-and-forth. The dsh-mol-structure plugin aims to solve this problem: embed a complete local Mol* v5 viewer in the DSH right sidebar, directly load, render, and annotate PDB/mmCIF structures, and keep the results next to the conversation. In other words, the agent no longer just returns text; the image it displays is the same view as the structure I am talking about.

Below introduces this plugin: who maintains it, whether it can be installed, and how to use it.

What is it

masterchiefm/dsh-mol-structure, maintainer Masterchiefm, categorized as a “Client-side” plugin, uses the MIT license. It targets DeepSeek Harness (DSH) developers and users: appends a “Structure View” tab to the right sidebar of the DSH desktop / web client, embeds a Mol* viewer, and exposes 22 mol_* tools to the agent, putting the entire “Load Structure → Build Scene → Measure and Annotate → Export or Screenshot” pipeline into the conversation.

Core Features

A “Structure View” tab appears in the right sidebar, embedding a complete Mol viewer. Two modes are available: a clean agent canvas, or the full Mol interface. Once a tab is switched, the scene remains resident; loading a structure won’t be lost just because you switch away.

Agent Tools

The plugin provides 22 mol_* tools covering the full pipeline:

  • Load structure: mol_load
  • Build scene / Change representation: mol_scene, mol_style
  • Register replayable views: mol_panel_define
  • Measurement and hydrogen bond annotation: mol_measure, mol_hbonds, mol_structconn
  • Cα alignment: mol_align
  • State access and export: mol_state, mol_export
  • Screenshot: mol_screenshot
  • Others include mol_status, mol_select, mol_panel, etc.

You can drive the corresponding tools directly by saying “Load 6w5c” or “Take a look at the PAM pocket” in the conversation.

Structure Analysis

After mol_load, the plugin does a few things: counts chain composition, statistics interface residue contacts, and automatically registers two views: “Overview” and “Interface Close-up”. The appearance defaults to publication-grade standards: proteins are transparent surface (alpha 0.45) plus opaque cartoon, DNA/RNA are cartoon, side chains at interaction close-ups are highlighted with stick, and distance lines are annotated with labels.

Bidirectional Perception

The view is not one-way. Clicking on a residue in the 3D view reports this click back to the agent (mol_status / mol_select can read it). Also, any local program can drive the viewer using the same command vocabulary via POST /api/mol-structure/command.

One point needs to be clarified: the plugin cannot force-expand the DSH right sidebar; that is a host UI state, the plugin has no API to touch it and can only request switching to the “Structure View” tab. Therefore, for any request involving structure display or analysis, the agent should proactively call mol_panel to open the right sidebar’s structure view tab before 3D operations like mol_load, so the user can immediately see the view instead of just receiving a text result.

Installation and Enablement

In any open DSH session, say to the agent:

Please install the plugin https://github.com/Masterchiefm/dsh-mol-structure

The agent will call plugin_manager (install_bundle, target = absolute path of the repository directory, real directory, no symlinks), automatically completing profile dependency registration, cordis.patch.yml mounting, and client registration. After installation, restart the app or open a new session, and the “Structure View” card will appear in the right sidebar.

Method B: Desktop Manual Installation

In Settings → Plugins → Local Path Install, point to an existing plugin directory locally; or manually place:

  1. Copy the package (including dist/) to %DSH_HOME%\profiles\desktop\node_modules\dsh-mol-structure\
  2. Add "dsh-mol-structure": "*" to the dependencies in the profile’s package.json
  3. Append "dsh-mol-structure" to dsh.profile.bundles

Note not to add an entry to the profile’s cordis.patch.yml; the bundle’s own cordis.patch.yml (one line insert, id mol-structure) will take effect automatically.

Pure Web Profile Source Code Installation

dsh plugin --profile web add github:Masterchiefm/dsh-mol-structure

Post-Installation Check

Confirm successful installation in three steps:

  1. The “Structure View” card appears in the right sidebar; say “open structure view” to the agent; manually expand the right bar in the UI if it is collapsed.
  2. Say “load 4oo8” to the agent; mol_load returns the chain list and automatically registers overview / interface views.
  3. Click on a residue in the 3D view; the agent can read this click via mol_status.

Typical Usage: SaCas9–sgRNA–Target DNA

The reproducible example given in the README is PDB 4OO8 (Nishimasu et al. 2015, local file dist/structures/4oo8.cif): Staphylococcus aureus Cas9 (SaCas9) – sgRNA – Target DNA ternary complex. Chain composition is A = SaCas9 (aa 3–1366), B = sgRNA (97 nt), C = Target DNA TS (0–20, PAM end), D/E/F are the second complex copy in the crystal.

Saying “load 4oo8 and see how it recognizes DNA” to the agent can reproduce three views:

  1. Overview: Protein transparent surface covers the slate cartoon, sgRNA (Red) and Target DNA (Cyan) are cartoon, the central channel conformation is clear.
  2. PAM Recognition Close-up: The PI domain S1106–I1110 loop reads the PAM end bases, K1107/S1109 side chains stick to the PAM end phosphate backbone, distance lines annotate the contact.
  3. Seed Heteroduplex Close-up: The sgRNA 5′ segment forms a heteroduplex with the target DNA, REC lobe positively charged groove residues (R75/Y72/R403 etc.) side chains stick clamp the duplex backbone, stabilizing the R-loop conformation.

The agent will register each view as a replayable panel via mol_panel_define, and the control card can reproduce it with one click. The screenshot in the README is a real DSH window screenshot, generated headlessly by node tools/capture-readme.mjs, and can be re-captured.

Check for Updates and Plugin Self-Upgrade

Since v0.5.0, the plugin has a built-in update channel, with automatic checking enabled by default (every 6 hours). This can be changed to daily / weekly / off in Settings → General → “Structure View: Auto Check Updates”. When a new version is found, the open settings page will show an update banner, and SSE will push an update reminder to the browser once; you can also click “Check for Updates” to query immediately, or click “Update and Reload Now” to complete download → SHA-256 verification → backup → atomic file replacement → hot reload with automatic rollback on failure. Developers can also directly call the HTTP interfaces:

GET  /api/mol-structure/update
POST /api/mol-structure/update/check
POST /api/mol-structure/update/apply

The update source is fixed to the feed/manifest.json of the GitHub repository Masterchiefm/dsh-mol-structure (raw.githubusercontent.com + jsDelivr mirror, variable branches pinned to full commit SHA first). Each file in the manifest includes size + SHA-256; after downloading, they are verified one by one, and any byte mismatch will reject the installation and rollback. New version release flow: Change code → bump package.json and index.js versions → npm run build (when src/ is changed) → npm run manifest → commit and push (including feed/manifest.json).

Applicable Scenarios and Notes

Suitable for developers and researchers who need to repeatedly view and analyze PDB/mmCIF structures in the conversation: especially those who want the agent to directly provide annotated images instead of manually pasting them later; and scenarios where local programs need to drive the same viewer via HTTP interface.

A few tips:

  • The plugin runs with the permissions of the current DSH process. Before installing, check the source code and license (MIT). The installation in the README is maintained by a community repository and has no official affiliation with DeepSeek / Hypothesis, please judge the source yourself.
  • The plugin declares Node version requirement as >=20 and Mol* dependency version as ^5.13.1.
  • The expanded state of the right sidebar is controlled by the host UI. The plugin can only request switching the tab and cannot expand the sidebar for the user.

Summary

The value of dsh-mol-structure lies in moving structural viewing from “a tool in another window” into the conversation itself: the agent can load, render, and annotate structures, and user clicks can also return to the agent. For DSH users who frequently perform structural analysis, it is worth a try.

Directory: https://www.skillhub.cn/plugins/Masterchiefm/dsh-mol-structure
GitHub: https://github.com/Masterchiefm/dsh-mol-structure

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

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

Xiaoye