dsh-code-server-app 0.3.19 → 0.3.20

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.
@@ -34,6 +34,7 @@ const { createDiffCache, describeChange } = require('./lib/diff-model.js');
34
34
  const {
35
35
  applyAnswers,
36
36
  createPanelState,
37
+ currentTurn,
37
38
  describeContext,
38
39
  panelPayload,
39
40
  pushQuestion,
@@ -379,8 +380,17 @@ async function pollOnce() {
379
380
  if ((result.events ?? []).length > 0) client.persist();
380
381
  // 回答同步:host 把 agent 的正文放在 answers 里(见 lib/bridge-answer.mjs),
381
382
  // 面板每趟轮询刷新一次 —— 不需要第二个定时器,也不需要流式协议。
382
- if (askPanel !== null && result.answers !== undefined) {
383
- if (applyAnswers(askPanel.state, result.answers, askPanel.state.sessionId)) refreshAskPanel();
383
+ if (askPanel !== null) {
384
+ if (result.answers === undefined) {
385
+ // 旧版 host(≤0.3.18)没有这个字段:此时面板会永远停在"正在回答…",必须说出原因。
386
+ askPanel.stalePolls = (askPanel.stalePolls ?? 0) + 1;
387
+ if (askPanel.stalePolls === 15 && askPanel.state.sessionId !== null && askPanel.state.status === 'thinking') {
388
+ failAskPanel('宿主没有回复同步能力(插件版本过旧?):请重启 dsh web 让 host 侧升级到 0.3.19 以上');
389
+ }
390
+ } else {
391
+ askPanel.stalePolls = 0;
392
+ if (applyAnswers(askPanel.state, result.answers, askPanel.state.sessionId)) refreshAskPanel();
393
+ }
384
394
  }
385
395
  }
386
396
 
@@ -441,6 +451,17 @@ function refreshAskPanel() {
441
451
  void askPanel.panel.webview.postMessage(payload);
442
452
  }
443
453
 
454
+ /** 面板进入错误态:状态行 + 当前轮都标上原因(绝不静默)。 */
455
+ function failAskPanel(message) {
456
+ if (askPanel === null) return;
457
+ askPanel.state.status = 'error';
458
+ askPanel.state.error = message;
459
+ const turn = currentTurn(askPanel.state);
460
+ if (turn !== null) turn.error = message;
461
+ log(message);
462
+ refreshAskPanel();
463
+ }
464
+
444
465
  /** 面板收到一条提问:投递到 DSH,并把这一轮放进状态里等回答。 */
445
466
  async function sendAskFromPanel(text) {
446
467
  if (askPanel === null || client === null) return;
@@ -2,7 +2,7 @@
2
2
  "name": "dshcs-editor-bridge",
3
3
  "displayName": "DSH Editor Bridge",
4
4
  "description": "只读地把编辑器状态(未保存缓冲区、诊断、活动选区)提供给 DSH,并让编辑器里的动作驱动 DSH 会话。由 dsh-code-server-app 插件安装,可禁用。",
5
- "version": "0.2.0",
5
+ "version": "0.2.1",
6
6
  "publisher": "dsh-code-server-app",
7
7
  "license": "MIT",
8
8
  "private": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
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. 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-13T06:39:47.464Z",
6
+ "preparedAt": "2026-09-13T06:41:44.563Z",
7
7
  "source": "registry",
8
8
  "node": "v24.21.0",
9
9
  "platform": "win32",