From 02ecb442ec8a219f825608d804ff62a436bf5e8b Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Fri, 7 Nov 2025 15:21:52 -0800 Subject: [PATCH 1/5] feat: update default manifest to 0.3 --- src/cli/init.ts | 19 ++++++++++--------- src/shared/common.ts | 16 ++++++++++++++++ src/shared/constants.ts | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/cli/init.ts b/src/cli/init.ts index 9e62777..60b353e 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -5,7 +5,7 @@ import type { z } from "zod"; // Import the schema for DEFAULT_MANIFEST_VERSION // TODO: Allow dynamic manifest version choice -import type { McpbManifestSchema } from "../schemas/0.2.js"; +import type { McpbManifestSchema } from "../schemas/0.3.js"; import { DEFAULT_MANIFEST_VERSION } from "../shared/constants.js"; interface PackageJson { @@ -877,10 +877,10 @@ export function buildManifest( license: string; repository?: { type: string; url: string }; }, - // localization?: { - // resources: string; - // default_locale: string; - // }, + localization?: { + resources: string; + default_locale: string; + }, ): z.infer { const { name, displayName, version, description, authorName } = basicInfo; const { authorEmail, authorUrl } = authorInfo; @@ -909,7 +909,7 @@ export function buildManifest( ...(visualAssets.screenshots.length > 0 ? { screenshots: visualAssets.screenshots } : {}), - // ...(localization ? { localization } : {}), + ...(localization ? { localization } : {}), server: { type: serverType, entry_point: entryPoint, @@ -994,9 +994,9 @@ export async function initExtension( const visualAssets = nonInteractive ? { icon: "", icons: [], screenshots: [] } : await promptVisualAssets(); - // const localization = nonInteractive - // ? undefined - // : await promptLocalization(); + const localization = nonInteractive + ? undefined + : await promptLocalization(); const serverConfig = nonInteractive ? getDefaultServerConfig(packageData) : await promptServerConfig(packageData); @@ -1029,6 +1029,7 @@ export async function initExtension( compatibility, userConfig, optionalFields, + localization, ); // Write manifest diff --git a/src/shared/common.ts b/src/shared/common.ts index 9a8aeb3..50c3bd6 100644 --- a/src/shared/common.ts +++ b/src/shared/common.ts @@ -14,5 +14,21 @@ export const McpbSignatureInfoSchema = z.strictObject({ fingerprint: z.string().optional(), }); +export const McpbUserConfigurationOptionSchema = z.strictObject({ + type: z.enum(["string", "number", "boolean", "directory", "file"]), + title: z.string(), + description: z.string(), + required: z.boolean().optional(), + default: z + .union([z.string(), z.number(), z.boolean(), z.array(z.string())]) + .optional(), + multiple: z.boolean().optional(), + sensitive: z.boolean().optional(), + min: z.number().optional(), + max: z.number().optional(), +}); + + export type McpbSignatureInfo = z.infer; export type McpbUserConfigValues = z.infer; +export type McpbUserConfigurationOption = z.infer; diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 53b08ed..e2bcb4c 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -13,7 +13,7 @@ export const LATEST_MANIFEST_VERSION = "0.3" as const; /** * Default manifest version for new packages */ -export const DEFAULT_MANIFEST_VERSION = "0.2" as const; +export const DEFAULT_MANIFEST_VERSION = "0.3" as const; /** * Map of manifest versions to their strict schemas From 4f5138cdd7e69b2aac6b41c48461d025c9b04a83 Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Fri, 7 Nov 2025 15:23:21 -0800 Subject: [PATCH 2/5] chore: uncomment localization in tests --- test/init.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/init.test.ts b/test/init.test.ts index 7acd57a..f25a4d8 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -216,7 +216,7 @@ describe("init functions", () => { keywords: "", license: "", }, - // undefined, // localization + undefined, // localization ); expect(manifest).toEqual({ @@ -315,10 +315,10 @@ describe("init functions", () => { license: "MIT", repository: { type: "git", url: "https://github.com/user/repo" }, }, - // { // localization - // resources: "resources/${locale}.json", - // default_locale: "en-US", - // }, + { // localization + resources: "resources/${locale}.json", + default_locale: "en-US", + }, ); expect(manifest).toEqual({ From a10feb85b1c87fb0021852dd6af350defd37706b Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Fri, 7 Nov 2025 15:24:18 -0800 Subject: [PATCH 3/5] cleanup --- src/shared/common.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/shared/common.ts b/src/shared/common.ts index 50c3bd6..9a8aeb3 100644 --- a/src/shared/common.ts +++ b/src/shared/common.ts @@ -14,21 +14,5 @@ export const McpbSignatureInfoSchema = z.strictObject({ fingerprint: z.string().optional(), }); -export const McpbUserConfigurationOptionSchema = z.strictObject({ - type: z.enum(["string", "number", "boolean", "directory", "file"]), - title: z.string(), - description: z.string(), - required: z.boolean().optional(), - default: z - .union([z.string(), z.number(), z.boolean(), z.array(z.string())]) - .optional(), - multiple: z.boolean().optional(), - sensitive: z.boolean().optional(), - min: z.number().optional(), - max: z.number().optional(), -}); - - export type McpbSignatureInfo = z.infer; export type McpbUserConfigValues = z.infer; -export type McpbUserConfigurationOption = z.infer; From 96352fb48af7c7d08ad02b73bf1e7ce2e21fff4b Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Fri, 7 Nov 2025 15:53:52 -0800 Subject: [PATCH 4/5] fix: update test expectations to include localization field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buildManifest test now correctly expects the localization field in the output when it's provided as input. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/init.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/init.test.ts b/test/init.test.ts index f25a4d8..39e77f1 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -388,6 +388,10 @@ describe("init functions", () => { keywords: ["test", "extension", "mcp"], license: "MIT", repository: { type: "git", url: "https://github.com/user/repo" }, + localization: { + default_locale: "en-US", + resources: "resources/${locale}.json", + }, }); }); }); From f2317e1e2cd27b43b4d4854aa2a6581014023863 Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Fri, 7 Nov 2025 16:41:23 -0800 Subject: [PATCH 5/5] fix: format localization comment in test file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move inline comment to separate line to satisfy linter requirements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/init.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/init.test.ts b/test/init.test.ts index 39e77f1..71d79e7 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -315,7 +315,8 @@ describe("init functions", () => { license: "MIT", repository: { type: "git", url: "https://github.com/user/repo" }, }, - { // localization + { + // localization resources: "resources/${locale}.json", default_locale: "en-US", },