@mks2508/mks-ui 0.3.1 → 0.4.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 (325) hide show
  1. package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
  2. package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
  3. package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
  4. package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
  5. package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
  6. package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
  7. package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
  8. package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
  9. package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
  10. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
  11. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
  12. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
  13. package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
  14. package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
  15. package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
  16. package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
  17. package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
  18. package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
  19. package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
  20. package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
  21. package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
  22. package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
  23. package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
  24. package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
  25. package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
  26. package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
  27. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
  28. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
  29. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
  30. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
  31. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
  32. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
  33. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
  34. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
  35. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
  36. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
  37. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
  38. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
  39. package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
  40. package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
  41. package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
  42. package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
  43. package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
  44. package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
  45. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
  46. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
  47. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
  48. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
  49. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
  50. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
  51. package/dist/react-ui/blocks/Terminal/index.d.ts +39 -0
  52. package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
  53. package/dist/react-ui/blocks/Terminal/index.js +38 -0
  54. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
  55. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
  56. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
  57. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
  58. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
  59. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
  60. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
  61. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
  62. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
  63. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
  64. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
  65. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
  66. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
  67. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
  68. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
  69. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
  70. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
  71. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
  72. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
  73. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
  74. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
  75. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
  76. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
  77. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
  78. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
  79. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
  80. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
  81. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +54 -0
  82. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
  83. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +193 -0
  84. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +57 -0
  85. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
  86. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
  87. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
  88. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
  89. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
  90. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
  91. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
  92. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
  93. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
  94. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
  95. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
  96. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
  97. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
  98. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
  99. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
  100. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
  101. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
  102. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
  103. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
  104. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
  105. package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
  106. package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
  107. package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-Bovc57nm.css +60 -0
  108. package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
  109. package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-QyxHO7cN.css +60 -0
  110. package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
  111. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
  112. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
  113. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
  114. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
  115. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
  116. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
  117. package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
  118. package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
  119. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
  120. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
  121. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
  122. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
  123. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
  124. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
  125. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
  126. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
  127. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
  128. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
  129. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
  130. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
  131. package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
  132. package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
  133. package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
  134. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
  135. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
  136. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
  137. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
  138. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
  139. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
  140. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
  141. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
  142. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
  143. package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
  144. package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
  145. package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
  146. package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
  147. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
  148. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
  149. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
  150. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
  151. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
  152. package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
  153. package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
  154. package/dist/react-ui/blocks/index.d.ts +11 -0
  155. package/dist/react-ui/blocks/index.d.ts.map +1 -0
  156. package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
  157. package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
  158. package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
  159. package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
  160. package/dist/react-ui/icons/lucide-animated/box.js +1 -1
  161. package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
  162. package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
  163. package/dist/react-ui/icons/lucide-animated/download.js +1 -1
  164. package/dist/react-ui/icons/lucide-animated/home.js +1 -1
  165. package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
  166. package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
  167. package/dist/react-ui/icons/lucide-animated/search.js +1 -1
  168. package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
  169. package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
  170. package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
  171. package/dist/react-ui/icons/lucide-animated/x.js +1 -1
  172. package/dist/react-ui/index.js +4 -1
  173. package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
  174. package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
  175. package/dist/react-ui/lib/icon-wrapper.js +55 -0
  176. package/dist/react-ui/lib/index.d.ts +1 -0
  177. package/dist/react-ui/lib/index.d.ts.map +1 -1
  178. package/dist/react-ui/lib/index.js +1 -0
  179. package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
  180. package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
  181. package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
  182. package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
  183. package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
  184. package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
  185. package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
  186. package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
  187. package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
  188. package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
  189. package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
  190. package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
  191. package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
  192. package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
  193. package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
  194. package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
  195. package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
  196. package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
  197. package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +2 -2
  198. package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
  199. package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
  200. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
  201. package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
  202. package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
  203. package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
  204. package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
  205. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
  206. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
  207. package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
  208. package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
  209. package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
  210. package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
  211. package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
  212. package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
  213. package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
  214. package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
  215. package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
  216. package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
  217. package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
  218. package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
  219. package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
  220. package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
  221. package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
  222. package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
  223. package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
  224. package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
  225. package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
  226. package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
  227. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
  228. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
  229. package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
  230. package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +9 -6
  231. package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
  232. package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
  233. package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
  234. package/dist/react-ui/ui/Tabs/index.js +99 -27
  235. package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
  236. package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
  237. package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
  238. package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
  239. package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
  240. package/dist/react-ui/ui/index.d.ts +1 -0
  241. package/dist/react-ui/ui/index.d.ts.map +1 -1
  242. package/dist/react-ui/ui/index.js +2 -0
  243. package/package.json +54 -6
  244. package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
  245. package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
  246. package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
  247. package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
  248. package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
  249. package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
  250. package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
  251. package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
  252. package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
  253. package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
  254. package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
  255. package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
  256. package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
  257. package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
  258. package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
  259. package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
  260. package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
  261. package/src/react-ui/blocks/Terminal/index.ts +103 -0
  262. package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
  263. package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
  264. package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
  265. package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
  266. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
  267. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
  268. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
  269. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
  270. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
  271. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
  272. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +237 -0
  273. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +76 -0
  274. package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
  275. package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
  276. package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
  277. package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
  278. package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
  279. package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
  280. package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
  281. package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
  282. package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
  283. package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
  284. package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
  285. package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
  286. package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
  287. package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
  288. package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
  289. package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
  290. package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
  291. package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
  292. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
  293. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
  294. package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
  295. package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
  296. package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
  297. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
  298. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
  299. package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
  300. package/src/react-ui/blocks/index.ts +11 -0
  301. package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
  302. package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
  303. package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
  304. package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
  305. package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
  306. package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
  307. package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
  308. package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
  309. package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
  310. package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
  311. package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
  312. package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
  313. package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
  314. package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
  315. package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
  316. package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
  317. package/src/react-ui/lib/icon-wrapper.tsx +70 -0
  318. package/src/react-ui/lib/index.ts +1 -0
  319. package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
  320. package/src/react-ui/ui/Tabs/Tabs.css +39 -0
  321. package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
  322. package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
  323. package/src/react-ui/ui/Tabs/index.tsx +135 -27
  324. package/src/react-ui/ui/index.ts +1 -0
  325. package/dist/index.css +0 -129
