yymaxapi 1.0.75 → 1.0.77
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/bin/yymaxapi.js
CHANGED
|
@@ -104,8 +104,8 @@ const DEFAULT_CODEX_MODELS = [
|
|
|
104
104
|
"name": "GPT 5.4"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
"id": "gpt-5.
|
|
108
|
-
"name": "GPT 5.
|
|
107
|
+
"id": "gpt-5.3-codex",
|
|
108
|
+
"name": "GPT 5.3 Codex"
|
|
109
109
|
}
|
|
110
110
|
];
|
|
111
111
|
|
|
@@ -792,65 +792,34 @@ function writeOpencodeConfig(claudeBaseUrl, codexBaseUrl, apiKey, modelId) {
|
|
|
792
792
|
content = fs.readFileSync(codexConfigPath, 'utf8');
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
//
|
|
795
|
+
// 移除旧标记块(仅移除 yunyi opencode 自己的)
|
|
796
796
|
content = content.replace(/# >>> yunyi opencode >>>[\s\S]*?# <<< yunyi opencode <<<\n?/g, '');
|
|
797
|
-
content = content.replace(/# >>> maxapi codex >>>[\s\S]*?# <<< maxapi codex <<<\n?/g, '');
|
|
798
797
|
|
|
799
798
|
// 移除旧的 yunyi model_providers 段落(包括 yunyi-cli 写入的 [model_providers.yunyi])
|
|
800
799
|
content = content.replace(/\[model_providers\.yunyi[^\]]*\]\n(?:(?!\[)[^\n]*\n?)*/g, '');
|
|
801
800
|
|
|
802
|
-
//
|
|
803
|
-
const
|
|
804
|
-
model_provider: '"yunyi-claude"',
|
|
805
|
-
model: '"claude-sonnet-4-6"',
|
|
806
|
-
model_context_window: '1000000',
|
|
807
|
-
model_auto_compact_token_limit: '900000',
|
|
808
|
-
model_reasoning_effort: '"xhigh"',
|
|
809
|
-
disable_response_storage: 'true',
|
|
810
|
-
};
|
|
811
|
-
for (const [key, value] of Object.entries(topSettings)) {
|
|
812
|
-
const re = new RegExp(`^${key}\\s*=\\s*[^\\n]*`, 'm');
|
|
813
|
-
if (re.test(content)) {
|
|
814
|
-
content = content.replace(re, `${key} = ${value}`);
|
|
815
|
-
} else {
|
|
816
|
-
// 插入到第一个 section 之前
|
|
817
|
-
const firstSection = content.search(/^\[/m);
|
|
818
|
-
if (firstSection > 0) {
|
|
819
|
-
content = content.slice(0, firstSection) + `${key} = ${value}\n` + content.slice(firstSection);
|
|
820
|
-
} else if (firstSection === 0) {
|
|
821
|
-
content = `${key} = ${value}\n` + content;
|
|
822
|
-
} else {
|
|
823
|
-
content += `${key} = ${value}\n`;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
// 清理多余空行
|
|
829
|
-
content = content.replace(/\n{3,}/g, '\n\n').trim();
|
|
830
|
-
|
|
831
|
-
// 追加 model_providers 段落
|
|
832
|
-
const providers = [
|
|
833
|
-
'',
|
|
834
|
-
'# >>> yunyi opencode >>>',
|
|
835
|
-
'[model_providers.yunyi-claude]',
|
|
836
|
-
'name = "云翼 Claude"',
|
|
837
|
-
`base_url = "${claudeUrl}"`,
|
|
838
|
-
'wire_api = "anthropic"',
|
|
839
|
-
`experimental_bearer_token = "${apiKey}"`,
|
|
840
|
-
];
|
|
801
|
+
// 只追加 yunyi-codex provider(Claude 配置仅在 opencode.json 中,Codex CLI 不支持 wire_api=anthropic)
|
|
802
|
+
const providers = [''];
|
|
841
803
|
if (codexUrl) {
|
|
842
804
|
providers.push(
|
|
843
|
-
'',
|
|
805
|
+
'# >>> yunyi opencode >>>',
|
|
844
806
|
'[model_providers.yunyi-codex]',
|
|
845
807
|
'name = "云翼 Codex"',
|
|
846
808
|
`base_url = "${codexUrl}"`,
|
|
847
809
|
'wire_api = "responses"',
|
|
848
810
|
`experimental_bearer_token = "${apiKey}"`,
|
|
849
811
|
'requires_openai_auth = true',
|
|
812
|
+
'# <<< yunyi opencode <<<'
|
|
850
813
|
);
|
|
851
814
|
}
|
|
852
|
-
|
|
853
|
-
|
|
815
|
+
|
|
816
|
+
// 清理多余空行
|
|
817
|
+
content = content.replace(/\n{3,}/g, '\n\n').trim();
|
|
818
|
+
|
|
819
|
+
// 追加 provider section
|
|
820
|
+
if (providers.length > 1) {
|
|
821
|
+
content += '\n\n' + providers.join('\n') + '\n';
|
|
822
|
+
}
|
|
854
823
|
|
|
855
824
|
fs.writeFileSync(codexConfigPath, content, 'utf8');
|
|
856
825
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"codex": [
|
|
31
31
|
{ "id": "gpt-5.4", "name": "GPT 5.4" },
|
|
32
|
-
{ "id": "gpt-5.
|
|
32
|
+
{ "id": "gpt-5.3-codex", "name": "GPT 5.3 Codex" }
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"apiConfig": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"codex": {
|
|
44
44
|
"urlSuffix": "/codex",
|
|
45
|
-
"api": "openai-
|
|
45
|
+
"api": "openai-completions",
|
|
46
46
|
"contextWindow": 1050000,
|
|
47
47
|
"maxTokens": 128000,
|
|
48
48
|
"providerName": "yunyi"
|
|
@@ -92,7 +92,7 @@ npx yymaxapi@latest
|
|
|
92
92
|
{
|
|
93
93
|
"provider": "openai",
|
|
94
94
|
"base_url": "https://yunyi.rdzhvip.com/codex",
|
|
95
|
-
"api": "openai-
|
|
95
|
+
"api": "openai-completions",
|
|
96
96
|
"api_key": "<你的云翼 API Key>",
|
|
97
97
|
"model": {
|
|
98
98
|
"id": "gpt-5.4",
|
|
@@ -137,7 +137,7 @@ npx yymaxapi@latest
|
|
|
137
137
|
{
|
|
138
138
|
"provider": "openai",
|
|
139
139
|
"base_url": "https://yunyi.rdzhvip.com/codex",
|
|
140
|
-
"api": "openai-
|
|
140
|
+
"api": "openai-completions",
|
|
141
141
|
"api_key": "<你的云翼 API Key>",
|
|
142
142
|
"model": {
|
|
143
143
|
"id": "gpt-5.4",
|