@iasiv5/dsh-skip-browser-auth 0.2.0 → 0.2.1

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 CHANGED
@@ -1,14 +1,14 @@
1
1
  # @iasiv5/dsh-skip-browser-auth
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@iasiv5/dsh-skip-browser-auth?label=npm&color=cb3837)](https://www.npmjs.com/package/@iasiv5/dsh-skip-browser-auth)
4
- [![DSH Web](https://img.shields.io/badge/DSH_Web-0.1.2--rc.1_%7C_0.1.5--rc.1_verified-blue)](#兼容版本)
4
+ [![DSH Web](https://img.shields.io/badge/DSH_Web-0.1.2--rc.1_%7C_0.1.5--rc.1_%7C_0.1.5--rc.2_verified-blue)](#兼容版本)
5
5
  [![License](https://img.shields.io/github/license/iasiv5/dsh-skip-browser-auth?color=green)](./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`,但两者使用不同的 host/client 兼容代际;不是把两个版本塞进同一个实现。
9
+ - **精确 profile 门控**:当前支持 `0.1.2-rc.1`、`0.1.5-rc.1` 与 `0.1.5-rc.2`,按 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` 使用 `carrier-neutral-v2`,包含 request body mode、RPC carrier 和对应浏览器 client variant 适配。
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 适配。
12
12
  - **不修改 DSH 本体与任何机制**:仅通过 DSH 官方插件 patch 机制替换 Connection 行;卸载或禁用插件并重启,即完全恢复官方行为。
13
13
  - **安全提醒**:跳过认证后,Web 对本机/可信网络内的访问不再有身份层,请勿把 DSH 端口暴露给不可信网络。
14
14
 
@@ -33,9 +33,9 @@ sudo systemctl restart deepseek-harness.service # 按你的部署方式重启
33
33
 
34
34
  ```text
35
35
  请给我的 DSH Web 安装 @iasiv5/dsh-skip-browser-auth 插件。
36
- 它支持两个精确 compatibility profile:
36
+ 它支持的精确 compatibility profile:
37
37
  - DSH 0.1.2-rc.1:legacy-web-v1
38
- - DSH 0.1.5-rc.1:carrier-neutral-v2
38
+ - DSH 0.1.5-rc.1 / 0.1.5-rc.2:carrier-neutral-v2
39
39
  其它版本或 runtime/connection 混合版本会自动休眠,不要强行处理。
40
40
 
41
41
  1. 先执行 dsh --version 告诉我当前 DSH 版本,然后照常安装:
@@ -43,7 +43,7 @@ sudo systemctl restart deepseek-harness.service # 按你的部署方式重启
43
43
  2. 重启 DSH Web 并轮询 http://127.0.0.1:3080 直到恢复 200
44
44
  (systemd 系统级部署:sudo systemctl restart deepseek-harness.service;
45
45
  user 级部署:systemctl --user restart dsh-web.service;端口以实际部署为准)。
46
- 3. 若版本是 0.1.2-rc.1 或 0.1.5-rc.1:
46
+ 3. 若版本是 0.1.2-rc.1、0.1.5-rc.1 或 0.1.5-rc.2:
47
47
  确认 journal/日志中出现固定警告
48
48
  "BrowserAuth has been skipped",并验证浏览器直接打开 Web 地址不再要求 token。
49
49
  4. 若版本不是精确白名单版本,或 profile/依赖契约不匹配:插件应自动休眠,
@@ -65,6 +65,7 @@ sudo systemctl restart deepseek-harness.service
65
65
  | --- | --- | --- | --- |
66
66
  | `0.1.2-rc.1` + `0.1.2-rc.1` | `legacy-web-v1` | legacy `/api` prefix + 0.1.2 client | ✅ active |
67
67
  | `0.1.5-rc.1` + `0.1.5-rc.1` | `carrier-neutral-v2` | carrier-neutral HostConnectionService + 0.1.5 client | ✅ active(代码/真实 npm fixture 已验证;真实部署仍需按清单确认) |
68
+ | `0.1.5-rc.2` + `0.1.5-rc.2` | `carrier-neutral-v2` | 同上(rc.2 为 rc.1 的重发布:代码逐字节一致) | ✅ active(npm diff 审计 + 真实 rc.2 npm fixture 组合测试已验证;真实部署仍需按清单确认) |
68
69
  | 其它版本或混合版本对 | — | 😴 自动休眠:官方行为分毫不变 | dormant |
69
70
 
70
71
  白名单匹配的是**完整版本对**,不是两个独立的 `includes()`:
@@ -72,6 +73,8 @@ sudo systemctl restart deepseek-harness.service
72
73
  ```text
73
74
  runtime=0.1.2-rc.1 + connection=0.1.5-rc.1 → dormant
74
75
  runtime=0.1.5-rc.1 + connection=0.1.5-rc.1 → carrier-neutral-v2
76
+ runtime=0.1.5-rc.1 + connection=0.1.5-rc.2 → dormant(同代际跨 patch 混合同样是事故形态)
77
+ runtime=0.1.5-rc.2 + connection=0.1.5-rc.2 → carrier-neutral-v2
75
78
  ```
76
79
 
77
80
  未来的新版本如果保持同一契约,可以加入对应 profile 的精确版本对;如果发生 API、DI、route、body 或 client bundle 契约变化,必须新增 profile、host adapter 和 client variant,不能 fallback 到旧代际。详细流程见 [docs/COMPATIBILITY.md](./docs/COMPATIBILITY.md)。
package/cordis.patch.yml CHANGED
@@ -11,8 +11,8 @@
11
11
  name: '@deepseek-ai/dsh-client-connection'
12
12
  disabled: !!js >-
13
13
  (() => { try { const profile = ((() => { try { const internal = ctx.loader && ctx.loader.internal; if (!internal || typeof internal.resolveSync !== 'function') return null; 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
14
- 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 = [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"}]}]; for (const profile of profiles)
15
- { if (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()); return profile !== null && ["legacy-web-v1","carrier-neutral-v2"].includes(profile); } catch (gateError) { return false; } })()
14
+ 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 =
15
+ [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"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"}]}]; for (const profile of profiles) { if (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()); return profile !== null && ["legacy-web-v1","carrier-neutral-v2"].includes(profile); } catch (gateError) { return false; } })()
16
16
  - insert:
17
17
  - id: trusted-connection
18
18
  name: '@iasiv5/dsh-skip-browser-auth'
@@ -22,9 +22,9 @@
22
22
  trustedHosts: !!js ctx.webRuntime.trustedHosts
23
23
  compatibilityProfile: !!js >-
24
24
  (() => { try { const internal = ctx.loader && ctx.loader.internal; if (!internal || typeof internal.resolveSync !== 'function') return null; 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
25
- 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 = [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"}]}]; for (const profile of profiles) { if
26
- (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()
25
+ 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 = [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"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"}]}]; for
26
+ (const profile of profiles) { if (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()
27
27
  disabled: !!js >-
28
28
  !((() => { 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 probeAllowed = ((() => { try { const profile = ((() => { try { const internal = ctx.loader && ctx.loader.internal; if (!internal || typeof internal.resolveSync !== 'function') return null; 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')
29
29
  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 = [["@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
30
- anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles = [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"id":"carrier-neutral-v2","pairs":[{"runtime":"0.1.5-rc.1","connection":"0.1.5-rc.1"}]}]; for (const profile of profiles) { if (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()); return profile !== null && ["legacy-web-v1","carrier-neutral-v2"].includes(profile); } catch (gateError) { return false; } })()); if (probeAllowed !== true) return false; return official.disabled === true; } catch (gateError) { return false; } })())
30
+ anchorVersion; try { anchorVersion = versionOfUrl(url, patternSource); } catch (gateError) { return null; } if (anchorVersion === null) return null; versions.push(anchorVersion); } const profiles = [{"id":"legacy-web-v1","pairs":[{"runtime":"0.1.2-rc.1","connection":"0.1.2-rc.1"}]},{"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"}]}]; for (const profile of profiles) { if (profile.pairs.some((pair) => pair.runtime === versions[0] && pair.connection === versions[1])) return profile.id; } return null; } catch (gateError) { return null; } })()); return profile !== null && ["legacy-web-v1","carrier-neutral-v2"].includes(profile); } catch (gateError) { return false; } })()); if (probeAllowed !== true) return false; return official.disabled === true; } catch (gateError) { return false; } })())
@@ -18,7 +18,14 @@ export const COMPATIBILITY_PROFILES = [
18
18
  },
19
19
  {
20
20
  id: 'carrier-neutral-v2',
21
- pairs: [{ runtime: '0.1.5-rc.1', connection: '0.1.5-rc.1' }],
21
+ // 0.1.5-rc.2 joined this generation after a byte-level audit: every anchor
22
+ // package the gate probes (@deepseek-ai/dsh, dsh-client-connection,
23
+ // dsh-host-webserver, dsh-web-app) ships rc.1-identical code and only bumps
24
+ // manifest versions/dependency ranges. See docs/COMPATIBILITY.md §6.
25
+ pairs: [
26
+ { runtime: '0.1.5-rc.1', connection: '0.1.5-rc.1' },
27
+ { runtime: '0.1.5-rc.2', connection: '0.1.5-rc.2' },
28
+ ],
22
29
  hostAdapter: 'carrier-neutral',
23
30
  clientVariant: 'rc15',
24
31
  requiresRecoveryGlobal: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-skip-browser-auth",
3
- "version": "0.2.0",
4
- "description": "DSH 0.1.2-rc.1 与 0.1.5-rc.1 的分代兼容插件:按精确 compatibility profile 自动跳过 BrowserAuth;其它版本自动休眠,不修改任何 DSH 本体与机制",
3
+ "version": "0.2.1",
4
+ "description": "DSH 0.1.2-rc.1、0.1.5-rc.1 与 0.1.5-rc.2 的分代兼容插件:按精确 compatibility profile 自动跳过 BrowserAuth;其它版本自动休眠,不修改任何 DSH 本体与机制",
5
5
  "keywords": [
6
6
  "dsh",
7
7
  "deepseek-harness",