Skip to content

Plugin Market

雪绫 edited this page Aug 25, 2026 · 2 revisions

插件市场与发布清单

插件市场把四类来源合并为同一列表:

  1. 客户端内置的 GitHub Topic pclnexplugin
  2. 内置 NexDeveloper 官方 plugin-market.json
  3. 用户添加的 JSON 市场源或单插件 Manifest 源。
  4. 安装插件时保存的 Manifest 订阅。

内置 GitHub Topic

Topic 固定在客户端:

pclnexplugin

搜索使用 GitHub Search Repositories API:

https://api.github.com/search/repositories?q=topic%3Apclnexplugin&sort=updated&order=desc

插件仓库需要:

  • 添加 pclnexplugin Topic。
  • 仓库根目录提供 manifest.json
  • 普通用户能访问仓库和 Release 资源。

仓库不要求开源,不要求 License、.csproj 或源代码。它可以只包含 Manifest、README 和 GitHub Release。

Topic 只负责发现仓库。仓库返回的其他 Topics 可以作为插件 Tag 展示和筛选,但不能改变市场发现关键词。

Topic 不是自定义市场字段

plugin-market.json 不允许声明 topics。客户端和官方服务都会拒绝这类字段:

{
  "topics": ["another-topic"]
}

用户也不能通过 URI 添加自定义 Topic 源。需要扩展市场时,应添加 JSON 来源文档或直接添加单插件 Manifest。

官方 NexDeveloper 来源

内置地址:

https://raw.githubusercontent.com/PCL-Nex-Developer/Nex_Server/refs/heads/main/apiv2/plugin-market.json

该文件同时承载官方开发者身份、额外 Manifest 地址和内联插件。客户端没有 jsDelivr 回退;GitHub 请求按启动器现有 GitHub 加速配置自动选择请求地址。

plugin-market.json

推荐格式:

{
  "version": 1,
  "updatedAt": "2026-07-21T00:00:00Z",
  "name": "Example Market",
  "group": "Community",
  "tags": ["featured"],
  "developers": [
    {
      "githubLogin": "example",
      "displayName": "Example",
      "level": "trusted"
    }
  ],
  "manifests": [
    "https://example.com/plugins/example/manifest.json"
  ],
  "plugins": []
}
字段 说明
version 当前必须为 1
updatedAt 来源更新时间,可选
name 用户界面显示名称
group 分组名称;没有 name 时也可作为显示名
tags 继承给该来源插件的 Tag
developers 该来源声明的开发者身份
manifests 单插件 Manifest 地址列表,支持相对地址
plugins 直接内联的完整插件 Manifest 列表

JSON 来源可以是 HTTP/HTTPS URL,也可以是本地 JSON 文件。单个 Manifest 或仓库失败不会阻止其他来源加载;成功结果和来源文本会缓存,网络失败时可使用最近缓存。

开发者身份

  • 内置 NexDeveloper 来源中 level: official 的开发者获得 Official 身份。
  • 用户添加的第三方来源无论声明什么 level,都只获得本地用户信任身份。
  • 用户仍可以在客户端按 GitHub Login 单独信任或取消信任开发者。
  • GitHub Login 比较忽略大小写。
  • 关闭“显示来自非官方开发者的内容”后,只显示官方或用户已信任开发者的插件。

第三方来源不能伪造 NexDeveloper 官方身份。

manifest.json

GitHub Topic 仓库根目录和直接 Manifest 源都使用同一结构:

