dsh-baize-rules 0.1.3 → 0.1.5
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 +31 -1
- package/README.zh.md +27 -1
- package/lib/client.js +21 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# dsh-baize-rules
|
|
2
2
|
|
|
3
|
+
**[English](README.md) | [简体中文](README.zh.md)** — 中文说明见 [README.zh.md](README.zh.md)。
|
|
4
|
+
|
|
5
|
+
[](https://dsh-plugin.org/plugins/bvcvb/dsh-baize-rules)
|
|
3
6
|

|
|
4
7
|

|
|
5
8
|
|
|
@@ -32,13 +35,40 @@ The name comes from **Baize (白泽)** — a mythical beast said to "understand
|
|
|
32
35
|
|
|
33
36
|
```bash
|
|
34
37
|
# Install from npm into the web profile (use the actual published version)
|
|
35
|
-
dsh plugin --profile web add dsh-baize-rules@0.1.
|
|
38
|
+
dsh plugin --profile web add dsh-baize-rules@0.1.5
|
|
36
39
|
pm2 restart dsh # Reload when dsh is managed by pm2
|
|
37
40
|
dsh --profile web
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
Peer dependencies (`@deepseek-ai/*`, `react`, etc.) are provided by the dsh profile; if any are missing, pnpm resolves them against `peerDependencies` in the profile directory.
|
|
41
44
|
|
|
45
|
+
### Uninstall
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Remove the plugin from the profile
|
|
49
|
+
dsh plugin --profile web remove dsh-baize-rules
|
|
50
|
+
pm2 restart dsh # Reload when dsh is managed by pm2
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the entry lingers in the profile's `dsh.profile.bundles`, delete that line from
|
|
54
|
+
`$DSH_HOME/profiles/web/package.json` and restart dsh again. Your rule files under
|
|
55
|
+
`$DSH_HOME/rules/` are not touched — delete them by hand if you want a clean slate.
|
|
56
|
+
|
|
57
|
+
### Try it without touching your running setup
|
|
58
|
+
|
|
59
|
+
Install into a **separate profile** so your currently running dsh stays unchanged:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dsh plugin --profile smoke add dsh-baize-rules@0.1.5
|
|
63
|
+
dsh --profile smoke --dump-config # read & compose the config only — does not boot dsh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`--dump-config` only composes and prints the tree; it does not start a server, so it is safe to run
|
|
67
|
+
alongside your live dsh. To actually try the plugin in that profile, run `dsh --profile smoke`.
|
|
68
|
+
|
|
69
|
+
> Note on `pm2 restart dsh`: it reloads the profile you are running. Install/remove only changes the
|
|
70
|
+
> profile on disk — nothing takes effect until the next boot (or that restart).
|
|
71
|
+
|
|
42
72
|
### Local development (link)
|
|
43
73
|
|
|
44
74
|
If you haven't published yet, or want to pick up source changes live, use this directory as a link dependency:
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# dsh-baize-rules
|
|
2
2
|
|
|
3
|
+
**[English](README.md) | 简体中文**
|
|
4
|
+
|
|
5
|
+
[](https://dsh-plugin.org/plugins/bvcvb/dsh-baize-rules)
|
|
3
6
|

|
|
4
7
|

|
|
5
8
|
|
|
@@ -32,13 +35,36 @@
|
|
|
32
35
|
|
|
33
36
|
```bash
|
|
34
37
|
# 从 npm 安装到 web profile(版本以发布后的实际版本为准)
|
|
35
|
-
dsh plugin --profile web add dsh-baize-rules@0.1.
|
|
38
|
+
dsh plugin --profile web add dsh-baize-rules@0.1.5
|
|
36
39
|
pm2 restart dsh # dsh 由 pm2 托管时重载生效
|
|
37
40
|
dsh --profile web
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
安装时依赖的 peer 包(`@deepseek-ai/` 系列、`react` 等)由 dsh profile 提供;若缺少,pnpm 会在 profile 目录里按 `peerDependencies` 解析。
|
|
41
44
|
|
|
45
|
+
### 卸载
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 从 profile 移除插件
|
|
49
|
+
dsh plugin --profile web remove dsh-baize-rules
|
|
50
|
+
pm2 restart dsh # dsh 由 pm2 托管时重载生效
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
若 `dsh.profile.bundles` 里仍残留该条目,删掉 `$DSH_HOME/profiles/web/package.json` 中对应那一行后再重启一次。`$DSH_HOME/rules/` 下的规则文件不会被删除——想要干净重来请自行删除。
|
|
54
|
+
|
|
55
|
+
### 不影响正在运行的 dsh 试装
|
|
56
|
+
|
|
57
|
+
装到**另一个 profile**,正在运行的 dsh 完全不受影响:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
dsh plugin --profile smoke add dsh-baize-rules@0.1.5
|
|
61
|
+
dsh --profile smoke --dump-config # 只读取并组合配置,不会启动 dsh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`--dump-config` 只组合并打印配置树、不启动服务,所以可安全地与正在运行的 dsh 并存。要在那个 profile 里真正试用,再执行 `dsh --profile smoke`。
|
|
65
|
+
|
|
66
|
+
> 关于 `pm2 restart dsh`:它会重载你正在运行的那个 profile。安装/卸载只改磁盘上的 profile,**下一次启动(或那次重启)才生效**。
|
|
67
|
+
|
|
42
68
|
### 本地开发联调(link)
|
|
43
69
|
|
|
44
70
|
尚未发布或想改源码即时生效时,用本目录作为 link 依赖:
|
package/lib/client.js
CHANGED
|
@@ -74,6 +74,27 @@ window.__ModuleLoader__.load({
|
|
|
74
74
|
|
|
75
75
|
// --- Themed CSS (mirrors dsh-mneme's .mneme-trigger) + a themed rules icon. ---
|
|
76
76
|
const RULES_CSS = [
|
|
77
|
+
// Sidebar-foot layout fix. The shell renders `sidebar.footer.action` as a
|
|
78
|
+
// nowrap horizontal flex row (`.footerActions{display:flex}`, width 100%),
|
|
79
|
+
// but every entry registered there is a *full-width foot row*: Baize's
|
|
80
|
+
// `.baize-trigger` is `width:calc(100% + 4px); flex:none` (copied from
|
|
81
|
+
// dsh-mneme's `.mneme-trigger`), and the wallet's ring is `width:100%`.
|
|
82
|
+
// Two such rows in one unshrinkable strip overflow the column and push the
|
|
83
|
+
// later entry (this button) outside the sidebar, so the strip must stack:
|
|
84
|
+
// one plugin entry per row, each directly above Settings.
|
|
85
|
+
//
|
|
86
|
+
// Two rules, because changing a host container from a plugin is only safe
|
|
87
|
+
// when it is *certainly* the right container. The first pins the shell's own
|
|
88
|
+
// strip by its CSS-Modules name fragment, which CSS Modules keeps verbatim
|
|
89
|
+
// (`hHd-Xa_footerActions`), so no other element can match it. The second is
|
|
90
|
+
// the class-name-independent fallback: the slot renderer mounts list entries
|
|
91
|
+
// in a Fragment and the per-entry error boundary renders children directly,
|
|
92
|
+
// so this button is a DIRECT child of the strip — `:has(> …)` then pinpoints
|
|
93
|
+
// it even if the shell renames its class. Either rule fails *silently*: the
|
|
94
|
+
// old inline behaviour just returns. The `:not(.baize-rail)` guard leaves
|
|
95
|
+
// the collapsed 56px rail an even row of circular icons.
|
|
96
|
+
'div[class*="footerActions"]:has(.baize-trigger:not(.baize-rail)){flex-direction:column;align-items:stretch}',
|
|
97
|
+
'div:has(> .baize-trigger:not(.baize-rail)){flex-direction:column;align-items:stretch}',
|
|
77
98
|
'.baize-trigger{box-sizing:border-box;cursor:pointer;width:calc(100% + 4px);height:42px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:12px;flex:none;align-items:center;gap:8px;margin:4px -2px;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}',
|
|
78
99
|
'.baize-trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
79
100
|
'.baize-trigger.baize-rail{border-radius:50%;justify-content:center;gap:0;width:36px;height:36px;margin:8px 0 10px;padding:0}',
|
package/package.json
CHANGED