dsh-intelligent-ui: Model-Generated Declarative DSL Interface

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture, allowing developers to extend capabilities through plugins. When building agents, models typically output results in text form. The dsh-intelligent-ui plugin changes this paradigm by enabling the model to directly generate interactive interfaces rather than merely describing them.

Plugin Overview

Name: dsh-intelligent-ui
Owner: yunyv
Positioning: A DSH plugin that enables models to write declarative DSL interfaces. The model’s generated response is no longer just a description of a dashboard, but the dashboard itself.

Core Capabilities

The plugin possesses the following capabilities:
1. Declarative DSL Authoring: The model writes DIL code similar to {@body const...} to generate interfaces.
2. DOM-less Worker Sandbox Execution: Code executes in a Worker environment without a DOM, ensuring security.
3. Host Native DOM Rendering: The render tree is drawn by the host (main application) using native DOM, rather than internally by the plugin.
4. Support for In-place Rewriting: The model can modify the interface without losing context.
5. Version History Support: All modifications are recorded in version history.
6. Patchable Across Restarts: Interface state is persisted, maintaining modifications after the application restarts.
7. Dual Rendering Paths: Supports engine: 'dil' (compile path) or engine: 'html' (escape hatch path).

Installation and Activation

Installing this plugin requires DeepSeek Harness version >= 0.2.1-rc.1.

  1. CLI Installation:
    Run the following command in the terminal:
    dsh plugin --profile <profile> add dsh-intelligent-ui
*Note: Installing via linked source directories is prohibited, as it exposes `node_modules` and causes loading failures.*
  1. Electron Desktop:
    If using the Electron desktop profile, please use the in-app Plugin Manager for installation; the CLI will reject this profile.

Please restart the application after installation is complete.

Usage

No additional configuration is required to use this plugin. When generating responses, the model will decide whether to invoke this tool based on the context.

  1. View Component List:
    Enter the following command in the conversation to view component rules:
    skill genui
  1. Mount Artifact:
    The model inserts a fenced block in its response, using the dsh-artifact language tag to mount the interface:
```dsh-artifact
    artifact-id
3.  **DSL Syntax Example**:
    The interface code written by the model resembles the following DIL snippet:
```dil
    {@body const [seats,setSeats] = DIL.useState(5)}
    {@body const [yearly,setYearly] = DIL.useState(false)}
    <box gap={4}>
      <slider label="Seats" value={seats} onChange={setSeats} min={1} max={50}/>
    </box>

How It Works and Storage

  • Execution Flow: The model writes a declarative DSL document; DSH compiles and runs it within a DOM-less Worker sandbox to generate a render tree, which is finally rendered by the host using native DOM.
  • Sandbox Characteristics: The sandbox is an execution container, not a display container. Code runs in a Worker and does not touch the DOM directly, but influences the host’s interface via the render tree.
  • Data Persistence: All Artifact data is stored in the ~/.dsh/storages/dsh-intelligent-ui/ directory.

Notes

  • Dependency Version: The DSH version requirements must be met.
  • Source Link Restrictions: Installing from a source directory via npm link or symbolic links is strictly prohibited, as this leads to dependency resolution errors.
  • Use Cases: Suitable for scenarios requiring the model to generate interactive tools, calculators, or configuration panels.
羽毛球分组比赛记分
小程序二维码

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

Xiaoye