dsh-multipane 1.0.23 → 1.0.24
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 +55 -10
- 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.24(2026-11-10)
|
|
250
|
+
- **市场缓存旧时自动重查一次**:市场对同一 URL 有服务端缓存,刚到新版本时第一次查可能还是旧值。
|
|
251
|
+
现在发现 npm 上更新且市场说「已最新」时,会当场换时间戳重查一次——拿到就直接弹更新框,
|
|
252
|
+
不用再让用户手动点第二次。仍然拿不到才显示「市场还没放行,稍后再点一次」。
|
|
253
|
+
|
|
249
254
|
### 1.0.23(2026-11-10)
|
|
250
255
|
- **接上市场「有会话在跑」的确认口子**:市场在检测到 agent 正在运行时会拒绝替换插件文件(保护那个会话),
|
|
251
256
|
但它同时留了 `confirmAgentsRunning` 这个「用户明确同意就放行」的开关。以前我们没带这个参数,
|
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.24";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
/* 插件市场的公开更新 API v1(dshmarket 提供,见其 UPDATE-API-V1.md)。
|
|
23
23
|
它自己负责装包/校验版本/回滚,我们只负责触发和显示结果——
|
|
@@ -6494,25 +6494,70 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6494
6494
|
checkedAt: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })
|
|
6495
6495
|
});
|
|
6496
6496
|
} else {
|
|
6497
|
-
/*
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6497
|
+
/* 市场说「已最新」不代表真的没新版:它自己的同步比 npm registry 慢,
|
|
6498
|
+
而且对同一 URL 有服务端缓存。这里先问 registry,如果那边确实更新,
|
|
6499
|
+
**当场再查一次市场**(换时间戳绕过缓存)—— 拿到了就直接弹更新框,
|
|
6500
|
+
省掉「用户点两次」;拿不到才提示「市场还没同步」。 */
|
|
6501
|
+
const stamp = () => new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" });
|
|
6502
|
+
let regLatest = "";
|
|
6501
6503
|
try {
|
|
6502
6504
|
const regRes = await fetch(`${NPM_LATEST_URL}?t=${Date.now()}`, { cache: "no-store" });
|
|
6503
6505
|
if (regRes.ok === true) {
|
|
6504
6506
|
const regData = await regRes.json();
|
|
6505
|
-
|
|
6506
|
-
if (regLatest !== "" && compareVersion(regLatest, installed) > 0) {
|
|
6507
|
-
lagNote = `;npm 上已有 ${regLatest},插件市场还没同步(通常要 20 分钟左右),稍后再点一次`;
|
|
6508
|
-
}
|
|
6507
|
+
regLatest = String((regData && regData.version) || "");
|
|
6509
6508
|
}
|
|
6510
6509
|
} catch {
|
|
6511
6510
|
/* 忽略:查不到 registry 就只报市场的结果 */
|
|
6512
6511
|
}
|
|
6512
|
+
if (regLatest !== "" && compareVersion(regLatest, installed) > 0) {
|
|
6513
|
+
let retryInfo = null;
|
|
6514
|
+
try {
|
|
6515
|
+
const retry = await fetch(
|
|
6516
|
+
`${MARKET_UPDATES_URL}?name=${PKG_NAME}&force=1&t=${Date.now()}-retry`,
|
|
6517
|
+
{ cache: "no-store" }
|
|
6518
|
+
);
|
|
6519
|
+
if (retry.ok === true) {
|
|
6520
|
+
const retryData = await retry.json();
|
|
6521
|
+
retryInfo = retryData === null || retryData === void 0 ? null : retryData.package;
|
|
6522
|
+
}
|
|
6523
|
+
} catch {
|
|
6524
|
+
/* 忽略 */
|
|
6525
|
+
}
|
|
6526
|
+
if (retryInfo !== null && retryInfo.updateAvailable === true) {
|
|
6527
|
+
/* 第二次查到了:直接给可更新状态(不用用户再点一遍) */
|
|
6528
|
+
const retryLatest = String(retryInfo.latestVersion ?? regLatest);
|
|
6529
|
+
setUpdate({
|
|
6530
|
+
phase: "available",
|
|
6531
|
+
text: `发现新版本 ${retryLatest}`,
|
|
6532
|
+
canUpdate: true,
|
|
6533
|
+
opId: "",
|
|
6534
|
+
modal: true,
|
|
6535
|
+
installed,
|
|
6536
|
+
latest: retryLatest,
|
|
6537
|
+
forceHint: "",
|
|
6538
|
+
progress: null,
|
|
6539
|
+
agentsBusy: false,
|
|
6540
|
+
busyAgents: [],
|
|
6541
|
+
checkedAt: stamp()
|
|
6542
|
+
});
|
|
6543
|
+
return;
|
|
6544
|
+
}
|
|
6545
|
+
setUpdate({
|
|
6546
|
+
phase: "latest",
|
|
6547
|
+
text: `已是最新版本(${installed},${stamp()} 检查);npm 上已有 ${regLatest},插件市场还没放行,稍后再点一次`,
|
|
6548
|
+
canUpdate: false,
|
|
6549
|
+
opId: "",
|
|
6550
|
+
modal: false,
|
|
6551
|
+
installed,
|
|
6552
|
+
latest,
|
|
6553
|
+
forceHint: "",
|
|
6554
|
+
progress: null
|
|
6555
|
+
});
|
|
6556
|
+
return;
|
|
6557
|
+
}
|
|
6513
6558
|
setUpdate({
|
|
6514
6559
|
phase: "latest",
|
|
6515
|
-
text: `已是最新版本(${installed},${
|
|
6560
|
+
text: `已是最新版本(${installed},${stamp()} 检查)`,
|
|
6516
6561
|
canUpdate: false,
|
|
6517
6562
|
opId: "",
|
|
6518
6563
|
modal: false,
|
package/package.json
CHANGED