From fd7387928c00831dd1dfec5dfb46caf31c2a1e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Thu, 2 Apr 2026 10:10:13 +0200 Subject: [PATCH] feat: queue messages + replace AI SDK with GraphQL SSE subscription (#19203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - **Queue messages while streaming**: Messages sent during active AI streaming are queued server-side and auto-flushed when the current stream completes. Frontend renders queued messages optimistically in a dedicated queue UI. - **Drop `@ai-sdk/react` + `resumable-stream`**: Replace the dual HTTP SSE + AI SDK client architecture with a single GraphQL SSE subscription per thread. All events (token chunks, message persistence, queue updates, errors) flow through Redis PubSub → GraphQL subscription. - **Server-driven architecture**: The server decides whether to queue or stream (via `POST /:threadId/message`). The frontend mirrors this decision for optimistic rendering but defers to the server response. - **Reuse AI SDK accumulation logic**: `readUIMessageStream` from the `ai` package handles chunk-to-message accumulation on the frontend, avoiding a custom 780-line accumulator. ## Key files **Backend:** - `agent-chat-event-publisher.service.ts` — publishes events to Redis PubSub - `agent-chat-subscription.resolver.ts` — GraphQL subscription resolver - `stream-agent-chat.job.ts` — publishes chunks via PubSub instead of resumable-stream - `agent-chat.controller.ts` — unified `POST /:threadId/message` endpoint **Frontend:** - `useAgentChatSubscription.ts` — subscribes to `onAgentChatEvent`, bridges to `readUIMessageStream` - `useAgentChat.ts` — send/stop/optimistic rendering (no more AI SDK) - `AgentChatStreamSubscriptionEffect.tsx` — replaces `AgentChatAiSdkStreamEffect.tsx` ## Test plan - [ ] Send message on new thread → optimistic render, streaming response appears - [ ] Send message while streaming → queued instantly (no flash in main thread) - [ ] Queued message auto-flushes after current stream completes - [ ] Remove queued message via queue UI - [ ] Stop streaming mid-response - [ ] Leave chat idle for several minutes → streaming still works after (SSE client recycling) - [ ] Token refresh during session → requests succeed (authenticated fetch) - [ ] Switch threads while streaming → clean subscription handoff Made with [Cursor](https://cursor.com) --------- Co-authored-by: Claude Opus 4.6 --- .../src/metadata/generated/schema.graphql | 25 +- .../src/metadata/generated/schema.ts | 81 ++- .../src/metadata/generated/types.ts | 559 +++++++++++------- packages/twenty-front/package.json | 1 - .../src/generated-metadata/graphql.ts | 97 ++- .../ai/components/AIChatErrorMessage.tsx | 21 +- .../modules/ai/components/AIChatMessage.tsx | 33 +- .../ai/components/AIChatQueuedMessages.tsx | 78 +++ .../src/modules/ai/components/AIChatTab.tsx | 2 + .../AgentChatMessagesFetchEffect.tsx | 48 +- .../components/AgentChatProviderContent.tsx | 4 +- ... => AgentChatStreamSubscriptionEffect.tsx} | 95 +-- .../AgentChatThreadInitializationEffect.tsx | 150 ++--- .../ai/constants/AgentChatInstanceId.ts | 1 + .../ai/constants/AgentChatRetryEventName.ts | 1 - .../mutations/deleteQueuedChatMessage.ts | 7 + .../ai/graphql/mutations/sendChatMessage.ts | 23 + .../graphql/mutations/stopAgentChatStream.ts | 7 + .../ai/graphql/queries/getChatMessages.ts | 5 + .../graphql/subscriptions/OnAgentChatEvent.ts | 10 + .../src/modules/ai/hooks/useAgentChat.ts | 360 ++++------- .../ai/hooks/useAgentChatSubscription.ts | 358 +++++++++++ .../src/modules/ai/hooks/useChatThreads.ts | 97 +-- .../ai/hooks/useCreateAgentChatThread.ts | 28 +- .../ai/hooks/useDeleteQueuedMessage.ts | 28 + .../ai/states/agentChatFirstLiveSeqState.ts | 6 + .../agentChatHandleEventCallbackState.ts | 10 + ...tChatQueuedMessagesComponentFamilyState.ts | 10 + .../ai/states/agentChatStreamWriterState.ts | 9 + .../agentChatSubscriptionDisposeState.ts | 8 + .../ai/states/agentChatThreadsSelector.ts | 14 + .../hasInitializedAgentChatThreadsState.ts | 6 + .../__tests__/normalizeAiSdkError.test.ts | 60 -- .../ai/utils/mapDBMessagesToUIMessages.ts | 1 + .../ai/utils/mapDBPartToUIMessagePart.ts | 4 + ...rgeAgentChatFetchedAndStreamingMessages.ts | 15 - .../modules/ai/utils/normalizeAiSdkError.ts | 43 -- ...seListenToMetadataOperationBrowserEvent.ts | 4 +- .../types/BroadcastEntityName.ts | 15 + .../MetadataOperationBrowserEventDetail.ts | 13 +- .../hooks/useLoadStaleMetadataEntities.ts | 28 +- .../states/metadataStoreState.ts | 3 + .../types/FlatAgentChatThread.ts | 3 + .../types/MetadataEntityTypeMap.ts | 2 + .../utils/mapAllMetadataNameToEntityKey.ts | 1 + ...tchMetadataEventsFromSseToBrowserEvents.ts | 26 +- ...aEventsToMetadataOperationBrowserEvents.ts | 4 +- packages/twenty-server/package.json | 1 - ...75001600000-add-status-to-agent-message.ts | 41 ++ .../dtos/agent-message.dto.ts | 11 +- .../entities/agent-message.entity.ts | 22 +- .../utils/mapDBPartToUIMessagePart.ts | 71 +++ .../utils/mapDBPartsToUIMessageParts.ts | 13 + .../ai/ai-chat/ai-chat.module.ts | 8 +- .../controllers/agent-chat.controller.ts | 183 ------ .../ai/ai-chat/dtos/agent-chat-event.dto.ts | 14 + .../dtos/chat-stream-catchup-chunks.dto.ts | 12 + .../dtos/send-chat-message-result.dto.ts | 13 + .../stream-agent-chat-job-name.constant.ts | 1 + .../jobs/stream-agent-chat-job.types.ts | 20 + .../ai/ai-chat/jobs/stream-agent-chat.job.ts | 149 +++-- .../agent-chat-subscription.resolver.ts | 68 +++ .../ai-chat/resolvers/agent-chat.resolver.ts | 205 ++++++- .../agent-chat-event-publisher.service.ts | 74 +++ .../agent-chat-resumable-stream.service.ts | 104 ---- .../services/agent-chat-streaming.service.ts | 197 +++--- .../ai/ai-chat/services/agent-chat.service.ts | 162 ++++- .../enums/subscription-channel.enum.ts | 1 + .../metadata-event-publisher.ts | 75 +-- .../subscriptions/subscription.service.ts | 41 ++ .../subscriptions/subscriptions.module.ts | 3 + .../types/event-stream-metadata-event.type.ts | 12 + .../types/event-stream-payload.type.ts | 4 +- .../types/workspace-broadcast-event.type.ts | 11 + .../workspace-event-broadcaster.service.ts | 73 +++ packages/twenty-shared/src/ai/index.ts | 1 + .../ai/types/AgentChatSubscriptionEvent.ts | 8 + .../src/ai/types/ExtendedUIMessage.ts | 1 + yarn.lock | 42 -- 79 files changed, 2617 insertions(+), 1428 deletions(-) create mode 100644 packages/twenty-front/src/modules/ai/components/AIChatQueuedMessages.tsx rename packages/twenty-front/src/modules/ai/components/{AgentChatAiSdkStreamEffect.tsx => AgentChatStreamSubscriptionEffect.tsx} (60%) create mode 100644 packages/twenty-front/src/modules/ai/constants/AgentChatInstanceId.ts delete mode 100644 packages/twenty-front/src/modules/ai/constants/AgentChatRetryEventName.ts create mode 100644 packages/twenty-front/src/modules/ai/graphql/mutations/deleteQueuedChatMessage.ts create mode 100644 packages/twenty-front/src/modules/ai/graphql/mutations/sendChatMessage.ts create mode 100644 packages/twenty-front/src/modules/ai/graphql/mutations/stopAgentChatStream.ts create mode 100644 packages/twenty-front/src/modules/ai/graphql/subscriptions/OnAgentChatEvent.ts create mode 100644 packages/twenty-front/src/modules/ai/hooks/useAgentChatSubscription.ts create mode 100644 packages/twenty-front/src/modules/ai/hooks/useDeleteQueuedMessage.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatFirstLiveSeqState.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatHandleEventCallbackState.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatQueuedMessagesComponentFamilyState.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatStreamWriterState.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatSubscriptionDisposeState.ts create mode 100644 packages/twenty-front/src/modules/ai/states/agentChatThreadsSelector.ts create mode 100644 packages/twenty-front/src/modules/ai/states/hasInitializedAgentChatThreadsState.ts delete mode 100644 packages/twenty-front/src/modules/ai/utils/__tests__/normalizeAiSdkError.test.ts delete mode 100644 packages/twenty-front/src/modules/ai/utils/mergeAgentChatFetchedAndStreamingMessages.ts delete mode 100644 packages/twenty-front/src/modules/ai/utils/normalizeAiSdkError.ts create mode 100644 packages/twenty-front/src/modules/browser-event/types/BroadcastEntityName.ts create mode 100644 packages/twenty-front/src/modules/metadata-store/types/FlatAgentChatThread.ts create mode 100644 packages/twenty-server/src/database/typeorm/core/migrations/common/1775001600000-add-status-to-agent-message.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/utils/mapDBPartToUIMessagePart.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/utils/mapDBPartsToUIMessageParts.ts delete mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/controllers/agent-chat.controller.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/dtos/agent-chat-event.dto.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/dtos/chat-stream-catchup-chunks.dto.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/dtos/send-chat-message-result.dto.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/jobs/stream-agent-chat-job-name.constant.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/jobs/stream-agent-chat-job.types.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/resolvers/agent-chat-subscription.resolver.ts create mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat-event-publisher.service.ts delete mode 100644 packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat-resumable-stream.service.ts create mode 100644 packages/twenty-server/src/engine/subscriptions/types/event-stream-metadata-event.type.ts create mode 100644 packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/types/workspace-broadcast-event.type.ts create mode 100644 packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service.ts create mode 100644 packages/twenty-shared/src/ai/types/AgentChatSubscriptionEvent.ts diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql index c4670bb9915..b3a49b4beb0 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql @@ -2787,10 +2787,12 @@ type AgentChatThread { type AgentMessage { id: UUID! threadId: UUID! - turnId: UUID! + turnId: UUID agentId: UUID role: String! + status: String! parts: [AgentMessagePart!]! + processedAt: DateTime createdAt: DateTime! } @@ -2805,6 +2807,22 @@ type AISystemPromptPreview { estimatedTokenCount: Int! } +type ChatStreamCatchupChunks { + chunks: [JSON!]! + maxSeq: Int! +} + +type SendChatMessageResult { + messageId: String! + queued: Boolean! + streamId: String +} + +type AgentChatEvent { + threadId: String! + event: JSON! +} + type AgentChatThreadEdge { """The node containing the AgentChatThread""" node: AgentChatThread! @@ -3152,6 +3170,7 @@ type Query { minimalMetadata: MinimalMetadata! chatThread(id: UUID!): AgentChatThread! chatMessages(threadId: UUID!): [AgentMessage!]! + chatStreamCatchupChunks(threadId: UUID!): ChatStreamCatchupChunks! getAISystemPromptPreview: AISystemPromptPreview! skills: [Skill!]! skill(id: UUID!): Skill @@ -3452,6 +3471,9 @@ type Mutation { updateWebhook(input: UpdateWebhookInput!): Webhook! deleteWebhook(id: UUID!): Webhook! createChatThread: AgentChatThread! + sendChatMessage(threadId: UUID!, text: String!, messageId: UUID!, browsingContext: JSON, modelId: String): SendChatMessageResult! + stopAgentChatStream(threadId: UUID!): Boolean! + deleteQueuedChatMessage(messageId: UUID!): Boolean! createSkill(input: CreateSkillInput!): Skill! updateSkill(input: UpdateSkillInput!): Skill! deleteSkill(id: UUID!): Skill! @@ -4541,6 +4563,7 @@ enum FileFolder { type Subscription { onEventSubscription(eventStreamId: String!): EventSubscription logicFunctionLogs(input: LogicFunctionLogsInput!): LogicFunctionLogs! + onAgentChatEvent(threadId: UUID!): AgentChatEvent! } input LogicFunctionLogsInput { diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts index 2fec5003e03..c1f4731c2d9 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts @@ -2448,10 +2448,12 @@ export interface AgentChatThread { export interface AgentMessage { id: Scalars['UUID'] threadId: Scalars['UUID'] - turnId: Scalars['UUID'] + turnId?: Scalars['UUID'] agentId?: Scalars['UUID'] role: Scalars['String'] + status: Scalars['String'] parts: AgentMessagePart[] + processedAt?: Scalars['DateTime'] createdAt: Scalars['DateTime'] __typename: 'AgentMessage' } @@ -2469,6 +2471,25 @@ export interface AISystemPromptPreview { __typename: 'AISystemPromptPreview' } +export interface ChatStreamCatchupChunks { + chunks: Scalars['JSON'][] + maxSeq: Scalars['Int'] + __typename: 'ChatStreamCatchupChunks' +} + +export interface SendChatMessageResult { + messageId: Scalars['String'] + queued: Scalars['Boolean'] + streamId?: Scalars['String'] + __typename: 'SendChatMessageResult' +} + +export interface AgentChatEvent { + threadId: Scalars['String'] + event: Scalars['JSON'] + __typename: 'AgentChatEvent' +} + export interface AgentChatThreadEdge { /** The node containing the AgentChatThread */ node: AgentChatThread @@ -2713,6 +2734,7 @@ export interface Query { minimalMetadata: MinimalMetadata chatThread: AgentChatThread chatMessages: AgentMessage[] + chatStreamCatchupChunks: ChatStreamCatchupChunks getAISystemPromptPreview: AISystemPromptPreview skills: Skill[] skill?: Skill @@ -2899,6 +2921,9 @@ export interface Mutation { updateWebhook: Webhook deleteWebhook: Webhook createChatThread: AgentChatThread + sendChatMessage: SendChatMessageResult + stopAgentChatStream: Scalars['Boolean'] + deleteQueuedChatMessage: Scalars['Boolean'] createSkill: Skill updateSkill: Skill deleteSkill: Skill @@ -3001,6 +3026,7 @@ export type FileFolder = 'ProfilePicture' | 'WorkspaceLogo' | 'Attachment' | 'Pe export interface Subscription { onEventSubscription?: EventSubscription logicFunctionLogs: LogicFunctionLogs + onAgentChatEvent: AgentChatEvent __typename: 'Subscription' } @@ -5598,7 +5624,9 @@ export interface AgentMessageGenqlSelection{ turnId?: boolean | number agentId?: boolean | number role?: boolean | number + status?: boolean | number parts?: AgentMessagePartGenqlSelection + processedAt?: boolean | number createdAt?: boolean | number __typename?: boolean | number __scalar?: boolean | number @@ -5619,6 +5647,28 @@ export interface AISystemPromptPreviewGenqlSelection{ __scalar?: boolean | number } +export interface ChatStreamCatchupChunksGenqlSelection{ + chunks?: boolean | number + maxSeq?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface SendChatMessageResultGenqlSelection{ + messageId?: boolean | number + queued?: boolean | number + streamId?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface AgentChatEventGenqlSelection{ + threadId?: boolean | number + event?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + export interface AgentChatThreadEdgeGenqlSelection{ /** The node containing the AgentChatThread */ node?: AgentChatThreadGenqlSelection @@ -5868,6 +5918,7 @@ export interface QueryGenqlSelection{ minimalMetadata?: MinimalMetadataGenqlSelection chatThread?: (AgentChatThreadGenqlSelection & { __args: {id: Scalars['UUID']} }) chatMessages?: (AgentMessageGenqlSelection & { __args: {threadId: Scalars['UUID']} }) + chatStreamCatchupChunks?: (ChatStreamCatchupChunksGenqlSelection & { __args: {threadId: Scalars['UUID']} }) getAISystemPromptPreview?: AISystemPromptPreviewGenqlSelection skills?: SkillGenqlSelection skill?: (SkillGenqlSelection & { __args: {id: Scalars['UUID']} }) @@ -6079,6 +6130,9 @@ export interface MutationGenqlSelection{ updateWebhook?: (WebhookGenqlSelection & { __args: {input: UpdateWebhookInput} }) deleteWebhook?: (WebhookGenqlSelection & { __args: {id: Scalars['UUID']} }) createChatThread?: AgentChatThreadGenqlSelection + sendChatMessage?: (SendChatMessageResultGenqlSelection & { __args: {threadId: Scalars['UUID'], text: Scalars['String'], messageId: Scalars['UUID'], browsingContext?: (Scalars['JSON'] | null), modelId?: (Scalars['String'] | null)} }) + stopAgentChatStream?: { __args: {threadId: Scalars['UUID']} } + deleteQueuedChatMessage?: { __args: {messageId: Scalars['UUID']} } createSkill?: (SkillGenqlSelection & { __args: {input: CreateSkillInput} }) updateSkill?: (SkillGenqlSelection & { __args: {input: UpdateSkillInput} }) deleteSkill?: (SkillGenqlSelection & { __args: {id: Scalars['UUID']} }) @@ -6496,6 +6550,7 @@ export interface WorkspaceMigrationDeleteActionInput {type: WorkspaceMigrationAc export interface SubscriptionGenqlSelection{ onEventSubscription?: (EventSubscriptionGenqlSelection & { __args: {eventStreamId: Scalars['String']} }) logicFunctionLogs?: (LogicFunctionLogsGenqlSelection & { __args: {input: LogicFunctionLogsInput} }) + onAgentChatEvent?: (AgentChatEventGenqlSelection & { __args: {threadId: Scalars['UUID']} }) __typename?: boolean | number __scalar?: boolean | number } @@ -8423,6 +8478,30 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null + const ChatStreamCatchupChunks_possibleTypes: string[] = ['ChatStreamCatchupChunks'] + export const isChatStreamCatchupChunks = (obj?: { __typename?: any } | null): obj is ChatStreamCatchupChunks => { + if (!obj?.__typename) throw new Error('__typename is missing in "isChatStreamCatchupChunks"') + return ChatStreamCatchupChunks_possibleTypes.includes(obj.__typename) + } + + + + const SendChatMessageResult_possibleTypes: string[] = ['SendChatMessageResult'] + export const isSendChatMessageResult = (obj?: { __typename?: any } | null): obj is SendChatMessageResult => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSendChatMessageResult"') + return SendChatMessageResult_possibleTypes.includes(obj.__typename) + } + + + + const AgentChatEvent_possibleTypes: string[] = ['AgentChatEvent'] + export const isAgentChatEvent = (obj?: { __typename?: any } | null): obj is AgentChatEvent => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAgentChatEvent"') + return AgentChatEvent_possibleTypes.includes(obj.__typename) + } + + + const AgentChatThreadEdge_possibleTypes: string[] = ['AgentChatThreadEdge'] export const isAgentChatThreadEdge = (obj?: { __typename?: any } | null): obj is AgentChatThreadEdge => { if (!obj?.__typename) throw new Error('__typename is missing in "isAgentChatThreadEdge"') diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts index fd95e48b725..2c65955b40a 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/types.ts +++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts @@ -67,30 +67,30 @@ export default { 282, 293, 294, - 319, - 320, - 321, 322, + 323, + 324, 325, - 326, - 327, 328, 329, 330, 331, + 332, 333, - 335, - 343, - 349, - 350, - 351, + 334, + 336, + 338, + 346, + 352, 353, - 360, - 367, - 393, - 477, - 482, - 483 + 354, + 356, + 363, + 370, + 396, + 480, + 485, + 486 ], "types": { "BillingProductDTO": { @@ -5543,9 +5543,15 @@ export default { "role": [ 1 ], + "status": [ + 1 + ], "parts": [ 296 ], + "processedAt": [ + 4 + ], "createdAt": [ 4 ], @@ -5578,6 +5584,42 @@ export default { 1 ] }, + "ChatStreamCatchupChunks": { + "chunks": [ + 15 + ], + "maxSeq": [ + 21 + ], + "__typename": [ + 1 + ] + }, + "SendChatMessageResult": { + "messageId": [ + 1 + ], + "queued": [ + 6 + ], + "streamId": [ + 1 + ], + "__typename": [ + 1 + ] + }, + "AgentChatEvent": { + "threadId": [ + 1 + ], + "event": [ + 15 + ], + "__typename": [ + 1 + ] + }, "AgentChatThreadEdge": { "node": [ 310 @@ -5594,7 +5636,7 @@ export default { 232 ], "edges": [ - 314 + 317 ], "__typename": [ 1 @@ -5631,7 +5673,7 @@ export default { 3 ], "evaluations": [ - 316 + 319 ], "messages": [ 311 @@ -5651,19 +5693,19 @@ export default { 1 ], "syncStatus": [ - 319 + 322 ], "syncStage": [ - 320 + 323 ], "visibility": [ - 321 + 324 ], "isContactAutoCreationEnabled": [ 6 ], "contactAutoCreationPolicy": [ - 322 + 325 ], "isSyncEnabled": [ 6 @@ -5737,22 +5779,22 @@ export default { 3 ], "visibility": [ - 325 + 328 ], "handle": [ 1 ], "type": [ - 326 + 329 ], "isContactAutoCreationEnabled": [ 6 ], "contactAutoCreationPolicy": [ - 327 + 330 ], "messageFolderImportPolicy": [ - 328 + 331 ], "excludeNonProfessionalEmails": [ 6 @@ -5761,7 +5803,7 @@ export default { 6 ], "pendingGroupEmailsAction": [ - 329 + 332 ], "isSyncEnabled": [ 6 @@ -5770,10 +5812,10 @@ export default { 4 ], "syncStatus": [ - 330 + 333 ], "syncStage": [ - 331 + 334 ], "syncStageStartedAt": [ 4 @@ -5824,7 +5866,7 @@ export default { 1 ], "pendingSyncAction": [ - 333 + 336 ], "messageChannelId": [ 3 @@ -5842,7 +5884,7 @@ export default { "MessageFolderPendingSyncAction": {}, "CollectionHash": { "collectionName": [ - 335 + 338 ], "hash": [ 1 @@ -5909,13 +5951,13 @@ export default { }, "MinimalMetadata": { "objectMetadataItems": [ - 336 + 339 ], "views": [ - 337 + 340 ], "collectionHashes": [ - 334 + 337 ], "__typename": [ 1 @@ -6063,7 +6105,7 @@ export default { 2, { "input": [ - 341, + 344, "GetApiKeyInput!" ] } @@ -6167,7 +6209,7 @@ export default { 32, { "input": [ - 342, + 345, "LogicFunctionIdInput!" ] } @@ -6179,7 +6221,7 @@ export default { 15, { "input": [ - 342, + 345, "LogicFunctionIdInput!" ] } @@ -6188,7 +6230,7 @@ export default { 1, { "input": [ - 342, + 345, "LogicFunctionIdInput!" ] } @@ -6289,7 +6331,7 @@ export default { 25, { "input": [ - 344, + 347, "AgentIdInput!" ] } @@ -6349,7 +6391,7 @@ export default { } ], "myMessageFolders": [ - 332, + 335, { "messageChannelId": [ 3 @@ -6357,7 +6399,7 @@ export default { } ], "myMessageChannels": [ - 324, + 327, { "connectedAccountId": [ 3 @@ -6365,13 +6407,13 @@ export default { } ], "myConnectedAccounts": [ - 323 + 326 ], "connectedAccounts": [ - 323 + 326 ], "myCalendarChannels": [ - 318, + 321, { "connectedAccountId": [ 3 @@ -6379,10 +6421,10 @@ export default { } ], "webhooks": [ - 339 + 342 ], "webhook": [ - 339, + 342, { "id": [ 3, @@ -6391,7 +6433,7 @@ export default { } ], "minimalMetadata": [ - 338 + 341 ], "chatThread": [ 310, @@ -6411,6 +6453,15 @@ export default { ] } ], + "chatStreamCatchupChunks": [ + 314, + { + "threadId": [ + 3, + "UUID!" + ] + } + ], "getAISystemPromptPreview": [ 313 ], @@ -6427,24 +6478,24 @@ export default { } ], "chatThreads": [ - 315, + 318, { "paging": [ 39, "CursorPaging!" ], "filter": [ - 345, + 348, "AgentChatThreadFilter!" ], "sorting": [ - 348, + 351, "[AgentChatThreadSort!]!" ] } ], "agentTurns": [ - 317, + 320, { "agentId": [ 3, @@ -6456,7 +6507,7 @@ export default { 308, { "input": [ - 352, + 355, "EventLogQueryInput!" ] } @@ -6465,7 +6516,7 @@ export default { 304, { "input": [ - 356, + 359, "PieChartDataInput!" ] } @@ -6474,7 +6525,7 @@ export default { 302, { "input": [ - 357, + 360, "LineChartDataInput!" ] } @@ -6483,7 +6534,7 @@ export default { 299, { "input": [ - 358, + 361, "BarChartDataInput!" ] } @@ -6745,7 +6796,7 @@ export default { 271, { "input": [ - 359 + 362 ] } ], @@ -6798,7 +6849,7 @@ export default { }, "LogicFunctionIdInput": { "id": [ - 343 + 346 ], "__typename": [ 1 @@ -6815,16 +6866,16 @@ export default { }, "AgentChatThreadFilter": { "and": [ - 345 + 348 ], "or": [ - 345 + 348 ], "id": [ 42 ], "updatedAt": [ - 346 + 349 ], "__typename": [ 1 @@ -6862,10 +6913,10 @@ export default { 4 ], "between": [ - 347 + 350 ], "notBetween": [ - 347 + 350 ], "__typename": [ 1 @@ -6884,13 +6935,13 @@ export default { }, "AgentChatThreadSort": { "field": [ - 349 + 352 ], "direction": [ - 350 + 353 ], "nulls": [ - 351 + 354 ], "__typename": [ 1 @@ -6901,10 +6952,10 @@ export default { "SortNulls": {}, "EventLogQueryInput": { "table": [ - 353 + 356 ], "filters": [ - 354 + 357 ], "first": [ 21 @@ -6925,7 +6976,7 @@ export default { 1 ], "dateRange": [ - 355 + 358 ], "recordId": [ 1 @@ -6992,7 +7043,7 @@ export default { 1 ], "operationTypes": [ - 360 + 363 ], "__typename": [ 1 @@ -7004,7 +7055,7 @@ export default { 6, { "input": [ - 362, + 365, "AddQuerySubscriptionInput!" ] } @@ -7013,7 +7064,7 @@ export default { 6, { "input": [ - 363, + 366, "RemoveQueryFromEventStreamInput!" ] } @@ -7022,7 +7073,7 @@ export default { 145, { "inputs": [ - 364, + 367, "[CreateNavigationMenuItemInput!]!" ] } @@ -7031,7 +7082,7 @@ export default { 145, { "input": [ - 364, + 367, "CreateNavigationMenuItemInput!" ] } @@ -7040,7 +7091,7 @@ export default { 145, { "inputs": [ - 365, + 368, "[UpdateOneNavigationMenuItemInput!]!" ] } @@ -7049,7 +7100,7 @@ export default { 145, { "input": [ - 365, + 368, "UpdateOneNavigationMenuItemInput!" ] } @@ -7076,7 +7127,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ] } @@ -7085,7 +7136,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ] } @@ -7094,7 +7145,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ] } @@ -7103,7 +7154,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ] } @@ -7112,7 +7163,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ], "fieldMetadataId": [ @@ -7125,7 +7176,7 @@ export default { 141, { "file": [ - 367, + 370, "Upload!" ], "fieldMetadataUniversalIdentifier": [ @@ -7138,7 +7189,7 @@ export default { 52, { "input": [ - 368, + 371, "CreateViewFilterGroupInput!" ] } @@ -7151,7 +7202,7 @@ export default { "String!" ], "input": [ - 369, + 372, "UpdateViewFilterGroupInput!" ] } @@ -7178,7 +7229,7 @@ export default { 54, { "input": [ - 370, + 373, "CreateViewFilterInput!" ] } @@ -7187,7 +7238,7 @@ export default { 54, { "input": [ - 371, + 374, "UpdateViewFilterInput!" ] } @@ -7196,7 +7247,7 @@ export default { 54, { "input": [ - 373, + 376, "DeleteViewFilterInput!" ] } @@ -7205,7 +7256,7 @@ export default { 54, { "input": [ - 374, + 377, "DestroyViewFilterInput!" ] } @@ -7214,7 +7265,7 @@ export default { 60, { "input": [ - 375, + 378, "CreateViewInput!" ] } @@ -7227,7 +7278,7 @@ export default { "String!" ], "input": [ - 376, + 379, "UpdateViewInput!" ] } @@ -7254,7 +7305,7 @@ export default { 57, { "input": [ - 377, + 380, "CreateViewSortInput!" ] } @@ -7263,7 +7314,7 @@ export default { 57, { "input": [ - 378, + 381, "UpdateViewSortInput!" ] } @@ -7272,7 +7323,7 @@ export default { 6, { "input": [ - 380, + 383, "DeleteViewSortInput!" ] } @@ -7281,7 +7332,7 @@ export default { 6, { "input": [ - 381, + 384, "DestroyViewSortInput!" ] } @@ -7290,7 +7341,7 @@ export default { 59, { "input": [ - 382, + 385, "UpdateViewFieldGroupInput!" ] } @@ -7299,7 +7350,7 @@ export default { 59, { "input": [ - 384, + 387, "CreateViewFieldGroupInput!" ] } @@ -7308,7 +7359,7 @@ export default { 59, { "inputs": [ - 384, + 387, "[CreateViewFieldGroupInput!]!" ] } @@ -7317,7 +7368,7 @@ export default { 59, { "input": [ - 385, + 388, "DeleteViewFieldGroupInput!" ] } @@ -7326,7 +7377,7 @@ export default { 59, { "input": [ - 386, + 389, "DestroyViewFieldGroupInput!" ] } @@ -7335,7 +7386,7 @@ export default { 60, { "input": [ - 387, + 390, "UpsertFieldsWidgetInput!" ] } @@ -7344,7 +7395,7 @@ export default { 2, { "input": [ - 390, + 393, "CreateApiKeyInput!" ] } @@ -7353,7 +7404,7 @@ export default { 2, { "input": [ - 391, + 394, "UpdateApiKeyInput!" ] } @@ -7362,7 +7413,7 @@ export default { 2, { "input": [ - 392, + 395, "RevokeApiKeyInput!" ] } @@ -7404,7 +7455,7 @@ export default { 115, { "type": [ - 393, + 396, "AnalyticsType!" ], "name": [ @@ -7517,7 +7568,7 @@ export default { 140, { "input": [ - 394, + 397, "CreateApprovedAccessDomainInput!" ] } @@ -7526,7 +7577,7 @@ export default { 6, { "input": [ - 395, + 398, "DeleteApprovedAccessDomainInput!" ] } @@ -7535,7 +7586,7 @@ export default { 140, { "input": [ - 396, + 399, "ValidateApprovedAccessDomainInput!" ] } @@ -7544,7 +7595,7 @@ export default { 112, { "input": [ - 397, + 400, "CreatePageLayoutTabInput!" ] } @@ -7557,7 +7608,7 @@ export default { "String!" ], "input": [ - 398, + 401, "UpdatePageLayoutTabInput!" ] } @@ -7575,7 +7626,7 @@ export default { 113, { "input": [ - 399, + 402, "CreatePageLayoutInput!" ] } @@ -7588,7 +7639,7 @@ export default { "String!" ], "input": [ - 400, + 403, "UpdatePageLayoutInput!" ] } @@ -7610,7 +7661,7 @@ export default { "String!" ], "input": [ - 401, + 404, "UpdatePageLayoutWithTabsInput!" ] } @@ -7619,7 +7670,7 @@ export default { 75, { "input": [ - 405, + 408, "CreatePageLayoutWidgetInput!" ] } @@ -7632,7 +7683,7 @@ export default { "String!" ], "input": [ - 406, + 409, "UpdatePageLayoutWidgetInput!" ] } @@ -7650,7 +7701,7 @@ export default { 32, { "input": [ - 342, + 345, "LogicFunctionIdInput!" ] } @@ -7659,7 +7710,7 @@ export default { 32, { "input": [ - 407, + 410, "CreateLogicFunctionFromSourceInput!" ] } @@ -7668,7 +7719,7 @@ export default { 154, { "input": [ - 408, + 411, "ExecuteOneLogicFunctionInput!" ] } @@ -7677,7 +7728,7 @@ export default { 6, { "input": [ - 409, + 412, "UpdateLogicFunctionFromSourceInput!" ] } @@ -7686,7 +7737,7 @@ export default { 292, { "input": [ - 411, + 414, "CreateCommandMenuItemInput!" ] } @@ -7695,7 +7746,7 @@ export default { 292, { "input": [ - 412, + 415, "UpdateCommandMenuItemInput!" ] } @@ -7713,7 +7764,7 @@ export default { 291, { "input": [ - 413, + 416, "CreateFrontComponentInput!" ] } @@ -7722,7 +7773,7 @@ export default { 291, { "input": [ - 414, + 417, "UpdateFrontComponentInput!" ] } @@ -7740,7 +7791,7 @@ export default { 46, { "input": [ - 416, + 419, "CreateOneObjectInput!" ] } @@ -7749,7 +7800,7 @@ export default { 46, { "input": [ - 418, + 421, "DeleteOneObjectInput!" ] } @@ -7758,7 +7809,7 @@ export default { 46, { "input": [ - 419, + 422, "UpdateOneObjectInput!" ] } @@ -7767,7 +7818,7 @@ export default { 50, { "input": [ - 421, + 424, "UpdateViewFieldInput!" ] } @@ -7776,7 +7827,7 @@ export default { 50, { "input": [ - 423, + 426, "CreateViewFieldInput!" ] } @@ -7785,7 +7836,7 @@ export default { 50, { "inputs": [ - 423, + 426, "[CreateViewFieldInput!]!" ] } @@ -7794,7 +7845,7 @@ export default { 50, { "input": [ - 424, + 427, "DeleteViewFieldInput!" ] } @@ -7803,7 +7854,7 @@ export default { 50, { "input": [ - 425, + 428, "DestroyViewFieldInput!" ] } @@ -7812,7 +7863,7 @@ export default { 25, { "input": [ - 426, + 429, "CreateAgentInput!" ] } @@ -7821,7 +7872,7 @@ export default { 25, { "input": [ - 427, + 430, "UpdateAgentInput!" ] } @@ -7830,7 +7881,7 @@ export default { 25, { "input": [ - 344, + 347, "AgentIdInput!" ] } @@ -7852,7 +7903,7 @@ export default { 29, { "createRoleInput": [ - 428, + 431, "CreateRoleInput!" ] } @@ -7861,7 +7912,7 @@ export default { 29, { "updateRoleInput": [ - 429, + 432, "UpdateRoleInput!" ] } @@ -7879,7 +7930,7 @@ export default { 16, { "upsertObjectPermissionsInput": [ - 431, + 434, "UpsertObjectPermissionsInput!" ] } @@ -7888,7 +7939,7 @@ export default { 27, { "upsertPermissionFlagsInput": [ - 433, + 436, "UpsertPermissionFlagsInput!" ] } @@ -7897,7 +7948,7 @@ export default { 26, { "upsertFieldPermissionsInput": [ - 434, + 437, "UpsertFieldPermissionsInput!" ] } @@ -7906,7 +7957,7 @@ export default { 243, { "input": [ - 436, + 439, "UpsertRowLevelPermissionPredicatesInput!" ] } @@ -7937,7 +7988,7 @@ export default { 34, { "input": [ - 439, + 442, "CreateOneFieldMetadataInput!" ] } @@ -7946,7 +7997,7 @@ export default { 34, { "input": [ - 441, + 444, "UpdateOneFieldMetadataInput!" ] } @@ -7955,7 +8006,7 @@ export default { 34, { "input": [ - 443, + 446, "DeleteOneFieldInput!" ] } @@ -7964,7 +8015,7 @@ export default { 56, { "input": [ - 444, + 447, "CreateViewGroupInput!" ] } @@ -7973,7 +8024,7 @@ export default { 56, { "inputs": [ - 444, + 447, "[CreateViewGroupInput!]!" ] } @@ -7982,7 +8033,7 @@ export default { 56, { "input": [ - 445, + 448, "UpdateViewGroupInput!" ] } @@ -7991,7 +8042,7 @@ export default { 56, { "inputs": [ - 445, + 448, "[UpdateViewGroupInput!]!" ] } @@ -8000,7 +8051,7 @@ export default { 56, { "input": [ - 447, + 450, "DeleteViewGroupInput!" ] } @@ -8009,40 +8060,40 @@ export default { 56, { "input": [ - 448, + 451, "DestroyViewGroupInput!" ] } ], "updateMessageFolder": [ - 332, + 335, { "input": [ - 449, + 452, "UpdateMessageFolderInput!" ] } ], "updateMessageFolders": [ - 332, + 335, { "input": [ - 451, + 454, "UpdateMessageFoldersInput!" ] } ], "updateMessageChannel": [ - 324, + 327, { "input": [ - 452, + 455, "UpdateMessageChannelInput!" ] } ], "deleteConnectedAccount": [ - 323, + 326, { "id": [ 3, @@ -8051,34 +8102,34 @@ export default { } ], "updateCalendarChannel": [ - 318, + 321, { "input": [ - 454, + 457, "UpdateCalendarChannelInput!" ] } ], "createWebhook": [ - 339, + 342, { "input": [ - 456, + 459, "CreateWebhookInput!" ] } ], "updateWebhook": [ - 339, + 342, { "input": [ - 457, + 460, "UpdateWebhookInput!" ] } ], "deleteWebhook": [ - 339, + 342, { "id": [ 3, @@ -8089,11 +8140,52 @@ export default { "createChatThread": [ 310 ], + "sendChatMessage": [ + 315, + { + "threadId": [ + 3, + "UUID!" + ], + "text": [ + 1, + "String!" + ], + "messageId": [ + 3, + "UUID!" + ], + "browsingContext": [ + 15 + ], + "modelId": [ + 1 + ] + } + ], + "stopAgentChatStream": [ + 6, + { + "threadId": [ + 3, + "UUID!" + ] + } + ], + "deleteQueuedChatMessage": [ + 6, + { + "messageId": [ + 3, + "UUID!" + ] + } + ], "createSkill": [ 309, { "input": [ - 459, + 462, "CreateSkillInput!" ] } @@ -8102,7 +8194,7 @@ export default { 309, { "input": [ - 460, + 463, "UpdateSkillInput!" ] } @@ -8135,7 +8227,7 @@ export default { } ], "evaluateAgentTurn": [ - 316, + 319, { "turnId": [ 3, @@ -8144,7 +8236,7 @@ export default { } ], "runEvaluationInput": [ - 317, + 320, { "agentId": [ 3, @@ -8169,7 +8261,7 @@ export default { 256, { "input": [ - 461, + 464, "GetAuthorizationUrlForSSOInput!" ] } @@ -8423,7 +8515,7 @@ export default { 214, { "input": [ - 462, + 465, "CreateApplicationRegistrationInput!" ] } @@ -8432,7 +8524,7 @@ export default { 7, { "input": [ - 463, + 466, "UpdateApplicationRegistrationInput!" ] } @@ -8459,7 +8551,7 @@ export default { 5, { "input": [ - 465, + 468, "CreateApplicationRegistrationVariableInput!" ] } @@ -8468,7 +8560,7 @@ export default { 5, { "input": [ - 466, + 469, "UpdateApplicationRegistrationVariableInput!" ] } @@ -8486,7 +8578,7 @@ export default { 7, { "file": [ - 367, + 370, "Upload!" ], "universalIdentifier": [ @@ -8582,7 +8674,7 @@ export default { 66, { "data": [ - 468, + 471, "ActivateWorkspaceInput!" ] } @@ -8591,7 +8683,7 @@ export default { 66, { "data": [ - 469, + 472, "UpdateWorkspaceInput!" ] } @@ -8606,7 +8698,7 @@ export default { 222, { "input": [ - 470, + 473, "SetupOIDCSsoInput!" ] } @@ -8615,7 +8707,7 @@ export default { 222, { "input": [ - 471, + 474, "SetupSAMLSsoInput!" ] } @@ -8624,7 +8716,7 @@ export default { 218, { "input": [ - 472, + 475, "DeleteSsoInput!" ] } @@ -8633,7 +8725,7 @@ export default { 219, { "input": [ - 473, + 476, "EditSsoInput!" ] } @@ -8672,7 +8764,7 @@ export default { "String!" ], "connectionParameters": [ - 474, + 477, "EmailAccountConnectionParameters!" ], "id": [ @@ -8684,7 +8776,7 @@ export default { 198, { "input": [ - 476, + 479, "UpdateLabPublicFeatureFlagInput!" ] } @@ -8745,7 +8837,7 @@ export default { 6, { "role": [ - 477, + 480, "AiModelRole!" ], "modelId": [ @@ -8931,7 +9023,7 @@ export default { 68, { "input": [ - 478, + 481, "CreateOneAppTokenInput!" ] } @@ -8967,7 +9059,7 @@ export default { 6, { "workspaceMigration": [ - 480, + 483, "WorkspaceMigrationInput!" ] } @@ -9033,7 +9125,7 @@ export default { 275, { "file": [ - 367, + 370, "Upload!" ], "applicationUniversalIdentifier": [ @@ -9041,7 +9133,7 @@ export default { "String!" ], "fileFolder": [ - 483, + 486, "FileFolder!" ], "filePath": [ @@ -9147,7 +9239,7 @@ export default { 3 ], "update": [ - 366 + 369 ], "__typename": [ 1 @@ -9251,7 +9343,7 @@ export default { 3 ], "update": [ - 372 + 375 ], "__typename": [ 1 @@ -9424,7 +9516,7 @@ export default { 3 ], "update": [ - 379 + 382 ], "__typename": [ 1 @@ -9459,7 +9551,7 @@ export default { 3 ], "update": [ - 383 + 386 ], "__typename": [ 1 @@ -9523,10 +9615,10 @@ export default { 3 ], "groups": [ - 388 + 391 ], "fields": [ - 389 + 392 ], "__typename": [ 1 @@ -9546,7 +9638,7 @@ export default { 6 ], "fields": [ - 389 + 392 ], "__typename": [ 1 @@ -9715,7 +9807,7 @@ export default { 3 ], "tabs": [ - 402 + 405 ], "__typename": [ 1 @@ -9738,7 +9830,7 @@ export default { 79 ], "widgets": [ - 403 + 406 ], "__typename": [ 1 @@ -9761,7 +9853,7 @@ export default { 3 ], "gridPosition": [ - 404 + 407 ], "position": [ 15 @@ -9807,7 +9899,7 @@ export default { 3 ], "gridPosition": [ - 404 + 407 ], "position": [ 15 @@ -9830,7 +9922,7 @@ export default { 3 ], "gridPosition": [ - 404 + 407 ], "position": [ 15 @@ -9899,7 +9991,7 @@ export default { 3 ], "update": [ - 410 + 413 ], "__typename": [ 1 @@ -10050,7 +10142,7 @@ export default { 3 ], "update": [ - 415 + 418 ], "__typename": [ 1 @@ -10069,7 +10161,7 @@ export default { }, "CreateOneObjectInput": { "object": [ - 417 + 420 ], "__typename": [ 1 @@ -10129,7 +10221,7 @@ export default { }, "UpdateOneObjectInput": { "update": [ - 420 + 423 ], "id": [ 3 @@ -10187,7 +10279,7 @@ export default { 3 ], "update": [ - 422 + 425 ], "__typename": [ 1 @@ -10377,7 +10469,7 @@ export default { }, "UpdateRoleInput": { "update": [ - 430 + 433 ], "id": [ 3 @@ -10432,7 +10524,7 @@ export default { 3 ], "objectPermissions": [ - 432 + 435 ], "__typename": [ 1 @@ -10474,7 +10566,7 @@ export default { 3 ], "fieldPermissions": [ - 435 + 438 ], "__typename": [ 1 @@ -10505,10 +10597,10 @@ export default { 3 ], "predicates": [ - 437 + 440 ], "predicateGroups": [ - 438 + 441 ], "__typename": [ 1 @@ -10568,7 +10660,7 @@ export default { }, "CreateOneFieldMetadataInput": { "field": [ - 440 + 443 ], "__typename": [ 1 @@ -10641,7 +10733,7 @@ export default { 3 ], "update": [ - 442 + 445 ], "__typename": [ 1 @@ -10733,7 +10825,7 @@ export default { 3 ], "update": [ - 446 + 449 ], "__typename": [ 1 @@ -10777,7 +10869,7 @@ export default { 3 ], "update": [ - 450 + 453 ], "__typename": [ 1 @@ -10796,7 +10888,7 @@ export default { 3 ], "update": [ - 450 + 453 ], "__typename": [ 1 @@ -10807,7 +10899,7 @@ export default { 3 ], "update": [ - 453 + 456 ], "__typename": [ 1 @@ -10815,16 +10907,16 @@ export default { }, "UpdateMessageChannelInputUpdates": { "visibility": [ - 325 + 328 ], "isContactAutoCreationEnabled": [ 6 ], "contactAutoCreationPolicy": [ - 327 + 330 ], "messageFolderImportPolicy": [ - 328 + 331 ], "isSyncEnabled": [ 6 @@ -10844,7 +10936,7 @@ export default { 3 ], "update": [ - 455 + 458 ], "__typename": [ 1 @@ -10852,13 +10944,13 @@ export default { }, "UpdateCalendarChannelInputUpdates": { "visibility": [ - 321 + 324 ], "isContactAutoCreationEnabled": [ 6 ], "contactAutoCreationPolicy": [ - 322 + 325 ], "isSyncEnabled": [ 6 @@ -10892,7 +10984,7 @@ export default { 3 ], "update": [ - 458 + 461 ], "__typename": [ 1 @@ -10997,7 +11089,7 @@ export default { 1 ], "update": [ - 464 + 467 ], "__typename": [ 1 @@ -11045,7 +11137,7 @@ export default { 1 ], "update": [ - 467 + 470 ], "__typename": [ 1 @@ -11205,13 +11297,13 @@ export default { }, "EmailAccountConnectionParameters": { "IMAP": [ - 475 + 478 ], "SMTP": [ - 475 + 478 ], "CALDAV": [ - 475 + 478 ], "__typename": [ 1 @@ -11251,7 +11343,7 @@ export default { "AiModelRole": {}, "CreateOneAppTokenInput": { "appToken": [ - 479 + 482 ], "__typename": [ 1 @@ -11267,7 +11359,7 @@ export default { }, "WorkspaceMigrationInput": { "actions": [ - 481 + 484 ], "__typename": [ 1 @@ -11275,10 +11367,10 @@ export default { }, "WorkspaceMigrationDeleteActionInput": { "type": [ - 482 + 485 ], "metadataName": [ - 335 + 338 ], "universalIdentifier": [ 1 @@ -11303,11 +11395,20 @@ export default { 247, { "input": [ - 485, + 488, "LogicFunctionLogsInput!" ] } ], + "onAgentChatEvent": [ + 316, + { + "threadId": [ + 3, + "UUID!" + ] + } + ], "__typename": [ 1 ] diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.json index f25b727633f..88267b478e2 100644 --- a/packages/twenty-front/package.json +++ b/packages/twenty-front/package.json @@ -29,7 +29,6 @@ "workerDirectory": "public" }, "dependencies": { - "@ai-sdk/react": "3.0.99", "@apollo/client": "^4.0.0", "@blocknote/mantine": "^0.47.1", "@blocknote/react": "^0.47.1", diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index 76d63758ae3..64f8ee53e5b 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -112,6 +112,12 @@ export type Agent = { updatedAt: Scalars['DateTime']; }; +export type AgentChatEvent = { + __typename?: 'AgentChatEvent'; + event: Scalars['JSON']; + threadId: Scalars['String']; +}; + export type AgentChatThread = { __typename?: 'AgentChatThread'; contextWindowTokens?: Maybe; @@ -171,9 +177,11 @@ export type AgentMessage = { createdAt: Scalars['DateTime']; id: Scalars['UUID']; parts: Array; + processedAt?: Maybe; role: Scalars['String']; + status: Scalars['String']; threadId: Scalars['UUID']; - turnId: Scalars['UUID']; + turnId?: Maybe; }; export type AgentMessagePart = { @@ -842,6 +850,12 @@ export type ChannelSyncSuccess = { success: Scalars['Boolean']; }; +export type ChatStreamCatchupChunks = { + __typename?: 'ChatStreamCatchupChunks'; + chunks: Array; + maxSeq: Scalars['Int']; +}; + export type CheckUserExist = { __typename?: 'CheckUserExist'; availableWorkspacesCount: Scalars['Float']; @@ -2534,6 +2548,7 @@ export type Mutation = { deleteOneObject: Object; deleteOneRole: Scalars['String']; deletePublicDomain: Scalars['Boolean']; + deleteQueuedChatMessage: Scalars['Boolean']; deleteSSOIdentityProvider: DeleteSso; deleteSkill: Skill; deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethod; @@ -2593,6 +2608,7 @@ export type Mutation = { runEvaluationInput: AgentTurn; runWorkspaceMigration: Scalars['Boolean']; saveImapSmtpCaldavAccount: ImapSmtpCaldavConnectionSuccess; + sendChatMessage: SendChatMessageResult; sendInvitations: SendInvitations; setAdminAiModelEnabled: Scalars['Boolean']; setAdminAiModelRecommended: Scalars['Boolean']; @@ -2606,6 +2622,7 @@ export type Mutation = { skipBookOnboardingStep: OnboardingStepSuccess; skipSyncEmailOnboardingStep: OnboardingStepSuccess; startChannelSync: ChannelSyncSuccess; + stopAgentChatStream: Scalars['Boolean']; switchBillingPlan: BillingUpdate; switchSubscriptionInterval: BillingUpdate; syncApplication: WorkspaceMigration; @@ -3012,6 +3029,11 @@ export type MutationDeletePublicDomainArgs = { }; +export type MutationDeleteQueuedChatMessageArgs = { + messageId: Scalars['UUID']; +}; + + export type MutationDeleteSsoIdentityProviderArgs = { input: DeleteSsoInput; }; @@ -3294,6 +3316,15 @@ export type MutationSaveImapSmtpCaldavAccountArgs = { }; +export type MutationSendChatMessageArgs = { + browsingContext?: InputMaybe; + messageId: Scalars['UUID']; + modelId?: InputMaybe; + text: Scalars['String']; + threadId: Scalars['UUID']; +}; + + export type MutationSendInvitationsArgs = { emails: Array; roleId?: InputMaybe; @@ -3363,6 +3394,11 @@ export type MutationStartChannelSyncArgs = { }; +export type MutationStopAgentChatStreamArgs = { + threadId: Scalars['UUID']; +}; + + export type MutationSyncApplicationArgs = { manifest: Scalars['JSON']; }; @@ -4155,6 +4191,7 @@ export type Query = { barChartData: BarChartData; billingPortalSession: BillingSession; chatMessages: Array; + chatStreamCatchupChunks: ChatStreamCatchupChunks; chatThread: AgentChatThread; chatThreads: AgentChatThreadConnection; checkUserExists: CheckUserExist; @@ -4292,6 +4329,11 @@ export type QueryChatMessagesArgs = { }; +export type QueryChatStreamCatchupChunksArgs = { + threadId: Scalars['UUID']; +}; + + export type QueryChatThreadArgs = { id: Scalars['UUID']; }; @@ -4901,6 +4943,13 @@ export enum SsoIdentityProviderStatus { Inactive = 'Inactive' } +export type SendChatMessageResult = { + __typename?: 'SendChatMessageResult'; + messageId: Scalars['String']; + queued: Scalars['Boolean']; + streamId?: Maybe; +}; + export type SendInvitations = { __typename?: 'SendInvitations'; errors: Array; @@ -4991,6 +5040,7 @@ export type StandardOverrides = { export type Subscription = { __typename?: 'Subscription'; logicFunctionLogs: LogicFunctionLogs; + onAgentChatEvent: AgentChatEvent; onEventSubscription?: Maybe; }; @@ -5000,6 +5050,11 @@ export type SubscriptionLogicFunctionLogsArgs = { }; +export type SubscriptionOnAgentChatEventArgs = { + threadId: Scalars['UUID']; +}; + + export type SubscriptionOnEventSubscriptionArgs = { eventStreamId: Scalars['String']; }; @@ -6197,6 +6252,13 @@ export type DeleteOneAgentMutationVariables = Exact<{ export type DeleteOneAgentMutation = { __typename?: 'Mutation', deleteOneAgent: { __typename?: 'Agent', id: string, name: string, label: string, description?: string | null, icon?: string | null, prompt: string, modelId: string, responseFormat?: any | null, roleId?: string | null, isCustom: boolean, modelConfiguration?: any | null, evaluationInputs: Array, applicationId?: string | null, createdAt: string, updatedAt: string } }; +export type DeleteQueuedChatMessageMutationVariables = Exact<{ + messageId: Scalars['UUID']; +}>; + + +export type DeleteQueuedChatMessageMutation = { __typename?: 'Mutation', deleteQueuedChatMessage: boolean }; + export type DeleteSkillMutationVariables = Exact<{ id: Scalars['UUID']; }>; @@ -6226,6 +6288,24 @@ export type RunEvaluationInputMutationVariables = Exact<{ export type RunEvaluationInputMutation = { __typename?: 'Mutation', runEvaluationInput: { __typename?: 'AgentTurn', id: string, threadId: string, agentId?: string | null, createdAt: string, evaluations: Array<{ __typename?: 'AgentTurnEvaluation', id: string, score: number, comment?: string | null, createdAt: string }> } }; +export type SendChatMessageMutationVariables = Exact<{ + threadId: Scalars['UUID']; + text: Scalars['String']; + messageId: Scalars['UUID']; + browsingContext?: InputMaybe; + modelId?: InputMaybe; +}>; + + +export type SendChatMessageMutation = { __typename?: 'Mutation', sendChatMessage: { __typename?: 'SendChatMessageResult', messageId: string, queued: boolean, streamId?: string | null } }; + +export type StopAgentChatStreamMutationVariables = Exact<{ + threadId: Scalars['UUID']; +}>; + + +export type StopAgentChatStreamMutation = { __typename?: 'Mutation', stopAgentChatStream: boolean }; + export type UpdateOneAgentMutationVariables = Exact<{ input: UpdateAgentInput; }>; @@ -6283,7 +6363,7 @@ export type GetChatMessagesQueryVariables = Exact<{ }>; -export type GetChatMessagesQuery = { __typename?: 'Query', chatMessages: Array<{ __typename?: 'AgentMessage', id: string, threadId: string, turnId: string, role: string, createdAt: string, parts: Array<{ __typename?: 'AgentMessagePart', id: string, messageId: string, orderIndex: number, type: string, textContent?: string | null, reasoningContent?: string | null, toolName?: string | null, toolCallId?: string | null, toolInput?: any | null, toolOutput?: any | null, state?: string | null, errorMessage?: string | null, errorDetails?: any | null, sourceUrlSourceId?: string | null, sourceUrlUrl?: string | null, sourceUrlTitle?: string | null, sourceDocumentSourceId?: string | null, sourceDocumentMediaType?: string | null, sourceDocumentTitle?: string | null, sourceDocumentFilename?: string | null, fileMediaType?: string | null, fileFilename?: string | null, fileUrl?: string | null, fileId?: string | null, providerMetadata?: any | null, createdAt: string }> }> }; +export type GetChatMessagesQuery = { __typename?: 'Query', chatMessages: Array<{ __typename?: 'AgentMessage', id: string, threadId: string, turnId?: string | null, role: string, status: string, createdAt: string, parts: Array<{ __typename?: 'AgentMessagePart', id: string, messageId: string, orderIndex: number, type: string, textContent?: string | null, reasoningContent?: string | null, toolName?: string | null, toolCallId?: string | null, toolInput?: any | null, toolOutput?: any | null, state?: string | null, errorMessage?: string | null, errorDetails?: any | null, sourceUrlSourceId?: string | null, sourceUrlUrl?: string | null, sourceUrlTitle?: string | null, sourceDocumentSourceId?: string | null, sourceDocumentMediaType?: string | null, sourceDocumentTitle?: string | null, sourceDocumentFilename?: string | null, fileMediaType?: string | null, fileFilename?: string | null, fileUrl?: string | null, fileId?: string | null, providerMetadata?: any | null, createdAt: string }> }>, chatStreamCatchupChunks: { __typename?: 'ChatStreamCatchupChunks', chunks: Array, maxSeq: number } }; export type GetChatThreadsQueryVariables = Exact<{ paging?: InputMaybe; @@ -6304,6 +6384,13 @@ export type GetToolInputSchemaQueryVariables = Exact<{ export type GetToolInputSchemaQuery = { __typename?: 'Query', getToolInputSchema?: any | null }; +export type OnAgentChatEventSubscriptionVariables = Exact<{ + threadId: Scalars['UUID']; +}>; + + +export type OnAgentChatEventSubscription = { __typename?: 'Subscription', onAgentChatEvent: { __typename?: 'AgentChatEvent', threadId: string, event: any } }; + export type TrackAnalyticsMutationVariables = Exact<{ type: AnalyticsType; event?: InputMaybe; @@ -8109,10 +8196,13 @@ export const CreateOneAgentDocument = {"kind":"Document","definitions":[{"kind": export const CreateSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSkill"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateSkillInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSkill"},"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 DeactivateSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeactivateSkill"},"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":"deactivateSkill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"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 DeleteOneAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AgentIdInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneAgent"},"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 DeleteQueuedChatMessageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteQueuedChatMessage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteQueuedChatMessage"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"messageId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}}}]}]}}]} as unknown as DocumentNode; export const DeleteSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSkill"},"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":"deleteSkill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"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 EvaluateAgentTurnDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"EvaluateAgentTurn"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"turnId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evaluateAgentTurn"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"turnId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"turnId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"turnId"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"comment"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode; export const RemoveRoleFromAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RemoveRoleFromAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"removeRoleFromAgent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}}}]}]}}]} as unknown as DocumentNode; export const RunEvaluationInputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RunEvaluationInput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"runEvaluationInput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"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":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"agentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"evaluations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"comment"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode; +export const SendChatMessageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendChatMessage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"text"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"browsingContext"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sendChatMessage"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}},{"kind":"Argument","name":{"kind":"Name","value":"text"},"value":{"kind":"Variable","name":{"kind":"Name","value":"text"}}},{"kind":"Argument","name":{"kind":"Name","value":"messageId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}}},{"kind":"Argument","name":{"kind":"Name","value":"browsingContext"},"value":{"kind":"Variable","name":{"kind":"Name","value":"browsingContext"}}},{"kind":"Argument","name":{"kind":"Name","value":"modelId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"queued"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}}]}}]}}]} as unknown as DocumentNode; +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; @@ -8121,10 +8211,11 @@ export const FindManySkillsDocument = {"kind":"Document","definitions":[{"kind": 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; export const FindOneSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneSkill"},"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":"skill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"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 GetAgentTurnsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentTurns"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agentTurns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"agentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"evaluations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"comment"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"messages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"parts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"textContent"}},{"kind":"Field","name":{"kind":"Name","value":"reasoningContent"}},{"kind":"Field","name":{"kind":"Name","value":"toolName"}},{"kind":"Field","name":{"kind":"Name","value":"toolCallId"}},{"kind":"Field","name":{"kind":"Name","value":"toolInput"}},{"kind":"Field","name":{"kind":"Name","value":"toolOutput"}},{"kind":"Field","name":{"kind":"Name","value":"errorMessage"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"errorDetails"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"fileFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileUrl"}},{"kind":"Field","name":{"kind":"Name","value":"providerMetadata"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetChatMessagesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChatMessages"},"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":"chatMessages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"turnId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"parts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"orderIndex"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"textContent"}},{"kind":"Field","name":{"kind":"Name","value":"reasoningContent"}},{"kind":"Field","name":{"kind":"Name","value":"toolName"}},{"kind":"Field","name":{"kind":"Name","value":"toolCallId"}},{"kind":"Field","name":{"kind":"Name","value":"toolInput"}},{"kind":"Field","name":{"kind":"Name","value":"toolOutput"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"errorMessage"}},{"kind":"Field","name":{"kind":"Name","value":"errorDetails"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"fileFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileUrl"}},{"kind":"Field","name":{"kind":"Name","value":"fileId"}},{"kind":"Field","name":{"kind":"Name","value":"providerMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetChatMessagesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChatMessages"},"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":"chatMessages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"turnId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"parts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"orderIndex"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"textContent"}},{"kind":"Field","name":{"kind":"Name","value":"reasoningContent"}},{"kind":"Field","name":{"kind":"Name","value":"toolName"}},{"kind":"Field","name":{"kind":"Name","value":"toolCallId"}},{"kind":"Field","name":{"kind":"Name","value":"toolInput"}},{"kind":"Field","name":{"kind":"Name","value":"toolOutput"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"errorMessage"}},{"kind":"Field","name":{"kind":"Name","value":"errorDetails"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrlTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentTitle"}},{"kind":"Field","name":{"kind":"Name","value":"sourceDocumentFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileMediaType"}},{"kind":"Field","name":{"kind":"Name","value":"fileFilename"}},{"kind":"Field","name":{"kind":"Name","value":"fileUrl"}},{"kind":"Field","name":{"kind":"Name","value":"fileId"}},{"kind":"Field","name":{"kind":"Name","value":"providerMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"chatStreamCatchupChunks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chunks"}},{"kind":"Field","name":{"kind":"Name","value":"maxSeq"}}]}}]}}]} as unknown as DocumentNode; export const GetChatThreadsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChatThreads"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"paging"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"CursorPaging"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chatThreads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"Variable","name":{"kind":"Name","value":"paging"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"contextWindowTokens"}},{"kind":"Field","name":{"kind":"Name","value":"conversationSize"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputCredits"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputCredits"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetToolIndexDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetToolIndex"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getToolIndex"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"objectName"}}]}}]}}]} as unknown as DocumentNode; export const GetToolInputSchemaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetToolInputSchema"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toolName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getToolInputSchema"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"toolName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toolName"}}}]}]}}]} as unknown as DocumentNode; +export const OnAgentChatEventDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnAgentChatEvent"},"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":"onAgentChatEvent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"event"}}]}}]}}]} as unknown as DocumentNode; export const TrackAnalyticsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TrackAnalytics"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AnalyticsType"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"event"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"properties"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trackAnalytics"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}},{"kind":"Argument","name":{"kind":"Name","value":"event"},"value":{"kind":"Variable","name":{"kind":"Name","value":"event"}}},{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"properties"},"value":{"kind":"Variable","name":{"kind":"Name","value":"properties"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; export const FindManyApplicationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationRegistrationId"}},{"kind":"Field","name":{"kind":"Name","value":"applicationRegistration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"latestAvailableVersion"}},{"kind":"Field","name":{"kind":"Name","value":"sourceType"}}]}}]}}]}}]} as unknown as DocumentNode; export const FindOneApplicationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneApplication"},"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":"findOneApplication"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ApplicationFields"}}]}}]}},{"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"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Object"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"labelIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"imageIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"shortcut"}},{"kind":"Field","name":{"kind":"Name","value":"isLabelSyncedWithName"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"indexMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"indexWhereClause"}},{"kind":"Field","name":{"kind":"Name","value":"indexType"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"indexFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"order"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldsList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"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":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"defaultValue"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"settings"}},{"kind":"Field","name":{"kind":"Name","value":"isLabelSyncedWithName"}},{"kind":"Field","name":{"kind":"Name","value":"morphId"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"relation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"sourceObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sourceFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"morphRelations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"sourceObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sourceFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LogicFunctionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LogicFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"runtime"}},{"kind":"Field","name":{"kind":"Name","value":"timeoutSeconds"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"kind":"Field","name":{"kind":"Name","value":"toolInputSchema"}},{"kind":"Field","name":{"kind":"Name","value":"isTool"}},{"kind":"Field","name":{"kind":"Name","value":"cronTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"databaseEventTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"httpRouteTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ApplicationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Application"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationRegistrationId"}},{"kind":"Field","name":{"kind":"Name","value":"applicationRegistration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"latestAvailableVersion"}},{"kind":"Field","name":{"kind":"Name","value":"sourceType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canBeUninstalled"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleId"}},{"kind":"Field","name":{"kind":"Name","value":"settingsCustomTabFrontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"availablePackages"}},{"kind":"Field","name":{"kind":"Name","value":"applicationVariables"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"isSecret"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"objects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectMetadataFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logicFunctions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LogicFunctionFields"}}]}}]}}]} as unknown as DocumentNode; diff --git a/packages/twenty-front/src/modules/ai/components/AIChatErrorMessage.tsx b/packages/twenty-front/src/modules/ai/components/AIChatErrorMessage.tsx index 5745cebdbc1..484ec547d0e 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatErrorMessage.tsx +++ b/packages/twenty-front/src/modules/ai/components/AIChatErrorMessage.tsx @@ -1,11 +1,6 @@ -import { AGENT_CHAT_RETRY_EVENT_NAME } from '@/ai/constants/AgentChatRetryEventName'; -import { agentChatIsStreamingState } from '@/ai/states/agentChatIsStreamingState'; -import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent'; -import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; -import { IconAlertCircle, IconRefresh } from 'twenty-ui/display'; -import { Button } from 'twenty-ui/input'; +import { IconAlertCircle } from 'twenty-ui/display'; import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; @@ -49,12 +44,6 @@ type AIChatErrorMessageProps = { }; export const AIChatErrorMessage = ({ error }: AIChatErrorMessageProps) => { - const agentChatIsStreaming = useAtomStateValue(agentChatIsStreamingState); - - const handleRetryClick = () => { - dispatchBrowserEvent(AGENT_CHAT_RETRY_EVENT_NAME); - }; - const { theme } = useContext(ThemeContext); return ( @@ -68,14 +57,6 @@ export const AIChatErrorMessage = ({ error }: AIChatErrorMessageProps) => { {error.message || t`An error occurred while processing your message`} -