@hiper2d/ai-agents 0.7.0 → 0.8.0

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/dist/index.js CHANGED
@@ -998,9 +998,13 @@ var SupportedAiModels = {
998
998
  tags: ["expensive"]
999
999
  },
1000
1000
  // Claude models — thinking-only entries (non-thinking variants retired 2026-08-05)
1001
+ // Opus moved 5 → 5.5 on 2026-09-22 (`claude-opus-5-5`, verified against GET /v1/models).
1002
+ // Cheaper than Opus 5 ($4/$20 vs $5/$25) and the same 1M context / 128K output. Thinking is
1003
+ // always on, as on Opus 5. Its API default effort is `medium`, but we keep the catalog-wide
1004
+ // `high` pin so bot answers don't get shallower than every other model in the lobby.
1001
1005
  [LLM_CONSTANTS.CLAUDE_OPUS]: {
1002
- displayName: "Claude 5 Opus",
1003
- modelApiName: "claude-opus-5",
1006
+ displayName: "Claude 5.5 Opus",
1007
+ modelApiName: "claude-opus-5-5",
1004
1008
  apiKeyName: API_KEY_CONSTANTS.ANTHROPIC,
1005
1009
  hasThinking: true,
1006
1010
  reasoningEffort: "high",
@@ -1473,9 +1477,13 @@ var MODEL_PRICING = {
1473
1477
  cacheHitPrice: 0.25
1474
1478
  },
1475
1479
  [SupportedAiModels[LLM_CONSTANTS.CLAUDE_OPUS].modelApiName]: {
1476
- inputPrice: 5,
1477
- outputPrice: 25,
1478
- cacheHitPrice: 0.5
1480
+ // Opus 5.5 (2026-09-22): $4/$20, down from Opus 5's $5/$25. Cache reads are 5% of input
1481
+ // here, not the usual 10% — $0.20, not $0.40. Cache WRITES ($5 at 5m, $8 at 1h) are not
1482
+ // modelled: calculateCost bills every uncached prompt token at inputPrice, so a write is
1483
+ // under-billed by the 1.25x/2x premium. Pre-existing for every Anthropic model.
1484
+ inputPrice: 4,
1485
+ outputPrice: 20,
1486
+ cacheHitPrice: 0.2
1479
1487
  },
1480
1488
  [SupportedAiModels[LLM_CONSTANTS.CLAUDE_SONNET].modelApiName]: {
1481
1489
  inputPrice: 2,
@@ -2633,6 +2641,7 @@ ${instruction}`);
2633
2641
 
2634
2642
  // src/agents/anthropic-agent.ts
2635
2643
  var import_sdk = require("@anthropic-ai/sdk");
2644
+ var rejectsDisabledThinking = (model) => model.includes("fable") || model.includes("opus-5-5");
2636
2645
  var ClaudeAgent = class extends AbstractAgent {
2637
2646
  client;
2638
2647
  /**
@@ -2849,7 +2858,9 @@ ${schemaDescription}`;
2849
2858
  params.temperature = 1;
2850
2859
  }
2851
2860
  } else if (usesAdaptiveThinking) {
2852
- params.thinking = { type: "disabled" };
2861
+ if (!rejectsDisabledThinking(this.model)) {
2862
+ params.thinking = { type: "disabled" };
2863
+ }
2853
2864
  } else {
2854
2865
  params.temperature = this.temperature;
2855
2866
  }
@@ -2943,7 +2954,9 @@ ${schemaDescription}`;
2943
2954
  params.temperature = 1;
2944
2955
  }
2945
2956
  } else if (usesAdaptiveThinking) {
2946
- params.thinking = { type: "disabled" };
2957
+ if (!rejectsDisabledThinking(this.model)) {
2958
+ params.thinking = { type: "disabled" };
2959
+ }
2947
2960
  } else {
2948
2961
  params.temperature = this.temperature;
2949
2962
  }