@ahggg/dsh-side-chat 0.7.3 → 1.0.0
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/README.md +15 -12
- package/README.zh-CN.md +15 -12
- package/lib/client/apply.js +48 -32
- package/lib/client/contracts.d.ts +3 -58
- package/lib/client/dsh/ReadOnlyConversation.d.ts +10 -0
- package/lib/client/dsh/ReadOnlyConversation.js +91 -0
- package/lib/client/dsh/SideChatOverlay.d.ts +7 -0
- package/lib/client/{rc6/Rc6SideChatOverlay.js → dsh/SideChatOverlay.js} +26 -56
- package/lib/client/{rc6 → dsh}/context.d.ts +4 -6
- package/lib/client/dsh/conversation-store.d.ts +22 -0
- package/lib/client/dsh/conversation-store.js +19 -0
- package/lib/client/dsh/primitive-labels.d.ts +2 -0
- package/lib/client/dsh/primitive-labels.js +4 -0
- package/lib/client/{rc6 → dsh}/remote-adapter.d.ts +2 -2
- package/lib/client/dsh/remote-adapter.js +22 -0
- package/lib/client/dsh/sessions-adapter.d.ts +56 -0
- package/lib/client/dsh/sessions-adapter.js +185 -0
- package/lib/client/index.d.ts +2 -2
- package/lib/client/panel/SelectionQuote.js +8 -1
- package/lib/client/panel/SideChatErrorState.js +1 -1
- package/lib/client/panel/SideChatModelSelect.js +37 -18
- package/lib/client/panel/SideChatPanel.js +12 -5
- package/lib/client/panel/messages.d.ts +1 -1
- package/lib/client/panel/messages.js +8 -8
- package/lib/client/parent-composer/ParentConversationAnnotations.d.ts +3 -2
- package/lib/client/parent-composer/ParentConversationAnnotations.js +50 -30
- package/lib/client/parent-composer/add-to-conversation.d.ts +14 -28
- package/lib/client/parent-composer/add-to-conversation.js +131 -545
- package/lib/client/parent-composer/annotation-persistence.d.ts +8 -8
- package/lib/client/parent-composer/annotation-persistence.js +106 -102
- package/lib/client/parent-composer/composer-reference.d.ts +17 -55
- package/lib/client/parent-composer/composer-reference.js +20 -72
- package/lib/client/parent-composer/referenced-conversation.d.ts +5 -7
- package/lib/client/parent-composer/referenced-conversation.js +21 -73
- package/lib/client/selection/ConversationAnnotationMarkers.js +5 -1
- package/lib/client/selection/SelectionActions.js +2 -1
- package/lib/client/selection/conversation-dom.d.ts +5 -0
- package/lib/client/selection/conversation-dom.js +24 -0
- package/lib/client/selection/selection-controller.d.ts +1 -1
- package/lib/client/selection/selection-controller.js +7 -3
- package/lib/client/selection/selection-normalizer.js +1 -1
- package/lib/client/side-chat-controller.d.ts +28 -41
- package/lib/client/side-chat-controller.js +245 -337
- package/lib/client.js +81 -52
- package/lib/host/index.d.ts +1 -1
- package/lib/host/index.js +1 -1
- package/lib/host/read-only-chat-service.d.ts +30 -0
- package/lib/host/read-only-chat-service.js +314 -0
- package/lib/index.d.ts +16 -8
- package/lib/index.js +34 -13
- package/lib/remote.d.ts +23 -14
- package/lib/remote.js +2 -5
- package/lib/shared/constants.d.ts +0 -13
- package/lib/shared/constants.js +0 -13
- package/lib/shared/contracts.d.ts +52 -19
- package/lib/shared/contracts.js +2 -3
- package/lib/shared/error-codes.d.ts +1 -1
- package/lib/shared/error-codes.js +2 -2
- package/lib/shared/{archived-wire.d.ts → side-chat-wire.d.ts} +109 -20
- package/lib/shared/side-chat-wire.js +34 -0
- package/lib/typert.d.ts +3 -68
- package/lib/typert.js +60 -4
- package/package.json +76 -56
- package/lib/client/rc6/ArchivedConversation.d.ts +0 -14
- package/lib/client/rc6/ArchivedConversation.js +0 -231
- package/lib/client/rc6/Rc6SideChatOverlay.d.ts +0 -7
- package/lib/client/rc6/SideChatTool.d.ts +0 -22
- package/lib/client/rc6/SideChatTool.js +0 -404
- package/lib/client/rc6/primitive-labels.d.ts +0 -7
- package/lib/client/rc6/primitive-labels.js +0 -60
- package/lib/client/rc6/remote-adapter.js +0 -34
- package/lib/client/rc6/runtime-compat.d.ts +0 -120
- package/lib/client/rc6/runtime-compat.js +0 -187
- package/lib/client/rc6/sessions-adapter.d.ts +0 -64
- package/lib/client/rc6/sessions-adapter.js +0 -387
- package/lib/host/archived-fork-service.d.ts +0 -28
- package/lib/host/archived-fork-service.js +0 -309
- package/lib/shared/archived-wire.js +0 -47
- /package/lib/client/{rc6 → dsh}/context.js +0 -0
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
3
|
-
import { DisclosureRow, IconThinkOutline14, MarkdownText, } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
|
-
import { SIDE_CHAT_MESSAGES } from '../panel/messages.js';
|
|
5
|
-
import { SelectionQuote } from '../panel/SelectionQuote.js';
|
|
6
|
-
import { SendIcon } from '../panel/SendIcon.js';
|
|
7
|
-
import { StopIcon } from '../panel/StopIcon.js';
|
|
8
|
-
import { useAutoGrowingTextarea } from '../panel/use-auto-growing-textarea.js';
|
|
9
|
-
import { RunningToolCard, ToolBlockCard, ToolCard, } from './SideChatTool.js';
|
|
10
|
-
import { MARKDOWN_LABELS } from './primitive-labels.js';
|
|
11
|
-
function stringify(value) {
|
|
12
|
-
if (typeof value === 'string')
|
|
13
|
-
return value;
|
|
14
|
-
try {
|
|
15
|
-
return JSON.stringify(value, null, 2);
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return String(value);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function contentText(content) {
|
|
22
|
-
return content.map((block) => {
|
|
23
|
-
if (block.type === 'text' || block.type === 'reasoning')
|
|
24
|
-
return block.text;
|
|
25
|
-
if (block.type === 'image')
|
|
26
|
-
return '[Image]';
|
|
27
|
-
if (block.type === 'tool-call')
|
|
28
|
-
return `${block.name}(${block.arguments})`;
|
|
29
|
-
if (block.type === 'tool-result')
|
|
30
|
-
return contentText(block.content);
|
|
31
|
-
return stringify(block);
|
|
32
|
-
}).filter(Boolean).join('\n');
|
|
33
|
-
}
|
|
34
|
-
function firstSideChatQuestion(text) {
|
|
35
|
-
const match = /<user_question>([\s\S]*?)<\/user_question>/u.exec(text);
|
|
36
|
-
return match?.[1]?.trim() ?? text;
|
|
37
|
-
}
|
|
38
|
-
function firstLine(text) {
|
|
39
|
-
const newline = text.indexOf('\n');
|
|
40
|
-
return newline === -1 ? text : text.slice(0, newline);
|
|
41
|
-
}
|
|
42
|
-
function latestLine(text) {
|
|
43
|
-
const visible = text.trimEnd();
|
|
44
|
-
const newline = visible.lastIndexOf('\n');
|
|
45
|
-
return newline === -1 ? visible : visible.slice(newline + 1);
|
|
46
|
-
}
|
|
47
|
-
function useThrottledVisualUpdate(update, intervalFrames = 3) {
|
|
48
|
-
const updateRef = useRef(update);
|
|
49
|
-
updateRef.current = update;
|
|
50
|
-
const pendingFrameRef = useRef(null);
|
|
51
|
-
useLayoutEffect(() => () => {
|
|
52
|
-
if (pendingFrameRef.current === null)
|
|
53
|
-
return;
|
|
54
|
-
cancelAnimationFrame(pendingFrameRef.current);
|
|
55
|
-
pendingFrameRef.current = null;
|
|
56
|
-
}, []);
|
|
57
|
-
return useCallback(() => {
|
|
58
|
-
if (pendingFrameRef.current !== null)
|
|
59
|
-
return;
|
|
60
|
-
let remainingFrames = intervalFrames;
|
|
61
|
-
const advance = () => {
|
|
62
|
-
remainingFrames -= 1;
|
|
63
|
-
if (remainingFrames > 0) {
|
|
64
|
-
pendingFrameRef.current = requestAnimationFrame(advance);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
pendingFrameRef.current = null;
|
|
68
|
-
updateRef.current();
|
|
69
|
-
};
|
|
70
|
-
pendingFrameRef.current = requestAnimationFrame(advance);
|
|
71
|
-
}, [intervalFrames]);
|
|
72
|
-
}
|
|
73
|
-
function ReasoningRow({ text, running, locale }) {
|
|
74
|
-
const [expanded, setExpanded] = useState(false);
|
|
75
|
-
const summaryRef = useRef(null);
|
|
76
|
-
const summary = running ? latestLine(text) : firstLine(text);
|
|
77
|
-
const scheduleSummaryScroll = useThrottledVisualUpdate(() => {
|
|
78
|
-
const element = summaryRef.current;
|
|
79
|
-
if (element === null)
|
|
80
|
-
return;
|
|
81
|
-
element.scrollLeft = running ? element.scrollWidth - element.clientWidth : 0;
|
|
82
|
-
});
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
scheduleSummaryScroll();
|
|
85
|
-
}, [running, scheduleSummaryScroll, summary]);
|
|
86
|
-
return (_jsxs("div", { className: "dsh-side-chat-reasoning", "data-variant": "think", "data-state": running ? 'running' : 'ok', children: [running && (_jsx("span", { className: "dsh-side-chat-reasoning-visually-hidden", children: locale === 'zh-CN' ? '运行中' : 'Running' })), _jsx(DisclosureRow, { rowClassName: "dsh-side-chat-reasoning-row", leadingClassName: "dsh-side-chat-reasoning-leading", titleClassName: "dsh-side-chat-reasoning-title", chevronClassName: "dsh-side-chat-reasoning-chevron", icon: _jsx(IconThinkOutline14, { size: 14 }), title: "Think", open: expanded, expandable: true, expandOnRowClick: true, onToggle: () => { setExpanded(value => !value); }, collapsedContent: (_jsxs(_Fragment, { children: [_jsx("span", { className: "dsh-side-chat-reasoning-separator", "aria-hidden": "true" }), _jsx("span", { ref: summaryRef, className: "dsh-side-chat-reasoning-summary", "data-follow-end": running || undefined, children: summary })] })), children: _jsx("div", { className: "dsh-side-chat-reasoning-body", children: text }) })] }));
|
|
87
|
-
}
|
|
88
|
-
function AssistantBlocks({ blocks, streaming = false, projectedToolCallIds, unprojectedToolState = 'pending', cwd, locale }) {
|
|
89
|
-
return _jsx(_Fragment, { children: blocks.map((block, index) => {
|
|
90
|
-
const key = `${block.kind}-${String(index)}`;
|
|
91
|
-
if (block.kind === 'text') {
|
|
92
|
-
return _jsx(MarkdownText, { text: block.text, streaming: streaming, labels: MARKDOWN_LABELS }, key);
|
|
93
|
-
}
|
|
94
|
-
if (block.kind === 'reasoning') {
|
|
95
|
-
return (_jsx(ReasoningRow, { text: block.text, running: streaming && index === blocks.length - 1, locale: locale }, key));
|
|
96
|
-
}
|
|
97
|
-
if (block.kind === 'image')
|
|
98
|
-
return _jsx("div", { children: "[Image attachment]" }, key);
|
|
99
|
-
if (block.kind === 'tool-call') {
|
|
100
|
-
if (projectedToolCallIds.has(block.callId))
|
|
101
|
-
return null;
|
|
102
|
-
return (_jsx(ToolCard, { callId: block.callId, name: block.name, argsRaw: block.argsRaw, state: unprojectedToolState, cwd: cwd }, key));
|
|
103
|
-
}
|
|
104
|
-
return _jsx("pre", { children: stringify(block.block) }, key);
|
|
105
|
-
}) });
|
|
106
|
-
}
|
|
107
|
-
function MessageRow({ node, projectedToolCallIds, cwd, locale }) {
|
|
108
|
-
if (node.kind === 'user' || node.kind === 'steering') {
|
|
109
|
-
return (_jsxs("article", { className: "dsh-side-chat-message", "data-role": "user", children: [_jsx("span", { className: "dsh-side-chat-message-role", children: "You" }), _jsx("div", { className: "dsh-side-chat-message-text", children: firstSideChatQuestion(contentText(node.content)) })] }));
|
|
110
|
-
}
|
|
111
|
-
if (node.kind === 'assistant') {
|
|
112
|
-
return (_jsxs("article", { className: "dsh-side-chat-message", "data-role": "assistant", children: [_jsx("span", { className: "dsh-side-chat-message-role", children: "Assistant" }), _jsx(AssistantBlocks, { blocks: node.blocks, projectedToolCallIds: projectedToolCallIds, unprojectedToolState: node.interrupted === true ? 'interrupted' : 'pending', cwd: cwd, locale: locale }), node.interrupted === true && _jsx("span", { className: "dsh-side-chat-message-note", children: "Stopped" })] }));
|
|
113
|
-
}
|
|
114
|
-
if (node.kind === 'context') {
|
|
115
|
-
return (_jsxs("details", { className: "dsh-side-chat-message dsh-side-chat-context-message", children: [_jsxs("summary", { children: ["Context \u00B7 ", node.provenance.label ?? node.provenance.role] }), _jsx("pre", { children: contentText(node.content) })] }));
|
|
116
|
-
}
|
|
117
|
-
if (node.kind === 'tool-result') {
|
|
118
|
-
return _jsx(ToolBlockCard, { block: node, cwd: cwd });
|
|
119
|
-
}
|
|
120
|
-
if (node.kind === 'turn-error') {
|
|
121
|
-
return _jsx("div", { className: "dsh-side-chat-turn-notice", role: "alert", children: node.message });
|
|
122
|
-
}
|
|
123
|
-
if (node.kind === 'turn-max-tokens') {
|
|
124
|
-
return _jsx("div", { className: "dsh-side-chat-turn-notice", children: "The response reached its output-token limit." });
|
|
125
|
-
}
|
|
126
|
-
if (node.kind === 'model-retry') {
|
|
127
|
-
return _jsxs("div", { className: "dsh-side-chat-turn-notice", children: ["Model retry: ", node.retryState] });
|
|
128
|
-
}
|
|
129
|
-
if (node.kind === 'command') {
|
|
130
|
-
return _jsxs("div", { className: "dsh-side-chat-turn-notice", children: ["/", node.name ?? 'command', " ", node.outcome?.text ?? ''] });
|
|
131
|
-
}
|
|
132
|
-
if (node.kind === 'compaction') {
|
|
133
|
-
return _jsxs("details", { className: "dsh-side-chat-turn-notice", children: [_jsx("summary", { children: "Context compacted" }), _jsx("pre", { children: node.summary })] });
|
|
134
|
-
}
|
|
135
|
-
return _jsxs("details", { className: "dsh-side-chat-turn-notice", children: [_jsx("summary", { children: node.type }), _jsx("pre", { children: stringify(node.data) })] });
|
|
136
|
-
}
|
|
137
|
-
function ApprovalCard({ wait, onRespond, }) {
|
|
138
|
-
return (_jsxs("section", { className: "dsh-side-chat-interaction", "aria-label": "Tool approval required", children: [_jsxs("strong", { children: ["Allow tool: ", wait.toolName, "?"] }), wait.reason !== undefined && _jsx("p", { children: wait.reason }), _jsxs("div", { className: "dsh-side-chat-interaction-actions", children: [_jsx("button", { type: "button", onClick: () => { onRespond('decline'); }, children: "Decline" }), _jsx("button", { type: "button", onClick: () => { onRespond('approve'); }, children: "Allow once" })] })] }));
|
|
139
|
-
}
|
|
140
|
-
function QuestionCard({ wait, onRespond, }) {
|
|
141
|
-
const questions = wait.questions;
|
|
142
|
-
const [answers, setAnswers] = useState(() => Object.fromEntries(questions.map(question => [question.id, { selected: [], custom: '' }])));
|
|
143
|
-
const update = (id, answer) => {
|
|
144
|
-
setAnswers(current => ({ ...current, [id]: answer }));
|
|
145
|
-
};
|
|
146
|
-
const submit = () => {
|
|
147
|
-
onRespond({
|
|
148
|
-
answers: questions.map((question) => {
|
|
149
|
-
const answer = answers[question.id] ?? { selected: [], custom: '' };
|
|
150
|
-
const custom = answer.custom.trim();
|
|
151
|
-
return {
|
|
152
|
-
id: question.id,
|
|
153
|
-
selected: [...answer.selected],
|
|
154
|
-
...(custom.length === 0 ? {} : { custom }),
|
|
155
|
-
};
|
|
156
|
-
}),
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
return (_jsxs("section", { className: "dsh-side-chat-interaction", "aria-label": "Assistant question", children: [questions.map((question) => {
|
|
160
|
-
const answer = answers[question.id] ?? { selected: [], custom: '' };
|
|
161
|
-
return (_jsxs("fieldset", { children: [_jsx("legend", { children: question.header === undefined ? question.question : `${question.header} · ${question.question}` }), question.detail !== undefined && _jsx("p", { children: question.detail }), question.options?.map(option => (_jsxs("label", { className: "dsh-side-chat-question-option", children: [_jsx("input", { type: question.multiSelect === true ? 'checkbox' : 'radio', name: `${wait.key}-${question.id}`, checked: answer.selected.includes(option.label), onChange: (event) => {
|
|
162
|
-
const selected = question.multiSelect === true
|
|
163
|
-
? event.target.checked
|
|
164
|
-
? [...answer.selected, option.label]
|
|
165
|
-
: answer.selected.filter(value => value !== option.label)
|
|
166
|
-
: [option.label];
|
|
167
|
-
update(question.id, { ...answer, selected });
|
|
168
|
-
} }), _jsxs("span", { children: [_jsx("strong", { children: option.label }), option.description === undefined ? '' : ` — ${option.description}`] })] }, option.label))), _jsx("textarea", { rows: 2, value: answer.custom, placeholder: question.options === undefined ? 'Your answer' : 'Other (optional)', onChange: (event) => { update(question.id, { ...answer, custom: event.target.value }); } })] }, question.id));
|
|
169
|
-
}), _jsxs("div", { className: "dsh-side-chat-interaction-actions", children: [_jsx("button", { type: "button", onClick: () => { onRespond(null); }, children: "Cancel" }), _jsx("button", { type: "button", onClick: submit, children: "Submit" })] })] }));
|
|
170
|
-
}
|
|
171
|
-
function PendingCards({ pending, controller, }) {
|
|
172
|
-
return _jsx(_Fragment, { children: pending.map((wait) => wait.kind === 'approval'
|
|
173
|
-
? (_jsx(ApprovalCard, { wait: wait, onRespond: (decision) => { void controller.respondApproval(wait.key, decision); } }, wait.key))
|
|
174
|
-
: (_jsx(QuestionCard, { wait: wait, onRespond: (answer) => { void controller.respondQuestion(wait.key, answer); } }, wait.key))) });
|
|
175
|
-
}
|
|
176
|
-
function QueueRows({ queue, controller }) {
|
|
177
|
-
if (queue.length === 0)
|
|
178
|
-
return null;
|
|
179
|
-
return (_jsxs("section", { className: "dsh-side-chat-queue", "aria-label": "Queued Side Chat messages", children: [_jsx("strong", { children: "Queued" }), queue.filter(item => item.placement === 'queued').map(item => (_jsxs("div", { children: [_jsx("span", { children: item.preview }), _jsx("button", { type: "button", onClick: () => { void controller.updateQueue(item.id, { kind: 'remove' }); }, children: "Remove" })] }, item.id)))] }));
|
|
180
|
-
}
|
|
181
|
-
/** Functional rc.6 conversation surface bound to a non-current child Session. */
|
|
182
|
-
export function ArchivedConversation({ face, inheritedThroughSeq, controller, selection, locale = 'en', cwd, modelControl, }) {
|
|
183
|
-
const snapshot = useSyncExternalStore(listener => face.subscribe(listener), () => face.getSnapshot(), () => face.getSnapshot());
|
|
184
|
-
const [draft, setDraft] = useState('');
|
|
185
|
-
const [sending, setSending] = useState(false);
|
|
186
|
-
const draftRef = useAutoGrowingTextarea(draft);
|
|
187
|
-
const scrollRef = useRef(null);
|
|
188
|
-
const nodes = useMemo(() => snapshot.nodes.filter(node => node.seq > inheritedThroughSeq), [snapshot.nodes, inheritedThroughSeq]);
|
|
189
|
-
const runningCalls = snapshot.runningCalls ?? [];
|
|
190
|
-
const projectedToolCallIds = useMemo(() => new Set([
|
|
191
|
-
...nodes.filter((node) => node.kind === 'tool-result').map(node => node.callId),
|
|
192
|
-
...runningCalls.map(call => call.callId),
|
|
193
|
-
]), [nodes, runningCalls]);
|
|
194
|
-
const annotatedUserNode = selection === undefined
|
|
195
|
-
? undefined
|
|
196
|
-
: nodes.find(node => node.kind === 'user' || node.kind === 'steering');
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
const element = scrollRef.current;
|
|
199
|
-
if (element !== null)
|
|
200
|
-
element.scrollTop = element.scrollHeight;
|
|
201
|
-
}, [nodes.length, snapshot.partial, snapshot.pending.length, snapshot.queue.length]);
|
|
202
|
-
const submit = async (event) => {
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
const text = draft.trim();
|
|
205
|
-
if (text.length === 0 || sending)
|
|
206
|
-
return;
|
|
207
|
-
setSending(true);
|
|
208
|
-
try {
|
|
209
|
-
const result = await controller.send(text, snapshot.running ? 'steer' : 'queue');
|
|
210
|
-
if (result.ok)
|
|
211
|
-
setDraft('');
|
|
212
|
-
}
|
|
213
|
-
finally {
|
|
214
|
-
setSending(false);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
if (snapshot.openState === 'cold' || snapshot.openState === 'loading') {
|
|
218
|
-
return _jsx("div", { className: "dsh-side-chat-loading", children: "Loading Side Chat\u2026" });
|
|
219
|
-
}
|
|
220
|
-
if (snapshot.openState === 'error') {
|
|
221
|
-
return _jsx("div", { className: "dsh-side-chat-loading", role: "alert", children: "Could not load Side Chat history." });
|
|
222
|
-
}
|
|
223
|
-
return (_jsxs("div", { className: "dsh-side-chat-conversation", children: [_jsxs("div", { ref: scrollRef, className: "dsh-side-chat-transcript", "aria-live": "polite", children: [nodes.map(node => selection !== undefined && node === annotatedUserNode
|
|
224
|
-
? (_jsxs("div", { className: "dsh-side-chat-annotated-user-message", children: [_jsx(SelectionQuote, { selections: [selection], messages: SIDE_CHAT_MESSAGES[locale] }), _jsx(MessageRow, { node: node, projectedToolCallIds: projectedToolCallIds, cwd: cwd, locale: locale })] }, `${node.kind}-${String(node.seq)}`))
|
|
225
|
-
: _jsx(MessageRow, { node: node, projectedToolCallIds: projectedToolCallIds, cwd: cwd, locale: locale }, `${node.kind}-${String(node.seq)}`)), snapshot.partial !== null && (_jsxs("article", { className: "dsh-side-chat-message", "data-role": "assistant", children: [_jsx("span", { className: "dsh-side-chat-message-role", children: "Assistant" }), _jsx(AssistantBlocks, { blocks: snapshot.partial.blocks, streaming: true, projectedToolCallIds: projectedToolCallIds, unprojectedToolState: "running", cwd: cwd, locale: locale })] })), runningCalls.map(call => (_jsx(RunningToolCard, { call: call, cwd: cwd }, call.callId))), _jsx(PendingCards, { pending: snapshot.pending, controller: controller }), _jsx(QueueRows, { queue: snapshot.queue, controller: controller }), snapshot.promptError !== null && _jsx("div", { className: "dsh-side-chat-turn-notice", role: "alert", children: snapshot.promptError.error.message })] }), _jsxs("form", { className: "dsh-side-chat-composer", "data-composer-card": "", onSubmit: (event) => { void submit(event); }, children: [_jsx("textarea", { ref: draftRef, rows: 1, value: draft, placeholder: snapshot.running ? 'Steer the current response' : 'Reply in Side Chat', onChange: (event) => { setDraft(event.target.value); }, onKeyDown: (event) => {
|
|
226
|
-
if (event.key === 'Enter' && !event.shiftKey) {
|
|
227
|
-
event.preventDefault();
|
|
228
|
-
event.currentTarget.form?.requestSubmit();
|
|
229
|
-
}
|
|
230
|
-
} }), _jsxs("div", { className: "dsh-side-chat-composer-actions", children: [modelControl, snapshot.running ? (_jsx("button", { type: "button", className: "dsh-side-chat-stop-button", "aria-label": "Stop generating", title: "Stop generating", onClick: () => { void controller.cancel(); }, children: _jsx(StopIcon, {}) })) : (_jsx("button", { type: "submit", className: "dsh-side-chat-send-button", "aria-label": "Send", disabled: sending || draft.trim().length === 0, children: _jsx(SendIcon, {}) }))] })] })] }));
|
|
231
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SideChatController } from '../side-chat-controller.js';
|
|
2
|
-
import { Rc6SideChatSessions } from './sessions-adapter.js';
|
|
3
|
-
/** rc.6 compatibility surface: selection toolbar plus a non-current child conversation panel. */
|
|
4
|
-
export declare function Rc6SideChatOverlay({ controller, sessions, }: {
|
|
5
|
-
readonly controller: SideChatController;
|
|
6
|
-
readonly sessions: Rc6SideChatSessions;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ContentBlock } from '@deepseek-ai/dsh-api-remotes/client';
|
|
2
|
-
import type { RunningToolCall, ToolCallBlock } from './runtime-compat.js';
|
|
3
|
-
export type ToolState = 'pending' | 'running' | 'success' | 'error' | 'interrupted';
|
|
4
|
-
export declare function toolOutputText(content: readonly ContentBlock[]): string;
|
|
5
|
-
export declare function ToolCard({ callId, name, argsRaw, state, output, callView, resultView, cwd, }: {
|
|
6
|
-
readonly callId: string;
|
|
7
|
-
readonly name: string;
|
|
8
|
-
readonly argsRaw: string;
|
|
9
|
-
readonly state: ToolState;
|
|
10
|
-
readonly output?: string | undefined;
|
|
11
|
-
readonly callView?: unknown;
|
|
12
|
-
readonly resultView?: unknown;
|
|
13
|
-
readonly cwd?: string | undefined;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function ToolBlockCard({ block, cwd }: {
|
|
16
|
-
readonly block: ToolCallBlock;
|
|
17
|
-
readonly cwd?: string | undefined;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare function RunningToolCard({ call, cwd }: {
|
|
20
|
-
readonly call: RunningToolCall;
|
|
21
|
-
readonly cwd?: string | undefined;
|
|
22
|
-
}): import("react/jsx-runtime").JSX.Element;
|