@omnicross/contracts 0.1.5 → 0.1.7

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
@@ -1,5 +1,7 @@
1
1
  export { AccountClientIdentity, AccountTokensConfig, AuthMethod, ClaudeAuthMethod, ClaudeTokenConfig, CodexTokenConfig, GeminiTokenConfig, OAuthParams, ProxyConfig, SanitizedProxyConfig, SubscriptionAccountEntry, SubscriptionAccountSanitized, SubscriptionLevel, SyncWarningCode, TokenExchangeRequest, TokenStatus } from './account-tokens-types.cjs';
2
- export { AuditConfig, AuditQueryResult, AuditRecord, DEFAULT_AUDIT_CONFIG } from './audit-types.cjs';
2
+ import { SubscriptionProviderId } from './subscription-types.cjs';
3
+ export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.cjs';
4
+ export { AuditConfig, AuditQueryResult, AuditRecord, AuditStats, DEFAULT_AUDIT_CONFIG } from './audit-types.cjs';
3
5
  export { BillingConfig, BillingDeliveryStatus, BillingEvent, DEFAULT_BILLING_CONFIG } from './billing-types.cjs';
4
6
  export { KNOWN_MODELS, KnownModelCapabilities, MODEL_ALIASES, ResolvedModelCapabilities, applyAlias, lookupCanonicalCapabilities, normalizeModelId, resolveModelCapabilities } from './canonical-models.cjs';
5
7
  export { AnthropicAudioContent, AnthropicChatRequest, AnthropicChatResponse, AnthropicContentPart, AnthropicImageContent, AnthropicMessage, AnthropicSystemContent, AnthropicTextContent, AnthropicThinkingContent, AnthropicTool, AnthropicToolResultContent, AnthropicToolUseContent, AnthropicVideoContent, ConversionConfig, OpenAIChatRequest, OpenAIChatResponse, OpenAIContentPart, OpenAIMessage, OpenAIStreamChunk, OpenAITool, OpenAIToolCall, SimpleChatAudio, SimpleChatImage, SimpleChatMessage, SimpleChatSession, SimpleChatVideo } from './completion-types.cjs';
@@ -10,13 +12,66 @@ export { HealthReport, HealthStatus, LogFormat, LogLevel, LoggingConfig, healthH
10
12
  export { A as API_MODE_IDS, a as AgentDefaultModels, b as ApiFormat, c as ApiKeyEntry, d as ApiMode, e as ApiModeId, C as ChatApiFormat, f as CodingPlanConfig, g as CompletionSettings, G as GlobalModelParameters, L as LLMProvider, M as ModelConfig, h as ModelGroup, i as ModelParameter, j as ModelRef, O as OpenRouterDataCollection, k as OpenRouterMaxPrice, l as OpenRouterProviderRouting, m as OpenRouterProviderSort, n as OpenRouterQuantization, P as PresetProviderTemplate, o as ProviderApiType, p as ProviderModelMapping, q as ProviderSearchConfig, r as ProviderTemplate, S as SearchCapability, T as TransformerConfig, s as TransformerEntry } from './llm-config-DeWNx1ig.cjs';
11
13
  export { DEFAULT_MCP_SESSION_CONFIG, MCPCallToolResponse, MCPTool, MCPToolResponseContent, McpActionResult, McpDiscoverResult, McpMode, McpServerConfig, McpServerInput, McpServerJsonInput, McpServerList, McpServerRecord, McpServerRemoveInput, McpServerScope, McpServerTransport, McpSessionConfig, McpTestResult, McpToolInfo } from './mcp-types.cjs';
12
14
  export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock } from './message-blocks.cjs';
13
- export { DEFAULT_LITELLM_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource } from './pricing-types.cjs';
15
+ export { DEFAULT_LITELLM_PRICING_URL, DEFAULT_OPENROUTER_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource, PricingSourceRefreshResult } from './pricing-types.cjs';
14
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';
15
17
  export { SUBSCRIPTION_MODEL_CATALOG, subscriptionProviderHasCatalog } from './subscription-model-catalog.cjs';
16
- export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionProviderId, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.cjs';
17
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 { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.cjs';
19
+ export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageCacheKeySource, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.cjs';
19
20
  export { UsageEngineOrigin, UsageTokens } from './usage-types.cjs';
20
21
  export { DEFAULT_VOUCHER_CONFIG, VoucherConfig, VoucherCreated, VoucherGrant, VoucherInfo, VoucherRecord, VoucherRedeemResult, VoucherStatus, VoucherType } from './voucher-types.cjs';
21
22
  export { SanitizedWebhookConfig, SanitizedWebhookDestination, WEBHOOK_DESTINATION_TYPES, WEBHOOK_EVENT_KINDS, WebhookAnomalyState, WebhookConfig, WebhookDestination, WebhookDestinationType, WebhookEvent, WebhookEventKind, WebhookQuotaScope } from './webhook-types.cjs';
22
23
  export { JinaReaderResponse, WebSearchOptions, WebSearchProviderConfig, WebSearchProviderId, WebSearchProviderType, WebSearchResponse, WebSearchResult, isApiProvider, isLocalProvider } from './websearch-types.cjs';
24
+
25
+ /**
26
+ * Secret-free upstream subscription allowance contracts.
27
+ *
28
+ * These DTOs intentionally contain only normalized percentages, window metadata,
29
+ * timestamps, and stable error codes. Raw provider headers, OAuth credentials,
30
+ * account e-mail addresses, and upstream response bodies must never be added here.
31
+ */
32
+
33
+ /** Availability/freshness of one normalized allowance window. */
34
+ type AllowanceWindowState = 'fresh' | 'stale' | 'unavailable' | 'unsupported';
35
+ /** A single provider allowance window (for example five hours or seven days). */
36
+ type AllowanceWindow = {
37
+ /** Stable machine id (`five-hour`, `seven-day`, `primary`, ...). */
38
+ id: string;
39
+ /** Display-safe fallback label. UIs may localize from `id` instead. */
40
+ label: string;
41
+ /** Whether this window applies to the full account or one model family. */
42
+ scope: 'all' | 'model-family';
43
+ /** Present only when `scope` is `model-family`. */
44
+ modelFamily?: string;
45
+ /** Provider-reported percentage used; `null` means the value is unavailable. */
46
+ usedPercent: number | null;
47
+ /** Provider-reported window duration, when known. */
48
+ windowMinutes?: number;
49
+ /** Absolute reset instant, normalized to ISO-8601, when known. */
50
+ resetsAt?: string;
51
+ /** Remaining whole seconds at the time this DTO was materialized. */
52
+ remainingSeconds?: number;
53
+ state: AllowanceWindowState;
54
+ };
55
+ /**
56
+ * Secret-free allowance snapshot for exactly one stored subscription account.
57
+ */
58
+ type AccountAllowanceSnapshot = {
59
+ providerId: SubscriptionProviderId;
60
+ /** Omnicross's stable account-entry id, not an upstream account identifier. */
61
+ accountId: string;
62
+ source: 'oauth-usage-api' | 'response-headers';
63
+ /** Last successful observation, or the attempted-at instant for an unavailable result. */
64
+ observedAt: string;
65
+ /** Freshness deadline; fresh windows become stale after this instant. */
66
+ expiresAt?: string;
67
+ windows: AllowanceWindow[];
68
+ /** Stable, display-safe diagnostic code. Never an upstream body or token. */
69
+ lastErrorCode?: string;
70
+ /**
71
+ * Codex's normalized primary-over-secondary ratio, when supplied. This is the
72
+ * numeric value only; the original response header is never retained.
73
+ */
74
+ primaryOverSecondaryLimitPercent?: number;
75
+ };
76
+
77
+ export { type AccountAllowanceSnapshot, type AllowanceWindow, type AllowanceWindowState, SubscriptionProviderId };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { AccountClientIdentity, AccountTokensConfig, AuthMethod, ClaudeAuthMethod, ClaudeTokenConfig, CodexTokenConfig, GeminiTokenConfig, OAuthParams, ProxyConfig, SanitizedProxyConfig, SubscriptionAccountEntry, SubscriptionAccountSanitized, SubscriptionLevel, SyncWarningCode, TokenExchangeRequest, TokenStatus } from './account-tokens-types.js';
2
- export { AuditConfig, AuditQueryResult, AuditRecord, DEFAULT_AUDIT_CONFIG } from './audit-types.js';
2
+ import { SubscriptionProviderId } from './subscription-types.js';
3
+ export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.js';
4
+ export { AuditConfig, AuditQueryResult, AuditRecord, AuditStats, DEFAULT_AUDIT_CONFIG } from './audit-types.js';
3
5
  export { BillingConfig, BillingDeliveryStatus, BillingEvent, DEFAULT_BILLING_CONFIG } from './billing-types.js';
4
6
  export { KNOWN_MODELS, KnownModelCapabilities, MODEL_ALIASES, ResolvedModelCapabilities, applyAlias, lookupCanonicalCapabilities, normalizeModelId, resolveModelCapabilities } from './canonical-models.js';
5
7
  export { AnthropicAudioContent, AnthropicChatRequest, AnthropicChatResponse, AnthropicContentPart, AnthropicImageContent, AnthropicMessage, AnthropicSystemContent, AnthropicTextContent, AnthropicThinkingContent, AnthropicTool, AnthropicToolResultContent, AnthropicToolUseContent, AnthropicVideoContent, ConversionConfig, OpenAIChatRequest, OpenAIChatResponse, OpenAIContentPart, OpenAIMessage, OpenAIStreamChunk, OpenAITool, OpenAIToolCall, SimpleChatAudio, SimpleChatImage, SimpleChatMessage, SimpleChatSession, SimpleChatVideo } from './completion-types.js';
@@ -10,13 +12,66 @@ export { HealthReport, HealthStatus, LogFormat, LogLevel, LoggingConfig, healthH
10
12
  export { A as API_MODE_IDS, a as AgentDefaultModels, b as ApiFormat, c as ApiKeyEntry, d as ApiMode, e as ApiModeId, C as ChatApiFormat, f as CodingPlanConfig, g as CompletionSettings, G as GlobalModelParameters, L as LLMProvider, M as ModelConfig, h as ModelGroup, i as ModelParameter, j as ModelRef, O as OpenRouterDataCollection, k as OpenRouterMaxPrice, l as OpenRouterProviderRouting, m as OpenRouterProviderSort, n as OpenRouterQuantization, P as PresetProviderTemplate, o as ProviderApiType, p as ProviderModelMapping, q as ProviderSearchConfig, r as ProviderTemplate, S as SearchCapability, T as TransformerConfig, s as TransformerEntry } from './llm-config-CKOaFFdy.js';
11
13
  export { DEFAULT_MCP_SESSION_CONFIG, MCPCallToolResponse, MCPTool, MCPToolResponseContent, McpActionResult, McpDiscoverResult, McpMode, McpServerConfig, McpServerInput, McpServerJsonInput, McpServerList, McpServerRecord, McpServerRemoveInput, McpServerScope, McpServerTransport, McpSessionConfig, McpTestResult, McpToolInfo } from './mcp-types.js';
12
14
  export { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock } from './message-blocks.js';
13
- export { DEFAULT_LITELLM_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource } from './pricing-types.js';
15
+ export { DEFAULT_LITELLM_PRICING_URL, DEFAULT_OPENROUTER_PRICING_URL, PricingConflict, PricingConflictDecision, PricingEntry, PricingEntryInput, PricingFetchResult, PricingResolution, PricingSource, PricingSourceRefreshResult } from './pricing-types.js';
14
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';
15
17
  export { SUBSCRIPTION_MODEL_CATALOG, subscriptionProviderHasCatalog } from './subscription-model-catalog.js';
16
- export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionProviderId, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.js';
17
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 { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.js';
19
+ export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, UsageCacheKeySource, UsageDateRange, UsageEventInput, UsageEventRecord, UsageQueryParams, UsageTimeBucket, UsageTimeSeriesBucket, UsageTotals } from './usage-stats-types.js';
19
20
  export { UsageEngineOrigin, UsageTokens } from './usage-types.js';
20
21
  export { DEFAULT_VOUCHER_CONFIG, VoucherConfig, VoucherCreated, VoucherGrant, VoucherInfo, VoucherRecord, VoucherRedeemResult, VoucherStatus, VoucherType } from './voucher-types.js';
21
22
  export { SanitizedWebhookConfig, SanitizedWebhookDestination, WEBHOOK_DESTINATION_TYPES, WEBHOOK_EVENT_KINDS, WebhookAnomalyState, WebhookConfig, WebhookDestination, WebhookDestinationType, WebhookEvent, WebhookEventKind, WebhookQuotaScope } from './webhook-types.js';
22
23
  export { JinaReaderResponse, WebSearchOptions, WebSearchProviderConfig, WebSearchProviderId, WebSearchProviderType, WebSearchResponse, WebSearchResult, isApiProvider, isLocalProvider } from './websearch-types.js';
24
+
25
+ /**
26
+ * Secret-free upstream subscription allowance contracts.
27
+ *
28
+ * These DTOs intentionally contain only normalized percentages, window metadata,
29
+ * timestamps, and stable error codes. Raw provider headers, OAuth credentials,
30
+ * account e-mail addresses, and upstream response bodies must never be added here.
31
+ */
32
+
33
+ /** Availability/freshness of one normalized allowance window. */
34
+ type AllowanceWindowState = 'fresh' | 'stale' | 'unavailable' | 'unsupported';
35
+ /** A single provider allowance window (for example five hours or seven days). */
36
+ type AllowanceWindow = {
37
+ /** Stable machine id (`five-hour`, `seven-day`, `primary`, ...). */
38
+ id: string;
39
+ /** Display-safe fallback label. UIs may localize from `id` instead. */
40
+ label: string;
41
+ /** Whether this window applies to the full account or one model family. */
42
+ scope: 'all' | 'model-family';
43
+ /** Present only when `scope` is `model-family`. */
44
+ modelFamily?: string;
45
+ /** Provider-reported percentage used; `null` means the value is unavailable. */
46
+ usedPercent: number | null;
47
+ /** Provider-reported window duration, when known. */
48
+ windowMinutes?: number;
49
+ /** Absolute reset instant, normalized to ISO-8601, when known. */
50
+ resetsAt?: string;
51
+ /** Remaining whole seconds at the time this DTO was materialized. */
52
+ remainingSeconds?: number;
53
+ state: AllowanceWindowState;
54
+ };
55
+ /**
56
+ * Secret-free allowance snapshot for exactly one stored subscription account.
57
+ */
58
+ type AccountAllowanceSnapshot = {
59
+ providerId: SubscriptionProviderId;
60
+ /** Omnicross's stable account-entry id, not an upstream account identifier. */
61
+ accountId: string;
62
+ source: 'oauth-usage-api' | 'response-headers';
63
+ /** Last successful observation, or the attempted-at instant for an unavailable result. */
64
+ observedAt: string;
65
+ /** Freshness deadline; fresh windows become stale after this instant. */
66
+ expiresAt?: string;
67
+ windows: AllowanceWindow[];
68
+ /** Stable, display-safe diagnostic code. Never an upstream body or token. */
69
+ lastErrorCode?: string;
70
+ /**
71
+ * Codex's normalized primary-over-secondary ratio, when supplied. This is the
72
+ * numeric value only; the original response header is never retained.
73
+ */
74
+ primaryOverSecondaryLimitPercent?: number;
75
+ };
76
+
77
+ export { type AccountAllowanceSnapshot, type AllowanceWindow, type AllowanceWindowState, SubscriptionProviderId };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var DEFAULT_AUDIT_CONFIG = {
3
3
  enabled: false,
4
4
  captureBodies: false,
5
- maxBodyBytes: 8192,
5
+ maxBodyBytes: -1,
6
6
  retentionDays: 7,
7
7
  trustForwardedFor: false
8
8
  };
@@ -15,6 +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
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 } },
19
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 } },
20
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 } },
@@ -28,6 +31,10 @@ var OPENAI_MODELS = {
28
31
  "o4-mini": { category: "reasoning", contextLength: 2e5, maxTokens: 1e5, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
29
32
  };
30
33
  var ANTHROPIC_MODELS = {
34
+ "claude-fable-5": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
35
+ "claude-opus-5": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
36
+ "claude-opus-4-8": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
37
+ "claude-sonnet-5": { category: "chat", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
31
38
  "claude-opus-4-7": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
32
39
  "claude-opus-4-7[1m]": { category: "reasoning", contextLength: 1e6, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
33
40
  "claude-opus-4-6": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 128e3 } },
@@ -37,10 +44,12 @@ var ANTHROPIC_MODELS = {
37
44
  "claude-haiku-4-5": { category: "chat", contextLength: 2e5, maxTokens: 64e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 64e3 } }
38
45
  };
39
46
  var GEMINI_MODELS = {
47
+ "gemini-3.5-flash": { category: "chat", contextLength: 1e6, maxTokens: 65536, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 24576 } },
40
48
  "gemini-3-flash": { category: "chat", contextLength: 1e6, maxTokens: 65536, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 24576 } },
