base_parts_ai 1.0.40 → 1.0.41
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/lib/setapi.js +8 -5
- package/package.json +1 -1
package/lib/setapi.js
CHANGED
|
@@ -48,7 +48,6 @@ module.exports = async function (cmd, buildCfg) {
|
|
|
48
48
|
claudeJson.hasCompletedOnboarding = true;
|
|
49
49
|
utils.writeJsonFile(buildCfg.claudeJsonPath, claudeJson);
|
|
50
50
|
|
|
51
|
-
// 强制合入 claudeSettingsPath(~/.claude/settings.json)的固定字段
|
|
52
51
|
// 设置 SessionStart Hook(上报提示)、界面语言、更新渠道
|
|
53
52
|
settings.hooks = {
|
|
54
53
|
"SessionStart": [
|
|
@@ -99,7 +98,6 @@ module.exports = async function (cmd, buildCfg) {
|
|
|
99
98
|
settings.env.ANTHROPIC_AUTH_TOKEN = newToken.trim();
|
|
100
99
|
|
|
101
100
|
// 写入 settings.json(useSettingsFile 模式不缓存 Key 到 jcc.json)
|
|
102
|
-
utils.writeJsonFile(buildCfg.claudeSettingsPath, settings);
|
|
103
101
|
console.log('✅ 已切换到渠道: ' + selected.name);
|
|
104
102
|
console.log(' BASE_URL: ' + settings.env.ANTHROPIC_BASE_URL);
|
|
105
103
|
console.log(' Token: ' + utils.maskKey(settings.env.ANTHROPIC_AUTH_TOKEN));
|
|
@@ -114,10 +112,7 @@ module.exports = async function (cmd, buildCfg) {
|
|
|
114
112
|
},
|
|
115
113
|
});
|
|
116
114
|
newKey = newKey.trim();
|
|
117
|
-
|
|
118
|
-
// 写入 settings.json
|
|
119
115
|
settings.env.ANTHROPIC_AUTH_TOKEN = newKey;
|
|
120
|
-
utils.writeJsonFile(buildCfg.claudeSettingsPath, settings);
|
|
121
116
|
|
|
122
117
|
// 缓存到 jcc.json
|
|
123
118
|
if (!jccJson.keys) { jccJson.keys = {}; }
|
|
@@ -165,5 +160,13 @@ module.exports = async function (cmd, buildCfg) {
|
|
|
165
160
|
} else if (requiredVer) {
|
|
166
161
|
console.log('✅ Claude 版本匹配: ' + currentVer);
|
|
167
162
|
}
|
|
163
|
+
|
|
164
|
+
// 如果是22版本,清除大小标记
|
|
165
|
+
if (settings.model && requiredVer === '2.1.22') {
|
|
166
|
+
settings.model = settings.model.split('[')[0];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 写入 settings.json
|
|
170
|
+
utils.writeJsonFile(buildCfg.claudeSettingsPath, settings);
|
|
168
171
|
};
|
|
169
172
|
|