@xtruder/opencode-claude-max-plugin 0.4.1 → 0.4.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.js CHANGED
@@ -885,6 +885,9 @@ function buildMetadata() {
885
885
  function supportsContextManagement(apiModelId) {
886
886
  return !apiModelId.includes("claude-3-");
887
887
  }
888
+ function usesAdaptiveThinking(apiModelId) {
889
+ return apiModelId.includes("claude-opus-4-7") || apiModelId.includes("claude-opus-4-8") || apiModelId.includes("claude-fable-5");
890
+ }
888
891
  function placeMessageBreakpoints(messages, cache) {
889
892
  if (messages.length === 0)
890
893
  return;
@@ -957,6 +960,9 @@ class AnthropicSDKModel {
957
960
  const providerOpts = options.providerOptions?.["anthropic-sdk"] ?? options.providerOptions?.anthropic;
958
961
  const effort = providerOpts?.effort ?? "medium";
959
962
  params.output_config = { effort };
963
+ if (usesAdaptiveThinking(this.apiModelId)) {
964
+ params.thinking = { type: "adaptive", display: "summarized" };
965
+ }
960
966
  }
961
967
  } else if (system) {
962
968
  const CACHE = { type: "ephemeral" };
@@ -995,7 +1001,12 @@ class AnthropicSDKModel {
995
1001
  if (anthropicOptions.thinking) {
996
1002
  const t = anthropicOptions.thinking;
997
1003
  if (t.type === "adaptive") {
998
- params.thinking = { type: "adaptive" };
1004
+ params.thinking = {
1005
+ type: "adaptive",
1006
+ display: t.display ?? (usesAdaptiveThinking(this.apiModelId) ? "summarized" : undefined)
1007
+ };
1008
+ if (params.thinking.display == null)
1009
+ delete params.thinking.display;
999
1010
  } else if (t.type === "enabled" && t.budgetTokens) {
1000
1011
  params.thinking = { type: "enabled", budget_tokens: t.budgetTokens };
1001
1012
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAG1B,6BAA6B,EAE7B,2BAA2B,EAE5B,MAAM,kBAAkB,CAAA;A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7E"}
package/build/server.js CHANGED
@@ -885,6 +885,9 @@ function buildMetadata() {
885
885
  function supportsContextManagement(apiModelId) {
886
886
  return !apiModelId.includes("claude-3-");
887
887
  }
888
+ function usesAdaptiveThinking(apiModelId) {
889
+ return apiModelId.includes("claude-opus-4-7") || apiModelId.includes("claude-opus-4-8") || apiModelId.includes("claude-fable-5");
890
+ }
888
891
  function placeMessageBreakpoints(messages, cache) {
889
892
  if (messages.length === 0)
890
893
  return;
@@ -957,6 +960,9 @@ class AnthropicSDKModel {
957
960
  const providerOpts = options.providerOptions?.["anthropic-sdk"] ?? options.providerOptions?.anthropic;
958
961
  const effort = providerOpts?.effort ?? "medium";
959
962
  params.output_config = { effort };
963
+ if (usesAdaptiveThinking(this.apiModelId)) {
964
+ params.thinking = { type: "adaptive", display: "summarized" };
965
+ }
960
966
  }
961
967
  } else if (system) {
962
968
  const CACHE = { type: "ephemeral" };
@@ -995,7 +1001,12 @@ class AnthropicSDKModel {
995
1001
  if (anthropicOptions.thinking) {
996
1002
  const t = anthropicOptions.thinking;
997
1003
  if (t.type === "adaptive") {
998
- params.thinking = { type: "adaptive" };
1004
+ params.thinking = {
1005
+ type: "adaptive",
1006
+ display: t.display ?? (usesAdaptiveThinking(this.apiModelId) ? "summarized" : undefined)
1007
+ };
1008
+ if (params.thinking.display == null)
1009
+ delete params.thinking.display;
999
1010
  } else if (t.type === "enabled" && t.budgetTokens) {
1000
1011
  params.thinking = { type: "enabled", budget_tokens: t.budgetTokens };
1001
1012
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtruder/opencode-claude-max-plugin",
3
- "version": "0.4.1",
3
+ "version": "0.4.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",