{
  "id": "example.plugin",
  "name": "Example Plugin",
  "author": {
    "githubLogin": "example",
    "displayName": "Example"
  },
  "description": "Example PCL.Mixin plugin.",
  "readmeUrl": "README.md",
  "repository": "https://github.com/example/example-plugin",
  "homepageUrl": "https://example.com/plugin",
  "logo": "assets/logo.png",
  "group": "Utilities",
  "tags": ["download", "automation"],
  "dependencies": [
    {
      "id": "example.bridge",
      "version": ">=1.0.0 <2.0.0"
    }
  ],
  "versions": [
    {
      "version": "1.2.0",
      "pclCoreVersion": "2026.07.1",
      "downloads": {
        "windows": {
          "amd64": {
            "packageUrl": "https://github.com/example/example-plugin/releases/download/v1.2.0/example-plugin-windows-amd64.pclx",
            "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
          },
          "arm64": {
            "packageUrl": "https://github.com/example/example-plugin/releases/download/v1.2.0/example-plugin-windows-arm64.pclx",
            "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
          }
        },
        "linux": {
          "anycpu": {
            "packageUrl": "https://github.com/example/example-plugin/releases/download/v1.2.0/example-plugin-linux-anycpu.pclx",
            "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
          }
        },
        "macos": {
          "arm64": {
            "packageUrl": "https://github.com/example/example-plugin/releases/download/v1.2.0/example-plugin-macos-arm64.pclx",
            "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
          }
        }
      },
      "releaseNotes": "https://github.com/example/example-plugin/releases/tag/v1.2.0"
    }
  ]
}

必需规则:

  • idnamedescription 和至少一个作者标识必须存在。
  • GitHub 仓库的 author.githubLogin 必须与仓库 Owner 一致。
  • Topic 结果中的 repository 必须指回当前 Topic 仓库。
  • 每个版本号必须是有效 SemVer。
  • 每个版本必须在 downloads 下至少声明一个平台包。
  • packageUrl 必须是完整 HTTP/HTTPS .pclx URL。
  • sha256 必须是 64 位十六进制 SHA-256。
  • GitHub 仓库 Manifest 的 releaseNotes 必须指向同仓库、同版本或 v 前缀版本的 Release Tag。
  • GitHub 包 URL 必须指向同一 Release Tag。

平台选择

顶层系统键:

windows
linux
macos

每个系统组内可用 amd64arm64anycpu。选择顺序:

  • 客户端先选当前系统组,再按 CPU 精确选择 amd64arm64,缺失时使用该组的 anycpu
  • 当前系统组存在但没有匹配 CPU 时,不会跨系统或回退旧键。
  • 当前系统组完全缺失时,才按相同 CPU 规则读取旧版顶层 amd64arm64anycpu
  • 没有匹配平台且没有 anycpu 时显示平台不兼容。
  • ARM64 不会安装 amd64 包,反之亦然。

旧版顶层 CPU 键继续有效,适合真正不区分操作系统的托管插件。新插件包含平台 API 或原生库时应使用系统分组。完整规范见跨平台插件

分组、Tag 与 Logo

  • group 用于商店分组。
  • tags 用于筛选;来源 JSON 的 Tag 会与插件自己的 Tag 合并、去重。
  • Manifest 相对 Logo 根据 Manifest 地址解析。
  • GitHub Topic 插件没有 Logo 时使用仓库 Owner 头像。

Topic 插件还会显示 manifest.json 最后提交时间和所有 GitHub Release 资产的累计下载次数。下载次数只用于展示,不参与默认排序。

仓库状态和排序

GitHub 返回的 Archived、Disabled 和 Fork 状态会保留。用户可以分别选择是否显示这些仓库,服务层不会永久硬编码过滤。

商店支持按客户端提供的顺序选项排序。来源、状态、兼容性、开发者信任、分组和 Tag 都作为条目元数据参与显示或筛选。

用户添加来源

支持两种来源类型:

  • Jsonplugin-market.json 或本地 JSON 文件。
  • Manifest:直接指向单个插件的 manifest.json

可以从插件源管理界面添加,也可以使用 URI Scheme。官方 Topic 与 NexDeveloper 来源已经内置,无需重复添加。

从 Manifest 安装后,地址会保存到 PluginManifestSubscriptions;从 Git 安装则保存仓库地址。更新检查因此会继续使用原始来源,而不是猜测新的下载地址。

Clone this wiki locally