@xtruder/opencode-claude-max-plugin 2.1.1 → 2.1.2

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/build/index.d.ts CHANGED
@@ -5,14 +5,17 @@ export declare const CLAUDE_CODE_OPUS5_SYSTEM_PROMPT: string;
5
5
  export declare const CLAUDE_CODE_SONNET5_SYSTEM_PROMPT: string;
6
6
  export declare const CLAUDE_CODE_SONNET55_SYSTEM_PROMPT: string;
7
7
  export declare const CLAUDE_CODE_FABLE5_SYSTEM_PROMPT: string;
8
+ export declare const CLAUDE_CODE_FABLE51_SYSTEM_PROMPT: string;
8
9
  /**
9
10
  * Select the Claude Code system prompt that matches the given model.
10
11
  *
11
- * Claude Code ships per-model prompts. Sonnet 5.5 gets the condensed harness
12
- * without delivery and correction guidance; Sonnet 5 gets its long-form
13
- * harness; Opus 5 gets its condensed scope, delivery, and correction guidance;
14
- * Fable 5 gets its communication guidance; Opus 4.8 gets the shorter earlier
15
- * harness. Older models get the legacy long-form prompt.
12
+ * Claude Code ships per-model prompts. Sonnet 5.5 and Opus 5.5 share the
13
+ * condensed harness without delivery and correction guidance; Sonnet 5 gets
14
+ * its long-form harness; Opus 5 gets its condensed scope, delivery, and
15
+ * correction guidance; Fable 5.1 gets delivery guidance and strict
16
+ * final-message writing rules; Fable 5 gets its communication guidance;
17
+ * Opus 4.8 gets the shorter earlier harness. Older models get the legacy
18
+ * long-form prompt.
16
19
  */
17
20
  export declare function selectClaudePromptForModel(modelId: string): string;
18
21
  export declare const PROVIDER_ID = "anthropic-sdk";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAYvD,eAAO,MAAM,yBAAyB,QAA4B,CAAA;AAClE,eAAO,MAAM,6BAA6B,QAA2B,CAAA;AACrE,eAAO,MAAM,+BAA+B,QAA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H,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAA;CAChD;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG;IACjE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;CACjB,CAoBA;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,2BAAgC,GACxC,oBAAoB,CAmJtB;AAID,eAAe,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as CLAUDE_CODE_SONNET5_SYSTEM_PROMPT, c as buildPluginModels, d as selectClaudePromptForModel, i as CLAUDE_CODE_SONNET55_SYSTEM_PROMPT, l as createAnthropicSDK, n as CLAUDE_CODE_NEW_SYSTEM_PROMPT, o as CLAUDE_CODE_SYSTEM_PROMPT, r as CLAUDE_CODE_OPUS5_SYSTEM_PROMPT, s as PROVIDER_ID, t as CLAUDE_CODE_FABLE5_SYSTEM_PROMPT, u as resolveAuth } from "./src-DKt_2MEw.js";
