mirror of
https://git.openapi.site/https://github.com/desirecore/registry.git
synced 2026-12-06 02:59:03 +08:00
merge: 同步 main 并改用已合入的作者契约
main 已在 #16 合入受主仓固定的 4.3 作者 Schema(95afcff…)和校验逻辑,因此保留其字节,不再引入本分支的候选 Schema(29ece0b…)。 - 删除 application-release-contract.mjs:它要求所有条目声明 definitionPath,会拒绝已上架的 definitionSource: manifest 条目;其余检查 main 已覆盖,仅把 definitionPath 规范路径检查移入 application-contract.mjs。 - 保留 webBundles 统计,并在 authored-release 测试样本中声明,与客户端 checkout 校验一致。 - 测试不再写死条目数,并增加 CLI 校验入口与作者 Schema 摘要断言。 - README 合并到现有作者契约章节,移除已过时的候选说明。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
80e0ff0355
38 files changed
+2240
-82
No files matched your search
@@ -0,0 +1,39 @@
|
|||||||
|
name: MCP Upstream Updates
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '17 2 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
concurrency:
|
||||||
|
group: mcp-upstream-updates
|
||||||
|
cancel-in-progress: false
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
if: github.repository == 'desirecore/registry'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
- run: npm ci
|
||||||
|
- name: 核验更新边界
|
||||||
|
run: |
|
||||||
|
python3 scripts/upstream/test_mcp_updates.py
|
||||||
|
python3 scripts/upstream/test_propose_mcp_updates.py
|
||||||
|
node --test scripts/catalog/automated-mcp-review.test.mjs
|
||||||
|
- name: 检查并提交 MCP 新版候选
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: python3 scripts/upstream/propose_mcp_updates.py --publish --limit 5 --report mcp-upstream-report.json
|
||||||
|
- name: 展示全部 MCP 条目的更新状态与阻碍
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f mcp-upstream-report.md ]; then cat mcp-upstream-report.md >> "$GITHUB_STEP_SUMMARY"; else echo 'MCP 来源检查未完成。' >> "$GITHUB_STEP_SUMMARY"; fi
|
||||||
@@ -23,6 +23,10 @@ jobs:
|
|||||||
cache: npm
|
cache: npm
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
- name: Validate MCP update boundaries
|
||||||
|
run: |
|
||||||
|
python3 scripts/upstream/test_mcp_updates.py
|
||||||
|
python3 scripts/upstream/test_propose_mcp_updates.py
|
||||||
- name: Validate Registry v4
|
- name: Validate Registry v4
|
||||||
run: npm test
|
run: npm test
|
||||||
- name: Run validator tests
|
- name: Run validator tests
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ DesireCore 客户端启动时会克隆此仓库,并定期同步更新。用户
|
|||||||
```text
|
```text
|
||||||
.
|
.
|
||||||
├── README.md # 本文件
|
├── README.md # 本文件
|
||||||
├── SCHEMA_VERSION # 正式数据格式仍为4.2.0;4.3候选另存独立Schema文件
|
├── SCHEMA_VERSION # 数据格式版本号(当前 4.2.0)
|
||||||
├── manifest.json # 仓库元数据(版本、统计、维护者)
|
├── manifest.json # 仓库元数据(版本、统计、维护者)
|
||||||
├── package.json # Registry 校验入口
|
├── package.json # Registry 校验入口
|
||||||
├── schemas/ # legacy entry、仓库 manifest 与 catalog sidecar Schema
|
├── schemas/ # legacy entry、仓库 manifest 与 catalog sidecar Schema
|
||||||
├── scripts/ # Registry v4 校验入口与回归测试
|
├── scripts/ # Registry v4 校验入口与回归测试
|
||||||
├── scripts/catalog/ # 零依赖离线 validator 与 node:test
|
├── scripts/catalog/ # 零依赖离线 validator 与 node:test
|
||||||
|
├── fixtures/authoring/ # 合成的作者契约样本(listing-only,不进入正式目录)
|
||||||
├── entries/ # 🔑 所有注册表条目(统一格式)
|
├── entries/ # 🔑 所有注册表条目(统一格式)
|
||||||
│ ├── n8n/ # 示例:Docker 应用
|
│ ├── n8n/ # 示例:Docker 应用
|
||||||
│ │ ├── manifest.json # 条目元数据(必需)
|
│ │ ├── manifest.json # 条目元数据(必需)
|
||||||
@@ -42,11 +43,19 @@ DesireCore 客户端启动时会克隆此仓库,并定期同步更新。用户
|
|||||||
|
|
||||||
[DesireCore Control 1.4.0](entries/desirecore-control/) 是面向外部智能体的独立宿主机应用,包含 ChatGPT 隧道管理。它以 `type: native-app`、`install.method: native-node`、`identity.kind: app` 收录;MCP 只是对外协议,不注册到 DesireCore 内部工具列表,不伪装为 Docker。
|
[DesireCore Control 1.4.0](entries/desirecore-control/) 是面向外部智能体的独立宿主机应用,包含 ChatGPT 隧道管理。它以 `type: native-app`、`install.method: native-node`、`identity.kind: app` 收录;MCP 只是对外协议,不注册到 DesireCore 内部工具列表,不伪装为 Docker。
|
||||||
|
|
||||||
原生应用必须声明宿主机 Node 版本、`docker: false`、精确管理端口、最低客户端版本、不可变 Release URL/ref/SHA-256 和审核记录。安装说明同时覆盖安装、升级、验证及卸载,不随 DesireCore 启停,不默认启用控制或隧道。条目禁止 `connection`、`exposes`、`endpoint`、工具数等内部服务配置;`allowAgentBinding` 为 false。兼容来源字段只写在 manifest.source 与 sidecar.provenance.content,二者必须一致;sidecar 不写运行时 governance.source。
|
原生应用必须声明宿主机 Node 版本、`docker: false`、明确的管理端口安装约定、最低客户端版本、不可变制品或固定 Git 源和审核记录。安装说明同时覆盖安装、升级、验证及卸载,生命周期由其实际 owner 管理,不默认启用控制或隧道。条目禁止 `connection`、`exposes`、`endpoint`、工具数等内部服务配置;Control 的 `allowAgentBinding` 为 false,视频应用按自身 placementPolicy 声明可关联范围。兼容来源字段只写在 manifest.source 与 sidecar.provenance.content,二者必须一致;sidecar 不写运行时 governance.source。
|
||||||
|
|
||||||
安装要求支持 native-app 的客户端(Control 条目最低 10.0.170)及核心应用安装技能 >=1.5.0。目录同步不能升级桌面客户端或技能;旧版看不到条目或提示升级时,不得修改类型绕过兼容检查。新制品已发布不代表新版桌面客户端已发布,也不代表用户已完成 ChatGPT 联调。
|
安装要求支持 native-app 的客户端(Control 条目最低 10.0.170)及核心应用安装技能 >=1.5.0。目录同步不能升级桌面客户端或技能;旧版看不到条目或提示升级时,不得修改类型绕过兼容检查。新制品已发布不代表新版桌面客户端已发布,也不代表用户已完成 ChatGPT 联调。
|
||||||
|
|
||||||
English: Native applications are independently installed host processes. Their outward MCP protocol does not make them internal service packages. Pinned artifacts, explicit client/skill compatibility and App lifecycle receipts are required; catalog publication alone cannot upgrade an older client. The Control listing is the sole application entry, not a Docker or MCP duplicate.
|
English: Native applications are independently installed host processes. Their outward MCP protocol does not make them internal service packages. Pinned artifacts or fixed Git source, explicit client/skill compatibility and App lifecycle receipts are required; catalog publication alone cannot upgrade an older client. Control remains a single application entry without a Docker or MCP duplicate; each application's placement policy controls whether users may associate an agent.
|
||||||
|
|
||||||
|
[视频创作 0.3.0](entries/video-creation/)以完整Git提交固定源码,通过现有app-authoring-v1安装与运行合同提供编辑器、原创场景和带版本时点的审片。需支持该合同的客户端(已验证下限10.0.186)和独立运行依赖;目录约定的管理端口可调整,实际端口/健康/权限仍以安装回执为准。视频导演在Agent市场单独获取,目录发布不更新生产安装。
|
||||||
|
|
||||||
|
English: Video Creation is a source-pinned native application using the existing authoring/runtime contract. Its tested client floor and separate dependencies are declared; catalog ports do not establish live readiness or permission. The companion Director is acquired separately from the Agent market.
|
||||||
|
|
||||||
|
[视频剪辑 0.1.0](entries/video-editing/)复用 FableCut 时间线、合成器与 MCP 核心,使用独立产品和 Agent“视频剪辑师”。固定源码与第三方许可、显式原生依赖准备、正式受管安装和同实例 MCP 连接见条目材料。客户端下限选择已测平台版本 10.0.195,安装仍检查真实 capabilities;当前目录平台范围限定 Windows 与 Ubuntu/WSLg,macOS 待验。目录 PR 与产品 PR 的剩余验收/合并门禁未完成前不代表正式上架,从市场安装与关联仍需实际验证。
|
||||||
|
|
||||||
|
English: Video Editing reuses the FableCut core with an independent Video Editor agent. The listing pins source, separates dependency licenses and requires explicit runtime preparation plus normal managed installation. The tested 10.0.195 client floor does not replace capability checks. Scope currently covers Windows and Ubuntu/WSLg; macOS and final product/catalog publication gates remain pending.
|
||||||
|
|
||||||
## 应用与插件(4.2)
|
## 应用与插件(4.2)
|
||||||
|
|
||||||
@@ -62,29 +71,35 @@ English: Native applications are independently installed host processes. Their o
|
|||||||
|
|
||||||
依赖中的 `extension.requires[].sourceId` 是产品引用;条目自身的 `sourceId` 与 `hasInstall` 仍只由受信客户端注入。贡献材料必须使用规范 POSIX 包内相对路径并固定摘要;实际获取与消费仍由客户端核验字节与文件归属。
|
依赖中的 `extension.requires[].sourceId` 是产品引用;条目自身的 `sourceId` 与 `hasInstall` 仍只由受信客户端注入。贡献材料必须使用规范 POSIX 包内相对路径并固定摘要;实际获取与消费仍由客户端核验字节与文件归属。
|
||||||
|
|
||||||
4.2 对现有 9 个应用在 sidecar 中声明 `application` 身份,legacy manifest 省略旧客户端不认识的 `productKind`,并提供读取安装/使用材料后委派 Agent 的真实维护入口。现有目录没有可引用的用户 UI 服务 ID,不猜测 API endpoint 或任意本机端口为 Web 页面;`legacy-port:`/`native-port:` 仅供客户端兼容适配层生成,发布者不能自行声明。原有版本、来源、许可证、审核及 `listing-only` 事实保留,未完成治理证据的条目不会因为格式迁移变为可安装。当前官方条目数仍为 23,没有新增或默认启用插件。
|
4.2 对现有 9 个应用在 sidecar 中声明 `application` 身份,legacy manifest 省略旧客户端不认识的 `productKind`,并提供读取安装/使用材料后委派 Agent 的真实维护入口。现有目录没有可引用的用户 UI 服务 ID,不猜测 API endpoint 或任意本机端口为 Web 页面;`legacy-port:`/`native-port:` 仅供客户端兼容适配层生成,发布者不能自行声明。原有版本、来源、许可证、审核及 `listing-only` 事实保留,未完成治理证据的条目不会因为格式迁移变为可安装。该次格式迁移没有新增条目或默认启用插件;当前条目数以 manifest.json 的实际统计为准。
|
||||||
|
|
||||||
Catalog sidecar 的 App spec 同步 `productKind`、可选 `extension` 和入口类型摘要;与 manifest 的受信归一结果必须一致。4.2 Schema 的固定 LF SHA-256 为 `ea63d6305ae17994e595aea009a131c41300d2b7fdb07ec83cc2c19c37b32038`。旧普通应用 manifest 保留已发布 10.0.177 可读取的字段;这不表示旧客户端支持 4.2 插件、artifact 或受新 authored 契约校验的外部集成。新能力上线前须确保目标客户端固定了此摘要并支持 4.2,目录发布不会升级客户端。
|
Catalog sidecar 的 App spec 同步 `productKind`、可选 `extension` 和入口类型摘要;与 manifest 的受信归一结果必须一致。4.2 Schema 的固定 LF SHA-256 为 `ea63d6305ae17994e595aea009a131c41300d2b7fdb07ec83cc2c19c37b32038`。旧普通应用 manifest 保留已发布 10.0.177 可读取的字段;这不表示旧客户端支持 4.2 插件、artifact 或受新 authored 契约校验的外部集成。新能力上线前须确保目标客户端固定了此摘要并支持 4.2,目录发布不会升级客户端。
|
||||||
|
|
||||||
English: Plugins are App products with host contributions, sharing the canonical catalog and installation identity. Deployment type does not decide product kind. Applications may provide contributions or consume direct dependencies; a plugin must provide a real contribution. Artifact packages contain declarative materials without ports or processes. Dependency product references do not grant installation, activation or permission. Existing listings retain their source and compliance evidence; schema migration does not make listing-only content installable or publish a client release.
|
English: Plugins are App products with host contributions, sharing the canonical catalog and installation identity. Deployment type does not decide product kind. Applications may provide contributions or consume direct dependencies; a plugin must provide a real contribution. Artifact packages contain declarative materials without ports or processes. Dependency product references do not grant installation, activation or permission. Existing listings retain their source and compliance evidence; schema migration does not make listing-only content installable or publish a client release.
|
||||||
|
|
||||||
## 固定工作台应用(4.3兼容候选)
|
## 固定应用材料的作者契约
|
||||||
|
|
||||||
本PR只新增 `schemas/registry-entry.v4.3.schema.json` 和合成fixtures/validator,正式 `SCHEMA_VERSION`、manifest数据版本与 `schemas/registry-entry.schema.json` 原4.2字节保持。正式Schema SHA-256仍为 `ea63d6305ae17994e595aea009a131c41300d2b7fdb07ec83cc2c19c37b32038`;4.3候选为 `29ece0b6ae92d2b31d18bbb288b5ed33220dde125924082e1e38c20ace900200`。旧已发行客户端不会因为此Schema先行PR丢失原外部listing或其他类目。
|
仓库根 `SCHEMA_VERSION` 与 `schemas/registry-entry.schema.json` 继续保留已发布的 4.2 格式及其原始摘要。`type: web-bundle` 或显式声明 `appRelease` 的条目,由两个校验入口统一选择独立的 `schemas/registry-entry.v4.3.schema.json`;普通应用、服务和外部集成继续使用原有 Schema。作者 Schema 不升级客户端,也不允许条目自报官方来源或信任。
|
||||||
|
|
||||||
发布顺序:先review候选Schema/fixtures → 主仓固定候选摘要并交付兼容reader(官方候选只允许原类目,可信非官方测试源可验新类型)→ 客户端能力实际发行并验收 → 核心Agent/Market知识经各自PR合入再同步真实main bootstrap → 单独PR将正式Schema激活4.3并开放新entries。每一步取实际提交/发行/目录回执,不把未合入commit固定成官方seed;知识正式启用及seed交付须等待兼容客户端实际发行验收。若有4.3checkout先到新reader,只有版本/字节摘要完全匹配才读原类目;未知或被篡改Schema继续关闭,新作者条目仍等待正式准入。
|
`appRelease` 固定材料的 `releaseDigest`、`app-release.json` 与必要 capabilities。作者定义来自清单内联 `definition` 时声明 `definitionSource: manifest`;旧包内独立定义文件继续声明 `definitionPath`。两种来源互斥,不可为内联定义编造一个文件路径。获取后,客户端仍须核验归档字节、清单与文件,并比较真实产品 UUID、入口和放置策略。
|
||||||
|
|
||||||
4.3保留全部4.2旧分支,新增 `web-bundle` 与带 `appRelease` 的 `native-app`/`docker-app` 严格分支。网页包不冒充无执行声明artifact;宿主/容器服务应用使用 `install.method: release`,运行知识与依赖在固定清单中,不限定Node技术栈,也不自动执行说明文字。Docker显式声明固定imageRefs,每项是repository@sha256,复用原容器/执行/服务owner;没有真实身份adapter时保留Agent管理,不因为Schema合法声称直开。新分支声明来源无关releaseDigest、包内manifestPath/definitionPath与实际能力要求,source.sha256仍为下载归档原始字节摘要;descriptor在安装时按来源物化并单独核验。
|
作者材料来源只允许不可变 HTTPS `git` 或 `release`,必须分别提供固定提交 `source.ref` 和实际归档响应体的 `source.sha256`;归档摘要不能用 `releaseDigest` 代替。Git 归档还需声明实际包内的规范相对目录 `source.path`。`native-app` 和 Docker 作者条目使用 `install.method: release`,Web bundle 使用 `web-bundle`;能力握手、MCP 授权与运行归属仍以真实安装流程为准。
|
||||||
|
|
||||||
正式目录未新增工作台条目。`fixtures/authoring/`只有合成的listing-only契约样本,example.test地址不是可获取的应用发行物,不表示上传、审核、运行或第二用户安装已完成。主仓内置seed保持旧受审提交;此候选先经外仓与客户端reader分别review,只有客户端真实app-authoring-v1/web-bundle等能力发行后才能开放新entries。最低版本字符串不能代替握手,旧客户端继续读取旧条目并忽略未知类型,不允许改交付类型绕过。
|
English: The published root format and global 4.2 Schema remain unchanged. Both validators select the separate reviewed authoring Schema only for `web-bundle` or an explicit `appRelease`; ordinary listings retain their existing Schema. Inline definitions use `definitionSource: manifest`, while legacy payload definitions use `definitionPath`, exclusively. Fixed source commits, the downloaded archive SHA-256 and the canonical release digest are separate identities. Validation does not establish client support, source trust, installation, authorization or runtime ownership.
|
||||||
|
|
||||||
作者从同一固定导出生成manifest.json、catalog-metadata.v1.json、install.md三文件,产品ID/版本/入口保持一致。证据不足保持listing-only;installable需真实来源、许可和审核记录。用户实例/数据/平台secret/开发机路径不写目录。目录PR、来源上传、准入和安装各自核验;同版本异内容创建新修订,目录更新不热替换已安装快照,撤回不自动卸载或删除数据。
|
作者 Schema 保留全部 4.2 旧分支,新增 `web-bundle` 与带 `appRelease` 的 `native-app`/`docker-app` 严格分支;其字节由主仓生成并固定,SHA-256 为 `95afcffce0c985215685554ec8b3f5e3012036bf2c4ecc4214c23e4eff895b10`,修改须先更新主仓并经 review。网页包不冒充无执行声明 artifact;宿主/容器服务应用的运行知识与依赖在固定清单中,不限定 Node 技术栈,也不自动执行说明文字。Docker 显式声明固定 `imageRefs`,每项是 `repository@sha256`,复用原容器/执行/服务 owner;没有真实身份 adapter 时保留 Agent 管理,不因为 Schema 合法声称直开。descriptor 在安装时按来源物化并单独核验。最低版本字符串不能代替握手,旧客户端继续读取旧条目并忽略未知类型,不允许改交付类型绕过。
|
||||||
|
|
||||||
GitHub/Gitea私有来源依真实ACL和连接;客户端private来源不走公开镜像回退,认证失败拒绝新获取。团队移除不自动改来源ACL,需实际源管理员处理;已下载字节不能收回。离线已安装应用按保存事实维护,不把目录缓存当新安装的完整运行环境。
|
根 `SCHEMA_VERSION` 与 global Schema 升级到 4.3 须另提 PR,并等待兼容客户端实际发行验收;知识正式启用及 seed 交付同样须等待该验收。每一步取实际提交/发行/目录回执,不把未合入 commit 固定成官方 seed。
|
||||||
|
|
||||||
English: Version 4.3 is a compatibility candidate, preserving legacy branches and adding fixed web-bundle and authored native release contracts. Synthetic listing-only fixtures are not published artifacts. Official entries wait for reviewed Schema/client support and actual capability release. Archive bytes, portable release identity and source-materialized descriptor identity are distinct. Private-source access depends on actual Git ACL; team membership does not automatically revoke source access, and catalog withdrawal does not delete installed data.
|
`fixtures/authoring/` 只有合成的 listing-only 契约样本,不进入 `entries/` 或目录统计;example.test 地址不是可获取的应用发行物,不表示上传、审核、运行或第二用户安装已完成。
|
||||||
|
|
||||||
## 条目格式(兼容字段)
|
作者从同一固定导出生成 manifest.json、catalog-metadata.v1.json、install.md 三文件,产品 ID/版本/入口保持一致。证据不足保持 listing-only;installable 需真实来源、许可和审核记录。用户实例/数据/平台 secret/开发机路径不写目录。目录 PR、来源上传、准入和安装各自核验;同版本异内容创建新修订,目录更新不热替换已安装快照,撤回不自动卸载或删除数据。
|
||||||
|
|
||||||
|
GitHub/Gitea 私有来源依真实 ACL 和连接;客户端 private 来源不走公开镜像回退,认证失败拒绝新获取。团队移除不自动改来源 ACL,需实际源管理员处理;已下载字节不能收回。离线已安装应用按保存事实维护,不把目录缓存当新安装的完整运行环境。
|
||||||
|
|
||||||
|
English: The authoring Schema preserves legacy branches and adds strict web-bundle and authored native/Docker release branches; its bytes are generated and pinned by the main repository. Upgrading the root format to 4.3 takes a separate PR after a compatible client release is accepted. Synthetic listing-only fixtures under `fixtures/authoring/` are not published artifacts and stay out of the catalog and its statistics. Private-source access depends on actual Git ACL; team membership does not automatically revoke source access, and catalog withdrawal does not delete installed data.
|
||||||
|
|
||||||
|
## 条目格式
|
||||||
|
|
||||||
每个条目是 `entries/<id>/` 下的一个目录,目录名即条目 ID。
|
每个条目是 `entries/<id>/` 下的一个目录,目录名即条目 ID。
|
||||||
|
|
||||||
@@ -476,3 +491,9 @@ external integration 需要额外安全、供应链、商标和隐私 review,
|
|||||||
|
|
||||||
- GitHub(主):https://github.com/desirecore/registry.git
|
- GitHub(主):https://github.com/desirecore/registry.git
|
||||||
- git.hxr.so(镜像):https://git.hxr.so/desirecore/registry.git
|
- git.hxr.so(镜像):https://git.hxr.so/desirecore/registry.git
|
||||||
|
|
||||||
|
## MCP 上游更新维护
|
||||||
|
|
||||||
|
每日检查 npm、PyPI 与已登记的 GitHub MCP 容器发行源,输出所有 MCP 条目的版本状态或阻碍;远程服务和关联应用分别标明维护归属。证据完整、许可与结构化前置条件不变时,自动填写机器核验记录并创建普通 PR;受阻只创建说明草稿,旧目录和准入不变。没有自动合并、上游执行或用户服务升级。客户端更新仍需用户操作,并由原安装回执与新审核目标共同约束。
|
||||||
|
|
||||||
|
规则、预算与验收入口见 [MCP 上游更新](scripts/upstream/README.md)。
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../schemas/catalog-metadata.v1.schema.json",
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"identity": {
|
||||||
|
"kind": "app",
|
||||||
|
"id": "0171a763-ad35-4b94-98b9-204782817b44"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"defaultLocale": "zh-CN",
|
||||||
|
"i18n": {
|
||||||
|
"zh-CN": {
|
||||||
|
"name": "视频剪辑",
|
||||||
|
"summary": "多轨视频剪辑、声音与原创动效;与独立视频剪辑师协作,保留人工编辑。",
|
||||||
|
"description": "多轨视频剪辑、声音与原创动效;与独立视频剪辑师协作,保留人工编辑。复用 FableCut 时间线、浏览器合成器与 MCP 核心,界面跟随 DesireCore 明暗主题。需要包含新应用目录读取能力的 DesireCore 10.0.197 或更新版本、Node.js >=22,及显式准备的固定浏览器和 FFmpeg/ffprobe。公开196标签源不含该reader;安装时须核对实际发行源码与能力,版本号本身不足以证明支持。限定功能已在 macOS 源码 GUI、Windows 未签 GUI 和 Ubuntu/WSLg 源码 GUI 实测;不扩展为正式签名安装器、官方 Linux 包、裸机 GPU 或模型自主规划质量。模型及可选媒体服务的许可、账号与费用另计,不默认调用付费生成。"
|
||||||
|
},
|
||||||
|
"en-US": {
|
||||||
|
"name": "Video Editing",
|
||||||
|
"summary": "Multitrack editing, sound and original motion with the independent Video Editor agent, preserving human edits.",
|
||||||
|
"description": "Multitrack editing, sound and editable original motion using the retained FableCut timeline, browser compositor and MCP core, with DesireCore light/dark appearance. Requires a client >=10.0.197 containing the new official UUID catalog and manifest-inline appRelease reader, Node.js >=22 and explicit preparation of pinned browser/FFmpeg dependencies. The public 196 tag source lacks the reader; check the actual release source and capabilities before installation, not only its version number. Bounded functionality was tested on macOS source GUI, unsigned Windows GUI and Ubuntu/WSLg source GUI. Production installers, official Linux packages, bare-metal GPU and autonomous model reasoning are not qualified. Model and optional media-service licenses, accounts and fees are separate; no paid generation service is selected by default."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"video",
|
||||||
|
"editing",
|
||||||
|
"timeline",
|
||||||
|
"motion"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"state": "known",
|
||||||
|
"version": "0.1.3",
|
||||||
|
"versionScheme": "semver"
|
||||||
|
},
|
||||||
|
"timestamps": {
|
||||||
|
"catalogUpdatedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-11-03",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"releasePublishedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-11-02",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"reviewedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-11-02",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"upstreamObservedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-11-02",
|
||||||
|
"precision": "day"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"provenance": {
|
||||||
|
"content": {
|
||||||
|
"kind": "release",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-editing/releases/download/v0.1.3/video-editing-0.1.3.zip",
|
||||||
|
"ref": "e1e5d12ce95854ca7cb02d277f955abb1536c5ac",
|
||||||
|
"sha256": "fa9128606390a17409ff4eba46c13988df17f55cb8bbd3f21c6066cb5f9940b4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"governance": {
|
||||||
|
"stewardship": "pointer",
|
||||||
|
"availability": "installable",
|
||||||
|
"redistribution": "source-pointer-only",
|
||||||
|
"listingMaintainer": {
|
||||||
|
"name": "DesireCore Registry maintainers",
|
||||||
|
"url": "https://github.com/desirecore/registry"
|
||||||
|
},
|
||||||
|
"upstreamMaintainer": {
|
||||||
|
"name": "desirecore-agent",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-editing"
|
||||||
|
},
|
||||||
|
"branding": {
|
||||||
|
"relationship": "independent-listing",
|
||||||
|
"nameUsage": "nominative",
|
||||||
|
"logoStatus": "not-used"
|
||||||
|
},
|
||||||
|
"compliance": {
|
||||||
|
"licenseEvidencePath": "LICENSE",
|
||||||
|
"noticePath": "NOTICE.md",
|
||||||
|
"reviewedRef": "e1e5d12ce95854ca7cb02d277f955abb1536c5ac",
|
||||||
|
"reviewedAt": "2026-11-02",
|
||||||
|
"reviewedBy": "fixed-source-and-bounded-runtime-review (see review.md)",
|
||||||
|
"upstreamEndorsed": false
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "MIT",
|
||||||
|
"evidencePath": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compatibility": {
|
||||||
|
"platforms": {
|
||||||
|
"state": "known",
|
||||||
|
"values": [
|
||||||
|
"windows",
|
||||||
|
"macos",
|
||||||
|
"linux"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"requiredClientVersion": "10.0.197"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"kind": "app",
|
||||||
|
"category": "tools",
|
||||||
|
"placementPolicy": {
|
||||||
|
"showInMyApps": true,
|
||||||
|
"allowNavPin": true,
|
||||||
|
"allowAgentBinding": true
|
||||||
|
},
|
||||||
|
"productKind": "application",
|
||||||
|
"entrypointKinds": [
|
||||||
|
"embedded-web"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# 视频剪辑:固定材料安装、关联与维护
|
||||||
|
|
||||||
|
本条目只发布固定应用材料与运行说明,不包含已安装事实、系统安装器、原生依赖二进制、用户数据、模型额度或预授权。产品UUID/目录ID均为 `0171a763-ad35-4b94-98b9-204782817b44`;源仓库与skill名video-editing不是安装ID。先读取同目录manifest.json/review.md、[固定源运行合同](https://github.com/desirecore-agent/video-editing/blob/e1e5d12ce95854ca7cb02d277f955abb1536c5ac/desirecore/RUNTIME.md)、LICENSE、NOTICE.md和desirecore/runtime-assets.json。
|
||||||
|
|
||||||
|
## 兼容客户端与官方获取
|
||||||
|
|
||||||
|
最低版本预定DesireCore10.0.197;公开196标签源缺少官方UUID目录/manifest内联appRelease读取能力,安装时须核对实际发行源码与能力,不能仅凭同号版本或capability字符串判断兼容。正常安装前检查真实app-authoring-v1的release/runtime-binding与App管理能力;缺失时报告,不改类型绕过。
|
||||||
|
|
||||||
|
沿默认官方应用市场获取本UUID条目。唯一材料为 [video-editing-0.1.3.zip](https://github.com/desirecore-agent/video-editing/releases/download/v0.1.3/video-editing-0.1.3.zip),响应体 **1372662B**,SHA256 `fa9128606390a17409ff4eba46c13988df17f55cb8bbd3f21c6066cb5f9940b4`;来源提交 `e1e5d12ce95854ca7cb02d277f955abb1536c5ac`。ZIP根含app-release.json与130个payload文件/3104880B;releaseDigest `205ca1f94ae71ce4b86984328ab9914d477fcc9428fd69c6dc5789f93de0e68b`。归档SHA、产品Git提交与规范releaseDigest是三种不同事实。客户端正常获取需核验实际响应字节、包根清单、逐文件大小与摘要及真实UUID/版本/入口/placement。definitionSource=manifest直接采用已核验内联definition,不编造definitionPath。不要使用可变main、上游npx/npm服务或源码内嵌草稿清单代替该归档。
|
||||||
|
|
||||||
|
应用获取不等于安装完成。委派正常AppManage/AppHost/TaskHost owner完成prepare、实际Bash接纳、运行合同与CAS commit;结果未知先查询原提交,不重复副作用。实际installationId、Actor、revision、generation、材料根和数据根只取平台响应。已有同产品安装沿expectedRevision更新,不因目录重命名另造安装。
|
||||||
|
|
||||||
|
## 显式依赖准备与启动
|
||||||
|
|
||||||
|
Node.js >=22使用平台正常受管PATH。在平台返回的固定材料根为cwd、独立正式dataRoot中显式执行 `node desirecore/setup-runtime.js --data-dir <本应用数据根>`。它按完整固定URL/版本/SHA核验浏览器、FFmpeg/ffprobe并生成新展开回执,不启动服务;这些二进制没有捆入ZIP。Node、字体、浏览器和FFmpeg各自许可独立。首次准备需网络/磁盘与系统库;Linux保持正常sandbox,Windows完整路径超过原合同限制时在下载前拒绝。不可自动sudo、关闭sandbox、改ACL、身份或依赖pin迎合环境。
|
||||||
|
|
||||||
|
正式启动使用 `node desirecore/start.js --data-dir <同一数据根>`,原owner注入真实PORT、APP_DATA_DIR和受管身份。7777只是源码fallback对应的可调默认约定,不是分配端口或验收端口;占用时选择可用值,不结束其他进程。经原owner就绪观测与当前release/revision/generation binding核验后打开embedded-web editor入口。仅端口监听或HTTP200不代表完整初始化。
|
||||||
|
|
||||||
|
## 视频剪辑师和同实例MCP
|
||||||
|
|
||||||
|
从默认官方数字员工市场单独获取[视频剪辑师](https://github.com/desirecore-agent/video-editor),按实际导入响应ID关联当前应用,旧视频创作/视频导演保持独立。关联只设置入口偏好,contextPermissions为空,不授予文件、工具、模型或MCP权限。
|
||||||
|
|
||||||
|
按正式MCP管理与授权配置同材料根的 `node desirecore/cli.mjs mcp --runtime-file <当前owner运行快照.json>`。快照沿源Schema含schemaVersion、dataDir、port、instanceId、scopeId、runtimeGeneration、releaseDigest,不包含proof、凭据或grant。只连接当前已安装同实例;CLI拒绝旧代际/不同数据根,不另起服务。status/identity同此合同。模型算力与可选媒体服务许可、账户及费用另计;无前置条件时停止并报告。
|
||||||
|
|
||||||
|
## 更新、备份与卸载
|
||||||
|
|
||||||
|
保留人工时间线与草稿,沿精确owner正常停止并等实际Root/编码器退出。用已授权文件工具备份dataRoot、外部媒体与摘要;video-editing-home-v1中的工程/素材/成片不是缓存。runtime依赖可按固定合同重建。新版本正常prepare/数据合同比较/expectedRevision CAS,不复用旧PID、锁、proof或hint。恢复在停止状态核对格式、相对路径与媒体再测试;不支持的格式保持原数据并失败,没有自动降级或后台续渲染承诺。卸载沿正式入口停止精确安装并默认保留用户数据;不能清材料时顺带删工程成片。
|
||||||
|
|
||||||
|
English: Acquire only the fixed published archive through the normal official UUID catalog. Verify its archive SHA separately from the manifest release digest and every listed file. Public 196 lacks the reader; verify the actual release source and capabilities. Normal owner admission, explicit pinned runtime preparation, current-instance MCP authorization and observed readiness remain necessary. Dependencies and model/media terms are separate. Preserve user data and human edits through updates, backup, restore and uninstall; uncertain submissions are queried before retrying.
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
{
|
||||||
|
"id": "0171a763-ad35-4b94-98b9-204782817b44",
|
||||||
|
"name": "视频剪辑",
|
||||||
|
"type": "native-app",
|
||||||
|
"version": "0.1.3",
|
||||||
|
"author": "desirecore-agent",
|
||||||
|
"description": "多轨视频剪辑、声音与原创动效;与独立视频剪辑师协作,保留人工编辑。",
|
||||||
|
"shortDesc": "多轨视频剪辑、声音与原创动效;与独立视频剪辑师协作,保留人工编辑。",
|
||||||
|
"fullDesc": "多轨视频剪辑、声音与原创动效;与独立视频剪辑师协作,保留人工编辑。复用 FableCut 时间线、浏览器合成器与 MCP 核心,界面跟随 DesireCore 明暗主题。需要包含新应用目录读取能力的 DesireCore 10.0.197 或更新版本、Node.js >=22,及显式准备的固定浏览器和 FFmpeg/ffprobe。公开196标签源不含该reader;安装时须核对实际发行源码与能力,版本号本身不足以证明支持。限定功能已在 macOS 源码 GUI、Windows 未签 GUI 和 Ubuntu/WSLg 源码 GUI 实测;不扩展为正式签名安装器、官方 Linux 包、裸机 GPU 或模型自主规划质量。模型及可选媒体服务的许可、账号与费用另计,不默认调用付费生成。",
|
||||||
|
"tags": [
|
||||||
|
"video",
|
||||||
|
"editing",
|
||||||
|
"timeline",
|
||||||
|
"motion"
|
||||||
|
],
|
||||||
|
"icon": "film",
|
||||||
|
"iconLetter": "剪",
|
||||||
|
"platformSupport": [
|
||||||
|
"windows",
|
||||||
|
"macos",
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"category": "tools",
|
||||||
|
"githubUrl": "https://github.com/desirecore-agent/video-editing",
|
||||||
|
"requiredClientVersion": "10.0.197",
|
||||||
|
"install": {
|
||||||
|
"method": "release",
|
||||||
|
"requirements": {
|
||||||
|
"docker": false,
|
||||||
|
"node": ">=22",
|
||||||
|
"minMemory": "未声明固定最低值;预览和渲染开销随工程与输出尺寸变化。",
|
||||||
|
"minDisk": "需容纳固定浏览器、FFmpeg/ffprobe、原媒体、输入快照和导出文件;按实际容量核对。",
|
||||||
|
"ports": [
|
||||||
|
7777
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configNeeded": [
|
||||||
|
"客户端 >=10.0.197,且实际包含官方 UUID 应用目录与 manifest 内联 appRelease reader;核对 app-authoring-v1 release/runtime-binding 与正常应用管理能力。公开196标签源不包含该reader。",
|
||||||
|
"从固定 Release 下载并核验 source.sha256,根 app-release.json 和130个文件逐项核验;由正常应用获取及 AppManage/AppHost/TaskHost 流程安装,不用可变main或npm命令替代。",
|
||||||
|
"显式执行固定材料中的 setup-runtime,准备Node >=22、浏览器、FFmpeg/ffprobe;这些二进制不包含在 ZIP,遵循各自许可,所需系统库和原sandbox前提不可跳过。",
|
||||||
|
"7777 是源码fallback对应的可调默认约定,不是当前端口或已安装事实。真实owner选择可用PORT并注入原启动契约,不结束其它进程。",
|
||||||
|
"独立安装视频剪辑师,关联只设置入口偏好。MCP须另行授权连接同一个当前release/安装/instance/generation/dataRoot;版本号、能力字符串或目录不替代真实就绪观测。"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"placementPolicy": {
|
||||||
|
"showInMyApps": true,
|
||||||
|
"allowNavPin": true,
|
||||||
|
"allowAgentBinding": true
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"kind": "release",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-editing/releases/download/v0.1.3/video-editing-0.1.3.zip",
|
||||||
|
"ref": "e1e5d12ce95854ca7cb02d277f955abb1536c5ac",
|
||||||
|
"sha256": "fa9128606390a17409ff4eba46c13988df17f55cb8bbd3f21c6066cb5f9940b4"
|
||||||
|
},
|
||||||
|
"stewardship": "pointer",
|
||||||
|
"availability": "installable",
|
||||||
|
"license": "MIT",
|
||||||
|
"redistribution": "source-pointer-only",
|
||||||
|
"listingMaintainer": {
|
||||||
|
"name": "DesireCore Registry maintainers",
|
||||||
|
"url": "https://github.com/desirecore/registry"
|
||||||
|
},
|
||||||
|
"upstreamMaintainer": {
|
||||||
|
"name": "desirecore-agent",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-editing"
|
||||||
|
},
|
||||||
|
"branding": {
|
||||||
|
"relationship": "independent-listing",
|
||||||
|
"nameUsage": "nominative",
|
||||||
|
"logoStatus": "not-used"
|
||||||
|
},
|
||||||
|
"compliance": {
|
||||||
|
"licenseEvidencePath": "LICENSE",
|
||||||
|
"noticePath": "NOTICE.md",
|
||||||
|
"reviewedRef": "e1e5d12ce95854ca7cb02d277f955abb1536c5ac",
|
||||||
|
"reviewedAt": "2026-11-02",
|
||||||
|
"reviewedBy": "fixed-source-and-bounded-runtime-review (see review.md)",
|
||||||
|
"upstreamEndorsed": false
|
||||||
|
},
|
||||||
|
"entrypoints": [
|
||||||
|
{
|
||||||
|
"id": "editor",
|
||||||
|
"name": "剪辑工作台",
|
||||||
|
"kind": "embedded-web",
|
||||||
|
"serviceRef": "video-editing:editor"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"appRelease": {
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"releaseDigest": "205ca1f94ae71ce4b86984328ab9914d477fcc9428fd69c6dc5789f93de0e68b",
|
||||||
|
"manifestPath": "app-release.json",
|
||||||
|
"definitionSource": "manifest",
|
||||||
|
"requiredCapabilities": [
|
||||||
|
"app-authoring-v1",
|
||||||
|
"release",
|
||||||
|
"runtime-binding"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# 视频剪辑固定材料审阅与发布边界
|
||||||
|
|
||||||
|
独立“视频剪辑”,与既有视频创作/视频导演分开。App PR1与CI修复PR2已合,实际固定源 `e1e5d12ce95854ca7cb02d277f955abb1536c5ac`,main CI41455224007七项真实Runner成功。直接保留FableCut `61bf46babca82214c162c0650e47a81c3530982c`历史、MIT/版权/字体通知,NOTICE.md记录独立fork,无上游背书或产品标志。Node、Chrome for Testing、FFmpeg/ffprobe与字体各自许可独立,不冒MIT-only。
|
||||||
|
|
||||||
|
## 真实分发身份
|
||||||
|
|
||||||
|
0.1.3固定资产已在2026-11-02发布到[GitHub Release](https://github.com/desirecore-agent/video-editing/releases/tag/v0.1.3),实际公网HTTP200下载与准备归档完全相同:1372662B/SHA256 `fa9128606390a17409ff4eba46c13988df17f55cb8bbd3f21c6066cb5f9940b4`。包根app-release.json及130payload/3104880B逐字节与上述提交一致,规范releaseDigest `205ca1f94ae71ce4b86984328ab9914d477fcc9428fd69c6dc5789f93de0e68b`。清单实际worktree生成来源保留,不为了填写Git mergeRef改payload或摘要。归档不含原生bins、node_modules、用户数据、媒体、测试夹具、凭据或授权。源固定pin和归档SHA独立填写,不用releaseDigest代替下载SHA。
|
||||||
|
|
||||||
|
产品UUID/目录ID `0171a763-ad35-4b94-98b9-204782817b44`、editor embedded-web入口/serviceRef、placement来自真实清单内联definition,appRelease.definitionSource=manifest。实际安装ID/owner/代际只能来自正常安装流程;目录不自报信任。独立4.3作者Schema与现有4.2全局Schema分开,不改旧格式字节;两个validator选择同一判据,固定git/release来源、required capabilities与互斥definition来源由回归约束。
|
||||||
|
|
||||||
|
## 限定实际资格
|
||||||
|
|
||||||
|
应用0.1.3/R14限定功能通过macOS UID501/Electron44.10源码GUI、Windows x64 Console1未签GUI、Ubuntu24.04.5/WSLg普通用户Electron44.10源码GUI。正常固定依赖准备、真实AppManage/TaskHost、实际Agent与同实例MCP、可编辑工程/自产影片full decode与来源/声音校准及真实明暗UI分开留证。Windows当前UI新窗口有实际guest/Play/Pause/正常MCP24,不冒新的AgentRun;Mac的取消/故障不变域承接已验R12,不称R14重跑全矩阵。Windows/Linux当前取消及单Root故障后原任务interrupted/登记物理清理/no auto job分别实测;Linux原观察工装readlink退出竞态保留,以同case只读续核,不重复kill。旧Windows锁归档晚hard13.245秒等原边界不因后续全闭窗口抹除。自有现场均关闭,数据保留。
|
||||||
|
|
||||||
|
资格不扩展为正式签名系统安装器/官方Linux包、裸机GPU、所有版本或商业模型自主规划质量。依赖固定档案校验与原setupRuntime新回执不冒全部OS首次公网下载。原生源码平台Mac eb31、Windows/WSL f5;最新平台实际合并f897完整CI已过,新增启动审批/PORT影响尚待最终fresh-home官方市场链验证。目录Schema和CI不是安装成功证明。
|
||||||
|
|
||||||
|
## 客户端与默认市场实测
|
||||||
|
|
||||||
|
最低兼容要求为10.0.197并实际包含平台PR5598的新reader、release/runtime-binding。公开196标签源不含该reader;版本号、capability字符串或目录availability均不能替代实际来源与安装观测。
|
||||||
|
|
||||||
|
已在客户端197源码候选11285bc284bb0533f24851f9dc6d2f9b60324361的全新隔离home,通过默认官方registry main与market main实际获取固定App和独立Agent。原AppManage prepare、实际TaskHost命令接纳/enroll/CAS commit、关联空权限、独立同实例MCP24、真实Agent改名/改字幕/新影片输出及完整解码/画面声音校验、原生关联guest播放暂停/明暗主题均完成;没有目录override或手塞seed。该结果是macOS源码候选,不是公开197签名包的安装结论。
|
||||||
|
|
||||||
|
核验后旧运行修订失效和待审批停止请求的未知结果均保留。原恢复守卫正确拒绝无可信终态的旧命令,沿已有接纳流程修复同一部署,数据与影片保持;完整宿主ApplicationRuntime.stop审批允许后原HTTP200、可信TaskHost user_stopped/exit0与物理退出闭合。QA误用manage提交被writer拒绝,改合法update后通过,没有放宽校验或手写账本。源码候选的限定功能实测不代替正式发行包验收,也不证明商业模型自主质量。
|
||||||
|
|
||||||
|
English: The fixed archive and default official catalogs were actually acquired in a fresh isolated 197 source-GUI candidate. Managed admission/CAS, independent Agent installation and association, same-instance MCP, real Agent edits and output validation, native playback and both themes passed within that scope. A pending stop approval was not treated as completed; the original recovery guard remained intact, existing admission repaired the same deployment, and explicit stop approval produced HTTP200 and trusted TaskHost exit evidence without changing media. This is not qualification of a publicly distributed signed 197 client. Verify actual release source and capabilities; public 196 lacks the reader.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# 视频剪辑使用
|
||||||
|
|
||||||
|
从已安装应用的“剪辑工作台”打开或新建工程,组织视频、音频、图片、标题和叠加层,使用时间线完成裁剪、分割、轨道编排、声音与调色。界面跟随 DesireCore 明暗主题;窄窗口通过 Preview / Media / Inspector 切换主任务区域。部分上游控件保留英文标签。[固定源编辑手册](https://github.com/desirecore-agent/video-editing/blob/e1e5d12ce95854ca7cb02d277f955abb1536c5ac/docs/editor-guide.md)说明实际编辑与 MCP 合同。
|
||||||
|
|
||||||
|
视频剪辑师可协助素材组织、时间线与声音处理,也可自主编写 HTML/SVG/Canvas/WebGL 原创动效并按工程实际支持的素材/组件流程加入作品,不要求作品局限于字幕或模板。人工编辑、草稿和锁遵循原工程合同;保存和 MCP 修改携带当前 projectId/baseRevision,遇到冲突先保留草稿、重新读取当前修订,不盲覆盖。
|
||||||
|
|
||||||
|
正式 MCP 的 `fablecut_*` 工具保留上游命名,连接同一当前服务与工程;工具列表、审批和授权来自实际平台配置。关联数字员工不自动连接、授权或启动服务,安装目录也不提供 Provider Key、模型额度或预设付费生成。可选 ASR、MediaPipe、远程字体及外部媒体服务可能访问其上游;许可、账户、网络和费用另行确认。
|
||||||
|
|
||||||
|
GUI Fast 与 `fablecut_export` 使用后台无头渲染器读取原 job 的冻结工程与声明本地媒体,不从正在编辑的可变页面输出。导出 `where` 省略、auto 或 headless 可用,tab 明确拒绝。动态 SVG 依赖、网络资源和 OS 字体尚未完整冻结,不承诺所有外部输入都有同样的快照资格。
|
||||||
|
|
||||||
|
完成状态以原 job 的回执、文件及必要视听检查为准,提交成功不是成片成功。取消等待原编码会话退出再清理已登记且身份匹配的临时产物;缺失或不可靠身份保持 unknown。重启把原未完成 job 记为 interrupted,并清理可证明归属的登记项,不自动续跑或新建替代 job。结果未知先查原 job;重试是明确的新任务。输入、工程、已完成输出与未登记文件不属于临时产物删除清单。
|
||||||
|
|
||||||
|
当前目录平台范围为 macOS 源码 GUI、Windows 未签 GUI 与 Ubuntu/WSLg 源码 GUI 的限定功能,详见 `review.md`。安装时仍需核对实际客户端的新reader能力;正式签名安装器、官方 Linux 包、裸机 GPU 与模型自主规划质量均未由这些运行证据证明。素材内容、审美、节奏和听感仍需实际审看与试听。
|
||||||
|
|
||||||
|
English: Use the installed timeline for editable multitrack media, sound, color and original motion; preserve human edits and compare current project revisions before applying changes. Video Editor can create original HTML/SVG/Canvas/WebGL material without reducing the work to captions or presets. Authorized MCP tools attach to the same current instance. Exports use frozen job inputs and the headless renderer; external dynamic resources and OS fonts are not fully frozen. Inspect the original job and output, keep unknown results explicit, and retry only as a new request. Runtime evidence is scoped to macOS source GUI, unsigned Windows GUI and Ubuntu/WSLg source GUI. Fresh default-market installation and use passed on a 197 source GUI candidate; public production packages and model quality remain separate checks.
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../schemas/catalog-metadata.v1.schema.json",
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"identity": {
|
||||||
|
"kind": "service",
|
||||||
|
"id": "aws-mcp"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"defaultLocale": "zh-CN",
|
||||||
|
"i18n": {
|
||||||
|
"zh-CN": {
|
||||||
|
"name": "AWS MCP",
|
||||||
|
"summary": "AWS 托管 MCP 服务的本地代理入口:固定代理 1.7.0,需 Python 3.10–3.14、uv/uvx 与自行配置的 AWS 凭据和 IAM 权限;默认只读,云资源费用另计。",
|
||||||
|
"description": "通过 AWS 官方 MCP Proxy 的本地 stdio 进程连接 AWS 托管 MCP 服务,远端使用 HTTPS 与 SigV4。条目的 1.7.0 是代理包版本,不是托管服务版本,也不固定远端工具清单;未填写工具数量。CLI 包及实际代理代码包均固定到发布 wheel 的 HTTPS URL 和 SHA-256。其余依赖遵循 CLI 包内的精确版本约束,这不是全部依赖的逐字节安全认证。\n\n需自行准备 Python >=3.10,<3.15、uv/uvx、网络和所选 AWS 身份的有效凭据、最小 IAM 权限;使用 AWS CLI 登录流程时还需相应 CLI。安装不会登录 AWS、创建账户、授予权限、安装配套技能或接入其他宿主。启动前由用户在私有配置中确认账户、Profile 与操作区域;不收集或公开密钥。缺工具、凭据、权限或连接时说明阻碍,在相应外部调用前停止,不能编造成功结果。\n\n默认连接 us-east-1 MCP 端点,操作默认区域也显式设为 us-east-1;端点区域和资源操作区域是两件事,均须用户确认。默认启用代理 --read-only,只保留远端标注 readOnlyHint=true 的工具并限制相应调用;写入或未标注的工具、以及包含混合操作的 API 工具可能不可用。这不是 IAM 安全边界,也不保证读操作没有费用。默认关闭代理可选遥测,不关闭向 AWS 发送工具参数、认证及 AWS 审计日志。\n\n本条目选择 SigV4 代理方案;AWS 同时提供的直接 OAuth 连接不是本条目默认安装流程。公开文档和服务信息可匿名访问,不代表能操作账户资源;未经用户授权,不切到匿名 --skip-auth、申请更高权限或移除只读模式来绕过错误。创建/删除资源、改 IAM、上传数据、发消息、切流和付费操作须先明确授权、范围及成本。请求参数与被访问数据按 AWS 服务条款和组织的数据处理要求进入 AWS。\n\n代理源码为 Apache-2.0;AWS 托管服务与资源适用独立条款。AWS 文档称工具包/MCP 服务本身无额外费用,所访问或创建的云资源、模型、存储、流量、日志及第三方服务仍可能计费。社区独立收录,维护者未验证,无上游背书。平台列表来自上游 OS Independent 声明和通用 Python wheel,不代表本轮跨平台实测。已在 macOS 隔离环境运行固定 Python 代理:默认签名模式在空凭据下明确返回缺凭据错误;另行授权的匿名只读测试变体完成 MCP 握手、发现 6 个工具并实际检索和读取公开文档。DesireCore 10.0.187 已验证目录展示和接入入口,并通过正常配置 API 将单独匿名变体接入测试 Agent,实际发现 6 个工具;真实对话经工具审批调用文档检索成功。默认签名接入未完成,停止安装任务后资源卡片仍将 installing 记录标为“已安装”的显示问题未修复;不代表账户业务验收。未读取真实 AWS 凭据、登录、调用账户业务、创建资源或进行 Windows/Linux 实测。"
|
||||||
|
},
|
||||||
|
"en-US": {
|
||||||
|
"name": "AWS MCP",
|
||||||
|
"summary": "Local proxy entry for the managed AWS MCP Server, pinned to proxy 1.7.0. Requires Python 3.10–3.14, uv/uvx and separately configured AWS credentials/IAM access; read-only by default, with separate cloud resource charges.",
|
||||||
|
"description": "Connect to the managed AWS MCP Server through the official AWS MCP Proxy as a local stdio process, using HTTPS and SigV4 upstream. Version 1.7.0 refers to the proxy packages, not the managed service or its evolving tool inventory. No tool count is claimed. Both the CLI wrapper and implementation wheels are pinned by HTTPS URL and SHA-256. Other dependencies follow the wrapper’s exact version constraints; this is not a byte-level security certification of the full dependency closure.\n\nSeparately provide Python >=3.10,<3.15, uv/uvx, network access, valid credentials for the selected AWS identity and least-privilege IAM permissions. An AWS CLI sign-in workflow also needs its compatible CLI. Installation does not sign in, create accounts, grant permissions, install companion skills or configure other hosts. Before starting, have the user confirm the account, profile and operational Region in private configuration; never collect or publish keys. Report missing tools, credentials, permissions or connectivity and stop before the affected external call rather than fabricating success.\n\nThe default MCP endpoint and explicit operational Region are both us-east-1; these are separate settings requiring user confirmation. Default --read-only keeps tools annotated readOnlyHint=true and restricts corresponding calls. Write-capable, unannotated or mixed-operation API tools may therefore be unavailable. This does not replace IAM or guarantee cost-free reads. Optional proxy telemetry is disabled; AWS request data, authentication and audit logging are not disabled.\n\nThis listing selects the SigV4 proxy route, not AWS’s separate direct OAuth connection. Anonymous documentation/service lookup does not establish permission to operate on account resources. Do not switch to --skip-auth, elevate permissions or remove read-only mode to work around a failure without authorization. Resource creation/deletion, IAM changes, uploads, messaging, traffic changes and paid operations require explicit scope and cost authorization. Request parameters and accessed data are subject to AWS terms and organizational data-handling requirements.\n\nThe proxy source is Apache-2.0; AWS services and resources have separate terms. AWS documents no additional charge for the toolkit/MCP service itself, while resources, models, storage, traffic, logs and third-party providers may still incur charges. Independent community listing, unverified maintainers, no upstream endorsement. Platform metadata reflects upstream OS Independent classification and universal wheels, not cross-platform testing. An isolated macOS run executed the pinned Python proxy: default signed mode failed explicitly without credentials; a separately authorized anonymous read-only variant initialized MCP, discovered six tools and searched/read public documentation. DesireCore 10.0.187 catalog and task entry points were exercised; a separate public variant was registered to a test Agent through the normal configuration API, exposing six tools, and its real chat invoked documentation search through normal approval. Default signed installation remains incomplete. A resource-card label still describes an installing record as installed after task cancellation; that UI issue is not fixed. AWS account readiness is not established. No real AWS credentials, sign-in, account operation, resource creation or Windows/Linux execution was used."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"aws",
|
||||||
|
"mcp",
|
||||||
|
"cloud",
|
||||||
|
"sigv4",
|
||||||
|
"documentation"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"state": "known",
|
||||||
|
"version": "1.7.0",
|
||||||
|
"versionScheme": "semver"
|
||||||
|
},
|
||||||
|
"timestamps": {
|
||||||
|
"catalogUpdatedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"releasePublishedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-09-15T11:20:51Z",
|
||||||
|
"precision": "second"
|
||||||
|
},
|
||||||
|
"reviewedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"upstreamObservedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"provenance": {
|
||||||
|
"content": {
|
||||||
|
"kind": "package",
|
||||||
|
"url": "https://pypi.org/project/mcp-proxy-for-aws-cli/",
|
||||||
|
"ref": "1.7.0",
|
||||||
|
"sha256": "75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"governance": {
|
||||||
|
"availability": "installable",
|
||||||
|
"stewardship": "community",
|
||||||
|
"license": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "Apache-2.0",
|
||||||
|
"evidencePath": "mcp_proxy_for_aws_cli-1.7.0.dist-info/licenses/LICENSE"
|
||||||
|
},
|
||||||
|
"redistribution": "allowed",
|
||||||
|
"listingMaintainer": {
|
||||||
|
"name": "mashagua",
|
||||||
|
"url": "https://github.com/mashagua",
|
||||||
|
"verified": false
|
||||||
|
},
|
||||||
|
"upstreamMaintainer": {
|
||||||
|
"name": "Amazon Web Services",
|
||||||
|
"url": "https://github.com/aws/mcp-proxy-for-aws",
|
||||||
|
"verified": false
|
||||||
|
},
|
||||||
|
"branding": {
|
||||||
|
"relationship": "independent-listing",
|
||||||
|
"nameUsage": "nominative",
|
||||||
|
"logoStatus": "not-used"
|
||||||
|
},
|
||||||
|
"compliance": {
|
||||||
|
"licenseEvidencePath": "mcp_proxy_for_aws_cli-1.7.0.dist-info/licenses/LICENSE",
|
||||||
|
"noticePath": "mcp_proxy_for_aws_cli-1.7.0.dist-info/licenses/NOTICE",
|
||||||
|
"reviewedRef": "1.7.0",
|
||||||
|
"reviewedAt": "2026-10-25",
|
||||||
|
"reviewedBy": "mashagua",
|
||||||
|
"upstreamEndorsed": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compatibility": {
|
||||||
|
"platforms": {
|
||||||
|
"state": "known",
|
||||||
|
"values": [
|
||||||
|
"macos",
|
||||||
|
"windows",
|
||||||
|
"linux"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"kind": "service",
|
||||||
|
"protocol": "mcp",
|
||||||
|
"authType": "unknown",
|
||||||
|
"capabilities": [
|
||||||
|
"aws_documentation",
|
||||||
|
"aws_service_reference",
|
||||||
|
"iam_authenticated_access"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# AWS MCP 安装 / Installation
|
||||||
|
|
||||||
|
这是 AWS 托管 MCP 服务的 **SigV4 本地代理**入口,不是把 AWS 服务部署到本机。`1.7.0` 指 `mcp-proxy-for-aws-cli` 和 `mcp-proxy-for-aws` 的代理版本,远端服务不由此固定版本。配套 [AWS 技能合集 PR](https://github.com/desirecore/market/pull/226) 单独安装,不是本服务的硬依赖。
|
||||||
|
|
||||||
|
This entry connects to the managed AWS MCP Server through a local SigV4 proxy. Version `1.7.0` identifies the two proxy distributions, not the remote service. The companion skill collection is optional and acquired separately.
|
||||||
|
|
||||||
|
## 安装前确认 / Before installation
|
||||||
|
|
||||||
|
- 自行准备 Python `>=3.10,<3.15`、uv/uvx 和兼容 stdio 的 DesireCore 客户端;首次获取依赖需要访问 PyPI 与 files.pythonhosted.org,运行需要访问选定 AWS HTTPS 端点。不要自动升级 Python、uv 或客户端。
|
||||||
|
- 请求用户在本机私有配置中选择 AWS 身份、Profile、账户与资源操作区域。优先使用现有 SSO/临时凭据和最小权限角色,不申请 root/AdministratorAccess,也不索取密钥、会话 token、凭据文件或完整身份输出到对话。已有凭据不代表用户授权此次使用。
|
||||||
|
- 本条目不自动安装 AWS CLI 或发起登录。若用户选择 `aws login`,该流程另需 AWS CLI >=2.32.0;已有 SSO 流程无需因此更换。登录、刷新会话或附加 IAM 策略必须先取得相应授权,不能把命令写成隐含安装步骤。
|
||||||
|
- 默认连接 `https://aws-mcp.us-east-1.api.aws/mcp`,资源操作默认区域通过 `AWS_REGION=us-east-1` 元数据明确指定。端点所在区域不等于资源所在区域;开始前说明并确认二者,按官方区域清单调整用户私有连接配置。
|
||||||
|
- AWS 的直接远端 OAuth 接入是另一条方案;本条目不宣称已验证 DesireCore 的 AWS OAuth 联调,不在安装中改写其他客户端配置。
|
||||||
|
|
||||||
|
Provide Python 3.10–3.14, uv/uvx, a compatible stdio host and network access. Have the user select the identity, profile, account and operational Region privately before using existing credentials. Prefer temporary/SSO credentials and least privilege; never request credential files or keys in chat. Do not automatically install/upgrade tools, sign in, refresh sessions, alter IAM or replace unrelated configurations. The optional `aws login` workflow requires AWS CLI >=2.32.0. Endpoint and operational Regions are distinct. Direct OAuth is not the selected or tested flow here.
|
||||||
|
|
||||||
|
## 固定制品 / Pinned artifacts
|
||||||
|
|
||||||
|
| 发布包 / Distribution | 文件 / File | SHA-256 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `mcp-proxy-for-aws-cli==1.7.0` | `mcp_proxy_for_aws_cli-1.7.0-py3-none-any.whl`(7321 字节 / bytes) | `75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e` |
|
||||||
|
| `mcp-proxy-for-aws==1.7.0` | `mcp_proxy_for_aws-1.7.0-py3-none-any.whl`(45971 字节 / bytes) | `d7e6c8f45ef89303cb48822e25f91c0234bb28ee987ebb56615cd16a5d044a1b` |
|
||||||
|
|
||||||
|
下载 URL 与带摘要的默认参数见 [usage.md](usage.md) 和 manifest;默认使用 `uvx --from <CLI wheel + hash> --with <implementation wheel + hash> mcp-proxy-for-aws-cli ...`。CLI 只是元数据包装包;`--with` 同时固定实际代码包,不能只校验包装包后就声称代码也已校验。
|
||||||
|
|
||||||
|
`uvx` 在隔离的缓存环境中准备依赖,不是系统级安装。`#sha256=` 是交给 uv 的下载校验信息;摘要不匹配必须失败,不改用无摘要 URL、浮动版本或 `latest`。若宿主或 uv 不支持本条目参数,停止并报告兼容性问题,不静默改写受治理的定义。CLI 的其余 84 条运行依赖声明使用精确版本及条件标记;本记录没有逐个审核它们的所有平台制品或证明无漏洞。
|
||||||
|
|
||||||
|
The launch definition pins both the metadata-only CLI wrapper and actual implementation wheels by URL and SHA-256. uv prepares an isolated cached environment and checks the URL hashes. A mismatch or unsupported launch contract must stop installation, with no unhashed/latest fallback. The wrapper declares 84 exact-version runtime requirements with environment markers; this review is not a byte-level audit or vulnerability certification of all platform-specific dependency artifacts.
|
||||||
|
|
||||||
|
## 登记与连接验证 / Registration and verification
|
||||||
|
|
||||||
|
1. 通过当前 DesireCore 提供的受治理服务安装/连接流程,使用本次操作携带的精确目录来源与快照。读取该快照的 manifest、sidecar、本说明与 usage,不替换整个 MCP 配置,也不凭裸 `aws-mcp` ID 吸收其他来源的安装。
|
||||||
|
2. 先确认 uvx/Python 可用、用户批准的凭据配置已就绪,以及账户、操作区域、只读范围与费用边界。缺失时说明缺失项并停止;不要通过读取或上传凭据来“验证”。若客户端需要定位 uvx,使用本机解析出的真实绝对路径,不把本机路径写回公共目录。
|
||||||
|
3. 使用 manifest 中完全一致的 command/args 启动;默认保留 `--read-only` 与 `--disable-telemetry`,没有 `--skip-auth`。不要在验证连接时调用资源创建、删除、上传、发消息或费用相关工具。
|
||||||
|
4. 由 MCP 宿主完成 `initialize`、`notifications/initialized`、`tools/list`(包括分页),检查实际响应、错误和断开清理。工具数量以本次真实返回为准,不预填或伪造。依赖准备完成、进程已启动、握手完成及某项业务可用是不同事实;只按实际结果登记当前客户端支持的安装/连接回执,不预写“已安装/就绪”。
|
||||||
|
5. 版本信息按已核验发行包元数据确认,不假设代理提供 `--version` 命令。此版本的 argparse 没有通用 `--version` 开关,不能用不存在的参数判定安装失败。真实账户工具调用需另有对应任务与授权,不能用创建资源作为连通性探针。
|
||||||
|
|
||||||
|
Use DesireCore’s governed service workflow with the exact source and snapshot. Confirm tools and privately approved credentials before launch. Keep the catalog definition intact and preserve unrelated connections. Verify MCP initialization and the complete tool list, then record only observations actually made; preparing dependencies or starting a process is not readiness. No tool count is predeclared. Read package metadata for version confirmation rather than assuming a nonexistent `--version` option. A business operation needs its own authorized task.
|
||||||
|
|
||||||
|
## 升级与卸载 / Update and removal
|
||||||
|
|
||||||
|
- 升级需重新核对两个发布包及适用依赖、摘要、许可证、参数和兼容性,再更新目录;不自动跟随远端或包的 latest,也不把托管服务更新冒充本地代理升级。
|
||||||
|
- 卸载先停止并移除这一来源/服务的受治理连接,再按客户端支持的流程移除本条目拥有的安装记录或独立环境。不要删除共享 uv 缓存、AWS CLI、其他宿主连接、`~/.aws`、SSO 会话或用户云资源;凭据撤销和云资源清理是需单独授权的操作。
|
||||||
|
|
||||||
|
Updates require a fresh review of both artifacts, dependencies and launch compatibility. Removal stops this exact connection and handles only its owned records/environment. Preserve shared caches, other hosts, credentials and cloud resources; revocation and cloud cleanup require separate authorization.
|
||||||
|
|
||||||
|
代理为 Apache-2.0;AWS 账户、API、资源及第三方依赖的条款与费用独立,详见 usage。**macOS 补测已运行固定代理,完成独立公开模式握手、工具发现和文档检索/读取,并检查 DesireCore 目录与接入入口;完整集成和账户业务不在这些通过项内,详见 review.md。**
|
||||||
|
|
||||||
|
The proxy is Apache-2.0; AWS and third-party terms/charges are separate. The macOS follow-up executed the pinned proxy for independent public-mode initialization, tool discovery and document search/read, and checked DesireCore catalog/task entry points. Complete client integration and AWS account operations are separate, unverified claims; see review.md.
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"id": "aws-mcp",
|
||||||
|
"name": "AWS MCP",
|
||||||
|
"type": "mcp",
|
||||||
|
"version": "1.7.0",
|
||||||
|
"author": "Amazon Web Services",
|
||||||
|
"description": "AWS 托管 MCP 服务的本地代理入口:固定代理 1.7.0,需 Python 3.10–3.14、uv/uvx 与自行配置的 AWS 凭据和 IAM 权限;默认只读,云资源费用另计。",
|
||||||
|
"tags": [
|
||||||
|
"aws",
|
||||||
|
"mcp",
|
||||||
|
"cloud",
|
||||||
|
"sigv4",
|
||||||
|
"documentation"
|
||||||
|
],
|
||||||
|
"icon": "cloud",
|
||||||
|
"platformSupport": [
|
||||||
|
"macos",
|
||||||
|
"windows",
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"capabilities": [
|
||||||
|
"aws_documentation",
|
||||||
|
"aws_service_reference",
|
||||||
|
"iam_authenticated_access"
|
||||||
|
],
|
||||||
|
"install": {
|
||||||
|
"method": "uvx",
|
||||||
|
"packageName": "mcp-proxy-for-aws-cli",
|
||||||
|
"command": "uvx",
|
||||||
|
"args": [
|
||||||
|
"--from",
|
||||||
|
"mcp-proxy-for-aws-cli @ https://files.pythonhosted.org/packages/5d/ec/2faa62a1c8186966d73b4d3069d7098f08e1891b2f5141dd7bcf135c3561/mcp_proxy_for_aws_cli-1.7.0-py3-none-any.whl#sha256=75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e",
|
||||||
|
"--with",
|
||||||
|
"mcp-proxy-for-aws @ https://files.pythonhosted.org/packages/73/df/04a7dba8d3ed744daff2783b220e9239969f0e0714266c52f0ced8d4ebf2/mcp_proxy_for_aws-1.7.0-py3-none-any.whl#sha256=d7e6c8f45ef89303cb48822e25f91c0234bb28ee987ebb56615cd16a5d044a1b",
|
||||||
|
"mcp-proxy-for-aws-cli",
|
||||||
|
"https://aws-mcp.us-east-1.api.aws/mcp",
|
||||||
|
"--read-only",
|
||||||
|
"--disable-telemetry",
|
||||||
|
"--metadata",
|
||||||
|
"AWS_REGION=us-east-1"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"connection": {
|
||||||
|
"transport": "stdio",
|
||||||
|
"command": "uvx",
|
||||||
|
"args": [
|
||||||
|
"--from",
|
||||||
|
"mcp-proxy-for-aws-cli @ https://files.pythonhosted.org/packages/5d/ec/2faa62a1c8186966d73b4d3069d7098f08e1891b2f5141dd7bcf135c3561/mcp_proxy_for_aws_cli-1.7.0-py3-none-any.whl#sha256=75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e",
|
||||||
|
"--with",
|
||||||
|
"mcp-proxy-for-aws @ https://files.pythonhosted.org/packages/73/df/04a7dba8d3ed744daff2783b220e9239969f0e0714266c52f0ced8d4ebf2/mcp_proxy_for_aws-1.7.0-py3-none-any.whl#sha256=d7e6c8f45ef89303cb48822e25f91c0234bb28ee987ebb56615cd16a5d044a1b",
|
||||||
|
"mcp-proxy-for-aws-cli",
|
||||||
|
"https://aws-mcp.us-east-1.api.aws/mcp",
|
||||||
|
"--read-only",
|
||||||
|
"--disable-telemetry",
|
||||||
|
"--metadata",
|
||||||
|
"AWS_REGION=us-east-1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# AWS MCP 收录核验 / Listing review
|
||||||
|
|
||||||
|
审核日期:2026-10-25;收录维护者:mashagua。独立 community 条目,维护者不标为 verified,`upstreamEndorsed=false`。AWS 名称仅用于指称来源,使用通用 cloud 图标,不复制 AWS 标志。`installable` 表示符合目录来源和治理条件,不等于已安装、连接就绪、账户已授权或通过安全认证。
|
||||||
|
|
||||||
|
Reviewed on 2026-10-25 by mashagua. Independent community listing, unverified maintainers, no upstream endorsement, nominative naming and a generic icon. Installable catalog evidence is not installation, readiness, account permission or software safety certification.
|
||||||
|
|
||||||
|
## 制品与许可 / Artifacts and license
|
||||||
|
|
||||||
|
| 项目 / Item | 证据 / Evidence |
|
||||||
|
| --- | --- |
|
||||||
|
| CLI 发行包 / CLI distribution | [PyPI 1.7.0 元数据](https://pypi.org/pypi/mcp-proxy-for-aws-cli/1.7.0/json) |
|
||||||
|
| CLI wheel | [固定下载 / fixed download](https://files.pythonhosted.org/packages/5d/ec/2faa62a1c8186966d73b4d3069d7098f08e1891b2f5141dd7bcf135c3561/mcp_proxy_for_aws_cli-1.7.0-py3-none-any.whl) |
|
||||||
|
| CLI wheel SHA-256 | `75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e`,7321 字节 / bytes |
|
||||||
|
| CLI 上传时间 / uploaded | `2026-09-15T11:20:51.587229Z`;sidecar 以秒精度保存 |
|
||||||
|
| 实现包 / implementation | [PyPI 1.7.0 元数据](https://pypi.org/pypi/mcp-proxy-for-aws/1.7.0/json) |
|
||||||
|
| 实现 wheel / implementation wheel | [固定下载 / fixed download](https://files.pythonhosted.org/packages/73/df/04a7dba8d3ed744daff2783b220e9239969f0e0714266c52f0ced8d4ebf2/mcp_proxy_for_aws-1.7.0-py3-none-any.whl) |
|
||||||
|
| 实现 wheel SHA-256 | `d7e6c8f45ef89303cb48822e25f91c0234bb28ee987ebb56615cd16a5d044a1b`,45971 字节 / bytes |
|
||||||
|
| 上游发布代码 / release source | tag `v1.7.0`,提交 [`22f1b3f8b7c4ef37112114b4af3d6c5a6c0a83bb`](https://github.com/aws/mcp-proxy-for-aws/tree/22f1b3f8b7c4ef37112114b4af3d6c5a6c0a83bb) |
|
||||||
|
|
||||||
|
实际下载两个 wheel,分别核对其 SHA-256、大小和 PyPI 元数据;初始静态审查只用 ZIP 读取发行元数据和相关源文件,未导入或执行包;后续运行补测见文末。CLI 的 entry point 为 `mcp-proxy-for-aws-cli = mcp_proxy_for_aws.server:main`;它本身没有 Python 实现模块,由固定 `mcp-proxy-for-aws==1.7.0` 提供。启动参数的 `--from` 与 `--with` 分别使用上述两份带 `#sha256=` 的固定 URL。
|
||||||
|
|
||||||
|
Sidecar 的 `provenance.content.url` 使用 PyPI 包主页标识包身份,版本由 `ref=1.7.0` 单独固定,不是主页 HTML 的摘要;`sha256` 对应所列 CLI wheel 字节。内容根为 wheel ZIP 根,因此许可证与通知路径分别为:
|
||||||
|
|
||||||
|
- `mcp_proxy_for_aws_cli-1.7.0.dist-info/licenses/LICENSE`
|
||||||
|
- `mcp_proxy_for_aws_cli-1.7.0.dist-info/licenses/NOTICE`
|
||||||
|
|
||||||
|
这两个文件已读取,分别与发布提交根 LICENSE/NOTICE 字节相同,许可证为 Apache-2.0。实现包也保留相应声明。`compliance.reviewedRef` 与 `provenance.content.ref` 都是 `1.7.0`,审核日期与 timestamps 一致。v1.7.0 发布代码中的 `cli.py`、`middleware/tool_filter.py` 与实现 wheel 对应文件也逐字节相同。不要用后续 main 分支代码替代发布包事实。
|
||||||
|
|
||||||
|
Both wheels were downloaded and matched their PyPI SHA-256/size metadata. The initial static review inspected ZIP data without import or execution; subsequent runtime acceptance is recorded below. The wrapper entry point delegates to the pinned implementation. The sidecar hash identifies the CLI wheel, while the implementation hash is additionally enforced in the launch definition and recorded here. License evidence paths are relative to the wheel archive root; its Apache-2.0 LICENSE/NOTICE match the release source. Ref-bound review and release argument/filter files were checked against published bytes, not assumed from current main.
|
||||||
|
|
||||||
|
CLI 元数据有 84 条带精确版本、部分带平台条件的运行依赖声明。固定版本不等于审核全部第三方制品、PyPI 账户、签名或供应链证明;本轮没有完成那些验证。依赖、Python 和 uv 各适用其许可;Apache-2.0 不授予 AWS 托管服务或其他商业服务使用权。仓库不复制发行包、Python 实现、SDK、凭据或本机验收原始数据。
|
||||||
|
|
||||||
|
The wrapper declares 84 exact-version runtime requirements, some conditional. This does not verify every dependency artifact, publisher, signature or supply-chain attestation. External dependencies retain their own licenses; Apache-2.0 does not license AWS services. No runtime artifacts or credentials are vendored.
|
||||||
|
|
||||||
|
## 参数、认证和行为 / Arguments, authentication and behavior
|
||||||
|
|
||||||
|
- 固定发行包实际支持 `--read-only`、`--disable-telemetry`、`--metadata` 和 `--profile`;它没有通用 `--version` 开关。初始审查仅静态检查参数;后续 macOS 补测实际运行了该启动定义。
|
||||||
|
- `--read-only` 按远端 `readOnlyHint=true` 过滤工具列表,并在具有 FastMCP 上下文的调用路径检查注解;不能作为 IAM 策略、服务端授权或完整沙箱保证。远端工具注解与清单可能变化,故不登记工具数量,不承诺所有只读 AWS API 都可经此模式调用。
|
||||||
|
- 本地 stdio 与远端 AWS 认证是两层。本条目实际选择 SigV4,不能把 stdio 无独立 API key 解读为 AWS 匿名访问。当前 sidecar 的 authType 枚举没有 SigV4,因此保留 `unknown` 并在双语描述和安装/使用说明中准确披露;不冒充 `none`、Bearer 或已验收的 OAuth,也不为单条登记修改 Schema。
|
||||||
|
- 上游另有匿名文档检索和直接 OAuth 流程;默认参数既不加 `--skip-auth`,也不配置 OAuth,用户须先在私有环境确认凭据。缺凭据或权限时停止,不自动改认证方式、扩大 IAM 权限或移除只读模式。
|
||||||
|
- `--disable-telemetry` 只关闭代理可选遥测,不阻止 HTTPS 数据流、AWS 认证、CloudTrail 或服务监控。默认 MCP 端点与操作区域均明确为 us-east-1,二者作用不同,使用前须确认。
|
||||||
|
|
||||||
|
The release supports the declared flags, but no generic --version option. Read-only behavior depends on upstream annotations and is not an IAM/security boundary. Local stdio and remote authentication are separate. The schema has no SigV4 enum, so authType remains unknown with explicit textual disclosure rather than a false none/Bearer/OAuth claim. There is no anonymous or permission-elevation fallback. Optional proxy telemetry suppression does not suppress AWS data transfer or audit logging.
|
||||||
|
|
||||||
|
## 官方接入与服务条款 / Official setup and terms
|
||||||
|
|
||||||
|
- [AWS MCP 设置、认证方案、端点与区域](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/getting-started-aws-mcp-server.html)
|
||||||
|
- [AWS MCP 能力与文档查询边界](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/mcp-server.html)
|
||||||
|
- [IAM 认证与最小权限](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/security-iam.html)
|
||||||
|
- [IAM 工作机制](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/security_iam_service-with-iam.html)
|
||||||
|
- [官方端点与配额](https://docs.aws.amazon.com/general/latest/gr/aws-mcp.html)
|
||||||
|
- [工具包计费说明](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/what-is-agent-toolkit.html)
|
||||||
|
- [AWS Customer Agreement](https://aws.amazon.com/agreement/) 与 [AWS Service Terms](https://aws.amazon.com/service-terms/)
|
||||||
|
- [uv 工具运行与来源说明](https://docs.astral.sh/uv/guides/tools/)
|
||||||
|
|
||||||
|
于审核日读取官方文档;这些持续更新的远端服务页面不代表固定后端软件。AWS 文档称工具包/MCP 服务没有额外费用,云资源使用仍按标准定价计费,不能宣传为所有操作免费。需遵守账户/组织的合同、区域、配额、数据处理与授权要求;安装本条目不会提供它们。
|
||||||
|
|
||||||
|
Official service documentation was checked on the review date, but does not pin the managed backend. No additional toolkit/MCP fee does not make all resource usage free. Account/organization terms, regions, quotas, data handling and authorization remain prerequisites.
|
||||||
|
|
||||||
|
## macOS 补测 / macOS runtime acceptance (2026-10-25)
|
||||||
|
|
||||||
|
- 在独立 Python 3.12.13、uv 0.11.2 环境使用本条目的真实 uvx 定义;两份 wheel 仍按 URL 与 SHA-256 固定,实际安装 76 个符合本平台条件的包。
|
||||||
|
- 显式空 AWS config/credentials、空登录缓存、禁用 IMDS,子进程环境采用白名单;没有读取真实 AWS 凭据或登录账户。
|
||||||
|
- 默认签名定义在 initialize 阶段明确返回 `No AWS credentials available`,这是缺凭据负向用例通过,不是 SigV4 授权成功。
|
||||||
|
- 在仅本轮独立测试变体中加 `--skip-auth`,继续保留 `--read-only`、`--disable-telemetry`;initialize 和完整 tools/list 成功,真实返回 6 个唯一工具。以 `AWS Lambda function timeout troubleshooting` 检索,返回 3 条公开结果,并成功读取其中一篇 AWS re:Post 文档;两次调用 `isError=false`。未调用账户业务工具。
|
||||||
|
- DesireCore 10.0.187 的独立 macOS GUI 实测发现并修正了包身份 URL 兼容性:当前 dev 会把版本化 PyPI URL 的 `/1.7.0/` 一并当成包名,真实一致性函数返回 `acquisition.source` 不匹配。改用包主页后同一函数通过,真实客户端从“仅收录”恢复“可接入”,可选择本机并发起带精确来源/快照的接入任务。`ref`、审核版本、两个 wheel URL/摘要和默认认证参数均未放宽。
|
||||||
|
- 另通过正在运行的 DesireCore 实例真实 `/api/mcp/test-connection` owner 复验:默认空凭据返回 HTTP 500 和明确缺凭据信息;匿名只读变体返回 HTTP 200、`status=connected`、6 个工具。该临时连接测试由真实客户端后端执行,不是 mock,也没有手写安装锁或成功状态;持久登记、宿主任务的完整安装及账户业务需分别验收。未进行 AWS 登录、真实凭据读取、账户业务、资源创建或 Windows/Linux 实测;没有运行本地全量测试或全量 typecheck。直接相关校验器单文件 16 项通过,目录校验通过。
|
||||||
|
- 单独匿名测试变体经正常 `/api/agents/:id/mcp-servers` owner 接入测试 Agent;实际工具组装返回 6 个 MCP 工具。随后在真实 GUI 对话指定公开文档查询,经过正常工具审批完成调用;运行回执显示 `DiscoverTools` 和真实 MCP 查询均 success,返回 3 条 URL 与独立探针一致。这是匿名变体的客户端集成通过,不是默认 SigV4 账户接入通过。
|
||||||
|
- 仍有明确 GUI 限制:市场安装委派任务在准备阶段停止后,持久记录仍是 `status=installing`,资源卡片的来源标签却显示“已安装”,详情为“离线”。实际点击“测试连接”能显示缺凭据错误;没有把这一默认安装记为成功。此主仓库显示/任务收尾问题不在本目录 PR 中修复。
|
||||||
|
|
||||||
|
|
||||||
|
The pinned proxy was executed on isolated macOS/Python 3.12.13 with uv 0.11.2 and 76 platform-applicable packages. Explicit empty AWS credential/config/login-cache paths and disabled IMDS prevented use of real AWS credentials. Default signed initialization reported missing credentials as expected. A separate, authorized unsigned read-only variant initialized, discovered six unique tools, searched public Lambda documentation and read one returned document, with both calls returning `isError=false`. No account operations were invoked.
|
||||||
|
|
||||||
|
A real DesireCore 10.0.187 catalog test exposed the versioned-PyPI-URL identity mismatch also present in current dev. Using the package homepage plus the unchanged version ref and wheel hashes restored the connectable entry and exact-source task launch. The running DesireCore instance’s real MCP connection-test owner also returned the expected missing-credentials failure in default mode and HTTP 200 / connected / six tools for the temporary public variant. A separate public test variant was then registered to an Agent through the normal configuration owner. Its six tools were assembled by the real runtime, and a GUI chat performed the approved MCP search with a successful tool audit and three matching public URLs. Default signed installation is still incomplete: a stopped installation leaves an installing record whose Resources origin label says installed, while details remain offline; the real test-connection button correctly displays the missing-credentials error. That main-repository UI/lifecycle limitation is not fixed by this catalog PR. No SigV4 account access, all-tool readiness, security certification or Windows/Linux acceptance is claimed. The directly related validator file passed 16 tests and catalog validation passed; no full test suite or full typecheck ran.
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
# AWS MCP 使用 / Usage
|
||||||
|
|
||||||
|
先阅读 [安装说明](install.md) 和 [来源核验](review.md)。本条目通过 AWS 官方代理连接托管服务;它不是本地 AWS 模拟器,不包含账户、云资源、配套技能或其他宿主插件。默认只读模式不保证所有账户 API 都可用。
|
||||||
|
|
||||||
|
Read installation and review notes first. This is a proxy to a managed service, not a local AWS emulator, account, cloud deployment, skill bundle or host plugin. Default read-only mode does not guarantee availability of every account API.
|
||||||
|
|
||||||
|
## 默认连接定义 / Default connection
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"transport": "stdio",
|
||||||
|
"command": "uvx",
|
||||||
|
"args": [
|
||||||
|
"--from",
|
||||||
|
"mcp-proxy-for-aws-cli @ https://files.pythonhosted.org/packages/5d/ec/2faa62a1c8186966d73b4d3069d7098f08e1891b2f5141dd7bcf135c3561/mcp_proxy_for_aws_cli-1.7.0-py3-none-any.whl#sha256=75f990fc5cab688bba31b67fb6a01832b64f7f097c94503877012c6595f0836e",
|
||||||
|
"--with",
|
||||||
|
"mcp-proxy-for-aws @ https://files.pythonhosted.org/packages/73/df/04a7dba8d3ed744daff2783b220e9239969f0e0714266c52f0ced8d4ebf2/mcp_proxy_for_aws-1.7.0-py3-none-any.whl#sha256=d7e6c8f45ef89303cb48822e25f91c0234bb28ee987ebb56615cd16a5d044a1b",
|
||||||
|
"mcp-proxy-for-aws-cli",
|
||||||
|
"https://aws-mcp.us-east-1.api.aws/mcp",
|
||||||
|
"--read-only",
|
||||||
|
"--disable-telemetry",
|
||||||
|
"--metadata",
|
||||||
|
"AWS_REGION=us-east-1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
上方 command/args 与本目录 manifest 的 install 和 connection 一致,两个 wheel 都通过 URL 摘要固定。由 DesireCore 管理时使用其服务安装/连接流程和精确目录来源,不把示例直接写入其他客户端,也不覆盖现有配置。本机 uvx 的绝对路径、用户 Profile、账户与区域属于私有运行配置,不写入公共目录。
|
||||||
|
|
||||||
|
The definition matches both install and connection in the manifest, pinning both wheels by URL hash. Use DesireCore’s governed service flow and exact catalog source; do not overwrite other clients or existing configurations. Absolute executable paths, profiles, accounts and user-selected Regions belong to private runtime configuration.
|
||||||
|
|
||||||
|
本地 stdio 不要求填写 API key,但远端使用用户选择的 AWS 身份做 SigV4。启动前先让用户确认可用的本地凭据链,例如其已授权的 AWS Profile/SSO;不要自动读取凭据内容、遍历其他账户或把身份输出粘贴到对话。凭据过期、IAM 拒绝或服务不可达时,报告具体阻碍并停止受影响操作,不通过去掉只读、换账户、附加管理员权限或改认证方式来制造“成功”。
|
||||||
|
|
||||||
|
Local stdio does not require an API key field, but the upstream request is SigV4-authenticated with the identity the user selects. Confirm the approved credential chain privately before starting. Do not read credential contents, enumerate unrelated accounts or paste identity output into chat. Report expired credentials, access denial and connectivity errors without changing accounts, permissions or authentication to manufacture success.
|
||||||
|
|
||||||
|
## 区域、能力与只读范围 / Region and read-only scope
|
||||||
|
|
||||||
|
- `https://aws-mcp.us-east-1.api.aws/mcp` 选择 MCP 服务端点;`--metadata AWS_REGION=us-east-1` 选择 AWS 操作默认区域。访问其他区域资源前需用户确认并调整私有配置,不能因为宿主在某地就猜测资源区域。端点替换以 [AWS 官方端点清单](https://docs.aws.amazon.com/general/latest/gr/aws-mcp.html) 为准。
|
||||||
|
- `--read-only` 依据远端的 `readOnlyHint=true` 展示工具并限制相应调用;未标注、可写或混合 API 工具可能被排除。读操作也可能产生资源或服务费用。此模式不能代替 IAM 最小权限和宿主工具审批,不是对远端工具实现的安全证明。
|
||||||
|
- 默认不传 `--skip-auth`。AWS 支持公开文档查询以及另一套直接 OAuth 接入,但这不等于本条目无需凭据即可操作账户,也不意味着本轮验收了 OAuth。仅当用户明确选择其他方案并完成客户端兼容性检查后,才在私有配置中调整,不静默降级。
|
||||||
|
- 远端工具清单会变化,需实际 `initialize`、`notifications/initialized` 和 `tools/list`(含分页)后才能得知本次能力。进程启动、工具被列出、IAM 允许和业务执行成功分别验证;不要把某一步成功泛化成全部成功。
|
||||||
|
- `--disable-telemetry` 关闭代理的可选遥测,不会关闭到 AWS 的 HTTPS、认证、请求参数传输或 AWS 审计日志。CloudTrail/CloudWatch 等实际采集、保留和费用按账户配置与服务要求核对。
|
||||||
|
|
||||||
|
The endpoint Region and operational default Region are distinct. Confirm both rather than guessing from host location. Read-only annotation filtering may exclude mixed-operation tools and does not replace IAM, host consent or cost review. Anonymous documentation and direct OAuth are separate flows, not implicit fallbacks. Discover actual capabilities after initialization and paginated tool listing. Process startup, tool discovery, permission and task success are separate checks. Disabling optional proxy telemetry does not disable AWS traffic, authentication or audit logging.
|
||||||
|
|
||||||
|
## 可提出的需求示例 / Example requests
|
||||||
|
|
||||||
|
以下是用户可提出的任务,不是安装后自动执行的操作;需以本次实际发现的只读工具为准,工具缺失时说明并停止:
|
||||||
|
|
||||||
|
- “查找 Lambda 超时排查的 AWS 官方文档,列出依据,先不要访问我的账户。”
|
||||||
|
- “对照官方服务资料解释 S3 与 EFS 的适用场景,只给建议,不创建资源。”
|
||||||
|
- “先说明完成我这个任务需要哪些 AWS 账户权限、区域和可能的费用;暂不调用账户 API。”
|
||||||
|
|
||||||
|
These are optional user requests, not automatic actions: find official Lambda timeout guidance without account access; compare S3 and EFS without provisioning; or explain required permissions, Regions and likely charges before any account API call. Use only tools actually available in this connection and report missing capabilities.
|
||||||
|
|
||||||
|
如要创建/删除资源、调整 IAM、上传数据、发送消息、切换流量、执行脚本或产生费用,先确认目标、授权、影响范围、成本和恢复/清理方案,再根据任务核对依赖与权限。不得为绕过默认限制直接去掉 `--read-only`;需要写能力时先让用户明确授权并使用宿主支持的受治理配置流程。不得以连接检查为由执行这些动作。
|
||||||
|
|
||||||
|
Provisioning/deletion, IAM changes, uploads, messaging, traffic changes, script execution and chargeable work require explicit target/scope/cost/recovery authorization and per-task dependency checks. Do not silently remove read-only mode. Use the host’s governed configuration flow if authorized write capability is needed; connection checks alone never authorize these operations.
|
||||||
|
|
||||||
|
## 条款、成本和数据边界 / Terms, costs and data handling
|
||||||
|
|
||||||
|
代理采用 Apache-2.0,不包含 AWS 或第三方服务的使用许可。根据 [AWS 工具包计费说明](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/what-is-agent-toolkit.html),工具包/MCP 服务本身没有额外费用;资源、API 使用引起的资源成本、模型、存储、流量、日志和第三方服务仍可能收费,按各服务价格、配额及用户合同核对。不承诺所有查询、只读调用或所谓免费额度都免费。
|
||||||
|
|
||||||
|
The Apache-2.0 proxy license does not license AWS or other services. AWS documents no additional toolkit/MCP service charge, while resource use, models, storage, traffic, logging and external providers can still incur their applicable costs and quotas. Do not promise that every read or free-tier usage is free.
|
||||||
|
|
||||||
|
请求参数、业务内容及操作可能传到 AWS,并进入相应服务或组织配置的日志;DesireCore 宿主模型的数据处理边界也需遵守。仅处理用户授权的账户和数据;不得将凭据、私有账户信息、资源标识、业务数据或完整日志提交到公共目录、PR 或截图。适用 [AWS Customer Agreement](https://aws.amazon.com/agreement/)、[AWS Service Terms](https://aws.amazon.com/service-terms/)、组织合同与各依赖许可。
|
||||||
|
|
||||||
|
Request parameters and business content can reach AWS and configured logs; the host model’s data boundary also applies. Operate only on authorized accounts/data. Never publish credentials, private account/resource identifiers, business data or raw logs in the catalog, PR or screenshots. AWS agreements, organizational terms and dependency licenses remain applicable.
|
||||||
|
|
||||||
|
本次未执行上游代码、读取 AWS 凭据、登录、真实握手或业务工具调用,也未做 DesireCore GUI/跨平台验收。来源与目录核验记录见 [review.md](review.md);不能把这些记录当作你的连接或业务已验证。
|
||||||
|
|
||||||
|
This listing review did not execute upstream code, read credentials, sign in, perform a live handshake/tool call or test DesireCore GUI/cross-platform functionality. Catalog evidence does not establish readiness for your connection or task.
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../schemas/catalog-metadata.v1.schema.json",
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"identity": {
|
||||||
|
"kind": "app",
|
||||||
|
"id": "video-creation"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"defaultLocale": "zh-CN",
|
||||||
|
"i18n": {
|
||||||
|
"zh-CN": {
|
||||||
|
"name": "视频创作",
|
||||||
|
"summary": "可编辑影片、原创动效和带版本时点的真实画面审片;与视频导演协作并保留人工修改。",
|
||||||
|
"description": "可编辑影片、原创动效和带版本时点的真实画面审片;与视频导演协作并保留人工修改。 复用OpenFilm渲染与编辑内核,支持HTML/SVG/Canvas/WebGL自主场景、时间窗总览、多尺寸与修订对照。需单独准备Node.js、pnpm、浏览器和FFmpeg;可选生成服务的许可、账户与费用另计。安装前检查app-authoring-v1的release/runtime-binding能力;目录来源或端口声明不等于已安装、已授权或当前在线。"
|
||||||
|
},
|
||||||
|
"en-US": {
|
||||||
|
"name": "Video Creation",
|
||||||
|
"summary": "Editable films, original motion scenes and versioned timed visual review, preserving human edits.",
|
||||||
|
"description": "Reuses the OpenFilm editor and renderer for autonomous HTML/SVG/Canvas/WebGL scenes, temporal overviews, size comparison and revision pairs. Requires Node.js, pnpm, browser/FFmpeg and app-authoring-v1 release/runtime-binding capabilities. Optional model/media licenses, accounts and usage fees are separate. Catalog ports are adjustable installation defaults, not proof of a live runtime."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"video",
|
||||||
|
"motion",
|
||||||
|
"editing",
|
||||||
|
"visual-review"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"state": "known",
|
||||||
|
"version": "0.3.0",
|
||||||
|
"versionScheme": "semver"
|
||||||
|
},
|
||||||
|
"timestamps": {
|
||||||
|
"catalogUpdatedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"releasePublishedAt": {
|
||||||
|
"state": "unknown"
|
||||||
|
},
|
||||||
|
"reviewedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
},
|
||||||
|
"upstreamObservedAt": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "2026-10-25",
|
||||||
|
"precision": "day"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"provenance": {
|
||||||
|
"content": {
|
||||||
|
"kind": "git",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-creation.git",
|
||||||
|
"ref": "f44e7f53ba928b77ce30db843a1d17d6c3163d52"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"governance": {
|
||||||
|
"stewardship": "pointer",
|
||||||
|
"availability": "installable",
|
||||||
|
"redistribution": "source-pointer-only",
|
||||||
|
"listingMaintainer": {
|
||||||
|
"name": "DesireCore Registry maintainers",
|
||||||
|
"url": "https://github.com/desirecore/registry"
|
||||||
|
},
|
||||||
|
"upstreamMaintainer": {
|
||||||
|
"name": "desirecore-agent",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-creation"
|
||||||
|
},
|
||||||
|
"branding": {
|
||||||
|
"relationship": "independent-listing",
|
||||||
|
"nameUsage": "nominative",
|
||||||
|
"logoStatus": "not-used"
|
||||||
|
},
|
||||||
|
"compliance": {
|
||||||
|
"licenseEvidencePath": "LICENSE",
|
||||||
|
"noticePath": "THIRD_PARTY_NOTICES.md",
|
||||||
|
"reviewedRef": "f44e7f53ba928b77ce30db843a1d17d6c3163d52",
|
||||||
|
"reviewedAt": "2026-10-25",
|
||||||
|
"reviewedBy": "repository-and-runtime-validation (see review.md)",
|
||||||
|
"upstreamEndorsed": false
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"state": "known",
|
||||||
|
"value": "MIT",
|
||||||
|
"evidencePath": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compatibility": {
|
||||||
|
"platforms": {
|
||||||
|
"state": "known",
|
||||||
|
"values": [
|
||||||
|
"windows",
|
||||||
|
"macos",
|
||||||
|
"linux"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"requiredClientVersion": "10.0.186"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"kind": "app",
|
||||||
|
"category": "tools",
|
||||||
|
"placementPolicy": {
|
||||||
|
"showInMyApps": true,
|
||||||
|
"allowNavPin": true,
|
||||||
|
"allowAgentBinding": true
|
||||||
|
},
|
||||||
|
"productKind": "application",
|
||||||
|
"entrypointKinds": [
|
||||||
|
"agent"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# 视频创作:安装、更新与卸载
|
||||||
|
|
||||||
|
本条目固定源码提交,不携带用户配置、模型额度、素材或已安装事实。安装者先读取同目录manifest.json、review.md以及固定源的LICENSE、TRADEMARK.md、THIRD_PARTY_NOTICES.md和desirecore/RUNTIME.md。浏览器、字体、FFmpeg及可选媒体服务按各自实际许可和费用使用;目录元数据不授予文件、工具或模型权限。
|
||||||
|
|
||||||
|
## 准备固定材料
|
||||||
|
|
||||||
|
使用manifest.source.url克隆到安装者自己的源码目录,检出manifest.source.ref的完整提交,核对Git对象与许可。不要从可变main、未核验镜像或上游原版替代。需要Node.js >=22.18与pnpm 9.15.9,在该固定源码根执行:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
pnpm build
|
||||||
|
node desirecore/release.mjs --output <新的材料目录>
|
||||||
|
```
|
||||||
|
|
||||||
|
生成器提供app-authoring-v1清单与明确列出的运行payload,不登记或启动应用。材料不含node_modules、用户工程、身份、凭据或安装ledger;用清单逐文件摘要核验,包含完整运行依赖LICENSE/NOTICE。实际生成内容与已审源不符时停止,不篡改清单迁就。
|
||||||
|
|
||||||
|
## 正式安装
|
||||||
|
|
||||||
|
先GET平台公开的/apps/authoring/capabilities(实际路由前缀以平台合同为准),确认app-authoring-v1的release和runtime-binding均supported、authorized、available。条目采用10.0.186作为已验证支持下限,不表示所有同版本构建的能力都已启用;缺失时报告需要兼容客户端,不伪装成Docker、MCP或已安装应用。
|
||||||
|
|
||||||
|
沿当前平台正式prepare、原owner的真实Bash/TaskHost接纳、runtime/contracts、commit流程,参数遵循公开Schema和RUNTIME.md。安装目标沿当前目录来源与稳定appId=video-creation解析;已有安装则使用其实际installationId和expectedRevision,不新建第二条事实或换来源覆盖。
|
||||||
|
|
||||||
|
本目录安装约定Studio管理端口为6390、只读影片origin为相邻6391,均仅回环。这是目录声明的可调安装约定;源码CLI默认port0动态分配,不能拿目录值当在线端口。端口占用时,原owner可选择另一对实际可用连续端口,检查两者并把真实端口写入正式运行合同;不要结束别人的进程。
|
||||||
|
|
||||||
|
在平台返回的固定材料根准备prod依赖,并在明确候选home中setup-runtime;浏览器与FFmpeg可能需首次下载。通过原owner执行候选start命令并保存实际terminalId、端口及身份路径/api/desirecore/runtime-identity。正式commit前由原owner关闭候选,确认精确进程及端口退出。正式启动使用平台登记的数据根与注入的PORT,核当前release/revision/generation的binding和实际页面;激活available、安装核验记录或HTTP200单项不等于完整可用。
|
||||||
|
|
||||||
|
视频导演单独从市场安装。只从真实安装结果读Agent ID,沿正式配置和弱关联流程接线;不把显示名、仓库slug或个人ID写进公共包。顶层AppHost使用有限桥,交接需宿主真实确认;影片iframe不获得平台权限。
|
||||||
|
|
||||||
|
## 更新和卸载
|
||||||
|
|
||||||
|
更新前核真实实例、活动Actor/审批/导出/审片队列与未保存工作,保留当前工程及人工参数、DOM和锁。正常AppStop、核精确端口退出后,再prepare固定新源、比较数据合同并以expectedRevision CAS更新;响应未知先查询原submissionId,不重复登记。用户工程、偏好、身份、凭据和ledger不手写、不复制覆盖。更新Agent内容沿平台Git更新/冲突合并,保留本地修改与偏好。
|
||||||
|
|
||||||
|
卸载先停止该精确安装,使用正式卸载入口;数据合同默认保留数据。作品与素材不属于release文件,不能随材料清理顺手删除。目录本身不删除或更改用户数据。
|
||||||
|
|
||||||
|
English: Install the exact pinned source using existing app-authoring-v1 prepare, owner admission, runtime contract and CAS commit. Node/pnpm/browser/FFmpeg are separate prerequisites; optional model/media licenses and costs are not bundled. Ports6390/6391 are adjustable catalog installation defaults, while the CLI defaults to automatic allocation. Use actual receipts, preserve human edits and app data, query uncertain submissions, and uninstall through the precise lifecycle owner. No internal MCP registration or permission grant is implied.
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"id": "video-creation",
|
||||||
|
"name": "视频创作",
|
||||||
|
"type": "native-app",
|
||||||
|
"version": "0.3.0",
|
||||||
|
"author": "desirecore-agent",
|
||||||
|
"description": "可编辑影片、原创动效和带版本时点的真实画面审片;与视频导演协作并保留人工修改。",
|
||||||
|
"shortDesc": "可编辑影片、原创动效和带版本时点的真实画面审片;与视频导演协作并保留人工修改。",
|
||||||
|
"fullDesc": "可编辑影片、原创动效和带版本时点的真实画面审片;与视频导演协作并保留人工修改。 复用OpenFilm渲染与编辑内核,支持HTML/SVG/Canvas/WebGL自主场景、时间窗总览、多尺寸与修订对照。需单独准备Node.js、pnpm、浏览器和FFmpeg;可选生成服务的许可、账户与费用另计。安装前检查app-authoring-v1的release/runtime-binding能力;目录来源或端口声明不等于已安装、已授权或当前在线。",
|
||||||
|
"tags": [
|
||||||
|
"video",
|
||||||
|
"motion",
|
||||||
|
"editing",
|
||||||
|
"visual-review"
|
||||||
|
],
|
||||||
|
"icon": "film",
|
||||||
|
"iconLetter": "影",
|
||||||
|
"platformSupport": [
|
||||||
|
"windows",
|
||||||
|
"macos",
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"category": "tools",
|
||||||
|
"githubUrl": "https://github.com/desirecore-agent/video-creation",
|
||||||
|
"requiredClientVersion": "10.0.186",
|
||||||
|
"install": {
|
||||||
|
"method": "native-node",
|
||||||
|
"requirements": {
|
||||||
|
"docker": false,
|
||||||
|
"node": ">=22.18",
|
||||||
|
"minMemory": "未声明固定最低值;渲染开销随影片内容和尺寸变化。",
|
||||||
|
"minDisk": "未声明固定最低值;需按浏览器、依赖、素材和输出实际空间核对。",
|
||||||
|
"ports": [
|
||||||
|
6390
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configNeeded": [
|
||||||
|
"pnpm 9.15.9、浏览器与FFmpeg运行依赖;不包含模型额度或付费媒体服务。",
|
||||||
|
"本目录安装约定管理端口6390、只读影片端口6391;这是可调安装约定,源码CLI默认port0。若占用,可由原owner选择可用连续端口,以正式运行回执记录实际端口。",
|
||||||
|
"支持app-authoring-v1的release/runtime-binding能力;先检查公开capabilities,缺失时停止并报告需要升级。"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"placementPolicy": {
|
||||||
|
"showInMyApps": true,
|
||||||
|
"allowNavPin": true,
|
||||||
|
"allowAgentBinding": true
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"kind": "git",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-creation.git",
|
||||||
|
"ref": "f44e7f53ba928b77ce30db843a1d17d6c3163d52"
|
||||||
|
},
|
||||||
|
"stewardship": "pointer",
|
||||||
|
"availability": "installable",
|
||||||
|
"license": "MIT",
|
||||||
|
"redistribution": "source-pointer-only",
|
||||||
|
"listingMaintainer": {
|
||||||
|
"name": "DesireCore Registry maintainers",
|
||||||
|
"url": "https://github.com/desirecore/registry"
|
||||||
|
},
|
||||||
|
"upstreamMaintainer": {
|
||||||
|
"name": "desirecore-agent",
|
||||||
|
"url": "https://github.com/desirecore-agent/video-creation"
|
||||||
|
},
|
||||||
|
"branding": {
|
||||||
|
"relationship": "independent-listing",
|
||||||
|
"nameUsage": "nominative",
|
||||||
|
"logoStatus": "not-used"
|
||||||
|
},
|
||||||
|
"compliance": {
|
||||||
|
"licenseEvidencePath": "LICENSE",
|
||||||
|
"noticePath": "THIRD_PARTY_NOTICES.md",
|
||||||
|
"reviewedRef": "f44e7f53ba928b77ce30db843a1d17d6c3163d52",
|
||||||
|
"reviewedAt": "2026-10-25",
|
||||||
|
"reviewedBy": "repository-and-runtime-validation (see review.md)",
|
||||||
|
"upstreamEndorsed": false
|
||||||
|
},
|
||||||
|
"entrypoints": [
|
||||||
|
{
|
||||||
|
"id": "manage",
|
||||||
|
"name": "委派Agent安装、打开与维护视频创作",
|
||||||
|
"kind": "agent"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# 固定源审阅边界
|
||||||
|
|
||||||
|
- 产品源码固定为manifest.source.ref;0.3.0取自该源码package声明,不捏造新的上游发布号。此目录为源码指针,没有另发二进制Release或打包上游桌面版。
|
||||||
|
- 源码保留OpenFilm历史、MIT、TRADEMARK与第三方通知,使用独立产品名和自身发行流程;可选媒体服务、浏览器、字体和编解码器许可另按实际组件处理。
|
||||||
|
- 固定源经core与Linux runtime的PR检查后实际合并,自然main检查单独归源,不挪作合并前门槛。已记录macOS正式受管应用/导演审片、版本与时间点、图片字节、原片及人工锁保留;本次新增CLI副本能力在隔离macOS中以冻结候选客户端连接兼容的已安装服务端,实际读取既有三图,未把候选冒称新服务端安装。Linux运行和macOS原生分源,不推广为新版Windows/Linux GUI验收。
|
||||||
|
- 已验证构建为DesireCore10.0.186,目录要求实际app-authoring-v1能力准入。代码默认动态port0;目录安装材料选择6390作为可调管理端口约定,并披露相邻只读影片端口6391。实际端口、安装、授权与健康仍由正式运行合同和回执决定。
|
||||||
|
- 不复制用户影片、私人部署路径、身份、凭据、审片记录或运行标识到公共目录。目录发布本身不改生产安装,不默认创建模型、启用外部服务或注册内部MCP。
|
||||||
|
|
||||||
|
English: The catalog pins reviewed source, preserves upstream provenance and notices, and declares a tested client floor rather than a client release promise. Runtime ports and readiness require actual lifecycle evidence. Platform-specific validation stays scoped; private projects and runtime identifiers are not published here.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# 视频创作使用
|
||||||
|
|
||||||
|
从真实安装的应用入口打开工程,film.html仍是唯一时间线;支持自主HTML/CSS/SVG/Canvas/WebGL场景,也可使用构件与组合,不要求字幕或预设模板。人工参数、DOM overrides及锁保持各自权威。
|
||||||
|
|
||||||
|
先用公开review --schema发现实际合同。工程顶部“审片”可选择带版本和实际时点的观察材料、点总览格、放大已有PNG,并播放仍核验匹配的历史输出。只有已保存版本、静态源输入与可证明时间映射都匹配时,才允许跳当前工程;缺失明确unknown,不猜时间。
|
||||||
|
|
||||||
|
可选data-review-intent按唯一Draft-07Schema记录目标宽度和必要/辅助/装饰信息,它帮助理解用途,不命令删字、排版或改锁。时间窗序列、同捕获尺寸对照和已有两版review-pair沿同一个review入口;对照复用原PNG,不再渲染。每侧来源、版本、实际时间、原图尺寸与摘要独立记录;数字秒数相同不保证语义对齐,数据变化不自动证明画面改善。
|
||||||
|
|
||||||
|
导演应对必要图片以完整expected_sha256实际Read,再结合可见像素给出意见;生成回执或HTTP成功不等于已经看图。可选用CLI的--copy-to把核SHA的PNG副本保存到已授权工作目录,用--read <reviewId>读取既有材料而不重新捕获;也可只登记必要的精确制品目录。副本不授予目录权限,不预授权整个应用数据根,文件冲突不覆盖。导出先固定输入快照,读取真实jobs终态;超时未知先查原任务,不重提付费或耗时工作。
|
||||||
|
|
||||||
|
新建付费媒体、外部生成服务或模型调用遵循平台原许可、审批和费用边界。若缺依赖、权限或证据,保留工程并报告可恢复的缺项,不伪称成功。技术量值不是审美、节奏、字形对比度或听感认证。
|
||||||
|
|
||||||
|
English: Use the installed app and public review contract. Original scenes and human locks remain editable under their existing rules. Review materials retain source/version/time/size identity; comparisons reuse existing PNGs. Optionally copy existing review PNGs into an already authorized workspace with --read/--copy-to, without permission grants or recapture. Read required images with exact digests, verify current inputs before engineering seek, preserve unknown mappings, and use real job receipts for completion. Optional model/media services, licensing, approvals and costs remain separate.
|
||||||
+4
-4
@@ -6,12 +6,12 @@
|
|||||||
"description": "DesireCore 官方注册表 — 应用、插件、MCP 服务、HTTP API 和第三方外部集成的统一目录",
|
"description": "DesireCore 官方注册表 — 应用、插件、MCP 服务、HTTP API 和第三方外部集成的统一目录",
|
||||||
"maintainer": "DesireCore Team",
|
"maintainer": "DesireCore Team",
|
||||||
"repository": "https://github.com/desirecore/registry",
|
"repository": "https://github.com/desirecore/registry",
|
||||||
"lastUpdated": "2026-10-13",
|
"lastUpdated": "2026-11-03",
|
||||||
"stats": {
|
"stats": {
|
||||||
"totalEntries": 24,
|
"totalEntries": 27,
|
||||||
"dockerApps": 8,
|
"dockerApps": 8,
|
||||||
"nativeApps": 1,
|
"nativeApps": 3,
|
||||||
"mcpServices": 9,
|
"mcpServices": 10,
|
||||||
"httpApis": 5,
|
"httpApis": 5,
|
||||||
"externalIntegrations": 1
|
"externalIntegrations": 1
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"validate": "node scripts/validate-registry.mjs",
|
"validate": "node scripts/validate-registry.mjs",
|
||||||
"test": "node --test scripts/validate-registry.test.mjs scripts/native-app.test.mjs scripts/plugin-contract.test.mjs scripts/application-authoring.test.mjs && npm run validate"
|
"test": "node --test scripts/validate-registry.test.mjs scripts/native-app.test.mjs scripts/plugin-contract.test.mjs scripts/authored-release.test.mjs scripts/application-authoring.test.mjs && npm run validate"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ajv": "8.20.0"
|
"ajv": "8.20.0"
|
||||||
|
|||||||
@@ -0,0 +1,138 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
"type": "object",
|
||||||
|
"description": "MCP 包来源自动审核回执;与实际条目、包版本、制品摘要和审核日期做额外语义绑定。",
|
||||||
|
"required": [
|
||||||
|
"schemaVersion",
|
||||||
|
"reviewer",
|
||||||
|
"reviewedAt",
|
||||||
|
"entryId",
|
||||||
|
"previousVersion",
|
||||||
|
"version",
|
||||||
|
"packageName",
|
||||||
|
"ecosystem",
|
||||||
|
"sourceUrl",
|
||||||
|
"artifactUrl",
|
||||||
|
"contentSha256",
|
||||||
|
"licenseEvidenceSha256",
|
||||||
|
"checks",
|
||||||
|
"limitations"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"$schema": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "本地审核记录 Schema 引用。"
|
||||||
|
},
|
||||||
|
"schemaVersion": {
|
||||||
|
"const": 1,
|
||||||
|
"description": "机器审核记录版本。"
|
||||||
|
},
|
||||||
|
"reviewer": {
|
||||||
|
"const": "automated:mcp-package-source-v1",
|
||||||
|
"description": "明确的机器审核身份,不冒充人工或上游背书。"
|
||||||
|
},
|
||||||
|
"reviewedAt": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
|
||||||
|
"description": "实际完成机械核验的 UTC 时间。"
|
||||||
|
},
|
||||||
|
"entryId": {
|
||||||
|
"type": "string",
|
||||||
|
"minLength": 1,
|
||||||
|
"description": "受审核的 Registry MCP 条目 ID。"
|
||||||
|
},
|
||||||
|
"previousVersion": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^\\d+(?:\\.\\d+){1,3}$",
|
||||||
|
"description": "已有准入证据的原发行版本。"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^\\d+(?:\\.\\d+){1,3}$",
|
||||||
|
"description": "核验的新固定发行版本。"
|
||||||
|
},
|
||||||
|
"packageName": {
|
||||||
|
"type": "string",
|
||||||
|
"minLength": 1,
|
||||||
|
"description": "安装和连接配置共同使用的包身份。"
|
||||||
|
},
|
||||||
|
"ecosystem": {
|
||||||
|
"enum": [
|
||||||
|
"npm",
|
||||||
|
"pypi"
|
||||||
|
],
|
||||||
|
"description": "已实现制品机械核验的包注册表。"
|
||||||
|
},
|
||||||
|
"sourceUrl": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri",
|
||||||
|
"description": "与 sidecar provenance 完全相同的包主页身份。"
|
||||||
|
},
|
||||||
|
"artifactUrl": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri",
|
||||||
|
"description": "本次实际读取并核对摘要的官方固定制品 URL。"
|
||||||
|
},
|
||||||
|
"contentSha256": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[a-f0-9]{64}$",
|
||||||
|
"description": "实际制品字节 SHA-256,与目录记录绑定。"
|
||||||
|
},
|
||||||
|
"licenseEvidenceSha256": {
|
||||||
|
"type": "object",
|
||||||
|
"minProperties": 1,
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[a-f0-9]{64}$"
|
||||||
|
},
|
||||||
|
"propertyNames": {
|
||||||
|
"pattern": "^(?![\\\\/])(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\]+$"
|
||||||
|
},
|
||||||
|
"description": "包内许可证和第三方声明的实际路径与摘要,不复制许可正文。"
|
||||||
|
},
|
||||||
|
"checks": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"publishedIntegrity",
|
||||||
|
"previousCatalogDigest",
|
||||||
|
"boundedOrdinaryFiles",
|
||||||
|
"licenseAndNoticeUnchanged",
|
||||||
|
"structuredPrerequisitesUnchanged",
|
||||||
|
"pinnedLaunchSelectors"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"publishedIntegrity": {
|
||||||
|
"const": true
|
||||||
|
},
|
||||||
|
"previousCatalogDigest": {
|
||||||
|
"const": true
|
||||||
|
},
|
||||||
|
"boundedOrdinaryFiles": {
|
||||||
|
"const": true
|
||||||
|
},
|
||||||
|
"licenseAndNoticeUnchanged": {
|
||||||
|
"const": true
|
||||||
|
},
|
||||||
|
"structuredPrerequisitesUnchanged": {
|
||||||
|
"const": true
|
||||||
|
},
|
||||||
|
"pinnedLaunchSelectors": {
|
||||||
|
"const": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "仅列本版本实际实现并完成的检查。新增检查必须同时实现,不能由 Schema 自动声明通过。"
|
||||||
|
},
|
||||||
|
"limitations": {
|
||||||
|
"type": "array",
|
||||||
|
"minItems": 1,
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"minLength": 1
|
||||||
|
},
|
||||||
|
"description": "来源核验、软件运行和供应链认证的边界。"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
@@ -3477,7 +3477,6 @@
|
|||||||
"schemaVersion",
|
"schemaVersion",
|
||||||
"releaseDigest",
|
"releaseDigest",
|
||||||
"manifestPath",
|
"manifestPath",
|
||||||
"definitionPath",
|
|
||||||
"requiredCapabilities"
|
"requiredCapabilities"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -3502,6 +3501,10 @@
|
|||||||
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*[\\\\\\x00-\\x1f])[^?#]+$",
|
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*[\\\\\\x00-\\x1f])[^?#]+$",
|
||||||
"description": "同一 release 文件清单中的作者定义路径;相对 POSIX 路径,禁止宿主路径、穿越和 URL。"
|
"description": "同一 release 文件清单中的作者定义路径;相对 POSIX 路径,禁止宿主路径、穿越和 URL。"
|
||||||
},
|
},
|
||||||
|
"definitionSource": {
|
||||||
|
"const": "manifest",
|
||||||
|
"description": "作者定义直接来自已核验 app-release.json 的 definition;包中不另外声明 definition 文件。"
|
||||||
|
},
|
||||||
"requiredCapabilities": {
|
"requiredCapabilities": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"minItems": 1,
|
"minItems": 1,
|
||||||
@@ -3532,6 +3535,30 @@
|
|||||||
"description": "仅容器release从同一delivery映射的固定镜像依赖;不包含登录凭据,不假定本机Docker可用。"
|
"description": "仅容器release从同一delivery映射的固定镜像依赖;不包含登录凭据,不假定本机Docker可用。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"required": [
|
||||||
|
"definitionPath"
|
||||||
|
],
|
||||||
|
"not": {
|
||||||
|
"required": [
|
||||||
|
"definitionSource"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "兼容已有包内独立作者定义文件。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"required": [
|
||||||
|
"definitionSource"
|
||||||
|
],
|
||||||
|
"not": {
|
||||||
|
"required": [
|
||||||
|
"definitionPath"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "使用 release 清单中的内联作者定义,不能同时声称存在独立文件。"
|
||||||
|
}
|
||||||
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"webBundle": {
|
"webBundle": {
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import assert from 'node:assert/strict'
|
import assert from 'node:assert/strict'
|
||||||
import { readFileSync, cpSync, mkdtempSync, writeFileSync, rmSync } from 'node:fs'
|
import { spawnSync } from 'node:child_process'
|
||||||
|
import { createHash } from 'node:crypto'
|
||||||
|
import { readFileSync, readdirSync, existsSync, cpSync, mkdtempSync, writeFileSync, rmSync } from 'node:fs'
|
||||||
import { dirname, join } from 'node:path'
|
import { dirname, join } from 'node:path'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { test, afterEach } from 'node:test'
|
import { test, afterEach } from 'node:test'
|
||||||
import Ajv from 'ajv'
|
import Ajv from 'ajv'
|
||||||
import { validateRegistry } from './catalog/validator.mjs'
|
import { validateRegistry } from './catalog/validator.mjs'
|
||||||
import { validateApplicationReleaseContract } from './catalog/application-release-contract.mjs'
|
import { validateApplicationContract } from './catalog/application-contract.mjs'
|
||||||
|
|
||||||
const source = join(dirname(fileURLToPath(import.meta.url)),'..')
|
const source = join(dirname(fileURLToPath(import.meta.url)),'..')
|
||||||
const temporary = []
|
const temporary = []
|
||||||
@@ -15,12 +17,13 @@ const schema = JSON.parse(readFileSync(join(source,'schemas/registry-entry.v4.3.
|
|||||||
const validate = new Ajv({allErrors:true,strict:true,strictTypes:false,strictRequired:false,validateFormats:false}).compile(schema)
|
const validate = new Ajv({allErrors:true,strict:true,strictTypes:false,strictRequired:false,validateFormats:false}).compile(schema)
|
||||||
const load = id => JSON.parse(readFileSync(join(source,'fixtures/authoring/entries',id,'manifest.json'),'utf8'))
|
const load = id => JSON.parse(readFileSync(join(source,'fixtures/authoring/entries',id,'manifest.json'),'utf8'))
|
||||||
|
|
||||||
test('4.3只新增候选文件和合成fixtures,正式4.2目录不提前激活新格式',() => {
|
test('根格式仍为4.2,作者Schema保持主仓固定字节,合成fixtures不进入正式目录',() => {
|
||||||
const root = JSON.parse(readFileSync(join(source,'manifest.json'),'utf8'))
|
const root = JSON.parse(readFileSync(join(source,'manifest.json'),'utf8'))
|
||||||
assert.equal(root.version,'4.2.0')
|
assert.equal(root.version,'4.2.0')
|
||||||
assert.equal(readFileSync(join(source,'SCHEMA_VERSION'),'utf8').trim(),'4.2.0')
|
assert.equal(readFileSync(join(source,'SCHEMA_VERSION'),'utf8').trim(),'4.2.0')
|
||||||
assert.equal(root.stats.totalEntries,24)
|
|
||||||
assert.equal(root.stats.webBundles,undefined)
|
assert.equal(root.stats.webBundles,undefined)
|
||||||
|
assert.equal(createHash('sha256').update(readFileSync(join(source,'schemas/registry-entry.v4.3.schema.json'))).digest('hex'),'95afcffce0c985215685554ec8b3f5e3012036bf2c4ecc4214c23e4eff895b10')
|
||||||
|
for (const id of readdirSync(join(source,'fixtures/authoring/entries'))) assert.equal(existsSync(join(source,'entries',id)),false,id)
|
||||||
})
|
})
|
||||||
test('静态与带服务合成目录三文件保持App语义,两个validator同样通过',() => {
|
test('静态与带服务合成目录三文件保持App语义,两个validator同样通过',() => {
|
||||||
const root = mkdtempSync(join(tmpdir(),'registry-authoring-'));temporary.push(root)
|
const root = mkdtempSync(join(tmpdir(),'registry-authoring-'));temporary.push(root)
|
||||||
@@ -34,9 +37,11 @@ test('静态与带服务合成目录三文件保持App语义,两个validator
|
|||||||
const report = validateRegistry(root)
|
const report = validateRegistry(root)
|
||||||
assert.equal(report.ok,true,JSON.stringify(report.errors))
|
assert.equal(report.ok,true,JSON.stringify(report.errors))
|
||||||
assert.equal(report.counts.webBundles,1)
|
assert.equal(report.counts.webBundles,1)
|
||||||
|
const cli = spawnSync(process.execPath,[join(source,'scripts/validate-registry.mjs'),'--root',root],{encoding:'utf8'})
|
||||||
|
assert.equal(cli.status,0,cli.stdout+cli.stderr)
|
||||||
for (const id of ['static-workbench-example','service-workbench-example','docker-workbench-example']) {
|
for (const id of ['static-workbench-example','service-workbench-example','docker-workbench-example']) {
|
||||||
const item=load(id);assert.equal(validate(item),true,JSON.stringify(validate.errors))
|
const item=load(id);assert.equal(validate(item),true,JSON.stringify(validate.errors))
|
||||||
assert.deepEqual(validateApplicationReleaseContract(item),[])
|
assert.deepEqual(validateApplicationContract(item),[])
|
||||||
assert.equal(item.sourceId,undefined)
|
assert.equal(item.sourceId,undefined)
|
||||||
assert.notEqual(item.appRelease.releaseDigest,item.source.sha256)
|
assert.notEqual(item.appRelease.releaseDigest,item.source.sha256)
|
||||||
assert.equal(item.availability,'listing-only')
|
assert.equal(item.availability,'listing-only')
|
||||||
@@ -51,9 +56,19 @@ test('不能把完整HTML伪装成artifact、native-node或内部MCP服务',() =
|
|||||||
test('未知能力、可变ref和私有凭据不成为正式分发事实',() => {
|
test('未知能力、可变ref和私有凭据不成为正式分发事实',() => {
|
||||||
const item=load('static-workbench-example')
|
const item=load('static-workbench-example')
|
||||||
for (const change of [copy=>{copy.source.ref='latest'},copy=>{copy.source.url='https://credential@git.example.test/private.zip'},copy=>{copy.appRelease.requiredCapabilities=['app-authoring-v1']}]) {
|
for (const change of [copy=>{copy.source.ref='latest'},copy=>{copy.source.url='https://credential@git.example.test/private.zip'},copy=>{copy.appRelease.requiredCapabilities=['app-authoring-v1']}]) {
|
||||||
const copy=structuredClone(item);change(copy);assert.ok(validateApplicationReleaseContract(copy).length>0)
|
const copy=structuredClone(item);change(copy);assert.ok(validateApplicationContract(copy).length>0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
test('definitionPath声明时必须是规范相对路径,内联定义不要求该字段',() => {
|
||||||
|
const item=load('service-workbench-example')
|
||||||
|
for (const path of ['C:/application.json','runtime//application.json','../application.json']) {
|
||||||
|
const copy=structuredClone(item);copy.appRelease.definitionPath=path
|
||||||
|
assert.ok(validateApplicationContract(copy).length>0,path)
|
||||||
|
}
|
||||||
|
const inline=structuredClone(item);delete inline.appRelease.definitionPath;inline.appRelease.definitionSource='manifest'
|
||||||
|
assert.equal(validate(inline),true,JSON.stringify(validate.errors))
|
||||||
|
assert.deepEqual(validateApplicationContract(inline),[])
|
||||||
|
})
|
||||||
test('保留既有native-node条目,新native release字段不污染旧分支',() => {
|
test('保留既有native-node条目,新native release字段不污染旧分支',() => {
|
||||||
const old=JSON.parse(readFileSync(join(source,'entries/desirecore-control/manifest.json'),'utf8'))
|
const old=JSON.parse(readFileSync(join(source,'entries/desirecore-control/manifest.json'),'utf8'))
|
||||||
assert.equal(validate(old),true,JSON.stringify(validate.errors))
|
assert.equal(validate(old),true,JSON.stringify(validate.errors))
|
||||||
@@ -66,6 +81,6 @@ test('Docker发布固定真实镜像内容引用,不把浮动tag或错误端
|
|||||||
assert.equal(item.install.method,'release');assert.equal(item.install.requirements.docker,true)
|
assert.equal(item.install.method,'release');assert.equal(item.install.requirements.docker,true)
|
||||||
for (const image of ['node:latest','registry.example.test/example/app:1.0.0','localhost:70000/app@sha256:'+'d'.repeat(64)]) {
|
for (const image of ['node:latest','registry.example.test/example/app:1.0.0','localhost:70000/app@sha256:'+'d'.repeat(64)]) {
|
||||||
const copy=structuredClone(item);copy.appRelease.imageRefs=[image]
|
const copy=structuredClone(item);copy.appRelease.imageRefs=[image]
|
||||||
assert.ok(!validate(copy) || validateApplicationReleaseContract(copy).length>0)
|
assert.ok(!validate(copy) || validateApplicationContract(copy).length>0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { afterEach, test } from 'node:test'
|
||||||
|
import { cpSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'
|
||||||
|
import { createHash } from 'node:crypto'
|
||||||
|
import { dirname, join, resolve } from 'node:path'
|
||||||
|
import { tmpdir } from 'node:os'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
import { spawnSync } from 'node:child_process'
|
||||||
|
import { validateRegistry } from './catalog/validator.mjs'
|
||||||
|
import { validateJsonSchema } from './catalog/json-schema.mjs'
|
||||||
|
|
||||||
|
const source = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||||
|
const temporary = []
|
||||||
|
const entryFile = 'entries/desirecore-control/manifest.json'
|
||||||
|
const sidecarFile = 'entries/desirecore-control/catalog-metadata.v1.json'
|
||||||
|
afterEach(() => { for (const root of temporary.splice(0)) rmSync(root, { recursive: true, force: true }) })
|
||||||
|
|
||||||
|
function mutate(root, file, change) {
|
||||||
|
const path = join(root, file)
|
||||||
|
const data = JSON.parse(readFileSync(path, 'utf8'))
|
||||||
|
change(data)
|
||||||
|
writeFileSync(path, JSON.stringify(data))
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixture(type = 'native-app') {
|
||||||
|
const root = mkdtempSync(join(tmpdir(), 'registry-authored-'))
|
||||||
|
temporary.push(root)
|
||||||
|
cpSync(join(source, 'schemas'), join(root, 'schemas'), { recursive: true })
|
||||||
|
cpSync(join(source, 'entries/desirecore-control'), join(root, 'entries/desirecore-control'), { recursive: true })
|
||||||
|
const manifest = JSON.parse(readFileSync(join(source, 'manifest.json'), 'utf8'))
|
||||||
|
manifest.stats = { totalEntries: 1, dockerApps: 0, nativeApps: type === 'native-app' ? 1 : 0, ...(type === 'web-bundle' ? { webBundles: 1 } : {}), mcpServices: 0, httpApis: 0, externalIntegrations: 0 }
|
||||||
|
writeFileSync(join(root, 'manifest.json'), JSON.stringify(manifest))
|
||||||
|
writeFileSync(join(root, 'SCHEMA_VERSION'), manifest.version + '\n')
|
||||||
|
// 测试 release 引用仅用于校验分支;不代表线上 Control 已发布此 release。
|
||||||
|
mutate(root, entryFile, entry => {
|
||||||
|
entry.type = type
|
||||||
|
entry.install.method = type === 'web-bundle' ? 'web-bundle' : 'release'
|
||||||
|
if (type === 'web-bundle') entry.install.requirements = { docker: false, ports: [] }
|
||||||
|
entry.entrypoints = [{ id: 'editor', name: 'Editor', kind: 'embedded-web', serviceRef: 'demo:editor' }]
|
||||||
|
entry.appRelease = {
|
||||||
|
schemaVersion: 1,
|
||||||
|
releaseDigest: 'a'.repeat(64),
|
||||||
|
manifestPath: 'app-release.json',
|
||||||
|
definitionSource: 'manifest',
|
||||||
|
requiredCapabilities: ['app-authoring-v1', 'release', ...(type === 'web-bundle' ? ['web-bundle'] : [])],
|
||||||
|
}
|
||||||
|
})
|
||||||
|
mutate(root, sidecarFile, sidecar => { sidecar.spec.entrypointKinds = ['embedded-web'] })
|
||||||
|
return root
|
||||||
|
}
|
||||||
|
|
||||||
|
function result(root) {
|
||||||
|
const cli = spawnSync(process.execPath, [join(source, 'scripts/validate-registry.mjs'), '--root', root], { encoding: 'utf8' })
|
||||||
|
return { cli, offline: validateRegistry(root) }
|
||||||
|
}
|
||||||
|
function expectValid(root) {
|
||||||
|
const report = result(root)
|
||||||
|
assert.equal(report.cli.status, 0, report.cli.stderr)
|
||||||
|
assert.equal(report.offline.ok, true, JSON.stringify(report.offline.errors))
|
||||||
|
}
|
||||||
|
function expectInvalid(root) {
|
||||||
|
const report = result(root)
|
||||||
|
assert.equal(report.cli.status, 1, report.cli.stdout + report.cli.stderr)
|
||||||
|
assert.equal(report.offline.ok, false, JSON.stringify(report.offline))
|
||||||
|
}
|
||||||
|
|
||||||
|
test('官方根仍为4.2且global Schema保留已发布原字节', () => {
|
||||||
|
assert.equal(readFileSync(join(source, 'SCHEMA_VERSION'), 'utf8'), '4.2.0\n')
|
||||||
|
assert.equal(createHash('sha256').update(readFileSync(join(source, 'schemas/registry-entry.schema.json'))).digest('hex'), 'ea63d6305ae17994e595aea009a131c41300d2b7fdb07ec83cc2c19c37b32038')
|
||||||
|
})
|
||||||
|
for (const type of ['native-app', 'web-bundle']) test('两个入口接受固定内联定义 ' + type, () => { expectValid(fixture(type)) })
|
||||||
|
test('旧独立definitionPath分支继续通过', () => {
|
||||||
|
const root = fixture()
|
||||||
|
mutate(root, entryFile, entry => { delete entry.appRelease.definitionSource; entry.appRelease.definitionPath = 'definition.json' })
|
||||||
|
expectValid(root)
|
||||||
|
})
|
||||||
|
test('普通条目与external-integration不被作者Schema重定义', () => {
|
||||||
|
const root = mkdtempSync(join(tmpdir(), 'registry-global-'))
|
||||||
|
temporary.push(root)
|
||||||
|
for (const path of ['entries', 'schemas']) cpSync(join(source, path), join(root, path), { recursive: true })
|
||||||
|
for (const path of ['SCHEMA_VERSION', 'manifest.json']) cpSync(join(source, path), join(root, path))
|
||||||
|
for (const id of readdirSync(join(root, 'entries'))) {
|
||||||
|
const entry = JSON.parse(readFileSync(join(root, 'entries', id, 'manifest.json'), 'utf8'))
|
||||||
|
if (entry.type === 'web-bundle' || Object.hasOwn(entry, 'appRelease')) {
|
||||||
|
rmSync(join(root, 'entries', id), { recursive: true })
|
||||||
|
mutate(root, 'manifest.json', manifest => {
|
||||||
|
manifest.stats.totalEntries -= 1
|
||||||
|
const stat = { 'native-app': 'nativeApps', 'docker-app': 'dockerApps' }[entry.type]
|
||||||
|
if (stat) manifest.stats[stat] -= 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writeFileSync(join(root, 'schemas/registry-entry.v4.3.schema.json'), 'false\n')
|
||||||
|
expectValid(root)
|
||||||
|
writeFileSync(join(root, 'schemas/registry-entry.schema.json'), 'false\n')
|
||||||
|
expectInvalid(root)
|
||||||
|
})
|
||||||
|
test('作者Schema拒绝时不回退global', () => {
|
||||||
|
const root = fixture()
|
||||||
|
writeFileSync(join(root, 'schemas/registry-entry.v4.3.schema.json'), 'false\n')
|
||||||
|
expectInvalid(root)
|
||||||
|
})
|
||||||
|
for (const invalid of ['null', '[]', '42']) test('两个入口拒绝非法作者Schema根 ' + invalid, () => {
|
||||||
|
const root = fixture()
|
||||||
|
writeFileSync(join(root, 'schemas/registry-entry.v4.3.schema.json'), invalid + '\n')
|
||||||
|
expectInvalid(root)
|
||||||
|
})
|
||||||
|
test('离线contains匹配实际元素并拒绝空数组与缺失能力', () => {
|
||||||
|
const schema = { type: 'array', contains: { const: 'app-authoring-v1' } }
|
||||||
|
assert.deepEqual(validateJsonSchema(['release', 'app-authoring-v1'], schema), [])
|
||||||
|
assert.ok(validateJsonSchema(['release'], schema).length > 0)
|
||||||
|
assert.ok(validateJsonSchema([], schema).length > 0)
|
||||||
|
})
|
||||||
|
for (const [name, change] of [
|
||||||
|
['同时声明两种定义来源', entry => { entry.appRelease.definitionPath = 'definition.json' }],
|
||||||
|
['缺少定义来源', entry => { delete entry.appRelease.definitionSource }],
|
||||||
|
['伪造inline来源', entry => { entry.appRelease.definitionSource = 'payload' }],
|
||||||
|
['缺app-authoring-v1能力', entry => { entry.appRelease.requiredCapabilities = ['release'] }],
|
||||||
|
['缺release能力', entry => { entry.appRelease.requiredCapabilities = ['app-authoring-v1'] }],
|
||||||
|
['浮动源码ref', entry => { entry.source.ref = 'main' }],
|
||||||
|
['缺归档摘要', entry => { delete entry.source.sha256 }],
|
||||||
|
['HTTPS URL携带凭据', entry => { entry.source.url = 'https://user@example.com/release.zip' }],
|
||||||
|
['HTTPS URL携带query', entry => { entry.source.url += '?download=1' }],
|
||||||
|
['HTTP归档', entry => { entry.source.url = 'http://example.com/release.zip' }],
|
||||||
|
['git缺归档内路径', entry => { entry.source.kind = 'git'; delete entry.source.path }],
|
||||||
|
['git归档内路径穿越', entry => { entry.source.kind = 'git'; entry.source.path = '../release' }],
|
||||||
|
['非Docker镜像依赖', entry => { entry.appRelease.imageRefs = ['registry.example.com/app@sha256:' + 'a'.repeat(64)] }],
|
||||||
|
['重复入口ID', entry => { entry.entrypoints.push({ ...entry.entrypoints[0] }) }],
|
||||||
|
['保留端口引用', entry => { entry.entrypoints[0].serviceRef = 'native-port:9333' }],
|
||||||
|
]) test('两个入口拒绝 ' + name, () => {
|
||||||
|
const root = fixture()
|
||||||
|
mutate(root, entryFile, change)
|
||||||
|
expectInvalid(root)
|
||||||
|
})
|
||||||
|
test('web-bundle缺web-bundle能力仍拒绝', () => {
|
||||||
|
const root = fixture('web-bundle')
|
||||||
|
mutate(root, entryFile, entry => { entry.appRelease.requiredCapabilities = ['app-authoring-v1', 'release'] })
|
||||||
|
expectInvalid(root)
|
||||||
|
})
|
||||||
|
test('web-bundle仍核对sidecar治理与内容来源', () => {
|
||||||
|
const root = fixture('web-bundle')
|
||||||
|
mutate(root, sidecarFile, sidecar => { sidecar.provenance.content.sha256 = 'b'.repeat(64) })
|
||||||
|
const report = validateRegistry(root)
|
||||||
|
assert.equal(report.ok, false)
|
||||||
|
assert.ok(report.errors.some(item => item.code === 'native-source-mismatch'))
|
||||||
|
})
|
||||||
@@ -1,7 +1,35 @@
|
|||||||
|
import { isApplicationEntry, isAuthoredRegistryEntry } from './entry-schema.mjs'
|
||||||
|
|
||||||
/** 发布者关系声明的跨字段检查;不推导安装、权限或运行时健康。 */
|
/** 发布者关系声明的跨字段检查;不推导安装、权限或运行时健康。 */
|
||||||
export function validateApplicationContract(manifest) {
|
export function validateApplicationContract(manifest) {
|
||||||
if (!['docker-app', 'native-app', 'artifact', 'web-bundle'].includes(manifest.type)) return []
|
if (!isApplicationEntry(manifest) && !isAuthoredRegistryEntry(manifest)) return []
|
||||||
const errors = []
|
const errors = []
|
||||||
|
if (isAuthoredRegistryEntry(manifest)) {
|
||||||
|
if (!['web-bundle', 'native-app', 'docker-app'].includes(manifest.type)) errors.push('appRelease: unsupported delivery type')
|
||||||
|
const required = manifest.appRelease?.requiredCapabilities
|
||||||
|
if (!Array.isArray(required) || !required.includes('release') || (manifest.type === 'web-bundle' && !required.includes('web-bundle'))) {
|
||||||
|
errors.push('appRelease: delivery capability handshake required')
|
||||||
|
}
|
||||||
|
const images = manifest.appRelease?.imageRefs
|
||||||
|
// 镜像语法由严格 Schema 校验;端口范围属于同一跨字段合同。
|
||||||
|
if (manifest.type === 'docker-app' && (!Array.isArray(images) || images.length === 0 || images.some(image =>
|
||||||
|
typeof image !== 'string' || Number(image.split('/')[0].split(':')[1] ?? 0) > 65535))) errors.push('appRelease: Docker images must be pinned by digest')
|
||||||
|
if (manifest.type !== 'docker-app' && images !== undefined) errors.push('appRelease: imageRefs belongs only to Docker release')
|
||||||
|
const source = manifest.source
|
||||||
|
if (!source || !['git', 'release'].includes(source.kind) ||
|
||||||
|
typeof source.ref !== 'string' || !/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(source.ref) ||
|
||||||
|
typeof source.sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(source.sha256)) {
|
||||||
|
errors.push('source: authored release requires immutable commit and archive sha256')
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const url = new URL(String(source?.url))
|
||||||
|
if (url.protocol !== 'https:' || url.username || url.password || url.hash || url.search) errors.push('source: credential-free fixed HTTPS URL required')
|
||||||
|
} catch { errors.push('source: invalid URL') }
|
||||||
|
if (source?.kind === 'git' && (typeof source.path !== 'string' || !isPortablePath(source.path))) errors.push('source: git archive path must be canonical and relative')
|
||||||
|
// 内联定义不声明 definitionPath;声明时才要求规范相对路径。
|
||||||
|
const definitionPath = manifest.appRelease?.definitionPath
|
||||||
|
if (definitionPath !== undefined && (typeof definitionPath !== 'string' || !isPortablePath(definitionPath))) errors.push('appRelease: definitionPath must be canonical and relative')
|
||||||
|
}
|
||||||
const ids = new Set()
|
const ids = new Set()
|
||||||
for (const entrypoint of Array.isArray(manifest.entrypoints) ? manifest.entrypoints : []) {
|
for (const entrypoint of Array.isArray(manifest.entrypoints) ? manifest.entrypoints : []) {
|
||||||
if (!entrypoint || typeof entrypoint !== 'object') continue
|
if (!entrypoint || typeof entrypoint !== 'object') continue
|
||||||
@@ -18,3 +46,9 @@ export function validateApplicationContract(manifest) {
|
|||||||
}
|
}
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isPortablePath(value) {
|
||||||
|
return value.length > 0 && value.length <= 512 &&
|
||||||
|
!/[\\\x00-\x1f?#:]/.test(value) && !value.startsWith('/') &&
|
||||||
|
value.split('/').every(part => part.length > 0 && part !== '.' && part !== '..')
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/** 作者材料的跨字段检查;身份与运行事实由客户端owner核验,不执行安装说明。 */
|
|
||||||
export function validateApplicationReleaseContract(manifest) {
|
|
||||||
if (manifest.type !== 'web-bundle' && manifest.appRelease === undefined) return []
|
|
||||||
const errors = []
|
|
||||||
if (!['web-bundle', 'native-app', 'docker-app'].includes(manifest.type)) errors.push('appRelease: unsupported delivery type')
|
|
||||||
if (!manifest.appRelease?.requiredCapabilities?.includes('app-authoring-v1')) errors.push('appRelease: app-authoring-v1 capability handshake required')
|
|
||||||
if (!manifest.appRelease?.requiredCapabilities?.includes('release') ||
|
|
||||||
(manifest.type === 'web-bundle' && !manifest.appRelease.requiredCapabilities.includes('web-bundle'))) errors.push('appRelease: delivery capability handshake required')
|
|
||||||
const images = manifest.appRelease?.imageRefs
|
|
||||||
if (manifest.type === 'docker-app' && (!Array.isArray(images) || !images.length || images.some(image =>
|
|
||||||
typeof image !== 'string' || !/^[a-z0-9][a-z0-9._:/-]*@sha256:[a-f0-9]{64}$/.test(image) ||
|
|
||||||
Number(image.split('/')[0].split(':')[1] ?? 0) > 65535))) errors.push('appRelease: Docker images must be pinned by digest')
|
|
||||||
if (manifest.type !== 'docker-app' && images !== undefined) errors.push('appRelease: imageRefs belongs only to Docker release')
|
|
||||||
const source = manifest.source
|
|
||||||
if (!source || !['git', 'release'].includes(source.kind) ||
|
|
||||||
!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(source.ref ?? '') || !/^[a-f0-9]{64}$/.test(source.sha256 ?? '')) {
|
|
||||||
errors.push('source: authored release requires immutable commit and archive sha256')
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const url = new URL(source?.url)
|
|
||||||
if (url.protocol !== 'https:' || url.username || url.password || url.hash || url.search) errors.push('source: credential-free fixed HTTPS URL required')
|
|
||||||
} catch { errors.push('source: invalid URL') }
|
|
||||||
if (source?.kind === 'git' && !isPortablePath(source.path)) errors.push('source: git archive path must be canonical and relative')
|
|
||||||
if (!isPortablePath(manifest.appRelease?.definitionPath)) errors.push('appRelease: definitionPath must be canonical and relative')
|
|
||||||
return errors
|
|
||||||
}
|
|
||||||
|
|
||||||
function isPortablePath(value) {
|
|
||||||
return typeof value === 'string' && value.length > 0 && value.length <= 512 &&
|
|
||||||
!/[\\\x00-\x1f?#:]/.test(value) && !value.startsWith('/') &&
|
|
||||||
value.split('/').every(part => part.length > 0 && part !== '.' && part !== '..')
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/** MCP 机器审核记录的绑定契约;仅机械核验,不授予运行权限。 */
|
||||||
|
import { readFileSync } from 'node:fs'
|
||||||
|
import { validateJsonSchema } from './json-schema.mjs'
|
||||||
|
const schema = JSON.parse(readFileSync(new URL('../../schemas/mcp-package-review.v1.schema.json', import.meta.url), 'utf8'))
|
||||||
|
export const MCP_PACKAGE_REVIEWER = schema.properties.reviewer.const
|
||||||
|
const checks = schema.properties.checks.required
|
||||||
|
|
||||||
|
export function validateMcpPackageReview(manifest, catalog, record) {
|
||||||
|
const content = catalog.provenance?.content
|
||||||
|
const compliance = catalog.governance?.compliance
|
||||||
|
const errors = validateJsonSchema(record, schema).map(error => `${error.path}: ${error.message}`)
|
||||||
|
if (errors.length) return errors
|
||||||
|
if (manifest.type !== 'mcp' || content?.kind !== 'package' || record.schemaVersion !== 1
|
||||||
|
|| record.reviewer !== MCP_PACKAGE_REVIEWER || record.entryId !== manifest.id
|
||||||
|
|| record.version !== manifest.version || record.version !== content.ref
|
||||||
|
|| record.sourceUrl !== content.url || record.contentSha256 !== content.sha256
|
||||||
|
|| !/^[a-f0-9]{64}$/.test(record.contentSha256 ?? '')
|
||||||
|
|| record.packageName !== manifest.install?.packageName
|
||||||
|
|| !['npm', 'pypi'].includes(record.ecosystem)
|
||||||
|
|| typeof record.previousVersion !== 'string' || record.previousVersion === record.version) errors.push('机器审核必须绑定当前 MCP 包身份、版本和摘要')
|
||||||
|
const expectedMethod = record.ecosystem === 'npm' ? ['npx'] : ['uvx', 'pip']
|
||||||
|
const expectedUrl = record.ecosystem === 'npm' ? 'https://www.npmjs.com/package/' + record.packageName : 'https://pypi.org/project/' + record.packageName
|
||||||
|
if (!expectedMethod.includes(manifest.install?.method) || content?.url?.replace(/\/$/, '') !== expectedUrl) errors.push('包生态与目录来源不一致')
|
||||||
|
const separator = record.ecosystem === 'npm' ? '@' : '=='
|
||||||
|
const selector = record.packageName + separator + record.version
|
||||||
|
for (const config of [manifest.install, manifest.connection]) {
|
||||||
|
if (!Array.isArray(config?.args) || !config.args.includes(selector)
|
||||||
|
|| config.args.filter(arg => typeof arg === 'string' && (arg === record.packageName || arg.startsWith(record.packageName + separator))).length !== 1) errors.push('启动配置未唯一固定到审核版本')
|
||||||
|
}
|
||||||
|
if (checks.some(key => record.checks?.[key] !== true)) errors.push('机器审核检查不完整')
|
||||||
|
if (typeof record.reviewedAt !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(record.reviewedAt)
|
||||||
|
|| !Number.isFinite(Date.parse(record.reviewedAt)) || new Date(record.reviewedAt).toISOString().replace('.000Z', 'Z') !== record.reviewedAt || record.reviewedAt.slice(0, 10) !== compliance?.reviewedAt
|
||||||
|
|| compliance?.reviewedBy !== MCP_PACKAGE_REVIEWER) errors.push('机器审核身份和日期不一致')
|
||||||
|
const evidence = record.licenseEvidenceSha256
|
||||||
|
if (!evidence || typeof evidence !== 'object' || Array.isArray(evidence) || !Object.keys(evidence).length
|
||||||
|
|| Object.values(evidence).some(value => typeof value !== 'string' || !/^[a-f0-9]{64}$/.test(value))) errors.push('缺少许可及 Notice 摘要')
|
||||||
|
for (const path of [compliance?.licenseEvidencePath, compliance?.noticePath].filter(Boolean)) {
|
||||||
|
if (!evidence?.[path]) errors.push('未绑定声明的许可证据路径')
|
||||||
|
}
|
||||||
|
if (!Array.isArray(record.limitations) || !record.limitations.length) errors.push('缺少核验范围披露')
|
||||||
|
try {
|
||||||
|
const url = new URL(record.artifactUrl)
|
||||||
|
const host = record.ecosystem === 'npm' ? 'registry.npmjs.org' : 'files.pythonhosted.org'
|
||||||
|
if (url.protocol !== 'https:' || url.hostname !== host || url.username || url.password) throw new Error()
|
||||||
|
} catch { errors.push('固定制品来源无效') }
|
||||||
|
return errors
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import test from 'node:test'
|
||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { readFileSync, cpSync, mkdtempSync, writeFileSync, rmSync } from 'node:fs'
|
||||||
|
import { join } from 'node:path'
|
||||||
|
import { tmpdir } from 'node:os'
|
||||||
|
import { validateMcpPackageReview, MCP_PACKAGE_REVIEWER } from './automated-mcp-review.mjs'
|
||||||
|
import { validateRegistry } from './validator.mjs'
|
||||||
|
|
||||||
|
function fixture() {
|
||||||
|
const manifest = JSON.parse(readFileSync(new URL('../../entries/rea-mcp/manifest.json', import.meta.url)))
|
||||||
|
const catalog = JSON.parse(readFileSync(new URL('../../entries/rea-mcp/catalog-metadata.v1.json', import.meta.url)))
|
||||||
|
manifest.version = '6.5.0'
|
||||||
|
for (const config of [manifest.install, manifest.connection]) config.args = config.args.map(arg => arg.replace('rea-agents@6.4.0', 'rea-agents@6.5.0'))
|
||||||
|
catalog.release.version = manifest.version
|
||||||
|
catalog.provenance.content.ref = manifest.version
|
||||||
|
catalog.provenance.content.sha256 = 'a'.repeat(64)
|
||||||
|
catalog.governance.compliance.reviewedRef = manifest.version
|
||||||
|
catalog.governance.compliance.reviewedBy = MCP_PACKAGE_REVIEWER
|
||||||
|
catalog.governance.compliance.reviewedAt = '2026-10-31'
|
||||||
|
catalog.timestamps.reviewedAt = { state: 'known', value: '2026-10-31', precision: 'day' }
|
||||||
|
const checks = ['publishedIntegrity', 'previousCatalogDigest', 'boundedOrdinaryFiles', 'licenseAndNoticeUnchanged', 'structuredPrerequisitesUnchanged', 'pinnedLaunchSelectors']
|
||||||
|
const receipt = { schemaVersion: 1, reviewer: MCP_PACKAGE_REVIEWER, reviewedAt: '2026-10-31T08:00:00Z', entryId: 'rea-mcp', previousVersion: '6.4.0', version: '6.5.0', packageName: 'rea-agents', ecosystem: 'npm', sourceUrl: catalog.provenance.content.url, artifactUrl: 'https://registry.npmjs.org/rea-agents/-/rea-agents-6.5.0.tgz', contentSha256: 'a'.repeat(64), licenseEvidenceSha256: { LICENSE: 'b'.repeat(64) }, checks: Object.fromEntries(checks.map(key => [key, true])), limitations: ['Source verification only; no runtime/security acceptance'] }
|
||||||
|
return { manifest, catalog, receipt }
|
||||||
|
}
|
||||||
|
|
||||||
|
test('machine receipt binds package version, archive digest, review time and required checks', () => {
|
||||||
|
const { manifest, catalog, receipt } = fixture()
|
||||||
|
assert.deepEqual(validateMcpPackageReview(manifest, catalog, receipt), [])
|
||||||
|
for (const patch of [{ entryId: 'other' }, { contentSha256: 'c'.repeat(64) }, { reviewedAt: '2026-10-30T08:00:00Z' }, { reviewedAt: '2026-02-31T08:00:00Z' }, { checks: {} }, { licenseEvidenceSha256: {} }, { artifactUrl: 'https://attacker.invalid/file' }, { previousVersion: null }]) {
|
||||||
|
assert.ok(validateMcpPackageReview(manifest, catalog, { ...receipt, ...patch }).length)
|
||||||
|
}
|
||||||
|
assert.ok(validateMcpPackageReview(manifest, catalog, null).length)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('real catalog validator accepts bound evidence and rejects missing or tampered evidence', () => {
|
||||||
|
const root = mkdtempSync(join(tmpdir(), 'mcp-review-'))
|
||||||
|
try {
|
||||||
|
for (const name of ['entries', 'schemas', 'manifest.json', 'SCHEMA_VERSION']) cpSync(new URL('../../' + name, import.meta.url), join(root, name), { recursive: true })
|
||||||
|
const { manifest, catalog, receipt } = fixture()
|
||||||
|
const folder = join(root, 'entries/rea-mcp')
|
||||||
|
const write = (name, value) => writeFileSync(join(folder, name), JSON.stringify(value))
|
||||||
|
write('manifest.json', manifest); write('catalog-metadata.v1.json', catalog); write('upstream-audit.v1.json', receipt)
|
||||||
|
assert.equal(validateRegistry(root, { requireSidecars: true }).ok, true)
|
||||||
|
write('upstream-audit.v1.json', { ...receipt, contentSha256: '0'.repeat(64) })
|
||||||
|
assert.ok(validateRegistry(root).errors.some(issue => issue.code === 'automated-mcp-review'))
|
||||||
|
rmSync(join(folder, 'upstream-audit.v1.json'))
|
||||||
|
assert.ok(validateRegistry(root).errors.some(issue => issue.code === 'automated-mcp-review'))
|
||||||
|
} finally { rmSync(root, { recursive: true, force: true }) }
|
||||||
|
})
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/** 作者 release 使用受审的新契约;普通条目仍由已发布 global Schema 校验。 */
|
||||||
|
export const AUTHORED_ENTRY_SCHEMA_FILENAME = 'registry-entry.v4.3.schema.json'
|
||||||
|
|
||||||
|
export function isAuthoredRegistryEntry(entry) {
|
||||||
|
return entry?.type === 'web-bundle' || (entry !== null && typeof entry === 'object' && Object.hasOwn(entry, 'appRelease'))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isApplicationEntry(entry) {
|
||||||
|
return ['docker-app', 'native-app', 'artifact', 'web-bundle'].includes(entry?.type)
|
||||||
|
}
|
||||||
@@ -141,6 +141,13 @@ function validateNode(value, schema, rootSchema, path, errors) {
|
|||||||
if (schema.items) {
|
if (schema.items) {
|
||||||
value.forEach((item, index) => validateNode(item, schema.items, rootSchema, joinPath(path, index), errors))
|
value.forEach((item, index) => validateNode(item, schema.items, rootSchema, joinPath(path, index), errors))
|
||||||
}
|
}
|
||||||
|
if (schema.contains !== undefined && !value.some((item, index) => {
|
||||||
|
const candidateErrors = []
|
||||||
|
validateNode(item, schema.contains, rootSchema, joinPath(path, index), candidateErrors)
|
||||||
|
return candidateErrors.length === 0
|
||||||
|
})) {
|
||||||
|
errors.push({ path, message: '数组必须包含符合 contains 的元素' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import { isDeepStrictEqual } from 'node:util'
|
|||||||
import { basename, join, relative, resolve, sep } from 'node:path'
|
import { basename, join, relative, resolve, sep } from 'node:path'
|
||||||
import { validateJsonSchema } from './json-schema.mjs'
|
import { validateJsonSchema } from './json-schema.mjs'
|
||||||
import { findStaticMetrics } from './static-metadata.mjs'
|
import { findStaticMetrics } from './static-metadata.mjs'
|
||||||
|
import { MCP_PACKAGE_REVIEWER, validateMcpPackageReview } from './automated-mcp-review.mjs'
|
||||||
import { validateApplicationContract } from './application-contract.mjs'
|
import { validateApplicationContract } from './application-contract.mjs'
|
||||||
import { validateApplicationReleaseContract } from './application-release-contract.mjs'
|
import { AUTHORED_ENTRY_SCHEMA_FILENAME, isApplicationEntry, isAuthoredRegistryEntry } from './entry-schema.mjs'
|
||||||
|
|
||||||
export const CATALOG_SIDECAR_FILENAME = 'catalog-metadata.v1.json'
|
export const CATALOG_SIDECAR_FILENAME = 'catalog-metadata.v1.json'
|
||||||
|
|
||||||
@@ -34,6 +35,15 @@ function schemaDiagnostics(value, schema, file) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function readSchema(file, diagnostics) {
|
||||||
|
const schema = readJson(file, diagnostics)
|
||||||
|
if (schema === null || Array.isArray(schema) || !['object', 'boolean'].includes(typeof schema)) {
|
||||||
|
diagnostics.push(diagnostic('error', 'invalid-schema', file, '$', 'Schema 根必须是对象或 boolean'))
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
function safeRelativePath(value) {
|
function safeRelativePath(value) {
|
||||||
return (
|
return (
|
||||||
typeof value === 'string' &&
|
typeof value === 'string' &&
|
||||||
@@ -78,7 +88,7 @@ function timestampShapeIsConsistent(timestamp) {
|
|||||||
function validateSidecarSemantics(manifest, sidecar, file) {
|
function validateSidecarSemantics(manifest, sidecar, file) {
|
||||||
const errors = []
|
const errors = []
|
||||||
const add = (code, path, message) => errors.push(diagnostic('error', code, file, path, message))
|
const add = (code, path, message) => errors.push(diagnostic('error', code, file, path, message))
|
||||||
const expectedKind = ['docker-app', 'native-app', 'artifact', 'web-bundle'].includes(manifest.type) ? 'app' : 'service'
|
const expectedKind = isApplicationEntry(manifest) ? 'app' : 'service'
|
||||||
|
|
||||||
if (sidecar.identity?.id !== manifest.id) add('identity-mismatch', '$.identity.id', 'sidecar identity.id 必须与 legacy manifest.id 一致')
|
if (sidecar.identity?.id !== manifest.id) add('identity-mismatch', '$.identity.id', 'sidecar identity.id 必须与 legacy manifest.id 一致')
|
||||||
if (sidecar.identity?.kind !== expectedKind) add('kind-mismatch', '$.identity.kind', `legacy ${manifest.type} 必须映射为 ${expectedKind}`)
|
if (sidecar.identity?.kind !== expectedKind) add('kind-mismatch', '$.identity.kind', `legacy ${manifest.type} 必须映射为 ${expectedKind}`)
|
||||||
@@ -141,7 +151,7 @@ function validateSidecarSemantics(manifest, sidecar, file) {
|
|||||||
if (manifest.toolCount !== undefined && sidecar.spec?.toolCount !== manifest.toolCount) add('spec-mismatch', '$.spec.toolCount', 'toolCount 必须与 legacy 一致')
|
if (manifest.toolCount !== undefined && sidecar.spec?.toolCount !== manifest.toolCount) add('spec-mismatch', '$.spec.toolCount', 'toolCount 必须与 legacy 一致')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (['native-app', 'artifact', 'web-bundle'].includes(manifest.type)) {
|
if (['native-app', 'artifact', 'web-bundle'].includes(manifest.type) || isAuthoredRegistryEntry(manifest)) {
|
||||||
for (const field of ['stewardship', 'availability', 'redistribution', 'listingMaintainer', 'upstreamMaintainer', 'branding', 'compliance']) {
|
for (const field of ['stewardship', 'availability', 'redistribution', 'listingMaintainer', 'upstreamMaintainer', 'branding', 'compliance']) {
|
||||||
if (!isDeepStrictEqual(manifest[field], sidecar.governance?.[field])) add('native-governance-mismatch', '$.governance.' + field, '原生应用 manifest 与 sidecar 的治理事实必须一致')
|
if (!isDeepStrictEqual(manifest[field], sidecar.governance?.[field])) add('native-governance-mismatch', '$.governance.' + field, '原生应用 manifest 与 sidecar 的治理事实必须一致')
|
||||||
}
|
}
|
||||||
@@ -206,15 +216,16 @@ export function validateRegistry(repoRoot, options = {}) {
|
|||||||
const diagnostics = []
|
const diagnostics = []
|
||||||
const manifestFile = join(root, 'manifest.json')
|
const manifestFile = join(root, 'manifest.json')
|
||||||
const schemaVersionFile = join(root, 'SCHEMA_VERSION')
|
const schemaVersionFile = join(root, 'SCHEMA_VERSION')
|
||||||
const rootSchema = readJson(join(root, 'schemas', 'registry-manifest.v3.schema.json'), diagnostics)
|
const rootSchema = readSchema(join(root, 'schemas', 'registry-manifest.v3.schema.json'), diagnostics)
|
||||||
const legacyEntrySchema = readJson(join(root, 'schemas', 'registry-entry.v3.schema.json'), diagnostics)
|
const legacyEntrySchema = readSchema(join(root, 'schemas', 'registry-entry.v3.schema.json'), diagnostics)
|
||||||
const externalEntrySchema = readJson(join(root, 'schemas', 'registry-entry.schema.json'), diagnostics)
|
const externalEntrySchema = readSchema(join(root, 'schemas', 'registry-entry.schema.json'), diagnostics)
|
||||||
const sidecarSchema = readJson(join(root, 'schemas', 'catalog-metadata.v1.schema.json'), diagnostics)
|
const authoredEntrySchema = readSchema(join(root, 'schemas', AUTHORED_ENTRY_SCHEMA_FILENAME), diagnostics)
|
||||||
|
const sidecarSchema = readSchema(join(root, 'schemas', 'catalog-metadata.v1.schema.json'), diagnostics)
|
||||||
const rootManifest = readJson(manifestFile, diagnostics)
|
const rootManifest = readJson(manifestFile, diagnostics)
|
||||||
const entryDirs = findEntryDirs(join(root, 'entries'))
|
const entryDirs = findEntryDirs(join(root, 'entries'))
|
||||||
const counts = { totalEntries: 0, dockerApps: 0, mcpServices: 0, httpApis: 0, externalIntegrations: 0, sidecars: 0, legacyOnly: 0 }
|
const counts = { totalEntries: 0, dockerApps: 0, mcpServices: 0, httpApis: 0, externalIntegrations: 0, sidecars: 0, legacyOnly: 0 }
|
||||||
|
|
||||||
if (rootManifest && rootSchema) diagnostics.push(...schemaDiagnostics(rootManifest, rootSchema, relativeFile(root, manifestFile)))
|
if (rootManifest && rootSchema !== null) diagnostics.push(...schemaDiagnostics(rootManifest, rootSchema, relativeFile(root, manifestFile)))
|
||||||
const schemaVersion = existsSync(schemaVersionFile) ? readFileSync(schemaVersionFile, 'utf8').trim() : ''
|
const schemaVersion = existsSync(schemaVersionFile) ? readFileSync(schemaVersionFile, 'utf8').trim() : ''
|
||||||
const currentEntrySchema = /^4\./.test(schemaVersion) ? externalEntrySchema : legacyEntrySchema
|
const currentEntrySchema = /^4\./.test(schemaVersion) ? externalEntrySchema : legacyEntrySchema
|
||||||
if (!schemaVersion) diagnostics.push(diagnostic('error', 'missing-schema-version', 'SCHEMA_VERSION', '$', 'SCHEMA_VERSION 不能为空'))
|
if (!schemaVersion) diagnostics.push(diagnostic('error', 'missing-schema-version', 'SCHEMA_VERSION', '$', 'SCHEMA_VERSION 不能为空'))
|
||||||
@@ -242,10 +253,10 @@ export function validateRegistry(repoRoot, options = {}) {
|
|||||||
if (entry.type === 'mcp') counts.mcpServices += 1
|
if (entry.type === 'mcp') counts.mcpServices += 1
|
||||||
if (entry.type === 'http-api') counts.httpApis += 1
|
if (entry.type === 'http-api') counts.httpApis += 1
|
||||||
if (entry.type === 'external-integration') counts.externalIntegrations += 1
|
if (entry.type === 'external-integration') counts.externalIntegrations += 1
|
||||||
const effectiveEntrySchema = ['external-integration', 'native-app', 'artifact', 'web-bundle'].includes(entry.type) ? externalEntrySchema : currentEntrySchema
|
const effectiveEntrySchema = isAuthoredRegistryEntry(entry) ? authoredEntrySchema
|
||||||
if (effectiveEntrySchema) diagnostics.push(...schemaDiagnostics(entry, effectiveEntrySchema, manifestRelative))
|
: ['external-integration', 'native-app', 'artifact'].includes(entry.type) ? externalEntrySchema : currentEntrySchema
|
||||||
|
if (effectiveEntrySchema !== null && effectiveEntrySchema !== undefined) diagnostics.push(...schemaDiagnostics(entry, effectiveEntrySchema, manifestRelative))
|
||||||
for (const message of validateApplicationContract(entry)) diagnostics.push(diagnostic('error', 'application-contract', manifestRelative, '$', message))
|
for (const message of validateApplicationContract(entry)) diagnostics.push(diagnostic('error', 'application-contract', manifestRelative, '$', message))
|
||||||
for (const message of validateApplicationReleaseContract(entry)) diagnostics.push(diagnostic('error', 'application-release-contract', manifestRelative, '$', message))
|
|
||||||
if (entry.id !== basename(entryDir)) diagnostics.push(diagnostic('error', 'directory-id-mismatch', manifestRelative, '$.id', 'manifest.id 必须与 entries/<id> 目录名一致'))
|
if (entry.id !== basename(entryDir)) diagnostics.push(diagnostic('error', 'directory-id-mismatch', manifestRelative, '$.id', 'manifest.id 必须与 entries/<id> 目录名一致'))
|
||||||
if (seenIds.has(entry.id)) diagnostics.push(diagnostic('error', 'duplicate-id', manifestRelative, '$.id', 'Registry 条目 ID 重复'))
|
if (seenIds.has(entry.id)) diagnostics.push(diagnostic('error', 'duplicate-id', manifestRelative, '$.id', 'Registry 条目 ID 重复'))
|
||||||
seenIds.add(entry.id)
|
seenIds.add(entry.id)
|
||||||
@@ -262,8 +273,15 @@ export function validateRegistry(repoRoot, options = {}) {
|
|||||||
const sidecar = readJson(sidecarPath, diagnostics)
|
const sidecar = readJson(sidecarPath, diagnostics)
|
||||||
if (!sidecar) continue
|
if (!sidecar) continue
|
||||||
const sidecarRelative = relativeFile(root, sidecarPath)
|
const sidecarRelative = relativeFile(root, sidecarPath)
|
||||||
if (sidecarSchema) diagnostics.push(...schemaDiagnostics(sidecar, sidecarSchema, sidecarRelative))
|
if (sidecarSchema !== null) diagnostics.push(...schemaDiagnostics(sidecar, sidecarSchema, sidecarRelative))
|
||||||
diagnostics.push(...validateSidecarSemantics(entry, sidecar, sidecarRelative))
|
diagnostics.push(...validateSidecarSemantics(entry, sidecar, sidecarRelative))
|
||||||
|
if (sidecar.governance?.compliance?.reviewedBy === MCP_PACKAGE_REVIEWER) {
|
||||||
|
const receiptPath = join(entryDir, 'upstream-audit.v1.json')
|
||||||
|
const receipt = readJson(receiptPath, diagnostics)
|
||||||
|
for (const message of validateMcpPackageReview(entry, sidecar, receipt)) {
|
||||||
|
diagnostics.push(diagnostic('error', 'automated-mcp-review', sidecarRelative, '$.governance.compliance', message))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rootManifest?.stats) {
|
if (rootManifest?.stats) {
|
||||||
|
|||||||
@@ -208,10 +208,10 @@ test('当前 v4.2 条目保持可读,原生应用与既有 App/Service 具备
|
|||||||
httpApis: report.counts.httpApis,
|
httpApis: report.counts.httpApis,
|
||||||
externalIntegrations: report.counts.externalIntegrations,
|
externalIntegrations: report.counts.externalIntegrations,
|
||||||
}, {
|
}, {
|
||||||
totalEntries: 24,
|
totalEntries: 27,
|
||||||
dockerApps: 8,
|
dockerApps: 8,
|
||||||
nativeApps: 1,
|
nativeApps: 3,
|
||||||
mcpServices: 9,
|
mcpServices: 10,
|
||||||
httpApis: 5,
|
httpApis: 5,
|
||||||
externalIntegrations: 1,
|
externalIntegrations: 1,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# MCP 上游更新
|
||||||
|
|
||||||
|
`propose_mcp_updates.py` 默认只检查所有 MCP 条目并输出 JSON/Markdown 状态。npm 使用已声明包的 latest,PyPI 使用项目版本元数据;没有本地安装声明的远程服务标记 remote-managed;有本地安装声明的 HTTP/SSE 服务仍检查发行包,不因传输类型就当作托管服务,关联应用标记 app-managed,未配置可靠规则的交付形态标记 requires-version-feed。网络失败不等于已是最新。
|
||||||
|
|
||||||
|
`--publish` 仅在官方 Registry 使用触发用户身份,每次最多提出五个去重 PR,不覆盖已有候选,不自动合并。旧版本已经具备准入证据,且固定包、许可/第三方声明、结构化依赖、引擎和启动入口不变时,核验实际发布摘要和旧目录 SHA-256,生成明确机器身份、绑定新版本和摘要的审核记录;通过 Registry 两套校验后提交普通 PR。
|
||||||
|
|
||||||
|
许可、依赖或入口变化、版本相关实测说明、工具数量等不能自动判定时,只生成带原因的候选说明草稿,不改变旧 manifest、sidecar 或准入状态。不能把旧版本的运行验收继承到新版。自动核验不执行安装脚本、MCP 握手或业务工具,不代表安全认证。npm 签名和供应链认证未在此实现。
|
||||||
|
|
||||||
|
核验预算为下载 32 MiB、展开 128 MiB、单文件 16 MiB、5000 个文件,仅用于 CI 自动核验。制品只读,不解压到用户目录。Python 自动核验限唯一通用 wheel;平台 wheel、Docker/Go/二进制需要另外的固定制品规则,明确报告阻碍。
|
||||||
|
|
||||||
|
运行相关单文件:`python3 scripts/upstream/test_mcp_updates.py`、`node --test scripts/catalog/automated-mcp-review.test.mjs`。定时流程须合入 main,且仓库允许 Actions 创建 PR 后才生效。默认 GITHUB_TOKEN 创建 PR 不保证触发其它工作流,因此候选提交前执行目录校验,合并前仍确认必需检查。
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
"""MCP 固定包来源的发现与机械核验。不安装包、不执行上游代码。"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import copy
|
||||||
|
import hashlib
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
import tarfile
|
||||||
|
import urllib.parse
|
||||||
|
import urllib.request
|
||||||
|
import zipfile
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from email.parser import BytesParser
|
||||||
|
from pathlib import Path, PurePosixPath
|
||||||
|
|
||||||
|
REVIEW_SCHEMA = json.loads((Path(__file__).resolve().parents[2] / 'schemas/mcp-package-review.v1.schema.json').read_text())
|
||||||
|
REVIEWER = REVIEW_SCHEMA['properties']['reviewer']['const']
|
||||||
|
MAX_DOWNLOAD = 32 * 1024 * 1024
|
||||||
|
MAX_FILE = 16 * 1024 * 1024
|
||||||
|
MAX_EXPANDED = 128 * 1024 * 1024
|
||||||
|
MAX_FILES = 5000
|
||||||
|
NPM_NAME = re.compile(r'(?:@[a-z0-9_.-]+/)?[a-z0-9][a-z0-9_.-]*')
|
||||||
|
PYPI_NAME = re.compile(r'[A-Za-z0-9][A-Za-z0-9._-]*')
|
||||||
|
VERSION = re.compile(r'\d+(?:\.\d+){1,3}')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class AuditBlocked(ValueError):
|
||||||
|
"""证据不足时保持旧目录,不填写新审核通过记录。"""
|
||||||
|
def __init__(self, message, findings=None):
|
||||||
|
super().__init__(message)
|
||||||
|
self.findings = findings or {}
|
||||||
|
|
||||||
|
|
||||||
|
class NoRedirect(urllib.request.HTTPRedirectHandler):
|
||||||
|
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def download(url: str, maximum=MAX_DOWNLOAD) -> bytes:
|
||||||
|
parsed = urllib.parse.urlsplit(url)
|
||||||
|
if (parsed.scheme != 'https' or parsed.hostname not in
|
||||||
|
{'registry.npmjs.org', 'pypi.org', 'files.pythonhosted.org', 'api.github.com'}
|
||||||
|
or parsed.username or parsed.password or parsed.port not in (None, 443)):
|
||||||
|
raise AuditBlocked('仅获取固定官方包注册表 HTTPS 地址')
|
||||||
|
request = urllib.request.Request(url, headers={'User-Agent': 'DesireCore-upstream-review/1.0'})
|
||||||
|
chunks, total = [], 0
|
||||||
|
with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response:
|
||||||
|
while chunk := response.read(min(64 * 1024, maximum + 1 - total)):
|
||||||
|
chunks.append(chunk); total += len(chunk)
|
||||||
|
if total > maximum:
|
||||||
|
raise AuditBlocked('制品超过自动核验下载预算')
|
||||||
|
return b''.join(chunks)
|
||||||
|
|
||||||
|
|
||||||
|
def fetch_json(url):
|
||||||
|
return json.loads(download(url, 2 * 1024 * 1024))
|
||||||
|
|
||||||
|
|
||||||
|
def identity(name, ecosystem):
|
||||||
|
if not isinstance(name, str): raise AuditBlocked('上游包名称必须是字符串')
|
||||||
|
return re.sub('[-_.]+', '-', name).lower() if ecosystem == 'pypi' else name
|
||||||
|
|
||||||
|
|
||||||
|
def discover(manifest: dict, fetch=fetch_json, version_scheme=None) -> dict:
|
||||||
|
row = {'id': manifest['id'], 'listedVersion': manifest.get('version')}
|
||||||
|
connection, install = manifest.get('connection', {}), manifest.get('install', {})
|
||||||
|
if manifest.get('sourceAppId'):
|
||||||
|
return {**row, 'status': 'app-managed', 'reason': '随关联应用维护,不独立升级此 MCP 入口'}
|
||||||
|
if connection.get('transport') in ('streamable-http', 'sse') and not install:
|
||||||
|
return {**row, 'status': 'remote-managed', 'reason': '由服务端维护;目录版本不是实际服务端版本'}
|
||||||
|
method, package = install.get('method'), install.get('packageName', '')
|
||||||
|
ecosystem = 'npm' if method == 'npx' else 'pypi' if method in ('pip', 'uvx') else None
|
||||||
|
if method == 'docker' and manifest['id'] == 'github-mcp' and package == 'ghcr.io/github/github-mcp-server':
|
||||||
|
url = 'https://api.github.com/repos/github/github-mcp-server/releases/latest'
|
||||||
|
published = fetch(url)
|
||||||
|
if not isinstance(published, dict): raise AuditBlocked('发行元数据必须是对象')
|
||||||
|
latest, listed = str(published.get('tag_name', '')).removeprefix('v'), manifest.get('version', '')
|
||||||
|
if not VERSION.fullmatch(latest) or not VERSION.fullmatch(listed):
|
||||||
|
return {**row, 'status':'manual-review-required', 'reason':'容器发行标签不能可靠比较'}
|
||||||
|
status = 'current' if latest == listed else 'outdated' if tuple(map(int, latest.split('.'))) > tuple(map(int, listed.split('.'))) else 'upstream-version-behind'
|
||||||
|
return {**row,'status':status,'latestVersion':latest,'ecosystem':'github-release','packageName':package,'metadataUrl':url,'metadata':published,
|
||||||
|
'reason':'已登记 GitHub 官方发行源;镜像 digest 和准入仍需核验,不自动拉取容器'}
|
||||||
|
if ecosystem is None:
|
||||||
|
return {**row, 'status': 'requires-version-feed', 'reason': '该交付类型尚无已登记的可靠新版发现与固定制品规则'}
|
||||||
|
pattern = NPM_NAME if ecosystem == 'npm' else PYPI_NAME
|
||||||
|
if not isinstance(package, str) or not pattern.fullmatch(package):
|
||||||
|
return {**row, 'status': 'invalid-package-identity', 'reason': '缺少明确包身份,不能把任意 URL 或命令当作包名'}
|
||||||
|
url = (f'https://registry.npmjs.org/{urllib.parse.quote(package, safe="@/")}/latest'
|
||||||
|
if ecosystem == 'npm' else f'https://pypi.org/pypi/{package}/json')
|
||||||
|
published = fetch(url)
|
||||||
|
if not isinstance(published, dict): raise AuditBlocked('包元数据必须是对象')
|
||||||
|
details = published if ecosystem == 'npm' else published.get('info')
|
||||||
|
if not isinstance(details, dict): raise AuditBlocked('包发行身份必须是对象')
|
||||||
|
if identity(details.get('name', ''), ecosystem) != identity(package, ecosystem):
|
||||||
|
raise AuditBlocked('上游返回了不同包身份')
|
||||||
|
latest, listed = details.get('version', ''), manifest.get('version', '')
|
||||||
|
row.update(ecosystem=ecosystem, packageName=package, latestVersion=latest, metadataUrl=url)
|
||||||
|
if not all(isinstance(value, str) and VERSION.fullmatch(value) for value in (latest, listed)):
|
||||||
|
return {**row, 'status': 'manual-review-required', 'reason': '预发布、标签或不透明版本需单独复核'}
|
||||||
|
looks_calver = lambda value: bool(re.fullmatch(r'(?:19|20)\d{2}\.\d{1,2}\.\d{1,2}', value))
|
||||||
|
if (version_scheme == 'calver' or (version_scheme is None and looks_calver(listed))) != looks_calver(latest):
|
||||||
|
return {**row, 'status':'version-scheme-mismatch', 'reason':'目录与包注册表的版本体系不同,需核对映射;不自动降级或推进'}
|
||||||
|
if version_scheme == 'opaque' and latest != listed:
|
||||||
|
return {**row, 'status':'manual-review-required', 'reason':'目录版本是不透明标识,不能自动进行数值排序'}
|
||||||
|
latest_key, listed_key = (tuple(map(int, value.split('.'))) for value in (latest, listed))
|
||||||
|
status = 'outdated' if latest_key > listed_key else 'current' if latest_key == listed_key else 'upstream-version-behind'
|
||||||
|
return {**row, 'status': status, 'reason': '只比较公开发行版本,不声称本机已升级', 'metadata': published}
|
||||||
|
|
||||||
|
|
||||||
|
def inspect_archive(body: bytes, ecosystem='npm') -> dict[str, bytes]:
|
||||||
|
files, expanded = {}, 0
|
||||||
|
def accept(name, size, ordinary, reader):
|
||||||
|
nonlocal expanded
|
||||||
|
path = PurePosixPath(name)
|
||||||
|
if path.is_absolute() or '..' in path.parts or '\\' in name or not ordinary:
|
||||||
|
raise AuditBlocked('制品包含不安全路径、链接或特殊节点')
|
||||||
|
if size > MAX_FILE or len(files) >= MAX_FILES or expanded + size > MAX_EXPANDED:
|
||||||
|
raise AuditBlocked('制品超过自动核验展开预算')
|
||||||
|
normalized = path.as_posix()
|
||||||
|
if normalized in files: raise AuditBlocked('制品存在重复文件路径')
|
||||||
|
content = reader()
|
||||||
|
if len(content) != size: raise AuditBlocked('文件实际长度不匹配')
|
||||||
|
files[normalized] = content; expanded += size
|
||||||
|
if ecosystem == 'npm':
|
||||||
|
with tarfile.open(fileobj=io.BytesIO(body), mode='r:gz') as archive:
|
||||||
|
for number, member in enumerate(archive):
|
||||||
|
if number >= MAX_FILES: raise AuditBlocked('制品节点数超过核验预算')
|
||||||
|
path = PurePosixPath(member.name)
|
||||||
|
if member.isdir():
|
||||||
|
if path.is_absolute() or '..' in path.parts or '\\' in member.name: raise AuditBlocked('目录路径不安全')
|
||||||
|
continue
|
||||||
|
if not path.parts or path.parts[0] != 'package' or len(path.parts) < 2:
|
||||||
|
raise AuditBlocked('npm 制品必须以 package/ 为内容根')
|
||||||
|
accept(PurePosixPath(*path.parts[1:]).as_posix(), member.size, member.isfile(), lambda: archive.extractfile(member).read())
|
||||||
|
else:
|
||||||
|
with zipfile.ZipFile(io.BytesIO(body)) as archive:
|
||||||
|
for member in archive.infolist():
|
||||||
|
if member.is_dir(): continue
|
||||||
|
mode = member.external_attr >> 16
|
||||||
|
accept(member.filename, member.file_size, mode & 0o170000 in (0, 0o100000), lambda: archive.read(member))
|
||||||
|
if not files: raise AuditBlocked('制品为空')
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
def evidence(files):
|
||||||
|
result = {}
|
||||||
|
for path, body in files.items():
|
||||||
|
parts = PurePosixPath(path).parts
|
||||||
|
if parts[-1].upper().startswith(('LICENSE', 'NOTICE', 'COPYING')) or any(part.lower() == 'licenses' for part in parts[:-1]):
|
||||||
|
result[path] = hashlib.sha256(body).hexdigest()
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def package_contract(files, ecosystem):
|
||||||
|
if ecosystem == 'npm':
|
||||||
|
value = json.loads(files['package.json'])
|
||||||
|
if not isinstance(value, dict): raise AuditBlocked('package.json 必须是对象')
|
||||||
|
keys = ('name', 'license', 'dependencies', 'optionalDependencies', 'peerDependencies',
|
||||||
|
'peerDependenciesMeta', 'engines', 'os', 'cpu', 'bin', 'scripts', 'type', 'exports', 'main', 'repository')
|
||||||
|
return {key: value.get(key) for key in keys}, value.get('version')
|
||||||
|
paths = [path for path in files if path.endswith('.dist-info/METADATA')]
|
||||||
|
if len(paths) != 1: raise AuditBlocked('需要唯一的 Python wheel METADATA')
|
||||||
|
metadata = BytesParser().parsebytes(files[paths[0]])
|
||||||
|
keys = ('Name', 'Requires-Python', 'Requires-Dist', 'Provides-Extra', 'License', 'License-Expression', 'Classifier')
|
||||||
|
return {key: sorted(metadata.get_all(key, [])) for key in keys}, metadata.get('Version')
|
||||||
|
|
||||||
|
|
||||||
|
def fixed_artifact(metadata, ecosystem, expected_sha=None):
|
||||||
|
if ecosystem == 'npm':
|
||||||
|
dist = metadata.get('dist', {})
|
||||||
|
if not isinstance(dist, dict): raise AuditBlocked('npm dist 必须是对象')
|
||||||
|
url, integrity = dist.get('tarball'), dist.get('integrity')
|
||||||
|
if not isinstance(integrity, str) or not integrity.startswith('sha512-'):
|
||||||
|
raise AuditBlocked('npm 缺少 SHA-512 integrity 证据')
|
||||||
|
return url, integrity
|
||||||
|
candidates = metadata.get('urls')
|
||||||
|
if not isinstance(candidates, list) or any(not isinstance(item, dict) for item in candidates):
|
||||||
|
raise AuditBlocked('PyPI 制品列表格式不正确')
|
||||||
|
for item in candidates:
|
||||||
|
if not isinstance(item.get('filename'), str) or not isinstance(item.get('digests'), dict):
|
||||||
|
raise AuditBlocked('PyPI 制品名称或摘要格式不正确')
|
||||||
|
if not re.fullmatch('[a-f0-9]{64}', str(item['digests'].get('sha256', ''))):
|
||||||
|
raise AuditBlocked('PyPI 制品缺少有效 SHA-256')
|
||||||
|
artifacts = [item for item in candidates if not item.get('yanked')
|
||||||
|
and item.get('filename', '').endswith('-none-any.whl')
|
||||||
|
and (expected_sha is None or item.get('digests', {}).get('sha256') == expected_sha)]
|
||||||
|
if len(artifacts) != 1:
|
||||||
|
raise AuditBlocked('需要唯一且匹配已审核摘要的通用 Python wheel;平台包需专项复核')
|
||||||
|
return artifacts[0]['url'], 'sha256-' + base64.b64encode(bytes.fromhex(artifacts[0]['digests']['sha256'])).decode()
|
||||||
|
|
||||||
|
|
||||||
|
def verified_artifact(metadata, ecosystem, fetch_bytes, expected_sha=None):
|
||||||
|
url, integrity = fixed_artifact(metadata, ecosystem, expected_sha)
|
||||||
|
# 测试替身也必须满足官方来源约束,不能借注入 fetch 绕过来源规则。
|
||||||
|
parsed = urllib.parse.urlsplit(url or '')
|
||||||
|
host = 'registry.npmjs.org' if ecosystem == 'npm' else 'files.pythonhosted.org'
|
||||||
|
if parsed.scheme != 'https' or parsed.hostname != host or parsed.username or parsed.password or parsed.port not in (None, 443):
|
||||||
|
raise AuditBlocked('固定制品不是对应官方包注册表 HTTPS 地址')
|
||||||
|
body = fetch_bytes(url)
|
||||||
|
if len(body) > MAX_DOWNLOAD: raise AuditBlocked('制品超过下载预算')
|
||||||
|
algorithm, encoded = integrity.split('-', 1)
|
||||||
|
if base64.b64encode(hashlib.new(algorithm, body).digest()).decode() != encoded:
|
||||||
|
raise AuditBlocked('发布摘要与实际制品不一致')
|
||||||
|
digest = hashlib.sha256(body).hexdigest()
|
||||||
|
if expected_sha is not None and digest != expected_sha:
|
||||||
|
raise AuditBlocked('旧包与目录已审核摘要不一致')
|
||||||
|
try:
|
||||||
|
files = inspect_archive(body, ecosystem)
|
||||||
|
except (tarfile.TarError, zipfile.BadZipFile, EOFError) as error:
|
||||||
|
raise AuditBlocked('固定制品格式损坏') from error
|
||||||
|
return files, digest, url
|
||||||
|
|
||||||
|
|
||||||
|
def advance_selector(config, package, old, new, ecosystem):
|
||||||
|
args = config.get('args')
|
||||||
|
separator = '@' if ecosystem == 'npm' else '=='
|
||||||
|
old_values = {package, package + separator + old, package + ('@latest' if ecosystem == 'npm' else '')}
|
||||||
|
if not isinstance(args, list) or sum(arg in old_values for arg in args) != 1:
|
||||||
|
raise AuditBlocked('启动选择器不能唯一绑定当前包,需专项复核')
|
||||||
|
config['args'] = [package + separator + new if arg in old_values else arg for arg in args]
|
||||||
|
|
||||||
|
|
||||||
|
def prepare_update(manifest, sidecar, result, fetch=fetch_json, fetch_bytes=download, observed_at=None):
|
||||||
|
if result.get('status') != 'outdated' or result['listedVersion'] != manifest['version']:
|
||||||
|
raise AuditBlocked('新版检查快照已过期或不支持自动推进')
|
||||||
|
old, new, ecosystem, package = manifest['version'], result['latestVersion'], result['ecosystem'], result['packageName']
|
||||||
|
if ecosystem not in ('npm', 'pypi'):
|
||||||
|
raise AuditBlocked('容器或二进制新版需要固定制品 digest 和许可准入证据;不自动拉取或运行')
|
||||||
|
governance, content = sidecar.get('governance', {}), sidecar.get('provenance', {}).get('content', {})
|
||||||
|
compliance = governance.get('compliance', {})
|
||||||
|
if (governance.get('availability') != 'installable' or governance.get('license', {}).get('state') != 'known'
|
||||||
|
or compliance.get('reviewedRef') != old or not compliance.get('reviewedBy') or not compliance.get('reviewedAt')
|
||||||
|
or content.get('kind') != 'package' or content.get('ref') != old
|
||||||
|
or not re.fullmatch('[0-9a-f]{64}', content.get('sha256', ''))):
|
||||||
|
raise AuditBlocked('旧版本缺少完整准入与固定制品审核证据')
|
||||||
|
expected_url = ('https://www.npmjs.com/package/' + package if ecosystem == 'npm' else 'https://pypi.org/project/' + package + '/')
|
||||||
|
if content.get('url', '').rstrip('/') != expected_url.rstrip('/'):
|
||||||
|
raise AuditBlocked('目录包来源与实际包身份不一致')
|
||||||
|
old_url = (f'https://registry.npmjs.org/{urllib.parse.quote(package, safe="@/")}/{old}'
|
||||||
|
if ecosystem == 'npm' else f'https://pypi.org/pypi/{package}/{old}/json')
|
||||||
|
old_metadata, new_metadata = fetch(old_url), result['metadata']
|
||||||
|
for metadata, version in ((old_metadata, old), (new_metadata, new)):
|
||||||
|
if not isinstance(metadata, dict): raise AuditBlocked('固定版本元数据必须是对象')
|
||||||
|
details = metadata if ecosystem == 'npm' else metadata.get('info')
|
||||||
|
if not isinstance(details, dict): raise AuditBlocked('固定版本包身份必须是对象')
|
||||||
|
if identity(details.get('name', ''), ecosystem) != identity(package, ecosystem) or details.get('version') != version:
|
||||||
|
raise AuditBlocked('固定版本元数据身份不一致')
|
||||||
|
old_files, _, _ = verified_artifact(old_metadata, ecosystem, fetch_bytes, content['sha256'])
|
||||||
|
new_files, digest, artifact_url = verified_artifact(new_metadata, ecosystem, fetch_bytes)
|
||||||
|
old_evidence, new_evidence = evidence(old_files), evidence(new_files)
|
||||||
|
normalize_path = lambda path: re.sub(r'[^/]+\.dist-info/', 'PACKAGE.dist-info/', path, count=1)
|
||||||
|
old_normalized = {normalize_path(path):value for path,value in old_evidence.items()}
|
||||||
|
new_normalized = {normalize_path(path):value for path,value in new_evidence.items()}
|
||||||
|
if not old_evidence or old_normalized != new_normalized:
|
||||||
|
raise AuditBlocked('许可证或第三方 Notice 有变化,不能继承旧审核', {
|
||||||
|
'licenseOrNoticePaths': sorted(path for path in old_normalized.keys() | new_normalized.keys()
|
||||||
|
if old_normalized.get(path) != new_normalized.get(path))
|
||||||
|
})
|
||||||
|
for key in ('licenseEvidencePath', 'noticePath'):
|
||||||
|
if compliance.get(key) and compliance[key] not in old_files:
|
||||||
|
raise AuditBlocked('声明的许可证据文件不存在')
|
||||||
|
evidence_paths = {}
|
||||||
|
for path in {compliance.get('licenseEvidencePath'), compliance.get('noticePath'), governance.get('license', {}).get('evidencePath')} - {None}:
|
||||||
|
matches = [candidate for candidate in new_evidence if normalize_path(candidate) == normalize_path(path)]
|
||||||
|
if path not in old_evidence or len(matches) != 1:
|
||||||
|
raise AuditBlocked('声明的许可证据无法绑定新包文件')
|
||||||
|
evidence_paths[path] = matches[0]
|
||||||
|
old_contract, old_version = package_contract(old_files, ecosystem)
|
||||||
|
new_contract, new_version = package_contract(new_files, ecosystem)
|
||||||
|
declared_name = new_contract.get('name') if ecosystem == 'npm' else (new_contract.get('Name') or [''])[0]
|
||||||
|
if identity(declared_name or '', ecosystem) != identity(package, ecosystem):
|
||||||
|
raise AuditBlocked('制品中的包名称与请求身份不同')
|
||||||
|
if old_version != old or new_version != new or old_contract != new_contract:
|
||||||
|
raise AuditBlocked('包身份、许可、依赖、启动入口或平台要求变化,需要复核')
|
||||||
|
# 版本相关的运行验收说明不能随新包机械继承。
|
||||||
|
presentation = json.dumps(sidecar.get('presentation', {}), ensure_ascii=False)
|
||||||
|
if old in presentation or manifest.get('toolCount') is not None:
|
||||||
|
raise AuditBlocked('版本相关说明或工具数量需要新版证据,不能冒充已完成运行验收')
|
||||||
|
updated, catalog = copy.deepcopy(manifest), copy.deepcopy(sidecar)
|
||||||
|
for config in (updated['install'], updated['connection']):
|
||||||
|
advance_selector(config, package, old, new, ecosystem)
|
||||||
|
updated['version'] = new
|
||||||
|
catalog['release'] = {'state': 'known', 'version': new, 'versionScheme': sidecar['release']['versionScheme']}
|
||||||
|
catalog['provenance']['content'].update(ref=new, sha256=digest)
|
||||||
|
now = observed_at or datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
datetime.strptime(now, '%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
catalog['governance']['compliance'].update(reviewedRef=new, reviewedBy=REVIEWER, reviewedAt=now[:10])
|
||||||
|
for key in ('licenseEvidencePath', 'noticePath'):
|
||||||
|
if compliance.get(key): catalog['governance']['compliance'][key] = evidence_paths[compliance[key]]
|
||||||
|
if governance.get('license', {}).get('evidencePath'):
|
||||||
|
catalog['governance']['license']['evidencePath'] = evidence_paths[governance['license']['evidencePath']]
|
||||||
|
catalog.setdefault('timestamps', {}).update({
|
||||||
|
'catalogUpdatedAt': {'state':'known','value':now,'precision':'second'},
|
||||||
|
'upstreamObservedAt': {'state':'known','value':now,'precision':'second'},
|
||||||
|
'reviewedAt': {'state':'known','value':now[:10],'precision':'day'},
|
||||||
|
'releasePublishedAt': {'state':'unknown'},
|
||||||
|
})
|
||||||
|
report = {'schemaVersion':1,'reviewer':REVIEWER,'reviewedAt':now,'entryId':manifest['id'],
|
||||||
|
'previousVersion':old,'version':new,'packageName':package,'ecosystem':ecosystem,
|
||||||
|
'sourceUrl':content['url'],'artifactUrl':artifact_url,'contentSha256':digest,
|
||||||
|
'licenseEvidenceSha256':new_evidence,
|
||||||
|
'checks':{'publishedIntegrity':True,'previousCatalogDigest':True,'boundedOrdinaryFiles':True,
|
||||||
|
'licenseAndNoticeUnchanged':True,'structuredPrerequisitesUnchanged':True,'pinnedLaunchSelectors':True},
|
||||||
|
'limitations':['仅来源、制品、许可和结构化前置条件核验;未执行上游代码、MCP 握手、业务工具或跨平台验收。',
|
||||||
|
'包签名、供应链认证与非结构化行为变化不在本次机械核验范围;不自动合并。']}
|
||||||
|
return updated, catalog, report
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""每日发现 MCP 新版;核验通过普通 PR,受阻只提交候选说明草稿。"""
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
from pathlib import Path
|
||||||
|
from mcp_updates import discover, prepare_update, AuditBlocked
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
|
||||||
|
|
||||||
|
def run(*args, cwd=ROOT):
|
||||||
|
return subprocess.run(args,cwd=cwd,check=True,capture_output=True,text=True).stdout.strip()
|
||||||
|
|
||||||
|
|
||||||
|
def write_report(rows, destination):
|
||||||
|
destination.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
public = [{key:value for key,value in row.items() if key != 'metadata'} for row in rows]
|
||||||
|
destination.write_text(json.dumps(public,ensure_ascii=False,indent=2)+'\n')
|
||||||
|
lines=['| MCP | 目录版本 | 上游版本 | 状态 | 说明 |','|---|---|---|---|---|']
|
||||||
|
for row in public:
|
||||||
|
cell=lambda value:str(value or '').replace('|','/').replace('\n',' ')
|
||||||
|
lines.append('| '+' | '.join(cell(row.get(key)) for key in ['id','listedVersion','latestVersion','status','reason'])+' |')
|
||||||
|
destination.with_suffix('.md').write_text('\n'.join(lines)+'\n')
|
||||||
|
|
||||||
|
|
||||||
|
def publish(root, manifest, metadata, result, actor, repository):
|
||||||
|
package = re.sub('[^a-zA-Z0-9_.-]','-',result['latestVersion'])
|
||||||
|
branch = f"updates/mcp-{manifest['id']}-{package}"
|
||||||
|
existing = json.loads(run('gh','pr','list','--repo',repository,'--state','all','--head',branch,'--json','number'))
|
||||||
|
open_prs = json.loads(run('gh','pr','list','--repo',repository,'--state','open','--limit','1000','--json','headRefName'))
|
||||||
|
if existing or any(pr['headRefName'].startswith(f"updates/mcp-{manifest['id']}-") for pr in open_prs):
|
||||||
|
result.update(status='already-proposed',reason='已有候选或同快照记录,保留审核者修改');return False
|
||||||
|
# push 已成功但创建 PR 的网络请求失败时,下一轮恢复待审入口,不覆盖既有分支。
|
||||||
|
try:
|
||||||
|
orphan = run('gh','api',f'repos/{repository}/git/ref/heads/{branch}','--jq','.object.sha')
|
||||||
|
except subprocess.CalledProcessError as error:
|
||||||
|
if '404' not in (error.stderr or ''): raise
|
||||||
|
orphan = ''
|
||||||
|
if orphan:
|
||||||
|
run('gh','pr','create','--repo',repository,'--base','main','--head',branch,'--draft',
|
||||||
|
'--title',f"chore(registry): 恢复 {manifest['id']} 新版候选审核",
|
||||||
|
'--body','发现已有候选分支但没有 PR。仅恢复草稿审核入口,未重新核验分支内容;合并前须复核来源、摘要及目录校验。\n\nRecovered an existing candidate branch as a draft; no new review or auto-merge.')
|
||||||
|
result.update(status='review-blocked',reason='恢复已有候选分支的草稿;未重新核验其内容,不覆盖维护者修改')
|
||||||
|
return True
|
||||||
|
proposal, receipt, reason, findings = None, None, None, {}
|
||||||
|
try:
|
||||||
|
updated, sidecar, receipt = prepare_update(manifest,metadata,result)
|
||||||
|
proposal = (updated,sidecar)
|
||||||
|
except (AuditBlocked, OSError, ValueError, KeyError, RuntimeError) as error:
|
||||||
|
reason=str(error)[:500]
|
||||||
|
findings=getattr(error,'findings',{})
|
||||||
|
with tempfile.TemporaryDirectory(prefix='mcp-update-') as temporary:
|
||||||
|
checkout=Path(temporary)/'checkout'
|
||||||
|
run('git','worktree','add','--detach',str(checkout),'HEAD')
|
||||||
|
try:
|
||||||
|
run('git','switch','-c',branch,cwd=checkout)
|
||||||
|
folder=checkout/'entries'/manifest['id'];paths=[]
|
||||||
|
def write(name,value):
|
||||||
|
(folder/name).write_text(json.dumps(value,ensure_ascii=False,indent=2)+'\n')
|
||||||
|
paths.append(str((folder/name).relative_to(checkout)))
|
||||||
|
if proposal:
|
||||||
|
write('manifest.json',proposal[0]);write('catalog-metadata.v1.json',proposal[1]);write('upstream-audit.v1.json',receipt)
|
||||||
|
try:
|
||||||
|
run('node','scripts/validate-registry.mjs',cwd=checkout)
|
||||||
|
run('node','scripts/catalog/validate-registry.mjs','--require-sidecars',cwd=checkout)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
run('git','restore','--',*paths[:2],cwd=checkout)
|
||||||
|
(folder/'upstream-audit.v1.json').unlink();paths=[];receipt=None
|
||||||
|
reason='目录校验未通过;保留现有版本、审核及运行事实'
|
||||||
|
if not receipt:
|
||||||
|
write('upstream-update-candidate.json',{
|
||||||
|
'schemaVersion':1,'entryId':manifest['id'],'listedVersion':manifest['version'],
|
||||||
|
'observedVersion':result['latestVersion'],'metadataUrl':result['metadataUrl'],
|
||||||
|
'reason':reason,'reviewPassed':False,
|
||||||
|
'findings':findings,
|
||||||
|
'note':'仅候选说明,不修改当前 manifest、sidecar、审核结论或安装状态。',
|
||||||
|
})
|
||||||
|
run('git','add','--',*paths,cwd=checkout)
|
||||||
|
run('git','-c',f'user.name={actor}','-c',f'user.email={actor}@users.noreply.github.com','commit','-m',f"chore(registry): 更新 {manifest['id']} 候选 {result['latestVersion']}",cwd=checkout)
|
||||||
|
run('git','push','origin',f'HEAD:refs/heads/{branch}',cwd=checkout)
|
||||||
|
body=Path(temporary)/'body.md'
|
||||||
|
body.write_text(f"{manifest['id']}: {manifest['version']} → {result['latestVersion']}\n\n"
|
||||||
|
+( '来源、旧摘要、发布摘要、许可与结构化前置条件核验通过,附机器记录。\n' if receipt else '核验受阻:'+str(reason)+'。仅提交候选说明,旧目录与审核不变。\n')
|
||||||
|
+'\n未运行上游安装脚本、MCP 握手或业务工具,不代表安全认证或新版运行验收。不自动合并。\n\n'
|
||||||
|
+'Automated package-source verification only; no upstream execution, runtime/security acceptance or auto-merge.\n')
|
||||||
|
args=['gh','pr','create','--repo',repository,'--base','main','--head',branch,'--title',f"chore(registry): 更新 {manifest['id']} 至 {result['latestVersion']}",'--body-file',str(body)]
|
||||||
|
if not receipt:args.append('--draft')
|
||||||
|
run(*args,cwd=checkout)
|
||||||
|
result.update(status='proposed' if receipt else 'review-blocked',reason=reason or '机器核验通过,已提交普通 PR;未合并或升级用户服务')
|
||||||
|
return True
|
||||||
|
finally:
|
||||||
|
run('git','worktree','remove','--force',str(checkout))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser=argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument('--publish',action='store_true')
|
||||||
|
parser.add_argument('--limit',type=int,default=5)
|
||||||
|
parser.add_argument('--report',type=Path,default=Path('mcp-upstream-report.json'))
|
||||||
|
args=parser.parse_args()
|
||||||
|
if args.limit<1:parser.error('limit 必须大于零')
|
||||||
|
repository=os.environ.get('GITHUB_REPOSITORY','desirecore/registry');actor=os.environ.get('GITHUB_ACTOR','')
|
||||||
|
if args.publish and (repository!='desirecore/registry' or not re.fullmatch('[A-Za-z0-9-]+',actor)):
|
||||||
|
parser.error('仅允许官方仓库使用触发用户身份发布')
|
||||||
|
rows=[];failed=False;count=0
|
||||||
|
try:
|
||||||
|
for path in sorted((ROOT/'entries').glob('*/manifest.json')):
|
||||||
|
manifest=json.loads(path.read_text())
|
||||||
|
if manifest.get('type')!='mcp':continue
|
||||||
|
try:
|
||||||
|
sidecar_path=path.parent/'catalog-metadata.v1.json'
|
||||||
|
metadata=json.loads(sidecar_path.read_text()) if sidecar_path.exists() else {}
|
||||||
|
result=discover(manifest,version_scheme=metadata.get('release',{}).get('versionScheme'))
|
||||||
|
except (OSError,ValueError,KeyError,RuntimeError) as error:
|
||||||
|
result={'id':manifest['id'],'listedVersion':manifest['version'],'status':'check-failed','reason':str(error)[:300]};failed=True
|
||||||
|
rows.append(result)
|
||||||
|
if result['status']=='outdated' and args.publish and count<args.limit:
|
||||||
|
try:
|
||||||
|
created = publish(ROOT,manifest,metadata,result,actor,repository)
|
||||||
|
if created: count+=1
|
||||||
|
except (OSError,ValueError,KeyError,subprocess.SubprocessError) as error:
|
||||||
|
count+=1
|
||||||
|
result.update(status='publish-failed',reason=str(error)[:300]);failed=True
|
||||||
|
finally:
|
||||||
|
write_report(rows,args.report)
|
||||||
|
if failed:raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
"""MCP 来源发现与固定制品审核的相关单文件测试;不执行上游代码。"""
|
||||||
|
import base64
|
||||||
|
import copy
|
||||||
|
import hashlib
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
import tarfile
|
||||||
|
import tempfile
|
||||||
|
import subprocess
|
||||||
|
import unittest
|
||||||
|
import zipfile
|
||||||
|
from pathlib import Path
|
||||||
|
from mcp_updates import discover, prepare_update, AuditBlocked, inspect_archive, fixed_artifact
|
||||||
|
|
||||||
|
|
||||||
|
def archive(version='1.0.0', dependencies=None, license_text=b'MIT previously reviewed', link=False):
|
||||||
|
manifest={'name':'example-mcp','version':version,'license':'MIT','engines':{'node':'>=22'},'dependencies':dependencies or {'example':'1.0.0'}}
|
||||||
|
output=io.BytesIO()
|
||||||
|
with tarfile.open(fileobj=output,mode='w:gz') as tar:
|
||||||
|
for name,body in {'package/package.json':json.dumps(manifest).encode(),'package/LICENSE':license_text,'package/main.js':b'throw new Error("must not execute")'}.items():
|
||||||
|
info=tarfile.TarInfo(name);info.size=len(body);tar.addfile(info,io.BytesIO(body))
|
||||||
|
if link:
|
||||||
|
info=tarfile.TarInfo('package/alias');info.type=tarfile.SYMTYPE;info.linkname='/etc/passwd';tar.addfile(info)
|
||||||
|
return output.getvalue()
|
||||||
|
|
||||||
|
|
||||||
|
def published(version, body):
|
||||||
|
return {'name':'example-mcp','version':version,'dist':{'tarball':f'https://registry.npmjs.org/example-mcp/-/example-mcp-{version}.tgz','integrity':'sha512-'+base64.b64encode(hashlib.sha512(body).digest()).decode()}}
|
||||||
|
|
||||||
|
|
||||||
|
class McpUpdatesTests(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.old=archive();self.new=archive('1.1.0')
|
||||||
|
self.manifest={'id':'demo-mcp','name':'Demo','type':'mcp','version':'1.0.0','description':'Example service','install':{'method':'npx','packageName':'example-mcp','command':'npx','args':['--yes','--ignore-scripts','example-mcp@1.0.0']},'connection':{'transport':'stdio','command':'npx','args':['--yes','--ignore-scripts','example-mcp@1.0.0']}}
|
||||||
|
self.sidecar={'identity':{'kind':'service','id':'demo-mcp'},'presentation':{'i18n':{'zh-CN':{'summary':'示例服务'}}},'release':{'state':'known','version':'1.0.0','versionScheme':'semver'},'provenance':{'content':{'kind':'package','url':'https://www.npmjs.com/package/example-mcp','ref':'1.0.0','sha256':hashlib.sha256(self.old).hexdigest(),'path':'package'}},'governance':{'availability':'installable','license':{'state':'known','value':'MIT','evidencePath':'LICENSE'},'redistribution':'allowed','compliance':{'reviewedRef':'1.0.0','reviewedAt':'2026-10-01','reviewedBy':'previous-reviewer','licenseEvidencePath':'LICENSE','upstreamEndorsed':False}},'timestamps':{}}
|
||||||
|
self.documents={'https://registry.npmjs.org/example-mcp/latest':published('1.1.0',self.new),'https://registry.npmjs.org/example-mcp/1.0.0':published('1.0.0',self.old)}
|
||||||
|
self.artifacts={published('1.0.0',self.old)['dist']['tarball']:self.old,published('1.1.0',self.new)['dist']['tarball']:self.new}
|
||||||
|
|
||||||
|
def prepare(self):
|
||||||
|
result=discover(self.manifest,self.documents.__getitem__)
|
||||||
|
return prepare_update(self.manifest,self.sidecar,result,self.documents.__getitem__,self.artifacts.__getitem__,'2026-10-31T08:00:00Z')
|
||||||
|
|
||||||
|
def test_discovers_npm_and_never_executes_the_package(self):
|
||||||
|
result=discover(self.manifest,self.documents.__getitem__)
|
||||||
|
self.assertEqual(result['status'],'outdated');self.assertEqual(result['latestVersion'],'1.1.0')
|
||||||
|
manifest,sidecar,audit=self.prepare()
|
||||||
|
self.assertEqual(manifest['connection']['args'][-1],'example-mcp@1.1.0')
|
||||||
|
self.assertEqual(sidecar['governance']['compliance']['reviewedRef'],'1.1.0')
|
||||||
|
self.assertTrue(sidecar['governance']['compliance']['reviewedBy'].startswith('automated:'))
|
||||||
|
self.assertFalse(sidecar['governance']['compliance']['upstreamEndorsed'])
|
||||||
|
self.assertEqual(audit['contentSha256'],hashlib.sha256(self.new).hexdigest())
|
||||||
|
self.assertNotIn('source',manifest)
|
||||||
|
# Python 实际生成的回执交给 Node 真实共享契约,不用另造成功回执冒充组合验收。
|
||||||
|
with tempfile.TemporaryDirectory() as temporary:
|
||||||
|
payload=Path(temporary)/'receipt.json';payload.write_text(json.dumps({'manifest':manifest,'catalog':sidecar,'receipt':audit}))
|
||||||
|
code="import fs from 'node:fs'; import {validateMcpPackageReview} from './scripts/catalog/automated-mcp-review.mjs'; const p=JSON.parse(fs.readFileSync(process.argv[1],'utf8')); const errors=validateMcpPackageReview(p.manifest,p.catalog,p.receipt); if(errors.length) throw new Error(errors.join(';'));"
|
||||||
|
subprocess.run(['node','--input-type=module','-e',code,str(payload)],cwd=Path(__file__).resolve().parents[2],check=True,capture_output=True,text=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_current_and_rollback_are_distinct(self):
|
||||||
|
self.documents['https://registry.npmjs.org/example-mcp/latest']=published('1.0.0',self.old)
|
||||||
|
self.assertEqual(discover(self.manifest,self.documents.__getitem__)['status'],'current')
|
||||||
|
self.documents['https://registry.npmjs.org/example-mcp/latest']=published('0.9.0',self.old)
|
||||||
|
self.assertEqual(discover(self.manifest,self.documents.__getitem__)['status'],'upstream-version-behind')
|
||||||
|
|
||||||
|
def test_remote_and_parent_app_are_not_local_updates(self):
|
||||||
|
self.assertEqual(discover({'id':'hosted','type':'mcp','version':'1.0','connection':{'transport':'streamable-http','url':'https://example.com/mcp'}},lambda _:None)['status'],'remote-managed')
|
||||||
|
self.assertEqual(discover({'id':'app','type':'mcp','version':'1.0','sourceAppId':'example','connection':{'transport':'stdio'}},lambda _:None)['status'],'app-managed')
|
||||||
|
|
||||||
|
def test_version_scheme_mismatch_is_not_reported_as_current_or_downgraded(self):
|
||||||
|
manifest={**self.manifest,'version':'2026.1.26'}
|
||||||
|
result=discover(manifest,lambda url:published('2.0.1',self.new),version_scheme='calver')
|
||||||
|
self.assertEqual(result['status'],'version-scheme-mismatch')
|
||||||
|
self.assertEqual(discover(self.manifest,lambda url:published('1.1.0',self.new),version_scheme='opaque')['status'],'manual-review-required')
|
||||||
|
|
||||||
|
def test_malformed_registry_payload_is_a_reportable_audit_block(self):
|
||||||
|
with self.assertRaises(AuditBlocked):discover(self.manifest,lambda url:[])
|
||||||
|
for payload in [{'urls':None},{'urls':[None]},{'urls':[{'filename':'x-none-any.whl','digests':None}]}]:
|
||||||
|
with self.subTest(payload=payload),self.assertRaises(AuditBlocked):fixed_artifact(payload,'pypi')
|
||||||
|
|
||||||
|
def test_changed_license_paths_are_available_for_review_without_copying_sources(self):
|
||||||
|
body=archive('1.1.0',license_text=b'changed terms')
|
||||||
|
self.documents['https://registry.npmjs.org/example-mcp/latest']=published('1.1.0',body)
|
||||||
|
self.artifacts[published('1.1.0',body)['dist']['tarball']]=body
|
||||||
|
with self.assertRaises(AuditBlocked) as raised:self.prepare()
|
||||||
|
self.assertEqual(raised.exception.findings,{'licenseOrNoticePaths':['LICENSE']})
|
||||||
|
|
||||||
|
def test_pypi_discovery_and_unsupported_feed_are_explicit(self):
|
||||||
|
manifest={**self.manifest,'install':{'method':'uvx','packageName':'example-mcp'}}
|
||||||
|
result=discover(manifest,lambda url:{'info':{'name':'example-mcp','version':'1.2.0'},'urls':[]})
|
||||||
|
self.assertEqual(result['latestVersion'],'1.2.0');self.assertEqual(result['ecosystem'],'pypi')
|
||||||
|
manifest['install']={'method':'docker','packageName':'ghcr.io/example/server'}
|
||||||
|
self.assertEqual(discover(manifest,lambda _:None)['status'],'requires-version-feed')
|
||||||
|
|
||||||
|
def test_license_dependency_link_and_digest_changes_block_automatic_approval(self):
|
||||||
|
for body in [archive('1.1.0',license_text=b'new terms'),archive('1.1.0',dependencies={'example':'2'}),archive('1.1.0',link=True)]:
|
||||||
|
with self.subTest(sha=hashlib.sha256(body).hexdigest()):
|
||||||
|
self.new=body;self.documents['https://registry.npmjs.org/example-mcp/latest']=published('1.1.0',body);self.artifacts[published('1.1.0',body)['dist']['tarball']]=body
|
||||||
|
with self.assertRaises(AuditBlocked):self.prepare()
|
||||||
|
self.new=archive('1.1.0');self.documents['https://registry.npmjs.org/example-mcp/latest']=published('1.1.0',self.new)
|
||||||
|
self.artifacts[published('1.1.0',self.new)['dist']['tarball']]=b'corrupt'
|
||||||
|
with self.assertRaises(AuditBlocked):self.prepare()
|
||||||
|
|
||||||
|
def test_listing_only_is_not_promoted(self):
|
||||||
|
self.sidecar['governance']['availability']='listing-only'
|
||||||
|
with self.assertRaisesRegex(AuditBlocked,'准入'):self.prepare()
|
||||||
|
self.assertEqual(self.sidecar['governance']['availability'],'listing-only')
|
||||||
|
|
||||||
|
def test_runtime_claims_need_new_evidence(self):
|
||||||
|
self.sidecar['presentation']['i18n']['zh-CN']['description']='版本 1.0.0 已进行真实运行验收'
|
||||||
|
with self.assertRaisesRegex(AuditBlocked,'版本相关'):self.prepare()
|
||||||
|
|
||||||
|
def test_github_container_feed_is_discovered_without_pulling_images(self):
|
||||||
|
manifest={**self.manifest,'id':'github-mcp','install':{'method':'docker','packageName':'ghcr.io/github/github-mcp-server'}}
|
||||||
|
result=discover(manifest,lambda url:{'tag_name':'v1.2.0'})
|
||||||
|
self.assertEqual(result['status'],'outdated')
|
||||||
|
self.assertEqual(result['ecosystem'],'github-release')
|
||||||
|
with self.assertRaisesRegex(AuditBlocked,'容器'):prepare_update(manifest,self.sidecar,result)
|
||||||
|
|
||||||
|
def test_pypi_wheel_is_verified_and_versioned_license_path_advances(self):
|
||||||
|
def wheel(version,dependency='example==1'):
|
||||||
|
output=io.BytesIO()
|
||||||
|
with zipfile.ZipFile(output,'w') as bundle:
|
||||||
|
bundle.writestr(f'example_mcp-{version}.dist-info/METADATA',f'Name: example-mcp\nVersion: {version}\nLicense: MIT\nRequires-Python: >=3.10\nRequires-Dist: {dependency}\n')
|
||||||
|
bundle.writestr(f'example_mcp-{version}.dist-info/licenses/LICENSE','previously reviewed license')
|
||||||
|
bundle.writestr('example_mcp/main.py','raise Exception("must not execute")')
|
||||||
|
return output.getvalue()
|
||||||
|
def metadata(version,body):
|
||||||
|
return {'info':{'name':'example-mcp','version':version},'urls':[{'filename':f'example_mcp-{version}-py3-none-any.whl','url':f'https://files.pythonhosted.org/example_mcp-{version}-py3-none-any.whl','digests':{'sha256':hashlib.sha256(body).hexdigest()}}]}
|
||||||
|
old,new=wheel('1.0.0'),wheel('1.1.0')
|
||||||
|
manifest=copy.deepcopy(self.manifest)
|
||||||
|
for config in [manifest['install'],manifest['connection']]:config.update(command='uvx',args=['example-mcp==1.0.0'])
|
||||||
|
manifest['install']['method']='uvx'
|
||||||
|
sidecar=copy.deepcopy(self.sidecar)
|
||||||
|
sidecar['provenance']['content'].update(url='https://pypi.org/project/example-mcp/',sha256=hashlib.sha256(old).hexdigest())
|
||||||
|
sidecar['provenance']['content'].pop('path',None)
|
||||||
|
path='example_mcp-1.0.0.dist-info/licenses/LICENSE'
|
||||||
|
sidecar['governance']['license']['evidencePath']=path
|
||||||
|
sidecar['governance']['compliance']['licenseEvidencePath']=path
|
||||||
|
result=discover(manifest,lambda url:metadata('1.1.0',new))
|
||||||
|
result['metadata']=metadata('1.1.0',new)
|
||||||
|
artifacts={metadata('1.0.0',old)['urls'][0]['url']:old,metadata('1.1.0',new)['urls'][0]['url']:new}
|
||||||
|
updated,catalog,receipt=prepare_update(manifest,sidecar,result,lambda url:metadata('1.0.0',old),artifacts.__getitem__)
|
||||||
|
self.assertEqual(updated['connection']['args'],['example-mcp==1.1.0'])
|
||||||
|
self.assertIn('example_mcp-1.1.0.dist-info/licenses/LICENSE',receipt['licenseEvidenceSha256'])
|
||||||
|
self.assertEqual(catalog['governance']['compliance']['licenseEvidencePath'],'example_mcp-1.1.0.dist-info/licenses/LICENSE')
|
||||||
|
# 所需 Python 或依赖变化不能机械继承。
|
||||||
|
changed=wheel('1.1.0',dependency='example==2')
|
||||||
|
result['metadata']=metadata('1.1.0',changed);artifacts[result['metadata']['urls'][0]['url']]=changed
|
||||||
|
with self.assertRaisesRegex(AuditBlocked,'依赖'):prepare_update(manifest,sidecar,result,lambda url:metadata('1.0.0',old),artifacts.__getitem__)
|
||||||
|
|
||||||
|
def test_package_identity_and_foreign_urls_cannot_be_rewritten(self):
|
||||||
|
self.manifest['connection']['args']=['another-package@1.0.0']
|
||||||
|
with self.assertRaises(AuditBlocked):self.prepare()
|
||||||
|
self.manifest['install']['packageName']='https://attacker.invalid/file'
|
||||||
|
self.assertEqual(discover(self.manifest,lambda _:None)['status'],'invalid-package-identity')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':unittest.main()
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
"""发布与失败报告的单文件回归;GitHub/Git 使用替身,不发送真实 PR。"""
|
||||||
|
import copy
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
from unittest.mock import patch
|
||||||
|
import propose_mcp_updates as publisher
|
||||||
|
from mcp_updates import AuditBlocked
|
||||||
|
|
||||||
|
|
||||||
|
class ProposalTests(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.manifest={'id':'demo-mcp','type':'mcp','version':'1.0.0'}
|
||||||
|
self.metadata={'governance':{'compliance':{'reviewedRef':'1.0.0','reviewedBy':'previous-reviewer'}}}
|
||||||
|
self.result={'id':'demo-mcp','listedVersion':'1.0.0','latestVersion':'1.1.0','status':'outdated','metadataUrl':'https://registry.npmjs.org/demo-mcp/latest'}
|
||||||
|
|
||||||
|
def publish(self, blocked=False, validation_failure=False):
|
||||||
|
with tempfile.TemporaryDirectory() as temporary:
|
||||||
|
root=Path(temporary);folder=root/'entries/demo-mcp';folder.mkdir(parents=True)
|
||||||
|
(folder/'manifest.json').write_text(json.dumps(self.manifest));(folder/'catalog-metadata.v1.json').write_text(json.dumps(self.metadata))
|
||||||
|
seen={}
|
||||||
|
def run(*args,cwd=None):
|
||||||
|
if args[:3]==('gh','pr','list'):return '[]'
|
||||||
|
if args[:3]==('git','worktree','add'):shutil.copytree(root/'entries',Path(args[4])/'entries')
|
||||||
|
if args[:2]==('git','restore'):
|
||||||
|
shutil.copyfile(folder/'manifest.json',cwd/'entries/demo-mcp/manifest.json')
|
||||||
|
shutil.copyfile(folder/'catalog-metadata.v1.json',cwd/'entries/demo-mcp/catalog-metadata.v1.json')
|
||||||
|
if args[0]=='node' and validation_failure:raise subprocess.CalledProcessError(1,args)
|
||||||
|
if args[:3]==('gh','pr','create'):
|
||||||
|
seen['draft']='--draft' in args
|
||||||
|
seen['manifest']=json.loads((cwd/'entries/demo-mcp/manifest.json').read_text())
|
||||||
|
seen['metadata']=json.loads((cwd/'entries/demo-mcp/catalog-metadata.v1.json').read_text())
|
||||||
|
seen['candidate']=(cwd/'entries/demo-mcp/upstream-update-candidate.json').exists()
|
||||||
|
return ''
|
||||||
|
updated={**self.manifest,'version':'1.1.0'}
|
||||||
|
with patch.object(publisher,'ROOT',root),patch.object(publisher,'run',side_effect=run),patch.object(publisher,'prepare_update',return_value=(updated,self.metadata,{'reviewer':'automated:test'}),side_effect=AuditBlocked('license changed') if blocked else None):
|
||||||
|
result=copy.deepcopy(self.result)
|
||||||
|
self.assertTrue(publisher.publish(root,self.manifest,self.metadata,result,'fixture-user','desirecore/registry'))
|
||||||
|
seen['result']=result
|
||||||
|
return seen
|
||||||
|
|
||||||
|
def test_successful_audit_and_validators_open_a_normal_pr(self):
|
||||||
|
result=self.publish();self.assertFalse(result['draft']);self.assertFalse(result['candidate']);self.assertEqual(result['manifest']['version'],'1.1.0')
|
||||||
|
|
||||||
|
def test_blocked_audit_only_opens_a_candidate_draft_without_changing_old_facts(self):
|
||||||
|
result=self.publish(blocked=True);self.assertTrue(result['draft']);self.assertTrue(result['candidate'])
|
||||||
|
self.assertEqual(result['manifest'],self.manifest);self.assertEqual(result['metadata'],self.metadata)
|
||||||
|
self.assertEqual(result['result']['status'],'review-blocked')
|
||||||
|
|
||||||
|
def test_failed_catalog_validation_restores_old_metadata_before_draft(self):
|
||||||
|
result=self.publish(validation_failure=True);self.assertTrue(result['draft']);self.assertEqual(result['manifest'],self.manifest)
|
||||||
|
|
||||||
|
def test_existing_branch_without_pr_is_recovered_as_a_draft_without_overwriting(self):
|
||||||
|
calls=[]
|
||||||
|
def run(*args,**kwargs):
|
||||||
|
calls.append(args)
|
||||||
|
if args[:3]==('gh','pr','list'):return '[]'
|
||||||
|
if args[:2]==('gh','api'):return 'a'*40
|
||||||
|
return ''
|
||||||
|
with patch.object(publisher,'run',side_effect=run),patch.object(publisher,'prepare_update') as prepare:
|
||||||
|
result=copy.deepcopy(self.result)
|
||||||
|
self.assertTrue(publisher.publish(Path('/unused'),self.manifest,self.metadata,result,'fixture-user','desirecore/registry'))
|
||||||
|
self.assertTrue(any(args[:3]==('gh','pr','create') and '--draft' in args for args in calls))
|
||||||
|
self.assertFalse(any(args[0]=='git' for args in calls))
|
||||||
|
prepare.assert_not_called()
|
||||||
|
|
||||||
|
def test_existing_candidates_do_not_consume_the_daily_new_candidate_budget(self):
|
||||||
|
with tempfile.TemporaryDirectory() as temporary:
|
||||||
|
root=Path(temporary)
|
||||||
|
for name in ['a-mcp','b-mcp']:
|
||||||
|
folder=root/'entries'/name;folder.mkdir(parents=True)
|
||||||
|
(folder/'manifest.json').write_text(json.dumps({**self.manifest,'id':name}))
|
||||||
|
(folder/'catalog-metadata.v1.json').write_text(json.dumps(self.metadata))
|
||||||
|
calls=[]
|
||||||
|
def publish(*args):
|
||||||
|
calls.append(args[1]['id']);return len(calls)>1
|
||||||
|
with patch.object(publisher,'ROOT',root),patch.object(publisher,'discover',side_effect=lambda item,**kwargs:{**self.result,'id':item['id']}),patch.object(publisher,'publish',side_effect=publish),patch.dict(os.environ,{'GITHUB_REPOSITORY':'desirecore/registry','GITHUB_ACTOR':'fixture-user'}),patch('sys.argv',['propose','--publish','--limit','1','--report',str(root/'report.json')]):
|
||||||
|
publisher.main()
|
||||||
|
self.assertEqual(calls,['a-mcp','b-mcp'])
|
||||||
|
|
||||||
|
def test_check_failure_is_reported_and_other_sources_still_run(self):
|
||||||
|
with tempfile.TemporaryDirectory() as temporary:
|
||||||
|
root=Path(temporary)
|
||||||
|
for name in ['a-mcp','b-mcp']:
|
||||||
|
folder=root/'entries'/name;folder.mkdir(parents=True)
|
||||||
|
(folder/'manifest.json').write_text(json.dumps({**self.manifest,'id':name}))
|
||||||
|
with patch.object(publisher,'ROOT',root),patch.object(publisher,'discover',side_effect=[OSError('offline'),{'id':'b-mcp','status':'remote-managed'}]),patch('sys.argv',['propose','--report',str(root/'report.json')]):
|
||||||
|
with self.assertRaises(SystemExit):publisher.main()
|
||||||
|
rows=json.loads((root/'report.json').read_text())
|
||||||
|
self.assertEqual([row['status'] for row in rows],['check-failed','remote-managed'])
|
||||||
|
self.assertTrue((root/'report.md').is_file())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':unittest.main()
|
||||||
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url'
|
|||||||
import Ajv from 'ajv'
|
import Ajv from 'ajv'
|
||||||
import { findStaticMetrics } from './catalog/static-metadata.mjs'
|
import { findStaticMetrics } from './catalog/static-metadata.mjs'
|
||||||
import { validateApplicationContract } from './catalog/application-contract.mjs'
|
import { validateApplicationContract } from './catalog/application-contract.mjs'
|
||||||
import { validateApplicationReleaseContract } from './catalog/application-release-contract.mjs'
|
import { AUTHORED_ENTRY_SCHEMA_FILENAME, isAuthoredRegistryEntry } from './catalog/entry-schema.mjs'
|
||||||
|
|
||||||
const scriptDirectory = dirname(fileURLToPath(import.meta.url))
|
const scriptDirectory = dirname(fileURLToPath(import.meta.url))
|
||||||
const rootArgumentIndex = process.argv.indexOf('--root')
|
const rootArgumentIndex = process.argv.indexOf('--root')
|
||||||
@@ -282,6 +282,7 @@ const validateExternalIntegration = async (entryDirectory, manifest) => {
|
|||||||
const schemaVersion = (await readText(join(repositoryRoot, 'SCHEMA_VERSION')))?.trim()
|
const schemaVersion = (await readText(join(repositoryRoot, 'SCHEMA_VERSION')))?.trim()
|
||||||
const rootManifest = await readJson(join(repositoryRoot, 'manifest.json'))
|
const rootManifest = await readJson(join(repositoryRoot, 'manifest.json'))
|
||||||
const entrySchema = await readJson(join(repositoryRoot, 'schemas', 'registry-entry.schema.json'))
|
const entrySchema = await readJson(join(repositoryRoot, 'schemas', 'registry-entry.schema.json'))
|
||||||
|
const authoredEntrySchema = await readJson(join(repositoryRoot, 'schemas', AUTHORED_ENTRY_SCHEMA_FILENAME))
|
||||||
|
|
||||||
if (!schemaVersion || !/^\d+\.\d+\.\d+$/.test(schemaVersion)) {
|
if (!schemaVersion || !/^\d+\.\d+\.\d+$/.test(schemaVersion)) {
|
||||||
addError('SCHEMA_VERSION: expected a semantic version')
|
addError('SCHEMA_VERSION: expected a semantic version')
|
||||||
@@ -291,16 +292,22 @@ if (rootManifest) {
|
|||||||
if (rootManifest.dataVersion !== schemaVersion) addError('manifest.json#dataVersion must equal SCHEMA_VERSION')
|
if (rootManifest.dataVersion !== schemaVersion) addError('manifest.json#dataVersion must equal SCHEMA_VERSION')
|
||||||
}
|
}
|
||||||
|
|
||||||
let validateEntry = null
|
const compileEntrySchema = (schema, filename) => {
|
||||||
if (entrySchema) {
|
if (schema === null || Array.isArray(schema) || !['object', 'boolean'].includes(typeof schema)) {
|
||||||
|
addError(`schemas/${filename}: Schema root must be an object or boolean`)
|
||||||
|
return null
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// Draft-07 条件块补充父 Schema 的约束;无需在每个 then/not 再写局部 type。
|
// Draft-07 条件块补充父 Schema 的约束;无需在每个 then/not 再写局部 type。
|
||||||
const ajv = new Ajv({ allErrors: true, strict: true, strictTypes: false, strictRequired: false, validateFormats: false })
|
const ajv = new Ajv({ allErrors: true, strict: true, strictTypes: false, strictRequired: false, validateFormats: false })
|
||||||
validateEntry = ajv.compile(entrySchema)
|
return ajv.compile(schema)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addError(`schemas/registry-entry.schema.json: unable to compile (${error.message})`)
|
addError(`schemas/${filename}: unable to compile (${error.message})`)
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const validateEntry = compileEntrySchema(entrySchema, 'registry-entry.schema.json')
|
||||||
|
const validateAuthoredEntry = compileEntrySchema(authoredEntrySchema, AUTHORED_ENTRY_SCHEMA_FILENAME)
|
||||||
|
|
||||||
const manifests = []
|
const manifests = []
|
||||||
const seenIds = new Set()
|
const seenIds = new Set()
|
||||||
@@ -345,11 +352,11 @@ for (const directoryEntry of await readdir(entriesRoot, { withFileTypes: true })
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateEntry && !validateEntry(manifest)) {
|
const validateManifest = isAuthoredRegistryEntry(manifest) ? validateAuthoredEntry : validateEntry
|
||||||
addError(`entries/${directoryEntry.name}/manifest.json: ${formatAjvErrors(validateEntry.errors)}`)
|
if (validateManifest && !validateManifest(manifest)) {
|
||||||
|
addError(`entries/${directoryEntry.name}/manifest.json: ${formatAjvErrors(validateManifest.errors)}`)
|
||||||
}
|
}
|
||||||
for (const message of validateApplicationContract(manifest)) addError(`entries/${directoryEntry.name}/manifest.json: ${message}`)
|
for (const message of validateApplicationContract(manifest)) addError(`entries/${directoryEntry.name}/manifest.json: ${message}`)
|
||||||
for (const message of validateApplicationReleaseContract(manifest)) addError(`entries/${directoryEntry.name}/manifest.json: ${message}`)
|
|
||||||
if (manifest.type === 'external-integration') {
|
if (manifest.type === 'external-integration') {
|
||||||
await validateExternalIntegration(entryDirectory, manifest)
|
await validateExternalIntegration(entryDirectory, manifest)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user