dsh-vscode-mode 0.15.7 → 0.15.8

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
@@ -465,13 +465,13 @@ profile 请替换为实际目标,不要把示例目录当成当前运行 profi
465
465
 
466
466
  ```bash
467
467
  # ① Git 安装(clone + prepare 构建;推荐打固定 tag)
468
- dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.15.7
468
+ dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.15.8
469
469
 
470
470
  # ② npm 注册表(发布到 npm 后)
471
471
  dsh plugin --profile web add dsh-vscode-mode@0.15.7
472
472
 
473
473
  # ③ GitHub Release tgz 直装(Release asset 可用后)
474
- dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.15.7/dsh-vscode-mode-0.15.7.tgz
474
+ dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.15.8/dsh-vscode-mode-0.15.8.tgz
475
475
  ```
476
476
 
477
477
  > **DSH 版本政策(0.14.10 起)**:六项 DSH peer 统一声明为 `*`,不再维护逐版
@@ -809,6 +809,7 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
809
809
  完整变更见 [GitHub Releases](https://github.com/Lenonss/DSH_VsCodeMode/releases)。
810
810
  近期关键版本:
811
811
 
812
+ - **v0.15.8**:**跨端「会话不存在」兼容**——桌面端与 Web 端各自运行独立 DSH 实例、会话列表互通但会话仅在一端激活时,另一端文件编辑器不再卡在「文件加载失败:会话不存在 0%」:中央区显示「会话在当前端不可用」终态提示(说明成因、保留重试),资源管理器红条同样替换为友好文案。host 三处会话前置错误文案收敛为 shared 常量,client 按常量识别归类。详见 [0.15.8 发布说明](docs/release-0.15.8.md)。
812
813
  - **v0.15.7**:**Lua 成员链跳转与枚举引用**——规避 EmmyLua 标识符词边界解析问题,从引用结果推导跨文件声明;Lua 表字面量枚举键 Ctrl+点击打开引用 Peek,使用处仍按原生定义跳转。真实 GUI 点击尚未完成验收,用户接受此缺口;发布不自动安装或重启当前实例,详见 [0.15.7 发布说明](docs/release-0.15.7.md)。
813
814
  - **v0.15.6**:**统一 SVN 项目更新入口**——资源管理器顶部 ↓ 与 SVN 变更页全局 ↓ 均打开插件自带 SVN 更新窗口,目标为当前项目根目录;非 SVN、能力未知或 CLI 不可用时不显示虚假的 SVN 读取提示。保留只读远端检查与本地刷新;本次真实 GUI 未验证,用户已接受此发布缺口,不自动安装或重启,详见 [0.15.6 发布说明](docs/release-0.15.6.md)。
814
815
 
package/lib/client.js CHANGED
@@ -2765,6 +2765,13 @@ window.__ModuleLoader__.load({
2765
2765
  /** PDF 统一 MIME(host base64 响应与 client PDF 面板同源,避免两处漂移)。 */
2766
2766
  const PDF_MIME = "application/pdf";
2767
2767
  /**
2768
+ * 会话级前置错误的规范文案:host requireSession 系与 client 错误识别共用同一常量,
2769
+ * 避免文案漂移导致 client 端分类失效。跨端场景(桌面端/Web 端各自运行独立 DSH 实例、
2770
+ * 会话列表互通但会话仅在一端激活)下,本端 host 取不到会话即返回「会话不存在」。
2771
+ * @author ddj 2026年10月16号
2772
+ */
2773
+ const SESSION_MISSING_ERROR = "会话不存在";
2774
+ /**
2768
2775
  * 路径 → 二进制预览 MIME:PDF 特判 {@link PDF_MIME},其余走图片表回退 octet-stream。
2769
2776
  * @author ddj 2026年09月22号
2770
2777
  * @param path 文件路径(`/` 或 `\` 分隔均可)
@@ -22046,6 +22053,41 @@ window.__ModuleLoader__.load({
22046
22053
  return uriPath ? decodeURIComponent(String(uriPath).replace(/^\//, "")) : null;
22047
22054
  }
22048
22055
  //#endregion
22056
+ //#region src/client/sessionError.ts
22057
+ /**
22058
+ * dsh-vscode-mode client — 会话缺失错误识别与友好文案。
22059
+ * 跨端场景:桌面端与 Web 端各自运行独立 DSH 实例,会话列表跨实例可见,
22060
+ * 但会话仅在一端激活;另一端发起的 edrv.* RPC 会被 host requireSession
22061
+ * 以「会话不存在」拒绝。此处把该错误归类为终态提示(非反复重试可解),
22062
+ * 并给出引导文案,替代裸错误卡死观感。
22063
+ * 作者 ddj 2026年10月16号
22064
+ */
22065
+ /**
22066
+ * 判断错误文案是否为「会话不存在」类错误。
22067
+ * @author ddj 2026年10月16号
22068
+ * @param text 任意错误文本(host 业务 error、异常 message 等原始形态)
22069
+ * @returns 命中规范文案(含拼接形态,如「会话不存在:路径」)返回 true;空值安全
22070
+ */
22071
+ function isSessionMissingError(text) {
22072
+ return String(text ?? "").includes(SESSION_MISSING_ERROR);
22073
+ }
22074
+ /**
22075
+ * 会话缺失提示标题(编辑区终态面板与侧栏红条共用)。
22076
+ * @author ddj 2026年10月16号
22077
+ * @returns 简短标题文案
22078
+ */
22079
+ function sessionMissingTitle() {
22080
+ return "会话在当前端不可用";
22081
+ }
22082
+ /**
22083
+ * 会话缺失提示详情:说明成因并给出引导(去持有端查看,或在本端打开会话后重试)。
22084
+ * @author ddj 2026年10月16号
22085
+ * @returns 多句详情文案
22086
+ */
22087
+ function sessionMissingDetail() {
22088
+ return "该会话可能正被其他 DSH 实例(桌面端 / Web 端)占用,或尚未在当前实例激活。请在持有该会话的一端查看,或在本端打开该会话后重试。";
22089
+ }
22090
+ //#endregion
22049
22091
  //#region src/client/ui/EditorView.ts
22050
22092
  /**
22051
22093
  * dsh-vscode-mode client — EditorView:中央 VSCode 式文件编辑器(编排层)。
@@ -26403,6 +26445,26 @@ window.__ModuleLoader__.load({
26403
26445
  }
26404
26446
  }, "重试"));
26405
26447
  else if (!active) body = react.default.createElement("div", { className: "edrv-empty" }, react.default.createElement("div", null, "暂无打开的文件"), react.default.createElement("div", { style: { fontSize: 12 } }, "使用右上搜索框 (" + (chordOf("edrv.quickOpen") ?? "Ctrl+P") + ") 打开工作区文件;" + (chordOf("edrv.showCommands") ?? "Ctrl+Shift+P") + " 打开命令栏;agent 修改文件后顶部会出现差异角标"));
26448
+ else if (content === null && loadError && isSessionMissingError(loadError)) body = react.default.createElement("div", {
26449
+ className: "edrv-empty edrv-loading",
26450
+ "aria-live": "polite"
26451
+ }, react.default.createElement("div", { className: "edrv-loading-title" }, sessionMissingTitle()), react.default.createElement("div", { style: {
26452
+ fontSize: 12,
26453
+ maxWidth: 420,
26454
+ lineHeight: 1.6
26455
+ } }, sessionMissingDetail()), react.default.createElement("button", {
26456
+ className: "edrv-pill edrv-pill-ghost",
26457
+ onClick: () => {
26458
+ setLoadError(null);
26459
+ setContent(null);
26460
+ setContentPath(null);
26461
+ setLoadStage({
26462
+ progress: 10,
26463
+ message: "重新读取文件…"
26464
+ });
26465
+ loadContent(active, sessionId);
26466
+ }
26467
+ }, "重试"));
26406
26468
  else if (content === null && loadError) body = loadingBody("文件加载失败:" + loadError, 0, () => {
26407
26469
  setLoadError(null);
26408
26470
  setContent(null);
@@ -32780,7 +32842,9 @@ window.__ModuleLoader__.load({
32780
32842
  }
32781
32843
  const updateHint = !ctx?.svn?.svnCli ? "SVN CLI 不可用" : !ctx?.openSvnUpdate ? "SVN 更新窗口不可用" : "更新项目(打开 SVN 更新窗口)";
32782
32844
  const errorList = Object.entries(errors);
32783
- const errorText = errorList.length ? errorList[0][1] : null;
32845
+ const rawErrorText = errorList.length ? errorList[0][1] : null;
32846
+ const sessionMissing = isSessionMissingError(rawErrorText);
32847
+ const errorText = rawErrorText === null ? null : sessionMissing ? sessionMissingTitle() + ":" + sessionMissingDetail() : rawErrorText;
32784
32848
  return react.default.createElement("div", {
32785
32849
  className: "edrv-side-panel",
32786
32850
  onContextMenu: onPanelContext