@iasiv5/dsh-skip-browser-auth 0.4.1 → 0.4.2
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 +8 -4
- package/cordis.patch.yml +10 -8
- package/lib/compatibility.js +9 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
个人自用的 DSH Web 插件:在已验证的 DSH compatibility profile 上自动跳过 BrowserAuth,打开 Web 地址即可直接使用,**不必每次把启动 URL 里那串随机 token 抄进浏览器**。
|
|
8
8
|
|
|
9
|
-
- **精确 profile 门控**:当前支持 `0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1` 与 `0.2.1-rc.
|
|
9
|
+
- **精确 profile 门控**:当前支持 `0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2` 与 `0.2.1-rc.3`,按 host/client 兼容代际分组;不是把所有版本塞进同一个实现。
|
|
10
10
|
- **严格成对匹配**:runtime `@deepseek-ai/dsh` 与 `@deepseek-ai/dsh-client-connection` 必须组成已知版本对。混合版本、未知版本、profile 未实现或解析失败都会自动休眠。
|
|
11
|
-
- **分代适配**:`0.1.2-rc.1` 使用 `legacy-web-v1`;`0.1.5-rc.1` 与 `0.1.5-rc.2` 使用 `carrier-neutral-v2`,包含 request body mode、RPC carrier 和对应浏览器 client variant 适配;`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1` 与 `0.2.0-rc.2` 使用 `carrier-neutral-v3`,覆盖 0.1.7 引入、0.2.0 沿用的 `admit()`/OperatorPeer 准入、`connection/request` waterfall 与 mount-preserving BrowserAuth;`0.2.1-rc.1` 与 `0.2.1-rc.
|
|
11
|
+
- **分代适配**:`0.1.2-rc.1` 使用 `legacy-web-v1`;`0.1.5-rc.1` 与 `0.1.5-rc.2` 使用 `carrier-neutral-v2`,包含 request body mode、RPC carrier 和对应浏览器 client variant 适配;`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1` 与 `0.2.0-rc.2` 使用 `carrier-neutral-v3`,覆盖 0.1.7 引入、0.2.0 沿用的 `admit()`/OperatorPeer 准入、`connection/request` waterfall 与 mount-preserving BrowserAuth;`0.2.1-rc.1`、`0.2.1-rc.2` 与 `0.2.1-rc.3` 使用 `carrier-neutral-v4`,覆盖 0.2.1 的 Peer/principal 准入重构、`admission.peer` 透传 bridge、新 `/connect` 交换通道与 `webStartup` 信任来源(0.2.1 是真实契约变化,独立代际;rc.2/rc.3 为契约面等价重发布,见 docs/COMPATIBILITY.md §5.8/§5.9/§5.10/§5.11)。
|
|
12
12
|
- **不修改 DSH 本体与任何机制**:仅通过 DSH 官方插件 patch 机制替换 Connection 行;卸载或禁用插件并重启,即完全恢复官方行为。
|
|
13
13
|
- **安全提醒**:跳过认证后,Web 对本机/可信网络内的访问不再有身份层,请勿把 DSH 端口暴露给不可信网络。
|
|
14
14
|
|
|
@@ -37,7 +37,7 @@ sudo systemctl restart deepseek-harness.service # 按你的部署方式重启
|
|
|
37
37
|
- DSH 0.1.2-rc.1:legacy-web-v1
|
|
38
38
|
- DSH 0.1.5-rc.1 / 0.1.5-rc.2:carrier-neutral-v2
|
|
39
39
|
- DSH 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2:carrier-neutral-v3
|
|
40
|
-
- DSH 0.2.1-rc.1 / 0.2.1-rc.2:carrier-neutral-v4
|
|
40
|
+
- DSH 0.2.1-rc.1 / 0.2.1-rc.2 / 0.2.1-rc.3:carrier-neutral-v4
|
|
41
41
|
其它版本或 runtime/connection 混合版本会自动休眠,不要强行处理。
|
|
42
42
|
desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 argv/宿主二进制,0.3.9 起生效),这是设计行为,不要强行处理或改代码绕过;desktop 用户请直接使用 0.3.11+(0.3.6-0.3.10 在 desktop 有已知缺陷,见 docs/COMPATIBILITY.md §7.4)。
|
|
43
43
|
|
|
@@ -46,7 +46,7 @@ desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 a
|
|
|
46
46
|
2. 重启 DSH Web 并轮询 http://127.0.0.1:3080 直到恢复 200
|
|
47
47
|
(systemd 系统级部署:sudo systemctl restart deepseek-harness.service;
|
|
48
48
|
user 级部署:systemctl --user restart dsh-web.service;端口以实际部署为准)。
|
|
49
|
-
3. 若版本是 0.1.2-rc.1、0.1.5-rc.1、0.1.5-rc.2、0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1、0.2.0-rc.2、0.2.1-rc.1 或 0.2.1-rc.
|
|
49
|
+
3. 若版本是 0.1.2-rc.1、0.1.5-rc.1、0.1.5-rc.2、0.1.7-rc.1、0.1.7-rc.2、0.2.0-rc.1、0.2.0-rc.2、0.2.1-rc.1、0.2.1-rc.2 或 0.2.1-rc.3:
|
|
50
50
|
确认 journal/日志中出现固定警告
|
|
51
51
|
"BrowserAuth has been skipped",并验证浏览器直接打开 Web 地址不再要求 token。
|
|
52
52
|
4. 若版本不是精确白名单版本,或 profile/依赖契约不匹配:插件应自动休眠,
|
|
@@ -75,6 +75,7 @@ sudo systemctl restart deepseek-harness.service
|
|
|
75
75
|
| `0.2.0-rc.2` + `0.2.0-rc.2` | `carrier-neutral-v3` | 同上(0.2.0-rc.2 为依赖对齐重发布 + 无关 Desktop CLI 演进:插件契约面代码逐字节一致) | ✅ active(npm diff 审计 + 真实 0.2.0-rc.2 npm fixture 组合测试,见 docs/COMPATIBILITY.md §5.7;实机 checklist 见当日升级记录) |
|
|
76
76
|
| `0.2.1-rc.1` + `0.2.1-rc.1` | `carrier-neutral-v4` | carrier-neutral-021:Peer/principal 准入 + `admission.peer` 透传 bridge + `/connect` 交换通道 + webStartup 信任来源 + 0.2.1 browser client | ✅ active(§5.8 契约审计定谳新代际 + 真实 0.2.1-rc.1 npm fixture 组合测试,见 docs/COMPATIBILITY.md §5.9;实机 checklist 待宿主升级后回填) |
|
|
77
77
|
| `0.2.1-rc.2` + `0.2.1-rc.2` | `carrier-neutral-v4` | 同上(0.2.1-rc.2 为契约面等价重发布:web-app patch 仅新增非 connection 行,connection 行逐字段一致) | ✅ active(npm diff 审计 + 真实 0.2.1-rc.2 npm fixture 组合测试,见 docs/COMPATIBILITY.md §5.10;实机 checklist 待宿主升级后回填) |
|
|
78
|
+
| `0.2.1-rc.3` + `0.2.1-rc.3` | `carrier-neutral-v4` | 同上(0.2.1-rc.3 为契约面等价重发布:web-app patch 仅新增非 connection 行,connection 行逐字段一致) | ✅ active(npm diff 审计 + 真实 0.2.1-rc.3 npm fixture 组合测试,见 docs/COMPATIBILITY.md §5.11;实机 checklist 待宿主升级后回填) |
|
|
78
79
|
| desktop profile(存在 dsh-desktop-host 的环境,任意版本对) | — | 😴 dormant-by-design:desktop 一律休眠 | dormant |
|
|
79
80
|
| 其它版本或混合版本对 | — | 😴 自动休眠:官方行为分毫不变 | dormant |
|
|
80
81
|
|
|
@@ -101,6 +102,9 @@ runtime=0.2.1-rc.1 + connection=0.2.1-rc.1 → carrier-neutral-v4
|
|
|
101
102
|
runtime=0.2.1-rc.1 + connection=0.2.1-rc.2 → dormant(同代际跨 patch 混合同样是事故形态)
|
|
102
103
|
runtime=0.2.1-rc.2 + connection=0.2.1-rc.1 → dormant
|
|
103
104
|
runtime=0.2.1-rc.2 + connection=0.2.1-rc.2 → carrier-neutral-v4
|
|
105
|
+
runtime=0.2.1-rc.2 + connection=0.2.1-rc.3 → dormant(同代际跨 patch 混合同样是事故形态)
|
|
106
|
+
runtime=0.2.1-rc.3 + connection=0.2.1-rc.2 → dormant
|
|
107
|
+
runtime=0.2.1-rc.3 + connection=0.2.1-rc.3 → carrier-neutral-v4
|
|
104
108
|
runtime=0.1.7-rc.2 + connection=0.1.5-rc.2 → dormant(跨代际混合)
|
|
105
109
|
```
|
|
106
110
|
|
package/cordis.patch.yml
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
arg.indexOf("dsh-desktop-host") !== -1); } catch (sigError2) { } let webByBinary = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && typeof hostProcess.execPath === 'string') { const execBase = hostProcess.execPath.slice(Math.max(hostProcess.execPath.lastIndexOf('/'), hostProcess.execPath.lastIndexOf('\\')) + 1).toLowerCase(); webByBinary = execBase === 'node' || execBase === 'node.exe' || execBase === 'nodejs' || execBase === 'nodejs.exe'; } } catch (sigError3) { } let desktopByPackage = false; try { const desktopResolved = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier: desktopSpecifier, attributes: {} }) : internal.resolveSync(desktopSpecifier, ctx.baseUrl, {}); const desktopUrl = desktopResolved === null || typeof desktopResolved !== 'object' ? undefined : desktopResolved.url; desktopByPackage = typeof desktopUrl === 'string'; } catch (sigError4) { } hostProfile = desktopByArgv || desktopBySlot || desktopByPackage ||
|
|
21
21
|
!webByBinary ? 'desktop' : 'web'; const versionOfUrl = (url, patternSource) => { if (typeof url !== 'string') return null; const decoded = decodeURIComponent(url); const segmented = decoded.match(new RegExp(patternSource)); if (segmented !== null) return segmented[1]; if (decoded.slice(0, 5) === 'file:') { const processRef = globalThis.process; if (processRef === null || typeof processRef !== 'object' || typeof processRef.getBuiltinModule !== 'function') return null; const fsModule = processRef.getBuiltinModule('node:fs'); const urlModule = processRef.getBuiltinModule('node:url'); if (!fsModule || typeof fsModule.readFileSync !== 'function' || !urlModule || typeof urlModule.fileURLToPath !== 'function') return null; const manifest = JSON.parse(fsModule.readFileSync(urlModule.fileURLToPath(url), 'utf8')); return manifest !== null && typeof manifest === 'object' && typeof manifest.version === 'string' ? manifest.version : null; } return null; }; const anchors =
|
|
22
22
|
[["@deepseek-ai/dsh","[+]dsh@([^/_]+)[_/]"],["@deepseek-ai/dsh-client-connection","[+]dsh-client-connection@([^/_]+)[_/]"]]; const versions = []; for (const [anchorPackage, patternSource] of anchors) { const specifier = anchorPackage + '/package.json'; let url; try { url = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier, attributes: {} }).url : internal.resolveSync(specifier, ctx.baseUrl, {}).url; } catch (gateError) { return null; } let anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles =
|
|
23
|
-
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return
|
|
24
|
-
["legacy-web-v1","carrier-neutral-v2","carrier-neutral-v3","carrier-neutral-v4"].includes(profile); } catch (gateError) { return false; } })()
|
|
23
|
+
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return
|
|
24
|
+
null; } })()); return profile !== null && ["legacy-web-v1","carrier-neutral-v2","carrier-neutral-v3","carrier-neutral-v4"].includes(profile); } catch (gateError) { return false; } })()
|
|
25
25
|
- insert:
|
|
26
26
|
- id: trusted-connection
|
|
27
27
|
name: '@iasiv5/dsh-skip-browser-auth'
|
|
@@ -34,14 +34,15 @@
|
|
|
34
34
|
(sigError2) { } let webByBinary = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && typeof hostProcess.execPath === 'string') { const execBase = hostProcess.execPath.slice(Math.max(hostProcess.execPath.lastIndexOf('/'), hostProcess.execPath.lastIndexOf('\\')) + 1).toLowerCase(); webByBinary = execBase === 'node' || execBase === 'node.exe' || execBase === 'nodejs' || execBase === 'nodejs.exe'; } } catch (sigError3) { } let desktopByPackage = false; try { const desktopResolved = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier: desktopSpecifier, attributes: {} }) : internal.resolveSync(desktopSpecifier, ctx.baseUrl, {}); const desktopUrl = desktopResolved === null || typeof desktopResolved !== 'object' ? undefined : desktopResolved.url; desktopByPackage = typeof desktopUrl === 'string'; } catch (sigError4) { } hostProfile = desktopByArgv || desktopBySlot || desktopByPackage || !webByBinary ? 'desktop' : 'web'; const
|
|
35
35
|
versionOfUrl = (url, patternSource) => { if (typeof url !== 'string') return null; const decoded = decodeURIComponent(url); const segmented = decoded.match(new RegExp(patternSource)); if (segmented !== null) return segmented[1]; if (decoded.slice(0, 5) === 'file:') { const processRef = globalThis.process; if (processRef === null || typeof processRef !== 'object' || typeof processRef.getBuiltinModule !== 'function') return null; const fsModule = processRef.getBuiltinModule('node:fs'); const urlModule = processRef.getBuiltinModule('node:url'); if (!fsModule || typeof fsModule.readFileSync !== 'function' || !urlModule || typeof urlModule.fileURLToPath !== 'function') return null; const manifest = JSON.parse(fsModule.readFileSync(urlModule.fileURLToPath(url), 'utf8')); return manifest !== null && typeof manifest === 'object' && typeof manifest.version === 'string' ? manifest.version : null; } return null; }; const anchors =
|
|
36
36
|
[["@deepseek-ai/dsh","[+]dsh@([^/_]+)[_/]"],["@deepseek-ai/dsh-client-connection","[+]dsh-client-connection@([^/_]+)[_/]"]]; const versions = []; for (const [anchorPackage, patternSource] of anchors) { const specifier = anchorPackage + '/package.json'; let url; try { url = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier, attributes: {} }).url : internal.resolveSync(specifier, ctx.baseUrl, {}).url; } catch (gateError) { return null; } let anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles =
|
|
37
|
-
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
37
|
+
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
38
|
+
return null; } })()
|
|
38
39
|
disabled: !!js >-
|
|
39
40
|
!((() => { try { const self = ctx[Symbol.for('cordis.entry')]; if (!self || !self.parent || !self.parent.tree) return false; const official = self.parent.tree.resolve('connection'); if (!official || official.parent !== self.parent) return false; if (official.options.id !== 'connection' || official.options.name !== '@deepseek-ai/dsh-client-connection') return false; const profile = ((() => { try { const internal = ctx.loader && ctx.loader.internal; if (!internal || typeof internal.resolveSync !== 'function') return null; const desktopSpecifier = "@deepseek-ai/dsh-desktop-host" + '/package.json'; let hostProfile = 'web'; let hostProcess = null; try { if (typeof process === 'object' && process !== null) hostProcess = process; } catch (sigError0) { } let slot = ''; let desktopBySlot = false; try { const decodedBase = decodeURIComponent(typeof ctx.baseUrl === 'string' ? ctx.baseUrl : ''); const trimmedBase = decodedBase.endsWith('/') ? decodedBase.slice(0, -1) : decodedBase; slot =
|
|
40
41
|
trimmedBase.slice(trimmedBase.lastIndexOf('/') + 1).toLowerCase(); desktopBySlot = slot === "desktop"; } catch (sigError1) { } let desktopByArgv = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && Array.isArray(hostProcess.argv)) desktopByArgv = hostProcess.argv.some((arg) => typeof arg === 'string' && arg.indexOf("dsh-desktop-host") !== -1); } catch (sigError2) { } let webByBinary = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && typeof hostProcess.execPath === 'string') { const execBase = hostProcess.execPath.slice(Math.max(hostProcess.execPath.lastIndexOf('/'), hostProcess.execPath.lastIndexOf('\\')) + 1).toLowerCase(); webByBinary = execBase === 'node' || execBase === 'node.exe' || execBase === 'nodejs' || execBase === 'nodejs.exe'; } } catch (sigError3) { } let desktopByPackage = false; try { const desktopResolved = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier: desktopSpecifier, attributes:
|
|
41
42
|
{} }) : internal.resolveSync(desktopSpecifier, ctx.baseUrl, {}); const desktopUrl = desktopResolved === null || typeof desktopResolved !== 'object' ? undefined : desktopResolved.url; desktopByPackage = typeof desktopUrl === 'string'; } catch (sigError4) { } hostProfile = desktopByArgv || desktopBySlot || desktopByPackage || !webByBinary ? 'desktop' : 'web'; const versionOfUrl = (url, patternSource) => { if (typeof url !== 'string') return null; const decoded = decodeURIComponent(url); const segmented = decoded.match(new RegExp(patternSource)); if (segmented !== null) return segmented[1]; if (decoded.slice(0, 5) === 'file:') { const processRef = globalThis.process; if (processRef === null || typeof processRef !== 'object' || typeof processRef.getBuiltinModule !== 'function') return null; const fsModule = processRef.getBuiltinModule('node:fs'); const urlModule = processRef.getBuiltinModule('node:url'); if (!fsModule || typeof fsModule.readFileSync !== 'function' || !urlModule ||
|
|
42
43
|
typeof urlModule.fileURLToPath !== 'function') return null; const manifest = JSON.parse(fsModule.readFileSync(urlModule.fileURLToPath(url), 'utf8')); return manifest !== null && typeof manifest === 'object' && typeof manifest.version === 'string' ? manifest.version : null; } return null; }; const anchors = [["@deepseek-ai/dsh","[+]dsh@([^/_]+)[_/]"],["@deepseek-ai/dsh-client-connection","[+]dsh-client-connection@([^/_]+)[_/]"]]; const versions = []; for (const [anchorPackage, patternSource] of anchors) { const specifier = anchorPackage + '/package.json'; let url; try { url = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier, attributes: {} }).url : internal.resolveSync(specifier, ctx.baseUrl, {}).url; } catch (gateError) { return null; } let anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles =
|
|
43
|
-
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
44
|
-
!["legacy-web-v1","carrier-neutral-v2","carrier-neutral-v3"].includes(profile)) return false; return official.disabled === true; } catch (gateError) { return false; } })())
|
|
44
|
+
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
45
|
+
return null; } })()); if (profile === null || !["legacy-web-v1","carrier-neutral-v2","carrier-neutral-v3"].includes(profile)) return false; return official.disabled === true; } catch (gateError) { return false; } })())
|
|
45
46
|
- id: trusted-connection-021
|
|
46
47
|
name: '@iasiv5/dsh-skip-browser-auth'
|
|
47
48
|
inject:
|
|
@@ -53,11 +54,12 @@
|
|
|
53
54
|
(sigError2) { } let webByBinary = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && typeof hostProcess.execPath === 'string') { const execBase = hostProcess.execPath.slice(Math.max(hostProcess.execPath.lastIndexOf('/'), hostProcess.execPath.lastIndexOf('\\')) + 1).toLowerCase(); webByBinary = execBase === 'node' || execBase === 'node.exe' || execBase === 'nodejs' || execBase === 'nodejs.exe'; } } catch (sigError3) { } let desktopByPackage = false; try { const desktopResolved = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier: desktopSpecifier, attributes: {} }) : internal.resolveSync(desktopSpecifier, ctx.baseUrl, {}); const desktopUrl = desktopResolved === null || typeof desktopResolved !== 'object' ? undefined : desktopResolved.url; desktopByPackage = typeof desktopUrl === 'string'; } catch (sigError4) { } hostProfile = desktopByArgv || desktopBySlot || desktopByPackage || !webByBinary ? 'desktop' : 'web'; const
|
|
54
55
|
versionOfUrl = (url, patternSource) => { if (typeof url !== 'string') return null; const decoded = decodeURIComponent(url); const segmented = decoded.match(new RegExp(patternSource)); if (segmented !== null) return segmented[1]; if (decoded.slice(0, 5) === 'file:') { const processRef = globalThis.process; if (processRef === null || typeof processRef !== 'object' || typeof processRef.getBuiltinModule !== 'function') return null; const fsModule = processRef.getBuiltinModule('node:fs'); const urlModule = processRef.getBuiltinModule('node:url'); if (!fsModule || typeof fsModule.readFileSync !== 'function' || !urlModule || typeof urlModule.fileURLToPath !== 'function') return null; const manifest = JSON.parse(fsModule.readFileSync(urlModule.fileURLToPath(url), 'utf8')); return manifest !== null && typeof manifest === 'object' && typeof manifest.version === 'string' ? manifest.version : null; } return null; }; const anchors =
|
|
55
56
|
[["@deepseek-ai/dsh","[+]dsh@([^/_]+)[_/]"],["@deepseek-ai/dsh-client-connection","[+]dsh-client-connection@([^/_]+)[_/]"]]; const versions = []; for (const [anchorPackage, patternSource] of anchors) { const specifier = anchorPackage + '/package.json'; let url; try { url = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier, attributes: {} }).url : internal.resolveSync(specifier, ctx.baseUrl, {}).url; } catch (gateError) { return null; } let anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles =
|
|
56
|
-
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
57
|
+
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
58
|
+
return null; } })()
|
|
57
59
|
disabled: !!js >-
|
|
58
60
|
!((() => { try { const self = ctx[Symbol.for('cordis.entry')]; if (!self || !self.parent || !self.parent.tree) return false; const official = self.parent.tree.resolve('connection'); if (!official || official.parent !== self.parent) return false; if (official.options.id !== 'connection' || official.options.name !== '@deepseek-ai/dsh-client-connection') return false; const profile = ((() => { try { const internal = ctx.loader && ctx.loader.internal; if (!internal || typeof internal.resolveSync !== 'function') return null; const desktopSpecifier = "@deepseek-ai/dsh-desktop-host" + '/package.json'; let hostProfile = 'web'; let hostProcess = null; try { if (typeof process === 'object' && process !== null) hostProcess = process; } catch (sigError0) { } let slot = ''; let desktopBySlot = false; try { const decodedBase = decodeURIComponent(typeof ctx.baseUrl === 'string' ? ctx.baseUrl : ''); const trimmedBase = decodedBase.endsWith('/') ? decodedBase.slice(0, -1) : decodedBase; slot =
|
|
59
61
|
trimmedBase.slice(trimmedBase.lastIndexOf('/') + 1).toLowerCase(); desktopBySlot = slot === "desktop"; } catch (sigError1) { } let desktopByArgv = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && Array.isArray(hostProcess.argv)) desktopByArgv = hostProcess.argv.some((arg) => typeof arg === 'string' && arg.indexOf("dsh-desktop-host") !== -1); } catch (sigError2) { } let webByBinary = false; try { if (hostProcess !== null && typeof hostProcess === 'object' && typeof hostProcess.execPath === 'string') { const execBase = hostProcess.execPath.slice(Math.max(hostProcess.execPath.lastIndexOf('/'), hostProcess.execPath.lastIndexOf('\\')) + 1).toLowerCase(); webByBinary = execBase === 'node' || execBase === 'node.exe' || execBase === 'nodejs' || execBase === 'nodejs.exe'; } } catch (sigError3) { } let desktopByPackage = false; try { const desktopResolved = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier: desktopSpecifier, attributes:
|
|
60
62
|
{} }) : internal.resolveSync(desktopSpecifier, ctx.baseUrl, {}); const desktopUrl = desktopResolved === null || typeof desktopResolved !== 'object' ? undefined : desktopResolved.url; desktopByPackage = typeof desktopUrl === 'string'; } catch (sigError4) { } hostProfile = desktopByArgv || desktopBySlot || desktopByPackage || !webByBinary ? 'desktop' : 'web'; const versionOfUrl = (url, patternSource) => { if (typeof url !== 'string') return null; const decoded = decodeURIComponent(url); const segmented = decoded.match(new RegExp(patternSource)); if (segmented !== null) return segmented[1]; if (decoded.slice(0, 5) === 'file:') { const processRef = globalThis.process; if (processRef === null || typeof processRef !== 'object' || typeof processRef.getBuiltinModule !== 'function') return null; const fsModule = processRef.getBuiltinModule('node:fs'); const urlModule = processRef.getBuiltinModule('node:url'); if (!fsModule || typeof fsModule.readFileSync !== 'function' || !urlModule ||
|
|
61
63
|
typeof urlModule.fileURLToPath !== 'function') return null; const manifest = JSON.parse(fsModule.readFileSync(urlModule.fileURLToPath(url), 'utf8')); return manifest !== null && typeof manifest === 'object' && typeof manifest.version === 'string' ? manifest.version : null; } return null; }; const anchors = [["@deepseek-ai/dsh","[+]dsh@([^/_]+)[_/]"],["@deepseek-ai/dsh-client-connection","[+]dsh-client-connection@([^/_]+)[_/]"]]; const versions = []; for (const [anchorPackage, patternSource] of anchors) { const specifier = anchorPackage + '/package.json'; let url; try { url = internal.version === 'v2' ? internal.resolveSync(ctx.baseUrl, { specifier, attributes: {} }).url : internal.resolveSync(specifier, ctx.baseUrl, {}).url; } catch (gateError) { return null; } let anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles =
|
|
62
|
-
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
63
|
-
!["carrier-neutral-v4"].includes(profile)) return false; return official.disabled === true; } catch (gateError) { return false; } })())
|
|
64
|
+
[{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"},{"runtime":"0.1.5-rc.2","connection":"0.1.5-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v3","pairs":[{"runtime":"0.1.7-rc.1","connection":"0.1.7-rc.1"},{"runtime":"0.1.7-rc.2","connection":"0.1.7-rc.2"},{"runtime":"0.2.0-rc.1","connection":"0.2.0-rc.1"},{"runtime":"0.2.0-rc.2","connection":"0.2.0-rc.2"}],"hostProfiles":["web"]},{"id":"carrier-neutral-v4","pairs":[{"runtime":"0.2.1-rc.1","connection":"0.2.1-rc.1"},{"runtime":"0.2.1-rc.2","connection":"0.2.1-rc.2"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) {
|
|
65
|
+
return null; } })()); if (profile === null || !["carrier-neutral-v4"].includes(profile)) return false; return official.disabled === true; } catch (gateError) { return false; } })())
|
package/lib/compatibility.js
CHANGED
|
@@ -113,10 +113,19 @@ export const COMPATIBILITY_PROFILES = [
|
|
|
113
113
|
// ADDED row (ui-deepseek-model-label-1017) with the connection row
|
|
114
114
|
// field-identical. rc21 keeps anchoring at 0.2.1-rc.1; no second 0.2.1-line
|
|
115
115
|
// build input is introduced.
|
|
116
|
+
//
|
|
117
|
+
// 0.2.1-rc.3 joined this generation after a tarball audit (§5.11): another
|
|
118
|
+
// rc.2-style republish on the contract face — connection/webserver/scope/
|
|
119
|
+
// frontend-static/app-boot/runtime ship manifest-only bumps, invariants
|
|
120
|
+
// remains unpublished on both sides, and web-app's whole patch diff is one
|
|
121
|
+
// ADDED row (entry-customization) with the connection row field-identical
|
|
122
|
+
// and presets/ byte-identical. rc21 keeps anchoring at 0.2.1-rc.1; no
|
|
123
|
+
// second 0.2.1-line build input is introduced.
|
|
116
124
|
id: 'carrier-neutral-v4',
|
|
117
125
|
pairs: [
|
|
118
126
|
{ runtime: '0.2.1-rc.1', connection: '0.2.1-rc.1' },
|
|
119
127
|
{ runtime: '0.2.1-rc.2', connection: '0.2.1-rc.2' },
|
|
128
|
+
{ runtime: '0.2.1-rc.3', connection: '0.2.1-rc.3' },
|
|
120
129
|
],
|
|
121
130
|
hostAdapter: 'carrier-neutral-021',
|
|
122
131
|
clientVariant: 'rc21',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iasiv5/dsh-skip-browser-auth",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "替换官方 Connection 提供方跳过 BrowserAuth,免输 Token;已适配 0.1.2-rc.1、0.1.5-rc.1/rc.2、0.1.7-rc.1/rc.2、0.2.0-rc.1/rc.2 与 0.2.1-rc.1/rc.2,详见仓库。仅支持 web(宿主二进制须为 node);desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 argv/宿主二进制),属设计行为。",
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "替换官方 Connection 提供方跳过 BrowserAuth,免输 Token;已适配 0.1.2-rc.1、0.1.5-rc.1/rc.2、0.1.7-rc.1/rc.2、0.2.0-rc.1/rc.2 与 0.2.1-rc.1/rc.2/rc.3,详见仓库。仅支持 web(宿主二进制须为 node);desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 argv/宿主二进制),属设计行为。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"deepseek-harness",
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "node scripts/build.mjs",
|
|
40
40
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
41
|
+
"pretest": "npm run build",
|
|
41
42
|
"test": "node --test tests/*.test.mjs tests/composition/*.test.mjs",
|
|
42
43
|
"test:rc2-fixture": "node scripts/install-rc2-fixture.mjs",
|
|
43
44
|
"test:rc15-fixture": "node scripts/install-rc15-fixture.mjs",
|
|
44
45
|
"test:rc17-fixture": "node scripts/install-rc17-fixture.mjs",
|
|
45
|
-
"test:all": "npm run test:rc2-fixture && npm run test:rc15-fixture && npm run test:rc17-fixture && npm run
|
|
46
|
+
"test:all": "npm run test:rc2-fixture && npm run test:rc15-fixture && npm run test:rc17-fixture && npm run typecheck && npm test",
|
|
46
47
|
"audit-candidate": "node scripts/audit-candidate.mjs",
|
|
47
48
|
"prepare": "npm run build"
|
|
48
49
|
},
|