agent-harness 0.8.0 → 0.9.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: a5bc12df7dec39319082c66c7aa4fc47bfc3f3d1765f572c4faa49677e18bad1
4
- data.tar.gz: '08138f93d009f4d390917d7f09721adf7e1fbfe0eb2bedb75352b3c2250b245d'
3
+ metadata.gz: 8162991fcf80a1cfe21b522abe909f615e87e56942b8261f5ee3cbb9a86f18c2
4
+ data.tar.gz: 22f7b57522dc3f38dd73a5200cbf878ca72d0b22d889c29bfa58ca878725a705
5
5
  SHA512:
6
- metadata.gz: 0b0870b435dd46293c04eb382476138bb5b2cd1c8e6fc665a9c41fa0b4ed20be09906242a9e492f8c8f4eebd6c2da17c51ddb17860750ed634da220a54c80846
7
- data.tar.gz: 1cc610554e295e6d9a65c7ac2f44209f99c45eab8b713256397a595d95c8bcd88a8a3463509dc55881b3a22701e142bb70632846b99c2f4d30a05be0888e8fd9
6
+ metadata.gz: 1a9f60dc02f229765786bfe38c5cc84f489f52efb8d146f1a0595f9bc03d930b6e71f2194cfb4c86d24e191e1c5d184e7030addda5f1ab09a4a9098ff3a90a7f
7
+ data.tar.gz: 7b4a8d87ceb151d28d867522afe69872f5a983df961b7c2a1dcccf07324c1ca8c6cc2e7ed1eb7b4dd129d7315917084a0e0da7d29c2ad4e032b6be29eda71fa2
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.8.0"
2
+ ".": "0.9.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.8.0...agent-harness/v0.9.0) (2026-04-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * **installers:** make Github Copilot CLI installation/version support a first-class provider contract ([#135](https://github.com/viamin/agent-harness/issues/135)) ([5120d44](https://github.com/viamin/agent-harness/commit/5120d44cf8405d0f7ef5fbb036f6d44ffdb701f6))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * **deps:** bump rake from 13.3.1 to 13.4.2 in the minor-updates group ([f9189f1](https://github.com/viamin/agent-harness/commit/f9189f1d78cd2348fb792d22156ecce6cefdd3a8))
14
+
3
15
  ## [0.8.0](https://github.com/viamin/agent-harness/compare/agent-harness/v0.7.4...agent-harness/v0.8.0) (2026-04-19)
4
16
 
5
17
 
@@ -8,6 +8,10 @@ module AgentHarness
8
8
  class GithubCopilot < Base
9
9
  include TokenUsageParsing
10
10
 
11
+ PACKAGE_NAME = "@githubnext/github-copilot-cli"
12
+ SUPPORTED_CLI_VERSION = "0.1.36"
13
+ SUPPORTED_CLI_REQUIREMENT = Gem::Requirement.new(">= #{SUPPORTED_CLI_VERSION}", "< 0.2.0").freeze
14
+
11
15
  MODEL_PATTERN = /^gpt-[\d.o-]+(?:-turbo)?(?:-mini)?$/i
12
16
  JSON_OUTPUT_MIN_VERSION = Gem::Version.new("0.0.422").freeze
13
17
 
@@ -33,6 +37,40 @@ module AgentHarness
33
37
  !!executor.which(binary_name)
34
38
  end
35
39
 
40
+ def installation_contract(version: SUPPORTED_CLI_VERSION)
41
+ version = version.strip if version.respond_to?(:strip)
42
+ validate_install_version!(version)
43
+ package_spec = "#{PACKAGE_NAME}@#{version}".freeze
44
+ install_command_prefix = ["npm", "install", "-g", "--ignore-scripts"].freeze
45
+ install_command = (install_command_prefix + [package_spec]).freeze
46
+ version_requirement = SUPPORTED_CLI_REQUIREMENT.requirements
47
+ .map { |op, ver| "#{op} #{ver}".freeze }
48
+ .freeze
49
+
50
+ contract = {
51
+ source: {
52
+ type: :npm,
53
+ package: PACKAGE_NAME
54
+ }.freeze,
55
+ install_command_prefix: install_command_prefix,
56
+ install_command: install_command,
57
+ binary_name: binary_name,
58
+ default_version: SUPPORTED_CLI_VERSION,
59
+ version: version,
60
+ version_requirement: version_requirement,
61
+ supported_version_requirement: SUPPORTED_CLI_REQUIREMENT.to_s
62
+ }
63
+
64
+ contract.each_value do |value|
65
+ value.freeze if value.is_a?(String)
66
+ end
67
+ contract.freeze
68
+ end
69
+
70
+ def install_command(version: SUPPORTED_CLI_VERSION)
71
+ installation_contract(version: version)[:install_command]
72
+ end
73
+
36
74
  def provider_metadata_overrides
37
75
  {
38
76
  auth: {
@@ -93,6 +131,30 @@ module AgentHarness
93
131
  def supports_model_family?(family_name)
94
132
  MODEL_PATTERN.match?(family_name)
95
133
  end
134
+
135
+ private
136
+
137
+ def validate_install_version!(version)
138
+ unless version.is_a?(String) && !version.strip.empty?
139
+ raise ArgumentError,
140
+ "Unsupported GitHub Copilot CLI version #{version.inspect}; " \
141
+ "supported versions must satisfy #{SUPPORTED_CLI_REQUIREMENT}"
142
+ end
143
+
144
+ parsed_version = begin
145
+ Gem::Version.new(version)
146
+ rescue ArgumentError
147
+ raise ArgumentError,
148
+ "Unsupported GitHub Copilot CLI version #{version.inspect}; " \
149
+ "supported versions must satisfy #{SUPPORTED_CLI_REQUIREMENT}"
150
+ end
151
+
152
+ return if SUPPORTED_CLI_REQUIREMENT.satisfied_by?(parsed_version)
153
+
154
+ raise ArgumentError,
155
+ "Unsupported GitHub Copilot CLI version #{version.inspect}; " \
156
+ "supported versions must satisfy #{SUPPORTED_CLI_REQUIREMENT}"
157
+ end
96
158
  end
97
159
 
98
160
  def name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentHarness
4
- VERSION = "0.8.0"
4
+ VERSION = "0.9.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.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan