@tjamescouch/gro 1.3.13 → 1.3.14

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.
@@ -128,6 +128,23 @@ function parseResponseContent(data, onToken) {
128
128
  } : undefined;
129
129
  return { text, toolCalls, usage };
130
130
  }
131
+ /**
132
+ * Determine if a model supports Anthropic adaptive/extended thinking.
133
+ * Conservative allowlist approach: if we don't recognize the model,
134
+ * we omit thinking (safe default — API works fine without it).
135
+ */
136
+ function supportsAdaptiveThinking(model) {
137
+ const m = model.toLowerCase();
138
+ if (/claude-opus-4/.test(m))
139
+ return true;
140
+ if (/claude-sonnet-4/.test(m))
141
+ return true;
142
+ if (/claude-3[.-]7/.test(m))
143
+ return true;
144
+ if (/claude-3[.-]5-sonnet.*20241022/.test(m))
145
+ return true;
146
+ return false;
147
+ }
131
148
  export function makeAnthropicDriver(cfg) {
132
149
  const base = (cfg.baseUrl ?? "https://api.anthropic.com").replace(/\/+$/, "");
133
150
  const endpoint = `${base}/v1/messages`;
@@ -141,12 +158,13 @@ export function makeAnthropicDriver(cfg) {
141
158
  const { system: systemPrompt, apiMessages } = convertMessages(messages);
142
159
  const body = {
143
160
  model: resolvedModel,
144
- thinking: {
145
- type: "adaptive"
146
- },
147
161
  max_tokens: maxTokens,
148
162
  messages: apiMessages,
149
163
  };
164
+ // Only include adaptive thinking for models that support it
165
+ if (supportsAdaptiveThinking(resolvedModel)) {
166
+ body.thinking = { type: "adaptive" };
167
+ }
150
168
  if (systemPrompt)
151
169
  body.system = systemPrompt;
152
170
  // Tools support — convert from OpenAI format to Anthropic format
package/dist/main.js CHANGED
@@ -487,9 +487,9 @@ function formatOutput(text, format) {
487
487
  * the model needing to know the full versioned name.
488
488
  */
489
489
  const MODEL_ALIASES = {
490
- "haiku": "claude-haiku-4-20250514",
491
- "sonnet": "claude-sonnet-4-20250514",
492
- "opus": "claude-opus-4-20250514",
490
+ "haiku": "claude-haiku-4-5",
491
+ "sonnet": "claude-sonnet-4-5",
492
+ "opus": "claude-opus-4-6",
493
493
  "gpt4": "gpt-4o",
494
494
  "gpt4o": "gpt-4o",
495
495
  "gpt4o-mini": "gpt-4o-mini",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjamescouch/gro",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Provider-agnostic LLM runtime with context management",
5
5
  "bin": {
6
6
  "gro": "./dist/main.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjamescouch/gro",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Provider-agnostic LLM runtime with context management",
5
5
  "bin": {
6
6
  "gro": "./dist/main.js"