Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
+194
-4
@@ -11,17 +11,18 @@ pub use cloud_object_models::{
|
||||
AgentModeCommandExecutionPredicate, DEFAULT_COMMAND_EXECUTION_ALLOWLIST,
|
||||
DEFAULT_COMMAND_EXECUTION_DENYLIST,
|
||||
};
|
||||
use galaxy_core::execution_mode::AppExecutionMode;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use indexmap::IndexMap;
|
||||
use regex::Regex;
|
||||
use serde::de::Deserializer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::{
|
||||
define_settings_group, RespectUserSyncSetting, Setting, SupportedPlatforms, SyncToCloud,
|
||||
define_settings_group, ChangeEventReason, RespectUserSyncSetting, Setting, SupportedPlatforms,
|
||||
SyncToCloud,
|
||||
};
|
||||
use strum::IntoEnumIterator;
|
||||
use strum_macros::EnumIter;
|
||||
use galaxy_core::execution_mode::AppExecutionMode;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use warpui::platform::keyboard::KeyCode;
|
||||
use warpui::platform::OperatingSystem;
|
||||
use warpui::{AppContext, Entity, ModelContext, SingletonEntity, UpdateModel};
|
||||
@@ -768,6 +769,122 @@ impl settings_value::SettingsValue for ToolbarCommandMap {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Default,
|
||||
Debug,
|
||||
Clone,
|
||||
Copy,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
EnumIter,
|
||||
schemars::JsonSchema,
|
||||
settings_value::SettingsValue,
|
||||
)]
|
||||
#[schemars(
|
||||
description = "Authentication method for AWS Bedrock.",
|
||||
rename_all = "snake_case"
|
||||
)]
|
||||
pub enum BedrockAuthMethod {
|
||||
#[default]
|
||||
#[serde(alias = "profile")]
|
||||
Profile,
|
||||
#[serde(alias = "static_keys")]
|
||||
StaticKeys,
|
||||
#[serde(alias = "sso")]
|
||||
Sso,
|
||||
}
|
||||
|
||||
settings::macros::implement_setting_for_enum!(
|
||||
BedrockAuthMethod,
|
||||
AISettings,
|
||||
SupportedPlatforms::DESKTOP,
|
||||
SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.bedrock.auth_method",
|
||||
description: "Authentication method for AWS Bedrock.",
|
||||
);
|
||||
|
||||
impl BedrockAuthMethod {
|
||||
pub fn display_name(&self) -> &'static str {
|
||||
match self {
|
||||
BedrockAuthMethod::Profile => "AWS Profile",
|
||||
BedrockAuthMethod::StaticKeys => "Static Keys",
|
||||
BedrockAuthMethod::Sso => "SSO",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Configuration for a single Bedrock model.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)]
|
||||
#[schemars(description = "Configuration for a single AWS Bedrock model.")]
|
||||
pub struct BedrockModelConfig {
|
||||
#[schemars(
|
||||
description = "The Bedrock model ID (e.g. anthropic.claude-sonnet-4-20250514-v1:0)."
|
||||
)]
|
||||
pub model_id: String,
|
||||
#[schemars(description = "Display name shown in the model picker.")]
|
||||
pub display_name: String,
|
||||
#[serde(default)]
|
||||
#[schemars(description = "Whether the model supports image/vision input.")]
|
||||
pub vision_supported: bool,
|
||||
}
|
||||
|
||||
impl settings_value::SettingsValue for BedrockModelConfig {}
|
||||
|
||||
fn default_context_size() -> u32 {
|
||||
200_000
|
||||
}
|
||||
|
||||
/// Configuration for a single OpenAI-compatible (LiteLLM) model.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)]
|
||||
#[schemars(description = "Configuration for a single OpenAI-compatible model (e.g. via LiteLLM).")]
|
||||
pub struct OpenAIModelConfig {
|
||||
#[schemars(
|
||||
description = "The model ID to send in the API request (e.g. claude-sonnet-4-20250514)."
|
||||
)]
|
||||
pub model_id: String,
|
||||
#[schemars(description = "Display name shown in the model picker.")]
|
||||
pub display_name: String,
|
||||
#[serde(default)]
|
||||
#[schemars(description = "Whether the model supports image/vision input.")]
|
||||
pub vision_supported: bool,
|
||||
#[serde(default = "default_context_size")]
|
||||
#[schemars(description = "Maximum context window size in tokens.")]
|
||||
pub context_size: u32,
|
||||
#[serde(default)]
|
||||
#[schemars(
|
||||
description = "Optional provider hint (e.g. anthropic, openai, google) for icon display."
|
||||
)]
|
||||
pub provider: Option<String>,
|
||||
}
|
||||
|
||||
impl settings_value::SettingsValue for OpenAIModelConfig {}
|
||||
|
||||
/// Configuration for a single OpenAI-compatible provider endpoint.
|
||||
///
|
||||
/// Multiple providers can be configured simultaneously (e.g. LiteLLM for cloud models,
|
||||
/// Ollama for local models, etc.). Each provider has its own endpoint, credentials, and model list.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)]
|
||||
#[schemars(
|
||||
description = "Configuration for an OpenAI-compatible provider endpoint (e.g. LiteLLM, Ollama, vLLM)."
|
||||
)]
|
||||
pub struct OpenAIProviderConfig {
|
||||
#[schemars(description = "Display name for this provider (shown in model picker).")]
|
||||
pub name: String,
|
||||
#[schemars(description = "Base URL for the OpenAI-compatible API endpoint.")]
|
||||
pub base_url: String,
|
||||
#[serde(default)]
|
||||
#[schemars(description = "API key for this endpoint (optional if the proxy handles auth).")]
|
||||
pub api_key: Option<String>,
|
||||
#[serde(default)]
|
||||
#[schemars(description = "Models available from this provider.")]
|
||||
pub models: Vec<OpenAIModelConfig>,
|
||||
}
|
||||
|
||||
impl settings_value::SettingsValue for OpenAIProviderConfig {}
|
||||
|
||||
define_settings_group!(AISettings, settings: [
|
||||
// If `false`, all AI features are disabled.
|
||||
is_any_ai_enabled: IsAnyAIEnabled {
|
||||
@@ -1094,7 +1211,7 @@ define_settings_group!(AISettings, settings: [
|
||||
private: true,
|
||||
}
|
||||
// Whether to use locally loaded AWS credentials for Bedrock-enabled requests.
|
||||
aws_bedrock_credentials_enabled: AwsBedrockCredentialsEnabled {
|
||||
bedrock_enabled: BedrockEnabled {
|
||||
type: bool,
|
||||
default: true,
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
@@ -1203,6 +1320,67 @@ define_settings_group!(AISettings, settings: [
|
||||
toml_path: "cloud_platform.third_party_api_keys.gemini_enterprise_credentials_enabled",
|
||||
description: "Whether Warp should route eligible requests through your workspace's Gemini Enterprise Google Cloud project.",
|
||||
}
|
||||
// Whether the OpenAI-compatible (LiteLLM) provider is enabled.
|
||||
openai_enabled: OpenAIEnabled {
|
||||
type: bool,
|
||||
default: false,
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.openai.enabled",
|
||||
description: "Whether to use an OpenAI-compatible endpoint (e.g. LiteLLM) for AI requests.",
|
||||
}
|
||||
// Base URL for the OpenAI-compatible API endpoint.
|
||||
openai_base_url: OpenAIBaseUrl {
|
||||
type: String,
|
||||
default: "http://localhost:4000/v1".to_string(),
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.openai.base_url",
|
||||
description: "Base URL for the OpenAI-compatible API endpoint (e.g. LiteLLM proxy).",
|
||||
}
|
||||
// API key for the OpenAI-compatible endpoint (optional if proxy handles auth).
|
||||
openai_api_key: OpenAIApiKey {
|
||||
type: String,
|
||||
default: String::new(),
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Never,
|
||||
private: false,
|
||||
toml_path: "ai.openai.api_key",
|
||||
description: "API key for the OpenAI-compatible endpoint (optional if proxy handles auth).",
|
||||
}
|
||||
// Model name to send to the OpenAI-compatible endpoint. Empty = use selected model ID.
|
||||
openai_model: OpenAIModel {
|
||||
type: String,
|
||||
default: String::new(),
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.openai.model",
|
||||
description: "Model name to send to the OpenAI-compatible endpoint. Leave empty to use the selected model ID.",
|
||||
}
|
||||
// Custom OpenAI-compatible model configurations (fetched from LiteLLM or manually configured).
|
||||
openai_models: OpenAIModels {
|
||||
type: Vec<OpenAIModelConfig>,
|
||||
default: Vec::new(),
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.openai.models",
|
||||
description: "Custom OpenAI-compatible model configurations (e.g. from LiteLLM).",
|
||||
}
|
||||
// Multiple OpenAI-compatible provider endpoints (LiteLLM, Ollama, vLLM, etc.).
|
||||
// Each provider has its own name, base_url, api_key, and model list.
|
||||
openai_providers: OpenAIProviders {
|
||||
type: Vec<OpenAIProviderConfig>,
|
||||
default: Vec::new(),
|
||||
supported_platforms: SupportedPlatforms::DESKTOP,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "ai.providers",
|
||||
description: "Multiple OpenAI-compatible provider endpoints (e.g. LiteLLM, Ollama, local models).",
|
||||
}
|
||||
// Whether or not the user wants agent mode requests to use their saved rules.
|
||||
memory_enabled: MemoryEnabled {
|
||||
type: bool,
|
||||
@@ -1349,6 +1527,18 @@ define_settings_group!(AISettings, settings: [
|
||||
private: true,
|
||||
}
|
||||
|
||||
// Used to determine whether the "What's new in Oz" section of the agent view
|
||||
// zero state is shown or hidden.
|
||||
should_show_oz_updates_in_zero_state: ShouldShowOzUpdatesInZeroState {
|
||||
type: bool,
|
||||
default: true,
|
||||
supported_platforms: SupportedPlatforms::ALL,
|
||||
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::Yes),
|
||||
private: false,
|
||||
toml_path: "agents.warp_agent.other.should_show_oz_updates_in_zero_state",
|
||||
description: "Whether the \"What's new\" section is shown in the agent view.",
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Whether or not the user has enabled fallback to Warp credits for user-provided models.
|
||||
|
||||
Reference in New Issue
Block a user