dsh-community-plugins:为 DSH 会话注册社区插件发现与安装指南

前言

在 DSH 的插件化场景中,社区插件的来源通常不止一个:已安装的市场工具、目录索引、GitHub topic、npm 等。对 agent 来说,单纯存在市场工具并不等于它会优先使用市场工具,也不等于它知道如何核对本机已安装内容、如何评估插件来源、如何按 DSH 的安装机制执行安装并验证结果。

dsh-community-plugins 要解决的问题就是这个上下文缺口:它注册一个全局 skill,把社区插件的查找、评估、安装规则写入每个会话的可用技能目录,让 agent 在给出插件安装建议时,先依据本机 profile manifest 和已安装工具,而不是假设或推广未安装插件。

这是什么

dsh-community-plugins 由 HubaKing 维护,许可证为 MIT。它不是一个独立插件商店,而是一个 DSH 插件:将社区插件生态指南注册为 skill。

安装后,dsh-community-plugins 会出现在每个会话的 <available_skills> 目录中。agent 读取该 skill 后,会知道本机已内置 dshmarket / dsh-plugin-marketplace 等市场相关能力,并学习如何查找、评估、安装社区插件。

核心功能

下面列出的能力均来自已核实资料:

1、注册全局 skill:dsh-community-plugins 出现在每个会话的 <available_skills> 目录中。

2、教 agent 验证本机实际已安装内容:读取 profile manifest,不假设或推广未安装插件。

3、提供中立发现渠道:已安装市场工具、目录索引(Oh-My-DSH data/plugins.jsonawesome-dsh-plugin)、GitHub dsh-plugin topic、npm。

4、记录官方安装方式及加速方式:dsh plugin 命令、npm-first、批量安装、按插件形式选择 hot-mount 或重启。

5、记录 pnpm 供应链策略(minimumReleaseAge)及其规避方式。

6、声明约束:不修改官方自带预设、重启规则、构建授权边界。

安装与启用

前提

需要可用的 dsh CLI。如果 dsh 不在 PATH,可以使用 dsh 安装根目录下的 CLI 入口。

GitHub 直接安装

先通过 GitHub 直接添加插件:

dsh plugin --profile web add github:HubaKing/dsh-community-plugins

该方式适合能直接访问 GitHub 的环境。资料说明其为 pure JavaScript、无 build scripts;GitHub direct install 需要时无需 prepare 脚本或 allowBuilds 授权。

Gitee 镜像

如果使用 Gitee 镜像仓库:

dsh plugin --profile web add https://gitee.com/HubaKing/dsh-community-plugins.git

tarball

使用 release tarball 时,先下载文件,再本地添加:

curl -LO https://github.com/HubaKing/dsh-community-plugins/releases/download/v0.1.2/dsh-community-plugins-0.1.2.tgz
dsh plugin --profile web add ./dsh-community-plugins-0.1.2.tgz

开发模式

开发模式下先 clone 到插件目录,再使用 link: 方式添加:

git clone https://github.com/HubaKing/dsh-community-plugins.git "${DSH_HOME:-~/.dsh}/plugins/dsh-community-plugins"
dsh plugin --profile web add link:${DSH_HOME:-~/.dsh}/plugins/dsh-community-plugins

安装后重启与验证

安装完成后,重启 dsh。资料说明 bundle layers 在启动时组合,因此安装后需要重启。

验证方式是查看新会话:当 dsh-community-plugins 出现在 <available_skills> 中,表示安装成功。

如果 dsh 不在 PATH,可改用 dsh 安装根目录中的 CLI 入口:

node <dsh install root>/apps/cli/lib/bin.js plugin --profile web add <spec>

典型用法

1、新会话中确认 skill 可用。

<available_skills> 中查找 dsh-community-plugins。如果存在,说明该会话可读取该指南。

2、让 agent 查找社区插件。

agent 应按 skill 指引优先核对已安装市场工具、目录索引、GitHub dsh-plugin topic、npm 等渠道,并结合 profile manifest 确认本机实际安装内容。

3、按插件形式选择安装路径。

资料中记录的安装方式包括 dsh plugin 命令、npm-first、批量安装,以及按插件形式选择 hot-mount 或重启。

4、修改 skill 内容。

编辑:

skills/dsh-community-plugins/SKILL.md

保存后生效。如果需要共享给其他用户,执行:

git push

适用场景与注意

适合以下场景:

1、使用 DSH,并希望在 agent 会话中稳定查找社区插件。

2、希望 agent 先验证本机 profile manifest,再给出安装建议,而不是假设未安装插件已经存在。

3、需要把市场工具、目录索引、GitHub topic、npm 等发现渠道统一纳入 agent 的上下文。

4、需要记录 npm-first、批量安装、hot-mount 或重启、pnpm minimumReleaseAge 及其规避方式等安装规则。

注意以下几点:

1、插件以当前 dsh 进程权限运行。安装前应检查源码与许可证。dsh-community-plugins 的许可证为 MIT。

2、资料列出了多个安装方式,无法从已核实资料唯一确认哪一个为唯一官方安装命令。实际使用时任选其一,并以新会话中 <available_skills> 是否出现 dsh-community-plugins 作为验证依据。

3、不要把社区插件目录理解成官方应用商店。资料中提到的 dshmarket / dsh-plugin-marketplaceOh-My-DSH data/plugins.jsonawesome-dsh-plugin、GitHub dsh-plugin topic、npm 等,应作为发现渠道使用。

4、该插件会声明不修改官方自带预设、遵守重启规则,并记录构建授权边界。使用时应遵守这些约束。

链接与结尾

dsh-community-plugins 的价值在于把“发现插件、评估插件、安装插件、验证插件”写入 agent 会话上下文,减少 agent 因缺少 DSH 上下文而回退到通用搜索的情况。

相关链接:

  • GitHub 仓库:https://github.com/HubaKing/dsh-community-plugins
  • 目录 / 市场入口:dshmarket / dsh-plugin-marketplace
  • 目录页 URL:已核实资料中未确认具体 URL,建议通过已安装市场工具或相关文档入口查看。
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