@google/gemini-cli 0.1.9 → 0.1.10-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/package.json +4 -8
  2. package/LICENSE +0 -202
  3. package/README.md +0 -142
  4. package/dist/.last_build +0 -0
  5. package/dist/google-gemini-cli-0.1.9.tgz +0 -0
  6. package/dist/index.d.ts +0 -7
  7. package/dist/index.js +0 -20
  8. package/dist/index.js.map +0 -1
  9. package/dist/package.json +0 -81
  10. package/dist/src/config/auth.d.ts +0 -6
  11. package/dist/src/config/auth.js +0 -32
  12. package/dist/src/config/auth.js.map +0 -1
  13. package/dist/src/config/config.d.ts +0 -14
  14. package/dist/src/config/config.js +0 -235
  15. package/dist/src/config/config.js.map +0 -1
  16. package/dist/src/config/extension.d.ts +0 -20
  17. package/dist/src/config/extension.js +0 -81
  18. package/dist/src/config/extension.js.map +0 -1
  19. package/dist/src/config/sandboxConfig.d.ts +0 -13
  20. package/dist/src/config/sandboxConfig.js +0 -75
  21. package/dist/src/config/sandboxConfig.js.map +0 -1
  22. package/dist/src/config/settings.d.ts +0 -70
  23. package/dist/src/config/settings.js +0 -165
  24. package/dist/src/config/settings.js.map +0 -1
  25. package/dist/src/gemini.d.ts +0 -6
  26. package/dist/src/gemini.js +0 -217
  27. package/dist/src/gemini.js.map +0 -1
  28. package/dist/src/gemini.test.d.ts +0 -6
  29. package/dist/src/gemini.test.js +0 -122
  30. package/dist/src/gemini.test.js.map +0 -1
  31. package/dist/src/generated/git-commit.d.ts +0 -6
  32. package/dist/src/generated/git-commit.js +0 -9
  33. package/dist/src/generated/git-commit.js.map +0 -1
  34. package/dist/src/nonInteractiveCli.d.ts +0 -7
  35. package/dist/src/nonInteractiveCli.js +0 -115
  36. package/dist/src/nonInteractiveCli.js.map +0 -1
  37. package/dist/src/ui/App.d.ts +0 -14
  38. package/dist/src/ui/App.js +0 -387
  39. package/dist/src/ui/App.js.map +0 -1
  40. package/dist/src/ui/App.test.d.ts +0 -6
  41. package/dist/src/ui/App.test.js +0 -299
  42. package/dist/src/ui/App.test.js.map +0 -1
  43. package/dist/src/ui/colors.d.ts +0 -7
  44. package/dist/src/ui/colors.js +0 -48
  45. package/dist/src/ui/colors.js.map +0 -1
  46. package/dist/src/ui/components/AboutBox.d.ts +0 -16
  47. package/dist/src/ui/components/AboutBox.js +0 -6
  48. package/dist/src/ui/components/AboutBox.js.map +0 -1
  49. package/dist/src/ui/components/AsciiArt.d.ts +0 -7
  50. package/dist/src/ui/components/AsciiArt.js +0 -26
  51. package/dist/src/ui/components/AsciiArt.js.map +0 -1
  52. package/dist/src/ui/components/AuthDialog.d.ts +0 -15
  53. package/dist/src/ui/components/AuthDialog.js +0 -47
  54. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  55. package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
  56. package/dist/src/ui/components/AuthDialog.test.js +0 -69
  57. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  58. package/dist/src/ui/components/AuthInProgress.d.ts +0 -11
  59. package/dist/src/ui/components/AuthInProgress.js +0 -27
  60. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  61. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
  62. package/dist/src/ui/components/AutoAcceptIndicator.js +0 -26
  63. package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
  64. package/dist/src/ui/components/ConsolePatcher.d.ts +0 -12
  65. package/dist/src/ui/components/ConsolePatcher.js +0 -40
  66. package/dist/src/ui/components/ConsolePatcher.js.map +0 -1
  67. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
  68. package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
  69. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
  70. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -15
  71. package/dist/src/ui/components/ContextSummaryDisplay.js +0 -41
  72. package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
  73. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
  74. package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
  75. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
  76. package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -15
  77. package/dist/src/ui/components/EditorSettingsDialog.js +0 -73
  78. package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
  79. package/dist/src/ui/components/Footer.d.ts +0 -20
  80. package/dist/src/ui/components/Footer.js +0 -13
  81. package/dist/src/ui/components/Footer.js.map +0 -1
  82. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -17
  83. package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -16
  84. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
  85. package/dist/src/ui/components/Header.d.ts +0 -12
  86. package/dist/src/ui/components/Header.js +0 -20
  87. package/dist/src/ui/components/Header.js.map +0 -1
  88. package/dist/src/ui/components/Help.d.ts +0 -12
  89. package/dist/src/ui/components/Help.js +0 -9
  90. package/dist/src/ui/components/Help.js.map +0 -1
  91. package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -18
  92. package/dist/src/ui/components/HistoryItemDisplay.js +0 -17
  93. package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
  94. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  95. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -81
  96. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  97. package/dist/src/ui/components/InputPrompt.d.ts +0 -24
  98. package/dist/src/ui/components/InputPrompt.js +0 -331
  99. package/dist/src/ui/components/InputPrompt.js.map +0 -1
  100. package/dist/src/ui/components/InputPrompt.test.d.ts +0 -6
  101. package/dist/src/ui/components/InputPrompt.test.js +0 -154
  102. package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
  103. package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
  104. package/dist/src/ui/components/LoadingIndicator.js +0 -19
  105. package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
  106. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  107. package/dist/src/ui/components/LoadingIndicator.test.js +0 -141
  108. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  109. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
  110. package/dist/src/ui/components/MemoryUsageDisplay.js +0 -27
  111. package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
  112. package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
  113. package/dist/src/ui/components/ModelStatsDisplay.js +0 -33
  114. package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
  115. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
  116. package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -217
  117. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
  118. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
  119. package/dist/src/ui/components/SessionSummaryDisplay.js +0 -4
  120. package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
  121. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
  122. package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -60
  123. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
  124. package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
  125. package/dist/src/ui/components/ShellModeIndicator.js +0 -5
  126. package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
  127. package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
  128. package/dist/src/ui/components/ShowMoreLines.js +0 -24
  129. package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
  130. package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
  131. package/dist/src/ui/components/StatsDisplay.js +0 -42
  132. package/dist/src/ui/components/StatsDisplay.js.map +0 -1
  133. package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
  134. package/dist/src/ui/components/StatsDisplay.test.js +0 -275
  135. package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
  136. package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -21
  137. package/dist/src/ui/components/SuggestionsDisplay.js +0 -32
  138. package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
  139. package/dist/src/ui/components/ThemeDialog.d.ts +0 -19
  140. package/dist/src/ui/components/ThemeDialog.js +0 -126
  141. package/dist/src/ui/components/ThemeDialog.js.map +0 -1
  142. package/dist/src/ui/components/Tips.d.ts +0 -12
  143. package/dist/src/ui/components/Tips.js +0 -8
  144. package/dist/src/ui/components/Tips.js.map +0 -1
  145. package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
  146. package/dist/src/ui/components/ToolStatsDisplay.js +0 -41
  147. package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
  148. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
  149. package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -160
  150. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
  151. package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
  152. package/dist/src/ui/components/UpdateNotification.js +0 -10
  153. package/dist/src/ui/components/UpdateNotification.js.map +0 -1
  154. package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -11
  155. package/dist/src/ui/components/messages/CompressionMessage.js +0 -16
  156. package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
  157. package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -15
  158. package/dist/src/ui/components/messages/DiffRenderer.js +0 -212
  159. package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
  160. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  161. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
  162. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  163. package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
  164. package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
  165. package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
  166. package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
  167. package/dist/src/ui/components/messages/GeminiMessage.js +0 -10
  168. package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
  169. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
  170. package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
  171. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
  172. package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
  173. package/dist/src/ui/components/messages/InfoMessage.js +0 -9
  174. package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
  175. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -15
  176. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -111
  177. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
  178. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  179. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
  180. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  181. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -18
  182. package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -53
  183. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
  184. package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -15
  185. package/dist/src/ui/components/messages/ToolMessage.js +0 -61
  186. package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
  187. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  188. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -116
  189. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  190. package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
  191. package/dist/src/ui/components/messages/UserMessage.js +0 -9
  192. package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
  193. package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
  194. package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
  195. package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
  196. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
  197. package/dist/src/ui/components/shared/MaxSizedBox.js +0 -384
  198. package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
  199. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  200. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -134
  201. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  202. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -41
  203. package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -52
  204. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
  205. package/dist/src/ui/components/shared/text-buffer.d.ts +0 -128
  206. package/dist/src/ui/components/shared/text-buffer.js +0 -1122
  207. package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
  208. package/dist/src/ui/constants.d.ts +0 -8
  209. package/dist/src/ui/constants.js +0 -12
  210. package/dist/src/ui/constants.js.map +0 -1
  211. package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
  212. package/dist/src/ui/contexts/OverflowContext.js +0 -43
  213. package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
  214. package/dist/src/ui/contexts/SessionContext.d.ts +0 -33
  215. package/dist/src/ui/contexts/SessionContext.js +0 -49
  216. package/dist/src/ui/contexts/SessionContext.js.map +0 -1
  217. package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
  218. package/dist/src/ui/contexts/SessionContext.test.js +0 -96
  219. package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
  220. package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
  221. package/dist/src/ui/contexts/StreamingContext.js +0 -15
  222. package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
  223. package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
  224. package/dist/src/ui/editors/editorSettingsManager.js +0 -54
  225. package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
  226. package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
  227. package/dist/src/ui/hooks/atCommandProcessor.js +0 -312
  228. package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
  229. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -16
  230. package/dist/src/ui/hooks/shellCommandProcessor.js +0 -261
  231. package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
  232. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -31
  233. package/dist/src/ui/hooks/slashCommandProcessor.js +0 -965
  234. package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
  235. package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
  236. package/dist/src/ui/hooks/useAuthCommand.js +0 -54
  237. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  238. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -10
  239. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -37
  240. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
  241. package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
  242. package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
  243. package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
  244. package/dist/src/ui/hooks/useCompletion.d.ts +0 -21
  245. package/dist/src/ui/hooks/useCompletion.js +0 -322
  246. package/dist/src/ui/hooks/useCompletion.js.map +0 -1
  247. package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
  248. package/dist/src/ui/hooks/useConsoleMessages.js +0 -60
  249. package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
  250. package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
  251. package/dist/src/ui/hooks/useEditorSettings.js +0 -43
  252. package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
  253. package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -23
  254. package/dist/src/ui/hooks/useGeminiStream.js +0 -524
  255. package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
  256. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
  257. package/dist/src/ui/hooks/useGeminiStream.test.js +0 -775
  258. package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
  259. package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
  260. package/dist/src/ui/hooks/useGitBranchName.js +0 -61
  261. package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
  262. package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
  263. package/dist/src/ui/hooks/useHistoryManager.js +0 -72
  264. package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
  265. package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
  266. package/dist/src/ui/hooks/useInputHistory.js +0 -84
  267. package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
  268. package/dist/src/ui/hooks/useKeypress.d.ts +0 -29
  269. package/dist/src/ui/hooks/useKeypress.js +0 -86
  270. package/dist/src/ui/hooks/useKeypress.js.map +0 -1
  271. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
  272. package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
  273. package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
  274. package/dist/src/ui/hooks/useLogger.d.ts +0 -10
  275. package/dist/src/ui/hooks/useLogger.js +0 -29
  276. package/dist/src/ui/hooks/useLogger.js.map +0 -1
  277. package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
  278. package/dist/src/ui/hooks/usePhraseCycler.js +0 -189
  279. package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
  280. package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
  281. package/dist/src/ui/hooks/usePrivacySettings.js +0 -115
  282. package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
  283. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -33
  284. package/dist/src/ui/hooks/useReactToolScheduler.js +0 -186
  285. package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
  286. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
  287. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
  288. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
  289. package/dist/src/ui/hooks/useShellHistory.d.ts +0 -11
  290. package/dist/src/ui/hooks/useShellHistory.js +0 -89
  291. package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
  292. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
  293. package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
  294. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
  295. package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
  296. package/dist/src/ui/hooks/useStateAndRef.js +0 -26
  297. package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
  298. package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
  299. package/dist/src/ui/hooks/useTerminalSize.js +0 -27
  300. package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
  301. package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
  302. package/dist/src/ui/hooks/useThemeCommand.js +0 -78
  303. package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
  304. package/dist/src/ui/hooks/useTimer.d.ts +0 -12
  305. package/dist/src/ui/hooks/useTimer.js +0 -58
  306. package/dist/src/ui/hooks/useTimer.js.map +0 -1
  307. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
  308. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -40
  309. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
  310. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
  311. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -17
  312. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
  313. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
  314. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -17
  315. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
  316. package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
  317. package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
  318. package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
  319. package/dist/src/ui/themes/ansi-light.d.ts +0 -7
  320. package/dist/src/ui/themes/ansi-light.js +0 -139
  321. package/dist/src/ui/themes/ansi-light.js.map +0 -1
  322. package/dist/src/ui/themes/ansi.d.ts +0 -7
  323. package/dist/src/ui/themes/ansi.js +0 -149
  324. package/dist/src/ui/themes/ansi.js.map +0 -1
  325. package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
  326. package/dist/src/ui/themes/atom-one-dark.js +0 -136
  327. package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
  328. package/dist/src/ui/themes/ayu-light.d.ts +0 -7
  329. package/dist/src/ui/themes/ayu-light.js +0 -128
  330. package/dist/src/ui/themes/ayu-light.js.map +0 -1
  331. package/dist/src/ui/themes/ayu.d.ts +0 -7
  332. package/dist/src/ui/themes/ayu.js +0 -102
  333. package/dist/src/ui/themes/ayu.js.map +0 -1
  334. package/dist/src/ui/themes/default-light.d.ts +0 -7
  335. package/dist/src/ui/themes/default-light.js +0 -100
  336. package/dist/src/ui/themes/default-light.js.map +0 -1
  337. package/dist/src/ui/themes/default.d.ts +0 -7
  338. package/dist/src/ui/themes/default.js +0 -143
  339. package/dist/src/ui/themes/default.js.map +0 -1
  340. package/dist/src/ui/themes/dracula.d.ts +0 -7
  341. package/dist/src/ui/themes/dracula.js +0 -113
  342. package/dist/src/ui/themes/dracula.js.map +0 -1
  343. package/dist/src/ui/themes/github-dark.d.ts +0 -7
  344. package/dist/src/ui/themes/github-dark.js +0 -136
  345. package/dist/src/ui/themes/github-dark.js.map +0 -1
  346. package/dist/src/ui/themes/github-light.d.ts +0 -7
  347. package/dist/src/ui/themes/github-light.js +0 -138
  348. package/dist/src/ui/themes/github-light.js.map +0 -1
  349. package/dist/src/ui/themes/googlecode.d.ts +0 -7
  350. package/dist/src/ui/themes/googlecode.js +0 -135
  351. package/dist/src/ui/themes/googlecode.js.map +0 -1
  352. package/dist/src/ui/themes/no-color.d.ts +0 -7
  353. package/dist/src/ui/themes/no-color.js +0 -84
  354. package/dist/src/ui/themes/no-color.js.map +0 -1
  355. package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
  356. package/dist/src/ui/themes/shades-of-purple.js +0 -302
  357. package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
  358. package/dist/src/ui/themes/theme-manager.d.ts +0 -33
  359. package/dist/src/ui/themes/theme-manager.js +0 -109
  360. package/dist/src/ui/themes/theme-manager.js.map +0 -1
  361. package/dist/src/ui/themes/theme.d.ts +0 -67
  362. package/dist/src/ui/themes/theme.js +0 -304
  363. package/dist/src/ui/themes/theme.js.map +0 -1
  364. package/dist/src/ui/themes/xcode.d.ts +0 -7
  365. package/dist/src/ui/themes/xcode.js +0 -143
  366. package/dist/src/ui/themes/xcode.js.map +0 -1
  367. package/dist/src/ui/types.d.ts +0 -162
  368. package/dist/src/ui/types.js +0 -43
  369. package/dist/src/ui/types.js.map +0 -1
  370. package/dist/src/ui/utils/CodeColorizer.d.ts +0 -14
  371. package/dist/src/ui/utils/CodeColorizer.js +0 -97
  372. package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
  373. package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
  374. package/dist/src/ui/utils/MarkdownDisplay.js +0 -276
  375. package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
  376. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  377. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -176
  378. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
  379. package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
  380. package/dist/src/ui/utils/TableRenderer.js +0 -66
  381. package/dist/src/ui/utils/TableRenderer.js.map +0 -1
  382. package/dist/src/ui/utils/commandUtils.d.ts +0 -22
  383. package/dist/src/ui/utils/commandUtils.js +0 -25
  384. package/dist/src/ui/utils/commandUtils.js.map +0 -1
  385. package/dist/src/ui/utils/computeStats.d.ts +0 -10
  386. package/dist/src/ui/utils/computeStats.js +0 -55
  387. package/dist/src/ui/utils/computeStats.js.map +0 -1
  388. package/dist/src/ui/utils/displayUtils.d.ts +0 -17
  389. package/dist/src/ui/utils/displayUtils.js +0 -24
  390. package/dist/src/ui/utils/displayUtils.js.map +0 -1
  391. package/dist/src/ui/utils/errorParsing.d.ts +0 -15
  392. package/dist/src/ui/utils/errorParsing.js +0 -79
  393. package/dist/src/ui/utils/errorParsing.js.map +0 -1
  394. package/dist/src/ui/utils/formatters.d.ts +0 -13
  395. package/dist/src/ui/utils/formatters.js +0 -56
  396. package/dist/src/ui/utils/formatters.js.map +0 -1
  397. package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
  398. package/dist/src/ui/utils/markdownUtilities.js +0 -110
  399. package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
  400. package/dist/src/ui/utils/textUtils.d.ts +0 -22
  401. package/dist/src/ui/utils/textUtils.js +0 -58
  402. package/dist/src/ui/utils/textUtils.js.map +0 -1
  403. package/dist/src/ui/utils/updateCheck.d.ts +0 -6
  404. package/dist/src/ui/utils/updateCheck.js +0 -36
  405. package/dist/src/ui/utils/updateCheck.js.map +0 -1
  406. package/dist/src/utils/cleanup.d.ts +0 -6
  407. package/dist/src/utils/cleanup.js +0 -19
  408. package/dist/src/utils/cleanup.js.map +0 -1
  409. package/dist/src/utils/package.d.ts +0 -12
  410. package/dist/src/utils/package.js +0 -24
  411. package/dist/src/utils/package.js.map +0 -1
  412. package/dist/src/utils/readStdin.d.ts +0 -6
  413. package/dist/src/utils/readStdin.js +0 -34
  414. package/dist/src/utils/readStdin.js.map +0 -1
  415. package/dist/src/utils/sandbox-macos-permissive-closed.sb +0 -26
  416. package/dist/src/utils/sandbox-macos-permissive-open.sb +0 -19
  417. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +0 -31
  418. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +0 -87
  419. package/dist/src/utils/sandbox-macos-restrictive-open.sb +0 -90
  420. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +0 -92
  421. package/dist/src/utils/sandbox.d.ts +0 -7
  422. package/dist/src/utils/sandbox.js +0 -680
  423. package/dist/src/utils/sandbox.js.map +0 -1
  424. package/dist/src/utils/startupWarnings.d.ts +0 -6
  425. package/dist/src/utils/startupWarnings.js +0 -40
  426. package/dist/src/utils/startupWarnings.js.map +0 -1
  427. package/dist/src/utils/version.d.ts +0 -6
  428. package/dist/src/utils/version.js +0 -11
  429. package/dist/src/utils/version.js.map +0 -1
  430. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- interface ShowMoreLinesProps {
7
- constrainHeight: boolean;
8
- }
9
- export declare const ShowMoreLines: ({ constrainHeight }: ShowMoreLinesProps) => import("react/jsx-runtime").JSX.Element | null;
10
- export {};
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license
4
- * Copyright 2025 Google LLC
5
- * SPDX-License-Identifier: Apache-2.0
6
- */
7
- import { Box, Text } from 'ink';
8
- import { useOverflowState } from '../contexts/OverflowContext.js';
9
- import { useStreamingContext } from '../contexts/StreamingContext.js';
10
- import { StreamingState } from '../types.js';
11
- import { Colors } from '../colors.js';
12
- export const ShowMoreLines = ({ constrainHeight }) => {
13
- const overflowState = useOverflowState();
14
- const streamingState = useStreamingContext();
15
- if (overflowState === undefined ||
16
- overflowState.overflowingIds.size === 0 ||
17
- !constrainHeight ||
18
- !(streamingState === StreamingState.Idle ||
19
- streamingState === StreamingState.WaitingForConfirmation)) {
20
- return null;
21
- }
22
- return (_jsx(Box, { children: _jsx(Text, { color: Colors.Gray, wrap: "truncate", children: "Press ctrl-s to show more lines" }) }));
23
- };
24
- //# sourceMappingURL=ShowMoreLines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShowMoreLines.js","sourceRoot":"","sources":["../../../../src/ui/components/ShowMoreLines.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAMtC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,eAAe,EAAsB,EAAE,EAAE;IACvE,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,cAAc,GAAG,mBAAmB,EAAE,CAAC;IAE7C,IACE,aAAa,KAAK,SAAS;QAC3B,aAAa,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;QACvC,CAAC,eAAe;QAChB,CAAC,CACC,cAAc,KAAK,cAAc,CAAC,IAAI;YACtC,cAAc,KAAK,cAAc,CAAC,sBAAsB,CACzD,EACD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,UAAU,gDAElC,GACH,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import React from 'react';
7
- interface StatsDisplayProps {
8
- duration: string;
9
- title?: string;
10
- }
11
- export declare const StatsDisplay: React.FC<StatsDisplayProps>;
12
- export {};
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import Gradient from 'ink-gradient';
4
- import { Colors } from '../colors.js';
5
- import { formatDuration } from '../utils/formatters.js';
6
- import { useSessionStats } from '../contexts/SessionContext.js';
7
- import { getStatusColor, TOOL_SUCCESS_RATE_HIGH, TOOL_SUCCESS_RATE_MEDIUM, USER_AGREEMENT_RATE_HIGH, USER_AGREEMENT_RATE_MEDIUM, } from '../utils/displayUtils.js';
8
- import { computeSessionStats } from '../utils/computeStats.js';
9
- const StatRow = ({ title, children }) => (_jsxs(Box, { children: [_jsx(Box, { width: 28, children: _jsx(Text, { color: Colors.LightBlue, children: title }) }), children] }));
10
- const SubStatRow = ({ title, children }) => (_jsxs(Box, { paddingLeft: 2, children: [_jsx(Box, { width: 26, children: _jsxs(Text, { children: ["\u00BB ", title] }) }), children] }));
11
- const Section = ({ title, children }) => (_jsxs(Box, { flexDirection: "column", width: "100%", marginBottom: 1, children: [_jsx(Text, { bold: true, children: title }), children] }));
12
- const ModelUsageTable = ({ models, totalCachedTokens, cacheEfficiency }) => {
13
- const nameWidth = 25;
14
- const requestsWidth = 8;
15
- const inputTokensWidth = 15;
16
- const outputTokensWidth = 15;
17
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Box, { children: [_jsx(Box, { width: nameWidth, children: _jsx(Text, { bold: true, children: "Model Usage" }) }), _jsx(Box, { width: requestsWidth, justifyContent: "flex-end", children: _jsx(Text, { bold: true, children: "Reqs" }) }), _jsx(Box, { width: inputTokensWidth, justifyContent: "flex-end", children: _jsx(Text, { bold: true, children: "Input Tokens" }) }), _jsx(Box, { width: outputTokensWidth, justifyContent: "flex-end", children: _jsx(Text, { bold: true, children: "Output Tokens" }) })] }), _jsx(Box, { borderStyle: "round", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, width: nameWidth + requestsWidth + inputTokensWidth + outputTokensWidth }), Object.entries(models).map(([name, modelMetrics]) => (_jsxs(Box, { children: [_jsx(Box, { width: nameWidth, children: _jsx(Text, { children: name.replace('-001', '') }) }), _jsx(Box, { width: requestsWidth, justifyContent: "flex-end", children: _jsx(Text, { children: modelMetrics.api.totalRequests }) }), _jsx(Box, { width: inputTokensWidth, justifyContent: "flex-end", children: _jsx(Text, { color: Colors.AccentYellow, children: modelMetrics.tokens.prompt.toLocaleString() }) }), _jsx(Box, { width: outputTokensWidth, justifyContent: "flex-end", children: _jsx(Text, { color: Colors.AccentYellow, children: modelMetrics.tokens.candidates.toLocaleString() }) })] }, name))), cacheEfficiency > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: Colors.AccentGreen, children: "Savings Highlight:" }), ' ', totalCachedTokens.toLocaleString(), " (", cacheEfficiency.toFixed(1), "%) of input tokens were served from the cache, reducing costs."] }), _jsx(Box, { height: 1 }), _jsx(Text, { color: Colors.Gray, children: "\u00BB Tip: For a full token breakdown, run `/stats model`." })] }))] }));
18
- };
19
- export const StatsDisplay = ({ duration, title, }) => {
20
- const { stats } = useSessionStats();
21
- const { metrics } = stats;
22
- const { models, tools } = metrics;
23
- const computed = computeSessionStats(metrics);
24
- const successThresholds = {
25
- green: TOOL_SUCCESS_RATE_HIGH,
26
- yellow: TOOL_SUCCESS_RATE_MEDIUM,
27
- };
28
- const agreementThresholds = {
29
- green: USER_AGREEMENT_RATE_HIGH,
30
- yellow: USER_AGREEMENT_RATE_MEDIUM,
31
- };
32
- const successColor = getStatusColor(computed.successRate, successThresholds);
33
- const agreementColor = getStatusColor(computed.agreementRate, agreementThresholds);
34
- const renderTitle = () => {
35
- if (title) {
36
- return Colors.GradientColors && Colors.GradientColors.length > 0 ? (_jsx(Gradient, { colors: Colors.GradientColors, children: _jsx(Text, { bold: true, children: title }) })) : (_jsx(Text, { bold: true, color: Colors.AccentPurple, children: title }));
37
- }
38
- return (_jsx(Text, { bold: true, color: Colors.AccentPurple, children: "Session Stats" }));
39
- };
40
- return (_jsxs(Box, { borderStyle: "round", borderColor: Colors.Gray, flexDirection: "column", paddingY: 1, paddingX: 2, children: [renderTitle(), _jsx(Box, { height: 1 }), tools.totalCalls > 0 && (_jsxs(Section, { title: "Interaction Summary", children: [_jsx(StatRow, { title: "Tool Calls:", children: _jsxs(Text, { children: [tools.totalCalls, " (", ' ', _jsxs(Text, { color: Colors.AccentGreen, children: ["\u2714 ", tools.totalSuccess] }), ' ', _jsxs(Text, { color: Colors.AccentRed, children: ["\u2716 ", tools.totalFail] }), " )"] }) }), _jsx(StatRow, { title: "Success Rate:", children: _jsxs(Text, { color: successColor, children: [computed.successRate.toFixed(1), "%"] }) }), computed.totalDecisions > 0 && (_jsx(StatRow, { title: "User Agreement:", children: _jsxs(Text, { color: agreementColor, children: [computed.agreementRate.toFixed(1), "%", ' ', _jsxs(Text, { color: Colors.Gray, children: ["(", computed.totalDecisions, " reviewed)"] })] }) }))] })), _jsxs(Section, { title: "Performance", children: [_jsx(StatRow, { title: "Wall Time:", children: _jsx(Text, { children: duration }) }), _jsx(StatRow, { title: "Agent Active:", children: _jsx(Text, { children: formatDuration(computed.agentActiveTime) }) }), _jsx(SubStatRow, { title: "API Time:", children: _jsxs(Text, { children: [formatDuration(computed.totalApiTime), ' ', _jsxs(Text, { color: Colors.Gray, children: ["(", computed.apiTimePercent.toFixed(1), "%)"] })] }) }), _jsx(SubStatRow, { title: "Tool Time:", children: _jsxs(Text, { children: [formatDuration(computed.totalToolTime), ' ', _jsxs(Text, { color: Colors.Gray, children: ["(", computed.toolTimePercent.toFixed(1), "%)"] })] }) })] }), Object.keys(models).length > 0 && (_jsx(ModelUsageTable, { models: models, totalCachedTokens: computed.totalCachedTokens, cacheEfficiency: computed.cacheEfficiency }))] }));
41
- };
42
- //# sourceMappingURL=StatsDisplay.js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C,UAC/B,IACF,GACI,EACb,KAAC,UAAU,IAAC,KAAK,EAAC,YAAY,YAC5B,MAAC,IAAI,eACF,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,GAAG,EAC5C,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,kBACpB,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,UAChC,IACF,GACI,IACL,EAET,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CACjC,KAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,EAC7C,eAAe,EAAE,QAAQ,CAAC,eAAe,GACzC,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export {};
@@ -1,275 +0,0 @@
1
- import { jsx as _jsx } 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 { describe, it, expect, vi } from 'vitest';
9
- import { StatsDisplay } from './StatsDisplay.js';
10
- import * as SessionContext from '../contexts/SessionContext.js';
11
- // Mock the context to provide controlled data for testing
12
- vi.mock('../contexts/SessionContext.js', async (importOriginal) => {
13
- const actual = await importOriginal();
14
- return {
15
- ...actual,
16
- useSessionStats: vi.fn(),
17
- };
18
- });
19
- const useSessionStatsMock = vi.mocked(SessionContext.useSessionStats);
20
- const renderWithMockedStats = (metrics) => {
21
- useSessionStatsMock.mockReturnValue({
22
- stats: {
23
- sessionStartTime: new Date(),
24
- metrics,
25
- lastPromptTokenCount: 0,
26
- },
27
- });
28
- return render(_jsx(StatsDisplay, { duration: "1s" }));
29
- };
30
- describe('<StatsDisplay />', () => {
31
- it('renders only the Performance section in its zero state', () => {
32
- const zeroMetrics = {
33
- models: {},
34
- tools: {
35
- totalCalls: 0,
36
- totalSuccess: 0,
37
- totalFail: 0,
38
- totalDurationMs: 0,
39
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
40
- byName: {},
41
- },
42
- };
43
- const { lastFrame } = renderWithMockedStats(zeroMetrics);
44
- const output = lastFrame();
45
- expect(output).toContain('Performance');
46
- expect(output).not.toContain('Interaction Summary');
47
- expect(output).not.toContain('Efficiency & Optimizations');
48
- expect(output).not.toContain('Model'); // The table header
49
- expect(output).toMatchSnapshot();
50
- });
51
- it('renders a table with two models correctly', () => {
52
- const metrics = {
53
- models: {
54
- 'gemini-2.5-pro': {
55
- api: { totalRequests: 3, totalErrors: 0, totalLatencyMs: 15000 },
56
- tokens: {
57
- prompt: 1000,
58
- candidates: 2000,
59
- total: 43234,
60
- cached: 500,
61
- thoughts: 100,
62
- tool: 50,
63
- },
64
- },
65
- 'gemini-2.5-flash': {
66
- api: { totalRequests: 5, totalErrors: 1, totalLatencyMs: 4500 },
67
- tokens: {
68
- prompt: 25000,
69
- candidates: 15000,
70
- total: 150000000,
71
- cached: 10000,
72
- thoughts: 2000,
73
- tool: 1000,
74
- },
75
- },
76
- },
77
- tools: {
78
- totalCalls: 0,
79
- totalSuccess: 0,
80
- totalFail: 0,
81
- totalDurationMs: 0,
82
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
83
- byName: {},
84
- },
85
- };
86
- const { lastFrame } = renderWithMockedStats(metrics);
87
- const output = lastFrame();
88
- expect(output).toContain('gemini-2.5-pro');
89
- expect(output).toContain('gemini-2.5-flash');
90
- expect(output).toContain('1,000');
91
- expect(output).toContain('25,000');
92
- expect(output).toMatchSnapshot();
93
- });
94
- it('renders all sections when all data is present', () => {
95
- const metrics = {
96
- models: {
97
- 'gemini-2.5-pro': {
98
- api: { totalRequests: 1, totalErrors: 0, totalLatencyMs: 100 },
99
- tokens: {
100
- prompt: 100,
101
- candidates: 100,
102
- total: 250,
103
- cached: 50,
104
- thoughts: 0,
105
- tool: 0,
106
- },
107
- },
108
- },
109
- tools: {
110
- totalCalls: 2,
111
- totalSuccess: 1,
112
- totalFail: 1,
113
- totalDurationMs: 123,
114
- totalDecisions: { accept: 1, reject: 0, modify: 0 },
115
- byName: {
116
- 'test-tool': {
117
- count: 2,
118
- success: 1,
119
- fail: 1,
120
- durationMs: 123,
121
- decisions: { accept: 1, reject: 0, modify: 0 },
122
- },
123
- },
124
- },
125
- };
126
- const { lastFrame } = renderWithMockedStats(metrics);
127
- const output = lastFrame();
128
- expect(output).toContain('Performance');
129
- expect(output).toContain('Interaction Summary');
130
- expect(output).toContain('User Agreement');
131
- expect(output).toContain('Savings Highlight');
132
- expect(output).toContain('gemini-2.5-pro');
133
- expect(output).toMatchSnapshot();
134
- });
135
- describe('Conditional Rendering Tests', () => {
136
- it('hides User Agreement when no decisions are made', () => {
137
- const metrics = {
138
- models: {},
139
- tools: {
140
- totalCalls: 2,
141
- totalSuccess: 1,
142
- totalFail: 1,
143
- totalDurationMs: 123,
144
- totalDecisions: { accept: 0, reject: 0, modify: 0 }, // No decisions
145
- byName: {
146
- 'test-tool': {
147
- count: 2,
148
- success: 1,
149
- fail: 1,
150
- durationMs: 123,
151
- decisions: { accept: 0, reject: 0, modify: 0 },
152
- },
153
- },
154
- },
155
- };
156
- const { lastFrame } = renderWithMockedStats(metrics);
157
- const output = lastFrame();
158
- expect(output).toContain('Interaction Summary');
159
- expect(output).toContain('Success Rate');
160
- expect(output).not.toContain('User Agreement');
161
- expect(output).toMatchSnapshot();
162
- });
163
- it('hides Efficiency section when cache is not used', () => {
164
- const metrics = {
165
- models: {
166
- 'gemini-2.5-pro': {
167
- api: { totalRequests: 1, totalErrors: 0, totalLatencyMs: 100 },
168
- tokens: {
169
- prompt: 100,
170
- candidates: 100,
171
- total: 200,
172
- cached: 0,
173
- thoughts: 0,
174
- tool: 0,
175
- },
176
- },
177
- },
178
- tools: {
179
- totalCalls: 0,
180
- totalSuccess: 0,
181
- totalFail: 0,
182
- totalDurationMs: 0,
183
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
184
- byName: {},
185
- },
186
- };
187
- const { lastFrame } = renderWithMockedStats(metrics);
188
- const output = lastFrame();
189
- expect(output).not.toContain('Efficiency & Optimizations');
190
- expect(output).toMatchSnapshot();
191
- });
192
- });
193
- describe('Conditional Color Tests', () => {
194
- it('renders success rate in green for high values', () => {
195
- const metrics = {
196
- models: {},
197
- tools: {
198
- totalCalls: 10,
199
- totalSuccess: 10,
200
- totalFail: 0,
201
- totalDurationMs: 0,
202
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
203
- byName: {},
204
- },
205
- };
206
- const { lastFrame } = renderWithMockedStats(metrics);
207
- expect(lastFrame()).toMatchSnapshot();
208
- });
209
- it('renders success rate in yellow for medium values', () => {
210
- const metrics = {
211
- models: {},
212
- tools: {
213
- totalCalls: 10,
214
- totalSuccess: 9,
215
- totalFail: 1,
216
- totalDurationMs: 0,
217
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
218
- byName: {},
219
- },
220
- };
221
- const { lastFrame } = renderWithMockedStats(metrics);
222
- expect(lastFrame()).toMatchSnapshot();
223
- });
224
- it('renders success rate in red for low values', () => {
225
- const metrics = {
226
- models: {},
227
- tools: {
228
- totalCalls: 10,
229
- totalSuccess: 5,
230
- totalFail: 5,
231
- totalDurationMs: 0,
232
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
233
- byName: {},
234
- },
235
- };
236
- const { lastFrame } = renderWithMockedStats(metrics);
237
- expect(lastFrame()).toMatchSnapshot();
238
- });
239
- });
240
- describe('Title Rendering', () => {
241
- const zeroMetrics = {
242
- models: {},
243
- tools: {
244
- totalCalls: 0,
245
- totalSuccess: 0,
246
- totalFail: 0,
247
- totalDurationMs: 0,
248
- totalDecisions: { accept: 0, reject: 0, modify: 0 },
249
- byName: {},
250
- },
251
- };
252
- it('renders the default title when no title prop is provided', () => {
253
- const { lastFrame } = renderWithMockedStats(zeroMetrics);
254
- const output = lastFrame();
255
- expect(output).toContain('Session Stats');
256
- expect(output).not.toContain('Agent powering down');
257
- expect(output).toMatchSnapshot();
258
- });
259
- it('renders the custom title when a title prop is provided', () => {
260
- useSessionStatsMock.mockReturnValue({
261
- stats: {
262
- sessionStartTime: new Date(),
263
- metrics: zeroMetrics,
264
- lastPromptTokenCount: 0,
265
- },
266
- });
267
- const { lastFrame } = render(_jsx(StatsDisplay, { duration: "1s", title: "Agent powering down. Goodbye!" }));
268
- const output = lastFrame();
269
- expect(output).toContain('Agent powering down. Goodbye!');
270
- expect(output).not.toContain('Session Stats');
271
- expect(output).toMatchSnapshot();
272
- });
273
- });
274
- });
275
- //# sourceMappingURL=StatsDisplay.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatsDisplay.test.js","sourceRoot":"","sources":["../../../../src/ui/components/StatsDisplay.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAGhE,0DAA0D;AAC1D,EAAE,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,cAAc,EAAyB,CAAC;IAC7D,OAAO;QACL,GAAG,MAAM;QACT,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;KACzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAEtE,MAAM,qBAAqB,GAAG,CAAC,OAAuB,EAAE,EAAE;IACxD,mBAAmB,CAAC,eAAe,CAAC;QAClC,KAAK,EAA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AAC,+BAA+B,CAAC,CAAC;YAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export interface Suggestion {
7
- label: string;
8
- value: string;
9
- description?: string;
10
- }
11
- interface SuggestionsDisplayProps {
12
- suggestions: Suggestion[];
13
- activeIndex: number;
14
- isLoading: boolean;
15
- width: number;
16
- scrollOffset: number;
17
- userInput: string;
18
- }
19
- export declare const MAX_SUGGESTIONS_TO_SHOW = 8;
20
- export declare function SuggestionsDisplay({ suggestions, activeIndex, isLoading, width, scrollOffset, userInput, }: SuggestionsDisplayProps): import("react/jsx-runtime").JSX.Element | null;
21
- export {};
@@ -1,32 +0,0 @@
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 { Box, Text } from 'ink';
8
- import { Colors } from '../colors.js';
9
- export const MAX_SUGGESTIONS_TO_SHOW = 8;
10
- export function SuggestionsDisplay({ suggestions, activeIndex, isLoading, width, scrollOffset, userInput, }) {
11
- if (isLoading) {
12
- return (_jsx(Box, { paddingX: 1, width: width, children: _jsx(Text, { color: "gray", children: "Loading suggestions..." }) }));
13
- }
14
- if (suggestions.length === 0) {
15
- return null; // Don't render anything if there are no suggestions
16
- }
17
- // Calculate the visible slice based on scrollOffset
18
- const startIndex = scrollOffset;
19
- const endIndex = Math.min(scrollOffset + MAX_SUGGESTIONS_TO_SHOW, suggestions.length);
20
- const visibleSuggestions = suggestions.slice(startIndex, endIndex);
21
- return (_jsxs(Box, { flexDirection: "column", paddingX: 1, width: width, children: [scrollOffset > 0 && _jsx(Text, { color: Colors.Foreground, children: "\u25B2" }), visibleSuggestions.map((suggestion, index) => {
22
- const originalIndex = startIndex + index;
23
- const isActive = originalIndex === activeIndex;
24
- const textColor = isActive ? Colors.AccentPurple : Colors.Gray;
25
- return (_jsx(Box, { width: width, children: _jsxs(Box, { flexDirection: "row", children: [userInput.startsWith('/') ? (
26
- // only use box model for (/) command mode
27
- _jsx(Box, { width: 20, flexShrink: 0, children: _jsx(Text, { color: textColor, children: suggestion.label }) })) : (
28
- // use regular text for other modes (@ context)
29
- _jsx(Text, { color: textColor, children: suggestion.label })), suggestion.description ? (_jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: textColor, wrap: "wrap", children: suggestion.description }) })) : null] }) }, `${suggestion}-${originalIndex}`));
30
- }), endIndex < suggestions.length && _jsx(Text, { color: "gray", children: "\u25BC" }), suggestions.length > MAX_SUGGESTIONS_TO_SHOW && (_jsxs(Text, { color: "gray", children: ["(", activeIndex + 1, "/", suggestions.length, ")"] }))] }));
31
- }
32
- //# sourceMappingURL=SuggestionsDisplay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuggestionsDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/SuggestionsDisplay.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAetC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,MAAM,UAAU,kBAAkB,CAAC,EACjC,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,EACL,YAAY,EACZ,SAAS,GACe;IACxB,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,YAC5B,KAAC,IAAI,IAAC,KAAK,EAA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KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,UAAU,CAAC,KAAK,GAAQ,CAClD,EACA,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CACxB,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,YAChC,UAAU,CAAC,WAAW,GAClB,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,IAlBE,GAAG,UAAU,IAAI,aAAa,EAAE,CAmBpC,CACP,CAAC;YACJ,CAAC,CAAC,EACD,QAAQ,GAAG,WAAW,CAAC,MAAM,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,uBAAS,EAC5D,WAAW,CAAC,MAAM,GAAG,uBAAuB,IAAI,CAC/C,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBACd,WAAW,GAAG,CAAC,OAAG,WAAW,CAAC,MAAM,SACjC,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import React from 'react';
7
- import { LoadedSettings, SettingScope } from '../../config/settings.js';
8
- interface ThemeDialogProps {
9
- /** Callback function when a theme is selected */
10
- onSelect: (themeName: string | undefined, scope: SettingScope) => void;
11
- /** Callback function when a theme is highlighted */
12
- onHighlight: (themeName: string | undefined) => void;
13
- /** The settings object */
14
- settings: LoadedSettings;
15
- availableTerminalHeight?: number;
16
- terminalWidth: number;
17
- }
18
- export declare function ThemeDialog({ onSelect, onHighlight, settings, availableTerminalHeight, terminalWidth, }: ThemeDialogProps): React.JSX.Element;
19
- export {};
@@ -1,126 +0,0 @@
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 { useState } from 'react';
8
- import { Box, Text, useInput } from 'ink';
9
- import { Colors } from '../colors.js';
10
- import { themeManager, DEFAULT_THEME } from '../themes/theme-manager.js';
11
- import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
12
- import { DiffRenderer } from './messages/DiffRenderer.js';
13
- import { colorizeCode } from '../utils/CodeColorizer.js';
14
- import { SettingScope } from '../../config/settings.js';
15
- export function ThemeDialog({ onSelect, onHighlight, settings, availableTerminalHeight, terminalWidth, }) {
16
- const [selectedScope, setSelectedScope] = useState(SettingScope.User);
17
- // Generate theme items
18
- const themeItems = themeManager.getAvailableThemes().map((theme) => {
19
- const typeString = theme.type.charAt(0).toUpperCase() + theme.type.slice(1);
20
- return {
21
- label: theme.name,
22
- value: theme.name,
23
- themeNameDisplay: theme.name,
24
- themeTypeDisplay: typeString,
25
- };
26
- });
27
- const [selectInputKey, setSelectInputKey] = useState(Date.now());
28
- // Determine which radio button should be initially selected in the theme list
29
- // This should reflect the theme *saved* for the selected scope, or the default
30
- const initialThemeIndex = themeItems.findIndex((item) => item.value === (settings.merged.theme || DEFAULT_THEME.name));
31
- const scopeItems = [
32
- { label: 'User Settings', value: SettingScope.User },
33
- { label: 'Workspace Settings', value: SettingScope.Workspace },
34
- ];
35
- const handleThemeSelect = (themeName) => {
36
- onSelect(themeName, selectedScope);
37
- };
38
- const handleScopeHighlight = (scope) => {
39
- setSelectedScope(scope);
40
- setSelectInputKey(Date.now());
41
- };
42
- const handleScopeSelect = (scope) => {
43
- handleScopeHighlight(scope);
44
- setFocusedSection('theme'); // Reset focus to theme section
45
- };
46
- const [focusedSection, setFocusedSection] = useState('theme');
47
- useInput((input, key) => {
48
- if (key.tab) {
49
- setFocusedSection((prev) => (prev === 'theme' ? 'scope' : 'theme'));
50
- }
51
- if (key.escape) {
52
- onSelect(undefined, selectedScope);
53
- }
54
- });
55
- let otherScopeModifiedMessage = '';
56
- const otherScope = selectedScope === SettingScope.User
57
- ? SettingScope.Workspace
58
- : SettingScope.User;
59
- if (settings.forScope(otherScope).settings.theme !== undefined) {
60
- otherScopeModifiedMessage =
61
- settings.forScope(selectedScope).settings.theme !== undefined
62
- ? `(Also modified in ${otherScope})`
63
- : `(Modified in ${otherScope})`;
64
- }
65
- // Constants for calculating preview pane layout.
66
- // These values are based on the JSX structure below.
67
- const PREVIEW_PANE_WIDTH_PERCENTAGE = 0.55;
68
- // A safety margin to prevent text from touching the border.
69
- // This is a complete hack unrelated to the 0.9 used in App.tsx
70
- const PREVIEW_PANE_WIDTH_SAFETY_MARGIN = 0.9;
71
- // Combined horizontal padding from the dialog and preview pane.
72
- const TOTAL_HORIZONTAL_PADDING = 4;
73
- const colorizeCodeWidth = Math.max(Math.floor((terminalWidth - TOTAL_HORIZONTAL_PADDING) *
74
- PREVIEW_PANE_WIDTH_PERCENTAGE *
75
- PREVIEW_PANE_WIDTH_SAFETY_MARGIN), 1);
76
- const DAILOG_PADDING = 2;
77
- const selectThemeHeight = themeItems.length + 1;
78
- const SCOPE_SELECTION_HEIGHT = 4; // Height for the scope selection section + margin.
79
- const SPACE_BETWEEN_THEME_SELECTION_AND_APPLY_TO = 1;
80
- const TAB_TO_SELECT_HEIGHT = 2;
81
- availableTerminalHeight = availableTerminalHeight ?? Number.MAX_SAFE_INTEGER;
82
- availableTerminalHeight -= 2; // Top and bottom borders.
83
- availableTerminalHeight -= TAB_TO_SELECT_HEIGHT;
84
- let totalLeftHandSideHeight = DAILOG_PADDING +
85
- selectThemeHeight +
86
- SCOPE_SELECTION_HEIGHT +
87
- SPACE_BETWEEN_THEME_SELECTION_AND_APPLY_TO;
88
- let showScopeSelection = true;
89
- let includePadding = true;
90
- // Remove content from the LHS that can be omitted if it exceeds the available height.
91
- if (totalLeftHandSideHeight > availableTerminalHeight) {
92
- includePadding = false;
93
- totalLeftHandSideHeight -= DAILOG_PADDING;
94
- }
95
- if (totalLeftHandSideHeight > availableTerminalHeight) {
96
- // First, try hiding the scope selection
97
- totalLeftHandSideHeight -= SCOPE_SELECTION_HEIGHT;
98
- showScopeSelection = false;
99
- }
100
- // Don't focus the scope selection if it is hidden due to height constraints.
101
- const currenFocusedSection = !showScopeSelection ? 'theme' : focusedSection;
102
- // Vertical space taken by elements other than the two code blocks in the preview pane.
103
- // Includes "Preview" title, borders, and margin between blocks.
104
- const PREVIEW_PANE_FIXED_VERTICAL_SPACE = 8;
105
- // The right column doesn't need to ever be shorter than the left column.
106
- availableTerminalHeight = Math.max(availableTerminalHeight, totalLeftHandSideHeight);
107
- const availableTerminalHeightCodeBlock = availableTerminalHeight -
108
- PREVIEW_PANE_FIXED_VERTICAL_SPACE -
109
- (includePadding ? 2 : 0) * 2;
110
- // Give slightly more space to the code block as it is 3 lines longer.
111
- const diffHeight = Math.floor(availableTerminalHeightCodeBlock / 2) - 1;
112
- const codeBlockHeight = Math.ceil(availableTerminalHeightCodeBlock / 2) + 1;
113
- return (_jsxs(Box, { borderStyle: "round", borderColor: Colors.Gray, flexDirection: "column", paddingTop: includePadding ? 1 : 0, paddingBottom: includePadding ? 1 : 0, paddingLeft: 1, paddingRight: 1, width: "100%", children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Box, { flexDirection: "column", width: "45%", paddingRight: 2, children: [_jsxs(Text, { bold: currenFocusedSection === 'theme', wrap: "truncate", children: [currenFocusedSection === 'theme' ? '> ' : ' ', "Select Theme", ' ', _jsx(Text, { color: Colors.Gray, children: otherScopeModifiedMessage })] }), _jsx(RadioButtonSelect, { items: themeItems, initialIndex: initialThemeIndex, onSelect: handleThemeSelect, onHighlight: onHighlight, isFocused: currenFocusedSection === 'theme' }, selectInputKey), showScopeSelection && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { bold: currenFocusedSection === 'scope', wrap: "truncate", children: [currenFocusedSection === 'scope' ? '> ' : ' ', "Apply To"] }), _jsx(RadioButtonSelect, { items: scopeItems, initialIndex: 0, onSelect: handleScopeSelect, onHighlight: handleScopeHighlight, isFocused: currenFocusedSection === 'scope' })] }))] }), _jsxs(Box, { flexDirection: "column", width: "55%", paddingLeft: 2, children: [_jsx(Text, { bold: true, children: "Preview" }), _jsxs(Box, { borderStyle: "single", borderColor: Colors.Gray, paddingTop: includePadding ? 1 : 0, paddingBottom: includePadding ? 1 : 0, paddingLeft: 1, paddingRight: 1, flexDirection: "column", children: [colorizeCode(`# function
114
- -def fibonacci(n):
115
- - a, b = 0, 1
116
- - for _ in range(n):
117
- - a, b = b, a + b
118
- - return a`, 'python', codeBlockHeight, colorizeCodeWidth), _jsx(Box, { marginTop: 1 }), _jsx(DiffRenderer, { diffContent: `--- a/old_file.txt
119
- -+++ b/new_file.txt
120
- -@@ -1,4 +1,5 @@
121
- - This is a context line.
122
- --This line was deleted.
123
- -+This line was added.
124
- -`, availableTerminalHeight: diffHeight, terminalWidth: colorizeCodeWidth })] })] })] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: Colors.Gray, wrap: "truncate", children: ["(Use Enter to select", showScopeSelection ? ', Tab to change focus' : '', ")"] }) })] }));
125
- }
126
- //# sourceMappingURL=ThemeDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/ThemeDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAkB,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAcxE,MAAM,UAAU,WAAW,CAA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