opencode-aicodewith-auth 0.1.66 → 0.1.68

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 +29 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1793,7 +1793,8 @@ var provider_config_default = {
1793
1793
  ]
1794
1794
  },
1795
1795
  provider: {
1796
- npm: "@ai-sdk/openai"
1796
+ npm: "@ai-sdk/openai",
1797
+ api: "https://api.openai.com/v1"
1797
1798
  },
1798
1799
  options: {
1799
1800
  store: false,
@@ -1843,7 +1844,8 @@ var provider_config_default = {
1843
1844
  ]
1844
1845
  },
1845
1846
  provider: {
1846
- npm: "@ai-sdk/openai"
1847
+ npm: "@ai-sdk/openai",
1848
+ api: "https://api.openai.com/v1"
1847
1849
  },
1848
1850
  options: {
1849
1851
  store: false,
@@ -2009,8 +2011,30 @@ var isPackageEntry = (value) => value === PACKAGE_NAME3 || value.startsWith(`${P
2009
2011
  var ensurePluginEntry = (list) => {
2010
2012
  if (!Array.isArray(list))
2011
2013
  return [PLUGIN_ENTRY];
2012
- const hasPlugin = list.some((entry) => typeof entry === "string" && (entry === PLUGIN_ENTRY || isPackageEntry(entry)));
2013
- return hasPlugin ? list : [...list, 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;
2014
2038
  };
2015
2039
  var buildStandardProviderConfig = () => ({
2016
2040
  ...provider_config_default,
@@ -2194,7 +2218,7 @@ var AicodewithCodexAuthPlugin = async (ctx) => {
2194
2218
  if (isCodexRequest) {
2195
2219
  const transformation = await transformRequestForCodex(init);
2196
2220
  let requestInit = transformation?.updatedInit ?? init;
2197
- if (!transformation && init.body) {
2221
+ if (!transformation && init?.body) {
2198
2222
  const sanitized = sanitizeRequestBody(init.body);
2199
2223
  requestInit = { ...init, body: sanitized };
2200
2224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-aicodewith-auth",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
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",