Module: AgentHarness
- Defined in:
- lib/agent_harness.rb,
lib/agent_harness/errors.rb,
lib/agent_harness/version.rb,
lib/agent_harness/response.rb,
lib/agent_harness/configuration.rb,
lib/agent_harness/token_tracker.rb,
lib/agent_harness/error_taxonomy.rb,
lib/agent_harness/providers/base.rb,
lib/agent_harness/providers/aider.rb,
lib/agent_harness/providers/codex.rb,
lib/agent_harness/command_executor.rb,
lib/agent_harness/providers/cursor.rb,
lib/agent_harness/providers/gemini.rb,
lib/agent_harness/providers/adapter.rb,
lib/agent_harness/providers/kilocode.rb,
lib/agent_harness/providers/opencode.rb,
lib/agent_harness/providers/registry.rb,
lib/agent_harness/providers/anthropic.rb,
lib/agent_harness/orchestration/metrics.rb,
lib/agent_harness/orchestration/conductor.rb,
lib/agent_harness/providers/github_copilot.rb,
lib/agent_harness/orchestration/rate_limiter.rb,
lib/agent_harness/orchestration/health_monitor.rb,
lib/agent_harness/orchestration/circuit_breaker.rb,
lib/agent_harness/orchestration/provider_manager.rb
Overview
AgentHarness provides a unified interface for CLI-based AI coding agents.
It offers:
-
Unified interface for multiple AI coding agents (Claude Code, Cursor, Gemini CLI, etc.)
-
Full orchestration layer with provider switching, circuit breakers, and health monitoring
-
Flexible configuration via YAML, Ruby DSL, or environment variables
-
Dynamic provider registration for custom provider support
-
Token usage tracking for cost and limit calculations
Defined Under Namespace
Modules: ErrorTaxonomy, Orchestration, Providers Classes: AuthenticationError, CallbackRegistry, CircuitBreakerConfig, CircuitOpenError, CommandExecutionError, CommandExecutor, Configuration, ConfigurationError, Error, HealthCheckConfig, NoProvidersAvailableError, OrchestrationConfig, ProviderConfig, ProviderError, ProviderNotFoundError, ProviderUnavailableError, RateLimitConfig, RateLimitError, Response, RetryConfig, TimeoutError, TokenTracker
Constant Summary collapse
- VERSION =
"0.2.2"
Class Method Summary collapse
-
.conductor ⇒ Orchestration::Conductor
Returns the global conductor for orchestrated requests.
-
.configuration ⇒ Configuration
Returns the global configuration instance.
-
.configure {|Configuration| ... } ⇒ void
Configure AgentHarness with a block.
-
.logger ⇒ Logger?
Returns the global logger.
-
.provider(name) ⇒ Providers::Base
Get a provider instance.
-
.reset! ⇒ void
Reset configuration to defaults (useful for testing).
-
.send_message(prompt, provider: nil, **options) ⇒ Response
Send a message using the orchestration layer.
-
.token_tracker ⇒ TokenTracker
Returns the global token tracker.
Class Method Details
.conductor ⇒ Orchestration::Conductor
Returns the global conductor for orchestrated requests
66 67 68 |
# File 'lib/agent_harness.rb', line 66 def conductor @conductor ||= Orchestration::Conductor.new(config: configuration) end |
.configuration ⇒ Configuration
Returns the global configuration instance
33 34 35 |
# File 'lib/agent_harness.rb', line 33 def configuration @configuration ||= Configuration.new end |
.configure {|Configuration| ... } ⇒ void
This method returns an undefined value.
Configure AgentHarness with a block
40 41 42 |
# File 'lib/agent_harness.rb', line 40 def configure yield(configuration) if block_given? end |
.logger ⇒ Logger?
Returns the global logger
54 55 56 |
# File 'lib/agent_harness.rb', line 54 def logger configuration.logger end |
.provider(name) ⇒ Providers::Base
Get a provider instance
82 83 84 |
# File 'lib/agent_harness.rb', line 82 def provider(name) conductor.provider_manager.get_provider(name) end |
.reset! ⇒ void
This method returns an undefined value.
Reset configuration to defaults (useful for testing)
46 47 48 49 50 |
# File 'lib/agent_harness.rb', line 46 def reset! @configuration = nil @conductor = nil @token_tracker = nil end |
.send_message(prompt, provider: nil, **options) ⇒ Response
Send a message using the orchestration layer
75 76 77 |
# File 'lib/agent_harness.rb', line 75 def (prompt, provider: nil, **) conductor.(prompt, provider: provider, **) end |
.token_tracker ⇒ TokenTracker
Returns the global token tracker
60 61 62 |
# File 'lib/agent_harness.rb', line 60 def token_tracker @token_tracker ||= TokenTracker.new end |