diff --git a/etc/flowforge.yml b/etc/flowforge.yml index 6bf59658d9..949b8bdbd1 100644 --- a/etc/flowforge.yml +++ b/etc/flowforge.yml @@ -67,6 +67,14 @@ driver: # public_url: ws://localhost:4881 +################################################# +# AI Configuration # +################################################# + +# ai: +# enabled: true + + ################################################# # Assistant Configuration # ################################################# @@ -127,4 +135,4 @@ rate_limits: # Create Default Admin # ################################################# # create_admin: false -# create_admin_access_token: false \ No newline at end of file +# create_admin_access_token: false diff --git a/forge/ee/lib/index.js b/forge/ee/lib/index.js index 75c472a704..b9d72cd14e 100644 --- a/forge/ee/lib/index.js +++ b/forge/ee/lib/index.js @@ -38,6 +38,9 @@ module.exports = fp(async function (app, opts) { // Expert await app.register(require('./expert')) + // Set the AI Features Flag (global gate for all AI features) + app.config.features.register('ai', app.config?.ai?.enabled ?? true, true) + // Set the Generate Snapshot Description Feature Flag app.config.features.register('generatedSnapshotDescription', true, true) diff --git a/forge/lib/features.js b/forge/lib/features.js index 17bef62554..7be6973bd0 100644 --- a/forge/lib/features.js +++ b/forge/lib/features.js @@ -20,6 +20,7 @@ const featureList = [ 'instanceResources', 'tables', 'certifiedNodes', + 'ai', 'assistantInlineCompletions', 'generatedSnapshotDescription', 'ffNodes', @@ -47,6 +48,7 @@ const featureNames = { instanceResources: 'Instance Resources', tables: 'Tables', certifiedNodes: 'Certified Nodes', + ai: 'AI Features', assistantInlineCompletions: 'Assistant Inline Code Completions', generatedSnapshotDescription: 'Generate Snapshot Descriptions', ffNodes: 'FlowFuse Exclusive Nodes', diff --git a/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue b/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue index 6842974da5..985aaf6eb9 100644 --- a/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue +++ b/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue @@ -172,9 +172,9 @@
Persistent File storage limit (Mb) Persistent Context storage limit (Mb) @@ -419,6 +419,14 @@ export default { }, computed: { ...mapState(useAccountSettingsStore, ['features']), + teamTypeFeatureList () { + return this.featureList.filter(feature => { + if (!Object.prototype.hasOwnProperty.call(this.features, feature)) { + return true + } + return this.features[feature] !== false + }) + }, formValid () { return (this.input.name) }, @@ -436,7 +444,8 @@ export default { return !!this.features.billing }, teamBrokerEnabled () { - return !!this.input.properties.features.teamBroker + const disabledOnPlatform = Object.prototype.hasOwnProperty.call(this.features, 'teamBroker') && this.features.teamBroker === false + return !disabledOnPlatform && !!this.input.properties.features.teamBroker }, autoStackUpdateEnforced () { return !!this.input.properties.autoStackUpdate?.enabled diff --git a/frontend/src/stores/account-settings.js b/frontend/src/stores/account-settings.js index a2c1f5ed13..e47c1f0049 100644 --- a/frontend/src/stores/account-settings.js +++ b/frontend/src/stores/account-settings.js @@ -22,6 +22,7 @@ const FEATURE_CONFIGS = [ { output: 'isGitIntegrationFeatureEnabled', platformKey: 'gitIntegration', teamKey: 'gitIntegration' }, { output: 'isInstanceResourcesFeatureEnabled', platformKey: 'instanceResources', teamKey: 'instanceResources' }, { output: 'isTablesFeatureEnabled', platformKey: 'tables', teamKey: 'tables' }, + { output: 'isAiFeatureEnabled', platformKey: 'ai', teamKey: 'ai' }, { output: 'isGeneratedSnapshotDescriptionFeatureEnabled', platformKey: 'generatedSnapshotDescription', teamKey: 'generatedSnapshotDescription' }, { output: 'isApplicationsRBACFeatureEnabled', platformKey: 'rbacApplication', teamKey: 'rbacApplication' },