Move RCC types to @roo-code/types (#75)

This commit is contained in:
Chris Estreich 2025-06-03 12:10:32 -07:00 committed by GitHub
parent 9eeae3071d
commit 2a8cafa1f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 25 additions and 83 deletions

View file

@ -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",

10
pnpm-lock.yaml generated
View file

@ -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': {}

View file

@ -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';

View file

@ -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';

View file

@ -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';

View file

@ -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,

View file

@ -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,

View file

@ -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';

View file

@ -1,5 +1,4 @@
export * from './api';
export * from './auth';
export * from './org';
export * from './react-query';
export * from './time-period';

View file

@ -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<typeof organizationAllowListSchema>;
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<typeof organizationSettingsSchema>;
export const ORGANIZATION_DEFAULT: OrganizationSettings = {
version: 0,
cloudSettings: {},
defaultSettings: {},
allowList: ORGANIZATION_ALLOW_ALL,
} as const;