dsh-code-server-app 0.3.41 → 0.3.43

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.
@@ -78,6 +78,8 @@ function cleanEntry(raw) {
78
78
  thinking: typeof raw.thinking === 'string' ? raw.thinking.slice(0, MAX_TEXT) : '',
79
79
  // 注入的上下文(0.3.24):桥自己拼的位置行 + 选区代码块,渲染成默认收起的「上下文」行。
80
80
  context: typeof raw.context === 'string' ? raw.context.slice(0, MAX_TEXT) : '',
81
+ // 消息来源(0.3.43):非 'user' = 上下文注入,渲染成折叠行。
82
+ sourceKind: typeof raw.sourceKind === 'string' && raw.sourceKind !== '' ? raw.sourceKind : null,
81
83
  streaming: raw.streaming === true,
82
84
  name: typeof raw.name === 'string' ? raw.name : null,
83
85
  summary: typeof raw.summary === 'string' ? raw.summary : null,
@@ -101,6 +103,7 @@ function entriesSignature(entries) {
101
103
  entry.text.length,
102
104
  entry.thinking.length,
103
105
  entry.context.length,
106
+ entry.sourceKind === null ? '' : entry.sourceKind.length,
104
107
  entry.summary === null ? '' : entry.summary.length,
105
108
  ].join(':'));
106
109
  }
@@ -2,7 +2,7 @@
2
2
  "name": "dshcs-editor-bridge",
3
3
  "displayName": "DSH Editor Bridge",
4
4
  "description": "只读地把编辑器状态(未保存缓冲区、诊断、活动选区)提供给 DSH;右键提问打开 DSH 页面里的悬浮对话对话框(0.2.5;老宿主退回编辑器面板),正文/思考/上下文都用 DSH 官方渲染器,并可就地回答授权请求。由 dsh-code-server-app 插件安装,可禁用。",
5
- "version": "0.2.13",
5
+ "version": "0.2.14",
6
6
  "publisher": "dsh-code-server-app",
7
7
  "license": "MIT",
8
8
  "private": true,
@@ -11,7 +11,7 @@
11
11
  | react | 18.3.1 | MIT |
12
12
  | react-dom | 18.3.1 | MIT |
13
13
 
14
- 生成时间:2026-09-13T13:12:04.600Z
14
+ 生成时间:2026-09-13T13:18:21.529Z
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 界面一致)
@@ -77,7 +77,7 @@ function ThinkingRow({ text, running }) {
77
77
  * 与 DSH 界面对注入上下文的处理一致 —— 默认折叠,只留一行摘要;点开才看得到那段代码。
78
78
  * 摘要取位置行(第一行),去掉 `From the editor: ` 前缀(标题已经说了"来自编辑器")。
79
79
  */
80
- function ContextRow({ text }) {
80
+ function ContextRow({ text, title = '上下文' }) {
81
81
  const [expanded, setExpanded] = useState(false);
82
82
  const firstLine = text.split('\n')[0] ?? '';
83
83
  const summary = firstLine.replace(/^From the editor:\s*/i, '');
@@ -85,7 +85,7 @@ function ContextRow({ text }) {
85
85
  <div className="dshcs-context" data-expanded={expanded || undefined}>
86
86
  <DisclosureRow
87
87
  icon={<IconContextInjectionOutline16 size={16} />}
88
- title="上下文"
88
+ title={title}
89
89
  open={expanded}
90
90
  expandable
91
91
  expandOnRowClick
@@ -100,6 +100,15 @@ function ContextRow({ text }) {
100
100
 
101
101
  export const ThreadEntry = memo(function ThreadEntry({ entry }) {
102
102
  if (entry.role === 'user') {
103
+ // **别的工具注入的上下文不是"用户说的"**(0.3.43):DSH 界面按「上下文注入」折叠显示,面板照做 ——
104
+ // 否则这些注入会变成一屏用户气泡,把真正的对话挤掉。
105
+ if (typeof entry.sourceKind === 'string' && entry.sourceKind !== '') {
106
+ return (
107
+ <div className="dshcs-msg dshcs-injection">
108
+ <ContextRow text={entry.text} title="上下文注入" />
109
+ </div>
110
+ );
111
+ }
103
112
  const context = typeof entry.context === 'string' ? entry.context : '';
104
113
  return (
105
114
  <div className="dshcs-msg dshcs-user">