osai-agent 4.2.50 → 4.2.53
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.
package/package.json
CHANGED
|
@@ -164,13 +164,15 @@ export function ProviderMenu({ visible, onSelect, onCancel, serverUrl, token, cu
|
|
|
164
164
|
setCatalog(data);
|
|
165
165
|
setPhase('catalog');
|
|
166
166
|
} else {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
const res = await fetch(`${serverUrl}/api/provider/catalog`, {
|
|
168
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
169
|
+
});
|
|
170
|
+
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
|
|
171
|
+
const data = await res.json();
|
|
172
|
+
const localKeyMap = Object.fromEntries(LOCAL_PROVIDERS.map(p => [p.id, p.needsKey]));
|
|
173
|
+
const fixed = data.map(p => ({ ...p, needs_key: localKeyMap[p.id] ?? p.needs_key }));
|
|
174
|
+
setCatalog(fixed);
|
|
175
|
+
setPhase('catalog');
|
|
174
176
|
}
|
|
175
177
|
} catch (err) {
|
|
176
178
|
setCatalogError(err.message);
|