@deepseek-harness-tui/dsh-tui 0.6.0 → 0.7.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.
Files changed (379) hide show
  1. package/README.md +74 -21
  2. package/bin/dsh-tui.js +115 -25
  3. package/cordis.patch.yml +69 -17
  4. package/cordis.yml +50 -12
  5. package/lib/types/activityPrefs.d.ts +1 -1
  6. package/lib/types/activityPrefs.js +3 -3
  7. package/lib/types/cc/figures.d.ts +27 -20
  8. package/lib/types/cc/figures.d.ts.map +1 -1
  9. package/lib/types/cc/figures.js +43 -34
  10. package/lib/types/cc/format.d.ts +18 -9
  11. package/lib/types/cc/format.d.ts.map +1 -1
  12. package/lib/types/cc/format.js +26 -18
  13. package/lib/types/cc/markdown.d.ts +31 -16
  14. package/lib/types/cc/markdown.d.ts.map +1 -1
  15. package/lib/types/cc/markdown.js +283 -260
  16. package/lib/types/cc/terminal.d.ts +10 -7
  17. package/lib/types/cc/terminal.d.ts.map +1 -1
  18. package/lib/types/cc/terminal.js +62 -50
  19. package/lib/types/command-trees.d.ts +3 -0
  20. package/lib/types/command-trees.d.ts.map +1 -0
  21. package/lib/types/command-trees.js +4 -0
  22. package/lib/types/commands.d.ts +37 -1
  23. package/lib/types/commands.d.ts.map +1 -1
  24. package/lib/types/commands.js +68 -3
  25. package/lib/types/components/ActivityLine.d.ts +1 -1
  26. package/lib/types/components/ActivityLine.d.ts.map +1 -1
  27. package/lib/types/components/ActivityPicker.d.ts.map +1 -1
  28. package/lib/types/components/ActivityPicker.js +3 -4
  29. package/lib/types/components/BtwPanel.d.ts +16 -0
  30. package/lib/types/components/BtwPanel.d.ts.map +1 -0
  31. package/lib/types/components/BtwPanel.js +47 -0
  32. package/lib/types/components/CommandSuggestions.d.ts +4 -2
  33. package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
  34. package/lib/types/components/CommandSuggestions.js +2 -2
  35. package/lib/types/components/EffortSlider.d.ts +15 -0
  36. package/lib/types/components/EffortSlider.d.ts.map +1 -0
  37. package/lib/types/components/EffortSlider.js +17 -0
  38. package/lib/types/components/GoalTodoPanel.d.ts +1 -1
  39. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  40. package/lib/types/components/HelpMenu.d.ts +5 -2
  41. package/lib/types/components/HelpMenu.d.ts.map +1 -1
  42. package/lib/types/components/HelpMenu.js +8 -3
  43. package/lib/types/components/HistorySearchDialog.d.ts +1 -1
  44. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
  45. package/lib/types/components/HistorySearchDialog.js +21 -10
  46. package/lib/types/components/InterruptedByUser.d.ts +2 -2
  47. package/lib/types/components/InterruptedByUser.d.ts.map +1 -1
  48. package/lib/types/components/InterruptedByUser.js +4 -3
  49. package/lib/types/components/LoadedContextPanel.d.ts +1 -1
  50. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
  51. package/lib/types/components/LogoV2.d.ts.map +1 -1
  52. package/lib/types/components/LogoV2.js +2 -1
  53. package/lib/types/components/Markdown.d.ts +11 -11
  54. package/lib/types/components/Markdown.d.ts.map +1 -1
  55. package/lib/types/components/Markdown.js +63 -57
  56. package/lib/types/components/MarkdownTable.d.ts +1 -1
  57. package/lib/types/components/MarkdownTable.js +2 -2
  58. package/lib/types/components/MessageList.d.ts +10 -2
  59. package/lib/types/components/MessageList.d.ts.map +1 -1
  60. package/lib/types/components/MessageList.js +17 -10
  61. package/lib/types/components/ModelPicker.d.ts +4 -1
  62. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  63. package/lib/types/components/ModelPicker.js +16 -4
  64. package/lib/types/components/OverlayAbove.d.ts +20 -0
  65. package/lib/types/components/OverlayAbove.d.ts.map +1 -0
  66. package/lib/types/components/OverlayAbove.js +18 -0
  67. package/lib/types/components/PresetPicker.d.ts +1 -1
  68. package/lib/types/components/PresetPicker.d.ts.map +1 -1
  69. package/lib/types/components/PresetPicker.js +2 -3
  70. package/lib/types/components/PromptInput.d.ts +5 -4
  71. package/lib/types/components/PromptInput.d.ts.map +1 -1
  72. package/lib/types/components/PromptInput.js +186 -39
  73. package/lib/types/components/ResumePicker.d.ts +15 -4
  74. package/lib/types/components/ResumePicker.d.ts.map +1 -1
  75. package/lib/types/components/ResumePicker.js +25 -9
  76. package/lib/types/components/RewindPicker.d.ts +1 -1
  77. package/lib/types/components/RewindPicker.d.ts.map +1 -1
  78. package/lib/types/components/RewindPicker.js +14 -5
  79. package/lib/types/components/SearchBox.d.ts +1 -1
  80. package/lib/types/components/SearchBox.js +1 -1
  81. package/lib/types/components/Spinner/GlimmerMessage.d.ts +1 -2
  82. package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -1
  83. package/lib/types/components/Spinner/GlimmerMessage.js +1 -2
  84. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +1 -1
  85. package/lib/types/components/Spinner/SpinnerAnimationRow.js +2 -2
  86. package/lib/types/components/Spinner/SpinnerGlyph.d.ts +1 -1
  87. package/lib/types/components/Spinner/SpinnerGlyph.js +1 -1
  88. package/lib/types/components/Spinner/spinnerUtils.d.ts +13 -18
  89. package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -1
  90. package/lib/types/components/Spinner/spinnerUtils.js +67 -71
  91. package/lib/types/components/Spinner/useStalledAnimation.d.ts +1 -2
  92. package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -1
  93. package/lib/types/components/Spinner/useStalledAnimation.js +1 -2
  94. package/lib/types/components/StreamingMarkdown.d.ts +1 -1
  95. package/lib/types/components/StreamingMarkdown.js +1 -1
  96. package/lib/types/components/ThemePicker.d.ts +13 -9
  97. package/lib/types/components/ThemePicker.d.ts.map +1 -1
  98. package/lib/types/components/ThemePicker.js +21 -15
  99. package/lib/types/components/ThinkingToggle.d.ts +1 -1
  100. package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
  101. package/lib/types/components/ThinkingToggle.js +8 -8
  102. package/lib/types/components/ToolUseLoader.d.ts +1 -1
  103. package/lib/types/components/ToolUseLoader.js +1 -1
  104. package/lib/types/components/WorkingSpinner.d.ts +2 -2
  105. package/lib/types/components/WorkingSpinner.js +2 -2
  106. package/lib/types/components/WorkspaceFlowPicker.d.ts +15 -0
  107. package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -0
  108. package/lib/types/components/WorkspaceFlowPicker.js +19 -0
  109. package/lib/types/components/WorkspacePicker.d.ts +9 -0
  110. package/lib/types/components/WorkspacePicker.d.ts.map +1 -0
  111. package/lib/types/components/WorkspacePicker.js +13 -0
  112. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  113. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  114. package/lib/types/components/approvals/ApprovalPanel.js +2 -1
  115. package/lib/types/components/design-system/Byline.d.ts +1 -1
  116. package/lib/types/components/design-system/Byline.js +1 -1
  117. package/lib/types/components/design-system/Divider.d.ts +1 -1
  118. package/lib/types/components/design-system/Divider.js +1 -1
  119. package/lib/types/components/design-system/HintLine.d.ts +12 -0
  120. package/lib/types/components/design-system/HintLine.d.ts.map +1 -0
  121. package/lib/types/components/design-system/HintLine.js +15 -0
  122. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +1 -1
  123. package/lib/types/components/design-system/KeyboardShortcutHint.js +1 -1
  124. package/lib/types/components/design-system/ListItem.d.ts +2 -2
  125. package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
  126. package/lib/types/components/design-system/ListItem.js +35 -3
  127. package/lib/types/components/design-system/LoadingState.d.ts +1 -2
  128. package/lib/types/components/design-system/LoadingState.d.ts.map +1 -1
  129. package/lib/types/components/design-system/LoadingState.js +1 -2
  130. package/lib/types/components/design-system/Pane.d.ts +2 -2
  131. package/lib/types/components/design-system/Pane.js +2 -2
  132. package/lib/types/components/design-system/ProgressBar.d.ts +1 -2
  133. package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -1
  134. package/lib/types/components/design-system/ProgressBar.js +1 -2
  135. package/lib/types/components/design-system/StatusIcon.d.ts +2 -2
  136. package/lib/types/components/design-system/StatusIcon.js +2 -2
  137. package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
  138. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  139. package/lib/types/components/design-system/ThemeProvider.js +87 -26
  140. package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
  141. package/lib/types/components/design-system/ThemedBox.js +1 -1
  142. package/lib/types/components/design-system/ThemedText.d.ts +2 -2
  143. package/lib/types/components/design-system/ThemedText.js +2 -2
  144. package/lib/types/components/listWindow.d.ts +26 -0
  145. package/lib/types/components/listWindow.d.ts.map +1 -0
  146. package/lib/types/components/listWindow.js +47 -0
  147. package/lib/types/components/messages/AssistantTextMessage.d.ts +1 -2
  148. package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
  149. package/lib/types/components/messages/AssistantTextMessage.js +1 -2
  150. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -2
  151. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  152. package/lib/types/components/messages/AssistantThinkingMessage.js +6 -6
  153. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +12 -4
  154. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  155. package/lib/types/components/messages/AssistantToolUseMessage.js +9 -5
  156. package/lib/types/components/messages/MessageMetadata.d.ts +1 -1
  157. package/lib/types/components/messages/MessageMetadata.js +1 -1
  158. package/lib/types/components/messages/UserPromptMessage.d.ts +1 -1
  159. package/lib/types/components/messages/UserPromptMessage.js +1 -1
  160. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -1
  161. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  162. package/lib/types/components/questions/AskUserQuestionPanel.js +11 -9
  163. package/lib/types/components/questions/PlanReviewPanel.d.ts +1 -1
  164. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  165. package/lib/types/components/questions/PlanReviewPanel.js +3 -2
  166. package/lib/types/components/trajectory/HotspotView.d.ts +14 -0
  167. package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -0
  168. package/lib/types/components/trajectory/HotspotView.js +83 -0
  169. package/lib/types/components/trajectory/Inspector.d.ts +31 -0
  170. package/lib/types/components/trajectory/Inspector.d.ts.map +1 -0
  171. package/lib/types/components/trajectory/Inspector.js +67 -0
  172. package/lib/types/components/trajectory/Ledger.d.ts +20 -0
  173. package/lib/types/components/trajectory/Ledger.d.ts.map +1 -0
  174. package/lib/types/components/trajectory/Ledger.js +112 -0
  175. package/lib/types/components/trajectory/MiniWake.d.ts +24 -0
  176. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -0
  177. package/lib/types/components/trajectory/MiniWake.js +99 -0
  178. package/lib/types/components/trajectory/WaveBand.d.ts +33 -0
  179. package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -0
  180. package/lib/types/components/trajectory/WaveBand.js +145 -0
  181. package/lib/types/customTheme.d.ts +6 -6
  182. package/lib/types/customTheme.d.ts.map +1 -1
  183. package/lib/types/customTheme.js +15 -12
  184. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -0
  185. package/lib/types/{channel.d.ts → dsh-adapter/channel.d.ts} +184 -43
  186. package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
  187. package/lib/types/{channel.js → dsh-adapter/channel.js} +972 -201
  188. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -0
  189. package/lib/types/{childStderr.js → dsh-adapter/childStderr.js} +1 -1
  190. package/lib/types/dsh-adapter/command-trees.d.ts +27 -0
  191. package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -0
  192. package/lib/types/dsh-adapter/command-trees.js +42 -0
  193. package/lib/types/dsh-adapter/compat/index.d.ts +22 -0
  194. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -0
  195. package/lib/types/{compat → dsh-adapter/compat}/index.js +7 -4
  196. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +86 -0
  197. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -0
  198. package/lib/types/dsh-adapter/compat/sessionLog.js +347 -0
  199. package/lib/types/dsh-adapter/contract.d.ts +20 -0
  200. package/lib/types/dsh-adapter/contract.d.ts.map +1 -0
  201. package/lib/types/dsh-adapter/contract.js +109 -0
  202. package/lib/types/dsh-adapter/index.d.ts +80 -0
  203. package/lib/types/dsh-adapter/index.d.ts.map +1 -0
  204. package/lib/types/dsh-adapter/index.js +45 -0
  205. package/lib/types/dsh-adapter/invariant.d.ts.map +1 -0
  206. package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -0
  207. package/lib/types/{plugin.d.ts → dsh-adapter/plugin.d.ts} +17 -0
  208. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -0
  209. package/lib/types/{plugin.js → dsh-adapter/plugin.js} +280 -80
  210. package/lib/types/dsh-adapter/presets.d.ts.map +1 -0
  211. package/lib/types/dsh-adapter/providerWizard.d.ts +91 -0
  212. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -0
  213. package/lib/types/dsh-adapter/providerWizard.js +332 -0
  214. package/lib/types/{questions.d.ts → dsh-adapter/questions.d.ts} +7 -2
  215. package/lib/types/dsh-adapter/questions.d.ts.map +1 -0
  216. package/lib/types/{questions.js → dsh-adapter/questions.js} +15 -7
  217. package/lib/types/dsh-adapter/sideQuestion.d.ts +38 -0
  218. package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -0
  219. package/lib/types/dsh-adapter/sideQuestion.js +69 -0
  220. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +46 -0
  221. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -0
  222. package/lib/types/dsh-adapter/trajectory/aggregate.js +207 -0
  223. package/lib/types/dsh-adapter/trajectory/guards.d.ts +177 -0
  224. package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -0
  225. package/lib/types/dsh-adapter/trajectory/guards.js +235 -0
  226. package/lib/types/dsh-adapter/trajectory/index.d.ts +16 -0
  227. package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -0
  228. package/lib/types/dsh-adapter/trajectory/index.js +15 -0
  229. package/lib/types/dsh-adapter/trajectory/inspect.d.ts +40 -0
  230. package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -0
  231. package/lib/types/dsh-adapter/trajectory/inspect.js +160 -0
  232. package/lib/types/dsh-adapter/trajectory/projection.d.ts +128 -0
  233. package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -0
  234. package/lib/types/dsh-adapter/trajectory/projection.js +653 -0
  235. package/lib/types/dsh-adapter/trajectory/types.d.ts +232 -0
  236. package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -0
  237. package/lib/types/dsh-adapter/trajectory/types.js +70 -0
  238. package/lib/types/dsh-adapter/trajectory/wave.d.ts +45 -0
  239. package/lib/types/dsh-adapter/trajectory/wave.d.ts.map +1 -0
  240. package/lib/types/dsh-adapter/trajectory/wave.js +210 -0
  241. package/lib/types/dsh-adapter/types.d.ts +23 -0
  242. package/lib/types/dsh-adapter/types.d.ts.map +1 -0
  243. package/lib/types/dsh-adapter/types.js +1 -0
  244. package/lib/types/dsh-adapter/workspace.d.ts +22 -0
  245. package/lib/types/dsh-adapter/workspace.d.ts.map +1 -0
  246. package/lib/types/dsh-adapter/workspace.js +16 -0
  247. package/lib/types/dsh-adapter/workspaces.d.ts +118 -0
  248. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -0
  249. package/lib/types/dsh-adapter/workspaces.js +290 -0
  250. package/lib/types/effortPrefs.d.ts +1 -1
  251. package/lib/types/effortPrefs.js +3 -3
  252. package/lib/types/history.js +2 -2
  253. package/lib/types/hooks/useBlink.d.ts +1 -1
  254. package/lib/types/hooks/useBlink.js +1 -1
  255. package/lib/types/i18n.d.ts +977 -36
  256. package/lib/types/i18n.d.ts.map +1 -1
  257. package/lib/types/i18n.js +307 -30
  258. package/lib/types/index.d.ts +1 -69
  259. package/lib/types/index.d.ts.map +1 -1
  260. package/lib/types/index.js +3 -31
  261. package/lib/types/ink/components/App.d.ts.map +1 -1
  262. package/lib/types/ink/components/App.js +33 -19
  263. package/lib/types/ink/dom.d.ts +15 -0
  264. package/lib/types/ink/dom.d.ts.map +1 -1
  265. package/lib/types/ink/dom.js +32 -0
  266. package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
  267. package/lib/types/ink/hooks/use-input.js +8 -0
  268. package/lib/types/ink/hooks/use-terminal-size.d.ts +1 -1
  269. package/lib/types/ink/hooks/use-terminal-size.js +1 -1
  270. package/lib/types/ink/ink.d.ts.map +1 -1
  271. package/lib/types/ink/ink.js +109 -28
  272. package/lib/types/ink/input-suppression.d.ts +20 -0
  273. package/lib/types/ink/input-suppression.d.ts.map +1 -0
  274. package/lib/types/ink/input-suppression.js +26 -0
  275. package/lib/types/ink/log-update.js +21 -6
  276. package/lib/types/ink/parse-keypress.d.ts +31 -0
  277. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  278. package/lib/types/ink/parse-keypress.js +442 -8
  279. package/lib/types/ink/terminal-querier.d.ts +5 -1
  280. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  281. package/lib/types/ink/terminal-querier.js +27 -3
  282. package/lib/types/ink/terminal.d.ts +18 -0
  283. package/lib/types/ink/terminal.d.ts.map +1 -1
  284. package/lib/types/ink/terminal.js +32 -4
  285. package/lib/types/ink/termio/csi.d.ts +10 -0
  286. package/lib/types/ink/termio/csi.d.ts.map +1 -1
  287. package/lib/types/ink/termio/csi.js +20 -0
  288. package/lib/types/ink/termio/tokenize.js +10 -0
  289. package/lib/types/modelPrefs.d.ts +1 -1
  290. package/lib/types/modelPrefs.js +3 -3
  291. package/lib/types/presetPrefs.d.ts +1 -1
  292. package/lib/types/presetPrefs.js +3 -3
  293. package/lib/types/screens/Chat.d.ts +20 -4
  294. package/lib/types/screens/Chat.d.ts.map +1 -1
  295. package/lib/types/screens/Chat.js +655 -55
  296. package/lib/types/screens/StatusLine.d.ts +17 -2
  297. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  298. package/lib/types/screens/StatusLine.js +12 -4
  299. package/lib/types/screens/TrajectoryScene.d.ts +16 -0
  300. package/lib/types/screens/TrajectoryScene.d.ts.map +1 -0
  301. package/lib/types/screens/TrajectoryScene.js +305 -0
  302. package/lib/types/sessionHistory.d.ts +9 -1
  303. package/lib/types/sessionHistory.d.ts.map +1 -1
  304. package/lib/types/sessionHistory.js +56 -16
  305. package/lib/types/sessionModes.d.ts +29 -0
  306. package/lib/types/sessionModes.d.ts.map +1 -0
  307. package/lib/types/sessionModes.js +45 -0
  308. package/lib/types/theme.d.ts +27 -3
  309. package/lib/types/theme.d.ts.map +1 -1
  310. package/lib/types/theme.js +48 -4
  311. package/lib/types/themePrefs.d.ts +3 -3
  312. package/lib/types/themePrefs.js +5 -5
  313. package/lib/types/trajectory/format.d.ts +100 -0
  314. package/lib/types/trajectory/format.d.ts.map +1 -0
  315. package/lib/types/trajectory/format.js +213 -0
  316. package/lib/types/trajectory/motion.d.ts +99 -0
  317. package/lib/types/trajectory/motion.d.ts.map +1 -0
  318. package/lib/types/trajectory/motion.js +143 -0
  319. package/lib/types/trajectory/query.d.ts +83 -0
  320. package/lib/types/trajectory/query.d.ts.map +1 -0
  321. package/lib/types/trajectory/query.js +187 -0
  322. package/lib/types/trajectoryPrefs.d.ts +36 -0
  323. package/lib/types/trajectoryPrefs.d.ts.map +1 -0
  324. package/lib/types/trajectoryPrefs.js +65 -0
  325. package/lib/types/update.d.ts +3 -3
  326. package/lib/types/update.d.ts.map +1 -1
  327. package/lib/types/update.js +18 -7
  328. package/lib/types/utils/clipboard.d.ts +101 -29
  329. package/lib/types/utils/clipboard.d.ts.map +1 -1
  330. package/lib/types/utils/clipboard.js +533 -55
  331. package/lib/types/utils/debug.d.ts +1 -1
  332. package/lib/types/utils/debug.js +2 -2
  333. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
  334. package/lib/types/utils/execFileNoThrow.js +16 -6
  335. package/lib/types/utils/externalEditor.d.ts +115 -0
  336. package/lib/types/utils/externalEditor.d.ts.map +1 -0
  337. package/lib/types/utils/externalEditor.js +270 -0
  338. package/lib/types/utils/fullscreen.d.ts +2 -2
  339. package/lib/types/utils/fullscreen.js +3 -3
  340. package/lib/types/utils/loaded-context.d.ts +1 -1
  341. package/lib/types/utils/loaded-context.d.ts.map +1 -1
  342. package/lib/types/utils/modifiers.d.ts +24 -0
  343. package/lib/types/utils/modifiers.d.ts.map +1 -1
  344. package/lib/types/utils/modifiers.js +27 -0
  345. package/lib/types/utils/paths.d.ts +45 -0
  346. package/lib/types/utils/paths.d.ts.map +1 -0
  347. package/lib/types/utils/paths.js +69 -0
  348. package/lib/types/utils/shellQuote.d.ts +14 -0
  349. package/lib/types/utils/shellQuote.d.ts.map +1 -0
  350. package/lib/types/utils/shellQuote.js +39 -0
  351. package/lib/types/utils/workspaceRoot.d.ts +21 -0
  352. package/lib/types/utils/workspaceRoot.d.ts.map +1 -0
  353. package/lib/types/utils/workspaceRoot.js +47 -0
  354. package/lib/types/workspaces.d.ts +3 -0
  355. package/lib/types/workspaces.d.ts.map +1 -0
  356. package/lib/types/workspaces.js +4 -0
  357. package/package.json +26 -8
  358. package/lib/types/approvals.d.ts.map +0 -1
  359. package/lib/types/channel.d.ts.map +0 -1
  360. package/lib/types/childStderr.d.ts.map +0 -1
  361. package/lib/types/compat/index.d.ts +0 -20
  362. package/lib/types/compat/index.d.ts.map +0 -1
  363. package/lib/types/compat/sessionLog.d.ts +0 -40
  364. package/lib/types/compat/sessionLog.d.ts.map +0 -1
  365. package/lib/types/compat/sessionLog.js +0 -226
  366. package/lib/types/invariant.d.ts.map +0 -1
  367. package/lib/types/packaged-skills.d.ts.map +0 -1
  368. package/lib/types/plugin.d.ts.map +0 -1
  369. package/lib/types/presets.d.ts.map +0 -1
  370. package/lib/types/questions.d.ts.map +0 -1
  371. /package/lib/types/{approvals.d.ts → dsh-adapter/approvals.d.ts} +0 -0
  372. /package/lib/types/{approvals.js → dsh-adapter/approvals.js} +0 -0
  373. /package/lib/types/{childStderr.d.ts → dsh-adapter/childStderr.d.ts} +0 -0
  374. /package/lib/types/{invariant.d.ts → dsh-adapter/invariant.d.ts} +0 -0
  375. /package/lib/types/{invariant.js → dsh-adapter/invariant.js} +0 -0
  376. /package/lib/types/{packaged-skills.d.ts → dsh-adapter/packaged-skills.d.ts} +0 -0
  377. /package/lib/types/{packaged-skills.js → dsh-adapter/packaged-skills.js} +0 -0
  378. /package/lib/types/{presets.d.ts → dsh-adapter/presets.d.ts} +0 -0
  379. /package/lib/types/{presets.js → dsh-adapter/presets.js} +0 -0
