diff --git a/src/schemas/any.ts b/src/schemas/any.ts index 000eba4..bd7cec8 100644 --- a/src/schemas/any.ts +++ b/src/schemas/any.ts @@ -5,24 +5,11 @@ import * as v0_2 from "./0.2.js"; import * as v0_3 from "./0.3.js"; /** - * Union schema that accepts any supported manifest version. - * Uses preprocessing to normalize dxt_version to manifest_version, - * then efficiently discriminates based on the now-required manifest_version field. + * 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.preprocess( - (val) => { - // Normalize: if it has dxt_version, ensure manifest_version is also set - if (val && typeof val === "object" && "dxt_version" in val) { - const obj = val as Record; - if (!obj.manifest_version && obj.dxt_version) { - return { ...obj, manifest_version: obj.dxt_version }; - } - } - return val; - }, - z.union([ - v0_1.McpbManifestSchema, - v0_2.McpbManifestSchema, - v0_3.McpbManifestSchema, - ]), -); +export const McpbManifestSchema = z.union([ + v0_1.McpbManifestSchema, + v0_2.McpbManifestSchema, + v0_3.McpbManifestSchema, +]); diff --git a/src/types.ts b/src/types.ts index e6ba766..9fb510f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ import type * as z from "zod"; -import type { McpbManifestSchema as McpbManifestSchema_vAny } from "./schemas/any.js"; +import type { McpbManifestSchema as McpbManifestSchemaAny } from "./schemas/any.js"; import type { McpbManifestAuthorSchema, McpbManifestCompatibilitySchema, @@ -51,7 +51,7 @@ export type McpbUserConfigValues = z.infer; * McpbManifest type that accepts any supported manifest version * This is the default manifest type that should be used for maximum compatibility. */ -export type McpbManifestAny = z.infer; +export type McpbManifest = z.infer; /** * McpbManifest type for the latest manifest version only @@ -59,12 +59,6 @@ export type McpbManifestAny = z.infer; */ export type McpbManifestLatest = z.infer; -/** - * @deprecated Use McpbManifestAny instead - * Default manifest type that accepts any supported version - */ -export type McpbManifest = McpbManifestAny; - /** * Information about a MCPB package signature */