agent-harness 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/agent_harness.rb CHANGED
@@ -70,10 +70,11 @@ module AgentHarness
70
70
  # Send a message using the orchestration layer
71
71
  # @param prompt [String] the prompt to send
72
72
  # @param provider [Symbol, nil] optional provider override
73
+ # @param executor [CommandExecutor, nil] per-request executor override
73
74
  # @param options [Hash] additional options
74
75
  # @return [Response] the response from the provider
75
- def send_message(prompt, provider: nil, **options)
76
- conductor.send_message(prompt, provider: provider, **options)
76
+ def send_message(prompt, provider: nil, executor: nil, **options)
77
+ conductor.send_message(prompt, provider: provider, executor: executor, **options)
77
78
  end
78
79
 
79
80
  # Get a provider instance
@@ -83,6 +84,64 @@ module AgentHarness
83
84
  conductor.provider_manager.get_provider(name)
84
85
  end
85
86
 
87
+ # Returns install metadata for a provider CLI when the provider exposes it.
88
+ #
89
+ # @param provider_name [Symbol, String] the provider name
90
+ # @param version [String, nil] optional explicit CLI version override
91
+ # @return [Hash, nil] installation metadata
92
+ def provider_install_contract(provider_name, version: nil)
93
+ provider_installation_contract(provider_name, **(version ? {version: version} : {}))
94
+ end
95
+
96
+ # Get the installation contract for a provider CLI.
97
+ #
98
+ # @param name [Symbol, String] the provider name
99
+ # @param options [Hash] optional target selection (for example, `version:`)
100
+ # @return [Hash, nil] provider installation contract for the requested target
101
+ # @raise [ConfigurationError] if provider not found
102
+ def provider_installation_contract(name, **options)
103
+ Providers::Registry.instance.installation_contract(name, **options)
104
+ end
105
+
106
+ # Get installation metadata for a provider CLI.
107
+ # @param provider_name [Symbol, String] the provider name
108
+ # @param options [Hash] optional target selection (for example, `version:`)
109
+ # @return [Hash, nil] installation contract
110
+ # @raise [ConfigurationError] if the provider name is not registered
111
+ def installation_contract(provider_name, **options)
112
+ Providers::Registry.instance.installation_contract(provider_name, **options)
113
+ end
114
+
115
+ # Get all provider installation contracts exposed by agent-harness.
116
+ # @return [Hash<Symbol, Hash>] installation contracts keyed by provider
117
+ def installation_contracts
118
+ Providers::Registry.instance.installation_contracts
119
+ end
120
+
121
+ # Get smoke-test metadata for a provider CLI when the provider exposes it.
122
+ #
123
+ # @param provider_name [Symbol, String] the provider name
124
+ # @return [Hash, nil] smoke-test contract
125
+ def provider_smoke_test_contract(provider_name)
126
+ smoke_test_contract(provider_name)
127
+ end
128
+
129
+ # Get smoke-test metadata for a provider CLI.
130
+ # @param provider_name [Symbol, String] the provider name
131
+ # @return [Hash, nil] smoke-test contract
132
+ # @raise [ConfigurationError] if the provider name is not registered
133
+ def smoke_test_contract(provider_name)
134
+ # Explicitly raise if provider is not registered to match documentation
135
+ raise ConfigurationError, "Unknown provider: #{provider_name}" unless Providers::Registry.instance.registered?(provider_name)
136
+ Providers::Registry.instance.smoke_test_contract(provider_name)
137
+ end
138
+
139
+ # Get all provider smoke-test contracts exposed by agent-harness.
140
+ # @return [Hash<Symbol, Hash>] smoke-test contracts keyed by provider
141
+ def smoke_test_contracts
142
+ Providers::Registry.instance.smoke_test_contracts
143
+ end
144
+
86
145
  # Check if authentication is valid for a provider
87
146
  # @param provider_name [Symbol] the provider name
88
147
  # @return [Boolean] true if auth is valid
@@ -120,17 +179,29 @@ module AgentHarness
120
179
  # authentication, provider health status, and config validation checks.
121
180
  #
122
181
  # @param timeout [Integer] timeout in seconds for each check (defaults to configured value)
182
+ # @raise [ArgumentError] if provider_runtime is supplied; runtime overrides are
183
+ # only supported by `check_provider` to avoid leaking one provider's execution
184
+ # context into every other health check
123
185
  # @return [Array<Hash>] health status for each provider
124
- def check_providers(timeout: nil)
125
- timeout ? ProviderHealthCheck.check_all(timeout: timeout) : ProviderHealthCheck.check_all
186
+ def check_providers(timeout: nil, executor: nil, provider_runtime: nil)
187
+ raise ArgumentError, "provider_runtime is only supported for single-provider health checks" unless provider_runtime.nil?
188
+
189
+ options = {}
190
+ options[:timeout] = timeout unless timeout.nil?
191
+ options[:executor] = executor unless executor.nil?
192
+ ProviderHealthCheck.check_all(**options)
126
193
  end
127
194
 
128
195
  # Check health of a single provider
129
196
  # @param provider_name [Symbol] the provider name
130
197
  # @param timeout [Integer, nil] timeout in seconds (nil lets ProviderHealthCheck apply its validated default)
131
198
  # @return [Hash] health status with :name, :status, :message, :latency_ms
132
- def check_provider(provider_name, timeout: nil)
133
- timeout ? ProviderHealthCheck.check(provider_name, timeout: timeout) : ProviderHealthCheck.check(provider_name)
199
+ def check_provider(provider_name, timeout: nil, executor: nil, provider_runtime: nil)
200
+ options = {}
201
+ options[:timeout] = timeout unless timeout.nil?
202
+ options[:executor] = executor unless executor.nil?
203
+ options[:provider_runtime] = provider_runtime unless provider_runtime.nil?
204
+ ProviderHealthCheck.check(provider_name, **options)
134
205
  end
135
206
  end
136
207
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent-harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan
@@ -9,6 +9,26 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.6'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '1.6'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '2.0'
12
32
  - !ruby/object:Gem::Dependency
13
33
  name: rake
14
34
  requirement: !ruby/object:Gem::Requirement