@x1a0f3n9/dsh-failover-queue 0.1.11
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/LICENSE +21 -0
- package/README.md +64 -0
- package/README.zh.md +62 -0
- package/cordis.patch.yml +5 -0
- package/lib/client.js +2261 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +274 -0
- package/lib/index.js +574 -0
- package/package.json +92 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LunFengChen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# dsh-failover-queue
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
CC Switch-style **P1 / P2 / P3** failover for DeepSeek Harness / xfdsh.
|
|
6
|
+
|
|
7
|
+
A `P1` / `P-` chip sits on the composer. Click it to:
|
|
8
|
+
|
|
9
|
+
- Toggle auto failover
|
|
10
|
+
- Drag to reorder priority (P1 primary, P2 / P3 backup)
|
|
11
|
+
- Add routes from the live provider+model catalog
|
|
12
|
+
|
|
13
|
+
On failure, same-route `llm-retry` runs first. `AUTH` / `RATE_LIMIT` / `NO_ADAPTER` skip that wait, open the circuit, and jump to the next P. After `cooldownMs`, P1 becomes HalfOpen and the next request probes it — failover is not sticky. While enabled, requests prefer the first healthy P, not the session picker.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
dsh plugin --profile web add github:LunFengChen/dsh-failover-queue
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Local checkout:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
dsh plugin --profile web add /path/to/dsh-failover-queue
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Reload the Web GUI. The composer shows `P-`. Settings left nav has a **Failover** page with the same queue editor.
|
|
28
|
+
|
|
29
|
+
## Names
|
|
30
|
+
|
|
31
|
+
| Use | Name |
|
|
32
|
+
|---|---|
|
|
33
|
+
| GitHub | `LunFengChen/dsh-failover-queue` |
|
|
34
|
+
| npm / package | `@x1a0f3n9/dsh-failover-queue` |
|
|
35
|
+
| Plugin id | `dsh-failover-queue` |
|
|
36
|
+
| Settings namespace | `dsh-failover-queue` |
|
|
37
|
+
| Slash command | `/failover` |
|
|
38
|
+
|
|
39
|
+
`dsh-llm-failover` is already taken by several GitHub plugins. This name is the P-queue.
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/failover # print the queue; * is current
|
|
45
|
+
/failover on|off # toggle
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Config (cordis.yml)
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
- id: dsh-failover-queue
|
|
52
|
+
config:
|
|
53
|
+
cooldownMs: 60000
|
|
54
|
+
failureThreshold: 2
|
|
55
|
+
successThreshold: 2
|
|
56
|
+
immediateCodes: [AUTH, RATE_LIMIT, NO_ADAPTER]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Limits
|
|
60
|
+
|
|
61
|
+
- Queue items are **provider + model**, not a whole provider.
|
|
62
|
+
- Switching mid-step drops the current KV cache.
|
|
63
|
+
- Balance query is not in this version.
|
|
64
|
+
- With `retryPolicy.mode: always`, only `immediateCodes` interrupt retries to change P.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# dsh-failover-queue
|
|
2
|
+
|
|
3
|
+
CC Switch 风格的 **P1 / P2 / P3** 故障转移插件,给 DeepSeek Harness / xfdsh 用。
|
|
4
|
+
|
|
5
|
+
输入框右侧有一颗 `P1` / `P-` 芯片。点开后:
|
|
6
|
+
|
|
7
|
+
- 开关控制自动故障转移
|
|
8
|
+
- 拖动手柄改优先级(P1 主,P2 / P3 备用)
|
|
9
|
+
- 从当前已配置的供应商+模型里加路由
|
|
10
|
+
|
|
11
|
+
失败时:同一条路由先走 `llm-retry`;`AUTH` / `RATE_LIMIT` / `NO_ADAPTER` 立刻熔断并切下一条。`cooldownMs` 之后 P1 进入半开探活,下一次请求会切回 P1,不会粘在 P2。开启后请求优先打健康的最高优先级档,不看会话里随手选的模型。
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
dsh plugin --profile web add github:LunFengChen/dsh-failover-queue
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
本地开发:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add /path/to/dsh-failover-queue
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
装完刷新 Web GUI。输入框右侧会出现 `P-`。设置左侧导航有独立的 **故障转移** 页,里面是同一套队列编辑。
|
|
26
|
+
|
|
27
|
+
## 命名
|
|
28
|
+
|
|
29
|
+
| 用途 | 名字 |
|
|
30
|
+
|---|---|
|
|
31
|
+
| GitHub | `LunFengChen/dsh-failover-queue` |
|
|
32
|
+
| npm / 包 | `@x1a0f3n9/dsh-failover-queue` |
|
|
33
|
+
| 插件 id | `dsh-failover-queue` |
|
|
34
|
+
| 设置命名空间 | `dsh-failover-queue` |
|
|
35
|
+
| 斜杠命令 | `/failover` |
|
|
36
|
+
|
|
37
|
+
不用 `dsh-llm-failover`:GitHub 上已经有好几份同名插件,这个名字专门表示 **P 队列**。
|
|
38
|
+
|
|
39
|
+
## 命令
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/failover # 打印队列,* 是当前
|
|
43
|
+
/failover on|off # 开关
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 配置(cordis.yml)
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
- id: dsh-failover-queue
|
|
50
|
+
config:
|
|
51
|
+
cooldownMs: 60000
|
|
52
|
+
failureThreshold: 2
|
|
53
|
+
successThreshold: 2
|
|
54
|
+
immediateCodes: [AUTH, RATE_LIMIT, NO_ADAPTER]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 限制
|
|
58
|
+
|
|
59
|
+
- 队列项是 **供应商 + 模型**,不是整条供应商。
|
|
60
|
+
- 同一步切路由会丢掉当前 KV cache。
|
|
61
|
+
- 余额查询还没做;下个版本按 host 打 DeepSeek / 硅基 / OpenRouter 的余额接口。
|
|
62
|
+
- `retryPolicy.mode: always` 时,只有 `immediateCodes` 会打断重试去切 P。
|