opencode-aicodewith-auth 0.1.12 → 0.1.14

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/README.ai.md CHANGED
@@ -185,9 +185,9 @@ If the output is NOT `https://registry.npmjs.org/` (e.g., shows taobao, cnpm, or
185
185
  > 你现在可以使用以下模型:
186
186
  > - `gpt-5.2-codex`
187
187
  > - `gpt-5.2`
188
- > - `claude-sonnet-4-5-20250929`
189
- > - `claude-opus-4-5-20251101`
190
- > - `gemini-3-pro-high`
188
+ > - `claude-sonnet-4-5`
189
+ > - `claude-opus-4-5`
190
+ > - `gemini-3-pro`
191
191
  >
192
192
  > 测试命令: `opencode --model gpt-5.2-codex`"
193
193
 
@@ -197,9 +197,9 @@ If the output is NOT `https://registry.npmjs.org/` (e.g., shows taobao, cnpm, or
197
197
  > 你现在可以使用以下模型:
198
198
  > - `gpt-5.2-codex`
199
199
  > - `gpt-5.2`
200
- > - `claude-sonnet-4-5-20250929`
201
- > - `claude-opus-4-5-20251101`
202
- > - `gemini-3-pro-high`
200
+ > - `claude-sonnet-4-5`
201
+ > - `claude-opus-4-5`
202
+ > - `gemini-3-pro`
203
203
  >
204
204
  > 测试命令: `opencode --model gpt-5.2-codex`
205
205
  >
package/README.md CHANGED
@@ -63,9 +63,9 @@ User Request → OpenCode → Plugin Auth Hook → Route by Model:
63
63
  |---------|---------|:-------:|---------|
64
64
  | `aicodewith/gpt-5.2-codex` | GPT-5.2 Codex | ✅ | 日常编程、代码生成 |
65
65
  | `aicodewith/gpt-5.2` | GPT-5.2 | ✅ | 架构设计、逻辑推理 |
66
- | `aicodewith/claude-sonnet-4-5-20250929` | Claude Sonnet 4.5 | ✅ | 代码审查、文档查询 |
67
- | `aicodewith/claude-opus-4-5-20251101` | Claude Opus 4.5 | ✅ | 复杂任务、深度思考 |
68
- | `aicodewith/gemini-3-pro-high` | Gemini 3 Pro | ✅ | 前端 UI、多模态任务 |
66
+ | `aicodewith/claude-sonnet-4-5` | Claude Sonnet 4.5 | ✅ | 代码审查、文档查询 |
67
+ | `aicodewith/claude-opus-4-5` | Claude Opus 4.5 | ✅ | 复杂任务、深度思考 |
68
+ | `aicodewith/gemini-3-pro` | Gemini 3 Pro | ✅ | 前端 UI、多模态任务 |
69
69
 
70
70
  ---
71
71
 
package/dist/index.js CHANGED
@@ -1500,15 +1500,15 @@ var provider_config_default = {
1500
1500
  name: "GPT-5.2",
1501
1501
  modalities: { input: ["text", "image"], output: ["text"] }
1502
1502
  },
1503
- "claude-sonnet-4-5-20250929": {
1503
+ "claude-sonnet-4-5": {
1504
1504
  name: "Claude Sonnet 4.5",
1505
1505
  modalities: { input: ["text", "image"], output: ["text"] }
1506
1506
  },
1507
- "claude-opus-4-5-20251101": {
1507
+ "claude-opus-4-5": {
1508
1508
  name: "Claude Opus 4.5",
1509
1509
  modalities: { input: ["text", "image"], output: ["text"] }
1510
1510
  },
1511
- "gemini-3-pro-high": {
1511
+ "gemini-3-pro": {
1512
1512
  name: "Gemini 3 Pro",
1513
1513
  modalities: { input: ["text", "image"], output: ["text"] }
1514
1514
  }
@@ -1582,6 +1582,39 @@ var buildStandardProviderConfig = () => ({
1582
1582
  ...provider_config_default,
1583
1583
  npm: PROVIDER_NPM
1584
1584
  });
1585
+ var MODEL_ID_MIGRATIONS = {
1586
+ "claude-sonnet-4-5-20250929": "claude-sonnet-4-5",
1587
+ "claude-opus-4-5-20251101": "claude-opus-4-5",
1588
+ "gemini-3-pro-high": "gemini-3-pro"
1589
+ };
1590
+ var migrateModelId = (modelId) => {
1591
+ if (typeof modelId !== "string")
1592
+ return modelId;
1593
+ const withoutProvider = modelId.replace(/^aicodewith\//, "");
1594
+ const migrated = MODEL_ID_MIGRATIONS[withoutProvider];
1595
+ if (!migrated)
1596
+ return modelId;
1597
+ return modelId.startsWith("aicodewith/") ? `aicodewith/${migrated}` : migrated;
1598
+ };
1599
+ var migrateModelIdsInConfig = (obj) => {
1600
+ if (!obj || typeof obj !== "object")
1601
+ return false;
1602
+ let changed = false;
1603
+ for (const key in obj) {
1604
+ if (key === "model" && typeof obj[key] === "string") {
1605
+ const migrated = migrateModelId(obj[key]);
1606
+ if (migrated !== obj[key]) {
1607
+ obj[key] = migrated;
1608
+ changed = true;
1609
+ }
1610
+ } else if (typeof obj[key] === "object") {
1611
+ if (migrateModelIdsInConfig(obj[key])) {
1612
+ changed = true;
1613
+ }
1614
+ }
1615
+ }
1616
+ return changed;
1617
+ };
1585
1618
  var applyProviderConfig = (config) => {
1586
1619
  let changed = false;
1587
1620
  const providerMap = config.provider && typeof config.provider === "object" ? config.provider : {};
@@ -1597,6 +1630,9 @@ var applyProviderConfig = (config) => {
1597
1630
  config.plugin = nextPlugins;
1598
1631
  changed = true;
1599
1632
  }
1633
+ if (migrateModelIdsInConfig(config)) {
1634
+ changed = true;
1635
+ }
1600
1636
  return changed;
1601
1637
  };
1602
1638
  var ensureConfigFile = async () => {
@@ -1620,6 +1656,16 @@ var ensureConfigFile = async () => {
1620
1656
  if (!config || typeof config !== "object")
1621
1657
  return;
1622
1658
  const changed = applyProviderConfig(config);
1659
+ const omoPath = path4.join(configDir, "oh-my-opencode.json");
1660
+ if (await fileExists(omoPath)) {
1661
+ const omoConfig = await readJsonOrJsonc(omoPath);
1662
+ if (omoConfig && typeof omoConfig === "object") {
1663
+ if (migrateModelIdsInConfig(omoConfig)) {
1664
+ await writeFile2(omoPath, `${JSON.stringify(omoConfig, null, 2)}
1665
+ `, "utf-8");
1666
+ }
1667
+ }
1668
+ }
1623
1669
  if (!changed)
1624
1670
  return;
1625
1671
  await mkdir2(configDir, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-aicodewith-auth",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "OpenCode plugin for AICodewith authentication - Access GPT-5.2, Claude, and Gemini models through AICodewith API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",