diff --git a/src/schemas/any.ts b/src/schemas/any.ts new file mode 100644 index 0000000..bd7cec8 --- /dev/null +++ b/src/schemas/any.ts @@ -0,0 +1,15 @@ +import * as z from "zod"; + +import * as v0_1 from "./0.1.js"; +import * as v0_2 from "./0.2.js"; +import * as v0_3 from "./0.3.js"; + +/** + * Union schema that accepts any supported manifest version (0.1, 0.2, 0.3). + * Use this when you need to validate manifests of any version. + */ +export const McpbManifestSchema = z.union([ + v0_1.McpbManifestSchema, + v0_2.McpbManifestSchema, + v0_3.McpbManifestSchema, +]); diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 1b7c64b..3729f0e 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,6 +1,7 @@ export * as v0_1 from "./0.1.js"; export * as v0_2 from "./0.2.js"; export * as v0_3 from "./0.3.js"; +export * as any from "./any.js"; export * as latest from "./latest.js"; export { MANIFEST_VERSION as LATEST_MANIFEST_VERSION,