dsh-background-by-model 0.4.5 → 0.5.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
@@ -99,23 +99,15 @@ One interface, one config — only the current model differs:
99
99
  - **Conversation & Trajectory** — The message list is wrapped in a translucent card automatically, and the trajectory page gets whole-page opacity & blur controls, letting the wallpaper shine through the content.
100
100
  - **Right Panel** — The column that slides in from the right when you open a file now has a card of its own: its opacity follows **Main background** until you drag it (then this card owns it), and its blur stacks on top of the main-background blur. While closed it takes no space and costs nothing.
101
101
 
102
- ### Host check (Config tab)
103
-
104
- - **Every host interface, evaluated against the build you are running** — The plugin re-emits the host's design tokens, hangs backdrop filters on the host's structural elements and reads the host's session/model services; each of those is a contract with a dsh release, and each can be renamed without an error. The check reports, per point, whether it holds, what its loss looks like on screen, the literal it depends on, the host file that should define it and the plugin file that reads it.
105
- - **Three states, honestly** — *ok* (the host still provides it), *n/a* (it cannot be observed from here right now — the chat view is off screen while the settings dialog is open, the file-preview panel is not in the DOM until a file has been opened) and *broken* (it is gone while the surface that uses it is on screen). Only the third is a failure.
106
- - **Copy diagnostics** — One click copies both halves (the live probe and the offline scan of the installed files) as markdown, ready to paste into an issue.
107
- - **Offline equivalent** — `pnpm scan` runs the same contract table against the installed packages with no browser, and exits non-zero when a target is gone. Use it right after upgrading dsh.
108
-
109
102
  ## Settings
110
103
 
111
- Settings → **Theme** now has four tabs:
104
+ Settings → **Theme** now has three tabs:
112
105
 
113
106
  | Tab | Scope | Contents |
114
107
  | --- | --- | --- |
115
108
  | **Interface** | Global, shared by every model | Opacity & blur for the main background, left panel, right panel, cards & panels, input & controls, settings panel, conversation text box and trajectory page |
116
109
  | **Model Background** | Per rule | The ordered rule list, the live match readout, and each rule's wallpaper, theme color, layout mode, framing, opacity and blur |
117
110
  | **Config** | — | Import / export the whole rule set (`dsh-background-by-model-theme.json`) |
118
- | **Host check** | — | Every host interface this plugin depends on, evaluated against the running dsh: what holds, what broke, and a copyable report |
119
111
 
120
112
  The old **Color** tab is gone — the theme color is now a property of each rule. The old **Background** tab became **Model Background**.
121
113
 
@@ -188,17 +180,7 @@ To mount a working copy into a profile instead, add it to the profile's `package
188
180
 
189
181
  After changing anything under `src/`, run `pnpm run bundle` again — the mounted profile loads `lib/`, so edits do not take effect until the bundle is rebuilt.
190
182
 
191
- ### Checking a new dsh release
192
-
193
- The plugin talks to dsh through a small, explicit set of host interfaces (see [`src/host-contracts.ts`](src/host-contracts.ts)). After upgrading dsh, check them before wondering why something looks off:
194
-
195
- ```sh
196
- pnpm run bundle
197
- pnpm run scan # offline: fails when a contract target vanished from the installed dsh
198
- pnpm test # the contract table, the live probe's logic, the UI stylesheet, the version floor
199
- ```
200
-
201
- `pnpm scan` accepts `--host <dir>` (the `node_modules` directory holding `@deepseek-ai/dsh-app-boot`) and `--json`. The same check runs inside the app, against the live interface, on Settings → **Host check**.
183
+ `pnpm test` builds and typechecks (`tsdown && tsc -p tsconfig.json`).
202
184
 
203
185
  ## Compatibility
204
186
 
@@ -225,6 +207,10 @@ No. Both were removed in 0.3.0; each rule uses a static image.
225
207
 
226
208
  ## Recent Optimizations
227
209
 
210
+ ### v0.5.0
211
+
212
+ - **The host self-check is gone.** Removed together with everything that fed it: the settings page's **Host check** tab, the contract table (`src/host-contracts.ts`), the browser probe (`src/client/judge.ts`), the installed-file scan (`src/host-scan.ts`), the `hostCheck` RPC, the `pnpm scan` script and its test suite. The plugin keeps only what it does: rules, wallpapers and interface opacity/blur. What it cost to remove is in the diff — 28 contracts, three consumers and a report format, none of which ever agreed with reality for long enough to be worth the red lines it printed on a healthy host.
213
+
228
214
  ### v0.4.5
229
215
 
230
216
  - **`optionalWhen` finally means what its name says** — The field is documented as "the check runs while this surface is on screen", but the probe was evaluating the exact opposite: an anchor that was *not* in the DOM produced *n/a*, and one that *was* produced the failure. Two of the three dock contracts and both conversation-view contracts were therefore testing the wrong state — which is how a healthy dock came back as `停靠空位 失效` with "no element matches `[data-dockkit-empty]`". The helper now reads the anchor as a positive predicate, and every anchor was renamed to say what it means (`dockHasTab`, `dockHasNoTab`, `chatHasMessages`, `paneFloated`, …) so an anchor named for an absence can no longer invert a check silently. Four tests pin the resulting state table in both directions.
package/README.zh.md CHANGED
@@ -99,23 +99,15 @@
99
99
  - **对话与轨迹页** — 消息列表自动包裹为半透明卡片,轨迹页可整页调节透明度与模糊,让壁纸从内容后方透出来。
