@google/gemini-cli 0.1.1 → 0.1.3-rc.1

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 (391) hide show
  1. package/README.md +7 -6
  2. package/dist/.last_build +0 -0
  3. package/dist/google-gemini-cli-0.1.3.tgz +0 -0
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +20 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/package.json +74 -0
  8. package/dist/src/config/auth.d.ts +6 -0
  9. package/dist/src/config/auth.js +38 -0
  10. package/dist/src/config/auth.js.map +1 -0
  11. package/dist/src/config/config.d.ts +14 -0
  12. package/dist/src/config/config.js +225 -0
  13. package/dist/src/config/config.js.map +1 -0
  14. package/dist/src/config/extension.d.ts +19 -0
  15. package/dist/src/config/extension.js +81 -0
  16. package/dist/src/config/extension.js.map +1 -0
  17. package/dist/src/config/sandboxConfig.d.ts +13 -0
  18. package/dist/src/config/sandboxConfig.js +75 -0
  19. package/dist/src/config/sandboxConfig.js.map +1 -0
  20. package/dist/src/config/settings.d.ts +69 -0
  21. package/dist/src/config/settings.js +165 -0
  22. package/dist/src/config/settings.js.map +1 -0
  23. package/dist/src/gemini.d.ts +6 -0
  24. package/dist/src/gemini.js +212 -0
  25. package/dist/src/gemini.js.map +1 -0
  26. package/dist/src/gemini.test.d.ts +6 -0
  27. package/dist/src/gemini.test.js +122 -0
  28. package/dist/src/gemini.test.js.map +1 -0
  29. package/dist/src/generated/git-commit.d.ts +6 -0
  30. package/dist/src/generated/git-commit.js +9 -0
  31. package/dist/src/generated/git-commit.js.map +1 -0
  32. package/dist/src/nonInteractiveCli.d.ts +7 -0
  33. package/dist/src/nonInteractiveCli.js +112 -0
  34. package/dist/src/nonInteractiveCli.js.map +1 -0
  35. package/dist/src/ui/App.d.ts +14 -0
  36. package/dist/src/ui/App.js +398 -0
  37. package/dist/src/ui/App.js.map +1 -0
  38. package/dist/src/ui/App.test.d.ts +6 -0
  39. package/dist/src/ui/App.test.js +280 -0
  40. package/dist/src/ui/App.test.js.map +1 -0
  41. package/dist/src/ui/colors.d.ts +7 -0
  42. package/dist/src/ui/colors.js +48 -0
  43. package/dist/src/ui/colors.js.map +1 -0
  44. package/dist/src/ui/components/AboutBox.d.ts +14 -0
  45. package/dist/src/ui/components/AboutBox.js +6 -0
  46. package/dist/src/ui/components/AboutBox.js.map +1 -0
  47. package/dist/src/ui/components/AsciiArt.d.ts +7 -0
  48. package/dist/src/ui/components/AsciiArt.js +26 -0
  49. package/dist/src/ui/components/AsciiArt.js.map +1 -0
  50. package/dist/src/ui/components/AuthDialog.d.ts +15 -0
  51. package/dist/src/ui/components/AuthDialog.js +67 -0
  52. package/dist/src/ui/components/AuthDialog.js.map +1 -0
  53. package/dist/src/ui/components/AuthDialog.test.d.ts +6 -0
  54. package/dist/src/ui/components/AuthDialog.test.js +69 -0
  55. package/dist/src/ui/components/AuthDialog.test.js.map +1 -0
  56. package/dist/src/ui/components/AuthInProgress.d.ts +11 -0
  57. package/dist/src/ui/components/AuthInProgress.js +27 -0
  58. package/dist/src/ui/components/AuthInProgress.js.map +1 -0
  59. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
  60. package/dist/src/ui/components/AutoAcceptIndicator.js +26 -0
  61. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
  62. package/dist/src/ui/components/ConsolePatcher.d.ts +12 -0
  63. package/dist/src/ui/components/ConsolePatcher.js +40 -0
  64. package/dist/src/ui/components/ConsolePatcher.js.map +1 -0
  65. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
  66. package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
  67. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
  68. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +15 -0
  69. package/dist/src/ui/components/ContextSummaryDisplay.js +41 -0
  70. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
  71. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +14 -0
  72. package/dist/src/ui/components/DetailedMessagesDisplay.js +34 -0
  73. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
  74. package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
  75. package/dist/src/ui/components/EditorSettingsDialog.js +73 -0
  76. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
  77. package/dist/src/ui/components/Footer.d.ts +22 -0
  78. package/dist/src/ui/components/Footer.js +13 -0
  79. package/dist/src/ui/components/Footer.js.map +1 -0
  80. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +17 -0
  81. package/dist/src/ui/components/GeminiRespondingSpinner.js +16 -0
  82. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
  83. package/dist/src/ui/components/Header.d.ts +12 -0
  84. package/dist/src/ui/components/Header.js +20 -0
  85. package/dist/src/ui/components/Header.js.map +1 -0
  86. package/dist/src/ui/components/Help.d.ts +12 -0
  87. package/dist/src/ui/components/Help.js +7 -0
  88. package/dist/src/ui/components/Help.js.map +1 -0
  89. package/dist/src/ui/components/HistoryItemDisplay.d.ts +18 -0
  90. package/dist/src/ui/components/HistoryItemDisplay.js +15 -0
  91. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
  92. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
  93. package/dist/src/ui/components/HistoryItemDisplay.test.js +85 -0
  94. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
  95. package/dist/src/ui/components/InputPrompt.d.ts +24 -0
  96. package/dist/src/ui/components/InputPrompt.js +313 -0
  97. package/dist/src/ui/components/InputPrompt.js.map +1 -0
  98. package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
  99. package/dist/src/ui/components/InputPrompt.test.js +154 -0
  100. package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
  101. package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
  102. package/dist/src/ui/components/LoadingIndicator.js +19 -0
  103. package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
  104. package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
  105. package/dist/src/ui/components/LoadingIndicator.test.js +141 -0
  106. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
  107. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
  108. package/dist/src/ui/components/MemoryUsageDisplay.js +27 -0
  109. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
  110. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +13 -0
  111. package/dist/src/ui/components/SessionSummaryDisplay.js +20 -0
  112. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
  113. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
  114. package/dist/src/ui/components/SessionSummaryDisplay.test.js +41 -0
  115. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
  116. package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
  117. package/dist/src/ui/components/ShellModeIndicator.js +5 -0
  118. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
  119. package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
  120. package/dist/src/ui/components/ShowMoreLines.js +24 -0
  121. package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
  122. package/dist/src/ui/components/Stats.d.ts +39 -0
  123. package/dist/src/ui/components/Stats.js +23 -0
  124. package/dist/src/ui/components/Stats.js.map +1 -0
  125. package/dist/src/ui/components/Stats.test.d.ts +6 -0
  126. package/dist/src/ui/components/Stats.test.js +57 -0
  127. package/dist/src/ui/components/Stats.test.js.map +1 -0
  128. package/dist/src/ui/components/StatsDisplay.d.ts +14 -0
  129. package/dist/src/ui/components/StatsDisplay.js +28 -0
  130. package/dist/src/ui/components/StatsDisplay.js.map +1 -0
  131. package/dist/src/ui/components/StatsDisplay.test.d.ts +6 -0
  132. package/dist/src/ui/components/StatsDisplay.test.js +51 -0
  133. package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
  134. package/dist/src/ui/components/SuggestionsDisplay.d.ts +21 -0
  135. package/dist/src/ui/components/SuggestionsDisplay.js +32 -0
  136. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
  137. package/dist/src/ui/components/ThemeDialog.d.ts +19 -0
  138. package/dist/src/ui/components/ThemeDialog.js +126 -0
  139. package/dist/src/ui/components/ThemeDialog.js.map +1 -0
  140. package/dist/src/ui/components/Tips.d.ts +12 -0
  141. package/dist/src/ui/components/Tips.js +8 -0
  142. package/dist/src/ui/components/Tips.js.map +1 -0
  143. package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
  144. package/dist/src/ui/components/UpdateNotification.js +10 -0
  145. package/dist/src/ui/components/UpdateNotification.js.map +1 -0
  146. package/dist/src/ui/components/messages/CompressionMessage.d.ts +11 -0
  147. package/dist/src/ui/components/messages/CompressionMessage.js +16 -0
  148. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
  149. package/dist/src/ui/components/messages/DiffRenderer.d.ts +15 -0
  150. package/dist/src/ui/components/messages/DiffRenderer.js +212 -0
  151. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
  152. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
  153. package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
  154. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
  155. package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
  156. package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
  157. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
  158. package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
  159. package/dist/src/ui/components/messages/GeminiMessage.js +10 -0
  160. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
  161. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
  162. package/dist/src/ui/components/messages/GeminiMessageContent.js +15 -0
  163. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
  164. package/dist/src/ui/components/messages/InfoMessage.d.ts +11 -0
  165. package/dist/src/ui/components/messages/InfoMessage.js +9 -0
  166. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
  167. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +15 -0
  168. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +111 -0
  169. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
  170. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
  171. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +37 -0
  172. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
  173. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +18 -0
  174. package/dist/src/ui/components/messages/ToolGroupMessage.js +53 -0
  175. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
  176. package/dist/src/ui/components/messages/ToolMessage.d.ts +15 -0
  177. package/dist/src/ui/components/messages/ToolMessage.js +61 -0
  178. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
  179. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
  180. package/dist/src/ui/components/messages/ToolMessage.test.js +116 -0
  181. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
  182. package/dist/src/ui/components/messages/UserMessage.d.ts +11 -0
  183. package/dist/src/ui/components/messages/UserMessage.js +9 -0
  184. package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
  185. package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
  186. package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
  187. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
  188. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
  189. package/dist/src/ui/components/shared/MaxSizedBox.js +383 -0
  190. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
  191. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
  192. package/dist/src/ui/components/shared/MaxSizedBox.test.js +134 -0
  193. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
  194. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +41 -0
  195. package/dist/src/ui/components/shared/RadioButtonSelect.js +52 -0
  196. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
  197. package/dist/src/ui/components/shared/text-buffer.d.ts +121 -0
  198. package/dist/src/ui/components/shared/text-buffer.js +1147 -0
  199. package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
  200. package/dist/src/ui/constants.d.ts +8 -0
  201. package/dist/src/ui/constants.js +12 -0
  202. package/dist/src/ui/constants.js.map +1 -0
  203. package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
  204. package/dist/src/ui/contexts/OverflowContext.js +43 -0
  205. package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
  206. package/dist/src/ui/contexts/SessionContext.d.ts +35 -0
  207. package/dist/src/ui/contexts/SessionContext.js +132 -0
  208. package/dist/src/ui/contexts/SessionContext.js.map +1 -0
  209. package/dist/src/ui/contexts/SessionContext.test.d.ts +6 -0
  210. package/dist/src/ui/contexts/SessionContext.test.js +151 -0
  211. package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
  212. package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
  213. package/dist/src/ui/contexts/StreamingContext.js +15 -0
  214. package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
  215. package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
  216. package/dist/src/ui/editors/editorSettingsManager.js +50 -0
  217. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
  218. package/dist/src/ui/hooks/atCommandProcessor.d.ts +31 -0
  219. package/dist/src/ui/hooks/atCommandProcessor.js +312 -0
  220. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
  221. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +16 -0
  222. package/dist/src/ui/hooks/shellCommandProcessor.js +261 -0
  223. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
  224. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +31 -0
  225. package/dist/src/ui/hooks/slashCommandProcessor.js +922 -0
  226. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
  227. package/dist/src/ui/hooks/useAuthCommand.d.ts +15 -0
  228. package/dist/src/ui/hooks/useAuthCommand.js +65 -0
  229. package/dist/src/ui/hooks/useAuthCommand.js.map +1 -0
  230. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +10 -0
  231. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +37 -0
  232. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
  233. package/dist/src/ui/hooks/useCompletion.d.ts +21 -0
  234. package/dist/src/ui/hooks/useCompletion.js +321 -0
  235. package/dist/src/ui/hooks/useCompletion.js.map +1 -0
  236. package/dist/src/ui/hooks/useConsoleMessages.d.ts +12 -0
  237. package/dist/src/ui/hooks/useConsoleMessages.js +59 -0
  238. package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
  239. package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
  240. package/dist/src/ui/hooks/useEditorSettings.js +43 -0
  241. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
  242. package/dist/src/ui/hooks/useGeminiStream.d.ts +23 -0
  243. package/dist/src/ui/hooks/useGeminiStream.js +552 -0
  244. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
  245. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
  246. package/dist/src/ui/hooks/useGeminiStream.test.js +823 -0
  247. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
  248. package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
  249. package/dist/src/ui/hooks/useGitBranchName.js +61 -0
  250. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
  251. package/dist/src/ui/hooks/useHistoryManager.d.ts +22 -0
  252. package/dist/src/ui/hooks/useHistoryManager.js +72 -0
  253. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
  254. package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
  255. package/dist/src/ui/hooks/useInputHistory.js +84 -0
  256. package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
  257. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
  258. package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
  259. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
  260. package/dist/src/ui/hooks/useLogger.d.ts +10 -0
  261. package/dist/src/ui/hooks/useLogger.js +29 -0
  262. package/dist/src/ui/hooks/useLogger.js.map +1 -0
  263. package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
  264. package/dist/src/ui/hooks/usePhraseCycler.js +189 -0
  265. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
  266. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
  267. package/dist/src/ui/hooks/useReactToolScheduler.js +186 -0
  268. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
  269. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
  270. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
  271. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
  272. package/dist/src/ui/hooks/useShellHistory.d.ts +11 -0
  273. package/dist/src/ui/hooks/useShellHistory.js +89 -0
  274. package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
  275. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
  276. package/dist/src/ui/hooks/useShowMemoryCommand.js +58 -0
  277. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
  278. package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
  279. package/dist/src/ui/hooks/useStateAndRef.js +26 -0
  280. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
  281. package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
  282. package/dist/src/ui/hooks/useTerminalSize.js +27 -0
  283. package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
  284. package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
  285. package/dist/src/ui/hooks/useThemeCommand.js +78 -0
  286. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
  287. package/dist/src/ui/hooks/useTimer.d.ts +12 -0
  288. package/dist/src/ui/hooks/useTimer.js +58 -0
  289. package/dist/src/ui/hooks/useTimer.js.map +1 -0
  290. package/dist/src/ui/themes/ansi-light.d.ts +7 -0
  291. package/dist/src/ui/themes/ansi-light.js +139 -0
  292. package/dist/src/ui/themes/ansi-light.js.map +1 -0
  293. package/dist/src/ui/themes/ansi.d.ts +7 -0
  294. package/dist/src/ui/themes/ansi.js +149 -0
  295. package/dist/src/ui/themes/ansi.js.map +1 -0
  296. package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
  297. package/dist/src/ui/themes/atom-one-dark.js +136 -0
  298. package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
  299. package/dist/src/ui/themes/ayu-light.d.ts +7 -0
  300. package/dist/src/ui/themes/ayu-light.js +128 -0
  301. package/dist/src/ui/themes/ayu-light.js.map +1 -0
  302. package/dist/src/ui/themes/ayu.d.ts +7 -0
  303. package/dist/src/ui/themes/ayu.js +102 -0
  304. package/dist/src/ui/themes/ayu.js.map +1 -0
  305. package/dist/src/ui/themes/default-light.d.ts +7 -0
  306. package/dist/src/ui/themes/default-light.js +100 -0
  307. package/dist/src/ui/themes/default-light.js.map +1 -0
  308. package/dist/src/ui/themes/default.d.ts +7 -0
  309. package/dist/src/ui/themes/default.js +143 -0
  310. package/dist/src/ui/themes/default.js.map +1 -0
  311. package/dist/src/ui/themes/dracula.d.ts +7 -0
  312. package/dist/src/ui/themes/dracula.js +113 -0
  313. package/dist/src/ui/themes/dracula.js.map +1 -0
  314. package/dist/src/ui/themes/github-dark.d.ts +7 -0
  315. package/dist/src/ui/themes/github-dark.js +136 -0
  316. package/dist/src/ui/themes/github-dark.js.map +1 -0
  317. package/dist/src/ui/themes/github-light.d.ts +7 -0
  318. package/dist/src/ui/themes/github-light.js +138 -0
  319. package/dist/src/ui/themes/github-light.js.map +1 -0
  320. package/dist/src/ui/themes/googlecode.d.ts +7 -0
  321. package/dist/src/ui/themes/googlecode.js +135 -0
  322. package/dist/src/ui/themes/googlecode.js.map +1 -0
  323. package/dist/src/ui/themes/no-color.d.ts +7 -0
  324. package/dist/src/ui/themes/no-color.js +84 -0
  325. package/dist/src/ui/themes/no-color.js.map +1 -0
  326. package/dist/src/ui/themes/theme-manager.d.ts +33 -0
  327. package/dist/src/ui/themes/theme-manager.js +107 -0
  328. package/dist/src/ui/themes/theme-manager.js.map +1 -0
  329. package/dist/src/ui/themes/theme.d.ts +67 -0
  330. package/dist/src/ui/themes/theme.js +304 -0
  331. package/dist/src/ui/themes/theme.js.map +1 -0
  332. package/dist/src/ui/themes/xcode.d.ts +7 -0
  333. package/dist/src/ui/themes/xcode.js +143 -0
  334. package/dist/src/ui/themes/xcode.js.map +1 -0
  335. package/dist/src/ui/types.d.ts +149 -0
  336. package/dist/src/ui/types.js +41 -0
  337. package/dist/src/ui/types.js.map +1 -0
  338. package/dist/src/ui/utils/CodeColorizer.d.ts +14 -0
  339. package/dist/src/ui/utils/CodeColorizer.js +97 -0
  340. package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
  341. package/dist/src/ui/utils/MarkdownDisplay.d.ts +14 -0
  342. package/dist/src/ui/utils/MarkdownDisplay.js +221 -0
  343. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
  344. package/dist/src/ui/utils/commandUtils.d.ts +22 -0
  345. package/dist/src/ui/utils/commandUtils.js +25 -0
  346. package/dist/src/ui/utils/commandUtils.js.map +1 -0
  347. package/dist/src/ui/utils/errorParsing.d.ts +15 -0
  348. package/dist/src/ui/utils/errorParsing.js +80 -0
  349. package/dist/src/ui/utils/errorParsing.js.map +1 -0
  350. package/dist/src/ui/utils/formatters.d.ts +13 -0
  351. package/dist/src/ui/utils/formatters.js +56 -0
  352. package/dist/src/ui/utils/formatters.js.map +1 -0
  353. package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
  354. package/dist/src/ui/utils/markdownUtilities.js +110 -0
  355. package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
  356. package/dist/src/ui/utils/textUtils.d.ts +22 -0
  357. package/dist/src/ui/utils/textUtils.js +58 -0
  358. package/dist/src/ui/utils/textUtils.js.map +1 -0
  359. package/dist/src/ui/utils/updateCheck.d.ts +6 -0
  360. package/dist/src/ui/utils/updateCheck.js +34 -0
  361. package/dist/src/ui/utils/updateCheck.js.map +1 -0
  362. package/dist/src/utils/cleanup.d.ts +6 -0
  363. package/dist/src/utils/cleanup.js +19 -0
  364. package/dist/src/utils/cleanup.js.map +1 -0
  365. package/dist/src/utils/package.d.ts +12 -0
  366. package/dist/src/utils/package.js +24 -0
  367. package/dist/src/utils/package.js.map +1 -0
  368. package/dist/src/utils/readStdin.d.ts +6 -0
  369. package/dist/src/utils/readStdin.js +34 -0
  370. package/dist/src/utils/readStdin.js.map +1 -0
  371. package/dist/src/utils/sandbox.d.ts +7 -0
  372. package/dist/src/utils/sandbox.js +680 -0
  373. package/dist/src/utils/sandbox.js.map +1 -0
  374. package/dist/src/utils/startupWarnings.d.ts +6 -0
  375. package/dist/src/utils/startupWarnings.js +40 -0
  376. package/dist/src/utils/startupWarnings.js.map +1 -0
  377. package/dist/src/utils/version.d.ts +6 -0
  378. package/dist/src/utils/version.js +11 -0
  379. package/dist/src/utils/version.js.map +1 -0
  380. package/dist/tsconfig.tsbuildinfo +1 -0
  381. package/package.json +60 -71
  382. package/LICENSE +0 -202
  383. package/bundle/gemini.js +0 -257368
  384. package/bundle/shell.json +0 -18
  385. package/bundle/shell.md +0 -16
  386. /package/{bundle → dist/src/utils}/sandbox-macos-permissive-closed.sb +0 -0
  387. /package/{bundle → dist/src/utils}/sandbox-macos-permissive-open.sb +0 -0
  388. /package/{bundle → dist/src/utils}/sandbox-macos-permissive-proxied.sb +0 -0
  389. /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-closed.sb +0 -0
  390. /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-open.sb +0 -0
  391. /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-proxied.sb +0 -0
