@madgagarin/pi-agentrouter 1.0.3 → 1.0.4
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/README.md +1 -1
- package/index.ts +2 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pi-agentrouter
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@madgagarin/pi-agentrouter)
|
|
4
4
|
[](LICENSE)
|
package/index.ts
CHANGED
|
@@ -31,14 +31,7 @@ export function saveConfig(cfg: AgentRouterConfig): void {
|
|
|
31
31
|
|
|
32
32
|
export function normalizeApiKey(key?: string): string {
|
|
33
33
|
if (!key) return "";
|
|
34
|
-
|
|
35
|
-
if (clean.toLowerCase().startsWith("bearer ")) {
|
|
36
|
-
clean = clean.slice(7).trim();
|
|
37
|
-
}
|
|
38
|
-
if (clean.startsWith("sk-")) {
|
|
39
|
-
clean = clean.slice(3).trim();
|
|
40
|
-
}
|
|
41
|
-
return clean;
|
|
34
|
+
return key.trim().replace(/^["']|["']$/g, "").trim();
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
const initialConfig = loadConfig();
|
|
@@ -222,7 +215,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
222
215
|
currentApiKey = cleanKey;
|
|
223
216
|
saveConfig({ apiKey: cleanKey, minIntervalMs });
|
|
224
217
|
registerAgentRouterProviders(cleanKey);
|
|
225
|
-
ctx.ui.notify("AgentRouter API key updated
|
|
218
|
+
ctx.ui.notify("AgentRouter API key updated successfully for all models.", "info");
|
|
226
219
|
return;
|
|
227
220
|
}
|
|
228
221
|
|
package/package.json
CHANGED