@deepseek-ai/dsh-client-ui-chat 0.2.3-alpha.2 → 0.2.3-alpha.4

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.
Files changed (206) hide show
  1. package/README.i18n.yaml +12 -12
  2. package/README.md +11 -9
  3. package/README.zh.md +11 -9
  4. package/lib/client.js +9 -9
  5. package/lib/client.js.map +1 -1
  6. package/lib/types/client/apply.d.ts.map +1 -1
  7. package/lib/types/client/apply.js.map +1 -1
  8. package/lib/types/client/chat/ApprovalCommand.d.ts +1 -1
  9. package/lib/types/client/chat/ApprovalCommand.d.ts.map +1 -1
  10. package/lib/types/client/chat/AssistantMarkdown.d.ts +2 -2
  11. package/lib/types/client/chat/AssistantMarkdown.d.ts.map +1 -1
  12. package/lib/types/client/chat/AssistantMarkdown.js.map +1 -1
  13. package/lib/types/client/chat/AssistantNodeView.d.ts +3 -3
  14. package/lib/types/client/chat/AssistantNodeView.d.ts.map +1 -1
  15. package/lib/types/client/chat/ChatAside.d.ts +1 -1
  16. package/lib/types/client/chat/ChatAside.d.ts.map +1 -1
  17. package/lib/types/client/chat/ChatFlow.d.ts +1 -1
  18. package/lib/types/client/chat/ChatFlow.d.ts.map +1 -1
  19. package/lib/types/client/chat/ChatFlow.js.map +1 -1
  20. package/lib/types/client/chat/ChatGroupSeat.d.ts.map +1 -1
  21. package/lib/types/client/chat/ChatGroupSeat.js.map +1 -1
  22. package/lib/types/client/chat/ChatNodeSeat.d.ts +1 -1
  23. package/lib/types/client/chat/ChatNodeSeat.d.ts.map +1 -1
  24. package/lib/types/client/chat/ChatNodeSeat.js.map +1 -1
  25. package/lib/types/client/chat/ChatView.d.ts +1 -1
  26. package/lib/types/client/chat/ChatView.d.ts.map +1 -1
  27. package/lib/types/client/chat/ChatView.js.map +1 -1
  28. package/lib/types/client/chat/CommandNodeView.d.ts +1 -1
  29. package/lib/types/client/chat/CommandNodeView.d.ts.map +1 -1
  30. package/lib/types/client/chat/CommandStatusRow.js.map +1 -1
  31. package/lib/types/client/chat/CompactionItem.js.map +1 -1
  32. package/lib/types/client/chat/ContextBody.d.ts +11 -1
  33. package/lib/types/client/chat/ContextBody.d.ts.map +1 -1
  34. package/lib/types/client/chat/ContextBody.js.map +1 -1
  35. package/lib/types/client/chat/ContextInjectionRow.d.ts.map +1 -1
  36. package/lib/types/client/chat/ContextInjectionRow.js.map +1 -1
  37. package/lib/types/client/chat/MessageIconActions.js.map +1 -1
  38. package/lib/types/client/chat/MessageItem.d.ts +5 -3
  39. package/lib/types/client/chat/MessageItem.d.ts.map +1 -1
  40. package/lib/types/client/chat/MessageItem.js.map +1 -1
  41. package/lib/types/client/chat/QuotaNoticeHost.js.map +1 -1
  42. package/lib/types/client/chat/ReasoningContent.d.ts +1 -1
  43. package/lib/types/client/chat/ReasoningContent.d.ts.map +1 -1
  44. package/lib/types/client/chat/ReasoningContent.js.map +1 -1
  45. package/lib/types/client/chat/ReasoningRow.d.ts +1 -1
  46. package/lib/types/client/chat/ReasoningRow.d.ts.map +1 -1
  47. package/lib/types/client/chat/ReasoningRow.js.map +1 -1
  48. package/lib/types/client/chat/RunningStatus.js.map +1 -1
  49. package/lib/types/client/chat/StatsPills.d.ts +1 -1
  50. package/lib/types/client/chat/StatsPills.d.ts.map +1 -1
  51. package/lib/types/client/chat/StatsPills.js.map +1 -1
  52. package/lib/types/client/chat/SystemPromptRow.d.ts +7 -3
  53. package/lib/types/client/chat/SystemPromptRow.d.ts.map +1 -1
  54. package/lib/types/client/chat/SystemPromptRow.js.map +1 -1
  55. package/lib/types/client/chat/TurnNavigator.d.ts +1 -1
  56. package/lib/types/client/chat/TurnNavigator.d.ts.map +1 -1
  57. package/lib/types/client/chat/TurnProcessNodeView.js.map +1 -1
  58. package/lib/types/client/chat/TurnTailNodeView.d.ts +1 -1
  59. package/lib/types/client/chat/TurnTailNodeView.d.ts.map +1 -1
  60. package/lib/types/client/chat/TurnTailNodeView.js.map +1 -1
  61. package/lib/types/client/chat/TurnTriggerNodeView.js.map +1 -1
  62. package/lib/types/client/chat/TurnUsagePanel.js.map +1 -1
  63. package/lib/types/client/chat/UserContent.d.ts +1 -1
  64. package/lib/types/client/chat/UserContent.d.ts.map +1 -1
  65. package/lib/types/client/chat/UserContent.js.map +1 -1
  66. package/lib/types/client/chat/flow-motion.d.ts +1 -1
  67. package/lib/types/client/chat/flow-motion.d.ts.map +1 -1
  68. package/lib/types/client/chat/flow-motion.js.map +1 -1
  69. package/lib/types/client/chat/message-chrome.d.ts +1 -1
  70. package/lib/types/client/chat/message-chrome.d.ts.map +1 -1
  71. package/lib/types/client/chat/register-node-renderers.d.ts +1 -5
  72. package/lib/types/client/chat/register-node-renderers.d.ts.map +1 -1
  73. package/lib/types/client/chat/register-node-renderers.js.map +1 -1
  74. package/lib/types/client/chat/searchable-hidden.d.ts +1 -1
  75. package/lib/types/client/chat/searchable-hidden.d.ts.map +1 -1
  76. package/lib/types/client/chat/stat-dialog.d.ts +3 -3
  77. package/lib/types/client/chat/stat-dialog.d.ts.map +1 -1
  78. package/lib/types/client/chat/stat-dialog.js.map +1 -1
  79. package/lib/types/client/chat/step-process.d.ts +18 -1
  80. package/lib/types/client/chat/step-process.d.ts.map +1 -1
  81. package/lib/types/client/chat/step-process.js.map +1 -1
  82. package/lib/types/client/chat/text-interaction.d.ts +1 -1
  83. package/lib/types/client/chat/text-interaction.d.ts.map +1 -1
  84. package/lib/types/client/chat/text-interaction.js.map +1 -1
  85. package/lib/types/client/chat/text-selection.d.ts +1 -0
  86. package/lib/types/client/chat/text-selection.d.ts.map +1 -1
  87. package/lib/types/client/chat/text-selection.js.map +1 -1
  88. package/lib/types/client/chat/use-chat-scroll.d.ts +2 -2
  89. package/lib/types/client/chat/use-chat-scroll.d.ts.map +1 -1
  90. package/lib/types/client/chat/use-chat-viewport.d.ts +2 -2
  91. package/lib/types/client/chat/use-chat-viewport.d.ts.map +1 -1
  92. package/lib/types/client/chat/use-chat-viewport.js.map +1 -1
  93. package/lib/types/client/chat/use-process-scroll.d.ts +1 -1
  94. package/lib/types/client/chat/use-process-scroll.d.ts.map +1 -1
  95. package/lib/types/client/chat/use-process-scroll.js.map +1 -1
  96. package/lib/types/client/contract/chat-nodes.d.ts +4 -0
  97. package/lib/types/client/contract/chat-nodes.d.ts.map +1 -1
  98. package/lib/types/client/contract/chat-nodes.js.map +1 -1
  99. package/lib/types/client/contract/chat-visibility.d.ts +2 -2
  100. package/lib/types/client/contract/chat-visibility.js.map +1 -1
  101. package/lib/types/client/contract/slots.d.ts +33 -12
  102. package/lib/types/client/contract/slots.d.ts.map +1 -1
  103. package/lib/types/client/conversation-nodes/command.js.map +1 -1
  104. package/lib/types/client/conversation-nodes/fallback.js.map +1 -1
  105. package/lib/types/client/conversation-nodes/message.js.map +1 -1
  106. package/lib/types/client/conversation-nodes/request-prompt.d.ts +8 -3
  107. package/lib/types/client/conversation-nodes/request-prompt.d.ts.map +1 -1
  108. package/lib/types/client/conversation-nodes/request-prompt.js.map +1 -1
  109. package/lib/types/client/conversation-nodes/retry.d.ts.map +1 -1
  110. package/lib/types/client/conversation-nodes/retry.js.map +1 -1
  111. package/lib/types/client/conversation-nodes/tool.d.ts +18 -3
  112. package/lib/types/client/conversation-nodes/tool.d.ts.map +1 -1
  113. package/lib/types/client/conversation-nodes/tool.js.map +1 -1
  114. package/lib/types/client/fence/FenceLayers.d.ts +1 -1
  115. package/lib/types/client/fence/FenceLayers.d.ts.map +1 -1
  116. package/lib/types/client/fence/FenceLayers.js.map +1 -1
  117. package/lib/types/client/index.d.ts +1 -1
  118. package/lib/types/client/index.d.ts.map +1 -1
  119. package/lib/types/client/locale.d.ts +96 -0
  120. package/lib/types/client/locale.d.ts.map +1 -1
  121. package/lib/types/client/locale.js.map +1 -1
  122. package/lib/types/client/markdown-labels.d.ts +1 -1
  123. package/lib/types/client/markdown-labels.d.ts.map +1 -1
  124. package/lib/types/client/presentation-policy.d.ts +2 -0
  125. package/lib/types/client/presentation-policy.d.ts.map +1 -1
  126. package/lib/types/client/presentation-policy.js.map +1 -1
  127. package/lib/types/client/settings/LinkOpeningRow.d.ts +2 -3
  128. package/lib/types/client/settings/LinkOpeningRow.d.ts.map +1 -1
  129. package/lib/types/client/settings/LinkOpeningRow.js.map +1 -1
  130. package/lib/types/client/settings/PerformanceUsageRow.d.ts +2 -2
  131. package/lib/types/client/settings/PerformanceUsageRow.d.ts.map +1 -1
  132. package/lib/types/client/settings/PerformanceUsageRow.js.map +1 -1
  133. package/lib/types/client/settings/PreferenceRow.js.map +1 -1
  134. package/lib/types/client/settings/TranscriptViewRow.d.ts +2 -2
  135. package/lib/types/client/settings/TranscriptViewRow.d.ts.map +1 -1
  136. package/lib/types/client/settings/TranscriptViewRow.js.map +1 -1
  137. package/package.json +46 -46
  138. package/src/client/apply.ts +11 -10
  139. package/src/client/chat/ApprovalCommand.tsx +1 -1
  140. package/src/client/chat/AssistantMarkdown.module.css +10 -16
  141. package/src/client/chat/AssistantMarkdown.tsx +6 -5
  142. package/src/client/chat/AssistantNodeView.tsx +3 -3
  143. package/src/client/chat/ChatAside.tsx +1 -1
  144. package/src/client/chat/ChatFlow.tsx +2 -2
  145. package/src/client/chat/ChatGroupSeat.module.css +4 -2
  146. package/src/client/chat/ChatGroupSeat.tsx +10 -6
  147. package/src/client/chat/ChatNodeSeat.tsx +16 -6
  148. package/src/client/chat/ChatView.module.css +67 -14
  149. package/src/client/chat/ChatView.tsx +18 -10
  150. package/src/client/chat/CommandNodeView.tsx +1 -1
  151. package/src/client/chat/CommandStatusRow.tsx +1 -1
  152. package/src/client/chat/CompactionItem.tsx +1 -1
  153. package/src/client/chat/ContextBody.module.css +8 -0
  154. package/src/client/chat/ContextBody.tsx +37 -4
  155. package/src/client/chat/ContextInjectionRow.tsx +4 -3
  156. package/src/client/chat/MessageIconActions.module.css +7 -0
  157. package/src/client/chat/MessageIconActions.tsx +1 -1
  158. package/src/client/chat/MessageItem.module.css +40 -48
  159. package/src/client/chat/MessageItem.tsx +97 -54
  160. package/src/client/chat/QuotaNoticeHost.tsx +1 -1
  161. package/src/client/chat/ReasoningContent.tsx +2 -2
  162. package/src/client/chat/ReasoningRow.tsx +2 -2
  163. package/src/client/chat/RunningStatus.tsx +1 -1
  164. package/src/client/chat/StatsPills.tsx +2 -2
  165. package/src/client/chat/SystemPromptRow.tsx +26 -9
  166. package/src/client/chat/TurnNavigator.module.css +10 -1
  167. package/src/client/chat/TurnProcessNodeView.tsx +1 -1
  168. package/src/client/chat/TurnTailNodeView.tsx +4 -3
  169. package/src/client/chat/TurnTriggerNodeView.tsx +1 -1
  170. package/src/client/chat/TurnUsagePanel.tsx +1 -1
  171. package/src/client/chat/UserContent.tsx +4 -4
  172. package/src/client/chat/flow-motion.ts +3 -1
  173. package/src/client/chat/message-chrome.ts +1 -1
  174. package/src/client/chat/register-node-renderers.ts +5 -8
  175. package/src/client/chat/searchable-hidden.ts +1 -1
  176. package/src/client/chat/stat-dialog.module.css +8 -6
  177. package/src/client/chat/stat-dialog.ts +5 -5
  178. package/src/client/chat/step-process.ts +33 -1
  179. package/src/client/chat/text-interaction.ts +7 -8
  180. package/src/client/chat/text-selection.ts +33 -14
  181. package/src/client/chat/use-chat-scroll.ts +2 -2
  182. package/src/client/chat/use-chat-viewport.ts +12 -11
  183. package/src/client/chat/use-process-scroll.ts +1 -1
  184. package/src/client/contract/chat-nodes.ts +4 -0
  185. package/src/client/contract/chat-visibility.ts +3 -3
  186. package/src/client/contract/slots.ts +30 -13
  187. package/src/client/conversation-nodes/README.i18n.yaml +4 -4
  188. package/src/client/conversation-nodes/README.md +5 -4
  189. package/src/client/conversation-nodes/README.zh.md +5 -4
  190. package/src/client/conversation-nodes/command.ts +1 -1
  191. package/src/client/conversation-nodes/fallback.ts +1 -1
  192. package/src/client/conversation-nodes/message.ts +1 -1
  193. package/src/client/conversation-nodes/request-prompt.ts +16 -6
  194. package/src/client/conversation-nodes/retry.ts +19 -1
  195. package/src/client/conversation-nodes/tool.ts +50 -29
  196. package/src/client/conversation-nodes/turn-process.ts +1 -1
  197. package/src/client/fence/FenceLayers.tsx +2 -2
  198. package/src/client/index.ts +2 -2
  199. package/src/client/locale.ts +96 -0
  200. package/src/client/markdown-labels.ts +1 -1
  201. package/src/client/model/tool-call-tree.ts +1 -1
  202. package/src/client/presentation-policy.ts +6 -0
  203. package/src/client/settings/LinkOpeningRow.tsx +5 -3
  204. package/src/client/settings/PerformanceUsageRow.tsx +6 -3
  205. package/src/client/settings/PreferenceRow.tsx +5 -5
  206. package/src/client/settings/TranscriptViewRow.tsx +12 -5
@@ -37,6 +37,18 @@ function isClosed(location: ConversationLocation): boolean {
37
37
  || ((location.kind === 'step' || location.kind === 'turn') && location.turn.status === 'closed')
38
38
  }
39
39
 
40
+ /**
41
+ * The last started retry failed when its Step is the last of a Turn that ended with an error.
42
+ * A retry chain can continue into a later Turn, so the current attempt's own location decides.
43
+ * The rule reads the Turn outcome, not the retried request's own result: a retry that
44
+ * succeeded and whose Step then failed for another reason also reads as failed.
45
+ */
46
+ function finallyFailed(location: ConversationLocation, current: ModelRetryNode): boolean {
47
+ if (current.retryState !== 'started' || location.kind !== 'step') return false
48
+ const turn = location.turn
49
+ return turn.end?.data.reason.kind === 'error' && turn.steps.at(-1)?.step === current.step
50
+ }
51
+
40
52
  /** Producer-correlated model retry chain Definition. */
41
53
  export const retryDefinition: ConversationNodeDefinition<RetryState> = {
42
54
  kind: 'model-retry',
@@ -83,7 +95,13 @@ export const retryDefinition: ConversationNodeDefinition<RetryState> = {
83
95
  : attempt)
84
96
  const current = attempts.at(-1)
85
97
  if (current === undefined) return null
86
- const data: RetryChatData = { attempts, current }
98
+ const currentLocation = context.matches.findLast(match => match.event.seq === current.seq)?.location ?? location
99
+ const data: RetryChatData = {
100
+ attempts,
101
+ current,
102
+ inFlight: current.retryState === 'started' && !isClosed(currentLocation),
103
+ failed: finallyFailed(currentLocation, current),
104
+ }
87
105
  return chatNode(context, 'model-retry', attempts[0]?.seq ?? current.seq, data, { groupTree: 'process' })
88
106
  },
