Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/types/npm/package.metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
76 changes: 76 additions & 0 deletions packages/types/src/__tests__/cloud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
2 changes: 2 additions & 0 deletions packages/types/src/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof organizationCloudSettingsSchema>
Expand Down Expand Up @@ -213,6 +214,7 @@ export const ORGANIZATION_DEFAULT: OrganizationSettings = {
allowPublicTaskSharing: true,
taskShareExpirationDays: 30,
allowMembersViewAllTasks: true,
llmEnhancedFeaturesEnabled: false,
},
defaultSettings: {},
allowList: ORGANIZATION_ALLOW_ALL,
Expand Down
Loading