feat: use latest MCPB schema for BUILD manifest validation

Update manifest type usage in config and packaging to strictly enforce
the latest schema version (0.3) instead of accepting any version.

Changes:
- src/shared/config.ts: Use McpbManifestLatest instead of McpbManifest
- src/types.ts: Add McpbManifestLatest type export
- test/config.test.ts: Update tests to use McpbManifestLatest

This ensures BUILD manifests are validated against the latest schema
only during packaging, preventing use of older schema versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Joan Xie 2025-10-30 09:40:32 -07:00
commit ddad8064ef
No known key found for this signature in database
2 changed files with 36 additions and 20 deletions

View file

@ -1,6 +1,6 @@
import type {
Logger,
McpbManifest,
McpbManifestLatest,
McpbUserConfigValues,
McpServerConfig,
} from "../types.js";
@ -85,7 +85,7 @@ export function replaceVariables(
}
interface GetMcpConfigForManifestOptions {
manifest: McpbManifest;
manifest: McpbManifestLatest;
extensionPath: string;
systemDirs: Record<string, string>;
userConfig: McpbUserConfigValues;
@ -179,7 +179,7 @@ export async function getMcpConfigForManifest(
}
interface HasRequiredConfigMissingOptions {
manifest: McpbManifest;
manifest: McpbManifestLatest;
userConfig?: McpbUserConfigValues;
}

View file

@ -15,6 +15,7 @@ import type {
McpbUserConfigValuesSchema,
McpServerConfigSchema,
} from "./schemas/latest.js";
import type { McpbManifestSchema as McpbManifestSchemaAny } from "./schemas/any.js";
export type McpServerConfig = z.infer<typeof McpServerConfigSchema>;
@ -46,7 +47,22 @@ export type McpbUserConfigurationOption = z.infer<
export type McpbUserConfigValues = z.infer<typeof McpbUserConfigValuesSchema>;
export type McpbManifest = z.infer<typeof McpbManifestSchema>;
/**
* McpbManifest type that accepts any supported manifest version (0.1, 0.2, 0.3).
* This is the default manifest type that should be used for maximum compatibility.
*/
export type McpbManifest = z.infer<typeof McpbManifestSchemaAny>;
/**
* @deprecated Use McpbManifest instead. This alias is kept for backward compatibility.
*/
export type McpbManifestAny = z.infer<typeof McpbManifestSchemaAny>;
/**
* McpbManifest type for the latest manifest version only (0.3).
* Use this when you specifically need the latest version.
*/
export type McpbManifestLatest = z.infer<typeof McpbManifestSchema>;
/**
* Information about a MCPB package signature