@machina.ai/cell-cli 1.16.0-rc2 → 1.19.4-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/index.d.ts +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/package.json +10 -9
- package/dist/src/commands/extensions/disable.js +2 -0
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/disable.test.d.ts +6 -0
- package/dist/src/commands/extensions/disable.test.js +169 -0
- package/dist/src/commands/extensions/disable.test.js.map +1 -0
- package/dist/src/commands/extensions/enable.js +2 -0
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/enable.test.d.ts +6 -0
- package/dist/src/commands/extensions/enable.test.js +150 -0
- package/dist/src/commands/extensions/enable.test.js.map +1 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.d.ts +6 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js +111 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +1 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.test.ts +143 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +1 -1
- package/dist/src/commands/extensions/install.js +2 -0
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +3 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.js +2 -0
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/link.test.d.ts +6 -0
- package/dist/src/commands/extensions/link.test.js +131 -0
- package/dist/src/commands/extensions/link.test.js.map +1 -0
- package/dist/src/commands/extensions/list.js +2 -0
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/list.test.d.ts +6 -0
- package/dist/src/commands/extensions/list.test.js +112 -0
- package/dist/src/commands/extensions/list.test.js.map +1 -0
- package/dist/src/commands/extensions/new.js +2 -0
- package/dist/src/commands/extensions/new.js.map +1 -1
- package/dist/src/commands/extensions/new.test.js +3 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.d.ts +1 -1
- package/dist/src/commands/extensions/uninstall.js +26 -9
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js +190 -9
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.js +2 -0
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions/update.test.d.ts +6 -0
- package/dist/src/commands/extensions/update.test.js +170 -0
- package/dist/src/commands/extensions/update.test.js.map +1 -0
- package/dist/src/commands/extensions/validate.js +2 -0
- package/dist/src/commands/extensions/validate.js.map +1 -1
- package/dist/src/commands/extensions/validate.test.js +3 -0
- package/dist/src/commands/extensions/validate.test.js.map +1 -1
- package/dist/src/commands/extensions.js +2 -0
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/extensions.test.d.ts +6 -0
- package/dist/src/commands/extensions.test.js +67 -0
- package/dist/src/commands/extensions.test.js.map +1 -0
- package/dist/src/commands/mcp/add.js +2 -0
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/mcp/add.test.js +11 -3
- package/dist/src/commands/mcp/add.test.js.map +1 -1
- package/dist/src/commands/mcp/list.js +2 -0
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.js +4 -6
- package/dist/src/commands/mcp/list.test.js.map +1 -1
- package/dist/src/commands/mcp/remove.js +2 -0
- package/dist/src/commands/mcp/remove.js.map +1 -1
- package/dist/src/commands/mcp/remove.test.js +26 -12
- package/dist/src/commands/mcp/remove.test.js.map +1 -1
- package/dist/src/commands/mcp.js +2 -0
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/mcp.test.js +1 -0
- package/dist/src/commands/mcp.test.js.map +1 -1
- package/dist/src/commands/utils.d.ts +6 -0
- package/dist/src/commands/utils.js +11 -0
- package/dist/src/commands/utils.js.map +1 -0
- package/dist/src/commands/utils.test.d.ts +6 -0
- package/dist/src/commands/utils.test.js +35 -0
- package/dist/src/commands/utils.test.js.map +1 -0
- package/dist/src/config/auth.js +4 -0
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.js +1 -2
- package/dist/src/config/auth.test.js.map +1 -1
- package/dist/src/config/config.d.ts +2 -1
- package/dist/src/config/config.integration.test.js +81 -198
- package/dist/src/config/config.integration.test.js.map +1 -1
- package/dist/src/config/config.js +38 -31
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +235 -294
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension.test.js +30 -48
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensions/consent.test.d.ts +6 -0
- package/dist/src/config/extensions/consent.test.js +152 -0
- package/dist/src/config/extensions/consent.test.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.test.js +82 -15
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.test.js +105 -1
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
- package/dist/src/config/extensions/github.d.ts +1 -0
- package/dist/src/config/extensions/github.js +21 -5
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +201 -318
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/storage.test.d.ts +6 -0
- package/dist/src/config/extensions/storage.test.js +64 -0
- package/dist/src/config/extensions/storage.test.js.map +1 -0
- package/dist/src/config/extensions/update.test.js +154 -263
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/extensions/variables.test.js +87 -1
- package/dist/src/config/extensions/variables.test.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +1 -1
- package/dist/src/config/keyBindings.js +4 -4
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +1 -1
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/sandboxConfig.test.d.ts +6 -0
- package/dist/src/config/sandboxConfig.test.js +178 -0
- package/dist/src/config/sandboxConfig.test.js.map +1 -0
- package/dist/src/config/settingPaths.test.d.ts +6 -0
- package/dist/src/config/settingPaths.test.js +22 -0
- package/dist/src/config/settingPaths.test.js.map +1 -0
- package/dist/src/config/settings.js +12 -1
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +228 -227
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +25 -7
- package/dist/src/config/settingsSchema.js +26 -8
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +11 -6
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +1 -1
- package/dist/src/config/trustedFolders.js +24 -17
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/core/auth.test.d.ts +6 -0
- package/dist/src/core/auth.test.js +43 -0
- package/dist/src/core/auth.test.js.map +1 -0
- package/dist/src/core/initializer.test.d.ts +6 -0
- package/dist/src/core/initializer.test.js +101 -0
- package/dist/src/core/initializer.test.js.map +1 -0
- package/dist/src/core/theme.test.d.ts +6 -0
- package/dist/src/core/theme.test.js +46 -0
- package/dist/src/core/theme.test.js.map +1 -0
- package/dist/src/gemini.d.ts +3 -1
- package/dist/src/gemini.js +80 -17
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +681 -16
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.d.ts +6 -0
- package/dist/src/gemini_cleanup.test.js +201 -0
- package/dist/src/gemini_cleanup.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/nonInteractiveCli.js +4 -1
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +338 -2
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +3 -1
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +1 -22
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/CommandService.test.js +3 -2
- package/dist/src/services/CommandService.test.js.map +1 -1
- package/dist/src/services/McpPromptLoader.js +5 -3
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +29 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +1 -1
- package/dist/src/test-utils/render.d.ts +26 -2
- package/dist/src/test-utils/render.js +80 -3
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/ui/App.test.js +28 -14
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.js +142 -48
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +181 -103
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.test.d.ts +6 -0
- package/dist/src/ui/IdeIntegrationNudge.test.js +147 -0
- package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -0
- package/dist/src/ui/auth/ApiAuthDialog.test.js +12 -17
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.js +17 -10
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +55 -21
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthInProgress.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthInProgress.test.js +71 -0
- package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +2 -0
- package/dist/src/ui/auth/useAuth.js +6 -1
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
- package/dist/src/ui/auth/useAuth.test.js +178 -0
- package/dist/src/ui/auth/useAuth.test.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.js +8 -1
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.test.js +4 -0
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.js +12 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.test.js +5 -0
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +0 -1
- package/dist/src/ui/commands/directoryCommand.js +104 -43
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +91 -2
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +28 -6
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +32 -0
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +1 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.js +3 -0
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/permissionsCommand.js +62 -5
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -1
- package/dist/src/ui/commands/permissionsCommand.test.js +60 -4
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
- package/dist/src/ui/commands/resumeCommand.js +16 -0
- package/dist/src/ui/commands/resumeCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +82 -45
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js +35 -5
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js +27 -16
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +8 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +1 -0
- package/dist/src/ui/components/AboutBox.js +1 -1
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AboutBox.test.d.ts +6 -0
- package/dist/src/ui/components/AboutBox.test.js +53 -0
- package/dist/src/ui/components/AboutBox.test.js.map +1 -0
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +62 -11
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js +18 -23
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AppHeader.js +3 -22
- package/dist/src/ui/components/AppHeader.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +10 -4
- 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/AutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/AutoAcceptIndicator.test.js +31 -0
- package/dist/src/ui/components/AutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/components/Banner.d.ts +4 -2
- package/dist/src/ui/components/Banner.js +18 -4
- package/dist/src/ui/components/Banner.js.map +1 -1
- package/dist/src/ui/components/Banner.test.d.ts +6 -0
- package/dist/src/ui/components/Banner.test.js +24 -0
- package/dist/src/ui/components/Banner.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.js +103 -0
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +26 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.js +39 -0
- package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/CopyModeWarning.test.d.ts +6 -0
- package/dist/src/ui/components/CopyModeWarning.test.js +33 -0
- package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.d.ts +1 -0
- package/dist/src/ui/components/DebugProfiler.js +24 -35
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.test.js +47 -1
- package/dist/src/ui/components/DebugProfiler.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +49 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -0
- package/dist/src/ui/components/DialogManager.js +11 -2
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/DialogManager.test.d.ts +6 -0
- package/dist/src/ui/components/DialogManager.test.js +167 -0
- package/dist/src/ui/components/DialogManager.test.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.js +111 -0
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ExitWarning.test.d.ts +6 -0
- package/dist/src/ui/components/ExitWarning.test.js +54 -0
- package/dist/src/ui/components/ExitWarning.test.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +58 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
- package/dist/src/ui/components/GradientRegression.test.js +22 -1
- package/dist/src/ui/components/GradientRegression.test.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +27 -2
- 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/InputPrompt.js +30 -36
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +110 -24
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +6 -1
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/MainContent.test.d.ts +6 -0
- package/dist/src/ui/components/MainContent.test.js +73 -0
- package/dist/src/ui/components/MainContent.test.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.js +49 -0
- package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.js +2 -2
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +1 -1
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +23 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.js +90 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +161 -0
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Notifications.js +5 -3
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/Notifications.test.d.ts +6 -0
- package/dist/src/ui/components/Notifications.test.js +153 -0
- package/dist/src/ui/components/Notifications.test.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +5 -2
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +12 -7
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -1
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +2 -2
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.js +2 -2
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.test.js +49 -0
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -0
- package/dist/src/ui/components/RawMarkdownIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/RawMarkdownIndicator.test.js +34 -0
- package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser.d.ts +98 -0
- package/dist/src/ui/components/SessionBrowser.js +457 -0
- package/dist/src/ui/components/SessionBrowser.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser.test.d.ts +6 -0
- package/dist/src/ui/components/SessionBrowser.test.js +250 -0
- package/dist/src/ui/components/SessionBrowser.test.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.d.ts +3 -1
- package/dist/src/ui/components/SettingsDialog.js +4 -1
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ShellInputPrompt.test.js +82 -0
- package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/ShellModeIndicator.test.js +17 -0
- package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.test.d.ts +6 -0
- package/dist/src/ui/components/ShowMoreLines.test.js +40 -0
- package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js +56 -0
- package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.js +6 -2
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +20 -6
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ThemedGradient.js +2 -1
- package/dist/src/ui/components/ThemedGradient.js.map +1 -1
- package/dist/src/ui/components/ThemedGradient.test.d.ts +6 -0
- package/dist/src/ui/components/ThemedGradient.test.js +30 -0
- package/dist/src/ui/components/ThemedGradient.test.js.map +1 -0
- package/dist/src/ui/components/Tips.test.d.ts +6 -0
- package/dist/src/ui/components/Tips.test.js +23 -0
- package/dist/src/ui/components/Tips.test.js.map +1 -0
- package/dist/src/ui/components/UpdateNotification.test.d.ts +6 -0
- package/dist/src/ui/components/UpdateNotification.test.js +16 -0
- package/dist/src/ui/components/UpdateNotification.test.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.js +23 -0
- package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/InfoMessage.test.js +28 -0
- package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ModelMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ModelMessage.js +5 -0
- package/dist/src/ui/components/messages/ModelMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ShellToolMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/ShellToolMessage.js +76 -0
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +123 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +5 -6
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +19 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +6 -4
- package/dist/src/ui/components/messages/ToolMessage.js +15 -102
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +26 -26
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.d.ts +13 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js +54 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +96 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolShared.d.ts +23 -0
- package/dist/src/ui/components/messages/ToolShared.js +40 -0
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/UserMessage.test.js +32 -0
- package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/WarningMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/WarningMessage.test.js +23 -0
- package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +1 -0
- package/dist/src/ui/components/shared/text-buffer.js +27 -5
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +20 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/constants/tips.d.ts +6 -0
- package/dist/src/ui/constants/tips.js +168 -0
- package/dist/src/ui/constants/tips.js.map +1 -0
- package/dist/src/ui/constants/wittyPhrases.d.ts +6 -0
- package/dist/src/ui/constants/wittyPhrases.js +137 -0
- package/dist/src/ui/constants/wittyPhrases.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.js +21 -11
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +29 -10
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +8 -0
- package/dist/src/ui/contexts/UIActionsContext.js +1 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +5 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +11 -5
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +4 -3
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js +17 -5
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +2 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.js +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -1
- package/dist/src/ui/hooks/useBanner.d.ts +14 -0
- package/dist/src/ui/hooks/useBanner.js +48 -0
- package/dist/src/ui/hooks/useBanner.js.map +1 -0
- package/dist/src/ui/hooks/useBanner.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBanner.test.js +92 -0
- package/dist/src/ui/hooks/useBanner.test.js.map +1 -0
- package/dist/src/ui/hooks/useBracketedPaste.js +3 -4
- package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +5 -5
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +26 -1
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.test.js +37 -5
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.d.ts +2 -2
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +11 -1
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +22 -0
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -1
- package/dist/src/ui/hooks/useGeminiStream.js +69 -12
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +21 -22
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +5 -2
- package/dist/src/ui/hooks/useHistoryManager.js +39 -3
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -1
- package/dist/src/ui/hooks/useInactivityTimer.d.ts +14 -0
- package/dist/src/ui/hooks/useInactivityTimer.js +30 -0
- package/dist/src/ui/hooks/useInactivityTimer.js.map +1 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +8 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +119 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +151 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +4 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +1 -2
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +21 -9
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouseClick.d.ts +12 -0
- package/dist/src/ui/hooks/useMouseClick.js +28 -0
- package/dist/src/ui/hooks/useMouseClick.js.map +1 -0
- package/dist/src/ui/hooks/useMouseClick.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMouseClick.test.js +59 -0
- package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +2 -2
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +44 -7
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +191 -89
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +4 -3
- package/dist/src/ui/hooks/usePhraseCycler.js +54 -305
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.js +109 -30
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.js +9 -3
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +25 -3
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js +4 -8
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.test.js +1 -8
- package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +18 -12
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.d.ts +18 -1
- package/dist/src/ui/hooks/useSessionBrowser.js +76 -4
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.test.js +154 -489
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.js +1 -1
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.test.js +4 -4
- package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +5 -5
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +8 -4
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +2 -2
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.js +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +1 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +121 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +34 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +34 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +6 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.js +62 -0
- package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -0
- package/dist/src/ui/state/extensions.test.js +208 -51
- package/dist/src/ui/state/extensions.test.js.map +1 -1
- package/dist/src/ui/themes/holiday.d.ts +7 -0
- package/dist/src/ui/themes/holiday.js +162 -0
- package/dist/src/ui/themes/holiday.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.js +2 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.js +2 -1
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -1
- package/dist/src/ui/types.d.ts +7 -1
- package/dist/src/ui/types.js +1 -1
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.js +6 -9
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/bracketedPaste.d.ts +7 -0
- package/dist/src/ui/utils/bracketedPaste.js +15 -0
- package/dist/src/ui/utils/bracketedPaste.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.js +3 -86
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +21 -273
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.d.ts +6 -0
- package/dist/src/ui/utils/directoryUtils.js +21 -0
- package/dist/src/ui/utils/directoryUtils.js.map +1 -0
- package/dist/src/ui/utils/directoryUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/directoryUtils.test.js +52 -0
- package/dist/src/ui/utils/directoryUtils.test.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +6 -2
- package/dist/src/ui/utils/kittyProtocolDetector.js +47 -43
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/kittyProtocolDetector.test.d.ts +6 -0
- package/dist/src/ui/utils/kittyProtocolDetector.test.js +113 -0
- package/dist/src/ui/utils/kittyProtocolDetector.test.js.map +1 -0
- package/dist/src/ui/utils/mouse.d.ts +2 -2
- package/dist/src/ui/utils/mouse.js +2 -11
- package/dist/src/ui/utils/mouse.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.js +39 -38
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.d.ts +6 -0
- package/dist/src/ui/utils/terminalSetup.test.js +132 -0
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -0
- package/dist/src/ui/utils/ui-sizing.test.d.ts +6 -0
- package/dist/src/ui/utils/ui-sizing.test.js +56 -0
- package/dist/src/ui/utils/ui-sizing.test.js.map +1 -0
- package/dist/src/utils/checks.test.d.ts +6 -0
- package/dist/src/utils/checks.test.js +29 -0
- package/dist/src/utils/checks.test.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -0
- package/dist/src/utils/cleanup.js +16 -0
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/cleanup.test.js +69 -16
- package/dist/src/utils/cleanup.test.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.test.d.ts +6 -0
- package/dist/src/utils/dialogScopeUtils.test.js +81 -0
- package/dist/src/utils/dialogScopeUtils.test.js.map +1 -0
- package/dist/src/utils/errors.js +10 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +62 -0
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +0 -2
- package/dist/src/utils/events.js +0 -1
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/events.test.d.ts +6 -0
- package/dist/src/utils/events.test.js +24 -0
- package/dist/src/utils/events.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.test.js +103 -24
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +8 -9
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/math.test.d.ts +6 -0
- package/dist/src/utils/math.test.js +23 -0
- package/dist/src/utils/math.test.js.map +1 -0
- package/dist/src/utils/persistentState.d.ts +1 -1
- package/dist/src/utils/persistentState.test.d.ts +6 -0
- package/dist/src/utils/persistentState.test.js +68 -0
- package/dist/src/utils/persistentState.test.js.map +1 -0
- package/dist/src/utils/readStdin.js +1 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.js +25 -0
- package/dist/src/utils/readStdin.test.js.map +1 -1
- package/dist/src/utils/resolvePath.test.d.ts +6 -0
- package/dist/src/utils/resolvePath.test.js +31 -0
- package/dist/src/utils/resolvePath.test.js.map +1 -0
- package/dist/src/utils/sandbox.js +6 -137
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandbox.test.d.ts +6 -0
- package/dist/src/utils/sandbox.test.js +302 -0
- package/dist/src/utils/sandbox.test.js.map +1 -0
- package/dist/src/utils/sandboxUtils.d.ts +14 -0
- package/dist/src/utils/sandboxUtils.js +120 -0
- package/dist/src/utils/sandboxUtils.js.map +1 -0
- package/dist/src/utils/sandboxUtils.test.d.ts +6 -0
- package/dist/src/utils/sandboxUtils.test.js +119 -0
- package/dist/src/utils/sandboxUtils.test.js.map +1 -0
- package/dist/src/utils/sessionCleanup.test.js +42 -2
- package/dist/src/utils/sessionCleanup.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +54 -4
- package/dist/src/utils/sessionUtils.js +106 -26
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +46 -3
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +4 -1
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/sessions.test.d.ts +6 -0
- package/dist/src/utils/sessions.test.js +558 -0
- package/dist/src/utils/sessions.test.js.map +1 -0
- package/dist/src/utils/updateEventEmitter.test.d.ts +6 -0
- package/dist/src/utils/updateEventEmitter.test.js +18 -0
- package/dist/src/utils/updateEventEmitter.test.js.map +1 -0
- package/dist/src/utils/version.test.d.ts +6 -0
- package/dist/src/utils/version.test.js +39 -0
- package/dist/src/utils/version.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.js +2 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.d.ts +2 -24
- package/dist/src/zed-integration/acp.js +2 -156
- package/dist/src/zed-integration/acp.js.map +1 -1
- package/dist/src/zed-integration/acp.test.d.ts +6 -0
- package/dist/src/zed-integration/acp.test.js +227 -0
- package/dist/src/zed-integration/acp.test.js.map +1 -0
- package/dist/src/zed-integration/connection.d.ts +28 -0
- package/dist/src/zed-integration/connection.js +163 -0
- package/dist/src/zed-integration/connection.js.map +1 -0
- package/dist/src/zed-integration/connection.test.d.ts +6 -0
- package/dist/src/zed-integration/connection.test.js +175 -0
- package/dist/src/zed-integration/connection.test.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.test.d.ts +6 -0
- package/dist/src/zed-integration/fileSystemService.test.js +98 -0
- package/dist/src/zed-integration/fileSystemService.test.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +69 -13
- package/dist/src/zed-integration/schema.js +6 -5
- package/dist/src/zed-integration/schema.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +31 -8
- package/dist/src/zed-integration/zedIntegration.js +14 -23
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.test.d.ts +6 -0
- package/dist/src/zed-integration/zedIntegration.test.js +619 -0
- package/dist/src/zed-integration/zedIntegration.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
|
@@ -6,35 +6,53 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { describe, it, expect, vi, beforeEach, afterEach, } from 'vitest';
|
|
8
8
|
import { render } from '../test-utils/render.js';
|
|
9
|
+
import { waitFor } from '../test-utils/async.js';
|
|
9
10
|
import { cleanup } from 'ink-testing-library';
|
|
10
11
|
import { act, useContext } from 'react';
|
|
11
12
|
import { AppContainer } from './AppContainer.js';
|
|
12
13
|
import { SettingsContext } from './contexts/SettingsContext.js';
|
|
13
|
-
import { makeFakeConfig, CoreEvent, } from '@google/gemini-cli-core';
|
|
14
|
+
import { makeFakeConfig, CoreEvent, AuthType, } from '@google/gemini-cli-core';
|
|
14
15
|
// Mock coreEvents
|
|
15
16
|
const mockCoreEvents = vi.hoisted(() => ({
|
|
16
17
|
on: vi.fn(),
|
|
17
18
|
off: vi.fn(),
|
|
18
|
-
|
|
19
|
+
drainBacklogs: vi.fn(),
|
|
19
20
|
emit: vi.fn(),
|
|
20
21
|
}));
|
|
22
|
+
// Mock IdeClient
|
|
23
|
+
const mockIdeClient = vi.hoisted(() => ({
|
|
24
|
+
getInstance: vi.fn().mockReturnValue(new Promise(() => { })),
|
|
25
|
+
}));
|
|
26
|
+
// Mock stdout
|
|
27
|
+
const mocks = vi.hoisted(() => ({
|
|
28
|
+
mockStdout: { write: vi.fn() },
|
|
29
|
+
}));
|
|
21
30
|
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
22
31
|
const actual = await importOriginal();
|
|
23
32
|
return {
|
|
24
33
|
...actual,
|
|
25
34
|
coreEvents: mockCoreEvents,
|
|
35
|
+
IdeClient: mockIdeClient,
|
|
36
|
+
writeToStdout: vi.fn((...args) => process.stdout.write(...args)),
|
|
37
|
+
writeToStderr: vi.fn((...args) => process.stderr.write(...args)),
|
|
38
|
+
patchStdio: vi.fn(() => () => { }),
|
|
39
|
+
createInkStdio: vi.fn(() => ({
|
|
40
|
+
stdout: process.stdout,
|
|
41
|
+
stderr: process.stderr,
|
|
42
|
+
})),
|
|
43
|
+
enableMouseEvents: vi.fn(),
|
|
44
|
+
disableMouseEvents: vi.fn(),
|
|
26
45
|
};
|
|
27
46
|
});
|
|
28
47
|
import { useQuotaAndFallback } from './hooks/useQuotaAndFallback.js';
|
|
29
48
|
import { UIStateContext } from './contexts/UIStateContext.js';
|
|
30
49
|
import { UIActionsContext, } from './contexts/UIActionsContext.js';
|
|
31
50
|
// Mock useStdout to capture terminal title writes
|
|
32
|
-
let mockStdout;
|
|
33
51
|
vi.mock('ink', async (importOriginal) => {
|
|
34
52
|
const actual = await importOriginal();
|
|
35
53
|
return {
|
|
36
54
|
...actual,
|
|
37
|
-
useStdout: () => ({ stdout: mockStdout }),
|
|
55
|
+
useStdout: () => ({ stdout: mocks.mockStdout }),
|
|
38
56
|
measureElement: vi.fn(),
|
|
39
57
|
};
|
|
40
58
|
});
|
|
@@ -82,10 +100,6 @@ vi.mock('../utils/events.js');
|
|
|
82
100
|
vi.mock('../utils/handleAutoUpdate.js');
|
|
83
101
|
vi.mock('./utils/ConsolePatcher.js');
|
|
84
102
|
vi.mock('../utils/cleanup.js');
|
|
85
|
-
vi.mock('./utils/mouse.js', () => ({
|
|
86
|
-
enableMouseEvents: vi.fn(),
|
|
87
|
-
disableMouseEvents: vi.fn(),
|
|
88
|
-
}));
|
|
89
103
|
import { useHistory } from './hooks/useHistoryManager.js';
|
|
90
104
|
import { useThemeCommand } from './hooks/useThemeCommand.js';
|
|
91
105
|
import { useAuthCommand } from './auth/useAuth.js';
|
|
@@ -109,9 +123,8 @@ import { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
|
|
|
109
123
|
import { useKeypress } from './hooks/useKeypress.js';
|
|
110
124
|
import { measureElement } from 'ink';
|
|
111
125
|
import { useTerminalSize } from './hooks/useTerminalSize.js';
|
|
112
|
-
import { ShellExecutionService } from '@google/gemini-cli-core';
|
|
126
|
+
import { ShellExecutionService, writeToStdout, enableMouseEvents, disableMouseEvents, } from '@google/gemini-cli-core';
|
|
113
127
|
import {} from '../config/extension-manager.js';
|
|
114
|
-
import { enableMouseEvents, disableMouseEvents } from './utils/mouse.js';
|
|
115
128
|
describe('AppContainer State Management', () => {
|
|
116
129
|
let mockConfig;
|
|
117
130
|
let mockSettings;
|
|
@@ -147,7 +160,7 @@ describe('AppContainer State Management', () => {
|
|
|
147
160
|
beforeEach(() => {
|
|
148
161
|
vi.clearAllMocks();
|
|
149
162
|
// Initialize mock stdout for terminal title tests
|
|
150
|
-
mockStdout
|
|
163
|
+
mocks.mockStdout.write.mockClear();
|
|
151
164
|
// Mock computeWindowTitle function to centralize title logic testing
|
|
152
165
|
vi.mock('../utils/windowTitle.js', async () => ({
|
|
153
166
|
computeWindowTitle: vi.fn((folderName) =>
|
|
@@ -254,7 +267,7 @@ describe('AppContainer State Management', () => {
|
|
|
254
267
|
// Add other properties if AppContainer uses them
|
|
255
268
|
});
|
|
256
269
|
mockedUseLogger.mockReturnValue({
|
|
257
|
-
getPreviousUserMessages: vi.fn().
|
|
270
|
+
getPreviousUserMessages: vi.fn().mockReturnValue(new Promise(() => { })),
|
|
258
271
|
});
|
|
259
272
|
mockedUseLoadingIndicator.mockReturnValue({
|
|
260
273
|
elapsedTime: '0.0s',
|
|
@@ -300,17 +313,13 @@ describe('AppContainer State Management', () => {
|
|
|
300
313
|
describe('Basic Rendering', () => {
|
|
301
314
|
it('renders without crashing with minimal props', async () => {
|
|
302
315
|
const { unmount } = renderAppContainer();
|
|
303
|
-
await
|
|
304
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
305
|
-
});
|
|
316
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
306
317
|
unmount();
|
|
307
318
|
});
|
|
308
319
|
it('renders with startup warnings', async () => {
|
|
309
320
|
const startupWarnings = ['Warning 1', 'Warning 2'];
|
|
310
321
|
const { unmount } = renderAppContainer({ startupWarnings });
|
|
311
|
-
await
|
|
312
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
313
|
-
});
|
|
322
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
314
323
|
unmount();
|
|
315
324
|
});
|
|
316
325
|
});
|
|
@@ -323,9 +332,7 @@ describe('AppContainer State Management', () => {
|
|
|
323
332
|
const { unmount } = renderAppContainer({
|
|
324
333
|
initResult: initResultWithError,
|
|
325
334
|
});
|
|
326
|
-
await
|
|
327
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
328
|
-
});
|
|
335
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
329
336
|
unmount();
|
|
330
337
|
});
|
|
331
338
|
it('handles debug mode state', () => {
|
|
@@ -339,31 +346,23 @@ describe('AppContainer State Management', () => {
|
|
|
339
346
|
describe('Context Providers', () => {
|
|
340
347
|
it('provides AppContext with correct values', async () => {
|
|
341
348
|
const { unmount } = renderAppContainer({ version: '2.0.0' });
|
|
342
|
-
await
|
|
343
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
344
|
-
});
|
|
349
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
345
350
|
// Should render and unmount cleanly
|
|
346
351
|
expect(() => unmount()).not.toThrow();
|
|
347
352
|
});
|
|
348
353
|
it('provides UIStateContext with state management', async () => {
|
|
349
354
|
const { unmount } = renderAppContainer();
|
|
350
|
-
await
|
|
351
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
352
|
-
});
|
|
355
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
353
356
|
unmount();
|
|
354
357
|
});
|
|
355
358
|
it('provides UIActionsContext with action handlers', async () => {
|
|
356
359
|
const { unmount } = renderAppContainer();
|
|
357
|
-
await
|
|
358
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
359
|
-
});
|
|
360
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
360
361
|
unmount();
|
|
361
362
|
});
|
|
362
363
|
it('provides ConfigContext with config object', async () => {
|
|
363
364
|
const { unmount } = renderAppContainer();
|
|
364
|
-
await
|
|
365
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
366
|
-
});
|
|
365
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
367
366
|
unmount();
|
|
368
367
|
});
|
|
369
368
|
});
|
|
@@ -378,9 +377,7 @@ describe('AppContainer State Management', () => {
|
|
|
378
377
|
},
|
|
379
378
|
};
|
|
380
379
|
const { unmount } = renderAppContainer({ settings: settingsAllHidden });
|
|
381
|
-
await
|
|
382
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
383
|
-
});
|
|
380
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
384
381
|
unmount();
|
|
385
382
|
});
|
|
386
383
|
it('handles settings with memory usage enabled', async () => {
|
|
@@ -393,18 +390,14 @@ describe('AppContainer State Management', () => {
|
|
|
393
390
|
},
|
|
394
391
|
};
|
|
395
392
|
const { unmount } = renderAppContainer({ settings: settingsWithMemory });
|
|
396
|
-
await
|
|
397
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
398
|
-
});
|
|
393
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
399
394
|
unmount();
|
|
400
395
|
});
|
|
401
396
|
});
|
|
402
397
|
describe('Version Handling', () => {
|
|
403
398
|
it.each(['1.0.0', '2.1.3-beta', '3.0.0-nightly'])('handles version format: %s', async (version) => {
|
|
404
399
|
const { unmount } = renderAppContainer({ version });
|
|
405
|
-
await
|
|
406
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
407
|
-
});
|
|
400
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
408
401
|
unmount();
|
|
409
402
|
});
|
|
410
403
|
});
|
|
@@ -416,9 +409,6 @@ describe('AppContainer State Management', () => {
|
|
|
416
409
|
});
|
|
417
410
|
// Should still render without crashing - errors should be handled internally
|
|
418
411
|
const { unmount } = renderAppContainer({ config: errorConfig });
|
|
419
|
-
await act(async () => {
|
|
420
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
421
|
-
});
|
|
422
412
|
unmount();
|
|
423
413
|
});
|
|
424
414
|
it('handles undefined settings gracefully', async () => {
|
|
@@ -426,9 +416,7 @@ describe('AppContainer State Management', () => {
|
|
|
426
416
|
merged: {},
|
|
427
417
|
};
|
|
428
418
|
const { unmount } = renderAppContainer({ settings: undefinedSettings });
|
|
429
|
-
await
|
|
430
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
431
|
-
});
|
|
419
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
432
420
|
unmount();
|
|
433
421
|
});
|
|
434
422
|
});
|
|
@@ -724,11 +712,10 @@ describe('AppContainer State Management', () => {
|
|
|
724
712
|
it('passes a null proQuotaRequest to UIStateContext by default', async () => {
|
|
725
713
|
// The default mock from beforeEach already sets proQuotaRequest to null
|
|
726
714
|
const { unmount } = renderAppContainer();
|
|
727
|
-
await
|
|
728
|
-
|
|
715
|
+
await waitFor(() => {
|
|
716
|
+
// Assert that the context value is as expected
|
|
717
|
+
expect(capturedUIState.proQuotaRequest).toBeNull();
|
|
729
718
|
});
|
|
730
|
-
// Assert that the context value is as expected
|
|
731
|
-
expect(capturedUIState.proQuotaRequest).toBeNull();
|
|
732
719
|
unmount();
|
|
733
720
|
});
|
|
734
721
|
it('passes a valid proQuotaRequest to UIStateContext when provided by the hook', async () => {
|
|
@@ -744,11 +731,10 @@ describe('AppContainer State Management', () => {
|
|
|
744
731
|
});
|
|
745
732
|
// Act: Render the container
|
|
746
733
|
const { unmount } = renderAppContainer();
|
|
747
|
-
await
|
|
748
|
-
|
|
734
|
+
await waitFor(() => {
|
|
735
|
+
// Assert: The mock request is correctly passed through the context
|
|
736
|
+
expect(capturedUIState.proQuotaRequest).toEqual(mockRequest);
|
|
749
737
|
});
|
|
750
|
-
// Assert: The mock request is correctly passed through the context
|
|
751
|
-
expect(capturedUIState.proQuotaRequest).toEqual(mockRequest);
|
|
752
738
|
unmount();
|
|
753
739
|
});
|
|
754
740
|
it('passes the handleProQuotaChoice function to UIActionsContext', async () => {
|
|
@@ -760,11 +746,10 @@ describe('AppContainer State Management', () => {
|
|
|
760
746
|
});
|
|
761
747
|
// Act: Render the container
|
|
762
748
|
const { unmount } = renderAppContainer();
|
|
763
|
-
await
|
|
764
|
-
|
|
749
|
+
await waitFor(() => {
|
|
750
|
+
// Assert: The action in the context is the mock handler we provided
|
|
751
|
+
expect(capturedUIActions.handleProQuotaChoice).toBe(mockHandler);
|
|
765
752
|
});
|
|
766
|
-
// Assert: The action in the context is the mock handler we provided
|
|
767
|
-
expect(capturedUIActions.handleProQuotaChoice).toBe(mockHandler);
|
|
768
753
|
// You can even verify that the plumbed function is callable
|
|
769
754
|
act(() => {
|
|
770
755
|
capturedUIActions.handleProQuotaChoice('retry_later');
|
|
@@ -776,7 +761,12 @@ describe('AppContainer State Management', () => {
|
|
|
776
761
|
describe('Terminal Title Update Feature', () => {
|
|
777
762
|
beforeEach(() => {
|
|
778
763
|
// Reset mock stdout for each test
|
|
779
|
-
mockStdout
|
|
764
|
+
mocks.mockStdout.write.mockClear();
|
|
765
|
+
});
|
|
766
|
+
it('verifies useStdout is mocked', async () => {
|
|
767
|
+
const { useStdout } = await import('ink');
|
|
768
|
+
const { stdout } = useStdout();
|
|
769
|
+
expect(stdout).toBe(mocks.mockStdout);
|
|
780
770
|
});
|
|
781
771
|
it('should not update terminal title when showStatusInTitle is false', () => {
|
|
782
772
|
// Arrange: Set up mock settings with showStatusInTitle disabled
|
|
@@ -796,7 +786,7 @@ describe('AppContainer State Management', () => {
|
|
|
796
786
|
settings: mockSettingsWithShowStatusFalse,
|
|
797
787
|
});
|
|
798
788
|
// Assert: Check that no title-related writes occurred
|
|
799
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
789
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
800
790
|
expect(titleWrites).toHaveLength(0);
|
|
801
791
|
unmount();
|
|
802
792
|
});
|
|
@@ -818,7 +808,7 @@ describe('AppContainer State Management', () => {
|
|
|
818
808
|
settings: mockSettingsWithHideTitleTrue,
|
|
819
809
|
});
|
|
820
810
|
// Assert: Check that no title-related writes occurred
|
|
821
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
811
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
822
812
|
expect(titleWrites).toHaveLength(0);
|
|
823
813
|
unmount();
|
|
824
814
|
});
|
|
@@ -850,7 +840,7 @@ describe('AppContainer State Management', () => {
|
|
|
850
840
|
settings: mockSettingsWithTitleEnabled,
|
|
851
841
|
});
|
|
852
842
|
// Assert: Check that title was updated with thought subject
|
|
853
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
843
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
854
844
|
expect(titleWrites).toHaveLength(1);
|
|
855
845
|
expect(titleWrites[0][0]).toBe(`\x1b]2;${thoughtSubject.padEnd(80, ' ')}\x07`);
|
|
856
846
|
unmount();
|
|
@@ -882,7 +872,7 @@ describe('AppContainer State Management', () => {
|
|
|
882
872
|
settings: mockSettingsWithTitleEnabled,
|
|
883
873
|
});
|
|
884
874
|
// Assert: Check that title was updated with default Idle text
|
|
885
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
875
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
886
876
|
expect(titleWrites).toHaveLength(1);
|
|
887
877
|
expect(titleWrites[0][0]).toBe(`\x1b]2;${'Gemini - workspace'.padEnd(80, ' ')}\x07`);
|
|
888
878
|
unmount();
|
|
@@ -915,7 +905,7 @@ describe('AppContainer State Management', () => {
|
|
|
915
905
|
settings: mockSettingsWithTitleEnabled,
|
|
916
906
|
});
|
|
917
907
|
// Assert: Check that title was updated with confirmation text
|
|
918
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
908
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
919
909
|
expect(titleWrites).toHaveLength(1);
|
|
920
910
|
expect(titleWrites[0][0]).toBe(`\x1b]2;${thoughtSubject.padEnd(80, ' ')}\x07`);
|
|
921
911
|
unmount();
|
|
@@ -948,7 +938,7 @@ describe('AppContainer State Management', () => {
|
|
|
948
938
|
settings: mockSettingsWithTitleEnabled,
|
|
949
939
|
});
|
|
950
940
|
// Assert: Check that title is padded to exactly 80 characters
|
|
951
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
941
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
952
942
|
expect(titleWrites).toHaveLength(1);
|
|
953
943
|
const calledWith = titleWrites[0][0];
|
|
954
944
|
const expectedTitle = shortTitle.padEnd(80, ' ');
|
|
@@ -986,7 +976,7 @@ describe('AppContainer State Management', () => {
|
|
|
986
976
|
settings: mockSettingsWithTitleEnabled,
|
|
987
977
|
});
|
|
988
978
|
// Assert: Check that the correct ANSI escape sequence is used
|
|
989
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
979
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
990
980
|
expect(titleWrites).toHaveLength(1);
|
|
991
981
|
const expectedEscapeSequence = `\x1b]2;${title.padEnd(80, ' ')}\x07`;
|
|
992
982
|
expect(titleWrites[0][0]).toBe(expectedEscapeSequence);
|
|
@@ -1021,7 +1011,7 @@ describe('AppContainer State Management', () => {
|
|
|
1021
1011
|
settings: mockSettingsWithTitleEnabled,
|
|
1022
1012
|
});
|
|
1023
1013
|
// Assert: Check that title was updated with CLI_TITLE value
|
|
1024
|
-
const titleWrites = mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
1014
|
+
const titleWrites = mocks.mockStdout.write.mock.calls.filter((call) => call[0].includes('\x1b]2;'));
|
|
1025
1015
|
expect(titleWrites).toHaveLength(1);
|
|
1026
1016
|
expect(titleWrites[0][0]).toBe(`\x1b]2;${'Custom Gemini Title'.padEnd(80, ' ')}\x07`);
|
|
1027
1017
|
unmount();
|
|
@@ -1102,12 +1092,7 @@ describe('AppContainer State Management', () => {
|
|
|
1102
1092
|
activePtyId: 'some-id',
|
|
1103
1093
|
});
|
|
1104
1094
|
const { unmount } = renderAppContainer();
|
|
1105
|
-
await
|
|
1106
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1107
|
-
});
|
|
1108
|
-
// Assert: The shell should be resized to a minimum height of 1, not a negative number.
|
|
1109
|
-
// The old code would have tried to set a negative height.
|
|
1110
|
-
expect(resizePtySpy).toHaveBeenCalled();
|
|
1095
|
+
await waitFor(() => expect(resizePtySpy).toHaveBeenCalled());
|
|
1111
1096
|
const lastCall = resizePtySpy.mock.calls[resizePtySpy.mock.calls.length - 1];
|
|
1112
1097
|
// Check the height argument specifically
|
|
1113
1098
|
expect(lastCall[2]).toBe(1);
|
|
@@ -1198,7 +1183,7 @@ describe('AppContainer State Management', () => {
|
|
|
1198
1183
|
await setupKeypressTest();
|
|
1199
1184
|
pressKey({ name: 'c', ctrl: true }, 2);
|
|
1200
1185
|
expect(mockCancelOngoingRequest).toHaveBeenCalledTimes(2);
|
|
1201
|
-
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit');
|
|
1186
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit', undefined, undefined, false);
|
|
1202
1187
|
unmount();
|
|
1203
1188
|
});
|
|
1204
1189
|
it('should reset press count after a timeout', async () => {
|
|
@@ -1228,7 +1213,7 @@ describe('AppContainer State Management', () => {
|
|
|
1228
1213
|
it('should quit on second press if buffer is empty', async () => {
|
|
1229
1214
|
await setupKeypressTest();
|
|
1230
1215
|
pressKey({ name: 'd', ctrl: true }, 2);
|
|
1231
|
-
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit');
|
|
1216
|
+
expect(mockHandleSlashCommand).toHaveBeenCalledWith('/quit', undefined, undefined, false);
|
|
1232
1217
|
unmount();
|
|
1233
1218
|
});
|
|
1234
1219
|
it('should reset press count after a timeout', async () => {
|
|
@@ -1269,7 +1254,7 @@ describe('AppContainer State Management', () => {
|
|
|
1269
1254
|
unmount = renderResult.unmount;
|
|
1270
1255
|
};
|
|
1271
1256
|
beforeEach(() => {
|
|
1272
|
-
mockStdout.write.mockClear();
|
|
1257
|
+
mocks.mockStdout.write.mockClear();
|
|
1273
1258
|
mockedUseKeypress.mockImplementation((callback) => {
|
|
1274
1259
|
handleGlobalKeypress = callback;
|
|
1275
1260
|
});
|
|
@@ -1292,7 +1277,7 @@ describe('AppContainer State Management', () => {
|
|
|
1292
1277
|
])('$modeName', ({ isAlternateMode, shouldEnable }) => {
|
|
1293
1278
|
it(`should ${shouldEnable ? 'toggle' : 'NOT toggle'} mouse off when Ctrl+S is pressed`, async () => {
|
|
1294
1279
|
await setupCopyModeTest(isAlternateMode);
|
|
1295
|
-
mockStdout.write.mockClear(); // Clear initial enable call
|
|
1280
|
+
mocks.mockStdout.write.mockClear(); // Clear initial enable call
|
|
1296
1281
|
act(() => {
|
|
1297
1282
|
handleGlobalKeypress({
|
|
1298
1283
|
name: 's',
|
|
@@ -1316,7 +1301,7 @@ describe('AppContainer State Management', () => {
|
|
|
1316
1301
|
if (shouldEnable) {
|
|
1317
1302
|
it('should toggle mouse back on when Ctrl+S is pressed again', async () => {
|
|
1318
1303
|
await setupCopyModeTest(isAlternateMode);
|
|
1319
|
-
|
|
1304
|
+
writeToStdout.mockClear();
|
|
1320
1305
|
// Turn it on (disable mouse)
|
|
1321
1306
|
act(() => {
|
|
1322
1307
|
handleGlobalKeypress({
|
|
@@ -1362,7 +1347,7 @@ describe('AppContainer State Management', () => {
|
|
|
1362
1347
|
});
|
|
1363
1348
|
});
|
|
1364
1349
|
rerender();
|
|
1365
|
-
|
|
1350
|
+
writeToStdout.mockClear();
|
|
1366
1351
|
// Press any other key
|
|
1367
1352
|
act(() => {
|
|
1368
1353
|
handleGlobalKeypress({
|
|
@@ -1391,9 +1376,7 @@ describe('AppContainer State Management', () => {
|
|
|
1391
1376
|
closeModelDialog: vi.fn(),
|
|
1392
1377
|
});
|
|
1393
1378
|
const { unmount } = renderAppContainer();
|
|
1394
|
-
await
|
|
1395
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1396
|
-
});
|
|
1379
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1397
1380
|
expect(capturedUIState.isModelDialogOpen).toBe(true);
|
|
1398
1381
|
unmount();
|
|
1399
1382
|
});
|
|
@@ -1405,9 +1388,7 @@ describe('AppContainer State Management', () => {
|
|
|
1405
1388
|
closeModelDialog: mockCloseModelDialog,
|
|
1406
1389
|
});
|
|
1407
1390
|
const { unmount } = renderAppContainer();
|
|
1408
|
-
await
|
|
1409
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1410
|
-
});
|
|
1391
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1411
1392
|
// Verify that the actions are correctly passed through context
|
|
1412
1393
|
act(() => {
|
|
1413
1394
|
capturedUIActions.closeModelDialog();
|
|
@@ -1419,26 +1400,20 @@ describe('AppContainer State Management', () => {
|
|
|
1419
1400
|
describe('CoreEvents Integration', () => {
|
|
1420
1401
|
it('subscribes to UserFeedback and drains backlog on mount', async () => {
|
|
1421
1402
|
const { unmount } = renderAppContainer();
|
|
1422
|
-
await
|
|
1423
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1424
|
-
});
|
|
1403
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1425
1404
|
expect(mockCoreEvents.on).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1426
|
-
expect(mockCoreEvents.
|
|
1405
|
+
expect(mockCoreEvents.drainBacklogs).toHaveBeenCalledTimes(1);
|
|
1427
1406
|
unmount();
|
|
1428
1407
|
});
|
|
1429
1408
|
it('unsubscribes from UserFeedback on unmount', async () => {
|
|
1430
1409
|
const { unmount } = renderAppContainer();
|
|
1431
|
-
await
|
|
1432
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1433
|
-
});
|
|
1410
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1434
1411
|
unmount();
|
|
1435
1412
|
expect(mockCoreEvents.off).toHaveBeenCalledWith(CoreEvent.UserFeedback, expect.any(Function));
|
|
1436
1413
|
});
|
|
1437
1414
|
it('adds history item when UserFeedback event is received', async () => {
|
|
1438
1415
|
const { unmount } = renderAppContainer();
|
|
1439
|
-
await
|
|
1440
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1441
|
-
});
|
|
1416
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1442
1417
|
// Get the registered handler
|
|
1443
1418
|
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.UserFeedback)?.[1];
|
|
1444
1419
|
expect(handler).toBeDefined();
|
|
@@ -1460,10 +1435,8 @@ describe('AppContainer State Management', () => {
|
|
|
1460
1435
|
// Arrange: Mock initial model
|
|
1461
1436
|
vi.spyOn(mockConfig, 'getModel').mockReturnValue('initial-model');
|
|
1462
1437
|
const { unmount } = renderAppContainer();
|
|
1463
|
-
await
|
|
1464
|
-
|
|
1465
|
-
expect(capturedUIState?.currentModel).toBe('initial-model');
|
|
1466
|
-
});
|
|
1438
|
+
await waitFor(() => {
|
|
1439
|
+
expect(capturedUIState?.currentModel).toBe('initial-model');
|
|
1467
1440
|
});
|
|
1468
1441
|
// Get the registered handler for ModelChanged
|
|
1469
1442
|
const handler = mockCoreEvents.on.mock.calls.find((call) => call[0] === CoreEvent.ModelChanged)?.[1];
|
|
@@ -1495,10 +1468,115 @@ describe('AppContainer State Management', () => {
|
|
|
1495
1468
|
});
|
|
1496
1469
|
// The main assertion is that the render does not throw.
|
|
1497
1470
|
const { unmount } = render(_jsx(SettingsContext.Provider, { value: mockSettings, children: _jsx(AppContainer, { config: mockConfig, version: "1.0.0", initializationResult: mockInitResult }) }));
|
|
1471
|
+
await waitFor(() => expect(resizePtySpy).toHaveBeenCalled());
|
|
1472
|
+
unmount();
|
|
1473
|
+
});
|
|
1474
|
+
});
|
|
1475
|
+
describe('Banner Text', () => {
|
|
1476
|
+
it('should render placeholder banner text for USE_GEMINI auth type', async () => {
|
|
1477
|
+
const config = makeFakeConfig();
|
|
1478
|
+
vi.spyOn(config, 'getContentGeneratorConfig').mockReturnValue({
|
|
1479
|
+
authType: AuthType.USE_GEMINI,
|
|
1480
|
+
apiKey: 'fake-key',
|
|
1481
|
+
});
|
|
1482
|
+
const { unmount } = renderAppContainer();
|
|
1483
|
+
await waitFor(() => {
|
|
1484
|
+
expect(capturedUIState.bannerData.defaultText).toBeDefined();
|
|
1485
|
+
unmount();
|
|
1486
|
+
});
|
|
1487
|
+
});
|
|
1488
|
+
});
|
|
1489
|
+
describe('onCancelSubmit Behavior', () => {
|
|
1490
|
+
let mockSetText;
|
|
1491
|
+
// Helper to extract arguments from the useGeminiStream hook call
|
|
1492
|
+
// This isolates the positional argument dependency to a single location
|
|
1493
|
+
const extractUseGeminiStreamArgs = (args) => ({
|
|
1494
|
+
onCancelSubmit: args[13],
|
|
1495
|
+
});
|
|
1496
|
+
beforeEach(() => {
|
|
1497
|
+
mockSetText = vi.fn();
|
|
1498
|
+
mockedUseTextBuffer.mockReturnValue({
|
|
1499
|
+
text: '',
|
|
1500
|
+
setText: mockSetText,
|
|
1501
|
+
});
|
|
1502
|
+
});
|
|
1503
|
+
it('clears the prompt when onCancelSubmit is called with shouldRestorePrompt=false', async () => {
|
|
1504
|
+
const { unmount } = renderAppContainer();
|
|
1505
|
+
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
|
1506
|
+
const { onCancelSubmit } = extractUseGeminiStreamArgs(mockedUseGeminiStream.mock.lastCall);
|
|
1507
|
+
act(() => {
|
|
1508
|
+
onCancelSubmit(false);
|
|
1509
|
+
});
|
|
1510
|
+
expect(mockSetText).toHaveBeenCalledWith('');
|
|
1511
|
+
unmount();
|
|
1512
|
+
});
|
|
1513
|
+
it('restores the prompt when onCancelSubmit is called with shouldRestorePrompt=true (or undefined)', async () => {
|
|
1514
|
+
mockedUseLogger.mockReturnValue({
|
|
1515
|
+
getPreviousUserMessages: vi
|
|
1516
|
+
.fn()
|
|
1517
|
+
.mockResolvedValue(['previous message']),
|
|
1518
|
+
});
|
|
1519
|
+
const { unmount } = renderAppContainer();
|
|
1520
|
+
await waitFor(() => expect(capturedUIState.userMessages).toContain('previous message'));
|
|
1521
|
+
const { onCancelSubmit } = extractUseGeminiStreamArgs(mockedUseGeminiStream.mock.lastCall);
|
|
1498
1522
|
await act(async () => {
|
|
1499
|
-
|
|
1523
|
+
onCancelSubmit(true);
|
|
1524
|
+
});
|
|
1525
|
+
expect(mockSetText).toHaveBeenCalledWith('previous message');
|
|
1526
|
+
unmount();
|
|
1527
|
+
});
|
|
1528
|
+
it('correctly restores prompt even if userMessages is stale (race condition fix)', async () => {
|
|
1529
|
+
// Setup initial history with one message
|
|
1530
|
+
const initialHistory = [{ type: 'user', text: 'Previous Prompt' }];
|
|
1531
|
+
mockedUseHistory.mockReturnValue({
|
|
1532
|
+
history: initialHistory,
|
|
1533
|
+
addItem: vi.fn(),
|
|
1534
|
+
updateItem: vi.fn(),
|
|
1535
|
+
clearItems: vi.fn(),
|
|
1536
|
+
loadHistory: vi.fn(),
|
|
1537
|
+
});
|
|
1538
|
+
let resolveLoggerPromise;
|
|
1539
|
+
const loggerPromise = new Promise((resolve) => {
|
|
1540
|
+
resolveLoggerPromise = resolve;
|
|
1541
|
+
});
|
|
1542
|
+
// Mock logger to control when userMessages updates
|
|
1543
|
+
const getPreviousUserMessagesMock = vi
|
|
1544
|
+
.fn()
|
|
1545
|
+
.mockResolvedValueOnce([]) // Initial mount
|
|
1546
|
+
.mockReturnValueOnce(loggerPromise); // Second render (simulated update)
|
|
1547
|
+
mockedUseLogger.mockReturnValue({
|
|
1548
|
+
getPreviousUserMessages: getPreviousUserMessagesMock,
|
|
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 }];
|
|
1556
|
+
mockedUseHistory.mockReturnValue({
|
|
1557
|
+
history: newHistory,
|
|
1558
|
+
addItem: vi.fn(),
|
|
1559
|
+
updateItem: vi.fn(),
|
|
1560
|
+
clearItems: vi.fn(),
|
|
1561
|
+
loadHistory: vi.fn(),
|
|
1562
|
+
});
|
|
1563
|
+
// Rerender to reflect the history change.
|
|
1564
|
+
// This triggers the effect to update userMessages, but it hangs on loggerPromise.
|
|
1565
|
+
rerender(getAppContainer());
|
|
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);
|
|
1571
|
+
});
|
|
1572
|
+
// Now resolve the promise to let the effect complete and update userMessages
|
|
1573
|
+
await act(async () => {
|
|
1574
|
+
resolveLoggerPromise([]);
|
|
1575
|
+
});
|
|
1576
|
+
// With the fix, it should have waited for userMessages to update and then set the new prompt
|
|
1577
|
+
await waitFor(() => {
|
|
1578
|
+
expect(mockSetText).toHaveBeenCalledWith(newPrompt);
|
|
1500
1579
|
});
|
|
1501
|
-
expect(resizePtySpy).toHaveBeenCalled();
|
|
1502
1580
|
unmount();
|
|
1503
1581
|
});
|
|
1504
1582
|
});
|