41
49
  "gemini-3.1-pro": { category: "chat", contextLength: 1e6, maxTokens: 65536, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 128, max: 32768 } }
42
50
  };
43
51
  var GROK_MODELS = {
52
+ "grok-4.5": { category: "chat", contextLength: 5e5, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
44
53
  "grok-4.3": { category: "chat", contextLength: 1e6, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
45
54
  "grok-4.20": { category: "chat", contextLength: 131072, maxTokens: 32768, vision: true, functionCall: true },
46
55
  "grok-4.20-reasoning": { category: "reasoning", contextLength: 131072, maxTokens: 32768, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
@@ -54,6 +63,7 @@ var DEEPSEEK_MODELS = {
54
63
  "deepseek-r1": { category: "reasoning", contextLength: 64e3, maxTokens: 8192, reasoning: true, thinkingTokenLimit: { min: 0, max: 32768 } }
55
64
  };
56
65
  var ZHIPU_MODELS = {
66
+ "glm-5.2": { category: "chat", contextLength: 1048576, maxTokens: 131072, functionCall: true },
57
67
  "glm-5": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
58
68
  "glm-5.1": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
59
69
  "glm-4.5-air": { category: "chat", contextLength: 128e3, maxTokens: 32768, functionCall: true },
@@ -61,6 +71,7 @@ var ZHIPU_MODELS = {
61
71
  "glm-4.7": { category: "code", contextLength: 2e5, maxTokens: 128e3, functionCall: true }
62
72
  };
63
73
  var KIMI_MODELS = {
74
+ "kimi-k3": { category: "code", contextLength: 1048576, maxTokens: 1048576, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
64
75
  "kimi-k2.6": { category: "code", contextLength: 256e3, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
65
76
  "kimi-k2.5": { category: "chat", contextLength: 256e3, maxTokens: 65535, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
66
77
  "kimi-k2-thinking": { category: "reasoning", contextLength: 256e3, reasoning: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
@@ -288,6 +299,7 @@ var DEFAULT_MCP_SESSION_CONFIG = {
288
299
 
289
300
  // src/pricing-types.ts
290
301
  var DEFAULT_LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
302
+ var DEFAULT_OPENROUTER_PRICING_URL = "https://openrouter.ai/api/v1/models";
291
303
 
292
304
  // src/provider-presets/catalog.json
293
305
  var catalog_default = {
@@ -521,8 +533,12 @@ var anthropic_default = {
521
533
  api_base_url: "https://api.anthropic.com/v1/messages",
522
534
  modelsEndpoint: "https://api.anthropic.com/v1/models",
523
535
  models: [
536
+ "claude-fable-5",
537
+ "claude-opus-5",
538
+ "claude-opus-4-8",
524
539
  "claude-opus-4-7",
525
540
  "claude-opus-4-7[1m]",
541
+ "claude-sonnet-5",
526
542
  "claude-sonnet-4-6",
527
543
  "claude-sonnet-4-6[1m]",
528
544
  "claude-opus-4-6",
@@ -530,6 +546,21 @@ var anthropic_default = {
530
546
  "claude-haiku-4-5"
531
547
  ],
532
548
  modelConfigs: [
549
+ {
550
+ id: "claude-fable-5",
551
+ name: "Claude Fable 5",
552
+ enabled: true
553
+ },
554
+ {
555
+ id: "claude-opus-5",
556
+ name: "Claude Opus 5",
557
+ enabled: true
558
+ },
559
+ {
560
+ id: "claude-opus-4-8",
561
+ name: "Claude Opus 4.8",
562
+ enabled: true
563
+ },
533
564
  {
534
565
  id: "claude-opus-4-7",
535
566
  name: "Claude Opus 4.7",
@@ -540,6 +571,11 @@ var anthropic_default = {
540
571
  name: "Claude Opus 4.7 (1M)",
541
572
  enabled: false
542
573
  },
574
+ {
575
+ id: "claude-sonnet-5",
576
+ name: "Claude Sonnet 5",
577
+ enabled: true
578
+ },
543
579
  {
544
580
  id: "claude-sonnet-4-6",
545
581
  name: "Claude Sonnet 4.6",
@@ -566,11 +602,6 @@ var anthropic_default = {
566
602
  enabled: true
567
603
  }
568
604
  ],
569
- transformer: {
570
- use: [
571
- "anthropic"
572
- ]
573
- },
574
605
  description: "Claude\u6A21\u578B\u5B98\u65B9API (Anthropic Messages\u683C\u5F0F)",
575
606
  icon: "anthropic",
576
607
  website: "https://anthropic.com",
@@ -827,9 +858,7 @@ var deepseek_default = {
827
858
  api_base_url: "https://api.deepseek.com/v1/chat/completions",
828
859
  models: [
829
860
  "deepseek-v4-flash",
830
- "deepseek-v4-pro",
831
- "deepseek-chat",
832
- "deepseek-reasoner"
861
+ "deepseek-v4-pro"
833
862
  ],
834
863
  modelConfigs: [
835
864
  {
@@ -841,23 +870,8 @@ var deepseek_default = {
841
870
  id: "deepseek-v4-pro",
842
871
  name: "DeepSeek V4 Pro",
843
872
  enabled: true
844
- },
845
- {
846
- id: "deepseek-chat",
847
- name: "DeepSeek Chat (Legacy)",
848
- enabled: false
849
- },
850
- {
851
- id: "deepseek-reasoner",
852
- name: "DeepSeek Reasoner (Legacy)",
853
- enabled: false
854
873
  }
855
874
  ],
856
- transformer: {
857
- use: [
858
- "deepseek"
859
- ]
860
- },
861
875
  description: "DeepSeek\u5B98\u65B9API",
862
876
  icon: "deepseek",
863
877
  website: "https://deepseek.com",
@@ -882,10 +896,16 @@ var gemini_default = {
882
896
  api_base_url: "https://generativelanguage.googleapis.com/v1beta/models/",
883
897
  modelsEndpoint: "https://generativelanguage.googleapis.com/v1beta/models",
884
898
  models: [
899
+ "gemini-3.5-flash",
885
900
  "gemini-3-flash",
886
901
  "gemini-3.1-pro"
887
902
  ],
888
903
  modelConfigs: [
904
+ {
905
+ id: "gemini-3.5-flash",
906
+ name: "Gemini 3.5 Flash",
907
+ enabled: true
908
+ },
889
909
  {
890
910
  id: "gemini-3-flash",
891
911
  name: "Gemini 3 Flash",
@@ -936,10 +956,16 @@ var gemini_vertex_default = {
936
956
  apiType: "google",
937
957
  api_base_url: "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/us-central1/publishers/google",
938
958
  models: [
959
+ "gemini-3.5-flash",
939
960
  "gemini-3-flash",
940
961
  "gemini-3.1-pro"
941
962
  ],
942
963
  modelConfigs: [
964
+ {
965
+ id: "gemini-3.5-flash",
966
+ name: "Gemini 3.5 Flash",
967
+ enabled: true
968
+ },
943
969
  {
944
970
  id: "gemini-3-flash",
945
971
  name: "Gemini 3 Flash",
@@ -990,30 +1016,18 @@ var grok_default = {
990
1016
  apiType: "openai",
991
1017
  api_base_url: "https://api.x.ai/v1/chat/completions",
992
1018
  models: [
993
- "grok-4.3",
994
- "grok-4.20",
995
- "grok-4.20-reasoning",
996
- "grok-4.20-multi-agent"
1019
+ "grok-4.5",
1020
+ "grok-4.3"
997
1021
  ],
998
1022
  modelConfigs: [
999
1023
  {
1000
- id: "grok-4.3",
1001
- name: "Grok 4.3",
1002
- enabled: true
1003
- },
1004
- {
1005
- id: "grok-4.20",
1006
- name: "Grok 4.20",
1024
+ id: "grok-4.5",
1025
+ name: "Grok 4.5",
1007
1026
  enabled: true
1008
1027
  },
1009
1028
  {
1010
- id: "grok-4.20-reasoning",
1011
- name: "Grok 4.20 Reasoning",
1012
- enabled: true
1013
- },
1014
- {
1015
- id: "grok-4.20-multi-agent",
1016
- name: "Grok 4.20 Multi-Agent",
1029
+ id: "grok-4.3",
1030
+ name: "Grok 4.3",
1017
1031
  enabled: true
1018
1032
  }
1019
1033
  ],
@@ -1099,11 +1113,16 @@ var kimi_default = {
1099
1113
  api_base_url: "https://api.moonshot.ai/v1",
1100
1114
  codingPlanBaseUrl: "https://api.kimi.com/coding/v1",
1101
1115
  models: [
1116
+ "kimi-k3",
1102
1117
  "kimi-k2.6",
1103
- "kimi-k2.5",
1104
- "kimi-k2-thinking"
1118
+ "kimi-k2.5"
1105
1119
  ],
1106
1120
  modelConfigs: [
1121
+ {
1122
+ id: "kimi-k3",
1123
+ name: "Kimi K3",
1124
+ enabled: true
1125
+ },
1107
1126
  {
1108
1127
  id: "kimi-k2.6",
1109
1128
  name: "Kimi K2.6",
@@ -1113,11 +1132,6 @@ var kimi_default = {
1113
1132
  id: "kimi-k2.5",
1114
1133
  name: "Kimi K2.5",
1115
1134
  enabled: true
1116
- },
1117
- {
1118
- id: "kimi-k2-thinking",
1119
- name: "Kimi K2 Thinking",
1120
- enabled: false
1121
1135
  }
1122
1136
  ],
1123
1137
  description: "Moonshot AI - Kimi\u5927\u6A21\u578B",
@@ -1362,42 +1376,30 @@ var openai_default = {
1362
1376
  apiType: "openai",
1363
1377
  api_base_url: "https://api.openai.com/v1/chat/completions",
1364
1378
  models: [
1365
- "gpt-5.5",
1366
- "gpt-5.4",
1367
- "gpt-5.4-mini",
1368
- "gpt-5.2",
1369
- "gpt-4o",
1370
- "gpt-4o-mini"
1379
+ "gpt-5.6-sol",
1380
+ "gpt-5.6-terra",
1381
+ "gpt-5.6-luna",
1382
+ "gpt-5.5"
1371
1383
  ],
1372
1384
  modelConfigs: [
1373
1385
  {
1374
- id: "gpt-5.5",
1375
- name: "GPT-5.5",
1376
- enabled: true
1377
- },
1378
- {
1379
- id: "gpt-5.4",
1380
- name: "GPT-5.4",
1386
+ id: "gpt-5.6-sol",
1387
+ name: "GPT-5.6 Sol",
1381
1388
  enabled: true
1382
1389
  },
1383
1390
  {
1384
- id: "gpt-5.4-mini",
1385
- name: "GPT-5.4 Mini",
1391
+ id: "gpt-5.6-terra",
1392
+ name: "GPT-5.6 Terra",
1386
1393
  enabled: true
1387
1394
  },
1388
1395
  {
1389
- id: "gpt-5.2",
1390
- name: "GPT-5.2",
1396
+ id: "gpt-5.6-luna",
1397
+ name: "GPT-5.6 Luna",
1391
1398
  enabled: true
1392
1399
  },
1393
1400
  {
1394
- id: "gpt-4o",
1395
- name: "GPT-4o",
1396
- enabled: true
1397
- },
1398
- {
1399
- id: "gpt-4o-mini",
1400
- name: "GPT-4o Mini",
1401
+ id: "gpt-5.5",
1402
+ name: "GPT-5.5",
1401
1403
  enabled: true
1402
1404
  }
1403
1405
  ],
@@ -1432,62 +1434,33 @@ var openai_response_default = {
1432
1434
  apiFormat: "openai-response",
1433
1435
  api_base_url: "https://api.openai.com",
1434
1436
  models: [
1435
- "gpt-5.5",
1436
- "gpt-5.4",
1437
- "gpt-5.4-mini",
1438
- "gpt-5.3-codex",
1439
- "gpt-5.2",
1440
- "o3",
1441
- "o4-mini",
1442
- "gpt-4.1"
1437
+ "gpt-5.6-sol",
1438
+ "gpt-5.6-terra",
1439
+ "gpt-5.6-luna",
1440
+ "gpt-5.5"
1443
1441
  ],
1444
1442
  modelConfigs: [
1445
1443
  {
1446
- id: "gpt-5.5",
1447
- name: "GPT-5.5",
1448
- enabled: true
1449
- },
1450
- {
1451
- id: "gpt-5.4",
1452
- name: "GPT-5.4",
1453
- enabled: true
1454
- },
1455
- {
1456
- id: "gpt-5.4-mini",
1457
- name: "GPT-5.4 Mini",
1458
- enabled: true
1459
- },
1460
- {
1461
- id: "gpt-5.3-codex",
1462
- name: "GPT-5.3 Codex",
1444
+ id: "gpt-5.6-sol",
1445
+ name: "GPT-5.6 Sol",
1463
1446
  enabled: true
1464
1447
  },
1465
1448
  {
1466
- id: "gpt-5.2",
1467
- name: "GPT-5.2",
1449
+ id: "gpt-5.6-terra",
1450
+ name: "GPT-5.6 Terra",
1468
1451
  enabled: true
1469
1452
  },
1470
1453
  {
1471
- id: "o3",
1472
- name: "o3",
1454
+ id: "gpt-5.6-luna",
1455
+ name: "GPT-5.6 Luna",
1473
1456
  enabled: true
1474
1457
  },
1475
1458
  {
1476
- id: "o4-mini",
1477
- name: "o4 Mini",
1478
- enabled: true
1479
- },
1480
- {
1481
- id: "gpt-4.1",
1482
- name: "GPT-4.1",
1459
+ id: "gpt-5.5",
1460
+ name: "GPT-5.5",
1483
1461
  enabled: true
1484
1462
  }
1485
1463
  ],
1486
- transformer: {
1487
- use: [
1488
- "openai-response"
1489
- ]
1490
- },
1491
1464
  description: "OpenAI Responses API (/v1/responses endpoint)",
1492
1465
  icon: "openai",
1493
1466
  website: "https://openai.com",
@@ -2086,6 +2059,7 @@ var zhipu_default = {
2086
2059
  codingPlanBaseUrl: "https://api.z.ai/api/coding/paas/v4",
2087
2060
  modelsEndpoint: "https://api.z.ai/api/paas/v4/models",
2088
2061
  models: [
2062
+ "glm-5.2",
2089
2063
  "glm-5",
2090
2064
  "glm-5.1",
2091
2065
  "glm-4.5-air",
@@ -2093,6 +2067,11 @@ var zhipu_default = {
2093
2067
  "glm-4.7"
2094
2068
  ],
2095
2069
  modelConfigs: [
2070
+ {
2071
+ id: "glm-5.2",
2072
+ name: "GLM-5.2",
2073
+ enabled: true
2074
+ },
2096
2075
  {
2097
2076
  id: "glm-5",
2098
2077
  name: "GLM-5",
@@ -2166,6 +2145,7 @@ var zhipu_bigmodel_default = {
2166
2145
  codingPlanBaseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
2167
2146
  modelsEndpoint: "https://open.bigmodel.cn/api/paas/v4/models",
2168
2147
  models: [
2148
+ "glm-5.2",
2169
2149
  "glm-5",
2170
2150
  "glm-5.1",
2171
2151
  "glm-4.5-air",
@@ -2173,6 +2153,15 @@ var zhipu_bigmodel_default = {
2173
2153
  "glm-4.7"
2174
2154
  ],
2175
2155
  modelConfigs: [
2156
+ {
2157
+ id: "glm-5.2",
2158
+ name: "GLM-5.2",
2159
+ enabled: true,
2160
+ category: "chat",
2161
+ contextLength: 1048576,
2162
+ maxTokens: 131072,
2163
+ functionCall: true
2164
+ },
2176
2165
  {
2177
2166
  id: "glm-5",
2178
2167
  name: "GLM-5",
@@ -2670,6 +2659,7 @@ export {
2670
2659
  DEFAULT_LITELLM_PRICING_URL,
2671
2660
  DEFAULT_MAX_TOKENS,
2672
2661
  DEFAULT_MCP_SESSION_CONFIG,
2662
+ DEFAULT_OPENROUTER_PRICING_URL,
2673
2663
  DEFAULT_SEED_PRESET_IDS,
2674
2664
  DEFAULT_VOUCHER_CONFIG,
2675
2665
  EFFORT_RATIO,
@@ -20,11 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/pricing-types.ts
21
21
  var pricing_types_exports = {};
22
22
  __export(pricing_types_exports, {
23
- DEFAULT_LITELLM_PRICING_URL: () => DEFAULT_LITELLM_PRICING_URL
23
+ DEFAULT_LITELLM_PRICING_URL: () => DEFAULT_LITELLM_PRICING_URL,
24
+ DEFAULT_OPENROUTER_PRICING_URL: () => DEFAULT_OPENROUTER_PRICING_URL
24
25
  });
25
26
  module.exports = __toCommonJS(pricing_types_exports);
26
27
  var DEFAULT_LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
28
+ var DEFAULT_OPENROUTER_PRICING_URL = "https://openrouter.ai/api/v1/models";
27
29
  // Annotate the CommonJS export names for ESM import in node:
28
30
  0 && (module.exports = {
29
- DEFAULT_LITELLM_PRICING_URL
31
+ DEFAULT_LITELLM_PRICING_URL,
32
+ DEFAULT_OPENROUTER_PRICING_URL
30
33
  });
@@ -14,6 +14,8 @@ type PricingSource =
14
14
  'builtin'
15
15
  /** Auto-fetched from the LiteLLM JSON URL. */
16
16
  | 'litellm'
17
+ /** Supplemental OpenRouter model catalog price (OpenRouter routes only). */
18
+ | 'openrouter'
17
19
  /** Hand-edited by the user; protected from auto-overwrite. */
18
20
  | 'user';
19
21
  /**
@@ -64,6 +66,8 @@ interface PricingFetchResult {
64
66
  fetchedAt: number;
65
67
  /** Source URL that was fetched. */
66
68
  sourceUrl: string;
69
+ /** Outcome of every configured catalog source; one source may fail without discarding the other. */
70
+ sources: PricingSourceRefreshResult[];
67
71
  }
68
72
  /** Per-row decision passed back from the host's conflict-resolution UI. */
69
73
  interface PricingConflictDecision {
@@ -80,5 +84,16 @@ interface PricingResolution {
80
84
  }
81
85
  /** Default LiteLLM source URL — public model_prices_and_context_window.json. */
82
86
  declare const DEFAULT_LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
87
+ /** Supplemental OpenRouter catalog. Prices are USD per token in `data[].pricing`. */
88
+ declare const DEFAULT_OPENROUTER_PRICING_URL = "https://openrouter.ai/api/v1/models";
89
+ /** One source attempt in a multi-source pricing refresh. */
90
+ interface PricingSourceRefreshResult {
91
+ source: 'litellm' | 'openrouter';
92
+ sourceUrl: string;
93
+ status: 'applied' | 'failed';
94
+ parsedCount: number;
95
+ appliedCount: number;
96
+ error?: string;
97
+ }
83
98
 
84
- export { DEFAULT_LITELLM_PRICING_URL, type PricingConflict, type PricingConflictDecision, type PricingEntry, type PricingEntryInput, type PricingFetchResult, type PricingResolution, type PricingSource };
99
+ export { DEFAULT_LITELLM_PRICING_URL, DEFAULT_OPENROUTER_PRICING_URL, type PricingConflict, type PricingConflictDecision, type PricingEntry, type PricingEntryInput, type PricingFetchResult, type PricingResolution, type PricingSource, type PricingSourceRefreshResult };