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 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
- "ltcraft": {
142
- "baseUrl": API_BASE_URL,
142
+ "ltcraftai": {
143
+ "baseUrl": `${API_BASE_URL}/v1`,
143
144
  "apiKey": apiKey,
144
- "api": "anthropic-messages",
145
- "models": [{
146
- "id": "claude-sonnet-4-5-20250929",
147
- "name": "Claude Sonnet 4.5",
148
- "reasoning": false,
149
- "input": ["text"],
150
- "contextWindow": 200000,
151
- "maxTokens": 8192
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": "ltcraft/claude-sonnet-4-5-20250929" },
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?.ltcraft;
394
+ const ltcraftProvider = config?.models?.providers?.ltcraftai;
392
395
 
393
396
  console.log(colorize('\n🔧 LTCraft Provider 配置:', 'blue'));
394
397
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ltcraft-ai-auto",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "一键配置 Claude Code / OpenCode / OpenClaw 的 API 密钥工具",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/tmp_test.txt ADDED
@@ -0,0 +1,10 @@
1
+ 第1轮写入:你好,这是临时测试文件。
2
+ 第2轮写入:反复读写测试中,一切正常。
3
+ 第3轮写入:第三次写入,数据持续累积。
4
+ 第4轮写入:快接近尾声了,再来一轮。
5
+ 第5轮写入:最后一轮,读写测试完成!
6
+ 第6轮写入:新一轮开始,继续追加。
7
+ 第7轮写入:稳定运行,没有问题。
8
+ 第8轮写入:越写越多,文件在长大。
9
+ 第9轮写入:倒数第二轮,马上结束。
10
+ 第10轮写入:十轮读写全部完成,收工!