fix: add dxt_version support to v0.2 schemas with deprecation notice
This commit is contained in:
parent
9f078c6163
commit
336e878252
2 changed files with 17 additions and 6 deletions
|
|
@ -76,9 +76,11 @@ export const McpbUserConfigValuesSchema = z.record(
|
|||
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
|
||||
);
|
||||
|
||||
export const McpbManifestSchema = z.strictObject({
|
||||
$schema: z.string().optional(),
|
||||
manifest_version: z.literal("0.2"),
|
||||
export const McpbManifestSchema = z
|
||||
.strictObject({
|
||||
$schema: z.string().optional(),
|
||||
dxt_version: z.literal("0.2").optional().describe("@deprecated Use manifest_version instead"),
|
||||
manifest_version: z.literal("0.2").optional(),
|
||||
name: z.string(),
|
||||
display_name: z.string().optional(),
|
||||
version: z.string(),
|
||||
|
|
@ -103,7 +105,11 @@ export const McpbManifestSchema = z.strictObject({
|
|||
user_config: z
|
||||
.record(z.string(), McpbUserConfigurationOptionSchema)
|
||||
.optional(),
|
||||
});
|
||||
})
|
||||
.refine((data) => !!(data.dxt_version || data.manifest_version), {
|
||||
message:
|
||||
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
|
||||
});
|
||||
|
||||
export const McpbSignatureInfoSchema = z.strictObject({
|
||||
status: z.enum(["signed", "unsigned", "self-signed"]),
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ export const McpbUserConfigValuesSchema = z.record(
|
|||
export const McpbManifestSchema = z
|
||||
.object({
|
||||
$schema: z.string().optional(),
|
||||
manifest_version: z.literal("0.2"),
|
||||
dxt_version: z.literal("0.2").optional().describe("@deprecated Use manifest_version instead"),
|
||||
manifest_version: z.literal("0.2").optional(),
|
||||
name: z.string(),
|
||||
display_name: z.string().optional(),
|
||||
version: z.string(),
|
||||
|
|
@ -105,7 +106,11 @@ export const McpbManifestSchema = z
|
|||
.record(z.string(), McpbUserConfigurationOptionSchema)
|
||||
.optional(),
|
||||
})
|
||||
.passthrough();
|
||||
.passthrough()
|
||||
.refine((data) => !!(data.dxt_version || data.manifest_version), {
|
||||
message:
|
||||
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
|
||||
});
|
||||
|
||||
export const McpbSignatureInfoSchema = z.object({
|
||||
status: z.enum(["signed", "unsigned", "self-signed"]),
|
||||
|
|
|
|||
Loading…
Reference in a new issue