better-opencode-openai-codex-auth 0.1.4 → 0.1.5
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/lib/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Plugin identifier for logging and error messages */
|
|
6
6
|
export declare const PLUGIN_NAME = "openai-codex-plugin";
|
|
7
7
|
/** Plugin version — keep in sync with package.json */
|
|
8
|
-
export declare const PLUGIN_VERSION = "0.1.
|
|
8
|
+
export declare const PLUGIN_VERSION = "0.1.5";
|
|
9
9
|
/** Base URL for ChatGPT backend API */
|
|
10
10
|
export declare const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
11
11
|
/** Dummy API key used for OpenAI SDK (actual auth via OAuth) */
|
package/dist/lib/constants.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Plugin identifier for logging and error messages */
|
|
6
6
|
export const PLUGIN_NAME = "openai-codex-plugin";
|
|
7
7
|
/** Plugin version — keep in sync with package.json */
|
|
8
|
-
export const PLUGIN_VERSION = "0.1.
|
|
8
|
+
export const PLUGIN_VERSION = "0.1.5";
|
|
9
9
|
/** Base URL for ChatGPT backend API */
|
|
10
10
|
export const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
11
11
|
/** Dummy API key used for OpenAI SDK (actual auth via OAuth) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-opencode-openai-codex-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "OpenAI ChatGPT (Codex backend) OAuth auth plugin for opencode - use your ChatGPT Plus/Pro subscription instead of API credits",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -52,6 +52,15 @@ const pluginAccountsPath = join(homedir(), ".opencode", "openai-codex-accounts.j
|
|
|
52
52
|
const pluginLogDir = join(homedir(), ".opencode", "logs", "codex-plugin");
|
|
53
53
|
const opencodeCacheDir = join(homedir(), ".opencode", "cache");
|
|
54
54
|
|
|
55
|
+
const LEGACY_MANAGED_MODEL_IDS = [
|
|
56
|
+
"gpt-5.2",
|
|
57
|
+
"gpt-5.2-codex",
|
|
58
|
+
"gpt-5.1-codex-max",
|
|
59
|
+
"gpt-5.1-codex",
|
|
60
|
+
"gpt-5.1-codex-mini",
|
|
61
|
+
"gpt-5.1",
|
|
62
|
+
];
|
|
63
|
+
|
|
55
64
|
function log(message) {
|
|
56
65
|
console.log(message);
|
|
57
66
|
}
|
|
@@ -99,12 +108,15 @@ function mergeOpenAIConfig(existingOpenAI, templateOpenAI) {
|
|
|
99
108
|
template.models && typeof template.models === "object"
|
|
100
109
|
? template.models
|
|
101
110
|
: {};
|
|
111
|
+
const prunedExistingModels = Object.fromEntries(
|
|
112
|
+
Object.entries(existingModels).filter(([key]) => !LEGACY_MANAGED_MODEL_IDS.includes(key)),
|
|
113
|
+
);
|
|
102
114
|
|
|
103
115
|
return {
|
|
104
116
|
...existing,
|
|
105
117
|
...template,
|
|
106
118
|
options: { ...existingOptions, ...templateOptions },
|
|
107
|
-
models: { ...
|
|
119
|
+
models: { ...prunedExistingModels, ...templateModels },
|
|
108
120
|
};
|
|
109
121
|
}
|
|
110
122
|
|
|
@@ -112,7 +124,10 @@ async function getKnownModelIds() {
|
|
|
112
124
|
const modernTemplate = await readJson(
|
|
113
125
|
join(repoRoot, "config", "opencode-modern.json"),
|
|
114
126
|
);
|
|
115
|
-
return new Set(
|
|
127
|
+
return new Set([
|
|
128
|
+
...Object.keys(modernTemplate?.provider?.openai?.models || {}),
|
|
129
|
+
...LEGACY_MANAGED_MODEL_IDS,
|
|
130
|
+
]);
|
|
116
131
|
}
|
|
117
132
|
|
|
118
133
|
function formatJson(obj) {
|