agent-harness 0.12.0 → 0.13.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e1a243bc20db360b93c22248fd0b35864a995dd6a78def3fdca291d5e39809d
4
- data.tar.gz: 591bc4baf70eeb598b4c7a6736b4c0090b7108c6f34628b75a1b5b68eb991805
3
+ metadata.gz: 5248389a9a7500880e23672e9daad822c4c2038f5424ed2b278ab7c6276cf9a5
4
+ data.tar.gz: 806895feee0bd65477498453d32de90985849a70476560dabd7f0330995db6a2
5
5
  SHA512:
6
- metadata.gz: 1028da8c56be8d3f7e948dd23bfd25fbfae3515d1f678fe5c9b5172f5f5a82dbd0fad959ef94d2681619fdf44a6d509dcfc925bc20fb2d3e4e2c92f44ea19d9a
7
- data.tar.gz: f8ed1ca7bccfa683eee9303a977920d177a62832b48d937b01c107407890ea60b17680030cf4bc8ca3cd3bdf495def3d90518da89943d55306239ee15869c0c2
6
+ metadata.gz: 48652585f74b61a2a70a4c118a23cb93977dca88e743ec76cd6c12802cb005cc24c703f25b0994a8b5d423f59114be93c8ab040f957191ac782d6260f6d5ffde
7
+ data.tar.gz: f37ece29dc1dbd311713abd42aeb99363f7bf41ede1e31185fea16c41a312ace62d8247fb3e6034a38ac519797c131000480832921376141a2fe88bbc2b6e822
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.12.0"
2
+ ".": "0.13.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.13.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.12.0...agent-harness/v0.13.0) (2026-05-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * Expose public parse_container_output method on provider interface ([#187](https://github.com/viamin/agent-harness/issues/187)) ([ecdb7ba](https://github.com/viamin/agent-harness/commit/ecdb7bac56e47cf75e1379508cca64a9c7a0ffff))
9
+
3
10
  ## [0.12.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.11.3...agent-harness/v0.12.0) (2026-05-01)
4
11
 
5
12
 
@@ -263,6 +263,33 @@ module AgentHarness
263
263
  cleanup_llm_history_file!(llm_history_path)
264
264
  end
265
265
 
266
+ # Parse raw container output into a Response.
267
+ #
268
+ # Overrides the base implementation to support the
269
+ # +llm_history_path+ option for token usage extraction from
270
+ # Aider's LLM history file.
271
+ #
272
+ # @param stdout [String] captured standard output
273
+ # @param stderr [String] captured standard error
274
+ # @param exit_code [Integer] process exit code
275
+ # @param duration [Float] execution duration in seconds
276
+ # @param options [Hash] additional options
277
+ # @option options [String, nil] :llm_history_path path to LLM history file
278
+ # @return [Response] parsed response
279
+ def parse_container_output(stdout:, stderr: "", exit_code: 0, duration: 0.0, **options)
280
+ result = CommandExecutor::Result.new(
281
+ stdout: stdout,
282
+ stderr: stderr,
283
+ exit_code: exit_code,
284
+ duration: duration
285
+ )
286
+ parse_response(
287
+ result,
288
+ duration: duration,
289
+ llm_history_path: options[:llm_history_path]
290
+ )
291
+ end
292
+
266
293
  protected
267
294
 
268
295
  def build_command(prompt, options)
@@ -265,6 +265,29 @@ module AgentHarness
265
265
  handle_error(e, prompt: (last_msg&.dig(:content) || last_msg&.dig("content")).to_s, options: options)
266
266
  end
267
267
 
268
+ # Parse raw container output into a Response.
269
+ #
270
+ # This is the public interface for parsing CLI output captured from
271
+ # external execution (e.g. Docker containers) without going through
272
+ # send_message. It accepts the same data a CommandExecutor::Result
273
+ # holds and returns an AgentHarness::Response.
274
+ #
275
+ # @param stdout [String] captured standard output
276
+ # @param stderr [String] captured standard error
277
+ # @param exit_code [Integer] process exit code
278
+ # @param duration [Float] execution duration in seconds
279
+ # @param options [Hash] additional provider-specific options
280
+ # @return [Response] parsed response
281
+ def parse_container_output(stdout:, stderr: "", exit_code: 0, duration: 0.0, **options)
282
+ result = CommandExecutor::Result.new(
283
+ stdout: stdout,
284
+ stderr: stderr,
285
+ exit_code: exit_code,
286
+ duration: duration
287
+ )
288
+ parse_response(result, duration: duration)
289
+ end
290
+
268
291
  # Provider name for display
269
292
  #
270
293
  # @return [String] display name
@@ -345,6 +345,33 @@ module AgentHarness
345
345
  handle_error(e, prompt: prompt, options: options)
346
346
  end
347
347
 
348
+ # Parse raw container output into a Response.
349
+ #
350
+ # Overrides the base implementation to support the
351
+ # +json_output_requested+ option, which controls whether JSONL
352
+ # output is parsed for token extraction.
353
+ #
354
+ # @param stdout [String] captured standard output
355
+ # @param stderr [String] captured standard error
356
+ # @param exit_code [Integer] process exit code
357
+ # @param duration [Float] execution duration in seconds
358
+ # @param options [Hash] additional options
359
+ # @option options [Boolean] :json_output_requested whether to parse JSONL output
360
+ # @return [Response] parsed response
361
+ def parse_container_output(stdout:, stderr: "", exit_code: 0, duration: 0.0, **options)
362
+ result = CommandExecutor::Result.new(
363
+ stdout: stdout,
364
+ stderr: stderr,
365
+ exit_code: exit_code,
366
+ duration: duration
367
+ )
368
+ parse_response(
369
+ result,
370
+ duration: duration,
371
+ json_output_requested: options.fetch(:json_output_requested, false)
372
+ )
373
+ end
374
+
348
375
  protected
349
376
 
350
377
  def build_command(prompt, options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentHarness
4
- VERSION = "0.12.0"
4
+ VERSION = "0.13.0"
5
5
  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.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan