opencode-aicodewith-auth 0.1.66 → 0.1.67

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 +25 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2009,8 +2009,30 @@ var isPackageEntry = (value) => value === PACKAGE_NAME3 || value.startsWith(`${P
2009
2009
  var ensurePluginEntry = (list) => {
2010
2010
  if (!Array.isArray(list))
2011
2011
  return [PLUGIN_ENTRY];
2012
- const hasPlugin = list.some((entry) => typeof entry === "string" && (entry === PLUGIN_ENTRY || isPackageEntry(entry)));
2013
- return hasPlugin ? list : [...list, PLUGIN_ENTRY];
2012
+ let changed = false;
2013
+ let seenPlugin = false;
2014
+ const normalized = [];
2015
+ for (const entry of list) {
2016
+ let nextEntry = entry;
2017
+ if (typeof entry === "string" && isPackageEntry(entry)) {
2018
+ if (entry !== PLUGIN_ENTRY)
2019
+ changed = true;
2020
+ nextEntry = PLUGIN_ENTRY;
2021
+ }
2022
+ if (nextEntry === PLUGIN_ENTRY) {
2023
+ if (seenPlugin) {
2024
+ changed = true;
2025
+ continue;
2026
+ }
2027
+ seenPlugin = true;
2028
+ }
2029
+ normalized.push(nextEntry);
2030
+ }
2031
+ if (!seenPlugin) {
2032
+ changed = true;
2033
+ normalized.push(PLUGIN_ENTRY);
2034
+ }
2035
+ return changed ? normalized : list;
2014
2036
  };
2015
2037
  var buildStandardProviderConfig = () => ({
2016
2038
  ...provider_config_default,
@@ -2194,7 +2216,7 @@ var AicodewithCodexAuthPlugin = async (ctx) => {
2194
2216
  if (isCodexRequest) {
2195
2217
  const transformation = await transformRequestForCodex(init);
2196
2218
  let requestInit = transformation?.updatedInit ?? init;
2197
- if (!transformation && init.body) {
2219
+ if (!transformation && init?.body) {
2198
2220
  const sanitized = sanitizeRequestBody(init.body);
2199
2221
  requestInit = { ...init, body: sanitized };
2200
2222
  }
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.67",
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",