2
- export { CLAUDE_CODE_FABLE5_SYSTEM_PROMPT, CLAUDE_CODE_NEW_SYSTEM_PROMPT, CLAUDE_CODE_OPUS5_SYSTEM_PROMPT, CLAUDE_CODE_SONNET55_SYSTEM_PROMPT, CLAUDE_CODE_SONNET5_SYSTEM_PROMPT, CLAUDE_CODE_SYSTEM_PROMPT, PROVIDER_ID, buildPluginModels, createAnthropicSDK, createAnthropicSDK as default, resolveAuth, selectClaudePromptForModel };
1
+ import { a as CLAUDE_CODE_SONNET55_SYSTEM_PROMPT, c as PROVIDER_ID, d as resolveAuth, f as selectClaudePromptForModel, i as CLAUDE_CODE_OPUS5_SYSTEM_PROMPT, l as buildPluginModels, n as CLAUDE_CODE_FABLE5_SYSTEM_PROMPT, o as CLAUDE_CODE_SONNET5_SYSTEM_PROMPT, r as CLAUDE_CODE_NEW_SYSTEM_PROMPT, s as CLAUDE_CODE_SYSTEM_PROMPT, t as CLAUDE_CODE_FABLE51_SYSTEM_PROMPT, u as createAnthropicSDK } from "./src-BALxhaEC.js";
2
+ export { CLAUDE_CODE_FABLE51_SYSTEM_PROMPT, CLAUDE_CODE_FABLE5_SYSTEM_PROMPT, CLAUDE_CODE_NEW_SYSTEM_PROMPT, CLAUDE_CODE_OPUS5_SYSTEM_PROMPT, CLAUDE_CODE_SONNET55_SYSTEM_PROMPT, CLAUDE_CODE_SONNET5_SYSTEM_PROMPT, CLAUDE_CODE_SYSTEM_PROMPT, PROVIDER_ID, buildPluginModels, createAnthropicSDK, createAnthropicSDK as default, resolveAuth, selectClaudePromptForModel };
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;;;;;AAK9C,wBAmFyB"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;;;;;AAa9C,wBAsFyB"}
package/build/server.js CHANGED
@@ -1,5 +1,6 @@
1
- import { c as buildPluginModels, d as selectClaudePromptForModel, s as PROVIDER_ID, u as resolveAuth } from "./src-DKt_2MEw.js";
1
+ import { c as PROVIDER_ID, d as resolveAuth, f as selectClaudePromptForModel, l as buildPluginModels } from "./src-BALxhaEC.js";
2
2
  //#region src/server.ts
3
+ var SHELL_CWD_NOTE = "Each shell tool call starts in the working directory from <env>; a `cd` lasts only for that call. When possible, avoid changing directories in the command and set the shell tool's `workdir` instead.";
3
4
  var server_default = {
4
5
  id: "anthropic-sdk",
5
6
  async setup(ctx) {
@@ -59,7 +60,7 @@ var server_default = {
59
60
  }, ...event.system.slice(1)] : event.system.slice(1);
60
61
  event.system.splice(0, event.system.length, {
61
62
  type: "text",
62
- text: selectClaudePromptForModel(event.model.id)
63
+ text: `${selectClaudePromptForModel(event.model.id)}\n${SHELL_CWD_NOTE}\n`
63
64
  }, ...tail.map((part) => Object.assign({}, part, { text: part.text.replace("Is directory a git repo: yes", "Is a git repository: true").replace("Is directory a git repo: no", "Is a git repository: false") })));
64
65
  event.options.maxTokens ??= 64e3;
65
66
  }, { providerID: PROVIDER_ID });
@@ -7,6 +7,9 @@ import { createHash, randomBytes } from "node:crypto";
7
7
  //#region src/claudecode-system-fable5.txt
8
8
  var claudecode_system_fable5_default = "\nYou are an interactive agent that helps users with software engineering tasks.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.\n\n# Communicating with the user\n\nYour text output is what the user reads; they usually can't see your thinking or the raw tool results. Write it for a teammate who stepped away and is catching up, not for a log file: they don't know the codenames or shorthand you created along the way, and they didn't watch your process unfold. Before your first tool call, say in a sentence what you're about to do; while working, give brief updates when you find something load-bearing or change direction.\n\nText you write between tool calls may not be shown to the user. Everything the user needs from this turn — answers, summaries, findings, conclusions, deliverables — must be in the final text message of your turn, with no tool calls after it. Keep text between tool calls to brief status notes. If something important appeared only mid-turn or in your thinking, restate it in that final message.\n\nLead with the outcome. Your first sentence after finishing should answer \"what happened\" or \"what did you find\" — the thing the user would ask for if they said \"just give me the TLDR.\" Supporting detail and reasoning come after, for readers who want them.\n\nBeing readable and being concise are different things, and readable matters more. Keep output short by being selective about what you include, not by compressing writing into fragments, abbreviations, arrow chains, or jargon. Write what you include in complete sentences with technical terms spelled out.\n\nMatch the response to the question: a simple question gets a direct answer in prose, not headers and sections. Use tables only for short enumerable facts. Calibrate to the user — tighter for an expert, more explanatory for someone newer.\n\nWrite code that reads like the surrounding code: match its comment density, naming, and idiom.\nOnly write a code comment to state a constraint the code itself can't show — never to say where it came from, what the next line does, or why your change is correct.\n\nFor actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.\n\n# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.\n\nWhen you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey.\n";
