@axlsdk/axl 0.17.5 → 0.17.6

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.d.cts CHANGED
@@ -22,17 +22,22 @@ type ToolDefinition = {
22
22
  * minimum thinking level (3.1 Pro: 'low', others: 'minimal'). On other providers,
23
23
  * fully disables reasoning.
24
24
  * - `'low'` through `'max'` — Increasing levels of reasoning depth and token spend.
25
+ * - `'xhigh'` — Extra-high tier between `'high'` and `'max'`. Supported natively on
26
+ * Anthropic Opus 4.7 (`output_config.effort: 'xhigh'`) and OpenAI gpt-5.2+
27
+ * (`reasoning_effort: 'xhigh'`). Clamps to `'high'` on providers/models that
28
+ * don't expose a distinct xhigh level.
25
29
  *
26
30
  * Provider mapping:
27
- * - Anthropic 4.6: adaptive thinking + output_config.effort
28
- * - Anthropic Opus 4.5: output_config.effort (no adaptive)
31
+ * - Anthropic 4.7: adaptive thinking + output_config.effort (incl. 'xhigh')
32
+ * - Anthropic 4.6: adaptive thinking + output_config.effort (xhigh clamps to 'high')
33
+ * - Anthropic Opus 4.5: output_config.effort (no adaptive; xhigh clamps to 'high')
29
34
  * - Anthropic older: thinking.budget_tokens fallback
30
35
  * - OpenAI o-series: reasoning_effort
31
- * - OpenAI GPT-5.x: reasoning.effort / reasoning_effort
32
- * - Gemini 3.x: thinkingLevel (`'none'` → model min: `'minimal'` or `'low'` for 3.1 Pro)
36
+ * - OpenAI GPT-5.x: reasoning.effort / reasoning_effort (xhigh on gpt-5.2+)
37
+ * - Gemini 3.x: thinkingLevel (`'none'` → model min: `'minimal'` or `'low'` for 3.1 Pro; xhigh → 'high')
33
38
  * - Gemini 2.x: thinkingBudget (`'none'` → 0; some models have minimums)
34
39
  */
35
- type Effort = 'none' | 'low' | 'medium' | 'high' | 'max';
40
+ type Effort = 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
36
41
  /** Tool choice strategy for LLM calls. */
37
42
  type ToolChoice = 'auto' | 'none' | 'required' | {
38
43
  type: 'function';
package/dist/index.d.ts CHANGED
@@ -22,17 +22,22 @@ type ToolDefinition = {
22
22
  * minimum thinking level (3.1 Pro: 'low', others: 'minimal'). On other providers,
23
23
  * fully disables reasoning.
24
24
  * - `'low'` through `'max'` — Increasing levels of reasoning depth and token spend.
25
+ * - `'xhigh'` — Extra-high tier between `'high'` and `'max'`. Supported natively on
26
+ * Anthropic Opus 4.7 (`output_config.effort: 'xhigh'`) and OpenAI gpt-5.2+
27
+ * (`reasoning_effort: 'xhigh'`). Clamps to `'high'` on providers/models that
28
+ * don't expose a distinct xhigh level.
25
29
  *
26
30
  * Provider mapping:
27
- * - Anthropic 4.6: adaptive thinking + output_config.effort
28
- * - Anthropic Opus 4.5: output_config.effort (no adaptive)
31
+ * - Anthropic 4.7: adaptive thinking + output_config.effort (incl. 'xhigh')
32
+ * - Anthropic 4.6: adaptive thinking + output_config.effort (xhigh clamps to 'high')
33
+ * - Anthropic Opus 4.5: output_config.effort (no adaptive; xhigh clamps to 'high')
29
34
  * - Anthropic older: thinking.budget_tokens fallback
30
35
  * - OpenAI o-series: reasoning_effort
31
- * - OpenAI GPT-5.x: reasoning.effort / reasoning_effort
32
- * - Gemini 3.x: thinkingLevel (`'none'` → model min: `'minimal'` or `'low'` for 3.1 Pro)
36
+ * - OpenAI GPT-5.x: reasoning.effort / reasoning_effort (xhigh on gpt-5.2+)
37
+ * - Gemini 3.x: thinkingLevel (`'none'` → model min: `'minimal'` or `'low'` for 3.1 Pro; xhigh → 'high')
33
38
  * - Gemini 2.x: thinkingBudget (`'none'` → 0; some models have minimums)
34
39
  */
35
- type Effort = 'none' | 'low' | 'medium' | 'high' | 'max';
40
+ type Effort = 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
36
41
  /** Tool choice strategy for LLM calls. */
37
42
  type ToolChoice = 'auto' | 'none' | 'required' | {
38
43
  type: 'function';
package/dist/index.js CHANGED
@@ -839,6 +839,7 @@ var OpenAIResponsesProvider = class {
839
839
  // src/providers/anthropic.ts
840
840
  var ANTHROPIC_API_VERSION = "2023-06-01";
841
841
  var ANTHROPIC_PRICING = {
842
+ "claude-opus-4-7": [5e-6, 25e-6],
842
843
  "claude-opus-4-6": [5e-6, 25e-6],
843
844
  "claude-sonnet-4-6": [3e-6, 15e-6],
844
845
  "claude-opus-4-5": [5e-6, 25e-6],
@@ -883,13 +884,21 @@ var THINKING_BUDGETS = {
883
884
  max: 3e4
884
885
  };
885
886
  function supportsAdaptiveThinking(model) {
886
- return model.startsWith("claude-opus-4-6") || model.startsWith("claude-sonnet-4-6");
887
+ return model.startsWith("claude-opus-4-7") || model.startsWith("claude-opus-4-6") || model.startsWith("claude-sonnet-4-6");
887
888
  }
888
889
  function supportsMaxEffort(model) {
889
- return model.startsWith("claude-opus-4-6");
890
+ return model.startsWith("claude-opus-4-7") || model.startsWith("claude-opus-4-6");
891
+ }
892
+ function supportsXhigh2(model) {
893
+ return model.startsWith("claude-opus-4-7");
890
894
  }
891
895
  function supportsEffort(model) {
892
- return model.startsWith("claude-opus-4-6") || model.startsWith("claude-sonnet-4-6") || model.startsWith("claude-opus-4-5");
896
+ return model.startsWith("claude-opus-4-7") || model.startsWith("claude-opus-4-6") || model.startsWith("claude-sonnet-4-6") || model.startsWith("claude-opus-4-5");
897
+ }
898
+ function clampAnthropicEffort(model, effort) {
899
+ if (effort === "max" && !supportsMaxEffort(model)) return "high";
900
+ if (effort === "xhigh" && !supportsXhigh2(model)) return "high";
901
+ return effort;
893
902
  }
894
903
  var AnthropicProvider = class {
895
904
  name = "anthropic";
@@ -990,10 +999,7 @@ var AnthropicProvider = class {
990
999
  body.tool_choice = this.mapToolChoice(options.toolChoice);
991
1000
  }
992
1001
  const { thinkingBudget, thinkingDisabled, activeEffort, hasBudgetOverride } = resolveThinkingOptions(options);
993
- let resolvedEffort = activeEffort;
994
- if (resolvedEffort === "max" && !supportsMaxEffort(options.model)) {
995
- resolvedEffort = "high";
996
- }
1002
+ const resolvedEffort = activeEffort ? clampAnthropicEffort(options.model, activeEffort) : void 0;
997
1003
  if (hasBudgetOverride) {
998
1004
  body.thinking = { type: "enabled", budget_tokens: thinkingBudget };
999
1005
  const currentMax = body.max_tokens;
@@ -1360,6 +1366,7 @@ var GEMINI_PRICING = {
1360
1366
  "gemini-3-pro-preview": [2e-6, 12e-6],
1361
1367
  "gemini-3-flash-preview": [5e-7, 3e-6],
1362
1368
  "gemini-3.1-pro-preview": [2e-6, 12e-6],
1369
+ "gemini-3.1-flash-lite": [25e-8, 15e-7],
1363
1370
  "gemini-3.1-flash-lite-preview": [25e-8, 15e-7]
1364
1371
  };
1365
1372
  var GEMINI_PRICING_KEYS_BY_LENGTH = Object.keys(GEMINI_PRICING).sort(
@@ -1385,12 +1392,16 @@ var THINKING_BUDGETS2 = {
1385
1392
  low: 1024,
1386
1393
  medium: 5e3,
1387
1394
  high: 1e4,
1395
+ xhigh: 16384,
1396
+ // between high (10000) and max (24576)
1388
1397
  max: 24576
1389
1398
  };
1390
1399
  var THINKING_LEVELS = {
1391
1400
  low: "low",
1392
1401
  medium: "medium",
1393
1402
  high: "high",
1403
+ xhigh: "high",
1404
+ // 3.x has no xhigh tier; clamp to 'high'
1394
1405
  max: "high"
1395
1406
  // 3.x caps at 'high'
1396
1407
  };