@comma-agents/tui 2.0.0-rc.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 (256) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/App/App.d.ts +24 -0
  4. package/dist/App/App.theme.d.ts +12 -0
  5. package/dist/App/App.types.d.ts +8 -0
  6. package/dist/App/index.d.ts +4 -0
  7. package/dist/Theme/DefineTheme.d.ts +53 -0
  8. package/dist/Theme/Theme.d.ts +11 -0
  9. package/dist/Theme/Theme.types.d.ts +100 -0
  10. package/dist/Theme/index.d.ts +9 -0
  11. package/dist/Theme/themes/dark.d.ts +14 -0
  12. package/dist/Theme/themes/dracula.d.ts +9 -0
  13. package/dist/Theme/themes/index.d.ts +25 -0
  14. package/dist/Theme/themes/light.d.ts +10 -0
  15. package/dist/Theme/themes/solarized-dark.d.ts +9 -0
  16. package/dist/Theme/useTheme/index.d.ts +3 -0
  17. package/dist/Theme/useTheme/useTheme.context.d.ts +31 -0
  18. package/dist/Theme/useTheme/useTheme.d.ts +11 -0
  19. package/dist/Theme/useTheme/useTheme.types.d.ts +10 -0
  20. package/dist/components/BorderedPanel/BorderedPanel.d.ts +70 -0
  21. package/dist/components/BorderedPanel/BorderedPanel.theme.d.ts +59 -0
  22. package/dist/components/BorderedPanel/index.d.ts +4 -0
  23. package/dist/components/Button/Button.d.ts +69 -0
  24. package/dist/components/Button/Button.theme.d.ts +50 -0
  25. package/dist/components/Button/Button.types.d.ts +9 -0
  26. package/dist/components/Button/index.d.ts +4 -0
  27. package/dist/components/ChatTextArea/ChatTextArea.d.ts +85 -0
  28. package/dist/components/ChatTextArea/ChatTextArea.theme.d.ts +34 -0
  29. package/dist/components/ChatTextArea/index.d.ts +2 -0
  30. package/dist/components/CodeView/CodeView.constants.d.ts +9 -0
  31. package/dist/components/CodeView/CodeView.d.ts +23 -0
  32. package/dist/components/CodeView/CodeView.theme.d.ts +26 -0
  33. package/dist/components/CodeView/index.d.ts +4 -0
  34. package/dist/components/CommandPalette/CommandPalette.constants.d.ts +8 -0
  35. package/dist/components/CommandPalette/CommandPalette.d.ts +62 -0
  36. package/dist/components/CommandPalette/CommandPalette.theme.d.ts +50 -0
  37. package/dist/components/CommandPalette/CommandPalette.types.d.ts +50 -0
  38. package/dist/components/CommandPalette/CommandPalette.utils.d.ts +6 -0
  39. package/dist/components/CommandPalette/index.d.ts +5 -0
  40. package/dist/components/CommandPalette/pages/HelpPage/HelpPage.constants.d.ts +2 -0
  41. package/dist/components/CommandPalette/pages/HelpPage/HelpPage.d.ts +12 -0
  42. package/dist/components/CommandPalette/pages/HelpPage/HelpPage.types.d.ts +5 -0
  43. package/dist/components/CommandPalette/pages/HelpPage/index.d.ts +3 -0
  44. package/dist/components/CommandPalette/pages/ListProvidersPage/ListProvidersPage.d.ts +42 -0
  45. package/dist/components/CommandPalette/pages/ListProvidersPage/index.d.ts +1 -0
  46. package/dist/components/CommandPalette/pages/RegisteredProvidersPage/RegisteredProvidersPage.constants.d.ts +3 -0
  47. package/dist/components/CommandPalette/pages/RegisteredProvidersPage/RegisteredProvidersPage.d.ts +40 -0
  48. package/dist/components/CommandPalette/pages/RegisteredProvidersPage/RegisteredProvidersPage.types.d.ts +13 -0
  49. package/dist/components/CommandPalette/pages/RegisteredProvidersPage/RegisteredProvidersPage.utils.d.ts +9 -0
  50. package/dist/components/CommandPalette/pages/RegisteredProvidersPage/index.d.ts +2 -0
  51. package/dist/components/CommandPalette/pages/RunPickerPage/RunPickerPage.constants.d.ts +3 -0
  52. package/dist/components/CommandPalette/pages/RunPickerPage/RunPickerPage.d.ts +31 -0
  53. package/dist/components/CommandPalette/pages/RunPickerPage/RunPickerPage.types.d.ts +8 -0
  54. package/dist/components/CommandPalette/pages/RunPickerPage/RunPickerPage.utils.d.ts +7 -0
  55. package/dist/components/CommandPalette/pages/RunPickerPage/index.d.ts +3 -0
  56. package/dist/components/CommandPalette/pages/SettingsPage/SettingsPage.d.ts +24 -0
  57. package/dist/components/CommandPalette/pages/SettingsPage/index.d.ts +2 -0
  58. package/dist/components/Frame/Frame.d.ts +48 -0
  59. package/dist/components/Frame/Frame.theme.d.ts +52 -0
  60. package/dist/components/Frame/index.d.ts +4 -0
  61. package/dist/components/Hide/Hide.d.ts +20 -0
  62. package/dist/components/Hide/Hide.types.d.ts +12 -0
  63. package/dist/components/Hide/index.d.ts +2 -0
  64. package/dist/components/MessageList/AgentMessage/AgentMessage.d.ts +71 -0
  65. package/dist/components/MessageList/AgentMessage/index.d.ts +2 -0
  66. package/dist/components/MessageList/ContextUsageModal/ContextUsageModal.constants.d.ts +2 -0
  67. package/dist/components/MessageList/ContextUsageModal/ContextUsageModal.d.ts +9 -0
  68. package/dist/components/MessageList/ContextUsageModal/ContextUsageModal.types.d.ts +12 -0
  69. package/dist/components/MessageList/ContextUsageModal/index.d.ts +4 -0
  70. package/dist/components/MessageList/MarkdownView/MarkdownView.constants.d.ts +51 -0
  71. package/dist/components/MessageList/MarkdownView/MarkdownView.d.ts +34 -0
  72. package/dist/components/MessageList/MarkdownView/MarkdownView.theme.d.ts +89 -0
  73. package/dist/components/MessageList/MarkdownView/MarkdownView.types.d.ts +96 -0
  74. package/dist/components/MessageList/MarkdownView/MarkdownView.utils.d.ts +58 -0
  75. package/dist/components/MessageList/MarkdownView/index.d.ts +6 -0
  76. package/dist/components/MessageList/MessageList.d.ts +20 -0
  77. package/dist/components/MessageList/MessageList.theme.d.ts +170 -0
  78. package/dist/components/MessageList/MessageList.types.d.ts +26 -0
  79. package/dist/components/MessageList/OutputModal/OutputModal.constants.d.ts +22 -0
  80. package/dist/components/MessageList/OutputModal/OutputModal.d.ts +37 -0
  81. package/dist/components/MessageList/OutputModal/OutputModal.theme.d.ts +68 -0
  82. package/dist/components/MessageList/OutputModal/OutputModal.types.d.ts +56 -0
  83. package/dist/components/MessageList/OutputModal/OutputModal.utils.d.ts +3 -0
  84. package/dist/components/MessageList/OutputModal/index.d.ts +6 -0
  85. package/dist/components/MessageList/SpawnedStrategyView/SpawnedStrategyView.d.ts +47 -0
  86. package/dist/components/MessageList/SpawnedStrategyView/SpawnedStrategyView.theme.d.ts +58 -0
  87. package/dist/components/MessageList/SpawnedStrategyView/index.d.ts +4 -0
  88. package/dist/components/MessageList/SystemMessage/SystemMessage.d.ts +21 -0
  89. package/dist/components/MessageList/SystemMessage/index.d.ts +2 -0
  90. package/dist/components/MessageList/ToolCallView/ToolCallView.constants.d.ts +42 -0
  91. package/dist/components/MessageList/ToolCallView/ToolCallView.d.ts +71 -0
  92. package/dist/components/MessageList/ToolCallView/ToolCallView.theme.d.ts +47 -0
  93. package/dist/components/MessageList/ToolCallView/ToolCallView.types.d.ts +60 -0
  94. package/dist/components/MessageList/ToolCallView/ToolCallView.utils.d.ts +40 -0
  95. package/dist/components/MessageList/ToolCallView/index.d.ts +8 -0
  96. package/dist/components/MessageList/UserMessage/UserMessage.d.ts +25 -0
  97. package/dist/components/MessageList/UserMessage/index.d.ts +2 -0
  98. package/dist/components/MessageList/index.d.ts +14 -0
  99. package/dist/components/Modal/Modal.d.ts +64 -0
  100. package/dist/components/Modal/Modal.theme.d.ts +29 -0
  101. package/dist/components/Modal/index.d.ts +4 -0
  102. package/dist/components/MouseProvider/MouseContext.d.ts +36 -0
  103. package/dist/components/MouseProvider/MouseProvider.d.ts +20 -0
  104. package/dist/components/MouseProvider/index.d.ts +4 -0
  105. package/dist/components/PermissionPrompt/PermissionPrompt.d.ts +33 -0
  106. package/dist/components/PermissionPrompt/index.d.ts +2 -0
  107. package/dist/components/QuestionPrompt/QuestionPrompt.d.ts +4 -0
  108. package/dist/components/QuestionPrompt/QuestionPrompt.types.d.ts +18 -0
  109. package/dist/components/QuestionPrompt/index.d.ts +2 -0
  110. package/dist/components/ScrollableList/ScrollableList.d.ts +33 -0
  111. package/dist/components/ScrollableList/ScrollableList.theme.d.ts +33 -0
  112. package/dist/components/ScrollableList/ScrollableList.types.d.ts +66 -0
  113. package/dist/components/ScrollableList/index.d.ts +4 -0
  114. package/dist/components/ScrollableView/ScrollableView.d.ts +34 -0
  115. package/dist/components/ScrollableView/ScrollableView.theme.d.ts +34 -0
  116. package/dist/components/ScrollableView/ScrollableView.types.d.ts +113 -0
  117. package/dist/components/ScrollableView/index.d.ts +4 -0
  118. package/dist/components/Scrollbar/Scrollbar.d.ts +21 -0
  119. package/dist/components/Scrollbar/Scrollbar.theme.d.ts +16 -0
  120. package/dist/components/Scrollbar/Scrollbar.types.d.ts +27 -0
  121. package/dist/components/Scrollbar/Scrollbar.utils.d.ts +21 -0
  122. package/dist/components/Scrollbar/index.d.ts +4 -0
  123. package/dist/components/SearchInput/SearchInput.d.ts +22 -0
  124. package/dist/components/SearchInput/SearchInput.theme.d.ts +30 -0
  125. package/dist/components/SearchInput/SearchInput.types.d.ts +25 -0
  126. package/dist/components/SearchInput/SearchInput.utils.d.ts +22 -0
  127. package/dist/components/SearchInput/index.d.ts +5 -0
  128. package/dist/components/Separator/Separator.d.ts +39 -0
  129. package/dist/components/Separator/Separator.theme.d.ts +22 -0
  130. package/dist/components/Separator/index.d.ts +4 -0
  131. package/dist/components/StatusBar/StatusBar.d.ts +4 -0
  132. package/dist/components/StatusBar/StatusBar.theme.d.ts +35 -0
  133. package/dist/components/StatusBar/StatusBar.types.d.ts +24 -0
  134. package/dist/components/StatusBar/index.d.ts +2 -0
  135. package/dist/components/TextAreaInput/TextAreaInput.d.ts +68 -0
  136. package/dist/components/TextAreaInput/TextAreaInput.theme.d.ts +14 -0
  137. package/dist/components/TextAreaInput/TextAreaInput.utils.d.ts +69 -0
  138. package/dist/components/TextAreaInput/index.d.ts +2 -0
  139. package/dist/components/TitleIcon/TitleIcon.d.ts +13 -0
  140. package/dist/components/TitleIcon/TitleIcon.theme.d.ts +19 -0
  141. package/dist/components/TitleIcon/index.d.ts +1 -0
  142. package/dist/components/index.d.ts +61 -0
  143. package/dist/hooks/index.d.ts +27 -0
  144. package/dist/hooks/useBreakpoint/index.d.ts +2 -0
  145. package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +15 -0
  146. package/dist/hooks/useBreakpoint/useBreakpoint.types.d.ts +18 -0
  147. package/dist/hooks/useChat/index.d.ts +22 -0
  148. package/dist/hooks/useChat/useChat.context.d.ts +7 -0
  149. package/dist/hooks/useChat/useChat.d.ts +11 -0
  150. package/dist/hooks/useChat/useChat.types.d.ts +209 -0
  151. package/dist/hooks/useChat/useChat.utils.d.ts +18 -0
  152. package/dist/hooks/useChat/useChatActions.d.ts +10 -0
  153. package/dist/hooks/useChat/useChatAgentMessages/index.d.ts +1 -0
  154. package/dist/hooks/useChat/useChatAgentMessages/useChatAgentMessages.d.ts +2 -0
  155. package/dist/hooks/useChat/useChatInputRequests/index.d.ts +2 -0
  156. package/dist/hooks/useChat/useChatInputRequests/useChatInputRequests.d.ts +3 -0
  157. package/dist/hooks/useChat/useChatInputRequests/useChatInputRequests.types.d.ts +4 -0
  158. package/dist/hooks/useChat/useChatLifecycle.d.ts +5 -0
  159. package/dist/hooks/useChat/useChatPermissionRequests/index.d.ts +2 -0
  160. package/dist/hooks/useChat/useChatPermissionRequests/useChatPermissionRequestSubscriptions.d.ts +2 -0
  161. package/dist/hooks/useChat/useChatPermissionRequests/useChatPermissionRequests.d.ts +3 -0
  162. package/dist/hooks/useChat/useChatPermissionRequests/useChatPermissionRequests.types.d.ts +4 -0
  163. package/dist/hooks/useChat/useChatQuestionRequests/index.d.ts +2 -0
  164. package/dist/hooks/useChat/useChatQuestionRequests/useChatQuestionRequestSubscriptions.d.ts +2 -0
  165. package/dist/hooks/useChat/useChatQuestionRequests/useChatQuestionRequests.d.ts +3 -0
  166. package/dist/hooks/useChat/useChatQuestionRequests/useChatQuestionRequests.types.d.ts +4 -0
  167. package/dist/hooks/useChat/useChatRunLifecycle/index.d.ts +2 -0
  168. package/dist/hooks/useChat/useChatRunLifecycle/useChatRunLifecycle.d.ts +3 -0
  169. package/dist/hooks/useChat/useChatRunLifecycle/useChatRunLifecycle.types.d.ts +11 -0
  170. package/dist/hooks/useChat/useChatRunLifecycle/useChatRunLifecycleSubscriptions.d.ts +2 -0
  171. package/dist/hooks/useChat/useChatRunStore/index.d.ts +1 -0
  172. package/dist/hooks/useChat/useChatRunStore/useChatRunStore.d.ts +3 -0
  173. package/dist/hooks/useChat/useChatRuns.d.ts +10 -0
  174. package/dist/hooks/useChat/useChatState.d.ts +17 -0
  175. package/dist/hooks/useChat/useChatSteering/index.d.ts +2 -0
  176. package/dist/hooks/useChat/useChatSteering/useChatSteering.d.ts +3 -0
  177. package/dist/hooks/useChat/useChatSteering/useChatSteering.types.d.ts +4 -0
  178. package/dist/hooks/useChat/useChatStepMessages/index.d.ts +1 -0
  179. package/dist/hooks/useChat/useChatStepMessages/useChatStepMessages.d.ts +2 -0
  180. package/dist/hooks/useChat/usePersistedRunList/index.d.ts +2 -0
  181. package/dist/hooks/useChat/usePersistedRunList/usePersistedRunList.d.ts +3 -0
  182. package/dist/hooks/useChat/usePersistedRunList/usePersistedRunList.types.d.ts +5 -0
  183. package/dist/hooks/useDaemon/index.d.ts +6 -0
  184. package/dist/hooks/useDaemon/useDaemon.context.d.ts +18 -0
  185. package/dist/hooks/useDaemon/useDaemon.d.ts +7 -0
  186. package/dist/hooks/useDaemon/useDaemon.types.d.ts +62 -0
  187. package/dist/hooks/useDaemon/useDaemonCommand/index.d.ts +2 -0
  188. package/dist/hooks/useDaemon/useDaemonCommand/useDaemonCommand.d.ts +20 -0
  189. package/dist/hooks/useDaemon/useDaemonCommand/useDaemonCommand.types.d.ts +28 -0
  190. package/dist/hooks/useDaemon/useDaemonSubscription/index.d.ts +1 -0
  191. package/dist/hooks/useDaemon/useDaemonSubscription/useDaemonSubscription.d.ts +18 -0
  192. package/dist/hooks/useDebugRender/index.d.ts +2 -0
  193. package/dist/hooks/useDebugRender/useDebugRender.constants.d.ts +18 -0
  194. package/dist/hooks/useDebugRender/useDebugRender.d.ts +35 -0
  195. package/dist/hooks/useDebugRender/useDebugRender.types.d.ts +60 -0
  196. package/dist/hooks/useDebugRender/useDebugRender.utils.d.ts +34 -0
  197. package/dist/hooks/useLogs/index.d.ts +3 -0
  198. package/dist/hooks/useLogs/logStore.d.ts +18 -0
  199. package/dist/hooks/useLogs/useLogs.constants.d.ts +2 -0
  200. package/dist/hooks/useLogs/useLogs.d.ts +15 -0
  201. package/dist/hooks/useLogs/useLogs.types.d.ts +47 -0
  202. package/dist/hooks/useLogs/useLogs.utils.d.ts +13 -0
  203. package/dist/hooks/useModal/index.d.ts +3 -0
  204. package/dist/hooks/useModal/useModal.context.d.ts +20 -0
  205. package/dist/hooks/useModal/useModal.d.ts +22 -0
  206. package/dist/hooks/useModal/useModal.types.d.ts +49 -0
  207. package/dist/hooks/useMouse/index.d.ts +2 -0
  208. package/dist/hooks/useMouse/useMouse.types.d.ts +43 -0
  209. package/dist/hooks/useMouse/useMouse.utils.d.ts +30 -0
  210. package/dist/hooks/useMouseClick/index.d.ts +2 -0
  211. package/dist/hooks/useMouseClick/useMouseClick.d.ts +23 -0
  212. package/dist/hooks/useMouseClick/useMouseClick.types.d.ts +28 -0
  213. package/dist/hooks/useMouseHover/index.d.ts +2 -0
  214. package/dist/hooks/useMouseHover/useMouseHover.d.ts +25 -0
  215. package/dist/hooks/useMouseHover/useMouseHover.types.d.ts +38 -0
  216. package/dist/hooks/useMouseWheelScroll/index.d.ts +2 -0
  217. package/dist/hooks/useMouseWheelScroll/useMouseWheelScroll.d.ts +28 -0
  218. package/dist/hooks/useMouseWheelScroll/useMouseWheelScroll.types.d.ts +32 -0
  219. package/dist/hooks/useRegion/index.d.ts +3 -0
  220. package/dist/hooks/useRegion/useRegion.d.ts +21 -0
  221. package/dist/hooks/useRegion/useRegion.types.d.ts +41 -0
  222. package/dist/hooks/useRegion/useRegion.utils.d.ts +51 -0
  223. package/dist/hooks/useStrategies/useStrategies.d.ts +10 -0
  224. package/dist/hooks/useToolSpinner/index.d.ts +1 -0
  225. package/dist/hooks/useToolSpinner/useToolSpinner.d.ts +28 -0
  226. package/dist/hooks/useUserConfig/index.d.ts +4 -0
  227. package/dist/hooks/useUserConfig/useUserConfig.constants.d.ts +17 -0
  228. package/dist/hooks/useUserConfig/useUserConfig.context.d.ts +9 -0
  229. package/dist/hooks/useUserConfig/useUserConfig.d.ts +9 -0
  230. package/dist/hooks/useUserConfig/useUserConfig.types.d.ts +30 -0
  231. package/dist/hooks/useUserConfig/useUserConfig.utils.d.ts +19 -0
  232. package/dist/hooks/useWebSocket/index.d.ts +2 -0
  233. package/dist/hooks/useWebSocket/useWebSocket.d.ts +17 -0
  234. package/dist/hooks/useWebSocket/useWebSocket.types.d.ts +27 -0
  235. package/dist/index.d.ts +2 -0
  236. package/dist/index.js +10592 -0
  237. package/dist/main.js +10655 -0
  238. package/dist/pages/ChatPage/ChatPage.constants.d.ts +2 -0
  239. package/dist/pages/ChatPage/ChatPage.d.ts +25 -0
  240. package/dist/pages/ChatPage/ChatPage.theme.d.ts +56 -0
  241. package/dist/pages/ChatPage/index.d.ts +4 -0
  242. package/dist/pages/IntroPage/IntroPage.d.ts +14 -0
  243. package/dist/pages/IntroPage/IntroPage.theme.d.ts +13 -0
  244. package/dist/pages/IntroPage/index.d.ts +4 -0
  245. package/dist/pages/LogsPage/LogsPage.d.ts +14 -0
  246. package/dist/pages/LogsPage/LogsPage.theme.d.ts +49 -0
  247. package/dist/pages/LogsPage/LogsPage.utils.d.ts +5 -0
  248. package/dist/pages/LogsPage/index.d.ts +4 -0
  249. package/dist/pages/SpawnedStrategyPage/SpawnedStrategyPage.d.ts +12 -0
  250. package/dist/pages/SpawnedStrategyPage/index.d.ts +2 -0
  251. package/dist/run-tui.d.ts +12 -0
  252. package/dist/run-tui.types.d.ts +12 -0
  253. package/dist/utils/debug.d.ts +12 -0
  254. package/dist/utils/mouseEscape.d.ts +29 -0
  255. package/dist/utils/yogaLayout.d.ts +32 -0
  256. package/package.json +66 -0
