@linbin-mk/dsh-brand-deepseek 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +60 -0
- package/README.en.md +114 -0
- package/README.md +114 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +1233 -0
- package/lib/index.js +26 -0
- package/package.json +121 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 linbin-mk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@linbin-mk/dsh-brand-deepseek
|
|
2
|
+
Copyright (c) 2026 linbin-mk
|
|
3
|
+
|
|
4
|
+
This distribution includes the third-party material listed below. Each entry
|
|
5
|
+
reproduces the copyright notice and license text that its license requires.
|
|
6
|
+
|
|
7
|
+
================================================================================
|
|
8
|
+
src/client/brand.tsx — DeepSeek whale mark and "DeepSeek" wordmark
|
|
9
|
+
================================================================================
|
|
10
|
+
|
|
11
|
+
The whale silhouette (WHALE_PATH) and the letter paths of the "DeepSeek"
|
|
12
|
+
wordmark (WORDMARK_PATHS) are reproduced verbatim from the brand SVG rendered
|
|
13
|
+
in the header of https://www.deepseek.com/ — same path data, same viewBox
|
|
14
|
+
proportions. They are used unmodified by a plugin whose whole purpose is to
|
|
15
|
+
show that mark in the DeepSeek Harness Web client.
|
|
16
|
+
|
|
17
|
+
The DeepSeek name, the whale mark and the DeepSeek wordmark are trademarks of
|
|
18
|
+
DeepSeek (Hangzhou DeepSeek Artificial Intelligence Basic Technology Research
|
|
19
|
+
Co., Ltd. / 杭州深度求索人工智能基础技术研究有限公司). They appear here for
|
|
20
|
+
identification only, to render the look of the official product inside a
|
|
21
|
+
user-installed plugin. The MIT license in LICENSE covers this plugin's own
|
|
22
|
+
source code and nothing else: it grants no rights in these marks. This project
|
|
23
|
+
is not affiliated with, endorsed by, or sponsored by DeepSeek.
|
|
24
|
+
|
|
25
|
+
The upstream website publishes no license text for this asset. If you hold the
|
|
26
|
+
rights to it and want this use changed or removed, open an issue at
|
|
27
|
+
https://github.com/linbin-mk/dsh-brand-deepseek/issues and it will be removed.
|
|
28
|
+
|
|
29
|
+
The hero headline string "想从哪里开始?" (src/client/locales.ts) is the same
|
|
30
|
+
site copy, reproduced for the same purpose and under the same terms.
|
|
31
|
+
|
|
32
|
+
================================================================================
|
|
33
|
+
DeepSeek Harness UI strings reproduced as fallbacks
|
|
34
|
+
================================================================================
|
|
35
|
+
|
|
36
|
+
The settings preview labels the official default brand with the strings the
|
|
37
|
+
harness itself renders ("探索未至之境", "预览版", "DSH Local Build"). They are
|
|
38
|
+
quoted from DeepSeek Harness, which is distributed under the MIT license below.
|
|
39
|
+
|
|
40
|
+
MIT License
|
|
41
|
+
|
|
42
|
+
Copyright (c) 2026 DeepSeek
|
|
43
|
+
|
|
44
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
45
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
46
|
+
in the Software without restriction, including without limitation the rights
|
|
47
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
48
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
49
|
+
furnished to do so, subject to the following conditions:
|
|
50
|
+
|
|
51
|
+
The above copyright notice and this permission notice shall be included in all
|
|
52
|
+
copies or substantial portions of the Software.
|
|
53
|
+
|
|
54
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
55
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
56
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
57
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
58
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
59
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
60
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
English | [简体中文](https://github.com/linbin-mk/dsh-brand-deepseek/blob/main/README.md)
|
|
2
|
+
|
|
3
|
+
# dsh-brand-deepseek
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@linbin-mk/dsh-brand-deepseek)
|
|
6
|
+
[](https://github.com/linbin-mk/dsh-brand-deepseek/actions/workflows/publish.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](package.json)
|
|
9
|
+
[](#requirements)
|
|
10
|
+
|
|
11
|
+
`dsh-brand-deepseek` is a **third-party, self-contained** DeepSeek Harness client plugin. It replaces the Web client sidebar brand with the official DeepSeek look — whale mark plus `deepseek` wordmark — and, when enabled, the blank-session hero headline above the chat box with the official title (whale mark + 想从哪里开始?). It overrides the shell's `DSH Local Build` fallback entirely through the documented slot system, so the harness source never has to be patched.
|
|
12
|
+
|
|
13
|
+
It fills two single slots: `sidebar.brand.mark` (the whale mark) and `sidebar.brand.name` (the `deepseek` wordmark); the hero headline goes through the `conversation.hero.brand.mark` slot plus one scoped style sheet.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Sidebar brand** — the official DeepSeek whale mark and wordmark, filled with the official DeepSeek blue by default.
|
|
18
|
+
- **Hero headline** — when on, the blank-session title row above the chat box becomes the DeepSeek brand title (whale mark + 想从哪里开始?), with the official default headline (探索未至之境 + the 预览版 badge) hidden and the row re-centered; when off, the official headline returns.
|
|
19
|
+
- **Brand style settings page** (**Settings → Brand style**, bottom left):
|
|
20
|
+
- a **custom style** toggle — off restores the official default brand (`DSH 本地构建` / `DSH Local Build` + build-version badge): the brand slots are unregistered, so the shell fallback renders;
|
|
21
|
+
- a **hero headline** toggle — switches the blank-session title row independently (defaults to on);
|
|
22
|
+
- **trajectory tab** and **session log button** toggles — show or hide those two pieces of harness chrome in the conversation header (both default to on). Implemented purely at the DOM level: no harness source is touched and the data behind them (trajectory records, export) is unaffected;
|
|
23
|
+
- **ten brand colors** (the current scheme — official DeepSeek blue — is the default). Choices apply immediately and persist through the Host settings RPC, so they survive reloads.
|
|
24
|
+
- **Live preview** — the settings preview panel mirrors both states; with the custom style off it renders the shell fallback (fish mark, localized label and the build-version badge).
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- Node.js `^22.19` or `>=24`
|
|
29
|
+
- DeepSeek Harness `0.1.5-rc.1` or a compatible `0.1.5` prerelease, on a **Web profile** that provides `ctx.slots`, `ctx.remote.settings` and `ctx.locale`
|
|
30
|
+
- The client modules the plugin declares (`@deepseek-ai/dsh-client-ui-primitives`, `-ui-sidebar`, `-ui-settings`, `-ui-renderer`, `-locale`, `dsh-api-remotes`) — the default Web profile already ships them
|
|
31
|
+
- No path dependency on a Harness checkout
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Install the published package into a custom Web profile. The package declares `dsh.bundle`, so `dsh plugin add` also inserts the `brand-deepseek` row automatically:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh --profile web-brand --from-default-profile web --dump-config
|
|
39
|
+
dsh plugin --profile web-brand add @linbin-mk/dsh-brand-deepseek
|
|
40
|
+
dsh --profile web-brand
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or install a locally built tarball:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm build
|
|
48
|
+
pnpm test
|
|
49
|
+
npm pack
|
|
50
|
+
dsh plugin --profile web-brand add ./linbin-mk-dsh-brand-deepseek-0.1.3.tgz
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Remove it from the same profile:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dsh plugin --profile web-brand remove @linbin-mk/dsh-brand-deepseek
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Settings
|
|
60
|
+
|
|
61
|
+
The host half registers the `dsh-brand-deepseek` settings namespace. The fields default as follows and are written through the harness's revision-guarded settings transport, so changes take effect immediately with no restart. The namespace is **deliberately not the package name**: the package name is the loader identity (`@linbin-mk/dsh-brand-deepseek`), while the namespace only persists values — renaming the package does not invalidate existing settings.
|
|
62
|
+
|
|
63
|
+
| Setting | Default | Effect |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| `enabled` | `true` | Master switch for the custom brand. Off unregisters the brand slots, returning the sidebar to the shell's official default brand. |
|
|
66
|
+
| `hero` | `true` | Whether the blank-session title row uses the DeepSeek brand title. |
|
|
67
|
+
| `trajectoryTab` | `true` | Whether the conversation header's "Trajectory" tab is visible (trajectory data is unaffected). |
|
|
68
|
+
| `sessionLogButton` | `true` | Whether the conversation header's "Session log" button is visible (export still works). |
|
|
69
|
+
| `color` | `#4176e6` | Brand color, one of ten; official blue is the default. |
|
|
70
|
+
|
|
71
|
+
## How it works
|
|
72
|
+
|
|
73
|
+
- The **host half** (`lib/index.js`) does exactly one thing: it registers the `dsh-brand-deepseek` settings namespace so the client half's `settings.describe` / `settings.mutate` calls are accepted and persisted.
|
|
74
|
+
- The **client half** (`lib/client.js`) is a CJS bundle built by tsdown that self-registers through `window.__ModuleLoader__.load({ id, factory })`. The `id` must equal the **package name** — the harness keys its client module table by entry name, and a mismatch makes the row unresolvable and takes the whole GUI down while `--dump-config` still looks fine. `tsdown.config.ts` derives the id from `package.json#name` and `scripts/smoke-client.mjs` re-asserts the equality, so a rename cannot drift silently.
|
|
75
|
+
- The **hero style sheet** targets the harness's CSS-module locals by their `<hash>_<local>` shape, scoped to the conversation shell's `[data-composer-seat]` and anchored on the hero's own `_fishHitbox` descendant, so the shared `.headline` locals of other modules (ContextMeter, ApprovalPanel) are never touched. The official default title is hidden under **every** local it has shipped with — `_headlineText` in `0.1.5-rc.1` and the `_titleGroup` wrapper (title plus badge) introduced in `0.1.5-rc.2`; on a harness that never had a given local the matching selector is simply a no-op. Should those names change again, the plugin degrades to the brand title rendering next to the official one instead of erroring or taking the page down.
|
|
76
|
+
- The **two harness-chrome toggles** locate elements by class-name suffix with the localized label as a fallback, and a `MutationObserver` re-applies the state after React remounts the header. If both the class and the label change, the element stays visible rather than being hidden by mistake.
|
|
77
|
+
|
|
78
|
+
## Build and verify
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
pnpm install
|
|
82
|
+
pnpm build # src/ -> lib/ (lib/ is committed; installs need no build step)
|
|
83
|
+
pnpm build:check # rebuild and assert lib/ matches what is committed
|
|
84
|
+
pnpm test # both smoke tests
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`pnpm test` runs `scripts/smoke-client.mjs` (loads `lib/client.js` the way the browser loader does, asserting bundle id == package name plus the export and `inject` contract) and `scripts/smoke-visibility.mjs` (mounts `apply()` on a jsdom document and verifies that both persisted toggles drive the DOM, including the observer re-apply after a remount and the label fallback locator). jsdom is a development dependency of this package only; the plugin never needs it at runtime.
|
|
88
|
+
|
|
89
|
+
## Troubleshooting
|
|
90
|
+
|
|
91
|
+
- **The sidebar does not change.** First confirm the plugin row is still installed (this only covers the host half; a client-half failure surfaces in the browser console):
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
dsh --profile web-brand --dump-config | grep -A 2 brand-deepseek
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Then open the browser console: client bundle loading errors are printed there.
|
|
98
|
+
- **The page shows `Failed to load plugins`.** The harness indexes its client module table by **package name**, and the bundle's registered `id` must be that same string. This repository pins the constraint with a build-time derivation plus a smoke-test assertion; if you rename the package in a fork, rebuild `lib/` (`pnpm build`) rather than editing `lib/client.js` by hand.
|
|
99
|
+
- **`dsh plugin add` returns 404 right after a release.** A brand-new version takes a few minutes to appear on the registry's read path; `dist-tags` and metadata usually appear first. Retry later — do not republish.
|
|
100
|
+
- **`ERR_PNPM_FETCH_404` when installing through a mirror.** Mirrors such as npmmirror sync new versions on their own schedule. Add `--registry=https://registry.npmjs.org` to that command, or wait for the mirror.
|
|
101
|
+
- **pnpm refuses or questions a just-published version.** That is pnpm's `minimumReleaseAge` delay. Allow the package (pnpm records it in `minimumReleaseAgeExclude`) or wait out the window.
|
|
102
|
+
- **The brand is duplicated or conflicting under an official profile.** The in-box `ui-brand-official` package only fills the same slots when `DSH_CLIENT_BUILD_PROFILE === 'official'`. A local build profile is not official, so there is no conflict; if you do run an official profile, disable one of the two.
|
|
103
|
+
- **Two headlines show at once (brand title next to the official one).** That means the current harness renamed the hero's CSS-module locals again, and the plugin degrades by design instead of erroring. Include your harness version and the `<hash>_xxx` local name in the issue.
|
|
104
|
+
- **A hidden tab or button reappears.** The observer re-applies after a remount; the plugin only gives up when the class suffix **and** the localized label both change (staying visible beats hiding the wrong element).
|
|
105
|
+
|
|
106
|
+
## Privacy and scope
|
|
107
|
+
|
|
108
|
+
The plugin makes no network requests, reads no conversation content and reports no telemetry. It does three things only: register slot occupants, read and write the `dsh-brand-deepseek` settings namespace, and hide two DOM elements in the conversation header (the trajectory tab and the session log button) according to your settings. Values live in the harness profile settings and never leave the machine. Hiding affects rendering only — trajectory data and export are untouched.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT — see `LICENSE`.
|
|
113
|
+
|
|
114
|
+
The sidebar whale mark and the `DeepSeek` wordmark are copied unmodified from the brand SVG in the header of the DeepSeek website (deepseek.com). The DeepSeek name and marks are trademarks of DeepSeek (Hangzhou DeepSeek Artificial Intelligence Basic Technology Research Co., Ltd.); they appear here only to render the look of the official product inside the plugin, and the MIT license covers this plugin's source code only, not those marks. Upstream copyright and trademark notices are in `NOTICE`.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[English](https://github.com/linbin-mk/dsh-brand-deepseek/blob/main/README.en.md) | 简体中文
|
|
2
|
+
|
|
3
|
+
# dsh-brand-deepseek
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@linbin-mk/dsh-brand-deepseek)
|
|
6
|
+
[](https://github.com/linbin-mk/dsh-brand-deepseek/actions/workflows/publish.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](package.json)
|
|
9
|
+
[](#要求)
|
|
10
|
+
|
|
11
|
+
`dsh-brand-deepseek` 是一个**纯第三方、自包含**的 DeepSeek Harness 客户端插件。它把 Web 客户端侧边栏的品牌替换成 DeepSeek 官方样式——鲸鱼标志加 `deepseek` 字标;开启后还会把空白会话页聊天框上方的标题行替换成官方标题(鲸鱼标志 + 想从哪里开始?)。它全部通过 Harness 已公开的插槽系统覆盖外壳的 `DSH 本地构建` 回退品牌,**不需要改动 Harness 源码**。
|
|
12
|
+
|
|
13
|
+
插件占用两个单占位插槽:`sidebar.brand.mark`(鲸鱼标志)与 `sidebar.brand.name`(`deepseek` 字标);标题行的替换走 `conversation.hero.brand.mark` 插槽加一段作用域受控的样式表。
|
|
14
|
+
|
|
15
|
+
## 功能
|
|
16
|
+
|
|
17
|
+
- **侧边栏品牌** —— 官方 DeepSeek 鲸鱼标志与字标,默认填充官方 DeepSeek 蓝。
|
|
18
|
+
- **会话页标题行** —— 开启后,空白会话聊天框上方的标题行改为 DeepSeek 品牌标题(鲸鱼标志 + 想从哪里开始?),官方默认标题(探索未至之境 + 预览版徽章)被隐藏、整行居中;关闭后回到官方默认标题。
|
|
19
|
+
- **品牌样式设置页**(左下角**设置 → 品牌样式**):
|
|
20
|
+
- **自定义样式**开关 —— 关闭即恢复官方默认品牌(`DSH 本地构建` / `DSH Local Build` + 构建版本徽章):品牌插槽整体注销,由外壳回退渲染;
|
|
21
|
+
- **会话页标题**开关 —— 独立切换标题行(默认开启);
|
|
22
|
+
- **轨迹页签**与 **Session 日志按钮**开关 —— 独立显示/隐藏会话页头部这两处外壳元素(默认都开启),纯 DOM 层操作,不影响背后的轨迹数据与导出功能;
|
|
23
|
+
- **十种品牌颜色**可选(当前配色 = 官方 DeepSeek 蓝,为默认项),选择后立即生效并通过 Host 设置 RPC 持久化,刷新后仍在。
|
|
24
|
+
- **实时预览** —— 设置页的预览区跟随两个状态渲染:自定义样式关闭时展示当前外壳回退品牌(鱼形标志、本地化标签与构建版本徽章)。
|
|
25
|
+
|
|
26
|
+
## 要求
|
|
27
|
+
|
|
28
|
+
- Node.js `^22.19` 或 `>=24`
|
|
29
|
+
- DeepSeek Harness `0.1.5-rc.1` 或兼容的 `0.1.5` 预发布版本,以及提供 `ctx.slots`、`ctx.remote.settings` 与 `ctx.locale` 的 **Web profile**
|
|
30
|
+
- Web profile 中需带有插件声明的客户端模块(`@deepseek-ai/dsh-client-ui-primitives`、`-ui-sidebar`、`-ui-settings`、`-ui-renderer`、`-locale`、`dsh-api-remotes`);默认 Web profile 已包含
|
|
31
|
+
- 产物不含任何指向 Harness checkout 的路径依赖
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
把已发布的包安装进自定义 Web profile。包内声明了 `dsh.bundle`,因此 `dsh plugin add` 会自动补上 `brand-deepseek` 这一行:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh --profile web-brand --from-default-profile web --dump-config
|
|
39
|
+
dsh plugin --profile web-brand add @linbin-mk/dsh-brand-deepseek
|
|
40
|
+
dsh --profile web-brand
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
改为安装本地构建的 tarball:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm build
|
|
48
|
+
pnpm test
|
|
49
|
+
npm pack
|
|
50
|
+
dsh plugin --profile web-brand add ./linbin-mk-dsh-brand-deepseek-0.1.3.tgz
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
从同一个 profile 移除插件:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dsh plugin --profile web-brand remove @linbin-mk/dsh-brand-deepseek
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 设置
|
|
60
|
+
|
|
61
|
+
Host 半侧注册 `dsh-brand-deepseek` 设置命名空间,字段默认值如下,通过 Harness 带修订保护的设置传输写入,因此修改立即生效、无需重启 Harness。命名空间名与包名**故意不同**:包名是加载标识(`@linbin-mk/dsh-brand-deepseek`),命名空间只用于持久化,改包名不会让已有设置失效。
|
|
62
|
+
|
|
63
|
+
| 设置 | 默认值 | 作用 |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| `enabled` | `true` | 自定义品牌样式总开关。关闭后品牌插槽被注销,侧边栏回到外壳的官方默认品牌。 |
|
|
66
|
+
| `hero` | `true` | 空白会话页标题行是否使用 DeepSeek 品牌标题。 |
|
|
67
|
+
| `trajectoryTab` | `true` | 会话页头部的「轨迹」页签是否可见(轨迹数据不受影响)。 |
|
|
68
|
+
| `sessionLogButton` | `true` | 会话页头部的「Session 日志」按钮是否可见(导出功能不受影响)。 |
|
|
69
|
+
| `color` | `#4176e6` | 品牌颜色,十选一,官方蓝为默认。 |
|
|
70
|
+
|
|
71
|
+
## 工作原理
|
|
72
|
+
|
|
73
|
+
- **Host 半侧**(`lib/index.js`)只做一件事:注册 `dsh-brand-deepseek` 设置命名空间,让客户端半侧的 `settings.describe` / `settings.mutate` 调用被接受并持久化。
|
|
74
|
+
- **客户端半侧**(`lib/client.js`)是一个由 tsdown 打包、以 `window.__ModuleLoader__.load({ id, factory })` 自注册的 CJS bundle。`id` 必须等于**包名**——Harness 用入口名索引客户端模块表,名字不一致时该行解析失败、整个 GUI 起不来(而 `--dump-config` 仍显示正常)。`tsdown.config.ts` 直接从 `package.json` 取 `name` 写进 banner,`scripts/smoke-client.mjs` 再断言一次两者相等,因此重命名不会静默漂移。
|
|
75
|
+
- **标题行样式**按 CSS Module 的 `<hash>_<local>` 形状匹配 Harness 的局部类名,并用会话外壳的 `[data-composer-seat]` 限定作用域、锚定在标题行自己的 `_fishHitbox` 后代上,因此不会波及其他模块(ContextMeter、ApprovalPanel)的同名 `.headline`。官方默认标题按它用过的**每个**局部名隐藏——`0.1.5-rc.1` 的 `_headlineText`,以及 `0.1.5-rc.2` 起包裹标题与徽章的 `_titleGroup`;没出现过该局部名的版本上,对应选择器只是空操作。若将来这些名字被再次改掉,插件退化为「品牌标题 + 官方标题并排显示」,而不是报错或让整个页面起不来。
|
|
76
|
+
- **两个外壳开关**(轨迹页签、Session 日志按钮)按类名后缀定位元素、用本地化文案兜底,并用 `MutationObserver` 在 React 重挂载后重新应用;若两者都改名,元素保持可见,而不是误隐藏。
|
|
77
|
+
|
|
78
|
+
## 构建与验证
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
pnpm install
|
|
82
|
+
pnpm build # src/ -> lib/(lib/ 已提交,安装后无需构建)
|
|
83
|
+
pnpm build:check # 重新构建并断言 lib/ 与提交内容一致
|
|
84
|
+
pnpm test # 两个冒烟测试
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`pnpm test` 依次跑:`scripts/smoke-client.mjs`(按浏览器加载器的真实方式加载 `lib/client.js`,断言 bundle id == 包名、导出与 `inject` 契约)和 `scripts/smoke-visibility.mjs`(在 jsdom 里挂载 `apply()`,验证两个持久化开关驱动 DOM,包括重挂载后的观察者补偿与文案兜底定位)。jsdom 只是本包的开发依赖,运行时不需要。
|
|
88
|
+
|
|
89
|
+
## 常见问题
|
|
90
|
+
|
|
91
|
+
- **侧边栏没有任何变化。** 先确认插件行还在(这一步只覆盖 Host 半侧;客户端半侧的失败只在浏览器控制台里暴露):
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
dsh --profile web-brand --dump-config | grep -A 2 brand-deepseek
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
再打开浏览器控制台:客户端 bundle 的加载错误会直接打在这里。
|
|
98
|
+
- **页面显示 `Failed to load plugins`。** Harness 用**包名**索引客户端模块表,bundle 注册的 `id` 必须是同一个字符串。本仓库用构建期派生 + 冒烟测试断言把这个约束固定住了;如果你在 fork 里改了包名,请一并重建 `lib/`(`pnpm build`),不要手改 `lib/client.js`。
|
|
99
|
+
- **刚发版后 `dsh plugin add` 报 404。** 全新版本在 registry 读路径上需要几分钟才可见;`dist-tags` 与元数据通常先可用。稍后重试即可,不要重复发布。
|
|
100
|
+
- **通过镜像安装报 `ERR_PNPM_FETCH_404`。** npmmirror 等镜像同步新版本有自己的节奏。给这条命令加上 `--registry=https://registry.npmjs.org`,或等镜像同步。
|
|
101
|
+
- **pnpm 拒绝或询问刚发布的版本。** 这是 pnpm 的 `minimumReleaseAge` 延迟保护。放行该包(pnpm 会记录到 `minimumReleaseAgeExclude`)或等过这个时间窗口。
|
|
102
|
+
- **官方 profile 下品牌重复或冲突。** 内置的 `ui-brand-official` 只在 `DSH_CLIENT_BUILD_PROFILE === 'official'` 时占用同样的插槽。本地构建的 profile 不是 official,因此不会冲突;若你确实在跑 official profile,请二选一关闭。
|
|
103
|
+
- **标题行出现两个标题(品牌标题与官方标题并排)。** 说明当前 Harness 又改掉了标题行的 CSS Module 局部名,插件按设计退化而不是报错。提 issue 时附上 Harness 版本和那个 `<hash>_xxx` 局部名即可。
|
|
104
|
+
- **隐藏的页签或按钮又出现了。** 观察者会在重挂载后重新应用;只有类名后缀与本地化文案**同时**变化时插件才放弃隐藏(宁可保持可见,也不误隐藏别的元素)。
|
|
105
|
+
|
|
106
|
+
## 隐私与作用域
|
|
107
|
+
|
|
108
|
+
插件不发起任何网络请求、不读取会话内容、不上报遥测。它只做三件事:注册插槽占位、读写 `dsh-brand-deepseek` 设置命名空间、在会话页头部按设置隐藏两个 DOM 元素(轨迹页签、Session 日志按钮)。设置值保存在 Harness 的 profile 设置里,不离开本机。隐藏元素只影响渲染,轨迹数据与导出功能不受影响。
|
|
109
|
+
|
|
110
|
+
## 许可证
|
|
111
|
+
|
|
112
|
+
MIT —— 详见 `LICENSE`。
|
|
113
|
+
|
|
114
|
+
侧边栏的鲸鱼标志与 `DeepSeek` 字标复制自 DeepSeek 官网(deepseek.com)页头品牌 SVG,未作修改;DeepSeek 名称与标志是 DeepSeek(杭州深度求索人工智能基础技术研究有限公司)的商标,此处仅用于在插件里呈现官方产品的观感,MIT 许可证只覆盖本插件源码、不涉及这些标志。上游版权说明与商标声明见 `NOTICE`。
|
package/cordis.patch.yml
ADDED