dsh-free-model 0.0.0-stage → 0.2.3
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 +227 -2
- package/README_EN.md +241 -0
- package/SECURITY-AUDIT.md +119 -0
- package/client.js +2531 -0
- package/cordis.patch.yml +8 -0
- package/icon.svg +1 -0
- package/index.js +684 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +67 -4
- package/src/chan-relay.js +193 -0
- package/src/egress.js +793 -0
- package/src/key.js +24 -0
- package/src/store.js +166 -0
- package/src/trust.js +179 -0
- package/vendor/channel-pack/LICENSE +21 -0
- package/vendor/channel-pack/NOTICE.md +94 -0
- package/vendor/channel-pack/pack.js +73153 -0
- package/vendor/channel-pack/qoder-auth-wasm.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ebony-Vinyl
|
|
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
CHANGED
|
@@ -1,3 +1,228 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 模型接入 (dsh-free-model)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**DSH 插件**(DeepSeek Harness · cordis bundle)· [English](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/README_EN.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-free-model)
|
|
6
|
+
[](#)
|
|
7
|
+
[](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE)
|
|
8
|
+
|
|
9
|
+
> [`Ebony-Vinyl/dsh-our-free-model`](https://github.com/Ebony-Vinyl/dsh-our-free-model) **2.1.0**(提交 `7e3a1da`)的精简 fork。
|
|
10
|
+
> 只保留「把外部账号接进来」这一条车道:**十五个账号渠道 + 数据看板 + 运行日志 + 本地网关**。
|
|
11
|
+
> 上游的匿名免费车道、EAC 协付车道、聚合渠道、省 Token、路由与发布/更新通道全部移除。
|
|
12
|
+
>
|
|
13
|
+
> ⚠️ fork 父仓库**已走到 2.3.0**,但它的后续改动几乎全在被删掉的那些车道里;
|
|
14
|
+
> **渠道与模型数据以真上游为准**(见下文「出处与致谢」)。
|
|
15
|
+
|
|
16
|
+
| | |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| npm | **`dsh-free-model`**(与仓库同名) |
|
|
19
|
+
| 设置页入口 | **模型接入**(英文界面 **Model Access**) |
|
|
20
|
+
| loader 条目 id | `our-free-model`(设置命名空间与状态目录挂在这个 id 上,**不随包名变化**) |
|
|
21
|
+
| 状态目录 | `~/.dsh/our-free-model/`(0600) |
|
|
22
|
+
|
|
23
|
+
## 安装
|
|
24
|
+
|
|
25
|
+
**命令行(纯 dsh web)——推荐**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
dsh plugin --profile web add dsh-free-model
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
装完**重启一次 dsh**:宿主半身在进程内,重启才加载新的 `index.js`;浏览器半身刷新页面即可。
|
|
32
|
+
`--profile` 填你实际用的 profile 名(默认 `web`)。
|
|
33
|
+
|
|
34
|
+
**桌面端(DSHEAC AIO)**:用**应用内的插件管理器**安装。桌面端启动 web 前有一道 profile 闸门,
|
|
35
|
+
只放行 dsh 自己在 `.dsh-module-fallback` 下生成的链接,profile 里出现其它符号链接或 junction 会直接
|
|
36
|
+
拒绝启动(`PROFILE_UPGRADE_REQUIRED`)——所以**不要用 `link:` 依赖、不要手建 junction**。
|
|
37
|
+
|
|
38
|
+
**从上游版本切换过来**:上游包名是 `dsh-our-free-model`。两者的 loader 条目 id 都是 `our-free-model`,
|
|
39
|
+
**不能同时装**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
dsh plugin --profile web remove dsh-our-free-model
|
|
43
|
+
dsh plugin --profile web add dsh-free-model
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
状态目录与条目 id 在本 fork 里没变,所以**账号、密钥、出口地址在切换时不会丢**。
|
|
47
|
+
|
|
48
|
+
**卸载 / 回滚**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
dsh plugin --profile web remove dsh-free-model # 卸载
|
|
52
|
+
dsh plugin --profile web add dsh-our-free-model # 回滚到上游 2.1.0
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> ⚠️ **不要再手工把仓库拷进 `node_modules/<包名>/`**。2026-10-11 实测:这么装的副本会在插件管理器
|
|
56
|
+
> 下一次 `pnpm install`(装/卸任何别的插件都会跑)时被按 lockfile 顶替,甚至直接清掉。要长期固定就用
|
|
57
|
+
> registry(本包),或在命令行 web profile 里用 `file:` 依赖。
|
|
58
|
+
|
|
59
|
+
## 快速上手
|
|
60
|
+
|
|
61
|
+
1. 重启后进 **设置 → 模型接入**,逐个渠道点登录(浏览器授权,账号池与积分查询都在同一张卡上)。
|
|
62
|
+
2. 每个渠道卡里可以**逐模型开/关**,也能「全部显示 / 全部隐藏」——**默认可能全是关的**,关着的模型
|
|
63
|
+
不会出现在模型选择器里。
|
|
64
|
+
3. 回到聊天输入框上方的模型选择器,渠道模型按产品分组出现;选一个即可开始用。
|
|
65
|
+
|
|
66
|
+
## 保留了什么
|
|
67
|
+
|
|
68
|
+
四个设置页(上游九页 → 四页):
|
|
69
|
+
|
|
70
|
+
| 页面 | 作用 |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| **白嫖模型接入** | 十五张渠道卡:CodeArts、CodeBuddy / WorkBuddy(国内 + 国际)、LobsterAI、Qoder / Qoder CN、TRAE、Cline、Loomy、Raccoon、MiniMax Code、ZCode、Gemini、**OfficeAce**(华为云 ModelArts,云端直连、无需装客户端)、**Accio Work**(阿里,标准 OAuth + PKCE,可脱离 IDE)。浏览器登录、账号池、续期、积分查询与一键领取、每日自动签到、逐模型开关、余额查询。 |
|
|
73
|
+
| **数据看板** | 渠道包自己的逐请求 Token 账本:今日 / 全部消耗、平均生成速度、首字延迟、缓存命中率、成功率、账号透视、模型性能表。 |
|
|
74
|
+
| **运行日志** | 逐条请求明细:结果、耗时、首字、速度、Token 细分;失败行悬停看原因。 |
|
|
75
|
+
| **网关设置** | 渠道包的本地 OpenAI 兼容网关(开关、端点、密钥、模型数)+ 本插件的局域网中继(可选绑定地址/端口、独立中继密钥、轮换)+ 出口代理分区(订阅分流或单个 http/socks5 出口)。 |
|
|
76
|
+
|
|
77
|
+
## 移除了什么,以及为什么
|
|
78
|
+
|
|
79
|
+
| 移除 | 原因 |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| **免费模型**页:匿名 opencode 车道 + Kilo 免费池 | 第三方灰产通道(伪装客户端 + 池化公共凭据),随时可能失效或改协议。 |
|
|
82
|
+
| **EAC 模型**页:GitHub 授权协付车道 | 依赖仓库方网关与 star 授权。 |
|
|
83
|
+
| **聚合渠道**页(76 家自带 Key 的提供商) | 与插件自己的模型适配器(`src/adapter.js`)绑定,随它一起移除。 |
|
|
84
|
+
| **省 Token**页 | 压缩管线(RTK / 提示词瘦身 / 本地应答)跑在同一个适配器里。 |
|
|
85
|
+
| **路由**页(combo 降级链) | 由同一个适配器提供。 |
|
|
86
|
+
| 公告中心、自更新、热重载 | 上游发布清单签名验不过;一个 fork 也不该让别人替你换掉本机字节。 |
|
|
87
|
+
| 本地转发(18899)与局域网转发 | 转发的正是被删掉的那条车道。 |
|
|
88
|
+
| `packages/standalone/`(独立 Web 产品)、`worker/`(EAC 的 Cloudflare 授权网关)、`feed/` + `catalog/`(公告源与发布清单) | 三块卫星全部 `import` 被删车道,留着就是一套永远跑不起来的代码。 |
|
|
89
|
+
|
|
90
|
+
规模变化:`src/` 从 **58 个模块 → 5 个**(`store/key/chan-relay/egress/trust`),宿主 `index.js` 从
|
|
91
|
+
**2343 行 → 684 行**,浏览器半身 `client.js` 从 **5992 行 → 2531 行**,离线测试从 45 个套件 → **16 个**。
|
|
92
|
+
界面里所有 `animation` 与 `@keyframes` 也已删除。
|
|
93
|
+
|
|
94
|
+
## 配置
|
|
95
|
+
|
|
96
|
+
唯一的状态文件是 `~/.dsh/our-free-model/settings.json`(0600)。本 fork 只读这三个键:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"egress": {
|
|
101
|
+
"enabled": false,
|
|
102
|
+
"mode": "subscription",
|
|
103
|
+
"url": "",
|
|
104
|
+
"mihomoPath": ""
|
|
105
|
+
},
|
|
106
|
+
"chanGateway": {
|
|
107
|
+
"relay": { "enabled": false, "host": "127.0.0.1", "port": 18326, "key": "" }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
2.1.0 写下的其它键(`enabled`、`forward`、`tokenSaver`、`aggregate`、`combos`、
|
|
113
|
+
`announcementsAcked`…)会被原样保留但不再生效——`JsonStore` 把文件合并到默认值之上,
|
|
114
|
+
所以你已有的出口地址与中继密钥在升级时不会丢。
|
|
115
|
+
|
|
116
|
+
### HTTP 面
|
|
117
|
+
|
|
118
|
+
全部经信任围栏,前缀 `/api/our-free-model`:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
GET /summary 四个页面要的文档(settings.egress / channels / version / outlet)
|
|
122
|
+
GET /outlet 当前出口节点与延迟(读数,失败也只是缺读数)
|
|
123
|
+
GET /egress/url 订阅地址本身——只在页面点「显示/复制」时读
|
|
124
|
+
POST /settings 只接受 egress 分区
|
|
125
|
+
GET /chan-gateway 中继与网关状态(不含密钥)
|
|
126
|
+
POST /chan-gateway/apply 改绑定地址/端口
|
|
127
|
+
GET /chan-gateway/key 中继密钥(按需读)
|
|
128
|
+
POST /chan-gateway/rotate 轮换中继密钥
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
数据看板与运行日志**不经过这里**:渠道包自己持有逐请求账本,浏览器半身直接走 shell 的
|
|
132
|
+
`connection` RPC(`usage.tokenLedger` / `usage.tokenLedgerHistory`)。
|
|
133
|
+
|
|
134
|
+
## 安全
|
|
135
|
+
|
|
136
|
+
- **凭据**:账号 token 进渠道包自己的凭据目录(`~/.dsh/.credentials.yaml`,0600),页面永远拿不到明文;订阅地址按凭据对待,只在点「显示」时读取,常规 payload 里只有打码后的 host。
|
|
137
|
+
- **局域网中继是唯一对外监听**:默认关;开启后必须用独立的中继密钥(与本机网关密钥不通用)。**能连上这台机器的人都能消耗你的渠道额度**——只在可信网络启用,必要时用防火墙限制来源网段。
|
|
138
|
+
- **信任围栏**:插件路由优先级高于内核 `/api`,所以内置了与内核一致的准入检查——优先复用 composition 的 `connection` 服务,缺失时退回结构化围栏(Host 必须回环、拒绝跨站标记、Origin/Referer 必须同源)。
|
|
139
|
+
- **出网面审计**:见 [`SECURITY-AUDIT.md`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/SECURITY-AUDIT.md)——**结论是直连各渠道厂商、无第三方中转、无遥测**;含 13 家域名与 TLS 证书主体、两处不带凭据的第三方调用、本地暴露面与已知风险。
|
|
140
|
+
复跑:`node scripts/egress-audit.mjs --tls`(只读,`--json` 出结构化结果)。
|
|
141
|
+
|
|
142
|
+
## 测试
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm test # 16 个离线套件,无需网络、不花额度
|
|
146
|
+
node scripts/host-smoke-test.mjs # 只跑宿主 HTTP 面
|
|
147
|
+
node scripts/client-lint.mjs # 只跑浏览器半身(字典键一一对应 + CSS 规则可达)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
| 套件 | 覆盖 |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| `client-lint` | 浏览器半身:注册、双语字典键一一对应且无冗余、每条 CSS 规则可达、发出的 `ofm_*` 类都有定义 |
|
|
153
|
+
| `client-render` | 四个页面用宿主形状的 payload 真渲染一遍(终态树,防「引用了已删组件」) |
|
|
154
|
+
| `host-smoke` | 宿主 HTTP 面全量:四个页面的数据、出口校验、中继密钥生成/轮换/落盘、**被删路由必须 404** |
|
|
155
|
+
| `trust` / `chan-relay` / `egress` | 三个宿主模块各自的契约 |
|
|
156
|
+
| `channel-pack` / `channel-network` | 渠道包挂载、十五个 provider 注册、积分、图片计价、代理与 OAuth 生命周期 |
|
|
157
|
+
| `channel-model-metadata` | 选择器读到的模型元数据:WorkBuddy 五档档位、Loomy `spark-x` 窗口(**远端与兜底两条路径都测**)、档位声明顺序与默认档不翻转 |
|
|
158
|
+
| `channel-catalog` / `channel-catalog-heal` | 目录落地广播、`got` 与 `complete` 分离、冷启动有界预热;以及**残缺目录能否自愈**(真装配适配器,先残缺后完整) |
|
|
159
|
+
| `channel-gateway-source` | 网关自造消息的 `source.kind` 落在 `dsh-llm` 的模块增强词汇表内(**真起网关 + 真 HTTP 请求**,从 `stream()` 入参读回合成消息) |
|
|
160
|
+
| `channel-cline-dev` | Cline 的 models.dev 目录:`Accept-Encoding: br, gzip`、ETag/条件请求、**304 回退成上次结果**(不许变空表)、超时 60s、`supportsImage: false` 保真 |
|
|
161
|
+
| `channel-officeace-lock` / `channel-officeace-login` | 移植渠道 OfficeAce:登录闭环真走 RPC(authorize URL → poll → 换 token → 落库);锁定分道的**判定与执行**逐条断言(未锁定逐字走旧路径、锁定+只剩永久桶必须抛错不回落)|
|
|
162
|
+
| `channel-accio` | 移植渠道 Accio:真走 RPC 完成回调式登录(授权页 → 本地回调 → 换 token → 按**账号 ref** 落库),并断言自动续期表覆盖 accio / officeace(漏一项 = 静默不续期且零日志)|
|
|
163
|
+
|
|
164
|
+
上游的 45 个套件里,其余的都在测被删掉的车道,已一并移除。测试**只在仓库里跑**(npm 包不含 `scripts/`)。
|
|
165
|
+
|
|
166
|
+
## 渠道包
|
|
167
|
+
|
|
168
|
+
`vendor/channel-pack/` 是一个完整子项目(有自己的 `package.json`、TypeScript 源码、
|
|
169
|
+
测试与构建脚本),`pack.js` 是它的打包产物:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
npm run channel-pack # 从 vendor/channel-pack/src 重新打包(需要 esbuild)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
来源、授权与改造说明见 `vendor/channel-pack/NOTICE.md`;挂载时关闭了上游 OpenCode 账号接入。
|
|
176
|
+
|
|
177
|
+
## 出处与致谢
|
|
178
|
+
|
|
179
|
+
这个插件的两层来路不同,**都是别人的劳动**,这里如实写清。
|
|
180
|
+
|
|
181
|
+
### ① 宿主与整体形态:`Ebony-Vinyl/dsh-our-free-model`(fork 父仓库)
|
|
182
|
+
|
|
183
|
+
本仓库是它的精简 fork。**宿主半身、内置渠道包的改造、以及本 fork 沿用至今的目录结构都出自它**:
|
|
184
|
+
|
|
185
|
+
| 它做了什么 | 在哪 |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| 整个插件的原始实现(宿主 + 浏览器半身 + 渠道包挂载) | [`Ebony-Vinyl/dsh-our-free-model`](https://github.com/Ebony-Vinyl/dsh-our-free-model) |
|
|
188
|
+
| 把渠道包内置进 `vendor/`,并统一改名为 `channel-pack`(去掉上游代号) | 提交 `7bc8068`(2026-10-07,作者 Ebony-Vinyl)—— 本 fork 直接继承 |
|
|
189
|
+
| 在挂载时关闭上游 OpenCode 账号接入(本 fork 保留该开关) | 同上 |
|
|
190
|
+
| 许可与版权 | MIT,© 2026 **Ebony-Vinyl**(见本仓库 [`LICENSE`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE)) |
|
|
191
|
+
|
|
192
|
+
⚠️ 它**不是渠道与模型数据的数据源** —— 它自己没有固定节奏地从下面的真上游刷新那段副本,
|
|
193
|
+
所以我们查模型列表一律去 ②。
|
|
194
|
+
|
|
195
|
+
宿主半身(`index.js` / `client.js` / `src/*.js`)的**骨架出自它** —— 那是本 fork 的起点。
|
|
196
|
+
⚠️ **截至当前版本,我们还没有从它的 2.2/2.3 取过宿主侧修复**:那些改动集中在
|
|
197
|
+
被本 fork 删掉的车道与页面上(免费车道、EAC、桌面壳、插件升级页),取不进来。
|
|
198
|
+
将来若它有落在**保留车道**上的宿主修复,按「改动即回写」的规矩单独移植。
|
|
199
|
+
|
|
200
|
+
另外,有一处**两条上游给了不同答案**的地方值得说明:网关自造消息的来源身份,父仓库用
|
|
201
|
+
`{ kind: 'plugin:dsh-openai-gateway' }`,而 gitee 上游用「裸 `kind` + `declare module` 增强」。
|
|
202
|
+
本 fork **采用了后者** —— 因为 `dsh-llm` 0.2 已删掉共享的 `plugin` 包装
|
|
203
|
+
(原文「no shared catch-all `plugin` kind」),且全仓约 20 处 `MessageSourceMap` 增强
|
|
204
|
+
一律是裸 kebab-case,**没有任何 `plugin:` 前缀先例**。判断依据与实测见
|
|
205
|
+
`vendor/channel-pack/src/openai-gateway/messages.ts` 的注释。
|
|
206
|
+
|
|
207
|
+
### ② 渠道与模型数据:`Jet` 的渠道包(真上游)
|
|
208
|
+
|
|
209
|
+
`vendor/channel-pack/` 里**十五个账号渠道的登录、账号池、凭据续期、积分领取、
|
|
210
|
+
模型黑名单与 OpenAI 网关**全部出自同一个上游项目 —— 那才是本插件真正的价值所在:
|
|
211
|
+
|
|
212
|
+
- **Gitee 仓库**:`iJetLi/deepseek-harness-codearts`(上游现已更名为 **`dsh-providers-hub`**)
|
|
213
|
+
- **作者**:**Jet**(`iJetLi`)
|
|
214
|
+
- **许可与版权**:MIT,© 2026 **Jet**(见 `vendor/channel-pack/LICENSE`)
|
|
215
|
+
- 本 fork 吸收的提交:`345f0a07b22713c0ae189ca7d8b97ec4f64626c6`(2026-10-06),出处与再构建步骤见 `vendor/channel-pack/NOTICE.md`
|
|
216
|
+
|
|
217
|
+
我们在这个副本上做的是**外科手术式跟进**:当前版本的模型档位、`spark-x` 上下文窗口、
|
|
218
|
+
档位展示顺序,以及目录完整性/广播/冷启动预热,都是逐条对齐 Jet 上游的实测结论移植过来的
|
|
219
|
+
(每条改动的依据都写在对应源码注释里)。**没有他这份实现,这个插件不存在。**
|
|
220
|
+
|
|
221
|
+
也谢谢 fork 父仓库与真上游的其它贡献者:两边都是多人协作的项目,
|
|
222
|
+
`git log` 里那些实测记录(浏览器抓包、真实账号复测、错误码归因)才是这些渠道能跑通的真正原因。
|
|
223
|
+
|
|
224
|
+
## 许可
|
|
225
|
+
|
|
226
|
+
本仓库 MIT(见 [`LICENSE`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE));
|
|
227
|
+
渠道包部分见 `vendor/channel-pack/LICENSE`(© Jet)与 `NOTICE.md`。
|
|
228
|
+
所有渠道账号、额度与积分规则归各提供商所有,请遵守各自的服务条款。
|
package/README_EN.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Model Access (dsh-free-model)
|
|
2
|
+
|
|
3
|
+
**A DSH plugin** (DeepSeek Harness · cordis bundle) · [中文](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/README.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-free-model)
|
|
6
|
+
[](#)
|
|
7
|
+
[](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE)
|
|
8
|
+
|
|
9
|
+
> A trimmed fork of [`Ebony-Vinyl/dsh-our-free-model`](https://github.com/Ebony-Vinyl/dsh-our-free-model) **2.1.0** (commit `7e3a1da`).
|
|
10
|
+
> One lane survives: **bring your own account channels** — fifteen providers, plus a token dashboard,
|
|
11
|
+
> a per-request log and a local gateway. Upstream's anonymous free lane, the EAC co-paid lane, the
|
|
12
|
+
> aggregate lane, the token savers, the routing chains and the whole release/update channel are gone.
|
|
13
|
+
>
|
|
14
|
+
> ⚠️ The fork parent is **already at 2.3.0**, but nearly all of its later work sits in the lanes this fork
|
|
15
|
+
> deletes; **channel and model data come from the true upstream** (see "Credits and provenance" below).
|
|
16
|
+
|
|
17
|
+
| | |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| npm | **`dsh-free-model`** (same as the repository) |
|
|
20
|
+
| Settings entry | **模型接入** in Chinese, **Model Access** in English |
|
|
21
|
+
| Loader entry id | `our-free-model` — the settings namespace and the state directory hang off this id, so they do **not** move when the package name changes |
|
|
22
|
+
| State directory | `~/.dsh/our-free-model/` (0600) |
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
**CLI (plain dsh web) — recommended**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
dsh plugin --profile web add dsh-free-model
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then **restart dsh once**: the host half lives inside the process, so only a restart loads the new
|
|
33
|
+
`index.js`; the browser half just needs a page refresh. `--profile` takes the profile you actually use
|
|
34
|
+
(`web` by default).
|
|
35
|
+
|
|
36
|
+
**Desktop (DSHEAC AIO)**: install through the **in-app plugin manager**. The desktop build gates the
|
|
37
|
+
profile before booting web — it only lets through links dsh itself created under `.dsh-module-fallback`,
|
|
38
|
+
and any other symlink or junction in the profile tree makes it refuse to start
|
|
39
|
+
(`PROFILE_UPGRADE_REQUIRED`). So **do not use `link:` dependencies and do not hand-make junctions**.
|
|
40
|
+
|
|
41
|
+
**Switching from upstream**: upstream publishes as `dsh-our-free-model`. Both packages use the loader
|
|
42
|
+
entry id `our-free-model`, so they **cannot be installed at the same time**:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
dsh plugin --profile web remove dsh-our-free-model
|
|
46
|
+
dsh plugin --profile web add dsh-free-model
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The state directory and the entry id are unchanged in this fork, so **accounts, credentials and the
|
|
50
|
+
outlet address survive the switch**.
|
|
51
|
+
|
|
52
|
+
**Uninstall / roll back**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
dsh plugin --profile web remove dsh-free-model # uninstall
|
|
56
|
+
dsh plugin --profile web add dsh-our-free-model # roll back to upstream 2.1.0
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> ⚠️ **Do not copy the checkout into `node_modules/<package>/` by hand.** Measured on 2026-10-11: such a
|
|
60
|
+
> copy is replaced from the lockfile — or pruned outright — by the next `pnpm install` the plugin manager
|
|
61
|
+
> runs (installing or removing *any* other plugin triggers one). To pin it long-term, use the registry
|
|
62
|
+
> (this package) or a `file:` dependency on a CLI web profile.
|
|
63
|
+
|
|
64
|
+
## Quick start
|
|
65
|
+
|
|
66
|
+
1. After the restart open **Settings → 模型接入 / Model Access** and log into each channel you want
|
|
67
|
+
(browser authorization; the account pool and credit lookups live on the same card).
|
|
68
|
+
2. Every channel card lets you switch models on and off one by one, plus **show all / hide all** —
|
|
69
|
+
**they may all start hidden**, and hidden models never reach the model picker.
|
|
70
|
+
3. Back in the chat composer's model picker the channel models appear grouped per product; pick one.
|
|
71
|
+
|
|
72
|
+
## What survives
|
|
73
|
+
|
|
74
|
+
Four settings pages (down from nine):
|
|
75
|
+
|
|
76
|
+
| Page | What it does |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| **Free channels** | Fifteen account cards — CodeArts, CodeBuddy / WorkBuddy (CN + intl), LobsterAI, Qoder / Qoder CN, TRAE, Cline, Loomy, Raccoon, MiniMax Code, ZCode, Gemini, **OfficeAce** (Huawei Cloud ModelArts, cloud-direct, no client install) and **Accio Work** (Alibaba, standard OAuth + PKCE, IDE-free): browser login, account pool, renewal, credit lookup and one-click claim, daily auto check-in, per-model switches, balance. |
|
|
79
|
+
| **Dashboard** | The pack's own per-request token ledger: today / all-time usage, average throughput, TTFT, cache hit rate, success rate, account pivot, per-model table. |
|
|
80
|
+
| **Request log** | Every request in detail: result, duration, TTFT, speed, token breakdown; hover a failed row for the reason. |
|
|
81
|
+
| **Gateway** | The pack's local OpenAI-compatible gateway (switch, endpoint, key, model count), this plugin's LAN relay (bind address/port, its own key, rotation), and the egress-outlet section. |
|
|
82
|
+
|
|
83
|
+
## What was removed and why
|
|
84
|
+
|
|
85
|
+
| Removed | Why |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| **Free models** page: the anonymous opencode lane + Kilo free pool | Third-party grey channel (client impersonation + pooled public credentials); can break at any time. |
|
|
88
|
+
| **EAC models** page: the GitHub-gated co-paid lane | Depends on the repository owner's gateway and a star grant. |
|
|
89
|
+
| **Aggregate** page (76 bring-your-own-key providers) | Served by the plugin's own adapter, which this fork removes. |
|
|
90
|
+
| **Token savers** page | The compaction pipeline runs inside that same adapter. |
|
|
91
|
+
| **Routing** page (combo fallback chains) | Same adapter. |
|
|
92
|
+
| Announcement centre, self-updater, hot reload | Upstream release signatures did not verify; and a fork should not let a remote party swap its bytes. |
|
|
93
|
+
| Local forward listener (18899) and the LAN forward | They forwarded the deleted lane. |
|
|
94
|
+
| `packages/standalone/`, `worker/`, `feed/`, `catalog/` | All three satellite products `import` the deleted lane; keeping them means shipping code that can never run. |
|
|
95
|
+
|
|
96
|
+
Sizes: `src/` went from **58 modules to 5** (`store/key/chan-relay/egress/trust`), the host `index.js`
|
|
97
|
+
from **2343 to 684 lines**, the browser half `client.js` from **5992 to 2538 lines**, and the offline
|
|
98
|
+
suites from 45 to **16**. Every `animation` and `@keyframes` rule is gone as well.
|
|
99
|
+
|
|
100
|
+
## Configuration
|
|
101
|
+
|
|
102
|
+
The only state file is `~/.dsh/our-free-model/settings.json` (0600); this fork reads three keys:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"egress": {
|
|
107
|
+
"enabled": false,
|
|
108
|
+
"mode": "subscription",
|
|
109
|
+
"url": "",
|
|
110
|
+
"mihomoPath": ""
|
|
111
|
+
},
|
|
112
|
+
"chanGateway": {
|
|
113
|
+
"relay": { "enabled": false, "host": "127.0.0.1", "port": 18326, "key": "" }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Other keys written by 2.1.0 (`enabled`, `forward`, `tokenSaver`, `aggregate`, `combos`,
|
|
119
|
+
`announcementsAcked`, …) are preserved but inert — `JsonStore` merges the file over the defaults, so
|
|
120
|
+
your outlet address and relay key survive an upgrade.
|
|
121
|
+
|
|
122
|
+
### HTTP surface
|
|
123
|
+
|
|
124
|
+
Everything goes through the trust fence, under `/api/our-free-model`:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
GET /summary the document the four pages read (settings.egress / channels / version / outlet)
|
|
128
|
+
GET /outlet current outlet node and latency (a reading; failure is just a missing reading)
|
|
129
|
+
GET /egress/url the subscription URL itself — read only when the page asks to show/copy it
|
|
130
|
+
POST /settings accepts the egress section only
|
|
131
|
+
GET /chan-gateway relay and gateway state (never the keys)
|
|
132
|
+
POST /chan-gateway/apply change bind address/port
|
|
133
|
+
GET /chan-gateway/key the relay key, on demand
|
|
134
|
+
POST /chan-gateway/rotate rotate the relay key
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The dashboard and the request log **do not** go through here: the pack owns the per-request ledger and
|
|
138
|
+
the browser half talks to it over the shell's `connection` RPC (`usage.tokenLedger` /
|
|
139
|
+
`usage.tokenLedgerHistory`).
|
|
140
|
+
|
|
141
|
+
## Security
|
|
142
|
+
|
|
143
|
+
- **Credentials**: account tokens live in the pack's own credential store (`~/.dsh/.credentials.yaml`, 0600); the page never sees plaintext. The subscription URL is treated as a credential and read only when you ask to display it — ordinary payloads carry a masked host.
|
|
144
|
+
- **The LAN relay is the only listener facing outward**: off by default; when on it requires its own relay key (not shared with the local gateway key). **Anyone who can reach this machine can spend your channel quota** — enable it only on a trusted network, and firewall the source range if in doubt.
|
|
145
|
+
- **Trust fence**: the plugin's routes outrank the kernel's `/api`, so it carries the same admission check as the kernel — it reuses the composition's `connection` service when present, and otherwise falls back to a structural fence (loopback `Host`, no cross-site marker, same-origin `Origin`/`Referer`).
|
|
146
|
+
- **Egress audit**: see [`SECURITY-AUDIT.md`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/SECURITY-AUDIT.md) — the verdict is **direct to each provider, no third-party relay, no telemetry**; it lists the fifteen providers' hosts with their TLS certificate subjects, the two non-vendor calls that carry no credentials, the local surface and the known risks. Re-run it with `node scripts/egress-audit.mjs --tls` (read-only; `--json` for machine output).
|
|
147
|
+
|
|
148
|
+
## Tests
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm test # 16 offline suites: no network, no quota
|
|
152
|
+
node scripts/host-smoke-test.mjs # the host HTTP surface only
|
|
153
|
+
node scripts/client-lint.mjs # the browser half only (dictionary keys, CSS reachability)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Suite | Covers |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| `client-lint` | Browser half: registration, the two dictionaries agree key-for-key with no extras, every CSS rule is reachable, every emitted `ofm_*` class is defined |
|
|
159
|
+
| `client-render` | The four pages rendered for real against host-shaped payloads (catches references to deleted components) |
|
|
160
|
+
| `host-smoke` | The whole host HTTP surface: the four pages' data, outlet validation, relay key minting/rotation/persistence, **and that deleted routes 404** |
|
|
161
|
+
| `trust` / `chan-relay` / `egress` | Each host module's own contract |
|
|
162
|
+
| `channel-pack` / `channel-network` | Pack mounting, fifteen provider registrations, credits, image pricing, proxy and OAuth lifecycles |
|
|
163
|
+
| `channel-model-metadata` | The model metadata the picker reads: WorkBuddy's five efforts, Loomy `spark-x`'s window (**both the remote and fallback paths**), and the declared effort order with a default that must not flip |
|
|
164
|
+
| `channel-catalog` / `channel-catalog-heal` | Catalog-landing broadcast, `got` vs `complete`, bounded cold-start prewarm, and whether a **partial catalog heals** (real adapter, partial then complete) |
|
|
165
|
+
| `channel-gateway-source` | The gateway's synthesized messages carry a `source.kind` inside `dsh-llm`'s module-augmented vocabulary (**real gateway + real HTTP request**, read back from the `stream()` argument) |
|
|
166
|
+
| `channel-cline-dev` | Cline's models.dev catalog: `Accept-Encoding: br, gzip`, ETag conditional requests, **304 falling back to the previous result** (never an empty catalog), 60s timeout, and `supportsImage: false` preserved |
|
|
167
|
+
| `channel-officeace-lock` / `channel-officeace-login` | The ported OfficeAce channel: the login loop really goes through RPC (authorize URL → poll → token → persisted); the lock **decision and its execution** are asserted case by case (unlocked keeps the old path verbatim, locked-with-only-permanent must throw and never fall back to the pool) |
|
|
168
|
+
| `channel-accio` | The ported Accio channel: a callback-style login really goes through RPC (authorize page → local callback → token exchange → persisted under the **account's own ref**), plus the auto-renew table is asserted to cover accio / officeace (a missing entry = silently never renewed, with no log) |
|
|
169
|
+
|
|
170
|
+
The other 37 of upstream's 45 suites tested lanes this fork deletes. The suites run **from a checkout
|
|
171
|
+
only** — the npm package does not ship `scripts/`.
|
|
172
|
+
|
|
173
|
+
## The channel pack
|
|
174
|
+
|
|
175
|
+
`vendor/channel-pack/` is a complete sub-project (its own `package.json`, TypeScript sources, tests and
|
|
176
|
+
build script); `pack.js` is its bundle:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npm run channel-pack # rebuild from vendor/channel-pack/src (needs esbuild)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Provenance, licence and what was changed are in `vendor/channel-pack/NOTICE.md`; OpenCode account
|
|
183
|
+
access is switched off when the pack mounts.
|
|
184
|
+
|
|
185
|
+
## Credits and provenance
|
|
186
|
+
|
|
187
|
+
This plugin has two distinct lineages, and **both are other people's work**. Stated plainly here.
|
|
188
|
+
|
|
189
|
+
### ① The host and the overall shape: `Ebony-Vinyl/dsh-our-free-model` (the fork parent)
|
|
190
|
+
|
|
191
|
+
This repository is a trimmed fork of it. **The host half, the vendoring of the channel pack, and the
|
|
192
|
+
directory layout this fork still uses all come from there:**
|
|
193
|
+
|
|
194
|
+
| What it did | Where |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| The original plugin implementation (host + browser half + pack mounting) | [`Ebony-Vinyl/dsh-our-free-model`](https://github.com/Ebony-Vinyl/dsh-our-free-model) |
|
|
197
|
+
| Vendored the pack into `vendor/` and renamed it to `channel-pack` (dropping the upstream codename) | commit `7bc8068` (2026-10-07, by Ebony-Vinyl) — inherited verbatim by this fork |
|
|
198
|
+
| Switched off upstream OpenCode account access when mounting (this fork keeps that switch) | same commit |
|
|
199
|
+
| Licence and copyright | MIT, © 2026 **Ebony-Vinyl** (see this repo's [`LICENSE`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE)) |
|
|
200
|
+
|
|
201
|
+
⚠️ It is **not the data source for channels or model data** — it does not refresh that vendored copy
|
|
202
|
+
from the true upstream below on any fixed cadence, so model lists are always checked against ②.
|
|
203
|
+
|
|
204
|
+
The **host half's skeleton** (`index.js` / `client.js` / `src/*.js`) is its work — that is this fork's
|
|
205
|
+
starting point. ⚠️ **As of this version we have taken no host-side fixes from its 2.2/2.3**: those
|
|
206
|
+
changes sit in lanes and pages this fork deletes (free lane, EAC, the desktop shell, the plugin-upgrade
|
|
207
|
+
page), so they do not port. If it later lands a host fix in a lane we keep, we port it on its own.
|
|
208
|
+
|
|
209
|
+
One place where the **two upstreams disagree** is worth naming: for the gateway's own message
|
|
210
|
+
source identity, the parent uses `{ kind: 'plugin:dsh-openai-gateway' }` while the gitee upstream uses
|
|
211
|
+
a bare `kind` plus a `declare module` augmentation. This fork **chose the latter** — `dsh-llm` 0.2
|
|
212
|
+
deleted the shared `plugin` wrapper (verbatim: "no shared catch-all `plugin` kind"), and all ~20
|
|
213
|
+
`MessageSourceMap` augmentations in the harness use bare kebab-case with **no `plugin:` prefix
|
|
214
|
+
precedent**. The reasoning and the measurements are in the
|
|
215
|
+
`vendor/channel-pack/src/openai-gateway/messages.ts` comments.
|
|
216
|
+
|
|
217
|
+
### ② Channel and model data: Jet's channel pack (the true upstream)
|
|
218
|
+
|
|
219
|
+
Everything in `vendor/channel-pack/` — **the fifteen account channels' login, account pools,
|
|
220
|
+
credential renewal, credit claiming, model blacklists and the OpenAI gateway** — comes from one
|
|
221
|
+
upstream project. That is where this plugin's actual value lives:
|
|
222
|
+
|
|
223
|
+
- **Gitee repository**: `iJetLi/deepseek-harness-codearts` (upstream has since renamed it to **`dsh-providers-hub`**)
|
|
224
|
+
- **Author**: **Jet** (`iJetLi`)
|
|
225
|
+
- **Licence and copyright**: MIT, © 2026 **Jet** (see `vendor/channel-pack/LICENSE`)
|
|
226
|
+
- Commit absorbed by this fork: `345f0a07b22713c0ae189ca7d8b97ec4f64626c6` (2026-10-06); provenance and rebuild steps are in `vendor/channel-pack/NOTICE.md`
|
|
227
|
+
|
|
228
|
+
What we do on top is **surgical catch-up**: the current model efforts, the `spark-x` context window,
|
|
229
|
+
the declared effort order, and the catalog completeness/broadcast/prewarm work were all ported by
|
|
230
|
+
following Jet's measured findings one by one (the evidence for each change is in the source comments).
|
|
231
|
+
**Without his implementation, this plugin would not exist.**
|
|
232
|
+
|
|
233
|
+
Thanks too to the other contributors on both sides: these are multi-person projects, and the measured
|
|
234
|
+
records in their `git log` (browser captures, real-account retests, error-code attribution) are the
|
|
235
|
+
real reason these channels work at all.
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
This repository is MIT (see [`LICENSE`](https://github.com/YpipaQ/dsh-free-model/blob/slim-channels-only/LICENSE));
|
|
240
|
+
the vendored channel pack is covered by `vendor/channel-pack/LICENSE` (© Jet) and `NOTICE.md`. All channel
|
|
241
|
+
accounts, quotas and credit rules belong to their providers — follow their terms of service.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# 出网面安全审计(egress audit)
|
|
2
|
+
|
|
3
|
+
> 审计对象:本 fork 装机副本(当时装成 `~/.dsh/profiles/web/node_modules/dsh-our-free-model`,
|
|
4
|
+
> 现已作为 npm 包 **`dsh-free-model@2.1.0`** 发布,装机路径随之变为 `~/.dsh/profiles/web/node_modules/dsh-free-model`)。
|
|
5
|
+
> 审计日期:**2026-10-11**。审计方式:静态列出全部出网域名 + 对每个域名在本机直连握手看 TLS 证书主体。
|
|
6
|
+
> 复跑工具:`node scripts/egress-audit.mjs --tls`(只读、不写文件、不修改系统)。
|
|
7
|
+
> 2026-10-12 复核:只是**改包名**(`dsh-free-model`)与 id 引用,出网面零变化,域名表结论仍然有效;`client.js` 哈希已随改名更新。
|
|
8
|
+
|
|
9
|
+
审计时的产物指纹(要复现同期结论请先比对):
|
|
10
|
+
|
|
11
|
+
| 文件 | sha256 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `index.js` | `a932bcb6bdeef608496071a60d1f9e8499997fca52765e0eb300171d8728aa57` |
|
|
14
|
+
| `client.js` | `13332f9b4102e5cc7125998983126df7b50cfa6a32ef5e20aefc51aca0a5e820` |
|
|
15
|
+
| `vendor/channel-pack/pack.js` | `e1e63e95d0aeddb882748c3961391a2583dcbeb5f71104c418797989030f4425` |
|
|
16
|
+
|
|
17
|
+
⚠️ `pack.js` 的指纹随每次「刷新模型数据 / 移植上游修复」而变(它是构建产物)。
|
|
18
|
+
上面的值对应**模型元数据刷新与目录完整性移植之后**的版本;域名面结论未变,
|
|
19
|
+
`scripts/egress-audit.mjs` 可随时重跑复验。
|
|
20
|
+
|
|
21
|
+
## 结论
|
|
22
|
+
|
|
23
|
+
**是直连对应服务提供商。** 全部业务出网都是 HTTPS 到厂商自家域名,TLS 证书主体为厂商本人;**没有第三方中转、没有回传作者服务器、没有遥测**。仅有两处外部辅助调用(模型能力元数据、出口 IP 探测),都不携带账号凭据。
|
|
24
|
+
|
|
25
|
+
## 一、15 个渠道的出网域名与证书主体
|
|
26
|
+
|
|
27
|
+
下表"证书主体"取自**本机直连握手**(域名 → TLS 证书的 Subject/Issuer),用来证明流量终点不是中间人。
|
|
28
|
+
|
|
29
|
+
| 渠道 | 出网主机 | 证书主体(实测) |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| CodeArts(华为) | `codearts.huaweicloud.com`、`opengw.developer.huaweicloud.com`、`snap-access.cn-north-4.myhuaweicloud.com`、`devcloud.cn-north-4.huaweicloud.com`、`auth.huaweicloud.com`、`sts.cn-north-4.myhuaweicloud.com` | `Huawei Software Technologies Co., Ltd.`(GlobalSign) |
|
|
32
|
+
| CodeBuddy / WorkBuddy / Buddy(腾讯) | `copilot.tencent.com`、`www.codebuddy.cn`、`www.workbuddy.ai` | `Tencent Technology (Shenzhen) Company Limited`(DigiCert) |
|
|
33
|
+
| Qoder / Qoder CN(阿里) | `qoder.com`、`qoder.cn`、`gateway.qoder.com.cn`、`openapi.qoder.com.cn`、`openapi.qoder.sh`、`api2.qoder.sh`、`api2-v2.qoder.sh` | `*.qoder.com.cn` / `*.qoder.sh` / `qoder.com` |
|
|
34
|
+
| TRAE(字节) | `api.trae.cn`、`www.trae.cn`、`api.trae.com.cn`、`trae-api-cn.mchost.guru` | `*.trae.cn` / `*.trae.com.cn` / `*.mchost.guru`(DV 证书,不含企业名) |
|
|
35
|
+
| Cline | `api.cline.bot`、`app.cline.bot`、`cline.bot`;登录 `api.workos.com` | `api.cline.bot`(Google Trust Services) |
|
|
36
|
+
| LobsterAI(网易有道) | `lobsterai-server.youdao.com`、`lobsterai.youdao.com`、`api-overmind.youdao.com`、`pub-g1-gz.alb.ntes53.netease.com`(ALB 回源) | `网易有道信息技术(北京)有限公司` / `*.youdao.com`(ALB 主机也发 Youdao 证书) |
|
|
37
|
+
| Loomy(讯飞) | `loomy.xunfei.cn`、`loomyad.xunfei.cn`、`account.xfinfr.com`;微信扫码 `open.weixin.qq.com` / `long.open.weixin.qq.com` | `合肥科讯创想软件开发有限公司` / `科大讯飞股份有限公司`;微信为腾讯 |
|
|
38
|
+
| Raccoon(小浣熊) | `xiaohuanxiong.com`;登录页静态资源 `o.alicdn.com` | `*.xiaohuanxiong.com`;阿里 CDN `Alibaba (China) Technology Co., Ltd.` |
|
|
39
|
+
| MiniMax Code | `agent.minimax.cn`、`account.minimax.cn` | `*.minimax.cn`(DNSPod DV) |
|
|
40
|
+
| ZCode(智谱 z.ai) | `zcode.z.ai`、`api.z.ai`、`chat.z.ai` | `*.z.ai`(Sectigo DV) |
|
|
41
|
+
| Gemini(Google) | `daily-cloudcode-pa.googleapis.com`、`daily-cloudcode-pa.sandbox.googleapis.com`、`www.googleapis.com`、`oauth2.googleapis.com`、`accounts.google.com` | Google(**本机直连不通**,需代理才能握手;域名与用途由源码与官方 SDK 对齐) |
|
|
42
|
+
| Accio Work(阿里,2026-10-15 移植) | `phoenix-gw.alibaba.com`(gateway,两区域同一个)、登录页 `www.accio-ai.com`(国际)/ `zh.accio.com`(中国) | `*.alibaba.com` / `*.accio-ai.com` / `*.accio.com`,签发方 GlobalSign **OV**(已验证组织身份)—— 网关证书主体即 `*.alibaba.com`,直接证明流量终点是阿里本身而非中间人 |
|
|
43
|
+
| OfficeAce(华为云 ModelArts MaaS,2026-10-15 移植) | `officeace.cn-southwest-2.huaweicloud-agentarts.com`、`agentarts.cn-southwest-2.myhuaweicloud.com`、`api.modelarts-maas.com`;登录复用 `auth.huaweicloud.com` + `sts.cn-north-4.myhuaweicloud.com`(与 CodeArts 同两家) | `*.cn-southwest-2.huaweicloud-agentarts.com` / `*.cn-southwest-2.myhuaweicloud.com` / `*.modelarts-maas.com`,签发方均为 GlobalSign RSA OV(OV = 已验证组织身份,与华为云其余端点同一 CA 策略) |
|
|
44
|
+
|
|
45
|
+
## 二、仅有的外部(非厂商)调用
|
|
46
|
+
|
|
47
|
+
| 主机 | 用途 | 是否带凭据 | 在我们这份里的状态 |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| `https://models.dev/api.json` | Cline 车道取**模型能力元数据**(上下文/推理档位) | 否(只有 `Accept: application/json`) | 有效(Cline 在用) |
|
|
50
|
+
| `http://ip-api.com/json/?fields=…` | **明文 HTTP**,查出口 IP,仅供 OpenCode 车道的「测试代理」按钮 | 否 | 车道已禁用(`disableOpencode`),不会触发 |
|
|
51
|
+
| `http://www.gstatic.com/generate_204` | 生成的 mihomo 配置里的连通性探测 URL | 否 | 只在你启用「出口代理」时才存在,且是写入配置文本,不主动请求 |
|
|
52
|
+
|
|
53
|
+
代码注释里出现的 `github.com` / `gitee.com` / `blog.csdn.net` / `bigmodel.cn` 是**参考实现出处**,不是请求目标。
|
|
54
|
+
|
|
55
|
+
## 三、"直连"是怎么保证的
|
|
56
|
+
|
|
57
|
+
渠道出网的代理决策顺序(`vendor/channel-pack/src/channel-fetch.ts`):
|
|
58
|
+
|
|
59
|
+
1. 目标 `127.0.0.1` / `::1` → 永不加代理;
|
|
60
|
+
2. **插件出口代理**(本项目「网关设置」里的出口分区)——默认关闭;
|
|
61
|
+
3. **环境代理** `HTTPS_PROXY` / `HTTP_PROXY` / `ALL_PROXY`——本机 dsh 进程没有任何 `*_proxy`;
|
|
62
|
+
4. Windows 系统代理——Linux 分支不读;
|
|
63
|
+
5. 否则**直连**。
|
|
64
|
+
|
|
65
|
+
因此当前渠道请求是直连厂商;桌面环境里那个 `127.0.0.1:7897`(GNOME 手动代理)**不会被渠道请求使用**。需要给 Google 系(Gemini)或 OpenCode 用车时,才需要配环境代理或启用出口。
|
|
66
|
+
|
|
67
|
+
## 四、本机暴露面
|
|
68
|
+
|
|
69
|
+
| 面 | 状态 |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| dsh 本体 | `127.0.0.1:3080`(仅回环) |
|
|
72
|
+
| 渠道包本地 OpenAI 网关 | `127.0.0.1:8326`,**必须带 API key**(无 key 实测 `401`);key 文件 `~/.dsh/openai-gateway/api-key` 权限 `600` |
|
|
73
|
+
| 局域网中继 / 本地转发 | `18326` / `18899` **未监听**(默认关闭) |
|
|
74
|
+
| OAuth / 回调服务器 | 全部 `listen 127.0.0.1`(Gemini 另有一个 `::1`) |
|
|
75
|
+
| 浏览器半身 | 只 `fetch` 本机插件 API,不发任何外部请求 |
|
|
76
|
+
| 插件 HTTP 面 | 有信任围栏(Host 必须回环 + 拒跨站 + Origin/Referer 同源);无同源头的请求实测 `401`,外部网页无法借你已登录的账号发请求 |
|
|
77
|
+
|
|
78
|
+
## 五、凭据面
|
|
79
|
+
|
|
80
|
+
- 账号 token 存在 `~/.dsh/.credentials.yaml`(`600`),由内核凭据服务保管;渠道页只拿 `credentialRef` 与**脱敏**身份(手机号形如 `130******00`),token 不回传浏览器。
|
|
81
|
+
- 渠道包状态 `~/.dsh/channel-pack/state.json` 与账本 `token-ledger.json` 权限 `644`,内容只有账号引用、昵称与用量,**没有密钥**(要更严可 `chmod 600`)。
|
|
82
|
+
|
|
83
|
+
## 六、打包产物与可读源码
|
|
84
|
+
|
|
85
|
+
`vendor/channel-pack/pack.js` 是 2.9 MB 打包产物,仓库里同时带可读 `src/*.ts`。用工具做域名差集:
|
|
86
|
+
|
|
87
|
+
- **产物有、源码无**:只有 `github.com`(注释里的参考仓库)与 WHATWG/W3C/IETF 规范链接(错误信息格式化用)。
|
|
88
|
+
- **源码有、产物无**:`www.codebuddy.cn`(仅登录页常量 `WEBSITE_HOME`,源码里未被引用,被 tree-shake)、`blog.csdn.net`/`bigmodel.cn`(注释)。
|
|
89
|
+
|
|
90
|
+
这一步只能证明**域名面**一致,加上行为套件(15 家注册、无 OpenCode 预热、RPC 失败关闭)。**不能从字节上证明 `pack.js` 与源码逐行等价**。
|
|
91
|
+
|
|
92
|
+
## 七、边界与已知风险(要知情)
|
|
93
|
+
|
|
94
|
+
1. **ZCode 会向厂商补发存活事件**:`POST https://zcode.z.ai/api/v1/event/report`,事件仅 `app_launch`、`app_daily_active`。收件方是 z.ai 本家,但这是**伪装成官方 IDE 客户端**的行为——属厂商 ToS/风控风险,不是第三方外泄。
|
|
95
|
+
2. **DV 证书不含企业名**的几家(Qoder 部分主机、TRAE、z.ai、MiniMax、小浣熊、Cline、models.dev):只能靠域名归属与源码用途判断,本次未能用证书主体反证。
|
|
96
|
+
3. **Google 系主机直连不通**(`www.googleapis.com`、`oauth2.googleapis.com`、`accounts.google.com`、`daily-cloudcode-pa*.googleapis.com` 握手失败),需要代理;因此它们的证书主体本次未取到。
|
|
97
|
+
4. 插件与 dsh **同进程**、以你的用户身份拥有完整文件权限(所有 dsh 插件皆如此)。本次审的是**出网与凭据面**,不是运行沙箱。
|
|
98
|
+
5. 上游代码是第三方;**渠道包更新后本审计作废**,需要重跑 `node scripts/egress-audit.mjs --tls`。
|
|
99
|
+
|
|
100
|
+
## 八、怎么复跑
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# 1) 静态:域名清单 + 明文 http + listen 绑定 + 产物↔源码差集(离线,秒级)
|
|
104
|
+
node scripts/egress-audit.mjs
|
|
105
|
+
|
|
106
|
+
# 2) 联网:对上面每个域名做 TLS 握手,打印证书主体(约 1–2 分钟)
|
|
107
|
+
node scripts/egress-audit.mjs --tls
|
|
108
|
+
|
|
109
|
+
# 3) 审装机副本而不是仓库
|
|
110
|
+
node scripts/egress-audit.mjs --root ~/.dsh/profiles/web/node_modules/dsh-free-model --tls
|
|
111
|
+
|
|
112
|
+
# 4) 运行时监听面(找有没有 0.0.0.0)
|
|
113
|
+
ss -ltn
|
|
114
|
+
|
|
115
|
+
# 5) 本地网关是否要钥(期望 401)
|
|
116
|
+
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8326/v1/models
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
工具只读、不改任何文件;`--json` 可输出结构化结果供别的脚本消费。
|