@deepseek-harness-tui/dsh-tui 0.6.1 → 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 +25 -7
  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
@@ -2,16 +2,16 @@
2
2
  * Persisted working-activity indicator preference, mirroring the pi
3
3
  * working-activity extension's `~/.pi/agent/working-activity.json`
4
4
  * (`frames` key). dsh-tui keeps its own copy at
5
- * `~/.dsh-cc/working-activity.json` so the `/activity` choice survives
5
+ * `~/.dsh-tui/working-activity.json` so the `/activity` choice survives
6
6
  * restarts. The file is best-effort: a missing or corrupt file (or an
7
7
  * unknown preset left behind by an older version) just falls back to the
8
8
  * default preset.
9
9
  */
10
10
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
11
- import { homedir } from 'node:os';
12
11
  import { join } from 'node:path';
13
12
  import { isPresetName } from './components/activityFrames.js';
14
- const PREFS_DIR = join(homedir(), '.dsh-cc');
13
+ import { DATA_DIR } from './utils/paths.js';
14
+ const PREFS_DIR = DATA_DIR;
15
15
  /**
16
16
  * Parse a persisted `{ frames }` value; anything else yields undefined.
17
17
  * @param text - Raw file contents.
@@ -1,41 +1,48 @@
1
1
  /**
2
- * UI glyph constants, ported from the leaked Claude Code source
3
- * (`src/constants/figures.ts`). The macOS/Windows variants from the original
4
- * are kept; the plugin renders on whatever platform the user runs.
2
+ * UI glyph constants used across the TUI: prompt markers, status badges,
3
+ * direction arrows, media controls, reasoning-effort indicators, and
4
+ * bridge-state symbols.
5
+ *
6
+ * Every constant is a fixed Unicode character, so rendering is identical on
7
+ * all platforms except the activity bullet: macOS gets a heavier ring glyph
8
+ * that matches its default terminal font, everything else gets a solid dot.
9
+ * Escapes are used instead of raw characters so the file stays robust to
10
+ * encoding round-trips; the rendered glyph is shown in each comment.
5
11
  */
12
+ /** Activity bullet: ring on macOS (`⏺`), solid dot elsewhere (`●`). */
6
13
  export declare const BLACK_CIRCLE: string;
7
- /** The prompt pointer glyph (`❯`), figures.pointer. */
14
+ /** Prompt pointer, a bold right chevron (`❯`). */
8
15
  export declare const POINTER = "\u276F";
9
- /** Checkmark (`✓`), figures.tick. */
16
+ /** Success checkmark (`✓`). */
10
17
  export declare const TICK = "\u2713";
11
- /** Bullet dot (`∙`), figures.bulletOperator. */
18
+ /** Small dot for separating operators (`∙`). */
12
19
  export declare const BULLET_OPERATOR = "\u2219";
13
- /** Teardrop asterisk (`✻`), figures.teardropAsterisk. */
20
+ /** Teardrop asterisk, decorative list marker (`✻`). */
14
21
  export declare const TEARDROP_ASTERISK = "\u273B";
22
+ /** Lightning bolt, "fast / hot" marker (`↯`). */
23
+ export declare const LIGHTNING_BOLT = "\u21AF";
15
24
  /** Up arrow (`↑`). */
16
25
  export declare const UP_ARROW = "\u2191";
17
26
  /** Down arrow (`↓`). */
18
27
  export declare const DOWN_ARROW = "\u2193";
19
- /** Lightning bolt (`↯`), figures.lightningBolt. */
20
- export declare const LIGHTNING_BOLT = "\u21AF";
21
- /** Low-effort indicator: open circle (`○`). */
28
+ /** Left arrow (`←`), channel indicator. */
29
+ export declare const CHANNEL_ARROW = "\u2190";
30
+ /** Right arrow (`→`), injected-message indicator. */
31
+ export declare const INJECTED_ARROW = "\u2192";
32
+ /** Low effort: open circle (`○`). */
22
33
  export declare const EFFORT_LOW = "\u25CB";
23
- /** Medium-effort indicator: half circle (`◐`). */
34
+ /** Medium effort: half-filled circle (`◐`). */
24
35
  export declare const EFFORT_MEDIUM = "\u25D0";