89
107
  }
@@ -3,8 +3,8 @@ import type {
3
3
  ConversationMatch, ConversationNodeContext, ConversationNodeDefinition, PreparingToolCall, StartedToolCall,
4
4
  ToolCallBlock, ToolResultNode,
5
5
  } from '@deepseek-ai/dsh-client-ui-conversation/client'
6
- import { isAppendSurfaceEvent } from '@deepseek-ai/dsh-session/surface'
7
- import type {} from '@deepseek-ai/dsh-tool-executor-ptc/client'
6
+ import { isAppendSurfaceEvent } from '@deepseek-ai/dsh-session/types'
7
+ import type {} from '@deepseek-ai/dsh-tool-registry-ptc/client'
8
8
  import { PartialArguments } from '@deepseek-ai/dsh-util-values'
9
9
  import type { ChatNode, ToolChatData } from '../contract/chat-nodes.ts'
10
10
  import { CHAT_SYNTHETIC_SEQ_OFFSETS, chatNode, contextLocation } from './common.ts'
@@ -18,11 +18,31 @@ declare module '../contract/chat-nodes.ts' {
18
18
 
19
19
  const MAX_DEPTH = 256
20
20
 
21
+ /**
22
+ * Fold State of one root Tool call. Dispatch updates mutate it in place and return the same object, as the
23
+ * [Assembler update rule](../../../../../../.agents/notes/implemented/architecture/2026-08-09-client-conversation-node-assembly.md)
24
+ * permits.
25
+ */
21
26
  interface ToolState {
22
27
  /** Absent until a named delta or `tool/call` identifies the call. */
23
- readonly root: ToolCallBlock | undefined
24
- readonly children: ReadonlyMap<string, readonly ToolCallBlock[]>
25
- readonly parents: ReadonlyMap<string, string>
28
+ root: ToolCallBlock | undefined
29
+ /** Dispatch edges accumulated by incremental updates. */
30
+ calls: DispatchTree
31
+ }
32
+
33
+ /**
34
+ * Nested dispatch edges, keyed by parent then child call id and mutated in place
35
+ * ([rationale](../../../../../../.agents/notes/implemented/bug-fix/2026-11-27-ptc-dispatch-fold-quadratic.md)).
36
+ * Published Tool call blocks carry their own arrays and never alias this tree.
37
+ */
38
+ interface DispatchTree {
39
+ /** Children of each parent, in dispatch order. */
40
+ children: Map<string, Map<string, ToolCallBlock>>
41
+ parents: Map<string, string>
42
+ }
43
+
44
+ function emptyDispatchTree(): DispatchTree {
45
+ return { children: new Map(), parents: new Map() }
26
46
  }
27
47
 
28
48
  interface ProjectedBlockCache {
@@ -171,7 +191,7 @@ function locationStep(match: ConversationMatch): number {
171
191
  }
172
192
 
173
193
  function acceptsEdge(state: ToolState, parent: string, child: string): boolean {
174
- if (parent === child || state.parents.has(child)) return false
194
+ if (parent === child || state.calls.parents.has(child)) return false
175
195
  let cursor: string | undefined = parent
176
196
  let parentDepth = 0
177
197
  const ancestors = new Set<string>()
@@ -179,7 +199,7 @@ function acceptsEdge(state: ToolState, parent: string, child: string): boolean {
179
199
  if (cursor === child || ancestors.has(cursor)) return false
180
200
  ancestors.add(cursor)
181
201
  parentDepth++
182
- cursor = state.parents.get(cursor)
202
+ cursor = state.calls.parents.get(cursor)
183
203
  }
184
204
  const pending = [{ callId: child, depth: 1 }]
185
205
  const descendants = new Set<string>()
@@ -188,7 +208,7 @@ function acceptsEdge(state: ToolState, parent: string, child: string): boolean {
188
208
  if (descendants.has(candidate.callId)) return false
189
209
  descendants.add(candidate.callId)
190
210
  subtreeDepth = Math.max(subtreeDepth, candidate.depth)
191
- for (const nested of state.children.get(candidate.callId) ?? []) {
211
+ for (const nested of state.calls.children.get(candidate.callId)?.values() ?? []) {
192
212
  pending.push({ callId: nested.callId, depth: candidate.depth + 1 })
193
213
  }
194
214
  }
@@ -201,26 +221,26 @@ function updateDispatch(state: ToolState, match: ConversationMatch): ToolState {
201
221
  const data = event.data
202
222
  const parentCallId = String(data.parentCallId)
203
223
  const subCallId = String(data.subCallId)
204
- const siblings = state.children.get(parentCallId) ?? []
205
- const index = siblings.findIndex(candidate => candidate.callId === subCallId)
224
+ const previous = state.calls.children.get(parentCallId)?.get(subCallId)
206
225
  if (event.type === 'tool/ptc-dispatch-start') {
207
- if (index >= 0 || !acceptsEdge(state, parentCallId, subCallId)) return state
208
- const children = new Map(state.children)
209
- children.set(parentCallId, [...siblings, childCall(match, data)])
210
- const parents = new Map(state.parents)
211
- parents.set(subCallId, parentCallId)
212
- return { ...state, children, parents }
226
+ if (previous !== undefined || !acceptsEdge(state, parentCallId, subCallId)) return state
227
+ attachChild(state.calls, parentCallId, childCall(match, data))
228
+ return state
229
+ }
230
+ if (previous === undefined && !acceptsEdge(state, parentCallId, subCallId)) return state
231
+ attachChild(state.calls, parentCallId, childResult(match, data, previous))
232
+ return state
233
+ }
234
+
235
+ /** Record one child under its parent, keeping first-attachment order on replacement. */
236
+ function attachChild(calls: DispatchTree, parentCallId: string, child: ToolCallBlock): void {
237
+ let siblings = calls.children.get(parentCallId)
238
+ if (siblings === undefined) {
239
+ siblings = new Map()
240
+ calls.children.set(parentCallId, siblings)
213
241
  }
214
- if (index < 0 && !acceptsEdge(state, parentCallId, subCallId)) return state
215
- const previous = index < 0 ? undefined : siblings[index]
216
- const settled = childResult(match, data, previous)
217
- const children = new Map(state.children)
218
- children.set(parentCallId, index < 0
219
- ? [...siblings, settled]
220
- : siblings.map((child, at) => at === index ? settled : child))
221
- const parents = new Map(state.parents)
222
- if (index < 0) parents.set(subCallId, parentCallId)
223
- return { ...state, children, parents }
242
+ siblings.set(child.callId, child)
243
+ calls.parents.set(child.callId, parentCallId)
224
244
  }
225
245
 
226
246
  function projectBlock(
@@ -234,7 +254,8 @@ function projectBlock(
234
254
  if (visited.has(block.callId) || depth > MAX_DEPTH) return { ...block, subCalls: [] }
235
255
  const nextVisited = new Set(visited)
236
256
  nextVisited.add(block.callId)
237
- const children = (state.children.get(block.callId) ?? block.subCalls)
257
+ const attached = state.calls.children.get(block.callId)
258
+ const children = (attached === undefined ? block.subCalls : [...attached.values()])
238
259
  .map(child => projectBlock(child, state, interruptedAt, nextVisited, depth + 1))
239
260
  const interruptionSeq = 'kind' in block ? undefined : interruptedAt?.seq
240
261
  const interruptionTime = 'kind' in block ? undefined : interruptedAt?.time
@@ -283,7 +304,7 @@ function fallbackState(context: ConversationNodeContext<ToolState>): ToolState |
283
304
  const match = context.matches.find(candidate => candidate.event.type === 'tool/result')
284
305
  const root = match === undefined ? undefined : rootResult(match)
285
306
  if (root === undefined) return undefined
286
- let state: ToolState = { root, children: new Map(), parents: new Map() }
307
+ let state: ToolState = { root, calls: emptyDispatchTree() }
287
308
  for (const candidate of context.matches) state = updateDispatch(state, candidate)
288
309
  return state
289
310
  }
@@ -314,7 +335,7 @@ export const toolDefinition: ConversationNodeDefinition<ToolState> = {
314
335
  return null
315
336
  },
316
337
  start: (_context, match) => {
317
- const state: ToolState = { root: undefined, children: new Map(), parents: new Map() }
338
+ const state: ToolState = { root: undefined, calls: emptyDispatchTree() }
318
339
  return match.event.type === 'tool/call' ? { ...state, root: rootCall(match) } : applyDelta(state, match)
319
340
  },
320
341
  update: (context, match) => {
@@ -4,7 +4,7 @@ import type {
4
4
  } from '@deepseek-ai/dsh-client-ui-conversation/client'
5
5
  import type {} from '@deepseek-ai/dsh-llm-retry/types'
6
6
  import type { StreamChunk } from '@deepseek-ai/dsh-llm'
7
- import type {} from '@deepseek-ai/dsh-tool-executor-ptc/client'
7
+ import type {} from '@deepseek-ai/dsh-tool-registry-ptc/client'
8
8
  import { hasAssistantReplyContent } from '../contract/assistant-content.ts'
9
9
  import type { AssistantChatData, ChatNode, FinalAssistantChatData } from '../contract/chat-nodes.ts'
10
10
  import {
@@ -1,8 +1,8 @@
1
1
  /** Chat's language layers for Markdown fences: display math and unified-diff rows. */
2
2
  import { useMemo } from 'react'
3
3
  import type { ReactNode } from 'react'
4
- import { FenceCodeBlock, FenceMathBlock } from '@deepseek-ai/dsh-client-ui-primitives'
5
- import type { HocShare, PropsLocale, PropsRuntime, SlotMap } from '@deepseek-ai/dsh-client-ui-slots'
4
+ import { FenceCodeBlock, FenceMathBlock } from '@deepseek-ai/dsh-client-ui-primitives/client'
5
+ import type { HocShare, PropsLocale, PropsRuntime, SlotMap } from '@deepseek-ai/dsh-client-ui-slots/client'
6
6
  import { markdownLabels } from '../markdown-labels.ts'
7
7
 
8
8
  /** Props of the math layer: the fence and the next inner content. */
@@ -35,10 +35,10 @@ export type { TranscriptViewRowInjected, TranscriptViewRowProps } from './settin
35
35
  export type { TranscriptViewMode } from '../chat-settings.ts'
36
36
  export type { ChatPresentationPolicy } from './presentation-policy.ts'
37
37
  export type {
38
- AssistantActionOwnerProps, ChatFileMentions, ChatNodeHookContext, ChatNodeInjected, ChatNodeOwnerProps,
38
+ AssistantActionOwnerProps, UserActionOwnerProps, ChatFileMentions, ChatNodeHookContext, ChatNodeInjected, ChatNodeOwnerProps,
39
39
  ChatNodeViewProps, ChatScrollPosition, ChatStore, ChatViewInjected, ChatViewSlotProps,
40
40
  ChatFlowDataInjected, ChatFlowHookContext, ChatFlowInjected, ChatFlowOwnerProps, ChatFlowSlotProps, UseGroupHeaderAction,
41
- CommandRowOwnerProps, CommandRowProps, MessageImagesProps, OpenFileOptions, PresentationInjected,
41
+ CommandRowOwnerProps, CommandRowProps, MessageImagesProps, OpenFileOptions,
42
42
  QuotaNoticeCode, QuotaNoticeHostProps, QuotaNoticeInjected, QuotaNoticeOwnerProps, QuotaNoticeState,
43
43
  ReasoningBodyOwnerProps, ReasoningContentInput, UserContentAttachment, UserContentData, UserContentInput,
44
44
  UserBeforeOwnerProps,
@@ -6,6 +6,7 @@ export const NS = 'chat'
6
6
  /** Simplified Chinese dictionary and key-set source of truth. */
7
7
  export const zh = {
8
8
  'message.stepProcess.thinking': '正在分析请求',
9
+ 'message.stepProcess.thinkingNext': '{title},正在思考下一步',
9
10
  'message.stepProcess.read': '正在读取文件',
10
11
  'message.stepProcess.readImage': '正在读取图片',
11
12
  'message.stepProcess.write': '正在写入文件',
@@ -130,6 +131,14 @@ export const zh = {
130
131
  'message.extraBlock': '附加内容块',
131
132
  'message.systemPrompt': '系统提示词',
132
133
  'message.systemPromptUpdate': '系统提示词更新',
134
+ 'message.systemSection.added': '新增 {name}',
135
+ 'message.systemSection.updated': '更新 {name}',
136
+ 'message.systemSection.cleared': '清空 {name}',
137
+ 'message.systemSection.reordered': '调整顺序 {name}',
138
+ 'message.systemSection.removed': '移除 {name}',
139
+ 'message.systemSection.unchanged': '未变化 {name}',
140
+ 'message.systemPromptReset': '取代此前的全部指令',
141
+ 'message.systemPromptSections': '{count} 个章节',
133
142
  'message.toolAdded': '已添加工具:{name}',
134
143
  'message.toolRemoved': '已移除工具:{name}',
135
144
  'message.toolsAdded': '新增:{names}',
@@ -181,8 +190,11 @@ export const zh = {
181
190
  'message.continuation.requested': '已请求继续生成',
182
191
  'message.retry.scheduled': '等待重试模型请求',
183
192
  'message.retry.status': '{label}({retry}/{maximum}) · {seconds}s',
193
+ 'message.retry.title': '{label}({retry}/{maximum})',
194
+ 'message.retry.countdown': '{seconds}s',
184
195
  'message.retry.delay': '重试延迟:',
185
196
  'message.retry.failure': '失败原因:',
197
+ 'message.retry.inspect': '查看',
186
198
  'message.failure.auth': 'API 密钥无效',
187
199
  'message.taskStopped': '任务已停止',
188
200
  'message.failure.accountSignedOut': '任务已因退出 DeepSeek 登录而停止。',
@@ -223,6 +235,7 @@ export type ChatKey = keyof typeof zh
223
235
  /** English dictionary, checked against the Chinese key set. */
224
236
  export const en = {
225
237
  'message.stepProcess.thinking': 'Analyzing the request',
238
+ 'message.stepProcess.thinkingNext': '{title}, thinking about the next step',
226
239
  'message.stepProcess.read': 'Reading files',
227
240
  'message.stepProcess.readImage': 'Reading images',
228
241
  'message.stepProcess.write': 'Writing files',
@@ -347,6 +360,14 @@ export const en = {
347
360
  'message.extraBlock': 'Extra content block',
348
361
  'message.systemPrompt': 'System prompt',
349
362
  'message.systemPromptUpdate': 'System prompt update',
363
+ 'message.systemSection.added': 'Added {name}',
364
+ 'message.systemSection.updated': 'Updated {name}',
365
+ 'message.systemSection.cleared': 'Cleared {name}',
366
+ 'message.systemSection.reordered': 'Reordered {name}',
367
+ 'message.systemSection.removed': 'Removed {name}',
368
+ 'message.systemSection.unchanged': 'Unchanged {name}',
369
+ 'message.systemPromptReset': 'Replaces all earlier instructions',
370
+ 'message.systemPromptSections': '{count} sections',
350
371
  'message.toolAdded': 'Tool added: {name}',
351
372
  'message.toolRemoved': 'Tool removed: {name}',
352
373
  'message.toolsAdded': 'Added: {names}',
@@ -398,8 +419,11 @@ export const en = {
398
419
  'message.continuation.requested': 'Requested to continue generation',
399
420
  'message.retry.scheduled': 'Waiting to retry model request',
400
421
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
422
+ 'message.retry.title': '{label} ({retry}/{maximum})',
423
+ 'message.retry.countdown': '{seconds}s',
401
424
  'message.retry.delay': 'Retry delay: ',
402
425
  'message.retry.failure': 'Failure reason: ',
426
+ 'message.retry.inspect': 'Inspect',
403
427
  'message.failure.auth': 'API key is invalid',
404
428
  'message.taskStopped': 'Task stopped',
405
429
  'message.failure.accountSignedOut': 'Stopped because you signed out of DeepSeek.',
@@ -437,6 +461,7 @@ export const en = {
437
461
  /** Japanese copy, checked against the English keys. */
438
462
  export const ja = {
439
463
  'message.stepProcess.thinking': 'リクエストを分析中',
464
+ 'message.stepProcess.thinkingNext': '{title}、次のステップを検討中',
440
465
  'message.stepProcess.read': 'ファイルを読み取り中',
441
466
  'message.stepProcess.readImage': '画像を読み取り中',
442
467
  'message.stepProcess.write': 'ファイルを書き込み中',
@@ -561,6 +586,14 @@ export const ja = {
561
586
  'message.extraBlock': '追加のコンテンツブロック',
562
587
  'message.systemPrompt': 'システムプロンプト',
563
588
  'message.systemPromptUpdate': 'システムプロンプトの更新',
589
+ 'message.systemSection.added': '追加 {name}',
590
+ 'message.systemSection.updated': '更新 {name}',
591
+ 'message.systemSection.cleared': 'クリア {name}',
592
+ 'message.systemSection.reordered': '並べ替え {name}',
593
+ 'message.systemSection.removed': '削除 {name}',
594
+ 'message.systemSection.unchanged': '変更なし {name}',
595
+ 'message.systemPromptReset': '以前の指示をすべて置き換えます',
596
+ 'message.systemPromptSections': '{count} セクション',
564
597
  'message.toolAdded': 'ツールを追加: {name}',
565
598
  'message.toolRemoved': 'ツールを削除: {name}',
566
599
  'message.toolsAdded': '追加: {names}',
@@ -612,8 +645,11 @@ export const ja = {
612
645
  'message.continuation.requested': '生成の続行をリクエストしました',
613
646
  'message.retry.scheduled': 'モデルリクエストの再試行待ちです',
614
647
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}秒',
648
+ 'message.retry.title': '{label} ({retry}/{maximum})',
649
+ 'message.retry.countdown': '{seconds}秒',
615
650
  'message.retry.delay': '再試行までの待機時間: ',
616
651
  'message.retry.failure': '失敗理由: ',
652
+ 'message.retry.inspect': '検査',
617
653
  'message.failure.auth': 'APIキーが無効です',
618
654
  'message.taskStopped': 'タスクを停止しました',
619
655
  'message.failure.accountSignedOut': 'DeepSeekからログアウトしたため停止しました。',
@@ -651,6 +687,7 @@ export const ja = {
651
687
  /** Spanish dictionary, checked against the English keys. */
652
688
  export const es = {
653
689
  'message.stepProcess.thinking': 'Analizando la solicitud',
690
+ 'message.stepProcess.thinkingNext': '{title}, pensando en el siguiente paso',
654
691
  'message.stepProcess.read': 'Leyendo archivos',
655
692
  'message.stepProcess.readImage': 'Leyendo imágenes',
656
693
  'message.stepProcess.write': 'Escribir archivos',
@@ -775,6 +812,14 @@ export const es = {
775
812
  'message.extraBlock': 'Bloque de contenido adicional',
776
813
  'message.systemPrompt': 'Aviso del sistema',
777
814
  'message.systemPromptUpdate': 'Actualización del mensaje del sistema',
815
+ 'message.systemSection.added': 'Añadido {name}',
816
+ 'message.systemSection.updated': 'Actualizado {name}',
817
+ 'message.systemSection.cleared': 'Vaciado {name}',
818
+ 'message.systemSection.reordered': 'Reordenado {name}',
819
+ 'message.systemSection.removed': 'Eliminado {name}',
820
+ 'message.systemSection.unchanged': 'Sin cambios {name}',
821
+ 'message.systemPromptReset': 'Reemplaza todas las instrucciones anteriores',
822
+ 'message.systemPromptSections': '{count} secciones',
778
823
  'message.toolAdded': 'Herramienta agregada: {name}',
779
824
  'message.toolRemoved': 'Herramienta eliminada: {name}',
780
825
  'message.toolsAdded': 'Añadido: {names}',
@@ -826,8 +871,11 @@ export const es = {
826
871
  'message.continuation.requested': 'Se ha solicitado continuar la generación',
827
872
  'message.retry.scheduled': 'Esperando para volver a intentar la solicitud de modelo',
828
873
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
874
+ 'message.retry.title': '{label} ({retry}/{maximum})',
875
+ 'message.retry.countdown': '{seconds}s',
829
876
  'message.retry.delay': 'Retraso de reintento: ',
830
877
  'message.retry.failure': 'Razón del fracaso: ',
878
+ 'message.retry.inspect': 'Inspeccionar',
831
879
  'message.failure.auth': 'La clave API no es válida',
832
880
  'message.taskStopped': 'Tarea detenida',
833
881
  'message.failure.accountSignedOut': 'Se detuvo porque cerró sesión en DeepSeek.',
@@ -865,6 +913,7 @@ export const es = {
865
913
  /** French dictionary, checked against the English keys. */
866
914
  export const fr = {
867
915
  'message.stepProcess.thinking': 'Analyser la demande',
916
+ 'message.stepProcess.thinkingNext': "{title}, réflexion sur l'étape suivante",
868
917
  'message.stepProcess.read': 'Lecture de fichiers',
869
918
  'message.stepProcess.readImage': 'Lire des images',
870
919
  'message.stepProcess.write': 'Écriture de fichiers',
@@ -989,6 +1038,14 @@ export const fr = {
989
1038
  'message.extraBlock': 'Bloc de contenu supplémentaire',
990
1039
  'message.systemPrompt': 'Invite système',
991
1040
  'message.systemPromptUpdate': "Mise à jour de l'invite du système",
1041
+ 'message.systemSection.added': 'Ajouté {name}',
1042
+ 'message.systemSection.updated': 'Mis à jour {name}',
1043
+ 'message.systemSection.cleared': 'Vidé {name}',
1044
+ 'message.systemSection.reordered': 'Réordonné {name}',
1045
+ 'message.systemSection.removed': 'Supprimé {name}',
1046
+ 'message.systemSection.unchanged': 'Inchangé {name}',
1047
+ 'message.systemPromptReset': 'Remplace toutes les instructions précédentes',
1048
+ 'message.systemPromptSections': '{count} sections',
992
1049
  'message.toolAdded': 'Outil ajouté : {name}',
993
1050
  'message.toolRemoved': 'Outil supprimé : {name}',
994
1051
  'message.toolsAdded': 'Ajouté : {names}',
@@ -1040,8 +1097,11 @@ export const fr = {
1040
1097
  'message.continuation.requested': 'Suite de la génération demandée',
1041
1098
  'message.retry.scheduled': 'En attente de réessayer la demande de modèle',
1042
1099
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}',
1100
+ 'message.retry.title': '{label} ({retry}/{maximum})',
1101
+ 'message.retry.countdown': '{seconds} s',
1043
1102
  'message.retry.delay': 'Délai de nouvelle tentative : ',
1044
1103
  'message.retry.failure': "Raison de l'échec : ",
1104
+ 'message.retry.inspect': 'Inspecter',
1045
1105
  'message.failure.auth': "La clé API n'est pas valide",
1046
1106
  'message.taskStopped': 'Tâche arrêtée',
1047
1107
  'message.failure.accountSignedOut': 'Arrêté car vous vous êtes déconnecté de DeepSeek.',
@@ -1079,6 +1139,7 @@ export const fr = {
1079
1139
  /** German dictionary, checked against the English keys. */
1080
1140
  export const de = {
1081
1141
  'message.stepProcess.thinking': 'Analyse der Anfrage',
1142
+ 'message.stepProcess.thinkingNext': '{title}, Überlegung zum nächsten Schritt',
1082
1143
  'message.stepProcess.read': 'Dateien lesen',
1083
1144
  'message.stepProcess.readImage': 'Bilder lesen',
1084
1145
  'message.stepProcess.write': 'Dateien schreiben',
@@ -1203,6 +1264,14 @@ export const de = {
1203
1264
  'message.extraBlock': 'Zusätzlicher Inhaltsblock',
1204
1265
  'message.systemPrompt': 'Systemaufforderung',
1205
1266
  'message.systemPromptUpdate': 'Aktualisierung der Systemaufforderung',
1267
+ 'message.systemSection.added': 'Hinzugefügt {name}',
1268
+ 'message.systemSection.updated': 'Aktualisiert {name}',
1269
+ 'message.systemSection.cleared': 'Geleert {name}',
1270
+ 'message.systemSection.reordered': 'Neu angeordnet {name}',
1271
+ 'message.systemSection.removed': 'Entfernt {name}',
1272
+ 'message.systemSection.unchanged': 'Unverändert {name}',
1273
+ 'message.systemPromptReset': 'Ersetzt alle früheren Anweisungen',
1274
+ 'message.systemPromptSections': '{count} Abschnitte',
1206
1275
  'message.toolAdded': 'Tool hinzugefügt: {name}',
1207
1276
  'message.toolRemoved': 'Entferntes Werkzeug: {name}',
1208
1277
  'message.toolsAdded': 'Hinzugefügt: {names}',
@@ -1254,8 +1323,11 @@ export const de = {
1254
1323
  'message.continuation.requested': 'Fortsetzung der Generierung angefordert',
1255
1324
  'message.retry.scheduled': 'Warten auf erneuten Versuch der Modellanforderung',
1256
1325
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
1326
+ 'message.retry.title': '{label} ({retry}/{maximum})',
1327
+ 'message.retry.countdown': '{seconds}s',
1257
1328
  'message.retry.delay': 'Wiederholungsverzögerung: ',
1258
1329
  'message.retry.failure': 'Fehlergrund: ',
1330
+ 'message.retry.inspect': 'Inspizieren',
1259
1331
  'message.failure.auth': 'Der API-Schlüssel ist ungültig',
1260
1332
  'message.taskStopped': 'Aufgabe gestoppt',
1261
1333
  'message.failure.accountSignedOut': 'Gestoppt, weil Sie sich von DeepSeek abgemeldet haben.',
@@ -1293,6 +1365,7 @@ export const de = {
1293
1365
  /** Russian dictionary, checked against the English keys. */
1294
1366
  export const ru = {
1295
1367
  'message.stepProcess.thinking': 'Анализ запроса',
1368
+ 'message.stepProcess.thinkingNext': '{title}, обдумывание следующего шага',
1296
1369
  'message.stepProcess.read': 'Чтение файлов',
1297
1370
  'message.stepProcess.readImage': 'Чтение изображений',
1298
1371
  'message.stepProcess.write': 'Запись файлов',
@@ -1417,6 +1490,14 @@ export const ru = {
1417
1490
  'message.extraBlock': 'Дополнительный блок контента',
1418
1491
  'message.systemPrompt': 'Системная подсказка',
1419
1492
  'message.systemPromptUpdate': 'Обновление системного запроса',
1493
+ 'message.systemSection.added': 'Добавлено {name}',
1494
+ 'message.systemSection.updated': 'Обновлено {name}',
1495
+ 'message.systemSection.cleared': 'Очищено {name}',
1496
+ 'message.systemSection.reordered': 'Порядок изменён {name}',
1497
+ 'message.systemSection.removed': 'Удалено {name}',
1498
+ 'message.systemSection.unchanged': 'Без изменений {name}',
1499
+ 'message.systemPromptReset': 'Заменяет все предыдущие инструкции',
1500
+ 'message.systemPromptSections': 'Разделов: {count}',
1420
1501
  'message.toolAdded': 'Добавлен инструмент: {name}.',
1421
1502
  'message.toolRemoved': 'Инструмент удален: {name}.',
1422
1503
  'message.toolsAdded': 'Добавлено: {names}',
@@ -1468,8 +1549,11 @@ export const ru = {
1468
1549
  'message.continuation.requested': 'Запрошено продолжение генерации',
1469
1550
  'message.retry.scheduled': 'Ожидание повторного запроса модели',
1470
1551
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
1552
+ 'message.retry.title': '{label} ({retry}/{maximum})',
1553
+ 'message.retry.countdown': '{seconds}s',
1471
1554
  'message.retry.delay': 'Задержка повтора: ',
1472
1555
  'message.retry.failure': 'Причина неисправности: ',
1556
+ 'message.retry.inspect': 'Осмотреть',
1473
1557
  'message.failure.auth': 'Ключ API недействителен.',
1474
1558
  'message.taskStopped': 'Задача остановлена',
1475
1559
  'message.failure.accountSignedOut': 'Остановлено, поскольку вы вышли из DeepSeek.',
@@ -1507,6 +1591,7 @@ export const ru = {
1507
1591
  /** Portuguese dictionary, checked against the English keys. */
1508
1592
  export const pt = {
1509
1593
  'message.stepProcess.thinking': 'Analisando a solicitação',
1594
+ 'message.stepProcess.thinkingNext': '{title}, pensando no próximo passo',
1510
1595
  'message.stepProcess.read': 'Lendo arquivos',
1511
1596
  'message.stepProcess.readImage': 'Lendo imagens',
1512
1597
  'message.stepProcess.write': 'Gravando arquivos',
@@ -1631,6 +1716,14 @@ export const pt = {
1631
1716
  'message.extraBlock': 'Bloco de conteúdo extra',
1632
1717
  'message.systemPrompt': 'Alerta do sistema',
1633
1718
  'message.systemPromptUpdate': 'Atualização imediata do sistema',
1719
+ 'message.systemSection.added': 'Adicionado {name}',
1720
+ 'message.systemSection.updated': 'Atualizado {name}',
1721
+ 'message.systemSection.cleared': 'Limpo {name}',
1722
+ 'message.systemSection.reordered': 'Reordenado {name}',
1723
+ 'message.systemSection.removed': 'Removido {name}',
1724
+ 'message.systemSection.unchanged': 'Inalterado {name}',
1725
+ 'message.systemPromptReset': 'Substitui todas as instruções anteriores',
1726
+ 'message.systemPromptSections': '{count} seções',
1634
1727
  'message.toolAdded': 'Ferramenta adicionada: {name}',
1635
1728
  'message.toolRemoved': 'Ferramenta removida: {name}',
1636
1729
  'message.toolsAdded': 'Adicionado: {names}',
@@ -1682,8 +1775,11 @@ export const pt = {
1682
1775
  'message.continuation.requested': 'Continuação da geração solicitada',
1683
1776
  'message.retry.scheduled': 'Aguardando para tentar novamente a solicitação de modelo',
1684
1777
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
1778
+ 'message.retry.title': '{label} ({retry}/{maximum})',
1779
+ 'message.retry.countdown': '{seconds}s',
1685
1780
  'message.retry.delay': 'Atraso na nova tentativa: ',
1686
1781
  'message.retry.failure': 'Motivo da falha: ',
1782
+ 'message.retry.inspect': 'Inspecionar',
1687
1783
  'message.failure.auth': 'A chave API é inválida',
1688
1784
  'message.taskStopped': 'Tarefa interrompida',
1689
1785
  'message.failure.accountSignedOut': 'Interrompido porque você saiu de DeepSeek.',
@@ -1,6 +1,6 @@
1
1
  /** Localized copy adapters for Cordis-free Markdown primitives. */
2
2
 
3
- import type { MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives'
3
+ import type { MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives/client'
4
4
  import type { ChatViewSlotProps } from './contract/slots.ts'
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import type { SessionEvent } from '@deepseek-ai/dsh-session/types'
2
- import type {} from '@deepseek-ai/dsh-tool-executor-ptc/client'
2
+ import type {} from '@deepseek-ai/dsh-tool-registry-ptc/client'
3
3
  import type {
4
4
  ConversationNode, RunningToolCall, ToolCallBlock, ToolResultNode,
5
5
  } from '@deepseek-ai/dsh-client-ui-conversation/client'
@@ -20,6 +20,8 @@ export interface ChatPresentationPolicy {
20
20
  readonly liveProcessDetail: boolean
21
21
  /** Whether a settled reasoning row previews its first line beside the Think title. */
22
22
  readonly settledReasoningPreview: boolean
23
+ /** Whether program call rows show their source row and sub-calls open, without a collapse action. */
24
+ readonly programCallsOpen: boolean
23
25
  }
24
26
 
25
27
  const POLICIES: Readonly<Record<TranscriptViewMode, Omit<ChatPresentationPolicy, 'collapseTiming' | 'foldedReplies'>>> = {
@@ -29,6 +31,7 @@ const POLICIES: Readonly<Record<TranscriptViewMode, Omit<ChatPresentationPolicy,
29
31
  stepGrouping: 'collapsed',
30
32
  liveProcessDetail: false,
31
33
  settledReasoningPreview: false,
34
+ programCallsOpen: false,
32
35
  },
33
36
  standard: {
34
37
  mode: 'standard',
@@ -36,6 +39,7 @@ const POLICIES: Readonly<Record<TranscriptViewMode, Omit<ChatPresentationPolicy,
36
39
  stepGrouping: 'collapsed',
37
40
  liveProcessDetail: true,
38
41
  settledReasoningPreview: true,
42
+ programCallsOpen: false,
39
43
  },
40
44
  detailed: {
41
45
  mode: 'detailed',
@@ -43,6 +47,7 @@ const POLICIES: Readonly<Record<TranscriptViewMode, Omit<ChatPresentationPolicy,
43
47
  stepGrouping: 'history',
44
48
  liveProcessDetail: true,
45
49
  settledReasoningPreview: true,
50
+ programCallsOpen: false,
46
51
  },
47
52
  verbose: {
48
53
  mode: 'verbose',
@@ -50,6 +55,7 @@ const POLICIES: Readonly<Record<TranscriptViewMode, Omit<ChatPresentationPolicy,
50
55
  stepGrouping: 'none',
51
56
  liveProcessDetail: false,
52
57
  settledReasoningPreview: true,
58
+ programCallsOpen: true,
53
59
  },
54
60
  }
55
61
 
@@ -1,6 +1,7 @@
1
1
  /** General Settings row for Chat HTTP(S) link destinations. */
2
+ import { useCallback } from 'react'
2
3
  import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
3
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
4
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
4
5
  import type { LinkOpening } from '../../chat-settings.ts'
5
6
  import { PreferenceRow } from './PreferenceRow.tsx'
6
7
 
@@ -18,7 +19,7 @@ export interface LinkOpeningRowInjected {
18
19
 
19
20
  /** Full Settings-row props. */
20
21
  export type LinkOpeningRowProps =
21
- PropsRuntime<'settings.general.item'>
22
+ PropsRuntime<'settings.general.group.interaction.item'>
22
23
  & PropsLocale<'chat'>
23
24
  & InjectFace<LinkOpeningRowInjected>
24
25
 
@@ -30,6 +31,7 @@ export type LinkOpeningRowProps =
30
31
  export function LinkOpeningRow({ useLinkOpening, useBrowserAvailable, setLinkOpening, t }: LinkOpeningRowProps) {
31
32
  const destination = useLinkOpening(value => value)
32
33
  const browserAvailable = useBrowserAvailable(value => value)
34
+ const selectOpening = useCallback((value: string) => { setLinkOpening(value as LinkOpening) }, [setLinkOpening])
33
35
  if (!browserAvailable) return null
34
36
  return (
35
37
  <PreferenceRow
@@ -41,7 +43,7 @@ export function LinkOpeningRow({ useLinkOpening, useBrowserAvailable, setLinkOpe
41
43
  { id: 'sidebar', label: t('settings.links.sidebar') },
42
44
  { id: 'new-tab', label: t('settings.links.newTab') },
43
45
  ]}
44
- onSelect={(value) => { setLinkOpening(value as LinkOpening) }}
46
+ onSelect={selectOpening}
45
47
  />
46
48
  )
47
49
  }
@@ -1,6 +1,7 @@
1
1
  /** General Settings row for performance and usage detail. */
2
2
 
3
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
3
+ import { useCallback } from 'react'
4
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'
4
5
  import type { PerformanceUsageMode } from '../../chat-settings.ts'
5
6
  import type { PerformanceUsageInjected } from '../contract/slots.ts'
6
7
  import type { ChatKey } from '../locale.ts'
@@ -14,7 +15,7 @@ export interface PerformanceUsageRowInjected extends PerformanceUsageInjected {
14
15
 
15
16
  /** Full Settings-row props. */
16
17
  export type PerformanceUsageRowProps =
17
- PropsRuntime<'settings.general.item'>
18
+ PropsRuntime<'settings.general.group.display.item'>
18
19
  & PropsLocale<'chat'>
19
20
  & InjectFace<PerformanceUsageRowInjected>
20
21
 
@@ -30,6 +31,8 @@ const OPTIONS: readonly { id: PerformanceUsageMode; label: ChatKey }[] = [
30
31
  */
31
32
  export function PerformanceUsageRow({ usePerformanceUsage, setPerformanceUsage, t }: PerformanceUsageRowProps) {
32
33
  const mode = usePerformanceUsage(value => value)
34
+ const selectMode = useCallback((value: string) => { setPerformanceUsage(value as PerformanceUsageMode) },
35
+ [setPerformanceUsage])
33
36
  const selectedLabel = mode === 'detailed'
34
37
  ? 'settings.performance.detailed'
35
38
  : 'settings.performance.compact'
@@ -40,7 +43,7 @@ export function PerformanceUsageRow({ usePerformanceUsage, setPerformanceUsage,
40
43
  value={mode}
41
44
  selectedLabel={t(selectedLabel)}
42
45
  options={OPTIONS.map(option => ({ id: option.id, label: t(option.label) }))}
43
- onSelect={(value) => { setPerformanceUsage(value as PerformanceUsageMode) }}
46
+ onSelect={selectMode}
44
47
  />
45
48
  )
46
49
  }
@@ -1,6 +1,6 @@
1
1
  /** Localized two-column selector shared by Chat preference rows. */
2
- import { useRef, useState } from 'react'
3
- import { IconChevronDownOutlineRegular, Menu } from '@deepseek-ai/dsh-client-ui-primitives'
2
+ import { useCallback, useRef, useState } from 'react'
3
+ import { IconChevronDownOutlineRegular, Menu } from '@deepseek-ai/dsh-client-ui-primitives/client'
4
4
  import css from './PreferenceRow.module.css'
5
5
 
6
6
  /**
@@ -18,12 +18,12 @@ export function PreferenceRow({ title, description, value, selectedLabel, option
18
18
  }) {
19
19
  const [open, setOpen] = useState(false)
20
20
  const selectorRef = useRef<HTMLButtonElement>(null)
21
- const closeMenu = () => { setOpen(false) }
22
- const selectMode = (id: string) => {
21
+ const closeMenu = useCallback(() => { setOpen(false) }, [])
22
+ const selectMode = useCallback((id: string) => {
23
23
  selectorRef.current?.focus({ preventScroll: true })
24
24
  closeMenu()
25
25
  onSelect(id)
26
- }
26
+ }, [closeMenu, onSelect])
27
27
  const selector = (
28
28
  <button
29
29
  ref={selectorRef}