dsh-vscode-mode 0.26.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/lib/client.js CHANGED
@@ -414,6 +414,16 @@ window.__ModuleLoader__.load({
414
414
  }
415
415
  /** @private @author ddj 2026年10月14号 @param event Keyboard activation. */
416
416
  function key(event) {
417
+ if (event.key === "ContextMenu" || event.shiftKey && event.key === "F10") {
418
+ event.preventDefault();
419
+ event.stopPropagation();
420
+ const rect = event.currentTarget.getBoundingClientRect();
421
+ props.onMenu(tab.path, {
422
+ clientX: rect.left,
423
+ clientY: rect.bottom
424
+ });
425
+ return;
426
+ }
417
427
  if (event.key === "Enter" || event.key === " ") {
418
428
  event.preventDefault();
419
429
  props.onSelect(group.id, tab.path);
@@ -3469,11 +3479,23 @@ window.__ModuleLoader__.load({
3469
3479
  */
3470
3480
  function refreshFeed(sessionId, skipStale = false) {
3471
3481
  const entry = entryOf(sessionId);
3482
+ entry.queuedSkipStale = entry.queuedSkipStale === void 0 ? skipStale : entry.queuedSkipStale && skipStale;
3483
+ if (typeof document !== "undefined" && document.hidden) {
3484
+ entry.queued = true;
3485
+ return Promise.resolve();
3486
+ }
3487
+ if (entry.inflight) {
3488
+ entry.queued = true;
3489
+ return entry.request ?? Promise.resolve();
3490
+ }
3491
+ skipStale = entry.queuedSkipStale ?? skipStale;
3492
+ entry.queuedSkipStale = void 0;
3472
3493
  const current = ++entry.seq;
3473
3494
  entry.inflight = true;
3495
+ entry.controller = new AbortController();
3474
3496
  const payload = { sessionId };
3475
3497
  if (skipStale) payload.skipStale = true;
3476
- return rpc("edrv.list", payload).then((res) => {
3498
+ entry.request = rpc("edrv.list", payload, entry.controller.signal).then((res) => {
3477
3499
  if (current !== entry.seq) return;
3478
3500
  if (!res || !res.ok || !Array.isArray(res.records)) return;
3479
3501
  entry.records = res.records;
@@ -3485,8 +3507,14 @@ window.__ModuleLoader__.load({
3485
3507
  listener(message);
3486
3508
  } catch {}
3487
3509
  }).finally(() => {
3488
- if (current === entry.seq) entry.inflight = false;
3510
+ if (current !== entry.seq) return;
3511
+ entry.inflight = false;
3512
+ if (entry.queued) {
3513
+ entry.queued = false;
3514
+ if (feeds$1.get(sessionId) === entry) return refreshFeed(sessionId, entry.queuedSkipStale ?? false);
3515
+ }
3489
3516
  });
3517
+ return entry.request;
3490
3518
  }
3491
3519
  /**
3492
3520
  * 确保该会话的定时器与 refresh 事件监听已就绪(首个订阅者到来时启动)。
@@ -3496,12 +3524,26 @@ window.__ModuleLoader__.load({
3496
3524
  */
3497
3525
  function ensureTimer$1(sessionId, entry) {
3498
3526
  if (entry.timer === null) entry.timer = setInterval(() => {
3527
+ if (typeof document !== "undefined" && document.hidden) return;
3499
3528
  const tickers = Array.from(entry.tickers);
3500
3529
  for (const tick of tickers) try {
3501
3530
  tick();
3502
3531
  } catch {}
3503
3532
  if (entry.listeners.size > 0 || entry.errorListeners.size > 0) refreshFeed(sessionId);
3504
3533
  }, FEED_INTERVAL_MS);
3534
+ if (!entry.onVisible && typeof document !== "undefined") {
3535
+ entry.onVisible = () => {
3536
+ if (document.hidden) return;
3537
+ for (const tick of entry.tickers) try {
3538
+ tick();
3539
+ } catch {}
3540
+ if (entry.listeners.size || entry.errorListeners.size) {
3541
+ entry.queued = false;
3542
+ refreshFeed(sessionId);
3543
+ }
3544
+ };
3545
+ document.addEventListener("visibilitychange", entry.onVisible);
3546
+ }
3505
3547
  if (entry.onRefresh === null) {
3506
3548
  const handler = () => {
3507
3549
  refreshFeed(sessionId);
@@ -3518,12 +3560,16 @@ window.__ModuleLoader__.load({
3518
3560
  * @param entry 订阅槽位
3519
3561
  */
3520
3562
  function releaseIfIdle(sessionId, entry) {
3521
- if (entry.listeners.size || entry.tickers.size || entry.errorListeners.size) return;
3563
+ if (feeds$1.get(sessionId) !== entry || entry.listeners.size || entry.tickers.size || entry.errorListeners.size) return;
3522
3564
  if (entry.timer !== null) clearInterval(entry.timer);
3523
3565
  if (entry.onRefresh !== null) {
3524
3566
  const target = win();
3525
3567
  if (target) target.removeEventListener("edrv:refresh", entry.onRefresh);
3526
3568
  }
3569
+ entry.seq++;
3570
+ entry.queued = false;
3571
+ entry.controller?.abort();
3572
+ if (entry.onVisible && typeof document !== "undefined") document.removeEventListener("visibilitychange", entry.onVisible);
3527
3573
  feeds$1.delete(sessionId);
3528
3574
  }
3529
3575
  /**
@@ -3588,6 +3634,10 @@ window.__ModuleLoader__.load({
3588
3634
  /** @private @author ddj 2026年10月26号 @param sessionId Scope. @param entry Current generation. @returns First-page metadata update; no overlap or late publication. */
3589
3635
  async function refresh(sessionId, entry, force = false) {
3590
3636
  if (entry.controller.signal.aborted) return;
3637
+ if (typeof document !== "undefined" && document.hidden) {
3638
+ entry.again = true;
3639
+ return;
3640
+ }
3591
3641
  if (entry.loading) {
3592
3642
  entry.again = true;
3593
3643
  return;
@@ -3641,17 +3691,25 @@ window.__ModuleLoader__.load({
3641
3691
  };
3642
3692
  feeds.set(sessionId, entry);
3643
3693
  if (typeof window !== "undefined") window.addEventListener("edrv:refresh", onRefresh);
3694
+ if (typeof document !== "undefined") {
3695
+ const current = entry;
3696
+ entry.onVisible = () => {
3697
+ if (!document.hidden) refresh(sessionId, current);
3698
+ };
3699
+ document.addEventListener("visibilitychange", entry.onVisible);
3700
+ }
3644
3701
  refresh(sessionId, entry);
3645
3702
  }
3646
3703
  entry.listeners.add(listener);
3647
3704
  listener(entry.value);
3648
3705
  return () => {
3649
3706
  entry.listeners.delete(listener);
3650
- if (entry.listeners.size) return;
3707
+ if (entry.listeners.size || feeds.get(sessionId) !== entry) return;
3651
3708
  entry.controller.abort();
3652
3709
  clearTimeout(entry.timer);
3653
3710
  feeds.delete(sessionId);
3654
3711
  if (typeof window !== "undefined") window.removeEventListener("edrv:refresh", entry.onRefresh);
3712
+ if (entry.onVisible && typeof document !== "undefined") document.removeEventListener("visibilitychange", entry.onVisible);
3655
3713
  };
3656
3714
  }
3657
3715
  /** @public @author ddj 2026年10月26号 @param sessionId Refresh metadata after a decision; does not alter legacy or disk. */
@@ -3663,10 +3721,6 @@ window.__ModuleLoader__.load({
3663
3721
  }
3664
3722
  }
3665
3723
  //#endregion
3666
- //#region src/shared/pendingReview.ts
3667
- /** 待审条目在面板列表里的 id 前缀;客户端与 Host 共用这一份口径。 */
3668
- const PENDING_PREFIX = "pending:";
3669
- //#endregion
3670
3724
  //#region src/client/reviewBatch.ts
3671
3725
  /**
3672
3726
  * @public
@@ -5488,6 +5542,25 @@ window.__ModuleLoader__.load({
5488
5542
  function diffPathKey(path) {
5489
5543
  return pathKeyFor(path, false);
5490
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
+ }
5491
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. */
5492
5565
  function officialPath(path, page) {
5493
5566
  const key = diffPathKey(path);
@@ -5550,7 +5623,7 @@ window.__ModuleLoader__.load({
5550
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. */
5551
5624
  function diffSummary(records, page) {
5552
5625
  const pending = pendingRowsOf(page);
5553
- 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)));
5554
5627
  const files = [...pending.rows];
5555
5628
  for (const file of page?.overview?.files ?? []) {
5556
5629
  if (pending.covered.has(diffPathKey(file.path))) continue;
@@ -376726,9 +376799,15 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
376726
376799
  */
376727
376800
  function resolveNavLine(params) {
376728
376801
  const line = (params ?? {})?.line;
376729
- if (typeof line !== "number" || !Number.isFinite(line) || line <= 0) return void 0;
376802
+ if (typeof line !== "number" || !Number.isFinite(line) || line < 1) return void 0;
376730
376803
  return Math.floor(line);
376731
376804
  }
376805
+ /** @public @author ddj 2026年11月04号 @param params Plugin navigation extension. @returns Positive column only alongside a valid line; official line-only callers remain unchanged. */
376806
+ function resolveNavColumn(params) {
376807
+ if (!resolveNavLine(params)) return void 0;
376808
+ const column = params?.column;
376809
+ return typeof column === "number" && Number.isFinite(column) && column >= 1 ? Math.floor(column) : void 0;
376810
+ }
376732
376811
  /** 逐段 component 解码(失败返回 null,对齐官方 parseFileAddress 的容错语义)。 */
376733
376812
  function decodeSegment(raw) {
376734
376813
  if (raw === void 0) return null;
@@ -376749,7 +376828,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
376749
376828
  */
376750
376829
  function parseOfficialFileAddress(address) {
376751
376830
  if (typeof address !== "string" || !address.startsWith("dsh-resource://file/")) return null;
376752
- const [scope, ...tail] = address.slice(20).split("/");
376831
+ const [scope, ...tail] = address.split(/[?#]/, 1)[0].slice(20).split("/");
376753
376832
  const kind = decodeSegment(scope);
376754
376833
  if (kind === "session") {
376755
376834
  const sessionId = decodeSegment(tail[0]);
@@ -376817,10 +376896,16 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
376817
376896
  * @param preview 可选 Markdown 渲染模式(行号导航优先源码)
376818
376897
  * @returns 转发是否成功(openTab 抛错返回 false,由调用方决定重试或兜底)
376819
376898
  */
376820
- function forwardToEditor(service, path, line, preview) {
376899
+ function forwardToEditor(service, path, line, preview, column) {
376821
376900
  if (!service || typeof service.openTab !== "function" || !path) return false;
376822
376901
  const params = { openPath: path };
376823
- if (line !== void 0) params.line = line;
376902
+ const validLine = resolveNavLine({ line });
376903
+ if (validLine !== void 0) params.line = validLine;
376904
+ const validColumn = resolveNavColumn({
376905
+ line: validLine,
376906
+ column
376907
+ });
376908
+ if (validColumn !== void 0) params.column = validColumn;
376824
376909
  if (preview !== void 0) params.preview = preview;
376825
376910
  try {
376826
376911
  service.openTab(OFFICIAL_TAB_KIND, { params });
@@ -383943,6 +384028,18 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
383943
384028
  * 必须显式区分,否则用户会误判为插件未升级。
383944
384029
  * 作者 ddj 2026年10月27号
383945
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
+ }
383946
384043
  /** @private @author ddj 2026年10月27号 @param value 任意计数输入 @returns 非负整数,NaN/负数/非数字归零 */
383947
384044
  function safeCount(value) {
383948
384045
  const parsed = Number(value);
@@ -386122,6 +386219,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
386122
386219
  at: 0
386123
386220
  };
386124
386221
  let progressListeners = /* @__PURE__ */ new Set();
386222
+ let statusRequest = null;
386223
+ let statusEpoch = 0;
386125
386224
  /** 会话 id 变更通知(EditorView 持有权威 sessionId,经窗口事件回填)。 */
386126
386225
  const SESSION_EVENT = "edrv:lsp-session";
386127
386226
  /** 上报可见状态(复用 EditorView 的状态通道;失败不再静默)。 */
@@ -386141,6 +386240,11 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
386141
386240
  syncTimers.clear();
386142
386241
  docVersions.clear();
386143
386242
  sessionId$1 = id;
386243
+ statusEpoch++;
386244
+ statusCache = {
386245
+ servers: [],
386246
+ at: 0
386247
+ };
386144
386248
  refreshStatus();
386145
386249
  }
386146
386250
  /**
@@ -386400,17 +386504,35 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
386400
386504
  if (!res || !res.tokens || !Array.isArray(res.tokens.data)) return null;
386401
386505
  return res.tokens;
386402
386506
  }
386403
- /** 拉取服务器状态(带 5s 缓存)。 */
386507
+ /** @public @author ddj 2026年11月04号 @param force Bypass cached data, not the in-flight guard. @returns Current-session server status; stale responses never publish. */
386404
386508
  async function refreshStatus(force = false) {
386509
+ if (statusRequest) {
386510
+ const pending = statusRequest;
386511
+ await pending.promise;
386512
+ if (pending.epoch !== statusEpoch) return refreshStatus(force);
386513
+ return statusCache.servers;
386514
+ }
386515
+ if (typeof document !== "undefined" && document.hidden) return statusCache.servers;
386405
386516
  if (!force && Date.now() - statusCache.at < 1500) return statusCache.servers;
386406
- const res = await rpc("edrv.lsp.status", { sessionId: sessionId$1 }).catch(() => null);
386407
- const servers = res && res.ok && Array.isArray(res.servers) ? res.servers : [];
386408
- statusCache = {
386409
- servers,
386410
- at: Date.now()
386517
+ const epoch = statusEpoch, owner = sessionId$1;
386518
+ const request = {
386519
+ epoch,
386520
+ promise: rpc("edrv.lsp.status", { sessionId: owner }).catch(() => null)
386411
386521
  };
386412
- publishProgress();
386413
- return servers;
386522
+ statusRequest = request;
386523
+ try {
386524
+ const res = await request.promise;
386525
+ if (epoch !== statusEpoch || owner !== sessionId$1) return statusCache.servers;
386526
+ const servers = res && res.ok && Array.isArray(res.servers) ? res.servers : [];
386527
+ statusCache = {
386528
+ servers,
386529
+ at: Date.now()
386530
+ };
386531
+ publishProgress();
386532
+ return servers;
386533
+ } finally {
386534
+ if (statusRequest === request) statusRequest = null;
386535
+ }
386414
386536
  }
386415
386537
  /** file:// 或已转 edrv:// 的 LSP location → Monaco Location(edrv:// uri + 1-based range)。 */
386416
386538
  function toClientLocation(loc) {
@@ -389483,6 +389605,13 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
389483
389605
  label: "添加到对话",
389484
389606
  disabled: !(hasSession && canAddToConversation)
389485
389607
  },
389608
+ ...state.forgeReady ? [{
389609
+ id: "forge-open",
389610
+ label: "打开 Forge"
389611
+ }, {
389612
+ id: "forge-local",
389613
+ label: "查看本地变更(Forge)"
389614
+ }] : [],
389486
389615
  {
389487
389616
  id: "close",
389488
389617
  label: "关闭",
@@ -394409,9 +394538,11 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
394409
394538
  page: null,
394410
394539
  error: ""
394411
394540
  });
394412
- if (!sessionId) return void 0;
394413
- return subscribeReview(sessionId, setReview);
394414
394541
  }, [sessionId]);
394542
+ react$1.default.useEffect(() => {
394543
+ if (!sessionId || props.visible === false) return void 0;
394544
+ return subscribeReview(sessionId, setReview);
394545
+ }, [sessionId, props.visible]);
394415
394546
  const [tabs, setTabs] = react$1.default.useState([]);
394416
394547
  const [active, setDiskActive] = react$1.default.useState(null);
394417
394548
  const [planTabs, setPlanTabs] = react$1.default.useState([]);
@@ -394742,10 +394873,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
394742
394873
  ]);
394743
394874
  react$1.default.useEffect(() => {
394744
394875
  const controller = new AbortController();
394745
- const pendingPath = (review.page?.items ?? []).filter((item) => String(item.id).startsWith(PENDING_PREFIX)).map((item) => item.currentPath || item.path).find((path) => sameFile(path, active));
394746
- const coveredPath = review.page?.overview?.coveredPaths.find((path) => sameFile(path, active));
394747
- const reviewPath = coveredPath ?? pendingPath;
394748
- 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}`);
394749
394878
  if (!active || !reviewPath) {
394750
394879
  setOfficialDetail(null);
394751
394880
  setOfficialRecords([]);
@@ -394861,9 +394990,9 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
394861
394990
  const noBlocks = !!officialDetail && (officialDetail.diff.kind !== "text" || officialDetail.diff.hunks.length === 0);
394862
394991
  const decideRegions = react$1.default.useMemo(() => [...pendingRegions, ...staleRegions], [pendingRegions, staleRegions]);
394863
394992
  react$1.default.useEffect(() => {
394864
- if (!officialDetail || contentReady !== true || batchBusyRef.current) return;
394865
- if (pendingRegions.length > 0 || staleRegions.length === 0) return;
394866
- 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;
394867
394996
  if (dirtyRef.current[active]) return;
394868
394997
  settleInvisibleRecord(officialDetail);
394869
394998
  }, [
@@ -395720,7 +395849,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
395720
395849
  });
395721
395850
  };
395722
395851
  react$1.default.useEffect(() => {
395723
- if (!sessionId) return void 0;
395852
+ if (!sessionId || props.visible === false) return void 0;
395724
395853
  const offRecords = subscribeRecords(sessionId, applyRecords);
395725
395854
  const offErrors = subscribeErrors(sessionId, (message) => setError("list异常:" + message));
395726
395855
  refreshRecords();
@@ -395728,7 +395857,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
395728
395857
  offRecords();
395729
395858
  offErrors();
395730
395859
  };
395731
- }, [sessionId]);
395860
+ }, [sessionId, props.visible]);
395732
395861
  /**
395733
395862
  * 展示外部同步提示(按路径+类型去重:同一文件重复回调不重置已关闭的提示)。
395734
395863
  * @author ddj 2026年09月15号
@@ -395847,17 +395976,31 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
395847
395976
  onDiskChange: (change) => diskChangeRef.current?.(change)
395848
395977
  });
395849
395978
  react$1.default.useEffect(() => {
395850
- const publishLsp = (servers) => setLspServers(Array.isArray(servers) ? servers : []);
395979
+ let alive = true;
395980
+ let loading = false;
395981
+ const publishLsp = (servers) => {
395982
+ if (alive) setLspServers(Array.isArray(servers) ? servers : []);
395983
+ };
395984
+ const refreshLsp = async () => {
395985
+ if (loading || props.visible === false || document.hidden) return;
395986
+ loading = true;
395987
+ try {
395988
+ publishLsp(await refreshStatus(true));
395989
+ } finally {
395990
+ loading = false;
395991
+ }
395992
+ };
395851
395993
  const unsubscribe = onLspProgress(publishLsp);
395852
- refreshStatus(true).then(publishLsp);
395853
- const timer = setInterval(() => {
395854
- refreshStatus(true).then(publishLsp);
395855
- }, 1500);
395994
+ refreshLsp();
395995
+ const timer = setInterval(refreshLsp, 1500);
395996
+ document.addEventListener("visibilitychange", refreshLsp);
395856
395997
  return () => {
395998
+ alive = false;
395857
395999
  unsubscribe();
395858
396000
  clearInterval(timer);
396001
+ document.removeEventListener("visibilitychange", refreshLsp);
395859
396002
  };
395860
- }, [sessionId]);
396003
+ }, [sessionId, props.visible]);
395861
396004
  react$1.default.useEffect(() => {
395862
396005
  if (!sessionId) return;
395863
396006
  setSession(sessionId);
@@ -395907,6 +396050,9 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
395907
396050
  const fileOpenRef = react$1.default.useRef(null);
395908
396051
  /** @private @author ddj 2026年10月08号 @param e Routed file request. Always uses the current workspace and save/preview callbacks. */
395909
396052
  fileOpenRef.current = (e) => {
396053
+ if (e?.detail?.sessionId && e.detail.sessionId !== sessionId) return;
396054
+ if (e?.detail?.ownerId && e.detail.ownerId !== props?.ownerId) return;
396055
+ if (!e?.detail?.ownerId && props?.visible === false) return;
395910
396056
  const p = e?.detail?.path;
395911
396057
  if (!p) return;
395912
396058
  const normalized = tabPath(p);
@@ -397980,7 +398126,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
397980
398126
  const allPending = react$1.default.useMemo(() => {
397981
398127
  const out = [];
397982
398128
  for (const rec of Object.values(records)) {
397983
- if (rec.superseded === true || coveredPaths.has(diffPathKey(rec.path))) continue;
398129
+ if (rec.archived === true || rec.superseded === true || coveredPaths.has(diffPathKey(rec.path))) continue;
397984
398130
  const perHunk = Array.isArray(rec.decisions?.perHunk) ? rec.decisions.perHunk : [];
397985
398131
  const hunks = Array.isArray(rec.hunks) ? rec.hunks : [];
397986
398132
  for (let i = 0; i < hunks.length; i++) if ((perHunk.length ? perHunk[i] : rec.decisions.call) === "pending" && !noopHunk(rec, hunks[i])) out.push({
@@ -398670,6 +398816,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
398670
398816
  }
398671
398817
  const tabMenuActions = (path) => ({
398672
398818
  "add-to-conversation": () => addRefToChat(path),
398819
+ "forge-open": () => props.forge?.open(sessionId),
398820
+ "forge-local": () => props.forge?.open(sessionId, true),
398673
398821
  "split-left": () => splitTab(path, "left"),
398674
398822
  "split-right": () => splitTab(path, "right"),
398675
398823
  "split-top": () => splitTab(path, "top"),
@@ -398716,6 +398864,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
398716
398864
  cwd,
398717
398865
  hasSession: Boolean(sessionId),
398718
398866
  canAddToConversation: Boolean(addToConversation),
398867
+ forgeReady: props.forge?.available() === true,
398719
398868
  canSplit: workbench.groups.length < 8 && !workbench.floats.some((item) => item.group === ownerOf(workbench, tabMenu.path)?.id),
398720
398869
  canFloat: workbench.groups.length < 8,
398721
398870
  canReturn: ownerOf(workbench, tabMenu.path)?.id !== MAIN_GROUP,
@@ -399098,6 +399247,48 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
399098
399247
  y: event.clientY
399099
399248
  });
399100
399249
  }
399250
+ const menuOwner = react$1.default.useRef({
399251
+ sessionId,
399252
+ scope,
399253
+ alive: true
399254
+ });
399255
+ menuOwner.current.sessionId = sessionId;
399256
+ menuOwner.current.scope = scope;
399257
+ const menuValid = react$1.default.useRef(null);
399258
+ react$1.default.useEffect(() => {
399259
+ menuOwner.current.alive = props.visible !== false;
399260
+ return () => {
399261
+ menuOwner.current.alive = false;
399262
+ if (menuValid.current) props.officialMenus?.invalidate(menuValid.current);
399263
+ };
399264
+ }, [
399265
+ sessionId,
399266
+ scope,
399267
+ props.visible,
399268
+ props.officialMenus
399269
+ ]);
399270
+ react$1.default.useEffect(() => {
399271
+ if (!tabMenu || !props.officialMenus || !sessionId) return;
399272
+ const capturedSession = sessionId;
399273
+ const capturedScope = scope;
399274
+ const path = tabMenu.path;
399275
+ const groupId = ownerOf(benchRef.current, path)?.id;
399276
+ const valid = () => menuOwner.current.alive && menuOwner.current.sessionId === capturedSession && menuOwner.current.scope === capturedScope && ownerOf(benchRef.current, path)?.id === groupId && tabsRef.current.some((tab) => tab.path === path);
399277
+ menuValid.current = valid;
399278
+ const items = tabMenuEntries().map((entry) => ({
399279
+ ...entry,
399280
+ run: entry.onClick ?? (() => {})
399281
+ }));
399282
+ if (props.officialMenus.open("tab", sessionId, path, {
399283
+ x: tabMenu.x,
399284
+ y: tabMenu.y
399285
+ }, items, valid)) setTabMenu(null);
399286
+ }, [
399287
+ tabMenu,
399288
+ props.officialMenus,
399289
+ sessionId,
399290
+ scope
399291
+ ]);
399101
399292
  /** @private @author ddj 2026年10月14号 @param group Auxiliary group. Return documents rather than closing them. */
399102
399293
  function returnPane(group) {
399103
399294
  acceptLayout(returnGroup(benchRef.current, group));
@@ -399757,7 +399948,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
399757
399948
  * @author ddj 2026年09月29号
399758
399949
  * @returns 含布局及操作回调的差异快照
399759
399950
  */
399760
- const officialFile = review.page?.overview?.coveredPaths.find((path) => sameFile(path, active));
399951
+ const officialFile = reviewPathOf(active, review.page, sameFile);
399761
399952
  const officialDown = officialFile ? null : officialDownView(review.error);
399762
399953
  const rawReviewError = review.error || error;
399763
399954
  const sessionDown = isSessionMissingError(rawReviewError);
@@ -399877,6 +400068,9 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
399877
400068
  editor: () => editorRef.current,
399878
400069
  outlineSources: props.outlineSources,
399879
400070
  fileMenuItems: props.fileMenuItems,
400071
+ officialMenus: props.officialMenus,
400072
+ visible: props.visible,
400073
+ forge: props.forge,
399880
400074
  addToConversation,
399881
400075
  svn: svnStatus,
399882
400076
  svnChanges,
@@ -403933,6 +404127,144 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
403933
404127
  return new McpSessionState(fetchStatus, document);
403934
404128
  }
403935
404129
  //#endregion
404130
+ //#region src/client/forgeBridge.ts
404131
+ /** @public @author ddj 2026年11月04号 @param ctx Client capabilities. @param current Current session reader. @returns Capability-gated official navigation, with no polling or writes. */
404132
+ function forgeBridge(ctx, current) {
404133
+ const capabilities = () => {
404134
+ try {
404135
+ return {
404136
+ tabs: ctx.get("sidebarRightTabs"),
404137
+ service: ctx.get("sidebarRight")
404138
+ };
404139
+ } catch {
404140
+ return;
404141
+ }
404142
+ };
404143
+ return {
404144
+ available() {
404145
+ const capabilitiesNow = capabilities();
404146
+ return Boolean(capabilitiesNow?.tabs?.get?.("forge-panel") && capabilitiesNow.tabs.get("forge-changes") && capabilitiesNow.service?.openTab && capabilitiesNow.service.openResource);
404147
+ },
404148
+ open(sessionId, local = false) {
404149
+ if (!sessionId || current() !== sessionId || !this.available()) return false;
404150
+ const service = capabilities().service;
404151
+ try {
404152
+ if (local) service.openResource("dsh-resource://forge-changes/" + encodeURIComponent(sessionId) + "/local", { kind: "forge-changes" });
404153
+ else service.openTab("forge-panel");
404154
+ return true;
404155
+ } catch {
404156
+ return false;
404157
+ }
404158
+ }
404159
+ };
404160
+ }
404161
+ //#endregion
404162
+ //#region src/client/contextMenusOfficial.ts
404163
+ let ownerSeq = 0;
404164
+ /** @public @author ddj 2026年11月04号 @param ctx Optional service context. @returns Retry-on-use bridge for late service registration, with legacy fallback. */
404165
+ function lazyMenus(ctx) {
404166
+ let bridge;
404167
+ let stopped = false;
404168
+ return {
404169
+ open(...args) {
404170
+ if (stopped) return false;
404171
+ bridge ??= officialMenus(ctx);
404172
+ return bridge?.open(...args) ?? false;
404173
+ },
404174
+ invalidate(valid) {
404175
+ bridge?.invalidate(valid);
404176
+ },
404177
+ dispose() {
404178
+ stopped = true;
404179
+ bridge?.dispose();
404180
+ bridge = void 0;
404181
+ }
404182
+ };
404183
+ }
404184
+ /** @public @author ddj 2026年11月04号 @param ctx Optional service context. @returns Scoped bridge or no capability, preserving the existing popup. */
404185
+ function officialMenus(ctx) {
404186
+ let service;
404187
+ try {
404188
+ service = ctx.get("contextMenus");
404189
+ } catch {
404190
+ return;
404191
+ }
404192
+ if (!service || typeof service.register !== "function" || typeof service.open !== "function" || typeof service.close !== "function") return void 0;
404193
+ const owner = "edrv-menu-" + ++ownerSeq;
404194
+ let current;
404195
+ let revision = 0;
404196
+ let stopped = false;
404197
+ const disposers = [];
404198
+ try {
404199
+ for (const kind of ["resource", "tab"]) disposers.push(service.register({
404200
+ id: owner + "-" + kind,
404201
+ target: "edrv." + kind,
404202
+ order: 30,
404203
+ resolve: (target, signal) => {
404204
+ const opening = current;
404205
+ if (stopped || target.owner !== owner || !opening || !opening.valid() || signal.aborted) return [];
404206
+ return opening.items.map((item) => ({
404207
+ id: item.id,
404208
+ label: item.label,
404209
+ disabled: item.disabled,
404210
+ danger: item.danger,
404211
+ separatorBefore: item.separator,
404212
+ commandId: item.commandId,
404213
+ run: async () => {
404214
+ if (stopped || opening.revision !== revision || !opening.valid() || item.disabled) return;
404215
+ await item.run();
404216
+ }
404217
+ }));
404218
+ }
404219
+ }));
404220
+ } catch {
404221
+ for (const dispose of disposers) dispose();
404222
+ return;
404223
+ }
404224
+ /** @private @author ddj 2026年11月04号 Close only this bridge's active shared popup. */
404225
+ function closeOwned() {
404226
+ const active = service.active?.getSnapshot();
404227
+ if (active?.value?.owner === owner && (active.kind === "edrv.resource" || active.kind === "edrv.tab")) service.close();
404228
+ }
404229
+ return {
404230
+ open(kind, sessionId, path, point, items, valid) {
404231
+ if (stopped || !sessionId || !valid()) return false;
404232
+ current = {
404233
+ items,
404234
+ valid,
404235
+ revision: ++revision
404236
+ };
404237
+ try {
404238
+ service.open({
404239
+ kind: "edrv." + kind,
404240
+ value: {
404241
+ owner,
404242
+ sessionId,
404243
+ path
404244
+ }
404245
+ }, point);
404246
+ return true;
404247
+ } catch {
404248
+ current = void 0;
404249
+ return false;
404250
+ }
404251
+ },
404252
+ invalidate(valid) {
404253
+ if (current?.valid !== valid) return;
404254
+ revision++;
404255
+ current = void 0;
404256
+ closeOwned();
404257
+ },
404258
+ dispose() {
404259
+ stopped = true;
404260
+ revision++;
404261
+ current = void 0;
404262
+ closeOwned();
404263
+ for (const dispose of disposers) dispose();
404264
+ }
404265
+ };
404266
+ }
404267
+ //#endregion
403936
404268
  //#region src/client/ui/McpSessionStatus.ts
403937
404269
  /** Official session-row slots; no DOM patching or session activation. @author ddj 2026年10月20号 */
403938
404270
  const labels = {
@@ -404271,6 +404603,16 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404271
404603
  active: state.fileClaim,
404272
404604
  note: state.fileClaim ? "聊天文件链接转发进单一编辑器页签" : "官方文件链接认领未安装"
404273
404605
  });
404606
+ if (state.officialMenus !== void 0) items.push({
404607
+ name: "官方右键菜单",
404608
+ active: state.officialMenus,
404609
+ note: state.officialMenus ? "插件动作接入共享菜单" : "服务缺失或装配失败,保留插件菜单"
404610
+ });
404611
+ if (state.forge !== void 0) items.push({
404612
+ name: "Forge 导航",
404613
+ active: state.forge,
404614
+ note: state.forge ? "导航至官方面板与本地变更;PR 保持官方审查" : "官方 Forge 未安装或未启用,不自动启用"
404615
+ });
404274
404616
  return items;
404275
404617
  }
404276
404618
  //#endregion
@@ -404339,8 +404681,12 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404339
404681
  const sessionId = props?.sessionId;
404340
404682
  const useTabInfo = props?.useTabInfo;
404341
404683
  let navigation;
404684
+ let tab;
404685
+ let visible = true;
404342
404686
  if (typeof useTabInfo === "function") try {
404343
- navigation = useTabInfo()?.tab?.navigation;
404687
+ tab = useTabInfo()?.tab;
404688
+ navigation = tab?.navigation;
404689
+ visible = tab?.visible !== false;
404344
404690
  } catch {
404345
404691
  navigation = void 0;
404346
404692
  }
@@ -404371,19 +404717,25 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404371
404717
  if (revision <= 0) return;
404372
404718
  const fileHit = parseOfficialFileAddress(navigation?.address);
404373
404719
  if (fileHit) {
404374
- const line = navigation?.params?.line;
404720
+ const line = resolveNavLine(navigation?.params);
404375
404721
  window.dispatchEvent(new CustomEvent("edrv:open-editor", { detail: {
404722
+ sessionId,
404723
+ ownerId: tab?.id,
404376
404724
  path: fileHit.path,
404377
- line: typeof line === "number" ? line : void 0,
404725
+ line,
404726
+ column: resolveNavColumn(navigation?.params),
404378
404727
  preview: navigation?.params?.preview
404379
404728
  } }));
404380
404729
  return;
404381
404730
  }
404382
404731
  const request = resolveNavOpen(navigation?.params);
404383
404732
  window.dispatchEvent(new CustomEvent("edrv:open-editor", { detail: {
404733
+ sessionId,
404734
+ ownerId: tab?.id,
404384
404735
  path: request.path,
404385
404736
  focusDiff: request.focusDiff,
404386
404737
  line: resolveNavLine(navigation?.params),
404738
+ column: resolveNavColumn(navigation?.params),
404387
404739
  preview: navigation?.params?.preview
404388
404740
  } }));
404389
404741
  });
@@ -404391,11 +404743,15 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404391
404743
  key: sessionId,
404392
404744
  sessionId,
404393
404745
  layout: "side",
404746
+ visible,
404747
+ ownerId: tab?.id,
404394
404748
  schedule: props?.schedule,
404395
404749
  addToConversation: props?.addToConversation,
404396
404750
  sidebarPanels: props?.sidebarPanels,
404397
404751
  outlineSources: props?.outlineSources,
404398
404752
  fileMenuItems: props?.fileMenuItems,
404753
+ officialMenus: props?.officialMenus,
404754
+ forge: props?.forge,
404399
404755
  fileOpeners: props?.fileOpeners,
404400
404756
  sessions: props?.sessions
404401
404757
  });
@@ -404462,17 +404818,27 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404462
404818
  const [failed, setFailed] = react$1.default.useState(false);
404463
404819
  const doneRef = react$1.default.useRef(-1);
404464
404820
  react$1.default.useEffect(() => {
404465
- if (revision === doneRef.current) return;
404466
- doneRef.current = revision;
404821
+ const intent = JSON.stringify([
404822
+ props?.sessionId,
404823
+ tab?.id,
404824
+ revision,
404825
+ navigation?.address
404826
+ ]);
404827
+ if (intent === doneRef.current) return;
404467
404828
  const parsed = parseOfficialFileAddress(navigation?.address);
404468
404829
  if (!parsed) {
404469
404830
  setFailed(true);
404470
404831
  return;
404471
404832
  }
404472
404833
  const line = resolveNavLine(navigation?.params);
404834
+ const column = resolveNavColumn(navigation?.params);
404835
+ let alive = true;
404836
+ setFailed(false);
404473
404837
  let left = FORWARD_ATTEMPTS;
404474
404838
  const attempt = () => {
404475
- if (forwardToEditor(service, parsed.path, line, navigation?.params?.preview)) {
404839
+ if (!alive || tab?.signal?.aborted) return;
404840
+ if (forwardToEditor(typeof tab?.actions?.openTab === "function" ? tab.actions : service, parsed.path, line, navigation?.params?.preview, column)) {
404841
+ doneRef.current = intent;
404476
404842
  closeTab(tab);
404477
404843
  return;
404478
404844
  }
@@ -404481,7 +404847,15 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
404481
404847
  else setFailed(true);
404482
404848
  };
404483
404849
  attempt();
404484
- }, [revision]);
404850
+ return () => {
404851
+ alive = false;
404852
+ };
404853
+ }, [
404854
+ revision,
404855
+ props?.sessionId,
404856
+ tab?.id,
404857
+ navigation?.address
404858
+ ]);
404485
404859
  if (!failed || typeof fallback !== "function") return null;
404486
404860
  return react$1.default.createElement(fallback, props);
404487
404861
  }
@@ -408716,13 +409090,26 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
408716
409090
  function menu(event) {
408717
409091
  onContext(path, type, event);
408718
409092
  }
409093
+ /** @private @author ddj 2026年11月04号 @param event Keyboard context trigger anchored to the focused row. */
409094
+ function menuKey(event) {
409095
+ if (event.key !== "ContextMenu" && !(event.shiftKey && event.key === "F10")) return;
409096
+ const rect = event.currentTarget.getBoundingClientRect();
409097
+ onContext(path, type, {
409098
+ preventDefault: () => event.preventDefault(),
409099
+ stopPropagation: () => event.stopPropagation(),
409100
+ clientX: rect.left,
409101
+ clientY: rect.bottom
409102
+ });
409103
+ }
408719
409104
  return react$1.default.createElement("div", {
408720
409105
  className: "edrv-tree-row" + (active ? " edrv-tree-active" : "") + (context ? " edrv-tree-context" : "") + (reveal ? " edrv-tree-reveal" : "") + (mark?.stale ? " edrv-tree-stale" : ""),
408721
409106
  title: path + (mark?.stale ? ";SVN 状态陈旧,等待确认" : ""),
408722
409107
  "data-edrv-path": path,
408723
409108
  style: { paddingLeft: 6 + depth * 14 },
409109
+ tabIndex: 0,
408724
409110
  onClick: select,
408725
- onContextMenu: menu
409111
+ onContextMenu: menu,
409112
+ onKeyDown: menuKey
408726
409113
  }, react$1.default.createElement("span", { className: "edrv-tree-chev" }, isDir ? isOpen ? "▾" : "▸" : ""), react$1.default.createElement("span", { className: "edrv-tree-iconbox" }, rowIconEl({ name }, isDir, isOpen), svnOverlayEl(viewOverlayOf(mark), remote)), react$1.default.createElement("span", { className: "edrv-tree-name" + (type === "other" ? " edrv-tree-dim" : "") }, name), pending > 0 ? react$1.default.createElement("span", { className: "edrv-tree-badge" }, String(pending)) : null);
408727
409114
  }
408728
409115
  const ExplorerRow = react$1.default.memo(rowView);
@@ -409182,6 +409569,54 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
409182
409569
  if (menu && !menuValid) setMenu(null);
409183
409570
  }
409184
409571
  react$1.default.useEffect(closeLostMenu, [menu, menuValid]);
409572
+ const liveMenu = react$1.default.useRef({
409573
+ scope,
409574
+ treeRows,
409575
+ sessionId: ctx?.sessionId,
409576
+ alive: true
409577
+ });
409578
+ const openingValid = react$1.default.useRef(null);
409579
+ liveMenu.current = {
409580
+ scope,
409581
+ treeRows,
409582
+ sessionId: ctx?.sessionId,
409583
+ alive: liveMenu.current.alive
409584
+ };
409585
+ react$1.default.useEffect(() => {
409586
+ liveMenu.current.alive = ctx?.visible !== false;
409587
+ return () => {
409588
+ liveMenu.current.alive = false;
409589
+ if (openingValid.current) ctx?.officialMenus?.invalidate(openingValid.current);
409590
+ };
409591
+ }, [
409592
+ scope,
409593
+ ctx?.sessionId,
409594
+ ctx?.officialMenus,
409595
+ ctx?.visible
409596
+ ]);
409597
+ react$1.default.useEffect(() => {
409598
+ if (!menuValid || !ctx?.officialMenus || !ctx.sessionId) return;
409599
+ const target = { ...menu.target };
409600
+ const sessionId = ctx.sessionId;
409601
+ const valid = () => liveMenu.current.alive && liveMenu.current.sessionId === sessionId && liveMenu.current.scope === menu.scope && (target.path === "" || liveMenu.current.treeRows.some((row) => row.e?.path === target.path));
409602
+ openingValid.current = valid;
409603
+ const items = buildTreeMenu(ctx.fileMenuItems, target, ctx).map((item) => ({
409604
+ id: item.id,
409605
+ label: item.label,
409606
+ disabled: item.disabled,
409607
+ danger: item.danger,
409608
+ separator: item.separator,
409609
+ run: () => item.run(target, ctx)
409610
+ }));
409611
+ if (ctx.officialMenus.open("resource", ctx.sessionId, target.path, {
409612
+ x: menu.x,
409613
+ y: menu.y
409614
+ }, items, valid)) setMenu(null);
409615
+ }, [
409616
+ menu,
409617
+ menuValid,
409618
+ ctx?.officialMenus
409619
+ ]);
409185
409620
  const menuEntries = menuValid ? buildTreeMenu(ctx?.fileMenuItems, menu.target, ctx).map((item) => ({
409186
409621
  id: item.id,
409187
409622
  label: item.label,
@@ -412672,6 +413107,26 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
412672
413107
  function createDefaultFileMenuItems() {
412673
413108
  return [
412674
413109
  ...openGroupItems(),
413110
+ {
413111
+ id: "forge-open",
413112
+ label: "打开 Forge",
413113
+ order: 6,
413114
+ group: GROUP_OPEN,
413115
+ visible: (_target, ctx) => ctx.forge?.available() === true,
413116
+ run: (_target, ctx) => {
413117
+ if (ctx.sessionId) ctx.forge?.open(ctx.sessionId);
413118
+ }
413119
+ },
413120
+ {
413121
+ id: "forge-local",
413122
+ label: "查看本地变更(Forge)",
413123
+ order: 7,
413124
+ group: GROUP_OPEN,
413125
+ visible: (_target, ctx) => ctx.forge?.available() === true,
413126
+ run: (_target, ctx) => {
413127
+ if (ctx.sessionId) ctx.forge?.open(ctx.sessionId, true);
413128
+ }
413129
+ },
412675
413130
  ...revealGroupItems(),
412676
413131
  ...refGroupItems(),
412677
413132
  ...clipGroupItems(),
@@ -414513,7 +414968,9 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
414513
414968
  officialSidebar: officialService !== void 0,
414514
414969
  fileClaim: claimDisposer !== null,
414515
414970
  claimWanted: shouldClaimFiles(selected),
414516
- selected
414971
+ selected,
414972
+ officialMenus: Boolean(ctx.get("contextMenus")),
414973
+ forge: forge.available()
414517
414974
  }, version);
414518
414975
  ctx.provide("fileOpeners", registry);
414519
414976
  ctx.effect(() => registry.register(vscodeOpener()), "vscode-mode: file opener");
@@ -414545,12 +415002,17 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
414545
415002
  const sidebar = scanSidebar(ctx);
414546
415003
  return sidebar ? registry.register(sidebar) : void 0;
414547
415004
  }, "vscode-mode: sidebar file opener");
415005
+ const forge = forgeBridge(ctx, () => readSessionScope(ctx).sessionId ?? void 0);
415006
+ const menuBridge = lazyMenus(ctx);
415007
+ if (menuBridge) ctx.effect(() => () => menuBridge.dispose(), "vscode-mode: official menus");
414548
415008
  const officialRenderTab = (props) => react$1.default.createElement(OfficialSideTab, Object.assign({}, props, {
414549
415009
  schedule,
414550
415010
  addToConversation,
414551
415011
  sidebarPanels,
414552
415012
  outlineSources,
414553
415013
  fileMenuItems,
415014
+ officialMenus: menuBridge,
415015
+ forge,
414554
415016
  fileOpeners: registry,
414555
415017
  sessions,
414556
415018
  readSessionScope: () => readSessionScope(ctx)
@@ -414735,6 +415197,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
414735
415197
  sidebarPanels,
414736
415198
  outlineSources,
414737
415199
  fileMenuItems,
415200
+ officialMenus: menuBridge,
415201
+ forge,
414738
415202
  fileOpeners: registry,
414739
415203
  sessions
414740
415204
  })));
@@ -414820,6 +415284,8 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
414820
415284
  sidebarPanels,
414821
415285
  outlineSources,
414822
415286
  fileMenuItems,
415287
+ officialMenus: menuBridge,
415288
+ forge,
414823
415289
  fileOpeners: registry,
414824
415290
  sessions
414825
415291
  })),
@@ -414929,6 +415395,17 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
414929
415395
  compatSummary,
414930
415396
  getShortcuts: () => detectShortcuts(ctx)
414931
415397
  })));
415398
+ registerSlotSafely(ctx, {
415399
+ name: "settings.section.icon",
415400
+ id: "vscode-mode",
415401
+ order: 30
415402
+ }, (input) => {
415403
+ const props = input;
415404
+ return react$1.default.createElement(IconCodeOutline16, {
415405
+ size: props.size ?? 16,
415406
+ className: props.active ? "edrv-settings-active" : void 0
415407
+ });
415408
+ });
414932
415409
  registerSlotSafely(ctx, {
414933
415410
  name: "plugins.detail.section",
414934
415411
  id: "edrv-plugin-status",