@iasiv5/dsh-skip-browser-auth 0.4.6 → 0.4.7
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 +9 -5
- package/cordis.patch.yml +10 -10
- package/lib/compatibility.js +9 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @iasiv5/dsh-skip-browser-auth
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@iasiv5/dsh-skip-browser-auth)
|
|
4
|
-
[](#兼容版本)
|
|
5
5
|
[](./LICENSE)
|
|
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.2`、`0.2.1-rc.3` 与 `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`、`0.2.1-rc.4` 与 `0.2.1-rc.5`,按 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.2`、`0.2.1-rc.3` 与 `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`、`0.2.1-rc.4` 与 `0.2.1-rc.5` 使用 `carrier-neutral-v4`,覆盖 0.2.1 的 Peer/principal 准入重构、`admission.peer` 透传 bridge、新 `/connect` 交换通道与 `webStartup` 信任来源(0.2.1 是真实契约变化,独立代际;rc.2/rc.3/rc.4/rc.5 为契约面等价重发布,见 docs/COMPATIBILITY.md §5.8/§5.9/§5.10/§5.11/§5.12/§5.13)。
|
|
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 / 0.2.1-rc.3 / 0.2.1-rc.4:carrier-neutral-v4
|
|
40
|
+
- DSH 0.2.1-rc.1 / 0.2.1-rc.2 / 0.2.1-rc.3 / 0.2.1-rc.4 / 0.2.1-rc.5: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.2、0.2.1-rc.3 或 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、0.2.1-rc.4 或 0.2.1-rc.5:
|
|
50
50
|
确认 journal/日志中出现固定警告
|
|
51
51
|
"BrowserAuth has been skipped",并验证浏览器直接打开 Web 地址不再要求 token。
|
|
52
52
|
4. 若版本不是精确白名单版本,或 profile/依赖契约不匹配:插件应自动休眠,
|
|
@@ -79,6 +79,7 @@ sudo systemctl restart deepseek-harness.service
|
|
|
79
79
|
| `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 待宿主升级后回填) |
|
|
80
80
|
| `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 审计 + 真实 rc.3 fixture 测试,见 docs/COMPATIBILITY.md §5.11;2026-10-25 Web 实测:BrowserAuth 横幅出现、无 token GET / 返回 200) |
|
|
81
81
|
| `0.2.1-rc.4` + `0.2.1-rc.4` | `carrier-neutral-v4` | 同上(0.2.1-rc.4 为契约面等价重发布:首个 web-app patch 零 diff 的收编轮,connection 行逐字段一致) | ✅ active(npm diff 审计 + 真实 rc.4 fixture 测试,见 docs/COMPATIBILITY.md §5.12;实机 checklist 待宿主升级 rc.4 后回填) |
|
|
82
|
+
| `0.2.1-rc.5` + `0.2.1-rc.5` | `carrier-neutral-v4` | 同上(0.2.1-rc.5 为契约面等价重发布:web-app patch 连续第二轮零 diff,connection 行逐字段一致) | ✅ active(npm diff 审计 + 真实 rc.5 fixture 测试,见 docs/COMPATIBILITY.md §5.13;实机 checklist 待宿主升级 rc.5 后回填) |
|
|
82
83
|
| desktop profile(存在 dsh-desktop-host 的环境,任意版本对) | — | 😴 dormant-by-design:desktop 一律休眠 | dormant |
|
|
83
84
|
| 其它版本或混合版本对 | — | 😴 自动休眠:官方行为分毫不变 | dormant |
|
|
84
85
|
|
|
@@ -111,6 +112,9 @@ runtime=0.2.1-rc.3 + connection=0.2.1-rc.3 → carrier-neutral-v4
|
|
|
111
112
|
runtime=0.2.1-rc.3 + connection=0.2.1-rc.4 → dormant(同代际跨 patch 混合同样是事故形态)
|
|
112
113
|
runtime=0.2.1-rc.4 + connection=0.2.1-rc.3 → dormant
|
|
113
114
|
runtime=0.2.1-rc.4 + connection=0.2.1-rc.4 → carrier-neutral-v4
|
|
115
|
+
runtime=0.2.1-rc.4 + connection=0.2.1-rc.5 → dormant(同代际跨 patch 混合同样是事故形态)
|
|
116
|
+
runtime=0.2.1-rc.5 + connection=0.2.1-rc.4 → dormant
|
|
117
|
+
runtime=0.2.1-rc.5 + connection=0.2.1-rc.5 → carrier-neutral-v4
|
|
114
118
|
runtime=0.1.7-rc.2 + connection=0.1.5-rc.2 → dormant(跨代际混合)
|
|
115
119
|
```
|
|
116
120
|
|
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"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0]
|
|
24
|
-
profile.id; } return null; } catch (gateError) { return null; } })()); return profile !== null && ["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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"},{"runtime":"0.2.1-rc.5","connection":"0.2.1-rc.5"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime === versions[0]
|
|
24
|
+
&& pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return 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,15 +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"},{"runtime":"0.2.1-rc.3","connection":"0.2.1-rc.3"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
38
|
-
profile.id; } return null; } catch (gateError) { return null; } })()
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"},{"runtime":"0.2.1-rc.5","connection":"0.2.1-rc.5"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
38
|
+
versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()
|
|
39
39
|
disabled: !!js >-
|
|
40
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 =
|
|
41
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:
|
|
42
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 ||
|
|
43
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 =
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
45
|
-
profile.id; } return null; } catch (gateError) { 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; } })())
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"},{"runtime":"0.2.1-rc.5","connection":"0.2.1-rc.5"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
45
|
+
versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { 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; } })())
|
|
46
46
|
- id: trusted-connection-021
|
|
47
47
|
name: '@iasiv5/dsh-skip-browser-auth'
|
|
48
48
|
inject:
|
|
@@ -54,12 +54,12 @@
|
|
|
54
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
|
|
55
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 =
|
|
56
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 =
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
58
|
-
profile.id; } return null; } catch (gateError) { return null; } })()
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"},{"runtime":"0.2.1-rc.5","connection":"0.2.1-rc.5"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
58
|
+
versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()
|
|
59
59
|
disabled: !!js >-
|
|
60
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 =
|
|
61
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:
|
|
62
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 ||
|
|
63
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 =
|
|
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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
65
|
-
profile.id; } return null; } catch (gateError) { return null; } })()); if (profile === null || !["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"},{"runtime":"0.2.1-rc.4","connection":"0.2.1-rc.4"},{"runtime":"0.2.1-rc.5","connection":"0.2.1-rc.5"}],"hostProfiles":["web"]}]; for (const profile of profiles) { if (profile.hostProfiles.includes(hostProfile) && profile.pairs.some((pair) => pair.runtime ===
|
|
65
|
+
versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { 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
|
@@ -129,12 +129,21 @@ export const COMPATIBILITY_PROFILES = [
|
|
|
129
129
|
// and web-app's patch diff is empty for the first time in the 0.2.1 line
|
|
130
130
|
// (no ADDED rows at all, connection row field-identical). rc21 keeps
|
|
131
131
|
// anchoring at 0.2.1-rc.1; no second 0.2.1-line build input is introduced.
|
|
132
|
+
//
|
|
133
|
+
// 0.2.1-rc.5 joined this generation after a tarball audit (§5.13): another
|
|
134
|
+
// pure rc.2-style republish on the contract face — every anchor package
|
|
135
|
+
// (connection/webserver/scope/frontend-static/app-boot/web-app/runtime)
|
|
136
|
+
// ships manifest-only bumps, invariants remains unpublished on both sides,
|
|
137
|
+
// and web-app's patch diff stays empty for a second consecutive round
|
|
138
|
+
// (connection row field-identical). rc21 keeps anchoring at 0.2.1-rc.1;
|
|
139
|
+
// no second 0.2.1-line build input is introduced.
|
|
132
140
|
id: 'carrier-neutral-v4',
|
|
133
141
|
pairs: [
|
|
134
142
|
{ runtime: '0.2.1-rc.1', connection: '0.2.1-rc.1' },
|
|
135
143
|
{ runtime: '0.2.1-rc.2', connection: '0.2.1-rc.2' },
|
|
136
144
|
{ runtime: '0.2.1-rc.3', connection: '0.2.1-rc.3' },
|
|
137
145
|
{ runtime: '0.2.1-rc.4', connection: '0.2.1-rc.4' },
|
|
146
|
+
{ runtime: '0.2.1-rc.5', connection: '0.2.1-rc.5' },
|
|
138
147
|
],
|
|
139
148
|
hostAdapter: 'carrier-neutral-021',
|
|
140
149
|
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/rc.3/rc.4,详见仓库。仅支持 web(宿主二进制须为 node);desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 argv/宿主二进制),属设计行为。",
|
|
3
|
+
"version": "0.4.7",
|
|
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/rc.4/rc.5,详见仓库。仅支持 web(宿主二进制须为 node);desktop 宿主一律自动休眠(多进程树判别:安装槽位/启动器 argv/宿主二进制),属设计行为。",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"dsh",
|