dshbase

插件目录 / UI & Skins / dhs-theme-plugin

dhs-theme-plugin

已验证 · 实测可装 kongxiangyiren

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-15最近推送
跨平台平台

功能简介

dsh主题管理插件

我们的评价
可用 — 实测通过,早期项目

dsh主题管理插件 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

@kongxiangyiren/dhs-theme-plugin

DSH 主题管理插件(静态版):在 设置 → 主题 提供主题大分类,内置两套主题,
支持上传自定义 JS 主题并一键切换,数据持久化在磁盘上(换浏览器不丢)。

功能

  • 设置 → 主题 大分类(与"通用"平级)
  • 内置主题:森林绿 / 海洋蓝(13 个 alias token 覆盖 + 质感特效 CSS:辉光、网格/波纹、暗角、霓虹光带)
  • 上传自定义 JS 主题__ModuleLoader__.load 格式单文件,支持 overrideTokens 改色、注入 CSS、slots 注册 UI 组件、require("react")无文件大小限制
  • 点击切换:上传主题出现在主列表,点一下即应用;切换内置主题自动停用上传主题;同一时刻只有一个生效
  • 磁盘持久化:Host 半部注册 webServer 路由 GET/POST /api/theme-plugin,数据存放在 DSH home(~/.dsh/dhs-theme-plugin.json),浏览器无关

安装

# 从 npm 安装(首选)
dsh plugin --profile web add @kongxiangyiren/dhs-theme-plugin

# 或从 git 直装(纯 JS 无 prepare,无需 allowBuilds 授权)
dsh plugin --profile web add git+https://github.com/kongxiangyiren/dhs-theme-plugin

# 或本地目录(开发/验证)
dsh plugin --profile web add ./

dsh plugin 会把包加入 profile 的 dsh.profile.bundles 层列表。之后正常启动:

npx @deepseek-ai/dsh web

卸载

 dsh plugin --profile web remove @kongxiangyiren/dhs-theme-plugin

使用

  1. 打开 设置 → 主题
  2. 点击列表项切换:跟随系统 / 浅色 / 深色 / 森林绿 / 海洋蓝 / 已上传主题
  3. 上传主题:点 选择 JS 文件,选一个主题脚本(见 examples/
  4. "已上传主题"区可查看状态(应用中/未应用)并删除

主题文件格式

上传文件必须是浏览器 bundle 格式(与 dsh.client 包相同):

window.__ModuleLoader__.load({
  id: 'my-theme',
  factory: require => {
    var module = { exports: {} };
    var exports = module.exports;
    function apply(ctx) {
      ctx.effect(
        () =>
          ctx.theme.overrideTokens('my-theme', {
            '--dsw-alias-bg-base': { light: '#ffffff', dark: '#0f1115' },
            '--dsw-alias-brand-primary': { light: '#7c3aed', dark: '#a78bfa' }
          }),
        'my-theme tokens'
      );
    }
    exports.apply = apply;
    return module.exports;
  }
});

apply 收到的迷你 ctx 提供:theme / slots / effect / on / once / timeout / interval / get / console
factory 内支持 require("react")。注意:上传的 JS 会在页面中直接执行,只使用可信文件。

示例

  • examples/cyberpunk-theme.js — 黑底荧光绿终端风:网格、扫描线、霓虹光带、glitch
  • examples/nekogirl-theme.js — 粉色猫娘风:粉色调、猫耳、樱花花瓣、喵酱按钮、输入框猫猫(演示 require("react") + slots UI)

目录结构

theme-plugin/
├── package.json      # 包清单;files: ["lib", "README.md"]
├── README.md
├── lib/
│   ├── index.js      # Host 半部:/api/theme-plugin 路由(磁盘持久化)
│   └── client.js     # 浏览器 bundle:主题注册、设置页、上传/执行/切换/清理
└── examples/         # 可上传的示例主题(不随包发布)

开发与更新

  1. 修改源码副本 lib/client.js / lib/index.js(如 theme-plugin/ 目录)
  2. 同步到 ~/.dsh/profiles/node_modules/@kongxiangyiren/dhs-theme-plugin/
  3. 刷新页面(Host 半部改动需重启应用)

持久化

每个上传的主题以独立 .js 文件存储(内容即 dsh client bundle,一个主题一个文件):

  • 主题文件:~/.dsh/dhs-theme-plugin-themes/<id>-<hash>.js
  • 索引(元数据 + 选中):~/.dsh/dhs-theme-plugin.json
{
  "themes": [{ "id": "my-theme", "name": "my-theme", "file": "my-theme-a1b2c3.js", "active": true }],
  "selected": "ocean"
}

active 记录启用状态,selected 记忆森林绿/海洋蓝等自定义主题选中。旧版内嵌源码的索引会在首次读取时自动拆分为独立文件。

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dhs-theme-plugin」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:kongxiangyiren/dhs-theme-plugin

Headless(CLI)profile:

dsh plugin --profile headless add github:kongxiangyiren/dhs-theme-plugin

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

改变 dsh 的外观或交互方式——一套主题、皮肤或新面板,重塑工作区。

适合谁

在 web UI 里一待几小时、想让它按自己的习惯好看又好用的人。

二次开发建议

皮肤、面板和主题 token 是扩展点——写新皮肤、加面板,或与上游配色同步 token。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

UI & Skins 里更多

浏览全部 7795 个插件 →