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:
commit
82b12a406e
3 changed files with 15 additions and 4 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
13
src/types.ts
13
src/types.ts
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue