Merge pull request #140 from anthropics/feat/use-latest-schema-only

feat: export McpbManifestAny type, use latest MCPB schema for BUILD manifest validation
This commit is contained in:
joan-anthropic 2025-10-30 14:26:23 -07:00 • committed by GitHub
commit 82b12a406e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@anthropic-ai/mcpb",
"description": "Tools for building MCP Bundles",
"version": "1.1.3",
"version": "1.1.4",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",

View file

@ -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;

View file

@ -1,5 +1,6 @@
import type * as z from "zod";
import type { McpbManifestSchema as McpbManifestSchemaAny } from "./schemas/any.js";
import type {
McpbManifestAuthorSchema,
McpbManifestCompatibilitySchema,
@ -46,7 +47,17 @@ 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
* This is the default manifest type that should be used for maximum compatibility.
*/
export type McpbManifest = z.infer<typeof McpbManifestSchemaAny>;
/**
* McpbManifest type for the latest manifest version only
* Use this when you specifically need the latest version.
*/
export type McpbManifestLatest = z.infer<typeof McpbManifestSchema>;
/**
* Information about a MCPB package signature