9
9
  //#endregion
10
+ //#region src/claudecode-system-fable51.txt
11
+ var claudecode_system_fable51_default = "\nYou are an interactive agent that helps users with software engineering tasks.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.\n\nBefore you start, say in a line what you're about to do; brief updates while you work help the user follow along. Close with a short recap that stands on its own — what you found, what you did, and what's next — so a reader who only sees the last message has the full picture.\n\nFor actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.\n\n# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.\n\nWhen you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey.\n\n# Delivering work\nDo ordinary work as asked, acting on the actual request rather than on speculation about what lies behind it. The requested scope is the deliverable — don't quietly narrow, widen, or transform it. Interpret ambiguity the way a careful colleague would: make routine judgment calls yourself, and check in only when different readings would lead to materially different work. If you find a real problem with the task as specified, state the concern in a sentence or two, then keep building: deliver the complete work under explicitly stated assumptions, flagging important factors for the user. Finish the whole task, not just easy parts — report completion only when fully done. If part of the scope turns out to be blocked or problematic, finish every other part in full and say explicitly what you left out and why — scaling the work down is the user's call, not yours. Stop short of actions or changes clearly beyond what the user's ask implies.\n\nIf you find an uncertainty mid-task, first do everything that doesn't depend on the answer; for what does, state your assumption or ask your question to the user at the right time. Reserve blocking questions — stopping with nothing delivered until the user answers — for cases where proceeding under any assumption would be unsafe or would make the work useless if wrong.\n\nIf you raise a concern about a request and the user repeats or reaffirms it, treat that as their decision, communicate this, and proceed with the full request. Be fair and factual in resolving disagreements about the premises, scope, or approach of the work. Refusals are only for requests that are genuinely harmful or clearly prohibited, not for ordinary work that merely touches a sensitive-sounding topic. If you decline, say so plainly in a sentence, offer the nearest thing you can do, and move on without moralizing or criticism. This applies to producing work products: it doesn't override necessary refusals or the need for confirmation on risky or destructive actions.\n\n# Writing for the user\nThe user may not see your tool calls, tool results, or the text you write between them. Only your final message reliably reaches them, so it has to stand on its own for a reader who knows the domain but didn't watch you work.\n\nRules for that message:\n- Lead with the answer or outcome. If something could not be verified, say so first. Keep it short by leaving things out, not by packing them in.\n- One idea per sentence, about 20 words, with a verb. Short does not mean clipped: a sentence beats a label with a colon. Start a new sentence instead of joining clauses with a semicolon.\n- No em-dashes, no parentheticals, no arrows.\n- State facts and conclusions. Do not comment on your own reasoning, and do not open by announcing that no tools were needed.\n- Do not refer to anything by a name you made up during the session. Expand uncommon acronyms the first time you use them. Say who wrote a message and what it said, not by number or label.\n- Keep code out of prose. Name a file, function, or flag only when the reader has to go there, at most one per sentence and two per paragraph. Describe the rest in words. Commands, snippets, and error text go in a fenced code block.\n- Keep numbers out of prose. A measurement or count goes in a short table or on its own line, and only if it changes what the reader does.\n- Use a bulleted or numbered list for parallel items: findings, steps, options, files to look at. One or two sentences per bullet, never a paragraph. Bold the first few words of a bullet or paragraph, never a whole sentence. A single point or a line of argument stays in prose.\n- No headers in a message under about 500 words. Above that, at most three. If the user asks for no formatting, use none.\n- Stop when the content stops. No closing offer, no restating what you did.\n";
12
+ //#endregion
10
13
  //#region src/claudecode-system-new.txt