25
- /** High-effort indicator: filled circle (`●`). */
36
+ /** High effort: filled circle (`●`). */
26
37
  export declare const EFFORT_HIGH = "\u25CF";
27
- /** Max-effort indicator: bullseye (`◉`). */
38
+ /** Maximum effort: bullseye (`◉`). */
28
39
  export declare const EFFORT_MAX = "\u25C9";
29
- /** Play control icon (`▶`). */
40
+ /** Play control (`▶`). */
30
41
  export declare const PLAY_ICON = "\u25B6";
31
- /** Pause control icon (`⏸`). */
42
+ /** Pause control (`⏸`). */
32
43
  export declare const PAUSE_ICON = "\u23F8";
33
44
  /** Refresh arrow (`↻`), MCP subscription indicator. */
34
45
  export declare const REFRESH_ARROW = "\u21BB";
35
- /** Left arrow (`←`), channel indicator. */
36
- export declare const CHANNEL_ARROW = "\u2190";
37
- /** Right arrow (`→`), injected-message indicator. */
38
- export declare const INJECTED_ARROW = "\u2192";
39
46
  /** Fork glyph (`⑂`), fork indicator. */
40
47
  export declare const FORK_GLYPH = "\u2442";
41
48
  /** Open diamond (`◇`), review status indicator. */
@@ -50,7 +57,7 @@ export declare const FLAG_ICON = "\u2691";
50
57
  export declare const BLOCKQUOTE_BAR = "\u258E";
51
58
  /** Heavy horizontal rule (`━`). */
52
59
  export declare const HEAVY_HORIZONTAL = "\u2501";
53
- /** Bridge status spinner frames (`·|·`, `·/·`, `·—·`, `·\·`). */
60
+ /** Bridge spinner frames: `·|·` → `·/·` → `·—·` → `·\·`. */
54
61
  export declare const BRIDGE_SPINNER_FRAMES: string[];
55
62
  /** Bridge ready indicator (`·✔︎·`). */
56
63
  export declare const BRIDGE_READY_INDICATOR = "\u00B7\u2714\uFE0E\u00B7";
@@ -1 +1 @@
1
- {"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../../src/cc/figures.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,YAAY,QAA4C,CAAA;AACrE,uDAAuD;AACvD,eAAO,MAAM,OAAO,WAAM,CAAA;AAC1B,qCAAqC;AACrC,eAAO,MAAM,IAAI,WAAM,CAAA;AACvB,gDAAgD;AAChD,eAAO,MAAM,eAAe,WAAM,CAAA;AAClC,yDAAyD;AACzD,eAAO,MAAM,iBA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,MAAM,gBAAgB,WAAW,CAAA;AAGxC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,UAKjC,CAAA;AACD,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,6BAA6B,CAAA;AAChE,qCAAqC;AACrC,eAAO,MAAM,uBAAuB,WAAW,CAAA"}
@@ -1,62 +1,71 @@
1
1
  /**
2
- * UI glyph constants, ported from the leaked Claude Code source
3
- * (`src/constants/figures.ts`). The macOS/Windows variants from the original
4
- * are kept; the plugin renders on whatever platform the user runs.
2
+ * UI glyph constants used across the TUI: prompt markers, status badges,
3
+ * direction arrows, media controls, reasoning-effort indicators, and
4
+ * bridge-state symbols.
5
+ *
6
+ * Every constant is a fixed Unicode character, so rendering is identical on
7
+ * all platforms except the activity bullet: macOS gets a heavier ring glyph
8
+ * that matches its default terminal font, everything else gets a solid dot.
9
+ * Escapes are used instead of raw characters so the file stays robust to
10
+ * encoding round-trips; the rendered glyph is shown in each comment.
5
11
  */
12
+ /** Activity bullet: ring on macOS (`⏺`), solid dot elsewhere (`●`). */
6
13
  export const BLACK_CIRCLE = process.platform === 'darwin' ? '⏺' : '●';
