@omnicross/contracts 0.1.5 → 0.1.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.cjs CHANGED
@@ -29,6 +29,7 @@ __export(index_exports, {
29
29
  DEFAULT_LITELLM_PRICING_URL: () => DEFAULT_LITELLM_PRICING_URL,
30
30
  DEFAULT_MAX_TOKENS: () => DEFAULT_MAX_TOKENS,
31
31
  DEFAULT_MCP_SESSION_CONFIG: () => DEFAULT_MCP_SESSION_CONFIG,
32
+ DEFAULT_OPENROUTER_PRICING_URL: () => DEFAULT_OPENROUTER_PRICING_URL,
32
33
  DEFAULT_SEED_PRESET_IDS: () => DEFAULT_SEED_PRESET_IDS,
33
34
  DEFAULT_VOUCHER_CONFIG: () => DEFAULT_VOUCHER_CONFIG,
34
35
  EFFORT_RATIO: () => EFFORT_RATIO,
@@ -91,6 +92,9 @@ var DEFAULT_BILLING_CONFIG = {
91
92
 
92
93
  // src/canonical-models.ts
93
94
  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 } },
94
98
  "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 } },
95
99
  "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 } },
96
100
  "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 } },
@@ -104,6 +108,10 @@ var OPENAI_MODELS = {
104
108
  "o4-mini": { category: "reasoning", contextLength: 2e5, maxTokens: 1e5, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
105
109
  };
106
110
  var ANTHROPIC_MODELS = {
111
+ "claude-fable-5": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
112
+ "claude-opus-5": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
113
+ "claude-opus-4-8": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
114
+ "claude-sonnet-5": { category: "chat", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
107
115
  "claude-opus-4-7": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
108
116
  "claude-opus-4-7[1m]": { category: "reasoning", contextLength: 1e6, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
109
117
  "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 } },
@@ -113,10 +121,12 @@ var ANTHROPIC_MODELS = {
113
121
  "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 } }
114
122
  };
115
123
  var GEMINI_MODELS = {
124
+ "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 } },
116
125
  "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 } },
117
126
  "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 } }
118
127
  };
119
128
  var GROK_MODELS = {
129
+ "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 } },
120
130
  "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 } },
121
131
  "grok-4.20": { category: "chat", contextLength: 131072, maxTokens: 32768, vision: true, functionCall: true },
122
132
  "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 } },
@@ -130,6 +140,7 @@ var DEEPSEEK_MODELS = {
130
140
  "deepseek-r1": { category: "reasoning", contextLength: 64e3, maxTokens: 8192, reasoning: true, thinkingTokenLimit: { min: 0, max: 32768 } }
131
141
  };
132
142
  var ZHIPU_MODELS = {
143
+ "glm-5.2": { category: "chat", contextLength: 1048576, maxTokens: 131072, functionCall: true },
133
144
  "glm-5": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
134
145
  "glm-5.1": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
135
146
  "glm-4.5-air": { category: "chat", contextLength: 128e3, maxTokens: 32768, functionCall: true },
@@ -137,6 +148,7 @@ var ZHIPU_MODELS = {
137
148
  "glm-4.7": { category: "code", contextLength: 2e5, maxTokens: 128e3, functionCall: true }
138
149
  };
139
150
  var KIMI_MODELS = {
151
+ "kimi-k3": { category: "code", contextLength: 1048576, maxTokens: 1048576, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
140
152
  "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 } },
141
153
  "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 } },
142
154
  "kimi-k2-thinking": { category: "reasoning", contextLength: 256e3, reasoning: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
@@ -364,6 +376,7 @@ var DEFAULT_MCP_SESSION_CONFIG = {
364
376
 
365
377
  // src/pricing-types.ts
366
378
  var DEFAULT_LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
379
+ var DEFAULT_OPENROUTER_PRICING_URL = "https://openrouter.ai/api/v1/models";
367
380
 
368
381
  // src/provider-presets/catalog.json
369
382
  var catalog_default = {
@@ -597,8 +610,12 @@ var anthropic_default = {
597
610
  api_base_url: "https://api.anthropic.com/v1/messages",
598
611
  modelsEndpoint: "https://api.anthropic.com/v1/models",
599
612
  models: [
613
+ "claude-fable-5",
614
+ "claude-opus-5",
615
+ "claude-opus-4-8",
600
616
  "claude-opus-4-7",
601
617
  "claude-opus-4-7[1m]",
618
+ "claude-sonnet-5",
602
619
  "claude-sonnet-4-6",
603
620
  "claude-sonnet-4-6[1m]",
604
621
  "claude-opus-4-6",
@@ -606,6 +623,21 @@ var anthropic_default = {
606
623
  "claude-haiku-4-5"
607
624
  ],
608
625
  modelConfigs: [
626
+ {
627
+ id: "claude-fable-5",
628
+ name: "Claude Fable 5",
629
+ enabled: true
630
+ },
631
+ {
632
+ id: "claude-opus-5",
633
+ name: "Claude Opus 5",
634
+ enabled: true
635
+ },
636
+ {
637
+ id: "claude-opus-4-8",
638
+ name: "Claude Opus 4.8",
639
+ enabled: true
640
+ },
609
641
  {
610
642
  id: "claude-opus-4-7",
611
643
  name: "Claude Opus 4.7",
@@ -616,6 +648,11 @@ var anthropic_default = {
616
648
  name: "Claude Opus 4.7 (1M)",
617
649
  enabled: false
618
650
  },
651
+ {
652
+ id: "claude-sonnet-5",
653
+ name: "Claude Sonnet 5",
654
+ enabled: true
655
+ },
619
656
  {
620
657
  id: "claude-sonnet-4-6",
621
658
  name: "Claude Sonnet 4.6",
@@ -642,11 +679,6 @@ var anthropic_default = {
642
679
  enabled: true
643
680
  }
644
681
  ],
645
- transformer: {
646
- use: [
647
- "anthropic"
648
- ]
649
- },
650
682
  description: "Claude\u6A21\u578B\u5B98\u65B9API (Anthropic Messages\u683C\u5F0F)",
651
683
  icon: "anthropic",
652
684
  website: "https://anthropic.com",
@@ -903,9 +935,7 @@ var deepseek_default = {
903
935
  api_base_url: "https://api.deepseek.com/v1/chat/completions",
904
936
  models: [
905
937
  "deepseek-v4-flash",
906
- "deepseek-v4-pro",
907
- "deepseek-chat",
908
- "deepseek-reasoner"
938
+ "deepseek-v4-pro"
909
939
  ],
910
940
  modelConfigs: [
911
941
  {
@@ -917,23 +947,8 @@ var deepseek_default = {
917
947
  id: "deepseek-v4-pro",
918
948
  name: "DeepSeek V4 Pro",
919
949
  enabled: true
920
- },
921
- {
922
- id: "deepseek-chat",
923
- name: "DeepSeek Chat (Legacy)",
924
- enabled: false
925
- },
926
- {
927
- id: "deepseek-reasoner",
928
- name: "DeepSeek Reasoner (Legacy)",
929
- enabled: false
930
950
  }
931
951
  ],
932
- transformer: {
933
- use: [
934
- "deepseek"
935
- ]
936
- },
937
952
  description: "DeepSeek\u5B98\u65B9API",
938
953
  icon: "deepseek",
939
954
  website: "https://deepseek.com",
@@ -958,10 +973,16 @@ var gemini_default = {
958
973
  api_base_url: "https://generativelanguage.googleapis.com/v1beta/models/",
959
974
  modelsEndpoint: "https://generativelanguage.googleapis.com/v1beta/models",
960
975
  models: [
976
+ "gemini-3.5-flash",
961
977
  "gemini-3-flash",
962
978
  "gemini-3.1-pro"
963
979
  ],
964
980
  modelConfigs: [
981
+ {
982
+ id: "gemini-3.5-flash",
983
+ name: "Gemini 3.5 Flash",
984
+ enabled: true
985
+ },
965
986
  {
966
987
  id: "gemini-3-flash",
967
988
  name: "Gemini 3 Flash",
@@ -1012,10 +1033,16 @@ var gemini_vertex_default = {
1012
1033
  apiType: "google",
1013
1034
  api_base_url: "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/us-central1/publishers/google",
1014
1035
  models: [
1036
+ "gemini-3.5-flash",
1015
1037
  "gemini-3-flash",
1016
1038
  "gemini-3.1-pro"
1017
1039
  ],
1018
1040
  modelConfigs: [
1041
+ {
1042
+ id: "gemini-3.5-flash",
1043
+ name: "Gemini 3.5 Flash",
1044
+ enabled: true
1045
+ },
1019
1046
  {
1020
1047
  id: "gemini-3-flash",
1021
1048
  name: "Gemini 3 Flash",
@@ -1066,30 +1093,18 @@ var grok_default = {
1066
1093
  apiType: "openai",
1067
1094
  api_base_url: "https://api.x.ai/v1/chat/completions",
1068
1095
  models: [
1069
- "grok-4.3",
1070
- "grok-4.20",
1071
- "grok-4.20-reasoning",
1072
- "grok-4.20-multi-agent"
1096
+ "grok-4.5",
1097
+ "grok-4.3"
1073
1098
  ],
1074
1099
  modelConfigs: [
1075
1100
  {
1076
- id: "grok-4.3",
1077
- name: "Grok 4.3",
1078
- enabled: true
1079
- },
1080
- {
1081
- id: "grok-4.20",
1082
- name: "Grok 4.20",
1101
+ id: "grok-4.5",
1102
+ name: "Grok 4.5",
1083
1103
  enabled: true
1084
1104
  },
1085
1105
  {
1086
- id: "grok-4.20-reasoning",
1087
- name: "Grok 4.20 Reasoning",
1088
- enabled: true
1089
- },
1090
- {
1091
- id: "grok-4.20-multi-agent",
1092
- name: "Grok 4.20 Multi-Agent",
1106
+ id: "grok-4.3",
1107
+ name: "Grok 4.3",
1093
1108
  enabled: true
1094
1109
  }
1095
1110
  ],
@@ -1175,11 +1190,16 @@ var kimi_default = {
1175
1190
  api_base_url: "https://api.moonshot.ai/v1",
1176
1191
  codingPlanBaseUrl: "https://api.kimi.com/coding/v1",
1177
1192
  models: [
1193
+ "kimi-k3",
1178
1194
  "kimi-k2.6",
1179
- "kimi-k2.5",
1180
- "kimi-k2-thinking"
1195
+ "kimi-k2.5"
1181
1196
  ],
1182
1197
  modelConfigs: [
1198
+ {
1199
+ id: "kimi-k3",
1200
+ name: "Kimi K3",
1201
+ enabled: true
1202
+ },
1183
1203
  {
1184
1204
  id: "kimi-k2.6",
1185
1205
  name: "Kimi K2.6",
@@ -1189,11 +1209,6 @@ var kimi_default = {
1189
1209
  id: "kimi-k2.5",
1190
1210
  name: "Kimi K2.5",
1191
1211
  enabled: true
1192
- },
1193
- {
1194
- id: "kimi-k2-thinking",
1195
- name: "Kimi K2 Thinking",
1196
- enabled: false
1197
1212
  }
1198
1213
  ],
1199
1214
  description: "Moonshot AI - Kimi\u5927\u6A21\u578B",
@@ -1438,42 +1453,30 @@ var openai_default = {
1438
1453
  apiType: "openai",
1439
1454
  api_base_url: "https://api.openai.com/v1/chat/completions",
1440
1455
  models: [
1441
- "gpt-5.5",
1442
- "gpt-5.4",
1443
- "gpt-5.4-mini",
1444
- "gpt-5.2",
1445
- "gpt-4o",
1446
- "gpt-4o-mini"
1456
+ "gpt-5.6-sol",
1457
+ "gpt-5.6-terra",
1458
+ "gpt-5.6-luna",
1459
+ "gpt-5.5"
1447
1460
  ],
1448
1461
  modelConfigs: [
1449
1462
  {
1450
- id: "gpt-5.5",
1451
- name: "GPT-5.5",
1452
- enabled: true
1453
- },
1454
- {
1455
- id: "gpt-5.4",
1456
- name: "GPT-5.4",
1463
+ id: "gpt-5.6-sol",
1464
+ name: "GPT-5.6 Sol",
1457
1465
  enabled: true
1458
1466
  },
1459
1467
  {
1460
- id: "gpt-5.4-mini",
1461
- name: "GPT-5.4 Mini",
1468
+ id: "gpt-5.6-terra",
1469
+ name: "GPT-5.6 Terra",
1462
1470
  enabled: true
1463
1471
  },
1464
1472
  {
1465
- id: "gpt-5.2",
1466
- name: "GPT-5.2",
1473
+ id: "gpt-5.6-luna",
1474
+ name: "GPT-5.6 Luna",
1467
1475
  enabled: true
1468
1476
  },
1469
1477
  {
1470
- id: "gpt-4o",
1471
- name: "GPT-4o",
1472
- enabled: true
1473
- },
1474
- {
1475
- id: "gpt-4o-mini",
1476
- name: "GPT-4o Mini",
1478
+ id: "gpt-5.5",
1479
+ name: "GPT-5.5",
1477
1480
  enabled: true
1478
1481
  }
1479
1482
  ],
@@ -1508,62 +1511,33 @@ var openai_response_default = {
1508
1511
  apiFormat: "openai-response",
1509
1512
  api_base_url: "https://api.openai.com",
1510
1513
  models: [
1511
- "gpt-5.5",
1512
- "gpt-5.4",
1513
- "gpt-5.4-mini",
1514
- "gpt-5.3-codex",
1515
- "gpt-5.2",
1516
- "o3",
1517
- "o4-mini",
1518
- "gpt-4.1"
1514
+ "gpt-5.6-sol",
1515
+ "gpt-5.6-terra",
1516
+ "gpt-5.6-luna",
1517
+ "gpt-5.5"
1519
1518
  ],
1520
1519
  modelConfigs: [
1521
1520
  {
1522
- id: "gpt-5.5",
1523
- name: "GPT-5.5",
1524
- enabled: true
1525
- },
1526
- {
1527
- id: "gpt-5.4",
1528
- name: "GPT-5.4",
1529
- enabled: true
1530
- },
1531
- {
1532
- id: "gpt-5.4-mini",
1533
- name: "GPT-5.4 Mini",
1534
- enabled: true
1535
- },
1536
- {
1537
- id: "gpt-5.3-codex",
1538
- name: "GPT-5.3 Codex",
1521
+ id: "gpt-5.6-sol",
1522
+ name: "GPT-5.6 Sol",
1539
1523
  enabled: true
1540
1524
  },
1541
1525
  {
1542
- id: "gpt-5.2",
1543
- name: "GPT-5.2",
1526
+ id: "gpt-5.6-terra",
1527
+ name: "GPT-5.6 Terra",
1544
1528
  enabled: true
1545
1529
  },
1546
1530
  {
1547
- id: "o3",
1548
- name: "o3",
1531
+ id: "gpt-5.6-luna",
1532
+ name: "GPT-5.6 Luna",
1549
1533
  enabled: true
1550
1534
  },
1551
1535
  {
1552
- id: "o4-mini",
1553
- name: "o4 Mini",
1554
- enabled: true
1555
- },
1556
- {
1557
- id: "gpt-4.1",
1558
- name: "GPT-4.1",
1536
+ id: "gpt-5.5",
1537
+ name: "GPT-5.5",
1559
1538
  enabled: true
1560
1539
  }
1561
1540
  ],
1562
- transformer: {
1563
- use: [
1564
- "openai-response"
1565
- ]
1566
- },
1567
1541
  description: "OpenAI Responses API (/v1/responses endpoint)",
1568
1542
  icon: "openai",
1569
1543
  website: "https://openai.com",
@@ -2162,6 +2136,7 @@ var zhipu_default = {
2162
2136
  codingPlanBaseUrl: "https://api.z.ai/api/coding/paas/v4",
2163
2137
  modelsEndpoint: "https://api.z.ai/api/paas/v4/models",
2164
2138
  models: [
2139
+ "glm-5.2",
2165
2140
  "glm-5",
2166
2141
  "glm-5.1",
2167
2142
  "glm-4.5-air",
@@ -2169,6 +2144,11 @@ var zhipu_default = {
2169
2144
  "glm-4.7"
2170
2145
  ],
2171
2146
  modelConfigs: [
2147
+ {
2148
+ id: "glm-5.2",
2149
+ name: "GLM-5.2",
2150
+ enabled: true
2151
+ },
2172
2152
  {
2173
2153
  id: "glm-5",
2174
2154
  name: "GLM-5",
@@ -2242,6 +2222,7 @@ var zhipu_bigmodel_default = {
2242
2222
  codingPlanBaseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
2243
2223
  modelsEndpoint: "https://open.bigmodel.cn/api/paas/v4/models",
2244
2224
  models: [
2225
+ "glm-5.2",
2245
2226
  "glm-5",
2246
2227
  "glm-5.1",
2247
2228
  "glm-4.5-air",
@@ -2249,6 +2230,15 @@ var zhipu_bigmodel_default = {
2249
2230
  "glm-4.7"
2250
2231
  ],
2251
2232
  modelConfigs: [
2233
+ {
2234
+ id: "glm-5.2",
2235
+ name: "GLM-5.2",
2236
+ enabled: true,
2237
+ category: "chat",
2238
+ contextLength: 1048576,
2239
+ maxTokens: 131072,
2240
+ functionCall: true
2241
+ },
2252
2242
  {
2253
2243
  id: "glm-5",
2254
2244
  name: "GLM-5",
@@ -2747,6 +2737,7 @@ function isLocalProvider(id) {
2747
2737
  DEFAULT_LITELLM_PRICING_URL,
2748
2738
  DEFAULT_MAX_TOKENS,
2749
2739
  DEFAULT_MCP_SESSION_CONFIG,
2740
+ DEFAULT_OPENROUTER_PRICING_URL,
2750
2741
  DEFAULT_SEED_PRESET_IDS,
2751
2742
  DEFAULT_VOUCHER_CONFIG,
2752
2743
  EFFORT_RATIO,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,6 @@
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
+ import { SubscriptionProviderId } from './subscription-types.cjs';
3
+ export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.cjs';
2
4
  export { AuditConfig, AuditQueryResult, AuditRecord, 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';
@@ -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
19
  export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, 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,4 +1,6 @@
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
+ import { SubscriptionProviderId } from './subscription-types.js';
3
+ export { OpenCodeGoModelEntry, OpenCodeGoScenario, OpenCodeGoTokenConfig, OpenCodeGoTokenSanitized, ProviderChannel, SubscriptionListEntry, SubscriptionStatusEntry, legacyCliBackendToSubscriptionProvider, subscriptionTargetForSession } from './subscription-types.js';
2
4
  export { AuditConfig, AuditQueryResult, AuditRecord, 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';
@@ -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
19
  export { ApiKeyUsageRow, MessageUsageRow, ModelUsageRow, SessionCacheStats, 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 };