11
14
  var claudecode_system_new_default = "\nYou are an interactive agent that helps users with software engineering tasks.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - `<system-reminder>` tags in messages and tool results are injected by the harness, not the user. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.\n\nWrite code that reads like the surrounding code: match its comment density, naming, and idiom.\n\nFor actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target — if what you find contradicts how it was described, or you didn't create it, surface that instead of proceeding. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.\n\n# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.\n\nWhen you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey.\n";
12
15
  //#endregion
@@ -716,7 +719,7 @@ var FALLBACK_BETAS_HEADER = "x-anthropic-sdk-fallback-betas";
716
719
  */
717
720
  var BILLING_SYSTEM_BLOCK = {
718
721
  type: "text",
719
- text: "x-anthropic-billing-header: cc_version=2.1.280.790; cc_entrypoint=sdk-cli;"
722
+ text: "x-anthropic-billing-header: cc_version=2.1.286.ee5; cc_entrypoint=sdk-cli;"
720
723
  };
721
724
  /**
722
725
  * Claude Code identity block — always sent as system[1].
@@ -1131,34 +1134,43 @@ var CLAUDE_CODE_OPUS5_SYSTEM_PROMPT = claudecode_system_opus5_default;
1131
1134
  var CLAUDE_CODE_SONNET5_SYSTEM_PROMPT = claudecode_system_sonnet5_default;
1132
1135
  var CLAUDE_CODE_SONNET55_SYSTEM_PROMPT = claudecode_system_sonnet55_default;
1133
1136
  var CLAUDE_CODE_FABLE5_SYSTEM_PROMPT = claudecode_system_fable5_default;
1137
+ var CLAUDE_CODE_FABLE51_SYSTEM_PROMPT = claudecode_system_fable51_default;
1134
1138
  /**
1135
1139
  * Select the Claude Code system prompt that matches the given model.
1136
1140
  *
1137
- * Claude Code ships per-model prompts. Sonnet 5.5 gets the condensed harness
1138
- * without delivery and correction guidance; Sonnet 5 gets its long-form
1139
- * harness; Opus 5 gets its condensed scope, delivery, and correction guidance;
1140
- * Fable 5 gets its communication guidance; Opus 4.8 gets the shorter earlier
1141
- * harness. Older models get the legacy long-form prompt.
1141
+ * Claude Code ships per-model prompts. Sonnet 5.5 and Opus 5.5 share the
1142
+ * condensed harness without delivery and correction guidance; Sonnet 5 gets
1143
+ * its long-form harness; Opus 5 gets its condensed scope, delivery, and
1144
+ * correction guidance; Fable 5.1 gets delivery guidance and strict
1145
+ * final-message writing rules; Fable 5 gets its communication guidance;
1146
+ * Opus 4.8 gets the shorter earlier harness. Older models get the legacy
1147
+ * long-form prompt.
1142
1148
  */
1143
1149
  function selectClaudePromptForModel(modelId) {
1144
- if (modelId.includes("sonnet-5-5")) return claudecode_system_sonnet55_default;
1150
+ if (modelId.includes("sonnet-5-5") || modelId.includes("opus-5-5")) return claudecode_system_sonnet55_default;
1145
1151
  if (modelId.includes("sonnet-5")) return claudecode_system_sonnet5_default;
1146
1152
  if (modelId.includes("opus-5")) return claudecode_system_opus5_default;
1153
+ if (modelId.includes("fable-5-1")) return claudecode_system_fable51_default;
1147
1154
  if (modelId.includes("fable-5")) return claudecode_system_fable5_default;
1148
1155
  if (modelId.includes("opus-4-8")) return claudecode_system_new_default;
1149
1156
  return claudecode_system_default;
1150
1157
  }
