@deepseek-harness-tui/dsh-tui 0.5.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 (638) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/bin/dsh-tui.js +95 -0
  4. package/cordis.patch.yml +218 -0
  5. package/cordis.yml +185 -0
  6. package/lib/invariant.js +28 -0
  7. package/lib/types/activityPrefs.d.ts +29 -0
  8. package/lib/types/activityPrefs.d.ts.map +1 -0
  9. package/lib/types/activityPrefs.js +60 -0
  10. package/lib/types/bootstrap/state.d.ts +13 -0
  11. package/lib/types/bootstrap/state.d.ts.map +1 -0
  12. package/lib/types/bootstrap/state.js +12 -0
  13. package/lib/types/cc/cliHighlight.d.ts +20 -0
  14. package/lib/types/cc/cliHighlight.d.ts.map +1 -0
  15. package/lib/types/cc/cliHighlight.js +53 -0
  16. package/lib/types/cc/figures.d.ts +59 -0
  17. package/lib/types/cc/figures.d.ts.map +1 -0
  18. package/lib/types/cc/figures.js +69 -0
  19. package/lib/types/cc/format.d.ts +26 -0
  20. package/lib/types/cc/format.d.ts.map +1 -0
  21. package/lib/types/cc/format.js +55 -0
  22. package/lib/types/cc/hash.d.ts +25 -0
  23. package/lib/types/cc/hash.d.ts.map +1 -0
  24. package/lib/types/cc/hash.js +41 -0
  25. package/lib/types/cc/hyperlink.d.ts +21 -0
  26. package/lib/types/cc/hyperlink.d.ts.map +1 -0
  27. package/lib/types/cc/hyperlink.js +31 -0
  28. package/lib/types/cc/markdown.d.ts +43 -0
  29. package/lib/types/cc/markdown.d.ts.map +1 -0
  30. package/lib/types/cc/markdown.js +345 -0
  31. package/lib/types/cc/spinnerVerbs.d.ts +3 -0
  32. package/lib/types/cc/spinnerVerbs.d.ts.map +1 -0
  33. package/lib/types/cc/spinnerVerbs.js +190 -0
  34. package/lib/types/cc/terminal.d.ts +15 -0
  35. package/lib/types/cc/terminal.d.ts.map +1 -0
  36. package/lib/types/cc/terminal.js +84 -0
  37. package/lib/types/channel.d.ts +672 -0
  38. package/lib/types/channel.d.ts.map +1 -0
  39. package/lib/types/channel.js +2427 -0
  40. package/lib/types/childStderr.d.ts +63 -0
  41. package/lib/types/childStderr.d.ts.map +1 -0
  42. package/lib/types/childStderr.js +161 -0
  43. package/lib/types/commands.d.ts +55 -0
  44. package/lib/types/commands.d.ts.map +1 -0
  45. package/lib/types/commands.js +101 -0
  46. package/lib/types/components/ActivityLine.d.ts +29 -0
  47. package/lib/types/components/ActivityLine.d.ts.map +1 -0
  48. package/lib/types/components/ActivityLine.js +47 -0
  49. package/lib/types/components/ActivityPicker.d.ts +13 -0
  50. package/lib/types/components/ActivityPicker.d.ts.map +1 -0
  51. package/lib/types/components/ActivityPicker.js +24 -0
  52. package/lib/types/components/CommandSuggestions.d.ts +14 -0
  53. package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
  54. package/lib/types/components/CommandSuggestions.js +33 -0
  55. package/lib/types/components/FileSuggestions.d.ts +12 -0
  56. package/lib/types/components/FileSuggestions.d.ts.map +1 -0
  57. package/lib/types/components/FileSuggestions.js +26 -0
  58. package/lib/types/components/GoalTodoPanel.d.ts +13 -0
  59. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
  60. package/lib/types/components/GoalTodoPanel.js +57 -0
  61. package/lib/types/components/HelpMenu.d.ts +12 -0
  62. package/lib/types/components/HelpMenu.d.ts.map +1 -0
  63. package/lib/types/components/HelpMenu.js +12 -0
  64. package/lib/types/components/HistorySearchDialog.d.ts +16 -0
  65. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
  66. package/lib/types/components/HistorySearchDialog.js +31 -0
  67. package/lib/types/components/InterruptedByUser.d.ts +7 -0
  68. package/lib/types/components/InterruptedByUser.d.ts.map +1 -0
  69. package/lib/types/components/InterruptedByUser.js +9 -0
  70. package/lib/types/components/LoadedContextPanel.d.ts +20 -0
  71. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
  72. package/lib/types/components/LoadedContextPanel.js +30 -0
  73. package/lib/types/components/LogoV2.d.ts +23 -0
  74. package/lib/types/components/LogoV2.d.ts.map +1 -0
  75. package/lib/types/components/LogoV2.js +95 -0
  76. package/lib/types/components/Markdown.d.ts +24 -0
  77. package/lib/types/components/Markdown.d.ts.map +1 -0
  78. package/lib/types/components/Markdown.js +106 -0
  79. package/lib/types/components/MarkdownTable.d.ts +17 -0
  80. package/lib/types/components/MarkdownTable.d.ts.map +1 -0
  81. package/lib/types/components/MarkdownTable.js +272 -0
  82. package/lib/types/components/MessageList.d.ts +41 -0
  83. package/lib/types/components/MessageList.d.ts.map +1 -0
  84. package/lib/types/components/MessageList.js +303 -0
  85. package/lib/types/components/ModelPicker.d.ts +14 -0
  86. package/lib/types/components/ModelPicker.d.ts.map +1 -0
  87. package/lib/types/components/ModelPicker.js +15 -0
  88. package/lib/types/components/PresetPicker.d.ts +17 -0
  89. package/lib/types/components/PresetPicker.d.ts.map +1 -0
  90. package/lib/types/components/PresetPicker.js +25 -0
  91. package/lib/types/components/PromptInput.d.ts +67 -0
  92. package/lib/types/components/PromptInput.d.ts.map +1 -0
  93. package/lib/types/components/PromptInput.js +778 -0
  94. package/lib/types/components/ResumePicker.d.ts +15 -0
  95. package/lib/types/components/ResumePicker.d.ts.map +1 -0
  96. package/lib/types/components/ResumePicker.js +34 -0
  97. package/lib/types/components/RewindPicker.d.ts +14 -0
  98. package/lib/types/components/RewindPicker.d.ts.map +1 -0
  99. package/lib/types/components/RewindPicker.js +23 -0
  100. package/lib/types/components/SearchBox.d.ts +20 -0
  101. package/lib/types/components/SearchBox.d.ts.map +1 -0
  102. package/lib/types/components/SearchBox.js +33 -0
  103. package/lib/types/components/Select.d.ts +22 -0
  104. package/lib/types/components/Select.d.ts.map +1 -0
  105. package/lib/types/components/Select.js +19 -0
  106. package/lib/types/components/Spinner/GlimmerMessage.d.ts +19 -0
  107. package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
  108. package/lib/types/components/Spinner/GlimmerMessage.js +78 -0
  109. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +31 -0
  110. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
  111. package/lib/types/components/Spinner/SpinnerAnimationRow.js +162 -0
  112. package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
  113. package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
  114. package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
  115. package/lib/types/components/Spinner/spinnerMode.d.ts +6 -0
  116. package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
  117. package/lib/types/components/Spinner/spinnerMode.js +1 -0
  118. package/lib/types/components/Spinner/spinnerUtils.d.ts +41 -0
  119. package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
  120. package/lib/types/components/Spinner/spinnerUtils.js +104 -0
  121. package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
  122. package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
  123. package/lib/types/components/Spinner/useStalledAnimation.js +71 -0
  124. package/lib/types/components/StreamingMarkdown.d.ts +12 -0
  125. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
  126. package/lib/types/components/StreamingMarkdown.js +39 -0
  127. package/lib/types/components/ThemePicker.d.ts +22 -0
  128. package/lib/types/components/ThemePicker.d.ts.map +1 -0
  129. package/lib/types/components/ThemePicker.js +51 -0
  130. package/lib/types/components/ThinkingToggle.d.ts +17 -0
  131. package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
  132. package/lib/types/components/ThinkingToggle.js +30 -0
  133. package/lib/types/components/ToolUseLoader.d.ts +13 -0
  134. package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
  135. package/lib/types/components/ToolUseLoader.js +17 -0
  136. package/lib/types/components/Whale.d.ts +22 -0
  137. package/lib/types/components/Whale.d.ts.map +1 -0
  138. package/lib/types/components/Whale.js +78 -0
  139. package/lib/types/components/WorkingSpinner.d.ts +26 -0
  140. package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
  141. package/lib/types/components/WorkingSpinner.js +68 -0
  142. package/lib/types/components/activityFrames.d.ts +31 -0
  143. package/lib/types/components/activityFrames.d.ts.map +1 -0
  144. package/lib/types/components/activityFrames.js +83 -0
  145. package/lib/types/components/bigfont.d.ts +28 -0
  146. package/lib/types/components/bigfont.d.ts.map +1 -0
  147. package/lib/types/components/bigfont.js +91 -0
  148. package/lib/types/components/design-system/Byline.d.ts +14 -0
  149. package/lib/types/components/design-system/Byline.d.ts.map +1 -0
  150. package/lib/types/components/design-system/Byline.js +17 -0
  151. package/lib/types/components/design-system/Divider.d.ts +40 -0
  152. package/lib/types/components/design-system/Divider.d.ts.map +1 -0
  153. package/lib/types/components/design-system/Divider.js +24 -0
  154. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +19 -0
  155. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +1 -0
  156. package/lib/types/components/design-system/KeyboardShortcutHint.js +14 -0
  157. package/lib/types/components/design-system/ListItem.d.ts +36 -0
  158. package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
  159. package/lib/types/components/design-system/ListItem.js +48 -0
  160. package/lib/types/components/design-system/LoadingState.d.ts +19 -0
  161. package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
  162. package/lib/types/components/design-system/LoadingState.js +22 -0
  163. package/lib/types/components/design-system/Pane.d.ts +17 -0
  164. package/lib/types/components/design-system/Pane.d.ts.map +1 -0
  165. package/lib/types/components/design-system/Pane.js +15 -0
  166. package/lib/types/components/design-system/ProgressBar.d.ts +22 -0
  167. package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
  168. package/lib/types/components/design-system/ProgressBar.js +27 -0
  169. package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
  170. package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
  171. package/lib/types/components/design-system/StatusIcon.js +20 -0
  172. package/lib/types/components/design-system/ThemeProvider.d.ts +11 -0
  173. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
  174. package/lib/types/components/design-system/ThemeProvider.js +135 -0
  175. package/lib/types/components/design-system/ThemedBox.d.ts +37 -0
  176. package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
  177. package/lib/types/components/design-system/ThemedBox.js +26 -0
  178. package/lib/types/components/design-system/ThemedText.d.ts +56 -0
  179. package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
  180. package/lib/types/components/design-system/ThemedText.js +45 -0
  181. package/lib/types/components/messages/AssistantTextMessage.d.ts +18 -0
  182. package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
  183. package/lib/types/components/messages/AssistantTextMessage.js +15 -0
  184. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +23 -0
  185. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
  186. package/lib/types/components/messages/AssistantThinkingMessage.js +23 -0
  187. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +23 -0
  188. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
  189. package/lib/types/components/messages/AssistantToolUseMessage.js +220 -0
  190. package/lib/types/components/messages/MessageMetadata.d.ts +15 -0
  191. package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
  192. package/lib/types/components/messages/MessageMetadata.js +20 -0
  193. package/lib/types/components/messages/UserPromptMessage.d.ts +19 -0
  194. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
  195. package/lib/types/components/messages/UserPromptMessage.js +15 -0
  196. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +39 -0
  197. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
  198. package/lib/types/components/questions/AskUserQuestionPanel.js +228 -0
  199. package/lib/types/components/shimmer.d.ts +35 -0
  200. package/lib/types/components/shimmer.d.ts.map +1 -0
  201. package/lib/types/components/shimmer.js +43 -0
  202. package/lib/types/components/whaleFrames.d.ts +25 -0
  203. package/lib/types/components/whaleFrames.d.ts.map +1 -0
  204. package/lib/types/components/whaleFrames.js +419 -0
  205. package/lib/types/customTheme.d.ts +104 -0
  206. package/lib/types/customTheme.d.ts.map +1 -0
  207. package/lib/types/customTheme.js +268 -0
  208. package/lib/types/effortPrefs.d.ts +22 -0
  209. package/lib/types/effortPrefs.d.ts.map +1 -0
  210. package/lib/types/effortPrefs.js +45 -0
  211. package/lib/types/history.d.ts +24 -0
  212. package/lib/types/history.d.ts.map +1 -0
  213. package/lib/types/history.js +75 -0
  214. package/lib/types/hooks/useBlink.d.ts +11 -0
  215. package/lib/types/hooks/useBlink.d.ts.map +1 -0
  216. package/lib/types/hooks/useBlink.js +20 -0
  217. package/lib/types/i18n.d.ts +926 -0
  218. package/lib/types/i18n.d.ts.map +1 -0
  219. package/lib/types/i18n.js +356 -0
  220. package/lib/types/index.d.ts +70 -0
  221. package/lib/types/index.d.ts.map +1 -0
  222. package/lib/types/index.js +31 -0
  223. package/lib/types/ink/Ansi.d.ts +11 -0
  224. package/lib/types/ink/Ansi.d.ts.map +1 -0
  225. package/lib/types/ink/Ansi.js +269 -0
  226. package/lib/types/ink/bidi.d.ts +18 -0
  227. package/lib/types/ink/bidi.d.ts.map +1 -0
  228. package/lib/types/ink/bidi.js +119 -0
  229. package/lib/types/ink/clearTerminal.d.ts +22 -0
  230. package/lib/types/ink/clearTerminal.d.ts.map +1 -0
  231. package/lib/types/ink/clearTerminal.js +72 -0
  232. package/lib/types/ink/colorize.d.ts +33 -0
  233. package/lib/types/ink/colorize.d.ts.map +1 -0
  234. package/lib/types/ink/colorize.js +213 -0
  235. package/lib/types/ink/components/AlternateScreen.d.ts +22 -0
  236. package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
  237. package/lib/types/ink/components/AlternateScreen.js +74 -0
  238. package/lib/types/ink/components/App.d.ts +73 -0
  239. package/lib/types/ink/components/App.d.ts.map +1 -0
  240. package/lib/types/ink/components/App.js +597 -0
  241. package/lib/types/ink/components/AppContext.d.ts +15 -0
  242. package/lib/types/ink/components/AppContext.d.ts.map +1 -0
  243. package/lib/types/ink/components/AppContext.js +11 -0
  244. package/lib/types/ink/components/Box.d.ts +49 -0
  245. package/lib/types/ink/components/Box.d.ts.map +1 -0
  246. package/lib/types/ink/components/Box.js +153 -0
  247. package/lib/types/ink/components/Button.d.ts +37 -0
  248. package/lib/types/ink/components/Button.d.ts.map +1 -0
  249. package/lib/types/ink/components/Button.js +166 -0
  250. package/lib/types/ink/components/ClockContext.d.ts +10 -0
  251. package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
  252. package/lib/types/ink/components/ClockContext.js +108 -0
  253. package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
  254. package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
  255. package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
  256. package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
  257. package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
  258. package/lib/types/ink/components/ErrorOverview.js +49 -0
  259. package/lib/types/ink/components/Link.d.ts +8 -0
  260. package/lib/types/ink/components/Link.d.ts.map +1 -0
  261. package/lib/types/ink/components/Link.js +33 -0
  262. package/lib/types/ink/components/Newline.d.ts +13 -0
  263. package/lib/types/ink/components/Newline.d.ts.map +1 -0
  264. package/lib/types/ink/components/Newline.js +29 -0
  265. package/lib/types/ink/components/NoSelect.d.ts +20 -0
  266. package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
  267. package/lib/types/ink/components/NoSelect.js +56 -0
  268. package/lib/types/ink/components/RawAnsi.d.ts +17 -0
  269. package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
  270. package/lib/types/ink/components/RawAnsi.js +45 -0
  271. package/lib/types/ink/components/ScrollBox.d.ts +78 -0
  272. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
  273. package/lib/types/ink/components/ScrollBox.js +174 -0
  274. package/lib/types/ink/components/Spacer.d.ts +6 -0
  275. package/lib/types/ink/components/Spacer.d.ts.map +1 -0
  276. package/lib/types/ink/components/Spacer.js +19 -0
  277. package/lib/types/ink/components/StdinContext.d.ts +32 -0
  278. package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
  279. package/lib/types/ink/components/StdinContext.js +16 -0
  280. package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
  281. package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
  282. package/lib/types/ink/components/TerminalFocusContext.js +45 -0
  283. package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
  284. package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
  285. package/lib/types/ink/components/TerminalSizeContext.js +3 -0
  286. package/lib/types/ink/components/Text.d.ts +56 -0
  287. package/lib/types/ink/components/Text.d.ts.map +1 -0
  288. package/lib/types/ink/components/Text.js +194 -0
  289. package/lib/types/ink/constants.d.ts +3 -0
  290. package/lib/types/ink/constants.d.ts.map +1 -0
  291. package/lib/types/ink/constants.js +2 -0
  292. package/lib/types/ink/cursor.d.ts +11 -0
  293. package/lib/types/ink/cursor.d.ts.map +1 -0
  294. package/lib/types/ink/cursor.js +1 -0
  295. package/lib/types/ink/devtools.d.ts +7 -0
  296. package/lib/types/ink/devtools.d.ts.map +1 -0
  297. package/lib/types/ink/devtools.js +1 -0
  298. package/lib/types/ink/dom.d.ts +178 -0
  299. package/lib/types/ink/dom.d.ts.map +1 -0
  300. package/lib/types/ink/dom.js +424 -0
  301. package/lib/types/ink/events/click-event.d.ts +32 -0
  302. package/lib/types/ink/events/click-event.d.ts.map +1 -0
  303. package/lib/types/ink/events/click-event.js +36 -0
  304. package/lib/types/ink/events/dispatcher.d.ts +63 -0
  305. package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
  306. package/lib/types/ink/events/dispatcher.js +194 -0
  307. package/lib/types/ink/events/emitter.d.ts +20 -0
  308. package/lib/types/ink/events/emitter.d.ts.map +1 -0
  309. package/lib/types/ink/events/emitter.js +43 -0
  310. package/lib/types/ink/events/event-handlers.d.ts +47 -0
  311. package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
  312. package/lib/types/ink/events/event-handlers.js +30 -0
  313. package/lib/types/ink/events/event.d.ts +19 -0
  314. package/lib/types/ink/events/event.d.ts.map +1 -0
  315. package/lib/types/ink/events/event.js +22 -0
  316. package/lib/types/ink/events/focus-event.d.ts +19 -0
  317. package/lib/types/ink/events/focus-event.d.ts.map +1 -0
  318. package/lib/types/ink/events/focus-event.js +21 -0
  319. package/lib/types/ink/events/input-event.d.ts +53 -0
  320. package/lib/types/ink/events/input-event.d.ts.map +1 -0
  321. package/lib/types/ink/events/input-event.js +180 -0
  322. package/lib/types/ink/events/keyboard-event.d.ts +40 -0
  323. package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
  324. package/lib/types/ink/events/keyboard-event.js +65 -0
  325. package/lib/types/ink/events/paste-event.d.ts +11 -0
  326. package/lib/types/ink/events/paste-event.d.ts.map +1 -0
  327. package/lib/types/ink/events/paste-event.js +13 -0
  328. package/lib/types/ink/events/resize-event.d.ts +13 -0
  329. package/lib/types/ink/events/resize-event.d.ts.map +1 -0
  330. package/lib/types/ink/events/resize-event.js +16 -0
  331. package/lib/types/ink/events/terminal-event.d.ts +112 -0
  332. package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
  333. package/lib/types/ink/events/terminal-event.js +131 -0
  334. package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
  335. package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
  336. package/lib/types/ink/events/terminal-focus-event.js +18 -0
  337. package/lib/types/ink/focus.d.ts +74 -0
  338. package/lib/types/ink/focus.d.ts.map +1 -0
  339. package/lib/types/ink/focus.js +188 -0
  340. package/lib/types/ink/frame.d.ts +119 -0
  341. package/lib/types/ink/frame.d.ts.map +1 -0
  342. package/lib/types/ink/frame.js +43 -0
  343. package/lib/types/ink/get-max-width.d.ts +20 -0
  344. package/lib/types/ink/get-max-width.d.ts.map +1 -0
  345. package/lib/types/ink/get-max-width.js +25 -0
  346. package/lib/types/ink/hit-test.d.ts +47 -0
  347. package/lib/types/ink/hit-test.d.ts.map +1 -0
  348. package/lib/types/ink/hit-test.js +126 -0
  349. package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
  350. package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
  351. package/lib/types/ink/hooks/use-animation-frame.js +48 -0
  352. package/lib/types/ink/hooks/use-app.d.ts +8 -0
  353. package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
  354. package/lib/types/ink/hooks/use-app.js +8 -0
  355. package/lib/types/ink/hooks/use-copy-on-select.d.ts +22 -0
  356. package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
  357. package/lib/types/ink/hooks/use-copy-on-select.js +40 -0
  358. package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
  359. package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
  360. package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
  361. package/lib/types/ink/hooks/use-input.d.ts +41 -0
  362. package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
  363. package/lib/types/ink/hooks/use-input.js +73 -0
  364. package/lib/types/ink/hooks/use-interval.d.ts +23 -0
  365. package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
  366. package/lib/types/ink/hooks/use-interval.js +58 -0
  367. package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
  368. package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
  369. package/lib/types/ink/hooks/use-search-highlight.js +35 -0
  370. package/lib/types/ink/hooks/use-selection.d.ts +44 -0
  371. package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
  372. package/lib/types/ink/hooks/use-selection.js +64 -0
  373. package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
  374. package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
  375. package/lib/types/ink/hooks/use-stdin.js +8 -0
  376. package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
  377. package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
  378. package/lib/types/ink/hooks/use-tab-status.js +58 -0
  379. package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
  380. package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
  381. package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
  382. package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
  383. package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
  384. package/lib/types/ink/hooks/use-terminal-size.js +12 -0
  385. package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
  386. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
  387. package/lib/types/ink/hooks/use-terminal-title.js +30 -0
  388. package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
  389. package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
  390. package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
  391. package/lib/types/ink/ink.d.ts +370 -0
  392. package/lib/types/ink/ink.d.ts.map +1 -0
  393. package/lib/types/ink/ink.js +1665 -0
  394. package/lib/types/ink/instances.d.ts +10 -0
  395. package/lib/types/ink/instances.d.ts.map +1 -0
  396. package/lib/types/ink/instances.js +13 -0
  397. package/lib/types/ink/layout/engine.d.ts +7 -0
  398. package/lib/types/ink/layout/engine.d.ts.map +1 -0
  399. package/lib/types/ink/layout/engine.js +8 -0
  400. package/lib/types/ink/layout/geometry.d.ts +86 -0
  401. package/lib/types/ink/layout/geometry.d.ts.map +1 -0
  402. package/lib/types/ink/layout/geometry.js +95 -0
  403. package/lib/types/ink/layout/node.d.ts +151 -0
  404. package/lib/types/ink/layout/node.d.ts.map +1 -0
  405. package/lib/types/ink/layout/node.js +72 -0
  406. package/lib/types/ink/layout/yoga.d.ts +69 -0
  407. package/lib/types/ink/layout/yoga.d.ts.map +1 -0
  408. package/lib/types/ink/layout/yoga.js +249 -0
  409. package/lib/types/ink/line-width-cache.d.ts +9 -0
  410. package/lib/types/ink/line-width-cache.d.ts.map +1 -0
  411. package/lib/types/ink/line-width-cache.js +45 -0
  412. package/lib/types/ink/log-update.d.ts +57 -0
  413. package/lib/types/ink/log-update.d.ts.map +1 -0
  414. package/lib/types/ink/log-update.js +710 -0
  415. package/lib/types/ink/measure-element.d.ts +19 -0
  416. package/lib/types/ink/measure-element.d.ts.map +1 -0
  417. package/lib/types/ink/measure-element.js +10 -0
  418. package/lib/types/ink/measure-text.d.ts +13 -0
  419. package/lib/types/ink/measure-text.d.ts.map +1 -0
  420. package/lib/types/ink/measure-text.js +38 -0
  421. package/lib/types/ink/node-cache.d.ts +33 -0
  422. package/lib/types/ink/node-cache.d.ts.map +1 -0
  423. package/lib/types/ink/node-cache.js +42 -0
  424. package/lib/types/ink/optimizer.d.ts +18 -0
  425. package/lib/types/ink/optimizer.d.ts.map +1 -0
  426. package/lib/types/ink/optimizer.js +83 -0
  427. package/lib/types/ink/output.d.ts +200 -0
  428. package/lib/types/ink/output.d.ts.map +1 -0
  429. package/lib/types/ink/output.js +663 -0
  430. package/lib/types/ink/parse-keypress.d.ts +132 -0
  431. package/lib/types/ink/parse-keypress.d.ts.map +1 -0
  432. package/lib/types/ink/parse-keypress.js +707 -0
  433. package/lib/types/ink/reconciler.d.ts +43 -0
  434. package/lib/types/ink/reconciler.d.ts.map +1 -0
  435. package/lib/types/ink/reconciler.js +413 -0
  436. package/lib/types/ink/render-border.d.ts +36 -0
  437. package/lib/types/ink/render-border.d.ts.map +1 -0
  438. package/lib/types/ink/render-border.js +143 -0
  439. package/lib/types/ink/render-node-to-output.d.ts +93 -0
  440. package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
  441. package/lib/types/ink/render-node-to-output.js +1290 -0
  442. package/lib/types/ink/render-to-screen.d.ts +65 -0
  443. package/lib/types/ink/render-to-screen.d.ts.map +1 -0
  444. package/lib/types/ink/render-to-screen.js +189 -0
  445. package/lib/types/ink/renderer.d.ts +24 -0
  446. package/lib/types/ink/renderer.d.ts.map +1 -0
  447. package/lib/types/ink/renderer.js +136 -0
  448. package/lib/types/ink/root.d.ts +91 -0
  449. package/lib/types/ink/root.d.ts.map +1 -0
  450. package/lib/types/ink/root.js +93 -0
  451. package/lib/types/ink/screen.d.ts +443 -0
  452. package/lib/types/ink/screen.d.ts.map +1 -0
  453. package/lib/types/ink/screen.js +1295 -0
  454. package/lib/types/ink/searchHighlight.d.ts +25 -0
  455. package/lib/types/ink/searchHighlight.d.ts.map +1 -0
  456. package/lib/types/ink/searchHighlight.js +82 -0
  457. package/lib/types/ink/selection.d.ts +323 -0
  458. package/lib/types/ink/selection.d.ts.map +1 -0
  459. package/lib/types/ink/selection.js +881 -0
  460. package/lib/types/ink/squash-text-nodes.d.ts +30 -0
  461. package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
  462. package/lib/types/ink/squash-text-nodes.js +63 -0
  463. package/lib/types/ink/stringWidth.d.ts +11 -0
  464. package/lib/types/ink/stringWidth.d.ts.map +1 -0
  465. package/lib/types/ink/stringWidth.js +209 -0
  466. package/lib/types/ink/styles.d.ts +324 -0
  467. package/lib/types/ink/styles.d.ts.map +1 -0
  468. package/lib/types/ink/styles.js +307 -0
  469. package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
  470. package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
  471. package/lib/types/ink/supports-hyperlinks.js +44 -0
  472. package/lib/types/ink/tabstops.d.ts +9 -0
  473. package/lib/types/ink/tabstops.d.ts.map +1 -0
  474. package/lib/types/ink/tabstops.js +46 -0
  475. package/lib/types/ink/terminal-focus-state.d.ts +35 -0
  476. package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
  477. package/lib/types/ink/terminal-focus-state.js +57 -0
  478. package/lib/types/ink/terminal-querier.d.ts +161 -0
  479. package/lib/types/ink/terminal-querier.d.ts.map +1 -0
  480. package/lib/types/ink/terminal-querier.js +204 -0
  481. package/lib/types/ink/terminal.d.ts +80 -0
  482. package/lib/types/ink/terminal.d.ts.map +1 -0
  483. package/lib/types/ink/terminal.js +268 -0
  484. package/lib/types/ink/termio/ansi.d.ts +75 -0
  485. package/lib/types/ink/termio/ansi.d.ts.map +1 -0
  486. package/lib/types/ink/termio/ansi.js +79 -0
  487. package/lib/types/ink/termio/csi.d.ts +253 -0
  488. package/lib/types/ink/termio/csi.d.ts.map +1 -0
  489. package/lib/types/ink/termio/csi.js +347 -0
  490. package/lib/types/ink/termio/dec.d.ts +61 -0
  491. package/lib/types/ink/termio/dec.d.ts.map +1 -0
  492. package/lib/types/ink/termio/dec.js +76 -0
  493. package/lib/types/ink/termio/esc.d.ts +15 -0
  494. package/lib/types/ink/termio/esc.d.ts.map +1 -0
  495. package/lib/types/ink/termio/esc.js +57 -0
  496. package/lib/types/ink/termio/osc.d.ts +208 -0
  497. package/lib/types/ink/termio/osc.d.ts.map +1 -0
  498. package/lib/types/ink/termio/osc.js +466 -0
  499. package/lib/types/ink/termio/parser.d.ts +46 -0
  500. package/lib/types/ink/termio/parser.d.ts.map +1 -0
  501. package/lib/types/ink/termio/parser.js +366 -0
  502. package/lib/types/ink/termio/sgr.d.ts +17 -0
  503. package/lib/types/ink/termio/sgr.d.ts.map +1 -0
  504. package/lib/types/ink/termio/sgr.js +300 -0
  505. package/lib/types/ink/termio/tokenize.d.ts +50 -0
  506. package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
  507. package/lib/types/ink/termio/tokenize.js +266 -0
  508. package/lib/types/ink/termio/types.d.ts +211 -0
  509. package/lib/types/ink/termio/types.d.ts.map +1 -0
  510. package/lib/types/ink/termio/types.js +68 -0
  511. package/lib/types/ink/termio.d.ts +25 -0
  512. package/lib/types/ink/termio.d.ts.map +1 -0
  513. package/lib/types/ink/termio.js +24 -0
  514. package/lib/types/ink/truncateToWidth.d.ts +7 -0
  515. package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
  516. package/lib/types/ink/truncateToWidth.js +18 -0
  517. package/lib/types/ink/useTerminalNotification.d.ts +45 -0
  518. package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
  519. package/lib/types/ink/useTerminalNotification.js +70 -0
  520. package/lib/types/ink/warn.d.ts +7 -0
  521. package/lib/types/ink/warn.d.ts.map +1 -0
  522. package/lib/types/ink/warn.js +15 -0
  523. package/lib/types/ink/widest-line.d.ts +7 -0
  524. package/lib/types/ink/widest-line.d.ts.map +1 -0
  525. package/lib/types/ink/widest-line.js +19 -0
  526. package/lib/types/ink/wrap-text.d.ts +10 -0
  527. package/lib/types/ink/wrap-text.d.ts.map +1 -0
  528. package/lib/types/ink/wrap-text.js +61 -0
  529. package/lib/types/ink/wrapAnsi.d.ts +18 -0
  530. package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
  531. package/lib/types/ink/wrapAnsi.js +16 -0
  532. package/lib/types/invariant.d.ts +20 -0
  533. package/lib/types/invariant.d.ts.map +1 -0
  534. package/lib/types/invariant.js +26 -0
  535. package/lib/types/modelPrefs.d.ts +37 -0
  536. package/lib/types/modelPrefs.d.ts.map +1 -0
  537. package/lib/types/modelPrefs.js +66 -0
  538. package/lib/types/modelRoute.d.ts +79 -0
  539. package/lib/types/modelRoute.d.ts.map +1 -0
  540. package/lib/types/modelRoute.js +96 -0
  541. package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
  542. package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
  543. package/lib/types/native-ts/yoga-layout/enums.js +150 -0
  544. package/lib/types/native-ts/yoga-layout/index.d.ts +788 -0
  545. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
  546. package/lib/types/native-ts/yoga-layout/index.js +2571 -0
  547. package/lib/types/packaged-skills.d.ts +10 -0
  548. package/lib/types/packaged-skills.d.ts.map +1 -0
  549. package/lib/types/packaged-skills.js +63 -0
  550. package/lib/types/plugin.d.ts +33 -0
  551. package/lib/types/plugin.d.ts.map +1 -0
  552. package/lib/types/plugin.js +454 -0
  553. package/lib/types/presetPrefs.d.ts +29 -0
  554. package/lib/types/presetPrefs.d.ts.map +1 -0
  555. package/lib/types/presetPrefs.js +61 -0
  556. package/lib/types/presets.d.ts +110 -0
  557. package/lib/types/presets.d.ts.map +1 -0
  558. package/lib/types/presets.js +114 -0
  559. package/lib/types/questions.d.ts +97 -0
  560. package/lib/types/questions.d.ts.map +1 -0
  561. package/lib/types/questions.js +201 -0
  562. package/lib/types/screens/Chat.d.ts +23 -0
  563. package/lib/types/screens/Chat.d.ts.map +1 -0
  564. package/lib/types/screens/Chat.js +1263 -0
  565. package/lib/types/screens/StatusLine.d.ts +16 -0
  566. package/lib/types/screens/StatusLine.d.ts.map +1 -0
  567. package/lib/types/screens/StatusLine.js +105 -0
  568. package/lib/types/screens/StatusMetrics.d.ts +87 -0
  569. package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
  570. package/lib/types/screens/StatusMetrics.js +252 -0
  571. package/lib/types/sessionHistory.d.ts +32 -0
  572. package/lib/types/sessionHistory.d.ts.map +1 -0
  573. package/lib/types/sessionHistory.js +87 -0
  574. package/lib/types/theme.d.ts +115 -0
  575. package/lib/types/theme.d.ts.map +1 -0
  576. package/lib/types/theme.js +300 -0
  577. package/lib/types/themePrefs.d.ts +28 -0
  578. package/lib/types/themePrefs.d.ts.map +1 -0
  579. package/lib/types/themePrefs.js +59 -0
  580. package/lib/types/ui.d.ts +28 -0
  581. package/lib/types/ui.d.ts.map +1 -0
  582. package/lib/types/ui.js +25 -0
  583. package/lib/types/update.d.ts +76 -0
  584. package/lib/types/update.d.ts.map +1 -0
  585. package/lib/types/update.js +203 -0
  586. package/lib/types/utils/clipboard.d.ts +43 -0
  587. package/lib/types/utils/clipboard.d.ts.map +1 -0
  588. package/lib/types/utils/clipboard.js +82 -0
  589. package/lib/types/utils/debug.d.ts +8 -0
  590. package/lib/types/utils/debug.d.ts.map +1 -0
  591. package/lib/types/utils/debug.js +12 -0
  592. package/lib/types/utils/earlyInput.d.ts +7 -0
  593. package/lib/types/utils/earlyInput.d.ts.map +1 -0
  594. package/lib/types/utils/earlyInput.js +6 -0
  595. package/lib/types/utils/env.d.ts +10 -0
  596. package/lib/types/utils/env.d.ts.map +1 -0
  597. package/lib/types/utils/env.js +9 -0
  598. package/lib/types/utils/envUtils.d.ts +8 -0
  599. package/lib/types/utils/envUtils.d.ts.map +1 -0
  600. package/lib/types/utils/envUtils.js +13 -0
  601. package/lib/types/utils/execFileNoThrow.d.ts +34 -0
  602. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
  603. package/lib/types/utils/execFileNoThrow.js +31 -0
  604. package/lib/types/utils/fullscreen.d.ts +8 -0
  605. package/lib/types/utils/fullscreen.d.ts.map +1 -0
  606. package/lib/types/utils/fullscreen.js +10 -0
  607. package/lib/types/utils/intl.d.ts +7 -0
  608. package/lib/types/utils/intl.d.ts.map +1 -0
  609. package/lib/types/utils/intl.js +9 -0
  610. package/lib/types/utils/loaded-context.d.ts +20 -0
  611. package/lib/types/utils/loaded-context.d.ts.map +1 -0
  612. package/lib/types/utils/loaded-context.js +36 -0
  613. package/lib/types/utils/log.d.ts +7 -0
  614. package/lib/types/utils/log.d.ts.map +1 -0
  615. package/lib/types/utils/log.js +9 -0
  616. package/lib/types/utils/mentions.d.ts +30 -0
  617. package/lib/types/utils/mentions.d.ts.map +1 -0
  618. package/lib/types/utils/mentions.js +72 -0
  619. package/lib/types/utils/narration.d.ts +11 -0
  620. package/lib/types/utils/narration.d.ts.map +1 -0
  621. package/lib/types/utils/narration.js +16 -0
  622. package/lib/types/utils/semver.d.ts +9 -0
  623. package/lib/types/utils/semver.d.ts.map +1 -0
  624. package/lib/types/utils/semver.js +24 -0
  625. package/lib/types/utils/sliceAnsi.d.ts +12 -0
  626. package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
  627. package/lib/types/utils/sliceAnsi.js +79 -0
  628. package/lib/types/working-activity.d.ts +19 -0
  629. package/lib/types/working-activity.d.ts.map +1 -0
  630. package/lib/types/working-activity.js +18 -0
  631. package/package.json +141 -0
  632. package/skills/audit/SKILL.md +24 -0
  633. package/skills/bug/SKILL.md +27 -0
  634. package/skills/pr-comments/SKILL.md +20 -0
  635. package/skills/practice/SKILL.md +22 -0
  636. package/skills/release-notes/SKILL.md +25 -0
  637. package/skills/review/SKILL.md +25 -0
  638. package/skills/vuln-check/SKILL.md +25 -0
