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.
Files changed (2) hide show
  1. package/index.mjs +7 -1
  2. 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) return;
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-anthropic-auth",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "./index.mjs",
5
5
  "devDependencies": {
6
6
  "@opencode-ai/plugin": "^0.4.45"