diff --git a/package.json b/package.json index 12b629549f..0fc5db37a3 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@radix-ui/react-tabs": "^1.1.12", "@radix-ui/react-toast": "^1.2.14", "@radix-ui/react-tooltip": "^1.2.7", - "@roo-code/types": "^1.24.0", + "@roo-code/types": "^1.25.0", "@sentry/nextjs": "^9.23.0", "@t3-oss/env-nextjs": "^0.13.6", "@tailwindcss/postcss": "^4.1.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbcaac1794..5e668fc659 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: ^1.2.7 version: 1.2.7(@types/react@19.1.6)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@roo-code/types': - specifier: ^1.24.0 - version: 1.24.0 + specifier: ^1.25.0 + version: 1.25.0 '@sentry/nextjs': specifier: ^9.23.0 version: 9.23.0(@opentelemetry/context-async-hooks@1.30.1(@opentelemetry/api@1.9.0))(@opentelemetry/core@1.30.1(@opentelemetry/api@1.9.0))(@opentelemetry/instrumentation@0.57.2(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.30.1(@opentelemetry/api@1.9.0))(next@15.3.3(@babel/core@7.27.3)(@opentelemetry/api@1.9.0)(@playwright/test@1.52.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react@19.1.0)(webpack@5.99.9(@swc/core@1.11.29)(esbuild@0.25.5)) @@ -2939,8 +2939,8 @@ packages: cpu: [x64] os: [win32] - '@roo-code/types@1.24.0': - resolution: {integrity: sha512-Fo8/k2EqovcDji7L674MbrpJ+Prw18jag4j2S1+xQrmRDTgmJ7nBZXjFxi8MtY/Us3AIA6sufS9Gi5/czwye6Q==} + '@roo-code/types@1.25.0': + resolution: {integrity: sha512-1MSFGi0jq6WSKDF26kC2yV1B0QSPGr1FvABRi+huKY+dgmaioUP0WBnKOaeackHneSFIMy7eZK6Gw7K1yNXTug==} '@schummar/icu-type-parser@1.21.5': resolution: {integrity: sha512-bXHSaW5jRTmke9Vd0h5P7BtWZG9Znqb8gSDxZnxaGSJnGwPLDPfS+3g0BKzeWqzgZPsIVZkM7m2tbo18cm5HBw==} @@ -11813,7 +11813,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.41.1': optional: true - '@roo-code/types@1.24.0': {} + '@roo-code/types@1.25.0': {} '@schummar/icu-type-parser@1.21.5': {} diff --git a/src/actions/defaultParameters.ts b/src/actions/defaultParameters.ts index 79a5bf4ea1..1d5533401c 100644 --- a/src/actions/defaultParameters.ts +++ b/src/actions/defaultParameters.ts @@ -3,7 +3,9 @@ import { sql } from 'drizzle-orm'; import { z } from 'zod'; -import { type ApiResponse, ORGANIZATION_ALLOW_ALL } from '@/types'; +import { ORGANIZATION_ALLOW_ALL } from '@roo-code/types'; + +import type { ApiResponse } from '@/types'; import { AuditLogTargetType, client as db, orgSettings } from '@/db/server'; import { isAuthSuccess, handleError } from '@/lib/server'; diff --git a/src/actions/organizationSettings.ts b/src/actions/organizationSettings.ts index 3f1ff19d15..ddd6b810be 100644 --- a/src/actions/organizationSettings.ts +++ b/src/actions/organizationSettings.ts @@ -5,14 +5,15 @@ import { auth } from '@clerk/nextjs/server'; import { z } from 'zod'; import { - type ApiResponse, - ORGANIZATION_ALLOW_ALL, - ORGANIZATION_DEFAULT, type OrganizationSettings, organizationAllowListSchema, organizationDefaultSettingsSchema, organizationCloudSettingsSchema, -} from '@/types'; + ORGANIZATION_ALLOW_ALL, + ORGANIZATION_DEFAULT, +} from '@roo-code/types'; + +import type { ApiResponse } from '@/types'; import { AuditLogTargetType, client as db, orgSettings } from '@/db/server'; import { handleError, isAuthSuccess } from '@/lib/server'; diff --git a/src/app/(authenticated)/providers/ProviderForm.tsx b/src/app/(authenticated)/providers/ProviderForm.tsx index b96c35ff09..a34c5a9521 100644 --- a/src/app/(authenticated)/providers/ProviderForm.tsx +++ b/src/app/(authenticated)/providers/ProviderForm.tsx @@ -2,9 +2,9 @@ import { useForm } from 'react-hook-form'; import { useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; -import type { ProviderName } from '@roo-code/types'; +import type { ProviderName, OrganizationAllowList } from '@roo-code/types'; -import { type OrganizationAllowList, QueryKey } from '@/types'; +import { QueryKey } from '@/types'; import { updateOrganization } from '@/actions/organizationSettings'; import { useAvailableProviders } from '@/hooks/useAvailableProviders'; import { cn } from '@/lib/utils'; diff --git a/src/app/(authenticated)/telemetry/TelemetryForm.tsx b/src/app/(authenticated)/telemetry/TelemetryForm.tsx index 8c1c9a6c9f..a37f815ff7 100644 --- a/src/app/(authenticated)/telemetry/TelemetryForm.tsx +++ b/src/app/(authenticated)/telemetry/TelemetryForm.tsx @@ -7,7 +7,11 @@ import { useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; import { Cloud } from 'lucide-react'; -import type { OrganizationSettings, OrganizationCloudSettings } from '@/types'; +import type { + OrganizationSettings, + OrganizationCloudSettings, +} from '@roo-code/types'; + import { updateOrganization } from '@/actions/organizationSettings'; import { Button, diff --git a/src/components/__tests__/ProviderForm.test.tsx b/src/components/__tests__/ProviderForm.test.tsx index cc59d44f27..7069d7ac9b 100644 --- a/src/components/__tests__/ProviderForm.test.tsx +++ b/src/components/__tests__/ProviderForm.test.tsx @@ -5,7 +5,8 @@ import userEvent from '@testing-library/user-event'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { toast } from 'sonner'; -import { type OrganizationSettings } from '@/types'; +import type { OrganizationSettings } from '@roo-code/types'; + import { updateOrganization, getOrganizationSettings, diff --git a/src/db/schema.ts b/src/db/schema.ts index a5f5d7f9f9..122fc6c0c0 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -12,9 +12,9 @@ import { relations } from 'drizzle-orm'; import { type OrganizationDefaultSettings, type OrganizationAllowList, - ORGANIZATION_ALLOW_ALL, type OrganizationCloudSettings, -} from '@/types'; + ORGANIZATION_ALLOW_ALL, +} from '@roo-code/types'; import { AuditLogTargetType } from './enums'; diff --git a/src/types/index.ts b/src/types/index.ts index 75c0e186f7..95b277761b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,5 +1,4 @@ export * from './api'; export * from './auth'; -export * from './org'; export * from './react-query'; export * from './time-period'; diff --git a/src/types/org.ts b/src/types/org.ts deleted file mode 100644 index 11f3b2e53f..0000000000 --- a/src/types/org.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { providerNames } from '@roo-code/types'; -import { z } from 'zod'; - -export const organizationAllowListSchema = z.object({ - allowAll: z.boolean(), - providers: z.record( - z.enum(providerNames), - z.object({ - allowAll: z.boolean(), - models: z.array(z.string()).optional(), - }), - ), -}); - -// From Roo-Code-Internal - -export type OrganizationAllowList = z.infer; - -export const ORGANIZATION_ALLOW_ALL: OrganizationAllowList = { - allowAll: true, - providers: {}, -} as const; - -export const organizationDefaultSettingsSchema = z.object({ - enableCheckpoints: z.boolean().optional(), - fuzzyMatchThreshold: z.number().optional(), - maxOpenTabsContext: z.number().int().nonnegative().optional(), - maxReadFileLine: z.number().int().gte(-1).optional(), - maxWorkspaceFiles: z.number().int().nonnegative().optional(), - showRooIgnoredFiles: z.boolean().optional(), - terminalCommandDelay: z.number().int().nonnegative().optional(), - terminalCompressProgressBar: z.boolean().optional(), - terminalOutputLineLimit: z.number().int().nonnegative().optional(), - terminalShellIntegrationDisabled: z.boolean().optional(), - terminalShellIntegrationTimeout: z.number().int().nonnegative().optional(), - terminalZshClearEolMark: z.boolean().optional(), -}); - -export type OrganizationDefaultSettings = z.infer< - typeof organizationDefaultSettingsSchema ->; - -export const organizationCloudSettingsSchema = z.object({ - recordTaskMessages: z.boolean().optional(), -}); - -export type OrganizationCloudSettings = z.infer< - typeof organizationCloudSettingsSchema ->; - -export const organizationSettingsSchema = z.object({ - version: z.number(), - cloudSettings: organizationCloudSettingsSchema.optional(), - defaultSettings: organizationDefaultSettingsSchema, - allowList: organizationAllowListSchema, -}); - -export type OrganizationSettings = z.infer; - -export const ORGANIZATION_DEFAULT: OrganizationSettings = { - version: 0, - cloudSettings: {}, - defaultSettings: {}, - allowList: ORGANIZATION_ALLOW_ALL, -} as const;