---
title: "index.json 规范"
url: "https://preview-docs.dshuniverse.com/zh/developers/index-json/"
lang: "zh-CN"
updated: "2026-11-21"
license: "CC-BY-4.0"
licenseScope: "DSH Universe plugin data"
---

# index.json 规范

DSH Universe 提供两个遵循 dsh index format 1 的文件：`https://dshuniverse.com/index.json`（严选插件，可按站点配置纳入已扫描插件）和 `https://dshuniverse.com/index.all.json`（除下架外的全部插件）。dsh 可以直接把它们作为 Index source，其他程序也可以免费读取。

## 地址

| 地址                                                         | 内容                 |
| ---------------------------------------------------------- | ------------------ |
| `https://dshuniverse.com/index.json`                       | 严选插件，可按站点配置纳入已扫描插件 |
| `https://dshuniverse.com/index.all.json`                   | 除「下架」外的全部插件        |
| `https://api.dshuniverse.com/index.json`、`/index.all.json` | 同上，内容相同            |

## 结构

文件的顶层结构与插件条目的标准字段完全遵循 dsh index format 1，dsh 不需要任何适配即可读取。

插件包名在索引中唯一，每个插件至少有一条版本记录。`publishTimestamp` 是 Unix 秒级时间戳。完整格式见 [DSH 官方索引规范](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/guide/plugin-market.md#index-format-reference)。

| 字段路径                                       | 类型或取值           | 在所属对象中必填 |
| ------------------------------------------ | --------------- | -------- |
| `format`                                   | `1`             | 是        |
| `title`                                    | `string`        | 是        |
| `generatedAt`                              | `date-time`     | 是        |
| `plugins`                                  | `array<object>` | 是        |
| `plugins[].name`                           | `string`        | 是        |
| `plugins[].title`                          | `string`        | 否        |
| `plugins[].description`                    | `string`        | 否        |
| `plugins[].versions`                       | `array<object>` | 是        |
| `plugins[].versions[].version`             | `string`        | 是        |
| `plugins[].versions[].publishTimestamp`    | `integer`       | 是        |
| `plugins[].versions[].engines`             | `object`        | 否        |
| `plugins[].versions[].engines.dsh`         | `string`        | 是        |
| `plugins[].versions[].source`              | `object`        | 是        |
| `plugins[].versions[].source (npm).type`   | `"npm"`         | 是        |
| `plugins[].versions[].source (git).type`   | `"git"`         | 是        |
| `plugins[].versions[].source (git).url`    | `uri`           | 是        |
| `plugins[].versions[].source (git).commit` | `string`        | 是        |
| `plugins[].versions[].source (git).path`   | `string`        | 否        |

DSH Universe 对每个插件条目的取值约定：

| 约定   | 说明                                            |
| ---- | --------------------------------------------- |
| 版本   | 给出 DSH Universe 检查过的版本，不是 npm 上的最新版本          |
| 安装来源 | npm 来源写明 npm 类型与确定的版本号；GitHub 来源写明 commit SHA |
| 排序   | 按等级（严选在前），同等级按最近发布时间                          |

## 扩展字段

DSH Universe 额外提供的信息放在每个条目的 `x-dshu` 对象中。dsh 会忽略不认识的字段，所以扩展字段不影响兼容性。

| 字段路径                            | 类型或取值                                                                                                    | 在所属对象中必填 |
| ------------------------------- | -------------------------------------------------------------------------------------------------------- | -------- |
| `plugins[].x-dshu`              | `object`                                                                                                 | 是        |
| `plugins[].x-dshu.id`           | `string`                                                                                                 | 是        |
| `plugins[].x-dshu.tier`         | `"listed" \| "scanned" \| "curated" \| "flagged"`                                                        | 是        |
| `plugins[].x-dshu.tierVersion`  | `string`                                                                                                 | 是        |
| `plugins[].x-dshu.scannedAt`    | `date-time \| null`                                                                                      | 是        |
| `plugins[].x-dshu.url`          | `uri`                                                                                                    | 是        |
| `plugins[].x-dshu.categories`   | `array<string>`                                                                                          | 是        |
| `plugins[].x-dshu.capabilities` | `array<"network" \| "process" \| "env" \| "secret-paths" \| "install-script" \| "dynamic-code"> \| null` | 是        |

`id` 是插件 ID，`url` 是详情页地址，`tierVersion` 指向等级绑定的版本，`scannedAt` 是扫描完成时间。分类 slug 见[插件分类](/zh/developers/#%E6%8F%92%E4%BB%B6%E5%88%86%E7%B1%BB)。能力由扫描结果推导。`[]` 表示扫描未发现能力，`null` 表示能力未知。离线筛选时，若要排除网络访问，应选择 `capabilities` 不为 `null` 且其中不含 `network` 的记录。

## 缓存

| 响应头                             | 值                                        |
| ------------------------------- | ---------------------------------------- |
| `Cache-Control`                 | `public, max-age=30, must-revalidate`    |
| `ETag`                          | 文件内容哈希；客户端带 `If-None-Match` 时未变化返回 `304` |
| `Access-Control-Allow-Origin`   | `*`                                      |
| `Access-Control-Expose-Headers` | 包含 `ETag` 和 `Link`，供浏览器 JavaScript 读取    |
| `Link`                          | CC BY 4.0 地址，带 `rel="license"`           |

API 域名与主站索引地址均支持携带 `If-None-Match` 的 `GET`、`HEAD` 请求的 `OPTIONS` 预检。跨域读取不携带凭据；`200` 和 `304` 均暴露校验标记与许可头。

等级变化后，文件在几分钟内重建。请不要以高于每 5 分钟一次的频率轮询。

## 兼容承诺

* 在 format 1 范围内只做**新增**，不删除、不改名已有字段。
* dsh 发布新的 format 版本时，新格式使用新地址，旧地址至少保留 6 个月。
* 破坏性变更会提前在 [API 总览](/zh/api/)中公告。
