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.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roo-code/types",
"version": "1.24.0",
"version": "1.25.0",
"description": "TypeScript type definitions for Roo Code.",
"publishConfig": {
"access": "public",
Expand Down
92 changes: 72 additions & 20 deletions packages/types/src/cloud.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { z } from "zod"

import { globalSettingsSchema } from "./global-settings.js"

/**
* CloudUserInfo
*/

export interface CloudUserInfo {
name?: string
email?: string
picture?: string
}

/**
* Organization Allow List
* OrganizationAllowList
*/

export const organizationAllowListSchema = z.object({
Expand All @@ -22,33 +28,79 @@ export const organizationAllowListSchema = z.object({

export type OrganizationAllowList = z.infer<typeof organizationAllowListSchema>

export const ORGANIZATION_ALLOW_ALL: OrganizationAllowList = {
allowAll: true,
providers: {},
} as const
/**
* OrganizationDefaultSettings
*/

export const organizationDefaultSettingsSchema = globalSettingsSchema
.pick({
enableCheckpoints: true,
fuzzyMatchThreshold: true,
maxOpenTabsContext: true,
maxReadFileLine: true,
maxWorkspaceFiles: true,
showRooIgnoredFiles: true,
terminalCommandDelay: true,
terminalCompressProgressBar: true,
terminalOutputLineLimit: true,
terminalShellIntegrationDisabled: true,
terminalShellIntegrationTimeout: true,
terminalZshClearEolMark: true,
})
// Add stronger validations for some fields.
.merge(
z.object({
maxOpenTabsContext: z.number().int().nonnegative().optional(),
maxReadFileLine: z.number().int().gte(-1).optional(),
maxWorkspaceFiles: z.number().int().nonnegative().optional(),
terminalCommandDelay: z.number().int().nonnegative().optional(),
terminalOutputLineLimit: z.number().int().nonnegative().optional(),
terminalShellIntegrationTimeout: z.number().int().nonnegative().optional(),
}),
)

export type OrganizationDefaultSettings = z.infer<typeof organizationDefaultSettingsSchema>

/**
* OrganizationCloudSettings
*/

export const organizationCloudSettingsSchema = z.object({
recordTaskMessages: z.boolean().optional(),
enableTaskSharing: z.boolean().optional(),
taskShareExpirationDays: z.number().int().positive().optional(),
})

export type OrganizationCloudSettings = z.infer<typeof organizationCloudSettingsSchema>

/**
* Organization Settings
*/

export const organizationSettingsSchema = z.object({
version: z.number(),
defaultSettings: z
.object({
enableCheckpoints: z.boolean().optional(),
maxOpenTabsContext: z.number().optional(),
maxWorkspaceFiles: z.number().optional(),
showRooIgnoredFiles: z.boolean().optional(),
maxReadFileLine: z.number().optional(),
fuzzyMatchThreshold: z.number().optional(),
})
.optional(),
cloudSettings: z
.object({
recordTaskMessages: z.boolean().optional(),
})
.optional(),
cloudSettings: organizationCloudSettingsSchema.optional(),
defaultSettings: organizationDefaultSettingsSchema,
allowList: organizationAllowListSchema,
})

export type OrganizationSettings = z.infer<typeof organizationSettingsSchema>

/**
* Constants
*/

export const ORGANIZATION_ALLOW_ALL: OrganizationAllowList = {
allowAll: true,
providers: {},
} as const

export const ORGANIZATION_DEFAULT: OrganizationSettings = {
version: 0,
cloudSettings: {
enableTaskSharing: true,
taskShareExpirationDays: 30,
},
defaultSettings: {},
allowList: ORGANIZATION_ALLOW_ALL,
} as const
Loading