@rdmind/rdmind 0.0.15-alpha.1 → 0.0.15-alpha.2

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 (773) hide show
  1. package/dist/package.json +15 -10
  2. package/dist/src/commands/extensions/disable.d.ts +2 -3
  3. package/dist/src/commands/extensions/disable.js +20 -6
  4. package/dist/src/commands/extensions/disable.js.map +1 -1
  5. package/dist/src/commands/extensions/enable.d.ts +2 -3
  6. package/dist/src/commands/extensions/enable.js +21 -10
  7. package/dist/src/commands/extensions/enable.js.map +1 -1
  8. package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
  9. package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
  10. package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
  11. package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
  12. package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
  13. package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
  14. package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
  15. package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
  16. package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
  17. package/dist/src/commands/extensions/install.d.ts +3 -2
  18. package/dist/src/commands/extensions/install.js +47 -17
  19. package/dist/src/commands/extensions/install.js.map +1 -1
  20. package/dist/src/commands/extensions/install.test.js +86 -9
  21. package/dist/src/commands/extensions/install.test.js.map +1 -1
  22. package/dist/src/commands/extensions/link.d.ts +12 -0
  23. package/dist/src/commands/extensions/link.js +37 -0
  24. package/dist/src/commands/extensions/link.js.map +1 -0
  25. package/dist/src/commands/extensions/list.js +1 -1
  26. package/dist/src/commands/extensions/list.js.map +1 -1
  27. package/dist/src/commands/extensions/new.d.ts +7 -0
  28. package/dist/src/commands/extensions/new.js +90 -0
  29. package/dist/src/commands/extensions/new.js.map +1 -0
  30. package/dist/src/commands/extensions/new.test.js +59 -0
  31. package/dist/src/commands/extensions/new.test.js.map +1 -0
  32. package/dist/src/commands/extensions/uninstall.js +1 -1
  33. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  34. package/dist/src/commands/extensions/uninstall.test.js +2 -2
  35. package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
  36. package/dist/src/commands/extensions/update.d.ts +2 -1
  37. package/dist/src/commands/extensions/update.js +80 -14
  38. package/dist/src/commands/extensions/update.js.map +1 -1
  39. package/dist/src/commands/extensions.js +4 -0
  40. package/dist/src/commands/extensions.js.map +1 -1
  41. package/dist/src/commands/mcp/add.js +6 -1
  42. package/dist/src/commands/mcp/add.js.map +1 -1
  43. package/dist/src/commands/mcp/list.js +4 -3
  44. package/dist/src/commands/mcp/list.js.map +1 -1
  45. package/dist/src/commands/mcp/remove.js +1 -1
  46. package/dist/src/commands/mcp/remove.js.map +1 -1
  47. package/dist/src/config/auth.d.ts +1 -1
  48. package/dist/src/config/auth.js +4 -4
  49. package/dist/src/config/auth.js.map +1 -1
  50. package/dist/src/config/auth.test.js +15 -7
  51. package/dist/src/config/auth.test.js.map +1 -1
  52. package/dist/src/config/config.d.ts +7 -2
  53. package/dist/src/config/config.js +178 -122
  54. package/dist/src/config/config.js.map +1 -1
  55. package/dist/src/config/extension.d.ts +39 -16
  56. package/dist/src/config/extension.js +349 -192
  57. package/dist/src/config/extension.js.map +1 -1
  58. package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
  59. package/dist/src/config/extensions/extensionEnablement.js +189 -0
  60. package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
  61. package/dist/src/{ui/components/ModelSelectionDialog.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +1 -1
  62. package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
  63. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
  64. package/dist/src/config/extensions/github.d.ts +30 -0
  65. package/dist/src/config/extensions/github.js +322 -0
  66. package/dist/src/config/extensions/github.js.map +1 -0
  67. package/dist/src/config/extensions/github.test.d.ts +6 -0
  68. package/dist/src/config/extensions/github.test.js +334 -0
  69. package/dist/src/config/extensions/github.test.js.map +1 -0
  70. package/dist/src/config/extensions/update.d.ts +19 -0
  71. package/dist/src/config/extensions/update.js +113 -0
  72. package/dist/src/config/extensions/update.js.map +1 -0
  73. package/dist/src/config/extensions/update.test.d.ts +6 -0
  74. package/dist/src/config/extensions/update.test.js +342 -0
  75. package/dist/src/config/extensions/update.test.js.map +1 -0
  76. package/dist/src/config/extensions/variableSchema.d.ts +8 -0
  77. package/dist/src/config/extensions/variableSchema.js +4 -0
  78. package/dist/src/config/extensions/variableSchema.js.map +1 -1
  79. package/dist/src/config/keyBindings.d.ts +5 -1
  80. package/dist/src/config/keyBindings.js +14 -25
  81. package/dist/src/config/keyBindings.js.map +1 -1
  82. package/dist/src/config/settings.d.ts +8 -5
  83. package/dist/src/config/settings.js +178 -275
  84. package/dist/src/config/settings.js.map +1 -1
  85. package/dist/src/config/settingsSchema.d.ts +332 -141
  86. package/dist/src/config/settingsSchema.js +321 -153
  87. package/dist/src/config/settingsSchema.js.map +1 -1
  88. package/dist/src/config/settingsSchema.test.js +64 -57
  89. package/dist/src/config/settingsSchema.test.js.map +1 -1
  90. package/dist/src/config/trustedFolders.d.ts +23 -4
  91. package/dist/src/config/trustedFolders.js +97 -47
  92. package/dist/src/config/trustedFolders.js.map +1 -1
  93. package/dist/src/config/trustedFolders.test.js +196 -20
  94. package/dist/src/config/trustedFolders.test.js.map +1 -1
  95. package/dist/src/core/auth.d.ts +13 -0
  96. package/dist/src/core/auth.js +27 -0
  97. package/dist/src/core/auth.js.map +1 -0
  98. package/dist/src/core/initializer.d.ts +21 -0
  99. package/dist/src/core/initializer.js +33 -0
  100. package/dist/src/core/initializer.js.map +1 -0
  101. package/dist/src/core/theme.d.ts +12 -0
  102. package/dist/src/core/theme.js +20 -0
  103. package/dist/src/core/theme.js.map +1 -0
  104. package/dist/src/gemini.d.ts +3 -2
  105. package/dist/src/gemini.js +156 -128
  106. package/dist/src/gemini.js.map +1 -1
  107. package/dist/src/gemini.test.js +190 -47
  108. package/dist/src/gemini.test.js.map +1 -1
  109. package/dist/src/generated/git-commit.d.ts +2 -2
  110. package/dist/src/generated/git-commit.js +2 -2
  111. package/dist/src/nonInteractiveCli.d.ts +2 -1
  112. package/dist/src/nonInteractiveCli.js +101 -72
  113. package/dist/src/nonInteractiveCli.js.map +1 -1
  114. package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
  115. package/dist/src/nonInteractiveCliCommands.js +79 -0
  116. package/dist/src/nonInteractiveCliCommands.js.map +1 -0
  117. package/dist/src/services/BuiltinCommandLoader.js +1 -1
  118. package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
  119. package/dist/src/services/BuiltinCommandLoader.test.js +30 -18
  120. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
  121. package/dist/src/services/FileCommandLoader.d.ts +2 -0
  122. package/dist/src/services/FileCommandLoader.js +7 -0
  123. package/dist/src/services/FileCommandLoader.js.map +1 -1
  124. package/dist/src/services/McpPromptLoader.js +43 -8
  125. package/dist/src/services/McpPromptLoader.js.map +1 -1
  126. package/dist/src/services/McpPromptLoader.test.js +228 -1
  127. package/dist/src/services/McpPromptLoader.test.js.map +1 -1
  128. package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
  129. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
  130. package/dist/src/test-utils/createExtension.d.ts +15 -0
  131. package/dist/src/test-utils/createExtension.js +25 -0
  132. package/dist/src/test-utils/createExtension.js.map +1 -0
  133. package/dist/src/test-utils/mockCommandContext.js +2 -0
  134. package/dist/src/test-utils/mockCommandContext.js.map +1 -1
  135. package/dist/src/test-utils/render.d.ts +5 -1
  136. package/dist/src/test-utils/render.js +5 -1
  137. package/dist/src/test-utils/render.js.map +1 -1
  138. package/dist/src/ui/App.d.ts +1 -10
  139. package/dist/src/ui/App.js +26 -834
  140. package/dist/src/ui/App.js.map +1 -1
  141. package/dist/src/ui/AppContainer.d.ts +17 -0
  142. package/dist/src/ui/AppContainer.js +1062 -0
  143. package/dist/src/ui/AppContainer.js.map +1 -0
  144. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  145. package/dist/src/ui/AppContainer.test.js +831 -0
  146. package/dist/src/ui/AppContainer.test.js.map +1 -0
  147. package/dist/src/ui/IdeIntegrationNudge.d.ts +2 -2
  148. package/dist/src/ui/IdeIntegrationNudge.js +6 -8
  149. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
  150. package/dist/src/ui/{components → auth}/AuthDialog.js +8 -4
  151. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  152. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  153. package/dist/src/ui/{components → auth}/AuthDialog.test.js +92 -10
  154. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  155. package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
  156. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  157. package/dist/src/ui/{hooks/useAuthCommand.d.ts → auth/useAuth.d.ts} +9 -3
  158. package/dist/src/ui/{hooks/useAuthCommand.js → auth/useAuth.js} +49 -14
  159. package/dist/src/ui/auth/useAuth.js.map +1 -0
  160. package/dist/src/ui/commands/aboutCommand.js +9 -3
  161. package/dist/src/ui/commands/aboutCommand.js.map +1 -1
  162. package/dist/src/ui/commands/chatCommand.d.ts +2 -0
  163. package/dist/src/ui/commands/chatCommand.js +93 -3
  164. package/dist/src/ui/commands/chatCommand.js.map +1 -1
  165. package/dist/src/ui/commands/clearCommand.js +1 -1
  166. package/dist/src/ui/commands/clearCommand.js.map +1 -1
  167. package/dist/src/ui/commands/corgiCommand.js +1 -0
  168. package/dist/src/ui/commands/corgiCommand.js.map +1 -1
  169. package/dist/src/ui/commands/directoryCommand.js +2 -2
  170. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  171. package/dist/src/ui/commands/extensionsCommand.js +92 -15
  172. package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
  173. package/dist/src/ui/commands/ideCommand.d.ts +1 -2
  174. package/dist/src/ui/commands/ideCommand.js +19 -10
  175. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  176. package/dist/src/ui/commands/mcpCommand.js +88 -261
  177. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  178. package/dist/src/ui/commands/memoryCommand.js +1 -1
  179. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  180. package/dist/src/ui/commands/modelCommand.js +1 -16
  181. package/dist/src/ui/commands/modelCommand.js.map +1 -1
  182. package/dist/src/ui/commands/modelCommand.test.js +10 -11
  183. package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
  184. package/dist/src/ui/commands/summaryCommand.js +1 -1
  185. package/dist/src/ui/commands/summaryCommand.js.map +1 -1
  186. package/dist/src/ui/commands/toolsCommand.js +10 -24
  187. package/dist/src/ui/commands/toolsCommand.js.map +1 -1
  188. package/dist/src/ui/commands/types.d.ts +7 -2
  189. package/dist/src/ui/commands/types.js +0 -1
  190. package/dist/src/ui/commands/types.js.map +1 -1
  191. package/dist/src/ui/components/AboutBox.js +2 -2
  192. package/dist/src/ui/components/AboutBox.js.map +1 -1
  193. package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
  194. package/dist/src/ui/components/AnsiOutput.js +12 -0
  195. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  196. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  197. package/dist/src/ui/components/AnsiOutput.test.js +97 -0
  198. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  199. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  200. package/dist/src/ui/components/AppHeader.js +19 -0
  201. package/dist/src/ui/components/AppHeader.js.map +1 -0
  202. package/dist/src/ui/components/AutoAcceptIndicator.js +5 -5
  203. package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
  204. package/dist/src/ui/components/Composer.d.ts +6 -0
  205. package/dist/src/ui/components/Composer.js +54 -0
  206. package/dist/src/ui/components/Composer.js.map +1 -0
  207. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  208. package/dist/src/ui/components/Composer.test.js +337 -0
  209. package/dist/src/ui/components/Composer.test.js.map +1 -0
  210. package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
  211. package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
  212. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
  213. package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
  214. package/dist/src/ui/components/ConsentPrompt.js +19 -0
  215. package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
  216. package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
  217. package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
  218. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
  219. package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
  220. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
  221. package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
  222. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  223. package/dist/src/ui/components/ContextUsageDisplay.d.ts +2 -1
  224. package/dist/src/ui/components/ContextUsageDisplay.js +5 -3
  225. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
  226. package/dist/src/ui/components/DebugProfiler.js +2 -2
  227. package/dist/src/ui/components/DebugProfiler.js.map +1 -1
  228. package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
  229. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
  230. package/dist/src/ui/components/DialogManager.d.ts +12 -0
  231. package/dist/src/ui/components/DialogManager.js +129 -0
  232. package/dist/src/ui/components/DialogManager.js.map +1 -0
  233. package/dist/src/ui/components/EditorSettingsDialog.js +16 -7
  234. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  235. package/dist/src/ui/components/ExitWarning.d.ts +7 -0
  236. package/dist/src/ui/components/ExitWarning.js +9 -0
  237. package/dist/src/ui/components/ExitWarning.js.map +1 -0
  238. package/dist/src/ui/components/FolderTrustDialog.js +22 -9
  239. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
  240. package/dist/src/ui/components/FolderTrustDialog.test.js +37 -12
  241. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
  242. package/dist/src/ui/components/Footer.d.ts +1 -17
  243. package/dist/src/ui/components/Footer.js +33 -11
  244. package/dist/src/ui/components/Footer.js.map +1 -1
  245. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
  246. package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
  247. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
  248. package/dist/src/ui/components/Header.js +2 -2
  249. package/dist/src/ui/components/Header.js.map +1 -1
  250. package/dist/src/ui/components/Help.d.ts +1 -1
  251. package/dist/src/ui/components/Help.js +9 -6
  252. package/dist/src/ui/components/Help.js.map +1 -1
  253. package/dist/src/ui/components/Help.test.d.ts +6 -0
  254. package/dist/src/ui/components/Help.test.js +57 -0
  255. package/dist/src/ui/components/Help.test.js.map +1 -0
  256. package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -4
  257. package/dist/src/ui/components/HistoryItemDisplay.js +13 -4
  258. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
  259. package/dist/src/ui/components/HistoryItemDisplay.test.js +90 -9
  260. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
  261. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
  262. package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
  263. package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
  264. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
  265. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
  266. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
  267. package/dist/src/ui/components/InputPrompt.d.ts +9 -0
  268. package/dist/src/ui/components/InputPrompt.js +192 -45
  269. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  270. package/dist/src/ui/components/LoadingIndicator.js +2 -2
  271. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  272. package/dist/src/ui/components/LoadingIndicator.test.js +4 -0
  273. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
  274. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  275. package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
  276. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  277. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  278. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
  279. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  280. package/dist/src/ui/components/MainContent.d.ts +6 -0
  281. package/dist/src/ui/components/MainContent.js +28 -0
  282. package/dist/src/ui/components/MainContent.js.map +1 -0
  283. package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
  284. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
  285. package/dist/src/ui/components/ModelDialog.d.ts +11 -0
  286. package/dist/src/ui/components/ModelDialog.js +42 -0
  287. package/dist/src/ui/components/ModelDialog.js.map +1 -0
  288. package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
  289. package/dist/src/ui/components/ModelDialog.test.js +158 -0
  290. package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
  291. package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
  292. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
  293. package/dist/src/ui/components/ModelSwitchDialog.js +3 -0
  294. package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -1
  295. package/dist/src/ui/components/ModelSwitchDialog.test.js +3 -0
  296. package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -1
  297. package/dist/src/ui/components/Notifications.d.ts +6 -0
  298. package/dist/src/ui/components/Notifications.js +23 -0
  299. package/dist/src/ui/components/Notifications.js.map +1 -0
  300. package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -39
  301. package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
  302. package/dist/src/ui/components/OpenAIKeyPrompt.test.js +8 -1
  303. package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -1
  304. package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
  305. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
  306. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
  307. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
  308. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
  309. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
  310. package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
  311. package/dist/src/ui/components/PrepareLabel.js +67 -11
  312. package/dist/src/ui/components/PrepareLabel.js.map +1 -1
  313. package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
  314. package/dist/src/ui/components/PrepareLabel.test.js +71 -0
  315. package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
  316. package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
  317. package/dist/src/ui/components/ProQuotaDialog.js +23 -0
  318. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
  319. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
  320. package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
  321. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
  322. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
  323. package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
  324. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
  325. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
  326. package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
  327. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
  328. package/dist/src/ui/components/QuitConfirmationDialog.js +4 -0
  329. package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -1
  330. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  331. package/dist/src/ui/components/QuittingDisplay.js +20 -0
  332. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  333. package/dist/src/ui/components/QwenOAuthProgress.js +5 -4
  334. package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
  335. package/dist/src/ui/components/QwenOAuthProgress.test.js +82 -11
  336. package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -1
  337. package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
  338. package/dist/src/ui/components/SettingsDialog.js +97 -23
  339. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  340. package/dist/src/ui/components/SettingsDialog.test.js +474 -84
  341. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  342. package/dist/src/ui/components/ShellConfirmationDialog.js +5 -2
  343. package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
  344. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  345. package/dist/src/ui/components/ShellInputPrompt.js +36 -0
  346. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  347. package/dist/src/ui/components/ShellModeIndicator.js +2 -2
  348. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
  349. package/dist/src/ui/components/ShowMoreLines.js +2 -2
  350. package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
  351. package/dist/src/ui/components/StatsDisplay.js +6 -6
  352. package/dist/src/ui/components/StatsDisplay.js.map +1 -1
  353. package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
  354. package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
  355. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
  356. package/dist/src/ui/components/ThemeDialog.js +14 -29
  357. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  358. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  359. package/dist/src/ui/components/ThemeDialog.test.js +75 -0
  360. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  361. package/dist/src/ui/components/Tips.js +2 -2
  362. package/dist/src/ui/components/Tips.js.map +1 -1
  363. package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
  364. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
  365. package/dist/src/ui/components/UpdateNotification.js +2 -2
  366. package/dist/src/ui/components/UpdateNotification.js.map +1 -1
  367. package/dist/src/ui/components/WelcomeBackDialog.js +2 -0
  368. package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -1
  369. package/dist/src/ui/components/WorkspaceMigrationDialog.js +14 -11
  370. package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
  371. package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
  372. package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
  373. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
  374. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  375. package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
  376. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  377. package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
  378. package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
  379. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
  380. package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
  381. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
  382. package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
  383. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
  384. package/dist/src/ui/components/messages/InfoMessage.js +2 -2
  385. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
  386. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +53 -21
  387. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  388. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -8
  389. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  390. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
  391. package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -10
  392. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
  393. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
  394. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  395. package/dist/src/ui/components/messages/ToolMessage.d.ts +3 -1
  396. package/dist/src/ui/components/messages/ToolMessage.js +53 -11
  397. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  398. package/dist/src/ui/components/messages/ToolMessage.test.js +34 -1
  399. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
  400. package/dist/src/ui/components/messages/UserMessage.js +3 -4
  401. package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
  402. package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
  403. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
  404. package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
  405. package/dist/src/ui/components/messages/WarningMessage.js +10 -0
  406. package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
  407. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
  408. package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
  409. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
  410. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
  411. package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
  412. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
  413. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
  414. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
  415. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
  416. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
  417. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
  418. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
  419. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  420. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  421. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  422. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  423. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  424. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  425. package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
  426. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  427. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +2 -3
  428. package/dist/src/ui/components/shared/RadioButtonSelect.js +10 -105
  429. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
  430. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +115 -92
  431. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -1
  432. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  433. package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
  434. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  435. package/dist/src/ui/components/shared/text-buffer.d.ts +25 -2
  436. package/dist/src/ui/components/shared/text-buffer.js +296 -187
  437. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  438. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +2 -3
  439. package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -1
  440. package/dist/src/ui/components/subagents/create/ColorSelector.js +3 -2
  441. package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -1
  442. package/dist/src/ui/components/subagents/create/CreationSummary.js +6 -5
  443. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
  444. package/dist/src/ui/components/subagents/create/DescriptionInput.js +2 -3
  445. package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -1
  446. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +1 -0
  447. package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -1
  448. package/dist/src/ui/components/subagents/create/LocationSelector.js +1 -0
  449. package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -1
  450. package/dist/src/ui/components/subagents/create/TextEntryStep.js +2 -2
  451. package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -1
  452. package/dist/src/ui/components/subagents/create/ToolSelector.js +4 -3
  453. package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -1
  454. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +4 -4
  455. package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -1
  456. package/dist/src/ui/components/subagents/manage/AgentEditStep.js +1 -0
  457. package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -1
  458. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +1 -2
  459. package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -1
  460. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +1 -2
  461. package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -1
  462. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +9 -10
  463. package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
  464. package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
  465. package/dist/src/ui/components/views/ExtensionsList.js +47 -0
  466. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  467. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  468. package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
  469. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  470. package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
  471. package/dist/src/ui/components/views/McpStatus.js +77 -0
  472. package/dist/src/ui/components/views/McpStatus.js.map +1 -0
  473. package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
  474. package/dist/src/ui/components/views/McpStatus.test.js +117 -0
  475. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
  476. package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
  477. package/dist/src/ui/components/views/ToolsList.js +7 -0
  478. package/dist/src/ui/components/views/ToolsList.js.map +1 -0
  479. package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
  480. package/dist/src/ui/components/views/ToolsList.test.js +45 -0
  481. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
  482. package/dist/src/ui/constants.d.ts +1 -0
  483. package/dist/src/ui/constants.js +1 -0
  484. package/dist/src/ui/constants.js.map +1 -1
  485. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  486. package/dist/src/ui/contexts/AppContext.js +15 -0
  487. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  488. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  489. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  490. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  491. package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
  492. package/dist/src/ui/contexts/KeypressContext.js +309 -44
  493. package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
  494. package/dist/src/ui/contexts/KeypressContext.test.js +288 -2
  495. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
  496. package/dist/src/ui/contexts/SessionContext.d.ts +6 -0
  497. package/dist/src/ui/contexts/SessionContext.js +107 -5
  498. package/dist/src/ui/contexts/SessionContext.js.map +1 -1
  499. package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
  500. package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
  501. package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
  502. package/dist/src/ui/contexts/UIActionsContext.d.ts +45 -0
  503. package/dist/src/ui/contexts/UIActionsContext.js +21 -0
  504. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  505. package/dist/src/ui/contexts/UIStateContext.d.ts +117 -0
  506. package/dist/src/ui/contexts/UIStateContext.js +17 -0
  507. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  508. package/dist/src/ui/hooks/atCommandProcessor.js +12 -12
  509. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  510. package/dist/src/ui/hooks/atCommandProcessor.test.js +21 -19
  511. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
  512. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  513. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  514. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  515. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
  516. package/dist/src/ui/hooks/shellCommandProcessor.js +65 -15
  517. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  518. package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
  519. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  520. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +20 -2
  521. package/dist/src/ui/hooks/slashCommandProcessor.js +41 -82
  522. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  523. package/dist/src/ui/hooks/useAtCompletion.js +1 -1
  524. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
  525. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
  526. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +20 -18
  527. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
  528. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +43 -0
  529. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
  530. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
  531. package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
  532. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  533. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  534. package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
  535. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  536. package/dist/src/ui/hooks/useFocus.js +10 -0
  537. package/dist/src/ui/hooks/useFocus.js.map +1 -1
  538. package/dist/src/ui/hooks/useFolderTrust.js +6 -10
  539. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
  540. package/dist/src/ui/hooks/useGeminiStream.d.ts +14 -3
  541. package/dist/src/ui/hooks/useGeminiStream.js +173 -79
  542. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  543. package/dist/src/ui/hooks/useGitBranchName.js +15 -18
  544. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
  545. package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
  546. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
  547. package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
  548. package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
  549. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
  550. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
  551. package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
  552. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
  553. package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
  554. package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
  555. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
  556. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
  557. package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
  558. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
  559. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
  560. package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
  561. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
  562. package/dist/src/ui/hooks/useLoadingIndicator.test.js +2 -2
  563. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  564. package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
  565. package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
  566. package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
  567. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
  568. package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
  569. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
  570. package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
  571. package/dist/src/ui/hooks/useMessageQueue.js +5 -3
  572. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
  573. package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
  574. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
  575. package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
  576. package/dist/src/ui/hooks/useModelCommand.js +21 -0
  577. package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
  578. package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
  579. package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
  580. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
  581. package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
  582. package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
  583. package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
  584. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
  585. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
  586. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
  587. package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
  588. package/dist/src/ui/hooks/usePhraseCycler.js +11 -8
  589. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  590. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
  591. package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
  592. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
  593. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
  594. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
  595. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
  596. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
  597. package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
  598. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  599. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
  600. package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
  601. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
  602. package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
  603. package/dist/src/ui/hooks/useSelectionList.js +245 -0
  604. package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
  605. package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
  606. package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
  607. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
  608. package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
  609. package/dist/src/ui/hooks/useSlashCompletion.js +281 -67
  610. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
  611. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +4 -1
  612. package/dist/src/ui/hooks/useSlashCompletion.test.js +390 -65
  613. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
  614. package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
  615. package/dist/src/ui/hooks/useStateAndRef.js +2 -2
  616. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
  617. package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
  618. package/dist/src/ui/hooks/useThemeCommand.js +3 -14
  619. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
  620. package/dist/src/ui/hooks/useToolScheduler.test.js +64 -291
  621. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  622. package/dist/src/ui/hooks/useWelcomeBack.js +2 -2
  623. package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -1
  624. package/dist/src/ui/hooks/useWorkspaceMigration.js +2 -1
  625. package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -1
  626. package/dist/src/ui/keyMatchers.test.js +17 -0
  627. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  628. package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
  629. package/dist/src/ui/layouts/DefaultAppLayout.js +13 -0
  630. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
  631. package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
  632. package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
  633. package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
  634. package/dist/src/ui/models/availableModels.d.ts +3 -0
  635. package/dist/src/ui/models/availableModels.js +27 -3
  636. package/dist/src/ui/models/availableModels.js.map +1 -1
  637. package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
  638. package/dist/src/ui/noninteractive/nonInteractiveUi.js +28 -0
  639. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
  640. package/dist/src/ui/state/extensions.d.ts +42 -0
  641. package/dist/src/ui/state/extensions.js +62 -0
  642. package/dist/src/ui/state/extensions.js.map +1 -0
  643. package/dist/src/ui/themes/ayu.js +1 -1
  644. package/dist/src/ui/themes/dracula.js +2 -2
  645. package/dist/src/ui/themes/github-dark.js +1 -1
  646. package/dist/src/ui/themes/theme.js +19 -19
  647. package/dist/src/ui/themes/theme.js.map +1 -1
  648. package/dist/src/ui/types.d.ts +79 -3
  649. package/dist/src/ui/types.js +14 -0
  650. package/dist/src/ui/types.js.map +1 -1
  651. package/dist/src/ui/utils/CodeColorizer.js +3 -2
  652. package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
  653. package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
  654. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
  655. package/dist/src/ui/utils/MarkdownDisplay.js +11 -11
  656. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  657. package/dist/src/ui/utils/MarkdownDisplay.test.js +95 -87
  658. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
  659. package/dist/src/ui/utils/TableRenderer.js +4 -4
  660. package/dist/src/ui/utils/TableRenderer.js.map +1 -1
  661. package/dist/src/ui/utils/clipboardUtils.js +5 -6
  662. package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
  663. package/dist/src/ui/utils/displayUtils.d.ts +1 -0
  664. package/dist/src/ui/utils/displayUtils.js +7 -4
  665. package/dist/src/ui/utils/displayUtils.js.map +1 -1
  666. package/dist/src/ui/utils/displayUtils.test.js +37 -18
  667. package/dist/src/ui/utils/displayUtils.test.js.map +1 -1
  668. package/dist/src/ui/utils/highlight.d.ts +11 -0
  669. package/dist/src/ui/utils/highlight.js +78 -0
  670. package/dist/src/ui/utils/highlight.js.map +1 -0
  671. package/dist/src/ui/utils/highlight.test.d.ts +6 -0
  672. package/dist/src/ui/utils/highlight.test.js +120 -0
  673. package/dist/src/ui/utils/highlight.test.js.map +1 -0
  674. package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
  675. package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
  676. package/dist/src/ui/utils/platformConstants.d.ts +24 -1
  677. package/dist/src/ui/utils/platformConstants.js +26 -1
  678. package/dist/src/ui/utils/platformConstants.js.map +1 -1
  679. package/dist/src/ui/utils/textUtils.d.ts +10 -0
  680. package/dist/src/ui/utils/textUtils.js +108 -3
  681. package/dist/src/ui/utils/textUtils.js.map +1 -1
  682. package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
  683. package/dist/src/ui/utils/textUtils.test.js +132 -0
  684. package/dist/src/ui/utils/textUtils.test.js.map +1 -0
  685. package/dist/src/utils/commands.d.ts +20 -0
  686. package/dist/src/utils/commands.js +53 -0
  687. package/dist/src/utils/commands.js.map +1 -0
  688. package/dist/src/utils/commands.test.d.ts +6 -0
  689. package/dist/src/utils/commands.test.js +115 -0
  690. package/dist/src/utils/commands.test.js.map +1 -0
  691. package/dist/src/utils/commentJson.d.ts +9 -0
  692. package/dist/src/utils/commentJson.js +48 -0
  693. package/dist/src/utils/commentJson.js.map +1 -0
  694. package/dist/src/utils/commentJson.test.d.ts +6 -0
  695. package/dist/src/utils/commentJson.test.js +146 -0
  696. package/dist/src/utils/commentJson.test.js.map +1 -0
  697. package/dist/src/utils/deepMerge.d.ts +9 -0
  698. package/dist/src/utils/deepMerge.js +58 -0
  699. package/dist/src/utils/deepMerge.js.map +1 -0
  700. package/dist/src/utils/deepMerge.test.d.ts +6 -0
  701. package/dist/src/utils/deepMerge.test.js +143 -0
  702. package/dist/src/utils/deepMerge.test.js.map +1 -0
  703. package/dist/src/utils/envVarResolver.d.ts +39 -0
  704. package/dist/src/utils/envVarResolver.js +97 -0
  705. package/dist/src/utils/envVarResolver.js.map +1 -0
  706. package/dist/src/utils/envVarResolver.test.d.ts +6 -0
  707. package/dist/src/utils/envVarResolver.test.js +221 -0
  708. package/dist/src/utils/envVarResolver.test.js.map +1 -0
  709. package/dist/src/utils/errors.d.ts +21 -0
  710. package/dist/src/utils/errors.js +93 -0
  711. package/dist/src/utils/errors.js.map +1 -1
  712. package/dist/src/utils/errors.test.d.ts +6 -0
  713. package/dist/src/utils/errors.test.js +303 -0
  714. package/dist/src/utils/errors.test.js.map +1 -0
  715. package/dist/src/utils/events.d.ts +2 -1
  716. package/dist/src/utils/events.js +1 -0
  717. package/dist/src/utils/events.js.map +1 -1
  718. package/dist/src/utils/math.d.ts +13 -0
  719. package/dist/src/utils/math.js +14 -0
  720. package/dist/src/utils/math.js.map +1 -0
  721. package/dist/src/utils/processUtils.d.ts +13 -0
  722. package/dist/src/utils/processUtils.js +18 -0
  723. package/dist/src/utils/processUtils.js.map +1 -0
  724. package/dist/src/utils/processUtils.test.d.ts +6 -0
  725. package/dist/src/utils/processUtils.test.js +20 -0
  726. package/dist/src/utils/processUtils.test.js.map +1 -0
  727. package/dist/src/utils/relaunch.d.ts +7 -0
  728. package/dist/src/utils/relaunch.js +57 -0
  729. package/dist/src/utils/relaunch.js.map +1 -0
  730. package/dist/src/utils/relaunch.test.d.ts +6 -0
  731. package/dist/src/utils/relaunch.test.js +273 -0
  732. package/dist/src/utils/relaunch.test.js.map +1 -0
  733. package/dist/src/utils/sandbox.d.ts +1 -1
  734. package/dist/src/utils/sandbox.js +42 -17
  735. package/dist/src/utils/sandbox.js.map +1 -1
  736. package/dist/src/utils/settingsUtils.d.ts +16 -6
  737. package/dist/src/utils/settingsUtils.js +35 -25
  738. package/dist/src/utils/settingsUtils.js.map +1 -1
  739. package/dist/src/utils/settingsUtils.test.js +455 -158
  740. package/dist/src/utils/settingsUtils.test.js.map +1 -1
  741. package/dist/src/utils/userStartupWarnings.d.ts +1 -1
  742. package/dist/src/utils/userStartupWarnings.js +1 -1
  743. package/dist/src/utils/userStartupWarnings.js.map +1 -1
  744. package/dist/src/utils/windowTitle.d.ts +12 -0
  745. package/dist/src/utils/windowTitle.js +19 -0
  746. package/dist/src/utils/windowTitle.js.map +1 -0
  747. package/dist/src/utils/windowTitle.test.d.ts +6 -0
  748. package/dist/src/utils/windowTitle.test.js +49 -0
  749. package/dist/src/utils/windowTitle.test.js.map +1 -0
  750. package/dist/src/validateNonInterActiveAuth.d.ts +4 -2
  751. package/dist/src/validateNonInterActiveAuth.js +33 -12
  752. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  753. package/dist/src/zed-integration/fileSystemService.d.ts +1 -0
  754. package/dist/src/zed-integration/fileSystemService.js +3 -0
  755. package/dist/src/zed-integration/fileSystemService.js.map +1 -1
  756. package/dist/src/zed-integration/schema.d.ts +310 -310
  757. package/dist/src/zed-integration/zedIntegration.d.ts +8 -1
  758. package/dist/src/zed-integration/zedIntegration.js +32 -15
  759. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  760. package/dist/tsconfig.tsbuildinfo +1 -1
  761. package/package.json +15 -10
  762. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  763. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  764. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  765. package/dist/src/ui/components/ModelSelectionDialog.d.ts +0 -14
  766. package/dist/src/ui/components/ModelSelectionDialog.js +0 -26
  767. package/dist/src/ui/components/ModelSelectionDialog.js.map +0 -1
  768. package/dist/src/ui/components/ModelSelectionDialog.test.js +0 -124
  769. package/dist/src/ui/components/ModelSelectionDialog.test.js.map +0 -1
  770. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  771. /package/dist/src/{ui/components/AuthDialog.test.d.ts → commands/extensions/new.test.d.ts} +0 -0
  772. /package/dist/src/ui/{components → auth}/AuthDialog.d.ts +0 -0
  773. /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
@@ -1,845 +1,37 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2025 Google LLC
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
- import { useCallback, useEffect, useMemo, useState, useRef } from 'react';
8
- import { Box, measureElement, Static, Text, useStdin, useStdout, } from 'ink';
9
- import { StreamingState, MessageType, ToolCallStatus, } from './types.js';
7
+ import { useIsScreenReaderEnabled } from 'ink';
10
8
  import { useTerminalSize } from './hooks/useTerminalSize.js';
11
- import { useGeminiStream } from './hooks/useGeminiStream.js';
12
- import { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
13
- import { useThemeCommand } from './hooks/useThemeCommand.js';
14
- import { useAuthCommand } from './hooks/useAuthCommand.js';
15
- import { useQwenAuth } from './hooks/useQwenAuth.js';
16
- import { useFolderTrust } from './hooks/useFolderTrust.js';
17
- import { useEditorSettings } from './hooks/useEditorSettings.js';
18
- import { useQuitConfirmation } from './hooks/useQuitConfirmation.js';
19
- import { useWelcomeBack } from './hooks/useWelcomeBack.js';
20
- import { useDialogClose } from './hooks/useDialogClose.js';
21
- import { useSlashCommandProcessor } from './hooks/slashCommandProcessor.js';
22
- import { useSubagentCreateDialog } from './hooks/useSubagentCreateDialog.js';
23
- import { useAgentsManagerDialog } from './hooks/useAgentsManagerDialog.js';
24
- import { useAutoAcceptIndicator } from './hooks/useAutoAcceptIndicator.js';
25
- import { useMessageQueue } from './hooks/useMessageQueue.js';
26
- import { useConsoleMessages } from './hooks/useConsoleMessages.js';
27
- import { Header } from './components/Header.js';
28
- import { LoadingIndicator } from './components/LoadingIndicator.js';
29
- import { AutoAcceptIndicator } from './components/AutoAcceptIndicator.js';
30
- import { ShellModeIndicator } from './components/ShellModeIndicator.js';
31
- import { InputPrompt } from './components/InputPrompt.js';
32
- import { Footer } from './components/Footer.js';
33
- import { ThemeDialog } from './components/ThemeDialog.js';
34
- import { AuthDialog } from './components/AuthDialog.js';
35
- import { AuthInProgress } from './components/AuthInProgress.js';
36
- import { QwenOAuthProgress } from './components/QwenOAuthProgress.js';
37
- import { EditorSettingsDialog } from './components/EditorSettingsDialog.js';
38
- import { FolderTrustDialog } from './components/FolderTrustDialog.js';
39
- import { ShellConfirmationDialog } from './components/ShellConfirmationDialog.js';
40
- import { QuitConfirmationDialog } from './components/QuitConfirmationDialog.js';
41
- import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js';
42
- import { ModelSelectionDialog } from './components/ModelSelectionDialog.js';
43
- import { ModelSwitchDialog, } from './components/ModelSwitchDialog.js';
44
- import { getOpenAIAvailableModelFromEnv, getFilteredQwenModels, } from './models/availableModels.js';
45
- import { processVisionSwitchOutcome } from './hooks/useVisionAutoSwitch.js';
46
- import { AgentCreationWizard, AgentsManagerDialog, } from './components/subagents/index.js';
47
- import { Colors } from './colors.js';
48
- import { loadHierarchicalGeminiMemory } from '../config/config.js';
49
- import { SettingScope } from '../config/settings.js';
50
- import { Tips } from './components/Tips.js';
51
- import { ConsolePatcher } from './utils/ConsolePatcher.js';
52
- import { registerCleanup } from '../utils/cleanup.js';
53
- import { DetailedMessagesDisplay } from './components/DetailedMessagesDisplay.js';
54
- import { HistoryItemDisplay } from './components/HistoryItemDisplay.js';
55
- import { ContextSummaryDisplay } from './components/ContextSummaryDisplay.js';
56
- import { useHistory } from './hooks/useHistoryManager.js';
57
- import process from 'node:process';
58
- import { ApprovalMode, getAllGeminiMdFilenames, isEditorAvailable, getErrorMessage, AuthType, logFlashFallback, FlashFallbackEvent, ideContext, isProQuotaExceededError, isGenericQuotaExceededError, UserTierId, } from '@rdmind/rdmind-core';
59
- import { IdeIntegrationNudge } from './IdeIntegrationNudge.js';
60
- import { validateAuthMethod } from '../config/auth.js';
61
- import { useLogger } from './hooks/useLogger.js';
9
+ import { lerp } from '../utils/math.js';
10
+ import { useUIState } from './contexts/UIStateContext.js';
62
11
  import { StreamingContext } from './contexts/StreamingContext.js';
63
- import { SessionStatsProvider, useSessionStats, } from './contexts/SessionContext.js';
64
- import { useGitBranchName } from './hooks/useGitBranchName.js';
65
- import { useFocus } from './hooks/useFocus.js';
66
- import { useBracketedPaste } from './hooks/useBracketedPaste.js';
67
- import { useTextBuffer } from './components/shared/text-buffer.js';
68
- import { useVimMode, VimModeProvider } from './contexts/VimModeContext.js';
69
- import { useVim } from './hooks/vim.js';
70
- import { useKeypress } from './hooks/useKeypress.js';
71
- import { KeypressProvider } from './contexts/KeypressContext.js';
72
- import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js';
73
- import { keyMatchers, Command } from './keyMatchers.js';
74
- import * as fs from 'node:fs';
75
- import { UpdateNotification } from './components/UpdateNotification.js';
76
- import ansiEscapes from 'ansi-escapes';
77
- import { OverflowProvider } from './contexts/OverflowContext.js';
78
- import { ShowMoreLines } from './components/ShowMoreLines.js';
79
- import { useSettingsCommand } from './hooks/useSettingsCommand.js';
80
- import { SettingsDialog } from './components/SettingsDialog.js';
81
- import { setUpdateHandler } from '../utils/handleAutoUpdate.js';
82
- import { appEvents, AppEvent } from '../utils/events.js';
83
- import { isNarrowWidth } from './utils/isNarrowWidth.js';
84
- import { useWorkspaceMigration } from './hooks/useWorkspaceMigration.js';
85
- import { WorkspaceMigrationDialog } from './components/WorkspaceMigrationDialog.js';
86
- import { WelcomeBackDialog } from './components/WelcomeBackDialog.js';
87
- // Maximum number of queued messages to display in UI to prevent performance issues
88
- const MAX_DISPLAYED_QUEUED_MESSAGES = 3;
89
- function isToolExecuting(pendingHistoryItems) {
90
- return pendingHistoryItems.some((item) => {
91
- if (item && item.type === 'tool_group') {
92
- return item.tools.some((tool) => ToolCallStatus.Executing === tool.status);
93
- }
94
- return false;
95
- });
96
- }
97
- export const AppWrapper = (props) => {
98
- const kittyProtocolStatus = useKittyKeyboardProtocol();
99
- const nodeMajorVersion = parseInt(process.versions.node.split('.')[0], 10);
100
- return (_jsx(KeypressProvider, { kittyProtocolEnabled: kittyProtocolStatus.enabled, pasteWorkaround: process.platform === 'win32' || nodeMajorVersion < 20, config: props.config, debugKeystrokeLogging: props.settings.merged.general?.debugKeystrokeLogging, children: _jsx(SessionStatsProvider, { children: _jsx(VimModeProvider, { settings: props.settings, children: _jsx(App, { ...props }) }) }) }));
12
+ import { QuittingDisplay } from './components/QuittingDisplay.js';
13
+ import { ScreenReaderAppLayout } from './layouts/ScreenReaderAppLayout.js';
14
+ import { DefaultAppLayout } from './layouts/DefaultAppLayout.js';
15
+ const getContainerWidth = (terminalWidth) => {
16
+ if (terminalWidth <= 80) {
17
+ return '98%';
18
+ }
19
+ if (terminalWidth >= 132) {
20
+ return '90%';
21
+ }
22
+ // Linearly interpolate between 80 columns (98%) and 132 columns (90%).
23
+ const t = (terminalWidth - 80) / (132 - 80);
24
+ const percentage = lerp(98, 90, t);
25
+ return `${Math.round(percentage)}%`;
101
26
  };
102
- const App = ({ config, settings, startupWarnings = [], version }) => {
103
- const isFocused = useFocus();
104
- useBracketedPaste();
105
- const [updateInfo, setUpdateInfo] = useState(null);
106
- const { stdout } = useStdout();
107
- const nightly = version.includes('nightly');
108
- const { history, addItem, clearItems, loadHistory } = useHistory();
109
- const [idePromptAnswered, setIdePromptAnswered] = useState(false);
110
- const currentIDE = config.getIdeClient().getCurrentIde();
111
- useEffect(() => {
112
- registerCleanup(() => config.getIdeClient().disconnect());
113
- }, [config]);
114
- const shouldShowIdePrompt = currentIDE &&
115
- !config.getIdeMode() &&
116
- !settings.merged.ide?.hasSeenNudge &&
117
- !idePromptAnswered;
118
- useEffect(() => {
119
- const cleanup = setUpdateHandler(addItem, setUpdateInfo);
120
- return cleanup;
121
- }, [addItem]);
122
- const { consoleMessages, handleNewMessage, clearConsoleMessages: clearConsoleMessagesState, } = useConsoleMessages();
123
- useEffect(() => {
124
- const consolePatcher = new ConsolePatcher({
125
- onNewMessage: handleNewMessage,
126
- debugMode: config.getDebugMode(),
127
- });
128
- consolePatcher.patch();
129
- registerCleanup(consolePatcher.cleanup);
130
- }, [handleNewMessage, config]);
131
- const { stats: sessionStats } = useSessionStats();
132
- const [staticNeedsRefresh, setStaticNeedsRefresh] = useState(false);
133
- const [staticKey, setStaticKey] = useState(0);
134
- const refreshStatic = useCallback(() => {
135
- stdout.write(ansiEscapes.clearTerminal);
136
- setStaticKey((prev) => prev + 1);
137
- }, [setStaticKey, stdout]);
138
- const [geminiMdFileCount, setGeminiMdFileCount] = useState(0);
139
- const [debugMessage, setDebugMessage] = useState('');
140
- const [themeError, setThemeError] = useState(null);
141
- const [authError, setAuthError] = useState(null);
142
- const [editorError, setEditorError] = useState(null);
143
- const [footerHeight, setFooterHeight] = useState(0);
144
- const [corgiMode, setCorgiMode] = useState(false);
145
- const [isTrustedFolderState, setIsTrustedFolder] = useState(config.isTrustedFolder());
146
- const [currentModel, setCurrentModel] = useState(config.getModel());
147
- const [shellModeActive, setShellModeActive] = useState(false);
148
- const [showErrorDetails, setShowErrorDetails] = useState(false);
149
- const [showToolDescriptions, setShowToolDescriptions] = useState(false);
150
- const [ctrlCPressedOnce, setCtrlCPressedOnce] = useState(false);
151
- const [quittingMessages, setQuittingMessages] = useState(null);
152
- const ctrlCTimerRef = useRef(null);
153
- const [ctrlDPressedOnce, setCtrlDPressedOnce] = useState(false);
154
- const ctrlDTimerRef = useRef(null);
155
- const [constrainHeight, setConstrainHeight] = useState(true);
156
- const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = useState(false);
157
- const [userTier, setUserTier] = useState(undefined);
158
- const [ideContextState, setIdeContextState] = useState();
159
- const [showEscapePrompt, setShowEscapePrompt] = useState(false);
160
- const [isProcessing, setIsProcessing] = useState(false);
161
- const { showWorkspaceMigrationDialog, workspaceExtensions, onWorkspaceMigrationDialogOpen, onWorkspaceMigrationDialogClose, } = useWorkspaceMigration(settings);
162
- // Model selection dialog states
163
- const [isModelSelectionDialogOpen, setIsModelSelectionDialogOpen] = useState(false);
164
- const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = useState(false);
165
- const [visionSwitchResolver, setVisionSwitchResolver] = useState(null);
166
- useEffect(() => {
167
- const unsubscribe = ideContext.subscribeToIdeContext(setIdeContextState);
168
- // Set the initial value
169
- setIdeContextState(ideContext.getIdeContext());
170
- return unsubscribe;
171
- }, []);
172
- useEffect(() => {
173
- const openDebugConsole = () => {
174
- setShowErrorDetails(true);
175
- setConstrainHeight(false); // Make sure the user sees the full message.
176
- };
177
- appEvents.on(AppEvent.OpenDebugConsole, openDebugConsole);
178
- const logErrorHandler = (errorMessage) => {
179
- handleNewMessage({
180
- type: 'error',
181
- content: String(errorMessage),
182
- count: 1,
183
- });
184
- };
185
- appEvents.on(AppEvent.LogError, logErrorHandler);
186
- return () => {
187
- appEvents.off(AppEvent.OpenDebugConsole, openDebugConsole);
188
- appEvents.off(AppEvent.LogError, logErrorHandler);
189
- };
190
- }, [handleNewMessage]);
191
- const handleEscapePromptChange = useCallback((showPrompt) => {
192
- setShowEscapePrompt(showPrompt);
193
- }, []);
194
- const initialPromptSubmitted = useRef(false);
195
- const errorCount = useMemo(() => consoleMessages
196
- .filter((msg) => msg.type === 'error')
197
- .reduce((total, msg) => total + msg.count, 0), [consoleMessages]);
198
- const { isThemeDialogOpen, openThemeDialog, handleThemeSelect, handleThemeHighlight, } = useThemeCommand(settings, setThemeError, addItem);
199
- const { isSettingsDialogOpen, openSettingsDialog, closeSettingsDialog } = useSettingsCommand();
200
- const { isSubagentCreateDialogOpen, openSubagentCreateDialog, closeSubagentCreateDialog, } = useSubagentCreateDialog();
201
- const { isAgentsManagerDialogOpen, openAgentsManagerDialog, closeAgentsManagerDialog, } = useAgentsManagerDialog();
202
- const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
203
- const { showQuitConfirmation, handleQuitConfirmationSelect } = useQuitConfirmation();
204
- const { isAuthDialogOpen, openAuthDialog, handleAuthSelect, isAuthenticating, cancelAuthentication, } = useAuthCommand(settings, setAuthError, config);
205
- const { isQwenAuthenticating, deviceAuth, isQwenAuth, cancelQwenAuth, authStatus, authMessage, } = useQwenAuth(settings, isAuthenticating);
206
- useEffect(() => {
207
- if (settings.merged.security?.auth?.selectedType &&
208
- !settings.merged.security?.auth?.useExternal) {
209
- const error = validateAuthMethod(settings.merged.security.auth.selectedType);
210
- if (error) {
211
- setAuthError(error);
212
- openAuthDialog();
213
- }
214
- }
215
- }, [
216
- settings.merged.security?.auth?.selectedType,
217
- settings.merged.security?.auth?.useExternal,
218
- openAuthDialog,
219
- setAuthError,
220
- ]);
221
- // Sync user tier from config when authentication changes
222
- useEffect(() => {
223
- // Only sync when not currently authenticating
224
- if (!isAuthenticating) {
225
- setUserTier(config.getGeminiClient()?.getUserTier());
226
- }
227
- }, [config, isAuthenticating]);
228
- // Handle Qwen OAuth timeout
229
- useEffect(() => {
230
- if (isQwenAuth && authStatus === 'timeout') {
231
- setAuthError(authMessage ||
232
- 'Qwen OAuth authentication timed out. Please try again or select a different authentication method.');
233
- cancelQwenAuth();
234
- cancelAuthentication();
235
- openAuthDialog();
236
- }
237
- }, [
238
- isQwenAuth,
239
- authStatus,
240
- authMessage,
241
- cancelQwenAuth,
242
- cancelAuthentication,
243
- openAuthDialog,
244
- setAuthError,
245
- ]);
246
- const { isEditorDialogOpen, openEditorDialog, handleEditorSelect, exitEditorDialog, } = useEditorSettings(settings, setEditorError, addItem);
247
- const toggleCorgiMode = useCallback(() => {
248
- setCorgiMode((prev) => !prev);
249
- }, []);
250
- const performMemoryRefresh = useCallback(async () => {
251
- addItem({
252
- type: MessageType.INFO,
253
- text: 'Refreshing hierarchical memory (RDMind.md or other context files)...',
254
- }, Date.now());
255
- try {
256
- const { memoryContent, fileCount } = await loadHierarchicalGeminiMemory(process.cwd(), settings.merged.context?.loadMemoryFromIncludeDirectories
257
- ? config.getWorkspaceContext().getDirectories()
258
- : [], config.getDebugMode(), config.getFileService(), settings.merged, config.getExtensionContextFilePaths(), settings.merged.context?.importFormat || 'tree', // Use setting or default to 'tree'
259
- config.getFileFilteringOptions());
260
- config.setUserMemory(memoryContent);
261
- config.setGeminiMdFileCount(fileCount);
262
- setGeminiMdFileCount(fileCount);
263
- addItem({
264
- type: MessageType.INFO,
265
- text: `Memory refreshed successfully. ${memoryContent.length > 0 ? `Loaded ${memoryContent.length} characters from ${fileCount} file(s).` : 'No memory content found.'}`,
266
- }, Date.now());
267
- if (config.getDebugMode()) {
268
- console.log(`[DEBUG] Refreshed memory content in config: ${memoryContent.substring(0, 200)}...`);
269
- }
270
- }
271
- catch (error) {
272
- const errorMessage = getErrorMessage(error);
273
- addItem({
274
- type: MessageType.ERROR,
275
- text: `Error refreshing memory: ${errorMessage}`,
276
- }, Date.now());
277
- console.error('Error refreshing memory:', error);
278
- }
279
- }, [config, addItem, settings.merged]);
280
- // Watch for model changes (e.g., from Flash fallback)
281
- useEffect(() => {
282
- const checkModelChange = () => {
283
- const configModel = config.getModel();
284
- if (configModel !== currentModel) {
285
- setCurrentModel(configModel);
286
- }
287
- };
288
- // Check immediately and then periodically
289
- checkModelChange();
290
- const interval = setInterval(checkModelChange, 1000); // Check every second
291
- return () => clearInterval(interval);
292
- }, [config, currentModel]);
293
- // Set up Flash fallback handler
294
- useEffect(() => {
295
- const flashFallbackHandler = async (currentModel, fallbackModel, error) => {
296
- let message;
297
- if (config.getContentGeneratorConfig().authType ===
298
- AuthType.LOGIN_WITH_GOOGLE) {
299
- // Use actual user tier if available; otherwise, default to FREE tier behavior (safe default)
300
- const isPaidTier = userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
301
- // Check if this is a Pro quota exceeded error
302
- if (error && isProQuotaExceededError(error)) {
303
- if (isPaidTier) {
304
- message = `⚡ You have reached your daily ${currentModel} quota limit.
305
- ⚡ Automatically switching from ${currentModel} to ${fallbackModel} for the remainder of this session.
306
- ⚡ To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
307
- }
308
- else {
309
- message = `⚡ You have reached your daily ${currentModel} quota limit.
310
- ⚡ Automatically switching from ${currentModel} to ${fallbackModel} for the remainder of this session.
311
- ⚡ To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
312
- ⚡ Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
313
- ⚡ You can switch authentication methods by typing /auth`;
314
- }
315
- }
316
- else if (error && isGenericQuotaExceededError(error)) {
317
- if (isPaidTier) {
318
- message = `⚡ You have reached your daily quota limit.
319
- ⚡ Automatically switching from ${currentModel} to ${fallbackModel} for the remainder of this session.
320
- ⚡ To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
321
- }
322
- else {
323
- message = `⚡ You have reached your daily quota limit.
324
- ⚡ Automatically switching from ${currentModel} to ${fallbackModel} for the remainder of this session.
325
- ⚡ To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
326
- ⚡ Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
327
- ⚡ You can switch authentication methods by typing /auth`;
328
- }
329
- }
330
- else {
331
- if (isPaidTier) {
332
- // Default fallback message for other cases (like consecutive 429s)
333
- message = `⚡ Automatically switching from ${currentModel} to ${fallbackModel} for faster responses for the remainder of this session.
334
- ⚡ Possible reasons for this are that you have received multiple consecutive capacity errors or you have reached your daily ${currentModel} quota limit
335
- ⚡ To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
336
- }
337
- else {
338
- // Default fallback message for other cases (like consecutive 429s)
339
- message = `⚡ Automatically switching from ${currentModel} to ${fallbackModel} for faster responses for the remainder of this session.
340
- ⚡ Possible reasons for this are that you have received multiple consecutive capacity errors or you have reached your daily ${currentModel} quota limit
341
- ⚡ To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist
342
- ⚡ Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
343
- ⚡ You can switch authentication methods by typing /auth`;
344
- }
345
- }
346
- // Add message to UI history
347
- addItem({
348
- type: MessageType.INFO,
349
- text: message,
350
- }, Date.now());
351
- // Set the flag to prevent tool continuation
352
- setModelSwitchedFromQuotaError(true);
353
- // Set global quota error flag to prevent Flash model calls
354
- config.setQuotaErrorOccurred(true);
355
- }
356
- // Switch model for future use but return false to stop current retry
357
- config.setModel(fallbackModel).catch((error) => {
358
- console.error('Failed to switch to fallback model:', error);
359
- });
360
- config.setFallbackMode(true);
361
- logFlashFallback(config, new FlashFallbackEvent(config.getContentGeneratorConfig().authType));
362
- return false; // Don't continue with current prompt
363
- };
364
- config.setFlashFallbackHandler(flashFallbackHandler);
365
- }, [config, addItem, userTier]);
366
- // Terminal and UI setup
367
- const { rows: terminalHeight, columns: terminalWidth } = useTerminalSize();
368
- const isNarrow = isNarrowWidth(terminalWidth);
369
- const { stdin, setRawMode } = useStdin();
370
- const isInitialMount = useRef(true);
371
- const widthFraction = 0.9;
372
- const inputWidth = Math.max(20, Math.floor(terminalWidth * widthFraction) - 3);
373
- const suggestionsWidth = Math.max(20, Math.floor(terminalWidth * 0.8));
374
- // Utility callbacks
375
- const isValidPath = useCallback((filePath) => {
376
- try {
377
- return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
378
- }
379
- catch (_e) {
380
- return false;
381
- }
382
- }, []);
383
- const getPreferredEditor = useCallback(() => {
384
- const editorType = settings.merged.general?.preferredEditor;
385
- const isValidEditor = isEditorAvailable(editorType);
386
- if (!isValidEditor) {
387
- openEditorDialog();
388
- return;
389
- }
390
- return editorType;
391
- }, [settings, openEditorDialog]);
392
- const onAuthError = useCallback(() => {
393
- setAuthError('reauth required');
394
- openAuthDialog();
395
- }, [openAuthDialog, setAuthError]);
396
- // Vision switch handler for auto-switch functionality
397
- const handleVisionSwitchRequired = useCallback(async (_query) => new Promise((resolve, reject) => {
398
- setVisionSwitchResolver({ resolve, reject });
399
- setIsVisionSwitchDialogOpen(true);
400
- }), []);
401
- const handleVisionSwitchSelect = useCallback((outcome) => {
402
- setIsVisionSwitchDialogOpen(false);
403
- if (visionSwitchResolver) {
404
- const result = processVisionSwitchOutcome(outcome);
405
- visionSwitchResolver.resolve(result);
406
- setVisionSwitchResolver(null);
407
- }
408
- }, [visionSwitchResolver]);
409
- const handleModelSelectionOpen = useCallback(() => {
410
- setIsModelSelectionDialogOpen(true);
411
- }, []);
412
- const handleModelSelectionClose = useCallback(() => {
413
- setIsModelSelectionDialogOpen(false);
414
- }, []);
415
- const handleModelSelect = useCallback(async (modelId) => {
416
- try {
417
- await config.setModel(modelId);
418
- setCurrentModel(modelId);
419
- setIsModelSelectionDialogOpen(false);
420
- addItem({
421
- type: MessageType.INFO,
422
- text: `Switched model to \`${modelId}\` for this session.`,
423
- }, Date.now());
424
- }
425
- catch (error) {
426
- console.error('Failed to switch model:', error);
427
- addItem({
428
- type: MessageType.ERROR,
429
- text: `Failed to switch to model \`${modelId}\`. Please try again.`,
430
- }, Date.now());
431
- }
432
- }, [config, setCurrentModel, addItem]);
433
- const getAvailableModelsForCurrentAuth = useCallback(() => {
434
- const contentGeneratorConfig = config.getContentGeneratorConfig();
435
- if (!contentGeneratorConfig)
436
- return [];
437
- const visionModelPreviewEnabled = settings.merged.experimental?.visionModelPreview ?? true;
438
- switch (contentGeneratorConfig.authType) {
439
- case AuthType.QWEN_OAUTH:
440
- return getFilteredQwenModels(visionModelPreviewEnabled);
441
- case AuthType.USE_OPENAI: {
442
- const openAIModel = getOpenAIAvailableModelFromEnv();
443
- return openAIModel ? [openAIModel] : [];
444
- }
445
- default:
446
- return [];
447
- }
448
- }, [config, settings.merged.experimental?.visionModelPreview]);
449
- // Core hooks and processors
450
- const { vimEnabled: vimModeEnabled, vimMode, toggleVimEnabled, } = useVimMode();
451
- const { handleSlashCommand, slashCommands, pendingHistoryItems: pendingSlashCommandHistoryItems, commandContext, shellConfirmationRequest, confirmationRequest, quitConfirmationRequest, } = useSlashCommandProcessor(config, settings, addItem, clearItems, loadHistory, refreshStatic, setDebugMessage, openThemeDialog, openAuthDialog, openEditorDialog, toggleCorgiMode, setQuittingMessages, openSettingsDialog, handleModelSelectionOpen, openSubagentCreateDialog, openAgentsManagerDialog, toggleVimEnabled, setIsProcessing, setGeminiMdFileCount, showQuitConfirmation);
452
- const buffer = useTextBuffer({
453
- initialText: '',
454
- viewport: { height: 10, width: inputWidth },
455
- stdin,
456
- setRawMode,
457
- isValidPath,
458
- shellModeActive,
459
- });
460
- const [userMessages, setUserMessages] = useState([]);
461
- // Stable reference for cancel handler to avoid circular dependency
462
- const cancelHandlerRef = useRef(() => { });
463
- const { streamingState, submitQuery, initError, pendingHistoryItems: pendingGeminiHistoryItems, thought, cancelOngoingRequest, } = useGeminiStream(config.getGeminiClient(), history, addItem, config, setDebugMessage, handleSlashCommand, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, refreshStatic, () => cancelHandlerRef.current(), settings.merged.experimental?.visionModelPreview ?? true, handleVisionSwitchRequired);
464
- const pendingHistoryItems = useMemo(() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems].map((item, index) => ({
465
- ...item,
466
- id: index,
467
- })), [pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]);
468
- // Welcome back functionality
469
- const { welcomeBackInfo, showWelcomeBackDialog, welcomeBackChoice, handleWelcomeBackSelection, handleWelcomeBackClose, } = useWelcomeBack(config, submitQuery, buffer, settings.merged);
470
- // Dialog close functionality
471
- const { closeAnyOpenDialog } = useDialogClose({
472
- isThemeDialogOpen,
473
- handleThemeSelect,
474
- isAuthDialogOpen,
475
- handleAuthSelect,
476
- selectedAuthType: settings.merged.security?.auth?.selectedType,
477
- isEditorDialogOpen,
478
- exitEditorDialog,
479
- isSettingsDialogOpen,
480
- closeSettingsDialog,
481
- isFolderTrustDialogOpen,
482
- showWelcomeBackDialog,
483
- handleWelcomeBackClose,
484
- quitConfirmationRequest,
485
- });
486
- // Message queue for handling input during streaming
487
- const { messageQueue, addMessage, clearQueue, getQueuedMessagesText } = useMessageQueue({
488
- streamingState,
489
- submitQuery,
490
- });
491
- // Update the cancel handler with message queue support
492
- cancelHandlerRef.current = useCallback(() => {
493
- if (isToolExecuting(pendingHistoryItems)) {
494
- buffer.setText(''); // Just clear the prompt
495
- return;
496
- }
497
- const lastUserMessage = userMessages.at(-1);
498
- let textToSet = lastUserMessage || '';
499
- // Append queued messages if any exist
500
- const queuedText = getQueuedMessagesText();
501
- if (queuedText) {
502
- textToSet = textToSet ? `${textToSet}\n\n${queuedText}` : queuedText;
503
- clearQueue();
504
- }
505
- if (textToSet) {
506
- buffer.setText(textToSet);
507
- }
508
- }, [
509
- buffer,
510
- userMessages,
511
- getQueuedMessagesText,
512
- clearQueue,
513
- pendingHistoryItems,
514
- ]);
515
- // Input handling - queue messages for processing
516
- const handleFinalSubmit = useCallback((submittedValue) => {
517
- addMessage(submittedValue);
518
- }, [addMessage]);
519
- const handleIdePromptComplete = useCallback((result) => {
520
- if (result.userSelection === 'yes') {
521
- if (result.isExtensionPreInstalled) {
522
- handleSlashCommand('/ide enable');
523
- }
524
- else {
525
- handleSlashCommand('/ide install');
526
- }
527
- settings.setValue(SettingScope.User, 'hasSeenIdeIntegrationNudge', true);
528
- }
529
- else if (result.userSelection === 'dismiss') {
530
- settings.setValue(SettingScope.User, 'hasSeenIdeIntegrationNudge', true);
531
- }
532
- setIdePromptAnswered(true);
533
- }, [handleSlashCommand, settings]);
534
- const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
535
- const { elapsedTime, currentLoadingPhrase } = useLoadingIndicator(streamingState);
536
- const showAutoAcceptIndicator = useAutoAcceptIndicator({ config, addItem });
537
- const handleExit = useCallback((pressedOnce, setPressedOnce, timerRef) => {
538
- // Fast double-press: Direct quit (preserve user habit)
539
- if (pressedOnce) {
540
- if (timerRef.current) {
541
- clearTimeout(timerRef.current);
542
- }
543
- // Exit directly without showing confirmation dialog
544
- handleSlashCommand('/quit');
545
- return;
546
- }
547
- // First press: Prioritize cleanup tasks
548
- // Special case: If quit-confirm dialog is open, Ctrl+C means "quit immediately"
549
- if (quitConfirmationRequest) {
550
- handleSlashCommand('/quit');
551
- return;
552
- }
553
- /**
554
- * For AuthDialog it is required to complete the authentication process,
555
- * otherwise user cannot proceed to the next step.
556
- * So a quit on AuthDialog should go with normal two press quit
557
- * and without quit-confirm dialog.
558
- */
559
- if (isAuthDialogOpen) {
560
- setPressedOnce(true);
561
- timerRef.current = setTimeout(() => {
562
- setPressedOnce(false);
563
- }, 500);
564
- return;
565
- }
566
- //1. Close other dialogs (highest priority)
567
- if (closeAnyOpenDialog()) {
568
- return; // Dialog closed, end processing
569
- }
570
- // 2. Cancel ongoing requests
571
- if (streamingState === StreamingState.Responding) {
572
- cancelOngoingRequest?.();
573
- return; // Request cancelled, end processing
574
- }
575
- // 3. Clear input buffer (if has content)
576
- if (buffer.text.length > 0) {
577
- buffer.setText('');
578
- return; // Input cleared, end processing
579
- }
580
- // All cleanup tasks completed, show quit confirmation dialog
581
- handleSlashCommand('/quit-confirm');
582
- }, [
583
- isAuthDialogOpen,
584
- handleSlashCommand,
585
- quitConfirmationRequest,
586
- closeAnyOpenDialog,
587
- streamingState,
588
- cancelOngoingRequest,
589
- buffer,
590
- ]);
591
- const handleGlobalKeypress = useCallback((key) => {
592
- // Debug log keystrokes if enabled
593
- if (settings.merged.general?.debugKeystrokeLogging) {
594
- console.log('[DEBUG] Keystroke:', JSON.stringify(key));
595
- }
596
- let enteringConstrainHeightMode = false;
597
- if (!constrainHeight) {
598
- enteringConstrainHeightMode = true;
599
- setConstrainHeight(true);
600
- }
601
- if (keyMatchers[Command.SHOW_ERROR_DETAILS](key)) {
602
- setShowErrorDetails((prev) => !prev);
603
- }
604
- else if (keyMatchers[Command.TOGGLE_TOOL_DESCRIPTIONS](key)) {
605
- const newValue = !showToolDescriptions;
606
- setShowToolDescriptions(newValue);
607
- const mcpServers = config.getMcpServers();
608
- if (Object.keys(mcpServers || {}).length > 0) {
609
- handleSlashCommand(newValue ? '/mcp desc' : '/mcp nodesc');
610
- }
611
- }
612
- else if (keyMatchers[Command.TOGGLE_IDE_CONTEXT_DETAIL](key) &&
613
- config.getIdeMode() &&
614
- ideContextState) {
615
- // Show IDE status when in IDE mode and context is available.
616
- handleSlashCommand('/ide status');
617
- }
618
- else if (keyMatchers[Command.QUIT](key)) {
619
- // When authenticating, let AuthInProgress component handle Ctrl+C.
620
- if (isAuthenticating) {
621
- return;
622
- }
623
- handleExit(ctrlCPressedOnce, setCtrlCPressedOnce, ctrlCTimerRef);
624
- }
625
- else if (keyMatchers[Command.EXIT](key)) {
626
- if (buffer.text.length > 0) {
627
- return;
628
- }
629
- handleExit(ctrlDPressedOnce, setCtrlDPressedOnce, ctrlDTimerRef);
630
- }
631
- else if (keyMatchers[Command.SHOW_MORE_LINES](key) &&
632
- !enteringConstrainHeightMode) {
633
- setConstrainHeight(false);
634
- }
635
- }, [
636
- constrainHeight,
637
- setConstrainHeight,
638
- setShowErrorDetails,
639
- showToolDescriptions,
640
- setShowToolDescriptions,
641
- config,
642
- ideContextState,
643
- handleExit,
644
- ctrlCPressedOnce,
645
- setCtrlCPressedOnce,
646
- ctrlCTimerRef,
647
- buffer.text.length,
648
- ctrlDPressedOnce,
649
- setCtrlDPressedOnce,
650
- ctrlDTimerRef,
651
- handleSlashCommand,
652
- isAuthenticating,
653
- settings.merged.general?.debugKeystrokeLogging,
654
- ]);
655
- useKeypress(handleGlobalKeypress, {
656
- isActive: true,
657
- });
658
- useEffect(() => {
659
- if (config) {
660
- setGeminiMdFileCount(config.getGeminiMdFileCount());
661
- }
662
- }, [config, config.getGeminiMdFileCount]);
663
- const logger = useLogger(config.storage);
664
- useEffect(() => {
665
- const fetchUserMessages = async () => {
666
- const pastMessagesRaw = (await logger?.getPreviousUserMessages()) || []; // Newest first
667
- const currentSessionUserMessages = history
668
- .filter((item) => item.type === 'user' &&
669
- typeof item.text === 'string' &&
670
- item.text.trim() !== '')
671
- .map((item) => item.text)
672
- .reverse(); // Newest first, to match pastMessagesRaw sorting
673
- // Combine, with current session messages being more recent
674
- const combinedMessages = [
675
- ...currentSessionUserMessages,
676
- ...pastMessagesRaw,
677
- ];
678
- // Deduplicate consecutive identical messages from the combined list (still newest first)
679
- const deduplicatedMessages = [];
680
- if (combinedMessages.length > 0) {
681
- deduplicatedMessages.push(combinedMessages[0]); // Add the newest one unconditionally
682
- for (let i = 1; i < combinedMessages.length; i++) {
683
- if (combinedMessages[i] !== combinedMessages[i - 1]) {
684
- deduplicatedMessages.push(combinedMessages[i]);
685
- }
686
- }
687
- }
688
- // Reverse to oldest first for useInputHistory
689
- setUserMessages(deduplicatedMessages.reverse());
690
- };
691
- fetchUserMessages();
692
- }, [history, logger]);
693
- const isInputActive = (streamingState === StreamingState.Idle ||
694
- streamingState === StreamingState.Responding) &&
695
- !initError &&
696
- !isProcessing &&
697
- !showWelcomeBackDialog;
698
- const handleClearScreen = useCallback(() => {
699
- clearItems();
700
- clearConsoleMessagesState();
701
- console.clear();
702
- refreshStatic();
703
- }, [clearItems, clearConsoleMessagesState, refreshStatic]);
704
- const mainControlsRef = useRef(null);
705
- const pendingHistoryItemRef = useRef(null);
706
- useEffect(() => {
707
- if (mainControlsRef.current) {
708
- const fullFooterMeasurement = measureElement(mainControlsRef.current);
709
- setFooterHeight(fullFooterMeasurement.height);
710
- }
711
- }, [terminalHeight, consoleMessages, showErrorDetails]);
712
- const staticExtraHeight = /* margins and padding */ 3;
713
- const availableTerminalHeight = useMemo(() => terminalHeight - footerHeight - staticExtraHeight, [terminalHeight, footerHeight]);
714
- useEffect(() => {
715
- // skip refreshing Static during first mount
716
- if (isInitialMount.current) {
717
- isInitialMount.current = false;
718
- return;
719
- }
720
- // debounce so it doesn't fire up too often during resize
721
- const handler = setTimeout(() => {
722
- setStaticNeedsRefresh(false);
723
- refreshStatic();
724
- }, 300);
725
- return () => {
726
- clearTimeout(handler);
727
- };
728
- }, [terminalWidth, terminalHeight, refreshStatic]);
729
- useEffect(() => {
730
- if (streamingState === StreamingState.Idle && staticNeedsRefresh) {
731
- setStaticNeedsRefresh(false);
732
- refreshStatic();
733
- }
734
- }, [streamingState, refreshStatic, staticNeedsRefresh]);
735
- const filteredConsoleMessages = useMemo(() => {
736
- if (config.getDebugMode()) {
737
- return consoleMessages;
738
- }
739
- return consoleMessages.filter((msg) => msg.type !== 'debug');
740
- }, [consoleMessages, config]);
741
- const branchName = useGitBranchName(config.getTargetDir());
742
- const contextFileNames = useMemo(() => {
743
- const fromSettings = settings.merged.context?.fileName;
744
- if (fromSettings) {
745
- return Array.isArray(fromSettings) ? fromSettings : [fromSettings];
746
- }
747
- return getAllGeminiMdFilenames();
748
- }, [settings.merged.context?.fileName]);
749
- const initialPrompt = useMemo(() => config.getQuestion(), [config]);
750
- const geminiClient = config.getGeminiClient();
751
- useEffect(() => {
752
- if (initialPrompt &&
753
- !initialPromptSubmitted.current &&
754
- !isAuthenticating &&
755
- !isAuthDialogOpen &&
756
- !isThemeDialogOpen &&
757
- !isEditorDialogOpen &&
758
- !isModelSelectionDialogOpen &&
759
- !isVisionSwitchDialogOpen &&
760
- !isSubagentCreateDialogOpen &&
761
- !showWelcomeBackDialog &&
762
- welcomeBackChoice !== 'restart' &&
763
- geminiClient?.isInitialized?.()) {
764
- submitQuery(initialPrompt);
765
- initialPromptSubmitted.current = true;
766
- }
767
- }, [
768
- initialPrompt,
769
- submitQuery,
770
- isAuthenticating,
771
- isAuthDialogOpen,
772
- isThemeDialogOpen,
773
- isEditorDialogOpen,
774
- isSubagentCreateDialogOpen,
775
- showWelcomeBackDialog,
776
- welcomeBackChoice,
777
- geminiClient,
778
- isModelSelectionDialogOpen,
779
- isVisionSwitchDialogOpen,
780
- ]);
781
- if (quittingMessages) {
782
- return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: quittingMessages.map((item) => (_jsx(HistoryItemDisplay, { availableTerminalHeight: constrainHeight ? availableTerminalHeight : undefined, terminalWidth: terminalWidth, item: item, isPending: false, config: config }, item.id))) }));
27
+ export const App = () => {
28
+ const uiState = useUIState();
29
+ const isScreenReaderEnabled = useIsScreenReaderEnabled();
30
+ const { columns } = useTerminalSize();
31
+ const containerWidth = getContainerWidth(columns);
32
+ if (uiState.quittingMessages) {
33
+ return _jsx(QuittingDisplay, {});
783
34
  }
784
- const mainAreaWidth = Math.floor(terminalWidth * 0.9);
785
- const debugConsoleMaxHeight = Math.floor(Math.max(terminalHeight * 0.2, 5));
786
- // Arbitrary threshold to ensure that items in the static area are large
787
- // enough but not too large to make the terminal hard to use.
788
- const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
789
- const placeholder = vimModeEnabled
790
- ? " Press 'i' for INSERT mode and 'Esc' for NORMAL mode."
791
- : ' Type your message or @path/to/file';
792
- return (_jsx(StreamingContext.Provider, { value: streamingState, children: _jsxs(Box, { flexDirection: "column", width: "90%", children: [_jsx(Static, { items: [
793
- _jsxs(Box, { flexDirection: "column", children: [!(settings.merged.ui?.hideBanner || config.getScreenReader()) && _jsx(Header, { version: version, nightly: nightly }), !(settings.merged.ui?.hideTips || config.getScreenReader()) && (_jsx(Tips, { config: config }))] }, "header"),
794
- ...history.map((h) => (_jsx(HistoryItemDisplay, { terminalWidth: mainAreaWidth, availableTerminalHeight: staticAreaMaxItemHeight, item: h, isPending: false, config: config, commands: slashCommands }, h.id))),
795
- ], children: (item) => item }, staticKey), _jsx(OverflowProvider, { children: _jsxs(Box, { ref: pendingHistoryItemRef, flexDirection: "column", children: [pendingHistoryItems.map((item) => (_jsx(HistoryItemDisplay, { availableTerminalHeight: constrainHeight ? availableTerminalHeight : undefined, terminalWidth: mainAreaWidth, item: item, isPending: true, config: config, isFocused: !isEditorDialogOpen }, item.id))), _jsx(ShowMoreLines, { constrainHeight: constrainHeight })] }) }), _jsxs(Box, { flexDirection: "column", ref: mainControlsRef, children: [updateInfo && _jsx(UpdateNotification, { message: updateInfo.message }), startupWarnings.length > 0 && (_jsx(Box, { borderStyle: "round", borderColor: Colors.AccentYellow, paddingX: 1, marginY: 1, flexDirection: "column", children: startupWarnings.map((warning, index) => (_jsx(Text, { color: Colors.AccentYellow, children: warning }, index))) })), showWelcomeBackDialog && welcomeBackInfo?.hasHistory && (_jsx(WelcomeBackDialog, { welcomeBackInfo: welcomeBackInfo, onSelect: handleWelcomeBackSelection, onClose: handleWelcomeBackClose })), showWorkspaceMigrationDialog ? (_jsx(WorkspaceMigrationDialog, { workspaceExtensions: workspaceExtensions, onOpen: onWorkspaceMigrationDialogOpen, onClose: onWorkspaceMigrationDialogClose })) : shouldShowIdePrompt && currentIDE ? (_jsx(IdeIntegrationNudge, { ide: currentIDE, onComplete: handleIdePromptComplete })) : isFolderTrustDialogOpen ? (_jsx(FolderTrustDialog, { onSelect: handleFolderTrustSelect, isRestarting: isRestarting })) : quitConfirmationRequest ? (_jsx(QuitConfirmationDialog, { onSelect: (choice) => {
796
- const result = handleQuitConfirmationSelect(choice);
797
- if (result?.shouldQuit) {
798
- quitConfirmationRequest.onConfirm(true, result.action);
799
- }
800
- else {
801
- quitConfirmationRequest.onConfirm(false);
802
- }
803
- } })) : shellConfirmationRequest ? (_jsx(ShellConfirmationDialog, { request: shellConfirmationRequest })) : confirmationRequest ? (_jsxs(Box, { flexDirection: "column", children: [confirmationRequest.prompt, _jsx(Box, { paddingY: 1, children: _jsx(RadioButtonSelect, { isFocused: !!confirmationRequest, items: [
804
- { label: 'Yes', value: true },
805
- { label: 'No', value: false },
806
- ], onSelect: (value) => {
807
- confirmationRequest.onConfirm(value);
808
- } }) })] })) : isThemeDialogOpen ? (_jsxs(Box, { flexDirection: "column", children: [themeError && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: Colors.AccentRed, children: themeError }) })), _jsx(ThemeDialog, { onSelect: handleThemeSelect, onHighlight: handleThemeHighlight, settings: settings, availableTerminalHeight: constrainHeight
809
- ? terminalHeight - staticExtraHeight
810
- : undefined, terminalWidth: mainAreaWidth })] })) : isSettingsDialogOpen ? (_jsx(Box, { flexDirection: "column", children: _jsx(SettingsDialog, { settings: settings, onSelect: () => closeSettingsDialog(), onRestartRequest: () => process.exit(0) }) })) : isSubagentCreateDialogOpen ? (_jsx(Box, { flexDirection: "column", children: _jsx(AgentCreationWizard, { onClose: closeSubagentCreateDialog, config: config }) })) : isAgentsManagerDialogOpen ? (_jsx(Box, { flexDirection: "column", children: _jsx(AgentsManagerDialog, { onClose: closeAgentsManagerDialog, config: config }) })) : isAuthenticating ? (_jsxs(_Fragment, { children: [isQwenAuth && isQwenAuthenticating ? (_jsx(QwenOAuthProgress, { deviceAuth: deviceAuth || undefined, authStatus: authStatus, authMessage: authMessage, onTimeout: () => {
811
- setAuthError('Qwen OAuth authentication timed out. Please try again.');
812
- cancelQwenAuth();
813
- cancelAuthentication();
814
- openAuthDialog();
815
- }, onCancel: () => {
816
- setAuthError('Qwen OAuth authentication cancelled.');
817
- cancelQwenAuth();
818
- cancelAuthentication();
819
- openAuthDialog();
820
- } })) : (_jsx(AuthInProgress, { onTimeout: () => {
821
- setAuthError('Authentication timed out. Please try again.');
822
- cancelAuthentication();
823
- openAuthDialog();
824
- } })), showErrorDetails && (_jsx(OverflowProvider, { children: _jsxs(Box, { flexDirection: "column", children: [_jsx(DetailedMessagesDisplay, { messages: filteredConsoleMessages, maxHeight: constrainHeight ? debugConsoleMaxHeight : undefined, width: inputWidth }), _jsx(ShowMoreLines, { constrainHeight: constrainHeight })] }) }))] })) : isAuthDialogOpen ? (_jsx(Box, { flexDirection: "column", children: _jsx(AuthDialog, { onSelect: handleAuthSelect, settings: settings, initialErrorMessage: authError }) })) : isEditorDialogOpen ? (_jsxs(Box, { flexDirection: "column", children: [editorError && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: Colors.AccentRed, children: editorError }) })), _jsx(EditorSettingsDialog, { onSelect: handleEditorSelect, settings: settings, onExit: exitEditorDialog })] })) : isModelSelectionDialogOpen ? (_jsx(ModelSelectionDialog, { availableModels: getAvailableModelsForCurrentAuth(), currentModel: currentModel, onSelect: handleModelSelect, onCancel: handleModelSelectionClose })) : isVisionSwitchDialogOpen ? (_jsx(ModelSwitchDialog, { onSelect: handleVisionSwitchSelect })) : (_jsxs(_Fragment, { children: [_jsx(LoadingIndicator, { thought: streamingState === StreamingState.WaitingForConfirmation ||
825
- config.getAccessibility()?.disableLoadingPhrases ||
826
- config.getScreenReader()
827
- ? undefined
828
- : thought, currentLoadingPhrase: config.getAccessibility()?.disableLoadingPhrases ||
829
- config.getScreenReader()
830
- ? undefined
831
- : currentLoadingPhrase, elapsedTime: elapsedTime }), messageQueue.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [messageQueue
832
- .slice(0, MAX_DISPLAYED_QUEUED_MESSAGES)
833
- .map((message, index) => {
834
- // Ensure multi-line messages are collapsed for the preview.
835
- // Replace all whitespace (including newlines) with a single space.
836
- const preview = message.replace(/\s+/g, ' ');
837
- return (
838
- // Ensure the Box takes full width so truncation calculates correctly
839
- _jsx(Box, { paddingLeft: 2, width: "100%", children: _jsx(Text, { dimColor: true, wrap: "truncate", children: preview }) }, index));
840
- }), messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["... (+", messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES, "more)"] }) }))] })), _jsxs(Box, { marginTop: 1, justifyContent: "space-between", width: "100%", flexDirection: isNarrow ? 'column' : 'row', alignItems: isNarrow ? 'flex-start' : 'center', children: [_jsxs(Box, { children: [process.env['GEMINI_SYSTEM_MD'] && (_jsx(Text, { color: Colors.AccentRed, children: "|\u2310\u25A0_\u25A0| " })), ctrlCPressedOnce ? (_jsx(Text, { color: Colors.AccentYellow, children: "Press Ctrl+C again to confirm exit." })) : ctrlDPressedOnce ? (_jsx(Text, { color: Colors.AccentYellow, children: "Press Ctrl+D again to exit." })) : showEscapePrompt ? (_jsx(Text, { color: Colors.Gray, children: "Press Esc again to clear." })) : (_jsx(ContextSummaryDisplay, { ideContext: ideContextState, geminiMdFileCount: geminiMdFileCount, contextFileNames: contextFileNames, mcpServers: config.getMcpServers(), blockedMcpServers: config.getBlockedMcpServers(), showToolDescriptions: showToolDescriptions }))] }), _jsxs(Box, { paddingTop: isNarrow ? 1 : 0, children: [showAutoAcceptIndicator !== ApprovalMode.DEFAULT &&
841
- !shellModeActive && (_jsx(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator })), shellModeActive && _jsx(ShellModeIndicator, {})] })] }), showErrorDetails && (_jsx(OverflowProvider, { children: _jsxs(Box, { flexDirection: "column", children: [_jsx(DetailedMessagesDisplay, { messages: filteredConsoleMessages, maxHeight: constrainHeight ? debugConsoleMaxHeight : undefined, width: inputWidth }), _jsx(ShowMoreLines, { constrainHeight: constrainHeight })] }) })), isInputActive && (_jsx(InputPrompt, { buffer: buffer, inputWidth: inputWidth, suggestionsWidth: suggestionsWidth, onSubmit: handleFinalSubmit, userMessages: userMessages, onClearScreen: handleClearScreen, config: config, slashCommands: slashCommands, commandContext: commandContext, shellModeActive: shellModeActive, setShellModeActive: setShellModeActive, onEscapePromptChange: handleEscapePromptChange, focus: isFocused, vimHandleInput: vimHandleInput, placeholder: placeholder }))] })), initError && streamingState !== StreamingState.Responding && (_jsx(Box, { borderStyle: "round", borderColor: Colors.AccentRed, paddingX: 1, marginBottom: 1, children: history.find((item) => item.type === 'error' && item.text?.includes(initError))?.text ? (_jsx(Text, { color: Colors.AccentRed, children: history.find((item) => item.type === 'error' && item.text?.includes(initError))?.text })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { color: Colors.AccentRed, children: ["Initialization Error: ", initError] }), _jsxs(Text, { color: Colors.AccentRed, children: [' ', "Please check API key and configuration."] })] })) })), !settings.merged.ui?.hideFooter && (_jsx(Footer, { model: currentModel, targetDir: config.getTargetDir(), debugMode: config.getDebugMode(), branchName: branchName, debugMessage: debugMessage, corgiMode: corgiMode, errorCount: errorCount, showErrorDetails: showErrorDetails, showMemoryUsage: config.getDebugMode() ||
842
- settings.merged.ui?.showMemoryUsage ||
843
- false, promptTokenCount: sessionStats.lastPromptTokenCount, nightly: nightly, vimMode: vimModeEnabled ? vimMode : undefined, isTrustedFolder: isTrustedFolderState }))] })] }) }));
35
+ return (_jsx(StreamingContext.Provider, { value: uiState.streamingState, children: isScreenReaderEnabled ? (_jsx(ScreenReaderAppLayout, {})) : (_jsx(DefaultAppLayout, { width: containerWidth })) }));
844
36
  };
845
37
  //# sourceMappingURL=App.js.map