dsh-code-server-app 0.3.42 → 0.3.44
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/assets/extensions/dshcs-editor-bridge/lib/ask-panel.js +3 -0
- package/assets/extensions/dshcs-editor-bridge/package.json +1 -1
- package/assets/extensions/dshcs-editor-bridge/webview/THIRD-PARTY.md +1 -1
- package/assets/extensions/dshcs-editor-bridge/webview/src/app.jsx +11 -3
- package/assets/extensions/dshcs-editor-bridge/webview/src/thread.jsx +11 -2
- package/assets/extensions/dshcs-editor-bridge/webview/thread.js +48 -48
- package/lib/bridge-thread.mjs +13 -0
- package/package.json +1 -1
- package/vendor/VENDOR.json +1 -1
|
@@ -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.
|
|
5
|
+
"version": "0.2.15",
|
|
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:
|
|
14
|
+
生成时间:2026-09-13T13:24:35.092Z
|
|
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 界面一致)
|
|
@@ -133,10 +133,18 @@ function App() {
|
|
|
133
133
|
if (node !== null && stickRef.current) node.scrollTop = node.scrollHeight;
|
|
134
134
|
}, [view.entries]);
|
|
135
135
|
|
|
136
|
-
//
|
|
136
|
+
// 任何一趟宿主状态回来都解除"发送中"的按钮锁(0.3.44)。
|
|
137
|
+
// 老写法盯着 `view.status` 变化 —— 而对话框形态下宿主回的 status **一直是 'idle'**,
|
|
138
|
+
// 于是那个 effect 永远不再触发:第一次发送之后按钮就永久变灰(实测"只能发送一次,没法追问")。
|
|
137
139
|
useEffect(() => {
|
|
138
|
-
|
|
139
|
-
}, [view
|
|
140
|
+
setSending(false);
|
|
141
|
+
}, [view]);
|
|
142
|
+
// 兜底:万一某一趟状态没回来(宿主卡住/请求失败),最多 15 秒也把锁解开。
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (sending !== true) return undefined;
|
|
145
|
+
const timer = window.setTimeout(() => setSending(false), 15000);
|
|
146
|
+
return () => window.clearTimeout(timer);
|
|
147
|
+
}, [sending]);
|
|
140
148
|
|
|
141
149
|
const onScroll = () => {
|
|
142
150
|
const node = logRef.current;
|
|
@@ -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">
|