@machina.ai/cell-cli 0.1.13-rc2

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 (475) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +20 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/package.json +79 -0
  6. package/dist/src/acp/acp.d.ts +208 -0
  7. package/dist/src/acp/acp.js +193 -0
  8. package/dist/src/acp/acp.js.map +1 -0
  9. package/dist/src/acp/acpPeer.d.ts +8 -0
  10. package/dist/src/acp/acpPeer.js +537 -0
  11. package/dist/src/acp/acpPeer.js.map +1 -0
  12. package/dist/src/config/auth.d.ts +6 -0
  13. package/dist/src/config/auth.js +15 -0
  14. package/dist/src/config/auth.js.map +1 -0
  15. package/dist/src/config/config.d.ts +39 -0
  16. package/dist/src/config/config.js +359 -0
  17. package/dist/src/config/config.js.map +1 -0
  18. package/dist/src/config/extension.d.ts +21 -0
  19. package/dist/src/config/extension.js +114 -0
  20. package/dist/src/config/extension.js.map +1 -0
  21. package/dist/src/config/sandboxConfig.d.ts +13 -0
  22. package/dist/src/config/sandboxConfig.js +75 -0
  23. package/dist/src/config/sandboxConfig.js.map +1 -0
  24. package/dist/src/config/settings.d.ts +91 -0
  25. package/dist/src/config/settings.js +282 -0
  26. package/dist/src/config/settings.js.map +1 -0
  27. package/dist/src/gemini.d.ts +6 -0
  28. package/dist/src/gemini.js +242 -0
  29. package/dist/src/gemini.js.map +1 -0
  30. package/dist/src/generated/git-commit.d.ts +6 -0
  31. package/dist/src/generated/git-commit.js +9 -0
  32. package/dist/src/generated/git-commit.js.map +1 -0
  33. package/dist/src/nonInteractiveCli.d.ts +7 -0
  34. package/dist/src/nonInteractiveCli.js +124 -0
  35. package/dist/src/nonInteractiveCli.js.map +1 -0
  36. package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
  37. package/dist/src/services/BuiltinCommandLoader.js +70 -0
  38. package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
  39. package/dist/src/services/CommandService.d.ts +51 -0
  40. package/dist/src/services/CommandService.js +74 -0
  41. package/dist/src/services/CommandService.js.map +1 -0
  42. package/dist/src/services/FileCommandLoader.d.ts +37 -0
  43. package/dist/src/services/FileCommandLoader.js +133 -0
  44. package/dist/src/services/FileCommandLoader.js.map +1 -0
  45. package/dist/src/services/types.d.ts +22 -0
  46. package/dist/src/services/types.js +7 -0
  47. package/dist/src/services/types.js.map +1 -0
  48. package/dist/src/ui/App.d.ts +15 -0
  49. package/dist/src/ui/App.js +488 -0
  50. package/dist/src/ui/App.js.map +1 -0
  51. package/dist/src/ui/colors.d.ts +7 -0
  52. package/dist/src/ui/colors.js +48 -0
  53. package/dist/src/ui/colors.js.map +1 -0
  54. package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
  55. package/dist/src/ui/commands/aboutCommand.js +39 -0
  56. package/dist/src/ui/commands/aboutCommand.js.map +1 -0
  57. package/dist/src/ui/commands/authCommand.d.ts +7 -0
  58. package/dist/src/ui/commands/authCommand.js +16 -0
  59. package/dist/src/ui/commands/authCommand.js.map +1 -0
  60. package/dist/src/ui/commands/bugCommand.d.ts +7 -0
  61. package/dist/src/ui/commands/bugCommand.js +63 -0
  62. package/dist/src/ui/commands/bugCommand.js.map +1 -0
  63. package/dist/src/ui/commands/chatCommand.d.ts +7 -0
  64. package/dist/src/ui/commands/chatCommand.js +174 -0
  65. package/dist/src/ui/commands/chatCommand.js.map +1 -0
  66. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  67. package/dist/src/ui/commands/clearCommand.js +27 -0
  68. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  69. package/dist/src/ui/commands/compressCommand.d.ts +7 -0
  70. package/dist/src/ui/commands/compressCommand.js +64 -0
  71. package/dist/src/ui/commands/compressCommand.js.map +1 -0
  72. package/dist/src/ui/commands/copyCommand.d.ts +7 -0
  73. package/dist/src/ui/commands/copyCommand.js +59 -0
  74. package/dist/src/ui/commands/copyCommand.js.map +1 -0
  75. package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
  76. package/dist/src/ui/commands/corgiCommand.js +15 -0
  77. package/dist/src/ui/commands/corgiCommand.js.map +1 -0
  78. package/dist/src/ui/commands/docsCommand.d.ts +7 -0
  79. package/dist/src/ui/commands/docsCommand.js +31 -0
  80. package/dist/src/ui/commands/docsCommand.js.map +1 -0
  81. package/dist/src/ui/commands/editorCommand.d.ts +7 -0
  82. package/dist/src/ui/commands/editorCommand.js +16 -0
  83. package/dist/src/ui/commands/editorCommand.js.map +1 -0
  84. package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
  85. package/dist/src/ui/commands/extensionsCommand.js +31 -0
  86. package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
  87. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  88. package/dist/src/ui/commands/helpCommand.js +20 -0
  89. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  90. package/dist/src/ui/commands/ideCommand.d.ts +8 -0
  91. package/dist/src/ui/commands/ideCommand.js +127 -0
  92. package/dist/src/ui/commands/ideCommand.js.map +1 -0
  93. package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
  94. package/dist/src/ui/commands/mcpCommand.js +206 -0
  95. package/dist/src/ui/commands/mcpCommand.js.map +1 -0
  96. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  97. package/dist/src/ui/commands/memoryCommand.js +86 -0
  98. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  99. package/dist/src/ui/commands/privacyCommand.d.ts +7 -0
  100. package/dist/src/ui/commands/privacyCommand.js +16 -0
  101. package/dist/src/ui/commands/privacyCommand.js.map +1 -0
  102. package/dist/src/ui/commands/quitCommand.d.ts +7 -0
  103. package/dist/src/ui/commands/quitCommand.js +34 -0
  104. package/dist/src/ui/commands/quitCommand.js.map +1 -0
  105. package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
  106. package/dist/src/ui/commands/restoreCommand.js +128 -0
  107. package/dist/src/ui/commands/restoreCommand.js.map +1 -0
  108. package/dist/src/ui/commands/statsCommand.d.ts +7 -0
  109. package/dist/src/ui/commands/statsCommand.js +54 -0
  110. package/dist/src/ui/commands/statsCommand.js.map +1 -0
  111. package/dist/src/ui/commands/themeCommand.d.ts +7 -0
  112. package/dist/src/ui/commands/themeCommand.js +16 -0
  113. package/dist/src/ui/commands/themeCommand.js.map +1 -0
  114. package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
  115. package/dist/src/ui/commands/toolsCommand.js +56 -0
  116. package/dist/src/ui/commands/toolsCommand.js.map +1 -0
  117. package/dist/src/ui/commands/types.d.ts +110 -0
  118. package/dist/src/ui/commands/types.js +11 -0
  119. package/dist/src/ui/commands/types.js.map +1 -0
  120. package/dist/src/ui/components/AboutBox.d.ts +16 -0
  121. package/dist/src/ui/components/AboutBox.js +6 -0
  122. package/dist/src/ui/components/AboutBox.js.map +1 -0
  123. package/dist/src/ui/components/AsciiArt.d.ts +7 -0
  124. package/dist/src/ui/components/AsciiArt.js +32 -0
  125. package/dist/src/ui/components/AsciiArt.js.map +1 -0
  126. package/dist/src/ui/components/AuthDialog.d.ts +15 -0
  127. package/dist/src/ui/components/AuthDialog.js +50 -0
  128. package/dist/src/ui/components/AuthDialog.js.map +1 -0
  129. package/dist/src/ui/components/AuthInProgress.d.ts +11 -0
  130. package/dist/src/ui/components/AuthInProgress.js +27 -0
  131. package/dist/src/ui/components/AuthInProgress.js.map +1 -0
  132. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
  133. package/dist/src/ui/components/AutoAcceptIndicator.js +26 -0
  134. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
  135. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
  136. package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
  137. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
  138. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
  139. package/dist/src/ui/components/ContextSummaryDisplay.js +68 -0
  140. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
  141. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +14 -0
  142. package/dist/src/ui/components/DetailedMessagesDisplay.js +34 -0
  143. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
  144. package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
  145. package/dist/src/ui/components/EditorSettingsDialog.js +73 -0
  146. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
  147. package/dist/src/ui/components/Footer.d.ts +21 -0
  148. package/dist/src/ui/components/Footer.js +14 -0
  149. package/dist/src/ui/components/Footer.js.map +1 -0
  150. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +17 -0
  151. package/dist/src/ui/components/GeminiRespondingSpinner.js +16 -0
  152. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
  153. package/dist/src/ui/components/Header.d.ts +14 -0
  154. package/dist/src/ui/components/Header.js +20 -0
  155. package/dist/src/ui/components/Header.js.map +1 -0
  156. package/dist/src/ui/components/Help.d.ts +12 -0
  157. package/dist/src/ui/components/Help.js +10 -0
  158. package/dist/src/ui/components/Help.js.map +1 -0
  159. package/dist/src/ui/components/HistoryItemDisplay.d.ts +18 -0
  160. package/dist/src/ui/components/HistoryItemDisplay.js +17 -0
  161. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
  162. package/dist/src/ui/components/InputPrompt.d.ts +25 -0
  163. package/dist/src/ui/components/InputPrompt.js +387 -0
  164. package/dist/src/ui/components/InputPrompt.js.map +1 -0
  165. package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
  166. package/dist/src/ui/components/LoadingIndicator.js +20 -0
  167. package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
  168. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
  169. package/dist/src/ui/components/MemoryUsageDisplay.js +27 -0
  170. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
  171. package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
  172. package/dist/src/ui/components/ModelStatsDisplay.js +33 -0
  173. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
  174. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
  175. package/dist/src/ui/components/SessionSummaryDisplay.js +4 -0
  176. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
  177. package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
  178. package/dist/src/ui/components/ShellModeIndicator.js +5 -0
  179. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
  180. package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
  181. package/dist/src/ui/components/ShowMoreLines.js +24 -0
  182. package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
  183. package/dist/src/ui/components/StatsDisplay.d.ts +12 -0
  184. package/dist/src/ui/components/StatsDisplay.js +42 -0
  185. package/dist/src/ui/components/StatsDisplay.js.map +1 -0
  186. package/dist/src/ui/components/SuggestionsDisplay.d.ts +21 -0
  187. package/dist/src/ui/components/SuggestionsDisplay.js +32 -0
  188. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
  189. package/dist/src/ui/components/ThemeDialog.d.ts +19 -0
  190. package/dist/src/ui/components/ThemeDialog.js +148 -0
  191. package/dist/src/ui/components/ThemeDialog.js.map +1 -0
  192. package/dist/src/ui/components/Tips.d.ts +12 -0
  193. package/dist/src/ui/components/Tips.js +8 -0
  194. package/dist/src/ui/components/Tips.js.map +1 -0
  195. package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
  196. package/dist/src/ui/components/ToolStatsDisplay.js +41 -0
  197. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
  198. package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
  199. package/dist/src/ui/components/UpdateNotification.js +10 -0
  200. package/dist/src/ui/components/UpdateNotification.js.map +1 -0
  201. package/dist/src/ui/components/messages/CompressionMessage.d.ts +11 -0
  202. package/dist/src/ui/components/messages/CompressionMessage.js +16 -0
  203. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
  204. package/dist/src/ui/components/messages/DiffRenderer.d.ts +16 -0
  205. package/dist/src/ui/components/messages/DiffRenderer.js +212 -0
  206. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
  207. package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
  208. package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
  209. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
  210. package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
  211. package/dist/src/ui/components/messages/GeminiMessage.js +10 -0
  212. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
  213. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
  214. package/dist/src/ui/components/messages/GeminiMessageContent.js +15 -0
  215. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
  216. package/dist/src/ui/components/messages/InfoMessage.d.ts +11 -0
  217. package/dist/src/ui/components/messages/InfoMessage.js +9 -0
  218. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
  219. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +15 -0
  220. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +111 -0
  221. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
  222. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +18 -0
  223. package/dist/src/ui/components/messages/ToolGroupMessage.js +55 -0
  224. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
  225. package/dist/src/ui/components/messages/ToolMessage.d.ts +15 -0
  226. package/dist/src/ui/components/messages/ToolMessage.js +61 -0
  227. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
  228. package/dist/src/ui/components/messages/UserMessage.d.ts +11 -0
  229. package/dist/src/ui/components/messages/UserMessage.js +9 -0
  230. package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
  231. package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
  232. package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
  233. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
  234. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
  235. package/dist/src/ui/components/shared/MaxSizedBox.js +451 -0
  236. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
  237. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +46 -0
  238. package/dist/src/ui/components/shared/RadioButtonSelect.js +119 -0
  239. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
  240. package/dist/src/ui/components/shared/text-buffer.d.ts +184 -0
  241. package/dist/src/ui/components/shared/text-buffer.js +1010 -0
  242. package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
  243. package/dist/src/ui/constants.d.ts +9 -0
  244. package/dist/src/ui/constants.js +13 -0
  245. package/dist/src/ui/constants.js.map +1 -0
  246. package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
  247. package/dist/src/ui/contexts/OverflowContext.js +43 -0
  248. package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
  249. package/dist/src/ui/contexts/SessionContext.d.ts +36 -0
  250. package/dist/src/ui/contexts/SessionContext.js +59 -0
  251. package/dist/src/ui/contexts/SessionContext.js.map +1 -0
  252. package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
  253. package/dist/src/ui/contexts/StreamingContext.js +15 -0
  254. package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
  255. package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
  256. package/dist/src/ui/editors/editorSettingsManager.js +54 -0
  257. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
  258. package/dist/src/ui/hooks/atCommandProcessor.d.ts +31 -0
  259. package/dist/src/ui/hooks/atCommandProcessor.js +347 -0
  260. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
  261. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +16 -0
  262. package/dist/src/ui/hooks/shellCommandProcessor.js +295 -0
  263. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
  264. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -0
  265. package/dist/src/ui/hooks/slashCommandProcessor.js +294 -0
  266. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
  267. package/dist/src/ui/hooks/useAuthCommand.d.ts +14 -0
  268. package/dist/src/ui/hooks/useAuthCommand.js +65 -0
  269. package/dist/src/ui/hooks/useAuthCommand.js.map +1 -0
  270. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +10 -0
  271. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +37 -0
  272. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
  273. package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
  274. package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
  275. package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
  276. package/dist/src/ui/hooks/useCompletion.d.ts +22 -0
  277. package/dist/src/ui/hooks/useCompletion.js +393 -0
  278. package/dist/src/ui/hooks/useCompletion.js.map +1 -0
  279. package/dist/src/ui/hooks/useConsoleMessages.d.ts +12 -0
  280. package/dist/src/ui/hooks/useConsoleMessages.js +60 -0
  281. package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
  282. package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
  283. package/dist/src/ui/hooks/useEditorSettings.js +43 -0
  284. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
  285. package/dist/src/ui/hooks/useFocus.d.ts +6 -0
  286. package/dist/src/ui/hooks/useFocus.js +41 -0
  287. package/dist/src/ui/hooks/useFocus.js.map +1 -0
  288. package/dist/src/ui/hooks/useGeminiStream.d.ts +23 -0
  289. package/dist/src/ui/hooks/useGeminiStream.js +613 -0
  290. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
  291. package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
  292. package/dist/src/ui/hooks/useGitBranchName.js +61 -0
  293. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
  294. package/dist/src/ui/hooks/useHistoryManager.d.ts +22 -0
  295. package/dist/src/ui/hooks/useHistoryManager.js +72 -0
  296. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
  297. package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
  298. package/dist/src/ui/hooks/useInputHistory.js +84 -0
  299. package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
  300. package/dist/src/ui/hooks/useKeypress.d.ts +29 -0
  301. package/dist/src/ui/hooks/useKeypress.js +156 -0
  302. package/dist/src/ui/hooks/useKeypress.js.map +1 -0
  303. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
  304. package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
  305. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
  306. package/dist/src/ui/hooks/useLogger.d.ts +10 -0
  307. package/dist/src/ui/hooks/useLogger.js +29 -0
  308. package/dist/src/ui/hooks/useLogger.js.map +1 -0
  309. package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
  310. package/dist/src/ui/hooks/usePhraseCycler.js +189 -0
  311. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
  312. package/dist/src/ui/hooks/usePrivacySettings.d.ts +16 -0
  313. package/dist/src/ui/hooks/usePrivacySettings.js +115 -0
  314. package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -0
  315. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
  316. package/dist/src/ui/hooks/useReactToolScheduler.js +186 -0
  317. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
  318. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
  319. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
  320. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
  321. package/dist/src/ui/hooks/useShellHistory.d.ts +11 -0
  322. package/dist/src/ui/hooks/useShellHistory.js +89 -0
  323. package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
  324. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
  325. package/dist/src/ui/hooks/useShowMemoryCommand.js +58 -0
  326. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
  327. package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
  328. package/dist/src/ui/hooks/useStateAndRef.js +26 -0
  329. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
  330. package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
  331. package/dist/src/ui/hooks/useTerminalSize.js +27 -0
  332. package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
  333. package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
  334. package/dist/src/ui/hooks/useThemeCommand.js +79 -0
  335. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
  336. package/dist/src/ui/hooks/useTimer.d.ts +12 -0
  337. package/dist/src/ui/hooks/useTimer.js +58 -0
  338. package/dist/src/ui/hooks/useTimer.js.map +1 -0
  339. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +12 -0
  340. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +40 -0
  341. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -0
  342. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +10 -0
  343. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +17 -0
  344. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -0
  345. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +10 -0
  346. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +17 -0
  347. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -0
  348. package/dist/src/ui/privacy/PrivacyNotice.d.ts +12 -0
  349. package/dist/src/ui/privacy/PrivacyNotice.js +25 -0
  350. package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -0
  351. package/dist/src/ui/themes/ansi-light.d.ts +7 -0
  352. package/dist/src/ui/themes/ansi-light.js +139 -0
  353. package/dist/src/ui/themes/ansi-light.js.map +1 -0
  354. package/dist/src/ui/themes/ansi.d.ts +7 -0
  355. package/dist/src/ui/themes/ansi.js +149 -0
  356. package/dist/src/ui/themes/ansi.js.map +1 -0
  357. package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
  358. package/dist/src/ui/themes/atom-one-dark.js +136 -0
  359. package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
  360. package/dist/src/ui/themes/ayu-light.d.ts +7 -0
  361. package/dist/src/ui/themes/ayu-light.js +128 -0
  362. package/dist/src/ui/themes/ayu-light.js.map +1 -0
  363. package/dist/src/ui/themes/ayu.d.ts +7 -0
  364. package/dist/src/ui/themes/ayu.js +102 -0
  365. package/dist/src/ui/themes/ayu.js.map +1 -0
  366. package/dist/src/ui/themes/color-utils.d.ts +21 -0
  367. package/dist/src/ui/themes/color-utils.js +221 -0
  368. package/dist/src/ui/themes/color-utils.js.map +1 -0
  369. package/dist/src/ui/themes/default-light.d.ts +7 -0
  370. package/dist/src/ui/themes/default-light.js +100 -0
  371. package/dist/src/ui/themes/default-light.js.map +1 -0
  372. package/dist/src/ui/themes/default.d.ts +7 -0
  373. package/dist/src/ui/themes/default.js +143 -0
  374. package/dist/src/ui/themes/default.js.map +1 -0
  375. package/dist/src/ui/themes/dracula.d.ts +7 -0
  376. package/dist/src/ui/themes/dracula.js +113 -0
  377. package/dist/src/ui/themes/dracula.js.map +1 -0
  378. package/dist/src/ui/themes/github-dark.d.ts +7 -0
  379. package/dist/src/ui/themes/github-dark.js +136 -0
  380. package/dist/src/ui/themes/github-dark.js.map +1 -0
  381. package/dist/src/ui/themes/github-light.d.ts +7 -0
  382. package/dist/src/ui/themes/github-light.js +138 -0
  383. package/dist/src/ui/themes/github-light.js.map +1 -0
  384. package/dist/src/ui/themes/googlecode.d.ts +7 -0
  385. package/dist/src/ui/themes/googlecode.js +135 -0
  386. package/dist/src/ui/themes/googlecode.js.map +1 -0
  387. package/dist/src/ui/themes/no-color.d.ts +7 -0
  388. package/dist/src/ui/themes/no-color.js +84 -0
  389. package/dist/src/ui/themes/no-color.js.map +1 -0
  390. package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
  391. package/dist/src/ui/themes/shades-of-purple.js +302 -0
  392. package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
  393. package/dist/src/ui/themes/theme-manager.d.ts +58 -0
  394. package/dist/src/ui/themes/theme-manager.js +179 -0
  395. package/dist/src/ui/themes/theme-manager.js.map +1 -0
  396. package/dist/src/ui/themes/theme.d.ts +84 -0
  397. package/dist/src/ui/themes/theme.js +341 -0
  398. package/dist/src/ui/themes/theme.js.map +1 -0
  399. package/dist/src/ui/themes/xcode.d.ts +7 -0
  400. package/dist/src/ui/themes/xcode.js +143 -0
  401. package/dist/src/ui/themes/xcode.js.map +1 -0
  402. package/dist/src/ui/types.d.ts +180 -0
  403. package/dist/src/ui/types.js +43 -0
  404. package/dist/src/ui/types.js.map +1 -0
  405. package/dist/src/ui/utils/CodeColorizer.d.ts +15 -0
  406. package/dist/src/ui/utils/CodeColorizer.js +97 -0
  407. package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
  408. package/dist/src/ui/utils/ConsolePatcher.d.ts +23 -0
  409. package/dist/src/ui/utils/ConsolePatcher.js +42 -0
  410. package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
  411. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
  412. package/dist/src/ui/utils/InlineMarkdownRenderer.js +104 -0
  413. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  414. package/dist/src/ui/utils/MarkdownDisplay.d.ts +14 -0
  415. package/dist/src/ui/utils/MarkdownDisplay.js +205 -0
  416. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
  417. package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
  418. package/dist/src/ui/utils/TableRenderer.js +84 -0
  419. package/dist/src/ui/utils/TableRenderer.js.map +1 -0
  420. package/dist/src/ui/utils/clipboardUtils.d.ts +22 -0
  421. package/dist/src/ui/utils/clipboardUtils.js +127 -0
  422. package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
  423. package/dist/src/ui/utils/commandUtils.d.ts +23 -0
  424. package/dist/src/ui/utils/commandUtils.js +72 -0
  425. package/dist/src/ui/utils/commandUtils.js.map +1 -0
  426. package/dist/src/ui/utils/computeStats.d.ts +10 -0
  427. package/dist/src/ui/utils/computeStats.js +55 -0
  428. package/dist/src/ui/utils/computeStats.js.map +1 -0
  429. package/dist/src/ui/utils/displayUtils.d.ts +17 -0
  430. package/dist/src/ui/utils/displayUtils.js +24 -0
  431. package/dist/src/ui/utils/displayUtils.js.map +1 -0
  432. package/dist/src/ui/utils/errorParsing.d.ts +7 -0
  433. package/dist/src/ui/utils/errorParsing.js +90 -0
  434. package/dist/src/ui/utils/errorParsing.js.map +1 -0
  435. package/dist/src/ui/utils/formatters.d.ts +13 -0
  436. package/dist/src/ui/utils/formatters.js +56 -0
  437. package/dist/src/ui/utils/formatters.js.map +1 -0
  438. package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
  439. package/dist/src/ui/utils/markdownUtilities.js +110 -0
  440. package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
  441. package/dist/src/ui/utils/textUtils.d.ts +22 -0
  442. package/dist/src/ui/utils/textUtils.js +58 -0
  443. package/dist/src/ui/utils/textUtils.js.map +1 -0
  444. package/dist/src/ui/utils/updateCheck.d.ts +6 -0
  445. package/dist/src/ui/utils/updateCheck.js +40 -0
  446. package/dist/src/ui/utils/updateCheck.js.map +1 -0
  447. package/dist/src/utils/cleanup.d.ts +8 -0
  448. package/dist/src/utils/cleanup.js +34 -0
  449. package/dist/src/utils/cleanup.js.map +1 -0
  450. package/dist/src/utils/package.d.ts +12 -0
  451. package/dist/src/utils/package.js +24 -0
  452. package/dist/src/utils/package.js.map +1 -0
  453. package/dist/src/utils/readStdin.d.ts +6 -0
  454. package/dist/src/utils/readStdin.js +34 -0
  455. package/dist/src/utils/readStdin.js.map +1 -0
  456. package/dist/src/utils/sandbox-macos-permissive-closed.sb +26 -0
  457. package/dist/src/utils/sandbox-macos-permissive-open.sb +19 -0
  458. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +31 -0
  459. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +87 -0
  460. package/dist/src/utils/sandbox-macos-restrictive-open.sb +90 -0
  461. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +92 -0
  462. package/dist/src/utils/sandbox.d.ts +7 -0
  463. package/dist/src/utils/sandbox.js +680 -0
  464. package/dist/src/utils/sandbox.js.map +1 -0
  465. package/dist/src/utils/startupWarnings.d.ts +6 -0
  466. package/dist/src/utils/startupWarnings.js +40 -0
  467. package/dist/src/utils/startupWarnings.js.map +1 -0
  468. package/dist/src/utils/userStartupWarnings.d.ts +6 -0
  469. package/dist/src/utils/userStartupWarnings.js +54 -0
  470. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  471. package/dist/src/utils/version.d.ts +6 -0
  472. package/dist/src/utils/version.js +11 -0
  473. package/dist/src/utils/version.js.map +1 -0
  474. package/dist/tsconfig.tsbuildinfo +1 -0
  475. package/package.json +79 -0
