@simonyea/holysheep-cli 1.7.55 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.55",
3
+ "version": "1.7.56",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "keywords": [
6
6
  "openai-china",
@@ -101,6 +101,11 @@ a:hover { text-decoration: underline; }
101
101
  /* Console */
102
102
  .console-area { margin-top: 12px; display: none; }
103
103
  .console-area.open { display: block; }
104
+ .console-area.busy .console-header span::after {
105
+ content: ' '; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
106
+ background: var(--primary); margin-left: 8px; animation: pulse 1s infinite;
107
+ }
108
+ @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
104
109
  .console-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
105
110
  .console-header span { font-size: 0.85rem; font-weight: 600; }
106
111
  .console { background: #111; color: #ccc; font-family: var(--mono); font-size: 0.78rem; padding: 12px; border-radius: 8px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; line-height: 1.6; }
@@ -360,6 +365,7 @@ async function doConfigureTool(id, name) {
360
365
  if (busy) return
361
366
  busy = true
362
367
  openConsole(`${t('configure')}: ${name}`)
368
+ document.getElementById('console-section').classList.add('busy')
363
369
 
364
370
  await streamSSE('/api/tool/configure', { toolId: id }, (ev) => {
365
371
  if (ev.type === 'progress') appendLog(ev.message, 'info')
@@ -374,9 +380,14 @@ async function doConfigureTool(id, name) {
374
380
  else if (ev.type === 'error') appendLog(`✗ ${ev.message}`, 'err')
375
381
  else if (ev.type === 'done') {
376
382
  appendLog(ev.success ? `\n✓ ${t('configSuccess')}` : `\n✗ ${t('configFailed')}`, ev.success ? 'ok' : 'err')
383
+ if (ev.dashboardUrl) {
384
+ appendLog(`\n→ ${ev.dashboardUrl}`, 'ok')
385
+ window.open(ev.dashboardUrl, '_blank')
386
+ }
377
387
  }
378
388
  })
379
389
 
390
+ document.getElementById('console-section').classList.remove('busy')
380
391
  busy = false
381
392
  loadTools()
382
393
  }
@@ -393,6 +404,7 @@ async function doInstallTool(id, name) {
393
404
  if (busy) return
394
405
  busy = true
395
406
  openConsole(`${t('install')}: ${name}`)
407
+ document.getElementById('console-section').classList.add('busy')
396
408
 
397
409
  await streamSSE('/api/tool/install', { toolId: id }, (ev) => {
398
410
  if (ev.type === 'progress') appendLog(ev.message, 'info')
@@ -402,6 +414,7 @@ async function doInstallTool(id, name) {
402
414
  }
403
415
  })
404
416
 
417
+ document.getElementById('console-section').classList.remove('busy')
405
418
  busy = false
406
419
  loadTools()
407
420
  }
@@ -460,11 +460,26 @@ async function handleToolConfigure(req, res) {
460
460
  return res.end()
461
461
  }
462
462
 
463
- const allModelIds = ['gpt-5.4', 'gpt-5.3-codex-spark', 'claude-sonnet-4-6', 'claude-opus-4-6', 'MiniMax-M2.7-highspeed', 'claude-haiku-4-5']
464
- const primaryModel = 'claude-sonnet-4-6'
463
+ const allModelIds = [
464
+ 'gpt-5.4', 'gpt-5.3-codex-spark',
465
+ 'claude-sonnet-4-6', 'claude-sonnet-4-6[1m]',
466
+ 'claude-opus-4-6', 'claude-opus-4-6[1m]',
467
+ 'MiniMax-M2.7-highspeed', 'claude-haiku-4-5',
468
+ ]
469
+ const primaryModel = toolId === 'openclaw' ? 'claude-sonnet-4-6[1m]' : 'claude-sonnet-4-6'
465
470
 
466
471
  sseEmit(res, { type: 'progress', message: `正在配置 ${tool.name}...` })
467
472
 
473
+ // 劫持 console.log/warn,将 tool.configure() 内部的进度消息转发为 SSE 事件
474
+ const origLog = console.log
475
+ const origWarn = console.warn
476
+ console.log = (...args) => {
477
+ const msg = args.map(a => typeof a === 'string' ? a : String(a)).join(' ')
478
+ const clean = msg.replace(/\x1b\[[0-9;]*m/g, '').trim()
479
+ if (clean) sseEmit(res, { type: 'progress', message: clean })
480
+ }
481
+ console.warn = console.log
482
+
468
483
  try {
469
484
  const result = tool.configure(apiKey, BASE_URL_ANTHROPIC, BASE_URL_OPENAI, primaryModel, allModelIds)
470
485
 
@@ -483,10 +498,13 @@ async function handleToolConfigure(req, res) {
483
498
  sseEmit(res, { type: 'result', status: 'ok', message: `${tool.name} 配置成功`, file: result.file, hot: result.hot })
484
499
  }
485
500
 
486
- sseEmit(res, { type: 'done', success: true, file: result.file, hot: result.hot })
501
+ sseEmit(res, { type: 'done', success: true, file: result.file, hot: result.hot, dashboardUrl: result.dashboardUrl || null })
487
502
  } catch (e) {
488
503
  sseEmit(res, { type: 'error', message: e.message })
489
504
  sseEmit(res, { type: 'done', success: false })
505
+ } finally {
506
+ console.log = origLog
507
+ console.warn = origWarn
490
508
  }
491
509
  res.end()
492
510
  }
@@ -546,7 +564,9 @@ function handleModels(_req, res) {
546
564
  { id: 'gpt-5.4', label: 'GPT 5.4', desc: '通用编码' },
547
565
  { id: 'gpt-5.3-codex-spark', label: 'GPT 5.3 Codex Spark', desc: '编码' },
548
566
  { id: 'claude-sonnet-4-6', label: 'Sonnet 4.6', desc: '均衡推荐' },
567
+ { id: 'claude-sonnet-4-6[1m]', label: 'Sonnet 4.6 (1M)', desc: '均衡推荐·100万上下文' },
549
568
  { id: 'claude-opus-4-6', label: 'Opus 4.6', desc: '强力旗舰' },
569
+ { id: 'claude-opus-4-6[1m]', label: 'Opus 4.6 (1M)', desc: '强力旗舰·100万上下文' },
550
570
  { id: 'MiniMax-M2.7-highspeed', label: 'MiniMax M2.7', desc: '高速经济版' },
551
571
  { id: 'claude-haiku-4-5', label: 'Haiku 4.5', desc: '轻快便宜' },
552
572
  ])