dsh-multipane 1.0.22 → 1.0.23
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 +5 -0
- package/lib/client.js +49 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,11 @@ C:\Users\weiai\.dsh\plugin-src\_probe\sync-client.ps1 -Push # 台式机 ->
|
|
|
246
246
|
|
|
247
247
|
## 更新记录
|
|
248
248
|
|
|
249
|
+
### 1.0.23(2026-11-10)
|
|
250
|
+
- **接上市场「有会话在跑」的确认口子**:市场在检测到 agent 正在运行时会拒绝替换插件文件(保护那个会话),
|
|
251
|
+
但它同时留了 `confirmAgentsRunning` 这个「用户明确同意就放行」的开关。以前我们没带这个参数,
|
|
252
|
+
所以永远被挡。现在第一次会被拦,弹窗说明「有 N 个会话在跑,可能中途出错」,再点一次「仍然更新」就带同意标记重发。
|
|
253
|
+
|
|
249
254
|
### 1.0.22(2026-11-10)
|
|
250
255
|
- **插件自己维护「可安装版本清单」,用户再也不用碰命令行**:pnpm 对新版本有等待期,只有把版本号写进
|
|
251
256
|
`~/.dsh/profiles/<profile>/pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude` 才允许安装。
|
package/lib/client.js
CHANGED
|
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
*/
|
|
18
18
|
const PLUGIN_LABEL = "多栏视图";
|
|
19
19
|
/* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
|
|
20
|
-
const PLUGIN_VERSION = "1.0.
|
|
20
|
+
const PLUGIN_VERSION = "1.0.23";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
/* 插件市场的公开更新 API v1(dshmarket 提供,见其 UPDATE-API-V1.md)。
|
|
23
23
|
它自己负责装包/校验版本/回滚,我们只负责触发和显示结果——
|
|
@@ -6429,7 +6429,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6429
6429
|
latest: "",
|
|
6430
6430
|
forceHint: "",
|
|
6431
6431
|
progress: null,
|
|
6432
|
-
/*
|
|
6432
|
+
/* 市场因「有会话正在运行」拒绝时,进入待确认:用户再点一次即带 confirmAgentsRunning 强制继续 */
|
|
6433
|
+
agentsBusy: false,
|
|
6434
|
+
busyAgents: [],
|
|
6435
|
+
/* 上次检查的时刻:市场对新版本有缓存,显示出来用户才知道是查过旧的 */
|
|
6433
6436
|
checkedAt: ""
|
|
6434
6437
|
});
|
|
6435
6438
|
const closeModal = () => setUpdate((prev) => ({ ...prev, modal: false }));
|
|
@@ -6550,18 +6553,47 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6550
6553
|
autoChecked.current = true;
|
|
6551
6554
|
checkUpdate(true);
|
|
6552
6555
|
}, []);
|
|
6553
|
-
const runUpdate = async (force) => {
|
|
6554
|
-
setUpdate((prev) => ({ ...prev, phase: "updating", text: "正在更新…", canUpdate: false, progress: 0 }));
|
|
6556
|
+
const runUpdate = async (force, confirmAgents) => {
|
|
6557
|
+
setUpdate((prev) => ({ ...prev, phase: "updating", text: "正在更新…", canUpdate: false, progress: 0, agentsBusy: false }));
|
|
6555
6558
|
try {
|
|
6559
|
+
const payload = { packageName: PKG_NAME };
|
|
6560
|
+
if (force === true) payload.force = true;
|
|
6561
|
+
if (confirmAgents === true) payload.confirmAgentsRunning = true;
|
|
6556
6562
|
const res = await fetch(MARKET_UPDATES_URL, {
|
|
6557
6563
|
method: "POST",
|
|
6558
6564
|
headers: { "Content-Type": "application/json" },
|
|
6559
|
-
body: JSON.stringify(
|
|
6565
|
+
body: JSON.stringify(payload)
|
|
6560
6566
|
});
|
|
6567
|
+
if (res.status === 409) {
|
|
6568
|
+
/* 市场自己的规矩:有会话在跑时改插件文件会让那个会话中途出错。
|
|
6569
|
+
它留了「明确同意就放行」的口子(confirmAgentsRunning),
|
|
6570
|
+
所以这里不是死路——转成待确认,用户再点一次就带同意标记重发。 */
|
|
6571
|
+
let busy = null;
|
|
6572
|
+
try {
|
|
6573
|
+
busy = await res.json();
|
|
6574
|
+
} catch {
|
|
6575
|
+
/* 忽略 */
|
|
6576
|
+
}
|
|
6577
|
+
if (busy !== null && busy !== void 0 && busy.agentsBusy === true) {
|
|
6578
|
+
const list = Array.isArray(busy.runningAgents) ? busy.runningAgents : [];
|
|
6579
|
+
setUpdate((prev) => ({
|
|
6580
|
+
...prev,
|
|
6581
|
+
phase: "available",
|
|
6582
|
+
canUpdate: true,
|
|
6583
|
+
progress: null,
|
|
6584
|
+
agentsBusy: true,
|
|
6585
|
+
busyAgents: list,
|
|
6586
|
+
forceHint: `现在有 ${list.length || 1} 个会话正在运行。更新会替换插件文件,那个会话可能在半路读到新旧混着的代码而报错。确定要继续,就再点一次「仍然更新」。`
|
|
6587
|
+
}));
|
|
6588
|
+
return;
|
|
6589
|
+
}
|
|
6590
|
+
throw new Error("HTTP 409");
|
|
6591
|
+
}
|
|
6561
6592
|
if (res.status !== 202) {
|
|
6562
6593
|
let detail = "";
|
|
6563
6594
|
try {
|
|
6564
|
-
|
|
6595
|
+
const body = await res.json();
|
|
6596
|
+
detail = String(body.message ?? body.error ?? "");
|
|
6565
6597
|
} catch {
|
|
6566
6598
|
/* 忽略 */
|
|
6567
6599
|
}
|
|
@@ -6982,9 +7014,18 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6982
7014
|
type: "button",
|
|
6983
7015
|
"data-primary": "1",
|
|
6984
7016
|
disabled: update.phase === "updating",
|
|
6985
|
-
onClick: () =>
|
|
7017
|
+
onClick: () =>
|
|
7018
|
+
update.canUpdate === true
|
|
7019
|
+
? runUpdate(false, update.agentsBusy === true)
|
|
7020
|
+
: checkUpdate()
|
|
6986
7021
|
},
|
|
6987
|
-
update.phase === "updating"
|
|
7022
|
+
update.phase === "updating"
|
|
7023
|
+
? "更新中…"
|
|
7024
|
+
: update.agentsBusy === true
|
|
7025
|
+
? "仍然更新"
|
|
7026
|
+
: update.canUpdate === true
|
|
7027
|
+
? "立即更新"
|
|
7028
|
+
: "重新检查"
|
|
6988
7029
|
)
|
|
6989
7030
|
]
|
|
6990
7031
|
)
|
package/package.json
CHANGED