Skip to content
dsh.fish
Bundle

dsh-plugin-source

增强官方「插件列表」tab:按来源分组(官方/内置/自装),显示版本、上游仓库(org/repo 一键跳转)与本地开发标记。只读,零网络。

Source
Carrick-K7
stars
1 stars
License
MIT
Updated
Updated yesterday

Readme

# dsh-plugin-source

增强 DeepSeek Harness 官方「设置 → 插件 → 插件列表」tab:**按来源分组**,一眼区分**官方**与**社区插件**,并显示版本、上游仓库(org/repo 一键跳转)与本地开发标记。

纯只读、零网络、零写盘:所有数据来自本地文件(loader 清单 + `node_modules/<pkg>/package.json` + profile `package.json`)。

![设置 → 插件 → 插件列表:社区插件组排在官方组前面,展开卡片显示版本、上游仓库与本地开发标记](docs/plugin-list.png)

## 功能

- **来源分组**(组头计数,可折叠;**社区插件组排在官方插件组前面**):
  - `@deepseek-ai/` 前缀 → **官方**(官方 monorepo 作用域)
  - `cordis:` 前缀 → **官方**(loader 内部基建,并入官方组)
  - 其余 → **社区插件**
- **来源徽标**:每张卡片带来源标签。
- **版本号**:卡片显示已装版本(官方页不显示)。
- **上游仓库**:读本地 `repository`/`homepage` 字段,显示 org/repo 并一键跳转 GitHub;未声明的显示「未声明仓库」。
- **本地开发标记**:profile `dependencies` 里 `file:`/`link:` 依赖 → 「本地开发」(自己写的),其余 → 已安装。
- 官方功能全部保留:搜索、展开详情(entryId / 配置状态 / Cordis 状态)、状态点、重试。

## 实现方式

影子覆盖(shadow):注册 `settings.plugins.tab` 插槽 **id=`all`、priority=-1**(官方默认 0)。
DSH slots 的 list 语义是「同 id 不同 priority 共存、最低者渲染」,因此 tab 名字与位置不变,
官方组件被我们的增强组件遮蔽。

数据通道:

- 插件清单:官方 `ctx.remote.pluginInventory.list()`(client 直调);
- 来源元数据:自建只读 remote `pluginSource/describe(moduleNames)`(host 读本地文件)。

## 构建与安装

```sh
pnpm install
node build.mjs          # 产出 lib/index.js (host) + lib/client.js (web)
# 完整构建(含类型声明):npm run build
```

安装(bundle 类型):

```sh
# 从 npm 安装(发布后)
dsh plugin --profile web add dsh-plugin-source
# 从 GitHub 安装
dsh plugin --profile web add github:Carrick-K7/dsh-plugin-source
# 本地开发:dsh plugin --profile web add link:/path/to/dsh-plugin-source
```

装完重启 `dsh web`,打开 设置 → 插件 → 插件列表 即可看到分组。

## 目录

```
src/
  classify.ts      来源判定 + 仓库解析(纯函数)
  contract.ts      wire 契约(zod schema,host/client 共用)
  typert.ts        host manifest
  host.ts          host 插件:describe remote(只读本地文件)
  client/index.tsx web 插件:shadow 官方 tab + 分组组件
  client/remote.ts client remote 贡献
  client/styles.ts 组件样式(--dsw-alias-* 变量)
```

## 许可

MIT

Install

dsh plugin --profile web add github:Carrick-K7/dsh-plugin-source

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source