diff --git a/src/cli/init.ts b/src/cli/init.ts index 3b2ad80..be8eaa5 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -1,10 +1,9 @@ import { confirm, input, select } from "@inquirer/prompts"; import { existsSync, readFileSync, writeFileSync } from "fs"; import { basename, join, resolve } from "path"; -import type * as z from "zod"; -import type { McpbManifestSchema as McpbManifestSchemaV0_2 } from "../schemas/0.2.js"; import { DEFAULT_MANIFEST_VERSION } from "../shared/constants.js"; +import type { McpbManifestDefault } from "../types.js"; interface PackageJson { name?: string; @@ -879,7 +878,7 @@ export function buildManifest( resources: string; default_locale: string; }, -): z.infer { +): McpbManifestDefault { const { name, displayName, version, description, authorName } = basicInfo; const { authorEmail, authorUrl } = authorInfo; const { serverType, entryPoint, mcp_config } = serverConfig; @@ -907,7 +906,7 @@ export function buildManifest( ...(visualAssets.screenshots.length > 0 ? { screenshots: visualAssets.screenshots } : {}), - ...(localization ? { localization } : {}), + // ...(localization ? { localization } : {}), server: { type: serverType, entry_point: entryPoint, diff --git a/src/types.ts b/src/types.ts index 20296af..90c5c1d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,8 @@ import type * as z from "zod"; import type { McpbManifestSchema as McpbManifestSchemaAny } from "./schemas/any.js"; -import type { McpbManifestSchema as McpbManifestSchemaV0_2 } from "./schemas/0.2.js"; +import { VERSIONED_MANIFEST_SCHEMAS } from "./schemas/index.js"; +// Import schema types from the version matching DEFAULT_MANIFEST_VERSION import type { McpbManifestAuthorSchema, McpbManifestCompatibilitySchema, @@ -15,7 +16,8 @@ import type { McpbUserConfigurationOptionSchema, McpbUserConfigValuesSchema, McpServerConfigSchema, -} from "./schemas/0.3.js"; +} from "./schemas/0.2.js"; +import { DEFAULT_MANIFEST_VERSION } from "./shared/constants.js"; export type McpServerConfig = z.infer; @@ -53,10 +55,17 @@ export type McpbUserConfigValues = z.infer; export type McpbManifestAny = z.infer; /** - * McpbManifest type for v0.2 (default version) for backwards compatibility - * @deprecated Use McpbManifestAny instead to support all manifest versions. + * McpbManifest type for the DEFAULT_MANIFEST_VERSION + * Use this for creating new manifests with the default version. */ -export type McpbManifest = z.infer; +export type McpbManifestDefault = z.infer< + (typeof VERSIONED_MANIFEST_SCHEMAS)[typeof DEFAULT_MANIFEST_VERSION] +>; + +/** + * @deprecated Use McpbManifestAny instead to support all manifest versions, or McpbManifestDefault for the default version. + */ +export type McpbManifest = McpbManifestDefault; /** * Information about a MCPB package signature diff --git a/test/init.test.ts b/test/init.test.ts index a9b9bf4..def2e9c 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -351,10 +351,6 @@ describe("init functions", () => { }, ], screenshots: ["screen1.png", "screen2.png"], - localization: { - resources: "resources/${locale}.json", - default_locale: "en-US", - }, server: { type: "python", entry_point: "server/main.py",