Skip to content

dsh-theme-studio

Verified

@dsh-electron/dsh-theme-studio · v0.1.3 · MIT · Web UI

Portable DSH theme overlay plugin: builtin palettes, preview, persistence, and General settings UI

Install

dsh plugin add @dsh-electron/dsh-theme-studio

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Readme

dsh-theme-studio

English | 中文

可移植的 DSH/Cordis 插件:在官方外观偏好之上叠加内置配色主题。包声明 platform:web,不依赖 Electron、Node 或 Desktop。npm 作用域 @dsh-electron/ 标识发布者,不是运行时要求。

本仓库是源码权威。DeepSeek Harness Desktop 通过 git subtree 镜像到 apps/electron/runtime/plugins/dsh-theme-studio,并从源码重新构建 Host 与 Client artifacts。同一包可在 Desktop 与标准 DSH Web Host 中不变地运行。

Stage 1 提供内置主题浏览、预览、应用、持久化与插件生命周期恢复。Theme Schema、导入导出与 Theme Creator Agent 属于后续阶段。

DSH 兼容性

支持的精确版本以 src/compat/dsh-version.ts 为准:0.1.5-rc.2、0.1.5-rc.3、0.1.6-alpha.1、0.1.6-alpha.2、0.1.7-alpha.1、0.1.7-alpha.2、0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1、0.2.0-rc.2。本节与该列表不一致时,pnpm compat:check 会失败。开发安装固定在最新的受支持版本。启用 DSH peer 兼容校验的宿主,仅在运行时版本位于该列表时加载本插件。

逐版本证据与升级风险见 DSH 兼容矩阵。运行 pnpm compat:matrix 可在独立安装树中验证所有支持版本。

安装

本包在 npm 上的包名为 @dsh-electron/dsh-theme-studio。tag 驱动的发布流程见发布说明。

DeepSeek Harness Desktop — Theme Studio 是必需内置插件。Desktop 始终从 runtime plugin inventory 挂载它。

DSH Web — 构建 lib/ 后加入 profile:

pnpm install
pnpm build
dsh plugin --profile web add .

或直接从 GitHub 安装:

dsh plugin --profile web add github:cherrchen/dsh-theme-studio

dsh plugin add 会启用附带的 cordis.patch.yml 层。官方外观(浅色 / 深色 / 跟随系统)仍由 dsh-client-ui-theme 拥有。Theme Studio 只在设置 → 通用 → 主题增加一行。

使用体验

设置 → 通用中,外观在前(order = 10),主题在后(id = themes,order = 20)。

  • 默认清除 Theme Studio 覆盖层,回到官方主题。
  • 预览是临时的,不会写入设置。
  • 应用把 activeThemeId 持久化到 Host 的 theme-studio 命名空间。
  • 更改外观仍切换官方浅色/深色底色;已应用的 Theme Studio 调色板会自动跟随。

重启应用会恢复上次应用的主题。卸载插件会移除两层覆盖,ThemeRuntime 回到官方主题。

运行模型

Theme Studio 不自行呈现 CSS。它调用 ctx.theme.overrideTokens():

Official Light / Dark / System
        ↓
ACTIVE_SOURCE  (@dsh-electron/dsh-theme-studio:active)
        ↓
PREVIEW_SOURCE (@dsh-electron/dsh-theme-studio:preview)
        ↓
ThemeSnapshot → ThemePresenter → DOM

Host 设置:

ui-theme.preference          system | light | dark
theme-studio.activeThemeId   null | dsh-theme-studio.*

null 表示默认。内置 id 包括 dsh-theme-studio.claude、.codex、.claude-cream、.graphite、.oled、.nordic、.paper 与 .warm。

组装

Host 插件在存在 ctx.settings 时注册 theme-studio 设置命名空间,否则为空操作。到 0.1.6-alpha.2 为止,Host 使用 settings.register。从 0.1.7-alpha.1 起,同一段配置是插件的 Config,并且会关闭自动生成的表单,因为主题行是自定义的。Client 插件需要 theme、slots、locale、connection 与 remote,然后读取宿主实际提供的设置通道:settingsScope 或 configForms。Headless profile 只加载 Host 半,不会启动浏览器 UI。本包有意不导出 ./invariant,因为 ThemeRuntime 负责覆盖层一致性,设置服务负责持久化。浏览器包通过包名加载器记录注册;官方插件管理器从已安装 bundle 元数据读取插件。

npm 发布

本包在 npm 上的包名为 @dsh-electron/dsh-theme-studio。推送与 package.json 版本一致的 v<version> tag 会触发发布。

开发

使用 Node.js ^22.19 或 >=24,以及 pnpm 11。

pnpm install --frozen-lockfile
pnpm compat:check
pnpm typecheck
pnpm test
pnpm build
pnpm pack --dry-run

Model Experience

无。本包贡献面向用户的 Client UI,不注册模型工具或提示内容。

KV Cache effect

无。本包不增加、替换或保留模型请求 token。

已知限制与延后工作

  • 仅内置主题 — Stage 1 不导入、导出或校验公开的 .dsh-theme.json schema。
  • 没有公开的 ctx.themeStudio catalog — 跨插件发现 API 属于 Stage 3。
  • 没有自动对比度认证 — 内置调色板经人工检查可读性;WCAG 声明等待 Stage 2 校验器。