@omnicross/contracts 0.1.7 → 0.1.9

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.
@@ -29,9 +29,9 @@ __export(canonical_models_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(canonical_models_exports);
31
31
  var OPENAI_MODELS = {
32
- "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
33
- "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
34
- "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
32
+ "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
33
+ "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
34
+ "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
35
35
  "gpt-5.5": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
36
36
  "gpt-5.4": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
37
37
  "gpt-5.4-mini": { category: "reasoning", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
@@ -200,6 +200,7 @@ function normalizeModelId(rawId) {
200
200
  return noSuffix.toLowerCase();
201
201
  }
202
202
  var MODEL_ALIASES = {
203
+ "gpt-5.6": "gpt-5.6-sol",
203
204
  "deepseek-chat": "deepseek-v3",
204
205
  "deepseek-reasoner": "deepseek-r1"
205
206
  };
@@ -71,9 +71,8 @@ declare function normalizeModelId(rawId: string): string;
71
71
  * assertion at module load enforces this so the alias map can't drift to
72
72
  * point at non-existent entries.
73
73
  *
74
- * Currently covers DeepSeek's marketing names (`deepseek-chat` is the
75
- * marketing alias for the latest non-reasoning model historically v3,
76
- * may rotate as new releases land).
74
+ * Includes official API aliases plus vendor marketing names. DeepSeek's
75
+ * `deepseek-chat` historically targets v3 and may rotate as new releases land.
77
76
  */
78
77
  declare const MODEL_ALIASES: Record<string, string>;
79
78
  /**
@@ -71,9 +71,8 @@ declare function normalizeModelId(rawId: string): string;
71
71
  * assertion at module load enforces this so the alias map can't drift to
72
72
  * point at non-existent entries.
73
73
  *
74
- * Currently covers DeepSeek's marketing names (`deepseek-chat` is the
75
- * marketing alias for the latest non-reasoning model historically v3,
76
- * may rotate as new releases land).
74
+ * Includes official API aliases plus vendor marketing names. DeepSeek's
75
+ * `deepseek-chat` historically targets v3 and may rotate as new releases land.
77
76
  */
78
77
  declare const MODEL_ALIASES: Record<string, string>;
79
78
  /**
@@ -1,8 +1,8 @@
1
1
  // src/canonical-models.ts
2
2
  var OPENAI_MODELS = {
3
- "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
4
- "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
5
- "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
3
+ "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
4
+ "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
5
+ "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
6
6
  "gpt-5.5": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
7
7
  "gpt-5.4": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
8
8
  "gpt-5.4-mini": { category: "reasoning", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
@@ -171,6 +171,7 @@ function normalizeModelId(rawId) {
171
171
  return noSuffix.toLowerCase();
172
172
  }
173
173
  var MODEL_ALIASES = {
174
+ "gpt-5.6": "gpt-5.6-sol",
174
175
  "deepseek-chat": "deepseek-v3",
175
176
  "deepseek-reasoner": "deepseek-r1"
176
177
  };
package/dist/index.cjs CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  EFFORT_RATIO: () => EFFORT_RATIO,
36
36
  EXTENDED_CONTEXT_CAPABLE_MODELS: () => EXTENDED_CONTEXT_CAPABLE_MODELS,
37
37
  KNOWN_MODELS: () => KNOWN_MODELS,
38
+ LEGACY_THINKING_TOKEN_LIMITS: () => LEGACY_THINKING_TOKEN_LIMITS,
38
39
  LLM_PROVIDER_PRESETS: () => LLM_PROVIDER_PRESETS,
39
40
  MAX_CONCURRENCY_DEFAULTS: () => MAX_CONCURRENCY_DEFAULTS,
40
41
  MODEL_ALIASES: () => MODEL_ALIASES,
@@ -51,6 +52,7 @@ __export(index_exports, {
51
52
  buildQwenThinkingConfig: () => buildQwenThinkingConfig,
52
53
  calculateThinkingBudget: () => calculateThinkingBudget,
53
54
  canDisableThinking: () => canDisableThinking,
55
+ findLegacyTokenLimit: () => findLegacyTokenLimit,
54
56
  findTokenLimit: () => findTokenLimit,
55
57
  getAllProviderPresets: () => getAllProviderPresets,
56
58
  getClaudeMaxTokens: () => getClaudeMaxTokens,
@@ -92,9 +94,9 @@ var DEFAULT_BILLING_CONFIG = {
92
94
 
93
95
  // src/canonical-models.ts
94
96
  var OPENAI_MODELS = {
95
- "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
96
- "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
97
- "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
97
+ "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
98
+ "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
99
+ "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
98
100
  "gpt-5.5": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
99
101
  "gpt-5.4": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
100
102
  "gpt-5.4-mini": { category: "reasoning", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
@@ -263,6 +265,7 @@ function normalizeModelId(rawId) {
263
265
  return noSuffix.toLowerCase();
264
266
  }
265
267
  var MODEL_ALIASES = {
268
+ "gpt-5.6": "gpt-5.6-sol",
266
269
  "deepseek-chat": "deepseek-v3",
267
270
  "deepseek-reasoner": "deepseek-r1"
268
271
  };
@@ -573,6 +576,7 @@ var DEFAULT_SEED_PRESET_IDS = [
573
576
  // MiniMax + Xiaomi MiMo bumped up next to Kimi per UX preference —
574
577
  // popular Anthropic-format Chinese providers cluster together.
575
578
  "openrouter",
579
+ "openrouter-response",
576
580
  "zhipu",
577
581
  "zhipu-bigmodel",
578
582
  "kimi",
@@ -1615,6 +1619,63 @@ var openrouter_default = {
1615
1619
  ]
1616
1620
  };
1617
1621
 
1622
+ // src/provider-presets/presets/openrouter-response.json
1623
+ var openrouter_response_default = {
1624
+ id: "openrouter-response",
1625
+ presetId: "openrouter-response",
1626
+ name: "OpenRouter (Responses API)",
1627
+ apiFormat: "openai-response",
1628
+ api_base_url: "https://openrouter.ai/api/v1",
1629
+ modelsEndpoint: "https://openrouter.ai/api/v1/models",
1630
+ models: [
1631
+ "anthropic/claude-sonnet-4-6",
1632
+ "openai/gpt-5",
1633
+ "google/gemini-3.1-pro",
1634
+ "meta-llama/llama-3.3-70b-instruct",
1635
+ "deepseek/deepseek-v3.2"
1636
+ ],
1637
+ modelConfigs: [
1638
+ {
1639
+ id: "anthropic/claude-sonnet-4-6",
1640
+ name: "Claude Sonnet 4.6 (OpenRouter Responses)",
1641
+ enabled: true
1642
+ },
1643
+ {
1644
+ id: "openai/gpt-5",
1645
+ name: "GPT-5 (OpenRouter Responses)",
1646
+ enabled: true
1647
+ },
1648
+ {
1649
+ id: "google/gemini-3.1-pro",
1650
+ name: "Gemini 3.1 Pro (OpenRouter Responses)",
1651
+ enabled: true
1652
+ },
1653
+ {
1654
+ id: "meta-llama/llama-3.3-70b-instruct",
1655
+ name: "Llama 3.3 70B (OpenRouter Responses)",
1656
+ enabled: true
1657
+ },
1658
+ {
1659
+ id: "deepseek/deepseek-v3.2",
1660
+ name: "DeepSeek V3.2 (OpenRouter Responses)",
1661
+ enabled: true
1662
+ }
1663
+ ],
1664
+ description: "OpenRouter Responses API \u2014 \u539F\u6837\u900F\u4F20 Responses \u53C2\u6570\uFF0C\u652F\u6301 Claude \u663E\u5F0F\u7F13\u5B58\u63A7\u5236",
1665
+ icon: "openrouter",
1666
+ website: "https://openrouter.ai",
1667
+ docsUrl: "https://openrouter.ai/docs/api-reference/responses/overview",
1668
+ defaultSettings: {
1669
+ temperature: 0.7,
1670
+ maxTokens: 4096
1671
+ },
1672
+ isSystem: true,
1673
+ features: [
1674
+ "vision",
1675
+ "reasoning"
1676
+ ]
1677
+ };
1678
+
1618
1679
  // src/provider-presets/presets/perplexity.json
1619
1680
  var perplexity_default = {
1620
1681
  id: "perplexity",
@@ -2335,6 +2396,7 @@ var RAW_PRESETS_IN_ORDER = [
2335
2396
  openai_response_default,
2336
2397
  siliconflow_default,
2337
2398
  openrouter_default,
2399
+ openrouter_response_default,
2338
2400
  mistral_default,
2339
2401
  together_default,
2340
2402
  perplexity_default,
@@ -2524,7 +2586,7 @@ var EFFORT_RATIO = {
2524
2586
  max: 0.95
2525
2587
  };
2526
2588
  var DEFAULT_MAX_TOKENS = 4096;
2527
- var THINKING_TOKEN_MAP = {
2589
+ var LEGACY_THINKING_TOKEN_LIMITS = {
2528
2590
  // Gemini
2529
2591
  "gemini-2\\.5-flash-lite": { min: 512, max: 24576 },
2530
2592
  "gemini-.*-flash": { min: 0, max: 24576 },
@@ -2580,6 +2642,7 @@ var THINKING_TOKEN_MAP = {
2580
2642
  // Doubao
2581
2643
  "doubao.*think": { min: 0, max: 16384 }
2582
2644
  };
2645
+ var THINKING_TOKEN_MAP = LEGACY_THINKING_TOKEN_LIMITS;
2583
2646
  var REASONING_MODEL_PATTERNS = [
2584
2647
  /^o[134](-mini|-preview|-pro)?$/i,
2585
2648
  /^gpt-5(\.\d)?(-pro|-codex|-codex-max)?/i,
@@ -2612,8 +2675,14 @@ function findTokenLimit(modelOrId) {
2612
2675
  if (modelOrId.thinkingTokenLimit) return modelOrId.thinkingTokenLimit;
2613
2676
  return findTokenLimit(modelOrId.id);
2614
2677
  }
2615
- const lowerModelId = modelOrId.toLowerCase();
2616
- for (const [pattern, limit] of Object.entries(THINKING_TOKEN_MAP)) {
2678
+ const canonicalLimit = lookupCanonicalCapabilities(modelOrId)?.thinkingTokenLimit;
2679
+ if (canonicalLimit) return canonicalLimit;
2680
+ return findLegacyTokenLimit(modelOrId);
2681
+ }
2682
+ function findLegacyTokenLimit(modelId) {
2683
+ if (!modelId) return null;
2684
+ const lowerModelId = modelId.toLowerCase();
2685
+ for (const [pattern, limit] of Object.entries(LEGACY_THINKING_TOKEN_LIMITS)) {
2617
2686
  const regex = new RegExp(pattern, "i");
2618
2687
  if (regex.test(lowerModelId)) {
2619
2688
  return limit;
@@ -2743,6 +2812,7 @@ function isLocalProvider(id) {
2743
2812
  EFFORT_RATIO,
2744
2813
  EXTENDED_CONTEXT_CAPABLE_MODELS,
2745
2814
  KNOWN_MODELS,
2815
+ LEGACY_THINKING_TOKEN_LIMITS,
2746
2816
  LLM_PROVIDER_PRESETS,
2747
2817
  MAX_CONCURRENCY_DEFAULTS,
2748
2818
  MODEL_ALIASES,
@@ -2759,6 +2829,7 @@ function isLocalProvider(id) {
2759
2829
  buildQwenThinkingConfig,
2760
2830
  calculateThinkingBudget,
2761
2831
  canDisableThinking,
2832
+ findLegacyTokenLimit,
2762
2833
  findTokenLimit,
2763
2834
  getAllProviderPresets,
2764
2835
  getClaudeMaxTokens,
package/dist/index.d.cts CHANGED
@@ -15,7 +15,7 @@ export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBl
15
15
  export { DEFAULT_LITELLM_PRICING_URL, DEFAULT_OPENROUTER_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource, PricingSourceRefreshResult } from './pricing-types.cjs';
16
16
  export { CATALOG_VERSION, CODING_PLAN_URL_PRESETS, DEFAULT_SEED_PRESET_IDS, LLM_PROVIDER_PRESETS, MAX_CONCURRENCY_DEFAULTS, PROVIDER_MODEL_MAPPINGS, PROVIDER_SEARCH_CONFIGS, getAllProviderPresets, getCodingPlanBaseUrl, getPresetById, getPresetRevision, getProviderSearchConfig, resolveFollowProviderModel } from './provider-presets/index.cjs';
17
17
  export { SUBSCRIPTION_MODEL_CATALOG, subscriptionProviderHasCatalog } from './subscription-model-catalog.cjs';
18
- export { CANNOT_DISABLE_THINKING_PATTERNS, DEFAULT_MAX_TOKENS, EFFORT_RATIO, REASONING_MODEL_PATTERNS, THINKING_TOKEN_MAP, buildAnthropicThinking, buildGeminiThinkingConfig, buildQwenThinkingConfig, calculateThinkingBudget, canDisableThinking, findTokenLimit, getClaudeMaxTokens, getOpenAIReasoningEffort, isReasoningModel } from './thinking-config.cjs';
18
+ export { CANNOT_DISABLE_THINKING_PATTERNS, DEFAULT_MAX_TOKENS, EFFORT_RATIO, LEGACY_THINKING_TOKEN_LIMITS, REASONING_MODEL_PATTERNS, THINKING_TOKEN_MAP, buildAnthropicThinking, buildGeminiThinkingConfig, buildQwenThinkingConfig, calculateThinkingBudget, canDisableThinking, findLegacyTokenLimit, findTokenLimit, getClaudeMaxTokens, getOpenAIReasoningEffort, isReasoningModel } from './thinking-config.cjs';
19
19
  export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageCacheKeySource, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.cjs';
20
20
  export { UsageEngineOrigin, UsageTokens } from './usage-types.cjs';
21
21
  export { DEFAULT_VOUCHER_CONFIG, VoucherConfig, VoucherCreated, VoucherGrant, VoucherInfo, VoucherRecord, VoucherRedeemResult, VoucherStatus, VoucherType } from './voucher-types.cjs';
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBl
15
15
  export { DEFAULT_LITELLM_PRICING_URL, DEFAULT_OPENROUTER_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource, PricingSourceRefreshResult } from './pricing-types.js';
16
16
  export { CATALOG_VERSION, CODING_PLAN_URL_PRESETS, DEFAULT_SEED_PRESET_IDS, LLM_PROVIDER_PRESETS, MAX_CONCURRENCY_DEFAULTS, PROVIDER_MODEL_MAPPINGS, PROVIDER_SEARCH_CONFIGS, getAllProviderPresets, getCodingPlanBaseUrl, getPresetById, getPresetRevision, getProviderSearchConfig, resolveFollowProviderModel } from './provider-presets/index.js';
17
17
  export { SUBSCRIPTION_MODEL_CATALOG, subscriptionProviderHasCatalog } from './subscription-model-catalog.js';
18
- export { CANNOT_DISABLE_THINKING_PATTERNS, DEFAULT_MAX_TOKENS, EFFORT_RATIO, REASONING_MODEL_PATTERNS, THINKING_TOKEN_MAP, buildAnthropicThinking, buildGeminiThinkingConfig, buildQwenThinkingConfig, calculateThinkingBudget, canDisableThinking, findTokenLimit, getClaudeMaxTokens, getOpenAIReasoningEffort, isReasoningModel } from './thinking-config.js';
18
+ export { CANNOT_DISABLE_THINKING_PATTERNS, DEFAULT_MAX_TOKENS, EFFORT_RATIO, LEGACY_THINKING_TOKEN_LIMITS, REASONING_MODEL_PATTERNS, THINKING_TOKEN_MAP, buildAnthropicThinking, buildGeminiThinkingConfig, buildQwenThinkingConfig, calculateThinkingBudget, canDisableThinking, findLegacyTokenLimit, findTokenLimit, getClaudeMaxTokens, getOpenAIReasoningEffort, isReasoningModel } from './thinking-config.js';
19
19
  export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageCacheKeySource, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.js';
20
20
  export { UsageEngineOrigin, UsageTokens } from './usage-types.js';
21
21
  export { DEFAULT_VOUCHER_CONFIG, VoucherConfig, VoucherCreated, VoucherGrant, VoucherInfo, VoucherRecord, VoucherRedeemResult, VoucherStatus, VoucherType } from './voucher-types.js';
package/dist/index.js CHANGED
@@ -15,9 +15,9 @@ var DEFAULT_BILLING_CONFIG = {
15
15
 
16
16
  // src/canonical-models.ts
17
17
  var OPENAI_MODELS = {
18
- "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
19
- "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
20
- "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
18
+ "gpt-5.6-sol": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
19
+ "gpt-5.6-terra": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
20
+ "gpt-5.6-luna": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 0, max: 128e3 } },
21
21
  "gpt-5.5": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
22
22
  "gpt-5.4": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
23
23
  "gpt-5.4-mini": { category: "reasoning", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
@@ -186,6 +186,7 @@ function normalizeModelId(rawId) {
186
186
  return noSuffix.toLowerCase();
187
187
  }
188
188
  var MODEL_ALIASES = {
189
+ "gpt-5.6": "gpt-5.6-sol",
189
190
  "deepseek-chat": "deepseek-v3",
190
191
  "deepseek-reasoner": "deepseek-r1"
191
192
  };
@@ -496,6 +497,7 @@ var DEFAULT_SEED_PRESET_IDS = [
496
497
  // MiniMax + Xiaomi MiMo bumped up next to Kimi per UX preference —
497
498
  // popular Anthropic-format Chinese providers cluster together.
498
499
  "openrouter",
500
+ "openrouter-response",
499
501
  "zhipu",
500
502
  "zhipu-bigmodel",
501
503
  "kimi",
@@ -1538,6 +1540,63 @@ var openrouter_default = {
1538
1540
  ]
1539
1541
  };
1540
1542
 
1543
+ // src/provider-presets/presets/openrouter-response.json
1544
+ var openrouter_response_default = {
1545
+ id: "openrouter-response",
1546
+ presetId: "openrouter-response",
1547
+ name: "OpenRouter (Responses API)",
1548
+ apiFormat: "openai-response",
1549
+ api_base_url: "https://openrouter.ai/api/v1",
1550
+ modelsEndpoint: "https://openrouter.ai/api/v1/models",
1551
+ models: [
1552
+ "anthropic/claude-sonnet-4-6",
1553
+ "openai/gpt-5",
1554
+ "google/gemini-3.1-pro",
1555
+ "meta-llama/llama-3.3-70b-instruct",
1556
+ "deepseek/deepseek-v3.2"
1557
+ ],
1558
+ modelConfigs: [
1559
+ {
1560
+ id: "anthropic/claude-sonnet-4-6",
1561
+ name: "Claude Sonnet 4.6 (OpenRouter Responses)",
1562
+ enabled: true
1563
+ },
1564
+ {
1565
+ id: "openai/gpt-5",
1566
+ name: "GPT-5 (OpenRouter Responses)",
1567
+ enabled: true
1568
+ },
1569
+ {
1570
+ id: "google/gemini-3.1-pro",
1571
+ name: "Gemini 3.1 Pro (OpenRouter Responses)",
1572
+ enabled: true
1573
+ },
1574
+ {
1575
+ id: "meta-llama/llama-3.3-70b-instruct",
1576
+ name: "Llama 3.3 70B (OpenRouter Responses)",
1577
+ enabled: true
1578
+ },
1579
+ {
1580
+ id: "deepseek/deepseek-v3.2",
1581
+ name: "DeepSeek V3.2 (OpenRouter Responses)",
1582
+ enabled: true
1583
+ }
1584
+ ],
1585
+ description: "OpenRouter Responses API \u2014 \u539F\u6837\u900F\u4F20 Responses \u53C2\u6570\uFF0C\u652F\u6301 Claude \u663E\u5F0F\u7F13\u5B58\u63A7\u5236",
1586
+ icon: "openrouter",
1587
+ website: "https://openrouter.ai",
1588
+ docsUrl: "https://openrouter.ai/docs/api-reference/responses/overview",
1589
+ defaultSettings: {
1590
+ temperature: 0.7,
1591
+ maxTokens: 4096
1592
+ },
1593
+ isSystem: true,
1594
+ features: [
1595
+ "vision",
1596
+ "reasoning"
1597
+ ]
1598
+ };
1599
+
1541
1600
  // src/provider-presets/presets/perplexity.json
1542
1601
  var perplexity_default = {
1543
1602
  id: "perplexity",
@@ -2258,6 +2317,7 @@ var RAW_PRESETS_IN_ORDER = [
2258
2317
  openai_response_default,
2259
2318
  siliconflow_default,
2260
2319
  openrouter_default,
2320
+ openrouter_response_default,
2261
2321
  mistral_default,
2262
2322
  together_default,
2263
2323
  perplexity_default,
@@ -2447,7 +2507,7 @@ var EFFORT_RATIO = {
2447
2507
  max: 0.95
2448
2508
  };
2449
2509
  var DEFAULT_MAX_TOKENS = 4096;
2450
- var THINKING_TOKEN_MAP = {
2510
+ var LEGACY_THINKING_TOKEN_LIMITS = {
2451
2511
  // Gemini
2452
2512
  "gemini-2\\.5-flash-lite": { min: 512, max: 24576 },
2453
2513
  "gemini-.*-flash": { min: 0, max: 24576 },
@@ -2503,6 +2563,7 @@ var THINKING_TOKEN_MAP = {
2503
2563
  // Doubao
2504
2564
  "doubao.*think": { min: 0, max: 16384 }
2505
2565
  };
2566
+ var THINKING_TOKEN_MAP = LEGACY_THINKING_TOKEN_LIMITS;
2506
2567
  var REASONING_MODEL_PATTERNS = [
2507
2568
  /^o[134](-mini|-preview|-pro)?$/i,
2508
2569
  /^gpt-5(\.\d)?(-pro|-codex|-codex-max)?/i,
@@ -2535,8 +2596,14 @@ function findTokenLimit(modelOrId) {
2535
2596
  if (modelOrId.thinkingTokenLimit) return modelOrId.thinkingTokenLimit;
2536
2597
  return findTokenLimit(modelOrId.id);
2537
2598
  }
2538
- const lowerModelId = modelOrId.toLowerCase();
2539
- for (const [pattern, limit] of Object.entries(THINKING_TOKEN_MAP)) {
2599
+ const canonicalLimit = lookupCanonicalCapabilities(modelOrId)?.thinkingTokenLimit;
2600
+ if (canonicalLimit) return canonicalLimit;
2601
+ return findLegacyTokenLimit(modelOrId);
2602
+ }
2603
+ function findLegacyTokenLimit(modelId) {
2604
+ if (!modelId) return null;
2605
+ const lowerModelId = modelId.toLowerCase();
2606
+ for (const [pattern, limit] of Object.entries(LEGACY_THINKING_TOKEN_LIMITS)) {
2540
2607
  const regex = new RegExp(pattern, "i");
2541
2608
  if (regex.test(lowerModelId)) {
2542
2609
  return limit;
@@ -2665,6 +2732,7 @@ export {
2665
2732
  EFFORT_RATIO,
2666
2733
  EXTENDED_CONTEXT_CAPABLE_MODELS,
2667
2734
  KNOWN_MODELS,
2735
+ LEGACY_THINKING_TOKEN_LIMITS,
2668
2736
  LLM_PROVIDER_PRESETS,
2669
2737
  MAX_CONCURRENCY_DEFAULTS,
2670
2738
  MODEL_ALIASES,
@@ -2681,6 +2749,7 @@ export {
2681
2749
  buildQwenThinkingConfig,
2682
2750
  calculateThinkingBudget,
2683
2751
  canDisableThinking,
2752
+ findLegacyTokenLimit,
2684
2753
  findTokenLimit,
2685
2754
  getAllProviderPresets,
2686
2755
  getClaudeMaxTokens,
@@ -232,6 +232,7 @@ var DEFAULT_SEED_PRESET_IDS = [
232
232
  // MiniMax + Xiaomi MiMo bumped up next to Kimi per UX preference —
233
233
  // popular Anthropic-format Chinese providers cluster together.
234
234
  "openrouter",
235
+ "openrouter-response",
235
236
  "zhipu",
236
237
  "zhipu-bigmodel",
237
238
  "kimi",
@@ -1274,6 +1275,63 @@ var openrouter_default = {
1274
1275
  ]
1275
1276
  };
1276
1277
 
1278
+ // src/provider-presets/presets/openrouter-response.json
1279
+ var openrouter_response_default = {
1280
+ id: "openrouter-response",
1281
+ presetId: "openrouter-response",
1282
+ name: "OpenRouter (Responses API)",
1283
+ apiFormat: "openai-response",
1284
+ api_base_url: "https://openrouter.ai/api/v1",
1285
+ modelsEndpoint: "https://openrouter.ai/api/v1/models",
1286
+ models: [
1287
+ "anthropic/claude-sonnet-4-6",
1288
+ "openai/gpt-5",
1289
+ "google/gemini-3.1-pro",
1290
+ "meta-llama/llama-3.3-70b-instruct",
1291
+ "deepseek/deepseek-v3.2"
1292
+ ],
1293
+ modelConfigs: [
1294
+ {
1295
+ id: "anthropic/claude-sonnet-4-6",
1296
+ name: "Claude Sonnet 4.6 (OpenRouter Responses)",
1297
+ enabled: true
1298
+ },
1299
+ {
1300
+ id: "openai/gpt-5",
1301
+ name: "GPT-5 (OpenRouter Responses)",
1302
+ enabled: true
1303
+ },
1304
+ {
1305
+ id: "google/gemini-3.1-pro",
1306
+ name: "Gemini 3.1 Pro (OpenRouter Responses)",
1307
+ enabled: true
1308
+ },
1309
+ {
1310
+ id: "meta-llama/llama-3.3-70b-instruct",
1311
+ name: "Llama 3.3 70B (OpenRouter Responses)",
1312
+ enabled: true
1313
+ },
1314
+ {
1315
+ id: "deepseek/deepseek-v3.2",
1316
+ name: "DeepSeek V3.2 (OpenRouter Responses)",
1317
+ enabled: true
1318
+ }
1319
+ ],
1320
+ description: "OpenRouter Responses API \u2014 \u539F\u6837\u900F\u4F20 Responses \u53C2\u6570\uFF0C\u652F\u6301 Claude \u663E\u5F0F\u7F13\u5B58\u63A7\u5236",
1321
+ icon: "openrouter",
1322
+ website: "https://openrouter.ai",
1323
+ docsUrl: "https://openrouter.ai/docs/api-reference/responses/overview",
1324
+ defaultSettings: {
1325
+ temperature: 0.7,
1326
+ maxTokens: 4096
1327
+ },
1328
+ isSystem: true,
1329
+ features: [
1330
+ "vision",
1331
+ "reasoning"
1332
+ ]
1333
+ };
1334
+
1277
1335
  // src/provider-presets/presets/perplexity.json
1278
1336
  var perplexity_default = {
1279
1337
  id: "perplexity",
@@ -1994,6 +2052,7 @@ var RAW_PRESETS_IN_ORDER = [
1994
2052
  openai_response_default,
1995
2053
  siliconflow_default,
1996
2054
  openrouter_default,
2055
+ openrouter_response_default,
1997
2056
  mistral_default,
1998
2057
  together_default,
1999
2058
  perplexity_default,
@@ -193,6 +193,7 @@ var DEFAULT_SEED_PRESET_IDS = [
193
193
  // MiniMax + Xiaomi MiMo bumped up next to Kimi per UX preference —
194
194
  // popular Anthropic-format Chinese providers cluster together.
195
195
  "openrouter",
196
+ "openrouter-response",
196
197
  "zhipu",
197
198
  "zhipu-bigmodel",
198
199
  "kimi",
@@ -1235,6 +1236,63 @@ var openrouter_default = {
1235
1236
  ]
1236
1237
  };
1237
1238
 
1239
+ // src/provider-presets/presets/openrouter-response.json
1240
+ var openrouter_response_default = {
1241
+ id: "openrouter-response",
1242
+ presetId: "openrouter-response",
1243
+ name: "OpenRouter (Responses API)",
1244
+ apiFormat: "openai-response",
1245
+ api_base_url: "https://openrouter.ai/api/v1",
1246
+ modelsEndpoint: "https://openrouter.ai/api/v1/models",
1247
+ models: [
1248
+ "anthropic/claude-sonnet-4-6",
1249
+ "openai/gpt-5",
1250
+ "google/gemini-3.1-pro",
1251
+ "meta-llama/llama-3.3-70b-instruct",
1252
+ "deepseek/deepseek-v3.2"
1253
+ ],
1254
+ modelConfigs: [
1255
+ {
1256
+ id: "anthropic/claude-sonnet-4-6",
1257
+ name: "Claude Sonnet 4.6 (OpenRouter Responses)",
1258
+ enabled: true
1259
+ },
1260
+ {
1261
+ id: "openai/gpt-5",
1262
+ name: "GPT-5 (OpenRouter Responses)",
1263
+ enabled: true
1264
+ },
1265
+ {
1266
+ id: "google/gemini-3.1-pro",
1267
+ name: "Gemini 3.1 Pro (OpenRouter Responses)",
1268
+ enabled: true
1269
+ },
1270
+ {
1271
+ id: "meta-llama/llama-3.3-70b-instruct",
1272
+ name: "Llama 3.3 70B (OpenRouter Responses)",
1273
+ enabled: true
1274
+ },
1275
+ {
1276
+ id: "deepseek/deepseek-v3.2",
1277
+ name: "DeepSeek V3.2 (OpenRouter Responses)",
1278
+ enabled: true
1279
+ }
1280
+ ],
1281
+ description: "OpenRouter Responses API \u2014 \u539F\u6837\u900F\u4F20 Responses \u53C2\u6570\uFF0C\u652F\u6301 Claude \u663E\u5F0F\u7F13\u5B58\u63A7\u5236",
1282
+ icon: "openrouter",
1283
+ website: "https://openrouter.ai",
1284
+ docsUrl: "https://openrouter.ai/docs/api-reference/responses/overview",
1285
+ defaultSettings: {
1286
+ temperature: 0.7,
1287
+ maxTokens: 4096
1288
+ },
1289
+ isSystem: true,
1290
+ features: [
1291
+ "vision",
1292
+ "reasoning"
1293
+ ]
1294
+ };
1295
+
1238
1296
  // src/provider-presets/presets/perplexity.json
1239
1297
  var perplexity_default = {
1240
1298
  id: "perplexity",
@@ -1955,6 +2013,7 @@ var RAW_PRESETS_IN_ORDER = [
1955
2013
  openai_response_default,
1956
2014
  siliconflow_default,
1957
2015
  openrouter_default,
2016
+ openrouter_response_default,
1958
2017
  mistral_default,
1959
2018
  together_default,
1960
2019
  perplexity_default,