dsh-vscode-mode 0.27.0 → 0.27.1

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
@@ -587,13 +587,13 @@ profile 请替换为实际目标,不要把示例目录当成当前运行 profi
587
587
 
588
588
  ```bash
589
589
  # ① Git 安装(clone + prepare 构建;推荐打固定 tag)
590
- dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.27.0
590
+ dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.27.1
591
591
 
592
592
  # ② npm 注册表(发布到 npm 后)
593
- dsh plugin --profile web add dsh-vscode-mode@0.27.0
593
+ dsh plugin --profile web add dsh-vscode-mode@0.27.1
594
594
 
595
595
  # ③ GitHub Release tgz 直装(Release asset 可用后)
596
- dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.27.0/dsh-vscode-mode-0.27.0.tgz
596
+ dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.27.1/dsh-vscode-mode-0.27.1.tgz
597
597
  ```
598
598
 
599
599
  > **DSH 版本政策(0.17.0 起)**:六项 DSH peer 仍统一声明为 `*`,另以
@@ -973,6 +973,7 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
973
973
 
974
974
  | 版本 | 要点 |
975
975
  | --- | --- |
976
+ | v0.27.1 | 修复仅 LF/CRLF 或 BOM 差异造成的空待审与差异栏残留;统一累计待审路径路由并过滤已归档历史记录 |
976
977
  | v0.27.0 | DSH alpha.3 官方菜单/Forge 导航/设置图标与能力诊断;多目标 patch 字节采集;回滚版本与会话策略守卫;工作区共享差异基线;隐藏轮询门控与导航隔离 |
977
978
  | v0.26.0 | Keep All 改为单次批量(不再因单条过期/冷端条目整批中止,2N+1 次往返降到 2 次);差异审查旧通道遗留清理:待审接管的旧记录自动结案、守卫改会话作用域、失败原因不再被通用文案吞掉 |
978
979
  | v0.25.1 | 下载到本机支持选择保存文件夹(目录选择器),按工作区相对路径写入 |
@@ -986,7 +987,9 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
986
987
  | v0.23.0 | 快捷菜单:可拖动悬浮按钮 + 自定义菜单树 |
987
988
 
988
989
  <details>
989
- <summary>完整版本记录(v0.27.0 → v0.1.5x,点击展开)</summary>
990
+ <summary>完整版本记录(v0.27.1 → v0.1.5x,点击展开)</summary>
991
+
992
+ - **v0.27.1**:净零判定复用差异生成器的逻辑行口径,消除仅 LF/CRLF 或 BOM 不同造成的「无差异块但仍计入待审」;保留真实文本与末尾换行增删,不改原始快照和磁盘文件。累计待审详情与工具栏统一身份解析,避免误走历史改动栏;汇总与批量列表排除已归档记录。客户端空文本差异收敛保留现有能力、脏缓冲和忙状态守卫。Web Host 重启后实测三个空待审归零、差异栏消失,三个游戏文件 SHA256 不变。参见 [0.27.1 发布说明](docs/release-0.27.1.md)。
990
993
 
991
994
  - **v0.27.0**:接入 DSH 0.2.2-alpha.3 官方共享菜单(树/页签、键盘入口、陈旧目标守卫、旧 Host 回退)、Forge 面板/本地变更导航(缺能力隐藏,不接管 PR 快照)、设置图标与能力诊断;apply_patch 多目标采集采用独立原始字节前后像,保留 BOM/行尾,不把结果 before:null 当作文件缺失。回滚使用 provider 原子版本与内容守卫,删除无直接文件系统兜底,修复累计待审入口漏传会话沙箱策略;差异按工作区共享基线及接管登记。展示轮询隐藏门控与单飞合并,LSP 旧会话结果隔离,导航补列及 owner/session 守卫。实机 write/edit → GUI Undo → 磁盘读回已通过。**已知缺口**:Undo 后当前已结算文件可能仍显示“待审”和超出总数的序号;真实 apply_patch 工具、Forge 已启用环境、真实后台请求与多会话完整矩阵尚未实测。缺口经维护者接受发布;不宣称完整端到端验收或 Console 零错误。
992
995
 
package/lib/client.js CHANGED
@@ -3721,10 +3721,6 @@ window.__ModuleLoader__.load({
3721
3721
  }
3722
3722
  }
3723
3723
  //#endregion
3724
- //#region src/shared/pendingReview.ts
3725
- /** 待审条目在面板列表里的 id 前缀;客户端与 Host 共用这一份口径。 */
3726
- const PENDING_PREFIX = "pending:";
3727
- //#endregion
3728
3724
  //#region src/client/reviewBatch.ts
3729
3725
  /**
3730
3726
  * @public
@@ -5546,6 +5542,25 @@ window.__ModuleLoader__.load({
5546
5542
  function diffPathKey(path) {
5547
5543
  return pathKeyFor(path, false);
5548
5544
  }
5545
+ /**
5546
+ * @public
5547
+ * @author ddj 2026年11月5号
5548
+ * @description: 解析编辑器权威审查路径,累计待审优先,详情与工具栏共用同一来源。
5549
+ * @param path 当前文件
5550
+ * @param page 权威审查元数据
5551
+ * @param sameFile 工作区路径比较器,缺省按完整路径键比较
5552
+ * @returns 后端审查路径;未接管时返回 null
5553
+ */
5554
+ function reviewPathOf(path, page, sameFile = (left, right) => diffPathKey(left) === diffPathKey(right)) {
5555
+ if (!path || !page) return null;
5556
+ for (const item of page.items) {
5557
+ if (!item.id.startsWith("pending:")) continue;
5558
+ const currentPath = item.currentPath || item.path;
5559
+ const identity = item.id.slice(8);
5560
+ if (sameFile(currentPath, path) || sameFile(identity, path)) return currentPath;
5561
+ }
5562
+ return page.overview?.coveredPaths.find((candidate) => sameFile(candidate, path)) ?? null;
5563
+ }
5549
5564
  /** @public @author ddj 2026年10月26号 @param path Current editor file. @param page Authoritative metadata, including decided paths. @returns Whether legacy actions must be hidden for this file. */
