opencode-aicodewith-auth 0.1.71 → 0.1.73

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.
Files changed (2) hide show
  1. package/dist/index.js +109 -167
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -17,6 +17,16 @@ var MODELS = [
17
17
  reasoning: "xhigh",
18
18
  aliases: ["gpt-5.3-codex", "gpt 5.3 codex", "codex"]
19
19
  },
20
+ {
21
+ id: "gpt-5.4",
22
+ family: "gpt",
23
+ displayName: "GPT-5.4",
24
+ version: "5.4",
25
+ limit: { context: 400000, output: 128000 },
26
+ modalities: { input: ["text", "image"], output: ["text"] },
27
+ reasoning: "xhigh",
28
+ aliases: ["gpt-5.4", "gpt 5.4"]
29
+ },
20
30
  {
21
31
  id: "gpt-5.2",
22
32
  family: "gpt",
@@ -90,13 +100,23 @@ var MODELS = [
90
100
  limit: { context: 200000, output: 64000 },
91
101
  modalities: { input: ["text", "image"], output: ["text"] }
92
102
  },
103
+ {
104
+ id: "claude-sonnet-4-6",
105
+ family: "claude",
106
+ displayName: "Claude Sonnet 4.6",
107
+ version: "4.6",
108
+ limit: { context: 200000, output: 64000 },
109
+ modalities: { input: ["text", "image"], output: ["text"] }
110
+ },
93
111
  {
94
112
  id: "claude-sonnet-4-5-20250929",
95
113
  family: "claude",
96
114
  displayName: "Claude Sonnet 4.5",
97
115
  version: "4.5",
98
116
  limit: { context: 200000, output: 64000 },
99
- modalities: { input: ["text", "image"], output: ["text"] }
117
+ modalities: { input: ["text", "image"], output: ["text"] },
118
+ deprecated: true,
119
+ replacedBy: "claude-sonnet-4-6"
100
120
  },
101
121
  {
102
122
  id: "claude-haiku-4-5-20251001",
@@ -144,7 +164,7 @@ var MODELS = [
144
164
  limit: { context: 200000, output: 64000 },
145
165
  modalities: { input: ["text", "image"], output: ["text"] },
146
166
  deprecated: true,
147
- replacedBy: "claude-sonnet-4-5-20250929"
167
+ replacedBy: "claude-sonnet-4-6"
148
168
  },
149
169
  {
150
170
  id: "claude-haiku-4-5-20251001-third-party",
@@ -156,13 +176,23 @@ var MODELS = [
156
176
  deprecated: true,
157
177
  replacedBy: "claude-haiku-4-5-20251001"
158
178
  },
179
+ {
180
+ id: "gemini-3.1-pro-preview",
181
+ family: "gemini",
182
+ displayName: "Gemini 3.1 Pro Preview",
183
+ version: "3.1",
184
+ limit: { context: 1048576, output: 65536 },
185
+ modalities: { input: ["text", "image"], output: ["text"] }
186
+ },
159
187
  {
160
188
  id: "gemini-3-pro",
161
189
  family: "gemini",
162
- displayName: "Gemini 3 Pro",
190
+ displayName: "Gemini 3 Pro (deprecated)",
163
191
  version: "3",
164
192
  limit: { context: 1048576, output: 65536 },
165
- modalities: { input: ["text", "image"], output: ["text"] }
193
+ modalities: { input: ["text", "image"], output: ["text"] },
194
+ deprecated: true,
195
+ replacedBy: "gemini-3.1-pro-preview"
166
196
  }
167
197
  ];
168
198
  var getActiveModels = () => MODELS.filter((m) => !m.deprecated);
@@ -177,16 +207,6 @@ var buildModelMigrations = () => {
177
207
  }
178
208
  return migrations;
179
209
  };
180
- var CODEX_VARIANTS = {
181
- low: { reasoningEffort: "low", reasoningSummary: "auto", textVerbosity: "medium" },
182
- medium: { reasoningEffort: "medium", reasoningSummary: "auto", textVerbosity: "medium" },
183
- high: { reasoningEffort: "high", reasoningSummary: "detailed", textVerbosity: "medium" },
184
- xhigh: { reasoningEffort: "xhigh", reasoningSummary: "detailed", textVerbosity: "medium" }
185
- };
186
- var GPT_VARIANTS = {
187
- none: { reasoningEffort: "none", reasoningSummary: "auto", textVerbosity: "medium" },
188
- ...CODEX_VARIANTS
189
- };
190
210
  var buildAliasMap = () => {
191
211
  const map = {};
192
212
  for (const model of getActiveModels()) {
@@ -203,39 +223,62 @@ var buildAliasMap = () => {
203
223
  }
204
224
  return map;
205
225
  };
206
- var getFullModelId = (id) => `${PROVIDER_ID}/${id}`;
226
+ function getLatestByFamily(family) {
227
+ const activeModels = MODELS.filter((m) => !m.deprecated && m.family === family);
228
+ if (activeModels.length === 0) {
229
+ throw new Error(`No active models found for family: ${family}`);
230
+ }
231
+ const latest = activeModels.sort((a, b) => {
232
+ const versionA = parseFloat(a.version);
233
+ const versionB = parseFloat(b.version);
234
+ return versionB - versionA;
235
+ })[0];
236
+ return `${PROVIDER_ID}/${latest.id}`;
237
+ }
238
+ function getLatestClaudeByTier(tier) {
239
+ const claudeModels = MODELS.filter((m) => !m.deprecated && m.family === "claude" && m.id.includes(tier));
240
+ if (claudeModels.length === 0) {
241
+ throw new Error(`No active Claude ${tier} models found`);
242
+ }
243
+ const latest = claudeModels.sort((a, b) => {
244
+ const versionA = parseFloat(a.version);
245
+ const versionB = parseFloat(b.version);
246
+ return versionB - versionA;
247
+ })[0];
248
+ return `${PROVIDER_ID}/${latest.id}`;
249
+ }
207
250
  var OMO_MODEL_ASSIGNMENTS = {
208
251
  agents: {
209
- sisyphus: getFullModelId("claude-sonnet-4-5-20250929"),
210
- hephaestus: getFullModelId("claude-sonnet-4-5-20250929"),
211
- oracle: getFullModelId("gpt-5.2"),
212
- librarian: getFullModelId("claude-sonnet-4-5-20250929"),
213
- explore: getFullModelId("claude-sonnet-4-5-20250929"),
214
- "multimodal-looker": getFullModelId("gemini-3-pro"),
215
- prometheus: getFullModelId("gpt-5.2"),
216
- metis: getFullModelId("gpt-5.2"),
217
- momus: getFullModelId("gpt-5.2"),
218
- atlas: getFullModelId("claude-sonnet-4-5-20250929"),
219
- build: getFullModelId("claude-opus-4-6-20260205"),
220
- plan: getFullModelId("claude-opus-4-6-20260205"),
221
- "sisyphus-junior": getFullModelId("claude-sonnet-4-5-20250929"),
222
- "OpenCode-Builder": getFullModelId("claude-opus-4-6-20260205"),
223
- general: getFullModelId("claude-sonnet-4-5-20250929"),
224
- "frontend-ui-ux-engineer": getFullModelId("gemini-3-pro"),
225
- "document-writer": getFullModelId("gemini-3-pro")
252
+ sisyphus: getLatestClaudeByTier("sonnet"),
253
+ hephaestus: getLatestClaudeByTier("sonnet"),
254
+ oracle: getLatestByFamily("gpt"),
255
+ librarian: getLatestClaudeByTier("sonnet"),
256
+ explore: getLatestClaudeByTier("sonnet"),
257
+ "multimodal-looker": getLatestByFamily("gemini"),
258
+ prometheus: getLatestByFamily("gpt"),
259
+ metis: getLatestByFamily("gpt"),
260
+ momus: getLatestByFamily("gpt"),
261
+ atlas: getLatestClaudeByTier("sonnet"),
262
+ build: getLatestClaudeByTier("opus"),
263
+ plan: getLatestClaudeByTier("opus"),
264
+ "sisyphus-junior": getLatestClaudeByTier("sonnet"),
265
+ "OpenCode-Builder": getLatestClaudeByTier("opus"),
266
+ general: getLatestClaudeByTier("sonnet"),
267
+ "frontend-ui-ux-engineer": getLatestByFamily("gemini"),
268
+ "document-writer": getLatestByFamily("gemini")
226
269
  },
227
270
  categories: {
228
- "visual-engineering": getFullModelId("gemini-3-pro"),
229
- ultrabrain: getFullModelId("gemini-3-pro"),
230
- deep: getFullModelId("gemini-3-pro"),
231
- artistry: getFullModelId("gemini-3-pro"),
232
- quick: getFullModelId("claude-sonnet-4-5-20250929"),
233
- "unspecified-low": getFullModelId("claude-sonnet-4-5-20250929"),
234
- "unspecified-high": getFullModelId("gpt-5.2"),
235
- writing: getFullModelId("gemini-3-pro"),
236
- visual: getFullModelId("gemini-3-pro"),
237
- "business-logic": getFullModelId("gpt-5.2"),
238
- "data-analysis": getFullModelId("claude-sonnet-4-5-20250929")
271
+ "visual-engineering": getLatestByFamily("gemini"),
272
+ ultrabrain: getLatestByFamily("gemini"),
273
+ deep: getLatestByFamily("gemini"),
274
+ artistry: getLatestByFamily("gemini"),
275
+ quick: getLatestClaudeByTier("sonnet"),
276
+ "unspecified-low": getLatestClaudeByTier("sonnet"),
277
+ "unspecified-high": getLatestByFamily("gpt"),
278
+ writing: getLatestByFamily("gemini"),
279
+ visual: getLatestByFamily("gemini"),
280
+ "business-logic": getLatestByFamily("gpt"),
281
+ "data-analysis": getLatestClaudeByTier("sonnet")
239
282
  }
240
283
  };
241
284
  // lib/constants.ts
@@ -795,6 +838,9 @@ function normalizeModel(model) {
795
838
  if (normalized.includes("gpt-5.3-codex") || normalized.includes("gpt 5.3 codex")) {
796
839
  return "gpt-5.3-codex";
797
840
  }
841
+ if (normalized.includes("gpt-5.4") || normalized.includes("gpt 5.4")) {
842
+ return "gpt-5.4";
843
+ }
798
844
  if (normalized.includes("gpt-5.2") || normalized.includes("gpt 5.2")) {
799
845
  return "gpt-5.2";
800
846
  }
@@ -1791,41 +1837,22 @@ var provider_config_default = {
1791
1837
  output: [
1792
1838
  "text"
1793
1839
  ]
1840
+ }
1841
+ },
1842
+ "gpt-5.4": {
1843
+ name: "GPT-5.4",
1844
+ limit: {
1845
+ context: 400000,
1846
+ output: 128000
1794
1847
  },
1795
- provider: {
1796
- npm: "@ai-sdk/openai",
1797
- api: "https://api.openai.com/v1"
1798
- },
1799
- options: {
1800
- store: false,
1801
- reasoningEffort: "medium",
1802
- reasoningSummary: "auto",
1803
- textVerbosity: "medium",
1804
- include: [
1805
- "reasoning.encrypted_content"
1848
+ modalities: {
1849
+ input: [
1850
+ "text",
1851
+ "image"
1852
+ ],
1853
+ output: [
1854
+ "text"
1806
1855
  ]
1807
- },
1808
- variants: {
1809
- low: {
1810
- reasoningEffort: "low",
1811
- reasoningSummary: "auto",
1812
- textVerbosity: "medium"
1813
- },
1814
- medium: {
1815
- reasoningEffort: "medium",
1816
- reasoningSummary: "auto",
1817
- textVerbosity: "medium"
1818
- },
1819
- high: {
1820
- reasoningEffort: "high",
1821
- reasoningSummary: "detailed",
1822
- textVerbosity: "medium"
1823
- },
1824
- xhigh: {
1825
- reasoningEffort: "xhigh",
1826
- reasoningSummary: "detailed",
1827
- textVerbosity: "medium"
1828
- }
1829
1856
  }
1830
1857
  },
1831
1858
  "gpt-5.2": {
@@ -1842,46 +1869,6 @@ var provider_config_default = {
1842
1869
  output: [
1843
1870
  "text"
1844
1871
  ]
1845
- },
1846
- provider: {
1847
- npm: "@ai-sdk/openai",
1848
- api: "https://api.openai.com/v1"
1849
- },
1850
- options: {
1851
- store: false,
1852
- reasoningEffort: "medium",
1853
- reasoningSummary: "auto",
1854
- textVerbosity: "medium",
1855
- include: [
1856
- "reasoning.encrypted_content"
1857
- ]
1858
- },
1859
- variants: {
1860
- none: {
1861
- reasoningEffort: "none",
1862
- reasoningSummary: "auto",
1863
- textVerbosity: "medium"
1864
- },
1865
- low: {
1866
- reasoningEffort: "low",
1867
- reasoningSummary: "auto",
1868
- textVerbosity: "medium"
1869
- },
1870
- medium: {
1871
- reasoningEffort: "medium",
1872
- reasoningSummary: "auto",
1873
- textVerbosity: "medium"
1874
- },
1875
- high: {
1876
- reasoningEffort: "high",
1877
- reasoningSummary: "detailed",
1878
- textVerbosity: "medium"
1879
- },
1880
- xhigh: {
1881
- reasoningEffort: "xhigh",
1882
- reasoningSummary: "detailed",
1883
- textVerbosity: "medium"
1884
- }
1885
1872
  }
1886
1873
  },
1887
1874
  "claude-opus-4-6-20260205": {
@@ -1900,8 +1887,8 @@ var provider_config_default = {
1900
1887
  ]
1901
1888
  }
1902
1889
  },
1903
- "claude-sonnet-4-5-20250929": {
1904
- name: "Claude Sonnet 4.5",
1890
+ "claude-sonnet-4-6": {
1891
+ name: "Claude Sonnet 4.6",
1905
1892
  limit: {
1906
1893
  context: 200000,
1907
1894
  output: 64000
@@ -1932,8 +1919,8 @@ var provider_config_default = {
1932
1919
  ]
1933
1920
  }
1934
1921
  },
1935
- "gemini-3-pro": {
1936
- name: "Gemini 3 Pro",
1922
+ "gemini-3.1-pro-preview": {
1923
+ name: "Gemini 3.1 Pro Preview",
1937
1924
  limit: {
1938
1925
  context: 1048576,
1939
1926
  output: 65536
@@ -2011,56 +1998,11 @@ var isPackageEntry = (value) => value === PACKAGE_NAME3 || value.startsWith(`${P
2011
1998
  var ensurePluginEntry = (list) => {
2012
1999
  if (!Array.isArray(list))
2013
2000
  return [PLUGIN_ENTRY];
2014
- let changed = false;
2015
- let seenPlugin = false;
2016
- const normalized = [];
2017
- for (const entry of list) {
2018
- let nextEntry = entry;
2019
- if (typeof entry === "string" && isPackageEntry(entry)) {
2020
- if (entry !== PLUGIN_ENTRY)
2021
- changed = true;
2022
- nextEntry = PLUGIN_ENTRY;
2023
- }
2024
- if (nextEntry === PLUGIN_ENTRY) {
2025
- if (seenPlugin) {
2026
- changed = true;
2027
- continue;
2028
- }
2029
- seenPlugin = true;
2030
- }
2031
- normalized.push(nextEntry);
2032
- }
2033
- if (!seenPlugin) {
2034
- changed = true;
2035
- normalized.push(PLUGIN_ENTRY);
2036
- }
2037
- return changed ? normalized : list;
2038
- };
2039
- var normalizeModelProviders = (models) => {
2040
- if (!models || typeof models !== "object")
2041
- return models;
2042
- const normalized = {};
2043
- for (const [id, val] of Object.entries(models)) {
2044
- if (!val || typeof val !== "object") {
2045
- normalized[id] = val;
2046
- continue;
2047
- }
2048
- const m = { ...val };
2049
- const p = m.provider;
2050
- if (p && typeof p === "object") {
2051
- const np = { ...p };
2052
- if (typeof np.npm === "string" && typeof np.api !== "string") {
2053
- np.api = "https://api.openai.com/v1";
2054
- }
2055
- m.provider = np;
2056
- }
2057
- normalized[id] = m;
2058
- }
2059
- return normalized;
2001
+ const hasPlugin = list.some((entry) => typeof entry === "string" && (entry === PLUGIN_ENTRY || isPackageEntry(entry)));
2002
+ return hasPlugin ? list : [...list, PLUGIN_ENTRY];
2060
2003
  };
2061
2004
  var buildStandardProviderConfig = () => ({
2062
2005
  ...provider_config_default,
2063
- models: normalizeModelProviders(provider_config_default.models),
2064
2006
  npm: PROVIDER_NPM
2065
2007
  });
2066
2008
  var applyProviderConfig = (config) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-aicodewith-auth",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "description": "OpenCode plugin for AICodewith authentication - Access GPT-5.3 Codex, GPT-5.2, Claude, and Gemini models through AICodewith API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",