Skip to content

The open alternative to Salesforce, designed for AI.

Give agents and skills the override and archive model of objects (#29051)

Félix Malfait98b194a29c7b
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 0aeb4a4a63f..1726f864e7a 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -17,6 +17,7 @@ type Agent {
description: String
icon: String
id: UUID!
+ isActive: Boolean!
isCustom: Boolean! @deprecated(reason: "Derived from applicationId and removed in 2.54: compare applicationId with the workspace custom application instead.")
isSystem: Boolean!
label: String!
@@ -4910,6 +4911,7 @@ input UpdateAgentInput {
description: String
icon: String
id: UUID!
+ isActive: Boolean
label: String
modelConfiguration: JSON
modelId: String
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index ce5c35160a3..dbfbe3ab581 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -20,6 +20,7 @@ export interface Agent {
description?: Scalars['String']
icon?: Scalars['String']
id: Scalars['UUID']
+ isActive: Scalars['Boolean']
/** @deprecated Derived from applicationId and removed in 2.54: compare applicationId with the workspace custom application instead. */
isCustom: Scalars['Boolean']
isSystem: Scalars['Boolean']
@@ -4215,6 +4216,7 @@ export interface AgentGenqlSelection{
description?: boolean | number
icon?: boolean | number
id?: boolean | number
+ isActive?: boolean | number
/** @deprecated Derived from applicationId and removed in 2.54: compare applicationId with the workspace custom application instead. */
isCustom?: boolean | number
isSystem?: boolean | number
@@ -8222,7 +8224,7 @@ export interface UnsubscribeTopicGenqlSelection{
export interface UpdateAgentChatChannelInput {color?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),name?: (Scalars['String'] | null),position?: (Scalars['Float'] | null),roleIds?: (Scalars['UUID'][] | null)}
-export interface UpdateAgentInput {description?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),id: Scalars['UUID'],label?: (Scalars['String'] | null),modelConfiguration?: (Scalars['JSON'] | null),modelId?: (Scalars['String'] | null),name?: (Scalars['String'] | null),prompt?: (Scalars['String'] | null),responseFormat?: (Scalars['JSON'] | null),roleId?: (Scalars['UUID'] | null),triggers?: (Scalars['JSON'][] | null)}
+export interface UpdateAgentInput {description?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),id: Scalars['UUID'],isActive?: (Scalars['Boolean'] | null),label?: (Scalars['String'] | null),modelConfiguration?: (Scalars['JSON'] | null),modelId?: (Scalars['String'] | null),name?: (Scalars['String'] | null),prompt?: (Scalars['String'] | null),responseFormat?: (Scalars['JSON'] | null),roleId?: (Scalars['UUID'] | null),triggers?: (Scalars['JSON'][] | null)}
export interface UpdateApiKeyInput {expiresAt?: (Scalars['String'] | null),id: Scalars['UUID'],name?: (Scalars['String'] | null),revokedAt?: (Scalars['String'] | null)}
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index b33c9e700c0..b7a69086339 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -163,6 +163,9 @@ export default {
"id": [
524
],
+ "isActive": [
+ 4
+ ],
"isCustom": [
4
],
@@ -13120,6 +13123,9 @@ export default {
"id": [
524
],
+ "isActive": [
+ 4
+ ],
"label": [
1
],
diff --git a/packages/twenty-docs/developers/extend/apps/operations/sync-and-recovery.mdx b/packages/twenty-docs/developers/extend/apps/operations/sync-and-recovery.mdx
index 0791e0dae81..59f2ec85db5 100644
--- a/packages/twenty-docs/developers/extend/apps/operations/sync-and-recovery.mdx
+++ b/packages/twenty-docs/developers/extend/apps/operations/sync-and-recovery.mdx
@@ -146,7 +146,7 @@ Each entity goes to the file that already defines it, so a second pull rewrites
- **Placed on a default or foreign page layout** — tabs and widgets added to an engine default page layout, or to one owned by another application, are written as standalone `definePageLayoutTab()` and `definePageLayoutWidget()` files, since the identifier they attach to is known.
- **Widgets the export cannot carry yet** — on any layout, including your own, a widget of the deprecated `VIEW` type, a widget showing one of your app's own front components or command menu items, or a widget without a position for its tab's layout mode is reported, and the layout or tab is written without it.
- **Workflows the export cannot carry yet** — a workflow changed in the workflow builder since the last sync, a system or private workflow, one with a Code or chat message step, which application workflows don't support, and one calling another app's workflow action are reported and left in place. The workspace custom application is the exception for the first and last cases: the builder publishes its workflows too, and they may call any app's actions, so they are pulled. One of its workflows is reported instead when it has no active version, or when its active version uses settings a definition can't express. Email and calendar steps are pulled: an account shared with the workspace is written as its `connectedAccountHandle`, while a member's private account and variables are kept as they are. The workflow is reported instead when a step's account is archived, can no longer run the step, or shares its address with an older account, since applying the handle would pick another account.
-- **Agents and skills the export cannot carry yet** — a deactivated skill, and an agent on more than one role or bound to a role pull does not write, are reported and left in place.
+- **Agents the export cannot carry yet** — an agent on more than one role, or bound to a role pull does not write, is reported and left in place.
- **Workspace runtime state** — member and API-key role assignments, webhooks, per-user navigation and navigation items pinned to a record, all excluded by design.
- **Owned by another application** — reported, never pulled.
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 7a437496914..be8946bf32e 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -74,7 +74,7 @@ export type FindManyTimelineActivityTypesQuery = { timelineActivityTypes: Array<
export type AgentChatThreadParticipantFieldsFragment = { __typename: 'AgentChatThreadParticipant', id: string, threadId: string, lastReadAt: string | null, archivedAt: string | null, snoozedUntil: string | null, isSubscribed: boolean, lastMentionedAt: string | null, updatedAt: string };
-export type AgentFieldsFragment = { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string };
+export type AgentFieldsFragment = { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string };
export type SkillFieldsFragment = { __typename: 'Skill', id: string, name: string, label: string, description: string | null, icon: string | null, content: string, isSystem: boolean, isActive: boolean, applicationId: string | null, createdAt: string, updatedAt: string };
@@ -121,7 +121,7 @@ export type CreateOneAgentMutationVariables = Exact<{
}>;
-export type CreateOneAgentMutation = { createOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
+export type CreateOneAgentMutation = { createOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
export type CreateSkillMutationVariables = Exact<{
input: Types.CreateSkillInput;
@@ -150,7 +150,7 @@ export type DeleteOneAgentMutationVariables = Exact<{
}>;
-export type DeleteOneAgentMutation = { deleteOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
+export type DeleteOneAgentMutation = { deleteOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
export type DeleteQueuedChatMessageMutationVariables = Exact<{
messageId: string;
@@ -256,7 +256,7 @@ export type UpdateOneAgentMutationVariables = Exact<{
}>;
-export type UpdateOneAgentMutation = { updateOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
+export type UpdateOneAgentMutation = { updateOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
export type UpdateSkillMutationVariables = Exact<{
input: Types.UpdateSkillInput;
@@ -268,7 +268,7 @@ export type UpdateSkillMutation = { updateSkill: { __typename: 'Skill', id: stri
export type FindManyAgentsQueryVariables = Exact<{ [key: string]: never; }>;
-export type FindManyAgentsQuery = { findManyAgents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }> };
+export type FindManyAgentsQuery = { findManyAgents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }> };
export type FindManySkillsQueryVariables = Exact<{ [key: string]: never; }>;
@@ -285,7 +285,7 @@ export type FindOneAgentQueryVariables = Exact<{
}>;
-export type FindOneAgentQuery = { findOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
+export type FindOneAgentQuery = { findOneAgent: { __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string } };
export type FindOneSkillQueryVariables = Exact<{
id: string;
@@ -373,7 +373,7 @@ export type TrackAnalyticsMutationVariables = Exact<{
export type TrackAnalyticsMutation = { trackAnalytics: { __typename: 'Analytics', success: boolean } };
-export type ApplicationFieldsFragment = { __typename: 'Application', id: string, name: string, description: string | null, logoUrl: string | null, version: string | null, universalIdentifier: string, applicationRegistrationId: string | null, canBeUninstalled: boolean, autoUpgrade: boolean, createdAt: string, defaultRoleId: string | null, settingsCustomTabFrontComponentId: string | null, healthCheckLogicFunctionId: string | null, availablePackages: any, applicationRegistration: { __typename: 'ApplicationRegistrationSummary', id: string, latestAvailableVersion: string | null, sourceType: Types.ApplicationRegistrationSourceType, logoUrl: string | null } | null, applicationVariables: Array<{ __typename: 'ApplicationVariable', id: string, key: string, value: string, description: string, label: string, isSecret: boolean, isDeprecated: boolean, isRequired: boolean, type: string, options: any, scope: Types.ApplicationVariableScope }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, frontComponents: Array<{ __typename: 'FrontComponent', id: string, name: string, description: string | null, applicationId: string, componentName: string, builtComponentChecksum: string, universalIdentifier: string | null, isHeadless: boolean, usesSdkClient: boolean, frontComponentSharedDependenciesChecksum: string | null, createdAt: string, updatedAt: string }>, commandMenuItems: Array<{ __typename: 'CommandMenuItem', id: string, label: string, shortLabel: string | null, icon: string | null, isPinned: boolean, availabilityType: Types.CommandMenuItemAvailabilityType, conditionalAvailabilityExpression: string | null, frontComponentId: string | null, universalIdentifier: string | null, applicationId: string | null, createdAt: string, updatedAt: string }>, settingsMenuItems: Array<{ __typename: 'SettingsMenuItem', id: string, universalIdentifier: string, applicationId: string, frontComponentId: string, title: string, icon: string | null, position: number, scope: Types.SettingsMenuItemScope }> | null, objects: Array<{ __typename: 'Object', id: string, universalIdentifier: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, color: string | null, description: string | null, icon: string | null, isRemote: boolean, isActive: boolean, isSystem: boolean, isAuditLogged: boolean, isUIEditable: boolean, isUICreatable: boolean, writability: Types.MetadataWritability, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId: string | null, imageIdentifierFieldMetadataId: string | null, applicationId: string, shortcut: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, openRecordIn: Types.ObjectOpenRecordIn, sharingReach: Types.ObjectSharingReach, readability: Types.MetadataReadability, duplicateCriteria: Array<Array<string>> | null, searchFieldMetadataList: Array<{ __typename: 'SearchField', id: string, fieldMetadataId: string, tsVectorFieldMetadataId: string, position: number, createdAt: string, updatedAt: string }>, indexMetadataList: Array<{ __typename: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause: string | null, indexType: Types.IndexType, isUnique: boolean, applicationId: string, isSystemSideEffect: boolean, indexFieldMetadataList: Array<{ __typename: 'IndexField', id: string, fieldMetadataId: string, subFieldName: string | null, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename: 'Field', id: string, universalIdentifier: string, type: Types.FieldMetadataType, name: string, label: string, description: string | null, icon: string | null, isActive: boolean | null, isSystem: boolean | null, isUIEditable: boolean | null, writability: Types.MetadataWritability | null, isNullable: boolean | null, isUnique: boolean | null, isSearchable: boolean | null, createdAt: string, updatedAt: string, defaultValue: any, options: any, settings: any, isLabelSyncedWithName: boolean | null, morphId: string | null, applicationId: string, relation: { __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } } | null, morphRelations: Array<{ __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } }> | null }> }>, logicFunctions: Array<{ __typename: 'LogicFunction', id: string, name: string, description: string | null, runtime: string, timeoutSeconds: number, executionMode: Types.LogicFunctionExecutionMode, sourceHandlerPath: string, handlerName: string, cronTriggerSettings: any, databaseEventTriggerSettings: any, httpRouteTriggerSettings: any, toolTriggerSettings: any, workflowActionTriggerSettings: any, applicationId: string | null, universalIdentifier: string | null, createdAt: string, updatedAt: string }> };
+export type ApplicationFieldsFragment = { __typename: 'Application', id: string, name: string, description: string | null, logoUrl: string | null, version: string | null, universalIdentifier: string, applicationRegistrationId: string | null, canBeUninstalled: boolean, autoUpgrade: boolean, createdAt: string, defaultRoleId: string | null, settingsCustomTabFrontComponentId: string | null, healthCheckLogicFunctionId: string | null, availablePackages: any, applicationRegistration: { __typename: 'ApplicationRegistrationSummary', id: string, latestAvailableVersion: string | null, sourceType: Types.ApplicationRegistrationSourceType, logoUrl: string | null } | null, applicationVariables: Array<{ __typename: 'ApplicationVariable', id: string, key: string, value: string, description: string, label: string, isSecret: boolean, isDeprecated: boolean, isRequired: boolean, type: string, options: any, scope: Types.ApplicationVariableScope }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, frontComponents: Array<{ __typename: 'FrontComponent', id: string, name: string, description: string | null, applicationId: string, componentName: string, builtComponentChecksum: string, universalIdentifier: string | null, isHeadless: boolean, usesSdkClient: boolean, frontComponentSharedDependenciesChecksum: string | null, createdAt: string, updatedAt: string }>, commandMenuItems: Array<{ __typename: 'CommandMenuItem', id: string, label: string, shortLabel: string | null, icon: string | null, isPinned: boolean, availabilityType: Types.CommandMenuItemAvailabilityType, conditionalAvailabilityExpression: string | null, frontComponentId: string | null, universalIdentifier: string | null, applicationId: string | null, createdAt: string, updatedAt: string }>, settingsMenuItems: Array<{ __typename: 'SettingsMenuItem', id: string, universalIdentifier: string, applicationId: string, frontComponentId: string, title: string, icon: string | null, position: number, scope: Types.SettingsMenuItemScope }> | null, objects: Array<{ __typename: 'Object', id: string, universalIdentifier: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, color: string | null, description: string | null, icon: string | null, isRemote: boolean, isActive: boolean, isSystem: boolean, isAuditLogged: boolean, isUIEditable: boolean, isUICreatable: boolean, writability: Types.MetadataWritability, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId: string | null, imageIdentifierFieldMetadataId: string | null, applicationId: string, shortcut: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, openRecordIn: Types.ObjectOpenRecordIn, sharingReach: Types.ObjectSharingReach, readability: Types.MetadataReadability, duplicateCriteria: Array<Array<string>> | null, searchFieldMetadataList: Array<{ __typename: 'SearchField', id: string, fieldMetadataId: string, tsVectorFieldMetadataId: string, position: number, createdAt: string, updatedAt: string }>, indexMetadataList: Array<{ __typename: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause: string | null, indexType: Types.IndexType, isUnique: boolean, applicationId: string, isSystemSideEffect: boolean, indexFieldMetadataList: Array<{ __typename: 'IndexField', id: string, fieldMetadataId: string, subFieldName: string | null, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename: 'Field', id: string, universalIdentifier: string, type: Types.FieldMetadataType, name: string, label: string, description: string | null, icon: string | null, isActive: boolean | null, isSystem: boolean | null, isUIEditable: boolean | null, writability: Types.MetadataWritability | null, isNullable: boolean | null, isUnique: boolean | null, isSearchable: boolean | null, createdAt: string, updatedAt: string, defaultValue: any, options: any, settings: any, isLabelSyncedWithName: boolean | null, morphId: string | null, applicationId: string, relation: { __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } } | null, morphRelations: Array<{ __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } }> | null }> }>, logicFunctions: Array<{ __typename: 'LogicFunction', id: string, name: string, description: string | null, runtime: string, timeoutSeconds: number, executionMode: Types.LogicFunctionExecutionMode, sourceHandlerPath: string, handlerName: string, cronTriggerSettings: any, databaseEventTriggerSettings: any, httpRouteTriggerSettings: any, toolTriggerSettings: any, workflowActionTriggerSettings: any, applicationId: string | null, universalIdentifier: string | null, createdAt: string, updatedAt: string }> };
export type RunApplicationHealthCheckMutationVariables = Exact<{
applicationId: string;
@@ -392,7 +392,7 @@ export type FindOneApplicationQueryVariables = Exact<{
}>;
-export type FindOneApplicationQuery = { findOneApplication: { __typename: 'Application', isUninstallBlockedByOtherWorkspaceInstallations: boolean, id: string, name: string, description: string | null, logoUrl: string | null, version: string | null, universalIdentifier: string, applicationRegistrationId: string | null, canBeUninstalled: boolean, autoUpgrade: boolean, createdAt: string, defaultRoleId: string | null, settingsCustomTabFrontComponentId: string | null, healthCheckLogicFunctionId: string | null, availablePackages: any, applicationRegistration: { __typename: 'ApplicationRegistrationSummary', id: string, latestAvailableVersion: string | null, sourceType: Types.ApplicationRegistrationSourceType, logoUrl: string | null } | null, applicationVariables: Array<{ __typename: 'ApplicationVariable', id: string, key: string, value: string, description: string, label: string, isSecret: boolean, isDeprecated: boolean, isRequired: boolean, type: string, options: any, scope: Types.ApplicationVariableScope }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, frontComponents: Array<{ __typename: 'FrontComponent', id: string, name: string, description: string | null, applicationId: string, componentName: string, builtComponentChecksum: string, universalIdentifier: string | null, isHeadless: boolean, usesSdkClient: boolean, frontComponentSharedDependenciesChecksum: string | null, createdAt: string, updatedAt: string }>, commandMenuItems: Array<{ __typename: 'CommandMenuItem', id: string, label: string, shortLabel: string | null, icon: string | null, isPinned: boolean, availabilityType: Types.CommandMenuItemAvailabilityType, conditionalAvailabilityExpression: string | null, frontComponentId: string | null, universalIdentifier: string | null, applicationId: string | null, createdAt: string, updatedAt: string }>, settingsMenuItems: Array<{ __typename: 'SettingsMenuItem', id: string, universalIdentifier: string, applicationId: string, frontComponentId: string, title: string, icon: string | null, position: number, scope: Types.SettingsMenuItemScope }> | null, objects: Array<{ __typename: 'Object', id: string, universalIdentifier: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, color: string | null, description: string | null, icon: string | null, isRemote: boolean, isActive: boolean, isSystem: boolean, isAuditLogged: boolean, isUIEditable: boolean, isUICreatable: boolean, writability: Types.MetadataWritability, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId: string | null, imageIdentifierFieldMetadataId: string | null, applicationId: string, shortcut: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, openRecordIn: Types.ObjectOpenRecordIn, sharingReach: Types.ObjectSharingReach, readability: Types.MetadataReadability, duplicateCriteria: Array<Array<string>> | null, searchFieldMetadataList: Array<{ __typename: 'SearchField', id: string, fieldMetadataId: string, tsVectorFieldMetadataId: string, position: number, createdAt: string, updatedAt: string }>, indexMetadataList: Array<{ __typename: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause: string | null, indexType: Types.IndexType, isUnique: boolean, applicationId: string, isSystemSideEffect: boolean, indexFieldMetadataList: Array<{ __typename: 'IndexField', id: string, fieldMetadataId: string, subFieldName: string | null, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename: 'Field', id: string, universalIdentifier: string, type: Types.FieldMetadataType, name: string, label: string, description: string | null, icon: string | null, isActive: boolean | null, isSystem: boolean | null, isUIEditable: boolean | null, writability: Types.MetadataWritability | null, isNullable: boolean | null, isUnique: boolean | null, isSearchable: boolean | null, createdAt: string, updatedAt: string, defaultValue: any, options: any, settings: any, isLabelSyncedWithName: boolean | null, morphId: string | null, applicationId: string, relation: { __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } } | null, morphRelations: Array<{ __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } }> | null }> }>, logicFunctions: Array<{ __typename: 'LogicFunction', id: string, name: string, description: string | null, runtime: string, timeoutSeconds: number, executionMode: Types.LogicFunctionExecutionMode, sourceHandlerPath: string, handlerName: string, cronTriggerSettings: any, databaseEventTriggerSettings: any, httpRouteTriggerSettings: any, toolTriggerSettings: any, workflowActionTriggerSettings: any, applicationId: string | null, universalIdentifier: string | null, createdAt: string, updatedAt: string }> } };
+export type FindOneApplicationQuery = { findOneApplication: { __typename: 'Application', isUninstallBlockedByOtherWorkspaceInstallations: boolean, id: string, name: string, description: string | null, logoUrl: string | null, version: string | null, universalIdentifier: string, applicationRegistrationId: string | null, canBeUninstalled: boolean, autoUpgrade: boolean, createdAt: string, defaultRoleId: string | null, settingsCustomTabFrontComponentId: string | null, healthCheckLogicFunctionId: string | null, availablePackages: any, applicationRegistration: { __typename: 'ApplicationRegistrationSummary', id: string, latestAvailableVersion: string | null, sourceType: Types.ApplicationRegistrationSourceType, logoUrl: string | null } | null, applicationVariables: Array<{ __typename: 'ApplicationVariable', id: string, key: string, value: string, description: string, label: string, isSecret: boolean, isDeprecated: boolean, isRequired: boolean, type: string, options: any, scope: Types.ApplicationVariableScope }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, frontComponents: Array<{ __typename: 'FrontComponent', id: string, name: string, description: string | null, applicationId: string, componentName: string, builtComponentChecksum: string, universalIdentifier: string | null, isHeadless: boolean, usesSdkClient: boolean, frontComponentSharedDependenciesChecksum: string | null, createdAt: string, updatedAt: string }>, commandMenuItems: Array<{ __typename: 'CommandMenuItem', id: string, label: string, shortLabel: string | null, icon: string | null, isPinned: boolean, availabilityType: Types.CommandMenuItemAvailabilityType, conditionalAvailabilityExpression: string | null, frontComponentId: string | null, universalIdentifier: string | null, applicationId: string | null, createdAt: string, updatedAt: string }>, settingsMenuItems: Array<{ __typename: 'SettingsMenuItem', id: string, universalIdentifier: string, applicationId: string, frontComponentId: string, title: string, icon: string | null, position: number, scope: Types.SettingsMenuItemScope }> | null, objects: Array<{ __typename: 'Object', id: string, universalIdentifier: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, color: string | null, description: string | null, icon: string | null, isRemote: boolean, isActive: boolean, isSystem: boolean, isAuditLogged: boolean, isUIEditable: boolean, isUICreatable: boolean, writability: Types.MetadataWritability, createdAt: string, updatedAt: string, labelIdentifierFieldMetadataId: string | null, imageIdentifierFieldMetadataId: string | null, applicationId: string, shortcut: string | null, isLabelSyncedWithName: boolean, isSearchable: boolean, openRecordIn: Types.ObjectOpenRecordIn, sharingReach: Types.ObjectSharingReach, readability: Types.MetadataReadability, duplicateCriteria: Array<Array<string>> | null, searchFieldMetadataList: Array<{ __typename: 'SearchField', id: string, fieldMetadataId: string, tsVectorFieldMetadataId: string, position: number, createdAt: string, updatedAt: string }>, indexMetadataList: Array<{ __typename: 'Index', id: string, createdAt: string, updatedAt: string, name: string, indexWhereClause: string | null, indexType: Types.IndexType, isUnique: boolean, applicationId: string, isSystemSideEffect: boolean, indexFieldMetadataList: Array<{ __typename: 'IndexField', id: string, fieldMetadataId: string, subFieldName: string | null, createdAt: string, updatedAt: string, order: number }> }>, fieldsList: Array<{ __typename: 'Field', id: string, universalIdentifier: string, type: Types.FieldMetadataType, name: string, label: string, description: string | null, icon: string | null, isActive: boolean | null, isSystem: boolean | null, isUIEditable: boolean | null, writability: Types.MetadataWritability | null, isNullable: boolean | null, isUnique: boolean | null, isSearchable: boolean | null, createdAt: string, updatedAt: string, defaultValue: any, options: any, settings: any, isLabelSyncedWithName: boolean | null, morphId: string | null, applicationId: string, relation: { __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } } | null, morphRelations: Array<{ __typename: 'Relation', type: Types.RelationType, sourceObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, targetObjectMetadata: { __typename: 'Object', id: string, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename: 'Field', id: string, name: string }, targetFieldMetadata: { __typename: 'Field', id: string, name: string } }> | null }> }>, logicFunctions: Array<{ __typename: 'LogicFunction', id: string, name: string, description: string | null, runtime: string, timeoutSeconds: number, executionMode: Types.LogicFunctionExecutionMode, sourceHandlerPath: string, handlerName: string, cronTriggerSettings: any, databaseEventTriggerSettings: any, httpRouteTriggerSettings: any, toolTriggerSettings: any, workflowActionTriggerSettings: any, applicationId: string | null, universalIdentifier: string | null, createdAt: string, updatedAt: string }> } };
export type FindOneApplicationByUniversalIdentifierQueryVariables = Exact<{
universalIdentifier: string;
@@ -2351,7 +2351,7 @@ export type GetRoleQuery = { getRole: { __typename: 'Role', id: string, label: s
export type GetRolesQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetRolesQuery = { getPermissionFlags: Array<{ __typename: 'PermissionFlag', id: string, applicationId: string, key: string, label: string, description: string | null, icon: string | null, permissionType: string }>, getRoles: Array<{ __typename: 'Role', id: string, label: string, description: string | null, icon: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, canAccessAllAgentChatChannels: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean, applicationId: string, universalIdentifier: string | null, workspaceMembers: Array<{ __typename: 'WorkspaceMember', id: string, avatarUrl: string | null, userEmail: string, userId: string, userWorkspaceId: string | null, name: { __typename: 'FullName', firstName: string, lastName: string } }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, apiKeys: Array<{ __typename: 'ApiKeyForRole', id: string, name: string, expiresAt: string, revokedAt: string | null }>, permissionFlags: Array<{ __typename: 'RolePermissionFlag', id: string, flag: string, roleId: string }> | null, objectPermissions: Array<{ __typename: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords: boolean | null, canUpdateObjectRecords: boolean | null, canSoftDeleteObjectRecords: boolean | null, canDestroyObjectRecords: boolean | null, restrictedFields: any }> | null, fieldPermissions: Array<{ __typename: 'FieldPermission', objectMetadataId: string, fieldMetadataId: string, canReadFieldValue: boolean | null, canUpdateFieldValue: boolean | null, id: string, roleId: string }> | null, rowLevelPermissionPredicates: Array<{ __typename: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: Types.RowLevelPermissionPredicateOperand, subFieldName: string | null, workspaceMemberFieldMetadataId: string | null, workspaceMemberSubFieldName: string | null, rowLevelPermissionPredicateGroupId: string | null, positionInRowLevelPermissionPredicateGroup: number | null, roleId: string, value: any }> | null, rowLevelPermissionPredicateGroups: Array<{ __typename: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId: string | null, logicalOperator: Types.RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup: number | null, roleId: string, objectMetadataId: string }> | null }> };
+export type GetRolesQuery = { getPermissionFlags: Array<{ __typename: 'PermissionFlag', id: string, applicationId: string, key: string, label: string, description: string | null, icon: string | null, permissionType: string }>, getRoles: Array<{ __typename: 'Role', id: string, label: string, description: string | null, icon: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, canAccessAllAgentChatChannels: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean, applicationId: string, universalIdentifier: string | null, workspaceMembers: Array<{ __typename: 'WorkspaceMember', id: string, avatarUrl: string | null, userEmail: string, userId: string, userWorkspaceId: string | null, name: { __typename: 'FullName', firstName: string, lastName: string } }>, agents: Array<{ __typename: 'Agent', id: string, name: string, label: string, description: string | null, icon: string | null, prompt: string, modelId: string, responseFormat: any, roleId: string | null, isSystem: boolean, isActive: boolean, modelConfiguration: any, triggers: Array<any>, applicationId: string | null, createdAt: string, updatedAt: string }>, apiKeys: Array<{ __typename: 'ApiKeyForRole', id: string, name: string, expiresAt: string, revokedAt: string | null }>, permissionFlags: Array<{ __typename: 'RolePermissionFlag', id: string, flag: string, roleId: string }> | null, objectPermissions: Array<{ __typename: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords: boolean | null, canUpdateObjectRecords: boolean | null, canSoftDeleteObjectRecords: boolean | null, canDestroyObjectRecords: boolean | null, restrictedFields: any }> | null, fieldPermissions: Array<{ __typename: 'FieldPermission', objectMetadataId: string, fieldMetadataId: string, canReadFieldValue: boolean | null, canUpdateFieldValue: boolean | null, id: string, roleId: string }> | null, rowLevelPermissionPredicates: Array<{ __typename: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: Types.RowLevelPermissionPredicateOperand, subFieldName: string | null, workspaceMemberFieldMetadataId: string | null, workspaceMemberSubFieldName: string | null, rowLevelPermissionPredicateGroupId: string | null, positionInRowLevelPermissionPredicateGroup: number | null, roleId: string, value: any }> | null, rowLevelPermissionPredicateGroups: Array<{ __typename: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId: string | null, logicalOperator: Types.RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup: number | null, roleId: string, objectMetadataId: string }> | null }> };
export type CreateApprovedAccessDomainMutationVariables = Exact<{
input: Types.CreateApprovedAccessDomainInput;
@@ -2846,10 +2846,10 @@ export type FindManyMarketplaceAppsForToolTableQuery = { findManyMarketplaceApps
export const AgentChatThreadParticipantFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentChatThreadParticipantFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AgentChatThreadParticipant"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"lastReadAt"}},{"kind":"Field","name":{"kind":"Name","value":"archivedAt"}},{"kind":"Field","name":{"kind":"Name","value":"snoozedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"isSubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"lastMentionedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<AgentChatThreadParticipantFieldsFragment, unknown>;
export const SkillFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<SkillFieldsFragment, unknown>;
-export const AgentFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<AgentFieldsFragment, unknown>;
+export const AgentFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<AgentFieldsFragment, unknown>;
export const ObjectMetadataFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isAuditLogged"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"isUICreatable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"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":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"sharingReach"}},{"kind":"Field","name":{"kind":"Name","value":"readability"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"searchFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"tsVectorFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"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":"subFieldName"}},{"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"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"}}]}}]}}]}}]}}]} as unknown as DocumentNode<ObjectMetadataFieldsFragment, unknown>;
export const LogicFunctionFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"executionMode"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"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":"toolTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"workflowActionTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<LogicFunctionFieldsFragment, unknown>;
-export const ApplicationFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"logoUrl"}},{"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":"logoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canBeUninstalled"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpgrade"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleId"}},{"kind":"Field","name":{"kind":"Name","value":"settingsCustomTabFrontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"healthCheckLogicFunctionId"}},{"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"isSecret"}},{"kind":"Field","name":{"kind":"Name","value":"isDeprecated"}},{"kind":"Field","name":{"kind":"Name","value":"isRequired"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"frontComponents"},"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"componentName"}},{"kind":"Field","name":{"kind":"Name","value":"builtComponentChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}},{"kind":"Field","name":{"kind":"Name","value":"usesSdkClient"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentSharedDependenciesChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"settingsMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"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"}}]}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isAuditLogged"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"isUICreatable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"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":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"sharingReach"}},{"kind":"Field","name":{"kind":"Name","value":"readability"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"searchFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"tsVectorFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"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":"subFieldName"}},{"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"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":"executionMode"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"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":"toolTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"workflowActionTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ApplicationFieldsFragment, unknown>;
+export const ApplicationFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"logoUrl"}},{"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":"logoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canBeUninstalled"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpgrade"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleId"}},{"kind":"Field","name":{"kind":"Name","value":"settingsCustomTabFrontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"healthCheckLogicFunctionId"}},{"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"isSecret"}},{"kind":"Field","name":{"kind":"Name","value":"isDeprecated"}},{"kind":"Field","name":{"kind":"Name","value":"isRequired"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"frontComponents"},"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"componentName"}},{"kind":"Field","name":{"kind":"Name","value":"builtComponentChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}},{"kind":"Field","name":{"kind":"Name","value":"usesSdkClient"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentSharedDependenciesChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"settingsMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"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"}}]}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isAuditLogged"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"isUICreatable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"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":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"sharingReach"}},{"kind":"Field","name":{"kind":"Name","value":"readability"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"searchFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"tsVectorFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"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":"subFieldName"}},{"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"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":"executionMode"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"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":"toolTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"workflowActionTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ApplicationFieldsFragment, unknown>;
export const AuthTokenFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<AuthTokenFragmentFragment, unknown>;
export const AuthTokenPairFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<AuthTokenPairFragmentFragment, unknown>;
export const AvailableSsoIdentityProvidersFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableSSOIdentityProvidersFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FindAvailableSSOIDP"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]} as unknown as DocumentNode<AvailableSsoIdentityProvidersFragmentFragment, unknown>;
@@ -2910,11 +2910,11 @@ export const AddAgentChatMessageReactionDocument = {"kind":"Document","definitio
export const AssignAgentChatThreadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AssignAgentChatThread"},"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":"assigneeWorkspaceMemberId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignAgentChatThread"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeWorkspaceMemberId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeWorkspaceMemberId"}}}]}]}}]} as unknown as DocumentNode<AssignAgentChatThreadMutation, AssignAgentChatThreadMutationVariables>;
export const AssignRoleToAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AssignRoleToAgent"},"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":"roleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignRoleToAgent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"roleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"roleId"}}}]}]}}]} as unknown as DocumentNode<AssignRoleToAgentMutation, AssignRoleToAgentMutationVariables>;
export const CreateAgentChatChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAgentChatChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateAgentChatChannelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createAgentChatChannel"},"arguments":[{"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"}}]}}]}}]} as unknown as DocumentNode<CreateAgentChatChannelMutation, CreateAgentChatChannelMutationVariables>;
-export const CreateOneAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateOneAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateAgentInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createOneAgent"},"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<CreateOneAgentMutation, CreateOneAgentMutationVariables>;
+export const CreateOneAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateOneAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateAgentInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createOneAgent"},"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<CreateOneAgentMutation, CreateOneAgentMutationVariables>;
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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<CreateSkillMutation, CreateSkillMutationVariables>;
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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<DeactivateSkillMutation, DeactivateSkillMutationVariables>;
export const DeleteAgentChatChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteAgentChatChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"channelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"destinationChannelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteAgentChatChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"channelId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"channelId"}}},{"kind":"Argument","name":{"kind":"Name","value":"destinationChannelId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"destinationChannelId"}}}]}]}}]} as unknown as DocumentNode<DeleteAgentChatChannelMutation, DeleteAgentChatChannelMutationVariables>;
-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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<DeleteOneAgentMutation, DeleteOneAgentMutationVariables>;
+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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<DeleteOneAgentMutation, DeleteOneAgentMutationVariables>;
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<DeleteQueuedChatMessageMutation, DeleteQueuedChatMessageMutationVariables>;
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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<DeleteSkillMutation, DeleteSkillMutationVariables>;
export const MarkAgentChatThreadAsDoneInChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MarkAgentChatThreadAsDoneInChannel"},"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":"markAgentChatThreadAsDoneInChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}]}]}}]} as unknown as DocumentNode<MarkAgentChatThreadAsDoneInChannelMutation, MarkAgentChatThreadAsDoneInChannelMutationVariables>;
@@ -2927,12 +2927,12 @@ export const SnoozeAgentChatThreadInChannelDocument = {"kind":"Document","defini
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<StopAgentChatStreamMutation, StopAgentChatStreamMutationVariables>;
export const UpdateAgentChatChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateAgentChatChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"channelId"}},"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":"UpdateAgentChatChannelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateAgentChatChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"channelId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"channelId"}}},{"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"}}]}}]}}]} as unknown as DocumentNode<UpdateAgentChatChannelMutation, UpdateAgentChatChannelMutationVariables>;
export const UpdateAgentChatThreadInboxStateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateAgentChatThreadInboxState"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"threadIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"action"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AgentChatInboxAction"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"snoozedUntil"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateAgentChatThreadInboxState"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"action"},"value":{"kind":"Variable","name":{"kind":"Name","value":"action"}}},{"kind":"Argument","name":{"kind":"Name","value":"snoozedUntil"},"value":{"kind":"Variable","name":{"kind":"Name","value":"snoozedUntil"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentChatThreadParticipantFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentChatThreadParticipantFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AgentChatThreadParticipant"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"lastReadAt"}},{"kind":"Field","name":{"kind":"Name","value":"archivedAt"}},{"kind":"Field","name":{"kind":"Name","value":"snoozedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"isSubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"lastMentionedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<UpdateAgentChatThreadInboxStateMutation, UpdateAgentChatThreadInboxStateMutationVariables>;
-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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<UpdateOneAgentMutation, UpdateOneAgentMutationVariables>;
+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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<UpdateOneAgentMutation, UpdateOneAgentMutationVariables>;
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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<UpdateSkillMutation, UpdateSkillMutationVariables>;
-export const FindManyAgentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"prompt"}},{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"responseFormat"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<FindManyAgentsQuery, FindManyAgentsQueryVariables>;
+export const FindManyAgentsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyAgents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AgentFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Agent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"prompt"}},{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"responseFormat"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<FindManyAgentsQuery, FindManyAgentsQueryVariables>;
export const FindManySkillsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManySkills"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"skills"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SkillFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SkillFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Skill"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<FindManySkillsQuery, FindManySkillsQueryVariables>;
export const FindManySkillsForSuggestionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManySkillsForSuggestion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"skills"},"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}}]}}]}}]} as unknown as DocumentNode<FindManySkillsForSuggestionQuery, FindManySkillsForSuggestionQueryVariables>;
-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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<FindOneAgentQuery, FindOneAgentQueryVariables>;
+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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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<FindOneAgentQuery, FindOneAgentQueryVariables>;
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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"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<FindOneSkillQuery, FindOneSkillQueryVariables>;
export const GetAgentChatChannelRolesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentChatChannelRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agentChatChannelRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllAgentChatChannels"}}]}}]}}]} as unknown as DocumentNode<GetAgentChatChannelRolesQuery, GetAgentChatChannelRolesQueryVariables>;
export const GetAgentChatChannelSummariesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentChatChannelSummaries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agentChatChannelSummaries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"openCount"}},{"kind":"Field","name":{"kind":"Name","value":"hasUnreadOpen"}},{"kind":"Field","name":{"kind":"Name","value":"assignedToMeCount"}},{"kind":"Field","name":{"kind":"Name","value":"hasUnreadAssignedToMe"}},{"kind":"Field","name":{"kind":"Name","value":"snoozedCount"}},{"kind":"Field","name":{"kind":"Name","value":"doneCount"}}]}}]}}]} as unknown as DocumentNode<GetAgentChatChannelSummariesQuery, GetAgentChatChannelSummariesQueryVariables>;
@@ -2948,7 +2948,7 @@ export const OnAgentChatEventDocument = {"kind":"Document","definitions":[{"kind
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<TrackAnalyticsMutation, TrackAnalyticsMutationVariables>;
export const RunApplicationHealthCheckDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RunApplicationHealthCheck"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"runApplicationHealthCheck"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"action"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"location"}}]}}]}}]}}]} as unknown as DocumentNode<RunApplicationHealthCheckMutation, RunApplicationHealthCheckMutationVariables>;
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":"logoUrl"}},{"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":"defaultRoleId"}}]}}]}}]} as unknown as DocumentNode<FindManyApplicationsQuery, FindManyApplicationsQueryVariables>;
-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":"Field","name":{"kind":"Name","value":"isUninstallBlockedByOtherWorkspaceInstallations"}}]}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isAuditLogged"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"isUICreatable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"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":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"sharingReach"}},{"kind":"Field","name":{"kind":"Name","value":"readability"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"searchFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"tsVectorFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"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":"subFieldName"}},{"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"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":"executionMode"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"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":"toolTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"workflowActionTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"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":"logoUrl"}},{"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":"logoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canBeUninstalled"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpgrade"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleId"}},{"kind":"Field","name":{"kind":"Name","value":"settingsCustomTabFrontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"healthCheckLogicFunctionId"}},{"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"isSecret"}},{"kind":"Field","name":{"kind":"Name","value":"isDeprecated"}},{"kind":"Field","name":{"kind":"Name","value":"isRequired"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"frontComponents"},"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"componentName"}},{"kind":"Field","name":{"kind":"Name","value":"builtComponentChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}},{"kind":"Field","name":{"kind":"Name","value":"usesSdkClient"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentSharedDependenciesChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"settingsMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"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<FindOneApplicationQuery, FindOneApplicationQueryVariables>;
+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":"Field","name":{"kind":"Name","value":"isUninstallBlockedByOtherWorkspaceInstallations"}}]}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isAuditLogged"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"isUICreatable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"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":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"sharingReach"}},{"kind":"Field","name":{"kind":"Name","value":"readability"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateCriteria"}},{"kind":"Field","name":{"kind":"Name","value":"searchFieldMetadataList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"tsVectorFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"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":"subFieldName"}},{"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":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}},{"kind":"Field","name":{"kind":"Name","value":"writability"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"isUnique"}},{"kind":"Field","name":{"kind":"Name","value":"isSearchable"}},{"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":"executionMode"}},{"kind":"Field","name":{"kind":"Name","value":"sourceHandlerPath"}},{"kind":"Field","name":{"kind":"Name","value":"handlerName"}},{"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":"toolTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"workflowActionTriggerSettings"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"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":"logoUrl"}},{"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":"logoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canBeUninstalled"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpgrade"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleId"}},{"kind":"Field","name":{"kind":"Name","value":"settingsCustomTabFrontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"healthCheckLogicFunctionId"}},{"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"isSecret"}},{"kind":"Field","name":{"kind":"Name","value":"isDeprecated"}},{"kind":"Field","name":{"kind":"Name","value":"isRequired"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"frontComponents"},"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":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"componentName"}},{"kind":"Field","name":{"kind":"Name","value":"builtComponentChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}},{"kind":"Field","name":{"kind":"Name","value":"usesSdkClient"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentSharedDependenciesChecksum"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"settingsMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}},{"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<FindOneApplicationQuery, FindOneApplicationQueryVariables>;
export const FindOneApplicationByUniversalIdentifierDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneApplicationByUniversalIdentifier"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"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":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode<FindOneApplicationByUniversalIdentifierQuery, FindOneApplicationByUniversalIdentifierQueryVariables>;
export const FindOneApplicationNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneApplicationName"},"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":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<FindOneApplicationNameQuery, FindOneApplicationNameQueryVariables>;
export const FindOneApplicationSummaryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOneApplicationSummary"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"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":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<FindOneApplicationSummaryQuery, FindOneApplicationSummaryQueryVariables>;
@@ -3165,7 +3165,7 @@ export const UpsertObjectPermissionsDocument = {"kind":"Document","definitions":
export const UpsertPermissionFlagsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertPermissionFlags"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"upsertPermissionFlagsInput"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpsertPermissionFlagsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsertPermissionFlags"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"upsertPermissionFlagsInput"},"value":{"kind":"Variable","name":{"kind":"Name","value":"upsertPermissionFlagsInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RolePermissionFlagFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RolePermissionFlagFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RolePermissionFlag"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"flag"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}}]} as unknown as DocumentNode<UpsertPermissionFlagsMutation, UpsertPermissionFlagsMutationVariables>;
export const UpsertRowLevelPermissionPredicatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertRowLevelPermissionPredicates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpsertRowLevelPermissionPredicatesInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsertRowLevelPermissionPredicates"},"arguments":[{"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":"predicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"predicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}}]} as unknown as DocumentNode<UpsertRowLevelPermissionPredicatesMutation, UpsertRowLevelPermissionPredicatesMutationVariables>;
export const GetRoleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRole"},"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":"getRole"},"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":"RoleFragment"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RolePermissionFlagFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"objectPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllAgentChatChannels"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RolePermissionFlagFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RolePermissionFlag"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"flag"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}}]}}]} as unknown as DocumentNode<GetRoleQuery, GetRoleQueryVariables>;
-export const GetRolesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPermissionFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"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":"permissionType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"getRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"apiKeys"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ApiKeyForRoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RolePermissionFlagFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"objectPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FieldPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllAgentChatChannels"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"ApiKeyForRoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ApiKeyForRole"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"revokedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RolePermissionFlagFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RolePermissionFlag"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"flag"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FieldPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}}]} as unknown as DocumentNode<GetRolesQuery, GetRolesQueryVariables>;
+export const GetRolesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPermissionFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"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":"permissionType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"getRoles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"agents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AgentFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"apiKeys"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ApiKeyForRoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RolePermissionFlagFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"objectPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FieldPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllAgentChatChannels"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"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":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"modelConfiguration"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"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":"ApiKeyForRoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ApiKeyForRole"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"revokedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RolePermissionFlagFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RolePermissionFlag"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"flag"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FieldPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}}]} as unknown as DocumentNode<GetRolesQuery, GetRolesQueryVariables>;
export const CreateApprovedAccessDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateApprovedAccessDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateApprovedAccessDomainInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createApprovedAccessDomain"},"arguments":[{"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":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"isValidated"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode<CreateApprovedAccessDomainMutation, CreateApprovedAccessDomainMutationVariables>;
export const CreateOidcIdentityProviderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateOIDCIdentityProvider"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetupOIDCSsoInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createOIDCIdentityProvider"},"arguments":[{"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":"type"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<CreateOidcIdentityProviderMutation, CreateOidcIdentityProviderMutationVariables>;
export const CreateSamlIdentityProviderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSAMLIdentityProvider"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetupSAMLSsoInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSAMLIdentityProvider"},"arguments":[{"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":"type"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<CreateSamlIdentityProviderMutation, CreateSamlIdentityProviderMutationVariables>;
diff --git a/packages/twenty-front/src/generated-metadata/schema.ts b/packages/twenty-front/src/generated-metadata/schema.ts
index e190b2c4d2d..82f95bcc96a 100644
--- a/packages/twenty-front/src/generated-metadata/schema.ts
+++ b/packages/twenty-front/src/generated-metadata/schema.ts
@@ -34,6 +34,7 @@ export type Agent = {
description?: Maybe<Scalars['String']['output']>;
icon?: Maybe<Scalars['String']['output']>;
id: Scalars['UUID']['output'];
+ isActive: Scalars['Boolean']['output'];
/** @deprecated Derived from applicationId and removed in 2.54: compare applicationId with the workspace custom application instead. */
isCustom: Scalars['Boolean']['output'];
isSystem: Scalars['Boolean']['output'];
@@ -7199,6 +7200,7 @@ export type UpdateAgentInput = {
description?: InputMaybe<Scalars['String']['input']>;
icon?: InputMaybe<Scalars['String']['input']>;
id: Scalars['UUID']['input'];
+ isActive?: InputMaybe<Scalars['Boolean']['input']>;
label?: InputMaybe<Scalars['String']['input']>;
modelConfiguration?: InputMaybe<Scalars['JSON']['input']>;
modelId?: InputMaybe<Scalars['String']['input']>;
diff --git a/packages/twenty-front/src/modules/ai/graphql/fragments/agentFragment.ts b/packages/twenty-front/src/modules/ai/graphql/fragments/agentFragment.ts
index 2110afb4731..6277e8bdc66 100644
--- a/packages/twenty-front/src/modules/ai/graphql/fragments/agentFragment.ts
+++ b/packages/twenty-front/src/modules/ai/graphql/fragments/agentFragment.ts
@@ -12,6 +12,7 @@ export const AGENT_FRAGMENT = gql`
responseFormat
roleId
isSystem
+ isActive
modelConfiguration
triggers
applicationId
diff --git a/packages/twenty-front/src/modules/object-core/agents/hooks/__tests__/useCoreAgents.test.tsx b/packages/twenty-front/src/modules/object-core/agents/hooks/__tests__/useCoreAgents.test.tsx
index 101524f18ad..4c46cd005e1 100644
--- a/packages/twenty-front/src/modules/object-core/agents/hooks/__tests__/useCoreAgents.test.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/hooks/__tests__/useCoreAgents.test.tsx
@@ -32,8 +32,8 @@ const buildAgent = ({
modelId: 'workspace-default-model',
responseFormat: null,
roleId: null,
- isCustom: true,
isSystem,
+ isActive: true,
modelConfiguration: null,
triggers: [],
applicationId: null,
diff --git a/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/getCoreAgentInitialFormValues.test.ts b/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/getCoreAgentInitialFormValues.test.ts
index a596f273acd..2b477bce7e8 100644
--- a/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/getCoreAgentInitialFormValues.test.ts
+++ b/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/getCoreAgentInitialFormValues.test.ts
@@ -11,8 +11,8 @@ const agent = {
modelId: 'anthropic/claude-sonnet-5',
responseFormat: { type: 'json', schema: {} },
roleId: 'role-id',
- isCustom: true,
isSystem: false,
+ isActive: true,
modelConfiguration: { webSearch: { enabled: true } },
triggers: [
{
diff --git a/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/isCoreAgentMatchingFilterSettings.test.ts b/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/isCoreAgentMatchingFilterSettings.test.ts
index 3febdbc7c08..00706bb4963 100644
--- a/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/isCoreAgentMatchingFilterSettings.test.ts
+++ b/packages/twenty-front/src/modules/object-core/agents/utils/__tests__/isCoreAgentMatchingFilterSettings.test.ts
@@ -22,6 +22,7 @@ const buildAgent = (overrides: Partial<CoreAgent>): CoreAgent => ({
modelConfiguration: null,
applicationId: null,
isSystem: false,
+ isActive: true,
triggers: [],
createdAt: '2026-01-01T00:00:00.000Z',
updatedAt: '2026-01-01T00:00:00.000Z',
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/2-53-instance-command-fast-1793203146887-agent-and-skill-overridable-entity.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/2-53-instance-command-fast-1793203146887-agent-and-skill-overridable-entity.ts
new file mode 100644
index 00000000000..84e3004fc70
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/2-53-instance-command-fast-1793203146887-agent-and-skill-overridable-entity.ts
@@ -0,0 +1,23 @@
+import { type QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+@RegisteredInstanceCommand('2.53.0', 1793203146887)
+export class AgentAndSkillOverridableEntityFastInstanceCommand
+ implements FastInstanceCommand
+{
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ 'ALTER TABLE "core"."agent" ADD "overrides" jsonb, ADD "isActive" boolean NOT NULL DEFAULT true',
+ );
+ await queryRunner.query('ALTER TABLE "core"."skill" ADD "overrides" jsonb');
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query('ALTER TABLE "core"."skill" DROP COLUMN "overrides"');
+ await queryRunner.query(
+ 'ALTER TABLE "core"."agent" DROP COLUMN "isActive", DROP COLUMN "overrides"',
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/agent-and-skill-overridable-entity-upgrade-command-name.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/agent-and-skill-overridable-entity-upgrade-command-name.constant.ts
new file mode 100644
index 00000000000..d8cbc896de1
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-53/agent-and-skill-overridable-entity-upgrade-command-name.constant.ts
@@ -0,0 +1,2 @@
+export const AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME =
+ '2.53.0_AgentAndSkillOverridableEntityFastInstanceCommand_1793203146887';
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
index 3a877e11a32..4a8db66cadf 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
@@ -262,6 +262,7 @@ import { AddObjectMetadataDisabledObjectPermissionActionsFastInstanceCommand } f
import { BackfillApplicationAutoUpgradeSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-53/2-53-instance-command-slow-1793170402367-backfill-application-auto-upgrade';
import { AddMessagingProviderFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-52/2-52-instance-command-fast-1793032438837-add-messaging-provider';
import { AddMcpServerFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-53/2-53-instance-command-fast-1793150000000-add-mcp-server';
+import { AgentAndSkillOverridableEntityFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-53/2-53-instance-command-fast-1793203146887-agent-and-skill-overridable-entity';
import { DropIsCustomFromAgentSkillViewIndexAndAgentChatChannelFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-54/2-54-instance-command-fast-1793139794914-drop-is-custom-from-agent-skill-view-index-and-agent-chat-channel';
export const INSTANCE_COMMANDS = [
@@ -527,5 +528,6 @@ export const INSTANCE_COMMANDS = [
AddMcpServerFastInstanceCommand,
AddObjectMetadataDisabledObjectPermissionActionsFastInstanceCommand,
BackfillApplicationAutoUpgradeSlowInstanceCommand,
+ AgentAndSkillOverridableEntityFastInstanceCommand,
DropIsCustomFromAgentSkillViewIndexAndAgentChatChannelFastInstanceCommand,
];
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-skill-manifest-to-universal-flat-skill.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-skill-manifest-to-universal-flat-skill.util.ts
index 044a598d1d2..4d9c07d1c8c 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-skill-manifest-to-universal-flat-skill.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-skill-manifest-to-universal-flat-skill.util.ts
@@ -21,6 +21,7 @@ export const fromSkillManifestToUniversalFlatSkill = ({
content: skillManifest.content,
isSystem: false,
isActive: true,
+ overrides: null,
createdAt: now,
updatedAt: now,
};
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/build-all-flat-entity-operation-record-by-metadata-name-from-from-to.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/build-all-flat-entity-operation-record-by-metadata-name-from-from-to.util.spec.ts
index f29494c2455..9a2aa55616a 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/build-all-flat-entity-operation-record-by-metadata-name-from-from-to.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/build-all-flat-entity-operation-record-by-metadata-name-from-from-to.util.spec.ts
@@ -10,6 +10,8 @@ import { type FlatCommandMenuItem } from 'src/engine/metadata-modules/flat-comma
import { createEmptyAllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-all-flat-entity-maps.constant';
import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
+import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
+import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
import { type FlatNavigationMenuItem } from 'src/engine/metadata-modules/flat-navigation-menu-item/types/flat-navigation-menu-item.type';
import { type FlatPageLayout } from 'src/engine/metadata-modules/flat-page-layout/types/flat-page-layout.type';
import { type FlatRole } from 'src/engine/metadata-modules/flat-role/types/flat-role.type';
@@ -123,6 +125,63 @@ const NAVIGATION_MENU_ITEM: FlatNavigationMenuItem = {
position: 0,
};
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ 'workspace-custom-application-universal-identifier';
+
+const AGENT: FlatAgent = {
+ ...SYNCABLE,
+ id: 'agent-id',
+ universalIdentifier: 'agent-universal-identifier',
+ name: 'researcher',
+ label: 'Researcher',
+ icon: null,
+ description: null,
+ prompt: 'Research the company',
+ modelId: 'auto',
+ responseFormat: { type: 'text' },
+ modelConfiguration: null,
+ triggers: [],
+ isSystem: true,
+ isActive: true,
+ overrides: null,
+ deletedAt: null,
+};
+
+const SKILL: FlatSkill = {
+ ...SYNCABLE,
+ id: 'skill-id',
+ universalIdentifier: 'skill-universal-identifier',
+ name: 'summarize',
+ label: 'Summarize',
+ icon: null,
+ description: null,
+ content: 'Summarize the record',
+ isSystem: false,
+ isActive: true,
+ overrides: null,
+};
+
+const buildAllFlatEntityMapsWithAgentAndSkill = ({
+ agent,
+ skill,
+}: {
+ agent: FlatAgent;
+ skill: FlatSkill;
+}) => {
+ const allFlatEntityMaps = createEmptyAllFlatEntityMaps();
+
+ allFlatEntityMaps.flatAgentMaps = addFlatEntityToFlatEntityMapsOrThrow({
+ flatEntity: agent,
+ flatEntityMaps: allFlatEntityMaps.flatAgentMaps,
+ });
+ allFlatEntityMaps.flatSkillMaps = addFlatEntityToFlatEntityMapsOrThrow({
+ flatEntity: skill,
+ flatEntityMaps: allFlatEntityMaps.flatSkillMaps,
+ });
+
+ return allFlatEntityMaps;
+};
+
const BUILD_OPTIONS = {
isSystemBuild: false,
inferDeletionFromMissingEntities: true,
@@ -390,4 +449,66 @@ describe('buildAllFlatEntityOperationRecordByMetadataNameFromFromTo', () => {
[PAGE_LAYOUT.universalIdentifier]: PAGE_LAYOUT,
});
});
+
+ it('keeps workspace overrides and archives of agents and skills across a sync', () => {
+ const workspaceAgent: FlatAgent = {
+ ...AGENT,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ prompt: 'Research the market',
+ isActive: false,
+ },
+ },
+ };
+ const workspaceSkill: FlatSkill = {
+ ...SKILL,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ content: 'Summarize in one line',
+ isActive: false,
+ },
+ },
+ };
+
+ const result = buildAllFlatEntityOperationRecordByMetadataNameFromFromTo({
+ fromAllFlatEntityMaps: buildAllFlatEntityMapsWithAgentAndSkill({
+ agent: workspaceAgent,
+ skill: workspaceSkill,
+ }),
+ toAllUniversalFlatEntityMaps: buildAllFlatEntityMapsWithAgentAndSkill({
+ agent: { ...AGENT, label: 'Lead researcher' },
+ skill: { ...SKILL, label: 'Summarize record' },
+ }),
+ buildOptions: BUILD_OPTIONS,
+ });
+
+ expect(result.agent?.flatEntityToUpdate).toEqual({
+ [AGENT.universalIdentifier]: {
+ ...workspaceAgent,
+ label: 'Lead researcher',
+ },
+ });
+ expect(result.skill?.flatEntityToUpdate).toEqual({
+ [SKILL.universalIdentifier]: {
+ ...workspaceSkill,
+ label: 'Summarize record',
+ },
+ });
+ });
+
+ it('keeps a skill the workspace deactivated before overrides existed', () => {
+ const result = buildAllFlatEntityOperationRecordByMetadataNameFromFromTo({
+ fromAllFlatEntityMaps: buildAllFlatEntityMapsWithAgentAndSkill({
+ agent: AGENT,
+ skill: { ...SKILL, isActive: false },
+ }),
+ toAllUniversalFlatEntityMaps: buildAllFlatEntityMapsWithAgentAndSkill({
+ agent: AGENT,
+ skill: SKILL,
+ }),
+ buildOptions: BUILD_OPTIONS,
+ });
+
+ expect(result).toEqual({});
+ });
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
index 39c0c27438a..1680d50bfb8 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
@@ -858,7 +858,7 @@ const EXPORTED_KINDS: ExportedKind[] = [
metadataName: 'agent',
emittedProperties: Object.keys(EXPORTED_AGENT_MANIFEST),
renamedProperties: {},
- workspaceLocalProperties: [],
+ workspaceLocalProperties: WORKSPACE_LOCAL_PROPERTIES,
knownGaps: {
modelConfiguration:
'no manifest slot; an agent with one is reported as unsupported',
@@ -890,10 +890,8 @@ const EXPORTED_KINDS: ExportedKind[] = [
}),
),
renamedProperties: {},
- workspaceLocalProperties: [],
+ workspaceLocalProperties: WORKSPACE_LOCAL_PROPERTIES,
knownGaps: {
- isActive:
- 'no manifest slot and no overrides; a deactivated skill is reported as unsupported',
isSystem:
'always false for application skills; any other value is reported as unsupported',
},
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-skills-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-skills-manifest.util.spec.ts
index 9e657f5f7aa..426d7160dc6 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-skills-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-skills-manifest.util.spec.ts
@@ -15,6 +15,10 @@ const DEACTIVATED_SKILL_UNIVERSAL_IDENTIFIER =
'20000000-0000-4000-8000-000000000002';
const SYSTEM_SKILL_UNIVERSAL_IDENTIFIER =
'20000000-0000-4000-8000-000000000003';
+const OVERRIDDEN_SKILL_UNIVERSAL_IDENTIFIER =
+ '20000000-0000-4000-8000-000000000004';
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '10000000-0000-4000-8000-000000000002';
const buildSkillManifest = (universalIdentifier: string): SkillManifest => ({
universalIdentifier,
@@ -47,6 +51,14 @@ const { skills, coverage } = reconstructSkillsManifest({
isActive: false,
}),
buildFlatSkill(SYSTEM_SKILL_UNIVERSAL_IDENTIFIER, { isSystem: true }),
+ buildFlatSkill(OVERRIDDEN_SKILL_UNIVERSAL_IDENTIFIER, {
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ label: 'Workspace label',
+ isActive: false,
+ },
+ },
+ }),
],
flatEntityMaps: createEmptyAllFlatEntityMaps().flatSkillMaps,
}),
@@ -55,9 +67,9 @@ const { skills, coverage } = reconstructSkillsManifest({
describe('reconstructSkillsManifest', () => {
it('should export an active application skill', () => {
- expect(skills).toEqual([
+ expect(skills).toContainEqual(
buildSkillManifest(OUTREACH_SKILL_UNIVERSAL_IDENTIFIER),
- ]);
+ );
expect(coverage).toContainEqual({
metadataName: 'skill',
universalIdentifier: OUTREACH_SKILL_UNIVERSAL_IDENTIFIER,
@@ -68,21 +80,31 @@ describe('reconstructSkillsManifest', () => {
it.each([
[
DEACTIVATED_SKILL_UNIVERSAL_IDENTIFIER,
- 'skill deactivated in this workspace',
+ 'deactivated in this workspace, exported active',
],
[
- SYSTEM_SKILL_UNIVERSAL_IDENTIFIER,
- 'skill with values a definition cannot express: isSystem',
+ OVERRIDDEN_SKILL_UNIVERSAL_IDENTIFIER,
+ 'deactivated in this workspace, exported active, workspace overrides not exported',
],
])(
- 'should report skill %s as unsupported: %s',
+ 'should export skill %s with its workspace state noted: %s',
(universalIdentifier, reason) => {
+ expect(skills).toContainEqual(buildSkillManifest(universalIdentifier));
expect(coverage).toContainEqual({
metadataName: 'skill',
universalIdentifier,
- status: ApplicationExportCoverageStatus.UNSUPPORTED,
+ status: ApplicationExportCoverageStatus.EXPORTED,
reason,
});
},
);
+
+ it('should report a system skill as unsupported', () => {
+ expect(coverage).toContainEqual({
+ metadataName: 'skill',
+ universalIdentifier: SYSTEM_SKILL_UNIVERSAL_IDENTIFIER,
+ status: ApplicationExportCoverageStatus.UNSUPPORTED,
+ reason: 'skill with values a definition cannot express: isSystem',
+ });
+ });
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/get-unreproduced-properties-reason.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/get-unreproduced-properties-reason.util.ts
index 6f8fc859a7e..b903364c326 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/get-unreproduced-properties-reason.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/get-unreproduced-properties-reason.util.ts
@@ -3,6 +3,7 @@ import { isDefined } from 'twenty-shared/utils';
import { compareByCodePoint } from 'src/engine/core-modules/application/application-manifest/utils/compare-by-code-point.util';
import { MANIFEST_ENTITY_REGISTRY } from 'src/engine/core-modules/application/application-manifest/utils/find-manifest-entity-descriptor-by-universal-identifier.util';
+import { preserveApplicationLocalMetadataState } from 'src/engine/core-modules/application/application-manifest/utils/preserve-application-local-metadata-state.util';
import { type MetadataUniversalFlatEntity } from 'src/engine/metadata-modules/flat-entity/types/metadata-universal-flat-entity.type';
import { compareTwoFlatEntity } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/compare-two-universal-flat-entity.util';
@@ -20,7 +21,10 @@ export const getUnreproducedPropertiesReason = <
}): string | undefined => {
const comparison = compareTwoFlatEntity({
fromUniversalFlatEntity: flatEntity,
- toUniversalFlatEntity: reproducedUniversalFlatEntity,
+ toUniversalFlatEntity: preserveApplicationLocalMetadataState({
+ existingEntity: flatEntity,
+ manifestEntity: reproducedUniversalFlatEntity,
+ }),
metadataName,
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/preserve-application-local-metadata-state.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/preserve-application-local-metadata-state.util.ts
index 109c44402aa..f5118211735 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/preserve-application-local-metadata-state.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/preserve-application-local-metadata-state.util.ts
@@ -1,8 +1,4 @@
-const APPLICATION_LOCAL_METADATA_PROPERTIES = [
- 'overrides',
- 'universalOverrides',
- 'isActive',
-] as const;
+import { WORKSPACE_LOCAL_STATE_PROPERTIES } from 'src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant';
export const preserveApplicationLocalMetadataState = <TEntity extends object>({
existingEntity,
@@ -22,7 +18,7 @@ export const preserveApplicationLocalMetadataState = <TEntity extends object>({
return manifestEntity;
}
- for (const property of APPLICATION_LOCAL_METADATA_PROPERTIES) {
+ for (const property of WORKSPACE_LOCAL_STATE_PROPERTIES) {
if (property in existingEntityRecord && property in mergedEntityRecord) {
mergedEntityRecord[property] = existingEntityRecord[property];
}
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/reconstruct-skills-manifest.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/reconstruct-skills-manifest.util.ts
index 9fd2b327b03..fa8498a6bb7 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/reconstruct-skills-manifest.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/reconstruct-skills-manifest.util.ts
@@ -14,11 +14,6 @@ import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/fla
const convertFlatSkill = (
flatSkill: FlatSkill,
): { manifest: SkillManifest } | { reason: string } => {
- // A skill has no overrides, so apply would reactivate it
- if (!flatSkill.isActive) {
- return { reason: 'skill deactivated in this workspace' };
- }
-
const manifest = fromFlatSkillToSkillManifest({ flatSkill });
const reason = getUnreproducedPropertiesReason({
metadataName: 'skill',
diff --git a/packages/twenty-server/src/engine/core-modules/application/utils/from-agent-manifest-to-universal-flat-agent.util.ts b/packages/twenty-server/src/engine/core-modules/application/utils/from-agent-manifest-to-universal-flat-agent.util.ts
index 3f653c44dae..2e3268180a5 100644
--- a/packages/twenty-server/src/engine/core-modules/application/utils/from-agent-manifest-to-universal-flat-agent.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/utils/from-agent-manifest-to-universal-flat-agent.util.ts
@@ -36,6 +36,8 @@ export const fromAgentManifestToUniversalFlatAgent = ({
}),
),
isSystem: agentManifest.isSystem ?? false,
+ isActive: true,
+ overrides: null,
createdAt: now,
updatedAt: now,
deletedAt: null,
diff --git a/packages/twenty-server/src/engine/core-modules/tool-provider/utils/is-user-facing-tool-execution-error.util.ts b/packages/twenty-server/src/engine/core-modules/tool-provider/utils/is-user-facing-tool-execution-error.util.ts
index 46f16e8e094..1ef37d22d46 100644
--- a/packages/twenty-server/src/engine/core-modules/tool-provider/utils/is-user-facing-tool-execution-error.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/tool-provider/utils/is-user-facing-tool-execution-error.util.ts
@@ -77,6 +77,7 @@ const USER_FACING_AI_EXCEPTION_CODES = [
AiExceptionCode.AGENT_NOT_FOUND,
AiExceptionCode.AGENT_ALREADY_EXISTS,
AiExceptionCode.AGENT_IS_STANDARD,
+ AiExceptionCode.AGENT_IS_INACTIVE,
AiExceptionCode.INVALID_AGENT_INPUT,
AiExceptionCode.ROLE_NOT_FOUND,
AiExceptionCode.ROLE_CANNOT_BE_ASSIGNED_TO_AGENTS,
diff --git a/packages/twenty-server/src/engine/core-modules/usage-limit/services/usage-quota-consumption.service.ts b/packages/twenty-server/src/engine/core-modules/usage-limit/services/usage-quota-consumption.service.ts
index 04be48d523d..eded3d65646 100644
--- a/packages/twenty-server/src/engine/core-modules/usage-limit/services/usage-quota-consumption.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/usage-limit/services/usage-quota-consumption.service.ts
@@ -24,6 +24,7 @@ import { UsageUnit } from 'src/engine/core-modules/usage/enums/usage-unit.enum';
import { UsageAnalyticsService } from 'src/engine/core-modules/usage/services/usage-analytics.service';
import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { LogicFunctionEntity } from 'src/engine/metadata-modules/logic-function/logic-function.entity';
import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
@@ -203,9 +204,9 @@ export class UsageQuotaConsumptionService {
await this.applicationRepository.find(workspaceId, { where })
).map((application) => [application.id, application.name]);
case 'agent':
- return (await this.agentRepository.find(workspaceId, { where })).map(
- (agent) => [agent.id, agent.label],
- );
+ return (await this.agentRepository.find(workspaceId, { where }))
+ .map((agentRow) => resolveEffectiveAgent(agentRow))
+ .map((agent) => [agent.id, agent.label]);
case 'logicFunction':
return (
await this.logicFunctionRepository.find(workspaceId, { where })
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/__tests__/agent-run.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/__tests__/agent-run.service.spec.ts
new file mode 100644
index 00000000000..c7bf07735c5
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/__tests__/agent-run.service.spec.ts
@@ -0,0 +1,130 @@
+import { type AgentResponseFormat } from 'twenty-shared/ai';
+
+import { AgentRunService } from 'src/engine/metadata-modules/ai/ai-agent-execution/services/agent-run.service';
+import {
+ AiException,
+ AiExceptionCode,
+} from 'src/engine/metadata-modules/ai/ai.exception';
+
+const WORKSPACE_ID = 'workspace-id';
+const APPLICATION_ID = 'application-id';
+const AGENT_ID = 'agent-id';
+const AGENT_UNIVERSAL_IDENTIFIER = 'agent-universal-identifier';
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '00000000-0000-4000-8000-000000000002';
+
+const APPLICATION = {
+ id: APPLICATION_ID,
+ name: 'Research app',
+ defaultRoleId: null,
+};
+
+const JSON_RESPONSE_FORMAT: AgentResponseFormat = {
+ type: 'json',
+ schema: {
+ type: 'object',
+ properties: { summary: { type: 'string' } },
+ },
+};
+
+const buildService = (overrides: Record<string, unknown>) => {
+ const agentRow = {
+ id: AGENT_ID,
+ universalIdentifier: AGENT_UNIVERSAL_IDENTIFIER,
+ applicationId: APPLICATION_ID,
+ name: 'researcher',
+ label: 'Researcher',
+ responseFormat: { type: 'text' },
+ isActive: true,
+ triggers: [],
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: overrides,
+ },
+ };
+ const agentRepository = {
+ findOne: jest.fn().mockResolvedValue(agentRow),
+ };
+ const applicationLookupService = {
+ findById: jest.fn().mockResolvedValue(APPLICATION),
+ };
+ const agentActorContextService = {
+ buildApplicationAgentContext: jest.fn().mockResolvedValue({
+ application: APPLICATION,
+ authContext: { type: 'application', application: APPLICATION },
+ agentRoleId: undefined,
+ }),
+ };
+ const agentRunnerService = { start: jest.fn().mockResolvedValue(undefined) };
+
+ const service = new AgentRunService(
+ agentActorContextService as never,
+ agentRunnerService as never,
+ {} as never,
+ {} as never,
+ {} as never,
+ {} as never,
+ {} as never,
+ {} as never,
+ applicationLookupService as never,
+ agentRepository as never,
+ );
+
+ return { service, agentRunnerService };
+};
+
+const runAgent = (service: AgentRunService) =>
+ service.run({
+ workspace: { id: WORKSPACE_ID } as never,
+ requestUserWorkspaceId: null,
+ requestWorkspaceMemberId: null,
+ callerApplication: APPLICATION as never,
+ input: {
+ agentUniversalIdentifier: AGENT_UNIVERSAL_IDENTIFIER,
+ prompt: 'Summarize the market',
+ waitForCompletion: false,
+ },
+ });
+
+describe('AgentRunService', () => {
+ describe('run', () => {
+ it('runs with the overridden label and response format', async () => {
+ const { service, agentRunnerService } = buildService({
+ label: 'Market researcher',
+ responseFormat: JSON_RESPONSE_FORMAT,
+ });
+
+ await runAgent(service);
+
+ expect(agentRunnerService.start).toHaveBeenCalledWith(
+ expect.objectContaining({
+ spec: expect.objectContaining({
+ agentId: AGENT_ID,
+ title: 'Market researcher',
+ }),
+ }),
+ );
+ });
+
+ it('rejects an overridden response format without output fields', async () => {
+ const { service, agentRunnerService } = buildService({
+ responseFormat: { type: 'json', schema: { type: 'object' } },
+ });
+
+ await expect(runAgent(service)).rejects.toMatchObject(
+ new AiException(
+ 'This agent has no output fields. Add at least one output field to its response format.',
+ AiExceptionCode.INVALID_AGENT_INPUT,
+ ),
+ );
+ expect(agentRunnerService.start).not.toHaveBeenCalled();
+ });
+
+ it('refuses an agent archived through its overrides', async () => {
+ const { service } = buildService({ isActive: false });
+
+ await expect(runAgent(service)).rejects.toMatchObject({
+ code: AiExceptionCode.AGENT_IS_INACTIVE,
+ });
+ });
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-run.service.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-run.service.ts
index 9dc52d5d2bb..7a91ea49de7 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-run.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-run.service.ts
@@ -60,6 +60,7 @@ import { buildAgentRunThreadId } from 'src/engine/metadata-modules/ai/ai-agent-e
import { resolveRunAgentMessagesOrThrow } from 'src/engine/metadata-modules/ai/ai-agent-execution/utils/resolve-run-agent-messages-or-throw.util';
import { AGENT_RUN_BASE_SYSTEM_PROMPT } from 'src/engine/metadata-modules/ai/ai-agent/constants/agent-run-base-system-prompt.const';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { AgentChatThreadService } from 'src/engine/metadata-modules/ai/ai-chat/services/agent-chat-thread.service';
import {
AiException,
@@ -173,18 +174,27 @@ export class AgentRunService implements AgentRunCallerHandler, OnModuleInit {
input.responseFormat,
);
- const agent = await this.agentRepository.findOne(workspace.id, {
+ const agentRow = await this.agentRepository.findOne(workspace.id, {
where: {
universalIdentifier: input.agentUniversalIdentifier,
},
});
- if (!agent) {
+ if (!isDefined(agentRow)) {
throw new NotFoundException(
`Agent ${input.agentUniversalIdentifier} not found`,
);
}
+ const agent = resolveEffectiveAgent(agentRow);
+
+ if (!agent.isActive) {
+ throw new AiException(
+ `Agent ${input.agentUniversalIdentifier} is archived`,
+ AiExceptionCode.AGENT_IS_INACTIVE,
+ );
+ }
+
if (
isDefined(callerApplication) &&
agent.applicationId !== callerApplication.id
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-runner.service.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-runner.service.ts
index 97233e4ba18..69149b50802 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-runner.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-execution/services/agent-runner.service.ts
@@ -33,6 +33,7 @@ import { type RunAgentJobData } from 'src/engine/metadata-modules/ai/ai-agent-ex
import { buildAgentRunSummary } from 'src/engine/metadata-modules/ai/ai-agent-execution/utils/build-agent-run-summary.util';
import { sumAgentRunSummaries } from 'src/engine/metadata-modules/ai/ai-agent-execution/utils/sum-agent-run-summaries.util';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { AgentChatEventPublisherService } from 'src/engine/metadata-modules/ai/ai-chat/services/agent-chat-event-publisher.service';
import {
type AgentChatStreamClaim,
@@ -730,7 +731,16 @@ export class AgentRunnerService {
);
}
- return agent;
+ const effectiveAgent = resolveEffectiveAgent(agent);
+
+ if (!effectiveAgent.isActive) {
+ throw new AiException(
+ `Agent "${effectiveAgent.label}" is archived`,
+ AiExceptionCode.AGENT_IS_INACTIVE,
+ );
+ }
+
+ return effectiveAgent;
}
// A record of the run, not its outcome, so a write failure must not fail the run
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/crons/__tests__/agent-cron-trigger.cron.job.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/crons/__tests__/agent-cron-trigger.cron.job.spec.ts
index fbaa1612cad..d2910a4960a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/crons/__tests__/agent-cron-trigger.cron.job.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/crons/__tests__/agent-cron-trigger.cron.job.spec.ts
@@ -8,6 +8,7 @@ import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handl
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
import { getQueueToken } from 'src/engine/core-modules/message-queue/utils/get-queue-token.util';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { type AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
import { AgentCronTriggerCronJob } from 'src/engine/metadata-modules/ai/ai-agent-trigger/crons/agent-cron-trigger.cron.job';
import { RunAgentTriggerJob } from 'src/engine/metadata-modules/ai/ai-agent-trigger/jobs/run-agent-trigger.job';
import { AgentTriggerThrottlerService } from 'src/engine/metadata-modules/ai/ai-agent-trigger/services/agent-trigger-throttler.service';
@@ -27,13 +28,21 @@ const buildCronTrigger = (isActive = true): AgentTrigger => ({
settings: { pattern: '0 9 * * 1' },
});
-const buildFlatAgentMaps = (triggers: AgentTrigger[]) =>
+const buildFlatAgentMaps = ({
+ triggers,
+ agentOverrides = null,
+}: {
+ triggers: AgentTrigger[];
+ agentOverrides?: AgentEntity['overrides'];
+}) =>
addFlatEntityToFlatEntityMapsOrThrow({
flatEntity: {
id: AGENT_ID,
universalIdentifier: AGENT_ID,
workspaceId: WORKSPACE_ID,
triggers,
+ isActive: true,
+ overrides: agentOverrides,
deletedAt: null,
} as never,
flatEntityMaps: createEmptyFlatEntityMaps(),
@@ -47,7 +56,7 @@ describe('AgentCronTriggerCronJob', () => {
let flatAgentMaps: ReturnType<typeof buildFlatAgentMaps>;
beforeEach(async () => {
- flatAgentMaps = buildFlatAgentMaps([buildCronTrigger()]);
+ flatAgentMaps = buildFlatAgentMaps({ triggers: [buildCronTrigger()] });
messageQueueService = { add: jest.fn().mockResolvedValue(undefined) };
cronTriggerDeduplicationService = {
shouldDispatch: jest.fn().mockResolvedValue(true),
@@ -123,7 +132,7 @@ describe('AgentCronTriggerCronJob', () => {
});
it('should ignore inactive cron triggers', async () => {
- flatAgentMaps = buildFlatAgentMaps([buildCronTrigger(false)]);
+ flatAgentMaps = buildFlatAgentMaps({ triggers: [buildCronTrigger(false)] });
await job.handle();
@@ -133,6 +142,21 @@ describe('AgentCronTriggerCronJob', () => {
expect(messageQueueService.add).not.toHaveBeenCalled();
});
+ it('should ignore the triggers of an agent the workspace archived', async () => {
+ flatAgentMaps = buildFlatAgentMaps({
+ triggers: [buildCronTrigger()],
+ agentOverrides: {
+ 'workspace-custom-application-universal-identifier': {
+ isActive: false,
+ },
+ },
+ });
+
+ await job.handle();
+
+ expect(messageQueueService.add).not.toHaveBeenCalled();
+ });
+
it('should not enqueue a run once the agent reached its run limit', async () => {
agentTriggerThrottlerService.consumeAvailableRuns.mockResolvedValue(0);
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/jobs/__tests__/call-agent-database-event-triggers.job.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/jobs/__tests__/call-agent-database-event-triggers.job.spec.ts
index af240c96eb3..83ae2633320 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/jobs/__tests__/call-agent-database-event-triggers.job.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/jobs/__tests__/call-agent-database-event-triggers.job.spec.ts
@@ -87,6 +87,7 @@ const buildFlatAgentMaps = (triggers: AgentTrigger[]) =>
workspaceId: WORKSPACE_ID,
applicationId: APPLICATION_ID,
triggers,
+ isActive: true,
deletedAt: null,
},
]);
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/services/agent-trigger-runner.service.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/services/agent-trigger-runner.service.ts
index a6222ed588c..1f0f72d69d8 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/services/agent-trigger-runner.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/services/agent-trigger-runner.service.ts
@@ -22,6 +22,7 @@ import { AGENT_TRIGGER_BASE_SYSTEM_PROMPT } from 'src/engine/metadata-modules/ai
import { type RunAgentTriggerJobData } from 'src/engine/metadata-modules/ai/ai-agent-trigger/types/run-agent-trigger-job-data.type';
import { buildAgentTriggerMessages } from 'src/engine/metadata-modules/ai/ai-agent-trigger/utils/build-agent-trigger-messages.util';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import {
AiException,
AiExceptionCode,
@@ -144,15 +145,20 @@ export class AgentTriggerRunnerService
workspaceId: string;
ref: AgentTriggerCallerRef;
}): Promise<Pick<TriggeredRun, 'agent' | 'trigger'> | null> {
- const agent = await this.agentRepository.findOne(workspaceId, {
+ const agentRow = await this.agentRepository.findOne(workspaceId, {
where: { id: agentId },
});
- const trigger = agent?.triggers.find(
+ if (!isDefined(agentRow)) {
+ return null;
+ }
+
+ const agent = resolveEffectiveAgent(agentRow);
+ const trigger = agent.triggers.find(
(agentTrigger) => agentTrigger.id === triggerId,
);
- return isDefined(agent) && isDefined(trigger) && trigger.isActive
+ return agent.isActive && isDefined(trigger) && trigger.isActive
? { agent, trigger }
: null;
}
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/utils/find-active-agent-triggers.util.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/utils/find-active-agent-triggers.util.ts
index bec270b5d9f..106c7d763ad 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/utils/find-active-agent-triggers.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent-trigger/utils/find-active-agent-triggers.util.ts
@@ -6,6 +6,7 @@ import { isDefined } from 'twenty-shared/utils';
import { type FlatAgentWithTrigger } from 'src/engine/metadata-modules/ai/ai-agent-trigger/types/flat-agent-with-trigger.type';
import { type FlatAgentMaps } from 'src/engine/metadata-modules/flat-agent/types/flat-agent-maps.type';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
export const findActiveAgentTriggers = <TTriggerType extends AgentTriggerType>({
flatAgentMaps,
@@ -17,6 +18,8 @@ export const findActiveAgentTriggers = <TTriggerType extends AgentTriggerType>({
Object.values(flatAgentMaps.byUniversalIdentifier)
.filter(isDefined)
.filter((flatAgent) => !isDefined(flatAgent.deletedAt))
+ .map((flatAgent) => resolveEffectiveAgent(flatAgent))
+ .filter((flatAgent) => flatAgent.isActive)
.flatMap((flatAgent) =>
flatAgent.triggers
.filter(
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/agent.service.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/agent.service.ts
index 094ab3aa186..bbb36c68e6a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/agent.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/agent.service.ts
@@ -8,6 +8,7 @@ import { type UpdateAgentInput } from 'src/engine/metadata-modules/ai/ai-agent/d
import { fromCreateAgentInputToFlatAgent } from 'src/engine/metadata-modules/ai/ai-agent/utils/from-create-agent-input-to-flat-agent.util';
import { fromUpdateAgentInputToFlatAgentToUpdate } from 'src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util';
import { FlatAgentWithRoleId } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { findFlatEntityByIdInFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps-or-throw.util';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
@@ -46,7 +47,7 @@ export class AgentService {
const roleId = flatRoleTargetByAgentIdMaps[flatAgent.id]?.roleId;
return {
- ...flatAgent,
+ ...resolveEffectiveAgent(flatAgent),
roleId: roleId ?? null,
};
});
@@ -76,7 +77,7 @@ export class AgentService {
const roleId = flatRoleTargetByAgentIdMaps[flatAgent.id]?.roleId;
- return { ...flatAgent, roleId: roleId ?? null };
+ return { ...resolveEffectiveAgent(flatAgent), roleId: roleId ?? null };
}
async createOneAgent(
@@ -154,7 +155,7 @@ export class AgentService {
});
return {
- ...createdAgent,
+ ...resolveEffectiveAgent(createdAgent),
roleId: flatRoleTargetToCreate?.roleId ?? null,
};
}
@@ -190,6 +191,10 @@ export class AgentService {
flatAgentMaps,
flatRoleTargetByAgentIdMaps,
flatRoleMaps,
+ callerApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
});
const validateAndBuildResult =
@@ -244,7 +249,7 @@ export class AgentService {
recomputedFlatRoleTargetByAgentIdMaps[flatAgentToUpdate.id];
return {
- ...updatedAgent,
+ ...resolveEffectiveAgent(updatedAgent),
roleId: existingRoleTarget?.roleId ?? null,
};
}
@@ -343,7 +348,7 @@ export class AgentService {
}
return agentsToDelete.map((agent) => ({
- ...agent,
+ ...resolveEffectiveAgent(agent),
roleId: flatRoleTargetByAgentIdMaps[agent.id]?.roleId ?? null,
}));
}
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto.ts
index 55ef1264d60..aafd0739bd4 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto.ts
@@ -55,6 +55,10 @@ export class AgentDTO {
@Field()
isSystem: boolean;
+ @IsBoolean()
+ @Field()
+ isActive: boolean;
+
@HideField()
workspaceId: string;
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/update-agent.input.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/update-agent.input.ts
index 1743d5fb20c..e4f5174fbcc 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/update-agent.input.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/dtos/update-agent.input.ts
@@ -3,6 +3,7 @@ import { Field, InputType } from '@nestjs/graphql';
import { Type } from 'class-transformer';
import {
IsArray,
+ IsBoolean,
IsNotEmpty,
IsObject,
IsOptional,
@@ -82,6 +83,11 @@ export class UpdateAgentInput {
@Field(() => GraphQLJSON, { nullable: true })
modelConfiguration?: ModelConfiguration;
+ @IsBoolean()
+ @IsOptional()
+ @Field({ nullable: true })
+ isActive?: boolean;
+
@IsArray()
@IsObject({ each: true })
@IsOptional()
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/entities/agent.entity.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/entities/agent.entity.ts
index ca345eb204b..f32e05fc50e 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/entities/agent.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/entities/agent.entity.ts
@@ -11,6 +11,7 @@ import {
import { ADD_IS_SYSTEM_TO_AGENT_AND_WORKFLOW_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-46/add-is-system-to-agent-and-workflow-upgrade-command-name.constant';
import { ADD_TRIGGERS_TO_AGENT_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-46/add-triggers-to-agent-upgrade-command-name.constant';
import { DROP_AGENT_EVALUATION_INPUTS_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-47/drop-agent-evaluation-inputs-upgrade-command-name.constant';
+import { AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-53/agent-and-skill-overridable-entity-upgrade-command-name.constant';
import { WasIntroducedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-introduced-in-upgrade.decorator';
import { WasRemovedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-removed-in-upgrade.decorator';
import { AgentResponseFormat } from 'src/engine/metadata-modules/ai/ai-agent/types/agent-response-format.type';
@@ -18,9 +19,20 @@ import { ModelConfiguration } from 'src/engine/metadata-modules/ai/ai-agent/type
import { AUTO_SELECT_WORKSPACE_DEFAULT_MODEL_ID } from 'twenty-shared/ai';
import { type AgentTrigger } from 'twenty-shared/application';
import { type ModelId } from 'src/engine/metadata-modules/ai/ai-models/types/model-id.type';
-import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-entity.interface';
+import { OverridableEntity } from 'src/engine/workspace-manager/types/overridable-entity.type';
import { JsonbProperty } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/jsonb-property.type';
+export type AgentOverrides = {
+ label?: string;
+ icon?: string | null;
+ description?: string | null;
+ prompt?: string;
+ modelId?: ModelId;
+ responseFormat?: AgentResponseFormat;
+ modelConfiguration?: ModelConfiguration | null;
+ isActive?: boolean;
+};
+
@Entity('agent')
@Index('IDX_AGENT_ID_DELETED_AT', ['id', 'deletedAt'])
@Index('IDX_AGENT_NAME_WORKSPACE_ID_UNIQUE', ['name', 'workspaceId'], {
@@ -28,7 +40,7 @@ import { JsonbProperty } from 'src/engine/workspace-manager/workspace-migration/
where: '"deletedAt" IS NULL',
})
export class AgentEntity
- extends SyncableEntity
+ extends OverridableEntity<AgentOverrides>
implements Required<AgentEntity>
{
@PrimaryGeneratedColumn('uuid')
@@ -94,3 +106,10 @@ export class AgentEntity
@Column({ type: 'text', array: true, default: '{}' })
evaluationInputs: WasRemovedInUpgrade<string[]>;
}
+
+WasIntroducedInUpgrade({
+ upgradeCommandName: AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME,
+})(AgentEntity.prototype, 'overrides');
+WasIntroducedInUpgrade({
+ upgradeCommandName: AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME,
+})(AgentEntity.prototype, 'isActive');
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/__tests__/agent-tools.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/__tests__/agent-tools.spec.ts
index cef9ee02574..91220e2dc65 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/__tests__/agent-tools.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/__tests__/agent-tools.spec.ts
@@ -39,6 +39,7 @@ const buildAgent = (overrides: Record<string, unknown> = {}) => ({
triggers: [],
applicationId: workspaceCustomApplicationId,
isSystem: false,
+ isActive: true,
...overrides,
});
@@ -247,12 +248,13 @@ describe('Agent tools', () => {
});
describe('list_agents', () => {
- it('leaves out system agents', async () => {
+ it('leaves out system and archived agents', async () => {
const { executeTool, agentService } = buildAgentTools();
agentService.findManyAgents.mockResolvedValue([
buildAgent(),
buildAgent({ id: 'workflow-step-agent-id', isSystem: true }),
+ buildAgent({ id: 'archived-agent-id', isActive: false }),
]);
const output = await executeTool({ toolName: 'list_agents', args: {} });
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/list-agents.tool.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/list-agents.tool.ts
index a96dedf6e58..2d735707bc2 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/list-agents.tool.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/tools/list-agents.tool.ts
@@ -18,7 +18,7 @@ const listAgentsInputSchema = z.object({});
category: ToolCategory.AGENT,
requiredPermissionFlags: [PermissionFlagType.AI_SETTINGS],
requiredFeatureFlags: [FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED],
- description: `List the AI agents of the workspace with their prompt, model, role and triggers. System agents, such as those backing workflow AI steps, are not included. Agents installed by an application are listed, but only that application can change them.`,
+ description: `List the AI agents of the workspace with their prompt, model, role and triggers. System agents, such as those backing workflow AI steps, and archived agents are not included. Agents installed by an application are listed, but only that application can change them.`,
})
export class ListAgentsTool extends BaseTool<typeof listAgentsInputSchema> {
readonly inputSchema = listAgentsInputSchema;
@@ -35,6 +35,7 @@ export class ListAgentsTool extends BaseTool<typeof listAgentsInputSchema> {
const listedAgents = agents
.filter(
(agent) =>
+ agent.isActive &&
!agent.isSystem &&
canCallerReachApplication({
callingApplication: application,
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/__tests__/from-update-agent-input-to-flat-agent-to-update.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/__tests__/from-update-agent-input-to-flat-agent-to-update.util.spec.ts
new file mode 100644
index 00000000000..1090de9f407
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/__tests__/from-update-agent-input-to-flat-agent-to-update.util.spec.ts
@@ -0,0 +1,174 @@
+import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
+import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
+import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
+import { fromUpdateAgentInputToFlatAgentToUpdate } from 'src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util';
+import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
+import { fromFlatAgentWithRoleIdToAgentDto } from 'src/engine/metadata-modules/flat-agent/utils/from-agent-entity-to-agent-dto.util';
+
+const APPLICATION_UNIVERSAL_IDENTIFIER = '00000000-0000-4000-8000-000000000001';
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '00000000-0000-4000-8000-000000000002';
+
+const appAgent: FlatAgent = {
+ id: '00000000-0000-4000-8000-000000000003',
+ universalIdentifier: '00000000-0000-4000-8000-000000000004',
+ workspaceId: '00000000-0000-4000-8000-000000000005',
+ applicationId: '00000000-0000-4000-8000-000000000006',
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'researcher',
+ label: 'Researcher',
+ icon: 'IconRobot',
+ description: 'Finds things',
+ prompt: 'Research the company',
+ modelId: 'auto',
+ responseFormat: { type: 'text' },
+ modelConfiguration: null,
+ triggers: [],
+ isSystem: true,
+ isActive: true,
+ overrides: null,
+ createdAt: '2026-10-01T00:00:00.000Z',
+ updatedAt: '2026-10-01T00:00:00.000Z',
+ deletedAt: null,
+};
+
+const workspaceAgent: FlatAgent = {
+ ...appAgent,
+ id: '00000000-0000-4000-8000-000000000007',
+ universalIdentifier: '00000000-0000-4000-8000-000000000008',
+ applicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'writer',
+ label: 'Writer',
+ isSystem: false,
+};
+
+const flatAgentMaps = [appAgent, workspaceAgent].reduce<
+ FlatEntityMaps<FlatAgent>
+>(
+ (flatEntityMaps, flatEntity) =>
+ addFlatEntityToFlatEntityMapsOrThrow({ flatEntity, flatEntityMaps }),
+ createEmptyFlatEntityMaps(),
+);
+
+const updateAsWorkspace = (
+ updateAgentInput: Parameters<
+ typeof fromUpdateAgentInputToFlatAgentToUpdate
+ >[0]['updateAgentInput'],
+) =>
+ fromUpdateAgentInputToFlatAgentToUpdate({
+ updateAgentInput,
+ flatAgentMaps,
+ flatRoleTargetByAgentIdMaps: {},
+ flatRoleMaps: createEmptyFlatEntityMaps(),
+ callerApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ workspaceCustomApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ });
+
+describe('fromUpdateAgentInputToFlatAgentToUpdate', () => {
+ it('stores edits on another application agent as workspace overrides', () => {
+ const { flatAgentToUpdate } = updateAsWorkspace({
+ id: appAgent.id,
+ name: appAgent.name,
+ label: 'Market researcher',
+ prompt: 'Research the market',
+ modelId: 'gpt-4o',
+ isActive: false,
+ });
+
+ expect(flatAgentToUpdate).toMatchObject({
+ name: 'researcher',
+ label: 'Researcher',
+ prompt: 'Research the company',
+ modelId: 'auto',
+ isActive: true,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ label: 'Market researcher',
+ prompt: 'Research the market',
+ modelId: 'gpt-4o',
+ isActive: false,
+ },
+ },
+ });
+ expect(
+ fromFlatAgentWithRoleIdToAgentDto({ ...flatAgentToUpdate, roleId: null }),
+ ).toMatchObject({
+ name: 'researcher',
+ label: 'Market researcher',
+ prompt: 'Research the market',
+ modelId: 'gpt-4o',
+ isActive: false,
+ });
+ });
+
+ it('drops the override entry once the workspace goes back to the application values', () => {
+ const { flatAgentToUpdate } = fromUpdateAgentInputToFlatAgentToUpdate({
+ updateAgentInput: {
+ id: appAgent.id,
+ label: 'Researcher',
+ isActive: true,
+ },
+ flatAgentMaps: addFlatEntityToFlatEntityMapsOrThrow({
+ flatEntity: {
+ ...appAgent,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ label: 'Market researcher',
+ isActive: false,
+ },
+ },
+ },
+ flatEntityMaps: createEmptyFlatEntityMaps(),
+ }),
+ flatRoleTargetByAgentIdMaps: {},
+ flatRoleMaps: createEmptyFlatEntityMaps(),
+ callerApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ workspaceCustomApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ });
+
+ expect(flatAgentToUpdate.overrides).toBeNull();
+ expect(flatAgentToUpdate.label).toBe('Researcher');
+ expect(flatAgentToUpdate.isActive).toBe(true);
+ });
+
+ it('ignores a null isActive instead of storing it', () => {
+ const { flatAgentToUpdate } = updateAsWorkspace({
+ id: appAgent.id,
+ label: 'Market researcher',
+ isActive: null as unknown as boolean,
+ });
+
+ expect(flatAgentToUpdate.isActive).toBe(true);
+ expect(
+ flatAgentToUpdate.overrides?.[
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER
+ ],
+ ).toEqual({ label: 'Market researcher' });
+ });
+
+ it('refuses to rename another application agent', () => {
+ expect(() =>
+ updateAsWorkspace({ id: appAgent.id, name: 'renamed' }),
+ ).toThrow('Cannot rename an agent owned by another application');
+ });
+
+ it('writes edits on a workspace agent to the agent itself', () => {
+ const { flatAgentToUpdate } = updateAsWorkspace({
+ id: workspaceAgent.id,
+ label: 'Copywriter',
+ isActive: false,
+ });
+
+ expect(flatAgentToUpdate).toMatchObject({
+ name: 'copywriter',
+ label: 'Copywriter',
+ isActive: false,
+ overrides: null,
+ });
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-create-agent-input-to-flat-agent.util.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-create-agent-input-to-flat-agent.util.ts
index 16f4c98d9b2..ba57925db4e 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-create-agent-input-to-flat-agent.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-create-agent-input-to-flat-agent.util.ts
@@ -53,6 +53,8 @@ export const fromCreateAgentInputToFlatAgent = ({
responseFormat: createAgentInput.responseFormat ?? { type: 'text' },
workspaceId,
isSystem,
+ isActive: true,
+ overrides: null,
universalIdentifier: v4(),
applicationId: flatApplication.id,
applicationUniversalIdentifier: flatApplication.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util.ts
index 2770ab12102..f57ba9aae06 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-agent/utils/from-update-agent-input-to-flat-agent-to-update.util.ts
@@ -18,6 +18,8 @@ import { type FlatRoleTargetByAgentIdMaps } from 'src/engine/metadata-modules/fl
import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { findFlatEntityByIdInFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps-or-throw.util';
+import { isCallerOverridingEntity } from 'src/engine/metadata-modules/overrides/utils/is-caller-overriding-entity.util';
+import { sanitizeOverridableEntityInput } from 'src/engine/metadata-modules/overrides/utils/sanitize-overridable-entity-input.util';
import { type FlatRoleTarget } from 'src/engine/metadata-modules/flat-role-target/types/flat-role-target.type';
import { computeMetadataNameFromLabelOrThrow } from 'src/engine/metadata-modules/utils/compute-metadata-name-from-label-or-throw.util';
import { mergeUpdateInExistingRecord } from 'src/utils/merge-update-in-existing-record.util';
@@ -91,10 +93,32 @@ const computeAgentFlatRoleTargetToUpdate = ({
};
};
+const computeUpdatedAgentName = ({
+ shouldOverride,
+ name,
+ label,
+}: {
+ shouldOverride: boolean;
+ name: string | undefined;
+ label: string | undefined;
+}): string | undefined => {
+ if (shouldOverride) {
+ return undefined;
+ }
+
+ if (isDefined(name) || !isDefined(label)) {
+ return name;
+ }
+
+ return computeMetadataNameFromLabelOrThrow(label);
+};
+
export type FromUpdateAgentInputToFlatAgentToUpdateArgs = {
updateAgentInput: UpdateAgentInput;
flatAgentMaps: FlatAgentMaps;
flatRoleTargetByAgentIdMaps: FlatRoleTargetByAgentIdMaps;
+ callerApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationUniversalIdentifier: string;
} & Pick<AllFlatEntityMaps, 'flatRoleMaps'>;
export const fromUpdateAgentInputToFlatAgentToUpdate = ({
@@ -102,6 +126,8 @@ export const fromUpdateAgentInputToFlatAgentToUpdate = ({
flatAgentMaps,
flatRoleTargetByAgentIdMaps,
flatRoleMaps,
+ callerApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
}: FromUpdateAgentInputToFlatAgentToUpdateArgs): {
flatAgentToUpdate: FlatAgent;
} & FlatRoleTargetToUpdateCreateDelete => {
@@ -122,26 +148,64 @@ export const fromUpdateAgentInputToFlatAgentToUpdate = ({
});
}
- const updatedEditableAgentProperties = extractAndSanitizeObjectStringFields(
- rawUpdateAgentInput,
- FLAT_AGENT_EDITABLE_PROPERTIES,
- );
-
- if (
- isDefined(updatedEditableAgentProperties.label) &&
- !isDefined(updatedEditableAgentProperties.name)
- ) {
- updatedEditableAgentProperties.name = computeMetadataNameFromLabelOrThrow(
- updatedEditableAgentProperties.label,
+ const { name, isActive, ...otherEditableAgentProperties } =
+ extractAndSanitizeObjectStringFields(
+ rawUpdateAgentInput,
+ FLAT_AGENT_EDITABLE_PROPERTIES,
+ );
+ // GraphQL accepts an explicit null for any optional input, but isActive is never null
+ const updatedEditableAgentProperties = {
+ ...otherEditableAgentProperties,
+ ...(isDefined(isActive) ? { isActive } : {}),
+ };
+
+ const shouldOverride = isCallerOverridingEntity({
+ callerApplicationUniversalIdentifier,
+ entityApplicationUniversalIdentifier:
+ existingFlatAgent.applicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ isSystemSideEffect: false,
+ });
+
+ // The name identifies the agent to its application, so overriding the label keeps it
+ if (shouldOverride && isDefined(name) && name !== existingFlatAgent.name) {
+ throw new AiException(
+ 'Cannot rename an agent owned by another application',
+ AiExceptionCode.INVALID_AGENT_INPUT,
+ {
+ userFriendlyMessage: msg`An agent installed by an application cannot be renamed.`,
+ },
);
}
- const flatAgentToUpdate: FlatAgent = mergeUpdateInExistingRecord({
- existing: existingFlatAgent,
- properties: FLAT_AGENT_EDITABLE_PROPERTIES,
- update: updatedEditableAgentProperties,
+ const updatedName = computeUpdatedAgentName({
+ shouldOverride,
+ name,
+ label: updatedEditableAgentProperties.label,
});
+ const { overrides, updatedEditableProperties } =
+ sanitizeOverridableEntityInput({
+ metadataName: 'agent',
+ existingFlatEntity: existingFlatAgent,
+ updatedEditableProperties: {
+ ...updatedEditableAgentProperties,
+ ...(isDefined(updatedName) ? { name: updatedName } : {}),
+ },
+ shouldOverride,
+ callerApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ });
+
+ const flatAgentToUpdate: FlatAgent = {
+ ...mergeUpdateInExistingRecord({
+ existing: existingFlatAgent,
+ properties: FLAT_AGENT_EDITABLE_PROPERTIES,
+ update: updatedEditableProperties,
+ }),
+ overrides,
+ };
+
const {
flatRoleTargetToUpdate,
flatRoleTargetToCreate,
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai.exception.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai.exception.ts
index 9d3e3c7fb59..3859e14a466 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai.exception.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai.exception.ts
@@ -8,6 +8,7 @@ export enum AiExceptionCode {
AGENT_NOT_FOUND = 'AGENT_NOT_FOUND',
AGENT_ALREADY_EXISTS = 'AGENT_ALREADY_EXISTS',
AGENT_IS_STANDARD = 'AGENT_IS_STANDARD',
+ AGENT_IS_INACTIVE = 'AGENT_IS_INACTIVE',
AGENT_EXECUTION_FAILED = 'AGENT_EXECUTION_FAILED',
INVALID_AGENT_INPUT = 'INVALID_AGENT_INPUT',
THREAD_NOT_FOUND = 'THREAD_NOT_FOUND',
@@ -56,6 +57,8 @@ const getAiExceptionUserFriendlyMessage = (code: AiExceptionCode) => {
return msg`An agent with this name already exists.`;
case AiExceptionCode.AGENT_IS_STANDARD:
return msg`Standard agents cannot be modified.`;
+ case AiExceptionCode.AGENT_IS_INACTIVE:
+ return msg`This agent is archived.`;
case AiExceptionCode.AGENT_EXECUTION_FAILED:
return msg`Agent execution failed.`;
case AiExceptionCode.INVALID_AGENT_INPUT:
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/filters/ai-api-exception.filter.ts b/packages/twenty-server/src/engine/metadata-modules/ai/filters/ai-api-exception.filter.ts
index d44c2578159..9475bfb5af3 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/filters/ai-api-exception.filter.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/filters/ai-api-exception.filter.ts
@@ -50,6 +50,7 @@ export class AiRestApiExceptionFilter implements ExceptionFilter {
case AiExceptionCode.INVALID_AGENT_INPUT:
case AiExceptionCode.AGENT_ALREADY_EXISTS:
case AiExceptionCode.AGENT_IS_STANDARD:
+ case AiExceptionCode.AGENT_IS_INACTIVE:
return this.httpExceptionHandlerService.handleError(
exception,
response,
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/utils/ai-graphql-api-exception-handler.util.ts b/packages/twenty-server/src/engine/metadata-modules/ai/utils/ai-graphql-api-exception-handler.util.ts
index 5fd818dfecb..4c2bc8b4307 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/utils/ai-graphql-api-exception-handler.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/utils/ai-graphql-api-exception-handler.util.ts
@@ -51,6 +51,7 @@ export const aiGraphqlApiExceptionHandler = (error: Error) => {
case AiExceptionCode.CHAT_CHANNEL_BUSY:
throw new ConflictError(error);
case AiExceptionCode.AGENT_IS_STANDARD:
+ case AiExceptionCode.AGENT_IS_INACTIVE:
case AiExceptionCode.ROLE_CANNOT_BE_ASSIGNED_TO_AGENTS:
case AiExceptionCode.RUN_AS_WORKSPACE_MEMBER_NOT_ALLOWED:
case AiExceptionCode.RUN_AGENT_NOT_ALLOWED:
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-agent/constants/flat-agent-editable-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-agent/constants/flat-agent-editable-properties.constant.ts
index 92ceb117e56..e47468cbaea 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-agent/constants/flat-agent-editable-properties.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-agent/constants/flat-agent-editable-properties.constant.ts
@@ -10,4 +10,5 @@ export const FLAT_AGENT_EDITABLE_PROPERTIES = [
'responseFormat',
'modelConfiguration',
'triggers',
+ 'isActive',
] as const satisfies MetadataEntityPropertyName<'agent'>[];
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/__tests__/resolve-effective-agent.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/__tests__/resolve-effective-agent.util.spec.ts
new file mode 100644
index 00000000000..9490adc3b04
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/__tests__/resolve-effective-agent.util.spec.ts
@@ -0,0 +1,48 @@
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
+
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '00000000-0000-4000-8000-000000000002';
+
+const agentRow = {
+ id: '00000000-0000-4000-8000-000000000003',
+ name: 'researcher',
+ label: 'Researcher',
+ prompt: 'Research the company',
+ isActive: true,
+ triggers: [],
+};
+
+describe('resolveEffectiveAgent', () => {
+ it('applies workspace overrides to a repository row', () => {
+ expect(
+ resolveEffectiveAgent({
+ ...agentRow,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ prompt: 'Research the market',
+ isActive: false,
+ },
+ },
+ }),
+ ).toMatchObject({
+ name: 'researcher',
+ label: 'Researcher',
+ prompt: 'Research the market',
+ isActive: false,
+ });
+ });
+
+ it('returns the agent unchanged without overrides', () => {
+ const agent = { ...agentRow, overrides: null };
+
+ expect(resolveEffectiveAgent(agent)).toEqual(agent);
+ });
+
+ it('treats a row read before the isActive column existed as active', () => {
+ const { isActive: _isActive, ...rowWithoutIsActive } = agentRow;
+
+ expect(
+ resolveEffectiveAgent({ ...rowWithoutIsActive, overrides: null }),
+ ).toMatchObject({ isActive: true });
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/from-agent-entity-to-agent-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/from-agent-entity-to-agent-dto.util.ts
index 164c7ecf0fa..7d2eaee2e61 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/from-agent-entity-to-agent-dto.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/from-agent-entity-to-agent-dto.util.ts
@@ -1,38 +1,47 @@
import { type AgentDTO } from 'src/engine/metadata-modules/ai/ai-agent/dtos/agent.dto';
import { type FlatAgentWithRoleId } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
-export const fromFlatAgentWithRoleIdToAgentDto = ({
- applicationId,
- createdAt,
- description,
- icon,
- id,
- isSystem,
- label,
- modelConfiguration,
- modelId,
- name,
- prompt,
- responseFormat,
- triggers,
- updatedAt,
- workspaceId,
- roleId,
-}: FlatAgentWithRoleId): AgentDTO => ({
- createdAt: new Date(createdAt),
- description: description ?? undefined,
- id,
- isSystem,
- label,
- modelConfiguration: modelConfiguration ?? undefined,
- modelId,
- name,
- prompt,
- responseFormat,
- triggers,
- updatedAt: new Date(updatedAt),
- workspaceId,
- applicationId: applicationId ?? undefined,
- icon: icon ?? undefined,
- roleId: roleId ?? undefined,
-});
+export const fromFlatAgentWithRoleIdToAgentDto = (
+ flatAgentWithRoleId: FlatAgentWithRoleId,
+): AgentDTO => {
+ const {
+ applicationId,
+ createdAt,
+ description,
+ icon,
+ id,
+ isActive,
+ isSystem,
+ label,
+ modelConfiguration,
+ modelId,
+ name,
+ prompt,
+ responseFormat,
+ triggers,
+ updatedAt,
+ workspaceId,
+ roleId,
+ } = resolveEffectiveAgent(flatAgentWithRoleId);
+
+ return {
+ createdAt: new Date(createdAt),
+ description: description ?? undefined,
+ id,
+ isActive,
+ isSystem,
+ label,
+ modelConfiguration: modelConfiguration ?? undefined,
+ modelId,
+ name,
+ prompt,
+ responseFormat,
+ triggers,
+ updatedAt: new Date(updatedAt),
+ workspaceId,
+ applicationId: applicationId ?? undefined,
+ icon: icon ?? undefined,
+ roleId: roleId ?? undefined,
+ };
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util.ts
new file mode 100644
index 00000000000..2371687241f
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util.ts
@@ -0,0 +1,14 @@
+import { type AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { type OverridableFlatEntity } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util';
+import { resolveEffectiveFlatEntity } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util';
+
+// The upgrade-aware adapter hides isActive until its 2.53 instance command runs, and agents stay usable meanwhile
+export const resolveEffectiveAgent = <
+ TAgent extends OverridableFlatEntity & Partial<Pick<AgentEntity, 'isActive'>>,
+>(
+ agent: TAgent,
+): TAgent =>
+ resolveEffectiveFlatEntity({
+ metadataName: 'agent',
+ flatEntity: { ...agent, isActive: agent.isActive ?? true },
+ });
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/transform-agent-entity-to-flat-agent.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/transform-agent-entity-to-flat-agent.util.ts
index 6e01d5a191d..f3140f7e747 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/transform-agent-entity-to-flat-agent.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-agent/utils/transform-agent-entity-to-flat-agent.util.ts
@@ -39,6 +39,8 @@ export const transformAgentEntityToFlatAgent = ({
applicationId: agentEntity.applicationId,
modelConfiguration: agentEntity.modelConfiguration,
triggers: agentEntity.triggers,
+ isActive: agentEntity.isActive,
+ overrides: agentEntity.overrides,
applicationUniversalIdentifier,
};
};
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
index c21b5fb126c..860cd400cdb 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
@@ -13,12 +13,15 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma
"responseFormat",
"modelConfiguration",
"triggers",
+ "isActive",
+ "overrides",
"isSystem",
],
"propertiesToStringify": [
"responseFormat",
"modelConfiguration",
"triggers",
+ "overrides",
],
},
"agentChatChannel": {
@@ -400,9 +403,12 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma
"description",
"content",
"isActive",
+ "overrides",
"isSystem",
],
- "propertiesToStringify": [],
+ "propertiesToStringify": [
+ "overrides",
+ ],
},
"timelineActivityType": {
"propertiesToCompare": [
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/overridable-and-translatable-properties.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/overridable-and-translatable-properties.constant.spec.ts.snap
index ff6d7450f53..1080dc3e756 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/overridable-and-translatable-properties.constant.spec.ts.snap
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/overridable-and-translatable-properties.constant.spec.ts.snap
@@ -2,7 +2,16 @@
exports[`registry-derived override property maps derives the overridable properties for every metadata entity 1`] = `
{
- "agent": [],
+ "agent": [
+ "label",
+ "icon",
+ "description",
+ "prompt",
+ "modelId",
+ "responseFormat",
+ "modelConfiguration",
+ "isActive",
+ ],
"agentChatChannel": [],
"agentChatChannelRole": [],
"applicationVariable": [],
@@ -67,7 +76,13 @@ exports[`registry-derived override property maps derives the overridable propert
"rowLevelPermissionPredicateGroup": [],
"searchFieldMetadata": [],
"settingsMenuItem": [],
- "skill": [],
+ "skill": [
+ "label",
+ "icon",
+ "description",
+ "content",
+ "isActive",
+ ],
"timelineActivityType": [
"label",
"icon",
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/overridable-and-translatable-properties.constant.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/overridable-and-translatable-properties.constant.spec.ts
index 640e3df1a54..c415b2979dc 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/overridable-and-translatable-properties.constant.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/overridable-and-translatable-properties.constant.spec.ts
@@ -1,5 +1,7 @@
import { ALL_OVERRIDABLE_PROPERTIES_BY_METADATA_NAME } from 'src/engine/metadata-modules/overrides/constants/all-overridable-properties-by-metadata-name.constant';
+import { ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME } from 'src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant';
import { ALL_TRANSLATABLE_PROPERTIES_BY_METADATA_NAME } from 'src/engine/metadata-modules/flat-entity/constant/all-translatable-properties-by-metadata-name.constant';
+import { WORKSPACE_OWNED_PROPERTIES_BY_METADATA_NAME } from 'src/engine/metadata-modules/flat-entity/constant/workspace-owned-properties-by-metadata-name.constant';
describe('registry-derived override property maps', () => {
it('derives the overridable properties for every metadata entity', () => {
@@ -9,4 +11,39 @@ describe('registry-derived override property maps', () => {
it('derives the translatable properties for every metadata entity', () => {
expect(ALL_TRANSLATABLE_PROPERTIES_BY_METADATA_NAME).toMatchSnapshot();
});
+
+ it.each([
+ [
+ 'agent',
+ [
+ 'label',
+ 'icon',
+ 'description',
+ 'prompt',
+ 'modelId',
+ 'responseFormat',
+ 'modelConfiguration',
+ 'isActive',
+ ],
+ ],
+ ['skill', ['label', 'icon', 'description', 'content', 'isActive']],
+ ] as const)(
+ 'lets the workspace override the editable properties of an application %s',
+ (metadataName, overridableProperties) => {
+ expect(ALL_OVERRIDABLE_PROPERTIES_BY_METADATA_NAME[metadataName]).toEqual(
+ overridableProperties,
+ );
+ expect(
+ ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME[metadataName]
+ .overrides,
+ ).toEqual({
+ toCompare: true,
+ toStringify: true,
+ universalProperty: undefined,
+ });
+ expect(
+ WORKSPACE_OWNED_PROPERTIES_BY_METADATA_NAME[metadataName],
+ ).toBeUndefined();
+ },
+ );
});
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
index c7d4f2a8c37..3f8e1d969d6 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
@@ -954,38 +954,60 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
+ },
+ icon: {
+ toCompare: true,
+ toStringify: false,
+ universalProperty: undefined,
+ isOverridable: true,
},
- icon: { toCompare: true, toStringify: false, universalProperty: undefined },
description: {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
},
prompt: {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
},
modelId: {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
},
responseFormat: {
toCompare: true,
toStringify: true,
universalProperty: undefined,
+ isOverridable: true,
},
modelConfiguration: {
toCompare: true,
toStringify: true,
universalProperty: undefined,
+ isOverridable: true,
},
triggers: {
toCompare: true,
toStringify: true,
universalProperty: undefined,
},
+ isActive: {
+ isOverridable: true,
+ toCompare: true,
+ toStringify: false,
+ universalProperty: undefined,
+ },
+ overrides: {
+ toCompare: true,
+ toStringify: true,
+ universalProperty: undefined,
+ },
isSystem: {
toCompare: true,
toStringify: false,
@@ -1193,23 +1215,37 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
+ },
+ icon: {
+ toCompare: true,
+ toStringify: false,
+ universalProperty: undefined,
+ isOverridable: true,
},
- icon: { toCompare: true, toStringify: false, universalProperty: undefined },
description: {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
},
content: {
toCompare: true,
toStringify: false,
universalProperty: undefined,
+ isOverridable: true,
},
isActive: {
+ isOverridable: true,
toCompare: true,
toStringify: false,
universalProperty: undefined,
},
+ overrides: {
+ toCompare: true,
+ toStringify: true,
+ universalProperty: undefined,
+ },
isSystem: {
toCompare: true,
toStringify: false,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/workspace-owned-properties-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/workspace-owned-properties-by-metadata-name.constant.ts
index 56618ccc0d3..aeb58786a9b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/workspace-owned-properties-by-metadata-name.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/workspace-owned-properties-by-metadata-name.constant.ts
@@ -10,7 +10,6 @@ export const WORKSPACE_OWNED_PROPERTIES_BY_METADATA_NAME: Partial<{
}> = {
agentChatChannel: ['name', 'icon', 'color', 'position'],
pageLayout: ['isFirstTabPinned'],
- skill: ['isActive'],
view: ['createdByUserWorkspaceId'],
workflow: ['createdByUserWorkspaceId', 'workspaceWorkflowId', 'visibility'],
};
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/utils/__tests__/keep-workspace-owned-properties.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/utils/__tests__/keep-workspace-owned-properties.util.spec.ts
index db5ead11cde..e3ae1239247 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/utils/__tests__/keep-workspace-owned-properties.util.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/utils/__tests__/keep-workspace-owned-properties.util.spec.ts
@@ -69,33 +69,6 @@ describe('keepWorkspaceOwnedProperties', () => {
).toEqual(standardPageLayout);
});
- it('should keep a skill deactivated by the workspace', () => {
- const shippedSkill = {
- universalIdentifier: 'skill-universal-identifier',
- name: 'summarize',
- isActive: true,
- };
-
- const result = keepWorkspaceOwnedProperties({
- metadataName: 'skill',
- fromFlatEntityMaps: {
- byUniversalIdentifier: {
- 'skill-universal-identifier': { ...shippedSkill, isActive: false },
- },
- },
- toFlatEntityMaps: {
- byUniversalIdentifier: {
- 'skill-universal-identifier': shippedSkill,
- },
- },
- });
-
- expect(result.byUniversalIdentifier['skill-universal-identifier']).toEqual({
- ...shippedSkill,
- isActive: false,
- });
- });
-
it('should keep the creator of a view the workspace already has', () => {
const shippedView = {
universalIdentifier: 'view-universal-identifier',
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/__tests__/from-update-skill-input-to-flat-skill-to-update-or-throw.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/__tests__/from-update-skill-input-to-flat-skill-to-update-or-throw.util.spec.ts
new file mode 100644
index 00000000000..c6240d3d30b
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/__tests__/from-update-skill-input-to-flat-skill-to-update-or-throw.util.spec.ts
@@ -0,0 +1,127 @@
+import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
+import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
+import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
+import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
+import { fromFlatSkillToSkillDto } from 'src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util';
+import { fromUpdateSkillInputToFlatSkillToUpdateOrThrow } from 'src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util';
+
+const APPLICATION_UNIVERSAL_IDENTIFIER = '00000000-0000-4000-8000-000000000001';
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '00000000-0000-4000-8000-000000000002';
+
+const appSkill: FlatSkill = {
+ id: '00000000-0000-4000-8000-000000000003',
+ universalIdentifier: '00000000-0000-4000-8000-000000000004',
+ workspaceId: '00000000-0000-4000-8000-000000000005',
+ applicationId: '00000000-0000-4000-8000-000000000006',
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'summarize',
+ label: 'Summarize',
+ icon: 'IconBook',
+ description: null,
+ content: 'Summarize the record',
+ isSystem: false,
+ isActive: true,
+ overrides: null,
+ createdAt: '2026-10-01T00:00:00.000Z',
+ updatedAt: '2026-10-01T00:00:00.000Z',
+};
+
+const workspaceSkill: FlatSkill = {
+ ...appSkill,
+ id: '00000000-0000-4000-8000-000000000007',
+ universalIdentifier: '00000000-0000-4000-8000-000000000008',
+ applicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'translate',
+ label: 'Translate',
+};
+
+const flatSkillMaps = [appSkill, workspaceSkill].reduce<
+ FlatEntityMaps<FlatSkill>
+>(
+ (flatEntityMaps, flatEntity) =>
+ addFlatEntityToFlatEntityMapsOrThrow({ flatEntity, flatEntityMaps }),
+ createEmptyFlatEntityMaps(),
+);
+
+const updateAsWorkspace = (
+ updateSkillInput: Parameters<
+ typeof fromUpdateSkillInputToFlatSkillToUpdateOrThrow
+ >[0]['updateSkillInput'],
+) =>
+ fromUpdateSkillInputToFlatSkillToUpdateOrThrow({
+ flatSkillMaps,
+ updateSkillInput,
+ callerApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ workspaceCustomApplicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ });
+
+describe('fromUpdateSkillInputToFlatSkillToUpdateOrThrow', () => {
+ it('stores edits on another application skill as workspace overrides', () => {
+ const result = updateAsWorkspace({
+ id: appSkill.id,
+ name: appSkill.name,
+ label: 'Summarize briefly',
+ content: 'Summarize the record in one line',
+ isActive: false,
+ });
+
+ expect(result).toMatchObject({
+ name: 'summarize',
+ label: 'Summarize',
+ content: 'Summarize the record',
+ isActive: true,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ label: 'Summarize briefly',
+ content: 'Summarize the record in one line',
+ isActive: false,
+ },
+ },
+ });
+ expect(fromFlatSkillToSkillDto(result)).toMatchObject({
+ label: 'Summarize briefly',
+ content: 'Summarize the record in one line',
+ isActive: false,
+ });
+ });
+
+ it('ignores a null isActive instead of storing it', () => {
+ const result = updateAsWorkspace({
+ id: appSkill.id,
+ label: 'Summarize briefly',
+ isActive: null as unknown as boolean,
+ });
+
+ expect(result.isActive).toBe(true);
+ expect(
+ result.overrides?.[WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER],
+ ).toEqual({ label: 'Summarize briefly' });
+ expect(fromFlatSkillToSkillDto(result).isActive).toBe(true);
+ });
+
+ it('refuses to rename another application skill', () => {
+ expect(() =>
+ updateAsWorkspace({ id: appSkill.id, name: 'renamed' }),
+ ).toThrow('Cannot rename a skill owned by another application');
+ });
+
+ it('writes edits on a workspace skill to the skill itself', () => {
+ expect(
+ updateAsWorkspace({
+ id: workspaceSkill.id,
+ name: 'translate-to-french',
+ content: 'Translate to French',
+ isActive: false,
+ }),
+ ).toMatchObject({
+ name: 'translate-to-french',
+ content: 'Translate to French',
+ isActive: false,
+ overrides: null,
+ });
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/find-active-effective-flat-skills.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/find-active-effective-flat-skills.util.ts
new file mode 100644
index 00000000000..bb531f56b42
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/find-active-effective-flat-skills.util.ts
@@ -0,0 +1,18 @@
+import { isDefined } from 'twenty-shared/utils';
+
+import { type FlatSkillMaps } from 'src/engine/metadata-modules/flat-skill/types/flat-skill-maps.type';
+import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
+import { resolveEffectiveFlatEntity } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util';
+
+export const findActiveEffectiveFlatSkills = (
+ flatSkillMaps: FlatSkillMaps,
+): FlatSkill[] =>
+ Object.values(flatSkillMaps.byUniversalIdentifier)
+ .filter(isDefined)
+ .map((flatSkill) =>
+ resolveEffectiveFlatEntity({
+ metadataName: 'skill',
+ flatEntity: flatSkill,
+ }),
+ )
+ .filter((flatSkill) => flatSkill.isActive);
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-create-skill-input-to-flat-skill-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-create-skill-input-to-flat-skill-to-create.util.ts
index c6fe89f43d9..0580f8f03b6 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-create-skill-input-to-flat-skill-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-create-skill-input-to-flat-skill-to-create.util.ts
@@ -35,6 +35,7 @@ export const fromCreateSkillInputToUniversalFlatSkillToCreate = ({
content,
isSystem: false,
isActive: true,
+ overrides: null,
createdAt: now,
updatedAt: now,
applicationUniversalIdentifier: flatApplication.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util.ts
index 85d80db1234..31c3fd386f8 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util.ts
@@ -1,17 +1,25 @@
import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
+import { resolveEffectiveFlatEntity } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util';
import { type SkillDTO } from 'src/engine/metadata-modules/skill/dtos/skill.dto';
-export const fromFlatSkillToSkillDto = (flatSkill: FlatSkill): SkillDTO => ({
- id: flatSkill.id,
- name: flatSkill.name,
- label: flatSkill.label,
- icon: flatSkill.icon ?? undefined,
- description: flatSkill.description ?? undefined,
- content: flatSkill.content,
- isSystem: flatSkill.isSystem,
- isActive: flatSkill.isActive,
- workspaceId: flatSkill.workspaceId,
- applicationId: flatSkill.applicationId ?? undefined,
- createdAt: new Date(flatSkill.createdAt),
- updatedAt: new Date(flatSkill.updatedAt),
-});
+export const fromFlatSkillToSkillDto = (flatSkill: FlatSkill): SkillDTO => {
+ const effectiveFlatSkill = resolveEffectiveFlatEntity({
+ metadataName: 'skill',
+ flatEntity: flatSkill,
+ });
+
+ return {
+ id: effectiveFlatSkill.id,
+ name: effectiveFlatSkill.name,
+ label: effectiveFlatSkill.label,
+ icon: effectiveFlatSkill.icon ?? undefined,
+ description: effectiveFlatSkill.description ?? undefined,
+ content: effectiveFlatSkill.content,
+ isSystem: effectiveFlatSkill.isSystem,
+ isActive: effectiveFlatSkill.isActive,
+ workspaceId: effectiveFlatSkill.workspaceId,
+ applicationId: effectiveFlatSkill.applicationId ?? undefined,
+ createdAt: new Date(effectiveFlatSkill.createdAt),
+ updatedAt: new Date(effectiveFlatSkill.updatedAt),
+ };
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util.ts
index 62a61a26a84..c8d24159f97 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util.ts
@@ -1,9 +1,12 @@
+import { msg } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { FLAT_SKILL_EDITABLE_PROPERTIES } from 'src/engine/metadata-modules/flat-skill/constants/flat-skill-editable-properties.constant';
import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
+import { isCallerOverridingEntity } from 'src/engine/metadata-modules/overrides/utils/is-caller-overriding-entity.util';
+import { sanitizeOverridableEntityInput } from 'src/engine/metadata-modules/overrides/utils/sanitize-overridable-entity-input.util';
import { type UpdateSkillInput } from 'src/engine/metadata-modules/skill/dtos/update-skill.input';
import {
SkillException,
@@ -14,11 +17,13 @@ import { mergeUpdateInExistingRecord } from 'src/utils/merge-update-in-existing-
export const fromUpdateSkillInputToFlatSkillToUpdateOrThrow = ({
flatSkillMaps,
updateSkillInput,
- workspaceCustomApplicationId,
+ callerApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
}: {
flatSkillMaps: FlatEntityMaps<FlatSkill>;
updateSkillInput: UpdateSkillInput;
- workspaceCustomApplicationId: string;
+ callerApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationUniversalIdentifier: string;
}): FlatSkill => {
const existingFlatSkill = findFlatEntityByIdInFlatEntityMaps({
flatEntityId: updateSkillInput.id,
@@ -32,21 +37,61 @@ export const fromUpdateSkillInputToFlatSkillToUpdateOrThrow = ({
);
}
- if (existingFlatSkill.applicationId !== workspaceCustomApplicationId) {
+ const shouldOverride = isCallerOverridingEntity({
+ callerApplicationUniversalIdentifier,
+ entityApplicationUniversalIdentifier:
+ existingFlatSkill.applicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ isSystemSideEffect: false,
+ });
+
+ if (
+ !shouldOverride &&
+ existingFlatSkill.applicationUniversalIdentifier !==
+ workspaceCustomApplicationUniversalIdentifier
+ ) {
throw new SkillException(
'Cannot update standard skill',
SkillExceptionCode.SKILL_IS_STANDARD,
);
}
- const { id: _id, ...updates } = updateSkillInput;
+ const { id: _id, name, isActive, ...otherUpdates } = updateSkillInput;
+ // GraphQL accepts an explicit null for any optional input, but isActive is never null
+ const updates = {
+ ...otherUpdates,
+ ...(isDefined(isActive) ? { isActive } : {}),
+ };
+
+ if (shouldOverride && isDefined(name) && name !== existingFlatSkill.name) {
+ throw new SkillException(
+ 'Cannot rename a skill owned by another application',
+ SkillExceptionCode.INVALID_SKILL_INPUT,
+ {
+ userFriendlyMessage: msg`A skill installed by an application cannot be renamed.`,
+ },
+ );
+ }
+
+ const { overrides, updatedEditableProperties } =
+ sanitizeOverridableEntityInput({
+ metadataName: 'skill',
+ existingFlatEntity: existingFlatSkill,
+ updatedEditableProperties: shouldOverride
+ ? updates
+ : { ...updates, name },
+ shouldOverride,
+ callerApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ });
return {
...mergeUpdateInExistingRecord({
existing: existingFlatSkill,
properties: [...FLAT_SKILL_EDITABLE_PROPERTIES],
- update: updates,
+ update: updatedEditableProperties,
}),
+ overrides,
updatedAt: new Date().toISOString(),
};
};
diff --git a/packages/twenty-server/src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant.ts
new file mode 100644
index 00000000000..5e048cb13cb
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant.ts
@@ -0,0 +1,5 @@
+export const WORKSPACE_LOCAL_STATE_PROPERTIES: ReadonlySet<string> = new Set([
+ 'overrides',
+ 'universalOverrides',
+ 'isActive',
+]);
diff --git a/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util.ts b/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util.ts
index 548633f635d..fbc79a2fb67 100644
--- a/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util.ts
@@ -4,8 +4,9 @@ import { type MetadataEntityOverridablePropertyName } from 'src/engine/metadata-
import { type OverrideAuthorReadContext } from 'src/engine/metadata-modules/overrides/types/override-author-context.type';
import { readAuthoredOverrideProperty } from 'src/engine/metadata-modules/overrides/utils/read-authored-override-property.util';
+// Repository rows carry no applicationUniversalIdentifier; without it the owner entry is not ordered last
export type OverridableFlatEntity = {
- applicationUniversalIdentifier: string;
+ applicationUniversalIdentifier?: string;
overrides?: unknown;
};
diff --git a/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util.ts b/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util.ts
index 3f3472312d3..f5eb68454d4 100644
--- a/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util.ts
@@ -8,7 +8,7 @@ import {
} from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util';
export const resolveEffectiveFlatEntity = <
- TFlatEntity extends OverridableFlatEntity & Record<string, unknown>,
+ TFlatEntity extends OverridableFlatEntity,
>({
metadataName,
flatEntity,
diff --git a/packages/twenty-server/src/engine/metadata-modules/skill/entities/skill.entity.ts b/packages/twenty-server/src/engine/metadata-modules/skill/entities/skill.entity.ts
index d3d8d2c19e6..280188044d7 100644
--- a/packages/twenty-server/src/engine/metadata-modules/skill/entities/skill.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/skill/entities/skill.entity.ts
@@ -8,9 +8,18 @@ import {
} from 'typeorm';
import { ADD_IS_SYSTEM_TO_SKILL_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-40/add-is-system-to-skill-upgrade-command-name.constant';
+import { AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-53/agent-and-skill-overridable-entity-upgrade-command-name.constant';
import { WasIntroducedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-introduced-in-upgrade.decorator';
import { WasRemovedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-removed-in-upgrade.decorator';
-import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-entity.interface';
+import { OverridableEntity } from 'src/engine/workspace-manager/types/overridable-entity.type';
+
+export type SkillOverrides = {
+ label?: string;
+ icon?: string | null;
+ description?: string | null;
+ content?: string;
+ isActive?: boolean;
+};
@Entity('skill')
@Index('IDX_SKILL_APPLICATION_ID', ['applicationId'])
@@ -20,7 +29,7 @@ import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-enti
where: '"isActive" = true',
})
export class SkillEntity
- extends SyncableEntity
+ extends OverridableEntity<SkillOverrides>
implements Required<SkillEntity>
{
@PrimaryGeneratedColumn('uuid')
@@ -50,12 +59,13 @@ export class SkillEntity
@Column({ default: false })
isSystem: boolean;
- @Column({ default: true })
- isActive: boolean;
-
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
@UpdateDateColumn({ type: 'timestamptz' })
updatedAt: Date;
}
+
+WasIntroducedInUpgrade({
+ upgradeCommandName: AGENT_AND_SKILL_OVERRIDABLE_ENTITY_UPGRADE_COMMAND_NAME,
+})(SkillEntity.prototype, 'overrides');
diff --git a/packages/twenty-server/src/engine/metadata-modules/skill/skill.service.ts b/packages/twenty-server/src/engine/metadata-modules/skill/skill.service.ts
index b616050daa7..d45f3c413b3 100644
--- a/packages/twenty-server/src/engine/metadata-modules/skill/skill.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/skill/skill.service.ts
@@ -7,10 +7,12 @@ import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadat
import { findFlatEntityByIdInFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps-or-throw.util';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { type FlatSkill } from 'src/engine/metadata-modules/flat-skill/types/flat-skill.type';
+import { findActiveEffectiveFlatSkills } from 'src/engine/metadata-modules/flat-skill/utils/find-active-effective-flat-skills.util';
import { fromCreateSkillInputToUniversalFlatSkillToCreate } from 'src/engine/metadata-modules/flat-skill/utils/from-create-skill-input-to-flat-skill-to-create.util';
import { fromDeleteSkillInputToFlatSkillOrThrow } from 'src/engine/metadata-modules/flat-skill/utils/from-delete-skill-input-to-flat-skill-or-throw.util';
import { fromFlatSkillToSkillDto } from 'src/engine/metadata-modules/flat-skill/utils/from-flat-skill-to-skill-dto.util';
import { fromUpdateSkillInputToFlatSkillToUpdateOrThrow } from 'src/engine/metadata-modules/flat-skill/utils/from-update-skill-input-to-flat-skill-to-update-or-throw.util';
+import { dispatchIsActiveUpdateToAuthoredOverride } from 'src/engine/metadata-modules/overrides/utils/dispatch-is-active-update-to-authored-override.util';
import { type CreateSkillInput } from 'src/engine/metadata-modules/skill/dtos/create-skill.input';
import { type SkillDTO } from 'src/engine/metadata-modules/skill/dtos/skill.dto';
import { type UpdateSkillInput } from 'src/engine/metadata-modules/skill/dtos/update-skill.input';
@@ -40,8 +42,8 @@ export class SkillService {
return Object.values(flatSkillMaps.byUniversalIdentifier)
.filter(isDefined)
- .sort((a, b) => a.label.localeCompare(b.label))
- .map(fromFlatSkillToSkillDto);
+ .map(fromFlatSkillToSkillDto)
+ .sort((a, b) => a.label.localeCompare(b.label));
}
async findById(id: string, workspaceId: string): Promise<SkillDTO | null> {
@@ -140,7 +142,10 @@ export class SkillService {
const flatSkillToUpdate = fromUpdateSkillInputToFlatSkillToUpdateOrThrow({
flatSkillMaps: existingFlatSkillMaps,
updateSkillInput: input,
- workspaceCustomApplicationId: workspaceCustomFlatApplication.id,
+ callerApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
});
const validateAndBuildResult =
@@ -239,10 +244,9 @@ export class SkillService {
},
);
- return Object.values(flatSkillMaps.byUniversalIdentifier)
- .filter(isDefined)
- .filter((flatSkill) => flatSkill.isActive)
- .sort((a, b) => a.label.localeCompare(b.label));
+ return findActiveEffectiveFlatSkills(flatSkillMaps).sort((a, b) =>
+ a.label.localeCompare(b.label),
+ );
}
async findFlatSkillsByNames(
@@ -261,11 +265,9 @@ export class SkillService {
},
);
- return Object.values(flatSkillMaps.byUniversalIdentifier)
- .filter(isDefined)
- .filter(
- (flatSkill) => names.includes(flatSkill.name) && flatSkill.isActive,
- );
+ return findActiveEffectiveFlatSkills(flatSkillMaps).filter((flatSkill) =>
+ names.includes(flatSkill.name),
+ );
}
async findFlatSkillsByIds(
@@ -284,77 +286,28 @@ export class SkillService {
},
);
- return Object.values(flatSkillMaps.byUniversalIdentifier)
- .filter(isDefined)
- .filter((flatSkill) => ids.includes(flatSkill.id) && flatSkill.isActive);
+ return findActiveEffectiveFlatSkills(flatSkillMaps).filter((flatSkill) =>
+ ids.includes(flatSkill.id),
+ );
}
async activate(id: string, workspaceId: string): Promise<SkillDTO> {
- const { workspaceCustomFlatApplication } =
- await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
- { workspaceId },
- );
-
- const { flatSkillMaps } =
- await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
- {
- workspaceId,
- flatMapsKeys: ['flatSkillMaps'],
- },
- );
-
- const existingFlatSkill = findFlatEntityByIdInFlatEntityMapsOrThrow({
- flatEntityId: id,
- flatEntityMaps: flatSkillMaps,
- });
-
- const flatSkillToUpdate: FlatSkill = {
- ...existingFlatSkill,
- isActive: true,
- updatedAt: new Date().toISOString(),
- };
-
- const validateAndBuildResult =
- await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunWorkspaceMigration(
- {
- allFlatEntityOperationByMetadataName: {
- skill: {
- flatEntityToCreate: [],
- flatEntityToDelete: [],
- flatEntityToUpdate: [flatSkillToUpdate],
- },
- },
- workspaceId,
- isSystemBuild: false,
- applicationUniversalIdentifier:
- workspaceCustomFlatApplication.universalIdentifier,
- },
- );
-
- if (validateAndBuildResult.status === 'fail') {
- throw new WorkspaceMigrationBuilderException(
- validateAndBuildResult,
- 'Multiple validation errors occurred while activating skill',
- );
- }
-
- const { flatSkillMaps: recomputedFlatSkillMaps } =
- await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
- {
- workspaceId,
- flatMapsKeys: ['flatSkillMaps'],
- },
- );
-
- return fromFlatSkillToSkillDto(
- findFlatEntityByIdInFlatEntityMapsOrThrow({
- flatEntityId: id,
- flatEntityMaps: recomputedFlatSkillMaps,
- }),
- );
+ return this.setIsActive({ id, workspaceId, isActive: true });
}
async deactivate(id: string, workspaceId: string): Promise<SkillDTO> {
+ return this.setIsActive({ id, workspaceId, isActive: false });
+ }
+
+ private async setIsActive({
+ id,
+ workspaceId,
+ isActive,
+ }: {
+ id: string;
+ workspaceId: string;
+ isActive: boolean;
+ }): Promise<SkillDTO> {
const { workspaceCustomFlatApplication } =
await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
{ workspaceId },
@@ -374,8 +327,15 @@ export class SkillService {
});
const flatSkillToUpdate: FlatSkill = {
- ...existingFlatSkill,
- isActive: false,
+ ...dispatchIsActiveUpdateToAuthoredOverride({
+ metadataName: 'skill',
+ flatEntity: existingFlatSkill,
+ isActive,
+ authorUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ }),
updatedAt: new Date().toISOString(),
};
@@ -399,7 +359,7 @@ export class SkillService {
if (validateAndBuildResult.status === 'fail') {
throw new WorkspaceMigrationBuilderException(
validateAndBuildResult,
- 'Multiple validation errors occurred while deactivating skill',
+ `Multiple validation errors occurred while ${isActive ? 'activating' : 'deactivating'} skill`,
);
}
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util.ts
index a96ca9af679..4dc1c3b8245 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util.ts
@@ -58,6 +58,8 @@ export const createStandardAgentFlatMetadata = ({
isSystem,
modelConfiguration,
triggers: [],
+ isActive: true,
+ overrides: null,
workspaceId,
applicationId: twentyStandardApplicationId,
applicationUniversalIdentifier:
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-skill-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-skill-flat-metadata.util.ts
index 6eff4f46ba5..6b0395c5181 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-skill-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-skill-flat-metadata.util.ts
@@ -48,6 +48,7 @@ export const createStandardSkillFlatMetadata = ({
content,
isSystem,
isActive,
+ overrides: null,
workspaceId,
applicationId: twentyStandardApplicationId,
applicationUniversalIdentifier:
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-skill-validator.service.spec.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-skill-validator.service.spec.ts
new file mode 100644
index 00000000000..2597d0c0f1c
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-skill-validator.service.spec.ts
@@ -0,0 +1,101 @@
+import { FeatureFlagKey } from 'twenty-shared/types';
+import { v4 } from 'uuid';
+
+import { createEmptyAllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-all-flat-entity-maps.constant';
+import { TWENTY_STANDARD_APPLICATION } from 'src/engine/workspace-manager/twenty-standard-application/constants/twenty-standard-applications';
+import { type WorkspaceMigrationBuilderAdditionalCacheDataMaps } from 'src/engine/workspace-manager/workspace-migration/types/workspace-migration-builder-additional-cache-data-maps.type';
+import { type UniversalFlatSkill } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-skill.type';
+import { addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/add-universal-flat-entity-to-universal-flat-entity-maps-through-mutation-or-throw.util';
+import { type FlatEntityUpdateValidationArgs } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/types/universal-flat-entity-update-validation-args.type';
+import { FlatSkillValidatorService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-skill-validator.service';
+
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER = v4();
+const now = new Date().toISOString();
+
+const standardSkill: UniversalFlatSkill = {
+ universalIdentifier: v4(),
+ applicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION.universalIdentifier,
+ name: 'workflow-building',
+ label: 'Workflow Building',
+ icon: null,
+ description: null,
+ content: 'Build workflows',
+ isSystem: false,
+ isActive: true,
+ overrides: null,
+ createdAt: now,
+ updatedAt: now,
+};
+
+const buildFeatureFlagsMap =
+ (): WorkspaceMigrationBuilderAdditionalCacheDataMaps['featureFlagsMap'] =>
+ Object.values(FeatureFlagKey).reduce(
+ (featureFlagsMap, key) => ({ ...featureFlagsMap, [key]: false }),
+ {} as WorkspaceMigrationBuilderAdditionalCacheDataMaps['featureFlagsMap'],
+ );
+
+const validateWorkspaceUpdate = (
+ flatEntityUpdate: FlatEntityUpdateValidationArgs<'skill'>['flatEntityUpdate'],
+) => {
+ const optimisticFlatEntityMapsAndRelatedFlatEntityMaps =
+ createEmptyAllFlatEntityMaps();
+
+ addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow({
+ universalFlatEntity: standardSkill,
+ universalFlatEntityMapsToMutate:
+ optimisticFlatEntityMapsAndRelatedFlatEntityMaps.flatSkillMaps,
+ });
+
+ return new FlatSkillValidatorService().validateFlatSkillUpdate({
+ additionalCacheDataMaps: {
+ featureFlagsMap: buildFeatureFlagsMap(),
+ billingEntitlements: {},
+ },
+ optimisticFlatEntityMapsAndRelatedFlatEntityMaps,
+ finalFlatEntityMaps:
+ optimisticFlatEntityMapsAndRelatedFlatEntityMaps.flatSkillMaps,
+ workspaceId: v4(),
+ buildOptions: {
+ isSystemBuild: false,
+ applicationUniversalIdentifier:
+ WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ flatEntityUpdate,
+ universalIdentifier: standardSkill.universalIdentifier,
+ });
+};
+
+const errorCodes = (result: { errors: { code: string }[] }) =>
+ result.errors.map(({ code }) => code);
+
+describe('FlatSkillValidatorService', () => {
+ it('accepts workspace overrides on a standard skill', () => {
+ const result = validateWorkspaceUpdate({
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ label: 'Workspace label',
+ isActive: false,
+ },
+ },
+ });
+
+ expect(errorCodes(result)).toEqual([]);
+ });
+
+ it('refuses a direct edit of a standard skill', () => {
+ const result = validateWorkspaceUpdate({ label: 'Workspace label' });
+
+ expect(errorCodes(result)).toEqual(['SKILL_IS_STANDARD']);
+ });
+
+ it('refuses an override that empties the skill content', () => {
+ const result = validateWorkspaceUpdate({
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: { content: '' },
+ },
+ });
+
+ expect(errorCodes(result)).toEqual(['INVALID_SKILL_INPUT']);
+ });
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-agent-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-agent-validator.service.ts
index 926986adcbc..f68ae601ce4 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-agent-validator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-agent-validator.service.ts
@@ -5,6 +5,8 @@ import { ALL_METADATA_NAME } from 'twenty-shared/metadata';
import { isDefined } from 'twenty-shared/utils';
import { AiExceptionCode } from 'src/engine/metadata-modules/ai/ai.exception';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
+import { WORKSPACE_LOCAL_STATE_PROPERTIES } from 'src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant';
import { findFlatEntityByUniversalIdentifier } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-universal-identifier.util';
import { type UniversalFlatAgent } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-agent.type';
import { belongsToTwentyStandardApp } from 'src/engine/metadata-modules/utils/belongs-to-twenty-standard-app.util';
@@ -154,8 +156,13 @@ export class FlatAgentValidatorService {
return validationResult;
}
+ const isWorkspaceLocalStateUpdate = Object.keys(flatEntityUpdate).every(
+ (key) => WORKSPACE_LOCAL_STATE_PROPERTIES.has(key),
+ );
+
if (
!isCallerTwentyStandardApp(buildOptions) &&
+ !isWorkspaceLocalStateUpdate &&
belongsToTwentyStandardApp({
universalIdentifier: fromFlatAgent.universalIdentifier,
applicationUniversalIdentifier:
@@ -173,6 +180,9 @@ export class FlatAgentValidatorService {
...fromFlatAgent,
...flatEntityUpdate,
};
+ const effectiveOptimisticFlatAgent = isDefined(flatEntityUpdate.overrides)
+ ? resolveEffectiveAgent(optimisticFlatAgent)
+ : undefined;
const existingAgents = Object.values(
optimisticFlatAgentMaps.byUniversalIdentifier,
@@ -185,6 +195,11 @@ export class FlatAgentValidatorService {
flatAgent: optimisticFlatAgent,
updatedProperties: flatEntityUpdate,
}),
+ ...(isDefined(effectiveOptimisticFlatAgent)
+ ? validateAgentRequiredProperties({
+ flatAgent: effectiveOptimisticFlatAgent,
+ })
+ : []),
);
if (isDefined(flatEntityUpdate.name)) {
@@ -196,11 +211,14 @@ export class FlatAgentValidatorService {
);
}
- if (isDefined(flatEntityUpdate.responseFormat)) {
+ const responseFormatsToValidate = [
+ flatEntityUpdate.responseFormat,
+ effectiveOptimisticFlatAgent?.responseFormat,
+ ].filter(isDefined);
+
+ for (const responseFormat of responseFormatsToValidate) {
validationResult.errors.push(
- ...validateAgentResponseFormat({
- responseFormat: flatEntityUpdate.responseFormat,
- }),
+ ...validateAgentResponseFormat({ responseFormat }),
);
}
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-skill-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-skill-validator.service.ts
index 6f5bed9d0a8..98a35f538ca 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-skill-validator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-skill-validator.service.ts
@@ -4,9 +4,10 @@ import { msg, t } from '@lingui/core/macro';
import { ALL_METADATA_NAME } from 'twenty-shared/metadata';
import { isDefined } from 'twenty-shared/utils';
+import { WORKSPACE_LOCAL_STATE_PROPERTIES } from 'src/engine/metadata-modules/overrides/constants/workspace-local-state-properties.constant';
import { findFlatEntityByUniversalIdentifier } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-universal-identifier.util';
+import { resolveEffectiveFlatEntity } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity.util';
import { SkillExceptionCode } from 'src/engine/metadata-modules/skill/skill.exception';
-import { type UniversalFlatSkill } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-skill.type';
import { belongsToTwentyStandardApp } from 'src/engine/metadata-modules/utils/belongs-to-twenty-standard-app.util';
import { isCallerTwentyStandardApp } from 'src/engine/metadata-modules/utils/is-caller-twenty-standard-app.util';
import { type FailedFlatEntityValidation } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/builders/types/failed-flat-entity-validation.type';
@@ -141,10 +142,8 @@ export class FlatSkillValidatorService {
return validationResult;
}
- const isActiveUpdate = flatEntityUpdate.isActive;
-
- const hasNonIsActiveUpdates = Object.keys(flatEntityUpdate).some(
- (key) => key !== 'isActive',
+ const isWorkspaceLocalStateUpdate = Object.keys(flatEntityUpdate).every(
+ (key) => WORKSPACE_LOCAL_STATE_PROPERTIES.has(key),
);
const isTwentyStandardSkill = belongsToTwentyStandardApp({
@@ -156,44 +155,40 @@ export class FlatSkillValidatorService {
if (
!isCallerTwentyStandardApp(buildOptions) &&
isTwentyStandardSkill &&
- hasNonIsActiveUpdates
+ !isWorkspaceLocalStateUpdate
) {
validationResult.errors.push({
code: SkillExceptionCode.SKILL_IS_STANDARD,
- message: t`Cannot update standard skill properties (only activation/deactivation allowed)`,
- userFriendlyMessage: msg`Cannot update standard skill properties (only activation/deactivation allowed)`,
+ message: t`Cannot update standard skill properties (only overrides and activation/deactivation allowed)`,
+ userFriendlyMessage: msg`Cannot update standard skill properties (only overrides and activation/deactivation allowed)`,
});
}
- if (
- isTwentyStandardSkill &&
- isDefined(isActiveUpdate) &&
- !hasNonIsActiveUpdates
- ) {
- return validationResult;
- }
-
- const optimisticFlatSkill: UniversalFlatSkill = {
- ...fromFlatSkill,
- ...flatEntityUpdate,
- };
+ const optimisticFlatSkill = { ...fromFlatSkill, ...flatEntityUpdate };
- const labelUpdate = flatEntityUpdate.label;
-
- if (isDefined(labelUpdate)) {
+ if (isDefined(flatEntityUpdate.label)) {
validationResult.errors.push(
...validateSkillLabelIsDefined({ flatSkill: optimisticFlatSkill }),
);
}
- const contentUpdate = flatEntityUpdate.content;
-
- if (isDefined(contentUpdate)) {
+ if (isDefined(flatEntityUpdate.content)) {
validationResult.errors.push(
...validateSkillContentIsDefined({ flatSkill: optimisticFlatSkill }),
);
}
+ if (isDefined(flatEntityUpdate.overrides)) {
+ validationResult.errors.push(
+ ...validateSkillRequiredProperties({
+ flatSkill: resolveEffectiveFlatEntity({
+ metadataName: 'skill',
+ flatEntity: optimisticFlatSkill,
+ }),
+ }),
+ );
+ }
+
const nameUpdate = flatEntityUpdate.name;
if (isDefined(nameUpdate)) {
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/__tests__/workflow-schema.workspace-service.spec.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/__tests__/workflow-schema.workspace-service.spec.ts
new file mode 100644
index 00000000000..83a259bd9bf
--- /dev/null
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/__tests__/workflow-schema.workspace-service.spec.ts
@@ -0,0 +1,58 @@
+import { WorkflowActionType } from 'twenty-shared/workflow';
+
+import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
+import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
+import { WorkflowSchemaWorkspaceService } from 'src/modules/workflow/workflow-builder/workflow-schema/workflow-schema.workspace-service';
+
+const WORKSPACE_ID = 'workspace-id';
+const AGENT_ID = 'agent-id';
+const WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '00000000-0000-4000-8000-000000000002';
+
+describe('WorkflowSchemaWorkspaceService', () => {
+ it('computes an AI agent step output schema from the overridden response format', async () => {
+ const flatAgentMaps = addFlatEntityToFlatEntityMapsOrThrow({
+ flatEntity: {
+ id: AGENT_ID,
+ universalIdentifier: AGENT_ID,
+ workspaceId: WORKSPACE_ID,
+ responseFormat: { type: 'text' },
+ isActive: true,
+ deletedAt: null,
+ overrides: {
+ [WORKSPACE_CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER]: {
+ responseFormat: {
+ type: 'json',
+ schema: {
+ type: 'object',
+ properties: { summary: { type: 'string' } },
+ },
+ },
+ },
+ },
+ } as never,
+ flatEntityMaps: createEmptyFlatEntityMaps(),
+ });
+ const flatEntityMapsCacheService = {
+ getOrRecomputeManyOrAllFlatEntityMaps: jest
+ .fn()
+ .mockResolvedValue({ flatAgentMaps }),
+ };
+ const service = new WorkflowSchemaWorkspaceService(
+ {} as never,
+ flatEntityMapsCacheService as never,
+ );
+
+ const outputSchema = await service.computeStepOutputSchema({
+ step: {
+ type: WorkflowActionType.AI_AGENT,
+ settings: { input: { agentId: AGENT_ID } },
+ } as never,
+ workspaceId: WORKSPACE_ID,
+ });
+
+ expect(outputSchema).toEqual({
+ summary: expect.objectContaining({ isLeaf: true, type: 'string' }),
+ });
+ });
+});
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/workflow-schema.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/workflow-schema.workspace-service.ts
index 1277f7963ce..0001d1d5f1a 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/workflow-schema.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-schema/workflow-schema.workspace-service.ts
@@ -29,6 +29,7 @@ import {
import { type DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
import { checkStringIsDatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/utils/check-string-is-database-event-action';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.service';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { generateFakeValue } from 'src/engine/utils/generate-fake-value';
@@ -542,7 +543,13 @@ export class WorkflowSchemaWorkspaceService {
flatEntityMaps: flatAgentMaps,
});
- return computeAiAgentOutputSchema(flatAgent?.responseFormat);
+ if (!isDefined(flatAgent)) {
+ return computeAiAgentOutputSchema();
+ }
+
+ return computeAiAgentOutputSchema(
+ resolveEffectiveAgent(flatAgent).responseFormat,
+ );
}
private async computeFormActionOutputSchema({
diff --git a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts
index 1014e04ac64..add2a80814f 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts
@@ -1,5 +1,6 @@
import { Injectable } from '@nestjs/common';
+import { msg } from '@lingui/core/macro';
import { isNonEmptyString, isString } from '@sniptt/guards';
import { isDefined, isValidUuid, resolveInput } from 'twenty-shared/utils';
@@ -8,6 +9,7 @@ import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/inte
import { AgentRunnerService } from 'src/engine/metadata-modules/ai/ai-agent-execution/services/agent-runner.service';
import { buildStartedAgentRunSummary } from 'src/engine/metadata-modules/ai/ai-agent-execution/utils/build-started-agent-run-summary.util';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
+import { resolveEffectiveAgent } from 'src/engine/metadata-modules/flat-agent/utils/resolve-effective-agent.util';
import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
import {
@@ -88,17 +90,29 @@ export class AiAgentWorkflowAction implements WorkflowAction {
);
}
- const agent = await this.agentRepository.findOne(workspaceId, {
+ const agentRow = await this.agentRepository.findOne(workspaceId, {
where: { id: agentId },
});
- if (!isDefined(agent)) {
+ if (!isDefined(agentRow)) {
throw new WorkflowStepExecutorException(
`Agent with id ${agentId} not found`,
WorkflowStepExecutorExceptionCode.INVALID_STEP_INPUT,
);
}
+ const agent = resolveEffectiveAgent(agentRow);
+
+ if (!agent.isActive) {
+ const { label } = agent;
+
+ throw new WorkflowStepExecutorException(
+ `Agent "${label}" is archived`,
+ WorkflowStepExecutorExceptionCode.INVALID_STEP_INPUT,
+ { userFriendlyMessage: msg`Agent "${label}" is archived.` },
+ );
+ }
+
const executionContext =
await this.workflowExecutionContextService.getExecutionContext(runInfo);
diff --git a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap
index 2520857db08..20ef30e354b 100644
--- a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap
@@ -3,7 +3,7 @@
exports[`MCP agent tools (integration) should describe the agent tools to the model 1`] = `
[
{
- "description": "List the AI agents of the workspace with their prompt, model, role and triggers. System agents, such as those backing workflow AI steps, are not included. Agents installed by an application are listed, but only that application can change them.",
+ "description": "List the AI agents of the workspace with their prompt, model, role and triggers. System agents, such as those backing workflow AI steps, and archived agents are not included. Agents installed by an application are listed, but only that application can change them.",
"inputSchema": {
"properties": {},
"type": "object",
diff --git a/packages/twenty-server/test/integration/metadata/suites/agent/__snapshots__/failing-agent-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/agent/__snapshots__/failing-agent-update.integration-spec.ts.snap
index cb254416c5c..a6be63476f4 100644
--- a/packages/twenty-server/test/integration/metadata/suites/agent/__snapshots__/failing-agent-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/agent/__snapshots__/failing-agent-update.integration-spec.ts.snap
@@ -1,40 +1,5 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
-exports[`Agent update should fail should fail when attempting to update a standard agent 1`] = `
-{
- "extensions": {
- "code": "METADATA_VALIDATION_FAILED",
- "errors": {
- "agent": [
- {
- "errors": [
- {
- "code": "AGENT_IS_STANDARD",
- "message": "Cannot update standard agent",
- "userFriendlyMessage": "Cannot update standard agent",
- },
- ],
- "flatEntityMinimalInformation": {
- "universalIdentifier": Any<String>,
- },
- "metadataName": "agent",
- "status": "fail",
- "type": "update",
- },
- ],
- },
- "message": "Validation failed for 1 agent",
- "summary": {
- "agent": 1,
- "totalErrors": 1,
- },
- "userFriendlyMessage": "Cannot update standard agent",
- },
- "message": "Multiple validation errors occurred while updating agent",
- "name": "GraphQLError",
-}
-`;
-
exports[`Agent update should fail should fail when updating a non-existent agent 1`] = `
{
"extensions": {
diff --git a/packages/twenty-server/test/integration/metadata/suites/agent/failing-agent-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/agent/failing-agent-update.integration-spec.ts
index 384f1e28a75..2e6f3c0b919 100644
--- a/packages/twenty-server/test/integration/metadata/suites/agent/failing-agent-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/agent/failing-agent-update.integration-spec.ts
@@ -3,7 +3,6 @@ import { faker } from '@faker-js/faker';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { createOneAgent } from 'test/integration/metadata/suites/agent/utils/create-one-agent.util';
import { deleteOneAgent } from 'test/integration/metadata/suites/agent/utils/delete-one-agent.util';
-import { findAgents } from 'test/integration/metadata/suites/agent/utils/find-agents.util';
import { updateOneAgent } from 'test/integration/metadata/suites/agent/utils/update-one-agent.util';
import {
eachTestingContextFilter,
@@ -215,30 +214,4 @@ describe('Agent update should fail', () => {
errors,
});
});
-
- it('should fail when attempting to update a standard agent', async () => {
- const { data } = await findAgents({
- expectToFail: false,
- input: undefined,
- gqlFields: 'id name',
- });
-
- const helperAgent = data.findManyAgents.find(
- (agent) => agent.name === 'helper',
- );
-
- expect(helperAgent).toBeDefined();
-
- const { errors } = await updateOneAgent({
- expectToFail: true,
- input: {
- id: helperAgent!.id,
- label: 'Attempted Update to Standard Agent',
- },
- });
-
- expectOneNotInternalServerErrorSnapshot({
- errors,
- });
- });
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/agent/successful-agent-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/agent/successful-agent-update.integration-spec.ts
index cfc2c22619d..88f043b30b4 100644
--- a/packages/twenty-server/test/integration/metadata/suites/agent/successful-agent-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/agent/successful-agent-update.integration-spec.ts
@@ -6,6 +6,7 @@ import { DEFAULT_TOOL_INPUT_SCHEMA } from 'twenty-shared/logic-function';
import { type AgentResponseSchema } from 'twenty-shared/ai';
import { createOneAgent } from 'test/integration/metadata/suites/agent/utils/create-one-agent.util';
import { deleteOneAgent } from 'test/integration/metadata/suites/agent/utils/delete-one-agent.util';
+import { findAgents } from 'test/integration/metadata/suites/agent/utils/find-agents.util';
import { updateOneAgent } from 'test/integration/metadata/suites/agent/utils/update-one-agent.util';
describe('Agent update should succeed', () => {
@@ -320,4 +321,62 @@ describe('Agent update should succeed', () => {
triggers: [],
});
});
+
+ it('should store edits and the archive of another application agent as workspace overrides', async () => {
+ const { data } = await findAgents({
+ expectToFail: false,
+ input: undefined,
+ gqlFields: 'id name label',
+ });
+
+ const helperAgent = data.findManyAgents.find(
+ (agent) => agent.name === 'helper',
+ );
+
+ expect(helperAgent).toBeDefined();
+
+ try {
+ const { data: editData } = await updateOneAgent({
+ expectToFail: false,
+ input: {
+ id: helperAgent!.id,
+ label: 'Workspace helper',
+ isActive: false,
+ },
+ gqlFields: 'id label isActive',
+ });
+
+ expect(editData.updateOneAgent).toMatchObject({
+ label: 'Workspace helper',
+ isActive: false,
+ });
+
+ const [agentRow] = await global.testDataSource.query(
+ `SELECT label, "isActive", overrides FROM core."agent" WHERE id = $1`,
+ [helperAgent!.id],
+ );
+
+ expect(agentRow.label).toBe(helperAgent!.label);
+ expect(agentRow.isActive).toBe(true);
+ expect(Object.values(agentRow.overrides)).toEqual([
+ { label: 'Workspace helper', isActive: false },
+ ]);
+ } finally {
+ // Every spec shares the helper agent, so a failed assertion must not leave it archived
+ const { data: revertData } = await updateOneAgent({
+ expectToFail: false,
+ input: {
+ id: helperAgent!.id,
+ label: helperAgent!.label,
+ isActive: true,
+ },
+ gqlFields: 'id label isActive',
+ });
+
+ expect(revertData.updateOneAgent).toMatchObject({
+ label: helperAgent!.label,
+ isActive: true,
+ });
+ }
+ });
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
index 907b27d46d1..854d23d4921 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
@@ -3061,6 +3061,7 @@ This is a test skill.",
"isSystem": false,
"label": "Test Skill",
"name": "test-skill",
+ "overrides": null,
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-sync-agent-and-skill-overrides.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-sync-agent-and-skill-overrides.integration-spec.ts
new file mode 100644
index 00000000000..663664d77c7
--- /dev/null
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-sync-agent-and-skill-overrides.integration-spec.ts
@@ -0,0 +1,226 @@
+import { findAgents } from 'test/integration/metadata/suites/agent/utils/find-agents.util';
+import { updateOneAgent } from 'test/integration/metadata/suites/agent/utils/update-one-agent.util';
+import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
+import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
+import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
+import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';
+import { activateSkill } from 'test/integration/metadata/suites/skill/utils/activate-skill.util';
+import { deactivateSkill } from 'test/integration/metadata/suites/skill/utils/deactivate-skill.util';
+import { findSkills } from 'test/integration/metadata/suites/skill/utils/find-skills.util';
+import { updateSkill } from 'test/integration/metadata/suites/skill/utils/update-skill.util';
+import { type Manifest } from 'twenty-shared/application';
+import { v4 as uuidv4 } from 'uuid';
+
+const TEST_APP_ID = uuidv4();
+const TEST_ROLE_ID = uuidv4();
+const TEST_AGENT_ID = uuidv4();
+const TEST_SKILL_ID = uuidv4();
+
+const AGENT_GQL_FIELDS = 'id name label prompt isActive applicationId';
+const SKILL_GQL_FIELDS = 'id name label content isActive applicationId';
+
+const buildManifest = ({
+ agentLabel,
+ skillLabel,
+}: {
+ agentLabel: string;
+ skillLabel: string;
+}): Manifest =>
+ buildBaseManifest({
+ appId: TEST_APP_ID,
+ roleId: TEST_ROLE_ID,
+ overrides: {
+ agents: [
+ {
+ universalIdentifier: TEST_AGENT_ID,
+ name: 'override-test-agent',
+ label: agentLabel,
+ prompt: 'You are the application agent.',
+ },
+ ],
+ skills: [
+ {
+ universalIdentifier: TEST_SKILL_ID,
+ name: 'override-test-skill',
+ label: skillLabel,
+ content: 'Application skill content',
+ },
+ ],
+ },
+ });
+
+const findAppAgent = async () => {
+ const { data } = await findAgents({
+ gqlFields: AGENT_GQL_FIELDS,
+ expectToFail: false,
+ input: undefined,
+ });
+
+ return data.findManyAgents.find(
+ (agent) => agent.name === 'override-test-agent',
+ );
+};
+
+const findAppSkill = async () => {
+ const { data } = await findSkills({
+ gqlFields: SKILL_GQL_FIELDS,
+ expectToFail: false,
+ input: undefined,
+ });
+
+ return data.skills.find((skill) => skill.name === 'override-test-skill');
+};
+
+const findRow = async (table: 'agent' | 'skill') => {
+ const rows = await global.testDataSource.query(
+ `SELECT label, "isActive", overrides FROM core."${table}" WHERE "universalIdentifier" = $1`,
+ [table === 'agent' ? TEST_AGENT_ID : TEST_SKILL_ID],
+ );
+
+ return rows[0];
+};
+
+describe('Manifest sync - workspace overrides on agents and skills', () => {
+ beforeAll(async () => {
+ await setupApplicationForSync({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ name: 'Test Application',
+ description: 'App for testing agent and skill overrides',
+ sourcePath: 'test-manifest-sync-agent-skill-overrides',
+ });
+
+ await syncApplication({
+ manifest: buildManifest({
+ agentLabel: 'Application agent',
+ skillLabel: 'Application skill',
+ }),
+ expectToFail: false,
+ });
+ }, 60000);
+
+ afterAll(async () => {
+ await cleanupApplicationAndAppRegistration({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ });
+ });
+
+ it('should store workspace edits and archives as overrides', async () => {
+ const agent = await findAppAgent();
+ const skill = await findAppSkill();
+
+ expect(agent).toBeDefined();
+ expect(skill).toBeDefined();
+
+ const { data: agentData } = await updateOneAgent({
+ input: {
+ id: agent!.id,
+ name: agent!.name,
+ label: 'Workspace agent',
+ prompt: 'You are the workspace agent.',
+ isActive: false,
+ },
+ gqlFields: AGENT_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ expect(agentData.updateOneAgent).toMatchObject({
+ name: 'override-test-agent',
+ label: 'Workspace agent',
+ prompt: 'You are the workspace agent.',
+ isActive: false,
+ });
+
+ const { data: skillData } = await updateSkill({
+ input: {
+ id: skill!.id,
+ label: 'Workspace skill',
+ content: 'Workspace skill content',
+ },
+ gqlFields: SKILL_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ expect(skillData.updateSkill).toMatchObject({
+ label: 'Workspace skill',
+ content: 'Workspace skill content',
+ isActive: true,
+ });
+
+ await deactivateSkill({
+ input: { id: skill!.id },
+ gqlFields: SKILL_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ const agentRow = await findRow('agent');
+ const skillRow = await findRow('skill');
+
+ expect(agentRow.label).toBe('Application agent');
+ expect(agentRow.isActive).toBe(true);
+ expect(Object.values(agentRow.overrides)).toEqual([
+ {
+ label: 'Workspace agent',
+ prompt: 'You are the workspace agent.',
+ isActive: false,
+ },
+ ]);
+ expect(skillRow.label).toBe('Application skill');
+ expect(skillRow.isActive).toBe(true);
+ expect(Object.values(skillRow.overrides)).toEqual([
+ {
+ label: 'Workspace skill',
+ content: 'Workspace skill content',
+ isActive: false,
+ },
+ ]);
+ }, 60000);
+
+ it('should keep the overrides and the archive when the application syncs again', async () => {
+ await syncApplication({
+ manifest: buildManifest({
+ agentLabel: 'Application agent v2',
+ skillLabel: 'Application skill v2',
+ }),
+ expectToFail: false,
+ });
+
+ expect(await findAppAgent()).toMatchObject({
+ label: 'Workspace agent',
+ prompt: 'You are the workspace agent.',
+ isActive: false,
+ });
+ expect(await findAppSkill()).toMatchObject({
+ label: 'Workspace skill',
+ content: 'Workspace skill content',
+ isActive: false,
+ });
+
+ expect((await findRow('agent')).label).toBe('Application agent v2');
+ expect((await findRow('skill')).label).toBe('Application skill v2');
+ }, 60000);
+
+ it('should unarchive through the overrides', async () => {
+ const agent = await findAppAgent();
+ const skill = await findAppSkill();
+
+ await updateOneAgent({
+ input: { id: agent!.id, isActive: true },
+ gqlFields: AGENT_GQL_FIELDS,
+ expectToFail: false,
+ });
+ await activateSkill({
+ input: { id: skill!.id },
+ gqlFields: SKILL_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ expect((await findAppAgent())?.isActive).toBe(true);
+ expect((await findAppSkill())?.isActive).toBe(true);
+ expect(Object.values((await findRow('agent')).overrides)).toEqual([
+ { label: 'Workspace agent', prompt: 'You are the workspace agent.' },
+ ]);
+ expect(Object.values((await findRow('skill')).overrides)).toEqual([
+ { label: 'Workspace skill', content: 'Workspace skill content' },
+ ]);
+ }, 60000);
+});
diff --git a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
index 6a7cb4a3a75..63b7f1c6516 100644
--- a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
@@ -1,17 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Skill update should fail should fail when attempting to update a standard skill 1`] = `
-{
- "extensions": {
- "code": "FORBIDDEN",
- "subCode": "SKILL_IS_STANDARD",
- "userFriendlyMessage": "Standard skills cannot be modified.",
- },
- "message": "Cannot update standard skill",
- "name": "ForbiddenError",
-}
-`;
-
exports[`Skill update should fail should fail when updating a non-existent skill 1`] = `
{
"extensions": {
diff --git a/packages/twenty-server/test/integration/metadata/suites/skill/failing-skill-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/skill/failing-skill-update.integration-spec.ts
index 30292156c20..8f2e0a0784a 100644
--- a/packages/twenty-server/test/integration/metadata/suites/skill/failing-skill-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/skill/failing-skill-update.integration-spec.ts
@@ -1,9 +1,7 @@
import { faker } from '@faker-js/faker';
-import { STANDARD_SKILL } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-skill.constant';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { createSkill } from 'test/integration/metadata/suites/skill/utils/create-skill.util';
import { deleteSkill } from 'test/integration/metadata/suites/skill/utils/delete-skill.util';
-import { findSkills } from 'test/integration/metadata/suites/skill/utils/find-skills.util';
import { updateSkill } from 'test/integration/metadata/suites/skill/utils/update-skill.util';
import {
eachTestingContextFilter,
@@ -135,32 +133,4 @@ describe('Skill update should fail', () => {
errors,
});
});
-
- it('should fail when attempting to update a standard skill', async () => {
- const { data } = await findSkills({
- expectToFail: false,
- input: undefined,
- gqlFields: 'id name',
- });
-
- const standardSkill = data.skills.find((skill) =>
- Object.keys(STANDARD_SKILL).includes(skill.name),
- );
-
- if (!standardSkill) {
- return;
- }
-
- const { errors } = await updateSkill({
- expectToFail: true,
- input: {
- id: standardSkill.id,
- label: 'Attempted Update to Standard Skill',
- },
- });
-
- expectOneNotInternalServerErrorSnapshot({
- errors,
- });
- });
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/skill/successful-skill-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/skill/successful-skill-update.integration-spec.ts
index 5a9ab123f5a..254698bc145 100644
--- a/packages/twenty-server/test/integration/metadata/suites/skill/successful-skill-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/skill/successful-skill-update.integration-spec.ts
@@ -1,5 +1,7 @@
+import { STANDARD_SKILL } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-skill.constant';
import { createSkill } from 'test/integration/metadata/suites/skill/utils/create-skill.util';
import { deleteSkill } from 'test/integration/metadata/suites/skill/utils/delete-skill.util';
+import { findSkills } from 'test/integration/metadata/suites/skill/utils/find-skills.util';
import { updateSkill } from 'test/integration/metadata/suites/skill/utils/update-skill.util';
describe('Skill update should succeed', () => {
@@ -128,4 +130,54 @@ describe('Skill update should succeed', () => {
label: 'Unique Updated Label',
});
});
+
+ it('should store an update of a standard skill as a workspace override', async () => {
+ const { data } = await findSkills({
+ expectToFail: false,
+ input: undefined,
+ gqlFields: 'id name label',
+ });
+
+ const standardSkill = data.skills.find((skill) =>
+ Object.keys(STANDARD_SKILL).includes(skill.name),
+ );
+
+ expect(standardSkill).toBeDefined();
+
+ const { data: updateData } = await updateSkill({
+ expectToFail: false,
+ input: { id: standardSkill!.id, label: 'Zz workspace label' },
+ });
+
+ expect(updateData.updateSkill.label).toBe('Zz workspace label');
+
+ const [skillRow] = await global.testDataSource.query(
+ `SELECT label, overrides FROM core."skill" WHERE id = $1`,
+ [standardSkill!.id],
+ );
+
+ expect(skillRow.label).toBe(standardSkill!.label);
+ expect(Object.values(skillRow.overrides)).toEqual([
+ { label: 'Zz workspace label' },
+ ]);
+
+ const { data: listData } = await findSkills({
+ expectToFail: false,
+ input: undefined,
+ gqlFields: 'id label',
+ });
+ const listedLabels = listData.skills.map((skill) => skill.label);
+
+ expect(listedLabels).toContain('Zz workspace label');
+ expect(listedLabels).toEqual(
+ [...listedLabels].sort((left, right) => left.localeCompare(right)),
+ );
+
+ const { data: revertData } = await updateSkill({
+ expectToFail: false,
+ input: { id: standardSkill!.id, label: standardSkill!.label },
+ });
+
+ expect(revertData.updateSkill.label).toBe(standardSkill!.label);
+ });
});