@google/gemini-cli 0.30.0-preview.5 → 0.31.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.
- package/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +7 -6
- package/dist/src/commands/extensions/install.js +72 -4
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +153 -20
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/utils.js +1 -0
- package/dist/src/commands/extensions/utils.js.map +1 -1
- package/dist/src/config/config.js +17 -5
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +79 -4
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager-hydration.test.js +2 -2
- package/dist/src/config/extension-manager-hydration.test.js.map +1 -1
- package/dist/src/config/extension-manager.js +10 -6
- package/dist/src/config/extension-manager.js.map +1 -1
- package/dist/src/config/extension.test.js +20 -20
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensionRegistryClient.js +3 -2
- package/dist/src/config/extensionRegistryClient.js.map +1 -1
- package/dist/src/config/extensionRegistryClient.test.js +52 -0
- package/dist/src/config/extensionRegistryClient.test.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +10 -0
- package/dist/src/config/extensions/consent.js +10 -3
- package/dist/src/config/extensions/consent.js.map +1 -1
- package/dist/src/config/extensions/consent.test.js +1 -1
- package/dist/src/config/extensions/consent.test.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.js +1 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.js +20 -3
- package/dist/src/config/extensions/extensionSettings.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.test.js +16 -0
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +1 -1
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/variables.js +3 -1
- package/dist/src/config/extensions/variables.js.map +1 -1
- package/dist/src/config/keyBindings.js +6 -2
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/policy-engine.integration.test.js +51 -13
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- package/dist/src/config/policy.d.ts +15 -3
- package/dist/src/config/policy.js +49 -4
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/policy.test.d.ts +6 -0
- package/dist/src/config/policy.test.js +152 -0
- package/dist/src/config/policy.test.js.map +1 -0
- package/dist/src/config/settings-validation.js +1 -1
- package/dist/src/config/settings-validation.js.map +1 -1
- package/dist/src/config/settings-validation.test.js +2 -3
- package/dist/src/config/settings-validation.test.js.map +1 -1
- package/dist/src/config/settings.d.ts +2 -0
- package/dist/src/config/settings.js +18 -20
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +118 -18
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +171 -9
- package/dist/src/config/settingsSchema.js +159 -9
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +26 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/settings_repro.test.js +0 -1
- package/dist/src/config/settings_repro.test.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +3 -1
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/config/workspace-policy-cli.test.d.ts +6 -0
- package/dist/src/config/workspace-policy-cli.test.js +180 -0
- package/dist/src/config/workspace-policy-cli.test.js.map +1 -0
- package/dist/src/gemini.d.ts +2 -2
- package/dist/src/gemini.js +15 -5
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +18 -2
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +27 -24
- package/dist/src/gemini_cleanup.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/integration-tests/modelSteering.test.d.ts +6 -0
- package/dist/src/integration-tests/modelSteering.test.js +65 -0
- package/dist/src/integration-tests/modelSteering.test.js.map +1 -0
- package/dist/src/nonInteractiveCli.js +2 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/test-utils/AppRig.d.ts +1 -1
- package/dist/src/test-utils/AppRig.js +16 -7
- package/dist/src/test-utils/AppRig.js.map +1 -1
- package/dist/src/test-utils/AppRig.test.js +37 -2
- package/dist/src/test-utils/AppRig.test.js.map +1 -1
- package/dist/src/test-utils/async.d.ts +1 -1
- package/dist/src/test-utils/async.js +1 -1
- package/dist/src/test-utils/async.js.map +1 -1
- package/dist/src/test-utils/customMatchers.js +1 -1
- package/dist/src/test-utils/customMatchers.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +8 -2
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/mockConfig.js +2 -1
- package/dist/src/test-utils/mockConfig.js.map +1 -1
- package/dist/src/test-utils/render.d.ts +81 -5
- package/dist/src/test-utils/render.js +299 -29
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/test-utils/render.test.js +49 -23
- package/dist/src/test-utils/render.test.js.map +1 -1
- package/dist/src/test-utils/settings.js +4 -2
- package/dist/src/test-utils/settings.js.map +1 -1
- package/dist/src/ui/App.test.js +56 -24
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +2 -2
- package/dist/src/ui/AppContainer.js +231 -11
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +561 -7
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.test.js +29 -33
- package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.test.js +19 -9
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.js +1 -1
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +61 -27
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthInProgress.test.js +35 -14
- package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +11 -5
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -1
- package/dist/src/ui/colors.js +6 -0
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +2 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.test.js +7 -1
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.js +2 -1
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.test.js +6 -4
- package/dist/src/ui/commands/copyCommand.test.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +18 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +4 -4
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/planCommand.js +1 -1
- package/dist/src/ui/commands/planCommand.js.map +1 -1
- package/dist/src/ui/commands/planCommand.test.js +1 -1
- package/dist/src/ui/commands/planCommand.test.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.js +5 -0
- package/dist/src/ui/commands/policiesCommand.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.test.js +38 -1
- package/dist/src/ui/commands/policiesCommand.test.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.js +3 -2
- package/dist/src/ui/commands/rewindCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.test.js +16 -8
- package/dist/src/ui/components/AboutBox.test.js.map +1 -1
- package/dist/src/ui/components/AdminSettingsChangedDialog.test.js +7 -4
- package/dist/src/ui/components/AdminSettingsChangedDialog.test.js.map +1 -1
- package/dist/src/ui/components/AgentConfigDialog.test.js +41 -19
- package/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +24 -12
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js +35 -19
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +27 -17
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/ApprovalModeIndicator.test.js +18 -12
- package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +1 -1
- package/dist/src/ui/components/AskUserDialog.test.js +147 -85
- package/dist/src/ui/components/AskUserDialog.test.js.map +1 -1
- package/dist/src/ui/components/BackgroundShellDisplay.test.js +50 -48
- package/dist/src/ui/components/BackgroundShellDisplay.test.js.map +1 -1
- package/dist/src/ui/components/Banner.test.js +8 -4
- package/dist/src/ui/components/Banner.test.js.map +1 -1
- package/dist/src/ui/components/Checklist.test.js +17 -12
- package/dist/src/ui/components/Checklist.test.js.map +1 -1
- package/dist/src/ui/components/ChecklistItem.test.js +9 -6
- package/dist/src/ui/components/ChecklistItem.test.js.map +1 -1
- package/dist/src/ui/components/CliSpinner.test.js +8 -5
- package/dist/src/ui/components/CliSpinner.test.js.map +1 -1
- package/dist/src/ui/components/Composer.js +5 -5
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +104 -100
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.test.js +3 -2
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ConsentPrompt.test.js +15 -8
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +9 -5
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +16 -14
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.test.js +12 -6
- package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/CopyModeWarning.test.js +9 -5
- package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.test.js +17 -14
- package/dist/src/ui/components/DebugProfiler.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +13 -7
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +5 -1
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/DialogManager.test.js +9 -5
- package/dist/src/ui/components/DialogManager.test.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.test.js +16 -8
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ExitPlanModeDialog.js +2 -2
- package/dist/src/ui/components/ExitPlanModeDialog.js.map +1 -1
- package/dist/src/ui/components/ExitPlanModeDialog.test.js +2 -2
- package/dist/src/ui/components/ExitPlanModeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ExitWarning.test.js +18 -10
- package/dist/src/ui/components/ExitWarning.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +2 -0
- package/dist/src/ui/components/FolderTrustDialog.js +49 -3
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +249 -18
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.test.js +101 -50
- package/dist/src/ui/components/Footer.test.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +23 -13
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -1
- package/dist/src/ui/components/GradientRegression.test.js +20 -10
- package/dist/src/ui/components/GradientRegression.test.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +2 -0
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/Help.test.js +9 -6
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +1 -2
- package/dist/src/ui/components/HistoryItemDisplay.js +4 -3
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +80 -35
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/HookStatusDisplay.test.js +13 -9
- package/dist/src/ui/components/HookStatusDisplay.test.js.map +1 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +36 -16
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +10 -12
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +127 -13
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +97 -47
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js +25 -9
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +9 -5
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/MainContent.js +35 -14
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/MainContent.test.js +224 -10
- package/dist/src/ui/components/MainContent.test.js.map +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.test.js +8 -3
- package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +6 -6
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +142 -16
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +38 -24
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +32 -9
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/NewAgentsNotification.test.js +6 -4
- package/dist/src/ui/components/NewAgentsNotification.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +50 -4
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/Notifications.test.js +162 -30
- package/dist/src/ui/components/Notifications.test.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +36 -10
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/PolicyUpdateDialog.d.ts +18 -0
- package/dist/src/ui/components/PolicyUpdateDialog.js +59 -0
- package/dist/src/ui/components/PolicyUpdateDialog.js.map +1 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.js +93 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +16 -11
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.test.js +9 -5
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/QuotaDisplay.test.js +40 -22
- package/dist/src/ui/components/QuotaDisplay.test.js.map +1 -1
- package/dist/src/ui/components/RawMarkdownIndicator.test.js +8 -4
- package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -1
- package/dist/src/ui/components/RewindConfirmation.test.js +15 -7
- package/dist/src/ui/components/RewindConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.js +9 -7
- package/dist/src/ui/components/RewindViewer.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.test.js +54 -17
- package/dist/src/ui/components/RewindViewer.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.test.js +24 -11
- package/dist/src/ui/components/SessionBrowser.test.js.map +1 -1
- package/dist/src/ui/components/SessionRetentionWarningDialog.test.js +12 -7
- package/dist/src/ui/components/SessionRetentionWarningDialog.test.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +7 -4
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.js +76 -7
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +252 -109
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.test.js +120 -67
- package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ShellModeIndicator.test.js +4 -2
- package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -1
- package/dist/src/ui/components/ShortcutsHelp.js +1 -1
- package/dist/src/ui/components/ShortcutsHelp.js.map +1 -1
- package/dist/src/ui/components/ShortcutsHelp.test.js +6 -3
- package/dist/src/ui/components/ShortcutsHelp.test.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.d.ts +2 -1
- package/dist/src/ui/components/ShowMoreLines.js +10 -5
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.test.js +47 -7
- package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +1 -0
- package/dist/src/ui/components/StatsDisplay.js +9 -3
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +51 -34
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.test.js +30 -17
- package/dist/src/ui/components/StatusDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StickyHeader.test.js +4 -2
- package/dist/src/ui/components/StickyHeader.test.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.test.js +19 -13
- package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/Table.test.js +9 -6
- package/dist/src/ui/components/Table.test.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +42 -19
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ThemedGradient.test.js +4 -2
- package/dist/src/ui/components/ThemedGradient.test.js.map +1 -1
- package/dist/src/ui/components/Tips.test.js +4 -2
- package/dist/src/ui/components/Tips.test.js.map +1 -1
- package/dist/src/ui/components/ToastDisplay.js +6 -1
- package/dist/src/ui/components/ToastDisplay.js.map +1 -1
- package/dist/src/ui/components/ToastDisplay.test.js +48 -17
- package/dist/src/ui/components/ToastDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.js +11 -8
- package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.test.js +75 -17
- package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.js +19 -12
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.test.js +4 -2
- package/dist/src/ui/components/UpdateNotification.test.js.map +1 -1
- package/dist/src/ui/components/UserIdentity.test.js +16 -11
- package/dist/src/ui/components/UserIdentity.test.js.map +1 -1
- package/dist/src/ui/components/ValidationDialog.test.js +33 -16
- package/dist/src/ui/components/ValidationDialog.test.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.js +99 -101
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.test.js +8 -4
- package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +5 -1
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.test.js +12 -6
- package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/HintMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/HintMessage.js +14 -0
- package/dist/src/ui/components/messages/HintMessage.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.d.ts +1 -0
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.test.js +12 -6
- package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +4 -2
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.d.ts +1 -2
- package/dist/src/ui/components/messages/ShellToolMessage.js +15 -29
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +91 -22
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ThinkingMessage.test.js +25 -13
- package/dist/src/ui/components/messages/ThinkingMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.test.js +34 -19
- package/dist/src/ui/components/messages/Todo.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +128 -13
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +175 -20
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +91 -35
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +286 -63
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +4 -4
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +118 -39
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +15 -6
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +4 -2
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js +79 -0
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js +25 -14
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +81 -31
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js +5 -5
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.d.ts +8 -0
- package/dist/src/ui/components/messages/ToolShared.js +27 -9
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolShared.test.js +52 -0
- package/dist/src/ui/components/messages/ToolShared.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +11 -4
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +1 -2
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.test.js +16 -8
- package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +1 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.test.js +8 -4
- package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +118 -106
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.js +22 -24
- package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +139 -40
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +10 -6
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -1
- package/dist/src/ui/components/shared/EnumSelector.test.js +42 -20
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -1
- package/dist/src/ui/components/shared/ExpandableText.test.js +21 -14
- package/dist/src/ui/components/shared/ExpandableText.test.js.map +1 -1
- package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js +8 -4
- package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +41 -30
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/Scrollable.js +2 -3
- package/dist/src/ui/components/shared/Scrollable.js.map +1 -1
- package/dist/src/ui/components/shared/Scrollable.test.js +33 -17
- package/dist/src/ui/components/shared/Scrollable.test.js.map +1 -1
- package/dist/src/ui/components/shared/ScrollableList.js +1 -1
- package/dist/src/ui/components/shared/ScrollableList.js.map +1 -1
- package/dist/src/ui/components/shared/ScrollableList.test.js +36 -6
- package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -1
- package/dist/src/ui/components/shared/SearchableList.d.ts +46 -14
- package/dist/src/ui/components/shared/SearchableList.js +69 -57
- package/dist/src/ui/components/shared/SearchableList.js.map +1 -1
- package/dist/src/ui/components/shared/SearchableList.test.js +67 -14
- package/dist/src/ui/components/shared/SearchableList.test.js.map +1 -1
- package/dist/src/ui/components/shared/SectionHeader.d.ts +1 -0
- package/dist/src/ui/components/shared/SectionHeader.js +1 -1
- package/dist/src/ui/components/shared/SectionHeader.js.map +1 -1
- package/dist/src/ui/components/shared/SectionHeader.test.js +9 -2
- package/dist/src/ui/components/shared/SectionHeader.test.js.map +1 -1
- package/dist/src/ui/components/shared/TabHeader.js +1 -1
- package/dist/src/ui/components/shared/TabHeader.js.map +1 -1
- package/dist/src/ui/components/shared/TabHeader.test.js +65 -25
- package/dist/src/ui/components/shared/TabHeader.test.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.test.js +111 -65
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.test.js +27 -35
- package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -1
- package/dist/src/ui/components/triage/TriageDuplicates.js +1 -0
- package/dist/src/ui/components/triage/TriageDuplicates.js.map +1 -1
- package/dist/src/ui/components/triage/TriageIssues.js +1 -0
- package/dist/src/ui/components/triage/TriageIssues.js.map +1 -1
- package/dist/src/ui/components/views/ChatList.test.js +9 -6
- package/dist/src/ui/components/views/ChatList.test.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionRegistryView.d.ts +15 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.js +60 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js +168 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +21 -19
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +38 -25
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.test.js +18 -12
- package/dist/src/ui/components/views/SkillsList.test.js.map +1 -1
- package/dist/src/ui/components/views/ToolsList.test.js +9 -6
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +1 -1
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/constants.d.ts +2 -1
- package/dist/src/ui/constants.js +2 -1
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +2 -1
- package/dist/src/ui/contexts/AppContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.js +37 -8
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +68 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +3 -3
- package/dist/src/ui/contexts/OverflowContext.js +5 -1
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -1
- package/dist/src/ui/contexts/TerminalContext.test.js +26 -15
- package/dist/src/ui/contexts/TerminalContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +6 -1
- package/dist/src/ui/contexts/UIActionsContext.js +1 -1
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +7 -1
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +6 -2
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +23 -11
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +30 -14
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.d.ts +2 -0
- package/dist/src/ui/hooks/toolMapping.js +13 -1
- package/dist/src/ui/hooks/toolMapping.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.test.js +42 -0
- package/dist/src/ui/hooks/toolMapping.test.js.map +1 -1
- package/dist/src/ui/hooks/useAnimatedScrollbar.js +13 -3
- package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +74 -22
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.js +88 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +2 -3
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +0 -4
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useConfirmingTool.d.ts +2 -6
- package/dist/src/ui/hooks/useConfirmingTool.js +2 -23
- package/dist/src/ui/hooks/useConfirmingTool.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +18 -6
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.test.js +4 -4
- package/dist/src/ui/hooks/useExtensionRegistry.d.ts +13 -0
- package/dist/src/ui/hooks/useExtensionRegistry.js +70 -0
- package/dist/src/ui/hooks/useExtensionRegistry.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +4 -1
- package/dist/src/ui/hooks/useFocus.js +7 -1
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.test.js +20 -11
- package/dist/src/ui/hooks/useFocus.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +2 -0
- package/dist/src/ui/hooks/useFolderTrust.js +15 -3
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +3 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +86 -20
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +150 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +3 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +9 -4
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouseClick.test.js +15 -7
- package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +4 -2
- package/dist/src/ui/hooks/usePhraseCycler.js +38 -26
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.js +123 -73
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +1 -2
- package/dist/src/ui/hooks/usePromptCompletion.js +2 -2
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useRegistrySearch.d.ts +19 -0
- package/dist/src/ui/hooks/useRegistrySearch.js +35 -0
- package/dist/src/ui/hooks/useRegistrySearch.js.map +1 -0
- package/dist/src/ui/hooks/useRunEventNotifications.d.ts +22 -0
- package/dist/src/ui/hooks/useRunEventNotifications.js +93 -0
- package/dist/src/ui/hooks/useRunEventNotifications.js.map +1 -0
- package/dist/src/ui/hooks/useSearchBuffer.d.ts +11 -0
- package/dist/src/ui/hooks/useSearchBuffer.js +24 -0
- package/dist/src/ui/hooks/useSearchBuffer.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +111 -45
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.js +3 -2
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.test.js +15 -12
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.js +2 -2
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useStateAndRef.js +1 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
- package/dist/src/ui/hooks/useTerminalTheme.test.js +29 -18
- package/dist/src/ui/hooks/useTerminalTheme.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.js +19 -2
- package/dist/src/ui/hooks/useToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +44 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +1 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.test.js +12 -6
- package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +24 -8
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +16 -5
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +16 -5
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/PrivacyNotice.test.js +4 -2
- package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +4 -0
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +2 -0
- package/dist/src/ui/themes/semantic-tokens.js +6 -2
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -1
- package/dist/src/ui/themes/solarized-dark.js +2 -0
- package/dist/src/ui/themes/solarized-dark.js.map +1 -1
- package/dist/src/ui/themes/solarized-light.js +2 -0
- package/dist/src/ui/themes/solarized-light.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.js +9 -4
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +2 -0
- package/dist/src/ui/themes/theme.js +20 -7
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/theme.test.js +7 -7
- package/dist/src/ui/themes/theme.test.js.map +1 -1
- package/dist/src/ui/types.d.ts +14 -2
- package/dist/src/ui/types.js +1 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +3 -5
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.test.js +4 -2
- package/dist/src/ui/utils/CodeColorizer.test.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +3 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +65 -33
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +7 -3
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.test.js +43 -22
- package/dist/src/ui/utils/TableRenderer.test.js.map +1 -1
- package/dist/src/ui/utils/borderStyles.d.ts +18 -0
- package/dist/src/ui/utils/borderStyles.js +78 -0
- package/dist/src/ui/utils/borderStyles.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +2 -1
- package/dist/src/ui/utils/commandUtils.js +8 -3
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +18 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/confirmingTool.d.ts +15 -0
- package/dist/src/ui/utils/confirmingTool.js +27 -0
- package/dist/src/ui/utils/confirmingTool.js.map +1 -0
- package/dist/src/ui/utils/pendingAttentionNotification.d.ts +12 -0
- package/dist/src/ui/utils/pendingAttentionNotification.js +101 -0
- package/dist/src/ui/utils/pendingAttentionNotification.js.map +1 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.d.ts +6 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.js +79 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.js.map +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.d.ts +2 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js +18 -0
- package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -1
- package/dist/src/ui/utils/terminalCapabilityManager.test.js +68 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.d.ts +24 -0
- package/dist/src/ui/utils/terminalSetup.js +130 -34
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.js +35 -1
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +4 -0
- package/dist/src/ui/utils/textUtils.js +10 -1
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.js +25 -2
- package/dist/src/ui/utils/textUtils.test.js.map +1 -1
- package/dist/src/ui/utils/toolLayoutUtils.d.ts +44 -0
- package/dist/src/ui/utils/toolLayoutUtils.js +73 -0
- package/dist/src/ui/utils/toolLayoutUtils.js.map +1 -0
- package/dist/src/ui/utils/urlSecurityUtils.d.ts +32 -0
- package/dist/src/ui/utils/urlSecurityUtils.js +71 -0
- package/dist/src/ui/utils/urlSecurityUtils.js.map +1 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.js +49 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.js.map +1 -0
- package/dist/src/utils/activityLogger.js +95 -24
- package/dist/src/utils/activityLogger.js.map +1 -1
- package/dist/src/utils/devtoolsService.js +1 -2
- package/dist/src/utils/devtoolsService.js.map +1 -1
- package/dist/src/utils/devtoolsService.test.js +1 -1
- package/dist/src/utils/devtoolsService.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.js +4 -1
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/gitUtils.js +2 -0
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/jsonoutput.js +2 -0
- package/dist/src/utils/jsonoutput.js.map +1 -1
- package/dist/src/utils/persistentState.d.ts +2 -0
- package/dist/src/utils/persistentState.js +1 -0
- package/dist/src/utils/persistentState.js.map +1 -1
- package/dist/src/utils/readStdin.js +1 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +1 -6
- package/dist/src/utils/sessionUtils.js +8 -101
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +47 -0
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/settingsUtils.js +2 -0
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/skillUtils.test.js +7 -5
- package/dist/src/utils/skillUtils.test.js.map +1 -1
- package/dist/src/utils/terminalNotifications.d.ts +25 -0
- package/dist/src/utils/terminalNotifications.js +77 -0
- package/dist/src/utils/terminalNotifications.js.map +1 -0
- package/dist/src/utils/terminalNotifications.test.d.ts +6 -0
- package/dist/src/utils/terminalNotifications.test.js +123 -0
- package/dist/src/utils/terminalNotifications.test.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +4 -1
- package/dist/src/utils/userStartupWarnings.js +22 -4
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +53 -11
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/zed-integration/acpErrors.js +2 -0
- package/dist/src/zed-integration/acpErrors.js.map +1 -1
- package/dist/src/zed-integration/acpResume.test.js +53 -3
- package/dist/src/zed-integration/acpResume.test.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.js +2 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +2 -0
- package/dist/src/zed-integration/zedIntegration.js +77 -6
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.test.js +176 -2
- package/dist/src/zed-integration/zedIntegration.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/dist/google-gemini-cli-0.30.0-preview.4.tgz +0 -0
- package/dist/src/ui/hooks/useFuzzyList.d.ts +0 -25
- package/dist/src/ui/hooks/useFuzzyList.js +0 -100
- package/dist/src/ui/hooks/useFuzzyList.js.map +0 -1
|
@@ -22,24 +22,25 @@ describe('useLoadingIndicator', () => {
|
|
|
22
22
|
act(() => vi.runOnlyPendingTimers);
|
|
23
23
|
vi.restoreAllMocks();
|
|
24
24
|
});
|
|
25
|
-
const renderLoadingIndicatorHook = (initialStreamingState, initialShouldShowFocusHint = false, initialRetryStatus = null) => {
|
|
25
|
+
const renderLoadingIndicatorHook = (initialStreamingState, initialShouldShowFocusHint = false, initialRetryStatus = null, loadingPhrasesMode = 'all') => {
|
|
26
26
|
let hookResult;
|
|
27
|
-
function TestComponent({ streamingState, shouldShowFocusHint, retryStatus, }) {
|
|
27
|
+
function TestComponent({ streamingState, shouldShowFocusHint, retryStatus, mode, }) {
|
|
28
28
|
hookResult = useLoadingIndicator({
|
|
29
29
|
streamingState,
|
|
30
30
|
shouldShowFocusHint: !!shouldShowFocusHint,
|
|
31
31
|
retryStatus: retryStatus || null,
|
|
32
|
+
loadingPhrasesMode: mode,
|
|
32
33
|
});
|
|
33
34
|
return null;
|
|
34
35
|
}
|
|
35
|
-
const { rerender } = render(_jsx(TestComponent, { streamingState: initialStreamingState, shouldShowFocusHint: initialShouldShowFocusHint, retryStatus: initialRetryStatus }));
|
|
36
|
+
const { rerender } = render(_jsx(TestComponent, { streamingState: initialStreamingState, shouldShowFocusHint: initialShouldShowFocusHint, retryStatus: initialRetryStatus, mode: loadingPhrasesMode }));
|
|
36
37
|
return {
|
|
37
38
|
result: {
|
|
38
39
|
get current() {
|
|
39
40
|
return hookResult;
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
|
-
rerender: (newProps) => rerender(_jsx(TestComponent, { ...newProps })),
|
|
43
|
+
rerender: (newProps) => rerender(_jsx(TestComponent, { mode: loadingPhrasesMode, ...newProps })),
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
it('should initialize with default values when Idle', () => {
|
|
@@ -141,5 +142,9 @@ describe('useLoadingIndicator', () => {
|
|
|
141
142
|
expect(result.current.currentLoadingPhrase).toContain('Trying to reach');
|
|
142
143
|
expect(result.current.currentLoadingPhrase).toContain('Attempt 3/3');
|
|
143
144
|
});
|
|
145
|
+
it('should show no phrases when loadingPhrasesMode is "off"', () => {
|
|
146
|
+
const { result } = renderLoadingIndicatorHook(StreamingState.Responding, false, null, 'off');
|
|
147
|
+
expect(result.current.currentLoadingPhrase).toBeUndefined();
|
|
148
|
+
});
|
|
144
149
|
});
|
|
145
150
|
//# sourceMappingURL=useLoadingIndicator.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadingIndicator.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useLoadingIndicator.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,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLoadingIndicator.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useLoadingIndicator.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,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CA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oBAAoB,CAAC,CAAC,aAAa,EAAE,CAAC;QAE5D,2BAA2B;QAC3B,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,MAAM,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,WAAW,GAAG;YAClB,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,OAAO,EAAE,IAAI;SACd,CAAC;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAC3C,cAAc,CAAC,UAAU,EACzB,KAAK,EACL,WAAW,CACZ,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACzE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAC3C,cAAc,CAAC,UAAU,EACzB,KAAK,EACL,IAAI,EACJ,KAAK,CACN,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -8,9 +8,13 @@ import { renderHook } from '../../test-utils/render.js';
|
|
|
8
8
|
import { useMouseClick } from './useMouseClick.js';
|
|
9
9
|
import { getBoundingBox } from 'ink';
|
|
10
10
|
// Mock ink
|
|
11
|
-
vi.mock('ink', async () =>
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
vi.mock('ink', async (importOriginal) => {
|
|
12
|
+
const actual = await importOriginal();
|
|
13
|
+
return {
|
|
14
|
+
...actual,
|
|
15
|
+
getBoundingBox: vi.fn(),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
14
18
|
// Mock MouseContext
|
|
15
19
|
const mockUseMouse = vi.fn();
|
|
16
20
|
vi.mock('../contexts/MouseContext.js', async () => ({
|
|
@@ -24,14 +28,15 @@ describe('useMouseClick', () => {
|
|
|
24
28
|
handler = vi.fn();
|
|
25
29
|
containerRef = { current: {} };
|
|
26
30
|
});
|
|
27
|
-
it('should call handler with relative coordinates when click is inside bounds', () => {
|
|
31
|
+
it('should call handler with relative coordinates when click is inside bounds', async () => {
|
|
28
32
|
vi.mocked(getBoundingBox).mockReturnValue({
|
|
29
33
|
x: 10,
|
|
30
34
|
y: 5,
|
|
31
35
|
width: 20,
|
|
32
36
|
height: 10,
|
|
33
37
|
});
|
|
34
|
-
renderHook(() => useMouseClick(containerRef, handler));
|
|
38
|
+
const { unmount, waitUntilReady } = renderHook(() => useMouseClick(containerRef, handler));
|
|
39
|
+
await waitUntilReady();
|
|
35
40
|
// Get the callback registered with useMouse
|
|
36
41
|
expect(mockUseMouse).toHaveBeenCalled();
|
|
37
42
|
const callback = mockUseMouse.mock.calls[0][0];
|
|
@@ -41,19 +46,22 @@ describe('useMouseClick', () => {
|
|
|
41
46
|
// relativeY = 7 - 5 = 2
|
|
42
47
|
callback({ name: 'left-press', col: 16, row: 8 });
|
|
43
48
|
expect(handler).toHaveBeenCalledWith(expect.objectContaining({ name: 'left-press' }), 5, 2);
|
|
49
|
+
unmount();
|
|
44
50
|
});
|
|
45
|
-
it('should not call handler when click is outside bounds', () => {
|
|
51
|
+
it('should not call handler when click is outside bounds', async () => {
|
|
46
52
|
vi.mocked(getBoundingBox).mockReturnValue({
|
|
47
53
|
x: 10,
|
|
48
54
|
y: 5,
|
|
49
55
|
width: 20,
|
|
50
56
|
height: 10,
|
|
51
57
|
});
|
|
52
|
-
renderHook(() => useMouseClick(containerRef, handler));
|
|
58
|
+
const { unmount, waitUntilReady } = renderHook(() => useMouseClick(containerRef, handler));
|
|
59
|
+
await waitUntilReady();
|
|
53
60
|
const callback = mockUseMouse.mock.calls[0][0];
|
|
54
61
|
// Click outside: x=5 (col 6), y=7 (row 8) -> left of box
|
|
55
62
|
callback({ name: 'left-press', col: 6, row: 8 });
|
|
56
63
|
expect(handler).not.toHaveBeenCalled();
|
|
64
|
+
unmount();
|
|
57
65
|
});
|
|
58
66
|
});
|
|
59
67
|
//# sourceMappingURL=useMouseClick.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMouseClick.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useMouseClick.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAa,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAmB,MAAM,KAAK,CAAC;AAGtD,WAAW;AACX,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useMouseClick.test.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useMouseClick.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAa,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAmB,MAAM,KAAK,CAAC;AAGtD,WAA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@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { LoadingPhrasesMode } from '../../config/settings.js';
|
|
6
7
|
export declare const PHRASE_CHANGE_INTERVAL_MS = 15000;
|
|
7
8
|
export declare const INTERACTIVE_SHELL_WAITING_PHRASE = "Interactive shell awaiting input... press tab to focus shell";
|
|
8
9
|
/**
|
|
@@ -10,7 +11,8 @@ export declare const INTERACTIVE_SHELL_WAITING_PHRASE = "Interactive shell await
|
|
|
10
11
|
* @param isActive Whether the phrase cycling should be active.
|
|
11
12
|
* @param isWaiting Whether to show a specific waiting phrase.
|
|
12
13
|
* @param shouldShowFocusHint Whether to show the shell focus hint.
|
|
13
|
-
* @param
|
|
14
|
+
* @param loadingPhrasesMode Which phrases to show: tips, witty, all, or off.
|
|
15
|
+
* @param customPhrases Optional list of custom phrases to use instead of built-in witty phrases.
|
|
14
16
|
* @returns The current loading phrase.
|
|
15
17
|
*/
|
|
16
|
-
export declare const usePhraseCycler: (isActive: boolean, isWaiting: boolean, shouldShowFocusHint: boolean, customPhrases?: string[]) => string | undefined;
|
|
18
|
+
export declare const usePhraseCycler: (isActive: boolean, isWaiting: boolean, shouldShowFocusHint: boolean, loadingPhrasesMode?: LoadingPhrasesMode, customPhrases?: string[]) => string | undefined;
|
|
@@ -13,14 +13,12 @@ export const INTERACTIVE_SHELL_WAITING_PHRASE = 'Interactive shell awaiting inpu
|
|
|
13
13
|
* @param isActive Whether the phrase cycling should be active.
|
|
14
14
|
* @param isWaiting Whether to show a specific waiting phrase.
|
|
15
15
|
* @param shouldShowFocusHint Whether to show the shell focus hint.
|
|
16
|
-
* @param
|
|
16
|
+
* @param loadingPhrasesMode Which phrases to show: tips, witty, all, or off.
|
|
17
|
+
* @param customPhrases Optional list of custom phrases to use instead of built-in witty phrases.
|
|
17
18
|
* @returns The current loading phrase.
|
|
18
19
|
*/
|
|
19
|
-
export const usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, customPhrases) => {
|
|
20
|
-
const
|
|
21
|
-
? customPhrases
|
|
22
|
-
: WITTY_LOADING_PHRASES;
|
|
23
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = useState(isActive ? loadingPhrases[0] : undefined);
|
|
20
|
+
export const usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, loadingPhrasesMode = 'tips', customPhrases) => {
|
|
21
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = useState(undefined);
|
|
24
22
|
const phraseIntervalRef = useRef(null);
|
|
25
23
|
const hasShownFirstRequestTipRef = useRef(false);
|
|
26
24
|
useEffect(() => {
|
|
@@ -37,31 +35,39 @@ export const usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, custom
|
|
|
37
35
|
setCurrentLoadingPhrase('Waiting for user confirmation...');
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
|
-
if (!isActive) {
|
|
38
|
+
if (!isActive || loadingPhrasesMode === 'off') {
|
|
41
39
|
setCurrentLoadingPhrase(undefined);
|
|
42
40
|
return;
|
|
43
41
|
}
|
|
42
|
+
const wittyPhrases = customPhrases && customPhrases.length > 0
|
|
43
|
+
? customPhrases
|
|
44
|
+
: WITTY_LOADING_PHRASES;
|
|
44
45
|
const setRandomPhrase = () => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
let phraseList;
|
|
47
|
+
switch (loadingPhrasesMode) {
|
|
48
|
+
case 'tips':
|
|
49
|
+
phraseList = INFORMATIVE_TIPS;
|
|
50
|
+
break;
|
|
51
|
+
case 'witty':
|
|
52
|
+
phraseList = wittyPhrases;
|
|
53
|
+
break;
|
|
54
|
+
case 'all':
|
|
55
|
+
// Show a tip on the first request after startup, then continue with 1/6 chance
|
|
56
|
+
if (!hasShownFirstRequestTipRef.current) {
|
|
57
|
+
phraseList = INFORMATIVE_TIPS;
|
|
58
|
+
hasShownFirstRequestTipRef.current = true;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const showTip = Math.random() < 1 / 6;
|
|
62
|
+
phraseList = showTip ? INFORMATIVE_TIPS : wittyPhrases;
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
54
66
|
phraseList = INFORMATIVE_TIPS;
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
// Roughly 1 in 6 chance to show a tip after the first request
|
|
59
|
-
const showTip = Math.random() < 1 / 6;
|
|
60
|
-
phraseList = showTip ? INFORMATIVE_TIPS : WITTY_LOADING_PHRASES;
|
|
61
|
-
}
|
|
62
|
-
const randomIndex = Math.floor(Math.random() * phraseList.length);
|
|
63
|
-
setCurrentLoadingPhrase(phraseList[randomIndex]);
|
|
67
|
+
break;
|
|
64
68
|
}
|
|
69
|
+
const randomIndex = Math.floor(Math.random() * phraseList.length);
|
|
70
|
+
setCurrentLoadingPhrase(phraseList[randomIndex]);
|
|
65
71
|
};
|
|
66
72
|
// Select an initial random phrase
|
|
67
73
|
setRandomPhrase();
|
|
@@ -75,7 +81,13 @@ export const usePhraseCycler = (isActive, isWaiting, shouldShowFocusHint, custom
|
|
|
75
81
|
phraseIntervalRef.current = null;
|
|
76
82
|
}
|
|
77
83
|
};
|
|
78
|
-
}, [
|
|
84
|
+
}, [
|
|
85
|
+
isActive,
|
|
86
|
+
isWaiting,
|
|
87
|
+
shouldShowFocusHint,
|
|
88
|
+
loadingPhrasesMode,
|
|
89
|
+
customPhrases,
|
|
90
|
+
]);
|
|
79
91
|
return currentLoadingPhrase;
|
|
80
92
|
};
|
|
81
93
|
//# sourceMappingURL=usePhraseCycler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePhraseCycler.js","sourceRoot":"","sources":["../../../../src/ui/hooks/usePhraseCycler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OA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O,GAAG,WAAW,CAAC,GAAG,EAAE;YAC3C,6BAA6B;YAC7B,eAAe,EAAE,CAAC;QACpB,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAE9B,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;QACD,QAAQ;QACR,SAAS;QACT,mBAAmB;QACnB,kBAAkB;QAClB,aAAa;KACd,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -5,15 +5,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
7
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
8
|
-
import { act } from 'react';
|
|
8
|
+
import React, { act } from 'react';
|
|
9
9
|
import { render } from '../../test-utils/render.js';
|
|
10
10
|
import { Text } from 'ink';
|
|
11
11
|
import { usePhraseCycler, PHRASE_CHANGE_INTERVAL_MS, } from './usePhraseCycler.js';
|
|
12
12
|
import { INFORMATIVE_TIPS } from '../constants/tips.js';
|
|
13
13
|
import { WITTY_LOADING_PHRASES } from '../constants/wittyPhrases.js';
|
|
14
14
|
// Test component to consume the hook
|
|
15
|
-
const TestComponent = ({ isActive, isWaiting, isInteractiveShellWaiting = false, customPhrases, }) => {
|
|
16
|
-
const phrase = usePhraseCycler(isActive, isWaiting, isInteractiveShellWaiting, customPhrases);
|
|
15
|
+
const TestComponent = ({ isActive, isWaiting, isInteractiveShellWaiting = false, loadingPhrasesMode = 'all', customPhrases, }) => {
|
|
16
|
+
const phrase = usePhraseCycler(isActive, isWaiting, isInteractiveShellWaiting, loadingPhrasesMode, customPhrases);
|
|
17
17
|
return _jsx(Text, { children: phrase });
|
|
18
18
|
};
|
|
19
19
|
describe('usePhraseCycler', () => {
|
|
@@ -21,80 +21,89 @@ describe('usePhraseCycler', () => {
|
|
|
21
21
|
vi.useFakeTimers();
|
|
22
22
|
});
|
|
23
23
|
afterEach(() => {
|
|
24
|
+
vi.useRealTimers();
|
|
24
25
|
vi.restoreAllMocks();
|
|
25
26
|
});
|
|
26
|
-
it('should initialize with an empty string when not active and not waiting', () => {
|
|
27
|
+
it('should initialize with an empty string when not active and not waiting', async () => {
|
|
27
28
|
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
|
|
28
|
-
const { lastFrame } = render(_jsx(TestComponent, { isActive: false, isWaiting: false }));
|
|
29
|
-
|
|
29
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: false, isWaiting: false }));
|
|
30
|
+
await waitUntilReady();
|
|
31
|
+
expect(lastFrame({ allowEmpty: true }).trim()).toBe('');
|
|
32
|
+
unmount();
|
|
30
33
|
});
|
|
31
34
|
it('should show "Waiting for user confirmation..." when isWaiting is true', async () => {
|
|
32
|
-
const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
33
|
-
|
|
35
|
+
const { lastFrame, rerender, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
36
|
+
await waitUntilReady();
|
|
34
37
|
await act(async () => {
|
|
35
|
-
|
|
38
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: true }));
|
|
36
39
|
});
|
|
37
|
-
|
|
40
|
+
await waitUntilReady();
|
|
41
|
+
expect(lastFrame().trim()).toMatchSnapshot();
|
|
42
|
+
unmount();
|
|
38
43
|
});
|
|
39
44
|
it('should show interactive shell waiting message immediately when isInteractiveShellWaiting is true', async () => {
|
|
40
|
-
const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
41
|
-
|
|
45
|
+
const { lastFrame, rerender, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
46
|
+
await waitUntilReady();
|
|
42
47
|
await act(async () => {
|
|
43
|
-
|
|
48
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, isInteractiveShellWaiting: true }));
|
|
44
49
|
});
|
|
45
|
-
|
|
50
|
+
await waitUntilReady();
|
|
51
|
+
expect(lastFrame().trim()).toMatchSnapshot();
|
|
52
|
+
unmount();
|
|
46
53
|
});
|
|
47
54
|
it('should prioritize interactive shell waiting over normal waiting immediately', async () => {
|
|
48
|
-
const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: true }));
|
|
49
|
-
await
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
expect(lastFrame()).toMatchSnapshot();
|
|
53
|
-
rerender(_jsx(TestComponent, { isActive: true, isWaiting: true, isInteractiveShellWaiting: true }));
|
|
55
|
+
const { lastFrame, rerender, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: true }));
|
|
56
|
+
await waitUntilReady();
|
|
57
|
+
expect(lastFrame().trim()).toMatchSnapshot();
|
|
54
58
|
await act(async () => {
|
|
55
|
-
|
|
59
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: true, isInteractiveShellWaiting: true }));
|
|
56
60
|
});
|
|
57
|
-
|
|
61
|
+
await waitUntilReady();
|
|
62
|
+
expect(lastFrame().trim()).toMatchSnapshot();
|
|
63
|
+
unmount();
|
|
58
64
|
});
|
|
59
65
|
it('should not cycle phrases if isActive is false and not waiting', async () => {
|
|
60
|
-
const { lastFrame } = render(_jsx(TestComponent, { isActive: false, isWaiting: false }));
|
|
61
|
-
|
|
66
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: false, isWaiting: false }));
|
|
67
|
+
await waitUntilReady();
|
|
68
|
+
const initialPhrase = lastFrame({ allowEmpty: true }).trim();
|
|
62
69
|
await act(async () => {
|
|
63
70
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS * 2);
|
|
64
71
|
});
|
|
65
|
-
|
|
72
|
+
await waitUntilReady();
|
|
73
|
+
expect(lastFrame({ allowEmpty: true }).trim()).toBe(initialPhrase);
|
|
74
|
+
unmount();
|
|
66
75
|
});
|
|
67
76
|
it('should show a tip on first activation, then a witty phrase', async () => {
|
|
68
77
|
vi.spyOn(Math, 'random').mockImplementation(() => 0.99); // Subsequent phrases are witty
|
|
69
|
-
const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
78
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
79
|
+
await waitUntilReady();
|
|
70
80
|
// Initial phrase on first activation should be a tip
|
|
71
|
-
|
|
72
|
-
await vi.advanceTimersByTimeAsync(0);
|
|
73
|
-
});
|
|
74
|
-
expect(INFORMATIVE_TIPS).toContain(lastFrame());
|
|
81
|
+
expect(INFORMATIVE_TIPS).toContain(lastFrame().trim());
|
|
75
82
|
// After the first interval, it should be a witty phrase
|
|
76
83
|
await act(async () => {
|
|
77
84
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
|
|
78
85
|
});
|
|
79
|
-
|
|
86
|
+
await waitUntilReady();
|
|
87
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
88
|
+
unmount();
|
|
80
89
|
});
|
|
81
90
|
it('should cycle through phrases when isActive is true and not waiting', async () => {
|
|
82
91
|
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
|
|
83
|
-
const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
await vi.advanceTimersByTimeAsync(0);
|
|
87
|
-
});
|
|
88
|
-
// First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
|
|
92
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
93
|
+
await waitUntilReady();
|
|
94
|
+
// Initial phrase on first activation will be a tip
|
|
89
95
|
// After the first interval, it should follow the random pattern (witty phrases due to mock)
|
|
90
96
|
await act(async () => {
|
|
91
97
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
|
|
92
98
|
});
|
|
93
|
-
|
|
99
|
+
await waitUntilReady();
|
|
100
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
94
101
|
await act(async () => {
|
|
95
102
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
|
|
96
103
|
});
|
|
97
|
-
|
|
104
|
+
await waitUntilReady();
|
|
105
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
106
|
+
unmount();
|
|
98
107
|
});
|
|
99
108
|
it('should reset to a phrase when isActive becomes true after being false', async () => {
|
|
100
109
|
const customPhrases = ['Phrase A', 'Phrase B'];
|
|
@@ -107,34 +116,46 @@ describe('usePhraseCycler', () => {
|
|
|
107
116
|
callCount++;
|
|
108
117
|
return val;
|
|
109
118
|
});
|
|
110
|
-
const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
|
|
119
|
+
const { lastFrame, rerender, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
|
|
120
|
+
await waitUntilReady();
|
|
111
121
|
// Activate -> On first activation will show tip on initial call, then first interval will use first mock value for 'Phrase A'
|
|
112
|
-
|
|
122
|
+
await act(async () => {
|
|
123
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
|
|
124
|
+
});
|
|
125
|
+
await waitUntilReady();
|
|
113
126
|
await act(async () => {
|
|
114
127
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after initial state -> callCount 0 -> 'Phrase A'
|
|
115
128
|
});
|
|
116
|
-
|
|
129
|
+
await waitUntilReady();
|
|
130
|
+
expect(customPhrases).toContain(lastFrame().trim()); // Should be one of the custom phrases
|
|
117
131
|
// Second interval -> callCount 1 -> returns 0.99 -> 'Phrase B'
|
|
118
132
|
await act(async () => {
|
|
119
133
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
|
|
120
134
|
});
|
|
121
|
-
|
|
135
|
+
await waitUntilReady();
|
|
136
|
+
expect(customPhrases).toContain(lastFrame().trim()); // Should be one of the custom phrases
|
|
122
137
|
// Deactivate -> resets to undefined (empty string in output)
|
|
123
|
-
rerender(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
|
|
124
138
|
await act(async () => {
|
|
125
|
-
|
|
139
|
+
rerender(_jsx(TestComponent, { isActive: false, isWaiting: false, customPhrases: customPhrases }));
|
|
126
140
|
});
|
|
141
|
+
await waitUntilReady();
|
|
127
142
|
// The phrase should be empty after reset
|
|
128
|
-
expect(lastFrame()).toBe('');
|
|
143
|
+
expect(lastFrame({ allowEmpty: true }).trim()).toBe('');
|
|
129
144
|
// Activate again -> this will show a tip on first activation, then cycle from where mock is
|
|
130
|
-
|
|
145
|
+
await act(async () => {
|
|
146
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: customPhrases }));
|
|
147
|
+
});
|
|
148
|
+
await waitUntilReady();
|
|
131
149
|
await act(async () => {
|
|
132
150
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // First interval after re-activation -> should contain phrase
|
|
133
151
|
});
|
|
134
|
-
|
|
152
|
+
await waitUntilReady();
|
|
153
|
+
expect(customPhrases).toContain(lastFrame().trim()); // Should be one of the custom phrases
|
|
154
|
+
unmount();
|
|
135
155
|
});
|
|
136
|
-
it('should clear phrase interval on unmount when active', () => {
|
|
137
|
-
const { unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
156
|
+
it('should clear phrase interval on unmount when active', async () => {
|
|
157
|
+
const { unmount, waitUntilReady } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
158
|
+
await waitUntilReady();
|
|
138
159
|
const clearIntervalSpy = vi.spyOn(global, 'clearInterval');
|
|
139
160
|
unmount();
|
|
140
161
|
expect(clearIntervalSpy).toHaveBeenCalledOnce();
|
|
@@ -142,67 +163,96 @@ describe('usePhraseCycler', () => {
|
|
|
142
163
|
it('should use custom phrases when provided', async () => {
|
|
143
164
|
const customPhrases = ['Custom Phrase 1', 'Custom Phrase 2'];
|
|
144
165
|
const randomMock = vi.spyOn(Math, 'random');
|
|
145
|
-
|
|
166
|
+
let setStateExternally;
|
|
167
|
+
const StatefulWrapper = () => {
|
|
168
|
+
const [config, setConfig] = React.useState({
|
|
169
|
+
isActive: true,
|
|
170
|
+
customPhrases,
|
|
171
|
+
});
|
|
172
|
+
setStateExternally = setConfig;
|
|
173
|
+
return (_jsx(TestComponent, { isActive: config.isActive, isWaiting: false, loadingPhrasesMode: "witty", customPhrases: config.customPhrases }));
|
|
174
|
+
};
|
|
175
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(StatefulWrapper, {}));
|
|
176
|
+
await waitUntilReady();
|
|
146
177
|
// After first interval, it should use custom phrases
|
|
147
178
|
await act(async () => {
|
|
148
179
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
|
|
149
180
|
});
|
|
181
|
+
await waitUntilReady();
|
|
150
182
|
randomMock.mockReturnValue(0);
|
|
151
|
-
|
|
183
|
+
await act(async () => {
|
|
184
|
+
setStateExternally?.({
|
|
185
|
+
isActive: true,
|
|
186
|
+
customPhrases,
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
await waitUntilReady();
|
|
152
190
|
await act(async () => {
|
|
153
191
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS + 100);
|
|
154
192
|
});
|
|
155
|
-
|
|
193
|
+
await waitUntilReady();
|
|
194
|
+
expect(customPhrases).toContain(lastFrame({ allowEmpty: true }).trim());
|
|
156
195
|
randomMock.mockReturnValue(0.99);
|
|
157
196
|
await act(async () => {
|
|
158
197
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
|
|
159
198
|
});
|
|
160
|
-
|
|
199
|
+
await waitUntilReady();
|
|
200
|
+
expect(customPhrases).toContain(lastFrame({ allowEmpty: true }).trim());
|
|
161
201
|
// Test fallback to default phrases.
|
|
162
202
|
randomMock.mockRestore();
|
|
163
203
|
vi.spyOn(Math, 'random').mockReturnValue(0.5); // Always witty
|
|
164
|
-
|
|
204
|
+
await act(async () => {
|
|
205
|
+
setStateExternally?.({
|
|
206
|
+
isActive: true,
|
|
207
|
+
customPhrases: [],
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
await waitUntilReady();
|
|
165
211
|
await act(async () => {
|
|
166
212
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Wait for first cycle
|
|
167
213
|
});
|
|
168
|
-
|
|
214
|
+
await waitUntilReady();
|
|
215
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
216
|
+
unmount();
|
|
169
217
|
});
|
|
170
218
|
it('should fall back to witty phrases if custom phrases are an empty array', async () => {
|
|
171
219
|
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
|
|
172
|
-
const { lastFrame } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
|
|
173
|
-
await
|
|
174
|
-
await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
|
|
175
|
-
});
|
|
176
|
-
// First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
|
|
220
|
+
const { lastFrame, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false, customPhrases: [] }));
|
|
221
|
+
await waitUntilReady();
|
|
177
222
|
await act(async () => {
|
|
178
223
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Next phrase after tip
|
|
179
224
|
});
|
|
180
|
-
|
|
225
|
+
await waitUntilReady();
|
|
226
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
227
|
+
unmount();
|
|
181
228
|
});
|
|
182
229
|
it('should reset phrase when transitioning from waiting to active', async () => {
|
|
183
230
|
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty for subsequent phrases
|
|
184
|
-
const { lastFrame, rerender } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
185
|
-
await
|
|
186
|
-
await vi.advanceTimersByTimeAsync(0); // First activation will be a tip
|
|
187
|
-
});
|
|
188
|
-
// First activation shows a tip, so we can't guarantee it's in WITTY_LOADING_PHRASES
|
|
231
|
+
const { lastFrame, rerender, waitUntilReady, unmount } = render(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
232
|
+
await waitUntilReady();
|
|
189
233
|
// Cycle to a different phrase (should be witty due to mock)
|
|
190
234
|
await act(async () => {
|
|
191
235
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS);
|
|
192
236
|
});
|
|
193
|
-
|
|
237
|
+
await waitUntilReady();
|
|
238
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
194
239
|
// Go to waiting state
|
|
195
|
-
rerender(_jsx(TestComponent, { isActive: false, isWaiting: true }));
|
|
196
240
|
await act(async () => {
|
|
197
|
-
|
|
241
|
+
rerender(_jsx(TestComponent, { isActive: false, isWaiting: true }));
|
|
198
242
|
});
|
|
199
|
-
|
|
243
|
+
await waitUntilReady();
|
|
244
|
+
expect(lastFrame().trim()).toMatchSnapshot();
|
|
200
245
|
// Go back to active cycling - should pick a phrase based on the logic (witty due to mock)
|
|
201
|
-
|
|
246
|
+
await act(async () => {
|
|
247
|
+
rerender(_jsx(TestComponent, { isActive: true, isWaiting: false }));
|
|
248
|
+
});
|
|
249
|
+
await waitUntilReady();
|
|
202
250
|
await act(async () => {
|
|
203
251
|
await vi.advanceTimersByTimeAsync(PHRASE_CHANGE_INTERVAL_MS); // Skip the tip and get next phrase
|
|
204
252
|
});
|
|
205
|
-
|
|
253
|
+
await waitUntilReady();
|
|
254
|
+
expect(WITTY_LOADING_PHRASES).toContain(lastFrame().trim());
|
|
255
|
+
unmount();
|
|
206
256
|
});
|
|
207
257
|
});
|
|
208
258
|
//# sourceMappingURL=usePhraseCycler.test.js.map
|