dsh-htmlui: Render Agent-Written HTML Interfaces in DSH Sessions

Introduction

When building agents in DeepSeek Harness (DSH), many interactions still rely on round-tripping descriptions in natural language: how to fill a form, what a chart looks like, or repeating a fixed workflow. This consumes context and can be imprecise. The community plugin @mostkia/dsh-htmlui (repository mostkia/dsh-htmlui) takes a different approach: the model directly produces HTML/CSS/JS, and the plugin renders it inside a sandboxed iframe in the browser. It communicates bidirectionally with the model via POST and SSE, turning “described UI” into “running panels.”

Below, we cover what it is, what it can do, how to install it, and the security boundaries to keep in mind.

What is this

dsh-htmlui is a client-side (web) plugin for DSH, maintained by mostkia, categorized as a client-side capability extension.

In one sentence: It provides an HTML conversational UI layer for Agents within DSH sessions—any HTML/CSS/JS can be rendered in a sandboxed iframe, supporting five mount locations. Pages POST actions back to the host via dshHTML.send(...), and model-side data is streamed back to the page via SSE for updates.

It aligns with DSH’s “everything is a plugin” architecture: the host side provides tools and an HTTP carrier, the browser side registers tool cards, composer entries, and display slots, while the middle layer injects bridge.js to expose the window.dshHTML API.

Core Features

Five Placements

The plugin determines where the interface appears via placement; templates can also declare this in the HTML meta. The priority order is: Tool Parameters > Meta Declaration > Default inline.

placement Description
inline Embedded in the main conversation stream, no extra chrome, height follows the document.
dock-right A collapsible bar on the right side of the conversation, creating a split-pane layout with the chat; this is the common form.
float A draggable, resizable, and minimizable floating window (e.g., size: "520x360+80+60").
fullscreen Covers the conversation area, can switch back to chat; leaving and returning does not force a reload.
background A full-frame, click-through background layer (fixed at ~25% opacity); experimental.

Example declaration inside a template:

<meta name="dsh-htmlui" content="placement=dock-right; size=520x360; title=Orders">

Bidirectional Communication, Context-Friendly

  • The document calls dshHTML.send(...), and the action arrives at the model side as a message.
  • The model streams back via SSE, and the page updates in place.
  • The tool result read by the model is a compact summary (e.g., ui_id / placement / bytes / revision); large documents can use a file path path, which the browser loads via a carrier ticket route, avoiding stuffing the entire HTML page into the context.

Tools and Template Library

The host side (index.js) provides tools such as html_ui and html_ui_template. The storage directory is $DSH_HOME/htmlui, and the HTTP carrier is mounted at /plugins/@mostkia/dsh-htmlui (covering document tickets, session lists, template directories, POST action channels, SSE, health, etc.).

  • You can point to a local HTML project directory for import/export, retaining useful templates across sessions; templates can also be created directly without going through a model turn.
  • The session page “HTML Admin” lists the interfaces within the current session, their placements, and source projects. You can hide, restore, or remove them; records are saved on the host side and bound to the session.

Bridge API and Persistence

The injected assets/bridge.js provides send, state, store, store.rows, resize, close, on(...), ready(...), etc.

Display slots retain page state on that slot when switching conversations, minimizing, or collapsing. To retain data across closing the panel, closing the session, or restarting the host, you need to use a persistence slot ($DSH_HOME/htmlui/store/). This is accessed by declaring store=... in the meta and using dshHTML.store (small values are synchronized, large row data is split into SQLite, see README for details).

Permissions and Security

  • Documents run in iframes with an opaque origin and are accessed via per-document capability tokens to reduce the direct impact on the DSH main interface content.
  • Configure permission levels per project; the sandbox cannot stop you from granting excessive permissions to a project. You should review the source code and license yourself before importing third-party HTML.

Installation and Activation

The plugin has not yet been published to npm and must be installed from GitHub. The official command is:

dsh plugin --profile web add github:mostkia/dsh-htmlui

Requires DSH >=0.1.7-0 (including the 0.1.7-rc.* pre-release line). After installation, perform a hard refresh of the page; when the browser half is activated, a log like [dsh-htmlui] client active (0.1.1) will appear in the console.

Confirm the version loaded by the current host:

curl -s http://127.0.0.1:3080/plugins/@mostkia/dsh-htmlui/health
# {"ok":true,"plugin":"@mostkia/dsh-htmlui","version":"0.1.1",...}

Note: After modifying the host half index.js, you must restart dsh to make it effective; the browser half usually only requires a page refresh. The repository’s docs/VERIFY.md provides a local acceptance checklist (performance of each placement, how round-trips appear in the conversation, etc.).

Typical Usage (Workflow Level)

  1. Install under the web profile and refresh the DSH Web interface, confirming the health check and the client active log in the console.
  2. In the conversation, ask the Agent to call html_ui to render a piece of HTML (or html_ui_template to bind an imported project), specifying or relying on the meta placement.
  3. Inside the iframe, use dshHTML.send to send user operations back to the model; listen to SSE/on to update the interface.
  4. When long-term data is needed, declare store in the template meta and use dshHTML.store / store.rows; manage multiple floating windows or fullscreen interfaces uniformly in HTML Admin.
  5. Put commonly used HTML tools into the template directory and set project-level permissions for reuse in future sessions or for the Agent to iterate and improve.

The screenshots in the README show forms such as inline, right dock, floating windows, fullscreen, session management, one-click deployment from the composer, and the Agent generating a notepad-style app with a single sentence, serving as visual references (paths see repo docs/images/).

Scenarios and Notes

Who it is for

  • Agent developers who want to build generative UI, fixed workflow panels, visual debugging, or small HTML tools (canvas, WebGL, third-party libraries, etc.) inside DSH.
  • Teams that need to integrate existing static HTML projects into DSH and let Agents enhance them.

Must Note

  • The plugin host half runs with the current dsh process privileges and provides external HTTP routes and local storage; before installing, please read the GitHub source code and the MIT license, and only trust templates and projects you have reviewed.
  • The community directory SkillHub plugin page is an independent site and has no official affiliation with DeepSeek / High-Flyer. Versions and stars are subject to real-time information from each source (e.g., the directory page stars are 0, take the page as the standard).

Conclusion

dsh-htmlui replaces “describing UI” with “rendering UI + structured return,” deeply integrating with Agents under five placements, supplemented by a template library, session management, and optional persistence slots. If you are building interactive agents on the DSH web side, you can install it using the command above, verify the environment with the health check and VERIFY checklist, and start trying with inline or dock-right.

  • Directory Page: https://www.skillhub.cn/plugins/mostkia/dsh-htmlui
  • GitHub: https://github.com/mostkia/dsh-htmlui
羽毛球分组比赛记分
小程序二维码

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

Xiaoye