@google/gemini-cli 0.17.0-nightly.20251116.e650a4ee5 → 0.17.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/package.json +4 -3
  2. package/dist/src/commands/extensions/uninstall.d.ts +1 -1
  3. package/dist/src/commands/extensions/uninstall.js +24 -9
  4. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  5. package/dist/src/commands/extensions/uninstall.test.js +100 -28
  6. package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
  7. package/dist/src/config/config.js +1 -0
  8. package/dist/src/config/config.js.map +1 -1
  9. package/dist/src/config/keyBindings.d.ts +1 -1
  10. package/dist/src/config/keyBindings.js +4 -4
  11. package/dist/src/config/keyBindings.js.map +1 -1
  12. package/dist/src/config/settingsSchema.d.ts +10 -0
  13. package/dist/src/config/settingsSchema.js +10 -0
  14. package/dist/src/config/settingsSchema.js.map +1 -1
  15. package/dist/src/config/settingsSchema.test.js +9 -0
  16. package/dist/src/config/settingsSchema.test.js.map +1 -1
  17. package/dist/src/gemini.test.js +6 -0
  18. package/dist/src/gemini.test.js.map +1 -1
  19. package/dist/src/generated/git-commit.d.ts +2 -2
  20. package/dist/src/generated/git-commit.js +2 -2
  21. package/dist/src/generated/git-commit.js.map +1 -1
  22. package/dist/src/ui/App.test.js +4 -0
  23. package/dist/src/ui/App.test.js.map +1 -1
  24. package/dist/src/ui/AppContainer.js +38 -1
  25. package/dist/src/ui/AppContainer.js.map +1 -1
  26. package/dist/src/ui/AppContainer.test.js +18 -1
  27. package/dist/src/ui/AppContainer.test.js.map +1 -1
  28. package/dist/src/ui/commands/ideCommand.js +6 -4
  29. package/dist/src/ui/commands/ideCommand.js.map +1 -1
  30. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +12 -0
  31. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
  32. package/dist/src/ui/components/AppHeader.js +25 -3
  33. package/dist/src/ui/components/AppHeader.js.map +1 -1
  34. package/dist/src/ui/components/AppHeader.test.d.ts +6 -0
  35. package/dist/src/ui/components/AppHeader.test.js +138 -0
  36. package/dist/src/ui/components/AppHeader.test.js.map +1 -0
  37. package/dist/src/ui/components/Banner.d.ts +12 -0
  38. package/dist/src/ui/components/Banner.js +14 -0
  39. package/dist/src/ui/components/Banner.js.map +1 -0
  40. package/dist/src/ui/components/Composer.js +1 -1
  41. package/dist/src/ui/components/Composer.js.map +1 -1
  42. package/dist/src/ui/components/DialogManager.js +1 -1
  43. package/dist/src/ui/components/DialogManager.js.map +1 -1
  44. package/dist/src/ui/components/EditorSettingsDialog.d.ts +1 -1
  45. package/dist/src/ui/components/EditorSettingsDialog.js +2 -2
  46. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
  47. package/dist/src/ui/components/Footer.js +2 -2
  48. package/dist/src/ui/components/Footer.js.map +1 -1
  49. package/dist/src/ui/components/GradientRegression.test.d.ts +6 -0
  50. package/dist/src/ui/components/GradientRegression.test.js +84 -0
  51. package/dist/src/ui/components/GradientRegression.test.js.map +1 -0
  52. package/dist/src/ui/components/Header.js +2 -13
  53. package/dist/src/ui/components/Header.js.map +1 -1
  54. package/dist/src/ui/components/InputPrompt.d.ts +1 -0
  55. package/dist/src/ui/components/InputPrompt.js +18 -14
  56. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  57. package/dist/src/ui/components/InputPrompt.test.js +31 -0
  58. package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
  59. package/dist/src/ui/components/ModelDialog.js +38 -29
  60. package/dist/src/ui/components/ModelDialog.js.map +1 -1
  61. package/dist/src/ui/components/ModelDialog.test.js +19 -11
  62. package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
  63. package/dist/src/ui/components/ProQuotaDialog.d.ts +8 -2
  64. package/dist/src/ui/components/ProQuotaDialog.js +79 -14
  65. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
  66. package/dist/src/ui/components/ProQuotaDialog.test.js +146 -40
  67. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
  68. package/dist/src/ui/components/SettingsDialog.test.js +7 -7
  69. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  70. package/dist/src/ui/components/StatsDisplay.js +2 -2
  71. package/dist/src/ui/components/StatsDisplay.js.map +1 -1
  72. package/dist/src/ui/components/ThemedGradient.d.ts +8 -0
  73. package/dist/src/ui/components/ThemedGradient.js +15 -0
  74. package/dist/src/ui/components/ThemedGradient.js.map +1 -0
  75. package/dist/src/ui/components/shared/text-buffer.d.ts +1 -0
  76. package/dist/src/ui/components/shared/text-buffer.js +3 -0
  77. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  78. package/dist/src/ui/constants/tips.d.ts +6 -0
  79. package/dist/src/ui/constants/tips.js +168 -0
  80. package/dist/src/ui/constants/tips.js.map +1 -0
  81. package/dist/src/ui/constants/wittyPhrases.d.ts +6 -0
  82. package/dist/src/ui/constants/wittyPhrases.js +137 -0
  83. package/dist/src/ui/constants/wittyPhrases.js.map +1 -0
  84. package/dist/src/ui/contexts/UIActionsContext.d.ts +2 -1
  85. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
  86. package/dist/src/ui/contexts/UIStateContext.d.ts +8 -0
  87. package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
  88. package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -1
  89. package/dist/src/ui/editors/editorSettingsManager.js +1 -11
  90. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -1
  91. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
  92. package/dist/src/ui/hooks/slashCommandProcessor.js +3 -1
  93. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  94. package/dist/src/ui/hooks/slashCommandProcessor.test.js +1 -0
  95. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
  96. package/dist/src/ui/hooks/useAnimatedScrollbar.js +5 -2
  97. package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -1
  98. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +22 -0
  99. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -1
  100. package/dist/src/ui/hooks/useEditorSettings.js +2 -2
  101. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
  102. package/dist/src/ui/hooks/useEditorSettings.test.js +8 -3
  103. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
  104. package/dist/src/ui/hooks/useLoadingIndicator.test.js +6 -5
  105. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
  106. package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -2
  107. package/dist/src/ui/hooks/usePhraseCycler.js +15 -275
  108. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  109. package/dist/src/ui/hooks/usePhraseCycler.test.js +58 -28
  110. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
  111. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +1 -1
  112. package/dist/src/ui/hooks/useQuotaAndFallback.js +44 -31
  113. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
  114. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +106 -101
  115. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
  116. package/dist/src/ui/keyMatchers.test.js +2 -2
  117. package/dist/src/ui/keyMatchers.test.js.map +1 -1
  118. package/dist/src/ui/themes/color-utils.js +9 -0
  119. package/dist/src/ui/themes/color-utils.js.map +1 -1
  120. package/dist/src/ui/themes/color-utils.test.js +17 -0
  121. package/dist/src/ui/themes/color-utils.test.js.map +1 -1
  122. package/dist/src/ui/utils/commandUtils.js +3 -86
  123. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  124. package/dist/src/ui/utils/commandUtils.test.js +21 -273
  125. package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
  126. package/dist/src/utils/persistentState.d.ts +19 -0
  127. package/dist/src/utils/persistentState.js +65 -0
  128. package/dist/src/utils/persistentState.js.map +1 -0
  129. package/dist/tsconfig.tsbuildinfo +1 -1
  130. package/package.json +5 -4
  131. package/dist/google-gemini-cli-0.17.0-nightly.20251114.0fcbff506.tgz +0 -0