1151
1158
  /**
1152
- * Claude Code CLI version to impersonate.
1153
- * Used in user-agent, billing header, and x-stainless-package-version.
1159
+ * Claude Code CLI version to impersonate in the user-agent. The billing
1160
+ * block in model.ts must report the same version.
1161
+ */
1162
+ var CLAUDE_CODE_VERSION = "2.1.286";
1163
+ /**
1164
+ * @anthropic-ai/sdk version bundled with CLAUDE_CODE_VERSION, sent as
1165
+ * x-stainless-package-version. Keep the package.json pin in sync.
1154
1166
  */
1155
- var CLAUDE_CODE_VERSION = "2.1.280";
1167
+ var CLAUDE_CODE_SDK_VERSION = "0.127.0";
1156
1168
  /**
1157
1169
  * Beta flags that Claude Code sends on every OAuth request.
1158
1170
  * Order and exact values must match what Claude Code sends.
1159
1171
  *
1160
- * Captured from Claude Code 2.1.220 and verified against 2.1.280. Model-conditional flags
1161
- * are appended in wrappedFetch so their order matches the CLI.
1172
+ * Captured from Claude Code 2.1.286. Model-conditional flags are appended in
1173
+ * wrappedFetch so their order matches the CLI.
1162
1174
  * - thinking-token-count-2026-05-13: estimated_tokens in thinking_delta
1163
1175
  * stream events (progress hint when display="omitted")
1164
1176
  */
@@ -1170,6 +1182,33 @@ var OAUTH_BETAS = [
1170
1182
  "context-management-2025-06-27",
1171
1183
  "prompt-caching-scope-2026-01-05"
1172
1184
  ];
1185
+ /** Claude Code sends Haiku the same base flags with its own gate moved last. */
1186
+ var HAIKU_OAUTH_BETAS = [...OAUTH_BETAS.slice(1), "claude-code-20250219"];
1187
+ /**
1188
+ * Model-conditional OAuth flags in the order Claude Code 2.1.286 appends
1189
+ * them after the base flags.
1190
+ */
1191
+ function modelOAuthBetas(model) {
1192
+ const isClaude5 = [
1193
+ "opus-4-8",
1194
+ "opus-5",
1195
+ "sonnet-5",
1196
+ "fable-5"
1197
+ ].some((m) => model.includes(m));
1198
+ const isLatest = [
1199
+ "opus-5-5",
1200
+ "sonnet-5-5",
1201
+ "fable-5-1"
1202
+ ].some((m) => model.includes(m));
1203
+ return [
1204
+ ...isClaude5 ? ["mid-conversation-system-2026-04-07"] : [],
1205
+ ...isLatest ? ["per-turn-control-2026-07-01"] : [],
1206
+ ...isClaude5 && !model.includes("sonnet") ? ["mid-conversation-tool-changes-2026-07-01"] : [],
1207
+ "advisor-tool-2026-03-01",
1208
+ ...!model.includes("haiku") ? ["effort-2025-11-24"] : [],
1209
+ "extended-cache-ttl-2025-04-11"
1210
+ ];
1211
+ }
1173
1212
  /**
1174
1213
  * Beta flags for regular API key auth (no OAuth).
1175
1214
  */
@@ -1492,7 +1531,7 @@ function createAnthropicSDK(options = {}) {
1492
1531
  defaultHeaders["user-agent"] = `claude-cli/${CLAUDE_CODE_VERSION} (external, sdk-cli)`;
1493
1532
  defaultHeaders["x-app"] = "cli";
1494
1533
  defaultHeaders["anthropic-dangerous-direct-browser-access"] = "true";
1495
- defaultHeaders["x-stainless-package-version"] = "0.94.0";
1534
+ defaultHeaders["x-stainless-package-version"] = CLAUDE_CODE_SDK_VERSION;
1496
1535
  }
