dsh-xdpool 3.0.8 → 3.0.9
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/CHANGELOG.md +2451 -2432
- package/LICENSE +21 -21
- package/README.en.md +308 -308
- package/README.md +5 -21
- package/assets/community-qr-qq.jpg +0 -0
- package/assets/icon.png +0 -0
- package/assets/xdpool-banner.gif +0 -0
- package/cordis.patch.yml +24 -24
- package/lib/bin.js +356 -59
- package/lib/client.js +396 -172
- package/lib/index.d.ts +41 -9
- package/lib/index.js +948 -345
- package/package.json +1 -2
- package/screenshots.json +9 -9
- package/scripts/extract-design-css.mjs +322 -322
- package/scripts/link-host-peers.mjs +359 -359
- package/scripts/make-rail-icons.mjs +46 -46
- package/scripts/probe-channels.mjs +142 -142
- package/vendor/channel-pack/LICENSE +21 -21
- package/vendor/channel-pack/NOTICE.md +53 -53
- package/vendor/channel-pack/pack.js +30 -93
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 设计稿的 rail 图标(SVG 线性、24 网格、stroke-width 1.8)。
|
|
3
|
-
*
|
|
4
|
-
* 插件原来用汉字「池登聚量路关备」当图标 —— 那是 Cette 早期没有图标资源时的
|
|
5
|
-
* 占位。设计稿每一行都是一个描边图标,和 DSH 自己的侧栏风格一致。
|
|
6
|
-
*/
|
|
7
|
-
import { writeFileSync } from 'node:fs'
|
|
8
|
-
|
|
9
|
-
const PATHS = {
|
|
10
|
-
pool: 'M3 7h18M3 12h18M3 17h12',
|
|
11
|
-
login: 'M4 8V5a1 1 0 011-1h14a1 1 0 011 1v3M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3M8 12h8',
|
|
12
|
-
aggregate: 'M12 3l8 4.5v9L12 21l-8-4.5v-9z M12 12l8-4.5M12 12v9M12 12L4 7.5',
|
|
13
|
-
ledger: 'M4 19V9M10 19V5M16 19v-7M22 19H2',
|
|
14
|
-
routing: 'M6 3v18M18 3v18M6 8h12M6 16h12',
|
|
15
|
-
gateway: 'M3 5h18v14H3z M3 10h18',
|
|
16
|
-
backup: 'M12 3v12M8 11l4 4 4-4 M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2',
|
|
17
|
-
star: 'M12 3l2.6 5.6 6.4.8-4.7 4.4 1.2 6.2L12 17l-5.5 3 1.2-6.2L3 9.4l6.4-.8z',
|
|
18
|
-
group: 'M21 12a9 9 0 11-4.5-7.8L21 3l-1 4.5',
|
|
19
|
-
dock: 'M4 6h16M4 12h16M4 18h16',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const lines = Object.entries(PATHS).map(([id, d]) => {
|
|
23
|
-
// 一条 path 里可能有多个子路径(空格分隔的 M)
|
|
24
|
-
const parts = d.split(/\s+(?=M)/u)
|
|
25
|
-
const inner = parts.map(sub => `<path d="${sub.trim()}"/>`).join('')
|
|
26
|
-
return ` ${id}: '${inner}',`
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const out = `/**
|
|
30
|
-
* 设计稿的功能页图标。
|
|
31
|
-
*
|
|
32
|
-
* 全部是 24 网格、stroke-width 1.8、圆头描边 —— 和设计稿的 rail-item 一致。
|
|
33
|
-
* 用法:<RailIcon name="pool" />
|
|
34
|
-
*
|
|
35
|
-
* 之前这些位置是汉字(池 / 登 / 聚 / 量 / 路 / 关 / 备)。那是占位,
|
|
36
|
-
* 一屏七个汉字看着像标签而不像导航。
|
|
37
|
-
*/
|
|
38
|
-
export const RAIL_ICONS = {
|
|
39
|
-
${lines.join('\n')}
|
|
40
|
-
} as const
|
|
41
|
-
|
|
42
|
-
export type RailIconName = keyof typeof RAIL_ICONS
|
|
43
|
-
`
|
|
44
|
-
|
|
45
|
-
writeFileSync('D:/dsh-home/_xdpool-src/src/client/rail-icons.ts', out, 'utf8')
|
|
46
|
-
console.log('生成 rail-icons.ts,', Object.keys(PATHS).length, '个图标')
|
|
1
|
+
/**
|
|
2
|
+
* 设计稿的 rail 图标(SVG 线性、24 网格、stroke-width 1.8)。
|
|
3
|
+
*
|
|
4
|
+
* 插件原来用汉字「池登聚量路关备」当图标 —— 那是 Cette 早期没有图标资源时的
|
|
5
|
+
* 占位。设计稿每一行都是一个描边图标,和 DSH 自己的侧栏风格一致。
|
|
6
|
+
*/
|
|
7
|
+
import { writeFileSync } from 'node:fs'
|
|
8
|
+
|
|
9
|
+
const PATHS = {
|
|
10
|
+
pool: 'M3 7h18M3 12h18M3 17h12',
|
|
11
|
+
login: 'M4 8V5a1 1 0 011-1h14a1 1 0 011 1v3M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3M8 12h8',
|
|
12
|
+
aggregate: 'M12 3l8 4.5v9L12 21l-8-4.5v-9z M12 12l8-4.5M12 12v9M12 12L4 7.5',
|
|
13
|
+
ledger: 'M4 19V9M10 19V5M16 19v-7M22 19H2',
|
|
14
|
+
routing: 'M6 3v18M18 3v18M6 8h12M6 16h12',
|
|
15
|
+
gateway: 'M3 5h18v14H3z M3 10h18',
|
|
16
|
+
backup: 'M12 3v12M8 11l4 4 4-4 M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2',
|
|
17
|
+
star: 'M12 3l2.6 5.6 6.4.8-4.7 4.4 1.2 6.2L12 17l-5.5 3 1.2-6.2L3 9.4l6.4-.8z',
|
|
18
|
+
group: 'M21 12a9 9 0 11-4.5-7.8L21 3l-1 4.5',
|
|
19
|
+
dock: 'M4 6h16M4 12h16M4 18h16',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const lines = Object.entries(PATHS).map(([id, d]) => {
|
|
23
|
+
// 一条 path 里可能有多个子路径(空格分隔的 M)
|
|
24
|
+
const parts = d.split(/\s+(?=M)/u)
|
|
25
|
+
const inner = parts.map(sub => `<path d="${sub.trim()}"/>`).join('')
|
|
26
|
+
return ` ${id}: '${inner}',`
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const out = `/**
|
|
30
|
+
* 设计稿的功能页图标。
|
|
31
|
+
*
|
|
32
|
+
* 全部是 24 网格、stroke-width 1.8、圆头描边 —— 和设计稿的 rail-item 一致。
|
|
33
|
+
* 用法:<RailIcon name="pool" />
|
|
34
|
+
*
|
|
35
|
+
* 之前这些位置是汉字(池 / 登 / 聚 / 量 / 路 / 关 / 备)。那是占位,
|
|
36
|
+
* 一屏七个汉字看着像标签而不像导航。
|
|
37
|
+
*/
|
|
38
|
+
export const RAIL_ICONS = {
|
|
39
|
+
${lines.join('\n')}
|
|
40
|
+
} as const
|
|
41
|
+
|
|
42
|
+
export type RailIconName = keyof typeof RAIL_ICONS
|
|
43
|
+
`
|
|
44
|
+
|
|
45
|
+
writeFileSync('D:/dsh-home/_xdpool-src/src/client/rail-icons.ts', out, 'utf8')
|
|
46
|
+
console.log('生成 rail-icons.ts,', Object.keys(PATHS).length, '个图标')
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 渠道实测:验证每个渠道的登录页能不能打开、能不能识别出登录入口。
|
|
3
|
-
*
|
|
4
|
-
* 不是真实扫码登录 —— 那需要人手。这里验的是「插件能不能把浏览器正确打开到正确的地方」:
|
|
5
|
-
* 1. 登录页 URL 是否可达(HTTP 200/3xx)
|
|
6
|
-
* 2. 页面里是否有登录相关的元素(二维码 / 手机号输入 / 授权按钮)
|
|
7
|
-
* 3. 有没有明显的错误页(404 / 域名过期 / 证书问题)
|
|
8
|
-
*
|
|
9
|
-
* 用法:
|
|
10
|
-
* node scripts/probe-channels.mjs 测一遍,打印结果
|
|
11
|
-
* node scripts/probe-channels.mjs --json 额外写 probe-result.json
|
|
12
|
-
*
|
|
13
|
-
* 为什么留着它:渠道地址会变(这次就修了 4 个),而这个脚本能在几秒内
|
|
14
|
-
* 告诉你哪一家的入口已经打不开了 —— 比等用户报「某个渠道用不了」早得多。
|
|
15
|
-
*/
|
|
16
|
-
import { writeFileSync } from 'node:fs'
|
|
17
|
-
|
|
18
|
-
/** 各渠道的登录入口,从 vendor/channel-pack/pack.js 与 src/*-browser.ts 里取。 */
|
|
19
|
-
const CHANNELS = [
|
|
20
|
-
// 已确认可用(用户说了免测)
|
|
21
|
-
{ id: 'buddy', name: 'WorkBuddy 国内版', skip: '用户已用过' },
|
|
22
|
-
{ id: 'codearts', name: 'CodeArts', skip: '用户已用过' },
|
|
23
|
-
{ id: 'trae', name: 'TRAE', skip: '用户已用过' },
|
|
24
|
-
|
|
25
|
-
// 待测:浏览器登录
|
|
26
|
-
{ id: 'workbuddy', name: 'WorkBuddy 国际版', url: 'https://www.workbuddy.ai/', login: 'browser' },
|
|
27
|
-
{ id: 'lobsterai', name: 'LobsterAI', url: 'https://lobsterai.youdao.com/', login: 'browser' },
|
|
28
|
-
{ id: 'qoder', name: 'Qoder 国际版', url: 'https://qoder.com/', login: 'browser' },
|
|
29
|
-
{ id: 'qodercn', name: 'Qoder 国内版', url: 'https://qoder.com.cn/', login: 'browser' },
|
|
30
|
-
{ id: 'cline', name: 'Cline', url: 'https://app.cline.bot/', login: 'browser' },
|
|
31
|
-
{ id: 'loomy', name: 'Loomy', url: 'https://loomy.xunfei.cn/', login: 'browser' },
|
|
32
|
-
{ id: 'raccoon', name: 'Raccoon', url: 'https://raccoon-ai.com/', login: 'browser' },
|
|
33
|
-
{ id: 'minimax', name: 'MiniMax Code', url: 'https://agent.minimax.cn/', login: 'browser' },
|
|
34
|
-
{ id: 'zcode', name: 'ZCode', url: 'https://z.ai/', login: 'browser' },
|
|
35
|
-
{ id: 'gemini', name: 'Gemini Code Assist', url: 'https://accounts.google.com/', login: 'browser' },
|
|
36
|
-
{ id: 'doubao', name: '豆包', url: 'https://www.doubao.com/', login: 'browser' },
|
|
37
|
-
|
|
38
|
-
// 待测:粘贴 / Key / OAuth
|
|
39
|
-
{ id: 'autoclaw', name: 'AutoClaw 国际', url: 'https://autoglm.ai/', login: 'paste' },
|
|
40
|
-
{ id: 'autoclaw-cn', name: 'AutoClaw 国内', url: 'https://autoglm.zhipuai.cn/', login: 'paste' },
|
|
41
|
-
{ id: 'baizhi', name: '百智云', url: 'https://baizhi.cloud/console', login: 'apikey' },
|
|
42
|
-
{ id: 'monkeycode', name: 'MonkeyCode', url: 'https://monkeycode-ai.com/', login: 'paste' },
|
|
43
|
-
{ id: 'monkeycode-intl', name: 'MonkeyCode 国际', url: 'https://monkeycode-ai.net/', login: 'paste' },
|
|
44
|
-
{ id: 'accio', name: 'Accio', url: 'https://www.accio-ai.com/', login: 'paste' },
|
|
45
|
-
{ id: 'astudio', name: 'AStudio', url: 'https://agent.xfyun.cn/', login: 'paste' },
|
|
46
|
-
{ id: 'marvis', name: '腾讯 Marvis', url: 'https://yybadaccess.3g.qq.com/', login: 'oauth' },
|
|
47
|
-
]
|
|
48
|
-
|
|
49
|
-
/** 探一个 URL。只发 HEAD,跟随重定向,记录最终落点和状态。 */
|
|
50
|
-
async function probe(url) {
|
|
51
|
-
const started = Date.now()
|
|
52
|
-
try {
|
|
53
|
-
const ctrl = new AbortController()
|
|
54
|
-
const timer = setTimeout(() => ctrl.abort(), 15000)
|
|
55
|
-
const res = await fetch(url, {
|
|
56
|
-
method: 'GET',
|
|
57
|
-
redirect: 'follow',
|
|
58
|
-
signal: ctrl.signal,
|
|
59
|
-
headers: {
|
|
60
|
-
// 有些站对没有 UA 的请求直接 403
|
|
61
|
-
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
|
|
62
|
-
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
63
|
-
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
clearTimeout(timer)
|
|
67
|
-
const text = res.status === 200 ? await res.text() : ''
|
|
68
|
-
return {
|
|
69
|
-
ok: res.ok,
|
|
70
|
-
status: res.status,
|
|
71
|
-
finalUrl: res.url,
|
|
72
|
-
ms: Date.now() - started,
|
|
73
|
-
bytes: text.length,
|
|
74
|
-
// 页面里有没有登录相关的痕迹
|
|
75
|
-
signals: {
|
|
76
|
-
qr: /qrcode|二维码|qr-code|canvas.*qr/i.test(text),
|
|
77
|
-
phone: /手机号|phone|mobile/i.test(text),
|
|
78
|
-
login: /登录|sign\s*in|log\s*in/i.test(text),
|
|
79
|
-
oauth: /oauth|authorize|授权/i.test(text),
|
|
80
|
-
google: /accounts\.google|google.*sign/i.test(text),
|
|
81
|
-
},
|
|
82
|
-
title: (text.match(/<title[^>]*>([^<]{0,80})/i)?.[1] ?? '').trim(),
|
|
83
|
-
}
|
|
84
|
-
} catch (error) {
|
|
85
|
-
return {
|
|
86
|
-
ok: false,
|
|
87
|
-
status: 0,
|
|
88
|
-
error: error instanceof Error ? error.message : String(error),
|
|
89
|
-
ms: Date.now() - started,
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const results = []
|
|
95
|
-
for (const ch of CHANNELS) {
|
|
96
|
-
if (ch.skip) {
|
|
97
|
-
results.push({ ...ch, result: { skipped: true, reason: ch.skip } })
|
|
98
|
-
console.log(`跳过 ${ch.name}(${ch.skip})`)
|
|
99
|
-
continue
|
|
100
|
-
}
|
|
101
|
-
process.stdout.write(`探测 ${ch.name} … `)
|
|
102
|
-
const r = await probe(ch.url)
|
|
103
|
-
results.push({ ...ch, result: r })
|
|
104
|
-
if (r.error) console.log(`失败 ${r.error}`)
|
|
105
|
-
else {
|
|
106
|
-
const sig = r.signals
|
|
107
|
-
? Object.entries(r.signals).filter(([, v]) => v).map(([k]) => k).join(',') || '无'
|
|
108
|
-
: '—'
|
|
109
|
-
console.log(`${r.status} ${r.ms}ms 信号[${sig}]`)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (process.argv.includes('--json') === true) {
|
|
114
|
-
const out = new URL('../probe-result.json', import.meta.url)
|
|
115
|
-
writeFileSync(out, JSON.stringify(results, null, 2), 'utf8')
|
|
116
|
-
console.log('')
|
|
117
|
-
console.log('结果已写入', out.pathname)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
console.log('\n===== 汇总 =====')
|
|
121
|
-
const ok = results.filter(r => r.result.ok)
|
|
122
|
-
const bad = results.filter(r => !r.result.ok && !r.result.skipped)
|
|
123
|
-
const skipped = results.filter(r => r.result.skipped)
|
|
124
|
-
console.log(`可用 ${ok.length} · 失败 ${bad.length} · 跳过 ${skipped.length}`)
|
|
125
|
-
if (bad.length) {
|
|
126
|
-
console.log('\n失败的:')
|
|
127
|
-
for (const r of bad) console.log(` ${r.name} ${r.url} ${r.result.status} ${r.result.error ?? ''}`)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 附:协议层验证结论(2026-11-20)
|
|
132
|
-
*
|
|
133
|
-
* 带假凭据请求真实端点,看服务端返回什么。这比「端点 200」更强:
|
|
134
|
-
* 服务端认出了我们的请求格式,只是拒绝了凭据。
|
|
135
|
-
*
|
|
136
|
-
* Marvis 401 {"code":4100403,"msg":"客户端通用错误:登录态过期/未登录"}
|
|
137
|
-
* 百智云 401 {"type":"error","error":{"type":"invalid_request_error","message":"API Key 无效"}}
|
|
138
|
-
* AutoClaw 200 {"code":400001,"msg":"Request data error"} ← 业务码,HTTP 层 200
|
|
139
|
-
* MonkeyCode 401 Unauthorized
|
|
140
|
-
*
|
|
141
|
-
* 都不是 404(路径错)也不是 5xx(请求体畸形),说明协议实现正确。
|
|
142
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* 渠道实测:验证每个渠道的登录页能不能打开、能不能识别出登录入口。
|
|
3
|
+
*
|
|
4
|
+
* 不是真实扫码登录 —— 那需要人手。这里验的是「插件能不能把浏览器正确打开到正确的地方」:
|
|
5
|
+
* 1. 登录页 URL 是否可达(HTTP 200/3xx)
|
|
6
|
+
* 2. 页面里是否有登录相关的元素(二维码 / 手机号输入 / 授权按钮)
|
|
7
|
+
* 3. 有没有明显的错误页(404 / 域名过期 / 证书问题)
|
|
8
|
+
*
|
|
9
|
+
* 用法:
|
|
10
|
+
* node scripts/probe-channels.mjs 测一遍,打印结果
|
|
11
|
+
* node scripts/probe-channels.mjs --json 额外写 probe-result.json
|
|
12
|
+
*
|
|
13
|
+
* 为什么留着它:渠道地址会变(这次就修了 4 个),而这个脚本能在几秒内
|
|
14
|
+
* 告诉你哪一家的入口已经打不开了 —— 比等用户报「某个渠道用不了」早得多。
|
|
15
|
+
*/
|
|
16
|
+
import { writeFileSync } from 'node:fs'
|
|
17
|
+
|
|
18
|
+
/** 各渠道的登录入口,从 vendor/channel-pack/pack.js 与 src/*-browser.ts 里取。 */
|
|
19
|
+
const CHANNELS = [
|
|
20
|
+
// 已确认可用(用户说了免测)
|
|
21
|
+
{ id: 'buddy', name: 'WorkBuddy 国内版', skip: '用户已用过' },
|
|
22
|
+
{ id: 'codearts', name: 'CodeArts', skip: '用户已用过' },
|
|
23
|
+
{ id: 'trae', name: 'TRAE', skip: '用户已用过' },
|
|
24
|
+
|
|
25
|
+
// 待测:浏览器登录
|
|
26
|
+
{ id: 'workbuddy', name: 'WorkBuddy 国际版', url: 'https://www.workbuddy.ai/', login: 'browser' },
|
|
27
|
+
{ id: 'lobsterai', name: 'LobsterAI', url: 'https://lobsterai.youdao.com/', login: 'browser' },
|
|
28
|
+
{ id: 'qoder', name: 'Qoder 国际版', url: 'https://qoder.com/', login: 'browser' },
|
|
29
|
+
{ id: 'qodercn', name: 'Qoder 国内版', url: 'https://qoder.com.cn/', login: 'browser' },
|
|
30
|
+
{ id: 'cline', name: 'Cline', url: 'https://app.cline.bot/', login: 'browser' },
|
|
31
|
+
{ id: 'loomy', name: 'Loomy', url: 'https://loomy.xunfei.cn/', login: 'browser' },
|
|
32
|
+
{ id: 'raccoon', name: 'Raccoon', url: 'https://raccoon-ai.com/', login: 'browser' },
|
|
33
|
+
{ id: 'minimax', name: 'MiniMax Code', url: 'https://agent.minimax.cn/', login: 'browser' },
|
|
34
|
+
{ id: 'zcode', name: 'ZCode', url: 'https://z.ai/', login: 'browser' },
|
|
35
|
+
{ id: 'gemini', name: 'Gemini Code Assist', url: 'https://accounts.google.com/', login: 'browser' },
|
|
36
|
+
{ id: 'doubao', name: '豆包', url: 'https://www.doubao.com/', login: 'browser' },
|
|
37
|
+
|
|
38
|
+
// 待测:粘贴 / Key / OAuth
|
|
39
|
+
{ id: 'autoclaw', name: 'AutoClaw 国际', url: 'https://autoglm.ai/', login: 'paste' },
|
|
40
|
+
{ id: 'autoclaw-cn', name: 'AutoClaw 国内', url: 'https://autoglm.zhipuai.cn/', login: 'paste' },
|
|
41
|
+
{ id: 'baizhi', name: '百智云', url: 'https://baizhi.cloud/console', login: 'apikey' },
|
|
42
|
+
{ id: 'monkeycode', name: 'MonkeyCode', url: 'https://monkeycode-ai.com/', login: 'paste' },
|
|
43
|
+
{ id: 'monkeycode-intl', name: 'MonkeyCode 国际', url: 'https://monkeycode-ai.net/', login: 'paste' },
|
|
44
|
+
{ id: 'accio', name: 'Accio', url: 'https://www.accio-ai.com/', login: 'paste' },
|
|
45
|
+
{ id: 'astudio', name: 'AStudio', url: 'https://agent.xfyun.cn/', login: 'paste' },
|
|
46
|
+
{ id: 'marvis', name: '腾讯 Marvis', url: 'https://yybadaccess.3g.qq.com/', login: 'oauth' },
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
/** 探一个 URL。只发 HEAD,跟随重定向,记录最终落点和状态。 */
|
|
50
|
+
async function probe(url) {
|
|
51
|
+
const started = Date.now()
|
|
52
|
+
try {
|
|
53
|
+
const ctrl = new AbortController()
|
|
54
|
+
const timer = setTimeout(() => ctrl.abort(), 15000)
|
|
55
|
+
const res = await fetch(url, {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
redirect: 'follow',
|
|
58
|
+
signal: ctrl.signal,
|
|
59
|
+
headers: {
|
|
60
|
+
// 有些站对没有 UA 的请求直接 403
|
|
61
|
+
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
|
|
62
|
+
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
63
|
+
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
clearTimeout(timer)
|
|
67
|
+
const text = res.status === 200 ? await res.text() : ''
|
|
68
|
+
return {
|
|
69
|
+
ok: res.ok,
|
|
70
|
+
status: res.status,
|
|
71
|
+
finalUrl: res.url,
|
|
72
|
+
ms: Date.now() - started,
|
|
73
|
+
bytes: text.length,
|
|
74
|
+
// 页面里有没有登录相关的痕迹
|
|
75
|
+
signals: {
|
|
76
|
+
qr: /qrcode|二维码|qr-code|canvas.*qr/i.test(text),
|
|
77
|
+
phone: /手机号|phone|mobile/i.test(text),
|
|
78
|
+
login: /登录|sign\s*in|log\s*in/i.test(text),
|
|
79
|
+
oauth: /oauth|authorize|授权/i.test(text),
|
|
80
|
+
google: /accounts\.google|google.*sign/i.test(text),
|
|
81
|
+
},
|
|
82
|
+
title: (text.match(/<title[^>]*>([^<]{0,80})/i)?.[1] ?? '').trim(),
|
|
83
|
+
}
|
|
84
|
+
} catch (error) {
|
|
85
|
+
return {
|
|
86
|
+
ok: false,
|
|
87
|
+
status: 0,
|
|
88
|
+
error: error instanceof Error ? error.message : String(error),
|
|
89
|
+
ms: Date.now() - started,
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const results = []
|
|
95
|
+
for (const ch of CHANNELS) {
|
|
96
|
+
if (ch.skip) {
|
|
97
|
+
results.push({ ...ch, result: { skipped: true, reason: ch.skip } })
|
|
98
|
+
console.log(`跳过 ${ch.name}(${ch.skip})`)
|
|
99
|
+
continue
|
|
100
|
+
}
|
|
101
|
+
process.stdout.write(`探测 ${ch.name} … `)
|
|
102
|
+
const r = await probe(ch.url)
|
|
103
|
+
results.push({ ...ch, result: r })
|
|
104
|
+
if (r.error) console.log(`失败 ${r.error}`)
|
|
105
|
+
else {
|
|
106
|
+
const sig = r.signals
|
|
107
|
+
? Object.entries(r.signals).filter(([, v]) => v).map(([k]) => k).join(',') || '无'
|
|
108
|
+
: '—'
|
|
109
|
+
console.log(`${r.status} ${r.ms}ms 信号[${sig}]`)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (process.argv.includes('--json') === true) {
|
|
114
|
+
const out = new URL('../probe-result.json', import.meta.url)
|
|
115
|
+
writeFileSync(out, JSON.stringify(results, null, 2), 'utf8')
|
|
116
|
+
console.log('')
|
|
117
|
+
console.log('结果已写入', out.pathname)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
console.log('\n===== 汇总 =====')
|
|
121
|
+
const ok = results.filter(r => r.result.ok)
|
|
122
|
+
const bad = results.filter(r => !r.result.ok && !r.result.skipped)
|
|
123
|
+
const skipped = results.filter(r => r.result.skipped)
|
|
124
|
+
console.log(`可用 ${ok.length} · 失败 ${bad.length} · 跳过 ${skipped.length}`)
|
|
125
|
+
if (bad.length) {
|
|
126
|
+
console.log('\n失败的:')
|
|
127
|
+
for (const r of bad) console.log(` ${r.name} ${r.url} ${r.result.status} ${r.result.error ?? ''}`)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 附:协议层验证结论(2026-11-20)
|
|
132
|
+
*
|
|
133
|
+
* 带假凭据请求真实端点,看服务端返回什么。这比「端点 200」更强:
|
|
134
|
+
* 服务端认出了我们的请求格式,只是拒绝了凭据。
|
|
135
|
+
*
|
|
136
|
+
* Marvis 401 {"code":4100403,"msg":"客户端通用错误:登录态过期/未登录"}
|
|
137
|
+
* 百智云 401 {"type":"error","error":{"type":"invalid_request_error","message":"API Key 无效"}}
|
|
138
|
+
* AutoClaw 200 {"code":400001,"msg":"Request data error"} ← 业务码,HTTP 层 200
|
|
139
|
+
* MonkeyCode 401 Unauthorized
|
|
140
|
+
*
|
|
141
|
+
* 都不是 404(路径错)也不是 5xx(请求体畸形),说明协议实现正确。
|
|
142
|
+
*/
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Jet
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jet
|
|
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.
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# vendor/channel-pack — 上游免费渠道包的来源与再构建
|
|
2
|
-
|
|
3
|
-
本目录是 **[dsh-codearts-auth](https://gitee.com/iJetLi/deepseek-harness-codearts)**
|
|
4
|
-
的完整拷贝,由 `dsh-our-free-model` 的 Host 半身在独立 fiber 上挂载,
|
|
5
|
-
使 CodeArts、CodeBuddy、WorkBuddy、LobsterAI、Qoder、Qoder 中国版、TRAE、
|
|
6
|
-
Cline、Loomy、Raccoon、MiniMax Code、ZCode、Gemini 这十三个账号渠道的
|
|
7
|
-
登录流程、账号池、积分领取、模型黑名单与本地 OpenAI 网关可用。OFM 挂载时关闭上游 OpenCode 账号接入,原有匿名免费车道保持独立。
|
|
8
|
-
目录名与内部标识符在本插件的再构建中统一改为 channel-pack;出处与许可证不变。
|
|
9
|
-
|
|
10
|
-
- 上游仓库:`https://gitee.com/iJetLi/deepseek-harness-codearts`
|
|
11
|
-
- 吸收的提交:`345f0a07b22713c0ae189ca7d8b97ec4f64626c6`(2026-10-06)
|
|
12
|
-
- 许可证:MIT(见 `LICENSE`,与上游一致)
|
|
13
|
-
|
|
14
|
-
## 目录内容
|
|
15
|
-
|
|
16
|
-
| 路径 | 说明 |
|
|
17
|
-
| --- | --- |
|
|
18
|
-
| `src/` | 上游 TypeScript 源码,包含下述 OFM 本地适配(便于审计与再构建) |
|
|
19
|
-
| `pack.js` | **插件运行时实际加载的代码**:直接由 `src/` 经 `scripts/build-channel-pack.mjs` 打包成单文件(jose/undici 内联,`@deepseek-ai/*` 保持外部),使发布清单不超文件上限 |
|
|
20
|
-
| `qoder-auth-wasm.wasm` | Qoder 加密推理所需的 WASM,必须与 `pack.js` 同目录(`pack.js` 按 `import.meta.url` 定位它) |
|
|
21
|
-
| `locale/` | 上游文案 |
|
|
22
|
-
| `scripts/`、`tsconfig.json`、`package.json` | 再构建所需的元数据(`lib/` 与 `node_modules/` 不入库,按下面步骤重建) |
|
|
23
|
-
|
|
24
|
-
宿主提供的依赖(`@deepseek-ai/dsh-llm`、`@deepseek-ai/dsh-credentials`、
|
|
25
|
-
`@deepseek-ai/cordis`、`@deepseek-ai/schemastery`)不在此目录,按 Node 解析规则
|
|
26
|
-
从安装它的 profile 的 `node_modules` 取;缺少时渠道包整体降级(`/summary.channels`
|
|
27
|
-
报告 `state: "failed"` 与原因),免费车道不受影响。
|
|
28
|
-
|
|
29
|
-
## 再构建
|
|
30
|
-
|
|
31
|
-
直接从受版本管理的 `src/` 打包,不使用未入库的 `lib/`:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# 在仓库外准备构建依赖,保持插件零运行依赖
|
|
35
|
-
npm install --prefix /tmp/ofm-channel-build --no-package-lock --ignore-scripts esbuild@0.24.2 jose@6.2.9 undici@8.11.2
|
|
36
|
-
mkdir -p vendor/channel-pack/node_modules
|
|
37
|
-
cp -R /tmp/ofm-channel-build/node_modules/jose /tmp/ofm-channel-build/node_modules/undici vendor/channel-pack/node_modules/
|
|
38
|
-
OFM_ESBUILD_DIR=/tmp/ofm-channel-build npm run channel-pack
|
|
39
|
-
# qoder-auth-wasm.wasm 沿用上游已有文件,须与 pack.js 同目录
|
|
40
|
-
# 清理本次创建的构建依赖;这些目录不入库、不随插件发布
|
|
41
|
-
rm -rf vendor/channel-pack/node_modules
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## OFM 本地适配
|
|
45
|
-
|
|
46
|
-
- `src/index.ts`:增加可选 `disableOpencode` 挂载配置;OFM 开启它时跳过重复 OpenCode adapter、默认匿名账号和能力表预热,保留历史账号及凭据。省略时维持上游行为。
|
|
47
|
-
- `src/channel-pack-rpc.ts`:追加同一配置,关闭时拒绝 `opencode.*` 与通用 `account.create(provider=opencode)`。
|
|
48
|
-
- 打包入口改为 `src/index.ts`;宿主模块仍保持外部,jose/undici 内联。
|
|
49
|
-
- 构建依赖固定为 esbuild 0.24.2、jose 6.2.9、undici 8.11.2;本次重构建核对了原包的依赖代码,未借此升级运行依赖。
|
|
50
|
-
|
|
51
|
-
本目录**不含**上游的浏览器半身(`plugin-src/client`)与其设置页——
|
|
52
|
-
界面由 `dsh-our-free-model` 自己的三页界面取代,渠道操作经上游的
|
|
53
|
-
`/api/channel-pack` RPC 完成(`connection.rpc.call('/api', 'channel-pack', { method, payload })`)。
|
|
1
|
+
# vendor/channel-pack — 上游免费渠道包的来源与再构建
|
|
2
|
+
|
|
3
|
+
本目录是 **[dsh-codearts-auth](https://gitee.com/iJetLi/deepseek-harness-codearts)**
|
|
4
|
+
的完整拷贝,由 `dsh-our-free-model` 的 Host 半身在独立 fiber 上挂载,
|
|
5
|
+
使 CodeArts、CodeBuddy、WorkBuddy、LobsterAI、Qoder、Qoder 中国版、TRAE、
|
|
6
|
+
Cline、Loomy、Raccoon、MiniMax Code、ZCode、Gemini 这十三个账号渠道的
|
|
7
|
+
登录流程、账号池、积分领取、模型黑名单与本地 OpenAI 网关可用。OFM 挂载时关闭上游 OpenCode 账号接入,原有匿名免费车道保持独立。
|
|
8
|
+
目录名与内部标识符在本插件的再构建中统一改为 channel-pack;出处与许可证不变。
|
|
9
|
+
|
|
10
|
+
- 上游仓库:`https://gitee.com/iJetLi/deepseek-harness-codearts`
|
|
11
|
+
- 吸收的提交:`345f0a07b22713c0ae189ca7d8b97ec4f64626c6`(2026-10-06)
|
|
12
|
+
- 许可证:MIT(见 `LICENSE`,与上游一致)
|
|
13
|
+
|
|
14
|
+
## 目录内容
|
|
15
|
+
|
|
16
|
+
| 路径 | 说明 |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `src/` | 上游 TypeScript 源码,包含下述 OFM 本地适配(便于审计与再构建) |
|
|
19
|
+
| `pack.js` | **插件运行时实际加载的代码**:直接由 `src/` 经 `scripts/build-channel-pack.mjs` 打包成单文件(jose/undici 内联,`@deepseek-ai/*` 保持外部),使发布清单不超文件上限 |
|
|
20
|
+
| `qoder-auth-wasm.wasm` | Qoder 加密推理所需的 WASM,必须与 `pack.js` 同目录(`pack.js` 按 `import.meta.url` 定位它) |
|
|
21
|
+
| `locale/` | 上游文案 |
|
|
22
|
+
| `scripts/`、`tsconfig.json`、`package.json` | 再构建所需的元数据(`lib/` 与 `node_modules/` 不入库,按下面步骤重建) |
|
|
23
|
+
|
|
24
|
+
宿主提供的依赖(`@deepseek-ai/dsh-llm`、`@deepseek-ai/dsh-credentials`、
|
|
25
|
+
`@deepseek-ai/cordis`、`@deepseek-ai/schemastery`)不在此目录,按 Node 解析规则
|
|
26
|
+
从安装它的 profile 的 `node_modules` 取;缺少时渠道包整体降级(`/summary.channels`
|
|
27
|
+
报告 `state: "failed"` 与原因),免费车道不受影响。
|
|
28
|
+
|
|
29
|
+
## 再构建
|
|
30
|
+
|
|
31
|
+
直接从受版本管理的 `src/` 打包,不使用未入库的 `lib/`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 在仓库外准备构建依赖,保持插件零运行依赖
|
|
35
|
+
npm install --prefix /tmp/ofm-channel-build --no-package-lock --ignore-scripts esbuild@0.24.2 jose@6.2.9 undici@8.11.2
|
|
36
|
+
mkdir -p vendor/channel-pack/node_modules
|
|
37
|
+
cp -R /tmp/ofm-channel-build/node_modules/jose /tmp/ofm-channel-build/node_modules/undici vendor/channel-pack/node_modules/
|
|
38
|
+
OFM_ESBUILD_DIR=/tmp/ofm-channel-build npm run channel-pack
|
|
39
|
+
# qoder-auth-wasm.wasm 沿用上游已有文件,须与 pack.js 同目录
|
|
40
|
+
# 清理本次创建的构建依赖;这些目录不入库、不随插件发布
|
|
41
|
+
rm -rf vendor/channel-pack/node_modules
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## OFM 本地适配
|
|
45
|
+
|
|
46
|
+
- `src/index.ts`:增加可选 `disableOpencode` 挂载配置;OFM 开启它时跳过重复 OpenCode adapter、默认匿名账号和能力表预热,保留历史账号及凭据。省略时维持上游行为。
|
|
47
|
+
- `src/channel-pack-rpc.ts`:追加同一配置,关闭时拒绝 `opencode.*` 与通用 `account.create(provider=opencode)`。
|
|
48
|
+
- 打包入口改为 `src/index.ts`;宿主模块仍保持外部,jose/undici 内联。
|
|
49
|
+
- 构建依赖固定为 esbuild 0.24.2、jose 6.2.9、undici 8.11.2;本次重构建核对了原包的依赖代码,未借此升级运行依赖。
|
|
50
|
+
|
|
51
|
+
本目录**不含**上游的浏览器半身(`plugin-src/client`)与其设置页——
|
|
52
|
+
界面由 `dsh-our-free-model` 自己的三页界面取代,渠道操作经上游的
|
|
53
|
+
`/api/channel-pack` RPC 完成(`connection.rpc.call('/api', 'channel-pack', { method, payload })`)。
|