Module: AgentHarness::Providers::Adapter::ClassMethods
- Defined in:
- lib/agent_harness/providers/adapter.rb
Overview
Class methods that all providers must implement
Instance Method Summary collapse
-
#available? ⇒ Boolean
Check if provider CLI is available on the system.
-
#binary_name ⇒ String
CLI binary name.
-
#discover_models ⇒ Array<Hash>
Discover available models.
-
#firewall_requirements ⇒ Hash
Required domains for firewall configuration.
-
#install_command(version: nil) ⇒ Array<String>?
Build the install command from the provider installation contract.
-
#install_contract(version: nil) ⇒ Hash?
Installation contract for the provider CLI.
-
#installation_contract(**options) ⇒ Hash?
Installation contract for this provider’s CLI.
-
#instruction_file_paths ⇒ Array<Hash>
Paths to instruction files (e.g., CLAUDE.md, .cursorrules).
-
#provider_name ⇒ Symbol
Human-readable provider name.
-
#smoke_test_contract ⇒ Hash?
Canonical smoke-test contract for this provider.
Instance Method Details
#available? ⇒ Boolean
Check if provider CLI is available on the system
35 36 37 |
# File 'lib/agent_harness/providers/adapter.rb', line 35 def available? raise NotImplementedError, "#{self} must implement .available?" end |
#binary_name ⇒ String
CLI binary name
42 43 44 |
# File 'lib/agent_harness/providers/adapter.rb', line 42 def binary_name raise NotImplementedError, "#{self} must implement .binary_name" end |
#discover_models ⇒ Array<Hash>
Discover available models
74 75 76 |
# File 'lib/agent_harness/providers/adapter.rb', line 74 def discover_models [] end |
#firewall_requirements ⇒ Hash
Required domains for firewall configuration
60 61 62 |
# File 'lib/agent_harness/providers/adapter.rb', line 60 def firewall_requirements {domains: [], ip_ranges: []} end |
#install_command(version: nil) ⇒ Array<String>?
Build the install command from the provider installation contract.
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/agent_harness/providers/adapter.rb', line 97 def install_command(version: nil) contract = installation_contract return nil unless contract return contract[:install_command] unless version package_name = contract[:package_name] unless package_name raise ArgumentError, "installation_contract must define :package_name when overriding version" end Array(contract[:install_command_prefix]) + ["#{package_name}@#{version}"] end |
#install_contract(version: nil) ⇒ Hash?
Installation contract for the provider CLI.
Downstream applications can use this metadata to install a provider’s supported CLI without hardcoding package names, install flags, or version pins outside AgentHarness.
53 54 55 |
# File 'lib/agent_harness/providers/adapter.rb', line 53 def install_contract(version: nil) nil end |
#installation_contract(**options) ⇒ Hash?
Installation contract for this provider’s CLI.
Downstream apps can use this metadata to provision the provider CLI without hardcoding package names, versions, or binary expectations outside agent-harness.
86 87 88 89 90 |
# File 'lib/agent_harness/providers/adapter.rb', line 86 def installation_contract(**) return install_contract unless .key?(:version) install_contract(version: [:version]) end |
#instruction_file_paths ⇒ Array<Hash>
Paths to instruction files (e.g., CLAUDE.md, .cursorrules)
67 68 69 |
# File 'lib/agent_harness/providers/adapter.rb', line 67 def instruction_file_paths [] end |
#provider_name ⇒ Symbol
Human-readable provider name
28 29 30 |
# File 'lib/agent_harness/providers/adapter.rb', line 28 def provider_name raise NotImplementedError, "#{self} must implement .provider_name" end |
#smoke_test_contract ⇒ Hash?
Canonical smoke-test contract for this provider.
CLI-backed providers should expose a minimal real-execution prompt so downstream apps can reuse a stable provider-owned health check.
117 118 119 |
# File 'lib/agent_harness/providers/adapter.rb', line 117 def smoke_test_contract nil end |