5550
5565
  function officialPath(path, page) {
5551
5566
  const key = diffPathKey(path);
@@ -5608,7 +5623,7 @@ window.__ModuleLoader__.load({
5608
5623
  /** @public @author ddj 2026年10月26号 @param records Tool-call history. @param page Official file navigation, never only its first 50 rows. @returns Pending first, then official; legacy paths remain explicitly labelled. */
5609
5624
  function diffSummary(records, page) {
5610
5625
  const pending = pendingRowsOf(page);
5611
- const legacy = summarize(records.filter((record) => !pending.covered.has(diffPathKey(record.path)) && !officialPath(record.path, page)));
5626
+ const legacy = summarize(records.filter((record) => record.archived !== true && !pending.covered.has(diffPathKey(record.path)) && !officialPath(record.path, page)));
5612
5627
  const files = [...pending.rows];
5613
5628
  for (const file of page?.overview?.files ?? []) {
5614
5629
  if (pending.covered.has(diffPathKey(file.path))) continue;
@@ -384013,6 +384028,18 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
384013
384028
  * 必须显式区分,否则用户会误判为插件未升级。
384014
384029
  * 作者 ddj 2026年10月27号
384015
384030
  */
384031
+ /**
384032
+ * @public
384033
+ * @author ddj 2026年11月5号
384034
+ * @description 仅收敛已成功生成的空文本净差异;不把定位失败、二进制或生成异常当作已解决。
384035
+ * @param detail 已加载的权威详情
384036
+ * @returns 是否可以无写盘结案
384037
+ */
384038
+ function emptyTextReview(detail) {
384039
+ if (!detail || detail.item.decision !== "pending" || !detail.item.current) return false;
384040
+ if (detail.capability.keep !== true || detail.diff.kind !== "text") return false;
384041
+ return detail.diff.hunks.length === 0 && detail.blocks.length === 0 && detail.item.added === 0 && detail.item.deleted === 0;
384042
+ }
384016
384043
  /** @private @author ddj 2026年10月27号 @param value 任意计数输入 @returns 非负整数,NaN/负数/非数字归零 */
384017
384044
  function safeCount(value) {
384018
384045
  const parsed = Number(value);
@@ -394846,10 +394873,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
394846
394873
  ]);
394847
394874
  react$1.default.useEffect(() => {
394848
394875
  const controller = new AbortController();
394849
- const pendingPath = (review.page?.items ?? []).filter((item) => String(item.id).startsWith(PENDING_PREFIX)).map((item) => item.currentPath || item.path).find((path) => sameFile(path, active));
394850
- const coveredPath = review.page?.overview?.coveredPaths.find((path) => sameFile(path, active));
394851
- const reviewPath = coveredPath ?? pendingPath;
394852
- dbg(sessionId, `[DEBUG reviewPath] active=${active ?? "(null)"} covered=${coveredPath ?? "(none)"} pending=${pendingPath ?? "(none)"} coveredCount=${review.page?.overview?.coveredPaths.length ?? -1} items=${review.page?.items?.length ?? -1} overview=${review.page?.overview ? 1 : 0}`);
394876
+ const reviewPath = reviewPathOf(active, review.page, sameFile);
394877
+ dbg(sessionId, `[DEBUG reviewPath] active=${active ?? "(null)"} resolved=${reviewPath ?? "(none)"} coveredCount=${review.page?.overview?.coveredPaths.length ?? -1} items=${review.page?.items?.length ?? -1} overview=${review.page?.overview ? 1 : 0}`);
394853
394878
  if (!active || !reviewPath) {
394854
394879
  setOfficialDetail(null);
394855
394880
  setOfficialRecords([]);
@@ -394965,9 +394990,9 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
394965
394990
  const noBlocks = !!officialDetail && (officialDetail.diff.kind !== "text" || officialDetail.diff.hunks.length === 0);
394966
394991
  const decideRegions = react$1.default.useMemo(() => [...pendingRegions, ...staleRegions], [pendingRegions, staleRegions]);
394967
394992
  react$1.default.useEffect(() => {
394968
- if (!officialDetail || contentReady !== true || batchBusyRef.current) return;
394969
- if (pendingRegions.length > 0 || staleRegions.length === 0) return;
394970
- if (noBlocks || officialDetail.capability?.keep !== true) return;
394993
+ if (!officialDetail || batchBusyRef.current) return;
394994
+ if (!emptyTextReview(officialDetail) && (contentReady !== true || pendingRegions.length > 0 || staleRegions.length === 0 || noBlocks)) return;
394995
+ if (officialDetail.capability?.keep !== true) return;
394971
394996
  if (dirtyRef.current[active]) return;
394972
394997
  settleInvisibleRecord(officialDetail);
394973
394998
  }, [
@@ -398101,7 +398126,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
398101
398126
  const allPending = react$1.default.useMemo(() => {
398102
398127
  const out = [];
398103
398128
  for (const rec of Object.values(records)) {
398104
- if (rec.superseded === true || coveredPaths.has(diffPathKey(rec.path))) continue;
398129
+ if (rec.archived === true || rec.superseded === true || coveredPaths.has(diffPathKey(rec.path))) continue;
398105
398130
  const perHunk = Array.isArray(rec.decisions?.perHunk) ? rec.decisions.perHunk : [];
398106
398131
  const hunks = Array.isArray(rec.hunks) ? rec.hunks : [];
398107
398132
  for (let i = 0; i < hunks.length; i++) if ((perHunk.length ? perHunk[i] : rec.decisions.call) === "pending" && !noopHunk(rec, hunks[i])) out.push({
@@ -399923,7 +399948,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
399923
399948
  * @author ddj 2026年09月29号
399924
399949
  * @returns 含布局及操作回调的差异快照
399925
399950
  */
399926
- const officialFile = review.page?.overview?.coveredPaths.find((path) => sameFile(path, active));
399951
+ const officialFile = reviewPathOf(active, review.page, sameFile);
399927
399952
  const officialDown = officialFile ? null : officialDownView(review.error);
399928
399953
  const rawReviewError = review.error || error;
399929
399954
  const sessionDown = isSessionMissingError(rawReviewError);
package/lib/client.js.map CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/lib/client.js.map
3
- size: 35794222 bytes
4
- sha256: 4eedfe531edd3f9eac21752f5a109748e1eb349145299e6c50ec8f999ff56859
3
+ size: 35796301 bytes
4
+ sha256: 2982d27d96e985ee9a5893d3b7ec831282dbff4552db9d6cafea17ad3186e806
package/lib/index.js CHANGED
@@ -9905,12 +9905,15 @@ function sameEntryText(left, right) {
9905
9905
  }
9906
9906
  /**
9907
9907
  * @author ddj 2026年10月29号
9908
- * @description: 净零判定:基线等于当前内容即为已解决,但条目仍留在列表等待移除。
9908
+ * @description: 净零判定与文本差异生成器保持逻辑行口径一致;只忽略 BOM 和换行编码,不改存储原文。
9909
9909
  * @param entry 待审条目
9910
9910
  * @returns 是否已无净差异
9911
9911
  */
9912
9912
  function isSettled(entry) {
9913
- return sameEntryText(entry.oldText, entry.newText);
9913
+ if (sameEntryText(entry.oldText, entry.newText)) return true;
9914
+ const baselineLines = logicalLines(entry.oldText);
9915
+ const currentLines = logicalLines(entry.newText);
9916
+ return baselineLines.length === currentLines.length && baselineLines.every((line, index) => line === currentLines[index]);
9914
9917
  }
9915
9918
  /**
9916
9919
  * @author ddj 2026年10月29号