opencode-anthropic-auth 0.0.8 → 0.0.9

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 +16 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -184,6 +184,22 @@ export async function AnthropicAuthPlugin({ client }) {
184
184
  if (body && typeof body === "string") {
185
185
  try {
186
186
  const parsed = JSON.parse(body);
187
+
188
+ // Sanitize system prompt - server blocks "OpenCode" string
189
+ if (parsed.system && Array.isArray(parsed.system)) {
190
+ parsed.system = parsed.system.map(item => {
191
+ if (item.type === 'text' && item.text) {
192
+ return {
193
+ ...item,
194
+ text: item.text
195
+ .replace(/OpenCode/g, 'Claude Code')
196
+ .replace(/opencode/gi, 'Claude')
197
+ };
198
+ }
199
+ return item;
200
+ });
201
+ }
202
+
187
203
  // Add prefix to tools definitions
188
204
  if (parsed.tools && Array.isArray(parsed.tools)) {
189
205
  parsed.tools = parsed.tools.map((tool) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-anthropic-auth",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "main": "./index.mjs",
5
5
  "devDependencies": {
6
6
  "@opencode-ai/plugin": "^0.4.45"