diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql index 6ae8f3aff6..6f6dffadd3 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql @@ -1743,7 +1743,7 @@ type NativeModelCapabilities { twitterSearch: Boolean } -type ClientAIModelConfig { +type ClientAiModelConfig { modelId: String! label: String! modelFamily: ModelFamily @@ -1769,7 +1769,7 @@ enum ModelFamily { GROK } -type AdminAIModelConfig { +type AdminAiModelConfig { modelId: String! label: String! modelFamily: ModelFamily @@ -1789,8 +1789,8 @@ type AdminAIModelConfig { dataResidency: String } -type AdminAIModels { - models: [AdminAIModelConfig!]! +type AdminAiModels { + models: [AdminAiModelConfig!]! defaultSmartModelId: String defaultFastModelId: String } @@ -1852,7 +1852,7 @@ type ClientConfig { appVersion: String authProviders: AuthProviders! billing: Billing! - aiModels: [ClientAIModelConfig!]! + aiModels: [ClientAiModelConfig!]! signInPrefilled: Boolean! isMultiWorkspaceEnabled: Boolean! isEmailVerificationRequired: Boolean! @@ -2957,14 +2957,14 @@ type AgentMessage { createdAt: DateTime! } -type AISystemPromptSection { +type AiSystemPromptSection { title: String! content: String! estimatedTokenCount: Int! } -type AISystemPromptPreview { - sections: [AISystemPromptSection!]! +type AiSystemPromptPreview { + sections: [AiSystemPromptSection!]! estimatedTokenCount: Int! } @@ -3319,7 +3319,7 @@ type Query { chatThread(id: UUID!): AgentChatThread! chatMessages(threadId: UUID!): [AgentMessage!]! chatStreamCatchupChunks(threadId: UUID!): ChatStreamCatchupChunks! - getAISystemPromptPreview: AISystemPromptPreview! + getAiSystemPromptPreview: AiSystemPromptPreview! skills: [Skill!]! skill(id: UUID!): Skill chatThreads( @@ -3364,7 +3364,7 @@ type Query { getIndicatorHealthStatus(indicatorId: HealthIndicatorId!): AdminPanelHealthServiceData! getQueueMetrics(queueName: String!, timeRange: QueueMetricsTimeRange = OneHour): QueueMetricsData! versionInfo: VersionInfo! - getAdminAiModels: AdminAIModels! + getAdminAiModels: AdminAiModels! getDatabaseConfigVariable(key: String!): ConfigVariable! getQueueJobs(queueName: String!, state: JobState!, limit: Int = 50, offset: Int = 0): QueueJobsResponse! findAllApplicationRegistrations: [ApplicationRegistration!]! @@ -3519,7 +3519,7 @@ type Mutation { deleteManyNavigationMenuItems(ids: [UUID!]!): [NavigationMenuItem!]! deleteNavigationMenuItem(id: UUID!): NavigationMenuItem! uploadEmailAttachmentFile(file: Upload!): FileWithSignedUrl! - uploadAIChatFile(file: Upload!): FileWithSignedUrl! + uploadAiChatFile(file: Upload!): FileWithSignedUrl! uploadWorkflowFile(file: Upload!): FileWithSignedUrl! uploadWorkspaceLogo(file: Upload!): FileWithSignedUrl! uploadWorkspaceMemberProfilePicture(file: Upload!): FileWithSignedUrl! diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts index 4039c25d4c..85e66f50be 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts @@ -1444,7 +1444,7 @@ export interface NativeModelCapabilities { __typename: 'NativeModelCapabilities' } -export interface ClientAIModelConfig { +export interface ClientAiModelConfig { modelId: Scalars['String'] label: Scalars['String'] modelFamily?: ModelFamily @@ -1460,12 +1460,12 @@ export interface ClientAIModelConfig { contextWindowTokens?: Scalars['Float'] maxOutputTokens?: Scalars['Float'] dataResidency?: Scalars['String'] - __typename: 'ClientAIModelConfig' + __typename: 'ClientAiModelConfig' } export type ModelFamily = 'GPT' | 'CLAUDE' | 'GEMINI' | 'MISTRAL' | 'GROK' -export interface AdminAIModelConfig { +export interface AdminAiModelConfig { modelId: Scalars['String'] label: Scalars['String'] modelFamily?: ModelFamily @@ -1483,14 +1483,14 @@ export interface AdminAIModelConfig { providerLabel?: Scalars['String'] name?: Scalars['String'] dataResidency?: Scalars['String'] - __typename: 'AdminAIModelConfig' + __typename: 'AdminAiModelConfig' } -export interface AdminAIModels { - models: AdminAIModelConfig[] +export interface AdminAiModels { + models: AdminAiModelConfig[] defaultSmartModelId?: Scalars['String'] defaultFastModelId?: Scalars['String'] - __typename: 'AdminAIModels' + __typename: 'AdminAiModels' } export interface Billing { @@ -1552,7 +1552,7 @@ export interface ClientConfig { appVersion?: Scalars['String'] authProviders: AuthProviders billing: Billing - aiModels: ClientAIModelConfig[] + aiModels: ClientAiModelConfig[] signInPrefilled: Scalars['Boolean'] isMultiWorkspaceEnabled: Scalars['Boolean'] isEmailVerificationRequired: Scalars['Boolean'] @@ -2628,17 +2628,17 @@ export interface AgentMessage { __typename: 'AgentMessage' } -export interface AISystemPromptSection { +export interface AiSystemPromptSection { title: Scalars['String'] content: Scalars['String'] estimatedTokenCount: Scalars['Int'] - __typename: 'AISystemPromptSection' + __typename: 'AiSystemPromptSection' } -export interface AISystemPromptPreview { - sections: AISystemPromptSection[] +export interface AiSystemPromptPreview { + sections: AiSystemPromptSection[] estimatedTokenCount: Scalars['Int'] - __typename: 'AISystemPromptPreview' + __typename: 'AiSystemPromptPreview' } export interface ChatStreamCatchupChunks { @@ -2891,7 +2891,7 @@ export interface Query { chatThread: AgentChatThread chatMessages: AgentMessage[] chatStreamCatchupChunks: ChatStreamCatchupChunks - getAISystemPromptPreview: AISystemPromptPreview + getAiSystemPromptPreview: AiSystemPromptPreview skills: Skill[] skill?: Skill chatThreads: AgentChatThreadConnection @@ -2927,7 +2927,7 @@ export interface Query { getIndicatorHealthStatus: AdminPanelHealthServiceData getQueueMetrics: QueueMetricsData versionInfo: VersionInfo - getAdminAiModels: AdminAIModels + getAdminAiModels: AdminAiModels getDatabaseConfigVariable: ConfigVariable getQueueJobs: QueueJobsResponse findAllApplicationRegistrations: ApplicationRegistration[] @@ -2975,7 +2975,7 @@ export interface Mutation { deleteManyNavigationMenuItems: NavigationMenuItem[] deleteNavigationMenuItem: NavigationMenuItem uploadEmailAttachmentFile: FileWithSignedUrl - uploadAIChatFile: FileWithSignedUrl + uploadAiChatFile: FileWithSignedUrl uploadWorkflowFile: FileWithSignedUrl uploadWorkspaceLogo: FileWithSignedUrl uploadWorkspaceMemberProfilePicture: FileWithSignedUrl @@ -4706,7 +4706,7 @@ export interface NativeModelCapabilitiesGenqlSelection{ __scalar?: boolean | number } -export interface ClientAIModelConfigGenqlSelection{ +export interface ClientAiModelConfigGenqlSelection{ modelId?: boolean | number label?: boolean | number modelFamily?: boolean | number @@ -4726,7 +4726,7 @@ export interface ClientAIModelConfigGenqlSelection{ __scalar?: boolean | number } -export interface AdminAIModelConfigGenqlSelection{ +export interface AdminAiModelConfigGenqlSelection{ modelId?: boolean | number label?: boolean | number modelFamily?: boolean | number @@ -4748,8 +4748,8 @@ export interface AdminAIModelConfigGenqlSelection{ __scalar?: boolean | number } -export interface AdminAIModelsGenqlSelection{ - models?: AdminAIModelConfigGenqlSelection +export interface AdminAiModelsGenqlSelection{ + models?: AdminAiModelConfigGenqlSelection defaultSmartModelId?: boolean | number defaultFastModelId?: boolean | number __typename?: boolean | number @@ -4819,7 +4819,7 @@ export interface ClientConfigGenqlSelection{ appVersion?: boolean | number authProviders?: AuthProvidersGenqlSelection billing?: BillingGenqlSelection - aiModels?: ClientAIModelConfigGenqlSelection + aiModels?: ClientAiModelConfigGenqlSelection signInPrefilled?: boolean | number isMultiWorkspaceEnabled?: boolean | number isEmailVerificationRequired?: boolean | number @@ -5993,7 +5993,7 @@ export interface AgentMessageGenqlSelection{ __scalar?: boolean | number } -export interface AISystemPromptSectionGenqlSelection{ +export interface AiSystemPromptSectionGenqlSelection{ title?: boolean | number content?: boolean | number estimatedTokenCount?: boolean | number @@ -6001,8 +6001,8 @@ export interface AISystemPromptSectionGenqlSelection{ __scalar?: boolean | number } -export interface AISystemPromptPreviewGenqlSelection{ - sections?: AISystemPromptSectionGenqlSelection +export interface AiSystemPromptPreviewGenqlSelection{ + sections?: AiSystemPromptSectionGenqlSelection estimatedTokenCount?: boolean | number __typename?: boolean | number __scalar?: boolean | number @@ -6265,7 +6265,7 @@ export interface QueryGenqlSelection{ chatThread?: (AgentChatThreadGenqlSelection & { __args: {id: Scalars['UUID']} }) chatMessages?: (AgentMessageGenqlSelection & { __args: {threadId: Scalars['UUID']} }) chatStreamCatchupChunks?: (ChatStreamCatchupChunksGenqlSelection & { __args: {threadId: Scalars['UUID']} }) - getAISystemPromptPreview?: AISystemPromptPreviewGenqlSelection + getAiSystemPromptPreview?: AiSystemPromptPreviewGenqlSelection skills?: SkillGenqlSelection skill?: (SkillGenqlSelection & { __args: {id: Scalars['UUID']} }) chatThreads?: (AgentChatThreadConnectionGenqlSelection & { __args: { @@ -6307,7 +6307,7 @@ export interface QueryGenqlSelection{ getIndicatorHealthStatus?: (AdminPanelHealthServiceDataGenqlSelection & { __args: {indicatorId: HealthIndicatorId} }) getQueueMetrics?: (QueueMetricsDataGenqlSelection & { __args: {queueName: Scalars['String'], timeRange?: (QueueMetricsTimeRange | null)} }) versionInfo?: VersionInfoGenqlSelection - getAdminAiModels?: AdminAIModelsGenqlSelection + getAdminAiModels?: AdminAiModelsGenqlSelection getDatabaseConfigVariable?: (ConfigVariableGenqlSelection & { __args: {key: Scalars['String']} }) getQueueJobs?: (QueueJobsResponseGenqlSelection & { __args: {queueName: Scalars['String'], state: JobState, limit?: (Scalars['Int'] | null), offset?: (Scalars['Int'] | null)} }) findAllApplicationRegistrations?: ApplicationRegistrationGenqlSelection @@ -6374,7 +6374,7 @@ export interface MutationGenqlSelection{ deleteManyNavigationMenuItems?: (NavigationMenuItemGenqlSelection & { __args: {ids: Scalars['UUID'][]} }) deleteNavigationMenuItem?: (NavigationMenuItemGenqlSelection & { __args: {id: Scalars['UUID']} }) uploadEmailAttachmentFile?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) - uploadAIChatFile?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) + uploadAiChatFile?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) uploadWorkflowFile?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) uploadWorkspaceLogo?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) uploadWorkspaceMemberProfilePicture?: (FileWithSignedUrlGenqlSelection & { __args: {file: Scalars['Upload']} }) @@ -7887,26 +7887,26 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null - const ClientAIModelConfig_possibleTypes: string[] = ['ClientAIModelConfig'] - export const isClientAIModelConfig = (obj?: { __typename?: any } | null): obj is ClientAIModelConfig => { - if (!obj?.__typename) throw new Error('__typename is missing in "isClientAIModelConfig"') - return ClientAIModelConfig_possibleTypes.includes(obj.__typename) + const ClientAiModelConfig_possibleTypes: string[] = ['ClientAiModelConfig'] + export const isClientAiModelConfig = (obj?: { __typename?: any } | null): obj is ClientAiModelConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isClientAiModelConfig"') + return ClientAiModelConfig_possibleTypes.includes(obj.__typename) } - const AdminAIModelConfig_possibleTypes: string[] = ['AdminAIModelConfig'] - export const isAdminAIModelConfig = (obj?: { __typename?: any } | null): obj is AdminAIModelConfig => { - if (!obj?.__typename) throw new Error('__typename is missing in "isAdminAIModelConfig"') - return AdminAIModelConfig_possibleTypes.includes(obj.__typename) + const AdminAiModelConfig_possibleTypes: string[] = ['AdminAiModelConfig'] + export const isAdminAiModelConfig = (obj?: { __typename?: any } | null): obj is AdminAiModelConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAdminAiModelConfig"') + return AdminAiModelConfig_possibleTypes.includes(obj.__typename) } - const AdminAIModels_possibleTypes: string[] = ['AdminAIModels'] - export const isAdminAIModels = (obj?: { __typename?: any } | null): obj is AdminAIModels => { - if (!obj?.__typename) throw new Error('__typename is missing in "isAdminAIModels"') - return AdminAIModels_possibleTypes.includes(obj.__typename) + const AdminAiModels_possibleTypes: string[] = ['AdminAiModels'] + export const isAdminAiModels = (obj?: { __typename?: any } | null): obj is AdminAiModels => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAdminAiModels"') + return AdminAiModels_possibleTypes.includes(obj.__typename) } @@ -8975,18 +8975,18 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null - const AISystemPromptSection_possibleTypes: string[] = ['AISystemPromptSection'] - export const isAISystemPromptSection = (obj?: { __typename?: any } | null): obj is AISystemPromptSection => { - if (!obj?.__typename) throw new Error('__typename is missing in "isAISystemPromptSection"') - return AISystemPromptSection_possibleTypes.includes(obj.__typename) + const AiSystemPromptSection_possibleTypes: string[] = ['AiSystemPromptSection'] + export const isAiSystemPromptSection = (obj?: { __typename?: any } | null): obj is AiSystemPromptSection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAiSystemPromptSection"') + return AiSystemPromptSection_possibleTypes.includes(obj.__typename) } - const AISystemPromptPreview_possibleTypes: string[] = ['AISystemPromptPreview'] - export const isAISystemPromptPreview = (obj?: { __typename?: any } | null): obj is AISystemPromptPreview => { - if (!obj?.__typename) throw new Error('__typename is missing in "isAISystemPromptPreview"') - return AISystemPromptPreview_possibleTypes.includes(obj.__typename) + const AiSystemPromptPreview_possibleTypes: string[] = ['AiSystemPromptPreview'] + export const isAiSystemPromptPreview = (obj?: { __typename?: any } | null): obj is AiSystemPromptPreview => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAiSystemPromptPreview"') + return AiSystemPromptPreview_possibleTypes.includes(obj.__typename) } diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts index b4b2649e97..a12d7f83b6 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/types.ts +++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts @@ -3506,7 +3506,7 @@ export default { 1 ] }, - "ClientAIModelConfig": { + "ClientAiModelConfig": { "modelId": [ 1 ], @@ -3557,7 +3557,7 @@ export default { ] }, "ModelFamily": {}, - "AdminAIModelConfig": { + "AdminAiModelConfig": { "modelId": [ 1 ], @@ -3613,7 +3613,7 @@ export default { 1 ] }, - "AdminAIModels": { + "AdminAiModels": { "models": [ 181 ], @@ -5936,7 +5936,7 @@ export default { 1 ] }, - "AISystemPromptSection": { + "AiSystemPromptSection": { "title": [ 1 ], @@ -5950,7 +5950,7 @@ export default { 1 ] }, - "AISystemPromptPreview": { + "AiSystemPromptPreview": { "sections": [ 331 ], @@ -6810,7 +6810,7 @@ export default { ] } ], - "getAISystemPromptPreview": [ + "getAiSystemPromptPreview": [ 332 ], "skills": [ @@ -7544,7 +7544,7 @@ export default { ] } ], - "uploadAIChatFile": [ + "uploadAiChatFile": [ 118, { "file": [ diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index 8e345a73e7..e2362bd4a7 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -19,19 +19,6 @@ export type Scalars = { Upload: any; }; -export type AiSystemPromptPreview = { - __typename?: 'AISystemPromptPreview'; - estimatedTokenCount: Scalars['Int']; - sections: Array; -}; - -export type AiSystemPromptSection = { - __typename?: 'AISystemPromptSection'; - content: Scalars['String']; - estimatedTokenCount: Scalars['Int']; - title: Scalars['String']; -}; - export type ActivateWorkspaceInput = { displayName?: InputMaybe; }; @@ -43,7 +30,7 @@ export type AddQuerySubscriptionInput = { }; export type AdminAiModelConfig = { - __typename?: 'AdminAIModelConfig'; + __typename?: 'AdminAiModelConfig'; contextWindowTokens?: Maybe; dataResidency?: Maybe; inputCostPerMillionTokens?: Maybe; @@ -64,7 +51,7 @@ export type AdminAiModelConfig = { }; export type AdminAiModels = { - __typename?: 'AdminAIModels'; + __typename?: 'AdminAiModels'; defaultFastModelId?: Maybe; defaultSmartModelId?: Maybe; models: Array; @@ -328,6 +315,19 @@ export enum AiModelRole { SMART = 'SMART' } +export type AiSystemPromptPreview = { + __typename?: 'AiSystemPromptPreview'; + estimatedTokenCount: Scalars['Int']; + sections: Array; +}; + +export type AiSystemPromptSection = { + __typename?: 'AiSystemPromptSection'; + content: Scalars['String']; + estimatedTokenCount: Scalars['Int']; + title: Scalars['String']; +}; + export enum AllMetadataName { agent = 'agent', commandMenuItem = 'commandMenuItem', @@ -924,7 +924,7 @@ export type CheckUserExist = { }; export type ClientAiModelConfig = { - __typename?: 'ClientAIModelConfig'; + __typename?: 'ClientAiModelConfig'; contextWindowTokens?: Maybe; dataResidency?: Maybe; inputCostPerMillionTokens?: Maybe; @@ -2792,7 +2792,7 @@ export type Mutation = { updateWorkspaceMemberRole: WorkspaceMember; updateWorkspaceMemberSettings: Scalars['Boolean']; upgradeApplication: Scalars['Boolean']; - uploadAIChatFile: FileWithSignedUrl; + uploadAiChatFile: FileWithSignedUrl; uploadAppTarball: ApplicationRegistration; uploadApplicationFile: File; uploadEmailAttachmentFile: FileWithSignedUrl; @@ -4441,13 +4441,13 @@ export type Query = { findWorkspaceInvitations: Array; frontComponent?: Maybe; frontComponents: Array; - getAISystemPromptPreview: AiSystemPromptPreview; getAddressDetails: PlaceDetailsResult; getAdminAiModels: AdminAiModels; getAdminAiUsageByWorkspace: Array; getAdminChatThreadMessages: AdminChatThreadMessages; getAdminWorkspaceChatThreads: Array; getAiProviders: Scalars['JSON']; + getAiSystemPromptPreview: AiSystemPromptPreview; getApprovedAccessDomains: Array; getAutoCompleteAddress: Array; getAvailablePackages: Scalars['JSON']; @@ -6636,7 +6636,7 @@ export type UploadAiChatFileMutationVariables = Exact<{ }>; -export type UploadAiChatFileMutation = { __typename?: 'Mutation', uploadAIChatFile: { __typename?: 'FileWithSignedUrl', id: string, path: string, size: number, createdAt: string, url: string } }; +export type UploadAiChatFileMutation = { __typename?: 'Mutation', uploadAiChatFile: { __typename?: 'FileWithSignedUrl', id: string, path: string, size: number, createdAt: string, url: string } }; export type FindManyAgentsQueryVariables = Exact<{ [key: string]: never; }>; @@ -7462,7 +7462,7 @@ export type SetAdminDefaultAiModelMutation = { __typename?: 'Mutation', setAdmin export type GetAdminAiModelsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetAdminAiModelsQuery = { __typename?: 'Query', getAdminAiModels: { __typename?: 'AdminAIModels', defaultSmartModelId?: string | null, defaultFastModelId?: string | null, models: Array<{ __typename?: 'AdminAIModelConfig', modelId: string, label: string, modelFamily?: ModelFamily | null, sdkPackage?: string | null, isAvailable: boolean, isAdminEnabled: boolean, isDeprecated?: boolean | null, isRecommended?: boolean | null, contextWindowTokens?: number | null, maxOutputTokens?: number | null, inputCostPerMillionTokens?: number | null, outputCostPerMillionTokens?: number | null, providerName?: string | null, providerLabel?: string | null, name?: string | null, dataResidency?: string | null }> } }; +export type GetAdminAiModelsQuery = { __typename?: 'Query', getAdminAiModels: { __typename?: 'AdminAiModels', defaultSmartModelId?: string | null, defaultFastModelId?: string | null, models: Array<{ __typename?: 'AdminAiModelConfig', modelId: string, label: string, modelFamily?: ModelFamily | null, sdkPackage?: string | null, isAvailable: boolean, isAdminEnabled: boolean, isDeprecated?: boolean | null, isRecommended?: boolean | null, contextWindowTokens?: number | null, maxOutputTokens?: number | null, inputCostPerMillionTokens?: number | null, outputCostPerMillionTokens?: number | null, providerName?: string | null, providerLabel?: string | null, name?: string | null, dataResidency?: string | null }> } }; export type GetAdminAiUsageByWorkspaceQueryVariables = Exact<{ periodStart?: InputMaybe; @@ -8589,7 +8589,7 @@ export type CheckCustomDomainValidRecordsMutation = { __typename?: 'Mutation', c export type GetAiSystemPromptPreviewQueryVariables = Exact<{ [key: string]: never; }>; -export type GetAiSystemPromptPreviewQuery = { __typename?: 'Query', getAISystemPromptPreview: { __typename?: 'AISystemPromptPreview', estimatedTokenCount: number, sections: Array<{ __typename?: 'AISystemPromptSection', title: string, content: string, estimatedTokenCount: number }> } }; +export type GetAiSystemPromptPreviewQuery = { __typename?: 'Query', getAiSystemPromptPreview: { __typename?: 'AiSystemPromptPreview', estimatedTokenCount: number, sections: Array<{ __typename?: 'AiSystemPromptSection', title: string, content: string, estimatedTokenCount: number }> } }; export type GetPublicWorkspaceDataByIdQueryVariables = Exact<{ id: Scalars['UUID']; @@ -8670,7 +8670,7 @@ export const SendChatMessageDocument = {"kind":"Document","definitions":[{"kind" export const StopAgentChatStreamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"StopAgentChatStream"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stopAgentChatStream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}]}]}}]} as unknown as DocumentNode; export const UpdateOneAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOneAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateAgentInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOneAgent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"prompt"}},{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"responseFormat"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationInputs"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode; export const UpdateSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSkill"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateSkillInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSkill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SkillFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SkillFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Skill"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode; -export const UploadAiChatFileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"uploadAIChatFile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"file"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Upload"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"uploadAIChatFile"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"file"},"value":{"kind":"Variable","name":{"kind":"Name","value":"file"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; +export const UploadAiChatFileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"uploadAiChatFile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"file"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Upload"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"uploadAiChatFile"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"file"},"value":{"kind":"Variable","name":{"kind":"Name","value":"file"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const FindManyAgentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"prompt"}},{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"responseFormat"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationInputs"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode; export const FindManySkillsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManySkills"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"skills"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SkillFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SkillFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Skill"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode; export const FindOneAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findOneAgent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"prompt"}},{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"responseFormat"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationInputs"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode; @@ -8939,6 +8939,6 @@ export const DeleteCurrentWorkspaceDocument = {"kind":"Document","definitions":[ export const UpdateWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateWorkspaceInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}}]} as unknown as DocumentNode; export const UploadWorkspaceLogoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UploadWorkspaceLogo"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"file"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Upload"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"uploadWorkspaceLogo"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"file"},"value":{"kind":"Variable","name":{"kind":"Name","value":"file"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const CheckCustomDomainValidRecordsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CheckCustomDomainValidRecords"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkCustomDomainValidRecords"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"records"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"validationType"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetAiSystemPromptPreviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAISystemPromptPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getAISystemPromptPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sections"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTokenCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTokenCount"}}]}}]}}]} as unknown as DocumentNode; +export const GetAiSystemPromptPreviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAiSystemPromptPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getAiSystemPromptPreview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sections"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTokenCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTokenCount"}}]}}]}}]} as unknown as DocumentNode; export const GetPublicWorkspaceDataByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPublicWorkspaceDataById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPublicWorkspaceDataById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}}]}}]} as unknown as DocumentNode; export const GetWorkspaceFromInviteHashDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaceFromInviteHash"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inviteHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findWorkspaceFromInviteHash"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inviteHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inviteHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/twenty-front/src/modules/ai/components/AIChatErrorRenderer.tsx b/packages/twenty-front/src/modules/ai/components/AIChatErrorRenderer.tsx deleted file mode 100644 index b5ead539a9..0000000000 --- a/packages/twenty-front/src/modules/ai/components/AIChatErrorRenderer.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { AIChatApiKeyNotConfiguredMessage } from '@/ai/components/AIChatApiKeyNotConfiguredMessage'; -import { AIChatCreditsExhaustedMessage } from '@/ai/components/AIChatCreditsExhaustedMessage'; -import { AIChatErrorMessage } from '@/ai/components/AIChatErrorMessage'; -import { type AIChatError } from '@/ai/types/AIChatError'; -import { AIChatErrorCode } from '@/ai/utils/aiChatErrorCode'; -import { isGraphqlErrorOfType } from '~/utils/is-graphql-error-of-type.util'; - -type AIChatErrorRendererProps = { - error: AIChatError; -}; - -export const AIChatErrorRenderer = ({ error }: AIChatErrorRendererProps) => { - if (isGraphqlErrorOfType(error, AIChatErrorCode.BILLING_CREDITS_EXHAUSTED)) { - return ; - } - - if (isGraphqlErrorOfType(error, AIChatErrorCode.API_KEY_NOT_CONFIGURED)) { - return ; - } - - return ; -}; diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatMessagesFetchEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatMessagesFetchEffect.tsx index 65591bdc04..6671fa5c1e 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatMessagesFetchEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatMessagesFetchEffect.tsx @@ -10,7 +10,7 @@ import { AGENT_CHAT_NEW_THREAD_DRAFT_KEY } from '@/ai/states/agentChatDraftsByTh import { agentChatFetchedMessagesComponentFamilyState } from '@/ai/states/agentChatFetchedMessagesComponentFamilyState'; import { agentChatMessagesLoadingState } from '@/ai/states/agentChatMessagesLoadingState'; import { agentChatQueuedMessagesComponentFamilyState } from '@/ai/states/agentChatQueuedMessagesComponentFamilyState'; -import { currentAIChatThreadState } from '@/ai/states/currentAIChatThreadState'; +import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState'; import { skipMessagesSkeletonUntilLoadedState } from '@/ai/states/skipMessagesSkeletonUntilLoadedState'; import { mapDBMessagesToUIMessages } from '@/ai/utils/mapDBMessagesToUIMessages'; import { useQueryWithCallbacks } from '@/apollo/hooks/useQueryWithCallbacks'; @@ -26,13 +26,13 @@ import { export const AgentChatMessagesFetchEffect = () => { const store = useStore(); - const currentAIChatThread = useAtomStateValue(currentAIChatThreadState); + const currentAiChatThread = useAtomStateValue(currentAiChatThreadState); const isNewThread = useMemo( () => - currentAIChatThread === null || - currentAIChatThread === AGENT_CHAT_NEW_THREAD_DRAFT_KEY, - [currentAIChatThread], + currentAiChatThread === null || + currentAiChatThread === AGENT_CHAT_NEW_THREAD_DRAFT_KEY, + [currentAiChatThread], ); const setAgentChatMessagesLoading = useSetAtomState( @@ -45,12 +45,12 @@ export const AgentChatMessagesFetchEffect = () => { const setAgentChatFetchedMessages = useSetAtomComponentFamilyState( agentChatFetchedMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const setAgentChatQueuedMessages = useSetAtomComponentFamilyState( agentChatQueuedMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const handleEventCallbackFamilyCallback = @@ -84,7 +84,7 @@ export const AgentChatMessagesFetchEffect = () => { return; } - const threadId = store.get(currentAIChatThreadState.atom); + const threadId = store.get(currentAiChatThreadState.atom); if (!isDefined(threadId)) { return; @@ -135,8 +135,8 @@ export const AgentChatMessagesFetchEffect = () => { const { refetch: refetchAgentChatMessages } = useQueryWithCallbacks( GetChatMessagesDocument, { - variables: { threadId: currentAIChatThread ?? '' }, - skip: !isDefined(currentAIChatThread) || isNewThread, + variables: { threadId: currentAiChatThread ?? '' }, + skip: !isDefined(currentAiChatThread) || isNewThread, onFirstLoad: handleFirstLoad, onDataLoaded: handleDataLoaded, onLoadingChange: handleLoadingChange, diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatScrollToBottomOnDisplayedThreadChangeLayoutEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatScrollToBottomOnDisplayedThreadChangeLayoutEffect.tsx index ce9d288b94..2d70d2dbb5 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatScrollToBottomOnDisplayedThreadChangeLayoutEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatScrollToBottomOnDisplayedThreadChangeLayoutEffect.tsx @@ -1,6 +1,6 @@ import { AI_CHAT_SCROLL_WRAPPER_ID } from '@/ai/constants/AiChatScrollWrapperId'; import { agentChatIsInitialScrollPendingOnThreadChangeState } from '@/ai/states/agentChatIsInitialScrollPendingOnThreadChangeState'; -import { scrollAIChatToBottom } from '@/ai/utils/scrollAIChatToBottom'; +import { scrollAiChatToBottom } from '@/ai/utils/scrollAiChatToBottom'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState'; import { useEffect } from 'react'; @@ -37,10 +37,10 @@ export const AgentChatScrollToBottomOnDisplayedThreadChangeLayoutEffect = clearTimeout(settleTimeoutId); } - scrollAIChatToBottom(); + scrollAiChatToBottom(); settleTimeoutId = setTimeout(() => { - scrollAIChatToBottom(); + scrollAiChatToBottom(); setAgentChatIsInitialScrollPendingOnThreadChange(false); mutationObserver.disconnect(); }, SCROLL_SETTLE_DELAY_MS); diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatStreamSubscriptionEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatStreamSubscriptionEffect.tsx index dc5f3d8b8c..aecb63d8cd 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatStreamSubscriptionEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatStreamSubscriptionEffect.tsx @@ -15,7 +15,7 @@ import { agentChatIsStreamingComponentFamilyState } from '@/ai/states/agentChatI import { agentChatMessagesComponentFamilyState } from '@/ai/states/agentChatMessagesComponentFamilyState'; import { agentChatMessagesLoadingState } from '@/ai/states/agentChatMessagesLoadingState'; import { agentChatThreadsLoadingState } from '@/ai/states/agentChatThreadsLoadingState'; -import { currentAIChatThreadState } from '@/ai/states/currentAIChatThreadState'; +import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState'; import { useListenToBrowserEvent } from '@/browser-event/hooks/useListenToBrowserEvent'; import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; @@ -23,7 +23,7 @@ import { useSetAtomComponentFamilyState } from '@/ui/utilities/state/jotai/hooks import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState'; export const AgentChatStreamSubscriptionEffect = () => { - const currentAIChatThread = useAtomStateValue(currentAIChatThreadState); + const currentAiChatThread = useAtomStateValue(currentAiChatThreadState); const { createChatThread } = useCreateAgentChatThread(); @@ -41,25 +41,25 @@ export const AgentChatStreamSubscriptionEffect = () => { useAgentChat(ensureThreadIdForSend); const subscriptionThreadId = - currentAIChatThread !== null && isValidUuid(currentAIChatThread) - ? currentAIChatThread + currentAiChatThread !== null && isValidUuid(currentAiChatThread) + ? currentAiChatThread : null; useAgentChatSubscription(subscriptionThreadId); const agentChatFetchedMessages = useAtomComponentFamilyStateValue( agentChatFetchedMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const setAgentChatMessages = useSetAtomComponentFamilyState( agentChatMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const agentChatIsStreaming = useAtomComponentFamilyStateValue( agentChatIsStreamingComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const agentChatDisplayedThread = useAtomStateValue( @@ -81,17 +81,17 @@ export const AgentChatStreamSubscriptionEffect = () => { setAgentChatMessages(agentChatFetchedMessages); - if (currentAIChatThread !== agentChatDisplayedThread) { + if (currentAiChatThread !== agentChatDisplayedThread) { if (agentChatFetchedMessages.length > 0) { setAgentChatIsInitialScrollPendingOnThreadChange(true); } - setAgentChatDisplayedThread(currentAIChatThread); + setAgentChatDisplayedThread(currentAiChatThread); } }, [ agentChatFetchedMessages, agentChatIsStreaming, setAgentChatMessages, - currentAIChatThread, + currentAiChatThread, agentChatDisplayedThread, setAgentChatDisplayedThread, setAgentChatIsInitialScrollPendingOnThreadChange, diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatStreamingAutoScrollEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatStreamingAutoScrollEffect.tsx index 54538b154c..196937ebf9 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatStreamingAutoScrollEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatStreamingAutoScrollEffect.tsx @@ -1,17 +1,17 @@ import { agentChatIsScrolledToBottomSelector } from '@/ai/states/agentChatIsScrolledToBottomSelector'; import { agentChatMessagesComponentFamilyState } from '@/ai/states/agentChatMessagesComponentFamilyState'; -import { currentAIChatThreadState } from '@/ai/states/currentAIChatThreadState'; -import { scrollAIChatToBottom } from '@/ai/utils/scrollAIChatToBottom'; +import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState'; +import { scrollAiChatToBottom } from '@/ai/utils/scrollAiChatToBottom'; import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { useEffect } from 'react'; export const AgentChatStreamingAutoScrollEffect = () => { - const currentAIChatThread = useAtomStateValue(currentAIChatThreadState); + const currentAiChatThread = useAtomStateValue(currentAiChatThreadState); const agentChatMessages = useAtomComponentFamilyStateValue( agentChatMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const agentChatIsScrolledToBottom = useAtomStateValue( @@ -24,7 +24,7 @@ export const AgentChatStreamingAutoScrollEffect = () => { } if (agentChatIsScrolledToBottom) { - scrollAIChatToBottom(); + scrollAiChatToBottom(); } }, [agentChatMessages, agentChatIsScrolledToBottom]); diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatStreamingPartsDiffSyncEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatStreamingPartsDiffSyncEffect.tsx index 7761ab11ec..32ae92f24a 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatStreamingPartsDiffSyncEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatStreamingPartsDiffSyncEffect.tsx @@ -1,18 +1,18 @@ import { useUpdateStreamingPartsWithDiff } from '@/ai/hooks/useUpdateStreamingPartsWithDiff'; import { agentChatLastDiffSyncedThreadState } from '@/ai/states/agentChatLastDiffSyncedThreadState'; import { agentChatMessagesComponentFamilyState } from '@/ai/states/agentChatMessagesComponentFamilyState'; -import { currentAIChatThreadState } from '@/ai/states/currentAIChatThreadState'; +import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState'; import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState'; import { useEffect } from 'react'; export const AgentChatStreamingPartsDiffSyncEffect = () => { - const currentAIChatThread = useAtomStateValue(currentAIChatThreadState); + const currentAiChatThread = useAtomStateValue(currentAiChatThreadState); const agentChatMessages = useAtomComponentFamilyStateValue( agentChatMessagesComponentFamilyState, - { threadId: currentAIChatThread }, + { threadId: currentAiChatThread }, ); const { updateStreamingPartsWithDiff } = useUpdateStreamingPartsWithDiff(); @@ -27,11 +27,11 @@ export const AgentChatStreamingPartsDiffSyncEffect = () => { } updateStreamingPartsWithDiff(agentChatMessages); - setAgentChatLastDiffSyncedThread(currentAIChatThread); + setAgentChatLastDiffSyncedThread(currentAiChatThread); }, [ agentChatMessages, updateStreamingPartsWithDiff, - currentAIChatThread, + currentAiChatThread, setAgentChatLastDiffSyncedThread, ]); diff --git a/packages/twenty-front/src/modules/ai/components/AgentChatThreadInitializationEffect.tsx b/packages/twenty-front/src/modules/ai/components/AgentChatThreadInitializationEffect.tsx index 4bbda19c93..50e601032f 100644 --- a/packages/twenty-front/src/modules/ai/components/AgentChatThreadInitializationEffect.tsx +++ b/packages/twenty-front/src/modules/ai/components/AgentChatThreadInitializationEffect.tsx @@ -10,8 +10,8 @@ import { agentChatInputState } from '@/ai/states/agentChatInputState'; import { agentChatThreadsLoadingState } from '@/ai/states/agentChatThreadsLoadingState'; import { agentChatThreadsSelector } from '@/ai/states/agentChatThreadsSelector'; import { agentChatUsageComponentFamilyState } from '@/ai/states/agentChatUsageComponentFamilyState'; -import { currentAIChatThreadState } from '@/ai/states/currentAIChatThreadState'; -import { currentAIChatThreadTitleComponentFamilyState } from '@/ai/states/currentAIChatThreadTitleComponentFamilyState'; +import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState'; +import { currentAiChatThreadTitleComponentFamilyState } from '@/ai/states/currentAiChatThreadTitleComponentFamilyState'; import { hasInitializedAgentChatThreadsState } from '@/ai/states/hasInitializedAgentChatThreadsState'; import { hasTriggeredCreateForDraftState } from '@/ai/states/hasTriggeredCreateForDraftState'; import { useUpdateMetadataStoreDraft } from '@/metadata-store/hooks/useUpdateMetadataStoreDraft'; @@ -35,14 +35,14 @@ export const AgentChatThreadInitializationEffect = () => { PermissionFlagType.AI_SETTINGS, ); - const currentAIChatThread = useAtomStateValue(currentAIChatThreadState); - const setCurrentAIChatThread = useSetAtomState(currentAIChatThreadState); + const currentAiChatThread = useAtomStateValue(currentAiChatThreadState); + const setCurrentAiChatThread = useSetAtomState(currentAiChatThreadState); const setAgentChatInput = useSetAtomState(agentChatInputState); const setAgentChatThreadsLoading = useSetAtomState( agentChatThreadsLoadingState, ); const threadTitleFamilyCallback = useAtomComponentFamilyStateCallbackState( - currentAIChatThreadTitleComponentFamilyState, + currentAiChatThreadTitleComponentFamilyState, ); const agentChatUsageFamilyCallback = useAtomComponentFamilyStateCallbackState( agentChatUsageComponentFamilyState, @@ -93,7 +93,7 @@ export const AgentChatThreadInitializationEffect = () => { useEffect(() => { if ( hasInitializedAgentChatThreads || - (currentAIChatThread !== null && isValidUuid(currentAIChatThread)) + (currentAiChatThread !== null && isValidUuid(currentAiChatThread)) ) { return; } @@ -114,7 +114,7 @@ export const AgentChatThreadInitializationEffect = () => { const draftForThread = store.get(agentChatDraftsByThreadIdState.atom)[firstThread.id] ?? ''; - setCurrentAIChatThread(firstThread.id); + setCurrentAiChatThread(firstThread.id); setAgentChatInput(draftForThread); const firstThreadFamilyKey = { threadId: firstThread.id }; @@ -144,7 +144,7 @@ export const AgentChatThreadInitializationEffect = () => { ); } else { store.set(hasTriggeredCreateForDraftState.atom, false); - setCurrentAIChatThread(AGENT_CHAT_NEW_THREAD_DRAFT_KEY); + setCurrentAiChatThread(AGENT_CHAT_NEW_THREAD_DRAFT_KEY); setAgentChatInput( store.get(agentChatDraftsByThreadIdState.atom)[ AGENT_CHAT_NEW_THREAD_DRAFT_KEY @@ -153,12 +153,12 @@ export const AgentChatThreadInitializationEffect = () => { } }, [ agentChatThreads, - currentAIChatThread, + currentAiChatThread, hasAiSettingsPermission, hasInitializedAgentChatThreads, setHasInitializedAgentChatThreads, storeEntry.status, - setCurrentAIChatThread, + setCurrentAiChatThread, setAgentChatInput, store, threadTitleFamilyCallback, diff --git a/packages/twenty-front/src/modules/ai/components/AIChatApiKeyNotConfiguredMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx similarity index 80% rename from packages/twenty-front/src/modules/ai/components/AIChatApiKeyNotConfiguredMessage.tsx rename to packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx index df26fc7954..3c32900ad4 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatApiKeyNotConfiguredMessage.tsx +++ b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx @@ -1,17 +1,17 @@ -import { AIChatBanner } from '@/ai/components/AIChatBanner'; +import { AiChatBanner } from '@/ai/components/AiChatBanner'; import { t } from '@lingui/core/macro'; import { IconExternalLink } from 'twenty-ui/display'; const DOCS_URL = 'https://twenty.com/developers/section/self-hosting/self-hosting-var#ai-features'; -export const AIChatApiKeyNotConfiguredMessage = () => { +export const AiChatApiKeyNotConfiguredMessage = () => { const handleDocsClick = () => { window.open(DOCS_URL, '_blank', 'noopener,noreferrer'); }; return ( - ; case 'data-compaction': - return ; + return ; case 'data-code-execution': return ( ` +const StyledBanner = styled.div<{ variant: AiChatBannerVariant }>` align-items: center; background-color: ${({ variant }) => variant === 'warning' @@ -25,7 +25,7 @@ const StyledBanner = styled.div<{ variant: AIChatBannerVariant }>` width: 100%; `; -const StyledIconContainer = styled.div<{ variant: AIChatBannerVariant }>` +const StyledIconContainer = styled.div<{ variant: AiChatBannerVariant }>` align-items: center; color: ${({ variant }) => variant === 'warning' @@ -38,7 +38,7 @@ const StyledIconContainer = styled.div<{ variant: AIChatBannerVariant }>` width: 16px; `; -const StyledMessage = styled.p<{ variant: AIChatBannerVariant }>` +const StyledMessage = styled.p<{ variant: AiChatBannerVariant }>` color: ${({ variant }) => variant === 'warning' ? themeCssVariables.color.orange @@ -53,9 +53,9 @@ const StyledMessage = styled.p<{ variant: AIChatBannerVariant }>` min-width: 0; `; -export type AIChatBannerProps = { +export type AiChatBannerProps = { message: string; - variant?: AIChatBannerVariant; + variant?: AiChatBannerVariant; tooltipMessage?: string; buttonTitle?: string; buttonIcon?: IconComponent; @@ -64,7 +64,7 @@ export type AIChatBannerProps = { isButtonLoading?: boolean; }; -export const AIChatBanner = ({ +export const AiChatBanner = ({ message, variant = 'default', tooltipMessage, @@ -73,7 +73,7 @@ export const AIChatBanner = ({ buttonOnClick, isButtonDisabled = false, isButtonLoading = false, -}: AIChatBannerProps) => { +}: AiChatBannerProps) => { const tooltipId = 'ai-chat-banner-tooltip'; return ( diff --git a/packages/twenty-front/src/modules/ai/components/AIChatCompactionIndicator.tsx b/packages/twenty-front/src/modules/ai/components/AiChatCompactionIndicator.tsx similarity index 94% rename from packages/twenty-front/src/modules/ai/components/AIChatCompactionIndicator.tsx rename to packages/twenty-front/src/modules/ai/components/AiChatCompactionIndicator.tsx index af900a4bc2..1d6b159ba1 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatCompactionIndicator.tsx +++ b/packages/twenty-front/src/modules/ai/components/AiChatCompactionIndicator.tsx @@ -16,7 +16,7 @@ const StyledIconTextContainer = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -export const AIChatCompactionIndicator = () => { +export const AiChatCompactionIndicator = () => { const { theme } = useContext(ThemeContext); return ( diff --git a/packages/twenty-front/src/modules/ai/components/AIChatCreditsExhaustedMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatCreditsExhaustedMessage.tsx similarity index 91% rename from packages/twenty-front/src/modules/ai/components/AIChatCreditsExhaustedMessage.tsx rename to packages/twenty-front/src/modules/ai/components/AiChatCreditsExhaustedMessage.tsx index c37e771fc2..4258c03e54 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatCreditsExhaustedMessage.tsx +++ b/packages/twenty-front/src/modules/ai/components/AiChatCreditsExhaustedMessage.tsx @@ -1,4 +1,4 @@ -import { AIChatBanner } from '@/ai/components/AIChatBanner'; +import { AiChatBanner } from '@/ai/components/AiChatBanner'; import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap'; import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus'; import { t } from '@lingui/core/macro'; @@ -10,7 +10,7 @@ import { } from '~/generated-metadata/graphql'; import { useNavigateSettings } from '~/hooks/useNavigateSettings'; -export const AIChatCreditsExhaustedMessage = () => { +export const AiChatCreditsExhaustedMessage = () => { const navigateSettings = useNavigateSettings(); const subscriptionStatus = useSubscriptionStatus(); @@ -32,7 +32,7 @@ export const AIChatCreditsExhaustedMessage = () => { const buttonTitle = isTrialing ? t`Subscribe Now` : t`Upgrade Plan`; return ( - { +export const AiChatEditorSection = () => { const isMobile = useIsMobile(); const { options, pinnedOption } = useAiModelOptions({ variant: 'pinned-default', @@ -123,14 +123,14 @@ export const AIChatEditorSection = () => { ); const { selectedModelId } = useAgentChatModelId(); - const { editor, handleSendAndClear } = useAIChatEditor(); + const { editor, handleSendAndClear } = useAiChatEditor(); return ( <> - - - - + + + + @@ -141,7 +141,7 @@ export const AIChatEditorSection = () => { - +