7
- /** The prompt pointer glyph (`❯`), figures.pointer. */
8
- export const POINTER = '❯';
9
- /** Checkmark (`✓`), figures.tick. */
10
- export const TICK = '✓';
11
- /** Bullet dot (`∙`), figures.bulletOperator. */
12
- export const BULLET_OPERATOR = '∙';
13
- /** Teardrop asterisk (`✻`), figures.teardropAsterisk. */
14
- export const TEARDROP_ASTERISK = '✻';
14
+ // Prompt and list markers
15
+ /** Prompt pointer, a bold right chevron (`❯`). */
16
+ export const POINTER = '\u276f'; // ❯
17
+ /** Success checkmark (`✓`). */
18
+ export const TICK = '\u2713'; // ✓
19
+ /** Small dot for separating operators (`∙`). */
20
+ export const BULLET_OPERATOR = '\u2219'; // ∙
21
+ /** Teardrop asterisk, decorative list marker (`✻`). */
22
+ export const TEARDROP_ASTERISK = '\u273b'; // ✻
23
+ /** Lightning bolt, "fast / hot" marker (`↯`). */
24
+ export const LIGHTNING_BOLT = '\u21af'; // ↯
25
+ // Direction arrows
15
26
  /** Up arrow (`↑`). */
16
27
  export const UP_ARROW = '\u2191'; // ↑
17
28
  /** Down arrow (`↓`). */
18
29
  export const DOWN_ARROW = '\u2193'; // ↓
19
- /** Lightning bolt (`↯`), figures.lightningBolt. */
20
- export const LIGHTNING_BOLT = '↯';
21
- /** Low-effort indicator: open circle (`○`). */
22
- export const EFFORT_LOW = '○';
23
- /** Medium-effort indicator: half circle (`◐`). */
24
- export const EFFORT_MEDIUM = '◐';
25
- /** High-effort indicator: filled circle (`●`). */
26
- export const EFFORT_HIGH = '●';
27
- /** Max-effort indicator: bullseye (`◉`). */
28
- export const EFFORT_MAX = '◉';
29
- // Media/trigger status indicators
30
- /** Play control icon (`▶`). */
31
- export const PLAY_ICON = '\u25b6'; // ▶
32
- /** Pause control icon (`⏸`). */
33
- export const PAUSE_ICON = '\u23f8'; // ⏸
34
- // MCP subscription indicators
35
- /** Refresh arrow (`↻`), MCP subscription indicator. */
36
- export const REFRESH_ARROW = '\u21bb'; // ↻
37
30
  /** Left arrow (`←`), channel indicator. */
38
31
  export const CHANNEL_ARROW = '\u2190'; // ←
39
32
  /** Right arrow (`→`), injected-message indicator. */
40
33
  export const INJECTED_ARROW = '\u2192'; // →
34
+ // Reasoning-effort badges, from low to maximum
35
+ /** Low effort: open circle (`○`). */
36
+ export const EFFORT_LOW = '\u25cb'; // ○
37
+ /** Medium effort: half-filled circle (`◐`). */
38
+ export const EFFORT_MEDIUM = '\u25d0'; // ◐
39
+ /** High effort: filled circle (`●`). */
40
+ export const EFFORT_HIGH = '\u25cf'; // ●
41
+ /** Maximum effort: bullseye (`◉`). */
42
+ export const EFFORT_MAX = '\u25c9'; // ◉
43
+ // Media transport controls
44
+ /** Play control (`▶`). */
45
+ export const PLAY_ICON = '\u25b6'; // ▶
46
+ /** Pause control (`⏸`). */
47
+ export const PAUSE_ICON = '\u23f8'; // ⏸
48
+ // Subscription and routing
49
+ /** Refresh arrow (`↻`), MCP subscription indicator. */
50
+ export const REFRESH_ARROW = '\u21bb'; // ↻
41
51
  /** Fork glyph (`⑂`), fork indicator. */
42
52
  export const FORK_GLYPH = '\u2442'; // ⑂
43
- // Review status indicators
53
+ // Review status
44
54
  /** Open diamond (`◇`), review status indicator. */
45
55
  export const DIAMOND_OPEN = '\u25c7'; // ◇
46
56
  /** Filled diamond (`◆`), review status indicator. */
47
57
  export const DIAMOND_FILLED = '\u25c6'; // ◆
