pennyrouter 0.1.5 → 0.1.6
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 +1 -1
- package/src/harnesses/claude-code.js +2 -20
package/package.json
CHANGED
|
@@ -5,17 +5,9 @@ const LEGACY_MODEL_LABEL = "PennyRouter Bundle";
|
|
|
5
5
|
const CLAUDE_CODE_MODELS = {
|
|
6
6
|
speed: "Penny Speed",
|
|
7
7
|
core: "Penny Core",
|
|
8
|
-
coreMax: "Penny Core Max",
|
|
9
8
|
power: "Penny Power",
|
|
10
9
|
custom: "Penny Custom",
|
|
11
10
|
};
|
|
12
|
-
const MODEL_OVERRIDE_KEYS = {
|
|
13
|
-
"claude-sonnet-4-6": CLAUDE_CODE_MODELS.core,
|
|
14
|
-
"claude-sonnet-4-6-1m": CLAUDE_CODE_MODELS.coreMax,
|
|
15
|
-
"claude-opus-4-8": CLAUDE_CODE_MODELS.power,
|
|
16
|
-
"claude-haiku-4-5": CLAUDE_CODE_MODELS.speed,
|
|
17
|
-
"claude-fable-5": CLAUDE_CODE_MODELS.custom,
|
|
18
|
-
};
|
|
19
11
|
|
|
20
12
|
export const claudeCodeHarness = {
|
|
21
13
|
id: "claude-code",
|
|
@@ -49,11 +41,9 @@ export const claudeCodeHarness = {
|
|
|
49
41
|
// Claude Code displays these env values directly in its model picker; the
|
|
50
42
|
// gateway decodes the friendly labels into bundle/profile overrides.
|
|
51
43
|
current.env.ANTHROPIC_DEFAULT_OPUS_MODEL = CLAUDE_CODE_MODELS.power;
|
|
52
|
-
current.env.ANTHROPIC_DEFAULT_SONNET_MODEL = CLAUDE_CODE_MODELS.
|
|
53
|
-
current.env.ANTHROPIC_DEFAULT_HAIKU_MODEL = CLAUDE_CODE_MODELS.
|
|
44
|
+
current.env.ANTHROPIC_DEFAULT_SONNET_MODEL = CLAUDE_CODE_MODELS.core;
|
|
45
|
+
current.env.ANTHROPIC_DEFAULT_HAIKU_MODEL = CLAUDE_CODE_MODELS.speed;
|
|
54
46
|
current.env.ANTHROPIC_DEFAULT_FABLE_MODEL = CLAUDE_CODE_MODELS.custom;
|
|
55
|
-
current.modelOverrides ||= {};
|
|
56
|
-
Object.assign(current.modelOverrides, MODEL_OVERRIDE_KEYS);
|
|
57
47
|
|
|
58
48
|
await atomicWrite(CONFIG_PATH, `${JSON.stringify(current, null, 2)}\n`);
|
|
59
49
|
|
|
@@ -72,7 +62,6 @@ export const claudeCodeHarness = {
|
|
|
72
62
|
"ANTHROPIC_DEFAULT_HAIKU_MODEL",
|
|
73
63
|
"ANTHROPIC_DEFAULT_FABLE_MODEL",
|
|
74
64
|
],
|
|
75
|
-
model_overrides: Object.keys(MODEL_OVERRIDE_KEYS),
|
|
76
65
|
},
|
|
77
66
|
};
|
|
78
67
|
},
|
|
@@ -98,12 +87,6 @@ export const claudeCodeHarness = {
|
|
|
98
87
|
if (current.env[k] === LEGACY_MODEL_LABEL || isPennyRouterModelValue(current.env[k])) delete current.env[k];
|
|
99
88
|
}
|
|
100
89
|
}
|
|
101
|
-
if (current.modelOverrides && typeof current.modelOverrides === "object") {
|
|
102
|
-
for (const [key, value] of Object.entries(MODEL_OVERRIDE_KEYS)) {
|
|
103
|
-
if (current.modelOverrides[key] === value) delete current.modelOverrides[key];
|
|
104
|
-
}
|
|
105
|
-
if (Object.keys(current.modelOverrides).length === 0) delete current.modelOverrides;
|
|
106
|
-
}
|
|
107
90
|
if (current["anthropic.baseURL"] && isPennyRouterValue(current["anthropic.baseURL"])) {
|
|
108
91
|
delete current["anthropic.baseURL"];
|
|
109
92
|
}
|
|
@@ -145,7 +128,6 @@ function isPennyRouterModelValue(value) {
|
|
|
145
128
|
isPennyRouterValue(value) ||
|
|
146
129
|
value === CLAUDE_CODE_MODELS.speed ||
|
|
147
130
|
value === CLAUDE_CODE_MODELS.core ||
|
|
148
|
-
value === CLAUDE_CODE_MODELS.coreMax ||
|
|
149
131
|
value === CLAUDE_CODE_MODELS.power ||
|
|
150
132
|
value === CLAUDE_CODE_MODELS.custom
|
|
151
133
|
);
|