@kenkaiiii/gg-ai 4.3.223 → 4.3.225

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/README.md CHANGED
@@ -40,7 +40,7 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
40
40
 
41
41
  | Provider | Models | Notes |
42
42
  |---|---|---|
43
- | `anthropic` | Claude Opus 4.7, Sonnet 4.6, Haiku 4.5 | Extended thinking, prompt caching, server-side compaction |
43
+ | `anthropic` | Claude Opus 4.8, Sonnet 4.6, Haiku 4.5 | Extended thinking, prompt caching, server-side compaction |
44
44
  | `openai` | GPT-4.1, o3, o4-mini | Supports OAuth (codex endpoint) and API keys |
45
45
  | `glm` | GLM-5.1, GLM-4.7 | Z.AI platform, OpenAI-compatible |
46
46
  | `moonshot` | Kimi K2.6 | Moonshot platform, OpenAI-compatible |
package/dist/index.cjs CHANGED
@@ -588,12 +588,12 @@ function toAnthropicToolChoice(choice) {
588
588
  return { type: "tool", name: choice.name };
589
589
  }
590
590
  function supportsAdaptiveThinking(model) {
591
- return /opus-4-7|opus-4-6|sonnet-4-6/.test(model);
591
+ return /opus-4-8|opus-4-7|opus-4-6|sonnet-4-6/.test(model);
592
592
  }
593
593
  function toAnthropicThinking(level, maxTokens, model) {
594
594
  if (supportsAdaptiveThinking(model)) {
595
- let effort = level === "xhigh" ? "max" : level;
596
- if (effort === "max" && !model.includes("opus")) {
595
+ let effort = level;
596
+ if (effort === "xhigh" && !/opus-4-8|opus-4-7/.test(model)) {
597
597
  effort = "high";
598
598
  }
599
599
  return {
@@ -602,7 +602,7 @@ function toAnthropicThinking(level, maxTokens, model) {
602
602
  outputConfig: { effort }
603
603
  };
604
604
  }
605
- const effectiveLevel = level === "xhigh" ? "high" : level;
605
+ const effectiveLevel = level === "xhigh" || level === "max" ? "high" : level;
606
606
  const budgetMap = {
607
607
  low: Math.max(1024, Math.floor(maxTokens * 0.25)),
608
608
  medium: Math.max(2048, Math.floor(maxTokens * 0.5)),
@@ -736,7 +736,7 @@ function toOpenAIToolChoice(choice) {
736
736
  return { type: "function", function: { name: choice.name } };
737
737
  }
738
738
  function toOpenAIReasoningEffort(level, _model) {
739
- return level;
739
+ return level === "max" ? "xhigh" : level;
740
740
  }
741
741
  function normalizeAnthropicStopReason(reason) {
742
742
  switch (reason) {
@@ -863,7 +863,7 @@ async function* runStream(options) {
863
863
  })(),
864
864
  stream: useStreaming
865
865
  };
866
- const hasAdaptiveThinking = options.model.includes("opus-4-7") || options.model.includes("opus-4.7") || options.model.includes("opus-4-6") || options.model.includes("opus-4.6") || options.model.includes("sonnet-4-6") || options.model.includes("sonnet-4.6");
866
+ const hasAdaptiveThinking = options.model.includes("opus-4-8") || options.model.includes("opus-4.8") || options.model.includes("opus-4-7") || options.model.includes("opus-4.7") || options.model.includes("opus-4-6") || options.model.includes("opus-4.6") || options.model.includes("sonnet-4-6") || options.model.includes("sonnet-4.6");
867
867
  const betaHeaders = [
868
868
  ...isOAuth ? ["claude-code-20250219", "oauth-2025-04-20"] : [],
869
869
  ...options.compaction ? ["compact-2026-01-12"] : [],
@@ -2171,6 +2171,7 @@ function toGemini3ThinkingLevel(level) {
2171
2171
  return "MEDIUM";
2172
2172
  case "high":
2173
2173
  case "xhigh":
2174
+ case "max":
2174
2175
  return "HIGH";
2175
2176
  }
2176
2177
  }
@@ -2182,6 +2183,7 @@ function toThinkingBudget(level) {
2182
2183
  return 8192;
2183
2184
  case "high":
2184
2185
  case "xhigh":
2186
+ case "max":
2185
2187
  return 8192;
2186
2188
  }
2187
2189
  }