@madgagarin/pi-agentrouter 1.0.2 → 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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.ts +4 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @madgagarin/pi-agentrouter
1
+ # pi-agentrouter
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@madgagarin/pi-agentrouter.svg?color=blue)](https://www.npmjs.com/package/@madgagarin/pi-agentrouter)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
package/index.ts CHANGED
@@ -27,16 +27,11 @@ export function saveConfig(cfg: AgentRouterConfig): void {
27
27
  }
28
28
  fs.writeFileSync(CONFIG_FILE, JSON.stringify(cfg, null, 2), "utf-8");
29
29
  } catch {}
30
+ }
31
+
30
32
  export function normalizeApiKey(key?: string): string {
31
33
  if (!key) return "";
32
- let clean = key.trim().replace(/^["']|["']$/g, "").trim();
33
- if (clean.toLowerCase().startsWith("bearer ")) {
34
- clean = clean.slice(7).trim();
35
- }
36
- if (clean.startsWith("sk-")) {
37
- clean = clean.slice(3).trim();
38
- }
39
- return clean;
34
+ return key.trim().replace(/^["']|["']$/g, "").trim();
40
35
  }
41
36
 
42
37
  const initialConfig = loadConfig();
@@ -220,7 +215,7 @@ export default function (pi: ExtensionAPI) {
220
215
  currentApiKey = cleanKey;
221
216
  saveConfig({ apiKey: cleanKey, minIntervalMs });
222
217
  registerAgentRouterProviders(cleanKey);
223
- ctx.ui.notify("AgentRouter API key updated and normalized successfully for all models.", "info");
218
+ ctx.ui.notify("AgentRouter API key updated successfully for all models.", "info");
224
219
  return;
225
220
  }
226
221
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgagarin/pi-agentrouter",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Pi coding agent extension for AgentRouter (GPT-5.6 Sol & Claude Opus 5) with rate-limit pacing and caching.",
5
5
  "publishConfig": {
6
6
  "access": "public"