DSH 插件中枢 v0.5 · 演进自 dsh-skin-market
dsh-home 是 DeepSeek Harness (DSH) 生态的插件中枢,提供:
dsh-home 全套命令dsh plugin --profile web add 'dsh-home@latest'
npm install -g dsh-home
dsh-home init my-first-skin
cd my-first-skin
dsh-home dev # 本地预览
dsh-home validate # 校验
dsh-home publish # 一键发布
| 模块 | 说明 |
|---|---|
src/types.ts |
类型定义 + v1→v2 迁移函数 |
src/live-preview.ts |
实时试穿 + hot-swap + family 批量应用 + revert/commit + diff |
src/registry.ts |
多注册表联邦 + 冲突解决 + 过滤 + RegistryManager |
src/cli.ts |
创作者 CLI 框架(init/validate/dev/publish/screenshot/registry/bump/version/help) |
// live-preview
import { applyLivePreview, applyFamily, diffPreviews, startAutoDemo } from 'dsh-home/lib/live-preview.js'
const handle = applyLivePreview(plugin) // 应用 + 返回 handle
handle.revert() // 撤销
handle.commit() // 提交(持久化)
const diff = diffPreviews(pluginA, pluginB) // 对比 CSS 变量差异
// registry
import { RegistryManager, mergeCatalogs, filterPlugins } from 'dsh-home/lib/registry.js'
const mgr = new RegistryManager()
mgr.add({ id: 'r1', url: 'https://...', trust: 'community', enabled: true, ... })
const merged = mgr.merge() // 合并所有 enabled 注册表
const filtered = mgr.filter({ verifiedOnly: true, tags: ['glass'] })
dsh-skin-hub v2
│
┌───────────────────┼───────────────────┐
│ │ │
▼ ▼ ▼
npm 包 GitHub Pages catalog.json
(运行时) (UI 发现) (数据更新)
│ │ │
└───────────────────┼───────────────────┘
▼
DSH Runtime
(用户实际使用)
详见 docs/ARCHITECTURE.md(即将添加)。
| 字段 | v1 | v2 |
|---|---|---|
schemaVersion |
— | 必填,= 2 |
type |
隐式 skin | 必填:skin / family / pack / tool / scene / personality / voice / knowledge |
assets |
无 | 新增:icons / illustrations / animations / fonts / music / sounds / voice |
livePreview |
无 | 新增:cssVariables + componentOverrides |
family |
无 | 新增(仅 family 类型):members / defaultSkin / exclusive |
monetization |
无 | 新增:pricing + tiers |
registry |
无 | 新增:source / trust / signature |
metrics |
顶层字段 | 重组:featuredRank / starsSnapshot 移入 |
timestamps |
顶层字段 | 重组:releaseUpdatedAt 等移入 |
v1 → v2 迁移:migrateV1ToV2(v1Entry) 自动完成迁移,老数据 100% 兼容。
npm test # 运行所有测试
npm run test:watch # watch 模式
当前测试覆盖:
| 模块 | 测试用例 | 状态 |
|---|---|---|
live-preview |
12 | ✅ |
registry |
19 | ✅ |
types |
8 | ✅ |
| 合计 | 39 | ✅ 100% 通过 |
v1: dsh-skin-market → v2 (dsh-skin-hub) → v2.5 (dsh-home)
| 维度 | v1 (dsh-skin-market) | v2 (dsh-home) |
|---|---|---|
| Schema | 仅 skin | skin / family / pack / tool / scene / personality |
| 资产 | 仅 metadata | icons / illustrations / animations / fonts / music / sounds / voices |
| 注册表 | 单注册表 | 多注册表联邦 |
| 家族 | 无 | 一等公民 |
| 创作者工具 | 无 CLI | dsh-home CLI(9 个子命令) |
| 实时试穿 | 截图预览 | CSS 变量热替换 |
| 切换 | 需 restart | 0 重启 |
| 测试 | 70+ | 39 单元 + 已有 e2e |
dsh-skin-hub 基于 dsh-skin-market 演进而来。
我们感谢所有早期贡献者:
原项目以 MIT 协议发布,本项目继承双协议策略(BSL 1.1,详见 LICENSE)。
Business Source License 1.1 — 4 年后转 MIT。