baitouwuya/dsh-super-cards: Enable DSH assistant to answer structured questions with native cards

Introduction

The most dreaded experience when building agents in DSH is this: the model’s answer should be a table or a chart, but it spits out dozens of lines of Markdown where the table columns don’t align and the chart is just ASCII art. This isn’t a model capability issue, it’s an expression channel issue—Markdown lacks table alignment, chart components, and clickable buttons.

dsh-super-cards, maintained by baitouwuya, is the solution to this channel problem: the plugin registers a render_ui tool. When the model encounters structured questions like comparisons, metrics, tables, charts, steps, or solution choices, it switches to outputting UI cards rendered into the conversation flow. Below is an introduction to what this plugin does, how to install it, and how to use it.

What is it

dsh-super-cards (Chinese name: “Super Cards”) is a DSH Web plugin with zero runtime dependencies, published to npm with the package name dsh-super-cards. The current version is 0.14.0, tested and working on DSH 0.2.2-rc.1 (cordis 4.1.0); the repository’s built-in npm test reports 253/253 passing. The license is MIT, and the author is baitouwuya.

It solves a very specific problem: when the model outputs structured content, it no longer tries to patch together Markdown, but instead calls render_ui to render the answer into a card. The card content is entirely derived from the render_ui tool call parameters recorded in the conversation log, so cards persist after refresh, replay, or fork—unlike the approach of temporarily patching together a snippet of HTML.

Core Features

29 Block Types

The plugin provides 29 block types: text, heading, callout, stats, table, key-value, list, tags, progress, bar chart, trend chart, pie chart, code, quote, timeline, link, action button, separator, live count, settings control, flowchart/UML, tree, heatmap, diff, kanban, tabs, side-by-side columns, image, and custom HTML. See docs/zh/blocks.md in the repository for the full forms and limits.

Two Writing Methods

  • content: Only describes the material; the card itself chooses controls and arranges the layout. 2–3 items side-by-side form columns; 4–5 items become tabs.
  • blocks: Precisely specify each block.

The two can be mixed.

Four Placement Positions

Cards can be placed in four positions: inline in the main body (answer), in the process collapse area (process), in a persistent dock above the input box (dock), or as the next-step card at the end of a turn (tail).

Progressive Disclosure

The full schema for the 29 block types will not be kept in the model context permanently. The description of render_ui only includes a compact block directory; when the model needs the precise fields of a specific block, it calls render_ui_blocks to retrieve it on demand.

Optional Automatic “Next Step” Card

At the end of a turn, a “tail card” can be generated by a small model: a summary sentence, a question, and 2–4 clickable options. It is disabled by default and must be explicitly enabled.

Installation and Activation

Published to npm, install via command line (profile name depends on your installation; for the desktop version it is desktop):

dsh plugin --profile desktop add dsh-super-cards

After installation, restart DSH (or reload the plugin row) and refresh the page.

The other three methods:

  1. Click “Add plugin” on the “Plugins” page and paste the package name dsh-super-cards.
  2. Use plugin_manager’s install_bundle pointing to the local repository directory, for development or offline installation.
  3. Install via the plugin market: Settings → Plugin Market → Add Index Source. The index source address is below, then search for dsh-super-cards in Discover.
https://raw.githubusercontent.com/baitouwuya/dsh-super-cards/main/market/index.json

Please note that this index source is the entry point for this plugin’s own market, not DSH’s official market.

Typical Usage

After installation, simply use natural language to ask the model to answer with cards; no extra toggle is needed. Below is an example of render_ui parameters given in the README, which you can refer to directly:

// render_ui 的参数
{
  "title": "本周发布",
  "content": {
    "summary": "18 次发布全部完成,2 次回滚已恢复。",
    "metrics": [
      { "label": "发布次数", "value": 18, "delta": "+3", "tone": "success" },
      { "label": "失败回滚", "value": 2, "delta": "-1", "tone": "success" }
    ],
    "actions": [{ "label": "查看日志", "prompt": "查看本周的发布日志", "tone": "primary" }]
  }
}

