Browse Source

Add enum support to configuration schema (#9247)

Matt Rubens 1 month ago
parent
commit
ad1e9a82f9
2 changed files with 13 additions and 0 deletions
  1. 12 0
      packages/build/src/__tests__/index.test.ts
  2. 1 0
      packages/build/src/types.ts

+ 12 - 0
packages/build/src/__tests__/index.test.ts

@@ -100,6 +100,12 @@ describe("generatePackageJson", () => {
 								default: "",
 								description: "%settings.customStoragePath.description%",
 							},
+							"roo-cline.toolProtocol": {
+								type: "string",
+								enum: ["xml", "native"],
+								default: "xml",
+								description: "%settings.toolProtocol.description%",
+							},
 						},
 					},
 				},
@@ -213,6 +219,12 @@ describe("generatePackageJson", () => {
 							default: "",
 							description: "%settings.customStoragePath.description%",
 						},
+						"roo-code-nightly.toolProtocol": {
+							type: "string",
+							enum: ["xml", "native"],
+							default: "xml",
+							description: "%settings.toolProtocol.description%",
+						},
 					},
 				},
 			},

+ 1 - 0
packages/build/src/types.ts

@@ -86,6 +86,7 @@ const configurationPropertySchema = z.object({
 		})
 		.optional(),
 	properties: z.record(z.string(), z.any()).optional(),
+	enum: z.array(z.any()).optional(),
 	default: z.any().optional(),
 	description: z.string(),
 })