dsh-inline-figures: Inserting Vector Graphics Between Paragraphs in DSH Answers

Foreword

In DeepSeek Harness (DSH), a model’s long answer is often a large block of Markdown: structure, flows, and comparisons all crammed into text, making it hard to grasp relationships at a glance. Common approaches are to write shorter, flatter prose, or to draw diagrams separately and paste links — the former may still miss the structure, and the latter interrupts the reading flow.

Below we introduce the community plugin dsh-inline-figures (maintainer 0mao0). On the host side, it gives the model a draw_figure tool: it renders a JSON figure spec into SVG, writes it to the current session workspace, and returns a single line of plain Markdown image link; the model inserts that line between paragraphs, resulting in a “text—figure—text” presentation, without adding new client UI or folding the figure into a tool card. The project is categorized as “趣味换装” (fun dress-up) in the SkillHub directory, currently has 0 GitHub stars and 1 fork; MIT license, version 0.1.0.

What Is This

dsh-inline-figures is a DSH host plugin (Cordis bundle): when an answer needs to be understood rather than merely skimmed, it lets the model call draw_figure at appropriate positions to generate deterministic SVGs, which are then embedded full-width in the reply through the Markdown image channel.

Compared with “plain text + tables/long lists”, the injected guidance also leans toward roughly 80% ASD-STE100 (Simplified Technical English) style prose, and prefers converting content of the “parts, relationships, flows, sequences, comparisons, quantities” type into figures rather than writing another paragraph.

Core Features

The draw_figure Tool

Interface shape (from the README):

draw_figure({ spec, alt, slug? }) -> { path, markdown, warnings }

The model submits a preset-structured spec; the plugin validates, lays out, and renders it, then returns one line of markdown that must be pasted verbatim into the reply, for example:

![Current vs target](.dsh-figures/s3f2a9c1e-6f7d-4/1-compare.png)

Supported kind values and limitations (excerpt):

kind Purpose Limitations
raw_svg Custom structures such as trees, branch pipelines, state machines spec 32 KB
architecture Layered boxes, P0/P1 badges, danger groupings, feedback edges 2–6 layers × 1–6 nodes, 8 edges
compare Left/right column comparison, semantic tones default/danger/ok/muted 1–6 rows
timeline Vertical steps, done/active/todo 2–10 steps
chart bar / line / pie 1–12 points

Example compare spec:

{ "kind": "compare", "title": "Current vs target",
  "rows": [{ "left": { "label": "Manual review" },
             "right": { "label": "Automated gate", "tone": "ok" } }] }

Figures are always SVG (not ASCII box art, not fake diagrams inside code blocks). raw_svg passes through a sanitizer that strips scripts, external references, and the like, and injects theme styles and arrow markers.

Three Steps in One Turn

  1. The model judges that a figure is needed at some point and calls draw_figure.
  2. The host plugin validates the spec, renders it, writes the file, and returns one line of Markdown.
  3. The model writes that line into the reply, where the regular Markdown image renderer displays the figure full-width.

When the Model Forgets to Draw

The tool cannot write the figure into the reply on its own. On the host side, the plugin reads the “about to finish” answer: if it contains structures such as tables, lists with five or more items, comparisons, plans, or flows, but no figures at all, it steers at the agent/turn-stopping side to prompt the model to draw one more step. This path steers at most twice per session, with a two-turn interval, and is only enabled after at least one figure has been drawn in the session; sessions that have never drawn anything receive a reminder attached to the next tool result, without consuming an extra model call.

Storage and Privacy

Only written to the session workspace, with no network uploads and no telemetry:

<session workspace>/.dsh-figures/<session>/
├── N-slug.svg
├── N-slug.png
└── .gitignore

Each session directory keeps the latest 200 figures (pruned by modification time). Deleting files will cause images in old replies to break; the directory should be treated as conversation assets. If rasterization fails, the reply can switch to an SVG inline data URI, and a raster-diagnostic.txt is written to the same directory.

Installation and Activation

DSH has a built-in plugin manager; there is no need to copy files manually or run npm install commands against the profile.

# from npm
dsh plugin --profile <profile> add dsh-inline-figures

# or straight from this repository, no registry involved
dsh plugin --profile <profile> add github:0mao0/dsh-inline-figures

The web sidebar Plugins page can perform the same operation via a form; agents can also use plugin_manager’s install_bundle (targeting a local clone directory — installation methods are subject to your environment’s documentation, and this article does not cover the clone process).

Restart DSH after installation: host plugin code is loaded once per process; without a restart, it may still show the old list or fail to load the new code. There is no separate build step; dependencies are provided by the harness, and sharp ships with prebuilt binaries.

package.json pins the verified DSH runtime via a peer dependency; on version mismatch, installation reports incompatible-version. The README states it was verified on dsh 0.2.0-rc.2 (cordis 4.0.4). If you must install on another runtime, you can use (replace placeholders with actual versions):

dsh plugin --profile <profile> allow-version dsh-inline-figures@<version> --dsh-version <runtime> --accept-risk

The plugin requires Node >= 22.

Typical Usage

  1. Install the bundle for the specified <profile> using the command above and restart DSH.
  2. In sessions that need to “explain structure clearly”, ask the model questions; the model calls draw_figure at appropriate paragraphs and inserts the returned markdown into the body.
  3. When comparing two approaches, use a spec with kind: "compare", with titles and row labels following short noun phrases (the label style inside figures is consistent with the strictest tier of ASD-STE100: each label at most about six words, one concept).

For specific preset fields and validation error messages, refer to the repository README and the warnings returned by draw_figure.

Use Cases and Cautions

Good for: operations/development documentation, architecture and flow explanations, before/after state comparisons, step timelines, small amounts of bar/line/pie chart data — any long answer where “skimming the text is worse than a glance at the relationships.”

Cautions:

  • The plugin runs with the permissions of the current DSH process. Before installing, review the GitHub source code and the MIT license yourself to confirm it meets your security and compliance requirements.
  • The community directory SkillHub plugin page has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin”, and the directory is an independent site.
  • Figure files are bound to the session; after cleaning the workspace or pruning, relative-path images in historical messages may break.
  • If the runtime version differs from the version verified in the README, prioritize resolving peer dependency rejection or explicit allow-version to avoid abnormal behavior after mounting.

Ending

dsh-inline-figures embeds vector explanatory figures into the rhythm of the model’s reply body: the same fact can trade one paragraph of verbose description for one more structural figure landing between paragraphs. To install or view comparison illustrations, open the directory page skillhub.cn/plugins/0mao0/dsh-inline-figures and the repository github.com/0mao0/dsh-inline-figures.

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

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

Xiaoye