dsh-multi-chat 1.0.2 → 1.0.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/README.md +7 -6
- package/README.zh.md +5 -4
- package/bin/dsh-multi-chat.mjs +33 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,8 +97,8 @@ dsh web --port 3084
|
|
|
97
97
|
Or manual:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
npm pack # produce a tarball (dsh-multi-chat-1.0.
|
|
101
|
-
dsh plugin --profile web add dsh-multi-chat-1.0.
|
|
100
|
+
npm pack # produce a tarball (dsh-multi-chat-1.0.3.tgz)
|
|
101
|
+
dsh plugin --profile web add dsh-multi-chat-1.0.3.tgz # DSH adds the package to the bundle layer stack automatically
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Uninstall (one command, nothing manual to clean up — restart `dsh web` to unload it):
|
|
@@ -143,7 +143,7 @@ Open that URL on your phone and enter the token to reach the full DSH UI. The ga
|
|
|
143
143
|
| **One-command (registry)** | `dsh plugin --profile web add dsh-multi-chat` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
144
144
|
| **npx (no download)** | `npx dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
145
145
|
| **Global CLI (npm)** | `npm i -g dsh-multi-chat` then `dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` then `npm rm -g dsh-multi-chat` |
|
|
146
|
-
| **Tarball (offline)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.
|
|
146
|
+
| **Tarball (offline)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.3.tgz` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
147
147
|
| **Git clone** | `node bin/dsh-multi-chat.mjs install` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
148
148
|
|
|
149
149
|
> `dsh plugin --profile web remove dsh-multi-chat` is the **single uninstall
|
|
@@ -153,11 +153,12 @@ Open that URL on your phone and enter the token to reach the full DSH UI. The ga
|
|
|
153
153
|
> Restart `dsh web` afterwards to unload the wall.
|
|
154
154
|
|
|
155
155
|
> **pnpm ≥ 11 gotcha**: pnpm 11's `minimumReleaseAge` supply-chain guard skips
|
|
156
|
-
> freshly published versions (
|
|
157
|
-
>
|
|
156
|
+
> freshly published versions (default cutoff: 1 day) and silently installs the
|
|
157
|
+
> newest "aged" release instead. If `dsh plugin --profile web add
|
|
158
158
|
> dsh-multi-chat` reports an older version than the latest, add
|
|
159
159
|
> `minimumReleaseAge: 0` to the profile's
|
|
160
|
-
> `~/.dsh/profiles/web/pnpm-workspace.yaml` and re-run the add.
|
|
160
|
+
> `~/.dsh/profiles/web/pnpm-workspace.yaml` and re-run the add. The bundled CLI
|
|
161
|
+
> (`npx dsh-multi-chat install`) writes that setting for you automatically.
|
|
161
162
|
|
|
162
163
|
The repo also bundles a cross-platform CLI, `dsh-multi-chat` (`bin/dsh-multi-chat.mjs`). Its `install` command probes `$DSH_HOME` (default `~/.dsh`), packs the package into the profile's `plugins/` folder, and runs `dsh plugin --profile web add <tarball>` (same behavior as `install-plugin.ps1`).
|
|
163
164
|
|
package/README.zh.md
CHANGED
|
@@ -97,8 +97,8 @@ dsh web --port 3084
|
|
|
97
97
|
或手动:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
npm pack # 得到 tarball (dsh-multi-chat-1.0.
|
|
101
|
-
dsh plugin --profile web add dsh-multi-chat-1.0.
|
|
100
|
+
npm pack # 得到 tarball (dsh-multi-chat-1.0.3.tgz)
|
|
101
|
+
dsh plugin --profile web add dsh-multi-chat-1.0.3.tgz # DSH 自动把包加入 bundle 层栈
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
卸载(一条命令,无需手动清理任何文件 —— 重启 `dsh web` 后生效):
|
|
@@ -143,7 +143,7 @@ dsh plugin --profile web remove dsh-multi-chat
|
|
|
143
143
|
| **一条命令(npm 官方源)** | `dsh plugin --profile web add dsh-multi-chat` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
144
144
|
| **npx(免下载)** | `npx dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
145
145
|
| **全局 CLI(npm)** | `npm i -g dsh-multi-chat` 然后 `dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` 然后 `npm rm -g dsh-multi-chat` |
|
|
146
|
-
| **Tarball(离线)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.
|
|
146
|
+
| **Tarball(离线)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.3.tgz` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
147
147
|
| **Git clone** | `node bin/dsh-multi-chat.mjs install` | `dsh plugin --profile web remove dsh-multi-chat` |
|
|
148
148
|
|
|
149
149
|
> `dsh plugin --profile web remove dsh-multi-chat` 是**所有渠道统一的卸载命令**:
|
|
@@ -151,9 +151,10 @@ dsh plugin --profile web remove dsh-multi-chat
|
|
|
151
151
|
> (层栈按已安装依赖实时调和,详见 `dsh plugin --help`)。之后重启 `dsh web` 卸载生效。
|
|
152
152
|
|
|
153
153
|
> **pnpm ≥ 11 注意**:pnpm 11 的 `minimumReleaseAge` 供应链保护会跳过刚发布的版本
|
|
154
|
-
>
|
|
154
|
+
> (默认阈值 1 天),静默回退到最新的「已过成熟期」版本。如果
|
|
155
155
|
> `dsh plugin --profile web add dsh-multi-chat` 装到的版本比最新版旧,请在
|
|
156
156
|
> `~/.dsh/profiles/web/pnpm-workspace.yaml` 里加上 `minimumReleaseAge: 0` 后重试。
|
|
157
|
+
> 自带 CLI(`npx dsh-multi-chat install`)会在安装时自动写入该设置。
|
|
157
158
|
|
|
158
159
|
仓库还内置了一个跨平台 CLI `dsh-multi-chat`(`bin/dsh-multi-chat.mjs`)。它的 `install` 命令会探测 `$DSH_HOME`(缺省 `~/.dsh`),把包打包进 profile 的 `plugins/` 目录,再执行 `dsh plugin --profile web add <tarball>`(与 `install-plugin.ps1` 行为一致)。
|
|
159
160
|
|
package/bin/dsh-multi-chat.mjs
CHANGED
|
@@ -126,9 +126,34 @@ Packs the dsh-multi-chat package and installs the tarball into the profile
|
|
|
126
126
|
with \`dsh plugin --profile <p> add\`. The package declares \`dsh.bundle.patch\`
|
|
127
127
|
(pointing at its own cordis.patch.yml), so DSH mounts it automatically as a
|
|
128
128
|
bundle layer — no manual profile patch is needed. Restart dsh web afterwards.
|
|
129
|
+
|
|
130
|
+
The install also writes \`minimumReleaseAge: 0\` into the profile's
|
|
131
|
+
pnpm-workspace.yaml (only if no explicit value is set): pnpm ≥ 11 filters
|
|
132
|
+
freshly published versions by default (1 day), which would otherwise make
|
|
133
|
+
\`dsh plugin --profile web add dsh-multi-chat\` silently fall back to an older
|
|
134
|
+
release. With the gate disabled, every registry install resolves the newest.
|
|
135
|
+
|
|
129
136
|
Uninstall with: dsh plugin --profile <p> remove dsh-multi-chat
|
|
130
137
|
`
|
|
131
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Ensure the profile's pnpm-workspace.yaml disables pnpm ≥ 11's
|
|
141
|
+
* minimumReleaseAge gate (default 1 day), so registry installs like
|
|
142
|
+
* `dsh plugin --profile web add dsh-multi-chat` always resolve the newest
|
|
143
|
+
* release instead of silently falling back to an older one. Respects an
|
|
144
|
+
* explicit user-set value; only writes when the key is absent.
|
|
145
|
+
*/
|
|
146
|
+
function ensureFreshReleasePolicy(profileDir) {
|
|
147
|
+
const wsFile = join(profileDir, 'pnpm-workspace.yaml')
|
|
148
|
+
const existing = existsSync(wsFile) ? readFileSync(wsFile, 'utf8') : null
|
|
149
|
+
if (existing !== null && /^\s*minimumReleaseAge\s*:/m.test(existing)) {
|
|
150
|
+
return false
|
|
151
|
+
}
|
|
152
|
+
const anchor = '\n# dsh-multi-chat: disable pnpm minimumReleaseAge so `dsh plugin add` always resolves the newest release\nminimumReleaseAge: 0\n'
|
|
153
|
+
writeFileSync(wsFile, `${existing ?? 'packages:\n - .\n'}${anchor}`, 'utf8')
|
|
154
|
+
return true
|
|
155
|
+
}
|
|
156
|
+
|
|
132
157
|
async function cmdInstall(args) {
|
|
133
158
|
let profile = 'web'
|
|
134
159
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -155,6 +180,14 @@ async function cmdInstall(args) {
|
|
|
155
180
|
process.stdout.write(`installing ${tarballName} into profile '${profile}'…\n`)
|
|
156
181
|
run('dsh', ['plugin', '--profile', profile, 'add', tarball])
|
|
157
182
|
|
|
183
|
+
// 3) disable pnpm's release-age gate for this profile so the registry
|
|
184
|
+
// one-liner (`dsh plugin --profile web add dsh-multi-chat`) — and every
|
|
185
|
+
// later add/update — resolves the newest version, not a stale fallback.
|
|
186
|
+
const profileDir = join(dshHome(), 'profiles', profile)
|
|
187
|
+
if (ensureFreshReleasePolicy(profileDir)) {
|
|
188
|
+
process.stdout.write(`disabled pnpm minimumReleaseAge in ${join(profileDir, 'pnpm-workspace.yaml')} — future registry installs resolve the newest version\n`)
|
|
189
|
+
}
|
|
190
|
+
|
|
158
191
|
process.stdout.write('\nDone. Restart dsh web to load the wall:\n')
|
|
159
192
|
process.stdout.write(' dsh web --port <n>\n')
|
|
160
193
|
}
|