Class: Aidp::ProviderManager
- Inherits:
-
Object
- Object
- Aidp::ProviderManager
- Defined in:
- lib/aidp/provider_manager.rb
Class Method Summary collapse
-
.clear_cache ⇒ Object
Clear provider cache.
-
.create_harness_provider(provider_name, options = {}) ⇒ Object
Create provider using harness configuration.
-
.get_all_providers(options = {}) ⇒ Object
Get all configured providers.
-
.get_enabled_providers(options = {}) ⇒ Object
Get enabled providers.
-
.get_harness_factory ⇒ Object
Get harness factory instance.
- .get_provider(provider_type, options = {}) ⇒ Object
-
.get_provider_capabilities(provider_name, options = {}) ⇒ Object
Get provider capabilities.
-
.get_provider_models(provider_name, options = {}) ⇒ Object
Get provider models.
-
.get_providers_by_priority(options = {}) ⇒ Object
Get providers by priority.
- .load_from_config(config = {}, options = {}) ⇒ Object
-
.provider_configured?(provider_name, options = {}) ⇒ Boolean
Check if provider is configured.
-
.provider_enabled?(provider_name, options = {}) ⇒ Boolean
Check if provider is enabled.
-
.provider_supports_feature?(provider_name, feature, options = {}) ⇒ Boolean
Check if provider supports feature.
-
.reload_config ⇒ Object
Reload configuration.
-
.validate_all_provider_configs(options = {}) ⇒ Object
Validate all provider configurations.
-
.validate_provider_config(provider_name, options = {}) ⇒ Object
Validate provider configuration.
Class Method Details
.clear_cache ⇒ Object
Clear provider cache
121 122 123 |
# File 'lib/aidp/provider_manager.rb', line 121 def clear_cache @harness_factory&.clear_cache end |
.create_harness_provider(provider_name, options = {}) ⇒ Object
Create provider using harness configuration
32 33 34 35 36 37 |
# File 'lib/aidp/provider_manager.rb', line 32 def create_harness_provider(provider_name, = {}) factory = get_harness_factory raise "Harness factory not available" unless factory factory.create_provider(provider_name, ) end |
.get_all_providers(options = {}) ⇒ Object
Get all configured providers
40 41 42 43 44 45 |
# File 'lib/aidp/provider_manager.rb', line 40 def get_all_providers( = {}) factory = get_harness_factory return [] unless factory factory.create_all_providers() end |
.get_enabled_providers(options = {}) ⇒ Object
Get enabled providers
56 57 58 59 60 61 62 |
# File 'lib/aidp/provider_manager.rb', line 56 def get_enabled_providers( = {}) factory = get_harness_factory return [] unless factory enabled_names = factory.enabled_providers() factory.create_providers(enabled_names, ) end |
.get_harness_factory ⇒ Object
Get harness factory instance
22 23 24 25 26 27 28 29 |
# File 'lib/aidp/provider_manager.rb', line 22 def get_harness_factory @harness_factory ||= begin require_relative "harness/config_manager" Aidp::Harness::ProviderFactory.new rescue LoadError nil end end |
.get_provider(provider_type, options = {}) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/aidp/provider_manager.rb', line 9 def get_provider(provider_type, = {}) factory = get_harness_factory raise "Harness factory not available" unless factory factory.create_provider(provider_type, ) end |
.get_provider_capabilities(provider_name, options = {}) ⇒ Object
Get provider capabilities
81 82 83 84 85 86 |
# File 'lib/aidp/provider_manager.rb', line 81 def get_provider_capabilities(provider_name, = {}) factory = get_harness_factory return [] unless factory factory.provider_capabilities(provider_name, ) end |
.get_provider_models(provider_name, options = {}) ⇒ Object
Get provider models
97 98 99 100 101 102 |
# File 'lib/aidp/provider_manager.rb', line 97 def get_provider_models(provider_name, = {}) factory = get_harness_factory return [] unless factory factory.provider_models(provider_name, ) end |
.get_providers_by_priority(options = {}) ⇒ Object
Get providers by priority
48 49 50 51 52 53 |
# File 'lib/aidp/provider_manager.rb', line 48 def get_providers_by_priority( = {}) factory = get_harness_factory return [] unless factory factory.create_providers_by_priority() end |
.load_from_config(config = {}, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/aidp/provider_manager.rb', line 16 def load_from_config(config = {}, = {}) provider_type = config["provider"] || "cursor" get_provider(provider_type, ) end |
.provider_configured?(provider_name, options = {}) ⇒ Boolean
Check if provider is configured
65 66 67 68 69 70 |
# File 'lib/aidp/provider_manager.rb', line 65 def provider_configured?(provider_name, = {}) factory = get_harness_factory return false unless factory factory.configured_providers().include?(provider_name.to_s) end |
.provider_enabled?(provider_name, options = {}) ⇒ Boolean
Check if provider is enabled
73 74 75 76 77 78 |
# File 'lib/aidp/provider_manager.rb', line 73 def provider_enabled?(provider_name, = {}) factory = get_harness_factory return false unless factory factory.enabled_providers().include?(provider_name.to_s) end |
.provider_supports_feature?(provider_name, feature, options = {}) ⇒ Boolean
Check if provider supports feature
89 90 91 92 93 94 |
# File 'lib/aidp/provider_manager.rb', line 89 def provider_supports_feature?(provider_name, feature, = {}) factory = get_harness_factory return false unless factory factory.provider_supports_feature?(provider_name, feature, ) end |
.reload_config ⇒ Object
Reload configuration
126 127 128 |
# File 'lib/aidp/provider_manager.rb', line 126 def reload_config @harness_factory&.reload_config end |
.validate_all_provider_configs(options = {}) ⇒ Object
Validate all provider configurations
113 114 115 116 117 118 |
# File 'lib/aidp/provider_manager.rb', line 113 def validate_all_provider_configs( = {}) factory = get_harness_factory return {} unless factory factory.validate_all_provider_configs() end |
.validate_provider_config(provider_name, options = {}) ⇒ Object
Validate provider configuration
105 106 107 108 109 110 |
# File 'lib/aidp/provider_manager.rb', line 105 def validate_provider_config(provider_name, = {}) factory = get_harness_factory return ["Harness factory not available"] unless factory factory.validate_provider_config(provider_name, ) end |