@cortexkit/pi-anthropic-auth 1.12.0 → 1.12.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.
Files changed (2) hide show
  1. package/dist/convert.js +10 -2
  2. package/package.json +2 -2
package/dist/convert.js CHANGED
@@ -1,4 +1,4 @@
1
- import { applyClaudeCodeMetadata, buildBillingHeaderValue, CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_IDENTITY, CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING, isClaudeFableOrMythos5Model, isFastModeSupportedModel, isOpenAIReasoningSignature, orderClaudeCodeBody, signRequestBody, } from '@cortexkit/anthropic-auth-core';
1
+ import { applyClaudeCodeMetadata, buildBillingHeaderValue, CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_IDENTITY, CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING, CLAUDE_SONNET_5_ADAPTIVE_THINKING, isClaudeFableOrMythos5Model, isClaudeSonnet5Model, isFastModeSupportedModel, isOpenAIReasoningSignature, orderClaudeCodeBody, signRequestBody, } from '@cortexkit/anthropic-auth-core';
2
2
  const CLAUDE_CODE_TOOLS = new Map([
3
3
  'Read',
4
4
  'Write',
@@ -312,11 +312,19 @@ export async function buildAnthropicRequest(modelId, context, options, cache, fa
312
312
  body.speed = 'fast';
313
313
  }
314
314
  const isFableOrMythos5 = isClaudeFableOrMythos5Model(modelId);
315
+ const isSonnet5 = isClaudeSonnet5Model(modelId);
316
+ // Sonnet 5 shares Fable/Mythos's adaptive-summarized contract: make adaptive
317
+ // thinking visible (display defaults to "omitted") and map reasoning to
318
+ // output_config effort. Pi's typed options cannot express thinking-disabled,
319
+ // so there is no disable case here (see transform.ts for the raw-body path).
315
320
  if (isFableOrMythos5) {
316
321
  body.thinking = { ...CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING };
317
322
  }
323
+ else if (isSonnet5) {
324
+ body.thinking = { ...CLAUDE_SONNET_5_ADAPTIVE_THINKING };
325
+ }
318
326
  if (options?.reasoning) {
319
- if (isFableOrMythos5) {
327
+ if (isFableOrMythos5 || isSonnet5) {
320
328
  body.output_config = { effort: options.reasoning };
321
329
  }
322
330
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-anthropic-auth",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  "prepublishOnly": "bun run build"
37
37
  },
38
38
  "dependencies": {
39
- "@cortexkit/anthropic-auth-core": "1.12.0"
39
+ "@cortexkit/anthropic-auth-core": "1.12.2"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@earendil-works/pi-ai": "*",