100
100
  - **右侧栏** — 点开文件后从右侧滑出的那一栏有了自己的卡片:透明度默认跟随「主背景」(拖动后本卡片接管),模糊则在主背景模糊之上再叠加;关闭时不占位置、无副作用。
101
101
 
102
- ### 宿主自检(「宿主自检」页)
103
-
104
- - **逐条检查插件依赖的宿主接口** — 本插件会重新发出宿主的设计令牌、把毛玻璃挂在宿主的界面元素上、并读取宿主的会话与模型服务;这些每一条都是与某个 dsh 版本之间的约定,而任何一条被改名都不会报错。自检会逐条给出:是否仍然成立、失效时界面上会是什么样子、依赖的那个字面量、本应由哪个宿主文件定义、以及本插件哪个文件在读取它。
105
- - **三种状态,如实报告** — *正常*(宿主仍然提供)、*未观察*(当前无法从界面上看到:设置弹窗打开时对话页不在屏幕上,没开过文件时右侧栏也不在 DOM 里)、*失效*(界面在屏幕上,但接口已经没了)。只有第三种算故障。
106
- - **复制诊断报告** — 一键把两侧结果(实时探测 + 对安装目录的离线扫描)合并成一份 markdown,直接贴进 issue 即可。
107
- - **离线等价物** — `pnpm scan` 用同一张约定表检查已安装的包,不需要浏览器;一旦某个目标消失就以非零码退出。升级 dsh 后先跑它。
108
-
109
102
  ## 设置界面
110
103
 
111
- 设置的 **「主题」** 分类下现在有四个选项卡:
104
+ 设置的 **「主题」** 分类下现在有三个选项卡:
112
105
 
113
106
  | 选项卡 | 作用范围 | 内容 |
114
107
  | --- | --- | --- |
115
108
  | **界面** | 全局,所有模型共用 | 主背景、左侧栏、右侧栏、卡片面板、输入框与控件、设置面板、对话文本框、轨迹页的透明度与模糊度 |
116
109
  | **模型背景** | 每条规则 | 有序规则列表、顶部实时状态,以及每条规则的壁纸、主题色、布局模式、取景、透明度与模糊度 |
117
110
  | **配置** | — | 导入 / 导出整套规则(`dsh-background-by-model-theme.json`) |
118
- | **宿主自检** | — | 逐条检查本插件依赖的宿主接口在当前 dsh 上是否仍然成立,并给出可复制的诊断报告 |
119
111
 
120
112
  原先的 **「色彩」** 选项卡已删除——主题色改为每条规则自己的属性;原 **「背景」** 选项卡已改造成 **「模型背景」**。
121
113
 
@@ -188,17 +180,7 @@ pnpm run typecheck
188
180
 
189
181
  改完 `src/` 必须重新执行 `pnpm run bundle` 才会生效——挂载的 profile 加载的是 `lib/`。
190
182
 
191
- ### 升级 dsh 后怎么查
192
-
193
- 插件与 dsh 之间只通过一张明确列出的接口清单通信(见 [`src/host-contracts.ts`](src/host-contracts.ts))。升级 dsh 之后,先查它,再怀疑别的地方:
194
-
195
- ```sh
196
- pnpm run bundle
197
- pnpm run scan # 离线:某个约定目标从已安装的 dsh 里消失就以非零码退出
198
- pnpm test # 约定表、实时探测逻辑、界面样式表、版本下限
199
- ```
200
-
201
- `pnpm scan` 支持 `--host <dir>`(含 `@deepseek-ai/dsh-app-boot` 的 `node_modules` 目录)与 `--json`。同一套检查也在应用内运行:设置 → **宿主自检**,对着真实界面跑。
183
+ `pnpm test` 会构建并做类型检查(`tsdown && tsc -p tsconfig.json`)。
202
184
 
203
185
  ## 兼容性
204
186
 
@@ -225,6 +207,10 @@ pnpm test # 约定表、实时探测逻辑、界面样式表、版本下
225
207
 
226
208
  ## 近期优化
227
209
 
210
+ ### v0.5.0
211
+
212
+ - **宿主自检整块删掉了。** 连同它的一切:设置页的 **「宿主自检」** 选项卡、约定表(`src/host-contracts.ts`)、浏览器探测(`src/client/judge.ts`)、安装目录扫描(`src/host-scan.ts`)、`hostCheck` RPC、`pnpm scan` 脚本以及它的测试。插件只留下它真正做的事:规则、壁纸、界面透明度与模糊。删掉它的代价就在 diff 里 —— 28 条约定、三处消费方、一套报告格式,而这些东西从来没有哪一版能跟现实对上足够久,值得它在健康宿主上打出的那些红字。
213
+
228
214
  ### v0.4.5
229
215
 
230
216
  - **`optionalWhen` 终于按它名字的意思工作了** — 这个字段的文档写着「只有当这块界面在屏幕上时才检查」,但探测实现的是**反过来的**:锚点**不在** DOM 里时反而报 *未观察*,锚点**在**时才会去报失效。于是三条停靠约定里的两条、以及两条对话视图约定,全都在检查错误的状态 —— 这就是健康的停靠栏会报出「停靠空位 失效 / no element matches `[data-dockkit-empty]`」的原因。现在这个辅助函数把锚点当作**正向断言**来读,并且把所有锚点改名成它们真正的含义(`dockHasTab`、`dockHasNoTab`、`chatHasMessages`、`paneFloated` …),这样「用缺席来命名」的锚点再也不可能悄悄把检查反过来。四个测试把由此得到的状态表两个方向都钉住了。