@@ -0,0 +1,170 @@
1
+ /** Per-role text style (color + bold). */
2
+ export interface RoleStyle {
3
+ readonly bold: boolean;
4
+ readonly color: string;
5
+ }
6
+ /** Style for an inline label badge (e.g. "you", "system", agent name). */
7
+ export interface BadgeStyle {
8
+ readonly bold: boolean;
9
+ readonly color: string;
10
+ }
11
+ /** Spread-ready style objects for the MessageList component. */
12
+ export interface MessageListTheme {
13
+ /** Outer container. */
14
+ readonly container: {
15
+ readonly flexDirection: "column";
16
+ readonly flexGrow: number;
17
+ readonly paddingX: number;
18
+ };
19
+ /** Empty state wrapper. */
20
+ readonly emptyState: {
21
+ readonly paddingX: number;
22
+ readonly text: {
23
+ readonly dimColor: boolean;
24
+ };
25
+ };
26
+ /** User-authored message block. */
27
+ readonly userMessage: {
28
+ /** Outer column container. */
29
+ readonly container: {
30
+ readonly flexDirection: "column";
31
+ readonly flex: 1;
32
+ readonly marginBottom: number;
33
+ };
34
+ /** Header row with the "you" label. */
35
+ readonly header: {
36
+ readonly flexDirection: "row";
37
+ };
38
+ /** "you" label style. */
39
+ readonly label: BadgeStyle;
40
+ /** Body row containing the prompt text. */
41
+ readonly body: {
42
+ readonly paddingLeft: number;
43
+ };
44
+ /** Body text style. */
45
+ readonly bodyText: {
46
+ readonly wrap: "wrap";
47
+ };
48
+ /** Color used for the wrapping `BorderedPanel` border + header label. */
49
+ readonly borderColor: string;
50
+ };
51
+ /** Agent-authored message block. */
52
+ readonly agentMessage: {
53
+ readonly container: {
54
+ readonly flexDirection: "column";
55
+ readonly flex: 1;
56
+ readonly marginBottom: number;
57
+ };
58
+ readonly header: {
59
+ readonly flexDirection: "row";
60
+ };
61
+ readonly label: BadgeStyle;
62
+ readonly headerDetail: {
63
+ readonly model: {
64
+ readonly color: string;
65
+ readonly dimColor: boolean;
66
+ };
67
+ readonly context: {
68
+ readonly color: string;
69
+ readonly bold: boolean;
70
+ };
71
+ /** Threshold colors for the context-usage fill bar, by fraction used. */
72
+ readonly contextBar: {
73
+ readonly low: string;
74
+ readonly medium: string;
75
+ readonly high: string;
76
+ };
77
+ readonly time: {
78
+ readonly color: string;
79
+ readonly dimColor: boolean;
80
+ };
81
+ readonly separator: {
82
+ readonly color: string;
83
+ readonly dimColor: boolean;
84
+ };
85
+ };
86
+ readonly body: {
87
+ readonly flexDirection: "column";
88
+ readonly paddingLeft: number;
89
+ };
90
+ /** Plain text segment style. */
91
+ readonly textSegment: {
92
+ readonly wrap: "wrap";
93
+ };
94
+ /** Streaming cursor indicator. */
95
+ readonly streamingCursor: {
96
+ readonly dimColor: boolean;
97
+ };
98
+ /** Tool-call row container. */
99
+ readonly toolCall: {
100
+ readonly container: {
101
+ readonly flexDirection: "column";
102
+ readonly marginTop: number;
103
+ };
104
+ readonly header: BadgeStyle;
105
+ readonly label: {
106
+ readonly dimColor: boolean;
107
+ };
108
+ readonly args: {
109
+ readonly dimColor: boolean;
110
+ };
111
+ };
112
+ /** Tool-result row container. */
113
+ readonly toolResult: {
114
+ readonly container: {
115
+ readonly flexDirection: "column";
116
+ readonly marginTop: number;
117
+ };
118
+ readonly header: BadgeStyle;
119
+ readonly output: {
120
+ readonly dimColor: boolean;
121
+ readonly wrap: "wrap";
122
+ };
123
+ };
124
+ /** Reasoning / "thinking" block. */
125
+ readonly thinking: {
126
+ readonly container: {
127
+ readonly flexDirection: "column";
128
+ readonly marginTop: number;
129
+ };
130
+ readonly header: BadgeStyle;
131
+ readonly text: {
132
+ readonly italic: true;
133
+ readonly dimColor: boolean;
134
+ readonly wrap: "wrap";
135
+ };
136
+ };
137
+ /** Color used for the wrapping `BorderedPanel` border + header label. */
138
+ readonly borderColor: string;
139
+ };
140
+ /** System-authored message block. */
141
+ readonly systemMessage: {
142
+ readonly container: {
143
+ readonly flexDirection: "row";
144
+ readonly flex: 1;
145
+ readonly marginBottom: number;
146
+ };
147
+ readonly bullet: {
148
+ readonly color: string;
149
+ readonly dimColor: boolean;
150
+ };
151
+ readonly text: {
152
+ readonly color: string;
153
+ readonly dimColor: boolean;
154
+ readonly wrap: "wrap";
155
+ };
156
+ /** Color used for the wrapping `BorderedPanel` border + header label. */
157
+ readonly borderColor: string;
158
+ };
159
+ /** Role-based colors for sender name (kept for backwards compatibility). */
160
+ readonly roles: {
161
+ readonly user: RoleStyle;
162
+ readonly agent: RoleStyle;
163
+ readonly system: RoleStyle;
164
+ };
165
+ }
166
+ /**
167
+ * Returns themed style objects for the MessageList component.
168
+ * Consumes global tokens via `useTheme()`.
169
+ */
170
+ export declare function useMessageListTheme(): MessageListTheme;
@@ -0,0 +1,26 @@
1
+ import type { InkBoxProps } from "ink";
2
+ import type { ChatMessage } from "../../hooks/useChat/useChat.types";
3
+ export interface MessageListProps {
4
+ /** Messages to render in chronological order. */
5
+ readonly messages: readonly ChatMessage[];
6
+ /** Opens a spawned strategy transcript in its dedicated page. */
7
+ readonly onOpenSubStrategy?: (toolCallId: string) => void;
8
+ }
9
+ export interface MessageListRenderProps {
10
+ /** Messages to render in chronological order. */
11
+ readonly messages: readonly GroupedChatMessage[];
12
+ /** Debug render ref from useDebugRender. */
13
+ readonly debugRef: React.RefObject<HTMLElement>;
14
+ /** Props for the outer container Box. */
15
+ readonly containerProps: InkBoxProps;
16
+ /** Props for the empty state container Box. */
17
+ readonly emptyStateProps: InkBoxProps;
18
+ /** Props for the empty state Text. */
19
+ readonly emptyStateTextProps: Omit<InkBoxProps, "children">;
20
+ /** Opens a spawned strategy transcript in its dedicated page. */
21
+ readonly onOpenSubStrategy?: (toolCallId: string) => void;
22
+ }
23
+ export interface GroupedChatMessage extends ChatMessage {
24
+ /** Messages spawned by a `launch_strategy` tool call inside this message. */
25
+ readonly subMessages: readonly GroupedChatMessage[];
26
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Single shared modal id for the OutputModal. The modal is a singleton —
3
+ * only one expanded tool-result / thinking body is shown at a time —
4
+ * so a stable id is enough.
5
+ */
6
+ export declare const OUTPUT_MODAL_ID = "output-modal";
7
+ /**
8
+ * Maximum number of lines retained in memory for grep+highlight. Beyond
9
+ * this, the modal still shows scrollable content but search compiles
10
+ * are skipped to keep frame time bounded. Picked empirically to handle
11
+ * a multi-MB tool dump on a slow terminal without locking the UI.
12
+ */
13
+ export declare const OUTPUT_MODAL_GREP_LINE_CAP = 5000;
14
+ /**
15
+ * Glyph repeated for the modal's "no matches" empty-state row. Single
16
+ * em-dash so it visually distinguishes from a literal grep hit.
17
+ */
18
+ export declare const OUTPUT_MODAL_EMPTY_LINE = "\u2014";
19
+ /**
20
+ * Placeholder shown inside the search input before the user types.
21
+ */
22
+ export declare const OUTPUT_MODAL_SEARCH_PLACEHOLDER = "regex\u2026";
@@ -0,0 +1,37 @@
1
+ import type React from "react";
2
+ import type { OutputModalTheme } from "./OutputModal.theme";
3
+ import type { OutputModalLine, OutputModalQuery } from "./OutputModal.types";
4
+ /**
5
+ * Modal expansion of a tool-result or thinking segment with regex
6
+ * filter + highlight.
7
+ *
8
+ * Behaviour:
9
+ * - The body is split into lines and rendered verbatim (plain text).
10
+ * Both `tool-result` and `thinking` use the same renderer here —
11
+ * markdown rendering happens in the main MessageList view, not in
12
+ * the modal, so grep semantics line up with what the user sees.
13
+ * - When the search query is empty, every line is shown without
14
+ * highlighting (fast path).
15
+ * - When the query is a valid regex, only matching lines are kept and
16
+ * the matching slices are inverse-highlighted in place.
17
+ * - Esc dismisses (handled by the underlying `Modal`); a click outside
18
+ * the modal content box also dismisses.
19
+ *
20
+ * The modal is a singleton — only one `<OutputModal />` should be
21
+ * mounted at a time, identified by {@link OUTPUT_MODAL_ID}. Open it
22
+ * from anywhere via `useModal(OUTPUT_MODAL_ID).open(payload)`.
23
+ */
24
+ export declare function OutputModal(): React.ReactElement | null;
25
+ /**
26
+ * Pure render half of {@link OutputModal} — receives a fully-prepared
27
+ * line list and a compiled query, so unit tests can exercise the
28
+ * renderer without going through `useModal`.
29
+ */
30
+ export interface OutputModalRenderProps {
31
+ readonly theme: OutputModalTheme;
32
+ readonly query: OutputModalQuery;
33
+ readonly lines: readonly OutputModalLine[];
34
+ readonly onQueryChange: (next: string) => void;
35
+ readonly scrollToRow?: number;
36
+ }
37
+ export declare function OutputModalRender({ theme, query, lines, onQueryChange, scrollToRow, }: OutputModalRenderProps): React.ReactElement;
@@ -0,0 +1,68 @@
1
+ import { type ThemeOf } from "../../../Theme";
2
+ /**
3
+ * Memoized themed style objects for the {@link OutputModal} component.
4
+ *
5
+ * Sized to fit the existing `Modal` chrome — the OutputModal renders
6
+ * inside a `Modal`, so this theme covers the body shell + search bar
7
+ * + line list, not the surrounding overlay.
8
+ */
9
+ export declare const useOutputModalTheme: () => {
10
+ body: {
11
+ flexDirection: "column";
12
+ width: string;
13
+ minHeight: number;
14
+ flexGrow: number;
15
+ overflow: "hidden";
16
+ };
17
+ searchRow: {
18
+ flexDirection: "row";
19
+ flexShrink: number;
20
+ };
21
+ statusRow: {
22
+ flexDirection: "row";
23
+ flexShrink: number;
24
+ marginBottom: number;
25
+ };
26
+ /** Style of the trailing "N matches" / "no matches" status text. */
27
+ searchStatus: {
28
+ color: string;
29
+ dimColor: boolean;
30
+ };
31
+ /** Style applied when the user-typed regex fails to compile. */
32
+ searchStatusError: {
33
+ color: string;
34
+ };
35
+ /** Container around the rendered (possibly filtered) line list. */
36
+ lineList: {
37
+ flexDirection: "column";
38
+ flexGrow: number;
39
+ overflow: "hidden";
40
+ };
41
+ /** Single line row container. */
42
+ lineRow: {
43
+ flexDirection: "row";
44
+ };
45
+ /** Faint left-gutter line number. */
46
+ lineNumber: {
47
+ color: string;
48
+ dimColor: boolean;
49
+ };
50
+ /** Default text style for non-matching segments. */
51
+ lineText: {
52
+ color: string;
53
+ };
54
+ /** Inverted highlight applied to matching segments. */
55
+ lineMatch: {
56
+ color: string;
57
+ backgroundColor: string;
58
+ bold: true;
59
+ };
60
+ /** Style of the empty-state row when the query matches nothing. */
61
+ emptyState: {
62
+ color: string;
63
+ dimColor: boolean;
64
+ italic: true;
65
+ };
66
+ };
67
+ /** Resolved style object shape returned by {@link useOutputModalTheme}. */
68
+ export type OutputModalTheme = ThemeOf<typeof useOutputModalTheme>;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Discriminator for what kind of agent segment is being expanded.
3
+ * Used purely for the modal title prefix and for analytics-friendly
4
+ * snapshots; the body itself is always plain text.
5
+ */
6
+ export type OutputModalKind = "tool-result" | "thinking";
7
+ /**
8
+ * Payload carried via {@link useModal} when opening the OutputModal.
9
+ *
10
+ * `body` is taken verbatim from the source segment (no markdown
11
+ * pre-processing) so grep semantics line up with what the user sees.
12
+ */
13
+ export interface OutputModalPayload {
14
+ /** Origin segment kind — drives the title prefix only. */
15
+ readonly kind: OutputModalKind;
16
+ /** Human-readable header text (e.g. tool name or "thinking"). */
17
+ readonly title: string;
18
+ /** Raw multi-line body to display. */
19
+ readonly body: string;
20
+ }
21
+ /**
22
+ * A single rendered line inside the modal body, after filtering by
23
+ * the current search query.
24
+ *
25
+ * `segments` is a sequence of `(text, isMatch)` runs that the renderer
26
+ * walks to draw highlight inversions. When the query is empty, every
27
+ * line collapses to a single `{ text, isMatch: false }` segment.
28
+ */
29
+ export interface OutputModalLine {
30
+ /** 1-based source line number, preserved from the original body. */
31
+ readonly lineNumber: number;
32
+ /** Run-length segmentation of the line for highlight rendering. */
33
+ readonly segments: readonly OutputModalLineSegment[];
34
+ }
35
+ /** One run inside an `OutputModalLine`. */
36
+ export interface OutputModalLineSegment {
37
+ /** Slice of the source line. */
38
+ readonly text: string;
39
+ /** Whether this slice matched the active grep regex. */
40
+ readonly isMatch: boolean;
41
+ }
42
+ /**
43
+ * Result of compiling a user-supplied search query.
44
+ *
45
+ * `regex === null` means "no active filter" — the renderer should show
46
+ * every line and skip highlighting. We surface the original query so
47
+ * the search bar can echo it back unmodified.
48
+ */
49
+ export interface OutputModalQuery {
50
+ /** Original query string as typed by the user. */
51
+ readonly raw: string;
52
+ /** Compiled regex, or `null` when the query is empty / invalid. */
53
+ readonly regex: RegExp | null;
54
+ /** True when the user typed a non-empty query that failed to compile. */
55
+ readonly invalid: boolean;
56
+ }
@@ -0,0 +1,3 @@
1
+ import type { OutputModalLine, OutputModalQuery } from "./OutputModal.types";
2
+ export declare function compileQuery(raw: string): OutputModalQuery;
3
+ export declare function filterAndHighlight(body: string, regex: RegExp | null): readonly OutputModalLine[];
@@ -0,0 +1,6 @@
1
+ export type { OutputModalRenderProps } from "./OutputModal";
2
+ export { OutputModal, OutputModalRender } from "./OutputModal";
3
+ export { OUTPUT_MODAL_EMPTY_LINE, OUTPUT_MODAL_GREP_LINE_CAP, OUTPUT_MODAL_ID, OUTPUT_MODAL_SEARCH_PLACEHOLDER, } from "./OutputModal.constants";
4
+ export type { OutputModalTheme } from "./OutputModal.theme";
5
+ export { useOutputModalTheme } from "./OutputModal.theme";
6
+ export type { OutputModalKind, OutputModalLine, OutputModalLineSegment, OutputModalPayload, OutputModalQuery, } from "./OutputModal.types";
@@ -0,0 +1,47 @@
1
+ import type React from "react";
2
+ import type { ToolCallViewStatus } from "../ToolCallView";
3
+ import type { SpawnedStrategyViewTheme } from "./SpawnedStrategyView.theme";
4
+ export interface SpawnedStrategyViewProps {
5
+ /** Raw JSON-encoded arguments from the `launch_strategy` tool call. */
6
+ readonly args: string;
7
+ /** Current execution status of the spawned strategy. */
8
+ readonly status: ToolCallViewStatus;
9
+ /** Raw JSON-encoded result from the completed `launch_strategy` tool call. */
10
+ readonly output?: string;
11
+ /** Error message when the spawned strategy failed. */
12
+ readonly error?: string;
13
+ /** Opens the spawned strategy transcript in its dedicated page. */
14
+ readonly onOpen?: () => void;
15
+ /** Nested messages emitted while the spawned strategy was running. */
16
+ readonly children: React.ReactNode;
17
+ }
18
+ export declare function SpawnedStrategyView({ args, status, output, error, onOpen, children, }: SpawnedStrategyViewProps): React.ReactElement;
19
+ export interface SpawnedStrategyViewRenderProps {
20
+ /** Resolved theme styles. */
21
+ readonly theme: SpawnedStrategyViewTheme;
22
+ /** Status glyph shown before the label. */
23
+ readonly leadingGlyph: string;
24
+ /** Strategy name parsed from the tool-call arguments. */
25
+ readonly strategyName: string;
26
+ /** Initial input preview parsed from the tool-call arguments. */
27
+ readonly inputPreview: string;
28
+ /** Optional provider/model override parsed from the tool-call arguments. */
29
+ readonly modelOverride: string;
30
+ /** Details parsed from the completed tool result. */
31
+ readonly resultDetails: ParsedLaunchStrategyResult;
32
+ /** Current execution status of the spawned strategy. */
33
+ readonly status: ToolCallViewStatus;
34
+ /** Error message when the spawned strategy failed. */
35
+ readonly error?: string;
36
+ /** Opens the spawned strategy transcript in its dedicated page. */
37
+ readonly onOpen?: () => void;
38
+ /** Nested message rows emitted by the spawned strategy. */
39
+ readonly children: React.ReactNode;
40
+ }
41
+ export declare function SpawnedStrategyViewRender({ theme, leadingGlyph, strategyName, inputPreview, modelOverride, resultDetails, status, error, onOpen, children, }: SpawnedStrategyViewRenderProps): React.ReactElement;
42
+ interface ParsedLaunchStrategyResult {
43
+ readonly path: string;
44
+ readonly finishReason: string;
45
+ readonly resultPreview: string;
46
+ }
47
+ export {};
@@ -0,0 +1,58 @@
1
+ import { type ThemeOf } from "../../../Theme";
2
+ export declare const useSpawnedStrategyViewTheme: () => {
3
+ container: {
4
+ flexDirection: "column";
5
+ marginTop: number;
6
+ marginBottom: number;
7
+ };
8
+ body: {
9
+ flexDirection: "column";
10
+ paddingLeft: number;
11
+ };
12
+ metaRow: {
13
+ flexDirection: "row";
14
+ marginBottom: number;
15
+ };
16
+ detailRow: {
17
+ flexDirection: "row";
18
+ paddingLeft: number;
19
+ };
20
+ nestedMessages: {
21
+ flexDirection: "column";
22
+ };
23
+ runningGlyph: {
24
+ color: string;
25
+ };
26
+ completedGlyph: {
27
+ color: string;
28
+ };
29
+ errorGlyph: {
30
+ color: string;
31
+ };
32
+ title: {
33
+ bold: boolean;
34
+ color: string;
35
+ };
36
+ detailLabel: {
37
+ bold: boolean;
38
+ };
39
+ openTarget: {
40
+ flexDirection: "row";
41
+ };
42
+ openHint: {
43
+ color: string;
44
+ underline: true;
45
+ };
46
+ muted: {
47
+ dimColor: boolean;
48
+ };
49
+ error: {
50
+ color: string;
51
+ };
52
+ borderColor: {
53
+ running: string;
54
+ completed: string;
55
+ error: string;
56
+ };
57
+ };
58
+ export type SpawnedStrategyViewTheme = ThemeOf<typeof useSpawnedStrategyViewTheme>;
@@ -0,0 +1,4 @@
1
+ export type { SpawnedStrategyViewProps, SpawnedStrategyViewRenderProps, } from "./SpawnedStrategyView";
2
+ export { SpawnedStrategyView, SpawnedStrategyViewRender, } from "./SpawnedStrategyView";
3
+ export type { SpawnedStrategyViewTheme } from "./SpawnedStrategyView.theme";
4
+ export { useSpawnedStrategyViewTheme } from "./SpawnedStrategyView.theme";
@@ -0,0 +1,21 @@
1
+ import type React from "react";
2
+ import { useMessageListTheme } from "../MessageList.theme";
3
+ export interface SystemMessageProps {
4
+ /** Body of the system message. */
5
+ readonly text: string;
6
+ }
7
+ /**
8
+ * Renders a single system-authored message inside a bordered panel.
9
+ *
10
+ * Surfaces strategy lifecycle events, step started/completed notifications,
11
+ * and surfaced errors. The panel header is fixed to "system" so the role
12
+ * is unambiguous in the scrollback.
13
+ */
14
+ export declare function SystemMessage({ text, }: SystemMessageProps): React.ReactElement;
15
+ export interface SystemMessageRenderProps {
16
+ /** Resolved MessageList theme styles. */
17
+ readonly theme: ReturnType<typeof useMessageListTheme>;
18
+ /** Body of the system message. */
19
+ readonly text: string;
20
+ }
21
+ export declare function SystemMessageRender({ theme, text, }: SystemMessageRenderProps): React.ReactElement;
@@ -0,0 +1,2 @@
1
+ export type { SystemMessageProps, SystemMessageRenderProps, } from "./SystemMessage";
2
+ export { SystemMessage, SystemMessageRender } from "./SystemMessage";
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Glyph drawn at the head of a completed tool-call row.
3
+ *
4
+ * Heavy check mark — distinct from a regular ASCII tick to read as a
5
+ * status badge rather than punctuation. Single cell wide.
6
+ */
7
+ export declare const TOOL_CALL_GLYPH_COMPLETED = "\u2713";
8
+ /**
9
+ * Glyph drawn at the head of an errored tool-call row.
10
+ *
11
+ * Heavy ballot X — pairs visually with the completed check mark and
12
+ * stays single-cell wide for column alignment.
13
+ */
14
+ export declare const TOOL_CALL_GLYPH_ERROR = "\u2717";
15
+ /**
16
+ * Maximum number of characters of args preview rendered inline before
17
+ * truncation with an ellipsis. Newlines are collapsed to spaces *before*
18
+ * truncation so multi-line JSON blobs still render as a single visual
19
+ * row.
20
+ *
21
+ * NOTE: A future iteration will replace this with viewport-width-fitting
22
+ * once `viewportWidth` is plumbed into the segment render path. Until
23
+ * then, this cap matches the renderer's actual single-line capacity on
24
+ * an 80-column panel and keeps the row estimator's text-only count in
25
+ * sync with the rendered output.
26
+ */
27
+ export declare const TOOL_CALL_ARGS_PREVIEW_LENGTH = 160;
28
+ /**
29
+ * Maximum length of an inline error message in the result summary
30
+ * before truncation. Errors are usually short (`ENOENT…`,
31
+ * `TypeError: …`) but we cap defensively so a stack-trace-shaped error
32
+ * can't blow up a row.
33
+ */
34
+ export declare const TOOL_CALL_ERROR_PREVIEW_LENGTH = 120;
35
+ /**
36
+ * Single-character ellipsis appended to clipped previews.
37
+ *
38
+ * Using the typographic `\u2026` rather than three dots keeps the
39
+ * preview a single visual cell shorter than `...` would, and matches
40
+ * the existing `truncatePreview` helper in `AgentMessage.tsx`.
41
+ */
42
+ export declare const TOOL_CALL_ELLIPSIS = "\u2026";
@@ -0,0 +1,71 @@
1
+ import type React from "react";
2
+ import type { ToolCallViewTheme } from "./ToolCallView.theme";
3
+ import type { ToolCallViewStatus } from "./ToolCallView.types";
4
+ export interface ToolCallViewProps {
5
+ /** Bare name of the tool that was invoked (e.g. `"read_file"`). */
6
+ readonly toolName: string;
7
+ /**
8
+ * Stringified tool-call arguments. Multi-line / long blobs are
9
+ * collapsed and clipped to a single visual row by the renderer; pass
10
+ * the raw value here.
11
+ */
12
+ readonly args: string;
13
+ /** Current visual state. */
14
+ readonly status: ToolCallViewStatus;
15
+ /**
16
+ * Stringified tool-result output. Used only for `status === "completed"`
17
+ * to derive the trailing `\u2192 N lines` summary.
18
+ */
19
+ readonly output?: string;
20
+ /**
21
+ * Error message, populated when the tool errored. Drives the
22
+ * trailing `\u2192 <message>` summary for `status === "error"`.
23
+ */
24
+ readonly error?: string;
25
+ }
26
+ /**
27
+ * One-line collapsed view of a tool call paired with its result.
28
+ *
29
+ * Renders as a single logical row inside an agent message:
30
+ *
31
+ * ```
32
+ * <glyph> <toolName> <argsPreview> <resultSummary>
33
+ * ```
34
+ *
35
+ * - `<glyph>` animates between {@link TOOL_SPINNER_FRAMES} while the
36
+ * call is in flight (driven by the shared
37
+ * {@link useToolSpinner} interval) and resolves to a check / cross
38
+ * on completion.
39
+ * - `<argsPreview>` is collapsed to one visual line and truncated; see
40
+ * {@link formatArgsPreview}.
41
+ * - `<resultSummary>` is omitted while running and reduced to a line
42
+ * count or a clipped error message otherwise; see
43
+ * {@link formatResultSummary}.
44
+ *
45
+ * The component is intentionally render-pure beyond the spinner tick:
46
+ * it does not subscribe to chat state and reads only the tokens it
47
+ * needs from the theme.
48
+ */
49
+ export declare function ToolCallView({ toolName, args, status, output, error, }: ToolCallViewProps): React.ReactElement;
50
+ export interface ToolCallViewRenderProps {
51
+ /** Resolved theme styles. */
52
+ readonly theme: ToolCallViewTheme;
53
+ /** Glyph rendered at the head of the row. */
54
+ readonly leadingGlyph: string;
55
+ /** Bare name of the tool. */
56
+ readonly toolName: string;
57
+ /** Pre-truncated, single-line args preview (may be empty). */
58
+ readonly argsPreview: string;
59
+ /** Pre-formatted result summary. Empty string when there is no result yet. */
60
+ readonly resultSummary: string;
61
+ /** Visual status — drives glyph color and error-summary styling. */
62
+ readonly status: ToolCallViewStatus;
63
+ }
64
+ /**
65
+ * Pure render half of {@link ToolCallView}.
66
+ *
67
+ * Split out so unit tests can render the component with a hand-crafted
68
+ * theme and pre-formatted strings without touching the spinner hook or
69
+ * the theme provider — same pattern as {@link CodeViewRender}.
70
+ */
71
+ export declare function ToolCallViewRender({ theme, leadingGlyph, toolName, argsPreview, resultSummary, status, }: ToolCallViewRenderProps): React.ReactElement;