@@ -4,278 +4,8 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { useState, useEffect, useRef } from 'react';
7
- export const WITTY_LOADING_PHRASES = [
8
- "I'm Feeling Lucky",
9
- 'Shipping awesomeness... ',
10
- 'Painting the serifs back on...',
11
- 'Navigating the slime mold...',
12
- 'Consulting the digital spirits...',
13
- 'Reticulating splines...',
14
- 'Warming up the AI hamsters...',
15
- 'Asking the magic conch shell...',
16
- 'Generating witty retort...',
17
- 'Polishing the algorithms...',
18
- "Don't rush perfection (or my code)...",
19
- 'Brewing fresh bytes...',
20
- 'Counting electrons...',
21
- 'Engaging cognitive processors...',
22
- 'Checking for syntax errors in the universe...',
23
- 'One moment, optimizing humor...',
24
- 'Shuffling punchlines...',
25
- 'Untangling neural nets...',
26
- 'Compiling brilliance...',
27
- 'Loading wit.exe...',
28
- 'Summoning the cloud of wisdom...',
29
- 'Preparing a witty response...',
30
- "Just a sec, I'm debugging reality...",
31
- 'Confuzzling the options...',
32
- 'Tuning the cosmic frequencies...',
33
- 'Crafting a response worthy of your patience...',
34
- 'Compiling the 1s and 0s...',
35
- 'Resolving dependencies... and existential crises...',
36
- 'Defragmenting memories... both RAM and personal...',
37
- 'Rebooting the humor module...',
38
- 'Caching the essentials (mostly cat memes)...',
39
- 'Optimizing for ludicrous speed',
40
- "Swapping bits... don't tell the bytes...",
41
- 'Garbage collecting... be right back...',
42
- 'Assembling the interwebs...',
43
- 'Converting coffee into code...',
44
- 'Updating the syntax for reality...',
45
- 'Rewiring the synapses...',
46
- 'Looking for a misplaced semicolon...',
47
- "Greasin' the cogs of the machine...",
48
- 'Pre-heating the servers...',
49
- 'Calibrating the flux capacitor...',
50
- 'Engaging the improbability drive...',
51
- 'Channeling the Force...',
52
- 'Aligning the stars for optimal response...',
53
- 'So say we all...',
54
- 'Loading the next great idea...',
55
- "Just a moment, I'm in the zone...",
56
- 'Preparing to dazzle you with brilliance...',
57
- "Just a tick, I'm polishing my wit...",
58
- "Hold tight, I'm crafting a masterpiece...",
59
- "Just a jiffy, I'm debugging the universe...",
60
- "Just a moment, I'm aligning the pixels...",
61
- "Just a sec, I'm optimizing the humor...",
62
- "Just a moment, I'm tuning the algorithms...",
63
- 'Warp speed engaged...',
64
- 'Mining for more Dilithium crystals...',
65
- "Don't panic...",
66
- 'Following the white rabbit...',
67
- 'The truth is in here... somewhere...',
68
- 'Blowing on the cartridge...',
69
- 'Loading... Do a barrel roll!',
70
- 'Waiting for the respawn...',
71
- 'Finishing the Kessel Run in less than 12 parsecs...',
72
- "The cake is not a lie, it's just still loading...",
73
- 'Fiddling with the character creation screen...',
74
- "Just a moment, I'm finding the right meme...",
75
- "Pressing 'A' to continue...",
76
- 'Herding digital cats...',
77
- 'Polishing the pixels...',
78
- 'Finding a suitable loading screen pun...',
79
- 'Distracting you with this witty phrase...',
80
- 'Almost there... probably...',
81
- 'Our hamsters are working as fast as they can...',
82
- 'Giving Cloudy a pat on the head...',
83
- 'Petting the cat...',
84
- 'Rickrolling my boss...',
85
- 'Never gonna give you up, never gonna let you down...',
86
- 'Slapping the bass...',
87
- 'Tasting the snozberries...',
88
- "I'm going the distance, I'm going for speed...",
89
- 'Is this the real life? Is this just fantasy?...',
90
- "I've got a good feeling about this...",
91
- 'Poking the bear...',
92
- 'Doing research on the latest memes...',
93
- 'Figuring out how to make this more witty...',
94
- 'Hmmm... let me think...',
95
- 'What do you call a fish with no eyes? A fsh...',
96
- 'Why did the computer go to therapy? It had too many bytes...',
97
- "Why don't programmers like nature? It has too many bugs...",
98
- 'Why do programmers prefer dark mode? Because light attracts bugs...',
99
- 'Why did the developer go broke? Because they used up all their cache...',
100
- "What can you do with a broken pencil? Nothing, it's pointless...",
101
- 'Applying percussive maintenance...',
102
- 'Searching for the correct USB orientation...',
103
- 'Ensuring the magic smoke stays inside the wires...',
104
- 'Rewriting in Rust for no particular reason...',
105
- 'Trying to exit Vim...',
106
- 'Spinning up the hamster wheel...',
107
- "That's not a bug, it's an undocumented feature...",
108
- 'Engage.',
109
- "I'll be back... with an answer.",
110
- 'My other process is a TARDIS...',
111
- 'Communing with the machine spirit...',
112
- 'Letting the thoughts marinate...',
113
- 'Just remembered where I put my keys...',
114
- 'Pondering the orb...',
115
- "I've seen things you people wouldn't believe... like a user who reads loading messages.",
116
- 'Initiating thoughtful gaze...',
117
- "What's a computer's favorite snack? Microchips.",
118
- "Why do Java developers wear glasses? Because they don't C#.",
119
- 'Charging the laser... pew pew!',
120
- 'Dividing by zero... just kidding!',
121
- 'Looking for an adult superviso... I mean, processing.',
122
- 'Making it go beep boop.',
123
- 'Buffering... because even AIs need a moment.',
124
- 'Entangling quantum particles for a faster response...',
125
- 'Polishing the chrome... on the algorithms.',
126
- 'Are you not entertained? (Working on it!)',
127
- 'Summoning the code gremlins... to help, of course.',
128
- 'Just waiting for the dial-up tone to finish...',
129
- 'Recalibrating the humor-o-meter.',
130
- 'My other loading screen is even funnier.',
131
- "Pretty sure there's a cat walking on the keyboard somewhere...",
132
- 'Enhancing... Enhancing... Still loading.',
133
- "It's not a bug, it's a feature... of this loading screen.",
134
- 'Have you tried turning it off and on again? (The loading screen, not me.)',
135
- 'Constructing additional pylons...',
136
- 'New line? That’s Ctrl+J.',
137
- 'Releasing the HypnoDrones...',
138
- ];
139
- export const INFORMATIVE_TIPS = [
140
- //Settings tips start here
141
- 'Set your preferred editor for opening files (/settings)...',
142
- 'Toggle Vim mode for a modal editing experience (/settings)...',
143
- 'Disable automatic updates if you prefer manual control (/settings)...',
144
- 'Turn off nagging update notifications (settings.json)...',
145
- 'Enable checkpointing to recover your session after a crash (settings.json)...',
146
- 'Change CLI output format to JSON for scripting (/settings)...',
147
- 'Personalize your CLI with a new color theme (/settings)...',
148
- 'Create and use your own custom themes (settings.json)...',
149
- 'Hide window title for a more minimal UI (/settings)...',
150
- "Don't like these tips? You can hide them (/settings)...",
151
- 'Hide the startup banner for a cleaner launch (/settings)...',
152
- 'Reclaim vertical space by hiding the footer (/settings)...',
153
- 'Show memory usage for performance monitoring (/settings)...',
154
- 'Show citations to see where the model gets information (/settings)...',
155
- 'Disable loading phrases for a quieter experience (/settings)...',
156
- 'Add custom witty phrases to the loading screen (settings.json)...',
157
- 'Choose a specific Gemini model for conversations (/settings)...',
158
- 'Limit the number of turns in your session history (/settings)...',
159
- 'Automatically summarize large tool outputs to save tokens (settings.json)...',
160
- 'Control when chat history gets compressed based on token usage (settings.json)...',
161
- 'Define custom context file names, like CONTEXT.md (settings.json)...',
162
- 'Set max directories to scan for context files (/settings)...',
163
- 'Expand your workspace with additional directories (/directory)...',
164
- 'Control how /memory refresh loads context files (/settings)...',
165
- 'Toggle respect for .gitignore files in context (/settings)...',
166
- 'Toggle respect for .geminiignore files in context (/settings)...',
167
- 'Enable recursive file search for @-file completions (/settings)...',
168
- 'Run tools in a secure sandbox environment (settings.json)...',
169
- 'Use an interactive terminal for shell commands (/settings)...',
170
- 'Restrict available built-in tools (settings.json)...',
171
- 'Exclude specific tools from being used (settings.json)...',
172
- 'Bypass confirmation for trusted tools (settings.json)...',
173
- 'Use a custom command for tool discovery (settings.json)...',
174
- 'Define a custom command for calling discovered tools (settings.json)...',
175
- 'Define and manage connections to MCP servers (settings.json)...',
176
- 'Enable folder trust to enhance security (/settings)...',
177
- 'Change your authentication method (/settings)...',
178
- 'Enforce auth type for enterprise use (settings.json)...',
179
- 'Let Node.js auto-configure memory (settings.json)...',
180
- 'Customize the DNS resolution order (settings.json)...',
181
- 'Exclude env vars from the context (settings.json)...',
182
- 'Configure a custom command for filing bug reports (settings.json)...',
183
- 'Enable or disable telemetry collection (/settings)...',
184
- 'Send telemetry data to a local file or GCP (settings.json)...',
185
- 'Configure the OTLP endpoint for telemetry (settings.json)...',
186
- 'Choose whether to log prompt content (settings.json)...',
187
- 'Enable AI-powered prompt completion while typing (/settings)...',
188
- 'Enable debug logging of keystrokes to the console (/settings)...',
189
- 'Enable automatic session cleanup of old conversations (/settings)...',
190
- 'Show Gemini CLI status in the terminal window title (/settings)...',
191
- 'Use the entire width of the terminal for output (/settings)...',
192
- 'Enable screen reader mode for better accessibility (/settings)...',
193
- 'Skip the next speaker check for faster responses (/settings)...',
194
- 'Use ripgrep for faster file content search (/settings)...',
195
- 'Enable truncation of large tool outputs to save tokens (/settings)...',
196
- 'Set the character threshold for truncating tool outputs (/settings)...',
197
- 'Set the number of lines to keep when truncating outputs (/settings)...',
198
- 'Enable policy-based tool confirmation via message bus (/settings)...',
199
- 'Enable smart-edit tool for more precise editing (/settings)...',
200
- 'Enable write_todos tool to generate task lists (/settings)...',
201
- 'Enable model routing based on complexity (/settings)...',
202
- 'Enable experimental subagents for task delegation (/settings)...',
203
- //Settings tips end here
204
- // Keyboard shortcut tips start here
205
- 'Close dialogs and suggestions with Esc...',
206
- 'Cancel a request with Ctrl+C, or press twice to exit...',
207
- 'Exit the app with Ctrl+D on an empty line...',
208
- 'Clear your screen at any time with Ctrl+L...',
209
- 'Toggle the debug console display with F12...',
210
- 'See full, untruncated responses with Ctrl+S...',
211
- 'Toggle auto-approval (YOLO mode) for all tools with Ctrl+Y...',
212
- 'Toggle shell mode by typing ! in an empty prompt...',
213
- 'Insert a newline with a backslash (\\) followed by Enter...',
214
- 'Navigate your prompt history with the Up and Down arrows...',
215
- 'You can also use Ctrl+P (up) and Ctrl+N (down) for history...',
216
- 'Submit your prompt to Gemini with Enter...',
217
- 'Accept an autocomplete suggestion with Tab or Enter...',
218
- 'Move to the start of the line with Ctrl+A or Home...',
219
- 'Move to the end of the line with Ctrl+E or End...',
220
- 'Move one character left or right with Ctrl+B/F or the arrow keys...',
221
- 'Move one word left or right with Ctrl+Left/Right Arrow...',
222
- 'Delete the character to the left with Ctrl+H or Backspace...',
223
- 'Delete the character to the right with Ctrl+D or Delete...',
224
- 'Delete the word to the left of the cursor with Ctrl+W...',
225
- 'Delete the word to the right of the cursor with Ctrl+Delete...',
226
- 'Delete from the cursor to the start of the line with Ctrl+U...',
227
- 'Delete from the cursor to the end of the line with Ctrl+K...',
228
- 'Clear the entire input prompt with a double-press of Esc...',
229
- 'Paste from your clipboard with Ctrl+V...',
230
- 'Open the current prompt in an external editor with Ctrl+X...',
231
- 'In menus, move up/down with k/j or the arrow keys...',
232
- 'In menus, select an item by typing its number...',
233
- "If you're using an IDE, see the context with Ctrl+G...",
234
- // Keyboard shortcut tips end here
235
- // Command tips start here
236
- 'Show version info with /about...',
237
- 'Change your authentication method with /auth...',
238
- 'File a bug report directly with /bug...',
239
- 'List your saved chat checkpoints with /chat list...',
240
- 'Save your current conversation with /chat save <tag>...',
241
- 'Resume a saved conversation with /chat resume <tag>...',
242
- 'Delete a conversation checkpoint with /chat delete <tag>...',
243
- 'Share your conversation to a file with /chat share <file>...',
244
- 'Clear the screen and history with /clear...',
245
- 'Save tokens by summarizing the context with /compress...',
246
- 'Copy the last response to your clipboard with /copy...',
247
- 'Open the full documentation in your browser with /docs...',
248
- 'Add directories to your workspace with /directory add <path>...',
249
- 'Show all directories in your workspace with /directory show...',
250
- 'Set your preferred external editor with /editor...',
251
- 'List all active extensions with /extensions list...',
252
- 'Update all or specific extensions with /extensions update...',
253
- 'Get help on commands with /help...',
254
- 'Manage IDE integration with /ide...',
255
- 'Create a project-specific GEMINI.md file with /init...',
256
- 'List configured MCP servers and tools with /mcp list...',
257
- 'Authenticate with an OAuth-enabled MCP server with /mcp auth...',
258
- 'Restart MCP servers with /mcp refresh...',
259
- 'See the current instructional context with /memory show...',
260
- 'Add content to the instructional memory with /memory add...',
261
- 'Reload instructional context from GEMINI.md files with /memory refresh...',
262
- 'List the paths of the GEMINI.md files in use with /memory list...',
263
- 'Display the privacy notice with /privacy...',
264
- 'Exit the CLI with /quit or /exit...',
265
- 'Check model-specific usage stats with /stats model...',
266
- 'Check tool-specific usage stats with /stats tools...',
267
- "Change the CLI's color theme with /theme...",
268
- 'List all available tools with /tools...',
269
- 'View and edit settings with the /settings editor...',
270
- 'Toggle Vim keybindings on and off with /vim...',
271
- 'Set up GitHub Actions with /setup-github...',
272
- 'Configure terminal keybindings for multiline input with /terminal-setup...',
273
- 'Find relevant documentation with /find-docs...',
274
- 'Review a pull request with /oncall:pr-review...',
275
- 'Go back to main and clean up the branch with /github:cleanup-back-to-main...',
276
- 'Execute any shell command with !<command>...',
277
- // Command tips end here
278
- ];
7
+ import { INFORMATIVE_TIPS } from '../constants/tips.js';
8
+ import { WITTY_LOADING_PHRASES } from '../constants/wittyPhrases.js';
279
9
  export const PHRASE_CHANGE_INTERVAL_MS = 15000;
