opencode-anthropic-auth 0.0.3 → 0.0.5
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/index.mjs +7 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -80,6 +80,10 @@ export async function AnthropicAuthPlugin({ client }) {
|
|
|
80
80
|
model.cost = {
|
|
81
81
|
input: 0,
|
|
82
82
|
output: 0,
|
|
83
|
+
cache: {
|
|
84
|
+
read: 0,
|
|
85
|
+
write: 0,
|
|
86
|
+
},
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
89
|
return {
|
|
@@ -106,7 +110,9 @@ export async function AnthropicAuthPlugin({ client }) {
|
|
|
106
110
|
}),
|
|
107
111
|
},
|
|
108
112
|
);
|
|
109
|
-
if (!response.ok)
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
throw new Error(`Token refresh failed: ${response.status}`);
|
|
115
|
+
}
|
|
110
116
|
const json = await response.json();
|
|
111
117
|
await client.auth.set({
|
|
112
118
|
path: {
|