bingocode 1.1.55 → 1.1.56
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/.env.example +53 -0
- package/package.json +2 -1
- package/src/manager/CliMenuManager.tsx +31 -1
package/.env.example
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# MiniMax(直连 Anthropic 兼容接口)
|
|
3
|
+
# 海外用户: ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic
|
|
4
|
+
# 国内用户: ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic
|
|
5
|
+
# 可用模型: MiniMax-M2.7(默认)、MiniMax-M2.7-highspeed(更快)
|
|
6
|
+
# ============================================================
|
|
7
|
+
# ANTHROPIC_AUTH_TOKEN=your_minimax_api_key_here
|
|
8
|
+
# ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic
|
|
9
|
+
# ANTHROPIC_MODEL=MiniMax-M2.7
|
|
10
|
+
# ANTHROPIC_DEFAULT_SONNET_MODEL=MiniMax-M2.7
|
|
11
|
+
# ANTHROPIC_DEFAULT_HAIKU_MODEL=MiniMax-M2.7-highspeed
|
|
12
|
+
# ANTHROPIC_DEFAULT_OPUS_MODEL=MiniMax-M2.7
|
|
13
|
+
# API_TIMEOUT_MS=3000000
|
|
14
|
+
|
|
15
|
+
# ============================================================
|
|
16
|
+
# OpenAI(通过 LiteLLM 代理)
|
|
17
|
+
# 先启动: litellm --config litellm_config.yaml --port 4000
|
|
18
|
+
# ============================================================
|
|
19
|
+
# ANTHROPIC_AUTH_TOKEN=sk-anything
|
|
20
|
+
# ANTHROPIC_BASE_URL=http://localhost:4000
|
|
21
|
+
# ANTHROPIC_MODEL=gpt-4o
|
|
22
|
+
# ANTHROPIC_DEFAULT_SONNET_MODEL=gpt-4o
|
|
23
|
+
# ANTHROPIC_DEFAULT_HAIKU_MODEL=gpt-4o
|
|
24
|
+
# ANTHROPIC_DEFAULT_OPUS_MODEL=gpt-4o
|
|
25
|
+
# API_TIMEOUT_MS=3000000
|
|
26
|
+
|
|
27
|
+
# ============================================================
|
|
28
|
+
# DeepSeek(通过 LiteLLM 代理)
|
|
29
|
+
# 先启动: litellm --config litellm_config.yaml --port 4000
|
|
30
|
+
# ============================================================
|
|
31
|
+
# ANTHROPIC_AUTH_TOKEN=sk-anything
|
|
32
|
+
# ANTHROPIC_BASE_URL=http://localhost:4000
|
|
33
|
+
# ANTHROPIC_MODEL=deepseek-chat
|
|
34
|
+
# ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-chat
|
|
35
|
+
# ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-chat
|
|
36
|
+
# ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-chat
|
|
37
|
+
# API_TIMEOUT_MS=3000000
|
|
38
|
+
|
|
39
|
+
# ============================================================
|
|
40
|
+
# OpenRouter(直连 Anthropic 兼容接口)
|
|
41
|
+
# ============================================================
|
|
42
|
+
# ANTHROPIC_AUTH_TOKEN=sk-or-v1-xxx
|
|
43
|
+
# ANTHROPIC_BASE_URL=https://openrouter.ai/api/v1
|
|
44
|
+
# ANTHROPIC_MODEL=openai/gpt-4o
|
|
45
|
+
# ANTHROPIC_DEFAULT_SONNET_MODEL=openai/gpt-4o
|
|
46
|
+
# ANTHROPIC_DEFAULT_HAIKU_MODEL=openai/gpt-4o-mini
|
|
47
|
+
# ANTHROPIC_DEFAULT_OPUS_MODEL=openai/gpt-4o
|
|
48
|
+
|
|
49
|
+
# ============================================================
|
|
50
|
+
# 通用设置(建议始终开启)
|
|
51
|
+
# ============================================================
|
|
52
|
+
DISABLE_TELEMETRY=1
|
|
53
|
+
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bingocode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claude": "bin/claude-win.cjs",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"config/",
|
|
25
25
|
".claude/",
|
|
26
26
|
"preload.ts",
|
|
27
|
+
".env.example",
|
|
27
28
|
"package.json",
|
|
28
29
|
"tsconfig.json",
|
|
29
30
|
"README.md",
|
|
@@ -285,7 +285,37 @@ export const CliMenuManager: React.FC = () => {
|
|
|
285
285
|
let mounted = true;
|
|
286
286
|
(async () => {
|
|
287
287
|
if (apiUrl) return;
|
|
288
|
-
|
|
288
|
+
|
|
289
|
+
// 动态定位 server 入口,兼容开发环境 (.ts) 和打包环境 (.js)
|
|
290
|
+
let entry = "";
|
|
291
|
+
try {
|
|
292
|
+
// 尝试从当前文件位置向上寻找 server 目录
|
|
293
|
+
const currentDir = path.dirname(new URL(import.meta.url).pathname);
|
|
294
|
+
const possiblePaths = [
|
|
295
|
+
path.resolve(currentDir, '../server/index.ts'), // 开发源码路径
|
|
296
|
+
path.resolve(currentDir, '../server/index.js'), // 编译后路径
|
|
297
|
+
path.resolve(currentDir, '../../src/server/index.ts'), // 嵌套结构
|
|
298
|
+
path.join(process.cwd(), 'node_modules/bingocode/src/server/index.ts') // npm 安装路径备选
|
|
299
|
+
];
|
|
300
|
+
|
|
301
|
+
for (const p of possiblePaths) {
|
|
302
|
+
// Windows 路径兼容处理:如果是以 /C:/ 开头的路径需要处理
|
|
303
|
+
const formattedPath = process.platform === 'win32' && p.startsWith('/') ? p.substring(1) : p;
|
|
304
|
+
if (fs.existsSync(formattedPath)) {
|
|
305
|
+
entry = formattedPath;
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
} catch (e) {
|
|
310
|
+
// fallback to old logic if path detection fails
|
|
311
|
+
entry = path.resolve(process.cwd(), 'src/server/index.ts');
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (!entry) {
|
|
315
|
+
setBootErr('无法定位服务器入口文件');
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
|
|
289
319
|
const MAX_RETRIES = 3;
|
|
290
320
|
const RETRY_DELAYS = [0, 2000, 5000]; // 首次无延迟,第2次2秒,第3次5秒
|
|
291
321
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|