diff --git a/packages/types/npm/package.metadata.json b/packages/types/npm/package.metadata.json index 04552040c74..4e9bb68f189 100644 --- a/packages/types/npm/package.metadata.json +++ b/packages/types/npm/package.metadata.json @@ -1,6 +1,6 @@ { "name": "@roo-code/types", - "version": "1.103.0", + "version": "1.105.0", "description": "TypeScript type definitions for Roo Code.", "publishConfig": { "access": "public", diff --git a/packages/types/src/__tests__/cloud.test.ts b/packages/types/src/__tests__/cloud.test.ts index 366916171e1..0d412a312dc 100644 --- a/packages/types/src/__tests__/cloud.test.ts +++ b/packages/types/src/__tests__/cloud.test.ts @@ -331,3 +331,79 @@ describe("organizationCloudSettingsSchema with workspaceTaskVisibility", () => { expect(result.data?.cloudSettings?.workspaceTaskVisibility).toBe("list-only") }) }) + +describe("organizationCloudSettingsSchema with llmEnhancedFeaturesEnabled", () => { + it("should validate without llmEnhancedFeaturesEnabled property", () => { + const input = { + recordTaskMessages: true, + enableTaskSharing: true, + } + const result = organizationCloudSettingsSchema.safeParse(input) + expect(result.success).toBe(true) + expect(result.data?.llmEnhancedFeaturesEnabled).toBeUndefined() + }) + + it("should validate with llmEnhancedFeaturesEnabled as true", () => { + const input = { + recordTaskMessages: true, + enableTaskSharing: true, + llmEnhancedFeaturesEnabled: true, + } + const result = organizationCloudSettingsSchema.safeParse(input) + expect(result.success).toBe(true) + expect(result.data?.llmEnhancedFeaturesEnabled).toBe(true) + }) + + it("should validate with llmEnhancedFeaturesEnabled as false", () => { + const input = { + recordTaskMessages: true, + enableTaskSharing: true, + llmEnhancedFeaturesEnabled: false, + } + const result = organizationCloudSettingsSchema.safeParse(input) + expect(result.success).toBe(true) + expect(result.data?.llmEnhancedFeaturesEnabled).toBe(false) + }) + + it("should reject non-boolean llmEnhancedFeaturesEnabled", () => { + const input = { + llmEnhancedFeaturesEnabled: "true", + } + const result = organizationCloudSettingsSchema.safeParse(input) + expect(result.success).toBe(false) + }) + + it("should have correct TypeScript type", () => { + // Type-only test to ensure TypeScript compilation + const settings: OrganizationCloudSettings = { + recordTaskMessages: true, + enableTaskSharing: true, + llmEnhancedFeaturesEnabled: true, + } + expect(settings.llmEnhancedFeaturesEnabled).toBe(true) + + const settingsWithoutLlmFeatures: OrganizationCloudSettings = { + recordTaskMessages: false, + } + expect(settingsWithoutLlmFeatures.llmEnhancedFeaturesEnabled).toBeUndefined() + }) + + it("should validate in organizationSettingsSchema with llmEnhancedFeaturesEnabled", () => { + const input = { + version: 1, + cloudSettings: { + recordTaskMessages: true, + enableTaskSharing: true, + llmEnhancedFeaturesEnabled: false, + }, + defaultSettings: {}, + allowList: { + allowAll: true, + providers: {}, + }, + } + const result = organizationSettingsSchema.safeParse(input) + expect(result.success).toBe(true) + expect(result.data?.cloudSettings?.llmEnhancedFeaturesEnabled).toBe(false) + }) +}) diff --git a/packages/types/src/cloud.ts b/packages/types/src/cloud.ts index 9d365b65254..13d7db674a4 100644 --- a/packages/types/src/cloud.ts +++ b/packages/types/src/cloud.ts @@ -139,6 +139,7 @@ export const organizationCloudSettingsSchema = z.object({ taskShareExpirationDays: z.number().int().positive().optional(), allowMembersViewAllTasks: z.boolean().optional(), workspaceTaskVisibility: workspaceTaskVisibilitySchema.optional(), + llmEnhancedFeaturesEnabled: z.boolean().optional(), }) export type OrganizationCloudSettings = z.infer @@ -213,6 +214,7 @@ export const ORGANIZATION_DEFAULT: OrganizationSettings = { allowPublicTaskSharing: true, taskShareExpirationDays: 30, allowMembersViewAllTasks: true, + llmEnhancedFeaturesEnabled: false, }, defaultSettings: {}, allowList: ORGANIZATION_ALLOW_ALL,