ask-agent 0.4.2 → 0.4.3

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: 4e56503ad4f2642bb671cfb6c1fe63b05dbfa507dbdc6fba048a822a2a4bbc74
4
- data.tar.gz: 13e0fe8facaac2823e7b73d6aaf7abbb71404e5f557b9e318a66bf7f767e4eda
3
+ metadata.gz: 23e169387a3dfe5b2f74e623ebe467d11a51518f7258aff69467955d7cd8b006
4
+ data.tar.gz: 1953b7ad69838440837864b8d39b56cced33ab4959eea3ffdc5eaa479dc8946a
5
5
  SHA512:
6
- metadata.gz: a4e45c5a696d28b887fdf63434fa304145428c6bf8c6dd14dec044c1d566267ce358ac4a347f761cbbee7c1b01e82faad8d4932ec21b35a8b528cbe217c1b36a
7
- data.tar.gz: c41b5afbf3ae4e0a1e3899bfa8b3c128c0209377e78c23923ab3a5da7538d491da3d665d665914dc1f7f88a15210c0cbf5e47ab5f1110ed4b21d42f1ed9fc4cc
6
+ metadata.gz: be8d999d26b967e996b8f3b72e5a1bbdf34b79446d3903e91e3d2ff1e65ba102cdd63a77a5abf40bcbbb5b9855b969cd79e6509c42c491ef749c0e2437474ed6
7
+ data.tar.gz: 3e96cd7d4bbebddf7ef7131a7adae6f086fd57c84740f88c50f21175f482e6d29a366936c174953e4217302721d565cb1b7f1dfeaf83206d3652202527cb4333
@@ -119,13 +119,21 @@ module Ask
119
119
  end
120
120
 
121
121
  def provider_config(slug)
122
- # Try the full slug credential name first, then fall back to the
123
- # base name for compound slugs (e.g., opencode_go → opencode).
124
- # The multi-name resolve tries each in order and returns the first match.
125
- cred_names = [:"#{slug}_api_key"]
126
- if slug.to_s.include?("_")
127
- cred_names << :"#{slug.to_s.split("_").first}_api_key"
122
+ # Try credential names from most to least specific:
123
+ # 1. Flat key with full slug (opencode_go_api_key)
124
+ # 2. Nested path with full slug ([:opencode, :go, :api_key])
125
+ # 3. Flat key with base slug (opencode_api_key)
126
+ # 4. Nested path with base slug ([:opencode, :api_key])
127
+ slug_s = slug.to_s
128
+ base_s = slug_s.include?("_") ? slug_s.split("_").first : nil
129
+
130
+ cred_names = [:"#{slug_s}_api_key"]
131
+ cred_names << slug_s.split("_").map(&:to_sym).push(:api_key) if slug_s.include?("_")
132
+ if base_s
133
+ cred_names << :"#{base_s}_api_key"
134
+ cred_names << [base_s.to_sym, :api_key]
128
135
  end
136
+
129
137
  key = Ask::Auth.resolve(*cred_names) rescue nil
130
138
 
131
139
  base_url = Ask::Auth.resolve(:"#{slug}_api_base") rescue nil
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Agent
5
- VERSION = "0.4.2"
5
+ VERSION = "0.4.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto