-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
ποΈ Provider Configuration Foundation
Context
Establish the core architecture for managing LOCAL and OPENROUTER provider configurations with validation states and secure storage.
Task
Build the foundational data structures and validation system for provider configuration management.
Requirements
Provider Configuration Types
#[derive(Debug, Clone)]
pub enum ProviderType {
Local,
OpenRouter,
}
#[derive(Debug, Clone)]
pub struct ProviderConfig {
pub provider_type: ProviderType,
pub endpoint_url: Option<String>, // For LOCAL
pub api_key: Option<String>, // For OPENROUTER
pub validation_status: ValidationStatus,
}
#[derive(Debug, Clone, PartialEq)]
pub enum ValidationStatus {
Unchecked, // Initial state
Checking, // Validation in progress
Valid, // β
Connection successful
Invalid, // β Connection failed
}Settings Structure Extension
Extend existing Settings struct:
pub struct Settings {
pub theme_variant: ThemeVariant,
pub selected_theme_index: usize,
pub available_themes: Vec<ThemeVariant>,
// Provider configuration
pub local_provider: ProviderConfig,
pub openrouter_provider: ProviderConfig,
pub selected_provider_index: usize, // For UI navigation
pub focused_field: Option<ProviderField>,
}
#[derive(Debug, Clone)]
pub enum ProviderField {
LocalEndpoint,
OpenRouterApiKey,
}Settings Actions Extension
pub enum SettingsAction {
// Theme actions
ChangeTheme(ThemeVariant),
NavigateThemePrevious,
NavigateThemeNext,
// Provider actions
NavigateProviderPrevious,
NavigateProviderNext,
FocusField(ProviderField),
UpdateField(ProviderField, String),
ValidateProvider(ProviderType),
SaveConfiguration,
}Input Validation Rules
- LOCAL Endpoint: Must be valid URL format (http://localhost:* preferred)
- API Key Masking: Show only first 10 and last 3 characters after save
- Required Fields: At least one provider must be configured
- Connection Testing: Non-blocking async validation
Success Criteria
- β Provider configuration data structures defined
- β Validation status management system ready
- β Settings actions support provider operations
- β Clean separation between LOCAL and OPENROUTER configs
- β Extensible architecture for future providers
- β Secure handling of sensitive data (API keys)
Dependencies
- Requires: RUI-28 (Settings Module Foundation)
Metadata
Metadata
Assignees
Labels
No labels