Module: AgentSettings::Registry Private
- Defined in:
- lib/agent_settings/registry.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Registry mapping agent symbols to their adapter classes.
The Registry is responsible for knowing which adapters exist and providing the correct adapter instance for a given agent symbol. It also defines the list of supported agents.
Constant Summary collapse
- AGENTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
List of supported agent symbols.
%i[claude opencode codex].freeze
Class Method Summary collapse
-
.adapter(agent) ⇒ Object
private
Get the adapter instance for an agent.
Class Method Details
.adapter(agent) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get the adapter instance for an agent.
Returns a new instance of the appropriate adapter class for the given agent symbol. Uses pattern matching to select the adapter.
29 30 31 32 33 34 35 36 37 |
# File 'lib/agent_settings/registry.rb', line 29 def adapter(agent) case agent in :claude then Adapters::Claude.new in :opencode then Adapters::Opencode.new in :codex then Adapters::Codex.new else raise UnknownAgentError, "Unknown agent: #{agent}. Supported: #{AGENTS.join(", ")}" end end |