dsh-code-server-app 0.3.33 → 0.3.35

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.
@@ -11,7 +11,7 @@
11
11
  | react | 18.3.1 | MIT |
12
12
  | react-dom | 18.3.1 | MIT |
13
13
 
14
- 生成时间:2026-09-13T12:04:36.996Z
14
+ 生成时间:2026-09-13T12:19:47.070Z
15
15
  渲染器:@deepseek-ai/dsh-client-ui-primitives@0.1.5-rc.2(DSH 部署的界面版本:0.1.5-rc.2)
16
16
  设计令牌:@deepseek-ai/dsh-client-ui-theme@0.1.5-rc.2(11 段)
17
17
  KaTeX:已打包(公式排版与 DSH 界面一致)
package/lib/index.js CHANGED
@@ -756,7 +756,9 @@ export async function apply(ctx, config) {
756
756
  /** 上次记录过的"有没有人在看"(0.3.30:状态翻转才写诊断日志)。 */
757
757
  let bridgeWatchLogged = false;
758
758
  /** 首帧是否已写过诊断(0.3.31:"一直没人看"也要留下证据)。 */
759
- let bridgeWatchWroteFirst = false;
759
+ let bridgeWatchWroteFirst = false;
760
+ /** 上次写过的 hasPanel 判据原文(变了才写,避免每 600ms 刷屏)。 */
761
+ let bridgeHasPanelLine = '';
760
762
  /** 客户端(self-declared)是否能把授权卡片画出来(0.3.30)。 */
761
763
  let bridgeApprovalsUi = false;
762
764
  let bridgeApprovalsUiLogged = false;
@@ -808,7 +810,17 @@ export async function apply(ctx, config) {
808
810
  // 客户端能画卡片 = 编辑器面板自报可以的 **或** 对话框开着且有会话(0.3.33)。
809
811
  // "活着"由 /ask/state 轮询证明)。0.3.31 的日志给出了反例:用户从**对话框**提问 ⇒
810
812
  // 编辑器面板是 null ⇒ 旧判据误判成"画不出卡片",授权被让给了 DSH 界面。
811
- hasPanel: () => hasWatcher() && (bridgeApprovalsUi || (askDialog.open && askDialog.sessionId !== null)),
813
+ hasPanel: () => {
814
+ const watcher = hasWatcher();
815
+ const dialogCapable = askDialogLive();
816
+ const verdict = watcher && (bridgeApprovalsUi || dialogCapable);
817
+ // 判据的**原始值**一起落日志(0.3.35):只记结论的话,出问题还是只能猜。
818
+ const line = 'hasPanel -> ' + verdict + ' (hasWatcher=' + watcher + ' approvalsUi=' + bridgeApprovalsUi
819
+ + ' dialogLive=' + dialogCapable + ' polls=' + askDialog.polls + ' open=' + askDialog.open
820
+ + ' session=' + String(askDialog.sessionId) + ')';
821
+ if (line !== bridgeHasPanelLine) { bridgeHasPanelLine = line; bridgeDiag(line); }
822
+ return verdict;
823
+ },
812
824
  log: (message) => {
813
825
  console.warn(`[code-server] 编辑器桥授权:${message}`);
814
826
  bridgeDiag(`approval: ${message}`);
@@ -835,7 +847,14 @@ export async function apply(ctx, config) {
835
847
  * 这个能力;否则扩展退回编辑器面板 —— 那是验证过、能看能点的 UI。
836
848
  */
837
849
  function askDialogLive() {
838
- return askDialog.polls > 0 && Date.now() - askDialog.lastPollAt < 5000;
850
+ // 对话框每 900ms 问一次 /ask/state —— 那就是"活跃心跳"。心跳一旦建立,在 TTL 内
851
+ // **整个 DSH 侧都把授权拦截到编辑器侧**(用户的要求:对话框开着就持续发活跃通知)。
852
+ // TTL 取 10 分钟:浏览器后台节流会把 900ms 拖到分钟级,短 TTL 会让"人就在编辑器旁边"
853
+ // 被误判成"没人看"(实测连续踩了两轮)。
854
+ const TTL_MS = 10 * 60 * 1000;
855
+ if (askDialog.polls > 0 && Date.now() - askDialog.lastPollAt < TTL_MS) return true;
856
+ // 心跳还没建立(刚重启)时:对话框开着且有会话也算。
857
+ return askDialog.open && askDialog.sessionId !== null;
839
858
  }
840
859
 
841
860
  /** 缓存里的活动编辑器 → 提问上下文(mode 决定带不带行号/选区,与扩展侧 0.3.21 的语义一致)。 */
@@ -2065,7 +2084,11 @@ export async function apply(ctx, config) {
2065
2084
  async function handleAskState(request) {
2066
2085
  // 这一条就是"客户端半部活着"的证据(能力位 askDialog 以它为准,见 askDialogLive)。
2067
2086
  askDialog.polls += 1;
2068
- askDialog.lastPollAt = Date.now();
2087
+ askDialog.lastPollAt = Date.now();
2088
+ // 心跳证据(0.3.35):首次 + 每 40 次写一行,证明"对话框在持续发活跃通知"。
2089
+ if (askDialog.polls % 40 === 1) {
2090
+ bridgeDiag('dialog heartbeat #' + askDialog.polls + ' (open=' + askDialog.open + ' session=' + String(askDialog.sessionId) + ')');
2091
+ }
2069
2092
  if (askDialog.polls === 1) {
2070
2093
  console.log('[code-server] 「问 DSH」对话框已连上客户端半部:/ask/state 开始轮询');
2071
2094
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
4
4
  "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). Since 0.3.0 the bundle also ships an editor bridge (assets/extensions/dshcs-editor-bridge): a read-only channel between the in-tree VS Code extension host and DSH, giving the agent what only the editor knows (unsaved buffers, language-server diagnostics, the active selection) and letting editor gestures drive the session. Since 0.3.22 the ask panel renders that session's new content with DSH's own Markdown renderer (pinned to the deployed DSH UI version); since 0.3.23 it is a full-width dialog with collapsible thinking rows and can answer approval requests in place — the bridge's only non-read-only route (POST /approve, constrained to pending in-process requests and the outcomes allowed-once/rejected; panel-first for 5 minutes, handed back to the official card the moment the panel closes). The tab claims DSH file addresses (dsh-resource://file/**) by file type (setting claimExtensions), so the product's own produced-file chips, delivered-file previews and inline prose mentions open in the workbench. The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads it. Opening the tab switches the right sidebar to fullscreen by default (setting fullscreenOnOpen). Following a workspace switch is lightweight: the workbench re-navigates with the new ?folder= and the IDE process is not restarted (since 0.2.12). Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.137.0",
4
4
  "productPath": "stable-b11dabdaca0d3369986975be285db92c8795cea5",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-13T12:04:35.817Z",
6
+ "preparedAt": "2026-09-13T12:19:45.959Z",
7
7
  "source": "registry",
8
8
  "node": "v24.21.0",
9
9
  "platform": "win32",