@@ -0,0 +1,278 @@
1
+ /**
2
+ * ResttyAdapter - ITerminalAdapter implementation for restty.
3
+ *
4
+ * Wraps restty's GPU-accelerated terminal renderer into the
5
+ * pluggable adapter interface, enabling renderer switching in the UI.
6
+ *
7
+ * Key differences from XTermAdapter:
8
+ * - Restty manages its own PTY WebSocket via custom PtyTransport
9
+ * - GPU rendering (WebGPU/WebGL2) instead of DOM/canvas
10
+ * - No write()/writeln() for injecting display text — restty renders PTY output
11
+ * - Built-in multi-pane, theme catalog, and text shaping with ligatures
12
+ *
13
+ * @module components/devenv/terminal/ResttyAdapter
14
+ */
15
+
16
+ import type {
17
+ ITerminalAdapter,
18
+ ITerminalAdapterCapabilities,
19
+ ITerminalBackendType,
20
+ ITerminalMode,
21
+ ITerminalOptions,
22
+ IPtyTransport,
23
+ IPtyTransportFactory,
24
+ } from './Terminal.types';
25
+ import type { Restty, ResttyPaneHandle } from 'restty';
26
+ import { getSynthwaveGhosttyTheme, xtermThemeToGhostty } from './Terminal.theme.restty';
27
+
28
+ /**
29
+ * ITerminalAdapter implementation backed by restty.
30
+ *
31
+ * Uses restty's Restty class with a custom DevenvPtyTransport
32
+ * that bridges the mks-devenv WebSocket JSON protocol. Status messages
33
+ * are not rendered in the terminal — they should be handled as React overlays.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const adapter = new ResttyAdapter({ fontSize: 14 });
38
+ * await adapter.initialize(containerEl, options);
39
+ * adapter.connectPty?.('ws://localhost:3100/terminal/session-1');
40
+ * ```
41
+ */
42
+ export class ResttyAdapter implements ITerminalAdapter {
43
+ /** Backend type identifier for factory pattern */
44
+ public readonly type: ITerminalBackendType = 'xterm'; // kept for backward compat with union
45
+
46
+ /** Adapter capabilities — restty manages its own connection and supports GPU */
47
+ public readonly capabilities: ITerminalAdapterCapabilities = {
48
+ managesOwnConnection: true,
49
+ gpuRendering: true,
50
+ multiPane: true,
51
+ builtinThemes: true,
52
+ };
53
+
54
+ private restty: Restty | null = null;
55
+ private transport: IPtyTransport | null = null;
56
+ private options: ITerminalOptions;
57
+ private rootElement: HTMLElement | null = null;
58
+ private createTransport?: IPtyTransportFactory;
59
+
60
+ /**
61
+ * @param options - Terminal initialization options
62
+ * @param createTransport - Optional factory to create a custom PTY transport.
63
+ * If not provided, restty manages its own PTY connection internally.
64
+ */
65
+ constructor(options: ITerminalOptions, createTransport?: IPtyTransportFactory) {
66
+ this.options = options;
67
+ this.createTransport = createTransport;
68
+ }
69
+
70
+ /**
71
+ * Initialize restty in the given container element.
72
+ * Dynamically imports restty to enable code-splitting and SSR safety.
73
+ *
74
+ * @param container - DOM element to render the terminal into
75
+ * @param options - Terminal initialization options
76
+ */
77
+ async initialize(container: HTMLElement, options: ITerminalOptions): Promise<void> {
78
+ this.options = { ...this.options, ...options };
79
+ this.rootElement = container;
80
+
81
+ const { Restty } = await import('restty');
82
+
83
+ // Create custom PtyTransport if factory provided
84
+ this.transport = this.createTransport?.() ?? null;
85
+
86
+ this.restty = new Restty({
87
+ root: container,
88
+ appOptions: {
89
+ renderer: 'auto',
90
+ fontSize: this.options.fontSize ?? 14,
91
+ autoResize: true,
92
+ ...(this.transport ? { ptyTransport: this.transport } : {}),
93
+ },
94
+ fontSources: this.buildFontSources(),
95
+ createInitialPane: true,
96
+ shortcuts: false, // Disable built-in pane splitting shortcuts
97
+ defaultContextMenu: true,
98
+ });
99
+
100
+ // Apply theme
101
+ if (this.options.theme) {
102
+ this.restty.applyTheme(xtermThemeToGhostty(this.options.theme));
103
+ } else {
104
+ this.restty.applyTheme(getSynthwaveGhosttyTheme());
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Write data to the terminal display.
110
+ * No-op for restty — it renders PTY output via its own connection.
111
+ * Status messages should be displayed as React overlays.
112
+ */
113
+ write(_data: string): void {
114
+ // No-op: restty renders from PTY stream, not injected text
115
+ }
116
+
117
+ /**
118
+ * Write data with newline to the terminal display.
119
+ * No-op for restty — see write().
120
+ */
121
+ writeln(_data: string): void {
122
+ // No-op: restty renders from PTY stream, not injected text
123
+ }
124
+
125
+ /**
126
+ * Clear the terminal screen and scrollback.
127
+ */
128
+ clear(): void {
129
+ this.restty?.clearScreen();
130
+ }
131
+
132
+ /**
133
+ * Resize the terminal to explicit dimensions.
134
+ * Uses Restty's native resize() (v0.1.21+) for precise control.
135
+ *
136
+ * @param cols - Number of columns
137
+ * @param rows - Number of rows
138
+ */
139
+ resize(cols: number, rows: number): void {
140
+ this.restty?.resize(cols, rows);
141
+ }
142
+
143
+ /**
144
+ * Dispose of restty and release all resources (GPU, WASM, WebSocket).
145
+ */
146
+ dispose(): void {
147
+ this.restty?.destroy();
148
+ this.restty = null;
149
+ this.transport = null;
150
+ this.rootElement = null;
151
+ }
152
+
153
+ /**
154
+ * Switch between interactive and readonly modes.
155
+ * No-op for restty — mode is determined by PTY connection state.
156
+ */
157
+ setMode(_mode: ITerminalMode): void {
158
+ // Restty doesn't have a separate readonly mode
159
+ }
160
+
161
+ /**
162
+ * Focus the terminal for keyboard input.
163
+ * Uses Restty's native focus() (v0.1.21+) which handles pane focus correctly.
164
+ */
165
+ focus(): void {
166
+ this.restty?.focus();
167
+ }
168
+
169
+ /**
170
+ * Remove focus from the terminal.
171
+ * Uses Restty's native blur() (v0.1.21+).
172
+ */
173
+ blur(): void {
174
+ this.restty?.blur();
175
+ }
176
+
177
+ /**
178
+ * Connect to a PTY backend via WebSocket URL.
179
+ *
180
+ * @param url - WebSocket URL for PTY connection
181
+ */
182
+ connectPty(url: string): void {
183
+ this.restty?.connectPty(url);
184
+ }
185
+
186
+ /**
187
+ * Disconnect from the PTY backend.
188
+ */
189
+ disconnectPty(): void {
190
+ this.restty?.disconnectPty();
191
+ }
192
+
193
+ /**
194
+ * Check if PTY WebSocket is connected.
195
+ */
196
+ isPtyConnected(): boolean {
197
+ return this.restty?.isPtyConnected() ?? false;
198
+ }
199
+
200
+ /**
201
+ * Update font size at runtime.
202
+ *
203
+ * @param size - Font size in CSS pixels
204
+ */
205
+ setFontSize(size: number): void {
206
+ this.restty?.setFontSize(size);
207
+ }
208
+
209
+ /**
210
+ * Send raw input data to the terminal PTY.
211
+ *
212
+ * @param data - Input data string
213
+ */
214
+ sendInput(data: string): void {
215
+ this.restty?.sendInput(data);
216
+ }
217
+
218
+ /**
219
+ * Copy the current text selection to the clipboard.
220
+ */
221
+ async copySelection(): Promise<boolean> {
222
+ return this.restty?.copySelectionToClipboard() ?? false;
223
+ }
224
+
225
+ /**
226
+ * Paste clipboard contents into the terminal.
227
+ */
228
+ async pasteClipboard(): Promise<boolean> {
229
+ return this.restty?.pasteFromClipboard() ?? false;
230
+ }
231
+
232
+ /**
233
+ * Get the underlying Restty instance for advanced usage.
234
+ * Use sparingly — prefer the adapter interface.
235
+ */
236
+ getResttyInstance(): Restty | null {
237
+ return this.restty;
238
+ }
239
+
240
+ /**
241
+ * Get the active pane handle for direct restty pane operations.
242
+ */
243
+ getActivePane(): ResttyPaneHandle | null {
244
+ return this.restty?.activePane() ?? null;
245
+ }
246
+
247
+ /**
248
+ * Build font source list following restty's priority pattern:
249
+ * local fonts first (fast), then CDN fallback.
250
+ */
251
+ private buildFontSources() {
252
+ const family = this.options.fontFamily;
253
+
254
+ if (family) {
255
+ // Parse comma-separated font family string into matchers
256
+ const matchers = family
257
+ .split(',')
258
+ .map((f) => f.trim().replace(/['"]/g, '').toLowerCase())
259
+ .filter(Boolean);
260
+
261
+ return [{ type: 'local' as const, matchers }];
262
+ }
263
+
264
+ // Default: prefer local system fonts commonly available in dev environments
265
+ return [
266
+ {
267
+ type: 'local' as const,
268
+ matchers: [
269
+ 'jetbrains mono',
270
+ 'fira code',
271
+ 'sf mono',
272
+ 'cascadia code',
273
+ 'meslo',
274
+ ],
275
+ },
276
+ ];
277
+ }
278
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Terminal adapter interface and factory.
3
+ *
4
+ * Allows switching between xterm.js, WebContainer, and Monaco backends
5
+ * through a unified interface. Backends are loaded dynamically to enable
6
+ * code-splitting and reduce initial bundle size.
7
+ *
8
+ * @module components/devenv/terminal/adapter
9
+ */
10
+
11
+ import type {
12
+ ITerminalAdapter,
13
+ ITerminalBackendType,
14
+ ITerminalRendererType,
15
+ ITerminalOptions,
16
+ } from './Terminal.types';
17
+
18
+ /**
19
+ * Create terminal adapter based on backend type.
20
+ *
21
+ * Factory function that instantiates the appropriate terminal backend
22
+ * adapter. Currently only xterm.js is implemented, with WebContainer
23
+ * and Monaco planned for future releases.
24
+ *
25
+ * @param backend - Backend type to instantiate
26
+ * @param options - Terminal options to pass to the adapter
27
+ * @returns Promise resolving to the configured adapter
28
+ *
29
+ * @throws {Error} If backend type is not supported yet
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const adapter = await createTerminalAdapter('xterm', {
34
+ * mode: 'interactive',
35
+ * wsUrl: 'ws://localhost:3100/terminal/session-123',
36
+ * });
37
+ * await adapter.initialize(container, options);
38
+ * ```
39
+ */
40
+ export async function createTerminalAdapter(
41
+ backend: ITerminalBackendType,
42
+ options: ITerminalOptions
43
+ ): Promise<ITerminalAdapter> {
44
+ switch (backend) {
45
+ case 'xterm':
46
+ const { XTermAdapter } = await import('./XTermAdapter');
47
+ return new XTermAdapter(options);
48
+
49
+ // TODO: Implement WebContainer and Monaco adapters
50
+ case 'webcontainer':
51
+ case 'monaco':
52
+ throw new Error(
53
+ `Backend '${backend}' is not yet implemented. Use 'xterm' backend for now.`
54
+ );
55
+
56
+ default:
57
+ throw new Error(`Unknown terminal backend: ${backend}`);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Create terminal adapter based on renderer type.
63
+ *
64
+ * Factory function that instantiates the appropriate terminal renderer
65
+ * adapter. Uses dynamic import for code-splitting — restty's WASM bundle
66
+ * is only loaded when the `'restty'` renderer is selected.
67
+ *
68
+ * @param renderer - Renderer type to instantiate
69
+ * @param options - Terminal options to pass to the adapter
70
+ * @returns Promise resolving to the configured adapter
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const adapter = await createTerminalAdapterForRenderer('restty', {
75
+ * mode: 'interactive',
76
+ * wsUrl: 'ws://localhost:3100/terminal/session-123',
77
+ * });
78
+ * await adapter.initialize(container, options);
79
+ * ```
80
+ */
81
+ export async function createTerminalAdapterForRenderer(
82
+ renderer: ITerminalRendererType,
83
+ options: ITerminalOptions
84
+ ): Promise<ITerminalAdapter> {
85
+ switch (renderer) {
86
+ case 'restty': {
87
+ const { ResttyAdapter } = await import('./ResttyAdapter');
88
+ return new ResttyAdapter(options);
89
+ }
90
+
91
+ case 'xterm':
92
+ default: {
93
+ const { XTermAdapter } = await import('./XTermAdapter');
94
+ return new XTermAdapter(options);
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Theme bridge between ITerminalTheme (xterm.js format) and GhosttyTheme (restty format).
3
+ *
4
+ * Converts the mks-dev-environment Synthwave theme colors into
5
+ * restty's Ghostty-compatible theme format for GPU-rendered terminals.
6
+ *
7
+ * @module components/devenv/terminal/theme-restty
8
+ */
9
+
10
+ import type { ITerminalTheme } from './Terminal.types';
11
+ import { SYNTHWAVE_TERMINAL_THEME } from './Terminal.theme';
12
+
13
+ /**
14
+ * RGB color as used by restty's Ghostty theme format.
15
+ * Each channel is 0-255.
16
+ */
17
+ export interface IResttyThemeColor {
18
+ r: number;
19
+ g: number;
20
+ b: number;
21
+ a?: number;
22
+ }
23
+
24
+ /**
25
+ * Ghostty theme structure compatible with restty's applyTheme().
26
+ * Mirrors the GhosttyTheme type from restty/theme.
27
+ */
28
+ export interface IResttyGhosttyTheme {
29
+ name?: string;
30
+ colors: {
31
+ background?: IResttyThemeColor;
32
+ foreground?: IResttyThemeColor;
33
+ cursor?: IResttyThemeColor;
34
+ cursorText?: IResttyThemeColor;
35
+ selectionBackground?: IResttyThemeColor;
36
+ selectionForeground?: IResttyThemeColor;
37
+ palette: Array<IResttyThemeColor | undefined>;
38
+ };
39
+ raw: Record<string, string>;
40
+ }
41
+
42
+ /**
43
+ * Convert a hex color string (#RRGGBB or #RGB) to restty's ThemeColor format.
44
+ *
45
+ * @param hex - Hex color string (e.g., '#D40C67', '#fff')
46
+ * @returns RGB color object with channels 0-255
47
+ */
48
+ export function hexToResttyColor(hex: string): IResttyThemeColor {
49
+ let clean = hex.replace('#', '');
50
+
51
+ // Handle shorthand (#RGB → #RRGGBB)
52
+ if (clean.length === 3) {
53
+ clean = clean[0] + clean[0] + clean[1] + clean[1] + clean[2] + clean[2];
54
+ }
55
+
56
+ return {
57
+ r: parseInt(clean.slice(0, 2), 16),
58
+ g: parseInt(clean.slice(2, 4), 16),
59
+ b: parseInt(clean.slice(4, 6), 16),
60
+ };
61
+ }
62
+
63
+ /**
64
+ * Convert an rgba() color string to restty's ThemeColor format.
65
+ * Falls back to opaque white for unparseable values.
66
+ *
67
+ * @param rgba - CSS rgba() string (e.g., 'rgba(0, 217, 255, 0.3)')
68
+ * @returns RGB color object
69
+ */
70
+ function rgbaToResttyColor(rgba: string): IResttyThemeColor {
71
+ const match = rgba.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/);
72
+ if (!match) return { r: 255, g: 255, b: 255 };
73
+
74
+ return {
75
+ r: parseInt(match[1], 10),
76
+ g: parseInt(match[2], 10),
77
+ b: parseInt(match[3], 10),
78
+ a: match[4] ? Math.round(parseFloat(match[4]) * 255) : undefined,
79
+ };
80
+ }
81
+
82
+ /**
83
+ * Parse any CSS color value (hex or rgba) to restty ThemeColor.
84
+ *
85
+ * @param color - CSS color string
86
+ * @returns RGB color object
87
+ */
88
+ function cssColorToResttyColor(color: string): IResttyThemeColor {
89
+ if (color.startsWith('#')) return hexToResttyColor(color);
90
+ if (color.startsWith('rgb')) return rgbaToResttyColor(color);
91
+ return { r: 255, g: 255, b: 255 };
92
+ }
93
+
94
+ /**
95
+ * Convert ITerminalTheme (xterm.js format) to GhosttyTheme (restty format).
96
+ *
97
+ * Maps the 16-color ANSI palette plus background, foreground, cursor,
98
+ * and selection colors to restty's Ghostty theme structure.
99
+ *
100
+ * @param theme - xterm.js theme with hex color values
101
+ * @returns Ghostty theme compatible with restty's applyTheme()
102
+ */
103
+ export function xtermThemeToGhostty(theme: ITerminalTheme): IResttyGhosttyTheme {
104
+ const palette: Array<IResttyThemeColor | undefined> = new Array(256).fill(undefined);
105
+
106
+ // Standard ANSI colors (indices 0-7)
107
+ palette[0] = hexToResttyColor(theme.black);
108
+ palette[1] = hexToResttyColor(theme.red);
109
+ palette[2] = hexToResttyColor(theme.green);
110
+ palette[3] = hexToResttyColor(theme.yellow);
111
+ palette[4] = hexToResttyColor(theme.blue);
112
+ palette[5] = hexToResttyColor(theme.magenta);
113
+ palette[6] = hexToResttyColor(theme.cyan);
114
+ palette[7] = hexToResttyColor(theme.white);
115
+
116
+ // Bright ANSI colors (indices 8-15)
117
+ palette[8] = hexToResttyColor(theme.brightBlack);
118
+ palette[9] = hexToResttyColor(theme.brightRed);
119
+ palette[10] = hexToResttyColor(theme.brightGreen);
120
+ palette[11] = hexToResttyColor(theme.brightYellow);
121
+ palette[12] = hexToResttyColor(theme.brightBlue);
122
+ palette[13] = hexToResttyColor(theme.brightMagenta);
123
+ palette[14] = hexToResttyColor(theme.brightCyan);
124
+ palette[15] = hexToResttyColor(theme.brightWhite);
125
+
126
+ return {
127
+ name: 'Synthwave Industrial Dark',
128
+ colors: {
129
+ background: hexToResttyColor(theme.background),
130
+ foreground: hexToResttyColor(theme.foreground),
131
+ cursor: hexToResttyColor(theme.cursor),
132
+ cursorText: theme.cursorAccent ? hexToResttyColor(theme.cursorAccent) : undefined,
133
+ selectionBackground: theme.selectionBackground
134
+ ? cssColorToResttyColor(theme.selectionBackground)
135
+ : undefined,
136
+ selectionForeground: theme.selectionForeground
137
+ ? cssColorToResttyColor(theme.selectionForeground)
138
+ : undefined,
139
+ palette,
140
+ },
141
+ raw: {},
142
+ };
143
+ }
144
+
145
+ /**
146
+ * Get the Synthwave Industrial Dark theme in Ghostty format for restty.
147
+ *
148
+ * Pre-built conversion of the default terminal theme, ready to pass
149
+ * directly to `restty.applyTheme()`.
150
+ *
151
+ * @returns GhosttyTheme with Synthwave colors
152
+ */
153
+ export function getSynthwaveGhosttyTheme(): IResttyGhosttyTheme {
154
+ return xtermThemeToGhostty(SYNTHWAVE_TERMINAL_THEME);
155
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Synthwave Industrial Dark theme for xterm.js.
3
+ *
4
+ * Matches mks-dev-environment design system from globals.css:
5
+ * - background: #241B2F (220 25% 15%)
6
+ * - primary: #D40C67 (330 85% 43%)
7
+ * - success: #44ffaa (142 100% 62%)
8
+ *
9
+ * Color palette optimized for dark terminal with high contrast
10
+ * and cyberpunk/synthwave aesthetic.
11
+ *
12
+ * @module components/devenv/terminal/theme
13
+ */
14
+
15
+ import type { ITerminalTheme } from './Terminal.types';
16
+
17
+ /**
18
+ * Synthwave Industrial Dark theme for xterm.js.
19
+ *
20
+ * Features:
21
+ * - Deep purple background (#241B2F) matching design system
22
+ * - Primary magenta cursor (#D40C67) with glow effect support
23
+ * - High-contrast ANSI colors for readability
24
+ * - Cyan selection with transparency for visual feedback
25
+ */
26
+ export const SYNTHWAVE_TERMINAL_THEME: ITerminalTheme = {
27
+ // Base colors from design system
28
+ background: '#241B2F',
29
+ foreground: '#e8e8ec',
30
+
31
+ // Cursor - primary magenta with glow effect
32
+ cursor: '#D40C67',
33
+ cursorAccent: '#D40C67',
34
+
35
+ // Selection - cyan with transparency
36
+ selectionBackground: 'rgba(0, 217, 255, 0.3)',
37
+
38
+ // ANSI colors - adjusted for synthwave aesthetic
39
+ black: '#1a1a2e',
40
+ red: '#ff4466',
41
+ green: '#44ffaa',
42
+ yellow: '#ffcc00',
43
+ blue: '#00d9ff',
44
+ magenta: '#D40C67',
45
+ cyan: '#00d9ff',
46
+ white: '#e8e8ec',
47
+
48
+ // Bright ANSI colors - enhanced for better visibility
49
+ brightBlack: '#2d2d44',
50
+ brightRed: '#ff6b6b',
51
+ brightGreen: '#66ffcc',
52
+ brightYellow: '#ffdd33',
53
+ brightBlue: '#33e0ff',
54
+ brightMagenta: '#ff3399',
55
+ brightCyan: '#33e0ff',
56
+ brightWhite: '#ffffff',
57
+ };
58
+
59
+ /**
60
+ * Get terminal theme with optional overrides.
61
+ *
62
+ * Allows customizing the Synthwave theme while preserving
63
+ * the default color scheme. Useful for per-session theming.
64
+ *
65
+ * @param overrides - Partial theme properties to override
66
+ * @returns Complete terminal theme with applied overrides
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const customTheme = getTerminalTheme({
71
+ * cursor: '#00ff00',
72
+ * fontSize: 16,
73
+ * });
74
+ * ```
75
+ */
76
+ export function getTerminalTheme(
77
+ overrides?: Partial<ITerminalTheme>
78
+ ): ITerminalTheme {
79
+ return { ...SYNTHWAVE_TERMINAL_THEME, ...overrides };
80
+ }