pi-ccswitch-auto-switch 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -82,9 +82,10 @@ Examples:
82
82
  ## Status bar
83
83
 
84
84
  ```text
85
- CCS ✓70/131 · ⏳61 · ⛔0 · 🔄3 · provider/model-id
85
+ CCS v0.3.1 ✓70/131 · ⏳61 · ⛔0 · 🔄3 · provider/model-id
86
86
  ```
87
87
 
88
+ - `v0.3.1`: the installed CCSwitch extension version.
88
89
  - `✓70/131`: 70 healthy models out of 131 unique `provider/model` combinations in Pi's effective scope. Duplicate scoped entries are counted once.
89
90
  - `⏳61`: 61 models are currently affected by automatic model, provider, or endpoint cooldowns. One provider breaker can account for many affected models.
90
91
  - `⛔0`: no manually disabled models.
package/README.zh-CN.md CHANGED
@@ -70,9 +70,10 @@ runner 内部只显式加载本扩展并启动一次 Pi RPC;`PI_BIN` 只能指
70
70
  ## 状态栏
71
71
 
72
72
  ```text
73
- CCS ✓70/131 · ⏳61 · ⛔0 · 🔄3 · provider/model-id
73
+ CCS v0.3.1 ✓70/131 · ⏳61 · ⛔0 · 🔄3 · provider/model-id
74
74
  ```
75
75
 
76
+ - `v0.3.1`:当前安装的 CCSwitch 扩展版本。
76
77
  - `✓70/131`:Pi 有效范围内共有 131 个去重后的 `provider/model` 组合,其中 70 个健康;重复的 scope 条目只计一次。
77
78
  - `⏳61`:有 61 个模型正受模型、Provider 或端点自动冷却影响;一条 Provider 熔断记录可能同时影响许多模型。
78
79
  - `⛔0`:没有被手动禁用的模型。
package/index.ts CHANGED
@@ -8,6 +8,7 @@ const STREAM_IDLE_TIMEOUT = 120_000
8
8
  const MAX_ATTEMPTS = 5
9
9
  const ROUND_LIMIT = 8 * 60_000
10
10
  const RPC_PROTOCOL_VERSION = 1
11
+ const EXTENSION_VERSION = '0.3.1'
11
12
  // 同端点(BaseURL 相同)连续失败达到该次数即隔离该端点,避免同一个平台的多个模型逐个试错耗尽本轮切换
12
13
  const ENDPOINT_FAIL_THRESHOLD = 3
13
14
 
@@ -84,9 +85,10 @@ export default function (pi: ExtensionAPI) {
84
85
  const counts = summarizeCandidateHealth(models, state)
85
86
  const activeModel = round?.model ?? ctx.model
86
87
  // 恒显完整状态:健康/总数 · 冷却 · 禁用 · 本session切换 · 当前模型(均为 0 时也显示,便于确认扩展在监控中)
87
- const plain = round?.phase === 'switching' ? `CCS ↻${round.attempts}/${MAX_ATTEMPTS} ${modelTag(round.model)}` :
88
- round?.phase === 'exhausted' ? `CCS ⏸切换停止 ${modelTag(round.model ?? ctx.model)}` :
89
- `CCS ✓${counts.healthy}/${counts.total} · ⏳${counts.cooling} · ⛔${counts.disabled}${switchSuffix()} · ${modelTag(activeModel)}`
88
+ const prefix = `CCS v${EXTENSION_VERSION}`
89
+ const plain = round?.phase === 'switching' ? `${prefix} ↻${round.attempts}/${MAX_ATTEMPTS} ${modelTag(round.model)}` :
90
+ round?.phase === 'exhausted' ? `${prefix} ⏸切换停止 ${modelTag(round.model ?? ctx.model)}` :
91
+ `${prefix} ✓${counts.healthy}/${counts.total} · ⏳${counts.cooling} · ⛔${counts.disabled}${switchSuffix()} · ${modelTag(activeModel)}`
90
92
  const theme = ctx.ui.theme
91
93
  const tone = round?.phase === 'exhausted' ? 'error' : counts.cooling || counts.disabled ? 'warning' : 'success'
92
94
  ctx.ui.setStatus('ccswitch-ha', theme ? theme.fg(tone, plain) : plain)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ccswitch-auto-switch",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Provider-first automatic model failover extension for Pi and CC Switch",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "health.ts"
28
28
  ],
29
29
  "bin": {
30
- "pi-ccswitch-run": "./runner.mjs"
30
+ "pi-ccswitch-run": "runner.mjs"
31
31
  },
32
32
  "pi": {
33
33
  "extensions": [