diff --git a/app/controllers/api/v1/accounts/captain/config_controller.rb b/app/controllers/api/v1/accounts/captain/config_controller.rb index 8b59ad7a5..c028c89c5 100644 --- a/app/controllers/api/v1/accounts/captain/config_controller.rb +++ b/app/controllers/api/v1/accounts/captain/config_controller.rb @@ -5,7 +5,23 @@ class Api::V1::Accounts::Captain::ConfigController < Api::V1::Accounts::BaseCont render json: { providers: Llm::ConfigService.providers, models: Llm::ConfigService.models, - features: Llm::ConfigService.all_features_config + features: features_with_account_preferences } end + + private + + def features_with_account_preferences + preferences = Current.account.captain_preferences + account_features = preferences[:features] || {} + account_models = preferences[:models] || {} + + Llm::ConfigService.all_features_config.transform_keys(&:to_s).to_h do |feature_key, feature_config| + selected_model = account_models[feature_key] || feature_config[:default] + [feature_key, feature_config.merge( + enabled: account_features[feature_key] == true, + selected: selected_model + )] + end + end end diff --git a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue index 06d1e84ae..7671d141e 100644 --- a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue +++ b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue @@ -493,6 +493,13 @@ const menuItems = computed(() => { icon: 'i-lucide-briefcase', to: accountScopedRoute('general_settings_index'), }, + // TODO: Hide before merging to develop until we have a way to manage captain settings + { + name: 'Settings Captain', + label: t('SIDEBAR.CAPTAIN_AI'), + icon: 'i-lucide-sparkles', + to: accountScopedRoute('captain_settings_index'), + }, { name: 'Settings Agents', label: t('SIDEBAR.AGENTS'), @@ -589,13 +596,6 @@ const menuItems = computed(() => { icon: 'i-lucide-credit-card', to: accountScopedRoute('billing_settings_index'), }, - // Hidden until we have a way to manage captain settings - // { - // name: 'Settings Captain', - // label: t('SIDEBAR.CAPTAIN_AI'), - // icon: 'i-lucide-sparkles', - // to: accountScopedRoute('captain_settings_index'), - // }, ], }, ]; diff --git a/app/javascript/dashboard/routes/dashboard/settings/captain/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/captain/Index.vue index 1307b6d03..d133b7c7c 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/captain/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/captain/Index.vue @@ -1,8 +1,10 @@