@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
package/dist/src/gemini.test.js
CHANGED
|
@@ -7,6 +7,7 @@ import { describe, it, expect, vi, beforeEach, afterEach, } from 'vitest';
|
|
|
7
7
|
import { main, setupUnhandledRejectionHandler, validateDnsResolutionOrder, startInteractiveUI, getNodeMemoryArgs, } from './gemini.js';
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import v8 from 'node:v8';
|
|
10
|
+
import {} from './config/config.js';
|
|
10
11
|
import {} from './config/settings.js';
|
|
11
12
|
import { appEvents, AppEvent } from './utils/events.js';
|
|
12
13
|
import { debugLogger, } from '@google/gemini-cli-core';
|
|
@@ -32,7 +33,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
|
32
33
|
recordSlowRender: vi.fn(),
|
|
33
34
|
writeToStdout: vi.fn((...args) => process.stdout.write(...args)),
|
|
34
35
|
patchStdio: vi.fn(() => () => { }),
|
|
35
|
-
|
|
36
|
+
createWorkingStdio: vi.fn(() => ({
|
|
36
37
|
stdout: {
|
|
37
38
|
write: vi.fn((...args) => process.stdout.write(...args)),
|
|
38
39
|
columns: 80,
|
|
@@ -48,6 +49,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
|
48
49
|
disableMouseEvents: vi.fn(),
|
|
49
50
|
enterAlternateScreen: vi.fn(),
|
|
50
51
|
disableLineWrapping: vi.fn(),
|
|
52
|
+
getVersion: vi.fn(() => Promise.resolve('1.0.0')),
|
|
51
53
|
};
|
|
52
54
|
});
|
|
53
55
|
vi.mock('ink', async (importOriginal) => {
|
|
@@ -176,10 +178,11 @@ describe('gemini.tsx main function', () => {
|
|
|
176
178
|
delete process.env['SANDBOX'];
|
|
177
179
|
}
|
|
178
180
|
const currentListeners = process.listeners('unhandledRejection');
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
currentListeners.forEach((listener) => {
|
|
182
|
+
if (!initialUnhandledRejectionListeners.includes(listener)) {
|
|
183
|
+
process.removeListener('unhandledRejection', listener);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
183
186
|
vi.restoreAllMocks();
|
|
184
187
|
});
|
|
185
188
|
it('verifies that we dont load the config before relaunchAppInChildProcess', async () => {
|
|
@@ -219,6 +222,7 @@ describe('gemini.tsx main function', () => {
|
|
|
219
222
|
getMessageBus: () => ({
|
|
220
223
|
subscribe: vi.fn(),
|
|
221
224
|
}),
|
|
225
|
+
getEnableHooks: () => false,
|
|
222
226
|
getToolRegistry: vi.fn(),
|
|
223
227
|
getContentGeneratorConfig: vi.fn(),
|
|
224
228
|
getModel: () => 'gemini-pro',
|
|
@@ -420,6 +424,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
420
424
|
getMessageBus: () => ({
|
|
421
425
|
subscribe: vi.fn(),
|
|
422
426
|
}),
|
|
427
|
+
getEnableHooks: () => false,
|
|
423
428
|
getToolRegistry: vi.fn(),
|
|
424
429
|
getContentGeneratorConfig: vi.fn(),
|
|
425
430
|
getModel: () => 'gemini-pro',
|
|
@@ -513,6 +518,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
513
518
|
getExtensions: () => [{ name: 'ext1' }],
|
|
514
519
|
getPolicyEngine: vi.fn(),
|
|
515
520
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
521
|
+
getEnableHooks: () => false,
|
|
516
522
|
initialize: vi.fn(),
|
|
517
523
|
getContentGeneratorConfig: vi.fn(),
|
|
518
524
|
getMcpServers: () => ({}),
|
|
@@ -585,6 +591,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
585
591
|
getExtensions: () => [],
|
|
586
592
|
getPolicyEngine: vi.fn(),
|
|
587
593
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
594
|
+
getEnableHooks: () => false,
|
|
588
595
|
initialize: vi.fn(),
|
|
589
596
|
getContentGeneratorConfig: vi.fn(),
|
|
590
597
|
getMcpServers: () => ({}),
|
|
@@ -612,53 +619,6 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
612
619
|
expect(processExitSpy).toHaveBeenCalledWith(0);
|
|
613
620
|
processExitSpy.mockRestore();
|
|
614
621
|
});
|
|
615
|
-
it('should exit with error when --prompt-interactive is used with piped input', async () => {
|
|
616
|
-
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
617
|
-
const { loadSettings } = await import('./config/settings.js');
|
|
618
|
-
const core = await import('@google/gemini-cli-core');
|
|
619
|
-
const processExitSpy = vi
|
|
620
|
-
.spyOn(process, 'exit')
|
|
621
|
-
.mockImplementation((code) => {
|
|
622
|
-
throw new MockProcessExitError(code);
|
|
623
|
-
});
|
|
624
|
-
const writeToStderrSpy = vi
|
|
625
|
-
.spyOn(core, 'writeToStderr')
|
|
626
|
-
.mockImplementation(() => true);
|
|
627
|
-
vi.mocked(loadSettings).mockReturnValue({
|
|
628
|
-
merged: { advanced: {}, security: { auth: {} }, ui: {} },
|
|
629
|
-
setValue: vi.fn(),
|
|
630
|
-
forScope: () => ({ settings: {}, originalSettings: {}, path: '' }),
|
|
631
|
-
errors: [],
|
|
632
|
-
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
633
|
-
vi.mocked(parseArguments).mockResolvedValue({
|
|
634
|
-
promptInteractive: true,
|
|
635
|
-
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
636
|
-
vi.mocked(loadCliConfig).mockResolvedValue({
|
|
637
|
-
isInteractive: () => false,
|
|
638
|
-
getQuestion: () => '',
|
|
639
|
-
getSandbox: () => false,
|
|
640
|
-
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
641
|
-
// Mock stdin to be non-TTY
|
|
642
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
643
|
-
value: false,
|
|
644
|
-
configurable: true,
|
|
645
|
-
});
|
|
646
|
-
try {
|
|
647
|
-
await main();
|
|
648
|
-
}
|
|
649
|
-
catch (e) {
|
|
650
|
-
if (!(e instanceof MockProcessExitError))
|
|
651
|
-
throw e;
|
|
652
|
-
}
|
|
653
|
-
expect(writeToStderrSpy).toHaveBeenCalledWith(expect.stringContaining('Error: The --prompt-interactive flag cannot be used'));
|
|
654
|
-
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
655
|
-
processExitSpy.mockRestore();
|
|
656
|
-
writeToStderrSpy.mockRestore();
|
|
657
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
658
|
-
value: true,
|
|
659
|
-
configurable: true,
|
|
660
|
-
}); // Restore TTY
|
|
661
|
-
});
|
|
662
622
|
it('should log warning when theme is not found', async () => {
|
|
663
623
|
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
664
624
|
const { loadSettings } = await import('./config/settings.js');
|
|
@@ -691,6 +651,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
691
651
|
getDebugMode: () => false,
|
|
692
652
|
getPolicyEngine: vi.fn(),
|
|
693
653
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
654
|
+
getEnableHooks: () => false,
|
|
694
655
|
initialize: vi.fn(),
|
|
695
656
|
getContentGeneratorConfig: vi.fn(),
|
|
696
657
|
getMcpServers: () => ({}),
|
|
@@ -729,12 +690,11 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
729
690
|
it('should handle session selector error', async () => {
|
|
730
691
|
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
731
692
|
const { loadSettings } = await import('./config/settings.js');
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
},
|
|
693
|
+
const { SessionSelector } = await import('./utils/sessionUtils.js');
|
|
694
|
+
vi.mocked(SessionSelector).mockImplementation(() => ({
|
|
695
|
+
resolveSession: vi
|
|
696
|
+
.fn()
|
|
697
|
+
.mockRejectedValue(new Error('Session not found')),
|
|
738
698
|
}));
|
|
739
699
|
const processExitSpy = vi
|
|
740
700
|
.spyOn(process, 'exit')
|
|
@@ -761,6 +721,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
761
721
|
getDebugMode: () => false,
|
|
762
722
|
getPolicyEngine: vi.fn(),
|
|
763
723
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
724
|
+
getEnableHooks: () => false,
|
|
764
725
|
initialize: vi.fn(),
|
|
765
726
|
getContentGeneratorConfig: vi.fn(),
|
|
766
727
|
getMcpServers: () => ({}),
|
|
@@ -793,7 +754,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
793
754
|
throw e;
|
|
794
755
|
}
|
|
795
756
|
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Error resuming session: Session not found'));
|
|
796
|
-
expect(processExitSpy).toHaveBeenCalledWith(
|
|
757
|
+
expect(processExitSpy).toHaveBeenCalledWith(42);
|
|
797
758
|
processExitSpy.mockRestore();
|
|
798
759
|
consoleErrorSpy.mockRestore();
|
|
799
760
|
});
|
|
@@ -826,6 +787,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
826
787
|
getDebugMode: () => false,
|
|
827
788
|
getPolicyEngine: vi.fn(),
|
|
828
789
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
790
|
+
getEnableHooks: () => false,
|
|
829
791
|
initialize: vi.fn(),
|
|
830
792
|
getContentGeneratorConfig: vi.fn(),
|
|
831
793
|
getMcpServers: () => ({}),
|
|
@@ -862,39 +824,32 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
862
824
|
expect(processExitSpy).toHaveBeenCalledWith(0); // Should not exit on cleanup failure
|
|
863
825
|
processExitSpy.mockRestore();
|
|
864
826
|
});
|
|
865
|
-
it('should
|
|
827
|
+
it('should read from stdin in non-interactive mode', async () => {
|
|
866
828
|
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
867
829
|
const { loadSettings } = await import('./config/settings.js');
|
|
868
|
-
const {
|
|
830
|
+
const { readStdin } = await import('./utils/readStdin.js');
|
|
869
831
|
const processExitSpy = vi
|
|
870
832
|
.spyOn(process, 'exit')
|
|
871
833
|
.mockImplementation((code) => {
|
|
872
834
|
throw new MockProcessExitError(code);
|
|
873
835
|
});
|
|
874
|
-
const debugLoggerErrorSpy = vi
|
|
875
|
-
.spyOn(debugLogger, 'error')
|
|
876
|
-
.mockImplementation(() => { });
|
|
877
836
|
vi.mocked(loadSettings).mockReturnValue({
|
|
878
|
-
merged: {
|
|
879
|
-
advanced: {},
|
|
880
|
-
security: { auth: { selectedType: 'google' } },
|
|
881
|
-
ui: {},
|
|
882
|
-
},
|
|
837
|
+
merged: { advanced: {}, security: { auth: {} }, ui: {} },
|
|
883
838
|
setValue: vi.fn(),
|
|
884
839
|
forScope: () => ({ settings: {}, originalSettings: {}, path: '' }),
|
|
885
840
|
errors: [],
|
|
886
841
|
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
887
|
-
vi.mocked(loadSandboxConfig).mockResolvedValue({}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
888
842
|
vi.mocked(parseArguments).mockResolvedValue({
|
|
889
843
|
promptInteractive: false,
|
|
890
844
|
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
891
845
|
vi.mocked(loadCliConfig).mockResolvedValue({
|
|
892
|
-
isInteractive: () =>
|
|
893
|
-
getQuestion: () => '',
|
|
846
|
+
isInteractive: () => false,
|
|
847
|
+
getQuestion: () => 'test-question',
|
|
894
848
|
getSandbox: () => false,
|
|
895
849
|
getDebugMode: () => false,
|
|
896
850
|
getPolicyEngine: vi.fn(),
|
|
897
851
|
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
852
|
+
getEnableHooks: () => false,
|
|
898
853
|
initialize: vi.fn(),
|
|
899
854
|
getContentGeneratorConfig: vi.fn(),
|
|
900
855
|
getMcpServers: () => ({}),
|
|
@@ -918,8 +873,23 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
918
873
|
getFileFilteringRespectGitIgnore: () => true,
|
|
919
874
|
getOutputFormat: () => 'text',
|
|
920
875
|
getUsageStatisticsEnabled: () => false,
|
|
921
|
-
refreshAuth: vi.fn().mockRejectedValue(new Error('Auth refresh failed')),
|
|
922
876
|
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
877
|
+
vi.mock('./utils/readStdin.js', () => ({
|
|
878
|
+
readStdin: vi.fn().mockResolvedValue('stdin-data'),
|
|
879
|
+
}));
|
|
880
|
+
const runNonInteractiveSpy = vi.hoisted(() => vi.fn());
|
|
881
|
+
vi.mock('./nonInteractiveCli.js', () => ({
|
|
882
|
+
runNonInteractive: runNonInteractiveSpy,
|
|
883
|
+
}));
|
|
884
|
+
runNonInteractiveSpy.mockClear();
|
|
885
|
+
vi.mock('./validateNonInterActiveAuth.js', () => ({
|
|
886
|
+
validateNonInteractiveAuth: vi.fn().mockResolvedValue({}),
|
|
887
|
+
}));
|
|
888
|
+
// Mock stdin to be non-TTY
|
|
889
|
+
Object.defineProperty(process.stdin, 'isTTY', {
|
|
890
|
+
value: false,
|
|
891
|
+
configurable: true,
|
|
892
|
+
});
|
|
923
893
|
try {
|
|
924
894
|
await main();
|
|
925
895
|
}
|
|
@@ -927,49 +897,174 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
927
897
|
if (!(e instanceof MockProcessExitError))
|
|
928
898
|
throw e;
|
|
929
899
|
}
|
|
930
|
-
expect(
|
|
931
|
-
|
|
900
|
+
expect(readStdin).toHaveBeenCalled();
|
|
901
|
+
// In this test setup, runNonInteractive might be called on the mocked module,
|
|
902
|
+
// but we need to ensure we are checking the correct spy instance.
|
|
903
|
+
// Since vi.mock is hoisted, runNonInteractiveSpy is defined early.
|
|
904
|
+
expect(runNonInteractiveSpy).toHaveBeenCalled();
|
|
905
|
+
const callArgs = runNonInteractiveSpy.mock.calls[0][0];
|
|
906
|
+
expect(callArgs.input).toBe('test-question');
|
|
907
|
+
expect(processExitSpy).toHaveBeenCalledWith(0);
|
|
932
908
|
processExitSpy.mockRestore();
|
|
909
|
+
Object.defineProperty(process.stdin, 'isTTY', {
|
|
910
|
+
value: true,
|
|
911
|
+
configurable: true,
|
|
912
|
+
});
|
|
933
913
|
});
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
914
|
+
});
|
|
915
|
+
describe('gemini.tsx main function exit codes', () => {
|
|
916
|
+
let originalEnvNoRelaunch;
|
|
917
|
+
beforeEach(() => {
|
|
918
|
+
originalEnvNoRelaunch = process.env['CELL_CLI_NO_RELAUNCH'];
|
|
919
|
+
process.env['CELL_CLI_NO_RELAUNCH'] = 'true';
|
|
920
|
+
vi.spyOn(process, 'exit').mockImplementation((code) => {
|
|
941
921
|
throw new MockProcessExitError(code);
|
|
942
922
|
});
|
|
923
|
+
// Mock stderr to avoid cluttering output
|
|
924
|
+
vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
925
|
+
});
|
|
926
|
+
afterEach(() => {
|
|
927
|
+
if (originalEnvNoRelaunch !== undefined) {
|
|
928
|
+
process.env['CELL_CLI_NO_RELAUNCH'] = originalEnvNoRelaunch;
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
delete process.env['CELL_CLI_NO_RELAUNCH'];
|
|
932
|
+
}
|
|
933
|
+
vi.restoreAllMocks();
|
|
934
|
+
});
|
|
935
|
+
it('should exit with 42 for invalid input combination (prompt-interactive with non-TTY)', async () => {
|
|
936
|
+
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
937
|
+
const { loadSettings } = await import('./config/settings.js');
|
|
938
|
+
vi.mocked(loadCliConfig).mockResolvedValue({});
|
|
943
939
|
vi.mocked(loadSettings).mockReturnValue({
|
|
944
|
-
merged: {
|
|
945
|
-
setValue: vi.fn(),
|
|
946
|
-
forScope: () => ({ settings: {}, originalSettings: {}, path: '' }),
|
|
940
|
+
merged: { security: { auth: {} }, ui: {} },
|
|
947
941
|
errors: [],
|
|
948
|
-
});
|
|
942
|
+
});
|
|
949
943
|
vi.mocked(parseArguments).mockResolvedValue({
|
|
950
|
-
promptInteractive:
|
|
951
|
-
});
|
|
944
|
+
promptInteractive: true,
|
|
945
|
+
});
|
|
946
|
+
Object.defineProperty(process.stdin, 'isTTY', {
|
|
947
|
+
value: false,
|
|
948
|
+
configurable: true,
|
|
949
|
+
});
|
|
950
|
+
try {
|
|
951
|
+
await main();
|
|
952
|
+
expect.fail('Should have thrown MockProcessExitError');
|
|
953
|
+
}
|
|
954
|
+
catch (e) {
|
|
955
|
+
expect(e).toBeInstanceOf(MockProcessExitError);
|
|
956
|
+
expect(e.code).toBe(42);
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
it('should exit with 41 for auth failure during sandbox setup', async () => {
|
|
960
|
+
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
961
|
+
const { loadSettings } = await import('./config/settings.js');
|
|
962
|
+
const { loadSandboxConfig } = await import('./config/sandboxConfig.js');
|
|
963
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
964
|
+
vi.mocked(loadSandboxConfig).mockResolvedValue({});
|
|
965
|
+
vi.mocked(loadCliConfig).mockResolvedValue({
|
|
966
|
+
refreshAuth: vi.fn().mockRejectedValue(new Error('Auth failed')),
|
|
967
|
+
});
|
|
968
|
+
vi.mocked(loadSettings).mockReturnValue({
|
|
969
|
+
merged: {
|
|
970
|
+
security: { auth: { selectedType: 'google', useExternal: false } },
|
|
971
|
+
ui: {},
|
|
972
|
+
},
|
|
973
|
+
errors: [],
|
|
974
|
+
});
|
|
975
|
+
vi.mocked(parseArguments).mockResolvedValue({});
|
|
976
|
+
vi.mock('./config/auth.js', () => ({
|
|
977
|
+
validateAuthMethod: vi.fn().mockReturnValue(null),
|
|
978
|
+
}));
|
|
979
|
+
try {
|
|
980
|
+
await main();
|
|
981
|
+
expect.fail('Should have thrown MockProcessExitError');
|
|
982
|
+
}
|
|
983
|
+
catch (e) {
|
|
984
|
+
expect(e).toBeInstanceOf(MockProcessExitError);
|
|
985
|
+
expect(e.code).toBe(41);
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
it('should exit with 42 for session resume failure', async () => {
|
|
989
|
+
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
990
|
+
const { loadSettings } = await import('./config/settings.js');
|
|
952
991
|
vi.mocked(loadCliConfig).mockResolvedValue({
|
|
953
992
|
isInteractive: () => false,
|
|
954
|
-
getQuestion: () => 'test
|
|
993
|
+
getQuestion: () => 'test',
|
|
955
994
|
getSandbox: () => false,
|
|
956
995
|
getDebugMode: () => false,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
getContentGeneratorConfig: vi.fn(),
|
|
996
|
+
getListExtensions: () => false,
|
|
997
|
+
getListSessions: () => false,
|
|
998
|
+
getDeleteSession: () => undefined,
|
|
961
999
|
getMcpServers: () => ({}),
|
|
962
1000
|
getMcpClientManager: vi.fn(),
|
|
1001
|
+
initialize: vi.fn(),
|
|
963
1002
|
getIdeMode: () => false,
|
|
964
1003
|
getExperimentalZedIntegration: () => false,
|
|
965
1004
|
getScreenReader: () => false,
|
|
966
1005
|
getGeminiMdFileCount: () => 0,
|
|
967
|
-
|
|
1006
|
+
getPolicyEngine: vi.fn(),
|
|
1007
|
+
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
1008
|
+
getEnableHooks: () => false,
|
|
1009
|
+
getToolRegistry: vi.fn(),
|
|
1010
|
+
getContentGeneratorConfig: vi.fn(),
|
|
1011
|
+
getModel: () => 'gemini-pro',
|
|
1012
|
+
getEmbeddingModel: () => 'embedding-001',
|
|
1013
|
+
getApprovalMode: () => 'default',
|
|
1014
|
+
getCoreTools: () => [],
|
|
1015
|
+
getTelemetryEnabled: () => false,
|
|
1016
|
+
getTelemetryLogPromptsEnabled: () => false,
|
|
1017
|
+
getFileFilteringRespectGitIgnore: () => true,
|
|
1018
|
+
getOutputFormat: () => 'text',
|
|
1019
|
+
getExtensions: () => [],
|
|
1020
|
+
getUsageStatisticsEnabled: () => false,
|
|
1021
|
+
});
|
|
1022
|
+
vi.mocked(loadSettings).mockReturnValue({
|
|
1023
|
+
merged: { security: { auth: {} }, ui: {} },
|
|
1024
|
+
errors: [],
|
|
1025
|
+
});
|
|
1026
|
+
vi.mocked(parseArguments).mockResolvedValue({
|
|
1027
|
+
resume: 'invalid-session',
|
|
1028
|
+
});
|
|
1029
|
+
vi.mock('./utils/sessionUtils.js', () => ({
|
|
1030
|
+
SessionSelector: vi.fn().mockImplementation(() => ({
|
|
1031
|
+
resolveSession: vi
|
|
1032
|
+
.fn()
|
|
1033
|
+
.mockRejectedValue(new Error('Session not found')),
|
|
1034
|
+
})),
|
|
1035
|
+
}));
|
|
1036
|
+
try {
|
|
1037
|
+
await main();
|
|
1038
|
+
expect.fail('Should have thrown MockProcessExitError');
|
|
1039
|
+
}
|
|
1040
|
+
catch (e) {
|
|
1041
|
+
expect(e).toBeInstanceOf(MockProcessExitError);
|
|
1042
|
+
expect(e.code).toBe(42);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
it('should exit with 42 for no input provided', async () => {
|
|
1046
|
+
const { loadCliConfig, parseArguments } = await import('./config/config.js');
|
|
1047
|
+
const { loadSettings } = await import('./config/settings.js');
|
|
1048
|
+
vi.mocked(loadCliConfig).mockResolvedValue({
|
|
1049
|
+
isInteractive: () => false,
|
|
1050
|
+
getQuestion: () => '',
|
|
1051
|
+
getSandbox: () => false,
|
|
1052
|
+
getDebugMode: () => false,
|
|
968
1053
|
getListExtensions: () => false,
|
|
969
1054
|
getListSessions: () => false,
|
|
970
1055
|
getDeleteSession: () => undefined,
|
|
1056
|
+
getMcpServers: () => ({}),
|
|
1057
|
+
getMcpClientManager: vi.fn(),
|
|
1058
|
+
initialize: vi.fn(),
|
|
1059
|
+
getIdeMode: () => false,
|
|
1060
|
+
getExperimentalZedIntegration: () => false,
|
|
1061
|
+
getScreenReader: () => false,
|
|
1062
|
+
getGeminiMdFileCount: () => 0,
|
|
1063
|
+
getPolicyEngine: vi.fn(),
|
|
1064
|
+
getMessageBus: () => ({ subscribe: vi.fn() }),
|
|
1065
|
+
getEnableHooks: () => false,
|
|
971
1066
|
getToolRegistry: vi.fn(),
|
|
972
|
-
|
|
1067
|
+
getContentGeneratorConfig: vi.fn(),
|
|
973
1068
|
getModel: () => 'gemini-pro',
|
|
974
1069
|
getEmbeddingModel: () => 'embedding-001',
|
|
975
1070
|
getApprovalMode: () => 'default',
|
|
@@ -978,44 +1073,26 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|
|
978
1073
|
getTelemetryLogPromptsEnabled: () => false,
|
|
979
1074
|
getFileFilteringRespectGitIgnore: () => true,
|
|
980
1075
|
getOutputFormat: () => 'text',
|
|
1076
|
+
getExtensions: () => [],
|
|
981
1077
|
getUsageStatisticsEnabled: () => false,
|
|
982
|
-
});
|
|
983
|
-
vi.
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
vi.
|
|
988
|
-
runNonInteractive: runNonInteractiveSpy,
|
|
989
|
-
}));
|
|
990
|
-
runNonInteractiveSpy.mockClear();
|
|
991
|
-
vi.mock('./validateNonInterActiveAuth.js', () => ({
|
|
992
|
-
validateNonInteractiveAuth: vi.fn().mockResolvedValue({}),
|
|
993
|
-
}));
|
|
994
|
-
// Mock stdin to be non-TTY
|
|
1078
|
+
});
|
|
1079
|
+
vi.mocked(loadSettings).mockReturnValue({
|
|
1080
|
+
merged: { security: { auth: {} }, ui: {} },
|
|
1081
|
+
errors: [],
|
|
1082
|
+
});
|
|
1083
|
+
vi.mocked(parseArguments).mockResolvedValue({});
|
|
995
1084
|
Object.defineProperty(process.stdin, 'isTTY', {
|
|
996
|
-
value:
|
|
1085
|
+
value: true, // Simulate TTY so it doesn't try to read stdin
|
|
997
1086
|
configurable: true,
|
|
998
1087
|
});
|
|
999
1088
|
try {
|
|
1000
1089
|
await main();
|
|
1090
|
+
expect.fail('Should have thrown MockProcessExitError');
|
|
1001
1091
|
}
|
|
1002
1092
|
catch (e) {
|
|
1003
|
-
|
|
1004
|
-
|
|
1093
|
+
expect(e).toBeInstanceOf(MockProcessExitError);
|
|
1094
|
+
expect(e.code).toBe(42);
|
|
1005
1095
|
}
|
|
1006
|
-
expect(readStdin).toHaveBeenCalled();
|
|
1007
|
-
// In this test setup, runNonInteractive might be called on the mocked module,
|
|
1008
|
-
// but we need to ensure we are checking the correct spy instance.
|
|
1009
|
-
// Since vi.mock is hoisted, runNonInteractiveSpy is defined early.
|
|
1010
|
-
expect(runNonInteractiveSpy).toHaveBeenCalled();
|
|
1011
|
-
const callArgs = runNonInteractiveSpy.mock.calls[0][0];
|
|
1012
|
-
expect(callArgs.input).toBe('test-question');
|
|
1013
|
-
expect(processExitSpy).toHaveBeenCalledWith(0);
|
|
1014
|
-
processExitSpy.mockRestore();
|
|
1015
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
1016
|
-
value: true,
|
|
1017
|
-
configurable: true,
|
|
1018
|
-
});
|
|
1019
1096
|
});
|
|
1020
1097
|
});
|
|
1021
1098
|
describe('validateDnsResolutionOrder', () => {
|
|
@@ -1068,9 +1145,6 @@ describe('startInteractiveUI', () => {
|
|
|
1068
1145
|
shouldOpenAuthDialog: false,
|
|
1069
1146
|
geminiMdFileCount: 0,
|
|
1070
1147
|
};
|
|
1071
|
-
vi.mock('./utils/version.js', () => ({
|
|
1072
|
-
getCliVersion: vi.fn(() => Promise.resolve('1.0.0')),
|
|
1073
|
-
}));
|
|
1074
1148
|
vi.mock('./ui/utils/kittyProtocolDetector.js', () => ({
|
|
1075
1149
|
detectAndEnableKittyProtocol: vi.fn(() => Promise.resolve(true)),
|
|
1076
1150
|
isKittyProtocolSupported: vi.fn(() => true),
|
|
@@ -1084,6 +1158,7 @@ describe('startInteractiveUI', () => {
|
|
|
1084
1158
|
registerCleanup: vi.fn(),
|
|
1085
1159
|
runExitCleanup: vi.fn(),
|
|
1086
1160
|
registerSyncCleanup: vi.fn(),
|
|
1161
|
+
registerTelemetryConfig: vi.fn(),
|
|
1087
1162
|
}));
|
|
1088
1163
|
afterEach(() => {
|
|
1089
1164
|
vi.restoreAllMocks();
|
|
@@ -1098,7 +1173,6 @@ describe('startInteractiveUI', () => {
|
|
|
1098
1173
|
const renderSpy = vi.mocked(render);
|
|
1099
1174
|
await startTestInteractiveUI(mockConfig, mockSettings, mockStartupWarnings, mockWorkspaceRoot, undefined, mockInitializationResult);
|
|
1100
1175
|
// Verify render was called with correct options
|
|
1101
|
-
expect(renderSpy).toHaveBeenCalledTimes(1);
|
|
1102
1176
|
const [reactElement, options] = renderSpy.mock.calls[0];
|
|
1103
1177
|
// Verify render options
|
|
1104
1178
|
expect(options).toEqual(expect.objectContaining({
|
|
@@ -1124,12 +1198,12 @@ describe('startInteractiveUI', () => {
|
|
|
1124
1198
|
expect(patchSpy).toHaveBeenCalled();
|
|
1125
1199
|
});
|
|
1126
1200
|
it('should perform all startup tasks in correct order', async () => {
|
|
1127
|
-
const {
|
|
1201
|
+
const { getVersion } = await import('@google/gemini-cli-core');
|
|
1128
1202
|
const { checkForUpdates } = await import('./ui/utils/updateCheck.js');
|
|
1129
1203
|
const { registerCleanup } = await import('./utils/cleanup.js');
|
|
1130
1204
|
await startTestInteractiveUI(mockConfig, mockSettings, mockStartupWarnings, mockWorkspaceRoot, undefined, mockInitializationResult);
|
|
1131
1205
|
// Verify all startup tasks were called
|
|
1132
|
-
expect(
|
|
1206
|
+
expect(getVersion).toHaveBeenCalledTimes(1);
|
|
1133
1207
|
expect(registerCleanup).toHaveBeenCalledTimes(3);
|
|
1134
1208
|
// Verify cleanup handler is registered with unmount function
|
|
1135
1209
|
const cleanupFn = vi.mocked(registerCleanup).mock.calls[0][0];
|