refactor: use MANIFEST_VERSION variable in z.literal() instead of hardcoded strings

This commit is contained in:
Joan Xie 2025-09-24 13:54:38 -07:00
commit fe733e3450
No known key found for this signature in database
4 changed files with 12 additions and 8 deletions

View file

@ -79,8 +79,8 @@ export const McpbUserConfigValuesSchema = z.record(
export const McpbManifestSchema = z
.strictObject({
$schema: z.string().optional(),
dxt_version: z.literal("0.1").optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal("0.1").optional(),
dxt_version: z.literal(MANIFEST_VERSION).optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal(MANIFEST_VERSION).optional(),
name: z.string(),
display_name: z.string().optional(),
version: z.string(),

View file

@ -79,8 +79,8 @@ export const McpbUserConfigValuesSchema = z.record(
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(),
dxt_version: z.literal(MANIFEST_VERSION).optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal(MANIFEST_VERSION).optional(),
name: z.string(),
display_name: z.string().optional(),
version: z.string(),

View file

@ -1,5 +1,7 @@
import * as z from "zod";
export const MANIFEST_VERSION = "0.1";
export const McpServerConfigSchema = z.object({
command: z.string(),
args: z.array(z.string()).optional(),
@ -79,8 +81,8 @@ export const McpbUserConfigValuesSchema = z.record(
export const McpbManifestSchema = z
.object({
$schema: z.string().optional(),
dxt_version: z.literal("0.1").optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal("0.1").optional(),
dxt_version: z.literal(MANIFEST_VERSION).optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal(MANIFEST_VERSION).optional(),
name: z.string(),
display_name: z.string().optional(),
version: z.string(),

View file

@ -1,5 +1,7 @@
import * as z from "zod";
export const MANIFEST_VERSION = "0.2";
export const McpServerConfigSchema = z.object({
command: z.string(),
args: z.array(z.string()).optional(),
@ -79,8 +81,8 @@ export const McpbUserConfigValuesSchema = z.record(
export const McpbManifestSchema = z
.object({
$schema: z.string().optional(),
dxt_version: z.literal("0.2").optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal("0.2").optional(),
dxt_version: z.literal(MANIFEST_VERSION).optional().describe("@deprecated Use manifest_version instead"),
manifest_version: z.literal(MANIFEST_VERSION).optional(),
name: z.string(),
display_name: z.string().optional(),
version: z.string(),