ltcraft-ai-auto 1.6.0 → 1.6.2
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 +13 -4
- package/package.json +6 -1
- package/.claude/settings.local.json +0 -6
- package/.mcp.json +0 -8
- package/tmp_test.txt +0 -10
package/bin/index.js
CHANGED
|
@@ -106,6 +106,7 @@ function readTomlValue(content, key) {
|
|
|
106
106
|
|
|
107
107
|
function mergeTomlConfig(existing, name, baseUrl, apiKey) {
|
|
108
108
|
let content = existing || '';
|
|
109
|
+
const newSection = `[model_providers.ltcraftai]\nname = "${name}"\nbase_url = "${baseUrl}"\napi_key = "${apiKey}"`;
|
|
109
110
|
|
|
110
111
|
// 更新或插入顶层 model_provider
|
|
111
112
|
if (/^model_provider\s*=/m.test(content)) {
|
|
@@ -114,11 +115,17 @@ function mergeTomlConfig(existing, name, baseUrl, apiKey) {
|
|
|
114
115
|
content = `model_provider = "ltcraftai"\n` + content;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
//
|
|
118
|
-
|
|
118
|
+
// 原地替换 [model_providers.ltcraftai] 节;不存在则追加
|
|
119
|
+
const sectionStart = content.indexOf('[model_providers.ltcraftai]');
|
|
120
|
+
if (sectionStart !== -1) {
|
|
121
|
+
const afterSection = content.slice(sectionStart + 1);
|
|
122
|
+
const nextSection = afterSection.match(/\n\[/);
|
|
123
|
+
const sectionEnd = nextSection ? sectionStart + 1 + nextSection.index + 1 : content.length;
|
|
124
|
+
content = content.slice(0, sectionStart) + newSection + '\n' + content.slice(sectionEnd);
|
|
125
|
+
} else {
|
|
126
|
+
content = content.trimEnd() + `\n\n${newSection}\n`;
|
|
127
|
+
}
|
|
119
128
|
|
|
120
|
-
// 追加新节
|
|
121
|
-
content = content.trimEnd() + `\n\n[model_providers.ltcraftai]\nname = "${name}"\nbase_url = "${baseUrl}"\napi_key = "${apiKey}"\n`;
|
|
122
129
|
return content;
|
|
123
130
|
}
|
|
124
131
|
|
|
@@ -192,6 +199,8 @@ function configureOpenClaw(apiKey) {
|
|
|
192
199
|
{ "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6", "reasoning": false, "input": ["text", "image"], "cost": { "input": 3.0, "output": 15.0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
193
200
|
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6", "reasoning": false, "input": ["text", "image"], "cost": { "input": 5.0, "output": 25.0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
194
201
|
{ "id": "gpt-5.2", "name": "GPT-5.2", "reasoning": false, "input": ["text", "image"], "cost": { "input": 1.7, "output": 14, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
202
|
+
{ "id": "gpt-5.3-codex", "name": "GPT-5.3-codex", "reasoning": false, "input": ["text", "image"], "cost": { "input": 1.7, "output": 14, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
203
|
+
{ "id": "gpt-5.4", "name": "GPT-5.4", "reasoning": false, "input": ["text", "image"], "cost": { "input": 2.5, "output": 20, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
195
204
|
{ "id": "gemini-3-flash", "name": "Gemini 3 Flash", "reasoning": false, "input": ["text", "image"], "cost": { "input": 0.5, "output": 3, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 },
|
|
196
205
|
{ "id": "gemini-3-pro", "name": "Gemini 3 Pro", "reasoning": false, "input": ["text", "image"], "cost": { "input": 2, "output": 12, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }
|
|
197
206
|
]
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ltcraft-ai-auto",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "一键配置 Claude Code / OpenCode / OpenClaw 的 API 密钥工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"ltcraft-ai-auto": "./bin/index.js"
|
|
9
9
|
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/index.js",
|
|
12
|
+
"README.md",
|
|
13
|
+
"教程.txt"
|
|
14
|
+
],
|
|
10
15
|
"scripts": {
|
|
11
16
|
"start": "node bin/index.js"
|
|
12
17
|
},
|
package/.mcp.json
DELETED