1497
1536
  const baseFetch = customFetch ?? globalThis.fetch;
1498
1537
  const wrappedFetch = async (url, init) => {
@@ -1517,16 +1556,10 @@ function createAnthropicSDK(options = {}) {
1517
1556
  if (filtered.length !== betas.length) betas.splice(0, betas.length, ...filtered);
1518
1557
  }
1519
1558
  const model = init.body.match(/"model"\s*:\s*"([^"]+)"/)?.[1] ?? "";
1520
- if (model.includes("opus-4-8") || model.includes("opus-5") || model.includes("sonnet-5") || model.includes("fable-5")) {
1521
- if (!betas.includes("mid-conversation-system-2026-04-07")) betas.push("mid-conversation-system-2026-04-07");
1522
- }
1523
- for (const beta of [
1524
- "advisor-tool-2026-03-01",
1525
- ...!model.includes("haiku") ? ["effort-2025-11-24"] : [],
1526
- "fallback-credit-2026-06-01",
1527
- "extended-cache-ttl-2025-04-11"
1528
- ]) if (!betas.includes(beta)) betas.push(beta);
1529
- reqHeaders.set("anthropic-beta", betas.join(","));
1559
+ const base = model.includes("haiku") ? HAIKU_OAUTH_BETAS : OAUTH_BETAS;
1560
+ const ordered = [...base, ...betas.filter((beta) => !base.includes(beta))];
1561
+ for (const beta of modelOAuthBetas(model)) if (!ordered.includes(beta)) ordered.push(beta);
1562
+ reqHeaders.set("anthropic-beta", ordered.join(","));
1530
1563
  init = {
1531
1564
  ...init,
1532
1565
  headers: reqHeaders
@@ -1583,4 +1616,4 @@ function createAnthropicSDK(options = {}) {
1583
1616
  } };
1584
1617
  }
1585
1618
  //#endregion
1586
- export { CLAUDE_CODE_SONNET5_SYSTEM_PROMPT as a, buildPluginModels as c, selectClaudePromptForModel as d, CLAUDE_CODE_SONNET55_SYSTEM_PROMPT as i, createAnthropicSDK as l, CLAUDE_CODE_NEW_SYSTEM_PROMPT as n, CLAUDE_CODE_SYSTEM_PROMPT as o, CLAUDE_CODE_OPUS5_SYSTEM_PROMPT as r, PROVIDER_ID as s, CLAUDE_CODE_FABLE5_SYSTEM_PROMPT as t, resolveAuth as u };
1619
+ export { CLAUDE_CODE_SONNET55_SYSTEM_PROMPT as a, PROVIDER_ID as c, resolveAuth as d, selectClaudePromptForModel as f, CLAUDE_CODE_OPUS5_SYSTEM_PROMPT as i, buildPluginModels as l, CLAUDE_CODE_FABLE5_SYSTEM_PROMPT as n, CLAUDE_CODE_SONNET5_SYSTEM_PROMPT as o, CLAUDE_CODE_NEW_SYSTEM_PROMPT as r, CLAUDE_CODE_SYSTEM_PROMPT as s, CLAUDE_CODE_FABLE51_SYSTEM_PROMPT as t, createAnthropicSDK as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtruder/opencode-claude-max-plugin",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "OpenCode plugin for Claude Max/Pro subscription via @anthropic-ai/sdk - uses Claude Code OAuth credentials",
5
5
  "keywords": [
6
6
  "ai-sdk",
@@ -50,7 +50,7 @@
50
50
  "prepare": "simple-git-hooks"
51
51
  },
52
52
  "dependencies": {
53
- "@anthropic-ai/sdk": "0.94.0",
53
+ "@anthropic-ai/sdk": "0.127.0",
54
54
  "@opentui/core": "0.5.10",
55
55
  "@opentui/solid": "0.5.10",
56
56
  "solid-js": "1.9.12",