ltcraft-ai-auto 1.2.0 → 1.3.0
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/index.js +17 -14
- package/package.json +1 -1
- package/tmp_test.txt +10 -0
package/bin/index.js
CHANGED
|
@@ -135,28 +135,27 @@ function configureOpenClaw(apiKey) {
|
|
|
135
135
|
const configPath = path.join(homeDir, '.openclaw', 'openclaw.json');
|
|
136
136
|
backupFile(configPath);
|
|
137
137
|
const existing = readJsonFile(configPath);
|
|
138
|
+
const zeroCost = { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 };
|
|
138
139
|
const apiConfig = {
|
|
139
140
|
"models": {
|
|
140
141
|
"providers": {
|
|
141
|
-
"
|
|
142
|
-
"baseUrl": API_BASE_URL
|
|
142
|
+
"ltcraftai": {
|
|
143
|
+
"baseUrl": `${API_BASE_URL}/v1`,
|
|
143
144
|
"apiKey": apiKey,
|
|
144
|
-
"api": "
|
|
145
|
-
"models": [
|
|
146
|
-
"id": "claude-sonnet-4-5
|
|
147
|
-
"name": "Claude
|
|
148
|
-
"reasoning": false,
|
|
149
|
-
"input": ["text"],
|
|
150
|
-
"contextWindow": 200000,
|
|
151
|
-
|
|
152
|
-
}]
|
|
145
|
+
"api": "openai-completions",
|
|
146
|
+
"models": [
|
|
147
|
+
{ "id": "claude-sonnet-4-5", "name": "Claude Sonnet 4.5", "reasoning": false, "input": ["text"], "cost": zeroCost, "contextWindow": 200000, "maxTokens": 8192 },
|
|
148
|
+
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6", "reasoning": false, "input": ["text"], "cost": zeroCost, "contextWindow": 200000, "maxTokens": 8192 },
|
|
149
|
+
{ "id": "gpt-5.2", "name": "GPT-5.2", "reasoning": false, "input": ["text"], "cost": zeroCost, "contextWindow": 200000, "maxTokens": 8192 },
|
|
150
|
+
{ "id": "gemini-3-flash", "name": "Gemini 3 Flash", "reasoning": false, "input": ["text"], "cost": zeroCost, "contextWindow": 200000, "maxTokens": 8192 },
|
|
151
|
+
{ "id": "gemini-3-pro", "name": "Gemini 3 Pro", "reasoning": false, "input": ["text"], "cost": zeroCost, "contextWindow": 200000, "maxTokens": 8192 }
|
|
152
|
+
]
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
"agents": {
|
|
157
157
|
"defaults": {
|
|
158
|
-
"model": { "primary": "
|
|
159
|
-
"models": { "ltcraft/claude-sonnet-4-5-20250929": {} }
|
|
158
|
+
"model": { "primary": "ltcraftai/claude-sonnet-4-5" }
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
};
|
|
@@ -164,6 +163,10 @@ function configureOpenClaw(apiKey) {
|
|
|
164
163
|
writeJsonFile(configPath, merged);
|
|
165
164
|
console.log(`✓ 已配置: ${configPath}`);
|
|
166
165
|
console.log('\n🎉 OpenClaw 配置完成!');
|
|
166
|
+
console.log('\n📖 使用提示:');
|
|
167
|
+
console.log(' /models ltcraftai 查看模型列表');
|
|
168
|
+
console.log(' /model ltcraftai/xxx 切换模型 (如 /model ltcraftai/claude-opus-4-6)');
|
|
169
|
+
console.log('\n⚠️ 配置后需要重启 gateway 才能生效');
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
// ==================== 配置检测功能 ====================
|
|
@@ -388,7 +391,7 @@ function checkOpenClaw() {
|
|
|
388
391
|
printFileStatus('全局配置', configPath, fileExists(configPath));
|
|
389
392
|
|
|
390
393
|
const config = readJsonFile(configPath);
|
|
391
|
-
const ltcraftProvider = config?.models?.providers?.
|
|
394
|
+
const ltcraftProvider = config?.models?.providers?.ltcraftai;
|
|
392
395
|
|
|
393
396
|
console.log(colorize('\n🔧 LTCraft Provider 配置:', 'blue'));
|
|
394
397
|
|
package/package.json
CHANGED