For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/module-loader/functions/validateManifest.md.
  • 简体中文
  • Function: validateManifest()

    function validateManifest(input: unknown): ValidationResult<AnyManifest>;

    Defined in: module-loader/manifest.ts:41

    模块 manifest 校验对外统一总入口。

    核心调度与设计规范:

    • 自动按 schemaVersion 分派至 validateManifestV2 或 validateManifestV3 校验器;
    • 遇到未知版本号时统一构造 const_mismatch 结构化问题(期望值为 "2 或 3");
    • 外部调用方(如 CLI check-modules、模块安装器、沙箱环境等)必须统一由此入口执行完整校验,禁止在业务层抄写或重复实现字段检查。

    Parameters

    ParameterTypeDescription
    inputunknown待校验的原始 manifest 输入对象。

    Returns

    ValidationResult<AnyManifest>

    统一校验结果。若成功返回对应版本的结构化 manifest,失败返回包含 errors 与 issues 的结果对象。