dsh-ui-html: Rendering sandboxed interactive HTML in DeepSeek Harness

Introduction

In the development workflow of DeepSeek Harness (DSH), models typically generate text only. When there is a need to display forms, charts, or interfaces requiring user input, text-only descriptions or one-way dsh-visualize cannot meet the requirements of closed-loop interaction.

The dsh-ui-html plugin solves this problem. It allows models to render a sandboxed interactive HTML interface within conversations and structuredly feed user actions (such as clicks, selections) back to the model, enabling subsequent processing workflows.

Core Features

The plugin primarily provides the following capabilities:
* Sandboxed HTML Rendering: Renders HTML interfaces within the conversation context.
* show_ui Tool: The model initiates interface rendering through this tool.
* Dual-Mode Interaction: Supports both non-blocking (default) and blocking waiting modes.
* Structured Feedback: User actions are submitted via window.dsh.emit, defaulting to being treated as new user messages; in blocking mode, they are returned as tool results.
* Theme Variable Injection: The host side can inject CSS variables for interface use.
* Security Isolation: Interfaces run in a sandboxed iframe with network access disabled by default.

Installation and Activation

Install the plugin using the following command. After installation, DSH needs to be restarted to expand the bundle.

dsh plugin --profile <profile> add github:eaglezlee/dsh-ui-html

Tool: show_ui

When the model calls the show_ui tool, the following parameters must be provided:

Parameter Type Description
html string Required. The HTML fragment or document to display, supports inline <style> and <script>.
title string Short title for the interface.
description string Explanatory text above the interface, also serves as fallback text.
wait_for_interaction boolean Default false. When true, blocks waiting for interaction, and the interaction is returned as a tool result.
interaction_hint string Hints for users on how to interact.

After the interface is rendered, the frontend submits data via window.dsh.emit(name, payload).

Interaction Modes

  • Non-blocking Mode (wait_for_interaction: false): The interface is displayed immediately, and the tool call returns presented. After user submission, the data enters the next conversation turn as a new user message.
  • Blocking Mode (wait_for_interaction: true): The tool call blocks within the current turn until the user submits or times out. The interaction content is returned as a tool result.

Return Status

Tool call return statuses include presented, interaction, timeout, cancelled, unsupported, etc.

Configuration Options

The plugin provides 7 host-side configuration items that can be adjusted in the DSH settings page. Changes require a browser refresh to take effect.

  • enabled: Master switch.
  • announceToAgent: Whether to declare this plugin to the agent system prompt.
  • maxHtmlBytes: Maximum bytes for a single interface HTML (default 262144).
  • maxEventBytes: Maximum bytes for a single interaction event payload (default 65536).
  • interactionTimeoutMs: Blocking mode wait timeout in milliseconds, 0 means wait indefinitely.
  • allowedResourceOrigins: List of allowed external resource origins to load, empty by default (network access prohibited).
  • eventBridgeEnabled: Interaction event feedback switch.

Security Model

Interfaces run in an iframe with sandbox="allow-scripts", possessing an opaque origin, and cannot access host documents, cookies, localStorage, or clipboard. By default, access to network resources is prohibited; whitelist configuration via allowedResourceOrigins is required.

Dependencies and Ecosystem

  • Dependencies: @deepseek-ai/dsh-llm and @deepseek-ai/schemastery.
  • License: MIT.
  • Ecosystem: Part of the DSH plugin system, maintained independently.

Use Cases and Cautions

This plugin is suitable for developers who need to embed forms, selectors, or visualization controls within conversation flows. When using it, note that the plugin runs under the permissions of the current DSH process; it is recommended to review the source code and license before installation.

Summary

dsh-ui-html establishes a data closed loop from model to interface and back to model. It enables LLMs to move beyond text limitations and directly engage in structured interactions with users.

GitHub Repository
Community Directory

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

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

Xiaoye