From fdefd474aed3e9bf56ee180e2c9c442934af7ddb Mon Sep 17 00:00:00 2001 From: Yige Date: Mon, 2 Nov 2026 21:54:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8A=E6=9E=B6=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=89=AA=E8=BE=91=E5=9B=BA=E5=AE=9A=E5=BA=94=E7=94=A8=E6=9D=90?= =?UTF-8?q?=E6=96=99=20(#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 发布固定 0.1.3 归档与独立 UUID 条目,保留旧全局 Schema,并补齐内联作者定义校验。客户端 197 与默认市场安装闭环仍须分别验证。 Publish the fixed 0.1.3 archive and UUID listing, preserving the existing global Schema and validating inline authored definitions. Client distribution and fresh market installation remain separate gates. --- README.md | 18 +- .../catalog-metadata.v1.json | 119 + .../install.md | 29 + .../manifest.json | 100 + .../review.md | 21 + .../usage.md | 15 + manifest.json | 6 +- package.json | 2 +- schemas/registry-entry.v4.3.schema.json | 5242 +++++++++++++++++ scripts/authored-release.test.mjs | 146 + scripts/catalog/application-contract.mjs | 33 +- scripts/catalog/entry-schema.mjs | 10 + scripts/catalog/json-schema.mjs | 7 + scripts/catalog/validator.mjs | 32 +- scripts/catalog/validator.test.mjs | 4 +- scripts/validate-registry.mjs | 21 +- 16 files changed, 5780 insertions(+), 25 deletions(-) create mode 100644 entries/0171a763-ad35-4b94-98b9-204782817b44/catalog-metadata.v1.json create mode 100644 entries/0171a763-ad35-4b94-98b9-204782817b44/install.md create mode 100644 entries/0171a763-ad35-4b94-98b9-204782817b44/manifest.json create mode 100644 entries/0171a763-ad35-4b94-98b9-204782817b44/review.md create mode 100644 entries/0171a763-ad35-4b94-98b9-204782817b44/usage.md create mode 100644 schemas/registry-entry.v4.3.schema.json create mode 100644 scripts/authored-release.test.mjs create mode 100644 scripts/catalog/entry-schema.mjs diff --git a/README.md b/README.md index 8efe981..f7c22b1 100644 --- a/README.md +++ b/README.md @@ -42,16 +42,20 @@ DesireCore 客户端启动时会克隆此仓库,并定期同步更新。用户 [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 联调。 -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) 插件仍是统一 App 产品,`productKind: plugin` 表示它向宿主提供能力;`productKind: application` 表示它交付独立业务。`type` 只区分交付形态:Docker、宿主进程或纯声明 `artifact`。插件使用同一来源内产品 ID、版本、安装材料与安装登记,不重复创建 MCP 服务或第二份安装事实。 @@ -72,6 +76,16 @@ Catalog sidecar 的 App spec 同步 `productKind`、可选 `extension` 和入口 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. +## 固定应用材料的作者契约 + +仓库根 `SCHEMA_VERSION` 与 `schemas/registry-entry.schema.json` 继续保留已发布的 4.2 格式及其原始摘要。`type: web-bundle` 或显式声明 `appRelease` 的条目,由两个校验入口统一选择独立的 `schemas/registry-entry.v4.3.schema.json`;普通应用、服务和外部集成继续使用原有 Schema。作者 Schema 不升级客户端,也不允许条目自报官方来源或信任。 + +`appRelease` 固定材料的 `releaseDigest`、`app-release.json` 与必要 capabilities。作者定义来自清单内联 `definition` 时声明 `definitionSource: manifest`;旧包内独立定义文件继续声明 `definitionPath`。两种来源互斥,不可为内联定义编造一个文件路径。获取后,客户端仍须核验归档字节、清单与文件,并比较真实产品 UUID、入口和放置策略。 + +作者材料来源只允许不可变 HTTPS `git` 或 `release`,必须分别提供固定提交 `source.ref` 和实际归档响应体的 `source.sha256`;归档摘要不能用 `releaseDigest` 代替。Git 归档还需声明实际包内的规范相对目录 `source.path`。`native-app` 和 Docker 作者条目使用 `install.method: release`,Web bundle 使用 `web-bundle`;能力握手、MCP 授权与运行归属仍以真实安装流程为准。 + +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. + ## 条目格式 每个条目是 `entries//` 下的一个目录,目录名即条目 ID。 diff --git a/entries/0171a763-ad35-4b94-98b9-204782817b44/catalog-metadata.v1.json b/entries/0171a763-ad35-4b94-98b9-204782817b44/catalog-metadata.v1.json new file mode 100644 index 0000000..4e1fcee --- /dev/null +++ b/entries/0171a763-ad35-4b94-98b9-204782817b44/catalog-metadata.v1.json @@ -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。197 客户端正在发行准备,旧公开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. Client 197 is being prepared; the public 196 package lacks the reader. 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-02", + "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" + ] + } +} diff --git a/entries/0171a763-ad35-4b94-98b9-204782817b44/install.md b/entries/0171a763-ad35-4b94-98b9-204782817b44/install.md new file mode 100644 index 0000000..654b309 --- /dev/null +++ b/entries/0171a763-ad35-4b94-98b9-204782817b44/install.md @@ -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. Client 197 is being prepared; public 196 lacks the reader. 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. diff --git a/entries/0171a763-ad35-4b94-98b9-204782817b44/manifest.json b/entries/0171a763-ad35-4b94-98b9-204782817b44/manifest.json new file mode 100644 index 0000000..79f9bdb --- /dev/null +++ b/entries/0171a763-ad35-4b94-98b9-204782817b44/manifest.json @@ -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。197 客户端正在发行准备,旧公开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。197 仍在发行准备;公开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" + ] + } +} diff --git a/entries/0171a763-ad35-4b94-98b9-204782817b44/review.md b/entries/0171a763-ad35-4b94-98b9-204782817b44/review.md new file mode 100644 index 0000000..aeeb470 --- /dev/null +++ b/entries/0171a763-ad35-4b94-98b9-204782817b44/review.md @@ -0,0 +1,21 @@ +# 视频剪辑固定材料审阅与发布边界 + +独立“视频剪辑”,与既有视频创作/视频导演分开。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并须实际capability检查;197正在发行准备,公开196实际tag源没有该reader。目录main未合前保持Draft,不宣称上架。两个目录合入与兼容客户端实际可得后,仍需全新隔离home沿默认官方main获取/安装应用和数字员工、核所有者、正常关联/独立MCP授权与实际编辑预览/导出。availability=installable只允许现有受治理获取流程,不是当前安装、运行或授权事实。 + +English: The fixed 0.1.3 archive is publicly available and downloaded bytes match the reviewed material and merged source. The independent fork retains FableCut history and notices. Qualification is bounded to the stated macOS source, unsigned Windows and Ubuntu/WSLg source GUIs; original recovery/timing failures and unchanged-domain boundaries remain explicit. The new client reader, catalog publication and fresh default-market acquisition/use are separate gates. Client 197 is not public yet; public 196 lacks the reader. This listing grants no permissions or runtime ownership. diff --git a/entries/0171a763-ad35-4b94-98b9-204782817b44/usage.md b/entries/0171a763-ad35-4b94-98b9-204782817b44/usage.md new file mode 100644 index 0000000..5bff0dd --- /dev/null +++ b/entries/0171a763-ad35-4b94-98b9-204782817b44/usage.md @@ -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的197客户端仍在发行准备;正式签名安装器、官方 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. The compatible 197 client and fresh default-market installation remain pending; production packages and model quality are separate. diff --git a/manifest.json b/manifest.json index 5a4586e..50c39e5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,11 +6,11 @@ "description": "DesireCore 官方注册表 — 应用、插件、MCP 服务、HTTP API 和第三方外部集成的统一目录", "maintainer": "DesireCore Team", "repository": "https://github.com/desirecore/registry", - "lastUpdated": "2026-10-25", + "lastUpdated": "2026-11-02", "stats": { - "totalEntries": 25, + "totalEntries": 26, "dockerApps": 8, - "nativeApps": 2, + "nativeApps": 3, "mcpServices": 9, "httpApis": 5, "externalIntegrations": 1 diff --git a/package.json b/package.json index 82b4685..44d758d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "validate": "node scripts/validate-registry.mjs", - "test": "node --test scripts/validate-registry.test.mjs scripts/native-app.test.mjs scripts/plugin-contract.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 && npm run validate" }, "devDependencies": { "ajv": "8.20.0" diff --git a/schemas/registry-entry.v4.3.schema.json b/schemas/registry-entry.v4.3.schema.json new file mode 100644 index 0000000..505ebf5 --- /dev/null +++ b/schemas/registry-entry.v4.3.schema.json @@ -0,0 +1,5242 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://github.com/desirecore/registry/schemas/registry-entry.schema.json", + "title": "DesireCore Registry Entry 4.3", + "description": "兼容保留4.2条目并新增固定应用release/web-bundle。候选Schema先审阅,客户端具备真实app-authoring-v1能力后才能开放条目。", + "oneOf": [ + { + "$ref": "#/definitions/dockerApp" + }, + { + "$ref": "#/definitions/nativeApp" + }, + { + "$ref": "#/definitions/artifact" + }, + { + "$ref": "#/definitions/mcp" + }, + { + "$ref": "#/definitions/httpApi" + }, + { + "$ref": "#/definitions/externalIntegration" + }, + { + "$ref": "#/definitions/webBundle" + }, + { + "$ref": "#/definitions/authoredNativeApp" + }, + { + "$ref": "#/definitions/authoredDockerApp" + } + ], + "definitions": { + "nativeApp": { + "type": "object", + "description": "宿主机原生应用:独立安装和运行,不通过 MCP 服务注册或 Docker 容器部署。", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "source", + "requiredClientVersion", + "placementPolicy", + "stewardship", + "availability", + "license", + "redistribution", + "listingMaintainer", + "upstreamMaintainer", + "branding", + "compliance", + "entrypoints" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "native-app" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "$ref": "#/definitions/platformSupport" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "requiredClientVersion": { + "$ref": "#/definitions/version" + }, + "install": { + "type": "object", + "required": [ + "method", + "requirements", + "configNeeded" + ], + "additionalProperties": false, + "properties": { + "method": { + "const": "native-node", + "description": "按审核后的 install.md 在宿主机安装固定 Node 制品;不自动启动应用或隧道。" + }, + "requirements": { + "type": "object", + "required": [ + "docker", + "node", + "minMemory", + "minDisk", + "ports" + ], + "additionalProperties": false, + "properties": { + "docker": { + "const": false + }, + "node": { + "type": "string", + "minLength": 1, + "maxLength": 80 + }, + "minMemory": { + "$ref": "#/definitions/nonEmptyString" + }, + "minDisk": { + "$ref": "#/definitions/nonEmptyString" + }, + "ports": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "description": "安装默认使用的本机管理页面端口,不是对外公网端口或内部服务。" + } + } + }, + "configNeeded": { + "type": "array", + "items": { + "$ref": "#/definitions/nonEmptyString" + } + } + } + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + }, + "productKind": { + "type": "string", + "enum": [ + "application", + "plugin" + ], + "description": "主要产品归属;应用提供独立业务,插件增加宿主能力。旧定义缺失时由受信适配层归一为 application。" + }, + "extension": { + "type": "object", + "required": [ + "apiVersion", + "hosts", + "runtime", + "contributes" + ], + "additionalProperties": false, + "properties": { + "apiVersion": { + "const": "1.0.0", + "description": "宿主扩展协议版本;当前支持 1.0.0。" + }, + "hosts": { + "type": "array", + "minItems": 1, + "maxItems": 2, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "agent-service", + "desktop-host" + ] + }, + "description": "执行宿主;未实现的宿主只作声明并显示不兼容,客户端展示面在 UI 定义中另行声明。" + }, + "runtime": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "const": "declarative", + "description": "仅由宿主读取声明,不创建执行进程。" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "kind", + "protocol", + "descriptorRef" + ], + "properties": { + "kind": { + "const": "service", + "description": "既有服务 owner 管理的协议连接;贡献调用继续走原授权和审批。" + }, + "protocol": { + "type": "string", + "enum": [ + "mcp", + "http" + ], + "description": "服务通信协议,不代表连接已经建立。" + }, + "descriptorRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + } + }, + "additionalProperties": false + } + ], + "description": "贡献执行承载;descriptor 只定位受核验材料,不能直接把任意 endpoint 当运行事实。" + }, + "contributes": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "id", + "point", + "contractVersion", + "definitionRef" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "产品内稳定贡献 ID;与来源、产品及精确安装实例共同定位运行绑定。" + }, + "point": { + "type": "string", + "enum": [ + "document.parsers", + "session.panels", + "session.widgets", + "session.actions", + "tools", + "skills" + ], + "description": "具有实际宿主消费者的贡献点;未知贡献点不得接入。" + }, + "contractVersion": { + "const": 1, + "description": "该贡献点的消费契约版本;不兼容版本不激活。" + }, + "definitionRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + } + }, + "description": "包内贡献定义引用;业务层补充贡献 ID 唯一性及内容摘要核验。" + }, + "description": "本产品提供的宿主贡献;仅消费能力的普通应用允许空数组,独立插件必须至少一项。每项定义从安装材料读取并核验。" + }, + "configurationSchemaRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + }, + "requires": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "sourceId", + "appId", + "contributionId", + "contractVersion", + "optional" + ], + "additionalProperties": false, + "properties": { + "sourceId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "直接依赖的受信产品来源,禁止按同名产品猜测。" + }, + "appId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "所依赖的应用或插件产品 ID;静态定义不携带安装实例 ID。" + }, + "contributionId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "消费方需要的具体贡献 ID。" + }, + "contractVersion": { + "const": 1, + "description": "消费方支持的贡献契约版本。" + }, + "optional": { + "type": "boolean", + "description": "true 为可选增强;false 缺失时阻断受影响功能,不自动安装或卸载。" + }, + "versionRange": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "可选发布版本 semver 范围,由满足性检查器校验。" + } + }, + "description": "直接能力依赖;运行时须显式解析兼容的精确安装实例,不建设递归依赖求解器。" + }, + "description": "本产品消费的必需或可选直接能力依赖;不产生使用授权。" + } + }, + "not": { + "properties": { + "contributes": { + "maxItems": 0 + }, + "requires": { + "maxItems": 0 + } + } + }, + "description": "产品提供或消费宿主能力的关系契约;至少声明一项贡献或依赖。普通应用可仅消费,独立插件仍须提供实际贡献。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "DesireCore 自带并随客户端发布的页面入口;第三方目录不得伪造此入口类型", + "required": [ + "id", + "name", + "kind", + "route" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "builtin", + "description": "内置页面入口判别字段" + }, + "route": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "客户端内置路由;必须是单斜杠开头的相对应用路由,不能是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由系统浏览器打开的目录声明入口;运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "external", + "description": "外部浏览器入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID;不是 URL,解析结果还需 HTTPS 或本机 loopback 校验" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "可选服务内路径;解析层禁止凭据、反斜杠和目录穿越" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + } + }, + "allOf": [ + { + "if": { + "properties": { + "productKind": { + "const": "plugin" + } + }, + "required": [ + "productKind" + ] + }, + "then": { + "required": [ + "extension" + ], + "properties": { + "extension": { + "properties": { + "contributes": { + "minItems": 1 + } + } + } + } + }, + "else": { + "properties": { + "entrypoints": { + "minItems": 1 + } + } + } + } + ] + }, + "nativeMaintainer": { + "type": "object", + "required": [ + "name", + "url" + ], + "additionalProperties": false, + "properties": { + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "url": { + "$ref": "#/definitions/httpsUrl" + }, + "verified": { + "type": "boolean" + } + } + }, + "id": { + "type": "string", + "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", + "description": "Stable entry identifier; must equal the containing directory name." + }, + "nonEmptyString": { + "type": "string", + "minLength": 1 + }, + "version": { + "type": "string", + "pattern": "^[0-9]+(?:\\.[0-9]+){1,3}(?:[-+][0-9A-Za-z.-]+)?$", + "description": "Entry or client version in dotted numeric form." + }, + "httpsUrl": { + "type": "string", + "pattern": "^https://[^\\s]+$", + "description": "An HTTPS URL without embedded whitespace." + }, + "platformSupport": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "macos", + "windows", + "linux" + ] + }, + "description": "Desktop platforms on which the entry is relevant." + }, + "tags": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": "Human-readable discovery and search tags." + }, + "capabilities": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[a-z0-9]+(?:_[a-z0-9]+)*$" + } + }, + "environment": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mcpInstall": { + "type": "object", + "required": [ + "method", + "command", + "args" + ], + "additionalProperties": false, + "properties": { + "method": { + "$ref": "#/definitions/nonEmptyString" + }, + "packageName": { + "$ref": "#/definitions/nonEmptyString" + }, + "command": { + "$ref": "#/definitions/nonEmptyString" + }, + "args": { + "type": "array", + "items": { + "type": "string" + } + }, + "postInstall": { + "type": "array", + "items": { + "$ref": "#/definitions/nonEmptyString" + } + }, + "env": { + "$ref": "#/definitions/environment" + } + } + }, + "connection": { + "type": "object", + "required": [ + "transport" + ], + "additionalProperties": false, + "properties": { + "transport": { + "type": "string", + "enum": [ + "stdio", + "streamable-http", + "sse" + ] + }, + "command": { + "$ref": "#/definitions/nonEmptyString" + }, + "args": { + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "$ref": "#/definitions/nonEmptyString" + }, + "env": { + "$ref": "#/definitions/environment" + } + } + }, + "dockerApp": { + "type": "object", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "entrypoints" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "docker-app" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "$ref": "#/definitions/platformSupport" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "stars": { + "type": "integer", + "minimum": 0 + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "install": { + "type": "object", + "required": [ + "method", + "requirements", + "configNeeded" + ], + "additionalProperties": false, + "properties": { + "method": { + "type": "string", + "enum": [ + "docker", + "docker-compose" + ] + }, + "requirements": { + "type": "object", + "required": [ + "docker", + "minMemory", + "minDisk", + "ports" + ], + "additionalProperties": false, + "properties": { + "docker": { + "const": true + }, + "minMemory": { + "$ref": "#/definitions/nonEmptyString" + }, + "minDisk": { + "$ref": "#/definitions/nonEmptyString" + }, + "ports": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + } + } + }, + "configNeeded": { + "type": "array", + "items": { + "$ref": "#/definitions/nonEmptyString" + } + } + } + }, + "exposes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "port", + "path", + "name" + ], + "additionalProperties": false, + "properties": { + "type": { + "const": "http-api" + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "path": { + "type": "string", + "pattern": "^/" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + } + } + } + }, + "productKind": { + "type": "string", + "enum": [ + "application", + "plugin" + ], + "description": "主要产品归属;应用提供独立业务,插件增加宿主能力。旧定义缺失时由受信适配层归一为 application。" + }, + "extension": { + "type": "object", + "required": [ + "apiVersion", + "hosts", + "runtime", + "contributes" + ], + "additionalProperties": false, + "properties": { + "apiVersion": { + "const": "1.0.0", + "description": "宿主扩展协议版本;当前支持 1.0.0。" + }, + "hosts": { + "type": "array", + "minItems": 1, + "maxItems": 2, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "agent-service", + "desktop-host" + ] + }, + "description": "执行宿主;未实现的宿主只作声明并显示不兼容,客户端展示面在 UI 定义中另行声明。" + }, + "runtime": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "const": "declarative", + "description": "仅由宿主读取声明,不创建执行进程。" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "kind", + "protocol", + "descriptorRef" + ], + "properties": { + "kind": { + "const": "service", + "description": "既有服务 owner 管理的协议连接;贡献调用继续走原授权和审批。" + }, + "protocol": { + "type": "string", + "enum": [ + "mcp", + "http" + ], + "description": "服务通信协议,不代表连接已经建立。" + }, + "descriptorRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + } + }, + "additionalProperties": false + } + ], + "description": "贡献执行承载;descriptor 只定位受核验材料,不能直接把任意 endpoint 当运行事实。" + }, + "contributes": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "id", + "point", + "contractVersion", + "definitionRef" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "产品内稳定贡献 ID;与来源、产品及精确安装实例共同定位运行绑定。" + }, + "point": { + "type": "string", + "enum": [ + "document.parsers", + "session.panels", + "session.widgets", + "session.actions", + "tools", + "skills" + ], + "description": "具有实际宿主消费者的贡献点;未知贡献点不得接入。" + }, + "contractVersion": { + "const": 1, + "description": "该贡献点的消费契约版本;不兼容版本不激活。" + }, + "definitionRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + } + }, + "description": "包内贡献定义引用;业务层补充贡献 ID 唯一性及内容摘要核验。" + }, + "description": "本产品提供的宿主贡献;仅消费能力的普通应用允许空数组,独立插件必须至少一项。每项定义从安装材料读取并核验。" + }, + "configurationSchemaRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + }, + "requires": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "sourceId", + "appId", + "contributionId", + "contractVersion", + "optional" + ], + "additionalProperties": false, + "properties": { + "sourceId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "直接依赖的受信产品来源,禁止按同名产品猜测。" + }, + "appId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "所依赖的应用或插件产品 ID;静态定义不携带安装实例 ID。" + }, + "contributionId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "消费方需要的具体贡献 ID。" + }, + "contractVersion": { + "const": 1, + "description": "消费方支持的贡献契约版本。" + }, + "optional": { + "type": "boolean", + "description": "true 为可选增强;false 缺失时阻断受影响功能,不自动安装或卸载。" + }, + "versionRange": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "可选发布版本 semver 范围,由满足性检查器校验。" + } + }, + "description": "直接能力依赖;运行时须显式解析兼容的精确安装实例,不建设递归依赖求解器。" + }, + "description": "本产品消费的必需或可选直接能力依赖;不产生使用授权。" + } + }, + "not": { + "properties": { + "contributes": { + "maxItems": 0 + }, + "requires": { + "maxItems": 0 + } + } + }, + "description": "产品提供或消费宿主能力的关系契约;至少声明一项贡献或依赖。普通应用可仅消费,独立插件仍须提供实际贡献。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "DesireCore 自带并随客户端发布的页面入口;第三方目录不得伪造此入口类型", + "required": [ + "id", + "name", + "kind", + "route" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "builtin", + "description": "内置页面入口判别字段" + }, + "route": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "客户端内置路由;必须是单斜杠开头的相对应用路由,不能是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由系统浏览器打开的目录声明入口;运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "external", + "description": "外部浏览器入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID;不是 URL,解析结果还需 HTTPS 或本机 loopback 校验" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "可选服务内路径;解析层禁止凭据、反斜杠和目录穿越" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + } + }, + "allOf": [ + { + "if": { + "properties": { + "productKind": { + "const": "plugin" + } + }, + "required": [ + "productKind" + ] + }, + "then": { + "required": [ + "extension" + ], + "properties": { + "extension": { + "properties": { + "contributes": { + "minItems": 1 + } + } + } + } + }, + "else": { + "properties": { + "entrypoints": { + "minItems": 1 + } + } + } + } + ] + }, + "mcp": { + "type": "object", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "platformSupport", + "capabilities", + "connection" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "mcp" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "platformSupport": { + "$ref": "#/definitions/platformSupport" + }, + "capabilities": { + "$ref": "#/definitions/capabilities" + }, + "toolCount": { + "type": "integer", + "minimum": 0 + }, + "install": { + "$ref": "#/definitions/mcpInstall" + }, + "connection": { + "$ref": "#/definitions/connection" + }, + "sourceAppId": { + "$ref": "#/definitions/id" + }, + "sourceAppName": { + "$ref": "#/definitions/nonEmptyString" + } + } + }, + "httpApi": { + "type": "object", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "platformSupport", + "endpoint", + "capabilities" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "http-api" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "platformSupport": { + "$ref": "#/definitions/platformSupport" + }, + "endpoint": { + "type": "string", + "pattern": "^https?://[^\\s]+$" + }, + "capabilities": { + "$ref": "#/definitions/capabilities" + }, + "sourceAppId": { + "$ref": "#/definitions/id" + }, + "sourceAppName": { + "$ref": "#/definitions/nonEmptyString" + } + } + }, + "maintainer": { + "type": "object", + "required": [ + "name", + "url", + "verified" + ], + "additionalProperties": false, + "properties": { + "name": { + "allOf": [ + { + "$ref": "#/definitions/nonEmptyString" + } + ], + "description": "Human-readable maintainer identity." + }, + "url": { + "allOf": [ + { + "$ref": "#/definitions/httpsUrl" + } + ], + "description": "Public source used to verify the maintainer identity." + }, + "verified": { + "const": true, + "description": "The Registry maintainer verified this identity against the public source." + } + } + }, + "officialLink": { + "description": "A Kimi WebBridge upstream URL pinned by kind, hostname, path, and extension ID where applicable.", + "oneOf": [ + { + "type": "object", + "required": [ + "kind", + "label", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "product" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "url": { + "const": "https://www.kimi.ai/products/kimi-webbridge" + } + } + }, + { + "type": "object", + "required": [ + "kind", + "label", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "documentation" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "url": { + "const": "https://www.kimi.ai/help/kimi-webbridge/kimi-webbridge-introduction" + } + } + }, + { + "type": "object", + "required": [ + "kind", + "label", + "extensionId", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "chrome-web-store" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "extensionId": { + "const": "fldmhceldgbpfpkbgopacenieobmligc", + "description": "The audited Chrome Web Store extension identifier." + }, + "url": { + "const": "https://chromewebstore.google.com/detail/kimi-webbridge/fldmhceldgbpfpkbgopacenieobmligc" + } + } + }, + { + "type": "object", + "required": [ + "kind", + "label", + "extensionId", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "edge-add-ons" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "extensionId": { + "const": "bnlffdbcfnanfbknnlaflhlhkocccckg", + "description": "The audited Microsoft Edge Add-ons extension identifier." + }, + "url": { + "const": "https://microsoftedge.microsoft.com/addons/detail/kimi-webbridge/bnlffdbcfnanfbknnlaflhlhkocccckg" + } + } + }, + { + "type": "object", + "required": [ + "kind", + "label", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "privacy" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "url": { + "const": "https://www.kimi.ai/user/agreement/userPrivacy?version=v2" + } + } + }, + { + "type": "object", + "required": [ + "kind", + "label", + "url" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "terms" + }, + "label": { + "$ref": "#/definitions/nonEmptyString" + }, + "url": { + "const": "https://www.kimi.ai/user/agreement/modelUse?version=v2" + } + } + } + ] + }, + "browserExtensionComponent": { + "type": "object", + "required": [ + "kind", + "name", + "description", + "distribution", + "browsers" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "browser-extension" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "distribution": { + "const": "official-upstream-only", + "description": "DesireCore does not mirror or repackage this third-party component." + }, + "browsers": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "chrome", + "edge" + ] + }, + "allOf": [ + { + "contains": { + "const": "chrome" + } + }, + { + "contains": { + "const": "edge" + } + } + ] + } + } + }, + "localDaemonComponent": { + "type": "object", + "required": [ + "kind", + "name", + "description", + "distribution", + "platforms" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "local-daemon" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "distribution": { + "const": "official-upstream-only", + "description": "DesireCore does not mirror or repackage this third-party component." + }, + "platforms": { + "type": "array", + "minItems": 2, + "maxItems": 3, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "macos", + "windows", + "linux" + ] + }, + "allOf": [ + { + "contains": { + "const": "macos" + } + }, + { + "contains": { + "const": "windows" + } + } + ] + } + } + }, + "externalComponent": { + "description": "One strictly discriminated Kimi WebBridge physical component.", + "oneOf": [ + { + "$ref": "#/definitions/browserExtensionComponent" + }, + { + "$ref": "#/definitions/localDaemonComponent" + } + ] + }, + "artifactReview": { + "type": "object", + "required": [ + "component", + "platform", + "architecture", + "version", + "url", + "sha256", + "reviewedAt", + "reviewedBy" + ], + "additionalProperties": false, + "properties": { + "component": { + "const": "local-daemon" + }, + "platform": { + "type": "string", + "enum": [ + "macos", + "windows", + "linux" + ] + }, + "architecture": { + "type": "string", + "enum": [ + "x64", + "arm64" + ] + }, + "version": { + "$ref": "#/definitions/version" + }, + "url": { + "$ref": "#/definitions/httpsUrl" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$" + }, + "reviewedAt": { + "type": "string", + "format": "date" + }, + "reviewedBy": { + "$ref": "#/definitions/nonEmptyString" + } + } + }, + "externalIntegration": { + "type": "object", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "category", + "shortDesc", + "fullDesc", + "tags", + "icon", + "platformSupport", + "requiredClientVersion", + "stewardship", + "availability", + "redistribution", + "branding", + "listingMaintainer", + "upstreamMaintainer", + "integration", + "officialLinks", + "components", + "permissions", + "profileRecommendation", + "dataBoundaries", + "admission", + "compliance" + ], + "additionalProperties": false, + "properties": { + "id": { + "const": "kimi-webbridge", + "description": "The only external-integration ID admitted by Registry Schema v4." + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "external-integration" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "category": { + "const": "tools" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "type": "string", + "enum": [ + "monitor", + "puzzle", + "globe" + ], + "description": "A neutral DesireCore icon name; upstream logos are not permitted in this listing type." + }, + "platformSupport": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "macos", + "windows" + ] + }, + "allOf": [ + { + "contains": { + "const": "macos" + } + }, + { + "contains": { + "const": "windows" + } + } + ], + "description": "The reviewed listing must support both macOS and Windows." + }, + "requiredClientVersion": { + "allOf": [ + { + "$ref": "#/definitions/version" + } + ], + "description": "Minimum DesireCore version that understands this strict listing-only entry." + }, + "stewardship": { + "const": "pointer" + }, + "availability": { + "const": "listing-only" + }, + "redistribution": { + "const": "source-pointer-only" + }, + "branding": { + "type": "object", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "additionalProperties": false, + "properties": { + "relationship": { + "const": "independent-listing" + }, + "nameUsage": { + "const": "nominative" + }, + "logoStatus": { + "const": "not-used" + } + } + }, + "listingMaintainer": { + "$ref": "#/definitions/maintainer" + }, + "upstreamMaintainer": { + "$ref": "#/definitions/maintainer" + }, + "integration": { + "type": "object", + "required": [ + "kind", + "adapterId", + "executionAvailability", + "installMode" + ], + "additionalProperties": false, + "properties": { + "kind": { + "const": "local-extension-bridge" + }, + "adapterId": { + "$ref": "#/definitions/id" + }, + "executionAvailability": { + "const": "blocked" + }, + "installMode": { + "const": "upstream-guided" + } + } + }, + "officialLinks": { + "type": "array", + "minItems": 6, + "maxItems": 6, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/officialLink" + }, + "description": "One reviewed official source for each required link kind." + }, + "components": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/externalComponent" + }, + "description": "The upstream browser extension and local daemon, neither redistributed by DesireCore." + }, + "permissions": { + "type": "object", + "required": [ + "browserExtension" + ], + "additionalProperties": false, + "properties": { + "browserExtension": { + "type": "object", + "required": [ + "apiPermissions", + "hostPermissions", + "riskLevel" + ], + "additionalProperties": false, + "properties": { + "apiPermissions": { + "type": "array", + "minItems": 7, + "maxItems": 7, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "tabs", + "activeTab", + "debugger", + "storage", + "alarms", + "tabGroups", + "windows" + ] + } + }, + "hostPermissions": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "const": "" + } + }, + "riskLevel": { + "const": "high" + } + } + } + } + }, + "profileRecommendation": { + "const": "dedicated-browser-profile" + }, + "dataBoundaries": { + "type": "object", + "required": [ + "webBridgeLocalExecution", + "desireCoreModelContext", + "modelProviderDisclosureRequired" + ], + "additionalProperties": false, + "properties": { + "webBridgeLocalExecution": { + "allOf": [ + { + "$ref": "#/definitions/nonEmptyString" + } + ], + "description": "A scoped statement of the upstream claim about the local WebBridge execution path." + }, + "desireCoreModelContext": { + "allOf": [ + { + "$ref": "#/definitions/nonEmptyString" + } + ], + "description": "A separate disclosure that content entering DesireCore context may be sent to the selected model provider." + }, + "modelProviderDisclosureRequired": { + "const": true + } + } + }, + "admission": { + "type": "object", + "required": [ + "status", + "code", + "reason", + "missingPrerequisites" + ], + "additionalProperties": false, + "properties": { + "status": { + "const": "blocked" + }, + "code": { + "const": "native-integration-not-admitted" + }, + "reason": { + "$ref": "#/definitions/nonEmptyString" + }, + "missingPrerequisites": { + "type": "array", + "minItems": 4, + "maxItems": 4, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "stable-auditable-protocol", + "integration-authorization", + "deterministic-command-receipts", + "user-interaction-pause-signal" + ] + } + } + } + }, + "compliance": { + "type": "object", + "required": [ + "reviewedAt", + "reviewedBy", + "upstreamEndorsed", + "relationshipDisclosure", + "artifactReviews" + ], + "additionalProperties": false, + "properties": { + "reviewedAt": { + "type": "string", + "format": "date" + }, + "reviewedBy": { + "$ref": "#/definitions/nonEmptyString" + }, + "upstreamEndorsed": { + "const": false + }, + "relationshipDisclosure": { + "const": "independent-listing-not-endorsed" + }, + "artifactReviews": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/artifactReview" + }, + "description": "Immutable upstream artifact audit facts; these records do not admit installation or redistribution." + } + } + } + } + }, + "artifact": { + "type": "object", + "description": "纯声明制品:由宿主读取受核验文件,不需要 Node、Docker、端口或虚假运行进程。安装仍走 Agent 材料/核验/唯一账本。", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "source", + "requiredClientVersion", + "placementPolicy", + "stewardship", + "availability", + "license", + "redistribution", + "listingMaintainer", + "upstreamMaintainer", + "branding", + "compliance", + "productKind", + "entrypoints", + "extension" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "artifact", + "description": "声明制品交付类别,与 productKind 正交。" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "$ref": "#/definitions/platformSupport" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "requiredClientVersion": { + "$ref": "#/definitions/version" + }, + "install": { + "type": "object", + "description": "应用安装配置:描述如何安装和部署此应用", + "required": [ + "method", + "requirements" + ], + "allOf": [ + { + "if": { + "properties": { + "method": { + "const": "native-node" + } + }, + "required": [ + "method" + ] + }, + "then": { + "properties": { + "requirements": { + "required": [ + "node" + ], + "properties": { + "docker": { + "const": false + } + } + } + } + } + }, + { + "if": { + "properties": { + "method": { + "const": "artifact" + } + }, + "required": [ + "method" + ] + }, + "then": { + "properties": { + "requirements": { + "properties": { + "docker": { + "const": false + }, + "ports": { + "maxItems": 0 + } + } + } + } + } + } + ], + "properties": { + "method": { + "const": "artifact", + "description": "按安装材料获取、核验和维护纯声明文件。" + }, + "requirements": { + "type": "object", + "description": "系统要求:安装前需满足的硬件和环境条件", + "required": [ + "docker", + "ports" + ], + "properties": { + "docker": { + "type": "boolean", + "description": "是否需要 Docker 环境" + }, + "minMemory": { + "type": "string", + "description": "发布者声明的内存要求或建议;未知时省略,不用通用默认值或当前运行用量填充。" + }, + "minDisk": { + "type": "string", + "description": "发布者声明的磁盘空间要求或建议;未知时省略,不代表实测占用。" + }, + "ports": { + "type": "array", + "description": "需要开放的端口号列表", + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + }, + "node": { + "type": "string", + "minLength": 1, + "maxLength": 80, + "description": "宿主机 Node.js 版本要求;native-node 安装必填。" + }, + "envVars": { + "type": "array", + "description": "需要配置的环境变量名列表(如 API_KEY、DATABASE_URL)", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "configNeeded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "安装前需准备的配置项(人类可读清单)" + } + }, + "additionalProperties": false + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + }, + "productKind": { + "type": "string", + "enum": [ + "application", + "plugin" + ], + "description": "主要产品归属;应用提供独立业务,插件增加宿主能力。旧定义缺失时由受信适配层归一为 application。" + }, + "extension": { + "type": "object", + "required": [ + "apiVersion", + "hosts", + "runtime", + "contributes" + ], + "additionalProperties": false, + "properties": { + "apiVersion": { + "const": "1.0.0", + "description": "宿主扩展协议版本;当前支持 1.0.0。" + }, + "hosts": { + "type": "array", + "minItems": 1, + "maxItems": 2, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "agent-service", + "desktop-host" + ] + }, + "description": "执行宿主;未实现的宿主只作声明并显示不兼容,客户端展示面在 UI 定义中另行声明。" + }, + "runtime": { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "const": "declarative", + "description": "只由宿主读取声明,不创建执行进程。" + } + }, + "additionalProperties": false + }, + "contributes": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "id", + "point", + "contractVersion", + "definitionRef" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "产品内稳定贡献 ID;与来源、产品及精确安装实例共同定位运行绑定。" + }, + "point": { + "type": "string", + "enum": [ + "document.parsers", + "session.panels", + "session.widgets", + "session.actions", + "tools", + "skills" + ], + "description": "具有实际宿主消费者的贡献点;未知贡献点不得接入。" + }, + "contractVersion": { + "const": 1, + "description": "该贡献点的消费契约版本;不兼容版本不激活。" + }, + "definitionRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + } + }, + "description": "包内贡献定义引用;业务层补充贡献 ID 唯一性及内容摘要核验。" + }, + "description": "本产品提供的宿主贡献;仅消费能力的普通应用允许空数组,独立插件必须至少一项。每项定义从安装材料读取并核验。" + }, + "configurationSchemaRef": { + "type": "object", + "required": [ + "path", + "sha256" + ], + "additionalProperties": false, + "properties": { + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*\\u0000)(?!.*(?:^|/)(?:\\.|\\.\\.)(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$", + "description": "固定在核验制品根下的规范 POSIX 相对文件路径;拒绝绝对路径、反斜杠、盘符、空段、点段及 NUL。解析时仍须核验 realpath containment。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "固定文件字节的 SHA-256;消费前核验,编辑须提交新安装修订。" + } + }, + "description": "安装制品根下内容固定的材料引用;相对路径和摘要必须共同匹配。" + }, + "requires": { + "type": "array", + "maxItems": 64, + "items": { + "type": "object", + "required": [ + "sourceId", + "appId", + "contributionId", + "contractVersion", + "optional" + ], + "additionalProperties": false, + "properties": { + "sourceId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "直接依赖的受信产品来源,禁止按同名产品猜测。" + }, + "appId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "所依赖的应用或插件产品 ID;静态定义不携带安装实例 ID。" + }, + "contributionId": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "消费方需要的具体贡献 ID。" + }, + "contractVersion": { + "const": 1, + "description": "消费方支持的贡献契约版本。" + }, + "optional": { + "type": "boolean", + "description": "true 为可选增强;false 缺失时阻断受影响功能,不自动安装或卸载。" + }, + "versionRange": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "可选发布版本 semver 范围,由满足性检查器校验。" + } + }, + "description": "直接能力依赖;运行时须显式解析兼容的精确安装实例,不建设递归依赖求解器。" + }, + "description": "本产品消费的必需或可选直接能力依赖;不产生使用授权。" + } + }, + "not": { + "properties": { + "contributes": { + "maxItems": 0 + }, + "requires": { + "maxItems": 0 + } + } + }, + "description": "产品提供或消费宿主能力的关系契约;至少声明一项贡献或依赖。普通应用可仅消费,独立插件仍须提供实际贡献。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "DesireCore 自带并随客户端发布的页面入口;第三方目录不得伪造此入口类型", + "required": [ + "id", + "name", + "kind", + "route" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "builtin", + "description": "内置页面入口判别字段" + }, + "route": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "客户端内置路由;必须是单斜杠开头的相对应用路由,不能是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由系统浏览器打开的目录声明入口;运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "external", + "description": "外部浏览器入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID;不是 URL,解析结果还需 HTTPS 或本机 loopback 校验" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "可选服务内路径;解析层禁止凭据、反斜杠和目录穿越" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + } + }, + "allOf": [ + { + "if": { + "properties": { + "productKind": { + "const": "plugin" + } + }, + "required": [ + "productKind" + ] + }, + "then": { + "required": [ + "extension" + ], + "properties": { + "extension": { + "properties": { + "contributes": { + "minItems": 1 + } + } + } + } + }, + "else": { + "properties": { + "entrypoints": { + "minItems": 1 + } + } + } + } + ] + }, + "appRelease": { + "type": "object", + "description": "Registry 指向固定应用 release 的兼容视图;来源归档摘要在 source.sha256,不能与 releaseDigest 交换。", + "required": [ + "schemaVersion", + "releaseDigest", + "manifestPath", + "requiredCapabilities" + ], + "properties": { + "schemaVersion": { + "const": 1, + "description": "固定 release 目录引用格式版本。" + }, + "releaseDigest": { + "type": "string", + "pattern": "^[a-f0-9]{64}$", + "description": "app-release-c14n-v1 规范材料身份;不是归档文件摘要。" + }, + "manifestPath": { + "type": "string", + "const": "app-release.json", + "description": "获取并核验的包内固定 release 清单。" + }, + "definitionPath": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*[\\\\\\x00-\\x1f])[^?#]+$", + "description": "同一 release 文件清单中的作者定义路径;相对 POSIX 路径,禁止宿主路径、穿越和 URL。" + }, + "definitionSource": { + "const": "manifest", + "description": "作者定义直接来自已核验 app-release.json 的 definition;包中不另外声明 definition 文件。" + }, + "requiredCapabilities": { + "type": "array", + "minItems": 1, + "maxItems": 32, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 120 + }, + "contains": { + "const": "app-authoring-v1" + }, + "description": "获取后需要重新握手的真实能力;最低客户端版本不能代替能力支持。" + }, + "imageRefs": { + "type": "array", + "minItems": 1, + "maxItems": 32, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 2048, + "pattern": "^(?:localhost|[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+)(?::[1-9][0-9]{0,4})?/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)*@sha256:[a-f0-9]{64}$", + "description": "显式DNS/IPv4或localhost注册表、可选端口和repository@sha256:小写64位摘要;不能用浮动tag、shell、凭据或宿主路径。" + }, + "description": "仅容器release从同一delivery映射的固定镜像依赖;不包含登录凭据,不假定本机Docker可用。" + } + }, + "oneOf": [ + { + "required": [ + "definitionPath" + ], + "not": { + "required": [ + "definitionSource" + ] + }, + "description": "兼容已有包内独立作者定义文件。" + }, + { + "required": [ + "definitionSource" + ], + "not": { + "required": [ + "definitionPath" + ] + }, + "description": "使用 release 清单中的内联作者定义,不能同时声称存在独立文件。" + } + ], + "additionalProperties": false + }, + "webBundle": { + "type": "object", + "description": "固定网页包:页面到包内文件的映射在同一release清单,不执行宿主程序、不派生内部服务。", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "source", + "requiredClientVersion", + "placementPolicy", + "stewardship", + "availability", + "license", + "redistribution", + "entrypoints", + "appRelease" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "web-bundle", + "description": "与 release.delivery 一致的交付类别。" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "type": "array", + "minItems": 1, + "maxItems": 4, + "uniqueItems": true, + "items": { + "enum": [ + "macos", + "windows", + "linux", + "web" + ] + }, + "description": "来源release支持的平台;运行时仍需真实宿主能力。" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "requiredClientVersion": { + "$ref": "#/definitions/version" + }, + "install": { + "type": "object", + "required": [ + "method", + "requirements" + ], + "additionalProperties": false, + "description": "先获取固定 release 再由 Agent 沿既有发布/执行owner处理;不是自动安装DSL。", + "properties": { + "method": { + "const": "web-bundle", + "description": "固定应用材料的安装方式。" + }, + "requirements": { + "type": "object", + "required": [ + "docker", + "ports" + ], + "additionalProperties": false, + "description": "发布者声明的环境条件;未知资源数字省略,不是当前运行健康。", + "properties": { + "docker": { + "const": false, + "description": "此静态或宿主应用分支不安装Docker。" + }, + "ports": { + "type": "array", + "uniqueItems": true, + "maxItems": 0, + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "description": "声明服务端口要求;运行时地址必须由可信执行owner提供。" + }, + "minMemory": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的内存条件;未知省略。" + }, + "minDisk": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的磁盘条件;未知省略。" + } + } + }, + "configNeeded": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "description": "发布者说明的配置准备项,不包含凭据。" + } + } + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + }, + "productKind": { + "const": "application", + "description": "用户自建应用;不是平台声明插件。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + }, + "appRelease": { + "$ref": "#/definitions/appRelease" + } + }, + "allOf": [ + { + "if": { + "properties": { + "availability": { + "const": "installable" + } + }, + "required": [ + "availability" + ] + }, + "then": { + "required": [ + "branding", + "compliance", + "listingMaintainer", + "upstreamMaintainer" + ] + } + } + ] + }, + "authoredNativeApp": { + "type": "object", + "description": "带运行说明的固定宿主应用:可信执行owner核验身份,目录不保存启动命令或当前端口。", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "source", + "requiredClientVersion", + "placementPolicy", + "stewardship", + "availability", + "license", + "redistribution", + "entrypoints", + "appRelease" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "native-app", + "description": "与 release.delivery 一致的交付类别。" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "type": "array", + "minItems": 1, + "maxItems": 4, + "uniqueItems": true, + "items": { + "enum": [ + "macos", + "windows", + "linux", + "web" + ] + }, + "description": "来源release支持的平台;运行时仍需真实宿主能力。" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "requiredClientVersion": { + "$ref": "#/definitions/version" + }, + "install": { + "type": "object", + "required": [ + "method", + "requirements" + ], + "additionalProperties": false, + "description": "先获取固定 release 再由 Agent 沿既有发布/执行owner处理;不是自动安装DSL。", + "properties": { + "method": { + "const": "release", + "description": "固定应用材料的安装方式。" + }, + "requirements": { + "type": "object", + "required": [ + "docker", + "ports" + ], + "additionalProperties": false, + "description": "发布者声明的环境条件;未知资源数字省略,不是当前运行健康。", + "properties": { + "docker": { + "const": false, + "description": "此静态或宿主应用分支不安装Docker。" + }, + "ports": { + "type": "array", + "uniqueItems": true, + "maxItems": 32, + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "description": "声明服务端口要求;运行时地址必须由可信执行owner提供。" + }, + "minMemory": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的内存条件;未知省略。" + }, + "minDisk": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的磁盘条件;未知省略。" + }, + "node": { + "type": "string", + "minLength": 1, + "maxLength": 80, + "description": "明确依赖Node时的版本要求,不由交付类别猜测。" + }, + "envVars": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1 + }, + "description": "运行环境变量名称,不包含秘密值。" + } + } + }, + "configNeeded": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "description": "发布者说明的配置准备项,不包含凭据。" + } + } + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + }, + "productKind": { + "const": "application", + "description": "用户自建应用;不是平台声明插件。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "DesireCore 自带并随客户端发布的页面入口;第三方目录不得伪造此入口类型", + "required": [ + "id", + "name", + "kind", + "route" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "builtin", + "description": "内置页面入口判别字段" + }, + "route": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "客户端内置路由;必须是单斜杠开头的相对应用路由,不能是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由系统浏览器打开的目录声明入口;运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "external", + "description": "外部浏览器入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID;不是 URL,解析结果还需 HTTPS 或本机 loopback 校验" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "可选服务内路径;解析层禁止凭据、反斜杠和目录穿越" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + }, + "appRelease": { + "$ref": "#/definitions/appRelease" + } + }, + "allOf": [ + { + "if": { + "properties": { + "availability": { + "const": "installable" + } + }, + "required": [ + "availability" + ] + }, + "then": { + "required": [ + "branding", + "compliance", + "listingMaintainer", + "upstreamMaintainer" + ] + } + } + ] + }, + "authoredDockerApp": { + "type": "object", + "description": "固定容器镜像依赖的release应用:使用原Docker执行/服务owner,不新建容器管理器;缺真实身份adapter时不声称直开。", + "required": [ + "id", + "name", + "type", + "version", + "author", + "description", + "tags", + "icon", + "iconLetter", + "platformSupport", + "category", + "fullDesc", + "shortDesc", + "install", + "source", + "requiredClientVersion", + "placementPolicy", + "stewardship", + "availability", + "license", + "redistribution", + "entrypoints", + "appRelease" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "#/definitions/id" + }, + "name": { + "$ref": "#/definitions/nonEmptyString" + }, + "type": { + "const": "docker-app", + "description": "与 release.delivery 一致的交付类别。" + }, + "version": { + "$ref": "#/definitions/version" + }, + "author": { + "$ref": "#/definitions/nonEmptyString" + }, + "description": { + "$ref": "#/definitions/nonEmptyString" + }, + "tags": { + "$ref": "#/definitions/tags" + }, + "icon": { + "$ref": "#/definitions/nonEmptyString" + }, + "iconLetter": { + "type": "string", + "minLength": 1, + "maxLength": 2 + }, + "platformSupport": { + "type": "array", + "minItems": 1, + "maxItems": 4, + "uniqueItems": true, + "items": { + "enum": [ + "macos", + "windows", + "linux", + "web" + ] + }, + "description": "来源release支持的平台;运行时仍需真实宿主能力。" + }, + "category": { + "type": "string", + "minLength": 1, + "pattern": "^[a-z0-9-]+$", + "description": "应用分类(slug 格式),可扩展任意分类" + }, + "fullDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "shortDesc": { + "$ref": "#/definitions/nonEmptyString" + }, + "githubUrl": { + "$ref": "#/definitions/httpsUrl" + }, + "requiredClientVersion": { + "$ref": "#/definitions/version" + }, + "install": { + "type": "object", + "required": [ + "method", + "requirements" + ], + "additionalProperties": false, + "description": "先获取固定 release 再由 Agent 沿既有发布/执行owner处理;不是自动安装DSL。", + "properties": { + "method": { + "const": "release", + "description": "固定应用材料的安装方式。" + }, + "requirements": { + "type": "object", + "required": [ + "docker", + "ports" + ], + "additionalProperties": false, + "description": "发布者声明的环境条件;未知资源数字省略,不是当前运行健康。", + "properties": { + "docker": { + "const": true, + "description": "此静态或宿主应用分支不安装Docker。" + }, + "ports": { + "type": "array", + "uniqueItems": true, + "maxItems": 32, + "items": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "description": "声明服务端口要求;运行时地址必须由可信执行owner提供。" + }, + "minMemory": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的内存条件;未知省略。" + }, + "minDisk": { + "type": "string", + "minLength": 1, + "description": "实际发布材料声明的磁盘条件;未知省略。" + }, + "node": { + "type": "string", + "minLength": 1, + "maxLength": 80, + "description": "明确依赖Node时的版本要求,不由交付类别猜测。" + }, + "envVars": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1 + }, + "description": "运行环境变量名称,不包含秘密值。" + } + } + }, + "configNeeded": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "description": "发布者说明的配置准备项,不包含凭据。" + } + } + }, + "placementPolicy": { + "type": "object", + "description": "目录维护者声明的可放置范围;只限制能力,不能替用户自动固定或绑定", + "required": [ + "showInMyApps", + "allowNavPin", + "allowAgentBinding" + ], + "properties": { + "showInMyApps": { + "type": "boolean", + "description": "安装后是否允许出现在“我的应用”" + }, + "allowNavPin": { + "type": "boolean", + "description": "用户是否可将应用固定到主导航" + }, + "allowAgentBinding": { + "type": "boolean", + "description": "用户是否可将应用关联到 Agent 会话侧栏" + } + }, + "additionalProperties": false + }, + "source": { + "type": "object", + "description": "经过审核的上游来源指针;安装时必须进一步证明 ref 或制品摘要不可变。", + "required": [ + "kind", + "url", + "ref" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "git", + "release", + "package", + "container" + ], + "description": "上游来源类型:Git 仓库、Release 制品、包管理器制品或容器镜像。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "权威上游地址;不得由客户端在安装请求中替换。" + }, + "ref": { + "type": "string", + "minLength": 1, + "description": "审核版本引用;安装候选必须是完整 commit、制品版本或容器 digest。" + }, + "sha256": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$", + "description": "Release、package 或其他下载响应体的 SHA-256 摘要。" + }, + "path": { + "type": "string", + "minLength": 1, + "description": "单仓库目录中的相对路径;不得作为运行时任意本地路径使用。" + }, + "upstreamRepo": { + "type": "string", + "format": "uri", + "description": "制品与源码不在同一地址时对应的上游源码仓库。" + } + }, + "additionalProperties": false + }, + "stewardship": { + "type": "string", + "enum": [ + "official", + "partner", + "community", + "pointer" + ], + "description": "条目治理身份:official 仅能由受信 official catalog provider 注入;partner/community/pointer 分别表示合作方、社区维护或纯上游指针。" + }, + "availability": { + "type": "string", + "enum": [ + "listing-only", + "installable" + ], + "description": "目录可用性:listing-only 仅允许浏览上游;installable 才允许进入既有受治理获取流程,不表示已经安装或正在运行。" + }, + "license": { + "type": "string", + "minLength": 1, + "description": "覆盖实际制品的许可证标识。" + }, + "redistribution": { + "type": "string", + "enum": [ + "allowed", + "source-pointer-only", + "verify-package-terms" + ], + "description": "内容转交策略:allowed 可按许可证分发;source-pointer-only 只能从权威上游取得;verify-package-terms 表示条款尚未完成复核。" + }, + "listingMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "upstreamMaintainer": { + "type": "object", + "description": "目录策展者或上游维护者身份;两种角色必须分别存放,不能把 author 当成已验证维护者。", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "维护者的公开名称或组织名称。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "维护者的公开主页、项目主页或可验证身份页面。" + }, + "verified": { + "type": "boolean", + "description": "平台是否已验证该身份;不等同于许可证授权、内容审核或上游背书。" + } + }, + "additionalProperties": false + }, + "branding": { + "type": "object", + "description": "名称、Logo 和官方关系的展示依据;代码许可证不能自动授予商标或宣传素材权利。", + "required": [ + "relationship", + "nameUsage", + "logoStatus" + ], + "properties": { + "relationship": { + "type": "string", + "enum": [ + "official", + "partner", + "independent-listing" + ], + "description": "与上游的公开关系:官方、已确认合作,或独立事实索引。" + }, + "nameUsage": { + "type": "string", + "enum": [ + "owned", + "licensed", + "nominative" + ], + "description": "项目名称的使用依据:自有、已获许可,或识别上游所需的指称性使用。" + }, + "logoStatus": { + "type": "string", + "enum": [ + "not-used", + "license-covered", + "trademark-policy-allowed", + "permission-obtained" + ], + "description": "Logo 使用依据;未确认权利时必须为 not-used,并由客户端使用中性图标。" + } + }, + "additionalProperties": false + }, + "compliance": { + "type": "object", + "description": "绑定到本次不可变来源的合规审核记录;新版本必须重新审核,不能继承旧版本结论。", + "required": [ + "licenseEvidencePath", + "reviewedRef", + "reviewedAt", + "reviewedBy", + "upstreamEndorsed" + ], + "properties": { + "licenseEvidencePath": { + "type": "string", + "minLength": 1, + "description": "在已审核源码或制品中定位许可证文本的相对路径。" + }, + "noticePath": { + "type": "string", + "minLength": 1, + "description": "需要履行 NOTICE 或署名义务时,对应材料的相对路径。" + }, + "reviewedRef": { + "type": "string", + "minLength": 1, + "description": "实际完成许可证、品牌和供应链复核的不可变 ref,必须与获取来源一致。" + }, + "reviewedAt": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T.*)?$", + "description": "审核日期或 ISO 8601 时间戳。" + }, + "reviewedBy": { + "type": "string", + "minLength": 1, + "description": "可追溯的审核者或审核流程标识。" + }, + "upstreamEndorsed": { + "type": "boolean", + "description": "上游是否明确认可该条目;false 时必须显示非官方、未经背书声明。" + } + }, + "additionalProperties": false + }, + "productKind": { + "const": "application", + "description": "用户自建应用;不是平台声明插件。" + }, + "entrypoints": { + "type": "array", + "maxItems": 32, + "items": { + "oneOf": [ + { + "type": "object", + "description": "DesireCore 自带并随客户端发布的页面入口;第三方目录不得伪造此入口类型", + "required": [ + "id", + "name", + "kind", + "route" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "builtin", + "description": "内置页面入口判别字段" + }, + "route": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "客户端内置路由;必须是单斜杠开头的相对应用路由,不能是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由隔离 App Host 承载的 Web 应用入口,运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "embedded-web", + "description": "隔离 Web 入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID 或服务端生成的本机端口引用;不是 URL" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "由系统浏览器打开的目录声明入口;运行时 URL 只可由服务端从 serviceRef 解析", + "required": [ + "id", + "name", + "kind", + "serviceRef" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "入口显示名称" + }, + "kind": { + "const": "external", + "description": "外部浏览器入口判别字段" + }, + "serviceRef": { + "type": "string", + "minLength": 1, + "maxLength": 240, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "Registry 服务 ID;不是 URL,解析结果还需 HTTPS 或本机 loopback 校验" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "pattern": "^/(?!/)", + "description": "可选服务内路径;解析层禁止凭据、反斜杠和目录穿越" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "id", + "name", + "kind" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]*$", + "description": "应用内稳定入口 ID。" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 120, + "description": "交给 Agent 打开的入口显示名。" + }, + "kind": { + "const": "agent", + "description": "读取实例维护资料后委派 Agent;无需服务端口或标准启动接口。" + } + } + } + ], + "description": "应用的一个用户可见启动入口,按 kind 严格判别" + }, + "description": "明确用户入口;plugin 允许空数组,普通应用至少一个入口。" + }, + "appRelease": { + "$ref": "#/definitions/appRelease" + } + }, + "allOf": [ + { + "if": { + "properties": { + "availability": { + "const": "installable" + } + }, + "required": [ + "availability" + ] + }, + "then": { + "required": [ + "branding", + "compliance", + "listingMaintainer", + "upstreamMaintainer" + ] + } + }, + { + "properties": { + "appRelease": { + "required": [ + "imageRefs" + ] + } + } + } + ] + } + } +} diff --git a/scripts/authored-release.test.mjs b/scripts/authored-release.test.mjs new file mode 100644 index 0000000..b3a34a0 --- /dev/null +++ b/scripts/authored-release.test.mjs @@ -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, 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')) +}) diff --git a/scripts/catalog/application-contract.mjs b/scripts/catalog/application-contract.mjs index 95a1e8e..5a69491 100644 --- a/scripts/catalog/application-contract.mjs +++ b/scripts/catalog/application-contract.mjs @@ -1,7 +1,32 @@ +import { isApplicationEntry, isAuthoredRegistryEntry } from './entry-schema.mjs' + /** 发布者关系声明的跨字段检查;不推导安装、权限或运行时健康。 */ export function validateApplicationContract(manifest) { - if (!['docker-app', 'native-app', 'artifact'].includes(manifest.type)) return [] + if (!isApplicationEntry(manifest) && !isAuthoredRegistryEntry(manifest)) return [] 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') + } const ids = new Set() for (const entrypoint of Array.isArray(manifest.entrypoints) ? manifest.entrypoints : []) { if (!entrypoint || typeof entrypoint !== 'object') continue @@ -18,3 +43,9 @@ export function validateApplicationContract(manifest) { } 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 !== '..') +} diff --git a/scripts/catalog/entry-schema.mjs b/scripts/catalog/entry-schema.mjs new file mode 100644 index 0000000..aac9c46 --- /dev/null +++ b/scripts/catalog/entry-schema.mjs @@ -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) +} diff --git a/scripts/catalog/json-schema.mjs b/scripts/catalog/json-schema.mjs index 1dac4bb..6dd0710 100644 --- a/scripts/catalog/json-schema.mjs +++ b/scripts/catalog/json-schema.mjs @@ -141,6 +141,13 @@ function validateNode(value, schema, rootSchema, path, errors) { if (schema.items) { 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)) { diff --git a/scripts/catalog/validator.mjs b/scripts/catalog/validator.mjs index b8b75bf..3aa353a 100644 --- a/scripts/catalog/validator.mjs +++ b/scripts/catalog/validator.mjs @@ -4,6 +4,7 @@ import { basename, join, relative, resolve, sep } from 'node:path' import { validateJsonSchema } from './json-schema.mjs' import { findStaticMetrics } from './static-metadata.mjs' import { validateApplicationContract } from './application-contract.mjs' +import { AUTHORED_ENTRY_SCHEMA_FILENAME, isApplicationEntry, isAuthoredRegistryEntry } from './entry-schema.mjs' export const CATALOG_SIDECAR_FILENAME = 'catalog-metadata.v1.json' @@ -33,6 +34,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) { return ( typeof value === 'string' && @@ -77,7 +87,7 @@ function timestampShapeIsConsistent(timestamp) { function validateSidecarSemantics(manifest, sidecar, file) { const errors = [] const add = (code, path, message) => errors.push(diagnostic('error', code, file, path, message)) - const expectedKind = ['docker-app', 'native-app', 'artifact'].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?.kind !== expectedKind) add('kind-mismatch', '$.identity.kind', `legacy ${manifest.type} 必须映射为 ${expectedKind}`) @@ -140,7 +150,7 @@ function validateSidecarSemantics(manifest, sidecar, file) { if (manifest.toolCount !== undefined && sidecar.spec?.toolCount !== manifest.toolCount) add('spec-mismatch', '$.spec.toolCount', 'toolCount 必须与 legacy 一致') } - if (['native-app', 'artifact'].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']) { if (!isDeepStrictEqual(manifest[field], sidecar.governance?.[field])) add('native-governance-mismatch', '$.governance.' + field, '原生应用 manifest 与 sidecar 的治理事实必须一致') } @@ -205,15 +215,16 @@ export function validateRegistry(repoRoot, options = {}) { const diagnostics = [] const manifestFile = join(root, 'manifest.json') const schemaVersionFile = join(root, 'SCHEMA_VERSION') - const rootSchema = readJson(join(root, 'schemas', 'registry-manifest.v3.schema.json'), diagnostics) - const legacyEntrySchema = readJson(join(root, 'schemas', 'registry-entry.v3.schema.json'), diagnostics) - const externalEntrySchema = readJson(join(root, 'schemas', 'registry-entry.schema.json'), diagnostics) - const sidecarSchema = readJson(join(root, 'schemas', 'catalog-metadata.v1.schema.json'), diagnostics) + const rootSchema = readSchema(join(root, 'schemas', 'registry-manifest.v3.schema.json'), diagnostics) + const legacyEntrySchema = readSchema(join(root, 'schemas', 'registry-entry.v3.schema.json'), diagnostics) + const externalEntrySchema = readSchema(join(root, 'schemas', 'registry-entry.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 entryDirs = findEntryDirs(join(root, 'entries')) 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 currentEntrySchema = /^4\./.test(schemaVersion) ? externalEntrySchema : legacyEntrySchema if (!schemaVersion) diagnostics.push(diagnostic('error', 'missing-schema-version', 'SCHEMA_VERSION', '$', 'SCHEMA_VERSION 不能为空')) @@ -240,8 +251,9 @@ export function validateRegistry(repoRoot, options = {}) { if (entry.type === 'mcp') counts.mcpServices += 1 if (entry.type === 'http-api') counts.httpApis += 1 if (entry.type === 'external-integration') counts.externalIntegrations += 1 - const effectiveEntrySchema = ['external-integration', 'native-app', 'artifact'].includes(entry.type) ? externalEntrySchema : currentEntrySchema - if (effectiveEntrySchema) diagnostics.push(...schemaDiagnostics(entry, effectiveEntrySchema, manifestRelative)) + const effectiveEntrySchema = isAuthoredRegistryEntry(entry) ? authoredEntrySchema + : ['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)) if (entry.id !== basename(entryDir)) diagnostics.push(diagnostic('error', 'directory-id-mismatch', manifestRelative, '$.id', 'manifest.id 必须与 entries/ 目录名一致')) if (seenIds.has(entry.id)) diagnostics.push(diagnostic('error', 'duplicate-id', manifestRelative, '$.id', 'Registry 条目 ID 重复')) @@ -259,7 +271,7 @@ export function validateRegistry(repoRoot, options = {}) { const sidecar = readJson(sidecarPath, diagnostics) if (!sidecar) continue 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)) } diff --git a/scripts/catalog/validator.test.mjs b/scripts/catalog/validator.test.mjs index 4e72969..128f432 100644 --- a/scripts/catalog/validator.test.mjs +++ b/scripts/catalog/validator.test.mjs @@ -208,9 +208,9 @@ test('当前 v4.2 条目保持可读,原生应用与既有 App/Service 具备 httpApis: report.counts.httpApis, externalIntegrations: report.counts.externalIntegrations, }, { - totalEntries: 25, + totalEntries: 26, dockerApps: 8, - nativeApps: 2, + nativeApps: 3, mcpServices: 9, httpApis: 5, externalIntegrations: 1, diff --git a/scripts/validate-registry.mjs b/scripts/validate-registry.mjs index f9b2378..67ba41a 100644 --- a/scripts/validate-registry.mjs +++ b/scripts/validate-registry.mjs @@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url' import Ajv from 'ajv' import { findStaticMetrics } from './catalog/static-metadata.mjs' import { validateApplicationContract } from './catalog/application-contract.mjs' +import { AUTHORED_ENTRY_SCHEMA_FILENAME, isAuthoredRegistryEntry } from './catalog/entry-schema.mjs' const scriptDirectory = dirname(fileURLToPath(import.meta.url)) const rootArgumentIndex = process.argv.indexOf('--root') @@ -281,6 +282,7 @@ const validateExternalIntegration = async (entryDirectory, manifest) => { const schemaVersion = (await readText(join(repositoryRoot, 'SCHEMA_VERSION')))?.trim() const rootManifest = await readJson(join(repositoryRoot, 'manifest.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)) { addError('SCHEMA_VERSION: expected a semantic version') @@ -290,16 +292,22 @@ if (rootManifest) { if (rootManifest.dataVersion !== schemaVersion) addError('manifest.json#dataVersion must equal SCHEMA_VERSION') } -let validateEntry = null -if (entrySchema) { +const compileEntrySchema = (schema, filename) => { + 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 { // Draft-07 条件块补充父 Schema 的约束;无需在每个 then/not 再写局部 type。 const ajv = new Ajv({ allErrors: true, strict: true, strictTypes: false, strictRequired: false, validateFormats: false }) - validateEntry = ajv.compile(entrySchema) + return ajv.compile(schema) } 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 seenIds = new Set() @@ -344,8 +352,9 @@ for (const directoryEntry of await readdir(entriesRoot, { withFileTypes: true }) } } - if (validateEntry && !validateEntry(manifest)) { - addError(`entries/${directoryEntry.name}/manifest.json: ${formatAjvErrors(validateEntry.errors)}`) + const validateManifest = isAuthoredRegistryEntry(manifest) ? validateAuthoredEntry : validateEntry + 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}`) if (manifest.type === 'external-integration') {