How zhu1090093659/dsh-web-ui works
Purpose and entry points
This pnpm monorepo supplies independently installable DeepSeek Harness (DSH) web-profile plugins, skins, and a marketplace. It extends—not forks—the DSH Web GUI through official profile/plugin mounting. The aggregate installable entry point is packages/dsh-web-ui-all/src/index.ts, with its composition declared in packages/dsh-web-ui-all/aggregate.yml. Individual plugins expose host and browser entry points through their package-level src/index.ts files.
Plugin architecture and host/client boundary
Most packages split browser UI under src/client/ from privileged DSH-host integration, routes, and persistence at package root, src/host/, or src/core/. Shared mounting, loopback, DSH-home, and client patterns live in shared/host/mount-once.ts, shared/host/loopback.ts, and shared/client/sidebar-entry-core.ts. This boundary is central: React/TSX components invoke local host routes/APIs; host code accesses filesystem, processes, DSH sessions, and network services.
Workflow and operations plugins
Task execution is a host-controlled pipeline: board UI → controller/store → DSH-agent execution and cron scheduling → persisted state/status returned to UI. Key paths: packages/dsh-task-board/src/client/board/TaskBoard.tsx, packages/dsh-task-board/src/core/execution.ts, packages/dsh-task-board/src/host-service.ts.
SSH follows the same UI/API/engine separation, with pooled SSH connections supporting PTY, SFTP, tunnels, and clusters: packages/dsh-ssh/src/client/panel/SshPanel.tsx, packages/dsh-ssh/src/engine/connection-pool.ts, packages/dsh-ssh/src/routes.ts.
Remote access and recovery
Remote Web UI pairs devices, gates remote API access, and uses SSE with polling fallback. Its protocol boundary is implemented by pairing, channel rules, and mobile RPC/UI: packages/dsh-remote-web-ui/src/pairing.ts, packages/dsh-remote-web-ui/src/remote-channel-rules.ts, packages/dsh-remote-web-ui/src/mobile/views/App.tsx. Optional cloudflared/public tunneling is represented by packages/dsh-remote-web-ui/src/tunnel.ts.
Profile repair is a separate transactional recovery subsystem with host agent supervision and a browser console: packages/dsh-doctor/src/core/transaction.ts, packages/dsh-doctor/src/agent/supervisor.ts, packages/dsh-doctor/src/client/DoctorRecoveryConsole.tsx.
Content, presentation, and agent augmentation
Skin Center is the sole runtime loader for asset-directory skins. It validates v2 manifests, safely transforms CSS, coordinates preview/apply state, and loads runtime effects: packages/skins/skin-center/src/routes-v2.ts, packages/skins/skin-center/src/core/css-safety/transform.ts, packages/skins/skin-center/src/client/runtime/skin-controller.ts. Skin assets and manifests are data, e.g. packages/skins/skin-center/skins/blue-fantasy/skin.json.
Pet behavior is registry/state driven, with browser renderers including optional PixiJS/WebGL Live2D: packages/dsh-pet/src/registry.ts, packages/dsh-pet/src/service.ts, packages/dsh-pet/src/client/renderers/live2d/runtime.ts. Image understanding bridges chat attachments/URLs to configurable OpenAI-compatible vision endpoints: packages/dsh-tool-describe-image/src/vision-client.ts, packages/dsh-tool-describe-image/src/attach-routes.ts.
Marketplace and distribution
The static marketplace is deterministically built from skin, pet, and community manifests into market/dist/; its source UI is market/src/app.js, and build orchestration is scripts/market-build. Cloudflare Worker endpoints provide dynamic likes backed by D1 migrations: market/worker/src/index.js, market/worker/migrations/0001_init.sql, market/worker/wrangler.jsonc. The in-DSH market plugin installs assets/plugins through host routes: packages/dsh-market/src/core/installer.ts, packages/dsh-market/src/routes.ts.
Browser-contained DSH shell
market/shell/ is a distinct Vite/TypeScript browser runtime used for marketplace try-on/demo functionality. It boots a plugin-capable host, virtual filesystem/network, Node-like shims, shell tooling, WebContainer/Python/V86 guest runtimes, and service-worker support: market/shell/src/main.ts, market/shell/src/host/boot.ts, market/shell/src/runtime/webcontainer.ts, market/shell/src/runtime/v86.ts. Built output is deployed beneath market/dist/tryon/.
Main entry points: app.js Marketplace UI · market-build Catalog build · boot.ts Shell host boot · index.ts All-in-one entry
Components 24
DSH Web Plugins
Mounted web-profile extensions with browser-to-host boundaries.
- All-in-one entry · Composes installable web-profile packages.
packages/dsh-web-ui-all/src/index.ts - Aggregate composition
packages/dsh-web-ui-all/aggregate.yml - Shared host/client patterns · Provides mounting, loopback, and sidebar patterns.
shared/host/mount-once.ts - Task Board UI
packages/dsh-task-board/src/client/board/TaskBoard.tsx - Task execution · Runs DSH agents and cron-backed tasks.
packages/dsh-task-board/src/core/execution.ts - Task host service · Persists task state and returns status to the UI.
packages/dsh-task-board/src/host-service.ts - SSH panel
packages/dsh-ssh/src/client/panel/SshPanel.tsx - SSH host routes
packages/dsh-ssh/src/routes.ts - SSH connection pool · Pools connections for PTY, SFTP, tunnels, and clusters.
packages/dsh-ssh/src/engine/connection-pool.ts - Remote pairing and policy · Pairs devices and enforces remote-channel rules.
packages/dsh-remote-web-ui/src/pairing.ts - Remote mobile UI · Uses SSE with polling fallback for remote control.
packages/dsh-remote-web-ui/src/mobile/views/App.tsx - Public tunnel · Cloudflared-based remote exposure.
packages/dsh-remote-web-ui/src/tunnel.ts - Recovery console
packages/dsh-doctor/src/client/DoctorRecoveryConsole.tsx - Profile repair transaction · Transactional profile repair under agent supervision.
packages/dsh-doctor/src/core/transaction.ts - Skin Center routes · Validates v2 manifests and coordinates skin state.
packages/skins/skin-center/src/routes-v2.ts - Safe CSS transform
packages/skins/skin-center/src/core/css-safety/transform.ts - Skin runtime controller · Previews, applies, and loads runtime effects.
packages/skins/skin-center/src/client/runtime/skin-controller.ts
Marketplace
Static catalog, dynamic likes, and in-DSH installation.
- In-DSH installer · Installs marketplace assets and plugins through host routes.
packages/dsh-market/src/core/installer.ts - Marketplace UI
market/src/app.js - Catalog build · Deterministically builds manifests into the static market.
scripts/market-build - Likes API · Dynamic likes backed by D1 migrations.
market/worker/src/index.js
Try-on Browser Shell
Standalone browser-contained DSH demo runtime.
- Shell host boot · Boots plugin-capable host, virtual filesystem, network, and shims.
market/shell/src/host/boot.ts - Guest runtimes · WebContainer, Python, and V86 guest execution.
market/shell/src/runtime/webcontainer.ts - Try-on deployment · Shell output deployed under the marketplace distribution.
Connections 17
- Aggregate composition → All-in-one entry: declares
- All-in-one entry → Shared host/client patterns: mounts via
- Task Board UI → Task host service: local host API
- Task host service → Task execution: executes and schedules
- SSH panel → SSH host routes: local host API
- SSH host routes → SSH connection pool: uses
- Remote mobile UI → Remote pairing and policy: pairs and RPC
- Public tunnel → Remote pairing and policy: optional exposure
- Recovery console → Profile repair transaction: drives recovery
- Skin Center routes → Safe CSS transform: sanitizes CSS
- Skin runtime controller → Skin Center routes: preview/apply API
- Catalog build → Marketplace UI: builds catalog
- Likes API → Marketplace UI: likes endpoint
- Marketplace UI → In-DSH installer: installation flow
- Shell host boot → Guest runtimes: hosts
- Shell host boot → Try-on deployment: built to
- Catalog build → Try-on deployment: publishes under dist