This call renders a card titled “Weekly Release” containing a summary, two metric cards with up/down indicators, and a “View Logs” button. Clicking the button simply puts the prompt into the input box; it does not send it automatically. The user presses Enter to continue the follow-up.

Configuration

Configuration is written in the config object of the super-cards line in the profile’s cordis.patch.yml. The three ways to modify it have the same effect, ultimately writing to the same row configuration: the plugin page has four basic configurations (auto next step, dock, default placement, max blocks); the settings page has a full form, adding the number of downstream step options, timeout, minimum length, provider and model used for generation, and enabled block types; you can also write the YAML manually:

- insert:
    - id: super-cards
      name: dsh-super-cards
      config:
        maxBlocks: 12
        dock: true
        defaultPlace: answer
        blocks: [text, heading, callout, stats, table, progress]

All fields in the row can be omitted; omission uses default values. The appearance of undeclared keys will cause validation to fail and report the key name, it will not be silently ignored.

A few noteworthy default behaviors:

  • maxBlocks defaults to 24, range 1 to 24.
  • dock defaults to true; when set to false, cards will land in answer even if the model passes place: "dock".
  • defaultPlace defaults to answer, taking one of answer, process, dock, tail.
  • nextSteps defaults to false; it must be explicitly set to true to enable the automatic next-step card.
  • nextStepsProvider and nextStepsModel must appear as a pair; writing only one will be ignored and fall back to session routing.
  • blocks affects more than just one place: it simultaneously affects the tool enumeration, the block directory in tool descriptions, validation error messages, and automatic layout fallback. To completely disable the network-connected image block, simply remove it from the list.

No need to restart DSH after saving configuration. apply() reads the configuration and registers tools, prompts, and optional services upon mounting, so after remounting, the tool descriptions, block enumeration, and validation prompts will switch to the new configuration. Open pages do not need to be refreshed; however, it is still recommended to refresh once after the first installation or plugin version upgrade to allow the Client to semi-reload.

In addition, the package comes with copies of @deepseek-ai/schemastery and @deepseek-ai/cosmokit (current versions 3.19.0 and 1.9.0) because local plugins cannot resolve the application’s own node_modules. After upgrading DSH, it is recommended to resync this pair of packages from the application package:

npm run sync:vendor
npm run sync:vendor -- "/Applications/DeepSeek Harness.app/Contents/Resources/app.asar"

Run npm test after syncing, then reload the plugin row.

Use Cases and Notes

Who is it for? Developers building assistants in the DSH Web client who want to turn structured answers like comparisons, metrics, tables, charts, processes, and solution choices into cards. Its positioning is as a client-side UI enhancement, not server-side rendering, nor a replacement for the assistant’s own reasoning logic.

A few things to pay attention to:

  • The plugin runs with the permissions of the current DSH process and can read/write data visible within its session. Before installation, check the source code and LICENSE (MIT).
  • The automatic next-step card is disabled by default. When enabled, it initiates an extra small model call at the end of every turn. The timeout defaults to 15000 milliseconds (range 1000 to 60000), and answers shorter than nextStepsMinChars (default 200 characters) will not be generated.
  • The rules for automatic layout columns and tabs are decided by the card side; the blocks writing method is the exit point when you need precise control over the layout.
  • Environment requirements: Node >= 22.19.0 (see the engines field in the package).
  • The classification of this repository in the community directory is “Client-side”, and the community directory is an independent site with no official affiliation to DeepSeek / Huafei.

Conclusion

What dsh-super-cards does is not complicated: pulling structured answers out of Markdown and into the native UI of the conversation flow, and ensuring card content persists with the session logs for replay and fork. If you are already using DSH to generate answers with metrics and tables, it is worth installing and trying; if you are just occasionally sending text, the benefits it brings are limited.

Directory page: https://www.skillhub.cn/plugins/baitouwuya/dsh-super-cards

Source code and documentation: https://github.com/baitouwuya/dsh-super-cards

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

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

Xiaoye