@@ -7,7 +7,7 @@ import { SPINNER_VERBS } from '../cc/spinnerVerbs.js';
7
7
  import { sample } from 'lodash-es';
8
8
  /**
9
9
  * The working spinner block shown between the transcript and the prompt
10
- * input while a turn is in flight. Ported from the leak's `Spinner.tsx`
10
+ * input while a turn is in flight. Mirrors Claude Code's `Spinner.tsx`
11
11
  * (SpinnerWithVerb path) with the swarm/teammate/effort/tips branches
12
12
  * removed; the channel feeds the mode, token count and thinking status.
13
13
  *
@@ -23,7 +23,7 @@ export function WorkingSpinner({ mode, hasActiveTools, responseLengthRef, loadin
23
23
  /**
24
24
  * Tracks thinking status: 'thinking' while the model is streaming reasoning,
25
25
  * then the duration in ms for a minimum 2s display (avoids UI jank). Ported
26
- * from the leak's SpinnerWithVerb effect.
26
+ * from Claude Code's SpinnerWithVerb effect.
27
27
  */
28
28
  export function useThinkingStatus(isThinking) {
29
29
  const [thinkingStatus, setThinkingStatus] = useState(null);
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { TuiWorkspaceChoice } from '../workspaces.js';
3
+ /** Generic nested choice surface returned by a workspace provider command. */
4
+ export declare function WorkspaceFlowPicker({ title, choices, focusIndex, busy, input, }: {
5
+ title: string;
6
+ choices: readonly TuiWorkspaceChoice[];
7
+ focusIndex: number;
8
+ busy?: boolean;
9
+ input?: {
10
+ value: string;
11
+ cursor: number;
12
+ placeholder?: string;
13
+ } | null;
14
+ }): React.ReactNode;
15
+ //# sourceMappingURL=WorkspaceFlowPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceFlowPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspaceFlowPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,OAAO,EACP,UAAU,EACV,IAAY,EACZ,KAAY,GACb,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACvE,GAAG,KAAK,CAAC,SAAS,CAoDlB"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box, Text } from '../ui.js';
3
+ import { t } from '../i18n.js';
4
+ import { Pane } from './design-system/Pane.js';
5
+ import { ListItem } from './design-system/ListItem.js';
6
+ import { HintLine } from './design-system/HintLine.js';
7
+ const WINDOW = 8;
8
+ /** Generic nested choice surface returned by a workspace provider command. */
9
+ export function WorkspaceFlowPicker({ title, choices, focusIndex, busy = false, input = null, }) {
10
+ const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), choices.length - WINDOW));
11
+ const visible = choices.slice(start, start + WINDOW);
12
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: title }) }), visible.map((choice, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: false, description: choice.description, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < choices.length, children: [choice.badge ? `${choice.badge} · ` : '', choice.label] }, choice.id))), input !== null && (_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "remember", children: "\u276F " }), input.value.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { inverse: true, children: " " }), _jsx(Text, { dimColor: true, children: input.placeholder ?? '' })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: input.value.slice(0, input.cursor) }), _jsx(Text, { inverse: true, children: input.value[input.cursor] ?? ' ' }), _jsx(Text, { children: input.value.slice(input.cursor + 1) })] }))] }))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: busy
13
+ ? t('workspace-flow-loading')
14
+ : input !== null
15
+ ? t('workspace-flow-input-hint')
16
+ : choices[focusIndex]?.input !== undefined
17
+ ? t('workspace-flow-edit-hint')
18
+ : t('workspace-flow-hint') }) })] }));
19
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { TuiWorkspaceTarget } from '../workspaces.js';
3
+ /** `/workspace` target picker contributed by local and optional providers. */
4
+ export declare function WorkspacePicker({ targets, focusIndex, currentCwd, }: {
5
+ targets: readonly TuiWorkspaceTarget[];
6
+ focusIndex: number;
7
+ currentCwd: string;
8
+ }): React.ReactNode;
9
+ //# sourceMappingURL=WorkspacePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspacePicker.d.ts","sourceRoot":"","sources":["../../../src/components/WorkspacePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAO1D,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;IACD,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,SAAS,CAyBlB"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from '../ui.js';
3
+ import { t } from '../i18n.js';
4
+ import { Pane } from './design-system/Pane.js';
5
+ import { ListItem } from './design-system/ListItem.js';
6
+ import { HintLine } from './design-system/HintLine.js';
7
+ const WINDOW = 8;
8
+ /** `/workspace` target picker contributed by local and optional providers. */
9
+ export function WorkspacePicker({ targets, focusIndex, currentCwd, }) {
10
+ const start = Math.max(0, Math.min(focusIndex - Math.floor(WINDOW / 2), targets.length - WINDOW));
11
+ const visible = targets.slice(start, start + WINDOW);
12
+ return (_jsxs(Pane, { color: "permission", children: [_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('workspace-picker-title') }) }), visible.map((target, index) => (_jsxs(ListItem, { isFocused: start + index === focusIndex, isSelected: target.cwd === currentCwd, description: target.description ?? target.uri, showScrollUp: index === 0 && start > 0, showScrollDown: index === visible.length - 1 && start + visible.length < targets.length, children: [target.badge, " \u00B7 ", target.label] }, target.uri)))] }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('workspace-picker-hint') }) })] }));
13
+ }
@@ -11,7 +11,7 @@
11
11
  * (fail closed, CC's "Esc to cancel" semantics).
12
12
  */
13
13
  import React from 'react';
14
- import type { ApprovalSnapshot } from '../../approvals.js';
14
+ import type { ApprovalSnapshot } from '../../dsh-adapter/approvals.js';
15
15
  export type ApprovalPanelProps = {
16
16
  /** The approval to render (from the ApprovalStore snapshot). */
17
17
  readonly approval: ApprovalSnapshot;
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,KAAK,IAAI,CAAA;CAClE,CAAA;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAmEzF"}
1
+ {"version":3,"file":"ApprovalPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/approvals/ApprovalPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,KAAK,IAAI,CAAA;CAClE,CAAA;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAmEzF"}
@@ -14,6 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import React from 'react';
15
15
  import { t } from '../../i18n.js';
16
16
  import { Box, Text, useInput } from '../../ui.js';
17
+ import { isPlainReturnInput } from '../../utils/modifiers.js';
17
18
  import { Divider } from '../design-system/Divider.js';
18
19
  import { POINTER } from '../../cc/figures.js';
19
20
  const OUTCOMES = ['allowed-once', 'rejected'];
@@ -36,7 +37,7 @@ export function ApprovalPanel({ approval, onDecide }) {
36
37
  onDecide(OUTCOMES[Number(input) - 1]);
37
38
  return;
38
39
  }
39
- if (key.return) {
40
+ if (isPlainReturnInput(input, key)) {
40
41
  onDecide(OUTCOMES[focusIndex]);
41
42
  }
42
43
  }, { isActive: true });
@@ -5,7 +5,7 @@ type Props = {
5
5
  };
6
6
  /**
7
7
  * Joins children with a middot separator (" · ") for inline metadata display
8
- * (ported from the leak's design-system). Automatically filters out
8
+ * (in the Claude Code visual language). Automatically filters out
9
9
  * null/undefined/false children and only renders separators between valid
10
10
  * elements.
11
11
  */
@@ -3,7 +3,7 @@ import React, { Children, isValidElement } from 'react';
3
3
  import Text from '../../ink/components/Text.js';
4
4
  /**
5
5
  * Joins children with a middot separator (" · ") for inline metadata display
6
- * (ported from the leak's design-system). Automatically filters out
6
+ * (in the Claude Code visual language). Automatically filters out
7
7
  * null/undefined/false children and only renders separators between valid
8
8
  * elements.
9
9
  */
@@ -29,7 +29,7 @@ type DividerProps = {
29
29
  };
30
30
  /**
31
31
  * A horizontal divider line, optionally with a title in the middle
32
- * (ported from the leak's design-system).
32
+ * (in the Claude Code visual language).
33
33
  *
34
34
  * @example
35
35
  * // ─────────── Title ───────────
@@ -4,7 +4,7 @@ import { stringWidth } from '../../ink/stringWidth.js';
4
4
  import { useTerminalSize } from '../../ink/hooks/use-terminal-size.js';
5
5
  /**
6
6
  * A horizontal divider line, optionally with a title in the middle
7
- * (ported from the leak's design-system).
7
+ * (in the Claude Code visual language).
8
8
  *
9
9
  * @example
10
10
  * // ─────────── Title ───────────
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ /**
3
+ * Localized shortcut-hint line: renders a `t('hint-*')` string, with the
4
+ * `**primary shortcut**` segment (the main action's key, wrapped in `**` in
5
+ * the dict) in bold — the visual hierarchy KeyboardShortcutHint's `bold`
6
+ * prop used to give. Wrap in `<Text dimColor italic>` for the common dim
7
+ * styling, like the Byline it replaces.
8
+ */
9
+ export declare function HintLine({ text }: {
10
+ text: string;
11
+ }): React.ReactNode;
12
+ //# sourceMappingURL=HintLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HintLine.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/HintLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAUpE"}
@@ -0,0 +1,15 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import Text from '../../ink/components/Text.js';
3
+ /**
4
+ * Localized shortcut-hint line: renders a `t('hint-*')` string, with the
5
+ * `**primary shortcut**` segment (the main action's key, wrapped in `**` in
6
+ * the dict) in bold — the visual hierarchy KeyboardShortcutHint's `bold`
7
+ * prop used to give. Wrap in `<Text dimColor italic>` for the common dim
8
+ * styling, like the Byline it replaces.
9
+ */
10
+ export function HintLine({ text }) {
11
+ const parts = text.split('**');
12
+ if (parts.length < 3)
13
+ return _jsx(_Fragment, { children: text });
14
+ return (_jsx(_Fragment, { children: parts.map((part, index) => index % 2 === 1 ? _jsx(Text, { bold: true, children: part }, index) : part) }));
15
+ }
@@ -11,7 +11,7 @@ type Props = {
11
11
  };
12
12
  /**
13
13
  * Renders a keyboard shortcut hint like "ctrl+o to expand" or "(tab to toggle)"
14
- * (ported from the leak's design-system). Wrap in `<Text dimColor>` for the
14
+ * (in the Claude Code visual language). Wrap in `<Text dimColor>` for the
15
15
  * common dim styling.
16
16
  */
17
17
  export declare function KeyboardShortcutHint({ shortcut, action, parens, bold, }: Props): React.ReactNode;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Text from '../../ink/components/Text.js';
3
3
  /**
4
4
  * Renders a keyboard shortcut hint like "ctrl+o to expand" or "(tab to toggle)"
5
- * (ported from the leak's design-system). Wrap in `<Text dimColor>` for the
5
+ * (in the Claude Code visual language). Wrap in `<Text dimColor>` for the
6
6
  * common dim styling.
7
7
  */
8
8
  export function KeyboardShortcutHint({ shortcut, action, parens = false, bold = false, }) {
@@ -26,8 +26,8 @@ export type ListItemProps = {
26
26
  declareCursor?: boolean;
27
27
  };
28
28
  /**
29
- * A list item for selection UIs (ported from the leak's
30
- * design-system/ListItem.tsx): `❯` pointer for the focused row, `✓`
29
+ * A list item for selection UIs, mirroring Claude Code's
30
+ * design-system/ListItem.tsx: `❯` pointer for the focused row, `✓`
31
31
  * checkmark for the selected row, description on an indented second line,
32
32
  * and CC's color states (focused = suggestion blue, selected = success
33
33
  * green).
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,MAAM,aAAa,GAAG;IAC1B;qDACiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB;uDACmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,UAAkB,EAClB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAa,EACb,QAAgB,EAChB,aAAa,GACd,EAAE,aAAa,GAAG,KAAK,CAAC,SAAS,CAsDjC"}
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,MAAM,aAAa,GAAG;IAC1B;qDACiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB;uDACmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,UAAkB,EAClB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAa,EACb,QAAgB,EAChB,aAAa,GACd,EAAE,aAAa,GAAG,KAAK,CAAC,SAAS,CAkEjC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
2
3
  import { Box, Text } from '../../ui.js';
3
4
  import { useDeclaredCursor } from '../../ink/hooks/use-declared-cursor.js';
4
5
  import { POINTER, DOWN_ARROW, UP_ARROW, TICK } from '../../cc/figures.js';
5
6
  /**
6
- * A list item for selection UIs (ported from the leak's
7
- * design-system/ListItem.tsx): `❯` pointer for the focused row, `✓`
7
+ * A list item for selection UIs, mirroring Claude Code's
8
+ * design-system/ListItem.tsx: `❯` pointer for the focused row, `✓`
8
9
  * checkmark for the selected row, description on an indented second line,
9
10
  * and CC's color states (focused = suggestion blue, selected = success
10
11
  * green).
@@ -44,5 +45,36 @@ export function ListItem({ isFocused, isSelected = false, children, description,
44
45
  return 'suggestion';
45
46
  return undefined;
46
47
  }
47
- return (_jsxs(Box, { ref: cursorRef, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [renderIndicator(), styled ? (_jsx(Text, { color: getTextColor(), dimColor: disabled, children: children })) : (children), isSelected && !disabled && _jsx(Text, { color: "success", children: TICK })] }), description && (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { color: "inactive", children: description }) }))] }));
48
+ // 窗口化列表(ModelPicker/History/Rewind/Select)按固定行高切片:字符串
49
+ // 内容必须恒占一行——压平内嵌换行(历史命令可能带 \n),超宽 truncate
50
+ // 而非换行,否则一项实际占多行会把焦点行裁出浮层(二次审查实证)。
51
+ // 压平必须递归穿透 Fragment/数组:ThemePicker 的 label 就是包着用户
52
+ // displayName 的 Fragment,而 customTheme 允许 displayName 保留内部
53
+ // 换行(三轮审查实证:不递归则 Fragment 里的 'Foo\nBar' 仍渲染两行)。
54
+ // 非 Fragment 的 element(如调用方自己的 <Text>)保留原样——其子树高度
55
+ // 由调用方负责。
56
+ const flatChildren = flattenDeep(children);
57
+ return (_jsxs(Box, { ref: cursorRef, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [renderIndicator(), styled ? (_jsx(Text, { color: getTextColor(), dimColor: disabled, wrap: "truncate", children: flatChildren })) : (flatChildren), isSelected && !disabled && _jsx(Text, { color: "success", children: TICK })] }), description && (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { color: "inactive", wrap: "truncate", children: flattenLine(description) }) }))] }));
58
+ }
59
+ /** 单行化:内嵌换行折叠为空格(行尾/行首换行随之消除)。 */
60
+ function flattenLine(s) {
61
+ return s.replace(/[\r\n]+/g, ' ');
62
+ }
63
+ /**
64
+ * 递归单行化:字符串直接压平;数组逐元素递归;Fragment 是透明结构包装,
65
+ * 递归进其 children(保留 key/props)。其他 element 原样保留。
66
+ * 数组必须走 React.Children.map 而非原生 map:后者把静态 JSX children
67
+ * 变成无 key 的动态数组,/theme(label 含 Fragment)会稳定触发 React
68
+ * key warning(四次审查实证)。
69
+ */
70
+ function flattenDeep(node) {
71
+ if (typeof node === 'string')
72
+ return flattenLine(node);
73
+ if (Array.isArray(node))
74
+ return React.Children.map(node, flattenDeep);
75
+ if (React.isValidElement(node) && node.type === React.Fragment) {
76
+ const frag = node;
77
+ return React.cloneElement(frag, undefined, flattenDeep(frag.props.children));
78
+ }
79
+ return node;
48
80
  }
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  /**
3
- * A spinner with a loading message for async operations, ported from the
4
- * leak's design-system/LoadingState.tsx (using the small animated glyph).
3
+ * A spinner with a loading message for async operations, mirroring Claude Code's design-system/LoadingState.tsx (using the small animated glyph).
5
4
  *
6
5
  * @example
7
6
  * <LoadingState message="Loading models" bold subtitle="Querying the provider…" />
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/LoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,IAAY,EACZ,QAAgB,EAChB,QAAQ,GACT,EAAE;IACD,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,KAAK,CAAC,SAAS,CAelB"}
1
+ {"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/LoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,IAAY,EACZ,QAAgB,EAChB,QAAQ,GACT,EAAE;IACD,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,KAAK,CAAC,SAAS,CAelB"}
@@ -9,8 +9,7 @@ const SPINNER_FRAMES = [
9
9
  ...[...getDefaultCharacters()].reverse(),
10
10
  ];
11
11
  /**
12
- * A spinner with a loading message for async operations, ported from the
13
- * leak's design-system/LoadingState.tsx (using the small animated glyph).
12
+ * A spinner with a loading message for async operations, mirroring Claude Code's design-system/LoadingState.tsx (using the small animated glyph).
14
13
  *
15
14
  * @example
16
15
  * <LoadingState message="Loading models" bold subtitle="Querying the provider…" />
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { Theme } from '../../theme.js';
3
3
  /**
4
4
  * A pane — a region below the prompt bounded by a colored top line with a
5
- * one-row gap above and horizontal padding (ported from the leak's
6
- * design-system/Pane.tsx). Used by the slash-command dialogs (/thinking,
5
+ * one-row gap above and horizontal padding, mirroring Claude Code's
6
+ * design-system/Pane.tsx. Used by the slash-command dialogs (/thinking,
7
7
  * /model, /resume).
8
8
  *
9
9
  * @example
@@ -3,8 +3,8 @@ import Box from '../../ink/components/Box.js';
3
3
  import { Divider } from './Divider.js';
4
4
  /**
5
5
  * A pane — a region below the prompt bounded by a colored top line with a
6
- * one-row gap above and horizontal padding (ported from the leak's
7
- * design-system/Pane.tsx). Used by the slash-command dialogs (/thinking,
6
+ * one-row gap above and horizontal padding, mirroring Claude Code's
7
+ * design-system/Pane.tsx. Used by the slash-command dialogs (/thinking,
8
8
  * /model, /resume).
9
9
  *
10
10
  * @example
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Theme } from '../../theme.js';
3
3
  /**
4
- * A proportional progress bar drawn with block glyphs, ported from the
5
- * leak's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
4
+ * A proportional progress bar drawn with block glyphs, mirroring Claude Code's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
6
5
  * cell uses the `▏▎▍▌▋▊▉` ladder for sub-cell precision, and the empty
7
6
  * remainder is spaces with the empty color as background.
8
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,SAAS,EACT,UAAU,GACX,EAAE;IACD,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,KAAK,CAAA;IACvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,KAAK,CAAA;CACzB,GAAG,KAAK,CAAC,SAAS,CAkBlB"}
1
+ {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,UAAU,EACjB,KAAK,EACL,SAAS,EACT,UAAU,GACX,EAAE;IACD,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,KAAK,CAAA;IACvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,KAAK,CAAA;CACzB,GAAG,KAAK,CAAC,SAAS,CAkBlB"}
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Text from '../../ink/components/Text.js';
3
3
  /**
4
- * A proportional progress bar drawn with block glyphs, ported from the
5
- * leak's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
4
+ * A proportional progress bar drawn with block glyphs, mirroring Claude Code's design-system/ProgressBar.tsx: `█` fills whole cells, the partial
6
5
  * cell uses the `▏▎▍▌▋▊▉` ladder for sub-cell precision, and the empty
7
6
  * remainder is spaces with the empty color as background.
8
7
  *
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading';
3
3
  /**
4
- * A status indicator icon with the CC color mapping (ported from the leak's
5
- * design-system/StatusIcon.tsx): ✓ green / ✗ red / ⚠ amber / ℹ blue /
4
+ * A status indicator icon with the CC color mapping, mirroring Claude Code's
5
+ * design-system/StatusIcon.tsx: ✓ green / ✗ red / ⚠ amber / ℹ blue /
6
6
  * ○ dim / … dim.
7
7
  */
8
8
  export declare function StatusIcon({ status, withSpace, }: {
@@ -10,8 +10,8 @@ const STATUS_CONFIG = {
10
10
  loading: { icon: '…', color: undefined },
11
11
  };
12
12
  /**
13
- * A status indicator icon with the CC color mapping (ported from the leak's
14
- * design-system/StatusIcon.tsx): ✓ green / ✗ red / ⚠ amber / ℹ blue /
13
+ * A status indicator icon with the CC color mapping, mirroring Claude Code's
14
+ * design-system/StatusIcon.tsx: ✓ green / ✗ red / ⚠ amber / ℹ blue /
15
15
  * ○ dim / … dim.
16
16
  */
17
17
  export function StatusIcon({ status, withSpace = false, }) {
@@ -5,7 +5,7 @@ export declare function ThemeProvider({ children, theme, }: {
5
5
  }): React.ReactNode;
6
6
  /**
7
7
  * Resolves the active theme name and the runtime setter. Returns
8
- * `[themeName, setTheme]` — the first element matches the leak's shape.
8
+ * `[themeName, setTheme]` — the first element matches Claude Code's shape.
9
9
  */
10
10
  export declare function useTheme(): [string, (name: string) => boolean];
11
11
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAsE7E,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CAgFlB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAG9D"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/design-system/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AA4F7E,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CAuIlB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAG9D"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React, { createContext, useContext, useEffect, useState } from 'react';
3
- import { registerCustomThemeResolver, setActiveThemeName } from '../../theme.js';
3
+ import { registerCustomThemeResolver, setActiveThemeName, setAutoThemeBase, getAutoThemeBase, AUTO_THEME_NAME, } from '../../theme.js';
4
4
  import { isThemeAvailable, resolveCustomTheme } from '../../customTheme.js';
5
5
  import { readThemePref, writeThemePref } from '../../themePrefs.js';
6
6
  import useStdin from '../../ink/hooks/use-stdin.js';
@@ -9,11 +9,11 @@ import { parseOscColor } from '../../ink/termio/osc.js';
9
9
  import { logForDebugging } from '../../utils/debug.js';
10
10
  /**
11
11
  * Theme provider with terminal-background auto-detection. With no explicit
12
- * `theme` prop, no CC_TUI_THEME override and no persisted choice
13
- * (~/.dsh-cc/theme.json), it queries the terminal's background color
12
+ * `theme` prop, no DSH_TUI_THEME override and no persisted choice
13
+ * (~/.dsh-tui/theme.json), it queries the terminal's background color
14
14
  * (OSC 11) before first paint and picks the Gentle Mist Blue `light` palette
15
15
  * on light backgrounds, `dark` otherwise. Priority: explicit `theme` prop >
16
- * CC_TUI_THEME (built-in or user theme name) > persisted `/theme` choice >
16
+ * DSH_TUI_THEME (built-in or user theme name) > persisted `/theme` choice >
17
17
  * OSC 11 detection. An invalid forced name is warned and skipped, so
18
18
  * detection still runs. Children render only after the theme settles, so
19
19
  * the first frame already carries the final palette — no dark→light flash.
@@ -21,25 +21,35 @@ import { logForDebugging } from '../../utils/debug.js';
21
21
  * stall) falls back to `dark`. The resolved name is mirrored via
22
22
  * setActiveThemeName() for non-React rendering (markdown inline code).
23
23
  *
24
+ * The `auto` pseudo-theme turns that one-shot startup detection into a
25
+ * standing choice: `auto` is valid everywhere a theme name is (DSH_TUI_THEME,
26
+ * theme.json, /theme), defers first paint until detection settles like the
27
+ * unforced path, and re-queries OSC 11 on every runtime switch to `auto` —
28
+ * the detected base (light/dark) is mirrored via setAutoThemeBase() so
29
+ * getTheme('auto') resolves it for every consumer. OSC 11 tracks the system
30
+ * theme in terminals that follow it, so `auto` effectively follows the
31
+ * system light/dark mode.
32
+ *
24
33
  * The context also exposes setTheme() for the runtime `/theme` picker: it
25
- * validates the name, persists the choice to ~/.dsh-cc/theme.json and hot
34
+ * validates the name, persists the choice to ~/.dsh-tui/theme.json and hot
26
35
  * swaps the palette (and the module-level mirror) immediately.
27
36
  */
28
- // User themes (~/.dsh-cc/themes/<name>.json) resolve through this registry,
37
+ // User themes (~/.dsh-tui/themes/<name>.json) resolve through this registry,
29
38
  // so getTheme() serves them to every themed component and to non-React
30
39
  // rendering (markdown inline code) without a context.
31
40
  registerCustomThemeResolver(resolveCustomTheme);
32
41
  const ThemeContext = createContext({
33
42
  theme: 'dark',
43
+ autoBase: 'dark',
34
44
  setTheme: () => false,
35
45
  });
36
46
  /**
37
- * CC_TUI_THEME skips terminal detection (tests, debugging). Accepts a
38
- * built-in name (light|dark|dark-ansi) or a user theme name; invalid values
39
- * are warned and ignored by the caller, falling back to detection.
47
+ * DSH_TUI_THEME skips terminal detection (tests, debugging). Accepts a
48
+ * built-in name (auto|light|dark|dark-ansi) or a user theme name; invalid
49
+ * values are warned and ignored by the caller, falling back to detection.
40
50
  */
41
51
  function envThemeOverride() {
42
- const v = process.env.CC_TUI_THEME;
52
+ const v = process.env.DSH_TUI_THEME;
43
53
  return v === undefined || v === '' ? undefined : v;
44
54
  }
45
55
  /** Detection round-trip is normally ~10ms locally; this only bounds pathological stalls. */
@@ -61,20 +71,43 @@ export function ThemeProvider({ children, theme, }) {
61
71
  return false;
62
72
  if (isThemeAvailable(forced))
63
73
  return true;
64
- console.warn(`[dsh-tui] theme "${forced}" not found (built-ins: light, dark, dark-ansi; user themes: ~/.dsh-cc/themes/*.json); falling back to auto-detection`);
74
+ console.warn(`[dsh-tui] theme "${forced}" not found (built-ins: auto, light, dark, dark-ansi; user themes: ~/.dsh-tui/themes/*.json); falling back to auto-detection`);
65
75
  return false;
66
76
  });
67
- const [active, setActive] = useState(forcedValid ? forced ?? null : null);
68
- const { internal_querier, setRawMode, isRawModeSupported } = useStdin();
77
+ // `auto` (like the unforced path) stays null until detection settles, so
78
+ // the first frame already carries the detected palette.
79
+ const [active, setActive] = useState(forcedValid && forced !== AUTO_THEME_NAME ? forced ?? null : null);
80
+ const { internal_querier, isRawModeSupported } = useStdin();
81
+ /**
82
+ * The palette `auto` resolves to, as React state so a flip re-renders
83
+ * consumers through the context value. Kept in sync with the module-level
84
+ * mirror in theme.ts (non-React rendering reads that one).
85
+ */
86
+ const [autoBase, setAutoBase] = useState(() => getAutoThemeBase());
87
+ const applyAutoBase = React.useCallback((base) => {
88
+ setAutoThemeBase(base);
89
+ setAutoBase(base);
90
+ }, []);
69
91
  useEffect(() => {
70
- if (forcedValid)
92
+ if (forcedValid && forced !== AUTO_THEME_NAME)
71
93
  return;
72
94
  const querier = internal_querier;
95
+ // Settle on the detected base: a concrete forced/unforced name activates
96
+ // directly; `auto` records the base and activates as `auto`.
97
+ const settle = (name, why) => {
98
+ logForDebugging(`theme: ${name} (${why})`);
99
+ if (forced === AUTO_THEME_NAME) {
100
+ applyAutoBase(name);
101
+ setActive(AUTO_THEME_NAME);
102
+ }
103
+ else {
104
+ setActive(name);
105
+ }
106
+ };
73
107
  // Stdin responses only flow while raw mode holds the readable listener;
74
108
  // without a querier (or raw-mode support) detection is impossible.
75
109
  if (querier === null || !isRawModeSupported) {
76
- logForDebugging('theme: detection unavailable (no querier/raw mode), using dark');
77
- setActive('dark');
110
+ settle('dark', 'detection unavailable (no querier/raw mode)');
78
111
  return;
79
112
  }
80
113
  let settled = false;
@@ -83,12 +116,11 @@ export function ThemeProvider({ children, theme, }) {
83
116
  return;
84
117
  settled = true;
85
118
  clearTimeout(timer);
86
- setRawMode(false);
87
- logForDebugging(`theme: ${name} (${why})`);
88
- setActive(name);
119
+ settle(name, why);
89
120
  };
90
- const timer = setTimeout(() => { finish('dark', 'detection timeout'); }, DETECT_TIMEOUT_MS);
91
- setRawMode(true);
121
+ const timer = setTimeout(() => {
122
+ finish('dark', 'detection timeout');
123
+ }, DETECT_TIMEOUT_MS);
92
124
  void Promise.all([querier.send(oscColor(11)), querier.flush()]).then(([r]) => {
93
125
  const color = r ? parseOscColor(r.data) : null;
94
126
  if (color === null || color.type !== 'rgb') {
@@ -98,11 +130,38 @@ export function ThemeProvider({ children, theme, }) {
98
130
  finish(isLightBackground(color.r, color.g, color.b) ? 'light' : 'dark', `OSC 11 bg rgb(${color.r},${color.g},${color.b})`);
99
131
  }
100
132
  });
133
+ return () => {
134
+ settled = true;
135
+ clearTimeout(timer);
136
+ };
101
137
  }, []);
138
+ /**
139
+ * Re-query the terminal background while the app is running (runtime
140
+ * switch to `auto`). Stdin is already in raw mode here — unlike the
141
+ * startup path above — so no raw-mode toggling. Best effort: a terminal
142
+ * that doesn't answer just keeps the current base.
143
+ */
144
+ const redetectAutoBase = React.useCallback(() => {
145
+ const querier = internal_querier;
146
+ if (querier === null || !isRawModeSupported) {
147
+ logForDebugging('theme: auto re-detection unavailable, keeping current base');
148
+ return;
149
+ }
150
+ void Promise.all([querier.send(oscColor(11)), querier.flush()]).then(([r]) => {
151
+ const color = r ? parseOscColor(r.data) : null;
152
+ if (color === null || color.type !== 'rgb')
153
+ return;
154
+ const base = isLightBackground(color.r, color.g, color.b) ? 'light' : 'dark';
155
+ logForDebugging(`theme: auto base ${base} (OSC 11 bg rgb(${color.r},${color.g},${color.b}))`);
156
+ applyAutoBase(base);
157
+ });
158
+ }, [internal_querier, isRawModeSupported, applyAutoBase]);
102
159
  /**
103
160
  * Runtime theme switch (/theme picker or direct command). Validates the
104
161
  * name, persists first (a choice that cannot be saved never silently
105
- * disappears), then hot swaps the palette.
162
+ * disappears), then hot swaps the palette. Switching to `auto` applies
163
+ * the last detected base immediately and re-queries OSC 11 in the
164
+ * background, so a theme change since launch is picked up.
106
165
  */
107
166
  const setTheme = React.useCallback((name) => {
108
167
  if (!isThemeAvailable(name)) {
@@ -110,13 +169,15 @@ export function ThemeProvider({ children, theme, }) {
110
169
  return false;
111
170
  }
112
171
  if (!writeThemePref(name)) {
113
- console.warn('[dsh-tui] failed to write ~/.dsh-cc/theme.json');
172
+ console.warn('[dsh-tui] failed to write ~/.dsh-tui/theme.json');
114
173
  return false;
115
174
  }
116
175
  setActive(name);
176
+ if (name === AUTO_THEME_NAME)
177
+ redetectAutoBase();
117
178
  return true;
118
- }, []);
119
- const value = React.useMemo(() => ({ theme: active ?? 'dark', setTheme }), [active, setTheme]);
179
+ }, [redetectAutoBase]);
180
+ const value = React.useMemo(() => ({ theme: active ?? 'dark', autoBase, setTheme }), [active, autoBase, setTheme]);
120
181
  useEffect(() => {
121
182
  if (active !== null)
122
183
  setActiveThemeName(active);
@@ -127,7 +188,7 @@ export function ThemeProvider({ children, theme, }) {
127
188
  }
128
189
  /**
129
190
  * Resolves the active theme name and the runtime setter. Returns
130
- * `[themeName, setTheme]` — the first element matches the leak's shape.
191
+ * `[themeName, setTheme]` — the first element matches Claude Code's shape.
131
192
  */
132
193
  export function useTheme() {
133
194
  const { theme, setTheme } = useContext(ThemeContext);