ask-agent 0.4.1 → 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 +4 -4
- data/CHANGELOG.md +0 -6
- data/lib/ask/agent/chat.rb +16 -8
- data/lib/ask/agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23e169387a3dfe5b2f74e623ebe467d11a51518f7258aff69467955d7cd8b006
|
|
4
|
+
data.tar.gz: 1953b7ad69838440837864b8d39b56cced33ab4959eea3ffdc5eaa479dc8946a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be8d999d26b967e996b8f3b72e5a1bbdf34b79446d3903e91e3d2ff1e65ba102cdd63a77a5abf40bcbbb5b9855b969cd79e6509c42c491ef749c0e2437474ed6
|
|
7
|
+
data.tar.gz: 3e96cd7d4bbebddf7ef7131a7adae6f086fd57c84740f88c50f21175f482e6d29a366936c174953e4217302721d565cb1b7f1dfeaf83206d3652202527cb4333
|
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
## [0.4.1] — 2026-07-18
|
|
2
|
-
|
|
3
|
-
### Fixed
|
|
4
|
-
|
|
5
|
-
- **`Chat#provider_config` now falls back to base provider name for credential lookup** — When a provider slug has a compound name like `opencode_go`, the method first tries `Ask::Auth.resolve(:opencode_go_api_key)` and if that returns nil, falls back to `Ask::Auth.resolve(:opencode_api_key)`. This lets users store credentials under the canonical provider name (e.g., `opencode.api_key` in Rails credentials) while using a specific variant provider (e.g., `opencode_go`).
|
|
6
|
-
|
|
7
1
|
## [0.4.0] — 2026-07-17
|
|
8
2
|
|
|
9
3
|
### Added
|
data/lib/ask/agent/chat.rb
CHANGED
|
@@ -119,15 +119,23 @@ module Ask
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def provider_config(slug)
|
|
122
|
-
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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]
|
|
130
135
|
end
|
|
136
|
+
|
|
137
|
+
key = Ask::Auth.resolve(*cred_names) rescue nil
|
|
138
|
+
|
|
131
139
|
base_url = Ask::Auth.resolve(:"#{slug}_api_base") rescue nil
|
|
132
140
|
config = { api_key: key }
|
|
133
141
|
config[:"#{slug}_api_key"] = key
|
data/lib/ask/agent/version.rb
CHANGED