find-plugin
find-plugin 是一个 DeepSeek Harness(DSH)插件。它向 Agent 注册 find_plugin Tool,按用户描述在 GitHub 上查找社区 DSH 插件,验证仓库根目录的 DSH bundle manifest,并生成安装命令。
第一版是无数据库、无 Registry、无 Web UI 的 MVP。它只搜索和生成命令,不会自动安装插件。
安装
dsh plugin --profile web add github:graceen2331-prog/find-plugin
本仓库提交了 lib/ 构建产物,因此从 GitHub 安装时不需要运行 prepare 构建脚本。安装或更新 bundle 后,重启对应的 DSH profile。
安装社区插件会让其代码在本机执行。安装前请审查源码;更严格的用法是把命令中的 GitHub spec 固定到可信 commit SHA。
使用
直接描述你需要的能力,例如:
帮我找一个 memory 插件
Agent 会在合适时自主调用:
find_plugin({
query: "memory",
limit: 5
})
也可以说:
帮我找一个支持 mobile remote access 的 DSH 插件
Tool 最多返回 10 条结果。每条结果包含名称、描述、GitHub URL、stars、更新时间、owner、DSH bundle 验证状态和安装命令。
示例输出:
Found 1 DSH plugin for "mobile remote".
1. dsh-mobile-plugin
Mobile remote UI for DeepSeek Harness
GitHub: https://github.com/example/dsh-mobile-plugin
Owner: example
★ 320
Updated: 2026-08-20
Verified DSH plugin: ✓
Install:
dsh plugin --profile web add github:example/dsh-mobile-plugin
验证规则
GitHub repository topic 只用于发现候选项,不等于插件有效。find-plugin 会读取每个候选仓库根目录的 package.json,只有存在以下非空字段时才标记为已验证:
{
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
}
}
}
缺少 package.json、JSON 无法解析、仓库不可用或 dsh.bundle.patch 无效时,verified 都是 false,输出会附上可读原因。GitHub Contents API 对“文件不存在”和部分“仓库不可用”场景都可能返回 404,因此这两种情况会使用同一条保守提示。
GitHub API
搜索请求使用:
topic:dsh-plugin <query terms> in:name,description,readme
认证优先读取环境变量:
export GITHUB_TOKEN=github_pat_...
没有 token 时会匿名请求。匿名请求的限额更低;遇到 rate limit 时,Tool 会返回重试时间(若 GitHub 提供)并提示配置 GITHUB_TOKEN。Token 不会写入磁盘或输出。
排序规则为:query relevance → verified DSH plugin → stars → recently updated。query relevance 使用 GitHub 搜索分数,加上 repository name/description 的轻量词法匹配;没有使用向量数据库或 embedding。
本地开发与测试
要求 Node.js 22.19+ 或 24+,并使用 pnpm:
corepack enable
pnpm install
pnpm test
pnpm run typecheck
pnpm run build
一次运行全部检查:
pnpm run check
把本地 checkout 安装进 DSH:
pnpm run build
dsh plugin --profile web add .
然后重启 Web profile,并检查 bundle 已进入配置层:
dsh --profile web --dump-config
dsh --profile web
项目结构
find-plugin/
├── src/
│ ├── index.ts # DSH apply(ctx) 与 find_plugin 注册
│ ├── github.ts # GitHub API、搜索解析、bundle 验证与错误处理
│ ├── search.ts # 候选验证、相关性计算、排序与 limit
│ ├── format.ts # LLM 友好的纯文本输出
│ └── types.ts
├── tests/
│ ├── github.test.ts
│ └── search.test.ts
├── lib/ # 已提交的可安装 JavaScript 与类型声明
├── cordis.patch.yml
├── package.json
└── tsconfig*.json
当前限制
- 只搜索带
dsh-plugin topic 的公开 GitHub repositories;topic 由仓库维护者自行设置,候选质量不受本项目控制。
- 只验证仓库根目录的
package.json,暂不发现 monorepo 子目录里的 bundle。
verified: true 只表示 manifest 结构符合 DSH bundle 规范,不代表代码安全、质量可靠或与当前 DSH 版本完全兼容。
- GitHub repository search 对 README 的匹配由 GitHub 负责;本地二次排序不会下载 README,以减少 API 请求。
- 没有缓存、数据库、Registry、embedding、Web UI 或自动安装功能。
规范依据
实现依据当前 DeepSeek Harness 官方源码 0.1.1-rc.2 的 Build a tool、Package and install a plugin 与 defineTool 源码。GitHub 查询与文件读取遵循官方 repository search qualifiers 和 Contents REST API。