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 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
- // 移除已有的 [model_providers.ltcraftai] 节(到下一个节或文件末尾)
118
- content = content.replace(/\[model_providers\.ltcraftai\][\s\S]*?(?=\n\[|\s*$)/, '');
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.0",
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
  },
@@ -1,6 +0,0 @@
1
- {
2
- "enabledMcpjsonServers": [
3
- "proxy"
4
- ],
5
- "enableAllProjectMcpServers": true
6
- }
package/.mcp.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "proxy": {
4
- "type": "http",
5
- "url": "http://localhost:8026/user/mcp"
6
- }
7
- }
8
- }
package/tmp_test.txt DELETED
@@ -1,10 +0,0 @@
1
- 第1轮写入:你好,这是临时测试文件。
2
- 第2轮写入:反复读写测试中,一切正常。
3
- 第3轮写入:第三次写入,数据持续累积。
4
- 第4轮写入:快接近尾声了,再来一轮。
5
- 第5轮写入:最后一轮,读写测试完成!
6
- 第6轮写入:新一轮开始,继续追加。
7
- 第7轮写入:稳定运行,没有问题。
8
- 第8轮写入:越写越多,文件在长大。
9
- 第9轮写入:倒数第二轮,马上结束。
10
- 第10轮写入:十轮读写全部完成,收工!