Preface¶
In DSH conversations, models often output long blocks of Markdown. Comparisons, charts, tables, and step-by-step instructions are frequently crammed into the same text block, requiring readers to manually scan headings and lists. Changing a single number also fails to trigger linked updates. Some users ask the model to write HTML or scripts directly, but this is difficult to validate and hard to reproduce stably within conversation logs; furthermore, it is prone to distortion when switching themes or continuing conversations.
The client plugin dsh-smart-ui maintained by beex-labs (npm package name dsh-intelligent-ui, GitHub: beex-labs/dsh-smart-ui) takes a different path: the model simply calls the tool ui_render to write a pure JSON UI Schema. The page then renders this into fixed cards or stateful interactive interfaces, without writing HTML/JSX/JavaScript. The specification is plain JSON, which remains unchanged across conversation records, forks, and resumes.
What is this¶
dsh-smart-ui targets the DSH Web client and belongs to the “Client” category in the community plugin directory. It takes over the display of ui_render in the conversation tool view: the Host side provides the tool schema and prompt fragments, while the Client side renders using React and theme tokens; charts and flowcharts are drawn via lazy-loaded chunks for ECharts and Mermaid.
Maintainer: beex-labs. Current GitHub stars: 0; package.json indicates version 1.0.0 and license MIT.
Two Vocabularies: Fixed Cards and Generative UI¶
Fixed Cards (Single Structure, Stateless)¶
Suitable for “one answer, one layout.” After selecting kind, you primarily fill in data fields:
kind |
Usage Summary |
|---|---|
compare |
Comparison of three or more items on the same dimension |
chart |
Series such as bar/line/pie or donut charts |
stats |
Two to six headline numbers |
progress |
A single ratio (pass rate, quota, etc.) |
steps |
Ordered list of steps |
table |
Row and column data tables |
diagram |
Node-edge graphs or raw mermaid |
calculator |
Recalculation where users can change numbers (e.g., bill splitting, tips) |
unit |
Unit conversion |
note |
Short prompts requiring emphasis |
Generative UI (kind: "app" and playground)¶
app: Interactive tools, simulators, or dashboards. Described usingstate,compute,tree(component tree:id,type,props,bind,on,children), and optionalstream. Component types come from a registry of approximately 71 classes (including chart aliases, maps,quiz/flashcard/countdown, etc.).bindevaluates in a safe expression language (noeval, fixed function table);onsupports actions likeset,toggle,copy,open,submit,call, etc., reporting only actually occurred effects via the Action Router.playground: Editable JSON UI Schema with validation and live preview;sourceis JSON text, intentionally allowing incomplete schemas for debugging.
Semantic color tones are parsed as theme tokens. Fixed cards and app share the same set of rules for light/dark modes. The DSH theme writes content font size to --dsh-content-font-size (10–22px), allowing the entire card to scale according to this variable. Wide tables scroll horizontally; if the table body exceeds 15 rows, it scrolls vertically within the card with a fixed header.
Runtime Architecture (Brief)¶
Model writes plain JSON spec
↓
index.js Host: ui_render tool, normalizeSpec, compile diagram to Mermaid source written to log
↓
engine.cjs Shared: registry, safe expressions, validateApp, computeAll, streaming protocol
↓
client.js Client: Fixed cards, app runtime, REGISTRY, Playground, Mock Streaming
engine.cjs and the bundled client.engine.js share the same source logic. Validation and evaluation are consistent between Host and Client to avoid drift. structured diagram is compiled on the Host, so what is saved in the session is the actual drawn graph.
For more detailed field descriptions, see docs/schema.md, docs/components.md, and docs/architecture.md in the repository.
Installation and Enablement¶
The plugin depends on build artifacts (client.engine.js, client.echarts.js, client.mermaid.js, etc., which are git-ignored in the repo). Without building, charts degrade to plain text summaries, and app cannot load the engine.
Build first in the plugin source directory:
pnpm install
node build-engine.mjs && node build-echarts.mjs && node build-mermaid.mjs
Then add it to your DSH Profile dependencies (local link: or GitHub URL are both acceptable). Example in the Profile’s package.json:
{
"dependencies": { "dsh-intelligent-ui": "link:<absolute path>" },
"dsh": { "profile": { "bundles": ["dsh-intelligent-ui"] } }
}
Insert the bundle in the Profile’s cordis.patch.yml:
- insert:
- id: intelligent-ui
name: 'dsh-intelligent-ui'
Then install in the Profile directory:
cd "$DSH_PROFILE_DIR"
pnpm install --no-frozen-lockfile
Note: The community directory page is beex-labs/dsh-smart-ui. Installation steps should follow the GitHub README; do not construct dsh plugin add commands not found in the documentation based on the repository name.
Typical Usage¶
- Guide the model in system prompts or tool descriptions: when structured display is needed, call
ui_renderwith a payload of JSON conforming to the schema, and do not output markup. - Static Answers: Choose a
kindfrom the table above. For example, usecomparefor sales comparisons,chartfor trends (series,variant,unit), andtablefor lists (columns,rows). - Interactive Answers: Set
kindtoapp, defining initialstate, derivedcompute, andtree. When the user changes controls, KPIs, charts, and tables dependent on the samestateupdate together. - Learning and Debugging: The repository’s
demos/folder contains seven runnableappspecs (travel planning, sales dashboard, compound interest simulation, Pythagorean theorem explanation, AA bill splitting, geography quiz, streaming load board, etc.). You can wrap file content in{"spec": {"kind": "app", …}}and pass it toui_render, or paste it into thesourcefield ofplaygroundto preview.
Example form for calculator (refer to docs/schema.md for fields):
{
"kind": "calculator",
"mode": "split",
"fields": [
{ "label": "Total Amount", "value": 100 },
{ "label": "Number of People", "value": 4, "min": 1 }
]
}
Use Cases and Notes¶
Suitable for: Situations requiring stable presentation of comparison tables, charts, flowcharts, calculators, and unit conversions within DSH conversations; or when you need small dashboards, forms, map point selections, quiz cards, and other “change-and-link” interfaces, while hoping the specification is archivable and auditable.
Notes:
- The plugin runs under the current DSH process permissions. Please review the source code and the MIT license yourself before installation to confirm that dependencies (such as
echarts,mermaid) are acceptable. - You must complete
build-engine/build-echarts/build-mermaidfirst, otherwise capabilities will be incomplete. - Whether
appactions likecallconnect to a real backend depends on your configuration in the schema and Host environment. Somecallfunctions in the repository demos will explicitly indicate they are not connected; do not mistake this for a built-in remote service. - The community directory skillhub.cn has no official affiliation with DeepSeek / High-Flyer. The DSH ecosystem emphasizes “everything is a plugin.” The facts in this article are derived from the aforementioned README and
package.json.
Conclusion¶
dsh-smart-ui implements “model writes data, client renders” through a single toolchain: ui_render + JSON Schema, covering ten types of fixed cards and a composable app runtime. If you are building DSH agents and want to turn answers into readable interactive cards, you can learn more from the directory page, then build and attach it to your Profile following the GitHub README.
- Directory Page: https://www.skillhub.cn/plugins/beex-labs/dsh-smart-ui
- Source Code and Documentation: https://github.com/beex-labs/dsh-smart-ui