diff --git a/src/cli/init.ts b/src/cli/init.ts index c8e764a..3111b3f 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -3,7 +3,7 @@ import { existsSync, readFileSync, writeFileSync } from "fs"; import { basename, join, resolve } from "path"; import { LATEST_MANIFEST_VERSION } from "../shared/constants.js"; -import type { McpbManifest } from "../types.js"; +import type { McpbManifestLatest } from "../types.js"; interface PackageJson { name?: string; @@ -878,7 +878,7 @@ export function buildManifest( resources: string; default_locale: string; }, -): McpbManifest { +): McpbManifestLatest { const { name, displayName, version, description, authorName } = basicInfo; const { authorEmail, authorUrl } = authorInfo; const { serverType, entryPoint, mcp_config } = serverConfig; diff --git a/src/shared/config.ts b/src/shared/config.ts index ab8e096..20e4262 100644 --- a/src/shared/config.ts +++ b/src/shared/config.ts @@ -1,6 +1,6 @@ import type { Logger, - McpbManifestLatest, + McpbManifest, McpbUserConfigValues, McpServerConfig, } from "../types.js"; @@ -85,7 +85,7 @@ export function replaceVariables( } interface GetMcpConfigForManifestOptions { - manifest: McpbManifestLatest; + manifest: McpbManifest; extensionPath: string; systemDirs: Record; userConfig: McpbUserConfigValues; @@ -179,7 +179,7 @@ export async function getMcpConfigForManifest( } interface HasRequiredConfigMissingOptions { - manifest: McpbManifestLatest; + manifest: McpbManifest; userConfig?: McpbUserConfigValues; } diff --git a/test/config.test.ts b/test/config.test.ts index 4701890..f7a0eb8 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -3,7 +3,7 @@ import { hasRequiredConfigMissing, replaceVariables, } from "../src/shared/config"; -import type { Logger, McpbManifestLatest } from "../src/types"; +import type { Logger, McpbManifest } from "../src/types"; describe("replaceVariables", () => { it("should replace variables in strings", () => { @@ -89,7 +89,7 @@ describe("getMcpConfigForManifest", () => { data: "/data", }; - const baseManifest: McpbManifestLatest = { + const baseManifest: McpbManifest = { manifest_version: "0.3", name: "test-extension", version: "1.0.0", @@ -114,7 +114,7 @@ describe("getMcpConfigForManifest", () => { const manifest = { ...baseManifest, server: undefined, - } as unknown as McpbManifestLatest; + } as unknown as McpbManifest; const result = await getMcpConfigForManifest({ manifest, @@ -129,7 +129,7 @@ describe("getMcpConfigForManifest", () => { }); it("should return undefined when required config is missing", async () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { apiKey: { @@ -171,7 +171,7 @@ describe("getMcpConfigForManifest", () => { }); it("should apply platform overrides", async () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, server: { type: "node", @@ -203,7 +203,7 @@ describe("getMcpConfigForManifest", () => { }); it("should handle user config variable replacement with defaults", async () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { port: { @@ -236,7 +236,7 @@ describe("getMcpConfigForManifest", () => { }); it("should handle user config variable replacement with user values", async () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { paths: { @@ -270,7 +270,7 @@ describe("getMcpConfigForManifest", () => { }); it("should convert boolean user config values to strings", async () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { verbose: { @@ -304,7 +304,7 @@ describe("getMcpConfigForManifest", () => { }); describe("hasRequiredConfigMissing", () => { - const baseManifest: McpbManifestLatest = { + const baseManifest: McpbManifest = { manifest_version: "0.3", name: "test-extension", version: "1.0.0", @@ -329,7 +329,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return false when no config fields are required", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { port: { @@ -349,7 +349,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return false when required config is provided", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { apiKey: { @@ -369,7 +369,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return true when required config is undefined", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { apiKey: { @@ -389,7 +389,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return true when required config is empty string", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { apiKey: { @@ -409,7 +409,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return true when required config is array with invalid values", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { paths: { @@ -430,7 +430,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should return true when required config is empty array", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { paths: { @@ -459,7 +459,7 @@ describe("hasRequiredConfigMissing", () => { }); it("should handle multiple required config fields", () => { - const manifest: McpbManifestLatest = { + const manifest: McpbManifest = { ...baseManifest, user_config: { apiKey: {