@@ -0,0 +1,220 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box, Text } from '../../ui.js';
3
+ import { stringWidth } from '../../ink/stringWidth.js';
4
+ import { useAnimationFrame } from '../../ink/hooks/use-animation-frame.js';
5
+ import { ToolUseLoader } from '../ToolUseLoader.js';
6
+ import { formatDuration } from '../../cc/format.js';
7
+ /** Tool display names: DSH emits lowercase tool ids (`bash`); Claude Code
8
+ * shows capitalized names (`Bash`). Map the common ones, fall back to the
9
+ * id with its first letter uppercased. */
10
+ function displayName(name) {
11
+ const KNOWN = {
12
+ bash: 'Bash',
13
+ powershell: 'PowerShell',
14
+ read: 'Read',
15
+ glob: 'Glob',
16
+ grep: 'Grep',
17
+ write: 'Write',
18
+ edit: 'Edit',
19
+ todo_write: 'TodoWrite',
20
+ subagent: 'Task',
21
+ web_search: 'WebSearch',
22
+ };
23
+ const mapped = KNOWN[name];
24
+ if (mapped)
25
+ return mapped;
26
+ if (name.length === 0)
27
+ return name;
28
+ return name[0].toUpperCase() + name.slice(1);
29
+ }
30
+ /** CC's collapsed text body keeps 3 lines (renderTruncatedContent). */
31
+ const TEXT_BODY_MAX_LINES = 3;
32
+ /** Diff bodies cap at the upstream chat row's 8 (dsh-client-ui-tool's
33
+ * CHAT_DIFF_MAX_LINES) — denser information than log output. */
34
+ const DIFF_BODY_MAX_LINES = 8;
35
+ const GUTTER_FIRST = ' ⎿ ';
36
+ const GUTTER_REST = ' ';
37
+ const add = (text) => ({ text, tone: 'add' });
38
+ const del = (text) => ({ text, tone: 'del' });
39
+ const dim = (text) => ({ text, tone: 'dim' });
40
+ const plain = (text) => ({ text, tone: 'plain' });
41
+ /** One side's text → display lines (upstream contentLines rule: empty text
42
+ * is zero lines; a single trailing newline is a terminator, not a line;
43
+ * interior blanks survive). */
44
+ function sideLines(text) {
45
+ if (text === '')
46
+ return [];
47
+ const lines = text.split('\n');
48
+ if (lines[lines.length - 1] === '')
49
+ lines.pop();
50
+ return lines;
51
+ }
52
+ /** Diff hunks → add/del rows. The header already carries the path for the
53
+ * common single-hunk case; with several hunks a path row separates files
54
+ * and `⋯` separates scattered hunks of one file (upstream DiffBlock). */
55
+ function diffLines(diffs) {
56
+ const out = [];
57
+ let prevPath;
58
+ for (const diff of diffs) {
59
+ if (diffs.length > 1) {
60
+ if (diff.path !== prevPath)
61
+ out.push(plain(diff.path));
62
+ else
63
+ out.push(dim('⋯'));
64
+ }
65
+ prevPath = diff.path;
66
+ if (diff.oldText !== null) {
67
+ for (const line of sideLines(diff.oldText))
68
+ out.push(del(`- ${line}`));
69
+ }
70
+ for (const line of sideLines(diff.newText))
71
+ out.push(add(`+ ${line}`));
72
+ }
73
+ return out;
74
+ }
75
+ /** Join the text blocks of a view's content payload (read/generic cards). */
76
+ function contentLines(content) {
77
+ const text = (content ?? []).map(block => (block.type === 'text' ? block.text ?? '' : '')).join('').trimEnd();
78
+ if (text === '')
79
+ return [];
80
+ return text.split('\n').map(dim);
81
+ }
82
+ /** Per-card body lines; unknown/absent shapes yield [] so the caller falls
83
+ * back to the raw result text. */
84
+ function viewLines(view) {
85
+ switch (view.card) {
86
+ case 'diff':
87
+ return diffLines(view.diffs);
88
+ case 'terminal': {
89
+ // The call-side terminal card has no output yet; only presentResult's
90
+ // does. `in` narrows the call/result union without extra types.
91
+ const out = (('output' in view ? view.output : undefined) ?? '').trimEnd();
92
+ const lines = out === '' ? [] : out.split('\n').map(dim);
93
+ if ('exitCode' in view && view.exitCode !== undefined && view.exitCode !== 0) {
94
+ lines.push({ text: `Exit code ${view.exitCode}`, tone: 'error' });
95
+ }
96
+ if ('signal' in view && view.signal !== undefined) {
97
+ lines.push({ text: `Killed by signal ${view.signal}`, tone: 'error' });
98
+ }
99
+ return lines;
100
+ }
101
+ case 'read':
102
+ return contentLines('content' in view ? view.content : undefined);
103
+ case 'generic':
104
+ return contentLines('content' in view ? view.content : undefined);
105
+ case 'search': {
106
+ if (view.shape === 'paths') {
107
+ const lines = view.paths.map(plain);
108
+ if (view.truncated)
109
+ lines.push(dim(`… (${view.total} total)`));
110
+ return lines;
111
+ }
112
+ const lines = [];
113
+ for (const file of view.files) {
114
+ lines.push(plain(file.path));
115
+ for (const match of file.matches) {
116
+ lines.push(dim(`${match.lineNumber}: ${match.line}`));
117
+ }
118
+ }
119
+ if (view.truncated)
120
+ lines.push(dim(`… (${view.total} total)`));
121
+ return lines;
122
+ }
123
+ default:
124
+ return [];
125
+ }
126
+ }
127
+ /** Collapsed bodies fold past the card's line budget; verbose (Ctrl+O) is
128
+ * always uncapped. Mirrors wrapText's "one extra line is shown directly". */
129
+ function capLines(lines, max, verbose) {
130
+ if (verbose || lines.length <= max)
131
+ return lines;
132
+ if (lines.length - max === 1)
133
+ return lines;
134
+ return [
135
+ ...lines.slice(0, max),
136
+ dim(`… +${lines.length - max} lines (ctrl+o to expand)`),
137
+ ];
138
+ }
139
+ /** Header title from the presentation view: terminal cards keep the
140
+ * `Name(command)` shape; everything else renders the tool's own title
141
+ * (`Edit /path`, `Read /path (1 - 100)`) with the first word bold. The
142
+ * result view's title replaces the call view's only when present — a
143
+ * settled terminal card carries output but no title of its own. */
144
+ function HeaderTitle({ name, title, isTerminal, displayArgs }) {
145
+ if (title === undefined) {
146
+ return (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, wrap: "truncate-end", children: name }) }), displayArgs !== '' && (_jsx(Box, { flexWrap: "nowrap", children: _jsxs(Text, { children: ["(", displayArgs, ")"] }) }))] }));
147
+ }
148
+ if (isTerminal) {
149
+ return (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, wrap: "truncate-end", children: name }) }), _jsx(Box, { flexWrap: "nowrap", children: _jsxs(Text, { children: ["(", title, ")"] }) })] }));
150
+ }
151
+ const trimmed = title.trim();
152
+ if (trimmed === '') {
153
+ return (_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, wrap: "truncate-end", children: name }) }));
154
+ }
155
+ const space = trimmed.indexOf(' ');
156
+ const head = space === -1 ? trimmed : trimmed.slice(0, space);
157
+ const tail = space === -1 ? '' : trimmed.slice(space);
158
+ return (_jsx(Box, { flexWrap: "nowrap", children: _jsxs(Text, { bold: true, wrap: "truncate-end", children: [head, _jsx(Text, { bold: false, children: tail })] }) }));
159
+ }
160
+ /**
161
+ * Tool-call card: `● Edit /path` header with a blinking status dot, then the
162
+ * structured body under a ` ⎿ ` gutter — diff hunks in red/green, terminal
163
+ * output, read content — instead of the raw result dump (ported from the
164
+ * leak's `AssistantToolUseMessage.tsx` + the dsh-tools presentation views the
165
+ * channel captures per call).
166
+ */
167
+ export function AssistantToolUseMessage({ tool, addMargin, verbose, isSelected = false, isExpanded = false, }) {
168
+ const isRunning = tool.status === 'running';
169
+ const isError = tool.status === 'error';
170
+ const displayArgs = verbose ? tool.argsFull ?? tool.argsText : tool.argsText;
171
+ const result = tool.resultFull ?? tool.resultText;
172
+ const name = displayName(tool.name);
173
+ const minWidth = stringWidth(name) + 2;
174
+ // The settled view carries the applied diff / actual output; while running,
175
+ // the call view already shows the pending change (CC's pending Edit diff).
176
+ const view = tool.resultView ?? tool.callView;
177
+ // presentResult may omit a title (terminal results carry output, not a
178
+ // command) — then the call view's title stands.
179
+ const headerTitle = tool.resultView?.title ?? tool.callView?.title;
180
+ const headerIsTerminal = view?.card === 'terminal';
181
+ // Live elapsed clock while the call runs (CC's bash elapsed timer): the
182
+ // 1s tick re-renders the card; elapsed derives from wall-clock refs.
183
+ const [viewportRef] = useAnimationFrame(isRunning ? 1000 : null);
184
+ const elapsedMs = isRunning
185
+ ? tool.startedAt !== undefined
186
+ ? Date.now() - tool.startedAt
187
+ : undefined
188
+ : tool.durationMs;
189
+ const elapsedText = elapsedMs !== undefined ? ` · ${formatDuration(elapsedMs)}` : '';
190
+ // Body lines: the structured view first, raw result text as the fallback
191
+ // (tools without a presenter, or a folded row awaiting loadOlder).
192
+ let body = [];
193
+ if (isError) {
194
+ if (tool.errorText)
195
+ body = [{ text: tool.errorText, tone: 'error' }];
196
+ }
197
+ else {
198
+ if (view !== undefined)
199
+ body = viewLines(view);
200
+ if (body.length === 0 && result) {
201
+ body = result.trimEnd().split('\n').map(dim);
202
+ }
203
+ if (isRunning && body.length === 0) {
204
+ body = [dim(`Running… (${formatDuration(Math.max(0, Date.now() - (tool.startedAt ?? Date.now())))})`)];
205
+ }
206
+ }
207
+ const cap = view?.card === 'diff' ? DIFF_BODY_MAX_LINES : TEXT_BODY_MAX_LINES;
208
+ const lines = capLines(body, cap, verbose);
209
+ return (_jsx(Box, { ref: viewportRef, flexDirection: "row", justifyContent: "space-between", marginTop: addMargin ? 1 : 0, width: "100%", backgroundColor: isSelected
210
+ ? 'messageActionsBackground'
211
+ : isExpanded
212
+ ? 'userMessageBackgroundHover'
213
+ : undefined, children: _jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [_jsxs(Box, { flexDirection: "row", flexWrap: "nowrap", minWidth: minWidth, children: [_jsx(ToolUseLoader, { shouldAnimate: isRunning, isUnresolved: isRunning, isError: isError }), _jsx(HeaderTitle, { name: name, title: headerTitle, isTerminal: headerIsTerminal, displayArgs: displayArgs }), !isRunning && (_jsx(Box, { flexWrap: "nowrap", children: _jsx(Text, { dimColor: true, children: elapsedText }) }))] }), lines.map((line, index) => (_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: 5, flexShrink: 0, children: _jsx(Text, { dimColor: true, children: index === 0 ? GUTTER_FIRST : GUTTER_REST }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: line.tone === 'add'
214
+ ? 'diffAddedWord'
215
+ : line.tone === 'del'
216
+ ? 'diffRemovedWord'
217
+ : line.tone === 'error'
218
+ ? 'error'
219
+ : undefined, dimColor: line.tone === 'dim', wrap: "wrap", children: line.text === '' ? ' ' : line.text }) })] }, index)))] }) }));
220
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ /** Wall-clock ms of the assistant message event. */
4
+ timestamp?: number;
5
+ /** Model id shown next to the time (session model). */
6
+ model: string;
7
+ };
8
+ /**
9
+ * Transcript-mode metadata row: `HH:MM · model`, right-aligned above the
10
+ * assistant text (ported from the leak's MessageTimestamp + MessageModel,
11
+ * collapsed into one row).
12
+ */
13
+ export declare function MessageMetadata({ timestamp, model, }: Props): React.ReactNode;
14
+ export {};
15
+ //# sourceMappingURL=MessageMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageMetadata.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/MessageMetadata.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,KAAK,GAAG;IACX,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,KAAK,GACN,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAczB"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Box from '../../ink/components/Box.js';
3
+ import Text from '../../ink/components/Text.js';
4
+ import { stringWidth } from '../../ink/stringWidth.js';
5
+ /**
6
+ * Transcript-mode metadata row: `HH:MM · model`, right-aligned above the
7
+ * assistant text (ported from the leak's MessageTimestamp + MessageModel,
8
+ * collapsed into one row).
9
+ */
10
+ export function MessageMetadata({ timestamp, model, }) {
11
+ if (timestamp === undefined)
12
+ return null;
13
+ const formatted = new Date(timestamp).toLocaleTimeString('en-US', {
14
+ hour: '2-digit',
15
+ minute: '2-digit',
16
+ hour12: true,
17
+ });
18
+ const text = `${formatted} · ${model}`;
19
+ return (_jsx(Box, { minWidth: stringWidth(text), children: _jsx(Text, { dimColor: true, children: text }) }));
20
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ text: string;
4
+ /** Adds the top margin between turns (CC: addMargin). */
5
+ addMargin: boolean;
6
+ /** Message-selection mode highlight. */
7
+ isSelected?: boolean;
8
+ /** Row expanded on its own (persistent hover-grey background, CC). */
9
+ isExpanded?: boolean;
10
+ onClick?(): void;
11
+ };
12
+ /**
13
+ * User prompt bubble: `❯ text` on the theme's userMessageBackground grey
14
+ * (ported from the leak's `messages/UserPromptMessage.tsx` +
15
+ * `HighlightedThinkingText.tsx`, with the ultrathink rainbow removed).
16
+ */
17
+ export declare function UserPromptMessage({ text, addMargin, isSelected, isExpanded, onClick, }: Props): React.ReactNode;
18
+ export {};
19
+ //# sourceMappingURL=UserPromptMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPromptMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/UserPromptMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,SAAS,EAAE,OAAO,CAAA;IAClB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,IAAI,IAAI,CAAA;CACjB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,SAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,OAAO,GACR,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAqBzB"}
@@ -0,0 +1,15 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Text } from '../../ui.js';
3
+ import { POINTER } from '../../cc/figures.js';
4
+ /**
5
+ * User prompt bubble: `❯ text` on the theme's userMessageBackground grey
6
+ * (ported from the leak's `messages/UserPromptMessage.tsx` +
7
+ * `HighlightedThinkingText.tsx`, with the ultrathink rainbow removed).
8
+ */
9
+ export function UserPromptMessage({ text, addMargin, isSelected = false, isExpanded = false, onClick, }) {
10
+ return (_jsx(Box, { flexDirection: "column", marginTop: addMargin ? 1 : 0, backgroundColor: isSelected
11
+ ? 'messageActionsBackground'
12
+ : isExpanded
13
+ ? 'userMessageBackgroundHover'
14
+ : 'userMessageBackground', paddingRight: 1, onClick: onClick, children: _jsxs(Text, { children: [_jsxs(Text, { color: "subtle", children: [POINTER, " "] }), _jsx(Text, { color: "text", children: text })] }) }));
15
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The questionnaire panel — Claude Code style ask-user-question UI for the
3
+ * DSH user-interaction seam. One question per panel (progress header, header
4
+ * chip, wrapped question text, optional detail, option list with focus
5
+ * pointer and multi-select checkmarks), styled in the dsh-tui mist-blue
6
+ * design language.
7
+ *
8
+ * The list's last row IS the free-text input (issue #9): no Tab, no mode
9
+ * switch — the view never changes. Typing while focused on a real option
10
+ * appends into that input row (single-select also attaches the option's
11
+ * label, so the answer can carry both `selected` and `custom`); focusing
12
+ * the input row itself and typing gives a pure custom answer.
13
+ */
14
+ import React from 'react';
15
+ import type { QuestionSelection } from '../../questions.js';
16
+ export type AskUserQuestionPanelProps = {
17
+ /** The question to render (from the QuestionStore snapshot). */
18
+ readonly question: {
19
+ readonly question: string;
20
+ readonly header?: string;
21
+ readonly detail?: string;
22
+ readonly options?: ReadonlyArray<{
23
+ readonly label: string;
24
+ readonly description?: string;
25
+ }>;
26
+ readonly multiSelect?: boolean;
27
+ };
28
+ /** 1-based position within the batch (progress header). */
29
+ readonly position: number;
30
+ /** Total questions in the batch (progress header). */
31
+ readonly total: number;
32
+ /** Questions answered before the current one. */
33
+ readonly answered: number;
34
+ readonly onAnswer: (selection: QuestionSelection) => void;
35
+ /** Esc / Ctrl+C — aborts the whole ask (ASK_ABORTED back to the model). */
36
+ readonly onCancel: () => void;
37
+ };
38
+ export declare function AskUserQuestionPanel({ question, position, total, answered, onAnswer, onCancel, }: AskUserQuestionPanelProps): React.ReactNode;
39
+ //# sourceMappingURL=AskUserQuestionPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AskUserQuestionPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/questions/AskUserQuestionPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAM3D,MAAM,MAAM,yBAAyB,GAAG;IACtC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;QAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAC/B,CAAA;IACD,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACzD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAC9B,CAAA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,GAAG,KAAK,CAAC,SAAS,CA8S7C"}
@@ -0,0 +1,228 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The questionnaire panel — Claude Code style ask-user-question UI for the
4
+ * DSH user-interaction seam. One question per panel (progress header, header
5
+ * chip, wrapped question text, optional detail, option list with focus
6
+ * pointer and multi-select checkmarks), styled in the dsh-tui mist-blue
7
+ * design language.
8
+ *
9
+ * The list's last row IS the free-text input (issue #9): no Tab, no mode
10
+ * switch — the view never changes. Typing while focused on a real option
11
+ * appends into that input row (single-select also attaches the option's
12
+ * label, so the answer can carry both `selected` and `custom`); focusing
13
+ * the input row itself and typing gives a pure custom answer.
14
+ */
15
+ import React from 'react';
16
+ import { t } from '../../i18n.js';
17
+ import { Box, Text, useInput } from '../../ui.js';
18
+ import { Divider } from '../design-system/Divider.js';
19
+ import { POINTER } from '../../cc/figures.js';
20
+ const CHECKED = '◉';
21
+ const UNCHECKED = '○';
22
+ const PENCIL = '✎';
23
+ export function AskUserQuestionPanel({ question, position, total, answered, onAnswer, onCancel, }) {
24
+ const options = question.options ?? [];
25
+ const multiSelect = question.multiSelect === true;
26
+ /** Rows: the real options plus the inline input row at the tail. */
27
+ const rowCount = options.length + 1;
28
+ const [focusIndex, setFocusIndex] = React.useState(0);
29
+ const [checked, setChecked] = React.useState(() => new Set());
30
+ const [customText, setCustomText] = React.useState('');
31
+ const [customCursor, setCustomCursor] = React.useState(0);
32
+ /** Single-select label captured by typing on a focused option — submitted
33
+ * together with the custom text when the input row itself is Entered. */
34
+ const [attached, setAttached] = React.useState(null);
35
+ const [error, setError] = React.useState(null);
36
+ const inputFocused = focusIndex === options.length;
37
+ const moveFocus = (delta) => {
38
+ if (rowCount <= 1)
39
+ return;
40
+ setFocusIndex(index => (index + delta + rowCount) % rowCount);
41
+ setError(null);
42
+ };
43
+ /** Append at the text tail (option-row typing has no visible cursor). */
44
+ const appendText = (text) => {
45
+ setCustomText(previous => previous + text);
46
+ setCustomCursor(previous => previous + text.length);
47
+ setError(null);
48
+ };
49
+ /** Drop the character before the cursor; empty text drops the attach. */
50
+ const backspaceText = () => {
51
+ if (customCursor <= 0)
52
+ return;
53
+ setCustomText(previous => {
54
+ const next = previous.slice(0, customCursor - 1) + previous.slice(customCursor);
55
+ if (next === '')
56
+ setAttached(null);
57
+ return next;
58
+ });
59
+ setCustomCursor(cursor => cursor - 1);
60
+ };
61
+ const checkedLabels = () => [...checked].sort((a, b) => a - b).map(index => options[index]?.label)
62
+ .filter((label) => label !== undefined);
63
+ /** Enter on a real option: the option(s) plus whatever the input row holds. */
64
+ const submitOptions = () => {
65
+ const text = customText.trim();
66
+ if (multiSelect) {
67
+ const selected = checkedLabels();
68
+ if (selected.length === 0 && text === '') {
69
+ setError(t('question-select-or-answer'));
70
+ return;
71
+ }
72
+ onAnswer({ selected, ...(text !== '' ? { custom: text } : {}) });
73
+ return;
74
+ }
75
+ const label = options[focusIndex]?.label;
76
+ if (label === undefined) {
77
+ setError(t('question-select-or-answer'));
78
+ return;
79
+ }
80
+ onAnswer({ selected: [label], ...(text !== '' ? { custom: text } : {}) });
81
+ };
82
+ /** Enter on the input row itself: the text, plus the attached label (or
83
+ * the checked labels for multi-select) when there is one. */
84
+ const submitInput = () => {
85
+ const text = customText.trim();
86
+ if (multiSelect) {
87
+ const selected = checkedLabels();
88
+ if (selected.length === 0 && text === '') {
89
+ setError(t('question-answer-or-check'));
90
+ return;
91
+ }
92
+ onAnswer({ selected, ...(text !== '' ? { custom: text } : {}) });
93
+ return;
94
+ }
95
+ if (text === '') {
96
+ setError(t('question-type-answer-first'));
97
+ return;
98
+ }
99
+ onAnswer({ selected: attached !== null ? [attached] : [], custom: text });
100
+ };
101
+ useInput((input, key) => {
102
+ if (key.escape || (key.ctrl && input === 'c')) {
103
+ onCancel();
104
+ return;
105
+ }
106
+ if (inputFocused) {
107
+ if (key.upArrow) {
108
+ moveFocus(-1);
109
+ return;
110
+ }
111
+ if (key.downArrow) {
112
+ moveFocus(1);
113
+ return;
114
+ }
115
+ if (key.return) {
116
+ submitInput();
117
+ return;
118
+ }
119
+ if (key.backspace) {
120
+ backspaceText();
121
+ return;
122
+ }
123
+ if (key.delete) {
124
+ if (customCursor < customText.length) {
125
+ setCustomText(text => {
126
+ const next = text.slice(0, customCursor) + text.slice(customCursor + 1);
127
+ if (next === '')
128
+ setAttached(null);
129
+ return next;
130
+ });
131
+ }
132
+ return;
133
+ }
134
+ if (key.leftArrow) {
135
+ setCustomCursor(cursor => Math.max(0, cursor - 1));
136
+ return;
137
+ }
138
+ if (key.rightArrow) {
139
+ setCustomCursor(cursor => Math.min(customText.length, cursor + 1));
140
+ return;
141
+ }
142
+ if (key.home) {
143
+ setCustomCursor(0);
144
+ return;
145
+ }
146
+ if (key.end) {
147
+ setCustomCursor(customText.length);
148
+ return;
149
+ }
150
+ if (!key.ctrl && !key.meta && input) {
151
+ setCustomText(text => text.slice(0, customCursor) + input + text.slice(customCursor));
152
+ setCustomCursor(cursor => cursor + input.length);
153
+ setError(null);
154
+ }
155
+ return;
156
+ }
157
+ // A real option row.
158
+ if (key.upArrow) {
159
+ moveFocus(-1);
160
+ return;
161
+ }
162
+ if (key.downArrow) {
163
+ moveFocus(1);
164
+ return;
165
+ }
166
+ if (key.tab) {
167
+ setFocusIndex(options.length);
168
+ setError(null);
169
+ return;
170
+ }
171
+ if (input === ' ' && multiSelect) {
172
+ setChecked(previous => {
173
+ const next = new Set(previous);
174
+ if (next.has(focusIndex))
175
+ next.delete(focusIndex);
176
+ else
177
+ next.add(focusIndex);
178
+ return next;
179
+ });
180
+ return;
181
+ }
182
+ if (key.return) {
183
+ submitOptions();
184
+ return;
185
+ }
186
+ if (key.backspace) {
187
+ // Edit the input row without leaving the option list.
188
+ if (customText !== '')
189
+ backspaceText();
190
+ return;
191
+ }
192
+ // Typing on an option appends into the input row; single-select also
193
+ // attaches this option's label so Enter carries label + text (#9).
194
+ if (!key.ctrl && !key.meta && input) {
195
+ appendText(input);
196
+ if (!multiSelect)
197
+ setAttached(options[focusIndex]?.label ?? null);
198
+ }
199
+ }, { isActive: true });
200
+ const remaining = total - answered;
201
+ const headerTitle = ` ${t('question-header-progress', { position, total, remaining: remaining > 1 ? t('question-remaining-more', { n: remaining }) : '' })} `;
202
+ const cursorChar = customCursor < customText.length ? customText[customCursor] : ' ';
203
+ const renderInputRow = () => (_jsxs(Box, { flexDirection: "row", marginTop: inputFocused ? 1 : 0, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: inputFocused ? 'claude' : undefined, bold: inputFocused, children: inputFocused ? POINTER : ' ' }) }), _jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: inputFocused ? 'claude' : 'suggestion', children: PENCIL }) }), _jsxs(Box, { flexDirection: "row", marginLeft: 1, children: [_jsx(Text, { bold: inputFocused, color: inputFocused ? 'claude' : 'suggestion', children: t('question-custom-tab') }), attached !== null && (_jsx(Text, { color: "suggestion", children: t('question-attached-label', { label: attached }) })), _jsx(Text, { dimColor: true, children: "\uFF1A" }), customText === '' && !inputFocused ? (_jsx(Text, { dimColor: true, children: t('question-direct-input') })) : (_jsxs(_Fragment, { children: [_jsx(Text, { wrap: "wrap", children: customText.slice(0, customCursor) }), inputFocused
204
+ ? _jsx(Text, { inverse: true, children: cursorChar })
205
+ : _jsx(Text, { color: "suggestion", children: "\u258F" }), _jsx(Text, { wrap: "wrap", children: customText.slice(inputFocused ? customCursor + 1 : customCursor) })] }))] })] }));
206
+ const renderOptions = () => (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [options.map((option, index) => {
207
+ const focused = index === focusIndex;
208
+ const selected = multiSelect ? checked.has(index) : focused;
209
+ return (_jsxs(Box, { flexDirection: "row", marginTop: focused ? 1 : 0, children: [_jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'claude' : undefined, bold: focused, children: focused ? POINTER : ' ' }) }), _jsx(Box, { width: 1, flexShrink: 0, children: _jsx(Text, { color: focused ? 'claude' : undefined, bold: selected, children: selected ? (multiSelect ? CHECKED : '●') : UNCHECKED }) }), _jsxs(Box, { flexDirection: "column", marginLeft: 1, children: [_jsx(Text, { bold: focused || selected, color: focused ? 'claude' : undefined, wrap: "wrap", children: option.label }), option.description !== undefined && (_jsx(Text, { dimColor: true, wrap: "wrap", children: option.description }))] })] }, option.label));
210
+ }), renderInputRow()] }));
211
+ const hintParts = inputFocused
212
+ ? [
213
+ t('question-hint-type'),
214
+ t('question-hint-enter'),
215
+ ...(options.length > 0 ? [t('question-hint-back')] : []),
216
+ t('question-hint-esc'),
217
+ ...(multiSelect && checked.size > 0 ? [t('question-hint-selected', { n: checked.size })] : []),
218
+ ]
219
+ : [
220
+ t('question-hint-select'),
221
+ ...(multiSelect ? [t('question-hint-multi')] : []),
222
+ t('question-hint-attach'),
223
+ t('question-hint-enter'),
224
+ t('question-hint-esc'),
225
+ ...(multiSelect && checked.size > 0 ? [t('question-hint-selected', { n: checked.size })] : []),
226
+ ];
227
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, paddingRight: 2, width: "100%", children: [_jsx(Divider, { color: "permission", title: headerTitle, padding: 4 }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [question.header !== undefined && (_jsxs(Text, { color: "suggestion", bold: true, children: ["\u25C8 ", question.header] })), _jsx(Text, { bold: true, wrap: "wrap", children: question.question }), question.detail !== undefined && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: question.detail.split('\n').map((line, index) => (_jsx(Text, { dimColor: true, italic: true, wrap: "wrap", children: line }, index))) }))] }), renderOptions(), error !== null && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: error }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: hintParts.join(' · ') }) })] }));
228
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared shimmer utilities: the blue-white color ladder of the header and a
3
+ * moving-highlight text painter used by the header wordmark/tagline and the
4
+ * working-activity status line.
5
+ */
6
+ export interface Rgb {
7
+ r: number;
8
+ g: number;
9
+ b: number;
10
+ }
11
+ /** Header blue-white ladder: brand → ice → pale → soft ice flash.
12
+ * FLASH stays visibly blue (never pure white) — the highlight reads as a
13
+ * mist-brightened crest, not a white strobe. */
14
+ export declare const BRAND: Rgb;
15
+ /** Header ladder ice blue (`#93BEFF`). */
16
+ export declare const ICE: Rgb;
17
+ /** Header ladder pale blue (`#D7E4FF`). */
18
+ export declare const PALE: Rgb;
19
+ /** Soft ice flash blue (`#C6D8F8`); stays visibly blue, never pure white. */
20
+ export declare const FLASH: Rgb;
21
+ /**
22
+ * Paint `word` with a 10-column highlight window sweeping across it. The
23
+ * window advances one column per `stepMs` and the brightness pulse follows
24
+ * the same cadence (period 2π·stepMs·... — one full sine per ~6 steps).
25
+ * CC's original cadence was 200ms/column; callers pass 60 for the lively
26
+ * sweep.
27
+ * @param word - Text to paint.
28
+ * @param time - Elapsed time in milliseconds; drives the sweep position and the brightness pulse.
29
+ * @param base - Color for cells outside the highlight window.
30
+ * @param highlight - Color mixed into the sweeping highlight window.
31
+ * @param stepMs - Milliseconds per column of sweep advance (default 60).
32
+ * @returns The ANSI bold-colored word with the moving highlight.
33
+ */
34
+ export declare function sweep(word: string, time: number, base: Rgb, highlight: Rgb, stepMs?: number): string;
35
+ //# sourceMappingURL=shimmer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/components/shimmer.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AAEH,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;iDAEiD;AACjD,eAAO,MAAM,KAAK,EAAE,GAA+B,CAAA;AACnD,0CAA0C;AAC1C,eAAO,MAAM,GAAG,EAAE,GAAgC,CAAA;AAClD,2CAA2C;AAC3C,eAAO,MAAM,IAAI,EAAE,GAAgC,CAAA;AACnD,6EAA6E;AAC7E,eAAO,MAAM,KAAK,EAAE,GAAgC,CAAA;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,SAAK,GAAG,MAAM,CAehG"}
@@ -0,0 +1,43 @@
1
+ import chalk from 'chalk';
2
+ import { stringWidth } from '../ink/stringWidth.js';
3
+ import { getGraphemeSegmenter } from '../utils/intl.js';
4
+ import { interpolateColor } from '../components/Spinner/spinnerUtils.js';
5
+ /** Header blue-white ladder: brand → ice → pale → soft ice flash.
6
+ * FLASH stays visibly blue (never pure white) — the highlight reads as a
7
+ * mist-brightened crest, not a white strobe. */
8
+ export const BRAND = { r: 77, g: 107, b: 254 };
9
+ /** Header ladder ice blue (`#93BEFF`). */
10
+ export const ICE = { r: 147, g: 190, b: 255 };
11
+ /** Header ladder pale blue (`#D7E4FF`). */
12
+ export const PALE = { r: 215, g: 228, b: 255 };
13
+ /** Soft ice flash blue (`#C6D8F8`); stays visibly blue, never pure white. */
14
+ export const FLASH = { r: 198, g: 216, b: 248 };
15
+ /**
16
+ * Paint `word` with a 10-column highlight window sweeping across it. The
17
+ * window advances one column per `stepMs` and the brightness pulse follows
18
+ * the same cadence (period 2π·stepMs·... — one full sine per ~6 steps).
19
+ * CC's original cadence was 200ms/column; callers pass 60 for the lively
20
+ * sweep.
21
+ * @param word - Text to paint.
22
+ * @param time - Elapsed time in milliseconds; drives the sweep position and the brightness pulse.
23
+ * @param base - Color for cells outside the highlight window.
24
+ * @param highlight - Color mixed into the sweeping highlight window.
25
+ * @param stepMs - Milliseconds per column of sweep advance (default 60).
26
+ * @returns The ANSI bold-colored word with the moving highlight.
27
+ */
28
+ export function sweep(word, time, base, highlight, stepMs = 60) {
29
+ const width = stringWidth(word);
30
+ const cycle = width + 20;
31
+ const glimmerStart = (Math.floor(time / stepMs) % cycle) - 10;
32
+ let out = '';
33
+ let col = 0;
34
+ for (const { segment } of getGraphemeSegmenter().segment(word)) {
35
+ const segWidth = stringWidth(segment);
36
+ const highlighted = col >= glimmerStart && col + segWidth <= glimmerStart + 10;
37
+ const opacity = highlighted ? (Math.sin(time / (stepMs * 2)) + 1) / 2 : 0;
38
+ const rgb = highlighted ? interpolateColor(base, highlight, opacity) : base;
39
+ out += chalk.rgb(rgb.r, rgb.g, rgb.b).bold(segment);
40
+ col += segWidth;
41
+ }
42
+ return out;
43
+ }