shixiaosia
dsh-plugin-marketplace
No description
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
dsh-plugin-marketplace
一款由 AI 全程制作的 dsh(DeepSeek Harness)插件,为 Web 端 设置 → 插件 页面新增一个 插件市场 标签页。
插件介绍
本插件在 dsh 的 Web 设置中增加了一个「插件市场」标签页,用于浏览 GitHub 上带有 dsh-plugin 主题标签的插件仓库、就地阅读每个项目的 README,并支持将 README 交给当前会话的 AI 模型总结安装方法。对于 GitHub 访问困难的网络环境,内置了一个可开关、可自定义地址的镜像代理。
主要功能
- 浏览插件:拉取 GitHub 上携带
dsh-plugin主题的仓库,每页 100 个;滚动到列表底部时自动继续加载后续页面,直至全部加载完成(受 GitHub 搜索结果 1000 条上限约束)。。 - 总结(AI 安装指引):每张缩略卡片带 总结 按钮(悬停显示功能简介)。点击后将该仓库的 README——前面附上可自定义的预设提示词——通过
api.sessions.prompt(mode "queue")发送给当前正在使用的 dsh 会话的模型,让对话中的模型直接总结该插件的安装方法,答案出现在当前对话里。预设提示词可在标签页内编辑(「编辑提示词」,持久化于 localStorage 键dsh-plugin-marketplace.summarize-prompt),支持{readme}占位符(会被替换为 README 内容);按钮状态依次为 总结中… → 已发送给模型。
工作原理
- 包内声明了
dsh.bundle.patch(cordis.patch.yml),向组合后的 Web 配置树插入一条客户端名册记录(ui-plugin-marketplace→dsh-plugin-marketplace)。 - 包内同时声明
dsh.client(platform: web),浏览器模块宿主会在/plugins/dsh-plugin-marketplace/client.js提供lib/client.js。 - 浏览器端注册一个
settings.plugins.tab槽位(id: marketplace),由既有的「插件」设置区渲染为标签页。 - GitHub 请求全部由浏览器直连发起——
api.github.com与raw.githubusercontent.com都返回Access-Control-Allow-Origin: *,因此无需宿主端代理或令牌。开启代理时,README 获取按「代理 → 直连 → API readme」的顺序回退。 - 代理偏好、视图配置(排序/方向/布局)、总结提示词均为浏览器本地状态(localStorage),刻意不占用宿主设置命名空间——因此本插件无宿主端依赖(
lib/index.js为空操作)。 - 总结功能走应用自身的浏览器 wire client:标签页注入
connection与sessions,从sessions.list.getSnapshot().current解析当前会话 id,调用api.sessions.prompt({ sessionId, mode: "queue", content: [{ type: "text", text }] })——与对话输入框同一条 RPC,总结以普通助手回复的形式出现在当前对话中。
安装方法
以下命令中的
web为 Web 配置文件(profile)名;配置文件目录为$DSH_HOME/profiles/web,$DSH_HOME默认为~/.dsh。安装完成后重启dsh web(或刷新已打开的 Web 页面),在 设置 → 插件 中即可看到「插件市场」标签页。
自动安装(推荐)
使用 dsh 自带的插件管理命令。该命令会在配置文件目录执行 pnpm add,并自动把带有 dsh.bundle 声明的依赖加入 dsh.profile.bundles 层列表,一次完成:
# ① 从本地路径安装(已克隆/解压好源码)
dsh plugin --profile web add /path/to/dsh-plugin-marketplace
# ② 直接从 GitHub 安装(首次使用会自动初始化配置文件)
dsh plugin --profile web add git+https://github.com/shixiaosia/dsh-plugin-marketplace.git
手动安装
不依赖 dsh plugin 命令,手工放置插件并编辑配置文件:
# 1. 获取插件代码(克隆或下载 zip 解压均可)
git clone https://github.com/YOUR-GITHUB-USERNAME/dsh-plugin-marketplace ~/dsh-plugin-marketplace
# 2. 编辑配置文件 ~/.dsh/profiles/web/package.json,改动两处:
{
"dependencies": {
// 新增:指向插件代码所在位置(link: 本地路径)
"dsh-plugin-marketplace": "link:~/dsh-plugin-marketplace"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
// 新增:追加到层列表末尾
"dsh-plugin-marketplace"
]
}
}
}
# 3. 在配置文件目录安装依赖(写入 node_modules 并建立链接)
cd ~/.dsh/profiles/web && pnpm install
# 4. 重启 Web 应用
dsh web
提示:手动安装时也可直接把插件目录复制进
~/.dsh/profiles/web/node_modules/dsh-plugin-marketplace/,但 pnpm 重新安装时可能清理该目录,因此更稳妥的做法是上面的link:方案。
卸载方法
自动卸载
dsh plugin --profile web remove dsh-plugin-marketplace
该命令会执行 pnpm remove,并自动把该依赖从 dsh.profile.bundles 层列表中移除。随后重启 dsh web 即可。
手动卸载
# 1. 编辑 ~/.dsh/profiles/web/package.json,删除两处:
# · dependencies 中的 "dsh-plugin-marketplace" 条目
# · dsh.profile.bundles 数组中的 "dsh-plugin-marketplace"
# 2. 在配置文件目录同步依赖
cd ~/.dsh/profiles/web && pnpm install
# 3. 重启 Web 应用
dsh web
注意事项
- GitHub 未登录搜索 API 有速率限制(每分钟 10 次、每小时 60 次);按查询缓存 + 内存 README 缓存使浏览保持在限额内——排序/筛选/布局从不请求 API,只有显式刷新或新的 Enter 搜索才会。
- 每个查询默认只展示按星标排序的前 30 个仓库,顶部标题栏会显示 GitHub 的完整结果总数。