@@ -0,0 +1,383 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license
4
+ * Copyright 2025 Google LLC
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ import React, { Fragment, useEffect, useId } from 'react';
8
+ import { Box, Text } from 'ink';
9
+ import stringWidth from 'string-width';
10
+ import { Colors } from '../../colors.js';
11
+ import { toCodePoints } from '../../utils/textUtils.js';
12
+ import { useOverflowActions } from '../../contexts/OverflowContext.js';
13
+ let enableDebugLog = false;
14
+ /**
15
+ * Minimum height for the MaxSizedBox component.
16
+ * This ensures there is room for at least one line of content as well as the
17
+ * message that content was truncated.
18
+ */
19
+ export const MINIMUM_MAX_HEIGHT = 2;
20
+ export function setMaxSizedBoxDebugging(value) {
21
+ enableDebugLog = value;
22
+ }
23
+ function debugReportError(message, element) {
24
+ if (!enableDebugLog)
25
+ return;
26
+ if (!React.isValidElement(element)) {
27
+ console.error(message, `Invalid element: '${String(element)}' typeof=${typeof element}`);
28
+ return;
29
+ }
30
+ let sourceMessage = '<Unknown file>';
31
+ try {
32
+ const elementWithSource = element;
33
+ const fileName = elementWithSource._source?.fileName;
34
+ const lineNumber = elementWithSource._source?.lineNumber;
35
+ sourceMessage = fileName ? `${fileName}:${lineNumber}` : '<Unknown file>';
36
+ }
37
+ catch (error) {
38
+ console.error('Error while trying to get file name:', error);
39
+ }
40
+ console.error(message, `${String(element.type)}. Source: ${sourceMessage}`);
41
+ }
42
+ /**
43
+ * A React component that constrains the size of its children and provides
44
+ * content-aware truncation when the content exceeds the specified `maxHeight`.
45
+ *
46
+ * `MaxSizedBox` requires a specific structure for its children to correctly
47
+ * measure and render the content:
48
+ *
49
+ * 1. **Direct children must be `<Box>` elements.** Each `<Box>` represents a
50
+ * single row of content.
51
+ * 2. **Row `<Box>` elements must contain only `<Text>` elements.** These
52
+ * `<Text>` elements can be nested and there are no restrictions to Text
53
+ * element styling other than that non-wrapping text elements must be
54
+ * before wrapping text elements.
55
+ *
56
+ * **Constraints:**
57
+ * - **Box Properties:** Custom properties on the child `<Box>` elements are
58
+ * ignored. In debug mode, runtime checks will report errors for any
59
+ * unsupported properties.
60
+ * - **Text Wrapping:** Within a single row, `<Text>` elements with no wrapping
61
+ * (e.g., headers, labels) must appear before any `<Text>` elements that wrap.
62
+ * - **Element Types:** Runtime checks will warn if unsupported element types
63
+ * are used as children.
64
+ *
65
+ * @example
66
+ * <MaxSizedBox maxWidth={80} maxHeight={10}>
67
+ * <Box>
68
+ * <Text>This is the first line.</Text>
69
+ * </Box>
70
+ * <Box>
71
+ * <Text color="cyan" wrap="truncate">Non-wrapping Header: </Text>
72
+ * <Text>This is the rest of the line which will wrap if it's too long.</Text>
73
+ * </Box>
74
+ * <Box>
75
+ * <Text>
76
+ * Line 3 with <Text color="yellow">nested styled text</Text> inside of it.
77
+ * </Text>
78
+ * </Box>
79
+ * </MaxSizedBox>
80
+ */
81
+ export const MaxSizedBox = ({ children, maxWidth, maxHeight, overflowDirection = 'top', additionalHiddenLinesCount = 0, }) => {
82
+ const id = useId();
83
+ const { addOverflowingId, removeOverflowingId } = useOverflowActions() || {};
84
+ const laidOutStyledText = [];
85
+ const targetMaxHeight = Math.max(Math.round(maxHeight ?? Number.MAX_SAFE_INTEGER), MINIMUM_MAX_HEIGHT);
86
+ if (maxWidth === undefined) {
87
+ throw new Error('maxWidth must be defined when maxHeight is set.');
88
+ }
89
+ function visitRows(element) {
90
+ if (!React.isValidElement(element)) {
91
+ return;
92
+ }
93
+ if (element.type === Fragment) {
94
+ React.Children.forEach(element.props.children, visitRows);
95
+ return;
96
+ }
97
+ if (element.type === Box) {
98
+ layoutInkElementAsStyledText(element, maxWidth, laidOutStyledText);
99
+ return;
100
+ }
101
+ debugReportError('MaxSizedBox children must be <Box> elements', element);
102
+ }
103
+ React.Children.forEach(children, visitRows);
104
+ const contentWillOverflow = (targetMaxHeight !== undefined &&
105
+ laidOutStyledText.length > targetMaxHeight) ||
106
+ additionalHiddenLinesCount > 0;
107
+ const visibleContentHeight = contentWillOverflow && targetMaxHeight !== undefined
108
+ ? targetMaxHeight - 1
109
+ : targetMaxHeight;
110
+ const hiddenLinesCount = visibleContentHeight !== undefined
111
+ ? Math.max(0, laidOutStyledText.length - visibleContentHeight)
112
+ : 0;
113
+ const totalHiddenLines = hiddenLinesCount + additionalHiddenLinesCount;
114
+ useEffect(() => {
115
+ if (totalHiddenLines > 0) {
116
+ addOverflowingId?.(id);
117
+ }
118
+ else {
119
+ removeOverflowingId?.(id);
120
+ }
121
+ return () => {
122
+ removeOverflowingId?.(id);
123
+ };
124
+ }, [id, totalHiddenLines, addOverflowingId, removeOverflowingId]);
125
+ const visibleStyledText = hiddenLinesCount > 0
126
+ ? overflowDirection === 'top'
127
+ ? laidOutStyledText.slice(hiddenLinesCount, laidOutStyledText.length)
128
+ : laidOutStyledText.slice(0, visibleContentHeight)
129
+ : laidOutStyledText;
130
+ const visibleLines = visibleStyledText.map((line, index) => (_jsx(Box, { children: line.length > 0 ? (line.map((segment, segIndex) => (_jsx(Text, { ...segment.props, children: segment.text }, segIndex)))) : (_jsx(Text, { children: " " })) }, index)));
131
+ return (_jsxs(Box, { flexDirection: "column", width: maxWidth, flexShrink: 0, children: [totalHiddenLines > 0 && overflowDirection === 'top' && (_jsxs(Text, { color: Colors.Gray, wrap: "truncate", children: ["... first ", totalHiddenLines, " line", totalHiddenLines === 1 ? '' : 's', ' ', "hidden ..."] })), visibleLines, totalHiddenLines > 0 && overflowDirection === 'bottom' && (_jsxs(Text, { color: Colors.Gray, wrap: "truncate", children: ["... last ", totalHiddenLines, " line", totalHiddenLines === 1 ? '' : 's', ' ', "hidden ..."] }))] }));
132
+ };
133
+ /**
134
+ * Flattens the child elements of MaxSizedBox into an array of `Row` objects.
135
+ *
136
+ * This function expects a specific child structure to function correctly:
137
+ * 1. The top-level child of `MaxSizedBox` should be a single `<Box>`. This
138
+ * outer box is primarily for structure and is not directly rendered.
139
+ * 2. Inside the outer `<Box>`, there should be one or more children. Each of
140
+ * these children must be a `<Box>` that represents a row.
141
+ * 3. Inside each "row" `<Box>`, the children must be `<Text>` components.
142
+ *
143
+ * The structure should look like this:
144
+ * <MaxSizedBox>
145
+ * <Box> // Row 1
146
+ * <Text>...</Text>
147
+ * <Text>...</Text>
148
+ * </Box>
149
+ * <Box> // Row 2
150
+ * <Text>...</Text>
151
+ * </Box>
152
+ * </MaxSizedBox>
153
+ *
154
+ * It is an error for a <Text> child without wrapping to appear after a
155
+ * <Text> child with wrapping within the same row Box.
156
+ *
157
+ * @param element The React node to flatten.
158
+ * @returns An array of `Row` objects.
159
+ */
160
+ function visitBoxRow(element) {
161
+ if (!React.isValidElement(element) || element.type !== Box) {
162
+ debugReportError(`All children of MaxSizedBox must be <Box> elements`, element);
163
+ return {
164
+ noWrapSegments: [{ text: '<ERROR>', props: {} }],
165
+ segments: [],
166
+ };
167
+ }
168
+ if (enableDebugLog) {
169
+ const boxProps = element.props;
170
+ // Ensure the Box has no props other than the default ones and key.
171
+ let maxExpectedProps = 4;
172
+ if (boxProps.children !== undefined) {
173
+ // Allow the key prop, which is automatically added by React.
174
+ maxExpectedProps += 1;
175
+ }
176
+ if (boxProps.flexDirection !== 'row') {
177
+ debugReportError('MaxSizedBox children must have flexDirection="row".', element);
178
+ }
179
+ if (Object.keys(boxProps).length > maxExpectedProps) {
180
+ debugReportError(`Boxes inside MaxSizedBox must not have additional props. ${Object.keys(boxProps).join(', ')}`, element);
181
+ }
182
+ }
183
+ const row = {
184
+ noWrapSegments: [],
185
+ segments: [],
186
+ };
187
+ let hasSeenWrapped = false;
188
+ function visitRowChild(element, parentProps) {
189
+ if (element === null) {
190
+ return;
191
+ }
192
+ if (typeof element === 'string' || typeof element === 'number') {
193
+ const text = String(element);
194
+ // Ignore empty strings as they don't need to be rendered.
195
+ if (!text) {
196
+ return;
197
+ }
198
+ const segment = { text, props: parentProps ?? {} };
199
+ // Check the 'wrap' property from the merged props to decide the segment type.
200
+ if (parentProps === undefined || parentProps.wrap === 'wrap') {
201
+ hasSeenWrapped = true;
202
+ row.segments.push(segment);
203
+ }
204
+ else {
205
+ if (!hasSeenWrapped) {
206
+ row.noWrapSegments.push(segment);
207
+ }
208
+ else {
209
+ // put in in the wrapped segment as the row is already stuck in wrapped mode.
210
+ row.segments.push(segment);
211
+ debugReportError('Text elements without wrapping cannot appear after elements with wrapping in the same row.', element);
212
+ }
213
+ }
214
+ return;
215
+ }
216
+ if (!React.isValidElement(element)) {
217
+ debugReportError('Invalid element.', element);
218
+ return;
219
+ }
220
+ if (element.type === Fragment) {
221
+ const fragmentChildren = element.props.children;
222
+ React.Children.forEach(fragmentChildren, (child) => visitRowChild(child, parentProps));
223
+ return;
224
+ }
225
+ if (element.type !== Text) {
226
+ debugReportError('Children of a row Box must be <Text> elements.', element);
227
+ return;
228
+ }
229
+ // Merge props from parent <Text> elements. Child props take precedence.
230
+ const { children, ...currentProps } = element.props;
231
+ const mergedProps = parentProps === undefined
232
+ ? currentProps
233
+ : { ...parentProps, ...currentProps };
234
+ React.Children.forEach(children, (child) => visitRowChild(child, mergedProps));
235
+ }
236
+ React.Children.forEach(element.props.children, (child) => visitRowChild(child, undefined));
237
+ return row;
238
+ }
239
+ function layoutInkElementAsStyledText(element, maxWidth, output) {
240
+ const row = visitBoxRow(element);
241
+ if (row.segments.length === 0 && row.noWrapSegments.length === 0) {
242
+ // Return a single empty line if there are no segments to display
243
+ output.push([]);
244
+ return;
245
+ }
246
+ const lines = [];
247
+ const nonWrappingContent = [];
248
+ let noWrappingWidth = 0;
249
+ // First, lay out the non-wrapping segments
250
+ row.noWrapSegments.forEach((segment) => {
251
+ nonWrappingContent.push(segment);
252
+ noWrappingWidth += stringWidth(segment.text);
253
+ });
254
+ if (row.segments.length === 0) {
255
+ // This is a bit of a special case when there are no segments that allow
256
+ // wrapping. It would be ideal to unify.
257
+ const lines = [];
258
+ let currentLine = [];
259
+ nonWrappingContent.forEach((segment) => {
260
+ const textLines = segment.text.split('\n');
261
+ textLines.forEach((text, index) => {
262
+ if (index > 0) {
263
+ lines.push(currentLine);
264
+ currentLine = [];
265
+ }
266
+ if (text) {
267
+ currentLine.push({ text, props: segment.props });
268
+ }
269
+ });
270
+ });
271
+ if (currentLine.length > 0 ||
272
+ (nonWrappingContent.length > 0 &&
273
+ nonWrappingContent[nonWrappingContent.length - 1].text.endsWith('\n'))) {
274
+ lines.push(currentLine);
275
+ }
276
+ for (const line of lines) {
277
+ output.push(line);
278
+ }
279
+ return;
280
+ }
281
+ const availableWidth = maxWidth - noWrappingWidth;
282
+ if (availableWidth < 1) {
283
+ // No room to render the wrapping segments. TODO(jacob314): consider an alternative fallback strategy.
284
+ output.push(nonWrappingContent);
285
+ return;
286
+ }
287
+ // Now, lay out the wrapping segments
288
+ let wrappingPart = [];
289
+ let wrappingPartWidth = 0;
290
+ function addWrappingPartToLines() {
291
+ if (lines.length === 0) {
292
+ lines.push([...nonWrappingContent, ...wrappingPart]);
293
+ }
294
+ else {
295
+ if (noWrappingWidth > 0) {
296
+ lines.push([
297
+ ...[{ text: ' '.repeat(noWrappingWidth), props: {} }],
298
+ ...wrappingPart,
299
+ ]);
300
+ }
301
+ else {
302
+ lines.push(wrappingPart);
303
+ }
304
+ }
305
+ wrappingPart = [];
306
+ wrappingPartWidth = 0;
307
+ }
308
+ function addToWrappingPart(text, props) {
309
+ if (wrappingPart.length > 0 &&
310
+ wrappingPart[wrappingPart.length - 1].props === props) {
311
+ wrappingPart[wrappingPart.length - 1].text += text;
312
+ }
313
+ else {
314
+ wrappingPart.push({ text, props });
315
+ }
316
+ }
317
+ row.segments.forEach((segment) => {
318
+ const linesFromSegment = segment.text.split('\n');
319
+ linesFromSegment.forEach((lineText, lineIndex) => {
320
+ if (lineIndex > 0) {
321
+ addWrappingPartToLines();
322
+ }
323
+ const words = lineText.split(/(\s+)/); // Split by whitespace
324
+ words.forEach((word) => {
325
+ if (!word)
326
+ return;
327
+ const wordWidth = stringWidth(word);
328
+ if (wrappingPartWidth + wordWidth > availableWidth &&
329
+ wrappingPartWidth > 0) {
330
+ addWrappingPartToLines();
331
+ if (/^\s+$/.test(word)) {
332
+ return;
333
+ }
334
+ }
335
+ if (wordWidth > availableWidth) {
336
+ // Word is too long, needs to be split across lines
337
+ const wordAsCodePoints = toCodePoints(word);
338
+ let remainingWordAsCodePoints = wordAsCodePoints;
339
+ while (remainingWordAsCodePoints.length > 0) {
340
+ let splitIndex = 0;
341
+ let currentSplitWidth = 0;
342
+ for (const char of remainingWordAsCodePoints) {
343
+ const charWidth = stringWidth(char);
344
+ if (wrappingPartWidth + currentSplitWidth + charWidth >
345
+ availableWidth) {
346
+ break;
347
+ }
348
+ currentSplitWidth += charWidth;
349
+ splitIndex++;
350
+ }
351
+ if (splitIndex > 0) {
352
+ const part = remainingWordAsCodePoints
353
+ .slice(0, splitIndex)
354
+ .join('');
355
+ addToWrappingPart(part, segment.props);
356
+ wrappingPartWidth += stringWidth(part);
357
+ remainingWordAsCodePoints =
358
+ remainingWordAsCodePoints.slice(splitIndex);
359
+ }
360
+ if (remainingWordAsCodePoints.length > 0) {
361
+ addWrappingPartToLines();
362
+ }
363
+ }
364
+ }
365
+ else {
366
+ addToWrappingPart(word, segment.props);
367
+ wrappingPartWidth += wordWidth;
368
+ }
369
+ });
370
+ });
371
+ // Split omits a trailing newline, so we need to handle it here
372
+ if (segment.text.endsWith('\n')) {
373
+ addWrappingPartToLines();
374
+ }
375
+ });
376
+ if (wrappingPart.length > 0) {
377
+ addWrappingPartToLines();
378
+ }
379
+ for (const line of lines) {
380
+ output.push(line);
381
+ }
382
+ }
383
+ //# sourceMappingURL=MaxSizedBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MaxSizedBox.js","sourceRoot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AyB;iCACnC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;iCACpB,IAAI,CAAC,EAAE,CAAC,CAAC;4BACZ,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;4BACvC,iBAAiB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;4BACvC,yBAAyB;gCACvB,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;wBAChD,CAAC;wBAED,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACzC,sBAAsB,EAAE,CAAC;wBAC3B,CAAC;oBACH,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;oBACvC,iBAAiB,IAAI,SAAS,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,+DAA+D;QAC/D,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,sBAAsB,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,sBAAsB,EAAE,CAAC;IAC3B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export {};
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * @license
4
+ * Copyright 2025 Google LLC
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ import { render } from 'ink-testing-library';
8
+ import { OverflowProvider } from '../../contexts/OverflowContext.js';
9
+ import { MaxSizedBox, setMaxSizedBoxDebugging } from './MaxSizedBox.js';
10
+ import { Box, Text } from 'ink';
11
+ import { describe, it, expect } from 'vitest';
12
+ describe('<MaxSizedBox />', () => {
13
+ // Make sure MaxSizedBox logs errors on invalid configurations.
14
+ // This is useful for debugging issues with the component.
15
+ // It should be set to false in production for perfornance and to avoid
16
+ // cluttering the console if there are ignoreable issues.
17
+ setMaxSizedBoxDebugging(true);
18
+ it('renders children without truncation when they fit', () => {
19
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 80, maxHeight: 10, children: _jsx(Box, { children: _jsx(Text, { children: "Hello, World!" }) }) }) }));
20
+ expect(lastFrame()).equals('Hello, World!');
21
+ });
22
+ it('hides lines when content exceeds maxHeight', () => {
23
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 2, children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 3" }) })] }) }));
24
+ expect(lastFrame()).equals(`... first 2 lines hidden ...
25
+ Line 3`);
26
+ });
27
+ it('hides lines at the end when content exceeds maxHeight and overflowDirection is bottom', () => {
28
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 2, overflowDirection: "bottom", children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 3" }) })] }) }));
29
+ expect(lastFrame()).equals(`Line 1
30
+ ... last 2 lines hidden ...`);
31
+ });
32
+ it('wraps text that exceeds maxWidth', () => {
33
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 10, maxHeight: 5, children: _jsx(Box, { children: _jsx(Text, { wrap: "wrap", children: "This is a long line of text" }) }) }) }));
34
+ expect(lastFrame()).equals(`This is a
35
+ long line
36
+ of text`);
37
+ });
38
+ it('handles mixed wrapping and non-wrapping segments', () => {
39
+ const multilineText = `This part will wrap around.
40
+ And has a line break.
41
+ Leading spaces preserved.`;
42
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 20, maxHeight: 20, children: [_jsx(Box, { children: _jsx(Text, { children: "Example" }) }), _jsxs(Box, { children: [_jsx(Text, { children: "No Wrap: " }), _jsx(Text, { wrap: "wrap", children: multilineText })] }), _jsxs(Box, { children: [_jsx(Text, { children: "Longer No Wrap: " }), _jsx(Text, { wrap: "wrap", children: "This part will wrap around." })] })] }) }));
43
+ expect(lastFrame()).equals(`Example
44
+ No Wrap: This part
45
+ will wrap
46
+ around.
47
+ And has a
48
+ line break.
49
+ Leading
50
+ spaces
51
+ preserved.
52
+ Longer No Wrap: This
53
+ part
54
+ will
55
+ wrap
56
+ arou
57
+ nd.`);
58
+ });
59
+ it('handles words longer than maxWidth by splitting them', () => {
60
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 5, maxHeight: 5, children: _jsx(Box, { children: _jsx(Text, { wrap: "wrap", children: "Supercalifragilisticexpialidocious" }) }) }) }));
61
+ expect(lastFrame()).equals(`... …
62
+ istic
63
+ expia
64
+ lidoc
65
+ ious`);
66
+ });
67
+ it('does not truncate when maxHeight is undefined', () => {
68
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: undefined, children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) })] }) }));
69
+ expect(lastFrame()).equals(`Line 1
70
+ Line 2`);
71
+ });
72
+ it('shows plural "lines" when more than one line is hidden', () => {
73
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 2, children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 3" }) })] }) }));
74
+ expect(lastFrame()).equals(`... first 2 lines hidden ...
75
+ Line 3`);
76
+ });
77
+ it('shows plural "lines" when more than one line is hidden and overflowDirection is bottom', () => {
78
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 2, overflowDirection: "bottom", children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 3" }) })] }) }));
79
+ expect(lastFrame()).equals(`Line 1
80
+ ... last 2 lines hidden ...`);
81
+ });
82
+ it('renders an empty box for empty children', () => {
83
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 80, maxHeight: 10 }) }));
84
+ // Expect an empty string or a box with nothing in it.
85
+ // Ink renders an empty box as an empty string.
86
+ expect(lastFrame()).equals('');
87
+ });
88
+ it('wraps text with multi-byte unicode characters correctly', () => {
89
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 5, maxHeight: 5, children: _jsx(Box, { children: _jsx(Text, { wrap: "wrap", children: "\u4F60\u597D\u4E16\u754C" }) }) }) }));
90
+ // "你好" has a visual width of 4. "世界" has a visual width of 4.
91
+ // With maxWidth=5, it should wrap after the second character.
92
+ expect(lastFrame()).equals(`你好
93
+ 世界`);
94
+ });
95
+ it('wraps text with multi-byte emoji characters correctly', () => {
96
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 5, maxHeight: 5, children: _jsx(Box, { children: _jsx(Text, { wrap: "wrap", children: "\uD83D\uDC36\uD83D\uDC36\uD83D\uDC36\uD83D\uDC36\uD83D\uDC36" }) }) }) }));
97
+ // Each "🐶" has a visual width of 2.
98
+ // With maxWidth=5, it should wrap every 2 emojis.
99
+ expect(lastFrame()).equals(`🐶🐶
100
+ 🐶🐶
101
+ 🐶`);
102
+ });
103
+ it('accounts for additionalHiddenLinesCount', () => {
104
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 2, additionalHiddenLinesCount: 5, children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 3" }) })] }) }));
105
+ // 1 line is hidden by overflow, 5 are additionally hidden.
106
+ expect(lastFrame()).equals(`... first 7 lines hidden ...
107
+ Line 3`);
108
+ });
109
+ it('handles React.Fragment as a child', () => {
110
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsxs(MaxSizedBox, { maxWidth: 80, maxHeight: 10, children: [_jsxs(_Fragment, { children: [_jsx(Box, { children: _jsx(Text, { children: "Line 1 from Fragment" }) }), _jsx(Box, { children: _jsx(Text, { children: "Line 2 from Fragment" }) })] }), _jsx(Box, { children: _jsx(Text, { children: "Line 3 direct child" }) })] }) }));
111
+ expect(lastFrame()).equals(`Line 1 from Fragment
112
+ Line 2 from Fragment
113
+ Line 3 direct child`);
114
+ });
115
+ it('clips a long single text child from the top', () => {
116
+ const THIRTY_LINES = Array.from({ length: 30 }, (_, i) => `Line ${i + 1}`).join('\n');
117
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 80, maxHeight: 10, children: _jsx(Box, { children: _jsx(Text, { children: THIRTY_LINES }) }) }) }));
118
+ const expected = [
119
+ '... first 21 lines hidden ...',
120
+ ...Array.from({ length: 9 }, (_, i) => `Line ${22 + i}`),
121
+ ].join('\n');
122
+ expect(lastFrame()).equals(expected);
123
+ });
124
+ it('clips a long single text child from the bottom', () => {
125
+ const THIRTY_LINES = Array.from({ length: 30 }, (_, i) => `Line ${i + 1}`).join('\n');
126
+ const { lastFrame } = render(_jsx(OverflowProvider, { children: _jsx(MaxSizedBox, { maxWidth: 80, maxHeight: 10, overflowDirection: "bottom", children: _jsx(Box, { children: _jsx(Text, { children: THIRTY_LINES }) }) }) }));
127
+ const expected = [
128
+ ...Array.from({ length: 9 }, (_, i) => `Line ${i + 1}`),
129
+ '... last 21 lines hidden ...',
130
+ ].join('\n');
131
+ expect(lastFrame()).equals(expected);
132
+ });
133
+ });
134
+ //# sourceMappingURL=MaxSizedBox.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MaxSizedBox.test.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/MaxSizedBox.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,+DAA+D;IAC/D,0DAA0D;IAC1D,uEAAuE;IACvE,yDAAyD;IACzD,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAE9B,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,gBAAgB,cACf,KAAC,WAAW,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,YACtC,KAAC,GAAG,cACF,KAAC,IAAI,gCAAqB,GACtB,GACM,GACG,CACpB,CAAC;QACF,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,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AAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;SACzD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAC7B,EAAE,MAAM,EAAE,EAAE,EAAE,EACd,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAC1B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,gBAAgB,cACf,KAAC,WAAW,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,iBAAiB,EAAC,QAAQ,YAClE,KAAC,GAAG,cACF,KAAC,IAAI,cAAE,YAAY,GAAQ,GACvB,GACM,GACG,CACpB,CAAC;QAEF,MAAM,QAAQ,GAAG;YACf,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACvD,8BAA8B;SAC/B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import React from 'react';
7
+ /**
8
+ * Represents a single option for the RadioButtonSelect.
9
+ * Requires a label for display and a value to be returned on selection.
10
+ */
11
+ export interface RadioSelectItem<T> {
12
+ label: string;
13
+ value: T;
14
+ disabled?: boolean;
15
+ }
16
+ /**
17
+ * Props for the RadioButtonSelect component.
18
+ * @template T The type of the value associated with each radio item.
19
+ */
20
+ export interface RadioButtonSelectProps<T> {
21
+ /** An array of items to display as radio options. */
22
+ items: Array<RadioSelectItem<T> & {
23
+ themeNameDisplay?: string;
24
+ themeTypeDisplay?: string;
25
+ }>;
26
+ /** The initial index selected */
27
+ initialIndex?: number;
28
+ /** Function called when an item is selected. Receives the `value` of the selected item. */
29
+ onSelect: (value: T) => void;
30
+ /** Function called when an item is highlighted. Receives the `value` of the selected item. */
31
+ onHighlight?: (value: T) => void;
32
+ /** Whether this select input is currently focused and should respond to input. */
33
+ isFocused?: boolean;
34
+ }
35
+ /**
36
+ * A specialized SelectInput component styled to look like radio buttons.
37
+ * It uses '◉' for selected and '○' for unselected items.
38
+ *
39
+ * @template T The type of the value associated with each radio item.
40
+ */
41
+ export declare function RadioButtonSelect<T>({ items, initialIndex, onSelect, onHighlight, isFocused, }: RadioButtonSelectProps<T>): React.JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, Box } from 'ink';
3
+ import SelectInput from 'ink-select-input';
4
+ import { Colors } from '../../colors.js';
5
+ /**
6
+ * A specialized SelectInput component styled to look like radio buttons.
7
+ * It uses '◉' for selected and '○' for unselected items.
8
+ *
9
+ * @template T The type of the value associated with each radio item.
10
+ */
11
+ export function RadioButtonSelect({ items, initialIndex, onSelect, onHighlight, isFocused, // This prop indicates if the current RadioButtonSelect group is focused
12
+ }) {
13
+ const handleSelect = (item) => {
14
+ onSelect(item.value);
15
+ };
16
+ const handleHighlight = (item) => {
17
+ if (onHighlight) {
18
+ onHighlight(item.value);
19
+ }
20
+ };
21
+ /**
22
+ * Custom indicator component displaying radio button style (◉/○).
23
+ * Color changes based on whether the item is selected and if its group is focused.
24
+ */
25
+ function DynamicRadioIndicator({ isSelected = false, }) {
26
+ return (_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsx(Text, { color: isSelected ? Colors.AccentGreen : Colors.Foreground, children: isSelected ? '●' : '○' }) }));
27
+ }
28
+ /**
29
+ * Custom item component for displaying the label.
30
+ * Color changes based on whether the item is selected and if its group is focused.
31
+ * Now also handles displaying theme type with custom color.
32
+ */
33
+ function CustomThemeItemComponent(props) {
34
+ const { isSelected = false, label } = props;
35
+ const itemWithThemeProps = props;
36
+ let textColor = Colors.Foreground;
37
+ if (isSelected) {
38
+ textColor = Colors.AccentGreen;
39
+ }
40
+ else if (itemWithThemeProps.disabled === true) {
41
+ textColor = Colors.Gray;
42
+ }
43
+ if (itemWithThemeProps.themeNameDisplay &&
44
+ itemWithThemeProps.themeTypeDisplay) {
45
+ return (_jsxs(Text, { color: textColor, wrap: "truncate", children: [itemWithThemeProps.themeNameDisplay, ' ', _jsx(Text, { color: Colors.Gray, children: itemWithThemeProps.themeTypeDisplay })] }));
46
+ }
47
+ return (_jsx(Text, { color: textColor, wrap: "truncate", children: label }));
48
+ }
49
+ initialIndex = initialIndex ?? 0;
50
+ return (_jsx(SelectInput, { indicatorComponent: DynamicRadioIndicator, itemComponent: CustomThemeItemComponent, items: items, initialIndex: initialIndex, onSelect: handleSelect, onHighlight: handleHighlight, isFocused: isFocused }));
51
+ }
52
+ //# sourceMappingURL=RadioButtonSelect.js.map