@@ -0,0 +1,302 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Shades of Purple Theme — for Highlight.js.
8
+ * @author Ahmad Awais <https://twitter.com/mrahmadawais/>
9
+ */
10
+ import { Theme } from './theme.js';
11
+ const shadesOfPurpleColors = {
12
+ type: 'dark',
13
+ // Required colors for ColorsTheme interface
14
+ Background: '#2d2b57', // Main background
15
+ Foreground: '#e3dfff', // Default text color (hljs, hljs-subst)
16
+ LightBlue: '#847ace', // Light blue/purple accent
17
+ AccentBlue: '#a599e9', // Borders, secondary blue
18
+ AccentPurple: '#ac65ff', // Comments (main purple)
19
+ AccentCyan: '#a1feff', // Names
20
+ AccentGreen: '#A5FF90', // Strings and many others
21
+ AccentYellow: '#fad000', // Title, main yellow
22
+ AccentRed: '#ff628c', // Error/deletion accent
23
+ Comment: '#B362FF', // Comment color (same as AccentPurple)
24
+ Gray: '#726c86', // Gray color
25
+ GradientColors: ['#4d21fc', '#847ace', '#ff628c'],
26
+ };
27
+ // Additional colors from CSS that don't fit in the ColorsTheme interface
28
+ const additionalColors = {
29
+ AccentYellowAlt: '#f8d000', // Attr yellow (slightly different)
30
+ AccentOrange: '#fb9e00', // Keywords, built_in, meta
31
+ AccentPink: '#fa658d', // Numbers, literals
32
+ AccentLightPurple: '#c991ff', // For params and properties
33
+ AccentDarkPurple: '#6943ff', // For operators
34
+ AccentTeal: '#2ee2fa', // For special constructs
35
+ };
36
+ export const ShadesOfPurple = new Theme('Shades Of Purple', 'dark', {
37
+ // Base styles
38
+ hljs: {
39
+ display: 'block',
40
+ overflowX: 'auto',
41
+ background: shadesOfPurpleColors.Background,
42
+ color: shadesOfPurpleColors.Foreground,
43
+ },
44
+ // Title elements
45
+ 'hljs-title': {
46
+ color: shadesOfPurpleColors.AccentYellow,
47
+ fontWeight: 'normal',
48
+ },
49
+ // Names
50
+ 'hljs-name': {
51
+ color: shadesOfPurpleColors.AccentCyan,
52
+ fontWeight: 'normal',
53
+ },
54
+ // Tags
55
+ 'hljs-tag': {
56
+ color: shadesOfPurpleColors.Foreground,
57
+ },
58
+ // Attributes
59
+ 'hljs-attr': {
60
+ color: additionalColors.AccentYellowAlt,
61
+ fontStyle: 'italic',
62
+ },
63
+ // Built-ins, selector tags, sections
64
+ 'hljs-built_in': {
65
+ color: additionalColors.AccentOrange,
66
+ },
67
+ 'hljs-selector-tag': {
68
+ color: additionalColors.AccentOrange,
69
+ fontWeight: 'normal',
70
+ },
71
+ 'hljs-section': {
72
+ color: additionalColors.AccentOrange,
73
+ },
74
+ // Keywords
75
+ 'hljs-keyword': {
76
+ color: additionalColors.AccentOrange,
77
+ fontWeight: 'normal',
78
+ },
79
+ // Default text and substitutions
80
+ 'hljs-subst': {
81
+ color: shadesOfPurpleColors.Foreground,
82
+ },
83
+ // Strings and related elements (all green)
84
+ 'hljs-string': {
85
+ color: shadesOfPurpleColors.AccentGreen,
86
+ },
87
+ 'hljs-attribute': {
88
+ color: shadesOfPurpleColors.AccentGreen,
89
+ },
90
+ 'hljs-symbol': {
91
+ color: shadesOfPurpleColors.AccentGreen,
92
+ },
93
+ 'hljs-bullet': {
94
+ color: shadesOfPurpleColors.AccentGreen,
95
+ },
96
+ 'hljs-addition': {
97
+ color: shadesOfPurpleColors.AccentGreen,
98
+ },
99
+ 'hljs-code': {
100
+ color: shadesOfPurpleColors.AccentGreen,
101
+ },
102
+ 'hljs-regexp': {
103
+ color: shadesOfPurpleColors.AccentGreen,
104
+ },
105
+ 'hljs-selector-class': {
106
+ color: shadesOfPurpleColors.AccentGreen,
107
+ },
108
+ 'hljs-selector-attr': {
109
+ color: shadesOfPurpleColors.AccentGreen,
110
+ },
111
+ 'hljs-selector-pseudo': {
112
+ color: shadesOfPurpleColors.AccentGreen,
113
+ },
114
+ 'hljs-template-tag': {
115
+ color: shadesOfPurpleColors.AccentGreen,
116
+ },
117
+ 'hljs-quote': {
118
+ color: shadesOfPurpleColors.AccentGreen,
119
+ },
120
+ 'hljs-deletion': {
121
+ color: shadesOfPurpleColors.AccentRed,
122
+ },
123
+ // Meta elements
124
+ 'hljs-meta': {
125
+ color: additionalColors.AccentOrange,
126
+ },
127
+ 'hljs-meta-string': {
128
+ color: additionalColors.AccentOrange,
129
+ },
130
+ // Comments
131
+ 'hljs-comment': {
132
+ color: shadesOfPurpleColors.AccentPurple,
133
+ },
134
+ // Literals and numbers
135
+ 'hljs-literal': {
136
+ color: additionalColors.AccentPink,
137
+ fontWeight: 'normal',
138
+ },
139
+ 'hljs-number': {
140
+ color: additionalColors.AccentPink,
141
+ },
142
+ // Emphasis and strong
143
+ 'hljs-emphasis': {
144
+ fontStyle: 'italic',
145
+ },
146
+ 'hljs-strong': {
147
+ fontWeight: 'bold',
148
+ },
149
+ // Diff-specific classes
150
+ 'hljs-diff': {
151
+ color: shadesOfPurpleColors.Foreground,
152
+ },
153
+ 'hljs-meta.hljs-diff': {
154
+ color: shadesOfPurpleColors.AccentBlue,
155
+ },
156
+ 'hljs-ln': {
157
+ color: shadesOfPurpleColors.Gray,
158
+ },
159
+ // Additional elements that might be needed
160
+ 'hljs-type': {
161
+ color: shadesOfPurpleColors.AccentYellow,
162
+ fontWeight: 'normal',
163
+ },
164
+ 'hljs-variable': {
165
+ color: shadesOfPurpleColors.AccentYellow,
166
+ },
167
+ 'hljs-template-variable': {
168
+ color: shadesOfPurpleColors.AccentGreen,
169
+ },
170
+ 'hljs-function .hljs-keyword': {
171
+ color: additionalColors.AccentOrange,
172
+ },
173
+ 'hljs-link': {
174
+ color: shadesOfPurpleColors.LightBlue,
175
+ },
176
+ 'hljs-doctag': {
177
+ fontWeight: 'bold',
178
+ },
179
+ // Function parameters
180
+ 'hljs-params': {
181
+ color: additionalColors.AccentLightPurple,
182
+ fontStyle: 'italic',
183
+ },
184
+ // Class definitions
185
+ 'hljs-class': {
186
+ color: shadesOfPurpleColors.AccentCyan,
187
+ fontWeight: 'bold',
188
+ },
189
+ // Function definitions
190
+ 'hljs-function': {
191
+ color: shadesOfPurpleColors.AccentCyan,
192
+ },
193
+ // Object properties
194
+ 'hljs-property': {
195
+ color: shadesOfPurpleColors.AccentBlue,
196
+ },
197
+ // Operators
198
+ 'hljs-operator': {
199
+ color: additionalColors.AccentDarkPurple,
200
+ },
201
+ // Punctuation (if supported by the parser)
202
+ 'hljs-punctuation': {
203
+ color: shadesOfPurpleColors.Gray,
204
+ },
205
+ // CSS ID selectors
206
+ 'hljs-selector-id': {
207
+ color: shadesOfPurpleColors.AccentYellow,
208
+ fontWeight: 'bold',
209
+ },
210
+ // Character literals
211
+ 'hljs-char': {
212
+ color: shadesOfPurpleColors.AccentGreen,
213
+ },
214
+ // Escape sequences
215
+ 'hljs-escape': {
216
+ color: additionalColors.AccentPink,
217
+ fontWeight: 'bold',
218
+ },
219
+ // Meta keywords
220
+ 'hljs-meta-keyword': {
221
+ color: additionalColors.AccentOrange,
222
+ fontWeight: 'bold',
223
+ },
224
+ // Built-in names
225
+ 'hljs-builtin-name': {
226
+ color: additionalColors.AccentTeal,
227
+ },
228
+ // Modules
229
+ 'hljs-module': {
230
+ color: shadesOfPurpleColors.AccentCyan,
231
+ },
232
+ // Namespaces
233
+ 'hljs-namespace': {
234
+ color: shadesOfPurpleColors.LightBlue,
235
+ },
236
+ // Important annotations
237
+ 'hljs-important': {
238
+ color: shadesOfPurpleColors.AccentRed,
239
+ fontWeight: 'bold',
240
+ },
241
+ // Formulas (for LaTeX, etc.)
242
+ 'hljs-formula': {
243
+ color: shadesOfPurpleColors.AccentCyan,
244
+ fontStyle: 'italic',
245
+ },
246
+ // Language-specific additions
247
+ // Python decorators
248
+ 'hljs-decorator': {
249
+ color: additionalColors.AccentTeal,
250
+ fontWeight: 'bold',
251
+ },
252
+ // Ruby symbols
253
+ 'hljs-symbol.ruby': {
254
+ color: additionalColors.AccentPink,
255
+ },
256
+ // SQL keywords
257
+ 'hljs-keyword.sql': {
258
+ color: additionalColors.AccentOrange,
259
+ textTransform: 'uppercase',
260
+ },
261
+ // Markdown specific
262
+ 'hljs-section.markdown': {
263
+ color: shadesOfPurpleColors.AccentYellow,
264
+ fontWeight: 'bold',
265
+ },
266
+ // JSON keys
267
+ 'hljs-attr.json': {
268
+ color: shadesOfPurpleColors.AccentCyan,
269
+ },
270
+ // XML/HTML specific
271
+ 'hljs-tag .hljs-name': {
272
+ color: shadesOfPurpleColors.AccentRed,
273
+ },
274
+ 'hljs-tag .hljs-attr': {
275
+ color: additionalColors.AccentYellowAlt,
276
+ },
277
+ // Line highlighting (if line numbers are enabled)
278
+ 'hljs.hljs-line-numbers': {
279
+ borderRight: `1px solid ${shadesOfPurpleColors.Gray}`,
280
+ },
281
+ 'hljs.hljs-line-numbers .hljs-ln-numbers': {
282
+ color: shadesOfPurpleColors.Gray,
283
+ paddingRight: '1em',
284
+ },
285
+ 'hljs.hljs-line-numbers .hljs-ln-code': {
286
+ paddingLeft: '1em',
287
+ },
288
+ // Selection styling
289
+ 'hljs::selection': {
290
+ background: shadesOfPurpleColors.AccentBlue + '40', // 40 = 25% opacity
291
+ },
292
+ 'hljs ::-moz-selection': {
293
+ background: shadesOfPurpleColors.AccentBlue + '40',
294
+ },
295
+ // Highlighted lines (for emphasis)
296
+ 'hljs .hljs-highlight': {
297
+ background: shadesOfPurpleColors.AccentPurple + '20', // 20 = 12.5% opacity
298
+ display: 'block',
299
+ width: '100%',
300
+ },
301
+ }, shadesOfPurpleColors);
302
+ //# sourceMappingURL=shades-of-purple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shades-of-purple.js","sourceRoot":"","sources":["../../../../src/ui/themes/shades-of-purple.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,OAAO,EAAoB,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,oBAAoB,GAAgB;IACxC,IAAI,EAAE,MAAM;IACZ,4CAA4C;IAC5C,UAAU,EAAE,SAAS,EAAE,kBAAkB;IACzC,UAAU,EAAE,SAAS,EAAE,wCAAwC;IAC/D,SAAS,EAAE,SAAS,EAAE,2BAA2B;IACjD,UAAU,EAAE,SAAS,EAAE,0BAA0B;IACjD,YAAY,EAAE,SAAS,EAAE,yBAAyB;IAClD,UAAU,EAAE,SAAS,EAAE,QAAQ;IAC/B,WAAW,EAAE,SAAS,EAAE,0BAA0B;IAClD,YAAY,EAAE,SAAS,EAAE,qBAAqB;IAC9C,SAAS,EAAE,SAAS,EAAE,wBAAwB;IAC9C,OAAO,EAAE,SAAS,EAAE,uCAAuC;IAC3D,IAAI,EAAE,SAAS,EAAE,aAAa;IAC9B,cAAc,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CA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EAAE;QAChB,KAAK,EAAE,oBAAoB,CAAC,UAAU;KACvC;IAED,oBAAoB;IACpB,qBAAqB,EAAE;QACrB,KAAK,EAAE,oBAAoB,CAAC,SAAS;KACtC;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,gBAAgB,CAAC,eAAe;KACxC;IAED,kDAAkD;IAClD,wBAAwB,EAAE;QACxB,WAAW,EAAE,aAAa,oBAAoB,CAAC,IAAI,EAAE;KACtD;IACD,yCAAyC,EAAE;QACzC,KAAK,EAAE,oBAAoB,CAAC,IAAI;QAChC,YAAY,EAAE,KAAK;KACpB;IACD,sCAAsC,EAAE;QACtC,WAAW,EAAE,KAAK;KACnB;IAED,oBAAoB;IACpB,iBAAiB,EAAE;QACjB,UAAU,EAAE,oBAAoB,CAAC,UAAU,GAAG,IAAI,EAAE,mBAAmB;KACxE;IACD,uBAAuB,EAAE;QACvB,UAAU,EAAE,oBAAoB,CAAC,UAAU,GAAG,IAAI;KACnD;IAED,mCAAmC;IACnC,sBAAsB,EAAE;QACtB,UAAU,EAAE,oBAAoB,CAAC,YAAY,GAAG,IAAI,EAAE,qBAAqB;QAC3E,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,MAAM;KACd;CACF,EACD,oBAAoB,CACrB,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Theme, ThemeType, CustomTheme } from './theme.js';
7
+ export interface ThemeDisplay {
8
+ name: string;
9
+ type: ThemeType;
10
+ isCustom?: boolean;
11
+ }
12
+ export declare const DEFAULT_THEME: Theme;
13
+ declare class ThemeManager {
14
+ private readonly availableThemes;
15
+ private activeTheme;
16
+ private customThemes;
17
+ constructor();
18
+ /**
19
+ * Loads custom themes from settings.
20
+ * @param customThemesSettings Custom themes from settings.
21
+ */
22
+ loadCustomThemes(customThemesSettings?: Record<string, CustomTheme>): void;
23
+ /**
24
+ * Sets the active theme.
25
+ * @param themeName The name of the theme to set as active.
26
+ * @returns True if the theme was successfully set, false otherwise.
27
+ */
28
+ setActiveTheme(themeName: string | undefined): boolean;
29
+ /**
30
+ * Gets the currently active theme.
31
+ * @returns The active theme.
32
+ */
33
+ getActiveTheme(): Theme;
34
+ /**
35
+ * Gets a list of custom theme names.
36
+ * @returns Array of custom theme names.
37
+ */
38
+ getCustomThemeNames(): string[];
39
+ /**
40
+ * Checks if a theme name is a custom theme.
41
+ * @param themeName The theme name to check.
42
+ * @returns True if the theme is custom.
43
+ */
44
+ isCustomTheme(themeName: string): boolean;
45
+ /**
46
+ * Returns a list of available theme names.
47
+ */
48
+ getAvailableThemes(): ThemeDisplay[];
49
+ /**
50
+ * Gets a theme by name.
51
+ * @param themeName The name of the theme to get.
52
+ * @returns The theme if found, undefined otherwise.
53
+ */
54
+ getTheme(themeName: string): Theme | undefined;
55
+ findThemeByName(themeName: string | undefined): Theme | undefined;
56
+ }
57
+ export declare const themeManager: ThemeManager;
58
+ export {};
@@ -0,0 +1,179 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { AyuDark } from './ayu.js';
7
+ import { AyuLight } from './ayu-light.js';
8
+ import { AtomOneDark } from './atom-one-dark.js';
9
+ import { Dracula } from './dracula.js';
10
+ import { GitHubDark } from './github-dark.js';
11
+ import { GitHubLight } from './github-light.js';
12
+ import { GoogleCode } from './googlecode.js';
13
+ import { DefaultLight } from './default-light.js';
14
+ import { DefaultDark } from './default.js';
15
+ import { ShadesOfPurple } from './shades-of-purple.js';
16
+ import { XCode } from './xcode.js';
17
+ import { createCustomTheme, validateCustomTheme, } from './theme.js';
18
+ import { ANSI } from './ansi.js';
19
+ import { ANSILight } from './ansi-light.js';
20
+ import { NoColorTheme } from './no-color.js';
21
+ import process from 'node:process';
22
+ export const DEFAULT_THEME = DefaultDark;
23
+ class ThemeManager {
24
+ availableThemes;
25
+ activeTheme;
26
+ customThemes = new Map();
27
+ constructor() {
28
+ this.availableThemes = [
29
+ AyuDark,
30
+ AyuLight,
31
+ AtomOneDark,
32
+ Dracula,
33
+ DefaultLight,
34
+ DefaultDark,
35
+ GitHubDark,
36
+ GitHubLight,
37
+ GoogleCode,
38
+ ShadesOfPurple,
39
+ XCode,
40
+ ANSI,
41
+ ANSILight,
42
+ ];
43
+ this.activeTheme = DEFAULT_THEME;
44
+ }
45
+ /**
46
+ * Loads custom themes from settings.
47
+ * @param customThemesSettings Custom themes from settings.
48
+ */
49
+ loadCustomThemes(customThemesSettings) {
50
+ this.customThemes.clear();
51
+ if (!customThemesSettings) {
52
+ return;
53
+ }
54
+ for (const [name, customThemeConfig] of Object.entries(customThemesSettings)) {
55
+ const validation = validateCustomTheme(customThemeConfig);
56
+ if (validation.isValid) {
57
+ try {
58
+ const theme = createCustomTheme(customThemeConfig);
59
+ this.customThemes.set(name, theme);
60
+ }
61
+ catch (error) {
62
+ console.warn(`Failed to load custom theme "${name}":`, error);
63
+ }
64
+ }
65
+ else {
66
+ console.warn(`Invalid custom theme "${name}": ${validation.error}`);
67
+ }
68
+ }
69
+ // If the current active theme is a custom theme, keep it if still valid
70
+ if (this.activeTheme &&
71
+ this.activeTheme.type === 'custom' &&
72
+ this.customThemes.has(this.activeTheme.name)) {
73
+ this.activeTheme = this.customThemes.get(this.activeTheme.name);
74
+ }
75
+ }
76
+ /**
77
+ * Sets the active theme.
78
+ * @param themeName The name of the theme to set as active.
79
+ * @returns True if the theme was successfully set, false otherwise.
80
+ */
81
+ setActiveTheme(themeName) {
82
+ const theme = this.findThemeByName(themeName);
83
+ if (!theme) {
84
+ return false;
85
+ }
86
+ this.activeTheme = theme;
87
+ return true;
88
+ }
89
+ /**
90
+ * Gets the currently active theme.
91
+ * @returns The active theme.
92
+ */
93
+ getActiveTheme() {
94
+ if (process.env.NO_COLOR) {
95
+ return NoColorTheme;
96
+ }
97
+ // Ensure the active theme is always valid (fall back to default if not)
98
+ if (!this.activeTheme || !this.findThemeByName(this.activeTheme.name)) {
99
+ this.activeTheme = DEFAULT_THEME;
100
+ }
101
+ return this.activeTheme;
102
+ }
103
+ /**
104
+ * Gets a list of custom theme names.
105
+ * @returns Array of custom theme names.
106
+ */
107
+ getCustomThemeNames() {
108
+ return Array.from(this.customThemes.keys());
109
+ }
110
+ /**
111
+ * Checks if a theme name is a custom theme.
112
+ * @param themeName The theme name to check.
113
+ * @returns True if the theme is custom.
114
+ */
115
+ isCustomTheme(themeName) {
116
+ return this.customThemes.has(themeName);
117
+ }
118
+ /**
119
+ * Returns a list of available theme names.
120
+ */
121
+ getAvailableThemes() {
122
+ const builtInThemes = this.availableThemes.map((theme) => ({
123
+ name: theme.name,
124
+ type: theme.type,
125
+ isCustom: false,
126
+ }));
127
+ const customThemes = Array.from(this.customThemes.values()).map((theme) => ({
128
+ name: theme.name,
129
+ type: theme.type,
130
+ isCustom: true,
131
+ }));
132
+ const allThemes = [...builtInThemes, ...customThemes];
133
+ const sortedThemes = allThemes.sort((a, b) => {
134
+ const typeOrder = (type) => {
135
+ switch (type) {
136
+ case 'dark':
137
+ return 1;
138
+ case 'light':
139
+ return 2;
140
+ case 'ansi':
141
+ return 3;
142
+ case 'custom':
143
+ return 4; // Custom themes at the end
144
+ default:
145
+ return 5;
146
+ }
147
+ };
148
+ const typeComparison = typeOrder(a.type) - typeOrder(b.type);
149
+ if (typeComparison !== 0) {
150
+ return typeComparison;
151
+ }
152
+ return a.name.localeCompare(b.name);
153
+ });
154
+ return sortedThemes;
155
+ }
156
+ /**
157
+ * Gets a theme by name.
158
+ * @param themeName The name of the theme to get.
159
+ * @returns The theme if found, undefined otherwise.
160
+ */
161
+ getTheme(themeName) {
162
+ return this.findThemeByName(themeName);
163
+ }
164
+ findThemeByName(themeName) {
165
+ if (!themeName) {
166
+ return DEFAULT_THEME;
167
+ }
168
+ // First check built-in themes
169
+ const builtInTheme = this.availableThemes.find((theme) => theme.name === themeName);
170
+ if (builtInTheme) {
171
+ return builtInTheme;
172
+ }
173
+ // Then check custom themes
174
+ return this.customThemes.get(themeName);
175
+ }
176
+ }
177
+ // Export an instance of the ThemeManager
178
+ export const themeManager = new ThemeManager();
179
+ //# sourceMappingURL=theme-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-manager.js","sourceRoot":"","sources":["../../../../src/ui/themes/theme-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAIL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,OAAO,MAAM,cAAc,CAAC;AAQnC,MAAM,CAAC,MAAM,aAAa,GAAU,WAAW,CAAC;AAEhD,MAAM,YAAY;IACC,eAAe,CAAU;IAClC,WAAW,CAAQ;IACnB,YAAY,GAAuB,IAAI,GAAG,EAAE,CAAC;IAErD;QACE,IAAI,CAAC,eAA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MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CACpC,CAAC;QACF,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,2BAA2B;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { CSSProperties } from 'react';
7
+ export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom';
8
+ export interface ColorsTheme {
9
+ type: ThemeType;
10
+ Background: string;
11
+ Foreground: string;
12
+ LightBlue: string;
13
+ AccentBlue: string;
14
+ AccentPurple: string;
15
+ AccentCyan: string;
16
+ AccentGreen: string;
17
+ AccentYellow: string;
18
+ AccentRed: string;
19
+ Comment: string;
20
+ Gray: string;
21
+ GradientColors?: string[];
22
+ }
23
+ export interface CustomTheme extends ColorsTheme {
24
+ type: 'custom';
25
+ name: string;
26
+ }
27
+ export declare const lightTheme: ColorsTheme;
28
+ export declare const darkTheme: ColorsTheme;
29
+ export declare const ansiTheme: ColorsTheme;
30
+ export declare class Theme {
31
+ readonly name: string;
32
+ readonly type: ThemeType;
33
+ readonly colors: ColorsTheme;
34
+ /**
35
+ * The default foreground color for text when no specific highlight rule applies.
36
+ * This is an Ink-compatible color string (hex or name).
37
+ */
38
+ readonly defaultColor: string;
39
+ /**
40
+ * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword')
41
+ * to Ink-compatible color strings (hex or name).
42
+ */
43
+ protected readonly _colorMap: Readonly<Record<string, string>>;
44
+ /**
45
+ * Creates a new Theme instance.
46
+ * @param name The name of the theme.
47
+ * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
48
+ */
49
+ constructor(name: string, type: ThemeType, rawMappings: Record<string, CSSProperties>, colors: ColorsTheme);
50
+ /**
51
+ * Gets the Ink-compatible color string for a given highlight.js class name.
52
+ * @param hljsClass The highlight.js class name (e.g., 'hljs-keyword', 'hljs-string').
53
+ * @returns The corresponding Ink color string (hex or name) if it exists.
54
+ */
55
+ getInkColor(hljsClass: string): string | undefined;
56
+ /**
57
+ * Resolves a CSS color value (name or hex) into an Ink-compatible color string.
58
+ * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki').
59
+ * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable.
60
+ */
61
+ private static _resolveColor;
62
+ /**
63
+ * Builds the internal map from highlight.js class names to Ink-compatible color strings.
64
+ * This method is protected and primarily intended for use by the constructor.
65
+ * @param hljsTheme The raw CSSProperties mappings from a react-syntax-highlighter theme object.
66
+ * @returns An Ink-compatible theme map (Record<string, string>).
67
+ */
68
+ protected _buildColorMap(hljsTheme: Record<string, CSSProperties>): Record<string, string>;
69
+ }
70
+ /**
71
+ * Creates a Theme instance from a custom theme configuration.
72
+ * @param customTheme The custom theme configuration.
73
+ * @returns A new Theme instance.
74
+ */
75
+ export declare function createCustomTheme(customTheme: CustomTheme): Theme;
76
+ /**
77
+ * Validates a custom theme configuration.
78
+ * @param customTheme The custom theme to validate.
79
+ * @returns An object with isValid boolean and error message if invalid.
80
+ */
81
+ export declare function validateCustomTheme(customTheme: Partial<CustomTheme>): {
82
+ isValid: boolean;
83
+ error?: string;
84
+ };