280
10
  /**
281
11
  * Custom hook to manage cycling through loading phrases.
@@ -289,6 +19,7 @@ export const usePhraseCycler = (isActive, isWaiting, customPhrases) => {
289
19
  : WITTY_LOADING_PHRASES;
290
20
  const [currentLoadingPhrase, setCurrentLoadingPhrase] = useState(loadingPhrases[0]);
291
21
  const phraseIntervalRef = useRef(null);
22
+ const hasShownFirstRequestTipRef = useRef(false);
292
23
  useEffect(() => {
293
24
  if (isWaiting) {
294
25
  setCurrentLoadingPhrase('Waiting for user confirmation...');
@@ -307,9 +38,18 @@ export const usePhraseCycler = (isActive, isWaiting, customPhrases) => {
307
38
  setCurrentLoadingPhrase(customPhrases[randomIndex]);
308
39
  }
309
40
  else {
310
- // Roughly 1 in 6 chance to show a tip.
311
- const showTip = Math.random() < 1 / 6;
312
- const phraseList = showTip ? INFORMATIVE_TIPS : WITTY_LOADING_PHRASES;
41
+ let phraseList;
42
+ // Show a tip on the first request after startup, then continue with 1/6 chance
43
+ if (!hasShownFirstRequestTipRef.current) {
44
+ // Show a tip during the first request
45
+ phraseList = INFORMATIVE_TIPS;
46
+ hasShownFirstRequestTipRef.current = true;
47
+ }
48
+ else {
49
+ // Roughly 1 in 6 chance to show a tip after the first request
50
+ const showTip = Math.random() < 1 / 6;
51
+ phraseList = showTip ? INFORMATIVE_TIPS : WITTY_LOADING_PHRASES;
52
+ }
313
53
  const randomIndex = Math.floor(Math.random() * phraseList.length);
314
54
  setCurrentLoadingPhrase(phraseList[randomIndex]);
315
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"usePhraseCycler.js","sourceRoot":"","sources":["../../../../src/ui/hooks/usePhraseCycler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB;IACnB,0BAA0B;IAC1B,gCAAgC;IAChC,8BAA8B;IAC9B,mCAAmC;IACnC,yBAAyB;IACzB,+BAA+B;IAC/B,iCAAiC;IACjC,4BAA4B;IAC5B,6BAA6B;IAC7B,uCAAuC;IACvC,wBAAwB;IACxB,uBAAuB;IACvB,kCAAkC;IAClC,+CAA+C;IAC/C,iCAAiC;IACjC,yBAAyB;IACzB,2BAA2B;IAC3B,yBAAyB;IACzB,oBAAoB;IACpB,kCAAkC;IAClC,+BAA+B;IAC/B,sCAAsC;IACtC,4BAA4B;IAC5B,kCAAkC;IAClC,gDAAgD;IAChD,4BAA4B;IAC5B,qDAAqD;IACrD,oDAAoD;IACpD,+BAA+B;IAC/B,8CAA8C;IAC9C,gCAAgC;IAChC,0CAA0C;IAC1C,wCAAwC;IACxC,6BAA6B;IAC7B,gCAAgC;IAChC,oCAAoC;IACpC,0BAA0B;IAC1B,sCAAsC;IACtC,qCAAqC;IACrC,4BAA4B;IAC5B,mCAAmC;IACnC,qCAAqC;IACrC,yBAAyB;IACzB,4CAA4C;IAC5C,kBAAkB;IAClB,gCAAgC;IAChC,mCAAmC;IACnC,4CAA4C;IAC5C,sCAAsC;IACtC,2CAA2C;IAC3C,6CAA6C;IAC7C,2CAA2C;IAC3C,yCAAyC;IACzC,6CAA6C;IAC7C,uBAAuB;IACvB,uCAAuC;IACvC,gBAAgB;IAChB,+BAA+B;IAC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AW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;oBAClE,uBAAuB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnD,CAAC;YACH,CAAC,CAAC;YAEF,kCAAkC;YAClC,eAAe,EAAE,CAAC;YAElB,iBAAiB,CAAC,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;gBAC3C,6BAA6B;gBAC7B,eAAe,EAAE,CAAC;YACpB,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,kDAAkD;YAClD,uDAAuD;YACvD,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;gBAC9B,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACzC,iBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC;YACnC,CAAC;YACD,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;gBAC9B,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACzC,iBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IAEzD,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC"}
@@ -8,7 +8,9 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
8
8
  import { act } from 'react';
9
9
  import { render } from '../../test-utils/render.js';
10
10
  import { Text } from 'ink';
11
- import { usePhraseCycler, WITTY_LOADING_PHRASES, PHRASE_CHANGE_INTERVAL_MS, } from './usePhraseCycler.js';
11
+ import { usePhraseCycler, PHRASE_CHANGE_INTERVAL_MS, } from './usePhraseCycler.js';
12
+ import { INFORMATIVE_TIPS } from '../constants/tips.js';
13
+ import { WITTY_LOADING_PHRASES } from '../constants/wittyPhrases.js';
12
14
  // Test component to consume the hook
13
15
  const TestComponent = ({ isActive, isWaiting, customPhrases, }) => {
14
16
  const phrase = usePhraseCycler(isActive, isWaiting, customPhrases);
@@ -42,14 +44,29 @@ describe('usePhraseCycler', () => {
42
44
  });
43
45
  expect(lastFrame()).toBe(initialPhrase);
44
46
  });
45
- it('should cycle through witty phrases when isActive is true and not waiting', async () => {
46
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
47
+ it('should show a tip on first activation, then a witty phrase', async () => {
48
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.99); // Subsequent phrases are witty
47
49
  const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
48
- // Initial phrase should be one of the witty phrases
50
+ // Initial phrase on first activation should be a tip
49
51
  await act(async () => {
50
52
  await vi.advanceTimersByTimeAsync(0);
51
53
  });
54
+ expect(INFORMATIVE_TIPS).toContain(lastFrame());
55
+ // After the first interval, it should be a witty phrase
56
+ await act(async () => {
57
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
58
+ });
52
59
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
60
+ });
61
+ it('should cycle through phrases when isActive is true and not waiting', async () => {
62
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
63
+ const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
64
+ // Initial phrase on first activation will be a tip, not necessarily from witty phrases
65
+ await act(async () => {
66
+ await vi.advanceTimersByTimeAsync(0);
67
+ });
68
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
69
+ // After the first interval, it should follow the random pattern (witty phrases due to mock)
53
70
  await act(async () => {
54
71
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
55
72
  });
@@ -71,29 +88,30 @@ describe('usePhraseCycler', () => {
71
88
  return val;
72
89
  });
73
90
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
74
- // Activate -> callCount 0 -> returns 0 -> 'Phrase A'
91
+ // Activate -> On first activation will show tip on initial call, then first interval will use first mock value for 'Phrase A'
75
92
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
76
93
  await act(async () => {
77
- await vi.advanceTimersByTimeAsync(0);
94
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after initial state -> callCount 0 -> 'Phrase A'
78
95
  });
79
- expect(lastFrame()).toBe('Phrase A');
80
- // Interval -> callCount 1 -> returns 0.99 -> 'Phrase B'
96
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
97
+ // Second interval -> callCount 1 -> returns 0.99 -> 'Phrase B'
81
98
  await act(async () => {
82
99
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
83
100
  });
84
- expect(lastFrame()).toBe('Phrase B');
85
- // Deactivate -> resets to customPhrases[0] -> 'Phrase A'
101
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
102
+ // Deactivate -> resets to first phrase in sequence
86
103
  rerender(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
87
104
  await act(async () => {
88
105
  await vi.advanceTimersByTimeAsync(0);
89
106
  });
90
- expect(lastFrame()).toBe('Phrase A');
91
- // Activate again -> callCount 2 -> returns 0 -> 'Phrase A'
107
+ // The phrase should be the first phrase after reset
108
+ expect(customPhrases).toContain(lastFrame());
109
+ // Activate again -> this will show a tip on first activation, then cycle from where mock is
92
110
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
93
111
  await act(async () => {
94
- await vi.advanceTimersByTimeAsync(0);
112
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after re-activation -> should contain phrase
95
113
  });
96
- expect(lastFrame()).toBe('Phrase A');
114
+ expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
97
115
  });
98
116
  it('should clear phrase interval on unmount when active', () => {
99
117
  const { unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
@@ -104,39 +122,51 @@ describe('usePhraseCycler', () => {
104
122
  it('should use custom phrases when provided', async () => {
105
123
  const customPhrases = ['Custom Phrase 1', 'Custom Phrase 2'];
106
124
  const randomMock = vi.spyOn(Math, 'random');
107
- randomMock.mockReturnValue(0);
108
125
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
109
- expect(lastFrame()).toBe('Custom Phrase 1');
110
- randomMock.mockReturnValue(0.99);
126
+ // After first interval, it should use custom phrases
111
127
  await act(async () => {
112
128
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
113
129
  });
114
- expect(lastFrame()).toBe('Custom Phrase 2');
130
+ randomMock.mockReturnValue(0);
131
+ rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
132
+ await act(async () => {
133
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
134
+ });
135
+ expect(customPhrases).toContain(lastFrame());
136
+ randomMock.mockReturnValue(0.99);
137
+ await act(async () => {
138
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
139
+ });
140
+ expect(customPhrases).toContain(lastFrame());
115
141
  // Test fallback to default phrases.
116
142
  randomMock.mockRestore();
117
143
  vi.spyOn(Math, 'random').mockReturnValue(0.5); // Always witty
118
144
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
119
145
  await act(async () => {
120
- await vi.advanceTimersByTimeAsync(0);
146
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Wait for first cycle
121
147
  });
122
148
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
123
149
  });
124
150
  it('should fall back to witty phrases if custom phrases are an empty array', async () => {
125
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
151
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
126
152
  const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
127
153
  await act(async () => {
128
- await vi.advanceTimersByTimeAsync(0);
154
+ await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
155
+ });
156
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
157
+ await act(async () => {
158
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Next phrase after tip
129
159
  });
130
160
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
131
161
  });
132
- it('should reset to a witty phrase when transitioning from waiting to active', async () => {
133
- vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
162
+ it('should reset phrase when transitioning from waiting to active', async () => {
163
+ vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
134
164
  const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
135
165
  await act(async () => {
136
- await vi.advanceTimersByTimeAsync(0);
166
+ await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
137
167
  });
138
- expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
139
- // Cycle to a different phrase (potentially)
168
+ // First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
169
+ // Cycle to a different phrase (should be witty due to mock)
140
170
  await act(async () => {
141
171
  await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
142
172
  });
@@ -147,10 +177,10 @@ describe('usePhraseCycler', () => {
147
177
  await vi.advanceTimersByTimeAsync(0);
148
178
  });
149
179
  expect(lastFrame()).toBe('Waiting for user confirmation...');
150
- // Go back to active cycling - should pick a random witty phrase
180
+ // Go back to active cycling - should pick a phrase based on the logic (witty due to mock)
151
181
  rerender(_jsx(TestComponent, { isActive: true, isWaiting: false }));
152
182
  await act(async () => {
153
- await vi.advanceTimersByTimeAsync(0);
183
+ await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Skip the tip and get next phrase
154
184
  });
155
185
  expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
156
186
  });
@@ -1 +1 @@
1
- {"version":3,"file":"usePhraseCycler.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/usePhraseCycler.test.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,qCAAqC;AACrC,MAAM,aAAa,GAAG,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,aAAa,GAKd,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IACnE,OAAO,KAAC,IAAI,cAAE,MAAM,GAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,eAAe,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,EAAE,CAAC,KAAK,CAAC,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QACvC,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QAE7D,0FAA0F;QAC1F,QAAQ,CAAC,KAAC,aAAa,IAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,GAAI,CAAC,CAAC;QAC9D,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,MAAM,EAAE,CAAC,wBAAwB,CAAC,yBAAyB,CAAC,CAAC,CAAC,mCAAmC;QACnG,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { type Config, type FallbackIntent, UserTierId } from '@google/gemini-cli-core';
6
+ import { type Config, type FallbackIntent, type UserTierId } from '@google/gemini-cli-core';
7
7
  import { type UseHistoryManagerReturn } from './useHistoryManager.js';
8
8
  import { type ProQuotaDialogRequest } from '../contexts/UIStateContext.js';
9
9
  interface UseQuotaAndFallbackArgs {