@machina.ai/cell-cli 1.19.4-rc3 → 1.22.5-rc1
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/dist/package.json +3 -3
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/disable.test.js.map +1 -1
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/enable.test.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +1 -1
- package/dist/src/commands/extensions/examples/mcp-server/example.test.ts +4 -12
- package/dist/src/commands/extensions/link.d.ts +1 -0
- package/dist/src/commands/extensions/link.js +15 -2
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/link.test.js +6 -0
- package/dist/src/commands/extensions/link.test.js.map +1 -1
- package/dist/src/commands/extensions/list.test.js +0 -1
- package/dist/src/commands/extensions/list.test.js.map +1 -1
- package/dist/src/commands/extensions/settings.d.ts +7 -0
- package/dist/src/commands/extensions/settings.js +111 -0
- package/dist/src/commands/extensions/settings.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.test.js.map +1 -1
- package/dist/src/commands/extensions/utils.d.ts +13 -0
- package/dist/src/commands/extensions/utils.js +29 -0
- package/dist/src/commands/extensions/utils.js.map +1 -0
- package/dist/src/commands/extensions.js +2 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/hooks/migrate.d.ts +11 -0
- package/dist/src/commands/hooks/migrate.js +206 -0
- package/dist/src/commands/hooks/migrate.js.map +1 -0
- package/dist/src/commands/hooks/migrate.test.js +389 -0
- package/dist/src/commands/hooks/migrate.test.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +7 -0
- package/dist/src/commands/hooks.js +22 -0
- package/dist/src/commands/hooks.js.map +1 -0
- package/dist/src/commands/mcp/add.js +4 -2
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/add.test.js +23 -1
- package/dist/src/commands/mcp/add.test.js.map +1 -1
- package/dist/src/commands/mcp/list.js +1 -1
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/config/config.js +15 -5
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +31 -11
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager.d.ts +1 -0
- package/dist/src/config/extension-manager.js +51 -9
- package/dist/src/config/extension-manager.js.map +1 -1
- package/dist/src/config/extension.test.js +88 -5
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +1 -1
- package/dist/src/config/extensions/consent.js +9 -6
- package/dist/src/config/extensions/consent.js.map +1 -1
- package/dist/src/config/extensions/consent.test.js +17 -7
- package/dist/src/config/extensions/consent.test.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.d.ts +6 -0
- package/dist/src/config/extensions/extensionSettings.js +87 -17
- package/dist/src/config/extensions/extensionSettings.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.test.js +189 -54
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
- package/dist/src/config/extensions/github.d.ts +4 -1
- package/dist/src/config/extensions/github.js +34 -8
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +188 -0
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/github_fetch.js.map +1 -1
- package/dist/src/config/extensions/storage.js +1 -1
- package/dist/src/config/extensions/storage.js.map +1 -1
- package/dist/src/config/settings-validation.d.ts +23 -0
- package/dist/src/config/settings-validation.js +249 -0
- package/dist/src/config/settings-validation.js.map +1 -0
- package/dist/src/{utils/version.d.ts → config/settings-validation.test.d.ts} +1 -1
- package/dist/src/config/settings-validation.test.js +322 -0
- package/dist/src/config/settings-validation.test.js.map +1 -0
- package/dist/src/config/settings.js +41 -2
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +27 -4
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +196 -5
- package/dist/src/config/settingsSchema.js +234 -4
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +10 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/settings_repro.test.d.ts +6 -0
- package/dist/src/config/settings_repro.test.js +162 -0
- package/dist/src/config/settings_repro.test.js.map +1 -0
- package/dist/src/core/initializer.js +3 -1
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/gemini.js +61 -14
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +204 -130
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +2 -1
- 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/nonInteractiveCli.js +8 -10
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +24 -10
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +5 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +4 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FeedbackService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +1 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +40 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/test-utils/render.js +1 -0
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/AppContainer.js +76 -69
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +205 -75
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.js +36 -3
- package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.test.js +26 -2
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.js +12 -4
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +14 -3
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/useAuth.js +14 -4
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/auth/useAuth.test.js +13 -2
- package/dist/src/ui/auth/useAuth.test.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +3 -3
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.test.js +3 -6
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
- package/dist/src/ui/commands/authCommand.js +1 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +3 -3
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.test.js +3 -3
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.js +8 -2
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.test.js +16 -16
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +19 -1
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.test.js +2 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.js +1 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.js +1 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +1 -0
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +2 -0
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/docsCommand.js +1 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -1
- package/dist/src/ui/commands/editorCommand.js +1 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +8 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.js +1 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/hooksCommand.d.ts +7 -0
- package/dist/src/ui/commands/hooksCommand.js +207 -0
- package/dist/src/ui/commands/hooksCommand.js.map +1 -0
- package/dist/src/ui/commands/hooksCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/hooksCommand.test.js +396 -0
- package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.js +6 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -1
- package/dist/src/ui/commands/initCommand.js +11 -50
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +32 -8
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.js +29 -0
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +5 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.js +11 -5
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.test.js +12 -1
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
- package/dist/src/ui/commands/permissionsCommand.js +2 -0
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.js +2 -0
- package/dist/src/ui/commands/policiesCommand.js.map +1 -1
- package/dist/src/ui/commands/privacyCommand.js +1 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/profileCommand.js +1 -0
- package/dist/src/ui/commands/profileCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.js +1 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +38 -32
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.test.js +6 -6
- package/dist/src/ui/commands/restoreCommand.test.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.js +1 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.js +1 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js +4 -1
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js +55 -14
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js +15 -5
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.test.js +17 -0
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/terminalSetupCommand.js +2 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -1
- package/dist/src/ui/commands/themeCommand.js +1 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +1 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +9 -37
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.js +1 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.js +1 -1
- package/dist/src/ui/components/AnsiOutput.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +8 -0
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +6 -6
- package/dist/src/ui/components/AsciiArt.js +6 -6
- package/dist/src/ui/components/ConfigInitDisplay.js +15 -2
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.test.js +34 -4
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +3 -3
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +2 -12
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +1 -1
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.test.js +7 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.js +6 -2
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +2 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.js +2 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +3 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -1
- package/dist/src/ui/components/Header.js +3 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +3 -1
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +2 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/IdeTrustChangeDialog.js +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +1 -1
- package/dist/src/ui/components/InputPrompt.js +45 -18
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +286 -17
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +116 -39
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +157 -148
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js +3 -3
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +9 -2
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.js +1 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +2 -0
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.js +14 -12
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +20 -21
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.js +2 -0
- package/dist/src/ui/components/SessionBrowser.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.js +135 -66
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +98 -10
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +4 -4
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +4 -4
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +2 -0
- package/dist/src/ui/components/StatsDisplay.js +88 -12
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +94 -7
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +54 -19
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +40 -4
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +45 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.js +46 -39
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +100 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/components/views/HooksList.d.ts +22 -0
- package/dist/src/ui/components/views/HooksList.js +23 -0
- package/dist/src/ui/components/views/HooksList.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +2 -1
- package/dist/src/ui/components/views/McpStatus.js +13 -3
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +13 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +0 -1
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +1 -0
- package/dist/src/ui/contexts/SessionContext.js +2 -1
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.test.js +3 -0
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +7 -6
- package/dist/src/ui/hooks/atCommandProcessor.js +141 -28
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +124 -32
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +2 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +3 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +52 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.js +21 -0
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +10 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +50 -6
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +4 -5
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.js +2 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +5 -3
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +4 -4
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +19 -56
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +4 -0
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +3 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.js +2 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +2 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +1 -1
- package/dist/src/ui/hooks/useMessageQueue.js +8 -12
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +7 -19
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -16
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +3 -9
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.js +1 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.js +20 -21
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +7 -7
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +2 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.js +1 -0
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.js +2 -0
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +3 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +21 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSnowfall.d.ts +6 -0
- package/dist/src/ui/hooks/useSnowfall.js +126 -0
- package/dist/src/ui/hooks/useSnowfall.js.map +1 -0
- package/dist/src/ui/hooks/useSnowfall.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSnowfall.test.js +88 -0
- package/dist/src/ui/hooks/useSnowfall.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +14 -4
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/types.d.ts +28 -3
- package/dist/src/ui/types.js +1 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +6 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +21 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +25 -0
- package/dist/src/ui/utils/clipboardUtils.js +98 -12
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.js +123 -1
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +12 -0
- package/dist/src/ui/utils/commandUtils.js +125 -1
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +163 -6
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.js +2 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/computeStats.test.js +9 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -1
- package/dist/src/ui/utils/highlight.js +5 -1
- package/dist/src/ui/utils/highlight.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.js +5 -0
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
- package/dist/src/ui/utils/textOutput.d.ts +2 -0
- package/dist/src/ui/utils/textOutput.js +5 -1
- package/dist/src/ui/utils/textOutput.js.map +1 -1
- package/dist/src/utils/cleanup.d.ts +6 -0
- package/dist/src/utils/cleanup.js +19 -1
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/deepMerge.js +7 -2
- package/dist/src/utils/deepMerge.js.map +1 -1
- package/dist/src/utils/deepMerge.test.js +58 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/envVarResolver.test.js.map +1 -1
- package/dist/src/utils/errors.js +4 -4
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +20 -2
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +1 -1
- package/dist/src/utils/handleAutoUpdate.js +7 -10
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +13 -11
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.js +1 -1
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +1 -1
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/sandbox.js +2 -2
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandboxUtils.js +3 -2
- package/dist/src/utils/sandboxUtils.js.map +1 -1
- package/dist/src/utils/sandboxUtils.test.js +3 -0
- package/dist/src/utils/sandboxUtils.test.js.map +1 -1
- package/dist/src/utils/sessionCleanup.integration.test.js +3 -3
- package/dist/src/utils/sessionCleanup.integration.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +9 -0
- package/dist/src/utils/sessionUtils.js +16 -1
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +201 -1
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +6 -4
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/sessions.test.js +26 -0
- package/dist/src/utils/sessions.test.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +3 -3
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.js +4 -4
- package/dist/src/zed-integration/acp.js.map +1 -1
- package/dist/src/zed-integration/acp.test.js +8 -21
- package/dist/src/zed-integration/acp.test.js.map +1 -1
- package/dist/src/zed-integration/connection.js +2 -0
- package/dist/src/zed-integration/connection.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +0 -1
- package/dist/src/zed-integration/fileSystemService.js +0 -3
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/fileSystemService.test.js +0 -8
- package/dist/src/zed-integration/fileSystemService.test.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +0 -46
- package/dist/src/zed-integration/schema.js +0 -1
- package/dist/src/zed-integration/schema.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.js +17 -11
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.test.js +0 -5
- package/dist/src/zed-integration/zedIntegration.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/utils/version.js +0 -15
- package/dist/src/utils/version.js.map +0 -1
- package/dist/src/utils/version.test.js +0 -39
- package/dist/src/utils/version.test.js.map +0 -1
- /package/dist/src/{utils/version.test.d.ts → commands/hooks/migrate.test.d.ts} +0 -0
|
@@ -36,14 +36,23 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
|
36
36
|
writeToStdout: vi.fn((...args) => process.stdout.write(...args)),
|
|
37
37
|
writeToStderr: vi.fn((...args) => process.stderr.write(...args)),
|
|
38
38
|
patchStdio: vi.fn(() => () => { }),
|
|
39
|
-
|
|
39
|
+
createWorkingStdio: vi.fn(() => ({
|
|
40
40
|
stdout: process.stdout,
|
|
41
41
|
stderr: process.stderr,
|
|
42
42
|
})),
|
|
43
43
|
enableMouseEvents: vi.fn(),
|
|
44
44
|
disableMouseEvents: vi.fn(),
|
|
45
|
+
FileDiscoveryService: vi.fn().mockImplementation(() => ({
|
|
46
|
+
initialize: vi.fn(),
|
|
47
|
+
})),
|
|
48
|
+
startupProfiler: {
|
|
49
|
+
flush: vi.fn(),
|
|
50
|
+
start: vi.fn(),
|
|
51
|
+
end: vi.fn(),
|
|
52
|
+
},
|
|
45
53
|
};
|
|
46
54
|
});
|
|
55
|
+
import ansiEscapes from 'ansi-escapes';
|
|
47
56
|
import { useQuotaAndFallback } from './hooks/useQuotaAndFallback.js';
|
|
48
57
|
import { UIStateContext } from './contexts/UIStateContext.js';
|
|
49
58
|
import { UIActionsContext, } from './contexts/UIActionsContext.js';
|
|
@@ -95,6 +104,7 @@ vi.mock('./contexts/VimModeContext.js');
|
|
|
95
104
|
vi.mock('./contexts/SessionContext.js');
|
|
96
105
|
vi.mock('./components/shared/text-buffer.js');
|
|
97
106
|
vi.mock('./hooks/useLogger.js');
|
|
107
|
+
vi.mock('./hooks/useInputHistoryStore.js');
|
|
98
108
|
// Mock external utilities
|
|
99
109
|
vi.mock('../utils/events.js');
|
|
100
110
|
vi.mock('../utils/handleAutoUpdate.js');
|
|
@@ -120,6 +130,7 @@ import { useSessionStats } from './contexts/SessionContext.js';
|
|
|
120
130
|
import { useTextBuffer } from './components/shared/text-buffer.js';
|
|
121
131
|
import { useLogger } from './hooks/useLogger.js';
|
|
122
132
|
import { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
|
|
133
|
+
import { useInputHistoryStore } from './hooks/useInputHistoryStore.js';
|
|
123
134
|
import { useKeypress } from './hooks/useKeypress.js';
|
|
124
135
|
import { measureElement } from 'ink';
|
|
125
136
|
import { useTerminalSize } from './hooks/useTerminalSize.js';
|
|
@@ -157,6 +168,7 @@ describe('AppContainer State Management', () => {
|
|
|
157
168
|
const mockedUseLogger = useLogger;
|
|
158
169
|
const mockedUseLoadingIndicator = useLoadingIndicator;
|
|
159
170
|
const mockedUseKeypress = useKeypress;
|
|
171
|
+
const mockedUseInputHistoryStore = useInputHistoryStore;
|
|
160
172
|
beforeEach(() => {
|
|
161
173
|
vi.clearAllMocks();
|
|
162
174
|
// Initialize mock stdout for terminal title tests
|
|
@@ -267,7 +279,12 @@ describe('AppContainer State Management', () => {
|
|
|
267
279
|
// Add other properties if AppContainer uses them
|
|
268
280
|
});
|
|
269
281
|
mockedUseLogger.mockReturnValue({
|
|
270
|
-
getPreviousUserMessages: vi.fn().
|
|
282
|
+
getPreviousUserMessages: vi.fn().mockResolvedValue([]),
|
|
283
|
+
});
|
|
284
|
+
mockedUseInputHistoryStore.mockReturnValue({
|
|
285
|
+
inputHistory: [],
|
|
286
|
+
addInput: vi.fn(),
|
|
287
|
+
initializeFromLogger: vi.fn(),
|
|
271
288
|
});
|
|
272
289
|
mockedUseLoadingIndicator.mockReturnValue({
|
|
273
290
|
elapsedTime: '0.0s',
|
|
@@ -277,6 +294,8 @@ describe('AppContainer State Management', () => {
|
|
|
277
294
|
mockConfig = makeFakeConfig();
|
|
278
295
|
// Mock config's getTargetDir to return consistent workspace directory
|
|
279
296
|
vi.spyOn(mockConfig, 'getTargetDir').mockReturnValue('/test/workspace');
|
|
297
|
+
vi.spyOn(mockConfig, 'initialize').mockResolvedValue(undefined);
|
|
298
|
+
vi.spyOn(mockConfig, 'getDebugMode').mockReturnValue(false);
|
|
280
299
|
mockExtensionManager = vi.mockObject({
|
|
281
300
|
getExtensions: vi.fn().mockReturnValue([]),
|
|
282
301
|
setRequestConsent: vi.fn(),
|
|
@@ -312,13 +331,21 @@ describe('AppContainer State Management', () => {
|
|
|
312
331
|
});
|
|
313
332
|
describe('Basic Rendering', () => {
|
|
314
333
|
it('renders without crashing with minimal props', async () => {
|
|
315
|
-
|
|
334
|
+
let unmount;
|
|
335
|
+
await act(async () => {
|
|
336
|
+
const result = renderAppContainer();
|
|
337
|
+
unmount = result.unmount;
|
|
338
|
+
});
|
|
316
339
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
317
340
|
unmount();
|
|
318
341
|
});
|
|
319
342
|
it('renders with startup warnings', async () => {
|
|
320
343
|
const startupWarnings = ['Warning 1', 'Warning 2'];
|
|
321
|
-
|
|
344
|
+
let unmount;
|
|
345
|
+
await act(async () => {
|
|
346
|
+
const result = renderAppContainer({ startupWarnings });
|
|
347
|
+
unmount = result.unmount;
|
|
348
|
+
});
|
|
322
349
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
323
350
|
unmount();
|
|
324
351
|
});
|
|
@@ -329,8 +356,12 @@ describe('AppContainer State Management', () => {
|
|
|
329
356
|
...mockInitResult,
|
|
330
357
|
themeError: 'Failed to load theme',
|
|
331
358
|
};
|
|
332
|
-
|
|
333
|
-
|
|
359
|
+
let unmount;
|
|
360
|
+
await act(async () => {
|
|
361
|
+
const result = renderAppContainer({
|
|
362
|
+
initResult: initResultWithError,
|
|
363
|
+
});
|
|
364
|
+
unmount = result.unmount;
|
|
334
365
|
});
|
|
335
366
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
336
367
|
unmount();
|
|
@@ -345,23 +376,39 @@ describe('AppContainer State Management', () => {
|
|
|
345
376
|
});
|
|
346
377
|
describe('Context Providers', () => {
|
|
347
378
|
it('provides AppContext with correct values', async () => {
|
|
348
|
-
|
|
379
|
+
let unmount;
|
|
380
|
+
await act(async () => {
|
|
381
|
+
const result = renderAppContainer({ version: '2.0.0' });
|
|
382
|
+
unmount = result.unmount;
|
|
383
|
+
});
|
|
349
384
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
350
385
|
// Should render and unmount cleanly
|
|
351
386
|
expect(() => unmount()).not.toThrow();
|
|
352
387
|
});
|
|
353
388
|
it('provides UIStateContext with state management', async () => {
|
|
354
|
-
|
|
389
|
+
let unmount;
|
|
390
|
+
await act(async () => {
|
|
391
|
+
const result = renderAppContainer();
|
|
392
|
+
unmount = result.unmount;
|
|
393
|
+
});
|
|
355
394
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
356
395
|
unmount();
|
|
357
396
|
});
|
|
358
397
|
it('provides UIActionsContext with action handlers', async () => {
|
|
359
|
-
|
|
398
|
+
let unmount;
|
|
399
|
+
await act(async () => {
|
|
400
|
+
const result = renderAppContainer();
|
|
401
|
+
unmount = result.unmount;
|
|
402
|
+
});
|
|
360
403
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
361
404
|
unmount();
|
|
362
405
|
});
|
|
363
406
|
it('provides ConfigContext with config object', async () => {
|
|
364
|
-
|
|
407
|
+
let unmount;
|
|
408
|
+
await act(async () => {
|
|
409
|
+
const result = renderAppContainer();
|
|
410
|
+
unmount = result.unmount;
|
|
411
|
+
});
|
|
365
412
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
366
413
|
unmount();
|
|
367
414
|
});
|
|
@@ -376,7 +423,11 @@ describe('AppContainer State Management', () => {
|
|
|
376
423
|
showMemoryUsage: false,
|
|
377
424
|
},
|
|
378
425
|
};
|
|
379
|
-
|
|
426
|
+
let unmount;
|
|
427
|
+
await act(async () => {
|
|
428
|
+
const result = renderAppContainer({ settings: settingsAllHidden });
|
|
429
|
+
unmount = result.unmount;
|
|
430
|
+
});
|
|
380
431
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
381
432
|
unmount();
|
|
382
433
|
});
|
|
@@ -389,14 +440,22 @@ describe('AppContainer State Management', () => {
|
|
|
389
440
|
showMemoryUsage: true,
|
|
390
441
|
},
|
|
391
442
|
};
|
|
392
|
-
|
|
443
|
+
let unmount;
|
|
444
|
+
await act(async () => {
|
|
445
|
+
const result = renderAppContainer({ settings: settingsWithMemory });
|
|
446
|
+
unmount = result.unmount;
|
|
447
|
+
});
|
|
393
448
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
394
449
|
unmount();
|
|
395
450
|
});
|
|
396
451
|
});
|
|
397
452
|
describe('Version Handling', () => {
|
|
398
453
|
it.each(['1.0.0', '2.1.3-beta', '3.0.0-nightly'])('handles version format: %s', async (version) => {
|
|
399
|
-
|
|
454
|
+
let unmount;
|
|
455
|
+
await act(async () => {
|
|
456
|
+
const result = renderAppContainer({ version });
|
|
457
|
+
unmount = result.unmount;
|
|
458
|
+
});
|
|
400
459
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
401
460
|
unmount();
|
|
402
461
|
});
|
|
@@ -415,7 +474,11 @@ describe('AppContainer State Management', () => {
|
|
|
415
474
|
const undefinedSettings = {
|
|
416
475
|
merged: {},
|
|
417
476
|
};
|
|
418
|
-
|
|
477
|
+
let unmount;
|
|
478
|
+
await act(async () => {
|
|
479
|
+
const result = renderAppContainer({ settings: undefinedSettings });
|
|
480
|
+
unmount = result.unmount;
|
|
481
|
+
});
|
|
419
482
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
420
483
|
unmount();
|
|
421
484
|
});
|
|
@@ -711,7 +774,11 @@ describe('AppContainer State Management', () => {
|
|
|
711
774
|
describe('Quota and Fallback Integration', () => {
|
|
712
775
|
it('passes a null proQuotaRequest to UIStateContext by default', async () => {
|
|
713
776
|
// The default mock from beforeEach already sets proQuotaRequest to null
|
|
714
|
-
|
|
777
|
+
let unmount;
|
|
778
|
+
await act(async () => {
|
|
779
|
+
const result = renderAppContainer();
|
|
780
|
+
unmount = result.unmount;
|
|
781
|
+
});
|
|
715
782
|
await waitFor(() => {
|
|
716
783
|
// Assert that the context value is as expected
|
|
717
784
|
expect(capturedUIState.proQuotaRequest).toBeNull();
|
|
@@ -730,7 +797,11 @@ describe('AppContainer State Management', () => {
|
|
|
730
797
|
handleProQuotaChoice: vi.fn(),
|
|
731
798
|
});
|
|
732
799
|
// Act: Render the container
|
|
733
|
-
|
|
800
|
+
let unmount;
|
|
801
|
+
await act(async () => {
|
|
802
|
+
const result = renderAppContainer();
|
|
803
|
+
unmount = result.unmount;
|
|
804
|
+
});
|
|
734
805
|
await waitFor(() => {
|
|
735
806
|
// Assert: The mock request is correctly passed through the context
|
|
736
807
|
expect(capturedUIState.proQuotaRequest).toEqual(mockRequest);
|
|
@@ -745,7 +816,11 @@ describe('AppContainer State Management', () => {
|
|
|
745
816
|
handleProQuotaChoice: mockHandler,
|
|
746
817
|
});
|
|
747
818
|
// Act: Render the container
|
|
748
|
-
|
|
819
|
+
let unmount;
|
|
820
|
+
await act(async () => {
|
|
821
|
+
const result = renderAppContainer();
|
|
822
|
+
unmount = result.unmount;
|
|
823
|
+
});
|
|
749
824
|
await waitFor(() => {
|
|
750
825
|
// Assert: The action in the context is the mock handler we provided
|
|
751
826
|
expect(capturedUIActions.handleProQuotaChoice).toBe(mockHandler);
|
|
@@ -1091,7 +1166,11 @@ describe('AppContainer State Management', () => {
|
|
|
1091
1166
|
cancelOngoingRequest: vi.fn(),
|
|
1092
1167
|
activePtyId: 'some-id',
|
|
1093
1168
|
});
|
|
1094
|
-
|
|
1169
|
+
let unmount;
|
|
1170
|
+
await act(async () => {
|
|
1171
|
+
const result = renderAppContainer();
|
|
1172
|
+
unmount = result.unmount;
|
|
1173
|
+
});
|
|
1095
1174
|
await waitFor(() => expect(resizePtySpy).toHaveBeenCalled());
|
|
1096
1175
|
const lastCall = resizePtySpy.mock.calls[resizePtySpy.mock.calls.length - 1];
|
|
1097
1176
|
// Check the height argument specifically
|
|
@@ -1375,7 +1454,11 @@ describe('AppContainer State Management', () => {
|
|
|
1375
1454
|
openModelDialog: vi.fn(),
|
|
1376
1455
|
closeModelDialog: vi.fn(),
|
|
1377
1456
|
});
|
|
1378
|
-
|
|
1457
|
+
let unmount;
|
|
1458
|
+
await act(async () => {
|
|
1459
|
+
const result = renderAppContainer();
|
|
1460
|
+
unmount = result.unmount;
|
|
1461
|
+
});
|
|
1379
1462
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1380
1463
|
expect(capturedUIState.isModelDialogOpen).toBe(true);
|
|
1381
1464
|
unmount();
|
|
@@ -1387,7 +1470,11 @@ describe('AppContainer State Management', () => {
|
|
|
1387
1470
|
openModelDialog: vi.fn(),
|
|
1388
1471
|
closeModelDialog: mockCloseModelDialog,
|
|
1389
1472
|
});
|
|
1390
|
-
|
|
1473
|
+
let unmount;
|
|
1474
|
+
await act(async () => {
|
|
1475
|
+
const result = renderAppContainer();
|
|
1476
|
+
unmount = result.unmount;
|
|
1477
|
+
});
|
|
1391
1478
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1392
1479
|
// Verify that the actions are correctly passed through context
|
|
1393
1480
|
act(() => {
|
|
@@ -1399,20 +1486,32 @@ describe('AppContainer State Management', () => {
|
|
|
1399
1486
|
});
|
|
1400
1487
|
describe('CoreEvents Integration', () => {
|
|
1401
1488
|
it('subscribes to UserFeedback and drains backlog on mount', async () => {
|
|
1402
|
-
|
|
1489
|
+
let unmount;
|
|
1490
|
+
await act(async () => {
|
|
1491
|
+
const result = renderAppContainer();
|
|
1492
|
+
unmount = result.unmount;
|
|
1493
|
+
});
|
|
1403
1494
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1404
1495
|
expect(mockCoreEvents.on).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1405
1496
|
expect(mockCoreEvents.drainBacklogs).toHaveBeenCalledTimes(1);
|
|
1406
1497
|
unmount();
|
|
1407
1498
|
});
|
|
1408
1499
|
it('unsubscribes from UserFeedback on unmount', async () => {
|
|
1409
|
-
|
|
1500
|
+
let unmount;
|
|
1501
|
+
await act(async () => {
|
|
1502
|
+
const result = renderAppContainer();
|
|
1503
|
+
unmount = result.unmount;
|
|
1504
|
+
});
|
|
1410
1505
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1411
1506
|
unmount();
|
|
1412
1507
|
expect(mockCoreEvents.off).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1413
1508
|
});
|
|
1414
1509
|
it('adds history item when UserFeedback event is received', async () => {
|
|
1415
|
-
|
|
1510
|
+
let unmount;
|
|
1511
|
+
await act(async () => {
|
|
1512
|
+
const result = renderAppContainer();
|
|
1513
|
+
unmount = result.unmount;
|
|
1514
|
+
});
|
|
1416
1515
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1417
1516
|
// Get the registered handler
|
|
1418
1517
|
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.UserFeedback)?.[1];
|
|
@@ -1434,7 +1533,11 @@ describe('AppContainer State Management', () => {
|
|
|
1434
1533
|
it('updates currentModel when ModelChanged event is received', async () => {
|
|
1435
1534
|
// Arrange: Mock initial model
|
|
1436
1535
|
vi.spyOn(mockConfig, 'getModel').mockReturnValue('initial-model');
|
|
1437
|
-
|
|
1536
|
+
let unmount;
|
|
1537
|
+
await act(async () => {
|
|
1538
|
+
const result = renderAppContainer();
|
|
1539
|
+
unmount = result.unmount;
|
|
1540
|
+
});
|
|
1438
1541
|
await waitFor(() => {
|
|
1439
1542
|
expect(capturedUIState?.currentModel).toBe('initial-model');
|
|
1440
1543
|
});
|
|
@@ -1442,6 +1545,8 @@ describe('AppContainer State Management', () => {
|
|
|
1442
1545
|
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.ModelChanged)?.[1];
|
|
1443
1546
|
expect(handler).toBeDefined();
|
|
1444
1547
|
// Act: Simulate ModelChanged event
|
|
1548
|
+
// Update config mock to return new model since the handler reads from config
|
|
1549
|
+
vi.spyOn(mockConfig, 'getModel').mockReturnValue('new-model');
|
|
1445
1550
|
act(() => {
|
|
1446
1551
|
handler({ model: 'new-model' });
|
|
1447
1552
|
});
|
|
@@ -1467,7 +1572,11 @@ describe('AppContainer State Management', () => {
|
|
|
1467
1572
|
activePtyId: 'some-pty-id', // Make sure activePtyId is set
|
|
1468
1573
|
});
|
|
1469
1574
|
// The main assertion is that the render does not throw.
|
|
1470
|
-
|
|
1575
|
+
let unmount;
|
|
1576
|
+
await act(async () => {
|
|
1577
|
+
const result = renderAppContainer();
|
|
1578
|
+
unmount = result.unmount;
|
|
1579
|
+
});
|
|
1471
1580
|
await waitFor(() => expect(resizePtySpy).toHaveBeenCalled());
|
|
1472
1581
|
unmount();
|
|
1473
1582
|
});
|
|
@@ -1479,7 +1588,11 @@ describe('AppContainer State Management', () => {
|
|
|
1479
1588
|
authType: AuthType.USE_GEMINI,
|
|
1480
1589
|
apiKey: 'fake-key',
|
|
1481
1590
|
});
|
|
1482
|
-
|
|
1591
|
+
let unmount;
|
|
1592
|
+
await act(async () => {
|
|
1593
|
+
const result = renderAppContainer();
|
|
1594
|
+
unmount = result.unmount;
|
|
1595
|
+
});
|
|
1483
1596
|
await waitFor(() => {
|
|
1484
1597
|
expect(capturedUIState.bannerData.defaultText).toBeDefined();
|
|
1485
1598
|
unmount();
|
|
@@ -1501,7 +1614,11 @@ describe('AppContainer State Management', () => {
|
|
|
1501
1614
|
});
|
|
1502
1615
|
});
|
|
1503
1616
|
it('clears the prompt when onCancelSubmit is called with shouldRestorePrompt=false', async () => {
|
|
1504
|
-
|
|
1617
|
+
let unmount;
|
|
1618
|
+
await act(async () => {
|
|
1619
|
+
const result = renderAppContainer();
|
|
1620
|
+
unmount = result.unmount;
|
|
1621
|
+
});
|
|
1505
1622
|
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1506
1623
|
const { onCancelSubmit } = extractUseGeminiStreamArgs(mockedUseGeminiStream.mock.lastCall);
|
|
1507
1624
|
act(() => {
|
|
@@ -1511,12 +1628,17 @@ describe('AppContainer State Management', () => {
|
|
|
1511
1628
|
unmount();
|
|
1512
1629
|
});
|
|
1513
1630
|
it('restores the prompt when onCancelSubmit is called with shouldRestorePrompt=true (or undefined)', async () => {
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1631
|
+
// Mock useInputHistoryStore to provide input history
|
|
1632
|
+
mockedUseInputHistoryStore.mockReturnValue({
|
|
1633
|
+
inputHistory: ['previous message'],
|
|
1634
|
+
addInput: vi.fn(),
|
|
1635
|
+
initializeFromLogger: vi.fn(),
|
|
1636
|
+
});
|
|
1637
|
+
let unmount;
|
|
1638
|
+
await act(async () => {
|
|
1639
|
+
const result = renderAppContainer();
|
|
1640
|
+
unmount = result.unmount;
|
|
1518
1641
|
});
|
|
1519
|
-
const { unmount } = renderAppContainer();
|
|
1520
1642
|
await waitFor(() => expect(capturedUIState.userMessages).toContain('previous message'));
|
|
1521
1643
|
const { onCancelSubmit } = extractUseGeminiStreamArgs(mockedUseGeminiStream.mock.lastCall);
|
|
1522
1644
|
await act(async () => {
|
|
@@ -1525,59 +1647,67 @@ describe('AppContainer State Management', () => {
|
|
|
1525
1647
|
expect(mockSetText).toHaveBeenCalledWith('previous message');
|
|
1526
1648
|
unmount();
|
|
1527
1649
|
});
|
|
1528
|
-
it('
|
|
1529
|
-
//
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
loadHistory: vi.fn(),
|
|
1650
|
+
it('input history is independent from conversation history (survives /clear)', async () => {
|
|
1651
|
+
// This test verifies that input history (used for up-arrow navigation) is maintained
|
|
1652
|
+
// separately from conversation history and survives /clear operations.
|
|
1653
|
+
const mockAddInput = vi.fn();
|
|
1654
|
+
mockedUseInputHistoryStore.mockReturnValue({
|
|
1655
|
+
inputHistory: ['first prompt', 'second prompt'],
|
|
1656
|
+
addInput: mockAddInput,
|
|
1657
|
+
initializeFromLogger: vi.fn(),
|
|
1537
1658
|
});
|
|
1538
|
-
let
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
const { unmount, rerender } = renderAppContainer();
|
|
1551
|
-
// Wait for userMessages to be populated with 'Previous Prompt'
|
|
1552
|
-
await waitFor(() => expect(capturedUIState.userMessages).toContain('Previous Prompt'));
|
|
1553
|
-
// Simulate a new prompt being added (e.g., user sent it, but it overflowed)
|
|
1554
|
-
const newPrompt = 'Current Prompt that Overflowed';
|
|
1555
|
-
const newHistory = [...initialHistory, { type: 'user', text: newPrompt }];
|
|
1659
|
+
let rerender;
|
|
1660
|
+
let unmount;
|
|
1661
|
+
await act(async () => {
|
|
1662
|
+
const result = renderAppContainer();
|
|
1663
|
+
rerender = result.rerender;
|
|
1664
|
+
unmount = result.unmount;
|
|
1665
|
+
});
|
|
1666
|
+
// Verify userMessages is populated from inputHistory
|
|
1667
|
+
await waitFor(() => expect(capturedUIState.userMessages).toContain('first prompt'));
|
|
1668
|
+
expect(capturedUIState.userMessages).toContain('second prompt');
|
|
1669
|
+
// Clear the conversation history (simulating /clear command)
|
|
1670
|
+
const mockClearItems = vi.fn();
|
|
1556
1671
|
mockedUseHistory.mockReturnValue({
|
|
1557
|
-
history:
|
|
1672
|
+
history: [],
|
|
1558
1673
|
addItem: vi.fn(),
|
|
1559
1674
|
updateItem: vi.fn(),
|
|
1560
|
-
clearItems:
|
|
1675
|
+
clearItems: mockClearItems,
|
|
1561
1676
|
loadHistory: vi.fn(),
|
|
1562
1677
|
});
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
const { onCancelSubmit } = extractUseGeminiStreamArgs(mockedUseGeminiStream.mock.lastCall);
|
|
1567
|
-
// Call onCancelSubmit immediately. userMessages is still stale (has only 'Previous Prompt')
|
|
1568
|
-
// because the effect is waiting on loggerPromise.
|
|
1569
|
-
act(() => {
|
|
1570
|
-
onCancelSubmit(true);
|
|
1678
|
+
await act(async () => {
|
|
1679
|
+
// Rerender to apply the new mock.
|
|
1680
|
+
rerender(getAppContainer());
|
|
1571
1681
|
});
|
|
1572
|
-
//
|
|
1682
|
+
// Verify that userMessages still contains the input history
|
|
1683
|
+
// (it should not be affected by clearing conversation history)
|
|
1684
|
+
expect(capturedUIState.userMessages).toContain('first prompt');
|
|
1685
|
+
expect(capturedUIState.userMessages).toContain('second prompt');
|
|
1686
|
+
unmount();
|
|
1687
|
+
});
|
|
1688
|
+
});
|
|
1689
|
+
describe('Regression Tests', () => {
|
|
1690
|
+
it('does not refresh static on startup if banner text is empty', async () => {
|
|
1691
|
+
// Mock banner text to be empty strings
|
|
1692
|
+
vi.spyOn(mockConfig, 'getBannerTextNoCapacityIssues').mockResolvedValue('');
|
|
1693
|
+
vi.spyOn(mockConfig, 'getBannerTextCapacityIssues').mockResolvedValue('');
|
|
1694
|
+
// Clear previous calls
|
|
1695
|
+
mocks.mockStdout.write.mockClear();
|
|
1696
|
+
let compUnmount = () => { };
|
|
1573
1697
|
await act(async () => {
|
|
1574
|
-
|
|
1698
|
+
const { unmount } = renderAppContainer();
|
|
1699
|
+
compUnmount = unmount;
|
|
1575
1700
|
});
|
|
1576
|
-
//
|
|
1577
|
-
await waitFor(() =>
|
|
1578
|
-
|
|
1701
|
+
// Allow async effects to run
|
|
1702
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1703
|
+
// Wait for fetchBannerTexts to complete
|
|
1704
|
+
await act(async () => {
|
|
1705
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
1579
1706
|
});
|
|
1580
|
-
|
|
1707
|
+
// Check that clearTerminal was NOT written to stdout
|
|
1708
|
+
const clearTerminalCalls = mocks.mockStdout.write.mock.calls.filter((call) => call[0] === ansiEscapes.clearTerminal);
|
|
1709
|
+
expect(clearTerminalCalls).toHaveLength(0);
|
|
1710
|
+
compUnmount();
|
|
1581
1711
|
});
|
|
1582
1712
|
});
|
|
1583
1713
|
});
|