refactor(manifest): remove discovery categories

This commit is contained in:
Yichen Jiang
2026-09-10 13:38:36 +08:00
parent 081e054c54
commit ce7ceb6071
7 changed files with 8 additions and 14 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-09-10-public-package-manifest.md
2026-09-10-public-package-manifest.md: 222cdb58af580678136f269b60aa8271024dc8ca
2026-09-10-public-package-manifest.zh.md: c3659586f340dfb5bcfbbd0cc8266772207e63de
2026-09-10-public-package-manifest.md: 0e6c1650a6b04e98aeba1aa6ef45df78e3f2cb44
2026-09-10-public-package-manifest.zh.md: 9b7d15f479ca1aab7bea655b2dee43625728a442
@@ -12,7 +12,7 @@ Plugin authors need npm identity, runtime requirements, and DSH declarations fro
[`DshPackageManifest`](../../../../packages/util/package-manifest/src/types.ts) describes the package.json fields DSH uses, with required `name` and `version`. Its optional `dsh` member uses `DshManifest` for public composition and author metadata. The type is a selected npm field set, not a complete package.json schema. App-boot adapts it with `Partial` for local profiles, which need no published identity.
Runtime requirements live at top-level `engines`: `dsh`, `node`, and `npm` are optional version strings, and other engine names are allowed. `dsh.manifestVersion` identifies declaration format `1`; `dsh.categories` carries free-form discovery tags without restricting package composition. Format and DSH compatibility declarations are not enforced by current installers or loaders.
Runtime requirements live at top-level `engines`: `dsh`, `node`, and `npm` are optional version strings, and other engine names are allowed. `dsh.manifestVersion` identifies declaration format `1`. Format and DSH compatibility declarations are not enforced by current installers or loaders.
The image packer owns `configTrees`, the workspace catalog generator owns Session migration declarations, and app-boot owns generated module-fallback metadata. Their existing on-disk keys remain readable by those internal tools, but the public manifest types do not expose them. This scope refines the [shared declaration ownership decision](2026-09-05-package-manifest-types.md), whose package placement and dependency rules remain active.
@@ -12,7 +12,7 @@ Status: implemented
[`DshPackageManifest`](../../../../packages/util/package-manifest/src/types.ts) 描述 DSH 使用的 package.json 字段,其中 `name``version` 必填。其可选的 `dsh` 成员使用 `DshManifest` 描述公共组合与作者元数据。该类型只选取所需 npm 字段,不是完整的 package.json schema(模式)。App-boot 通过 `Partial` 适配无需发布身份的本地 profile。
运行时要求位于顶层 `engines``dsh``node``npm` 均为可选版本字符串,也允许其他 engine 名称。`dsh.manifestVersion` 标识声明格式 `1``dsh.categories` 承载自由发现标签,不限制包的组合。当前安装器和加载器不强制检查格式与 DSH 兼容性声明。
运行时要求位于顶层 `engines``dsh``node``npm` 均为可选版本字符串,也允许其他 engine 名称。`dsh.manifestVersion` 标识声明格式 `1`。当前安装器和加载器不强制检查格式与 DSH 兼容性声明。
镜像打包器拥有 `configTrees`,工作区目录生成器拥有 Session 迁移声明,app-boot 拥有生成的模块后备元数据。这些内部工具仍可读取既有磁盘字段,但公共 manifest 类型不暴露这些字段。此范围细化了[共享声明归属决策](2026-09-05-package-manifest-types.zh.md),后者的包位置与依赖规则仍然有效。
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/util/package-manifest/README.md
README.md: e68426f667532267f947f94215d363862e6ea17d
README.zh.md: bad2f65e0b01ff5b1517b9195fafb01e30b50872
README.md: 36e25a7bee7ce6cc31133e0c815c0dc607c58de7
README.zh.md: d46ae346c2a654a0bfbfb4e7e7b2ba317f85a762
+1 -3
View File
@@ -37,7 +37,6 @@ const manifest: DshPackageManifest = {
engines: { node: '>=24', dsh: '0.1.5-alpha.1' },
dsh: {
manifestVersion: 1,
categories: ['skills', 'tools'],
bundle: { patch: './cordis.patch.yml' },
client,
},
@@ -46,12 +45,11 @@ const manifest: DshPackageManifest = {
`DshPackageManifest` describes the package.json fields used by DSH, with required `name` and `version`; it is not an exhaustive npm schema. Local profile readers use `Partial<DshPackageManifest>` because profiles need no published version. `DshManifest` describes only public author fields under `dsh`. TypeScript checks the example and erases `import type`; these interfaces do not parse JSON or write a file.
The following metadata fields are optional. Omitting them leaves the format version, tags, or compatible host versions undeclared; readers do not infer defaults.
The following metadata fields are optional. Omitting them leaves the format version or compatible host versions undeclared; readers do not infer defaults.
| Field | Meaning |
|---|---|
| `dsh.manifestVersion` | Manifest format identifier; the declared format is `1`, independent of the npm package version and Session format version. |
| `dsh.categories` | Free-form discovery tags such as `skills` and `tools`, with no fixed taxonomy or effect on plugin loading. |
| `engines.dsh` | Author-declared compatible DSH versions as a SemVer range, including exact prerelease versions. This field sits beside `engines.node` and `engines.npm`; an engines object may omit `dsh`. |
Public composition declarations are defined in [`src/types.ts`](src/types.ts). Internal `configTrees`, `sessionFormatMigration`, and generated `moduleFallback` metadata remain owned by their image-packer, catalog, and launcher readers; the public types do not expose them.
+1 -3
View File
@@ -37,7 +37,6 @@ const manifest: DshPackageManifest = {
engines: { node: '>=24', dsh: '0.1.5-alpha.1' },
dsh: {
manifestVersion: 1,
categories: ['skills', 'tools'],
bundle: { patch: './cordis.patch.yml' },
client,
},
@@ -46,12 +45,11 @@ const manifest: DshPackageManifest = {
`DshPackageManifest` 描述 DSH 使用的 package.json 字段,其中 `name``version` 必填;它不是完整的 npm schema(模式)。本地 profile 读取方使用 `Partial<DshPackageManifest>`,因为 profile 无需发布版本。`DshManifest` 仅描述 `dsh` 下的公共作者字段。TypeScript 检查示例并删除 `import type`;这些接口不解析 JSON,也不写入文件。
以下元数据字段均可选。省略时,格式版本、标签或兼容的宿主版本保持未声明状态;读取方不推断默认值。
以下元数据字段均可选。省略时,格式版本或兼容的宿主版本保持未声明状态;读取方不推断默认值。
| 字段 | 含义 |
|---|---|
| `dsh.manifestVersion` | manifest(元数据清单)格式标识;声明的格式为 `1`,独立于 npm 包版本和 Session 格式版本。 |
| `dsh.categories` | `skills``tools` 等自由发现标签,无固定分类体系,不影响插件加载。 |
| `engines.dsh` | 作者声明的兼容 DSH 版本,使用 SemVer 范围,也可填写精确的预发布版本。此字段与 `engines.node``engines.npm` 并列;engines 对象可省略 `dsh`。 |
公共组合声明定义在 [`src/types.ts`](src/types.ts) 中。内部 `configTrees``sessionFormatMigration` 和生成的 `moduleFallback` 元数据分别由镜像打包器、目录生成器和启动器读取方拥有;公共类型不暴露这些字段。
@@ -28,8 +28,6 @@ export interface DshPackageManifest {
export interface DshManifest {
/** Manifest format version, independent of the npm package and Session format versions. */
manifestVersion?: 1
/** Free-form discovery tags, such as `skills` or `tools`; do not affect plugin loading. */
categories?: string[]
/** Bundle metadata consumed by the profile launcher. */
bundle?: DshBundleManifest
/** Profile metadata consumed by the profile launcher. */