opencode-anthropic-auth 0.0.11 → 0.0.12

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 +6 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -73,7 +73,7 @@ export async function AnthropicAuthPlugin({ client }) {
73
73
  "experimental.chat.system.transform": (input, output) => {
74
74
  if (input.model?.providerID === "anthropic") {
75
75
  output.system.unshift(
76
- "You are Claude Code, Anthropic's official CLI for Claude.",
76
+ "You are Claude Code, Anthropic's official CLI for Claude.\n\n",
77
77
  );
78
78
  }
79
79
  },
@@ -164,20 +164,19 @@ export async function AnthropicAuthPlugin({ client }) {
164
164
  }
165
165
  }
166
166
 
167
+ // Preserve all incoming beta headers while ensuring OAuth requirements
167
168
  const incomingBeta = requestHeaders.get("anthropic-beta") || "";
168
169
  const incomingBetasList = incomingBeta
169
170
  .split(",")
170
171
  .map((b) => b.trim())
171
172
  .filter(Boolean);
172
173
 
173
- const includeClaudeCode = incomingBetasList.includes(
174
- "claude-code-20250219",
175
- );
176
-
177
- const mergedBetas = [
174
+ const requiredBetas = [
178
175
  "oauth-2025-04-20",
179
176
  "interleaved-thinking-2025-05-14",
180
- ...(includeClaudeCode ? ["claude-code-20250219"] : []),
177
+ ];
178
+ const mergedBetas = [
179
+ ...new Set([...requiredBetas, ...incomingBetasList]),
181
180
  ].join(",");
182
181
 
183
182
  requestHeaders.set("authorization", `Bearer ${auth.access}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-anthropic-auth",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "main": "./index.mjs",
5
5
  "devDependencies": {
6
6
  "@opencode-ai/plugin": "^0.4.45"