opencode-anthropic-auth 0.0.10 → 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.
- package/index.mjs +7 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -71,9 +71,9 @@ async function exchange(code, verifier) {
|
|
|
71
71
|
export async function AnthropicAuthPlugin({ client }) {
|
|
72
72
|
return {
|
|
73
73
|
"experimental.chat.system.transform": (input, output) => {
|
|
74
|
-
if (input.model
|
|
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
|
|
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
|
-
|
|
177
|
+
];
|
|
178
|
+
const mergedBetas = [
|
|
179
|
+
...new Set([...requiredBetas, ...incomingBetasList]),
|
|
181
180
|
].join(",");
|
|
182
181
|
|
|
183
182
|
requestHeaders.set("authorization", `Bearer ${auth.access}`);
|