rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Asaiuta/dsh-genui-enhanced
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Generative UI for DeepSeek Harness (DSH)
Interactive, rich components rendered inline alongside the model's textual responses.
English · 简体中文
🌐 Live Product Site · 🎬 Real Demo · 🚀 Quick Start · 🧩 Feature Matrix · 📖 Component Syntax (SKILL.md)
dsh-genui turns DeepSeek Harness (DSH) assistant replies into safe, fully interactive UI surfaces.
Ask “How are this month’s orders doing?”, and instead of plain text or raw code blocks, the response streams out an interactive sortable data table, audio/video players, draggable function plots, self-grading quizzes, or a persistent workspace dock — all embedded seamlessly within the conversation.
[!IMPORTANT] This repository is a fork of
@changfenhuang/dsh-genui0.14.0 (package name kept for drop-in compatibility), versioned0.14.0-fork.3. Delta over upstream: the diagram engine is pele instead of mermaid (1.02 MB, −70% asset weight, live CSS-variable theming,mindmap/timelinewhitelisted), plus capability additions —chartkind:"area", nativedate/datetime-local/time/numberinputs withmin/max/step, automatic table pagination (pageSize, row cap raised to 200), and upstream's Computed fields (input-driven local recalculation, ported from the 0.15.0 fix line). See FORK.md and the CHANGELOG for the full record. This fork is not published to npm — the Quick Start below separates the upstream npm install from building this fork from source.
[!NOTE] Real Interface Captures: All recordings and screenshots below are captured directly from real DSH interface rendering — no conceptual mockups or faked pre-renders. Demo media is inherited from the upstream repository: this fork carries the entire component surface shown here, with only the diagram engine swapped (pele instead of mermaid).
https://github.com/user-attachments/assets/f5db33ec-7471-4d4a-a85b-79c9962ab4ef
(Click the thumbnail to download the original MP4 if the GitHub video player fails to load. The prompt sequence is documented in demo-prompts.md.)
| 1. Monitoring Panel: Answer is the Dashboard | 2. Function Plot: Drag to Redraw Instantly | 3. Composable Hierarchy: Work Surface |
|---|---|---|
![]() |
![]() |
![]() |
| Data Insights: Eyebrow stats, filterable/drill-down service table, grouped totals, and spark/ring cells directly live in the assistant reply. | Zero-Latency Exploration: plot draws mathematical curves; drag parameter sliders to re-calculate and redraw locally in real time. |
Structured Hierarchy: Display quotes, stat cards, ring progress, and labeled chapter dividers composed declaratively by the model. |
| Scenario | Plain Text Response | With dsh-genui |
|---|---|---|
| Business Overview | “Revenue this month is ¥128,430 (+12.4% MoM); conversion rate is slightly dipping…” | One line of concise prose + 3 stat cards (revenue/orders/conversion), a trend chart, and a progress bar rendered right beside it. |
| Data Exploration | Type another prompt to ask the model to re-sort or filter. | Click table headers to sort numbers locally, or use the search box to filter rows in real time. |
| Parameter Tuning | Re-prompt the model and wait for another full generation. | Drag sliders to see curves update in sub-millisecond speed with animation preview. |
| Next Actions | Copy text and manually perform follow-up tasks elsewhere. | Click interactive action buttons (e.g. “Refresh”, “Switch View”) to trigger bidirectional model event loops. |
Ensure your environment meets the following requirements:
^0.2.0-rc.1 || ^0.2.1-rc.1 (verified against dsh-v0.2.0-rc.1 and dsh-v0.2.1-rc.2)dsh plugin CLI requires pnpm. If missing: run corepack enable or npm i -g pnpm, then open a new terminal and confirm pnpm -v prints a version number.Pick one path depending on what you want:
Option A — Upstream package from npm (the stable marketplace version, without this fork's deltas — pele engine, area charts, table pagination, Computed fields, etc.):
# Public npm package (works without an npm account)
dsh plugin --profile web add @changfenhuang/dsh-genui
[!TIP] Adding only as a Node package? Run
npm install @changfenhuang/dsh-genui. Note thatnpm installonly adds the dependency and does not register the plugin with DSH; use thedsh plugin addcommand above for DSH integration.
Option B — This fork, built from source (this repository; not on npm — lib/ is not committed, so building is mandatory; details in FORK.md):
git clone https://github.com/Asaiuta/dsh-genui-enhanced.git
cd dsh-genui-enhanced
pnpm install # approve esbuild's build script when prompted
# Build gate (see FORK.md for pnpm 11 caveats)
./node_modules/.bin/tsc -p tsconfig.json # type check — zero errors required
./node_modules/.bin/tsdown # emit lib/ (client.js, index.js, assets/*)
dsh plugin --profile web add link:$PWD
Cmd + Shift + R or Ctrl + F5).Use dsh-ui to draw a stats dashboard with a sortable service table.
[genui] client active; fence-channel=dom.[!WARNING]
⚠️ Installation Pitfalls to Avoid
- Watch the Package Scope (Crucial): The package must be
@changfenhuang/dsh-genui. npm hosts an unrelated, unscoped package nameddsh-genui(a Vue/OpenTiny implementation by another maintainer); installing it will fail due to incompatible host peer dependencies.- Do Not Use
link:on a Directory That Has Not Been Built:link:alone does not bundle or resolve peer assets (diagram engine, three.js, React). Runpnpm installplus the build gate first solib/exists, thenlink:works — that is exactly Option B above. Use npm (Option A) for the standard marketplace install.- Migrating from Legacy
@omdsh-dev: If you installed from GitHub or the old org name before v0.9.2, clean up the stale key:dsh plugin --profile web remove @omdsh-dev/dsh-genui dsh plugin --profile web add @changfenhuang/dsh-genui
Every component and behavior is guarded by the strict dsh-ui specification. See SKILL.md for full JSON schema details.
dsh-genui Capabilities
├── 🌊 1. Streaming & Realtime Mounting
├── 🎨 2. 30+ Component Ecosystem
├── ⚡ 3. Local-First Responsiveness
├── 🔄 4. Bidirectional Action Event Loop
├── 📌 5. Persistent Session Workspace & Templates
└── 🛡️ 6. Sandboxing, Guards & Self-Healing
stat with eyebrow labels, deltas, and sparklines), Tables, Timelines, Code Diffs, Step progress, File trees (interactive expand/collapse), Callouts, and Badges.k/m/b units;bar), rings (ring), sparklines (spark), and badges;filter);pageSize overrides the page size, while totals and export always cover the full data set.echart):bar, line, area, pie, scatter, radar, gauge, funnel, treemap, sankey, graph, heatmap, bigline, wordCloud) that adapt automatically to host light/dark themes;echart block is encountered.plot):$...$) and display blocks ($$...$$), supporting matrices and multi-line equations.quiz / submit):groups schema.action payload package user events back to the model to trigger follow-up reasoning.action render disabled to eliminate "dead clicks"; active buttons show immediate visual feedback upon trigger./panel or panel: true; resize by dragging its border; append tabs incrementally with append: true.eval; strict prohibition of passwords or secret collection.fenceFeedback: false).The model emits the following dsh-ui code block:
{
"title": "Q3 2026 Executive Overview",
"items": [
{
"type": "row",
"items": [
{ "type": "stat", "label": "Total Revenue", "value": "¥128,430", "delta": "+12.4%", "spark": [40, 55, 60, 85, 120] },
{ "type": "stat", "label": "Completed Orders", "value": "1,024", "delta": "-3.1%", "spark": [90, 85, 80, 75, 70] },
{ "type": "progress", "label": "Quarterly Target", "value": 82, "variant": "ring" }
]
}
]
}
{
"title": "Revenue Breakdown",
"items": [
{
"type": "echart",
"title": "Monthly Performance",
"preset": "bar",
"data": [
{ "label": "Jan", "value": 98 },
{ "label": "Feb", "value": 112 },
{ "label": "Mar", "value": 128 },
{ "label": "Apr", "value": 145 },
{ "label": "May", "value": 160 }
]
}
]
}
For the comprehensive specification and full component catalog, refer to SKILL.md.
sequenceDiagram
autonumber
actor User as User
participant Host as DSH Host / LLM
participant DOM as Conversation DOM
participant GenUI as GenUI Client Renderer
participant Assets as On-Demand Assets (ECharts/Three)
User->>Host: Prompt (e.g. "Analyze recent order trends")
Host-->>DOM: Streams Markdown prose & ```dsh-ui fence
DOM->>GenUI: Detects fence and normalizes schema against whitelist
alt Requires Heavy Engines
GenUI->>Assets: Dynamically fetches engine bundles
Assets-->>GenUI: Assets loaded
end
GenUI->>DOM: Mounts React component tree incrementally
opt Client-Side Local Actions
User->>GenUI: Sort table / Drag plot slider / Answer quiz
GenUI-->>User: Instant sub-millisecond local update
end
opt Model Action Feedback
User->>GenUI: Click interactive action button
GenUI->>Host: Dispatches structured action payload
Host-->>DOM: Model responds with next-step reasoning / updates panel
end
Completed GenUI blocks can be exported on demand:
.html: Inlines the lightweight renderer, CSS styles, KaTeX fonts, and required chart engines so the interactive UI can be viewed and tested offline in any browser..genui.json: Retains the normalized specification and durable interaction states for storage and portability.git clone https://github.com/Asaiuta/dsh-genui-enhanced.git
cd dsh-genui-enhanced
pnpm install # approve esbuild's build script when prompted
# Build and link into your DSH web profile
dsh plugin --profile web add link:$PWD
pnpm install # devDeps; approve esbuild's build script
./node_modules/.bin/tsc -p tsconfig.json # type gate — zero errors required
./node_modules/.bin/tsdown # emit lib/ (client.js, index.js, assets/*)
./node_modules/.bin/vitest run # unit tests
The upstream npm-script entry points (
pnpm run build/check, thescripts/*.mjshelpers and the E2E harness) are not part of this fork's npm-tarball snapshot. The three commands above are the fork's build gates; see FORK.md for pnpm 11 caveats (invoke the binaries directly rather than viapnpm exec/pnpm run).
To customize plugin behaviors, add configurations under cordis.patch.yml in your profile:
- id: genui
name: '@changfenhuang/dsh-genui'
config:
renderUiTool: false # Disable registering the render_ui tool card (fences and panel remain active)
fenceFeedback: false # Disable automatic same-turn steer correction on malformed fences
You can import GenuiBlock, GenuiActionContext, and processGenuiSpec from @changfenhuang/dsh-genui/embed to embed the renderer into any React application supporting CSS Modules.
[genui] client active; fence-channel=dom:dsh plugin list shows the plugin as active, restart DSH web, and hard refresh your browser;dsh-ui and that its body contains valid JSON.DSH plugin management calls pnpm under the hood. Run corepack enable or npm i -g pnpm, then open a new terminal window before running dsh plugin add.
The package is public and requires no login. Verify the package name via npm view @changfenhuang/dsh-genui version. If a version was published very recently, allow a few moments for registry mirrors to synchronize.
Heavier engines are lazy-loaded through plugin-provided static routes upon their first appearance. Hard refresh your browser (Cmd + Shift + R). If the issue persists, reinstall the package:
dsh plugin --profile web remove @changfenhuang/dsh-genui
dsh plugin --profile web add @changfenhuang/dsh-genui
(Note: these npm commands reinstall the upstream package. To refresh an install of this fork, rebuild from source and re-link instead — see Quick Start Option B.)
This version strictly requires DSH ^0.2.0-rc.1 || ^0.2.1-rc.1. Older host versions lack necessary React slot/context capabilities; please upgrade DSH.
| Exploration Area | Decision | Rationale |
|---|---|---|
| Incremental Diff Patching | Declined | A fence costs only 200–800 tokens; resending is fast and safe. Teaching models a patch diff protocol introduces high friction and hallucination rates. |
| Granular Action Delivery | ✅ Done | Discrete gestures send immediately; continuous slider drags apply trailing-edge debounce to keep chat context clean. |
| Cross-Session Replay Persistence | Declined | Resetting on replay is the more natural expectation when the model updates the UI; state is preserved seamlessly during streaming. |
| Separate Gallery / i18n Strings | Declined | The component gallery is covered by demo-prompts, gallery.ts, and README screenshots; the core bundle carries only 6 built-in UI strings. |
This project is licensed under the MIT License, as is the upstream project. Third-party notices: THIRD_PARTY_NOTICES.md.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。