48
58
  /** Reference mark (`※`), reference indicator. */
49
59
  export const REFERENCE_MARK = '\u203b'; // ※
50
- // Issue flag indicator
60
+ // Flag, quote, and rule markers
51
61
  /** Flag icon (`⚑`), issue indicator. */
52
62
  export const FLAG_ICON = '\u2691'; // ⚑
53
- // Blockquote indicator
54
63
  /** Blockquote bar (`▎`), left one-quarter block. */
55
64
  export const BLOCKQUOTE_BAR = '\u258e'; // ▎
56
65
  /** Heavy horizontal rule (`━`). */
57
66
  export const HEAVY_HORIZONTAL = '\u2501'; // ━
58
- // Bridge status indicators
59
- /** Bridge status spinner frames (`·|·`, `·/·`, `·—·`, `·\·`). */
67
+ // Bridge status
68
+ /** Bridge spinner frames: `·|·` → `·/·` → `·—·` → `·\·`. */
60
69
  export const BRIDGE_SPINNER_FRAMES = [
61
70
  '\u00b7|\u00b7',
62
71
  '\u00b7/\u00b7',
@@ -1,24 +1,33 @@
1
1
  /**
2
- * Token/byte display formatters, ported from the leaked Claude Code source
3
- * (src/utils/format.ts) minus the app-level formatter registry.
2
+ * Number, token-count, and duration formatters shared by the status line
3
+ * and message rows.
4
+ *
5
+ * All number output uses the `en` locale with at most one fraction digit.
6
+ * Values at or above 1000 switch to compact notation (e.g. `1.5K`), which
7
+ * callers receive lowercased as `1.5k` for a calmer status-line look.
4
8
  */
5
9
  /**
6
10
  * Format a number for display, switching to compact notation at 1000.
7
11
  * @param number - The value to format.
8
- * @returns The formatted number, lowercased (e.g. `1.2k`).
12
+ * @returns The formatted number, lowercased (e.g. `1.2k`, `1.5m`).
9
13
  */
10
14
  export declare function formatNumber(number: number): string;
11
15
  /**
12
- * Format a token count, dropping a trailing `.0` from compact values.
16
+ * Format a token count for display.
17
+ * Compact values that round to an even unit (e.g. `1.0k`) drop the
18
+ * trailing zero so the status line reads `1k` instead of `1.0k`.
13
19
  * @param count - The token count to format.
14
- * @returns The formatted count (e.g. `988`, `3.4k`).
20
+ * @returns The formatted count (e.g. `988`, `3.4k`, `1k`).
15
21
  */
16
22
  export declare function formatTokens(count: number): string;
17
23
  /**
18
- * Compact duration like `12s`, `3m 4s`, `1h 2m` (ported from the leak).
19
- * @param durationMs - Duration in milliseconds; negative values clamp to zero.
20
- * @param options - Formatting options; `mostSignificantOnly` stops after the first non-zero unit.
21
- * @returns The space-joined duration string with `h`/`m`/`s` units.
24
+ * Format a duration in milliseconds as a compact `h`/`m`/`s` string
25
+ * (e.g. `12s`, `3m 4s`, `1h 2m`).
26
+ * Negative durations are clamped to zero; a zero duration renders as `0s`.
27
+ * @param durationMs - Duration in milliseconds.
28
+ * @param options - `mostSignificantOnly` stops at the first non-zero unit
29
+ * (e.g. `1h`, `3m`) instead of emitting every unit.
30
+ * @returns The space-joined duration string.
22
31
  */
23
32
  export declare function formatDuration(durationMs: number, options?: {
24
33
  mostSignificantOnly?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cc/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9C,MAAM,CAoBR"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cc/format.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9C,MAAM,CAwBR"}
@@ -1,8 +1,13 @@
1
1
  /**
2
- * Token/byte display formatters, ported from the leaked Claude Code source
3
- * (src/utils/format.ts) minus the app-level formatter registry.
2
+ * Number, token-count, and duration formatters shared by the status line
3
+ * and message rows.
4
+ *
5
+ * All number output uses the `en` locale with at most one fraction digit.
6
+ * Values at or above 1000 switch to compact notation (e.g. `1.5K`), which
7
+ * callers receive lowercased as `1.5k` for a calmer status-line look.
4
8
  */
5
- function numberFormatter(compact) {
9
+ /** Build a formatter that emits either compact or standard notation. */
10
+ function buildNumberFormat(compact) {
6
11
  return new Intl.NumberFormat('en', {
7
12
  notation: compact ? 'compact' : 'standard',
8
13
  maximumFractionDigits: 1,
@@ -11,25 +16,29 @@ function numberFormatter(compact) {
11
16
  /**
12
17
  * Format a number for display, switching to compact notation at 1000.
13
18
  * @param number - The value to format.
14
- * @returns The formatted number, lowercased (e.g. `1.2k`).
19
+ * @returns The formatted number, lowercased (e.g. `1.2k`, `1.5m`).
15
20
  */
16
21
  export function formatNumber(number) {
17
- const compact = number >= 1000;
18
- return numberFormatter(compact).format(number).toLowerCase();
22
+ return buildNumberFormat(number >= 1000).format(number).toLowerCase();
19
23
  }
20
24
  /**
21
- * Format a token count, dropping a trailing `.0` from compact values.
25
+ * Format a token count for display.
26
+ * Compact values that round to an even unit (e.g. `1.0k`) drop the
27
+ * trailing zero so the status line reads `1k` instead of `1.0k`.
22
28
  * @param count - The token count to format.
23
- * @returns The formatted count (e.g. `988`, `3.4k`).
29
+ * @returns The formatted count (e.g. `988`, `3.4k`, `1k`).
24
30
  */
25
31
  export function formatTokens(count) {
26
32
  return formatNumber(count).replace('.0', '');
27
33
  }
28
34
  /**
29
- * Compact duration like `12s`, `3m 4s`, `1h 2m` (ported from the leak).
30
- * @param durationMs - Duration in milliseconds; negative values clamp to zero.
31
- * @param options - Formatting options; `mostSignificantOnly` stops after the first non-zero unit.
32
- * @returns The space-joined duration string with `h`/`m`/`s` units.
35
+ * Format a duration in milliseconds as a compact `h`/`m`/`s` string
36
+ * (e.g. `12s`, `3m 4s`, `1h 2m`).
37
+ * Negative durations are clamped to zero; a zero duration renders as `0s`.
38
+ * @param durationMs - Duration in milliseconds.
39
+ * @param options - `mostSignificantOnly` stops at the first non-zero unit
40
+ * (e.g. `1h`, `3m`) instead of emitting every unit.
41
+ * @returns The space-joined duration string.
33
42
  */
34
43
  export function formatDuration(durationMs, options = {}) {
35
44
  const { mostSignificantOnly = false } = options;
@@ -38,17 +47,16 @@ export function formatDuration(durationMs, options = {}) {
38
47
  const minutes = Math.floor((totalSeconds % 3600) / 60);
39
48
  const seconds = totalSeconds % 60;
40
49
  const parts = [];
50
+ let stopAfterFirst = false;
41
51
  if (hours > 0) {
42
52
  parts.push(`${hours}h`);
43
- if (mostSignificantOnly)
44
- return parts.join(' ');
53
+ stopAfterFirst = mostSignificantOnly;
45
54
  }
46
- if (minutes > 0) {
55
+ if (!stopAfterFirst && minutes > 0) {
47
56
  parts.push(`${minutes}m`);
48
- if (mostSignificantOnly && hours === 0)
49
- return parts.join(' ');
57
+ stopAfterFirst = mostSignificantOnly && hours === 0;
50
58
  }
51
- if (seconds > 0 || parts.length === 0) {
59
+ if (!stopAfterFirst && (seconds > 0 || parts.length === 0)) {
52
60
  parts.push(`${seconds}s`);
53
61
  }
54
62
  return parts.join(' ');
@@ -1,24 +1,32 @@
1
+ /**
2
+ * Markdown-to-ANSI renderer over marked's token stream.
3
+ *
4
+ * Converts the shared marked lexer output into styled terminal text: quote
5
+ * gutters, syntax-highlighted fenced blocks, indented list bullets with
6
+ * depth-based numbering, and alignment-padded tables. The visual conventions
7
+ * (▎ bars for blockquotes, theme-colored inline code, OSC 8 hyperlinks) are
8
+ * standard terminal markdown idioms, but this is an independent
9
+ * implementation: a single dispatch switch fans tokens out to dedicated
10
+ * per-type render functions, and all recursive calls thread one immutable
11
+ * RenderState (parent token, list depth, list ordinal, highlighter) instead
12
+ * of passing positional arguments.
13
+ */
1
14
  import { type Token } from 'marked';
2
15
  import type { CliHighlight } from './cliHighlight.js';
3
16
  /**
4
- * Strip tool-analysis XML tags (`<commit_analysis>`, `<context>`, `<function_analysis>`,
5
- * `<pr_analysis>`) and their contents, then trim the result.
6
- * @param content - Markdown text that may contain the wrapped tool-analysis tag blocks.
7
- * @returns The content with those blocks removed and surrounding whitespace trimmed.
17
+ * Strip tool-analysis XML blocks (`<commit_analysis>`, `<context>`,
18
+ * `<function_analysis>`, `<pr_analysis>`) and their contents, then trim.
19
+ * @param content - Markdown that may wrap the tool-analysis tag blocks.
20
+ * @returns The content with those blocks removed and whitespace trimmed.
8
21
  */
9
22
  export declare function stripPromptXMLTags(content: string): string;
10
23
  /**
11
- * Configure the shared `marked` instance once: disable strikethrough parsing so
12
- * `~100` renders literally instead of as deleted text.
24
+ * Configure the shared `marked` instance once. Strikethrough parsing is
25
+ * disabled so that `~100` renders literally instead of as deleted text —
26
+ * models use `~` far more often for "approximate" than for real
27
+ * strikethrough.
13
28
  */
14
29
  export declare function configureMarked(): void;
15
- /**
16
- * Render markdown content to ANSI-styled text via the shared `marked` instance.
17
- * @param content - Markdown source to render.
18
- * @param highlight - Optional cli-highlight surface for code blocks; null disables syntax highlighting.
19
- * @returns The rendered ANSI string, trimmed.
20
- */
21
- export declare function applyMarkdown(content: string, highlight?: CliHighlight | null): string;
22
30
  /**
23
31
  * Render one marked token to ANSI text, recursing into child tokens.
24
32
  * @param token - The marked token to render.
@@ -30,9 +38,16 @@ export declare function applyMarkdown(content: string, highlight?: CliHighlight
30
38
  */
31
39
  export declare function formatToken(token: Token, listDepth?: number, orderedListNumber?: number | null, parent?: Token | null, highlight?: CliHighlight | null): string;
32
40
  /**
33
- * Pad `content` to `targetWidth` according to alignment. `displayWidth` is the
34
- * visible width of `content` (caller computes this, e.g. via stringWidth on
35
- * stripAnsi'd text, so ANSI codes in `content` don't affect padding).
41
+ * Render markdown content to ANSI-styled text via the shared `marked` instance.
42
+ * @param content - Markdown source to render.
43
+ * @param highlight - Optional cli-highlight surface for code blocks; null disables syntax highlighting.
44
+ * @returns The rendered ANSI string, trimmed.
45
+ */
46
+ export declare function applyMarkdown(content: string, highlight?: CliHighlight | null): string;
47
+ /**
48
+ * Pad `content` to `targetWidth` according to alignment. `displayWidth` is
49
+ * the visible width of `content` (callers compute it via stringWidth on the
50
+ * ANSI-stripped text, so embedded escape codes don't affect padding).
36
51
  * @param content - The text to pad, which may carry ANSI codes.
37
52
  * @param displayWidth - Visible width of `content` without ANSI codes.
38
53
  * @param targetWidth - Column width to pad `content` to.
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/cc/markdown.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,KAAK,KAAK,EAAe,MAAM,QAAQ,CAAA;AAMxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAcrD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AASD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAatC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EAEf,SAAS,GAAE,YAAY,GAAG,IAAW,GACpC,MAAM,CAOR;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EAEZ,SAAS,SAAI,EACb,iBAAiB,GAA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